//#region ../../node_modules/.pnpm/liquidjs@10.27.0/node_modules/liquidjs/dist/liquid.browser.mjs
var e = class {
	constructor(e, t, n, r, i) {
		this.kind = e, this.input = t, this.begin = n, this.end = r, this.file = i;
	}
	getText() {
		return this.input.slice(this.begin, this.end);
	}
	getPosition() {
		let [e, t] = [1, 1];
		for (let n = 0; n < this.begin; n++) this.input[n] === "\n" ? (e++, t = 1) : t++;
		return [e, t];
	}
	size() {
		return this.end - this.begin;
	}
}, t = class {
	liquidMethodMissing(e, t) {}
}, n = Object.prototype.toString, r = String.prototype.toLowerCase, i = Object.hasOwnProperty;
function a(e) {
	return typeof e == "string";
}
function o(e) {
	return typeof e == "function";
}
function s(e) {
	return e && o(e.then);
}
function c(e) {
	return e && o(e.next) && o(e.throw) && o(e.return);
}
function l(e) {
	return e = f(e), a(e) ? e : p(e) ? "" : m(e) ? e.map((e) => l(e)).join("") : String(e);
}
function u(e) {
	return e = f(e), m(e) ? e : a(e) && e.length > 0 ? [e] : ae(e) ? Array.from(e) : h(e) ? Object.keys(e).map((t) => [t, e[t]]) : [];
}
function d(e) {
	return e = f(e), p(e) ? [] : m(e) ? e : [e];
}
function f(e) {
	return e instanceof t && o(e.valueOf) ? e.valueOf() : e;
}
function ee(e) {
	return +f(e) || 0;
}
function te(e) {
	return typeof e == "number";
}
function ne(e) {
	return e && o(e.toLiquid) ? ne(e.toLiquid()) : e;
}
function p(e) {
	return e == null;
}
function re(e) {
	return e === void 0;
}
function m(e) {
	return n.call(e) === "[object Array]";
}
function ie(e) {
	return e && te(e.length);
}
function ae(e) {
	return h(e) && Symbol.iterator in e;
}
function oe(e, t) {
	e ||= {};
	for (let n in e) if (i.call(e, n) && t(e[n], n, e) === !1) break;
	return e;
}
function se(e) {
	return e[e.length - 1];
}
function h(e) {
	let t = typeof e;
	return e !== null && (t === "object" || t === "function");
}
function ce(e, t, n = 1) {
	let r = [];
	for (let i = e; i < t; i += n) r.push(i);
	return r;
}
function g(e, t, n = " ") {
	return ue(e, t, n, (e, t) => t + e);
}
function le(e, t, n = " ") {
	return ue(e, t, n, (e, t) => e + t);
}
function ue(e, t, n, r) {
	e = String(e);
	let i = t - e.length;
	return i <= 0 ? e : r(e, n.repeat(i));
}
function de(e) {
	return e;
}
function fe(e) {
	return [...e].some((e) => e >= "a" && e <= "z") ? e.toUpperCase() : e.toLowerCase();
}
function pe(e, t) {
	return e.length > t ? e.slice(0, t - 3) + "..." : e;
}
function me(e, t) {
	return p(e) && p(t) ? 0 : p(e) ? 1 : p(t) || e < t ? -1 : +(e > t);
}
function he(e, t) {
	return p(e) && p(t) ? 0 : p(e) ? 1 : p(t) || (e = r.call(e), t = r.call(t), e < t) ? -1 : +(e > t);
}
function _(e) {
	return function(...t) {
		return e.call(this, ...t.map(f));
	};
}
function v(e) {
	return function(...t) {
		return e.call(this, ...t.map(ee));
	};
}
function* ge(e) {
	let t = /* @__PURE__ */ new Set();
	for (let n of e) {
		let e = JSON.stringify(n);
		t.has(e) || (t.add(e), yield n);
	}
}
var _e = "__liquidClass__", y = class extends Error {
	constructor(e, t) {
		super(typeof e == "string" ? e : e.message), this.context = "", typeof e != "string" && Object.defineProperty(this, "originalError", {
			value: e,
			enumerable: !1
		}), Object.defineProperty(this, "token", {
			value: t,
			enumerable: !1
		}), Object.defineProperty(this, _e, {
			value: "LiquidError",
			enumerable: !1
		});
	}
	update() {
		Object.defineProperty(this, "context", {
			value: Te(this.token),
			enumerable: !1
		}), this.message = Ee(this.message, this.token), this.stack = this.message + "\n" + this.context + "\n" + this.stack, this.originalError && (this.stack += "\nFrom " + this.originalError.stack);
	}
	static is(e) {
		return e?.[_e] === "LiquidError";
	}
}, ve = class extends y {
	constructor(e, t) {
		super(e, t), this.name = "TokenizationError", super.update();
	}
}, ye = class extends y {
	constructor(e, t) {
		super(e, t), this.name = "ParseError", this.message = e.message, super.update();
	}
}, be = class extends y {
	constructor(e, t) {
		super(e, t.token), this.name = "RenderError", this.message = e.message, super.update();
	}
	static is(e) {
		return e.name === "RenderError";
	}
}, xe = class extends y {
	constructor(e) {
		super(e[0], e[0].token), this.errors = e, this.name = "LiquidErrors";
		let t = e.length > 1 ? "s" : "";
		this.message = `${e.length} error${t} found`, super.update();
	}
	static is(e) {
		return e.name === "LiquidErrors";
	}
}, Se = class extends y {
	constructor(e, t) {
		super(e, t), this.name = "UndefinedVariableError", this.message = e.message, super.update();
	}
}, Ce = class extends Error {
	constructor(e) {
		super(`undefined variable: ${e}`), this.name = "InternalUndefinedVariableError", this.variableName = e;
	}
}, we = class extends Error {
	constructor(e) {
		super(e), this.name = "AssertionError", this.message = e + "";
	}
};
function Te(e) {
	let [t, n] = e.getPosition(), r = e.input.split("\n"), i = Math.max(t - 2, 1), a = Math.min(t + 3, r.length);
	return ce(i, a + 1).map((e) => {
		let i = `${e === t ? ">> " : "   "}${g(String(e), String(a).length)}| `, o = e === t ? "\n" + g("^", n + i.length) : "";
		return i += r[e - 1], i += o, i;
	}).join("\n");
}
function Ee(e, t) {
	t.file && (e += `, file:${t.file}`);
	let [n, r] = t.getPosition();
	return e += `, line:${n}, col:${r}`, e;
}
var b = [
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	20,
	4,
	4,
	4,
	20,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	20,
	2,
	8,
	0,
	0,
	0,
	0,
	8,
	0,
	0,
	0,
	64,
	0,
	65,
	0,
	0,
	33,
	33,
	33,
	33,
	33,
	33,
	33,
	33,
	33,
	33,
	0,
	0,
	2,
	2,
	2,
	1,
	0,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	0,
	0,
	0,
	0,
	1,
	0,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	1,
	0,
	0,
	0,
	0,
	0
], De = 1, x = 4, Oe = 8, ke = 16, Ae = 32, je = 64, Me = 128;
function S(e) {
	let t = e.charCodeAt(0);
	return t >= 128 ? !b[t] : !!(b[t] & De);
}
b[160] = b[5760] = b[6158] = b[8192] = b[8193] = b[8194] = b[8195] = b[8196] = b[8197] = b[8198] = b[8199] = b[8200] = b[8201] = b[8202] = b[8232] = b[8233] = b[8239] = b[8287] = b[12288] = x, b[8220] = b[8221] = Me;
function C(e, t) {
	if (!e) throw new we(typeof t == "function" ? t() : t || `expect ${e} to be true`);
}
function w(e, t = `unexpected ${JSON.stringify(e)}`) {
	C(!e, t);
}
var Ne = class extends t {
	equals(e) {
		return p(f(e));
	}
	gt() {
		return !1;
	}
	geq() {
		return !1;
	}
	lt() {
		return !1;
	}
	leq() {
		return !1;
	}
	valueOf() {
		return null;
	}
}, Pe = class e extends t {
	equals(t) {
		return t instanceof e ? !1 : (t = f(t), a(t) || m(t) ? t.length === 0 : h(t) ? Object.keys(t).length === 0 : !1);
	}
	gt() {
		return !1;
	}
	geq() {
		return !1;
	}
	lt() {
		return !1;
	}
	leq() {
		return !1;
	}
	valueOf() {
		return "";
	}
	static is(t) {
		return t instanceof e;
	}
}, Fe = class e extends Pe {
	equals(e) {
		return e === !1 || p(f(e)) ? !0 : a(e) ? /^\s*$/.test(e) : super.equals(e);
	}
	static is(t) {
		return t instanceof e;
	}
}, Ie = class extends t {
	constructor(e, t, n) {
		super(), this.i = 0, this.length = e, this.name = `${n}-${t}`;
	}
	next() {
		this.i++;
	}
	index0() {
		return this.i;
	}
	index() {
		return this.i + 1;
	}
	first() {
		return this.i === 0;
	}
	last() {
		return this.i === this.length - 1;
	}
	rindex() {
		return this.length - this.i;
	}
	rindex0() {
		return this.length - this.i - 1;
	}
	valueOf() {
		return JSON.stringify(this);
	}
}, Le = class {
	constructor() {
		this.buffer = "";
	}
	write(e) {
		this.buffer += l(e);
	}
}, Re = class {
	constructor() {
		throw this.buffer = "", this.stream = null, Error("streaming not supported in browser");
	}
}, ze = class {
	constructor() {
		this.buffer = "";
	}
	write(e) {
		e = f(e), typeof e != "string" && this.buffer === "" ? this.buffer = e : this.buffer = l(this.buffer) + l(e);
	}
}, Be = class extends t {
	constructor(e = () => "") {
		super(), this.superBlockRender = e;
	}
	*super() {
		let e = new Le();
		return yield this.superBlockRender(e), e.buffer;
	}
};
function T(e) {
	return e && o(e.equals) && o(e.gt) && o(e.geq) && o(e.lt) && o(e.leq);
}
var Ve = new Ne(), He = {
	true: !0,
	false: !1,
	nil: Ve,
	null: Ve,
	empty: new Pe(),
	blank: new Fe()
};
function Ue(e) {
	let t = {};
	for (let [n, r] of Object.entries(e)) {
		let e = t;
		for (let t = 0; t < n.length; t++) {
			let r = n[t];
			e[r] = e[r] || {}, t === n.length - 1 && S(n[t]) && (e[r].needBoundary = !0), e = e[r];
		}
		e.data = r, e.end = !0;
	}
	return t;
}
var We = function() {
	return We = Object.assign || function(e) {
		for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
		return e;
	}, We.apply(this, arguments);
};
function E(e, t, n, r) {
	function i(e) {
		return e instanceof n ? e : new n(function(t) {
			t(e);
		});
	}
	return new (n ||= Promise)(function(n, a) {
		function o(e) {
			try {
				c(r.next(e));
			} catch (e) {
				a(e);
			}
		}
		function s(e) {
			try {
				c(r.throw(e));
			} catch (e) {
				a(e);
			}
		}
		function c(e) {
			e.done ? n(e.value) : i(e.value).then(o, s);
		}
		c((r = r.apply(e, t || [])).next());
	});
}
function Ge(e, t) {
	let n = t || e;
	return (t, ...r) => t ? n(...r) : e(...r);
}
function D(e) {
	return E(this, void 0, void 0, function* () {
		if (!c(e)) return e;
		let t, n = !1, r = "next";
		do {
			let i = e[r](t);
			n = i.done, t = i.value, r = "next";
			try {
				c(t) && (t = D(t)), s(t) && (t = yield t);
			} catch (e) {
				r = "throw", t = e;
			}
		} while (!n);
		return t;
	});
}
function O(e) {
	if (!c(e)) return e;
	let t, n = !1, r = "next";
	do {
		let i = e[r](t);
		if (n = i.done, t = i.value, r = "next", c(t)) try {
			t = O(t);
		} catch (e) {
			r = "throw", t = e;
		}
	} while (!n);
	return t;
}
var Ke = /%([-_0^#:]+)?(\d+)?([EO])?(.)/;
function qe(e) {
	return [
		31,
		Xe(e) ? 29 : 28,
		31,
		30,
		31,
		30,
		31,
		31,
		30,
		31,
		30,
		31
	];
}
function Je(e) {
	let t = 0;
	for (let n = 0; n < e.getMonth(); ++n) t += qe(e)[n];
	return t + e.getDate();
}
function Ye(e, t) {
	let n = Je(e) + (t - e.getDay()), r = 7 - new Date(e.getFullYear(), 0, 1).getDay() + t;
	return String(Math.floor((n - r) / 7) + 1);
}
function Xe(e) {
	let t = e.getFullYear();
	return !!(!(t & 3) && (t % 100 || t % 400 == 0 && t));
}
function Ze(e) {
	let t = e.getDate();
	if ([
		11,
		12,
		13
	].includes(t)) return "th";
	switch (t % 10) {
		case 1: return "st";
		case 2: return "nd";
		case 3: return "rd";
		default: return "th";
	}
}
function Qe(e) {
	return parseInt(e.getFullYear().toString().substring(0, 2), 10);
}
var $e = {
	d: 2,
	e: 2,
	H: 2,
	I: 2,
	j: 3,
	k: 2,
	l: 2,
	L: 3,
	m: 2,
	M: 2,
	S: 2,
	U: 2,
	W: 2
}, et = /* @__PURE__ */ new Set("aAbBceklpP");
function tt(e, t) {
	let n = Math.abs(e.getTimezoneOffset()), r = Math.floor(n / 60), i = n % 60;
	return (e.getTimezoneOffset() > 0 ? "-" : "+") + g(r, 2, "0") + (t.flags[":"] ? ":" : "") + g(i, 2, "0");
}
var nt = {
	a: (e) => e.getShortWeekdayName(),
	A: (e) => e.getLongWeekdayName(),
	b: (e) => e.getShortMonthName(),
	B: (e) => e.getLongMonthName(),
	c: (e) => e.toLocaleString(),
	C: (e) => Qe(e),
	d: (e) => e.getDate(),
	e: (e) => e.getDate(),
	H: (e) => e.getHours(),
	I: (e) => String(e.getHours() % 12 || 12),
	j: (e) => Je(e),
	k: (e) => e.getHours(),
	l: (e) => String(e.getHours() % 12 || 12),
	L: (e) => e.getMilliseconds(),
	m: (e) => e.getMonth() + 1,
	M: (e) => e.getMinutes(),
	N: (e, t) => {
		var n;
		let r = Number(t.width) || 9, i = String(e.getMilliseconds()).slice(0, r);
		return (n = t.memoryLimit) == null || n.use(r - i.length), le(i, r, "0");
	},
	p: (e) => e.getHours() < 12 ? "AM" : "PM",
	P: (e) => e.getHours() < 12 ? "am" : "pm",
	q: (e) => Ze(e),
	s: (e) => Math.round(e.getTime() / 1e3),
	S: (e) => e.getSeconds(),
	u: (e) => e.getDay() || 7,
	U: (e) => Ye(e, 0),
	w: (e) => e.getDay(),
	W: (e) => Ye(e, 1),
	x: (e) => e.toLocaleDateString(),
	X: (e) => e.toLocaleTimeString(),
	y: (e) => e.getFullYear().toString().slice(2, 4),
	Y: (e) => e.getFullYear(),
	z: tt,
	Z: (e, t) => e.getTimeZoneName() || tt(e, t),
	t: () => "	",
	n: () => "\n",
	"%": () => "%"
};
nt.h = nt.b;
function rt(e, t, n) {
	let r = "", i = t, a;
	for (; a = Ke.exec(i);) r += i.slice(0, a.index), i = i.slice(a.index + a[0].length), r += it(e, a, n);
	return r + i;
}
function it(e, t, n) {
	let [r, i = "", a, o, s] = t, c = nt[s];
	if (!c) return r;
	let l = {};
	for (let e of i) l[e] = !0;
	let u = String(c(e, {
		flags: l,
		width: a,
		modifier: o,
		memoryLimit: n
	})), d = et.has(s) ? " " : "0", f = a || $e[s] || 0;
	return l["^"] ? u = u.toUpperCase() : l["#"] && (u = fe(u)), l._ ? d = " " : l[0] && (d = "0"), l["-"] && (f = 0), n?.use(Number(f) - u.length), g(u, f, d);
}
function at() {
	return typeof Intl < "u" ? Intl.DateTimeFormat : void 0;
}
var ot = 6e4, st = /([zZ]|([+-])(\d{2}):?(\d{2}))$/, ct = [
	"January",
	"February",
	"March",
	"April",
	"May",
	"June",
	"July",
	"August",
	"September",
	"October",
	"November",
	"December"
], lt = ct.map((e) => e.slice(0, 3)), ut = [
	"Sunday",
	"Monday",
	"Tuesday",
	"Wednesday",
	"Thursday",
	"Friday",
	"Saturday"
], dt = ut.map((e) => e.slice(0, 3)), k = class e {
	constructor(t, n, r) {
		this.locale = n, this.DateTimeFormat = at(), this.date = new Date(t), this.timezoneFixed = r !== void 0, r === void 0 && (r = this.date.getTimezoneOffset()), this.timezoneOffset = a(r) ? e.getTimezoneOffset(r, this.date) : r, this.timezoneName = a(r) ? r : "";
		let i = (this.date.getTimezoneOffset() - this.timezoneOffset) * ot, o = this.date.getTime() + i;
		this.displayDate = new Date(o);
	}
	getTime() {
		return this.displayDate.getTime();
	}
	getMilliseconds() {
		return this.displayDate.getMilliseconds();
	}
	getSeconds() {
		return this.displayDate.getSeconds();
	}
	getMinutes() {
		return this.displayDate.getMinutes();
	}
	getHours() {
		return this.displayDate.getHours();
	}
	getDay() {
		return this.displayDate.getDay();
	}
	getDate() {
		return this.displayDate.getDate();
	}
	getMonth() {
		return this.displayDate.getMonth();
	}
	getFullYear() {
		return this.displayDate.getFullYear();
	}
	toLocaleString(e, t) {
		return t?.timeZone ? this.date.toLocaleString(e, t) : this.displayDate.toLocaleString(e, t);
	}
	toLocaleTimeString(e) {
		return this.displayDate.toLocaleTimeString(e);
	}
	toLocaleDateString(e) {
		return this.displayDate.toLocaleDateString(e);
	}
	getTimezoneOffset() {
		return this.timezoneOffset;
	}
	getTimeZoneName() {
		if (this.timezoneFixed) return this.timezoneName;
		if (this.DateTimeFormat) return this.DateTimeFormat().resolvedOptions().timeZone;
	}
	getLongMonthName() {
		return this.format({ month: "long" }) ?? ct[this.getMonth()];
	}
	getShortMonthName() {
		return this.format({ month: "short" }) ?? lt[this.getMonth()];
	}
	getLongWeekdayName() {
		return this.format({ weekday: "long" }) ?? ut[this.displayDate.getDay()];
	}
	getShortWeekdayName() {
		return this.format({ weekday: "short" }) ?? dt[this.displayDate.getDay()];
	}
	valid() {
		return !isNaN(this.getTime());
	}
	format(e) {
		return this.DateTimeFormat && this.DateTimeFormat(this.locale, e).format(this.displayDate);
	}
	static createDateFixedToTimezone(t, n) {
		let r = t.match(st);
		if (r && r[1] === "Z") return new e(+new Date(t), n, 0);
		if (r && r[2] && r[3] && r[4]) {
			let [, , i, a, o] = r, s = (i === "+" ? -1 : 1) * (parseInt(a, 10) * 60 + parseInt(o, 10));
			return new e(+new Date(t), n, s);
		}
		return new e(t, n);
	}
	static getTimezoneOffset(e, t) {
		let n = t.toLocaleString("en-US", { timeZone: e }), r = t.toLocaleString("en-US", { timeZone: "UTC" }), i = new Date(n);
		return (new Date(r) - +i) / (60 * 1e3);
	}
}, ft = class {
	constructor(e, t) {
		this.base = 0, this.message = `${e} limit exceeded`, this.limit = t;
	}
	use(e) {
		+e > 0 && (C(this.base + +e <= this.limit, this.message), this.base += +e);
	}
	check(e) {
		+e > 0 && C(+e <= this.limit, this.message);
	}
}, pt = class extends e {
	constructor(e, [t, n], r, i, a, o, s, c) {
		super(e, r, i, a, c), this.trimLeft = !1, this.trimRight = !1;
		let l = r[t] === "-", u = r[n - 1] === "-", d = l ? t + 1 : t, f = u ? n - 1 : n;
		for (; d < f && b[r.charCodeAt(d)] & x;) d++;
		for (; f > d && b[r.charCodeAt(f - 1)] & x;) f--;
		this.contentRange = [d, f], this.trimLeft = l || o, this.trimRight = u || s;
	}
	get content() {
		return this.input.slice(this.contentRange[0], this.contentRange[1]);
	}
}, mt = class extends pt {
	constructor(e, t, n, r, i) {
		let { trimTagLeft: a, trimTagRight: o, tagDelimiterLeft: s, tagDelimiterRight: c } = r, [l, u] = [t + s.length, n - c.length];
		super(q.Tag, [l, u], e, t, n, a, o, i), this.tokenizer = new I(e, r.operators, i, this.contentRange), this.name = this.tokenizer.readTagName(), this.tokenizer.assert(this.name, "illegal tag syntax, tag name expected"), this.tokenizer.skipBlank(), this.args = this.tokenizer.input.slice(this.tokenizer.p, this.contentRange[1]);
	}
}, ht = class extends pt {
	constructor(e, t, n, r, i) {
		let { trimOutputLeft: a, trimOutputRight: o, outputDelimiterLeft: s, outputDelimiterRight: c } = r, l = [t + s.length, n - c.length];
		super(q.Output, l, e, t, n, a, o, i);
	}
}, gt = class extends e {
	constructor(e, t, n, r) {
		super(q.HTML, e, t, n, r), this.input = e, this.begin = t, this.end = n, this.file = r, this.trimLeft = 0, this.trimRight = 0;
	}
	getContent() {
		return this.input.slice(this.begin + this.trimLeft, this.end - this.trimRight);
	}
}, _t = class extends e {
	constructor(e, t, n, r) {
		super(q.Number, e, t, n, r), this.input = e, this.begin = t, this.end = n, this.file = r, this.content = Number(this.getText());
	}
}, vt = class extends e {
	constructor(e, t, n, r) {
		super(q.Word, e, t, n, r), this.input = e, this.begin = t, this.end = n, this.file = r, this.content = this.getText();
	}
}, yt = class extends e {
	constructor(e, t, n, r) {
		super(q.Literal, e, t, n, r), this.input = e, this.begin = t, this.end = n, this.file = r, this.literal = this.getText(), this.content = He[this.literal];
	}
}, bt = {
	"==": 2,
	"!=": 2,
	">": 2,
	"<": 2,
	">=": 2,
	"<=": 2,
	contains: 2,
	not: 1,
	and: 0,
	or: 0
}, xt = {
	"==": 0,
	"!=": 0,
	">": 0,
	"<": 0,
	">=": 0,
	"<=": 0,
	contains: 0,
	not: 1,
	and: 0,
	or: 0
}, St = class extends e {
	constructor(e, t, n, r) {
		super(q.Operator, e, t, n, r), this.input = e, this.begin = t, this.end = n, this.file = r, this.operator = this.getText();
	}
	getPrecedence() {
		let e = this.getText();
		return e in bt ? bt[e] : 1;
	}
}, Ct = class extends e {
	constructor(e, t, n, r, i, a) {
		super(q.PropertyAccess, n, r, i, a), this.variable = e, this.props = t;
	}
}, wt = class extends e {
	constructor(e, t, n, r, i, a) {
		super(q.Filter, n, r, i, a), this.name = e, this.args = t;
	}
}, Tt = class extends e {
	constructor(e, t, n, r, i, a) {
		super(q.Hash, e, t, n, a), this.input = e, this.begin = t, this.end = n, this.name = r, this.value = i, this.file = a;
	}
}, Et = /[\da-fA-F]/, Dt = /[0-7]/, Ot = {
	b: "\b",
	f: "\f",
	n: "\n",
	r: "\r",
	t: "	",
	v: "\v"
};
function kt(e) {
	let t = e.charCodeAt(0);
	return t >= 97 ? t - 87 : t >= 65 ? t - 55 : t - 48;
}
function At(e) {
	let t = "";
	for (let n = 1; n < e.length - 1; n++) {
		if (e[n] !== "\\") {
			t += e[n];
			continue;
		}
		if (Ot[e[n + 1]] !== void 0) t += Ot[e[++n]];
		else if (e[n + 1] === "u") {
			let r = 0, i = n + 2;
			for (; i <= n + 5 && Et.test(e[i]);) r = r * 16 + kt(e[i++]);
			n = i - 1, t += String.fromCharCode(r);
		} else if (!Dt.test(e[n + 1])) t += e[++n];
		else {
			let r = n + 1, i = 0;
			for (; r <= n + 3 && Dt.test(e[r]);) i = i * 8 + kt(e[r++]);
			n = r - 1, t += String.fromCharCode(i);
		}
	}
	return t;
}
var jt = class extends e {
	constructor(e, t, n, r) {
		super(q.Quoted, e, t, n, r), this.input = e, this.begin = t, this.end = n, this.file = r, this.content = At(this.getText());
	}
}, Mt = class extends e {
	constructor(e, t, n, r, i, a) {
		super(q.Range, e, t, n, a), this.input = e, this.begin = t, this.end = n, this.lhs = r, this.rhs = i, this.file = a;
	}
}, Nt = class extends pt {
	constructor(e, t, n, r, i) {
		super(q.Tag, [t, n], e, t, n, !1, !1, i), this.tokenizer = new I(e, r.operators, i, this.contentRange), this.name = this.tokenizer.readTagName(), this.tokenizer.assert(this.name, "illegal liquid tag syntax"), this.tokenizer.skipBlank();
	}
	get args() {
		return this.tokenizer.input.slice(this.tokenizer.p, this.contentRange[1]);
	}
}, Pt = class extends e {
	constructor(e, t, n, r, i, a) {
		super(q.FilteredValue, n, r, i, a), this.initial = e, this.filters = t, this.input = n, this.begin = r, this.end = i, this.file = a;
	}
}, Ft = { now: () => Date.now() };
function It() {
	return typeof global == "object" && global.performance || typeof window == "object" && window.performance || Ft;
}
var Lt = class {
	renderTemplatesToNodeStream(e, t) {
		let n = new Re();
		return Promise.resolve().then(() => D(this.renderTemplates(e, t, n))).then(() => n.end(), (e) => n.error(e)), n.stream;
	}
	*renderTemplates(e, t, n) {
		n ||= t.opts.keepOutputType ? new ze() : new Le(), t.renderLimit.check(It().now());
		let r = [];
		for (let i of e) {
			t.renderLimit.check(It().now());
			try {
				let e = yield i.render(t, n);
				if (e && n.write(e), t.breakCalled || t.continueCalled) break;
			} catch (e) {
				let n = y.is(e) ? e : new be(e, i);
				if (t.opts.catchAllErrors) r.push(n);
				else throw n;
			}
		}
		if (r.length) throw new xe(r);
		return n.buffer;
	}
}, Rt = class {
	constructor(e) {
		this.postfix = [...Ht(e)];
	}
	*evaluate(e, t) {
		C(e, "unable to evaluate: context not defined");
		let n = [];
		for (let r of this.postfix) if (Bn(r)) {
			let t = n.pop(), i;
			if (xt[r.operator] === 1) i = yield e.opts.operators[r.operator](t, e);
			else {
				let a = n.pop();
				i = yield e.opts.operators[r.operator](a, t, e);
			}
			n.push(i);
		} else n.push(yield A(r, e, t));
		return n[0];
	}
	valid() {
		return !!this.postfix.length;
	}
};
function* A(e, t, n = !1) {
	if (e) {
		if ("content" in e) return e.content;
		if (Gn(e)) return yield zt(e, t, n);
		if (qn(e)) return yield Vt(e, t);
	}
}
function* zt(e, t, n) {
	let r = [];
	for (let n of e.props) r.push(yield A(n, t, !1));
	try {
		if (e.variable) {
			let i = yield A(e.variable, t, n);
			return yield t._getFromScope(i, r);
		} else return yield t._get(r);
	} catch (t) {
		if (n && t.name === "InternalUndefinedVariableError") return null;
		throw new Se(t, e);
	}
}
function Bt(e) {
	return e.content;
}
function* Vt(e, t) {
	let n = yield A(e.lhs, t), r = yield A(e.rhs, t);
	return t.memoryLimit.use(r - n + 1), ce(+n, +r + 1);
}
function* Ht(e) {
	let t = [];
	for (let n of e) if (Bn(n)) {
		for (; t.length && t[t.length - 1].getPrecedence() > n.getPrecedence();) yield t.pop();
		t.push(n);
	} else yield n;
	for (; t.length;) yield t.pop();
}
function j(e, t) {
	return !M(e, t);
}
function M(e, t) {
	return e = f(e), t.opts.jsTruthy ? !e : e === !1 || e == null;
}
var Ut = {
	"==": N,
	"!=": (e, t) => !N(e, t),
	">": (e, t) => T(e) ? e.gt(t) : T(t) ? t.lt(e) : f(e) > f(t),
	"<": (e, t) => T(e) ? e.lt(t) : T(t) ? t.gt(e) : f(e) < f(t),
	">=": (e, t) => T(e) ? e.geq(t) : T(t) ? t.leq(e) : f(e) >= f(t),
	"<=": (e, t) => T(e) ? e.leq(t) : T(t) ? t.geq(e) : f(e) <= f(t),
	contains: (e, t) => (e = f(e), m(e) ? e.some((e) => N(e, t)) : o(e?.indexOf) ? e.indexOf(f(t)) > -1 : !1),
	not: (e, t) => M(f(e), t),
	and: (e, t, n) => j(f(e), n) && j(f(t), n),
	or: (e, t, n) => j(f(e), n) || j(f(t), n)
};
function N(e, t) {
	return T(e) ? e.equals(t) : T(t) ? t.equals(e) : (e = f(e), t = f(t), m(e) ? m(t) && Wt(e, t) : e === t);
}
function Wt(e, t) {
	return e.length === t.length ? !e.some((e, n) => !N(e, t[n])) : !1;
}
function Gt(e, t) {
	return e.some((e) => N(e, t));
}
var Kt = class {
	constructor(e, t, n, r) {
		this.key = e, this.value = t, this.next = n, this.prev = r;
	}
}, qt = class {
	constructor(e, t = 0) {
		this.limit = e, this.size = t, this.cache = {}, this.head = new Kt("HEAD", null, null, null), this.tail = new Kt("TAIL", null, null, null), this.head.next = this.tail, this.tail.prev = this.head;
	}
	write(e, t) {
		if (this.cache[e]) this.cache[e].value = t;
		else {
			let n = new Kt(e, t, this.head.next, this.head);
			this.head.next.prev = n, this.head.next = n, this.cache[e] = n, this.size++, this.ensureLimit();
		}
	}
	read(e) {
		if (!this.cache[e]) return;
		let { value: t } = this.cache[e];
		return this.remove(e), this.write(e, t), t;
	}
	remove(e) {
		let t = this.cache[e];
		t.prev.next = t.next, t.next.prev = t.prev, delete this.cache[e], this.size--;
	}
	clear() {
		this.head.next = this.tail, this.tail.prev = this.head, this.size = 0, this.cache = {};
	}
	ensureLimit() {
		this.size > this.limit && this.remove(this.tail.prev.key);
	}
};
function Jt(e, t) {
	let n = document.createElement("base");
	n.href = e;
	let r = document.getElementsByTagName("head")[0];
	r.insertBefore(n, r.firstChild);
	let i = document.createElement("a");
	i.href = t;
	let a = i.href;
	return r.removeChild(n), a;
}
function Yt(e, t, n) {
	return e.length && se(e) !== "/" && (e += "/"), Jt(e, t).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/, (e, t, r) => {
		let i = r.split("/").pop();
		return /\.\w+$/.test(i) ? e : t + r + n;
	});
}
function Xt(e) {
	return E(this, void 0, void 0, function* () {
		return new Promise((t, n) => {
			let r = new XMLHttpRequest();
			r.onload = () => {
				r.status >= 200 && r.status < 300 ? t(r.responseText) : n(Error(r.statusText));
			}, r.onerror = () => {
				n(/* @__PURE__ */ Error("An error occurred whilst receiving the response."));
			}, r.open("GET", e), r.send();
		});
	});
}
function Zt(e) {
	let t = new XMLHttpRequest();
	if (t.open("GET", e, !1), t.send(), t.status < 200 || t.status >= 300) throw Error(t.statusText);
	return t.responseText;
}
function Qt(e) {
	return E(this, void 0, void 0, function* () {
		return !0;
	});
}
function $t(e) {
	return !0;
}
function en(e) {
	return Jt(e, ".");
}
var tn = /* @__PURE__ */ Object.freeze({
	__proto__: null,
	resolve: Yt,
	readFile: Xt,
	readFileSync: Zt,
	exists: Qt,
	existsSync: $t,
	dirname: en,
	sep: "/"
});
function nn(e, t, ...n) {
	return e = f(e), m(e) || a(e) ? e.length ? e : t : e === !1 && new Map(n).get("allow_false") ? !1 : M(e, this.context) ? t : e;
}
function rn(e, t = 0) {
	return JSON.stringify(e, null, t);
}
function an(e, t = 0) {
	let n = [];
	return JSON.stringify(e, function(e, t) {
		if (typeof t != "object" || !t) return t;
		for (; n.length > 0 && n[n.length - 1] !== this;) n.pop();
		return n.includes(t) ? "[Circular]" : (n.push(t), t);
	}, t);
}
function on(e) {
	return Number(e);
}
var sn = {
	default: nn,
	raw: {
		raw: !0,
		handler: de
	},
	jsonify: rn,
	to_integer: on,
	json: rn,
	inspect: an
}, cn = {
	"&": "&amp;",
	"<": "&lt;",
	">": "&gt;",
	"\"": "&#34;",
	"'": "&#39;"
}, ln = {
	"&amp;": "&",
	"&lt;": "<",
	"&gt;": ">",
	"&#34;": "\"",
	"&#39;": "'"
};
function un(e) {
	return e = l(e), this.context.memoryLimit.use(e.length), e.replace(/&|<|>|"|'/g, (e) => cn[e]);
}
function dn(e) {
	return un.call(this, e);
}
function fn(e) {
	return e = l(e), this.context.memoryLimit.use(e.length), e.replace(/&(amp|lt|gt|#34|#39);/g, (e) => ln[e]);
}
function pn(e) {
	return un.call(this, fn.call(this, e));
}
function mn(e) {
	let t = l(e);
	return this.context.memoryLimit.use(t.length), t.replace(/\r?\n/gm, "<br />\n");
}
function hn(e) {
	let t = l(e);
	this.context.memoryLimit.use(t.length);
	let n = new Map([
		["<script", "<\/script>"],
		["<style", "</style>"],
		["<!--", "-->"],
		["<", ">"]
	]), r = "", i = 0;
	for (; i < t.length;) {
		let e = t.indexOf("<", i);
		if (e < 0) return r + t.slice(i);
		r += t.slice(i, e);
		for (let [r, a] of n) {
			if (!t.startsWith(r, e)) continue;
			let o = t.indexOf(a, e + r.length);
			if (o >= 0) {
				i = o + a.length;
				break;
			}
			n.delete(r);
		}
		if (i === e) return r + t.slice(e);
	}
	return r;
}
var gn = /* @__PURE__ */ Object.freeze({
	__proto__: null,
	escape: un,
	xml_escape: dn,
	escape_once: pn,
	newline_to_br: mn,
	strip_html: hn
}), _n = class {
	constructor(e) {
		this.mapping = e, this.sep = "/";
	}
	exists(e) {
		return E(this, void 0, void 0, function* () {
			return this.existsSync(e);
		});
	}
	existsSync(e) {
		return !p(this.mapping[e]);
	}
	readFile(e) {
		return E(this, void 0, void 0, function* () {
			return this.readFileSync(e);
		});
	}
	readFileSync(e) {
		let t = this.mapping[e];
		if (p(t)) throw Error(`ENOENT: ${e}`);
		return t;
	}
	dirname(e) {
		let t = e.split(this.sep);
		return t.pop(), t.join(this.sep);
	}
	resolve(e, t, n) {
		if (t += n, e === ".") return t;
		let r = e.split(/\/+/);
		for (let e of t.split(this.sep)) if (e === "." || e === "") continue;
		else e === ".." ? (r.length > 1 || r[0] !== "") && r.pop() : r.push(e);
		return r.join(this.sep);
	}
}, P = {
	root: ["."],
	layouts: ["."],
	partials: ["."],
	relativeReference: !0,
	jekyllInclude: !1,
	keyValueSeparator: ":",
	cache: void 0,
	extname: "",
	fs: tn,
	dynamicPartials: !0,
	jsTruthy: !1,
	dateFormat: "%A, %B %-e, %Y at %-l:%M %P %z",
	locale: "",
	trimTagRight: !1,
	trimTagLeft: !1,
	trimOutputRight: !1,
	trimOutputLeft: !1,
	greedy: !0,
	tagDelimiterLeft: "{%",
	tagDelimiterRight: "%}",
	outputDelimiterLeft: "{{",
	outputDelimiterRight: "}}",
	preserveTimezones: !1,
	strictFilters: !1,
	strictVariables: !1,
	ownPropertyOnly: !0,
	lenientIf: !1,
	globals: {},
	keepOutputType: !1,
	operators: Ut,
	memoryLimit: Infinity,
	parseLimit: Infinity,
	renderLimit: Infinity
};
function vn(e) {
	if (e.hasOwnProperty("root") && (e.hasOwnProperty("partials") || (e.partials = e.root), e.hasOwnProperty("layouts") || (e.layouts = e.root)), e.hasOwnProperty("cache")) {
		let t;
		t = typeof e.cache == "number" ? e.cache > 0 ? new qt(e.cache) : void 0 : typeof e.cache == "object" ? e.cache : e.cache ? new qt(1024) : void 0, e.cache = t;
	}
	return e = Object.assign(Object.assign(Object.assign({}, P), e.jekyllInclude ? { dynamicPartials: !1 } : {}), e), (!e.fs.dirname || !e.fs.sep) && e.relativeReference && (console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning"), e.relativeReference = !1), e.root = F(e.root), e.partials = F(e.partials), e.layouts = F(e.layouts), e.outputEscape = e.outputEscape && yn(e.outputEscape), e.locale ||= at()?.().resolvedOptions().locale ?? "en-US", e.templates && (e.fs = new _n(e.templates), e.relativeReference = !0, e.root = e.partials = e.layouts = "."), e;
}
function yn(e) {
	return e === "escape" ? un : e === "json" ? sn.json : (C(o(e), "`outputEscape` need to be of type string or function"), e);
}
function F(e) {
	let t = [];
	return m(e) && (t = e), a(e) && (t = [e]), t;
}
function bn(e, t) {
	let n = !1;
	for (let r = 0; r < e.length; r++) {
		let i = e[r];
		zn(i) && (!n && i.trimLeft && xn(e[r - 1], t.greedy), J(i) && (i.name === "raw" ? n = !0 : i.name === "endraw" && (n = !1)), !n && i.trimRight && Sn(e[r + 1], t.greedy));
	}
}
function xn(e, t) {
	if (!e || !Vn(e)) return;
	let n = t ? x : ke;
	for (; b[e.input.charCodeAt(e.end - 1 - e.trimRight)] & n;) e.trimRight++;
}
function Sn(e, t) {
	if (!e || !Vn(e)) return;
	let n = t ? x : ke;
	for (; b[e.input.charCodeAt(e.begin + e.trimLeft)] & n;) e.trimLeft++;
	e.input.charAt(e.begin + e.trimLeft) === "\n" && e.trimLeft++;
}
var I = class {
	constructor(e, t = P.operators, n, r) {
		this.input = e, this.file = n, this.rawBeginAt = -1, this.p = r ? r[0] : 0, this.N = r ? r[1] : e.length, this.opTrie = Ue(t), this.literalTrie = Ue(He);
	}
	readExpression() {
		return new Rt(this.readExpressionTokens());
	}
	*readExpressionTokens() {
		for (; this.p < this.N;) {
			let e = this.readOperator();
			if (e) {
				yield e;
				continue;
			}
			let t = this.readValue();
			if (t) {
				yield t;
				continue;
			}
			return;
		}
	}
	readOperator() {
		this.skipBlank();
		let e = this.matchTrie(this.opTrie);
		if (e !== -1) return new St(this.input, this.p, this.p = e, this.file);
	}
	matchTrie(e) {
		let t = e, n = this.p, r;
		for (; t[this.input[n]] && n < this.N;) t = t[this.input[n++]], t.end && (r = t);
		return !r || r.needBoundary && S(this.peek(n - this.p)) ? -1 : n;
	}
	readFilteredValue() {
		let e = this.p, t = this.readExpression();
		return this.assert(t.valid(), `invalid value expression: ${this.snapshot()}`), new Pt(t, this.readFilters(), this.input, e, this.p, this.file);
	}
	readFilters() {
		let e = [];
		for (;;) {
			let t = this.readFilter();
			if (!t) return e;
			e.push(t);
		}
	}
	readFilter() {
		if (this.skipBlank(), this.end()) return null;
		this.assert(this.read() === "|", "expected \"|\" before filter");
		let e = this.readIdentifier();
		if (!e.size()) return this.assert(this.end(), "expected filter name"), null;
		let t = [];
		if (this.skipBlank(), this.peek() === ":") do {
			++this.p;
			let e = this.readFilterArg();
			e && t.push(e), this.skipBlank(), this.assert(this.end() || this.peek() === "," || this.peek() === "|", () => `unexpected character ${this.snapshot()}`);
		} while (this.peek() === ",");
		else if (!(this.peek() === "|" || this.end())) throw this.error("expected \":\" after filter name");
		return new wt(e.getText(), t, this.input, e.begin, this.p, this.file);
	}
	readFilterArg() {
		let e = this.readValue();
		if (!e) return;
		if (this.skipBlank(), this.peek() !== ":") return e;
		++this.p;
		let t = this.readValue();
		return [e.getText(), t];
	}
	readTopLevelTokens(e = P) {
		let t = [];
		for (; this.p < this.N;) {
			let n = this.readTopLevelToken(e);
			t.push(n);
		}
		return bn(t, e), t;
	}
	readTopLevelToken(e) {
		let { tagDelimiterLeft: t, outputDelimiterLeft: n } = e;
		return this.rawBeginAt > -1 ? this.readEndrawOrRawContent(e) : this.match(t) ? this.readTagToken(e) : this.match(n) ? this.readOutputToken(e) : this.readHTMLToken([t, n]);
	}
	readHTMLToken(e) {
		let t = this.p;
		for (; this.p < this.N && !e.some((e) => this.match(e));) ++this.p;
		return new gt(this.input, t, this.p, this.file);
	}
	readTagToken(e) {
		let { file: t, input: n } = this, r = this.p;
		if (this.readToDelimiter(e.tagDelimiterRight) === -1) throw this.error(`tag ${this.snapshot(r)} not closed`, r);
		let i = new mt(n, r, this.p, e, t);
		return i.name === "raw" && (this.rawBeginAt = r), i;
	}
	readToDelimiter(e, t = !1) {
		for (this.skipBlank(); this.p < this.N;) {
			if (t && this.peekType() & Oe) {
				this.readQuoted();
				continue;
			}
			if (++this.p, this.rmatch(e)) return this.p;
		}
		return -1;
	}
	readOutputToken(e = P) {
		let { file: t, input: n } = this, { outputDelimiterRight: r } = e, i = this.p;
		if (this.readToDelimiter(r, !0) === -1) throw this.error(`output ${this.snapshot(i)} not closed`, i);
		return new ht(n, i, this.p, e, t);
	}
	readEndrawOrRawContent(e) {
		let { tagDelimiterLeft: t, tagDelimiterRight: n } = e, r = this.p, i = this.readTo(t) - t.length;
		for (; this.p < this.N;) {
			if (this.readIdentifier().getText() !== "endraw") {
				i = this.readTo(t) - t.length;
				continue;
			}
			for (; this.p <= this.N;) {
				if (this.rmatch(n)) {
					let t = this.p;
					return r === i ? (this.rawBeginAt = -1, new mt(this.input, r, t, e, this.file)) : (this.p = i, new gt(this.input, r, i, this.file));
				}
				if (this.rmatch(t)) break;
				this.p++;
			}
		}
		throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`, r);
	}
	readLiquidTagTokens(e = P) {
		let t = [];
		for (; this.p < this.N;) {
			let n = this.readLiquidTagToken(e);
			n && t.push(n);
		}
		return t;
	}
	readLiquidTagToken(e) {
		if (this.skipBlank(), this.end()) return;
		let t = this.p;
		this.readToDelimiter("\n");
		let n = this.p;
		return new Nt(this.input, t, n, e, this.file);
	}
	error(e, t = this.p) {
		return new ve(e, new vt(this.input, t, this.N, this.file));
	}
	assert(e, t, n) {
		if (!e) throw this.error(typeof t == "function" ? t() : t, n);
	}
	snapshot(e = this.p) {
		return JSON.stringify(pe(this.input.slice(e, this.N), 32));
	}
	readWord() {
		return this.readIdentifier();
	}
	readIdentifier() {
		this.skipBlank();
		let e = this.p;
		for (; !this.end() && S(this.peek());) ++this.p;
		return new vt(this.input, e, this.p, this.file);
	}
	readNonEmptyIdentifier() {
		let e = this.readIdentifier();
		return e.size() ? e : void 0;
	}
	readTagName() {
		return this.skipBlank(), this.input[this.p] === "#" ? this.input.slice(this.p, ++this.p) : this.readIdentifier().getText();
	}
	readHashes(e) {
		let t = [];
		for (;;) {
			let n = this.readHash(e);
			if (!n) return t;
			t.push(n);
		}
	}
	readHash(e) {
		this.skipBlank(), this.peek() === "," && ++this.p;
		let t = this.p, n = this.readNonEmptyIdentifier();
		if (!n) return;
		let r;
		this.skipBlank();
		let i = a(e) ? e : e ? "=" : ":";
		return this.peek() === i && (++this.p, r = this.readValue()), new Tt(this.input, t, this.p, n, r, this.file);
	}
	remaining() {
		return this.input.slice(this.p, this.N);
	}
	advance(e = 1) {
		this.p += e;
	}
	end() {
		return this.p >= this.N;
	}
	read() {
		return this.input[this.p++];
	}
	readTo(e) {
		for (; this.p < this.N;) if (++this.p, this.rmatch(e)) return this.p;
		return -1;
	}
	readValue() {
		this.skipBlank();
		let e = this.p, t = this.readLiteral() || this.readQuoted() || this.readRange() || this.readNumber(), n = this.readProperties(!t);
		return n.length ? new Ct(t, n, this.input, e, this.p) : t;
	}
	readScopeValue() {
		this.skipBlank();
		let e = this.p, t = this.readProperties();
		if (t.length) return new Ct(void 0, t, this.input, e, this.p);
	}
	readProperties(e = !0) {
		let t = [];
		for (;;) {
			if (this.peek() === "[") {
				this.p++;
				let e = this.readValue() || new vt(this.input, this.p, this.p, this.file);
				this.assert(this.readTo("]") !== -1, "[ not closed"), t.push(e);
				continue;
			}
			if (e && !t.length) {
				let e = this.readNonEmptyIdentifier();
				if (e) {
					t.push(e);
					continue;
				}
			}
			if (this.peek() === "." && this.peek(1) !== ".") {
				this.p++;
				let e = this.readNonEmptyIdentifier();
				if (!e) break;
				t.push(e);
				continue;
			}
			break;
		}
		return t;
	}
	readNumber() {
		this.skipBlank();
		let e = !1, t = !1, n = 0;
		for (this.peekType() & je && n++; this.p + n <= this.N;) if (this.peekType(n) & Ae) t = !0, n++;
		else if (this.peek(n) === "." && this.peek(n + 1) !== ".") {
			if (e || !t) return;
			e = !0, n++;
		} else break;
		if (t && !S(this.peek(n))) {
			let e = new _t(this.input, this.p, this.p + n, this.file);
			return this.advance(n), e;
		}
	}
	readLiteral() {
		this.skipBlank();
		let e = this.matchTrie(this.literalTrie);
		if (e === -1) return;
		let t = new yt(this.input, this.p, e, this.file);
		return this.p = e, t;
	}
	readRange() {
		this.skipBlank();
		let e = this.p;
		if (this.peek() !== "(") return;
		++this.p;
		let t = this.readValueOrThrow();
		this.skipBlank(), this.assert(this.read() === "." && this.read() === ".", "invalid range syntax");
		let n = this.readValueOrThrow();
		return this.skipBlank(), this.assert(this.read() === ")", "invalid range syntax"), new Mt(this.input, e, this.p, t, n, this.file);
	}
	readValueOrThrow() {
		let e = this.readValue();
		return this.assert(e, () => `unexpected token ${this.snapshot()}, value expected`), e;
	}
	readQuoted() {
		this.skipBlank();
		let e = this.p;
		if (!(this.peekType() & Oe)) return;
		++this.p;
		let t = !1;
		for (; this.p < this.N && (++this.p, !(this.input[this.p - 1] === this.input[e] && !t));) t ? t = !1 : this.input[this.p - 1] === "\\" && (t = !0);
		return new jt(this.input, e, this.p, this.file);
	}
	*readFileNameTemplate(e) {
		let { outputDelimiterLeft: t } = e, n = [
			",",
			" ",
			"\r",
			"\n",
			"	",
			t
		], r = new Set(n);
		for (; this.p < this.N && !r.has(this.peek());) yield this.match(t) ? this.readOutputToken(e) : this.readHTMLToken(n);
	}
	match(e) {
		for (let t = 0; t < e.length; t++) if (e[t] !== this.input[this.p + t]) return !1;
		return !0;
	}
	rmatch(e) {
		for (let t = 0; t < e.length; t++) if (e[e.length - 1 - t] !== this.input[this.p - 1 - t]) return !1;
		return !0;
	}
	peekType(e = 0) {
		return this.p + e >= this.N ? 0 : b[this.input.charCodeAt(this.p + e)];
	}
	peek(e = 0) {
		return this.p + e >= this.N ? "" : this.input[this.p + e];
	}
	skipBlank() {
		for (; this.peekType() & x;) ++this.p;
	}
}, Cn = class {
	constructor(e, t) {
		this.handlers = {}, this.stopRequested = !1, this.tokens = e, this.parseToken = t;
	}
	on(e, t) {
		return this.handlers[e] = t, this;
	}
	trigger(e, t) {
		let n = this.handlers[e];
		return n ? (n.call(this, t), !0) : !1;
	}
	start() {
		this.trigger("start");
		let e;
		for (; !this.stopRequested && (e = this.tokens.shift());) {
			if (this.trigger("token", e) || J(e) && this.trigger(`tag:${e.name}`, e)) continue;
			let t = this.parseToken(e, this.tokens);
			this.trigger("template", t);
		}
		return this.stopRequested || this.trigger("end"), this;
	}
	stop() {
		return this.stopRequested = !0, this;
	}
}, wn = class {
	constructor(e) {
		this.token = e;
	}
}, L = class extends wn {
	constructor(e, t, n) {
		super(e), this.name = e.name, this.liquid = n, this.tokenizer = e.tokenizer;
	}
}, R = class {
	constructor(e, t) {
		this.hash = {};
		let n = e instanceof I ? e : new I(e, {});
		for (let e of n.readHashes(t)) this.hash[e.name.content] = e.value;
	}
	*render(e) {
		let t = {};
		for (let n of Object.keys(this.hash)) t[n] = this.hash[n] === void 0 ? !0 : yield A(this.hash[n], e);
		return t;
	}
};
function Tn(e) {
	return class extends L {
		constructor(t, n, r) {
			super(t, n, r), o(e.parse) && e.parse.call(this, t, n);
		}
		*render(t, n) {
			let r = yield new R(this.token.args, t.opts.keyValueSeparator).render(t);
			return yield e.render.call(this, t, n, r);
		}
	};
}
function En(e) {
	return m(e);
}
var Dn = class {
	constructor(e, t, n) {
		this.token = e, this.name = e.name, this.handler = o(t) ? t : o(t?.handler) ? t.handler : de, this.raw = !o(t) && !!t?.raw, this.args = e.args, this.liquid = n;
	}
	*render(e, t) {
		let n = [];
		for (let e of this.args) En(e) ? n.push([e[0], yield A(e[1], t)]) : n.push(yield A(e, t));
		return yield this.handler.apply({
			context: t,
			token: this.token,
			liquid: this.liquid
		}, [e, ...n]);
	}
}, z = class {
	constructor(e, t) {
		this.filters = [];
		let n = typeof e == "string" ? new I(e, t.options.operators).readFilteredValue() : e;
		this.initial = n.initial, this.filters = n.filters.map((e) => new Dn(e, this.getFilter(t, e.name), t));
	}
	*value(e, t) {
		t ||= e.opts.lenientIf && this.filters.length > 0 && this.filters[0].name === "default";
		let n = yield this.initial.evaluate(e, t);
		for (let t of this.filters) n = yield t.render(n, e);
		return n;
	}
	getFilter(e, t) {
		let n = e.filters[t];
		return C(n || !e.options.strictFilters, () => `undefined filter: ${t}`), n;
	}
}, On = class extends wn {
	constructor(e, t) {
		super(e);
		let n = new I(e.input, t.options.operators, e.file, e.contentRange);
		this.value = new z(n.readFilteredValue(), t);
		let r = this.value.filters, i = t.options.outputEscape;
		if (!r[r.length - 1]?.raw && i) {
			let e = new wt(toString.call(i), [], "", 0, 0);
			r.push(new Dn(e, i, t));
		}
	}
	*render(e, t) {
		let n = yield this.value.value(e, !1);
		t.write(n);
	}
	*arguments() {
		yield this.value;
	}
}, kn = class extends wn {
	constructor(e) {
		super(e), this.str = e.getContent();
	}
	*render(e, t) {
		t.write(this.str);
	}
}, B = class e {
	constructor(e, t) {
		this.segments = e, this.location = t;
	}
	toString() {
		return W(this.segments, !0);
	}
	toArray() {
		function* t(...n) {
			for (let r of n) r instanceof e ? yield Array.from(t(...r.segments)) : yield r;
		}
		return Array.from(t(...this.segments));
	}
}, An = class {
	constructor() {
		this.map = /* @__PURE__ */ new Map();
	}
	get(e) {
		let t = W([e.segments[0]]);
		return this.map.has(t) || this.map.set(t, []), this.map.get(t);
	}
	has(e) {
		return this.map.has(W([e.segments[0]]));
	}
	push(e) {
		this.get(e).push(e);
	}
	asObject() {
		return Object.fromEntries(this.map);
	}
}, jn = { partials: !0 };
function* Mn(e, t, n) {
	let r = new An(), i = new An(), o = new An(), s = new Nn(/* @__PURE__ */ new Set()), c = /* @__PURE__ */ new Set();
	function l(e, t) {
		r.push(e);
		let n = t.alias(e);
		if (n !== void 0) {
			let e = n.segments[0];
			a(e) && !s.has(e) && i.push(n);
		} else {
			let n = e.segments[0];
			a(n) && !t.has(n) && i.push(e);
		}
		for (let n of e.segments) n instanceof B && l(n, t);
	}
	function* u(e, r) {
		if (e.arguments) for (let t of e.arguments()) for (let e of Pn(t)) l(e, r);
		if (e.localScope) for (let t of e.localScope()) {
			r.add(t.content), r.deleteAlias(t.content);
			let [e, n] = t.getPosition();
			o.push(new B([t.content], {
				row: e,
				col: n,
				file: t.file
			}));
		}
		if (e.children) if (e.partialScope) {
			let i = e.partialScope();
			if (i === void 0) {
				for (let i of yield e.children(t, n)) yield u(i, r);
				return;
			}
			if (c.has(i.name)) return;
			let o = /* @__PURE__ */ new Set(), s = i.isolated ? new Nn(o) : r.push(o);
			for (let e of i.scope) if (a(e)) o.add(e);
			else {
				let [t, n] = e;
				o.add(t);
				let r = Array.from(Pn(n));
				r.length && s.setAlias(t, r[0].segments);
			}
			for (let r of yield e.children(t, n)) yield u(r, s), c.add(i.name);
			s.pop();
		} else {
			e.blockScope && r.push(new Set(e.blockScope()));
			for (let i of yield e.children(t, n)) yield u(i, r);
			e.blockScope && r.pop();
		}
	}
	for (let t of e) yield u(t, s);
	return {
		variables: r.asObject(),
		globals: i.asObject(),
		locals: o.asObject()
	};
}
function V(e, t = {}) {
	return D(Mn(e, Object.assign(Object.assign({}, jn), t).partials, !1));
}
function H(e, t = {}) {
	return O(Mn(e, Object.assign(Object.assign({}, jn), t).partials, !0));
}
var Nn = class {
	constructor(e) {
		this.stack = [{
			names: e,
			aliases: /* @__PURE__ */ new Map()
		}];
	}
	has(e) {
		for (let t of this.stack) if (t.names.has(e)) return !0;
		return !1;
	}
	push(e) {
		return this.stack.push({
			names: e,
			aliases: /* @__PURE__ */ new Map()
		}), this;
	}
	pop() {
		return this.stack.pop()?.names;
	}
	add(e) {
		this.stack[0].names.add(e);
	}
	alias(e) {
		let t = e.segments[0];
		if (!a(t)) return;
		let n = this.getAlias(t);
		if (n !== void 0) return new B([...n, ...e.segments.slice(1)], e.location);
	}
	setAlias(e, t) {
		this.stack[this.stack.length - 1].aliases.set(e, t);
	}
	deleteAlias(e) {
		this.stack[this.stack.length - 1].aliases.delete(e);
	}
	getAlias(e) {
		for (let t of this.stack) {
			if (t.aliases.has(e)) return t.aliases.get(e);
			if (t.names.has(e)) return;
		}
	}
};
function* Pn(e) {
	Y(e) ? yield* U(e) : e instanceof z && (yield* Fn(e));
}
function* Fn(e) {
	for (let t of e.initial.postfix) Y(t) && (yield* U(t));
	for (let t of e.filters) for (let e of t.args) En(e) && e[1] ? yield* U(e[1]) : Y(e) && (yield* U(e));
}
function* U(e) {
	qn(e) ? (yield* U(e.lhs), yield* U(e.rhs)) : Gn(e) && (yield In(e));
}
function In(e) {
	let t = [], n = e.file, r = e.props[0];
	n ||= r.file, Un(r) || Wn(r) || Kn(r) ? t.push(r.content) : Gn(r) && t.push(...In(r).segments);
	for (let r of e.props.slice(1)) n ||= r.file, Un(r) || Wn(r) || Kn(r) ? t.push(r.content) : Gn(r) && t.push(In(r));
	let [i, a] = e.getPosition();
	return new B(t, {
		row: i,
		col: a,
		file: n
	});
}
var Ln = /^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;
function W(e, t = !1) {
	let n = [], r = e[0];
	a(r) && (!t || r.match(Ln) ? n.push(`${r}`) : n.push(`['${r}']`));
	for (let t of e.slice(1)) t instanceof B ? n.push(`[${W(t.segments)}]`) : a(t) ? t.match(Ln) ? n.push(`.${t}`) : n.push(`['${t}']`) : n.push(`[${t}]`);
	return n.join("");
}
var G;
(function(e) {
	e.Partials = "partials", e.Layouts = "layouts", e.Root = "root";
})(G ||= {});
var Rn = class {
	constructor(e) {
		if (this.options = e, e.relativeReference) {
			let t = e.fs.sep;
			C(t, "`fs.sep` is required for relative reference");
			let n = [
				"." + t,
				".." + t,
				"./",
				"../"
			];
			this.shouldLoadRelative = (e) => n.some((t) => e.startsWith(t));
		} else this.shouldLoadRelative = (e) => !1;
		let t = e.fs;
		this.contains = Ge(t.contains?.bind(t) || (() => E(this, void 0, void 0, function* () {
			return !0;
		})), t.containsSync?.bind(t) || (() => !0)), this.exists = Ge(t.exists?.bind(t) || (() => E(this, void 0, void 0, function* () {
			return !1;
		})), t.existsSync?.bind(t));
	}
	*lookup(e, t, n, r) {
		let i = this.options[t];
		for (let t of this.candidates(e, i, r)) {
			let e = !1;
			for (let r of i) if (yield this.contains(!!n, r, t)) {
				e = !0;
				break;
			}
			if (e && (yield this.exists(!!n, t))) return t;
		}
		throw this.lookupError(e, i);
	}
	*candidates(e, t, n) {
		let { fs: r, extname: i } = this.options;
		this.shouldLoadRelative(e) && n && (yield r.resolve(this.dirname(n), e, i));
		for (let n of t) yield r.resolve(n, e, i);
		if (r.fallback !== void 0) {
			let t = r.fallback(e);
			t !== void 0 && (yield t);
		}
	}
	dirname(e) {
		let t = this.options.fs;
		return C(t.dirname, "`fs.dirname` is required for relative reference"), t.dirname(e);
	}
	lookupError(e, t) {
		let n = /* @__PURE__ */ Error("ENOENT");
		return n.message = `ENOENT: Failed to lookup "${e}" in "${t}"`, n.code = "ENOENT", n;
	}
}, K = class {
	constructor(e) {
		this.liquid = e, this.cache = this.liquid.options.cache, this.fs = this.liquid.options.fs, this.parseFile = this.cache ? this._parseFileCached : this._parseFile, this.loader = new Rn(this.liquid.options), this.parseLimit = new ft("parse length", e.options.parseLimit), this.readFile = Ge(this.fs.readFile?.bind(this.fs) || (() => E(this, void 0, void 0, function* () {
			throw Error("readFile not implemented");
		})), this.fs.readFileSync?.bind(this.fs));
	}
	parse(e, t) {
		e = String(e), this.parseLimit.use(e.length);
		let n = new I(e, this.liquid.options.operators, t).readTopLevelTokens(this.liquid.options);
		return this.parseTokens(n);
	}
	parseTokens(e) {
		let t, n = [], r = [];
		for (; t = e.shift();) try {
			n.push(this.parseToken(t, e));
		} catch (e) {
			if (this.liquid.options.catchAllErrors) r.push(e);
			else throw e;
		}
		if (r.length) throw new xe(r);
		return n;
	}
	parseToken(e, t) {
		try {
			if (J(e)) {
				let n = this.liquid.tags[e.name];
				return C(n, `tag "${e.name}" not found`), new n(e, t, this.liquid, this);
			}
			return Hn(e) ? new On(e, this.liquid) : new kn(e);
		} catch (t) {
			throw y.is(t) ? t : new ye(t, e);
		}
	}
	parseStream(e) {
		return new Cn(e, (e, t) => this.parseToken(e, t));
	}
	*_parseFileCached(e, t, n = G.Root, r) {
		let i = this.cache, a = this.loader.shouldLoadRelative(e) ? r + "," + e : n + ":" + e, o = yield i.read(a);
		if (o) return o;
		let s = this._parseFile(e, t, n, r), c = t ? yield s : D(s);
		i.write(a, c);
		try {
			return yield c;
		} catch (e) {
			throw i.remove(a), e;
		}
	}
	*_parseFile(e, t, n = G.Root, r) {
		let i = yield this.loader.lookup(e, n, t, r);
		return this.parse(yield this.readFile(!!t, i), i);
	}
}, q;
(function(e) {
	e[e.Number = 1] = "Number", e[e.Literal = 2] = "Literal", e[e.Tag = 4] = "Tag", e[e.Output = 8] = "Output", e[e.HTML = 16] = "HTML", e[e.Filter = 32] = "Filter", e[e.Hash = 64] = "Hash", e[e.PropertyAccess = 128] = "PropertyAccess", e[e.Word = 256] = "Word", e[e.Range = 512] = "Range", e[e.Quoted = 1024] = "Quoted", e[e.Operator = 2048] = "Operator", e[e.FilteredValue = 4096] = "FilteredValue", e[e.Delimited = 12] = "Delimited";
})(q ||= {});
function zn(e) {
	return !!(X(e) & q.Delimited);
}
function Bn(e) {
	return X(e) === q.Operator;
}
function Vn(e) {
	return X(e) === q.HTML;
}
function Hn(e) {
	return X(e) === q.Output;
}
function J(e) {
	return X(e) === q.Tag;
}
function Un(e) {
	return X(e) === q.Quoted;
}
function Wn(e) {
	return X(e) === q.Number;
}
function Gn(e) {
	return X(e) === q.PropertyAccess;
}
function Kn(e) {
	return X(e) === q.Word;
}
function qn(e) {
	return X(e) === q.Range;
}
function Y(e) {
	return (X(e) & 1667) > 0;
}
function X(e) {
	return e ? e.kind : -1;
}
function Z(e) {
	let t = Object.create(null);
	return e && Object.assign(t, e), t;
}
var Q = class e {
	constructor(e = {}, t = P, n = {}, { memoryLimit: r, renderLimit: i } = {}) {
		this.scopes = [Z()], this.registers = {}, this.breakCalled = !1, this.continueCalled = !1, this.sync = !!n.sync, this.opts = t, this.globals = n.globals ?? t.globals, this.environments = h(e) ? e : Object(e), this.strictVariables = n.strictVariables ?? this.opts.strictVariables, this.ownPropertyOnly = n.ownPropertyOnly ?? t.ownPropertyOnly, this.memoryLimit = r ?? new ft("memory alloc", n.memoryLimit ?? t.memoryLimit), this.renderLimit = i ?? new ft("template render", It().now() + (n.renderLimit ?? t.renderLimit));
	}
	getRegister(e, t = void 0) {
		return this.registers[e] = this.registers[e] || t;
	}
	setRegister(e, t) {
		return this.registers[e] = t;
	}
	saveRegister(...e) {
		return e.map((e) => [e, this.getRegister(e)]);
	}
	restoreRegister(e) {
		return e.forEach(([e, t]) => this.setRegister(e, t));
	}
	getAll() {
		return [
			this.globals,
			this.environments,
			...this.scopes
		].reduce((e, t) => We(e, t), {});
	}
	get(e) {
		return this.getSync(e);
	}
	getSync(e) {
		return O(this._get(e));
	}
	*_get(e) {
		let t = this.findScope(e[0]);
		return yield this._getFromScope(t, e);
	}
	getFromScope(e, t) {
		return O(this._getFromScope(e, t));
	}
	*_getFromScope(e, t, n = this.strictVariables) {
		a(t) && (t = t.split("."));
		for (let r = 0; r < t.length; r++) if (e = yield this.readProperty(e, t[r]), n && re(e)) throw new Ce(t.slice(0, r + 1).join("."));
		return e;
	}
	push(e) {
		return this.scopes.push(e);
	}
	pop() {
		return this.scopes.pop();
	}
	bottom() {
		return this.scopes[0];
	}
	spawn(t = {}) {
		return new e(t, this.opts, {
			sync: this.sync,
			globals: this.globals,
			strictVariables: this.strictVariables,
			ownPropertyOnly: this.ownPropertyOnly
		}, {
			renderLimit: this.renderLimit,
			memoryLimit: this.memoryLimit
		});
	}
	findScope(e) {
		for (let t = this.scopes.length - 1; t >= 0; t--) {
			let n = this.scopes[t];
			if (e in n) return n;
		}
		return e in this.environments ? this.environments : this.globals;
	}
	readProperty(e, n) {
		if (e = ne(e), n = f(n), p(e)) return e;
		if (m(e) && n < 0) return e[e.length + +n];
		let r = Jn(e, n, this.ownPropertyOnly);
		return r === void 0 && e instanceof t ? e.liquidMethodMissing(n, this) : o(r) ? r.call(e) : n === "size" ? Zn(e) : n === "first" ? Yn(e) : n === "last" ? Xn(e) : r;
	}
};
function Jn(e, n, r) {
	if (!(r && !i.call(e, n) && !(e instanceof t))) return e[n];
}
function Yn(e) {
	return m(e) ? e[0] : e.first;
}
function Xn(e) {
	return m(e) ? e[e.length - 1] : e.last;
}
function Zn(e) {
	if (i.call(e, "size") || e.size !== void 0) return e.size;
	if (m(e) || a(e)) return e.length;
	if (typeof e == "object") return Object.keys(e).length;
}
var $;
(function(e) {
	e[e.OUTPUT = 0] = "OUTPUT", e[e.STORE = 1] = "STORE";
})($ ||= {});
var Qn = v(Math.abs), $n = v(Math.max), er = v(Math.min), tr = v(Math.ceil), nr = v((e, t, n = !1) => n ? Math.floor(e / t) : e / t), rr = v(Math.floor), ir = v((e, t) => e - t), ar = v((e, t) => e + t), or = v((e, t) => e % t), sr = v((e, t) => e * t);
function cr(e, t = 0) {
	e = ee(e), t = ee(t);
	let n = 10 ** t, r = e * n;
	return Math.sign(e) * Math.round(Math.abs(r)) / n;
}
var lr = /* @__PURE__ */ Object.freeze({
	__proto__: null,
	abs: Qn,
	at_least: $n,
	at_most: er,
	ceil: tr,
	divided_by: nr,
	floor: rr,
	minus: ir,
	plus: ar,
	modulo: or,
	times: sr,
	round: cr
}), ur = (e) => decodeURIComponent(l(e)).replace(/\+/g, " "), dr = (e) => encodeURIComponent(l(e)).replace(/%20/g, "+"), fr = (e) => encodeURIComponent(l(e)).replace(/%20/g, "+").replace(/[!'()*]/g, (e) => "%" + e.charCodeAt(0).toString(16).toUpperCase()), pr = (e) => encodeURI(l(e)).replace(/%5B/g, "[").replace(/%5D/g, "]"), mr = /[^\p{M}\p{L}\p{Nd}]+/gu, hr = {
	raw: /\s+/g,
	default: mr,
	pretty: /[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/gu,
	ascii: /[^A-Za-z0-9]+/g,
	latin: mr,
	none: null
};
function gr(e, t = "default", n = !1) {
	e = l(e);
	let r = hr[t];
	return r && (t === "latin" && (e = _r(e)), e = e.replace(r, "-").replace(/^-|-$/g, "")), n ? e : e.toLowerCase();
}
function _r(e) {
	return e.replace(/[àáâãäå]/g, "a").replace(/[æ]/g, "ae").replace(/[ç]/g, "c").replace(/[èéêë]/g, "e").replace(/[ìíîï]/g, "i").replace(/[ð]/g, "d").replace(/[ñ]/g, "n").replace(/[òóôõöø]/g, "o").replace(/[ùúûü]/g, "u").replace(/[ýÿ]/g, "y").replace(/[ß]/g, "ss").replace(/[œ]/g, "oe").replace(/[þ]/g, "th").replace(/[ẞ]/g, "SS").replace(/[Œ]/g, "OE").replace(/[Þ]/g, "TH");
}
var vr = /* @__PURE__ */ Object.freeze({
	__proto__: null,
	url_decode: ur,
	url_encode: dr,
	cgi_escape: fr,
	uri_escape: pr,
	slugify: gr
}), yr = _(function(e, t) {
	let n = d(e), r = p(t) ? " " : l(t), i = n.length * (1 + r.length);
	return this.context.memoryLimit.use(i), n.join(r);
}), br = _((e) => ie(e) ? se(e) : ""), xr = _((e) => ie(e) ? e[0] : ""), Sr = _(function(e) {
	let t = d(e);
	return this.context.memoryLimit.use(t.length), [...t].reverse();
});
function* Cr(e, t, n) {
	let r = [], i = d(e);
	this.context.memoryLimit.use(i.length);
	for (let e of i) r.push([e, t ? yield this.context._getFromScope(e, l(t).split("."), !1) : e]);
	return r.sort((e, t) => n(e[1], t[1])).map((e) => e[0]);
}
function* wr(e, t) {
	return yield* Cr.call(this, e, t, me);
}
function* Tr(e, t) {
	return yield* Cr.call(this, e, t, he);
}
var Er = (e) => e && e.length || 0;
function* Dr(e, t) {
	let n = [], r = d(e);
	this.context.memoryLimit.use(r.length);
	for (let e of r) n.push(yield this.context._getFromScope(e, l(t), !1));
	return n;
}
function* Or(e, t) {
	let n = 0, r = d(e);
	for (let e of r) {
		let r = Number(t ? yield this.context._getFromScope(e, l(t), !1) : e);
		n += Number.isNaN(r) ? 0 : r;
	}
	return n;
}
function kr(e) {
	let t = d(e);
	return this.context.memoryLimit.use(t.length), t.filter((e) => !p(f(e)));
}
function Ar(e, t = []) {
	let n = d(e), r = d(t);
	return this.context.memoryLimit.use(n.length + r.length), n.concat(r);
}
function jr(e, t) {
	return Ar.call(this, e, [t]);
}
function Mr(e, t) {
	let n = d(e);
	this.context.memoryLimit.use(n.length);
	let r = [...n];
	return r.unshift(t), r;
}
function Nr(e) {
	let t = [...d(e)];
	return t.pop(), t;
}
function Pr(e) {
	let t = d(e);
	this.context.memoryLimit.use(t.length);
	let n = [...t];
	return n.shift(), n;
}
function Fr(e, t, n = 1) {
	return e = f(e), p(e) ? [] : (m(e) || (e = l(e)), t = t < 0 ? e.length + t : t, this.context.memoryLimit.use(n), e.slice(t, t + n));
}
function Ir(e) {
	return this.context.opts.jekyllWhere ? (t) => Pe.is(e) ? N(t, e) : m(t) ? Gt(t, e) : N(t, e) : e === void 0 ? (e) => j(e, this.context) : (t) => N(t, e);
}
function* Lr(e, t, n, r) {
	let i = [];
	t = d(t), this.context.memoryLimit.use(t.length);
	let a = new I(l(n)).readScopeValue();
	for (let e of t) i.push(yield A(a, this.context.spawn(e)));
	let o = Ir.call(this, r);
	return t.filter((t, n) => o(i[n]) === e);
}
function* Rr(e, t, n, r) {
	let i = [], a = new z(l(r), this.liquid), o = d(t);
	this.context.memoryLimit.use(o.length);
	for (let t of o) {
		this.context.push({ [n]: t });
		let r = yield a.value(this.context);
		this.context.pop(), r === e && i.push(t);
	}
	return i;
}
function* zr(e, t, n) {
	return yield* Lr.call(this, !0, e, t, n);
}
function* Br(e, t, n) {
	return yield* Lr.call(this, !1, e, t, n);
}
function* Vr(e, t, n) {
	return yield* Rr.call(this, !0, e, t, n);
}
function* Hr(e, t, n) {
	return yield* Rr.call(this, !1, e, t, n);
}
function* Ur(e, t) {
	let n = /* @__PURE__ */ new Map();
	e = u(e);
	let r = new I(l(t)).readScopeValue();
	this.context.memoryLimit.use(e.length);
	for (let t of e) {
		let e = yield A(r, this.context.spawn(t));
		n.has(e) || n.set(e, []), n.get(e).push(t);
	}
	return [...n.entries()].map(([e, t]) => ({
		name: e,
		items: t
	}));
}
function* Wr(e, t, n) {
	let r = /* @__PURE__ */ new Map(), i = new z(l(n), this.liquid);
	e = u(e), this.context.memoryLimit.use(e.length);
	for (let n of e) {
		this.context.push({ [t]: n });
		let e = yield i.value(this.context);
		this.context.pop(), r.has(e) || r.set(e, []), r.get(e).push(n);
	}
	return [...r.entries()].map(([e, t]) => ({
		name: e,
		items: t
	}));
}
function* Gr(e, t, n) {
	let r = new I(l(t)).readScopeValue(), i = d(e), a = Ir.call(this, n);
	for (let e = 0; e < i.length; e++) if (a(yield A(r, this.context.spawn(i[e])))) return [e, i[e]];
}
function* Kr(e, t, n) {
	let r = new z(l(n), this.liquid), i = d(e);
	for (let e = 0; e < i.length; e++) {
		this.context.push({ [t]: i[e] });
		let n = yield r.value(this.context);
		if (this.context.pop(), n) return [e, i[e]];
	}
}
function* qr(e, t, n) {
	return !!(yield* Gr.call(this, e, t, n));
}
function* Jr(e, t, n) {
	return !!(yield* Kr.call(this, e, t, n));
}
function* Yr(e, t, n) {
	let r = yield* Gr.call(this, e, t, n);
	return r ? r[0] : void 0;
}
function* Xr(e, t, n) {
	let r = yield* Kr.call(this, e, t, n);
	return r ? r[0] : void 0;
}
function* Zr(e, t, n) {
	let r = yield* Gr.call(this, e, t, n);
	return r ? r[1] : void 0;
}
function* Qr(e, t, n) {
	let r = yield* Kr.call(this, e, t, n);
	return r ? r[1] : void 0;
}
function $r(e) {
	return e = d(e), this.context.memoryLimit.use(e.length), [...new Set(e)];
}
function ei(e, t = 1) {
	if (e = f(e), p(e)) return [];
	m(e) || (e = l(e)), this.context.memoryLimit.use(t);
	let n = [...e].sort(() => Math.random() - .5);
	return t === 1 ? n[0] : n.slice(0, t);
}
var ti = /* @__PURE__ */ Object.freeze({
	__proto__: null,
	join: yr,
	last: br,
	first: xr,
	reverse: Sr,
	sort: wr,
	sort_natural: Tr,
	size: Er,
	map: Dr,
	sum: Or,
	compact: kr,
	concat: Ar,
	push: jr,
	unshift: Mr,
	pop: Nr,
	shift: Pr,
	slice: Fr,
	where: zr,
	reject: Br,
	where_exp: Vr,
	reject_exp: Hr,
	group_by: Ur,
	group_by_exp: Wr,
	has: qr,
	has_exp: Jr,
	find_index: Yr,
	find_index_exp: Xr,
	find: Zr,
	find_exp: Qr,
	uniq: $r,
	sample: ei
});
function ni(e, t, n) {
	let r = (e?.length ?? 0) + (n?.length ?? 0);
	this.context.memoryLimit.use(r);
	let i = ci(e, this.context.opts, n);
	return i ? (t = f(t), t = p(t) ? this.context.opts.dateFormat : l(t), this.context.memoryLimit.use(t.length), rt(i, t, this.context.memoryLimit)) : e;
}
function ri(e) {
	return ni.call(this, e, "%Y-%m-%dT%H:%M:%S%:z");
}
function ii(e) {
	return ni.call(this, e, "%a, %d %b %Y %H:%M:%S %z");
}
function ai(e, t, n) {
	return si.call(this, e, "%b", t, n);
}
function oi(e, t, n) {
	return si.call(this, e, "%B", t, n);
}
function si(e, t, n, r) {
	let i = ci(e, this.context.opts);
	if (!i) return e;
	let a = this.context.memoryLimit;
	if (n === "ordinal") {
		let e = i.getDate();
		return r === "US" ? rt(i, `${t} ${e}%q, %Y`, a) : rt(i, `${e}%q ${t} %Y`, a);
	}
	return rt(i, `%d ${t} %Y`, a);
}
function ci(e, t, n) {
	let r, i = n ?? t.timezoneOffset, o = t.locale;
	if (e = f(e), !p(e)) return r = e === "now" || e === "today" ? new k(Date.now(), o, i) : te(e) ? new k(e * 1e3, o, i) : a(e) ? /^\d+$/.test(e) ? new k(e * 1e3, o, i) : t.preserveTimezones && n === void 0 ? k.createDateFixedToTimezone(e, o) : new k(e, o, i) : new k(e, o, i), r.valid() ? r : void 0;
}
var li = /* @__PURE__ */ Object.freeze({
	__proto__: null,
	date: ni,
	date_to_xmlschema: ri,
	date_to_rfc822: ii,
	date_to_string: ai,
	date_to_long_string: oi
}), ui = /[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu, di = /[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;
function fi(e, t) {
	C(arguments.length === 2, "append expect 2 arguments");
	let n = l(e), r = l(t);
	return this.context.memoryLimit.use(n.length + r.length), n + r;
}
function pi(e, t) {
	C(arguments.length === 2, "prepend expect 2 arguments");
	let n = l(e), r = l(t);
	return this.context.memoryLimit.use(n.length + r.length), r + n;
}
function mi(e, t) {
	let n = l(e);
	if (this.context.memoryLimit.use(n.length), t) {
		t = l(t), this.context.memoryLimit.use(t.length);
		for (let e = 0, r = new Set(t); e < n.length; e++) if (!r.has(n[e])) return n.slice(e);
		return "";
	}
	return n.trimStart();
}
function hi(e) {
	let t = l(e);
	return this.context.memoryLimit.use(t.length), t.toLowerCase();
}
function gi(e) {
	let t = l(e);
	return this.context.memoryLimit.use(t.length), l(t).toUpperCase();
}
function _i(e, t) {
	let n = l(e);
	return t = l(t), this.context.memoryLimit.use(n.length + t.length), n.split(t).join("");
}
function vi(e, t) {
	let n = l(e);
	return t = l(t), this.context.memoryLimit.use(n.length + t.length), n.replace(t, "");
}
function yi(e, t) {
	let n = l(e), r = l(t);
	this.context.memoryLimit.use(n.length + r.length);
	let i = n.lastIndexOf(r);
	return i === -1 ? n : n.substring(0, i) + n.substring(i + r.length);
}
function bi(e, t) {
	if (e = l(e), this.context.memoryLimit.use(e.length), t) {
		t = l(t), this.context.memoryLimit.use(t.length);
		for (let n = e.length - 1, r = new Set(t); n >= 0; n--) if (!r.has(e[n])) return e.slice(0, n + 1);
		return "";
	}
	return e.trimEnd();
}
function xi(e, t) {
	let n = l(e);
	this.context.memoryLimit.use(n.length);
	let r = n.split(l(t));
	for (; r.length && r[r.length - 1] === "";) r.pop();
	return r;
}
function Si(e, t) {
	let n = l(e);
	if (this.context.memoryLimit.use(n.length), t) {
		let e = new Set(l(t));
		this.context.memoryLimit.use(e.size);
		let r = 0, i = n.length - 1;
		for (; e.has(n[r]);) r++;
		for (; i >= r && e.has(n[i]);) i--;
		return n.slice(r, i + 1);
	}
	return n.trim();
}
function Ci(e) {
	let t = l(e);
	return this.context.memoryLimit.use(t.length), t.replace(/\r?\n/gm, "");
}
function wi(e) {
	return e = l(e), this.context.memoryLimit.use(e.length), e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
}
function Ti(e, t, n) {
	let r = l(e);
	t = l(t), n = l(n);
	let i = r.split(t), a = r.length + (i.length - 1) * (n.length - t.length);
	return this.context.memoryLimit.use(a), i.join(n);
}
function Ei(e, t, n) {
	let r = l(e);
	return t = l(t), n = l(n), this.context.memoryLimit.use(r.length + t.length + n.length), r.replace(t, () => n);
}
function Di(e, t, n) {
	let r = l(e), i = l(t), a = l(n);
	this.context.memoryLimit.use(r.length + i.length + a.length);
	let o = r.lastIndexOf(i);
	return o === -1 ? r : r.substring(0, o) + a + r.substring(o + i.length);
}
function Oi(e, t = 50, n = "...") {
	let r = l(e);
	return n = l(n), this.context.memoryLimit.use(r.length + n.length), r.length <= t ? e : r.substring(0, t - n.length) + n;
}
function ki(e, t = 15, n = "...") {
	let r = l(e);
	n = l(n), this.context.memoryLimit.use(r.length + n.length);
	let i = r.split(/\s+/);
	t <= 0 && (t = 1);
	let a = i.slice(0, t).join(" ");
	return i.length >= t && (a += n), a;
}
function Ai(e) {
	let t = l(e);
	return this.context.memoryLimit.use(t.length), t.replace(/\s+/g, " ");
}
function ji(e, t) {
	let n = l(e);
	if (this.context.memoryLimit.use(n.length), e = n.trim(), !e) return 0;
	switch (t) {
		case "cjk": return (e.match(ui) || []).length + (e.match(di) || []).length;
		case "auto": return ui.test(e) ? e.match(ui).length + (e.match(di) || []).length : e.split(/\s+/).length;
		default: return e.split(/\s+/).length;
	}
}
function Mi(e, t = "and") {
	switch (t = l(t), this.context.memoryLimit.use(e.length + t.length), e.length) {
		case 0: return "";
		case 1: return e[0];
		case 2: return `${e[0]} ${t} ${e[1]}`;
		default: return `${e.slice(0, -1).join(", ")}, ${t} ${e[e.length - 1]}`;
	}
}
var Ni = /* @__PURE__ */ Object.freeze({
	__proto__: null,
	append: fi,
	prepend: pi,
	lstrip: mi,
	downcase: hi,
	upcase: gi,
	remove: _i,
	remove_first: vi,
	remove_last: yi,
	rstrip: bi,
	split: xi,
	strip: Si,
	strip_newlines: Ci,
	capitalize: wi,
	replace: Ti,
	replace_first: Ei,
	replace_last: Di,
	truncate: Oi,
	truncatewords: ki,
	normalize_whitespace: Ai,
	number_of_words: ji,
	array_to_sentence_string: Mi
});
function Pi(e) {
	return btoa(String.fromCharCode(...new TextEncoder().encode(e)));
}
function Fi(e) {
	return new TextDecoder().decode(Uint8Array.from(atob(e), (e) => e.charCodeAt(0)));
}
function Ii(e) {
	if (typeof Buffer < "u" && Buffer.isBuffer(e)) return this.context.memoryLimit.use(e.byteLength), e.toString("base64");
	let t = l(e);
	return this.context.memoryLimit.use(t.length), Pi(t);
}
function Li(e) {
	let t = l(e);
	return this.context.memoryLimit.use(t.length), Fi(t);
}
var Ri = /* @__PURE__ */ Object.freeze({
	__proto__: null,
	base64_encode: Ii,
	base64_decode: Li
});
function zi(e) {
	let t = new Uint8Array(e), n = "";
	for (let e = 0; e < t.length; e++) n += t[e].toString(16).padStart(2, "0");
	return n;
}
function Bi(e) {
	return E(this, void 0, void 0, function* () {
		let t = new TextEncoder().encode(e);
		return zi(yield crypto.subtle.digest("SHA-256", t));
	});
}
function Vi(e, t) {
	return E(this, void 0, void 0, function* () {
		let n = new TextEncoder(), r = yield crypto.subtle.importKey("raw", n.encode(t), {
			name: "HMAC",
			hash: "SHA-256"
		}, !1, ["sign"]);
		return zi(yield crypto.subtle.sign("HMAC", r, n.encode(e)));
	});
}
function Hi(e) {
	let t = l(e);
	return this.context.memoryLimit.use(t.length), Bi(t);
}
function Ui(e, t) {
	let n = l(e), r = l(t);
	return this.context.memoryLimit.use(n.length + r.length), Vi(n, r);
}
var Wi = /* @__PURE__ */ Object.freeze({
	__proto__: null,
	sha256: Hi,
	hmac_sha256: Ui
}), Gi = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, gn), lr), vr), ti), li), Ni), Ri), Wi), sn), Ki = class extends L {
	constructor(e, t, n) {
		super(e, t, n), this.identifier = this.tokenizer.readIdentifier(), this.key = this.identifier.content, this.tokenizer.assert(this.key, "expected variable name"), this.tokenizer.skipBlank(), this.tokenizer.assert(this.tokenizer.peek() === "=", "expected \"=\""), this.tokenizer.advance(), this.value = new z(this.tokenizer.readFilteredValue(), this.liquid);
	}
	*render(e) {
		e.bottom()[this.key] = yield this.value.value(e, this.liquid.options.lenientIf);
	}
	*arguments() {
		yield this.value;
	}
	*localScope() {
		yield this.identifier;
	}
}, qi = [
	"offset",
	"limit",
	"reversed"
], Ji = class extends L {
	constructor(e, t, n, r) {
		super(e, t, n);
		let i = this.tokenizer.readIdentifier(), a = this.tokenizer.readIdentifier(), o = this.tokenizer.readValue();
		if (!i.size() || a.content !== "in" || !o) throw Error(`illegal tag: ${e.getText()}`);
		this.variable = i.content, this.collection = o, this.hash = new R(this.tokenizer, n.options.keyValueSeparator), this.templates = [], this.elseTemplates = [];
		let s, c = r.parseStream(t).on("start", () => s = this.templates).on("tag:else", (e) => {
			w(e.args), s = this.elseTemplates;
		}).on("tag:endfor", (e) => {
			w(e.args), c.stop();
		}).on("template", (e) => s.push(e)).on("end", () => {
			throw Error(`tag ${e.getText()} not closed`);
		});
		c.start();
	}
	*render(e, t) {
		let n = this.liquid.renderer, r = u(yield A(this.collection, e));
		if (!r.length) {
			yield n.renderTemplates(this.elseTemplates, e, t);
			return;
		}
		let i = "continue-" + this.variable + "-" + this.collection.getText();
		e.push(Z({ continue: e.getRegister(i, {}) }));
		let a = yield this.hash.render(e);
		e.pop(), r = (this.liquid.options.orderedFilterParameters ? Object.keys(a).filter((e) => qi.includes(e)) : qi.filter((e) => a[e] !== void 0)).reduce((e, t) => t === "offset" ? Xi(e, a.offset) : t === "limit" ? Zi(e, a.limit) : Yi(e), r), e.setRegister(i, (a.offset || 0) + r.length);
		let o = Z({ forloop: new Ie(r.length, this.collection.getText(), this.variable) });
		e.push(o);
		for (let i of r) {
			if (o[this.variable] = i, e.continueCalled = e.breakCalled = !1, yield n.renderTemplates(this.templates, e, t), e.breakCalled) break;
			o.forloop.next();
		}
		e.continueCalled = e.breakCalled = !1, e.pop();
	}
	*children() {
		let e = this.templates.slice();
		return this.elseTemplates && e.push(...this.elseTemplates), e;
	}
	*arguments() {
		yield this.collection;
		for (let e of Object.values(this.hash.hash)) Y(e) && (yield e);
	}
	blockScope() {
		return [this.variable, "forloop"];
	}
};
function Yi(e) {
	return [...e].reverse();
}
function Xi(e, t) {
	return e.slice(t);
}
function Zi(e, t) {
	return e.slice(0, t);
}
var Qi = class extends L {
	constructor(e, t, n, r) {
		for (super(e, t, n), this.templates = [], this.identifier = this.readVariable(), this.variable = this.identifier.content; t.length;) {
			let e = t.shift();
			if (J(e) && e.name === "endcapture") return;
			this.templates.push(r.parseToken(e, t));
		}
		throw Error(`tag ${e.getText()} not closed`);
	}
	readVariable() {
		let e = this.tokenizer.readIdentifier();
		if (e.content || (e = this.tokenizer.readQuoted(), e)) return e;
		throw this.tokenizer.error("invalid capture name");
	}
	*render(e) {
		let t = yield this.liquid.renderer.renderTemplates(this.templates, e);
		e.bottom()[this.variable] = t;
	}
	*children() {
		return this.templates;
	}
	*localScope() {
		yield this.identifier;
	}
}, $i = class extends L {
	constructor(e, t, n, r) {
		super(e, t, n), this.branches = [], this.elseTemplates = [], this.value = new z(this.tokenizer.readFilteredValue(), this.liquid), this.elseTemplates = [];
		let i = [], a = 0, o = r.parseStream(t).on("tag:when", (e) => {
			if (a > 0) return;
			i = [];
			let t = [];
			for (; !e.tokenizer.end();) t.push(e.tokenizer.readValueOrThrow()), e.tokenizer.skipBlank(), e.tokenizer.peek() === "," ? e.tokenizer.readTo(",") : e.tokenizer.readTo("or");
			this.branches.push({
				values: t,
				templates: i
			});
		}).on("tag:else", () => {
			a++, i = this.elseTemplates;
		}).on("tag:endcase", () => o.stop()).on("template", (e) => {
			(i !== this.elseTemplates || a === 1) && i.push(e);
		}).on("end", () => {
			throw Error(`tag ${e.getText()} not closed`);
		});
		o.start();
	}
	*render(e, t) {
		let n = this.liquid.renderer, r = f(yield this.value.value(e, e.opts.lenientIf)), i = !1;
		for (let a of this.branches) for (let o of a.values) if (N(r, yield A(o, e, e.opts.lenientIf))) {
			yield n.renderTemplates(a.templates, e, t), i = !0;
			break;
		}
		i || (yield n.renderTemplates(this.elseTemplates, e, t));
	}
	*arguments() {
		yield this.value, yield* this.branches.flatMap((e) => e.values);
	}
	*children() {
		let e = this.branches.flatMap((e) => e.templates);
		return this.elseTemplates && e.push(...this.elseTemplates), e;
	}
}, ea = class extends L {
	constructor(e, t, n) {
		for (super(e, t, n); t.length;) {
			let e = t.shift();
			if (J(e) && e.name === "endcomment") return;
		}
		throw Error(`tag ${e.getText()} not closed`);
	}
	render() {}
}, ta = class extends L {
	constructor(e, t, n, r) {
		super(e, t, n);
		let i = this.tokenizer;
		for (this.file = na(i, this.liquid, r), this.currentFile = e.file; !i.end();) {
			i.skipBlank();
			let e = i.p, t = i.readIdentifier();
			if ((t.content === "with" || t.content === "for") && (i.skipBlank(), i.peek() !== ":")) {
				let e = i.readValue();
				if (e) {
					let n = i.p, r = i.readIdentifier(), a;
					r.content === "as" ? a = i.readIdentifier() : i.p = n, this[t.content] = {
						value: e,
						alias: a && a.content
					}, i.skipBlank(), i.peek() === "," && i.advance();
					continue;
				}
			}
			i.p = e;
			break;
		}
		this.hash = new R(i, n.options.keyValueSeparator);
	}
	*render(e, t) {
		let { liquid: n, hash: r } = this, i = yield ia(this.file, e, n);
		C(i, () => `illegal file path "${i}"`);
		let a = e.spawn(), o = a.bottom();
		if (We(o, yield r.render(e)), this.with) {
			let { value: t, alias: n } = this.with;
			o[n || i] = yield A(t, e);
		}
		if (this.for) {
			let { value: r, alias: s } = this.for, c = u(yield A(r, e));
			o.forloop = new Ie(c.length, r.getText(), s);
			for (let e of c) {
				o[s] = e;
				let r = yield n._parsePartialFile(i, a.sync, this.currentFile);
				yield n.renderer.renderTemplates(r, a, t), o.forloop.next();
			}
		} else {
			let e = yield n._parsePartialFile(i, a.sync, this.currentFile);
			yield n.renderer.renderTemplates(e, a, t);
		}
	}
	*children(e, t) {
		return e && a(this.file) ? yield this.liquid._parsePartialFile(this.file, t, this.currentFile) : [];
	}
	partialScope() {
		if (a(this.file)) {
			let e = Object.keys(this.hash.hash);
			if (this.with) {
				let { value: t, alias: n } = this.with;
				a(n) ? e.push([n, t]) : a(this.file) && e.push([this.file, t]);
			}
			if (this.for) {
				let { value: t, alias: n } = this.for;
				a(n) ? e.push([n, t]) : a(this.file) && e.push([this.file, t]);
			}
			return {
				name: this.file,
				isolated: !0,
				scope: e
			};
		}
	}
	*arguments() {
		for (let e of Object.values(this.hash.hash)) Y(e) && (yield e);
		if (this.with) {
			let { value: e } = this.with;
			Y(e) && (yield e);
		}
		if (this.for) {
			let { value: e } = this.for;
			Y(e) && (yield e);
		}
	}
};
function na(e, t, n) {
	if (t.options.dynamicPartials) {
		let t = e.readValue();
		return e.assert(t, "illegal file path"), t.getText() === "none" ? void 0 : Un(t) ? ra(n.parse(Bt(t))) : t;
	}
	let r = [...e.readFileNameTemplate(t.options)], i = ra(n.parseTokens(r));
	return i === "none" ? void 0 : i;
}
function ra(e) {
	return e.length === 1 && Vn(e[0].token) ? e[0].token.getContent() : e;
}
function* ia(e, t, n) {
	return typeof e == "string" ? e : Array.isArray(e) ? n.renderer.renderTemplates(e, t) : yield A(e, t);
}
var aa = class extends L {
	constructor(e, t, n, r) {
		super(e, t, n);
		let { tokenizer: i } = e;
		this.file = na(i, this.liquid, r), this.currentFile = e.file;
		let a = i.p;
		i.readIdentifier().content === "with" ? (i.skipBlank(), i.peek() === ":" ? i.p = a : this.withVar = i.readValue()) : i.p = a, this.hash = new R(i, n.options.jekyllInclude || n.options.keyValueSeparator);
	}
	*render(e, t) {
		let { liquid: n, hash: r, withVar: i } = this, { renderer: a } = n, o = yield ia(this.file, e, n);
		C(o, () => `illegal file path "${o}"`);
		let s = e.saveRegister("blocks", "blockMode");
		e.setRegister("blocks", {}), e.setRegister("blockMode", $.OUTPUT);
		let c = Z(yield r.render(e));
		i && (c[o] = yield A(i, e));
		let l = yield n._parsePartialFile(o, e.sync, this.currentFile);
		e.push(e.opts.jekyllInclude ? Z({ include: c }) : c), yield a.renderTemplates(l, e, t), e.pop(), e.restoreRegister(s);
	}
	*children(e, t) {
		return e && a(this.file) ? yield this.liquid._parsePartialFile(this.file, t, this.currentFile) : [];
	}
	partialScope() {
		if (a(this.file)) {
			let e;
			return this.liquid.options.jekyllInclude ? e = ["include"] : (e = Object.keys(this.hash.hash), this.withVar && e.push([this.file, this.withVar])), {
				name: this.file,
				isolated: !1,
				scope: e
			};
		}
	}
	*arguments() {
		yield* Object.values(this.hash.hash).filter(Y), Y(this.file) && (yield this.file), Y(this.withVar) && (yield this.withVar);
	}
}, oa = class extends L {
	constructor(e, t, n) {
		super(e, t, n), this.identifier = this.tokenizer.readIdentifier(), this.variable = this.identifier.content;
	}
	render(e, t) {
		let n = e.environments;
		te(n[this.variable]) || (n[this.variable] = 0), t.write(l(--n[this.variable]));
	}
	*localScope() {
		yield this.identifier;
	}
}, sa = class extends L {
	constructor(e, t, n) {
		super(e, t, n), this.candidates = [];
		let r = this.tokenizer.readValue();
		for (this.tokenizer.skipBlank(), r && (this.tokenizer.peek() === ":" ? (this.group = r, this.tokenizer.advance()) : this.candidates.push(r)); !this.tokenizer.end();) {
			let e = this.tokenizer.readValue();
			e && this.candidates.push(e), this.tokenizer.readTo(",");
		}
		this.tokenizer.assert(this.candidates.length, () => `empty candidates: "${e.getText()}"`);
	}
	*render(e, t) {
		let n = `cycle:${yield A(this.group, e)}:` + this.candidates.join(","), r = e.getRegister("cycle", {}), i = r[n];
		i === void 0 && (i = r[n] = 0);
		let a = this.candidates[i];
		return i = (i + 1) % this.candidates.length, r[n] = i, yield A(a, e);
	}
	*arguments() {
		yield* this.candidates, this.group && (yield this.group);
	}
}, ca = class extends L {
	constructor(e, t, n, r) {
		super(e, t, n), this.branches = [];
		let i = [];
		r.parseStream(t).on("start", () => this.branches.push({
			value: new z(e.tokenizer.readFilteredValue(), this.liquid),
			templates: i = []
		})).on("tag:elsif", (e) => {
			C(!this.elseTemplates, "unexpected elsif after else"), this.branches.push({
				value: new z(e.tokenizer.readFilteredValue(), this.liquid),
				templates: i = []
			});
		}).on("tag:else", (e) => {
			w(e.args), C(!this.elseTemplates, "duplicated else"), i = this.elseTemplates = [];
		}).on("tag:endif", function(e) {
			w(e.args), this.stop();
		}).on("template", (e) => i.push(e)).on("end", () => {
			throw Error(`tag ${e.getText()} not closed`);
		}).start();
	}
	*render(e, t) {
		let n = this.liquid.renderer;
		for (let { value: r, templates: i } of this.branches) if (j(yield r.value(e, e.opts.lenientIf), e)) {
			yield n.renderTemplates(i, e, t);
			return;
		}
		yield n.renderTemplates(this.elseTemplates || [], e, t);
	}
	*children() {
		let e = this.branches.flatMap((e) => e.templates);
		return this.elseTemplates && e.push(...this.elseTemplates), e;
	}
	arguments() {
		return this.branches.map((e) => e.value);
	}
}, la = class extends L {
	constructor(e, t, n) {
		super(e, t, n), this.identifier = this.tokenizer.readIdentifier(), this.variable = this.identifier.content;
	}
	render(e, t) {
		let n = e.environments;
		te(n[this.variable]) || (n[this.variable] = 0);
		let r = n[this.variable];
		n[this.variable]++, t.write(l(r));
	}
	*localScope() {
		yield this.identifier;
	}
}, ua = class extends L {
	constructor(e, t, n, r) {
		super(e, t, n), this.file = na(this.tokenizer, this.liquid, r), this.currentFile = e.file, this.args = new R(this.tokenizer, n.options.keyValueSeparator), this.templates = r.parseTokens(t);
	}
	*render(e, t) {
		let { liquid: n, args: r, file: i } = this, { renderer: a } = n;
		if (i === void 0) {
			e.setRegister("blockMode", $.OUTPUT), yield a.renderTemplates(this.templates, e, t);
			return;
		}
		let o = yield ia(this.file, e, n);
		C(o, () => `illegal file path "${o}"`);
		let s = yield n._parseLayoutFile(o, e.sync, this.currentFile);
		e.setRegister("blockMode", $.STORE);
		let c = yield a.renderTemplates(this.templates, e), l = e.getRegister("blocks", {});
		l[""] === void 0 && (l[""] = (e, t) => t.write(c)), e.setRegister("blockMode", $.OUTPUT), e.push(Z(yield r.render(e))), yield a.renderTemplates(s, e, t), e.pop();
	}
	*children(e) {
		let t = this.templates.slice();
		return e && a(this.file) && t.push(...yield this.liquid._parsePartialFile(this.file, !0, this.currentFile)), t;
	}
	*arguments() {
		for (let e of Object.values(this.args.hash)) Y(e) && (yield e);
		Y(this.file) && (yield this.file);
	}
	partialScope() {
		if (a(this.file)) return {
			name: this.file,
			isolated: !1,
			scope: Object.keys(this.args.hash)
		};
	}
}, da = class extends L {
	constructor(e, t, n, r) {
		super(e, t, n), this.templates = [];
		let i = /\w+/.exec(e.args);
		for (this.block = i ? i[0] : ""; t.length;) {
			let e = t.shift();
			if (J(e) && e.name === "endblock") return;
			let n = r.parseToken(e, t);
			this.templates.push(n);
		}
		throw Error(`tag ${e.getText()} not closed`);
	}
	*render(e, t) {
		let n = this.getBlockRender(e);
		e.getRegister("blockMode") === $.STORE ? e.getRegister("blocks", {})[this.block] = n : yield n(new Be(), t);
	}
	getBlockRender(e) {
		let t = this, { liquid: n, templates: r } = this, i = e.getRegister("blocks", {})[this.block], a = function* (i, a) {
			let o = e.getRegister("blockStack", []);
			if (o.includes(t)) throw Error("block tag cannot be nested");
			o.push(t), e.push(Z({ block: i })), yield n.renderer.renderTemplates(r, e, a), e.pop(), o.pop();
		};
		return i ? (e, t) => i(new Be((t) => a(e, t)), t) : a;
	}
	*children() {
		return this.templates;
	}
	blockScope() {
		return ["block"];
	}
}, fa = class extends L {
	constructor(e, t, n) {
		for (super(e, t, n), this.tokens = []; t.length;) {
			let e = t.shift();
			if (J(e) && e.name === "endraw") return;
			this.tokens.push(e);
		}
		throw Error(`tag ${e.getText()} not closed`);
	}
	render() {
		return this.tokens.map((e) => e.getText()).join("");
	}
}, pa = class extends Ie {
	constructor(e, t, n, r) {
		super(e, n, r), this.length = e, this.cols = t;
	}
	row() {
		return Math.floor(this.i / this.cols) + 1;
	}
	col0() {
		return this.i % this.cols;
	}
	col() {
		return this.col0() + 1;
	}
	col_first() {
		return this.col0() === 0;
	}
	col_last() {
		return this.col() === this.cols;
	}
}, ma = {
	assign: Ki,
	for: Ji,
	capture: Qi,
	case: $i,
	comment: ea,
	include: aa,
	render: ta,
	decrement: oa,
	increment: la,
	cycle: sa,
	if: ca,
	layout: ua,
	block: da,
	raw: fa,
	tablerow: class extends L {
		constructor(e, t, n, r) {
			super(e, t, n);
			let i = this.tokenizer.readIdentifier();
			this.tokenizer.skipBlank();
			let a = this.tokenizer.readIdentifier(), o = this.tokenizer.readValue();
			if (a.content !== "in" || !o) throw Error(`illegal tag: ${e.getText()}`);
			this.variable = i.content, this.collection = o, this.args = new R(this.tokenizer, n.options.keyValueSeparator), this.templates = [];
			let s, c = r.parseStream(t).on("start", () => s = this.templates).on("tag:endtablerow", () => c.stop()).on("template", (e) => s.push(e)).on("end", () => {
				throw Error(`tag ${e.getText()} not closed`);
			});
			c.start();
		}
		*render(e, t) {
			let n = u(yield A(this.collection, e)), r = yield this.args.render(e), i = r.offset || 0;
			n = n.slice(i, i + (r.limit === void 0 ? n.length : r.limit));
			let a = r.cols || n.length, o = this.liquid.renderer, s = new pa(n.length, a, this.collection.getText(), this.variable), c = Z({ tablerowloop: s });
			e.push(c);
			for (let r = 0; r < n.length; r++, s.next()) c[this.variable] = n[r], s.col0() === 0 && (s.row() !== 1 && t.write("</tr>"), t.write(`<tr class="row${s.row()}">`)), t.write(`<td class="col${s.col()}">`), yield o.renderTemplates(this.templates, e, t), t.write("</td>");
			n.length && t.write("</tr>"), e.pop();
		}
		*children() {
			return this.templates;
		}
		*arguments() {
			yield this.collection;
			for (let e of Object.values(this.args.hash)) Y(e) && (yield e);
		}
		blockScope() {
			return [this.variable, "tablerowloop"];
		}
	},
	unless: class extends L {
		constructor(e, t, n, r) {
			super(e, t, n), this.branches = [], this.elseTemplates = [];
			let i = [], a = 0;
			r.parseStream(t).on("start", () => this.branches.push({
				value: new z(e.tokenizer.readFilteredValue(), this.liquid),
				test: M,
				templates: i = []
			})).on("tag:elsif", (e) => {
				if (a > 0) {
					i = [];
					return;
				}
				this.branches.push({
					value: new z(e.tokenizer.readFilteredValue(), this.liquid),
					test: j,
					templates: i = []
				});
			}).on("tag:else", () => {
				a++, i = this.elseTemplates;
			}).on("tag:endunless", function() {
				this.stop();
			}).on("template", (e) => {
				(i !== this.elseTemplates || a === 1) && i.push(e);
			}).on("end", () => {
				throw Error(`tag ${e.getText()} not closed`);
			}).start();
		}
		*render(e, t) {
			let n = this.liquid.renderer;
			for (let { value: r, test: i, templates: a } of this.branches) if (i(yield r.value(e, e.opts.lenientIf), e)) {
				yield n.renderTemplates(a, e, t);
				return;
			}
			yield n.renderTemplates(this.elseTemplates, e, t);
		}
		*children() {
			let e = this.branches.flatMap((e) => e.templates);
			return this.elseTemplates && e.push(...this.elseTemplates), e;
		}
		arguments() {
			return this.branches.map((e) => e.value);
		}
	},
	break: class extends L {
		render(e, t) {
			e.breakCalled = !0;
		}
	},
	continue: class extends L {
		render(e, t) {
			e.continueCalled = !0;
		}
	},
	echo: class extends L {
		constructor(e, t, n) {
			super(e, t, n), this.tokenizer.skipBlank(), this.tokenizer.end() || (this.value = new z(this.tokenizer.readFilteredValue(), this.liquid));
		}
		*render(e, t) {
			if (!this.value) return;
			let n = yield this.value.value(e, !1);
			t.write(n);
		}
		*arguments() {
			this.value && (yield this.value);
		}
	},
	liquid: class extends L {
		constructor(e, t, n, r) {
			super(e, t, n);
			let i = this.tokenizer.readLiquidTagTokens(this.liquid.options);
			this.templates = r.parseTokens(i);
		}
		*render(e, t) {
			yield this.liquid.renderer.renderTemplates(this.templates, e, t);
		}
		*children() {
			return this.templates;
		}
	},
	"#": class extends L {
		constructor(e, t, n) {
			if (super(e, t, n), e.args.search(/\n\s*[^#\s]/g) !== -1) throw Error("every line of an inline comment must start with a '#' character");
		}
		render() {}
	}
}, ha = class e {
	constructor(e = {}) {
		this.renderer = new Lt(), this.filters = Object.create(null), this.tags = Object.create(null), this.options = vn(e), this.parser = new K(this), oe(ma, (e, t) => this.registerTag(t, e)), oe(Gi, (e, t) => this.registerFilter(t, e));
	}
	parse(e, t) {
		return new K(this).parse(e, t);
	}
	_render(e, t, n) {
		let r = t instanceof Q ? t : new Q(t, this.options, n);
		return this.renderer.renderTemplates(e, r);
	}
	render(e, t, n) {
		return E(this, void 0, void 0, function* () {
			return D(this._render(e, t, Object.assign(Object.assign({}, n), { sync: !1 })));
		});
	}
	renderSync(e, t, n) {
		return O(this._render(e, t, Object.assign(Object.assign({}, n), { sync: !0 })));
	}
	renderToNodeStream(e, t, n = {}) {
		let r = new Q(t, this.options, n);
		return this.renderer.renderTemplatesToNodeStream(e, r);
	}
	_parseAndRender(e, t, n) {
		let r = this.parse(e);
		return this._render(r, t, n);
	}
	parseAndRender(e, t, n) {
		return E(this, void 0, void 0, function* () {
			return D(this._parseAndRender(e, t, Object.assign(Object.assign({}, n), { sync: !1 })));
		});
	}
	parseAndRenderSync(e, t, n) {
		return O(this._parseAndRender(e, t, Object.assign(Object.assign({}, n), { sync: !0 })));
	}
	_parsePartialFile(e, t, n) {
		return new K(this).parseFile(e, t, G.Partials, n);
	}
	_parseLayoutFile(e, t, n) {
		return new K(this).parseFile(e, t, G.Layouts, n);
	}
	_parseFile(e, t, n, r) {
		return new K(this).parseFile(e, t, n, r);
	}
	parseFile(e, t) {
		return E(this, void 0, void 0, function* () {
			return D(new K(this).parseFile(e, !1, t));
		});
	}
	parseFileSync(e, t) {
		return O(new K(this).parseFile(e, !0, t));
	}
	*_renderFile(e, t, n) {
		let r = yield this._parseFile(e, n.sync, n.lookupType);
		return yield this._render(r, t, n);
	}
	renderFile(e, t, n) {
		return E(this, void 0, void 0, function* () {
			return D(this._renderFile(e, t, Object.assign(Object.assign({}, n), { sync: !1 })));
		});
	}
	renderFileSync(e, t, n) {
		return O(this._renderFile(e, t, Object.assign(Object.assign({}, n), { sync: !0 })));
	}
	renderFileToNodeStream(e, t, n) {
		return E(this, void 0, void 0, function* () {
			let r = yield this.parseFile(e);
			return this.renderToNodeStream(r, t, n);
		});
	}
	_evalValue(e, t) {
		let n = new z(e, this), r = t instanceof Q ? t : new Q(t, this.options);
		return n.value(r);
	}
	evalValue(e, t) {
		return E(this, void 0, void 0, function* () {
			return D(this._evalValue(e, t));
		});
	}
	evalValueSync(e, t) {
		return O(this._evalValue(e, t));
	}
	registerFilter(e, t) {
		this.filters[e] = t;
	}
	registerTag(e, t) {
		this.tags[e] = o(t) ? t : Tn(t);
	}
	plugin(t) {
		return t.call(this, e);
	}
	express() {
		let e = this, t = !0;
		return function(n, r, i) {
			if (t) {
				t = !1;
				let n = F(this.root);
				e.options.root.unshift(...n), e.options.layouts.unshift(...n), e.options.partials.unshift(...n);
			}
			e.renderFile(n, r).then((e) => i(null, e), i);
		};
	}
	analyze(e, t = {}) {
		return E(this, void 0, void 0, function* () {
			return V(e, t);
		});
	}
	analyzeSync(e, t = {}) {
		return H(e, t);
	}
	parseAndAnalyze(e, t, n = {}) {
		return E(this, void 0, void 0, function* () {
			return V(this.parse(e, t), n);
		});
	}
	parseAndAnalyzeSync(e, t, n = {}) {
		return H(this.parse(e, t), n);
	}
	variables(e, t = {}) {
		return E(this, void 0, void 0, function* () {
			let n = yield V(a(e) ? this.parse(e) : e, t);
			return Object.keys(n.variables);
		});
	}
	variablesSync(e, t = {}) {
		let n = H(a(e) ? this.parse(e) : e, t);
		return Object.keys(n.variables);
	}
	fullVariables(e, t = {}) {
		return E(this, void 0, void 0, function* () {
			let n = yield V(a(e) ? this.parse(e) : e, t);
			return Array.from(new Set(Object.values(n.variables).flatMap((e) => e.map((e) => String(e)))));
		});
	}
	fullVariablesSync(e, t = {}) {
		let n = H(a(e) ? this.parse(e) : e, t);
		return Array.from(new Set(Object.values(n.variables).flatMap((e) => e.map((e) => String(e)))));
	}
	variableSegments(e, t = {}) {
		return E(this, void 0, void 0, function* () {
			let n = yield V(a(e) ? this.parse(e) : e, t);
			return Array.from(ge(Object.values(n.variables).flatMap((e) => e.map((e) => e.toArray()))));
		});
	}
	variableSegmentsSync(e, t = {}) {
		let n = H(a(e) ? this.parse(e) : e, t);
		return Array.from(ge(Object.values(n.variables).flatMap((e) => e.map((e) => e.toArray()))));
	}
	globalVariables(e, t = {}) {
		return E(this, void 0, void 0, function* () {
			let n = yield V(a(e) ? this.parse(e) : e, t);
			return Object.keys(n.globals);
		});
	}
	globalVariablesSync(e, t = {}) {
		let n = H(a(e) ? this.parse(e) : e, t);
		return Object.keys(n.globals);
	}
	globalFullVariables(e, t = {}) {
		return E(this, void 0, void 0, function* () {
			let n = yield V(a(e) ? this.parse(e) : e, t);
			return Array.from(new Set(Object.values(n.globals).flatMap((e) => e.map((e) => String(e)))));
		});
	}
	globalFullVariablesSync(e, t = {}) {
		let n = H(a(e) ? this.parse(e) : e, t);
		return Array.from(new Set(Object.values(n.globals).flatMap((e) => e.map((e) => String(e)))));
	}
	globalVariableSegments(e, t = {}) {
		return E(this, void 0, void 0, function* () {
			let n = yield V(a(e) ? this.parse(e) : e, t);
			return Array.from(ge(Object.values(n.globals).flatMap((e) => e.map((e) => e.toArray()))));
		});
	}
	globalVariableSegmentsSync(e, t = {}) {
		let n = H(a(e) ? this.parse(e) : e, t);
		return Array.from(ge(Object.values(n.globals).flatMap((e) => e.map((e) => e.toArray()))));
	}
};
//#endregion
export { ha as Liquid };

//# sourceMappingURL=liquid.browser-rMoPo2t_.js.map