//#region \0rolldown/runtime.js
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
	let r = {};
	for (var i in e) t(r, i, {
		get: e[i],
		enumerable: !0
	});
	return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
}, c = (e, i, o, s) => {
	if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
		get: ((e) => i[e]).bind(null, d),
		enumerable: !(s = n(i, d)) || s.enumerable
	});
	return e;
}, l = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
	value: n,
	enumerable: !0
}) : a, n)), u = /* @__PURE__ */ o(((e) => {
	e.byteLength = c, e.toByteArray = u, e.fromByteArray = p;
	for (var t = [], n = [], r = typeof Uint8Array < "u" ? Uint8Array : Array, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a = 0, o = i.length; a < o; ++a) t[a] = i[a], n[i.charCodeAt(a)] = a;
	n[45] = 62, n[95] = 63;
	function s(e) {
		var t = e.length;
		if (t % 4 > 0) throw Error("Invalid string. Length must be a multiple of 4");
		var n = e.indexOf("=");
		n === -1 && (n = t);
		var r = n === t ? 0 : 4 - n % 4;
		return [n, r];
	}
	function c(e) {
		var t = s(e), n = t[0], r = t[1];
		return (n + r) * 3 / 4 - r;
	}
	function l(e, t, n) {
		return (t + n) * 3 / 4 - n;
	}
	function u(e) {
		var t, i = s(e), a = i[0], o = i[1], c = new r(l(e, a, o)), u = 0, d = o > 0 ? a - 4 : a, f;
		for (f = 0; f < d; f += 4) t = n[e.charCodeAt(f)] << 18 | n[e.charCodeAt(f + 1)] << 12 | n[e.charCodeAt(f + 2)] << 6 | n[e.charCodeAt(f + 3)], c[u++] = t >> 16 & 255, c[u++] = t >> 8 & 255, c[u++] = t & 255;
		return o === 2 && (t = n[e.charCodeAt(f)] << 2 | n[e.charCodeAt(f + 1)] >> 4, c[u++] = t & 255), o === 1 && (t = n[e.charCodeAt(f)] << 10 | n[e.charCodeAt(f + 1)] << 4 | n[e.charCodeAt(f + 2)] >> 2, c[u++] = t >> 8 & 255, c[u++] = t & 255), c;
	}
	function d(e) {
		return t[e >> 18 & 63] + t[e >> 12 & 63] + t[e >> 6 & 63] + t[e & 63];
	}
	function f(e, t, n) {
		for (var r, i = [], a = t; a < n; a += 3) r = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (e[a + 2] & 255), i.push(d(r));
		return i.join("");
	}
	function p(e) {
		for (var n, r = e.length, i = r % 3, a = [], o = 16383, s = 0, c = r - i; s < c; s += o) a.push(f(e, s, s + o > c ? c : s + o));
		return i === 1 ? (n = e[r - 1], a.push(t[n >> 2] + t[n << 4 & 63] + "==")) : i === 2 && (n = (e[r - 2] << 8) + e[r - 1], a.push(t[n >> 10] + t[n >> 4 & 63] + t[n << 2 & 63] + "=")), a.join("");
	}
})), d = /* @__PURE__ */ o(((e) => {
	e.read = function(e, t, n, r, i) {
		var a, o, s = i * 8 - r - 1, c = (1 << s) - 1, l = c >> 1, u = -7, d = n ? i - 1 : 0, f = n ? -1 : 1, p = e[t + d];
		for (d += f, a = p & (1 << -u) - 1, p >>= -u, u += s; u > 0; a = a * 256 + e[t + d], d += f, u -= 8);
		for (o = a & (1 << -u) - 1, a >>= -u, u += r; u > 0; o = o * 256 + e[t + d], d += f, u -= 8);
		if (a === 0) a = 1 - l;
		else if (a === c) return o ? NaN : (p ? -1 : 1) * Infinity;
		else o += 2 ** r, a -= l;
		return (p ? -1 : 1) * o * 2 ** (a - r);
	}, e.write = function(e, t, n, r, i, a) {
		var o, s, c, l = a * 8 - i - 1, u = (1 << l) - 1, d = u >> 1, f = i === 23 ? 2 ** -24 - 2 ** -77 : 0, p = r ? 0 : a - 1, m = r ? 1 : -1, h = +(t < 0 || t === 0 && 1 / t < 0);
		for (t = Math.abs(t), isNaN(t) || t === Infinity ? (s = +!!isNaN(t), o = u) : (o = Math.floor(Math.log(t) / Math.LN2), t * (c = 2 ** -o) < 1 && (o--, c *= 2), o + d >= 1 ? t += f / c : t += f * 2 ** (1 - d), t * c >= 2 && (o++, c /= 2), o + d >= u ? (s = 0, o = u) : o + d >= 1 ? (s = (t * c - 1) * 2 ** i, o += d) : (s = t * 2 ** (d - 1) * 2 ** i, o = 0)); i >= 8; e[n + p] = s & 255, p += m, s /= 256, i -= 8);
		for (o = o << i | s, l += i; l > 0; e[n + p] = o & 255, p += m, o /= 256, l -= 8);
		e[n + p - m] |= h * 128;
	};
})), f = /* @__PURE__ */ o(((e) => {
	var t = u(), n = d(), r = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
	e.Buffer = s, e.SlowBuffer = b, e.INSPECT_MAX_BYTES = 50;
	var i = 2147483647;
	e.kMaxLength = i, s.TYPED_ARRAY_SUPPORT = a(), !s.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");
	function a() {
		try {
			let e = /* @__PURE__ */ new Uint8Array(1), t = { foo: function() {
				return 42;
			} };
			return Object.setPrototypeOf(t, Uint8Array.prototype), Object.setPrototypeOf(e, t), e.foo() === 42;
		} catch {
			return !1;
		}
	}
	Object.defineProperty(s.prototype, "parent", {
		enumerable: !0,
		get: function() {
			if (s.isBuffer(this)) return this.buffer;
		}
	}), Object.defineProperty(s.prototype, "offset", {
		enumerable: !0,
		get: function() {
			if (s.isBuffer(this)) return this.byteOffset;
		}
	});
	function o(e) {
		if (e > i) throw RangeError("The value \"" + e + "\" is invalid for option \"size\"");
		let t = new Uint8Array(e);
		return Object.setPrototypeOf(t, s.prototype), t;
	}
	function s(e, t, n) {
		if (typeof e == "number") {
			if (typeof t == "string") throw TypeError("The \"string\" argument must be of type string. Received type number");
			return p(e);
		}
		return c(e, t, n);
	}
	s.poolSize = 8192;
	function c(e, t, n) {
		if (typeof e == "string") return m(e, t);
		if (ArrayBuffer.isView(e)) return g(e);
		if (e == null) throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
		if (U(e, ArrayBuffer) || e && U(e.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (U(e, SharedArrayBuffer) || e && U(e.buffer, SharedArrayBuffer))) return _(e, t, n);
		if (typeof e == "number") throw TypeError("The \"value\" argument must not be of type number. Received type number");
		let r = e.valueOf && e.valueOf();
		if (r != null && r !== e) return s.from(r, t, n);
		let i = v(e);
		if (i) return i;
		if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof e[Symbol.toPrimitive] == "function") return s.from(e[Symbol.toPrimitive]("string"), t, n);
		throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
	}
	s.from = function(e, t, n) {
		return c(e, t, n);
	}, Object.setPrototypeOf(s.prototype, Uint8Array.prototype), Object.setPrototypeOf(s, Uint8Array);
	function l(e) {
		if (typeof e != "number") throw TypeError("\"size\" argument must be of type number");
		if (e < 0) throw RangeError("The value \"" + e + "\" is invalid for option \"size\"");
	}
	function f(e, t, n) {
		return l(e), e <= 0 || t === void 0 ? o(e) : typeof n == "string" ? o(e).fill(t, n) : o(e).fill(t);
	}
	s.alloc = function(e, t, n) {
		return f(e, t, n);
	};
	function p(e) {
		return l(e), o(e < 0 ? 0 : y(e) | 0);
	}
	s.allocUnsafe = function(e) {
		return p(e);
	}, s.allocUnsafeSlow = function(e) {
		return p(e);
	};
	function m(e, t) {
		if ((typeof t != "string" || t === "") && (t = "utf8"), !s.isEncoding(t)) throw TypeError("Unknown encoding: " + t);
		let n = x(e, t) | 0, r = o(n), i = r.write(e, t);
		return i !== n && (r = r.slice(0, i)), r;
	}
	function h(e) {
		let t = e.length < 0 ? 0 : y(e.length) | 0, n = o(t);
		for (let r = 0; r < t; r += 1) n[r] = e[r] & 255;
		return n;
	}
	function g(e) {
		if (U(e, Uint8Array)) {
			let t = new Uint8Array(e);
			return _(t.buffer, t.byteOffset, t.byteLength);
		}
		return h(e);
	}
	function _(e, t, n) {
		if (t < 0 || e.byteLength < t) throw RangeError("\"offset\" is outside of buffer bounds");
		if (e.byteLength < t + (n || 0)) throw RangeError("\"length\" is outside of buffer bounds");
		let r;
		return r = t === void 0 && n === void 0 ? new Uint8Array(e) : n === void 0 ? new Uint8Array(e, t) : new Uint8Array(e, t, n), Object.setPrototypeOf(r, s.prototype), r;
	}
	function v(e) {
		if (s.isBuffer(e)) {
			let t = y(e.length) | 0, n = o(t);
			return n.length === 0 || e.copy(n, 0, 0, t), n;
		}
		if (e.length !== void 0) return typeof e.length != "number" || W(e.length) ? o(0) : h(e);
		if (e.type === "Buffer" && Array.isArray(e.data)) return h(e.data);
	}
	function y(e) {
		if (e >= i) throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i.toString(16) + " bytes");
		return e | 0;
	}
	function b(e) {
		return +e != e && (e = 0), s.alloc(+e);
	}
	s.isBuffer = function(e) {
		return e != null && e._isBuffer === !0 && e !== s.prototype;
	}, s.compare = function(e, t) {
		if (U(e, Uint8Array) && (e = s.from(e, e.offset, e.byteLength)), U(t, Uint8Array) && (t = s.from(t, t.offset, t.byteLength)), !s.isBuffer(e) || !s.isBuffer(t)) throw TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
		if (e === t) return 0;
		let n = e.length, r = t.length;
		for (let i = 0, a = Math.min(n, r); i < a; ++i) if (e[i] !== t[i]) {
			n = e[i], r = t[i];
			break;
		}
		return n < r ? -1 : +(r < n);
	}, s.isEncoding = function(e) {
		switch (String(e).toLowerCase()) {
			case "hex":
			case "utf8":
			case "utf-8":
			case "ascii":
			case "latin1":
			case "binary":
			case "base64":
			case "ucs2":
			case "ucs-2":
			case "utf16le":
			case "utf-16le": return !0;
			default: return !1;
		}
	}, s.concat = function(e, t) {
		if (!Array.isArray(e)) throw TypeError("\"list\" argument must be an Array of Buffers");
		if (e.length === 0) return s.alloc(0);
		let n;
		if (t === void 0) for (t = 0, n = 0; n < e.length; ++n) t += e[n].length;
		let r = s.allocUnsafe(t), i = 0;
		for (n = 0; n < e.length; ++n) {
			let t = e[n];
			if (U(t, Uint8Array)) i + t.length > r.length ? (s.isBuffer(t) || (t = s.from(t)), t.copy(r, i)) : Uint8Array.prototype.set.call(r, t, i);
			else if (s.isBuffer(t)) t.copy(r, i);
			else throw TypeError("\"list\" argument must be an Array of Buffers");
			i += t.length;
		}
		return r;
	};
	function x(e, t) {
		if (s.isBuffer(e)) return e.length;
		if (ArrayBuffer.isView(e) || U(e, ArrayBuffer)) return e.byteLength;
		if (typeof e != "string") throw TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof e);
		let n = e.length, r = arguments.length > 2 && arguments[2] === !0;
		if (!r && n === 0) return 0;
		let i = !1;
		for (;;) switch (t) {
			case "ascii":
			case "latin1":
			case "binary": return n;
			case "utf8":
			case "utf-8": return pe(e).length;
			case "ucs2":
			case "ucs-2":
			case "utf16le":
			case "utf-16le": return n * 2;
			case "hex": return n >>> 1;
			case "base64": return ge(e).length;
			default:
				if (i) return r ? -1 : pe(e).length;
				t = ("" + t).toLowerCase(), i = !0;
		}
	}
	s.byteLength = x;
	function S(e, t, n) {
		let r = !1;
		if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((n === void 0 || n > this.length) && (n = this.length), n <= 0) || (n >>>= 0, t >>>= 0, n <= t)) return "";
		for (e ||= "utf8";;) switch (e) {
			case "hex": return ae(this, t, n);
			case "utf8":
			case "utf-8": return k(this, t, n);
			case "ascii": return re(this, t, n);
			case "latin1":
			case "binary": return ie(this, t, n);
			case "base64": return O(this, t, n);
			case "ucs2":
			case "ucs-2":
			case "utf16le":
			case "utf-16le": return oe(this, t, n);
			default:
				if (r) throw TypeError("Unknown encoding: " + e);
				e = (e + "").toLowerCase(), r = !0;
		}
	}
	s.prototype._isBuffer = !0;
	function C(e, t, n) {
		let r = e[t];
		e[t] = e[n], e[n] = r;
	}
	s.prototype.swap16 = function() {
		let e = this.length;
		if (e % 2 != 0) throw RangeError("Buffer size must be a multiple of 16-bits");
		for (let t = 0; t < e; t += 2) C(this, t, t + 1);
		return this;
	}, s.prototype.swap32 = function() {
		let e = this.length;
		if (e % 4 != 0) throw RangeError("Buffer size must be a multiple of 32-bits");
		for (let t = 0; t < e; t += 4) C(this, t, t + 3), C(this, t + 1, t + 2);
		return this;
	}, s.prototype.swap64 = function() {
		let e = this.length;
		if (e % 8 != 0) throw RangeError("Buffer size must be a multiple of 64-bits");
		for (let t = 0; t < e; t += 8) C(this, t, t + 7), C(this, t + 1, t + 6), C(this, t + 2, t + 5), C(this, t + 3, t + 4);
		return this;
	}, s.prototype.toString = function() {
		let e = this.length;
		return e === 0 ? "" : arguments.length === 0 ? k(this, 0, e) : S.apply(this, arguments);
	}, s.prototype.toLocaleString = s.prototype.toString, s.prototype.equals = function(e) {
		if (!s.isBuffer(e)) throw TypeError("Argument must be a Buffer");
		return this === e || s.compare(this, e) === 0;
	}, s.prototype.inspect = function() {
		let t = "", n = e.INSPECT_MAX_BYTES;
		return t = this.toString("hex", 0, n).replace(/(.{2})/g, "$1 ").trim(), this.length > n && (t += " ... "), "<Buffer " + t + ">";
	}, r && (s.prototype[r] = s.prototype.inspect), s.prototype.compare = function(e, t, n, r, i) {
		if (U(e, Uint8Array) && (e = s.from(e, e.offset, e.byteLength)), !s.isBuffer(e)) throw TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof e);
		if (t === void 0 && (t = 0), n === void 0 && (n = e ? e.length : 0), r === void 0 && (r = 0), i === void 0 && (i = this.length), t < 0 || n > e.length || r < 0 || i > this.length) throw RangeError("out of range index");
		if (r >= i && t >= n) return 0;
		if (r >= i) return -1;
		if (t >= n) return 1;
		if (t >>>= 0, n >>>= 0, r >>>= 0, i >>>= 0, this === e) return 0;
		let a = i - r, o = n - t, c = Math.min(a, o), l = this.slice(r, i), u = e.slice(t, n);
		for (let e = 0; e < c; ++e) if (l[e] !== u[e]) {
			a = l[e], o = u[e];
			break;
		}
		return a < o ? -1 : +(o < a);
	};
	function w(e, t, n, r, i) {
		if (e.length === 0) return -1;
		if (typeof n == "string" ? (r = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, W(n) && (n = i ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) {
			if (i) return -1;
			n = e.length - 1;
		} else if (n < 0) if (i) n = 0;
		else return -1;
		if (typeof t == "string" && (t = s.from(t, r)), s.isBuffer(t)) return t.length === 0 ? -1 : T(e, t, n, r, i);
		if (typeof t == "number") return t &= 255, typeof Uint8Array.prototype.indexOf == "function" ? i ? Uint8Array.prototype.indexOf.call(e, t, n) : Uint8Array.prototype.lastIndexOf.call(e, t, n) : T(e, [t], n, r, i);
		throw TypeError("val must be string, number or Buffer");
	}
	function T(e, t, n, r, i) {
		let a = 1, o = e.length, s = t.length;
		if (r !== void 0 && (r = String(r).toLowerCase(), r === "ucs2" || r === "ucs-2" || r === "utf16le" || r === "utf-16le")) {
			if (e.length < 2 || t.length < 2) return -1;
			a = 2, o /= 2, s /= 2, n /= 2;
		}
		function c(e, t) {
			return a === 1 ? e[t] : e.readUInt16BE(t * a);
		}
		let l;
		if (i) {
			let r = -1;
			for (l = n; l < o; l++) if (c(e, l) === c(t, r === -1 ? 0 : l - r)) {
				if (r === -1 && (r = l), l - r + 1 === s) return r * a;
			} else r !== -1 && (l -= l - r), r = -1;
		} else for (n + s > o && (n = o - s), l = n; l >= 0; l--) {
			let n = !0;
			for (let r = 0; r < s; r++) if (c(e, l + r) !== c(t, r)) {
				n = !1;
				break;
			}
			if (n) return l;
		}
		return -1;
	}
	s.prototype.includes = function(e, t, n) {
		return this.indexOf(e, t, n) !== -1;
	}, s.prototype.indexOf = function(e, t, n) {
		return w(this, e, t, n, !0);
	}, s.prototype.lastIndexOf = function(e, t, n) {
		return w(this, e, t, n, !1);
	};
	function E(e, t, n, r) {
		n = Number(n) || 0;
		let i = e.length - n;
		r ? (r = Number(r), r > i && (r = i)) : r = i;
		let a = t.length;
		r > a / 2 && (r = a / 2);
		let o;
		for (o = 0; o < r; ++o) {
			let r = parseInt(t.substr(o * 2, 2), 16);
			if (W(r)) return o;
			e[n + o] = r;
		}
		return o;
	}
	function ee(e, t, n, r) {
		return H(pe(t, e.length - n), e, n, r);
	}
	function te(e, t, n, r) {
		return H(me(t), e, n, r);
	}
	function ne(e, t, n, r) {
		return H(ge(t), e, n, r);
	}
	function D(e, t, n, r) {
		return H(he(t, e.length - n), e, n, r);
	}
	s.prototype.write = function(e, t, n, r) {
		if (t === void 0) r = "utf8", n = this.length, t = 0;
		else if (n === void 0 && typeof t == "string") r = t, n = this.length, t = 0;
		else if (isFinite(t)) t >>>= 0, isFinite(n) ? (n >>>= 0, r === void 0 && (r = "utf8")) : (r = n, n = void 0);
		else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
		let i = this.length - t;
		if ((n === void 0 || n > i) && (n = i), e.length > 0 && (n < 0 || t < 0) || t > this.length) throw RangeError("Attempt to write outside buffer bounds");
		r ||= "utf8";
		let a = !1;
		for (;;) switch (r) {
			case "hex": return E(this, e, t, n);
			case "utf8":
			case "utf-8": return ee(this, e, t, n);
			case "ascii":
			case "latin1":
			case "binary": return te(this, e, t, n);
			case "base64": return ne(this, e, t, n);
			case "ucs2":
			case "ucs-2":
			case "utf16le":
			case "utf-16le": return D(this, e, t, n);
			default:
				if (a) throw TypeError("Unknown encoding: " + r);
				r = ("" + r).toLowerCase(), a = !0;
		}
	}, s.prototype.toJSON = function() {
		return {
			type: "Buffer",
			data: Array.prototype.slice.call(this._arr || this, 0)
		};
	};
	function O(e, n, r) {
		return n === 0 && r === e.length ? t.fromByteArray(e) : t.fromByteArray(e.slice(n, r));
	}
	function k(e, t, n) {
		n = Math.min(e.length, n);
		let r = [], i = t;
		for (; i < n;) {
			let t = e[i], a = null, o = t > 239 ? 4 : t > 223 ? 3 : t > 191 ? 2 : 1;
			if (i + o <= n) {
				let n, r, s, c;
				switch (o) {
					case 1:
						t < 128 && (a = t);
						break;
					case 2:
						n = e[i + 1], (n & 192) == 128 && (c = (t & 31) << 6 | n & 63, c > 127 && (a = c));
						break;
					case 3:
						n = e[i + 1], r = e[i + 2], (n & 192) == 128 && (r & 192) == 128 && (c = (t & 15) << 12 | (n & 63) << 6 | r & 63, c > 2047 && (c < 55296 || c > 57343) && (a = c));
						break;
					case 4: n = e[i + 1], r = e[i + 2], s = e[i + 3], (n & 192) == 128 && (r & 192) == 128 && (s & 192) == 128 && (c = (t & 15) << 18 | (n & 63) << 12 | (r & 63) << 6 | s & 63, c > 65535 && c < 1114112 && (a = c));
				}
			}
			a === null ? (a = 65533, o = 1) : a > 65535 && (a -= 65536, r.push(a >>> 10 & 1023 | 55296), a = 56320 | a & 1023), r.push(a), i += o;
		}
		return j(r);
	}
	var A = 4096;
	function j(e) {
		let t = e.length;
		if (t <= A) return String.fromCharCode.apply(String, e);
		let n = "", r = 0;
		for (; r < t;) n += String.fromCharCode.apply(String, e.slice(r, r += A));
		return n;
	}
	function re(e, t, n) {
		let r = "";
		n = Math.min(e.length, n);
		for (let i = t; i < n; ++i) r += String.fromCharCode(e[i] & 127);
		return r;
	}
	function ie(e, t, n) {
		let r = "";
		n = Math.min(e.length, n);
		for (let i = t; i < n; ++i) r += String.fromCharCode(e[i]);
		return r;
	}
	function ae(e, t, n) {
		let r = e.length;
		(!t || t < 0) && (t = 0), (!n || n < 0 || n > r) && (n = r);
		let i = "";
		for (let r = t; r < n; ++r) i += G[e[r]];
		return i;
	}
	function oe(e, t, n) {
		let r = e.slice(t, n), i = "";
		for (let e = 0; e < r.length - 1; e += 2) i += String.fromCharCode(r[e] + r[e + 1] * 256);
		return i;
	}
	s.prototype.slice = function(e, t) {
		let n = this.length;
		e = ~~e, t = t === void 0 ? n : ~~t, e < 0 ? (e += n, e < 0 && (e = 0)) : e > n && (e = n), t < 0 ? (t += n, t < 0 && (t = 0)) : t > n && (t = n), t < e && (t = e);
		let r = this.subarray(e, t);
		return Object.setPrototypeOf(r, s.prototype), r;
	};
	function M(e, t, n) {
		if (e % 1 != 0 || e < 0) throw RangeError("offset is not uint");
		if (e + t > n) throw RangeError("Trying to access beyond buffer length");
	}
	s.prototype.readUintLE = s.prototype.readUIntLE = function(e, t, n) {
		e >>>= 0, t >>>= 0, n || M(e, t, this.length);
		let r = this[e], i = 1, a = 0;
		for (; ++a < t && (i *= 256);) r += this[e + a] * i;
		return r;
	}, s.prototype.readUintBE = s.prototype.readUIntBE = function(e, t, n) {
		e >>>= 0, t >>>= 0, n || M(e, t, this.length);
		let r = this[e + --t], i = 1;
		for (; t > 0 && (i *= 256);) r += this[e + --t] * i;
		return r;
	}, s.prototype.readUint8 = s.prototype.readUInt8 = function(e, t) {
		return e >>>= 0, t || M(e, 1, this.length), this[e];
	}, s.prototype.readUint16LE = s.prototype.readUInt16LE = function(e, t) {
		return e >>>= 0, t || M(e, 2, this.length), this[e] | this[e + 1] << 8;
	}, s.prototype.readUint16BE = s.prototype.readUInt16BE = function(e, t) {
		return e >>>= 0, t || M(e, 2, this.length), this[e] << 8 | this[e + 1];
	}, s.prototype.readUint32LE = s.prototype.readUInt32LE = function(e, t) {
		return e >>>= 0, t || M(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
	}, s.prototype.readUint32BE = s.prototype.readUInt32BE = function(e, t) {
		return e >>>= 0, t || M(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
	}, s.prototype.readBigUInt64LE = _e(function(e) {
		e >>>= 0, R(e, "offset");
		let t = this[e], n = this[e + 7];
		(t === void 0 || n === void 0) && z(e, this.length - 8);
		let r = t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24, i = this[++e] + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + n * 2 ** 24;
		return BigInt(r) + (BigInt(i) << BigInt(32));
	}), s.prototype.readBigUInt64BE = _e(function(e) {
		e >>>= 0, R(e, "offset");
		let t = this[e], n = this[e + 7];
		(t === void 0 || n === void 0) && z(e, this.length - 8);
		let r = t * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e], i = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n;
		return (BigInt(r) << BigInt(32)) + BigInt(i);
	}), s.prototype.readIntLE = function(e, t, n) {
		e >>>= 0, t >>>= 0, n || M(e, t, this.length);
		let r = this[e], i = 1, a = 0;
		for (; ++a < t && (i *= 256);) r += this[e + a] * i;
		return i *= 128, r >= i && (r -= 2 ** (8 * t)), r;
	}, s.prototype.readIntBE = function(e, t, n) {
		e >>>= 0, t >>>= 0, n || M(e, t, this.length);
		let r = t, i = 1, a = this[e + --r];
		for (; r > 0 && (i *= 256);) a += this[e + --r] * i;
		return i *= 128, a >= i && (a -= 2 ** (8 * t)), a;
	}, s.prototype.readInt8 = function(e, t) {
		return e >>>= 0, t || M(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
	}, s.prototype.readInt16LE = function(e, t) {
		e >>>= 0, t || M(e, 2, this.length);
		let n = this[e] | this[e + 1] << 8;
		return n & 32768 ? n | 4294901760 : n;
	}, s.prototype.readInt16BE = function(e, t) {
		e >>>= 0, t || M(e, 2, this.length);
		let n = this[e + 1] | this[e] << 8;
		return n & 32768 ? n | 4294901760 : n;
	}, s.prototype.readInt32LE = function(e, t) {
		return e >>>= 0, t || M(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
	}, s.prototype.readInt32BE = function(e, t) {
		return e >>>= 0, t || M(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
	}, s.prototype.readBigInt64LE = _e(function(e) {
		e >>>= 0, R(e, "offset");
		let t = this[e], n = this[e + 7];
		(t === void 0 || n === void 0) && z(e, this.length - 8);
		let r = this[e + 4] + this[e + 5] * 2 ** 8 + this[e + 6] * 2 ** 16 + (n << 24);
		return (BigInt(r) << BigInt(32)) + BigInt(t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24);
	}), s.prototype.readBigInt64BE = _e(function(e) {
		e >>>= 0, R(e, "offset");
		let t = this[e], n = this[e + 7];
		(t === void 0 || n === void 0) && z(e, this.length - 8);
		let r = (t << 24) + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
		return (BigInt(r) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n);
	}), s.prototype.readFloatLE = function(e, t) {
		return e >>>= 0, t || M(e, 4, this.length), n.read(this, e, !0, 23, 4);
	}, s.prototype.readFloatBE = function(e, t) {
		return e >>>= 0, t || M(e, 4, this.length), n.read(this, e, !1, 23, 4);
	}, s.prototype.readDoubleLE = function(e, t) {
		return e >>>= 0, t || M(e, 8, this.length), n.read(this, e, !0, 52, 8);
	}, s.prototype.readDoubleBE = function(e, t) {
		return e >>>= 0, t || M(e, 8, this.length), n.read(this, e, !1, 52, 8);
	};
	function se(e, t, n, r, i, a) {
		if (!s.isBuffer(e)) throw TypeError("\"buffer\" argument must be a Buffer instance");
		if (t > i || t < a) throw RangeError("\"value\" argument is out of bounds");
		if (n + r > e.length) throw RangeError("Index out of range");
	}
	s.prototype.writeUintLE = s.prototype.writeUIntLE = function(e, t, n, r) {
		if (e = +e, t >>>= 0, n >>>= 0, !r) {
			let r = 2 ** (8 * n) - 1;
			se(this, e, t, n, r, 0);
		}
		let i = 1, a = 0;
		for (this[t] = e & 255; ++a < n && (i *= 256);) this[t + a] = e / i & 255;
		return t + n;
	}, s.prototype.writeUintBE = s.prototype.writeUIntBE = function(e, t, n, r) {
		if (e = +e, t >>>= 0, n >>>= 0, !r) {
			let r = 2 ** (8 * n) - 1;
			se(this, e, t, n, r, 0);
		}
		let i = n - 1, a = 1;
		for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) this[t + i] = e / a & 255;
		return t + n;
	}, s.prototype.writeUint8 = s.prototype.writeUInt8 = function(e, t, n) {
		return e = +e, t >>>= 0, n || se(this, e, t, 1, 255, 0), this[t] = e & 255, t + 1;
	}, s.prototype.writeUint16LE = s.prototype.writeUInt16LE = function(e, t, n) {
		return e = +e, t >>>= 0, n || se(this, e, t, 2, 65535, 0), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
	}, s.prototype.writeUint16BE = s.prototype.writeUInt16BE = function(e, t, n) {
		return e = +e, t >>>= 0, n || se(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
	}, s.prototype.writeUint32LE = s.prototype.writeUInt32LE = function(e, t, n) {
		return e = +e, t >>>= 0, n || se(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = e & 255, t + 4;
	}, s.prototype.writeUint32BE = s.prototype.writeUInt32BE = function(e, t, n) {
		return e = +e, t >>>= 0, n || se(this, e, t, 4, 4294967295, 0), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
	};
	function N(e, t, n, r, i) {
		L(t, r, i, e, n, 7);
		let a = Number(t & BigInt(4294967295));
		e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a, a >>= 8, e[n++] = a;
		let o = Number(t >> BigInt(32) & BigInt(4294967295));
		return e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, o >>= 8, e[n++] = o, n;
	}
	function ce(e, t, n, r, i) {
		L(t, r, i, e, n, 7);
		let a = Number(t & BigInt(4294967295));
		e[n + 7] = a, a >>= 8, e[n + 6] = a, a >>= 8, e[n + 5] = a, a >>= 8, e[n + 4] = a;
		let o = Number(t >> BigInt(32) & BigInt(4294967295));
		return e[n + 3] = o, o >>= 8, e[n + 2] = o, o >>= 8, e[n + 1] = o, o >>= 8, e[n] = o, n + 8;
	}
	s.prototype.writeBigUInt64LE = _e(function(e, t = 0) {
		return N(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
	}), s.prototype.writeBigUInt64BE = _e(function(e, t = 0) {
		return ce(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
	}), s.prototype.writeIntLE = function(e, t, n, r) {
		if (e = +e, t >>>= 0, !r) {
			let r = 2 ** (8 * n - 1);
			se(this, e, t, n, r - 1, -r);
		}
		let i = 0, a = 1, o = 0;
		for (this[t] = e & 255; ++i < n && (a *= 256);) e < 0 && o === 0 && this[t + i - 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
		return t + n;
	}, s.prototype.writeIntBE = function(e, t, n, r) {
		if (e = +e, t >>>= 0, !r) {
			let r = 2 ** (8 * n - 1);
			se(this, e, t, n, r - 1, -r);
		}
		let i = n - 1, a = 1, o = 0;
		for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) e < 0 && o === 0 && this[t + i + 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
		return t + n;
	}, s.prototype.writeInt8 = function(e, t, n) {
		return e = +e, t >>>= 0, n || se(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
	}, s.prototype.writeInt16LE = function(e, t, n) {
		return e = +e, t >>>= 0, n || se(this, e, t, 2, 32767, -32768), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
	}, s.prototype.writeInt16BE = function(e, t, n) {
		return e = +e, t >>>= 0, n || se(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
	}, s.prototype.writeInt32LE = function(e, t, n) {
		return e = +e, t >>>= 0, n || se(this, e, t, 4, 2147483647, -2147483648), this[t] = e & 255, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4;
	}, s.prototype.writeInt32BE = function(e, t, n) {
		return e = +e, t >>>= 0, n || se(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
	}, s.prototype.writeBigInt64LE = _e(function(e, t = 0) {
		return N(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
	}), s.prototype.writeBigInt64BE = _e(function(e, t = 0) {
		return ce(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
	});
	function P(e, t, n, r, i, a) {
		if (n + r > e.length || n < 0) throw RangeError("Index out of range");
	}
	function F(e, t, r, i, a) {
		return t = +t, r >>>= 0, a || P(e, t, r, 4, 34028234663852886e22, -34028234663852886e22), n.write(e, t, r, i, 23, 4), r + 4;
	}
	s.prototype.writeFloatLE = function(e, t, n) {
		return F(this, e, t, !0, n);
	}, s.prototype.writeFloatBE = function(e, t, n) {
		return F(this, e, t, !1, n);
	};
	function I(e, t, r, i, a) {
		return t = +t, r >>>= 0, a || P(e, t, r, 8, 17976931348623157e292, -17976931348623157e292), n.write(e, t, r, i, 52, 8), r + 8;
	}
	s.prototype.writeDoubleLE = function(e, t, n) {
		return I(this, e, t, !0, n);
	}, s.prototype.writeDoubleBE = function(e, t, n) {
		return I(this, e, t, !1, n);
	}, s.prototype.copy = function(e, t, n, r) {
		if (!s.isBuffer(e)) throw TypeError("argument should be a Buffer");
		if (n ||= 0, !r && r !== 0 && (r = this.length), t >= e.length && (t = e.length), t ||= 0, r > 0 && r < n && (r = n), r === n || e.length === 0 || this.length === 0) return 0;
		if (t < 0) throw RangeError("targetStart out of bounds");
		if (n < 0 || n >= this.length) throw RangeError("Index out of range");
		if (r < 0) throw RangeError("sourceEnd out of bounds");
		r > this.length && (r = this.length), e.length - t < r - n && (r = e.length - t + n);
		let i = r - n;
		return this === e && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(t, n, r) : Uint8Array.prototype.set.call(e, this.subarray(n, r), t), i;
	}, s.prototype.fill = function(e, t, n, r) {
		if (typeof e == "string") {
			if (typeof t == "string" ? (r = t, t = 0, n = this.length) : typeof n == "string" && (r = n, n = this.length), r !== void 0 && typeof r != "string") throw TypeError("encoding must be a string");
			if (typeof r == "string" && !s.isEncoding(r)) throw TypeError("Unknown encoding: " + r);
			if (e.length === 1) {
				let t = e.charCodeAt(0);
				(r === "utf8" && t < 128 || r === "latin1") && (e = t);
			}
		} else typeof e == "number" ? e &= 255 : typeof e == "boolean" && (e = Number(e));
		if (t < 0 || this.length < t || this.length < n) throw RangeError("Out of range index");
		if (n <= t) return this;
		t >>>= 0, n = n === void 0 ? this.length : n >>> 0, e ||= 0;
		let i;
		if (typeof e == "number") for (i = t; i < n; ++i) this[i] = e;
		else {
			let a = s.isBuffer(e) ? e : s.from(e, r), o = a.length;
			if (o === 0) throw TypeError("The value \"" + e + "\" is invalid for argument \"value\"");
			for (i = 0; i < n - t; ++i) this[i + t] = a[i % o];
		}
		return this;
	};
	var le = {};
	function ue(e, t, n) {
		le[e] = class extends n {
			constructor() {
				super(), Object.defineProperty(this, "message", {
					value: t.apply(this, arguments),
					writable: !0,
					configurable: !0
				}), this.name = `${this.name} [${e}]`, this.stack, delete this.name;
			}
			get code() {
				return e;
			}
			set code(e) {
				Object.defineProperty(this, "code", {
					configurable: !0,
					enumerable: !0,
					value: e,
					writable: !0
				});
			}
			toString() {
				return `${this.name} [${e}]: ${this.message}`;
			}
		};
	}
	ue("ERR_BUFFER_OUT_OF_BOUNDS", function(e) {
		return e ? `${e} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
	}, RangeError), ue("ERR_INVALID_ARG_TYPE", function(e, t) {
		return `The "${e}" argument must be of type number. Received type ${typeof t}`;
	}, TypeError), ue("ERR_OUT_OF_RANGE", function(e, t, n) {
		let r = `The value of "${e}" is out of range.`, i = n;
		return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? i = de(String(n)) : typeof n == "bigint" && (i = String(n), (n > BigInt(2) ** BigInt(32) || n < -(BigInt(2) ** BigInt(32))) && (i = de(i)), i += "n"), r += ` It must be ${t}. Received ${i}`, r;
	}, RangeError);
	function de(e) {
		let t = "", n = e.length, r = +(e[0] === "-");
		for (; n >= r + 4; n -= 3) t = `_${e.slice(n - 3, n)}${t}`;
		return `${e.slice(0, n)}${t}`;
	}
	function fe(e, t, n) {
		R(t, "offset"), (e[t] === void 0 || e[t + n] === void 0) && z(t, e.length - (n + 1));
	}
	function L(e, t, n, r, i, a) {
		if (e > n || e < t) {
			let r = typeof t == "bigint" ? "n" : "", i;
			throw i = a > 3 ? t === 0 || t === BigInt(0) ? `>= 0${r} and < 2${r} ** ${(a + 1) * 8}${r}` : `>= -(2${r} ** ${(a + 1) * 8 - 1}${r}) and < 2 ** ${(a + 1) * 8 - 1}${r}` : `>= ${t}${r} and <= ${n}${r}`, new le.ERR_OUT_OF_RANGE("value", i, e);
		}
		fe(r, i, a);
	}
	function R(e, t) {
		if (typeof e != "number") throw new le.ERR_INVALID_ARG_TYPE(t, "number", e);
	}
	function z(e, t, n) {
		throw Math.floor(e) === e ? t < 0 ? new le.ERR_BUFFER_OUT_OF_BOUNDS() : new le.ERR_OUT_OF_RANGE(n || "offset", `>= ${+!!n} and <= ${t}`, e) : (R(e, n), new le.ERR_OUT_OF_RANGE(n || "offset", "an integer", e));
	}
	var B = /[^+/0-9A-Za-z-_]/g;
	function V(e) {
		if (e = e.split("=")[0], e = e.trim().replace(B, ""), e.length < 2) return "";
		for (; e.length % 4 != 0;) e += "=";
		return e;
	}
	function pe(e, t) {
		t ||= Infinity;
		let n, r = e.length, i = null, a = [];
		for (let o = 0; o < r; ++o) {
			if (n = e.charCodeAt(o), n > 55295 && n < 57344) {
				if (!i) {
					if (n > 56319) {
						(t -= 3) > -1 && a.push(239, 191, 189);
						continue;
					} else if (o + 1 === r) {
						(t -= 3) > -1 && a.push(239, 191, 189);
						continue;
					}
					i = n;
					continue;
				}
				if (n < 56320) {
					(t -= 3) > -1 && a.push(239, 191, 189), i = n;
					continue;
				}
				n = (i - 55296 << 10 | n - 56320) + 65536;
			} else i && (t -= 3) > -1 && a.push(239, 191, 189);
			if (i = null, n < 128) {
				if (--t < 0) break;
				a.push(n);
			} else if (n < 2048) {
				if ((t -= 2) < 0) break;
				a.push(n >> 6 | 192, n & 63 | 128);
			} else if (n < 65536) {
				if ((t -= 3) < 0) break;
				a.push(n >> 12 | 224, n >> 6 & 63 | 128, n & 63 | 128);
			} else if (n < 1114112) {
				if ((t -= 4) < 0) break;
				a.push(n >> 18 | 240, n >> 12 & 63 | 128, n >> 6 & 63 | 128, n & 63 | 128);
			} else throw Error("Invalid code point");
		}
		return a;
	}
	function me(e) {
		let t = [];
		for (let n = 0; n < e.length; ++n) t.push(e.charCodeAt(n) & 255);
		return t;
	}
	function he(e, t) {
		let n, r, i, a = [];
		for (let o = 0; o < e.length && !((t -= 2) < 0); ++o) n = e.charCodeAt(o), r = n >> 8, i = n % 256, a.push(i), a.push(r);
		return a;
	}
	function ge(e) {
		return t.toByteArray(V(e));
	}
	function H(e, t, n, r) {
		let i;
		for (i = 0; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i];
		return i;
	}
	function U(e, t) {
		return e instanceof t || e != null && e.constructor != null && e.constructor.name != null && e.constructor.name === t.name;
	}
	function W(e) {
		return e !== e;
	}
	var G = (function() {
		let e = "0123456789abcdef", t = Array(256);
		for (let n = 0; n < 16; ++n) {
			let r = n * 16;
			for (let i = 0; i < 16; ++i) t[r + i] = e[n] + e[i];
		}
		return t;
	})();
	function _e(e) {
		return typeof BigInt > "u" ? ve : e;
	}
	function ve() {
		throw Error("BigInt not supported");
	}
})), p = f();
function m(e) {
	return e.replace(/\\/g, "/").replace(/^\.\//, "");
}
function h(e) {
	let t = new Map(e.map((e) => [e.id, e])), n = /* @__PURE__ */ new Set(), r = [], i = (e, a) => {
		if (!n.has(e.id)) {
			if (a.has(e.id)) throw Error(`dependency cycle involving ${e.id}`);
			a.add(e.id);
			for (let n of e.deps) {
				let r = t.get(n);
				if (!r) throw Error(`${e.id} depends on unknown feature ${n}`);
				i(r, a);
			}
			a.delete(e.id), n.add(e.id), r.push(e);
		}
	};
	for (let t of e) i(t, /* @__PURE__ */ new Set());
	return r;
}
function g(e) {
	let t = /* @__PURE__ */ new Map();
	for (let n of e) {
		let e = m(n.path), r = t.get(e);
		t.set(e, r ? {
			path: n.path,
			content: `${r.content.trimEnd()}\n\n${n.content}`
		} : n);
	}
	return [...t.values()];
}
function _(e, t) {
	let n = new Set(t.files.map(m)), r = [];
	for (let i of e) {
		let e = m(i.path);
		e.startsWith("tests/") || e.includes("/tests/") ? r.push(`${e}: writes into the frozen IR (tests/)`) : n.has(e) || r.push(`${e}: outside the ownership boundary of ${t.id} (${[...n].join(", ")})`);
	}
	return r;
}
function v(e) {
	let t = new Set(e.features.map((e) => e.id)), n = /* @__PURE__ */ new Map();
	for (let t of e.features) {
		let e = /^F?\d+/i.exec(t.id)?.[0]?.toUpperCase();
		e && n.set(e, n.has(e) ? null : t.id);
	}
	let r = (e) => {
		if (t.has(e)) return e;
		let r = /^F?\d+/i.exec(e.trim())?.[0]?.toUpperCase();
		return (r ? n.get(r) : void 0) ?? null;
	};
	for (let t of e.features) t.deps = [...new Set((t.deps ?? []).map(r).filter((e) => !!e && e !== t.id))];
	for (let t of e.features) {
		t.files = [...new Set(t.files.map(m).filter((e) => e.startsWith("src/")))];
		let e = m(t.testFile || "");
		if (!e.startsWith("tests/")) {
			let n = (t.name || t.id).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 40) || "feature";
			e = `tests/${t.id.toLowerCase().replace(/[^a-z0-9.]+/g, "-")}-${n}.test.ts`;
		}
		t.testFile = e, t.stubs = g(t.stubs ?? []);
		let n = new Set(t.stubs.map((e) => m(e.path)));
		for (let e of t.files) {
			let r = m(e);
			if (!n.has(r)) {
				let e = `__rhaStub_${t.id.replace(/\W/g, "_")}`;
				t.stubs.push({
					path: r,
					content: [
						`/** auto-stub for ${r} — mechanical fill for missing interface */`,
						`export function ${e}(): never {`,
						"  throw new Error('stub: not implemented');",
						"}",
						""
					].join("\n")
				}), n.add(r);
			}
		}
		t.stubs = t.stubs.filter((e) => t.files.map(m).includes(m(e.path)));
	}
	b(e);
}
function y(e) {
	let t = /^F?\d+/i.exec(e);
	return t ? t[0] : null;
}
function b(e) {
	let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
	for (let r of e.features) {
		t.set(r.id, r.id);
		let e = y(r.id);
		e && (n.has(e) ? n.set(e, null) : n.set(e, r.id));
	}
	let r = (e) => {
		if (t.has(e)) return t.get(e);
		if (n.has(e) && n.get(e) != null) return n.get(e);
		let r = y(e);
		return r && n.has(r) && n.get(r) != null ? n.get(r) : null;
	};
	for (let t of e.features) {
		let e = [], n = /* @__PURE__ */ new Set();
		for (let i of t.deps ?? []) {
			let a = r(i) ?? i;
			a !== t.id && (n.has(a) || (n.add(a), e.push(a)));
		}
		t.deps = e;
	}
}
function x(e, t) {
	let n = new Set(t), r = /* @__PURE__ */ new Set();
	for (let t of e) for (let e of n) (t.startsWith(`${e}:`) || t.startsWith(`${e} `) || t.includes(` ${e} `) || t.includes(` ${e}:`) || t.endsWith(` ${e}`) || t.includes(`both ${e} `) || t.includes(`and ${e}`)) && r.add(e);
	return [...r];
}
function S(e) {
	let t = [], n = /* @__PURE__ */ new Set();
	for (let r of e.features) n.has(r.id) && t.push(`duplicate feature id ${r.id}`), n.add(r.id);
	for (let r of e.features) {
		for (let e of r.deps) n.has(e) || t.push(`${r.id} depends on unknown ${e}`);
		r.files.length === 0 && t.push(`${r.id} owns no implementation files`);
		for (let e of r.files) m(e).startsWith("src/") || t.push(`${r.id}: file ${e} must live under src/`);
		m(r.testFile).startsWith("tests/") || t.push(`${r.id}: test file must live under tests/`);
		let e = new Set(r.stubs.map((e) => m(e.path)));
		for (let n of r.files) e.has(m(n)) || t.push(`${r.id}: no interface stub for owned file ${n}`);
		for (let e of r.stubs) r.files.map(m).includes(m(e.path)) || t.push(`${r.id}: stub ${e.path} is not an owned file`);
		let i = /* @__PURE__ */ new Set();
		for (let e of r.stubs) {
			let n = m(e.path);
			i.has(n) && t.push(`${r.id}: duplicate stub for ${n} — ONE file must have ONE stub entry; merge all of the file's types/classes into a single stub content, each type imported or defined in-file`), i.add(n);
		}
	}
	let r = /* @__PURE__ */ new Map();
	for (let n of e.features) for (let e of n.files) {
		let i = m(e);
		r.has(i) && t.push(`file ${i} owned by both ${r.get(i)} and ${n.id}`), r.set(i, n.id);
	}
	try {
		h(e.features);
	} catch (e) {
		t.push(e.message);
	}
	return t;
}
function C(e) {
	let t = [];
	return /from ['"]vitest['"]/.test(e) || t.push("does not import from vitest"), /\bdescribe\s*\(/.test(e) || t.push("has no describe block"), /\bit\s*\(/.test(e) || t.push("has no test cases"), t;
}
//#endregion
//#region src/core/bounded.ts
var w = 20, T = 4, E = 2;
function ee(e) {
	return Math.max(3, Math.ceil(.05 * e));
}
async function te(e) {
	let t = e.maxPasses ?? w, n = e.stallLimit ?? E, r = e.progressStall ?? T, i = e.metric ?? ((e) => e.length), a = await e.measure(), o = e.signature(a), s = i(a), c = s, l = 0, u = 0, d = 0, f = !1;
	for (; a.length > 0 && d < t;) {
		if (e.abort?.()) return {
			errors: a,
			passes: d,
			stalled: !1
		};
		if (d++, await e.repair(a, d), e.abort?.()) return a = await e.measure(), {
			errors: a,
			passes: d,
			stalled: !1
		};
		a = await e.measure();
		let t = e.signature(a);
		l = t === o ? l + 1 : 0, o = t;
		let p = i(a);
		p < s && (s = p);
		let m = ee(c);
		if (s <= c - m ? (c = s, u = 0) : u++, l >= n || u >= r) {
			if (e.onStall && !f && (f = !0, await e.onStall(a, d))) {
				if (a = await e.measure(), !a.length) return {
					errors: a,
					passes: d,
					stalled: !1
				};
				o = e.signature(a), s = i(a), c = s, l = 0, u = 0;
				continue;
			}
			return {
				errors: a,
				passes: d,
				stalled: !0
			};
		}
	}
	return {
		errors: a,
		passes: d,
		stalled: !1
	};
}
//#endregion
//#region src/core/irScaffold.ts
var ne = {
	behavior: "",
	edge: "edge: ",
	integration: "integration: "
};
function D(e) {
	let t = e.trim().replace(/\.ts$/, "").replace(/^\.\//, "");
	return t.startsWith("src/") && (t = "../" + t), t;
}
function O(e, t, n) {
	return k(e, t, n).content;
}
function k(e, t, n) {
	let r = /* @__PURE__ */ new Map();
	for (let e of t) {
		let t = D(e.from);
		if (t.startsWith("../src/")) {
			r.has(t) || r.set(t, /* @__PURE__ */ new Set());
			for (let n of e.symbols) {
				let e = n.trim();
				/^[A-Za-z_$][\w$]*$/.test(e) && r.get(t).add(e);
			}
		}
	}
	let i = [];
	i.push("import { describe, it, expect } from 'vitest';");
	for (let [e, t] of r) t.size && i.push(`import { ${[...t].join(", ")} } from '${e}';`);
	let a = {
		start: 1,
		end: i.length
	};
	i.push(""), i.push(`describe('${e.id}: ${e.name.replace(/'/g, "\\'")}', () => {`);
	let o = [];
	return n.forEach((e, t) => {
		let n = ne[e.kind] ?? "", r = e.name.trim().replace(/\\/g, "\\\\").replace(/'/g, "\\'");
		n && !r.startsWith(n) && (r = n + r);
		let a = /\bawait\b/.test(e.body) ? "async " : "", s = i.length + 1;
		i.push(`  it('${r}', ${a}() => {`);
		for (let t of e.body.replace(/\r\n/g, "\n").split("\n")) i.push(t.trim() ? "    " + t : "");
		i.push("  });"), o.push({
			index: t,
			name: e.name,
			kind: e.kind,
			start: s,
			end: i.length
		}), i.push("");
	}), i.push("});"), i.push(""), {
		content: i.join("\n"),
		importRange: a,
		caseRanges: o
	};
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/tokenizer/keywords.js
var A;
(function(e) {
	e[e.NONE = 0] = "NONE", e[e._abstract = 1] = "_abstract", e[e._accessor = 2] = "_accessor", e[e._as = 3] = "_as", e[e._assert = 4] = "_assert", e[e._asserts = 5] = "_asserts", e[e._async = 6] = "_async", e[e._await = 7] = "_await", e[e._checks = 8] = "_checks", e[e._constructor = 9] = "_constructor", e[e._declare = 10] = "_declare", e[e._enum = 11] = "_enum", e[e._exports = 12] = "_exports", e[e._from = 13] = "_from", e[e._get = 14] = "_get", e[e._global = 15] = "_global", e[e._implements = 16] = "_implements", e[e._infer = 17] = "_infer", e[e._interface = 18] = "_interface", e[e._is = 19] = "_is", e[e._keyof = 20] = "_keyof", e[e._mixins = 21] = "_mixins", e[e._module = 22] = "_module", e[e._namespace = 23] = "_namespace", e[e._of = 24] = "_of", e[e._opaque = 25] = "_opaque", e[e._out = 26] = "_out", e[e._override = 27] = "_override", e[e._private = 28] = "_private", e[e._protected = 29] = "_protected", e[e._proto = 30] = "_proto", e[e._public = 31] = "_public", e[e._readonly = 32] = "_readonly", e[e._require = 33] = "_require", e[e._satisfies = 34] = "_satisfies", e[e._set = 35] = "_set", e[e._static = 36] = "_static", e[e._symbol = 37] = "_symbol", e[e._type = 38] = "_type", e[e._unique = 39] = "_unique", e[e._using = 40] = "_using";
})(A ||= {});
//#endregion
//#region node_modules/sucrase/dist/esm/parser/tokenizer/types.js
/* istanbul ignore file */
var j;
(function(e) {
	e[e.PRECEDENCE_MASK = 15] = "PRECEDENCE_MASK", e[e.IS_KEYWORD = 16] = "IS_KEYWORD", e[e.IS_ASSIGN = 32] = "IS_ASSIGN", e[e.IS_RIGHT_ASSOCIATIVE = 64] = "IS_RIGHT_ASSOCIATIVE", e[e.IS_PREFIX = 128] = "IS_PREFIX", e[e.IS_POSTFIX = 256] = "IS_POSTFIX", e[e.IS_EXPRESSION_START = 512] = "IS_EXPRESSION_START", e[e.num = 512] = "num", e[e.bigint = 1536] = "bigint", e[e.decimal = 2560] = "decimal", e[e.regexp = 3584] = "regexp", e[e.string = 4608] = "string", e[e.name = 5632] = "name", e[e.eof = 6144] = "eof", e[e.bracketL = 7680] = "bracketL", e[e.bracketR = 8192] = "bracketR", e[e.braceL = 9728] = "braceL", e[e.braceBarL = 10752] = "braceBarL", e[e.braceR = 11264] = "braceR", e[e.braceBarR = 12288] = "braceBarR", e[e.parenL = 13824] = "parenL", e[e.parenR = 14336] = "parenR", e[e.comma = 15360] = "comma", e[e.semi = 16384] = "semi", e[e.colon = 17408] = "colon", e[e.doubleColon = 18432] = "doubleColon", e[e.dot = 19456] = "dot", e[e.question = 20480] = "question", e[e.questionDot = 21504] = "questionDot", e[e.arrow = 22528] = "arrow", e[e.template = 23552] = "template", e[e.ellipsis = 24576] = "ellipsis", e[e.backQuote = 25600] = "backQuote", e[e.dollarBraceL = 27136] = "dollarBraceL", e[e.at = 27648] = "at", e[e.hash = 29184] = "hash", e[e.eq = 29728] = "eq", e[e.assign = 30752] = "assign", e[e.preIncDec = 32640] = "preIncDec", e[e.postIncDec = 33664] = "postIncDec", e[e.bang = 34432] = "bang", e[e.tilde = 35456] = "tilde", e[e.pipeline = 35841] = "pipeline", e[e.nullishCoalescing = 36866] = "nullishCoalescing", e[e.logicalOR = 37890] = "logicalOR", e[e.logicalAND = 38915] = "logicalAND", e[e.bitwiseOR = 39940] = "bitwiseOR", e[e.bitwiseXOR = 40965] = "bitwiseXOR", e[e.bitwiseAND = 41990] = "bitwiseAND", e[e.equality = 43015] = "equality", e[e.lessThan = 44040] = "lessThan", e[e.greaterThan = 45064] = "greaterThan", e[e.relationalOrEqual = 46088] = "relationalOrEqual", e[e.bitShiftL = 47113] = "bitShiftL", e[e.bitShiftR = 48137] = "bitShiftR", e[e.plus = 49802] = "plus", e[e.minus = 50826] = "minus", e[e.modulo = 51723] = "modulo", e[e.star = 52235] = "star", e[e.slash = 53259] = "slash", e[e.exponent = 54348] = "exponent", e[e.jsxName = 55296] = "jsxName", e[e.jsxText = 56320] = "jsxText", e[e.jsxEmptyText = 57344] = "jsxEmptyText", e[e.jsxTagStart = 58880] = "jsxTagStart", e[e.jsxTagEnd = 59392] = "jsxTagEnd", e[e.typeParameterStart = 60928] = "typeParameterStart", e[e.nonNullAssertion = 61440] = "nonNullAssertion", e[e._break = 62480] = "_break", e[e._case = 63504] = "_case", e[e._catch = 64528] = "_catch", e[e._continue = 65552] = "_continue", e[e._debugger = 66576] = "_debugger", e[e._default = 67600] = "_default", e[e._do = 68624] = "_do", e[e._else = 69648] = "_else", e[e._finally = 70672] = "_finally", e[e._for = 71696] = "_for", e[e._function = 73232] = "_function", e[e._if = 73744] = "_if", e[e._return = 74768] = "_return", e[e._switch = 75792] = "_switch", e[e._throw = 77456] = "_throw", e[e._try = 77840] = "_try", e[e._var = 78864] = "_var", e[e._let = 79888] = "_let", e[e._const = 80912] = "_const", e[e._while = 81936] = "_while", e[e._with = 82960] = "_with", e[e._new = 84496] = "_new", e[e._this = 85520] = "_this", e[e._super = 86544] = "_super", e[e._class = 87568] = "_class", e[e._extends = 88080] = "_extends", e[e._export = 89104] = "_export", e[e._import = 90640] = "_import", e[e._yield = 91664] = "_yield", e[e._null = 92688] = "_null", e[e._true = 93712] = "_true", e[e._false = 94736] = "_false", e[e._in = 95256] = "_in", e[e._instanceof = 96280] = "_instanceof", e[e._typeof = 97936] = "_typeof", e[e._void = 98960] = "_void", e[e._delete = 99984] = "_delete", e[e._async = 100880] = "_async", e[e._get = 101904] = "_get", e[e._set = 102928] = "_set", e[e._declare = 103952] = "_declare", e[e._readonly = 104976] = "_readonly", e[e._abstract = 106e3] = "_abstract", e[e._static = 107024] = "_static", e[e._public = 107536] = "_public", e[e._private = 108560] = "_private", e[e._protected = 109584] = "_protected", e[e._override = 110608] = "_override", e[e._as = 112144] = "_as", e[e._enum = 113168] = "_enum", e[e._type = 114192] = "_type", e[e._implements = 115216] = "_implements";
})(j ||= {});
function re(e) {
	switch (e) {
		case j.num: return "num";
		case j.bigint: return "bigint";
		case j.decimal: return "decimal";
		case j.regexp: return "regexp";
		case j.string: return "string";
		case j.name: return "name";
		case j.eof: return "eof";
		case j.bracketL: return "[";
		case j.bracketR: return "]";
		case j.braceL: return "{";
		case j.braceBarL: return "{|";
		case j.braceR: return "}";
		case j.braceBarR: return "|}";
		case j.parenL: return "(";
		case j.parenR: return ")";
		case j.comma: return ",";
		case j.semi: return ";";
		case j.colon: return ":";
		case j.doubleColon: return "::";
		case j.dot: return ".";
		case j.question: return "?";
		case j.questionDot: return "?.";
		case j.arrow: return "=>";
		case j.template: return "template";
		case j.ellipsis: return "...";
		case j.backQuote: return "`";
		case j.dollarBraceL: return "${";
		case j.at: return "@";
		case j.hash: return "#";
		case j.eq: return "=";
		case j.assign: return "_=";
		case j.preIncDec: return "++/--";
		case j.postIncDec: return "++/--";
		case j.bang: return "!";
		case j.tilde: return "~";
		case j.pipeline: return "|>";
		case j.nullishCoalescing: return "??";
		case j.logicalOR: return "||";
		case j.logicalAND: return "&&";
		case j.bitwiseOR: return "|";
		case j.bitwiseXOR: return "^";
		case j.bitwiseAND: return "&";
		case j.equality: return "==/!=";
		case j.lessThan: return "<";
		case j.greaterThan: return ">";
		case j.relationalOrEqual: return "<=/>=";
		case j.bitShiftL: return "<<";
		case j.bitShiftR: return ">>/>>>";
		case j.plus: return "+";
		case j.minus: return "-";
		case j.modulo: return "%";
		case j.star: return "*";
		case j.slash: return "/";
		case j.exponent: return "**";
		case j.jsxName: return "jsxName";
		case j.jsxText: return "jsxText";
		case j.jsxEmptyText: return "jsxEmptyText";
		case j.jsxTagStart: return "jsxTagStart";
		case j.jsxTagEnd: return "jsxTagEnd";
		case j.typeParameterStart: return "typeParameterStart";
		case j.nonNullAssertion: return "nonNullAssertion";
		case j._break: return "break";
		case j._case: return "case";
		case j._catch: return "catch";
		case j._continue: return "continue";
		case j._debugger: return "debugger";
		case j._default: return "default";
		case j._do: return "do";
		case j._else: return "else";
		case j._finally: return "finally";
		case j._for: return "for";
		case j._function: return "function";
		case j._if: return "if";
		case j._return: return "return";
		case j._switch: return "switch";
		case j._throw: return "throw";
		case j._try: return "try";
		case j._var: return "var";
		case j._let: return "let";
		case j._const: return "const";
		case j._while: return "while";
		case j._with: return "with";
		case j._new: return "new";
		case j._this: return "this";
		case j._super: return "super";
		case j._class: return "class";
		case j._extends: return "extends";
		case j._export: return "export";
		case j._import: return "import";
		case j._yield: return "yield";
		case j._null: return "null";
		case j._true: return "true";
		case j._false: return "false";
		case j._in: return "in";
		case j._instanceof: return "instanceof";
		case j._typeof: return "typeof";
		case j._void: return "void";
		case j._delete: return "delete";
		case j._async: return "async";
		case j._get: return "get";
		case j._set: return "set";
		case j._declare: return "declare";
		case j._readonly: return "readonly";
		case j._abstract: return "abstract";
		case j._static: return "static";
		case j._public: return "public";
		case j._private: return "private";
		case j._protected: return "protected";
		case j._override: return "override";
		case j._as: return "as";
		case j._enum: return "enum";
		case j._type: return "type";
		case j._implements: return "implements";
		default: return "";
	}
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/tokenizer/state.js
var ie = class {
	constructor(e, t, n) {
		this.startTokenIndex = e, this.endTokenIndex = t, this.isFunctionScope = n;
	}
}, ae = class {
	constructor(e, t, n, r, i, a, o, s, c, l, u, d, f) {
		this.potentialArrowAt = e, this.noAnonFunctionType = t, this.inDisallowConditionalTypesContext = n, this.tokensLength = r, this.scopesLength = i, this.pos = a, this.type = o, this.contextualKeyword = s, this.start = c, this.end = l, this.isType = u, this.scopeDepth = d, this.error = f;
	}
}, oe = class e {
	constructor() {
		e.prototype.__init.call(this), e.prototype.__init2.call(this), e.prototype.__init3.call(this), e.prototype.__init4.call(this), e.prototype.__init5.call(this), e.prototype.__init6.call(this), e.prototype.__init7.call(this), e.prototype.__init8.call(this), e.prototype.__init9.call(this), e.prototype.__init10.call(this), e.prototype.__init11.call(this), e.prototype.__init12.call(this), e.prototype.__init13.call(this);
	}
	__init() {
		this.potentialArrowAt = -1;
	}
	__init2() {
		this.noAnonFunctionType = !1;
	}
	__init3() {
		this.inDisallowConditionalTypesContext = !1;
	}
	__init4() {
		this.tokens = [];
	}
	__init5() {
		this.scopes = [];
	}
	__init6() {
		this.pos = 0;
	}
	__init7() {
		this.type = j.eof;
	}
	__init8() {
		this.contextualKeyword = A.NONE;
	}
	__init9() {
		this.start = 0;
	}
	__init10() {
		this.end = 0;
	}
	__init11() {
		this.isType = !1;
	}
	__init12() {
		this.scopeDepth = 0;
	}
	__init13() {
		this.error = null;
	}
	snapshot() {
		return new ae(this.potentialArrowAt, this.noAnonFunctionType, this.inDisallowConditionalTypesContext, this.tokens.length, this.scopes.length, this.pos, this.type, this.contextualKeyword, this.start, this.end, this.isType, this.scopeDepth, this.error);
	}
	restoreFromSnapshot(e) {
		this.potentialArrowAt = e.potentialArrowAt, this.noAnonFunctionType = e.noAnonFunctionType, this.inDisallowConditionalTypesContext = e.inDisallowConditionalTypesContext, this.tokens.length = e.tokensLength, this.scopes.length = e.scopesLength, this.pos = e.pos, this.type = e.type, this.contextualKeyword = e.contextualKeyword, this.start = e.start, this.end = e.end, this.isType = e.isType, this.scopeDepth = e.scopeDepth, this.error = e.error;
	}
}, M;
(function(e) {
	e[e.backSpace = 8] = "backSpace", e[e.lineFeed = 10] = "lineFeed", e[e.tab = 9] = "tab", e[e.carriageReturn = 13] = "carriageReturn", e[e.shiftOut = 14] = "shiftOut", e[e.space = 32] = "space", e[e.exclamationMark = 33] = "exclamationMark", e[e.quotationMark = 34] = "quotationMark", e[e.numberSign = 35] = "numberSign", e[e.dollarSign = 36] = "dollarSign", e[e.percentSign = 37] = "percentSign", e[e.ampersand = 38] = "ampersand", e[e.apostrophe = 39] = "apostrophe", e[e.leftParenthesis = 40] = "leftParenthesis", e[e.rightParenthesis = 41] = "rightParenthesis", e[e.asterisk = 42] = "asterisk", e[e.plusSign = 43] = "plusSign", e[e.comma = 44] = "comma", e[e.dash = 45] = "dash", e[e.dot = 46] = "dot", e[e.slash = 47] = "slash", e[e.digit0 = 48] = "digit0", e[e.digit1 = 49] = "digit1", e[e.digit2 = 50] = "digit2", e[e.digit3 = 51] = "digit3", e[e.digit4 = 52] = "digit4", e[e.digit5 = 53] = "digit5", e[e.digit6 = 54] = "digit6", e[e.digit7 = 55] = "digit7", e[e.digit8 = 56] = "digit8", e[e.digit9 = 57] = "digit9", e[e.colon = 58] = "colon", e[e.semicolon = 59] = "semicolon", e[e.lessThan = 60] = "lessThan", e[e.equalsTo = 61] = "equalsTo", e[e.greaterThan = 62] = "greaterThan", e[e.questionMark = 63] = "questionMark", e[e.atSign = 64] = "atSign", e[e.uppercaseA = 65] = "uppercaseA", e[e.uppercaseB = 66] = "uppercaseB", e[e.uppercaseC = 67] = "uppercaseC", e[e.uppercaseD = 68] = "uppercaseD", e[e.uppercaseE = 69] = "uppercaseE", e[e.uppercaseF = 70] = "uppercaseF", e[e.uppercaseG = 71] = "uppercaseG", e[e.uppercaseH = 72] = "uppercaseH", e[e.uppercaseI = 73] = "uppercaseI", e[e.uppercaseJ = 74] = "uppercaseJ", e[e.uppercaseK = 75] = "uppercaseK", e[e.uppercaseL = 76] = "uppercaseL", e[e.uppercaseM = 77] = "uppercaseM", e[e.uppercaseN = 78] = "uppercaseN", e[e.uppercaseO = 79] = "uppercaseO", e[e.uppercaseP = 80] = "uppercaseP", e[e.uppercaseQ = 81] = "uppercaseQ", e[e.uppercaseR = 82] = "uppercaseR", e[e.uppercaseS = 83] = "uppercaseS", e[e.uppercaseT = 84] = "uppercaseT", e[e.uppercaseU = 85] = "uppercaseU", e[e.uppercaseV = 86] = "uppercaseV", e[e.uppercaseW = 87] = "uppercaseW", e[e.uppercaseX = 88] = "uppercaseX", e[e.uppercaseY = 89] = "uppercaseY", e[e.uppercaseZ = 90] = "uppercaseZ", e[e.leftSquareBracket = 91] = "leftSquareBracket", e[e.backslash = 92] = "backslash", e[e.rightSquareBracket = 93] = "rightSquareBracket", e[e.caret = 94] = "caret", e[e.underscore = 95] = "underscore", e[e.graveAccent = 96] = "graveAccent", e[e.lowercaseA = 97] = "lowercaseA", e[e.lowercaseB = 98] = "lowercaseB", e[e.lowercaseC = 99] = "lowercaseC", e[e.lowercaseD = 100] = "lowercaseD", e[e.lowercaseE = 101] = "lowercaseE", e[e.lowercaseF = 102] = "lowercaseF", e[e.lowercaseG = 103] = "lowercaseG", e[e.lowercaseH = 104] = "lowercaseH", e[e.lowercaseI = 105] = "lowercaseI", e[e.lowercaseJ = 106] = "lowercaseJ", e[e.lowercaseK = 107] = "lowercaseK", e[e.lowercaseL = 108] = "lowercaseL", e[e.lowercaseM = 109] = "lowercaseM", e[e.lowercaseN = 110] = "lowercaseN", e[e.lowercaseO = 111] = "lowercaseO", e[e.lowercaseP = 112] = "lowercaseP", e[e.lowercaseQ = 113] = "lowercaseQ", e[e.lowercaseR = 114] = "lowercaseR", e[e.lowercaseS = 115] = "lowercaseS", e[e.lowercaseT = 116] = "lowercaseT", e[e.lowercaseU = 117] = "lowercaseU", e[e.lowercaseV = 118] = "lowercaseV", e[e.lowercaseW = 119] = "lowercaseW", e[e.lowercaseX = 120] = "lowercaseX", e[e.lowercaseY = 121] = "lowercaseY", e[e.lowercaseZ = 122] = "lowercaseZ", e[e.leftCurlyBrace = 123] = "leftCurlyBrace", e[e.verticalBar = 124] = "verticalBar", e[e.rightCurlyBrace = 125] = "rightCurlyBrace", e[e.tilde = 126] = "tilde", e[e.nonBreakingSpace = 160] = "nonBreakingSpace", e[e.oghamSpaceMark = 5760] = "oghamSpaceMark", e[e.lineSeparator = 8232] = "lineSeparator", e[e.paragraphSeparator = 8233] = "paragraphSeparator";
})(M ||= {});
//#endregion
//#region node_modules/sucrase/dist/esm/parser/traverser/base.js
var se, N, ce, P, F, I;
function le() {
	return I++;
}
function ue(e) {
	if ("pos" in e) {
		let t = fe(e.pos);
		e.message += ` (${t.line}:${t.column})`, e.loc = t;
	}
	return e;
}
var de = class {
	constructor(e, t) {
		this.line = e, this.column = t;
	}
};
function fe(e) {
	let t = 1, n = 1;
	for (let r = 0; r < e; r++) F.charCodeAt(r) === M.lineFeed ? (t++, n = 1) : n++;
	return new de(t, n);
}
function L(e, t, n, r) {
	F = e, P = new oe(), I = 1, se = t, N = n, ce = r;
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/traverser/util.js
function R(e) {
	return P.contextualKeyword === e;
}
function z(e) {
	let t = Re();
	return t.type === j.name && t.contextualKeyword === e;
}
function B(e) {
	return P.contextualKeyword === e && Y(j.name);
}
function V(e) {
	B(e) || W();
}
function pe() {
	return X(j.eof) || X(j.braceR) || me();
}
function me() {
	let e = P.tokens[P.tokens.length - 1], t = e ? e.end : 0;
	for (let e = t; e < P.start; e++) {
		let t = F.charCodeAt(e);
		if (t === M.lineFeed || t === M.carriageReturn || t === 8232 || t === 8233) return !0;
	}
	return !1;
}
function he() {
	let e = ze();
	for (let t = P.end; t < e; t++) {
		let e = F.charCodeAt(t);
		if (e === M.lineFeed || e === M.carriageReturn || e === 8232 || e === 8233) return !0;
	}
	return !1;
}
function ge() {
	return Y(j.semi) || pe();
}
function H() {
	ge() || W("Unexpected token, expected \";\"");
}
function U(e) {
	Y(e) || W(`Unexpected token, expected "${re(e)}"`);
}
function W(e = "Unexpected token", t = P.start) {
	if (P.error) return;
	let n = SyntaxError(e);
	n.pos = t, P.error = n, P.pos = F.length, qe(j.eof);
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/util/whitespace.js
var G = [
	9,
	11,
	12,
	M.space,
	M.nonBreakingSpace,
	M.oghamSpaceMark,
	8192,
	8193,
	8194,
	8195,
	8196,
	8197,
	8198,
	8199,
	8200,
	8201,
	8202,
	8239,
	8287,
	12288,
	65279
], _e = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ve = /* @__PURE__ */ new Uint8Array(65536);
for (let e of G) ve[e] = 1;
//#endregion
//#region node_modules/sucrase/dist/esm/parser/util/identifier.js
function ye(e) {
	if (e < 48) return e === 36;
	if (e < 58) return !0;
	if (e < 65) return !1;
	if (e < 91) return !0;
	if (e < 97) return e === 95;
	if (e < 123) return !0;
	if (e < 128) return !1;
	throw Error("Should not be called with non-ASCII char code.");
}
var be = /* @__PURE__ */ new Uint8Array(65536);
for (let e = 0; e < 128; e++) be[e] = +!!ye(e);
for (let e = 128; e < 65536; e++) be[e] = 1;
for (let e of G) be[e] = 0;
be[8232] = 0, be[8233] = 0;
var xe = be.slice();
for (let e = M.digit0; e <= M.digit9; e++) xe[e] = 0;
//#endregion
//#region node_modules/sucrase/dist/esm/parser/tokenizer/readWordTree.js
var Se = new Int32Array([
	-1,
	27,
	783,
	918,
	1755,
	2376,
	2862,
	3483,
	-1,
	3699,
	-1,
	4617,
	4752,
	4833,
	5130,
	5508,
	5940,
	-1,
	6480,
	6939,
	7749,
	8181,
	8451,
	8613,
	-1,
	8829,
	-1,
	-1,
	-1,
	54,
	243,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	432,
	-1,
	-1,
	-1,
	675,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	81,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	108,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	135,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	162,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	189,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	216,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._abstract << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	270,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	297,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	324,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	351,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	378,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	405,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._accessor << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._as << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	459,
	-1,
	-1,
	-1,
	-1,
	-1,
	594,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	486,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	513,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	540,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._assert << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	567,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._asserts << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	621,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	648,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._async << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	702,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	729,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	756,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._await << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	810,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	837,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	864,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	891,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._break << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	945,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1107,
	-1,
	-1,
	-1,
	1242,
	-1,
	-1,
	1350,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	972,
	1026,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	999,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._case << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1053,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1080,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._catch << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1134,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1161,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1188,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1215,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._checks << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1269,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1296,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1323,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._class << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1377,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1404,
	1620,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1431,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._const << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1458,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1485,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1512,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1539,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1566,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1593,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._constructor << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1647,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1674,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1701,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1728,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._continue << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1782,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2349,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1809,
	1971,
	-1,
	-1,
	2106,
	-1,
	-1,
	-1,
	-1,
	-1,
	2241,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1836,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1863,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1890,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1917,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1944,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._debugger << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	1998,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2025,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2052,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2079,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._declare << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2133,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2160,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2187,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2214,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._default << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2268,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2295,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2322,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._delete << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._do << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2403,
	-1,
	2484,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2565,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2430,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2457,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._else << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2511,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2538,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._enum << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2592,
	-1,
	-1,
	-1,
	2727,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2619,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2646,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2673,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._export << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2700,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._exports << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2754,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2781,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2808,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2835,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._extends << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2889,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2997,
	-1,
	-1,
	-1,
	-1,
	-1,
	3159,
	-1,
	-1,
	3213,
	-1,
	-1,
	3294,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2916,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2943,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	2970,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._false << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3024,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3051,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3078,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3105,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3132,
	-1,
	(j._finally << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3186,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._for << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3240,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3267,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._from << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3321,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3348,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3375,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3402,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3429,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3456,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._function << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3510,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3564,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3537,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._get << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3591,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3618,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3645,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3672,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._global << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3726,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3753,
	4077,
	-1,
	-1,
	-1,
	-1,
	4590,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._if << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3780,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3807,
	-1,
	-1,
	3996,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3834,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3861,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3888,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3915,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3942,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	3969,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._implements << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4023,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4050,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._import << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._in << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4104,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4185,
	4401,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4131,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4158,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._infer << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4212,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4239,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4266,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4293,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4320,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4347,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4374,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._instanceof << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4428,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4455,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4482,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4509,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4536,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4563,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._interface << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._is << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4644,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4671,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4698,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4725,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._keyof << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4779,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4806,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._let << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4860,
	-1,
	-1,
	-1,
	-1,
	-1,
	4995,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4887,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4914,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4941,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	4968,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._mixins << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5022,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5049,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5076,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5103,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._module << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5157,
	-1,
	-1,
	-1,
	5373,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5427,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5184,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5211,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5238,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5265,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5292,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5319,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5346,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._namespace << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5400,
	-1,
	-1,
	-1,
	(j._new << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5454,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5481,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._null << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5535,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5562,
	-1,
	-1,
	-1,
	-1,
	5697,
	5751,
	-1,
	-1,
	-1,
	-1,
	A._of << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5589,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5616,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5643,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5670,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._opaque << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5724,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._out << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5778,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5805,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5832,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5859,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5886,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5913,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._override << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5967,
	-1,
	-1,
	6345,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	5994,
	-1,
	-1,
	-1,
	-1,
	-1,
	6129,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6021,
	-1,
	-1,
	-1,
	-1,
	-1,
	6048,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6075,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6102,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._private << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6156,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6183,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6318,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6210,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6237,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6264,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6291,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._protected << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._proto << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6372,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6399,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6426,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6453,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._public << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6507,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6534,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6696,
	-1,
	-1,
	6831,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6561,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6588,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6615,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6642,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6669,
	-1,
	A._readonly << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6723,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6750,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6777,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6804,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._require << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6858,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6885,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6912,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._return << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6966,
	-1,
	-1,
	-1,
	7182,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7236,
	7371,
	-1,
	7479,
	-1,
	7614,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	6993,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7020,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7047,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7074,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7101,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7128,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7155,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._satisfies << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7209,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._set << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7263,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7290,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7317,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7344,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._static << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7398,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7425,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7452,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._super << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7506,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7533,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7560,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7587,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._switch << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7641,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7668,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7695,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7722,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._symbol << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7776,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7938,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8046,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7803,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7857,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7830,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._this << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7884,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7911,
	-1,
	-1,
	-1,
	(j._throw << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7965,
	-1,
	-1,
	-1,
	8019,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	7992,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._true << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._try << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8073,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8100,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._type << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8127,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8154,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._typeof << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8208,
	-1,
	-1,
	-1,
	-1,
	8343,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8235,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8262,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8289,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8316,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._unique << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8370,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8397,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8424,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	A._using << 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8478,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8532,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8505,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._var << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8559,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8586,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._void << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8640,
	8748,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8667,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8694,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8721,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._while << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8775,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8802,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._with << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8856,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8883,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8910,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	8937,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	(j._yield << 1) + 1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1
]);
//#endregion
//#region node_modules/sucrase/dist/esm/parser/tokenizer/readWord.js
function Ce() {
	let e = 0, t = 0, n = P.pos;
	for (; n < F.length && (t = F.charCodeAt(n), !(t < M.lowercaseA || t > M.lowercaseZ));) {
		let r = Se[e + (t - M.lowercaseA) + 1];
		if (r === -1) break;
		e = r, n++;
	}
	let r = Se[e];
	if (r > -1 && !be[t]) {
		P.pos = n, r & 1 ? qe(r >>> 1) : qe(j.name, r >>> 1);
		return;
	}
	for (; n < F.length;) {
		let e = F.charCodeAt(n);
		if (be[e]) n++;
		else if (e === M.backslash) {
			if (n += 2, F.charCodeAt(n) === M.leftCurlyBrace) {
				for (; n < F.length && F.charCodeAt(n) !== M.rightCurlyBrace;) n++;
				n++;
			}
		} else if (e === M.atSign && F.charCodeAt(n + 1) === M.atSign) n += 2;
		else break;
	}
	P.pos = n, qe(j.name);
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/tokenizer/index.js
var K;
(function(e) {
	e[e.Access = 0] = "Access", e[e.ExportAccess = 1] = "ExportAccess", e[e.TopLevelDeclaration = 2] = "TopLevelDeclaration", e[e.FunctionScopedDeclaration = 3] = "FunctionScopedDeclaration", e[e.BlockScopedDeclaration = 4] = "BlockScopedDeclaration", e[e.ObjectShorthandTopLevelDeclaration = 5] = "ObjectShorthandTopLevelDeclaration", e[e.ObjectShorthandFunctionScopedDeclaration = 6] = "ObjectShorthandFunctionScopedDeclaration", e[e.ObjectShorthandBlockScopedDeclaration = 7] = "ObjectShorthandBlockScopedDeclaration", e[e.ObjectShorthand = 8] = "ObjectShorthand", e[e.ImportDeclaration = 9] = "ImportDeclaration", e[e.ObjectKey = 10] = "ObjectKey", e[e.ImportAccess = 11] = "ImportAccess";
})(K ||= {});
var we;
(function(e) {
	e[e.NoChildren = 0] = "NoChildren", e[e.OneChild = 1] = "OneChild", e[e.StaticChildren = 2] = "StaticChildren", e[e.KeyAfterPropSpread = 3] = "KeyAfterPropSpread";
})(we ||= {});
function Te(e) {
	let t = e.identifierRole;
	return t === K.TopLevelDeclaration || t === K.FunctionScopedDeclaration || t === K.BlockScopedDeclaration || t === K.ObjectShorthandTopLevelDeclaration || t === K.ObjectShorthandFunctionScopedDeclaration || t === K.ObjectShorthandBlockScopedDeclaration;
}
function Ee(e) {
	let t = e.identifierRole;
	return t === K.FunctionScopedDeclaration || t === K.BlockScopedDeclaration || t === K.ObjectShorthandFunctionScopedDeclaration || t === K.ObjectShorthandBlockScopedDeclaration;
}
function De(e) {
	let t = e.identifierRole;
	return t === K.TopLevelDeclaration || t === K.ObjectShorthandTopLevelDeclaration || t === K.ImportDeclaration;
}
function Oe(e) {
	let t = e.identifierRole;
	return t === K.TopLevelDeclaration || t === K.BlockScopedDeclaration || t === K.ObjectShorthandTopLevelDeclaration || t === K.ObjectShorthandBlockScopedDeclaration;
}
function ke(e) {
	let t = e.identifierRole;
	return t === K.FunctionScopedDeclaration || t === K.ObjectShorthandFunctionScopedDeclaration;
}
function Ae(e) {
	return e.identifierRole === K.ObjectShorthandTopLevelDeclaration || e.identifierRole === K.ObjectShorthandBlockScopedDeclaration || e.identifierRole === K.ObjectShorthandFunctionScopedDeclaration;
}
var q = class {
	constructor() {
		this.type = P.type, this.contextualKeyword = P.contextualKeyword, this.start = P.start, this.end = P.end, this.scopeDepth = P.scopeDepth, this.isType = P.isType, this.identifierRole = null, this.jsxRole = null, this.shadowsGlobal = !1, this.isAsyncOperation = !1, this.contextId = null, this.rhsEndIndex = null, this.isExpression = !1, this.numNullishCoalesceStarts = 0, this.numNullishCoalesceEnds = 0, this.isOptionalChainStart = !1, this.isOptionalChainEnd = !1, this.subscriptStartIndex = null, this.nullishStartIndex = null;
	}
};
function J() {
	P.tokens.push(new q()), He();
}
function je() {
	P.tokens.push(new q()), P.start = P.pos, ft();
}
function Me() {
	P.type === j.assign && --P.pos, st();
}
function Ne(e) {
	for (let t = P.tokens.length - e; t < P.tokens.length; t++) P.tokens[t].isType = !0;
	let t = P.isType;
	return P.isType = !0, t;
}
function Pe(e) {
	P.isType = e;
}
function Y(e) {
	return X(e) ? (J(), !0) : !1;
}
function Fe(e) {
	let t = P.isType;
	P.isType = !0, Y(e), P.isType = t;
}
function X(e) {
	return P.type === e;
}
function Ie() {
	let e = P.snapshot();
	J();
	let t = P.type;
	return P.restoreFromSnapshot(e), t;
}
var Le = class {
	constructor(e, t) {
		this.type = e, this.contextualKeyword = t;
	}
};
function Re() {
	let e = P.snapshot();
	J();
	let t = P.type, n = P.contextualKeyword;
	return P.restoreFromSnapshot(e), new Le(t, n);
}
function ze() {
	return Be(P.pos);
}
function Be(e) {
	return _e.lastIndex = e, e + _e.exec(F)[0].length;
}
function Ve() {
	return F.charCodeAt(ze());
}
function He() {
	if (Ke(), P.start = P.pos, P.pos >= F.length) {
		let e = P.tokens;
		e.length >= 2 && e[e.length - 1].start >= F.length && e[e.length - 2].start >= F.length && W("Unexpectedly reached the end of input."), qe(j.eof);
		return;
	}
	Ue(F.charCodeAt(P.pos));
}
function Ue(e) {
	xe[e] || e === M.backslash || e === M.atSign && F.charCodeAt(P.pos + 1) === M.atSign ? Ce() : at(e);
}
function We() {
	for (; F.charCodeAt(P.pos) !== M.asterisk || F.charCodeAt(P.pos + 1) !== M.slash;) if (P.pos++, P.pos > F.length) {
		W("Unterminated comment", P.pos - 2);
		return;
	}
	P.pos += 2;
}
function Ge(e) {
	let t = F.charCodeAt(P.pos += e);
	if (P.pos < F.length) for (; t !== M.lineFeed && t !== M.carriageReturn && t !== M.lineSeparator && t !== M.paragraphSeparator && ++P.pos < F.length;) t = F.charCodeAt(P.pos);
}
function Ke() {
	for (; P.pos < F.length;) {
		let e = F.charCodeAt(P.pos);
		switch (e) {
			case M.carriageReturn: F.charCodeAt(P.pos + 1) === M.lineFeed && ++P.pos;
			case M.lineFeed:
			case M.lineSeparator:
			case M.paragraphSeparator:
				++P.pos;
				break;
			case M.slash:
				switch (F.charCodeAt(P.pos + 1)) {
					case M.asterisk:
						P.pos += 2, We();
						break;
					case M.slash:
						Ge(2);
						break;
					default: return;
				}
				break;
			default: if (ve[e]) ++P.pos;
			else return;
		}
	}
}
function qe(e, t = A.NONE) {
	P.end = P.pos, P.type = e, P.contextualKeyword = t;
}
function Je() {
	let e = F.charCodeAt(P.pos + 1);
	if (e >= M.digit0 && e <= M.digit9) {
		ut(!0);
		return;
	}
	e === M.dot && F.charCodeAt(P.pos + 2) === M.dot ? (P.pos += 3, qe(j.ellipsis)) : (++P.pos, qe(j.dot));
}
function Ye() {
	F.charCodeAt(P.pos + 1) === M.equalsTo ? ot(j.assign, 2) : ot(j.slash, 1);
}
function Xe(e) {
	let t = e === M.asterisk ? j.star : j.modulo, n = 1, r = F.charCodeAt(P.pos + 1);
	e === M.asterisk && r === M.asterisk && (n++, r = F.charCodeAt(P.pos + 2), t = j.exponent), r === M.equalsTo && F.charCodeAt(P.pos + 2) !== M.greaterThan && (n++, t = j.assign), ot(t, n);
}
function Ze(e) {
	let t = F.charCodeAt(P.pos + 1);
	if (t === e) {
		F.charCodeAt(P.pos + 2) === M.equalsTo ? ot(j.assign, 3) : ot(e === M.verticalBar ? j.logicalOR : j.logicalAND, 2);
		return;
	}
	if (e === M.verticalBar) {
		if (t === M.greaterThan) {
			ot(j.pipeline, 2);
			return;
		} else if (t === M.rightCurlyBrace && ce) {
			ot(j.braceBarR, 2);
			return;
		}
	}
	if (t === M.equalsTo) {
		ot(j.assign, 2);
		return;
	}
	ot(e === M.verticalBar ? j.bitwiseOR : j.bitwiseAND, 1);
}
function Qe() {
	F.charCodeAt(P.pos + 1) === M.equalsTo ? ot(j.assign, 2) : ot(j.bitwiseXOR, 1);
}
function $e(e) {
	let t = F.charCodeAt(P.pos + 1);
	if (t === e) {
		ot(j.preIncDec, 2);
		return;
	}
	t === M.equalsTo ? ot(j.assign, 2) : e === M.plusSign ? ot(j.plus, 1) : ot(j.minus, 1);
}
function et() {
	let e = F.charCodeAt(P.pos + 1);
	if (e === M.lessThan) {
		if (F.charCodeAt(P.pos + 2) === M.equalsTo) {
			ot(j.assign, 3);
			return;
		}
		P.isType ? ot(j.lessThan, 1) : ot(j.bitShiftL, 2);
		return;
	}
	e === M.equalsTo ? ot(j.relationalOrEqual, 2) : ot(j.lessThan, 1);
}
function tt() {
	if (P.isType) {
		ot(j.greaterThan, 1);
		return;
	}
	let e = F.charCodeAt(P.pos + 1);
	if (e === M.greaterThan) {
		let e = F.charCodeAt(P.pos + 2) === M.greaterThan ? 3 : 2;
		if (F.charCodeAt(P.pos + e) === M.equalsTo) {
			ot(j.assign, e + 1);
			return;
		}
		ot(j.bitShiftR, e);
		return;
	}
	e === M.equalsTo ? ot(j.relationalOrEqual, 2) : ot(j.greaterThan, 1);
}
function nt() {
	P.type === j.greaterThan && (--P.pos, tt());
}
function rt(e) {
	let t = F.charCodeAt(P.pos + 1);
	if (t === M.equalsTo) {
		ot(j.equality, F.charCodeAt(P.pos + 2) === M.equalsTo ? 3 : 2);
		return;
	}
	if (e === M.equalsTo && t === M.greaterThan) {
		P.pos += 2, qe(j.arrow);
		return;
	}
	ot(e === M.equalsTo ? j.eq : j.bang, 1);
}
function it() {
	let e = F.charCodeAt(P.pos + 1), t = F.charCodeAt(P.pos + 2);
	e === M.questionMark && !(ce && P.isType) ? t === M.equalsTo ? ot(j.assign, 3) : ot(j.nullishCoalescing, 2) : e === M.dot && !(t >= M.digit0 && t <= M.digit9) ? (P.pos += 2, qe(j.questionDot)) : (++P.pos, qe(j.question));
}
function at(e) {
	switch (e) {
		case M.numberSign:
			++P.pos, qe(j.hash);
			return;
		case M.dot:
			Je();
			return;
		case M.leftParenthesis:
			++P.pos, qe(j.parenL);
			return;
		case M.rightParenthesis:
			++P.pos, qe(j.parenR);
			return;
		case M.semicolon:
			++P.pos, qe(j.semi);
			return;
		case M.comma:
			++P.pos, qe(j.comma);
			return;
		case M.leftSquareBracket:
			++P.pos, qe(j.bracketL);
			return;
		case M.rightSquareBracket:
			++P.pos, qe(j.bracketR);
			return;
		case M.leftCurlyBrace:
			ce && F.charCodeAt(P.pos + 1) === M.verticalBar ? ot(j.braceBarL, 2) : (++P.pos, qe(j.braceL));
			return;
		case M.rightCurlyBrace:
			++P.pos, qe(j.braceR);
			return;
		case M.colon:
			F.charCodeAt(P.pos + 1) === M.colon ? ot(j.doubleColon, 2) : (++P.pos, qe(j.colon));
			return;
		case M.questionMark:
			it();
			return;
		case M.atSign:
			++P.pos, qe(j.at);
			return;
		case M.graveAccent:
			++P.pos, qe(j.backQuote);
			return;
		case M.digit0: {
			let e = F.charCodeAt(P.pos + 1);
			if (e === M.lowercaseX || e === M.uppercaseX || e === M.lowercaseO || e === M.uppercaseO || e === M.lowercaseB || e === M.uppercaseB) {
				lt();
				return;
			}
		}
		case M.digit1:
		case M.digit2:
		case M.digit3:
		case M.digit4:
		case M.digit5:
		case M.digit6:
		case M.digit7:
		case M.digit8:
		case M.digit9:
			ut(!1);
			return;
		case M.quotationMark:
		case M.apostrophe:
			dt(e);
			return;
		case M.slash:
			Ye();
			return;
		case M.percentSign:
		case M.asterisk:
			Xe(e);
			return;
		case M.verticalBar:
		case M.ampersand:
			Ze(e);
			return;
		case M.caret:
			Qe();
			return;
		case M.plusSign:
		case M.dash:
			$e(e);
			return;
		case M.lessThan:
			et();
			return;
		case M.greaterThan:
			tt();
			return;
		case M.equalsTo:
		case M.exclamationMark:
			rt(e);
			return;
		case M.tilde:
			ot(j.tilde, 1);
			return;
		default: break;
	}
	W(`Unexpected character '${String.fromCharCode(e)}'`, P.pos);
}
function ot(e, t) {
	P.pos += t, qe(e);
}
function st() {
	let e = P.pos, t = !1, n = !1;
	for (;;) {
		if (P.pos >= F.length) {
			W("Unterminated regular expression", e);
			return;
		}
		let r = F.charCodeAt(P.pos);
		if (t) t = !1;
		else {
			if (r === M.leftSquareBracket) n = !0;
			else if (r === M.rightSquareBracket && n) n = !1;
			else if (r === M.slash && !n) break;
			t = r === M.backslash;
		}
		++P.pos;
	}
	++P.pos, pt(), qe(j.regexp);
}
function ct() {
	for (;;) {
		let e = F.charCodeAt(P.pos);
		if (e >= M.digit0 && e <= M.digit9 || e === M.underscore) P.pos++;
		else break;
	}
}
function lt() {
	for (P.pos += 2;;) {
		let e = F.charCodeAt(P.pos);
		if (e >= M.digit0 && e <= M.digit9 || e >= M.lowercaseA && e <= M.lowercaseF || e >= M.uppercaseA && e <= M.uppercaseF || e === M.underscore) P.pos++;
		else break;
	}
	F.charCodeAt(P.pos) === M.lowercaseN ? (++P.pos, qe(j.bigint)) : qe(j.num);
}
function ut(e) {
	let t = !1, n = !1;
	e || ct();
	let r = F.charCodeAt(P.pos);
	if (r === M.dot && (++P.pos, ct(), r = F.charCodeAt(P.pos)), (r === M.uppercaseE || r === M.lowercaseE) && (r = F.charCodeAt(++P.pos), (r === M.plusSign || r === M.dash) && ++P.pos, ct(), r = F.charCodeAt(P.pos)), r === M.lowercaseN ? (++P.pos, t = !0) : r === M.lowercaseM && (++P.pos, n = !0), t) {
		qe(j.bigint);
		return;
	}
	if (n) {
		qe(j.decimal);
		return;
	}
	qe(j.num);
}
function dt(e) {
	for (P.pos++;;) {
		if (P.pos >= F.length) {
			W("Unterminated string constant");
			return;
		}
		let t = F.charCodeAt(P.pos);
		if (t === M.backslash) P.pos++;
		else if (t === e) break;
		P.pos++;
	}
	P.pos++, qe(j.string);
}
function ft() {
	for (;;) {
		if (P.pos >= F.length) {
			W("Unterminated template");
			return;
		}
		let e = F.charCodeAt(P.pos);
		if (e === M.graveAccent || e === M.dollarSign && F.charCodeAt(P.pos + 1) === M.leftCurlyBrace) {
			if (P.pos === P.start && X(j.template)) if (e === M.dollarSign) {
				P.pos += 2, qe(j.dollarBraceL);
				return;
			} else {
				++P.pos, qe(j.backQuote);
				return;
			}
			qe(j.template);
			return;
		}
		e === M.backslash && P.pos++, P.pos++;
	}
}
function pt() {
	for (; P.pos < F.length;) {
		let e = F.charCodeAt(P.pos);
		if (be[e]) P.pos++;
		else if (e === M.backslash) {
			if (P.pos += 2, F.charCodeAt(P.pos) === M.leftCurlyBrace) {
				for (; P.pos < F.length && F.charCodeAt(P.pos) !== M.rightCurlyBrace;) P.pos++;
				P.pos++;
			}
		} else break;
	}
}
//#endregion
//#region node_modules/sucrase/dist/esm/util/getImportExportSpecifierInfo.js
function mt(e, t = e.currentIndex()) {
	let n = t + 1;
	if (ht(e, n)) {
		let r = e.identifierNameAtIndex(t);
		return {
			isType: !1,
			leftName: r,
			rightName: r,
			endIndex: n
		};
	}
	if (n++, ht(e, n)) return {
		isType: !0,
		leftName: null,
		rightName: null,
		endIndex: n
	};
	if (n++, ht(e, n)) return {
		isType: !1,
		leftName: e.identifierNameAtIndex(t),
		rightName: e.identifierNameAtIndex(t + 2),
		endIndex: n
	};
	if (n++, ht(e, n)) return {
		isType: !0,
		leftName: null,
		rightName: null,
		endIndex: n
	};
	throw Error(`Unexpected import/export specifier at ${t}`);
}
function ht(e, t) {
	let n = e.tokens[t];
	return n.type === j.braceR || n.type === j.comma;
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/plugins/jsx/xhtml.js
var gt = /* @__PURE__ */ new Map([
	["quot", "\""],
	["amp", "&"],
	["apos", "'"],
	["lt", "<"],
	["gt", ">"],
	["nbsp", "\xA0"],
	["iexcl", "¡"],
	["cent", "¢"],
	["pound", "£"],
	["curren", "¤"],
	["yen", "¥"],
	["brvbar", "¦"],
	["sect", "§"],
	["uml", "¨"],
	["copy", "©"],
	["ordf", "ª"],
	["laquo", "«"],
	["not", "¬"],
	["shy", "­"],
	["reg", "®"],
	["macr", "¯"],
	["deg", "°"],
	["plusmn", "±"],
	["sup2", "²"],
	["sup3", "³"],
	["acute", "´"],
	["micro", "µ"],
	["para", "¶"],
	["middot", "·"],
	["cedil", "¸"],
	["sup1", "¹"],
	["ordm", "º"],
	["raquo", "»"],
	["frac14", "¼"],
	["frac12", "½"],
	["frac34", "¾"],
	["iquest", "¿"],
	["Agrave", "À"],
	["Aacute", "Á"],
	["Acirc", "Â"],
	["Atilde", "Ã"],
	["Auml", "Ä"],
	["Aring", "Å"],
	["AElig", "Æ"],
	["Ccedil", "Ç"],
	["Egrave", "È"],
	["Eacute", "É"],
	["Ecirc", "Ê"],
	["Euml", "Ë"],
	["Igrave", "Ì"],
	["Iacute", "Í"],
	["Icirc", "Î"],
	["Iuml", "Ï"],
	["ETH", "Ð"],
	["Ntilde", "Ñ"],
	["Ograve", "Ò"],
	["Oacute", "Ó"],
	["Ocirc", "Ô"],
	["Otilde", "Õ"],
	["Ouml", "Ö"],
	["times", "×"],
	["Oslash", "Ø"],
	["Ugrave", "Ù"],
	["Uacute", "Ú"],
	["Ucirc", "Û"],
	["Uuml", "Ü"],
	["Yacute", "Ý"],
	["THORN", "Þ"],
	["szlig", "ß"],
	["agrave", "à"],
	["aacute", "á"],
	["acirc", "â"],
	["atilde", "ã"],
	["auml", "ä"],
	["aring", "å"],
	["aelig", "æ"],
	["ccedil", "ç"],
	["egrave", "è"],
	["eacute", "é"],
	["ecirc", "ê"],
	["euml", "ë"],
	["igrave", "ì"],
	["iacute", "í"],
	["icirc", "î"],
	["iuml", "ï"],
	["eth", "ð"],
	["ntilde", "ñ"],
	["ograve", "ò"],
	["oacute", "ó"],
	["ocirc", "ô"],
	["otilde", "õ"],
	["ouml", "ö"],
	["divide", "÷"],
	["oslash", "ø"],
	["ugrave", "ù"],
	["uacute", "ú"],
	["ucirc", "û"],
	["uuml", "ü"],
	["yacute", "ý"],
	["thorn", "þ"],
	["yuml", "ÿ"],
	["OElig", "Œ"],
	["oelig", "œ"],
	["Scaron", "Š"],
	["scaron", "š"],
	["Yuml", "Ÿ"],
	["fnof", "ƒ"],
	["circ", "ˆ"],
	["tilde", "˜"],
	["Alpha", "Α"],
	["Beta", "Β"],
	["Gamma", "Γ"],
	["Delta", "Δ"],
	["Epsilon", "Ε"],
	["Zeta", "Ζ"],
	["Eta", "Η"],
	["Theta", "Θ"],
	["Iota", "Ι"],
	["Kappa", "Κ"],
	["Lambda", "Λ"],
	["Mu", "Μ"],
	["Nu", "Ν"],
	["Xi", "Ξ"],
	["Omicron", "Ο"],
	["Pi", "Π"],
	["Rho", "Ρ"],
	["Sigma", "Σ"],
	["Tau", "Τ"],
	["Upsilon", "Υ"],
	["Phi", "Φ"],
	["Chi", "Χ"],
	["Psi", "Ψ"],
	["Omega", "Ω"],
	["alpha", "α"],
	["beta", "β"],
	["gamma", "γ"],
	["delta", "δ"],
	["epsilon", "ε"],
	["zeta", "ζ"],
	["eta", "η"],
	["theta", "θ"],
	["iota", "ι"],
	["kappa", "κ"],
	["lambda", "λ"],
	["mu", "μ"],
	["nu", "ν"],
	["xi", "ξ"],
	["omicron", "ο"],
	["pi", "π"],
	["rho", "ρ"],
	["sigmaf", "ς"],
	["sigma", "σ"],
	["tau", "τ"],
	["upsilon", "υ"],
	["phi", "φ"],
	["chi", "χ"],
	["psi", "ψ"],
	["omega", "ω"],
	["thetasym", "ϑ"],
	["upsih", "ϒ"],
	["piv", "ϖ"],
	["ensp", " "],
	["emsp", " "],
	["thinsp", " "],
	["zwnj", "‌"],
	["zwj", "‍"],
	["lrm", "‎"],
	["rlm", "‏"],
	["ndash", "–"],
	["mdash", "—"],
	["lsquo", "‘"],
	["rsquo", "’"],
	["sbquo", "‚"],
	["ldquo", "“"],
	["rdquo", "”"],
	["bdquo", "„"],
	["dagger", "†"],
	["Dagger", "‡"],
	["bull", "•"],
	["hellip", "…"],
	["permil", "‰"],
	["prime", "′"],
	["Prime", "″"],
	["lsaquo", "‹"],
	["rsaquo", "›"],
	["oline", "‾"],
	["frasl", "⁄"],
	["euro", "€"],
	["image", "ℑ"],
	["weierp", "℘"],
	["real", "ℜ"],
	["trade", "™"],
	["alefsym", "ℵ"],
	["larr", "←"],
	["uarr", "↑"],
	["rarr", "→"],
	["darr", "↓"],
	["harr", "↔"],
	["crarr", "↵"],
	["lArr", "⇐"],
	["uArr", "⇑"],
	["rArr", "⇒"],
	["dArr", "⇓"],
	["hArr", "⇔"],
	["forall", "∀"],
	["part", "∂"],
	["exist", "∃"],
	["empty", "∅"],
	["nabla", "∇"],
	["isin", "∈"],
	["notin", "∉"],
	["ni", "∋"],
	["prod", "∏"],
	["sum", "∑"],
	["minus", "−"],
	["lowast", "∗"],
	["radic", "√"],
	["prop", "∝"],
	["infin", "∞"],
	["ang", "∠"],
	["and", "∧"],
	["or", "∨"],
	["cap", "∩"],
	["cup", "∪"],
	["int", "∫"],
	["there4", "∴"],
	["sim", "∼"],
	["cong", "≅"],
	["asymp", "≈"],
	["ne", "≠"],
	["equiv", "≡"],
	["le", "≤"],
	["ge", "≥"],
	["sub", "⊂"],
	["sup", "⊃"],
	["nsub", "⊄"],
	["sube", "⊆"],
	["supe", "⊇"],
	["oplus", "⊕"],
	["otimes", "⊗"],
	["perp", "⊥"],
	["sdot", "⋅"],
	["lceil", "⌈"],
	["rceil", "⌉"],
	["lfloor", "⌊"],
	["rfloor", "⌋"],
	["lang", "〈"],
	["rang", "〉"],
	["loz", "◊"],
	["spades", "♠"],
	["clubs", "♣"],
	["hearts", "♥"],
	["diams", "♦"]
]);
//#endregion
//#region node_modules/sucrase/dist/esm/util/getJSXPragmaInfo.js
function _t(e) {
	let [t, n] = vt(e.jsxPragma || "React.createElement"), [r, i] = vt(e.jsxFragmentPragma || "React.Fragment");
	return {
		base: t,
		suffix: n,
		fragmentBase: r,
		fragmentSuffix: i
	};
}
function vt(e) {
	let t = e.indexOf(".");
	return t === -1 && (t = e.length), [e.slice(0, t), e.slice(t)];
}
//#endregion
//#region node_modules/sucrase/dist/esm/transformers/Transformer.js
var yt = class {
	getPrefixCode() {
		return "";
	}
	getHoistedCode() {
		return "";
	}
	getSuffixCode() {
		return "";
	}
}, bt = class e extends yt {
	__init() {
		this.lastLineNumber = 1;
	}
	__init2() {
		this.lastIndex = 0;
	}
	__init3() {
		this.filenameVarName = null;
	}
	__init4() {
		this.esmAutomaticImportNameResolutions = {};
	}
	__init5() {
		this.cjsAutomaticModuleNameResolutions = {};
	}
	constructor(t, n, r, i, a) {
		super(), this.rootTransformer = t, this.tokens = n, this.importProcessor = r, this.nameManager = i, this.options = a, e.prototype.__init.call(this), e.prototype.__init2.call(this), e.prototype.__init3.call(this), e.prototype.__init4.call(this), e.prototype.__init5.call(this), this.jsxPragmaInfo = _t(a), this.isAutomaticRuntime = a.jsxRuntime === "automatic", this.jsxImportSource = a.jsxImportSource || "react";
	}
	process() {
		return this.tokens.matches1(j.jsxTagStart) ? (this.processJSXTag(), !0) : !1;
	}
	getPrefixCode() {
		let e = "";
		if (this.filenameVarName && (e += `const ${this.filenameVarName} = ${JSON.stringify(this.options.filePath || "")};`), this.isAutomaticRuntime) if (this.importProcessor) for (let [t, n] of Object.entries(this.cjsAutomaticModuleNameResolutions)) e += `var ${n} = require("${t}");`;
		else {
			let { createElement: t, ...n } = this.esmAutomaticImportNameResolutions;
			t && (e += `import {createElement as ${t}} from "${this.jsxImportSource}";`);
			let r = Object.entries(n).map(([e, t]) => `${e} as ${t}`).join(", ");
			if (r) {
				let t = this.jsxImportSource + (this.options.production ? "/jsx-runtime" : "/jsx-dev-runtime");
				e += `import {${r}} from "${t}";`;
			}
		}
		return e;
	}
	processJSXTag() {
		let { jsxRole: e, start: t } = this.tokens.currentToken(), n = this.options.production ? null : this.getElementLocationCode(t);
		this.isAutomaticRuntime && e !== we.KeyAfterPropSpread ? this.transformTagToJSXFunc(n, e) : this.transformTagToCreateElement(n);
	}
	getElementLocationCode(e) {
		return `lineNumber: ${this.getLineNumberForIndex(e)}`;
	}
	getLineNumberForIndex(e) {
		let t = this.tokens.code;
		for (; this.lastIndex < e && this.lastIndex < t.length;) t[this.lastIndex] === "\n" && this.lastLineNumber++, this.lastIndex++;
		return this.lastLineNumber;
	}
	transformTagToJSXFunc(e, t) {
		let n = t === we.StaticChildren;
		this.tokens.replaceToken(this.getJSXFuncInvocationCode(n));
		let r = null;
		if (this.tokens.matches1(j.jsxTagEnd)) this.tokens.replaceToken(`${this.getFragmentCode()}, {`), this.processAutomaticChildrenAndEndProps(t);
		else {
			if (this.processTagIntro(), this.tokens.appendCode(", {"), r = this.processProps(!0), this.tokens.matches2(j.slash, j.jsxTagEnd)) this.tokens.appendCode("}");
			else if (this.tokens.matches1(j.jsxTagEnd)) this.tokens.removeToken(), this.processAutomaticChildrenAndEndProps(t);
			else throw Error("Expected either /> or > at the end of the tag.");
			r && this.tokens.appendCode(`, ${r}`);
		}
		for (this.options.production || (r === null && this.tokens.appendCode(", void 0"), this.tokens.appendCode(`, ${n}, ${this.getDevSource(e)}, this`)), this.tokens.removeInitialToken(); !this.tokens.matches1(j.jsxTagEnd);) this.tokens.removeToken();
		this.tokens.replaceToken(")");
	}
	transformTagToCreateElement(e) {
		if (this.tokens.replaceToken(this.getCreateElementInvocationCode()), this.tokens.matches1(j.jsxTagEnd)) this.tokens.replaceToken(`${this.getFragmentCode()}, null`), this.processChildren(!0);
		else if (this.processTagIntro(), this.processPropsObjectWithDevInfo(e), !this.tokens.matches2(j.slash, j.jsxTagEnd)) if (this.tokens.matches1(j.jsxTagEnd)) this.tokens.removeToken(), this.processChildren(!0);
		else throw Error("Expected either /> or > at the end of the tag.");
		for (this.tokens.removeInitialToken(); !this.tokens.matches1(j.jsxTagEnd);) this.tokens.removeToken();
		this.tokens.replaceToken(")");
	}
	getJSXFuncInvocationCode(e) {
		return this.options.production ? e ? this.claimAutoImportedFuncInvocation("jsxs", "/jsx-runtime") : this.claimAutoImportedFuncInvocation("jsx", "/jsx-runtime") : this.claimAutoImportedFuncInvocation("jsxDEV", "/jsx-dev-runtime");
	}
	getCreateElementInvocationCode() {
		if (this.isAutomaticRuntime) return this.claimAutoImportedFuncInvocation("createElement", "");
		{
			let { jsxPragmaInfo: e } = this;
			return `${this.importProcessor && this.importProcessor.getIdentifierReplacement(e.base) || e.base}${e.suffix}(`;
		}
	}
	getFragmentCode() {
		if (this.isAutomaticRuntime) return this.claimAutoImportedName("Fragment", this.options.production ? "/jsx-runtime" : "/jsx-dev-runtime");
		{
			let { jsxPragmaInfo: e } = this;
			return (this.importProcessor && this.importProcessor.getIdentifierReplacement(e.fragmentBase) || e.fragmentBase) + e.fragmentSuffix;
		}
	}
	claimAutoImportedFuncInvocation(e, t) {
		let n = this.claimAutoImportedName(e, t);
		return this.importProcessor ? `${n}.call(void 0, ` : `${n}(`;
	}
	claimAutoImportedName(e, t) {
		if (this.importProcessor) {
			let n = this.jsxImportSource + t;
			return this.cjsAutomaticModuleNameResolutions[n] || (this.cjsAutomaticModuleNameResolutions[n] = this.importProcessor.getFreeIdentifierForPath(n)), `${this.cjsAutomaticModuleNameResolutions[n]}.${e}`;
		} else return this.esmAutomaticImportNameResolutions[e] || (this.esmAutomaticImportNameResolutions[e] = this.nameManager.claimFreeName(`_${e}`)), this.esmAutomaticImportNameResolutions[e];
	}
	processTagIntro() {
		let e = this.tokens.currentIndex() + 1;
		for (; this.tokens.tokens[e].isType || !this.tokens.matches2AtIndex(e - 1, j.jsxName, j.jsxName) && !this.tokens.matches2AtIndex(e - 1, j.greaterThan, j.jsxName) && !this.tokens.matches1AtIndex(e, j.braceL) && !this.tokens.matches1AtIndex(e, j.jsxTagEnd) && !this.tokens.matches2AtIndex(e, j.slash, j.jsxTagEnd);) e++;
		if (e === this.tokens.currentIndex() + 1) {
			let e = this.tokens.identifierName();
			xt(e) && this.tokens.replaceToken(`'${e}'`);
		}
		for (; this.tokens.currentIndex() < e;) this.rootTransformer.processToken();
	}
	processPropsObjectWithDevInfo(e) {
		let t = this.options.production ? "" : `__self: this, __source: ${this.getDevSource(e)}`;
		if (!this.tokens.matches1(j.jsxName) && !this.tokens.matches1(j.braceL)) {
			t ? this.tokens.appendCode(`, {${t}}`) : this.tokens.appendCode(", null");
			return;
		}
		this.tokens.appendCode(", {"), this.processProps(!1), t ? this.tokens.appendCode(` ${t}}`) : this.tokens.appendCode("}");
	}
	processProps(e) {
		let t = null;
		for (;;) {
			if (this.tokens.matches2(j.jsxName, j.eq)) {
				let n = this.tokens.identifierName();
				if (e && n === "key") {
					t !== null && this.tokens.appendCode(t.replace(/[^\n]/g, "")), this.tokens.removeToken(), this.tokens.removeToken();
					let e = this.tokens.snapshot();
					this.processPropValue(), t = this.tokens.dangerouslyGetAndRemoveCodeSinceSnapshot(e);
					continue;
				} else this.processPropName(n), this.tokens.replaceToken(": "), this.processPropValue();
			} else if (this.tokens.matches1(j.jsxName)) {
				let e = this.tokens.identifierName();
				this.processPropName(e), this.tokens.appendCode(": true");
			} else if (this.tokens.matches1(j.braceL)) this.tokens.replaceToken(""), this.rootTransformer.processBalancedCode(), this.tokens.replaceToken("");
			else break;
			this.tokens.appendCode(",");
		}
		return t;
	}
	processPropName(e) {
		e.includes("-") ? this.tokens.replaceToken(`'${e}'`) : this.tokens.copyToken();
	}
	processPropValue() {
		this.tokens.matches1(j.braceL) ? (this.tokens.replaceToken(""), this.rootTransformer.processBalancedCode(), this.tokens.replaceToken("")) : this.tokens.matches1(j.jsxTagStart) ? this.processJSXTag() : this.processStringPropValue();
	}
	processStringPropValue() {
		let e = this.tokens.currentToken(), t = this.tokens.code.slice(e.start + 1, e.end - 1), n = Ct(t), r = wt(t);
		this.tokens.replaceToken(r + n);
	}
	processAutomaticChildrenAndEndProps(e) {
		e === we.StaticChildren ? (this.tokens.appendCode(" children: ["), this.processChildren(!1), this.tokens.appendCode("]}")) : (e === we.OneChild && this.tokens.appendCode(" children: "), this.processChildren(!1), this.tokens.appendCode("}"));
	}
	processChildren(e) {
		let t = e;
		for (;;) {
			if (this.tokens.matches2(j.jsxTagStart, j.slash)) return;
			let e = !1;
			if (this.tokens.matches1(j.braceL)) this.tokens.matches2(j.braceL, j.braceR) ? (this.tokens.replaceToken(""), this.tokens.replaceToken("")) : (this.tokens.replaceToken(t ? ", " : ""), this.rootTransformer.processBalancedCode(), this.tokens.replaceToken(""), e = !0);
			else if (this.tokens.matches1(j.jsxTagStart)) this.tokens.appendCode(t ? ", " : ""), this.processJSXTag(), e = !0;
			else if (this.tokens.matches1(j.jsxText) || this.tokens.matches1(j.jsxEmptyText)) e = this.processChildTextElement(t);
			else throw Error("Unexpected token when processing JSX children.");
			e && (t = !0);
		}
	}
	processChildTextElement(e) {
		let t = this.tokens.currentToken(), n = this.tokens.code.slice(t.start, t.end), r = Ct(n), i = St(n);
		return i === "\"\"" ? (this.tokens.replaceToken(r), !1) : (this.tokens.replaceToken(`${e ? ", " : ""}${i}${r}`), !0);
	}
	getDevSource(e) {
		return `{fileName: ${this.getFilenameVarName()}, ${e}}`;
	}
	getFilenameVarName() {
		return this.filenameVarName ||= this.nameManager.claimFreeName("_jsxFileName"), this.filenameVarName;
	}
};
function xt(e) {
	let t = e.charCodeAt(0);
	return t >= M.lowercaseA && t <= M.lowercaseZ;
}
function St(e) {
	let t = "", n = "", r = !1, i = !1;
	for (let a = 0; a < e.length; a++) {
		let o = e[a];
		if (o === " " || o === "	" || o === "\r") r || (n += o);
		else if (o === "\n") n = "", r = !0;
		else {
			if (i && r && (t += " "), t += n, n = "", o === "&") {
				let { entity: n, newI: r } = Tt(e, a + 1);
				a = r - 1, t += n;
			} else t += o;
			i = !0, r = !1;
		}
	}
	return r || (t += n), JSON.stringify(t);
}
function Ct(e) {
	let t = 0, n = 0;
	for (let r of e) r === "\n" ? (t++, n = 0) : r === " " && n++;
	return "\n".repeat(t) + " ".repeat(n);
}
function wt(e) {
	let t = "";
	for (let n = 0; n < e.length; n++) {
		let r = e[n];
		if (r === "\n") if (/\s/.test(e[n + 1])) for (t += " "; n < e.length && /\s/.test(e[n + 1]);) n++;
		else t += "\n";
		else if (r === "&") {
			let { entity: r, newI: i } = Tt(e, n + 1);
			t += r, n = i - 1;
		} else t += r;
	}
	return JSON.stringify(t);
}
function Tt(e, t) {
	let n = "", r = 0, i, a = t;
	if (e[a] === "#") {
		let t = 10;
		a++;
		let n;
		if (e[a] === "x") for (t = 16, a++, n = a; a < e.length && Dt(e.charCodeAt(a));) a++;
		else for (n = a; a < e.length && Et(e.charCodeAt(a));) a++;
		if (e[a] === ";") {
			let r = e.slice(n, a);
			r && (a++, i = String.fromCodePoint(parseInt(r, t)));
		}
	} else for (; a < e.length && r++ < 10;) {
		let t = e[a];
		if (a++, t === ";") {
			i = gt.get(n);
			break;
		}
		n += t;
	}
	return i ? {
		entity: i,
		newI: a
	} : {
		entity: "&",
		newI: t
	};
}
function Et(e) {
	return e >= M.digit0 && e <= M.digit9;
}
function Dt(e) {
	return e >= M.digit0 && e <= M.digit9 || e >= M.lowercaseA && e <= M.lowercaseF || e >= M.uppercaseA && e <= M.uppercaseF;
}
//#endregion
//#region node_modules/sucrase/dist/esm/util/getNonTypeIdentifiers.js
function Ot(e, t) {
	let n = _t(t), r = /* @__PURE__ */ new Set();
	for (let t = 0; t < e.tokens.length; t++) {
		let i = e.tokens[t];
		i.type === j.name && !i.isType && (i.identifierRole === K.Access || i.identifierRole === K.ObjectShorthand || i.identifierRole === K.ExportAccess) && !i.shadowsGlobal && r.add(e.identifierNameForToken(i)), i.type === j.jsxTagStart && r.add(n.base), i.type === j.jsxTagStart && t + 1 < e.tokens.length && e.tokens[t + 1].type === j.jsxTagEnd && (r.add(n.base), r.add(n.fragmentBase)), i.type === j.jsxName && i.identifierRole === K.Access && (!xt(e.identifierNameForToken(i)) || e.tokens[t + 1].type === j.dot) && r.add(e.identifierNameForToken(i));
	}
	return r;
}
//#endregion
//#region node_modules/sucrase/dist/esm/CJSImportProcessor.js
var kt = class e {
	__init() {
		this.nonTypeIdentifiers = /* @__PURE__ */ new Set();
	}
	__init2() {
		this.importInfoByPath = /* @__PURE__ */ new Map();
	}
	__init3() {
		this.importsToReplace = /* @__PURE__ */ new Map();
	}
	__init4() {
		this.identifierReplacements = /* @__PURE__ */ new Map();
	}
	__init5() {
		this.exportBindingsByLocalName = /* @__PURE__ */ new Map();
	}
	constructor(t, n, r, i, a, o, s) {
		this.nameManager = t, this.tokens = n, this.enableLegacyTypeScriptModuleInterop = r, this.options = i, this.isTypeScriptTransformEnabled = a, this.keepUnusedImports = o, this.helperManager = s, e.prototype.__init.call(this), e.prototype.__init2.call(this), e.prototype.__init3.call(this), e.prototype.__init4.call(this), e.prototype.__init5.call(this);
	}
	preprocessTokens() {
		for (let e = 0; e < this.tokens.tokens.length; e++) this.tokens.matches1AtIndex(e, j._import) && !this.tokens.matches3AtIndex(e, j._import, j.name, j.eq) && this.preprocessImportAtIndex(e), this.tokens.matches1AtIndex(e, j._export) && !this.tokens.matches2AtIndex(e, j._export, j.eq) && this.preprocessExportAtIndex(e);
		this.generateImportReplacements();
	}
	pruneTypeOnlyImports() {
		this.nonTypeIdentifiers = Ot(this.tokens, this.options);
		for (let [e, t] of this.importInfoByPath.entries()) t.hasBareImport || t.hasStarExport || t.exportStarNames.length > 0 || t.namedExports.length > 0 || [
			...t.defaultNames,
			...t.wildcardNames,
			...t.namedImports.map(({ localName: e }) => e)
		].every((e) => this.shouldAutomaticallyElideImportedName(e)) && this.importsToReplace.set(e, "");
	}
	shouldAutomaticallyElideImportedName(e) {
		return this.isTypeScriptTransformEnabled && !this.keepUnusedImports && !this.nonTypeIdentifiers.has(e);
	}
	generateImportReplacements() {
		for (let [e, t] of this.importInfoByPath.entries()) {
			let { defaultNames: n, wildcardNames: r, namedImports: i, namedExports: a, exportStarNames: o, hasStarExport: s } = t;
			if (n.length === 0 && r.length === 0 && i.length === 0 && a.length === 0 && o.length === 0 && !s) {
				this.importsToReplace.set(e, `require('${e}');`);
				continue;
			}
			let c = this.getFreeIdentifierForPath(e), l;
			l = this.enableLegacyTypeScriptModuleInterop ? c : r.length > 0 ? r[0] : this.getFreeIdentifierForPath(e);
			let u = `var ${c} = require('${e}');`;
			if (r.length > 0) for (let e of r) {
				let t = this.enableLegacyTypeScriptModuleInterop ? c : `${this.helperManager.getHelperName("interopRequireWildcard")}(${c})`;
				u += ` var ${e} = ${t};`;
			}
			else o.length > 0 && l !== c ? u += ` var ${l} = ${this.helperManager.getHelperName("interopRequireWildcard")}(${c});` : n.length > 0 && l !== c && (u += ` var ${l} = ${this.helperManager.getHelperName("interopRequireDefault")}(${c});`);
			for (let { importedName: e, localName: t } of a) u += ` ${this.helperManager.getHelperName("createNamedExportFrom")}(${c}, '${t}', '${e}');`;
			for (let e of o) u += ` exports.${e} = ${l};`;
			s && (u += ` ${this.helperManager.getHelperName("createStarExport")}(${c});`), this.importsToReplace.set(e, u);
			for (let e of n) this.identifierReplacements.set(e, `${l}.default`);
			for (let { importedName: e, localName: t } of i) this.identifierReplacements.set(t, `${c}.${e}`);
		}
	}
	getFreeIdentifierForPath(e) {
		let t = e.split("/"), n = t[t.length - 1].replace(/\W/g, "");
		return this.nameManager.claimFreeName(`_${n}`);
	}
	preprocessImportAtIndex(e) {
		let t = [], n = [], r = [];
		if (e++, (this.tokens.matchesContextualAtIndex(e, A._type) || this.tokens.matches1AtIndex(e, j._typeof)) && !this.tokens.matches1AtIndex(e + 1, j.comma) && !this.tokens.matchesContextualAtIndex(e + 1, A._from) || this.tokens.matches1AtIndex(e, j.parenL)) return;
		if (this.tokens.matches1AtIndex(e, j.name) && (t.push(this.tokens.identifierNameAtIndex(e)), e++, this.tokens.matches1AtIndex(e, j.comma) && e++), this.tokens.matches1AtIndex(e, j.star) && (e += 2, n.push(this.tokens.identifierNameAtIndex(e)), e++), this.tokens.matches1AtIndex(e, j.braceL)) {
			let n = this.getNamedImports(e + 1);
			e = n.newIndex;
			for (let e of n.namedImports) e.importedName === "default" ? t.push(e.localName) : r.push(e);
		}
		if (this.tokens.matchesContextualAtIndex(e, A._from) && e++, !this.tokens.matches1AtIndex(e, j.string)) throw Error("Expected string token at the end of import statement.");
		let i = this.tokens.stringValueAtIndex(e), a = this.getImportInfo(i);
		a.defaultNames.push(...t), a.wildcardNames.push(...n), a.namedImports.push(...r), t.length === 0 && n.length === 0 && r.length === 0 && (a.hasBareImport = !0);
	}
	preprocessExportAtIndex(e) {
		if (this.tokens.matches2AtIndex(e, j._export, j._var) || this.tokens.matches2AtIndex(e, j._export, j._let) || this.tokens.matches2AtIndex(e, j._export, j._const)) this.preprocessVarExportAtIndex(e);
		else if (this.tokens.matches2AtIndex(e, j._export, j._function) || this.tokens.matches2AtIndex(e, j._export, j._class)) {
			let t = this.tokens.identifierNameAtIndex(e + 2);
			this.addExportBinding(t, t);
		} else if (this.tokens.matches3AtIndex(e, j._export, j.name, j._function)) {
			let t = this.tokens.identifierNameAtIndex(e + 3);
			this.addExportBinding(t, t);
		} else this.tokens.matches2AtIndex(e, j._export, j.braceL) ? this.preprocessNamedExportAtIndex(e) : this.tokens.matches2AtIndex(e, j._export, j.star) && this.preprocessExportStarAtIndex(e);
	}
	preprocessVarExportAtIndex(e) {
		let t = 0;
		for (let n = e + 2;; n++) if (this.tokens.matches1AtIndex(n, j.braceL) || this.tokens.matches1AtIndex(n, j.dollarBraceL) || this.tokens.matches1AtIndex(n, j.bracketL)) t++;
		else if (this.tokens.matches1AtIndex(n, j.braceR) || this.tokens.matches1AtIndex(n, j.bracketR)) t--;
		else if (t === 0 && !this.tokens.matches1AtIndex(n, j.name)) break;
		else if (this.tokens.matches1AtIndex(1, j.eq)) {
			let e = this.tokens.currentToken().rhsEndIndex;
			if (e == null) throw Error("Expected = token with an end index.");
			n = e - 1;
		} else {
			let e = this.tokens.tokens[n];
			if (Te(e)) {
				let e = this.tokens.identifierNameAtIndex(n);
				this.identifierReplacements.set(e, `exports.${e}`);
			}
		}
	}
	preprocessNamedExportAtIndex(e) {
		e += 2;
		let { newIndex: t, namedImports: n } = this.getNamedImports(e);
		if (e = t, this.tokens.matchesContextualAtIndex(e, A._from)) e++;
		else {
			for (let { importedName: e, localName: t } of n) this.addExportBinding(e, t);
			return;
		}
		if (!this.tokens.matches1AtIndex(e, j.string)) throw Error("Expected string token at the end of import statement.");
		let r = this.tokens.stringValueAtIndex(e);
		this.getImportInfo(r).namedExports.push(...n);
	}
	preprocessExportStarAtIndex(e) {
		let t = null;
		if (this.tokens.matches3AtIndex(e, j._export, j.star, j._as) ? (e += 3, t = this.tokens.identifierNameAtIndex(e), e += 2) : e += 3, !this.tokens.matches1AtIndex(e, j.string)) throw Error("Expected string token at the end of star export statement.");
		let n = this.tokens.stringValueAtIndex(e), r = this.getImportInfo(n);
		t === null ? r.hasStarExport = !0 : r.exportStarNames.push(t);
	}
	getNamedImports(e) {
		let t = [];
		for (;;) {
			if (this.tokens.matches1AtIndex(e, j.braceR)) {
				e++;
				break;
			}
			let n = mt(this.tokens, e);
			if (e = n.endIndex, n.isType || t.push({
				importedName: n.leftName,
				localName: n.rightName
			}), this.tokens.matches2AtIndex(e, j.comma, j.braceR)) {
				e += 2;
				break;
			} else if (this.tokens.matches1AtIndex(e, j.braceR)) {
				e++;
				break;
			} else if (this.tokens.matches1AtIndex(e, j.comma)) e++;
			else throw Error(`Unexpected token: ${JSON.stringify(this.tokens.tokens[e])}`);
		}
		return {
			newIndex: e,
			namedImports: t
		};
	}
	getImportInfo(e) {
		let t = this.importInfoByPath.get(e);
		if (t) return t;
		let n = {
			defaultNames: [],
			wildcardNames: [],
			namedImports: [],
			namedExports: [],
			hasBareImport: !1,
			exportStarNames: [],
			hasStarExport: !1
		};
		return this.importInfoByPath.set(e, n), n;
	}
	addExportBinding(e, t) {
		this.exportBindingsByLocalName.has(e) || this.exportBindingsByLocalName.set(e, []), this.exportBindingsByLocalName.get(e).push(t);
	}
	claimImportCode(e) {
		let t = this.importsToReplace.get(e);
		return this.importsToReplace.set(e, ""), t || "";
	}
	getIdentifierReplacement(e) {
		return this.identifierReplacements.get(e) || null;
	}
	resolveExportBinding(e) {
		let t = this.exportBindingsByLocalName.get(e);
		return !t || t.length === 0 ? null : t.map((e) => `exports.${e}`).join(" = ");
	}
	getGlobalNames() {
		return /* @__PURE__ */ new Set([...this.identifierReplacements.keys(), ...this.exportBindingsByLocalName.keys()]);
	}
}, At = 44, jt = 59, Mt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Nt = /* @__PURE__ */ new Uint8Array(64), Pt = /* @__PURE__ */ new Uint8Array(128);
for (let e = 0; e < Mt.length; e++) {
	let t = Mt.charCodeAt(e);
	Nt[e] = t, Pt[t] = e;
}
function Ft(e, t, n) {
	let r = t - n;
	r = r < 0 ? -r << 1 | 1 : r << 1;
	do {
		let t = r & 31;
		r >>>= 5, r > 0 && (t |= 32), e.write(Nt[t]);
	} while (r > 0);
	return t;
}
var It = 1024 * 16, Lt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? { decode(e) {
	return Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString();
} } : { decode(e) {
	let t = "";
	for (let n = 0; n < e.length; n++) t += String.fromCharCode(e[n]);
	return t;
} }, Rt = class {
	constructor() {
		this.pos = 0, this.out = "", this.buffer = new Uint8Array(It);
	}
	write(e) {
		let { buffer: t } = this;
		t[this.pos++] = e, this.pos === It && (this.out += Lt.decode(t), this.pos = 0);
	}
	flush() {
		let { buffer: e, out: t, pos: n } = this;
		return n > 0 ? t + Lt.decode(e.subarray(0, n)) : t;
	}
};
function zt(e) {
	let t = new Rt(), n = 0, r = 0, i = 0, a = 0;
	for (let o = 0; o < e.length; o++) {
		let s = e[o];
		if (o > 0 && t.write(jt), s.length === 0) continue;
		let c = 0;
		for (let e = 0; e < s.length; e++) {
			let o = s[e];
			e > 0 && t.write(At), c = Ft(t, o[0], c), o.length !== 1 && (n = Ft(t, o[1], n), r = Ft(t, o[2], r), i = Ft(t, o[3], i), o.length !== 4 && (a = Ft(t, o[4], a)));
		}
	}
	return t.flush();
}
(/* @__PURE__ */ o(((e, t) => {
	(function(n, r) {
		typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self, n.resolveURI = r());
	})(e, (function() {
		let e = /^[\w+.-]+:\/\//, t = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/, n = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
		function r(t) {
			return e.test(t);
		}
		function i(e) {
			return e.startsWith("//");
		}
		function a(e) {
			return e.startsWith("/");
		}
		function o(e) {
			return e.startsWith("file:");
		}
		function s(e) {
			return /^[.?#]/.test(e);
		}
		function c(e) {
			let n = t.exec(e);
			return u(n[1], n[2] || "", n[3], n[4] || "", n[5] || "/", n[6] || "", n[7] || "");
		}
		function l(e) {
			let t = n.exec(e), r = t[2];
			return u("file:", "", t[1] || "", "", a(r) ? r : "/" + r, t[3] || "", t[4] || "");
		}
		function u(e, t, n, r, i, a, o) {
			return {
				scheme: e,
				user: t,
				host: n,
				port: r,
				path: i,
				query: a,
				hash: o,
				type: 7
			};
		}
		function d(e) {
			if (i(e)) {
				let t = c("http:" + e);
				return t.scheme = "", t.type = 6, t;
			}
			if (a(e)) {
				let t = c("http://foo.com" + e);
				return t.scheme = "", t.host = "", t.type = 5, t;
			}
			if (o(e)) return l(e);
			if (r(e)) return c(e);
			let t = c("http://foo.com/" + e);
			return t.scheme = "", t.host = "", t.type = e ? e.startsWith("?") ? 3 : e.startsWith("#") ? 2 : 4 : 1, t;
		}
		function f(e) {
			if (e.endsWith("/..")) return e;
			let t = e.lastIndexOf("/");
			return e.slice(0, t + 1);
		}
		function p(e, t) {
			m(t, t.type), e.path === "/" ? e.path = t.path : e.path = f(t.path) + e.path;
		}
		function m(e, t) {
			let n = t <= 4, r = e.path.split("/"), i = 1, a = 0, o = !1;
			for (let e = 1; e < r.length; e++) {
				let t = r[e];
				if (!t) {
					o = !0;
					continue;
				}
				if (o = !1, t !== ".") {
					if (t === "..") {
						a ? (o = !0, a--, i--) : n && (r[i++] = t);
						continue;
					}
					r[i++] = t, a++;
				}
			}
			let s = "";
			for (let e = 1; e < i; e++) s += "/" + r[e];
			(!s || o && !s.endsWith("/..")) && (s += "/"), e.path = s;
		}
		function h(e, t) {
			if (!e && !t) return "";
			let n = d(e), r = n.type;
			if (t && r !== 7) {
				let e = d(t), i = e.type;
				switch (r) {
					case 1: n.hash = e.hash;
					case 2: n.query = e.query;
					case 3:
					case 4: p(n, e);
					case 5: n.user = e.user, n.host = e.host, n.port = e.port;
					case 6: n.scheme = e.scheme;
				}
				i > r && (r = i);
			}
			m(n, r);
			let i = n.query + n.hash;
			switch (r) {
				case 2:
				case 3: return i;
				case 4: {
					let r = n.path.slice(1);
					return r ? s(t || e) && !s(r) ? "./" + r + i : r + i : i || ".";
				}
				case 5: return n.path + i;
				default: return n.scheme + "//" + n.user + n.host + n.port + n.path + i;
			}
		}
		return h;
	}));
})))();
//#endregion
//#region node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs
var Bt = class {
	constructor() {
		this._indexes = { __proto__: null }, this.array = [];
	}
};
function Vt(e) {
	return e;
}
function Ht(e, t) {
	return Vt(e)._indexes[t];
}
function Ut(e, t) {
	let n = Ht(e, t);
	if (n !== void 0) return n;
	let { array: r, _indexes: i } = Vt(e);
	return i[t] = r.push(t) - 1;
}
var Wt = 0, Gt = 1, Kt = 2, qt = 3, Jt = 4, Yt = -1, Xt = class {
	constructor({ file: e, sourceRoot: t } = {}) {
		this._names = new Bt(), this._sources = new Bt(), this._sourcesContent = [], this._mappings = [], this.file = e, this.sourceRoot = t, this._ignoreList = new Bt();
	}
};
function Zt(e) {
	return e;
}
var Qt = (e, t, n, r, i, a, o, s) => tn(!0, e, t, n, r, i, a, o, s);
function $t(e) {
	let { _mappings: t, _sources: n, _sourcesContent: r, _names: i, _ignoreList: a } = Zt(e);
	return on(t), {
		version: 3,
		file: e.file || void 0,
		names: i.array,
		sourceRoot: e.sourceRoot || void 0,
		sources: n.array,
		sourcesContent: r,
		mappings: t,
		ignoreList: a.array
	};
}
function en(e) {
	let t = $t(e);
	return Object.assign({}, t, { mappings: zt(t.mappings) });
}
function tn(e, t, n, r, i, a, o, s, c) {
	let { _mappings: l, _sources: u, _sourcesContent: d, _names: f } = Zt(t), p = nn(l, n), m = rn(p, r);
	if (!i) return e && sn(p, m) ? void 0 : an(p, m, [r]);
	let h = Ut(u, i), g = s ? Ut(f, s) : Yt;
	if (h === d.length && (d[h] = c ?? null), !(e && cn(p, m, h, a, o, g))) return an(p, m, s ? [
		r,
		h,
		a,
		o,
		g
	] : [
		r,
		h,
		a,
		o
	]);
}
function nn(e, t) {
	for (let n = e.length; n <= t; n++) e[n] = [];
	return e[t];
}
function rn(e, t) {
	let n = e.length;
	for (let r = n - 1; r >= 0 && !(t >= e[r][Wt]); n = r--);
	return n;
}
function an(e, t, n) {
	for (let n = e.length; n > t; n--) e[n] = e[n - 1];
	e[t] = n;
}
function on(e) {
	let { length: t } = e, n = t;
	for (let t = n - 1; t >= 0 && !(e[t].length > 0); n = t, t--);
	n < t && (e.length = n);
}
function sn(e, t) {
	return t === 0 || e[t - 1].length === 1;
}
function cn(e, t, n, r, i, a) {
	if (t === 0) return !1;
	let o = e[t - 1];
	return o.length !== 1 && n === o[Gt] && r === o[Kt] && i === o[qt] && a === (o.length === 5 ? o[Jt] : Yt);
}
//#endregion
//#region node_modules/sucrase/dist/esm/computeSourceMap.js
function ln({ code: e, mappings: t }, n, r, i, a) {
	let o = un(i, a), s = new Xt({ file: r.compiledFilename }), c = 0, l = t[0];
	for (; l === void 0 && c < t.length - 1;) c++, l = t[c];
	let u = 0, d = 0;
	l !== d && Qt(s, u, 0, n, u, 0);
	for (let r = 0; r < e.length; r++) {
		if (r === l) {
			let e = l - d, i = o[c];
			for (Qt(s, u, e, n, u, i); (l === r || l === void 0) && c < t.length - 1;) c++, l = t[c];
		}
		e.charCodeAt(r) === M.lineFeed && (u++, d = r + 1, l !== d && Qt(s, u, 0, n, u, 0));
	}
	let { sourceRoot: f, sourcesContent: p, ...m } = en(s);
	return m;
}
function un(e, t) {
	let n = Array(t.length), r = 0, i = t[r].start, a = 0;
	for (let o = 0; o < e.length; o++) o === i && (n[r] = i - a, r++, i = t[r].start), e.charCodeAt(o) === M.lineFeed && (a = o + 1);
	return n;
}
//#endregion
//#region node_modules/sucrase/dist/esm/HelperManager.js
var dn = {
	require: "\n    import {createRequire as CREATE_REQUIRE_NAME} from \"module\";\n    const require = CREATE_REQUIRE_NAME(import.meta.url);\n  ",
	interopRequireWildcard: "\n    function interopRequireWildcard(obj) {\n      if (obj && obj.__esModule) {\n        return obj;\n      } else {\n        var newObj = {};\n        if (obj != null) {\n          for (var key in obj) {\n            if (Object.prototype.hasOwnProperty.call(obj, key)) {\n              newObj[key] = obj[key];\n            }\n          }\n        }\n        newObj.default = obj;\n        return newObj;\n      }\n    }\n  ",
	interopRequireDefault: "\n    function interopRequireDefault(obj) {\n      return obj && obj.__esModule ? obj : { default: obj };\n    }\n  ",
	createNamedExportFrom: "\n    function createNamedExportFrom(obj, localName, importedName) {\n      Object.defineProperty(exports, localName, {enumerable: true, configurable: true, get: () => obj[importedName]});\n    }\n  ",
	createStarExport: "\n    function createStarExport(obj) {\n      Object.keys(obj)\n        .filter((key) => key !== \"default\" && key !== \"__esModule\")\n        .forEach((key) => {\n          if (exports.hasOwnProperty(key)) {\n            return;\n          }\n          Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]});\n        });\n    }\n  ",
	nullishCoalesce: "\n    function nullishCoalesce(lhs, rhsFn) {\n      if (lhs != null) {\n        return lhs;\n      } else {\n        return rhsFn();\n      }\n    }\n  ",
	asyncNullishCoalesce: "\n    async function asyncNullishCoalesce(lhs, rhsFn) {\n      if (lhs != null) {\n        return lhs;\n      } else {\n        return await rhsFn();\n      }\n    }\n  ",
	optionalChain: "\n    function optionalChain(ops) {\n      let lastAccessLHS = undefined;\n      let value = ops[0];\n      let i = 1;\n      while (i < ops.length) {\n        const op = ops[i];\n        const fn = ops[i + 1];\n        i += 2;\n        if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n          return undefined;\n        }\n        if (op === 'access' || op === 'optionalAccess') {\n          lastAccessLHS = value;\n          value = fn(value);\n        } else if (op === 'call' || op === 'optionalCall') {\n          value = fn((...args) => value.call(lastAccessLHS, ...args));\n          lastAccessLHS = undefined;\n        }\n      }\n      return value;\n    }\n  ",
	asyncOptionalChain: "\n    async function asyncOptionalChain(ops) {\n      let lastAccessLHS = undefined;\n      let value = ops[0];\n      let i = 1;\n      while (i < ops.length) {\n        const op = ops[i];\n        const fn = ops[i + 1];\n        i += 2;\n        if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n          return undefined;\n        }\n        if (op === 'access' || op === 'optionalAccess') {\n          lastAccessLHS = value;\n          value = await fn(value);\n        } else if (op === 'call' || op === 'optionalCall') {\n          value = await fn((...args) => value.call(lastAccessLHS, ...args));\n          lastAccessLHS = undefined;\n        }\n      }\n      return value;\n    }\n  ",
	optionalChainDelete: "\n    function optionalChainDelete(ops) {\n      const result = OPTIONAL_CHAIN_NAME(ops);\n      return result == null ? true : result;\n    }\n  ",
	asyncOptionalChainDelete: "\n    async function asyncOptionalChainDelete(ops) {\n      const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops);\n      return result == null ? true : result;\n    }\n  "
}, fn = class e {
	__init() {
		this.helperNames = {};
	}
	__init2() {
		this.createRequireName = null;
	}
	constructor(t) {
		this.nameManager = t, e.prototype.__init.call(this), e.prototype.__init2.call(this);
	}
	getHelperName(e) {
		let t = this.helperNames[e];
		return t || (t = this.nameManager.claimFreeName(`_${e}`), this.helperNames[e] = t, t);
	}
	emitHelpers() {
		let e = "";
		this.helperNames.optionalChainDelete && this.getHelperName("optionalChain"), this.helperNames.asyncOptionalChainDelete && this.getHelperName("asyncOptionalChain");
		for (let [t, n] of Object.entries(dn)) {
			let r = this.helperNames[t], i = n;
			t === "optionalChainDelete" ? i = i.replace("OPTIONAL_CHAIN_NAME", this.helperNames.optionalChain) : t === "asyncOptionalChainDelete" ? i = i.replace("ASYNC_OPTIONAL_CHAIN_NAME", this.helperNames.asyncOptionalChain) : t === "require" && (this.createRequireName === null && (this.createRequireName = this.nameManager.claimFreeName("_createRequire")), i = i.replace(/CREATE_REQUIRE_NAME/g, this.createRequireName)), r && (e += " ", e += i.replace(t, r).replace(/\s+/g, " ").trim());
		}
		return e;
	}
};
//#endregion
//#region node_modules/sucrase/dist/esm/identifyShadowedGlobals.js
function pn(e, t, n) {
	mn(e, n) && hn(e, t, n);
}
function mn(e, t) {
	for (let n of e.tokens) if (n.type === j.name && !n.isType && Ee(n) && t.has(e.identifierNameForToken(n))) return !0;
	return !1;
}
function hn(e, t, n) {
	let r = [], i = t.length - 1;
	for (let a = e.tokens.length - 1;; a--) {
		for (; r.length > 0 && r[r.length - 1].startTokenIndex === a + 1;) r.pop();
		for (; i >= 0 && t[i].endTokenIndex === a + 1;) r.push(t[i]), i--;
		if (a < 0) break;
		let o = e.tokens[a], s = e.identifierNameForToken(o);
		if (r.length > 1 && !o.isType && o.type === j.name && n.has(s)) {
			if (Oe(o)) gn(r[r.length - 1], e, s);
			else if (ke(o)) {
				let t = r.length - 1;
				for (; t > 0 && !r[t].isFunctionScope;) t--;
				if (t < 0) throw Error("Did not find parent function scope.");
				gn(r[t], e, s);
			}
		}
	}
	if (r.length > 0) throw Error("Expected empty scope stack after processing file.");
}
function gn(e, t, n) {
	for (let r = e.startTokenIndex; r < e.endTokenIndex; r++) {
		let e = t.tokens[r];
		(e.type === j.name || e.type === j.jsxName) && t.identifierNameForToken(e) === n && (e.shadowsGlobal = !0);
	}
}
//#endregion
//#region node_modules/sucrase/dist/esm/util/getIdentifierNames.js
function _n(e, t) {
	let n = [];
	for (let r of t) r.type === j.name && n.push(e.slice(r.start, r.end));
	return n;
}
//#endregion
//#region node_modules/sucrase/dist/esm/NameManager.js
var vn = class e {
	__init() {
		this.usedNames = /* @__PURE__ */ new Set();
	}
	constructor(t, n) {
		e.prototype.__init.call(this), this.usedNames = new Set(_n(t, n));
	}
	claimFreeName(e) {
		let t = this.findFreeName(e);
		return this.usedNames.add(t), t;
	}
	findFreeName(e) {
		if (!this.usedNames.has(e)) return e;
		let t = 2;
		for (; this.usedNames.has(e + String(t));) t++;
		return e + String(t);
	}
}, yn = /* @__PURE__ */ o(((e) => {
	var t = e && e.__extends || (function() {
		var e = function(t, n) {
			return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
				e.__proto__ = t;
			} || function(e, t) {
				for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
			}, e(t, n);
		};
		return function(t, n) {
			e(t, n);
			function r() {
				this.constructor = t;
			}
			t.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype, new r());
		};
	})();
	Object.defineProperty(e, "__esModule", { value: !0 }), e.DetailContext = e.NoopContext = e.VError = void 0;
	var n = function(e) {
		t(n, e);
		function n(t, r) {
			var i = e.call(this, r) || this;
			return i.path = t, Object.setPrototypeOf(i, n.prototype), i;
		}
		return n;
	}(Error);
	e.VError = n, e.NoopContext = function() {
		function e() {}
		return e.prototype.fail = function(e, t, n) {
			return !1;
		}, e.prototype.unionResolver = function() {
			return this;
		}, e.prototype.createContext = function() {
			return this;
		}, e.prototype.resolveUnion = function(e) {}, e;
	}();
	var r = function() {
		function e() {
			this._propNames = [""], this._messages = [null], this._score = 0;
		}
		return e.prototype.fail = function(e, t, n) {
			return this._propNames.push(e), this._messages.push(t), this._score += n, !1;
		}, e.prototype.unionResolver = function() {
			return new i();
		}, e.prototype.resolveUnion = function(e) {
			for (var t, n, r = e, i = null, a = 0, o = r.contexts; a < o.length; a++) {
				var s = o[a];
				(!i || s._score >= i._score) && (i = s);
			}
			i && i._score > 0 && ((t = this._propNames).push.apply(t, i._propNames), (n = this._messages).push.apply(n, i._messages));
		}, e.prototype.getError = function(e) {
			for (var t = [], r = this._propNames.length - 1; r >= 0; r--) {
				var i = this._propNames[r];
				e += typeof i == "number" ? "[" + i + "]" : i ? "." + i : "";
				var a = this._messages[r];
				a && t.push(e + " " + a);
			}
			return new n(e, t.join("; "));
		}, e.prototype.getErrorDetail = function(e) {
			for (var t = [], n = this._propNames.length - 1; n >= 0; n--) {
				var r = this._propNames[n];
				e += typeof r == "number" ? "[" + r + "]" : r ? "." + r : "";
				var i = this._messages[n];
				i && t.push({
					path: e,
					message: i
				});
			}
			for (var a = null, n = t.length - 1; n >= 0; n--) a && (t[n].nested = [a]), a = t[n];
			return a;
		}, e;
	}();
	e.DetailContext = r;
	var i = function() {
		function e() {
			this.contexts = [];
		}
		return e.prototype.createContext = function() {
			var e = new r();
			return this.contexts.push(e), e;
		}, e;
	}();
})), bn = /* @__PURE__ */ o(((e) => {
	var t = e && e.__extends || (function() {
		var e = function(t, n) {
			return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
				e.__proto__ = t;
			} || function(e, t) {
				for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
			}, e(t, n);
		};
		return function(t, n) {
			e(t, n);
			function r() {
				this.constructor = t;
			}
			t.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype, new r());
		};
	})();
	Object.defineProperty(e, "__esModule", { value: !0 }), e.basicTypes = e.BasicType = e.TParamList = e.TParam = e.param = e.TFunc = e.func = e.TProp = e.TOptional = e.opt = e.TIface = e.iface = e.TEnumLiteral = e.enumlit = e.TEnumType = e.enumtype = e.TIntersection = e.intersection = e.TUnion = e.union = e.TTuple = e.tuple = e.TArray = e.array = e.TLiteral = e.lit = e.TName = e.name = e.TType = void 0;
	var n = yn(), r = function() {
		function e() {}
		return e;
	}();
	e.TType = r;
	function i(e) {
		return typeof e == "string" ? o(e) : e;
	}
	function a(e, t) {
		var n = e[t];
		if (!n) throw Error("Unknown type " + t);
		return n;
	}
	function o(e) {
		return new s(e);
	}
	e.name = o;
	var s = function(e) {
		t(n, e);
		function n(t) {
			var n = e.call(this) || this;
			return n.name = t, n._failMsg = "is not a " + t, n;
		}
		return n.prototype.getChecker = function(e, t, r) {
			var i = this, o = a(e, this.name), s = o.getChecker(e, t, r);
			return o instanceof j || o instanceof n ? s : function(e, t) {
				return s(e, t) ? !0 : t.fail(null, i._failMsg, 0);
			};
		}, n;
	}(r);
	e.TName = s;
	function c(e) {
		return new l(e);
	}
	e.lit = c;
	var l = function(e) {
		t(n, e);
		function n(t) {
			var n = e.call(this) || this;
			return n.value = t, n.name = JSON.stringify(t), n._failMsg = "is not " + n.name, n;
		}
		return n.prototype.getChecker = function(e, t) {
			var n = this;
			return function(e, t) {
				return e === n.value || t.fail(null, n._failMsg, -1);
			};
		}, n;
	}(r);
	e.TLiteral = l;
	function u(e) {
		return new d(i(e));
	}
	e.array = u;
	var d = function(e) {
		t(n, e);
		function n(t) {
			var n = e.call(this) || this;
			return n.ttype = t, n;
		}
		return n.prototype.getChecker = function(e, t) {
			var n = this.ttype.getChecker(e, t);
			return function(e, t) {
				if (!Array.isArray(e)) return t.fail(null, "is not an array", 0);
				for (var r = 0; r < e.length; r++) if (!n(e[r], t)) return t.fail(r, null, 1);
				return !0;
			};
		}, n;
	}(r);
	e.TArray = d;
	function f() {
		return new p([...arguments].map(function(e) {
			return i(e);
		}));
	}
	e.tuple = f;
	var p = function(e) {
		t(n, e);
		function n(t) {
			var n = e.call(this) || this;
			return n.ttypes = t, n;
		}
		return n.prototype.getChecker = function(e, t) {
			var n = this.ttypes.map(function(n) {
				return n.getChecker(e, t);
			}), r = function(e, t) {
				if (!Array.isArray(e)) return t.fail(null, "is not an array", 0);
				for (var r = 0; r < n.length; r++) if (!n[r](e[r], t)) return t.fail(r, null, 1);
				return !0;
			};
			return t ? function(e, t) {
				return r(e, t) ? e.length <= n.length || t.fail(n.length, "is extraneous", 2) : !1;
			} : r;
		}, n;
	}(r);
	e.TTuple = p;
	function m() {
		return new h([...arguments].map(function(e) {
			return i(e);
		}));
	}
	e.union = m;
	var h = function(e) {
		t(n, e);
		function n(t) {
			var n = e.call(this) || this;
			n.ttypes = t;
			var r = t.map(function(e) {
				return e instanceof s || e instanceof l ? e.name : null;
			}).filter(function(e) {
				return e;
			}), i = t.length - r.length;
			return r.length ? (i > 0 && r.push(i + " more"), n._failMsg = "is none of " + r.join(", ")) : n._failMsg = "is none of " + i + " types", n;
		}
		return n.prototype.getChecker = function(e, t) {
			var n = this, r = this.ttypes.map(function(n) {
				return n.getChecker(e, t);
			});
			return function(e, t) {
				for (var i = t.unionResolver(), a = 0; a < r.length; a++) if (r[a](e, i.createContext())) return !0;
				return t.resolveUnion(i), t.fail(null, n._failMsg, 0);
			};
		}, n;
	}(r);
	e.TUnion = h;
	function g() {
		return new _([...arguments].map(function(e) {
			return i(e);
		}));
	}
	e.intersection = g;
	var _ = function(e) {
		t(n, e);
		function n(t) {
			var n = e.call(this) || this;
			return n.ttypes = t, n;
		}
		return n.prototype.getChecker = function(e, t) {
			var n = /* @__PURE__ */ new Set(), r = this.ttypes.map(function(r) {
				return r.getChecker(e, t, n);
			});
			return function(e, t) {
				return r.every(function(n) {
					return n(e, t);
				}) ? !0 : t.fail(null, null, 0);
			};
		}, n;
	}(r);
	e.TIntersection = _;
	function v(e) {
		return new y(e);
	}
	e.enumtype = v;
	var y = function(e) {
		t(n, e);
		function n(t) {
			var n = e.call(this) || this;
			return n.members = t, n.validValues = /* @__PURE__ */ new Set(), n._failMsg = "is not a valid enum value", n.validValues = new Set(Object.keys(t).map(function(e) {
				return t[e];
			})), n;
		}
		return n.prototype.getChecker = function(e, t) {
			var n = this;
			return function(e, t) {
				return n.validValues.has(e) ? !0 : t.fail(null, n._failMsg, 0);
			};
		}, n;
	}(r);
	e.TEnumType = y;
	function b(e, t) {
		return new x(e, t);
	}
	e.enumlit = b;
	var x = function(e) {
		t(n, e);
		function n(t, n) {
			var r = e.call(this) || this;
			return r.enumName = t, r.prop = n, r._failMsg = "is not " + t + "." + n, r;
		}
		return n.prototype.getChecker = function(e, t) {
			var n = this, r = a(e, this.enumName);
			if (!(r instanceof y)) throw Error("Type " + this.enumName + " used in enumlit is not an enum type");
			var i = r.members[this.prop];
			if (!r.members.hasOwnProperty(this.prop)) throw Error("Unknown value " + this.enumName + "." + this.prop + " used in enumlit");
			return function(e, t) {
				return e === i || t.fail(null, n._failMsg, -1);
			};
		}, n;
	}(r);
	e.TEnumLiteral = x;
	function S(e) {
		return Object.keys(e).map(function(t) {
			return C(t, e[t]);
		});
	}
	function C(e, t) {
		return t instanceof ee ? new te(e, t.ttype, !0) : new te(e, i(t), !1);
	}
	function w(e, t) {
		return new T(e, S(t));
	}
	e.iface = w;
	var T = function(e) {
		t(r, e);
		function r(t, n) {
			var r = e.call(this) || this;
			return r.bases = t, r.props = n, r.propSet = new Set(n.map(function(e) {
				return e.name;
			})), r;
		}
		return r.prototype.getChecker = function(e, t, r) {
			var i = this, o = this.bases.map(function(n) {
				return a(e, n).getChecker(e, t);
			}), s = this.props.map(function(n) {
				return n.ttype.getChecker(e, t);
			}), c = new n.NoopContext(), l = this.props.map(function(e, t) {
				return !e.isOpt && !s[t](void 0, c);
			}), u = function(e, t) {
				if (typeof e != "object" || !e) return t.fail(null, "is not an object", 0);
				for (var n = 0; n < o.length; n++) if (!o[n](e, t)) return !1;
				for (var n = 0; n < s.length; n++) {
					var r = i.props[n].name, a = e[r];
					if (a === void 0) {
						if (l[n]) return t.fail(r, "is missing", 1);
					} else if (!s[n](a, t)) return t.fail(r, null, 1);
				}
				return !0;
			};
			if (!t) return u;
			var d = this.propSet;
			return r && (this.propSet.forEach(function(e) {
				return r.add(e);
			}), d = r), function(e, t) {
				if (!u(e, t)) return !1;
				for (var n in e) if (!d.has(n)) return t.fail(n, "is extraneous", 2);
				return !0;
			};
		}, r;
	}(r);
	e.TIface = T;
	function E(e) {
		return new ee(i(e));
	}
	e.opt = E;
	var ee = function(e) {
		t(n, e);
		function n(t) {
			var n = e.call(this) || this;
			return n.ttype = t, n;
		}
		return n.prototype.getChecker = function(e, t) {
			var n = this.ttype.getChecker(e, t);
			return function(e, t) {
				return e === void 0 || n(e, t);
			};
		}, n;
	}(r);
	e.TOptional = ee;
	var te = function() {
		function e(e, t, n) {
			this.name = e, this.ttype = t, this.isOpt = n;
		}
		return e;
	}();
	e.TProp = te;
	function ne(e) {
		return new D(new A([...arguments].slice(1)), i(e));
	}
	e.func = ne;
	var D = function(e) {
		t(n, e);
		function n(t, n) {
			var r = e.call(this) || this;
			return r.paramList = t, r.result = n, r;
		}
		return n.prototype.getChecker = function(e, t) {
			return function(e, t) {
				return typeof e == "function" || t.fail(null, "is not a function", 0);
			};
		}, n;
	}(r);
	e.TFunc = D;
	function O(e, t, n) {
		return new k(e, i(t), !!n);
	}
	e.param = O;
	var k = function() {
		function e(e, t, n) {
			this.name = e, this.ttype = t, this.isOpt = n;
		}
		return e;
	}();
	e.TParam = k;
	var A = function(e) {
		t(r, e);
		function r(t) {
			var n = e.call(this) || this;
			return n.params = t, n;
		}
		return r.prototype.getChecker = function(e, t) {
			var r = this, i = this.params.map(function(n) {
				return n.ttype.getChecker(e, t);
			}), a = new n.NoopContext(), o = this.params.map(function(e, t) {
				return !e.isOpt && !i[t](void 0, a);
			}), s = function(e, t) {
				if (!Array.isArray(e)) return t.fail(null, "is not an array", 0);
				for (var n = 0; n < i.length; n++) {
					var a = r.params[n];
					if (e[n] === void 0) {
						if (o[n]) return t.fail(a.name, "is missing", 1);
					} else if (!i[n](e[n], t)) return t.fail(a.name, null, 1);
				}
				return !0;
			};
			return t ? function(e, t) {
				return s(e, t) ? e.length <= i.length || t.fail(i.length, "is extraneous", 2) : !1;
			} : s;
		}, r;
	}(r);
	e.TParamList = A;
	var j = function(e) {
		t(n, e);
		function n(t, n) {
			var r = e.call(this) || this;
			return r.validator = t, r.message = n, r;
		}
		return n.prototype.getChecker = function(e, t) {
			var n = this;
			return function(e, t) {
				return n.validator(e) ? !0 : t.fail(null, n.message, 0);
			};
		}, n;
	}(r);
	e.BasicType = j, e.basicTypes = {
		any: new j(function(e) {
			return !0;
		}, "is invalid"),
		number: new j(function(e) {
			return typeof e == "number";
		}, "is not a number"),
		object: new j(function(e) {
			return typeof e == "object" && e;
		}, "is not an object"),
		boolean: new j(function(e) {
			return typeof e == "boolean";
		}, "is not a boolean"),
		string: new j(function(e) {
			return typeof e == "string";
		}, "is not a string"),
		symbol: new j(function(e) {
			return typeof e == "symbol";
		}, "is not a symbol"),
		void: new j(function(e) {
			return e == null;
		}, "is not void"),
		undefined: new j(function(e) {
			return e === void 0;
		}, "is not undefined"),
		null: new j(function(e) {
			return e === null;
		}, "is not null"),
		never: new j(function(e) {
			return !1;
		}, "is unexpected"),
		Date: new j(ie("[object Date]"), "is not a Date"),
		RegExp: new j(ie("[object RegExp]"), "is not a RegExp")
	};
	var re = Object.prototype.toString;
	function ie(e) {
		return function(t) {
			return typeof t == "object" && t && re.call(t) === e;
		};
	}
	typeof Buffer < "u" && (e.basicTypes.Buffer = new j(function(e) {
		return Buffer.isBuffer(e);
	}, "is not a Buffer"));
	for (var ae = function(t) {
		e.basicTypes[t.name] = new j(function(e) {
			return e instanceof t;
		}, "is not a " + t.name);
	}, oe = 0, M = [
		Int8Array,
		Uint8Array,
		Uint8ClampedArray,
		Int16Array,
		Uint16Array,
		Int32Array,
		Uint32Array,
		Float32Array,
		Float64Array,
		ArrayBuffer
	]; oe < M.length; oe++) {
		var se = M[oe];
		ae(se);
	}
})), xn = /* @__PURE__ */ l((/* @__PURE__ */ o(((e) => {
	var t = e && e.__spreadArrays || function() {
		for (var e = 0, t = 0, n = arguments.length; t < n; t++) e += arguments[t].length;
		for (var r = Array(e), i = 0, t = 0; t < n; t++) for (var a = arguments[t], o = 0, s = a.length; o < s; o++, i++) r[i] = a[o];
		return r;
	};
	Object.defineProperty(e, "__esModule", { value: !0 }), e.Checker = e.createCheckers = void 0;
	var n = bn(), r = yn(), i = bn();
	Object.defineProperty(e, "TArray", {
		enumerable: !0,
		get: function() {
			return i.TArray;
		}
	}), Object.defineProperty(e, "TEnumType", {
		enumerable: !0,
		get: function() {
			return i.TEnumType;
		}
	}), Object.defineProperty(e, "TEnumLiteral", {
		enumerable: !0,
		get: function() {
			return i.TEnumLiteral;
		}
	}), Object.defineProperty(e, "TFunc", {
		enumerable: !0,
		get: function() {
			return i.TFunc;
		}
	}), Object.defineProperty(e, "TIface", {
		enumerable: !0,
		get: function() {
			return i.TIface;
		}
	}), Object.defineProperty(e, "TLiteral", {
		enumerable: !0,
		get: function() {
			return i.TLiteral;
		}
	}), Object.defineProperty(e, "TName", {
		enumerable: !0,
		get: function() {
			return i.TName;
		}
	}), Object.defineProperty(e, "TOptional", {
		enumerable: !0,
		get: function() {
			return i.TOptional;
		}
	}), Object.defineProperty(e, "TParam", {
		enumerable: !0,
		get: function() {
			return i.TParam;
		}
	}), Object.defineProperty(e, "TParamList", {
		enumerable: !0,
		get: function() {
			return i.TParamList;
		}
	}), Object.defineProperty(e, "TProp", {
		enumerable: !0,
		get: function() {
			return i.TProp;
		}
	}), Object.defineProperty(e, "TTuple", {
		enumerable: !0,
		get: function() {
			return i.TTuple;
		}
	}), Object.defineProperty(e, "TType", {
		enumerable: !0,
		get: function() {
			return i.TType;
		}
	}), Object.defineProperty(e, "TUnion", {
		enumerable: !0,
		get: function() {
			return i.TUnion;
		}
	}), Object.defineProperty(e, "TIntersection", {
		enumerable: !0,
		get: function() {
			return i.TIntersection;
		}
	}), Object.defineProperty(e, "array", {
		enumerable: !0,
		get: function() {
			return i.array;
		}
	}), Object.defineProperty(e, "enumlit", {
		enumerable: !0,
		get: function() {
			return i.enumlit;
		}
	}), Object.defineProperty(e, "enumtype", {
		enumerable: !0,
		get: function() {
			return i.enumtype;
		}
	}), Object.defineProperty(e, "func", {
		enumerable: !0,
		get: function() {
			return i.func;
		}
	}), Object.defineProperty(e, "iface", {
		enumerable: !0,
		get: function() {
			return i.iface;
		}
	}), Object.defineProperty(e, "lit", {
		enumerable: !0,
		get: function() {
			return i.lit;
		}
	}), Object.defineProperty(e, "name", {
		enumerable: !0,
		get: function() {
			return i.name;
		}
	}), Object.defineProperty(e, "opt", {
		enumerable: !0,
		get: function() {
			return i.opt;
		}
	}), Object.defineProperty(e, "param", {
		enumerable: !0,
		get: function() {
			return i.param;
		}
	}), Object.defineProperty(e, "tuple", {
		enumerable: !0,
		get: function() {
			return i.tuple;
		}
	}), Object.defineProperty(e, "union", {
		enumerable: !0,
		get: function() {
			return i.union;
		}
	}), Object.defineProperty(e, "intersection", {
		enumerable: !0,
		get: function() {
			return i.intersection;
		}
	}), Object.defineProperty(e, "BasicType", {
		enumerable: !0,
		get: function() {
			return i.BasicType;
		}
	});
	var a = yn();
	Object.defineProperty(e, "VError", {
		enumerable: !0,
		get: function() {
			return a.VError;
		}
	});
	function o() {
		for (var e = [...arguments], r = Object.assign.apply(Object, t([{}, n.basicTypes], e)), i = {}, a = 0, o = e; a < o.length; a++) for (var c = o[a], l = 0, u = Object.keys(c); l < u.length; l++) {
			var d = u[l];
			i[d] = new s(r, c[d]);
		}
		return i;
	}
	e.createCheckers = o;
	var s = function() {
		function e(e, t, r) {
			if (r === void 0 && (r = "value"), this.suite = e, this.ttype = t, this._path = r, this.props = /* @__PURE__ */ new Map(), t instanceof n.TIface) for (var i = 0, a = t.props; i < a.length; i++) {
				var o = a[i];
				this.props.set(o.name, o.ttype);
			}
			this.checkerPlain = this.ttype.getChecker(e, !1), this.checkerStrict = this.ttype.getChecker(e, !0);
		}
		return e.prototype.setReportedPath = function(e) {
			this._path = e;
		}, e.prototype.check = function(e) {
			return this._doCheck(this.checkerPlain, e);
		}, e.prototype.test = function(e) {
			return this.checkerPlain(e, new r.NoopContext());
		}, e.prototype.validate = function(e) {
			return this._doValidate(this.checkerPlain, e);
		}, e.prototype.strictCheck = function(e) {
			return this._doCheck(this.checkerStrict, e);
		}, e.prototype.strictTest = function(e) {
			return this.checkerStrict(e, new r.NoopContext());
		}, e.prototype.strictValidate = function(e) {
			return this._doValidate(this.checkerStrict, e);
		}, e.prototype.getProp = function(t) {
			var n = this.props.get(t);
			if (!n) throw Error("Type has no property " + t);
			return new e(this.suite, n, this._path + "." + t);
		}, e.prototype.methodArgs = function(t) {
			var n = this._getMethod(t);
			return new e(this.suite, n.paramList);
		}, e.prototype.methodResult = function(t) {
			var n = this._getMethod(t);
			return new e(this.suite, n.result);
		}, e.prototype.getArgs = function() {
			if (!(this.ttype instanceof n.TFunc)) throw Error("getArgs() applied to non-function");
			return new e(this.suite, this.ttype.paramList);
		}, e.prototype.getResult = function() {
			if (!(this.ttype instanceof n.TFunc)) throw Error("getResult() applied to non-function");
			return new e(this.suite, this.ttype.result);
		}, e.prototype.getType = function() {
			return this.ttype;
		}, e.prototype._doCheck = function(e, t) {
			if (!e(t, new r.NoopContext())) {
				var n = new r.DetailContext();
				throw e(t, n), n.getError(this._path);
			}
		}, e.prototype._doValidate = function(e, t) {
			if (e(t, new r.NoopContext())) return null;
			var n = new r.DetailContext();
			return e(t, n), n.getErrorDetail(this._path);
		}, e.prototype._getMethod = function(e) {
			var t = this.props.get(e);
			if (!t) throw Error("Type has no property " + e);
			if (!(t instanceof n.TFunc)) throw Error("Property " + e + " is not a method");
			return t;
		}, e;
	}();
	e.Checker = s;
})))()), Sn = {
	Transform: xn.union(xn.lit("jsx"), xn.lit("typescript"), xn.lit("flow"), xn.lit("imports"), xn.lit("react-hot-loader"), xn.lit("jest")),
	SourceMapOptions: xn.iface([], { compiledFilename: "string" }),
	Options: xn.iface([], {
		transforms: xn.array("Transform"),
		disableESTransforms: xn.opt("boolean"),
		jsxRuntime: xn.opt(xn.union(xn.lit("classic"), xn.lit("automatic"), xn.lit("preserve"))),
		production: xn.opt("boolean"),
		jsxImportSource: xn.opt("string"),
		jsxPragma: xn.opt("string"),
		jsxFragmentPragma: xn.opt("string"),
		keepUnusedImports: xn.opt("boolean"),
		preserveDynamicImport: xn.opt("boolean"),
		injectCreateRequireForImportRequire: xn.opt("boolean"),
		enableLegacyTypeScriptModuleInterop: xn.opt("boolean"),
		enableLegacyBabel5ModuleInterop: xn.opt("boolean"),
		sourceMapOptions: xn.opt("SourceMapOptions"),
		filePath: xn.opt("string")
	})
}, { Options: Cn } = (0, xn.createCheckers)(Sn);
function wn(e) {
	Cn.strictCheck(e);
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/traverser/lval.js
function Tn() {
	J(), Ui(!1);
}
function En(e) {
	J(), An(e);
}
function Dn(e) {
	ja(), kn(e);
}
function On() {
	ja(), P.tokens[P.tokens.length - 1].identifierRole = K.ImportDeclaration;
}
function kn(e) {
	let t;
	t = P.scopeDepth === 0 ? K.TopLevelDeclaration : e ? K.BlockScopedDeclaration : K.FunctionScopedDeclaration, P.tokens[P.tokens.length - 1].identifierRole = t;
}
function An(e) {
	switch (P.type) {
		case j._this: {
			let e = Ne(0);
			J(), Pe(e);
			return;
		}
		case j._yield:
		case j.name:
			P.type = j.name, Dn(e);
			return;
		case j.bracketL:
			J(), jn(j.bracketR, e, !0);
			return;
		case j.braceL:
			ya(!0, e);
			return;
		default: W();
	}
}
function jn(e, t, n = !1, r = !1, i = 0) {
	let a = !0, o = !1, s = P.tokens.length;
	for (; !Y(e) && !P.error;) if (a ? a = !1 : (U(j.comma), P.tokens[P.tokens.length - 1].contextId = i, !o && P.tokens[s].isType && (P.tokens[P.tokens.length - 1].isType = !0, o = !0)), !(n && X(j.comma))) {
		if (Y(e)) break;
		if (X(j.ellipsis)) {
			En(t), Nn(), Y(j.comma), U(e);
			break;
		} else Mn(r, t);
	}
}
function Mn(e, t) {
	e && Rn([
		A._public,
		A._protected,
		A._private,
		A._readonly,
		A._override
	]), Pn(t), Nn(), Pn(t, !0);
}
function Nn() {
	ce ? Uo() : N && Ci();
}
function Pn(e, t = !1) {
	if (t || An(e), !Y(j.eq)) return;
	let n = P.tokens.length - 1;
	Ui(), P.tokens[n].rhsEndIndex = P.tokens.length;
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/plugins/typescript.js
function Fn() {
	return X(j.name);
}
function In() {
	return X(j.name) || !!(P.type & j.IS_KEYWORD) || X(j.string) || X(j.num) || X(j.bigint) || X(j.decimal);
}
function Ln() {
	let e = P.snapshot();
	return J(), (X(j.bracketL) || X(j.braceL) || X(j.star) || X(j.ellipsis) || X(j.hash) || In()) && !me() ? !0 : (P.restoreFromSnapshot(e), !1);
}
function Rn(e) {
	for (; zn(e) !== null;);
}
function zn(e) {
	if (!X(j.name)) return null;
	let t = P.contextualKeyword;
	if (e.indexOf(t) !== -1 && Ln()) {
		switch (t) {
			case A._readonly:
				P.tokens[P.tokens.length - 1].type = j._readonly;
				break;
			case A._abstract:
				P.tokens[P.tokens.length - 1].type = j._abstract;
				break;
			case A._static:
				P.tokens[P.tokens.length - 1].type = j._static;
				break;
			case A._public:
				P.tokens[P.tokens.length - 1].type = j._public;
				break;
			case A._private:
				P.tokens[P.tokens.length - 1].type = j._private;
				break;
			case A._protected:
				P.tokens[P.tokens.length - 1].type = j._protected;
				break;
			case A._override:
				P.tokens[P.tokens.length - 1].type = j._override;
				break;
			case A._declare:
				P.tokens[P.tokens.length - 1].type = j._declare;
				break;
			default: break;
		}
		return t;
	}
	return null;
}
function Bn() {
	for (ja(); Y(j.dot);) ja();
}
function Vn() {
	Bn(), !me() && X(j.lessThan) && ni();
}
function Hn() {
	J(), Ar();
}
function Un() {
	J();
}
function Wn() {
	U(j._typeof), X(j._import) ? Gn() : Bn(), !me() && X(j.lessThan) && ni();
}
function Gn() {
	U(j._import), U(j.parenL), U(j.string), U(j.parenR), Y(j.dot) && Bn(), X(j.lessThan) && ni();
}
function Kn() {
	Y(j._const);
	let e = Y(j._in), t = B(A._out);
	Y(j._const), (e || t) && !X(j.name) ? P.tokens[P.tokens.length - 1].type = j.name : ja(), Y(j._extends) && jr(), Y(j.eq) && jr();
}
function qn() {
	X(j.lessThan) && Jn();
}
function Jn() {
	let e = Ne(0);
	for (X(j.lessThan) || X(j.typeParameterStart) ? J() : W(); !Y(j.greaterThan) && !P.error;) Kn(), Y(j.comma);
	Pe(e);
}
function Yn(e) {
	let t = e === j.arrow;
	qn(), U(j.parenL), P.scopeDepth++, Xn(!1), P.scopeDepth--, (t || X(e)) && Tr(e);
}
function Xn(e) {
	jn(j.parenR, e);
}
function Zn() {
	Y(j.comma) || H();
}
function Qn() {
	Yn(j.colon), Zn();
}
function $n() {
	let e = P.snapshot();
	J();
	let t = Y(j.name) && X(j.colon);
	return P.restoreFromSnapshot(e), t;
}
function er() {
	if (!(X(j.bracketL) && $n())) return !1;
	let e = Ne(0);
	return U(j.bracketL), ja(), Ar(), U(j.bracketR), Dr(), Zn(), Pe(e), !0;
}
function tr(e) {
	Y(j.question), !e && (X(j.parenL) || X(j.lessThan)) ? (Yn(j.colon), Zn()) : (Dr(), Zn());
}
function nr() {
	if (X(j.parenL) || X(j.lessThan)) {
		Qn();
		return;
	}
	if (X(j._new)) {
		J(), X(j.parenL) || X(j.lessThan) ? Qn() : tr(!1);
		return;
	}
	let e = !!zn([A._readonly]);
	er() || ((R(A._get) || R(A._set)) && Ln(), wa(-1), tr(e));
}
function rr() {
	ir();
}
function ir() {
	for (U(j.braceL); !Y(j.braceR) && !P.error;) nr();
}
function ar() {
	let e = P.snapshot(), t = or();
	return P.restoreFromSnapshot(e), t;
}
function or() {
	return J(), Y(j.plus) || Y(j.minus) ? R(A._readonly) : (R(A._readonly) && J(), !X(j.bracketL) || (J(), !Fn()) ? !1 : (J(), X(j._in)));
}
function sr() {
	ja(), U(j._in), jr();
}
function cr() {
	U(j.braceL), X(j.plus) || X(j.minus) ? (J(), V(A._readonly)) : B(A._readonly), U(j.bracketL), sr(), B(A._as) && jr(), U(j.bracketR), X(j.plus) || X(j.minus) ? (J(), U(j.question)) : Y(j.question), Or(), H(), U(j.braceR);
}
function lr() {
	for (U(j.bracketL); !Y(j.bracketR) && !P.error;) ur(), Y(j.comma);
}
function ur() {
	Y(j.ellipsis) ? jr() : (jr(), Y(j.question)), Y(j.colon) && jr();
}
function dr() {
	U(j.parenL), jr(), U(j.parenR);
}
function fr() {
	for (je(), je(); !X(j.backQuote) && !P.error;) U(j.dollarBraceL), jr(), je(), je();
	J();
}
var pr;
(function(e) {
	e[e.TSFunctionType = 0] = "TSFunctionType", e[e.TSConstructorType = 1] = "TSConstructorType", e[e.TSAbstractConstructorType = 2] = "TSAbstractConstructorType";
})(pr ||= {});
function mr(e) {
	e === pr.TSAbstractConstructorType && V(A._abstract), (e === pr.TSConstructorType || e === pr.TSAbstractConstructorType) && U(j._new);
	let t = P.inDisallowConditionalTypesContext;
	P.inDisallowConditionalTypesContext = !1, Yn(j.arrow), P.inDisallowConditionalTypesContext = t;
}
function hr() {
	switch (P.type) {
		case j.name:
			Vn();
			return;
		case j._void:
		case j._null:
			J();
			return;
		case j.string:
		case j.num:
		case j.bigint:
		case j.decimal:
		case j._true:
		case j._false:
			ua();
			return;
		case j.minus:
			J(), ua();
			return;
		case j._this:
			Un(), R(A._is) && !me() && Hn();
			return;
		case j._typeof:
			Wn();
			return;
		case j._import:
			Gn();
			return;
		case j.braceL:
			ar() ? cr() : rr();
			return;
		case j.bracketL:
			lr();
			return;
		case j.parenL:
			dr();
			return;
		case j.backQuote:
			fr();
			return;
		default:
			if (P.type & j.IS_KEYWORD) {
				J(), P.tokens[P.tokens.length - 1].type = j.name;
				return;
			}
			break;
	}
	W();
}
function gr() {
	for (hr(); !me() && Y(j.bracketL);) Y(j.bracketR) || (jr(), U(j.bracketR));
}
function _r() {
	if (V(A._infer), ja(), X(j._extends)) {
		let e = P.snapshot();
		U(j._extends);
		let t = P.inDisallowConditionalTypesContext;
		P.inDisallowConditionalTypesContext = !0, jr(), P.inDisallowConditionalTypesContext = t, (P.error || !P.inDisallowConditionalTypesContext && X(j.question)) && P.restoreFromSnapshot(e);
	}
}
function vr() {
	if (R(A._keyof) || R(A._unique) || R(A._readonly)) J(), vr();
	else if (R(A._infer)) _r();
	else {
		let e = P.inDisallowConditionalTypesContext;
		P.inDisallowConditionalTypesContext = !1, gr(), P.inDisallowConditionalTypesContext = e;
	}
}
function yr() {
	if (Y(j.bitwiseAND), vr(), X(j.bitwiseAND)) for (; Y(j.bitwiseAND);) vr();
}
function br() {
	if (Y(j.bitwiseOR), yr(), X(j.bitwiseOR)) for (; Y(j.bitwiseOR);) yr();
}
function xr() {
	return X(j.lessThan) ? !0 : X(j.parenL) && Cr();
}
function Sr() {
	if (X(j.name) || X(j._this)) return J(), !0;
	if (X(j.braceL) || X(j.bracketL)) {
		let e = 1;
		for (J(); e > 0 && !P.error;) X(j.braceL) || X(j.bracketL) ? e++ : (X(j.braceR) || X(j.bracketR)) && e--, J();
		return !0;
	}
	return !1;
}
function Cr() {
	let e = P.snapshot(), t = wr();
	return P.restoreFromSnapshot(e), t;
}
function wr() {
	return J(), !!(X(j.parenR) || X(j.ellipsis) || Sr() && (X(j.colon) || X(j.comma) || X(j.question) || X(j.eq) || X(j.parenR) && (J(), X(j.arrow))));
}
function Tr(e) {
	let t = Ne(0);
	U(e), kr() || jr(), Pe(t);
}
function Er() {
	X(j.colon) && Tr(j.colon);
}
function Dr() {
	X(j.colon) && Ar();
}
function Or() {
	Y(j.colon) && jr();
}
function kr() {
	let e = P.snapshot();
	return R(A._asserts) ? (J(), B(A._is) ? (jr(), !0) : Fn() || X(j._this) ? (J(), B(A._is) && jr(), !0) : (P.restoreFromSnapshot(e), !1)) : Fn() || X(j._this) ? (J(), R(A._is) && !me() ? (J(), jr(), !0) : (P.restoreFromSnapshot(e), !1)) : !1;
}
function Ar() {
	let e = Ne(0);
	U(j.colon), jr(), Pe(e);
}
function jr() {
	if (Nr(), P.inDisallowConditionalTypesContext || me() || !Y(j._extends)) return;
	let e = P.inDisallowConditionalTypesContext;
	P.inDisallowConditionalTypesContext = !0, Nr(), P.inDisallowConditionalTypesContext = e, U(j.question), jr(), U(j.colon), jr();
}
function Mr() {
	return R(A._abstract) && Ie() === j._new;
}
function Nr() {
	if (xr()) {
		mr(pr.TSFunctionType);
		return;
	}
	if (X(j._new)) {
		mr(pr.TSConstructorType);
		return;
	} else if (Mr()) {
		mr(pr.TSAbstractConstructorType);
		return;
	}
	br();
}
function Pr() {
	let e = Ne(1);
	jr(), U(j.greaterThan), Pe(e), Xi();
}
function Fr() {
	if (Y(j.jsxTagStart)) {
		P.tokens[P.tokens.length - 1].type = j.typeParameterStart;
		let e = Ne(1);
		for (; !X(j.greaterThan) && !P.error;) jr(), Y(j.comma);
		Li(), Pe(e);
	}
}
function Ir() {
	for (; !X(j.braceL) && !P.error;) Lr(), Y(j.comma);
}
function Lr() {
	Bn(), X(j.lessThan) && ni();
}
function Rr() {
	Dn(!1), qn(), Y(j._extends) && Ir(), ir();
}
function zr() {
	Dn(!1), qn(), U(j.eq), jr(), H();
}
function Br() {
	if (X(j.string) ? ua() : ja(), Y(j.eq)) {
		let e = P.tokens.length - 1;
		Ui(), P.tokens[e].rhsEndIndex = P.tokens.length;
	}
}
function Vr() {
	for (Dn(!1), U(j.braceL); !Y(j.braceR) && !P.error;) Br(), Y(j.comma);
}
function Hr() {
	U(j.braceL), As(j.braceR);
}
function Ur() {
	Dn(!1), Y(j.dot) ? Ur() : Hr();
}
function Wr() {
	R(A._global) ? ja() : X(j.string) ? sa() : W(), X(j.braceL) ? Hr() : H();
}
function Gr() {
	On(), U(j.eq), qr(), H();
}
function Kr() {
	return R(A._require) && Ie() === j.parenL;
}
function qr() {
	Kr() ? Jr() : Bn();
}
function Jr() {
	V(A._require), U(j.parenL), X(j.string) || W(), ua(), U(j.parenR);
}
function Yr() {
	if (ge()) return !1;
	switch (P.type) {
		case j._function: {
			let e = Ne(1);
			J();
			let t = P.start;
			return Fs(t, !0), Pe(e), !0;
		}
		case j._class: {
			let e = Ne(1);
			return Ls(!0, !1), Pe(e), !0;
		}
		case j._const: if (X(j._const) && z(A._enum)) {
			let e = Ne(1);
			return U(j._const), V(A._enum), P.tokens[P.tokens.length - 1].type = j._enum, Vr(), Pe(e), !0;
		}
		case j._var:
		case j._let: {
			let e = Ne(1);
			return ws(P.type !== j._var), Pe(e), !0;
		}
		case j.name: {
			let e = Ne(1), t = P.contextualKeyword, n = !1;
			return t === A._global ? (Wr(), n = !0) : n = Qr(t, !0), Pe(e), n;
		}
		default: return !1;
	}
}
function Xr() {
	return Qr(P.contextualKeyword, !0);
}
function Zr(e) {
	switch (e) {
		case A._declare: {
			let e = P.tokens.length - 1;
			if (Yr()) return P.tokens[e].type = j._declare, !0;
			break;
		}
		case A._global:
			if (X(j.braceL)) return Hr(), !0;
			break;
		default: return Qr(e, !1);
	}
	return !1;
}
function Qr(e, t) {
	switch (e) {
		case A._abstract:
			if ($r(t) && X(j._class)) return P.tokens[P.tokens.length - 1].type = j._abstract, Ls(!0, !1), !0;
			break;
		case A._enum:
			if ($r(t) && X(j.name)) return P.tokens[P.tokens.length - 1].type = j._enum, Vr(), !0;
			break;
		case A._interface:
			if ($r(t) && X(j.name)) {
				let e = Ne(t ? 2 : 1);
				return Rr(), Pe(e), !0;
			}
			break;
		case A._module:
			if ($r(t)) {
				if (X(j.string)) {
					let e = Ne(t ? 2 : 1);
					return Wr(), Pe(e), !0;
				} else if (X(j.name)) {
					let e = Ne(t ? 2 : 1);
					return Ur(), Pe(e), !0;
				}
			}
			break;
		case A._namespace:
			if ($r(t) && X(j.name)) {
				let e = Ne(t ? 2 : 1);
				return Ur(), Pe(e), !0;
			}
			break;
		case A._type:
			if ($r(t) && X(j.name)) {
				let e = Ne(t ? 2 : 1);
				return zr(), Pe(e), !0;
			}
			break;
		default: break;
	}
	return !1;
}
function $r(e) {
	return e ? (J(), !0) : !ge();
}
function ei() {
	let e = P.snapshot();
	return Jn(), Is(), Er(), U(j.arrow), P.error ? (P.restoreFromSnapshot(e), !1) : (Oa(!0), !0);
}
function ti() {
	P.type === j.bitShiftL && (--P.pos, qe(j.lessThan)), ni();
}
function ni() {
	let e = Ne(0);
	for (U(j.lessThan); !X(j.greaterThan) && !P.error;) jr(), Y(j.comma);
	e ? (U(j.greaterThan), Pe(e)) : (Pe(e), nt(), U(j.greaterThan), P.tokens[P.tokens.length - 1].isType = !0);
}
function ri() {
	if (X(j.name)) switch (P.contextualKeyword) {
		case A._abstract:
		case A._declare:
		case A._enum:
		case A._interface:
		case A._module:
		case A._namespace:
		case A._type: return !0;
		default: break;
	}
	return !1;
}
function ii(e, t) {
	if (X(j.colon) && Tr(j.colon), !X(j.braceL) && ge()) {
		let t = P.tokens.length - 1;
		for (; t >= 0 && (P.tokens[t].start >= e || P.tokens[t].type === j._default || P.tokens[t].type === j._export);) P.tokens[t].isType = !0, t--;
		return;
	}
	Oa(!1, t);
}
function ai(e, t, n) {
	if (!me() && Y(j.bang)) {
		P.tokens[P.tokens.length - 1].type = j.nonNullAssertion;
		return;
	}
	if (X(j.lessThan) || X(j.bitShiftL)) {
		let n = P.snapshot();
		if (!t && na() && ei()) return;
		if (ti(), !t && Y(j.parenL) ? (P.tokens[P.tokens.length - 1].subscriptStartIndex = e, ra()) : X(j.backQuote) ? va() : (P.type === j.greaterThan || P.type !== j.parenL && P.type & j.IS_EXPRESSION_START && !me()) && W(), P.error) P.restoreFromSnapshot(n);
		else return;
	} else !t && X(j.questionDot) && Ie() === j.lessThan && (J(), P.tokens[e].isOptionalChainStart = !0, P.tokens[P.tokens.length - 1].subscriptStartIndex = e, ni(), U(j.parenL), ra());
	ta(e, t, n);
}
function oi() {
	if (Y(j._import)) return R(A._type) && Ie() !== j.eq && V(A._type), Gr(), !0;
	if (Y(j.eq)) return Hi(), H(), !0;
	if (B(A._as)) return V(A._namespace), ja(), H(), !0;
	if (R(A._type)) {
		let e = Ie();
		(e === j.braceL || e === j.star) && J();
	}
	return !1;
}
function si() {
	if (ja(), X(j.comma) || X(j.braceR)) {
		P.tokens[P.tokens.length - 1].identifierRole = K.ImportDeclaration;
		return;
	}
	if (ja(), X(j.comma) || X(j.braceR)) {
		P.tokens[P.tokens.length - 1].identifierRole = K.ImportDeclaration, P.tokens[P.tokens.length - 2].isType = !0, P.tokens[P.tokens.length - 1].isType = !0;
		return;
	}
	if (ja(), X(j.comma) || X(j.braceR)) {
		P.tokens[P.tokens.length - 3].identifierRole = K.ImportAccess, P.tokens[P.tokens.length - 1].identifierRole = K.ImportDeclaration;
		return;
	}
	ja(), P.tokens[P.tokens.length - 3].identifierRole = K.ImportAccess, P.tokens[P.tokens.length - 1].identifierRole = K.ImportDeclaration, P.tokens[P.tokens.length - 4].isType = !0, P.tokens[P.tokens.length - 3].isType = !0, P.tokens[P.tokens.length - 2].isType = !0, P.tokens[P.tokens.length - 1].isType = !0;
}
function ci() {
	if (ja(), X(j.comma) || X(j.braceR)) {
		P.tokens[P.tokens.length - 1].identifierRole = K.ExportAccess;
		return;
	}
	if (ja(), X(j.comma) || X(j.braceR)) {
		P.tokens[P.tokens.length - 1].identifierRole = K.ExportAccess, P.tokens[P.tokens.length - 2].isType = !0, P.tokens[P.tokens.length - 1].isType = !0;
		return;
	}
	if (ja(), X(j.comma) || X(j.braceR)) {
		P.tokens[P.tokens.length - 3].identifierRole = K.ExportAccess;
		return;
	}
	ja(), P.tokens[P.tokens.length - 3].identifierRole = K.ExportAccess, P.tokens[P.tokens.length - 4].isType = !0, P.tokens[P.tokens.length - 3].isType = !0, P.tokens[P.tokens.length - 2].isType = !0, P.tokens[P.tokens.length - 1].isType = !0;
}
function li() {
	if (R(A._abstract) && Ie() === j._class) return P.type = j._abstract, J(), Ls(!0, !0), !0;
	if (R(A._interface)) {
		let e = Ne(2);
		return Qr(A._interface, !0), Pe(e), !0;
	}
	return !1;
}
function ui() {
	if (P.type === j._const) {
		let e = Re();
		if (e.type === j.name && e.contextualKeyword === A._enum) return U(j._const), V(A._enum), P.tokens[P.tokens.length - 1].type = j._enum, Vr(), !0;
	}
	return !1;
}
function di(e) {
	let t = P.tokens.length;
	Rn([
		A._abstract,
		A._readonly,
		A._declare,
		A._static,
		A._override
	]);
	let n = P.tokens.length;
	if (er()) {
		let r = e ? t - 1 : t;
		for (let e = r; e < n; e++) P.tokens[e].isType = !0;
		return !0;
	}
	return !1;
}
function fi(e) {
	Zr(e) || H();
}
function pi() {
	let e = B(A._declare);
	e && (P.tokens[P.tokens.length - 1].type = j._declare);
	let t = !1;
	if (X(j.name)) if (e) {
		let e = Ne(2);
		t = Xr(), Pe(e);
	} else t = Xr();
	if (!t) if (e) {
		let e = Ne(2);
		is(!0), Pe(e);
	} else is(!0);
}
function mi(e) {
	if (e && (X(j.lessThan) || X(j.bitShiftL)) && ti(), B(A._implements)) {
		P.tokens[P.tokens.length - 1].type = j._implements;
		let e = Ne(1);
		Ir(), Pe(e);
	}
}
function hi() {
	qn();
}
function gi() {
	qn();
}
function _i() {
	let e = Ne(0);
	me() || Y(j.bang), Dr(), Pe(e);
}
function vi() {
	X(j.colon) && Ar();
}
function yi(e, t) {
	return se ? bi(e, t) : xi(e, t);
}
function bi(e, t) {
	if (!X(j.lessThan)) return Wi(e, t);
	let n = P.snapshot(), r = Wi(e, t);
	if (P.error) P.restoreFromSnapshot(n);
	else return r;
	return P.type = j.typeParameterStart, Jn(), r = Wi(e, t), r || W(), r;
}
function xi(e, t) {
	if (!X(j.lessThan)) return Wi(e, t);
	let n = P.snapshot();
	Jn();
	let r = Wi(e, t);
	if (r || W(), P.error) P.restoreFromSnapshot(n);
	else return r;
	return Wi(e, t);
}
function Si() {
	if (X(j.colon)) {
		let e = P.snapshot();
		Tr(j.colon), pe() && W(), X(j.arrow) || W(), P.error && P.restoreFromSnapshot(e);
	}
	return Y(j.arrow);
}
function Ci() {
	let e = Ne(0);
	Y(j.question), Dr(), Pe(e);
}
function wi() {
	(X(j.lessThan) || X(j.bitShiftL)) && ti(), us();
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/plugins/jsx/index.js
function Ti() {
	let e = !1, t = !1;
	for (;;) {
		if (P.pos >= F.length) {
			W("Unterminated JSX contents");
			return;
		}
		let n = F.charCodeAt(P.pos);
		if (n === M.lessThan || n === M.leftCurlyBrace) {
			if (P.pos === P.start) {
				if (n === M.lessThan) {
					P.pos++, qe(j.jsxTagStart);
					return;
				}
				at(n);
				return;
			}
			qe(e && !t ? j.jsxEmptyText : j.jsxText);
			return;
		}
		n === M.lineFeed ? e = !0 : n !== M.space && n !== M.carriageReturn && n !== M.tab && (t = !0), P.pos++;
	}
}
function Ei(e) {
	for (P.pos++;;) {
		if (P.pos >= F.length) {
			W("Unterminated string constant");
			return;
		}
		if (F.charCodeAt(P.pos) === e) {
			P.pos++;
			break;
		}
		P.pos++;
	}
	qe(j.string);
}
function Di() {
	let e;
	do {
		if (P.pos > F.length) {
			W("Unexpectedly reached the end of input.");
			return;
		}
		e = F.charCodeAt(++P.pos);
	} while (be[e] || e === M.dash);
	qe(j.jsxName);
}
function Oi() {
	Li();
}
function ki(e) {
	if (Oi(), !Y(j.colon)) {
		P.tokens[P.tokens.length - 1].identifierRole = e;
		return;
	}
	Oi();
}
function Ai() {
	let e = P.tokens.length;
	ki(K.Access);
	let t = !1;
	for (; X(j.dot);) t = !0, Li(), Oi();
	if (!t) {
		let t = P.tokens[e], n = F.charCodeAt(t.start);
		n >= M.lowercaseA && n <= M.lowercaseZ && (t.identifierRole = null);
	}
}
function ji() {
	switch (P.type) {
		case j.braceL:
			J(), Hi(), Li();
			return;
		case j.jsxTagStart:
			Ii(), Li();
			return;
		case j.string:
			Li();
			return;
		default: W("JSX value should be either an expression or a quoted JSX text");
	}
}
function Mi() {
	U(j.ellipsis), Hi();
}
function Ni(e) {
	if (X(j.jsxTagEnd)) return !1;
	Ai(), N && Fr();
	let t = !1;
	for (; !X(j.slash) && !X(j.jsxTagEnd) && !P.error;) {
		if (Y(j.braceL)) {
			t = !0, U(j.ellipsis), Ui(), Li();
			continue;
		}
		t && P.end - P.start === 3 && F.charCodeAt(P.start) === M.lowercaseK && F.charCodeAt(P.start + 1) === M.lowercaseE && F.charCodeAt(P.start + 2) === M.lowercaseY && (P.tokens[e].jsxRole = we.KeyAfterPropSpread), ki(K.ObjectKey), X(j.eq) && (Li(), ji());
	}
	let n = X(j.slash);
	return n && Li(), n;
}
function Pi() {
	X(j.jsxTagEnd) || Ai();
}
function Fi() {
	let e = P.tokens.length - 1;
	P.tokens[e].jsxRole = we.NoChildren;
	let t = 0;
	if (!Ni(e)) for (Ri();;) switch (P.type) {
		case j.jsxTagStart:
			if (Li(), X(j.slash)) {
				Li(), Pi(), P.tokens[e].jsxRole !== we.KeyAfterPropSpread && (t === 1 ? P.tokens[e].jsxRole = we.OneChild : t > 1 && (P.tokens[e].jsxRole = we.StaticChildren));
				return;
			}
			t++, Fi(), Ri();
			break;
		case j.jsxText:
			t++, Ri();
			break;
		case j.jsxEmptyText:
			Ri();
			break;
		case j.braceL:
			J(), X(j.ellipsis) ? (Mi(), Ri(), t += 2) : (X(j.braceR) || (t++, Hi()), Ri());
			break;
		// istanbul ignore next - should never happen
		default:
			W();
			return;
	}
}
function Ii() {
	Li(), Fi();
}
function Li() {
	P.tokens.push(new q()), Ke(), P.start = P.pos;
	let e = F.charCodeAt(P.pos);
	if (xe[e]) Di();
	else if (e === M.quotationMark || e === M.apostrophe) Ei(e);
	else switch (++P.pos, e) {
		case M.greaterThan:
			qe(j.jsxTagEnd);
			break;
		case M.lessThan:
			qe(j.jsxTagStart);
			break;
		case M.slash:
			qe(j.slash);
			break;
		case M.equalsTo:
			qe(j.eq);
			break;
		case M.leftCurlyBrace:
			qe(j.braceL);
			break;
		case M.dot:
			qe(j.dot);
			break;
		case M.colon:
			qe(j.colon);
			break;
		default: W();
	}
}
function Ri() {
	P.tokens.push(new q()), P.start = P.pos, Ti();
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/plugins/types.js
function zi(e) {
	if (X(j.question)) {
		let e = Ie();
		if (e === j.colon || e === j.comma || e === j.parenR) return;
	}
	qi(e);
}
function Bi() {
	Fe(j.question), X(j.colon) && (N ? Ar() : ce && Do());
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/traverser/expression.js
var Vi = class {
	constructor(e) {
		this.stop = e;
	}
};
function Hi(e = !1) {
	if (Ui(e), X(j.comma)) for (; Y(j.comma);) Ui(e);
}
function Ui(e = !1, t = !1) {
	return N ? yi(e, t) : ce ? Yo(e, t) : Wi(e, t);
}
function Wi(e, t) {
	if (X(j._yield)) return Na(), !1;
	(X(j.parenL) || X(j.name) || X(j._yield)) && (P.potentialArrowAt = P.start);
	let n = Gi(e);
	return t && ha(), P.type & j.IS_ASSIGN ? (J(), Ui(e), !1) : n;
}
function Gi(e) {
	return Ji(e) ? !0 : (Ki(e), !1);
}
function Ki(e) {
	N || ce ? zi(e) : qi(e);
}
function qi(e) {
	Y(j.question) && (Ui(), U(j.colon), Ui(e));
}
function Ji(e) {
	let t = P.tokens.length;
	return Xi() ? !0 : (Yi(t, -1, e), !1);
}
function Yi(e, t, n) {
	if (N && (j._in & j.PRECEDENCE_MASK) > t && !me() && (B(A._as) || B(A._satisfies))) {
		let r = Ne(1);
		jr(), Pe(r), nt(), Yi(e, t, n);
		return;
	}
	let r = P.type & j.PRECEDENCE_MASK;
	if (r > 0 && (!n || !X(j._in)) && r > t) {
		let i = P.type;
		J(), i === j.nullishCoalescing && (P.tokens[P.tokens.length - 1].nullishStartIndex = e);
		let a = P.tokens.length;
		Xi(), Yi(a, i & j.IS_RIGHT_ASSOCIATIVE ? r - 1 : r, n), i === j.nullishCoalescing && (P.tokens[e].numNullishCoalesceStarts++, P.tokens[P.tokens.length - 1].numNullishCoalesceEnds++), Yi(e, t, n);
	}
}
function Xi() {
	if (N && !se && Y(j.lessThan)) return Pr(), !1;
	if (R(A._module) && Ve() === M.leftCurlyBrace && !he()) return Pa(), !1;
	if (P.type & j.IS_PREFIX) return J(), Xi(), !1;
	if (Zi()) return !0;
	for (; P.type & j.IS_POSTFIX && !pe();) P.type === j.preIncDec && (P.type = j.postIncDec), J();
	return !1;
}
function Zi() {
	let e = P.tokens.length;
	return sa() ? !0 : (Qi(e), P.tokens.length > e && P.tokens[e].isOptionalChainStart && (P.tokens[P.tokens.length - 1].isOptionalChainEnd = !0), !1);
}
function Qi(e, t = !1) {
	ce ? Zo(e, t) : $i(e, t);
}
function $i(e, t = !1) {
	let n = new Vi(!1);
	do
		ea(e, t, n);
	while (!n.stop && !P.error);
}
function ea(e, t, n) {
	N ? ai(e, t, n) : ce ? jo(e, t, n) : ta(e, t, n);
}
function ta(e, t, n) {
	if (!t && Y(j.doubleColon)) oa(), n.stop = !0, Qi(e, t);
	else if (X(j.questionDot)) {
		if (P.tokens[e].isOptionalChainStart = !0, t && Ie() === j.parenL) {
			n.stop = !0;
			return;
		}
		J(), P.tokens[P.tokens.length - 1].subscriptStartIndex = e, Y(j.bracketL) ? (Hi(), U(j.bracketR)) : Y(j.parenL) ? ra() : ca();
	} else if (Y(j.dot)) P.tokens[P.tokens.length - 1].subscriptStartIndex = e, ca();
	else if (Y(j.bracketL)) P.tokens[P.tokens.length - 1].subscriptStartIndex = e, Hi(), U(j.bracketR);
	else if (!t && X(j.parenL)) if (na()) {
		let t = P.snapshot(), r = P.tokens.length;
		J(), P.tokens[P.tokens.length - 1].subscriptStartIndex = e;
		let i = le();
		P.tokens[P.tokens.length - 1].contextId = i, ra(), P.tokens[P.tokens.length - 1].contextId = i, ia() && (P.restoreFromSnapshot(t), n.stop = !0, P.scopeDepth++, Is(), aa(r));
	} else {
		J(), P.tokens[P.tokens.length - 1].subscriptStartIndex = e;
		let t = le();
		P.tokens[P.tokens.length - 1].contextId = t, ra(), P.tokens[P.tokens.length - 1].contextId = t;
	}
	else X(j.backQuote) ? va() : n.stop = !0;
}
function na() {
	return P.tokens[P.tokens.length - 1].contextualKeyword === A._async && !pe();
}
function ra() {
	let e = !0;
	for (; !Y(j.parenR) && !P.error;) {
		if (e) e = !1;
		else if (U(j.comma), Y(j.parenR)) break;
		Aa(!1);
	}
}
function ia() {
	return X(j.colon) || X(j.arrow);
}
function aa(e) {
	N ? vi() : ce && Jo(), U(j.arrow), Ea(e);
}
function oa() {
	let e = P.tokens.length;
	sa(), Qi(e, !0);
}
function sa() {
	if (Y(j.modulo)) return ja(), !1;
	if (X(j.jsxText) || X(j.jsxEmptyText)) return ua(), !1;
	if (X(j.lessThan) && se) return P.type = j.jsxTagStart, Ii(), J(), !1;
	let e = P.potentialArrowAt === P.start;
	switch (P.type) {
		case j.slash:
		case j.assign: Me();
		case j._super:
		case j._this:
		case j.regexp:
		case j.num:
		case j.bigint:
		case j.decimal:
		case j.string:
		case j._null:
		case j._true:
		case j._false: return J(), !1;
		case j._import: return J(), X(j.dot) && (P.tokens[P.tokens.length - 1].type = j.name, J(), ja()), !1;
		case j.name: {
			let t = P.tokens.length, n = P.start, r = P.contextualKeyword;
			return ja(), r === A._await ? (Ma(), !1) : r === A._async && X(j._function) && !pe() ? (J(), Fs(n, !1), !1) : e && r === A._async && !pe() && X(j.name) ? (P.scopeDepth++, Dn(!1), U(j.arrow), Ea(t), !0) : X(j._do) && !pe() ? (J(), ks(), !1) : e && !pe() && X(j.arrow) ? (P.scopeDepth++, kn(!1), U(j.arrow), Ea(t), !0) : (P.tokens[P.tokens.length - 1].identifierRole = K.Access, !1);
		}
		case j._do: return J(), ks(), !1;
		case j.parenL: return fa(e);
		case j.bracketL: return J(), ka(j.bracketR, !0), !1;
		case j.braceL: return ya(!1, !1), !1;
		case j._function: return la(), !1;
		case j.at: ss();
		case j._class: return Ls(!1), !1;
		case j._new: return ga(), !1;
		case j.backQuote: return va(), !1;
		case j.doubleColon: return J(), oa(), !1;
		case j.hash: {
			let e = Ve();
			return xe[e] || e === M.backslash ? ca() : J(), !1;
		}
		default: return W(), !1;
	}
}
function ca() {
	Y(j.hash), ja();
}
function la() {
	let e = P.start;
	ja(), Y(j.dot) && ja(), Fs(e, !1);
}
function ua() {
	J();
}
function da() {
	U(j.parenL), Hi(), U(j.parenR);
}
function fa(e) {
	let t = P.snapshot(), n = P.tokens.length;
	U(j.parenL);
	let r = !0;
	for (; !X(j.parenR) && !P.error;) {
		if (r) r = !1;
		else if (U(j.comma), X(j.parenR)) break;
		if (X(j.ellipsis)) {
			En(!1), ha();
			break;
		} else Ui(!1, !0);
	}
	return U(j.parenR), e && pa() && ma() ? (P.restoreFromSnapshot(t), P.scopeDepth++, Is(), ma(), Ea(n), P.error ? (P.restoreFromSnapshot(t), fa(!1), !1) : !0) : !1;
}
function pa() {
	return X(j.colon) || !pe();
}
function ma() {
	return N ? Si() : ce ? Xo() : Y(j.arrow);
}
function ha() {
	(N || ce) && Bi();
}
function ga() {
	if (U(j._new), Y(j.dot)) {
		ja();
		return;
	}
	_a(), ce && Mo(), Y(j.parenL) && ka(j.parenR);
}
function _a() {
	oa(), Y(j.questionDot);
}
function va() {
	for (je(), je(); !X(j.backQuote) && !P.error;) U(j.dollarBraceL), Hi(), je(), je();
	J();
}
function ya(e, t) {
	let n = le(), r = !0;
	for (J(), P.tokens[P.tokens.length - 1].contextId = n; !Y(j.braceR) && !P.error;) {
		if (r) r = !1;
		else if (U(j.comma), Y(j.braceR)) break;
		let i = !1;
		if (X(j.ellipsis)) {
			let n = P.tokens.length;
			if (Tn(), e && (P.tokens.length === n + 2 && kn(t), Y(j.braceR))) break;
			continue;
		}
		e || (i = Y(j.star)), !e && R(A._async) ? (i && W(), ja(), X(j.colon) || X(j.parenL) || X(j.braceR) || X(j.eq) || X(j.comma) || (X(j.star) && (J(), i = !0), wa(n))) : wa(n), Ca(e, t, n);
	}
	P.tokens[P.tokens.length - 1].contextId = n;
}
function ba(e) {
	return !e && (X(j.string) || X(j.num) || X(j.bracketL) || X(j.name) || !!(P.type & j.IS_KEYWORD));
}
function xa(e, t) {
	let n = P.start;
	return X(j.parenL) ? (e && W(), Ta(n, !1), !0) : ba(e) ? (wa(t), Ta(n, !1), !0) : !1;
}
function Sa(e, t) {
	if (Y(j.colon)) {
		e ? Pn(t) : Ui(!1);
		return;
	}
	let n;
	n = e ? P.scopeDepth === 0 ? K.ObjectShorthandTopLevelDeclaration : t ? K.ObjectShorthandBlockScopedDeclaration : K.ObjectShorthandFunctionScopedDeclaration : K.ObjectShorthand, P.tokens[P.tokens.length - 1].identifierRole = n, Pn(t, !0);
}
function Ca(e, t, n) {
	N ? hi() : ce && Ho(), xa(e, n) || Sa(e, t);
}
function wa(e) {
	ce && ko(), Y(j.bracketL) ? (P.tokens[P.tokens.length - 1].contextId = e, Ui(), U(j.bracketR), P.tokens[P.tokens.length - 1].contextId = e) : (X(j.num) || X(j.string) || X(j.bigint) || X(j.decimal) ? sa() : ca(), P.tokens[P.tokens.length - 1].identifierRole = K.ObjectKey, P.tokens[P.tokens.length - 1].contextId = e);
}
function Ta(e, t) {
	let n = le();
	P.scopeDepth++;
	let r = P.tokens.length;
	Is(t, n), Da(e, n);
	let i = P.tokens.length;
	P.scopes.push(new ie(r, i, !0)), P.scopeDepth--;
}
function Ea(e) {
	Oa(!0);
	let t = P.tokens.length;
	P.scopes.push(new ie(e, t, !0)), P.scopeDepth--;
}
function Da(e, t = 0) {
	N ? ii(e, t) : ce ? Ao(t) : Oa(!1, t);
}
function Oa(e, t = 0) {
	e && !X(j.braceL) ? Ui() : ks(!0, t);
}
function ka(e, t = !1) {
	let n = !0;
	for (; !Y(e) && !P.error;) {
		if (n) n = !1;
		else if (U(j.comma), Y(e)) break;
		Aa(t);
	}
}
function Aa(e) {
	e && X(j.comma) || (X(j.ellipsis) ? (Tn(), ha()) : X(j.question) ? J() : Ui(!1, !0));
}
function ja() {
	J(), P.tokens[P.tokens.length - 1].type = j.name;
}
function Ma() {
	Xi();
}
function Na() {
	J(), !X(j.semi) && !pe() && (Y(j.star), Ui());
}
function Pa() {
	V(A._module), U(j.braceL), As(j.braceR);
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/plugins/flow.js
function Fa(e) {
	return (e.type === j.name || !!(e.type & j.IS_KEYWORD)) && e.contextualKeyword !== A._from;
}
function Ia(e) {
	let t = Ne(0);
	U(e || j.colon), Eo(), Pe(t);
}
function La() {
	U(j.modulo), V(A._checks), Y(j.parenL) && (Hi(), U(j.parenR));
}
function Ra() {
	let e = Ne(0);
	U(j.colon), X(j.modulo) ? La() : (Eo(), X(j.modulo) && La()), Pe(e);
}
function za() {
	J(), Ya(!0);
}
function Ba() {
	J(), ja(), X(j.lessThan) && no(), U(j.parenL), yo(), U(j.parenR), Ra(), H();
}
function Va() {
	X(j._class) ? za() : X(j._function) ? Ba() : X(j._var) ? Ha() : B(A._module) ? Y(j.dot) ? Ga() : Ua() : R(A._type) ? Ka() : R(A._opaque) ? qa() : R(A._interface) ? Ja() : X(j._export) ? Wa() : W();
}
function Ha() {
	J(), Oo(), H();
}
function Ua() {
	for (X(j.string) ? sa() : ja(), U(j.braceL); !X(j.braceR) && !P.error;) X(j._import) ? (J(), uc()) : W();
	U(j.braceR);
}
function Wa() {
	U(j._export), Y(j._default) ? X(j._function) || X(j._class) ? Va() : (Eo(), H()) : X(j._var) || X(j._function) || X(j._class) || R(A._opaque) ? Va() : X(j.star) || X(j.braceL) || R(A._interface) || R(A._type) || R(A._opaque) ? Ys() : W();
}
function Ga() {
	V(A._exports), Do(), H();
}
function Ka() {
	J(), $a();
}
function qa() {
	J(), eo(!0);
}
function Ja() {
	J(), Ya();
}
function Ya(e = !1) {
	if (Qa(), X(j.lessThan) && no(), Y(j._extends)) do
		Xa();
	while (!e && Y(j.comma));
	if (R(A._mixins)) {
		J();
		do
			Xa();
		while (Y(j.comma));
	}
	if (R(A._implements)) {
		J();
		do
			Xa();
		while (Y(j.comma));
	}
	uo(e, !1, e);
}
function Xa() {
	mo(!1), X(j.lessThan) && ro();
}
function Za() {
	Ya();
}
function Qa() {
	ja();
}
function $a() {
	Qa(), X(j.lessThan) && no(), Ia(j.eq), H();
}
function eo(e) {
	V(A._type), Qa(), X(j.lessThan) && no(), X(j.colon) && Ia(j.colon), e || Ia(j.eq), H();
}
function to() {
	ko(), Oo(), Y(j.eq) && Eo();
}
function no() {
	let e = Ne(0);
	// istanbul ignore else: this condition is already checked at all call sites
	X(j.lessThan) || X(j.typeParameterStart) ? J() : W();
	do
		to(), X(j.greaterThan) || U(j.comma);
	while (!X(j.greaterThan) && !P.error);
	U(j.greaterThan), Pe(e);
}
function ro() {
	let e = Ne(0);
	for (U(j.lessThan); !X(j.greaterThan) && !P.error;) Eo(), X(j.greaterThan) || U(j.comma);
	U(j.greaterThan), Pe(e);
}
function io() {
	if (V(A._interface), Y(j._extends)) do
		Xa();
	while (Y(j.comma));
	uo(!1, !1, !1);
}
function ao() {
	X(j.num) || X(j.string) ? sa() : ja();
}
function oo() {
	Ie() === j.colon ? (ao(), Ia()) : Eo(), U(j.bracketR), Ia();
}
function so() {
	ao(), U(j.bracketR), U(j.bracketR), X(j.lessThan) || X(j.parenL) ? co() : (Y(j.question), Ia());
}
function co() {
	for (X(j.lessThan) && no(), U(j.parenL); !X(j.parenR) && !X(j.ellipsis) && !P.error;) vo(), X(j.parenR) || U(j.comma);
	Y(j.ellipsis) && vo(), U(j.parenR), Ia();
}
function lo() {
	co();
}
function uo(e, t, n) {
	let r;
	for (t && X(j.braceBarL) ? (U(j.braceBarL), r = j.braceBarR) : (U(j.braceL), r = j.braceR); !X(r) && !P.error;) {
		if (n && R(A._proto)) {
			let t = Ie();
			t !== j.colon && t !== j.question && (J(), e = !1);
		}
		if (e && R(A._static)) {
			let e = Ie();
			e !== j.colon && e !== j.question && J();
		}
		if (ko(), Y(j.bracketL)) Y(j.bracketL) ? so() : oo();
		else if (X(j.parenL) || X(j.lessThan)) lo();
		else {
			if (R(A._get) || R(A._set)) {
				let e = Ie();
				(e === j.name || e === j.string || e === j.num) && J();
			}
			fo();
		}
		po();
	}
	U(r);
}
function fo() {
	if (X(j.ellipsis)) {
		if (U(j.ellipsis), Y(j.comma) || Y(j.semi), X(j.braceR)) return;
		Eo();
	} else ao(), X(j.lessThan) || X(j.parenL) ? co() : (Y(j.question), Ia());
}
function po() {
	!Y(j.semi) && !Y(j.comma) && !X(j.braceR) && !X(j.braceBarR) && W();
}
function mo(e) {
	for (e || ja(); Y(j.dot);) ja();
}
function ho() {
	mo(!0), X(j.lessThan) && ro();
}
function go() {
	U(j._typeof), bo();
}
function _o() {
	for (U(j.bracketL); P.pos < F.length && !X(j.bracketR) && (Eo(), !X(j.bracketR));) U(j.comma);
	U(j.bracketR);
}
function vo() {
	let e = Ie();
	e === j.colon || e === j.question ? (ja(), Y(j.question), Ia()) : Eo();
}
function yo() {
	for (; !X(j.parenR) && !X(j.ellipsis) && !P.error;) vo(), X(j.parenR) || U(j.comma);
	Y(j.ellipsis) && vo();
}
function bo() {
	let e = !1, t = P.noAnonFunctionType;
	switch (P.type) {
		case j.name:
			if (R(A._interface)) {
				io();
				return;
			}
			ja(), ho();
			return;
		case j.braceL:
			uo(!1, !1, !1);
			return;
		case j.braceBarL:
			uo(!1, !0, !1);
			return;
		case j.bracketL:
			_o();
			return;
		case j.lessThan:
			no(), U(j.parenL), yo(), U(j.parenR), U(j.arrow), Eo();
			return;
		case j.parenL:
			if (J(), !X(j.parenR) && !X(j.ellipsis)) if (X(j.name)) {
				let t = Ie();
				e = t !== j.question && t !== j.colon;
			} else e = !0;
			if (e) if (P.noAnonFunctionType = !1, Eo(), P.noAnonFunctionType = t, P.noAnonFunctionType || !(X(j.comma) || X(j.parenR) && Ie() === j.arrow)) {
				U(j.parenR);
				return;
			} else Y(j.comma);
			yo(), U(j.parenR), U(j.arrow), Eo();
			return;
		case j.minus:
			J(), ua();
			return;
		case j.string:
		case j.num:
		case j._true:
		case j._false:
		case j._null:
		case j._this:
		case j._void:
		case j.star:
			J();
			return;
		default: if (P.type === j._typeof) {
			go();
			return;
		} else if (P.type & j.IS_KEYWORD) {
			J(), P.tokens[P.tokens.length - 1].type = j.name;
			return;
		}
	}
	W();
}
function xo() {
	for (bo(); !pe() && (X(j.bracketL) || X(j.questionDot));) Y(j.questionDot), U(j.bracketL), Y(j.bracketR) || (Eo(), U(j.bracketR));
}
function So() {
	Y(j.question) ? So() : xo();
}
function Co() {
	So(), !P.noAnonFunctionType && Y(j.arrow) && Eo();
}
function wo() {
	for (Y(j.bitwiseAND), Co(); Y(j.bitwiseAND);) Co();
}
function To() {
	for (Y(j.bitwiseOR), wo(); Y(j.bitwiseOR);) wo();
}
function Eo() {
	To();
}
function Do() {
	Ia();
}
function Oo() {
	ja(), X(j.colon) && Do();
}
function ko() {
	(X(j.plus) || X(j.minus)) && (J(), P.tokens[P.tokens.length - 1].isType = !0);
}
function Ao(e) {
	X(j.colon) && Ra(), Oa(!1, e);
}
function jo(e, t, n) {
	if (X(j.questionDot) && Ie() === j.lessThan) {
		if (t) {
			n.stop = !0;
			return;
		}
		J(), ro(), U(j.parenL), ra();
		return;
	} else if (!t && X(j.lessThan)) {
		let e = P.snapshot();
		if (ro(), U(j.parenL), ra(), P.error) P.restoreFromSnapshot(e);
		else return;
	}
	ta(e, t, n);
}
function Mo() {
	if (X(j.lessThan)) {
		let e = P.snapshot();
		ro(), P.error && P.restoreFromSnapshot(e);
	}
}
function No() {
	if (X(j.name) && P.contextualKeyword === A._interface) {
		let e = Ne(0);
		return J(), Za(), Pe(e), !0;
	} else if (R(A._enum)) return $o(), !0;
	return !1;
}
function Po() {
	return R(A._enum) ? ($o(), !0) : !1;
}
function Fo(e) {
	if (e === A._declare) {
		if (X(j._class) || X(j.name) || X(j._function) || X(j._var) || X(j._export)) {
			let e = Ne(1);
			Va(), Pe(e);
		}
	} else if (X(j.name)) {
		if (e === A._interface) {
			let e = Ne(1);
			Za(), Pe(e);
		} else if (e === A._type) {
			let e = Ne(1);
			$a(), Pe(e);
		} else if (e === A._opaque) {
			let e = Ne(1);
			eo(!1), Pe(e);
		}
	}
	H();
}
function Io() {
	return R(A._type) || R(A._interface) || R(A._opaque) || R(A._enum);
}
function Lo() {
	return X(j.name) && (P.contextualKeyword === A._type || P.contextualKeyword === A._interface || P.contextualKeyword === A._opaque || P.contextualKeyword === A._enum);
}
function Ro() {
	if (R(A._type)) {
		let e = Ne(1);
		J(), X(j.braceL) ? (oc(), ec()) : $a(), Pe(e);
	} else if (R(A._opaque)) {
		let e = Ne(1);
		J(), eo(!1), Pe(e);
	} else if (R(A._interface)) {
		let e = Ne(1);
		J(), Za(), Pe(e);
	} else is(!0);
}
function zo() {
	return X(j.star) || R(A._type) && Ie() === j.star;
}
function Bo() {
	if (B(A._type)) {
		let e = Ne(2);
		rc(), Pe(e);
	} else rc();
}
function Vo(e) {
	if (e && X(j.lessThan) && ro(), R(A._implements)) {
		let e = Ne(0);
		J(), P.tokens[P.tokens.length - 1].type = j._implements;
		do
			Qa(), X(j.lessThan) && ro();
		while (Y(j.comma));
		Pe(e);
	}
}
function Ho() {
	X(j.lessThan) && (no(), X(j.parenL) || W());
}
function Uo() {
	let e = Ne(0);
	Y(j.question), X(j.colon) && Do(), Pe(e);
}
function Wo() {
	if (X(j._typeof) || R(A._type)) {
		let e = Re();
		(Fa(e) || e.type === j.braceL || e.type === j.star) && J();
	}
}
function Go() {
	let e = P.contextualKeyword === A._type || P.type === j._typeof;
	e ? J() : ja(), R(A._as) && !z(A._as) ? (ja(), e && !X(j.name) && !(P.type & j.IS_KEYWORD) || ja()) : (e && (X(j.name) || P.type & j.IS_KEYWORD) && ja(), B(A._as) && ja());
}
function Ko() {
	if (X(j.lessThan)) {
		let e = Ne(0);
		no(), Pe(e);
	}
}
function qo() {
	X(j.colon) && Do();
}
function Jo() {
	if (X(j.colon)) {
		let e = P.noAnonFunctionType;
		P.noAnonFunctionType = !0, Do(), P.noAnonFunctionType = e;
	}
}
function Yo(e, t) {
	if (X(j.lessThan)) {
		let n = P.snapshot(), r = Wi(e, t);
		if (P.error) P.restoreFromSnapshot(n), P.type = j.typeParameterStart;
		else return r;
		let i = Ne(0);
		if (no(), Pe(i), r = Wi(e, t), r) return !0;
		W();
	}
	return Wi(e, t);
}
function Xo() {
	if (X(j.colon)) {
		let e = Ne(0), t = P.snapshot(), n = P.noAnonFunctionType;
		P.noAnonFunctionType = !0, Ra(), P.noAnonFunctionType = n, pe() && W(), X(j.arrow) || W(), P.error && P.restoreFromSnapshot(t), Pe(e);
	}
	return Y(j.arrow);
}
function Zo(e, t = !1) {
	if (P.tokens[P.tokens.length - 1].contextualKeyword === A._async && X(j.lessThan)) {
		let e = P.snapshot();
		if (Qo() && !P.error) return;
		P.restoreFromSnapshot(e);
	}
	$i(e, t);
}
function Qo() {
	P.scopeDepth++;
	let e = P.tokens.length;
	return Is(), ma() ? (Ea(e), !0) : !1;
}
function $o() {
	V(A._enum), P.tokens[P.tokens.length - 1].type = j._enum, ja(), es();
}
function es() {
	B(A._of) && J(), U(j.braceL), ts(), U(j.braceR);
}
function ts() {
	for (; !X(j.braceR) && !P.error && !Y(j.ellipsis);) ns(), X(j.braceR) || U(j.comma);
}
function ns() {
	ja(), Y(j.eq) && J();
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/traverser/statement.js
function rs() {
	if (As(j.eof), P.scopes.push(new ie(0, P.tokens.length, !0)), P.scopeDepth !== 0) throw Error(`Invalid scope depth at end of file: ${P.scopeDepth}`);
	return new _c(P.tokens, P.scopes);
}
function is(e) {
	ce && No() || (X(j.at) && ss(), as(e));
}
function as(e) {
	if (N && ui()) return;
	let t = P.type;
	switch (t) {
		case j._break:
		case j._continue:
			ds();
			return;
		case j._debugger:
			fs();
			return;
		case j._do:
			ps();
			return;
		case j._for:
			ms();
			return;
		case j._function:
			if (Ie() === j.dot) break;
			e || W(), _s();
			return;
		case j._class:
			e || W(), Ls(!0);
			return;
		case j._if:
			vs();
			return;
		case j._return:
			ys();
			return;
		case j._switch:
			bs();
			return;
		case j._throw:
			xs();
			return;
		case j._try:
			Cs();
			return;
		case j._let:
		case j._const: e || W();
		case j._var:
			ws(t !== j._var);
			return;
		case j._while:
			Ts();
			return;
		case j.braceL:
			ks();
			return;
		case j.semi:
			Es();
			return;
		case j._export:
		case j._import: {
			let e = Ie();
			if (e === j.parenL || e === j.dot) break;
			J(), t === j._import ? uc() : Ys();
			return;
		}
		case j.name: if (P.contextualKeyword === A._async) {
			let e = P.start, t = P.snapshot();
			if (J(), X(j._function) && !pe()) {
				U(j._function), Fs(e, !0);
				return;
			} else P.restoreFromSnapshot(t);
		} else if (P.contextualKeyword === A._using && !he() && Ie() === j.name) {
			ws(!0);
			return;
		} else if (os()) {
			V(A._await), ws(!0);
			return;
		}
		default: break;
	}
	let n = P.tokens.length;
	Hi();
	let r = null;
	if (P.tokens.length === n + 1) {
		let e = P.tokens[P.tokens.length - 1];
		e.type === j.name && (r = e.contextualKeyword);
	}
	if (r == null) {
		H();
		return;
	}
	Y(j.colon) ? Ds() : Os(r);
}
function os() {
	if (!R(A._await)) return !1;
	let e = P.snapshot();
	return J(), !R(A._using) || me() || (J(), !X(j.name) || me()) ? (P.restoreFromSnapshot(e), !1) : (P.restoreFromSnapshot(e), !0);
}
function ss() {
	for (; X(j.at);) cs();
}
function cs() {
	if (J(), Y(j.parenL)) Hi(), U(j.parenR);
	else {
		for (ja(); Y(j.dot);) ja();
		ls();
	}
}
function ls() {
	N ? wi() : us();
}
function us() {
	Y(j.parenL) && ra();
}
function ds() {
	J(), ge() || (ja(), H());
}
function fs() {
	J(), H();
}
function ps() {
	J(), is(!1), U(j._while), da(), Y(j.semi);
}
function ms() {
	P.scopeDepth++;
	let e = P.tokens.length;
	gs();
	let t = P.tokens.length;
	P.scopes.push(new ie(e, t, !1)), P.scopeDepth--;
}
function hs() {
	return !(!R(A._using) || z(A._of));
}
function gs() {
	J();
	let e = !1;
	if (R(A._await) && (e = !0, J()), U(j.parenL), X(j.semi)) {
		e && W(), js();
		return;
	}
	let t = os();
	if (t || X(j._var) || X(j._let) || X(j._const) || hs()) {
		if (t && V(A._await), J(), Ns(!0, P.type !== j._var), X(j._in) || R(A._of)) {
			Ms(e);
			return;
		}
		js();
		return;
	}
	if (Hi(!0), X(j._in) || R(A._of)) {
		Ms(e);
		return;
	}
	e && W(), js();
}
function _s() {
	let e = P.start;
	J(), Fs(e, !0);
}
function vs() {
	J(), da(), is(!1), Y(j._else) && is(!1);
}
function ys() {
	J(), ge() || (Hi(), H());
}
function bs() {
	J(), da(), P.scopeDepth++;
	let e = P.tokens.length;
	for (U(j.braceL); !X(j.braceR) && !P.error;) if (X(j._case) || X(j._default)) {
		let e = X(j._case);
		J(), e && Hi(), U(j.colon);
	} else is(!0);
	J();
	let t = P.tokens.length;
	P.scopes.push(new ie(e, t, !1)), P.scopeDepth--;
}
function xs() {
	J(), Hi(), H();
}
function Ss() {
	An(!0), N && Dr();
}
function Cs() {
	if (J(), ks(), X(j._catch)) {
		J();
		let e = null;
		if (X(j.parenL) && (P.scopeDepth++, e = P.tokens.length, U(j.parenL), Ss(), U(j.parenR)), ks(), e != null) {
			let t = P.tokens.length;
			P.scopes.push(new ie(e, t, !1)), P.scopeDepth--;
		}
	}
	Y(j._finally) && ks();
}
function ws(e) {
	J(), Ns(!1, e), H();
}
function Ts() {
	J(), da(), is(!1);
}
function Es() {
	J();
}
function Ds() {
	is(!0);
}
function Os(e) {
	N ? fi(e) : ce ? Fo(e) : H();
}
function ks(e = !1, t = 0) {
	let n = P.tokens.length;
	P.scopeDepth++, U(j.braceL), t && (P.tokens[P.tokens.length - 1].contextId = t), As(j.braceR), t && (P.tokens[P.tokens.length - 1].contextId = t);
	let r = P.tokens.length;
	P.scopes.push(new ie(n, r, e)), P.scopeDepth--;
}
function As(e) {
	for (; !Y(e) && !P.error;) is(!0);
}
function js() {
	U(j.semi), X(j.semi) || Hi(), U(j.semi), X(j.parenR) || Hi(), U(j.parenR), is(!1);
}
function Ms(e) {
	e ? B(A._of) : J(), Hi(), U(j.parenR), is(!1);
}
function Ns(e, t) {
	for (;;) {
		if (Ps(t), Y(j.eq)) {
			let t = P.tokens.length - 1;
			Ui(e), P.tokens[t].rhsEndIndex = P.tokens.length;
		}
		if (!Y(j.comma)) break;
	}
}
function Ps(e) {
	An(e), N ? _i() : ce && qo();
}
function Fs(e, t, n = !1) {
	X(j.star) && J(), t && !n && !X(j.name) && !X(j._yield) && W();
	let r = null;
	X(j.name) && (t || (r = P.tokens.length, P.scopeDepth++), Dn(!1));
	let i = P.tokens.length;
	P.scopeDepth++, Is(), Da(e);
	let a = P.tokens.length;
	P.scopes.push(new ie(i, a, !0)), P.scopeDepth--, r !== null && (P.scopes.push(new ie(r, a, !0)), P.scopeDepth--);
}
function Is(e = !1, t = 0) {
	N ? gi() : ce && Ko(), U(j.parenL), t && (P.tokens[P.tokens.length - 1].contextId = t), jn(j.parenR, !1, !1, e, t), t && (P.tokens[P.tokens.length - 1].contextId = t);
}
function Ls(e, t = !1) {
	let n = le();
	J(), P.tokens[P.tokens.length - 1].contextId = n, P.tokens[P.tokens.length - 1].isExpression = !e;
	let r = null;
	e || (r = P.tokens.length, P.scopeDepth++), qs(e, t), Js();
	let i = P.tokens.length;
	if (Bs(n), !P.error && (P.tokens[i].contextId = n, P.tokens[P.tokens.length - 1].contextId = n, r !== null)) {
		let e = P.tokens.length;
		P.scopes.push(new ie(r, e, !1)), P.scopeDepth--;
	}
}
function Rs() {
	return X(j.eq) || X(j.semi) || X(j.braceR) || X(j.bang) || X(j.colon);
}
function zs() {
	return X(j.parenL) || X(j.lessThan);
}
function Bs(e) {
	for (U(j.braceL); !Y(j.braceR) && !P.error;) {
		if (Y(j.semi)) continue;
		if (X(j.at)) {
			cs();
			continue;
		}
		let t = P.start;
		Vs(t, e);
	}
}
function Vs(e, t) {
	N && Rn([
		A._declare,
		A._public,
		A._protected,
		A._private,
		A._override
	]);
	let n = !1;
	if (X(j.name) && P.contextualKeyword === A._static) {
		if (ja(), zs()) {
			Us(e, !1);
			return;
		} else if (Rs()) {
			Ks();
			return;
		}
		if (P.tokens[P.tokens.length - 1].type = j._static, n = !0, X(j.braceL)) {
			P.tokens[P.tokens.length - 1].contextId = t, ks();
			return;
		}
	}
	Hs(e, n, t);
}
function Hs(e, t, n) {
	if (N && di(t)) return;
	if (Y(j.star)) {
		Ws(n), Us(e, !1);
		return;
	}
	Ws(n);
	let r = !1, i = P.tokens[P.tokens.length - 1];
	i.contextualKeyword === A._constructor && (r = !0), Gs(), zs() ? Us(e, r) : Rs() ? Ks() : i.contextualKeyword === A._async && !ge() ? (P.tokens[P.tokens.length - 1].type = j._async, X(j.star) && J(), Ws(n), Gs(), Us(e, !1)) : (i.contextualKeyword === A._get || i.contextualKeyword === A._set) && !(ge() && X(j.star)) ? (i.contextualKeyword === A._get ? P.tokens[P.tokens.length - 1].type = j._get : P.tokens[P.tokens.length - 1].type = j._set, Ws(n), Us(e, !1)) : i.contextualKeyword === A._accessor && !ge() ? (Ws(n), Ks()) : ge() ? Ks() : W();
}
function Us(e, t) {
	N ? qn() : ce && X(j.lessThan) && no(), Ta(e, t);
}
function Ws(e) {
	wa(e);
}
function Gs() {
	if (N) {
		let e = Ne(0);
		Y(j.question), Pe(e);
	}
}
function Ks() {
	if (N ? (Fe(j.bang), Dr()) : ce && X(j.colon) && Do(), X(j.eq)) {
		let e = P.tokens.length;
		J(), Ui(), P.tokens[e].rhsEndIndex = P.tokens.length;
	}
	H();
}
function qs(e, t = !1) {
	N && (!e || t) && R(A._implements) || (X(j.name) && Dn(!0), N ? qn() : ce && X(j.lessThan) && no());
}
function Js() {
	let e = !1;
	Y(j._extends) ? (Zi(), e = !0) : e = !1, N ? mi(e) : ce && Vo(e);
}
function Ys() {
	let e = P.tokens.length - 1;
	N && oi() || (tc() ? nc() : Qs() ? (ja(), X(j.comma) && Ie() === j.star ? (U(j.comma), U(j.star), V(A._as), ja()) : $s(), ec()) : Y(j._default) ? Xs() : ac() ? Zs() : (oc(), ec()), P.tokens[e].rhsEndIndex = P.tokens.length);
}
function Xs() {
	if (N && li() || ce && Po()) return;
	let e = P.start;
	Y(j._function) ? Fs(e, !0, !0) : R(A._async) && Ie() === j._function ? (B(A._async), Y(j._function), Fs(e, !0, !0)) : X(j._class) ? Ls(!0, !0) : X(j.at) ? (ss(), Ls(!0, !0)) : (Ui(), H());
}
function Zs() {
	N ? pi() : ce ? Ro() : is(!0);
}
function Qs() {
	if (N && ri() || ce && Lo()) return !1;
	if (X(j.name)) return P.contextualKeyword !== A._async;
	if (!X(j._default)) return !1;
	let e = ze(), t = Re(), n = t.type === j.name && t.contextualKeyword === A._from;
	if (t.type === j.comma) return !0;
	if (n) {
		let t = F.charCodeAt(Be(e + 4));
		return t === M.quotationMark || t === M.apostrophe;
	}
	return !1;
}
function $s() {
	Y(j.comma) && oc();
}
function ec() {
	B(A._from) && (sa(), hc()), H();
}
function tc() {
	return ce ? zo() : X(j.star);
}
function nc() {
	ce ? Bo() : rc();
}
function rc() {
	U(j.star), R(A._as) ? ic() : ec();
}
function ic() {
	J(), P.tokens[P.tokens.length - 1].type = j._as, ja(), $s(), ec();
}
function ac() {
	return N && ri() || ce && Io() || P.type === j._var || P.type === j._const || P.type === j._let || P.type === j._function || P.type === j._class || R(A._async) || X(j.at);
}
function oc() {
	let e = !0;
	for (U(j.braceL); !Y(j.braceR) && !P.error;) {
		if (e) e = !1;
		else if (U(j.comma), Y(j.braceR)) break;
		sc();
	}
}
function sc() {
	if (N) {
		ci();
		return;
	}
	ja(), P.tokens[P.tokens.length - 1].identifierRole = K.ExportAccess, B(A._as) && ja();
}
function cc() {
	let e = P.snapshot();
	return V(A._module), B(A._from) ? R(A._from) ? (P.restoreFromSnapshot(e), !0) : (P.restoreFromSnapshot(e), !1) : X(j.comma) ? (P.restoreFromSnapshot(e), !1) : (P.restoreFromSnapshot(e), !0);
}
function lc() {
	R(A._module) && cc() && J();
}
function uc() {
	if (N && X(j.name) && Ie() === j.eq) {
		Gr();
		return;
	}
	if (N && R(A._type)) {
		let e = Re();
		if (e.type === j.name && e.contextualKeyword !== A._from) {
			if (V(A._type), Ie() === j.eq) {
				Gr();
				return;
			}
		} else (e.type === j.star || e.type === j.braceL) && V(A._type);
	}
	X(j.string) ? sa() : (lc(), pc(), V(A._from), sa()), hc(), H();
}
function dc() {
	return X(j.name);
}
function fc() {
	On();
}
function pc() {
	ce && Wo();
	let e = !0;
	if (!(dc() && (fc(), !Y(j.comma)))) {
		if (X(j.star)) {
			J(), V(A._as), fc();
			return;
		}
		for (U(j.braceL); !Y(j.braceR) && !P.error;) {
			if (e) e = !1;
			else if (Y(j.colon) && W("ES2015 named imports do not destructure. Use another statement for destructuring after the import."), U(j.comma), Y(j.braceR)) break;
			mc();
		}
	}
}
function mc() {
	if (N) {
		si();
		return;
	}
	if (ce) {
		Go();
		return;
	}
	On(), R(A._as) && (P.tokens[P.tokens.length - 1].identifierRole = K.ImportAccess, J(), On());
}
function hc() {
	(X(j._with) || R(A._assert) && !me()) && (J(), ya(!1, !1));
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/traverser/index.js
function gc() {
	return P.pos === 0 && F.charCodeAt(0) === M.numberSign && F.charCodeAt(1) === M.exclamationMark && Ge(2), He(), rs();
}
//#endregion
//#region node_modules/sucrase/dist/esm/parser/index.js
var _c = class {
	constructor(e, t) {
		this.tokens = e, this.scopes = t;
	}
};
function vc(e, t, n, r) {
	if (r && n) throw Error("Cannot combine flow and typescript plugins.");
	L(e, t, n, r);
	let i = gc();
	if (P.error) throw ue(P.error);
	return i;
}
//#endregion
//#region node_modules/sucrase/dist/esm/util/isAsyncOperation.js
function yc(e) {
	let t = e.currentIndex(), n = 0, r = e.currentToken();
	do {
		let i = e.tokens[t];
		if (i.isOptionalChainStart && n++, i.isOptionalChainEnd && n--, n += i.numNullishCoalesceStarts, n -= i.numNullishCoalesceEnds, i.contextualKeyword === A._await && i.identifierRole == null && i.scopeDepth === r.scopeDepth) return !0;
		t += 1;
	} while (n > 0 && t < e.tokens.length);
	return !1;
}
//#endregion
//#region node_modules/sucrase/dist/esm/TokenProcessor.js
var bc = class e {
	__init() {
		this.resultCode = "";
	}
	__init2() {
		this.resultMappings = Array(this.tokens.length);
	}
	__init3() {
		this.tokenIndex = 0;
	}
	constructor(t, n, r, i, a) {
		this.code = t, this.tokens = n, this.isFlowEnabled = r, this.disableESTransforms = i, this.helperManager = a, e.prototype.__init.call(this), e.prototype.__init2.call(this), e.prototype.__init3.call(this);
	}
	snapshot() {
		return {
			resultCode: this.resultCode,
			tokenIndex: this.tokenIndex
		};
	}
	restoreToSnapshot(e) {
		this.resultCode = e.resultCode, this.tokenIndex = e.tokenIndex;
	}
	dangerouslyGetAndRemoveCodeSinceSnapshot(e) {
		let t = this.resultCode.slice(e.resultCode.length);
		return this.resultCode = e.resultCode, t;
	}
	reset() {
		this.resultCode = "", this.resultMappings = Array(this.tokens.length), this.tokenIndex = 0;
	}
	matchesContextualAtIndex(e, t) {
		return this.matches1AtIndex(e, j.name) && this.tokens[e].contextualKeyword === t;
	}
	identifierNameAtIndex(e) {
		return this.identifierNameForToken(this.tokens[e]);
	}
	identifierNameAtRelativeIndex(e) {
		return this.identifierNameForToken(this.tokenAtRelativeIndex(e));
	}
	identifierName() {
		return this.identifierNameForToken(this.currentToken());
	}
	identifierNameForToken(e) {
		return this.code.slice(e.start, e.end);
	}
	rawCodeForToken(e) {
		return this.code.slice(e.start, e.end);
	}
	stringValueAtIndex(e) {
		return this.stringValueForToken(this.tokens[e]);
	}
	stringValue() {
		return this.stringValueForToken(this.currentToken());
	}
	stringValueForToken(e) {
		return this.code.slice(e.start + 1, e.end - 1);
	}
	matches1AtIndex(e, t) {
		return this.tokens[e].type === t;
	}
	matches2AtIndex(e, t, n) {
		return this.tokens[e].type === t && this.tokens[e + 1].type === n;
	}
	matches3AtIndex(e, t, n, r) {
		return this.tokens[e].type === t && this.tokens[e + 1].type === n && this.tokens[e + 2].type === r;
	}
	matches1(e) {
		return this.tokens[this.tokenIndex].type === e;
	}
	matches2(e, t) {
		return this.tokens[this.tokenIndex].type === e && this.tokens[this.tokenIndex + 1].type === t;
	}
	matches3(e, t, n) {
		return this.tokens[this.tokenIndex].type === e && this.tokens[this.tokenIndex + 1].type === t && this.tokens[this.tokenIndex + 2].type === n;
	}
	matches4(e, t, n, r) {
		return this.tokens[this.tokenIndex].type === e && this.tokens[this.tokenIndex + 1].type === t && this.tokens[this.tokenIndex + 2].type === n && this.tokens[this.tokenIndex + 3].type === r;
	}
	matches5(e, t, n, r, i) {
		return this.tokens[this.tokenIndex].type === e && this.tokens[this.tokenIndex + 1].type === t && this.tokens[this.tokenIndex + 2].type === n && this.tokens[this.tokenIndex + 3].type === r && this.tokens[this.tokenIndex + 4].type === i;
	}
	matchesContextual(e) {
		return this.matchesContextualAtIndex(this.tokenIndex, e);
	}
	matchesContextIdAndLabel(e, t) {
		return this.matches1(e) && this.currentToken().contextId === t;
	}
	previousWhitespaceAndComments() {
		let e = this.code.slice(this.tokenIndex > 0 ? this.tokens[this.tokenIndex - 1].end : 0, this.tokenIndex < this.tokens.length ? this.tokens[this.tokenIndex].start : this.code.length);
		return this.isFlowEnabled && (e = e.replace(/@flow/g, "")), e;
	}
	replaceToken(e) {
		this.resultCode += this.previousWhitespaceAndComments(), this.appendTokenPrefix(), this.resultMappings[this.tokenIndex] = this.resultCode.length, this.resultCode += e, this.appendTokenSuffix(), this.tokenIndex++;
	}
	replaceTokenTrimmingLeftWhitespace(e) {
		this.resultCode += this.previousWhitespaceAndComments().replace(/[^\r\n]/g, ""), this.appendTokenPrefix(), this.resultMappings[this.tokenIndex] = this.resultCode.length, this.resultCode += e, this.appendTokenSuffix(), this.tokenIndex++;
	}
	removeInitialToken() {
		this.replaceToken("");
	}
	removeToken() {
		this.replaceTokenTrimmingLeftWhitespace("");
	}
	removeBalancedCode() {
		let e = 0;
		for (; !this.isAtEnd();) {
			if (this.matches1(j.braceL)) e++;
			else if (this.matches1(j.braceR)) {
				if (e === 0) return;
				e--;
			}
			this.removeToken();
		}
	}
	copyExpectedToken(e) {
		if (this.tokens[this.tokenIndex].type !== e) throw Error(`Expected token ${e}`);
		this.copyToken();
	}
	copyToken() {
		this.resultCode += this.previousWhitespaceAndComments(), this.appendTokenPrefix(), this.resultMappings[this.tokenIndex] = this.resultCode.length, this.resultCode += this.code.slice(this.tokens[this.tokenIndex].start, this.tokens[this.tokenIndex].end), this.appendTokenSuffix(), this.tokenIndex++;
	}
	copyTokenWithPrefix(e) {
		this.resultCode += this.previousWhitespaceAndComments(), this.appendTokenPrefix(), this.resultCode += e, this.resultMappings[this.tokenIndex] = this.resultCode.length, this.resultCode += this.code.slice(this.tokens[this.tokenIndex].start, this.tokens[this.tokenIndex].end), this.appendTokenSuffix(), this.tokenIndex++;
	}
	appendTokenPrefix() {
		let e = this.currentToken();
		if ((e.numNullishCoalesceStarts || e.isOptionalChainStart) && (e.isAsyncOperation = yc(this)), !this.disableESTransforms) {
			if (e.numNullishCoalesceStarts) for (let t = 0; t < e.numNullishCoalesceStarts; t++) e.isAsyncOperation ? (this.resultCode += "await ", this.resultCode += this.helperManager.getHelperName("asyncNullishCoalesce")) : this.resultCode += this.helperManager.getHelperName("nullishCoalesce"), this.resultCode += "(";
			e.isOptionalChainStart && (e.isAsyncOperation && (this.resultCode += "await "), this.tokenIndex > 0 && this.tokenAtRelativeIndex(-1).type === j._delete ? e.isAsyncOperation ? this.resultCode += this.helperManager.getHelperName("asyncOptionalChainDelete") : this.resultCode += this.helperManager.getHelperName("optionalChainDelete") : e.isAsyncOperation ? this.resultCode += this.helperManager.getHelperName("asyncOptionalChain") : this.resultCode += this.helperManager.getHelperName("optionalChain"), this.resultCode += "([");
		}
	}
	appendTokenSuffix() {
		let e = this.currentToken();
		if (e.isOptionalChainEnd && !this.disableESTransforms && (this.resultCode += "])"), e.numNullishCoalesceEnds && !this.disableESTransforms) for (let t = 0; t < e.numNullishCoalesceEnds; t++) this.resultCode += "))";
	}
	appendCode(e) {
		this.resultCode += e;
	}
	currentToken() {
		return this.tokens[this.tokenIndex];
	}
	currentTokenCode() {
		let e = this.currentToken();
		return this.code.slice(e.start, e.end);
	}
	tokenAtRelativeIndex(e) {
		return this.tokens[this.tokenIndex + e];
	}
	currentIndex() {
		return this.tokenIndex;
	}
	nextToken() {
		if (this.tokenIndex === this.tokens.length) throw Error("Unexpectedly reached end of input.");
		this.tokenIndex++;
	}
	previousToken() {
		this.tokenIndex--;
	}
	finish() {
		if (this.tokenIndex !== this.tokens.length) throw Error("Tried to finish processing tokens before reaching the end.");
		return this.resultCode += this.previousWhitespaceAndComments(), {
			code: this.resultCode,
			mappings: this.resultMappings
		};
	}
	isAtEnd() {
		return this.tokenIndex === this.tokens.length;
	}
};
//#endregion
//#region node_modules/sucrase/dist/esm/util/getClassInfo.js
function xc(e, t, n, r) {
	let i = t.snapshot(), a = Cc(t), o = [], s = [], c = [], l = null, u = [], d = [], f = t.currentToken().contextId;
	if (f == null) throw Error("Expected non-null class context ID on class open-brace.");
	for (t.nextToken(); !t.matchesContextIdAndLabel(j.braceR, f);) if (t.matchesContextual(A._constructor) && !t.currentToken().isType) ({constructorInitializerStatements: o, constructorInsertPos: l} = wc(t));
	else if (t.matches1(j.semi)) r || d.push({
		start: t.currentIndex(),
		end: t.currentIndex() + 1
	}), t.nextToken();
	else if (t.currentToken().isType) t.nextToken();
	else {
		let i = t.currentIndex(), a = !1, p = !1, m = !1;
		for (; Tc(t.currentToken());) t.matches1(j._static) && (a = !0), t.matches1(j.hash) && (p = !0), (t.matches1(j._declare) || t.matches1(j._abstract)) && (m = !0), t.nextToken();
		if (a && t.matches1(j.braceL)) {
			Sc(t, f);
			continue;
		}
		if (p) {
			Sc(t, f);
			continue;
		}
		if (t.matchesContextual(A._constructor) && !t.currentToken().isType) {
			({constructorInitializerStatements: o, constructorInsertPos: l} = wc(t));
			continue;
		}
		let h = t.currentIndex();
		if (Ec(t), t.matches1(j.lessThan) || t.matches1(j.parenL)) {
			Sc(t, f);
			continue;
		}
		for (; t.currentToken().isType;) t.nextToken();
		if (t.matches1(j.eq)) {
			let r = t.currentIndex(), i = t.currentToken().rhsEndIndex;
			if (i == null) throw Error("Expected rhsEndIndex on class field assignment.");
			for (t.nextToken(); t.currentIndex() < i;) e.processToken();
			let o;
			a ? (o = n.claimFreeName("__initStatic"), c.push(o)) : (o = n.claimFreeName("__init"), s.push(o)), u.push({
				initializerName: o,
				equalsIndex: r,
				start: h,
				end: t.currentIndex()
			});
		} else (!r || m) && d.push({
			start: i,
			end: t.currentIndex()
		});
	}
	return t.restoreToSnapshot(i), r ? {
		headerInfo: a,
		constructorInitializerStatements: o,
		instanceInitializerNames: [],
		staticInitializerNames: [],
		constructorInsertPos: l,
		fields: [],
		rangesToRemove: d
	} : {
		headerInfo: a,
		constructorInitializerStatements: o,
		instanceInitializerNames: s,
		staticInitializerNames: c,
		constructorInsertPos: l,
		fields: u,
		rangesToRemove: d
	};
}
function Sc(e, t) {
	for (e.nextToken(); e.currentToken().contextId !== t;) e.nextToken();
	for (; Tc(e.tokenAtRelativeIndex(-1));) e.previousToken();
}
function Cc(e) {
	let t = e.currentToken(), n = t.contextId;
	if (n == null) throw Error("Expected context ID on class token.");
	let r = t.isExpression;
	if (r == null) throw Error("Expected isExpression on class token.");
	let i = null, a = !1;
	for (e.nextToken(), e.matches1(j.name) && (i = e.identifierName()); !e.matchesContextIdAndLabel(j.braceL, n);) e.matches1(j._extends) && !e.currentToken().isType && (a = !0), e.nextToken();
	return {
		isExpression: r,
		className: i,
		hasSuperclass: a
	};
}
function wc(e) {
	let t = [];
	e.nextToken();
	let n = e.currentToken().contextId;
	if (n == null) throw Error("Expected context ID on open-paren starting constructor params.");
	for (; !e.matchesContextIdAndLabel(j.parenR, n);) if (e.currentToken().contextId === n) {
		if (e.nextToken(), Tc(e.currentToken())) {
			for (e.nextToken(); Tc(e.currentToken());) e.nextToken();
			let n = e.currentToken();
			if (n.type !== j.name) throw Error("Expected identifier after access modifiers in constructor arg.");
			let r = e.identifierNameForToken(n);
			t.push(`this.${r} = ${r}`);
		}
	} else e.nextToken();
	for (e.nextToken(); e.currentToken().isType;) e.nextToken();
	let r = e.currentIndex(), i = !1;
	for (; !e.matchesContextIdAndLabel(j.braceR, n);) {
		if (!i && e.matches2(j._super, j.parenL)) {
			e.nextToken();
			let t = e.currentToken().contextId;
			if (t == null) throw Error("Expected a context ID on the super call");
			for (; !e.matchesContextIdAndLabel(j.parenR, t);) e.nextToken();
			r = e.currentIndex(), i = !0;
		}
		e.nextToken();
	}
	return e.nextToken(), {
		constructorInitializerStatements: t,
		constructorInsertPos: r
	};
}
function Tc(e) {
	return [
		j._async,
		j._get,
		j._set,
		j.plus,
		j.minus,
		j._readonly,
		j._static,
		j._public,
		j._private,
		j._protected,
		j._override,
		j._abstract,
		j.star,
		j._declare,
		j.hash
	].includes(e.type);
}
function Ec(e) {
	if (e.matches1(j.bracketL)) {
		let t = e.currentToken().contextId;
		if (t == null) throw Error("Expected class context ID on computed name open bracket.");
		for (; !e.matchesContextIdAndLabel(j.bracketR, t);) e.nextToken();
		e.nextToken();
	} else e.nextToken();
}
//#endregion
//#region node_modules/sucrase/dist/esm/util/elideImportEquals.js
function Dc(e) {
	if (e.removeInitialToken(), e.removeToken(), e.removeToken(), e.removeToken(), e.matches1(j.parenL)) e.removeToken(), e.removeToken(), e.removeToken();
	else for (; e.matches1(j.dot);) e.removeToken(), e.removeToken();
}
//#endregion
//#region node_modules/sucrase/dist/esm/util/getDeclarationInfo.js
var Oc = {
	typeDeclarations: /* @__PURE__ */ new Set(),
	valueDeclarations: /* @__PURE__ */ new Set()
};
function kc(e) {
	let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
	for (let r = 0; r < e.tokens.length; r++) {
		let i = e.tokens[r];
		i.type === j.name && De(i) && (i.isType ? t.add(e.identifierNameForToken(i)) : n.add(e.identifierNameForToken(i)));
	}
	return {
		typeDeclarations: t,
		valueDeclarations: n
	};
}
//#endregion
//#region node_modules/sucrase/dist/esm/util/isExportFrom.js
function Ac(e) {
	let t = e.currentIndex();
	for (; !e.matches1AtIndex(t, j.braceR);) t++;
	return e.matchesContextualAtIndex(t + 1, A._from) && e.matches1AtIndex(t + 2, j.string);
}
//#endregion
//#region node_modules/sucrase/dist/esm/util/removeMaybeImportAttributes.js
function jc(e) {
	(e.matches2(j._with, j.braceL) || e.matches2(j.name, j.braceL) && e.matchesContextual(A._assert)) && (e.removeToken(), e.removeToken(), e.removeBalancedCode(), e.removeToken());
}
//#endregion
//#region node_modules/sucrase/dist/esm/util/shouldElideDefaultExport.js
function Mc(e, t, n, r) {
	if (!e || t) return !1;
	let i = n.currentToken();
	if (i.rhsEndIndex == null) throw Error("Expected non-null rhsEndIndex on export token.");
	let a = i.rhsEndIndex - n.currentIndex();
	if (a !== 3 && !(a === 4 && n.matches1AtIndex(i.rhsEndIndex - 1, j.semi))) return !1;
	let o = n.tokenAtRelativeIndex(2);
	if (o.type !== j.name) return !1;
	let s = n.identifierNameForToken(o);
	return r.typeDeclarations.has(s) && !r.valueDeclarations.has(s);
}
//#endregion
//#region node_modules/sucrase/dist/esm/transformers/CJSImportTransformer.js
var Nc = class e extends yt {
	__init() {
		this.hadExport = !1;
	}
	__init2() {
		this.hadNamedExport = !1;
	}
	__init3() {
		this.hadDefaultExport = !1;
	}
	constructor(t, n, r, i, a, o, s, c, l, u, d, f) {
		super(), this.rootTransformer = t, this.tokens = n, this.importProcessor = r, this.nameManager = i, this.helperManager = a, this.reactHotLoaderTransformer = o, this.enableLegacyBabel5ModuleInterop = s, this.enableLegacyTypeScriptModuleInterop = c, this.isTypeScriptTransformEnabled = l, this.isFlowTransformEnabled = u, this.preserveDynamicImport = d, this.keepUnusedImports = f, e.prototype.__init.call(this), e.prototype.__init2.call(this), e.prototype.__init3.call(this), this.declarationInfo = l ? kc(n) : Oc;
	}
	getPrefixCode() {
		let e = "";
		return this.hadExport && (e += "Object.defineProperty(exports, \"__esModule\", {value: true});"), e;
	}
	getSuffixCode() {
		return this.enableLegacyBabel5ModuleInterop && this.hadDefaultExport && !this.hadNamedExport ? "\nmodule.exports = exports.default;\n" : "";
	}
	process() {
		return this.tokens.matches3(j._import, j.name, j.eq) ? this.processImportEquals() : this.tokens.matches1(j._import) ? (this.processImport(), !0) : this.tokens.matches2(j._export, j.eq) ? (this.tokens.replaceToken("module.exports"), !0) : this.tokens.matches1(j._export) && !this.tokens.currentToken().isType ? (this.hadExport = !0, this.processExport()) : this.tokens.matches2(j.name, j.postIncDec) && this.processPostIncDec() ? !0 : this.tokens.matches1(j.name) || this.tokens.matches1(j.jsxName) ? this.processIdentifier() : this.tokens.matches1(j.eq) ? this.processAssignment() : this.tokens.matches1(j.assign) ? this.processComplexAssignment() : this.tokens.matches1(j.preIncDec) ? this.processPreIncDec() : !1;
	}
	processImportEquals() {
		let e = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1);
		return this.importProcessor.shouldAutomaticallyElideImportedName(e) ? Dc(this.tokens) : this.tokens.replaceToken("const"), !0;
	}
	processImport() {
		if (this.tokens.matches2(j._import, j.parenL)) {
			if (this.preserveDynamicImport) {
				this.tokens.copyToken();
				return;
			}
			let e = this.enableLegacyTypeScriptModuleInterop ? "" : `${this.helperManager.getHelperName("interopRequireWildcard")}(`;
			this.tokens.replaceToken(`Promise.resolve().then(() => ${e}require`);
			let t = this.tokens.currentToken().contextId;
			if (t == null) throw Error("Expected context ID on dynamic import invocation.");
			for (this.tokens.copyToken(); !this.tokens.matchesContextIdAndLabel(j.parenR, t);) this.rootTransformer.processToken();
			this.tokens.replaceToken(e ? ")))" : "))");
			return;
		}
		if (this.removeImportAndDetectIfShouldElide()) this.tokens.removeToken();
		else {
			let e = this.tokens.stringValue();
			this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(e)), this.tokens.appendCode(this.importProcessor.claimImportCode(e));
		}
		jc(this.tokens), this.tokens.matches1(j.semi) && this.tokens.removeToken();
	}
	removeImportAndDetectIfShouldElide() {
		if (this.tokens.removeInitialToken(), this.tokens.matchesContextual(A._type) && !this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, j.comma) && !this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, A._from)) return this.removeRemainingImport(), !0;
		if (this.tokens.matches1(j.name) || this.tokens.matches1(j.star)) return this.removeRemainingImport(), !1;
		if (this.tokens.matches1(j.string)) return !1;
		let e = !1, t = !1;
		for (; !this.tokens.matches1(j.string);) (!e && this.tokens.matches1(j.braceL) || this.tokens.matches1(j.comma)) && (this.tokens.removeToken(), this.tokens.matches1(j.braceR) || (t = !0), (this.tokens.matches2(j.name, j.comma) || this.tokens.matches2(j.name, j.braceR) || this.tokens.matches4(j.name, j.name, j.name, j.comma) || this.tokens.matches4(j.name, j.name, j.name, j.braceR)) && (e = !0)), this.tokens.removeToken();
		return this.keepUnusedImports ? !1 : this.isTypeScriptTransformEnabled ? !e : this.isFlowTransformEnabled ? t && !e : !1;
	}
	removeRemainingImport() {
		for (; !this.tokens.matches1(j.string);) this.tokens.removeToken();
	}
	processIdentifier() {
		let e = this.tokens.currentToken();
		if (e.shadowsGlobal) return !1;
		if (e.identifierRole === K.ObjectShorthand) return this.processObjectShorthand();
		if (e.identifierRole !== K.Access) return !1;
		let t = this.importProcessor.getIdentifierReplacement(this.tokens.identifierNameForToken(e));
		if (!t) return !1;
		let n = this.tokens.currentIndex() + 1;
		for (; n < this.tokens.tokens.length && this.tokens.tokens[n].type === j.parenR;) n++;
		return this.tokens.tokens[n].type === j.parenL ? this.tokens.tokenAtRelativeIndex(1).type === j.parenL && this.tokens.tokenAtRelativeIndex(-1).type !== j._new ? (this.tokens.replaceToken(`${t}.call(void 0, `), this.tokens.removeToken(), this.rootTransformer.processBalancedCode(), this.tokens.copyExpectedToken(j.parenR)) : this.tokens.replaceToken(`(0, ${t})`) : this.tokens.replaceToken(t), !0;
	}
	processObjectShorthand() {
		let e = this.tokens.identifierName(), t = this.importProcessor.getIdentifierReplacement(e);
		return t ? (this.tokens.replaceToken(`${e}: ${t}`), !0) : !1;
	}
	processExport() {
		if (this.tokens.matches2(j._export, j._enum) || this.tokens.matches3(j._export, j._const, j._enum)) return this.hadNamedExport = !0, !1;
		if (this.tokens.matches2(j._export, j._default)) return this.tokens.matches3(j._export, j._default, j._enum) ? (this.hadDefaultExport = !0, !1) : (this.processExportDefault(), !0);
		if (this.tokens.matches2(j._export, j.braceL)) return this.processExportBindings(), !0;
		if (this.tokens.matches2(j._export, j.name) && this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, A._type)) {
			if (this.tokens.removeInitialToken(), this.tokens.removeToken(), this.tokens.matches1(j.braceL)) {
				for (; !this.tokens.matches1(j.braceR);) this.tokens.removeToken();
				this.tokens.removeToken();
			} else this.tokens.removeToken(), this.tokens.matches1(j._as) && (this.tokens.removeToken(), this.tokens.removeToken());
			return this.tokens.matchesContextual(A._from) && this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, j.string) && (this.tokens.removeToken(), this.tokens.removeToken(), jc(this.tokens)), !0;
		}
		if (this.hadNamedExport = !0, this.tokens.matches2(j._export, j._var) || this.tokens.matches2(j._export, j._let) || this.tokens.matches2(j._export, j._const)) return this.processExportVar(), !0;
		if (this.tokens.matches2(j._export, j._function) || this.tokens.matches3(j._export, j.name, j._function)) return this.processExportFunction(), !0;
		if (this.tokens.matches2(j._export, j._class) || this.tokens.matches3(j._export, j._abstract, j._class) || this.tokens.matches2(j._export, j.at)) return this.processExportClass(), !0;
		if (this.tokens.matches2(j._export, j.star)) return this.processExportStar(), !0;
		throw Error("Unrecognized export syntax.");
	}
	processAssignment() {
		let e = this.tokens.currentIndex(), t = this.tokens.tokens[e - 1];
		if (t.isType || t.type !== j.name || t.shadowsGlobal || e >= 2 && this.tokens.matches1AtIndex(e - 2, j.dot) || e >= 2 && [
			j._var,
			j._let,
			j._const
		].includes(this.tokens.tokens[e - 2].type)) return !1;
		let n = this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(t));
		return n ? (this.tokens.copyToken(), this.tokens.appendCode(` ${n} =`), !0) : !1;
	}
	processComplexAssignment() {
		let e = this.tokens.currentIndex(), t = this.tokens.tokens[e - 1];
		if (t.type !== j.name || t.shadowsGlobal || e >= 2 && this.tokens.matches1AtIndex(e - 2, j.dot)) return !1;
		let n = this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(t));
		return n ? (this.tokens.appendCode(` = ${n}`), this.tokens.copyToken(), !0) : !1;
	}
	processPreIncDec() {
		let e = this.tokens.currentIndex(), t = this.tokens.tokens[e + 1];
		if (t.type !== j.name || t.shadowsGlobal || e + 2 < this.tokens.tokens.length && (this.tokens.matches1AtIndex(e + 2, j.dot) || this.tokens.matches1AtIndex(e + 2, j.bracketL) || this.tokens.matches1AtIndex(e + 2, j.parenL))) return !1;
		let n = this.tokens.identifierNameForToken(t), r = this.importProcessor.resolveExportBinding(n);
		return r ? (this.tokens.appendCode(`${r} = `), this.tokens.copyToken(), !0) : !1;
	}
	processPostIncDec() {
		let e = this.tokens.currentIndex(), t = this.tokens.tokens[e], n = this.tokens.tokens[e + 1];
		if (t.type !== j.name || t.shadowsGlobal || e >= 1 && this.tokens.matches1AtIndex(e - 1, j.dot)) return !1;
		let r = this.tokens.identifierNameForToken(t), i = this.importProcessor.resolveExportBinding(r);
		if (!i) return !1;
		let a = this.tokens.rawCodeForToken(n), o = this.importProcessor.getIdentifierReplacement(r) || r;
		if (a === "++") this.tokens.replaceToken(`(${o} = ${i} = ${o} + 1, ${o} - 1)`);
		else if (a === "--") this.tokens.replaceToken(`(${o} = ${i} = ${o} - 1, ${o} + 1)`);
		else throw Error(`Unexpected operator: ${a}`);
		return this.tokens.removeToken(), !0;
	}
	processExportDefault() {
		let e = !0;
		if (this.tokens.matches4(j._export, j._default, j._function, j.name) || this.tokens.matches5(j._export, j._default, j.name, j._function, j.name) && this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, A._async)) {
			this.tokens.removeInitialToken(), this.tokens.removeToken();
			let e = this.processNamedFunction();
			this.tokens.appendCode(` exports.default = ${e};`);
		} else if (this.tokens.matches4(j._export, j._default, j._class, j.name) || this.tokens.matches5(j._export, j._default, j._abstract, j._class, j.name) || this.tokens.matches3(j._export, j._default, j.at)) {
			this.tokens.removeInitialToken(), this.tokens.removeToken(), this.copyDecorators(), this.tokens.matches1(j._abstract) && this.tokens.removeToken();
			let e = this.rootTransformer.processNamedClass();
			this.tokens.appendCode(` exports.default = ${e};`);
		} else if (Mc(this.isTypeScriptTransformEnabled, this.keepUnusedImports, this.tokens, this.declarationInfo)) e = !1, this.tokens.removeInitialToken(), this.tokens.removeToken(), this.tokens.removeToken();
		else if (this.reactHotLoaderTransformer) {
			let e = this.nameManager.claimFreeName("_default");
			this.tokens.replaceToken(`let ${e}; exports.`), this.tokens.copyToken(), this.tokens.appendCode(` = ${e} =`), this.reactHotLoaderTransformer.setExtractedDefaultExportName(e);
		} else this.tokens.replaceToken("exports."), this.tokens.copyToken(), this.tokens.appendCode(" =");
		e && (this.hadDefaultExport = !0);
	}
	copyDecorators() {
		for (; this.tokens.matches1(j.at);) if (this.tokens.copyToken(), this.tokens.matches1(j.parenL)) this.tokens.copyExpectedToken(j.parenL), this.rootTransformer.processBalancedCode(), this.tokens.copyExpectedToken(j.parenR);
		else {
			for (this.tokens.copyExpectedToken(j.name); this.tokens.matches1(j.dot);) this.tokens.copyExpectedToken(j.dot), this.tokens.copyExpectedToken(j.name);
			this.tokens.matches1(j.parenL) && (this.tokens.copyExpectedToken(j.parenL), this.rootTransformer.processBalancedCode(), this.tokens.copyExpectedToken(j.parenR));
		}
	}
	processExportVar() {
		this.isSimpleExportVar() ? this.processSimpleExportVar() : this.processComplexExportVar();
	}
	isSimpleExportVar() {
		let e = this.tokens.currentIndex();
		if (e++, e++, !this.tokens.matches1AtIndex(e, j.name)) return !1;
		for (e++; e < this.tokens.tokens.length && this.tokens.tokens[e].isType;) e++;
		return !!this.tokens.matches1AtIndex(e, j.eq);
	}
	processSimpleExportVar() {
		this.tokens.removeInitialToken(), this.tokens.copyToken();
		let e = this.tokens.identifierName();
		for (; !this.tokens.matches1(j.eq);) this.rootTransformer.processToken();
		let t = this.tokens.currentToken().rhsEndIndex;
		if (t == null) throw Error("Expected = token with an end index.");
		for (; this.tokens.currentIndex() < t;) this.rootTransformer.processToken();
		this.tokens.appendCode(`; exports.${e} = ${e}`);
	}
	processComplexExportVar() {
		this.tokens.removeInitialToken(), this.tokens.removeToken();
		let e = this.tokens.matches1(j.braceL);
		e && this.tokens.appendCode("(");
		let t = 0;
		for (;;) if (this.tokens.matches1(j.braceL) || this.tokens.matches1(j.dollarBraceL) || this.tokens.matches1(j.bracketL)) t++, this.tokens.copyToken();
		else if (this.tokens.matches1(j.braceR) || this.tokens.matches1(j.bracketR)) t--, this.tokens.copyToken();
		else if (t === 0 && !this.tokens.matches1(j.name) && !this.tokens.currentToken().isType) break;
		else if (this.tokens.matches1(j.eq)) {
			let e = this.tokens.currentToken().rhsEndIndex;
			if (e == null) throw Error("Expected = token with an end index.");
			for (; this.tokens.currentIndex() < e;) this.rootTransformer.processToken();
		} else {
			let e = this.tokens.currentToken();
			if (Te(e)) {
				let t = this.tokens.identifierName(), n = this.importProcessor.getIdentifierReplacement(t);
				if (n === null) throw Error(`Expected a replacement for ${t} in \`export var\` syntax.`);
				Ae(e) && (n = `${t}: ${n}`), this.tokens.replaceToken(n);
			} else this.rootTransformer.processToken();
		}
		if (e) {
			let e = this.tokens.currentToken().rhsEndIndex;
			if (e == null) throw Error("Expected = token with an end index.");
			for (; this.tokens.currentIndex() < e;) this.rootTransformer.processToken();
			this.tokens.appendCode(")");
		}
	}
	processExportFunction() {
		this.tokens.replaceToken("");
		let e = this.processNamedFunction();
		this.tokens.appendCode(` exports.${e} = ${e};`);
	}
	processNamedFunction() {
		if (this.tokens.matches1(j._function)) this.tokens.copyToken();
		else if (this.tokens.matches2(j.name, j._function)) {
			if (!this.tokens.matchesContextual(A._async)) throw Error("Expected async keyword in function export.");
			this.tokens.copyToken(), this.tokens.copyToken();
		}
		if (this.tokens.matches1(j.star) && this.tokens.copyToken(), !this.tokens.matches1(j.name)) throw Error("Expected identifier for exported function name.");
		let e = this.tokens.identifierName();
		if (this.tokens.copyToken(), this.tokens.currentToken().isType) for (this.tokens.removeInitialToken(); this.tokens.currentToken().isType;) this.tokens.removeToken();
		return this.tokens.copyExpectedToken(j.parenL), this.rootTransformer.processBalancedCode(), this.tokens.copyExpectedToken(j.parenR), this.rootTransformer.processPossibleTypeRange(), this.tokens.copyExpectedToken(j.braceL), this.rootTransformer.processBalancedCode(), this.tokens.copyExpectedToken(j.braceR), e;
	}
	processExportClass() {
		this.tokens.removeInitialToken(), this.copyDecorators(), this.tokens.matches1(j._abstract) && this.tokens.removeToken();
		let e = this.rootTransformer.processNamedClass();
		this.tokens.appendCode(` exports.${e} = ${e};`);
	}
	processExportBindings() {
		this.tokens.removeInitialToken(), this.tokens.removeToken();
		let e = Ac(this.tokens), t = [];
		for (;;) {
			if (this.tokens.matches1(j.braceR)) {
				this.tokens.removeToken();
				break;
			}
			let n = mt(this.tokens);
			for (; this.tokens.currentIndex() < n.endIndex;) this.tokens.removeToken();
			if (!(n.isType || !e && this.shouldElideExportedIdentifier(n.leftName))) {
				let e = n.rightName;
				e === "default" ? this.hadDefaultExport = !0 : this.hadNamedExport = !0;
				let r = n.leftName, i = this.importProcessor.getIdentifierReplacement(r);
				t.push(`exports.${e} = ${i || r};`);
			}
			if (this.tokens.matches1(j.braceR)) {
				this.tokens.removeToken();
				break;
			}
			if (this.tokens.matches2(j.comma, j.braceR)) {
				this.tokens.removeToken(), this.tokens.removeToken();
				break;
			} else if (this.tokens.matches1(j.comma)) this.tokens.removeToken();
			else throw Error(`Unexpected token: ${JSON.stringify(this.tokens.currentToken())}`);
		}
		if (this.tokens.matchesContextual(A._from)) {
			this.tokens.removeToken();
			let e = this.tokens.stringValue();
			this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(e)), jc(this.tokens);
		} else this.tokens.appendCode(t.join(" "));
		this.tokens.matches1(j.semi) && this.tokens.removeToken();
	}
	processExportStar() {
		for (this.tokens.removeInitialToken(); !this.tokens.matches1(j.string);) this.tokens.removeToken();
		let e = this.tokens.stringValue();
		this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(e)), jc(this.tokens), this.tokens.matches1(j.semi) && this.tokens.removeToken();
	}
	shouldElideExportedIdentifier(e) {
		return this.isTypeScriptTransformEnabled && !this.keepUnusedImports && !this.declarationInfo.valueDeclarations.has(e);
	}
}, Pc = class extends yt {
	constructor(e, t, n, r, i, a, o, s) {
		super(), this.tokens = e, this.nameManager = t, this.helperManager = n, this.reactHotLoaderTransformer = r, this.isTypeScriptTransformEnabled = i, this.isFlowTransformEnabled = a, this.keepUnusedImports = o, this.nonTypeIdentifiers = i && !o ? Ot(e, s) : /* @__PURE__ */ new Set(), this.declarationInfo = i && !o ? kc(e) : Oc, this.injectCreateRequireForImportRequire = !!s.injectCreateRequireForImportRequire;
	}
	process() {
		if (this.tokens.matches3(j._import, j.name, j.eq)) return this.processImportEquals();
		if (this.tokens.matches4(j._import, j.name, j.name, j.eq) && this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, A._type)) {
			this.tokens.removeInitialToken();
			for (let e = 0; e < 7; e++) this.tokens.removeToken();
			return !0;
		}
		if (this.tokens.matches2(j._export, j.eq)) return this.tokens.replaceToken("module.exports"), !0;
		if (this.tokens.matches5(j._export, j._import, j.name, j.name, j.eq) && this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, A._type)) {
			this.tokens.removeInitialToken();
			for (let e = 0; e < 8; e++) this.tokens.removeToken();
			return !0;
		}
		if (this.tokens.matches1(j._import)) return this.processImport();
		if (this.tokens.matches2(j._export, j._default)) return this.processExportDefault();
		if (this.tokens.matches2(j._export, j.braceL)) return this.processNamedExports();
		if (this.tokens.matches2(j._export, j.name) && this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, A._type)) {
			if (this.tokens.removeInitialToken(), this.tokens.removeToken(), this.tokens.matches1(j.braceL)) {
				for (; !this.tokens.matches1(j.braceR);) this.tokens.removeToken();
				this.tokens.removeToken();
			} else this.tokens.removeToken(), this.tokens.matches1(j._as) && (this.tokens.removeToken(), this.tokens.removeToken());
			return this.tokens.matchesContextual(A._from) && this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, j.string) && (this.tokens.removeToken(), this.tokens.removeToken(), jc(this.tokens)), !0;
		}
		return !1;
	}
	processImportEquals() {
		let e = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1);
		return this.shouldAutomaticallyElideImportedName(e) ? Dc(this.tokens) : this.injectCreateRequireForImportRequire ? (this.tokens.replaceToken("const"), this.tokens.copyToken(), this.tokens.copyToken(), this.tokens.replaceToken(this.helperManager.getHelperName("require"))) : this.tokens.replaceToken("const"), !0;
	}
	processImport() {
		if (this.tokens.matches2(j._import, j.parenL)) return !1;
		let e = this.tokens.snapshot();
		if (this.removeImportTypeBindings()) {
			for (this.tokens.restoreToSnapshot(e); !this.tokens.matches1(j.string);) this.tokens.removeToken();
			this.tokens.removeToken(), jc(this.tokens), this.tokens.matches1(j.semi) && this.tokens.removeToken();
		}
		return !0;
	}
	removeImportTypeBindings() {
		if (this.tokens.copyExpectedToken(j._import), this.tokens.matchesContextual(A._type) && !this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, j.comma) && !this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, A._from)) return !0;
		if (this.tokens.matches1(j.string)) return this.tokens.copyToken(), !1;
		this.tokens.matchesContextual(A._module) && this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, A._from) && this.tokens.copyToken();
		let e = !1, t = !1, n = !1;
		if (this.tokens.matches1(j.name) && (this.shouldAutomaticallyElideImportedName(this.tokens.identifierName()) ? (this.tokens.removeToken(), this.tokens.matches1(j.comma) && this.tokens.removeToken()) : (e = !0, this.tokens.copyToken(), this.tokens.matches1(j.comma) && (n = !0, this.tokens.removeToken()))), this.tokens.matches1(j.star)) this.shouldAutomaticallyElideImportedName(this.tokens.identifierNameAtRelativeIndex(2)) ? (this.tokens.removeToken(), this.tokens.removeToken(), this.tokens.removeToken()) : (n && this.tokens.appendCode(","), e = !0, this.tokens.copyExpectedToken(j.star), this.tokens.copyExpectedToken(j.name), this.tokens.copyExpectedToken(j.name));
		else if (this.tokens.matches1(j.braceL)) {
			for (n && this.tokens.appendCode(","), this.tokens.copyToken(); !this.tokens.matches1(j.braceR);) {
				t = !0;
				let n = mt(this.tokens);
				if (n.isType || this.shouldAutomaticallyElideImportedName(n.rightName)) {
					for (; this.tokens.currentIndex() < n.endIndex;) this.tokens.removeToken();
					this.tokens.matches1(j.comma) && this.tokens.removeToken();
				} else {
					for (e = !0; this.tokens.currentIndex() < n.endIndex;) this.tokens.copyToken();
					this.tokens.matches1(j.comma) && this.tokens.copyToken();
				}
			}
			this.tokens.copyExpectedToken(j.braceR);
		}
		return this.keepUnusedImports ? !1 : this.isTypeScriptTransformEnabled ? !e : this.isFlowTransformEnabled ? t && !e : !1;
	}
	shouldAutomaticallyElideImportedName(e) {
		return this.isTypeScriptTransformEnabled && !this.keepUnusedImports && !this.nonTypeIdentifiers.has(e);
	}
	processExportDefault() {
		if (Mc(this.isTypeScriptTransformEnabled, this.keepUnusedImports, this.tokens, this.declarationInfo)) return this.tokens.removeInitialToken(), this.tokens.removeToken(), this.tokens.removeToken(), !0;
		if (!(this.tokens.matches4(j._export, j._default, j._function, j.name) || this.tokens.matches5(j._export, j._default, j.name, j._function, j.name) && this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, A._async) || this.tokens.matches4(j._export, j._default, j._class, j.name) || this.tokens.matches5(j._export, j._default, j._abstract, j._class, j.name)) && this.reactHotLoaderTransformer) {
			let e = this.nameManager.claimFreeName("_default");
			return this.tokens.replaceToken(`let ${e}; export`), this.tokens.copyToken(), this.tokens.appendCode(` ${e} =`), this.reactHotLoaderTransformer.setExtractedDefaultExportName(e), !0;
		}
		return !1;
	}
	processNamedExports() {
		if (!this.isTypeScriptTransformEnabled) return !1;
		this.tokens.copyExpectedToken(j._export), this.tokens.copyExpectedToken(j.braceL);
		let e = Ac(this.tokens), t = !1;
		for (; !this.tokens.matches1(j.braceR);) {
			let n = mt(this.tokens);
			if (n.isType || !e && this.shouldElideExportedName(n.leftName)) {
				for (; this.tokens.currentIndex() < n.endIndex;) this.tokens.removeToken();
				this.tokens.matches1(j.comma) && this.tokens.removeToken();
			} else {
				for (t = !0; this.tokens.currentIndex() < n.endIndex;) this.tokens.copyToken();
				this.tokens.matches1(j.comma) && this.tokens.copyToken();
			}
		}
		return this.tokens.copyExpectedToken(j.braceR), !this.keepUnusedImports && e && !t && (this.tokens.removeToken(), this.tokens.removeToken(), jc(this.tokens)), !0;
	}
	shouldElideExportedName(e) {
		return this.isTypeScriptTransformEnabled && !this.keepUnusedImports && this.declarationInfo.typeDeclarations.has(e) && !this.declarationInfo.valueDeclarations.has(e);
	}
}, Fc = class extends yt {
	constructor(e, t, n) {
		super(), this.rootTransformer = e, this.tokens = t, this.isImportsTransformEnabled = n;
	}
	process() {
		return this.rootTransformer.processPossibleArrowParamEnd() || this.rootTransformer.processPossibleAsyncArrowWithTypeParams() || this.rootTransformer.processPossibleTypeRange() ? !0 : this.tokens.matches1(j._enum) ? (this.processEnum(), !0) : this.tokens.matches2(j._export, j._enum) ? (this.processNamedExportEnum(), !0) : this.tokens.matches3(j._export, j._default, j._enum) ? (this.processDefaultExportEnum(), !0) : !1;
	}
	processNamedExportEnum() {
		if (this.isImportsTransformEnabled) {
			this.tokens.removeInitialToken();
			let e = this.tokens.identifierNameAtRelativeIndex(1);
			this.processEnum(), this.tokens.appendCode(` exports.${e} = ${e};`);
		} else this.tokens.copyToken(), this.processEnum();
	}
	processDefaultExportEnum() {
		this.tokens.removeInitialToken(), this.tokens.removeToken();
		let e = this.tokens.identifierNameAtRelativeIndex(1);
		this.processEnum(), this.isImportsTransformEnabled ? this.tokens.appendCode(` exports.default = ${e};`) : this.tokens.appendCode(` export default ${e};`);
	}
	processEnum() {
		this.tokens.replaceToken("const"), this.tokens.copyExpectedToken(j.name);
		let e = !1;
		this.tokens.matchesContextual(A._of) && (this.tokens.removeToken(), e = this.tokens.matchesContextual(A._symbol), this.tokens.removeToken());
		let t = this.tokens.matches3(j.braceL, j.name, j.eq);
		this.tokens.appendCode(" = require(\"flow-enums-runtime\")");
		let n = !e && !t;
		for (this.tokens.replaceTokenTrimmingLeftWhitespace(n ? ".Mirrored([" : "({"); !this.tokens.matches1(j.braceR);) {
			if (this.tokens.matches1(j.ellipsis)) {
				this.tokens.removeToken();
				break;
			}
			this.processEnumElement(e, t), this.tokens.matches1(j.comma) && this.tokens.copyToken();
		}
		this.tokens.replaceToken(n ? "]);" : "});");
	}
	processEnumElement(e, t) {
		if (e) {
			let e = this.tokens.identifierName();
			this.tokens.copyToken(), this.tokens.appendCode(`: Symbol("${e}")`);
		} else t ? (this.tokens.copyToken(), this.tokens.replaceTokenTrimmingLeftWhitespace(":"), this.tokens.copyToken()) : this.tokens.replaceToken(`"${this.tokens.identifierName()}"`);
	}
};
//#endregion
//#region node_modules/sucrase/dist/esm/transformers/JestHoistTransformer.js
function Ic(e) {
	let t, n = e[0], r = 1;
	for (; r < e.length;) {
		let i = e[r], a = e[r + 1];
		if (r += 2, (i === "optionalAccess" || i === "optionalCall") && n == null) return;
		i === "access" || i === "optionalAccess" ? (t = n, n = a(n)) : (i === "call" || i === "optionalCall") && (n = a((...e) => n.call(t, ...e)), t = void 0);
	}
	return n;
}
var Lc = "jest", Rc = [
	"mock",
	"unmock",
	"enableAutomock",
	"disableAutomock"
], zc = class e extends yt {
	__init() {
		this.hoistedFunctionNames = [];
	}
	constructor(t, n, r, i) {
		super(), this.rootTransformer = t, this.tokens = n, this.nameManager = r, this.importProcessor = i, e.prototype.__init.call(this);
	}
	process() {
		return this.tokens.currentToken().scopeDepth === 0 && this.tokens.matches4(j.name, j.dot, j.name, j.parenL) && this.tokens.identifierName() === Lc ? !Ic([
			this,
			"access",
			(e) => e.importProcessor,
			"optionalAccess",
			(e) => e.getGlobalNames,
			"call",
			(e) => e(),
			"optionalAccess",
			(e) => e.has,
			"call",
			(e) => e(Lc)
		]) && this.extractHoistedCalls() : !1;
	}
	getHoistedCode() {
		return this.hoistedFunctionNames.length > 0 ? this.hoistedFunctionNames.map((e) => `${e}();`).join("") : "";
	}
	extractHoistedCalls() {
		this.tokens.removeToken();
		let e = !1;
		for (; this.tokens.matches3(j.dot, j.name, j.parenL);) {
			let t = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1);
			if (Rc.includes(t)) {
				let t = this.nameManager.claimFreeName("__jestHoist");
				this.hoistedFunctionNames.push(t), this.tokens.replaceToken(`function ${t}(){${Lc}.`), this.tokens.copyToken(), this.tokens.copyToken(), this.rootTransformer.processBalancedCode(), this.tokens.copyExpectedToken(j.parenR), this.tokens.appendCode(";}"), e = !1;
			} else e ? this.tokens.copyToken() : this.tokens.replaceToken(`${Lc}.`), this.tokens.copyToken(), this.tokens.copyToken(), this.rootTransformer.processBalancedCode(), this.tokens.copyExpectedToken(j.parenR), e = !0;
		}
		return !0;
	}
}, Bc = class extends yt {
	constructor(e) {
		super(), this.tokens = e;
	}
	process() {
		if (this.tokens.matches1(j.num)) {
			let e = this.tokens.currentTokenCode();
			if (e.includes("_")) return this.tokens.replaceToken(e.replace(/_/g, "")), !0;
		}
		return !1;
	}
}, Vc = class extends yt {
	constructor(e, t) {
		super(), this.tokens = e, this.nameManager = t;
	}
	process() {
		return this.tokens.matches2(j._catch, j.braceL) ? (this.tokens.copyToken(), this.tokens.appendCode(` (${this.nameManager.claimFreeName("e")})`), !0) : !1;
	}
}, Hc = class extends yt {
	constructor(e, t) {
		super(), this.tokens = e, this.nameManager = t;
	}
	process() {
		if (this.tokens.matches1(j.nullishCoalescing)) {
			let e = this.tokens.currentToken();
			return this.tokens.tokens[e.nullishStartIndex].isAsyncOperation ? this.tokens.replaceTokenTrimmingLeftWhitespace(", async () => (") : this.tokens.replaceTokenTrimmingLeftWhitespace(", () => ("), !0;
		}
		if (this.tokens.matches1(j._delete) && this.tokens.tokenAtRelativeIndex(1).isOptionalChainStart) return this.tokens.removeInitialToken(), !0;
		let e = this.tokens.currentToken().subscriptStartIndex;
		if (e != null && this.tokens.tokens[e].isOptionalChainStart && this.tokens.tokenAtRelativeIndex(-1).type !== j._super) {
			let t = this.nameManager.claimFreeName("_"), n;
			if (n = e > 0 && this.tokens.matches1AtIndex(e - 1, j._delete) && this.isLastSubscriptInChain() ? `${t} => delete ${t}` : `${t} => ${t}`, this.tokens.tokens[e].isAsyncOperation && (n = `async ${n}`), this.tokens.matches2(j.questionDot, j.parenL) || this.tokens.matches2(j.questionDot, j.lessThan)) this.justSkippedSuper() && this.tokens.appendCode(".bind(this)"), this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalCall', ${n}`);
			else if (this.tokens.matches2(j.questionDot, j.bracketL)) this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${n}`);
			else if (this.tokens.matches1(j.questionDot)) this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${n}.`);
			else if (this.tokens.matches1(j.dot)) this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${n}.`);
			else if (this.tokens.matches1(j.bracketL)) this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${n}[`);
			else if (this.tokens.matches1(j.parenL)) this.justSkippedSuper() && this.tokens.appendCode(".bind(this)"), this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'call', ${n}(`);
			else throw Error("Unexpected subscript operator in optional chain.");
			return !0;
		}
		return !1;
	}
	isLastSubscriptInChain() {
		let e = 0;
		for (let t = this.tokens.currentIndex() + 1;; t++) {
			if (t >= this.tokens.tokens.length) throw Error("Reached the end of the code while finding the end of the access chain.");
			if (this.tokens.tokens[t].isOptionalChainStart ? e++ : this.tokens.tokens[t].isOptionalChainEnd && e--, e < 0) return !0;
			if (e === 0 && this.tokens.tokens[t].subscriptStartIndex != null) return !1;
		}
	}
	justSkippedSuper() {
		let e = 0, t = this.tokens.currentIndex() - 1;
		for (;;) {
			if (t < 0) throw Error("Reached the start of the code while finding the start of the access chain.");
			if (this.tokens.tokens[t].isOptionalChainStart ? e-- : this.tokens.tokens[t].isOptionalChainEnd && e++, e < 0) return !1;
			if (e === 0 && this.tokens.tokens[t].subscriptStartIndex != null) return this.tokens.tokens[t - 1].type === j._super;
			t--;
		}
	}
}, Uc = class extends yt {
	constructor(e, t, n, r) {
		super(), this.rootTransformer = e, this.tokens = t, this.importProcessor = n, this.options = r;
	}
	process() {
		let e = this.tokens.currentIndex();
		if (this.tokens.identifierName() === "createReactClass") {
			let t = this.importProcessor && this.importProcessor.getIdentifierReplacement("createReactClass");
			return t ? this.tokens.replaceToken(`(0, ${t})`) : this.tokens.copyToken(), this.tryProcessCreateClassCall(e), !0;
		}
		if (this.tokens.matches3(j.name, j.dot, j.name) && this.tokens.identifierName() === "React" && this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 2) === "createClass") {
			let t = this.importProcessor && this.importProcessor.getIdentifierReplacement("React") || "React";
			return t ? (this.tokens.replaceToken(t), this.tokens.copyToken(), this.tokens.copyToken()) : (this.tokens.copyToken(), this.tokens.copyToken(), this.tokens.copyToken()), this.tryProcessCreateClassCall(e), !0;
		}
		return !1;
	}
	tryProcessCreateClassCall(e) {
		let t = this.findDisplayName(e);
		t && this.classNeedsDisplayName() && (this.tokens.copyExpectedToken(j.parenL), this.tokens.copyExpectedToken(j.braceL), this.tokens.appendCode(`displayName: '${t}',`), this.rootTransformer.processBalancedCode(), this.tokens.copyExpectedToken(j.braceR), this.tokens.copyExpectedToken(j.parenR));
	}
	findDisplayName(e) {
		return e < 2 ? null : this.tokens.matches2AtIndex(e - 2, j.name, j.eq) || e >= 2 && this.tokens.tokens[e - 2].identifierRole === K.ObjectKey ? this.tokens.identifierNameAtIndex(e - 2) : this.tokens.matches2AtIndex(e - 2, j._export, j._default) ? this.getDisplayNameFromFilename() : null;
	}
	getDisplayNameFromFilename() {
		let e = (this.options.filePath || "unknown").split("/"), t = e[e.length - 1], n = t.lastIndexOf("."), r = n === -1 ? t : t.slice(0, n);
		return r === "index" && e[e.length - 2] ? e[e.length - 2] : r;
	}
	classNeedsDisplayName() {
		let e = this.tokens.currentIndex();
		if (!this.tokens.matches2(j.parenL, j.braceL)) return !1;
		let t = e + 1, n = this.tokens.tokens[t].contextId;
		if (n == null) throw Error("Expected non-null context ID on object open-brace.");
		for (; e < this.tokens.tokens.length; e++) {
			let t = this.tokens.tokens[e];
			if (t.type === j.braceR && t.contextId === n) {
				e++;
				break;
			}
			if (this.tokens.identifierNameAtIndex(e) === "displayName" && this.tokens.tokens[e].identifierRole === K.ObjectKey && t.contextId === n) return !1;
		}
		if (e === this.tokens.tokens.length) throw Error("Unexpected end of input when processing React class.");
		return this.tokens.matches1AtIndex(e, j.parenR) || this.tokens.matches2AtIndex(e, j.comma, j.parenR);
	}
}, Wc = class e extends yt {
	__init() {
		this.extractedDefaultExportName = null;
	}
	constructor(t, n) {
		super(), this.tokens = t, this.filePath = n, e.prototype.__init.call(this);
	}
	setExtractedDefaultExportName(e) {
		this.extractedDefaultExportName = e;
	}
	getPrefixCode() {
		return "\n      (function () {\n        var enterModule = require('react-hot-loader').enterModule;\n        enterModule && enterModule(module);\n      })();".replace(/\s+/g, " ").trim();
	}
	getSuffixCode() {
		let e = /* @__PURE__ */ new Set();
		for (let t of this.tokens.tokens) !t.isType && De(t) && t.identifierRole !== K.ImportDeclaration && e.add(this.tokens.identifierNameForToken(t));
		let t = Array.from(e).map((e) => ({
			variableName: e,
			uniqueLocalName: e
		}));
		return this.extractedDefaultExportName && t.push({
			variableName: this.extractedDefaultExportName,
			uniqueLocalName: "default"
		}), `
;(function () {
  var reactHotLoader = require('react-hot-loader').default;
  var leaveModule = require('react-hot-loader').leaveModule;
  if (!reactHotLoader) {
    return;
  }
${t.map(({ variableName: e, uniqueLocalName: t }) => `  reactHotLoader.register(${e}, "${t}", ${JSON.stringify(this.filePath || "")});`).join("\n")}
  leaveModule(module);
})();`;
	}
	process() {
		return !1;
	}
}, Gc = /* @__PURE__ */ new Set(/* @__PURE__ */ "break.case.catch.class.const.continue.debugger.default.delete.do.else.export.extends.finally.for.function.if.import.in.instanceof.new.return.super.switch.this.throw.try.typeof.var.void.while.with.yield.enum.implements.interface.let.package.private.protected.public.static.await.false.null.true".split("."));
function Kc(e) {
	if (e.length === 0 || !xe[e.charCodeAt(0)]) return !1;
	for (let t = 1; t < e.length; t++) if (!be[e.charCodeAt(t)]) return !1;
	return !Gc.has(e);
}
//#endregion
//#region node_modules/sucrase/dist/esm/transformers/TypeScriptTransformer.js
var qc = class extends yt {
	constructor(e, t, n) {
		super(), this.rootTransformer = e, this.tokens = t, this.isImportsTransformEnabled = n;
	}
	process() {
		return this.rootTransformer.processPossibleArrowParamEnd() || this.rootTransformer.processPossibleAsyncArrowWithTypeParams() || this.rootTransformer.processPossibleTypeRange() ? !0 : this.tokens.matches1(j._public) || this.tokens.matches1(j._protected) || this.tokens.matches1(j._private) || this.tokens.matches1(j._abstract) || this.tokens.matches1(j._readonly) || this.tokens.matches1(j._override) || this.tokens.matches1(j.nonNullAssertion) ? (this.tokens.removeInitialToken(), !0) : this.tokens.matches1(j._enum) || this.tokens.matches2(j._const, j._enum) ? (this.processEnum(), !0) : this.tokens.matches2(j._export, j._enum) || this.tokens.matches3(j._export, j._const, j._enum) ? (this.processEnum(!0), !0) : !1;
	}
	processEnum(e = !1) {
		for (this.tokens.removeInitialToken(); this.tokens.matches1(j._const) || this.tokens.matches1(j._enum);) this.tokens.removeToken();
		let t = this.tokens.identifierName();
		this.tokens.removeToken(), e && !this.isImportsTransformEnabled && this.tokens.appendCode("export "), this.tokens.appendCode(`var ${t}; (function (${t})`), this.tokens.copyExpectedToken(j.braceL), this.processEnumBody(t), this.tokens.copyExpectedToken(j.braceR), e && this.isImportsTransformEnabled ? this.tokens.appendCode(`)(${t} || (exports.${t} = ${t} = {}));`) : this.tokens.appendCode(`)(${t} || (${t} = {}));`);
	}
	processEnumBody(e) {
		let t = null;
		for (; !this.tokens.matches1(j.braceR);) {
			let { nameStringCode: n, variableName: r } = this.extractEnumKeyInfo(this.tokens.currentToken());
			this.tokens.removeInitialToken(), this.tokens.matches3(j.eq, j.string, j.comma) || this.tokens.matches3(j.eq, j.string, j.braceR) ? this.processStringLiteralEnumMember(e, n, r) : this.tokens.matches1(j.eq) ? this.processExplicitValueEnumMember(e, n, r) : this.processImplicitValueEnumMember(e, n, r, t), this.tokens.matches1(j.comma) && this.tokens.removeToken(), t = r ?? `${e}[${n}]`;
		}
	}
	extractEnumKeyInfo(e) {
		if (e.type === j.name) {
			let t = this.tokens.identifierNameForToken(e);
			return {
				nameStringCode: `"${t}"`,
				variableName: Kc(t) ? t : null
			};
		} else if (e.type === j.string) {
			let t = this.tokens.stringValueForToken(e);
			return {
				nameStringCode: this.tokens.code.slice(e.start, e.end),
				variableName: Kc(t) ? t : null
			};
		} else throw Error("Expected name or string at beginning of enum element.");
	}
	processStringLiteralEnumMember(e, t, n) {
		n == null ? (this.tokens.appendCode(`${e}[${t}]`), this.tokens.copyToken(), this.tokens.copyToken(), this.tokens.appendCode(";")) : (this.tokens.appendCode(`const ${n}`), this.tokens.copyToken(), this.tokens.copyToken(), this.tokens.appendCode(`; ${e}[${t}] = ${n};`));
	}
	processExplicitValueEnumMember(e, t, n) {
		let r = this.tokens.currentToken().rhsEndIndex;
		if (r == null) throw Error("Expected rhsEndIndex on enum assign.");
		if (n != null) {
			for (this.tokens.appendCode(`const ${n}`), this.tokens.copyToken(); this.tokens.currentIndex() < r;) this.rootTransformer.processToken();
			this.tokens.appendCode(`; ${e}[${e}[${t}] = ${n}] = ${t};`);
		} else {
			for (this.tokens.appendCode(`${e}[${e}[${t}]`), this.tokens.copyToken(); this.tokens.currentIndex() < r;) this.rootTransformer.processToken();
			this.tokens.appendCode(`] = ${t};`);
		}
	}
	processImplicitValueEnumMember(e, t, n, r) {
		let i = r == null ? "0" : `${r} + 1`;
		n != null && (this.tokens.appendCode(`const ${n} = ${i}; `), i = n), this.tokens.appendCode(`${e}[${e}[${t}] = ${i}] = ${t};`);
	}
}, Jc = class e {
	__init() {
		this.transformers = [];
	}
	__init2() {
		this.generatedVariables = [];
	}
	constructor(t, n, r, i) {
		e.prototype.__init.call(this), e.prototype.__init2.call(this), this.nameManager = t.nameManager, this.helperManager = t.helperManager;
		let { tokenProcessor: a, importProcessor: o } = t;
		this.tokens = a, this.isImportsTransformEnabled = n.includes("imports"), this.isReactHotLoaderTransformEnabled = n.includes("react-hot-loader"), this.disableESTransforms = !!i.disableESTransforms, i.disableESTransforms || (this.transformers.push(new Hc(a, this.nameManager)), this.transformers.push(new Bc(a)), this.transformers.push(new Vc(a, this.nameManager))), n.includes("jsx") && (i.jsxRuntime !== "preserve" && this.transformers.push(new bt(this, a, o, this.nameManager, i)), this.transformers.push(new Uc(this, a, o, i)));
		let s = null;
		if (n.includes("react-hot-loader")) {
			if (!i.filePath) throw Error("filePath is required when using the react-hot-loader transform.");
			s = new Wc(a, i.filePath), this.transformers.push(s);
		}
		if (n.includes("imports")) {
			if (o === null) throw Error("Expected non-null importProcessor with imports transform enabled.");
			this.transformers.push(new Nc(this, a, o, this.nameManager, this.helperManager, s, r, !!i.enableLegacyTypeScriptModuleInterop, n.includes("typescript"), n.includes("flow"), !!i.preserveDynamicImport, !!i.keepUnusedImports));
		} else this.transformers.push(new Pc(a, this.nameManager, this.helperManager, s, n.includes("typescript"), n.includes("flow"), !!i.keepUnusedImports, i));
		n.includes("flow") && this.transformers.push(new Fc(this, a, n.includes("imports"))), n.includes("typescript") && this.transformers.push(new qc(this, a, n.includes("imports"))), n.includes("jest") && this.transformers.push(new zc(this, a, this.nameManager, o));
	}
	transform() {
		this.tokens.reset(), this.processBalancedCode();
		let e = this.isImportsTransformEnabled ? "\"use strict\";" : "";
		for (let t of this.transformers) e += t.getPrefixCode();
		e += this.helperManager.emitHelpers(), e += this.generatedVariables.map((e) => ` var ${e};`).join("");
		for (let t of this.transformers) e += t.getHoistedCode();
		let t = "";
		for (let e of this.transformers) t += e.getSuffixCode();
		let n = this.tokens.finish(), { code: r } = n;
		if (r.startsWith("#!")) {
			let i = r.indexOf("\n");
			return i === -1 && (i = r.length, r += "\n"), {
				code: r.slice(0, i + 1) + e + r.slice(i + 1) + t,
				mappings: this.shiftMappings(n.mappings, e.length)
			};
		} else return {
			code: e + r + t,
			mappings: this.shiftMappings(n.mappings, e.length)
		};
	}
	processBalancedCode() {
		let e = 0, t = 0;
		for (; !this.tokens.isAtEnd();) {
			if (this.tokens.matches1(j.braceL) || this.tokens.matches1(j.dollarBraceL)) e++;
			else if (this.tokens.matches1(j.braceR)) {
				if (e === 0) return;
				e--;
			}
			if (this.tokens.matches1(j.parenL)) t++;
			else if (this.tokens.matches1(j.parenR)) {
				if (t === 0) return;
				t--;
			}
			this.processToken();
		}
	}
	processToken() {
		if (this.tokens.matches1(j._class)) {
			this.processClass();
			return;
		}
		for (let e of this.transformers) if (e.process()) return;
		this.tokens.copyToken();
	}
	processNamedClass() {
		if (!this.tokens.matches2(j._class, j.name)) throw Error("Expected identifier for exported class name.");
		let e = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1);
		return this.processClass(), e;
	}
	processClass() {
		let e = xc(this, this.tokens, this.nameManager, this.disableESTransforms), t = (e.headerInfo.isExpression || !e.headerInfo.className) && e.staticInitializerNames.length + e.instanceInitializerNames.length > 0, n = e.headerInfo.className;
		t && (n = this.nameManager.claimFreeName("_class"), this.generatedVariables.push(n), this.tokens.appendCode(` (${n} =`));
		let r = this.tokens.currentToken().contextId;
		if (r == null) throw Error("Expected class to have a context ID.");
		for (this.tokens.copyExpectedToken(j._class); !this.tokens.matchesContextIdAndLabel(j.braceL, r);) this.processToken();
		this.processClassBody(e, n);
		let i = e.staticInitializerNames.map((e) => `${n}.${e}()`);
		t ? this.tokens.appendCode(`, ${i.map((e) => `${e}, `).join("")}${n})`) : e.staticInitializerNames.length > 0 && this.tokens.appendCode(` ${i.map((e) => `${e};`).join(" ")}`);
	}
	processClassBody(e, t) {
		let { headerInfo: n, constructorInsertPos: r, constructorInitializerStatements: i, fields: a, instanceInitializerNames: o, rangesToRemove: s } = e, c = 0, l = 0, u = this.tokens.currentToken().contextId;
		if (u == null) throw Error("Expected non-null context ID on class.");
		this.tokens.copyExpectedToken(j.braceL), this.isReactHotLoaderTransformEnabled && this.tokens.appendCode("__reactstandin__regenerateByEval(key, code) {this[key] = eval(code);}");
		let d = i.length + o.length > 0;
		if (r === null && d) {
			let e = this.makeConstructorInitCode(i, o, t);
			if (n.hasSuperclass) {
				let t = this.nameManager.claimFreeName("args");
				this.tokens.appendCode(`constructor(...${t}) { super(...${t}); ${e}; }`);
			} else this.tokens.appendCode(`constructor() { ${e}; }`);
		}
		for (; !this.tokens.matchesContextIdAndLabel(j.braceR, u);) if (c < a.length && this.tokens.currentIndex() === a[c].start) {
			let e = !1;
			for (this.tokens.matches1(j.bracketL) ? this.tokens.copyTokenWithPrefix(`${a[c].initializerName}() {this`) : this.tokens.matches1(j.string) || this.tokens.matches1(j.num) ? (this.tokens.copyTokenWithPrefix(`${a[c].initializerName}() {this[`), e = !0) : this.tokens.copyTokenWithPrefix(`${a[c].initializerName}() {this.`); this.tokens.currentIndex() < a[c].end;) e && this.tokens.currentIndex() === a[c].equalsIndex && this.tokens.appendCode("]"), this.processToken();
			this.tokens.appendCode("}"), c++;
		} else if (l < s.length && this.tokens.currentIndex() >= s[l].start) {
			for (this.tokens.currentIndex() < s[l].end && this.tokens.removeInitialToken(); this.tokens.currentIndex() < s[l].end;) this.tokens.removeToken();
			l++;
		} else this.tokens.currentIndex() === r ? (this.tokens.copyToken(), d && this.tokens.appendCode(`;${this.makeConstructorInitCode(i, o, t)};`), this.processToken()) : this.processToken();
		this.tokens.copyExpectedToken(j.braceR);
	}
	makeConstructorInitCode(e, t, n) {
		return [...e, ...t.map((e) => `${n}.prototype.${e}.call(this)`)].join(";");
	}
	processPossibleArrowParamEnd() {
		if (this.tokens.matches2(j.parenR, j.colon) && this.tokens.tokenAtRelativeIndex(1).isType) {
			let e = this.tokens.currentIndex() + 1;
			for (; this.tokens.tokens[e].isType;) e++;
			if (this.tokens.matches1AtIndex(e, j.arrow)) {
				for (this.tokens.removeInitialToken(); this.tokens.currentIndex() < e;) this.tokens.removeToken();
				return this.tokens.replaceTokenTrimmingLeftWhitespace(") =>"), !0;
			}
		}
		return !1;
	}
	processPossibleAsyncArrowWithTypeParams() {
		if (!this.tokens.matchesContextual(A._async) && !this.tokens.matches1(j._async)) return !1;
		let e = this.tokens.tokenAtRelativeIndex(1);
		if (e.type !== j.lessThan || !e.isType) return !1;
		let t = this.tokens.currentIndex() + 1;
		for (; this.tokens.tokens[t].isType;) t++;
		if (this.tokens.matches1AtIndex(t, j.parenL)) {
			for (this.tokens.replaceToken("async ("), this.tokens.removeInitialToken(); this.tokens.currentIndex() < t;) this.tokens.removeToken();
			return this.tokens.removeToken(), this.processBalancedCode(), this.processToken(), !0;
		}
		return !1;
	}
	processPossibleTypeRange() {
		if (this.tokens.currentToken().isType) {
			for (this.tokens.removeInitialToken(); this.tokens.currentToken().isType;) this.tokens.removeToken();
			return !0;
		}
		return !1;
	}
	shiftMappings(e, t) {
		for (let n = 0; n < e.length; n++) {
			let r = e[n];
			r !== void 0 && (e[n] = r + t);
		}
		return e;
	}
};
(/* @__PURE__ */ o(((e) => {
	e.__esModule = !0, e.LinesAndColumns = void 0;
	var t = "\n", n = "\r";
	e.LinesAndColumns = function() {
		function e(e) {
			this.string = e;
			for (var r = [0], i = 0; i < e.length;) switch (e[i]) {
				case t:
					i += t.length, r.push(i);
					break;
				case n:
					i += n.length, e[i] === t && (i += t.length), r.push(i);
					break;
				default:
					i++;
					break;
			}
			this.offsets = r;
		}
		return e.prototype.locationForIndex = function(e) {
			if (e < 0 || e > this.string.length) return null;
			for (var t = 0, n = this.offsets; n[t + 1] <= e;) t++;
			var r = e - n[t];
			return {
				line: t,
				column: r
			};
		}, e.prototype.indexForLocation = function(e) {
			var t = e.line, n = e.column;
			return t < 0 || t >= this.offsets.length || n < 0 || n > this.lengthOfLine(t) ? null : this.offsets[t] + n;
		}, e.prototype.lengthOfLine = function(e) {
			var t = this.offsets[e];
			return (e === this.offsets.length - 1 ? this.string.length : this.offsets[e + 1]) - t;
		}, e;
	}();
})))();
//#endregion
//#region node_modules/sucrase/dist/esm/util/getTSImportedNames.js
function Yc(e) {
	let t = /* @__PURE__ */ new Set();
	for (let n = 0; n < e.tokens.length; n++) e.matches1AtIndex(n, j._import) && !e.matches3AtIndex(n, j._import, j.name, j.eq) && Xc(e, n, t);
	return t;
}
function Xc(e, t, n) {
	t++, !e.matches1AtIndex(t, j.parenL) && (e.matches1AtIndex(t, j.name) && (n.add(e.identifierNameAtIndex(t)), t++, e.matches1AtIndex(t, j.comma) && t++), e.matches1AtIndex(t, j.star) && (t += 2, n.add(e.identifierNameAtIndex(t)), t++), e.matches1AtIndex(t, j.braceL) && (t++, Zc(e, t, n)));
}
function Zc(e, t, n) {
	for (;;) {
		if (e.matches1AtIndex(t, j.braceR)) return;
		let r = mt(e, t);
		if (t = r.endIndex, r.isType || n.add(r.rightName), e.matches2AtIndex(t, j.comma, j.braceR) || e.matches1AtIndex(t, j.braceR)) return;
		if (e.matches1AtIndex(t, j.comma)) t++;
		else throw Error(`Unexpected token: ${JSON.stringify(e.tokens[t])}`);
	}
}
//#endregion
//#region node_modules/sucrase/dist/esm/index.js
function Qc(e, t) {
	wn(t);
	try {
		let n = $c(e, t), r = new Jc(n, t.transforms, !!t.enableLegacyBabel5ModuleInterop, t).transform(), i = { code: r.code };
		if (t.sourceMapOptions) {
			if (!t.filePath) throw Error("filePath must be specified when generating a source map.");
			i = {
				...i,
				sourceMap: ln(r, t.filePath, t.sourceMapOptions, e, n.tokenProcessor.tokens)
			};
		}
		return i;
	} catch (e) {
		throw t.filePath && (e.message = `Error transforming ${t.filePath}: ${e.message}`), e;
	}
}
function $c(e, t) {
	let n = t.transforms.includes("jsx"), r = t.transforms.includes("typescript"), i = t.transforms.includes("flow"), a = t.disableESTransforms === !0, o = vc(e, n, r, i), s = o.tokens, c = o.scopes, l = new vn(e, s), u = new fn(l), d = new bc(e, s, i, a, u), f = !!t.enableLegacyTypeScriptModuleInterop, p = null;
	return t.transforms.includes("imports") ? (p = new kt(l, d, f, t, t.transforms.includes("typescript"), !!t.keepUnusedImports, u), p.preprocessTokens(), pn(d, c, p.getGlobalNames()), t.transforms.includes("typescript") && !t.keepUnusedImports && p.pruneTypeOnlyImports()) : t.transforms.includes("typescript") && !t.keepUnusedImports && pn(d, c, Yc(d)), {
		tokenProcessor: d,
		scopes: c,
		nameManager: l,
		importProcessor: p,
		helperManager: u
	};
}
//#endregion
//#region src/tier1/ddmin.ts
function el(e, t) {
	let n = Math.max(1, Math.floor(e.length / t)), r = [], i = 0;
	for (let a = 0; a < t && i < e.length; a++) {
		let o = a === t - 1 ? e.length : Math.min(e.length, i + n);
		r.push(e.slice(i, o)), i = o;
	}
	return r.filter((e) => e.length > 0);
}
function tl(e, t) {
	if (e.length === 0 || !t(e)) return [];
	let n = (e, r) => {
		if (e.length <= 1) return e;
		let i = el(e, Math.min(r, e.length));
		for (let e of i) if (e.length > 0 && t(e)) return n(e, 2);
		for (let r = 0; r < i.length; r++) {
			let a = e.filter((e) => !i[r].includes(e));
			if (a.length > 0 && a.length < e.length && t(a)) return n(a, Math.max(i.length - 1, 2));
		}
		return r < e.length ? n(e, Math.min(e.length, 2 * r)) : e;
	};
	return n(e, 2);
}
function nl(e) {
	return `minimal failing set: [${e.join(", ")}]`;
}
function rl(e) {
	return e && e.length > 0 ? `ddmin-failure: ${e}` : "ddmin-failure";
}
function il(e, t, n) {
	try {
		if (e.length === 0) return {
			set: [],
			event: rl("empty module set")
		};
		let r = (e) => {
			let r = t(e);
			return r == null ? !1 : !n || al(r, n);
		};
		if (!r(e)) return {
			set: [],
			event: rl("universe not interesting")
		};
		let i = tl(e, r);
		if (i.length === 0) return {
			set: [],
			event: rl("empty result")
		};
		let a = i.map((e) => e.path);
		return {
			set: a,
			event: nl(a)
		};
	} catch (e) {
		return {
			set: [],
			event: rl((e instanceof Error ? e.message : String(e)).slice(0, 120))
		};
	}
}
function al(e, t) {
	if (/Invalid regular expression/i.test(e) && /Invalid regular expression/i.test(t)) return !0;
	let n = /Identifier '([A-Za-z_$][\w$]*)' has already been declared/i.exec(e), r = /Identifier '([A-Za-z_$][\w$]*)' has already been declared/i.exec(t);
	return n && r ? n[1] === r[1] : (e.split("\n")[0] ?? "").slice(0, 60) === (t.split("\n")[0] ?? "").slice(0, 60);
}
function ol(e, t, n, r) {
	let i = [];
	for (let a of t) {
		let t = e.find((e) => e.path === a);
		if (!t) continue;
		let o = n(t.content, r);
		!o || o.content === t.content || i.push({
			path: a,
			content: o.content,
			note: `ddmin delimiter-oracle full-text heal (${o.classKey}, ${o.edits} edit${o.edits === 1 ? "" : "s"}) on ${a}`
		});
	}
	return i;
}
//#endregion
//#region src/tier1/testgenOracle.generated.ts
var sl = [
	{
		id: "smoke-binary-number",
		family: "determinism",
		branch: "algebraic",
		paramCount: 2,
		paramTypes: ["number", "number"],
		returnType: "number",
		license: "export",
		body: "expect(typeof SYM(1, 2)).toBe('number');\nexpect(Number.isFinite(SYM(1, 2))).toBe(true);"
	},
	{
		id: "smoke-unary-string",
		family: "determinism",
		branch: "algebraic",
		paramCount: 1,
		paramTypes: ["string"],
		returnType: "string",
		license: "export",
		body: "expect(typeof SYM('x')).toBe('string');"
	},
	{
		id: "rejects-empty-string",
		family: "rejects-empty",
		branch: "contract",
		paramCount: 1,
		paramTypes: ["string"],
		returnType: "string",
		license: "empty",
		body: "expect(() => SYM('')).toThrow();"
	},
	{
		id: "roundtrip-string",
		family: "roundtrip",
		branch: "algebraic",
		paramCount: 1,
		paramTypes: ["string"],
		returnType: "string",
		license: "roundtrip",
		body: "expect(SYM('  ab  ')).toBe('ab');\nexpect(SYM('ab')).toBe('ab');"
	},
	{
		id: "model-schema-construct",
		family: "model-schema",
		branch: "state",
		paramCount: 1,
		paramTypes: ["Record<string, unknown>"],
		returnType: "ArticleModel",
		license: "model-schema",
		body: "expect(() => new SYM({})).not.toThrow();\nexpect(new SYM({})).toBeInstanceOf(SYM);"
	},
	{
		id: "uses-dep-seam",
		family: "uses-dep",
		branch: "contract",
		paramCount: 0,
		paramTypes: [],
		returnType: "unknown",
		license: "uses-dep",
		body: "expect(SYM).toBeDefined();\nexpect(typeof SYM).toBe('function');"
	}
], cl = [
	{
		id: "undefined-symbol-jest",
		classKeyPattern: "^undefined-symbol\\|jest$",
		category: "mechanical",
		route: "ir",
		hint: "undefined-symbol|jest mechanical fix (0 tok, never model): 1) harness provides jest as an alias of vi — prefer that 2) or rewrite jest. → vi. in the suite (accept iff re-parse + no other diffs) 3) do not ask the model to invent a jest shim"
	},
	{
		id: "undefined-symbol-fn",
		classKeyPattern: "^undefined-symbol\\|fn$",
		category: "mechanical",
		route: "ir",
		hint: "undefined-symbol|fn mechanical fix (0 tok, never model): 1) harness binds bare fn → vi.fn 2) or rewrite fn( → vi.fn( in the suite when safe 3) do not ask the model to invent a mock shim"
	},
	{
		id: "is-not-a-function-spyOn",
		classKeyPattern: "^is-not-a-function\\|spyOn$",
		category: "mechanical",
		route: "ir",
		hint: "is-not-a-function|spyOn mechanical fix (0 tok, never model): 1) harness binds spyOn → vi.spyOn 2) or rewrite spyOn( → vi.spyOn( in the suite when safe 3) do not ask the model to invent a spy shim"
	},
	{
		id: "undefined-symbol",
		classKeyPattern: "^undefined-symbol\\|",
		category: "mechanical",
		route: "impl",
		hint: "undefined-symbol playbook (apply in order): 1) check export/import wiring — is the symbol exported from the owning module and imported by the caller? 2) verify signature arity and name spelling against the stub 3) add null-guards only if the contract allows undefined inputs 4) implement the missing export if the stub declares it but the body was omitted"
	},
	{
		id: "is-not-a-function",
		classKeyPattern: "^is-not-a-function\\|",
		category: "semantic",
		route: "impl",
		hint: "is-not-a-function playbook (apply in order): 1) confirm the binding is a function export (not a value/object) matching the stub 2) check import { name } vs default/namespace mismatch 3) verify call arity and that the callee is not shadowed by a non-function 4) restore the function export if it was replaced by a constant"
	},
	{
		id: "empty-draw",
		classKeyPattern: "^empty-draw$",
		category: "mechanical",
		route: "ir",
		hint: "empty-draw mechanical path (0 tok, never count as attempt): 1) model returned an empty body — classify as empty-draw, not unparseable 2) route method-anchor cases to the clade template (registerUser/createArticle/…) 3) drop messaging says N empty draws — do not burn attempt budget"
	},
	{
		id: "nullread",
		classKeyPattern: "^runtime\\|nullread\\|",
		category: "semantic",
		route: "impl",
		hint: "nullread playbook (apply in order): 1) identify which receiver is null/undefined at the property access 2) add a guard or early return matching the frozen contract 3) ensure upstream builders initialize the object before use 4) do not weaken tests — make the implementation satisfy them"
	},
	{
		id: "assertion-toBe",
		classKeyPattern: "^assertion\\|toBe$",
		category: "semantic",
		route: "impl",
		hint: "assertion|toBe value-shape playbook (apply in order): 1) compare actual vs expected primitives from the failure message 2) check type coercion (string vs number), Object.is edge cases (-0, NaN) 3) align return shape with the stub contract and frozen expect().toBe 4) prefer fixing implementation; do not weaken the frozen expected value"
	},
	{
		id: "assertion-toHaveProperty",
		classKeyPattern: "^assertion\\|toHaveProperty$",
		category: "semantic",
		route: "impl",
		hint: "assertion|toHaveProperty playbook (apply in order): 1) confirm the object is non-null and the path exists on the return value 2) check nested path segments and optional value equality when asserted 3) align the returned object shape with the stub / frozen suite 4) prefer fixing implementation builders over deleting properties in tests"
	},
	{
		id: "assertion",
		classKeyPattern: "^assertion\\|",
		category: "semantic",
		route: "impl",
		hint: "assertion playbook (apply in order): 1) compare actual vs expected from the failure message 2) check operator direction, off-by-one, and type coercion 3) align return shape with the stub and frozen expect() 4) prefer fixing implementation; IR surgery only after persistent multi-pass failure"
	},
	{
		id: "regex-literal",
		classKeyPattern: "^regex-literal\\|",
		category: "mechanical",
		route: "impl",
		hint: "regex-literal playbook (apply in order): 1) locate the Invalid regular expression site (attributed file) 2) close unterminated /…/ literals and escape intentional slashes 3) prefer mechanical close-slash when the line has an odd unescaped / count 4) if the offender is the suite, route to IR-side case surgery"
	},
	{
		id: "throw-mismatch",
		classKeyPattern: "^throw-mismatch\\|",
		category: "semantic",
		route: "impl",
		hint: "throw-mismatch playbook (apply in order): 1) read whether the test expects throw vs not.toThrow 2) check impl validation branch vs case expectation (throw on the named edge) 3) match error TYPE vs message only when the frozen suite asserts them 4) check stub contract — do not swallow errors the suite requires"
	},
	{
		id: "runtime-generic",
		classKeyPattern: "^runtime\\|(?!nullread\\|).+",
		category: "semantic",
		route: "impl",
		hint: "runtime playbook (apply in order): 1) read the thrown message class first (TypeError/RangeError/custom) 2) locate the throw site from the attributed file / stack 3) satisfy the frozen contract with a guard or correct branch — do not catch-and-swallow 4) if the suite synthesizes code at runtime, route to IR-case surgery (dynamic-eval lint)"
	},
	{
		id: "undefined-symbol-fn",
		classKeyPattern: "^undefined-symbol\\|fn$",
		category: "mechanical",
		route: "ir",
		hint: "undefined-symbol|fn mechanical fix (0 tok, never model): 1) harness binds bare fn to vi.fn 2) or rewrite fn( → vi.fn( in the suite when safe 3) do not ask the model to invent a jest/fn shim"
	},
	{
		id: "is-not-a-function-spyOn",
		classKeyPattern: "^is-not-a-function\\|spyOn$",
		category: "mechanical",
		route: "ir",
		hint: "is-not-a-function|spyOn mechanical fix (0 tok, never model): 1) harness binds spyOn to vi.spyOn 2) or rewrite spyOn( → vi.spyOn( in the suite when safe 3) do not ask the model to invent a spyOn shim"
	},
	{
		id: "empty-draw",
		classKeyPattern: "^empty-draw$",
		category: "mechanical",
		route: "ir",
		hint: "empty-draw playbook (0 tok, never count as attempt): 1) model returned an empty body — route to method-anchor / clade template 2) do not spend a repair draw on nothing 3) drop messaging says N empty draws, not N attempts"
	},
	{
		id: "dynamic-eval-impl",
		classKeyPattern: "^dynamic-eval\\|",
		category: "semantic",
		route: "impl",
		hint: "dynamic-eval playbook (apply in order): 1) replace eval / new Function / dynamic new RegExp with direct logic 2) prefer literal RegExp / static parsers matching the frozen contract 3) never synthesize code at runtime in this artifact class"
	}
];
function ll(e) {
	if (!e) return null;
	for (let t of cl) if (new RegExp(t.classKeyPattern).test(e)) return t;
	return null;
}
function ul(e) {
	let t = ll(e);
	return t ? `Repair oracle [${t.id} | ${t.category}/${t.route}]: ${t.hint}` : "Repair oracle: catalog-drift (no-handler) — no enumerated strategy for this classKey; enumerate candidates bounded by the frozen contract.";
}
//#endregion
//#region src/tier1/substrateHandoff.ts
function dl(e) {
	let t = (e.action || "substrate").trim() || "substrate", n = (e.candidateSites ?? []).map((e) => e.trim()).filter(Boolean);
	return n.length ? `${t}: refused — ${n.length} candidate site${n.length === 1 ? "" : "s"}: ${n.join(", ")}` : `${t}: refused — ${(e.reason ?? "unproven").trim() || "unproven"}`;
}
function fl(e) {
	return e ? !!e.classKey || e.attempts.length > 0 || (e.refusals?.length ?? 0) > 0 || (e.rejectedCandidates?.length ?? 0) > 0 || (e.ruledOutPlaybook?.length ?? 0) > 0 || (e.constants?.length ?? 0) > 0 : !1;
}
function pl(e) {
	let t = e.candidateSites?.filter(Boolean) ?? [];
	if (e.status === "refused" && t.length) return `${e.handler}: refused — ${t.length} candidate site${t.length === 1 ? "" : "s"}: ${t.join(", ")}`;
	let n = e.reason ? ` — ${e.reason}` : "", r = e.note ? ` — ${e.note}` : "";
	return `${e.handler}: ${e.status}${n}${r}`;
}
function ml(e) {
	if (!fl(e) || !e) return "";
	let t = ["Page substrate — deterministic handoff (finish this investigation):", `classification: ${e.classKey}${e.stratum ? ` · stratum=${e.stratum}` : ""}`], n = [], r = (e) => {
		t.join("\n").length + e.length + 1 <= 800 ? t.push(e) : n.push(e);
	};
	if (e.attempts.length) {
		r("mechanical attempts (most recent first):");
		for (let t of [...e.attempts].reverse()) r(`  - ${pl(t)}`);
	}
	let i = e.refusals?.length ? e.refusals : e.attempts.filter((e) => e.status === "refused").map(pl);
	if (i.length) {
		r("refusals (with reason):");
		for (let e of i) r(`  - ${e}`);
	}
	if (e.rejectedCandidates?.length) {
		r("candidate edits considered-but-rejected:");
		for (let t of e.rejectedCandidates) r(`  - ${t}`);
	}
	if (e.ruledOutPlaybook?.length) {
		r("playbook steps ruled out:");
		for (let t of e.ruledOutPlaybook) r(`  - ${t}`);
	}
	if (e.constants?.length) {
		r("constants (spec literals):");
		for (let t of e.constants) r(`  - ${t}`);
	}
	if (!n.length) return t.join("\n");
	let a = `… (${n.length} item(s) elided at cap)`;
	return `${t.join("\n").slice(0, Math.max(0, 800 - a.length - 1))}\n${a}`;
}
function hl(e) {
	let t = e.refusals?.length ? e.refusals : e.attempts.filter((e) => e.status === "refused").map((e) => dl({
		action: e.handler,
		reason: e.reason,
		candidateSites: e.candidateSites
	})), n = {
		classKey: e.classKey,
		stratum: e.stratum,
		attempts: e.attempts,
		refusals: t.length ? t : void 0,
		rejectedCandidates: e.rejectedCandidates,
		ruledOutPlaybook: e.ruledOutPlaybook,
		constants: e.constants?.length ? e.constants : void 0
	};
	return fl(n) ? n : null;
}
//#endregion
//#region src/tier1/superbuffer.ts
var gl = 1200, _l = {
	fill: [
		"substrate",
		"spec",
		"contract",
		"corpus",
		"siblings",
		"union"
	],
	build: [
		"spec",
		"contract",
		"constants",
		"frozen",
		"concept",
		"corpus",
		"union"
	],
	repair: [
		"substrate",
		"finding-evidence",
		"exhibit",
		"trace",
		"contract",
		"constants",
		"ledger",
		"union",
		"frozen",
		"lessons",
		"concept"
	]
}, vl = 24;
function yl(e) {
	let t = /* @__PURE__ */ new Set();
	for (let n of e.matchAll(/"([^"\n]{1,80})"/g)) {
		let e = n[1].trim();
		e && t.add(e);
	}
	for (let n of e.matchAll(/'([^'\n]{1,80})'/g)) {
		let e = n[1].trim();
		e && t.add(e);
	}
	for (let n of e.matchAll(/`([^`\n]{1,80})`/g)) {
		let e = n[1].trim();
		e && t.add(e);
	}
	for (let n of e.matchAll(/\b[A-Z][A-Z0-9_]{1,}\b/g)) {
		let e = n[0];
		/^[A-Z]\d+$/.test(e) || t.add(e);
	}
	for (let n of e.matchAll(/\b(?:status(?:es)?|code|limit|max(?:imum)?|min(?:imum)?|size|width|height|depth|timeout|retries?|port|capacity|threshold|ttl|len(?:gth)?|dim(?:ension)?s?)\s*[:=]?\s*(-?\d+(?:\.\d+)?)\b/gi)) t.add(n[1]);
	for (let n of e.matchAll(/\b(\d{2,})\s*[x×]\s*(\d{2,})\b/gi)) t.add(`${n[1]}x${n[2]}`);
	return [...t].filter((e) => e.length > 0).sort((e, t) => e.localeCompare(t)).slice(0, vl);
}
function bl(e, t) {
	let n = (e) => new Set(e.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim().split(/\s+/).filter(Boolean)), r = n(e), i = n(t);
	if (!r.size || !i.size) return 0;
	let a = 0;
	for (let e of r) i.has(e) && a++;
	return a / (r.size + i.size - a);
}
function xl(e, t, n) {
	if (!e) return n ? bl(n, t.family) * .3 : 0;
	let r = e.params.length === t.paramCount ? 1 : 1 - Math.min(1, Math.abs(e.params.length - t.paramCount) / 3), i = 0, a = Math.min(e.params.length, t.paramTypes.length);
	if (a > 0) {
		let n = 0;
		for (let r = 0; r < a; r++) {
			let i = e.params[r].toLowerCase().replace(/\s+/g, ""), a = t.paramTypes[r].toLowerCase().replace(/\s+/g, "");
			(i === a || i.includes(a) || a.includes(i)) && n++;
		}
		i = n / Math.max(e.params.length, t.paramTypes.length);
	} else e.params.length === 0 && t.paramCount === 0 && (i = 1);
	let o = e.returnType.toLowerCase().replace(/\s+/g, ""), s = t.returnType.toLowerCase().replace(/\s+/g, ""), c = o === s || o.includes(s) || s.includes(o) ? 1 : 0, l = Math.max(bl(e.name, t.family), bl(e.name, t.id), n ? bl(n, t.family) : 0);
	return .35 * r + .3 * i + .15 * c + .2 * l;
}
function Sl(e) {
	return Math.ceil(e.length / 4);
}
function Cl(e) {
	let t = e.trimEnd();
	return {
		chars: t.length,
		text: t,
		approxTokens: Sl(t)
	};
}
function wl(e, t) {
	let n = [
		`Feature ${e.id}: ${e.name}`,
		`Description: ${e.description}`,
		`Edge cases: ${e.edgeCases.join(" | ") || "(none)"}`,
		`Exports: ${e.exports.map((e) => `${e.symbol} from ${e.file}`).join("; ") || "(none)"}`,
		`Files: ${e.files.join(", ")}`,
		`Deps: ${e.deps.join(", ") || "(none)"}`,
		`Test file: ${e.testFile}`
	];
	return t?.title && n.unshift(`Product: ${t.title}`), t?.prompt && n.push(`Prompt span: ${t.prompt.slice(0, 400)}`), n.join("\n");
}
function Tl(e) {
	let t = e.trim();
	return t = t.replace(/```[\s\S]*?```/g, "[code omitted — concept is prose context only]"), t = t.replace(/^export\s+.+$/gm, "[export omitted]"), t.slice(0, 1600);
}
function El(e, t) {
	return `concept draw: ${e} (${t} chars, context only)`;
}
function Dl(e) {
	let t = e.stage ?? "fill", n = _l[t], r = wl(e.feature, e.spec), i = (e.parts?.cases ?? []).map((e) => ({
		name: e.name,
		body: e.body.slice(0, 240)
	})), a = [], o = [], s = /* @__PURE__ */ new Set(), c = (e, t) => {
		s.has(e) || (s.add(e), a.push(t));
	};
	for (let t of e.stubs) {
		o.push(`--- ${t.path} ---\n${t.content.slice(0, 400)}`);
		for (let e of t.content.matchAll(/export\s+(?:async\s+)?function\s+([A-Za-z_$][\w$]*)\s*\(([^)]*)\)\s*:\s*([^{;]+)/g)) c(e[1], `${e[1]}(${e[2]}): ${e[3].trim()}`);
		for (let e of t.content.matchAll(/export\s+(?:async\s+)?function\s+([A-Za-z_$][\w$]*)\s*\(([^)]*)\)/g)) c(e[1], `${e[1]}(${e[2]})`);
		for (let e of t.content.matchAll(/export\s+const\s+([A-Za-z_$][\w$]*)\s*(?::\s*[^=]+)?=\s*(?:async\s*)?\(([^)]*)\)\s*(?::\s*[^=]+)?=>/g)) c(e[1], `${e[1]}(${e[2]}) =>`);
		for (let e of t.content.matchAll(/export\s+class\s+([A-Za-z_$][\w$]*)/g)) {
			let n = e[1];
			c(n, `class ${n}`);
			let r = t.content.indexOf("{", e.index);
			if (r < 0) continue;
			let i = 0, a = t.content.length;
			for (let e = r; e < t.content.length; e++) if (t.content[e] === "{") i++;
			else if (t.content[e] === "}" && (i--, i === 0)) {
				a = e;
				break;
			}
			let o = t.content.slice(r + 1, a);
			for (let e of o.matchAll(/^\s*(?:public\s+|private\s+|protected\s+|static\s+)*(?:async\s+)?([A-Za-z_$][\w$]*)\s*\(([^)]*)\)(?:\s*:\s*([^{\n]+))?\s*\{/gm)) {
				let t = e[1];
				[
					"if",
					"for",
					"while",
					"switch",
					"catch",
					"return"
				].includes(t) || c(`${n}.${t}`, `${n}.${t}(${e[2]})${e[3] ? `: ${e[3].trim()}` : ""}`);
			}
		}
		for (let e of t.content.matchAll(/export\s+interface\s+([A-Za-z_$][\w$]*)/g)) c(`interface ${e[1]}`, `interface ${e[1]}`);
		for (let e of t.content.matchAll(/export\s+type\s+([A-Za-z_$][\w$]*)\s*=\s*([^;]+);/g)) c(`type ${e[1]}`, `type ${e[1]} = ${e[2].trim()}`);
		for (let e of t.content.matchAll(/export\s+const\s+([A-Za-z_$][\w$]*)\s*:\s*([^=]+)=/g)) c(e[1], `${e[1]}: ${e[2].trim()}`);
	}
	let l = e.signature?.name ?? e.feature.exports[0]?.symbol ?? e.target, u = sl.map((t) => ({
		id: t.id,
		family: t.family,
		body: t.body.replace(/SYM/g, l).slice(0, 200),
		score: xl(e.signature, t, l)
	})).filter((e) => e.score > .15).sort((e, t) => t.score - e.score).slice(0, 6), d = e.target.split("|")[0] ?? e.target, f = e.lessons.filter((t) => {
		let n = t.classKey.split("|")[0] ?? "";
		return n === d || t.classKey.startsWith(d) || d.startsWith(n) || bl(t.classKey, e.target) > .2;
	}).slice(0, 8), p = [];
	for (let [t, n] of e.siblingParts) if (t !== e.feature.id) for (let r of n.cases) {
		let n = Math.max(bl(r.name, e.target), bl(r.clade?.family ?? "", e.target), r.clade?.branch === "freeform" ? .1 : .05);
		n < .12 || p.push({
			featureId: t,
			name: r.name,
			body: r.body.slice(0, 200),
			score: n
		});
	}
	p.sort((e, t) => t.score - e.score);
	let m = p.slice(0, 6), h = (e.siblingImpls ?? []).filter((t) => !e.feature.files.includes(t.path)).map((t) => ({
		path: t.path,
		body: t.content.slice(0, 280),
		score: Math.max(bl(t.path, e.target), bl(t.path, l), bl(t.content.slice(0, 120), l))
	})).filter((t) => t.score > .05 || (e.siblingImpls?.length ?? 0) <= 4).sort((e, t) => t.score - e.score).slice(0, 4), g = [
		"Page contract — stubs + signatures:",
		a.length ? a.slice(0, 12).map((e) => `- ${e}`).join("\n") : "(no signatures extracted)",
		o.slice(0, 4).join("\n")
	].join("\n"), _ = ["Page frozen — own cases:", ...i.map((e) => `"${e.name}":\n${e.body}`)].join("\n"), v = [
		"Page corpus — templates + lessons:",
		...u.map((e) => `Clade template ${e.id} (${e.family}, score=${e.score.toFixed(2)}):\n${e.body}`),
		...f.map((e) => `Lesson [${e.classKey}]: ${e.idiom} → ${e.resolution}`)
	].join("\n"), y = ["Page lessons:", ...f.map((e) => `Lesson [${e.classKey}]: ${e.idiom} → ${e.resolution}`)].join("\n"), b = [
		"Page siblings:",
		...m.map((e) => `Sibling ${e.featureId} "${e.name}":\n${e.body}`),
		...h.map((e) => `Sibling impl ${e.path}:\n${e.body}`)
	].join("\n"), x = (e.conceptText ?? "").trim(), S = x ? `Page concept — ideation (CONTEXT ONLY, never extract code):\n${Tl(x)}` : "", C = (e.findingEvidence ?? "").trim() ? `Page finding-evidence:\n${(e.findingEvidence ?? "").trim().slice(0, 600)}` : "", w = yl(r), T = w.length ? ["Page constants — spec literals (intent oracle):", ...w.map((e) => `- ${e}`)].join("\n") : "", E = {
		substrate: fl(e.substrateHandoff) ? ml(e.substrateHandoff) : "",
		spec: `Page spec — encoded feature text:\n${r}`,
		contract: g,
		constants: T,
		frozen: _,
		corpus: v,
		siblings: b,
		concept: S,
		"finding-evidence": C,
		exhibit: (e.exhibitText ?? "").trim(),
		trace: (e.traceText ?? "").trim(),
		ledger: (e.ledgerText ?? "").trim(),
		union: (e.unionText ?? "").trim(),
		lessons: y
	}, ee = [
		"Superbuffer — verified correctness algorithms for similar structures.",
		`Stage: ${t}. Enumerate / apply the analogous strategy to THIS node.`,
		""
	].join("\n"), te = Sl(ee), ne = [ee.trimEnd()], D = {}, O = [], k = [], A = [], j = [], re = [], ie = 0, ae = (e) => {
		let t = Sl(e);
		if (te + t > 1200) {
			let t = Math.max(0, (gl - te) * 4 - 8);
			if (t < 40) return !1;
			let n = e.slice(0, t) + "\n…";
			return ne.push(n), te += Sl(n), !0;
		}
		return ne.push(e), te += t, !0;
	};
	for (let e of n) {
		let t = E[e];
		!t || !t.trim() || ae(t) && (D[e] = Cl(t.slice(0, Math.min(t.length, gl * 4))), e === "contract" && (ie = Math.min(a.length, 12)), e === "frozen" && A.push(...i), e === "corpus" && (O.push(...u), k.push(...f)), e === "lessons" && k.push(...f), e === "siblings" && (j.push(...m), re.push(...h.map((e) => ({
			path: e.path,
			body: e.body
		})))));
	}
	let oe = ne.join("\n"), M = [...new Set(O.map((e) => e.family))], se = [...new Set(k.map((e) => (e.classKey.split("|")[0] ?? e.classKey).slice(0, 48)))], N = Object.entries(D).map(([e, t]) => `${e}:${t.chars}`).join(", "), ce = O.length ? `${O.length} templates [${M.join(", ")}]` : `${O.length} templates`, P = k.length ? `${k.length} lessons [${se.join(", ")}]` : `${k.length} lessons`, F = re.length ? `, ${re.length} impls` : "", I = `superbuffer: assembled (${ie} stubs, ${A.length} frozen, ${ce}, ${P}, ${j.length} siblings${F}; pages [${N || "none"}]) stage=${t} for "${e.target}"`;
	return {
		templates: O,
		lessons: k,
		siblingCases: j,
		siblingImpls: re,
		frozenCases: A,
		stubSignatures: a,
		packedStubCount: ie,
		approxTokens: te,
		promptBlock: oe,
		logLine: I,
		pages: D,
		stage: t,
		specText: r
	};
}
function Ol(e) {
	return e.promptBlock;
}
function kl(e) {
	return e.cladeFamily && e.cladeFamily !== "freeform" ? `family:${e.cladeFamily}` : e.classKey ? `class:${e.classKey.split("|").slice(0, 2).join("|")}` : e.caseName ? `case:${e.caseName.toLowerCase().replace(/\s+/g, "-")}` : "freeform:unknown";
}
function Al(e) {
	return e >= 3;
}
function jl(e) {
	let t = {
		family: e.patternKey.replace(/^(family|class|case):/, "").slice(0, 48) || "freeform-promoted",
		patternKey: e.patternKey,
		wins: e.wins,
		draft: {
			stubSketch: (e.stubSketch ?? "export function SYM(...args: unknown[]): unknown { throw new Error(\"stub\"); }").slice(0, 400),
			caseBody: (e.caseBody ?? "expect(SYM()).toBeDefined();").slice(0, 400)
		},
		featureId: e.featureId,
		ts: (/* @__PURE__ */ new Date()).toISOString()
	};
	return e.source && (t.source = e.source), e.runIds && (t.runIds = e.runIds), t;
}
function Ml(e) {
	return e.source === "in-run-win" ? `clade-candidate: "${e.family}" (won ${e.wins} times this run)` : `clade-candidate: "${e.family}" (failed ${e.wins} consecutive runs)`;
}
var Nl = [
	{
		family: "response-shape",
		re: /Status|ErrorBody|error\s*bod/i
	},
	{
		family: "format-string",
		re: /LogFormat|json\s*log|structured\s*json\s*log/i
	},
	{
		family: "pagination",
		re: /Page|Offset|LinkHeader|\bLink\b/i
	}
];
function Pl(e) {
	if (!e) return null;
	for (let { family: t, re: n } of Nl) if (n.test(e)) return t;
	return null;
}
//#endregion
//#region src/tier1/clades.ts
var Fl = {
	roundtrip: "algebraic",
	idempotency: "algebraic",
	determinism: "algebraic",
	involution: "algebraic",
	commutativity: "algebraic",
	"throws-on-invalid": "contract",
	"rejects-empty": "contract",
	"null-safety": "contract",
	"uses-dep": "contract",
	"method-anchor": "contract",
	"response-shape": "contract",
	"crud-lifecycle": "state",
	expiry: "state",
	"collision-uniqueness": "state",
	ordering: "state",
	"model-schema": "state",
	pagination: "state",
	"empty-input": "representation",
	"boundary-values": "representation",
	unicode: "representation",
	"format-string": "representation"
}, Il = "model-schema", Ll = "uses-dep", Rl = "method-anchor", zl = "response-shape", Bl = "format-string", Vl = "pagination", Hl = /^[A-Z][A-Za-z0-9_]*Model$/, Ul = /^(register|create|check|update|delete|get|set|find|list|add|remove|validate|authenticate|authorize)[A-Z][A-Za-z0-9_]*$/;
function Wl(e) {
	return Hl.test(e);
}
function Gl(e) {
	return Ul.test(e);
}
function Kl(e, t) {
	let n = e || "fn", r = (t ?? "").toLowerCase();
	return /string|slug|id|token/.test(r) ? `const __got = ${n}({} as never);\nexpect(__got).toBeDefined();\nexpect(typeof __got).toBe('string');` : /number|count|limit/.test(r) ? `const __got = ${n}({} as never);\nexpect(__got).toBeDefined();\nexpect(typeof __got).toBe('number');` : /bool|ok|valid/.test(r) ? `const __got = ${n}({} as never);\nexpect(__got).toBeDefined();\nexpect(typeof __got).toBe('boolean');` : /object|record|article|user|session/.test(r) ? `const __got = ${n}({} as never);\nexpect(__got).toBeDefined();\nexpect(typeof __got).toBe('object');` : `const __got = ${n}({} as never);\nexpect(__got).toBeDefined();`;
}
function ql(e) {
	return e.cladeFamily ? e.cladeFamily : Wl(e.name) || e.symbol != null && Wl(e.symbol) ? Il : e.kind === "integration" || e.source === "dep" || /^uses\s+/i.test(e.name) ? Ll : Gl(e.name) || e.symbol != null && Gl(e.symbol) ? Rl : (Pl(e.name) ?? (e.symbol == null ? null : Pl(e.symbol))) || null;
}
function Jl(e, t) {
	return {
		branch: e.branch,
		family: e.family,
		bindings: { symbol: t }
	};
}
function Yl(e, t) {
	let n = e.body, r = `${e.name} ${e.kind}`.toLowerCase(), i = t ? { symbol: t } : {};
	return Wl(e.name) || e.clade?.family === "model-schema" ? {
		branch: "state",
		family: Il,
		bindings: i
	} : e.kind === "integration" || /^uses\s+/i.test(e.name) || e.clade?.family === "uses-dep" ? {
		branch: "contract",
		family: Ll,
		bindings: i
	} : Gl(e.name) || e.clade?.family === "method-anchor" ? {
		branch: "contract",
		family: Rl,
		bindings: i
	} : /decode\s*\(\s*encode|encode\s*\(\s*decode|SYM\s*\(\s*SYM/.test(n) || /round.?trip/.test(r) ? {
		branch: "algebraic",
		family: "roundtrip",
		bindings: i
	} : /\.toThrow\s*\(/.test(n) && /invalid|reject|throw/.test(r) ? {
		branch: "contract",
		family: "throws-on-invalid",
		bindings: i
	} : /\.toThrow\s*\(/.test(n) && /empty|''|""/.test(n + r) ? {
		branch: "contract",
		family: "rejects-empty",
		bindings: i
	} : /null|undefined/.test(r) && /\.toThrow|\.toBeNull|\.toBeUndefined/.test(n) ? {
		branch: "contract",
		family: "null-safety",
		bindings: i
	} : /expir|ttl|clock/.test(r) ? {
		branch: "state",
		family: "expiry",
		bindings: i
	} : /unique|collision|duplicate/.test(r) ? {
		branch: "state",
		family: "collision-uniqueness",
		bindings: i
	} : /order|sort|lexicograph/.test(r) ? {
		branch: "state",
		family: "ordering",
		bindings: i
	} : /empty/.test(r) ? {
		branch: "representation",
		family: "empty-input",
		bindings: i
	} : /boundary|zero|negative|max/.test(r) ? {
		branch: "representation",
		family: "boundary-values",
		bindings: i
	} : /unicode|emoji|utf/.test(r) ? {
		branch: "representation",
		family: "unicode",
		bindings: i
	} : Fl[e.clade?.family ?? ""] ? e.clade : {
		branch: "freeform",
		family: "freeform",
		bindings: i
	};
}
function Xl(e) {
	let t = e.clade ?? Yl(e), n = t.bindings.symbol || "fn";
	switch (t.family) {
		case "rejects-empty": return `expect(() => ${n}('')).toThrow();`;
		case "roundtrip": return `expect(${n}(${n}('abc'))).toBe(${n}('abc'));`;
		case "determinism": return `expect(${n}(1, 2)).toBe(${n}(1, 2));`;
		case "throws-on-invalid": return `expect(() => ${n}(null as unknown as string)).toThrow();`;
		case "empty-input": return `expect(() => ${n}('')).toThrow();`;
		case Il: return `expect(() => new ${n}({})).not.toThrow();\nexpect(new ${n}({})).toBeInstanceOf(${n});`;
		case Ll: return `expect(${n}).toBeDefined();\nexpect(typeof ${n}).toBe('function');`;
		case Rl: return Kl(n);
		default: return null;
	}
}
function Zl(e) {
	let t = 0, n = 0;
	for (let r of e) (r.clade ?? Yl(r)).branch === "freeform" ? n++ : t++;
	return {
		schemad: t,
		freeform: n
	};
}
var Ql = "model-schema:*Model", $l = /case "([^"]+)"\s+(?:dropped|unfilled)/;
function eu(e) {
	if (!e?.length) return [];
	let t = [];
	for (let n of e) {
		let e = $l.exec(n);
		e && t.push(e[1]);
	}
	return t;
}
function tu(e) {
	return Wl(e) ? Ql : /^uses\s+/i.test(e) ? Ll : Gl(e) ? Rl : e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "freeform";
}
function nu(e, t) {
	return !e || !t ? !1 : e === t || bl(e, t) >= .5;
}
function ru(e) {
	let t = /* @__PURE__ */ new Map(), n = [];
	for (let r of e) if (r.projectId) {
		let e = t.get(r.projectId) ?? [];
		e.push(r), t.set(r.projectId, e);
	} else n.push(r);
	let r = [];
	for (let e of n) {
		let t = r.find((t) => nu(t[0].prompt, e.prompt));
		t ? t.push(e) : r.push([e]);
	}
	let i = [...t.values(), ...r];
	for (let e of i) e.sort((e, t) => (e.ts || "").localeCompare(t.ts || ""));
	return i;
}
function iu(e, t = {}) {
	let n = t.minConsecutive ?? 3, r = [];
	for (let t of ru(e)) {
		if (t.length < n) continue;
		let e = t.map((e) => {
			let t = eu(e.problems), n = /* @__PURE__ */ new Map();
			for (let e of t) n.has(tu(e)) || n.set(tu(e), e);
			return n;
		}), i = /* @__PURE__ */ new Set();
		for (let t of e) for (let e of t.keys()) i.add(e);
		for (let a of i) {
			let i = 0, o = a, s = [];
			for (let n = e.length - 1; n >= 0; n--) {
				let r = e[n].get(a);
				if (!r) break;
				i === 0 && (o = r), i++, s.unshift(t[n].id);
			}
			if (i < n) continue;
			let c = a === Ql;
			r.push(jl({
				patternKey: `family:${a}`,
				featureId: t[t.length - 1].id,
				wins: i,
				source: "cross-run-failure",
				runIds: s,
				stubSketch: c ? `export class ${o} { constructor(_fields: Record<string, unknown>) { throw new Error('stub'); } }` : void 0,
				caseBody: c ? `expect(() => new ${o}({} as never)).not.toThrow();` : void 0
			}));
		}
	}
	return r;
}
//#endregion
//#region src/tier1/planSuite.ts
var au = [
	"determinism",
	"rejects-empty",
	"roundtrip",
	"model-schema",
	"uses-dep"
];
function ou(e) {
	let t = e.toLowerCase();
	if (/round.?trip/.test(t)) return "roundtrip";
	if (/rejects?-?empty|empty\s*input|\bempty\b/.test(t) && !/boundary/.test(t)) return "rejects-empty";
	if (/determin|idempot|same\s*input|repeatable/.test(t)) return "determinism";
	if (Wl(e.trim())) return "model-schema";
}
function su(e, t) {
	let n = t.replace(/[$]/g, "\\$&");
	for (let t of e.stubs) {
		let e = RegExp(`export\\s+(?:async\\s+)?function\\s+(${n})\\s*\\(([^)]*)\\)\\s*:\\s*([^{;]+)`).exec(t.content);
		if (e) {
			let t = e[2].split(",").map((e) => e.trim()).filter(Boolean).map((e) => {
				let [t, n] = e.split(":").map((e) => e.trim());
				return {
					name: t || "arg",
					type: (n || "unknown").replace(/\s+/g, " ")
				};
			});
			return {
				name: e[1],
				params: t,
				returnType: e[3].trim()
			};
		}
		let r = RegExp(`export\\s+class\\s+(${n})\\b([^]*?)(?:\\n\\}|$)`).exec(t.content);
		if (r) {
			let e = r[2] ?? "", t = /constructor\s*\(([^)]*)\)/.exec(e), n = (t ? t[1] : "").split(",").map((e) => e.trim()).filter(Boolean).map((e) => {
				let [t, n] = e.split(":").map((e) => e.trim());
				return {
					name: t || "arg",
					type: (n || "unknown").replace(/\s+/g, " ")
				};
			});
			return {
				name: r[1],
				params: n,
				returnType: r[1]
			};
		}
	}
	return null;
}
function cu(e) {
	let t = /* @__PURE__ */ new Set(), n = /export\s+(?:async\s+)?(?:function|class|const|let|interface|type)\s+([A-Za-z_$][\w$]*)/g;
	for (let r of e.stubs) for (let e of r.content.matchAll(n)) t.add(e[1]);
	for (let n of e.exports) t.add(n.symbol);
	return [...t];
}
function lu(e, t) {
	let n = /* @__PURE__ */ new Map(), r = (e, t) => {
		let r = e.replace(/\.(ts|js)$/, "");
		n.has(r) || n.set(r, /* @__PURE__ */ new Set()), n.get(r).add(t);
	};
	for (let e of t.exports) r(e.file, e.symbol);
	for (let n of t.deps) {
		let t = e.features.find((e) => e.id === n);
		if (t) for (let e of t.exports) r(e.file, e.symbol);
	}
	return [...n.entries()].map(([e, t]) => ({
		from: e,
		symbols: [...t]
	}));
}
function uu(e, t) {
	let n = [];
	for (let e of t.exports) {
		let r = Wl(e.symbol) ? Il : void 0;
		n.push({
			name: e.symbol,
			kind: "behavior",
			license: e.symbol,
			source: "export",
			symbol: e.symbol,
			signature: su(t, e.symbol),
			cladeFamily: r
		});
	}
	let r = t.exports[0], i = r ? su(t, r.symbol) : null;
	for (let e of t.edgeCases) {
		let t = e.trim();
		if (!t) continue;
		let a = ou(t) ?? ql({
			name: t,
			kind: "edge",
			source: "edge",
			symbol: r?.symbol
		}) ?? void 0;
		n.push({
			name: t,
			kind: "edge",
			license: t,
			source: "edge",
			symbol: r?.symbol,
			signature: i,
			cladeFamily: a
		});
	}
	for (let r of t.deps) {
		let t = e.features.find((e) => e.id === r);
		t && n.push({
			name: `uses ${t.name}`,
			kind: "integration",
			license: t.id,
			source: "dep",
			symbol: t.exports[0]?.symbol,
			cladeFamily: Ll
		});
	}
	return {
		imports: lu(e, t),
		cases: n
	};
}
function du(e, t) {
	let n = cu(t);
	if (!n.length) return {
		plan: e,
		injected: null
	};
	let r = new Set(e.cases.map((e) => e.name));
	if (n.some((e) => r.has(e))) return {
		plan: e,
		injected: null
	};
	let i = n[0], a = {
		name: i,
		kind: "behavior",
		license: i,
		source: "export",
		symbol: i,
		signature: su(t, i),
		cladeFamily: Wl(i) ? Il : void 0
	};
	return {
		plan: {
			imports: e.imports,
			cases: [a, ...e.cases]
		},
		injected: a
	};
}
function fu(e, t) {
	let n = /* @__PURE__ */ new Set(/* @__PURE__ */ "expect.describe.it.test.beforeEach.afterEach.async.await.return.throw.new.typeof.instanceof.if.else.for.while.const.let.var.function.true.false.null.undefined.String.Number.Boolean.Array.Object.Error.Math.JSON.Promise.Date.toBe.toEqual.toThrow.toMatch.toContain.toBeTruthy.toBeFalsy.toBeNull.toBeUndefined.toBeDefined.toBeCloseTo.toHaveLength.toBeInstanceOf.toStrictEqual.not.resolves.rejects".split(".")), r = [], i = /(?<![\w$.])([A-Za-z_$][\w$]*)\s*\(/g, a, o = /* @__PURE__ */ new Set();
	for (; a = i.exec(e);) {
		let e = a[1];
		n.has(e) || o.has(e) || (o.add(e), t.has(e) || r.push(`undeclared symbol "${e}" — not in wiring contract`));
	}
	return r;
}
function pu(e, t) {
	let n = /* @__PURE__ */ new Set();
	for (let t of e.imports) for (let e of t.symbols) n.add(e);
	for (let e of t.exports) n.add(e.symbol);
	for (let e of t.stubs) for (let t of e.content.matchAll(/export\s+(?:async\s+)?(?:function|class|const)\s+([A-Za-z_$][\w$]*)/g)) n.add(t[1]);
	return n;
}
//#endregion
//#region src/core/providerWatch.ts
function mu(e) {
	if (!e.length) return 0;
	let t = [...e].sort((e, t) => e - t), n = Math.floor(t.length / 2);
	return t.length % 2 ? t[n] : (t[n - 1] + t[n]) / 2;
}
function hu(e, t, n) {
	return ((Number(t) || 0) + (Number(e) || 0)) / Math.max(.001, (Number(n) || 0) / 1e3);
}
function gu(e) {
	let t = Math.max(0, Math.round(e / 1e3));
	if (t < 60) return `${t}s`;
	let n = Math.floor(t / 60), r = t % 60;
	return r ? `${n}m ${r}s` : `${n}m`;
}
function _u() {
	return {
		samples: [],
		baseline: null,
		degraded: !1
	};
}
function vu(e, t) {
	if (!Number.isFinite(t) || t < 0) return null;
	if (e.samples.push(t), e.samples.length > 32 && e.samples.shift(), e.baseline == null) return e.samples.length < 5 ? null : (e.baseline = mu(e.samples.slice(0, 5)), e.baseline <= 0 && (e.baseline = t || 1), null);
	let n = e.samples.slice(-3);
	if (n.length < 3) return null;
	let r = mu(n), i = e.baseline;
	return !e.degraded && r < i * .25 ? (e.degraded = !0, `provider degraded: ${Math.round(r)} tok/s vs ${Math.round(i)} baseline — check host (GPU fallback?)`) : e.degraded && r >= i * .6 ? (e.degraded = !1, `provider recovered: ${Math.round(r)} tok/s (baseline ${Math.round(i)})`) : null;
}
function yu(e) {
	return {
		estimate: e?.estimate && e.estimate > 0 ? e.estimate : 0,
		multiplier: e?.multiplier && e.multiplier > 0 ? e.multiplier : 3,
		forcedEstimate: e?.estimate && e.estimate > 0 ? e.estimate : null,
		paused: !1,
		calls: 0,
		tokens: 0
	};
}
function bu(e, t, n = 40) {
	if (e.calls += 1, e.tokens += Math.max(0, t), e.forcedEstimate != null) e.estimate = e.forcedEstimate;
	else if (e.estimate <= 0 && e.calls >= 5) {
		let t = e.tokens / e.calls;
		e.estimate = Math.max(e.tokens, t * n);
	} else if (e.estimate > 0 && e.forcedEstimate == null) {
		let t = e.tokens * 1.15;
		t < e.estimate * e.multiplier * .5 && (e.estimate = Math.max(e.estimate, t));
	}
	if (e.estimate <= 0) return {
		pause: !1,
		message: null
	};
	let r = e.estimate * e.multiplier;
	return !e.paused && e.tokens > r ? (e.paused = !0, {
		pause: !0,
		message: "run paused: runaway token burn — Resume / Cancel"
	}) : {
		pause: e.paused,
		message: null
	};
}
function xu(e, t) {
	let n = gu(t);
	return e === "busy" ? `still generating (probed host: busy, ${n})` : e === "unreachable" ? `provider unreachable (${n}) — waiting` : `provider desync: host idle with call in-flight (${n}) — reissuing`;
}
function Su(e, t) {
	return `provider connection lost — retry ${e}/${t}`;
}
function Cu(e) {
	return `provider recovered after ${gu(e)}`;
}
var wu = 45e3, Tu = 9e4;
function Eu(e) {
	return e === "encode" ? Tu : wu;
}
function Du(e, t) {
	let n = Eu(e);
	return t == null || !Number.isFinite(t) || t <= 0 ? n : Math.max(n, 3 * t);
}
function Ou(e, t, n, r) {
	let i = Math.max(1, Math.round(Math.max(0, n) / 1e3));
	return `hang: ${e}:${(t || e).replace(/\s+/g, " ").trim().slice(0, 64)} stalled ${i}s (resolved: ${r})`;
}
//#endregion
//#region src/tier1/reportEvidence.ts
var ku = [
	{
		classKey: "assertion",
		strategy: "reset",
		findingsShare: .4,
		resolutionRate: .5
	},
	{
		classKey: "throw-mismatch",
		strategy: "oracle-hint",
		findingsShare: .25,
		resolutionRate: .6
	},
	{
		classKey: "mock-API",
		strategy: "mechanical",
		findingsShare: .15,
		resolutionRate: 0
	},
	{
		classKey: "transpile",
		strategy: "oracle-hint",
		findingsShare: .08,
		resolutionRate: .55
	},
	{
		classKey: "surgery",
		strategy: "surgery",
		findingsShare: .12,
		resolutionRate: .7
	}
];
function Au(e) {
	return `seam-dump: ${e.leftPath} ⨝ ${e.rightPath} · «${e.snippet}»`;
}
function ju(e, t) {
	let n = [...e, t].map((e) => `${e.path}\0${e.content}`).join("\n"), r = 2166136261;
	for (let e = 0; e < n.length; e++) r ^= n.charCodeAt(e), r = Math.imul(r, 16777619);
	return (r >>> 0).toString(16).padStart(8, "0");
}
function Mu(e) {
	let t = (e.split("\n")[0] ?? "").trim();
	return !(/^crash while loading /.test(t) || /^crash while executing /.test(t) || /\bat\s+.+:\d+/.test(e) && /Invalid regular expression|is not defined|TypeError|ReferenceError/i.test(e));
}
function Nu(e) {
	let t = e.crashMessage.replace(/\s+/g, " ").trim().slice(0, 240), n = [e.miss, `crash: ${t}`];
	return e.suppressSeams || !Mu(e.crashMessage) ? n : e.seamRefHash ? (n.push(`seam-dump: (see program ${e.seamRefHash})`), n) : (e.programHash && n.push(`seam-dump-program: ${e.programHash}`), n.push(...e.seams.map(Au)), n);
}
function Pu(e, t) {
	let n = (e.split("\n")[0] ?? "unparseable").trim().slice(0, 120), r = /\((\d+):(\d+)\)/.exec(e), i;
	if (r) {
		let e = t.split("\n"), n = Math.max(0, parseInt(r[1], 10) - 1), a = Math.max(0, parseInt(r[2], 10) - 1), o = e[n] ?? t, s = Math.max(0, a - 40);
		i = o.slice(s, s + 80);
	} else i = t.replace(/\s+/g, " ").trim().slice(0, 80);
	return i ||= "(empty)", {
		firstLine: n,
		snippet: i
	};
}
function Fu(e, t) {
	let { firstLine: n, snippet: r } = Pu(e, t);
	return `dropped — unparseable: ${n} at "${r}"`;
}
function Iu(e) {
	return JSON.stringify({
		title: e.title,
		features: e.features.map((e) => ({
			id: e.id,
			name: e.name,
			description: e.description,
			deps: [...e.deps],
			edgeCases: [...e.edgeCases],
			exports: e.exports.map((e) => ({
				file: e.file,
				symbol: e.symbol
			})),
			files: [...e.files],
			testFile: e.testFile
		}))
	});
}
async function Lu(e) {
	let t = globalThis.crypto?.subtle;
	if (!t) throw Error("crypto.subtle required for SET 34c spec hash");
	let n = await t.digest("SHA-256", new TextEncoder().encode(e));
	return [...new Uint8Array(n)].map((e) => e.toString(16).padStart(2, "0")).join("").slice(0, 8);
}
function Ru(e, t) {
	return `spec: ${e} of encode output — ${t ? `matches run ${t}` : "NEW carve"}`;
}
function zu(e, t) {
	return t?.length ? t.find((t) => t.hash === e)?.runId ?? null : null;
}
function Bu(e, t) {
	let n = (e, t) => t === 0 ? 0 : Math.round(100 * e / t), r = e, i = t;
	return `buffer had templates: ${r.cases} cases, ${r.filled} filled (${n(r.filled, r.cases)}%) · no templates: ${i.cases} cases, ${i.filled} filled (${n(i.filled, i.cases)}%)`;
}
function Vu(e) {
	return `planner bypass: ${e} matching templates unused`;
}
function Hu(e, t) {
	return e.length === t.length && e.every((e, n) => {
		let r = e.replace(/\s+/g, ""), i = t[n].replace(/\s+/g, "");
		return r === i || r.startsWith(i) || i.startsWith(r);
	});
}
function Uu(e) {
	let t = e.cladeFamily ?? ql(e);
	if (t === "model-schema" || t === "uses-dep") return sl.find((e) => e.family === t) ?? null;
	let n = e.cladeFamily ?? ou(e.license);
	if (n && n !== "model-schema" && n !== "uses-dep") {
		let t = sl.filter((e) => e.family === n);
		if (e.signature) {
			let n = e.signature;
			for (let e of t) if (n.params.length === e.paramCount && Hu(n.params.map((e) => e.type), e.paramTypes)) return e;
		}
		return t[0] ?? null;
	}
	if ((e.cladeFamily === "determinism" || /determin/i.test(e.license) || /determin/i.test(e.name)) && e.signature) {
		let t = e.signature;
		for (let e of sl) {
			if (e.family !== "determinism" || t.params.length !== e.paramCount || !Hu(t.params.map((e) => e.type), e.paramTypes)) continue;
			let n = t.returnType.replace(/\s+/g, ""), r = e.returnType.replace(/\s+/g, "");
			if (!(!n.startsWith(r) && !r.startsWith(n))) return e;
		}
	}
	if (e.kind === "edge" || e.source === "edge") {
		for (let t of sl) if (au.includes(t.family) && !(t.license === "export" || t.license === "model-schema" || t.license === "uses-dep") && e.license.toLowerCase().includes(t.license.toLowerCase()) && e.signature) {
			let n = e.signature;
			if (n.params.length === t.paramCount && Hu(n.params.map((e) => e.type), t.paramTypes)) return t;
		}
	}
	return null;
}
function Wu(e, t = []) {
	if (!e.length) return 0;
	let n = /* @__PURE__ */ new Set();
	for (let t of e) {
		let e = Uu(t);
		e && n.add(e.id);
	}
	return n.size;
}
function Gu(e) {
	return `excluded — requires ${e}; not testable in this runtime`;
}
function Ku(e) {
	if (!e.length) return [];
	let t = ["## Excluded (untested — no runtime capability)", ""];
	for (let n of e) {
		let e = n.line == null ? "" : `line ${n.line} · `, r = n.partial ? "partially excluded · " : "", i = n.partial && n.clause ? n.clause : n.item;
		t.push(`- ${e}${r}**${n.capability}**: ${i}`);
	}
	return t.push("", "Note: computed-style is the sole excluded capability technically reachable in a browser runtime; others require infrastructure this product does not ship.", ""), t;
}
function qu(e) {
	return e <= 0 ? "continue-project: no prior dropped cases to replan first" : `continue-project: replan ${e} previously-dropped case${e === 1 ? "" : "s"} FIRST (coverage backfill) before new features`;
}
function Ju(e, t) {
	return `parse-poison incidents: ${e} (prior run: ${t})`;
}
function Yu(e) {
	let t = (e, t) => t === 0 ? 0 : Math.round(100 * e / t), n = [`substrate hit-rate: ${e.fixes}/${e.attempts} fixes (${t(e.fixes, e.attempts)}%) · refusals ${e.refusals} · no-handler ${e.noHandler}`];
	if (e.byStage) for (let r of Object.keys(e.byStage).sort()) {
		let i = e.byStage[r];
		n.push(`  ${r}: ${i.fixes}/${i.attempts} fixes (${t(i.fixes, i.attempts)}%)`);
	}
	return n.join("\n");
}
function Xu(e) {
	let t = e.filter((e) => e.count >= 3).slice().sort((e, t) => t.count - e.count || e.classKey.localeCompare(t.classKey)), n = ["classKey coverage: (≥3 sightings → mechanical | mechanical-candidate | semantic-impossibility; else UNCOVERED)"];
	for (let e of t) {
		let t = e.stratum ?? "uncovered", r = t === "uncovered" ? "UNCOVERED" : t, i = e.note?.trim() ? ` — ${e.note.trim()}` : "";
		n.push(`  ${e.classKey}: ${e.count} · ${r}${i}`);
	}
	return n;
}
function Zu(e = ku) {
	let t = [...e].sort((e, t) => t.resolutionRate - e.resolutionRate), n = ["solution-strata (router order by observed resolution rate):"];
	for (let e of t) {
		let t = Math.round(e.findingsShare * 100), r = Math.round(e.resolutionRate * 100);
		n.push(`  ${e.classKey}: prefer ${e.strategy} (${t}% findings @ ${r}% resolved)`);
	}
	return n;
}
async function Qu() {
	try {
		let e = await Promise.resolve().then(() => Lm), t = e.SOLUTION_STRATA ?? e.SEED_SOLUTION_STRATA ?? e.default;
		if (Array.isArray(t) && t.length && typeof t[0]?.classKey == "string") return t;
		if (Array.isArray(t) && t.length && typeof t[0]?.classFamily == "string") {
			let n = e.strategyOrderForClass;
			return t.map((e) => {
				let t = (n?.(e.classFamily) ?? Object.entries(e.resolutionByStrategy ?? {}).sort((e, t) => (t[1] ?? 0) - (e[1] ?? 0)).map(([e]) => e))[0] ?? "mechanical";
				return {
					classKey: e.classFamily,
					strategy: t,
					findingsShare: e.findingShare ?? 0,
					resolutionRate: e.resolutionByStrategy?.[t] ?? 0
				};
			});
		}
	} catch {}
	return ku;
}
//#endregion
//#region src/tier1/testExec.ts
var $u = String.raw`
const __cases = [];
const __beforeEach = [];
const __afterEach = [];
const __names = [];
// SET 35a — execution-position cursor (module + case); 0 tokens.
globalThis.__RHA_CURRENT__ = null;
function __caseName(name) { return [...__names, name].join(' > '); }
function __pushCase(name, fn, skipped) {
  const full = __caseName(name);
  __cases.push({
    name: full,
    fn: async () => {
      if (skipped) return;
      const prev = globalThis.__RHA_CURRENT__;
      globalThis.__RHA_CURRENT__ = {
        module: (prev && prev.module)
          || globalThis.__RHA_SUITE_MODULE__
          || '(suite)',
        caseName: full,
      };
      try { return await fn(); }
      finally { globalThis.__RHA_CURRENT__ = prev; }
    },
  });
}
function __fmtEachName(template, row, index) {
  if (typeof template !== 'string') return String(template) + ' [' + index + ']';
  var name = template;
  if (row && typeof row === 'object' && !Array.isArray(row)) {
    name = name.replace(/\$([A-Za-z_]\w*)/g, function (_, k) {
      return row[k] == null ? '' : String(row[k]);
    });
  } else if (Array.isArray(row)) {
    var i = 0;
    name = name.replace(/%[isdfoj]/g, function () {
      var v = row[i++];
      return v == null ? '' : String(v);
    });
  }
  return name;
}
function __eachBinder(register) {
  return function (table) {
    return function (name, fn) {
      var rows = Array.isArray(table) ? table : [];
      for (var i = 0; i < rows.length; i++) {
        (function (row, index) {
          var caseName = __fmtEachName(name, row, index);
          if (Array.isArray(row)) register(caseName, function () { return fn.apply(null, row); });
          else register(caseName, function () { return fn(row); });
        })(rows[i], i);
      }
    };
  };
}
function describe(name, fn) { __names.push(name); try { fn(); } finally { __names.pop(); } }
// SET 40e — vitest surface: .skip/.todo/.only/.each must be callable (no .call crash).
describe.skip = function (name, _fn) { /* omit body — section skipped */ };
describe.todo = function (name) { describe.skip(name, function () {}); };
describe.only = function (name, fn) { return describe(name, fn); };
describe.each = function (table) {
  return function (name, fn) {
    var rows = Array.isArray(table) ? table : [];
    for (var i = 0; i < rows.length; i++) {
      (function (row, index) {
        var caseName = __fmtEachName(name, row, index);
        if (Array.isArray(row)) describe(caseName, function () { fn.apply(null, row); });
        else describe(caseName, function () { fn(row); });
      })(rows[i], i);
    }
  };
};
function it(name, fn) { __pushCase(name, fn, false); }
it.skip = function (name, fn) { __pushCase(name, fn || function () {}, true); };
it.todo = function (name) { __pushCase(name || 'todo', function () {}, true); };
it.only = function (name, fn) { return it(name, fn); };
it.each = __eachBinder(it);
const test = it;
function beforeEach(fn) { __beforeEach.push(fn); }
function afterEach(fn) { __afterEach.push(fn); }

function __fmt(v) {
  try {
    if (typeof v === 'string') return JSON.stringify(v);
    if (v instanceof Error) return String(v);
    return JSON.stringify(v, (_k, x) => x instanceof Map ? { __map: [...x] } : x instanceof Set ? { __set: [...x] } : x);
  } catch { return String(v); }
}
function __deepEq(a, b) {
  if (Object.is(a, b)) return true;
  if (typeof a !== typeof b) return false;
  if (a == null || b == null) return a === b;
  if (typeof a !== 'object') return false;
  if (a instanceof Date || b instanceof Date) return a instanceof Date && b instanceof Date && a.getTime() === b.getTime();
  if (a instanceof Map || b instanceof Map) {
    if (!(a instanceof Map && b instanceof Map) || a.size !== b.size) return false;
    for (const [k, v] of a) { if (!b.has(k) || !__deepEq(v, b.get(k))) return false; }
    return true;
  }
  if (a instanceof Set || b instanceof Set) {
    if (!(a instanceof Set && b instanceof Set) || a.size !== b.size) return false;
    for (const v of a) { if (![...b].some(x => __deepEq(v, x))) return false; }
    return true;
  }
  if (Array.isArray(a) !== Array.isArray(b)) return false;
  const ka = Object.keys(a), kb = Object.keys(b);
  if (ka.length !== kb.length) return false;
  return ka.every(k => __deepEq(a[k], b[k]));
}
function __matchObj(actual, sub) {
  if (typeof sub !== 'object' || sub == null) return __deepEq(actual, sub);
  if (typeof actual !== 'object' || actual == null) return false;
  return Object.keys(sub).every(k => k in actual && __matchObj(actual[k], sub[k]));
}
class __Fail extends Error {}
function __throwFail(op, actual, expected) {
  throw new __Fail('expect(...).' + op + ' failed — actual: ' + __fmt(actual) + (expected === undefined ? '' : ', expected: ' + __fmt(expected)));
}
function __makeExpect(actual, negate) {
  const check = (ok, op, expected) => {
    if (negate ? ok : !ok) __throwFail((negate ? 'not.' : '') + op, actual, expected);
  };
  const m = {
    toBe: (e) => check(Object.is(actual, e), 'toBe', e),
    toEqual: (e) => check(__deepEq(actual, e), 'toEqual', e),
    toStrictEqual: (e) => check(__deepEq(actual, e), 'toStrictEqual', e),
    toBeTruthy: () => check(!!actual, 'toBeTruthy'),
    toBeFalsy: () => check(!actual, 'toBeFalsy'),
    toBeNull: () => check(actual === null, 'toBeNull'),
    toBeUndefined: () => check(actual === undefined, 'toBeUndefined'),
    toBeDefined: () => check(actual !== undefined, 'toBeDefined'),
    toBeNaN: () => check(Number.isNaN(actual), 'toBeNaN'),
    toBeInstanceOf: (e) => check(actual instanceof e, 'toBeInstanceOf', e && e.name),
    toBeGreaterThan: (e) => check(actual > e, 'toBeGreaterThan', e),
    toBeGreaterThanOrEqual: (e) => check(actual >= e, 'toBeGreaterThanOrEqual', e),
    toBeLessThan: (e) => check(actual < e, 'toBeLessThan', e),
    toBeLessThanOrEqual: (e) => check(actual <= e, 'toBeLessThanOrEqual', e),
    toBeCloseTo: (e, digits = 2) => check(Math.abs(actual - e) < Math.pow(10, -digits) / 2, 'toBeCloseTo', e),
    toHaveLength: (e) => check(actual != null && actual.length === e, 'toHaveLength', e),
    toContain: (e) => check(
      typeof actual === 'string' ? actual.includes(e)
        : actual instanceof Set ? actual.has(e)
        : Array.isArray(actual) && actual.some(x => Object.is(x, e)),
      'toContain', e),
    toContainEqual: (e) => check(Array.isArray(actual) && actual.some(x => __deepEq(x, e)), 'toContainEqual', e),
    toMatch: (e) => check(typeof actual === 'string' && (e instanceof RegExp ? e.test(actual) : actual.includes(e)), 'toMatch', e),
    toMatchObject: (e) => check(__matchObj(actual, e), 'toMatchObject', e),
    toHaveProperty: (path, value) => {
      const parts = Array.isArray(path) ? path : String(path).split('.');
      let cur = actual, present = true;
      for (const p of parts) {
        if (cur != null && (typeof cur === 'object' || typeof cur === 'function') && p in cur) cur = cur[p];
        else { present = false; break; }
      }
      const ok = present && (value === undefined || __deepEq(cur, value));
      check(ok, 'toHaveProperty', path);
    },
    toThrow: (e) => {
      if (typeof actual !== 'function') __throwFail('toThrow(non-function)', actual, e);
      let threw = false, err;
      try { actual(); } catch (x) { threw = true; err = x; }
      let ok = threw;
      if (threw && e !== undefined) {
        const msg = err instanceof Error ? err.message : String(err);
        ok = e instanceof RegExp ? e.test(msg) : typeof e === 'string' ? msg.includes(e) : true;
      }
      check(ok, 'toThrow', e);
    },
  };
  m.toThrowError = m.toThrow;
  Object.defineProperty(m, 'not', { get: () => __makeExpect(actual, !negate) });
  m.resolves = new Proxy({}, { get: (_t, k) => async (...args) => {
    const v = await actual;
    return __makeExpect(v, negate)[k](...args);
  } });
  m.rejects = new Proxy({}, { get: (_t, k) => async (...args) => {
    let err, rejected = false;
    try { await actual; } catch (x) { rejected = true; err = x; }
    if (!rejected) __throwFail('rejects', '(resolved)', undefined);
    if (k === 'toThrow' || k === 'toThrowError') {
      const msg = err instanceof Error ? err.message : String(err);
      const e = args[0];
      const ok = e === undefined ? true : e instanceof RegExp ? e.test(msg) : typeof e === 'string' ? msg.includes(e) : true;
      if (negate ? ok : !ok) __throwFail('rejects.toThrow', msg, e);
      return;
    }
    return __makeExpect(err, negate)[k](...args);
  } });
  return m;
}
function expect(actual) { return __makeExpect(actual, false); }
const vi = {
  fn: (impl) => {
    const calls = [];
    const f = (...args) => { calls.push(args); return impl ? impl(...args) : undefined; };
    f.mock = { calls };
    f.mockImplementation = (i) => { impl = i; return f; };
    f.mockReturnValue = (v) => { impl = () => v; return f; };
    return f;
  },
  spyOn: (obj, method) => {
    const original = obj[method];
    const calls = [];
    let impl = typeof original === 'function' ? original.bind(obj) : undefined;
    const f = (...args) => { calls.push(args); return impl ? impl(...args) : undefined; };
    f.mock = { calls };
    f.mockImplementation = (i) => { impl = i; return f; };
    f.mockReturnValue = (v) => { impl = () => v; return f; };
    f.mockRestore = () => { obj[method] = original; };
    obj[method] = f;
    return f;
  },
};
// SET 35d — suites that call jest.fn under vitest get a harness alias (0 tok).
const jest = vi;
// SET 37c — bare spyOn/fn in the suite sandbox (0 tok; no import required).
const fn = (...args) => vi.fn(...args);
const spyOn = (...args) => vi.spyOn(...args);
`, ed = String.raw`
function __resolve(from, spec) {
  if (spec === 'vitest') return 'vitest';
  let p = spec.replace(/\.(ts|js|mjs|cjs)$/, '');
  if (!p.startsWith('.')) return p; // bare — looked up as-is
  const base = from.split('/').slice(0, -1);
  for (const part of p.split('/')) {
    if (part === '.' || part === '') continue;
    else if (part === '..') base.pop();
    else base.push(part);
  }
  return base.join('/');
}
`;
function td(e, t) {
	try {
		return Qc(t, { transforms: ["typescript", "imports"] }).code;
	} catch (t) {
		return `throw new Error(${JSON.stringify(`transpile ${e}: ${t instanceof Error ? t.message : String(t)}`)});`;
	}
}
function nd(e, t) {
	return `;(function(){ __register(${JSON.stringify(e)}, function (require, module, exports) {
var __rhaPrev = globalThis.__RHA_CURRENT__;
globalThis.__RHA_CURRENT__ = { module: ${JSON.stringify(e)}, caseName: ( __rhaPrev && __rhaPrev.caseName) || null };
try {
${t}
} catch (__rhaE) {
  globalThis.__RHA_LAST__ = globalThis.__RHA_CURRENT__;
  throw __rhaE;
} finally {
  globalThis.__RHA_CURRENT__ = __rhaPrev;
}
}); })();`;
}
function rd(e) {
	for (let t of [
		/<anonymous>:(\d+)/,
		/eval\s*(?:at\s+[^\n]*?)?:(\d+)/,
		/\(eval[^)]*:(\d+):\d+\)/
	]) {
		let n = t.exec(e);
		if (n) return parseInt(n[1], 10);
	}
	return null;
}
function id(e, t) {
	for (let n of e) if (t >= n.startLine && t <= n.endLine) return {
		path: n.path,
		localLine: t - n.startLine + 1
	};
	return null;
}
function ad(e, t) {
	let n = [
		"\"use strict\";",
		$u,
		ed,
		String.raw`
const __registry = new Map();
const __instances = new Map();
function __register(key, factory) { __registry.set(key, factory); }
function __nl() { return String.fromCharCode(10); }
function __stackTop3(err) {
  if (!err || !err.stack) return [];
  return String(err.stack).split(__nl()).slice(1).map(function (l) { return l.trim(); }).filter(Boolean).slice(0, 3);
}
function __locateFromFrames(frames, table) {
  if (!table || !table.length) return null;
  for (var i = 0; i < frames.length; i++) {
    var m = /<anonymous>:(\d+)/.exec(frames[i]) || /:(\d+):\d+/.exec(frames[i]);
    if (!m) continue;
    var line = parseInt(m[1], 10);
    for (var j = 0; j < table.length; j++) {
      var s = table[j];
      if (line >= s.startLine && line <= s.endLine) {
        return { path: s.path, localLine: line - s.startLine + 1 };
      }
    }
  }
  return null;
}
function __formatExecCrash(err) {
  var cur = globalThis.__RHA_CURRENT__ || globalThis.__RHA_LAST__;
  var mod = (cur && cur.module) || '(unknown)';
  var caseLabel = (cur && cur.caseName) ? ('"' + cur.caseName + '"') : '"(load)"';
  var frames = __stackTop3(err);
  var msg = err instanceof Error ? err.message : String(err);
  var nl = __nl();
  var table = globalThis.__RHA_LINE_TABLE__;
  // SET 36a — load-time / cleared-cursor: map program line → file:localLine.
  if ((!cur || !cur.caseName) && (mod === '(unknown)' || !cur || !cur.caseName)) {
    var loc = __locateFromFrames(frames, table);
    if (loc) {
      var headLoad = 'crash while loading ' + loc.path + ':' + loc.localLine;
      return frames.length ? (headLoad + nl + '  ' + frames.join(nl + '  ') + nl + msg) : (headLoad + nl + msg);
    }
  }
  var head = 'crash while executing ' + mod + ' # ' + caseLabel;
  return frames.length ? (head + nl + '  ' + frames.join(nl + '  ') + nl + msg) : (head + nl + msg);
}
function __isAssertFail(e) {
  return e && e.constructor && e.constructor.name === '__Fail';
}
function __isRuntimePoison(e) {
  if (!e) return false;
  if (e.name === 'SyntaxError') return true;
  var msg = e instanceof Error ? e.message : String(e);
  return /Invalid regular expression|Invalid or unexpected token/i.test(msg);
}
function __require(from, spec) {
  const key = __resolve(from, spec);
  if (key === 'vitest') return { describe, it, test, expect, beforeEach, afterEach, vi, jest, spyOn, fn };
  if (__instances.has(key)) return __instances.get(key).exports;
  const factory = __registry.get(key);
  if (!factory) throw new Error('unresolved import ' + spec + ' (from ' + from + ')');
  const module = { exports: {} };
  __instances.set(key, module);
  factory((s) => __require(key, s), module, module.exports);
  return module.exports;
}
`
	].join("\n"), r = [], i = (e, t) => {
		let n = e.replace(/\.(ts|js)$/, "");
		r.push(nd(n, td(e, t)));
	};
	for (let t of e) i(t.path, t.content);
	i(t.path, t.content);
	let a = t.path.replace(/\.(ts|js)$/, ""), o = String.raw`
globalThis.__RHA_LINE_TABLE__ = [];
globalThis.__RHA_RUN__ = async function () {
  const failures = [];
  globalThis.__RHA_SUITE_MODULE__ = ${JSON.stringify(a)};
  globalThis.__RHA_LAST__ = null;
  try {
    __require('.', ${JSON.stringify("./" + a)});
  } catch (e) {
    return { total: 0, failures: [], crashed: __formatExecCrash(e) };
  }
  for (const c of __cases) {
    // SET 35a — set cursor in the runner loop so finally-blocks inside case
    // wrappers cannot clear it before we format a crash.
    globalThis.__RHA_CURRENT__ = {
      module: globalThis.__RHA_SUITE_MODULE__ || '(suite)',
      caseName: c.name,
    };
    try {
      for (const b of __beforeEach) await b();
      await c.fn();
      for (const a of __afterEach) await a();
    } catch (e) {
      // SET 35a — runtime-poison detonations escalate to program crash with
      // execution-position attribution (assertions stay soft failures).
      if (!__isAssertFail(e) && __isRuntimePoison(e)) {
        return { total: __cases.length, failures, crashed: __formatExecCrash(e) };
      }
      failures.push({ name: c.name, message: e instanceof Error ? e.message : String(e) });
    } finally {
      globalThis.__RHA_CURRENT__ = null;
    }
  }
  return { total: __cases.length, failures };
};
`, s = [
		n,
		r.join("\n"),
		o
	].join("\n"), c = [], l = 0;
	for (let n = 0; n < r.length; n++) {
		let i = r[n], a = s.indexOf(i, l);
		if (a < 0) continue;
		let o = s.slice(0, a).split("\n").length, u = o + i.split("\n").length - 1, d = n < e.length ? e[n].path : t.path, f = d.replace(/\.(ts|js)$/, "");
		c.push({
			path: d,
			key: f,
			startLine: o,
			endLine: u
		}), l = a + i.length;
	}
	return {
		program: s.replace(/globalThis\.__RHA_LINE_TABLE__ = \[\];/, `globalThis.__RHA_LINE_TABLE__ = ${JSON.stringify(c.map((e) => ({
			path: e.path,
			startLine: e.startLine,
			endLine: e.endLine
		})))};`),
		spans: c
	};
}
function od(e, t) {
	return ad(e, t).program;
}
function sd(e, t, n) {
	let r = e instanceof Error ? e.message : String(e), i = e instanceof Error && e.stack ? e.stack.split("\n").slice(1).map((e) => e.trim()).filter(Boolean).slice(0, 3) : [], a = [e instanceof Error ? e.stack ?? "" : "", ...i].join("\n"), o = t?.module || "(unknown)", s = t?.caseName ?? null;
	if ((!s || o === "(unknown)") && n?.length) {
		let e = rd(a), t = e == null ? null : id(n, e);
		if (t) {
			let e = `crash while loading ${t.path}:${t.localLine}`;
			return i.length ? `${e}\n  ${i.join("\n  ")}\n${r}` : `${e}\n${r}`;
		}
	}
	let c = `crash while executing ${o} # ${s ? `"${s}"` : "\"(load)\""}`;
	return i.length ? `${c}\n  ${i.join("\n  ")}\n${r}` : `${c}\n${r}`;
}
function cd(e) {
	let t = e.split("\n")[0] ?? "", n = /^crash while loading (.+):(\d+)\s*$/.exec(t);
	if (n) return {
		module: n[1],
		caseName: null,
		localLine: parseInt(n[2], 10)
	};
	let r = /^crash while executing (.+?) # "([^"]*)"/.exec(t);
	if (!r) return null;
	let i = r[2] === "(load)" ? null : r[2];
	return {
		module: r[1],
		caseName: i
	};
}
function ld(e, t) {
	try {
		return Qc(t, { transforms: ["typescript", "imports"] }), !1;
	} catch {
		return !0;
	}
}
function ud(e) {
	return e.filter((e) => !/\.test\.(ts|js)$/.test(e.path) && ld(e.path, e.content));
}
async function dd(e, t, n = "full") {
	let r = [], i = [], a = !1, o = new Set(e.map((e) => e.path));
	for (let s of e) {
		let e = [
			...t.filter((e) => e.path !== s.path && !o.has(e.path)),
			...r,
			s
		], c = Od(s.content);
		if (c) {
			i.push({
				path: s.path,
				reason: c
			});
			continue;
		}
		let l = Ad(s.content);
		if (l) {
			if (n === "build") {
				r.push(s);
				continue;
			}
			i.push({
				path: s.path,
				reason: `transpile failed: ${l.split("\n")[0].slice(0, 120)}`
			});
			continue;
		}
		if (n === "full") {
			let t = await Fd(e, s.path);
			if (t === "GATE_UNAVAILABLE") {
				a = !0, r.push(s);
				continue;
			}
			if (t) {
				i.push({
					path: s.path,
					reason: `module probe: ${t.split("\n")[0].slice(0, 120)}`
				});
				continue;
			}
		}
		r.push(s);
	}
	return {
		ok: r,
		rejected: i,
		gateUnavailable: a || void 0
	};
}
function fd(e) {
	let t = e.map((e) => nd(e.path.replace(/\.(ts|js)$/, ""), td(e.path, e.content)));
	return [
		"\"use strict\";",
		$u,
		ed,
		String.raw`
const __registry = new Map();
function __register(key, factory) { __registry.set(key, factory); }
`,
		t.join("\n")
	].join("\n");
}
var pd = "GATE_UNAVAILABLE";
function md(e) {
	if (e instanceof EvalError) return !0;
	let t = e instanceof Error ? e.message : String(e);
	return /unsafe-eval/i.test(t);
}
function hd(e) {
	return md(e) ? pd : e instanceof Error ? e.message : String(e);
}
function gd(e, t) {
	if (t) return ad(e, t).program;
	let n = e.find((e) => /\.test\.(ts|js)$/.test(e.path));
	return n ? ad(e.filter((e) => e.path !== n.path), n).program : fd(e);
}
var _d = null;
function vd(e) {
	_d = e;
}
var yd = null;
function bd(e) {
	yd = e;
}
function xd(e) {
	for (let t of e) {
		let e = Ad(t.content);
		if (e && /Unterminated regular expression/i.test(e)) return "Invalid regular expression: missing /";
	}
	return null;
}
function Sd(e, t) {
	let n = xd(e);
	if (n) return n;
	try {
		let n = gd(e, t);
		return Function(n), null;
	} catch (e) {
		return hd(e);
	}
}
async function Cd(e, t) {
	let n = xd(e);
	if (n) return n;
	let r = gd(e, t);
	if (_d) try {
		return await _d(r);
	} catch (e) {
		return hd(e);
	}
	try {
		return Function(r), null;
	} catch (e) {
		return hd(e);
	}
}
function wd(e, t) {
	return e == null ? { ok: !0 } : e === "GATE_UNAVAILABLE" ? {
		ok: !0,
		gateUnavailable: !0
	} : {
		ok: !1,
		message: e,
		event: `program-parse regression: ${t} rejected (crash: ${e})`
	};
}
async function Td(e, t) {
	return wd(await Cd(e), t);
}
async function Ed(e, t) {
	return Td(t, e.path);
}
function Dd(e, t) {
	return `program-parse|${e}|${(t.split("\n")[0] ?? t).slice(0, 80)}`;
}
function Od(e) {
	if (/\beval\s*\(/.test(e)) return "dynamic-eval: eval( is forbidden in frozen tests/impls";
	if (/\bnew\s+Function\s*\(/.test(e)) return "dynamic-eval: new Function( is forbidden in frozen tests/impls";
	let t = /\bnew\s+RegExp\s*\(\s*([^)\n]+)/g, n;
	for (; (n = t.exec(e)) !== null;) {
		let e = (n[1] ?? "").trim();
		if (e && !/^(['"`]|\/)/.test(e)) return "dynamic-eval: new RegExp( with non-literal argument is forbidden";
	}
	return null;
}
function kd(e) {
	if (!/\bjest\s*\./.test(e) && !/\bjest\b/.test(e)) return null;
	let t = e.replace(/\bjest\s*\./g, "vi.").replace(/(\{[^}]*)\bjest\b(\s*,)/g, "$1vi$2").replace(/(,\s*)\bjest\b(\s*\})/g, "$1vi$2").replace(/import\s*\{\s*jest\s*\}\s*from\s*['"]vitest['"]/, "import { vi } from 'vitest'").replace(/import\s*\{\s*([^}]*)\bjest\b([^}]*)\}\s*from\s*['"]vitest['"]/, (e, t, n) => `import { ${`${t}vi${n}`.replace(/,\s*,/g, ",").replace(/^\s*,|,\s*$/g, "")} } from 'vitest'`);
	return t === e ? null : t;
}
function Ad(e) {
	try {
		return Qc(e, { transforms: ["typescript", "imports"] }), null;
	} catch (e) {
		return e instanceof Error ? e.message : String(e);
	}
}
function jd(e) {
	return e.flatMap((e) => {
		try {
			return Qc(`async function __t() {
${e.body}
}`, { transforms: ["typescript"] }), [];
		} catch (t) {
			return [{
				name: e.name,
				error: t instanceof Error ? t.message : String(t)
			}];
		}
	});
}
function Md() {
	return async (e, t) => {
		let { program: n, spans: r } = ad(e, t), i = globalThis;
		delete i.__RHA_RUN__, delete i.__RHA_LINE_TABLE__, delete i.__RHA_LAST__;
		try {
			Function(n)();
		} catch (e) {
			return md(e) ? {
				total: 0,
				failures: [],
				crashed: pd
			} : {
				total: 0,
				failures: [],
				crashed: sd(e, null, r)
			};
		}
		let a = i.__RHA_RUN__;
		if (!a) return {
			total: 0,
			failures: [],
			crashed: "program did not define __RHA_RUN__"
		};
		try {
			return await a();
		} finally {
			delete i.__RHA_RUN__, delete i.__RHA_LINE_TABLE__, delete i.__RHA_LAST__;
		}
	};
}
function Nd(e, t) {
	let n = t.replace(/\.(ts|js)$/, ""), r = [], i = (e, t) => {
		let n = e.replace(/\.(ts|js)$/, "");
		r.push(nd(n, td(e, t)));
	};
	for (let t of e) i(t.path, t.content);
	return [
		"\"use strict\";",
		$u,
		ed,
		String.raw`
const __registry = new Map();
const __instances = new Map();
function __register(key, factory) { __registry.set(key, factory); }
function __require(from, spec) {
  const key = __resolve(from, spec);
  if (key === 'vitest') return { describe, it, test, expect, beforeEach, afterEach, vi, jest, spyOn, fn };
  if (__instances.has(key)) return __instances.get(key).exports;
  const factory = __registry.get(key);
  if (!factory) throw new Error('unresolved import ' + spec + ' (from ' + from + ')');
  const module = { exports: {} };
  __instances.set(key, module);
  factory((s) => __require(key, s), module, module.exports);
  return module.exports;
}
`,
		r.join("\n"),
		`globalThis.__RHA_PROBE__ = function () {
  try { __require('.', ${JSON.stringify("./" + n)}); return null; }
  catch (e) { return e instanceof Error ? e.message : String(e); }
};`
	].join("\n");
}
function Pd(e, t) {
	let n = Nd(e, t), r = globalThis;
	delete r.__RHA_PROBE__;
	try {
		Function(n)();
		let e = r.__RHA_PROBE__;
		return e ? e() : "probe did not define __RHA_PROBE__";
	} catch (e) {
		return hd(e);
	} finally {
		delete r.__RHA_PROBE__;
	}
}
async function Fd(e, t) {
	let n = Nd(e, t);
	if (yd) try {
		return await yd(n);
	} catch (e) {
		return hd(e);
	}
	return Pd(e, t);
}
function Id(e) {
	return e == null || e === "GATE_UNAVAILABLE" ? null : e;
}
var Ld = "TRACE:";
function Rd(e, t, n) {
	let r = Nd(e, t), i = t.replace(/\.(ts|js)$/, "");
	return r + String.raw`
globalThis.__RHA_PROBE__ = function () {
  const CALLS = ${JSON.stringify(n)};
  const MARK = ${JSON.stringify(Ld)};
  const out = [];
  function ser(v) {
    if (typeof v === 'function') return '(function)';
    if (v && typeof v.then === 'function') return '(promise)';
    if (typeof v === 'bigint') return String(v) + 'n';
    try {
      const s = JSON.stringify(v, function (k, x) {
        if (typeof x === 'function') return '(function)';
        if (typeof x === 'bigint') return String(x) + 'n';
        return x;
      });
      return String(s).slice(0, 80);
    } catch (e) { return '(unserializable)'; }
  }
  let mod;
  try { mod = __require('.', ${JSON.stringify("./" + i)}); }
  catch (e) {
    return MARK + JSON.stringify([{ call: '(module load)', outcome: 'threw ' + (e && e.message ? e.message : String(e)).slice(0, 120) }]);
  }
  for (const c of CALLS) {
    const call = c.symbol + '(' + c.argsSrc + ')';
    try {
      const args = (0, eval)('[' + c.argsSrc + ']');
      const fn = mod[c.symbol];
      if (typeof fn !== 'function') { out.push({ call: call, outcome: 'is not a function (' + typeof fn + ')' }); continue; }
      out.push({ call: call, outcome: '→ ' + ser(fn.apply(null, args)) });
    } catch (e) {
      out.push({ call: call, outcome: '→ threw ' + (e && e.message ? e.message : String(e)).slice(0, 120) });
    }
  }
  return MARK + JSON.stringify(out);
};`;
}
function zd(e) {
	if (!e || !e.startsWith(Ld)) return null;
	try {
		let t = JSON.parse(e.slice(6));
		return Array.isArray(t) ? t : null;
	} catch {
		return null;
	}
}
function Bd(e, t, n) {
	if (!n.length) return null;
	let r = Rd(e, t, n), i = globalThis;
	delete i.__RHA_PROBE__;
	try {
		Function(r)();
		let e = i.__RHA_PROBE__;
		return e ? zd(e()) : null;
	} catch {
		return null;
	} finally {
		delete i.__RHA_PROBE__;
	}
}
async function Vd(e, t, n) {
	if (!n.length) return null;
	if (yd) try {
		return zd(await yd(Rd(e, t, n)));
	} catch {
		return null;
	}
	return Bd(e, t, n);
}
function Hd(e) {
	let t = e.split("\n")[0] ?? "";
	return /^crash while (?:executing|loading) /.test(t) && e.split("\n").filter((e) => !/^crash while (?:executing|loading) /.test(e) && !/^\s*at\s/.test(e)).join("\n").trim() || e;
}
function Ud(e, t) {
	let n = Hd(e), r = Hd(t);
	if (/Invalid regular expression/i.test(n) && /Invalid regular expression/i.test(r)) return !0;
	let i = /Identifier '([A-Za-z_$][\w$]*)' has already been declared/i.exec(n), a = /Identifier '([A-Za-z_$][\w$]*)' has already been declared/i.exec(r);
	return i && a ? i[1] === a[1] : n.split("\n")[0].slice(0, 60) === r.split("\n")[0].slice(0, 60);
}
function Wd(e) {
	for (let t of e) {
		if (/\.test\.(ts|js)$/.test(t.path)) continue;
		let n = Id(Pd(e, t.path));
		if (n) return n;
	}
	return null;
}
function Gd(e, t) {
	let n = new Map(e.map((e) => [e.path.replace(/\.(ts|js)$/, ""), e])), r = /* @__PURE__ */ new Map(), i = (t) => {
		if (r.has(t)) return;
		let a = e.find((e) => e.path === t);
		if (!a) return;
		r.set(t, a);
		let o = t.replace(/\.(ts|js)$/, "");
		for (let e of a.content.matchAll(/from\s+['"](\.[^'"]+)['"]/g)) {
			let t = e[1].replace(/\.(ts|js)$/, ""), r = o.includes("/") ? o.slice(0, o.lastIndexOf("/")) : "", a = t;
			if (t.startsWith("./")) a = r ? `${r}/${t.slice(2)}` : t.slice(2);
			else if (t.startsWith("../")) {
				let e = t.match(/^(?:\.\.\/)+/)[0].length / 3, n = t.replace(/^(?:\.\.\/)+/, ""), i = r.split("/").filter(Boolean);
				a = [...i.slice(0, Math.max(0, i.length - e)), n].join("/");
			}
			let s = n.get(a);
			s && i(s.path);
		}
	};
	return i(t), [...r.values()];
}
function Kd(e, t, n) {
	let r = [...e, t], i = /* @__PURE__ */ new Set(), a = ud(e);
	if (a.length === 1) return { file: a[0].path };
	let o = cd(n);
	if (o?.localLine != null && o.module) {
		let e = o.module.endsWith(".ts") || o.module.endsWith(".js") ? o.module : `${o.module}.ts`, t = r.find((t) => t.path === e || t.path.replace(/\.(ts|js)$/, "") === o.module);
		if (t) return { file: t.path };
	}
	let s = rd(n);
	if (s != null) {
		let { spans: n } = ad(e, t), i = id(n, s);
		if (i) {
			let e = r.find((e) => e.path === i.path);
			if (e) return { file: e.path };
		}
	}
	if (a.length > 1) {
		if (o?.module && o.module !== "(unknown)") {
			let e = o.module.endsWith(".ts") || o.module.endsWith(".js") ? o.module : `${o.module}.ts`, t = a.find((t) => t.path === e || t.path.replace(/\.(ts|js)$/, "") === o.module);
			if (t) return { file: t.path };
		}
		return { file: a[0].path };
	}
	if (o?.module && o.module !== "(unknown)" && o.module !== "(suite)") {
		let e = o.module.endsWith(".ts") || o.module.endsWith(".js") ? o.module : `${o.module}.ts`, t = r.find((t) => t.path === e || t.path.replace(/\.(ts|js)$/, "") === o.module);
		if (t) {
			i.add(t.path);
			let e = Pd(Gd(r, t.path), t.path);
			if (!e || Ud(e, n) || o.caseName) return { file: t.path };
		}
	}
	let c = (e) => {
		i.add(e.path);
		let t = Gd(r, e.path), a = Pd(t.length ? t : [e], e.path);
		if (a && Ud(a, n)) return !0;
		if (a != null && /^unresolved import /.test(a)) {
			let t = Pd(r, e.path);
			if (t && Ud(t, n)) return !0;
		}
		return !1;
	};
	for (let t of e) if (c(t)) return { file: t.path };
	if (c(t)) return { file: t.path };
	let l = r.map((e) => e.path), u = l.filter((e) => !i.has(e)), d = u.length ? u.join(", ") : "none (all probed clean)";
	return {
		file: null,
		miss: `attribution-miss: program crashed, ${i.size}/${l.length} probes clean — probe set diff: ${d}`
	};
}
function qd(e, t, n) {
	return Kd(e, t, n).file;
}
function Jd(e, t) {
	if (e.length < 2 || t([e[0]]) != null) return null;
	let n = t(e);
	if (n == null) return null;
	let r = 1, i = e.length;
	for (; i - r > 1;) {
		let n = r + i >>> 1;
		t(e.slice(0, n)) == null ? r = n : i = n;
	}
	return {
		left: r - 1,
		right: r,
		leftCleanPrefix: e.slice(0, r),
		crashMessage: n
	};
}
function Yd(e) {
	let t = e.map((e) => `__register(${JSON.stringify(e.key)}, function (require, module, exports) {\n${e.js}\n});`).join("\n");
	return [
		"\"use strict\";",
		$u,
		ed,
		String.raw`
const __registry = new Map();
const __instances = new Map();
function __register(key, factory) { __registry.set(key, factory); }
`,
		t
	].join("\n");
}
function Xd(e, t, n, r) {
	let i = [...e, t];
	if (i.length < 2) return null;
	let a = i.map((e) => ({
		path: e.path,
		key: e.path.replace(/\.(ts|js)$/, ""),
		js: td(e.path, e.content)
	})), o = (e) => {
		try {
			return Function(Yd(e)), null;
		} catch (e) {
			return hd(e);
		}
	}, s = Jd(a, o);
	if (!s) return null;
	let c = i[s.left], l = i[s.right], u = s.crashMessage, d = `boundary-fault: ${c.path} ⨝ ${l.path}`;
	if (!r) return {
		pair: [c.path, l.path],
		event: d
	};
	let f = (e) => {
		let n = i.map((t) => {
			let n = e.find((e) => e.path === t.path);
			return n ? {
				path: t.path,
				content: n.content
			} : t;
		}), r = Pd(n, t.path);
		if (r && Ud(r, u)) return !1;
		let a = n.map((e) => ({
			path: e.path,
			key: e.path.replace(/\.(ts|js)$/, ""),
			js: td(e.path, e.content)
		})), s = o(a);
		return !(s && Ud(s, u));
	}, p = r(c.content, u), m = r(l.content, u), h = (e, t, n) => ({
		path: e.path,
		content: t.content,
		note: `delimiter oracle seam-heal (${t.classKey}, ${t.edits} edit${t.edits === 1 ? "" : "s"}) on ${e.path} ${n}`
	});
	if (p) {
		let e = h(c, p, "tail");
		if (f([e])) return {
			pair: [c.path, l.path],
			fixes: [e],
			event: d
		};
	}
	if (m) {
		let e = h(l, m, "head");
		if (f([e])) return {
			pair: [c.path, l.path],
			fixes: [e],
			event: d
		};
	}
	if (p && m) {
		let e = [h(c, p, "tail"), h(l, m, "head")];
		if (f(e)) return {
			pair: [c.path, l.path],
			fixes: e,
			event: d
		};
	}
	return {
		pair: [c.path, l.path],
		event: d
	};
}
function Zd(e, t, n) {
	let r = n?.radius ?? 120, i = n?.isolated !== !1, a = [...e, t];
	if (a.length < 2) return [];
	let o = a.map((e) => {
		let t = e.path.replace(/\.(ts|js)$/, ""), n = td(e.path, e.content);
		return i ? nd(t, n) : `__register(${JSON.stringify(t)}, function (require, module, exports) {\n${n}\n});`;
	}), s = o.join("\n"), c = [], l = 0;
	for (let e = 0; e < o.length - 1; e++) {
		l += o[e].length;
		let t = Math.max(0, l - r), n = Math.min(s.length, l + 1 + r), i = s.slice(t, n);
		t > 0 && (i = "…" + i), n < s.length && (i += "…"), c.push({
			leftPath: a[e].path,
			rightPath: a[e + 1].path,
			snippet: i
		}), l += 1;
	}
	return c;
}
function Qd(e, t) {
	return il(e, (t) => {
		let n = Sd(t.map((t) => e.find((e) => e.path === t.path)).filter((e) => !!e));
		return n === "GATE_UNAVAILABLE" ? null : n;
	}, t);
}
function $d(e, t, n) {
	if (!n) return !1;
	let r = [...e, t];
	return r.every((e) => Pd(r, e.path) == null);
}
function ef(e, t, n) {
	if (!$d(e, t, n)) return null;
	let r = Qd([...e, t], n);
	return /^minimal failing set:|^ddmin-failure/.test(r.event) ? r : {
		set: [],
		event: rl("emission contract violated")
	};
}
function tf(e, t, n, r) {
	let i = ol(e, t, n, r);
	return i.length === 0 ? [] : Sd(e.map((e) => {
		let t = i.find((t) => t.path === e.path);
		return t ? {
			path: e.path,
			content: t.content
		} : e;
	})) == null ? i : i.filter((t) => {
		let n = e.map((e) => e.path === t.path ? {
			path: t.path,
			content: t.content
		} : e), r = Sd(e), i = Sd(n);
		return r != null && i == null;
	});
}
function nf(e) {
	return e.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/[^\n]*/g, "$1").replace(/\s+/g, " ").trim();
}
function rf(e) {
	return af(e.map((e) => `${e.path}\n${e.content}`).join("\n\0\n"));
}
function af(e) {
	let t = nf(e), n = 2166136261;
	for (let e = 0; e < t.length; e++) n ^= t.charCodeAt(e), n = Math.imul(n, 16777619);
	return `${(n >>> 0).toString(16).padStart(8, "0")}-${t.length.toString(36)}`;
}
function of(e, t, n) {
	return t.has(e) ? "run" : n.has(e) ? "meta" : null;
}
function sf(e, t) {
	return `corpse detected [${e || "unclassified"}]: identical draw rejected without execution (${t === "run" ? "this run" : "metasupercache"}) — forced escalation`;
}
//#endregion
//#region src/tier1/exhibit.ts
var cf = "flawed exhibit — evidence of the defect, not a base to patch; produce the correct node from the contract";
function lf(e, t) {
	let n = t.replace(/^.*\//, "").replace(/\./g, "\\."), r = RegExp(`${n}:(\\d+)`).exec(e);
	if (r) return parseInt(r[1], 10);
	let i = /\bline (\d+)\b/.exec(e);
	return i ? parseInt(i[1], 10) : null;
}
function uf(e, t) {
	let n = e.split("\n");
	if (t < 1 || t > n.length) return null;
	let r = t - 1;
	for (let e = t - 1; e >= 0; e--) if (/(^|\s)(export\s+)?(async\s+)?function\s|=>\s*\{|(^|\s)const\s+\w+\s*=|(^|\s)class\s+\w+/.test(n[e])) {
		r = e;
		break;
	}
	let i = 0, a = t - 1, o = !1;
	for (let e = r; e < n.length; e++) {
		for (let t of n[e]) t === "{" ? (i++, o = !0) : t === "}" && i--;
		if (a = e, o && i <= 0 || e - r > 24) break;
	}
	let s = n.slice(r, a + 1).join("\n").trim();
	return s ? ff(s) : null;
}
function df(e, t) {
	let n = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), r = RegExp(`(export\\s+)?(async\\s+)?(function\\s+${n}\\s*\\(|const\\s+${n}\\s*[:=]|class\\s+${n}\\b|${n}\\s*\\([^)]*\\)\\s*\\{)`).exec(e);
	if (!r) return null;
	let i = e.lastIndexOf("\n", r.index) + 1, a = 0, o = !1, s = e.length;
	for (let t = r.index; t < e.length; t++) {
		let n = e[t];
		if (n === "{") a++, o = !0;
		else if (n === "}") {
			if (a--, o && a <= 0) {
				s = t + 1;
				break;
			}
		} else if (!o && (n === ";" || n === "\n") && t > r.index + r[0].length) {
			s = t + 1;
			break;
		}
	}
	return ff(e.slice(i, s).trim());
}
function ff(e) {
	return e.length > 300 ? `${e.slice(0, 300)}…` : e;
}
function pf(e) {
	let t = e.cls, n = t?.detail.file && !/\.test\./.test(t.detail.file) ? t.detail.file : e.fallbackFile ?? null, r = n ? e.files.find((e) => e.path === n) ?? null : null;
	if (r && t) {
		let e = lf(t.message, r.path);
		if (e != null) {
			let t = uf(r.content, e);
			if (t) return mf(`[${r.path}:${e}]\n${t}`, "position");
		}
	}
	let i = t?.detail.symbol ?? e.symbol ?? null;
	if (i) {
		for (let t of r ? [r] : e.files) {
			let e = df(t.content, i);
			if (e) return mf(`[${t.path} · ${i}]\n${e}`, "symbol-span");
		}
		return mf(`symbol "${i}" is provably absent from ${r?.path ?? e.files.map((e) => e.path).join(", ") ?? "(no artifact)"}`, "symbol-absent");
	}
	return null;
}
function mf(e, t) {
	return {
		text: `Page exhibit — ${cf}:\n${e}`,
		hash: af(e),
		source: t
	};
}
function hf(e) {
	return e === "assertion" || e === "throw-mismatch" || e === "catalog-drift";
}
function gf(e) {
	if (e.includes("(") || e.includes("`")) return !1;
	let t = e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g, "\"\"");
	for (let e of t.matchAll(/[A-Za-z_$][\w$]*/g)) {
		let n = e[0];
		if ([
			"true",
			"false",
			"null",
			"undefined",
			"NaN",
			"Infinity"
		].includes(n)) continue;
		let r = t.slice(e.index + n.length);
		if (!/^\s*:/.test(r)) return !1;
	}
	return !0;
}
function _f(e, t, n = 6) {
	let r = [], i = /* @__PURE__ */ new Set();
	for (let a of t) {
		let t = a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = RegExp(`(?<![\\w$.])${t}\\s*\\(`, "g");
		for (let t of e.matchAll(o)) {
			let o = 1, s = t.index + t[0].length, c = s;
			for (; c < e.length && o > 0; c++) {
				let t = e[c];
				t === "(" ? o++ : t === ")" && o--;
			}
			if (o !== 0) continue;
			let l = e.slice(s, c - 1).trim(), u = `${a}(${l})`;
			if (!(i.has(u) || !gf(l)) && (i.add(u), r.push({
				symbol: a,
				argsSrc: l
			}), r.length >= n)) return r;
		}
	}
	return r;
}
var vf = "Page trace — observed values at the symbol boundary (deterministic replay of the failing case’s calls):";
function yf(e) {
	if (!e || !e.length) return null;
	let t = "";
	for (let n of e) {
		let e = `${t}${t ? "\n" : ""}${n.call} ${n.outcome}`;
		if (e.length > 400) break;
		t = e;
	}
	return t ? `${vf}\n${t}` : null;
}
//#endregion
//#region src/tier1/grammar.ts
var bf = (e) => `⟨${e}⟩`, xf = {
	existence: `expect(typeof SYM(${bf("ARGS")})).toBe(${bf("EXPECT")});`,
	determinism: `expect(SYM(${bf("ARGS")})).toEqual(SYM(${bf("ARGS")}));`,
	idempotence: `expect(SYM(SYM(${bf("ARGS")}))).toEqual(SYM(${bf("ARGS")}));`,
	boundary: `expect(SYM(${bf("ARGS")})).toEqual(${bf("EXPECT")});`,
	rejection: `expect(() => SYM(${bf("ARGS")})).toThrow();`,
	"error-contract": `expect(() => SYM(${bf("ARGS")})).toThrow(${bf("EXPECT")});`,
	ordering: `expect(SYM(${bf("ARGS")})).toEqual(${bf("EXPECT")});`,
	"referential-integrity": `const input = ${bf("ARGS")};\nexpect(SYM(input)).not.toBe(input);`,
	"state-transition": `expect(SYM(${bf("ARGS")})).toEqual(${bf("EXPECT")});\nexpect(SYM(${bf("ARGS2")})).toEqual(${bf("EXPECT2")});`,
	roundtrip: `expect(SYM(${bf("ARGS")})).toEqual(${bf("EXPECT")});`,
	"uses-dep": `expect(SYM(${bf("ARGS")})).toEqual(${bf("EXPECT")});`,
	"rate-window": [
		"let now = 0;",
		"const clock = () => now;",
		`const limited = SYM(${bf("ARGS")}, clock);`,
		`expect(limited(${bf("KEY")})).toEqual(${bf("EXPECT")});`,
		`now += ${bf("ADVANCE")};`,
		`expect(limited(${bf("KEY")})).toEqual(${bf("EXPECT2")});`
	].join("\n")
};
function Sf(e) {
	let t = `${e.name} ${e.license ?? ""}`.toLowerCase(), n = [];
	return /rate.?limit|sliding\s+window|throttl|per\s+(second|minute|hour|day)/.test(t) && n.push("rate-window"), /throw|invalid|reject|error|fail|refuse/.test(t) && n.push("rejection", "error-contract"), /idempotent|twice|re-appl|stable under/.test(t) && n.push("idempotence"), /sort|order|sequence|rank/.test(t) && n.push("ordering"), /determinis|same input|consistent|repeatab/.test(t) && n.push("determinism"), /clone|copy|mutat|immutab|reference/.test(t) && n.push("referential-integrity"), /round.?trip|encode.*decode|parse.*format/.test(t) && n.push("roundtrip"), /state|transition|then|after/.test(t) && /sequence|second|next/.test(t) && n.push("state-transition"), e.kind === "edge" && n.push("boundary"), n.push("boundary"), [...new Set(n)];
}
function Cf(e, t) {
	let n = xf[e].replace(/SYM/g, t);
	return {
		invariant: e,
		symbol: t,
		body: n,
		holes: [...n.matchAll(/⟨([A-Z0-9]+)⟩/g)].map((e) => e[1])
	};
}
function wf(e) {
	return [`Synthesis grammar — invariant "${e.invariant}". Emit EXACTLY this skeleton with each ⟨HOLE⟩ replaced by a literal value; every other character verbatim. No imports, no prose.`, e.body].join("\n");
}
function Tf(e, t) {
	let n = (e) => {
		let n = t.body.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s*").replace(/(\\\(|\\\)|\\\.|;|,)/g, (e) => `\\s*${e}\\s*`).replace(/⟨([A-Z0-9]+)⟩/g, "([\\s\\S]{1,160}?)"), r = RegExp(`^${n}$`).exec(e.trim());
		if (!r) return { miss: "shape-mismatch" };
		let i = {};
		for (let e = 0; e < t.holes.length; e++) {
			let n = t.holes[e], a = (r[e + 1] ?? "").trim();
			if (!a || !gf(a)) return { miss: "non-literal-fill" };
			if (i[n] != null && i[n] !== a) return { miss: "inconsistent-fill" };
			i[n] = a;
		}
		let a = t.body;
		for (let [e, t] of Object.entries(i)) a = a.split(`⟨${e}⟩`).join(t);
		return {
			fills: i,
			body: a
		};
	}, r = n(e);
	if ("body" in r) return {
		fills: r.fills,
		setup: [],
		body: r.body
	};
	let i = e.split("\n").map((e) => e.trim()).filter(Boolean);
	if (i.length > 1) {
		let e = i[i.length - 1], t = n(e);
		if ("body" in t) {
			let e = i.slice(0, -1);
			return {
				fills: t.fills,
				setup: e,
				body: [...e, t.body].join("\n")
			};
		}
	}
	return null;
}
function Ef(e, t) {
	return `grammar: case "${e}" conformed to ${t} skeleton (holes-only, reassembled)`;
}
//#endregion
//#region src/tier1/shellLock.ts
function Df(e) {
	let t = [];
	for (let n of e.matchAll(/export\s+(?:async\s+)?function\s+([A-Za-z_$][\w$]*)\s*\(/g)) {
		let r = n.index, i = e.indexOf("{", r);
		if (i < 0) continue;
		let a = 0, o = -1;
		for (let t = i; t < e.length; t++) {
			let n = e[t];
			if (n === "{") a++;
			else if (n === "}" && (a--, a === 0)) {
				o = t;
				break;
			}
		}
		o < 0 || t.push({
			symbol: n[1],
			head: e.slice(r, i).trimEnd(),
			body: e.slice(i + 1, o),
			start: r,
			end: o + 1
		});
	}
	return t;
}
function Of(e) {
	let t = Df(e.content);
	if (!t.length) return null;
	let n = e.content;
	for (let e of [...t].sort((e, t) => t.start - e.start)) n = n.slice(0, e.start) + n.slice(e.end);
	return {
		path: e.path,
		header: n.trim(),
		slots: t.map((e) => ({
			symbol: e.symbol,
			head: e.head,
			stubBody: e.body.trim()
		}))
	};
}
function kf(e, t) {
	let n = Df(e).find((e) => e.symbol === t);
	if (n) return n.body.trim();
	let r = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), i = RegExp(`(?:export\\s+)?const\\s+${r}\\s*=[^=>{;\\n]*=>\\s*`).exec(e);
	if (i) {
		let t = i.index + i[0].length;
		if (e[t] === "{") {
			let n = 0;
			for (let r = t; r < e.length; r++) if (e[r] === "{") n++;
			else if (e[r] === "}" && (n--, n === 0)) return e.slice(t + 1, r).trim();
			return null;
		}
		let n = e.indexOf(";", t), r = e.slice(t, n < 0 ? void 0 : n).trim();
		return r ? `return ${r};` : null;
	}
	return null;
}
var Af = /^\s*import\s+(?:type\s+)?(?:[\w${},*\s]+\s+from\s+)?['"][^'"\n]+['"]\s*;?\s*$/;
function jf(e) {
	let t = [], n = /* @__PURE__ */ new Set();
	for (let r of e.split("\n")) {
		if (!Af.test(r)) continue;
		let e = r.trim();
		n.has(e) || (n.add(e), t.push(e));
	}
	return t;
}
function Mf(e) {
	let t = [], n = {
		")": "(",
		"]": "[",
		"}": "{"
	}, r = null;
	for (let i = 0; i < e.length; i++) {
		let a = e[i];
		if (r) {
			if (a === "\\") {
				i++;
				continue;
			}
			a === r && (r = null);
			continue;
		}
		if (a === "'" || a === "\"" || a === "`") {
			r = a;
			continue;
		}
		if (a === "(" || a === "[" || a === "{") {
			t.push(a);
			continue;
		}
		if ((a === ")" || a === "]" || a === "}") && t.pop() !== n[a]) return !1;
	}
	return t.length === 0 && r == null;
}
function Nf(e, t, n) {
	let r = [], i = /* @__PURE__ */ new Set();
	for (let a of e.matchAll(/^(?:export\s+)?(?:declare\s+)?(?:async\s+)?(function|class|const|let|var|type|interface|enum)\s+([A-Za-z_$][\w$]*)/gm)) {
		let o = a[1], s = a[2];
		if (t.has(s) || i.has(s)) continue;
		let c = a.index, l, u = e.indexOf("{", c), d = e.indexOf(";", c), f = e.indexOf("\n", c);
		if ((o === "function" || o === "class" || o === "interface" || o === "enum") && u >= 0 && (d < 0 || u < d)) {
			let t = 0;
			l = e.length;
			for (let n = u; n < e.length; n++) if (e[n] === "{") t++;
			else if (e[n] === "}" && (t--, t === 0)) {
				l = n + 1;
				break;
			}
		} else if (u >= 0 && d >= 0 && u < d && o !== "type") {
			let t = 0;
			l = e.length;
			for (let n = u; n < e.length; n++) if (e[n] === "{") t++;
			else if (e[n] === "}" && (t--, t === 0)) {
				l = Math.min(n + 2, e.length);
				break;
			}
		} else l = d >= 0 ? d + 1 : f >= 0 ? f : e.length;
		let p = e.slice(c, l).trim();
		if (p) {
			if (!Mf(p)) {
				n?.push(s);
				continue;
			}
			i.add(s), r.push({
				symbol: s,
				text: p
			});
		}
	}
	return r;
}
function Pf(e, t) {
	let n = [], r = [], i = jf(t).filter((t) => !e.header.includes(t));
	i.length && r.push(i.join("\n")), e.header && r.push(e.header);
	let a = new Set(e.slots.map((e) => e.symbol)), o = [], s = Nf(t, a, o).filter((t) => !e.header.includes(t.text));
	for (let e of s) r.push(e.text);
	for (let i of e.slots) {
		let e = kf(t, i.symbol);
		e ?? n.push(i.symbol);
		let a = (e ?? i.stubBody).split("\n").map((e) => e.trim() ? `  ${e.replace(/^ {0,4}/, "")}` : e).join("\n");
		r.push(`${i.head} {\n${a}\n}`);
	}
	return {
		content: `${r.join("\n\n")}\n`,
		missing: n,
		dropped: o
	};
}
function Ff(e, t) {
	return `shell-lock: ${e} — parse poison PREVENTED at the frame: dropped unbalanced declaration(s) [${t.join(", ")}] (0 tok)`;
}
function If(e, t) {
	return `shell-lock: ${e} re-emitted through deterministic frame (${t} slot${t === 1 ? "" : "s"}, draw bodies only)`;
}
function Lf(e, t) {
	return `shell-lock: ${e} — draw missing bodies [${t.join(", ")}]; stub bodies kept for those slots`;
}
//#endregion
//#region src/tier1/supergit.ts
var Rf = "step,id,type,feature_id,parent_id,cause_id,edge_from,edge_to,artifact_path,bug_class,status,summary,ts";
function zf(e) {
	if (e == null) return "";
	let t = String(e);
	return /[",\n]/.test(t) ? `"${t.replace(/"/g, "\"\"")}"` : t;
}
function Bf(e) {
	return [
		e.step,
		e.id,
		e.type,
		e.featureId,
		e.parentId,
		e.causeId,
		e.edgeFrom,
		e.edgeTo,
		e.artifactPath,
		e.bugClass,
		e.status,
		e.summary,
		e.ts
	].map(zf).join(",");
}
var Vf = class {
	clock;
	step = 0;
	rows = [];
	lastByFeature = /* @__PURE__ */ new Map();
	testNode = /* @__PURE__ */ new Map();
	codeNode = /* @__PURE__ */ new Map();
	constructor(e = () => (/* @__PURE__ */ new Date()).toISOString()) {
		this.clock = e, this.recordNode({
			type: "genesis",
			summary: "supergit substrate initialized (tier 1)"
		});
	}
	nextId() {
		return this.step += 1, `N${String(this.step).padStart(4, "0")}`;
	}
	recordNode(e) {
		let t = this.nextId(), n = e.featureId ?? null, r = {
			step: this.step,
			id: t,
			type: e.type,
			featureId: n,
			parentId: e.parentId ?? (n ? this.lastByFeature.get(n) ?? null : null),
			causeId: e.causeId ?? null,
			edgeFrom: null,
			edgeTo: null,
			artifactPath: e.artifactPath ?? null,
			bugClass: e.bugClass ?? null,
			status: e.status ?? null,
			summary: e.summary.slice(0, 400),
			ts: this.clock()
		};
		return this.rows.push(r), n && this.lastByFeature.set(n, t), e.type === "test" && n && this.testNode.set(n, t), e.type === "code" && n && this.codeNode.set(n, t), t;
	}
	recordEdge(e, t, n = "downstream-dependency") {
		let r = this.nextId();
		return this.rows.push({
			step: this.step,
			id: r,
			type: "edge",
			featureId: null,
			parentId: null,
			causeId: null,
			edgeFrom: e,
			edgeTo: t,
			artifactPath: null,
			bugClass: null,
			status: null,
			summary: n,
			ts: this.clock()
		}), r;
	}
	testNodeFor(e) {
		return this.testNode.get(e) ?? null;
	}
	codeNodeFor(e) {
		return this.codeNode.get(e) ?? null;
	}
	lastNodeFor(e) {
		return this.lastByFeature.get(e) ?? null;
	}
	allRows() {
		return [...this.rows];
	}
	rowsForFeature(e) {
		return this.rows.filter((t) => t.featureId === e);
	}
	lineage(e, t = 8) {
		let n = new Map(this.rows.map((e) => [e.id, e])), r = [], i = n.get(e), a = /* @__PURE__ */ new Set();
		for (; i && r.length < t && !a.has(i.id);) {
			a.add(i.id), r.push(`${i.id} [${i.type}${i.featureId ? " " + i.featureId : ""}${i.bugClass ? " " + i.bugClass : ""}] ${i.summary}`);
			let e = i.causeId ?? i.parentId;
			i = e ? n.get(e) : void 0;
		}
		return r;
	}
	downstream(e) {
		return this.rows.filter((t) => t.type === "edge" && t.edgeFrom === e).map((e) => e.edgeTo).filter((e) => e != null);
	}
	toCsv() {
		return [Rf, ...this.rows.map(Bf)].join("\n") + "\n";
	}
	toGraph() {
		return {
			nodes: this.rows.filter((e) => e.type !== "edge").map((e) => ({
				id: e.id,
				step: e.step,
				type: e.type,
				featureId: e.featureId,
				parentId: e.parentId,
				causeId: e.causeId,
				status: e.status,
				bugClass: e.bugClass,
				artifactPath: e.artifactPath,
				summary: e.summary
			})),
			edges: this.rows.filter((e) => e.type === "edge").map((e) => ({
				from: e.edgeFrom,
				to: e.edgeTo
			}))
		};
	}
	toFiles() {
		return {
			".supergit/ledger.csv": this.toCsv(),
			".supergit/graph.json": JSON.stringify(this.toGraph(), null, 2)
		};
	}
	get size() {
		return this.rows.length;
	}
};
function Hf(e) {
	let t = e.allRows(), n = /* @__PURE__ */ new Map();
	for (let e of t) n.set(e.type, (n.get(e.type) ?? 0) + 1);
	let r = [...n.entries()].sort((e, t) => e[0].localeCompare(t[0])).map(([e, t]) => `${e}:${t}`);
	return `supergit: ${t.length} ledger nodes (${r.join(", ")}) — .supergit/ledger.csv + graph.json in the export`;
}
//#endregion
//#region src/tier1/nodeRepair.ts
var Uf = 3e3;
function Wf(e, t, n) {
	let r = [];
	for (let t of e.stubs ?? []) {
		for (let e of t.content.matchAll(/export\s+(?:async\s+)?function\s+([A-Za-z_$][\w$]*)\s*\(([^)]*)\)(?:\s*:\s*([^{;]+))?/g)) r.push(`${e[1]}(${e[2]})${e[3] ? `: ${e[3].trim()}` : ""}`);
		for (let e of t.content.matchAll(/export\s+class\s+([A-Za-z_$][\w$]*)/g)) r.push(`class ${e[1]}`);
		for (let e of t.content.matchAll(/export\s+const\s+([A-Za-z_$][\w$]*)\s*:\s*([^=]+)=/g)) r.push(`${e[1]}: ${e[2].trim()}`);
	}
	return {
		signatures: r,
		behaviors: (t?.cases ?? []).map((e) => ({
			name: e.name,
			assertion: e.body.replace(/\s+/g, " ").trim().slice(0, 200)
		})),
		dependencies: n.map((e) => e.path),
		path: e.files[0] ?? "(unknown)"
	};
}
function Gf(e) {
	let t = [`SCHEMA — the node at ${e.path} must satisfy ALL of the following.`];
	if (e.signatures.length) {
		t.push("Exported shape (signatures are FIXED — do not rename, do not change arity):");
		for (let n of e.signatures) t.push(`  ${n}`);
	}
	if (e.behaviors.length) {
		t.push("Required behaviors, as the frozen contract states them:");
		for (let n of e.behaviors) t.push(`  "${n.name}": ${n.assertion}`);
	}
	return e.dependencies.length && t.push(`Available dependencies: ${e.dependencies.join(", ")}.`), t.join("\n");
}
function Kf(e, t, n, r = Uf) {
	if (e.length <= r) return `NODE UNDER REPAIR — ${t} (complete current source):\n${e}`;
	let i = [];
	for (let t of n) {
		let n = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), r = RegExp(`(export\\s+)?(async\\s+)?function\\s+${n}\\s*\\(`).exec(e);
		if (!r) continue;
		let a = e.lastIndexOf("\n", r.index) + 1, o = 0, s = !1, c = e.length;
		for (let t = r.index; t < e.length; t++) if (e[t] === "{") o++, s = !0;
		else if (e[t] === "}" && (o--, s && o === 0)) {
			c = t + 1;
			break;
		}
		i.push(e.slice(a, c));
	}
	return `NODE UNDER REPAIR — ${t} (excerpted: the declarations under repair; the rest of the file is unchanged and must be preserved):\n${i.length ? i.join("\n\n") : e.slice(0, r)}`;
}
function qf(e) {
	let t = Kf(e.source, e.schema.path, e.focusSymbols), n = t.includes("complete current source");
	return {
		text: [
			"REPAIR THIS NODE SO THAT IT COMPLIES WITH THE SCHEMA.",
			"You are editing an existing artifact, not writing a new one. Return the COMPLETE node — every export the schema names, with its signature unchanged. Preserve everything that already satisfies the schema; change only what the findings show to be wrong. Do not modify or restate the tests. Do not add exports the schema does not name.",
			Gf(e.schema),
			t,
			e.findings ? `FINDINGS — what the frozen contract observed:\n${e.findings}` : "",
			e.substrate ? `SUBSTRATE (deterministic analysis already performed):\n${e.substrate}` : "",
			e.ledger ? `SUPERGIT (how this node reached its current state):\n${e.ledger}` : "",
			e.supercache ? `SUPERCACHE (what has already been tried):\n${e.supercache}` : ""
		].filter(Boolean).join("\n\n"),
		whole: n
	};
}
function Jf(e, t, n) {
	return `node-compliant repair: ${e} supplied ${t ? "in full" : `as ${n.length} declaration span(s)`} with schema + supergit + supercache + substrate — repair-in-place, not regeneration`;
}
//#endregion
//#region src/tier1/watcher.ts
var Yf = /^(L[1-4])\b/;
function Xf(e) {
	let { rows: t } = e, n = e.featureId ?? null, r = n ? t.filter((e) => e.featureId === n).slice(-8).reverse().map((e) => `${e.id} [${e.type}${e.bugClass ? " " + e.bugClass : ""}${e.status ? " " + e.status : ""}] ${e.summary}`) : [], i = t.filter((e) => e.type === "error"), a = t.filter((e) => e.type === "repair"), o = /* @__PURE__ */ new Map();
	for (let e of i) e.bugClass && o.set(e.bugClass, (o.get(e.bugClass) ?? 0) + 1);
	let s = [...o.entries()].map(([e, t]) => ({
		classKey: e,
		count: t
	})).sort((e, t) => t.count - e.count || e.classKey.localeCompare(t.classKey)).slice(0, 12), c = /* @__PURE__ */ new Map();
	for (let e of a) e.bugClass && c.set(e.bugClass, (c.get(e.bugClass) ?? 0) + 1);
	let l = [...c.entries()].map(([e, t]) => ({
		classKey: e,
		heals: t,
		recurrences: o.get(e) ?? 0
	})).filter((e) => e.heals >= 1 && e.recurrences > e.heals).sort((e, t) => t.recurrences - t.heals - (e.recurrences - e.heals)).slice(0, 8), u = {
		L1: 0,
		L2: 0,
		L3: 0,
		L4: 0
	};
	for (let e of a) {
		let t = Yf.exec(e.summary);
		t && u[t[1]]++;
	}
	let d = /* @__PURE__ */ new Map();
	for (let e of t) e.type === "spec" && e.featureId && d.set(e.id, e.featureId);
	let f = /* @__PURE__ */ new Map();
	for (let e of t) {
		if (e.type !== "edge" || !e.edgeFrom) continue;
		let t = d.get(e.edgeFrom);
		t && f.set(t, (f.get(t) ?? 0) + 1);
	}
	let p = [...f.entries()].map(([e, t]) => ({
		featureId: e,
		downstream: t
	})).sort((e, t) => t.downstream - e.downstream || e.featureId.localeCompare(t.featureId)).slice(0, 6), m = t.filter((e) => e.type === "resolution"), h = m.length > 0, g = [];
	for (let e of i) {
		let t = !1;
		t = h ? m.some((t) => t.causeId && t.causeId === e.id || t.featureId === e.featureId && t.step > e.step) : a.some((t) => t.featureId === e.featureId && t.bugClass === e.bugClass && t.step > e.step), !t && e.featureId && g.push({
			featureId: e.featureId,
			classKey: e.bugClass ?? "unclassified",
			summary: e.summary
		});
	}
	let _ = e.artifact.map((e) => ({
		path: e.path,
		bytes: e.content.length,
		exports: [...e.content.matchAll(/export\s+(?:async\s+)?(?:function|class|const|type|interface)\s+([A-Za-z_$][\w$]*)/g)].map((e) => e[1]).slice(0, 12)
	}));
	return {
		epoch: e.epoch,
		featureId: n,
		nodeTrail: r,
		nodes: t.length,
		recurringClasses: s,
		oscillating: l,
		layerMix: u,
		hotDependencies: p,
		unhealed: g.slice(0, 12),
		artifact: _
	};
}
function Zf(e) {
	let t = [`Supergit state at "${e.epoch}"${e.featureId ? ` for ${e.featureId}` : ""} — ${e.nodes} ledger nodes.`];
	e.nodeTrail.length && t.push("This node's trail (newest first):", ...e.nodeTrail.map((e) => `  ${e}`));
	{
		let n = e.layerMix, r = n.L1 + n.L2 + n.L3 + n.L4;
		if (r === 0) t.push("No repairs have been accepted yet.");
		else {
			let e = (e) => `${e} of ${r}`;
			t.push(`Repairs accepted so far: ${e(n.L1)} were deterministic substrate fixes costing no tokens, ${e(n.L2)} came from schema-guided draws, ${e(n.L3)} from free permutation batches, and ${e(n.L4)} required discarding the implementation entirely (entropy reset).` + (n.L4 > n.L1 ? " Whole-file rewrites outnumber mechanical fixes — the substrate is not catching this run." : ""));
		}
	}
	if (e.recurringClasses.length && t.push("Failure classes seen, by number of separate sightings: " + e.recurringClasses.map((e) => `${e.classKey} (${e.count})`).join(", ") + "."), e.oscillating.length) for (let n of e.oscillating) t.push(`${n.classKey} was repaired ${n.heals} time${n.heals === 1 ? "" : "s"} but has been seen ${n.recurrences} times — the fix is not holding.`);
	return e.hotDependencies.length && t.push("Blast radius: " + e.hotDependencies.map((e) => `changing ${e.featureId} affects ${e.downstream} dependent node${e.downstream === 1 ? "" : "s"}`).join("; ") + "."), e.unhealed.length && t.push("Still failing with no repair recorded: " + e.unhealed.map((e) => `${e.featureId} (${e.classKey})`).join(", ") + "."), e.artifact.length && t.push("Artifact as it stands: " + e.artifact.map((e) => `${e.path} is ${e.bytes} bytes and exports ${e.exports.length ? e.exports.join(", ") : "NOTHING"}`).join("; ") + "."), t.join("\n");
}
var Qf = [
	"You are a static observer of a code-generation run. You do not repair, choose, or instruct.",
	"From the deterministic digest, name the recurring IDIOMS (habits the generator repeats),",
	"TROPES (failure shapes that keep reappearing), and SCHEMES (structural strategies that are working).",
	"Every claim must cite evidence present in the digest. Say only what the digest supports.",
	"Return JSON only."
].join(" ");
function $f(e) {
	return [
		Zf(e),
		"",
		"Report in EXACTLY this format, one item per line, no prose:",
		"IDIOM: <habit> — <evidence from the digest>",
		"TROPE: <recurring failure shape> — <evidence>",
		"SCHEME: <structural strategy that is working> — <evidence>",
		"UNION: <one-sentence state of the union>"
	].join("\n");
}
function ep(e) {
	let t = (t) => e.split("\n").map((e) => e.trim()).filter((e) => e.toUpperCase().startsWith(`${t}:`)).map((e) => e.slice(t.length + 1).trim()).filter(Boolean).slice(0, 6), n = t("IDIOM"), r = t("TROPE"), i = t("SCHEME"), a = t("UNION")[0] ?? "";
	return !n.length && !r.length && !i.length && !a ? null : {
		idioms: n,
		tropes: r,
		schemes: i,
		union: a
	};
}
function tp(e, t) {
	let n = [];
	t?.union && n.push(t.union);
	for (let t of e.oscillating.slice(0, 2)) n.push(`${t.classKey}: repaired ${t.heals}× but seen ${t.recurrences}× — the fix is not holding.`);
	e.unhealed.length && n.push(`Still failing: ${e.unhealed.slice(0, 4).map((e) => `${e.featureId} (${e.classKey})`).join(", ")}.`);
	for (let e of (t?.tropes ?? []).slice(0, 2)) n.push(`Trope: ${e}`);
	for (let e of (t?.idioms ?? []).slice(0, 1)) n.push(`Idiom: ${e}`);
	{
		let t = e.layerMix, r = t.L1 + t.L2 + t.L3 + t.L4;
		r > 0 && n.push(`Of ${r} accepted repairs, ${t.L1} cost no tokens and ${t.L4} needed a full rewrite.`);
	}
	return `Page union — observation only, not instruction:\n${n.join("\n")}`.slice(0, 340);
}
function np(e, t, n, r) {
	let i = `${e.epoch}${e.featureId ? `/${e.featureId}` : ""}`;
	return n === "read" && t ? `watcher synthesis @ ${i}: fresh reading — ${t.idioms.length} idioms, ${t.tropes.length} tropes, ${t.schemes.length} schemes over ${e.nodes} ledger nodes (advisory)` : n === "unreadable" ? `watcher synthesis @ ${i}: reading taken but unparseable — digest stands over ${e.nodes} ledger nodes` : n === "engine-failed" ? `watcher synthesis @ ${i}: reading engine threw — ${r ?? "unknown error"} — digest stands over ${e.nodes} ledger nodes` : `watcher synthesis @ ${i}: digest over ${e.nodes} ledger nodes (no reading engine on this client)`;
}
//#endregion
//#region src/tier1/observatory.ts
var rp = /(export\s+)?(?:async\s+)?(function|class|const|type|interface)\s+([A-Za-z_$][\w$]*)\s*(\(([^)]*)\))?/g, ip = /import\s+(?:\{([^}]*)\}|(\w+))\s+from\s+['"]([^'"]+)['"]/g;
function ap(e) {
	let t = [], n = [], r = /* @__PURE__ */ new Map();
	for (let r of e) {
		for (let e of r.content.matchAll(rp)) t.push({
			path: r.path,
			kind: e[2],
			symbol: e[3],
			params: (e[5] ?? "").trim(),
			exported: !!e[1]
		});
		for (let e of r.content.matchAll(ip)) {
			let t = (e[1] ?? e[2] ?? "").split(",").map((e) => e.trim()).filter(Boolean);
			n.push({
				from: r.path,
				to: e[3],
				symbols: t
			});
		}
	}
	let i = new Set(t.map((e) => e.symbol));
	for (let n of e) for (let e of n.content.matchAll(/(?<![\w$.])([A-Za-z_$][\w$]*)\s*\(/g)) {
		let a = e[1];
		if (!i.has(a)) continue;
		let o = t.find((e) => e.symbol === a)?.path;
		if (!o || o === n.path) continue;
		let s = r.get(a);
		s || (s = /* @__PURE__ */ new Set(), r.set(a, s)), s.add(n.path);
	}
	return {
		declarations: t.sort((e, t) => e.path.localeCompare(t.path) || e.symbol.localeCompare(t.symbol)),
		imports: n.sort((e, t) => e.from.localeCompare(t.from) || e.to.localeCompare(t.to)),
		callEdges: [...r.entries()].map(([e, t]) => ({
			callee: e,
			callers: [...t].sort()
		})).sort((e, t) => t.callers.length - e.callers.length || e.callee.localeCompare(t.callee))
	};
}
function op(e, t = 900) {
	let n = ["AST facts (extracted from the artifact; cite these):"], r = /* @__PURE__ */ new Map();
	for (let t of e.declarations) {
		let e = r.get(t.path) ?? [];
		e.push(t), r.set(t.path, e);
	}
	for (let [e, t] of r) n.push(`${e}: ` + t.map((e) => `${e.exported ? "export " : ""}${e.kind} ${e.symbol}${e.params ? `(${e.params})` : ""}`).join("; "));
	for (let t of e.imports.slice(0, 12)) n.push(`${t.from} imports ${t.symbols.join(", ") || "*"} from ${t.to}`);
	for (let t of e.callEdges.slice(0, 8)) n.push(`${t.callee} is called from ${t.callers.join(", ")}`);
	return n.join("\n").slice(0, t);
}
function sp(e, t, n) {
	return `${e}${t.toLowerCase().trim()}${n.toLowerCase().replace(/\s+/g, " ").trim().slice(0, 120)}`;
}
var cp = class {
	byKey = /* @__PURE__ */ new Map();
	constructor(e = []) {
		for (let t of e) this.byKey.set(sp(t.kind, t.subject, t.claim), { ...t });
	}
	append(e, t, n, r, i) {
		let a = sp(e, t, n), o = this.byKey.get(a);
		if (o) {
			o.timesSeen += 1, o.lastSeenAt = i;
			for (let e of r) !o.evidence.includes(e) && o.evidence.length < 6 && o.evidence.push(e);
			return !1;
		}
		return this.byKey.set(a, {
			kind: e,
			subject: t,
			claim: n.slice(0, 200),
			evidence: r.slice(0, 4),
			firstSeenAt: i,
			lastSeenAt: i,
			timesSeen: 1
		}), !0;
	}
	all() {
		return [...this.byKey.values()].sort((e, t) => t.timesSeen - e.timesSeen || e.kind.localeCompare(t.kind) || e.subject.localeCompare(t.subject));
	}
	ofKind(e) {
		return this.all().filter((t) => t.kind === e);
	}
	get size() {
		return this.byKey.size;
	}
}, lp = [
	{
		kind: "idiom",
		question: "Identify any IDIOMS: constructions this code repeats across files.",
		system: "You name repeated constructions in code. One question only. Cite a symbol or path from the AST facts for each. Return JSON only."
	},
	{
		kind: "dependency",
		question: "Identify DEPENDENCIES: which symbols or modules rely on which others.",
		system: "You name dependency relationships in code. One question only. Cite a symbol or path from the AST facts for each. Return JSON only."
	},
	{
		kind: "trope",
		question: "Identify TROPES: failure shapes that keep reappearing.",
		system: "You name recurring failure shapes. One question only. Cite a symbol, path, or failure class from the facts for each. Return JSON only."
	},
	{
		kind: "scheme",
		question: "Identify SCHEMES: structural strategies in this code that are working.",
		system: "You name structural strategies that are working. One question only. Cite a symbol or path from the AST facts for each. Return JSON only."
	}
];
function up(e, t, n) {
	return [
		t,
		n ? `Observed failures:\n${n}` : "",
		"",
		e.question,
		"Answer ONLY this question. Report one item per line, at most four lines, no prose:",
		"ITEM: <subject from the facts> — <one-line claim>"
	].filter(Boolean).join("\n");
}
function dp(e) {
	return e.split("\n").map((e) => e.trim()).filter((e) => /^ITEM:/i.test(e)).map((e) => e.slice(5).trim()).map((e) => {
		let t = /^(.+?)\s+[—-]\s+(.+)$/.exec(e);
		return t ? {
			subject: t[1].trim(),
			claim: t[2].trim()
		} : null;
	}).filter((e) => !!e && !!e.subject && !!e.claim).slice(0, 4);
}
function fp(e) {
	let t = e.all();
	if (!t.length) return null;
	let n = ["Page observatory — accumulated observations (evidence, not instruction):"];
	for (let e of t) {
		let t = e.timesSeen > 1 ? ` [seen ${e.timesSeen}×]` : "";
		if (n.push(`${e.kind}: ${e.subject} — ${e.claim}${t}`), n.join("\n").length > 420) break;
	}
	return n.join("\n").slice(0, 420);
}
function pp(e, t, n, r, i) {
	return `observatory: ${e} decoupled poll(s) → ${t} new observation(s), ${n} corroborated — ${r} accumulated (append-only)` + (i ? ` · poll engine threw — ${i}` : "");
}
//#endregion
//#region src/tier1/agentHealth.ts
function mp() {
	return {
		consecutiveFailures: 0,
		lastError: null,
		totalFailures: 0
	};
}
function hp(e) {
	return (e instanceof Error ? e.message : String(e)).replace(/\s+/g, " ").trim().slice(0, 200) || "unknown error";
}
function gp(e, t) {
	return e.consecutiveFailures += 1, e.totalFailures += 1, e.lastError = hp(t), e.lastError;
}
function _p(e) {
	e.consecutiveFailures = 0;
}
function vp(e) {
	let t = e.lastError ?? "unknown error";
	return e.consecutiveFailures > 1 ? `${t} (${e.consecutiveFailures} consecutive)` : t;
}
//#endregion
//#region src/tier1/judgment.ts
function yp(e) {
	return e.toLowerCase().split(/[^a-z0-9]+/).filter((e) => e.length >= 4 && ![
		"this",
		"that",
		"with",
		"from",
		"expect",
		"toequal",
		"tobe",
		"const",
		"return",
		"true",
		"false",
		"null"
	].includes(e));
}
function bp(e) {
	let t = [
		...e.feature.edgeCases ?? [],
		e.feature.description ?? "",
		...(e.feature.exports ?? []).map((e) => e.symbol),
		e.prompt
	].join("\n").toLowerCase(), n = [], r = (e.expected ?? "").trim().replace(/^["']|["']$/g, ""), i = r.length >= 2 && !/^(true|false|null|undefined)$/.test(r);
	if (i && t.includes(r.toLowerCase())) return {
		licensed: !0,
		searched: `expected literal "${r}" found in intent chain`
	};
	i && n.push(`expected literal "${r}"`);
	let a = yp(e.caseName), o = a.filter((e) => t.includes(e)), s = a.length > 0 ? o.length === a.length : t.includes(e.caseName.toLowerCase().trim());
	n.push(a.length ? `case tokens [${a.join(", ")}] → ${o.length}/${a.length} in chain` : `case name "${e.caseName}" → ${s ? "found" : "absent"} in chain`);
	let c = s && !i;
	return {
		licensed: c,
		searched: `license search (case → edge/export → description → prompt): ${n.join("; ")} — ${c ? "chain found" : "NO licensing chain"}`
	};
}
function xp(e) {
	return [
		"JUDGMENT GATE — the following expectation has no licensing chain to the prompt, and honest implementations keep failing it. This is a spec decision, not a bug.",
		`feature: ${e.featureId}`,
		`case: "${e.caseName}" [${e.classKey}]`,
		`assertion:\n${e.assertion}`,
		e.expected == null ? "" : `expected: ${e.expected}`,
		e.received == null ? "" : `received: ${e.received}`,
		e.exhibit ?? "",
		e.trace ?? "",
		e.licenseSearch,
		"Rule with EXACTLY this format (no prose):",
		"ACTION: amend | direct | drop",
		"INTENT: <one line — required for direct: the missing intent that licenses the expectation; otherwise leave empty>"
	].filter(Boolean).join("\n\n");
}
function Sp(e) {
	let t = /^\s*ACTION:\s*(amend|direct|drop)\s*$/im.exec(e);
	if (!t) return null;
	let n = t[1].toLowerCase(), r = /^\s*INTENT:\s*(.*)$/im.exec(e)?.[1]?.trim() || void 0;
	return n === "direct" && !r ? null : {
		action: n,
		intentText: n === "direct" ? r : void 0
	};
}
function Cp(e, t) {
	return e === "operator" ? `operator decision @ ${t}` : `llm ruling @ ${t} (provisional)`;
}
function wp(e, t) {
	let n = e.action === "amend" ? "amend case to accept implementation behavior" : e.action === "direct" ? `direct repair — licensed intent addendum: "${e.intentText ?? ""}"` : "drop case (coverage reduced, honest)";
	return `judgment: case "${e.caseName}" — ${n} [${Cp(e.source, t)}]`;
}
//#endregion
//#region src/tier1/suiteScaffoldWire.ts
var Tp = /* @__PURE__ */ new Set(/* @__PURE__ */ "break.case.catch.class.const.continue.debugger.default.delete.do.else.enum.export.extends.false.finally.for.function.if.import.in.instanceof.let.new.null.return.super.switch.this.throw.true.try.typeof.undefined.var.void.while.with.yield.await.async.of.as.from.type.interface.implements.private.public.protected.readonly.static.get.set.describe.it.test.expect.beforeEach.afterEach.vi.jest.spyOn.fn".split("."));
function Ep(e) {
	return e.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\.(ts|tsx|js|jsx)$/, "");
}
function Dp(e, t) {
	let n = Ep(e), r = Ep(t), i = n.split("/").slice(0, -1), a = r.split("/").slice(0, -1);
	if (i.join("/") === a.join("/")) return `./${r.split("/").pop()}`;
	let o = i.length;
	return `${"../".repeat(o)}${r}`;
}
function Op(e) {
	let t = /* @__PURE__ */ new Map();
	for (let n of e.features) for (let e of n.exports ?? []) e.symbol && e.file && !t.has(e.symbol) && t.set(e.symbol, e.file);
	let n = (e) => RegExp(`export\\s+(?:default\\s+)?(?:async\\s+)?(?:function\\*?|class|const|let|var|type|interface|enum)\\s+${e}\\b`);
	for (let r of e.features) for (let e of r.stubs ?? []) for (let r of e.content.matchAll(/export\s+(?:default\s+)?(?:async\s+)?(?:function\*?|class|const|let|var|type|interface|enum)\s+([A-Za-z_$][\w$]*)\b/g)) {
		let i = r[1];
		!t.has(i) && n(i).test(e.content) && t.set(i, e.path);
	}
	return t;
}
function kp(e, t) {
	return Op(e).has(t);
}
function Ap(e) {
	let t = "", n = 0;
	for (; n < e.length;) {
		let r = e[n];
		if (r === "/" && e[n + 1] === "/") {
			for (t += " ", n += 2; n < e.length && e[n] !== "\n";) t += " ", n++;
			continue;
		}
		if (r === "/" && e[n + 1] === "*") {
			for (t += "  ", n += 2; n < e.length && !(e[n] === "*" && e[n + 1] === "/");) t += e[n] === "\n" ? "\n" : " ", n++;
			n < e.length && (t += "  ", n += 2);
			continue;
		}
		if (r === "\"" || r === "'" || r === "`") {
			let i = r;
			for (t += " ", n++; n < e.length && e[n] !== i;) {
				if (e[n] === "\\") {
					t += "  ", n += 2;
					continue;
				}
				t += e[n] === "\n" ? "\n" : " ", n++;
			}
			n < e.length && (t += " ", n++);
			continue;
		}
		t += r, n++;
	}
	return t;
}
function jp(e, t) {
	let n = RegExp(`import\\s*(?:type\\s*)?\\{[^}]*\\b${t}\\b[^}]*\\}\\s*from\\s*['"][^'"]+['"]`), r = RegExp(`import\\s+${t}\\b\\s*from\\s*['"][^'"]+['"]`);
	return n.test(e) || r.test(e);
}
function Mp(e) {
	let t = Ap(e), n = /* @__PURE__ */ new Set();
	for (let e of t.matchAll(/\b([A-Za-z_$][\w$]*)\b/g)) {
		let t = e[1];
		Tp.has(t) || n.add(t);
	}
	return n;
}
function Np(e, t, n) {
	let r = Op(n);
	if (!r.size) return {
		content: e,
		injected: []
	};
	let i = Mp(e), a = [];
	for (let [t, n] of [...r.entries()].sort((e, t) => e[0].localeCompare(t[0]))) i.has(t) && (jp(e, t) || a.push({
		symbol: t,
		file: n
	}));
	if (!a.length) return {
		content: e,
		injected: []
	};
	let o = /* @__PURE__ */ new Map();
	for (let e of a) {
		let t = o.get(e.file) ?? [];
		t.push(e.symbol), o.set(e.file, t);
	}
	let s = [], c = [];
	for (let e of [...o.keys()].sort((e, t) => e.localeCompare(t))) {
		let n = o.get(e).slice().sort((e, t) => e.localeCompare(t)), r = Dp(t, e);
		s.push(`import { ${n.join(", ")} } from '${r}';`);
		for (let e of n) c.push({
			symbol: e,
			from: r
		});
	}
	return {
		content: `${s.join("\n")}\n${e}`,
		injected: c
	};
}
//#endregion
//#region src/tier1/caseBodyConformance.ts
function Pp(e) {
	let t = [], n = 0, r = e.length;
	for (; n < r;) {
		let i = e[n];
		if (i === "/" && e[n + 1] === "/") {
			let i = n;
			for (; n < r && e[n] !== "\n";) n++;
			t.push(" ".repeat(n - i));
			continue;
		}
		if (i === "/" && e[n + 1] === "*") {
			let i = n;
			for (n += 2; n < r && !(e[n] === "*" && e[n + 1] === "/");) n++;
			n < r && (n += 2), t.push(e.slice(i, n).replace(/[^\n]/g, " "));
			continue;
		}
		if (i === "\"" || i === "'" || i === "`") {
			let a = i, o = n;
			for (n++; n < r;) {
				let t = e[n];
				if (t === "\\") {
					n += 2;
					continue;
				}
				if (t === a) {
					n++;
					break;
				}
				if (a === "`" && t === "$" && e[n + 1] === "{") {
					n += 2;
					let t = 1;
					for (; n < r && t > 0;) {
						let r = e[n];
						r === "{" ? t++ : r === "}" && t--, n++;
					}
					continue;
				}
				n++;
			}
			t.push(e.slice(o, n).replace(/[^\n]/g, " "));
			continue;
		}
		t.push(i), n++;
	}
	return t.join("");
}
function Fp(e) {
	let t = Pp(e);
	return /(^|[^A-Za-z0-9_$.])(it|test|describe)\s*\(/.test(t);
}
function Ip(e, t) {
	let n = e.trim().replace(/;\s*$/, ""), r = RegExp(`^${t}\\s*\\(\\s*(['"\`])`).exec(n);
	if (!r) return null;
	let i = r[1], a = r[0].length;
	for (; a < n.length;) {
		let e = n[a];
		if (e === "\\") {
			a += 2;
			continue;
		}
		if (e === i) {
			a++;
			break;
		}
		a++;
	}
	let o = n.slice(a), s = /^\s*,\s*(async\s+)?(\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>\s*\{/.exec(o), c = /^\s*,\s*(async\s+)?function\s*(?:[A-Za-z_$][\w$]*)?\s*\([^)]*\)\s*\{/.exec(o), l = s || c;
	if (!l) return null;
	let u = a + l[0].length - 1, d = 0, f = null;
	for (let e = u; e < n.length; e++) {
		let t = n[e];
		if (f) {
			if (t === "\\") {
				e++;
				continue;
			}
			t === f && (f = null);
			continue;
		}
		if (t === "\"" || t === "'" || t === "`") {
			f = t;
			continue;
		}
		if (t === "{") d++;
		else if (t === "}" && (d--, d === 0)) {
			let t = n.slice(e + 1).trim();
			if (t !== "" && !/^\)\s*;?\s*$/.test(t)) return null;
			let r = n.slice(u + 1, e).trim();
			return {
				innerBody: r,
				strippedInner: Pp(r)
			};
		}
	}
	return null;
}
function Lp(e) {
	let t = (e ?? "").trim();
	if (!t) return {
		disposition: "rejected-empty",
		body: e,
		unwrapped: "none",
		reason: "empty case body"
	};
	let n = "none", r = e, i = Ip(t, "it"), a = i ? null : Ip(t, "test"), o = i || a ? null : Ip(t, "describe");
	if (i) r = i.innerBody, n = "outer-it";
	else if (a) r = a.innerBody, n = "outer-test";
	else if (o) {
		let e = o.innerBody.trim(), t = Ip(e, "it"), i = t ? null : Ip(e, "test");
		if (t) r = t.innerBody, n = "outer-describe-it";
		else if (i) r = i.innerBody, n = "outer-describe-it";
		else return {
			disposition: "rejected-registration",
			body: r,
			unwrapped: "none",
			reason: "describe(...) body is not exactly one canonical it/test — nested registration"
		};
	}
	if (Fp(r)) return {
		disposition: "rejected-registration",
		body: r,
		unwrapped: n,
		reason: "case body contains a nested it/test/describe registration call"
	};
	let s = Od(r);
	if (s) return {
		disposition: "rejected-dynamic-eval",
		body: r,
		unwrapped: n,
		reason: s
	};
	let c = jd([{
		name: "_",
		body: r
	}])[0];
	return c ? {
		disposition: "rejected-syntax",
		body: r,
		unwrapped: n,
		reason: c.error
	} : /\bexpect\s*\(/.test(Pp(r)) ? {
		disposition: "ok",
		body: r,
		unwrapped: n,
		reason: ""
	} : {
		disposition: "rejected-empty",
		body: r,
		unwrapped: n,
		reason: "case body has no expect(...) assertion"
	};
}
//#endregion
//#region src/tier1/caseCertification.ts
function Rp(e) {
	let t = Pp(e), n = (t.match(/\bexpect\s*\(/g) ?? []).length, r = zp(t, /\brejects\s*\.\s*(toThrow|toThrowError)\s*\(/);
	if (r) return {
		hasThrowAssertion: !0,
		negated: !1,
		async: !0,
		expectedLiteral: Bp(e, r.argStart, r.argEnd),
		isSoleAssertion: n <= 1,
		form: "rejects.toThrow"
	};
	let i = zp(t, /\bnot\s*\.\s*(toThrow|toThrowError)\s*\(/);
	if (i) return {
		hasThrowAssertion: !0,
		negated: !0,
		async: !1,
		expectedLiteral: Bp(e, i.argStart, i.argEnd),
		isSoleAssertion: n <= 1,
		form: "not.toThrow"
	};
	let a = zp(t, /\.(toThrow|toThrowError)\s*\(/);
	return a ? {
		hasThrowAssertion: !0,
		negated: !1,
		async: !1,
		expectedLiteral: Bp(e, a.argStart, a.argEnd),
		isSoleAssertion: n <= 1,
		form: a.name
	} : {
		hasThrowAssertion: !1,
		negated: !1,
		async: !1,
		expectedLiteral: null,
		isSoleAssertion: n <= 1,
		form: null
	};
}
function zp(e, t) {
	let n = t.exec(e);
	if (!n) return null;
	let r = n[1] ?? n[0], i = n.index + n[0].length, a = 1, o = i;
	for (; o < e.length && a > 0;) {
		let t = e[o];
		if (t === "(" ? a++ : t === ")" && a--, a === 0) break;
		o++;
	}
	return {
		argStart: i,
		argEnd: o,
		name: r
	};
}
function Bp(e, t, n) {
	let r = e.slice(t, n).trim();
	if (!r) return null;
	let i = /^(['"`])([\s\S]*?)\1/.exec(r);
	if (i) return i[2];
	let a = /^\/([\s\S]*?)\/[gimsuy]*/.exec(r);
	return a ? a[1] : null;
}
function Vp(e, t, n) {
	if (!e) return !1;
	let r = e.toLowerCase();
	if (/\bstub\b/.test(r) || /\bnot\s+implemented\b/.test(r)) return !0;
	let i = t.features.flatMap((e) => e.stubs.map((e) => e.content));
	for (let e of i) if (e.toLowerCase().includes(r) && /\bthrow\b/.test(e)) return !0;
	return !1;
}
function Hp(e, t) {
	return new Set(t.exports.map((e) => e.symbol)).has(e.name);
}
function Up(e, t, n) {
	if (e.kind === "integration") return !0;
	if (!/^uses\s+/.test(e.name)) return !1;
	let r = new Set(t.deps.map((e) => n.features.find((t) => t.id === e)?.name).filter((e) => !!e)), i = e.name.replace(/^uses\s+/, "").trim();
	return r.has(i);
}
function Wp(e, t) {
	let n = Pp(e);
	return RegExp(`(?<![\\w$])${Kp(t)}(?![\\w$])`).test(n);
}
function Gp(e, t) {
	let n = Pp(e);
	if (n.includes(t.name)) return !0;
	for (let e of t.exports) if (RegExp(`(?<![\\w$])${Kp(e.symbol)}(?![\\w$])`).test(n)) return !0;
	return !1;
}
function Kp(e) {
	return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
async function qp(e) {
	let { spec: t, feature: n, prompt: r, imports: i, caseGen: a, runSuite: o, stubs: s } = e, c = {
		caseName: a.name,
		featureId: n.id,
		attributedToCase: !1,
		provisional: !1,
		reason: ""
	}, l = Lp(a.body);
	if (l.disposition === "rejected-registration") return {
		...c,
		disposition: "rejected-registration",
		reason: l.reason
	};
	if (l.disposition === "rejected-syntax") return {
		...c,
		disposition: "rejected-syntax",
		reason: l.reason
	};
	if (l.disposition === "rejected-dynamic-eval") return {
		...c,
		disposition: "rejected-conformance",
		reason: l.reason
	};
	if (l.disposition === "rejected-empty") return {
		...c,
		disposition: "rejected-vacuous",
		reason: l.reason
	};
	let u = l.body, d = {
		...a,
		body: u
	}, f = Np(O(n, i, [d]), n.testFile, t).content, p = Ad(f);
	if (p) return {
		...c,
		disposition: "rejected-syntax",
		reason: p.split("\n")[0].slice(0, 160)
	};
	let m = Sd(s, {
		path: n.testFile,
		content: f
	});
	if (m && m !== "GATE_UNAVAILABLE") return {
		...c,
		disposition: "rejected-syntax",
		reason: `program parse: ${m.split("\n")[0].slice(0, 140)}`
	};
	let h;
	try {
		h = await o(s, {
			path: n.testFile,
			content: f
		});
	} catch (e) {
		return {
			...c,
			disposition: "rejected-crash",
			crashSignature: e instanceof Error ? e.message.slice(0, 200) : String(e).slice(0, 200),
			reason: "suite runner threw during case certification"
		};
	}
	if (h.crashed) return {
		...c,
		disposition: "rejected-crash",
		crashSignature: h.crashed.split("\n")[0].slice(0, 200),
		reason: "suite crashed during single-case execution — proves oracle did not complete"
	};
	if (h.total !== 1) return {
		...c,
		disposition: "rejected-registration",
		reason: `single-case suite registered ${h.total} cases (expected 1)`
	};
	let g = h.failures.length === 0 || h.failures.length === 1 && (h.failures[0].name === d.name || h.failures[0].name.endsWith(`> ${d.name}`) || h.failures[0].name.includes(d.name));
	if (h.failures.length > 0 && !g) return {
		...c,
		disposition: "rejected-unattributed",
		reason: `case name did not match single-case run failure: ${h.failures[0].name}`
	};
	if (c.attributedToCase = !0, Hp(a, n)) return Wp(u, a.name) ? {
		...c,
		disposition: "certified-anchor",
		provisional: !0,
		reason: `structural anchor for exported symbol "${a.name}"`
	} : {
		...c,
		disposition: "rejected-vacuous",
		reason: `class-anchor body does not reference the anchored symbol "${a.name}"`
	};
	if (Up(a, n, t)) {
		let e = a.name.replace(/^uses\s+/, "").trim(), r = t.features.find((t) => t.name === e) ?? t.features.find((e) => n.deps.includes(e.id));
		if (r && Gp(u, r)) return {
			...c,
			disposition: "certified-dep-seam",
			provisional: !0,
			reason: `structural dep-seam for dependency "${r.name}"`
		};
	}
	let _ = Rp(u);
	if (_.hasThrowAssertion) {
		if (_.negated && !_.expectedLiteral) return {
			...c,
			disposition: "certified-behavior-red",
			provisional: !0,
			reason: "shape-only anchor (not.toThrow) — provisional build scaffold, not behavioral certification",
			throwAnalysis: _
		};
		if (Vp(_.expectedLiteral, t, n)) return {
			...c,
			disposition: "rejected-stub-derived",
			reason: `expected literal "${_.expectedLiteral}" derives from stub sentinel text`,
			throwAnalysis: _
		};
		let e = bp({
			caseName: d.name,
			expected: _.expectedLiteral,
			feature: n,
			prompt: r
		});
		return e.licensed ? {
			...c,
			disposition: "certified-licensed-throw",
			reason: e.searched,
			throwAnalysis: _
		} : {
			...c,
			disposition: "rejected-unlicensed-throw",
			reason: e.searched,
			throwAnalysis: _
		};
	}
	return h.failures.length === 0 ? {
		...c,
		disposition: "rejected-vacuous",
		reason: "case passes against pure stubs — asserts nothing an implementation could fail"
	} : {
		...c,
		disposition: "certified-behavior-red",
		reason: `honest absence-of-implementation failure (${h.failures[0].message.split("\n")[0].slice(0, 120)})`
	};
}
//#endregion
//#region src/tier1/bornRed.ts
function Jp(e) {
	return e.features.flatMap((e) => e.stubs);
}
function Yp(e) {
	if (e.crashed) return {
		total: e.total,
		red: 0,
		vacuous: 0,
		isRed: !1,
		aggregateRedGate: !1,
		crashed: !0
	};
	let t = e.total, n = e.failures.length;
	return {
		total: t,
		red: n,
		vacuous: Math.max(0, t - n),
		isRed: !1,
		aggregateRedGate: !1,
		crashed: !1
	};
}
function Xp(e) {
	return !e.crashed && e.failures.length > 0;
}
function Zp(e) {
	return `born-red check: ${e.red}/${e.total} cases red (${e.vacuous} vacuous → surgery)`;
}
function Qp(e) {
	return /\.(?:rejects\.)?toThrow\w*\s*\(/.test(e);
}
function $p(e) {
	return `born-red: ${e} throw-expecting case(s) retained (undecidable vs throwing stubs — verified rejection clade)`;
}
function em(e, t, n) {
	let r = Rp(e);
	return !r.hasThrowAssertion || !r.isSoleAssertion || r.negated ? !1 : Vp(r.expectedLiteral, n, t);
}
var tm = "case passes with no implementation — assert observable behavior", nm = /^[A-Za-z_$][\w$]*$/;
function rm(e) {
	return e.replace(/\\/g, "/").replace(/^\.\//, "");
}
function im(e) {
	let t = rm(e), n = t.lastIndexOf("/");
	return n >= 0 ? t.slice(n + 1) : t;
}
function am(e) {
	let t = rm(e), n = t.lastIndexOf("/");
	return n >= 0 ? t.slice(0, n) : "";
}
function om(e, t) {
	am(e);
	let n = rm(t).replace(/\.(ts|tsx|js|jsx)$/, ""), r = im(n);
	return am(n), `./${r}`;
}
function sm(e, t) {
	let n = e.length, r = t.length;
	if (n === 0) return r;
	if (r === 0) return n;
	let i = Array(r + 1), a = Array(r + 1);
	for (let e = 0; e <= r; e++) i[e] = e;
	for (let o = 1; o <= n; o++) {
		a[0] = o;
		for (let n = 1; n <= r; n++) {
			let r = e[o - 1] === t[n - 1] ? 0 : 1;
			a[n] = Math.min(i[n] + 1, a[n - 1] + 1, i[n - 1] + r);
		}
		for (let e = 0; e <= r; e++) i[e] = a[e];
	}
	return i[r];
}
function cm(e, t) {
	if (e === t) return !0;
	let n = e.toLowerCase(), r = t.toLowerCase();
	if (n === r) return !0;
	let i = (e) => e.replace(/(impl|fn|func|handler|export|_)+$/i, "");
	if (i(n) === i(r) && i(n).length > 0) return !0;
	if (r.startsWith(n) || n.startsWith(r)) {
		let e = n.length >= r.length ? n : r, t = n.length >= r.length ? r : n;
		if (t.length >= 2 && e.length - t.length <= 4) return !0;
	}
	let a = Math.max(1, Math.min(3, Math.floor(Math.max(n.length, r.length) / 3)));
	return sm(n, r) <= a;
}
function lm(e) {
	let t = [], n = "", r = 0, i = null;
	for (let a = 0; a < e.length; a++) {
		let o = e[a];
		if (i) {
			if (n += o, o === "\\") {
				a++, a < e.length && (n += e[a]);
				continue;
			}
			o === i && (i = null);
			continue;
		}
		if (o === "\"" || o === "'" || o === "`") {
			i = o, n += o;
			continue;
		}
		if (o === "(" || o === "[" || o === "{") {
			r++, n += o;
			continue;
		}
		if (o === ")" || o === "]" || o === "}") {
			if (r--, r < 0) return null;
			n += o;
			continue;
		}
		if (o === "," && r === 0) {
			n.trim() && t.push(n.trim()), n = "";
			continue;
		}
		n += o;
	}
	return r === 0 ? (n.trim() && t.push(n.trim()), t) : null;
}
function um(e) {
	let t = e.trim();
	if (!t) return 0;
	let n = lm(t);
	return !n || n.length === 1 && /^\.\.\./.test(n[0]) ? null : n.length;
}
function dm(e, t) {
	if (e[t] !== "(") return null;
	let n = 0, r = null;
	for (let i = t; i < e.length; i++) {
		let a = e[i];
		if (r) {
			if (a === "\\") {
				i++;
				continue;
			}
			a === r && (r = null);
			continue;
		}
		if (a === "\"" || a === "'" || a === "`") {
			r = a;
			continue;
		}
		if (a === "(") n++;
		else if (a === ")" && (n--, n === 0)) return {
			inner: e.slice(t + 1, i),
			end: i
		};
	}
	return null;
}
function fm(e, t, n) {
	!nm.test(n.symbol) || t.has(n.symbol) || (t.add(n.symbol), e.push(n));
}
function pm(e) {
	let t = [], n = /* @__PURE__ */ new Set(), r = 0, i = null, a = 0;
	for (; a < e.length;) {
		let o = e[a];
		if (i) {
			if (o === "\\") {
				a += 2;
				continue;
			}
			o === i && (i = null), a++;
			continue;
		}
		if (o === "\"" || o === "'" || o === "`") {
			i = o, a++;
			continue;
		}
		if (o === "/" && e[a + 1] === "/") {
			for (; a < e.length && e[a] !== "\n";) a++;
			continue;
		}
		if (o === "/" && e[a + 1] === "*") {
			for (a += 2; a < e.length && !(e[a] === "*" && e[a + 1] === "/");) a++;
			a += 2;
			continue;
		}
		if (o === "{") {
			r++, a++;
			continue;
		}
		if (o === "}") {
			r = Math.max(0, r - 1), a++;
			continue;
		}
		if (r !== 0) {
			a++;
			continue;
		}
		let s = e.slice(a), c = /^export\s*\{([^}]*)\}/.exec(s);
		if (c) {
			let e = c[1];
			for (let r of e.split(",")) {
				let e = r.trim();
				if (!e || e === "type") continue;
				let i = /^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/.exec(e);
				if (i) fm(t, n, {
					symbol: i[2],
					arity: null,
					kind: "reexport"
				});
				else {
					let r = /^([A-Za-z_$][\w$]*)$/.exec(e);
					r && fm(t, n, {
						symbol: r[1],
						arity: null,
						kind: "reexport"
					});
				}
			}
			a += c[0].length;
			continue;
		}
		let l = /^export\s+(?:default\s+)?(?:async\s+)?function\*?\s+([A-Za-z_$][\w$]*)\s*\(/.exec(s);
		if (l) {
			let r = l[1], i = dm(e, a + l[0].length - 1);
			fm(t, n, {
				symbol: r,
				arity: i ? um(i.inner) : null,
				kind: "function"
			}), a = i ? i.end + 1 : a + l[0].length;
			continue;
		}
		let u = /^export\s+const\s+([A-Za-z_$][\w$]*)\s*=\s*/.exec(s);
		if (u) {
			let r = u[1], i = a + u[0].length, o = e.slice(i), s = /^async\s*\(/.exec(o), c = /^\(/.exec(o), l = /^async\s+function\*?\s*(?:[A-Za-z_$][\w$]*)?\s*\(/.exec(o), d = /^function\*?\s*(?:[A-Za-z_$][\w$]*)?\s*\(/.exec(o), f = /^([A-Za-z_$][\w$]*)\s*;?/.exec(o), p = null, m = "const";
			if (s || c || l || d) {
				let t = s ?? c ?? l ?? d, n = dm(e, i + t[0].length - 1);
				p = n ? um(n.inner) : null, m = "const-function", i = n ? n.end + 1 : i + t[0].length;
			} else f && (p = null, m = "alias", i += f[0].length);
			fm(t, n, {
				symbol: r,
				arity: p,
				kind: m
			}), a = i;
			continue;
		}
		a++;
	}
	return t;
}
function mm(e) {
	let t = [], n = /* @__PURE__ */ new Set(), r = [...e].sort((e, t) => rm(e.path).localeCompare(rm(t.path)));
	for (let e of r) {
		let r = rm(e.path);
		for (let i of pm(e.content)) {
			let e = `${r}::${i.symbol}`;
			n.has(e) || (n.add(e), t.push({
				file: r,
				symbol: i.symbol,
				arity: i.arity
			}));
		}
	}
	return t;
}
function hm(e) {
	let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = [...e].sort((e, t) => rm(e.path).localeCompare(rm(t.path)));
	for (let e of r) {
		let r = rm(e.path), i = pm(e.content);
		n.set(r, i);
		for (let e of i) {
			let n = {
				file: r,
				symbol: e.symbol,
				arity: e.arity,
				kind: e.kind
			}, i = t.get(e.symbol) ?? [];
			i.push(n), t.set(e.symbol, i);
		}
	}
	return {
		bySymbol: t,
		byFile: n
	};
}
function gm(e) {
	return new Set(e.map((e) => e.symbol));
}
function _m(e, t, n, r, i) {
	let a = [];
	for (let [e, t] of n) for (let n of t) i.has(n.symbol) || r.has(n.symbol) || a.push({
		file: e,
		symbol: n.symbol,
		arity: n.arity,
		kind: n.kind
	});
	if (!a.length) return null;
	let o = a.filter((e) => e.file === t), s = o.length ? o : a;
	if (s.length === 1) return s[0];
	let c = s.filter((t) => cm(e, t.symbol)).map((n) => ({
		c: n,
		dist: sm(e.toLowerCase(), n.symbol.toLowerCase()),
		same: n.file === t ? 0 : 1
	})).sort((e, t) => e.dist - t.dist || e.same - t.same || e.c.symbol.localeCompare(t.c.symbol));
	return !c.length || c.length > 1 && c[0].dist === c[1].dist && c[0].same === c[1].same ? null : c[0].c;
}
function vm(e, t) {
	let n = mm(t), { bySymbol: r, byFile: i } = hm(e), a = gm(n), o = /* @__PURE__ */ new Set(), s = [];
	for (let e of n) {
		let t = r.get(e.symbol) ?? [], n = t.find((t) => t.file === e.file) ?? t[0];
		if (n) {
			o.add(n.symbol);
			let t = e.arity, r = n.arity;
			t != null && r != null && t !== r && s.push({
				kind: "arity-mismatch",
				symbol: e.symbol,
				file: n.file,
				stubArity: t,
				implArity: r
			});
			continue;
		}
		let c = _m(e.symbol, e.file, i, o, a);
		if (c) {
			o.add(c.symbol), s.push({
				kind: "renamed",
				stubSymbol: e.symbol,
				implSymbol: c.symbol,
				stubFile: e.file,
				implFile: c.file
			});
			continue;
		}
		s.push({
			kind: "missing",
			symbol: e.symbol,
			stubFile: e.file,
			arity: e.arity ?? null
		});
	}
	let c = {
		missing: 0,
		renamed: 1,
		"arity-mismatch": 2
	};
	return s.sort((e, t) => {
		let n = c[e.kind] - c[t.kind];
		return n === 0 ? e.kind === "missing" && t.kind === "missing" ? e.stubFile.localeCompare(t.stubFile) || e.symbol.localeCompare(t.symbol) : e.kind === "renamed" && t.kind === "renamed" ? e.stubFile.localeCompare(t.stubFile) || e.stubSymbol.localeCompare(t.stubSymbol) : e.kind === "arity-mismatch" && t.kind === "arity-mismatch" ? e.file.localeCompare(t.file) || e.symbol.localeCompare(t.symbol) : 0 : n;
	}), s;
}
function ym(e) {
	return e.endsWith("\n") ? e : `${e}\n`;
}
function bm(e, t) {
	let n = e.replace(/\s*$/, "");
	return ym(n ? `${n}\n${t}` : t);
}
function xm(e) {
	return `export function ${e}(...args: unknown[]): unknown { throw new Error('stub'); }`;
}
function Sm(e, t) {
	return `export { ${e} as ${t} };`;
}
function Cm(e, t) {
	let n = rm(t);
	if (e.has(n)) return n;
	for (let t of e.keys()) if (rm(t) === n) return t;
}
function wm(e, t, n, r) {
	if (n === r) return e;
	let i = RegExp(`(export\\s+(?:async\\s+)?function\\*?\\s+${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*)\\(([^)]*)\\)`).exec(e);
	if (!i) return null;
	let a = lm(i[2] ?? "");
	if (!a || a.some((e) => /[{[]/.test(e))) return null;
	let o;
	if (r < n) if (n - r >= 3 && a.every((e) => !/^\.\.\./.test(e))) o = [...a, "...args: unknown[]"];
	else {
		o = [...a];
		for (let e = r; e < n; e++) o.push(`_a${e}?: unknown`);
	}
	else {
		if (a.some((e) => /^\.\.\./.test(e))) return null;
		o = a.map((e, t) => {
			if (t < n || /\?/.test(e.split(":")[0] ?? "") || /=/.test(e)) return e;
			let r = /^(\s*)([A-Za-z_$][\w$]*)(\s*)(:.*)?$/.exec(e);
			return r ? `${r[1]}${r[2]}?${r[3] ?? ""}${r[4] ?? ": unknown"}` : e;
		});
	}
	let s = `${i[1]}(${o.join(", ")})`;
	return e.slice(0, i.index) + s + e.slice(i.index + i[0].length);
}
function Tm(e, t) {
	let n = /* @__PURE__ */ new Map();
	for (let t of [...e].sort((e, t) => rm(e.path).localeCompare(rm(t.path)))) n.set(rm(t.path), t.content);
	let r = [], i = mm(t).length + 2;
	for (let e = 0; e < i; e++) {
		let e = vm([...n.entries()].map(([e, t]) => ({
			path: e,
			content: t
		})), t);
		if (!e.length) break;
		let i = !1;
		for (let t of e) {
			if (t.kind === "renamed") {
				let e = Cm(n, t.stubFile) ?? rm(t.stubFile), a = n.get(e) ?? "";
				if (rm(t.implFile) === rm(t.stubFile)) {
					let i = Sm(t.implSymbol, t.stubSymbol);
					if (a.includes(i) || RegExp(`\\bexport\\s*\\{[^}]*\\bas\\s+${t.stubSymbol}\\b`).test(a)) continue;
					n.set(e, bm(a, i)), r.push({
						path: e,
						note: `aliased ${t.implSymbol} as ${t.stubSymbol}`
					});
				} else {
					let i = om(t.stubFile, t.implFile), o = `export { ${t.implSymbol} as ${t.stubSymbol} } from '${i}';`;
					if (a.includes(o)) continue;
					n.set(e, bm(a, o)), r.push({
						path: e,
						note: `re-exported ${t.implSymbol} as ${t.stubSymbol} from ${i}`
					});
				}
				i = !0;
				continue;
			}
			if (t.kind === "missing") {
				let e = Cm(n, t.stubFile) ?? rm(t.stubFile), a = n.get(e);
				a === void 0 && (a = "", n.set(e, a));
				let o = pm(a).filter((e) => e.symbol !== t.symbol && cm(t.symbol, e.symbol)).sort((e, n) => sm(t.symbol.toLowerCase(), e.symbol.toLowerCase()) - sm(t.symbol.toLowerCase(), n.symbol.toLowerCase()) || e.symbol.localeCompare(n.symbol));
				if (o.length === 1 || o.length > 1 && sm(t.symbol.toLowerCase(), o[0].symbol.toLowerCase()) < sm(t.symbol.toLowerCase(), o[1].symbol.toLowerCase())) {
					let s = o[0].symbol, c = Sm(s, t.symbol);
					if (!a.includes(c)) {
						n.set(e, bm(a, c)), r.push({
							path: e,
							note: `aliased ${s} as ${t.symbol}`
						}), i = !0;
						continue;
					}
				}
				let s = [...n.entries()].filter(([e]) => rm(e) !== rm(t.stubFile)).map(([e, n]) => ({
					path: e,
					hit: pm(n).find((e) => e.symbol === t.symbol)
				})).filter((e) => !!e.hit).sort((e, t) => e.path.localeCompare(t.path));
				if (s.length === 1) {
					let o = om(t.stubFile, s[0].path), c = `export { ${t.symbol} } from '${o}';`;
					if (!a.includes(c)) {
						n.set(e, bm(a, c)), r.push({
							path: e,
							note: `re-exported ${t.symbol} from ${o}`
						}), i = !0;
						continue;
					}
				}
				let c = xm(t.symbol);
				pm(a).some((e) => e.symbol === t.symbol) || (n.set(e, bm(a, c)), r.push({
					path: e,
					note: `added missing export ${t.symbol}`
				}), i = !0);
				continue;
			}
			if (t.kind === "arity-mismatch") {
				let e = Cm(n, t.file);
				if (!e) {
					r.push({
						path: t.file,
						note: `skipped arity fix for ${t.symbol}: file missing`
					});
					continue;
				}
				let a = n.get(e), o = wm(a, t.symbol, t.stubArity, t.implArity);
				if (o == null || o === a) {
					r.push({
						path: e,
						note: `skipped arity fix for ${t.symbol}: unsafe (${t.implArity}→${t.stubArity})`
					});
					continue;
				}
				n.set(e, ym(o)), r.push({
					path: e,
					note: `widened arity of ${t.symbol} ${t.implArity}→${t.stubArity}`
				}), i = !0;
			}
		}
		if (!i) break;
	}
	let a = [...n.entries()].sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => ({
		path: e,
		content: t
	})), o = /* @__PURE__ */ new Set(), s = [];
	for (let e of r) {
		let t = `${rm(e.path)}\0${e.note}`;
		o.has(t) || (o.add(t), s.push(e));
	}
	return {
		files: a,
		fixes: s
	};
}
//#endregion
//#region src/tier1/defectRegistry.ts
var Em = "@suite";
function Dm(e, t) {
	return String(e).padStart(t, "0");
}
function Om(e) {
	if (!e) return "";
	let t = e.replace(/\\/g, "/");
	return t = t.replace(/^.*?\/(src|tests)\//, "$1/"), t = t.replace(/^\.\//, ""), t;
}
function km(e) {
	return e == null ? "" : String(e).replace(/\r\n/g, "\n").replace(/\\/g, "/").replace(/\/Users\/[^/\s]+/g, "~").replace(/\/home\/[^/\s]+/g, "~").replace(/file:\/\/\/[^\s)]+/g, "file://…").replace(/\s+/g, " ").trim().slice(0, 240);
}
function Am(e) {
	let t = e.caseId === "__suite__" || !e.caseId ? Em : e.caseId, n = [
		`f=${km(e.featureId).toLowerCase()}`,
		`c=${km(t)}`,
		`k=${km(e.classKey)}`,
		`p=${Om(e.artifactPath)}`
	];
	return e.crashSignature ? n.push(`x=${km(e.crashSignature)}`) : (n.push(`e=${km(e.expected)}`), n.push(`r=${km(e.received)}`)), n.join("|");
}
function jm(e) {
	if (e.kindHint) return e.kindHint;
	if (e.crash) return "crash";
	let t = (e.classKey ?? "").toLowerCase(), n = (e.message ?? "").toLowerCase();
	return t.includes("parse") || t.includes("syntax") || t.includes("transpile") || n.includes("syntaxerror") || n.includes("parse error") || n.includes("unterminated") ? "parse" : t.includes("conformance") || t.includes("export") || t.includes("manifest") || t.includes("registration") || t.includes("contract") || t.includes("module-shape") || n.includes("is not a function") || n.includes("export") ? "conformance" : t.includes("throw-mismatch") || t.includes("assertion") || t.includes("expect") || n.includes("expected") || n.includes("received") || n.includes("assertionerror") || n.includes("tobe(") || n.includes("tothrow") ? "test-failure" : t.includes("crash") || n.includes("uncaught") || n.includes("unexpected throw") ? "crash" : "execution";
}
var Mm = class {
	occurrenceSeq = 0;
	defectSeq = 0;
	resolutionSeq = 0;
	occurrences = [];
	resolutions = [];
	keyToDefectId = /* @__PURE__ */ new Map();
	identities = /* @__PURE__ */ new Map();
	clock;
	constructor(e = () => (/* @__PURE__ */ new Date()).toISOString()) {
		this.clock = e;
	}
	observeAuthoritativeFinding(e) {
		let t = !e.caseId || e.caseId === "__suite__" ? Em : e.caseId, n = Am({
			featureId: e.featureId,
			caseId: t,
			classKey: e.classKey,
			artifactPath: e.artifactPath,
			expected: e.expected,
			received: e.received,
			crashSignature: e.crashSignature
		}), r = e.crashSignature ? km(e.crashSignature) : km(`expected=${e.expected ?? ""};received=${e.received ?? ""};msg=${e.message}`), i = e.ts ?? this.clock(), a = this.keyToDefectId.get(n);
		a || (this.defectSeq += 1, a = `D${Dm(this.defectSeq, 4)}`, this.keyToDefectId.set(n, a), this.identities.set(a, {
			defectId: a,
			canonicalKey: n,
			featureId: e.featureId,
			scopeKey: e.featureId,
			caseId: t,
			category: e.category,
			classKey: e.classKey,
			artifactPath: Om(e.artifactPath) || void 0,
			firstSeenAt: i,
			lastSeenAt: i,
			occurrenceCount: 0,
			unresolved: !0,
			latestErrorNodeId: e.errorNodeId,
			latestOccurrenceId: ""
		})), this.occurrenceSeq += 1;
		let o = `O${Dm(this.occurrenceSeq, 6)}`, s = {
			occurrenceId: o,
			defectId: a,
			canonicalKey: n,
			measurementId: e.measurementId,
			resultNodeId: e.resultNodeId,
			errorNodeId: e.errorNodeId,
			featureId: e.featureId,
			caseId: t,
			scopeKey: e.featureId,
			category: e.category,
			classKey: e.classKey,
			artifactPath: Om(e.artifactPath) || void 0,
			normalizedSignature: r,
			actionId: e.actionId,
			candidateId: e.candidateId,
			editIds: e.editIds ? [...e.editIds] : void 0,
			ts: i
		};
		this.occurrences.push(s);
		let c = this.identities.get(a);
		return c.occurrenceCount += 1, c.lastSeenAt = i, c.unresolved = !0, c.latestErrorNodeId = e.errorNodeId, c.latestOccurrenceId = o, c.category = e.category, c.classKey = e.classKey, s;
	}
	reconcileMeasurementScope(e) {
		let t = new Set(e.presentKeys), n = e.ts ?? this.clock(), r = [];
		for (let i of this.identities.values()) i.unresolved && (i.scopeKey !== e.scopeKey && i.featureId !== e.scopeKey || t.has(i.canonicalKey) || r.push(this.appendResolution(i, {
			confirmingMeasurementId: e.confirmingMeasurementId,
			confirmingResultNodeId: e.confirmingResultNodeId,
			actionId: e.actionId,
			candidateId: e.candidateId,
			editIds: e.editIds,
			ts: n,
			scopeKey: e.scopeKey
		})));
		return r;
	}
	reconcileTerminalMeasurement(e) {
		let t = new Set(e.presentKeys), n = e.ts ?? this.clock(), r = [];
		for (let i of this.identities.values()) i.unresolved && (t.has(i.canonicalKey) || r.push(this.appendResolution(i, {
			confirmingMeasurementId: e.confirmingMeasurementId,
			confirmingResultNodeId: e.confirmingResultNodeId,
			actionId: e.actionId,
			candidateId: e.candidateId,
			editIds: e.editIds,
			ts: n,
			scopeKey: "*"
		})));
		return r;
	}
	appendResolution(e, t) {
		this.resolutionSeq += 1;
		let n = {
			resolutionId: `R${Dm(this.resolutionSeq, 6)}`,
			defectId: e.defectId,
			canonicalKey: e.canonicalKey,
			confirmingMeasurementId: t.confirmingMeasurementId,
			confirmingResultNodeId: t.confirmingResultNodeId,
			causeErrorNodeId: e.latestErrorNodeId,
			scopeKey: t.scopeKey,
			actionId: t.actionId,
			candidateId: t.candidateId,
			editIds: t.editIds ? [...t.editIds] : void 0,
			ts: t.ts
		};
		return this.resolutions.push(n), e.unresolved = !1, n;
	}
	metrics() {
		let e = 0, t = 0, n = 0, r = 0, i = 0;
		for (let a of this.occurrences) a.category === "parse" ? e++ : a.category === "conformance" ? t++ : a.category === "execution" ? n++ : a.category === "crash" ? r++ : i++;
		let a = 0, o = 0;
		for (let e of this.identities.values()) e.unresolved ? a++ : o++;
		return {
			findingOccurrencesTotal: this.occurrences.length,
			findingOccurrencesParse: e,
			findingOccurrencesConformance: t,
			findingOccurrencesExecution: n,
			findingOccurrencesCrash: r,
			findingOccurrencesTestFailure: i,
			uniqueDefectsObserved: this.identities.size,
			uniqueDefectsResolved: o,
			uniqueDefectsUnresolved: a
		};
	}
	snapshot() {
		return {
			occurrences: this.occurrences.map((e) => ({
				...e,
				editIds: e.editIds ? [...e.editIds] : void 0
			})),
			resolutions: this.resolutions.map((e) => ({
				...e,
				editIds: e.editIds ? [...e.editIds] : void 0
			})),
			identities: [...this.identities.values()].map((e) => ({ ...e })),
			metrics: this.metrics()
		};
	}
	assertInvariants() {
		let e = this.metrics(), t = e.findingOccurrencesParse + e.findingOccurrencesConformance + e.findingOccurrencesExecution + e.findingOccurrencesCrash + e.findingOccurrencesTestFailure;
		if (t !== e.findingOccurrencesTotal) throw Error(`defectRegistry: category sum ${t} !== total ${e.findingOccurrencesTotal}`);
		if (e.uniqueDefectsResolved + e.uniqueDefectsUnresolved !== e.uniqueDefectsObserved) throw Error("defectRegistry: resolved + unresolved !== observed");
	}
	toJSONL() {
		let e = [];
		for (let t of this.occurrences) e.push(JSON.stringify({
			kind: "occurrence",
			...t
		}));
		for (let t of this.resolutions) e.push(JSON.stringify({
			kind: "resolution",
			...t
		}));
		return e.join("\n") + (e.length ? "\n" : "");
	}
}, Nm = [
	{
		id: "harness-unresolved-import",
		pattern: "^unresolved import (.+?) \\(from (.+?)\\)$",
		stratum: "mechanical-first",
		classKey: "unresolved-import|$1",
		source: "harness",
		fixture: "unresolved import ./addr (from src/calc)"
	},
	{
		id: "harness-transpile",
		pattern: "^transpile ([^:]+):",
		stratum: "mechanical-first",
		classKey: "transpile|$1",
		source: "harness",
		fixture: "transpile src/a.ts: Unexpected token"
	},
	{
		id: "harness-dynamic-eval",
		pattern: "^dynamic-eval:",
		stratum: "playbook",
		classKey: "dynamic-eval|$0",
		source: "harness",
		fixture: "dynamic-eval: eval( is forbidden in frozen tests/impls"
	},
	{
		id: "harness-stub",
		pattern: "stub: not implemented",
		stratum: "playbook",
		classKey: "runtime|stub-not-implemented",
		source: "harness",
		fixture: "stub: not implemented"
	},
	{
		id: "harness-placeholder",
		pattern: "PLACEHOLDER|__RHA_PLACEHOLDER__",
		stratum: "mechanical-first",
		classKey: "transpile|placeholder",
		source: "harness",
		fixture: "__RHA_PLACEHOLDER__ unresolved"
	},
	{
		id: "harness-crash-loading",
		pattern: "^crash while loading ",
		stratum: "mechanical-first",
		classKey: "crash|load|$0",
		source: "harness",
		fixture: "crash while loading src/a.ts:1"
	},
	{
		id: "harness-crash-exec",
		pattern: "^crash while executing ",
		stratum: "mechanical-first",
		classKey: "crash|exec|$0",
		source: "harness",
		fixture: "crash while executing case \"adds\""
	},
	{
		id: "harness-empty-draw",
		pattern: "unparseable at \"\\(empty\\)\"|unparseable:.*at \"\\(empty\\)\"|^\\(empty\\)$",
		stratum: "mechanical-first",
		classKey: "empty-draw",
		source: "harness",
		fixture: "dropped — unparseable: Unexpected end of input at \"(empty)\""
	},
	{
		id: "harness-provider-desync",
		pattern: "provider desync|desync:|model returned empty",
		stratum: "mechanical-first",
		classKey: "empty-draw",
		source: "harness",
		fixture: "model returned empty"
	},
	{
		id: "harness-boundary-fault",
		pattern: "boundary-fault|seam (?:fault|mismatch)",
		stratum: "mechanical-first",
		classKey: "boundary-fault|$0",
		source: "harness",
		fixture: "boundary-fault seam mismatch"
	},
	{
		id: "harness-vitest-surface",
		pattern: "_vitest\\.(?:it|test|describe)\\.call\\(\\.\\.\\.\\) is not a function|(?:it|test|describe)\\.(?:each|skip|todo|only) is not a function|_vitest\\.(?:it|test|describe)\\.(?:each|skip|todo|only)",
		stratum: "mechanical-first",
		classKey: "harness-vitest-surface",
		source: "harness",
		fixture: "_vitest.it.call(...) is not a function"
	},
	{
		id: "assert-not-toBe",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toBe\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toBe",
		source: "assertion",
		fixture: "expect(...).not.toBe failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toEqual",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toEqual\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toEqual",
		source: "assertion",
		fixture: "expect(...).not.toEqual failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toStrictEqual",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toStrictEqual\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toStrictEqual",
		source: "assertion",
		fixture: "expect(...).not.toStrictEqual failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toThrow",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toThrow\\b failed",
		stratum: "semantic-procedure",
		classKey: "throw-mismatch|not.toThrow",
		source: "assertion",
		fixture: "expect(...).not.toThrow failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toThrowError",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toThrowError\\b failed",
		stratum: "semantic-procedure",
		classKey: "throw-mismatch|not.toThrowError",
		source: "assertion",
		fixture: "expect(...).not.toThrowError failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toMatch",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toMatch\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toMatch",
		source: "assertion",
		fixture: "expect(...).not.toMatch failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toMatchObject",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toMatchObject\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toMatchObject",
		source: "assertion",
		fixture: "expect(...).not.toMatchObject failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toContain",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toContain\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toContain",
		source: "assertion",
		fixture: "expect(...).not.toContain failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toContainEqual",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toContainEqual\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toContainEqual",
		source: "assertion",
		fixture: "expect(...).not.toContainEqual failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toHaveProperty",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toHaveProperty\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toHaveProperty",
		source: "assertion",
		fixture: "expect(...).not.toHaveProperty failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toBeDefined",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toBeDefined\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toBeDefined",
		source: "assertion",
		fixture: "expect(...).not.toBeDefined failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toBeUndefined",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toBeUndefined\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toBeUndefined",
		source: "assertion",
		fixture: "expect(...).not.toBeUndefined failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toBeNull",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toBeNull\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toBeNull",
		source: "assertion",
		fixture: "expect(...).not.toBeNull failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toBeTruthy",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toBeTruthy\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toBeTruthy",
		source: "assertion",
		fixture: "expect(...).not.toBeTruthy failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toBeFalsy",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toBeFalsy\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toBeFalsy",
		source: "assertion",
		fixture: "expect(...).not.toBeFalsy failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toBeGreaterThan",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toBeGreaterThan\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toBeGreaterThan",
		source: "assertion",
		fixture: "expect(...).not.toBeGreaterThan failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toBeGreaterThanOrEqual",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toBeGreaterThanOrEqual\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toBeGreaterThanOrEqual",
		source: "assertion",
		fixture: "expect(...).not.toBeGreaterThanOrEqual failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toBeLessThan",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toBeLessThan\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toBeLessThan",
		source: "assertion",
		fixture: "expect(...).not.toBeLessThan failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toBeLessThanOrEqual",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toBeLessThanOrEqual\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toBeLessThanOrEqual",
		source: "assertion",
		fixture: "expect(...).not.toBeLessThanOrEqual failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toBeCloseTo",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toBeCloseTo\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toBeCloseTo",
		source: "assertion",
		fixture: "expect(...).not.toBeCloseTo failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toBeInstanceOf",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toBeInstanceOf\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toBeInstanceOf",
		source: "assertion",
		fixture: "expect(...).not.toBeInstanceOf failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toHaveLength",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toHaveLength\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toHaveLength",
		source: "assertion",
		fixture: "expect(...).not.toHaveLength failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toHaveBeenCalled",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toHaveBeenCalled\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toHaveBeenCalled",
		source: "assertion",
		fixture: "expect(...).not.toHaveBeenCalled failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toHaveBeenCalledTimes",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toHaveBeenCalledTimes\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toHaveBeenCalledTimes",
		source: "assertion",
		fixture: "expect(...).not.toHaveBeenCalledTimes failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toHaveBeenCalledWith",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toHaveBeenCalledWith\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toHaveBeenCalledWith",
		source: "assertion",
		fixture: "expect(...).not.toHaveBeenCalledWith failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toHaveBeenLastCalledWith",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toHaveBeenLastCalledWith\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toHaveBeenLastCalledWith",
		source: "assertion",
		fixture: "expect(...).not.toHaveBeenLastCalledWith failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toHaveReturned",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toHaveReturned\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toHaveReturned",
		source: "assertion",
		fixture: "expect(...).not.toHaveReturned failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toHaveReturnedWith",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toHaveReturnedWith\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toHaveReturnedWith",
		source: "assertion",
		fixture: "expect(...).not.toHaveReturnedWith failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toSatisfy",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toSatisfy\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toSatisfy",
		source: "assertion",
		fixture: "expect(...).not.toSatisfy failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toMatchSnapshot",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toMatchSnapshot\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toMatchSnapshot",
		source: "assertion",
		fixture: "expect(...).not.toMatchSnapshot failed — actual: 1, expected: 2"
	},
	{
		id: "assert-not-toMatchInlineSnapshot",
		pattern: "expect\\(\\.\\.\\.\\)\\.not\\.toMatchInlineSnapshot\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|not.toMatchInlineSnapshot",
		source: "assertion",
		fixture: "expect(...).not.toMatchInlineSnapshot failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toBe",
		pattern: "expect\\(\\.\\.\\.\\)\\.toBe\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toBe",
		source: "assertion",
		fixture: "expect(...).toBe failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toEqual",
		pattern: "expect\\(\\.\\.\\.\\)\\.toEqual\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toEqual",
		source: "assertion",
		fixture: "expect(...).toEqual failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toStrictEqual",
		pattern: "expect\\(\\.\\.\\.\\)\\.toStrictEqual\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toStrictEqual",
		source: "assertion",
		fixture: "expect(...).toStrictEqual failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toThrow",
		pattern: "expect\\(\\.\\.\\.\\)\\.toThrow\\b failed",
		stratum: "semantic-procedure",
		classKey: "throw-mismatch|toThrow",
		source: "assertion",
		fixture: "expect(...).toThrow failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toThrowError",
		pattern: "expect\\(\\.\\.\\.\\)\\.toThrowError\\b failed",
		stratum: "semantic-procedure",
		classKey: "throw-mismatch|toThrowError",
		source: "assertion",
		fixture: "expect(...).toThrowError failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toMatch",
		pattern: "expect\\(\\.\\.\\.\\)\\.toMatch\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toMatch",
		source: "assertion",
		fixture: "expect(...).toMatch failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toMatchObject",
		pattern: "expect\\(\\.\\.\\.\\)\\.toMatchObject\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toMatchObject",
		source: "assertion",
		fixture: "expect(...).toMatchObject failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toContain",
		pattern: "expect\\(\\.\\.\\.\\)\\.toContain\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toContain",
		source: "assertion",
		fixture: "expect(...).toContain failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toContainEqual",
		pattern: "expect\\(\\.\\.\\.\\)\\.toContainEqual\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toContainEqual",
		source: "assertion",
		fixture: "expect(...).toContainEqual failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toHaveProperty",
		pattern: "expect\\(\\.\\.\\.\\)\\.toHaveProperty\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toHaveProperty",
		source: "assertion",
		fixture: "expect(...).toHaveProperty failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toBeDefined",
		pattern: "expect\\(\\.\\.\\.\\)\\.toBeDefined\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toBeDefined",
		source: "assertion",
		fixture: "expect(...).toBeDefined failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toBeUndefined",
		pattern: "expect\\(\\.\\.\\.\\)\\.toBeUndefined\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toBeUndefined",
		source: "assertion",
		fixture: "expect(...).toBeUndefined failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toBeNull",
		pattern: "expect\\(\\.\\.\\.\\)\\.toBeNull\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toBeNull",
		source: "assertion",
		fixture: "expect(...).toBeNull failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toBeTruthy",
		pattern: "expect\\(\\.\\.\\.\\)\\.toBeTruthy\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toBeTruthy",
		source: "assertion",
		fixture: "expect(...).toBeTruthy failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toBeFalsy",
		pattern: "expect\\(\\.\\.\\.\\)\\.toBeFalsy\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toBeFalsy",
		source: "assertion",
		fixture: "expect(...).toBeFalsy failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toBeGreaterThan",
		pattern: "expect\\(\\.\\.\\.\\)\\.toBeGreaterThan\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toBeGreaterThan",
		source: "assertion",
		fixture: "expect(...).toBeGreaterThan failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toBeGreaterThanOrEqual",
		pattern: "expect\\(\\.\\.\\.\\)\\.toBeGreaterThanOrEqual\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toBeGreaterThanOrEqual",
		source: "assertion",
		fixture: "expect(...).toBeGreaterThanOrEqual failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toBeLessThan",
		pattern: "expect\\(\\.\\.\\.\\)\\.toBeLessThan\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toBeLessThan",
		source: "assertion",
		fixture: "expect(...).toBeLessThan failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toBeLessThanOrEqual",
		pattern: "expect\\(\\.\\.\\.\\)\\.toBeLessThanOrEqual\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toBeLessThanOrEqual",
		source: "assertion",
		fixture: "expect(...).toBeLessThanOrEqual failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toBeCloseTo",
		pattern: "expect\\(\\.\\.\\.\\)\\.toBeCloseTo\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toBeCloseTo",
		source: "assertion",
		fixture: "expect(...).toBeCloseTo failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toBeInstanceOf",
		pattern: "expect\\(\\.\\.\\.\\)\\.toBeInstanceOf\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toBeInstanceOf",
		source: "assertion",
		fixture: "expect(...).toBeInstanceOf failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toHaveLength",
		pattern: "expect\\(\\.\\.\\.\\)\\.toHaveLength\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toHaveLength",
		source: "assertion",
		fixture: "expect(...).toHaveLength failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toHaveBeenCalled",
		pattern: "expect\\(\\.\\.\\.\\)\\.toHaveBeenCalled\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toHaveBeenCalled",
		source: "assertion",
		fixture: "expect(...).toHaveBeenCalled failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toHaveBeenCalledTimes",
		pattern: "expect\\(\\.\\.\\.\\)\\.toHaveBeenCalledTimes\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toHaveBeenCalledTimes",
		source: "assertion",
		fixture: "expect(...).toHaveBeenCalledTimes failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toHaveBeenCalledWith",
		pattern: "expect\\(\\.\\.\\.\\)\\.toHaveBeenCalledWith\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toHaveBeenCalledWith",
		source: "assertion",
		fixture: "expect(...).toHaveBeenCalledWith failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toHaveBeenLastCalledWith",
		pattern: "expect\\(\\.\\.\\.\\)\\.toHaveBeenLastCalledWith\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toHaveBeenLastCalledWith",
		source: "assertion",
		fixture: "expect(...).toHaveBeenLastCalledWith failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toHaveReturned",
		pattern: "expect\\(\\.\\.\\.\\)\\.toHaveReturned\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toHaveReturned",
		source: "assertion",
		fixture: "expect(...).toHaveReturned failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toHaveReturnedWith",
		pattern: "expect\\(\\.\\.\\.\\)\\.toHaveReturnedWith\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toHaveReturnedWith",
		source: "assertion",
		fixture: "expect(...).toHaveReturnedWith failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toSatisfy",
		pattern: "expect\\(\\.\\.\\.\\)\\.toSatisfy\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toSatisfy",
		source: "assertion",
		fixture: "expect(...).toSatisfy failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toMatchSnapshot",
		pattern: "expect\\(\\.\\.\\.\\)\\.toMatchSnapshot\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toMatchSnapshot",
		source: "assertion",
		fixture: "expect(...).toMatchSnapshot failed — actual: 1, expected: 2"
	},
	{
		id: "assert-toMatchInlineSnapshot",
		pattern: "expect\\(\\.\\.\\.\\)\\.toMatchInlineSnapshot\\b failed",
		stratum: "semantic-procedure",
		classKey: "assertion|toMatchInlineSnapshot",
		source: "assertion",
		fixture: "expect(...).toMatchInlineSnapshot failed — actual: 1, expected: 2"
	},
	{
		id: "assert-generic",
		pattern: "expect\\(\\.\\.\\.\\)\\.((?:not\\.)?[A-Za-z]+) failed",
		stratum: "semantic-procedure",
		classKey: "assertion|$1",
		source: "assertion",
		fixture: "expect(...).customMatcher failed — actual: false, expected: true"
	},
	{
		id: "v8-invalid-unexpected-token",
		pattern: "Invalid or unexpected token",
		stratum: "mechanical-first",
		classKey: "crash|token|Invalid or unexpected token",
		source: "v8-syntax",
		fixture: "Invalid or unexpected token"
	},
	{
		id: "v8-unexpected-end",
		pattern: "Unexpected end of input",
		stratum: "mechanical-first",
		classKey: "crash|token|Unexpected end of input",
		source: "v8-syntax",
		fixture: "Unexpected end of input"
	},
	{
		id: "v8-unexpected-identifier",
		pattern: "Unexpected identifier",
		stratum: "mechanical-first",
		classKey: "crash|token|Unexpected identifier",
		source: "v8-syntax",
		fixture: "Unexpected identifier"
	},
	{
		id: "v8-unexpected-string",
		pattern: "Unexpected string",
		stratum: "mechanical-first",
		classKey: "crash|token|Unexpected string",
		source: "v8-syntax",
		fixture: "Unexpected string"
	},
	{
		id: "v8-unexpected-number",
		pattern: "Unexpected number",
		stratum: "mechanical-first",
		classKey: "crash|token|Unexpected number",
		source: "v8-syntax",
		fixture: "Unexpected number"
	},
	{
		id: "v8-reserved-strict",
		pattern: "Unexpected reserved word",
		stratum: "mechanical-first",
		classKey: "crash|token|Unexpected reserved word",
		source: "v8-syntax",
		fixture: "Unexpected reserved word"
	},
	{
		id: "v8-unexpected-token",
		pattern: "Unexpected token",
		stratum: "mechanical-first",
		classKey: "crash|token|Unexpected token",
		source: "v8-syntax",
		fixture: "Unexpected token '}'"
	},
	{
		id: "v8-invalid-regex",
		pattern: "Invalid regular expression",
		stratum: "mechanical-first",
		classKey: "regex-literal|$0",
		source: "v8-syntax",
		fixture: "Invalid regular expression: missing /"
	},
	{
		id: "v8-unterminated-regex",
		pattern: "Unterminated regular expression",
		stratum: "mechanical-first",
		classKey: "regex-literal|$0",
		source: "v8-syntax",
		fixture: "Unterminated regular expression literal"
	},
	{
		id: "v8-unterminated-template",
		pattern: "Unterminated template",
		stratum: "mechanical-first",
		classKey: "crash|token|Unterminated template",
		source: "v8-syntax",
		fixture: "Unterminated template"
	},
	{
		id: "v8-unterminated-string",
		pattern: "Unterminated string",
		stratum: "mechanical-first",
		classKey: "crash|token|Unterminated string",
		source: "v8-syntax",
		fixture: "Unterminated string constant"
	},
	{
		id: "v8-already-declared",
		pattern: "Identifier '([^']+)' has already been declared",
		stratum: "mechanical-first",
		classKey: "duplicate-decl|$1",
		source: "v8-syntax",
		fixture: "Identifier 'Foo' has already been declared"
	},
	{
		id: "v8-missing-paren-arglist",
		pattern: "missing \\) after argument list",
		stratum: "mechanical-first",
		classKey: "crash|token|missing ) after argument list",
		source: "v8-syntax",
		fixture: "missing ) after argument list"
	},
	{
		id: "v8-missing-catch-finally",
		pattern: "Missing catch or finally after try",
		stratum: "mechanical-first",
		classKey: "crash|token|Missing catch or finally",
		source: "v8-syntax",
		fixture: "Missing catch or finally after try"
	},
	{
		id: "v8-illegal-return",
		pattern: "Illegal return statement",
		stratum: "mechanical-first",
		classKey: "crash|token|Illegal return statement",
		source: "v8-syntax",
		fixture: "Illegal return statement"
	},
	{
		id: "v8-invalid-lhs",
		pattern: "Invalid left-hand side",
		stratum: "mechanical-first",
		classKey: "crash|token|Invalid left-hand side",
		source: "v8-syntax",
		fixture: "Invalid left-hand side in assignment"
	},
	{
		id: "v8-missing-initializer",
		pattern: "Missing initializer in (const|let) declaration",
		stratum: "mechanical-first",
		classKey: "crash|token|Missing initializer",
		source: "v8-syntax",
		fixture: "Missing initializer in const declaration"
	},
	{
		id: "v8-await-outside",
		pattern: "await is only valid in async",
		stratum: "mechanical-first",
		classKey: "crash|token|await outside async",
		source: "v8-syntax",
		fixture: "await is only valid in async functions"
	},
	{
		id: "v8-octal",
		pattern: "Octal literals are not allowed",
		stratum: "mechanical-first",
		classKey: "crash|token|Octal literals",
		source: "v8-syntax",
		fixture: "Octal literals are not allowed in strict mode"
	},
	{
		id: "v8-missing-colon",
		pattern: "missing : in conditional",
		stratum: "mechanical-first",
		classKey: "crash|token|missing colon",
		source: "v8-syntax",
		fixture: "missing : in conditional expression"
	},
	{
		id: "v8-not-defined-jest",
		pattern: "^jest is not defined",
		stratum: "mechanical-first",
		classKey: "undefined-symbol|jest",
		source: "v8-runtime",
		fixture: "jest is not defined"
	},
	{
		id: "v8-not-defined-fn",
		pattern: "^fn is not defined",
		stratum: "mechanical-first",
		classKey: "undefined-symbol|fn",
		source: "v8-runtime",
		fixture: "fn is not defined"
	},
	{
		id: "v8-not-a-function-spyOn",
		pattern: "(?:^|\\.)spyOn is not a function|vi\\.spyOn is not a function|spyOn is not a function",
		stratum: "mechanical-first",
		classKey: "is-not-a-function|spyOn",
		source: "v8-runtime",
		fixture: "spyOn is not a function"
	},
	{
		id: "v8-not-defined",
		pattern: "^([A-Za-z_$][\\w$]*) is not defined",
		stratum: "playbook",
		classKey: "undefined-symbol|$1",
		source: "v8-runtime",
		fixture: "slugify is not defined"
	},
	{
		id: "v8-before-init",
		pattern: "Cannot access '([^']+)' before initialization",
		stratum: "playbook",
		classKey: "runtime|before-init|$1",
		source: "v8-runtime",
		fixture: "Cannot access 'x' before initialization"
	},
	{
		id: "v8-not-a-function",
		pattern: "([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*) is not a function",
		stratum: "playbook",
		classKey: "is-not-a-function|$1",
		source: "v8-runtime",
		fixture: "parse is not a function"
	},
	{
		id: "v8-nullread-undef",
		pattern: "Cannot read propert(?:y|ies) of undefined \\(reading '([^']+)'\\)",
		stratum: "playbook",
		classKey: "runtime|nullread|$1",
		source: "v8-runtime",
		fixture: "Cannot read properties of undefined (reading 'id')"
	},
	{
		id: "v8-nullread-null",
		pattern: "Cannot read propert(?:y|ies) of null \\(reading '([^']+)'\\)",
		stratum: "playbook",
		classKey: "runtime|nullread|$1",
		source: "v8-runtime",
		fixture: "Cannot read properties of null (reading 'id')"
	},
	{
		id: "v8-set-undef",
		pattern: "Cannot set propert(?:y|ies) of undefined",
		stratum: "playbook",
		classKey: "runtime|nullwrite|undefined",
		source: "v8-runtime",
		fixture: "Cannot set properties of undefined (setting 'x')"
	},
	{
		id: "v8-set-null",
		pattern: "Cannot set propert(?:y|ies) of null",
		stratum: "playbook",
		classKey: "runtime|nullwrite|null",
		source: "v8-runtime",
		fixture: "Cannot set properties of null (setting 'x')"
	},
	{
		id: "v8-class-needs-new",
		pattern: "Class constructor (\\w+) cannot be invoked without 'new'",
		stratum: "mechanical-first",
		classKey: "catalog-drift|missing-new|$1",
		source: "v8-runtime",
		fixture: "Class constructor Widget cannot be invoked without 'new'"
	},
	{
		id: "v8-interop-not-constructor",
		pattern: "\\(0\\s*,\\s*_\\w+\\.(\\w+)\\)\\s+is not a constructor",
		stratum: "mechanical-first",
		classKey: "catalog-drift|missing-new|$1",
		source: "v8-runtime",
		fixture: "(0 , _widget.Widget) is not a constructor"
	},
	{
		id: "v8-not-constructor",
		pattern: "([A-Za-z_$][\\w$]*) is not a constructor",
		stratum: "mechanical-first",
		classKey: "catalog-drift|missing-new|$1",
		source: "v8-runtime",
		fixture: "Foo is not a constructor"
	},
	{
		id: "v8-not-iterable",
		pattern: "([A-Za-z_$][\\w$]*) is not iterable",
		stratum: "playbook",
		classKey: "runtime|not-iterable|$1",
		source: "v8-runtime",
		fixture: "x is not iterable"
	},
	{
		id: "v8-object-not-iterable",
		pattern: "object is not iterable|is not iterable \\(cannot read",
		stratum: "playbook",
		classKey: "runtime|not-iterable|object",
		source: "v8-runtime",
		fixture: "object is not iterable (cannot read property Symbol(Symbol.iterator))"
	},
	{
		id: "v8-max-stack",
		pattern: "Maximum call stack size exceeded",
		stratum: "playbook",
		classKey: "runtime|max-stack",
		source: "v8-runtime",
		fixture: "Maximum call stack size exceeded"
	},
	{
		id: "v8-cannot-convert",
		pattern: "Cannot convert undefined or null to object",
		stratum: "playbook",
		classKey: "runtime|cannot-convert",
		source: "v8-runtime",
		fixture: "Cannot convert undefined or null to object"
	},
	{
		id: "v8-assign-const",
		pattern: "Assignment to constant variable",
		stratum: "playbook",
		classKey: "runtime|assign-const",
		source: "v8-runtime",
		fixture: "Assignment to constant variable"
	},
	{
		id: "v8-reduce-empty",
		pattern: "Reduce of empty array with no initial value",
		stratum: "playbook",
		classKey: "runtime|reduce-empty",
		source: "v8-runtime",
		fixture: "Reduce of empty array with no initial value"
	},
	{
		id: "v8-invalid-array-length",
		pattern: "Invalid array length",
		stratum: "playbook",
		classKey: "runtime|invalid-array-length",
		source: "v8-runtime",
		fixture: "Invalid array length"
	},
	{
		id: "v8-precision-range",
		pattern: "precision .* out of range|toFixed\\(\\) digits argument must",
		stratum: "playbook",
		classKey: "runtime|range|precision",
		source: "v8-runtime",
		fixture: "toFixed() digits argument must be between 0 and 100"
	},
	{
		id: "v8-in-operator",
		pattern: "Cannot use 'in' operator",
		stratum: "playbook",
		classKey: "runtime|in-operator",
		source: "v8-runtime",
		fixture: "Cannot use 'in' operator to search for 'x' in undefined"
	},
	{
		id: "v8-spread-non-iterable",
		pattern: "Found non-callable @@iterator|is not iterable \\(cannot read property Symbol",
		stratum: "playbook",
		classKey: "runtime|spread-non-iterable",
		source: "v8-runtime",
		fixture: "Found non-callable @@iterator"
	},
	{
		id: "v8-instanceof",
		pattern: "Right-hand side of 'instanceof' is not",
		stratum: "playbook",
		classKey: "runtime|instanceof",
		source: "v8-runtime",
		fixture: "Right-hand side of 'instanceof' is not an object"
	},
	{
		id: "v8-promise-cycle",
		pattern: "Chaining cycle detected for promise",
		stratum: "playbook",
		classKey: "runtime|promise-cycle",
		source: "v8-runtime",
		fixture: "Chaining cycle detected for promise #<Promise>"
	},
	{
		id: "ts-1002",
		pattern: "TS1002\\b|error TS1002\\b|Unterminated string literal\\.",
		stratum: "mechanical-first",
		classKey: "transpile|TS1002",
		source: "typescript",
		fixture: "error TS1002: Unterminated string literal."
	},
	{
		id: "ts-1003",
		pattern: "TS1003\\b|error TS1003\\b|Identifier expected\\.",
		stratum: "mechanical-first",
		classKey: "transpile|TS1003",
		source: "typescript",
		fixture: "error TS1003: Identifier expected."
	},
	{
		id: "ts-1005",
		pattern: "TS1005\\b|error TS1005\\b",
		stratum: "mechanical-first",
		classKey: "transpile|TS1005",
		source: "typescript",
		fixture: "error TS1005: 'Foo' expected."
	},
	{
		id: "ts-1009",
		pattern: "TS1009\\b|error TS1009\\b|Trailing comma not allowed\\.",
		stratum: "mechanical-first",
		classKey: "transpile|TS1009",
		source: "typescript",
		fixture: "error TS1009: Trailing comma not allowed."
	},
	{
		id: "ts-1010",
		pattern: "TS1010\\b|error TS1010\\b|\\'\\*/\\' expected\\.",
		stratum: "mechanical-first",
		classKey: "transpile|TS1010",
		source: "typescript",
		fixture: "error TS1010: '*/' expected."
	},
	{
		id: "ts-1012",
		pattern: "TS1012\\b|error TS1012\\b|Unexpected token\\.",
		stratum: "mechanical-first",
		classKey: "transpile|TS1012",
		source: "typescript",
		fixture: "error TS1012: Unexpected token."
	},
	{
		id: "ts-1068",
		pattern: "TS1068\\b|error TS1068\\b|Unexpected token\\. A constructor, method,",
		stratum: "mechanical-first",
		classKey: "transpile|TS1068",
		source: "typescript",
		fixture: "error TS1068: Unexpected token. A constructor, method, accessor, or property was expected."
	},
	{
		id: "ts-1109",
		pattern: "TS1109\\b|error TS1109\\b|Expression expected\\.",
		stratum: "mechanical-first",
		classKey: "transpile|TS1109",
		source: "typescript",
		fixture: "error TS1109: Expression expected."
	},
	{
		id: "ts-1128",
		pattern: "TS1128\\b|error TS1128\\b|Declaration or statement expected\\.",
		stratum: "mechanical-first",
		classKey: "transpile|TS1128",
		source: "typescript",
		fixture: "error TS1128: Declaration or statement expected."
	},
	{
		id: "ts-1160",
		pattern: "TS1160\\b|error TS1160\\b|Unterminated template literal\\.",
		stratum: "mechanical-first",
		classKey: "transpile|TS1160",
		source: "typescript",
		fixture: "error TS1160: Unterminated template literal."
	},
	{
		id: "ts-1161",
		pattern: "TS1161\\b|error TS1161\\b|Unterminated regular expression literal\\.",
		stratum: "mechanical-first",
		classKey: "transpile|TS1161",
		source: "typescript",
		fixture: "error TS1161: Unterminated regular expression literal."
	},
	{
		id: "ts-1434",
		pattern: "TS1434\\b|error TS1434\\b|Unexpected keyword or identifier\\.",
		stratum: "mechanical-first",
		classKey: "transpile|TS1434",
		source: "typescript",
		fixture: "error TS1434: Unexpected keyword or identifier."
	},
	{
		id: "ts-2304",
		pattern: "TS2304\\b|error TS2304\\b|Cannot find name \\'",
		stratum: "playbook",
		classKey: "undefined-symbol|TS2304",
		source: "typescript",
		fixture: "error TS2304: Cannot find name 'Foo'."
	},
	{
		id: "ts-2305",
		pattern: "TS2305\\b|error TS2305\\b",
		stratum: "playbook",
		classKey: "unresolved-import|TS2305",
		source: "typescript",
		fixture: "error TS2305: Module 'Foo' has no exported member 'Bar'."
	},
	{
		id: "ts-2306",
		pattern: "TS2306\\b|error TS2306\\b",
		stratum: "semantic-procedure",
		classKey: "runtime|TS2306",
		source: "typescript",
		fixture: "error TS2306: File 'Foo' is not a module."
	},
	{
		id: "ts-2307",
		pattern: "TS2307\\b|error TS2307\\b|Cannot find module \\'",
		stratum: "playbook",
		classKey: "unresolved-import|TS2307",
		source: "typescript",
		fixture: "error TS2307: Cannot find module 'Foo' or its corresponding type declarations."
	},
	{
		id: "ts-2322",
		pattern: "TS2322\\b|error TS2322\\b",
		stratum: "semantic-procedure",
		classKey: "runtime|TS2322",
		source: "typescript",
		fixture: "error TS2322: Type 'Foo' is not assignable to type 'Bar'."
	},
	{
		id: "ts-2339",
		pattern: "TS2339\\b|error TS2339\\b",
		stratum: "semantic-procedure",
		classKey: "runtime|TS2339",
		source: "typescript",
		fixture: "error TS2339: Property 'Foo' does not exist on type 'Bar'."
	},
	{
		id: "ts-2345",
		pattern: "TS2345\\b|error TS2345\\b|Argument of type \\'",
		stratum: "semantic-procedure",
		classKey: "runtime|TS2345",
		source: "typescript",
		fixture: "error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'Bar'."
	},
	{
		id: "ts-2459",
		pattern: "TS2459\\b|error TS2459\\b",
		stratum: "playbook",
		classKey: "unresolved-import|TS2459",
		source: "typescript",
		fixture: "error TS2459: Module 'Foo' declares 'Bar' locally, but it is not exported."
	},
	{
		id: "ts-2551",
		pattern: "TS2551\\b|error TS2551\\b",
		stratum: "semantic-procedure",
		classKey: "runtime|TS2551",
		source: "typescript",
		fixture: "error TS2551: Property 'Foo' does not exist on type 'Bar'. Did you mean '{2}'?"
	},
	{
		id: "ts-2552",
		pattern: "TS2552\\b|error TS2552\\b|Cannot find name \\'",
		stratum: "playbook",
		classKey: "undefined-symbol|TS2552",
		source: "typescript",
		fixture: "error TS2552: Cannot find name 'Foo'. Did you mean 'Bar'?"
	},
	{
		id: "ts-2554",
		pattern: "TS2554\\b|error TS2554\\b",
		stratum: "semantic-procedure",
		classKey: "runtime|TS2554",
		source: "typescript",
		fixture: "error TS2554: Expected Foo arguments, but got Bar."
	},
	{
		id: "ts-7006",
		pattern: "TS7006\\b|error TS7006\\b",
		stratum: "semantic-procedure",
		classKey: "runtime|TS7006",
		source: "typescript",
		fixture: "error TS7006: Parameter 'Foo' implicitly has an 'Bar' type."
	}
];
function Pm(e, t, n) {
	let r = e;
	for (let e = 1; e < t.length; e++) r = r.split("$" + e).join(t[e] ?? "");
	return r = r.split("$0").join(n.slice(0, 40)), r.startsWith("is-not-a-function|") && t[1] && (r = "is-not-a-function|" + (t[1].split(".").pop() ?? t[1])), r;
}
function Fm(e) {
	let t = e ?? "";
	if (t.trim() === "") return {
		templateId: "harness-empty-draw",
		stratum: "mechanical-first",
		classKey: "empty-draw"
	};
	let n = t.split("\n")[0] ?? "";
	for (let e of Nm) {
		let r = new RegExp(e.pattern, "i"), i = r.exec(n);
		if (i ||= r.exec(t), i) return {
			templateId: e.id,
			stratum: e.stratum,
			classKey: Pm(e.classKey, i, n)
		};
	}
	return {
		templateId: "catalog-drift",
		stratum: "catalog-drift",
		classKey: "catalog-drift"
	};
}
function Im(e) {
	return "catalog-drift: \"" + ((e ?? "").split("\n")[0] ?? "").slice(0, 120).replace(/"/g, "'") + "\" matches no template";
}
//#endregion
//#region src/tier1/solutionStrata.generated.ts
var Lm = /* @__PURE__ */ s({
	SOLUTION_STRATA: () => Rm,
	strategyOrderForClass: () => Vm
}), Rm = [
	{
		classFamily: "assertion",
		findingShare: .4,
		resolutionByStrategy: {
			draws: .5,
			"oracle-hint-repair": .35,
			surgery: .7,
			mechanical: .05,
			"lessons-repair": .25,
			reset: .1
		},
		note: "~40% of findings; ~50% resolve via draws"
	},
	{
		classFamily: "throw-mismatch",
		findingShare: .25,
		resolutionByStrategy: {
			draws: .6,
			"oracle-hint-repair": .4,
			surgery: .7,
			mechanical: .02,
			"lessons-repair": .2,
			reset: .1
		},
		note: "~25% of findings; ~60% resolve via draws"
	},
	{
		classFamily: "undefined-symbol|jest",
		findingShare: .05,
		resolutionByStrategy: {
			mechanical: .95,
			draws: 0,
			"oracle-hint-repair": 0,
			surgery: 0,
			"lessons-repair": 0,
			reset: 0
		},
		note: "mock-API mechanical only — 0% via draws"
	},
	{
		classFamily: "undefined-symbol|fn",
		findingShare: .05,
		resolutionByStrategy: {
			mechanical: .95,
			draws: 0,
			"oracle-hint-repair": 0,
			surgery: 0,
			"lessons-repair": 0,
			reset: 0
		},
		note: "mock-API mechanical only — 0% via draws"
	},
	{
		classFamily: "is-not-a-function|spyOn",
		findingShare: .05,
		resolutionByStrategy: {
			mechanical: .95,
			draws: 0,
			"oracle-hint-repair": 0,
			surgery: 0,
			"lessons-repair": 0,
			reset: 0
		},
		note: "mock-API mechanical only — 0% via draws"
	},
	{
		classFamily: "mock-api",
		findingShare: .15,
		resolutionByStrategy: {
			mechanical: .95,
			draws: 0,
			"oracle-hint-repair": 0,
			surgery: 0,
			"lessons-repair": 0,
			reset: 0
		},
		note: "aggregate mock-API family (~15% findings, 0% draws)"
	},
	{
		classFamily: "transpile",
		findingShare: .08,
		resolutionByStrategy: {
			"lessons-repair": .55,
			mechanical: .4,
			surgery: .7,
			"oracle-hint-repair": .25,
			draws: .15,
			reset: .1
		},
		note: "~8% of findings; ~55% via lessons-repair"
	},
	{
		classFamily: "undefined-symbol",
		findingShare: .1,
		resolutionByStrategy: {
			mechanical: .7,
			"oracle-hint-repair": .4,
			draws: .3,
			"lessons-repair": .25,
			surgery: .7,
			reset: .1
		}
	},
	{
		classFamily: "is-not-a-function",
		findingShare: .05,
		resolutionByStrategy: {
			mechanical: .2,
			"oracle-hint-repair": .45,
			draws: .4,
			surgery: .7,
			"lessons-repair": .2,
			reset: .1
		}
	},
	{
		classFamily: "regex-literal",
		findingShare: .03,
		resolutionByStrategy: {
			mechanical: .8,
			surgery: .7,
			"lessons-repair": .3,
			draws: .1,
			"oracle-hint-repair": .2,
			reset: .05
		}
	},
	{
		classFamily: "empty-draw",
		findingShare: .04,
		resolutionByStrategy: {
			mechanical: .6,
			reset: .2,
			draws: 0,
			surgery: .4,
			"oracle-hint-repair": 0,
			"lessons-repair": .1
		},
		note: "empty draws skip model attempts; clade/template first"
	},
	{
		classFamily: "runtime",
		findingShare: .08,
		resolutionByStrategy: {
			"oracle-hint-repair": .4,
			draws: .35,
			surgery: .7,
			mechanical: .1,
			"lessons-repair": .25,
			reset: .15
		}
	},
	{
		classFamily: "crash",
		findingShare: .05,
		resolutionByStrategy: {
			mechanical: .5,
			surgery: .7,
			"lessons-repair": .3,
			draws: .15,
			"oracle-hint-repair": .2,
			reset: .1
		}
	},
	{
		classFamily: "catalog-drift",
		findingShare: 0,
		resolutionByStrategy: {
			surgery: .7,
			reset: .3,
			draws: .1,
			mechanical: 0,
			"oracle-hint-repair": .05,
			"lessons-repair": .05
		},
		note: "tripwire residual — escalate only after catalog miss"
	}
], zm = [
	"mechanical",
	"oracle-hint-repair",
	"lessons-repair",
	"draws",
	"surgery",
	"reset"
];
function Bm(e) {
	if (!e) return;
	let t = Rm.find((t) => t.classFamily === e);
	if (t) return t;
	let n = e.split("|")[0], r = Rm.find((e) => e.classFamily === n);
	if (r) return r;
	if (e === "undefined-symbol|jest" || e === "undefined-symbol|fn" || e === "is-not-a-function|spyOn") return Rm.find((e) => e.classFamily === "mock-api");
}
function Vm(e) {
	let t = Bm(e);
	if (!t) return [...zm];
	let n = t.resolutionByStrategy;
	return [...zm].sort((e, t) => (n[t] ?? 0) - (n[e] ?? 0));
}
//#endregion
//#region src/tier1/substrate.ts
function Hm(e) {
	return e === "crash" || e === "duplicate-decl" || e === "regex-literal";
}
function Um(e) {
	return e.kind === "assertion" ? e.detail.expected == null && e.detail.received == null ? null : `assertion diff (${e.detail.matcher ?? "matcher"}): expected ${e.detail.expected ?? "(missing)"} , received ${e.detail.received ?? "(missing)"}` : e.kind === "throw-mismatch" ? `throw-mismatch: expected ${e.detail.expectedThrow === !1 ? "no-throw" : "throw"} vs actual ${e.detail.threw ? `threw: ${e.detail.thrownMessage ?? e.detail.received ?? "(unknown)"}` : "no-throw"}` + (e.detail.expected == null ? "" : ` (matcher expected: ${e.detail.expected})`) : null;
}
function Wm(e) {
	return th("__suite__", e).classKey;
}
function Gm(e, t, n) {
	let r = e.detail.file;
	if (!r) return !1;
	let i = n ? [...t, n] : t, a = i.find((e) => e.path === r) ?? i.find((e) => dh(e.path) === dh(r));
	if (!a) return !1;
	let o = e.detail.symbol;
	return !o || RegExp(`\\b${o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\b`).test(a.content);
}
var Km = /^(undefined-symbol\|(jest|fn)|is-not-a-function\|spyOn)$/;
function qm(e) {
	return e ? Km.test(e) || e === "empty-draw" : !1;
}
function Jm(e) {
	return e ? e === "runtime|stub-not-implemented" || /(^|\|)stub-not-implemented(\||$)/.test(e) : !1;
}
function Ym(e, t, n) {
	if (e.trim() === t.trim()) return !0;
	if (!n) return /stub:\s*not implemented/i.test(e) && /stub:\s*not implemented/i.test(t);
	let r = (e) => {
		let t = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), r = RegExp(`export\\s+(?:async\\s+)?function\\s+${t}\\s*\\([^)]*\\)[^{]*\\{`).exec(e), i = r ? null : RegExp(`(?:export\\s+)?const\\s+${t}\\s*=[^=>{;\\n]*=>\\s*`).exec(e), a = !r && !i ? RegExp(`(?:export\\s+)?class\\s+${t}\\b[^{]*\\{[\\s\\S]*?constructor\\s*\\([^)]*\\)\\s*\\{`).exec(e) : null, o = r ?? i ?? a;
		if (!o) return null;
		let s = e.indexOf("{", o.index + o[0].length - 1);
		if (s < 0) return null;
		let c = 0;
		for (let t = s; t < e.length; t++) if (e[t] === "{") c++;
		else if (e[t] === "}" && (c--, c === 0)) return e.slice(s + 1, t).trim();
		return null;
	}, i = r(e), a = r(t);
	return i != null && a != null ? i === a : /stub:\s*not implemented/i.test(e) && e.trim() === t.trim();
}
function Xm(e, t) {
	if (!e || !/^undefined-symbol\|/.test(e)) return !1;
	let n = e.slice(17);
	return !n || n === "jest" || n === "fn" ? !1 : yh(t, n) != null;
}
function Zm(e) {
	let t = Math.max(0, Math.floor(e));
	return `${t} empty draw${t === 1 ? "" : "s"}`;
}
function Qm(e) {
	let t = e ?? "";
	return !!(/unparseable at "\(empty\)"/i.test(t) || /unparseable:.*at "\(empty\)"/i.test(t) || /^model returned empty$/i.test(t.trim()) || t.trim() === "" || t.trim() === "(empty)");
}
function $m(e, t) {
	let n = Fm(t);
	return {
		...e,
		templateId: n.templateId,
		stratum: n.stratum
	};
}
function eh(e) {
	let t = e.split("|")[0] ?? "runtime";
	return [
		"unresolved-import",
		"undefined-symbol",
		"is-not-a-function",
		"transpile",
		"regex-literal",
		"duplicate-decl",
		"assertion",
		"throw-mismatch",
		"runtime",
		"crash",
		"empty-draw",
		"catalog-drift"
	].includes(t) ? t : "runtime";
}
function th(e, t) {
	return $m(nh(e, t), t);
}
function nh(e, t) {
	let n = t.split("\n")[0];
	if (Qm(t)) return {
		kind: "empty-draw",
		classKey: "empty-draw",
		name: e,
		message: t,
		detail: {}
	};
	let r = cd(t);
	if (r) {
		let n = t.split("\n").filter((e) => !/^\s*at\s/.test(e) && !/^crash while executing /.test(e) && !/^crash while loading /.test(e)).join("\n").trim(), i = n ? th(e, n) : null, a = r.localLine == null ? r.caseName ? r.module.endsWith(".test") || /tests?\//.test(r.module) ? r.module.endsWith(".ts") ? r.module : `${r.module}.ts` : void 0 : r.module !== "(unknown)" && r.module !== "(suite)" ? r.module.endsWith(".ts") ? r.module : `${r.module}.ts` : void 0 : r.module.endsWith(".ts") || r.module.endsWith(".js") ? r.module : `${r.module}.ts`;
		return i && i.kind !== "runtime" && i.kind !== "crash" ? {
			...i,
			message: t,
			detail: {
				...i.detail,
				file: i.detail.file ?? a,
				caseName: r.caseName ?? void 0
			}
		} : {
			kind: "crash",
			classKey: r.localLine == null ? r.caseName ? `crash|exec|${r.caseName.slice(0, 40)}` : `crash|exec|${r.module.slice(0, 40)}` : `crash|load|${(a ?? r.module).slice(0, 40)}`,
			name: e,
			message: t,
			detail: {
				file: a,
				caseName: r.caseName ?? void 0
			}
		};
	}
	if (/^dynamic-eval:/.test(n)) return {
		kind: "runtime",
		classKey: `dynamic-eval|${n.replace(/^dynamic-eval:\s*/, "").slice(0, 40)}`,
		name: e,
		message: t,
		detail: {}
	};
	let i = /^unresolved import (.+?) \(from (.+?)\)$/.exec(n);
	if (i) return {
		kind: "unresolved-import",
		classKey: `unresolved-import|${i[1]}`,
		name: e,
		message: t,
		detail: {
			spec: i[1],
			importer: i[2]
		}
	};
	if (i = /^transpile ([^:]+):/.exec(n), i) return {
		kind: "transpile",
		classKey: `transpile|${i[1]}`,
		name: e,
		message: t,
		detail: { file: i[1] }
	};
	if (i = /expect\(\.\.\.\)\.((?:not\.)?[A-Za-z]+) failed/.exec(n), i) {
		let r = i[1], a = r.includes("toThrow") ? "throw-mismatch" : "assertion", o = /actual:\s*(.*?)(?:,\s*expected:|$)/.exec(n), s = /,\s*expected:\s*(.*)$/.exec(n), c = o ? o[1].trim() : void 0, l = {
			matcher: r,
			expected: s ? s[1].trim() : void 0,
			received: c
		};
		return a === "throw-mismatch" && (l.expectedThrow = !r.startsWith("not."), c && c !== "undefined" && c !== "(resolved)" ? (l.threw = !0, l.thrownMessage = c) : l.threw = !1), {
			kind: a,
			classKey: `${a}|${r}`,
			name: e,
			message: t,
			detail: l
		};
	}
	if (i = /^([A-Za-z_$][\w$]*) is not defined/.exec(n), i) return {
		kind: "undefined-symbol",
		classKey: `undefined-symbol|${i[1]}`,
		name: e,
		message: t,
		detail: { symbol: i[1] }
	};
	if (i = /\(0\s*,\s*([A-Za-z_$][\w$]*)\)\s+is not a function/.exec(n), i) return {
		kind: "is-not-a-function",
		classKey: `is-not-a-function|${i[1]}`,
		name: e,
		message: t,
		detail: { symbol: i[1] }
	};
	if (i = /([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*) is not a function/.exec(n), i) {
		let n = i[1].split(".").pop();
		return {
			kind: "is-not-a-function",
			classKey: `is-not-a-function|${n}`,
			name: e,
			message: t,
			detail: { symbol: n }
		};
	}
	if (i = /Class constructor (\w+) cannot be invoked without 'new'/.exec(n), i || (i = /\(0\s*,\s*_\w+\.(\w+)\)\s+is not a constructor/.exec(n), i)) return {
		kind: "catalog-drift",
		classKey: `catalog-drift|missing-new|${i[1]}`,
		name: e,
		message: t,
		detail: { symbol: i[1] }
	};
	if (i = /([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*) is not a constructor/.exec(n), i) {
		let n = i[1].split(".").pop();
		return {
			kind: "catalog-drift",
			classKey: `catalog-drift|missing-new|${n}`,
			name: e,
			message: t,
			detail: { symbol: n }
		};
	}
	if (i = /Cannot read propert(?:y|ies) of (?:undefined|null) \(reading '([^']+)'\)/.exec(n), i) return {
		kind: "runtime",
		classKey: `runtime|nullread|${i[1]}`,
		name: e,
		message: t,
		detail: { symbol: i[1] }
	};
	if (i = /Identifier '([A-Za-z_$][\w$]*)' has already been declared/i.exec(n), i) return {
		kind: "duplicate-decl",
		classKey: `duplicate-decl|${i[1]}`,
		name: e,
		message: t,
		detail: { symbol: i[1] }
	};
	if (/Invalid regular expression/i.test(n)) {
		let r = /Invalid regular expression:\s*(\/[\s\S]*?\/[gimsuy]*)\s*:/.exec(n) ?? /Invalid regular expression:\s*(\/[^\s]+)/.exec(n);
		return {
			kind: "regex-literal",
			classKey: `regex-literal|${n.slice(0, 40)}`,
			name: e,
			message: t,
			detail: r ? { pattern: r[1] } : {}
		};
	}
	if (/Invalid or unexpected token|Unexpected token|Unexpected end of input|Unexpected identifier/i.test(n)) return {
		kind: "crash",
		classKey: `crash|token|${n.slice(0, 40)}`,
		name: e,
		message: t,
		detail: {}
	};
	if (e === "__suite__") return {
		kind: "crash",
		classKey: "crash|suite",
		name: e,
		message: t,
		detail: {}
	};
	let a = Fm(t);
	return a.templateId === "catalog-drift" ? {
		kind: "catalog-drift",
		classKey: "catalog-drift",
		name: e,
		message: t,
		detail: {}
	} : {
		kind: eh(a.classKey),
		classKey: a.classKey,
		name: e,
		message: t,
		detail: {}
	};
}
function rh(e, t) {
	if (e.length === 0) return {
		status: "refused",
		reason: "zero candidates"
	};
	if (e.length > 4) return {
		status: "refused",
		reason: `>4 candidates (${e.length})`
	};
	let n = e.map((e) => ({
		c: e,
		fit: t(e)
	})), r = (e, t) => e.parseClean === t.parseClean ? e.filesTouched === t.filesTouched ? e.pathOrderKey < t.pathOrderKey ? -1 : +(e.pathOrderKey > t.pathOrderKey) : e.filesTouched - t.filesTouched : e.parseClean ? -1 : 1;
	n.sort((e, t) => r(e.fit, t.fit));
	let i = n[0], a = n.filter((e) => r(e.fit, i.fit) === 0);
	return a.length > 1 ? {
		status: "refused",
		reason: `fitness tie among ${a.length} candidates`
	} : {
		status: "picked",
		winner: i.c
	};
}
function ih(e) {
	if (e == null) return !1;
	let t = e.trim();
	if (t === "true" || t === "false" || t === "null" || /^-?\d+(\.\d+)?([eE][+-]?\d+)?$/.test(t)) return !0;
	if (t.length >= 2) {
		let e = t[0];
		if ((e === "\"" || e === "'") && t[t.length - 1] === e) {
			if (e === "\"") try {
				return JSON.parse(t), !0;
			} catch {
				return !1;
			}
			return !0;
		}
	}
	return !1;
}
function ah(e) {
	return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function oh(e) {
	let t = e.trim();
	if (t.length >= 2 && (t[0] === "\"" || t[0] === "'") && t[t.length - 1] === t[0]) {
		let e = t.slice(1, -1);
		return [`"${e}"`, `'${e}'`];
	}
	return [t];
}
function sh(e, t) {
	let n = e.trim();
	if ((t.startsWith("'") || t.startsWith("\"")) && (n.startsWith("\"") || n.startsWith("'")) && n.length >= 2) {
		let e = t[0];
		return `${e}${n.slice(1, -1)}${e}`;
	}
	return n;
}
function ch(e, t) {
	let n = t.trim(), r = [], i = /^(true|false|null|-?\d+(\.\d+)?([eE][+-]?\d+)?)$/.test(n);
	for (let t of e) if (i) {
		let e = RegExp(`(?<![A-Za-z0-9_$])${ah(n)}(?![A-Za-z0-9_$])`, "g"), i;
		for (; (i = e.exec(t.content)) !== null;) r.push({
			path: t.path,
			index: i.index,
			form: i[0],
			content: t.content
		});
	} else {
		let e = /* @__PURE__ */ new Set();
		for (let i of oh(n)) {
			let n = 0;
			for (; n <= t.content.length;) {
				let a = t.content.indexOf(i, n);
				if (a < 0) break;
				e.has(a) || (e.add(a), r.push({
					path: t.path,
					index: a,
					form: i,
					content: t.content
				})), n = a + i.length;
			}
		}
	}
	return r;
}
function lh(e, t) {
	let n = e.detail.matcher ?? "";
	if (e.kind !== "assertion" || !(n === "toBe" || e.classKey === "assertion|toBe")) return null;
	let r = e.detail.received, i = e.detail.expected;
	if (!ih(r) || !ih(i)) return null;
	let a = ch(t, r);
	if (a.length === 0) return null;
	if (a.length > 1) return {
		fix: null,
		status: "refused",
		reason: "ambiguous literal occurrence"
	};
	let o = a[0], s = sh(i, o.form), c = o.content.slice(0, o.index) + s + o.content.slice(o.index + o.form.length);
	return c === o.content ? null : Ad(c) == null ? {
		status: "fixed",
		fix: {
			path: o.path,
			content: c,
			note: `spec-constant: replaced received ${o.form} → ${s} in ${o.path} (0 tok)`,
			classKey: e.classKey
		}
	} : {
		fix: null,
		status: "refused",
		reason: "spec-constant replace not parse-clean"
	};
}
var uh = (e) => e.toLowerCase().replace(/[-_]/g, ""), dh = (e) => e.replace(/\.(ts|js|mjs|cjs)$/, ""), fh = (e) => e.replace(/\.(ts|js|mjs|cjs)$/, "");
function ph(e, t) {
	let n = fh(t);
	return e.find((e) => dh(e.path) === n) ?? e.find((e) => e.path === t) ?? e.find((e) => dh(e.path).endsWith(`/${n.split("/").pop()}`));
}
function mh(e, t) {
	let n = fh(e).split("/").slice(0, -1);
	if (n.join("/") === t.split("/").slice(0, -1).join("/")) return `./${t.split("/").pop()}`;
	let r = n.length;
	return `${"../".repeat(r)}${t}`;
}
function hh(e, t, n) {
	for (let r of ["'", "\""]) {
		let i = `from ${r}${t}${r}`;
		if (e.includes(i)) return e.split(i).join(`from ${r}${n}${r}`);
		let a = `import ${r}${t}${r}`;
		if (e.includes(a)) return e.split(a).join(`import ${r}${n}${r}`);
	}
	return null;
}
function gh(e) {
	return e.status === "catalog-drift" ? "catalog-drift" : e.status === "cataloged" || e.status === "no-handler" ? `cataloged (stratum: ${e.stratum ?? e.reason?.match(/stratum:\s*([^)]+)/)?.[1]?.trim() ?? "unknown"})` : e.status;
}
var _h = /* @__PURE__ */ new Set([
	"unresolved-import",
	"undefined-symbol",
	"regex-literal",
	"duplicate-decl",
	"transpile",
	"crash"
]);
function vh(e) {
	let t = [], n = /* @__PURE__ */ new Set(), r = 0, i = null, a = 0, o = (e) => {
		n.has(e) || (n.add(e), t.push(e));
	};
	for (; a < e.length;) {
		let t = e[a];
		if (i) {
			if (t === "\\") {
				a += 2;
				continue;
			}
			t === i && (i = null), a++;
			continue;
		}
		if (t === "\"" || t === "'" || t === "`") {
			i = t, a++;
			continue;
		}
		if (t === "/" && e[a + 1] === "/") {
			for (; a < e.length && e[a] !== "\n";) a++;
			continue;
		}
		if (t === "/" && e[a + 1] === "*") {
			for (a += 2; a < e.length && !(e[a] === "*" && e[a + 1] === "/");) a++;
			a += 2;
			continue;
		}
		if (t === "{") {
			r++, a++;
			continue;
		}
		if (t === "}") {
			r = Math.max(0, r - 1), a++;
			continue;
		}
		if (r !== 0) {
			a++;
			continue;
		}
		let n = e.slice(a), s = /^(?:export\s+)?(?:default\s+)?(?:async\s+)?(?:function\*?|class|const|let|var|type|interface|enum)\s+([A-Za-z_$][\w$]*)/.exec(n);
		if (s) {
			o(s[1]), a += s[0].length;
			continue;
		}
		a++;
	}
	return t;
}
function yh(e, t) {
	let n = RegExp(`export\\s+(?:default\\s+)?(?:async\\s+)?(?:function\\*?|class|const|let|var|type|interface|enum)\\s+${t}\\b`);
	for (let n of e.features) for (let e of n.exports) if (e.symbol === t) return e.file;
	for (let t of e.features) for (let e of t.stubs) if (n.test(e.content)) return e.path;
	return null;
}
function bh(e, t) {
	let n = 0, r = null, i = 0;
	for (; i < e.length;) {
		let a = e[i];
		if (r) {
			if (a === "\\") {
				i += 2;
				continue;
			}
			a === r && (r = null), i++;
			continue;
		}
		if (a === "\"" || a === "'" || a === "`") {
			r = a, i++;
			continue;
		}
		if (a === "/" && e[i + 1] === "/") {
			for (; i < e.length && e[i] !== "\n";) i++;
			continue;
		}
		if (a === "/" && e[i + 1] === "*") {
			for (i += 2; i < e.length && !(e[i] === "*" && e[i + 1] === "/");) i++;
			i += 2;
			continue;
		}
		if (a === "{") {
			n++, i++;
			continue;
		}
		if (a === "}") {
			n = Math.max(0, n - 1), i++;
			continue;
		}
		if (n !== 0) {
			i++;
			continue;
		}
		let o = e.slice(i), s = /^(export\s+)?(?:default\s+)?(?:async\s+)?(function\*?|class|const|let|var)\s+([A-Za-z_$][\w$]*)/.exec(o);
		if (s && s[3] === t) {
			let t = i, n = s[2];
			if (s[1], i += s[0].length, n === "class" || n.startsWith("function")) {
				for (; i < e.length && e[i] !== "{";) {
					if (e[i] === "\"" || e[i] === "'" || e[i] === "`") {
						let t = e[i];
						for (i++; i < e.length && e[i] !== t;) e[i] === "\\" && i++, i++;
						i++;
						continue;
					}
					i++;
				}
				if (e[i] === "{") {
					let t = 0;
					for (; i < e.length; i++) {
						let n = e[i];
						if (n === "\"" || n === "'" || n === "`") {
							let t = n;
							for (i++; i < e.length && e[i] !== t;) e[i] === "\\" && i++, i++;
							continue;
						}
						if (n === "{") t++;
						else if (n === "}" && (t--, t === 0)) {
							i++;
							break;
						}
					}
				}
			} else {
				let t = 0;
				for (; i < e.length;) {
					let n = e[i];
					if (n === "\"" || n === "'" || n === "`") {
						let t = n;
						for (i++; i < e.length && e[i] !== t;) e[i] === "\\" && i++, i++;
						i++;
						continue;
					}
					if (n === "{") t++;
					else if (n === "}") t = Math.max(0, t - 1);
					else if (t === 0 && (n === ";" || n === "\n")) {
						i++;
						break;
					}
					i++;
				}
			}
			for (; i < e.length && (e[i] === "\n" || e[i] === ";");) i++;
			return e.slice(0, t) + e.slice(i);
		}
		i++;
	}
	return null;
}
function xh(e, t, n, r) {
	return RegExp(`import\\s*(?:type\\s*)?\\{[^}]*\\b${t}\\b[^}]*\\}\\s*from\\s*['"]${n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}['"]`).test(e) ? r && !RegExp(`export\\s*\\{[^}]*\\b${t}\\b`).test(e) ? `export { ${t} };\n${e}` : e : r ? `export { ${t} } from '${n}';\n${e}` : `import { ${t} } from '${n}';\n${e}`;
}
function Sh(e, t) {
	if (!/^[A-Za-z_$][\w$]*$/.test(t)) return null;
	let n = RegExp(`\\b(?:new\\s+)?${ah(t)}\\s*\\(`, "g"), r = !1, i = e.replace(n, (t, n) => {
		if (/^new\s/.test(t)) return t;
		let i = e.slice(Math.max(0, n - 20), n);
		return /\b(?:async\s+)?function\s*$/.test(i) || /\bclass\s*$/.test(i) || /\b(?:get|set|static)\s*$/.test(i) ? t : (r = !0, `new ${t}`);
	});
	return r ? i : null;
}
function Ch(e, t) {
	if (!/^[A-Za-z_$][\w$]*$/.test(t)) return null;
	let n = RegExp(`export\\s+const\\s+${t}\\s*=\\s*(?:async\\s+)?function\\s*\\(`);
	if (n.test(e)) {
		let r = e.replace(n, `export function ${t}(`);
		return r === e ? null : r;
	}
	let r = RegExp(`export\\s+async\\s+function\\s+${t}\\b`);
	if (r.test(e)) return e.replace(r, `export function ${t}`);
	let i = RegExp(`export\\s+const\\s+${t}\\s*=\\s*(?:async\\s*)?(\\([^)]*\\)|[A-Za-z_$][\\w$]*)\\s*=>\\s*`).exec(e);
	if (!i) return null;
	let a = i[1], o = a.startsWith("(") ? a : `(${a})`, s = i.index, c = i.index + i[0].length;
	if (e[c] === "{") {
		let n = 0, r = c, i = null;
		for (; r < e.length; r++) {
			let t = e[r];
			if (i) {
				if (t === "\\") {
					r++;
					continue;
				}
				t === i && (i = null);
				continue;
			}
			if (t === "\"" || t === "'" || t === "`") {
				i = t;
				continue;
			}
			if (t === "{") n++;
			else if (t === "}" && (n--, n === 0)) {
				r++;
				break;
			}
		}
		if (n !== 0) return null;
		let a = r;
		e[a] === ";" && a++;
		let l = e.slice(c, r);
		return e.slice(0, s) + `export function ${t}${o} ${l}` + e.slice(a);
	}
	let l = 0, u = c, d = null;
	for (; u < e.length; u++) {
		let t = e[u];
		if (d) {
			if (t === "\\") {
				u++;
				continue;
			}
			t === d && (d = null);
			continue;
		}
		if (t === "\"" || t === "'" || t === "`") {
			d = t;
			continue;
		}
		if (t === "(" || t === "[" || t === "{") l++;
		else if (t === ")" || t === "]" || t === "}") l = Math.max(0, l - 1);
		else if ((t === ";" || t === "\n") && l === 0) break;
	}
	let f = e.slice(c, u).trim();
	if (!f) return null;
	let p = u;
	return e[p] === ";" && p++, e.slice(0, s) + `export function ${t}${o} { return ${f}; }` + e.slice(p);
}
function wh(e, t, n) {
	if (!/^catalog-drift\|missing-new\|/.test(e.classKey)) return null;
	let r = e.detail.symbol ?? e.classKey.slice(26);
	if (!r || !/^[A-Za-z_$][\w$]*$/.test(r)) return {
		fix: null,
		status: "refused",
		reason: "missing-new symbol unproven"
	};
	let i = `catalog-drift|missing-new|${r}`, a = RegExp(`(?:^|\\n)[ \\t]*export\\s+(?:default\\s+)?class\\s+${r}\\b`), o = t.filter((e) => a.test(e.content));
	if (o.length === 1) {
		let e = Sh(n.content, r);
		if (e && e !== n.content && Ad(e) == null) return {
			status: "fixed",
			fix: {
				path: n.path,
				content: e,
				note: `missing-new: inserted 'new' before ${r}(...) in ${n.path} (0 tok)`,
				classKey: i
			}
		};
	} else if (o.length > 1) return {
		fix: null,
		status: "refused",
		reason: `ambiguous: class ${r} declared in ${o.length} files`
	};
	if (!RegExp(`\\bnew\\s+${r}\\s*\\(`).test(n.content)) return {
		fix: null,
		status: "refused",
		reason: "missing-new call shape unproven"
	};
	let s = RegExp(`export\\s+const\\s+${r}\\s*=|export\\s+async\\s+function\\s+${r}\\b`), c = t.filter((e) => s.test(e.content));
	if (c.length === 0) return {
		fix: null,
		status: "refused",
		reason: `no const/arrow donor for '${r}'`
	};
	if (c.length > 1) return {
		fix: null,
		status: "refused",
		reason: `ambiguous: ${c.length} const/arrow donors for '${r}'`
	};
	let l = c[0], u = Ch(l.content, r);
	return !u || u === l.content ? {
		fix: null,
		status: "refused",
		reason: "const/arrow → constructor rewrite failed"
	} : Ad(u) == null ? {
		status: "fixed",
		fix: {
			path: l.path,
			content: u,
			note: `missing-new: rewrote ${r} to constructor in ${l.path} (0 tok)`,
			classKey: i
		}
	} : {
		fix: null,
		status: "refused",
		reason: "constructor rewrite not parse-clean"
	};
}
function Th(e, t, n) {
	let r = e.detail.symbol;
	if (!r || !/^[A-Za-z_$][\w$]*$/.test(r)) return null;
	let i = n.content, a = RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*\\.\\s*${r}\\s*\\(`).exec(i), o = null;
	if (a) {
		let e = a[1], t = RegExp(`(?:const|let|var)\\s+${e}\\s*=\\s*(?:await\\s+)?new\\s+([A-Za-z_$][\\w$]*)\\s*\\(`).exec(i);
		t ? o = {
			kind: "instance",
			klass: t[1]
		} : /^[A-Z]/.test(e) && (o = {
			kind: "static",
			klass: e
		});
	} else RegExp(`(?:^|[^.\\w$])${r}\\s*\\(`).test(i) && (o = { kind: "bare" });
	if (!o) return null;
	let s = RegExp(`(?:^|\\n)[ \\t]*(?:export\\s+)?(?:async\\s+)?function\\s+${r}\\b|(?:^|\\n)[ \\t]*(?:export\\s+)?const\\s+${r}\\s*=`), c = (e) => RegExp(`(?:^|\\n)[ \\t]*export\\s+(?:default\\s+)?class\\s+${e}\\b`), l = RegExp(`\\n[ \\t]+(?:public\\s+|private\\s+|protected\\s+)?(?:static\\s+)?(?:async\\s+)?${r}\\s*\\(`), u = (e, t) => {
		let n = e.slice(e.search(c(t))), r = /constructor\s*\(([^)]*)\)/.exec(n);
		if (!r) return !0;
		let i = r[1].trim();
		return i === "" || /^\.\.\./.test(i) || /=/.test(i.split(",")[0] ?? "");
	}, d = (e) => `member-conformance: ${e} (exact-name delegation, 0 tok)`, f = (t, n, r) => ({
		status: "fixed",
		fix: {
			path: t.path,
			content: `${t.content}\n// SET 61 — mechanical member conformance (0 tok)\n${n}\n`,
			note: d(r),
			classKey: e.classKey
		},
		fixes: void 0
	});
	if (o.kind === "instance" || o.kind === "static") {
		let e = o.klass, n = t.filter((t) => c(e).test(t.content));
		if (n.length !== 1) return {
			fix: null,
			status: "refused",
			reason: `class ${e} declared in ${n.length} files`
		};
		let i = n[0];
		if (o.kind === "instance") {
			if (s.test(i.content)) return f(i, `(${e}.prototype as unknown as Record<string, unknown>)["${r}"] = function (...args: unknown[]) { return (${r} as unknown as (...a: unknown[]) => unknown)(...args); };`, `prototype ${e}.${r} → module ${r} (same file)`);
			let n = t.filter((e) => e.path !== i.path && s.test(e.content) && RegExp(`export\\s+(?:async\\s+)?(?:function|const)\\s+${r}\\b`).test(e.content));
			return n.length === 1 ? f(i, `import { ${r} as __rha61_${r} } from '${mh(dh(i.path), dh(n[0].path))}';\n(${e}.prototype as unknown as Record<string, unknown>)["${r}"] = function (...args: unknown[]) { return (__rha61_${r} as unknown as (...a: unknown[]) => unknown)(...args); };`, `prototype ${e}.${r} → ${n[0].path} export ${r}`) : n.length > 1 ? {
				fix: null,
				status: "refused",
				reason: `ambiguous: ${n.length} exported '${r}' donors`
			} : l.test(i.content) === !1 ? {
				fix: null,
				status: "refused",
				reason: `no exact-name donor for '${r}'`
			} : null;
		}
		return s.test(i.content) ? f(i, `(${e} as unknown as Record<string, unknown>)["${r}"] = function (...args: unknown[]) { return (${r} as unknown as (...a: unknown[]) => unknown)(...args); };`, `static ${e}.${r} → module ${r}`) : l.test(i.content) && u(i.content, e) ? f(i, `(${e} as unknown as Record<string, unknown>)["${r}"] = function (...args: unknown[]) { return ((new ${e}()) as unknown as Record<string, (...a: unknown[]) => unknown>)["${r}"](...args); };`, `static ${e}.${r} → instance method (zero-arg ctor)`) : {
			fix: null,
			status: "refused",
			reason: `no provable donor for static ${e}.${r}`
		};
	}
	let p = t.filter((e) => /(?:^|\n)[ \t]*export\s+(?:default\s+)?class\s+[A-Za-z_$][\w$]*/.test(e.content) && l.test(e.content));
	if (p.length !== 1) return p.length === 0 ? {
		fix: null,
		status: "refused",
		reason: `no exact-name donor for bare '${r}'`
	} : {
		fix: null,
		status: "refused",
		reason: `ambiguous: ${p.length} class donors for '${r}'`
	};
	let m = p[0], h = /(?:^|\n)[ \t]*export\s+(?:default\s+)?class\s+([A-Za-z_$][\w$]*)/.exec(m.content)?.[1];
	return !h || !u(m.content, h) ? {
		fix: null,
		status: "refused",
		reason: "donor class constructor not provably zero-arg"
	} : f(m, `export const ${r} = (...args: unknown[]) => (((new ${h}()) as unknown as Record<string, (...a: unknown[]) => unknown>)["${r}"])(...args);`, `module ${r} → ${h}.${r} (zero-arg ctor)`);
}
function Eh(e, t, n, r) {
	if (e.kind === "empty-draw" || e.classKey === "empty-draw") return {
		fix: null,
		status: "cataloged",
		stratum: "mechanical-first",
		reason: "cataloged (stratum: mechanical-first) — empty-draw routes to clade template, not model"
	};
	if (e.kind === "catalog-drift" && /^catalog-drift\|missing-new\|/.test(e.classKey)) return wh(e, t, n) || {
		fix: null,
		status: "refused",
		reason: "missing-new preconditions unmet"
	};
	if (!qm(e.classKey)) {
		if (e.kind === "assertion") {
			let n = lh(e, t);
			if (n) return n;
			let r = Fm(e.message);
			return r.templateId === "catalog-drift" || e.templateId === "catalog-drift" ? {
				fix: null,
				status: "catalog-drift",
				stratum: "catalog-drift",
				reason: Im(e.message)
			} : {
				fix: null,
				status: "cataloged",
				stratum: r.stratum === "catalog-drift" ? "semantic-procedure" : r.stratum,
				reason: `cataloged (stratum: ${r.stratum})`
			};
		} else if (!_h.has(e.kind) && e.kind !== "is-not-a-function") {
			let t = Fm(e.message);
			return t.templateId === "catalog-drift" || e.kind === "catalog-drift" || e.templateId === "catalog-drift" ? {
				fix: null,
				status: "catalog-drift",
				stratum: "catalog-drift",
				reason: Im(e.message)
			} : {
				fix: null,
				status: "cataloged",
				stratum: t.stratum === "catalog-drift" ? "semantic-procedure" : t.stratum,
				reason: `cataloged (stratum: ${t.stratum})`
			};
		} else if (!_h.has(e.kind) && e.kind === "is-not-a-function" && !qm(e.classKey)) {
			let r = Th(e, t, n);
			if (r) return r;
			let i = Fm(e.message);
			return {
				fix: null,
				status: "cataloged",
				stratum: i.stratum === "catalog-drift" ? "playbook" : i.stratum,
				reason: `cataloged (stratum: ${i.stratum === "catalog-drift" ? "playbook" : i.stratum})`
			};
		}
	}
	let i = [...t, n];
	if (e.kind === "duplicate-decl" && e.detail.symbol) {
		let n = e.detail.symbol, i = t.filter((e) => vh(e.content).includes(n));
		if (i.length < 2) return {
			fix: null,
			status: "refused",
			reason: "identifier not declared in ≥2 modules"
		};
		let a = yh(r, n);
		if (!a) return {
			fix: null,
			status: "refused",
			reason: "no stub owner for identifier"
		};
		let o = dh(a);
		if (!t.find((e) => dh(e.path) === o || e.path === a)) return {
			fix: null,
			status: "refused",
			reason: "owner module not in artifact"
		};
		let s = [];
		for (let t of i) {
			if (dh(t.path) === o) continue;
			let r = RegExp(`export\\s+(?:default\\s+)?(?:async\\s+)?(?:function\\*?|class|const|let|var)\\s+${n}\\b`).test(t.content), i = bh(t.content, n);
			if (i == null || i === t.content) return {
				fix: null,
				status: "refused",
				reason: "could not strip non-owner redeclaration"
			};
			let a = mh(dh(t.path), o), c = xh(i, n, a, r);
			s.push({
				path: t.path,
				content: c,
				note: `stripped duplicate '${n}' in ${t.path}; rewired to import from '${a}'`,
				classKey: e.classKey
			});
		}
		return s.length ? {
			status: "fixed",
			fix: s[0],
			fixes: s
		} : {
			fix: null,
			status: "refused",
			reason: "no non-owner redeclaration to strip"
		};
	}
	if (e.kind === "unresolved-import" && e.detail.spec && e.detail.importer) {
		let r = uh(e.detail.spec.replace(/^(\.\.?\/)+/, "").replace(/\.(ts|js)$/, "").split("/").pop() ?? ""), a = [...new Set(t.map((e) => dh(e.path)).filter((e) => uh(e.split("/").pop() ?? "") === r))].sort((e, t) => e.localeCompare(t));
		if (a.length === 0) return {
			fix: null,
			status: "refused",
			reason: "no matching export module"
		};
		let o = ph(i, e.detail.importer) ?? (/\.test\b|tests?\//i.test(e.detail.importer) ? i.find((e) => /\.test\.(ts|js)$/.test(e.path) || e.path === n.path) : void 0);
		if (!o) return {
			fix: null,
			status: "refused",
			reason: "importer file not in artifact"
		};
		let s = dh(o.path), c = [];
		for (let t of a) {
			let n = mh(s, t), r = hh(o.content, e.detail.spec, n);
			r == null || r === o.content || c.push({ fix: {
				path: o.path,
				content: r,
				note: `rewired import '${e.detail.spec}' → '${n}' in ${o.path}`,
				classKey: e.classKey
			} });
		}
		if (c.length === 0) return {
			fix: null,
			status: "refused",
			reason: "import spec rewrite failed"
		};
		if (c.length > 4) return {
			fix: null,
			status: "refused",
			reason: `ambiguous export module (>4 candidates: ${c.length})`,
			candidateSites: a
		};
		let l = rh(c, (e) => ({
			parseClean: Ad(e.fix.content) == null,
			filesTouched: 1,
			pathOrderKey: dh(e.fix.path)
		}));
		return l.status === "refused" ? {
			fix: null,
			status: "refused",
			reason: l.reason.includes("tie") ? `ambiguous export module (${l.reason})` : l.reason,
			candidateSites: a
		} : {
			status: "fixed",
			fix: l.winner.fix
		};
	}
	if (e.kind === "undefined-symbol" && e.detail.symbol) {
		let a = e.detail.symbol;
		if (a === "jest") {
			let t = kd(n.content);
			return t && Ad(t) == null && !Od(t) && (((e) => e.replace(/\bjest\b/g, "vi"))(n.content) === t || t.includes("vi.")) ? {
				status: "fixed",
				fix: {
					path: n.path,
					content: t,
					note: `rewrote jest → vi in ${n.path} (0 tok)`,
					classKey: e.classKey
				}
			} : {
				fix: null,
				status: "refused",
				reason: "jest rewrite unsafe or unnecessary (harness aliases jest)"
			};
		}
		if (a === "fn") return {
			fix: null,
			status: "refused",
			reason: "mock-API mechanical only — harness binds fn→vi.fn (Stream B); never model"
		};
		let o = yh(r, a), s = [];
		if (o) {
			let e = i.find((e) => dh(e.path) === dh(o) || e.path === o) ?? t.find((e) => dh(e.path) === dh(o) || e.path === o);
			e && (s = [e]);
		}
		if (s.length === 0 && (s = t.filter((e) => RegExp(`export (?:async )?(?:function|class|const|interface|type|enum)\\s+${a}\\b`).test(e.content)).sort((e, t) => dh(e.path).localeCompare(dh(t.path)))), s.length === 0) return {
			fix: null,
			status: "refused",
			reason: "symbol not exported uniquely"
		};
		let c = new Set(s.map((e) => e.path)), l = i.filter((e) => !c.has(e.path) && RegExp(`\\b${a}\\b`).test(e.content) && !RegExp(`import\\s*(?:type\\s*)?\\{[^}]*\\b${a}\\b[^}]*\\}`).test(e.content)).sort((e, t) => dh(e.path).localeCompare(dh(t.path)));
		if (l.length === 0) return {
			fix: null,
			status: "refused",
			reason: "no unique import site"
		};
		let u = [];
		for (let t of s) {
			let n = dh(t.path);
			for (let t of l) {
				let r = mh(dh(t.path), n), i = `import { ${a} } from '${r}';\n${t.content}`;
				u.push({ fix: {
					path: t.path,
					content: i,
					note: `added missing import { ${a} } from '${r}' to ${t.path}`,
					classKey: e.classKey
				} });
			}
		}
		if (u.length > 4) return {
			fix: null,
			status: "refused",
			reason: `${s.length > 1 && l.length > 1 ? "ambiguous exporter×import site" : s.length > 1 ? "ambiguous exporter" : "ambiguous import site"} (>4 candidates: ${u.length})`,
			candidateSites: u.map((e) => e.fix.path)
		};
		let d = rh(u, (e) => ({
			parseClean: Ad(e.fix.content) == null,
			filesTouched: 1,
			pathOrderKey: dh(e.fix.path)
		}));
		if (d.status === "refused") {
			let e = s.length > 1 ? "ambiguous exporter" : l.length > 1 ? "ambiguous import site" : "mechanical permutation";
			return {
				fix: null,
				status: "refused",
				reason: d.reason.includes("tie") ? `${e} (${d.reason})` : d.reason,
				candidateSites: u.map((e) => e.fix.path)
			};
		}
		return {
			status: "fixed",
			fix: d.winner.fix
		};
	}
	if (e.kind === "is-not-a-function" && e.detail.symbol === "spyOn") return {
		fix: null,
		status: "refused",
		reason: "mock-API mechanical only — harness binds spyOn→vi.spyOn (Stream B); never model"
	};
	if (e.kind === "regex-literal") {
		let t = i.find((t) => t.path === e.detail.file) ?? null;
		if (!t && e.detail.pattern) {
			let n = e.detail.pattern, r = i.filter((e) => e.content.includes(n));
			if (r.length === 1) t = r[0], e.detail.file = t.path;
			else if (r.length > 1) {
				let n = r.find((e) => !/\.test\.|\/tests?\//.test(e.path));
				n && (t = n, e.detail.file = n.path);
			}
		}
		if (!t) return {
			fix: null,
			status: "refused",
			reason: "regex offender file not attributed"
		};
		let n = kh(t.content);
		if (n && Ad(n) == null) return {
			status: "fixed",
			fix: {
				path: t.path,
				content: n,
				note: `appended missing '/' to unterminated regex literal in ${t.path}`,
				classKey: e.classKey
			}
		};
		let r = Yh(t.content, e.message);
		return r ? {
			status: "fixed",
			fix: {
				path: t.path,
				content: r.content,
				note: `delimiter oracle heal (${r.classKey}) for regex literal in ${t.path}`,
				classKey: e.classKey
			}
		} : {
			fix: null,
			status: "refused",
			reason: "no unterminated regex literal on a line"
		};
	}
	if ((e.kind === "transpile" || e.kind === "crash") && e.detail.file) {
		let t = i.find((t) => t.path === e.detail.file) ?? null;
		if (!t) return {
			fix: null,
			status: "refused",
			reason: "offender file not in artifact"
		};
		let r = e.kind === "transpile" ? e.message.replace(/^transpile [^:]+:\s*/, "") : e.message;
		if (t.path === n.path || /\.test\.(ts|js)$/.test(t.path)) {
			let n = Yh(t.content, r);
			return n ? {
				status: "fixed",
				fix: {
					path: t.path,
					content: n.content,
					note: `delimiter oracle spot-heal (${n.classKey}) on frozen suite ${t.path}`,
					classKey: e.classKey
				}
			} : {
				fix: null,
				status: "refused",
				reason: "suite-side crash — IR surgery"
			};
		}
		let a = Gh(t.content, r);
		if (a) return {
			status: "fixed",
			fix: {
				path: t.path,
				content: a.content,
				note: `parser-guided impl repair (${a.token}) in ${t.path}`,
				classKey: e.classKey
			}
		};
		let o = Yh(t.content, r);
		return o ? {
			status: "fixed",
			fix: {
				path: t.path,
				content: o.content,
				note: `delimiter oracle heal (${o.classKey}) in ${t.path}`,
				classKey: e.classKey
			}
		} : {
			fix: null,
			status: "refused",
			reason: "parser-guided impl repair exhausted"
		};
	}
	return {
		fix: null,
		status: "refused",
		reason: "handler preconditions unmet"
	};
}
function Dh(e, t, n, r) {
	return Eh(e, t, n, r).fix;
}
function Oh(e) {
	let t = 0, n = null;
	for (let r = 0; r < e.length; r++) {
		let i = e[r];
		if (n) {
			if (i === "\\") {
				r++;
				continue;
			}
			i === n && (n = null);
			continue;
		}
		if (i === "\"" || i === "'" || i === "`") {
			n = i;
			continue;
		}
		if (i === "/" && e[r + 1] === "/" || i === "/" && e[r + 1] === "*") break;
		if (i === "\\") {
			r++;
			continue;
		}
		i === "/" && t++;
	}
	return t > 0 && t % 2 == 1;
}
function kh(e) {
	let t = e.split("\n"), n = !1, r = t.map((e) => {
		if (!Oh(e)) return e;
		let t = e.replace(/\s+$/, "");
		return t.endsWith("/") ? e : (n = !0, `${t}/`);
	});
	return n ? r.join("\n") : null;
}
function Ah(e) {
	return !e.includes("expect(") || Od(e) ? !1 : jd([{
		name: "_",
		body: e
	}]).length === 0;
}
function jh(e) {
	return e.replace(/[\u2018\u2019\u201A\u201B]/g, "'").replace(/[\u201C\u201D\u201E\u201F]/g, "\"");
}
function Mh(e) {
	return e.replace(/,(\s*[)\]}])/g, "$1");
}
function Nh(e) {
	let t = [], n = {
		")": "(",
		"]": "[",
		"}": "{"
	}, r = {
		"(": ")",
		"[": "]",
		"{": "}"
	}, i = null;
	for (let r = 0; r < e.length; r++) {
		let a = e[r];
		if (i) {
			if (a === "\\") {
				r++;
				continue;
			}
			a === i && (i = null);
			continue;
		}
		if (a === "\"" || a === "'" || a === "`") {
			i = a;
			continue;
		}
		a === "(" || a === "[" || a === "{" ? t.push(a) : a in n && t.length && t[t.length - 1] === n[a] && t.pop();
	}
	let a = e;
	for (; t.length;) a += r[t.pop()];
	return a;
}
function Ph(e) {
	let t = jh(e), n = t === e ? "noop" : "quotes";
	if (Ah(t) && t !== e) return {
		body: t,
		token: "quotes"
	};
	if (Ah(t)) return {
		body: t,
		token: "already-clean"
	};
	let r = Nh(t);
	r !== t && (t = r, n = "closers");
	let i = Mh(t);
	return i !== t && (t = i, n = "trailing-comma"), t = Mh(Nh(t)), t !== e && Ah(t) ? {
		body: t,
		token: n === "noop" ? "combined" : n
	} : null;
}
function Fh(e, t) {
	let n = /(?:expected ["']([^"']+)["'][^\(]*)?\((\d+):(\d+)\)/i.exec(e);
	if (!n) return null;
	let r = n[1], i = Number(n[2]), a = Number(n[3]), o = t.replace(/\r\n/g, "\n").split("\n"), s = i - 2;
	if (s < 0 || s >= o.length) return i === 1 ? {
		offset: Math.min(Math.max(a, 0), t.length),
		expected: r
	} : null;
	let c = 0;
	for (let e = 0; e < s; e++) c += o[e].length + 1;
	return c += Math.min(a, o[s].length), {
		offset: Math.min(c, t.length),
		expected: r
	};
}
function Ih(e, t, n, r) {
	return t < 0 || t > e.length ? null : n === "insert" ? r ? e.slice(0, t) + r + e.slice(t) : null : t >= e.length ? null : e.slice(0, t) + e.slice(t + 1);
}
function Lh(e) {
	let t = [], n = 0, r = null;
	for (let i = 0; i < e.length; i++) {
		let a = e[i];
		if (r) {
			if (a === "\\") {
				i++;
				continue;
			}
			a === r && (r = null);
			continue;
		}
		if (a === "\"" || a === "'" || a === "`") {
			r = a;
			continue;
		}
		a === "(" || a === "[" || a === "{" ? n++ : a === ")" || a === "]" || a === "}" ? n = Math.max(0, n - 1) : a === "." && n > 0 && t.push(i);
	}
	return t;
}
function Rh(e) {
	let t = null;
	for (let n = 0; n < e.length; n++) {
		let r = e[n];
		if (t) {
			if (r === "\\") {
				n++;
				continue;
			}
			r === t && (t = null);
			continue;
		}
		(r === "\"" || r === "'" || r === "`") && (t = r);
	}
	if (!t) return null;
	let n = t === "`" ? "template" : "string";
	return {
		next: e + t,
		token: `close-${n}`
	};
}
function zh(e) {
	let t = 0, n = null;
	for (let r = 0; r < e.length; r++) {
		let i = e[r];
		if (n) {
			if (i === "\\") {
				r++;
				continue;
			}
			i === n && (n = null);
			continue;
		}
		if (i === "\"" || i === "'" || i === "`") {
			n = i;
			continue;
		}
		i === "{" ? t++ : i === "}" && (t = Math.max(0, t - 1));
	}
	return t <= 0 ? null : {
		next: e + "}".repeat(t),
		token: `close-braces:${t}`
	};
}
function Bh(e, t) {
	let n = [], r = (t, r) => {
		if (t < 0 || t >= e.length) return;
		let i = e[t];
		i !== "\"" && i !== "'" && i !== "`" || n.push({
			next: e.slice(0, t) + e.slice(t + 1),
			token: `delete-stray:${r}`
		});
	};
	t != null && (r(t, "at"), r(t - 1, "before"), r(t + 1, "after"));
	for (let t = e.length - 1; t >= 0; t--) {
		let r = e[t];
		if (r === "\"" || r === "'" || r === "`") {
			n.push({
				next: e.slice(0, t) + e.slice(t + 1),
				token: "delete-stray:last"
			});
			break;
		}
	}
	return n;
}
function Vh(e, t, n = 3) {
	if (Ah(e)) return {
		body: e,
		token: "already-clean"
	};
	let r = [{
		body: e,
		depth: 0,
		lastErr: t
	}], i = /* @__PURE__ */ new Set([e]);
	for (; r.length;) {
		let e = r.shift();
		if (e.depth >= n) continue;
		let t = Fh(e.lastErr, e.body), a = [];
		if (t) {
			if (t.expected) {
				let n = Ih(e.body, t.offset, "insert", t.expected);
				n && a.push({
					next: n,
					token: `insert:${t.expected}`
				});
			}
			for (let n of [
				")",
				"]",
				"}",
				"\"",
				"'",
				"`"
			]) {
				let r = Ih(e.body, t.offset, "insert", n);
				r && a.push({
					next: r,
					token: `insert:${n}`
				});
			}
			let n = Ih(e.body, t.offset, "delete");
			n && a.push({
				next: n,
				token: "delete"
			}), a.push(...Bh(e.body, t.offset));
		}
		for (let t of Lh(e.body)) {
			let n = Ih(e.body, t, "insert", ")");
			n && a.push({
				next: n,
				token: "insert:)-before-dot"
			});
		}
		let o = Rh(e.body);
		o && a.push(o);
		let s = zh(e.body);
		s && a.push(s), a.push(...Bh(e.body, null));
		let c = Nh(Mh(e.body));
		c !== e.body && a.push({
			next: c,
			token: "balance"
		});
		for (let t of a) {
			if (i.has(t.next)) continue;
			if (i.add(t.next), Ah(t.next)) return {
				body: t.next,
				token: t.token
			};
			let n = jd([{
				name: "_",
				body: t.next
			}])[0]?.error;
			n && r.push({
				body: t.next,
				depth: e.depth + 1,
				lastErr: n
			});
		}
	}
	return null;
}
function Hh(e, t) {
	let n = Ph(e);
	if (n && n.token !== "already-clean" || n?.token === "already-clean") return {
		body: n.body,
		token: n.token,
		via: "mechanical"
	};
	let r = t ?? jd([{
		name: "_",
		body: e
	}])[0]?.error;
	if (!r) return null;
	let i = Vh(e, r);
	return i ? {
		body: i.body,
		token: i.token,
		via: "parser-guided"
	} : null;
}
function Uh(e) {
	return Ad(e) == null;
}
function Wh(e, t) {
	let n = /(?:expected ["']([^"']+)["'][^\(]*)?\((\d+):(\d+)\)/i.exec(e);
	if (!n) return null;
	let r = n[1], i = Number(n[2]), a = Number(n[3]), o = t.replace(/\r\n/g, "\n").split("\n"), s = i - 1;
	if (s < 0 || s >= o.length) return i === 1 ? {
		offset: Math.min(Math.max(a, 0), t.length),
		expected: r
	} : null;
	let c = 0;
	for (let e = 0; e < s; e++) c += o[e].length + 1;
	return c += Math.min(a, o[s].length), {
		offset: Math.min(c, t.length),
		expected: r
	};
}
function Gh(e, t, n = 3) {
	if (Uh(e)) return {
		content: e,
		token: "already-clean"
	};
	let r = jh(e);
	r = Mh(Nh(r));
	let i = Rh(r);
	if (i && (r = i.next), r !== e && Uh(r)) return {
		content: r,
		token: "mechanical-prepass"
	};
	let a = Ad(r) ?? t, o = [{
		content: r,
		depth: 0,
		lastErr: a
	}], s = /* @__PURE__ */ new Set([e, r]);
	for (; o.length;) {
		let e = o.shift();
		if (e.depth >= n) continue;
		let t = Wh(e.lastErr, e.content), r = [];
		if (t) {
			if (t.expected) {
				let n = Ih(e.content, t.offset, "insert", t.expected);
				n && r.push({
					next: n,
					token: `insert:${t.expected}`
				});
			}
			for (let n of [
				")",
				"]",
				"}",
				"\"",
				"'",
				"`",
				";"
			]) {
				let i = Ih(e.content, t.offset, "insert", n);
				i && r.push({
					next: i,
					token: `insert:${n}`
				});
			}
			let n = Ih(e.content, t.offset, "delete");
			n && r.push({
				next: n,
				token: "delete"
			}), r.push(...Bh(e.content, t.offset));
		}
		for (let t of Lh(e.content)) {
			let n = Ih(e.content, t, "insert", ")");
			n && r.push({
				next: n,
				token: "insert:)-before-dot"
			});
		}
		let i = Rh(e.content);
		i && r.push(i);
		let a = zh(e.content);
		a && r.push(a);
		let c = Nh(Mh(e.content));
		c !== e.content && r.push({
			next: c,
			token: "balance"
		});
		let l = kh(e.content);
		l && r.push({
			next: l,
			token: "regex-slash"
		});
		for (let t of r) {
			if (s.has(t.next)) continue;
			if (s.add(t.next), Uh(t.next)) return {
				content: t.next,
				token: t.token
			};
			let n = Ad(t.next);
			n && o.push({
				content: t.next,
				depth: e.depth + 1,
				lastErr: n
			});
		}
	}
	return null;
}
function Kh(e, t, n) {
	let r = /\.test\.(ts|js)$/.test(e) ? n : n.replace(/^transpile [^:]+:\s*/, ""), i = Yh(t, r), a = i?.content ?? t, o = Gh(a, r), s = o && o.token !== "already-clean", c = s ? o.content : a, l = s ? i ? `delimiter+guided:${o.token}` : o.token : i ? `delimiter:${i.classKey}` : "";
	if (c === t && !i && !s) return null;
	let u = Ad(c);
	if (u != null) {
		let e = Yh(c, u);
		e && e.content !== c && (c = e.content, l = l ? `${l}+delimiter:${e.classKey}` : `delimiter:${e.classKey}`);
	}
	return c === t ? null : {
		content: c,
		token: l || "delimiter"
	};
}
var qh = null;
function Jh(e) {
	qh = e;
}
function Yh(e, t) {
	if (!qh) return null;
	let n = qh(e, t);
	return n ? {
		content: n.content,
		classKey: n.classKey
	} : null;
}
var Xh = /^\s*(?:\d+[.)]\s+|[-*•]\s+)/, Zh = /\b(?:computed(?:\s*styles?)?|getComputedStyle|viewport\s*[≥≤<>]=?\s*\d*|axe-core|axe\.run|focus\s*ring|\d+px(?:\s*(?:at|@|wide|breakpoint))?)\b/i, Qh = [
	{
		capability: "computed-style",
		re: /\b(computed\s*styles?|getComputedStyle|viewport|focus\s*ring|\d+px\b|axe-core|axe\.run)\b/i
	},
	{
		capability: "browser",
		re: /\b(document\.|window\.|localStorage|sessionStorage|DOMContentLoaded|querySelector|playwright|puppeteer|jsdom|browsers?\b)\b/i
	},
	{
		capability: "database",
		re: /\b(CREATE\s+TABLE|ALTER\s+TABLE|BIGSERIAL|tsvector|postgres|postgresql|mysql|sqlite|prisma|drizzle|SELECT\s+.+\s+FROM)\b/i
	},
	{
		capability: "redis",
		re: /\b(redis|ioredis|sliding\s+window)\b/i
	},
	{
		capability: "network",
		re: /\b(SMTP|sendmail|nodemailer|TCP\b|WebSocket|favicon|Content-Type:\s*(image|font|audio|video)\/|fetch\(|axios|http\.createServer|listen\(\s*\d+)\b/i
	},
	{
		capability: "filesystem",
		re: /\b(fs\.promises|readFileSync|writeFileSync|createWriteStream|path\.join\([^)]*process\.cwd)\b/i
	}
];
function $h(e) {
	let t = "", n = "", r = 0;
	for (; r < e.length;) {
		let i = e[r];
		if (i === "`") {
			let i = e.indexOf("`", r + 1);
			if (i < 0) {
				t += e.slice(r);
				break;
			}
			n += ` ${e.slice(r + 1, i)}`, t += " ", r = i + 1;
			continue;
		}
		if (i === "\"" || i === "'") {
			let a = i, o = e.indexOf(a, r + 1);
			if (o > r && /<\/?[A-Za-z]/.test(e.slice(r, o + 1))) {
				n += ` ${e.slice(r + 1, o)}`, t += " ", r = o + 1;
				continue;
			}
		}
		t += i, r++;
	}
	return {
		plain: t,
		code: n
	};
}
var eg = 4;
function tg(e) {
	return !!(/`[^`]*<\/?[A-Za-z][^`]*>/.test(e) || /\b(?:returns?\s+(?:an?\s+)?HTML|innerHTML|outerHTML|textContent|markup|DOM\s+structure|className|data-[\w-]+)\b/i.test(e) || /\b(?:renders?|contains?|includes?)\s+[`'"<\w]/i.test(e));
}
function ng(e, t) {
	let n = e.replace(Xh, "").trim(), r = [];
	if (t === "computed-style") r.push(/(?:when\s+)?viewport\s*[≥≤<>]=?\s*\d+\s*px[^.;]*/i, /computed\s*styles?[^.;]*/i, /getComputedStyle[^.;]*/i, /focus\s*ring[^.;]*/i, /axe-core[^.;]*/i, /\d+px(?:\s*(?:at|@|wide|breakpoint)[^.;]*)?/i);
	else {
		let e = Qh.find((e) => e.capability === t);
		e && r.push(e.re);
	}
	for (let e of r) {
		let t = e.exec(n);
		if (t) return t[0].trim().slice(0, 120);
	}
	return n.slice(0, 120);
}
var rg = /\s*(?:using|with|via|backed\s+by|persisted\s+(?:in|to)|stored\s+in|in)\s+(?:an?\s+)?(?:redis|ioredis|postgres(?:ql)?|mysql|sqlite|(?:the\s+)?database|prisma|drizzle)(?:\s+(?:sorted\s+sets?|sliding\s+window|tables?|schema))?/gi, ig = /\b(?:redis|ioredis|postgres(?:ql)?|mysql|sqlite|database|prisma|drizzle)\b/gi, ag = /\b(?:rate.?limit|sliding\s+window|throttl\w*|quota|at\s+most\s+\d+|per\s+(?:second|minute|hour|day)|dedup\w*|cache|session|counter|token|expir\w*|returns?|rejects?|allows?|blocks?|enforces?|limits?|tracks?|computes?)\b/i, og = /\b(?:sliding\s+window|per\s+(?:second|minute|hour|day)|window|expir\w*|ttl|timeout|time-?based|seconds?|minutes?)\b/i;
function sg(e, t) {
	if (t !== "redis" && t !== "database") return null;
	let n = e.replace(Xh, "").trim(), r = ng(e, t), i = n.replace(rg, "").replace(ig, "").trim().replace(/\s{2,}/g, " ").replace(/\s+([,;.])/g, "$1").replace(/^[,;.\s]+|[,;.\s]+$/g, "");
	if (i.length < 15 || !ag.test(i)) return null;
	let a = og.test(n) ? "sim-clock" : "sim-store";
	return i += a === "sim-clock" ? " [binding excised — simulate with an injected clock; no real timers]" : " [binding excised — simulate with an in-memory store]", {
		behavior: i,
		binding: r,
		simClade: a
	};
}
function cg(e, t) {
	let { plain: n, code: r } = $h(e);
	return t.test(n) ? !0 : !r.trim() || !Zh.test(e) ? !1 : t.test(n + " " + r) && Zh.test(n + " " + r);
}
function lg(e, t) {
	let n = t.trim();
	if (!n) return;
	let r = e.split(/\r?\n/);
	for (let e = 0; e < r.length; e++) {
		let t = r[e], i = t.replace(Xh, "").trim();
		if (t.includes(n) || i === n || i.includes(n) || n.includes(i) && i.length >= 8) return e + 1;
	}
}
function ug(e) {
	let t = [], n = e.split(/\r?\n/), r = n.length > 1;
	for (let e = 0; e < n.length; e++) {
		let i = n[e];
		if (i.trim() && !(r && !Xh.test(i))) for (let { capability: n, re: r } of Qh) {
			if (!cg(i, r)) continue;
			let a = i.trim().slice(0, 80);
			if (tg(i)) {
				let r = i.replace(Xh, "").trim(), o = ng(i, n);
				if (r.replace(o, "").replace(/[\s.,;:()\[\]{}]+/g, "").trim().length < eg) {
					t.push({
						item: a,
						capability: n,
						line: e + 1,
						residueCollapsed: !0
					});
					break;
				}
				t.push({
					item: a,
					capability: n,
					line: e + 1,
					partial: !0,
					clause: o
				});
			} else {
				let r = sg(i, n);
				r ? t.push({
					item: a,
					capability: n,
					line: e + 1,
					partial: !0,
					clause: r.binding,
					behavioralSplit: r
				}) : t.push({
					item: a,
					capability: n,
					line: e + 1
				});
			}
			break;
		}
	}
	return t;
}
function dg(e) {
	let t = e.split(/\r?\n/), n = 0, r = 0, i = 0;
	for (let e of t) {
		if (!Xh.test(e)) continue;
		n++;
		let t = ug(e);
		if (t.length === 0) {
			i++;
			continue;
		}
		r++, t.some((e) => e.partial || e.behavioralSplit) && i++;
	}
	return {
		ok: n === 0 || i > 0,
		itemsScanned: n,
		fenced: r,
		residuePresent: i
	};
}
function fg(e) {
	let t = e.trim();
	t = t.replace(/^\[\d+\]\s*/, ""), t = t.replace(/\s*kind=(behavior|edge|integration)\s*$/i, ""), t = t.trim();
	let n = t.match(/^(?:it|test)\s*\(\s*(['"`])([\s\S]*?)\1\s*\)\s*$/);
	if (n) t = n[2];
	else {
		let e = t.match(/^(?:it|test)\s*\(\s*(['"`])([\s\S]*?)\1\s*\)\s*/);
		e && (t = e[2]);
	}
	if (t = t.trim(), t.length >= 2) {
		let e = t[0], n = t[t.length - 1];
		(e === "'" && n === "'" || e === "\"" && n === "\"") && (t = t.slice(1, -1));
	}
	return t.trim();
}
function pg(e, t) {
	return e === t || fg(e) === fg(t);
}
function mg(e) {
	let t = e.trim().replace(/;?\s*$/, ""), n = /^(?:it|test)\s*\(\s*(['"`])/.exec(t);
	if (!n) return {
		body: e,
		unwrapped: !1
	};
	let r = n.index + n[0].length, i = n[1];
	for (; r < t.length;) {
		let e = t[r];
		if (e === "\\") {
			r += 2;
			continue;
		}
		if (e === i) {
			r++;
			break;
		}
		r++;
	}
	let a = t.slice(r), o = a.match(/^\s*,\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>\s*\{/), s = a.match(/^\s*,\s*(?:async\s+)?function\s*(?:[A-Za-z_$][\w$]*)?\s*\([^)]*\)\s*\{/), c = o || s;
	if (!c) return {
		body: e,
		unwrapped: !1
	};
	let l = r + c[0].length - 1, u = 0, d = null;
	for (let n = l; n < t.length; n++) {
		let r = t[n];
		if (d) {
			if (r === "\\") {
				n++;
				continue;
			}
			r === d && (d = null);
			continue;
		}
		if (r === "\"" || r === "'" || r === "`") {
			d = r;
			continue;
		}
		if (r === "{") u++;
		else if (r === "}" && (u--, u === 0)) {
			let r = t.slice(n + 1).trim();
			if (r !== "" && !/^\)\s*;?\s*$/.test(r)) return {
				body: e,
				unwrapped: !1
			};
			let i = t.slice(l + 1, n).trim();
			return jd([{
				name: "_",
				body: i
			}]).length ? {
				body: e,
				unwrapped: !1
			} : {
				body: i,
				unwrapped: !0
			};
		}
	}
	return {
		body: e,
		unwrapped: !1
	};
}
function hg(e, t) {
	let n = Math.min(e.length, t.length), r = [], i = 0;
	for (let a = 0; a < n; a++) {
		let n = e[a], o = t[a], s = mg(o.body);
		s.unwrapped && i++, r.push({
			...o,
			name: n.name,
			kind: n.kind,
			body: s.body
		});
	}
	return {
		cases: r,
		unwrapFixes: i
	};
}
function gg(e, t, n = 200) {
	let r = /* @__PURE__ */ new Set(), i = [];
	for (let n of [...e, ...t]) {
		if (!n?.classKey || !n?.idiom) continue;
		let e = `${n.classKey}|${n.idiom}`;
		r.has(e) || (r.add(e), i.push(n));
	}
	return i.slice(0, n);
}
function _g(e, t) {
	let n = new Set(t), r = new Set(t.map((e) => e.split("|")[0])), i = /* @__PURE__ */ new Set(), a = [];
	for (let t of e) {
		let e = n.has(t.classKey) || r.has(t.classKey.split("|")[0]), o = `${t.classKey}|${t.idiom}`;
		e && !i.has(o) && (i.add(o), a.push(t));
	}
	return a.slice(0, 12);
}
function vg(e) {
	return e.length ? ["Checked idioms from prior runs (apply mechanically when they match — do not rediscover):", ...e.map((e) => `- ${e.idiom} → ${e.resolution}`)].join("\n") : "";
}
function yg(e, t, n) {
	return {
		classKey: e,
		idiom: t.split("\n")[0].slice(0, 160),
		resolution: n.slice(0, 200),
		ts: (/* @__PURE__ */ new Date()).toISOString()
	};
}
var bg = [
	"transpile",
	"duplicate-decl",
	"regex-literal",
	"crash",
	"unresolved-import",
	"undefined-symbol",
	"is-not-a-function",
	"empty-draw",
	"catalog-drift",
	"runtime",
	"throw-mismatch",
	"assertion"
];
function xg(e) {
	if (!e.length) return [];
	let t = /* @__PURE__ */ new Map();
	for (let n of e) t.set(n.classKey, [...t.get(n.classKey) ?? [], n]);
	return [...t.values()].sort((e, t) => {
		let n = bg.indexOf(e[0].kind), r = bg.indexOf(t[0].kind);
		return n === r ? t.length - e.length : n - r;
	})[0];
}
//#endregion
//#region src/tier1/frozenSuiteGateway.ts
async function Sg(e) {
	let { spec: t, feature: n, prompt: r, parts: i, runSuite: a, stubs: o, overrideContent: s, bypassCaseCertification: c } = e, l = s ?? Np(O(n, i.imports, i.cases), n.testFile, t).content, u = C(l), d = Ad(l), f = Sd(o, {
		path: n.testFile,
		content: l
	}), p = f === pd, m = p ? null : f, h = [];
	if (!c) for (let e of i.cases) {
		let s = await qp({
			spec: t,
			feature: n,
			prompt: r,
			imports: i.imports,
			caseGen: e,
			runSuite: a,
			stubs: o
		});
		h.push(s);
	}
	let g = [], _ = [], v = u.length > 0 || !!d || !!m;
	if (u.length) for (let e of u) g.push(`suite shape: ${e}`);
	d && g.push(`suite syntax: ${d.split("\n")[0].slice(0, 160)}`), m && g.push(`program parse: ${m.split("\n")[0].slice(0, 160)}`), !c && h.length === 0 && g.push("suite has no cases");
	let y = h.filter((e) => (e.disposition === "certified-behavior-red" || e.disposition === "certified-licensed-throw") && !e.provisional), b = h.filter((e) => e.disposition === "certified-anchor" || e.disposition === "certified-dep-seam" || e.provisional), x = h.filter((e) => e.disposition.startsWith("rejected")).map((e) => ({
		caseName: e.caseName,
		disposition: e.disposition,
		reason: e.reason
	}));
	p && _.push("parse probe could not run — gate infrastructure unavailable");
	let S;
	return S = v || !c && h.length === 0 ? "refused" : p ? "uncertified" : y.length >= 1 ? "certified" : b.length >= 1 ? "partial-certified" : c ? "certified" : "refused", {
		status: S,
		featureId: n.id,
		featureTestFile: n.testFile,
		cases: h,
		shapeFindings: u,
		syntaxError: d,
		programParseError: m,
		gateInfrastructureUnavailable: p,
		rejectionReasons: g,
		infrastructureNotes: _,
		droppedCases: x,
		suiteContent: l
	};
}
function Cg(e) {
	return [...e.frozenByFeature.entries()].sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => `${e}:${t.length}:${t.slice(0, 64)}`).join("|");
}
async function wg(e) {
	let t = e.actionLedger ?? null, n = e.beforeSignature ?? Cg(e.state), r;
	t && (r = t.startAction({
		kind: "frozen-suite-commit",
		target: e.feature.id,
		phase: e.reason,
		beforeSignature: n,
		startEvidence: {
			reason: e.reason,
			testFile: e.feature.testFile
		}
	}));
	try {
		let n = await Sg(e);
		if (n.status === "refused") return e.onRejection?.(n), t && r && t.finishAction({
			actionId: r,
			disposition: "rejected",
			afterSignature: Cg(e.state),
			endEvidence: { rejectionReasons: n.rejectionReasons }
		}), {
			status: "rejected",
			report: n,
			actionId: r
		};
		let { state: i, feature: a } = e, o = a.testFile, s = n.suiteContent;
		e.bypassCaseCertification || i.irPartsByFeature.set(a.id, e.parts), i.frozenByFeature.set(a.id, s);
		let c = i.frozenTests.findIndex((e) => e.path === o);
		return c >= 0 ? i.frozenTests[c] = {
			path: o,
			content: s
		} : i.frozenTests.push({
			path: o,
			content: s
		}), e.onAcceptance?.(n), t && r && t.finishAction({
			actionId: r,
			disposition: "applied",
			afterSignature: Cg(i),
			endEvidence: {
				testFile: o,
				bytes: s.length
			}
		}), {
			status: "accepted",
			report: n,
			actionId: r
		};
	} catch (n) {
		throw t && r && t.finishAction({
			actionId: r,
			disposition: "failed",
			failureMode: "fatal",
			error: n,
			afterSignature: Cg(e.state)
		}), n;
	}
}
function Tg(e) {
	return {
		expected: /Expected:\s*([^\n]+)/i.exec(e)?.[1]?.trim() ?? null,
		received: /Received:\s*([^\n]+)/i.exec(e)?.[1]?.trim() ?? null
	};
}
async function Eg(e) {
	let { spec: t, runSuite: n, artifact: r, state: i } = e, a = /* @__PURE__ */ new Map(), o = [], s = [], c = [], l = [], u = [], d = !1, f = new Map(r.map((e) => [e.path, e]));
	for (let e of t.features) if (i.frozenByFeature.has(e.id)) for (let t of e.files) {
		let n = f.get(t);
		(!n || /stub:\s*not implemented/i.test(n.content)) && (c.push(`${e.id}:${t}`), o.push(`${e.id}: missing or unvetted owned file ${t}`));
	}
	for (let c of t.features) {
		let f = i.frozenByFeature.get(c.id);
		if (!f) continue;
		let p = i.irPartsByFeature.get(c.id);
		if (p) {
			Np(O(c, p.imports, p.cases), c.testFile, t).content !== f && (l.push(c.id), o.push(`${c.id}: frozen suite bytes disagree with canonical IRParts reassembly`));
			let e = new Set(c.exports.map((e) => e.symbol)), n = new Set(c.deps.map((e) => t.features.find((t) => t.id === e)?.name).filter((e) => !!e));
			for (let t of p.cases) {
				if (/expect\s*\(\s*\(\s*\)\s*=>/.test(t.body) && /\.not\.toThrow\s*\(\s*\)/.test(t.body) && !/\.toBe\b|\.toEqual\b|\.toThrow\s*\(\s*['"`/]/.test(t.body)) {
					u.push(`${c.id}:${t.name}`), o.push(`${c.id}: case "${t.name}" is provisional (shape-only anchor)`);
					continue;
				}
				let r = e.has(t.name), i = /^uses\s+(.+)$/.exec(t.name)?.[1]?.trim(), a = t.kind === "integration" || !!i && n.has(i);
				(r || a) && (u.push(`${c.id}:${t.name}`), o.push(`${c.id}: case "${t.name}" is provisional (${r ? "class-anchor" : "dep-seam"})`));
			}
		} else o.push(`${c.id}: frozen bytes without canonical IRParts`);
		let m = Ad(f);
		if (m) {
			o.push(`${c.id}: suite syntax: ${m.split("\n")[0].slice(0, 160)}`);
			let e = jm({
				kindHint: "parse",
				message: m
			}), t = "parse|suite-syntax", n = Em;
			s.push({
				featureId: c.id,
				caseId: n,
				classKey: t,
				category: e,
				artifactPath: c.testFile,
				message: m,
				canonicalKey: Am({
					featureId: c.id,
					caseId: n,
					classKey: t,
					artifactPath: c.testFile,
					expected: m,
					received: null
				})
			});
		}
		let h = Sd(r, {
			path: c.testFile,
			content: f
		});
		if (h === "GATE_UNAVAILABLE") d = !0, o.push(`${c.id}: gate infrastructure unavailable`);
		else if (h) {
			o.push(`${c.id}: program parse: ${h.split("\n")[0].slice(0, 160)}`);
			let e = jm({
				kindHint: "parse",
				message: h
			}), t = "parse|program", n = Em;
			s.push({
				featureId: c.id,
				caseId: n,
				classKey: t,
				category: e,
				artifactPath: c.files[0],
				message: h,
				canonicalKey: Am({
					featureId: c.id,
					caseId: n,
					classKey: t,
					artifactPath: c.files[0],
					expected: h,
					received: null
				})
			});
		}
		if (p) {
			let r = await Sg({
				spec: t,
				feature: c,
				prompt: e.prompt,
				parts: p,
				runSuite: n,
				stubs: c.stubs
			});
			a.set(c.id, r);
		}
		let g;
		try {
			g = await n(r, {
				path: c.testFile,
				content: f
			});
		} catch (e) {
			let t = e instanceof Error ? e.message : String(e);
			o.push(`${c.id}: harness crash: ${t.slice(0, 160)}`);
			let n = "crash|harness", r = Em;
			s.push({
				featureId: c.id,
				caseId: r,
				classKey: n,
				category: "crash",
				message: t,
				crashSignature: t,
				canonicalKey: Am({
					featureId: c.id,
					caseId: r,
					classKey: n,
					crashSignature: t
				})
			});
			continue;
		}
		if (g.crashed) {
			o.push(`${c.id}: module/harness crash: ${g.crashed.slice(0, 160)}`);
			let e = th("__suite__", g.crashed), t = e.classKey || "crash|unattributed", n = Em;
			s.push({
				featureId: c.id,
				caseId: n,
				classKey: t,
				category: "crash",
				artifactPath: e.detail.file,
				message: g.crashed,
				crashSignature: g.crashed,
				canonicalKey: Am({
					featureId: c.id,
					caseId: n,
					classKey: t,
					artifactPath: e.detail.file,
					crashSignature: g.crashed
				})
			});
			continue;
		}
		for (let e of g.failures) {
			let t = th(e.name, e.message), { expected: n, received: r } = Tg(e.message), i = jm({
				classKey: t.classKey,
				message: e.message,
				kindHint: t.kind === "assertion" || /expected|received|tobe|tothrow/i.test(e.message) ? "test-failure" : void 0
			}), a = e.name || "@suite", l = t.classKey || `${i}|${a}`, u = {
				featureId: c.id,
				caseId: a,
				classKey: l,
				category: i,
				artifactPath: t.detail.file ?? c.files[0],
				expected: n ?? t.detail.expected ?? null,
				received: r ?? t.detail.received ?? null,
				message: e.message,
				canonicalKey: Am({
					featureId: c.id,
					caseId: a,
					classKey: l,
					artifactPath: t.detail.file ?? c.files[0],
					expected: n ?? t.detail.expected,
					received: r ?? t.detail.received
				})
			};
			s.push(u), o.push(`${c.id}: case "${a}" ${i}: ${e.message.split("\n")[0].slice(0, 160)}`);
		}
	}
	i.frozenByFeature.size === 0 && o.push("no frozen suites — artifact cannot be certified");
	let p = e.uniqueDefectsUnresolved ?? 0, m = e.actionPending ?? 0, h = e.hasDuplicateActionTerminals ?? !1;
	return {
		artifactCertified: o.length === 0 && s.length === 0 && c.length === 0 && l.length === 0 && u.length === 0 && !d && i.frozenByFeature.size > 0 && p === 0 && m === 0 && !h,
		suiteReports: a,
		unresolved: o,
		findings: s,
		gateInfrastructureUnavailable: d,
		missingOwnedFiles: c,
		representationInconsistent: l,
		provisionalCases: u
	};
}
//#endregion
//#region src/tier1/actionLedger.ts
function Dg(e, t) {
	return String(e).padStart(t, "0");
}
function Og(e) {
	return e instanceof Error ? {
		name: e.name,
		message: e.message,
		stack: e.stack
	} : { message: String(e) };
}
var kg = class {
	actionSeq = 0;
	decisionSeq = 0;
	starts = [];
	terminals = [];
	decisions = [];
	pending = /* @__PURE__ */ new Set();
	terminalized = /* @__PURE__ */ new Set();
	clock;
	strict;
	constructor(e = () => (/* @__PURE__ */ new Date()).toISOString(), t) {
		this.clock = e, this.strict = t?.strict ?? !0;
	}
	startAction(e) {
		this.actionSeq += 1;
		let t = `A${Dg(this.actionSeq, 6)}`, n = {
			actionId: t,
			kind: e.kind,
			target: e.target,
			phase: e.phase,
			startEvidence: e.startEvidence ?? null,
			relatedCandidateIds: [...e.relatedCandidateIds ?? []],
			relatedEditIds: [...e.relatedEditIds ?? []],
			beforeSignature: e.beforeSignature,
			ts: e.ts ?? this.clock()
		};
		return this.starts.push(n), this.pending.add(t), t;
	}
	finishAction(e) {
		if (this.terminalized.has(e.actionId)) {
			let t = `actionLedger: double terminal for ${e.actionId}`;
			if (this.strict) throw Error(t);
			return this.terminals.find((t) => t.actionId === e.actionId);
		}
		if (!this.pending.has(e.actionId) && !this.starts.some((t) => t.actionId === e.actionId)) throw Error(`actionLedger: finish without start for ${e.actionId}`);
		let t = {
			actionId: e.actionId,
			disposition: e.disposition,
			failureMode: e.failureMode,
			endEvidence: e.endEvidence ?? null,
			afterSignature: e.afterSignature,
			error: e.error === void 0 ? void 0 : Og(e.error),
			ts: e.ts ?? this.clock()
		};
		return this.terminals.push(t), this.pending.delete(e.actionId), this.terminalized.add(e.actionId), t;
	}
	recordDecision(e) {
		this.decisionSeq += 1;
		let t = {
			decisionId: `AD${Dg(this.decisionSeq, 6)}`,
			kind: e.kind,
			target: e.target,
			phase: e.phase,
			disposition: e.disposition,
			reason: e.reason,
			relatedCandidateIds: [...e.relatedCandidateIds ?? []],
			relatedEditIds: [...e.relatedEditIds ?? []],
			ts: e.ts ?? this.clock()
		};
		return this.decisions.push(t), t;
	}
	async runAction(e) {
		let t = this.startAction(e);
		try {
			let n = await e.fn(), r = e.dispositionOf?.(n) ?? "applied";
			return {
				actionId: t,
				result: n,
				terminal: this.finishAction({
					actionId: t,
					disposition: r,
					endEvidence: { ok: !0 },
					afterSignature: e.afterSignature?.()
				})
			};
		} catch (n) {
			let r = this.finishAction({
				actionId: t,
				disposition: "failed",
				failureMode: "fatal",
				error: n,
				endEvidence: { ok: !1 },
				afterSignature: e.afterSignature?.()
			});
			throw Object.assign(n instanceof Error ? n : Error(String(n)), {
				actionId: t,
				actionTerminal: r
			});
		}
	}
	async runNonfatalAction(e) {
		let t = this.startAction({
			kind: e.kind,
			target: e.target,
			phase: e.phase,
			startEvidence: e.startEvidence
		});
		try {
			return await e.fn(), {
				actionId: t,
				ok: !0,
				terminal: this.finishAction({
					actionId: t,
					disposition: "applied",
					endEvidence: { ok: !0 }
				})
			};
		} catch (e) {
			return {
				actionId: t,
				ok: !1,
				terminal: this.finishAction({
					actionId: t,
					disposition: "failed",
					failureMode: "nonfatal",
					error: e,
					endEvidence: { ok: !1 }
				})
			};
		}
	}
	cancelPending(e = "run cancelled") {
		for (let t of [...this.pending]) this.finishAction({
			actionId: t,
			disposition: "cancelled",
			endEvidence: { reason: e }
		});
	}
	metrics() {
		let e = 0, t = 0, n = 0, r = 0, i = 0, a = 0;
		for (let o of this.terminals) o.disposition === "failed" ? (e++, o.failureMode === "nonfatal" && a++) : o.disposition === "applied" ? t++ : o.disposition === "rejected" ? n++ : o.disposition === "noop" ? r++ : o.disposition === "cancelled" && i++;
		return {
			actionStarts: this.starts.length,
			actionTerminals: this.terminals.length,
			actionDecisions: this.decisions.length,
			actionPending: this.pending.size,
			actionFailed: e,
			actionApplied: t,
			actionRejected: n,
			actionNoop: r,
			actionCancelled: i,
			actionFailedNonfatal: a
		};
	}
	snapshot() {
		return {
			starts: this.starts.map((e) => ({
				...e,
				relatedCandidateIds: [...e.relatedCandidateIds],
				relatedEditIds: [...e.relatedEditIds]
			})),
			terminals: this.terminals.map((e) => ({ ...e })),
			decisions: this.decisions.map((e) => ({
				...e,
				relatedCandidateIds: [...e.relatedCandidateIds],
				relatedEditIds: [...e.relatedEditIds]
			})),
			metrics: this.metrics()
		};
	}
	assertConserved() {
		let e = this.metrics();
		if (e.actionStarts !== e.actionTerminals) throw Error(`actionLedger: starts ${e.actionStarts} !== terminals ${e.actionTerminals}`);
		if (e.actionPending !== 0) throw Error(`actionLedger: ${e.actionPending} pending action(s) at conservation check`);
	}
	renderTerminalLine(e) {
		let t = this.starts.find((t) => t.actionId === e), n = this.terminals.find((t) => t.actionId === e);
		if (!t || !n) return `[action:${e} incomplete]`;
		let r = n.failureMode === "nonfatal" ? "-nonfatal" : "", i = n.error ? ` — ${n.error.message}` : "";
		return `[action:${t.kind}:${t.target} ${e} → ${n.disposition}${r}]${i}`;
	}
	renderStartLine(e) {
		let t = this.starts.find((t) => t.actionId === e);
		return t ? `[action:${t.kind}:${t.target}:${e}] START` : `[action:${e} START?]`;
	}
	toJSONL() {
		let e = [];
		for (let t of this.starts) e.push(JSON.stringify({
			ledgerKind: "start",
			...t
		}));
		for (let t of this.terminals) e.push(JSON.stringify({
			ledgerKind: "terminal",
			...t
		}));
		for (let t of this.decisions) e.push(JSON.stringify({
			ledgerKind: "decision",
			...t
		}));
		return e.join("\n") + (e.length ? "\n" : "");
	}
};
//#endregion
//#region src/tier1/artifactState.ts
function Ag(e, t) {
	return String(e).padStart(t, "0");
}
function jg(e, t = 16) {
	let n = 2166136261;
	for (let t = 0; t < e.length; t++) n ^= e.charCodeAt(t), n = Math.imul(n, 16777619);
	let r = 2166136261;
	for (let t = e.length - 1; t >= 0; t--) r ^= e.charCodeAt(t), r = Math.imul(r, 16777619);
	return ((n >>> 0).toString(16).padStart(8, "0") + (r >>> 0).toString(16).padStart(8, "0")).slice(0, t);
}
function Mg(e) {
	return jg(e, 16);
}
function Ng(e) {
	return jg([...e].map((e) => `${e.path}:${Mg(e.content)}`).sort().join("\n"), 24);
}
var Pg = class {
	built = /* @__PURE__ */ new Map();
	edits = [];
	editSeq = 0;
	candidateSeq = 0;
	clock;
	ledger;
	constructor(e) {
		this.clock = e?.clock ?? (() => (/* @__PURE__ */ new Date()).toISOString()), this.ledger = e?.ledger ?? null;
	}
	files() {
		return [...this.built.values()].map((e) => ({ ...e }));
	}
	get(e) {
		let t = this.built.get(e);
		return t ? { ...t } : void 0;
	}
	has(e) {
		return this.built.has(e);
	}
	signature() {
		return Ng(this.built.values());
	}
	allocateCandidateId() {
		return this.candidateSeq += 1, `C${Ag(this.candidateSeq, 6)}`;
	}
	allocateEditId() {
		return this.editSeq += 1, `E${Ag(this.editSeq, 6)}`;
	}
	applyOne(e) {
		let t = this.built.get(e.path), n = {
			editId: this.allocateEditId(),
			path: e.path,
			beforeHash: t ? Mg(t.content) : null,
			afterHash: Mg(e.content),
			ts: this.clock()
		};
		return this.built.set(e.path, {
			path: e.path,
			content: e.content
		}), this.edits.push(n), n;
	}
	commitWrites(e) {
		let t = this.signature(), n = e.kind ?? "artifact-write", r;
		this.ledger && e.recordAction !== !1 && (r = this.ledger.startAction({
			kind: n,
			target: e.target,
			phase: e.phase,
			beforeSignature: t,
			relatedCandidateIds: e.relatedCandidateIds
		}));
		let i = [];
		try {
			for (let t of e.files) i.push(this.applyOne(t).editId);
			let t = this.signature();
			return this.ledger && r && this.ledger.finishAction({
				actionId: r,
				disposition: i.length ? "applied" : "noop",
				afterSignature: t,
				endEvidence: {
					editIds: i,
					paths: e.files.map((e) => e.path)
				}
			}), {
				editIds: i,
				signature: t,
				actionId: r
			};
		} catch (e) {
			throw this.ledger && r && this.ledger.finishAction({
				actionId: r,
				disposition: "failed",
				failureMode: "fatal",
				error: e,
				afterSignature: this.signature()
			}), e;
		}
	}
	restoreSnapshot(e) {
		this.built.clear();
		for (let t of e) this.built.set(t.path, {
			path: t.path,
			content: t.content
		});
	}
	async evaluateCandidateTrial(e) {
		let t = this.files(), n = this.signature(), r;
		this.ledger && (r = this.ledger.startAction({
			kind: "candidate-trial",
			target: e.target,
			phase: e.phase,
			beforeSignature: n,
			relatedCandidateIds: [e.candidateId],
			startEvidence: { paths: e.trialFiles.map((e) => e.path) }
		}));
		let i, a = n, o;
		try {
			for (let t of e.trialFiles) this.applyOne(t);
			a = this.signature(), i = await e.measure(this.files());
		} catch (e) {
			o = e;
		} finally {
			this.restoreSnapshot(t);
		}
		let s = this.signature();
		if (this.ledger && r) {
			if (o !== void 0) throw this.ledger.finishAction({
				actionId: r,
				disposition: "failed",
				failureMode: "fatal",
				error: o,
				afterSignature: s,
				endEvidence: {
					afterTrialSignature: a,
					restored: !0
				}
			}), o;
			let t = e.dispositionOf?.(i) ?? "rejected";
			this.ledger.finishAction({
				actionId: r,
				disposition: t,
				afterSignature: s,
				endEvidence: {
					afterTrialSignature: a,
					restored: !0
				}
			});
		} else if (o !== void 0) throw o;
		return {
			actionId: r,
			candidateId: e.candidateId,
			result: i,
			beforeSignature: n,
			afterTrialSignature: a,
			restoredSignature: s
		};
	}
	adoptCandidate(e) {
		return this.commitWrites({
			files: e.files,
			phase: e.phase,
			target: e.target,
			kind: "candidate-adopt",
			relatedCandidateIds: [e.candidateId]
		});
	}
	deletePath(e, t) {
		let n = this.signature(), r;
		this.ledger && (r = this.ledger.startAction({
			kind: "artifact-delete",
			target: t.target,
			phase: t.phase,
			beforeSignature: n
		})), this.built.delete(e), this.ledger && r && this.ledger.finishAction({
			actionId: r,
			disposition: "applied",
			afterSignature: this.signature(),
			endEvidence: { path: e }
		});
	}
	snapshot() {
		return {
			files: this.files(),
			signature: this.signature(),
			edits: this.edits.map((e) => ({ ...e })),
			candidateSeq: this.candidateSeq,
			editSeq: this.editSeq
		};
	}
};
//#endregion
//#region src/tier1/handlerCandidate.ts
function Fg(e, t) {
	return `${e}\u0000${t}`;
}
function Ig(e, t, n) {
	return `mechanical-candidate: when classKey="${e}" and editShape="${t}" (support=${n}), apply the healed before→after transform. Admission requires mutation-oracle verification — not auto-admitted.`;
}
function Lg(e, t = 3) {
	let n = /* @__PURE__ */ new Map();
	for (let t of e) {
		if (!t.classKey || !t.editShape) continue;
		let e = Fg(t.classKey, t.editShape), r = n.get(e) ?? [];
		r.push(t), n.set(e, r);
	}
	let r = [...n.keys()].sort(), i = [];
	for (let e of r) {
		let r = n.get(e);
		if (r.length < t) continue;
		let a = r[0].classKey, o = r[0].editShape, s = [];
		for (let e of r) e.beforeSnippet != null && e.afterSnippet != null && s.push({
			before: e.beforeSnippet,
			after: e.afterSnippet
		});
		i.push({
			classKey: a,
			editShape: o,
			support: r.length,
			draftRule: Ig(a, o, r.length),
			fixtures: s,
			status: "handler-candidate",
			ts: "1970-01-01T00:00:00.000Z"
		});
	}
	return i;
}
function Rg(e, t) {
	let n = (e) => new Set(e.match(/[A-Za-z_$][\w$]{2,}/g) ?? []), r = n(e), i = n(t), a = [...i].filter((e) => !r.has(e)).sort().slice(0, 5), o = [...r].filter((e) => !i.has(e)).sort().slice(0, 5);
	return `Δ${t.length > e.length ? "+" : t.length < e.length ? "-" : "="} +[${a.join(",")}] -[${o.join(",")}]`;
}
//#endregion
//#region src/tier1/statsAggregate.ts
function zg() {
	return {
		withPage: {
			cases: 0,
			filled: 0
		},
		withoutPage: {
			cases: 0,
			filled: 0
		}
	};
}
function Bg(e, t, n) {
	let r = t ? e.withPage : e.withoutPage;
	r.cases++, n && r.filled++;
}
function Vg(e, t) {
	let n = (e, t) => t === 0 ? 0 : Math.round(100 * e / t), r = e, i = t;
	return `substrate page: ${r.cases} cases, ${r.filled} filled (${n(r.filled, r.cases)}%) · no substrate page: ${i.cases} cases, ${i.filled} filled (${n(i.filled, i.cases)}%)`;
}
//#endregion
//#region src/tier1/delimiterOracle.generated.ts
var Hg = [
	{
		id: "regex-literal",
		kind: "eval-crash",
		detectPattern: "Invalid regular expression|Unterminated regular expression",
		candidateEdits: "heal unterminated /…/: append trailing / on lines with odd unescaped slash count; close char-class ] before the final /; escape intentional slashes",
		fixtureBefore: "const re = /[a-z+;\n",
		fixtureAfter: "const re = /[a-z+;]/;\n",
		evalErrorSample: "Invalid regular expression: missing /"
	},
	{
		id: "quote-single",
		kind: "parse-fail",
		detectPattern: "Unterminated string|Unexpected token",
		candidateEdits: "close unterminated single-quoted string with matching '; strip stray leading/trailing quote when the run is un-paired",
		fixtureBefore: "const x = 'hello\n",
		fixtureAfter: "const x = 'hello';\n"
	},
	{
		id: "quote-double",
		kind: "parse-fail",
		detectPattern: "Unterminated string|Unexpected token",
		candidateEdits: "close unterminated double-quoted string with matching \"; strip stray leading/trailing quote when the run is un-paired",
		fixtureBefore: "const x = \"hello\n",
		fixtureAfter: "const x = \"hello\";\n"
	},
	{
		id: "template-backtick",
		kind: "parse-fail",
		detectPattern: "Unterminated (?:template|string)|Unexpected token",
		candidateEdits: "close unterminated template literal with matching `; balance `${…}` interpolation braces before closing",
		fixtureBefore: "const x = `hello\n",
		fixtureAfter: "const x = `hello`;\n"
	},
	{
		id: "brace",
		kind: "parse-fail",
		detectPattern: "Unexpected token|Unexpected end of input|expected .?\\}.?",
		candidateEdits: "append missing } for unclosed block; strip surplus } via parser-guided delete",
		fixtureBefore: "function f() { return 1;\n",
		fixtureAfter: "function f() { return 1; }\n"
	},
	{
		id: "bracket",
		kind: "parse-fail",
		detectPattern: "Unexpected token|Unexpected end of input|expected .?\\].?",
		candidateEdits: "append missing ] for unclosed array/index; balance closer stack against ] openers",
		fixtureBefore: "const a = [1, 2, 3\n",
		fixtureAfter: "const a = [1, 2, 3];\n"
	},
	{
		id: "paren",
		kind: "parse-fail",
		detectPattern: "Unexpected token|Unexpected end of input|expected .?\\).?",
		candidateEdits: "append missing ) for unclosed call/group; insert ) before .prop when depth > 0 (missing-closer-before-dot)",
		fixtureBefore: "const x = Math.max(1, 2\n",
		fixtureAfter: "const x = Math.max(1, 2);\n"
	},
	{
		id: "comma",
		kind: "parse-fail",
		detectPattern: "Unexpected (?:token|number)|expected .?,.?",
		candidateEdits: "insert missing , between call args / array/object elements at the error offset; strip trailing , before closers",
		fixtureBefore: "const x = Math.max(1 2);\n",
		fixtureAfter: "const x = Math.max(1, 2);\n"
	},
	{
		id: "colon-object",
		kind: "parse-fail",
		detectPattern: "Unexpected token|expected .?:.?",
		candidateEdits: "insert missing : between object property key and value at the error offset",
		fixtureBefore: "const obj = { a 1 };\n",
		fixtureAfter: "const obj = { a: 1 };\n"
	},
	{
		id: "arrow",
		kind: "parse-fail",
		detectPattern: "Unexpected token|expected .?=>.?",
		candidateEdits: "insert missing => between arrow parameter list and body block",
		fixtureBefore: "const f = () { return 1; };\n",
		fixtureAfter: "const f = () => { return 1; };\n"
	},
	{
		id: "block-comment",
		kind: "parse-fail",
		detectPattern: "Unterminated comment|Unexpected end of input",
		candidateEdits: "append */ to unclosed /* comment when it runs to EOF",
		fixtureBefore: "/* hello\nconst x = 1;\n",
		fixtureAfter: "/* hello */\nconst x = 1;\n"
	}
];
function Ug(e) {
	if (!e) return null;
	for (let t of Hg) if (new RegExp(t.detectPattern).test(e)) return t;
	return null;
}
//#endregion
//#region src/tier1/delimiterOracle.ts
var Wg = 5;
function Gg(e) {
	let t = 0, n = null;
	for (let r = 0; r < e.length; r++) {
		let i = e[r];
		if (n) {
			if (i === "\\") {
				r++;
				continue;
			}
			i === n && (n = null);
			continue;
		}
		if (i === "\"" || i === "'" || i === "`") {
			n = i;
			continue;
		}
		if (i === "/" && e[r + 1] === "/" || i === "/" && e[r + 1] === "*") break;
		if (i === "\\") {
			r++;
			continue;
		}
		i === "/" && t++;
	}
	return t > 0 && t % 2 == 1;
}
function Kg(e) {
	let t = e.split("\n"), n = !1, r = t.map((e) => {
		let t = qg(e);
		if (t < 0) return e;
		let r = t + 1, i = !1, a = !1;
		for (; r < e.length;) {
			let t = e[r];
			if (t === "\\") {
				r += 2;
				continue;
			}
			if (!i && t === "/") {
				a = !0;
				break;
			}
			!i && t === "[" ? i = !0 : i && t === "]" && (i = !1), r++;
		}
		return a ? e : (n = !0, e + (i ? "]/" : "/"));
	});
	return n ? r.join("\n") : null;
}
function qg(e) {
	let t = null;
	for (let n = 0; n < e.length; n++) {
		let r = e[n];
		if (t) {
			if (r === "\\") {
				n++;
				continue;
			}
			r === t && (t = null);
			continue;
		}
		if (r === "\"" || r === "'" || r === "`") {
			t = r;
			continue;
		}
		if (r === "/" && e[n + 1] === "/" || r === "/" && e[n + 1] === "*") return -1;
		if (r === "/") {
			let t = e.slice(0, n).replace(/\s+$/, ""), r = t[t.length - 1];
			return r == null || /[=(,\[!&|?:;+\-*<>~]/.test(r) || /(return|typeof|in|of|void|delete)\s*$/.test(t) ? n : -1;
		}
	}
	return -1;
}
function Jg(e) {
	let t = 0, n = null;
	for (; t < e.length;) {
		let r = e[t];
		if (n) {
			if (r === "\\") {
				t += 2;
				continue;
			}
			r === n && (n = null), t++;
			continue;
		}
		if (r === "\"" || r === "'" || r === "`") {
			n = r, t++;
			continue;
		}
		if (r === "/" && e[t + 1] === "/") {
			for (; t < e.length && e[t] !== "\n";) t++;
			continue;
		}
		if (r === "/" && e[t + 1] === "*") {
			let n = e.indexOf("*/", t + 2);
			if (n < 0) return e + "*/";
			t = n + 2;
			continue;
		}
		t++;
	}
	return null;
}
function Yg(e) {
	let t = null;
	for (let n = 0; n < e.length; n++) {
		let r = e[n];
		if (t) {
			if (r === "\\") {
				n++;
				continue;
			}
			r === t && (t = null);
			continue;
		}
		if (r === "\"" || r === "'" || r === "`") {
			t = r;
			continue;
		}
		if (r === "/" && e[n + 1] === "/") {
			for (; n < e.length && e[n] !== "\n";) n++;
			continue;
		}
		if (r === "/" && e[n + 1] === "*") {
			let t = e.indexOf("*/", n + 2);
			if (t < 0) break;
			n = t + 1;
			continue;
		}
	}
	return t == null ? null : e + t;
}
function Xg(e) {
	let t = 0, n = null, r = 0;
	for (; r < e.length;) {
		let i = e[r];
		if (n) {
			if (i === "\\") {
				r += 2;
				continue;
			}
			i === n && (n = null), r++;
			continue;
		}
		if (i === "\"" || i === "'" || i === "`") {
			n = i, r++;
			continue;
		}
		if (i === "/" && e[r + 1] === "/") {
			for (; r < e.length && e[r] !== "\n";) r++;
			continue;
		}
		if (i === "/" && e[r + 1] === "*") {
			let t = e.indexOf("*/", r + 2);
			r = t < 0 ? e.length : t + 2;
			continue;
		}
		i === "{" ? t++ : i === "}" && (t = Math.max(0, t - 1)), r++;
	}
	return t > 0 ? e + "}".repeat(t) : null;
}
function Zg(e, t) {
	return Ad(e) == null ? t && /Invalid regular expression/i.test(t) && (e.split("\n").some(Gg) || /\/\[[^\]]*$/m.test(e)) ? 1 : 0 : 2;
}
function Qg(e, t) {
	let n = [], r = (t, r) => {
		t && t !== e && n.push({
			next: t,
			classKey: r
		});
	};
	r(Kg(e), "regex-literal"), r(kh(e), "regex-literal"), r(Yg(e), "quote"), r(Jg(e), "block-comment"), r(Nh(e), "balance"), r(Xg(e), "brace");
	let i = Ad(e);
	if (i) {
		let t = Gh(e, i, 1);
		if (t && t.content !== e) {
			let e = Ug(i);
			r(t.content, `parser-guided:${e?.id ?? t.token}`);
		}
	} else if (t) {
		let n = Gh(e, t, 1);
		n && n.content !== e && r(n.content, `parser-guided:${n.token}`);
	}
	return n;
}
function $g(e, t) {
	if (Zg(e, t) === 0) return null;
	let n = e, r = 0, i = null;
	for (let e = 0; e < Wg; e++) {
		let e = Zg(n, t);
		if (e === 0) break;
		let a = Qg(n, t), o = null, s = e;
		for (let e of a) {
			let n = Zg(e.next, t);
			n < s && (o = e, s = n);
		}
		if (!o) break;
		i ??= o.classKey, n = o.next, r++;
	}
	return r === 0 || n === e ? null : {
		content: n,
		classKey: i ?? "unknown",
		edits: r
	};
}
Jh($g);
//#endregion
//#region src/tier1/assembleContext.ts
function e_(e) {
	let t = Xf({
		epoch: e.stage,
		rows: e.ledgerRows,
		artifact: e.artifact,
		featureId: e.featureId
	}), n = tp(t, e.cachedReading ?? null), r = Dl({
		spec: e.spec,
		feature: e.feature,
		parts: e.parts,
		stubs: e.stubs,
		lessons: e.lessons,
		siblingParts: e.siblingParts,
		target: e.target,
		stage: e.superbufferStage ?? "fill",
		substrateHandoff: e.substrateHandoff ?? null,
		conceptText: e.conceptText ?? null,
		siblingImpls: e.siblingImpls,
		signature: e.signature,
		findingEvidence: e.findingEvidence ?? null,
		exhibitText: e.exhibitText ?? null,
		traceText: e.traceText ?? null,
		ledgerText: e.ledgerText ?? null,
		unionText: n
	});
	return {
		digest: t,
		unionText: n,
		assembly: r,
		superbufferText: Ol(r),
		digestPreamble: [
			"The pipeline ledger records this activity so far:",
			Zf(t).slice(0, 800),
			"",
			"Note the recurring patterns above before writing your response."
		].join("\n")
	};
}
//#endregion
//#region src/tier1/testgen.ts
function t_(e, t) {
	return e.length === t.length && e.every((e, n) => {
		let r = e.replace(/\s+/g, ""), i = t[n].replace(/\s+/g, "");
		return r === i || r.startsWith(i) || i.startsWith(r);
	});
}
function n_(e, t, n) {
	if (e.license === "export" || e.license === "model-schema" || e.license === "uses-dep" || t.kind !== "edge" && t.source !== "edge") return !1;
	let r = e.license.toLowerCase();
	return t.license.toLowerCase().includes(r);
}
function r_(e) {
	let t = ql(e) ?? e.cladeFamily ?? null;
	return t !== "model-schema" && t !== "uses-dep" ? null : sl.find((e) => e.family === t) ?? null;
}
function i_(e) {
	let t = e.cladeFamily ?? (e.kind === "edge" ? ou(e.license) : void 0);
	if (!t || t === "model-schema" || t === "uses-dep") return null;
	let n = sl.filter((e) => e.family === t);
	if (!n.length) return null;
	if (!e.signature) return n[0] ?? null;
	let r = e.signature;
	for (let e of n) if (r.params.length === e.paramCount && t_(r.params.map((e) => e.type), e.paramTypes)) return e;
	return n.find((e) => e.paramCount === r.params.length) ?? n[0] ?? null;
}
function a_(e) {
	if (!(e.cladeFamily === "determinism" || /determin/i.test(e.license) || /determin/i.test(e.name))) return null;
	if (!e.signature) return sl.find((e) => e.family === "determinism") ?? null;
	let t = e.signature;
	for (let e of sl) {
		if (e.family !== "determinism" || t.params.length !== e.paramCount || !t_(t.params.map((e) => e.type), e.paramTypes)) continue;
		let n = t.returnType.replace(/\s+/g, ""), r = e.returnType.replace(/\s+/g, "");
		if (!(!n.startsWith(r) && !r.startsWith(n))) return e;
	}
	return sl.find((e) => e.family === "determinism") ?? null;
}
function o_(e, t) {
	let n = r_(e);
	if (n) return n;
	let r = i_(e);
	if (r) return r;
	let i = a_(e);
	if (i) return i;
	if (e.kind === "integration") return null;
	for (let n of sl) if (n_(n, e, t)) {
		if (e.kind === "behavior" && e.signature) {
			let t = e.signature;
			if (t.params.length !== n.paramCount || !t_(t.params.map((e) => e.type), n.paramTypes) || !t.returnType.replace(/\s+/g, "").startsWith(n.returnType.replace(/\s+/g, ""))) continue;
			return n;
		}
		if (e.kind === "edge" && n_(n, e, t) && n.license !== "export" && e.symbol && e.signature) {
			let t = e.signature;
			if (t.params.length === n.paramCount && t_(t.params.map((e) => e.type), n.paramTypes)) return n;
		}
	}
	return null;
}
function s_(e, t, n) {
	let r = [], i = [], a = [], o = 0;
	for (let n of e.cases) {
		let e = o_(n, t);
		if (e && n.symbol) {
			let t = e.body.replace(/SYM/g, n.symbol);
			if (Ah(t)) {
				r.push({
					name: n.name,
					kind: n.kind,
					body: t,
					clade: Jl(e, n.symbol)
				}), o++, a.push(`templated ${n.name} via ${e.id}`);
				continue;
			}
		}
		i.push(n);
	}
	return {
		cases: r,
		templated: o,
		holes: i,
		events: a
	};
}
//#endregion
//#region src/tier1/fillHonesty.ts
function c_(e, t) {
	return `fill batch: targets [${e.map((e) => `"${e}"`).join(", ")}]${t ? ` (${t})` : ""}`;
}
function l_(e, t, n, r) {
	if (t <= 0) return `planned case "${e}" never drawn — dropped (plan exceeded fill budget)`;
	let i = [];
	return i.push(`${n} candidate batch${n === 1 ? "" : "es"}`), i.push(`${r} fallback batch${r === 1 ? "" : "es"}`), `planned case "${e}" unfilled after ${t} draw${t === 1 ? "" : "s"} (${i.join(" + ")}) — dropped`;
}
//#endregion
//#region src/tier1/substrateFill.ts
async function u_(e) {
	let { spec: t, feature: n, caseGen: r, plannedCase: i, stubs: a, runSuite: o, imports: s, onMechanismResult: c } = e, l = async (e, i, l) => {
		if (!i || !Ah(i)) return c?.(e, "empty"), null;
		let u = {
			...r,
			body: i
		}, d = Np(O(n, s, [u]), n.testFile, t).content;
		try {
			let t = await o(a, {
				path: n.testFile,
				content: d
			});
			if (t.crashed || t.total !== 1) return c?.(e, "empty"), null;
			if (t.failures.length !== 1) return c?.(e, "vacuous"), null;
		} catch {
			return c?.(e, "empty"), null;
		}
		return c?.(e, "red"), {
			body: i,
			mechanism: e,
			...l ? { templateId: l } : {}
		};
	}, u = i ? Uu(i) : null, d = await l("matchConsumableTemplate", u && r.symbol ? u.body.replace(/SYM/g, r.symbol) : null, u?.id);
	if (d) return d;
	let f = Yl({
		...r,
		body: ""
	}, r.symbol);
	return await l("rebindCladeBody", Xl({
		...r,
		body: "",
		clade: f
	})) || l("methodAnchorBody", Gl(r.name) ? Kl(r.symbol ?? r.name, n.description) : null);
}
//#endregion
//#region src/tier1/frame.ts
var d_ = "⟨HOLE⟩", f_ = "⟨/END⟩", p_ = 400, m_ = {
	behavior: "",
	edge: "edge: ",
	integration: "integration: "
};
function h_(e, t, n) {
	let r = m_[n] ?? "", i = r && !t.startsWith(r) ? r + t : t;
	return {
		bytes: [
			`it(${JSON.stringify(i)}, () => {`,
			`  ${d_}`,
			"});"
		].join("\n"),
		holeName: "ASSERTION",
		holeBudgetBytes: p_
	};
}
var g_ = RegExp(`${d_}\\s*([\\s\\S]*?)\\s*${f_}`);
function __(e) {
	let t = g_.exec(e);
	return t ? { body: t[1] ?? "" } : {
		body: null,
		reason: "no hole marker in response"
	};
}
var v_ = /\b(describe|it|test)\s*\(|(^|[\n;])\s*import\s/;
function y_(e, t) {
	let { body: n, reason: r } = __(e);
	if (n === null) return {
		over: !0,
		reason: r ?? "no hole marker in response"
	};
	let i = t * 1.5;
	if (n.length > i) return {
		over: !0,
		reason: `response ${n.length} > budget ${i}`
	};
	let a = e.indexOf(d_), o = e.indexOf(f_), s = a >= 0 && o >= 0 ? e.slice(0, a) + e.slice(o + 6) : e;
	return v_.test(s) ? {
		over: !0,
		reason: "boilerplate reproduction outside hole"
	} : { over: !1 };
}
var b_ = /\b(describe|it|test)\s*\(/;
function x_(e) {
	return b_.test(e) ? {
		over: !0,
		reason: "test-scaffold token in implementation file"
	} : { over: !1 };
}
//#endregion
//#region src/core/prompts.ts
var S_ = "You split a product prompt into its distinct features. You do NOT judge quality — only enumerate.\nFor each feature, return a short \"name\" and \"scope\": the span of the prompt that describes it (quote or lightly paraphrase; keep it self-contained so it can be read alone). Produce 3-40 features. Do not invent features the prompt does not mention.";
function C_(e) {
	return `Product prompt:\n\n${e}\n\nEnumerate the features (name + the describing text span for each).`;
}
var w_ = "You judge ONE feature of a product, given only its name and the text describing it. This is a bounded, isolated decision — do not reason about other features.\n\nThe question: could a test author write AT LEAST ONE concrete assertion about this feature's OBSERVABLE behavior (an input and the output or state change it should produce) WITHOUT guessing the author's intent?\n\nDecisive rule — do not confuse these:\n- UNSPECIFIED IMPLEMENTATION is FINE, never a reason to say unclear. Which algorithm, data structure, merge/diff/ranking/index logic, tie-breaks, exact permission combinatorics — the compiler chooses these. \"Detect concurrent edits and surface a conflict\" is testable as-is. \"Search returns relevant results\" is testable as-is.\n- Only GENUINELY AMBIGUOUS INTENT makes it unclear: you truly cannot tell what the feature is for or what its output should be.\n\nDefault to clear. If clear: set clear=true and WRITE one concrete assertion — a specific input and the observable output/state expected (the actual value is your choice; show that SOMETHING observable is assertable). If genuinely ambiguous: set clear=false and ask the ONE question whose answer you'd need — and it must be a question about intent, never about an implementation choice.\nAlways fill both \"assertion\" and \"question\" (use \"\" for the one that does not apply).";
function T_(e, t) {
	return `Feature: ${e}\n\nDescribing text:\n${t}\n\nJudge this ONE feature.`;
}
var E_ = "You are the feature-encoding stage of a deterministic codegen compiler.\nYou translate a user's product prompt into a feature-coded specification: a tree of feature nodes that will each receive a frozen test suite (the IR) before any implementation exists.\n\nRules:\n- Decompose into one feature node per distinct capability in the prompt. Use ids F1, F2, ... (children as F2.1 etc. only when a feature genuinely contains sub-features). Do NOT invent an artificial small count — if the prompt demarcates many features, emit all of them. Do NOT silently drop, merge, or collapse features on a repair pass.\n- Order features so dependencies come first; \"deps\" must form a DAG.\n- Every feature owns 1-2 implementation files under src/. Put their paths in the \"files\" array. NEVER put a test file in \"files\" — \"files\" is src/ implementation paths ONLY.\n- Every feature has exactly one test file at tests/<id-lowercase>-<slug>.test.ts. Put this single path in the \"testFile\" string field. \"testFile\" is a separate string field, NOT part of \"files\".\n- Think hard about the ACTUAL FUNCTION of each feature and enumerate concrete edge cases (empty input, boundary values, unicode, idempotency, collision, expiry, ordering) — these become mandatory test cases.\n- \"exports\" is the wiring contract: the exact symbols dependents import. Be precise; wiring mismatches are a known failure class.\n- \"stubs\" declare each owned file's public surface as SIGNATURES — you do NOT write file content or bodies; the harness assembles the stub file deterministically. Per owned file: { \"path\": \"src/<file>.ts\", \"imports\": [...], \"signatures\": [...] }.\n  Each signature is { \"symbol\", \"kind\", \"sig\" }:\n    kind \"function\":  sig is the parameter list + return type, e.g. \"(id: string, title: string): Article\"\n    kind \"class\":     sig is the member block, e.g. \"{ create(id: string): Article; count: number }\"\n    kind \"interface\": sig is the shape, e.g. \"{ id: string; title: string; body: string }\"\n    kind \"type\":      sig is the right-hand side, e.g. \"'draft' | 'published'\"\n    kind \"const\":     sig is the type annotation, e.g. \"number\"\n  \"imports\" pulls types from SIBLING stub files: { \"from\": \"./article_model\", \"symbols\": [\"Article\"] } — every type name used in a sig must be declared in the same file's signatures or imported this way, and the module it is imported from must declare that symbol in ITS signatures.\n  Every symbol in \"exports\" MUST appear in that file's signatures — exports is the wiring contract dependents import; test suites and implementations both conform to these signatures, so design them as the real API, not a sketch. Do not write bodies, the export keyword, or whole files — signatures only.\n- V1 constraint: the artifact is a dependency-free TypeScript library/service layer (Node stdlib only, ESM, no UI, no design work). Do not plan npm dependencies, UI, or styling.\n- envVars: only if the prompt genuinely requires configuration; prefer none.";
function D_(e, t) {
	return [
		`Product prompt:\n\n${e}`,
		t ? `\nA previous encoding attempt produced stub signatures that FAILED to typecheck. Fix every issue listed below — pay special attention to:\n1. Every type name used in a sig must be declared in the same file's signatures or listed in that stub's "imports".\n2. A symbol imported from a sibling stub must be declared in that sibling's signatures.\n\nCompiler errors:\n${t}` : "",
		"\nProduce the feature-coded specification."
	].join("");
}
var O_ = "You perform BOUNDED repair on a feature-coded specification.\nYou receive the full current spec and a list of offending feature ids plus validation problems.\nReturn ONLY corrected FeatureNode objects for those offending ids — every other feature must be left untouched by the caller.\n\nRules:\n- Do NOT add, remove, rename, or renumber features. Same ids. Same feature count.\n- Fix only the listed mechanical problems (files under src/, testFile under tests/, stubs present per path, edgeCases non-empty, deps valid, ownership disjoint).\n- Preserve descriptions, deps, and exports unless a problem explicitly requires changing them.\n- Stubs are SIGNATURES ({ path, imports, signatures }), never file content or bodies — the harness assembles the files.";
function k_(e, t, n) {
	let r = new Set(t), i = e.features.map((e) => {
		let t = String(e.id ?? "");
		return r.has(t) ? {
			id: e.id,
			name: e.name,
			description: e.description,
			parentId: e.parentId ?? null,
			deps: [],
			files: [],
			testFile: "",
			edgeCases: [],
			exports: [],
			envVars: [],
			stubs: []
		} : e;
	});
	return [
		"Specification context (offending features are skeletons — regenerate their mechanical fields; siblings are known-good):",
		JSON.stringify({
			title: e.title,
			features: i
		}, null, 2),
		"",
		`Repair ONLY these feature ids: ${t.join(", ")}`,
		"Problems:",
		...n.map((e) => `- ${e}`),
		"",
		"Return { \"features\": [ ...corrected FeatureNode for each offending id... ] }."
	].join("\n");
}
var A_ = "You regenerate ONE TypeScript interface stub file from diagnostics and calling evidence. This is a FRESH draw — you are NOT given the broken prior content (feeding it would resample the failed distribution).\n\nRules:\n- Return the COMPLETE file content for this path.\n- ADDITIVE-ONLY contract growth: ADD exported members when diagnostics say dependents need them — infer signatures from calling-line evidence. Never invent unrelated API surface.\n- PRE-FREEZE WIDENING: when callers pass MORE arguments than declared (TS2554 M > N), widen parameters from the shown calls. If `new C(...)` lacks a constructor, ADD one.\n- Every function/method/constructor body must be exactly: { throw new Error('stub: not implemented'); }.\n- Every type referenced must be defined in this file or imported with a relative extensionless path.\n- Balance all braces and parentheses; the file must parse.";
function j_(e, t) {
	return [
		`File: ${e}`,
		"",
		"Compiler errors:",
		t.diagnostics,
		t.contractText ? `\nDeclared contract / exports for this feature:\n${t.contractText}` : "",
		t.callingLines ? `\nCalling-line evidence (from OTHER files that consume this stub):\n${t.callingLines}` : "",
		t.checkedIdioms ? `\n${t.checkedIdioms}` : "",
		"",
		"Produce the complete corrected stub file content. Do not echo any prior broken draft — there is none in this prompt."
	].join("\n");
}
var M_ = "You are the IR-generation stage of a deterministic codegen compiler.\nYou produce the frozen test suite for ONE feature node — but NOT as a file. The harness owns the file structure (the vitest import, the describe block, name prefixes, assembly); you return STRUCTURED PARTS: implementation imports and test cases. This scaffolding exists so structure can never be wrong; your entire job is the substance of the cases. The assembled suite is the intermediate representation: generated BEFORE any implementation exists, never edited afterward.\n\nRules (strict input isolation):\n- Derive tests ONLY from the specification and the interface stubs. There is no implementation to read; do not imagine one and rationalize it.\n- The stubs are the declared API surface — yours and your dependencies'. Call ONLY what the stubs declare, with the declared signatures. The suite is typechecked against the stubs before it may freeze.\n- \"imports\": the implementation modules and symbols your case bodies use. \"from\" is the implementation file path (e.g. \"src/service\"); the harness normalizes it. Import ONLY symbols the stubs export. Do NOT list vitest — describe/it/expect are already in scope.\n- \"cases\": one entry per test. \"body\" is ONLY the code inside the it() callback — no it(), no describe(), no imports, no markdown fences. Use expect(...) assertions. If the body uses await, the harness makes the callback async.\n- \"kind\": \"behavior\" for core behavior; \"edge\" for the listed edge cases — cover EVERY listed edge case with at least one case; \"integration\" for wired-dependency paths — at least one when the feature has deps. The harness prefixes names by kind automatically.\n- Tests must be deterministic: no network, no timers you don't control, no randomness without seeding.\n- Each body must be small, self-contained, syntactically complete TypeScript.";
function N_(e, t, n) {
	let r = (e) => e.stubs.map((e) => `--- ${e.path} (interface stub) ---\n${e.content}`).join("\n");
	return [
		`Product: ${e.title}`,
		"",
		`Feature node ${t.id}: ${t.name}`,
		`Description: ${t.description}`,
		`Owned implementation files: ${t.files.join(", ")}`,
		`Edge cases to capture: ${t.edgeCases.join(" | ")}`,
		`Depends on: ${t.deps.length ? t.deps.join(", ") : "nothing"}`,
		"",
		"YOUR feature's declared interface (test exactly this surface):",
		r(t),
		t.deps.length ? `\nDependency interfaces (for integration tests — call only what these declare):\n${e.features.filter((e) => t.deps.includes(e.id)).map(r).join("\n")}` : "",
		n ? `\nA previous version of this suite FAILED a deterministic gate. Fix these findings by conforming to the stubs (never by weakening coverage):\n${n}` : "",
		"",
		`Return the imports and cases for the frozen suite ${t.testFile}.`
	].join("\n");
}
var P_ = "=== HARNESS CONTRACT (appended by the compiler — overrules any conflicting instruction above) ===\nThe artifact is a dependency-free TypeScript library (Node stdlib only, ESM). Tests execute pure functions in memory: there is NO browser, DOM, HTTP server, database, Redis, filesystem, or network at test time.\nExpress every capability as pure deterministic functions:\n- HTTP endpoints → handler functions `(request: {method, path, query, body, headers, session?}) => {status, headers, body}`; assert on the returned object.\n- HTML/UI → render functions returning HTML strings; assert on string structure. No computed styles, no viewport, no pixels.\n- Persistence → injectable in-memory stores (Map-backed); represent schemas as typed structures plus invariant-checking functions. No SQL engines.\n- Time, randomness, rate limiting → injectable clock/counter parameters; deterministic always.\nDo NOT create features for anything requiring a real browser, real database, network I/O, or visual/computed-style measurement — those are out of scope for this artifact and will be handled by a later tier.\nWhen naming edge cases, prefer these class words (they unlock verified test templates): empty input, boundary values, unicode, idempotency, roundtrip, collision, expiry, ordering, throws-on-invalid.\nIf any instruction above contradicts this contract, THIS CONTRACT WINS.";
function F_(e, t = P_) {
	return [e, t].join("\n\n");
}
var I_ = "You fill ONE assertion hole in a frozen-IR test case. The harness has already written the `it(...)` frame around your answer — you do NOT write describe(), it(), imports, or any test scaffolding.\n\nYour entire response must be ONE `⟨HOLE⟩ … ⟨/END⟩` block. The frame around your response is already correct; do not repeat it. Do not include `import`, `describe`, `it`, `test`, or function-declaration keywords in the body. Return the smallest correct code that satisfies the constraint.\n\nRules for the content inside the block:\n- Call ONLY what the declared stubs export, with the declared signatures.\n- Use expect(...) assertions. Assert real behavior — no existence-only checks.\n- Be deterministic: no network, no uncontrolled timers, no unseeded randomness.", L_ = "You fill the function/method bodies of ONE implementation file. The harness has already written the signatures, imports, and class/interface shells around your answer — you do NOT write signatures, imports, or declarations.\n\nYour entire response must be ONE `⟨HOLE⟩ … ⟨/END⟩` block per body, in the order the holes were listed. The frame around each hole is already correct; do not repeat it. Do not include `import`, `describe`, `it`, `test`, or a function/class declaration keyword in a body. Return the smallest correct implementation that satisfies the frozen tests.\n\nRules for the content inside each block:\n- Keep the public signature exactly as declared — you are writing the body only.\n- Read the frozen tests carefully; they define the behavior. Satisfy the contract, do not game it.\n- Prefer plain string scanning over regular-expression literals when practical.", R_ = "You regenerate individual failing test cases in a frozen-IR suite. This is BOUNDED FRESH repair: you are given case name/kind + diagnostics — NEVER the broken prior body (that would resample the failed distribution). Every other case is preserved untouched by the harness.\n\nRules:\n- Call ONLY what the stubs declare, with the declared signatures. Fix by CONFORMING to the stub — never by weakening coverage intent.\n- \"body\" is ONLY the code inside the it() callback: no it(), no describe, no imports, no markdown fences.\n- Return exactly ONE regenerated case per listed case, in the SAME ORDER. Preserve testing intent implied by the name/kind and feature edge cases.\n- If import errors are listed, return a corrected \"imports\" array using only symbols the stubs export. Otherwise omit \"imports\".";
function z_(e, t, n, r, i, a) {
	let o = (e) => e.stubs.map((e) => `--- ${e.path} (interface stub) ---\n${e.content}`).join("\n");
	return [
		`Product: ${e.title}`,
		`Feature node ${t.id}: ${t.name}`,
		`Description: ${t.description}`,
		`Edge cases: ${t.edgeCases.join(" | ")}`,
		"",
		"Declared interface (conform to this EXACTLY):",
		o(t),
		t.deps.length ? `\nDependency interfaces (call only what these declare):\n${e.features.filter((e) => t.deps.includes(e.id)).map(o).join("\n")}` : "",
		i.length ? `\nCurrent imports: ${JSON.stringify(i)}` : "",
		r.length ? `\nImport errors (return a corrected "imports"):\n- ${r.join("\n- ")}` : "",
		a ? `\n${a}` : "",
		"",
		"Cases to REGENERATE from name/kind + diagnostics (prior bodies deliberately withheld):",
		...n.map((e, t) => `[${t}] it('${e.name}') kind=${e.kind}\n  errors:\n${e.errors.map((e) => "  - " + e).join("\n")}`),
		"",
		`Return the regenerated cases${r.length ? " and imports" : ""}.`
	].join("\n");
}
var B_ = "You are the code-generation stage of a deterministic codegen compiler.\nThe frozen test suite you are given is the IR: a fixed contract. Your implementation must satisfy it exactly. You did not write these tests and you may not change them.\n\nRules:\n- Implement ONLY the files owned by this feature node. Never output test files or files owned by other features.\n- Your files currently contain interface stubs. Replace each stub body with a real implementation while keeping the public signatures EXACTLY as declared — dependents' frozen suites typecheck against them.\n- Dependency-free TypeScript, ESM, Node stdlib only. Extensionless relative imports.\n- Export exactly the wiring-contract symbols (plus internals as needed).\n- Read the frozen tests carefully — they define behavior including edge cases. Satisfy the contract, do not game it.\n- Prefer plain string scanning (indexOf/slice/split/startsWith) over regular-expression literals — malformed regex literals are a known failure class. Use a regex only when scanning is impractical, and keep it simple.\n- Output the complete content of every owned file.";
function V_(e, t, n, r, i, a) {
	return [
		`Product: ${e.title}`,
		`Feature node ${t.id}: ${t.name}`,
		`Description: ${t.description}`,
		`Files you own (output all of them): ${t.files.join(", ")}`,
		`Wiring contract: ${t.exports.map((e) => `${e.symbol} from ${e.file}`).join("; ")}`,
		"",
		"Declared interface (keep these public signatures exactly):",
		...t.stubs.map((e) => `--- ${e.path} (stub to replace) ---\n${e.content}`),
		"",
		"FROZEN TEST SUITE (the IR — read-only contract):",
		"```ts",
		n,
		"```",
		r.length ? "\nAlready-built dependency files (read-only context):" : "",
		...r.map((e) => `--- ${e.path} ---\n${e.content}`),
		a ? `\n${a}` : "",
		i ? `\nTABU — oracle facts from DISCARDED earlier attempts (you are a fresh implementation; the old code is deliberately withheld). These behaviors were observed failing and must NOT recur:\n${i}` : "",
		"",
		"Produce the implementation files."
	].join("\n");
}
var H_ = "You are the bounded-repair stage of the Recursive Healing Algorithm (RHA).\nA deterministic sweep localized a failure to one feature node. You produce a FRESH implementation for that node's owned files from the frozen contract alone — the broken prior implementation is deliberately withheld (feeding it resamples the failed distribution).\n\nRules:\n- You may ONLY return files from the owned-files list. Never tests (the IR is frozen), never other features' files.\n- Implement from the frozen test suite + declared stubs + findings/tabu facts. Do not echo any prior broken draft.\n- The frozen tests define correct behavior. Make the code satisfy them; do not work around them.\n- Output the complete content of every owned file you change (whole file, not a diff).";
function U_(e) {
	let t = (e) => `- [${e.bugClass}] ${e.file}${e.line ? ":" + e.line : ""} — ${e.message}`, n = e.findings.map((e) => `- ${e.testName ? e.testName + ": " : ""}${e.message.split("\n")[0].slice(0, 180)}`).join("\n");
	return [
		`Product: ${e.spec.title}`,
		`Error node: feature ${e.feature.id} (${e.feature.name}), repair attempt ${e.attempt}.`,
		`Owned files (your write boundary): ${e.feature.files.join(", ")}`,
		"",
		"Localized findings on this node:",
		...e.findings.map(t),
		e.parallelInstances.length ? `\nParallel instances of the same bug class elsewhere in the tree:\n${e.parallelInstances.map(t).join("\n")}` : "",
		"",
		"Supergit lineage of this node (decision trail):",
		...e.lineage.map((e) => `  ${e}`),
		"",
		"Failure output (oracle facts only):",
		"```",
		e.failureOutput.slice(0, 6e3),
		"```",
		"",
		"Declared interface stubs (contract to implement — replace stub bodies with real code):",
		...e.feature.stubs.map((e) => `--- ${e.path} ---\n${e.content}`),
		"",
		"FROZEN TEST SUITE (read-only contract):",
		"```ts",
		e.frozenTest,
		"```",
		e.ownedFiles.length ? "\nCURRENT IMPLEMENTATION — this is the node you are repairing (edit it; preserve what already satisfies the contract):" : "",
		...e.ownedFiles.map((e) => `--- ${e.path} ---\n${e.content}`),
		e.dependencyContext.length ? "\nDependency files (read-only context):" : "",
		...e.dependencyContext.map((e) => `--- ${e.path} ---\n${e.content}`),
		n ? `\nTABU — oracle facts from discarded attempts (error messages only; old code withheld):\n${n}` : "",
		"",
		e.ownedFiles.length ? "Return the COMPLETE repaired file(s). Keep every exported signature. Change only what the findings require." : "Produce the implementation files fresh from the frozen contract."
	].join("\n");
}
var W_ = "You are sketching how you would ship ONE feature — expansive ideation, realistic contraction.\nRules:\n- Respond with exactly THREE sentences: (1) approach, (2) pitfalls / edge risks, (3) key data shapes.\n- Do NOT emit implementation code, test code, TypeScript, or fenced code blocks.\n- Do NOT invent APIs beyond what the spec page states.\n- Stay under ~120 words. This page is CONTEXT for later draws, never executed.";
function G_(e, t) {
	return [
		`Feature ${t.id}: ${t.name}`,
		"",
		"SPEC PAGE (literal encoded feature text — denote, do not invent past it):",
		e,
		"",
		"In 3 sentences: approach, pitfalls, data shapes. No code."
	].join("\n");
}
//#endregion
//#region src/tier1/fillRelay.ts
function K_(e) {
	let t = 0;
	for (let n of e.irPartsByFeature.values()) t += n.cases.length;
	return {
		frozenCount: e.frozenByFeature.size,
		lessonCount: e.lessonKeys.size,
		siblingCaseCount: t
	};
}
function q_(e, t) {
	return t.frozenCount > e.frozenCount || t.lessonCount > e.lessonCount || t.siblingCaseCount > e.siblingCaseCount;
}
function J_(e, t, n) {
	let r = n?.base ?? 2, i = n?.cap ?? 4, a = 0;
	for (let n of t) n.deps?.includes(e.id) && a++;
	return Math.min(i, r + a);
}
function Y_(e) {
	return `feature deferred to end-of-phase retry (${e.frozenCount} frozen exemplars, ${e.siblingCaseCount} sibling cases now available)`;
}
function X_(e, t) {
	return `replan (substrate-anchored): ${e} cases (${t} templated)`;
}
function Z_(e) {
	return `metaloop 2: retrying [${e.join(", ")}] (deferred)`;
}
function Q_(e) {
	return `metaloop 3: bracket pass [${e.join(", ")}]`;
}
function $_() {
	return "retry skipped: no new track to lay";
}
function ev(e) {
	return `${e}: no-coverage (abandoned after metaloop 3)`;
}
function tv(e, t) {
	return `${e}: uses ${t} — dependency uncovered`;
}
function nv(e) {
	return `${e} feature${e === 1 ? "" : "s"} uncovered`;
}
function rv(e, t) {
	let n = new Map(t.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map(), i = (e) => {
		let t = r.get(e);
		if (t != null) return t;
		let a = n.get(e);
		if (!a || !a.deps.length) return r.set(e, 0), 0;
		let o = 1 + Math.max(...a.deps.map(i));
		return r.set(e, o), o;
	};
	return [...e].sort((e, t) => {
		let n = i(e), r = i(t);
		return n === r ? e.localeCompare(t) : n - r;
	});
}
//#endregion
//#region src/tier1/permutation.ts
var iv = [
	.3,
	.7,
	1
], av = 1.2;
function ov() {
	return {
		temps: [...iv],
		k: iv.length,
		escalated: !1
	};
}
function sv(e) {
	let t = e.temps.includes(1.2) ? [...e.temps] : [...e.temps, av], n = Math.max(t.length, e.k + 1);
	for (; t.length < n;) t.push(av);
	return {
		temps: t.slice(0, n),
		k: n,
		escalated: !0
	};
}
function cv(e, t = "spread widened") {
	return `pass ${e}: escalating entropy (${t})`;
}
function lv(e) {
	if (!e.length) throw Error("permutation-select: no candidates");
	return {
		picked: [...e].sort((e, t) => t.score === e.score ? e.findings === t.findings ? e.temp - t.temp : e.findings - t.findings : t.score - e.score)[0],
		candidates: e
	};
}
function uv(e) {
	let t = e.picked.label ?? `${e.picked.score}`;
	return `permutation-select: ${e.candidates.length} candidates, picked t=${e.picked.temp} (${t})`;
}
function dv(e) {
	return `pass ${e}: no improvement — incumbent kept`;
}
function fv(e, t) {
	return e > t;
}
function pv() {
	return {
		queue: [],
		instancesByKey: {},
		metaloopUsed: 0,
		lastWorldByKey: {}
	};
}
function mv(e) {
	return `${e.featureId}|${e.caseName}`;
}
function hv(e, t) {
	return e === "empty-draw" || !t.trim();
}
function gv(e, t) {
	return (e.instancesByKey[t] ?? 0) < 3;
}
function _v(e) {
	return e.metaloopUsed < 1;
}
function vv(e, t) {
	return q_(e, t);
}
function yv(e, t) {
	if (hv(t.kind, t.brokenDraw)) return {
		state: e,
		pushed: null,
		reason: "empty-draw skips stack"
	};
	let n = mv(t);
	if (!gv(e, n)) return {
		state: e,
		pushed: null,
		reason: "instance cap 3"
	};
	let r = t.instance ?? (e.instancesByKey[n] ?? 0) + 1, i = {
		...t,
		instance: r,
		stackedAt: t.stackedAt ?? (/* @__PURE__ */ new Date()).toISOString()
	};
	return {
		state: {
			...e,
			queue: [...e.queue, i],
			instancesByKey: {
				...e.instancesByKey,
				[n]: r
			}
		},
		pushed: i
	};
}
function bv(e) {
	if (!e.queue.length) return {
		state: e,
		entry: null
	};
	let [t, ...n] = e.queue;
	return {
		state: {
			...e,
			queue: n
		},
		entry: t ?? null
	};
}
function xv(e, t, n) {
	return {
		...e,
		lastWorldByKey: {
			...e.lastWorldByKey,
			[t]: n
		}
	};
}
function Sv(e, t, n) {
	if (!gv(e, t) && (e.instancesByKey[t] ?? 0) >= 3 && !_v(e)) return {
		ok: !1,
		reason: "instance + metaloop caps exhausted"
	};
	let r = e.lastWorldByKey[t];
	return r && !vv(r, n) ? {
		ok: !1,
		reason: "world unchanged"
	} : { ok: !0 };
}
function Cv(e) {
	let t = e?.oraclePass !== !1, n = e?.warmRedraw !== !1, r = [];
	return t && r.push("1 oracle pass"), n && r.push("1 warm targeted redraw"), `dropped after parse-loop (${r.join(", ")})`;
}
function wv(e) {
	return [
		`your draw, broken at ${e.position?.line == null ? "unknown position" : `line ${e.position.line}${e.position.col == null ? "" : `:${e.position.col}`}`}: \`${e.snippet}\` — repair it.`,
		`parse error: ${e.parseError}`,
		"Broken draw (repair in place; preserve assertion intent):",
		e.brokenDraw.slice(0, 800)
	].join("\n");
}
function Tv(e) {
	let t = e.instanceCap ?? 3, n = e.healsDelta ?? 0, r = e.lessonsDelta ?? 0, i = e.worldChanged === !1 ? "world unchanged" : `world changed: +${n} heals, +${r} lessons`;
	return `relay: ${e.featureId} re-entering (instance ${e.instance}/${t}, ${i})`;
}
function Ev(e, t) {
	return {
		heals: Math.max(0, t.frozenCount - e.frozenCount),
		lessons: Math.max(0, t.lessonCount - e.lessonCount),
		siblings: Math.max(0, t.siblingCaseCount - e.siblingCaseCount)
	};
}
//#endregion
//#region src/tier1/runner.ts
function Dv(e) {
	return e.map((e) => {
		let t = th(e.name, e.errors[0] ?? "").classKey;
		return {
			...e,
			errors: [ul(t), ...e.errors]
		};
	});
}
var Ov = {
	gateRounds: 3,
	irAttempts: 2,
	maxPasses: 8,
	stallLimit: 2,
	progressStall: 4,
	grammarEnabled: !0,
	shellLock: !0,
	set96bFoldWatcherIntoCandidate0: !1,
	holeOnlyFill: !1
};
function kv(e, t, n, r) {
	return e.holeOnlyFill ? h_(t, n, r) : null;
}
function Av(e) {
	return e ? [
		I_,
		"The frame already exists — do not repeat it:",
		e.bytes,
		`Assertion budget: ${e.holeBudgetBytes} bytes (hard cap ${Math.round(e.holeBudgetBytes * 1.5)}).`
	].join("\n") : "";
}
function jv(e, t, n, r, i) {
	if (!e) return {
		body: t,
		rejected: !1
	};
	let a = y_(t, e.holeBudgetBytes);
	return a.over ? (n.overreachBodyRejections++, i(`case "${r}" rejected overreach|body: ${a.reason}`), {
		body: t,
		rejected: !0
	}) : {
		body: __(t).body ?? t,
		rejected: !1
	};
}
var Mv = [
	void 0,
	.5,
	.75,
	1
], Nv = [
	.3,
	.7,
	1
];
async function Pv(e) {
	let t = {
		...Ov,
		...e.gates
	}, n = Date.now(), r = !1, i = {
		elapsedMs: 0,
		passesTotal: 0,
		passesPerFeature: {},
		repairDraws: 0,
		freshDraws: 0,
		irSurgeries: 0,
		irGenAttempts: 0,
		mechanicalFixes: 0,
		catalogDriftMechanicalFixes: 0,
		regexLiteralGateHeals: 0,
		bornRedStubDerivedDrops: 0,
		substrateAttempts: 0,
		substrateFixes: 0,
		substrateRefusals: 0,
		substrateNoHandler: 0,
		substrateEditsApplied: 0,
		deterministicEditsOutsideSubstrate: 0,
		substrateFillHits: 0,
		substrateFillEscalations: 0,
		substrateFillEmptyMechanisms: 0,
		substrateFillVacuousMechanisms: 0,
		overreachBodyRejections: 0,
		templatedCases: 0,
		permutationDraws: 0,
		permutationWins: 0,
		permBatches: 0,
		permCandidates: 0,
		permImproved: 0,
		superbufferDraws: 0,
		superbufferWins: 0,
		conceptDraws: 0,
		parsePoisonIncidents: 0,
		bugsObserved: 0,
		bugsPatched: 0,
		bugsRemaining: 0,
		artifactFaults: 0,
		artifactFaultsRemaining: 0,
		artifactFaultsAffectedFeatures: 0,
		featuresTotal: 0,
		featuresFrozenWithoutRedraw: 0,
		irRedraws: 0,
		nodesTotal: 0,
		nodesBuildable: 0,
		nodesBuilt: 0,
		nodesBuiltCleanFirstPass: 0,
		boundedLoopNodes: 0,
		boundedLoopIterations: 0,
		candidatesDrawn: 0,
		candidatesAccepted: 0,
		fillCandidatesDrawn: 0,
		repairCandidatesDrawn: 0,
		fillCandidatesAccepted: 0,
		repairCandidatesAccepted: 0,
		salvagedCases: 0,
		sickRedCases: 0,
		testRhaSubstrateFixes: 0,
		testRhaDraws: 0,
		testRhaSuperbufferAssemblies: 0,
		testRhaDrawThrew: 0,
		testRhaDraftRejected: 0,
		testRhaDraftAcceptedCleared: 0,
		testRhaDraftAcceptedStillSick: 0,
		testRhaSkippedNoHandle: 0,
		testRhaSkippedAlreadyRedrawn: 0,
		testRhaCaseExhausted: 0,
		testRhaCaseCleared: 0,
		irSurgeriesInRha: 0,
		reEnqueuedCases: 0,
		recoveredCases: 0,
		l2Draws: 0,
		l2Wins: 0,
		l2Bullseyes: 0,
		fixesL1: 0,
		fixesL2: 0,
		fixesL3: 0,
		fixesL4: 0,
		corpseRejections: 0,
		classifyAttempts: 0,
		classifyCataloged: 0,
		grammarConformant: 0,
		grammarFallbacks: 0,
		shellLockApplied: 0,
		shellLockFallbacks: 0,
		judgmentGates: 0,
		judgmentOperator: 0,
		judgmentLlm: 0,
		judgmentDropped: 0,
		watcherSyntheses: 0,
		watcherReadings: 0,
		watcherObservations: 0,
		watcherCacheHits: 0,
		watcherCacheMisses: 0,
		watcherWorldStaleSkips: 0,
		watcherInfusedCandidates: 0,
		corpseRejectionCeilingBreaches: 0,
		watcherEngineFailures: 0,
		observatoryEngineFailures: 0,
		nodeRepairDraws: 0,
		nodeRepairWins: 0,
		observationPolls: 0,
		observationsNew: 0,
		observationsCorroborated: 0,
		stubRouteShortcuts: 0,
		observatoryPollsSkipped: 0,
		l2ShortCircuits: 0,
		quarantineSuspensions: 0,
		errorsTotal: 0,
		errorsParse: 0,
		errorsConformance: 0,
		errorsExecution: 0,
		errorsCrash: 0,
		findingOccurrencesTotal: 0,
		findingOccurrencesParse: 0,
		findingOccurrencesConformance: 0,
		findingOccurrencesExecution: 0,
		findingOccurrencesCrash: 0,
		findingOccurrencesTestFailure: 0,
		uniqueDefectsObserved: 0,
		uniqueDefectsResolved: 0,
		uniqueDefectsUnresolved: 0,
		actionStarts: 0,
		actionTerminals: 0,
		actionDecisions: 0,
		actionPending: 0,
		actionFailed: 0,
		actionFailedNonfatal: 0,
		deferredTotal: 0,
		deferredRelitigated: 0,
		deferredResolvedAfterRelitigation: 0,
		deferredPermanent: 0,
		nodesHealed: 0,
		fixesUnsuccessful: 0,
		fixesUnparseable: 0
	}, a = new kg(() => (/* @__PURE__ */ new Date()).toISOString(), { strict: !0 }), o = new Mm(() => (/* @__PURE__ */ new Date()).toISOString()), s = () => {
		let e = o.metrics(), t = a.metrics();
		i.findingOccurrencesTotal = e.findingOccurrencesTotal, i.findingOccurrencesParse = e.findingOccurrencesParse, i.findingOccurrencesConformance = e.findingOccurrencesConformance, i.findingOccurrencesExecution = e.findingOccurrencesExecution, i.findingOccurrencesCrash = e.findingOccurrencesCrash, i.findingOccurrencesTestFailure = e.findingOccurrencesTestFailure, i.uniqueDefectsObserved = e.uniqueDefectsObserved, i.uniqueDefectsResolved = e.uniqueDefectsResolved, i.uniqueDefectsUnresolved = e.uniqueDefectsUnresolved, i.errorsTotal = e.findingOccurrencesTotal, i.errorsParse = e.findingOccurrencesParse, i.errorsConformance = e.findingOccurrencesConformance, i.errorsExecution = e.findingOccurrencesExecution + e.findingOccurrencesTestFailure, i.errorsCrash = e.findingOccurrencesCrash, i.bugsObserved = e.uniqueDefectsObserved, i.bugsPatched = e.uniqueDefectsResolved, i.bugsRemaining = e.uniqueDefectsUnresolved, i.actionStarts = t.actionStarts, i.actionTerminals = t.actionTerminals, i.actionDecisions = t.actionDecisions, i.actionPending = t.actionPending, i.actionFailed = t.actionFailed, i.actionFailedNonfatal = t.actionFailedNonfatal;
	}, c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), f = (e) => {
		!l.has(e) || d.has(e) || (d.add(e), i.nodesHealed++);
	}, p = [], m = [], g = [], y = [], w = [], T = [], E = /* @__PURE__ */ new Map(), ee = (e, t = "seen") => {
		if (!e) return;
		let n = E.get(e) ?? {
			count: 0,
			fixed: !1,
			mechanicalCandidate: !1
		};
		t === "seen" && (n.count += 1), t === "fixed" && (n.fixed = !0), t === "mechanical-candidate" && (n.mechanicalCandidate = !0), E.set(e, n);
	}, ne = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), k = (e) => {
		let t = ne.get(e) ?? [], n = D.get(e);
		return hl({
			classKey: n?.classKey ?? "unknown",
			stratum: n?.stratum,
			attempts: t
		});
	}, A = (e, t, n) => {
		if (ee(e, "seen"), t.status === "fixed" ? ee(e, "fixed") : t.status === "refused" && /ambiguous|fitness tie|>4 candidates/i.test(t.reason ?? "") && ee(e, "mechanical-candidate"), n) {
			D.set(n, {
				classKey: e,
				stratum: typeof t.stratum == "string" ? t.stratum : void 0
			});
			let r = /^unresolved-import\b/.test(e) ? "import-rewire" : e.split("|")[0] ?? e, i = ne.get(n) ?? [];
			i.push({
				handler: r,
				status: t.status,
				reason: t.reason,
				candidateSites: t.candidateSites,
				note: t.fix?.note
			}), ne.set(n, i);
		}
	}, j = pv(), re = /* @__PURE__ */ new Map(), ie = [...new Set(e.priorDroppedCaseNames ?? [])].filter(Boolean);
	ie.length && w.push(qu(ie.length));
	let ae = {
		cases: 0,
		filled: 0
	}, oe = {
		cases: 0,
		filled: 0
	}, M = (e, t) => {
		let n = e ? ae : oe;
		n.cases++, t && n.filled++;
	}, se = zg(), N = 0, ce = 0, P = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Set(), le = () => {
		if (e.isCancelled?.()) {
			try {
				a.cancelPending("run cancelled");
			} catch {}
			throw Error("cancelled by user");
		}
	}, ue = (e) => {
		let t = e.stubs?.[0]?.content ?? "", n = /export\s+(?:async\s+)?function\s+([A-Za-z_$][\w$]*)\s*\(([^)]*)\)/.exec(t);
		if (!n) return null;
		let r = n[1], i = n[2].trim(), a = i ? i.split(",").map((e) => {
			let t = (e.split(":")[1] ?? "").trim().toLowerCase();
			return t.startsWith("number") ? "1" : t.startsWith("string") ? "'x'" : t.startsWith("boolean") ? "true" : t.endsWith("[]") ? "[]" : "{} as never";
		}).join(", ") : "";
		return {
			name: `${r} anchor (callable)`,
			kind: "behavior",
			body: `expect(() => ${r}(${a})).not.toThrow();`
		};
	}, de = (e, t, n, r) => {
		let i = a.startAction({
			kind: `host-callback:${e}`,
			target: t,
			phase: n
		});
		try {
			r(), a.finishAction({
				actionId: i,
				disposition: "applied"
			});
		} catch (t) {
			a.finishAction({
				actionId: i,
				disposition: "failed",
				failureMode: "nonfatal",
				error: t
			}), m.push({
				ts: (/* @__PURE__ */ new Date()).toISOString(),
				phase: n,
				featureId: null,
				message: `host-callback:${e} failed nonfatally: ${t instanceof Error ? t.message : String(t)}`
			});
		}
	}, fe = (e) => a.runAction({
		kind: `llm:${e.method}`,
		target: e.target,
		phase: e.phase,
		startEvidence: e.startEvidence ?? null,
		fn: e.fn
	}).then((e) => e.result), L = (t, r, a) => {
		if (e._suppressEmit?.test(a)) return;
		let o = {
			ts: (/* @__PURE__ */ new Date()).toISOString(),
			phase: t,
			featureId: r,
			message: a
		};
		m.push(o), i.fixesL1 = i.substrateFixes, e.onEvent && de("onEvent", r ?? "@run", t, () => e.onEvent(o)), e.onMetrics && de("onMetrics", r ?? "@run", t, () => e.onMetrics({
			...i,
			passesPerFeature: { ...i.passesPerFeature },
			elapsedMs: Date.now() - n
		}));
	}, R = (e, t, n, r) => (L(e, t, n.logLine), i.superbufferDraws++, r === "test-rha" && i.testRhaSuperbufferAssemblies++, Ol(n)), z = new Vf(), B = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map(), pe = {
		reading: null,
		health: mp(),
		cache: /* @__PURE__ */ new Map(),
		lastSyntheticStep: 0
	}, me = (e, t, n) => {
		let r = JSON.stringify(n), i = 5381;
		for (let e = 0; e < r.length; e++) i = (i << 5) + i + r.charCodeAt(e) >>> 0;
		return `${e}|${t ?? "_"}|${i.toString(36)}|${r.length}`;
	}, he = /* @__PURE__ */ new Set([
		"test",
		"code",
		"resolution",
		"spec"
	]), ge = /* @__PURE__ */ new Set(["pass", "healed"]), H = (e, t) => e.some((e) => e.step > t && (he.has(e.type) || e.status != null && ge.has(e.status))), U = async (t, n, r) => {
		let a = z.allRows();
		if (a.length <= 1) return null;
		if (pe.lastSyntheticStep > 0 && !H(a, pe.lastSyntheticStep)) {
			i.watcherSyntheses++, i.watcherWorldStaleSkips++;
			let e = Xf({
				epoch: t,
				rows: a,
				artifact: r,
				featureId: n
			});
			return L(t, n, `watcher synthesis @ ${t}${n ? `/${n}` : ""}: skipped — no world advancement since node ${pe.lastSyntheticStep} (deterministic corpse cache carries failure evidence)`), tp(e, pe.reading);
		}
		let o = Xf({
			epoch: t,
			rows: a,
			artifact: r,
			featureId: n
		});
		i.watcherSyntheses++;
		let s = me(t, n, o), c = pe.cache.get(s);
		if (c !== void 0) return i.watcherCacheHits++, pe.lastSyntheticStep = a[a.length - 1]?.step ?? pe.lastSyntheticStep, L(t, n, `watcher synthesis @ ${t}${n ? `/${n}` : ""}: digest unchanged since node ${o.nodes} — reading reused (advisory)`), tp(o, c);
		i.watcherCacheMisses++;
		let l = e.llm.watchEpoch?.bind(e.llm), u = "no-engine", d;
		if (typeof l == "function") try {
			let e = ep(await l($f(o)));
			i.watcherReadings++, _p(pe.health), e ? (pe.reading = e, pe.cache.set(s, e), pe.lastSyntheticStep = a[a.length - 1]?.step ?? pe.lastSyntheticStep, i.watcherObservations += e.idioms.length + e.tropes.length + e.schemes.length, u = "read", z.recordNode({
				type: "lesson",
				status: "info",
				summary: `watcher @ ${t}${n ? `/${n}` : ""} (advisory): ${e.union || `${e.idioms.length} idioms, ${e.tropes.length} tropes`}`
			})) : u = "unreadable";
		} catch (e) {
			gp(pe.health, e), d = vp(pe.health), i.watcherEngineFailures++, u = "engine-failed", z.recordNode({
				type: "lesson",
				status: "fail",
				summary: `watcher engine threw @ ${t}${n ? `/${n}` : ""}: ${d}`
			});
		}
		return L(t, n, np(o, pe.reading, u, d)), tp(o, pe.reading);
	}, W = new cp(e.observations ?? []), G = mp(), _e = 0, ve = async (t, n) => {
		let r = e.llm.observe?.bind(e.llm);
		if (typeof r != "function" || !t.length) return fp(W);
		let a = z.allRows();
		if (_e > 0 && !H(a, _e)) return i.observatoryPollsSkipped++, L("rha", null, `observatory: polls skipped — world unchanged since node ${_e}`), fp(W);
		let o = ap(t), s = op(o), c = (/* @__PURE__ */ new Date()).toISOString(), l = 0, u = 0, d = 0, f;
		for (let e of lp) {
			le();
			try {
				let t = await r(up(e, s, n), e.system);
				d++, i.observationPolls++, _p(G);
				for (let n of dp(t)) {
					let t = o.declarations.filter((e) => e.symbol === n.subject || e.path === n.subject).slice(0, 2).map((e) => `${e.path}: ${e.kind} ${e.symbol}`);
					W.append(e.kind, n.subject, n.claim, t, c) ? (l++, i.observationsNew++) : (u++, i.observationsCorroborated++);
				}
			} catch (t) {
				gp(G, t), f = vp(G), i.observatoryEngineFailures++, z.recordNode({
					type: "lesson",
					status: "fail",
					summary: `observatory poll "${e.kind}" threw: ${f}`
				});
			}
		}
		if (d || f) {
			if (d) {
				let e = z.allRows();
				_e = e[e.length - 1]?.step ?? _e;
			}
			L("rha", null, pp(d, l, u, W.size, f));
			for (let t of W.all().slice(0, 3)) e.onObservation?.(t);
		}
		return fp(W);
	}, ye = [], be = /* @__PURE__ */ new Set(), xe = new Set(e.metaSb?.corpseHashes ?? []), Se = /* @__PURE__ */ new Map(), Ce = (e, t, n) => {
		i.corpseRejections++;
		let r = (Se.get(n) ?? 0) + 1;
		Se.set(n, r), r > 5 && (i.corpseRejectionCeilingBreaches++, L(e, t, `corpse-ceiling exceeded: case "${n}" hit ${r} rejections in one run — upstream is re-issuing this class more aggressively than the ladder-shape justifies`));
	}, K = (t) => {
		ye.push(t);
		try {
			e.onMetaCandidate?.(t);
		} catch {}
	}, we = (e, t) => {
		r || (r = !0, L(e, t, "parse-gate unavailable (CSP) — check skipped"));
	}, Te = !1, Ee = (e, t) => {
		Te || (Te = !0, L(e, t, "module-probe unavailable (CSP) — check skipped"));
	}, De = (e, t, n) => {
		for (let r of n) w.push(r), L(e, t, r);
	}, Oe = e.rawPrompt ?? e.prompt, ke = (e) => e == null ? "" : ` (line ${e})`;
	for (let e of ug(Oe)) {
		if (e.residueCollapsed && (i.deferredResidueEmpty = (i.deferredResidueEmpty ?? 0) + 1), g.push(e), e.behavioralSplit) {
			i.deferredTotal++, L("encode", null, `behavior/binding split: "${e.behavioralSplit.binding}" excised — behavioral invariant kept (${e.behavioralSplit.simClade})${ke(e.line)}`);
			continue;
		}
		i.deferredTotal++, L("encode", null, `excluded: "${e.item}" — requires ${e.capability}; not testable in this runtime${ke(e.line)}`);
	}
	let Ae = dg(Oe);
	if (!Ae.ok) return L("encode", null, `refused: prompt has no verifiable items — ${Ae.itemsScanned} items scanned, ${Ae.fenced} capability-fenced, 0 assertable residue`), i.encodeRefusedNoResidue = (i.encodeRefusedNoResidue ?? 0) + 1, i.elapsedMs = Date.now() - n, s(), {
		status: "refused",
		reason: "prompt-no-verifiable-items",
		spec: {
			title: e.prompt.slice(0, 80),
			prompt: e.prompt,
			features: []
		},
		files: [],
		frozenTests: [],
		problems: ["refused: prompt has no verifiable items"],
		metrics: i,
		log: m,
		provenance: p,
		contractVersion: e.contractVersion,
		deferred: g,
		evidence: w,
		supergit: {
			rows: z.allRows(),
			csv: z.toCsv(),
			graph: z.toGraph()
		},
		defectRegistry: o.snapshot(),
		actionLedger: a.snapshot()
	};
	L("encode", null, "encoding prompt into feature-coded spec");
	let { result: q } = await a.runAction({
		kind: "llm:encodeFeatures",
		target: "@spec",
		phase: "encode",
		startEvidence: { promptChars: (e.encodePrompt ?? e.prompt).length },
		fn: () => e.llm.encodeFeatures(e.encodePrompt ?? e.prompt, void 0, { temperature: 0 })
	});
	v(q), b(q);
	let J = S(q);
	for (let n = 0; J.length && n < t.gateRounds; n++) {
		let t = x(J, q.features.map((e) => e.id));
		if (!t.length) break;
		L("gate", null, `round ${n + 1}: repairing ${t.join(", ")} (${J.length} problems)`);
		let { result: r } = await a.runAction({
			kind: "llm:repairFeatures",
			target: t.join(","),
			phase: "gate",
			startEvidence: {
				ids: t,
				problems: J.length,
				round: n + 1
			},
			fn: () => e.llm.repairFeatures(q, t, J)
		});
		for (let e of r) {
			let t = q.features.findIndex((t) => t.id === e.id);
			t >= 0 && (q.features[t] = e);
		}
		v(q), b(q), J = S(q);
	}
	L("gate", null, J.length ? `spec gate exhausted with ${J.length} unresolved problems` : "spec gate clean");
	{
		let t = await Lu(Iu(q));
		De("encode", null, [Ru(t, zu(t, e.priorSpecHashes))]);
	}
	let je = h(q.features);
	i.featuresTotal = je.length;
	{
		let e = z.recordNode({
			type: "decision",
			artifactPath: ".supergit/spec.json",
			summary: `encode: ${je.length} features carved from the prompt`
		});
		for (let t of je) B.set(t.id, z.recordNode({
			type: "spec",
			featureId: t.id,
			causeId: e,
			artifactPath: t.files[0] ?? null,
			summary: `${t.id} ${t.name}: ${t.description ?? ""}`.trim()
		}));
		for (let e of je) for (let t of e.deps ?? []) {
			let n = B.get(t), r = B.get(e.id);
			n && r && z.recordEdge(n, r, `${t} → ${e.id}`);
		}
	}
	let Me = [], Ne = /* @__PURE__ */ new Map(), Pe = /* @__PURE__ */ new Map(), Y = {
		frozenTests: Me,
		frozenByFeature: Ne,
		irPartsByFeature: Pe
	}, Fe = /* @__PURE__ */ new Map(), X = async () => {
		throw Error("bypass-mode gateway must not invoke runSuite");
	}, Ie = async (t, n, r, i) => {
		let o = r ?? Pe.get(t.id);
		if (!o) return null;
		let s = e.runSuite ?? X;
		return wg({
			spec: q,
			feature: t,
			prompt: e.rawPrompt ?? e.prompt,
			parts: o,
			runSuite: s,
			stubs: Jp(q),
			state: Y,
			reason: i,
			overrideContent: n,
			bypassCaseCertification: !e.runSuite,
			onAcceptance: (e) => {
				Fe.set(t.id, e);
			},
			onRejection: (e) => {
				Fe.set(t.id, e);
			},
			actionLedger: a
		});
	}, Le = async (t, n, r) => {
		let i = e.runSuite ?? X;
		return wg({
			spec: q,
			feature: t,
			prompt: e.rawPrompt ?? e.prompt,
			parts: {
				imports: [],
				cases: []
			},
			runSuite: i,
			stubs: Jp(q),
			state: Y,
			reason: r,
			overrideContent: n,
			bypassCaseCertification: !0,
			onAcceptance: (e) => {
				Fe.set(t.id, e);
			},
			onRejection: (e) => {
				Fe.set(t.id, e);
			},
			actionLedger: a
		});
	}, Re = new Set((e.lessons ?? []).map((e) => e.classKey)), ze = e.onLesson, Be = (e) => {
		Re.add(e.classKey), ze?.(e);
	};
	e = {
		...e,
		onLesson: Be
	};
	let Ve = async (n, r) => {
		let o = null, s, l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), f = uu(q, n), m = du(f, n);
		f = m.plan, m.injected && L("ir", n.id, `plan: injected class-anchor case "${m.injected.name}" (from owned stub)`);
		let h = [];
		for (let e of f.cases) {
			let t = ug(e.license).map((t) => {
				let n = lg(Oe, e.license), r = {
					...t,
					item: e.license.slice(0, 80)
				};
				return n == null ? delete r.line : r.line = n, r;
			}), r = t.filter((e) => !e.partial), a = t.filter((e) => e.partial);
			if (r.length) {
				for (let e of r) g.push(e), i.deferredTotal++, L("ir", n.id, `excluded: "${e.item}" — requires ${e.capability}; not testable in this runtime${ke(e.line)}`);
				J.push(`${n.id}: case "${e.name}" excluded — requires ${r[0].capability}`);
				continue;
			}
			for (let t of a) g.push(t), i.deferredTotal++, t.behavioralSplit ? L("ir", n.id, `behavior/binding split: case "${e.name}" kept — binding "${t.behavioralSplit.binding}" excised (${t.behavioralSplit.simClade})${ke(t.line)}`) : L("ir", n.id, `excluded: case "${e.name}" — requires ${t.capability}; not testable in this runtime${ke(t.line)}`);
			let o = a.find((e) => e.behavioralSplit);
			h.push(o?.behavioralSplit ? {
				...e,
				license: o.behavioralSplit.behavior
			} : e);
		}
		if (f = {
			...f,
			cases: h
		}, !f.cases.length) return J.push(`${n.id}: abandoned — all planned cases excluded`), L("ir", n.id, "abandoned — all planned cases excluded"), {
			status: "skipped",
			reason: "all planned cases out-of-scope"
		};
		let _ = s_(f, n.edgeCases);
		i.templatedCases += _.templated, L("ir", n.id, `plan: ${f.cases.length} cases (${_.templated} substrate-templated, ${_.holes.length} model draws)`);
		for (let e of _.events) L("ir", n.id, e);
		if (Wu(_.holes, n.edgeCases) >= 1) {
			let e = [], t = [];
			for (let r of _.holes) {
				let a = r.symbol ? Uu(r) : null, o = a && r.symbol ? a.body.replace(/SYM/g, r.symbol) : "";
				a && r.symbol && Ah(o) ? (e.push({
					name: r.name,
					kind: r.kind,
					body: o,
					clade: Yl({
						name: r.name,
						kind: r.kind,
						body: o
					}, r.symbol)
				}), i.templatedCases++, L("ir", n.id, `templated ${r.name} via ${a.id} (planner-bypass closed, 0 tok)`)) : t.push(r);
			}
			e.length && (_ = {
				..._,
				cases: [..._.cases, ...e],
				templated: _.templated + e.length,
				holes: t
			});
			let r = Wu(t, n.edgeCases);
			r >= 1 && De("ir", n.id, [Vu(r)]);
		}
		for (let t of f.cases) p.push({
			caseName: t.name,
			kind: t.kind,
			license: t.license,
			source: t.source,
			featureId: n.id,
			featureDescription: n.description,
			prompt: e.prompt
		});
		let v = {
			imports: f.imports.map((e) => ({
				...e,
				symbols: [...e.symbols]
			})),
			cases: _.cases.map((e) => ({ ...e }))
		}, b = pu(f, n), x = J_(n, je), S = 0;
		for (; S < x;) {
			if (S++, S > 1) {
				let e = du(uu(q, n), n), t = e.plan.cases.filter((t) => h.some((e) => e.name === t.name) || t.name === e.injected?.name), r = {
					...e.plan,
					cases: t
				}, a = s_(r, n.edgeCases), o = Math.max(0, a.templated - _.templated);
				i.templatedCases += o, f = r, _ = a, b = pu(f, n);
				for (let e of a.cases) v.cases.some((t) => pg(t.name, e.name)) || v.cases.push({ ...e });
				L("ir", n.id, X_(r.cases.length, a.templated));
			}
			let r = _.holes.filter((e) => !v.cases.some((t) => pg(t.name, e.name))).sort((e, t) => !ie.some((t) => pg(t, e.name)) - +!ie.some((e) => pg(e, t.name)));
			for (let a = 0; a < r.length; a += 1) {
				le();
				let o = r.slice(a, a + 1);
				for (let e of o) u.set(e.name, (u.get(e.name) ?? 0) + 1);
				if (L("ir", n.id, c_(o.map((e) => e.name))), e.runSuite) {
					let t = [];
					for (let r of o) {
						let a = await u_({
							spec: q,
							feature: n,
							caseGen: {
								name: r.name,
								kind: r.kind,
								body: "",
								symbol: r.symbol
							},
							plannedCase: r,
							stubs: Jp(q),
							runSuite: e.runSuite,
							imports: v.imports,
							onMechanismResult: (e, t) => {
								t === "empty" ? i.substrateFillEmptyMechanisms++ : t === "vacuous" && i.substrateFillVacuousMechanisms++;
							}
						});
						if (!a) {
							i.substrateFillEscalations++, t.push(r);
							continue;
						}
						v.cases.push({
							name: r.name,
							kind: r.kind,
							body: a.body,
							clade: Yl({
								name: r.name,
								kind: r.kind,
								body: a.body
							}, r.symbol)
						}), i.substrateFillHits++, L("ir", n.id, `case "${r.name}" filled from substrate: ${a.mechanism} (0 tok)`);
					}
					o = t;
				} else i.substrateFillEscalations += o.length;
				if (!o.length) continue;
				let s = t.holeOnlyFill && o.length === 1 ? h_(n, o[0].name, o[0].kind) : null, c = "", d = "";
				{
					let r = o.find((e) => !e.signature || e.kind === "edge") ?? o[0];
					if (r) {
						t.set96bFoldWatcherIntoCandidate0 || await U("ir", n.id, Jp(q));
						let i = e_({
							stage: "ir",
							featureId: n.id,
							spec: q,
							feature: n,
							parts: v,
							stubs: n.stubs,
							lessons: e.lessons ?? [],
							siblingParts: Pe,
							target: r.name,
							conceptText: re.get(n.id) ?? null,
							substrateHandoff: k(n.id),
							ledgerRows: z.allRows(),
							artifact: Jp(q),
							cachedReading: pe.reading,
							signature: r.signature ? {
								name: r.signature.name,
								params: r.signature.params.map((e) => e.type),
								returnType: r.signature.returnType
							} : null
						});
						c = R("ir", n.id, i.assembly, "fill"), d = i.digestPreamble, i.assembly.templates.length;
					}
				}
				let f = null;
				if (t.grammarEnabled) {
					let e = o[0], t = e?.symbol ?? n.exports[0]?.symbol;
					e && t && (f = Cf(Sf({
						name: e.name,
						kind: e.kind,
						license: e.license
					})[0], t));
				}
				let p = o.map((e) => ({
					name: e.name,
					kind: e.kind,
					errors: [
						`Fill ONLY this ${e.kind} case.`,
						e.symbol ? `Symbol under test: ${e.symbol}` : "",
						e.signature ? `Signature: ${e.signature.name}(${e.signature.params.map((e) => `${e.name}: ${e.type}`).join(", ")}): ${e.signature.returnType}` : "",
						e.source === "edge" ? `Edge text (license): ${e.license}` : "",
						f ? wf(f) : "",
						s ? [
							I_,
							"The frame already exists — do not repeat it:",
							s.bytes,
							`Assertion budget: ${s.holeBudgetBytes} bytes (hard cap ${Math.round(s.holeBudgetBytes * 1.5)}).`
						].join("\n") : "",
						c,
						"Prior case bodies withheld. Assert behavior — no existence-only checks."
					].filter(Boolean)
				}));
				try {
					let r = [], a = /* @__PURE__ */ new Set();
					i.permBatches++;
					for (let c = 0; c < iv.length; c++) {
						let u = iv[c], m = t.set96bFoldWatcherIntoCandidate0 && c === 0;
						m && i.watcherInfusedCandidates++, le(), i.permutationDraws++, i.permCandidates++, i.candidatesDrawn++, i.fillCandidatesDrawn++, i.irGenAttempts++;
						for (let e of o) l.set(e.name, (l.get(e.name) ?? 0) + 1);
						let h = await fe({
							method: "fixTestCases:fill",
							target: n.id,
							phase: "ir",
							startEvidence: {
								temperature: u,
								candidateIndex: c + 1,
								holes: o.map((e) => e.name)
							},
							fn: () => e.llm.fixTestCases(q, n, p.map((e) => ({
								...e,
								errors: m ? [...e.errors, d].filter(Boolean) : e.errors
							})), [], v.imports, {
								temperature: u,
								candidate: {
									n: c + 1,
									k: iv.length
								}
							})
						}), g = hg(o.map((e) => ({
							name: e.name,
							kind: e.kind
						})), h.cases);
						i.mechanicalFixes += g.unwrapFixes;
						let _ = 0, y = 0, x = [];
						for (let t = 0; t < g.cases.length; t++) {
							let r = g.cases[t], l = o[t], u = r.body;
							if (s) {
								let e = y_(u, s.holeBudgetBytes);
								if (e.over) {
									i.overreachBodyRejections++, y++, L("ir", n.id, `case "${l.name}" rejected overreach|body: ${e.reason}`);
									continue;
								}
								u = __(u).body ?? u;
							}
							let d = !1;
							if (f) {
								let e = Tf(u, f);
								e && (u = e.body, d = !0);
							}
							let p = jd([{
								name: l.name,
								body: u
							}])[0];
							if (p) {
								let t = Hh(u, p.error);
								t && (u = t.body, i.mechanicalFixes++, e.onLesson?.(yg(`ir-syntax|${t.token}`, p.error, `${t.via} repair of case body (${t.token})`)), L("ir", n.id, `case "${l.name}" healed via ${t.via} (${t.token}, 0 tok)`));
							}
							let m = fu(u, b), h = Ah(u);
							if (m.length || !h) {
								y++;
								let e = m.length ? `surface-conformance: ${m[0].slice(0, 80)}` : "accept-body: predicate rejected body";
								L("ir", n.id, `case "${l.name}" candidate ${c + 1}/${iv.length} rejected after fill — ${e}`), i.healedButRejected = (i.healedButRejected ?? 0) + 1;
								continue;
							}
							_++, d && a.add(u), x.push({
								name: l.name,
								kind: l.kind,
								body: u,
								clade: Yl({
									name: l.name,
									kind: l.kind,
									body: u
								}, l.symbol)
							});
						}
						r.push({
							value: x,
							temp: u,
							score: _,
							findings: y,
							label: `${_}/${o.length} passing`
						});
						{
							let e = g.cases.map((e) => e.body ?? "").join("\n"), t = rf(o.map((e, t) => ({
								path: `${n.testFile}#${e.name}`,
								content: g.cases[t]?.body ?? ""
							}))), r = of(t, be, xe);
							r && (Ce("ir", n.id, o[0]?.name ?? n.id), L("ir", n.id, sf(`fill|${o[0]?.name ?? n.id}`, r))), be.add(t), K({
								classKey: `fill|${o[0]?.kind ?? "behavior"}`,
								layer: "fill",
								temp: u,
								score: _,
								findings: y,
								parseStatus: _ > 0 ? "parsed" : "unparseable",
								hash: t,
								body: e.slice(0, 400)
							});
						}
						if (_ === o.length) {
							L("ir", n.id, `fill accepted at try ${c + 1}/${iv.length} (t=${u}) — ladder stopped`);
							break;
						}
					}
					if (r.length) {
						let t = lv(r);
						if (i.permutationWins++, t.picked.score > 0 && (i.permImproved++, i.candidatesAccepted++, i.fillCandidatesAccepted++), c && t.picked.score > 0) {
							i.superbufferWins++;
							let r = kl({ caseName: o[0]?.name }), a = (P.get(r) ?? 0) + 1;
							if (P.set(r, a), Al(a)) {
								let i = jl({
									patternKey: r,
									featureId: n.id,
									wins: a,
									stubSketch: n.stubs[0]?.content,
									caseBody: t.picked.value[0]?.body,
									source: "in-run-win"
								});
								L("ir", n.id, Ml(i)), e.onCladeCandidate?.(i);
							}
						}
						if (L("ir", n.id, uv(t)), t.picked.score > 0) {
							for (let e of t.picked.value) v.cases.some((t) => pg(t.name, e.name)) || (v.cases.push(e), L("ir", n.id, `case "${e.name}" filled by model`), f && a.has(e.body) && (i.grammarConformant++, L("ir", n.id, Ef(e.name, f.invariant))));
							{
								let e = r.filter((e) => e !== t.picked).sort((e, t) => t.score - e.score || e.temp - t.temp);
								for (let t of o) if (!v.cases.some((e) => pg(e.name, t.name))) for (let r of e) {
									let e = r.value.find((e) => pg(e.name, t.name));
									if (e) {
										v.cases.push(e), i.salvagedCases++, L("ir", n.id, `case "${t.name}" salvaged from candidate t=${r.temp} (cross-candidate, 0 extra tok)`);
										break;
									}
								}
							}
							for (let e of o) {
								if (v.cases.some((t) => pg(t.name, e.name))) continue;
								let t = Xl({
									name: e.name,
									kind: e.kind,
									body: "",
									clade: Yl({
										name: e.name,
										kind: e.kind,
										body: ""
									}, e.symbol)
								});
								if (t && Ah(t) && !fu(t, b).length) {
									v.cases.push({
										name: e.name,
										kind: e.kind,
										body: t,
										clade: Yl({
											name: e.name,
											kind: e.kind,
											body: t
										}, e.symbol)
									}), i.mechanicalFixes++, L("ir", n.id, `case "${e.name}" rebound via clade (0 tok)`);
									continue;
								}
								L("ir", n.id, `case "${e.name}" empty in all candidates — queued for single-target rescue (0 tok)`);
							}
						}
					}
				} catch (e) {
					L("ir", n.id, `per-case fill failed for [${o.map((e) => `"${e.name}"`).join(", ")}]: ${e instanceof Error ? e.message : String(e)}`);
				}
			}
			if (v.cases.length > 0) break;
		}
		let w = new Set(v.cases.map((e) => e.name)), T = f.cases.filter((e) => !w.has(e.name)), E = null;
		if (T.length) {
			L("ir", n.id, c_(T.map((e) => e.name), "fallback")), c.add(n.id);
			for (let e of T) d.set(e.name, (d.get(e.name) ?? 0) + 1);
			await U("ir", n.id, Jp(q));
			let r = e_({
				stage: "ir",
				featureId: n.id,
				spec: q,
				feature: n,
				parts: v,
				stubs: n.stubs,
				lessons: e.lessons ?? [],
				siblingParts: Pe,
				target: T.map((e) => e.name).join(" | ") || n.id,
				conceptText: re.get(n.id) ?? null,
				substrateHandoff: k(n.id),
				ledgerRows: z.allRows(),
				artifact: Jp(q),
				cachedReading: pe.reading,
				signature: n.exports[0] ? {
					name: n.exports[0].symbol,
					params: [],
					returnType: "unknown"
				} : null
			}), o = R("ir", n.id, r.assembly, "fill"), s = Math.max(t.irAttempts, iv.length);
			for (let t = 0; t < s; t++) {
				le(), t > 0 && i.irRedraws++;
				for (let e of T) l.set(e.name, (l.get(e.name) ?? 0) + 1);
				let { result: r } = await a.runAction({
					kind: "llm:generateTests",
					target: n.id,
					phase: "ir",
					startEvidence: {
						attempt: t + 1,
						candidateN: t + 1,
						candidateK: s
					},
					fn: () => e.llm.generateTests(q, n, [`Plan-bound fallback. Required cases: ${f.cases.map((e) => `${e.kind}:${e.name}`).join(", ")}`, o].filter(Boolean).join("\n\n"), {
						attempt: t + 1,
						temperature: iv[Math.min(t, iv.length - 1)],
						candidate: {
							n: t + 1,
							k: s
						}
					})
				});
				if (r.parts?.cases.length) {
					for (let e of r.parts.cases) {
						let t = f.cases.find((t) => pg(t.name, e.name));
						if (!t) continue;
						let r = e.body, a = mg(r);
						if (a.unwrapped && (r = a.body, i.mechanicalFixes++), !Ah(r)) {
							let e = Od(r);
							e && (J.push(`${n.id}: case "${t.name}" dropped — ${e} (coverage reduced)`), L("ir", n.id, `case "${t.name}" dropped — ${e} (coverage reduced)`), w.add(t.name));
							continue;
						}
						fu(r, b).length || w.has(t.name) || (v.cases.push({
							...e,
							name: t.name,
							kind: t.kind,
							body: r
						}), w.add(t.name));
					}
					if (r.parts.imports.length && (v.imports = f.imports), !f.cases.some((e) => !w.has(e.name))) break;
				} else if (r.content && !C(r.content).length && !Ad(r.content)) {
					E = r.content;
					break;
				}
				if (!T.some((e) => !w.has(e.name))) break;
			}
		}
		if (E) {
			if (e.runSuite) {
				let t = await e.runSuite(Jp(q), {
					path: n.testFile,
					content: E
				});
				if (L("ir", n.id, Zp(Yp(t))), !Xp(t)) return L("ir", n.id, "born-red: all-vacuous fixture suite — freeze refused (assert observable behavior)"), {
					status: "deferred",
					reason: "born-red vacuous suite"
				};
			}
			let t = Np(E, n.testFile, q);
			E = t.content, t.injected.length && (L("ir", n.id, `suite scaffold-wire: injected ${t.injected.map((e) => e.symbol).join(", ")} (0 tok)`), i.mechanicalFixes += t.injected.length, i.deterministicEditsOutsideSubstrate += t.injected.length);
			let r = await Le(n, E, "fixture-fallback");
			if (r.status === "rejected") {
				let e = r.report.rejectionReasons[0] ?? "fixture-fallback gateway refused";
				return L("ir", n.id, `fixture-fallback freeze refused (gateway): ${e.slice(0, 200)}`), {
					status: "deferred",
					reason: e
				};
			}
			return e.runSuite ? L("ir", n.id, "fixture-fallback freeze accepted (case-cert bypassed — no canonical IRParts)") : L("ir", n.id, "fixture-fallback freeze uncertified: no runSuite host (case cert skipped, parse gate ran)"), (He.get(n.id) ?? 1) <= 1 && !c.has(n.id) && i.featuresFrozenWithoutRedraw++, L("ir", n.id, `frozen suite ${n.testFile} (fixture fallback; ${f.cases.length} planned)`), { status: "frozen" };
		}
		let ee = jd(v.cases);
		if (ee.length) {
			L("ir", n.id, `syntax — ${ee.length} broken case(s) pinpointed`);
			for (let t of ee) {
				let r = v.cases.findIndex((e) => pg(e.name, t.name));
				if (r < 0) continue;
				let a = Hh(v.cases[r].body, t.error);
				a && (v.cases[r] = {
					...v.cases[r],
					body: a.body
				}, i.mechanicalFixes++, e.onLesson?.(yg(`ir-syntax|${a.token}`, t.error, `${a.via} repair of case body (${a.token})`)), L("ir", n.id, `case "${t.name}" healed via ${a.via} (${a.token}, 0 tok)`));
			}
			if (ee = jd(v.cases), ee.length) {
				for (let e of ee) {
					let t = v.cases.find((t) => pg(t.name, e.name))?.body ?? "";
					if (Qm(e.error) || !t.trim()) {
						if (Gl(e.name)) {
							let t = Kl(e.name), r = v.cases.findIndex((t) => pg(t.name, e.name));
							if (r >= 0 && Ah(t) && !fu(t, b).length) {
								v.cases[r] = {
									...v.cases[r],
									body: t,
									clade: Yl({
										name: e.name,
										kind: v.cases[r].kind,
										body: t
									}, e.name)
								}, i.templatedCases++, i.mechanicalFixes++, L("ir", n.id, `case "${e.name}" filled via ${Rl} (0 tok, empty-draw)`);
								continue;
							}
						}
						L("ir", n.id, `case "${e.name}" ${Zm(1)} — skipped failure stack`);
						continue;
					}
					let r = t.replace(/\s+/g, " ").slice(0, 80), a = yv(j, {
						featureId: n.id,
						caseName: e.name,
						kind: "parse",
						brokenDraw: t,
						parseError: e.error,
						snippet: r
					});
					if (j = a.state, a.pushed) L("ir", n.id, `case "${e.name}" deferred to failure stack (instance ${a.pushed.instance}/3)`);
					else {
						let r = Fu(e.error, t);
						J.push(`${n.id}: case "${e.name}" ${r} (coverage reduced)`), L("ir", n.id, `case "${e.name}" ${r} (coverage reduced)`);
					}
				}
				for (; j.queue.some((e) => e.featureId === n.id);) {
					le();
					let r = bv(j);
					j = r.state;
					let a = r.entry;
					if (!a || a.featureId !== n.id) {
						a && (j = yv(j, a).state);
						break;
					}
					try {
						let r = Dl({
							spec: q,
							feature: n,
							parts: v,
							stubs: n.stubs,
							lessons: e.lessons ?? [],
							siblingParts: Pe,
							target: a.caseName,
							stage: "fill",
							conceptText: re.get(n.id) ?? null,
							findingEvidence: wv(a)
						});
						L("ir", n.id, r.logLine), l.set(a.caseName, (l.get(a.caseName) ?? 0) + 1);
						let o = v.cases.find((e) => pg(e.name, a.caseName));
						if (!o) continue;
						let s = kv(t, n, o.name, o.kind), c = await fe({
							method: "fixTestCases:warm-world",
							target: n.id,
							phase: "ir",
							startEvidence: {
								temperature: Mv[Mv.length - 1],
								caseName: o.name,
								instance: a.instance
							},
							fn: () => e.llm.fixTestCases(q, n, [{
								name: o.name,
								kind: o.kind,
								errors: [
									wv(a),
									Ol(r),
									Av(s)
								].filter(Boolean)
							}], [], v.imports, {
								temperature: Mv[Mv.length - 1],
								attempt: a.instance
							})
						});
						i.irGenAttempts++;
						let u = hg([{
							name: o.name,
							kind: o.kind
						}], c.cases);
						i.mechanicalFixes += u.unwrapFixes;
						let d = u.cases[0]?.body ?? "", f = jv(s, d, i, a.caseName, (e) => L("ir", n.id, e));
						if (f.rejected) continue;
						d = f.body;
						let p = jd([{
							name: o.name,
							body: d
						}])[0];
						if (p) {
							let e = Hh(d, p.error);
							e && (d = e.body, i.mechanicalFixes++);
						}
						let m = v.cases.findIndex((e) => pg(e.name, a.caseName));
						if (m >= 0 && Ah(d) && !jd([{
							name: o.name,
							body: d
						}]).length && !fu(d, b).length) v.cases[m] = {
							...v.cases[m],
							body: d
						}, L("ir", n.id, `case "${a.caseName}" warm-repaired from failure stack`);
						else {
							let e = Cv({
								oraclePass: !0,
								warmRedraw: !0
							});
							J.push(`${n.id}: case "${a.caseName}" ${e} (coverage reduced)`), L("ir", n.id, `case "${a.caseName}" ${e} (coverage reduced)`), v = {
								...v,
								cases: v.cases.filter((e) => !pg(e.name, a.caseName))
							};
						}
					} catch {
						let e = Cv({
							oraclePass: !0,
							warmRedraw: !0
						});
						J.push(`${n.id}: case "${a.caseName}" ${e} (coverage reduced)`), L("ir", n.id, `case "${a.caseName}" ${e} (coverage reduced)`), v = {
							...v,
							cases: v.cases.filter((e) => !pg(e.name, a.caseName))
						};
					}
				}
				if (ee = jd(v.cases), ee.length) {
					let e = new Set(ee.map((e) => e.name));
					v = {
						...v,
						cases: v.cases.filter((t) => !e.has(t.name) && Ah(t.body))
					};
				}
			}
		}
		for (let t of f.cases.filter((e) => !v.cases.some((t) => t.name === e.name))) {
			let r = l_(t.name, l.get(t.name) ?? 0, u.get(t.name) ?? 0, d.get(t.name) ?? 0);
			e.runSuite && y.length < 8 ? (y.push({
				featureId: n.id,
				name: t.name,
				kind: t.kind,
				reason: r.replace(/^planned case "[^"]*" /, "")
			}), i.reEnqueuedCases++, L("ir", n.id, `planned case "${t.name}" re-enqueued to end-of-run stack (${l.get(t.name) ?? 0} cold draws spent — warm retry pending)`)) : (J.push(`${n.id}: ${r}`), L("ir", n.id, r));
		}
		if (!v.cases.length) {
			let e = K_({
				frozenByFeature: Ne,
				lessonKeys: Re,
				irPartsByFeature: Pe
			});
			return L("ir", n.id, Y_({
				frozenCount: e.frozenCount,
				siblingCaseCount: e.siblingCaseCount
			})), {
				status: "deferred",
				reason: `fill exhaustion (cycles=${S}, floor=${x}, metaloop=${r})`
			};
		}
		let te = O(n, v.imports, v.cases), ne = C(te), D = ne.length ? null : Ad(te);
		if (!ne.length && !D) {
			let e = v.cases.filter((e) => Od(e.body));
			if (e.length) {
				for (let t of e) {
					let e = Od(t.body);
					J.push(`${n.id}: case "${t.name}" dropped — ${e} (coverage reduced)`), L("ir", n.id, `case "${t.name}" dropped — ${e} (coverage reduced)`);
				}
				v = {
					imports: v.imports,
					cases: v.cases.filter((e) => !Od(e.body))
				}, te = O(n, v.imports, v.cases), v.cases.length || (D = "dynamic-eval: all cases rejected (runtime code synthesis)");
			}
		}
		if (!ne.length && D) {
			let e = $g(te, D);
			e && !Ad(e.content) && (te = e.content, D = null, i.mechanicalFixes++, L("ir", n.id, `pre-freeze delimiter oracle heal (${e.classKey}, ${e.edits} edit${e.edits === 1 ? "" : "s"}, 0 tok)`));
		}
		if (ne.length || D) {
			let e = K_({
				frozenByFeature: Ne,
				lessonKeys: Re,
				irPartsByFeature: Pe
			});
			return L("ir", n.id, `IR suite invalid (${ne.length || 1} shape/syntax finding) — ${Y_({
				frozenCount: e.frozenCount,
				siblingCaseCount: e.siblingCaseCount
			})}`), {
				status: "deferred",
				reason: "suite failed validation"
			};
		}
		o = te, s = {
			...v,
			cases: v.cases.map((e) => ({
				...e,
				clade: e.clade ?? Yl(e)
			}))
		};
		{
			let e = Np(o, n.testFile, q);
			e.injected.length && (o = e.content, L("ir", n.id, `suite scaffold-wire: injected ${e.injected.map((e) => e.symbol).join(", ")} (0 tok)`), i.mechanicalFixes += e.injected.length, i.deterministicEditsOutsideSubstrate += e.injected.length);
		}
		if (e.runSuite && s.cases.length > 0) {
			let r = Jp(q), a = await e.runSuite(r, {
				path: n.testFile,
				content: o
			}), c = Yp(a);
			if (!Xp(a)) {
				let l = s.cases.filter((e) => !a.failures.some((t) => t.name.includes(e.name)) && Qp(e.body)).length;
				l && L("ir", n.id, $p(l));
				let u = s.cases.filter((e) => !a.failures.some((t) => t.name.includes(e.name)) && em(e.body, n, q));
				if (u.length) {
					i.bornRedStubDerivedDrops += u.length, L("ir", n.id, `born-red: ${u.length} stub-derived throw case(s) dropped — cannot be de-vacuum'd (stub is the contract)`);
					let t = new Set(u.map((e) => e.name));
					if (s = {
						imports: s.imports,
						cases: s.cases.filter((e) => !t.has(e.name))
					}, !s.cases.length) return {
						status: "deferred",
						reason: "all cases stub-derived-throw dropped at born-red"
					};
					o = Np(O(n, s.imports, s.cases), n.testFile, q).content, a = await e.runSuite(r, {
						path: n.testFile,
						content: o
					}), c = Yp(a);
				}
				let d = new Set(s.cases.filter((e) => !a.failures.some((t) => t.name.includes(e.name))).filter((e) => !Qp(e.body)).map((e) => e.name)), f = s.cases.filter((e) => d.has(e.name)).map((e) => ({
					name: e.name,
					kind: e.kind,
					errors: [tm]
				}));
				if (f.length) {
					if (L("ir", n.id, `born-red: ${f.length} vacuous case(s) → surgery (${tm})`), e.runSuite) {
						let t = !1, l = [...s.cases];
						for (let a of f) {
							let o = l.findIndex((e) => pg(e.name, a.name)), c = o >= 0 ? l[o] : null;
							if (!c) continue;
							let u = n.exports.find((e) => e.symbol === a.name)?.symbol ?? n.exports[0]?.symbol, d = await u_({
								spec: q,
								feature: n,
								caseGen: {
									...c,
									symbol: u
								},
								stubs: r,
								runSuite: e.runSuite,
								imports: s.imports,
								onMechanismResult: (e, t) => {
									t === "empty" ? i.substrateFillEmptyMechanisms++ : t === "vacuous" && i.substrateFillVacuousMechanisms++;
								}
							});
							if (!d) {
								i.substrateFillEscalations++;
								continue;
							}
							l[o] = {
								...c,
								body: d.body,
								clade: Yl({
									...c,
									body: d.body
								}, u)
							}, i.substrateFillHits++, t = !0, L("ir", n.id, `case "${a.name}" filled from substrate: ${d.mechanism} (0 tok)`);
						}
						t && (s = {
							imports: s.imports,
							cases: l
						}, o = Np(O(n, s.imports, s.cases), n.testFile, q).content, te = o, a = await e.runSuite(r, {
							path: n.testFile,
							content: o
						}), c = Yp(a));
					}
					let l = e_({
						stage: "ir",
						featureId: n.id,
						spec: q,
						feature: n,
						parts: s,
						stubs: n.stubs,
						lessons: e.lessons ?? [],
						siblingParts: Pe,
						target: `born-red|${n.id}`,
						conceptText: re.get(n.id) ?? null,
						substrateHandoff: k(n.id),
						ledgerRows: z.allRows(),
						artifact: Jp(q),
						cachedReading: pe.reading
					}), u = R("ir", n.id, l.assembly, "born-red");
					for (let l = 0; l < iv.length && !Xp(a); l++) {
						let d = s.cases.filter((e) => !a.failures.some((t) => t.name.includes(e.name))).filter((e) => !Qp(e.body)).map((e) => ({
							name: e.name,
							kind: e.kind,
							errors: [tm, u].filter(Boolean)
						}));
						if (!d.length) break;
						let f = d.length === 1 ? kv(t, n, d[0].name, d[0].kind) : null, p = f ? d.map((e) => ({
							...e,
							errors: [...e.errors, Av(f)].filter(Boolean)
						})) : d;
						try {
							let t = hg(d, (await fe({
								method: "fixTestCases:born-red-surgery",
								target: n.id,
								phase: "ir",
								startEvidence: {
									temperature: iv[l],
									attempt: l + 1,
									vacuous: d.map((e) => e.name)
								},
								fn: () => e.llm.fixTestCases(q, n, p, [], s.imports, {
									purpose: `born-red surgery: ${n.id}`,
									temperature: iv[l],
									candidate: {
										n: l + 1,
										k: iv.length
									}
								})
							})).cases);
							if (i.mechanicalFixes += t.unwrapFixes, f) {
								let e = jv(f, t.cases[0]?.body ?? "", i, d[0].name, (e) => L("ir", n.id, e));
								if (e.rejected) continue;
								t.cases[0] && (t.cases[0] = {
									...t.cases[0],
									body: e.body
								});
							}
							let u = s.cases.map((e) => {
								let n = d.findIndex((t) => pg(t.name, e.name));
								return n >= 0 && t.cases[n] ? {
									...e,
									...t.cases[n],
									name: d[n].name,
									kind: d[n].kind,
									clade: e.clade
								} : e;
							}), m = O(n, s.imports, u);
							if (C(m).length || Ad(m)) {
								L("ir", n.id, `born-red surgery try ${l + 1}/${iv.length}: invalid suite — discarded`);
								continue;
							}
							s = {
								imports: s.imports,
								cases: u
							}, o = Np(m, n.testFile, q).content, te = o, i.irSurgeries++, a = await e.runSuite(r, {
								path: n.testFile,
								content: o
							}), c = Yp(a), !Xp(a) && l < iv.length - 1 && L("ir", n.id, `born-red surgery try ${l + 1}/${iv.length}: still vacuous — retrying hotter`);
						} catch (e) {
							L("ir", n.id, `born-red surgery try ${l + 1}/${iv.length} failed: ${e instanceof Error ? e.message : String(e)}`);
						}
					}
				}
			}
			if (L("ir", n.id, Zp(c)), !Xp(a)) {
				let t = !1, l = ue(n);
				if (l) {
					let u = s.cases.filter((e) => Qp(e.body)), d = {
						imports: s.imports,
						cases: [l, ...u]
					}, f = Np(O(n, d.imports, d.cases), n.testFile, q).content;
					if (!C(f).length && !Ad(f)) {
						let p = await e.runSuite(r, {
							path: n.testFile,
							content: f
						});
						if (Xp(p)) {
							let e = 0;
							for (let t of s.cases) Qp(t.body) || y.length < 8 && (y.push({
								featureId: n.id,
								name: t.name,
								kind: t.kind,
								reason: "vacuous at born-red — dropped (coverage reduced)"
							}), i.reEnqueuedCases++, e++);
							s = d, o = f, a = p, c = Yp(p), t = !0, L("ir", n.id, `born-red: deterministic anchor frozen ("${l.name}", 0 tok) — ${e} vacuous case(s) re-enqueued` + (u.length ? `, ${u.length} throw-expecting retained` : ""));
						}
					}
				}
				if (!t) return L("ir", n.id, "born-red: suite still vacuous after surgery — freeze refused"), {
					status: "deferred",
					reason: "born-red vacuous suite"
				};
			}
			let l = /* @__PURE__ */ new Set([
				"is-not-a-function",
				"unresolved-import",
				"undefined-symbol"
			]), u = () => {
				let e = [];
				if (a.crashed) {
					let t = th("__suite__", a.crashed);
					return (l.has(t.kind) || t.kind === "transpile") && e.push({
						caseName: null,
						cls: t
					}), e;
				}
				for (let t of a.failures) {
					let n = th(t.name, t.message);
					l.has(n.kind) && !/not implemented|stub/i.test(n.message) && e.push({
						caseName: t.name,
						cls: n
					});
				}
				return e;
			}, d = u(), f = (e) => {
				if (!e) return;
				let t;
				for (let n of s.cases) e.includes(n.name) && (!t || n.name.length > t.name.length) && (t = n);
				return t;
			}, p = /* @__PURE__ */ new Map();
			d.length && (i.sickRedCases += d.length, L("ir", n.id, `test-rha: ${d.length} sick-red case(s) [${[...new Set(d.map((e) => e.cls.classKey))].join(", ")}] — freeze-gate repair`));
			for (let l = 0; l < 2 && d.length; l++) {
				let l = /* @__PURE__ */ new Set(), m = !1;
				for (let { cls: e } of d) {
					let t = Eh(e, r, {
						path: n.testFile,
						content: o
					}, q), a = t.status === "fixed" ? t.fixes?.length ? t.fixes : t.fix ? [t.fix] : [] : [];
					for (let t of a) t.path !== n.testFile || t.content === o || (o = t.content, m = !0, i.testRhaSubstrateFixes++, L("ir", n.id, `test-rha: ${e.classKey} → suite-side fix (0 tok)`));
				}
				if (!m && d[0]) {
					L("ir", n.id, `test-rha: miser ladder [K=${iv.length}] (stops on first cleared redraw)`);
					let m = d.find((e) => {
						let t = f(e.caseName);
						return t && !l.has(t.name);
					}) ?? d[0], h = f(m.caseName);
					if (!h) L("ir", n.id, `test-rha: case "${m.caseName}" skipped — no case handle`), i.testRhaSkippedNoHandle++, p.set(m.caseName ?? "__no-handle__", "skipped-no-handle");
					else if (l.has(h.name)) L("ir", n.id, `test-rha: case "${h.name}" skipped — already redrawn this pass`), i.testRhaSkippedAlreadyRedrawn++, p.set(h.name, "skipped-already-redrawn");
					else {
						l.add(h.name);
						for (let l = 0; l < iv.length; l++) {
							i.testRhaDraws++;
							let g = iv[l], _ = `try ${l + 1}/${iv.length}, t=${g}`, v = e_({
								stage: "ir",
								featureId: n.id,
								spec: q,
								feature: n,
								parts: s ?? null,
								stubs: n.stubs,
								lessons: e.lessons ?? [],
								siblingParts: Pe,
								target: m.cls.classKey,
								substrateHandoff: k(n.id),
								ledgerRows: z.allRows(),
								artifact: Jp(q),
								cachedReading: pe.reading
							}), y = R("ir", n.id, v.assembly, "test-rha"), b = kv(t, n, h.name, h.kind), x;
							try {
								x = await fe({
									method: "fixTestCases:test-rha-rescue",
									target: n.id,
									phase: "ir",
									startEvidence: {
										temperature: g,
										attempt: l + 1,
										caseName: h.name,
										classKey: m.cls.classKey
									},
									fn: () => e.llm.fixTestCases(q, n, [{
										name: h.name,
										kind: h.kind,
										errors: [
											`Sick-red at freeze: ${m.cls.classKey} — ${m.cls.message.split("\n")[0]}`,
											"The frozen contract is the stub: call ONLY symbols and shapes the stubs export.",
											y,
											Av(b)
										].filter(Boolean)
									}], [], s.imports, {
										purpose: `test-rha: ${n.id}`,
										rescue: !0,
										temperature: g,
										candidate: {
											n: l + 1,
											k: iv.length
										}
									})
								});
							} catch (e) {
								i.testRhaDrawThrew++;
								let t = e instanceof Error ? e.message.slice(0, 200) : String(e).slice(0, 200);
								L("ir", n.id, `test-rha: draw threw (${_}) — ${t}`), p.set(h.name, "attempt-threw");
								continue;
							}
							let S = x.cases[0]?.body ?? "", C = jv(b, S, i, h.name, (e) => L("ir", n.id, e));
							if (C.rejected) {
								i.testRhaDraftRejected++, p.set(h.name, "attempt-rejected");
								continue;
							}
							if (S = C.body, !S.trim() || !Ah(S)) {
								i.testRhaDraftRejected++;
								let e = S.trim() ? "failed acceptCaseBody" : "empty body";
								L("ir", n.id, `test-rha: draft rejected (${_}) — ${e}`), p.set(h.name, "attempt-rejected");
								continue;
							}
							if (s = {
								imports: s.imports,
								cases: s.cases.map((e) => e.name === h.name ? {
									...e,
									body: S
								} : e)
							}, o = Np(O(n, s.imports, s.cases), n.testFile, q).content, L("ir", n.id, `test-rha: draft accepted (${_})`), a = await e.runSuite(r, {
								path: n.testFile,
								content: o
							}), c = Yp(a), d = u(), !d.some((e) => f(e.caseName)?.name === h.name)) {
								i.testRhaDraftAcceptedCleared++, i.testRhaCaseCleared++, L("ir", n.id, `test-rha: case "${h.name}" cleared`), p.set(h.name, "case-cleared");
								break;
							}
							i.testRhaDraftAcceptedStillSick++, L("ir", n.id, `test-rha: case "${h.name}" still sick — continuing ladder`), p.set(h.name, "attempt-accepted-still-sick");
						}
						p.get(h.name) !== "case-cleared" && (i.testRhaCaseExhausted++, L("ir", n.id, `test-rha: case "${h.name}" exhausted after ${iv.length} attempts`), p.set(h.name, "case-exhausted"));
					}
				}
				a = await e.runSuite(r, {
					path: n.testFile,
					content: o
				}), c = Yp(a), d = u();
			}
			if (d.length) {
				let t = new Set(d.map((e) => f(e.caseName)?.name).filter((e) => !!e));
				for (let e of t) {
					let t = p.get(e) ?? "case-exhausted";
					t === "case-exhausted" ? (J.push(`${n.id}: case "${e}" dropped at freeze-gate — sick-red unrepairable`), L("ir", n.id, `test-rha: case "${e}" dropped at freeze-gate — sick-red unrepairable`), p.set(e, "case-dropped-unrepairable")) : (J.push(`${n.id}: case "${e}" dropped at freeze-gate — ${t}`), L("ir", n.id, `test-rha: case "${e}" dropped at freeze-gate — ${t}`));
				}
				if (t.size) {
					if (s = {
						imports: s.imports,
						cases: s.cases.filter((e) => !t.has(e.name))
					}, !s.cases.length) return {
						status: "deferred",
						reason: "all cases sick-red at freeze"
					};
					o = Np(O(n, s.imports, s.cases), n.testFile, q).content, a = await e.runSuite(r, {
						path: n.testFile,
						content: o
					}), c = Yp(a);
				} else if (a.crashed) return {
					status: "deferred",
					reason: `sick-red suite crash at freeze: ${a.crashed.slice(0, 80)}`
				};
				else L("ir", n.id, `test-rha: ${d.length} sick-red case(s) unattributed — freezing with disclosure`);
				if (!Xp(a)) return L("ir", n.id, "born-red: suite not red after freeze-gate repair — freeze refused"), {
					status: "deferred",
					reason: "born-red vacuous suite"
				};
			}
		}
		let A = Zl(s.cases);
		if (N += A.schemad, ce += A.freeform, i.cladeRatio = `${N}:${ce}`, e.runSuite) {
			let t = null, r = 0;
			for (; r++ < 4 && (t = await wg({
				spec: q,
				feature: n,
				prompt: e.rawPrompt ?? e.prompt,
				parts: s,
				runSuite: e.runSuite,
				stubs: Jp(q),
				state: Y,
				reason: r === 1 ? "initial-freeze" : `initial-freeze/retry-${r - 1}`,
				onAcceptance: (e) => {
					Fe.set(n.id, e);
				},
				onRejection: (e) => {
					Fe.set(n.id, e);
				},
				actionLedger: a
			}), t.status !== "accepted");) {
				let e = t.report.cases.filter((e) => e.disposition === "rejected-vacuous"), r = t.report.cases.filter((e) => e.disposition.startsWith("rejected") && e.disposition !== "rejected-vacuous"), a = t.report.rejectionReasons.some((e) => e.startsWith("suite shape") || e.startsWith("suite syntax") || e.startsWith("program parse") || e.startsWith("gate infrastructure"));
				if (r.length || a || !e.length) break;
				for (let t of e) y.length < 8 ? (y.push({
					featureId: n.id,
					name: t.caseName,
					kind: s.cases.find((e) => e.name === t.caseName)?.kind ?? "behavior",
					reason: `dropped at freeze-gate — rejected-vacuous (${t.reason.slice(0, 120)})`
				}), i.reEnqueuedCases++, L("ir", n.id, `case "${t.caseName}" re-enqueued (freeze-gate: rejected-vacuous) — warm retry pending`)) : (J.push(`${n.id}: case "${t.caseName}" dropped at freeze-gate — rejected-vacuous`), L("ir", n.id, `case "${t.caseName}" dropped at freeze-gate — rejected-vacuous`));
				let c = new Set(e.map((e) => e.caseName));
				if (s = {
					imports: s.imports,
					cases: s.cases.filter((e) => !c.has(e.name))
				}, !s.cases.length) return L("ir", n.id, "freeze refused (gateway): all cases rejected-vacuous — no observable contract"), {
					status: "deferred",
					reason: "all cases rejected-vacuous — no observable contract"
				};
				o = Np(O(n, s.imports, s.cases), n.testFile, q).content;
			}
			if (!t || t.status === "rejected") {
				let e = (t?.report.rejectionReasons ?? ["unknown rejection"])[0] ?? "commitFrozenSuite refused freeze";
				return L("ir", n.id, `freeze refused (gateway): ${e.slice(0, 200)}`), {
					status: "deferred",
					reason: e
				};
			}
		} else {
			let e = await Ie(n, o, s, "initial-freeze: no runSuite");
			if (e && e.status === "rejected") {
				let t = e.report.rejectionReasons[0] ?? "gateway refused freeze (no runSuite host)";
				return L("ir", n.id, `freeze refused (gateway): ${t.slice(0, 200)}`), {
					status: "deferred",
					reason: t
				};
			}
			L("ir", n.id, "freeze uncertified: no runSuite host (case cert skipped, parse gate ran)");
		}
		{
			let e = z.recordNode({
				type: "test",
				featureId: n.id,
				causeId: B.get(n.id) ?? null,
				artifactPath: n.testFile,
				status: "pass",
				summary: `IR frozen: ${s.cases.length}/${f.cases.length} planned cases`
			});
			for (let t of s.cases) z.recordNode({
				type: "decision",
				featureId: n.id,
				parentId: e,
				artifactPath: n.testFile,
				summary: `case "${t.name}" [${t.kind}${t.clade?.family ? `/${t.clade.family}` : ""}] frozen into the contract`
			});
		}
		(He.get(n.id) ?? 1) <= 1 && !c.has(n.id) && i.featuresFrozenWithoutRedraw++;
		{
			let e = f.cases.length, t = s.cases.length, r = Math.max(0, e - t);
			L("ir", n.id, `frozen suite ${n.testFile} (${e} planned → ${t} filled${r ? `, ${r} unfilled→re-enqueued` : ""}; clades ${A.schemad}:${A.freeform}; aggregate ${i.cladeRatio})`);
		}
		return { status: "frozen" };
	}, He = /* @__PURE__ */ new Map(), Ue = /* @__PURE__ */ new Map(), We = (e) => {
		let t = (He.get(e) ?? 0) + 1;
		return He.set(e, t), t;
	}, Ge = (e) => {
		Ue.set(e, K_({
			frozenByFeature: Ne,
			lessonKeys: Re,
			irPartsByFeature: Pe
		}));
	}, Ke = (e) => {
		let t = Ue.get(e);
		return !t || q_(t, K_({
			frozenByFeature: Ne,
			lessonKeys: Re,
			irPartsByFeature: Pe
		}));
	}, qe = [];
	for (let e of je) le(), We(e.id), Ge(e.id), (await Ve(e, 1)).status === "deferred" && (qe.push(e.id), i.deferredTotal++);
	let Je = [];
	if (qe.length) {
		let e = rv(qe, q.features);
		L("ir", null, Z_(e));
		for (let t of e) {
			le();
			let e = je.find((e) => e.id === t);
			if (e) {
				if (!Ke(t)) {
					L("ir", t, $_()), Je.push(t);
					continue;
				}
				We(t), Ge(t), u.has(t) || (u.add(t), i.deferredRelitigated++), (await Ve(e, 2)).status === "frozen" ? i.deferredResolvedAfterRelitigation++ : Je.push(t);
			}
		}
	}
	let Ye = [];
	if (Je.length) {
		let e = rv(Je, q.features);
		L("ir", null, Q_(e));
		for (let t of e) {
			le();
			let e = je.find((e) => e.id === t);
			if (!e) {
				Ye.push(t);
				continue;
			}
			if (!Ke(t)) {
				L("ir", t, $_()), Ye.push(t);
				continue;
			}
			We(t), Ge(t), u.has(t) || (u.add(t), i.deferredRelitigated++), (await Ve(e, 3)).status === "frozen" ? i.deferredResolvedAfterRelitigation++ : Ye.push(t);
		}
	}
	for (let e of Ye) {
		J.some((t) => t.startsWith(`${e}: no-coverage`)) || J.push(ev(e)), L("ir", e, "no-coverage — abandoned after metaloop 3");
		for (let t of q.features) {
			if (!t.deps.includes(e)) continue;
			let n = tv(t.id, e);
			J.some((e) => e === n) || J.push(n), L("ir", t.id, `uses ${e} — dependency uncovered`);
		}
	}
	await e.onPhaseGate?.("ir-contract"), le();
	let Xe = new Pg({ ledger: a }), Ze = /* @__PURE__ */ new Map(), Qe = /* @__PURE__ */ new Map(), $e = (e) => {
		for (let t of e) Ze.set(t, (Ze.get(t) ?? 0) + 1);
	}, et = (e) => {
		let t = Qe.get(e);
		return t !== void 0 && t === (Ze.get(e) ?? 0);
	}, tt = (e, t) => {
		let n = Ze.get(e) ?? 0;
		Qe.get(e) !== n && (Qe.set(e, n), i.quarantineSuspensions++, L("rha", t, `repair suspended: ${e} awaiting fresh draw (impl repair exhausted)`));
	};
	for (let n of je) {
		le();
		let r = Ne.get(n.id);
		if (r == null) continue;
		let o = n.deps.flatMap((e) => q.features.find((t) => t.id === e)?.files ?? []).map((e) => Xe.get(e)).filter((e) => e != null);
		if (typeof e.llm.drawConcept == "function" && !re.has(n.id)) {
			let t, { ok: r } = await a.runNonfatalAction({
				kind: "llm:drawConcept",
				target: n.id,
				phase: "build",
				startEvidence: { purpose: `concept: ${n.id}` },
				fn: async () => {
					t = await e.llm.drawConcept(wl(n, q), n, {
						temperature: 1.1,
						purpose: `concept: ${n.id}`
					});
				}
			});
			r && t && t.trim() ? (re.set(n.id, t.trim()), i.conceptDraws++, L("build", n.id, El(n.id, t.trim().length))) : r || L("build", n.id, "concept draw failed (nonfatal — see action ledger)");
		}
		let s = Xe.files().filter((e) => !n.files.includes(e.path)), c = await U("build", n.id, Xe.files()), l = Dl({
			spec: q,
			feature: n,
			parts: Pe.get(n.id) ?? null,
			stubs: n.stubs,
			lessons: e.lessons ?? [],
			siblingParts: Pe,
			siblingImpls: s,
			target: `build|${n.id}`,
			stage: "build",
			unionText: c,
			conceptText: re.get(n.id) ?? null,
			signature: n.exports[0] ? {
				name: n.exports[0].symbol,
				params: [],
				returnType: "unknown"
			} : null
		}), u = R("build", n.id, l, "fill"), d = [
			void 0,
			.75,
			1
		];
		for (let s = 0; s < d.length; s++) {
			let { result: c } = await a.runAction({
				kind: "llm:generateImplementation",
				target: n.id,
				phase: "build",
				startEvidence: {
					attempt: s + 1,
					temperature: d[s],
					files: n.files
				},
				fn: () => e.llm.generateImplementation(q, n, r, o, {
					context: t.holeOnlyFill ? [u, L_].join("\n\n") : u,
					purpose: `build: ${n.files.join(", ")}`,
					temperature: d[s],
					attempt: s + 1,
					attemptLabel: "attempt"
				})
			}), l = c;
			if (t.holeOnlyFill) {
				let e = l.filter((e) => n.files.includes(e.path) && x_(e.content).over);
				for (let t of e) i.overreachBodyRejections++, L("build", n.id, `case "${t.path}" rejected overreach|body: ${x_(t.content).reason}`);
				e.length && (l = l.filter((t) => !e.some((e) => e.path === t.path)));
			}
			t.shellLock && (l = l.map((t) => {
				let r = n.stubs.find((e) => e.path === t.path);
				if (!r) return t;
				let a = Of(r);
				if (!a) return t;
				let o = Pf(a, t.content);
				return o.missing.length ? (i.shellLockFallbacks++, L("build", n.id, Lf(t.path, o.missing))) : (i.shellLockApplied++, L("build", n.id, If(t.path, a.slots.length))), o.dropped.length && (i.mechanicalFixes += o.dropped.length, i.deterministicEditsOutsideSubstrate += o.dropped.length, L("build", n.id, Ff(t.path, o.dropped)), e.onLesson?.(yg("shell-lock|unbalanced-decl", `unbalanced top-level declaration(s): ${o.dropped.join(", ")}`, "shell-lock frame excluded the declaration before it could poison the program"))), {
					...t,
					content: o.content
				};
			}));
			let f = _(l, n);
			f.length && L("build", n.id, `boundary violations dropped: ${f.join("; ")}`);
			let p = l.filter((e) => n.files.includes(e.path)), m = Xe.files(), h = await dd(p, m, "build");
			h.gateUnavailable && Ee("build", n.id);
			for (let e of h.rejected) L("build", n.id, `build draw rejected: ${e.reason} in ${e.path}`);
			let g = 0;
			for (let t of h.ok) {
				let r = t, a = [...m.filter((e) => e.path !== r.path), r], o = await Ed(r, a);
				if (o.ok && o.gateUnavailable && we("build", n.id), !o.ok && /Invalid regular expression/i.test(o.message)) {
					let e = $g(r.content, o.message);
					if (e) {
						let t = {
							...r,
							content: e.content
						}, a = await Ed(t, [...m.filter((e) => e.path !== t.path), t]);
						a.ok && (L("build", n.id, `program-parse healed via delimiterOracle (${e.classKey}, 0 tok)`), i.regexLiteralGateHeals++, i.mechanicalFixes++, r = t, o = a, o.gateUnavailable && we("build", n.id));
					}
				}
				if (!o.ok) {
					i.parsePoisonIncidents++, L("build", n.id, o.event), e.onLesson?.(yg(Dd(r.path, o.message), o.message, "program-parse rejection — incumbent kept"));
					continue;
				}
				Xe.commitWrites({
					files: [r],
					phase: "build",
					target: n.id,
					kind: "build-write"
				}), $e([r.path]), m.push(r), g++;
			}
			if (g > 0) break;
			s < d.length - 1 && L("build", n.id, `build draw yielded 0 accepted files — retry ${s + 2}/${d.length} (hotter)`);
		}
		let f = n.files.map((e) => Xe.get(e)).filter((e) => e != null);
		if (f.length) {
			let e = Tm(f, n.stubs), t = /* @__PURE__ */ new Set();
			for (let r of e.fixes) {
				let e = `${r.path}\0${r.note}`;
				t.has(e) || (t.add(e), L("build", n.id, `export-conformance: ${r.note} (0 tok)`), i.mechanicalFixes++, i.deterministicEditsOutsideSubstrate++);
			}
			e.files.length && (Xe.commitWrites({
				files: e.files,
				phase: "build",
				target: n.id,
				kind: "export-conformance"
			}), $e(e.files.map((e) => e.path)));
		}
		{
			let e = n.files.filter((e) => Xe.has(e)).length;
			n.files.length > 0 && (i.nodesBuildable++, e === n.files.length && i.nodesBuilt++), z.recordNode({
				type: "code",
				featureId: n.id,
				causeId: z.testNodeFor(n.id),
				artifactPath: n.files[0] ?? null,
				status: e > 0 ? "pass" : "fail",
				summary: `build: ${e}/${n.files.length} owned files`
			});
		}
		{
			let e = n.files.filter((e) => Xe.has(e)).length, t = je.findIndex((e) => e.id === n.id) + 1;
			L("build", n.id, e === n.files.length ? `node ${t} of ${je.length} built — ${n.name} (${n.files.join(", ")})` : `node ${t} of ${je.length} INCOMPLETE — ${e} of ${n.files.length} files accepted for ${n.name}`);
		}
	}
	let nt = /* @__PURE__ */ new Set(), rt = 0;
	for (let e of je) Ne.has(e.id) && e.files.length !== 0 && (rt += 1, e.files.filter((e) => Xe.has(e)).length === 0 && (nt.add(e.id), L("build", e.id, `build-failed: 0/${e.files.length} owned files — RHA ladder skipped`), J.push(`${e.id}: build-failed (0/${e.files.length} owned files)`)));
	let it = rt > 0 && nt.size === rt;
	if (it) {
		let e = je.reduce((e, t) => e + (Ne.has(t.id) ? t.files.length : 0), 0);
		L("build", null, `build phase failed: 0/${e} files — RHA skipped`), J.push(`build phase failed: 0/${e} files — RHA skipped`);
	}
	let at = () => {
		let e = [];
		for (let t of je) for (let n of t.stubs) e.push(Xe.get(n.path) ?? n);
		return e;
	}, ot = (e) => e.deps.flatMap((e) => q.features.find((t) => t.id === e)?.files ?? []).map((e) => Xe.get(e)).filter((e) => e != null);
	if (e.runSuite && !it) {
		let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), s = (e, t) => e[0]?.crash ? `suite crashed: ${e[0].message.slice(0, 160)}` : `${t - e.length}/${t} passing`, c = (e, t, n) => (t.crashed ? [{
			name: "__suite__",
			message: t.crashed,
			crash: !0
		}] : t.failures.map((e) => ({
			name: e.name,
			message: e.message
		}))).map((t) => {
			let a = th(t.name, t.message);
			i.classifyAttempts++, a.stratum !== "catalog-drift" && i.classifyCataloged++;
			let o = "crash" in t && !!t.crash;
			if (o && !a.detail.file) {
				let i = ud(at());
				i.length === 1 && (a.detail.file = i[0].path, a.kind = "transpile", a.classKey = `transpile|${i[0].path}`);
				let o = Kd(at(), {
					path: e.testFile,
					content: n
				}, t.message);
				if (o.file) a.detail.file = o.file, i.some((e) => e.path === o.file) && (a.kind = "transpile", a.classKey = `transpile|${o.file}`);
				else if (o.miss) {
					let i = {
						path: e.testFile,
						content: n
					}, s = at(), c = ju(s, i), l = !Mu(t.message), u = l ? [] : Zd(s, i), d = !l && r.has(c) ? c : void 0;
					!l && !d && r.add(c), De("rha", e.id, Nu({
						miss: o.miss,
						crashMessage: t.message,
						seams: d ? [] : u,
						programHash: d ? void 0 : c,
						suppressSeams: l,
						seamRefHash: d
					}));
					let f = Xd(s, i, t.message, null);
					f && (L("rha", e.id, f.event), f.pair && (a.detail.file = f.pair[0]));
				}
			}
			return {
				...t,
				crash: o,
				cls: a
			};
		}), u = async (e, t, n) => {
			let r = !1;
			for (let a of e) {
				if (a.path === n) {
					let e = je.find((e) => e.id === t);
					if (e) {
						let n = await Ie(e, a.content, void 0, `mechanical-fix: ${a.classKey}`);
						if (n && n.status === "rejected") {
							L("rha", t, `mechanical patch rejected by gateway (${a.classKey}): ${n.report.rejectionReasons[0] ?? "no reason"}`);
							continue;
						}
					}
				} else Xe.commitWrites({
					files: [{
						path: a.path,
						content: a.content
					}],
					phase: "rha",
					target: t,
					kind: "substrate-mechanical-fix"
				}), $e([a.path]);
				i.mechanicalFixes++, i.substrateEditsApplied++, /^catalog-drift\|missing-new\|/.test(a.classKey) && i.catalogDriftMechanicalFixes++, r = !0, ee(a.classKey, "fixed");
				let e = a.note.replace(/\s+/g, " ").trim().slice(0, 120);
				T.push({
					classKey: a.classKey,
					editShape: e,
					afterSnippet: a.content.slice(0, 240),
					path: a.path
				});
			}
			r && i.substrateFixes++;
		}, d = async (t, n, r, i) => {
			let a = {
				path: n,
				content: r
			}, o = Xd(at(), a, i, $g);
			if (!o || (L("rha", t, o.event), !o.fixes || !o.fixes.length)) return !1;
			let s = `boundary-fault|${o.pair ? o.pair.join("⨝") : ""}`;
			return await u(o.fixes.map((e) => ({
				...e,
				classKey: s
			})), t, n), L("rha", t, `substrate: ${s} → fixed (0 tok)`), e.onLesson?.(yg(s, i, `boundary seam-heal ${o.pair?.join(" ⨝ ") ?? ""}`)), !0;
		}, m = (e) => {
			let t = 0;
			for (let [r, i] of [...n]) {
				if (i.sig !== e) continue;
				n.delete(r);
				let a = J.findIndex((e) => e === `${r}: crash|unattributed`);
				a >= 0 && J.splice(a, 1), L("auth", r, `unparked — delimiter oracle cleared ${e}`), t++;
			}
			return t;
		}, h = async (e, t, n, r) => {
			let i = 0;
			for (let n of e) {
				if (n === t) continue;
				let e = je.find((e) => e.id === n), a = e ? Ne.get(n) : void 0;
				if (!e || a == null) continue;
				let o = $g(a, r);
				o && (await u([{
					path: e.testFile,
					content: o.content,
					note: `propagated frozen-suite spot-heal (${o.classKey}) to ${e.testFile}`,
					classKey: `regex-literal|${r.slice(0, 40)}`
				}], n, e.testFile), L("rha", n, `frozen-suite spot-heal: ${e.testFile} (delimiter:${o.classKey}, ${o.edits} edit${o.edits === 1 ? "" : "s"}, 0 tok)`), L("ir", n, "suite re-frozen after quarantine spot-heal — parses clean"), i++);
			}
			return i;
		}, g = async (t, n) => {
			let a = n[0], o = je.find((e) => e.id === a), s = o ? Ne.get(o.id) : void 0;
			if (!o || s == null) return !1;
			let c = await e.runSuite(at(), {
				path: o.testFile,
				content: s
			});
			if (!c.crashed) return !1;
			let l = th("__suite__", c.crashed);
			if (!l.detail.file) {
				let e = Kd(at(), {
					path: o.testFile,
					content: s
				}, c.crashed);
				if (e.file) l.detail.file = e.file;
				else if (e.miss) {
					let n = {
						path: o.testFile,
						content: s
					}, i = at(), a = ju(i, n), l = !Mu(c.crashed), u = l ? [] : Zd(i, n), f = !l && r.has(a) ? a : void 0;
					if (!l && !f && r.add(a), De("rha", null, Nu({
						miss: e.miss,
						crashMessage: c.crashed,
						seams: f ? [] : u,
						programHash: f ? void 0 : a,
						suppressSeams: l,
						seamRefHash: f
					})), await d(o.id, o.testFile, s, c.crashed)) return m(t), !0;
				}
			}
			let f = {
				path: o.testFile,
				content: s
			};
			i.substrateAttempts++;
			let p = Eh(l, at(), f, q);
			A(l.classKey, p, o.id);
			let g;
			if (p.status === "fixed" && p.fix) g = p.fixes?.length ? p.fixes : [p.fix];
			else {
				p.status === "refused" ? i.substrateRefusals++ : (p.status === "cataloged" || p.status === "catalog-drift" || p.status === "no-handler") && (i.substrateNoHandler++, L("rha", null, `substrate: ${l.classKey} → ${gh(p)} (0 tok)`), p.status === "catalog-drift" && De("rha", null, [Im(l.message)]));
				let e = [{
					path: o.testFile,
					content: s
				}];
				if (l.detail.file && l.detail.file !== o.testFile) {
					let t = at().find((e) => e.path === l.detail.file);
					t && e.push({
						path: t.path,
						content: t.content
					});
				}
				let t = [];
				for (let n of e) {
					let e = $g(n.content, c.crashed);
					e && e.content !== n.content && t.push({
						path: n.path,
						content: e.content,
						note: `delimiter oracle last-sweep (${e.classKey}, ${e.edits} edit${e.edits === 1 ? "" : "s"}) on ${n.path}`,
						classKey: l.classKey
					});
				}
				if (!t.length) {
					if (L("rha", null, `crash quarantine diagnosis: ${l.classKey} → ${p.status}(${p.reason ?? ""})`), p.status === "refused" && /impl repair exhausted/i.test(p.reason ?? "") && (/^transpile\|/.test(l.classKey) || l.kind === "transpile")) {
						let e = l.detail.file ?? /^transpile\|(.+)$/.exec(l.classKey)?.[1] ?? null;
						e && tt(e, o.id);
					}
					return !1;
				}
				g = t;
			}
			if (l.kind === "duplicate-decl" || l.kind === "regex-literal" || l.kind === "transpile" || l.kind === "crash") {
				let e = at().map((e) => {
					let t = g.find((t) => t.path === e.path);
					return t ? {
						path: e.path,
						content: t.content
					} : e;
				});
				for (let t of g) e.some((e) => e.path === t.path) || (e = [...e, {
					path: t.path,
					content: t.content
				}]);
				let t = !1;
				if (l.kind === "duplicate-decl") {
					let n = Wd(e);
					n && /has already been declared/i.test(n) && (t = !0);
					for (let n of g) if (n.path !== o.testFile && Id(Pd(e, n.path))) {
						t = !0;
						break;
					}
				} else for (let n of g) if (n.path !== o.testFile && Id(Pd(e, n.path))) {
					t = !0;
					break;
				}
				if (t) return i.substrateRefusals++, L("rha", null, `crash quarantine diagnosis: ${l.classKey} → refused(probe-failed)`), !1;
			}
			await u(g, o.id, o.testFile);
			let _ = g.find((e) => e.path === o.testFile), v = _ != null;
			v && (L("rha", o.id, `frozen-suite spot-heal: ${o.testFile} (delimiter:${l.classKey.split("|")[0]}, 0 tok)`), L("ir", o.id, "suite re-frozen after quarantine spot-heal — parses clean"));
			for (let t of g) e.onLesson?.(yg(t.classKey, l.message, t.note));
			return L("rha", null, `crash quarantine diagnosis: ${l.classKey} → fixed (0 tok)`), v && await h(n, o.id, _, c.crashed), m(t), !0;
		}, v = async () => {
			let t = /* @__PURE__ */ new Map();
			for (let n of je) {
				let r = Ne.get(n.id);
				if (r == null) continue;
				le();
				let i = await e.runSuite(at(), {
					path: n.testFile,
					content: r
				});
				if (!i.crashed) continue;
				let a = Wm(i.crashed);
				t.set(a, [...t.get(a) ?? [], n.id]);
			}
			for (let [e, n] of t) n.length < 2 || (L("rha", null, `crash quarantine: ${e} across ${n.length} features — ladders frozen`), await g(e, n));
		};
		await e.onPhaseGate?.("build"), le(), await v();
		let b = async () => {
			for (let [t] of [...n]) {
				let r = je.find((e) => e.id === t), i = r ? Ne.get(t) : void 0;
				if (!r || i == null) continue;
				let a = await e.runSuite(at(), {
					path: r.testFile,
					content: i
				});
				!a.crashed && a.failures.length === 0 && (n.delete(t), L("auth", t, "unparked — shared artifact change cleared crash"));
			}
		};
		for (let r of je) {
			let h = Ne.get(r.id);
			if (h == null || n.has(r.id) || nt.has(r.id)) continue;
			i.nodesTotal++;
			let g = Pe.get(r.id) ?? null, y = /* @__PURE__ */ new Set(), x = { cur: null }, S = /* @__PURE__ */ new Map(), w = !1, E = 0, ee = !1, ne = 0, D = /* @__PURE__ */ new Map(), ie = "", ae = ov(), oe = 0, N = "", ce = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new Set(), de = [];
			{
				le();
				let t = await e.runSuite(at(), {
					path: r.testFile,
					content: h
				});
				if (ne = t.total, !t.crashed && t.failures.length === 0) {
					i.passesPerFeature[r.id] = 0, i.nodesBuiltCleanFirstPass++, L("auth", r.id, "converged in 0 passes");
					continue;
				}
				if (t.crashed) {
					let a = c(r, t, h)[0]?.cls;
					if (a && Hm(a.kind)) {
						let o = {
							path: r.testFile,
							content: h
						};
						if (!Gm(a, at(), o)) {
							i.substrateAttempts++;
							let s = Eh(a, at(), o, q);
							if (A(a.classKey, s, r.id), s.status === "fixed" && s.fix) {
								let t = s.fixes?.length ? s.fixes : [s.fix], n = !0;
								if (a.kind === "duplicate-decl") {
									let e = at().map((e) => {
										let n = t.find((t) => t.path === e.path);
										return n ? {
											path: e.path,
											content: n.content
										} : e;
									}), r = Wd(e);
									r && /has already been declared/i.test(r) && (n = !1);
									for (let r of t) if (Id(Pd(e, r.path))) {
										n = !1;
										break;
									}
								}
								if (n) {
									await u(t, r.id, r.testFile), h = Ne.get(r.id) ?? h;
									for (let n of t) {
										ie = `substrate: ${n.note}`;
										let t = /delimiter oracle/.test(n.note) ? " [delimiter oracle heal]" : "";
										L("rha", r.id, `substrate: ${a.classKey} → fixed (0 tok)${t}`), e.onLesson?.(yg(n.classKey, a.message, n.note));
									}
									let n = await e.runSuite(at(), {
										path: r.testFile,
										content: h
									});
									if (!n.crashed && n.failures.length === 0) {
										i.passesPerFeature[r.id] = 0, L("auth", r.id, "converged in 0 passes"), await b();
										continue;
									}
								} else i.substrateRefusals++;
							} else if (s.status === "refused") {
								if (i.substrateRefusals++, L("rha", r.id, `substrate: ${a.classKey} → refused(${s.reason ?? "unproven"}) (0 tok)`), /impl repair exhausted/i.test(s.reason ?? "") && (/^transpile\|/.test(a.classKey) || a.kind === "transpile")) {
									let e = a.detail.file ?? /^transpile\|(.+)$/.exec(a.classKey)?.[1] ?? null;
									e && tt(e, r.id);
								}
							} else (s.status === "cataloged" || s.status === "catalog-drift" || s.status === "no-handler") && (i.substrateNoHandler++, L("rha", r.id, `substrate: ${a.classKey} → ${gh(s)} (0 tok)`), s.status === "catalog-drift" && De("rha", r.id, [Im(a.message)]));
							let l = await e.runSuite(at(), {
								path: r.testFile,
								content: h
							});
							if (!Gm(c(r, l, h)[0]?.cls ?? a, at(), o)) if (await d(r.id, r.testFile, h, l.crashed ?? t.crashed)) {
								h = Ne.get(r.id) ?? h;
								let t = await e.runSuite(at(), {
									path: r.testFile,
									content: h
								});
								if (!t.crashed && t.failures.length === 0) {
									i.passesPerFeature[r.id] = 0, L("auth", r.id, "converged in 0 passes"), await b();
									continue;
								}
							} else {
								n.set(r.id, { sig: Wm(t.crashed) }), J.push(`${r.id}: crash|unattributed`), i.passesPerFeature[r.id] = 0, L("rha", r.id, "blocked-crash: parked (crash|unattributed)");
								continue;
							}
						}
					}
				}
			}
			let pe = async () => {
				le();
				let t = a.startAction({
					kind: "authoritative-measurement",
					target: r.id,
					phase: "rha",
					startEvidence: { testFile: r.testFile }
				}), n;
				try {
					n = await e.runSuite(at(), {
						path: r.testFile,
						content: h
					});
				} catch (e) {
					throw a.finishAction({
						actionId: t,
						disposition: "failed",
						failureMode: "fatal",
						error: e
					}), e;
				}
				ne = n.total;
				let i = c(r, n, h), l = new Set(i.map((e) => e.cls.classKey));
				for (let [t, n] of D) !l.has(t) && ie && e.onLesson?.(yg(t, n, ie));
				D = new Map(i.map((e) => [e.cls.classKey, e.message]));
				let u = new Set(i.map((e) => e.name));
				for (let e of u) S.set(e, (S.get(e) ?? 0) + 1);
				for (let e of [...S.keys()]) u.has(e) || S.delete(e);
				for (let e of i) y.add(`${e.name === "__suite__" ? "" : e.name + ": "}${e.message.split("\n")[0].slice(0, 160)}`);
				for (let e of i) if (e.crash) {
					let t = Wm(e.message), n = F.get(t);
					n || (n = /* @__PURE__ */ new Set(), F.set(t, n)), n.add(r.id);
				}
				let d = `M-${r.id}-${z.allRows().length}`, f = z.recordNode({
					type: "result",
					featureId: r.id,
					causeId: z.codeNodeFor(r.id) ?? z.testNodeFor(r.id),
					artifactPath: r.testFile,
					status: i.length === 0 ? "pass" : "fail",
					summary: s(i, n.total)
				}), p = [];
				for (let e of i) {
					let n = z.recordNode({
						type: "error",
						featureId: r.id,
						causeId: f,
						artifactPath: e.cls?.detail.file ?? r.files[0] ?? null,
						bugClass: e.cls?.classKey ?? null,
						status: "open",
						summary: `${e.name}: ${e.message.split("\n")[0] ?? ""}`
					});
					V.set(r.id, n);
					let i = jm({
						classKey: e.cls?.classKey,
						crash: !!e.crash,
						message: e.message,
						kindHint: e.cls?.kind === "assertion" || e.cls?.kind === "throw-mismatch" ? "test-failure" : void 0
					}), a = e.name && e.name !== "__suite__" ? e.name : Em, s = e.cls?.classKey ?? `${i}|${a}`, c = e.cls?.detail.expected ?? null, l = e.cls?.detail.received ?? null, u = e.crash ? Wm(e.message) : null, m = o.observeAuthoritativeFinding({
						featureId: r.id,
						caseId: a,
						classKey: s,
						category: i,
						artifactPath: e.cls?.detail.file ?? r.files[0] ?? null,
						expected: c,
						received: l,
						crashSignature: u,
						message: e.message,
						measurementId: d,
						resultNodeId: f,
						errorNodeId: n,
						actionId: t
					});
					p.push(m.canonicalKey);
				}
				let m = o.reconcileMeasurementScope({
					scopeKey: r.id,
					presentKeys: p,
					confirmingMeasurementId: d,
					confirmingResultNodeId: f,
					actionId: t
				});
				for (let e of m) z.recordNode({
					type: "resolution",
					featureId: r.id,
					causeId: e.causeErrorNodeId,
					artifactPath: r.testFile,
					status: "pass",
					summary: `resolved defect ${e.defectId} (${e.resolutionId})`
				});
				return a.finishAction({
					actionId: t,
					disposition: i.length === 0 ? "applied" : "noop",
					endEvidence: {
						total: n.total,
						failures: n.failures.length,
						crashed: n.crashed ?? null,
						resolutions: m.length
					}
				}), L("auth", r.id, s(i, n.total)), i;
			}, me = async (t, n) => {
				let a = _(t, r);
				a.length && L("rha", r.id, `boundary violations dropped: ${a.join("; ")}`);
				let o = t.filter((e) => r.files.includes(e.path)), s = async (t, n) => {
					let a = t, o = [...n.filter((e) => e.path !== a.path), a], s = await Ed(a, o);
					if (s.ok && s.gateUnavailable && we("rha", r.id), !s.ok && /Invalid regular expression/i.test(s.message)) {
						let e = $g(a.content, s.message);
						if (e) {
							let t = {
								...a,
								content: e.content
							}, o = await Ed(t, [...n.filter((e) => e.path !== t.path), t]);
							o.ok && (L("rha", r.id, `program-parse healed via delimiterOracle (${e.classKey}, 0 tok)`), i.regexLiteralGateHeals++, i.mechanicalFixes++, a = t, s = o, s.gateUnavailable && we("rha", r.id));
						}
					}
					return s.ok ? (Xe.commitWrites({
						files: [a],
						phase: "rha",
						target: r.id,
						kind: "rha-write"
					}), $e([a.path]), a) : (i.parsePoisonIncidents++, L("rha", r.id, s.event), e.onLesson?.(yg(Dd(a.path, s.message), s.message, "program-parse rejection — incumbent kept")), null);
				};
				if (n?.vet) {
					let e = at().filter((e) => !o.some((t) => t.path === e.path)), t = Tm(o, r.stubs), a = /* @__PURE__ */ new Set();
					for (let e of t.fixes) {
						let t = `${e.path}\0${e.note}`;
						a.has(t) || (a.add(t), L("rha", r.id, `export-conformance: ${e.note} (0 tok)`), i.mechanicalFixes++, i.deterministicEditsOutsideSubstrate++);
					}
					let c = t.files, { ok: l, rejected: u, gateUnavailable: d } = await dd(c, e);
					d && Ee("rha", r.id);
					for (let e of u) L("rha", r.id, `${n.label ?? "draw"} rejected: ${e.reason} in ${e.path}`);
					let f = u.length === 0, p = [];
					for (let t of l) {
						let n = await s(t, [...e, ...p]);
						if (!n) {
							f = !1;
							continue;
						}
						p.push(n);
					}
					return f;
				}
				let c = !0;
				for (let e of o) await s(e, at()) || (c = !1);
				return c;
			}, he = (e) => e.map((e) => {
				let t = e.cls?.detail.file || r.files[0] || "", n = e.crash || e.cls?.kind === "regex-literal" || e.cls?.kind === "duplicate-decl" || e.cls?.kind === "transpile" || e.cls?.kind === "crash" && !!e.cls.detail.file, i = e.cls ? Um(e.cls) : null, a = i && !e.message.includes(i) ? `${e.message}\n${i}` : e.message;
				return n ? {
					bugClass: "syntax",
					file: t,
					line: null,
					message: a,
					featureId: r.id
				} : {
					bugClass: "test-failure",
					file: r.files[0] ?? "",
					line: null,
					message: a,
					featureId: r.id,
					testName: e.name
				};
			}), ge = async (e) => {
				let t = [...D.entries()].filter(([t]) => t === e || t.startsWith("boundary-fault|") || t === "crash|suite").map(([, e]) => e)[0] ?? [...D.values()][0];
				if (t && await d(r.id, r.testFile, h, t)) return h = Ne.get(r.id) ?? h, !0;
				if (t) {
					let i = {
						path: r.testFile,
						content: h
					}, a = ef(at(), i, t);
					if (a && (L("rha", r.id, a.event), De("rha", r.id, [a.event]), a.set.length)) {
						let o = tf([...at(), i], a.set, $g, t);
						if (o.length) return await u(o.map((e) => ({
							...e,
							classKey: `ddmin|${a.set.join("⨝")}`
						})), r.id, r.testFile), h = Ne.get(r.id) ?? h, L("rha", r.id, `ddmin heal applied on [${a.set.join(", ")}] (0 tok)`), m(e), !0;
						ee = !0, n.set(r.id, { sig: e });
						let s = `crash|unattributed — ${a.event}`;
						return J.some((e) => e.startsWith(`${r.id}: crash|unattributed`)) || J.push(`${r.id}: ${s}`), L("rha", r.id, `blocked-crash: parked (${a.event})`), !1;
					}
				}
				return ee = !0, n.set(r.id, { sig: e }), J.some((e) => e.startsWith(`${r.id}: crash|unattributed`)) || J.push(`${r.id}: crash|unattributed`), L("rha", r.id, "blocked-crash: parked (crash|unattributed)"), !1;
			}, H = await te({
				measure: pe,
				signature: (e) => e.map((e) => `${e.name}|${e.message.split("\n")[0]}`).sort().join("~"),
				maxPasses: t.maxPasses,
				stallLimit: t.stallLimit,
				progressStall: t.progressStall,
				abort: () => ee,
				repair: async (n, o) => {
					if (le(), ee) return;
					let s = n.map((e) => e.cls).filter(Boolean), u = {
						path: r.testFile,
						content: h
					}, d = !1, f = !1, m = !1;
					for (let t of s) {
						i.substrateAttempts++;
						let n = Eh(t, at(), u, q);
						if (A(t.classKey, n, r.id), n.status === "cataloged" || n.status === "catalog-drift" || n.status === "no-handler") {
							i.substrateNoHandler++, L("rha", r.id, `substrate: ${t.classKey} → ${gh(n)} (0 tok)`), n.status === "catalog-drift" && De("rha", r.id, [Im(t.message)]);
							continue;
						}
						if (n.status === "refused" || !n.fix) {
							if (i.substrateRefusals++, L("rha", r.id, `substrate: ${t.classKey} → refused(${n.reason ?? "unproven"}) (0 tok)`), /impl repair exhausted/i.test(n.reason ?? "") && (/^transpile\|/.test(t.classKey) || t.kind === "transpile")) {
								let e = t.detail.file ?? /^transpile\|(.+)$/.exec(t.classKey)?.[1] ?? null;
								e && tt(e, r.id);
							}
							if (Hm(t.kind)) {
								if (!t.detail.file) {
									let e = qd(at(), u, t.message);
									e && (t.detail.file = e);
								}
								if (!Gm(t, at(), u)) {
									if (await ge(t.classKey)) {
										d = !0;
										continue;
									}
									f = !0;
									break;
								}
								m = !0, f = !0;
							}
							continue;
						}
						let a = n.fixes?.length ? n.fixes : [n.fix];
						if (t.kind === "regex-literal" || t.kind === "transpile" || t.kind === "crash" || t.kind === "duplicate-decl") {
							let e = at().map((e) => {
								let t = a.find((t) => t.path === e.path);
								return t ? {
									path: e.path,
									content: t.content
								} : e;
							});
							for (let t of a) e.some((e) => e.path === t.path) || (e = [...e, {
								path: t.path,
								content: t.content
							}]);
							let n = !1;
							if (t.kind === "duplicate-decl") {
								let t = Wd(e);
								t && /has already been declared/i.test(t) && (n = !0);
								for (let t of a) if (Id(Pd(e, t.path))) {
									n = !0;
									break;
								}
							} else for (let t of a) if (Id(Pd(e, t.path))) {
								n = !0;
								break;
							}
							if (n) {
								if (i.substrateRefusals++, L("rha", r.id, `substrate: ${t.classKey} → refused(probe-failed) (0 tok)`), Hm(t.kind) && !Gm(t, at(), u)) {
									if (await ge(t.classKey)) {
										d = !0;
										continue;
									}
									f = !0;
									break;
								}
								Hm(t.kind) && (m = Gm(t, at(), u), f = !0);
								continue;
							}
						}
						let o = !1;
						for (let n of a) {
							if (n.path === r.testFile) {
								let e = await Ie(r, n.content, void 0, `substrate-L1: ${t.classKey}`);
								if (e && e.status === "rejected") {
									L("rha", r.id, `substrate L1 patch rejected by gateway (${t.classKey}): ${e.report.rejectionReasons[0] ?? "no reason"}`);
									continue;
								}
								h = n.content;
							} else Xe.commitWrites({
								files: [{
									path: n.path,
									content: n.content
								}],
								phase: "rha",
								target: r.id,
								kind: "substrate-L1"
							}), $e([n.path]);
							i.mechanicalFixes++, i.substrateEditsApplied++, /^catalog-drift\|missing-new\|/.test(n.classKey) && i.catalogDriftMechanicalFixes++, o = !0, ie = `substrate: ${n.note}`;
							let a = /delimiter oracle/.test(n.note) ? " [delimiter oracle heal]" : "";
							L("rha", r.id, `substrate: ${t.classKey} → fixed (0 tok)${a}`), z.recordNode({
								type: "repair",
								featureId: r.id,
								causeId: V.get(r.id) ?? null,
								artifactPath: n.path,
								bugClass: t.classKey,
								status: "info",
								summary: `L1 substrate applied (0 tok): ${n.note}`
							}), e.onLesson?.(yg(n.classKey, t.message, n.note));
						}
						o && i.substrateFixes++, d = !0;
					}
					if (d || f && !m || ee) return;
					let _ = n[0]?.cls, b = (!!_?.detail.file && (_.detail.file === r.testFile || _.detail.file.replace(/\.(ts|js)$/, "") === r.testFile.replace(/\.(ts|js)$/, "")) || !!_?.detail.caseName) && (_.kind === "transpile" || _.kind === "regex-literal" || _.kind === "crash" || !!n[0]?.crash);
					if (g && E < 2 && b) {
						E++;
						let a = jd(g.cases).map((e) => {
							let t = g.cases.find((t) => t.name === e.name);
							return {
								name: t.name,
								kind: t.kind,
								errors: [e.error]
							};
						});
						if (!a.length && _?.detail.caseName) {
							let e = g.cases.find((e) => e.name === _.detail.caseName || pg(e.name, _.detail.caseName) || _.detail.caseName.endsWith(e.name));
							e && (a = [{
								name: e.name,
								kind: e.kind,
								errors: [n[0]?.message ?? "execution-position crash"]
							}]);
						}
						if (a.length || (a = g.cases.filter((e) => Od(e.body)).map((e) => ({
							name: e.name,
							kind: e.kind,
							errors: [Od(e.body)]
						}))), a.length) {
							L("rha", r.id, `substrate: pinpointed ${a.length} unparseable case(s) — IR-side regeneration (impl untouched)`);
							try {
								let n = g.cases.map((e) => {
									if (!a.some((t) => t.name === e.name)) return e;
									let t = Xl(e);
									return t && Ah(t) ? (i.mechanicalFixes++, {
										...e,
										body: t,
										clade: e.clade ?? Yl(e)
									}) : e;
								}), o = a.filter((e) => jd(n.filter((t) => t.name === e.name)).length > 0);
								if (o.length) {
									let a = Dv(o), s = o.length === 1 ? kv(t, r, o[0].name, o[0].kind) : null, c = s ? a.map((e) => ({
										...e,
										errors: [...e.errors, Av(s)].filter(Boolean)
									})) : a, l = [];
									for (let t = 0; t < iv.length; t++) {
										let a = iv[t];
										le(), i.permutationDraws++;
										let u = hg(o, (await fe({
											method: "fixTestCases:syntax-repair-permutation",
											target: r.id,
											phase: "ir",
											startEvidence: {
												temperature: a,
												candidateIndex: t + 1,
												broken: o.length
											},
											fn: () => e.llm.fixTestCases(q, r, c, [], g.imports, {
												temperature: a,
												candidate: {
													n: t + 1,
													k: iv.length
												}
											})
										})).cases);
										if (i.mechanicalFixes += u.unwrapFixes, s) {
											let e = jv(s, u.cases[0]?.body ?? "", i, o[0].name, (e) => L("rha", r.id, e));
											if (e.rejected) {
												l.push({
													value: n,
													temp: a,
													score: 0,
													findings: 1,
													label: "overreach|body rejected"
												});
												continue;
											}
											u.cases[0] && (u.cases[0] = {
												...u.cases[0],
												body: e.body
											});
										}
										let d = n.map((e) => {
											let t = o.findIndex((t) => pg(t.name, e.name));
											return t >= 0 && u.cases[t] ? {
												...e,
												...u.cases[t],
												name: o[t].name,
												kind: o[t].kind
											} : e;
										}), f = O(r, g.imports, d), p = !!Ad(f) || !!C(f).length, m = jd(d.filter((e) => o.some((t) => pg(t.name, e.name)))).length;
										l.push({
											value: d,
											temp: a,
											score: p ? 0 : Math.max(0, o.length - m),
											findings: p ? o.length + 1 : m,
											label: p ? "unparseable" : `${o.length - m}/${o.length} healed`
										});
									}
									if (l.length) {
										let e = lv(l);
										i.permutationWins++, L("rha", r.id, uv(e)), n = e.picked.value;
									}
								}
								g = {
									imports: g.imports,
									cases: n
								};
								let s = O(r, g.imports, g.cases);
								if (!C(s).length && !Ad(s)) {
									let e = await Ie(r, s, g, "ir-surgery: case-regen (parse)");
									if (e && e.status === "rejected") L("rha", r.id, `IR-side case regeneration rejected by gateway: ${e.report.rejectionReasons[0] ?? "no reason"} — discarded`);
									else {
										h = s, i.irSurgeries++, ie = "IR-side case regeneration (suite did not parse)", L("rha", r.id, "suite re-frozen — parses clean");
										return;
									}
								} else L("rha", r.id, "case regeneration still does not parse — discarded");
							} catch (e) {
								L("rha", r.id, `IR-side regeneration failed: ${e instanceof Error ? e.message : String(e)}`);
							}
						}
					}
					let x = [...S.entries()].filter(([, e]) => e >= 3).map(([e]) => e);
					if (!w && g && o >= 3 && x.length && !n[0]?.crash) {
						w = !0;
						let a = g.cases.filter((e) => x.some((t) => t.includes(e.name))).map((e) => ({
							name: e.name,
							kind: e.kind,
							errors: n.filter((t) => t.name.includes(e.name)).map((e) => e.message.slice(0, 300))
						})).filter((e) => e.errors.length);
						if (a.length) {
							L("rha", r.id, `IR-case surgery: ${a.length} cases fail every pass — bounded conform-to-stub redraw`);
							try {
								let n = new Map(g.cases.map((e) => [e.name, e.body])), o = g.cases.map((e) => {
									if (!a.some((t) => t.name === e.name)) return e;
									let t = Xl(e);
									return t && Ah(t) ? (i.mechanicalFixes++, L("rha", r.id, `case "${e.name}" rebound via clade (0 tok)`), {
										...e,
										body: t,
										clade: e.clade ?? Yl(e)
									}) : e;
								}), s = a.filter((e) => o.find((t) => t.name === e.name)?.body === g.cases.find((t) => t.name === e.name)?.body);
								if (s.length) {
									let n = Dv(s), a = s.length === 1 ? kv(t, r, s[0].name, s[0].kind) : null, c = a ? n.map((e) => ({
										...e,
										errors: [...e.errors, Av(a)].filter(Boolean)
									})) : n, l = [];
									for (let t = 0; t < iv.length; t++) {
										let n = iv[t];
										le(), i.permutationDraws++;
										let u = hg(s, (await fe({
											method: "fixTestCases:body-repair-permutation",
											target: r.id,
											phase: "ir",
											startEvidence: {
												temperature: n,
												candidateIndex: t + 1,
												broken: s.length
											},
											fn: () => e.llm.fixTestCases(q, r, c, [], g.imports, {
												temperature: n,
												candidate: {
													n: t + 1,
													k: iv.length
												}
											})
										})).cases);
										if (i.mechanicalFixes += u.unwrapFixes, a) {
											let e = jv(a, u.cases[0]?.body ?? "", i, s[0].name, (e) => L("rha", r.id, e));
											if (e.rejected) {
												l.push({
													value: o,
													temp: n,
													score: 0,
													findings: 1,
													label: "overreach|body rejected"
												});
												continue;
											}
											u.cases[0] && (u.cases[0] = {
												...u.cases[0],
												body: e.body
											});
										}
										let d = o.map((e) => {
											let t = s.findIndex((t) => pg(t.name, e.name));
											return t >= 0 && u.cases[t] ? {
												...e,
												...u.cases[t],
												name: s[t].name,
												kind: s[t].kind,
												clade: e.clade
											} : e;
										}), f = O(r, g.imports, d), p = !!C(f).length || !!Ad(f);
										l.push({
											value: d,
											temp: n,
											score: p ? 0 : s.length,
											findings: +!!p,
											label: p ? "invalid suite" : `${s.length} redrawn`
										});
									}
									if (l.length) {
										let e = lv(l);
										i.permutationWins++, L("rha", r.id, uv(e)), o = e.picked.value;
									}
								}
								g = {
									imports: g.imports,
									cases: o
								};
								let c = Np(O(r, g.imports, g.cases), r.testFile, q).content;
								if (C(c).length) L("rha", r.id, "case surgery produced an invalid suite — discarded");
								else {
									let e = await Ie(r, c, g, "ir-surgery: broken-cases");
									if (e && e.status === "rejected") L("rha", r.id, `IR-side surgery rejected by gateway: ${e.report.rejectionReasons[0] ?? "no reason"} — discarded`);
									else {
										h = c, i.irSurgeries++, i.irSurgeriesInRha++;
										for (let e of a) {
											let t = n.get(e.name) ?? "", i = g.cases.find((t) => t.name === e.name)?.body ?? "";
											if (!i || i === t) continue;
											let a = th(e.name, e.errors[0] ?? "");
											T.push({
												classKey: a.classKey,
												editShape: `surgery ${Rg(t, i)}`,
												beforeSnippet: t.slice(0, 240),
												afterSnippet: i.slice(0, 240),
												path: r.testFile
											});
										}
										L("rha", r.id, "suite re-frozen after case surgery");
										return;
									}
								}
							} catch (e) {
								L("rha", r.id, `IR-case surgery failed: ${e instanceof Error ? e.message : String(e)}`);
							}
						}
					}
					let te = s.find((e) => Hm(e.kind));
					if (te && !Gm(te, at(), u)) return await ge(te.classKey), void 0;
					let D = xg(s), j = D.length ? n.filter((e) => e.cls && e.cls.classKey === D[0].classKey) : n, F = vg(_g(e.lessons ?? [], D.map((e) => e.classKey))), I = D[0]?.classKey ?? "", pe = I ? Vm(I) : [], H = [ul(I), pe.length ? `solution-strata order: ${pe.join(" → ")}` : ""].filter(Boolean).join("\n"), W = j.map((e) => e.cls ? Um(e.cls) : null).filter((e) => !!e), G = "", _e = null, ye = null, Se = D[0] ? Hm(D[0].kind) : !1;
					if (I && qm(I)) {
						L("rha", r.id, `repair skipped: ${I} is mechanical-only (0 model draws)`);
						return;
					}
					if (I && Xm(I, q)) {
						L("rha", r.id, `repair skipped: ${I} is suite-scaffold-owned (0 impl draws)`);
						return;
					}
					if (I && Jm(I)) {
						let e = D[0]?.detail.symbol ?? r.exports[0]?.symbol ?? "unknown", t = r.exports.find((t) => t.symbol === e)?.file ?? r.files[0] ?? null, n = (t ? r.stubs.find((e) => e.path === t) : null) ?? r.stubs[0], a = t ? Xe.get(t) : n ? Xe.get(n.path) : void 0;
						if (n && a && Ym(a.content, n.content, e)) {
							i.stubRouteShortcuts++, L("rha", r.id, `stub-route: ${e} unimplemented — L2 skipped (absence, not defect)`), ce.set(I, Nv.length);
							return;
						}
					}
					{
						let e = D[0]?.detail.file ?? /^transpile\|(.+)$/.exec(I)?.[1] ?? null;
						if (e && et(e)) {
							ce.set(I, Nv.length);
							return;
						}
					}
					I && I === N && oe >= 2 && !ae.escalated && (ae = sv(ae), L("rha", r.id, cv(o, "spread widened")));
					let we = pf({
						cls: D[0] ?? _ ?? null,
						files: at(),
						symbol: r.exports[0]?.symbol ?? null,
						fallbackFile: r.files[0] ?? null
					}), Te = null;
					if (D[0] && hf(D[0].kind) && g) {
						let e = g.cases.find((e) => j.some((t) => t.name === e.name || t.name.endsWith(`> ${e.name}`) || t.name.endsWith(`: ${e.name}`))), t = r.exports[0]?.file ?? r.files[0];
						if (e && t) {
							let n = _f(e.body, r.exports.map((e) => e.symbol));
							Te = yf(await Vd(at(), t, n));
						}
					}
					let Ee = await U("rha", r.id, at());
					await ve(at(), j.map((e) => `${e.name}: ${e.message.split("\n")[0] ?? ""}`).join("\n"));
					{
						let t = Dl({
							spec: q,
							feature: r,
							parts: g,
							stubs: r.stubs,
							lessons: e.lessons ?? [],
							siblingParts: Pe,
							siblingImpls: at().filter((e) => !r.files.includes(e.path)),
							target: I || j[0]?.name || "freeform",
							stage: "repair",
							conceptText: re.get(r.id) ?? null,
							substrateHandoff: k(r.id),
							findingEvidence: [...W, ...j.map((e) => e.message.split("\n")[0] ?? "")].filter(Boolean).join("\n"),
							exhibitText: we?.text ?? null,
							traceText: Te,
							ledgerText: (() => {
								let e = V.get(r.id) ?? z.lastNodeFor(r.id);
								if (!e) return null;
								let t = z.lineage(e, 6);
								if (!t.length) return null;
								let n = z.downstream(B.get(r.id) ?? "");
								return [
									"Page ledger — supergit causal trail for this node (append-only decision history):",
									...t,
									n.length ? `blast radius: ${n.length} downstream node(s)` : ""
								].filter(Boolean).join("\n");
							})(),
							unionText: Ee,
							signature: r.exports[0] ? {
								name: r.exports[0].symbol,
								params: [],
								returnType: "unknown"
							} : null
						});
						G = R("rha", r.id, t, "repair"), Se || (_e = t.templates.length > 0, ye = !!t.pages.substrate);
					}
					l.has(r.id) || (l.add(r.id), i.boundedLoopNodes++), i.boundedLoopIterations++;
					let Oe = ce.get(I) ?? 0;
					if (I && Oe < Nv.length) {
						ce.set(I, Oe + 1);
						let t = Nv[Oe], s = Math.max(0, ne - n.length), l = j.map((e) => `${e.name}|${e.message.split("\n")[0] ?? ""}`).sort().join("~"), u = r.files.map((e) => Xe.get(e)).find((e) => e != null), d = Oe === 0 && !!u, f = null;
						if (d && u) {
							let e = Wf(r, g, ot(r)), t = [.../* @__PURE__ */ new Set([...j.map((e) => e.cls?.detail.symbol).filter((e) => !!e), ...r.exports.map((e) => e.symbol)])];
							f = qf({
								schema: e,
								source: u.content,
								focusSymbols: t,
								substrate: [
									`classified as ${I} (${D[0]?.kind ?? "unknown"}, stratum ${D[0]?.stratum ?? "uncataloged"})`,
									H,
									F
								].filter(Boolean).join("\n"),
								ledger: (() => {
									let e = V.get(r.id) ?? z.lastNodeFor(r.id);
									return e ? z.lineage(e, 6).join("\n") : "";
								})(),
								supercache: G,
								findings: [
									...W,
									...j.map((e) => e.message.split("\n")[0] ?? ""),
									...de.map((e) => `licensed intent addendum: ${e}`)
								].filter(Boolean).join("\n")
							}), i.nodeRepairDraws++, L("rha", r.id, Jf(u.path, f.whole, t));
						}
						let p = f ? f.text : [
							"L2 procedure dossier — schema-guided interpretation. Execute the playbook below against the finding; do not ideate beyond it.",
							`bug schema: classKey=${I}; kind=${D[0]?.kind ?? "unknown"}; stratum=${D[0]?.stratum ?? "(uncataloged)"}${D[0]?.templateId ? `; template=${D[0].templateId}` : ""}`,
							H,
							...W,
							...de.map((e) => `licensed intent addendum: ${e}`),
							F,
							G,
							[...y].slice(-15).join("\n")
						].filter(Boolean).join("\n\n");
						i.l2Draws++, i.repairDraws++, i.candidatesDrawn++, i.repairCandidatesDrawn++, ie = `L2 procedure loop ${Oe + 1}/${Nv.length} on ${I}`, L("rha", r.id, `L2 procedure loop ${Oe + 1}/${Nv.length} [${I}] t=${t} (K=1)`);
						let m = {
							spec: q,
							feature: r,
							findings: he(j),
							parallelInstances: [],
							frozenTest: h,
							ownedFiles: d && u ? [u] : [],
							dependencyContext: ot(r),
							failureOutput: p,
							attempt: o,
							lineage: [`tier1 L2 loop ${Oe + 1}: ${I}`]
						}, _ = Xe.files(), v = !1, b = Xe.allocateCandidateId(), x = a.startAction({
							kind: "candidate-trial",
							target: r.id,
							phase: "rha",
							beforeSignature: Xe.signature(),
							relatedCandidateIds: [b],
							startEvidence: {
								layer: "L2",
								focusKey: I,
								temperature: t
							}
						}), S = "rejected", C;
						try {
							let { result: n } = await a.runAction({
								kind: "llm:repair:L2",
								target: r.id,
								phase: "rha",
								relatedCandidateIds: [b],
								startEvidence: {
									temperature: t,
									pass: o,
									focusKey: I,
									nodeCompliant: d,
									purposeLabel: "L2 procedure"
								},
								fn: () => e.llm.repair(m, {
									temperature: t,
									candidate: {
										n: 1,
										k: 1
									},
									attempt: o,
									attemptLabel: "pass",
									purpose: `L2 procedure: ${I}`
								})
							}), u = rf(n.filter((e) => r.files.includes(e.path))), f = of(u, be, xe);
							if (f) {
								Ce("rha", r.id, I), i.fixesUnsuccessful++, L("rha", r.id, sf(I, f) + (Oe + 1 >= Nv.length ? " (L2 exhausted → L3 permutation next)" : "")), ae.escalated || (ae = sv(ae));
								return;
							}
							be.add(u), await me(n);
							let p = await e.runSuite(at(), {
								path: r.testFile,
								content: h
							}), g = c(r, p, h), y = !p.crashed && !g.some((e) => e.cls?.classKey === I), C = p.crashed ? 0 : Math.max(0, p.total - p.failures.length);
							if (K({
								classKey: I,
								layer: "L2",
								temp: t,
								score: C,
								findings: p.crashed ? 1 : p.failures.length,
								parseStatus: p.crashed ? "crashed" : "parsed",
								hash: u,
								exhibitHash: we?.hash,
								body: n.filter((e) => r.files.includes(e.path)).map((e) => e.content).join("\n").slice(0, 400)
							}), y || fv(C, s)) {
								Xe.restoreSnapshot(_), S = "applied", a.finishAction({
									actionId: x,
									disposition: "applied",
									afterSignature: Xe.signature(),
									endEvidence: {
										selected: !0,
										score: C,
										focusGone: y
									}
								}), await me(n, {
									vet: !0,
									label: "L2 winner"
								}), v = !0, i.l2Wins++, i.fixesL2++, d && i.nodeRepairWins++, z.recordNode({
									type: "repair",
									featureId: r.id,
									causeId: V.get(r.id) ?? null,
									artifactPath: r.files[0] ?? null,
									bugClass: I,
									status: "info",
									summary: `L2 schema-guided repair applied (loop ${Oe + 1}, t=${t}; candidate ${b})`
								}), i.candidatesAccepted++, i.repairCandidatesAccepted++, oe = 0, N = I, y ? (i.l2Bullseyes++, ae = ov(), L("rha", r.id, `L2 bullseye: ${I} resolved (loop ${Oe + 1}, ${C}/${p.total} passing)`)) : L("rha", r.id, `L2 improvement kept: ${C}/${p.total} passing — re-enters L1`);
								return;
							}
							i.fixesUnsuccessful++, I === N ? oe++ : (N = I, oe = 1);
							let w = (p.crashed ? [`__suite__|${p.crashed.split("\n")[0] ?? ""}`] : g.map((e) => `${e.name}|${e.message.split("\n")[0] ?? ""}`)).sort().join("~");
							L("rha", r.id, `L2 loop ${Oe + 1}/${Nv.length} no improvement — incumbent kept` + (Oe + 1 >= Nv.length ? " (L2 exhausted → L3 permutation next)" : "")), Oe === 0 && l === w && (ce.set(I, Nv.length), i.l2ShortCircuits++, L("rha", r.id, "L2 short-circuit: world unchanged — escalating"));
							return;
						} catch (e) {
							S = "failed", C = e, i.fixesUnsuccessful++, L("rha", r.id, `L2 draw failed: ${e instanceof Error ? e.message : String(e)}`);
							return;
						} finally {
							v || Xe.restoreSnapshot(_), a.snapshot().terminals.some((e) => e.actionId === x) || a.finishAction({
								actionId: x,
								disposition: S,
								failureMode: S === "failed" ? "fatal" : void 0,
								error: C,
								afterSignature: Xe.signature(),
								endEvidence: {
									restored: !v,
									candidateId: b
								}
							});
						}
					}
					if (e.onJudgment && D[0] && (D[0].kind === "assertion" || D[0].kind === "throw-mismatch") && g) {
						let n = (e, t) => e === t || e.endsWith(`> ${t}`) || e.endsWith(`: ${t}`), o = (() => {
							for (let t of g.cases) {
								let i = j.find((e) => n(e.name, t.name));
								if (!i || ue.has(t.name)) continue;
								let a = bp({
									caseName: t.name,
									expected: i.cls?.detail.expected ?? D[0].detail.expected,
									feature: r,
									prompt: e.rawPrompt ?? e.prompt
								});
								if (!a.licensed) return {
									judgeCase: t,
									chain: a,
									err: i
								};
							}
							return null;
						})();
						if (o) {
							let { judgeCase: n, chain: s } = o;
							{
								ue.add(n.name), i.judgmentGates++;
								let c = o.err.cls?.detail ?? D[0].detail, l = {
									featureId: r.id,
									caseName: n.name,
									classKey: I,
									assertion: n.body.slice(0, 400),
									expected: c.expected,
									received: c.received,
									exhibit: we?.text,
									trace: Te ?? void 0,
									licenseSearch: s.searched
								};
								L("rha", r.id, `judgment gate: case "${n.name}" [${I}] — ${s.searched}`);
								let u = a.startAction({
									kind: "judgment",
									target: n.name,
									phase: "rha",
									startEvidence: {
										featureId: r.id,
										focusKey: I,
										caseKind: D[0].kind
									}
								}), d;
								try {
									d = await e.onJudgment(l), a.finishAction({
										actionId: u,
										disposition: d ? "applied" : "noop",
										endEvidence: {
											decisionAction: d?.action ?? null,
											source: d?.source ?? null
										}
									});
								} catch (e) {
									a.finishAction({
										actionId: u,
										disposition: "failed",
										failureMode: "nonfatal",
										error: e
									}), L("rha", r.id, "judgment resolver failed nonfatally (see action ledger) — ladder continues");
								}
								if (d) {
									let a = (/* @__PURE__ */ new Date()).toISOString();
									d.source === "operator" ? i.judgmentOperator++ : i.judgmentLlm++, L("rha", r.id, wp(d, a));
									let o = p.find((e) => e.featureId === r.id && e.caseName === n.name);
									o && (o.license = `${o.license} → ${Cp(d.source, a)}`);
									let s = async (e) => {
										let t = Np(O(r, g.imports, e), r.testFile, q).content;
										if (C(t).length) return !1;
										let n = {
											imports: g.imports,
											cases: e
										}, i = await Ie(r, t, n, "judgment: refreeze");
										return i && i.status === "rejected" ? (L("rha", r.id, `judgment refreeze rejected by gateway: ${i.report.rejectionReasons[0] ?? "no reason"}`), !1) : (g = n, h = t, !0);
									}, l = async () => await s(g.cases.filter((e) => e.name !== n.name)) ? (i.judgmentDropped++, L("rha", r.id, `judgment: case "${n.name}" dropped — suite re-frozen (coverage reduced, honest)`), !0) : !1;
									if (d.action === "drop") {
										if (await l()) return;
										L("rha", r.id, "judgment drop produced invalid suite — ruling voided, ladder continues");
									} else if (d.action === "amend") {
										let a = !1;
										for (let o = 0; o < iv.length && !a; o++) {
											let l = kv(t, r, n.name, n.kind);
											try {
												let t = [{
													name: n.name,
													kind: n.kind,
													errors: [
														"JUDGMENT RULING: amend this case to accept the implementation's observed behavior.",
														c.expected == null ? "" : `previously expected: ${c.expected}`,
														c.received == null ? "" : `observed (accept this): ${c.received}`,
														Te ?? "",
														Av(l)
													].filter(Boolean)
												}], u = await fe({
													method: "fixTestCases:judgment-amend",
													target: r.id,
													phase: "rha",
													startEvidence: {
														temperature: iv[o],
														amendTry: o + 1,
														caseName: n.name
													},
													fn: () => e.llm.fixTestCases(q, r, t, [], g.imports, {
														temperature: iv[o],
														candidate: {
															n: o + 1,
															k: iv.length
														},
														purpose: `judgment-amend: ${r.id}`
													})
												}), d = jv(l, hg(t.map((e) => ({
													name: e.name,
													kind: e.kind
												})), u.cases).cases[0]?.body ?? "", i, n.name, (e) => L("rha", r.id, e));
												if (d.rejected) {
													L("rha", r.id, `judgment amend try ${o + 1}/${iv.length}: draw unusable`);
													continue;
												}
												let f = d.body;
												if (!f || !Ah(f) || jd([{
													name: n.name,
													body: f
												}]).length) {
													L("rha", r.id, `judgment amend try ${o + 1}/${iv.length}: draw unusable`);
													continue;
												}
												let p = g.cases.map((e) => e.name === n.name ? {
													...e,
													body: f
												} : e), m = Np(O(r, g.imports, p), r.testFile, q).content, h = await e.runSuite(Jp(q), {
													path: r.testFile,
													content: m
												});
												if ((h.crashed != null || h.failures.some((e) => e.name === n.name || e.name.endsWith(`> ${n.name}`) || e.name.endsWith(`: ${n.name}`))) && await s(p)) {
													a = !0, L("rha", r.id, `judgment: case "${n.name}" amended and re-frozen (born-red honest) — re-measuring`);
													return;
												}
												L("rha", r.id, `judgment amend try ${o + 1}/${iv.length} refused: amended case vacuous vs stubs`);
											} catch (e) {
												L("rha", r.id, `judgment amend try ${o + 1}/${iv.length} failed: ${e instanceof Error ? e.message : String(e)}`);
											}
										}
										if (L("rha", r.id, "judgment amend exhausted — dropping instead"), await l()) return;
									} else if (d.action === "direct" && d.intentText) {
										de.push(`${d.intentText} [${Cp(d.source, a)}]`), ce.set(I, Nv.length - 1), L("rha", r.id, "judgment: repair now carries the licensed intent addendum — ladder continues directed");
										return;
									}
								}
							}
						}
					}
					ie = `LLM repair pass ${o} (permutation) on ${D[0]?.classKey ?? "all"}`, L("rha", r.id, `repair pass ${o}: ${j.length}/${n.length} findings${D[0] ? ` [${D[0].classKey}]` : ""}${F ? " + checked idioms" : ""}${G ? " + superbuffer" : ""}, permutation K=${ae.k}`);
					let ke = {
						spec: q,
						feature: r,
						findings: he(j),
						parallelInstances: [],
						frozenTest: h,
						ownedFiles: [],
						dependencyContext: ot(r),
						failureOutput: [
							H,
							...W,
							...de.map((e) => `licensed intent addendum: ${e}`),
							G,
							F,
							[...y].slice(-30).join("\n")
						].filter(Boolean).join("\n\n"),
						attempt: o,
						lineage: [`tier1 authenticate pass ${o}: ${n.length} findings`]
					}, Ae = Xe.files(), J = () => {
						Xe.restoreSnapshot(Ae);
					}, je = [], Me = [], Ne = Math.max(0, ne - n.length), Y = n[0]?.crash ? Wm(n[0].message) : null, Fe = !1;
					try {
						i.permBatches++;
						for (let t = 0; t < ae.k; t++) {
							let n = ae.temps[t] ?? ae.temps[ae.temps.length - 1];
							le(), J(), i.permutationDraws++, i.permCandidates++, i.candidatesDrawn++, i.repairCandidatesDrawn++, i.repairDraws++;
							let { result: s } = await a.runAction({
								kind: "llm:repair:L3",
								target: r.id,
								phase: "rha",
								startEvidence: {
									temperature: n,
									pass: o,
									focusKey: I || "all",
									candidateIndex: t + 1,
									batchK: ae.k,
									batchTempsEscalated: ae.escalated
								},
								fn: () => e.llm.repair(ke, {
									temperature: n,
									candidate: {
										n: t + 1,
										k: ae.k
									},
									attempt: o,
									attemptLabel: "pass",
									purpose: I || "all"
								})
							}), c = s, l = rf(c.filter((e) => r.files.includes(e.path))), u = of(l, be, xe);
							if (u) {
								Ce("rha", r.id, I), i.fixesUnsuccessful++, L("rha", r.id, sf(I, u)), ae.escalated || (ae = sv(ae));
								continue;
							}
							be.add(l), await me(c);
							let d = await e.runSuite(at(), {
								path: r.testFile,
								content: h
							});
							if (d.crashed && /transpile |Invalid or unexpected token|Unexpected token|Invalid regular expression/i.test(d.crashed)) {
								let t = !1;
								c = c.map((e) => {
									let n = Ad(e.content), r = n ?? d.crashed;
									if (!n && !/Invalid|Unexpected/i.test(d.crashed)) return e;
									let i = Kh(e.path, e.content, r);
									return i ? (t = !0, {
										...e,
										content: i.content
									}) : e;
								}), t && (await me(c), d = await e.runSuite(at(), {
									path: r.testFile,
									content: h
								}), (!d.crashed || !/transpile |Invalid or unexpected token|Unexpected token/i.test(d.crashed)) && (i.mechanicalFixes++, i.deterministicEditsOutsideSubstrate++, L("rha", r.id, `substrate: polished permutation candidate t=${n} (0 tok)`))), d.crashed && /transpile |Invalid or unexpected token|Unexpected token|Invalid regular expression/i.test(d.crashed) && i.fixesUnparseable++;
							}
							let f = d.crashed ? 1 : d.failures.length, p = d.crashed ? 0 : Math.max(0, d.total - d.failures.length);
							Me.push(d.crashed ? Wm(d.crashed) : null), je.push({
								value: c,
								temp: n,
								score: p,
								findings: f,
								label: d.crashed ? "crashed" : `${p}/${d.total} passing`
							}), K({
								classKey: I || "freeform",
								layer: "L3",
								temp: n,
								score: p,
								findings: f,
								parseStatus: d.crashed ? /transpile |Invalid or unexpected token|Unexpected token/i.test(d.crashed) ? "unparseable" : "crashed" : "parsed",
								hash: l,
								exhibitHash: we?.hash,
								body: c.filter((e) => r.files.includes(e.path)).map((e) => e.content).join("\n").slice(0, 400)
							});
						}
						if (Y && je.length > 0 && Me.length === je.length && Me.every((e) => e === Y)) {
							J(), L("rha", r.id, "external-fault inferred"), await v();
							return;
						}
						if (je.length) {
							let t = lv(je);
							if (i.permutationWins++, !fv(t.picked.score, Ne)) J(), i.fixesUnsuccessful++, L("rha", r.id, uv(t)), L("rha", r.id, dv(o)), _e != null && M(_e, !1), ye != null && Bg(se, ye, !1), I === N ? oe++ : (N = I, oe = 1);
							else {
								if (i.permImproved++, i.candidatesAccepted++, i.repairCandidatesAccepted++, i.fixesL3++, z.recordNode({
									type: "repair",
									featureId: r.id,
									causeId: V.get(r.id) ?? null,
									artifactPath: r.files[0] ?? null,
									bugClass: I || null,
									status: "info",
									summary: `L3 permutation winner applied (t=${t.picked.temp}, ${t.picked.label})`
								}), L("rha", r.id, uv(t)), J(), await me(t.picked.value, {
									vet: !0,
									label: "repair winner"
								}), Fe = !0, oe = 0, N = I, ae = ov(), G) {
									i.superbufferWins++;
									let t = kl({
										classKey: I,
										caseName: j[0]?.name
									}), n = (P.get(t) ?? 0) + 1;
									if (P.set(t, n), Al(n)) {
										let i = jl({
											patternKey: t,
											featureId: r.id,
											wins: n,
											stubSketch: r.stubs[0]?.content,
											source: "in-run-win"
										});
										e.onCladeCandidate?.(i), L("rha", r.id, Ml(i));
									}
								}
								_e != null && M(_e, !0), ye != null && Bg(se, ye, !0);
							}
						}
					} catch (e) {
						i.fixesUnsuccessful++, L("rha", r.id, `repair draw failed: ${e instanceof Error ? e.message : String(e)}`);
					} finally {
						Fe || Xe.restoreSnapshot(Ae);
					}
				},
				onStall: async (n, o) => {
					let s = n.filter((e) => e.crash || e.cls?.kind === "crash" || e.cls?.kind === "transpile" || e.cls?.kind === "duplicate-decl" || e.cls?.kind === "regex-literal");
					if (s.length > 0 && !s.some((e) => {
						let t = e.cls?.detail.file;
						return !!t && r.files.includes(t);
					})) return L("rha", r.id, `entropy reset skipped @ pass ${o}: failure not attributed to owned file`), !1;
					L("rha", r.id, `entropy reset @ pass ${o}: fresh implementation from frozen contract`);
					try {
						i.freshDraws++;
						let s = Dl({
							spec: q,
							feature: r,
							parts: g,
							stubs: r.stubs,
							lessons: e.lessons ?? [],
							siblingParts: Pe,
							siblingImpls: at().filter((e) => !r.files.includes(e.path)),
							target: `entropy-reset|${r.id}`,
							stage: "build",
							conceptText: re.get(r.id) ?? null,
							signature: r.exports[0] ? {
								name: r.exports[0].symbol,
								params: [],
								returnType: "unknown"
							} : null
						}), c = [
							1,
							1.1,
							av
						];
						for (let l = 0; l < c.length; l++) {
							let u = c[l], { result: d } = await a.runAction({
								kind: "llm:generateImplementation:entropy-reset",
								target: r.id,
								phase: "rha",
								startEvidence: {
									temperature: u,
									pass: o,
									tryIndex: l + 1
								},
								fn: () => e.llm.generateImplementation(q, r, h, ot(r), {
									temperature: u,
									avoid: [...y].slice(-20).map((e) => `- ${e}`).join("\n"),
									context: t.holeOnlyFill ? [Ol(s), L_].join("\n\n") : Ol(s),
									purpose: `entropy reset: ${r.files.join(", ")}`,
									attempt: o,
									attemptLabel: "pass",
									candidate: {
										n: l + 1,
										k: c.length
									}
								})
							});
							if (t.holeOnlyFill) {
								let e = d.filter((e) => r.files.includes(e.path) && x_(e.content).over);
								if (e.length) {
									for (let t of e) i.overreachBodyRejections++, L("rha", r.id, `case "${t.path}" rejected overreach|body: ${x_(t.content).reason}`);
									L("rha", r.id, `entropy reset rejected @ pass ${o}: overreach|body` + (l < c.length - 1 ? ` — reset retry ${l + 2}/${c.length}` : ""));
									continue;
								}
							}
							let f = rf(d.filter((e) => r.files.includes(e.path))), p = of(f, be, xe);
							if (p) {
								Ce("rha", r.id, n[0]?.cls?.classKey ?? "entropy-reset"), i.fixesUnsuccessful++, L("rha", r.id, sf(n[0]?.cls?.classKey ?? "entropy-reset", p) + (l < c.length - 1 ? ` — reset retry ${l + 2}/${c.length} (t=${c[l + 1]})` : ""));
								continue;
							}
							be.add(f), K({
								classKey: n[0]?.cls?.classKey ?? "entropy-reset",
								layer: "L4",
								temp: u,
								score: 0,
								findings: n.length,
								parseStatus: "parsed",
								hash: f,
								body: d.filter((e) => r.files.includes(e.path)).map((e) => e.content).join("\n").slice(0, 400)
							});
							let m = d.filter((e) => r.files.includes(e.path)), { rejected: g, gateUnavailable: _ } = await dd(m, at().filter((e) => !m.some((t) => t.path === e.path)));
							if (_ && Ee("rha", r.id), g.length) {
								let e = g[0];
								L("rha", r.id, `reset draw rejected: ${e.reason} in ${e.path}`), L("rha", r.id, `entropy reset rejected @ pass ${o}: ${e.reason} in ${e.path}` + (l < c.length - 1 ? ` — reset retry ${l + 2}/${c.length}` : ""));
								continue;
							}
							{
								let e = m[0]?.path ?? r.files[0], t = Xe.get(e)?.content ?? "", i = m[0]?.content ?? "";
								x.cur = {
									classKey: n[0]?.cls?.classKey ?? "entropy-reset",
									before: t,
									after: i,
									path: e
								};
							}
							return await me(d, {
								vet: !0,
								label: "reset draw"
							}), ae = ov(), oe = 0, !0;
						}
						return !1;
					} catch (e) {
						return L("rha", r.id, `entropy reset draw failed: ${e instanceof Error ? e.message : String(e)}`), !1;
					}
				}
			});
			i.passesTotal += H.passes, i.passesPerFeature[r.id] = H.passes;
			for (let e of H.errors) if (e.crash) {
				let t = Wm(e.message);
				I.add(t);
				let n = F.get(t);
				n || (n = /* @__PURE__ */ new Set(), F.set(t, n)), n.add(r.id);
			}
			{
				let e = H.errors.length, t = Math.max(ne, e), i = Math.max(0, t - e);
				L("auth", r.id, `epoch closed: ${i}/${t} cases passing` + (e ? ` — ${e} still failing after ${H.passes} pass${H.passes === 1 ? "" : "es"}` : "") + (n.has(r.id) ? " (parked: crash unattributed)" : ""));
			}
			if (!n.has(r.id)) if (H.errors.length) J.push(`${r.id}: ${s(H.errors, ne)} after ${H.passes} passes${H.stalled ? " (stalled)" : ""}`), H.stalled && (j = yv(j, {
				featureId: r.id,
				caseName: "__feature__",
				kind: "stalled",
				brokenDraw: "(stalled ladder)",
				parseError: s(H.errors, ne),
				snippet: s(H.errors, ne).slice(0, 80)
			}).state);
			else {
				f(r.id);
				let e = x.cur;
				e && H.passes > 0 && e.after && (i.fixesL4++, z.recordNode({
					type: "repair",
					featureId: r.id,
					causeId: V.get(r.id) ?? null,
					artifactPath: e.path,
					bugClass: e.classKey,
					status: "info",
					summary: "L4 entropy reset applied to the node"
				}), T.push({
					classKey: e.classKey,
					editShape: `reset ${Rg(e.before, e.after)}`,
					beforeSnippet: e.before.slice(0, 240),
					afterSnippet: e.after.slice(0, 240),
					path: e.path
				}), x.cur = null), L("auth", r.id, `converged in ${H.passes} pass${H.passes === 1 ? "" : "es"}`);
			}
			await b();
		}
		{
			let t = K_({
				frozenByFeature: Ne,
				lessonKeys: Re,
				irPartsByFeature: Pe
			});
			for (let r = 1; r <= 3; r++) {
				let o = [...new Set(J.filter((e) => /\(stalled\)/.test(e)).map((e) => e.split(":")[0].trim()).filter(Boolean))];
				if (!o.length) break;
				let s = K_({
					frozenByFeature: Ne,
					lessonKeys: Re,
					irPartsByFeature: Pe
				}), l = Ev(t, s);
				if (r > 1) {
					let e = o.map((e) => ({
						fid: e,
						gate: Sv(j, e, s)
					}));
					if (e.length > 0 && e.every((e) => !e.gate.ok && e.gate.reason === "world unchanged")) {
						L("rha", null, `relay: world unchanged since the last certified state — no re-entry for [${o.join(", ")}]`);
						break;
					}
				}
				let d = !1;
				for (let t of o) {
					let o = Sv(j, t, s);
					if (!o.ok && r > 1) {
						L("rha", t, `relay skipped: ${o.reason ?? "blocked"}`);
						continue;
					}
					let p = je.find((e) => e.id === t), m = p ? Ne.get(t) : void 0;
					if (!p || m == null || n.has(t)) continue;
					let h = a.startAction({
						kind: "relay",
						target: t,
						phase: "rha",
						startEvidence: {
							instance: r,
							healsDelta: l.heals,
							lessonsDelta: l.lessons,
							siblingsDelta: l.siblings
						}
					});
					L("rha", t, Tv({
						featureId: t,
						instance: r,
						healsDelta: l.heals,
						lessonsDelta: l.lessons,
						worldChanged: r === 1 || l.heals + l.lessons + l.siblings > 0
					}) + ` [action:${h}]`), j = xv(j, t, s), d = !0, le();
					let g = await e.runSuite(at(), {
						path: p.testFile,
						content: m
					});
					if (!g.crashed && g.failures.length === 0) {
						for (let e = J.length - 1; e >= 0; e--) J[e].startsWith(`${t}:`) && /\(stalled\)/.test(J[e]) && J.splice(e, 1);
						f(t), a.finishAction({
							actionId: h,
							disposition: "applied",
							endEvidence: {
								convergence: "clean",
								instance: r
							}
						}), L("auth", t, a.renderTerminalLine(h));
						continue;
					}
					let _ = c(p, g, m), v = {
						path: p.testFile,
						content: m
					};
					for (let e of _) {
						if (!e.cls) continue;
						let n = Eh(e.cls, at(), v, q);
						i.substrateAttempts++, A(e.cls.classKey, n, t), n.status === "fixed" && n.fix && (await u((n.fixes?.length ? n.fixes : [n.fix]).map((t) => ({
							...t,
							classKey: e.cls.classKey
						})), t, p.testFile), L("rha", t, `relay substrate: ${e.cls.classKey} → fixed (0 tok)`));
					}
					let y = await e.runSuite(at(), {
						path: p.testFile,
						content: Ne.get(t) ?? m
					});
					if (!y.crashed && y.failures.length === 0) {
						for (let e = J.length - 1; e >= 0; e--) J[e].startsWith(`${t}:`) && /\(stalled\)/.test(J[e]) && J.splice(e, 1);
						f(t), a.finishAction({
							actionId: h,
							disposition: "applied",
							endEvidence: {
								convergence: "after-mechanical",
								instance: r
							}
						}), L("auth", t, a.renderTerminalLine(h));
					} else {
						let e = y.failures.length === g.failures.length && y.crashed === g.crashed;
						a.finishAction({
							actionId: h,
							disposition: e ? "noop" : "rejected",
							endEvidence: {
								convergence: "unchanged",
								failuresBefore: g.failures.length,
								failuresAfter: y.failures.length,
								crashedBefore: !!g.crashed,
								crashedAfter: !!y.crashed
							}
						}), L("rha", t, a.renderTerminalLine(h));
					}
				}
				if (t = s, !d) break;
			}
			let r = [...new Set(J.filter((e) => /\(stalled\)/.test(e)).map((e) => e.split(":")[0].trim()))];
			if (r.length) {
				L("rha", null, `relay metaloop: [${r.join(", ")}]`);
				for (let t of r) {
					let n = je.find((e) => e.id === t), r = n ? Ne.get(t) : void 0;
					if (!n || r == null) continue;
					le();
					let i = await e.runSuite(at(), {
						path: n.testFile,
						content: r
					});
					if (!i.crashed && i.failures.length === 0) {
						for (let e = J.length - 1; e >= 0; e--) J[e].startsWith(`${t}:`) && /\(stalled\)/.test(J[e]) && J.splice(e, 1);
						L("auth", t, "relay metaloop converged");
					}
				}
			}
		}
		if (y.length) {
			L("rha", null, `case-relay: ${y.length} re-enqueued case(s) — warm-world refill`);
			for (let r of y) {
				le();
				let a = je.find((e) => e.id === r.featureId), o = a ? Pe.get(a.id) : null, s = a ? Ne.get(a.id) : null, c = !1;
				if (a && o && s != null && !n.has(a.id)) {
					L("ir", a.id, `case-relay: refilling "${r.name}" against the warm world (K=${iv.length}, ${r.reason})`);
					let n = a.exports.find((e) => e.symbol === r.name)?.symbol ?? a.exports[0]?.symbol, s = await u_({
						spec: q,
						feature: a,
						caseGen: {
							name: r.name,
							kind: r.kind,
							body: "",
							symbol: n
						},
						stubs: Jp(q),
						runSuite: e.runSuite,
						imports: o.imports,
						onMechanismResult: (e, t) => {
							t === "empty" ? i.substrateFillEmptyMechanisms++ : t === "vacuous" && i.substrateFillVacuousMechanisms++;
						}
					});
					if (s) {
						let t = {
							name: r.name,
							kind: r.kind,
							body: s.body,
							clade: Yl({
								name: r.name,
								kind: r.kind,
								body: s.body
							}, n)
						}, l = {
							imports: o.imports,
							cases: [...o.cases, t]
						}, u = Np(O(a, l.imports, l.cases), a.testFile, q).content, d = await e.runSuite(at(), {
							path: a.testFile,
							content: u
						});
						if (!d.crashed && !d.failures.some((e) => e.name.includes(r.name))) {
							let e = await Ie(a, u, l, "case-relay: substrate adopt");
							(!e || e.status !== "rejected") && (i.substrateFillHits++, i.recoveredCases++, c = !0, L("rha", a.id, `case "${r.name}" filled from substrate: ${s.mechanism} (0 tok)`));
						}
					}
					c || i.substrateFillEscalations++;
					let l = at();
					await U("ir", a.id, l);
					let u = e_({
						stage: "ir",
						featureId: a.id,
						spec: q,
						feature: a,
						parts: o,
						stubs: a.stubs,
						lessons: e.lessons ?? [],
						siblingParts: Pe,
						siblingImpls: l.filter((e) => !a.files.includes(e.path)),
						target: r.name,
						conceptText: re.get(a.id) ?? null,
						substrateHandoff: k(a.id),
						ledgerRows: z.allRows(),
						artifact: l,
						cachedReading: pe.reading
					}), d = R("ir", a.id, u.assembly, "case-relay"), f = kv(t, a, r.name, r.kind);
					try {
						for (let t = 0; t < iv.length && !c; t++) {
							let n = iv[t];
							i.permutationDraws++, i.permCandidates++, i.candidatesDrawn++, i.fillCandidatesDrawn++;
							let s = (await fe({
								method: "fixTestCases:case-relay",
								target: a.id,
								phase: "rha",
								startEvidence: {
									temperature: n,
									candidateIndex: t + 1,
									caseName: r.name
								},
								fn: () => e.llm.fixTestCases(q, a, [{
									name: r.name,
									kind: r.kind,
									errors: [
										"End-of-run refill: siblings are frozen and implementations are built.",
										"Write the COMPLETE case body now — assert observable behavior.",
										d,
										Av(f)
									].filter(Boolean)
								}], [], o.imports, {
									temperature: n,
									candidate: {
										n: t + 1,
										k: iv.length
									},
									rescue: !0,
									purpose: `case-relay: ${a.id}`
								})
							})).cases[0]?.body ?? "", l = jv(f, s, i, r.name, (e) => L("rha", a.id, e));
							if (l.rejected || (s = l.body, !s.trim())) continue;
							let u = jd([{
								name: r.name,
								body: s
							}])[0];
							if (u) {
								let e = Hh(s, u.error);
								e && (s = e.body, i.mechanicalFixes++);
							}
							if (!Ah(s)) continue;
							let p = {
								name: r.name,
								kind: r.kind,
								body: s,
								clade: Yl({
									name: r.name,
									kind: r.kind,
									body: s
								})
							}, m = {
								imports: o.imports,
								cases: [...o.cases, p]
							}, h = Np(O(a, m.imports, m.cases), a.testFile, q).content;
							if (C(h).length || Ad(h)) continue;
							let g = await e.runSuite(Jp(q), {
								path: a.testFile,
								content: h
							});
							if (!(!g.crashed && g.failures.some((e) => e.name.includes(r.name)))) {
								L("rha", a.id, `case-relay: "${r.name}" candidate vacuous vs stubs — rejected`);
								continue;
							}
							let _ = await e.runSuite(at(), {
								path: a.testFile,
								content: h
							});
							if (_.crashed || _.failures.some((e) => e.name.includes(r.name))) continue;
							let v = await Ie(a, h, m, "case-relay: adopt");
							if (v && v.status === "rejected") {
								L("rha", a.id, `case-relay adoption rejected by gateway ("${r.name}"): ${v.report.rejectionReasons[0] ?? "no reason"}`);
								continue;
							}
							i.candidatesAccepted++, i.fillCandidatesAccepted++, i.recoveredCases++, c = !0, L("rha", a.id, `case-relay: case "${r.name}" recovered at end-of-run (warm world, candidate t=${n})`);
						}
					} catch (e) {
						L("rha", r.featureId, `case-relay draw failed: ${e instanceof Error ? e.message : String(e)}`);
					}
				}
				c || (J.push(`${r.featureId}: planned case "${r.name}" ${r.reason}`), L("rha", r.featureId, `case-relay: case "${r.name}" final drop — ${r.reason}`));
			}
		}
		await b();
		for (let [e, t] of n) {
			J.some((t) => t.startsWith(`${e}: crash|unattributed`)) || J.push(`${e}: crash|unattributed`);
			let n = t.sig;
			I.add(n);
			let r = F.get(n);
			r || (r = /* @__PURE__ */ new Set(), F.set(n, r)), r.add(e);
		}
	} else e.runSuite || (L("auth", null, "no suite runner available — artifact NOT authenticated (frozen suites were not executed)"), J.push("artifact not authenticated: no suite runner in this environment"));
	let st = at();
	i.elapsedMs = Date.now() - n, i.fixesL1 = i.substrateFixes, s(), i.artifactFaults = F.size, i.artifactFaultsRemaining = I.size, i.artifactFaultsAffectedFeatures = [...F.values()].reduce((e, t) => e + t.size, 0);
	let ct = [...I].reduce((e, t) => e + (F.get(t)?.size ?? 0), 0), lt = i.artifactFaultsRemaining > 0 ? `, ${i.artifactFaultsRemaining} artifact fault${i.artifactFaultsRemaining === 1 ? "" : "s"} affecting ${ct} feature${ct === 1 ? "" : "s"}` : "", ut = Ye.length > 0 ? `, ${nv(Ye.length)}` : "";
	ae.cases + oe.cases > 0 && De("done", null, [Bu(ae, oe)]), se.withPage.cases + se.withoutPage.cases > 0 && De("done", null, [Vg(se.withPage, se.withoutPage)]), i.deferredPermanent = g.length + Ye.length, L("done", null, `${Xe.files().length} files built, ${Me.length} suites frozen, ${J.length} problems — ${i.passesTotal} cycles, ${i.bugsPatched}/${i.bugsObserved} bugs patched${lt}${ut}, ${Math.round(i.elapsedMs / 1e3)}s`);
	let dt = i.substrateFillHits + i.substrateFillEscalations;
	L("done", null, `substrate fill hit-rate: ${i.substrateFillHits} of ${dt} cases filled at 0 tokens via substrate — approximately ${i.substrateFillHits * 3} LLM draws avoided`);
	for (let e of Lg(T)) {
		L("done", null, `handler-candidate: ${e.classKey} support=${e.support} shape="${e.editShape}"`);
		let t = e.fixtures[0];
		t && De("done", null, [
			`handler-candidate fixture [${e.classKey}] — this transform, seen ${e.support}×:`,
			`  before: ${t.before.replace(/\s+/g, " ").slice(0, 160)}`,
			`  after:  ${t.after.replace(/\s+/g, " ").slice(0, 160)}`
		]);
	}
	let ft = [...E.entries()].map(([e, t]) => {
		let n = "uncovered";
		return t.fixed ? n = "mechanical" : t.mechanicalCandidate && (n = "mechanical-candidate"), {
			classKey: e,
			count: t.count,
			stratum: n
		};
	});
	De("done", null, [
		Ju(i.parsePoisonIncidents, e.priorParsePoisonIncidents ?? 0),
		...Zu(await Qu().catch(() => void 0)),
		Yu({
			attempts: i.substrateAttempts,
			fixes: i.substrateFixes,
			refusals: i.substrateRefusals,
			noHandler: i.substrateNoHandler
		}),
		...Xu(ft)
	]);
	let pt = g.filter((e) => !e.behavioralSplit);
	if (pt.length) {
		for (let e of pt) J.push(Gu(e.capability));
		let e = [...new Set(pt.map((e) => e.capability))].sort().join(", ");
		J.push(`${pt.length} prompt items excluded (capabilities: ${e}) — see TRACEABILITY.md`);
	}
	let mt = g.filter((e) => e.behavioralSplit);
	mt.length && J.push(`${mt.length} infra binding${mt.length === 1 ? "" : "s"} excised (behavioral invariants kept under simulated dependencies) — see TRACEABILITY.md`);
	{
		let e = Me.length, t = J.filter((e) => /crash\|unattributed/.test(e)).length;
		L("done", null, `funnel: ${i.featuresTotal} feature(s) planned → ${e} froze a contract → ${i.nodesBuilt} built all owned files → ${i.nodesTotal} entered the repair ladder → ${i.nodesHealed} converged.` + (i.nodesTotal === 0 ? " The repair ladder never ran, so the substrate had nothing to attempt —" + (e === 0 ? " no feature froze a contract." : t > 0 ? ` ${t} feature(s) parked on unattributed crashes before repair.` : " every frozen feature was skipped (build-failed or parked).") : ""));
	}
	L("done", null, Hf(z));
	let ht;
	if (e.isCancelled?.() && a.cancelPending("run cancelled"), e.runSuite && Me.length > 0) {
		let t = a.startAction({
			kind: "terminal-certification",
			target: "*",
			phase: "done",
			startEvidence: {
				artifactBytes: st.length,
				frozenSuites: Me.length
			}
		});
		try {
			let n = await Eg({
				spec: q,
				prompt: e.rawPrompt ?? e.prompt,
				runSuite: e.runSuite,
				artifact: st,
				state: Y
			}), r = /* @__PURE__ */ new Map();
			for (let e of n.findings) {
				let t = r.get(e.featureId) ?? [];
				t.push(e), r.set(e.featureId, t);
			}
			let i = `M-terminal-${z.allRows().length}`, s = [];
			for (let [e, n] of r) {
				let r = je.find((t) => t.id === e), a = z.recordNode({
					type: "result",
					featureId: e,
					causeId: z.codeNodeFor(e) ?? z.testNodeFor(e),
					artifactPath: r?.testFile ?? null,
					status: "fail",
					summary: `terminal: ${n.length} finding(s) against final artifact`
				});
				for (let c of n) {
					let n = z.recordNode({
						type: "error",
						featureId: e,
						causeId: a,
						artifactPath: c.artifactPath ?? r?.files[0] ?? null,
						bugClass: c.classKey,
						status: "open",
						summary: `terminal ${c.category}: ${c.message.split("\n")[0].slice(0, 160)}`
					});
					o.observeAuthoritativeFinding({
						featureId: c.featureId,
						caseId: c.caseId,
						classKey: c.classKey,
						category: c.category,
						artifactPath: c.artifactPath ?? null,
						expected: c.expected ?? null,
						received: c.received ?? null,
						crashSignature: c.crashSignature ?? null,
						message: c.message,
						measurementId: i,
						resultNodeId: a,
						errorNodeId: n,
						actionId: t
					}), s.push(c.canonicalKey);
				}
			}
			let c = o.reconcileTerminalMeasurement({
				presentKeys: s,
				confirmingMeasurementId: i,
				confirmingResultNodeId: "terminal",
				actionId: t
			});
			for (let e of c) z.recordNode({
				type: "resolution",
				causeId: e.causeErrorNodeId,
				status: "pass",
				summary: `terminal resolution: defect ${e.defectId} (${e.resolutionId})`
			});
			ht = {
				artifactCertified: n.artifactCertified,
				unresolved: n.unresolved,
				gateInfrastructureUnavailable: n.gateInfrastructureUnavailable
			}, a.finishAction({
				actionId: t,
				disposition: n.artifactCertified ? "applied" : "rejected",
				endEvidence: {
					artifactCertified: n.artifactCertified,
					unresolvedCount: n.unresolved.length,
					findings: n.findings.length,
					terminalResolutions: c.length
				}
			});
		} catch (e) {
			a.finishAction({
				actionId: t,
				disposition: "failed",
				failureMode: "fatal",
				error: e
			}), L("done", null, `artifact certification could not run: ${(e instanceof Error ? e.message : String(e)).slice(0, 200)}`);
		}
	}
	try {
		o.assertInvariants();
	} catch (e) {
		L("done", null, `defect registry invariant violation: ${e instanceof Error ? e.message : String(e)}`);
	}
	try {
		a.assertConserved();
	} catch (e) {
		L("done", null, `action ledger conservation violation: ${e instanceof Error ? e.message : String(e)}`);
	}
	s();
	let gt = (ht?.artifactCertified ?? !1) && o.metrics().uniqueDefectsUnresolved === 0 && a.metrics().actionPending === 0 && !0;
	if (ht) {
		ht = {
			...ht,
			artifactCertified: gt
		};
		let e = ht.unresolved ?? [];
		if (gt) L("done", null, `artifact-certified: ${Me.length} suite(s) re-verified against final artifact`);
		else {
			let t = [];
			e.length > 0 && t.push(`${e.length} unresolved`);
			let n = o.metrics().uniqueDefectsUnresolved;
			n > 0 && t.push(`${n} open defect(s)`);
			let r = a.metrics().actionPending;
			r > 0 && t.push(`${r} pending action(s)`), L("done", null, `artifact-uncertified${t.length ? ` (${t.join("; ")})` : ""} (SET 89D)`);
			for (let t of e.slice(0, 12)) L("done", null, `  uncertified: ${t.slice(0, 200)}`);
		}
	}
	return z.recordNode({
		type: "decision",
		status: J.length ? "open" : "pass",
		summary: `run complete: ${st.length} files, ${Me.length} suites frozen, ${J.length} problems`
	}), {
		spec: q,
		files: st,
		frozenTests: Me,
		problems: J,
		metrics: i,
		log: m,
		provenance: p,
		contractVersion: e.contractVersion,
		deferred: g,
		evidence: w,
		supergit: {
			rows: z.allRows(),
			csv: z.toCsv(),
			graph: z.toGraph()
		},
		...ht ? { artifactCertification: ht } : {},
		defectRegistry: o.snapshot(),
		actionLedger: a.snapshot()
	};
}
//#endregion
//#region src/tier1/corpus.ts
var Fv = "https://rha.software/corpus/v1";
async function Iv(e) {
	let t = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(e));
	return [...new Uint8Array(t)].map((e) => e.toString(16).padStart(2, "0")).join("");
}
async function Lv(e = Fv, t = fetch) {
	let n = e.replace(/\/$/, ""), r = async (e) => {
		let r = await t(`${n}/${e}`);
		if (!r.ok) throw Error(`corpus fetch ${e}: HTTP ${r.status}`);
		return r.text();
	}, i = JSON.parse(await r("manifest.json"));
	if (i.corpusVersion !== 1) throw Error(`unsupported corpusVersion ${i.corpusVersion} (runner speaks v1)`);
	let a = {};
	for (let e of i.files) {
		let t = await r(e.name), n = await Iv(t);
		if (n !== e.sha256) throw Error(`corpus integrity failure: ${e.name} sha256 ${n} != manifest ${e.sha256}`);
		a[e.name] = t;
	}
	return {
		manifest: i,
		prompts: JSON.parse(a["prompts.json"] ?? "{}").stages ?? {},
		gates: JSON.parse(a["gates.json"] ?? "{}"),
		lessons: JSON.parse(a["lessons.json"] ?? "{}").lessons ?? []
	};
}
//#endregion
//#region node_modules/async-lock/lib/index.js
var Rv = /* @__PURE__ */ o(((e, t) => {
	var n = function(e) {
		if (e ||= {}, this.Promise = e.Promise || Promise, this.queues = Object.create(null), this.domainReentrant = e.domainReentrant || !1, this.domainReentrant) {
			if (typeof process > "u" || process.domain === void 0) throw Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");
			this.domains = Object.create(null);
		}
		this.timeout = e.timeout || n.DEFAULT_TIMEOUT, this.maxOccupationTime = e.maxOccupationTime || n.DEFAULT_MAX_OCCUPATION_TIME, this.maxExecutionTime = e.maxExecutionTime || n.DEFAULT_MAX_EXECUTION_TIME, e.maxPending === Infinity || Number.isInteger(e.maxPending) && e.maxPending >= 0 ? this.maxPending = e.maxPending : this.maxPending = n.DEFAULT_MAX_PENDING;
	};
	n.DEFAULT_TIMEOUT = 0, n.DEFAULT_MAX_OCCUPATION_TIME = 0, n.DEFAULT_MAX_EXECUTION_TIME = 0, n.DEFAULT_MAX_PENDING = 1e3, n.prototype.acquire = function(e, t, n, r) {
		if (Array.isArray(e)) return this._acquireBatch(e, t, n, r);
		if (typeof t != "function") throw Error("You must pass a function to execute");
		var i = null, a = null, o = null;
		typeof n != "function" && (r = n, n = null, o = new this.Promise(function(e, t) {
			i = e, a = t;
		})), r ||= {};
		var s = !1, c = null, l = null, u = null, d = this, f = function(t, r, c) {
			l &&= (clearTimeout(l), null), u &&= (clearTimeout(u), null), t && (d.queues[e] && d.queues[e].length === 0 && delete d.queues[e], d.domainReentrant && delete d.domains[e]), s ||= (o ? r ? a(r) : i(c) : typeof n == "function" && n(r, c), !0), t && d.queues[e] && d.queues[e].length > 0 && d.queues[e].shift()();
		}, p = function(n) {
			if (s) return f(n);
			c &&= (clearTimeout(c), null), d.domainReentrant && n && (d.domains[e] = process.domain);
			var i = r.maxExecutionTime || d.maxExecutionTime;
			if (i && (u = setTimeout(function() {
				d.queues[e] && f(n, /* @__PURE__ */ Error("Maximum execution time is exceeded " + e));
			}, i)), t.length === 1) {
				var a = !1;
				try {
					t(function(e, t) {
						a || (a = !0, f(n, e, t));
					});
				} catch (e) {
					a || (a = !0, f(n, e));
				}
			} else d._promiseTry(function() {
				return t();
			}).then(function(e) {
				f(n, void 0, e);
			}, function(e) {
				f(n, e);
			});
		};
		d.domainReentrant && process.domain && (p = process.domain.bind(p));
		var m = r.maxPending || d.maxPending;
		if (!d.queues[e]) d.queues[e] = [], p(!0);
		else if (d.domainReentrant && process.domain && process.domain === d.domains[e]) p(!1);
		else if (d.queues[e].length >= m) f(!1, /* @__PURE__ */ Error("Too many pending tasks in queue " + e));
		else {
			var h = function() {
				p(!0);
			};
			r.skipQueue ? d.queues[e].unshift(h) : d.queues[e].push(h);
			var g = r.timeout || d.timeout;
			g && (c = setTimeout(function() {
				c = null, f(!1, /* @__PURE__ */ Error("async-lock timed out in queue " + e));
			}, g));
		}
		var _ = r.maxOccupationTime || d.maxOccupationTime;
		if (_ && (l = setTimeout(function() {
			d.queues[e] && f(!1, /* @__PURE__ */ Error("Maximum occupation time is exceeded in queue " + e));
		}, _)), o) return o;
	}, n.prototype._acquireBatch = function(e, t, n, r) {
		typeof n != "function" && (r = n, n = null);
		var i = this, a = function(e, t) {
			return function(n) {
				i.acquire(e, t, n, r);
			};
		}, o = e.reduceRight(function(e, t) {
			return a(t, e);
		}, t);
		if (typeof n == "function") o(n);
		else return new this.Promise(function(e, t) {
			o.length === 1 ? o(function(n, r) {
				n ? t(n) : e(r);
			}) : e(o());
		});
	}, n.prototype.isBusy = function(e) {
		return e ? !!this.queues[e] : Object.keys(this.queues).length > 0;
	}, n.prototype._promiseTry = function(e) {
		try {
			return this.Promise.resolve(e());
		} catch (e) {
			return this.Promise.reject(e);
		}
	}, t.exports = n;
})), zv = /* @__PURE__ */ o(((e, t) => {
	t.exports = Rv();
})), Bv = /* @__PURE__ */ o(((e, t) => {
	typeof Object.create == "function" ? t.exports = function(e, t) {
		t && (e.super_ = t, e.prototype = Object.create(t.prototype, { constructor: {
			value: e,
			enumerable: !1,
			writable: !0,
			configurable: !0
		} }));
	} : t.exports = function(e, t) {
		if (t) {
			e.super_ = t;
			var n = function() {};
			n.prototype = t.prototype, e.prototype = new n(), e.prototype.constructor = e;
		}
	};
})), Vv = /* @__PURE__ */ o(((e, t) => {
	var n = f(), r = n.Buffer;
	function i(e, t) {
		for (var n in e) t[n] = e[n];
	}
	r.from && r.alloc && r.allocUnsafe && r.allocUnsafeSlow ? t.exports = n : (i(n, e), e.Buffer = a);
	function a(e, t, n) {
		return r(e, t, n);
	}
	a.prototype = Object.create(r.prototype), i(r, a), a.from = function(e, t, n) {
		if (typeof e == "number") throw TypeError("Argument must not be a number");
		return r(e, t, n);
	}, a.alloc = function(e, t, n) {
		if (typeof e != "number") throw TypeError("Argument must be a number");
		var i = r(e);
		return t === void 0 ? i.fill(0) : typeof n == "string" ? i.fill(t, n) : i.fill(t), i;
	}, a.allocUnsafe = function(e) {
		if (typeof e != "number") throw TypeError("Argument must be a number");
		return r(e);
	}, a.allocUnsafeSlow = function(e) {
		if (typeof e != "number") throw TypeError("Argument must be a number");
		return n.SlowBuffer(e);
	};
})), Hv = /* @__PURE__ */ o(((e, t) => {
	var n = {}.toString;
	t.exports = Array.isArray || function(e) {
		return n.call(e) == "[object Array]";
	};
})), Uv = /* @__PURE__ */ o(((e, t) => {
	t.exports = TypeError;
})), Wv = /* @__PURE__ */ o(((e, t) => {
	t.exports = Object;
})), Gv = /* @__PURE__ */ o(((e, t) => {
	t.exports = Error;
})), Kv = /* @__PURE__ */ o(((e, t) => {
	t.exports = EvalError;
})), qv = /* @__PURE__ */ o(((e, t) => {
	t.exports = RangeError;
})), Jv = /* @__PURE__ */ o(((e, t) => {
	t.exports = ReferenceError;
})), Yv = /* @__PURE__ */ o(((e, t) => {
	t.exports = SyntaxError;
})), Xv = /* @__PURE__ */ o(((e, t) => {
	t.exports = URIError;
})), Zv = /* @__PURE__ */ o(((e, t) => {
	t.exports = Math.abs;
})), Qv = /* @__PURE__ */ o(((e, t) => {
	t.exports = Math.floor;
})), $v = /* @__PURE__ */ o(((e, t) => {
	t.exports = Math.max;
})), ey = /* @__PURE__ */ o(((e, t) => {
	t.exports = Math.min;
})), ty = /* @__PURE__ */ o(((e, t) => {
	t.exports = Math.pow;
})), ny = /* @__PURE__ */ o(((e, t) => {
	t.exports = Math.round;
})), ry = /* @__PURE__ */ o(((e, t) => {
	t.exports = Number.isNaN || function(e) {
		return e !== e;
	};
})), iy = /* @__PURE__ */ o(((e, t) => {
	var n = ry();
	t.exports = function(e) {
		return n(e) || e === 0 ? e : e < 0 ? -1 : 1;
	};
})), ay = /* @__PURE__ */ o(((e, t) => {
	t.exports = Object.getOwnPropertyDescriptor;
})), oy = /* @__PURE__ */ o(((e, t) => {
	var n = ay();
	if (n) try {
		n([], "length");
	} catch {
		n = null;
	}
	t.exports = n;
})), sy = /* @__PURE__ */ o(((e, t) => {
	var n = Object.defineProperty || !1;
	if (n) try {
		n({}, "a", { value: 1 });
	} catch {
		n = !1;
	}
	t.exports = n;
})), cy = /* @__PURE__ */ o(((e, t) => {
	t.exports = function() {
		if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function") return !1;
		if (typeof Symbol.iterator == "symbol") return !0;
		var e = {}, t = Symbol("test"), n = Object(t);
		if (typeof t == "string" || Object.prototype.toString.call(t) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]") return !1;
		var r = 42;
		for (var i in e[t] = r, e) return !1;
		if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0) return !1;
		var a = Object.getOwnPropertySymbols(e);
		if (a.length !== 1 || a[0] !== t || !Object.prototype.propertyIsEnumerable.call(e, t)) return !1;
		if (typeof Object.getOwnPropertyDescriptor == "function") {
			var o = Object.getOwnPropertyDescriptor(e, t);
			if (o.value !== r || o.enumerable !== !0) return !1;
		}
		return !0;
	};
})), ly = /* @__PURE__ */ o(((e, t) => {
	var n = typeof Symbol < "u" && Symbol, r = cy();
	t.exports = function() {
		return typeof n != "function" || typeof Symbol != "function" || typeof n("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : r();
	};
})), uy = /* @__PURE__ */ o(((e, t) => {
	t.exports = typeof Reflect < "u" && Reflect.getPrototypeOf || null;
})), dy = /* @__PURE__ */ o(((e, t) => {
	t.exports = Wv().getPrototypeOf || null;
})), fy = /* @__PURE__ */ o(((e, t) => {
	var n = Object.prototype.toString, r = Math.max, i = "[object Function]", a = function(e, t) {
		for (var n = [], r = 0; r < e.length; r += 1) n[r] = e[r];
		for (var i = 0; i < t.length; i += 1) n[i + e.length] = t[i];
		return n;
	}, o = function(e, t) {
		for (var n = [], r = t || 0, i = 0; r < e.length; r += 1, i += 1) n[i] = e[r];
		return n;
	}, s = function(e, t) {
		for (var n = "", r = 0; r < e.length; r += 1) n += e[r], r + 1 < e.length && (n += t);
		return n;
	};
	t.exports = function(e) {
		var t = this;
		if (typeof t != "function" || n.apply(t) !== i) throw TypeError("Function.prototype.bind called on incompatible " + t);
		for (var c = o(arguments, 1), l, u = function() {
			if (this instanceof l) {
				var n = t.apply(this, a(c, arguments));
				return Object(n) === n ? n : this;
			}
			return t.apply(e, a(c, arguments));
		}, d = r(0, t.length - c.length), f = [], p = 0; p < d; p++) f[p] = "$" + p;
		if (l = Function("binder", "return function (" + s(f, ",") + "){ return binder.apply(this,arguments); }")(u), t.prototype) {
			var m = function() {};
			m.prototype = t.prototype, l.prototype = new m(), m.prototype = null;
		}
		return l;
	};
})), py = /* @__PURE__ */ o(((e, t) => {
	var n = fy();
	t.exports = Function.prototype.bind || n;
})), my = /* @__PURE__ */ o(((e, t) => {
	t.exports = Function.prototype.call;
})), hy = /* @__PURE__ */ o(((e, t) => {
	t.exports = Function.prototype.apply;
})), gy = /* @__PURE__ */ o(((e, t) => {
	t.exports = typeof Reflect < "u" && Reflect && Reflect.apply;
})), _y = /* @__PURE__ */ o(((e, t) => {
	var n = py(), r = hy(), i = my();
	t.exports = gy() || n.call(i, r);
})), vy = /* @__PURE__ */ o(((e, t) => {
	var n = py(), r = Uv(), i = my(), a = _y();
	t.exports = function(e) {
		if (e.length < 1 || typeof e[0] != "function") throw new r("a function is required");
		return a(n, i, e);
	};
})), yy = /* @__PURE__ */ o(((e, t) => {
	var n = vy(), r = oy(), i;
	try {
		i = [].__proto__ === Array.prototype;
	} catch (e) {
		if (!e || typeof e != "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") throw e;
	}
	var a = !!i && r && r(Object.prototype, "__proto__"), o = Object, s = o.getPrototypeOf;
	t.exports = a && typeof a.get == "function" ? n([a.get]) : typeof s == "function" && function(e) {
		return s(e == null ? e : o(e));
	};
})), by = /* @__PURE__ */ o(((e, t) => {
	var n = uy(), r = dy(), i = yy();
	t.exports = n ? function(e) {
		return n(e);
	} : r ? function(e) {
		if (!e || typeof e != "object" && typeof e != "function") throw TypeError("getProto: not an object");
		return r(e);
	} : i ? function(e) {
		return i(e);
	} : null;
})), xy = /* @__PURE__ */ o(((e, t) => {
	var n = Function.prototype.call, r = Object.prototype.hasOwnProperty;
	t.exports = py().call(n, r);
})), Sy = /* @__PURE__ */ o(((e, t) => {
	var n, r = Wv(), i = Gv(), a = Kv(), o = qv(), s = Jv(), c = Yv(), l = Uv(), u = Xv(), d = Zv(), f = Qv(), p = $v(), m = ey(), h = ty(), g = ny(), _ = iy(), v = Function, y = function(e) {
		try {
			return v("\"use strict\"; return (" + e + ").constructor;")();
		} catch {}
	}, b = oy(), x = sy(), S = function() {
		throw new l();
	}, C = b ? function() {
		try {
			return arguments.callee, S;
		} catch {
			try {
				return b(arguments, "callee").get;
			} catch {
				return S;
			}
		}
	}() : S, w = ly()(), T = by(), E = dy(), ee = uy(), te = hy(), ne = my(), D = {}, O = typeof Uint8Array > "u" || !T ? n : T(Uint8Array), k = {
		__proto__: null,
		"%AggregateError%": typeof AggregateError > "u" ? n : AggregateError,
		"%Array%": Array,
		"%ArrayBuffer%": typeof ArrayBuffer > "u" ? n : ArrayBuffer,
		"%ArrayIteratorPrototype%": w && T ? T([][Symbol.iterator]()) : n,
		"%AsyncFromSyncIteratorPrototype%": n,
		"%AsyncFunction%": D,
		"%AsyncGenerator%": D,
		"%AsyncGeneratorFunction%": D,
		"%AsyncIteratorPrototype%": D,
		"%Atomics%": typeof Atomics > "u" ? n : Atomics,
		"%BigInt%": typeof BigInt > "u" ? n : BigInt,
		"%BigInt64Array%": typeof BigInt64Array > "u" ? n : BigInt64Array,
		"%BigUint64Array%": typeof BigUint64Array > "u" ? n : BigUint64Array,
		"%Boolean%": Boolean,
		"%DataView%": typeof DataView > "u" ? n : DataView,
		"%Date%": Date,
		"%decodeURI%": decodeURI,
		"%decodeURIComponent%": decodeURIComponent,
		"%encodeURI%": encodeURI,
		"%encodeURIComponent%": encodeURIComponent,
		"%Error%": i,
		"%eval%": eval,
		"%EvalError%": a,
		"%Float16Array%": typeof Float16Array > "u" ? n : Float16Array,
		"%Float32Array%": typeof Float32Array > "u" ? n : Float32Array,
		"%Float64Array%": typeof Float64Array > "u" ? n : Float64Array,
		"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? n : FinalizationRegistry,
		"%Function%": v,
		"%GeneratorFunction%": D,
		"%Int8Array%": typeof Int8Array > "u" ? n : Int8Array,
		"%Int16Array%": typeof Int16Array > "u" ? n : Int16Array,
		"%Int32Array%": typeof Int32Array > "u" ? n : Int32Array,
		"%isFinite%": isFinite,
		"%isNaN%": isNaN,
		"%IteratorPrototype%": w && T ? T(T([][Symbol.iterator]())) : n,
		"%JSON%": typeof JSON == "object" ? JSON : n,
		"%Map%": typeof Map > "u" ? n : Map,
		"%MapIteratorPrototype%": typeof Map > "u" || !w || !T ? n : T((/* @__PURE__ */ new Map())[Symbol.iterator]()),
		"%Math%": Math,
		"%Number%": Number,
		"%Object%": r,
		"%Object.getOwnPropertyDescriptor%": b,
		"%parseFloat%": parseFloat,
		"%parseInt%": parseInt,
		"%Promise%": typeof Promise > "u" ? n : Promise,
		"%Proxy%": typeof Proxy > "u" ? n : Proxy,
		"%RangeError%": o,
		"%ReferenceError%": s,
		"%Reflect%": typeof Reflect > "u" ? n : Reflect,
		"%RegExp%": RegExp,
		"%Set%": typeof Set > "u" ? n : Set,
		"%SetIteratorPrototype%": typeof Set > "u" || !w || !T ? n : T((/* @__PURE__ */ new Set())[Symbol.iterator]()),
		"%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? n : SharedArrayBuffer,
		"%String%": String,
		"%StringIteratorPrototype%": w && T ? T(""[Symbol.iterator]()) : n,
		"%Symbol%": w ? Symbol : n,
		"%SyntaxError%": c,
		"%ThrowTypeError%": C,
		"%TypedArray%": O,
		"%TypeError%": l,
		"%Uint8Array%": typeof Uint8Array > "u" ? n : Uint8Array,
		"%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? n : Uint8ClampedArray,
		"%Uint16Array%": typeof Uint16Array > "u" ? n : Uint16Array,
		"%Uint32Array%": typeof Uint32Array > "u" ? n : Uint32Array,
		"%URIError%": u,
		"%WeakMap%": typeof WeakMap > "u" ? n : WeakMap,
		"%WeakRef%": typeof WeakRef > "u" ? n : WeakRef,
		"%WeakSet%": typeof WeakSet > "u" ? n : WeakSet,
		"%Function.prototype.call%": ne,
		"%Function.prototype.apply%": te,
		"%Object.defineProperty%": x,
		"%Object.getPrototypeOf%": E,
		"%Math.abs%": d,
		"%Math.floor%": f,
		"%Math.max%": p,
		"%Math.min%": m,
		"%Math.pow%": h,
		"%Math.round%": g,
		"%Math.sign%": _,
		"%Reflect.getPrototypeOf%": ee
	};
	if (T) try {
		null.error;
	} catch (e) {
		k["%Error.prototype%"] = T(T(e));
	}
	var A = function e(t) {
		var n;
		if (t === "%AsyncFunction%") n = y("async function () {}");
		else if (t === "%GeneratorFunction%") n = y("function* () {}");
		else if (t === "%AsyncGeneratorFunction%") n = y("async function* () {}");
		else if (t === "%AsyncGenerator%") {
			var r = e("%AsyncGeneratorFunction%");
			r && (n = r.prototype);
		} else if (t === "%AsyncIteratorPrototype%") {
			var i = e("%AsyncGenerator%");
			i && T && (n = T(i.prototype));
		}
		return k[t] = n, n;
	}, j = {
		__proto__: null,
		"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
		"%ArrayPrototype%": ["Array", "prototype"],
		"%ArrayProto_entries%": [
			"Array",
			"prototype",
			"entries"
		],
		"%ArrayProto_forEach%": [
			"Array",
			"prototype",
			"forEach"
		],
		"%ArrayProto_keys%": [
			"Array",
			"prototype",
			"keys"
		],
		"%ArrayProto_values%": [
			"Array",
			"prototype",
			"values"
		],
		"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
		"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
		"%AsyncGeneratorPrototype%": [
			"AsyncGeneratorFunction",
			"prototype",
			"prototype"
		],
		"%BooleanPrototype%": ["Boolean", "prototype"],
		"%DataViewPrototype%": ["DataView", "prototype"],
		"%DatePrototype%": ["Date", "prototype"],
		"%ErrorPrototype%": ["Error", "prototype"],
		"%EvalErrorPrototype%": ["EvalError", "prototype"],
		"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
		"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
		"%FunctionPrototype%": ["Function", "prototype"],
		"%Generator%": ["GeneratorFunction", "prototype"],
		"%GeneratorPrototype%": [
			"GeneratorFunction",
			"prototype",
			"prototype"
		],
		"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
		"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
		"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
		"%JSONParse%": ["JSON", "parse"],
		"%JSONStringify%": ["JSON", "stringify"],
		"%MapPrototype%": ["Map", "prototype"],
		"%NumberPrototype%": ["Number", "prototype"],
		"%ObjectPrototype%": ["Object", "prototype"],
		"%ObjProto_toString%": [
			"Object",
			"prototype",
			"toString"
		],
		"%ObjProto_valueOf%": [
			"Object",
			"prototype",
			"valueOf"
		],
		"%PromisePrototype%": ["Promise", "prototype"],
		"%PromiseProto_then%": [
			"Promise",
			"prototype",
			"then"
		],
		"%Promise_all%": ["Promise", "all"],
		"%Promise_reject%": ["Promise", "reject"],
		"%Promise_resolve%": ["Promise", "resolve"],
		"%RangeErrorPrototype%": ["RangeError", "prototype"],
		"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
		"%RegExpPrototype%": ["RegExp", "prototype"],
		"%SetPrototype%": ["Set", "prototype"],
		"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
		"%StringPrototype%": ["String", "prototype"],
		"%SymbolPrototype%": ["Symbol", "prototype"],
		"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
		"%TypedArrayPrototype%": ["TypedArray", "prototype"],
		"%TypeErrorPrototype%": ["TypeError", "prototype"],
		"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
		"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
		"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
		"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
		"%URIErrorPrototype%": ["URIError", "prototype"],
		"%WeakMapPrototype%": ["WeakMap", "prototype"],
		"%WeakSetPrototype%": ["WeakSet", "prototype"]
	}, re = py(), ie = xy(), ae = re.call(ne, Array.prototype.concat), oe = re.call(te, Array.prototype.splice), M = re.call(ne, String.prototype.replace), se = re.call(ne, String.prototype.slice), N = re.call(ne, RegExp.prototype.exec), ce = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, P = /\\(\\)?/g, F = function(e) {
		var t = se(e, 0, 1), n = se(e, -1);
		if (t === "%" && n !== "%") throw new c("invalid intrinsic syntax, expected closing `%`");
		if (n === "%" && t !== "%") throw new c("invalid intrinsic syntax, expected opening `%`");
		var r = [];
		return M(e, ce, function(e, t, n, i) {
			r[r.length] = n ? M(i, P, "$1") : t || e;
		}), r;
	}, I = function(e, t) {
		var n = e, r;
		if (ie(j, n) && (r = j[n], n = "%" + r[0] + "%"), ie(k, n)) {
			var i = k[n];
			if (i === D && (i = A(n)), i === void 0 && !t) throw new l("intrinsic " + e + " exists, but is not available. Please file an issue!");
			return {
				alias: r,
				name: n,
				value: i
			};
		}
		throw new c("intrinsic " + e + " does not exist!");
	};
	t.exports = function(e, t) {
		if (typeof e != "string" || e.length === 0) throw new l("intrinsic name must be a non-empty string");
		if (arguments.length > 1 && typeof t != "boolean") throw new l("\"allowMissing\" argument must be a boolean");
		if (N(/^%?[^%]*%?$/, e) === null) throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
		var n = F(e), r = n.length > 0 ? n[0] : "", i = I("%" + r + "%", t), a = i.name, o = i.value, s = !1, u = i.alias;
		u && (r = u[0], oe(n, ae([0, 1], u)));
		for (var d = 1, f = !0; d < n.length; d += 1) {
			var p = n[d], m = se(p, 0, 1), h = se(p, -1);
			if ((m === "\"" || m === "'" || m === "`" || h === "\"" || h === "'" || h === "`") && m !== h) throw new c("property names with quotes must have matching quotes");
			if ((p === "constructor" || !f) && (s = !0), r += "." + p, a = "%" + r + "%", ie(k, a)) o = k[a];
			else if (o != null) {
				if (!(p in o)) {
					if (!t) throw new l("base intrinsic for " + e + " exists, but the property is not available.");
					return;
				}
				if (b && d + 1 >= n.length) {
					var g = b(o, p);
					f = !!g, o = f && "get" in g && !("originalValue" in g.get) ? g.get : o[p];
				} else f = ie(o, p), o = o[p];
				f && !s && (k[a] = o);
			}
		}
		return o;
	};
})), Cy = /* @__PURE__ */ o(((e, t) => {
	var n = Sy(), r = vy(), i = r([n("%String.prototype.indexOf%")]);
	t.exports = function(e, t) {
		var a = n(e, !!t);
		return typeof a == "function" && i(e, ".prototype.") > -1 ? r([a]) : a;
	};
})), wy = /* @__PURE__ */ o(((e, t) => {
	var n = Function.prototype.toString, r = typeof Reflect == "object" && Reflect !== null && Reflect.apply, i, a;
	if (typeof r == "function" && typeof Object.defineProperty == "function") try {
		i = Object.defineProperty({}, "length", { get: function() {
			throw a;
		} }), a = {}, r(function() {
			throw 42;
		}, null, i);
	} catch (e) {
		e !== a && (r = null);
	}
	else r = null;
	var o = /^\s*class\b/, s = function(e) {
		try {
			var t = n.call(e);
			return o.test(t);
		} catch {
			return !1;
		}
	}, c = function(e) {
		try {
			return s(e) ? !1 : (n.call(e), !0);
		} catch {
			return !1;
		}
	}, l = Object.prototype.toString, u = "[object Object]", d = "[object Function]", f = "[object GeneratorFunction]", p = "[object HTMLAllCollection]", m = "[object HTML document.all class]", h = "[object HTMLCollection]", g = typeof Symbol == "function" && !!Symbol.toStringTag, _ = !(0 in [,]), v = function() {
		return !1;
	};
	if (typeof document == "object") {
		var y = document.all;
		l.call(y) === l.call(document.all) && (v = function(e) {
			if ((_ || !e) && (e === void 0 || typeof e == "object")) try {
				var t = l.call(e);
				return (t === p || t === m || t === h || t === u) && e("") == null;
			} catch {}
			return !1;
		});
	}
	t.exports = r ? function(e) {
		if (v(e)) return !0;
		if (!e || typeof e != "function" && typeof e != "object") return !1;
		try {
			r(e, null, i);
		} catch (e) {
			if (e !== a) return !1;
		}
		return !s(e) && c(e);
	} : function(e) {
		if (v(e)) return !0;
		if (!e || typeof e != "function" && typeof e != "object") return !1;
		if (g) return c(e);
		if (s(e)) return !1;
		var t = l.call(e);
		return t !== d && t !== f && !/^\[object HTML/.test(t) ? !1 : c(e);
	};
})), Ty = /* @__PURE__ */ o(((e, t) => {
	var n = wy(), r = Object.prototype.toString, i = Object.prototype.hasOwnProperty, a = function(e, t, n) {
		for (var r = 0, a = e.length; r < a; r++) i.call(e, r) && (n == null ? t(e[r], r, e) : t.call(n, e[r], r, e));
	}, o = function(e, t, n) {
		for (var r = 0, i = e.length; r < i; r++) n == null ? t(e.charAt(r), r, e) : t.call(n, e.charAt(r), r, e);
	}, s = function(e, t, n) {
		for (var r in e) i.call(e, r) && (n == null ? t(e[r], r, e) : t.call(n, e[r], r, e));
	};
	function c(e) {
		return r.call(e) === "[object Array]";
	}
	t.exports = function(e, t, r) {
		if (!n(t)) throw TypeError("iterator must be a function");
		var i;
		arguments.length >= 3 && (i = r), c(e) ? a(e, t, i) : typeof e == "string" ? o(e, t, i) : s(e, t, i);
	};
})), Ey = /* @__PURE__ */ o(((e, t) => {
	t.exports = [
		"Float16Array",
		"Float32Array",
		"Float64Array",
		"Int8Array",
		"Int16Array",
		"Int32Array",
		"Uint8Array",
		"Uint8ClampedArray",
		"Uint16Array",
		"Uint32Array",
		"BigInt64Array",
		"BigUint64Array"
	];
})), Dy = /* @__PURE__ */ o(((e, t) => {
	var n = Ey(), r = typeof globalThis > "u" ? global : globalThis;
	t.exports = function() {
		for (var e = [], t = 0; t < n.length; t++) typeof r[n[t]] == "function" && (e[e.length] = n[t]);
		return e;
	};
})), Oy = /* @__PURE__ */ o(((e, t) => {
	var n = sy(), r = Yv(), i = Uv(), a = oy();
	t.exports = function(e, t, o) {
		if (!e || typeof e != "object" && typeof e != "function") throw new i("`obj` must be an object or a function`");
		if (typeof t != "string" && typeof t != "symbol") throw new i("`property` must be a string or a symbol`");
		if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null) throw new i("`nonEnumerable`, if provided, must be a boolean or null");
		if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null) throw new i("`nonWritable`, if provided, must be a boolean or null");
		if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null) throw new i("`nonConfigurable`, if provided, must be a boolean or null");
		if (arguments.length > 6 && typeof arguments[6] != "boolean") throw new i("`loose`, if provided, must be a boolean");
		var s = arguments.length > 3 ? arguments[3] : null, c = arguments.length > 4 ? arguments[4] : null, l = arguments.length > 5 ? arguments[5] : null, u = arguments.length > 6 && arguments[6], d = !!a && a(e, t);
		if (n) n(e, t, {
			configurable: l === null && d ? d.configurable : !l,
			enumerable: s === null && d ? d.enumerable : !s,
			value: o,
			writable: c === null && d ? d.writable : !c
		});
		else if (u || !s && !c && !l) e[t] = o;
		else throw new r("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
	};
})), ky = /* @__PURE__ */ o(((e, t) => {
	var n = sy(), r = function() {
		return !!n;
	};
	r.hasArrayLengthDefineBug = function() {
		if (!n) return null;
		try {
			return n([], "length", { value: 1 }).length !== 1;
		} catch {
			return !0;
		}
	}, t.exports = r;
})), Ay = /* @__PURE__ */ o(((e, t) => {
	var n = Sy(), r = Oy(), i = ky()(), a = oy(), o = Uv(), s = n("%Math.floor%");
	t.exports = function(e, t) {
		if (typeof e != "function") throw new o("`fn` is not a function");
		if (typeof t != "number" || t < 0 || t > 4294967295 || s(t) !== t) throw new o("`length` must be a positive 32-bit integer");
		var n = arguments.length > 2 && !!arguments[2], c = !0, l = !0;
		if ("length" in e && a) {
			var u = a(e, "length");
			u && !u.configurable && (c = !1), u && !u.writable && (l = !1);
		}
		return (c || l || !n) && (i ? r(e, "length", t, !0, !0) : r(e, "length", t)), e;
	};
})), jy = /* @__PURE__ */ o(((e, t) => {
	var n = py(), r = hy(), i = _y();
	t.exports = function() {
		return i(n, r, arguments);
	};
})), My = /* @__PURE__ */ o(((e, t) => {
	var n = Ay(), r = sy(), i = vy(), a = jy();
	t.exports = function(e) {
		var t = i(arguments), r = 1 + e.length - (arguments.length - 1);
		return n(t, r > 0 ? r : 0, !0);
	}, r ? r(t.exports, "apply", { value: a }) : t.exports.apply = a;
})), Ny = /* @__PURE__ */ o(((e, t) => {
	var n = cy();
	t.exports = function() {
		return n() && !!Symbol.toStringTag;
	};
})), Py = /* @__PURE__ */ o(((e, t) => {
	var n = Ty(), r = Dy(), i = My(), a = Cy(), o = oy(), s = by(), c = a("Object.prototype.toString"), l = Ny()(), u = typeof globalThis > "u" ? global : globalThis, d = r(), f = a("String.prototype.slice"), p = a("Array.prototype.indexOf", !0) || function(e, t) {
		for (var n = 0; n < e.length; n += 1) if (e[n] === t) return n;
		return -1;
	}, m = { __proto__: null };
	l && o && s ? n(d, function(e) {
		var t = new u[e]();
		if (Symbol.toStringTag in t && s) {
			var n = s(t), r = o(n, Symbol.toStringTag);
			if (!r && n && (r = o(s(n), Symbol.toStringTag)), r && r.get) {
				var a = i(r.get);
				m["$" + e] = a;
			}
		}
	}) : n(d, function(e) {
		var t = new u[e](), n = t.slice || t.set;
		if (n) {
			var r = i(n);
			m["$" + e] = r;
		}
	});
	function h(e) {
		var t = !1;
		return n(m, function(n, r) {
			if (!t) try {
				"$" + n(e) === r && (t = f(r, 1));
			} catch {}
		}), t;
	}
	function g(e) {
		var t = !1;
		return n(m, function(n, r) {
			if (!t) try {
				n(e), t = f(r, 1);
			} catch {}
		}), t;
	}
	function _(e) {
		return p(d, e) > -1;
	}
	t.exports = function(e) {
		if (!e || typeof e != "object") return !1;
		if (!l) {
			var t = f(c(e), 8, -1);
			return _(t) ? t : t === "Object" && g(e);
		}
		return o ? h(e) : null;
	};
})), Fy = /* @__PURE__ */ o(((e, t) => {
	var n = Py();
	t.exports = function(e) {
		return !!n(e);
	};
})), Iy = /* @__PURE__ */ o(((e, t) => {
	var n = Uv(), r = Cy()("TypedArray.prototype.buffer", !0), i = Fy();
	t.exports = r || function(e) {
		if (!i(e)) throw new n("Not a Typed Array");
		return e.buffer;
	};
})), Ly = /* @__PURE__ */ o(((e, t) => {
	var n = Vv().Buffer, r = Hv(), i = Iy(), a = ArrayBuffer.isView || function(e) {
		try {
			return i(e), !0;
		} catch {
			return !1;
		}
	}, o = typeof Uint8Array < "u", s = typeof ArrayBuffer < "u" && typeof Uint8Array < "u", c = s && (n.prototype instanceof Uint8Array || n.TYPED_ARRAY_SUPPORT);
	t.exports = function(e, t) {
		if (n.isBuffer(e)) return e.constructor && !("isBuffer" in e) ? n.from(e) : e;
		if (typeof e == "string") return n.from(e, t);
		if (s && a(e)) {
			if (e.byteLength === 0) return n.alloc(0);
			if (c) {
				var i = n.from(e.buffer, e.byteOffset, e.byteLength);
				if (i.byteLength === e.byteLength) return i;
			}
			var l = e instanceof Uint8Array ? e : new Uint8Array(e.buffer, e.byteOffset, e.byteLength), u = n.from(l);
			if (u.length === e.byteLength) return u;
		}
		if (o && e instanceof Uint8Array) return n.from(e);
		var d = r(e);
		if (d) for (var f = 0; f < e.length; f += 1) {
			var p = e[f];
			if (typeof p != "number" || p < 0 || p > 255 || ~~p !== p) throw RangeError("Array items must be numbers in the range 0-255.");
		}
		if (d || n.isBuffer(e) && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e)) return n.from(e);
		throw TypeError("The \"data\" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.");
	};
})), Ry = /* @__PURE__ */ o(((e, t) => {
	var n = Vv().Buffer, r = Ly();
	function i(e, t) {
		this._block = n.alloc(e), this._finalSize = t, this._blockSize = e, this._len = 0;
	}
	i.prototype.update = function(e, t) {
		e = r(e, t || "utf8");
		for (var n = this._block, i = this._blockSize, a = e.length, o = this._len, s = 0; s < a;) {
			for (var c = o % i, l = Math.min(a - s, i - c), u = 0; u < l; u++) n[c + u] = e[s + u];
			o += l, s += l, o % i === 0 && this._update(n);
		}
		return this._len += a, this;
	}, i.prototype.digest = function(e) {
		var t = this._len % this._blockSize;
		this._block[t] = 128, this._block.fill(0, t + 1), t >= this._finalSize && (this._update(this._block), this._block.fill(0));
		var n = this._len * 8;
		if (n <= 4294967295) this._block.writeUInt32BE(n, this._blockSize - 4);
		else {
			var r = (n & 4294967295) >>> 0, i = (n - r) / 4294967296;
			this._block.writeUInt32BE(i, this._blockSize - 8), this._block.writeUInt32BE(r, this._blockSize - 4);
		}
		this._update(this._block);
		var a = this._hash();
		return e ? a.toString(e) : a;
	}, i.prototype._update = function() {
		throw Error("_update must be implemented by subclass");
	}, t.exports = i;
})), zy = /* @__PURE__ */ o(((e, t) => {
	var n = Bv(), r = Ry(), i = Vv().Buffer, a = [
		1518500249,
		1859775393,
		-1894007588,
		-899497514
	], o = Array(80);
	function s() {
		this.init(), this._w = o, r.call(this, 64, 56);
	}
	n(s, r), s.prototype.init = function() {
		return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
	};
	function c(e) {
		return e << 1 | e >>> 31;
	}
	function l(e) {
		return e << 5 | e >>> 27;
	}
	function u(e) {
		return e << 30 | e >>> 2;
	}
	function d(e, t, n, r) {
		return e === 0 ? t & n | ~t & r : e === 2 ? t & n | t & r | n & r : t ^ n ^ r;
	}
	s.prototype._update = function(e) {
		for (var t = this._w, n = this._a | 0, r = this._b | 0, i = this._c | 0, o = this._d | 0, s = this._e | 0, f = 0; f < 16; ++f) t[f] = e.readInt32BE(f * 4);
		for (; f < 80; ++f) t[f] = c(t[f - 3] ^ t[f - 8] ^ t[f - 14] ^ t[f - 16]);
		for (var p = 0; p < 80; ++p) {
			var m = ~~(p / 20), h = l(n) + d(m, r, i, o) + s + t[p] + a[m] | 0;
			s = o, o = i, i = u(r), r = n, n = h;
		}
		this._a = n + this._a | 0, this._b = r + this._b | 0, this._c = i + this._c | 0, this._d = o + this._d | 0, this._e = s + this._e | 0;
	}, s.prototype._hash = function() {
		var e = i.allocUnsafe(20);
		return e.writeInt32BE(this._a | 0, 0), e.writeInt32BE(this._b | 0, 4), e.writeInt32BE(this._c | 0, 8), e.writeInt32BE(this._d | 0, 12), e.writeInt32BE(this._e | 0, 16), e;
	}, t.exports = s;
})), By = /* @__PURE__ */ o(((e) => {
	(function(t) {
		typeof DO_NOT_EXPORT_CRC > "u" ? typeof e == "object" ? t(e) : typeof define == "function" && define.amd ? define(function() {
			var e = {};
			return t(e), e;
		}) : t({}) : t({});
	})(function(e) {
		e.version = "1.2.2";
		function t() {
			for (var e = 0, t = Array(256), n = 0; n != 256; ++n) e = n, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, t[n] = e;
			return typeof Int32Array < "u" ? new Int32Array(t) : t;
		}
		var n = t();
		function r(e) {
			var t = 0, n = 0, r = 0, i = typeof Int32Array < "u" ? /* @__PURE__ */ new Int32Array(4096) : Array(4096);
			for (r = 0; r != 256; ++r) i[r] = e[r];
			for (r = 0; r != 256; ++r) for (n = e[r], t = 256 + r; t < 4096; t += 256) n = i[t] = n >>> 8 ^ e[n & 255];
			var a = [];
			for (r = 1; r != 16; ++r) a[r - 1] = typeof Int32Array < "u" ? i.subarray(r * 256, r * 256 + 256) : i.slice(r * 256, r * 256 + 256);
			return a;
		}
		var i = r(n), a = i[0], o = i[1], s = i[2], c = i[3], l = i[4], u = i[5], d = i[6], f = i[7], p = i[8], m = i[9], h = i[10], g = i[11], _ = i[12], v = i[13], y = i[14];
		function b(e, t) {
			for (var r = t ^ -1, i = 0, a = e.length; i < a;) r = r >>> 8 ^ n[(r ^ e.charCodeAt(i++)) & 255];
			return ~r;
		}
		function x(e, t) {
			for (var r = t ^ -1, i = e.length - 15, b = 0; b < i;) r = y[e[b++] ^ r & 255] ^ v[e[b++] ^ r >> 8 & 255] ^ _[e[b++] ^ r >> 16 & 255] ^ g[e[b++] ^ r >>> 24] ^ h[e[b++]] ^ m[e[b++]] ^ p[e[b++]] ^ f[e[b++]] ^ d[e[b++]] ^ u[e[b++]] ^ l[e[b++]] ^ c[e[b++]] ^ s[e[b++]] ^ o[e[b++]] ^ a[e[b++]] ^ n[e[b++]];
			for (i += 15; b < i;) r = r >>> 8 ^ n[(r ^ e[b++]) & 255];
			return ~r;
		}
		function S(e, t) {
			for (var r = t ^ -1, i = 0, a = e.length, o = 0, s = 0; i < a;) o = e.charCodeAt(i++), o < 128 ? r = r >>> 8 ^ n[(r ^ o) & 255] : o < 2048 ? (r = r >>> 8 ^ n[(r ^ (192 | o >> 6 & 31)) & 255], r = r >>> 8 ^ n[(r ^ (128 | o & 63)) & 255]) : o >= 55296 && o < 57344 ? (o = (o & 1023) + 64, s = e.charCodeAt(i++) & 1023, r = r >>> 8 ^ n[(r ^ (240 | o >> 8 & 7)) & 255], r = r >>> 8 ^ n[(r ^ (128 | o >> 2 & 63)) & 255], r = r >>> 8 ^ n[(r ^ (128 | s >> 6 & 15 | (o & 3) << 4)) & 255], r = r >>> 8 ^ n[(r ^ (128 | s & 63)) & 255]) : (r = r >>> 8 ^ n[(r ^ (224 | o >> 12 & 15)) & 255], r = r >>> 8 ^ n[(r ^ (128 | o >> 6 & 63)) & 255], r = r >>> 8 ^ n[(r ^ (128 | o & 63)) & 255]);
			return ~r;
		}
		e.table = n, e.bstr = b, e.buf = x, e.str = S;
	});
})), Vy = /* @__PURE__ */ o(((e) => {
	var t = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Int32Array < "u";
	function n(e, t) {
		return Object.prototype.hasOwnProperty.call(e, t);
	}
	e.assign = function(e) {
		for (var t = Array.prototype.slice.call(arguments, 1); t.length;) {
			var r = t.shift();
			if (r) {
				if (typeof r != "object") throw TypeError(r + "must be non-object");
				for (var i in r) n(r, i) && (e[i] = r[i]);
			}
		}
		return e;
	}, e.shrinkBuf = function(e, t) {
		return e.length === t ? e : e.subarray ? e.subarray(0, t) : (e.length = t, e);
	};
	var r = {
		arraySet: function(e, t, n, r, i) {
			if (t.subarray && e.subarray) {
				e.set(t.subarray(n, n + r), i);
				return;
			}
			for (var a = 0; a < r; a++) e[i + a] = t[n + a];
		},
		flattenChunks: function(e) {
			var t, n, r = 0, i, a, o;
			for (t = 0, n = e.length; t < n; t++) r += e[t].length;
			for (o = new Uint8Array(r), i = 0, t = 0, n = e.length; t < n; t++) a = e[t], o.set(a, i), i += a.length;
			return o;
		}
	}, i = {
		arraySet: function(e, t, n, r, i) {
			for (var a = 0; a < r; a++) e[i + a] = t[n + a];
		},
		flattenChunks: function(e) {
			return [].concat.apply([], e);
		}
	};
	e.setTyped = function(t) {
		t ? (e.Buf8 = Uint8Array, e.Buf16 = Uint16Array, e.Buf32 = Int32Array, e.assign(e, r)) : (e.Buf8 = Array, e.Buf16 = Array, e.Buf32 = Array, e.assign(e, i));
	}, e.setTyped(t);
})), Hy = /* @__PURE__ */ o(((e) => {
	var t = Vy(), n = 4, r = 0, i = 1, a = 2;
	function o(e) {
		for (var t = e.length; --t >= 0;) e[t] = 0;
	}
	var s = 0, c = 1, l = 2, u = 3, d = 258, f = 29, p = 256, m = p + 1 + f, h = 30, g = 19, _ = 2 * m + 1, v = 15, y = 16, b = 7, x = 256, S = 16, C = 17, w = 18, T = [
		0,
		0,
		0,
		0,
		0,
		0,
		0,
		0,
		1,
		1,
		1,
		1,
		2,
		2,
		2,
		2,
		3,
		3,
		3,
		3,
		4,
		4,
		4,
		4,
		5,
		5,
		5,
		5,
		0
	], E = [
		0,
		0,
		0,
		0,
		1,
		1,
		2,
		2,
		3,
		3,
		4,
		4,
		5,
		5,
		6,
		6,
		7,
		7,
		8,
		8,
		9,
		9,
		10,
		10,
		11,
		11,
		12,
		12,
		13,
		13
	], ee = [
		0,
		0,
		0,
		0,
		0,
		0,
		0,
		0,
		0,
		0,
		0,
		0,
		0,
		0,
		0,
		0,
		2,
		3,
		7
	], te = [
		16,
		17,
		18,
		0,
		8,
		7,
		9,
		6,
		10,
		5,
		11,
		4,
		12,
		3,
		13,
		2,
		14,
		1,
		15
	], ne = 512, D = Array((m + 2) * 2);
	o(D);
	var O = Array(h * 2);
	o(O);
	var k = Array(ne);
	o(k);
	var A = Array(d - u + 1);
	o(A);
	var j = Array(f);
	o(j);
	var re = Array(h);
	o(re);
	function ie(e, t, n, r, i) {
		this.static_tree = e, this.extra_bits = t, this.extra_base = n, this.elems = r, this.max_length = i, this.has_stree = e && e.length;
	}
	var ae, oe, M;
	function se(e, t) {
		this.dyn_tree = e, this.max_code = 0, this.stat_desc = t;
	}
	function N(e) {
		return e < 256 ? k[e] : k[256 + (e >>> 7)];
	}
	function ce(e, t) {
		e.pending_buf[e.pending++] = t & 255, e.pending_buf[e.pending++] = t >>> 8 & 255;
	}
	function P(e, t, n) {
		e.bi_valid > y - n ? (e.bi_buf |= t << e.bi_valid & 65535, ce(e, e.bi_buf), e.bi_buf = t >> y - e.bi_valid, e.bi_valid += n - y) : (e.bi_buf |= t << e.bi_valid & 65535, e.bi_valid += n);
	}
	function F(e, t, n) {
		P(e, n[t * 2], n[t * 2 + 1]);
	}
	function I(e, t) {
		var n = 0;
		do
			n |= e & 1, e >>>= 1, n <<= 1;
		while (--t > 0);
		return n >>> 1;
	}
	function le(e) {
		e.bi_valid === 16 ? (ce(e, e.bi_buf), e.bi_buf = 0, e.bi_valid = 0) : e.bi_valid >= 8 && (e.pending_buf[e.pending++] = e.bi_buf & 255, e.bi_buf >>= 8, e.bi_valid -= 8);
	}
	function ue(e, t) {
		var n = t.dyn_tree, r = t.max_code, i = t.stat_desc.static_tree, a = t.stat_desc.has_stree, o = t.stat_desc.extra_bits, s = t.stat_desc.extra_base, c = t.stat_desc.max_length, l, u, d, f, p, m, h = 0;
		for (f = 0; f <= v; f++) e.bl_count[f] = 0;
		for (n[e.heap[e.heap_max] * 2 + 1] = 0, l = e.heap_max + 1; l < _; l++) u = e.heap[l], f = n[n[u * 2 + 1] * 2 + 1] + 1, f > c && (f = c, h++), n[u * 2 + 1] = f, !(u > r) && (e.bl_count[f]++, p = 0, u >= s && (p = o[u - s]), m = n[u * 2], e.opt_len += m * (f + p), a && (e.static_len += m * (i[u * 2 + 1] + p)));
		if (h !== 0) {
			do {
				for (f = c - 1; e.bl_count[f] === 0;) f--;
				e.bl_count[f]--, e.bl_count[f + 1] += 2, e.bl_count[c]--, h -= 2;
			} while (h > 0);
			for (f = c; f !== 0; f--) for (u = e.bl_count[f]; u !== 0;) d = e.heap[--l], !(d > r) && (n[d * 2 + 1] !== f && (e.opt_len += (f - n[d * 2 + 1]) * n[d * 2], n[d * 2 + 1] = f), u--);
		}
	}
	function de(e, t, n) {
		var r = Array(v + 1), i = 0, a, o;
		for (a = 1; a <= v; a++) r[a] = i = i + n[a - 1] << 1;
		for (o = 0; o <= t; o++) {
			var s = e[o * 2 + 1];
			s !== 0 && (e[o * 2] = I(r[s]++, s));
		}
	}
	function fe() {
		var e, t, n, r, i, a = Array(v + 1);
		for (n = 0, r = 0; r < f - 1; r++) for (j[r] = n, e = 0; e < 1 << T[r]; e++) A[n++] = r;
		for (A[n - 1] = r, i = 0, r = 0; r < 16; r++) for (re[r] = i, e = 0; e < 1 << E[r]; e++) k[i++] = r;
		for (i >>= 7; r < h; r++) for (re[r] = i << 7, e = 0; e < 1 << E[r] - 7; e++) k[256 + i++] = r;
		for (t = 0; t <= v; t++) a[t] = 0;
		for (e = 0; e <= 143;) D[e * 2 + 1] = 8, e++, a[8]++;
		for (; e <= 255;) D[e * 2 + 1] = 9, e++, a[9]++;
		for (; e <= 279;) D[e * 2 + 1] = 7, e++, a[7]++;
		for (; e <= 287;) D[e * 2 + 1] = 8, e++, a[8]++;
		for (de(D, m + 1, a), e = 0; e < h; e++) O[e * 2 + 1] = 5, O[e * 2] = I(e, 5);
		ae = new ie(D, T, p + 1, m, v), oe = new ie(O, E, 0, h, v), M = new ie([], ee, 0, g, b);
	}
	function L(e) {
		var t;
		for (t = 0; t < m; t++) e.dyn_ltree[t * 2] = 0;
		for (t = 0; t < h; t++) e.dyn_dtree[t * 2] = 0;
		for (t = 0; t < g; t++) e.bl_tree[t * 2] = 0;
		e.dyn_ltree[x * 2] = 1, e.opt_len = e.static_len = 0, e.last_lit = e.matches = 0;
	}
	function R(e) {
		e.bi_valid > 8 ? ce(e, e.bi_buf) : e.bi_valid > 0 && (e.pending_buf[e.pending++] = e.bi_buf), e.bi_buf = 0, e.bi_valid = 0;
	}
	function z(e, n, r, i) {
		R(e), i && (ce(e, r), ce(e, ~r)), t.arraySet(e.pending_buf, e.window, n, r, e.pending), e.pending += r;
	}
	function B(e, t, n, r) {
		var i = t * 2, a = n * 2;
		return e[i] < e[a] || e[i] === e[a] && r[t] <= r[n];
	}
	function V(e, t, n) {
		for (var r = e.heap[n], i = n << 1; i <= e.heap_len && (i < e.heap_len && B(t, e.heap[i + 1], e.heap[i], e.depth) && i++, !B(t, r, e.heap[i], e.depth));) e.heap[n] = e.heap[i], n = i, i <<= 1;
		e.heap[n] = r;
	}
	function pe(e, t, n) {
		var r, i, a = 0, o, s;
		if (e.last_lit !== 0) do
			r = e.pending_buf[e.d_buf + a * 2] << 8 | e.pending_buf[e.d_buf + a * 2 + 1], i = e.pending_buf[e.l_buf + a], a++, r === 0 ? F(e, i, t) : (o = A[i], F(e, o + p + 1, t), s = T[o], s !== 0 && (i -= j[o], P(e, i, s)), r--, o = N(r), F(e, o, n), s = E[o], s !== 0 && (r -= re[o], P(e, r, s)));
		while (a < e.last_lit);
		F(e, x, t);
	}
	function me(e, t) {
		var n = t.dyn_tree, r = t.stat_desc.static_tree, i = t.stat_desc.has_stree, a = t.stat_desc.elems, o, s, c = -1, l;
		for (e.heap_len = 0, e.heap_max = _, o = 0; o < a; o++) n[o * 2] === 0 ? n[o * 2 + 1] = 0 : (e.heap[++e.heap_len] = c = o, e.depth[o] = 0);
		for (; e.heap_len < 2;) l = e.heap[++e.heap_len] = c < 2 ? ++c : 0, n[l * 2] = 1, e.depth[l] = 0, e.opt_len--, i && (e.static_len -= r[l * 2 + 1]);
		for (t.max_code = c, o = e.heap_len >> 1; o >= 1; o--) V(e, n, o);
		l = a;
		do
			o = e.heap[1], e.heap[1] = e.heap[e.heap_len--], V(e, n, 1), s = e.heap[1], e.heap[--e.heap_max] = o, e.heap[--e.heap_max] = s, n[l * 2] = n[o * 2] + n[s * 2], e.depth[l] = (e.depth[o] >= e.depth[s] ? e.depth[o] : e.depth[s]) + 1, n[o * 2 + 1] = n[s * 2 + 1] = l, e.heap[1] = l++, V(e, n, 1);
		while (e.heap_len >= 2);
		e.heap[--e.heap_max] = e.heap[1], ue(e, t), de(n, c, e.bl_count);
	}
	function he(e, t, n) {
		var r, i = -1, a, o = t[1], s = 0, c = 7, l = 4;
		for (o === 0 && (c = 138, l = 3), t[(n + 1) * 2 + 1] = 65535, r = 0; r <= n; r++) a = o, o = t[(r + 1) * 2 + 1], !(++s < c && a === o) && (s < l ? e.bl_tree[a * 2] += s : a === 0 ? s <= 10 ? e.bl_tree[C * 2]++ : e.bl_tree[w * 2]++ : (a !== i && e.bl_tree[a * 2]++, e.bl_tree[S * 2]++), s = 0, i = a, o === 0 ? (c = 138, l = 3) : a === o ? (c = 6, l = 3) : (c = 7, l = 4));
	}
	function ge(e, t, n) {
		var r, i = -1, a, o = t[1], s = 0, c = 7, l = 4;
		for (o === 0 && (c = 138, l = 3), r = 0; r <= n; r++) if (a = o, o = t[(r + 1) * 2 + 1], !(++s < c && a === o)) {
			if (s < l) do
				F(e, a, e.bl_tree);
			while (--s !== 0);
			else a === 0 ? s <= 10 ? (F(e, C, e.bl_tree), P(e, s - 3, 3)) : (F(e, w, e.bl_tree), P(e, s - 11, 7)) : (a !== i && (F(e, a, e.bl_tree), s--), F(e, S, e.bl_tree), P(e, s - 3, 2));
			s = 0, i = a, o === 0 ? (c = 138, l = 3) : a === o ? (c = 6, l = 3) : (c = 7, l = 4);
		}
	}
	function H(e) {
		var t;
		for (he(e, e.dyn_ltree, e.l_desc.max_code), he(e, e.dyn_dtree, e.d_desc.max_code), me(e, e.bl_desc), t = g - 1; t >= 3 && e.bl_tree[te[t] * 2 + 1] === 0; t--);
		return e.opt_len += 3 * (t + 1) + 5 + 5 + 4, t;
	}
	function U(e, t, n, r) {
		var i;
		for (P(e, t - 257, 5), P(e, n - 1, 5), P(e, r - 4, 4), i = 0; i < r; i++) P(e, e.bl_tree[te[i] * 2 + 1], 3);
		ge(e, e.dyn_ltree, t - 1), ge(e, e.dyn_dtree, n - 1);
	}
	function W(e) {
		var t = 4093624447, n;
		for (n = 0; n <= 31; n++, t >>>= 1) if (t & 1 && e.dyn_ltree[n * 2] !== 0) return r;
		if (e.dyn_ltree[18] !== 0 || e.dyn_ltree[20] !== 0 || e.dyn_ltree[26] !== 0) return i;
		for (n = 32; n < p; n++) if (e.dyn_ltree[n * 2] !== 0) return i;
		return r;
	}
	var G = !1;
	function _e(e) {
		G ||= (fe(), !0), e.l_desc = new se(e.dyn_ltree, ae), e.d_desc = new se(e.dyn_dtree, oe), e.bl_desc = new se(e.bl_tree, M), e.bi_buf = 0, e.bi_valid = 0, L(e);
	}
	function ve(e, t, n, r) {
		P(e, (s << 1) + +!!r, 3), z(e, t, n, !0);
	}
	function ye(e) {
		P(e, c << 1, 3), F(e, x, D), le(e);
	}
	function be(e, t, r, i) {
		var o, s, u = 0;
		e.level > 0 ? (e.strm.data_type === a && (e.strm.data_type = W(e)), me(e, e.l_desc), me(e, e.d_desc), u = H(e), o = e.opt_len + 3 + 7 >>> 3, s = e.static_len + 3 + 7 >>> 3, s <= o && (o = s)) : o = s = r + 5, r + 4 <= o && t !== -1 ? ve(e, t, r, i) : e.strategy === n || s === o ? (P(e, (c << 1) + +!!i, 3), pe(e, D, O)) : (P(e, (l << 1) + +!!i, 3), U(e, e.l_desc.max_code + 1, e.d_desc.max_code + 1, u + 1), pe(e, e.dyn_ltree, e.dyn_dtree)), L(e), i && R(e);
	}
	function xe(e, t, n) {
		return e.pending_buf[e.d_buf + e.last_lit * 2] = t >>> 8 & 255, e.pending_buf[e.d_buf + e.last_lit * 2 + 1] = t & 255, e.pending_buf[e.l_buf + e.last_lit] = n & 255, e.last_lit++, t === 0 ? e.dyn_ltree[n * 2]++ : (e.matches++, t--, e.dyn_ltree[(A[n] + p + 1) * 2]++, e.dyn_dtree[N(t) * 2]++), e.last_lit === e.lit_bufsize - 1;
	}
	e._tr_init = _e, e._tr_stored_block = ve, e._tr_flush_block = be, e._tr_tally = xe, e._tr_align = ye;
})), Uy = /* @__PURE__ */ o(((e, t) => {
	function n(e, t, n, r) {
		for (var i = e & 65535 | 0, a = e >>> 16 & 65535 | 0, o = 0; n !== 0;) {
			o = n > 2e3 ? 2e3 : n, n -= o;
			do
				i = i + t[r++] | 0, a = a + i | 0;
			while (--o);
			i %= 65521, a %= 65521;
		}
		return i | a << 16 | 0;
	}
	t.exports = n;
})), Wy = /* @__PURE__ */ o(((e, t) => {
	function n() {
		for (var e, t = [], n = 0; n < 256; n++) {
			e = n;
			for (var r = 0; r < 8; r++) e = e & 1 ? 3988292384 ^ e >>> 1 : e >>> 1;
			t[n] = e;
		}
		return t;
	}
	var r = n();
	function i(e, t, n, i) {
		var a = r, o = i + n;
		e ^= -1;
		for (var s = i; s < o; s++) e = e >>> 8 ^ a[(e ^ t[s]) & 255];
		return e ^ -1;
	}
	t.exports = i;
})), Gy = /* @__PURE__ */ o(((e, t) => {
	t.exports = {
		2: "need dictionary",
		1: "stream end",
		0: "",
		"-1": "file error",
		"-2": "stream error",
		"-3": "data error",
		"-4": "insufficient memory",
		"-5": "buffer error",
		"-6": "incompatible version"
	};
})), Ky = /* @__PURE__ */ o(((e) => {
	var t = Vy(), n = Hy(), r = Uy(), i = Wy(), a = Gy(), o = 0, s = 1, c = 3, l = 4, u = 5, d = 0, f = 1, p = -2, m = -3, h = -5, g = -1, _ = 1, v = 2, y = 3, b = 4, x = 0, S = 2, C = 8, w = 9, T = 15, E = 8, ee = 286, te = 30, ne = 19, D = 2 * ee + 1, O = 15, k = 3, A = 258, j = A + k + 1, re = 32, ie = 42, ae = 69, oe = 73, M = 91, se = 103, N = 113, ce = 666, P = 1, F = 2, I = 3, le = 4, ue = 3;
	function de(e, t) {
		return e.msg = a[t], t;
	}
	function fe(e) {
		return (e << 1) - (e > 4 ? 9 : 0);
	}
	function L(e) {
		for (var t = e.length; --t >= 0;) e[t] = 0;
	}
	function R(e) {
		var n = e.state, r = n.pending;
		r > e.avail_out && (r = e.avail_out), r !== 0 && (t.arraySet(e.output, n.pending_buf, n.pending_out, r, e.next_out), e.next_out += r, n.pending_out += r, e.total_out += r, e.avail_out -= r, n.pending -= r, n.pending === 0 && (n.pending_out = 0));
	}
	function z(e, t) {
		n._tr_flush_block(e, e.block_start >= 0 ? e.block_start : -1, e.strstart - e.block_start, t), e.block_start = e.strstart, R(e.strm);
	}
	function B(e, t) {
		e.pending_buf[e.pending++] = t;
	}
	function V(e, t) {
		e.pending_buf[e.pending++] = t >>> 8 & 255, e.pending_buf[e.pending++] = t & 255;
	}
	function pe(e, n, a, o) {
		var s = e.avail_in;
		return s > o && (s = o), s === 0 ? 0 : (e.avail_in -= s, t.arraySet(n, e.input, e.next_in, s, a), e.state.wrap === 1 ? e.adler = r(e.adler, n, s, a) : e.state.wrap === 2 && (e.adler = i(e.adler, n, s, a)), e.next_in += s, e.total_in += s, s);
	}
	function me(e, t) {
		var n = e.max_chain_length, r = e.strstart, i, a, o = e.prev_length, s = e.nice_match, c = e.strstart > e.w_size - j ? e.strstart - (e.w_size - j) : 0, l = e.window, u = e.w_mask, d = e.prev, f = e.strstart + A, p = l[r + o - 1], m = l[r + o];
		e.prev_length >= e.good_match && (n >>= 2), s > e.lookahead && (s = e.lookahead);
		do {
			if (i = t, l[i + o] !== m || l[i + o - 1] !== p || l[i] !== l[r] || l[++i] !== l[r + 1]) continue;
			r += 2, i++;
			do			;
while (l[++r] === l[++i] && l[++r] === l[++i] && l[++r] === l[++i] && l[++r] === l[++i] && l[++r] === l[++i] && l[++r] === l[++i] && l[++r] === l[++i] && l[++r] === l[++i] && r < f);
			if (a = A - (f - r), r = f - A, a > o) {
				if (e.match_start = t, o = a, a >= s) break;
				p = l[r + o - 1], m = l[r + o];
			}
		} while ((t = d[t & u]) > c && --n !== 0);
		return o <= e.lookahead ? o : e.lookahead;
	}
	function he(e) {
		var n = e.w_size, r, i, a, o, s;
		do {
			if (o = e.window_size - e.lookahead - e.strstart, e.strstart >= n + (n - j)) {
				t.arraySet(e.window, e.window, n, n, 0), e.match_start -= n, e.strstart -= n, e.block_start -= n, i = e.hash_size, r = i;
				do
					a = e.head[--r], e.head[r] = a >= n ? a - n : 0;
				while (--i);
				i = n, r = i;
				do
					a = e.prev[--r], e.prev[r] = a >= n ? a - n : 0;
				while (--i);
				o += n;
			}
			if (e.strm.avail_in === 0) break;
			if (i = pe(e.strm, e.window, e.strstart + e.lookahead, o), e.lookahead += i, e.lookahead + e.insert >= k) for (s = e.strstart - e.insert, e.ins_h = e.window[s], e.ins_h = (e.ins_h << e.hash_shift ^ e.window[s + 1]) & e.hash_mask; e.insert && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[s + k - 1]) & e.hash_mask, e.prev[s & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = s, s++, e.insert--, !(e.lookahead + e.insert < k)););
		} while (e.lookahead < j && e.strm.avail_in !== 0);
	}
	function ge(e, t) {
		var n = 65535;
		for (n > e.pending_buf_size - 5 && (n = e.pending_buf_size - 5);;) {
			if (e.lookahead <= 1) {
				if (he(e), e.lookahead === 0 && t === o) return P;
				if (e.lookahead === 0) break;
			}
			e.strstart += e.lookahead, e.lookahead = 0;
			var r = e.block_start + n;
			if ((e.strstart === 0 || e.strstart >= r) && (e.lookahead = e.strstart - r, e.strstart = r, z(e, !1), e.strm.avail_out === 0) || e.strstart - e.block_start >= e.w_size - j && (z(e, !1), e.strm.avail_out === 0)) return P;
		}
		return e.insert = 0, t === l ? (z(e, !0), e.strm.avail_out === 0 ? I : le) : (e.strstart > e.block_start && (z(e, !1), e.strm.avail_out), P);
	}
	function H(e, t) {
		for (var r, i;;) {
			if (e.lookahead < j) {
				if (he(e), e.lookahead < j && t === o) return P;
				if (e.lookahead === 0) break;
			}
			if (r = 0, e.lookahead >= k && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + k - 1]) & e.hash_mask, r = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), r !== 0 && e.strstart - r <= e.w_size - j && (e.match_length = me(e, r)), e.match_length >= k) if (i = n._tr_tally(e, e.strstart - e.match_start, e.match_length - k), e.lookahead -= e.match_length, e.match_length <= e.max_lazy_match && e.lookahead >= k) {
				e.match_length--;
				do
					e.strstart++, e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + k - 1]) & e.hash_mask, r = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart;
				while (--e.match_length !== 0);
				e.strstart++;
			} else e.strstart += e.match_length, e.match_length = 0, e.ins_h = e.window[e.strstart], e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + 1]) & e.hash_mask;
			else i = n._tr_tally(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++;
			if (i && (z(e, !1), e.strm.avail_out === 0)) return P;
		}
		return e.insert = e.strstart < k - 1 ? e.strstart : k - 1, t === l ? (z(e, !0), e.strm.avail_out === 0 ? I : le) : e.last_lit && (z(e, !1), e.strm.avail_out === 0) ? P : F;
	}
	function U(e, t) {
		for (var r, i, a;;) {
			if (e.lookahead < j) {
				if (he(e), e.lookahead < j && t === o) return P;
				if (e.lookahead === 0) break;
			}
			if (r = 0, e.lookahead >= k && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + k - 1]) & e.hash_mask, r = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), e.prev_length = e.match_length, e.prev_match = e.match_start, e.match_length = k - 1, r !== 0 && e.prev_length < e.max_lazy_match && e.strstart - r <= e.w_size - j && (e.match_length = me(e, r), e.match_length <= 5 && (e.strategy === _ || e.match_length === k && e.strstart - e.match_start > 4096) && (e.match_length = k - 1)), e.prev_length >= k && e.match_length <= e.prev_length) {
				a = e.strstart + e.lookahead - k, i = n._tr_tally(e, e.strstart - 1 - e.prev_match, e.prev_length - k), e.lookahead -= e.prev_length - 1, e.prev_length -= 2;
				do
					++e.strstart <= a && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + k - 1]) & e.hash_mask, r = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart);
				while (--e.prev_length !== 0);
				if (e.match_available = 0, e.match_length = k - 1, e.strstart++, i && (z(e, !1), e.strm.avail_out === 0)) return P;
			} else if (e.match_available) {
				if (i = n._tr_tally(e, 0, e.window[e.strstart - 1]), i && z(e, !1), e.strstart++, e.lookahead--, e.strm.avail_out === 0) return P;
			} else e.match_available = 1, e.strstart++, e.lookahead--;
		}
		return e.match_available &&= (i = n._tr_tally(e, 0, e.window[e.strstart - 1]), 0), e.insert = e.strstart < k - 1 ? e.strstart : k - 1, t === l ? (z(e, !0), e.strm.avail_out === 0 ? I : le) : e.last_lit && (z(e, !1), e.strm.avail_out === 0) ? P : F;
	}
	function W(e, t) {
		for (var r, i, a, s, c = e.window;;) {
			if (e.lookahead <= A) {
				if (he(e), e.lookahead <= A && t === o) return P;
				if (e.lookahead === 0) break;
			}
			if (e.match_length = 0, e.lookahead >= k && e.strstart > 0 && (a = e.strstart - 1, i = c[a], i === c[++a] && i === c[++a] && i === c[++a])) {
				s = e.strstart + A;
				do				;
while (i === c[++a] && i === c[++a] && i === c[++a] && i === c[++a] && i === c[++a] && i === c[++a] && i === c[++a] && i === c[++a] && a < s);
				e.match_length = A - (s - a), e.match_length > e.lookahead && (e.match_length = e.lookahead);
			}
			if (e.match_length >= k ? (r = n._tr_tally(e, 1, e.match_length - k), e.lookahead -= e.match_length, e.strstart += e.match_length, e.match_length = 0) : (r = n._tr_tally(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++), r && (z(e, !1), e.strm.avail_out === 0)) return P;
		}
		return e.insert = 0, t === l ? (z(e, !0), e.strm.avail_out === 0 ? I : le) : e.last_lit && (z(e, !1), e.strm.avail_out === 0) ? P : F;
	}
	function G(e, t) {
		for (var r;;) {
			if (e.lookahead === 0 && (he(e), e.lookahead === 0)) {
				if (t === o) return P;
				break;
			}
			if (e.match_length = 0, r = n._tr_tally(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++, r && (z(e, !1), e.strm.avail_out === 0)) return P;
		}
		return e.insert = 0, t === l ? (z(e, !0), e.strm.avail_out === 0 ? I : le) : e.last_lit && (z(e, !1), e.strm.avail_out === 0) ? P : F;
	}
	function _e(e, t, n, r, i) {
		this.good_length = e, this.max_lazy = t, this.nice_length = n, this.max_chain = r, this.func = i;
	}
	var ve = [
		new _e(0, 0, 0, 0, ge),
		new _e(4, 4, 8, 4, H),
		new _e(4, 5, 16, 8, H),
		new _e(4, 6, 32, 32, H),
		new _e(4, 4, 16, 16, U),
		new _e(8, 16, 32, 32, U),
		new _e(8, 16, 128, 128, U),
		new _e(8, 32, 128, 256, U),
		new _e(32, 128, 258, 1024, U),
		new _e(32, 258, 258, 4096, U)
	];
	function ye(e) {
		e.window_size = 2 * e.w_size, L(e.head), e.max_lazy_match = ve[e.level].max_lazy, e.good_match = ve[e.level].good_length, e.nice_match = ve[e.level].nice_length, e.max_chain_length = ve[e.level].max_chain, e.strstart = 0, e.block_start = 0, e.lookahead = 0, e.insert = 0, e.match_length = e.prev_length = k - 1, e.match_available = 0, e.ins_h = 0;
	}
	function be() {
		this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = C, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new t.Buf16(D * 2), this.dyn_dtree = new t.Buf16((2 * te + 1) * 2), this.bl_tree = new t.Buf16((2 * ne + 1) * 2), L(this.dyn_ltree), L(this.dyn_dtree), L(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new t.Buf16(O + 1), this.heap = new t.Buf16(2 * ee + 1), L(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new t.Buf16(2 * ee + 1), L(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
	}
	function xe(e) {
		var t;
		return !e || !e.state ? de(e, p) : (e.total_in = e.total_out = 0, e.data_type = S, t = e.state, t.pending = 0, t.pending_out = 0, t.wrap < 0 && (t.wrap = -t.wrap), t.status = t.wrap ? ie : N, e.adler = t.wrap === 2 ? 0 : 1, t.last_flush = o, n._tr_init(t), d);
	}
	function Se(e) {
		var t = xe(e);
		return t === d && ye(e.state), t;
	}
	function Ce(e, t) {
		return !e || !e.state || e.state.wrap !== 2 ? p : (e.state.gzhead = t, d);
	}
	function K(e, n, r, i, a, o) {
		if (!e) return p;
		var s = 1;
		if (n === g && (n = 6), i < 0 ? (s = 0, i = -i) : i > 15 && (s = 2, i -= 16), a < 1 || a > w || r !== C || i < 8 || i > 15 || n < 0 || n > 9 || o < 0 || o > b) return de(e, p);
		i === 8 && (i = 9);
		var c = new be();
		return e.state = c, c.strm = e, c.wrap = s, c.gzhead = null, c.w_bits = i, c.w_size = 1 << c.w_bits, c.w_mask = c.w_size - 1, c.hash_bits = a + 7, c.hash_size = 1 << c.hash_bits, c.hash_mask = c.hash_size - 1, c.hash_shift = ~~((c.hash_bits + k - 1) / k), c.window = new t.Buf8(c.w_size * 2), c.head = new t.Buf16(c.hash_size), c.prev = new t.Buf16(c.w_size), c.lit_bufsize = 1 << a + 6, c.pending_buf_size = c.lit_bufsize * 4, c.pending_buf = new t.Buf8(c.pending_buf_size), c.d_buf = 1 * c.lit_bufsize, c.l_buf = 3 * c.lit_bufsize, c.level = n, c.strategy = o, c.method = r, Se(e);
	}
	function we(e, t) {
		return K(e, t, C, T, E, x);
	}
	function Te(e, t) {
		var r, a, m, g;
		if (!e || !e.state || t > u || t < 0) return e ? de(e, p) : p;
		if (a = e.state, !e.output || !e.input && e.avail_in !== 0 || a.status === ce && t !== l) return de(e, e.avail_out === 0 ? h : p);
		if (a.strm = e, r = a.last_flush, a.last_flush = t, a.status === ie) if (a.wrap === 2) e.adler = 0, B(a, 31), B(a, 139), B(a, 8), a.gzhead ? (B(a, +!!a.gzhead.text + (a.gzhead.hcrc ? 2 : 0) + (a.gzhead.extra ? 4 : 0) + (a.gzhead.name ? 8 : 0) + (a.gzhead.comment ? 16 : 0)), B(a, a.gzhead.time & 255), B(a, a.gzhead.time >> 8 & 255), B(a, a.gzhead.time >> 16 & 255), B(a, a.gzhead.time >> 24 & 255), B(a, a.level === 9 ? 2 : a.strategy >= v || a.level < 2 ? 4 : 0), B(a, a.gzhead.os & 255), a.gzhead.extra && a.gzhead.extra.length && (B(a, a.gzhead.extra.length & 255), B(a, a.gzhead.extra.length >> 8 & 255)), a.gzhead.hcrc && (e.adler = i(e.adler, a.pending_buf, a.pending, 0)), a.gzindex = 0, a.status = ae) : (B(a, 0), B(a, 0), B(a, 0), B(a, 0), B(a, 0), B(a, a.level === 9 ? 2 : a.strategy >= v || a.level < 2 ? 4 : 0), B(a, ue), a.status = N);
		else {
			var _ = C + (a.w_bits - 8 << 4) << 8, b = -1;
			b = a.strategy >= v || a.level < 2 ? 0 : a.level < 6 ? 1 : a.level === 6 ? 2 : 3, _ |= b << 6, a.strstart !== 0 && (_ |= re), _ += 31 - _ % 31, a.status = N, V(a, _), a.strstart !== 0 && (V(a, e.adler >>> 16), V(a, e.adler & 65535)), e.adler = 1;
		}
		if (a.status === ae) if (a.gzhead.extra) {
			for (m = a.pending; a.gzindex < (a.gzhead.extra.length & 65535) && !(a.pending === a.pending_buf_size && (a.gzhead.hcrc && a.pending > m && (e.adler = i(e.adler, a.pending_buf, a.pending - m, m)), R(e), m = a.pending, a.pending === a.pending_buf_size));) B(a, a.gzhead.extra[a.gzindex] & 255), a.gzindex++;
			a.gzhead.hcrc && a.pending > m && (e.adler = i(e.adler, a.pending_buf, a.pending - m, m)), a.gzindex === a.gzhead.extra.length && (a.gzindex = 0, a.status = oe);
		} else a.status = oe;
		if (a.status === oe) if (a.gzhead.name) {
			m = a.pending;
			do {
				if (a.pending === a.pending_buf_size && (a.gzhead.hcrc && a.pending > m && (e.adler = i(e.adler, a.pending_buf, a.pending - m, m)), R(e), m = a.pending, a.pending === a.pending_buf_size)) {
					g = 1;
					break;
				}
				g = a.gzindex < a.gzhead.name.length ? a.gzhead.name.charCodeAt(a.gzindex++) & 255 : 0, B(a, g);
			} while (g !== 0);
			a.gzhead.hcrc && a.pending > m && (e.adler = i(e.adler, a.pending_buf, a.pending - m, m)), g === 0 && (a.gzindex = 0, a.status = M);
		} else a.status = M;
		if (a.status === M) if (a.gzhead.comment) {
			m = a.pending;
			do {
				if (a.pending === a.pending_buf_size && (a.gzhead.hcrc && a.pending > m && (e.adler = i(e.adler, a.pending_buf, a.pending - m, m)), R(e), m = a.pending, a.pending === a.pending_buf_size)) {
					g = 1;
					break;
				}
				g = a.gzindex < a.gzhead.comment.length ? a.gzhead.comment.charCodeAt(a.gzindex++) & 255 : 0, B(a, g);
			} while (g !== 0);
			a.gzhead.hcrc && a.pending > m && (e.adler = i(e.adler, a.pending_buf, a.pending - m, m)), g === 0 && (a.status = se);
		} else a.status = se;
		if (a.status === se && (a.gzhead.hcrc ? (a.pending + 2 > a.pending_buf_size && R(e), a.pending + 2 <= a.pending_buf_size && (B(a, e.adler & 255), B(a, e.adler >> 8 & 255), e.adler = 0, a.status = N)) : a.status = N), a.pending !== 0) {
			if (R(e), e.avail_out === 0) return a.last_flush = -1, d;
		} else if (e.avail_in === 0 && fe(t) <= fe(r) && t !== l) return de(e, h);
		if (a.status === ce && e.avail_in !== 0) return de(e, h);
		if (e.avail_in !== 0 || a.lookahead !== 0 || t !== o && a.status !== ce) {
			var x = a.strategy === v ? G(a, t) : a.strategy === y ? W(a, t) : ve[a.level].func(a, t);
			if ((x === I || x === le) && (a.status = ce), x === P || x === I) return e.avail_out === 0 && (a.last_flush = -1), d;
			if (x === F && (t === s ? n._tr_align(a) : t !== u && (n._tr_stored_block(a, 0, 0, !1), t === c && (L(a.head), a.lookahead === 0 && (a.strstart = 0, a.block_start = 0, a.insert = 0))), R(e), e.avail_out === 0)) return a.last_flush = -1, d;
		}
		return t === l ? a.wrap <= 0 ? f : (a.wrap === 2 ? (B(a, e.adler & 255), B(a, e.adler >> 8 & 255), B(a, e.adler >> 16 & 255), B(a, e.adler >> 24 & 255), B(a, e.total_in & 255), B(a, e.total_in >> 8 & 255), B(a, e.total_in >> 16 & 255), B(a, e.total_in >> 24 & 255)) : (V(a, e.adler >>> 16), V(a, e.adler & 65535)), R(e), a.wrap > 0 && (a.wrap = -a.wrap), a.pending === 0 ? f : d) : d;
	}
	function Ee(e) {
		var t;
		return !e || !e.state ? p : (t = e.state.status, t !== ie && t !== ae && t !== oe && t !== M && t !== se && t !== N && t !== ce ? de(e, p) : (e.state = null, t === N ? de(e, m) : d));
	}
	function De(e, n) {
		var i = n.length, a, o, s, c, l, u, f, m;
		if (!e || !e.state || (a = e.state, c = a.wrap, c === 2 || c === 1 && a.status !== ie || a.lookahead)) return p;
		for (c === 1 && (e.adler = r(e.adler, n, i, 0)), a.wrap = 0, i >= a.w_size && (c === 0 && (L(a.head), a.strstart = 0, a.block_start = 0, a.insert = 0), m = new t.Buf8(a.w_size), t.arraySet(m, n, i - a.w_size, a.w_size, 0), n = m, i = a.w_size), l = e.avail_in, u = e.next_in, f = e.input, e.avail_in = i, e.next_in = 0, e.input = n, he(a); a.lookahead >= k;) {
			o = a.strstart, s = a.lookahead - (k - 1);
			do
				a.ins_h = (a.ins_h << a.hash_shift ^ a.window[o + k - 1]) & a.hash_mask, a.prev[o & a.w_mask] = a.head[a.ins_h], a.head[a.ins_h] = o, o++;
			while (--s);
			a.strstart = o, a.lookahead = k - 1, he(a);
		}
		return a.strstart += a.lookahead, a.block_start = a.strstart, a.insert = a.lookahead, a.lookahead = 0, a.match_length = a.prev_length = k - 1, a.match_available = 0, e.next_in = u, e.input = f, e.avail_in = l, a.wrap = c, d;
	}
	e.deflateInit = we, e.deflateInit2 = K, e.deflateReset = Se, e.deflateResetKeep = xe, e.deflateSetHeader = Ce, e.deflate = Te, e.deflateEnd = Ee, e.deflateSetDictionary = De, e.deflateInfo = "pako deflate (from Nodeca project)";
})), qy = /* @__PURE__ */ o(((e) => {
	var t = Vy(), n = !0, r = !0;
	try {
		String.fromCharCode.apply(null, [0]);
	} catch {
		n = !1;
	}
	try {
		String.fromCharCode.apply(null, /* @__PURE__ */ new Uint8Array(1));
	} catch {
		r = !1;
	}
	for (var i = new t.Buf8(256), a = 0; a < 256; a++) i[a] = a >= 252 ? 6 : a >= 248 ? 5 : a >= 240 ? 4 : a >= 224 ? 3 : a >= 192 ? 2 : 1;
	i[254] = i[254] = 1, e.string2buf = function(e) {
		var n, r, i, a, o, s = e.length, c = 0;
		for (a = 0; a < s; a++) r = e.charCodeAt(a), (r & 64512) == 55296 && a + 1 < s && (i = e.charCodeAt(a + 1), (i & 64512) == 56320 && (r = 65536 + (r - 55296 << 10) + (i - 56320), a++)), c += r < 128 ? 1 : r < 2048 ? 2 : r < 65536 ? 3 : 4;
		for (n = new t.Buf8(c), o = 0, a = 0; o < c; a++) r = e.charCodeAt(a), (r & 64512) == 55296 && a + 1 < s && (i = e.charCodeAt(a + 1), (i & 64512) == 56320 && (r = 65536 + (r - 55296 << 10) + (i - 56320), a++)), r < 128 ? n[o++] = r : r < 2048 ? (n[o++] = 192 | r >>> 6, n[o++] = 128 | r & 63) : r < 65536 ? (n[o++] = 224 | r >>> 12, n[o++] = 128 | r >>> 6 & 63, n[o++] = 128 | r & 63) : (n[o++] = 240 | r >>> 18, n[o++] = 128 | r >>> 12 & 63, n[o++] = 128 | r >>> 6 & 63, n[o++] = 128 | r & 63);
		return n;
	};
	function o(e, i) {
		if (i < 65534 && (e.subarray && r || !e.subarray && n)) return String.fromCharCode.apply(null, t.shrinkBuf(e, i));
		for (var a = "", o = 0; o < i; o++) a += String.fromCharCode(e[o]);
		return a;
	}
	e.buf2binstring = function(e) {
		return o(e, e.length);
	}, e.binstring2buf = function(e) {
		for (var n = new t.Buf8(e.length), r = 0, i = n.length; r < i; r++) n[r] = e.charCodeAt(r);
		return n;
	}, e.buf2string = function(e, t) {
		var n, r, a, s, c = t || e.length, l = Array(c * 2);
		for (r = 0, n = 0; n < c;) {
			if (a = e[n++], a < 128) {
				l[r++] = a;
				continue;
			}
			if (s = i[a], s > 4) {
				l[r++] = 65533, n += s - 1;
				continue;
			}
			for (a &= s === 2 ? 31 : s === 3 ? 15 : 7; s > 1 && n < c;) a = a << 6 | e[n++] & 63, s--;
			if (s > 1) {
				l[r++] = 65533;
				continue;
			}
			a < 65536 ? l[r++] = a : (a -= 65536, l[r++] = 55296 | a >> 10 & 1023, l[r++] = 56320 | a & 1023);
		}
		return o(l, r);
	}, e.utf8border = function(e, t) {
		var n;
		for (t ||= e.length, t > e.length && (t = e.length), n = t - 1; n >= 0 && (e[n] & 192) == 128;) n--;
		return n < 0 || n === 0 ? t : n + i[e[n]] > t ? n : t;
	};
})), Jy = /* @__PURE__ */ o(((e, t) => {
	function n() {
		this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
	}
	t.exports = n;
})), Yy = /* @__PURE__ */ o(((e) => {
	var t = Ky(), n = Vy(), r = qy(), i = Gy(), a = Jy(), o = Object.prototype.toString, s = 0, c = 4, l = 0, u = 1, d = 2, f = -1, p = 0, m = 8;
	function h(e) {
		if (!(this instanceof h)) return new h(e);
		this.options = n.assign({
			level: f,
			method: m,
			chunkSize: 16384,
			windowBits: 15,
			memLevel: 8,
			strategy: p,
			to: ""
		}, e || {});
		var s = this.options;
		s.raw && s.windowBits > 0 ? s.windowBits = -s.windowBits : s.gzip && s.windowBits > 0 && s.windowBits < 16 && (s.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new a(), this.strm.avail_out = 0;
		var c = t.deflateInit2(this.strm, s.level, s.method, s.windowBits, s.memLevel, s.strategy);
		if (c !== l) throw Error(i[c]);
		if (s.header && t.deflateSetHeader(this.strm, s.header), s.dictionary) {
			var u = typeof s.dictionary == "string" ? r.string2buf(s.dictionary) : o.call(s.dictionary) === "[object ArrayBuffer]" ? new Uint8Array(s.dictionary) : s.dictionary;
			if (c = t.deflateSetDictionary(this.strm, u), c !== l) throw Error(i[c]);
			this._dict_set = !0;
		}
	}
	h.prototype.push = function(e, i) {
		var a = this.strm, f = this.options.chunkSize, p, m;
		if (this.ended) return !1;
		m = i === ~~i ? i : i === !0 ? c : s, typeof e == "string" ? a.input = r.string2buf(e) : o.call(e) === "[object ArrayBuffer]" ? a.input = new Uint8Array(e) : a.input = e, a.next_in = 0, a.avail_in = a.input.length;
		do {
			if (a.avail_out === 0 && (a.output = new n.Buf8(f), a.next_out = 0, a.avail_out = f), p = t.deflate(a, m), p !== u && p !== l) return this.onEnd(p), this.ended = !0, !1;
			(a.avail_out === 0 || a.avail_in === 0 && (m === c || m === d)) && (this.options.to === "string" ? this.onData(r.buf2binstring(n.shrinkBuf(a.output, a.next_out))) : this.onData(n.shrinkBuf(a.output, a.next_out)));
		} while ((a.avail_in > 0 || a.avail_out === 0) && p !== u);
		return m === c ? (p = t.deflateEnd(this.strm), this.onEnd(p), this.ended = !0, p === l) : m === d ? (this.onEnd(l), a.avail_out = 0, !0) : !0;
	}, h.prototype.onData = function(e) {
		this.chunks.push(e);
	}, h.prototype.onEnd = function(e) {
		e === l && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = n.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg;
	};
	function g(e, t) {
		var n = new h(t);
		if (n.push(e, !0), n.err) throw n.msg || i[n.err];
		return n.result;
	}
	function _(e, t) {
		return t ||= {}, t.raw = !0, g(e, t);
	}
	function v(e, t) {
		return t ||= {}, t.gzip = !0, g(e, t);
	}
	e.Deflate = h, e.deflate = g, e.deflateRaw = _, e.gzip = v;
})), Xy = /* @__PURE__ */ o(((e, t) => {
	t.exports = function(e, t) {
		var n = e.state, r = e.next_in, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T = e.input, E;
		i = r + (e.avail_in - 5), a = e.next_out, E = e.output, o = a - (t - e.avail_out), s = a + (e.avail_out - 257), c = n.dmax, l = n.wsize, u = n.whave, d = n.wnext, f = n.window, p = n.hold, m = n.bits, h = n.lencode, g = n.distcode, _ = (1 << n.lenbits) - 1, v = (1 << n.distbits) - 1;
		top: do {
			m < 15 && (p += T[r++] << m, m += 8, p += T[r++] << m, m += 8), y = h[p & _];
			dolen: for (;;) {
				if (b = y >>> 24, p >>>= b, m -= b, b = y >>> 16 & 255, b === 0) E[a++] = y & 65535;
				else if (b & 16) {
					x = y & 65535, b &= 15, b && (m < b && (p += T[r++] << m, m += 8), x += p & (1 << b) - 1, p >>>= b, m -= b), m < 15 && (p += T[r++] << m, m += 8, p += T[r++] << m, m += 8), y = g[p & v];
					dodist: for (;;) {
						if (b = y >>> 24, p >>>= b, m -= b, b = y >>> 16 & 255, b & 16) {
							if (S = y & 65535, b &= 15, m < b && (p += T[r++] << m, m += 8, m < b && (p += T[r++] << m, m += 8)), S += p & (1 << b) - 1, S > c) {
								e.msg = "invalid distance too far back", n.mode = 30;
								break top;
							}
							if (p >>>= b, m -= b, b = a - o, S > b) {
								if (b = S - b, b > u && n.sane) {
									e.msg = "invalid distance too far back", n.mode = 30;
									break top;
								}
								if (C = 0, w = f, d === 0) {
									if (C += l - b, b < x) {
										x -= b;
										do
											E[a++] = f[C++];
										while (--b);
										C = a - S, w = E;
									}
								} else if (d < b) {
									if (C += l + d - b, b -= d, b < x) {
										x -= b;
										do
											E[a++] = f[C++];
										while (--b);
										if (C = 0, d < x) {
											b = d, x -= b;
											do
												E[a++] = f[C++];
											while (--b);
											C = a - S, w = E;
										}
									}
								} else if (C += d - b, b < x) {
									x -= b;
									do
										E[a++] = f[C++];
									while (--b);
									C = a - S, w = E;
								}
								for (; x > 2;) E[a++] = w[C++], E[a++] = w[C++], E[a++] = w[C++], x -= 3;
								x && (E[a++] = w[C++], x > 1 && (E[a++] = w[C++]));
							} else {
								C = a - S;
								do
									E[a++] = E[C++], E[a++] = E[C++], E[a++] = E[C++], x -= 3;
								while (x > 2);
								x && (E[a++] = E[C++], x > 1 && (E[a++] = E[C++]));
							}
						} else if (b & 64) {
							e.msg = "invalid distance code", n.mode = 30;
							break top;
						} else {
							y = g[(y & 65535) + (p & (1 << b) - 1)];
							continue dodist;
						}
						break;
					}
				} else if (!(b & 64)) {
					y = h[(y & 65535) + (p & (1 << b) - 1)];
					continue dolen;
				} else if (b & 32) {
					n.mode = 12;
					break top;
				} else {
					e.msg = "invalid literal/length code", n.mode = 30;
					break top;
				}
				break;
			}
		} while (r < i && a < s);
		x = m >> 3, r -= x, m -= x << 3, p &= (1 << m) - 1, e.next_in = r, e.next_out = a, e.avail_in = r < i ? 5 + (i - r) : 5 - (r - i), e.avail_out = a < s ? 257 + (s - a) : 257 - (a - s), n.hold = p, n.bits = m;
	};
})), Zy = /* @__PURE__ */ o(((e, t) => {
	var n = Vy(), r = 15, i = 852, a = 592, o = 0, s = 1, c = 2, l = [
		3,
		4,
		5,
		6,
		7,
		8,
		9,
		10,
		11,
		13,
		15,
		17,
		19,
		23,
		27,
		31,
		35,
		43,
		51,
		59,
		67,
		83,
		99,
		115,
		131,
		163,
		195,
		227,
		258,
		0,
		0
	], u = [
		16,
		16,
		16,
		16,
		16,
		16,
		16,
		16,
		17,
		17,
		17,
		17,
		18,
		18,
		18,
		18,
		19,
		19,
		19,
		19,
		20,
		20,
		20,
		20,
		21,
		21,
		21,
		21,
		16,
		72,
		78
	], d = [
		1,
		2,
		3,
		4,
		5,
		7,
		9,
		13,
		17,
		25,
		33,
		49,
		65,
		97,
		129,
		193,
		257,
		385,
		513,
		769,
		1025,
		1537,
		2049,
		3073,
		4097,
		6145,
		8193,
		12289,
		16385,
		24577,
		0,
		0
	], f = [
		16,
		16,
		16,
		16,
		17,
		17,
		18,
		18,
		19,
		19,
		20,
		20,
		21,
		21,
		22,
		22,
		23,
		23,
		24,
		24,
		25,
		25,
		26,
		26,
		27,
		27,
		28,
		28,
		29,
		29,
		64,
		64
	];
	t.exports = function(e, t, p, m, h, g, _, v) {
		var y = v.bits, b = 0, x = 0, S = 0, C = 0, w = 0, T = 0, E = 0, ee = 0, te = 0, ne = 0, D, O, k, A, j, re = null, ie = 0, ae, oe = new n.Buf16(r + 1), M = new n.Buf16(r + 1), se = null, N = 0, ce, P, F;
		for (b = 0; b <= r; b++) oe[b] = 0;
		for (x = 0; x < m; x++) oe[t[p + x]]++;
		for (w = y, C = r; C >= 1 && oe[C] === 0; C--);
		if (w > C && (w = C), C === 0) return h[g++] = 20971520, h[g++] = 20971520, v.bits = 1, 0;
		for (S = 1; S < C && oe[S] === 0; S++);
		for (w < S && (w = S), ee = 1, b = 1; b <= r; b++) if (ee <<= 1, ee -= oe[b], ee < 0) return -1;
		if (ee > 0 && (e === o || C !== 1)) return -1;
		for (M[1] = 0, b = 1; b < r; b++) M[b + 1] = M[b] + oe[b];
		for (x = 0; x < m; x++) t[p + x] !== 0 && (_[M[t[p + x]]++] = x);
		if (e === o ? (re = se = _, ae = 19) : e === s ? (re = l, ie -= 257, se = u, N -= 257, ae = 256) : (re = d, se = f, ae = -1), ne = 0, x = 0, b = S, j = g, T = w, E = 0, k = -1, te = 1 << w, A = te - 1, e === s && te > i || e === c && te > a) return 1;
		for (;;) {
			ce = b - E, _[x] < ae ? (P = 0, F = _[x]) : _[x] > ae ? (P = se[N + _[x]], F = re[ie + _[x]]) : (P = 96, F = 0), D = 1 << b - E, O = 1 << T, S = O;
			do
				O -= D, h[j + (ne >> E) + O] = ce << 24 | P << 16 | F | 0;
			while (O !== 0);
			for (D = 1 << b - 1; ne & D;) D >>= 1;
			if (D === 0 ? ne = 0 : (ne &= D - 1, ne += D), x++, --oe[b] === 0) {
				if (b === C) break;
				b = t[p + _[x]];
			}
			if (b > w && (ne & A) !== k) {
				for (E === 0 && (E = w), j += S, T = b - E, ee = 1 << T; T + E < C && (ee -= oe[T + E], !(ee <= 0));) T++, ee <<= 1;
				if (te += 1 << T, e === s && te > i || e === c && te > a) return 1;
				k = ne & A, h[k] = w << 24 | T << 16 | j - g | 0;
			}
		}
		return ne !== 0 && (h[j + ne] = b - E << 24 | 4194304), v.bits = w, 0;
	};
})), Qy = /* @__PURE__ */ o(((e) => {
	var t = Vy(), n = Uy(), r = Wy(), i = Xy(), a = Zy(), o = 0, s = 1, c = 2, l = 4, u = 5, d = 6, f = 0, p = 1, m = 2, h = -2, g = -3, _ = -4, v = -5, y = 8, b = 1, x = 2, S = 3, C = 4, w = 5, T = 6, E = 7, ee = 8, te = 9, ne = 10, D = 11, O = 12, k = 13, A = 14, j = 15, re = 16, ie = 17, ae = 18, oe = 19, M = 20, se = 21, N = 22, ce = 23, P = 24, F = 25, I = 26, le = 27, ue = 28, de = 29, fe = 30, L = 31, R = 32, z = 852, B = 592, V = 15;
	function pe(e) {
		return (e >>> 24 & 255) + (e >>> 8 & 65280) + ((e & 65280) << 8) + ((e & 255) << 24);
	}
	function me() {
		this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new t.Buf16(320), this.work = new t.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
	}
	function he(e) {
		var n;
		return !e || !e.state ? h : (n = e.state, e.total_in = e.total_out = n.total = 0, e.msg = "", n.wrap && (e.adler = n.wrap & 1), n.mode = b, n.last = 0, n.havedict = 0, n.dmax = 32768, n.head = null, n.hold = 0, n.bits = 0, n.lencode = n.lendyn = new t.Buf32(z), n.distcode = n.distdyn = new t.Buf32(B), n.sane = 1, n.back = -1, f);
	}
	function ge(e) {
		var t;
		return !e || !e.state ? h : (t = e.state, t.wsize = 0, t.whave = 0, t.wnext = 0, he(e));
	}
	function H(e, t) {
		var n, r;
		return !e || !e.state || (r = e.state, t < 0 ? (n = 0, t = -t) : (n = (t >> 4) + 1, t < 48 && (t &= 15)), t && (t < 8 || t > 15)) ? h : (r.window !== null && r.wbits !== t && (r.window = null), r.wrap = n, r.wbits = t, ge(e));
	}
	function U(e, t) {
		var n, r;
		return e ? (r = new me(), e.state = r, r.window = null, n = H(e, t), n !== f && (e.state = null), n) : h;
	}
	function W(e) {
		return U(e, V);
	}
	var G = !0, _e, ve;
	function ye(e) {
		if (G) {
			var n;
			for (_e = new t.Buf32(512), ve = new t.Buf32(32), n = 0; n < 144;) e.lens[n++] = 8;
			for (; n < 256;) e.lens[n++] = 9;
			for (; n < 280;) e.lens[n++] = 7;
			for (; n < 288;) e.lens[n++] = 8;
			for (a(s, e.lens, 0, 288, _e, 0, e.work, { bits: 9 }), n = 0; n < 32;) e.lens[n++] = 5;
			a(c, e.lens, 0, 32, ve, 0, e.work, { bits: 5 }), G = !1;
		}
		e.lencode = _e, e.lenbits = 9, e.distcode = ve, e.distbits = 5;
	}
	function be(e, n, r, i) {
		var a, o = e.state;
		return o.window === null && (o.wsize = 1 << o.wbits, o.wnext = 0, o.whave = 0, o.window = new t.Buf8(o.wsize)), i >= o.wsize ? (t.arraySet(o.window, n, r - o.wsize, o.wsize, 0), o.wnext = 0, o.whave = o.wsize) : (a = o.wsize - o.wnext, a > i && (a = i), t.arraySet(o.window, n, r - i, a, o.wnext), i -= a, i ? (t.arraySet(o.window, n, r - i, i, 0), o.wnext = i, o.whave = o.wsize) : (o.wnext += a, o.wnext === o.wsize && (o.wnext = 0), o.whave < o.wsize && (o.whave += a))), 0;
	}
	function xe(e, z) {
		var B, V, me, he, ge, H, U, W, G, _e, ve, xe, Se, Ce, K = 0, we, Te, Ee, De, Oe, ke, Ae, q, J = new t.Buf8(4), je, Me, Ne = [
			16,
			17,
			18,
			0,
			8,
			7,
			9,
			6,
			10,
			5,
			11,
			4,
			12,
			3,
			13,
			2,
			14,
			1,
			15
		];
		if (!e || !e.state || !e.output || !e.input && e.avail_in !== 0) return h;
		B = e.state, B.mode === O && (B.mode = k), ge = e.next_out, me = e.output, U = e.avail_out, he = e.next_in, V = e.input, H = e.avail_in, W = B.hold, G = B.bits, _e = H, ve = U, q = f;
		inf_leave: for (;;) switch (B.mode) {
			case b:
				if (B.wrap === 0) {
					B.mode = k;
					break;
				}
				for (; G < 16;) {
					if (H === 0) break inf_leave;
					H--, W += V[he++] << G, G += 8;
				}
				if (B.wrap & 2 && W === 35615) {
					B.check = 0, J[0] = W & 255, J[1] = W >>> 8 & 255, B.check = r(B.check, J, 2, 0), W = 0, G = 0, B.mode = x;
					break;
				}
				if (B.flags = 0, B.head && (B.head.done = !1), !(B.wrap & 1) || (((W & 255) << 8) + (W >> 8)) % 31) {
					e.msg = "incorrect header check", B.mode = fe;
					break;
				}
				if ((W & 15) !== y) {
					e.msg = "unknown compression method", B.mode = fe;
					break;
				}
				if (W >>>= 4, G -= 4, Ae = (W & 15) + 8, B.wbits === 0) B.wbits = Ae;
				else if (Ae > B.wbits) {
					e.msg = "invalid window size", B.mode = fe;
					break;
				}
				B.dmax = 1 << Ae, e.adler = B.check = 1, B.mode = W & 512 ? ne : O, W = 0, G = 0;
				break;
			case x:
				for (; G < 16;) {
					if (H === 0) break inf_leave;
					H--, W += V[he++] << G, G += 8;
				}
				if (B.flags = W, (B.flags & 255) !== y) {
					e.msg = "unknown compression method", B.mode = fe;
					break;
				}
				if (B.flags & 57344) {
					e.msg = "unknown header flags set", B.mode = fe;
					break;
				}
				B.head && (B.head.text = W >> 8 & 1), B.flags & 512 && (J[0] = W & 255, J[1] = W >>> 8 & 255, B.check = r(B.check, J, 2, 0)), W = 0, G = 0, B.mode = S;
			case S:
				for (; G < 32;) {
					if (H === 0) break inf_leave;
					H--, W += V[he++] << G, G += 8;
				}
				B.head && (B.head.time = W), B.flags & 512 && (J[0] = W & 255, J[1] = W >>> 8 & 255, J[2] = W >>> 16 & 255, J[3] = W >>> 24 & 255, B.check = r(B.check, J, 4, 0)), W = 0, G = 0, B.mode = C;
			case C:
				for (; G < 16;) {
					if (H === 0) break inf_leave;
					H--, W += V[he++] << G, G += 8;
				}
				B.head && (B.head.xflags = W & 255, B.head.os = W >> 8), B.flags & 512 && (J[0] = W & 255, J[1] = W >>> 8 & 255, B.check = r(B.check, J, 2, 0)), W = 0, G = 0, B.mode = w;
			case w:
				if (B.flags & 1024) {
					for (; G < 16;) {
						if (H === 0) break inf_leave;
						H--, W += V[he++] << G, G += 8;
					}
					B.length = W, B.head && (B.head.extra_len = W), B.flags & 512 && (J[0] = W & 255, J[1] = W >>> 8 & 255, B.check = r(B.check, J, 2, 0)), W = 0, G = 0;
				} else B.head && (B.head.extra = null);
				B.mode = T;
			case T:
				if (B.flags & 1024 && (xe = B.length, xe > H && (xe = H), xe && (B.head && (Ae = B.head.extra_len - B.length, B.head.extra || (B.head.extra = Array(B.head.extra_len)), t.arraySet(B.head.extra, V, he, xe, Ae)), B.flags & 512 && (B.check = r(B.check, V, xe, he)), H -= xe, he += xe, B.length -= xe), B.length)) break inf_leave;
				B.length = 0, B.mode = E;
			case E:
				if (B.flags & 2048) {
					if (H === 0) break inf_leave;
					xe = 0;
					do
						Ae = V[he + xe++], B.head && Ae && B.length < 65536 && (B.head.name += String.fromCharCode(Ae));
					while (Ae && xe < H);
					if (B.flags & 512 && (B.check = r(B.check, V, xe, he)), H -= xe, he += xe, Ae) break inf_leave;
				} else B.head && (B.head.name = null);
				B.length = 0, B.mode = ee;
			case ee:
				if (B.flags & 4096) {
					if (H === 0) break inf_leave;
					xe = 0;
					do
						Ae = V[he + xe++], B.head && Ae && B.length < 65536 && (B.head.comment += String.fromCharCode(Ae));
					while (Ae && xe < H);
					if (B.flags & 512 && (B.check = r(B.check, V, xe, he)), H -= xe, he += xe, Ae) break inf_leave;
				} else B.head && (B.head.comment = null);
				B.mode = te;
			case te:
				if (B.flags & 512) {
					for (; G < 16;) {
						if (H === 0) break inf_leave;
						H--, W += V[he++] << G, G += 8;
					}
					if (W !== (B.check & 65535)) {
						e.msg = "header crc mismatch", B.mode = fe;
						break;
					}
					W = 0, G = 0;
				}
				B.head && (B.head.hcrc = B.flags >> 9 & 1, B.head.done = !0), e.adler = B.check = 0, B.mode = O;
				break;
			case ne:
				for (; G < 32;) {
					if (H === 0) break inf_leave;
					H--, W += V[he++] << G, G += 8;
				}
				e.adler = B.check = pe(W), W = 0, G = 0, B.mode = D;
			case D:
				if (B.havedict === 0) return e.next_out = ge, e.avail_out = U, e.next_in = he, e.avail_in = H, B.hold = W, B.bits = G, m;
				e.adler = B.check = 1, B.mode = O;
			case O: if (z === u || z === d) break inf_leave;
			case k:
				if (B.last) {
					W >>>= G & 7, G -= G & 7, B.mode = le;
					break;
				}
				for (; G < 3;) {
					if (H === 0) break inf_leave;
					H--, W += V[he++] << G, G += 8;
				}
				switch (B.last = W & 1, W >>>= 1, --G, W & 3) {
					case 0:
						B.mode = A;
						break;
					case 1:
						if (ye(B), B.mode = M, z === d) {
							W >>>= 2, G -= 2;
							break inf_leave;
						}
						break;
					case 2:
						B.mode = ie;
						break;
					case 3: e.msg = "invalid block type", B.mode = fe;
				}
				W >>>= 2, G -= 2;
				break;
			case A:
				for (W >>>= G & 7, G -= G & 7; G < 32;) {
					if (H === 0) break inf_leave;
					H--, W += V[he++] << G, G += 8;
				}
				if ((W & 65535) != (W >>> 16 ^ 65535)) {
					e.msg = "invalid stored block lengths", B.mode = fe;
					break;
				}
				if (B.length = W & 65535, W = 0, G = 0, B.mode = j, z === d) break inf_leave;
			case j: B.mode = re;
			case re:
				if (xe = B.length, xe) {
					if (xe > H && (xe = H), xe > U && (xe = U), xe === 0) break inf_leave;
					t.arraySet(me, V, he, xe, ge), H -= xe, he += xe, U -= xe, ge += xe, B.length -= xe;
					break;
				}
				B.mode = O;
				break;
			case ie:
				for (; G < 14;) {
					if (H === 0) break inf_leave;
					H--, W += V[he++] << G, G += 8;
				}
				if (B.nlen = (W & 31) + 257, W >>>= 5, G -= 5, B.ndist = (W & 31) + 1, W >>>= 5, G -= 5, B.ncode = (W & 15) + 4, W >>>= 4, G -= 4, B.nlen > 286 || B.ndist > 30) {
					e.msg = "too many length or distance symbols", B.mode = fe;
					break;
				}
				B.have = 0, B.mode = ae;
			case ae:
				for (; B.have < B.ncode;) {
					for (; G < 3;) {
						if (H === 0) break inf_leave;
						H--, W += V[he++] << G, G += 8;
					}
					B.lens[Ne[B.have++]] = W & 7, W >>>= 3, G -= 3;
				}
				for (; B.have < 19;) B.lens[Ne[B.have++]] = 0;
				if (B.lencode = B.lendyn, B.lenbits = 7, je = { bits: B.lenbits }, q = a(o, B.lens, 0, 19, B.lencode, 0, B.work, je), B.lenbits = je.bits, q) {
					e.msg = "invalid code lengths set", B.mode = fe;
					break;
				}
				B.have = 0, B.mode = oe;
			case oe:
				for (; B.have < B.nlen + B.ndist;) {
					for (; K = B.lencode[W & (1 << B.lenbits) - 1], we = K >>> 24, Te = K >>> 16 & 255, Ee = K & 65535, !(we <= G);) {
						if (H === 0) break inf_leave;
						H--, W += V[he++] << G, G += 8;
					}
					if (Ee < 16) W >>>= we, G -= we, B.lens[B.have++] = Ee;
					else {
						if (Ee === 16) {
							for (Me = we + 2; G < Me;) {
								if (H === 0) break inf_leave;
								H--, W += V[he++] << G, G += 8;
							}
							if (W >>>= we, G -= we, B.have === 0) {
								e.msg = "invalid bit length repeat", B.mode = fe;
								break;
							}
							Ae = B.lens[B.have - 1], xe = 3 + (W & 3), W >>>= 2, G -= 2;
						} else if (Ee === 17) {
							for (Me = we + 3; G < Me;) {
								if (H === 0) break inf_leave;
								H--, W += V[he++] << G, G += 8;
							}
							W >>>= we, G -= we, Ae = 0, xe = 3 + (W & 7), W >>>= 3, G -= 3;
						} else {
							for (Me = we + 7; G < Me;) {
								if (H === 0) break inf_leave;
								H--, W += V[he++] << G, G += 8;
							}
							W >>>= we, G -= we, Ae = 0, xe = 11 + (W & 127), W >>>= 7, G -= 7;
						}
						if (B.have + xe > B.nlen + B.ndist) {
							e.msg = "invalid bit length repeat", B.mode = fe;
							break;
						}
						for (; xe--;) B.lens[B.have++] = Ae;
					}
				}
				if (B.mode === fe) break;
				if (B.lens[256] === 0) {
					e.msg = "invalid code -- missing end-of-block", B.mode = fe;
					break;
				}
				if (B.lenbits = 9, je = { bits: B.lenbits }, q = a(s, B.lens, 0, B.nlen, B.lencode, 0, B.work, je), B.lenbits = je.bits, q) {
					e.msg = "invalid literal/lengths set", B.mode = fe;
					break;
				}
				if (B.distbits = 6, B.distcode = B.distdyn, je = { bits: B.distbits }, q = a(c, B.lens, B.nlen, B.ndist, B.distcode, 0, B.work, je), B.distbits = je.bits, q) {
					e.msg = "invalid distances set", B.mode = fe;
					break;
				}
				if (B.mode = M, z === d) break inf_leave;
			case M: B.mode = se;
			case se:
				if (H >= 6 && U >= 258) {
					e.next_out = ge, e.avail_out = U, e.next_in = he, e.avail_in = H, B.hold = W, B.bits = G, i(e, ve), ge = e.next_out, me = e.output, U = e.avail_out, he = e.next_in, V = e.input, H = e.avail_in, W = B.hold, G = B.bits, B.mode === O && (B.back = -1);
					break;
				}
				for (B.back = 0; K = B.lencode[W & (1 << B.lenbits) - 1], we = K >>> 24, Te = K >>> 16 & 255, Ee = K & 65535, !(we <= G);) {
					if (H === 0) break inf_leave;
					H--, W += V[he++] << G, G += 8;
				}
				if (Te && !(Te & 240)) {
					for (De = we, Oe = Te, ke = Ee; K = B.lencode[ke + ((W & (1 << De + Oe) - 1) >> De)], we = K >>> 24, Te = K >>> 16 & 255, Ee = K & 65535, !(De + we <= G);) {
						if (H === 0) break inf_leave;
						H--, W += V[he++] << G, G += 8;
					}
					W >>>= De, G -= De, B.back += De;
				}
				if (W >>>= we, G -= we, B.back += we, B.length = Ee, Te === 0) {
					B.mode = I;
					break;
				}
				if (Te & 32) {
					B.back = -1, B.mode = O;
					break;
				}
				if (Te & 64) {
					e.msg = "invalid literal/length code", B.mode = fe;
					break;
				}
				B.extra = Te & 15, B.mode = N;
			case N:
				if (B.extra) {
					for (Me = B.extra; G < Me;) {
						if (H === 0) break inf_leave;
						H--, W += V[he++] << G, G += 8;
					}
					B.length += W & (1 << B.extra) - 1, W >>>= B.extra, G -= B.extra, B.back += B.extra;
				}
				B.was = B.length, B.mode = ce;
			case ce:
				for (; K = B.distcode[W & (1 << B.distbits) - 1], we = K >>> 24, Te = K >>> 16 & 255, Ee = K & 65535, !(we <= G);) {
					if (H === 0) break inf_leave;
					H--, W += V[he++] << G, G += 8;
				}
				if (!(Te & 240)) {
					for (De = we, Oe = Te, ke = Ee; K = B.distcode[ke + ((W & (1 << De + Oe) - 1) >> De)], we = K >>> 24, Te = K >>> 16 & 255, Ee = K & 65535, !(De + we <= G);) {
						if (H === 0) break inf_leave;
						H--, W += V[he++] << G, G += 8;
					}
					W >>>= De, G -= De, B.back += De;
				}
				if (W >>>= we, G -= we, B.back += we, Te & 64) {
					e.msg = "invalid distance code", B.mode = fe;
					break;
				}
				B.offset = Ee, B.extra = Te & 15, B.mode = P;
			case P:
				if (B.extra) {
					for (Me = B.extra; G < Me;) {
						if (H === 0) break inf_leave;
						H--, W += V[he++] << G, G += 8;
					}
					B.offset += W & (1 << B.extra) - 1, W >>>= B.extra, G -= B.extra, B.back += B.extra;
				}
				if (B.offset > B.dmax) {
					e.msg = "invalid distance too far back", B.mode = fe;
					break;
				}
				B.mode = F;
			case F:
				if (U === 0) break inf_leave;
				if (xe = ve - U, B.offset > xe) {
					if (xe = B.offset - xe, xe > B.whave && B.sane) {
						e.msg = "invalid distance too far back", B.mode = fe;
						break;
					}
					xe > B.wnext ? (xe -= B.wnext, Se = B.wsize - xe) : Se = B.wnext - xe, xe > B.length && (xe = B.length), Ce = B.window;
				} else Ce = me, Se = ge - B.offset, xe = B.length;
				xe > U && (xe = U), U -= xe, B.length -= xe;
				do
					me[ge++] = Ce[Se++];
				while (--xe);
				B.length === 0 && (B.mode = se);
				break;
			case I:
				if (U === 0) break inf_leave;
				me[ge++] = B.length, U--, B.mode = se;
				break;
			case le:
				if (B.wrap) {
					for (; G < 32;) {
						if (H === 0) break inf_leave;
						H--, W |= V[he++] << G, G += 8;
					}
					if (ve -= U, e.total_out += ve, B.total += ve, ve && (e.adler = B.check = B.flags ? r(B.check, me, ve, ge - ve) : n(B.check, me, ve, ge - ve)), ve = U, (B.flags ? W : pe(W)) !== B.check) {
						e.msg = "incorrect data check", B.mode = fe;
						break;
					}
					W = 0, G = 0;
				}
				B.mode = ue;
			case ue:
				if (B.wrap && B.flags) {
					for (; G < 32;) {
						if (H === 0) break inf_leave;
						H--, W += V[he++] << G, G += 8;
					}
					if (W !== (B.total & 4294967295)) {
						e.msg = "incorrect length check", B.mode = fe;
						break;
					}
					W = 0, G = 0;
				}
				B.mode = de;
			case de:
				q = p;
				break inf_leave;
			case fe:
				q = g;
				break inf_leave;
			case L: return _;
			case R:
			default: return h;
		}
		return e.next_out = ge, e.avail_out = U, e.next_in = he, e.avail_in = H, B.hold = W, B.bits = G, (B.wsize || ve !== e.avail_out && B.mode < fe && (B.mode < le || z !== l)) && be(e, e.output, e.next_out, ve - e.avail_out) ? (B.mode = L, _) : (_e -= e.avail_in, ve -= e.avail_out, e.total_in += _e, e.total_out += ve, B.total += ve, B.wrap && ve && (e.adler = B.check = B.flags ? r(B.check, me, ve, e.next_out - ve) : n(B.check, me, ve, e.next_out - ve)), e.data_type = B.bits + (B.last ? 64 : 0) + (B.mode === O ? 128 : 0) + (B.mode === M || B.mode === j ? 256 : 0), (_e === 0 && ve === 0 || z === l) && q === f && (q = v), q);
	}
	function Se(e) {
		if (!e || !e.state) return h;
		var t = e.state;
		return t.window &&= null, e.state = null, f;
	}
	function Ce(e, t) {
		var n;
		return !e || !e.state || (n = e.state, !(n.wrap & 2)) ? h : (n.head = t, t.done = !1, f);
	}
	function K(e, t) {
		var r = t.length, i, a, o;
		return !e || !e.state || (i = e.state, i.wrap !== 0 && i.mode !== D) ? h : i.mode === D && (a = 1, a = n(a, t, r, 0), a !== i.check) ? g : (o = be(e, t, r, r), o ? (i.mode = L, _) : (i.havedict = 1, f));
	}
	e.inflateReset = ge, e.inflateReset2 = H, e.inflateResetKeep = he, e.inflateInit = W, e.inflateInit2 = U, e.inflate = xe, e.inflateEnd = Se, e.inflateGetHeader = Ce, e.inflateSetDictionary = K, e.inflateInfo = "pako inflate (from Nodeca project)";
})), $y = /* @__PURE__ */ o(((e, t) => {
	t.exports = {
		Z_NO_FLUSH: 0,
		Z_PARTIAL_FLUSH: 1,
		Z_SYNC_FLUSH: 2,
		Z_FULL_FLUSH: 3,
		Z_FINISH: 4,
		Z_BLOCK: 5,
		Z_TREES: 6,
		Z_OK: 0,
		Z_STREAM_END: 1,
		Z_NEED_DICT: 2,
		Z_ERRNO: -1,
		Z_STREAM_ERROR: -2,
		Z_DATA_ERROR: -3,
		Z_BUF_ERROR: -5,
		Z_NO_COMPRESSION: 0,
		Z_BEST_SPEED: 1,
		Z_BEST_COMPRESSION: 9,
		Z_DEFAULT_COMPRESSION: -1,
		Z_FILTERED: 1,
		Z_HUFFMAN_ONLY: 2,
		Z_RLE: 3,
		Z_FIXED: 4,
		Z_DEFAULT_STRATEGY: 0,
		Z_BINARY: 0,
		Z_TEXT: 1,
		Z_UNKNOWN: 2,
		Z_DEFLATED: 8
	};
})), eb = /* @__PURE__ */ o(((e, t) => {
	function n() {
		this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1;
	}
	t.exports = n;
})), tb = /* @__PURE__ */ o(((e) => {
	var t = Qy(), n = Vy(), r = qy(), i = $y(), a = Gy(), o = Jy(), s = eb(), c = Object.prototype.toString;
	function l(e) {
		if (!(this instanceof l)) return new l(e);
		this.options = n.assign({
			chunkSize: 16384,
			windowBits: 0,
			to: ""
		}, e || {});
		var u = this.options;
		u.raw && u.windowBits >= 0 && u.windowBits < 16 && (u.windowBits = -u.windowBits, u.windowBits === 0 && (u.windowBits = -15)), u.windowBits >= 0 && u.windowBits < 16 && !(e && e.windowBits) && (u.windowBits += 32), u.windowBits > 15 && u.windowBits < 48 && (u.windowBits & 15 || (u.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new o(), this.strm.avail_out = 0;
		var d = t.inflateInit2(this.strm, u.windowBits);
		if (d !== i.Z_OK || (this.header = new s(), t.inflateGetHeader(this.strm, this.header), u.dictionary && (typeof u.dictionary == "string" ? u.dictionary = r.string2buf(u.dictionary) : c.call(u.dictionary) === "[object ArrayBuffer]" && (u.dictionary = new Uint8Array(u.dictionary)), u.raw && (d = t.inflateSetDictionary(this.strm, u.dictionary), d !== i.Z_OK)))) throw Error(a[d]);
	}
	l.prototype.push = function(e, a) {
		var o = this.strm, s = this.options.chunkSize, l = this.options.dictionary, u, d, f, p, m, h = !1;
		if (this.ended) return !1;
		d = a === ~~a ? a : a === !0 ? i.Z_FINISH : i.Z_NO_FLUSH, typeof e == "string" ? o.input = r.binstring2buf(e) : c.call(e) === "[object ArrayBuffer]" ? o.input = new Uint8Array(e) : o.input = e, o.next_in = 0, o.avail_in = o.input.length;
		do {
			if (o.avail_out === 0 && (o.output = new n.Buf8(s), o.next_out = 0, o.avail_out = s), u = t.inflate(o, i.Z_NO_FLUSH), u === i.Z_NEED_DICT && l && (u = t.inflateSetDictionary(this.strm, l)), u === i.Z_BUF_ERROR && h === !0 && (u = i.Z_OK, h = !1), u !== i.Z_STREAM_END && u !== i.Z_OK) return this.onEnd(u), this.ended = !0, !1;
			o.next_out && (o.avail_out === 0 || u === i.Z_STREAM_END || o.avail_in === 0 && (d === i.Z_FINISH || d === i.Z_SYNC_FLUSH)) && (this.options.to === "string" ? (f = r.utf8border(o.output, o.next_out), p = o.next_out - f, m = r.buf2string(o.output, f), o.next_out = p, o.avail_out = s - p, p && n.arraySet(o.output, o.output, f, p, 0), this.onData(m)) : this.onData(n.shrinkBuf(o.output, o.next_out))), o.avail_in === 0 && o.avail_out === 0 && (h = !0);
		} while ((o.avail_in > 0 || o.avail_out === 0) && u !== i.Z_STREAM_END);
		return u === i.Z_STREAM_END && (d = i.Z_FINISH), d === i.Z_FINISH ? (u = t.inflateEnd(this.strm), this.onEnd(u), this.ended = !0, u === i.Z_OK) : d === i.Z_SYNC_FLUSH ? (this.onEnd(i.Z_OK), o.avail_out = 0, !0) : !0;
	}, l.prototype.onData = function(e) {
		this.chunks.push(e);
	}, l.prototype.onEnd = function(e) {
		e === i.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = n.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg;
	};
	function u(e, t) {
		var n = new l(t);
		if (n.push(e, !0), n.err) throw n.msg || a[n.err];
		return n.result;
	}
	function d(e, t) {
		return t ||= {}, t.raw = !0, u(e, t);
	}
	e.Inflate = l, e.inflate = u, e.inflateRaw = d, e.ungzip = u;
})), nb = /* @__PURE__ */ o(((e, t) => {
	var n = Vy().assign, r = Yy(), i = tb(), a = $y(), o = {};
	n(o, r, i, a), t.exports = o;
})), rb = /* @__PURE__ */ o(((e, t) => {
	var n = (e, t) => function(...n) {
		let r = t.promiseModule;
		return new r((r, i) => {
			t.multiArgs ? n.push((...e) => {
				t.errorFirst ? e[0] ? i(e) : (e.shift(), r(e)) : r(e);
			}) : t.errorFirst ? n.push((e, t) => {
				e ? i(e) : r(t);
			}) : n.push(r), e.apply(this, n);
		});
	};
	t.exports = (e, t) => {
		t = Object.assign({
			exclude: [/.+(Sync|Stream)$/],
			errorFirst: !0,
			promiseModule: Promise
		}, t);
		let r = typeof e;
		if (!(e !== null && (r === "object" || r === "function"))) throw TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e === null ? "null" : r}\``);
		let i = (e) => {
			let n = (t) => typeof t == "string" ? e === t : t.test(e);
			return t.include ? t.include.some(n) : !t.exclude.some(n);
		}, a;
		a = r === "function" ? function(...r) {
			return t.excludeMain ? e(...r) : n(e, t).apply(this, r);
		} : Object.create(Object.getPrototypeOf(e));
		for (let r in e) {
			let o = e[r];
			a[r] = typeof o == "function" && i(r) ? n(o, t) : o;
		}
		return a;
	};
})), ib = /* @__PURE__ */ o(((e, t) => {
	function n(e) {
		return Array.isArray(e) ? e : [e];
	}
	var r = /^\s+$/, i = /(?:[^\\]|^)\\$/, a = /^\\!/, o = /^\\#/, s = /\r?\n/g, c = /^\.*\/|^\.+$/, l = "node-ignore";
	/* istanbul ignore else */
	typeof Symbol < "u" && (l = Symbol.for("node-ignore"));
	var u = l, d = (e, t, n) => Object.defineProperty(e, t, { value: n }), f = /([0-z])-([0-z])/g, p = () => !1, m = (e) => e.replace(f, (e, t, n) => t.charCodeAt(0) <= n.charCodeAt(0) ? e : ""), h = (e) => {
		let { length: t } = e;
		return e.slice(0, t - t % 2);
	}, g = [
		[/^\uFEFF/, () => ""],
		[/((?:\\\\)*?)(\\?\s+)$/, (e, t, n) => t + (n.indexOf("\\") === 0 ? " " : "")],
		[/(\\+?)\s/g, (e, t) => {
			let { length: n } = t;
			return t.slice(0, n - n % 2) + " ";
		}],
		[/[\\$.|*+(){^]/g, (e) => `\\${e}`],
		[/(?!\\)\?/g, () => "[^/]"],
		[/^\//, () => "^"],
		[/\//g, () => "\\/"],
		[/^\^*\\\*\\\*\\\//, () => "^(?:.*\\/)?"],
		[/^(?=[^^])/, function() {
			return /\/(?!$)/.test(this) ? "^" : "(?:^|\\/)";
		}],
		[/\\\/\\\*\\\*(?=\\\/|$)/g, (e, t, n) => t + 6 < n.length ? "(?:\\/[^\\/]+)*" : "\\/.+"],
		[/(^|[^\\]+)(\\\*)+(?=.+)/g, (e, t, n) => t + n.replace(/\\\*/g, "[^\\/]*")],
		[/\\\\\\(?=[$.|*+(){^])/g, () => "\\"],
		[/\\\\/g, () => "\\"],
		[/(\\)?\[([^\]/]*?)(\\*)($|\])/g, (e, t, n, r, i) => t === "\\" ? `\\[${n}${h(r)}${i}` : i === "]" && r.length % 2 == 0 ? `[${m(n)}${r}]` : "[]"],
		[/(?:[^*])$/, (e) => /\/$/.test(e) ? `${e}$` : `${e}(?=$|\\/$)`],
		[/(\^|\\\/)?\\\*$/, (e, t) => `${t ? `${t}[^/]+` : "[^/]*"}(?=$|\\/$)`]
	], _ = Object.create(null), v = (e, t) => {
		let n = _[e];
		return n || (n = g.reduce((t, [n, r]) => t.replace(n, r.bind(e)), e), _[e] = n), t ? new RegExp(n, "i") : new RegExp(n);
	}, y = (e) => typeof e == "string", b = (e) => e && y(e) && !r.test(e) && !i.test(e) && e.indexOf("#") !== 0, x = (e) => e.split(s), S = class {
		constructor(e, t, n, r) {
			this.origin = e, this.pattern = t, this.negative = n, this.regex = r;
		}
	}, C = (e, t) => {
		let n = e, r = !1;
		e.indexOf("!") === 0 && (r = !0, e = e.substr(1)), e = e.replace(a, "!").replace(o, "#");
		let i = v(e, t);
		return new S(n, e, r, i);
	}, w = (e, t) => {
		throw new t(e);
	}, T = (e, t, n) => y(e) ? e ? !T.isNotRelative(e) || n(`path should be a \`path.relative()\`d string, but got "${t}"`, RangeError) : n("path must not be empty", TypeError) : n(`path must be a string, but got \`${t}\``, TypeError), E = (e) => c.test(e);
	T.isNotRelative = E, T.convert = (e) => e;
	var ee = class {
		constructor({ ignorecase: e = !0, ignoreCase: t = e, allowRelativePaths: n = !1 } = {}) {
			d(this, u, !0), this._rules = [], this._ignoreCase = t, this._allowRelativePaths = n, this._initCache();
		}
		_initCache() {
			this._ignoreCache = Object.create(null), this._testCache = Object.create(null);
		}
		_addPattern(e) {
			if (e && e[u]) {
				this._rules = this._rules.concat(e._rules), this._added = !0;
				return;
			}
			if (b(e)) {
				let t = C(e, this._ignoreCase);
				this._added = !0, this._rules.push(t);
			}
		}
		add(e) {
			return this._added = !1, n(y(e) ? x(e) : e).forEach(this._addPattern, this), this._added && this._initCache(), this;
		}
		addPattern(e) {
			return this.add(e);
		}
		_testOne(e, t) {
			let n = !1, r = !1;
			return this._rules.forEach((i) => {
				let { negative: a } = i;
				r === a && n !== r || a && !n && !r && !t || i.regex.test(e) && (n = !a, r = a);
			}), {
				ignored: n,
				unignored: r
			};
		}
		_test(e, t, n, r) {
			let i = e && T.convert(e);
			return T(i, e, this._allowRelativePaths ? p : w), this._t(i, t, n, r);
		}
		_t(e, t, n, r) {
			if (e in t) return t[e];
			if (r ||= e.split("/"), r.pop(), !r.length) return t[e] = this._testOne(e, n);
			let i = this._t(r.join("/") + "/", t, n, r);
			return t[e] = i.ignored ? i : this._testOne(e, n);
		}
		ignores(e) {
			return this._test(e, this._ignoreCache, !1).ignored;
		}
		createFilter() {
			return (e) => !this.ignores(e);
		}
		filter(e) {
			return n(e).filter(this.createFilter());
		}
		test(e) {
			return this._test(e, this._testCache, !0);
		}
	}, te = (e) => new ee(e);
	/* istanbul ignore if */
	if (te.isPathValid = (e) => T(e && T.convert(e), e, p), te.default = te, t.exports = te, typeof process < "u" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")) {
		T.convert = (e) => /^\\\\\?\\/.test(e) || /["<>|\u0000-\u001F]+/u.test(e) ? e : e.replace(/\\/g, "/");
		let e = /^[a-z]:\//i;
		T.isNotRelative = (t) => e.test(t) || E(t);
	}
})), ab = /* @__PURE__ */ o(((e, t) => {
	function n(e) {
		return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
	}
	function r(e, t, r) {
		return t = t instanceof RegExp ? t : new RegExp(n(t), "g"), e.replace(t, r);
	}
	t.exports = { clean: function(e) {
		if (typeof e != "string") throw Error("Expected a string, received: " + e);
		return e = r(e, "./", "/"), e = r(e, "..", "."), e = r(e, " ", "-"), e = r(e, /^[~^:?*\\\-]/g, ""), e = r(e, /[~^:?*\\]/g, "-"), e = r(e, /[~^:?*\\\-]$/g, ""), e = r(e, "@{", "-"), e = r(e, /\.$/g, ""), e = r(e, /\/$/g, ""), e = r(e, /\.lock$/g, ""), e;
	} };
})), ob = /* @__PURE__ */ o(((e, t) => {
	t.exports = function(e, t) {
		var n = e, r = t, i = n.length, a = r.length, o = !1, s = null, c = i + 1, l = [], u = [], d = [], f = "", p = -1, m = 0, h = 1, g, _, v = function() {
			i >= a && (g = n, _ = i, n = r, r = g, i = a, a = _, o = !0, c = i + 1);
		}, y = function(e, t, n) {
			return {
				x: e,
				y: t,
				k: n
			};
		}, b = function(e, t) {
			return {
				elem: e,
				t
			};
		}, x = function(e, t, o) {
			var s = t > o ? l[e - 1 + c] : l[e + 1 + c], d, f = Math.max(t, o);
			for (d = f - e; d < i && f < a && n[d] === r[f];) ++d, ++f;
			return l[e + c] = u.length, u[u.length] = new y(d, f, s), f;
		}, S = function(e) {
			var t = i = 1, i, a = s = 0, s, c;
			for (c = e.length - 1; c >= 0; --c) for (; a < e[c].x || s < e[c].y;) e[c].y - e[c].x > s - a ? (o ? d[d.length] = new b(r[s], p) : d[d.length] = new b(r[s], h), ++i, ++s) : e[c].y - e[c].x < s - a ? (o ? d[d.length] = new b(n[a], h) : d[d.length] = new b(n[a], p), ++t, ++a) : (d[d.length] = new b(n[a], m), f += n[a], ++t, ++i, ++a, ++s);
		};
		return v(), {
			SES_DELETE: -1,
			SES_COMMON: 0,
			SES_ADD: 1,
			editdistance: function() {
				return s;
			},
			getlcs: function() {
				return f;
			},
			getses: function() {
				return d;
			},
			compose: function() {
				var e = a - i, t = i + a + 3, n = {}, r, o, d, f, p;
				for (f = 0; f < t; ++f) n[f] = -1, l[f] = -1;
				r = -1;
				do {
					for (++r, p = -r; p <= e - 1; ++p) n[p + c] = x(p, n[p - 1 + c] + 1, n[p + 1 + c]);
					for (p = e + r; p >= e + 1; --p) n[p + c] = x(p, n[p - 1 + c] + 1, n[p + 1 + c]);
					n[e + c] = x(e, n[e - 1 + c] + 1, n[e + 1 + c]);
				} while (n[e + c] !== a);
				for (s = e + 2 * r, o = l[e + c], d = []; o !== -1;) d[d.length] = new y(u[o].x, u[o].y, null), o = u[o].k;
				S(d);
			}
		};
	};
})), sb = /* @__PURE__ */ o(((e, t) => {
	var n = ob();
	function r(e, t) {
		var r = new n(e, t);
		r.compose();
		for (var i = r.getses(), a, o, s = e.length - 1, c = t.length - 1, l = i.length - 1; l >= 0; --l) i[l].t === r.SES_COMMON ? (o ? (o.chain = {
			file1index: s,
			file2index: c,
			chain: null
		}, o = o.chain) : (a = {
			file1index: s,
			file2index: c,
			chain: null
		}, o = a), s--, c--) : i[l].t === r.SES_DELETE ? s-- : i[l].t === r.SES_ADD && c--;
		var u = {
			file1index: -1,
			file2index: -1,
			chain: null
		};
		return o ? (o.chain = u, a) : u;
	}
	function i(e, t) {
		for (var n = [], i = e.length, a = t.length, o = r(e, t); o !== null; o = o.chain) {
			var s = i - o.file1index - 1, c = a - o.file2index - 1;
			i = o.file1index, a = o.file2index, (s || c) && n.push({
				file1: [i + 1, s],
				file2: [a + 1, c]
			});
		}
		return n.reverse(), n;
	}
	function a(e, t, n) {
		var r, a = i(t, e), o = i(t, n), s = [];
		function c(e, t) {
			s.push([
				e.file1[0],
				t,
				e.file1[1],
				e.file2[0],
				e.file2[1]
			]);
		}
		for (r = 0; r < a.length; r++) c(a[r], 0);
		for (r = 0; r < o.length; r++) c(o[r], 2);
		s.sort(function(e, t) {
			return e[0] - t[0];
		});
		var l = [], u = 0;
		function d(e) {
			e > u && (l.push([
				1,
				u,
				e - u
			]), u = e);
		}
		for (var f = 0; f < s.length; f++) {
			for (var p = f, m = s[f], h = m[0], g = h + m[2]; f < s.length - 1;) {
				var _ = s[f + 1], v = _[0];
				if (v > g) break;
				g = Math.max(g, v + _[2]), f++;
			}
			if (d(h), p == f) m[4] > 0 && l.push([
				m[1],
				m[3],
				m[4]
			]);
			else {
				var y = {
					0: [
						e.length,
						-1,
						t.length,
						-1
					],
					2: [
						n.length,
						-1,
						t.length,
						-1
					]
				};
				for (r = p; r <= f; r++) {
					m = s[r];
					var b = y[m[1]], x = m[0], S = x + m[2], C = m[3], w = C + m[4];
					b[0] = Math.min(C, b[0]), b[1] = Math.max(w, b[1]), b[2] = Math.min(x, b[2]), b[3] = Math.max(S, b[3]);
				}
				var T = y[0][0] + (h - y[0][2]), E = y[0][1] + (g - y[0][3]), ee = y[2][0] + (h - y[2][2]), te = y[2][1] + (g - y[2][3]);
				l.push([
					-1,
					T,
					E - T,
					h,
					g - h,
					ee,
					te - ee
				]);
			}
			u = g;
		}
		return d(t.length), l;
	}
	function o(e, t, n) {
		var r = [], i = [
			e,
			t,
			n
		], o = a(e, t, n), s = [];
		function c() {
			s.length && r.push({ ok: s }), s = [];
		}
		function l(e) {
			for (var t = 0; t < e.length; t++) s.push(e[t]);
		}
		function u(t) {
			if (t[2] != t[6]) return !0;
			for (var r = t[1], i = t[5], a = 0; a < t[2]; a++) if (e[a + r] != n[a + i]) return !0;
			return !1;
		}
		for (var d = 0; d < o.length; d++) {
			var f = o[d], p = f[0];
			p == -1 ? u(f) ? (c(), r.push({ conflict: {
				a: e.slice(f[1], f[1] + f[2]),
				aIndex: f[1],
				o: t.slice(f[3], f[3] + f[4]),
				oIndex: f[3],
				b: n.slice(f[5], f[5] + f[6]),
				bIndex: f[5]
			} })) : l(i[0].slice(f[1], f[1] + f[2])) : l(i[p].slice(f[1], f[1] + f[2]));
		}
		return c(), r;
	}
	t.exports = o;
})), cb = /* @__PURE__ */ l(zv(), 1), lb = /* @__PURE__ */ l(zy(), 1), ub = /* @__PURE__ */ l(By(), 1), db = /* @__PURE__ */ l(nb(), 1), fb = /* @__PURE__ */ l(rb(), 1), pb = /* @__PURE__ */ l(ib(), 1), mb = /* @__PURE__ */ l(ab(), 1), hb = /* @__PURE__ */ l(sb(), 1), gb = class e extends Error {
	constructor(e) {
		super(e), this.caller = "";
	}
	toJSON() {
		return {
			code: this.code,
			data: this.data,
			caller: this.caller,
			message: this.message,
			stack: this.stack
		};
	}
	fromJSON(t) {
		let n = new e(t.message);
		return n.code = t.code, n.data = t.data, n.caller = t.caller, n.stack = t.stack, n;
	}
	get isIsomorphicGitError() {
		return !0;
	}
}, _b = class e extends gb {
	constructor(t) {
		super(`Modifying the index is not possible because you have unmerged files: ${t.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`), this.code = this.name = e.code, this.data = { filepaths: t };
	}
};
_b.code = "UnmergedPathsError";
var vb = class e extends gb {
	constructor(t) {
		super(`An internal error caused this command to fail.\n\nIf you're using an application that depends on isomorphic-git, please report this error to that application's developers.\n\nIf you're a developer and you believe this is a bug in isomorphic-git, please file an issue at https://github.com/isomorphic-git/isomorphic-git/issues with a minimal reproduction, version and environment details, and this error message: ${t}`), this.code = this.name = e.code, this.data = { message: t };
	}
};
vb.code = "InternalError";
var yb = class e extends gb {
	constructor(t) {
		super(`The filepath "${t}" contains unsafe character sequences`), this.code = this.name = e.code, this.data = { filepath: t };
	}
};
yb.code = "UnsafeFilepathError";
var bb = class {
	constructor(e) {
		this.buffer = e, this._start = 0;
	}
	eof() {
		return this._start >= this.buffer.length;
	}
	tell() {
		return this._start;
	}
	seek(e) {
		this._start = e;
	}
	slice(e) {
		let t = this.buffer.slice(this._start, this._start + e);
		return this._start += e, t;
	}
	toString(e, t) {
		let n = this.buffer.toString(e, this._start, this._start + t);
		return this._start += t, n;
	}
	write(e, t, n) {
		let r = this.buffer.write(e, this._start, t, n);
		return this._start += t, r;
	}
	copy(e, t, n) {
		let r = e.copy(this.buffer, this._start, t, n);
		return this._start += r, r;
	}
	readUInt8() {
		let e = this.buffer.readUInt8(this._start);
		return this._start += 1, e;
	}
	writeUInt8(e) {
		let t = this.buffer.writeUInt8(e, this._start);
		return this._start += 1, t;
	}
	readUInt16BE() {
		let e = this.buffer.readUInt16BE(this._start);
		return this._start += 2, e;
	}
	writeUInt16BE(e) {
		let t = this.buffer.writeUInt16BE(e, this._start);
		return this._start += 2, t;
	}
	readUInt32BE() {
		let e = this.buffer.readUInt32BE(this._start);
		return this._start += 4, e;
	}
	writeUInt32BE(e) {
		let t = this.buffer.writeUInt32BE(e, this._start);
		return this._start += 4, t;
	}
};
function xb(e, t) {
	return -(e < t) || +(e > t);
}
function Sb(e, t) {
	return xb(e.path, t.path);
}
function Cb(e) {
	let t = e > 0 ? e >> 12 : 0;
	t !== 4 && t !== 8 && t !== 10 && t !== 14 && (t = 8);
	let n = e & 511;
	return n = n & 73 ? 493 : 420, t !== 8 && (n = 0), (t << 12) + n;
}
var wb = 2 ** 32;
function Tb(e, t, n, r) {
	if (e !== void 0 && t !== void 0) return [e, t];
	n === void 0 && (n = r.valueOf());
	let i = Math.floor(n / 1e3);
	return [i, (n - i * 1e3) * 1e6];
}
function Eb(e) {
	let [t, n] = Tb(e.ctimeSeconds, e.ctimeNanoseconds, e.ctimeMs, e.ctime), [r, i] = Tb(e.mtimeSeconds, e.mtimeNanoseconds, e.mtimeMs, e.mtime);
	return {
		ctimeSeconds: t % wb,
		ctimeNanoseconds: n % wb,
		mtimeSeconds: r % wb,
		mtimeNanoseconds: i % wb,
		dev: e.dev % wb,
		ino: e.ino % wb,
		mode: Cb(e.mode % wb),
		uid: e.uid % wb,
		gid: e.gid % wb,
		size: e.size > -1 ? e.size % wb : 0
	};
}
function Db(e) {
	let t = "";
	for (let n of new Uint8Array(e)) n < 16 && (t += "0"), t += n.toString(16);
	return t;
}
var Ob = null;
async function kb(e) {
	return Ob === null && (Ob = await Mb()), Ob ? jb(e) : Ab(e);
}
function Ab(e) {
	return new lb.default().update(e).digest("hex");
}
async function jb(e) {
	return Db(await crypto.subtle.digest("SHA-1", e));
}
async function Mb() {
	try {
		return await jb(new Uint8Array([])) === "da39a3ee5e6b4b0d3255bfef95601890afd80709";
	} catch {}
	return !1;
}
function Nb(e) {
	return {
		assumeValid: !!(e & 32768),
		extended: !!(e & 16384),
		stage: (e & 12288) >> 12,
		nameLength: e & 4095
	};
}
function Pb(e) {
	let t = e.flags;
	return t.extended = !1, t.nameLength = Math.min(Buffer.from(e.path).length, 4095), (t.assumeValid ? 32768 : 0) + (t.extended ? 16384 : 0) + ((t.stage & 3) << 12) + (t.nameLength & 4095);
}
var Fb = class e {
	constructor(e, t) {
		this._dirty = !1, this._unmergedPaths = t || /* @__PURE__ */ new Set(), this._entries = e || /* @__PURE__ */ new Map();
	}
	_addEntry(e) {
		if (e.flags.stage === 0) e.stages = [e], this._entries.set(e.path, e), this._unmergedPaths.delete(e.path);
		else {
			let t = this._entries.get(e.path);
			t ||= (this._entries.set(e.path, e), e), t.stages[e.flags.stage] = e, this._unmergedPaths.add(e.path);
		}
	}
	static async from(t) {
		if (Buffer.isBuffer(t)) return e.fromBuffer(t);
		if (t === null) return new e(null);
		throw new vb("invalid type passed to GitIndex.from");
	}
	static async fromBuffer(t) {
		if (t.length === 0) throw new vb("Index file is empty (.git/index)");
		let n = new e(), r = new bb(t), i = r.toString("utf8", 4);
		if (i !== "DIRC") throw new vb(`Invalid dircache magic file number: ${i}`);
		let a = await kb(t.slice(0, -20)), o = t.slice(-20).toString("hex");
		if (o !== a) throw new vb(`Invalid checksum in GitIndex buffer: expected ${o} but saw ${a}`);
		let s = r.readUInt32BE();
		if (s !== 2) throw new vb(`Unsupported dircache version: ${s}`);
		let c = r.readUInt32BE(), l = 0;
		for (; !r.eof() && l < c;) {
			let e = {};
			e.ctimeSeconds = r.readUInt32BE(), e.ctimeNanoseconds = r.readUInt32BE(), e.mtimeSeconds = r.readUInt32BE(), e.mtimeNanoseconds = r.readUInt32BE(), e.dev = r.readUInt32BE(), e.ino = r.readUInt32BE(), e.mode = r.readUInt32BE(), e.uid = r.readUInt32BE(), e.gid = r.readUInt32BE(), e.size = r.readUInt32BE(), e.oid = r.slice(20).toString("hex"), e.flags = Nb(r.readUInt16BE());
			let i = t.indexOf(0, r.tell() + 1) - r.tell();
			if (i < 1) throw new vb(`Got a path length of: ${i}`);
			if (e.path = r.toString("utf8", i), e.path.includes("..\\") || e.path.includes("../")) throw new yb(e.path);
			let a = 8 - (r.tell() - 12) % 8;
			for (a === 0 && (a = 8); a--;) {
				let t = r.readUInt8();
				if (t !== 0) throw new vb(`Expected 1-8 null characters but got '${t}' after ${e.path}`);
				if (r.eof()) throw new vb("Unexpected end of file");
			}
			e.stages = [], n._addEntry(e), l++;
		}
		return n;
	}
	get unmergedPaths() {
		return [...this._unmergedPaths];
	}
	get entries() {
		return [...this._entries.values()].sort(Sb);
	}
	get entriesMap() {
		return this._entries;
	}
	get entriesFlat() {
		return [...this.entries].flatMap((e) => e.stages.length > 1 ? e.stages.filter((e) => e) : e);
	}
	*[Symbol.iterator]() {
		for (let e of this.entries) yield e;
	}
	insert({ filepath: e, stats: t, oid: n, stage: r = 0 }) {
		t ||= {
			ctimeSeconds: 0,
			ctimeNanoseconds: 0,
			mtimeSeconds: 0,
			mtimeNanoseconds: 0,
			dev: 0,
			ino: 0,
			mode: 0,
			uid: 0,
			gid: 0,
			size: 0
		}, t = Eb(t);
		let i = Buffer.from(e), a = {
			ctimeSeconds: t.ctimeSeconds,
			ctimeNanoseconds: t.ctimeNanoseconds,
			mtimeSeconds: t.mtimeSeconds,
			mtimeNanoseconds: t.mtimeNanoseconds,
			dev: t.dev,
			ino: t.ino,
			mode: t.mode || 33188,
			uid: t.uid,
			gid: t.gid,
			size: t.size,
			path: e,
			oid: n,
			flags: {
				assumeValid: !1,
				extended: !1,
				stage: r,
				nameLength: i.length < 4095 ? i.length : 4095
			},
			stages: []
		};
		this._addEntry(a), this._dirty = !0;
	}
	delete({ filepath: e }) {
		if (this._entries.has(e)) this._entries.delete(e);
		else for (let t of this._entries.keys()) t.startsWith(e + "/") && this._entries.delete(t);
		this._unmergedPaths.has(e) && this._unmergedPaths.delete(e), this._dirty = !0;
	}
	clear() {
		this._entries.clear(), this._dirty = !0;
	}
	has({ filepath: e }) {
		return this._entries.has(e);
	}
	render() {
		return this.entries.map((e) => `${e.mode.toString(8)} ${e.oid}    ${e.path}`).join("\n");
	}
	static async _entryToBuffer(e) {
		let t = Buffer.from(e.path), n = Math.ceil((62 + t.length + 1) / 8) * 8, r = Buffer.alloc(n), i = new bb(r), a = Eb(e);
		return i.writeUInt32BE(a.ctimeSeconds), i.writeUInt32BE(a.ctimeNanoseconds), i.writeUInt32BE(a.mtimeSeconds), i.writeUInt32BE(a.mtimeNanoseconds), i.writeUInt32BE(a.dev), i.writeUInt32BE(a.ino), i.writeUInt32BE(a.mode), i.writeUInt32BE(a.uid), i.writeUInt32BE(a.gid), i.writeUInt32BE(a.size), i.write(e.oid, 20, "hex"), i.writeUInt16BE(Pb(e)), i.write(e.path, t.length, "utf8"), r;
	}
	async toObject() {
		let t = Buffer.alloc(12), n = new bb(t);
		n.write("DIRC", 4, "utf8"), n.writeUInt32BE(2), n.writeUInt32BE(this.entriesFlat.length);
		let r = [];
		for (let t of this.entries) if (r.push(e._entryToBuffer(t)), t.stages.length > 1) for (let n of t.stages) n && n !== t && r.push(e._entryToBuffer(n));
		r = await Promise.all(r);
		let i = Buffer.concat(r), a = Buffer.concat([t, i]), o = await kb(a);
		return Buffer.concat([a, Buffer.from(o, "hex")]);
	}
};
function Ib(e, t, n = !0, r = !0) {
	let i = Eb(e), a = Eb(t);
	return n && i.mode !== a.mode || i.mtimeSeconds !== a.mtimeSeconds || i.ctimeSeconds !== a.ctimeSeconds || i.uid !== a.uid || i.gid !== a.gid || r && i.ino !== a.ino || i.size !== a.size;
}
var Lb = null, Rb = Symbol("IndexCache");
function zb() {
	return {
		map: /* @__PURE__ */ new Map(),
		stats: /* @__PURE__ */ new Map()
	};
}
async function Bb(e, t, n) {
	let [r, i] = await Promise.all([e.lstat(t), e.read(t)]), a = await Fb.from(i);
	n.map.set(t, a), n.stats.set(t, r);
}
async function Vb(e, t, n) {
	let r = n.stats.get(t);
	if (r === void 0) return !0;
	if (r === null) return !1;
	let i = await e.lstat(t);
	return i !== null && Ib(r, i);
}
var Hb = class {
	static async acquire({ fs: e, gitdir: t, cache: n, allowUnmerged: r = !0 }, i) {
		n[Rb] || (n[Rb] = zb());
		let a = `${t}/index`;
		Lb === null && (Lb = new cb.default({ maxPending: Infinity }));
		let o, s = [];
		return await Lb.acquire(a, async () => {
			let t = n[Rb];
			await Vb(e, a, t) && await Bb(e, a, t);
			let c = t.map.get(a);
			if (s = c.unmergedPaths, s.length && !r) throw new _b(s);
			if (o = await i(c), c._dirty) {
				let n = await c.toObject();
				await e.write(a, n), t.stats.set(a, await e.lstat(a)), c._dirty = !1;
			}
		}), o;
	}
};
function Ub(e) {
	let t = Math.max(e.lastIndexOf("/"), e.lastIndexOf("\\"));
	return t > -1 && (e = e.slice(t + 1)), e;
}
function Wb(e) {
	let t = Math.max(e.lastIndexOf("/"), e.lastIndexOf("\\"));
	return t === -1 ? "." : t === 0 ? "/" : e.slice(0, t);
}
function Gb(e) {
	let t = /* @__PURE__ */ new Map(), n = function(e) {
		if (!t.has(e)) {
			let r = {
				type: "tree",
				fullpath: e,
				basename: Ub(e),
				metadata: {},
				children: []
			};
			t.set(e, r), r.parent = n(Wb(e)), r.parent && r.parent !== r && r.parent.children.push(r);
		}
		return t.get(e);
	}, r = function(e, r) {
		if (!t.has(e)) {
			let i = {
				type: "blob",
				fullpath: e,
				basename: Ub(e),
				metadata: r,
				parent: n(Wb(e)),
				children: []
			};
			i.parent && i.parent.children.push(i), t.set(e, i);
		}
		return t.get(e);
	};
	n(".");
	for (let t of e) r(t.path, t);
	return t;
}
function Kb(e) {
	switch (e) {
		case 16384: return "tree";
		case 33188: return "blob";
		case 33261: return "blob";
		case 40960: return "blob";
		case 57344: return "commit";
	}
	throw new vb(`Unexpected GitTree entry mode: ${e.toString(8)}`);
}
var qb = class {
	constructor({ fs: e, gitdir: t, cache: n }) {
		this.treePromise = Hb.acquire({
			fs: e,
			gitdir: t,
			cache: n
		}, async function(e) {
			return Gb(e.entries);
		});
		let r = this;
		this.ConstructEntry = class {
			constructor(e) {
				this._fullpath = e, this._type = !1, this._mode = !1, this._stat = !1, this._oid = !1;
			}
			async type() {
				return r.type(this);
			}
			async mode() {
				return r.mode(this);
			}
			async stat() {
				return r.stat(this);
			}
			async content() {
				return r.content(this);
			}
			async oid() {
				return r.oid(this);
			}
		};
	}
	async readdir(e) {
		let t = e._fullpath, n = (await this.treePromise).get(t);
		if (!n || n.type === "blob") return null;
		if (n.type !== "tree") throw Error(`ENOTDIR: not a directory, scandir '${t}'`);
		let r = n.children.map((e) => e.fullpath);
		return r.sort(xb), r;
	}
	async type(e) {
		return e._type === !1 && await e.stat(), e._type;
	}
	async mode(e) {
		return e._mode === !1 && await e.stat(), e._mode;
	}
	async stat(e) {
		if (e._stat === !1) {
			let t = (await this.treePromise).get(e._fullpath);
			if (!t) throw Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);
			let n = t.type === "tree" ? {} : Eb(t.metadata);
			e._type = t.type === "tree" ? "tree" : Kb(n.mode), e._mode = n.mode, t.type === "tree" ? e._stat = void 0 : e._stat = n;
		}
		return e._stat;
	}
	async content(e) {}
	async oid(e) {
		return e._oid === !1 && (e._oid = (await this.treePromise).get(e._fullpath).metadata.oid), e._oid;
	}
}, Jb = Symbol("GitWalkSymbol");
function Yb() {
	let e = Object.create(null);
	return Object.defineProperty(e, Jb, { value: function({ fs: e, gitdir: t, cache: n }) {
		return new qb({
			fs: e,
			gitdir: t,
			cache: n
		});
	} }), Object.freeze(e), e;
}
var Xb = class e extends gb {
	constructor(t) {
		super(`Could not find ${t}.`), this.code = this.name = e.code, this.data = { what: t };
	}
};
Xb.code = "NotFoundError";
var Zb = class e extends gb {
	constructor(t, n, r, i) {
		super(`Object ${t} ${i ? `at ${i}` : ""}was anticipated to be a ${r} but it is a ${n}.`), this.code = this.name = e.code, this.data = {
			oid: t,
			actual: n,
			expected: r,
			filepath: i
		};
	}
};
Zb.code = "ObjectTypeError";
var Qb = class e extends gb {
	constructor(t) {
		super(`Expected a 40-char hex object id but saw "${t}".`), this.code = this.name = e.code, this.data = { value: t };
	}
};
Qb.code = "InvalidOidError";
var $b = class e extends gb {
	constructor(t) {
		super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:
[remote "${t}"]
\tfetch = +refs/heads/*:refs/remotes/origin/*
`), this.code = this.name = e.code, this.data = { remote: t };
	}
};
$b.code = "NoRefspecError";
var ex = class e {
	constructor(e) {
		if (this.refs = /* @__PURE__ */ new Map(), this.parsedConfig = [], e) {
			let t = null;
			this.parsedConfig = e.trim().split("\n").map((e) => {
				if (/^\s*#/.test(e)) return {
					line: e,
					comment: !0
				};
				let n = e.indexOf(" ");
				if (e.startsWith("^")) {
					let n = e.slice(1);
					return this.refs.set(t + "^{}", n), {
						line: e,
						ref: t,
						peeled: n
					};
				} else {
					let r = e.slice(0, n);
					return t = e.slice(n + 1), this.refs.set(t, r), {
						line: e,
						ref: t,
						oid: r
					};
				}
			});
		}
		return this;
	}
	static from(t) {
		return new e(t);
	}
	delete(e) {
		this.parsedConfig = this.parsedConfig.filter((t) => t.ref !== e), this.refs.delete(e);
	}
	toString() {
		return this.parsedConfig.map(({ line: e }) => e).join("\n") + "\n";
	}
}, tx = class e {
	constructor({ remotePath: e, localPath: t, force: n, matchPrefix: r }) {
		Object.assign(this, {
			remotePath: e,
			localPath: t,
			force: n,
			matchPrefix: r
		});
	}
	static from(t) {
		let [n, r, i, a, o] = t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1), s = n === "+", c = i === "*";
		if (c !== (o === "*")) throw new vb("Invalid refspec");
		return new e({
			remotePath: r,
			localPath: a,
			force: s,
			matchPrefix: c
		});
	}
	translate(e) {
		if (this.matchPrefix) {
			if (e.startsWith(this.remotePath)) return this.localPath + e.replace(this.remotePath, "");
		} else if (e === this.remotePath) return this.localPath;
		return null;
	}
	reverseTranslate(e) {
		if (this.matchPrefix) {
			if (e.startsWith(this.localPath)) return this.remotePath + e.replace(this.localPath, "");
		} else if (e === this.localPath) return this.remotePath;
		return null;
	}
}, nx = class e {
	constructor(e = []) {
		this.rules = e;
	}
	static from(t) {
		let n = [];
		for (let e of t) n.push(tx.from(e));
		return new e(n);
	}
	add(e) {
		let t = tx.from(e);
		this.rules.push(t);
	}
	translate(e) {
		let t = [];
		for (let n of this.rules) for (let r of e) {
			let e = n.translate(r);
			e && t.push([r, e]);
		}
		return t;
	}
	translateOne(e) {
		let t = null;
		for (let n of this.rules) {
			let r = n.translate(e);
			r && (t = r);
		}
		return t;
	}
	localNamespaces() {
		return this.rules.filter((e) => e.matchPrefix).map((e) => e.localPath.replace(/\/$/, ""));
	}
};
function rx(e, t) {
	let n = e.replace(/\^\{\}$/, ""), r = t.replace(/\^\{\}$/, ""), i = -(n < r) || +(n > r);
	return i === 0 ? e.endsWith("^{}") ? 1 : -1 : i;
}
function ix(e, t) {
	let n = "", r = 0, i = -1, a = 0, o = "\0";
	for (let s = 0; s <= e.length; ++s) {
		if (s < e.length) o = e[s];
		else if (o === "/") break;
		else o = "/";
		if (o === "/") {
			if (!(i === s - 1 || a === 1)) if (a === 2) {
				if (n.length < 2 || r !== 2 || n.at(-1) !== "." || n.at(-2) !== ".") {
					if (n.length > 2) {
						let e = n.lastIndexOf("/");
						e === -1 ? (n = "", r = 0) : (n = n.slice(0, e), r = n.length - 1 - n.lastIndexOf("/")), i = s, a = 0;
						continue;
					} else if (n.length !== 0) {
						n = "", r = 0, i = s, a = 0;
						continue;
					}
				}
				t && (n += n.length > 0 ? "/.." : "..", r = 2);
			} else n.length > 0 ? n += "/" + e.slice(i + 1, s) : n = e.slice(i + 1, s), r = s - i - 1;
			i = s, a = 0;
		} else o === "." && a !== -1 ? ++a : a = -1;
	}
	return n;
}
function ax(e) {
	return e.length >= 2 && /^[a-zA-Z]:/.test(e) ? e.slice(0, 2) : null;
}
function ox(e) {
	if (!e.length) return ".";
	e = e.replace(/\\/g, "/");
	let t = ax(e), n = e[0] === "/" || t !== null && e[2] === "/", r = e.at(-1) === "/", i = ix(t ? e.slice(2) : e, !n);
	if (!i.length) {
		let e = t ? n ? t + "/" : t : n ? "/" : ".";
		return r && !n ? e + "/" : e;
	}
	return r && (i += "/"), t ? n ? `${t}/${i}` : `${t}${i}` : n ? `/${i}` : i;
}
function Z(...e) {
	if (e.length === 0) return ".";
	let t;
	for (let n = 0; n < e.length; ++n) {
		let r = e[n].replace(/\\/g, "/");
		r.length !== 0 && (/^[a-zA-Z]:\//.test(r) || t === void 0 ? t = r : t += "/" + r);
	}
	return t === void 0 ? "." : ox(t);
}
var sx = (e) => {
	if (typeof e == "number") return e;
	e = e.toLowerCase();
	let t = parseInt(e);
	return e.endsWith("k") && (t *= 1024), e.endsWith("m") && (t *= 1024 * 1024), e.endsWith("g") && (t *= 1024 * 1024 * 1024), t;
}, cx = (e) => {
	if (typeof e == "boolean") return e;
	if (e = e.trim().toLowerCase(), e === "true" || e === "yes" || e === "on") return !0;
	if (e === "false" || e === "no" || e === "off") return !1;
	throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${e}`);
}, lx = { core: {
	filemode: cx,
	bare: cx,
	logallrefupdates: cx,
	symlinks: cx,
	ignorecase: cx,
	bigFileThreshold: sx
} }, ux = /^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/, dx = /^[A-Za-z0-9-.]+$/, fx = /^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/, px = /^[A-Za-z][A-Za-z-]*$/, mx = /^(.*?)( *[#;].*)$/, hx = (e) => {
	let t = ux.exec(e);
	if (t != null) {
		let [e, n] = t.slice(1);
		return [e, n];
	}
	return null;
}, gx = (e) => {
	let t = fx.exec(e);
	if (t != null) {
		let [e, n = "true"] = t.slice(1);
		return [e, yx(_x(n))];
	}
	return null;
}, _x = (e) => {
	let t = mx.exec(e);
	if (t == null) return e;
	let [n, r] = t.slice(1);
	return vx(n) && vx(r) ? `${n}${r}` : n;
}, vx = (e) => (e.match(/(?:^|[^\\])"/g) || []).length % 2 != 0, yx = (e) => e.split("").reduce((e, t, n, r) => {
	let i = t === "\"" && r[n - 1] !== "\\", a = t === "\\" && r[n + 1] === "\"";
	return i || a ? e : e + t;
}, ""), bx = (e) => e == null ? null : e.toLowerCase(), xx = (e, t, n) => [
	bx(e),
	t,
	bx(n)
].filter((e) => e != null).join("."), Sx = (e) => {
	let t = e.split("."), n = t.shift(), r = t.pop(), i = t.length ? t.join(".") : void 0;
	return {
		section: n,
		subsection: i,
		name: r,
		path: xx(n, i, r),
		sectionPath: xx(n, i, null),
		isSection: !!n
	};
}, Cx = (e, t) => e.reduce((e, n, r) => t(n) ? r : e, -1), wx = class e {
	constructor(e) {
		let t = null, n = null;
		this.parsedConfig = e ? e.split("\n").map((e) => {
			let r = null, i = null, a = e.trim(), o = hx(a), s = o != null;
			if (s) [t, n] = o;
			else {
				let e = gx(a);
				e != null && ([r, i] = e);
			}
			let c = xx(t, n, r);
			return {
				line: e,
				isSection: s,
				section: t,
				subsection: n,
				name: r,
				value: i,
				path: c
			};
		}) : [];
	}
	static from(t) {
		return new e(t);
	}
	async get(e, t = !1) {
		let n = Sx(e).path, r = this.parsedConfig.filter((e) => e.path === n).map(({ section: e, name: t, value: n }) => {
			let r = lx[e] && lx[e][t];
			return r ? r(n) : n;
		});
		return t ? r : r.pop();
	}
	async getall(e) {
		return this.get(e, !0);
	}
	async getSubsections(e) {
		return this.parsedConfig.filter((t) => t.isSection && t.section === e).map((e) => e.subsection);
	}
	async deleteSection(e, t) {
		this.parsedConfig = this.parsedConfig.filter((n) => !(n.section === e && n.subsection === t));
	}
	async append(e, t) {
		return this.set(e, t, !0);
	}
	async set(e, t, n = !1) {
		let { section: r, subsection: i, name: a, path: o, sectionPath: s, isSection: c } = Sx(e), l = Cx(this.parsedConfig, (e) => e.path === o);
		if (t == null) l !== -1 && this.parsedConfig.splice(l, 1);
		else if (l !== -1) {
			let e = this.parsedConfig[l], r = Object.assign({}, e, {
				name: a,
				value: t,
				modified: !0
			});
			n ? this.parsedConfig.splice(l + 1, 0, r) : this.parsedConfig[l] = r;
		} else {
			let e = this.parsedConfig.findIndex((e) => e.path === s), n = {
				section: r,
				subsection: i,
				name: a,
				value: t,
				modified: !0,
				path: o
			};
			if (dx.test(r) && px.test(a)) if (e >= 0) this.parsedConfig.splice(e + 1, 0, n);
			else {
				let e = {
					isSection: c,
					section: r,
					subsection: i,
					modified: !0,
					path: s
				};
				this.parsedConfig.push(e, n);
			}
		}
	}
	toString() {
		return this.parsedConfig.map(({ line: e, section: t, subsection: n, name: r, value: i, modified: a = !1 }) => a ? r != null && i != null ? typeof i == "string" && /[#;]/.test(i) ? `\t${r} = "${i}"` : `\t${r} = ${i}` : n == null ? `[${t}]` : `[${t} "${n}"]` : e).join("\n");
	}
}, Tx = class {
	static async get({ fs: e, gitdir: t }) {
		let n = await e.read(`${t}/config`, { encoding: "utf8" });
		return wx.from(n);
	}
	static async save({ fs: e, gitdir: t, config: n }) {
		await e.write(`${t}/config`, n.toString(), { encoding: "utf8" });
	}
}, Ex = (e) => [
	`${e}`,
	`refs/${e}`,
	`refs/tags/${e}`,
	`refs/heads/${e}`,
	`refs/remotes/${e}`,
	`refs/remotes/${e}/HEAD`
], Dx = [
	"config",
	"description",
	"index",
	"shallow",
	"commondir"
], Ox;
async function kx(e, t) {
	return Ox === void 0 && (Ox = new cb.default()), Ox.acquire(e, t);
}
var Q = class e {
	static async updateRemoteRefs({ fs: t, gitdir: n, remote: r, refs: i, symrefs: a, tags: o, refspecs: s = void 0, prune: c = !1, pruneTags: l = !1 }) {
		for (let e of i.values()) if (!e.match(/[0-9a-f]{40}/)) throw new Qb(e);
		let u = await Tx.get({
			fs: t,
			gitdir: n
		});
		if (!s) {
			if (s = await u.getall(`remote.${r}.fetch`), s.length === 0) throw new $b(r);
			s.unshift(`+HEAD:refs/remotes/${r}/HEAD`);
		}
		let d = nx.from(s), f = /* @__PURE__ */ new Map();
		if (l) {
			let r = await e.listRefs({
				fs: t,
				gitdir: n,
				filepath: "refs/tags"
			});
			await e.deleteRefs({
				fs: t,
				gitdir: n,
				refs: r.map((e) => `refs/tags/${e}`)
			});
		}
		if (o) {
			for (let r of i.keys()) if (r.startsWith("refs/tags") && !r.endsWith("^{}") && !await e.exists({
				fs: t,
				gitdir: n,
				ref: r
			})) {
				let e = i.get(r);
				f.set(r, e);
			}
		}
		let p = d.translate([...i.keys()]);
		for (let [e, t] of p) {
			let n = i.get(e);
			f.set(t, n);
		}
		let m = d.translate([...a.keys()]);
		for (let [e, t] of m) {
			let n = a.get(e), r = d.translateOne(n);
			r && f.set(t, `ref: ${r}`);
		}
		let h = [];
		if (c) {
			for (let r of d.localNamespaces()) {
				let i = (await e.listRefs({
					fs: t,
					gitdir: n,
					filepath: r
				})).map((e) => `${r}/${e}`);
				for (let e of i) f.has(e) || h.push(e);
			}
			h.length > 0 && await e.deleteRefs({
				fs: t,
				gitdir: n,
				refs: h
			});
		}
		for (let [e, r] of f) await kx(e, async () => t.write(Z(n, e), `${r.trim()}\n`, "utf8"));
		return { pruned: h };
	}
	static async writeRef({ fs: e, gitdir: t, ref: n, value: r }) {
		if (!r.match(/[0-9a-f]{40}/)) throw new Qb(r);
		await kx(n, async () => e.write(Z(t, n), `${r.trim()}\n`, "utf8"));
	}
	static async writeSymbolicRef({ fs: e, gitdir: t, ref: n, value: r }) {
		await kx(n, async () => e.write(Z(t, n), `ref: ${r.trim()}\n`, "utf8"));
	}
	static async deleteRef({ fs: t, gitdir: n, ref: r }) {
		return e.deleteRefs({
			fs: t,
			gitdir: n,
			refs: [r]
		});
	}
	static async deleteRefs({ fs: e, gitdir: t, refs: n }) {
		await Promise.all(n.map((n) => e.rm(Z(t, n))));
		let r = await kx("packed-refs", async () => e.read(`${t}/packed-refs`, { encoding: "utf8" })), i = ex.from(r), a = i.refs.size;
		for (let e of n) i.refs.has(e) && i.delete(e);
		i.refs.size < a && (r = i.toString(), await kx("packed-refs", async () => e.write(`${t}/packed-refs`, r, { encoding: "utf8" })));
	}
	static async resolve({ fs: t, gitdir: n, ref: r, depth: i = void 0, visited: a = /* @__PURE__ */ new Set() }) {
		if (i !== void 0 && (i--, i === -1)) return r;
		if (r.startsWith("ref: ")) return r = r.slice(5), e.resolve({
			fs: t,
			gitdir: n,
			ref: r,
			depth: i,
			visited: a
		});
		if (r.length === 40 && /[0-9a-f]{40}/.test(r)) return r;
		let o = await e.packedRefs({
			fs: t,
			gitdir: n
		}), s = Ex(r).filter((e) => !Dx.includes(e));
		for (let r of s) {
			let s = await kx(r, async () => await t.read(`${n}/${r}`, { encoding: "utf8" }) || o.get(r));
			if (s) {
				if (a.has(r)) throw new vb(`Circular reference detected while resolving ref "${r}"`);
				return a.add(r), e.resolve({
					fs: t,
					gitdir: n,
					ref: s.trim(),
					depth: i,
					visited: a
				});
			}
		}
		throw new Xb(r);
	}
	static async exists({ fs: t, gitdir: n, ref: r }) {
		try {
			return await e.expand({
				fs: t,
				gitdir: n,
				ref: r
			}), !0;
		} catch {
			return !1;
		}
	}
	static async expand({ fs: t, gitdir: n, ref: r }) {
		if (r.length === 40 && /[0-9a-f]{40}/.test(r)) return r;
		let i = await e.packedRefs({
			fs: t,
			gitdir: n
		}), a = Ex(r);
		for (let e of a) if (await kx(e, async () => t.exists(`${n}/${e}`)) || i.has(e)) return e;
		throw new Xb(r);
	}
	static async expandAgainstMap({ ref: e, map: t }) {
		let n = Ex(e);
		for (let e of n) if (await t.has(e)) return e;
		throw new Xb(e);
	}
	static resolveAgainstMap({ ref: t, fullref: n = t, depth: r = void 0, map: i }) {
		if (r !== void 0 && (r--, r === -1)) return {
			fullref: n,
			oid: t
		};
		if (t.startsWith("ref: ")) return t = t.slice(5), e.resolveAgainstMap({
			ref: t,
			fullref: n,
			depth: r,
			map: i
		});
		if (t.length === 40 && /[0-9a-f]{40}/.test(t)) return {
			fullref: n,
			oid: t
		};
		let a = Ex(t);
		for (let t of a) {
			let n = i.get(t);
			if (n) return e.resolveAgainstMap({
				ref: n.trim(),
				fullref: t,
				depth: r,
				map: i
			});
		}
		throw new Xb(t);
	}
	static async packedRefs({ fs: e, gitdir: t }) {
		let n = await kx("packed-refs", async () => e.read(`${t}/packed-refs`, { encoding: "utf8" }));
		return ex.from(n).refs;
	}
	static async listRefs({ fs: t, gitdir: n, filepath: r }) {
		let i = e.packedRefs({
			fs: t,
			gitdir: n
		}), a = null;
		try {
			a = await t.readdirDeep(`${n}/${r}`), a = a.map((e) => e.replace(`${n}/${r}/`, ""));
		} catch {
			a = [];
		}
		for (let e of (await i).keys()) e.startsWith(r) && (e = e.replace(r + "/", ""), a.includes(e) || a.push(e));
		return a.sort(rx), a;
	}
	static async listBranches({ fs: t, gitdir: n, remote: r }) {
		return r ? e.listRefs({
			fs: t,
			gitdir: n,
			filepath: `refs/remotes/${r}`
		}) : e.listRefs({
			fs: t,
			gitdir: n,
			filepath: "refs/heads"
		});
	}
	static async listTags({ fs: t, gitdir: n }) {
		return (await e.listRefs({
			fs: t,
			gitdir: n,
			filepath: "refs/tags"
		})).filter((e) => !e.endsWith("^{}"));
	}
};
function Ax(e, t) {
	return xb(jx(e), jx(t));
}
function jx(e) {
	return e.mode === "040000" ? e.path + "/" : e.path;
}
function Mx(e) {
	switch (e) {
		case "040000": return "tree";
		case "100644": return "blob";
		case "100755": return "blob";
		case "120000": return "blob";
		case "160000": return "commit";
	}
	throw new vb(`Unexpected GitTree entry mode: ${e}`);
}
function Nx(e) {
	let t = [], n = 0;
	for (; n < e.length;) {
		let r = e.indexOf(32, n);
		if (r === -1) throw new vb(`GitTree: Error parsing buffer at byte location ${n}: Could not find the next space character.`);
		let i = e.indexOf(0, n);
		if (i === -1) throw new vb(`GitTree: Error parsing buffer at byte location ${n}: Could not find the next null character.`);
		let a = e.slice(n, r).toString("utf8");
		a === "40000" && (a = "040000");
		let o = Mx(a), s = e.slice(r + 1, i).toString("utf8"), c = s.replace(/[\u200C-\u200F\u202A-\u202E\u206A-\u206F\uFEFF]/g, ""), l = c.split(":")[0].toLowerCase().replace(/[. ]+$/, "");
		if (s.includes("\\") || s.includes("/") || c === "." || c === ".." || l === ".git" || /^\.?git~[1-9]$/.test(l)) throw new yb(s);
		let u = e.slice(i + 1, i + 21).toString("hex");
		n = i + 21, t.push({
			mode: a,
			path: s,
			oid: u,
			type: o
		});
	}
	return t;
}
function Px(e) {
	if (typeof e == "number" && (e = e.toString(8)), e.match(/^0?4.*/)) return "040000";
	if (e.match(/^1006.*/)) return "100644";
	if (e.match(/^1007.*/)) return "100755";
	if (e.match(/^120.*/)) return "120000";
	if (e.match(/^160.*/)) return "160000";
	throw new vb(`Could not understand file mode: ${e}`);
}
function Fx(e) {
	return !e.oid && e.sha && (e.oid = e.sha), e.mode = Px(e.mode), e.type ||= Mx(e.mode), e;
}
var Ix = class e {
	constructor(e) {
		if (Buffer.isBuffer(e)) this._entries = Nx(e);
		else if (Array.isArray(e)) this._entries = e.map(Fx);
		else throw new vb("invalid type passed to GitTree constructor");
		this._entries.sort(Sb);
	}
	static from(t) {
		return new e(t);
	}
	render() {
		return this._entries.map((e) => `${e.mode} ${e.type} ${e.oid}    ${e.path}`).join("\n");
	}
	toObject() {
		let e = [...this._entries];
		return e.sort(Ax), Buffer.concat(e.map((e) => {
			let t = Buffer.from(e.mode.replace(/^0/, "")), n = Buffer.from(" "), r = Buffer.from(e.path, "utf8"), i = Buffer.from([0]), a = Buffer.from(e.oid, "hex");
			return Buffer.concat([
				t,
				n,
				r,
				i,
				a
			]);
		}));
	}
	entries() {
		return this._entries;
	}
	*[Symbol.iterator]() {
		for (let e of this._entries) yield e;
	}
}, Lx = class {
	static wrap({ type: e, object: t }) {
		let n = `${e} ${t.length}\x00`, r = n.length, i = r + t.length, a = new Uint8Array(i);
		for (let e = 0; e < r; e++) a[e] = n.charCodeAt(e);
		return a.set(t, r), a;
	}
	static unwrap(e) {
		let t = e.indexOf(32), n = e.indexOf(0), r = e.slice(0, t).toString("utf8"), i = e.slice(t + 1, n).toString("utf8"), a = e.length - (n + 1);
		if (parseInt(i) !== a) throw new vb(`Length mismatch: expected ${i} bytes but got ${a} instead.`);
		return {
			type: r,
			object: Buffer.from(e.slice(n + 1))
		};
	}
};
async function Rx({ fs: e, gitdir: t, oid: n }) {
	let r = `objects/${n.slice(0, 2)}/${n.slice(2)}`, i = await e.read(`${t}/${r}`);
	return i ? {
		object: i,
		format: "deflated",
		source: r
	} : null;
}
function zx(e, t) {
	let n = new bb(e), r = Bx(n);
	if (r !== t.byteLength) throw new vb(`applyDelta expected source buffer to be ${r} bytes but the provided buffer was ${t.length} bytes`);
	let i = Bx(n), a, o = Hx(n, t);
	if (o.byteLength === i) a = o;
	else {
		let e = [o], r = o.byteLength;
		for (; !n.eof();) {
			let i = Hx(n, t);
			e.push(i), r += i.byteLength;
		}
		if (i !== r) throw new vb(`applyDelta expected target buffer to be ${i} bytes but the resulting buffer was ${r} bytes`);
		a = Buffer.concat(e, i);
	}
	return a;
}
function Bx(e) {
	let t = 0, n = 0, r = null;
	do
		r = e.readUInt8(), t |= (r & 127) << n, n += 7;
	while (r & 128);
	return t;
}
function Vx(e, t, n) {
	let r = 0, i = 0;
	for (; n--;) t & 1 && (r |= e.readUInt8() << i), t >>= 1, i += 8;
	return r;
}
function Hx(e, t) {
	let n = e.readUInt8();
	if (n & 128) {
		let r = Vx(e, n & 15, 4), i = Vx(e, (n & 112) >> 4, 3);
		return i === 0 && (i = 65536), t.slice(r, r + i);
	} else return e.slice(n);
}
function Ux(e) {
	let t = [e];
	return {
		next() {
			return Promise.resolve({
				done: t.length === 0,
				value: t.pop()
			});
		},
		return() {
			return t = [], {};
		},
		[Symbol.asyncIterator]() {
			return this;
		}
	};
}
function Wx(e) {
	return e[Symbol.asyncIterator] ? e[Symbol.asyncIterator]() : e[Symbol.iterator] ? e[Symbol.iterator]() : e.next ? e : Ux(e);
}
var Gx = class {
	constructor(e) {
		if (typeof Buffer > "u") throw Error("Missing Buffer dependency");
		this.stream = Wx(e), this.buffer = null, this.cursor = 0, this.undoCursor = 0, this.started = !1, this._ended = !1, this._discardedBytes = 0;
	}
	eof() {
		return this._ended && this.cursor === this.buffer.length;
	}
	tell() {
		return this._discardedBytes + this.cursor;
	}
	async byte() {
		if (!this.eof() && (this.started || await this._init(), !(this.cursor === this.buffer.length && (await this._loadnext(), this._ended)))) return this._moveCursor(1), this.buffer[this.undoCursor];
	}
	async chunk() {
		if (!this.eof() && (this.started || await this._init(), !(this.cursor === this.buffer.length && (await this._loadnext(), this._ended)))) return this._moveCursor(this.buffer.length), this.buffer.slice(this.undoCursor, this.cursor);
	}
	async read(e) {
		if (!this.eof()) return this.started || await this._init(), this.cursor + e > this.buffer.length && (this._trim(), await this._accumulate(e)), this._moveCursor(e), this.buffer.slice(this.undoCursor, this.cursor);
	}
	async skip(e) {
		this.eof() || (this.started || await this._init(), this.cursor + e > this.buffer.length && (this._trim(), await this._accumulate(e)), this._moveCursor(e));
	}
	async undo() {
		this.cursor = this.undoCursor;
	}
	async _next() {
		this.started = !0;
		let { done: e, value: t } = await this.stream.next();
		return e && (this._ended = !0, !t) ? Buffer.alloc(0) : (t &&= Buffer.from(t), t);
	}
	_trim() {
		this.buffer = this.buffer.slice(this.undoCursor), this.cursor -= this.undoCursor, this._discardedBytes += this.undoCursor, this.undoCursor = 0;
	}
	_moveCursor(e) {
		this.undoCursor = this.cursor, this.cursor += e, this.cursor > this.buffer.length && (this.cursor = this.buffer.length);
	}
	async _accumulate(e) {
		if (this._ended) return;
		let t = [this.buffer];
		for (; this.cursor + e > Kx(t);) {
			let e = await this._next();
			if (this._ended) break;
			t.push(e);
		}
		this.buffer = Buffer.concat(t);
	}
	async _loadnext() {
		this._discardedBytes += this.buffer.length, this.undoCursor = 0, this.cursor = 0, this.buffer = await this._next();
	}
	async _init() {
		this.buffer = await this._next();
	}
};
function Kx(e) {
	return e.reduce((e, t) => e + t.length, 0);
}
async function qx(e, t) {
	let n = new Gx(e), r = await n.read(4);
	if (r = r.toString("utf8"), r !== "PACK") throw new vb(`Invalid PACK header '${r}'`);
	let i = await n.read(4);
	if (i = i.readUInt32BE(0), i !== 2) throw new vb(`Invalid packfile version: ${i}`);
	let a = await n.read(4);
	if (a = a.readUInt32BE(0), !(a < 1)) for (; !n.eof() && a--;) {
		let e = n.tell(), { type: r, length: i, ofs: o, reference: s } = await Jx(n), c = new db.default.Inflate();
		for (; !c.result;) {
			let l = await n.chunk();
			if (!l) break;
			if (c.push(l, !1), c.err) throw new vb(`Pako error: ${c.msg}`);
			if (c.result) {
				if (c.result.length !== i) throw new vb("Inflated object size is different from that stated in packfile.");
				await n.undo(), await n.read(l.length - c.strm.avail_in);
				let u = n.tell();
				await t({
					data: c.result,
					type: r,
					num: a,
					offset: e,
					end: u,
					reference: s,
					ofs: o
				});
			}
		}
	}
}
async function Jx(e) {
	let t = await e.byte(), n = t >> 4 & 7, r = t & 15;
	if (t & 128) {
		let n = 4;
		do
			t = await e.byte(), r |= (t & 127) << n, n += 7;
		while (t & 128);
	}
	let i, a;
	if (n === 6) {
		let n = 0;
		i = 0;
		let r = [];
		do
			t = await e.byte(), i |= (t & 127) << n, n += 7, r.push(t);
		while (t & 128);
		a = Buffer.from(r);
	}
	return n === 7 && (a = await e.read(20)), {
		type: n,
		length: r,
		ofs: i,
		reference: a
	};
}
var Yx = !1;
async function Xx(e) {
	return Yx === null && (Yx = Qx()), Yx ? Zx(e) : db.default.inflate(e);
}
async function Zx(e) {
	let t = new DecompressionStream("deflate"), n = new Blob([e]).stream().pipeThrough(t);
	return new Uint8Array(await new Response(n).arrayBuffer());
}
function Qx() {
	try {
		if (new DecompressionStream("deflate")) return !0;
	} catch {}
	return !1;
}
function $x(e) {
	let t = [], n = 0, r = 0;
	do {
		n = e.readUInt8();
		let i = n & 127;
		t.push(i), r = n & 128;
	} while (r);
	return t.reduce((e, t) => e + 1 << 7 | t, -1);
}
function eS(e, t) {
	let n = t, r = 4, i = null;
	do
		i = e.readUInt8(), n |= (i & 127) << r, r += 7;
	while (i & 128);
	return n;
}
var tS = class e {
	constructor(e) {
		Object.assign(this, e), this.offsetCache = {};
	}
	static async fromIdx({ idx: t, getExternalRefDelta: n }) {
		let r = new bb(t);
		if (r.slice(4).toString("hex") !== "ff744f63") return;
		let i = r.readUInt32BE();
		if (i !== 2) throw new vb(`Unable to read version ${i} packfile IDX. (Only version 2 supported)`);
		if (t.byteLength > 2048 * 1024 * 1024) throw new vb("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");
		r.seek(r.tell() + 1020);
		let a = r.readUInt32BE(), o = [];
		for (let e = 0; e < a; e++) o[e] = r.slice(20).toString("hex");
		r.seek(r.tell() + 4 * a);
		let s = /* @__PURE__ */ new Map();
		for (let e = 0; e < a; e++) s.set(o[e], r.readUInt32BE());
		let c = r.slice(20).toString("hex");
		return new e({
			hashes: o,
			crcs: {},
			offsets: s,
			packfileSha: c,
			getExternalRefDelta: n
		});
	}
	static async fromPack({ pack: t, getExternalRefDelta: n, onProgress: r }) {
		let i = {
			1: "commit",
			2: "tree",
			3: "blob",
			4: "tag",
			6: "ofs-delta",
			7: "ref-delta"
		}, a = {}, o = t.slice(-20).toString("hex"), s = [], c = {}, l = /* @__PURE__ */ new Map(), u = null, d = null;
		await qx([t], async ({ data: e, type: t, reference: n, offset: o, num: s }) => {
			u === null && (u = s);
			let c = Math.floor((u - s) * 100 / u);
			c !== d && r && await r({
				phase: "Receiving objects",
				loaded: u - s,
				total: u
			}), d = c, t = i[t], ([
				"commit",
				"tree",
				"blob",
				"tag"
			].includes(t) || t === "ofs-delta" || t === "ref-delta") && (a[o] = {
				type: t,
				offset: o
			});
		});
		let f = Object.keys(a).map(Number);
		for (let [e, n] of f.entries()) {
			let r = e + 1 === f.length ? t.byteLength - 20 : f[e + 1], i = a[n], o = ub.default.buf(t.slice(n, r)) >>> 0;
			i.end = r, i.crc = o;
		}
		let p = new e({
			pack: Promise.resolve(t),
			packfileSha: o,
			crcs: c,
			hashes: s,
			offsets: l,
			getExternalRefDelta: n
		});
		d = null;
		let m = 0, h = [
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0
		];
		for (let e in a) {
			e = Number(e);
			let t = Math.floor(m * 100 / u);
			t !== d && r && await r({
				phase: "Resolving deltas",
				loaded: m,
				total: u
			}), m++, d = t;
			let n = a[e];
			if (!n.oid) try {
				p.readDepth = 0, p.externalReadDepth = 0;
				let { type: t, object: r } = await p.readSlice({ start: e });
				h[p.readDepth] += 1;
				let i = await kb(Lx.wrap({
					type: t,
					object: r
				}));
				n.oid = i, s.push(i), l.set(i, e), c[i] = n.crc;
			} catch {
				continue;
			}
		}
		return s.sort(), p;
	}
	async toBuffer() {
		let e = [], t = (t, n) => {
			e.push(Buffer.from(t, n));
		};
		t("ff744f63", "hex"), t("00000002", "hex");
		let n = new bb(Buffer.alloc(256 * 4));
		for (let e = 0; e < 256; e++) {
			let t = 0;
			for (let n of this.hashes) parseInt(n.slice(0, 2), 16) <= e && t++;
			n.writeUInt32BE(t);
		}
		e.push(n.buffer);
		for (let e of this.hashes) t(e, "hex");
		let r = new bb(Buffer.alloc(this.hashes.length * 4));
		for (let e of this.hashes) r.writeUInt32BE(this.crcs[e]);
		e.push(r.buffer);
		let i = new bb(Buffer.alloc(this.hashes.length * 4));
		for (let e of this.hashes) i.writeUInt32BE(this.offsets.get(e));
		e.push(i.buffer), t(this.packfileSha, "hex");
		let a = Buffer.concat(e), o = await kb(a), s = Buffer.alloc(20);
		return s.write(o, "hex"), Buffer.concat([a, s]);
	}
	async load({ pack: e }) {
		this.pack = e;
	}
	async unload() {
		this.pack = null;
	}
	async read({ oid: e }) {
		if (!this.offsets.get(e)) {
			if (this.getExternalRefDelta) return this.externalReadDepth++, this.getExternalRefDelta(e);
			throw new vb(`Could not read object ${e} from packfile`);
		}
		let t = this.offsets.get(e);
		return this.readSlice({ start: t });
	}
	async readSlice({ start: e }) {
		if (this.offsetCache[e]) return Object.assign({}, this.offsetCache[e]);
		this.readDepth++;
		let t = {
			16: "commit",
			32: "tree",
			48: "blob",
			64: "tag",
			96: "ofs_delta",
			112: "ref_delta"
		}, n = await this.pack;
		if (!n) throw new vb("Could not read packfile data. The packfile may be missing, corrupted, or too large to read into memory.");
		let r = n.slice(e), i = new bb(r), a = i.readUInt8(), o = a & 112, s = t[o];
		if (s === void 0) throw new vb("Unrecognized type: 0b" + o.toString(2));
		let c = a & 15, l = c;
		a & 128 && (l = eS(i, c));
		let u = null, d = null;
		if (s === "ofs_delta") {
			let t = e - $x(i);
			({object: u, type: s} = await this.readSlice({ start: t }));
		}
		if (s === "ref_delta") {
			let e = i.slice(20).toString("hex");
			({object: u, type: s} = await this.read({ oid: e }));
		}
		let f = r.slice(i.tell());
		if (d = Buffer.from(await Xx(f)), d.byteLength !== l) throw new vb(`Packfile told us object would have length ${l} but it had length ${d.byteLength}`);
		return u && (d = Buffer.from(zx(d, u))), this.readDepth > 3 && (this.offsetCache[e] = {
			type: s,
			object: d
		}), {
			type: s,
			format: "content",
			object: d
		};
	}
}, nS = Symbol("PackfileCache");
async function rS({ fs: e, filename: t, getExternalRefDelta: n, emitter: r, emitterPrefix: i }) {
	let a = await e.read(t);
	return tS.fromIdx({
		idx: a,
		getExternalRefDelta: n
	});
}
function iS({ fs: e, cache: t, filename: n, getExternalRefDelta: r, emitter: i, emitterPrefix: a }) {
	t[nS] || (t[nS] = /* @__PURE__ */ new Map());
	let o = t[nS].get(n);
	return o || (o = rS({
		fs: e,
		filename: n,
		getExternalRefDelta: r,
		emitter: i,
		emitterPrefix: a
	}), t[nS].set(n, o)), o;
}
async function aS(e, { start: t = 0, end: n = e.length } = {}) {
	return kb(e.subarray(t, n));
}
async function oS({ fs: e, cache: t, gitdir: n, oid: r, format: i = "content", getExternalRefDelta: a }) {
	let o = await e.readdir(Z(n, "objects/pack"));
	o = o.filter((e) => e.endsWith(".idx"));
	for (let i of o) {
		let o = `${n}/objects/pack/${i}`, s = await iS({
			fs: e,
			cache: t,
			filename: o,
			getExternalRefDelta: a
		});
		if (s.error) throw new vb(s.error);
		if (s.offsets.has(r)) {
			let t = o.replace(/idx$/, "pack");
			s.pack ||= e.read(t);
			let n = await s.pack;
			if (!n) throw s.pack = null, new vb(`Could not read packfile at ${t}. The file may be missing, corrupted, or too large to read into memory.`);
			if (!s._checksumVerified) {
				let e = s.packfileSha, t = n.subarray(-20), r = Array.from(t).map((e) => e.toString(16).padStart(2, "0")).join("");
				if (r !== e) throw new vb(`Packfile trailer mismatch: expected ${e}, got ${r}. The packfile may be corrupted.`);
				let i = await aS(n, {
					start: 0,
					end: n.length - 20
				});
				if (i !== e) throw new vb(`Packfile payload corrupted: calculated ${i} but expected ${e}. The packfile may have been tampered with.`);
				s._checksumVerified = !0;
			}
			let c = await s.read({
				oid: r,
				getExternalRefDelta: a
			});
			return c.format = "content", c.source = `objects/pack/${i.replace(/idx$/, "pack")}`, c;
		}
	}
	return null;
}
async function sS({ fs: e, cache: t, gitdir: n, oid: r, format: i = "content" }) {
	let a = (r) => sS({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	}), o;
	if (r === "4b825dc642cb6eb9a060e54bf8d69288fbee4904" && (o = {
		format: "wrapped",
		object: Buffer.from("tree 0\0")
	}), o ||= await Rx({
		fs: e,
		gitdir: n,
		oid: r
	}), !o) {
		if (o = await oS({
			fs: e,
			cache: t,
			gitdir: n,
			oid: r,
			getExternalRefDelta: a
		}), !o) throw new Xb(r);
		return o;
	}
	if (i === "deflated" || (o.format === "deflated" && (o.object = Buffer.from(await Xx(o.object)), o.format = "wrapped"), i === "wrapped")) return o;
	let s = await kb(o.object);
	if (s !== r) throw new vb(`SHA check failed! Expected ${r}, computed ${s}`);
	let { object: c, type: l } = Lx.unwrap(o.object);
	if (o.type = l, o.object = c, o.format = "content", i === "content") return o;
	throw new vb(`invalid requested format "${i}"`);
}
var cS = class e extends gb {
	constructor(t, n, r = !0) {
		super(`Failed to create ${t} at ${n} because it already exists.${r ? ` (Hint: use 'force: true' parameter to overwrite existing ${t}.)` : ""}`), this.code = this.name = e.code, this.data = {
			noun: t,
			where: n,
			canForce: r
		};
	}
};
cS.code = "AlreadyExistsError";
var lS = class e extends gb {
	constructor(t, n, r) {
		super(`Found multiple ${t} matching "${n}" (${r.join(", ")}). Use a longer abbreviation length to disambiguate them.`), this.code = this.name = e.code, this.data = {
			nouns: t,
			short: n,
			matches: r
		};
	}
};
lS.code = "AmbiguousError";
var uS = class e extends gb {
	constructor(t) {
		super(`Your local changes to the following files would be overwritten by checkout: ${t.join(", ")}`), this.code = this.name = e.code, this.data = { filepaths: t };
	}
};
uS.code = "CheckoutConflictError";
var dS = class e extends gb {
	constructor(t, n) {
		super(`Cannot cherry-pick merge commit ${t}. Merge commits have ${n} parents and require specifying which parent to use as the base.`), this.code = this.name = e.code, this.data = {
			oid: t,
			parentCount: n
		};
	}
};
dS.code = "CherryPickMergeCommitError";
var fS = class e extends gb {
	constructor(t) {
		super(`Cannot cherry-pick root commit ${t}. Root commits have no parents.`), this.code = this.name = e.code, this.data = { oid: t };
	}
};
fS.code = "CherryPickRootCommitError";
var pS = class e extends gb {
	constructor(t, n) {
		super(`Failed to checkout "${t}" because commit ${n} is not available locally. Do a git fetch to make the branch available locally.`), this.code = this.name = e.code, this.data = {
			ref: t,
			oid: n
		};
	}
};
pS.code = "CommitNotFetchedError";
var mS = class e extends gb {
	constructor() {
		super("Cannot create an empty commit when disallowEmpty is true."), this.code = this.name = e.code, this.data = {};
	}
};
mS.code = "EmptyCommitError";
var hS = class e extends gb {
	constructor() {
		super("Empty response from git server."), this.code = this.name = e.code, this.data = {};
	}
};
hS.code = "EmptyServerResponseError";
var gS = class e extends gb {
	constructor() {
		super("A simple fast-forward merge was not possible."), this.code = this.name = e.code, this.data = {};
	}
};
gS.code = "FastForwardError";
var _S = class e extends gb {
	constructor(t, n) {
		super(`One or more branches were not updated: ${t}`), this.code = this.name = e.code, this.data = {
			prettyDetails: t,
			result: n
		};
	}
};
_S.code = "GitPushError";
var vS = class e extends gb {
	constructor(t, n, r) {
		super(`HTTP Error: ${t} ${n}`), this.code = this.name = e.code, this.data = {
			statusCode: t,
			statusMessage: n,
			response: r
		};
	}
};
vS.code = "HttpError";
var yS = class e extends gb {
	constructor(t) {
		let n = "invalid filepath";
		t === "leading-slash" || t === "trailing-slash" ? n = "\"filepath\" parameter should not include leading or trailing directory separators because these can cause problems on some platforms." : t === "directory" && (n = "\"filepath\" should not be a directory."), super(n), this.code = this.name = e.code, this.data = { reason: t };
	}
};
yS.code = "InvalidFilepathError";
var bS = class e extends gb {
	constructor(t, n) {
		super(`"${t}" would be an invalid git reference. (Hint: a valid alternative would be "${n}".)`), this.code = this.name = e.code, this.data = {
			ref: t,
			suggestion: n
		};
	}
};
bS.code = "InvalidRefNameError";
var xS = class e extends gb {
	constructor(t) {
		super(`Maximum search depth of ${t} exceeded.`), this.code = this.name = e.code, this.data = { depth: t };
	}
};
xS.code = "MaxDepthError";
var SS = class e extends gb {
	constructor() {
		super("Merges with conflicts are not supported yet."), this.code = this.name = e.code, this.data = {};
	}
};
SS.code = "MergeNotSupportedError";
var CS = class e extends gb {
	constructor(t, n, r, i) {
		super(`Automatic merge failed with one or more merge conflicts in the following files: ${t.toString()}. Fix conflicts then commit the result.`), this.code = this.name = e.code, this.data = {
			filepaths: t,
			bothModified: n,
			deleteByUs: r,
			deleteByTheirs: i
		};
	}
};
CS.code = "MergeConflictError";
var wS = class e extends gb {
	constructor(t) {
		super(`No name was provided for ${t} in the argument or in the .git/config file.`), this.code = this.name = e.code, this.data = { role: t };
	}
};
wS.code = "MissingNameError";
var TS = class e extends gb {
	constructor(t) {
		super(`The function requires a "${t}" parameter but none was provided.`), this.code = this.name = e.code, this.data = { parameter: t };
	}
};
TS.code = "MissingParameterError";
var ES = class e extends gb {
	constructor(t) {
		super("There are multiple errors that were thrown by the method. Please refer to the \"errors\" property to see more"), this.code = this.name = e.code, this.data = { errors: t }, this.errors = t;
	}
};
ES.code = "MultipleGitError";
var DS = class e extends gb {
	constructor(t, n) {
		super(`Expected "${t}" but received "${n}".`), this.code = this.name = e.code, this.data = {
			expected: t,
			actual: n
		};
	}
};
DS.code = "ParseError";
var OS = class e extends gb {
	constructor(t) {
		let n = "";
		t === "not-fast-forward" ? n = " because it was not a simple fast-forward" : t === "tag-exists" && (n = " because tag already exists"), super(`Push rejected${n}. Use "force: true" to override.`), this.code = this.name = e.code, this.data = { reason: t };
	}
};
OS.code = "PushRejectedError";
var kS = class e extends gb {
	constructor(t, n) {
		super(`Remote does not support the "${t}" so the "${n}" parameter cannot be used.`), this.code = this.name = e.code, this.data = {
			capability: t,
			parameter: n
		};
	}
};
kS.code = "RemoteCapabilityError";
var AS = class e extends gb {
	constructor(t, n) {
		super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${t}`), this.code = this.name = e.code, this.data = {
			preview: t,
			response: n
		};
	}
};
AS.code = "SmartHttpError";
var jS = class e extends gb {
	constructor(t, n, r) {
		super(`Git remote "${t}" uses an unrecognized transport protocol: "${n}"`), this.code = this.name = e.code, this.data = {
			url: t,
			transport: n,
			suggestion: r
		};
	}
};
jS.code = "UnknownTransportError";
var MS = class e extends gb {
	constructor(t) {
		super(`Cannot parse remote URL: "${t}"`), this.code = this.name = e.code, this.data = { url: t };
	}
};
MS.code = "UrlParseError";
var NS = class e extends gb {
	constructor() {
		super("The operation was canceled."), this.code = this.name = e.code, this.data = {};
	}
};
NS.code = "UserCanceledError";
var PS = class e extends gb {
	constructor(t) {
		super(`Could not merge index: Entry for '${t}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`), this.code = this.name = e.code, this.data = { filepath: t };
	}
};
PS.code = "IndexResetError";
var FS = class e extends gb {
	constructor(t) {
		super(`"${t}" does not point to any commit. You're maybe working on a repository with no commits yet. `), this.code = this.name = e.code, this.data = { ref: t };
	}
};
FS.code = "NoCommitError";
var IS = /*#__PURE__*/ Object.freeze({
	__proto__: null,
	AlreadyExistsError: cS,
	AmbiguousError: lS,
	CheckoutConflictError: uS,
	CherryPickMergeCommitError: dS,
	CherryPickRootCommitError: fS,
	CommitNotFetchedError: pS,
	EmptyCommitError: mS,
	EmptyServerResponseError: hS,
	FastForwardError: gS,
	GitPushError: _S,
	HttpError: vS,
	InternalError: vb,
	InvalidFilepathError: yS,
	InvalidOidError: Qb,
	InvalidRefNameError: bS,
	MaxDepthError: xS,
	MergeNotSupportedError: SS,
	MergeConflictError: CS,
	MissingNameError: wS,
	MissingParameterError: TS,
	MultipleGitError: ES,
	NoRefspecError: $b,
	NotFoundError: Xb,
	ObjectTypeError: Zb,
	ParseError: DS,
	PushRejectedError: OS,
	RemoteCapabilityError: kS,
	SmartHttpError: AS,
	UnknownTransportError: jS,
	UnsafeFilepathError: yb,
	UrlParseError: MS,
	UserCanceledError: NS,
	UnmergedPathsError: _b,
	IndexResetError: PS,
	NoCommitError: FS
});
function LS({ name: e, email: t, timestamp: n, timezoneOffset: r }) {
	return r = RS(r), `${e} <${t}> ${n} ${r}`;
}
function RS(e) {
	let t = zS(BS(e));
	e = Math.abs(e);
	let n = Math.floor(e / 60);
	e -= n * 60;
	let r = String(n), i = String(e);
	return r.length < 2 && (r = "0" + r), i.length < 2 && (i = "0" + i), (t === -1 ? "-" : "+") + r + i;
}
function zS(e) {
	return Math.sign(e) || (Object.is(e, -0) ? -1 : 1);
}
function BS(e) {
	return e === 0 ? e : -e;
}
function VS(e) {
	return e = e.replace(/\r/g, ""), e = e.replace(/^\n+/, ""), e = e.replace(/\n+$/, "") + "\n", e;
}
function HS(e) {
	let [, t, n, r, i] = e.match(/^(.*) <(.*)> (.*) (.*)$/);
	return {
		name: t,
		email: n,
		timestamp: Number(r),
		timezoneOffset: US(i)
	};
}
function US(e) {
	let [, t, n, r] = e.match(/(\+|-)(\d\d)(\d\d)/);
	return r = (t === "+" ? 1 : -1) * (Number(n) * 60 + Number(r)), WS(r);
}
function WS(e) {
	return e === 0 ? e : -e;
}
var GS = class e {
	constructor(t) {
		if (typeof t == "string") this._tag = t;
		else if (Buffer.isBuffer(t)) this._tag = t.toString("utf8");
		else if (typeof t == "object") this._tag = e.render(t);
		else throw new vb("invalid type passed to GitAnnotatedTag constructor");
	}
	static from(t) {
		return new e(t);
	}
	static render(e) {
		return `object ${e.object}
type ${e.type}
tag ${e.tag}
tagger ${LS(e.tagger)}

${e.message}
${e.gpgsig ? e.gpgsig : ""}`;
	}
	justHeaders() {
		return this._tag.slice(0, this._tag.indexOf("\n\n"));
	}
	message() {
		let e = this.withoutSignature();
		return e.slice(e.indexOf("\n\n") + 2);
	}
	parse() {
		return Object.assign(this.headers(), {
			message: this.message(),
			gpgsig: this.gpgsig()
		});
	}
	render() {
		return this._tag;
	}
	headers() {
		let e = this.justHeaders().split("\n"), t = [];
		for (let n of e) n[0] === " " ? t[t.length - 1] += "\n" + n.slice(1) : t.push(n);
		let n = {};
		for (let e of t) {
			let t = e.slice(0, e.indexOf(" ")), r = e.slice(e.indexOf(" ") + 1);
			Array.isArray(n[t]) ? n[t].push(r) : n[t] = r;
		}
		return n.tagger &&= HS(n.tagger), n.committer &&= HS(n.committer), n;
	}
	withoutSignature() {
		let e = VS(this._tag);
		return e.indexOf("\n-----BEGIN PGP SIGNATURE-----") === -1 ? e : e.slice(0, e.lastIndexOf("\n-----BEGIN PGP SIGNATURE-----"));
	}
	gpgsig() {
		if (this._tag.indexOf("\n-----BEGIN PGP SIGNATURE-----") !== -1) return VS(this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"), this._tag.indexOf("-----END PGP SIGNATURE-----") + 27));
	}
	payload() {
		return this.withoutSignature() + "\n";
	}
	toObject() {
		return Buffer.from(this._tag, "utf8");
	}
	static async sign(t, n, r) {
		let i = t.payload(), { signature: a } = await n({
			payload: i,
			secretKey: r
		});
		a = VS(a);
		let o = i + a;
		return e.from(o);
	}
};
function KS(e) {
	return e.trim().split("\n").map((e) => " " + e).join("\n") + "\n";
}
function qS(e) {
	return e.split("\n").map((e) => e.replace(/^ /, "")).join("\n");
}
var JS = class e {
	constructor(t) {
		if (typeof t == "string") this._commit = t;
		else if (Buffer.isBuffer(t)) this._commit = t.toString("utf8");
		else if (typeof t == "object") this._commit = e.render(t);
		else throw new vb("invalid type passed to GitCommit constructor");
	}
	static fromPayloadSignature({ payload: t, signature: n }) {
		let r = e.justHeaders(t), i = e.justMessage(t), a = VS(r + "\ngpgsig" + KS(n) + "\n" + i);
		return new e(a);
	}
	static from(t) {
		return new e(t);
	}
	toObject() {
		return Buffer.from(this._commit, "utf8");
	}
	headers() {
		return this.parseHeaders();
	}
	message() {
		return e.justMessage(this._commit);
	}
	parse() {
		return Object.assign({ message: this.message() }, this.headers());
	}
	static justMessage(e) {
		return VS(e.slice(e.indexOf("\n\n") + 2));
	}
	static justHeaders(e) {
		return e.slice(0, e.indexOf("\n\n"));
	}
	parseHeaders() {
		let t = e.justHeaders(this._commit).split("\n"), n = [];
		for (let e of t) e[0] === " " ? n[n.length - 1] += "\n" + e.slice(1) : n.push(e);
		let r = { parent: [] };
		for (let e of n) {
			let t = e.slice(0, e.indexOf(" ")), n = e.slice(e.indexOf(" ") + 1);
			Array.isArray(r[t]) ? r[t].push(n) : r[t] = n;
		}
		return r.author &&= HS(r.author), r.committer &&= HS(r.committer), r;
	}
	static renderHeaders(e) {
		let t = "";
		if (e.tree ? t += `tree ${e.tree}\n` : t += "tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904\n", e.parent) {
			if (e.parent.length === void 0) throw new vb("commit 'parent' property should be an array");
			for (let n of e.parent) t += `parent ${n}\n`;
		}
		let n = e.author;
		t += `author ${LS(n)}\n`;
		let r = e.committer || e.author;
		return t += `committer ${LS(r)}\n`, e.gpgsig && (t += "gpgsig" + KS(e.gpgsig)), t;
	}
	static render(t) {
		return e.renderHeaders(t) + "\n" + VS(t.message);
	}
	render() {
		return this._commit;
	}
	withoutSignature() {
		let e = VS(this._commit);
		if (e.indexOf("\ngpgsig") === -1) return e;
		let t = e.slice(0, e.indexOf("\ngpgsig")), n = e.slice(e.indexOf("-----END PGP SIGNATURE-----\n") + 28);
		return VS(t + "\n" + n);
	}
	isolateSignature() {
		return qS(this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"), this._commit.indexOf("-----END PGP SIGNATURE-----") + 27));
	}
	static async sign(t, n, r) {
		let i = t.withoutSignature(), a = e.justMessage(t._commit), { signature: o } = await n({
			payload: i,
			secretKey: r
		});
		o = VS(o);
		let s = e.justHeaders(t._commit) + "\ngpgsig" + KS(o) + "\n" + a;
		return e.from(s);
	}
};
async function YS({ fs: e, cache: t, gitdir: n, oid: r }) {
	if (r === "4b825dc642cb6eb9a060e54bf8d69288fbee4904") return {
		tree: Ix.from([]),
		oid: r
	};
	let { type: i, object: a } = await sS({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	});
	if (i === "tag") return r = GS.from(a).parse().object, YS({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	});
	if (i === "commit") return r = JS.from(a).parse().tree, YS({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	});
	if (i !== "tree") throw new Zb(r, i, "tree");
	return {
		tree: Ix.from(a),
		oid: r
	};
}
var XS = class {
	constructor({ fs: e, gitdir: t, ref: n, cache: r }) {
		this.fs = e, this.cache = r, this.gitdir = t, this.mapPromise = (async () => {
			let r = /* @__PURE__ */ new Map(), i;
			try {
				i = await Q.resolve({
					fs: e,
					gitdir: t,
					ref: n
				});
			} catch (e) {
				e instanceof Xb && (i = "4b825dc642cb6eb9a060e54bf8d69288fbee4904");
			}
			let a = await YS({
				fs: e,
				cache: this.cache,
				gitdir: t,
				oid: i
			});
			return a.type = "tree", a.mode = "40000", r.set(".", a), r;
		})();
		let i = this;
		this.ConstructEntry = class {
			constructor(e) {
				this._fullpath = e, this._type = !1, this._mode = !1, this._stat = !1, this._content = !1, this._oid = !1;
			}
			async type() {
				return i.type(this);
			}
			async mode() {
				return i.mode(this);
			}
			async stat() {
				return i.stat(this);
			}
			async content() {
				return i.content(this);
			}
			async oid() {
				return i.oid(this);
			}
		};
	}
	async readdir(e) {
		let t = e._fullpath, { fs: n, cache: r, gitdir: i } = this, a = await this.mapPromise, o = a.get(t);
		if (!o) throw Error(`No obj for ${t}`);
		let s = o.oid;
		if (!s) throw Error(`No oid for obj ${JSON.stringify(o)}`);
		if (o.type !== "tree") return null;
		let { type: c, object: l } = await sS({
			fs: n,
			cache: r,
			gitdir: i,
			oid: s
		});
		if (c !== o.type) throw new Zb(s, c, o.type);
		let u = Ix.from(l);
		for (let e of u) a.set(Z(t, e.path), e);
		return u.entries().map((e) => Z(t, e.path));
	}
	async type(e) {
		if (e._type === !1) {
			let { type: t } = (await this.mapPromise).get(e._fullpath);
			e._type = t;
		}
		return e._type;
	}
	async mode(e) {
		if (e._mode === !1) {
			let { mode: t } = (await this.mapPromise).get(e._fullpath);
			e._mode = Cb(parseInt(t, 8));
		}
		return e._mode;
	}
	async stat(e) {}
	async content(e) {
		if (e._content === !1) {
			let t = await this.mapPromise, { fs: n, cache: r, gitdir: i } = this, a = t.get(e._fullpath).oid, { type: o, object: s } = await sS({
				fs: n,
				cache: r,
				gitdir: i,
				oid: a
			});
			o === "blob" ? e._content = new Uint8Array(s) : e._content = void 0;
		}
		return e._content;
	}
	async oid(e) {
		return e._oid === !1 && (e._oid = (await this.mapPromise).get(e._fullpath).oid), e._oid;
	}
};
function ZS({ ref: e = "HEAD" } = {}) {
	let t = Object.create(null);
	return Object.defineProperty(t, Jb, { value: function({ fs: t, gitdir: n, cache: r }) {
		return new XS({
			fs: t,
			gitdir: n,
			ref: e,
			cache: r
		});
	} }), Object.freeze(t), t;
}
var QS = class {
	constructor({ fs: e, dir: t, gitdir: n, cache: r, refresh: i = !0 }) {
		this.fs = e, this.cache = r, this.dir = t, this.gitdir = n, this.refresh = i, this.config = null;
		let a = this;
		this.ConstructEntry = class {
			constructor(e) {
				this._fullpath = e, this._type = !1, this._mode = !1, this._stat = !1, this._content = !1, this._oid = !1;
			}
			async type() {
				return a.type(this);
			}
			async mode() {
				return a.mode(this);
			}
			async stat() {
				return a.stat(this);
			}
			async content() {
				return a.content(this);
			}
			async oid() {
				return a.oid(this);
			}
		};
	}
	async readdir(e) {
		if (await e.type() !== "tree") return null;
		let t = e._fullpath, { fs: n, dir: r } = this, i = await n.readdir(Z(r, t));
		return i === null ? null : i.map((e) => Z(t, e));
	}
	async type(e) {
		return e._type === !1 && await e.stat(), e._type;
	}
	async mode(e) {
		return e._mode === !1 && await e.stat(), e._mode;
	}
	async stat(e) {
		if (e._stat === !1) {
			let { fs: t, dir: n } = this, r = await t.lstat(`${n}/${e._fullpath}`);
			if (!r) throw Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);
			let i = r.isDirectory() ? "tree" : "blob";
			i === "blob" && !r.isFile() && !r.isSymbolicLink() && (i = "special"), e._type = i, r = Eb(r), e._mode = r.mode, r.size === -1 && e._actualSize && (r.size = e._actualSize), e._stat = r;
		}
		return e._stat;
	}
	async content(e) {
		if (e._content === !1) {
			let { fs: t, dir: n, gitdir: r } = this;
			if (await e.type() === "tree") e._content = void 0;
			else {
				let i;
				if (await e.mode() >> 12 == 10) i = await t.readlink(`${n}/${e._fullpath}`);
				else {
					let a = await (await this._getGitConfig(t, r)).get("core.autocrlf");
					i = await t.read(`${n}/${e._fullpath}`, { autocrlf: a });
				}
				e._actualSize = i.length, e._stat && e._stat.size === -1 && (e._stat.size = e._actualSize), e._content = new Uint8Array(i);
			}
		}
		return e._content;
	}
	async oid(e) {
		if (e._oid === !1) {
			let t = this, { fs: n, gitdir: r, cache: i } = this, a;
			await Hb.acquire({
				fs: n,
				gitdir: r,
				cache: i
			}, async function(i) {
				let o = i.entriesMap.get(e._fullpath), s = await e.stat(), c = await (await t._getGitConfig(n, r)).get("core.filemode"), l = typeof process < "u" ? process.platform !== "win32" : !0;
				if (!o || Ib(s, o, c, l)) {
					let n = await e.content();
					n === void 0 ? a = void 0 : (a = await kb(Lx.wrap({
						type: "blob",
						object: n
					})), t.refresh && o && a === o.oid && (!c || s.mode === o.mode) && Ib(s, o, c, l) && i.insert({
						filepath: e._fullpath,
						stats: s,
						oid: a
					}));
				} else a = o.oid;
			}), e._oid = a;
		}
		return e._oid;
	}
	async _getGitConfig(e, t) {
		return this.config ||= await Tx.get({
			fs: e,
			gitdir: t
		}), this.config;
	}
};
function $S({ refresh: e = !0 } = {}) {
	let t = Object.create(null);
	return Object.defineProperty(t, Jb, { value: function({ fs: t, dir: n, gitdir: r, cache: i }) {
		return new QS({
			fs: t,
			dir: n,
			gitdir: r,
			cache: i,
			refresh: e
		});
	} }), Object.freeze(t), t;
}
function eC(e, t) {
	let n = t - e;
	return Array.from({ length: n }, (t, n) => e + n);
}
var tC = Array.prototype.flat === void 0 ? (e) => e.reduce((e, t) => e.concat(t), []) : (e) => e.flat(), nC = class {
	constructor() {
		this.value = null;
	}
	consider(e) {
		e != null && (this.value === null || e < this.value) && (this.value = e);
	}
	reset() {
		this.value = null;
	}
};
function* rC(e) {
	let t = new nC(), n, r = [], i = e.length;
	for (let n = 0; n < i; n++) r[n] = e[n].next().value, r[n] !== void 0 && t.consider(r[n]);
	if (t.value !== null) for (;;) {
		let a = [];
		n = t.value, t.reset();
		for (let o = 0; o < i; o++) r[o] !== void 0 && r[o] === n ? (a[o] = r[o], r[o] = e[o].next().value) : a[o] = null, r[o] !== void 0 && t.consider(r[o]);
		if (yield a, t.value === null) return;
	}
}
async function iC({ fs: e, cache: t, dir: n, gitdir: r, trees: i, map: a = async (e, t) => t, reduce: o = async (e, t) => {
	let n = tC(t);
	return e !== void 0 && n.unshift(e), n;
}, iterate: s = (e, t) => Promise.all([...t].map(e)) }) {
	let c = i.map((i) => i[Jb]({
		fs: e,
		dir: n,
		gitdir: r,
		cache: t
	})), l = Array(c.length).fill("."), u = eC(0, c.length), d = async (e) => (u.forEach((t) => {
		let n = e[t];
		e[t] = n && new c[t].ConstructEntry(n);
	}), {
		entries: e,
		children: rC((await Promise.all(u.map((t) => {
			let n = e[t];
			return n ? c[t].readdir(n) : [];
		}))).map((e) => (e === null ? [] : e)[Symbol.iterator]()))
	}), f = async (e) => {
		let { entries: t, children: n } = await d(e), r = t.find((e) => e && e._fullpath)._fullpath, i = await a(r, t);
		if (i !== null) {
			let e = await s(f, n);
			return e = e.filter((e) => e !== void 0), o(i, e);
		}
	};
	return f(l);
}
async function aC(e, t) {
	let n = await e.readdir(t);
	n == null ? await e.rm(t) : n.length ? await Promise.all(n.map((n) => {
		let r = Z(t, n);
		return e.lstat(r).then((t) => {
			if (t) return t.isDirectory() ? aC(e, r) : e.rm(r);
		});
	})).then(() => e.rmdir(t)) : await e.rmdir(t);
}
function oC(e) {
	return sC(e) && cC(e.then) && cC(e.catch);
}
function sC(e) {
	return e && typeof e == "object";
}
function cC(e) {
	return typeof e == "function";
}
function lC(e) {
	return oC(((e) => {
		try {
			return e.readFile().catch((e) => e);
		} catch (e) {
			return e;
		}
	})(e));
}
var uC = [
	"readFile",
	"writeFile",
	"mkdir",
	"rmdir",
	"unlink",
	"stat",
	"lstat",
	"readdir",
	"readlink",
	"symlink"
];
function dC(e, t) {
	if (lC(t)) for (let n of uC) e[`_${n}`] = t[n].bind(t);
	else for (let n of uC) e[`_${n}`] = (0, fb.default)(t[n].bind(t));
	lC(t) ? (t.cp && (e._cp = t.cp.bind(t)), t.rm ? e._rm = t.rm.bind(t) : t.rmdir.length > 1 ? e._rm = t.rmdir.bind(t) : e._rm = aC.bind(null, e)) : (t.cp && (e._cp = (0, fb.default)(t.cp.bind(t))), t.rm ? e._rm = (0, fb.default)(t.rm.bind(t)) : t.rmdir.length > 2 ? e._rm = (0, fb.default)(t.rmdir.bind(t)) : e._rm = aC.bind(null, e));
}
var fC = class {
	constructor(e) {
		if (e._original_unwrapped_fs !== void 0) return e;
		let t = Object.getOwnPropertyDescriptor(e, "promises");
		t && t.enumerable ? dC(this, e.promises) : dC(this, e), this._original_unwrapped_fs = e;
	}
	async exists(e, t = {}) {
		try {
			return await this._stat(e), !0;
		} catch (e) {
			if (e.code === "ENOENT" || e.code === "ENOTDIR" || (e.code || "").includes("ENS")) return !1;
			throw console.log("Unhandled error in \"FileSystem.exists()\" function", e), e;
		}
	}
	async read(e, t = {}) {
		try {
			let n = await this._readFile(e, t);
			if (t.autocrlf === "true") try {
				n = new TextDecoder("utf8", { fatal: !0 }).decode(n), n = n.replace(/\r\n/g, "\n"), n = new TextEncoder().encode(n);
			} catch {}
			return typeof n != "string" && (n = Buffer.from(n)), n;
		} catch {
			return null;
		}
	}
	async write(e, t, n = {}) {
		try {
			await this._writeFile(e, t, n);
		} catch {
			await this.mkdir(Wb(e)), await this._writeFile(e, t, n);
		}
	}
	async mkdir(e, t = !1) {
		try {
			await this._mkdir(e);
		} catch (n) {
			if (n === null || n.code === "EEXIST") return;
			if (t) throw n;
			if (n.code === "ENOENT") {
				let t = Wb(e);
				if (t === "." || t === "/" || t === e) throw n;
				await this.mkdir(t), await this.mkdir(e, !0);
			}
		}
	}
	async rm(e) {
		try {
			await this._unlink(e);
		} catch (e) {
			if (e.code !== "ENOENT") throw e;
		}
	}
	async rmdir(e, t) {
		try {
			t && t.recursive ? await this._rm(e, t) : await this._rmdir(e);
		} catch (e) {
			if (e.code !== "ENOENT") throw e;
		}
	}
	async readdir(e) {
		try {
			let t = await this._readdir(e);
			return t.sort(xb), t;
		} catch (e) {
			return e.code === "ENOTDIR" ? null : [];
		}
	}
	async readdirDeep(e) {
		let t = await this._readdir(e);
		return (await Promise.all(t.map(async (t) => {
			let n = e + "/" + t;
			return (await this._stat(n)).isDirectory() ? this.readdirDeep(n) : n;
		}))).reduce((e, t) => e.concat(t), []);
	}
	async lstat(e) {
		try {
			return await this._lstat(e);
		} catch (e) {
			if (e.code === "ENOENT" || (e.code || "").includes("ENS")) return null;
			throw e;
		}
	}
	async readlink(e, t = { encoding: "buffer" }) {
		try {
			let n = await this._readlink(e, t);
			return Buffer.isBuffer(n) ? n : Buffer.from(n);
		} catch (e) {
			if (e.code === "ENOENT" || (e.code || "").includes("ENS")) return null;
			throw e;
		}
	}
	async writelink(e, t) {
		return this._symlink(t.toString("utf8"), e);
	}
};
function $(e, t) {
	if (t === void 0) throw new TS(e);
}
function pC(e) {
	return e.startsWith("/") || /^[a-zA-Z]:[\\/]/.test(e);
}
async function mC({ fsp: e, dotgit: t }) {
	$("fsp", e), $("dotgit", t);
	let n = await e._stat(t).catch(() => ({
		isFile: () => !1,
		isDirectory: () => !1
	}));
	return n.isDirectory() ? t : n.isFile() ? e._readFile(t, "utf8").then((e) => e.trimRight().substr(8)).then((e) => pC(e) ? e : Z(Wb(t), e)) : t;
}
async function hC(e, t) {
	return !e && !t ? !1 : e && !t || !e && t ? !0 : !(await e.type() === "tree" && await t.type() === "tree" || await e.type() === await t.type() && await e.mode() === await t.mode() && await e.oid() === await t.oid());
}
async function gC({ fs: e, dir: t, gitdir: n = Z(t, ".git"), commit: r = "HEAD", cache: i = {} }) {
	try {
		$("fs", e), $("dir", t), $("gitdir", n);
		let a = new fC(e), o = [
			ZS({ ref: r }),
			$S(),
			Yb()
		], s = [], c = await mC({
			fsp: a,
			dotgit: n
		});
		await Hb.acquire({
			fs: a,
			gitdir: c,
			cache: i
		}, async function(e) {
			s = e.unmergedPaths;
		});
		let l = await iC({
			fs: a,
			cache: i,
			dir: t,
			gitdir: c,
			trees: o,
			map: async function(e, [t, n, r]) {
				let i = !await hC(n, r), a = s.includes(e), o = !await hC(r, t);
				if (i || a) return t ? {
					path: e,
					mode: await t.mode(),
					oid: await t.oid(),
					type: await t.type(),
					content: await t.content()
				} : void 0;
				if (o) return !1;
				throw new PS(e);
			}
		});
		await Hb.acquire({
			fs: a,
			gitdir: c,
			cache: i
		}, async function(e) {
			for (let n of l) if (n !== !1) {
				if (!n) {
					await a.rmdir(`${t}/${n.path}`, { recursive: !0 }), e.delete({ filepath: n.path });
					continue;
				}
				if (n.type === "blob") {
					let r = new TextDecoder().decode(n.content);
					await a.write(`${t}/${n.path}`, r, { mode: n.mode }), e.insert({
						filepath: n.path,
						oid: n.oid,
						stage: 0
					});
				}
			}
		});
	} catch (e) {
		throw e.caller = "git.abortMerge", e;
	}
}
var _C = class {
	static async isIgnored({ fs: e, dir: t, gitdir: n = Z(t, ".git"), filepath: r }) {
		if (Ub(r) === ".git") return !0;
		if (r === ".") return !1;
		let i = "", a = Z(n, "info", "exclude");
		await e.exists(a) && (i = await e.read(a, "utf8"));
		let o = [{
			gitignore: Z(t, ".gitignore"),
			filepath: r
		}], s = r.split("/").filter(Boolean);
		for (let e = 1; e < s.length; e++) {
			let n = s.slice(0, e).join("/"), r = s.slice(e).join("/");
			o.push({
				gitignore: Z(t, n, ".gitignore"),
				filepath: r
			});
		}
		let c = !1;
		for (let t of o) {
			let n;
			try {
				n = await e.read(t.gitignore, "utf8");
			} catch (e) {
				if (e.code === "NOENT") continue;
			}
			let r = (0, pb.default)().add(i);
			r.add(n);
			let a = Wb(t.filepath);
			if (a !== "." && r.ignores(a)) return !0;
			c = c ? !r.test(t.filepath).unignored : r.test(t.filepath).ignored;
		}
		return c;
	}
};
async function vC({ fs: e, gitdir: t, object: n, format: r, oid: i }) {
	if (r !== "deflated") throw new vb("GitObjectStoreLoose expects objects to write to be in deflated format");
	let a = `${t}/${`objects/${i.slice(0, 2)}/${i.slice(2)}`}`;
	await e.exists(a) || await e.write(a, n);
}
var yC = null;
async function bC(e) {
	return yC === null && (yC = SC()), yC ? xC(e) : db.default.deflate(e);
}
async function xC(e) {
	let t = new CompressionStream("deflate"), n = new Blob([e]).stream().pipeThrough(t);
	return new Uint8Array(await new Response(n).arrayBuffer());
}
function SC() {
	try {
		return new CompressionStream("deflate").writable.close(), new Blob([]).stream().cancel(), !0;
	} catch {
		return !1;
	}
}
async function CC({ fs: e, gitdir: t, type: n, object: r, format: i = "content", oid: a = void 0, dryRun: o = !1 }) {
	return i !== "deflated" && (i !== "wrapped" && (r = Lx.wrap({
		type: n,
		object: r
	})), a = await kb(r), r = Buffer.from(await bC(r))), o || await vC({
		fs: e,
		gitdir: t,
		object: r,
		format: "deflated",
		oid: a
	}), a;
}
function wC(e) {
	let t;
	for (; ~(t = e.indexOf(92));) e[t] = 47;
	return e;
}
async function TC({ fs: e, dir: t, gitdir: n = Z(t, ".git"), filepath: r, cache: i = {}, force: a = !1, parallel: o = !0 }) {
	try {
		$("fs", e), $("dir", t), $("gitdir", n), $("filepath", r);
		let s = new fC(e), c = await mC({
			fsp: s,
			dotgit: n
		});
		await Hb.acquire({
			fs: s,
			gitdir: c,
			cache: i
		}, async (e) => {
			let n = await (await Tx.get({
				fs: s,
				gitdir: c
			})).get("core.autocrlf");
			return EC({
				dir: t,
				gitdir: c,
				fs: s,
				filepath: r,
				index: e,
				force: a,
				parallel: o,
				autocrlf: n
			});
		});
	} catch (e) {
		throw e.caller = "git.add", e;
	}
}
async function EC({ dir: e, gitdir: t, fs: n, filepath: r, index: i, force: a, parallel: o, autocrlf: s }) {
	r = Array.isArray(r) ? r : [r];
	let c = r.map(async (r) => {
		if (!a && await _C.isIgnored({
			fs: n,
			dir: e,
			gitdir: t,
			filepath: r
		})) return;
		let c = await n.lstat(Z(e, r));
		if (!c) throw new Xb(r);
		if (c.isDirectory()) {
			let c = await n.readdir(Z(e, r));
			if (o) {
				let l = c.map((c) => EC({
					dir: e,
					gitdir: t,
					fs: n,
					filepath: [Z(r, c)],
					index: i,
					force: a,
					parallel: o,
					autocrlf: s
				}));
				await Promise.all(l);
			} else for (let l of c) await EC({
				dir: e,
				gitdir: t,
				fs: n,
				filepath: [Z(r, l)],
				index: i,
				force: a,
				parallel: o,
				autocrlf: s
			});
		} else {
			let a = c.isSymbolicLink() ? await n.readlink(Z(e, r)).then(wC) : await n.read(Z(e, r), { autocrlf: s });
			if (a === null) throw new Xb(r);
			let o = await CC({
				fs: n,
				gitdir: t,
				type: "blob",
				object: a
			});
			i.insert({
				filepath: r,
				stats: c,
				oid: o
			});
		}
	}), l = await Promise.allSettled(c), u = l.filter((e) => e.status === "rejected").map((e) => e.reason);
	if (u.length > 1) throw new ES(u);
	if (u.length === 1) throw u[0];
	return l.filter((e) => e.status === "fulfilled" && e.value).map((e) => e.value);
}
async function DC({ fs: e, gitdir: t, path: n }) {
	return (await Tx.get({
		fs: e,
		gitdir: t
	})).get(n);
}
function OC(e, ...t) {
	for (let n of t) if (n) for (let t of Object.keys(n)) {
		let r = n[t];
		r !== void 0 && (e[t] = r);
	}
	return e;
}
async function kC({ fs: e, gitdir: t, author: n, commit: r }) {
	let i = Math.floor(Date.now() / 1e3), a = OC({}, {
		name: await DC({
			fs: e,
			gitdir: t,
			path: "user.name"
		}),
		email: await DC({
			fs: e,
			gitdir: t,
			path: "user.email"
		}) || "",
		timestamp: i,
		timezoneOffset: (/* @__PURE__ */ new Date(i * 1e3)).getTimezoneOffset()
	}, r ? r.author : void 0, n);
	if (a.name !== void 0) return a;
}
async function AC({ fs: e, gitdir: t, author: n, committer: r, commit: i }) {
	let a = Math.floor(Date.now() / 1e3), o = OC({}, {
		name: await DC({
			fs: e,
			gitdir: t,
			path: "user.name"
		}),
		email: await DC({
			fs: e,
			gitdir: t,
			path: "user.email"
		}) || "",
		timestamp: a,
		timezoneOffset: (/* @__PURE__ */ new Date(a * 1e3)).getTimezoneOffset()
	}, i ? i.committer : void 0, n, r);
	if (o.name !== void 0) return o;
}
async function jC({ fs: e, cache: t, gitdir: n, oid: r }) {
	let { type: i, object: a } = await sS({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	});
	if (i === "tag") return r = GS.from(a).parse().object, jC({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	});
	if (i !== "commit") throw new Zb(r, i, "commit");
	return {
		commit: JS.from(a),
		oid: r
	};
}
async function MC({ fs: e, cache: t, gitdir: n, oid: r }) {
	let { commit: i, oid: a } = await jC({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	});
	return {
		oid: a,
		commit: i.parse(),
		payload: i.withoutSignature()
	};
}
var NC = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
async function PC({ fs: e, cache: t, onSign: n, gitdir: r, message: i, author: a, committer: o, signingKey: s, amend: c = !1, dryRun: l = !1, noUpdateBranch: u = !1, disallowEmpty: d = !1, ref: f, parent: p, tree: m }) {
	let h = !1, g = !1;
	f ||= (g = !(await e.read(`${r}/HEAD`, { encoding: "utf8" })).startsWith("ref:"), await Q.resolve({
		fs: e,
		gitdir: r,
		ref: "HEAD",
		depth: 2
	}));
	let _, v;
	try {
		_ = await Q.resolve({
			fs: e,
			gitdir: r,
			ref: f
		}), v = await MC({
			fs: e,
			gitdir: r,
			oid: _,
			cache: {}
		});
	} catch {
		h = !0;
	}
	if (c && h) throw new FS(f);
	let y = c ? await kC({
		fs: e,
		gitdir: r,
		author: a,
		commit: v.commit
	}) : await kC({
		fs: e,
		gitdir: r,
		author: a
	});
	if (!y) throw new wS("author");
	let b = c ? await AC({
		fs: e,
		gitdir: r,
		author: y,
		committer: o,
		commit: v.commit
	}) : await AC({
		fs: e,
		gitdir: r,
		author: y,
		committer: o
	});
	if (!b) throw new wS("committer");
	return Hb.acquire({
		fs: e,
		gitdir: r,
		cache: t,
		allowUnmerged: !1
	}, async function(t) {
		let a = Gb(t.entries).get(".");
		if (m ||= await FC({
			fs: e,
			gitdir: r,
			inode: a,
			dryRun: l
		}), p = p ? await Promise.all(p.map((t) => Q.resolve({
			fs: e,
			gitdir: r,
			ref: t
		}))) : c ? v.commit.parent : _ ? [_] : [], d && !c && (h && m === NC || !h && m === v.commit.tree)) throw new mS();
		if (!i) if (c) i = v.commit.message;
		else throw new TS("message");
		let o = JS.from({
			tree: m,
			parent: p,
			author: y,
			committer: b,
			message: i
		});
		s && (o = await JS.sign(o, n, s));
		let x = await CC({
			fs: e,
			gitdir: r,
			type: "commit",
			object: o.toObject(),
			dryRun: l
		});
		return !u && !l && await Q.writeRef({
			fs: e,
			gitdir: r,
			ref: g ? "HEAD" : f,
			value: x
		}), x;
	});
}
async function FC({ fs: e, gitdir: t, inode: n, dryRun: r }) {
	let i = n.children;
	for (let n of i) n.type === "tree" && (n.metadata.mode = "040000", n.metadata.oid = await FC({
		fs: e,
		gitdir: t,
		inode: n,
		dryRun: r
	}));
	let a = i.map((e) => ({
		mode: e.metadata.mode,
		path: e.basename,
		oid: e.metadata.oid,
		type: e.type
	}));
	return await CC({
		fs: e,
		gitdir: t,
		type: "tree",
		object: Ix.from(a).toObject(),
		dryRun: r
	});
}
async function IC({ fs: e, cache: t, gitdir: n, oid: r, filepath: i }) {
	if (i.startsWith("/")) throw new yS("leading-slash");
	if (i.endsWith("/")) throw new yS("trailing-slash");
	let a = r, o = await YS({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	}), s = o.tree;
	return r = i === "" ? o.oid : await LC({
		fs: e,
		cache: t,
		gitdir: n,
		tree: s,
		pathArray: i.split("/"),
		oid: a,
		filepath: i
	}), r;
}
async function LC({ fs: e, cache: t, gitdir: n, tree: r, pathArray: i, oid: a, filepath: o }) {
	let s = i.shift();
	for (let c of r) if (c.path === s) {
		if (i.length === 0) return c.oid;
		{
			let { type: s, object: l } = await sS({
				fs: e,
				cache: t,
				gitdir: n,
				oid: c.oid
			});
			if (s !== "tree") throw new Zb(a, s, "tree", o);
			return r = Ix.from(l), LC({
				fs: e,
				cache: t,
				gitdir: n,
				tree: r,
				pathArray: i,
				oid: a,
				filepath: o
			});
		}
	}
	throw new Xb(`file or directory found at "${a}:${o}"`);
}
async function RC({ fs: e, cache: t, gitdir: n, oid: r, filepath: i = void 0 }) {
	i !== void 0 && (r = await IC({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r,
		filepath: i
	}));
	let { tree: a, oid: o } = await YS({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	});
	return {
		oid: o,
		tree: a.entries()
	};
}
async function zC({ fs: e, gitdir: t, tree: n }) {
	return await CC({
		fs: e,
		gitdir: t,
		type: "tree",
		object: Ix.from(n).toObject(),
		format: "content"
	});
}
async function BC({ fs: e, cache: t, onSign: n, gitdir: r, ref: i, oid: a, note: o, force: s, author: c, committer: l, signingKey: u }) {
	let d;
	try {
		d = await Q.resolve({
			gitdir: r,
			fs: e,
			ref: i
		});
	} catch (e) {
		if (!(e instanceof Xb)) throw e;
	}
	let f = (await RC({
		fs: e,
		cache: t,
		gitdir: r,
		oid: d || "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
	})).tree;
	if (s) f = f.filter((e) => e.path !== a);
	else for (let e of f) if (e.path === a) throw new cS("note", a);
	typeof o == "string" && (o = Buffer.from(o, "utf8"));
	let p = await CC({
		fs: e,
		gitdir: r,
		type: "blob",
		object: o,
		format: "content"
	});
	return f.push({
		mode: "100644",
		path: a,
		oid: p,
		type: "blob"
	}), await PC({
		fs: e,
		cache: t,
		onSign: n,
		gitdir: r,
		ref: i,
		tree: await zC({
			fs: e,
			gitdir: r,
			tree: f
		}),
		parent: d && [d],
		message: "Note added by 'isomorphic-git addNote'\n",
		author: c,
		committer: l,
		signingKey: u
	});
}
async function VC({ fs: e, onSign: t, dir: n, gitdir: r = Z(n, ".git"), ref: i = "refs/notes/commits", oid: a, note: o, force: s, author: c, committer: l, signingKey: u, cache: d = {} }) {
	try {
		$("fs", e), $("gitdir", r), $("oid", a), $("note", o), u && $("onSign", t);
		let n = new fC(e), f = await kC({
			fs: n,
			gitdir: r,
			author: c
		});
		if (!f) throw new wS("author");
		let p = await AC({
			fs: n,
			gitdir: r,
			author: f,
			committer: l
		});
		if (!p) throw new wS("committer");
		return await BC({
			fs: n,
			cache: d,
			onSign: t,
			gitdir: await mC({
				fsp: n,
				dotgit: r
			}),
			ref: i,
			oid: a,
			note: o,
			force: s,
			author: f,
			committer: p,
			signingKey: u
		});
	} catch (e) {
		throw e.caller = "git.addNote", e;
	}
}
var HC = /(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;
function UC(e, t) {
	if (typeof e != "string") throw TypeError("Reference name must be a string");
	return !HC.test(e) && (!!t || e.includes("/"));
}
async function WC({ fs: e, gitdir: t, remote: n, url: r, force: i }) {
	if (!UC(n, !0)) throw new bS(n, mb.default.clean(n));
	let a = await Tx.get({
		fs: e,
		gitdir: t
	});
	if (!i && (await a.getSubsections("remote")).includes(n) && r !== await a.get(`remote.${n}.url`)) throw new cS("remote", n);
	await a.set(`remote.${n}.url`, r), await a.set(`remote.${n}.fetch`, `+refs/heads/*:refs/remotes/${n}/*`), await Tx.save({
		fs: e,
		gitdir: t,
		config: a
	});
}
async function GC({ fs: e, dir: t, gitdir: n = Z(t, ".git"), remote: r, url: i, force: a = !1 }) {
	try {
		$("fs", e), $("gitdir", n), $("remote", r), $("url", i);
		let t = new fC(e);
		return await WC({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			remote: r,
			url: i,
			force: a
		});
	} catch (e) {
		throw e.caller = "git.addRemote", e;
	}
}
async function KC({ fs: e, cache: t, onSign: n, gitdir: r, ref: i, tagger: a, message: o = i, gpgsig: s, object: c, signingKey: l, force: u = !1 }) {
	if (i = i.startsWith("refs/tags/") ? i : `refs/tags/${i}`, !u && await Q.exists({
		fs: e,
		gitdir: r,
		ref: i
	})) throw new cS("tag", i);
	let d = await Q.resolve({
		fs: e,
		gitdir: r,
		ref: c || "HEAD"
	}), { type: f } = await sS({
		fs: e,
		cache: t,
		gitdir: r,
		oid: d
	}), p = GS.from({
		object: d,
		type: f,
		tag: i.replace("refs/tags/", ""),
		tagger: a,
		message: o,
		gpgsig: s
	});
	l && (p = await GS.sign(p, n, l));
	let m = await CC({
		fs: e,
		gitdir: r,
		type: "tag",
		object: p.toObject()
	});
	await Q.writeRef({
		fs: e,
		gitdir: r,
		ref: i,
		value: m
	});
}
async function qC({ fs: e, onSign: t, dir: n, gitdir: r = Z(n, ".git"), ref: i, tagger: a, message: o = i, gpgsig: s, object: c, signingKey: l, force: u = !1, cache: d = {} }) {
	try {
		$("fs", e), $("gitdir", r), $("ref", i), l && $("onSign", t);
		let n = new fC(e), f = await mC({
			fsp: n,
			dotgit: r
		}), p = await kC({
			fs: n,
			gitdir: f,
			author: a
		});
		if (!p) throw new wS("tagger");
		return await KC({
			fs: n,
			cache: d,
			onSign: t,
			gitdir: f,
			ref: i,
			tagger: p,
			message: o,
			gpgsig: s,
			object: c,
			signingKey: l,
			force: u
		});
	} catch (e) {
		throw e.caller = "git.annotatedTag", e;
	}
}
async function JC({ fs: e, gitdir: t, ref: n, object: r, checkout: i = !1, force: a = !1 }) {
	if (!UC(n, !0)) throw new bS(n, mb.default.clean(n));
	let o = `refs/heads/${n}`;
	if (!a && await Q.exists({
		fs: e,
		gitdir: t,
		ref: o
	})) throw new cS("branch", n, !1);
	let s;
	try {
		s = await Q.resolve({
			fs: e,
			gitdir: t,
			ref: r || "HEAD"
		});
	} catch {}
	s && await Q.writeRef({
		fs: e,
		gitdir: t,
		ref: o,
		value: s
	}), i && await Q.writeSymbolicRef({
		fs: e,
		gitdir: t,
		ref: "HEAD",
		value: o
	});
}
async function YC({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r, object: i, checkout: a = !1, force: o = !1 }) {
	try {
		$("fs", e), $("gitdir", n), $("ref", r);
		let t = new fC(e);
		return await JC({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			ref: r,
			object: i,
			checkout: a,
			force: o
		});
	} catch (e) {
		throw e.caller = "git.branch", e;
	}
}
async function XC(e, t, n) {
	let r = n.split("/");
	r.pop();
	let i = t;
	for (let t of r) {
		if (t === "" || t === ".") continue;
		i = `${i}/${t}`;
		let r = await e.lstat(i);
		if (r && r.isSymbolicLink()) throw new yb(n);
	}
}
var ZC = (e, t) => e === "." || t == null || t.length === 0 || t === "." ? !0 : t.length >= e.length ? t.startsWith(e) : e.startsWith(t);
async function QC({ fs: e, cache: t, onProgress: n, onPostCheckout: r, dir: i, gitdir: a, remote: o, ref: s, filepaths: c, noCheckout: l, noUpdateHead: u, dryRun: d, force: f, track: p = !0, nonBlocking: m = !1, batchSize: h = 100 }) {
	let g;
	if (r) try {
		g = await Q.resolve({
			fs: e,
			gitdir: a,
			ref: "HEAD"
		});
	} catch {
		g = "0000000000000000000000000000000000000000";
	}
	let _;
	try {
		_ = await Q.resolve({
			fs: e,
			gitdir: a,
			ref: s
		});
	} catch (t) {
		if (s === "HEAD") throw t;
		let n = `${o}/${s}`;
		if (_ = await Q.resolve({
			fs: e,
			gitdir: a,
			ref: n
		}), p) {
			let t = await Tx.get({
				fs: e,
				gitdir: a
			});
			await t.set(`branch.${s}.remote`, o), await t.set(`branch.${s}.merge`, `refs/heads/${s}`), await Tx.save({
				fs: e,
				gitdir: a,
				config: t
			});
		}
		await Q.writeRef({
			fs: e,
			gitdir: a,
			ref: `refs/heads/${s}`,
			value: _
		});
	}
	if (!l) {
		let o;
		try {
			o = await $C({
				fs: e,
				cache: t,
				onProgress: n,
				dir: i,
				gitdir: a,
				ref: s,
				force: f,
				filepaths: c
			});
		} catch (e) {
			throw e instanceof Xb && e.data.what === _ ? new pS(s, _) : e;
		}
		let l = o.filter(([e]) => e === "conflict").map(([e, t]) => t);
		if (l.length > 0) throw new uS(l);
		let u = o.filter(([e]) => e === "error").map(([e, t]) => t);
		if (u.length > 0) throw new vb(u.join(", "));
		if (d) {
			r && await r({
				previousHead: g,
				newHead: _,
				type: c != null && c.length > 0 ? "file" : "branch"
			});
			return;
		}
		let p = 0, v = o.length;
		if (await Hb.acquire({
			fs: e,
			gitdir: a,
			cache: t
		}, async function(t) {
			await Promise.all(o.filter(([e]) => e === "delete" || e === "delete-index").map(async function([r, a]) {
				let o = `${i}/${a}`;
				r === "delete" && await e.rm(o), t.delete({ filepath: a }), n && await n({
					phase: "Updating workdir",
					loaded: ++p,
					total: v
				});
			}));
		}), await Hb.acquire({
			fs: e,
			gitdir: a,
			cache: t
		}, async function(t) {
			for (let [r, a] of o) if (r === "rmdir" || r === "rmdir-index") {
				let o = `${i}/${a}`;
				try {
					r === "rmdir" && await e.rmdir(o), t.delete({ filepath: a }), n && await n({
						phase: "Updating workdir",
						loaded: ++p,
						total: v
					});
				} catch (e) {
					if (e.code === "ENOTEMPTY") console.log(`Did not delete ${a} because directory is not empty`);
					else throw e;
				}
			}
		}), await Promise.all(o.filter(([e]) => e === "mkdir" || e === "mkdir-index").map(async function([t, r]) {
			let a = `${i}/${r}`;
			await XC(e, i, r), await e.mkdir(a), n && await n({
				phase: "Updating workdir",
				loaded: ++p,
				total: v
			});
		})), m) {
			let r = await nw("Update Working Dir", o.filter(([e]) => e === "create" || e === "create-index" || e === "update" || e === "mkdir-index").map(([n, r, o, s, c]) => () => tw({
				fs: e,
				cache: t,
				gitdir: a,
				dir: i
			}, [
				n,
				r,
				o,
				s,
				c
			])), n, h);
			await Hb.acquire({
				fs: e,
				gitdir: a,
				cache: t,
				allowUnmerged: !0
			}, async function(e) {
				await nw("Update Index", r.map(([t, n, r]) => () => ew({
					index: e,
					fullpath: t,
					oid: n,
					stats: r
				})), n, h);
			});
		} else await Hb.acquire({
			fs: e,
			gitdir: a,
			cache: t,
			allowUnmerged: !0
		}, async function(r) {
			let s = await Promise.allSettled(o.filter(([e]) => e === "create" || e === "create-index" || e === "update" || e === "mkdir-index").map(async function([o, s, c, l, u]) {
				let d = `${i}/${s}`;
				if (o !== "create-index" && o !== "mkdir-index") {
					await XC(e, i, s);
					let { object: n } = await sS({
						fs: e,
						cache: t,
						gitdir: a,
						oid: c
					});
					if (u && await e.rm(d), l === 33188) await e.write(d, n);
					else if (l === 33261) await e.write(d, n, { mode: 511 });
					else if (l === 40960) await e.writelink(d, n);
					else throw new vb(`Invalid mode 0o${l.toString(8)} detected in blob ${c}`);
				}
				let f = await e.lstat(d);
				l === 33261 && (f.mode = 493), o === "mkdir-index" && (f.mode = 57344), r.insert({
					filepath: s,
					stats: f,
					oid: c
				}), n && await n({
					phase: "Updating workdir",
					loaded: ++p,
					total: v
				});
			})), c = [];
			for (let e of s) e.status === "rejected" && (c.push(e.reason), console.error("[isomorphic-git checkout] task rejected:", e.reason?.stack ?? e.reason));
			if (c.length > 0) throw new ES(c);
		});
		r && await r({
			previousHead: g,
			newHead: _,
			type: c != null && c.length > 0 ? "file" : "branch"
		});
	}
	if (!u) {
		let t = await Q.expand({
			fs: e,
			gitdir: a,
			ref: s
		});
		t.startsWith("refs/heads") ? await Q.writeSymbolicRef({
			fs: e,
			gitdir: a,
			ref: "HEAD",
			value: t
		}) : await Q.writeRef({
			fs: e,
			gitdir: a,
			ref: "HEAD",
			value: _
		});
	}
}
async function $C({ fs: e, cache: t, onProgress: n, dir: r, gitdir: i, ref: a, force: o, filepaths: s }) {
	let c = 0;
	return iC({
		fs: e,
		cache: t,
		dir: r,
		gitdir: i,
		trees: [
			ZS({ ref: a }),
			$S(),
			Yb()
		],
		map: async function(e, [t, r, i]) {
			if (e !== ".") {
				if (s && !s.some((t) => ZC(e, t))) return null;
				switch (n && await n({
					phase: "Analyzing workdir",
					loaded: ++c
				}), [
					!!i,
					!!t,
					!!r
				].map(Number).join("")) {
					case "000": return;
					case "001": return o && s && s.includes(e) ? ["delete", e] : void 0;
					case "010": switch (await t.type()) {
						case "tree": return ["mkdir", e];
						case "blob": return [
							"create",
							e,
							await t.oid(),
							await t.mode()
						];
						case "commit": return [
							"mkdir-index",
							e,
							await t.oid(),
							await t.mode()
						];
						default: return ["error", `new entry Unhandled type ${await t.type()}`];
					}
					case "011": switch (`${await t.type()}-${await r.type()}`) {
						case "tree-tree": return;
						case "tree-blob":
						case "blob-tree": return ["conflict", e];
						case "blob-blob": return await t.oid() === await r.oid() ? await t.mode() === await r.mode() ? [
							"create-index",
							e,
							await t.oid(),
							await t.mode()
						] : o ? [
							"update",
							e,
							await t.oid(),
							await t.mode(),
							!0
						] : ["conflict", e] : o ? [
							"update",
							e,
							await t.oid(),
							await t.mode(),
							await t.mode() !== await r.mode()
						] : ["conflict", e];
						case "commit-tree": return;
						case "commit-blob": return ["conflict", e];
						default: return ["error", `new entry Unhandled type ${t.type}`];
					}
					case "100": return ["delete-index", e];
					case "101": switch (await i.type()) {
						case "tree": return ["rmdir-index", e];
						case "blob": return await i.oid() === await r.oid() || o ? ["delete", e] : ["conflict", e];
						case "commit": return ["rmdir-index", e];
						default: return ["error", `delete entry Unhandled type ${await i.type()}`];
					}
					case "110":
					case "111": switch (`${await i.type()}-${await t.type()}`) {
						case "tree-tree": return;
						case "blob-blob":
							if (await i.oid() === await t.oid() && await i.mode() === await t.mode() && !o) return;
							if (r) {
								if (await r.oid() !== await i.oid() && await r.oid() !== await t.oid()) return o ? [
									"update",
									e,
									await t.oid(),
									await t.mode(),
									await t.mode() !== await r.mode()
								] : ["conflict", e];
							} else if (o) return [
								"update",
								e,
								await t.oid(),
								await t.mode(),
								await t.mode() !== await i.mode()
							];
							return await t.mode() === await i.mode() ? await t.oid() === await i.oid() ? void 0 : [
								"update",
								e,
								await t.oid(),
								await t.mode(),
								!1
							] : [
								"update",
								e,
								await t.oid(),
								await t.mode(),
								!0
							];
						case "tree-blob": return [
							"update-dir-to-blob",
							e,
							await t.oid()
						];
						case "blob-tree": return ["update-blob-to-tree", e];
						case "commit-commit": return [
							"mkdir-index",
							e,
							await t.oid(),
							await t.mode()
						];
						default: return ["error", `update entry Unhandled type ${await i.type()}-${await t.type()}`];
					}
				}
			}
		},
		reduce: async function(e, t) {
			return t = tC(t), e ? e && e[0] === "rmdir" ? (t.push(e), t) : (t.unshift(e), t) : t;
		}
	});
}
async function ew({ index: e, fullpath: t, stats: n, oid: r }) {
	try {
		e.insert({
			filepath: t,
			stats: n,
			oid: r
		});
	} catch (e) {
		console.warn(`Error inserting ${t} into index:`, e);
	}
}
async function tw({ fs: e, cache: t, gitdir: n, dir: r }, [i, a, o, s, c]) {
	let l = `${r}/${a}`;
	if (i !== "create-index" && i !== "mkdir-index") {
		await XC(e, r, a);
		let { object: i } = await sS({
			fs: e,
			cache: t,
			gitdir: n,
			oid: o
		});
		if (c && await e.rm(l), s === 33188) await e.write(l, i);
		else if (s === 33261) await e.write(l, i, { mode: 511 });
		else if (s === 40960) await e.writelink(l, i);
		else throw new vb(`Invalid mode 0o${s.toString(8)} detected in blob ${o}`);
	}
	let u = await e.lstat(l);
	return s === 33261 && (u.mode = 493), i === "mkdir-index" && (u.mode = 57344), [
		a,
		o,
		u
	];
}
async function nw(e, t, n, r) {
	let i = [], a = [];
	for (let o = 0; o < t.length; o += r) {
		let s = t.slice(o, o + r).map((e) => e());
		(await Promise.allSettled(s)).forEach((t) => {
			t.status === "fulfilled" ? i.push(t.value) : (a.push(t.reason), console.error(`[isomorphic-git ${e}] task rejected:`, t.reason?.stack ?? t.reason));
		}), n && await n({
			phase: "Updating workdir",
			loaded: o + s.length,
			total: t.length
		});
	}
	if (a.length > 0) throw new ES(a);
	return i;
}
async function rw({ fs: e, onProgress: t, onPostCheckout: n, dir: r, gitdir: i = Z(r, ".git"), remote: a = "origin", ref: o, filepaths: s, noCheckout: c = !1, noUpdateHead: l = o === void 0, dryRun: u = !1, force: d = !1, track: f = !0, cache: p = {}, nonBlocking: m = !1, batchSize: h = 100 }) {
	try {
		$("fs", e), $("dir", r), $("gitdir", i);
		let g = o || "HEAD", _ = new fC(e);
		return await QC({
			fs: _,
			cache: p,
			onProgress: t,
			onPostCheckout: n,
			dir: r,
			gitdir: await mC({
				fsp: _,
				dotgit: i
			}),
			remote: a,
			ref: g,
			filepaths: s,
			noCheckout: c,
			noUpdateHead: l,
			dryRun: u,
			force: d,
			track: f,
			nonBlocking: m,
			batchSize: h
		});
	} catch (e) {
		throw e.caller = "git.checkout", e;
	}
}
var iw = /^.*(\r?\n|$)/gm;
function aw({ branches: e, contents: t }) {
	let n = e[1], r = e[2], i = t[0], a = t[1], o = t[2], s = (0, hb.default)(a.match(iw), i.match(iw), o.match(iw)), c = "", l = !0;
	for (let e of s) e.ok && (c += e.ok.join("")), e.conflict && (l = !1, c += `${"<".repeat(7)} ${n}\n`, c += e.conflict.a.join(""), c += `${"=".repeat(7)}\n`, c += e.conflict.b.join(""), c += `${">".repeat(7)} ${r}\n`);
	return {
		cleanMerge: l,
		mergedText: c
	};
}
async function ow({ fs: e, cache: t, dir: n, gitdir: r = Z(n, ".git"), index: i, ourOid: a, baseOid: o, theirOid: s, ourName: c = "ours", baseName: l = "base", theirName: u = "theirs", dryRun: d = !1, abortOnConflict: f = !0, mergeDriver: p }) {
	let m = ZS({ ref: a }), h = ZS({ ref: o }), g = ZS({ ref: s }), _ = [], v = [], y = [], b = [], x = await iC({
		fs: e,
		cache: t,
		dir: n,
		gitdir: r,
		trees: [
			m,
			h,
			g
		],
		map: async function(t, [n, a, o]) {
			let s = Ub(t);
			switch (`${await hC(n, a)}-${await hC(o, a)}`) {
				case "false-false": return {
					mode: await a.mode(),
					path: s,
					oid: await a.oid(),
					type: await a.type()
				};
				case "false-true": return !o && await n.type() === "tree" ? {
					mode: await n.mode(),
					path: s,
					oid: await n.oid(),
					type: await n.type()
				} : o ? {
					mode: await o.mode(),
					path: s,
					oid: await o.oid(),
					type: await o.type()
				} : void 0;
				case "true-false": return !n && await o.type() === "tree" ? {
					mode: await o.mode(),
					path: s,
					oid: await o.oid(),
					type: await o.type()
				} : n ? {
					mode: await n.mode(),
					path: s,
					oid: await n.oid(),
					type: await n.type()
				} : void 0;
				case "true-true":
					if (n && o && await n.type() === "tree" && await o.type() === "tree") return {
						mode: await n.mode(),
						path: s,
						oid: await n.oid(),
						type: "tree"
					};
					if (n && o && await n.type() === "blob" && await o.type() === "blob") return sw({
						fs: e,
						gitdir: r,
						path: s,
						ours: n,
						base: a,
						theirs: o,
						ourName: c,
						baseName: l,
						theirName: u,
						mergeDriver: p
					}).then(async (e) => {
						if (e.cleanMerge) f || i.insert({
							filepath: t,
							oid: e.mergeResult.oid,
							stage: 0
						});
						else if (_.push(t), v.push(t), !f) {
							let e = "";
							a && await a.type() === "blob" && (e = await a.oid());
							let r = await n.oid(), s = await o.oid();
							i.delete({ filepath: t }), e && i.insert({
								filepath: t,
								oid: e,
								stage: 1
							}), i.insert({
								filepath: t,
								oid: r,
								stage: 2
							}), i.insert({
								filepath: t,
								oid: s,
								stage: 3
							});
						}
						return e.mergeResult;
					});
					if (a && !n && o && await a.type() === "blob" && await o.type() === "blob") {
						if (_.push(t), y.push(t), !f) {
							let e = await a.oid(), n = await o.oid();
							i.delete({ filepath: t }), i.insert({
								filepath: t,
								oid: e,
								stage: 1
							}), i.insert({
								filepath: t,
								oid: n,
								stage: 3
							});
						}
						return {
							mode: await o.mode(),
							oid: await o.oid(),
							type: "blob",
							path: s
						};
					}
					if (a && n && !o && await a.type() === "blob" && await n.type() === "blob") {
						if (_.push(t), b.push(t), !f) {
							let e = await a.oid(), r = await n.oid();
							i.delete({ filepath: t }), i.insert({
								filepath: t,
								oid: e,
								stage: 1
							}), i.insert({
								filepath: t,
								oid: r,
								stage: 2
							});
						}
						return {
							mode: await n.mode(),
							oid: await n.oid(),
							type: "blob",
							path: s
						};
					}
					if (a && !n && !o && (await a.type() === "blob" || await a.type() === "tree")) return;
					throw new SS();
			}
		},
		reduce: _.length !== 0 && (!n || f) ? void 0 : async (t, n) => {
			let i = n.filter(Boolean);
			if (t && !(t && t.type === "tree" && i.length === 0 && t.path !== ".")) return (i.length > 0 || t.path === "." && i.length === 0) && (t.oid = await CC({
				fs: e,
				gitdir: r,
				type: "tree",
				object: new Ix(i).toObject(),
				dryRun: d
			})), t;
		}
	});
	return _.length === 0 ? x.oid : (n && !f && await iC({
		fs: e,
		cache: t,
		dir: n,
		gitdir: r,
		trees: [ZS({ ref: x.oid })],
		map: async function(t, [r]) {
			let i = `${n}/${t}`;
			if (await r.type() === "blob") {
				let t = await r.mode(), n = await r.content();
				await e.write(i, n, { mode: t });
			}
			return !0;
		}
	}), new CS(_, v, y, b));
}
async function sw({ fs: e, gitdir: t, path: n, ours: r, base: i, theirs: a, ourName: o, theirName: s, baseName: c, dryRun: l, mergeDriver: u = aw }) {
	let d = "blob", f = "100755", p = "", m = "";
	i && await i.type() === "blob" && (f = await i.mode(), p = await i.oid(), m = Buffer.from(await i.content()).toString("utf8"));
	let h = f === await r.mode() ? await a.mode() : await r.mode();
	if (await r.oid() === await a.oid()) return {
		cleanMerge: !0,
		mergeResult: {
			mode: h,
			path: n,
			oid: await r.oid(),
			type: d
		}
	};
	if (await r.oid() === p) return {
		cleanMerge: !0,
		mergeResult: {
			mode: h,
			path: n,
			oid: await a.oid(),
			type: d
		}
	};
	if (await a.oid() === p) return {
		cleanMerge: !0,
		mergeResult: {
			mode: h,
			path: n,
			oid: await r.oid(),
			type: d
		}
	};
	let g = Buffer.from(await r.content()).toString("utf8"), _ = Buffer.from(await a.content()).toString("utf8"), { mergedText: v, cleanMerge: y } = await u({
		branches: [
			c,
			o,
			s
		],
		contents: [
			m,
			g,
			_
		],
		path: n
	});
	return {
		cleanMerge: y,
		mergeResult: {
			mode: h,
			path: n,
			oid: await CC({
				fs: e,
				gitdir: t,
				type: "blob",
				object: Buffer.from(v, "utf8"),
				dryRun: l
			}),
			type: d
		}
	};
}
var cw = {
	stage: Yb,
	workdir: $S
}, lw;
async function uw(e, t) {
	return lw === void 0 && (lw = new cb.default()), lw.acquire(e, t);
}
async function dw(e, t, n, r, i = null) {
	let a = Z(n, r), o = await e.lstat(a);
	if (!o) throw new Xb(a);
	if (o.isDirectory()) throw new vb(`${a}: file expected, but found directory`);
	let s = i ? await Rx({
		fs: e,
		gitdir: t,
		oid: i
	}) : void 0, c = s ? i : void 0;
	return s || await uw({
		fs: e,
		gitdir: t,
		currentFilepath: a
	}, async () => {
		let n = o.isSymbolicLink() ? await e.readlink(a).then(wC) : await e.read(a);
		if (n === null) throw new Xb(a);
		c = await CC({
			fs: e,
			gitdir: t,
			type: "blob",
			object: n
		});
	}), c;
}
async function fw({ fs: e, dir: t, gitdir: n, entries: r }) {
	async function i(r) {
		return r.type === "tree" ? r.oid || (r.oid = await zC({
			fs: e,
			gitdir: n,
			tree: await Promise.all(r.children.map(i))
		}), r.mode = 16384) : r.type === "blob" && (r.oid = await dw(e, n, t, r.path, r.oid), r.mode = 33188), r.path = r.path.split("/").pop(), r;
	}
	return Promise.all(r.map(i));
}
async function pw({ fs: e, dir: t, gitdir: n, treePair: r }) {
	let i = r[1] === "stage", a = r.map((e) => typeof e == "string" ? cw[e]() : e), o = [], s = await iC({
		fs: e,
		cache: {},
		dir: t,
		gitdir: n,
		trees: a,
		map: async (r, [i, a]) => {
			if (!(r === "." || await _C.isIgnored({
				fs: e,
				dir: t,
				gitdir: n,
				filepath: r
			})) && a) return (!i || await i.oid() !== await a.oid() && await a.oid() !== void 0) && o.push([i, a]), {
				mode: await a.mode(),
				path: r,
				oid: await a.oid(),
				type: await a.type()
			};
		},
		reduce: async (e, t) => (t = t.filter(Boolean), e ? (e.children = t, e) : t.length > 0 ? t : void 0),
		iterate: async (n, r) => {
			let a = [];
			for (let n of r) {
				let [r, s] = n;
				i ? s && (await e.exists(`${t}/${s.toString()}`) ? a.push(n) : o.push([null, s])) : r && (s ? a.push(n) : o.push([r, null]));
			}
			return a.length ? Promise.all(a.map(n)) : [];
		}
	});
	return o.length === 0 || s.length === 0 ? null : zC({
		fs: e,
		gitdir: n,
		tree: (await fw({
			fs: e,
			dir: t,
			gitdir: n,
			entries: s
		})).filter(Boolean).map((e) => ({
			mode: e.mode,
			path: e.path,
			oid: e.oid,
			type: e.type
		}))
	});
}
async function mw({ fs: e, dir: t, gitdir: n, stashCommit: r, parentCommit: i, wasStaged: a }) {
	let o = [], s = [], c = await iC({
		fs: e,
		cache: {},
		dir: t,
		gitdir: n,
		trees: [ZS({ ref: i }), ZS({ ref: r })],
		map: async (r, [i, c]) => {
			if (r === "." || await _C.isIgnored({
				fs: e,
				dir: t,
				gitdir: n,
				filepath: r
			})) return;
			let l = c ? await c.type() : await i.type();
			if (l !== "tree" && l !== "blob") return;
			if (!c && i) {
				let e = l === "tree" ? "rmdir" : "rm";
				return l === "tree" && o.push(r), l === "blob" && a && s.push({
					filepath: r,
					oid: await i.oid()
				}), {
					method: e,
					filepath: r
				};
			}
			let u = await c.oid();
			if (!i || await i.oid() !== u) return l === "tree" ? {
				method: "mkdir",
				filepath: r
			} : (a && s.push({
				filepath: r,
				oid: u,
				stats: await e.lstat(Z(t, r))
			}), {
				method: "write",
				filepath: r,
				oid: u
			});
		}
	});
	await uw({
		fs: e,
		gitdir: n,
		dirRemoved: o,
		ops: c
	}, async () => {
		for (let r of c) {
			let i = Z(t, r.filepath);
			switch (r.method) {
				case "rmdir":
					await e.rmdir(i);
					break;
				case "mkdir":
					await XC(e, t, r.filepath), await e.mkdir(i);
					break;
				case "rm":
					await e.rm(i);
					break;
				case "write":
					if (!o.some((e) => i.startsWith(e))) {
						await XC(e, t, r.filepath);
						let { object: a } = await sS({
							fs: e,
							cache: {},
							gitdir: n,
							oid: r.oid
						});
						await e.exists(i) && await e.rm(i), await e.write(i, a);
					}
					break;
			}
		}
	}), await Hb.acquire({
		fs: e,
		gitdir: n,
		cache: {}
	}, async (e) => {
		s.forEach(({ filepath: t, stats: n, oid: r }) => {
			e.insert({
				filepath: t,
				stats: n,
				oid: r
			});
		});
	});
}
async function hw({ fs: e, cache: t, dir: n, gitdir: r, oid: i, dryRun: a = !1, noUpdateBranch: o = !1, abortOnConflict: s = !0, committer: c, mergeDriver: l }) {
	let { commit: u, oid: d } = await MC({
		fs: e,
		cache: t,
		gitdir: r,
		oid: i
	});
	if (u.parent.length > 1) throw new dS(d, u.parent.length);
	if (u.parent.length === 0) throw new fS(d);
	let f = await Q.resolve({
		fs: e,
		gitdir: r,
		ref: "HEAD"
	}), { commit: p } = await MC({
		fs: e,
		cache: t,
		gitdir: r,
		oid: f
	}), m = u.parent[0], { commit: h } = await MC({
		fs: e,
		cache: t,
		gitdir: r,
		oid: m
	}), g = await Hb.acquire({
		fs: e,
		gitdir: r,
		cache: t,
		allowUnmerged: !1
	}, async (i) => ow({
		fs: e,
		cache: t,
		dir: n,
		gitdir: r,
		index: i,
		ourOid: p.tree,
		baseOid: h.tree,
		theirOid: u.tree,
		ourName: "HEAD",
		baseName: `parent of ${d.slice(0, 7)}`,
		theirName: d.slice(0, 7),
		dryRun: a,
		abortOnConflict: s,
		mergeDriver: l
	}));
	if (g instanceof CS) throw g;
	let _ = await PC({
		fs: e,
		cache: t,
		gitdir: r,
		message: u.message,
		tree: g,
		parent: [f],
		author: u.author,
		committer: c,
		dryRun: a,
		noUpdateBranch: o
	});
	return n && !a && !o && await mw({
		fs: e,
		dir: n,
		gitdir: r,
		stashCommit: _,
		parentCommit: f,
		wasStaged: !0
	}), _;
}
async function gw({ fs: e, dir: t, gitdir: n = Z(t, ".git"), oid: r, cache: i = {}, committer: a, dryRun: o = !1, noUpdateBranch: s = !1, abortOnConflict: c = !0, mergeDriver: l }) {
	try {
		$("fs", e), $("gitdir", n), $("oid", r);
		let u = new fC(e), d = await mC({
			fsp: u,
			dotgit: n
		}), { commit: f } = await MC({
			fs: u,
			cache: i,
			gitdir: d,
			oid: r
		});
		if (f.parent && f.parent.length > 1) return await hw({
			fs: u,
			cache: i,
			dir: t,
			gitdir: d,
			oid: r,
			dryRun: o,
			noUpdateBranch: s,
			abortOnConflict: c,
			committer: void 0,
			mergeDriver: l
		});
		let p = await AC({
			fs: u,
			gitdir: d,
			committer: a
		});
		if (!p) throw new wS("committer");
		return await hw({
			fs: u,
			cache: i,
			dir: t,
			gitdir: d,
			oid: r,
			dryRun: o,
			noUpdateBranch: s,
			abortOnConflict: c,
			committer: p,
			mergeDriver: l
		});
	} catch (e) {
		throw e.caller = "git.cherryPick", e;
	}
}
var _w = /^refs\/(heads\/|tags\/|remotes\/)?(.*)/;
function vw(e) {
	let t = _w.exec(e);
	return t ? t[1] === "remotes/" && e.endsWith("/HEAD") ? t[2].slice(0, -5) : t[2] : e;
}
async function yw({ fs: e, gitdir: t, fullname: n = !1, test: r = !1 }) {
	let i = await Q.resolve({
		fs: e,
		gitdir: t,
		ref: "HEAD",
		depth: 2
	});
	if (r) try {
		await Q.resolve({
			fs: e,
			gitdir: t,
			ref: i
		});
	} catch {
		return;
	}
	if (i.startsWith("refs/")) return n ? i : vw(i);
}
function bw(e) {
	return e = e.replace(/^git@([^:]+):/, "https://$1/"), e = e.replace(/^ssh:\/\//, "https://"), e;
}
function xw({ username: e = "", password: t = "" }) {
	return `Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`;
}
async function Sw(e, t) {
	let n = Wx(e);
	for (;;) {
		let { value: e, done: r } = await n.next();
		if (e && await t(e), r) break;
	}
	n.return && n.return();
}
async function Cw(e) {
	let t = 0, n = [];
	await Sw(e, (e) => {
		n.push(e), t += e.byteLength;
	});
	let r = new Uint8Array(t), i = 0;
	for (let e of n) r.set(e, i), i += e.byteLength;
	return r;
}
function ww(e) {
	let t = e.match(/^https?:\/\/([^/]+)@/);
	if (t == null) return {
		url: e,
		auth: {}
	};
	t = t[1];
	let [n, r] = t.split(":");
	return e = e.replace(`${t}@`, ""), {
		url: e,
		auth: {
			username: n,
			password: r
		}
	};
}
function Tw(e, t) {
	let n = t.toString(16);
	return "0".repeat(e - n.length) + n;
}
var Ew = class {
	static flush() {
		return Buffer.from("0000", "utf8");
	}
	static delim() {
		return Buffer.from("0001", "utf8");
	}
	static encode(e) {
		typeof e == "string" && (e = Buffer.from(e));
		let t = Tw(4, e.length + 4);
		return Buffer.concat([Buffer.from(t, "utf8"), e]);
	}
	static streamReader(e) {
		let t = new Gx(e);
		return async function() {
			try {
				let e = await t.read(4);
				return e == null ? !0 : (e = parseInt(e.toString("utf8"), 16), e === 0 || e === 1 ? null : await t.read(e - 4) ?? !0);
			} catch (t) {
				return e.error = t, !0;
			}
		};
	}
};
async function Dw(e) {
	let t = {}, n;
	for (; n = await e(), n !== !0;) {
		if (n === null) continue;
		n = n.toString("utf8").replace(/\n$/, "");
		let e = n.indexOf("=");
		if (e > -1) {
			let r = n.slice(0, e);
			t[r] = n.slice(e + 1);
		} else t[n] = !0;
	}
	return {
		protocolVersion: 2,
		capabilities2: t
	};
}
async function Ow(e, { service: t }) {
	let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = Ew.streamReader(e), o = await a();
	for (; o === null;) o = await a();
	if (o === !0) throw new hS();
	if (o.includes("version 2")) return Dw(a);
	if (o.toString("utf8").replace(/\n$/, "") !== `# service=${t}`) throw new DS(`# service=${t}\\n`, o.toString("utf8"));
	let s = await a();
	for (; s === null;) s = await a();
	if (s === !0) return {
		capabilities: n,
		refs: r,
		symrefs: i
	};
	if (s = s.toString("utf8"), s.includes("version 2")) return Dw(a);
	let [c, l] = kw(s, "\0", "\\x00");
	if (l.split(" ").map((e) => n.add(e)), c !== "0000000000000000000000000000000000000000 capabilities^{}") {
		let [e, t] = kw(c, " ", " ");
		for (r.set(t, e);;) {
			let e = await a();
			if (e === !0) break;
			if (e !== null) {
				let [t, n] = kw(e.toString("utf8"), " ", " ");
				r.set(n, t);
			}
		}
	}
	for (let e of n) if (e.startsWith("symref=")) {
		let t = e.match(/symref=([^:]+):(.*)/);
		t.length === 3 && i.set(t[1], t[2]);
	}
	return {
		protocolVersion: 1,
		capabilities: n,
		refs: r,
		symrefs: i
	};
}
function kw(e, t, n) {
	let r = e.trim().split(t);
	if (r.length !== 2) throw new DS(`Two strings separated by '${n}'`, e.toString("utf8"));
	return r;
}
var Aw = (e, t) => e.endsWith("?") ? `${e}${t}` : `${e}/${t.replace(/^https?:\/\//, "")}`, jw = (e, t) => {
	(t.username || t.password) && (e.Authorization = xw(t)), t.headers && Object.assign(e, t.headers);
}, Mw = async (e) => {
	try {
		let t = Buffer.from(await Cw(e.body)), n = t.toString("utf8");
		return {
			preview: n.length < 256 ? n : n.slice(0, 256) + "...",
			response: n,
			data: t
		};
	} catch {
		return {};
	}
}, Nw = class {
	static async capabilities() {
		return ["discover", "connect"];
	}
	static async discover({ http: e, onProgress: t, onAuth: n, onAuthSuccess: r, onAuthFailure: i, corsProxy: a, service: o, url: s, headers: c, protocolVersion: l }) {
		let { url: u, auth: d } = ww(s), f = a ? Aw(a, u) : u;
		(d.username || d.password) && (c.Authorization = xw(d)), l === 2 && (c["Git-Protocol"] = "version=2");
		let p, m, h = !1;
		do
			if (p = await e.request({
				onProgress: t,
				method: "GET",
				url: `${f}/info/refs?service=${o}`,
				headers: c
			}), m = !1, p.statusCode === 401 || p.statusCode === 203) {
				let e = h ? i : n;
				if (e) {
					if (d = await e(u, {
						...d,
						headers: { ...c }
					}), d && d.cancel) throw new NS();
					d && (jw(c, d), h = !0, m = !0);
				}
			} else p.statusCode === 200 && h && r && await r(u, d);
		while (m);
		if (p.statusCode !== 200) {
			let { response: e } = await Mw(p);
			throw new vS(p.statusCode, p.statusMessage, e);
		}
		if (p.headers["content-type"] === `application/x-${o}-advertisement`) {
			let e = await Ow(p.body, { service: o });
			return e.auth = d, e;
		} else {
			let { preview: e, response: t, data: n } = await Mw(p);
			try {
				let e = await Ow([n], { service: o });
				return e.auth = d, e;
			} catch {
				throw new AS(e, t);
			}
		}
	}
	static async connect({ http: e, onProgress: t, corsProxy: n, service: r, url: i, auth: a, body: o, headers: s }) {
		let c = ww(i);
		c && (i = c.url), n && (i = Aw(n, i)), s["content-type"] = `application/x-${r}-request`, s.accept = `application/x-${r}-result`, jw(s, a);
		let l = await e.request({
			onProgress: t,
			method: "POST",
			url: `${i}/${r}`,
			body: o,
			headers: s
		});
		if (l.statusCode !== 200) {
			let { response: e } = Mw(l);
			throw new vS(l.statusCode, l.statusMessage, e);
		}
		return l;
	}
}, Pw = class {
	static getRemoteHelperFor({ url: e }) {
		let t = /* @__PURE__ */ new Map();
		t.set("http", Nw), t.set("https", Nw);
		let n = Fw({ url: e });
		if (!n) throw new MS(e);
		if (t.has(n.transport)) return t.get(n.transport);
		throw new jS(e, n.transport, n.transport === "ssh" ? bw(e) : void 0);
	}
};
function Fw({ url: e }) {
	if (e.startsWith("git@")) return {
		transport: "ssh",
		address: e
	};
	let t = e.match(/(\w+)(:\/\/|::)(.*)/);
	if (t !== null) {
		if (t[2] === "://") return {
			transport: t[1],
			address: t[0]
		};
		if (t[2] === "::") return {
			transport: t[1],
			address: t[3]
		};
	}
}
var Iw = null, Lw = class {
	static async read({ fs: e, gitdir: t }) {
		Iw === null && (Iw = new cb.default());
		let n = Z(t, "shallow"), r = /* @__PURE__ */ new Set();
		return await Iw.acquire(n, async function() {
			let t = await e.read(n, { encoding: "utf8" });
			if (t === null || t.trim() === "") return r;
			t.trim().split("\n").map((e) => r.add(e));
		}), r;
	}
	static async write({ fs: e, gitdir: t, oids: n }) {
		Iw === null && (Iw = new cb.default());
		let r = Z(t, "shallow");
		if (n.size > 0) {
			let t = [...n].join("\n") + "\n";
			await Iw.acquire(r, async function() {
				await e.write(r, t, { encoding: "utf8" });
			});
		} else await Iw.acquire(r, async function() {
			await e.rm(r);
		});
	}
};
async function Rw({ fs: e, gitdir: t, oid: n }) {
	let r = `objects/${n.slice(0, 2)}/${n.slice(2)}`;
	return e.exists(`${t}/${r}`);
}
async function zw({ fs: e, cache: t, gitdir: n, oid: r, getExternalRefDelta: i }) {
	let a = await e.readdir(Z(n, "objects/pack"));
	a = a.filter((e) => e.endsWith(".idx"));
	for (let o of a) {
		let a = await iS({
			fs: e,
			cache: t,
			filename: `${n}/objects/pack/${o}`,
			getExternalRefDelta: i
		});
		if (a.error) throw new vb(a.error);
		if (a.offsets.has(r)) return !0;
	}
	return !1;
}
async function Bw({ fs: e, cache: t, gitdir: n, oid: r, format: i = "content" }) {
	let a = (r) => sS({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	}), o = await Rw({
		fs: e,
		gitdir: n,
		oid: r
	});
	return o ||= await zw({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r,
		getExternalRefDelta: a
	}), o;
}
function Vw({ config: e, onAuth: t }) {
	return t && (async (n, r) => {
		let i = r.username || await e.get(`credential.${n}.username`);
		return t(n, i ? {
			...r,
			username: i
		} : r);
	});
}
function Hw(e) {
	return e.slice(0, 12).toString("hex") === "5041434b0000000200000000";
}
function Uw(e, t) {
	let n = e.map((e) => e.split("=", 1)[0]);
	return t.filter((e) => {
		let t = e.split("=", 1)[0];
		return n.includes(t);
	});
}
var Ww = {
	name: "isomorphic-git",
	version: "1.40.0",
	agent: "git/isomorphic-git@1.40.0"
}, Gw = class {
	constructor() {
		this._queue = [];
	}
	write(e) {
		if (this._ended) throw Error("You cannot write to a FIFO that has already been ended!");
		if (this._waiting) {
			let t = this._waiting;
			this._waiting = null, t({ value: e });
		} else this._queue.push(e);
	}
	end() {
		if (this._ended = !0, this._waiting) {
			let e = this._waiting;
			this._waiting = null, e({ done: !0 });
		}
	}
	destroy(e) {
		this.error = e, this.end();
	}
	async next() {
		if (this._queue.length > 0) return { value: this._queue.shift() };
		if (this._ended) return { done: !0 };
		if (this._waiting) throw Error("You cannot call read until the previous call to read has returned!");
		return new Promise((e) => {
			this._waiting = e;
		});
	}
};
function Kw(e) {
	let t = e.indexOf("\r"), n = e.indexOf("\n");
	return t === -1 && n === -1 ? -1 : t === -1 ? n + 1 : n === -1 ? t + 1 : n === t + 1 ? n + 1 : Math.min(t, n) + 1;
}
function qw(e) {
	let t = new Gw(), n = "";
	return (async () => {
		await Sw(e, (e) => {
			for (e = e.toString("utf8"), n += e;;) {
				let e = Kw(n);
				if (e === -1) break;
				t.write(n.slice(0, e)), n = n.slice(e);
			}
		}), n.length > 0 && t.write(n), t.end();
	})(), t;
}
var Jw = class {
	static demux(e) {
		let t = Ew.streamReader(e), n = new Gw(), r = new Gw(), i = new Gw(), a = async function() {
			let o = await t();
			if (o === null) return a();
			if (o === !0) {
				n.end(), i.end(), e.error ? r.destroy(e.error) : r.end();
				return;
			}
			switch (o[0]) {
				case 1:
					r.write(o.slice(1));
					break;
				case 2:
					i.write(o.slice(1));
					break;
				case 3: {
					let e = o.slice(1);
					i.write(e), n.end(), i.end(), r.destroy(Error(e.toString("utf8")));
					return;
				}
				default: n.write(o);
			}
			a();
		};
		return a(), {
			packetlines: n,
			packfile: r,
			progress: i
		};
	}
};
async function Yw(e) {
	let { packetlines: t, packfile: n, progress: r } = Jw.demux(e), i = [], a = [], o = [], s = !1, c = !1;
	return new Promise((l, u) => {
		Sw(t, (t) => {
			let d = t.toString("utf8").trim();
			if (d.startsWith("shallow")) {
				let e = d.slice(-41).trim();
				e.length !== 40 && u(new Qb(e)), i.push(e);
			} else if (d.startsWith("unshallow")) {
				let e = d.slice(-41).trim();
				e.length !== 40 && u(new Qb(e)), a.push(e);
			} else if (d.startsWith("ACK")) {
				let [, e, t] = d.split(" ");
				o.push({
					oid: e,
					status: t
				}), t || (c = !0);
			} else d.startsWith("NAK") ? (s = !0, c = !0) : (c = !0, s = !0);
			c && (e.error ? u(e.error) : l({
				shallows: i,
				unshallows: a,
				acks: o,
				nak: s,
				packfile: n,
				progress: r
			}));
		}).finally(() => {
			c || (e.error ? u(e.error) : l({
				shallows: i,
				unshallows: a,
				acks: o,
				nak: s,
				packfile: n,
				progress: r
			}));
		});
	});
}
function Xw({ capabilities: e = [], wants: t = [], haves: n = [], shallows: r = [], depth: i = null, since: a = null, exclude: o = [] }) {
	let s = [];
	t = [...new Set(t)];
	let c = ` ${e.join(" ")}`;
	for (let e of t) s.push(Ew.encode(`want ${e}${c}\n`)), c = "";
	for (let e of r) s.push(Ew.encode(`shallow ${e}\n`));
	i !== null && s.push(Ew.encode(`deepen ${i}\n`)), a !== null && s.push(Ew.encode(`deepen-since ${Math.floor(a.valueOf() / 1e3)}\n`));
	for (let e of o) s.push(Ew.encode(`deepen-not ${e}\n`));
	s.push(Ew.flush());
	for (let e of n) s.push(Ew.encode(`have ${e}\n`));
	return s.push(Ew.encode("done\n")), s;
}
async function Zw({ fs: e, cache: t, http: n, onProgress: r, onMessage: i, onAuth: a, onAuthSuccess: o, onAuthFailure: s, gitdir: c, ref: l, remoteRef: u, remote: d, url: f, corsProxy: p, depth: m = null, since: h = null, exclude: g = [], relative: _ = !1, tags: v = !1, singleBranch: y = !1, headers: b = {}, prune: x = !1, pruneTags: S = !1 }) {
	let C = l || await yw({
		fs: e,
		gitdir: c,
		test: !0
	}), w = await Tx.get({
		fs: e,
		gitdir: c
	}), T = d || C && await w.get(`branch.${C}.remote`) || "origin", E = f || await w.get(`remote.${T}.url`);
	if (E === void 0) throw new TS("remote OR url");
	let ee = u || C && await w.get(`branch.${C}.merge`) || l || "HEAD";
	p === void 0 && (p = await w.get("http.corsProxy"));
	let te = Pw.getRemoteHelperFor({ url: E }), ne = await te.discover({
		http: n,
		onAuth: Vw({
			config: w,
			onAuth: a
		}),
		onAuthSuccess: o,
		onAuthFailure: Vw({
			config: w,
			onAuth: s
		}),
		corsProxy: p,
		service: "git-upload-pack",
		url: E,
		headers: b,
		protocolVersion: 1
	}), D = ne.auth, O = ne.refs;
	if (O.size === 0) return {
		defaultBranch: null,
		fetchHead: null,
		fetchHeadDescription: null
	};
	if (m !== null && !ne.capabilities.has("shallow")) throw new kS("shallow", "depth");
	if (h !== null && !ne.capabilities.has("deepen-since")) throw new kS("deepen-since", "since");
	if (g.length > 0 && !ne.capabilities.has("deepen-not")) throw new kS("deepen-not", "exclude");
	if (_ === !0 && !ne.capabilities.has("deepen-relative")) throw new kS("deepen-relative", "relative");
	let { oid: k, fullref: A } = Q.resolveAgainstMap({
		ref: ee,
		map: O
	});
	for (let e of O.keys()) e === A || e === "HEAD" || e.startsWith("refs/heads/") || v && e.startsWith("refs/tags/") || O.delete(e);
	let j = Uw([...ne.capabilities], [
		"multi_ack_detailed",
		"no-done",
		"side-band-64k",
		"ofs-delta",
		`agent=${Ww.agent}`
	]);
	_ && j.push("deepen-relative");
	let re = y ? [k] : O.values(), ie = y ? [C] : await Q.listRefs({
		fs: e,
		gitdir: c,
		filepath: "refs"
	}), ae = [];
	for (let n of ie) try {
		n = await Q.expand({
			fs: e,
			gitdir: c,
			ref: n
		});
		let r = await Q.resolve({
			fs: e,
			gitdir: c,
			ref: n
		});
		await Bw({
			fs: e,
			cache: t,
			gitdir: c,
			oid: r
		}) && ae.push(r);
	} catch {}
	ae = [...new Set(ae)];
	let oe = await Lw.read({
		fs: e,
		gitdir: c
	}), M = ne.capabilities.has("shallow") ? [...oe] : [], se = Xw({
		capabilities: j,
		wants: re,
		haves: ae,
		shallows: M,
		depth: m,
		since: h,
		exclude: g
	}), N = Buffer.from(await Cw(se)), ce = await te.connect({
		http: n,
		onProgress: r,
		corsProxy: p,
		service: "git-upload-pack",
		url: E,
		auth: D,
		body: [N],
		headers: b
	}), P = await Yw(ce.body);
	ce.headers && (P.headers = ce.headers);
	for (let n of P.shallows) if (!oe.has(n)) try {
		let { object: r } = await sS({
			fs: e,
			cache: t,
			gitdir: c,
			oid: n
		}), i = new JS(r), a = await Promise.all(i.headers().parent.map((n) => Bw({
			fs: e,
			cache: t,
			gitdir: c,
			oid: n
		})));
		a.length === 0 || a.every((e) => e) || oe.add(n);
	} catch {
		oe.add(n);
	}
	for (let e of P.unshallows) oe.delete(e);
	if (await Lw.write({
		fs: e,
		gitdir: c,
		oids: oe
	}), y) {
		let t = /* @__PURE__ */ new Map([[A, k]]), n = /* @__PURE__ */ new Map(), r = 10, i = A;
		for (; r--;) {
			let e = ne.symrefs.get(i);
			if (e === void 0) break;
			n.set(i, e), i = e;
		}
		let a = O.get(i);
		a && t.set(i, a);
		let { pruned: o } = await Q.updateRemoteRefs({
			fs: e,
			gitdir: c,
			remote: T,
			refs: t,
			symrefs: n,
			tags: v,
			prune: x
		});
		x && (P.pruned = o);
	} else {
		let { pruned: t } = await Q.updateRemoteRefs({
			fs: e,
			gitdir: c,
			remote: T,
			refs: O,
			symrefs: ne.symrefs,
			tags: v,
			prune: x,
			pruneTags: S
		});
		x && (P.pruned = t);
	}
	if (P.HEAD = ne.symrefs.get("HEAD"), P.HEAD === void 0) {
		let { oid: e } = Q.resolveAgainstMap({
			ref: "HEAD",
			map: O
		});
		for (let [t, n] of O.entries()) if (t !== "HEAD" && n === e) {
			P.HEAD = t;
			break;
		}
	}
	P.FETCH_HEAD = {
		oid: k,
		description: `${A.startsWith("refs/tags") ? "tag" : "branch"} '${vw(A)}' of ${E}`
	}, (r || i) && Sw(qw(P.progress), async (e) => {
		if (i && await i(e), r) {
			let t = e.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);
			t && await r({
				phase: t[1].trim(),
				loaded: parseInt(t[2], 10),
				total: parseInt(t[3], 10)
			});
		}
	});
	let F = Buffer.from(await Cw(P.packfile));
	if (ce.body.error) throw ce.body.error;
	let I = F.slice(-20).toString("hex"), le = {
		defaultBranch: P.HEAD,
		fetchHead: P.FETCH_HEAD.oid,
		fetchHeadDescription: P.FETCH_HEAD.description
	};
	if (P.headers && (le.headers = P.headers), x && (le.pruned = P.pruned), I !== "" && !Hw(F)) {
		le.packfile = `objects/pack/pack-${I}.pack`;
		let n = Z(c, le.packfile);
		await e.write(n, F);
		let i = await tS.fromPack({
			pack: F,
			getExternalRefDelta: (n) => sS({
				fs: e,
				cache: t,
				gitdir: c,
				oid: n
			}),
			onProgress: r
		});
		await e.write(n.replace(/\.pack$/, ".idx"), await i.toBuffer());
	}
	return le;
}
async function Qw({ fs: e, bare: t = !1, dir: n, gitdir: r = t ? n : Z(n, ".git"), defaultBranch: i = "master" }) {
	if (await e.exists(r + "/config")) return;
	let a = [
		"hooks",
		"info",
		"objects/info",
		"objects/pack",
		"refs/heads",
		"refs/tags"
	];
	a = a.map((e) => r + "/" + e);
	for (let t of a) await e.mkdir(t);
	await e.write(r + "/config", `[core]
	repositoryformatversion = 0
	filemode = false
\tbare = ${t}\n` + (t ? "" : "	logallrefupdates = true\n") + "	symlinks = false\n	ignorecase = true\n"), await e.write(r + "/HEAD", `ref: refs/heads/${i}\n`);
}
async function $w({ fs: e, cache: t, http: n, onProgress: r, onMessage: i, onAuth: a, onAuthSuccess: o, onAuthFailure: s, onPostCheckout: c, dir: l, gitdir: u, url: d, corsProxy: f, ref: p, remote: m, depth: h, since: g, exclude: _, relative: v, singleBranch: y, noCheckout: b, noTags: x, headers: S, nonBlocking: C, batchSize: w = 100 }) {
	try {
		if (await Qw({
			fs: e,
			gitdir: u
		}), await WC({
			fs: e,
			gitdir: u,
			remote: m,
			url: d,
			force: !1
		}), f) {
			let t = await Tx.get({
				fs: e,
				gitdir: u
			});
			await t.set("http.corsProxy", f), await Tx.save({
				fs: e,
				gitdir: u,
				config: t
			});
		}
		let { defaultBranch: T, fetchHead: E } = await Zw({
			fs: e,
			cache: t,
			http: n,
			onProgress: r,
			onMessage: i,
			onAuth: a,
			onAuthSuccess: o,
			onAuthFailure: s,
			gitdir: u,
			ref: p,
			remote: m,
			corsProxy: f,
			depth: h,
			since: g,
			exclude: _,
			relative: v,
			singleBranch: y,
			headers: S,
			tags: !x
		});
		if (E === null) return;
		p ||= T, p = p.replace("refs/heads/", ""), await QC({
			fs: e,
			cache: t,
			onProgress: r,
			onPostCheckout: c,
			dir: l,
			gitdir: u,
			ref: p,
			remote: m,
			noCheckout: b,
			nonBlocking: C,
			batchSize: w
		});
	} catch (t) {
		throw await e.rmdir(u, {
			recursive: !0,
			maxRetries: 10
		}).catch(() => void 0), t;
	}
}
async function eT({ fs: e, http: t, onProgress: n, onMessage: r, onAuth: i, onAuthSuccess: a, onAuthFailure: o, onPostCheckout: s, dir: c, gitdir: l = Z(c, ".git"), url: u, corsProxy: d = void 0, ref: f = void 0, remote: p = "origin", depth: m = void 0, since: h = void 0, exclude: g = [], relative: _ = !1, singleBranch: v = !1, noCheckout: y = !1, noTags: b = !1, headers: x = {}, cache: S = {}, nonBlocking: C = !1, batchSize: w = 100 }) {
	try {
		$("fs", e), $("http", t), $("gitdir", l), y || $("dir", c), $("url", u);
		let T = new fC(e);
		return await $w({
			fs: T,
			cache: S,
			http: t,
			onProgress: n,
			onMessage: r,
			onAuth: i,
			onAuthSuccess: a,
			onAuthFailure: o,
			onPostCheckout: s,
			dir: c,
			gitdir: await mC({
				fsp: T,
				dotgit: l
			}),
			url: u,
			corsProxy: d,
			ref: f,
			remote: p,
			depth: m,
			since: h,
			exclude: g,
			relative: _,
			singleBranch: v,
			noCheckout: y,
			noTags: b,
			headers: x,
			nonBlocking: C,
			batchSize: w
		});
	} catch (e) {
		throw e.caller = "git.clone", e;
	}
}
async function tT({ fs: e, onSign: t, dir: n, gitdir: r = Z(n, ".git"), message: i, author: a, committer: o, signingKey: s, amend: c = !1, dryRun: l = !1, noUpdateBranch: u = !1, disallowEmpty: d = !1, ref: f, parent: p, tree: m, cache: h = {} }) {
	try {
		$("fs", e), c || $("message", i), s && $("onSign", t);
		let n = new fC(e);
		return await PC({
			fs: n,
			cache: h,
			onSign: t,
			gitdir: await mC({
				fsp: n,
				dotgit: r
			}),
			message: i,
			author: a,
			committer: o,
			signingKey: s,
			amend: c,
			dryRun: l,
			noUpdateBranch: u,
			disallowEmpty: d,
			ref: f,
			parent: p,
			tree: m
		});
	} catch (e) {
		throw e.caller = "git.commit", e;
	}
}
async function nT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), fullname: r = !1, test: i = !1 }) {
	try {
		$("fs", e), $("gitdir", n);
		let t = new fC(e);
		return await yw({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			fullname: r,
			test: i
		});
	} catch (e) {
		throw e.caller = "git.currentBranch", e;
	}
}
async function rT({ fs: e, gitdir: t, ref: n }) {
	if (n = n.startsWith("refs/heads/") ? n : `refs/heads/${n}`, !await Q.exists({
		fs: e,
		gitdir: t,
		ref: n
	})) throw new Xb(n);
	let r = await Q.expand({
		fs: e,
		gitdir: t,
		ref: n
	});
	if (r === await yw({
		fs: e,
		gitdir: t,
		fullname: !0
	})) {
		let n = await Q.resolve({
			fs: e,
			gitdir: t,
			ref: r
		});
		await Q.writeRef({
			fs: e,
			gitdir: t,
			ref: "HEAD",
			value: n
		});
	}
	await Q.deleteRef({
		fs: e,
		gitdir: t,
		ref: r
	});
	let i = vw(n), a = await Tx.get({
		fs: e,
		gitdir: t
	});
	await a.deleteSection("branch", i), await Tx.save({
		fs: e,
		gitdir: t,
		config: a
	});
}
async function iT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r }) {
	try {
		$("fs", e), $("ref", r);
		let t = new fC(e);
		return await rT({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			ref: r
		});
	} catch (e) {
		throw e.caller = "git.deleteBranch", e;
	}
}
async function aT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r }) {
	try {
		$("fs", e), $("ref", r);
		let t = new fC(e), i = await mC({
			fsp: t,
			dotgit: n
		});
		await Q.deleteRef({
			fs: t,
			gitdir: i,
			ref: r
		});
	} catch (e) {
		throw e.caller = "git.deleteRef", e;
	}
}
async function oT({ fs: e, gitdir: t, remote: n }) {
	let r = await Tx.get({
		fs: e,
		gitdir: t
	});
	await r.deleteSection("remote", n), await Tx.save({
		fs: e,
		gitdir: t,
		config: r
	});
}
async function sT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), remote: r }) {
	try {
		$("fs", e), $("remote", r);
		let t = new fC(e);
		return await oT({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			remote: r
		});
	} catch (e) {
		throw e.caller = "git.deleteRemote", e;
	}
}
async function cT({ fs: e, gitdir: t, ref: n }) {
	n = n.startsWith("refs/tags/") ? n : `refs/tags/${n}`, await Q.deleteRef({
		fs: e,
		gitdir: t,
		ref: n
	});
}
async function lT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r }) {
	try {
		$("fs", e), $("ref", r);
		let t = new fC(e);
		return await cT({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			ref: r
		});
	} catch (e) {
		throw e.caller = "git.deleteTag", e;
	}
}
async function uT({ fs: e, gitdir: t, oid: n }) {
	let r = n.slice(0, 2);
	return (await e.readdir(`${t}/objects/${r}`)).map((e) => `${r}${e}`).filter((e) => e.startsWith(n));
}
async function dT({ fs: e, cache: t, gitdir: n, oid: r, getExternalRefDelta: i }) {
	let a = [], o = await e.readdir(Z(n, "objects/pack"));
	o = o.filter((e) => e.endsWith(".idx"));
	for (let s of o) {
		let o = await iS({
			fs: e,
			cache: t,
			filename: `${n}/objects/pack/${s}`,
			getExternalRefDelta: i
		});
		if (o.error) throw new vb(o.error);
		for (let e of o.offsets.keys()) e.startsWith(r) && a.push(e);
	}
	return a;
}
async function fT({ fs: e, cache: t, gitdir: n, oid: r }) {
	let i = (r) => sS({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	}), a = await uT({
		fs: e,
		gitdir: n,
		oid: r
	}), o = await dT({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r,
		getExternalRefDelta: i
	});
	for (let e of o) a.indexOf(e) === -1 && a.push(e);
	if (a.length === 1) return a[0];
	throw a.length > 1 ? new lS("oids", r, a) : new Xb(`an object matching "${r}"`);
}
async function pT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), oid: r, cache: i = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("oid", r);
		let t = new fC(e);
		return await fT({
			fs: t,
			cache: i,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			oid: r
		});
	} catch (e) {
		throw e.caller = "git.expandOid", e;
	}
}
async function mT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r }) {
	try {
		$("fs", e), $("gitdir", n), $("ref", r);
		let t = new fC(e), i = await mC({
			fsp: t,
			dotgit: n
		});
		return await Q.expand({
			fs: t,
			gitdir: i,
			ref: r
		});
	} catch (e) {
		throw e.caller = "git.expandRef", e;
	}
}
async function hT({ fs: e, cache: t, gitdir: n, oids: r }) {
	let i = {}, a = r.length, o = r.map((e, t) => ({
		index: t,
		oid: e
	}));
	for (; o.length;) {
		let r = /* @__PURE__ */ new Set();
		for (let { oid: e, index: t } of o) i[e] || (i[e] = /* @__PURE__ */ new Set()), i[e].add(t), i[e].size === a && r.add(e);
		if (r.size > 0) return [...r];
		let s = /* @__PURE__ */ new Map();
		for (let { oid: r, index: a } of o) try {
			let { object: o } = await sS({
				fs: e,
				cache: t,
				gitdir: n,
				oid: r
			}), { parent: c } = JS.from(o).parseHeaders();
			for (let e of c) (!i[e] || !i[e].has(a)) && s.set(e + ":" + a, {
				oid: e,
				index: a
			});
		} catch {}
		o = Array.from(s.values());
	}
	return [];
}
async function gT({ fs: e, cache: t, dir: n, gitdir: r, ours: i, theirs: a, fastForward: o = !0, fastForwardOnly: s = !1, dryRun: c = !1, noUpdateBranch: l = !1, abortOnConflict: u = !0, message: d, author: f, committer: p, signingKey: m, onSign: h, mergeDriver: g, allowUnrelatedHistories: _ = !1 }) {
	i === void 0 && (i = await yw({
		fs: e,
		gitdir: r,
		fullname: !0
	})), i = await Q.expand({
		fs: e,
		gitdir: r,
		ref: i
	}), a = await Q.expand({
		fs: e,
		gitdir: r,
		ref: a
	});
	let v = await Q.resolve({
		fs: e,
		gitdir: r,
		ref: i
	}), y = await Q.resolve({
		fs: e,
		gitdir: r,
		ref: a
	}), b = await hT({
		fs: e,
		cache: t,
		gitdir: r,
		oids: [v, y]
	});
	if (b.length !== 1) if (b.length === 0 && _) b.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");
	else throw new SS();
	let x = b[0];
	if (x === y) return {
		oid: v,
		alreadyMerged: !0
	};
	if (o && x === v) return !c && !l && await Q.writeRef({
		fs: e,
		gitdir: r,
		ref: i,
		value: y
	}), {
		oid: y,
		fastForward: !0
	};
	{
		if (s) throw new gS();
		let o = await Hb.acquire({
			fs: e,
			gitdir: r,
			cache: t,
			allowUnmerged: !1
		}, async (o) => ow({
			fs: e,
			cache: t,
			dir: n,
			gitdir: r,
			index: o,
			ourOid: v,
			theirOid: y,
			baseOid: x,
			ourName: vw(i),
			baseName: "base",
			theirName: vw(a),
			dryRun: c,
			abortOnConflict: u,
			mergeDriver: g
		}));
		if (o instanceof CS) throw o;
		return d ||= `Merge branch '${vw(a)}' into ${vw(i)}`, {
			oid: await PC({
				fs: e,
				cache: t,
				gitdir: r,
				message: d,
				ref: i,
				tree: o,
				parent: [v, y],
				author: f,
				committer: p,
				signingKey: m,
				onSign: h,
				dryRun: c,
				noUpdateBranch: l
			}),
			tree: o,
			mergeCommit: !0
		};
	}
}
async function _T({ fs: e, cache: t, http: n, onProgress: r, onMessage: i, onAuth: a, onAuthSuccess: o, onAuthFailure: s, dir: c, gitdir: l, ref: u, url: d, remote: f, remoteRef: p, prune: m, pruneTags: h, fastForward: g, fastForwardOnly: _, corsProxy: v, singleBranch: y, headers: b, author: x, committer: S, signingKey: C }) {
	try {
		if (!u) {
			let t = await yw({
				fs: e,
				gitdir: l
			});
			if (!t) throw new TS("ref");
			u = t;
		}
		let { fetchHead: w, fetchHeadDescription: T } = await Zw({
			fs: e,
			cache: t,
			http: n,
			onProgress: r,
			onMessage: i,
			onAuth: a,
			onAuthSuccess: o,
			onAuthFailure: s,
			gitdir: l,
			corsProxy: v,
			ref: u,
			url: d,
			remote: f,
			remoteRef: p,
			singleBranch: y,
			headers: b,
			prune: m,
			pruneTags: h
		});
		await gT({
			fs: e,
			cache: t,
			gitdir: l,
			ours: u,
			theirs: w,
			fastForward: g,
			fastForwardOnly: _,
			message: `Merge ${T}`,
			author: x,
			committer: S,
			signingKey: C,
			dryRun: !1,
			noUpdateBranch: !1
		}), await QC({
			fs: e,
			cache: t,
			onProgress: r,
			dir: c,
			gitdir: l,
			ref: u,
			remote: f,
			noCheckout: !1
		});
	} catch (e) {
		throw e.caller = "git.pull", e;
	}
}
async function vT({ fs: e, http: t, onProgress: n, onMessage: r, onAuth: i, onAuthSuccess: a, onAuthFailure: o, dir: s, gitdir: c = Z(s, ".git"), ref: l, url: u, remote: d, remoteRef: f, corsProxy: p, singleBranch: m, headers: h = {}, cache: g = {} }) {
	try {
		$("fs", e), $("http", t), $("gitdir", c);
		let _ = {
			name: "",
			email: "",
			timestamp: Date.now(),
			timezoneOffset: 0
		}, v = new fC(e);
		return await _T({
			fs: v,
			cache: g,
			http: t,
			onProgress: n,
			onMessage: r,
			onAuth: i,
			onAuthSuccess: a,
			onAuthFailure: o,
			dir: s,
			gitdir: await mC({
				fsp: v,
				dotgit: c
			}),
			ref: l,
			url: u,
			remote: d,
			remoteRef: f,
			fastForwardOnly: !0,
			corsProxy: p,
			singleBranch: m,
			headers: h,
			author: _,
			committer: _
		});
	} catch (e) {
		throw e.caller = "git.fastForward", e;
	}
}
async function yT({ fs: e, http: t, onProgress: n, onMessage: r, onAuth: i, onAuthSuccess: a, onAuthFailure: o, dir: s, gitdir: c = Z(s, ".git"), ref: l, remote: u, remoteRef: d, url: f, corsProxy: p, depth: m = null, since: h = null, exclude: g = [], relative: _ = !1, tags: v = !1, singleBranch: y = !1, headers: b = {}, prune: x = !1, pruneTags: S = !1, cache: C = {} }) {
	try {
		$("fs", e), $("http", t), $("gitdir", c);
		let s = new fC(e);
		return await Zw({
			fs: s,
			cache: C,
			http: t,
			onProgress: n,
			onMessage: r,
			onAuth: i,
			onAuthSuccess: a,
			onAuthFailure: o,
			gitdir: await mC({
				fsp: s,
				dotgit: c
			}),
			ref: l,
			remote: u,
			remoteRef: d,
			url: f,
			corsProxy: p,
			depth: m,
			since: h,
			exclude: g,
			relative: _,
			tags: v,
			singleBranch: y,
			headers: b,
			prune: x,
			pruneTags: S
		});
	} catch (e) {
		throw e.caller = "git.fetch", e;
	}
}
async function bT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), oids: r, cache: i = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("oids", r);
		let t = new fC(e);
		return await hT({
			fs: t,
			cache: i,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			oids: r
		});
	} catch (e) {
		throw e.caller = "git.findMergeBase", e;
	}
}
async function xT({ fs: e, filepath: t }) {
	if (await e.exists(Z(t, ".git"))) return t;
	{
		let n = Wb(t);
		if (n === t) throw new Xb(`git root for ${t}`);
		return xT({
			fs: e,
			filepath: n
		});
	}
}
async function ST({ fs: e, filepath: t }) {
	try {
		return $("fs", e), $("filepath", t), await xT({
			fs: new fC(e),
			filepath: t
		});
	} catch (e) {
		throw e.caller = "git.findRoot", e;
	}
}
async function CT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), path: r }) {
	try {
		$("fs", e), $("gitdir", n), $("path", r);
		let t = new fC(e);
		return await DC({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			path: r
		});
	} catch (e) {
		throw e.caller = "git.getConfig", e;
	}
}
async function wT({ fs: e, gitdir: t, path: n }) {
	return (await Tx.get({
		fs: e,
		gitdir: t
	})).getall(n);
}
async function TT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), path: r }) {
	try {
		$("fs", e), $("gitdir", n), $("path", r);
		let t = new fC(e);
		return await wT({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			path: r
		});
	} catch (e) {
		throw e.caller = "git.getConfigAll", e;
	}
}
async function ET({ http: e, onAuth: t, onAuthSuccess: n, onAuthFailure: r, corsProxy: i, url: a, headers: o = {}, forPush: s = !1 }) {
	try {
		$("http", e), $("url", a);
		let c = await Pw.getRemoteHelperFor({ url: a }).discover({
			http: e,
			onAuth: t,
			onAuthSuccess: n,
			onAuthFailure: r,
			corsProxy: i,
			service: s ? "git-receive-pack" : "git-upload-pack",
			url: a,
			headers: o,
			protocolVersion: 1
		}), l = { capabilities: [...c.capabilities] };
		for (let [e, t] of c.refs) {
			let n = e.split("/"), r = n.pop(), i = l;
			for (let e of n) i[e] = i[e] || {}, i = i[e];
			i[r] = t;
		}
		for (let [e, t] of c.symrefs) {
			let n = e.split("/"), r = n.pop(), i = l;
			for (let e of n) i[e] = i[e] || {}, i = i[e];
			i[r] = t;
		}
		return l;
	} catch (e) {
		throw e.caller = "git.getRemoteInfo", e;
	}
}
function DT(e, t, n, r) {
	let i = [];
	for (let [a, o] of e.refs) {
		if (t && !a.startsWith(t)) continue;
		if (a.endsWith("^{}")) {
			if (r) {
				let e = a.replace("^{}", ""), t = i[i.length - 1], n = t.ref === e ? t : i.find((t) => t.ref === e);
				if (n === void 0) throw Error("I did not expect this to happen");
				n.peeled = o;
			}
			continue;
		}
		let s = {
			ref: a,
			oid: o
		};
		n && e.symrefs.has(a) && (s.target = e.symrefs.get(a)), i.push(s);
	}
	return i;
}
async function OT({ http: e, onAuth: t, onAuthSuccess: n, onAuthFailure: r, corsProxy: i, url: a, headers: o = {}, forPush: s = !1, protocolVersion: c = 2 }) {
	try {
		$("http", e), $("url", a);
		let l = await Pw.getRemoteHelperFor({ url: a }).discover({
			http: e,
			onAuth: t,
			onAuthSuccess: n,
			onAuthFailure: r,
			corsProxy: i,
			service: s ? "git-receive-pack" : "git-upload-pack",
			url: a,
			headers: o,
			protocolVersion: c
		});
		if (l.protocolVersion === 2) return {
			protocolVersion: l.protocolVersion,
			capabilities: l.capabilities2
		};
		let u = {};
		for (let e of l.capabilities) {
			let [t, n] = e.split("=");
			n ? u[t] = n : u[t] = !0;
		}
		return {
			protocolVersion: 1,
			capabilities: u,
			refs: DT(l, void 0, !0, !0)
		};
	} catch (e) {
		throw e.caller = "git.getRemoteInfo2", e;
	}
}
async function kT({ type: e, object: t, format: n = "content", oid: r = void 0 }) {
	return n !== "deflated" && (n !== "wrapped" && (t = Lx.wrap({
		type: e,
		object: t
	})), r = await kb(t)), {
		oid: r,
		object: t
	};
}
async function AT({ object: e }) {
	try {
		$("object", e), typeof e == "string" ? e = Buffer.from(e, "utf8") : e instanceof Uint8Array || (e = new Uint8Array(e));
		let t = "blob", { oid: n, object: r } = await kT({
			type: t,
			format: "content",
			object: e
		});
		return {
			oid: n,
			type: t,
			object: r,
			format: "wrapped"
		};
	} catch (e) {
		throw e.caller = "git.hashBlob", e;
	}
}
async function jT({ fs: e, cache: t, onProgress: n, dir: r, gitdir: i, filepath: a }) {
	try {
		a = Z(r, a);
		let o = await e.read(a), s = await tS.fromPack({
			pack: o,
			getExternalRefDelta: (n) => sS({
				fs: e,
				cache: t,
				gitdir: i,
				oid: n
			}),
			onProgress: n
		});
		return await e.write(a.replace(/\.pack$/, ".idx"), await s.toBuffer()), { oids: [...s.hashes] };
	} catch (e) {
		throw e.caller = "git.indexPack", e;
	}
}
async function MT({ fs: e, onProgress: t, dir: n, gitdir: r = Z(n, ".git"), filepath: i, cache: a = {} }) {
	try {
		$("fs", e), $("dir", n), $("gitdir", n), $("filepath", i);
		let o = new fC(e);
		return await jT({
			fs: o,
			cache: a,
			onProgress: t,
			dir: n,
			gitdir: await mC({
				fsp: o,
				dotgit: r
			}),
			filepath: i
		});
	} catch (e) {
		throw e.caller = "git.indexPack", e;
	}
}
async function NT({ fs: e, bare: t = !1, dir: n, gitdir: r = t ? n : Z(n, ".git"), defaultBranch: i = "master" }) {
	try {
		$("fs", e), $("gitdir", r), t || $("dir", n);
		let a = new fC(e);
		return await Qw({
			fs: a,
			bare: t,
			dir: n,
			gitdir: await mC({
				fsp: a,
				dotgit: r
			}),
			defaultBranch: i
		});
	} catch (e) {
		throw e.caller = "git.init", e;
	}
}
async function PT({ fs: e, cache: t, gitdir: n, oid: r, ancestor: i, depth: a }) {
	let o = await Lw.read({
		fs: e,
		gitdir: n
	});
	if (!r) throw new TS("oid");
	if (!i) throw new TS("ancestor");
	if (r === i) return !1;
	let s = [r], c = /* @__PURE__ */ new Set(), l = 0;
	for (; s.length;) {
		if (l++ === a) throw new xS(a);
		let r = s.shift(), { type: u, object: d } = await sS({
			fs: e,
			cache: t,
			gitdir: n,
			oid: r
		});
		if (u !== "commit") throw new Zb(r, u, "commit");
		let f = JS.from(d).parse();
		for (let e of f.parent) if (e === i) return !0;
		if (!o.has(r)) for (let e of f.parent) c.has(e) || (s.push(e), c.add(e));
	}
	return !1;
}
async function FT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), oid: r, ancestor: i, depth: a = -1, cache: o = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("oid", r), $("ancestor", i);
		let t = new fC(e);
		return await PT({
			fs: t,
			cache: o,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			oid: r,
			ancestor: i,
			depth: a
		});
	} catch (e) {
		throw e.caller = "git.isDescendent", e;
	}
}
async function IT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), filepath: r }) {
	try {
		$("fs", e), $("dir", t), $("gitdir", n), $("filepath", r);
		let i = new fC(e), a = await mC({
			fsp: i,
			dotgit: n
		});
		return _C.isIgnored({
			fs: i,
			dir: t,
			gitdir: a,
			filepath: r
		});
	} catch (e) {
		throw e.caller = "git.isIgnored", e;
	}
}
async function LT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), remote: r }) {
	try {
		$("fs", e), $("gitdir", n);
		let t = new fC(e), i = await mC({
			fsp: t,
			dotgit: n
		});
		return Q.listBranches({
			fs: t,
			gitdir: i,
			remote: r
		});
	} catch (e) {
		throw e.caller = "git.listBranches", e;
	}
}
async function RT({ fs: e, gitdir: t, ref: n, cache: r }) {
	if (n) {
		let i = await Q.resolve({
			gitdir: t,
			fs: e,
			ref: n
		}), a = [];
		return await zT({
			fs: e,
			cache: r,
			gitdir: t,
			oid: i,
			filenames: a,
			prefix: ""
		}), a;
	} else return Hb.acquire({
		fs: e,
		gitdir: t,
		cache: r
	}, async function(e) {
		return e.entries.map((e) => e.path);
	});
}
async function zT({ fs: e, cache: t, gitdir: n, oid: r, filenames: i, prefix: a }) {
	let { tree: o } = await RC({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	});
	for (let r of o) r.type === "tree" ? await zT({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r.oid,
		filenames: i,
		prefix: Z(a, r.path)
	}) : i.push(Z(a, r.path));
}
async function BT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r, cache: i = {} }) {
	try {
		$("fs", e), $("gitdir", n);
		let t = new fC(e);
		return await RT({
			fs: t,
			cache: i,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			ref: r
		});
	} catch (e) {
		throw e.caller = "git.listFiles", e;
	}
}
async function VT({ fs: e, cache: t, gitdir: n, ref: r }) {
	let i;
	try {
		i = await Q.resolve({
			gitdir: n,
			fs: e,
			ref: r
		});
	} catch (e) {
		if (e instanceof Xb) return [];
	}
	return (await RC({
		fs: e,
		cache: t,
		gitdir: n,
		oid: i
	})).tree.map((e) => ({
		target: e.path,
		note: e.oid
	}));
}
async function HT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r = "refs/notes/commits", cache: i = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("ref", r);
		let t = new fC(e);
		return await VT({
			fs: t,
			cache: i,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			ref: r
		});
	} catch (e) {
		throw e.caller = "git.listNotes", e;
	}
}
async function UT({ fs: e, dir: t, gitdir: n = Z(t, ".git"), filepath: r }) {
	try {
		$("fs", e), $("gitdir", n);
		let t = new fC(e), i = await mC({
			fsp: t,
			dotgit: n
		});
		return Q.listRefs({
			fs: t,
			gitdir: i,
			filepath: r
		});
	} catch (e) {
		throw e.caller = "git.listRefs", e;
	}
}
async function WT({ fs: e, gitdir: t }) {
	let n = await Tx.get({
		fs: e,
		gitdir: t
	}), r = await n.getSubsections("remote");
	return Promise.all(r.map(async (e) => ({
		remote: e,
		url: await n.get(`remote.${e}.url`)
	})));
}
async function GT({ fs: e, dir: t, gitdir: n = Z(t, ".git") }) {
	try {
		$("fs", e), $("gitdir", n);
		let t = new fC(e);
		return await WT({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			})
		});
	} catch (e) {
		throw e.caller = "git.listRemotes", e;
	}
}
async function KT(e) {
	let t = Ew.streamReader(e), n = [], r;
	for (; r = await t(), r !== !0;) {
		if (r === null) continue;
		r = r.toString("utf8").replace(/\n$/, "");
		let [e, t, ...i] = r.split(" "), a = {
			ref: t,
			oid: e
		};
		for (let e of i) {
			let [t, n] = e.split(":");
			t === "symref-target" ? a.target = n : t === "peeled" && (a.peeled = n);
		}
		n.push(a);
	}
	return n;
}
async function qT({ prefix: e, symrefs: t, peelTags: n }) {
	let r = [];
	return r.push(Ew.encode("command=ls-refs\n")), r.push(Ew.encode(`agent=${Ww.agent}\n`)), (n || t || e) && r.push(Ew.delim()), n && r.push(Ew.encode("peel")), t && r.push(Ew.encode("symrefs")), e && r.push(Ew.encode(`ref-prefix ${e}`)), r.push(Ew.flush()), r;
}
async function JT({ http: e, onAuth: t, onAuthSuccess: n, onAuthFailure: r, corsProxy: i, url: a, headers: o = {}, forPush: s = !1, protocolVersion: c = 2, prefix: l, symrefs: u, peelTags: d }) {
	try {
		$("http", e), $("url", a);
		let f = await Nw.discover({
			http: e,
			onAuth: t,
			onAuthSuccess: n,
			onAuthFailure: r,
			corsProxy: i,
			service: s ? "git-receive-pack" : "git-upload-pack",
			url: a,
			headers: o,
			protocolVersion: c
		});
		if (f.protocolVersion === 1) return DT(f, l, u, d);
		let p = await qT({
			prefix: l,
			symrefs: u,
			peelTags: d
		});
		return KT((await Nw.connect({
			http: e,
			auth: f.auth,
			headers: o,
			corsProxy: i,
			service: s ? "git-receive-pack" : "git-upload-pack",
			url: a,
			body: p
		})).body);
	} catch (e) {
		throw e.caller = "git.listServerRefs", e;
	}
}
async function YT({ fs: e, dir: t, gitdir: n = Z(t, ".git") }) {
	try {
		$("fs", e), $("gitdir", n);
		let t = new fC(e), r = await mC({
			fsp: t,
			dotgit: n
		});
		return Q.listTags({
			fs: t,
			gitdir: r
		});
	} catch (e) {
		throw e.caller = "git.listTags", e;
	}
}
function XT(e, t) {
	return e.committer.timestamp - t.committer.timestamp;
}
var ZT = "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";
async function QT({ fs: e, cache: t, gitdir: n, oid: r, fileId: i }) {
	if (i === ZT) return;
	let a = r, o, s = await YS({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	}), c = s.tree;
	return i === s.oid ? o = s.path : (o = await $T({
		fs: e,
		cache: t,
		gitdir: n,
		tree: c,
		fileId: i,
		oid: a
	}), Array.isArray(o) && (o.length === 0 ? o = void 0 : o.length === 1 && (o = o[0]))), o;
}
async function $T({ fs: e, cache: t, gitdir: n, tree: r, fileId: i, oid: a, filepaths: o = [], parentPath: s = "" }) {
	let c = r.entries().map(function(r) {
		let c;
		return r.oid === i ? (c = Z(s, r.path), o.push(c)) : r.type === "tree" && (c = sS({
			fs: e,
			cache: t,
			gitdir: n,
			oid: r.oid
		}).then(function({ object: c }) {
			return $T({
				fs: e,
				cache: t,
				gitdir: n,
				tree: Ix.from(c),
				fileId: i,
				oid: a,
				filepaths: o,
				parentPath: Z(s, r.path)
			});
		})), c;
	});
	return await Promise.all(c), o;
}
async function eE({ fs: e, cache: t, gitdir: n, filepath: r, ref: i, depth: a, since: o, force: s, follow: c, includeChanges: l }) {
	let u = o === void 0 ? void 0 : Math.floor(o.valueOf() / 1e3), d = [], f = await Lw.read({
		fs: e,
		gitdir: n
	}), p = [await MC({
		fs: e,
		cache: t,
		gitdir: n,
		oid: await Q.resolve({
			fs: e,
			gitdir: n,
			ref: i
		})
	})], m, h, g;
	function _(e) {
		g && r && d.push(e);
	}
	for (; p.length > 0;) {
		let i = p.pop();
		if (u !== void 0 && i.commit.committer.timestamp <= u) break;
		if (r) {
			let a;
			try {
				a = await IC({
					fs: e,
					cache: t,
					gitdir: n,
					oid: i.commit.tree,
					filepath: r
				}), h && m !== a && d.push(h), m = a, h = i, g = !0;
			} catch (a) {
				if (a instanceof Xb) {
					let o = c && m;
					if (o && (o = await QT({
						fs: e,
						cache: t,
						gitdir: n,
						oid: i.commit.tree,
						fileId: m
					}), o)) if (Array.isArray(o)) {
						if (h) {
							let i = await QT({
								fs: e,
								cache: t,
								gitdir: n,
								oid: h.commit.tree,
								fileId: m
							});
							if (Array.isArray(i)) if (o = o.filter((e) => i.indexOf(e) === -1), o.length === 1) o = o[0], r = o, h && d.push(h);
							else {
								o = !1, h && d.push(h);
								break;
							}
						}
					} else r = o, h && d.push(h);
					if (!o) {
						if (g && m && (d.push(h), !s)) break;
						if (!s && !c) throw a;
					}
					h = i, g = !1;
				} else throw a;
			}
		} else d.push(i);
		if (a !== void 0 && d.length === a) {
			_(i);
			break;
		}
		if (!f.has(i.oid)) for (let r of i.commit.parent) {
			let i = await MC({
				fs: e,
				cache: t,
				gitdir: n,
				oid: r
			});
			p.map((e) => e.oid).includes(i.oid) || p.push(i);
		}
		p.length === 0 && _(i), p.sort((e, t) => XT(e.commit, t.commit));
	}
	if (l) for (let r of d) r.commit.changes = await tE({
		fs: e,
		cache: t,
		gitdir: n,
		commit: r,
		shallow: f.has(r.oid)
	});
	return d;
}
async function tE({ fs: e, cache: t, gitdir: n, commit: r, shallow: i }) {
	let a = i || !r.commit.parent[0] ? "4b825dc642cb6eb9a060e54bf8d69288fbee4904" : r.commit.parent[0];
	return iC({
		fs: e,
		cache: t,
		gitdir: n,
		trees: [ZS({ ref: r.oid }), ZS({ ref: a })],
		map: async (e, [t, n]) => {
			let [r, i] = await Promise.all([t && t.type(), n && n.type()]);
			if (r === "tree") return i && i !== "tree" ? [
				null,
				await n.oid(),
				e
			] : void 0;
			if (i === "tree") return r ? [
				await t.oid(),
				null,
				e
			] : void 0;
			let [a, o] = await Promise.all([t ? t.oid() : null, n ? n.oid() : null]);
			if (a !== o) return [
				a,
				o,
				e
			];
		}
	});
}
async function nE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), filepath: r, ref: i = "HEAD", depth: a, since: o, force: s, follow: c, includeChanges: l = !1, cache: u = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("ref", i);
		let t = new fC(e);
		return await eE({
			fs: t,
			cache: u,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			filepath: r,
			ref: i,
			depth: a,
			since: o,
			force: s,
			follow: c,
			includeChanges: l
		});
	} catch (e) {
		throw e.caller = "git.log", e;
	}
}
async function rE({ fs: e, onSign: t, dir: n, gitdir: r = Z(n, ".git"), ours: i, theirs: a, fastForward: o = !0, fastForwardOnly: s = !1, dryRun: c = !1, noUpdateBranch: l = !1, abortOnConflict: u = !0, message: d, author: f, committer: p, signingKey: m, cache: h = {}, mergeDriver: g, allowUnrelatedHistories: _ = !1 }) {
	try {
		$("fs", e), m && $("onSign", t);
		let v = new fC(e), y = await mC({
			fsp: v,
			dotgit: r
		}), b = await kC({
			fs: v,
			gitdir: y,
			author: f
		});
		if (!b && (!s || !o)) throw new wS("author");
		let x = await AC({
			fs: v,
			gitdir: y,
			author: b,
			committer: p
		});
		if (!x && (!s || !o)) throw new wS("committer");
		return await gT({
			fs: v,
			cache: h,
			dir: n,
			gitdir: y,
			ours: i,
			theirs: a,
			fastForward: o,
			fastForwardOnly: s,
			dryRun: c,
			noUpdateBranch: l,
			abortOnConflict: u,
			message: d,
			author: b,
			committer: x,
			signingKey: m,
			onSign: t,
			mergeDriver: g,
			allowUnrelatedHistories: _
		});
	} catch (e) {
		throw e.caller = "git.merge", e;
	}
}
var iE = {
	commit: 16,
	tree: 32,
	blob: 48,
	tag: 64,
	ofs_delta: 96,
	ref_delta: 112
};
async function aE({ fs: e, cache: t, dir: n, gitdir: r = Z(n, ".git"), oids: i }) {
	let a = new lb.default(), o = [];
	function s(e, t) {
		let n = Buffer.from(e, t);
		o.push(n), a.update(n);
	}
	async function c({ stype: e, object: t }) {
		let n = iE[e], r = t.length, i = r > 15 ? 128 : 0, a = r & 15;
		r >>>= 4;
		let o = (i | n | a).toString(16);
		for (s(o, "hex"); i;) i = r > 127 ? 128 : 0, o = i | r & 127, s(Tw(2, o), "hex"), r >>>= 7;
		s(Buffer.from(await bC(t)));
	}
	s("PACK"), s("00000002", "hex"), s(Tw(8, i.length), "hex");
	for (let n of i) {
		let { type: i, object: a } = await sS({
			fs: e,
			cache: t,
			gitdir: r,
			oid: n
		});
		await c({
			write: s,
			object: a,
			stype: i
		});
	}
	let l = a.digest();
	return o.push(l), o;
}
async function oE({ fs: e, cache: t, gitdir: n, oids: r, write: i }) {
	let a = await aE({
		fs: e,
		cache: t,
		gitdir: n,
		oids: r
	}), o = Buffer.from(await Cw(a)), s = `pack-${o.slice(-20).toString("hex")}.pack`;
	return i ? (await e.write(Z(n, `objects/pack/${s}`), o), { filename: s }) : {
		filename: s,
		packfile: new Uint8Array(o)
	};
}
async function sE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), oids: r, write: i = !1, cache: a = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("oids", r);
		let t = new fC(e);
		return await oE({
			fs: t,
			cache: a,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			oids: r,
			write: i
		});
	} catch (e) {
		throw e.caller = "git.packObjects", e;
	}
}
async function cE({ fs: e, http: t, onProgress: n, onMessage: r, onAuth: i, onAuthSuccess: a, onAuthFailure: o, dir: s, gitdir: c = Z(s, ".git"), ref: l, url: u, remote: d, remoteRef: f, prune: p = !1, pruneTags: m = !1, fastForward: h = !0, fastForwardOnly: g = !1, corsProxy: _, singleBranch: v, headers: y = {}, author: b, committer: x, signingKey: S, cache: C = {} }) {
	try {
		$("fs", e), $("gitdir", c);
		let w = new fC(e), T = await mC({
			fsp: w,
			dotgit: c
		}), E = await kC({
			fs: w,
			gitdir: T,
			author: b
		});
		if (!E) throw new wS("author");
		let ee = await AC({
			fs: w,
			gitdir: T,
			author: E,
			committer: x
		});
		if (!ee) throw new wS("committer");
		return await _T({
			fs: w,
			cache: C,
			http: t,
			onProgress: n,
			onMessage: r,
			onAuth: i,
			onAuthSuccess: a,
			onAuthFailure: o,
			dir: s,
			gitdir: T,
			ref: l,
			url: u,
			remote: d,
			remoteRef: f,
			fastForward: h,
			fastForwardOnly: g,
			corsProxy: _,
			singleBranch: v,
			headers: y,
			author: E,
			committer: ee,
			signingKey: S,
			prune: p,
			pruneTags: m
		});
	} catch (e) {
		throw e.caller = "git.pull", e;
	}
}
async function lE({ fs: e, cache: t, dir: n, gitdir: r = Z(n, ".git"), start: i, finish: a }) {
	let o = await Lw.read({
		fs: e,
		gitdir: r
	}), s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
	for (let t of i) s.add(await Q.resolve({
		fs: e,
		gitdir: r,
		ref: t
	}));
	for (let t of a) try {
		let n = await Q.resolve({
			fs: e,
			gitdir: r,
			ref: t
		});
		c.add(n);
	} catch {}
	let l = /* @__PURE__ */ new Set();
	async function u(n) {
		l.add(n);
		let { type: i, object: a } = await sS({
			fs: e,
			cache: t,
			gitdir: r,
			oid: n
		});
		if (i === "tag") {
			let e = GS.from(a).headers().object;
			return u(e);
		}
		if (i !== "commit") throw new Zb(n, i, "commit");
		if (!o.has(n)) for (n of JS.from(a).headers().parent) !c.has(n) && !l.has(n) && await u(n);
	}
	for (let e of s) await u(e);
	return l;
}
async function uE({ fs: e, cache: t, dir: n, gitdir: r = Z(n, ".git"), oids: i }) {
	let a = /* @__PURE__ */ new Set();
	async function o(n) {
		if (a.has(n)) return;
		a.add(n);
		let { type: i, object: s } = await sS({
			fs: e,
			cache: t,
			gitdir: r,
			oid: n
		});
		if (i === "tag") {
			let e = GS.from(s).headers().object;
			await o(e);
		} else if (i === "commit") {
			let e = JS.from(s).headers().tree;
			await o(e);
		} else if (i === "tree") {
			let e = Ix.from(s);
			for (let t of e) t.type === "blob" && a.add(t.oid), t.type === "tree" && await o(t.oid);
		}
	}
	for (let e of i) await o(e);
	return a;
}
async function dE(e) {
	let t = {}, n = "", r = Ew.streamReader(e), i = await r();
	for (; i !== !0;) i !== null && (n += i.toString("utf8") + "\n"), i = await r();
	let a = n.toString("utf8").split("\n");
	if (i = a.shift(), !i.startsWith("unpack ")) throw new DS("unpack ok\" or \"unpack [error message]", i);
	t.ok = i === "unpack ok", t.ok || (t.error = i.slice(7)), t.refs = {};
	for (let e of a) {
		if (e.trim() === "") continue;
		let n = e.slice(0, 2), r = e.slice(3), i = r.indexOf(" ");
		i === -1 && (i = r.length);
		let a = r.slice(0, i), o = r.slice(i + 1);
		t.refs[a] = {
			ok: n === "ok",
			error: o
		};
	}
	return t;
}
async function fE({ capabilities: e = [], triplets: t = [] }) {
	let n = [], r = `\x00 ${e.join(" ")}`;
	for (let e of t) n.push(Ew.encode(`${e.oldoid} ${e.oid} ${e.fullRef}${r}\n`)), r = "";
	return n.push(Ew.flush()), n;
}
async function pE({ fs: e, cache: t, http: n, onProgress: r, onMessage: i, onAuth: a, onAuthSuccess: o, onAuthFailure: s, onPrePush: c, gitdir: l, ref: u, remoteRef: d, remote: f, url: p, force: m = !1, delete: h = !1, corsProxy: g, headers: _ = {} }) {
	let v = u || await yw({
		fs: e,
		gitdir: l
	});
	if (v === void 0) throw new TS("ref");
	let y = await Tx.get({
		fs: e,
		gitdir: l
	});
	f = f || await y.get(`branch.${v}.pushRemote`) || await y.get("remote.pushDefault") || await y.get(`branch.${v}.remote`) || "origin";
	let b = p || await y.get(`remote.${f}.pushurl`) || await y.get(`remote.${f}.url`);
	if (b === void 0) throw new TS("remote OR url");
	let x = d || await y.get(`branch.${v}.merge`);
	if (b === void 0) throw new TS("remoteRef");
	g === void 0 && (g = await y.get("http.corsProxy"));
	let S = await Q.expand({
		fs: e,
		gitdir: l,
		ref: v
	}), C = h ? "0000000000000000000000000000000000000000" : await Q.resolve({
		fs: e,
		gitdir: l,
		ref: S
	}), w = Pw.getRemoteHelperFor({ url: b }), T = await w.discover({
		http: n,
		onAuth: Vw({
			config: y,
			onAuth: a
		}),
		onAuthSuccess: o,
		onAuthFailure: Vw({
			config: y,
			onAuth: s
		}),
		corsProxy: g,
		service: "git-receive-pack",
		url: b,
		headers: _,
		protocolVersion: 1
	}), E = T.auth, ee;
	if (!x) ee = S;
	else try {
		ee = await Q.expandAgainstMap({
			ref: x,
			map: T.refs
		});
	} catch (e) {
		if (e instanceof Xb) ee = x.startsWith("refs/") ? x : `refs/heads/${x}`;
		else throw e;
	}
	let te = T.refs.get(ee) || "0000000000000000000000000000000000000000";
	if (c && !await c({
		remote: f,
		url: b,
		localRef: {
			ref: h ? "(delete)" : S,
			oid: C
		},
		remoteRef: {
			ref: ee,
			oid: te
		}
	})) throw new NS();
	let ne = !T.capabilities.has("no-thin"), D = /* @__PURE__ */ new Set();
	if (!h) {
		let n = [...T.refs.values()], r = /* @__PURE__ */ new Set();
		if (te !== "0000000000000000000000000000000000000000") {
			let i = await hT({
				fs: e,
				cache: t,
				gitdir: l,
				oids: [C, te]
			});
			for (let e of i) n.push(e);
			ne && (r = await uE({
				fs: e,
				cache: t,
				gitdir: l,
				oids: i
			}));
		}
		if (n.includes(C) || (D = await uE({
			fs: e,
			cache: t,
			gitdir: l,
			oids: await lE({
				fs: e,
				cache: t,
				gitdir: l,
				start: [C],
				finish: n
			})
		})), ne) {
			try {
				let n = await Q.resolve({
					fs: e,
					gitdir: l,
					ref: `refs/remotes/${f}/HEAD`,
					depth: 2
				}), { oid: i } = await Q.resolveAgainstMap({
					ref: n.replace(`refs/remotes/${f}/`, ""),
					fullref: n,
					map: T.refs
				}), a = [i];
				for (let n of await uE({
					fs: e,
					cache: t,
					gitdir: l,
					oids: a
				})) r.add(n);
			} catch {}
			for (let e of r) D.delete(e);
		}
		if (C === te && (m = !0), !m) {
			if (S.startsWith("refs/tags") && te !== "0000000000000000000000000000000000000000") throw new OS("tag-exists");
			if (C !== "0000000000000000000000000000000000000000" && te !== "0000000000000000000000000000000000000000" && !await PT({
				fs: e,
				cache: t,
				gitdir: l,
				oid: C,
				ancestor: te,
				depth: -1
			})) throw new OS("not-fast-forward");
		}
	}
	let O = await fE({
		capabilities: Uw([...T.capabilities], [
			"report-status",
			"side-band-64k",
			`agent=${Ww.agent}`
		]),
		triplets: [{
			oldoid: te,
			oid: C,
			fullRef: ee
		}]
	}), k = h ? [] : await aE({
		fs: e,
		cache: t,
		gitdir: l,
		oids: [...D]
	}), A = await w.connect({
		http: n,
		onProgress: r,
		corsProxy: g,
		service: "git-receive-pack",
		url: b,
		auth: E,
		headers: _,
		body: [...O, ...k]
	}), { packfile: j, progress: re } = await Jw.demux(A.body);
	i && Sw(qw(re), async (e) => {
		await i(e);
	});
	let ie = await dE(j);
	if (A.headers && (ie.headers = A.headers), f && ie.ok && ie.refs[ee].ok && !S.startsWith("refs/tags")) {
		let t = `refs/remotes/${f}/${ee.replace("refs/heads", "")}`;
		h ? await Q.deleteRef({
			fs: e,
			gitdir: l,
			ref: t
		}) : await Q.writeRef({
			fs: e,
			gitdir: l,
			ref: t,
			value: C
		});
	}
	if (ie.ok && Object.values(ie.refs).every((e) => e.ok)) return ie;
	throw new _S(Object.entries(ie.refs).filter(([e, t]) => !t.ok).map(([e, t]) => `\n  - ${e}: ${t.error}`).join(""), ie);
}
async function mE({ fs: e, http: t, onProgress: n, onMessage: r, onAuth: i, onAuthSuccess: a, onAuthFailure: o, onPrePush: s, dir: c, gitdir: l = Z(c, ".git"), ref: u, remoteRef: d, remote: f = "origin", url: p, force: m = !1, delete: h = !1, corsProxy: g, headers: _ = {}, cache: v = {} }) {
	try {
		$("fs", e), $("http", t), $("gitdir", l);
		let c = new fC(e);
		return await pE({
			fs: c,
			cache: v,
			http: t,
			onProgress: n,
			onMessage: r,
			onAuth: i,
			onAuthSuccess: a,
			onAuthFailure: o,
			onPrePush: s,
			gitdir: await mC({
				fsp: c,
				dotgit: l
			}),
			ref: u,
			remoteRef: d,
			remote: f,
			url: p,
			force: m,
			delete: h,
			corsProxy: g,
			headers: _
		});
	} catch (e) {
		throw e.caller = "git.push", e;
	}
}
async function hE({ fs: e, cache: t, gitdir: n, oid: r }) {
	let { type: i, object: a } = await sS({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	});
	if (i === "tag") return r = GS.from(a).parse().object, hE({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	});
	if (i !== "blob") throw new Zb(r, i, "blob");
	return {
		oid: r,
		blob: new Uint8Array(a)
	};
}
async function gE({ fs: e, cache: t, gitdir: n, oid: r, filepath: i = void 0 }) {
	return i !== void 0 && (r = await IC({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r,
		filepath: i
	})), await hE({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	});
}
async function _E({ fs: e, dir: t, gitdir: n = Z(t, ".git"), oid: r, filepath: i, cache: a = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("oid", r);
		let t = new fC(e);
		return await gE({
			fs: t,
			cache: a,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			oid: r,
			filepath: i
		});
	} catch (e) {
		throw e.caller = "git.readBlob", e;
	}
}
async function vE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), oid: r, cache: i = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("oid", r);
		let t = new fC(e);
		return await MC({
			fs: t,
			cache: i,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			oid: r
		});
	} catch (e) {
		throw e.caller = "git.readCommit", e;
	}
}
async function yE({ fs: e, cache: t, gitdir: n, ref: r = "refs/notes/commits", oid: i }) {
	let { blob: a } = await gE({
		fs: e,
		cache: t,
		gitdir: n,
		oid: await Q.resolve({
			gitdir: n,
			fs: e,
			ref: r
		}),
		filepath: i
	});
	return a;
}
async function bE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r = "refs/notes/commits", oid: i, cache: a = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("ref", r), $("oid", i);
		let t = new fC(e);
		return await yE({
			fs: t,
			cache: a,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			ref: r,
			oid: i
		});
	} catch (e) {
		throw e.caller = "git.readNote", e;
	}
}
async function xE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), oid: r, format: i = "parsed", filepath: a = void 0, encoding: o = void 0, cache: s = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("oid", r);
		let t = new fC(e), c = await mC({
			fsp: t,
			dotgit: n
		});
		a !== void 0 && (r = await IC({
			fs: t,
			cache: s,
			gitdir: c,
			oid: r,
			filepath: a
		}));
		let l = await sS({
			fs: t,
			cache: s,
			gitdir: c,
			oid: r,
			format: i === "parsed" ? "content" : i
		});
		if (l.oid = r, i === "parsed") switch (l.format = "parsed", l.type) {
			case "commit":
				l.object = JS.from(l.object).parse();
				break;
			case "tree":
				l.object = Ix.from(l.object).entries();
				break;
			case "blob":
				o ? l.object = l.object.toString(o) : (l.object = new Uint8Array(l.object), l.format = "content");
				break;
			case "tag":
				l.object = GS.from(l.object).parse();
				break;
			default: throw new Zb(l.oid, l.type, "blob|commit|tag|tree");
		}
		else (l.format === "deflated" || l.format === "wrapped") && (l.type = l.format);
		return l;
	} catch (e) {
		throw e.caller = "git.readObject", e;
	}
}
async function SE({ fs: e, cache: t, gitdir: n, oid: r }) {
	let { type: i, object: a } = await sS({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r,
		format: "content"
	});
	if (i !== "tag") throw new Zb(r, i, "tag");
	let o = GS.from(a);
	return {
		oid: r,
		tag: o.parse(),
		payload: o.payload()
	};
}
async function CE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), oid: r, cache: i = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("oid", r);
		let t = new fC(e);
		return await SE({
			fs: t,
			cache: i,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			oid: r
		});
	} catch (e) {
		throw e.caller = "git.readTag", e;
	}
}
async function wE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), oid: r, filepath: i = void 0, cache: a = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("oid", r);
		let t = new fC(e);
		return await RC({
			fs: t,
			cache: a,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			oid: r,
			filepath: i
		});
	} catch (e) {
		throw e.caller = "git.readTree", e;
	}
}
async function TE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), filepath: r, cache: i = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("filepath", r);
		let t = new fC(e), a = await mC({
			fsp: t,
			dotgit: n
		});
		await Hb.acquire({
			fs: t,
			gitdir: a,
			cache: i
		}, async function(e) {
			e.delete({ filepath: r });
		});
	} catch (e) {
		throw e.caller = "git.remove", e;
	}
}
async function EE({ fs: e, cache: t, onSign: n, gitdir: r, ref: i = "refs/notes/commits", oid: a, author: o, committer: s, signingKey: c }) {
	let l;
	try {
		l = await Q.resolve({
			gitdir: r,
			fs: e,
			ref: i
		});
	} catch (e) {
		if (!(e instanceof Xb)) throw e;
	}
	let u = (await RC({
		fs: e,
		cache: t,
		gitdir: r,
		oid: l || "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
	})).tree;
	return u = u.filter((e) => e.path !== a), await PC({
		fs: e,
		cache: t,
		onSign: n,
		gitdir: r,
		ref: i,
		tree: await zC({
			fs: e,
			gitdir: r,
			tree: u
		}),
		parent: l && [l],
		message: "Note removed by 'isomorphic-git removeNote'\n",
		author: o,
		committer: s,
		signingKey: c
	});
}
async function DE({ fs: e, onSign: t, dir: n, gitdir: r = Z(n, ".git"), ref: i = "refs/notes/commits", oid: a, author: o, committer: s, signingKey: c, cache: l = {} }) {
	try {
		$("fs", e), $("gitdir", r), $("oid", a);
		let n = new fC(e), u = await mC({
			fsp: n,
			dotgit: r
		}), d = await kC({
			fs: n,
			gitdir: u,
			author: o
		});
		if (!d) throw new wS("author");
		let f = await AC({
			fs: n,
			gitdir: u,
			author: d,
			committer: s
		});
		if (!f) throw new wS("committer");
		return await EE({
			fs: n,
			cache: l,
			onSign: t,
			gitdir: u,
			ref: i,
			oid: a,
			author: d,
			committer: f,
			signingKey: c
		});
	} catch (e) {
		throw e.caller = "git.removeNote", e;
	}
}
async function OE({ fs: e, gitdir: t, oldref: n, ref: r, checkout: i = !1 }) {
	if (!UC(r, !0)) throw new bS(r, mb.default.clean(r));
	if (!UC(n, !0)) throw new bS(n, mb.default.clean(n));
	let a = `refs/heads/${n}`, o = `refs/heads/${r}`;
	if (await Q.exists({
		fs: e,
		gitdir: t,
		ref: o
	})) throw new cS("branch", r, !1);
	let s = await Q.resolve({
		fs: e,
		gitdir: t,
		ref: a,
		depth: 1
	});
	await Q.writeRef({
		fs: e,
		gitdir: t,
		ref: o,
		value: s
	}), await Q.deleteRef({
		fs: e,
		gitdir: t,
		ref: a
	});
	let c = await yw({
		fs: e,
		gitdir: t,
		fullname: !0
	}) === a;
	(i || c) && await Q.writeSymbolicRef({
		fs: e,
		gitdir: t,
		ref: "HEAD",
		value: o
	});
}
async function kE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r, oldref: i, checkout: a = !1 }) {
	try {
		$("fs", e), $("gitdir", n), $("ref", r), $("oldref", i);
		let t = new fC(e);
		return await OE({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			ref: r,
			oldref: i,
			checkout: a
		});
	} catch (e) {
		throw e.caller = "git.renameBranch", e;
	}
}
async function AE({ gitdir: e, type: t, object: n }) {
	return kb(Lx.wrap({
		type: t,
		object: n
	}));
}
async function jE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), filepath: r, ref: i, cache: a = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("filepath", r);
		let o = new fC(e), s = await mC({
			fsp: o,
			dotgit: n
		}), c, l;
		try {
			c = await Q.resolve({
				fs: o,
				gitdir: s,
				ref: i || "HEAD"
			});
		} catch (e) {
			if (i) throw e;
		}
		if (c) try {
			c = await IC({
				fs: o,
				cache: a,
				gitdir: s,
				oid: c,
				filepath: r
			});
		} catch {
			c = null;
		}
		let u = {
			ctime: /* @__PURE__ */ new Date(0),
			mtime: /* @__PURE__ */ new Date(0),
			dev: 0,
			ino: 0,
			mode: 0,
			uid: 0,
			gid: 0,
			size: 0
		}, d = t && await o.read(Z(t, r));
		d && (l = await AE({
			gitdir: s,
			type: "blob",
			object: d
		}), c === l && (u = await o.lstat(Z(t, r)))), await Hb.acquire({
			fs: o,
			gitdir: s,
			cache: a
		}, async function(e) {
			e.delete({ filepath: r }), c && e.insert({
				filepath: r,
				stats: u,
				oid: c
			});
		});
	} catch (e) {
		throw e.caller = "git.reset", e;
	}
}
async function ME({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r, depth: i }) {
	try {
		$("fs", e), $("gitdir", n), $("ref", r);
		let t = new fC(e), a = await mC({
			fsp: t,
			dotgit: n
		});
		return await Q.resolve({
			fs: t,
			gitdir: a,
			ref: r,
			depth: i
		});
	} catch (e) {
		throw e.caller = "git.resolveRef", e;
	}
}
async function NE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), path: r, value: i, append: a = !1 }) {
	try {
		$("fs", e), $("gitdir", n), $("path", r);
		let t = new fC(e), o = await mC({
			fsp: t,
			dotgit: n
		}), s = await Tx.get({
			fs: t,
			gitdir: o
		});
		a ? await s.append(r, i) : await s.set(r, i), await Tx.save({
			fs: t,
			gitdir: o,
			config: s
		});
	} catch (e) {
		throw e.caller = "git.setConfig", e;
	}
}
async function PE({ fs: e, gitdir: t, commit: n }) {
	return await CC({
		fs: e,
		gitdir: t,
		type: "commit",
		object: JS.from(n).toObject(),
		format: "content"
	});
}
var FE = class e {
	static get timezoneOffsetForRefLogEntry() {
		let e = (/* @__PURE__ */ new Date()).getTimezoneOffset(), t = Math.abs(Math.floor(e / 60)), n = Math.abs(e % 60).toString().padStart(2, "0");
		return `${e > 0 ? "-" : "+"}${t.toString().padStart(2, "0")}${n}`;
	}
	static createStashReflogEntry(t, n, r) {
		let i = t.name.replace(/\s/g, ""), a = Math.floor(Date.now() / 1e3), o = e.timezoneOffsetForRefLogEntry;
		return `0000000000000000000000000000000000000000 ${n} ${i} ${t.email} ${a} ${o}\t${r}\n`;
	}
	static getStashReflogEntry(e, t = !1) {
		return e.split("\n").filter((e) => e).reverse().map((e, n) => t ? `stash@{${n}}: ${e.split("	")[1]}` : e);
	}
}, IE = class e {
	constructor({ fs: e, dir: t, gitdir: n = Z(t, ".git") }) {
		Object.assign(this, {
			fs: e,
			dir: t,
			gitdir: n,
			_author: null
		});
	}
	static get refStash() {
		return "refs/stash";
	}
	static get refLogsStash() {
		return "logs/refs/stash";
	}
	get refStashPath() {
		return Z(this.gitdir, e.refStash);
	}
	get refLogsStashPath() {
		return Z(this.gitdir, e.refLogsStash);
	}
	async getAuthor() {
		if (!this._author && (this._author = await kC({
			fs: this.fs,
			gitdir: this.gitdir,
			author: {}
		}), !this._author)) throw new wS("author");
		return this._author;
	}
	async getStashSHA(e, t) {
		return await this.fs.exists(this.refStashPath) ? (t || await this.readStashReflogs({ parsed: !1 }))[e].split(" ")[1] : null;
	}
	async writeStashCommit({ message: e, tree: t, parent: n }) {
		return PE({
			fs: this.fs,
			gitdir: this.gitdir,
			commit: {
				message: e,
				tree: t,
				parent: n,
				author: await this.getAuthor(),
				committer: await this.getAuthor()
			}
		});
	}
	async readStashCommit(e) {
		let t = await this.readStashReflogs({ parsed: !1 });
		if (e !== 0 && (e < 0 || e > t.length - 1)) throw new bS(`stash@${e}`, "number that is in range of [0, num of stash pushed]");
		let n = await this.getStashSHA(e, t);
		return n ? MC({
			fs: this.fs,
			cache: {},
			gitdir: this.gitdir,
			oid: n
		}) : {};
	}
	async writeStashRef(t) {
		return Q.writeRef({
			fs: this.fs,
			gitdir: this.gitdir,
			ref: e.refStash,
			value: t
		});
	}
	async writeStashReflogEntry({ stashCommit: e, message: t }) {
		let n = await this.getAuthor(), r = FE.createStashReflogEntry(n, e, t), i = this.refLogsStashPath;
		await uw({
			filepath: i,
			entry: r
		}, async () => {
			let e = await this.fs.exists(i) ? await this.fs.read(i, "utf8") : "";
			await this.fs.write(i, e + r, "utf8");
		});
	}
	async readStashReflogs({ parsed: e = !1 }) {
		if (!await this.fs.exists(this.refLogsStashPath)) return [];
		let t = await this.fs.read(this.refLogsStashPath, "utf8");
		return FE.getStashReflogEntry(t, e);
	}
};
async function LE({ fs: e, dir: t, gitdir: n, message: r = "" }) {
	let i = new IE({
		fs: e,
		dir: t,
		gitdir: n
	});
	await i.getAuthor();
	let a = await yw({
		fs: e,
		gitdir: n,
		fullname: !1
	}), o = await Q.resolve({
		fs: e,
		gitdir: n,
		ref: "HEAD"
	}), s = (await vE({
		fs: e,
		dir: t,
		gitdir: n,
		oid: o
	})).commit.message, c = [o], l = null, u = ZS({ ref: "HEAD" }), d = await pw({
		fs: e,
		dir: t,
		gitdir: n,
		treePair: [ZS({ ref: "HEAD" }), "stage"]
	});
	if (d) {
		let e = await i.writeStashCommit({
			message: `stash-Index: WIP on ${a} - ${(/* @__PURE__ */ new Date()).toISOString()}`,
			tree: d,
			parent: c
		});
		c.push(e), l = d, u = Yb();
	}
	let f = await pw({
		fs: e,
		dir: t,
		gitdir: n,
		treePair: [u, "workdir"]
	});
	if (f) {
		let e = await i.writeStashCommit({
			message: `stash-WorkDir: WIP on ${a} - ${(/* @__PURE__ */ new Date()).toISOString()}`,
			tree: f,
			parent: [c[c.length - 1]]
		});
		c.push(e), l = f;
	}
	if (!l || !d && !f) throw new Xb("changes, nothing to stash");
	let p = (r.trim() || `WIP on ${a}`) + `: ${o.substring(0, 7)} ${s}`;
	return {
		stashCommit: await i.writeStashCommit({
			message: p,
			tree: l,
			parent: c
		}),
		stashMsg: p,
		branch: a,
		stashMgr: i
	};
}
async function RE({ fs: e, dir: t, gitdir: n, message: r = "" }) {
	let { stashCommit: i, stashMsg: a, branch: o, stashMgr: s } = await LE({
		fs: e,
		dir: t,
		gitdir: n,
		message: r
	});
	return await s.writeStashRef(i), await s.writeStashReflogEntry({
		stashCommit: i,
		message: a
	}), await rw({
		fs: e,
		dir: t,
		gitdir: n,
		ref: o,
		track: !1,
		force: !0
	}), i;
}
async function zE({ fs: e, dir: t, gitdir: n, message: r = "" }) {
	let { stashCommit: i } = await LE({
		fs: e,
		dir: t,
		gitdir: n,
		message: r
	});
	return i;
}
async function BE({ fs: e, dir: t, gitdir: n, refIdx: r = 0 }) {
	let i = await new IE({
		fs: e,
		dir: t,
		gitdir: n
	}).readStashCommit(r), { parent: a = null } = i.commit ? i.commit : {};
	if (!(!a || !Array.isArray(a))) for (let r = 0; r < a.length - 1; r++) {
		let i = (await MC({
			fs: e,
			cache: {},
			gitdir: n,
			oid: a[r + 1]
		})).commit.message.startsWith("stash-Index");
		await mw({
			fs: e,
			dir: t,
			gitdir: n,
			stashCommit: a[r + 1],
			parentCommit: a[r],
			wasStaged: i
		});
	}
}
async function VE({ fs: e, dir: t, gitdir: n, refIdx: r = 0 }) {
	let i = new IE({
		fs: e,
		dir: t,
		gitdir: n
	});
	if (!(await i.readStashCommit(r)).commit) return;
	let a = i.refStashPath;
	await uw(a, async () => {
		await e.exists(a) && await e.rm(a);
	});
	let o = await i.readStashReflogs({ parsed: !1 });
	if (!o.length) return;
	o.splice(r, 1);
	let s = i.refLogsStashPath;
	await uw({
		reflogEntries: o,
		stashReflogPath: s,
		stashMgr: i
	}, async () => {
		if (o.length) {
			await e.write(s, o.reverse().join("\n") + "\n", "utf8");
			let t = o[o.length - 1].split(" ")[1];
			await i.writeStashRef(t);
		} else await e.rm(s);
	});
}
async function HE({ fs: e, dir: t, gitdir: n }) {
	return new IE({
		fs: e,
		dir: t,
		gitdir: n
	}).readStashReflogs({ parsed: !0 });
}
async function UE({ fs: e, dir: t, gitdir: n }) {
	let r = new IE({
		fs: e,
		dir: t,
		gitdir: n
	}), i = [r.refStashPath, r.refLogsStashPath];
	await uw(i, async () => {
		await Promise.all(i.map(async (t) => {
			if (await e.exists(t)) return e.rm(t);
		}));
	});
}
async function WE({ fs: e, dir: t, gitdir: n, refIdx: r = 0 }) {
	await BE({
		fs: e,
		dir: t,
		gitdir: n,
		refIdx: r
	}), await VE({
		fs: e,
		dir: t,
		gitdir: n,
		refIdx: r
	});
}
async function GE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), op: r = "push", message: i = "", refIdx: a = 0 }) {
	$("fs", e), $("dir", t), $("gitdir", n), $("op", r);
	let o = {
		push: RE,
		apply: BE,
		drop: VE,
		list: HE,
		clear: UE,
		pop: WE,
		create: zE
	}, s = [
		"apply",
		"drop",
		"pop"
	];
	try {
		let c = new fC(e), l = await mC({
			fsp: c,
			dotgit: n
		});
		[
			"refs",
			"logs",
			"logs/refs"
		].map((e) => Z(l, e)).forEach(async (e) => {
			await c.exists(e) || await c.mkdir(e);
		});
		let u = o[r];
		if (u) {
			if (s.includes(r) && a < 0) throw new bS(`stash@${a}`, "number that is in range of [0, num of stash pushed]");
			return await u({
				fs: c,
				dir: t,
				gitdir: l,
				message: i,
				refIdx: a
			});
		}
		throw Error(`To be implemented: ${r}`);
	} catch (e) {
		throw e.caller = "git.stash", e;
	}
}
async function KE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), filepath: r, cache: i = {}, refresh: a = !0 }) {
	try {
		$("fs", e), $("gitdir", n), $("filepath", r);
		let o = new fC(e), s = await mC({
			fsp: o,
			dotgit: n
		});
		if (await _C.isIgnored({
			fs: o,
			gitdir: s,
			dir: t,
			filepath: r
		})) return "ignored";
		let c = await qE({
			fs: o,
			cache: i,
			gitdir: s,
			tree: await JE({
				fs: o,
				cache: i,
				gitdir: s
			}),
			path: r
		}), l = await Hb.acquire({
			fs: o,
			gitdir: s,
			cache: i
		}, async function(e) {
			for (let t of e) if (t.path === r) return t;
			return null;
		}), u = await o.lstat(Z(t, r)), d = c !== null, f = l !== null, p = u !== null, m = async () => {
			if (f && !Ib(l, u)) return l.oid;
			{
				let e = await o.read(Z(t, r)), n = await AE({
					gitdir: s,
					type: "blob",
					object: e
				});
				return a && f && l.oid === n && u.size !== -1 && Hb.acquire({
					fs: o,
					gitdir: s,
					cache: i
				}, async function(e) {
					e.insert({
						filepath: r,
						stats: u,
						oid: n
					});
				}), n;
			}
		};
		if (!d && !p && !f) return "absent";
		if (!d && !p && f) return "*absent";
		if (!d && p && !f) return "*added";
		if (!d && p && f) return await m() === l.oid ? "added" : "*added";
		if (d && !p && !f) return "deleted";
		if (d && !p && f) return l.oid, "*deleted";
		if (d && p && !f) return await m() === c ? "*undeleted" : "*undeletemodified";
		if (d && p && f) {
			let e = await m();
			return e === c ? e === l.oid ? "unmodified" : "*unmodified" : e === l.oid ? "modified" : "*modified";
		}
	} catch (e) {
		throw e.caller = "git.status", e;
	}
}
async function qE({ fs: e, cache: t, gitdir: n, tree: r, path: i }) {
	typeof i == "string" && (i = i.split("/"));
	let a = i.shift();
	for (let o of r) if (o.path === a) {
		if (i.length === 0) return o.oid;
		let { type: r, object: a } = await sS({
			fs: e,
			cache: t,
			gitdir: n,
			oid: o.oid
		});
		if (r === "tree") return qE({
			fs: e,
			cache: t,
			gitdir: n,
			tree: Ix.from(a),
			path: i
		});
		if (r === "blob") throw new Zb(o.oid, r, "blob", i.join("/"));
	}
	return null;
}
async function JE({ fs: e, cache: t, gitdir: n }) {
	let r;
	try {
		r = await Q.resolve({
			fs: e,
			gitdir: n,
			ref: "HEAD"
		});
	} catch (e) {
		if (e instanceof Xb) return [];
	}
	let { tree: i } = await RC({
		fs: e,
		cache: t,
		gitdir: n,
		oid: r
	});
	return i;
}
async function YE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r = "HEAD", filepaths: i = ["."], filter: a, cache: o = {}, ignored: s = !1, refresh: c = !0 }) {
	try {
		$("fs", e), $("gitdir", n), $("ref", r);
		let l = new fC(e);
		return await iC({
			fs: l,
			cache: o,
			dir: t,
			gitdir: await mC({
				fsp: l,
				dotgit: n
			}),
			trees: [
				ZS({ ref: r }),
				$S({ refresh: c }),
				Yb()
			],
			map: async function(e, [n, r, o]) {
				if (!n && !o && r && !s && await _C.isIgnored({
					fs: l,
					dir: t,
					filepath: e
				}) || !i.some((t) => ZC(e, t))) return null;
				if (a && !a(e)) return;
				let [c, u, d] = await Promise.all([
					n && n.type(),
					r && r.type(),
					o && o.type()
				]), f = [
					c,
					u,
					d
				].includes("blob");
				if ((c === "tree" || c === "special") && !f) return;
				if (c === "commit") return null;
				if ((u === "tree" || u === "special") && !f) return;
				if (d === "commit") return null;
				if ((d === "tree" || d === "special") && !f) return;
				let p = c === "blob" ? await n.oid() : void 0, m = d === "blob" ? await o.oid() : void 0, h;
				c !== "blob" && u === "blob" && d !== "blob" ? h = "42" : u === "blob" && (h = await r.oid());
				let g = [
					void 0,
					p,
					h,
					m
				], _ = g.map((e) => g.indexOf(e));
				return _.shift(), [e, ..._];
			}
		});
	} catch (e) {
		throw e.caller = "git.statusMatrix", e;
	}
}
async function XE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r, object: i, force: a = !1 }) {
	try {
		$("fs", e), $("gitdir", n), $("ref", r);
		let t = new fC(e);
		if (r === void 0) throw new TS("ref");
		r = r.startsWith("refs/tags/") ? r : `refs/tags/${r}`;
		let o = await mC({
			fsp: t,
			dotgit: n
		}), s = await Q.resolve({
			fs: t,
			gitdir: o,
			ref: i || "HEAD"
		});
		if (!a && await Q.exists({
			fs: t,
			gitdir: o,
			ref: r
		})) throw new cS("tag", r);
		await Q.writeRef({
			fs: t,
			gitdir: o,
			ref: r,
			value: s
		});
	} catch (e) {
		throw e.caller = "git.tag", e;
	}
}
async function ZE({ fs: e, dir: t, gitdir: n = Z(t, ".git"), cache: r = {}, filepath: i, oid: a, mode: o, add: s, remove: c, force: l }) {
	try {
		$("fs", e), $("gitdir", n), $("filepath", i);
		let u = new fC(e), d = await mC({
			fsp: u,
			dotgit: n
		});
		if (c) return await Hb.acquire({
			fs: u,
			gitdir: d,
			cache: r
		}, async function(e) {
			if (!l) {
				let e = await u.lstat(Z(t, i));
				if (e) {
					if (e.isDirectory()) throw new yS("directory");
					return;
				}
			}
			e.has({ filepath: i }) && e.delete({ filepath: i });
		});
		let f;
		if (!a) {
			if (f = await u.lstat(Z(t, i)), !f) throw new Xb(`file at "${i}" on disk and "remove" not set`);
			if (f.isDirectory()) throw new yS("directory");
		}
		return await Hb.acquire({
			fs: u,
			gitdir: d,
			cache: r
		}, async function(e) {
			if (!s && !e.has({ filepath: i })) throw new Xb(`file at "${i}" in index and "add" not set`);
			let n;
			if (a) n = {
				ctime: /* @__PURE__ */ new Date(0),
				mtime: /* @__PURE__ */ new Date(0),
				dev: 0,
				ino: 0,
				mode: o,
				uid: 0,
				gid: 0,
				size: 0
			};
			else {
				n = f;
				let e = n.isSymbolicLink() ? await u.readlink(Z(t, i)) : await u.read(Z(t, i));
				a = await CC({
					fs: u,
					gitdir: d,
					type: "blob",
					format: "content",
					object: e
				});
			}
			return e.insert({
				filepath: i,
				oid: a,
				stats: n
			}), a;
		});
	} catch (e) {
		throw e.caller = "git.updateIndex", e;
	}
}
function QE() {
	try {
		return Ww.version;
	} catch (e) {
		throw e.caller = "git.version", e;
	}
}
async function $E({ fs: e, dir: t, gitdir: n = Z(t, ".git"), trees: r, map: i, reduce: a, iterate: o, cache: s = {} }) {
	try {
		$("fs", e), $("gitdir", n), $("trees", r);
		let c = new fC(e);
		return await iC({
			fs: c,
			cache: s,
			dir: t,
			gitdir: await mC({
				fsp: c,
				dotgit: n
			}),
			trees: r,
			map: i,
			reduce: a,
			iterate: o
		});
	} catch (e) {
		throw e.caller = "git.walk", e;
	}
}
async function eD({ fs: e, dir: t, gitdir: n = Z(t, ".git"), blob: r }) {
	try {
		$("fs", e), $("gitdir", n), $("blob", r);
		let t = new fC(e);
		return await CC({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			type: "blob",
			object: r,
			format: "content"
		});
	} catch (e) {
		throw e.caller = "git.writeBlob", e;
	}
}
async function tD({ fs: e, dir: t, gitdir: n = Z(t, ".git"), commit: r }) {
	try {
		$("fs", e), $("gitdir", n), $("commit", r);
		let t = new fC(e);
		return await PE({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			commit: r
		});
	} catch (e) {
		throw e.caller = "git.writeCommit", e;
	}
}
async function nD({ fs: e, dir: t, gitdir: n = Z(t, ".git"), type: r, object: i, format: a = "parsed", oid: o, encoding: s = void 0 }) {
	try {
		let t = new fC(e), c = await mC({
			fsp: t,
			dotgit: n
		});
		if (a === "parsed") {
			switch (r) {
				case "commit":
					i = JS.from(i).toObject();
					break;
				case "tree":
					i = Ix.from(i).toObject();
					break;
				case "blob":
					i = Buffer.from(i, s);
					break;
				case "tag":
					i = GS.from(i).toObject();
					break;
				default: throw new Zb(o || "", r, "blob|commit|tag|tree");
			}
			a = "content";
		}
		return o = await CC({
			fs: t,
			gitdir: c,
			type: r,
			object: i,
			oid: o,
			format: a
		}), o;
	} catch (e) {
		throw e.caller = "git.writeObject", e;
	}
}
async function rD({ fs: e, dir: t, gitdir: n = Z(t, ".git"), ref: r, value: i, force: a = !1, symbolic: o = !1 }) {
	try {
		$("fs", e), $("gitdir", n), $("ref", r), $("value", i);
		let t = new fC(e);
		if (!UC(r, !0)) throw new bS(r, mb.default.clean(r));
		let s = await mC({
			fsp: t,
			dotgit: n
		});
		if (!a && await Q.exists({
			fs: t,
			gitdir: s,
			ref: r
		})) throw new cS("ref", r);
		o ? await Q.writeSymbolicRef({
			fs: t,
			gitdir: s,
			ref: r,
			value: i
		}) : (i = await Q.resolve({
			fs: t,
			gitdir: s,
			ref: i
		}), await Q.writeRef({
			fs: t,
			gitdir: s,
			ref: r,
			value: i
		}));
	} catch (e) {
		throw e.caller = "git.writeRef", e;
	}
}
async function iD({ fs: e, gitdir: t, tag: n }) {
	return await CC({
		fs: e,
		gitdir: t,
		type: "tag",
		object: GS.from(n).toObject(),
		format: "content"
	});
}
async function aD({ fs: e, dir: t, gitdir: n = Z(t, ".git"), tag: r }) {
	try {
		$("fs", e), $("gitdir", n), $("tag", r);
		let t = new fC(e);
		return await iD({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			tag: r
		});
	} catch (e) {
		throw e.caller = "git.writeTag", e;
	}
}
async function oD({ fs: e, dir: t, gitdir: n = Z(t, ".git"), tree: r }) {
	try {
		$("fs", e), $("gitdir", n), $("tree", r);
		let t = new fC(e);
		return await zC({
			fs: t,
			gitdir: await mC({
				fsp: t,
				dotgit: n
			}),
			tree: r
		});
	} catch (e) {
		throw e.caller = "git.writeTree", e;
	}
}
var sD = {
	Errors: IS,
	STAGE: Yb,
	TREE: ZS,
	WORKDIR: $S,
	add: TC,
	abortMerge: gC,
	addNote: VC,
	addRemote: GC,
	annotatedTag: qC,
	branch: YC,
	cherryPick: gw,
	checkout: rw,
	clone: eT,
	commit: tT,
	getConfig: CT,
	getConfigAll: TT,
	setConfig: NE,
	currentBranch: nT,
	deleteBranch: iT,
	deleteRef: aT,
	deleteRemote: sT,
	deleteTag: lT,
	expandOid: pT,
	expandRef: mT,
	fastForward: vT,
	fetch: yT,
	findMergeBase: bT,
	findRoot: ST,
	getRemoteInfo: ET,
	getRemoteInfo2: OT,
	hashBlob: AT,
	indexPack: MT,
	init: NT,
	isDescendent: FT,
	isIgnored: IT,
	listBranches: LT,
	listFiles: BT,
	listNotes: HT,
	listRefs: UT,
	listRemotes: GT,
	listServerRefs: JT,
	listTags: YT,
	log: nE,
	merge: rE,
	packObjects: sE,
	pull: cE,
	push: mE,
	readBlob: _E,
	readCommit: vE,
	readNote: bE,
	readObject: xE,
	readTag: CE,
	readTree: wE,
	remove: TE,
	removeNote: DE,
	renameBranch: kE,
	resetIndex: jE,
	updateIndex: ZE,
	resolveRef: ME,
	status: KE,
	statusMatrix: YE,
	tag: XE,
	version: QE,
	walk: $E,
	writeBlob: eD,
	writeCommit: tD,
	writeObject: nD,
	writeRef: rD,
	writeTag: aD,
	writeTree: oD,
	stash: GE
}, cD = Uint8Array, lD = Uint16Array, uD = Int32Array, dD = new cD([
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	1,
	1,
	1,
	1,
	2,
	2,
	2,
	2,
	3,
	3,
	3,
	3,
	4,
	4,
	4,
	4,
	5,
	5,
	5,
	5,
	0,
	0,
	0,
	0
]), fD = new cD([
	0,
	0,
	0,
	0,
	1,
	1,
	2,
	2,
	3,
	3,
	4,
	4,
	5,
	5,
	6,
	6,
	7,
	7,
	8,
	8,
	9,
	9,
	10,
	10,
	11,
	11,
	12,
	12,
	13,
	13,
	0,
	0
]), pD = new cD([
	16,
	17,
	18,
	0,
	8,
	7,
	9,
	6,
	10,
	5,
	11,
	4,
	12,
	3,
	13,
	2,
	14,
	1,
	15
]), mD = function(e, t) {
	for (var n = new lD(31), r = 0; r < 31; ++r) n[r] = t += 1 << e[r - 1];
	for (var i = new uD(n[30]), r = 1; r < 30; ++r) for (var a = n[r]; a < n[r + 1]; ++a) i[a] = a - n[r] << 5 | r;
	return {
		b: n,
		r: i
	};
}, hD = mD(dD, 2), gD = hD.b, _D = hD.r;
gD[28] = 258, _D[258] = 28;
var vD = mD(fD, 0);
vD.b;
for (var yD = vD.r, bD = new lD(32768), xD = 0; xD < 32768; ++xD) {
	var SD = (xD & 43690) >> 1 | (xD & 21845) << 1;
	SD = (SD & 52428) >> 2 | (SD & 13107) << 2, SD = (SD & 61680) >> 4 | (SD & 3855) << 4, bD[xD] = ((SD & 65280) >> 8 | (SD & 255) << 8) >> 1;
}
for (var CD = (function(e, t, n) {
	for (var r = e.length, i = 0, a = new lD(t); i < r; ++i) e[i] && ++a[e[i] - 1];
	var o = new lD(t);
	for (i = 1; i < t; ++i) o[i] = o[i - 1] + a[i - 1] << 1;
	var s;
	if (n) {
		s = new lD(1 << t);
		var c = 15 - t;
		for (i = 0; i < r; ++i) if (e[i]) for (var l = i << 4 | e[i], u = t - e[i], d = o[e[i] - 1]++ << u, f = d | (1 << u) - 1; d <= f; ++d) s[bD[d] >> c] = l;
	} else for (s = new lD(r), i = 0; i < r; ++i) e[i] && (s[i] = bD[o[e[i] - 1]++] >> 15 - e[i]);
	return s;
}), wD = new cD(288), xD = 0; xD < 144; ++xD) wD[xD] = 8;
for (var xD = 144; xD < 256; ++xD) wD[xD] = 9;
for (var xD = 256; xD < 280; ++xD) wD[xD] = 7;
for (var xD = 280; xD < 288; ++xD) wD[xD] = 8;
for (var TD = new cD(32), xD = 0; xD < 32; ++xD) TD[xD] = 5;
var ED = /*#__PURE__*/ CD(wD, 9, 0), DD = /*#__PURE__*/ CD(TD, 5, 0), OD = function(e) {
	return (e + 7) / 8 | 0;
}, kD = function(e, t, n) {
	return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new cD(e.subarray(t, n));
}, AD = [
	"unexpected EOF",
	"invalid block type",
	"invalid length/literal",
	"invalid distance",
	"stream finished",
	"no stream handler",
	,
	"no callback",
	"invalid UTF-8 data",
	"extra field too long",
	"date not in range 1980-2099",
	"filename too long",
	"stream finishing",
	"invalid zip data"
], jD = function(e, t, n) {
	var r = Error(t || AD[e]);
	if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r, jD), !n) throw r;
	return r;
}, MD = function(e, t, n) {
	n <<= t & 7;
	var r = t / 8 | 0;
	e[r] |= n, e[r + 1] |= n >> 8;
}, ND = function(e, t, n) {
	n <<= t & 7;
	var r = t / 8 | 0;
	e[r] |= n, e[r + 1] |= n >> 8, e[r + 2] |= n >> 16;
}, PD = function(e, t) {
	for (var n = [], r = 0; r < e.length; ++r) e[r] && n.push({
		s: r,
		f: e[r]
	});
	var i = n.length, a = n.slice();
	if (!i) return {
		t: VD,
		l: 0
	};
	if (i == 1) {
		var o = new cD(n[0].s + 1);
		return o[n[0].s] = 1, {
			t: o,
			l: 1
		};
	}
	n.sort(function(e, t) {
		return e.f - t.f;
	}), n.push({
		s: -1,
		f: 25001
	});
	var s = n[0], c = n[1], l = 0, u = 1, d = 2;
	for (n[0] = {
		s: -1,
		f: s.f + c.f,
		l: s,
		r: c
	}; u != i - 1;) s = n[n[l].f < n[d].f ? l++ : d++], c = n[l != u && n[l].f < n[d].f ? l++ : d++], n[u++] = {
		s: -1,
		f: s.f + c.f,
		l: s,
		r: c
	};
	for (var f = a[0].s, r = 1; r < i; ++r) a[r].s > f && (f = a[r].s);
	var p = new lD(f + 1), m = FD(n[u - 1], p, 0);
	if (m > t) {
		var r = 0, h = 0, g = m - t, _ = 1 << g;
		for (a.sort(function(e, t) {
			return p[t.s] - p[e.s] || e.f - t.f;
		}); r < i; ++r) {
			var v = a[r].s;
			if (p[v] > t) h += _ - (1 << m - p[v]), p[v] = t;
			else break;
		}
		for (h >>= g; h > 0;) {
			var y = a[r].s;
			p[y] < t ? h -= 1 << t - p[y]++ - 1 : ++r;
		}
		for (; r >= 0 && h; --r) {
			var b = a[r].s;
			p[b] == t && (--p[b], ++h);
		}
		m = t;
	}
	return {
		t: new cD(p),
		l: m
	};
}, FD = function(e, t, n) {
	return e.s == -1 ? Math.max(FD(e.l, t, n + 1), FD(e.r, t, n + 1)) : t[e.s] = n;
}, ID = function(e) {
	for (var t = e.length; t && !e[--t];);
	for (var n = new lD(++t), r = 0, i = e[0], a = 1, o = function(e) {
		n[r++] = e;
	}, s = 1; s <= t; ++s) if (e[s] == i && s != t) ++a;
	else {
		if (!i && a > 2) {
			for (; a > 138; a -= 138) o(32754);
			a > 2 && (o(a > 10 ? a - 11 << 5 | 28690 : a - 3 << 5 | 12305), a = 0);
		} else if (a > 3) {
			for (o(i), --a; a > 6; a -= 6) o(8304);
			a > 2 && (o(a - 3 << 5 | 8208), a = 0);
		}
		for (; a--;) o(i);
		a = 1, i = e[s];
	}
	return {
		c: n.subarray(0, r),
		n: t
	};
}, LD = function(e, t) {
	for (var n = 0, r = 0; r < t.length; ++r) n += e[r] * t[r];
	return n;
}, RD = function(e, t, n) {
	var r = n.length, i = OD(t + 2);
	e[i] = r & 255, e[i + 1] = r >> 8, e[i + 2] = e[i] ^ 255, e[i + 3] = e[i + 1] ^ 255;
	for (var a = 0; a < r; ++a) e[i + a + 4] = n[a];
	return (i + 4 + r) * 8;
}, zD = function(e, t, n, r, i, a, o, s, c, l, u) {
	MD(t, u++, n), ++i[256];
	for (var d = PD(i, 15), f = d.t, p = d.l, m = PD(a, 15), h = m.t, g = m.l, _ = ID(f), v = _.c, y = _.n, b = ID(h), x = b.c, S = b.n, C = new lD(19), w = 0; w < v.length; ++w) ++C[v[w] & 31];
	for (var w = 0; w < x.length; ++w) ++C[x[w] & 31];
	for (var T = PD(C, 7), E = T.t, ee = T.l, te = 19; te > 4 && !E[pD[te - 1]]; --te);
	var ne = l + 5 << 3, D = LD(i, wD) + LD(a, TD) + o, O = LD(i, f) + LD(a, h) + o + 14 + 3 * te + LD(C, E) + 2 * C[16] + 3 * C[17] + 7 * C[18];
	if (c >= 0 && ne <= D && ne <= O) return RD(t, u, e.subarray(c, c + l));
	var k, A, j, re;
	if (MD(t, u, 1 + (O < D)), u += 2, O < D) {
		k = CD(f, p, 0), A = f, j = CD(h, g, 0), re = h;
		var ie = CD(E, ee, 0);
		MD(t, u, y - 257), MD(t, u + 5, S - 1), MD(t, u + 10, te - 4), u += 14;
		for (var w = 0; w < te; ++w) MD(t, u + 3 * w, E[pD[w]]);
		u += 3 * te;
		for (var ae = [v, x], oe = 0; oe < 2; ++oe) for (var M = ae[oe], w = 0; w < M.length; ++w) {
			var se = M[w] & 31;
			MD(t, u, ie[se]), u += E[se], se > 15 && (MD(t, u, M[w] >> 5 & 127), u += M[w] >> 12);
		}
	} else k = ED, A = wD, j = DD, re = TD;
	for (var w = 0; w < s; ++w) {
		var N = r[w];
		if (N > 255) {
			var se = N >> 18 & 31;
			ND(t, u, k[se + 257]), u += A[se + 257], se > 7 && (MD(t, u, N >> 23 & 31), u += dD[se]);
			var ce = N & 31;
			ND(t, u, j[ce]), u += re[ce], ce > 3 && (ND(t, u, N >> 5 & 8191), u += fD[ce]);
		} else ND(t, u, k[N]), u += A[N];
	}
	return ND(t, u, k[256]), u + A[256];
}, BD = /*#__PURE__*/ new uD([
	65540,
	131080,
	131088,
	131104,
	262176,
	1048704,
	1048832,
	2114560,
	2117632
]), VD = /*#__PURE__*/ new cD(0), HD = function(e, t, n, r, i, a) {
	var o = a.z || e.length, s = new cD(r + o + 5 * (1 + Math.ceil(o / 7e3)) + i), c = s.subarray(r, s.length - i), l = a.l, u = (a.r || 0) & 7;
	if (t) {
		u && (c[0] = a.r >> 3);
		for (var d = BD[t - 1], f = d >> 13, p = d & 8191, m = (1 << n) - 1, h = a.p || new lD(32768), g = a.h || new lD(m + 1), _ = Math.ceil(n / 3), v = 2 * _, y = function(t) {
			return (e[t] ^ e[t + 1] << _ ^ e[t + 2] << v) & m;
		}, b = new uD(25e3), x = new lD(288), S = new lD(32), C = 0, w = 0, T = a.i || 0, E = 0, ee = a.w || 0, te = 0; T + 2 < o; ++T) {
			var ne = y(T), D = T & 32767, O = g[ne];
			if (h[D] = O, g[ne] = D, ee <= T) {
				var k = o - T;
				if ((C > 7e3 || E > 24576) && (k > 423 || !l)) {
					u = zD(e, c, 0, b, x, S, w, E, te, T - te, u), E = C = w = 0, te = T;
					for (var A = 0; A < 286; ++A) x[A] = 0;
					for (var A = 0; A < 30; ++A) S[A] = 0;
				}
				var j = 2, re = 0, ie = p, ae = D - O & 32767;
				if (k > 2 && ne == y(T - ae)) for (var oe = Math.min(f, k) - 1, M = Math.min(32767, T), se = Math.min(258, k); ae <= M && --ie && D != O;) {
					if (e[T + j] == e[T + j - ae]) {
						for (var N = 0; N < se && e[T + N] == e[T + N - ae]; ++N);
						if (N > j) {
							if (j = N, re = ae, N > oe) break;
							for (var ce = Math.min(ae, N - 2), P = 0, A = 0; A < ce; ++A) {
								var F = T - ae + A & 32767, I = F - h[F] & 32767;
								I > P && (P = I, O = F);
							}
						}
					}
					D = O, O = h[D], ae += D - O & 32767;
				}
				if (re) {
					b[E++] = 268435456 | _D[j] << 18 | yD[re];
					var le = _D[j] & 31, ue = yD[re] & 31;
					w += dD[le] + fD[ue], ++x[257 + le], ++S[ue], ee = T + j, ++C;
				} else b[E++] = e[T], ++x[e[T]];
			}
		}
		for (T = Math.max(T, ee); T < o; ++T) b[E++] = e[T], ++x[e[T]];
		u = zD(e, c, l, b, x, S, w, E, te, T - te, u), l || (a.r = u & 7 | c[u / 8 | 0] << 3, u -= 7, a.h = g, a.p = h, a.i = T, a.w = ee);
	} else {
		for (var T = a.w || 0; T < o + l; T += 65535) {
			var de = T + 65535;
			de >= o && (c[u / 8 | 0] = l, de = o), u = RD(c, u + 1, e.subarray(T, de));
		}
		a.i = o;
	}
	return kD(s, 0, r + OD(u) + i);
}, UD = /*#__PURE__*/ (function() {
	for (var e = /* @__PURE__ */ new Int32Array(256), t = 0; t < 256; ++t) {
		for (var n = t, r = 9; --r;) n = (n & 1 && -306674912) ^ n >>> 1;
		e[t] = n;
	}
	return e;
})(), WD = function() {
	var e = -1;
	return {
		p: function(t) {
			for (var n = e, r = 0; r < t.length; ++r) n = UD[n & 255 ^ t[r]] ^ n >>> 8;
			e = n;
		},
		d: function() {
			return ~e;
		}
	};
}, GD = function(e, t, n, r, i) {
	if (!i && (i = { l: 1 }, t.dictionary)) {
		var a = t.dictionary.subarray(-32768), o = new cD(a.length + e.length);
		o.set(a), o.set(e, a.length), e = o, i.w = a.length;
	}
	return HD(e, t.level == null ? 6 : t.level, t.mem == null ? i.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(e.length))) * 1.5) : 20 : 12 + t.mem, n, r, i);
}, KD = function(e, t) {
	var n = {};
	for (var r in e) n[r] = e[r];
	for (var r in t) n[r] = t[r];
	return n;
}, qD = function(e, t, n) {
	for (; n; ++t) e[t] = n, n >>>= 8;
};
function JD(e, t) {
	return GD(e, t || {}, 0, 0);
}
var YD = function(e, t, n, r) {
	for (var i in e) {
		var a = e[i], o = t + i, s = r;
		Array.isArray(a) && (s = KD(r, a[1]), a = a[0]), ArrayBuffer.isView(a) ? n[o] = [a, s] : (n[o += "/"] = [new cD(0), s], YD(a, o, n, r));
	}
}, XD = typeof TextEncoder < "u" && /*#__PURE__*/ new TextEncoder(), ZD = typeof TextDecoder < "u" && /*#__PURE__*/ new TextDecoder();
try {
	ZD.decode(VD, { stream: !0 });
} catch {}
function QD(e, t) {
	if (t) {
		for (var n = new cD(e.length), r = 0; r < e.length; ++r) n[r] = e.charCodeAt(r);
		return n;
	}
	if (XD) return XD.encode(e);
	for (var i = e.length, a = new cD(e.length + (e.length >> 1)), o = 0, s = function(e) {
		a[o++] = e;
	}, r = 0; r < i; ++r) {
		if (o + 5 > a.length) {
			var c = new cD(o + 8 + (i - r << 1));
			c.set(a), a = c;
		}
		var l = e.charCodeAt(r);
		l < 128 || t ? s(l) : l < 2048 ? (s(192 | l >> 6), s(128 | l & 63)) : l > 55295 && l < 57344 ? (l = 65536 + (l & 1047552) | e.charCodeAt(++r) & 1023, s(240 | l >> 18), s(128 | l >> 12 & 63), s(128 | l >> 6 & 63), s(128 | l & 63)) : (s(224 | l >> 12), s(128 | l >> 6 & 63), s(128 | l & 63));
	}
	return kD(a, 0, o);
}
var $D = function(e) {
	var t = 0;
	if (e) for (var n in e) {
		var r = e[n].length;
		r > 65535 && jD(9), t += r + 4;
	}
	return t;
}, eO = function(e, t, n, r, i, a, o, s) {
	var c = r.length, l = n.extra, u = s && s.length, d = $D(l);
	qD(e, t, o == null ? 67324752 : 33639248), t += 4, o != null && (e[t++] = 20, e[t++] = n.os), e[t] = 20, t += 2, e[t++] = n.flag << 1 | (a < 0 && 8), e[t++] = i && 8, e[t++] = n.compression & 255, e[t++] = n.compression >> 8;
	var f = new Date(n.mtime == null ? Date.now() : n.mtime), p = f.getFullYear() - 1980;
	if ((p < 0 || p > 119) && jD(10), qD(e, t, p << 25 | f.getMonth() + 1 << 21 | f.getDate() << 16 | f.getHours() << 11 | f.getMinutes() << 5 | f.getSeconds() >> 1), t += 4, a != -1 && (qD(e, t, n.crc), qD(e, t + 4, a < 0 ? -a - 2 : a), qD(e, t + 8, n.size)), qD(e, t + 12, c), qD(e, t + 14, d), t += 16, o != null && (qD(e, t, u), qD(e, t + 6, n.attrs), qD(e, t + 10, o), t += 14), e.set(r, t), t += c, d) for (var m in l) {
		var h = l[m], g = h.length;
		qD(e, t, +m), qD(e, t + 2, g), e.set(h, t + 4), t += 4 + g;
	}
	return u && (e.set(s, t), t += u), t;
}, tO = function(e, t, n, r, i) {
	qD(e, t, 101010256), qD(e, t + 8, n), qD(e, t + 10, n), qD(e, t + 12, r), qD(e, t + 16, i);
};
function nO(e, t) {
	t ||= {};
	var n = {}, r = [];
	YD(e, "", n, t);
	var i = 0, a = 0;
	for (var o in n) {
		var s = n[o], c = s[0], l = s[1], u = l.level == 0 ? 0 : 8, d = QD(o), f = d.length, p = l.comment, m = p && QD(p), h = m && m.length, g = $D(l.extra);
		f > 65535 && jD(11);
		var _ = u ? JD(c, l) : c, v = _.length, y = WD();
		y.p(c), r.push(KD(l, {
			size: c.length,
			crc: y.d(),
			c: _,
			f: d,
			m,
			u: f != o.length || m && p.length != h,
			o: i,
			compression: u
		})), i += 30 + f + g + v, a += 76 + 2 * (f + g) + (h || 0) + v;
	}
	for (var b = new cD(a + 22), x = i, S = a - i, C = 0; C < r.length; ++C) {
		var d = r[C];
		eO(b, d.o, d, d.f, d.u, d.c.length);
		var w = 30 + d.f.length + $D(d.extra);
		b.set(d.c, d.o + w), eO(b, i, d, d.f, d.u, d.c.length, d.o, d.m), i += 16 + w + (d.m ? d.m.length : 0);
	}
	return tO(b, i, r.length, S, x), b;
}
//#endregion
//#region src/tier1/memFs.ts
function rO(e, t) {
	let n = /* @__PURE__ */ Error(`${e}: ${t}`);
	return n.code = e, n;
}
function iO(e) {
	let t = e.replace(/\\/g, "/").split("/").filter((e) => e && e !== "."), n = [];
	for (let e of t) e === ".." ? n.pop() : n.push(e);
	return "/" + n.join("/");
}
function aO(e) {
	return iO(e).replace(/\/[^/]*$/, "") || "/";
}
var oO = class {
	entry;
	size;
	constructor(e, t) {
		this.entry = e, this.size = t;
	}
	isFile() {
		return this.entry.type === "file";
	}
	isDirectory() {
		return this.entry.type === "dir";
	}
	isSymbolicLink() {
		return this.entry.type === "symlink";
	}
	get type() {
		return this.entry.type;
	}
	get mode() {
		return this.entry.type === "file" ? this.entry.mode : 511;
	}
	get mtimeMs() {
		return 0;
	}
	get ctimeMs() {
		return 0;
	}
	get uid() {
		return 1;
	}
	get gid() {
		return 1;
	}
	get dev() {
		return 1;
	}
	get ino() {
		return 1;
	}
};
function sO() {
	let e = /* @__PURE__ */ new Map([["/", { type: "dir" }]]), t = (t) => {
		let n = e.get(t);
		if (!n) throw rO("ENOENT", t);
		if (n.type !== "dir") throw rO("ENOTDIR", t);
	};
	return {
		promises: {
			async readFile(t, n) {
				let r = iO(t), i = e.get(r);
				if (!i) throw rO("ENOENT", r);
				if (i.type === "dir") throw rO("EISDIR", r);
				if (i.type === "symlink") throw rO("EINVAL", r);
				return (typeof n == "string" ? n : n?.encoding) === "utf8" ? new TextDecoder().decode(i.data) : i.data;
			},
			async writeFile(n, r, i) {
				let a = iO(n);
				t(aO(a));
				let o = typeof i == "object" && i?.mode ? i.mode : 420, s = typeof r == "string" ? new TextEncoder().encode(r) : new Uint8Array(r);
				e.set(a, {
					type: "file",
					data: s,
					mode: o
				});
			},
			async unlink(t) {
				let n = iO(t);
				if (!e.has(n)) throw rO("ENOENT", n);
				e.delete(n);
			},
			async readdir(n) {
				let r = iO(n);
				t(r);
				let i = r === "/" ? "/" : `${r}/`, a = /* @__PURE__ */ new Set();
				for (let t of e.keys()) t !== r && t.startsWith(i) && a.add(t.slice(i.length).split("/")[0]);
				return [...a];
			},
			async mkdir(n) {
				let r = iO(n);
				if (e.has(r)) throw rO("EEXIST", r);
				t(aO(r)), e.set(r, { type: "dir" });
			},
			async rmdir(n) {
				let r = iO(n);
				t(r), e.delete(r);
			},
			async stat(t) {
				let n = iO(t), r = e.get(n);
				if (r?.type === "symlink" && (r = e.get(iO(r.target))), !r) throw rO("ENOENT", n);
				let i = r.type === "file" ? r.data.byteLength : 0;
				return new oO(r, i);
			},
			async lstat(t) {
				let n = iO(t), r = e.get(n);
				if (!r) throw rO("ENOENT", n);
				return new oO(r, r.type === "file" ? r.data.byteLength : r.type === "symlink" ? r.target.length : 0);
			},
			async readlink(t) {
				let n = iO(t), r = e.get(n);
				if (!r) throw rO("ENOENT", n);
				if (r.type !== "symlink") throw rO("EINVAL", n);
				return r.target;
			},
			async symlink(n, r) {
				let i = iO(r);
				t(aO(i)), e.set(i, {
					type: "symlink",
					target: n
				});
			}
		},
		snapshot(t = "/") {
			let n = iO(t) === "/" ? "/" : `${iO(t)}/`, r = /* @__PURE__ */ new Map();
			for (let [t, i] of e) i.type === "file" && t.startsWith(n) && r.set(t.slice(n.length), i.data);
			return r;
		}
	};
}
//#endregion
//#region src/tier1/exportRepo.ts
var cO = {
	name: "RHA Wrapper (Tier 1)",
	email: "artifact@rha.software"
};
function lO(e) {
	let t = e.spec.title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "rha-artifact";
	return {
		"package.json": JSON.stringify({
			name: t,
			private: !0,
			type: "module",
			scripts: {
				test: "vitest run tests",
				typecheck: "tsc --noEmit"
			},
			devDependencies: {
				typescript: "^5.9.3",
				vitest: "^4.1.10"
			}
		}, null, 2) + "\n",
		"tsconfig.json": JSON.stringify({
			compilerOptions: {
				target: "ES2022",
				module: "ESNext",
				moduleResolution: "bundler",
				strict: !0,
				skipLibCheck: !0,
				types: ["vitest/globals"]
			},
			include: ["src", "tests"]
		}, null, 2) + "\n",
		"rha-spec.json": JSON.stringify(e.spec, null, 2) + "\n",
		"README.md": [
			`# ${e.spec.title}`,
			"",
			"Generated by the RHA Tier 1 runner (https://rha.software).",
			"",
			"The `tests/` suites are the frozen IR: they were generated from the spec",
			"BEFORE any implementation existed and define the behavioral contract.",
			"The git history mirrors the pipeline — spec, frozen IR, then one build",
			"commit per feature node (see the RHA-Node trailers).",
			"",
			"See `TRACEABILITY.md` for the case → export/edge → feature → prompt chains.",
			"",
			"```",
			"npm install",
			"npx vitest run   # execute the frozen contract",
			"```",
			""
		].join("\n"),
		"TRACEABILITY.md": uO(e)
	};
}
function uO(e) {
	let t = [
		`# TRACEABILITY — ${e.spec.title}`,
		"",
		"Each frozen IR case is licensed by a chain back to the user prompt.",
		"Unlicensed cases (if any) appear as problems on the run record.",
		""
	];
	e.contractVersion && t.push(`Harness contract version: \`${e.contractVersion}\``, ""), t.push(...Ku(e.deferred ?? []));
	let n = /* @__PURE__ */ new Map();
	for (let t of e.provenance ?? []) n.has(t.featureId) || n.set(t.featureId, []), n.get(t.featureId).push(t);
	if (!n.size) return t.push("_No provenance recorded for this run._", ""), t.join("\n");
	for (let [e, r] of n) {
		t.push(`## ${e}`), t.push("");
		for (let e of r) t.push(`- **${e.kind}:** \`${e.caseName}\``), t.push(`  - license ← \`${e.source}\`: ${e.license}`), t.push(`  - feature.description ← ${e.featureDescription}`), t.push(`  - prompt ← ${e.prompt.split("\n")[0].slice(0, 120)}`);
		t.push("");
	}
	return t.join("\n");
}
async function dO(e) {
	let t = sO(), n = "/repo", r = { promises: t.promises };
	await t.promises.mkdir(n), await sD.init({
		fs: r,
		dir: n,
		defaultBranch: "main"
	});
	let i = [], a = async (e) => {
		for (let [i, a] of Object.entries(e)) {
			let e = i.split("/");
			for (let r = 1; r < e.length; r++) {
				let i = `${n}/${e.slice(0, r).join("/")}`;
				await t.promises.mkdir(i).catch(() => {});
			}
			await t.promises.writeFile(`${n}/${i}`, a), await sD.add({
				fs: r,
				dir: n,
				filepath: i
			});
		}
	}, o = async (e) => {
		i.push(await sD.commit({
			fs: r,
			dir: n,
			message: e,
			author: cO
		}));
	}, s = e.supergit, c = s ? {
		".supergit/ledger.csv": s.csv,
		".supergit/graph.json": JSON.stringify(s.graph, null, 2),
		".supergit/spec.json": JSON.stringify(e.spec, null, 2)
	} : {};
	if (e.defectRegistry) {
		let t = e.defectRegistry, n = [];
		for (let e of t.occurrences) n.push(JSON.stringify({
			kind: "occurrence",
			...e
		}));
		for (let e of t.resolutions) n.push(JSON.stringify({
			kind: "resolution",
			...e
		}));
		for (let e of t.identities) n.push(JSON.stringify({
			kind: "identity",
			...e
		}));
		c[".supergit/defects.jsonl"] = n.join("\n") + (n.length ? "\n" : "");
	}
	if (e.actionLedger) {
		let t = e.actionLedger, n = [];
		for (let e of t.starts) n.push(JSON.stringify({
			ledgerKind: "start",
			...e
		}));
		for (let e of t.terminals) n.push(JSON.stringify({
			ledgerKind: "terminal",
			...e
		}));
		for (let e of t.decisions) n.push(JSON.stringify({
			ledgerKind: "decision",
			...e
		}));
		c[".supergit/actions.jsonl"] = n.join("\n") + (n.length ? "\n" : "");
	}
	let l = (e, t) => {
		let n = (s?.rows ?? []).filter((n) => n.type === e && (t == null || n.featureId === t));
		return n.length ? n[n.length - 1] : null;
	}, u = (e) => e ? `\nSupergit-Node: ${e.id}\nSupergit-Step: ${e.step}\nSupergit-Type: ${e.type}` : "", d = h(e.spec.features), f = {};
	for (let e of d) for (let t of e.stubs) f[t.path] = t.content;
	await a({
		...lO(e),
		...f,
		...c
	}), await o("encode: feature spec + interface stubs\n\nRHA-Phase: A" + u(l("decision")));
	let p = {};
	for (let t of e.frozenTests) p[t.path] = t.content;
	await a(p), await o(`ir: freeze ${e.frozenTests.length} test suites\n\nRHA-Phase: B` + u(l("test")));
	let m = new Map(e.files.map((e) => [e.path, e]));
	for (let e of d) {
		let t = {}, n = !1;
		for (let r of e.files) {
			let e = m.get(r);
			e && !e.content.includes("stub: not implemented") && (t[r] = e.content, n = !0);
		}
		n && (await a(t), await o(`build(${e.id}): ${e.name}\n\nRHA-Phase: C\nRHA-Node: ${e.id}` + u(l("code", e.id))));
	}
	return {
		fs: t,
		dir: n,
		commits: i
	};
}
function fO(e) {
	let t = {};
	for (let [n, r] of e.fs.snapshot(e.dir)) t[n] = r;
	return nO(t, { level: 6 });
}
async function pO(e) {
	return fO(await dO(e));
}
//#endregion
//#region src/core/llmCallLog.ts
function mO(e) {
	return e.toLocaleString("en-US");
}
function hO(e) {
	let t = [];
	e.candidate && t.push(`candidate ${e.candidate.n}/${e.candidate.k}`), e.temp != null && t.push(`t=${e.temp}`), e.attempt != null && t.push(`${e.attemptLabel ?? "attempt"} ${e.attempt}`);
	let n = t.length ? ` [${t.join(", ")}]` : "", r = e.inputTokens != null && e.outputTokens != null ? ` (${mO(e.inputTokens)}→ / ${mO(e.outputTokens)}← tok)` : "";
	return `llm call — ${e.stage}: ${e.purpose}${n}${r}`;
}
//#endregion
//#region src/core/stubScaffold.ts
var gO = {
	type: "array",
	items: {
		type: "object",
		additionalProperties: !1,
		required: [
			"path",
			"imports",
			"signatures"
		],
		properties: {
			path: { type: "string" },
			imports: {
				type: "array",
				items: {
					type: "object",
					additionalProperties: !1,
					required: ["from", "symbols"],
					properties: {
						from: { type: "string" },
						symbols: {
							type: "array",
							items: { type: "string" }
						}
					}
				}
			},
			signatures: {
				type: "array",
				items: {
					type: "object",
					additionalProperties: !1,
					required: [
						"symbol",
						"kind",
						"sig"
					],
					properties: {
						symbol: { type: "string" },
						kind: {
							type: "string",
							enum: [
								"function",
								"class",
								"interface",
								"type",
								"const"
							]
						},
						sig: { type: "string" }
					}
				}
			}
		}
	}
}, _O = "{ throw new Error('stub: not implemented'); }", vO = /^[A-Za-z_$][\w$]*$/;
function yO(e) {
	let t = 0, n = 0, r = 0;
	for (let i = 0; i < e.length; i++) {
		let a = e[i];
		if (a === "/" && e[i + 1] === "/") for (; i < e.length && e[i] !== "\n";) i++;
		else if (a === "/" && e[i + 1] === "*") {
			for (i += 2; i < e.length && !(e[i] === "*" && e[i + 1] === "/");) i++;
			i++;
		} else if (a === "'" || a === "\"" || a === "`") {
			let t = a;
			for (i++; i < e.length && e[i] !== t;) e[i] === "\\" && i++, i++;
		} else if (a === "(") t++;
		else if (a === ")") {
			if (--t < 0) return !1;
		} else if (a === "{") n++;
		else if (a === "}") {
			if (--n < 0) return !1;
		} else if (a === "[") r++;
		else if (a === "]" && --r < 0) return !1;
	}
	return t === 0 && n === 0 && r === 0;
}
function bO(e, t) {
	switch (t) {
		case "class": return `export class ${e} { constructor(...args: unknown[]) ${_O} }`;
		case "interface": return `export interface ${e} {}`;
		case "type": return `export type ${e} = unknown;`;
		case "const": return `export const ${e}: unknown = undefined;`;
		default: return `export function ${e}(...args: unknown[]): never ${_O}`;
	}
}
function xO(e) {
	let t = e.trim().replace(/^\{/, "").replace(/\}$/, ""), n = [], r = 0, i = "";
	for (let e of t) "({<[".includes(e) ? r++ : ")}>]".includes(e) && r--, e === ";" && r === 0 ? (i.trim() && n.push(i.trim()), i = "") : i += e;
	return i.trim() && n.push(i.trim()), n;
}
function SO(e, t) {
	let n = t.trim(), r = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), i = [
		/^export\s+/i,
		/^declare\s+/i,
		/^async\s+/i,
		/^(?:function|class|interface|type|const)\s+/i,
		RegExp(`^${r}\\s*`)
	], a = !0;
	for (; a;) {
		a = !1;
		for (let e of i) {
			let t = n.replace(e, "");
			t !== n && (n = t.trim(), a = !0);
		}
	}
	return n;
}
function CO(e) {
	if (!vO.test(e.symbol)) return "";
	let t = SO(e.symbol, e.sig ?? "");
	if (!t) return bO(e.symbol, e.kind);
	switch (e.kind) {
		case "function": return `export function ${e.symbol}${t} ${_O}`;
		case "class": {
			let n = xO(t).map((e) => /\(/.test(e.split(":")[0] ?? e) ? `  ${e} ${_O}` : `  declare ${e};`);
			return `export class ${e.symbol} {\n${n.join("\n")}\n}`;
		}
		case "interface": return `export interface ${e.symbol} ${t.startsWith("{") ? t : `{ ${t} }`}`;
		case "type": return `export type ${e.symbol} = ${t.replace(/^=\s*/, "").replace(/;$/, "")};`;
		case "const": return `export const ${e.symbol}: ${t.replace(/;$/, "")} = undefined as never;`;
	}
}
function wO(e) {
	let t = [];
	for (let n of e ?? []) {
		let e = (n.symbols ?? []).filter((e) => vO.test(e.trim())).map((e) => e.trim());
		if (!e.length) continue;
		let r = String(n.from ?? "").trim().replace(/\.ts$/, "");
		r && (r = r.replace(/^src\//, "./"), r.startsWith(".") || (r = `./${r}`), t.push(`import type { ${[...new Set(e)].join(", ")} } from '${r}';`));
	}
	return t;
}
function TO(e, t, n, r) {
	let i = `/** Interface stub for ${t} — ${e}. Harness-assembled; bodies throw until built. */`, a = wO(r?.imports).filter((e) => yO(e)), o = /* @__PURE__ */ new Set(), s = [];
	for (let e of r?.signatures ?? []) {
		let t = String(e.symbol ?? "").trim();
		if (!vO.test(t) || o.has(t)) continue;
		o.add(t);
		let n = CO({
			...e,
			symbol: t
		});
		s.push(n && yO(n) ? n : bO(t, e.kind ?? "function"));
	}
	for (let e of n) !vO.test(e) || o.has(e) || (o.add(e), s.push(bO(e, "function")));
	s.length || s.push("export {};");
	let c = [
		i,
		...a,
		"",
		...s,
		""
	].join("\n");
	return yO(c) || (c = [
		i,
		...[...o].map((e) => bO(e, "function")),
		""
	].join("\n")), c;
}
function EO(e, t) {
	let n = (e) => e.replace(/\\/g, "/").replace(/^\.\//, ""), r = /* @__PURE__ */ new Map();
	for (let e of t ?? []) e?.path && r.set(n(e.path), e);
	return (e.files ?? []).map((t) => {
		let i = n(t), a = (e.exports ?? []).filter((e) => n(e.file) === i).map((e) => e.symbol);
		return {
			path: i,
			content: TO(e.id, i, a, r.get(i))
		};
	});
}
function DO(e) {
	return (e ?? []).map((e) => ({
		...e,
		stubs: EO(e, e.stubs ?? [])
	}));
}
//#endregion
//#region src/core/lmsModels.ts
function OO(e) {
	let t = e;
	return Array.isArray(t?.models) ? t.models.filter((e) => typeof e?.key == "string").map((e) => {
		let t = Array.isArray(e.loaded_instances) ? e.loaded_instances : [], n = t.length > 0, r = t.map((e) => e?.status || e?.state || (e?.busy ? "busy" : void 0)).find(Boolean);
		return {
			id: e.key,
			loaded: n,
			type: e.type,
			status: r || e.status
		};
	}) : null;
}
function kO(e) {
	let t = e;
	if (!Array.isArray(t?.data)) return null;
	let n = t.data.filter((e) => typeof e?.id == "string" && typeof e?.state == "string");
	return n.length ? n.map((e) => ({
		id: e.id,
		loaded: e.state === "loaded",
		type: e.type,
		status: e.status || e.state
	})) : null;
}
function AO(e) {
	let t = e;
	return Array.isArray(t?.data) ? t.data.filter((e) => typeof e?.id == "string").map((e) => ({
		id: e.id,
		loaded: !1
	})) : null;
}
var jO = (e) => e.type === "embedding" || /embed/i.test(e.id);
function MO(e) {
	return e.filter((e) => e.loaded && !jO(e))[0]?.id ?? null;
}
async function NO(e, t) {
	try {
		let n = {};
		t && (n.Authorization = `Bearer ${t}`);
		let r = await fetch(e, {
			headers: n,
			signal: AbortSignal.timeout(4e3)
		});
		return r.ok ? await r.json() : null;
	} catch {
		return null;
	}
}
async function PO(e, t) {
	let n = e.replace(/\/v1\/?$/, "");
	for (let e of ["/api/v1/models", "/api/v0/models"]) {
		let r = await NO(`${n}${e}`, t);
		if (r == null) continue;
		let i = OO(r) ?? kO(r);
		if (i) {
			let e = MO(i);
			return e ? {
				id: e,
				source: "loaded"
			} : null;
		}
	}
	let r = await NO(`${e.replace(/\/$/, "")}/models`, t), i = (r == null ? null : AO(r))?.filter((e) => !jO(e))[0]?.id;
	return i ? {
		id: i,
		source: "first-listed"
	} : null;
}
var FO = /^(busy|generating|gen|predicting|running|in[_-]?progress)$/i;
function IO(e) {
	let t = e.filter((e) => !jO(e));
	if (!t.length) return "idle";
	for (let e of t) {
		let t = (e.status || "").trim();
		if (t && FO.test(t)) return "busy";
	}
	return "idle";
}
async function LO(e, t) {
	let n = e.replace(/\/v1\/?$/, ""), r = !1;
	for (let e of ["/api/v1/models", "/api/v0/models"]) {
		let i = await NO(`${n}${e}`, t);
		if (i == null) continue;
		r = !0;
		let a = OO(i) ?? kO(i);
		if (a) return IO(a);
	}
	let i = await NO(`${e.replace(/\/$/, "")}/models`, t);
	if (i != null) {
		r = !0;
		let e = AO(i);
		if (e) return IO(e);
	}
	return r ? "idle" : "unreachable";
}
//#endregion
//#region src/core/localLlm.ts
var RO = typeof process < "u" ? process.env : {}, zO = Number(RO.LOCAL_LLM_TIMEOUT_MS || 24e4), BO = Math.max(1, Number(RO.LOCAL_LLM_RETRIES || 4)), VO = RO.LOCAL_LLM_QUIET_MS, HO = 2, UO = 32, WO = (e) => new Promise((t) => setTimeout(t, e));
async function GO(e, t, n, r) {
	let i = "", a = 0, o = null;
	for (let s = 1; s <= BO; s++) {
		if (r?.aborted) throw Error("local LLM call aborted (desync reissue)");
		let c = new AbortController(), l = () => c.abort();
		r?.addEventListener("abort", l, { once: !0 });
		let u = setTimeout(() => c.abort(), zO);
		try {
			let d = await fetch(e, {
				...t,
				signal: c.signal
			});
			if (clearTimeout(u), r?.removeEventListener("abort", l), d.status >= 502 && d.status <= 504 && s < BO) i = `HTTP ${d.status}`;
			else return o != null && n?.(Cu(Date.now() - o)), {
				res: d,
				retries: a
			};
		} catch (e) {
			if (clearTimeout(u), r?.removeEventListener("abort", l), r?.aborted) throw Error("local LLM call aborted (desync reissue)");
			if (i = e instanceof Error ? e.name === "AbortError" ? `timeout after ${zO}ms` : e.message : String(e), s >= BO) break;
		}
		a += 1, o ??= Date.now(), n?.(Su(s, BO));
		let d = Math.min(8e3, 500 * 2 ** s);
		console.warn(`[localLlm] ${e} attempt ${s}/${BO} failed (${i}); retrying in ${d}ms`), await WO(d);
	}
	throw Error(`local LLM unreachable after ${BO} attempts: ${i}`);
}
var KO = class {
	onUsage;
	onDebug;
	baseURL;
	apiKey;
	modelOverride;
	modelPromise;
	onProviderEvent;
	isCancelled;
	isPaused;
	onPause;
	awaitResume;
	probeHost;
	quietProbeOverride;
	stageDurations = /* @__PURE__ */ new Map();
	lastOp = null;
	degradation = _u();
	ceiling;
	providerProblems = [];
	constructor(e, t, n) {
		this.onUsage = e, this.onDebug = t;
		let r = typeof process < "u" ? process.env : {};
		if (this.baseURL = (n?.baseURL || r.LOCAL_LLM_URL || "http://localhost:1234/v1").replace(/\/$/, ""), this.apiKey = n?.apiKey ?? r.LLM_API_KEY ?? "", this.modelOverride = n?.model ?? r.LOCAL_LLM_MODEL ?? "", this.modelPromise = this.resolveModel(), this.onProviderEvent = n?.onProviderEvent, this.isCancelled = n?.isCancelled, this.isPaused = n?.isPaused, this.onPause = n?.onPause, this.awaitResume = n?.awaitResume, this.probeHost = n?.probeHost ?? (() => LO(this.baseURL, this.apiKey || void 0)), n?.quietProbeMs == null ? VO != null && VO !== "" ? this.quietProbeOverride = Number(VO) || null : this.quietProbeOverride = null : this.quietProbeOverride = n.quietProbeMs, n?.seedStageDurations) for (let [e, t] of Object.entries(n.seedStageDurations)) t?.length && this.stageDurations.set(e, t.slice(-32));
		this.ceiling = yu({
			multiplier: n?.tokenCeilingMultiplier,
			estimate: n?.tokenHighWaterEstimate
		});
	}
	quietProbeMsFor(e) {
		if (this.quietProbeOverride != null) return this.quietProbeOverride;
		let t = this.stageDurations.get(e) ?? [];
		return Du(e, t.length ? mu(t) : null);
	}
	stageMedianMs(e) {
		let t = this.stageDurations.get(e) ?? [];
		return t.length < 3 ? null : mu(t);
	}
	recordStageDuration(e, t) {
		if (!Number.isFinite(t) || t <= 0) return;
		let n = this.stageDurations.get(e);
		n || (n = [], this.stageDurations.set(e, n)), n.push(t), n.length > UO && n.shift();
	}
	hangTarget(e, t) {
		return (e && e.trim() || t || "call").replace(/\s+/g, " ").trim().slice(0, 48);
	}
	maybeEmitHang(e, t, n, r) {
		let i = this.stageMedianMs(e);
		i == null || i <= 0 || n <= 3 * i || this.emit(Ou(e, t, n, r));
	}
	authHeaders() {
		return this.apiKey ? { Authorization: `Bearer ${this.apiKey}` } : {};
	}
	emit(e) {
		this.onProviderEvent?.(e);
	}
	async resolveModel() {
		if (this.modelOverride) return this.modelOverride;
		let e = await PO(this.baseURL, this.apiKey || void 0);
		if (!e) throw Error(`no model loaded on ${this.baseURL} — load one in LM Studio (RHA follows the loaded model), or set an explicit model override in Provider Vault`);
		return e.id;
	}
	async waitIfPaused() {
		for (; this.isPaused?.();) {
			if (this.isCancelled?.()) throw Error("cancelled by user");
			this.awaitResume ? await this.awaitResume() : await WO(500);
		}
	}
	async attemptFetch(e, t, n) {
		let r = new AbortController(), i = Date.now(), a = "", o = !1, s = () => {
			(async () => {
				if (r.signal.aborted) return;
				let e = Date.now() - i;
				if (e < n) return;
				let t = "unreachable";
				try {
					t = await this.probeHost();
				} catch {
					t = "unreachable";
				}
				let s = xu(t, e);
				s !== a && (a = s, this.emit(s)), t === "idle" && (o = !0, r.abort());
			})();
		}, c = setTimeout(s, n), l = setInterval(s, Math.min(3e4, Math.max(500, n))), u = () => {
			clearTimeout(c), clearInterval(l);
		};
		try {
			let { res: t, retries: n } = await GO(`${this.baseURL}/chat/completions`, {
				method: "POST",
				headers: {
					"Content-Type": "application/json",
					...this.authHeaders()
				},
				body: JSON.stringify(e)
			}, this.onProviderEvent, r.signal);
			return u(), {
				kind: "ok",
				res: t,
				retries: n
			};
		} catch (e) {
			u();
			let t = Date.now() - i;
			if (o || r.signal.aborted && t >= n) return {
				kind: "desync",
				quietMs: t
			};
			throw e;
		} finally {
			u();
		}
	}
	async call(e, t, n, r, i, a, o) {
		if (await this.waitIfPaused(), this.isCancelled?.()) throw Error("cancelled by user");
		this.lastOp != null && this.lastOp !== e && !o?.bypassStageSpacing && (this.emit(`stage-transition spacing applied (${this.lastOp}→${e})`), await WO(250)), this.lastOp = e;
		let s = o?.temperature, c = o?.purpose ?? a, l = this.hangTarget(t, c), u = await this.modelPromise, d = this.quietProbeMsFor(e), f = Date.now(), p = {
			model: u,
			messages: [{
				role: "system",
				content: n
			}, {
				role: "user",
				content: r
			}],
			response_format: {
				type: "json_schema",
				json_schema: {
					name: e,
					strict: !0,
					schema: i
				}
			},
			stream: !1,
			...s == null ? {} : { temperature: s }
		}, m = 0, h = 0, g = null;
		try {
			for (;;) {
				if (await this.waitIfPaused(), this.isCancelled?.()) throw Error("cancelled by user");
				let e = await this.attemptFetch(p, h, d);
				if (e.kind === "ok") {
					g = e.res, m += e.retries;
					break;
				}
				if (h += 1, h > HO) throw Error(`provider desync persisted after ${HO} reissues (${gu(e.quietMs)})`);
			}
			if (!g.ok) {
				let e = await g.text().catch(() => "");
				throw Error(`Local LLM ${g.status}: ${e.slice(0, 300)}`);
			}
			let i = await g.json(), a = i.choices?.[0]?.message?.content;
			if (!a) throw Error("Local LLM returned empty content");
			let _ = Date.now() - f, v = h > 0 ? "reissue" : "completed";
			this.maybeEmitHang(e, l, _, v), h === 0 && this.recordStageDuration(e, _);
			let y = i.usage?.prompt_tokens ?? 0, b = i.usage?.completion_tokens ?? 0, x = hu(y, b, _), S = vu(this.degradation, x);
			S && (this.emit(S), S.startsWith("provider degraded:") && this.providerProblems.push(S));
			let C = bu(this.ceiling, y + b);
			C.message && this.emit(C.message), C.pause && this.onPause?.();
			let w = hO({
				stage: e,
				purpose: c,
				candidate: o?.candidate,
				temp: s,
				attempt: o?.attempt,
				attemptLabel: o?.attemptLabel,
				inputTokens: y,
				outputTokens: b
			});
			return this.onUsage?.({
				ts: (/* @__PURE__ */ new Date()).toISOString(),
				op: e,
				featureId: t,
				model: i.model ?? u,
				ms: _,
				inputTokens: y,
				outputTokens: b,
				cacheReadTokens: 0,
				cacheWriteTokens: 0,
				tokensPerSec: Math.round(x * 10) / 10,
				retries: m,
				reissues: h,
				purpose: c,
				candidate: o?.candidate,
				attempt: o?.attempt,
				attemptLabel: o?.attemptLabel,
				logLine: w
			}), this.onDebug?.({
				ts: (/* @__PURE__ */ new Date()).toISOString(),
				op: e,
				featureId: t,
				model: i.model ?? u,
				temperature: s ?? null,
				ms: _,
				inputTokens: y,
				outputTokens: b,
				system: n,
				user: r,
				schemaName: e,
				responseRaw: a
			}), JSON.parse(a);
		} catch (t) {
			let n = Date.now() - f, r = t instanceof Error ? t.message : String(t), i = this.isCancelled?.() === !0 || /cancelled by user/i.test(r) ? "cancelled" : h > 0 ? "reissue" : "completed";
			throw this.maybeEmitHang(e, l, n, i), t;
		}
	}
	async enumerateFeatures(e, t) {
		return (await this.call("encode", null, S_, C_(e), ZO, "enumerate features", t)).features;
	}
	async probeFeature(e, t) {
		return this.call("encode", null, w_, T_(e.name, e.scope), QO, `probe "${e.name}"`, t);
	}
	async encodeFeatures(e, t, n) {
		let r = await this.call("encode", null, E_, D_(e, t), qO, t ? "encode features (stub feedback)" : "encode features", n);
		return {
			title: r.title,
			prompt: e,
			features: DO(r.features)
		};
	}
	async repairFeatures(e, t, n, r) {
		return DO((await this.call("encode", null, O_, k_(e, t, n), JO, `repair features [${t.join(", ")}]`, r)).features ?? []);
	}
	async fixStub(e, t, n) {
		return (await this.call("fixStub", null, A_, j_(e, t), XO, `fix stub ${e}`, n)).content;
	}
	async generateTests(e, t, n, r) {
		let i = await this.call("ir", t.id, M_, N_(e, t, n), YO, `fallback fill ${t.id}`, r);
		return {
			content: O(t, i.imports, i.cases),
			parts: {
				imports: i.imports,
				cases: i.cases
			}
		};
	}
	async fixTestCases(e, t, n, r, i, a) {
		let o = await this.call("ir", t.id, R_, z_(e, t, n, r, i, a?.avoid), YO, `fill ${n.map((e) => `"${e.name}"`).join(", ")}`, a);
		return {
			imports: o.imports,
			cases: o.cases
		};
	}
	async generateImplementation(e, t, n, r, i) {
		return (await this.call("build", t.id, B_, V_(e, t, n, r, i?.avoid, i?.context), $O, t.files.join(", "), i)).files;
	}
	async repair(e, t) {
		return (await this.call("repair", e.feature.id, H_, U_(e), $O, e.findings[0]?.bugClass ?? "all", t)).files;
	}
	async drawConcept(e, t, n) {
		return Tl((await this.call("concept", t.id, W_, G_(e, t), ek, `concept ${t.id}`, {
			...n,
			temperature: n?.temperature ?? 1.1
		})).concept ?? "");
	}
	async judgeRuling(e, t) {
		let n = [
			"You are ruling on ONE under-determined test expectation. The evidence card is complete;",
			"no other context exists. Choose exactly one action:",
			"amend — the implementation behavior is right; the case should accept it.",
			"direct — the expectation is right but unlicensed; supply the ONE missing intent line.",
			"drop — the case cannot be adjudicated; remove it (coverage reduced, honest).",
			"Return JSON only."
		].join(" "), r = await this.call("judge", null, n, e, rk, "judgment ruling", {
			...t,
			temperature: t?.temperature ?? 0
		});
		return `ACTION: ${r.action ?? ""}\nINTENT: ${r.intent ?? ""}`;
	}
	async watchEpoch(e, t) {
		let n = await this.call("watch", null, Qf, e, tk, "state of the union", {
			...t,
			temperature: t?.temperature ?? .2,
			bypassStageSpacing: !0
		});
		return [
			...(n.idioms ?? []).map((e) => `IDIOM: ${e}`),
			...(n.tropes ?? []).map((e) => `TROPE: ${e}`),
			...(n.schemes ?? []).map((e) => `SCHEME: ${e}`),
			n.union ? `UNION: ${n.union}` : ""
		].filter(Boolean).join("\n");
	}
	async observe(e, t, n) {
		return ((await this.call("watch", null, t, e, nk, "observation poll", {
			...n,
			temperature: n?.temperature ?? .2
		})).items ?? []).filter((e) => e?.subject && e?.claim).map((e) => `ITEM: ${e.subject} — ${e.claim}`).join("\n");
	}
	async vanillaDraw(e) {
		let t = [
			"You are a coding assistant. Produce a complete TypeScript library from the user prompt.",
			"Return JSON only. Include working implementation files AND your own vitest test files.",
			"Do not omit tests. Prefer small, self-contained modules under src/ and tests/."
		].join(" ");
		return this.call("vanilla", null, t, e, ik, "single draw");
	}
}, qO = {
	type: "object",
	additionalProperties: !1,
	required: ["title", "features"],
	properties: {
		title: { type: "string" },
		features: {
			type: "array",
			items: {
				type: "object",
				additionalProperties: !1,
				required: [
					"id",
					"name",
					"description",
					"parentId",
					"deps",
					"files",
					"testFile",
					"edgeCases",
					"exports",
					"envVars",
					"stubs"
				],
				properties: {
					id: { type: "string" },
					name: { type: "string" },
					description: { type: "string" },
					parentId: { anyOf: [{ type: "string" }, { type: "null" }] },
					deps: {
						type: "array",
						items: { type: "string" }
					},
					files: {
						type: "array",
						items: { type: "string" }
					},
					testFile: { type: "string" },
					edgeCases: {
						type: "array",
						items: { type: "string" }
					},
					exports: {
						type: "array",
						items: {
							type: "object",
							additionalProperties: !1,
							required: ["file", "symbol"],
							properties: {
								file: { type: "string" },
								symbol: { type: "string" }
							}
						}
					},
					envVars: {
						type: "array",
						items: { type: "string" }
					},
					stubs: gO
				}
			}
		}
	}
}, JO = {
	type: "object",
	additionalProperties: !1,
	required: ["features"],
	properties: { features: qO.properties.features }
}, YO = {
	type: "object",
	additionalProperties: !1,
	required: ["imports", "cases"],
	properties: {
		imports: {
			type: "array",
			items: {
				type: "object",
				additionalProperties: !1,
				required: ["from", "symbols"],
				properties: {
					from: { type: "string" },
					symbols: {
						type: "array",
						items: { type: "string" }
					}
				}
			}
		},
		cases: {
			type: "array",
			items: {
				type: "object",
				additionalProperties: !1,
				required: [
					"name",
					"kind",
					"body"
				],
				properties: {
					name: { type: "string" },
					kind: {
						type: "string",
						enum: [
							"behavior",
							"edge",
							"integration"
						]
					},
					body: { type: "string" }
				}
			}
		}
	}
}, XO = {
	type: "object",
	additionalProperties: !1,
	required: ["content"],
	properties: { content: { type: "string" } }
}, ZO = {
	type: "object",
	additionalProperties: !1,
	required: ["features"],
	properties: { features: {
		type: "array",
		items: {
			type: "object",
			additionalProperties: !1,
			required: ["name", "scope"],
			properties: {
				name: { type: "string" },
				scope: { type: "string" }
			}
		}
	} }
}, QO = {
	type: "object",
	additionalProperties: !1,
	required: [
		"clear",
		"assertion",
		"question"
	],
	properties: {
		clear: { type: "boolean" },
		assertion: { type: "string" },
		question: { type: "string" }
	}
}, $O = {
	type: "object",
	additionalProperties: !1,
	required: ["files"],
	properties: { files: {
		type: "array",
		items: {
			type: "object",
			additionalProperties: !1,
			required: ["path", "content"],
			properties: {
				path: { type: "string" },
				content: { type: "string" }
			}
		}
	} }
}, ek = {
	type: "object",
	additionalProperties: !1,
	required: ["concept"],
	properties: { concept: { type: "string" } }
}, tk = {
	type: "object",
	additionalProperties: !1,
	required: [
		"idioms",
		"tropes",
		"schemes",
		"union"
	],
	properties: {
		idioms: {
			type: "array",
			items: { type: "string" }
		},
		tropes: {
			type: "array",
			items: { type: "string" }
		},
		schemes: {
			type: "array",
			items: { type: "string" }
		},
		union: { type: "string" }
	}
}, nk = {
	type: "object",
	additionalProperties: !1,
	required: ["items"],
	properties: { items: {
		type: "array",
		items: {
			type: "object",
			additionalProperties: !1,
			required: ["subject", "claim"],
			properties: {
				subject: { type: "string" },
				claim: { type: "string" }
			}
		}
	} }
}, rk = {
	type: "object",
	additionalProperties: !1,
	required: ["action", "intent"],
	properties: {
		action: {
			type: "string",
			enum: [
				"amend",
				"direct",
				"drop"
			]
		},
		intent: { type: "string" }
	}
}, ik = {
	type: "object",
	additionalProperties: !1,
	required: [
		"title",
		"files",
		"tests"
	],
	properties: {
		title: { type: "string" },
		files: $O.properties.files,
		tests: $O.properties.files
	}
};
//#endregion
//#region src/core/netHost.ts
function ak(e) {
	return (e.trim().replace(/^https?:\/\//i, "").split("/")[0] || "").toLowerCase();
}
function ok(e) {
	if (e.startsWith("[")) {
		let t = e.indexOf("]");
		return t >= 0 ? e.slice(1, t) : e;
	}
	return e.includes(":") && e.split(":").length === 2 || /^\d+\.\d+\.\d+\.\d+:\d+$/.test(e) ? e.split(":")[0] : e;
}
function sk(e) {
	let t = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(e);
	if (!t) return null;
	let n = [
		Number(t[1]),
		Number(t[2]),
		Number(t[3]),
		Number(t[4])
	];
	return n.some((e) => e > 255) ? null : n;
}
function ck(e) {
	let t = ok(ak(e));
	if (!t) return !1;
	if (t === "localhost" || t === "::1" || t === "0:0:0:0:0:0:0:1" || t.endsWith(".local")) return !0;
	let n = sk(t);
	return n ? n[0] === 127 || n[0] === 10 || n[0] === 172 && n[1] >= 16 && n[1] <= 31 || n[0] === 192 && n[1] === 168 : !1;
}
//#endregion
//#region src/tier1/pricing.ts
function lk(e) {
	let t = e.trim().toLowerCase(), n = t.lastIndexOf("/");
	n >= 0 && (t = t.slice(n + 1)), t = t.replace(/:free$/i, "");
	let r = t.indexOf(":");
	return r >= 0 && (t = t.slice(0, r)), t = t.replace(/-it$/i, ""), t;
}
function uk(e, t) {
	if (!e?.trim()) return {
		matched: !1,
		reason: "price unavailable for (empty model)"
	};
	if (t[e]) return {
		matched: !0,
		id: e,
		price: t[e],
		how: "exact"
	};
	let n = lk(e);
	if (!n) return {
		matched: !1,
		reason: `price unavailable for ${e}`
	};
	let r = [];
	for (let e of Object.keys(t)) lk(e) === n && r.push(e);
	return r.length === 1 ? {
		matched: !0,
		id: r[0],
		price: t[r[0]],
		how: "normalized"
	} : (r.length, {
		matched: !1,
		reason: `price unavailable for ${e}`
	});
}
function dk(e) {
	if (e.privateHost === !0 || e.baseURL && ck(e.baseURL)) return {
		kind: "local",
		label: "$0.00 (local compute)",
		usdTotal: 0,
		usdIn: 0,
		usdOut: 0
	};
	let t = uk(e.modelId, e.table);
	if (!t.matched) return {
		kind: "unavailable",
		label: t.reason,
		usdTotal: null,
		usdIn: null,
		usdOut: null
	};
	let n = e.tokensIn * t.price.promptUsdPerTok, r = e.tokensOut * t.price.completionUsdPerTok;
	return {
		kind: "estimated",
		label: `estimated $${(n + r).toFixed(4)}`,
		usdTotal: n + r,
		usdIn: n,
		usdOut: r,
		matchedId: t.id
	};
}
var fk = [
	{
		key: "claude",
		label: "Claude",
		test: (e) => /^anthropic\/claude-/i.test(e)
	},
	{
		key: "chatgpt",
		label: "ChatGPT",
		test: (e) => /^openai\/gpt-/i.test(e)
	},
	{
		key: "gemini",
		label: "Gemini",
		test: (e) => /^google\/gemini-/i.test(e)
	},
	{
		key: "grok",
		label: "Grok",
		test: (e) => /^x-ai\/grok-/i.test(e)
	},
	{
		key: "kimi",
		label: "Kimi",
		test: (e) => /^moonshotai\/kimi-/i.test(e)
	},
	{
		key: "glm",
		label: "Z.ai GLM",
		test: (e) => /^z-ai\/glm-/i.test(e)
	},
	{
		key: "deepseek",
		label: "DeepSeek",
		test: (e) => /^deepseek\/deepseek-/i.test(e)
	},
	{
		key: "qwen",
		label: "Qwen",
		test: (e) => /^qwen\/qwen/i.test(e)
	}
];
function pk(e) {
	return !!(/:free\b/i.test(e) || /:[a-z0-9_-]+$/i.test(e) || /-it$/i.test(e.split("/").pop() || ""));
}
function mk(e) {
	let t = [];
	for (let n of fk) {
		let r = null;
		for (let [t, i] of Object.entries(e)) {
			if (!n.test(t) || pk(t)) continue;
			let e = i.created ?? 0;
			(!r || e > r.created || e === r.created && t > r.id) && (r = {
				id: t,
				price: i,
				created: e
			});
		}
		r && t.push({
			key: n.key,
			label: n.label,
			id: r.id,
			price: r.price
		});
	}
	return t;
}
function hk(e, t, n) {
	return mk(n).map((n) => {
		let r = e * n.price.promptUsdPerTok, i = t * n.price.completionUsdPerTok;
		return {
			label: n.label,
			id: n.id,
			usdTotal: r + i,
			usdIn: r,
			usdOut: i
		};
	});
}
function gk(e, t = 4) {
	return e == null || !Number.isFinite(e) ? "—" : e === 0 ? "$0.00" : Math.abs(e) < 1e-4 ? `$${e.toExponential(2)}` : `$${e.toFixed(t)}`;
}
function _k(e) {
	if (e.feed.unavailable || !e.feed.table || !Object.keys(e.feed.table).length) return null;
	let t = dk({
		modelId: e.modelId,
		tokensIn: e.tokensIn,
		tokensOut: e.tokensOut,
		table: e.feed.table,
		baseURL: e.baseURL,
		privateHost: e.privateHost
	}), n = t.kind === "local" ? [] : hk(e.tokensIn, e.tokensOut, e.feed.table), r = `prices: openrouter.ai @ ${e.feed.fetchedAt}${e.feed.stale ? " — stale" : ""}`;
	return {
		kind: t.kind,
		label: t.label,
		usdTotal: t.usdTotal,
		usdIn: t.usdIn,
		usdOut: t.usdOut,
		matchedId: t.matchedId,
		modelId: e.modelId,
		tokensIn: e.tokensIn,
		tokensOut: e.tokensOut,
		comparative: n,
		provenance: r,
		fetchedAt: e.feed.fetchedAt,
		stale: e.feed.stale
	};
}
//#endregion
//#region src/tier1/vanilla.ts
function vk(e) {
	return typeof e.vanillaDraw == "function";
}
function yk(e) {
	return {
		elapsedMs: 0,
		passesTotal: 0,
		passesPerFeature: {},
		repairDraws: 0,
		freshDraws: 0,
		irSurgeries: 0,
		irGenAttempts: 0,
		mechanicalFixes: 0,
		catalogDriftMechanicalFixes: 0,
		regexLiteralGateHeals: 0,
		bornRedStubDerivedDrops: 0,
		substrateAttempts: 0,
		substrateFixes: 0,
		substrateRefusals: 0,
		substrateNoHandler: 0,
		substrateEditsApplied: 0,
		deterministicEditsOutsideSubstrate: 0,
		substrateFillHits: 0,
		substrateFillEscalations: 0,
		substrateFillEmptyMechanisms: 0,
		substrateFillVacuousMechanisms: 0,
		overreachBodyRejections: 0,
		templatedCases: 0,
		permutationDraws: 0,
		permutationWins: 0,
		permBatches: 0,
		permCandidates: 0,
		permImproved: 0,
		superbufferDraws: 0,
		superbufferWins: 0,
		conceptDraws: 0,
		parsePoisonIncidents: 0,
		bugsObserved: 0,
		bugsPatched: 0,
		bugsRemaining: 0,
		artifactFaults: 0,
		artifactFaultsRemaining: 0,
		artifactFaultsAffectedFeatures: 0,
		featuresTotal: 0,
		featuresFrozenWithoutRedraw: 0,
		irRedraws: 0,
		nodesTotal: 0,
		nodesBuildable: 0,
		nodesBuilt: 0,
		nodesBuiltCleanFirstPass: 0,
		boundedLoopNodes: 0,
		boundedLoopIterations: 0,
		candidatesDrawn: 0,
		candidatesAccepted: 0,
		fillCandidatesDrawn: 0,
		repairCandidatesDrawn: 0,
		fillCandidatesAccepted: 0,
		repairCandidatesAccepted: 0,
		salvagedCases: 0,
		sickRedCases: 0,
		testRhaSubstrateFixes: 0,
		testRhaDraws: 0,
		testRhaSuperbufferAssemblies: 0,
		testRhaDrawThrew: 0,
		testRhaDraftRejected: 0,
		testRhaDraftAcceptedCleared: 0,
		testRhaDraftAcceptedStillSick: 0,
		testRhaSkippedNoHandle: 0,
		testRhaSkippedAlreadyRedrawn: 0,
		testRhaCaseExhausted: 0,
		testRhaCaseCleared: 0,
		irSurgeriesInRha: 0,
		reEnqueuedCases: 0,
		recoveredCases: 0,
		l2Draws: 0,
		l2Wins: 0,
		l2Bullseyes: 0,
		fixesL1: 0,
		fixesL2: 0,
		fixesL3: 0,
		fixesL4: 0,
		corpseRejections: 0,
		classifyAttempts: 0,
		classifyCataloged: 0,
		grammarConformant: 0,
		grammarFallbacks: 0,
		shellLockApplied: 0,
		shellLockFallbacks: 0,
		judgmentGates: 0,
		judgmentOperator: 0,
		judgmentLlm: 0,
		judgmentDropped: 0,
		watcherSyntheses: 0,
		watcherReadings: 0,
		watcherObservations: 0,
		watcherCacheHits: 0,
		watcherCacheMisses: 0,
		watcherWorldStaleSkips: 0,
		corpseRejectionCeilingBreaches: 0,
		watcherEngineFailures: 0,
		observatoryEngineFailures: 0,
		nodeRepairDraws: 0,
		nodeRepairWins: 0,
		observationPolls: 0,
		observationsNew: 0,
		observationsCorroborated: 0,
		stubRouteShortcuts: 0,
		observatoryPollsSkipped: 0,
		l2ShortCircuits: 0,
		quarantineSuspensions: 0,
		errorsTotal: 0,
		errorsParse: 0,
		errorsConformance: 0,
		errorsExecution: 0,
		errorsCrash: 0,
		findingOccurrencesTotal: 0,
		findingOccurrencesParse: 0,
		findingOccurrencesConformance: 0,
		findingOccurrencesExecution: 0,
		findingOccurrencesCrash: 0,
		findingOccurrencesTestFailure: 0,
		uniqueDefectsObserved: 0,
		uniqueDefectsResolved: 0,
		uniqueDefectsUnresolved: 0,
		actionStarts: 0,
		actionTerminals: 0,
		actionDecisions: 0,
		actionPending: 0,
		actionFailed: 0,
		actionFailedNonfatal: 0,
		deferredTotal: 0,
		deferredRelitigated: 0,
		deferredResolvedAfterRelitigation: 0,
		deferredPermanent: 0,
		nodesHealed: 0,
		fixesUnsuccessful: 0,
		fixesUnparseable: 0,
		...e,
		watcherInfusedCandidates: e?.watcherInfusedCandidates ?? 0
	};
}
function bk(e, t) {
	let n = t.files.filter((e) => !/\.test\.(ts|js)$/.test(e.path) && !e.path.startsWith("tests/")), r = t.tests.length ? t.tests : t.files.filter((e) => /\.test\.(ts|js)$/.test(e.path) || e.path.startsWith("tests/")), i = n.length ? n.map((e) => e.path) : ["src/index.ts"], a = r[0]?.path || "tests/vanilla.test.ts";
	return {
		title: t.title || "Vanilla artifact",
		prompt: e,
		features: [{
			id: "V1",
			name: "vanilla",
			description: e.slice(0, 240) || "vanilla single-draw implementation",
			parentId: null,
			deps: [],
			files: i,
			testFile: a,
			edgeCases: [],
			envVars: [],
			exports: [],
			stubs: i.map((e) => ({
				path: e,
				content: n.find((t) => t.path === e)?.content ?? "export {};\n"
			}))
		}]
	};
}
function xk(e) {
	let { prompt: t, spec: n, files: r, tests: i, failures: a } = e, o = 0, s = 0;
	for (let e of a) {
		let t = th(e.name, e.message);
		o++;
		for (let e of i) if (Dh(t, r, e, n)) {
			s++;
			break;
		}
	}
	let c = 0;
	for (let e of n.features) try {
		let r = uu(n, e), i = e.edgeCases?.length ? e.edgeCases : t.split(/\n/).map((e) => e.trim()).filter(Boolean).slice(0, 8);
		c += s_(r, i).templated;
	} catch {}
	let l = `substrate would have: classified ${o}/${a.length}, mechanically fixed ${s}, template-prevented ${c}`;
	return {
		failuresTotal: a.length,
		classified: o,
		mechanicalWouldFix: s,
		templatePrevented: c,
		summary: l
	};
}
async function Sk(e) {
	let t = Date.now(), n = [], r = (t, r, i) => {
		let a = {
			ts: (/* @__PURE__ */ new Date()).toISOString(),
			phase: t,
			featureId: r,
			message: i
		};
		n.push(a), e.onEvent?.(a);
	};
	if (!vk(e.llm)) throw Error("LLM client does not support vanillaDraw");
	if (r("build", null, "vanilla: single draw (no scaffolding, no harness contract, no repair)"), e.isCancelled?.()) throw Error("cancelled by user");
	let i = await e.llm.vanillaDraw(e.prompt);
	r("build", null, `vanilla draw complete — ${i.files.length} impl file(s), ${i.tests.length} test file(s)`);
	let a = i.files.filter((e) => !e.path.startsWith("tests/") && !/\.test\.(ts|js)$/.test(e.path)), o = i.tests.length ? i.tests : i.files.filter((e) => e.path.startsWith("tests/") || /\.test\.(ts|js)$/.test(e.path)), s = a.length ? a : i.files.filter((e) => !o.includes(e)), c = o.length ? o : [], l = bk(e.prompt, {
		title: i.title,
		files: s,
		tests: c
	}), u = ug(e.prompt), d = [], f = [], p = 0;
	if (!c.length) d.push("vanilla: model returned no tests"), r("auth", null, "vanilla: no tests to execute");
	else if (!e.runSuite) d.push("vanilla: no suite runner — tests not executed");
	else {
		r("auth", null, "vanilla: executing model's own tests");
		for (let t of c) {
			if (e.isCancelled?.()) throw Error("cancelled by user");
			let n = await e.runSuite(s, t);
			n.crashed && (f.push({
				name: "__suite__",
				message: n.crashed
			}), d.push(`vanilla suite crashed (${t.path}): ${n.crashed}`), p++);
			for (let e of n.failures ?? []) f.push({
				name: e.name,
				message: e.message
			}), d.push(`${t.path}: ${e.name}: ${e.message}`), p++;
			r("auth", "V1", `${t.path}: ${n.total - (n.failures?.length ?? 0)}/${n.total} passing`);
		}
	}
	let m = xk({
		prompt: e.prompt,
		spec: l,
		files: s,
		tests: c,
		failures: f
	});
	r("done", null, m.summary);
	let h = yk({
		elapsedMs: Date.now() - t,
		bugsObserved: p,
		bugsPatched: 0,
		bugsRemaining: p,
		freshDraws: 1
	});
	return e.onMetrics?.(h), {
		mode: "vanilla",
		spec: l,
		files: s,
		frozenTests: c,
		problems: d,
		metrics: h,
		log: n,
		provenance: [],
		deferred: u,
		counterfactual: m,
		refereeCostUsd: null
	};
}
//#endregion
//#region src/tier1/persistSafe.ts
var Ck = "run record missing (persist failed or never saved)";
function wk(e) {
	return `persist failed: ${(e || "unknown").trim() || "unknown"}`;
}
function Tk(e) {
	return `record checkpointed through ${(e || "").trim() || "unknown"} — finalization failed`;
}
function Ek(e) {
	return !e || e.finalized === !0 ? !1 : !!(e.status === "interrupted" || e.status === "running" || e.running || e.checkpointAt && e.finalized === !1);
}
function Dk(e) {
	let t = /* @__PURE__ */ new WeakSet();
	return JSON.parse(JSON.stringify(e, (e, n) => {
		if (typeof n == "bigint") return String(n);
		if (n instanceof Map) return Object.fromEntries(n);
		if (n instanceof Set) return [...n];
		if (typeof n == "object" && n) {
			if (t.has(n)) return null;
			t.add(n);
		}
		return n;
	}));
}
function Ok(e) {
	return e.isCurrent ? e.running ? "starting…" : Ck : e.recordMissing ? Ck : "no events saved for this epoch";
}
function kk(e) {
	if (typeof e != "object" || !e) return {
		ok: !1,
		error: "no ACK (null response)"
	};
	let t = e;
	return typeof t.error == "string" && t.error ? {
		ok: !1,
		error: t.error
	} : t.ok !== !0 || t.ack !== !0 || typeof t.id != "string" || !t.id ? {
		ok: !1,
		error: "ACK missing ok/ack/id"
	} : {
		ok: !0,
		ack: !0,
		id: t.id,
		eventCount: typeof t.eventCount == "number" ? t.eventCount : void 0,
		status: typeof t.status == "string" ? t.status : null,
		checkpointAt: typeof t.checkpointAt == "string" ? t.checkpointAt : null,
		bytes: typeof t.bytes == "number" ? t.bytes : void 0
	};
}
function Ak(e, t) {
	let n = Array.isArray(e?.events) ? e.events : [], r = Array.isArray(t.events) ? t.events : [], i = r.length >= n.length ? r : n;
	return {
		...e || {},
		...t,
		events: i
	};
}
function jk(e) {
	let t = (/* @__PURE__ */ new Date()).toISOString();
	return {
		id: e.id,
		ts: e.ts || t,
		startedAt: e.startedAt ?? null,
		model: e.model ?? null,
		mode: e.mode || "rha",
		projectId: e.projectId ?? null,
		parentId: e.parentId ?? null,
		promptHash: e.promptHash ?? null,
		status: e.status || "interrupted",
		error: e.error ?? null,
		title: e.title || "(persist fallback)",
		events: [],
		result: null,
		finalized: !1,
		running: !1,
		fallback: !0
	};
}
function Mk(e, t) {
	let n = (t || "").trim();
	return n ? `persist:${e} — ${n}` : `persist:${e}`;
}
//#endregion
//#region src/tier1/entry.ts
var Nk = globalThis;
Nk.Buffer === void 0 && (Nk.Buffer = p.Buffer);
//#endregion
export { fk as COST_FAMILIES, Fv as DEFAULT_CORPUS_BASE, Bl as FORMAT_STRING_CLADE, pd as GATE_UNAVAILABLE, P_ as HARNESS_CONTRACT_SYSTEM, KO as LocalLlmClient, Vl as PAGINATION_CLADE, cl as REPAIR_ORACLE, zl as RESPONSE_SHAPE_CLADE, Ck as RUN_RECORD_MISSING, Ov as TIER1_DEFAULT_GATES, Dl as assembleSuperbuffer, Eh as attemptMechanicalFix, lh as attemptSpecConstantConformance, qd as attributeEvalCrash, jk as buildMinimalFallbackRecord, dO as buildRepo, pO as buildRepoZip, _k as buildRunCostSnapshot, od as buildTestProgram, tu as caseFamily, th as classifyFailure, Dk as cloneSafeForPersist, hk as comparativeCosts, F_ as composeEncodePrompt, Tm as conformExportsToStubs, xk as counterfactualSubstrate, Gm as crashRepairPrecondition, vm as diffExportsVsStubs, jl as draftCladePromotion, Ok as emptyPipelineLogLabel, dk as estimateCost, eu as extractDroppedCaseNames, yl as extractSpecConstants, Lv as fetchCorpus, lg as findPromptLineNumber, Tk as formatCheckpointHeader, Ml as formatCladeCandidateMessage, Xu as formatClassKeyCoverageRule, xp as formatJudgmentPrompt, wk as formatPersistFailed, Mk as formatPersistStep, ul as formatRepairOracleHint, Yu as formatSubstrateHitRate, gk as formatUsd, kl as freeformPatternKey, tg as hasAssertableStructure, Ek as isCheckpointedUnfinalized, Hm as isCrashClass, ck as isPrivateHost, kp as isScaffoldOwnedSymbol, ll as lookupRepairOracle, Md as makeEvalSuiteRunner, uk as matchPricing, gg as mergeLessons, Ak as mergePersistRecord, bl as nameTokenOverlap, Wm as normalizeCrashSignature, lk as normalizeModelId, yh as ownerFileForSymbol, pm as parseExportedFunctions, Sp as parseLlmRuling, kk as parsePersistAck, Gh as parserGuidedImplRepair, mk as pickFamilyRefs, Kh as polishParseCrashContent, Id as probeErrOrNull, Pd as probeModuleEval, Fd as probeModuleEvalAsync, Wd as probeWholeArtifactEval, Cd as programParseErrorAsync, Lg as promoteLessonsToHandlerCandidates, dg as promptHasVerifiableResidue, Xm as refusesImplRedrawForOwnedSymbol, qm as refusesModelDraw, fO as repoToZip, Pv as runTier1Job, Sk as runVanillaJob, Op as scaffoldOwnershipMap, ug as scanCapabilities, iu as scanRecurringFailures, vh as scanTopLevelDeclarations, rh as selectMechanicalCandidate, bd as setModuleEvalProbe, vd as setProgramParseProbe, Al as shouldProposeCladePromotion, xl as signatureSimilarity, bk as specFromVanilla, bh as stripTopLevelDecl, dd as vetArtifactWritesAsync, Ed as vetProgramParseAfterWriteAsync, Np as wireSuiteScaffoldImports };
