module.exports = [ "[externals]/postcss [external] (postcss, cjs, [project]/node_modules/postcss)", ((__turbopack_context__, module, exports) => { var mod = __turbopack_context__.x("postcss-9745a0d11e3197ae", () => require("postcss-9745a0d11e3197ae")); module.exports = mod; }), "[project]/node_modules/dayjs/dayjs.min.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => { !function(t, e) { ("TURBOPACK compile-time truthy", 1) ? module.exports = e() : "TURBOPACK unreachable"; }(/*TURBOPACK member replacement*/ __turbopack_context__.e, function() { "use strict"; var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t) { var e = [ "th", "st", "nd", "rd" ], n = t % 100; return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]"; } }, m = function(t, e, n) { var r = String(t); return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t; }, v = { s: m, z: function(t) { var e = -t.utcOffset(), n = Math.abs(e), r = Math.floor(n / 60), i = n % 60; return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0"); }, m: function t(e, n) { if (e.date() < n.date()) return -t(n, e); var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), i = e.clone().add(r, c), s = n - i < 0, u = e.clone().add(r + (s ? -1 : 1), c); return +(-(r + (n - i) / (s ? i - u : u - i)) || 0); }, a: function(t) { return t < 0 ? Math.ceil(t) || 0 : Math.floor(t); }, p: function(t) { return ({ M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f })[t] || String(t || "").toLowerCase().replace(/s$/, ""); }, u: function(t) { return void 0 === t; } }, g = "en", D = {}; D[g] = M; var p = "$isDayjsObject", S = function(t) { return t instanceof _ || !(!t || !t[p]); }, w = function t(e, n, r) { var i; if (!e) return g; if ("string" == typeof e) { var s = e.toLowerCase(); D[s] && (i = s), n && (D[s] = n, i = s); var u = e.split("-"); if (!i && u.length > 1) return t(u[0]); } else { var a = e.name; D[a] = e, i = a; } return !r && i && (g = i), i || !r && g; }, O = function(t, e) { if (S(t)) return t.clone(); var n = "object" == typeof e ? e : {}; return n.date = t, n.args = arguments, new _(n); }, b = v; b.l = w, b.i = S, b.w = function(t, e) { return O(t, { locale: e.$L, utc: e.$u, x: e.$x, $offset: e.$offset }); }; var _ = function() { function M(t) { this.$L = w(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[p] = !0; } var m = M.prototype; return m.parse = function(t) { this.$d = function(t) { var e = t.date, n = t.utc; if (null === e) return new Date(NaN); if (b.u(e)) return new Date; if (e instanceof Date) return new Date(e); if ("string" == typeof e && !/Z$/i.test(e)) { var r = e.match($); if (r) { var i = r[2] - 1 || 0, s = (r[7] || "0").substring(0, 3); return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s); } } return new Date(e); }(t), this.init(); }, m.init = function() { var t = this.$d; this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds(); }, m.$utils = function() { return b; }, m.isValid = function() { return !(this.$d.toString() === l); }, m.isSame = function(t, e) { var n = O(t); return this.startOf(e) <= n && n <= this.endOf(e); }, m.isAfter = function(t, e) { return O(t) < this.startOf(e); }, m.isBefore = function(t, e) { return this.endOf(e) < O(t); }, m.$g = function(t, e, n) { return b.u(t) ? this[e] : this.set(n, t); }, m.unix = function() { return Math.floor(this.valueOf() / 1e3); }, m.valueOf = function() { return this.$d.getTime(); }, m.startOf = function(t, e) { var n = this, r = !!b.u(e) || e, f = b.p(t), l = function(t, e) { var i = b.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n); return r ? i : i.endOf(a); }, $ = function(t, e) { return b.w(n.toDate()[t].apply(n.toDate("s"), (r ? [ 0, 0, 0, 0 ] : [ 23, 59, 59, 999 ]).slice(e)), n); }, y = this.$W, M = this.$M, m = this.$D, v = "set" + (this.$u ? "UTC" : ""); switch(f){ case h: return r ? l(1, 0) : l(31, 11); case c: return r ? l(1, M) : l(0, M + 1); case o: var g = this.$locale().weekStart || 0, D = (y < g ? y + 7 : y) - g; return l(r ? m - D : m + (6 - D), M); case a: case d: return $(v + "Hours", 0); case u: return $(v + "Minutes", 1); case s: return $(v + "Seconds", 2); case i: return $(v + "Milliseconds", 3); default: return this.clone(); } }, m.endOf = function(t) { return this.startOf(t, !1); }, m.$set = function(t, e) { var n, o = b.p(t), f = "set" + (this.$u ? "UTC" : ""), l = (n = {}, n[a] = f + "Date", n[d] = f + "Date", n[c] = f + "Month", n[h] = f + "FullYear", n[u] = f + "Hours", n[s] = f + "Minutes", n[i] = f + "Seconds", n[r] = f + "Milliseconds", n)[o], $ = o === a ? this.$D + (e - this.$W) : e; if (o === c || o === h) { var y = this.clone().set(d, 1); y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d; } else l && this.$d[l]($); return this.init(), this; }, m.set = function(t, e) { return this.clone().$set(t, e); }, m.get = function(t) { return this[b.p(t)](); }, m.add = function(r, f) { var d, l = this; r = Number(r); var $ = b.p(f), y = function(t) { var e = O(l); return b.w(e.date(e.date() + Math.round(t * r)), l); }; if ($ === c) return this.set(c, this.$M + r); if ($ === h) return this.set(h, this.$y + r); if ($ === a) return y(1); if ($ === o) return y(7); var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1, m = this.$d.getTime() + r * M; return b.w(m, this); }, m.subtract = function(t, e) { return this.add(-1 * t, e); }, m.format = function(t) { var e = this, n = this.$locale(); if (!this.isValid()) return n.invalidDate || l; var r = t || "YYYY-MM-DDTHH:mm:ssZ", i = b.z(this), s = this.$H, u = this.$m, a = this.$M, o = n.weekdays, c = n.months, f = n.meridiem, h = function(t, n, i, s) { return t && (t[n] || t(e, r)) || i[n].slice(0, s); }, d = function(t) { return b.s(s % 12 || 12, t, "0"); }, $ = f || function(t, e, n) { var r = t < 12 ? "AM" : "PM"; return n ? r.toLowerCase() : r; }; return r.replace(y, function(t, r) { return r || function(t) { switch(t){ case "YY": return String(e.$y).slice(-2); case "YYYY": return b.s(e.$y, 4, "0"); case "M": return a + 1; case "MM": return b.s(a + 1, 2, "0"); case "MMM": return h(n.monthsShort, a, c, 3); case "MMMM": return h(c, a); case "D": return e.$D; case "DD": return b.s(e.$D, 2, "0"); case "d": return String(e.$W); case "dd": return h(n.weekdaysMin, e.$W, o, 2); case "ddd": return h(n.weekdaysShort, e.$W, o, 3); case "dddd": return o[e.$W]; case "H": return String(s); case "HH": return b.s(s, 2, "0"); case "h": return d(1); case "hh": return d(2); case "a": return $(s, u, !0); case "A": return $(s, u, !1); case "m": return String(u); case "mm": return b.s(u, 2, "0"); case "s": return String(e.$s); case "ss": return b.s(e.$s, 2, "0"); case "SSS": return b.s(e.$ms, 3, "0"); case "Z": return i; } return null; }(t) || i.replace(":", ""); }); }, m.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); }, m.diff = function(r, d, l) { var $, y = this, M = b.p(d), m = O(r), v = (m.utcOffset() - this.utcOffset()) * e, g = this - m, D = function() { return b.m(y, m); }; switch(M){ case h: $ = D() / 12; break; case c: $ = D(); break; case f: $ = D() / 3; break; case o: $ = (g - v) / 6048e5; break; case a: $ = (g - v) / 864e5; break; case u: $ = g / n; break; case s: $ = g / e; break; case i: $ = g / t; break; default: $ = g; } return l ? $ : b.a($); }, m.daysInMonth = function() { return this.endOf(c).$D; }, m.$locale = function() { return D[this.$L]; }, m.locale = function(t, e) { if (!t) return this.$L; var n = this.clone(), r = w(t, e, !0); return r && (n.$L = r), n; }, m.clone = function() { return b.w(this.$d, this); }, m.toDate = function() { return new Date(this.valueOf()); }, m.toJSON = function() { return this.isValid() ? this.toISOString() : null; }, m.toISOString = function() { return this.$d.toISOString(); }, m.toString = function() { return this.$d.toUTCString(); }, M; }(), Y = _.prototype; return O.prototype = Y, [ [ "$ms", r ], [ "$s", i ], [ "$m", s ], [ "$H", u ], [ "$W", a ], [ "$M", c ], [ "$y", h ], [ "$D", d ] ].forEach(function(t) { Y[t[1]] = function(e) { return this.$g(e, t[0], t[1]); }; }), O.extend = function(t, e) { return t.$i || (t(e, _, O), t.$i = !0), O; }, O.locale = w, O.isDayjs = S, O.unix = function(t) { return O(1e3 * t); }, O.en = D[g], O.Ls = D, O.p = {}, O; }); }), "[project]/node_modules/deepmerge/dist/cjs.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; var isMergeableObject = function isMergeableObject(value) { return isNonNullObject(value) && !isSpecial(value); }; function isNonNullObject(value) { return !!value && typeof value === 'object'; } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isReactElement(value); } // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25 var canUseSymbol = typeof Symbol === 'function' && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE; } function emptyTarget(val) { return Array.isArray(val) ? [] : {}; } function cloneUnlessOtherwiseSpecified(value, options) { return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value; } function defaultArrayMerge(target, source, options) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options); }); } function getMergeFunction(key, options) { if (!options.customMerge) { return deepmerge; } var customMerge = options.customMerge(key); return typeof customMerge === 'function' ? customMerge : deepmerge; } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { return Object.propertyIsEnumerable.call(target, symbol); }) : []; } function getKeys(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); } function propertyIsOnObject(object, property) { try { return property in object; } catch (_) { return false; } } // Protects from prototype poisoning and unexpected merging up the prototype chain. function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet, && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain, && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable. ; } function mergeObject(target, source, options) { var destination = {}; if (options.isMergeableObject(target)) { getKeys(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); }); } getKeys(source).forEach(function(key) { if (propertyIsUnsafe(target, key)) { return; } if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { destination[key] = getMergeFunction(key, options)(target[key], source[key], options); } else { destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); } }); return destination; } function deepmerge(target, source, options) { options = options || {}; options.arrayMerge = options.arrayMerge || defaultArrayMerge; options.isMergeableObject = options.isMergeableObject || isMergeableObject; // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge() // implementations can use it. The caller may not replace it. options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneUnlessOtherwiseSpecified(source, options); } else if (sourceIsArray) { return options.arrayMerge(target, source, options); } else { return mergeObject(target, source, options); } } deepmerge.all = function deepmergeAll(array, options) { if (!Array.isArray(array)) { throw new Error('first argument should be an array'); } return array.reduce(function(prev, next) { return deepmerge(prev, next, options); }, {}); }; var deepmerge_1 = deepmerge; module.exports = deepmerge_1; }), "[project]/node_modules/dom-serializer/dist/foreign-names.js [app-ssr] (ecmascript)", ((__turbopack_context__) => { "use strict"; /** * Mixed-case SVG and MathML element names recognized in foreign content. * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign */ __turbopack_context__.s([ "attributeNames", ()=>attributeNames, "elementNames", ()=>elementNames ]); const elementNames = new Map("altGlyph altGlyphDef altGlyphItem animateColor animateMotion animateTransform clipPath feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence foreignObject glyphRef linearGradient radialGradient textPath".split(" ").map((name)=>[ name.toLowerCase(), name ])); const attributeNames = new Map("definitionURL attributeName attributeType baseFrequency baseProfile calcMode clipPathUnits diffuseConstant edgeMode filterUnits glyphRef gradientTransform gradientUnits kernelMatrix kernelUnitLength keyPoints keySplines keyTimes lengthAdjust limitingConeAngle markerHeight markerUnits markerWidth maskContentUnits maskUnits numOctaves pathLength patternContentUnits patternTransform patternUnits pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits refX refY repeatCount repeatDur requiredExtensions requiredFeatures specularConstant specularExponent spreadMethod startOffset stdDeviation stitchTiles surfaceScale systemLanguage tableValues targetX targetY textLength viewBox viewTarget xChannelSelector yChannelSelector zoomAndPan".split(" ").map((name)=>[ name.toLowerCase(), name ])); }), "[project]/node_modules/dom-serializer/dist/index.js [app-ssr] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "default", ()=>__TURBOPACK__default__export__, "render", ()=>render ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domelementtype$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/domelementtype/dist/index.js [app-ssr] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$entities$2f$dist$2f$escape$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/entities/dist/escape.js [app-ssr] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$dom$2d$serializer$2f$dist$2f$foreign$2d$names$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/dom-serializer/dist/foreign-names.js [app-ssr] (ecmascript)"); ; ; ; // ── Constants ──────────────────────────────────────────────────────── /** Elements whose text content is never entity-encoded. */ const unencodedElements = new Set("style script xmp iframe noembed noframes plaintext noscript".split(" ")); /** HTML void elements — they cannot have children. */ const voidElements = new Set("area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr".split(" ")); /** Elements that switch the parser into foreign (XML-like) mode. */ const foreignElements = new Set([ "svg", "math" ]); /** * Foreign-mode integration points: children of these elements are parsed * as HTML again, not as foreign content. */ const foreignModeIntegrationPoints = new Set("mi mo mn ms mtext annotation-xml foreignObject desc title".split(" ")); function render(node, options = {}) { const nodes = "length" in node ? node : [ node ]; /* * `xmlMode` is threaded as a separate argument through the internal * functions so that foreign-mode transitions (svg/mathml ↔ html) can * adjust it without copying the options object on every element. */ const xmlMode = options.xmlMode ?? false; let output = ""; // eslint-disable-next-line unicorn/no-for-loop for(let index = 0; index < nodes.length; index++){ output += renderNode(nodes[index], options, xmlMode); } return output; } const __TURBOPACK__default__export__ = render; // ── Internal rendering ─────────────────────────────────────────────── /** * Render an array of child nodes (skips the single-node wrapping in `render`). * @param children The child nodes to render. * @param options The serialization options. * @param xmlMode The XML mode to use. */ function renderChildren(children, options, xmlMode) { let output = ""; // eslint-disable-next-line unicorn/no-for-loop for(let index = 0; index < children.length; index++){ output += renderNode(children[index], options, xmlMode); } return output; } function renderNode(node, options, xmlMode) { switch(node.type){ case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domelementtype$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Root"]: { return renderChildren(node.children, options, xmlMode); } case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domelementtype$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Directive"]: { return `<${node.data}>`; } case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domelementtype$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Comment"]: { return ``; } case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domelementtype$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["CDATA"]: { return ``; } case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domelementtype$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Script"]: case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domelementtype$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Style"]: case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domelementtype$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Tag"]: { return renderTag(node, options, xmlMode); } case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domelementtype$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Text"]: { const element = node; const data = element.data || ""; /* * Skip encoding when entities weren't decoded on input, or when * inside a raw-text element (script, style, etc.) in HTML mode. */ if ((options.encodeEntities ?? options.decodeEntities) !== false && !(!xmlMode && element.parent && unencodedElements.has(element.parent.name))) { // `xmlMode: "foreign"` is truthy return xmlMode || options.encodeEntities !== "utf8" ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$entities$2f$dist$2f$escape$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["encodeXML"])(data) : (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$entities$2f$dist$2f$escape$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["escapeText"])(data); } return data; } } } function renderTag(element, options, xmlMode) { if (xmlMode === "foreign") { // Correct lowercase element names back to their canonical mixed-case form element.name = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$dom$2d$serializer$2f$dist$2f$foreign$2d$names$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["elementNames"].get(element.name) ?? element.name; // Integration points exit foreign mode: their children are HTML if (element.parent && foreignModeIntegrationPoints.has(element.parent.name)) { xmlMode = false; } } if (!xmlMode && foreignElements.has(element.name)) { xmlMode = "foreign"; } const { name, children } = element; // Cache the void-element check — used for both self-closing and closing-tag logic const isVoid = !xmlMode && voidElements.has(name); let tag = `<${name}${formatAttributes(element.attribs, options, xmlMode)}`; if (children.length === 0 && (xmlMode ? options.selfClosingTags !== false : options.selfClosingTags && isVoid)) { // XML: `
`, HTML: `
` tag += xmlMode ? "/>" : " />"; } else { tag += ">"; if (children.length > 0) { tag += renderChildren(children, options, xmlMode); } if (!isVoid) { tag += ``; } } return tag; } // ── Attribute formatting ───────────────────────────────────────────── function replaceQuotes(value) { return value.replaceAll('"', """); } /** * Serialize an element's attribute map to a string. * * Returns a string with a leading space before each attribute, or an * empty string if there are no attributes. This convention lets the * caller unconditionally concatenate the result onto the tag name. * @param attributes * @param options * @param xmlMode */ function formatAttributes(attributes, options, xmlMode) { if (!attributes) return ""; /* * Pick the right encoder: * - Encoding disabled → only escape double-quotes (for valid attributes) * - XML / non-utf8 → full numeric entity encoding (encodeXML) * - HTML + utf8 → minimal escaping (escapeAttribute) */ const encode = (options.encodeEntities ?? options.decodeEntities) === false ? replaceQuotes : xmlMode || options.encodeEntities !== "utf8" ? __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$entities$2f$dist$2f$escape$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["encodeXML"] : __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$entities$2f$dist$2f$escape$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["escapeAttribute"]; const isForeign = xmlMode === "foreign"; const showEmpty = !!(options.emptyAttrs ?? xmlMode); let result = ""; for(const key in attributes){ if (!Object.hasOwn(attributes, key)) continue; const value = attributes[key]; const k = isForeign ? __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$dom$2d$serializer$2f$dist$2f$foreign$2d$names$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["attributeNames"].get(key) ?? key : key; result += !showEmpty && (value == null || value === "") ? ` ${k}` : ` ${k}="${encode(value == null ? "" : String(value))}"`; } return result; } }), "[project]/node_modules/domelementtype/dist/index.js [app-ssr] (ecmascript)", ((__turbopack_context__) => { "use strict"; /** Types of elements found in htmlparser2's DOM */ __turbopack_context__.s([ "CDATA", ()=>CDATA, "Comment", ()=>Comment, "Directive", ()=>Directive, "Doctype", ()=>Doctype, "ElementType", ()=>ElementType, "Root", ()=>Root, "Script", ()=>Script, "Style", ()=>Style, "Tag", ()=>Tag, "Text", ()=>Text, "isTag", ()=>isTag ]); var ElementType; (function(ElementType) { /** Type for the root element of a document */ ElementType["Root"] = "root"; /** Type for Text */ ElementType["Text"] = "text"; /** Type for */ ElementType["Directive"] = "directive"; /** Type for */ ElementType["Comment"] = "comment"; /** Type for `. this.sequenceIndex = Number(c === CharCodes.Lt); } } stateBeforeTagName(c) { if (c === CharCodes.ExclamationMark) { this.state = State.BeforeDeclaration; this.sectionStart = this.index + 1; } else if (c === CharCodes.Questionmark) { if (this.xmlMode) { this.state = State.InProcessingInstruction; this.sequenceIndex = 0; this.sectionStart = this.index + 1; } else { this.state = State.InSpecialComment; this.sectionStart = this.index; } } else if (this.isTagStartChar(c)) { this.sectionStart = this.index; const special = this.xmlMode || this.cbs.isInForeignContext?.() ? undefined : specialStartSequences.get(c | 0x20); if (special === undefined) { this.state = State.InTagName; } else { this.isSpecial = true; this.currentSequence = special; this.sequenceIndex = 3; this.state = State.SpecialStartSequence; } } else if (c === CharCodes.Slash) { this.state = State.BeforeClosingTagName; } else { this.state = State.Text; this.stateText(c); } } stateInTagName(c) { if (isEndOfTagSection(c)) { this.cbs.onopentagname(this.sectionStart, this.index); this.sectionStart = -1; this.state = State.BeforeAttributeName; this.stateBeforeAttributeName(c); } } stateBeforeClosingTagName(c) { if (isWhitespace(c)) { if (this.xmlMode) { // Ignore } else { this.state = State.InSpecialComment; this.sectionStart = this.index; } } else if (c === CharCodes.Gt) { this.state = State.Text; if (!this.xmlMode) { this.sectionStart = this.index + 1; } } else { this.state = this.isTagStartChar(c) ? State.InClosingTagName : State.InSpecialComment; this.sectionStart = this.index; } } stateInClosingTagName(c) { if (isEndOfTagSection(c)) { this.cbs.onclosetag(this.sectionStart, this.index); this.sectionStart = -1; this.state = State.AfterClosingTagName; this.stateAfterClosingTagName(c); } } stateAfterClosingTagName(c) { // Skip everything until ">" if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { this.state = State.Text; this.sectionStart = this.index + 1; } } stateBeforeAttributeName(c) { if (c === CharCodes.Gt) { this.cbs.onopentagend(this.index); this.enterTagBody(); this.sectionStart = this.index + 1; } else if (c === CharCodes.Slash) { this.state = State.InSelfClosingTag; } else if (!isWhitespace(c)) { this.state = State.InAttributeName; this.sectionStart = this.index; } } /** * Handle `/` before `>` in an opening tag. * * In HTML mode, text-only tags ignore the self-closing flag and still enter * their raw-text/RCDATA/plaintext state unless self-closing tags are being * recognized. In XML mode, or for ordinary tags, the tokenizer returns to * regular text parsing after emitting the self-closing callback. * @param c Current character code point. */ stateInSelfClosingTag(c) { if (c === CharCodes.Gt) { this.cbs.onselfclosingtag(this.index); this.sectionStart = this.index + 1; if (!this.recognizeSelfClosing) { this.enterTagBody(); return; } this.state = State.Text; this.isSpecial = false; // Reset special state, in case of self-closing special tags this.currentSequence = Sequences.Empty; } else if (!isWhitespace(c)) { this.state = State.BeforeAttributeName; this.stateBeforeAttributeName(c); } } stateInAttributeName(c) { if (c === CharCodes.Eq || isEndOfTagSection(c)) { this.cbs.onattribname(this.sectionStart, this.index); this.sectionStart = this.index; this.state = State.AfterAttributeName; this.stateAfterAttributeName(c); } } stateAfterAttributeName(c) { if (c === CharCodes.Eq) { this.state = State.BeforeAttributeValue; } else if (c === CharCodes.Slash || c === CharCodes.Gt) { this.cbs.onattribend(QuoteType.NoValue, this.sectionStart); this.sectionStart = -1; this.state = State.BeforeAttributeName; this.stateBeforeAttributeName(c); } else if (!isWhitespace(c)) { this.cbs.onattribend(QuoteType.NoValue, this.sectionStart); this.state = State.InAttributeName; this.sectionStart = this.index; } } stateBeforeAttributeValue(c) { if (c === CharCodes.DoubleQuote) { this.state = State.InAttributeValueDq; this.sectionStart = this.index + 1; } else if (c === CharCodes.SingleQuote) { this.state = State.InAttributeValueSq; this.sectionStart = this.index + 1; } else if (!isWhitespace(c)) { this.sectionStart = this.index; this.state = State.InAttributeValueNq; this.stateInAttributeValueNoQuotes(c); // Reconsume token } } handleInAttributeValue(c, quote) { if (c === quote || !this.decodeEntities && this.fastForwardTo(quote)) { this.cbs.onattribdata(this.sectionStart, this.index); this.sectionStart = -1; this.cbs.onattribend(quote === CharCodes.DoubleQuote ? QuoteType.Double : QuoteType.Single, this.index + 1); this.state = State.BeforeAttributeName; } else if (this.decodeEntities && c === CharCodes.Amp) { this.startEntity(); } } stateInAttributeValueDoubleQuotes(c) { this.handleInAttributeValue(c, CharCodes.DoubleQuote); } stateInAttributeValueSingleQuotes(c) { this.handleInAttributeValue(c, CharCodes.SingleQuote); } stateInAttributeValueNoQuotes(c) { if (isWhitespace(c) || c === CharCodes.Gt) { this.cbs.onattribdata(this.sectionStart, this.index); this.sectionStart = -1; this.cbs.onattribend(QuoteType.Unquoted, this.index); this.state = State.BeforeAttributeName; this.stateBeforeAttributeName(c); } else if (this.decodeEntities && c === CharCodes.Amp) { this.startEntity(); } } /** * Distinguish between CDATA, declarations, HTML comments, and HTML bogus * comments after ``. * @param c Current character code point. */ stateBeforeDeclaration(c) { if (c === CharCodes.OpeningSquareBracket) { this.state = State.CDATASequence; this.sequenceIndex = 0; } else if (this.xmlMode) { this.state = c === CharCodes.Dash ? State.BeforeComment : State.InDeclaration; } else if ((c | 0x20) === Sequences.Doctype[0]) { this.state = State.DeclarationSequence; this.currentSequence = Sequences.Doctype; this.sequenceIndex = 1; } else if (c === CharCodes.Gt) { this.cbs.oncomment(this.sectionStart, this.index, 0); this.state = State.Text; this.sectionStart = this.index + 1; } else if (c === CharCodes.Dash) { this.state = State.BeforeComment; } else { this.state = State.InSpecialComment; } } /** * Continue matching `doctype` after `` constructs. * @param c Current character code point. */ stateDeclarationSequence(c) { if (this.sequenceIndex === this.currentSequence.length) { this.state = State.InDeclaration; this.stateInDeclaration(c); } else if ((c | 0x20) === this.currentSequence[this.sequenceIndex]) { this.sequenceIndex += 1; } else if (c === CharCodes.Gt) { this.cbs.oncomment(this.sectionStart, this.index, 0); this.state = State.Text; this.sectionStart = this.index + 1; } else { this.state = State.InSpecialComment; } } stateInDeclaration(c) { if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { this.cbs.ondeclaration(this.sectionStart, this.index); this.state = State.Text; this.sectionStart = this.index + 1; } } /** * XML processing instructions (``). * * In HTML mode `` closes the PI. this.sequenceIndex = 1; } else if (c === CharCodes.Gt && this.sequenceIndex === 1) { this.cbs.onprocessinginstruction(this.sectionStart, this.index - 1); this.sequenceIndex = 0; this.state = State.Text; this.sectionStart = this.index + 1; } else { // Keep scanning for the next `?`, which can start a closing `?>`. this.sequenceIndex = Number(this.fastForwardTo(CharCodes.Questionmark)); } } stateBeforeComment(c) { if (c === CharCodes.Dash) { this.state = State.InCommentLike; this.currentSequence = Sequences.CommentEnd; this.sequenceIndex = 0; this.sectionStart = this.index + 1; } else if (this.xmlMode) { this.state = State.InDeclaration; } else if (c === CharCodes.Gt) { this.cbs.oncomment(this.sectionStart, this.index, 0); this.state = State.Text; this.sectionStart = this.index + 1; } else { this.state = State.InSpecialComment; } } stateInSpecialComment(c) { if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { this.cbs.oncomment(this.sectionStart, this.index, 0); this.state = State.Text; this.sectionStart = this.index + 1; } } startEntity() { this.baseState = this.state; this.state = State.InEntity; this.entityStart = this.index; this.entityDecoder.startEntity(this.xmlMode ? __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$entities$2f$dist$2f$decode$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["DecodingMode"].Strict : this.baseState === State.Text || this.baseState === State.InSpecialTag ? __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$entities$2f$dist$2f$decode$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["DecodingMode"].Legacy : __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$entities$2f$dist$2f$decode$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["DecodingMode"].Attribute); } stateInEntity() { const indexInBuffer = this.index - this.offset; const length = this.entityDecoder.write(this.buffer, indexInBuffer); // If `length` is positive, we are done with the entity. if (length >= 0) { this.state = this.baseState; if (length === 0) { this.index -= 1; } } else { if (indexInBuffer < this.buffer.length && this.buffer.charCodeAt(indexInBuffer) === CharCodes.Amp) { this.state = this.baseState; this.index -= 1; return; } // Mark buffer as consumed. this.index = this.offset + this.buffer.length - 1; } } /** * Remove data that has already been consumed from the buffer. */ cleanup() { // If we are inside of text or attributes, emit what we already have. if (this.running && this.sectionStart !== this.index) { if (this.state === State.Text || this.state === State.InPlainText || this.state === State.InSpecialTag && this.sequenceIndex === 0) { this.cbs.ontext(this.sectionStart, this.index); this.sectionStart = this.index; } else if (this.state === State.InAttributeValueDq || this.state === State.InAttributeValueSq || this.state === State.InAttributeValueNq) { this.cbs.onattribdata(this.sectionStart, this.index); this.sectionStart = this.index; } } } shouldContinue() { return this.index < this.buffer.length + this.offset && this.running; } /** * Iterates through the buffer, calling the function corresponding to the current state. * * States that are more likely to be hit are higher up, as a performance improvement. */ parse() { while(this.shouldContinue()){ const c = this.buffer.charCodeAt(this.index - this.offset); switch(this.state){ case State.Text: { this.stateText(c); break; } case State.InPlainText: { // Skip to end of buffer; cleanup() emits the text. this.index = this.buffer.length + this.offset - 1; break; } case State.SpecialStartSequence: { this.stateSpecialStartSequence(c); break; } case State.InSpecialTag: { this.stateInSpecialTag(c); break; } case State.CDATASequence: { this.stateCDATASequence(c); break; } case State.DeclarationSequence: { this.stateDeclarationSequence(c); break; } case State.InAttributeValueDq: { this.stateInAttributeValueDoubleQuotes(c); break; } case State.InAttributeName: { this.stateInAttributeName(c); break; } case State.InCommentLike: { this.stateInCommentLike(c); break; } case State.InSpecialComment: { this.stateInSpecialComment(c); break; } case State.BeforeAttributeName: { this.stateBeforeAttributeName(c); break; } case State.InTagName: { this.stateInTagName(c); break; } case State.InClosingTagName: { this.stateInClosingTagName(c); break; } case State.BeforeTagName: { this.stateBeforeTagName(c); break; } case State.AfterAttributeName: { this.stateAfterAttributeName(c); break; } case State.InAttributeValueSq: { this.stateInAttributeValueSingleQuotes(c); break; } case State.BeforeAttributeValue: { this.stateBeforeAttributeValue(c); break; } case State.BeforeClosingTagName: { this.stateBeforeClosingTagName(c); break; } case State.AfterClosingTagName: { this.stateAfterClosingTagName(c); break; } case State.InAttributeValueNq: { this.stateInAttributeValueNoQuotes(c); break; } case State.InSelfClosingTag: { this.stateInSelfClosingTag(c); break; } case State.InDeclaration: { this.stateInDeclaration(c); break; } case State.BeforeDeclaration: { this.stateBeforeDeclaration(c); break; } case State.BeforeComment: { this.stateBeforeComment(c); break; } case State.InProcessingInstruction: { this.stateInProcessingInstruction(c); break; } case State.InEntity: { this.stateInEntity(); break; } } this.index++; } this.cleanup(); } finish() { if (this.state === State.InEntity) { this.entityDecoder.end(); this.state = this.baseState; } this.handleTrailingData(); this.cbs.onend(); } handleTrailingCommentLikeData(endIndex) { if (this.state !== State.InCommentLike) { return false; } if (this.currentSequence === Sequences.CdataEnd) { if (this.xmlMode) { if (this.sectionStart < endIndex) { this.cbs.oncdata(this.sectionStart, endIndex, 0); } } else { /* In HTML mode, unclosed CDATA is a bogus comment. */ const cdataStart = this.sectionStart - Sequences.Cdata.length - 1; this.cbs.oncomment(cdataStart, endIndex, 0); } } else { const offset = this.xmlMode ? 0 : Math.min(this.sequenceIndex, Sequences.CommentEnd.length - 1); this.cbs.oncomment(this.sectionStart, endIndex, offset); } return true; } handleTrailingMarkupDeclaration(endIndex) { if (this.xmlMode) { switch(this.state){ case State.InSpecialComment: case State.BeforeComment: case State.CDATASequence: case State.DeclarationSequence: case State.InDeclaration: { this.cbs.ontext(this.sectionStart, endIndex); return true; } default: { return false; } } } switch(this.state){ case State.BeforeDeclaration: case State.InSpecialComment: case State.BeforeComment: case State.CDATASequence: { this.cbs.oncomment(this.sectionStart, endIndex, 0); return true; } case State.DeclarationSequence: { if (this.sequenceIndex !== Sequences.Doctype.length) { this.cbs.oncomment(this.sectionStart, endIndex, 0); } return true; } case State.InDeclaration: { return true; } default: { return false; } } } /** Handle any trailing data. */ handleTrailingData() { const endIndex = this.buffer.length + this.offset; if (this.handleTrailingCommentLikeData(endIndex) || this.handleTrailingMarkupDeclaration(endIndex)) { return; } // If there is no remaining data, we are done. if (this.sectionStart >= endIndex) { return; } switch(this.state){ case State.InTagName: case State.BeforeAttributeName: case State.BeforeAttributeValue: case State.AfterAttributeName: case State.InAttributeName: case State.InAttributeValueSq: case State.InAttributeValueDq: case State.InAttributeValueNq: case State.InClosingTagName: { break; } default: { this.cbs.ontext(this.sectionStart, endIndex); } } } emitCodePoint(cp, consumed) { if (this.baseState !== State.Text && this.baseState !== State.InSpecialTag) { if (this.sectionStart < this.entityStart) { this.cbs.onattribdata(this.sectionStart, this.entityStart); } this.sectionStart = this.entityStart + consumed; this.index = this.sectionStart - 1; this.cbs.onattribentity(cp); } else { if (this.sectionStart < this.entityStart) { this.cbs.ontext(this.sectionStart, this.entityStart); } this.sectionStart = this.entityStart + consumed; this.index = this.sectionStart - 1; this.cbs.ontextentity(cp, this.sectionStart); } } } }), "[project]/node_modules/htmlparser2/dist/index.js [app-ssr] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "DefaultHandler", ()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domhandler$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["DomHandler"], "DomHandler", ()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domhandler$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["DomHandler"], "DomUtils", ()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domutils$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__, "ElementType", ()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domelementtype$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__, "Parser", ()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$htmlparser2$2f$dist$2f$Parser$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Parser"], "QuoteType", ()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$htmlparser2$2f$dist$2f$Tokenizer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["QuoteType"], "Tokenizer", ()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$htmlparser2$2f$dist$2f$Tokenizer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"], "createDocumentStream", ()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$htmlparser2$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["createDocumentStream"], "getFeed", ()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domutils$2f$dist$2f$feeds$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getFeed"], "parseDocument", ()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$htmlparser2$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["parseDocument"], "parseFeed", ()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$htmlparser2$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["parseFeed"] ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$htmlparser2$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/htmlparser2/dist/index.js [app-ssr] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$htmlparser2$2f$dist$2f$Parser$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/htmlparser2/dist/Parser.js [app-ssr] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domhandler$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/domhandler/dist/index.js [app-ssr] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domelementtype$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/domelementtype/dist/index.js [app-ssr] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$htmlparser2$2f$dist$2f$Tokenizer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/htmlparser2/dist/Tokenizer.js [app-ssr] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domutils$2f$dist$2f$feeds$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/domutils/dist/feeds.js [app-ssr] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domutils$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/domutils/dist/index.js [app-ssr] (ecmascript)"); }), "[project]/node_modules/htmlparser2/dist/index.js [app-ssr] (ecmascript) ", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "createDocumentStream", ()=>createDocumentStream, "parseDocument", ()=>parseDocument, "parseFeed", ()=>parseFeed ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$htmlparser2$2f$dist$2f$Parser$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/htmlparser2/dist/Parser.js [app-ssr] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domhandler$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/domhandler/dist/index.js [app-ssr] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domutils$2f$dist$2f$feeds$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/domutils/dist/feeds.js [app-ssr] (ecmascript)"); ; ; ; ; function parseDocument(data, options) { const handler = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domhandler$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["DomHandler"](undefined, options); new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$htmlparser2$2f$dist$2f$Parser$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Parser"](handler, options).end(data); return handler.root; } function createDocumentStream(callback, options, elementCallback) { const handler = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domhandler$2f$dist$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["DomHandler"]((error)=>callback(error, handler.root), options, elementCallback); return new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$htmlparser2$2f$dist$2f$Parser$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Parser"](handler, options); } ; ; ; ; const parseFeedDefaultOptions = { xmlMode: true }; function parseFeed(feed, options = parseFeedDefaultOptions) { return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$domutils$2f$dist$2f$feeds$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getFeed"])(parseDocument(feed, options).children); } ; }), "[project]/node_modules/is-plain-object/dist/is-plain-object.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ function isObject(o) { return Object.prototype.toString.call(o) === '[object Object]'; } function isPlainObject(o) { var ctor, prot; if (isObject(o) === false) return false; // If has modified constructor ctor = o.constructor; if (ctor === undefined) return true; // If has modified prototype prot = ctor.prototype; if (isObject(prot) === false) return false; // If constructor does not have an Object-specific method if (prot.hasOwnProperty('isPrototypeOf') === false) { return false; } // Most likely a plain Object return true; } exports.isPlainObject = isPlainObject; }), "[project]/node_modules/launder/index.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => { const dayjs = __turbopack_context__.r("[project]/node_modules/dayjs/dayjs.min.js [app-ssr] (ecmascript)"); // Strip characters browsers ignore inside URLs (control chars and // embedded HTML comments) that are commonly used to sneak XSS // payloads past simple scheme checks. function cleanHref(href) { // Browsers ignore character codes of 32 (space) and below in a surprising // number of situations. Start reading here: // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Embedded_tab // eslint-disable-next-line no-control-regex href = href.replace(/[\x00-\x20]+/g, ''); // Clobber any comments in URLs, which the browser might // interpret inside an XML data island, allowing // a javascript: URL to be snuck through while(true){ const firstIndex = href.indexOf('', firstIndex + 4); if (lastIndex === -1) { break; } href = href.substring(0, firstIndex) + href.substring(lastIndex + 3); } return href; } // Returns true if `href` should be rejected as unsafe. Used to block // `javascript:`, `data:` and other dangerous schemes both when // validating URL fields and when sanitizing HTML attribute values. // // `options.allowedSchemes` is an array of permitted URL schemes // (defaults to the schemes long permitted by `launder().url`). // `options.allowProtocolRelative` controls whether protocol-relative // URLs (e.g. `//example.com`) are permitted. Defaults to true. function naughtyHref(href, options) { options = options || {}; const allowedSchemes = options.allowedSchemes || [ 'http', 'https', 'ftp', 'mailto', 'tel', 'sms' ]; const allowProtocolRelative = options.allowProtocolRelative !== false; if (typeof href !== 'string') { return false; } href = cleanHref(href); // Case insensitive so we don't get faked out by JAVASCRIPT #1 // Allow more characters after the first so we don't get faked // out by certain schemes browsers accept const matches = href.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/); if (!matches) { // Protocol-relative URL starting with any combination of '/' and '\' if (href.match(/^[/\\]{2}/)) { return !allowProtocolRelative; } // No scheme return false; } const scheme = matches[1].toLowerCase(); return allowedSchemes.indexOf(scheme) === -1; } module.exports = function(options) { const self = {}; self.options = options || {}; self.filterTag = self.options.filterTag || function(tag) { tag = tag.trim(); return tag.toLowerCase(); }; self.string = function(s, def) { if (typeof s !== 'string') { if (typeof s === 'number' || typeof s === 'boolean') { s += ''; } else { s = ''; } } s = s.trim(); if (def !== undefined) { if (s === '') { s = def; } } return s; }; self.strings = function(strings) { if (!Array.isArray(strings)) { return []; } return strings.map(function(s) { return self.string(s); }); }; self.integer = function(i, def, min, max) { if (def === undefined) { def = 0; } if (typeof i === 'number') { i = Math.floor(i); } else { try { i = parseInt(i, 10); if (isNaN(i)) { i = def; } } catch (e) { i = def; } } if (typeof min === 'number' && i < min) { i = min; } if (typeof max === 'number' && i > max) { i = max; } return i; }; self.padInteger = function(i, places) { let s = i + ''; while(s.length < places){ s = '0' + s; } return s; }; self.float = function(i, def, min, max) { if (def === undefined) { def = 0; } if (!(typeof i === 'number')) { try { i = parseFloat(i, 10); if (isNaN(i)) { i = def; } } catch (e) { i = def; } } if (typeof min === 'number' && i < min) { i = min; } if (typeof max === 'number' && i > max) { i = max; } return i; }; self.naughtyHref = naughtyHref; self.url = function(s, def, httpsFix) { s = self.string(s, def); // Allow the default to be undefined, null, false, etc. if (s === def) { return s; } // Strip characters browsers ignore that are commonly used to // smuggle dangerous schemes past validation. s = cleanHref(s); // Reject naughty URLs (e.g. `javascript:`, `data:`) before fixUrl // runs. Otherwise fixUrl could mask such schemes by prepending // `https://` to anything containing a `.`, turning // `javascript:alert(document.domain)` into a syntactically odd // but accepted `https://...` URL. if (naughtyHref(s)) { return def; } s = fixUrl(s); if (s === null) { return def; } return s; //TURBOPACK unreachable ; function fixUrl(href) { if (href.match(/^(((https?|ftp):\/\/)|((mailto|tel|sms):)|#|([^/.]+)?\/|[^/.]+$)/)) { // All good - no change required return href; } else if (href.match(/^[^/.]+\.[^/.]+/)) { // Smells like a domain name. Educated guess: they left off http:// const protocol = httpsFix ? 'https://' : 'http://'; return protocol + href; } else { return null; } } }; self.select = function(s, choices, def) { s = self.string(s); if (!choices || !choices.length) { return def; } let choice; if (typeof choices[0] === 'object') { choice = choices.find(function(choice) { if (choice.value === null || choice.value === undefined) { // Don't crash on invalid choices return false; } return choice.value.toString() === s; }); if (choice != null) { return choice.value; } return def; } choice = choices.find(function(choice) { if (choice === null || choice === undefined) { // Don't crash on invalid choices return false; } return choice.toString() === s; }); if (choice !== undefined) { return choice; } return def; }; self.boolean = function(b, def) { if (b === true) { return true; } if (b === false) { return false; } b = self.string(b, def); if (b === def) { if (b === undefined) { return false; } return b; } b = b.toLowerCase().charAt(0); if (b === '' || b === 'n' || b === '0' || b === 'f') { return false; } if (b === 't' || b === 'y' || b === '1') { return true; } return false; }; // Given an `options` object in which options[name] is a string // set to '0', '1', or 'any', this method adds mongodb criteria // to the `criteria` object. // // '0' or false means "the property must be false or absent," '1' or true // means "the property must be true," and 'any' or null means "we don't care // what the property is." // // See `booleanOrNull` for additional synonyms accepted for the // three possible values. // // An empty string is considered equivalent to '0'. // // This is not the same as apos.sanitizeBoolean which is concerned only with // true or false and does not address "any." // // `def` defaults to `any`. // // This method is most often used with REST API parameters and forms. self.addBooleanFilterToCriteria = function(options, name, criteria, def) { // if any or null, we aren't changing criteria if (def === undefined) { def = null; } // allow object or boolean let value = typeof options === 'object' && options !== null ? options[name] : options; value = value === undefined ? def : value; value = self.booleanOrNull(value); if (value === null) { // Don't care, show all } else if (!value) { // Must be absent or false. Hooray for $ne criteria[name] = { $ne: true }; } else { // Must be true criteria[name] = true; } }; // This method is used for tristate filters, i.e. "published," // "unpublished", and "show me both". // // Accepts `true`, `false`, or `null` and returns them exactly // as such; if the parameter is none of those or their synonyms // below, returns `def`. // // Also accepts the strings `'yes'` (or starting with y), `'no'` (or // starting with n), `'true'` (or starting with t), `'false'` // (or starting with f), `'1'`, `'0'` and the strings `'any'` and // `'null'`. The string `'null'` must be an exact match, anything // else starting with `n` is taken as `no` (false). // // These various synonyms are useful for string input, such as from // a user friendly query string. self.booleanOrNull = function(b, def) { if (b === true) { return b; } if (b === false) { return b; } if (b === null) { return b; } b = self.string(b, def); if (b === def) { if (def === undefined) { return null; } return b; } // String 'null' must match as a full string to disambiguate from string 'n' for 'no' if (b === 'null') { return null; } b = b.toLowerCase().charAt(0); if (b === '' || b === 'n' || b === '0' || b === 'f') { return false; } if (b === 't' || b === 'y' || b === '1') { return true; } if (b === 'a') { return null; } return def; }; // Accept a user-entered string in YYYY-MM-DD, MM/DD, MM/DD/YY, or MM/DD/YYYY format // (tolerates missing leading zeroes on MM and DD). Also accepts a Date object. // Returns YYYY-MM-DD. // // The current year is assumed when MM/DD is used. If there is no explicit default // any unparseable date is returned as today's date. // // If the default is explicitly `null` (not `undefined`) then `null` is returned for // any unparseable date. // // The `now` argument can be passed for performance if you prefer to call // `new Date()` just once before many calls to this method and pass that single // value to all of them. self.date = function(date, def, now) { let components; function returnDefault() { if (def === undefined) { def = dayjs().format('YYYY-MM-DD'); } return def; } if (typeof date === 'string') { if (date.match(/\//)) { components = date.split('/'); if (components.length === 2) { // Convert mm/dd to yyyy-mm-dd return (now || new Date()).getFullYear() + '-' + self.padInteger(components[0], 2) + '-' + self.padInteger(components[1], 2); } else if (components.length === 3) { // Convert mm/dd/yy to mm/dd/yyyy if (components[2] < 100) { // Add the current century. If the result is more than // 50 years in the future, assume they meant the // previous century. Thus in 2015, we find that // we get the intuitive result for both 1/1/75, // 1/1/99 and 1/1/25. It's a nasty habit among // us imprecise humans. -Tom const d = now || new Date(); const nowYear = d.getFullYear() % 100; const nowCentury = d.getFullYear() - nowYear; let theirYear = parseInt(components[2]) + nowCentury; if (theirYear - d.getFullYear() > 50) { theirYear -= 100; } components[2] = theirYear; } // Convert mm/dd/yyyy to yyyy-mm-dd return self.padInteger(components[2], 4) + '-' + self.padInteger(components[0], 2) + '-' + self.padInteger(components[1], 2); } else { return returnDefault(); } } else if (date.match(/-/)) { components = date.split('-'); if (components.length === 2) { // Convert mm-dd to yyyy-mm-dd return (now || new Date()).getFullYear() + '-' + self.padInteger(components[0], 2) + '-' + self.padInteger(components[1], 2); } else if (components.length === 3) { // Convert yyyy-mm-dd (with questionable padding) to yyyy-mm-dd return self.padInteger(components[0], 4) + '-' + self.padInteger(components[1], 2) + '-' + self.padInteger(components[2], 2); } else { return returnDefault(); } } } try { if (date === null) { return returnDefault(); } date = now || new Date(date); if (isNaN(date.getTime())) { return returnDefault(); } return date.getFullYear() + '-' + self.padInteger(date.getMonth() + 1, 2) + '-' + self.padInteger(date.getDate(), 2); } catch (e) { return returnDefault(); } }; // This is likely not relevent to you unless you're using Apostrophe // Given a date object, return a date string in Apostrophe's preferred sortable, // comparable, JSON-able format, which is YYYY-MM-DD. If `date` is undefined // the current date is used. self.formatDate = function(date) { return dayjs(date).format('YYYY-MM-DD'); }; // Accepts a user-entered string in 12-hour or 24-hour time and returns a string // in 24-hour time. This method is tolerant of syntax such as `4pm`; minutes and // seconds are optional. // // If `def` is not set the default is the current time. self.time = function(time, def) { time = self.string(time).toLowerCase(); time = time.trim(); const components = time.match(/^(\d+)([:|.](\d+))?([:|.](\d+))?\s*(am|pm|AM|PM|a|p|A|M)?$/); if (components) { let hours = parseInt(components[1], 10); const minutes = components[3] !== undefined ? parseInt(components[3], 10) : 0; const seconds = components[5] !== undefined ? parseInt(components[5], 10) : 0; let ampm = components[6] ? components[6].toLowerCase() : components[6]; ampm = ampm && ampm.charAt(0); if (hours === 12 && ampm === 'a') { hours -= 12; } else if (hours === 12 && ampm === 'p') { // Leave it be } else if (ampm === 'p') { hours += 12; } if (hours === 24 || hours === '24') { hours = 0; } return self.padInteger(hours, 2) + ':' + self.padInteger(minutes, 2) + ':' + self.padInteger(seconds, 2); } else { if (def !== undefined) { return def; } return dayjs().format('HH:mm'); } }; // This is likely not relevent to you unless you're using Apostrophe // Given a JavaScript Date object, return a time string in // Apostrophe's preferred sortable, comparable, JSON-able format: // 24-hour time, with seconds. // // If `date` is missing the current time is used. self.formatTime = function(date) { return dayjs(date).format('HH:mm:ss'); }; // Sanitize tags. Tags should be submitted as an array of strings, // or a comma-separated string. // // This method ensures the input is an array or string and, if // an array, that the elements of the array are strings. // // If a filterTag function is passed as an option when initializing // Launder, then all tags are passed through it (as individual // strings, one per call) and the return value is used instead. You // may also pass a filterTag when calling this function self.tags = function(tags, filter) { if (typeof tags === 'string') { tags = tags.split(/,\s*/); } if (!Array.isArray(tags)) { return []; } const strings = tags.map((tag)=>self.string(tag)); const rewritten = strings.map(filter || self.filterTag); const filtered = rewritten.filter((tag)=>tag.length > 0); return filtered; }; // Sanitize an id. IDs must consist solely of upper and lower case // letters, numbers, and digits unless options.idRegExp is set. self.idRegExp = self.options.idRegExp || /^[A-Za-z0-9_]+$/; self.id = function(s, def) { const id = self.string(s, def); if (id === def) { return id; } if (!id.match(self.idRegExp)) { return def; } return id; }; // Sanitize an array of IDs. IDs must consist solely of upper and lower case // letters and numbers, digits, and underscores. Any elements that are not // IDs are omitted from the final array. self.ids = function(ids) { if (!Array.isArray(ids)) { return []; } const result = ids.filter(function(id) { return self.id(id) !== undefined; }); return result; }; return self; }; // Expose `naughtyHref` statically so callers (notably sanitize-html) // can use it without instantiating a launder. module.exports.naughtyHref = naughtyHref; }), "[project]/node_modules/marked/lib/marked.esm.js [app-ssr] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "Hooks", ()=>S, "Lexer", ()=>x, "Marked", ()=>Z, "Parser", ()=>b, "Renderer", ()=>P, "TextRenderer", ()=>L, "Tokenizer", ()=>y, "defaults", ()=>R, "getDefaults", ()=>C, "lexer", ()=>pn, "marked", ()=>f, "options", ()=>nn, "parse", ()=>an, "parseInline", ()=>on, "parser", ()=>ln, "setOptions", ()=>rn, "use", ()=>kt, "walkTokens", ()=>sn ]); /** * marked v18.0.9 - a markdown parser * Copyright (c) 2018-2026, MarkedJS. (MIT License) * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) * https://github.com/markedjs/marked */ /** * DO NOT EDIT THIS FILE * The code in this file is generated from files in ./src/ */ function C() { return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null }; } var R = C(); function j(l) { R = l; } var z = { exec: ()=>null }; function A(l) { let e = []; return (t)=>{ let n = Math.max(0, Math.min(3, t - 1)), s = e[n]; return s || (s = l(n), e[n] = s), s; }; } function k(l, e = "") { let t = typeof l == "string" ? l : l.source, n = { replace: (s, r)=>{ let i = typeof r == "string" ? r : r.source; return i = i.replace(m.caret, "$1"), t = t.replace(s, i), n; }, getRegex: ()=>new RegExp(t, e) }; return n; } var Te = ((l = "")=>{ try { return !!new RegExp("(?<=1)(?/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l)=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: A((l)=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: A((l)=>new RegExp(`^ {0,${l}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: A((l)=>new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)), headingBeginRegex: A((l)=>new RegExp(`^ {0,${l}}#`)), htmlBeginRegex: A((l)=>new RegExp(`^ {0,${l}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: A((l)=>new RegExp(`^ {0,${l}}>`)) }, Oe = /^(?:[ \t]*(?:\n|$))+/, we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ye = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, q = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, U = / {0,3}(?:[*+-]|\d{1,9}[.)])/, oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ae = k(oe).replace(/bull/g, U).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Se = k(oe).replace(/bull/g, U).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), K = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, _e = /^[^\n]+/, W = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, $e = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", W).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Le = k(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, U).getRegex(), Q = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", X = /|$))/, Me = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", X).replace("tag", Q).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = (l)=>k(K).replace("hr", q).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", l).replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", Q).getRegex(), ze = le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Ee = le(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Ce = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ee).getRegex(), J = { blockquote: Ce, code: we, def: $e, fences: ye, heading: Pe, hr: q, html: Me, lheading: ae, list: Le, newline: Oe, paragraph: ze, table: z, text: _e }, se = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", q).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", Q).getRegex(), Ae = { ...J, lheading: Se, table: se, paragraph: k(K).replace("hr", q).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", Q).getRegex() }, Ie = { ...J, html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", X).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: z, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(K).replace("hr", q).replace("heading", ` *#{1,6} *[^ ]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Be = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, De = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, pe = /^( {2,}|\\)\n(?!\s*$)/, qe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Te ? "(?`+)[^`]+\k(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ce = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Ne = k(ce, "u").replace(/punct/g, _).getRegex(), je = k(ce, "u").replace(/punct/g, ue).getRegex(), Fe = /^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, Ue = k(Fe, "u").replace(/openQuote/g, He).replace(/punct/g, _).getRegex(), he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ke = k(he, "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, I).replace(/punct/g, _).getRegex(), We = k(he, "gu").replace(/notPunctSpace/g, Ge).replace(/punctSpace/g, Ze).replace(/punct/g, ue).getRegex(), Xe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", Je = k(Xe, "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, I).replace(/punct/g, _).getRegex(), Ve = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, I).replace(/punct/g, _).getRegex(), Ye = "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", et = k(Ye, "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, I).replace(/punct/g, _).getRegex(), tt = k(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, _).getRegex(), nt = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", rt = k(nt, "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, I).replace(/punct/g, _).getRegex(), st = k(/\\(punct)/, "gu").replace(/punct/g, _).getRegex(), it = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), ot = k(X).replace("(?:-->|$)", "-->").getRegex(), at = k("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment", ot).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), G = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, lt = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", G).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), de = k(/^!?\[(label)\]\[(ref)\]/).replace("label", G).replace("ref", W).getRegex(), ke = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", W).getRegex(), pt = k("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex(), ie = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, V = { _backpedal: z, anyPunctuation: st, autolink: it, blockSkip: Qe, br: pe, code: De, del: z, delLDelim: z, delRDelim: z, emStrongLDelim: Ne, emStrongRDelimAst: Ke, emStrongRDelimUnd: Ve, escape: Be, link: lt, nolink: ke, punctuation: ve, reflink: de, reflinkSearch: pt, tag: at, text: qe, url: z }, ut = { ...V, emStrongLDelim: Ue, emStrongRDelimAst: Je, emStrongRDelimUnd: et, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", G).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", G).getRegex() }, F = { ...V, emStrongRDelimAst: We, emStrongLDelim: je, delLDelim: tt, delRDelim: rt, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ie).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: k(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\": ">", '"': """, "'": "'" }, ge = (l)=>ht[l]; function O(l, e) { if (e) { if (m.escapeTest.test(l)) return l.replace(m.escapeReplace, ge); } else if (m.escapeTestNoEncode.test(l)) return l.replace(m.escapeReplaceNoEncode, ge); return l; } function Y(l) { try { l = encodeURI(l).replace(m.percentDecode, "%"); } catch { return null; } return l; } function ee(l, e) { let t = l.replace(m.findPipe, (r, i, o)=>{ let p = !1, a = i; for(; --a >= 0 && o[a] === "\\";)p = !p; return p ? "|" : " |"; }), n = t.split(m.splitPipe), s = 0; if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e); else for(; n.length < e;)n.push(""); for(; s < n.length; s++)n[s] = n[s].trim().replace(m.slashPipe, "|"); return n; } function $(l, e, t) { let n = l.length; if (n === 0) return ""; let s = 0; for(; s < n;){ let r = l.charAt(n - s - 1); if (r === e && !t) s++; else if (r !== e && t) s++; else break; } return l.slice(0, n - s); } function te(l) { let e = l.split(` `), t = e.length - 1; for(; t >= 0 && m.blankLine.test(e[t]);)t--; return e.length - t <= 2 ? l : e.slice(0, t + 1).join(` `); } function fe(l, e) { if (l.indexOf(e[1]) === -1) return -1; let t = 0; for(let n = 0; n < l.length; n++)if (l[n] === "\\") n++; else if (l[n] === e[0]) t++; else if (l[n] === e[1] && (t--, t < 0)) return n; return t > 0 ? -2 : -1; } function me(l, e = 0) { let t = e, n = ""; for (let s of l)if (s === " ") { let r = 4 - t % 4; n += " ".repeat(r), t += r; } else n += s, t++; return n; } function xe(l, e, t, n, s) { let r = e.href, i = e.title || null, o = l[1].replace(s.other.outputLinkReplace, "$1"); n.state.inLink = !0; let p = { type: l[0].charAt(0) === "!" ? "image" : "link", raw: t, href: r, title: i, text: o, tokens: n.inlineTokens(o) }; return n.state.inLink = !1, p; } function dt(l, e, t) { let n = l.match(t.other.indentCodeCompensation); if (n === null) return e; let s = n[1]; return e.split(` `).map((r)=>{ let i = r.match(t.other.beginningSpace); if (i === null) return r; let [o] = i; return o.length >= s.length ? r.slice(s.length) : r; }).join(` `); } var y = class { options; rules; lexer; constructor(e){ this.options = e || R; } space(e) { let t = this.rules.block.newline.exec(e); if (t && t[0].length > 0) return { type: "space", raw: t[0] }; } code(e) { let t = this.rules.block.code.exec(e); if (t) { let n = this.options.pedantic ? t[0] : te(t[0]), s = n.replace(this.rules.other.codeRemoveIndent, ""); return { type: "code", raw: n, codeBlockStyle: "indented", text: s }; } } fences(e) { let t = this.rules.block.fences.exec(e); if (t) { let n = t[0], s = dt(n, t[3] || "", this.rules); return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: s }; } } heading(e) { let t = this.rules.block.heading.exec(e); if (t) { let n = t[2].trim(); if (this.rules.other.endingHash.test(n)) { let s = $(n, "#"); (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (n = s.trim()); } return { type: "heading", raw: $(t[0], ` `), depth: t[1].length, text: n, tokens: this.lexer.inline(n) }; } } hr(e) { let t = this.rules.block.hr.exec(e); if (t) return { type: "hr", raw: $(t[0], ` `) }; } blockquote(e) { let t = this.rules.block.blockquote.exec(e); if (t) { let n = $(t[0], ` `).split(` `), s = "", r = "", i = []; for(; n.length > 0;){ let o = !1, p = [], a; for(a = 0; a < n.length; a++)if (this.rules.other.blockquoteStart.test(n[a])) p.push(n[a]), o = !0; else if (!o) p.push(n[a]); else break; n = n.slice(a); let u = p.join(` `), c = u.replace(this.rules.other.blockquoteSetextReplace, ` $1`).replace(this.rules.other.blockquoteSetextReplace2, ""); s = s ? `${s} ${u}` : u, r = r ? `${r} ${c}` : c; let h = this.lexer.state.top; if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = h, n.length === 0) break; let d = i.at(-1); if (d?.type === "code") break; if (d?.type === "blockquote") { let T = d, g = n.join(` `), w = T.raw + ` ` + g.replace(this.rules.other.blockquoteSetextReplace2, ""), M = this.blockquote(w); i[i.length - 1] = M, s = `${s} ${g}`, r = r.substring(0, r.length - T.text.length) + M.text; break; } else if (d?.type === "list") { let T = d, g = T.raw + ` ` + n.join(` `), w = this.list(g); i[i.length - 1] = w, s = s.substring(0, s.length - d.raw.length) + w.raw, r = r.substring(0, r.length - T.raw.length) + w.raw, n = g.substring(i.at(-1).raw.length).split(` `); continue; } } return { type: "blockquote", raw: s, tokens: i, text: r }; } } list(e) { let t = this.rules.block.list.exec(e); if (t) { let n = t[1].trim(), s = n.length > 1, r = { type: "list", raw: "", ordered: s, start: s ? +n.slice(0, -1) : "", loose: !1, items: [] }; n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]"); let i = this.rules.other.listItemRegex(n), o = !1; for(; e;){ let a = !1, u = "", c = ""; if (!(t = i.exec(e)) || this.rules.block.hr.test(e)) break; u = t[0], e = e.substring(u.length); let h = me(t[2].split(` `, 1)[0], t[1].length), d = e.split(` `, 1)[0], T = !h.trim(), g = 0; if (this.options.pedantic ? (g = 2, c = h.trimStart()) : T ? g = t[1].length + 1 : (g = h.search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, c = h.slice(g), g += t[1].length), T && this.rules.other.blankLine.test(d) && (u += d + ` `, e = e.substring(d.length + 1), a = !0), !a) { let w = this.rules.other.nextBulletRegex(g), M = this.rules.other.hrRegex(g), ne = this.rules.other.fencesBeginRegex(g), re = this.rules.other.headingBeginRegex(g), be = this.rules.other.htmlBeginRegex(g), Re = this.rules.other.blockquoteBeginRegex(g); for(; e;){ let N = e.split(` `, 1)[0], D; if (d = N, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), D = d) : D = d.replace(this.rules.other.tabCharGlobal, " "), ne.test(d) || re.test(d) || be.test(d) || Re.test(d) || w.test(d) || M.test(d)) break; if (D.search(this.rules.other.nonSpaceChar) >= g || !d.trim()) c += ` ` + D.slice(g); else { if (T || h.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ne.test(h) || re.test(h) || M.test(h)) break; c += ` ` + d; } T = !d.trim(), u += N + ` `, e = e.substring(N.length + 1), h = D.slice(g); } } r.loose || (o ? r.loose = !0 : this.rules.other.doubleBlankLine.test(u) && (o = !0)), r.items.push({ type: "list_item", raw: u, task: !!this.options.gfm && this.rules.other.listIsTask.test(c), loose: !1, text: c, tokens: [] }), r.raw += u; } let p = r.items.at(-1); if (p) p.raw = p.raw.trimEnd(), p.text = p.text.trimEnd(); else return; r.raw = r.raw.trimEnd(); for (let a of r.items){ this.lexer.state.top = !1, a.tokens = this.lexer.blockTokens(a.text, []); let u = a.tokens[0]; if (a.task && (u?.type === "text" || u?.type === "paragraph")) { a.text = a.text.replace(this.rules.other.listReplaceTask, ""), u.raw = u.raw.replace(this.rules.other.listReplaceTask, ""), u.text = u.text.replace(this.rules.other.listReplaceTask, ""); for(let h = this.lexer.inlineQueue.length - 1; h >= 0; h--)if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)) { this.lexer.inlineQueue[h].src = this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask, ""); break; } let c = this.rules.other.listTaskCheckbox.exec(a.raw); if (c) { let h = { type: "checkbox", raw: c[0] + " ", checked: c[0] !== "[ ]" }; a.checked = h.checked, r.loose ? a.tokens[0] && [ "paragraph", "text" ].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = h.raw + a.tokens[0].raw, a.tokens[0].text = h.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(h)) : a.tokens.unshift({ type: "paragraph", raw: h.raw, text: h.raw, tokens: [ h ] }) : a.tokens.unshift(h); } } else a.task && (a.task = !1); if (!r.loose) { let c = a.tokens.filter((d)=>d.type === "space"), h = c.length > 0 && c.some((d)=>this.rules.other.anyLine.test(d.raw)); r.loose = h; } } if (r.loose) for (let a of r.items){ a.loose = !0; for (let u of a.tokens)u.type === "text" && (u.type = "paragraph"); } return r; } } html(e) { let t = this.rules.block.html.exec(e); if (t) { let n = te(t[0]); return { type: "html", block: !0, raw: n, pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: n }; } } def(e) { let t = this.rules.block.def.exec(e); if (t) { let n = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3]; return { type: "def", tag: n, raw: $(t[0], ` `), href: s, title: r }; } } table(e) { let t = this.rules.block.table.exec(e); if (!t || !this.rules.other.tableDelimiter.test(t[2])) return; let n = ee(t[1]), s = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(` `) : [], i = { type: "table", raw: $(t[0], ` `), header: [], align: [], rows: [] }; if (n.length === s.length) { for (let o of s)this.rules.other.tableAlignRight.test(o) ? i.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? i.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? i.align.push("left") : i.align.push(null); for(let o = 0; o < n.length; o++)i.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: i.align[o] }); for (let o of r)i.rows.push(ee(o, i.header.length).map((p, a)=>({ text: p, tokens: this.lexer.inline(p), header: !1, align: i.align[a] }))); return i; } } lheading(e) { let t = this.rules.block.lheading.exec(e); if (t) { let n = t[1].trim(); return { type: "heading", raw: $(t[0], ` `), depth: t[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) }; } } paragraph(e) { let t = this.rules.block.paragraph.exec(e); if (t) { let n = t[1].charAt(t[1].length - 1) === ` ` ? t[1].slice(0, -1) : t[1]; return { type: "paragraph", raw: t[0], text: n, tokens: this.lexer.inline(n) }; } } text(e) { let t = this.rules.block.text.exec(e); if (t) return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) }; } escape(e) { let t = this.rules.inline.escape.exec(e); if (t) return { type: "escape", raw: t[0], text: t[1] }; } tag(e) { let t = this.rules.inline.tag.exec(e); if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), { type: "html", raw: t[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: !1, text: t[0] }; } link(e) { let t = this.rules.inline.link.exec(e); if (t) { let n = t[2].trim(); if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) { if (!this.rules.other.endAngleBracket.test(n)) return; let i = $(n.slice(0, -1), "\\"); if ((n.length - i.length) % 2 === 0) return; } else { let i = fe(t[2], "()"); if (i === -2) return; if (i > -1) { let p = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + i; t[2] = t[2].substring(0, i), t[0] = t[0].substring(0, p).trim(), t[3] = ""; } } let s = t[2], r = ""; if (this.options.pedantic) { let i = this.rules.other.pedanticHrefTitle.exec(s); i && (s = i[1], r = i[3]); } else r = t[3] ? t[3].slice(1, -1) : ""; return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? s = s.slice(1) : s = s.slice(1, -1)), xe(t, { href: s && s.replace(this.rules.inline.anyPunctuation, "$1"), title: r && r.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules); } } reflink(e, t) { let n; if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) { let s = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), r = t[s.toLowerCase()]; if (!r) { let i = n[0].charAt(0); return { type: "text", raw: i, text: i }; } return xe(n, r, n[0], this.lexer, this.rules); } } emStrong(e, t, n = "") { let s = this.rules.inline.emStrongLDelim.exec(e); if (!s || !s[1] && !s[2] && !s[3] && !s[4] || s[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return; if (!(s[1] || s[3] || "") || !n || this.rules.inline.punctuation.exec(n)) { let i = [ ...s[0] ].length - 1, o, p, a = i, u = 0, c = s[0][0], h = n === c, d = c === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd; for(d.lastIndex = 0, t = t.slice(-1 * e.length + i); (s = d.exec(t)) !== null;){ if (o = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o) continue; if (p = [ ...o ].length, s[3] || s[4]) { a += p; continue; } else if (s[5] || s[6]) { if (i % 3 && !((i + p) % 3)) { u += p; continue; } if (h) break; } if (a -= p, a > 0) continue; p = Math.min(p, p + a + u); let T = [ ...s[0] ][0].length, g = e.slice(0, i + s.index + T + p); if (Math.min(i, p) % 2) { let M = g.slice(1, -1); return { type: "em", raw: g, text: M, tokens: this.lexer.inlineTokens(M) }; } let w = g.slice(2, -2); return { type: "strong", raw: g, text: w, tokens: this.lexer.inlineTokens(w) }; } } } codespan(e) { let t = this.rules.inline.code.exec(e); if (t) { let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(n), r = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n); return s && r && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t[0], text: n }; } } br(e) { let t = this.rules.inline.br.exec(e); if (t) return { type: "br", raw: t[0] }; } del(e, t, n = "") { let s = this.rules.inline.delLDelim.exec(e); if (!s) return; if (!(s[1] || "") || !n || this.rules.inline.punctuation.exec(n)) { let i = [ ...s[0] ].length - 1, o, p, a = i, u = this.rules.inline.delRDelim; for(u.lastIndex = 0, t = t.slice(-1 * e.length + i); (s = u.exec(t)) !== null;){ if (o = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o || (p = [ ...o ].length, p !== i)) continue; if (s[3] || s[4]) { a += p; continue; } if (a -= p, a > 0) continue; p = Math.min(p, p + a); let c = [ ...s[0] ][0].length, h = e.slice(0, i + s.index + c + p), d = h.slice(i, -i); return { type: "del", raw: h, text: d, tokens: this.lexer.inlineTokens(d) }; } } } autolink(e) { let t = this.rules.inline.autolink.exec(e); if (t) { let n, s; return t[2] === "@" ? (n = t[1], s = "mailto:" + n) : (n = t[1], s = n), { type: "link", raw: t[0], text: n, href: s, tokens: [ { type: "text", raw: n, text: n } ] }; } } url(e) { let t; if (t = this.rules.inline.url.exec(e)) { let n, s; if (t[2] === "@") n = t[0], s = "mailto:" + n; else { let r; do r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? ""; while (r !== t[0]) n = t[0], t[1] === "www." ? s = "http://" + t[0] : s = t[0]; } return { type: "link", raw: t[0], text: n, href: s, tokens: [ { type: "text", raw: n, text: n } ] }; } } inlineText(e) { let t = this.rules.inline.text.exec(e); if (t) { let n = this.lexer.state.inRawBlock; return { type: "text", raw: t[0], text: t[0], escaped: n }; } } }; var x = class l { tokens; options; state; inlineQueue; tokenizer; constructor(e){ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || R, this.options.tokenizer = this.options.tokenizer || new y, this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 }; let t = { other: m, block: H.normal, inline: B.normal }; this.options.pedantic ? (t.block = H.pedantic, t.inline = B.pedantic) : this.options.gfm && (t.block = H.gfm, this.options.breaks ? t.inline = B.breaks : t.inline = B.gfm), this.tokenizer.rules = t; } static get rules() { return { block: H, inline: B }; } static lex(e, t) { return new l(t).lex(e); } static lexInline(e, t) { return new l(t).inlineTokens(e); } lex(e) { e = e.replace(m.carriageReturn, ` `), this.blockTokens(e, this.tokens); for(let t = 0; t < this.inlineQueue.length; t++){ let n = this.inlineQueue[t]; this.inlineTokens(n.src, n.tokens); } return this.inlineQueue = [], this.tokens; } blockTokens(e, t = [], n = !1) { this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); let s = 1 / 0; for(; e;){ if (e.length < s) s = e.length; else { this.infiniteLoopError(e.charCodeAt(0)); break; } let r; if (this.options.extensions?.block?.some((o)=>(r = o.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue; if (r = this.tokenizer.space(e)) { e = e.substring(r.raw.length); let o = t.at(-1); r.raw.length === 1 && o !== void 0 ? o.raw += ` ` : t.push(r); continue; } if (r = this.tokenizer.code(e)) { e = e.substring(r.raw.length); let o = t.at(-1); o?.type === "paragraph" || o?.type === "text" ? (o.raw += (o.raw.endsWith(` `) ? "" : ` `) + r.raw, o.text += ` ` + r.text, this.inlineQueue.at(-1).src = o.text) : t.push(r); continue; } if (r = this.tokenizer.fences(e)) { e = e.substring(r.raw.length), t.push(r); continue; } if (r = this.tokenizer.heading(e)) { e = e.substring(r.raw.length), t.push(r); continue; } if (r = this.tokenizer.hr(e)) { e = e.substring(r.raw.length), t.push(r); continue; } if (r = this.tokenizer.blockquote(e)) { e = e.substring(r.raw.length), t.push(r); continue; } if (r = this.tokenizer.list(e)) { e = e.substring(r.raw.length), t.push(r); continue; } if (r = this.tokenizer.html(e)) { e = e.substring(r.raw.length), t.push(r); continue; } if (r = this.tokenizer.def(e)) { e = e.substring(r.raw.length); let o = t.at(-1); o?.type === "paragraph" || o?.type === "text" ? (o.raw += (o.raw.endsWith(` `) ? "" : ` `) + r.raw, o.text += ` ` + r.raw, this.inlineQueue.at(-1).src = o.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = { href: r.href, title: r.title }, t.push(r)); continue; } if (r = this.tokenizer.table(e)) { e = e.substring(r.raw.length), t.push(r); continue; } if (r = this.tokenizer.lheading(e)) { e = e.substring(r.raw.length), t.push(r); continue; } let i = e; if (this.options.extensions?.startBlock) { let o = 1 / 0, p = e.slice(1), a; this.options.extensions.startBlock.forEach((u)=>{ a = u.call({ lexer: this }, p), typeof a == "number" && a >= 0 && (o = Math.min(o, a)); }), o < 1 / 0 && o >= 0 && (i = e.substring(0, o + 1)); } if (this.state.top && (r = this.tokenizer.paragraph(i))) { let o = t.at(-1); n && o?.type === "paragraph" ? (o.raw += (o.raw.endsWith(` `) ? "" : ` `) + r.raw, o.text += ` ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length); continue; } if (r = this.tokenizer.text(e)) { e = e.substring(r.raw.length); let o = t.at(-1); o?.type === "text" ? (o.raw += (o.raw.endsWith(` `) ? "" : ` `) + r.raw, o.text += ` ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : t.push(r); continue; } if (e) { this.infiniteLoopError(e.charCodeAt(0)); break; } } return this.state.top = !0, t; } inline(e, t = []) { return this.inlineQueue.push({ src: e, tokens: t }), t; } inlineTokens(e, t = []) { this.tokenizer.lexer = this; let n = e; if (this.tokens.links) { let o = Object.keys(this.tokens.links); o.length > 0 && (n = n.replace(this.tokenizer.rules.inline.reflinkSearch, (p)=>o.includes(p.slice(p.lastIndexOf("[") + 1, -1)) ? "[" + "a".repeat(p.length - 2) + "]" : p)); } n = n.replace(this.tokenizer.rules.inline.anyPunctuation, "++"), n = n.replace(this.tokenizer.rules.inline.blockSkip, (o, p, a)=>{ let u = a ? a.length : 0; return o.slice(0, u) + "[" + "a".repeat(o.length - u - 2) + "]"; }), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n; let s = !1, r = "", i = 1 / 0; for(; e;){ if (e.length < i) i = e.length; else { this.infiniteLoopError(e.charCodeAt(0)); break; } s || (r = ""), s = !1; let o; if (this.options.extensions?.inline?.some((a)=>(o = a.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), !0) : !1)) continue; if (o = this.tokenizer.escape(e)) { e = e.substring(o.raw.length), t.push(o); continue; } if (o = this.tokenizer.tag(e)) { e = e.substring(o.raw.length), t.push(o); continue; } if (o = this.tokenizer.link(e)) { e = e.substring(o.raw.length), t.push(o); continue; } if (o = this.tokenizer.reflink(e, this.tokens.links)) { e = e.substring(o.raw.length); let a = t.at(-1); o.type === "text" && a?.type === "text" ? (a.raw += o.raw, a.text += o.text) : t.push(o); continue; } if (o = this.tokenizer.emStrong(e, n, r)) { e = e.substring(o.raw.length), t.push(o); continue; } if (o = this.tokenizer.codespan(e)) { e = e.substring(o.raw.length), t.push(o); continue; } if (o = this.tokenizer.br(e)) { e = e.substring(o.raw.length), t.push(o); continue; } if (o = this.tokenizer.del(e, n, r)) { e = e.substring(o.raw.length), t.push(o); continue; } if (o = this.tokenizer.autolink(e)) { e = e.substring(o.raw.length), t.push(o); continue; } if (!this.state.inLink && (o = this.tokenizer.url(e))) { e = e.substring(o.raw.length), t.push(o); continue; } let p = e; if (this.options.extensions?.startInline) { let a = 1 / 0, u = e.slice(1), c; this.options.extensions.startInline.forEach((h)=>{ c = h.call({ lexer: this }, u), typeof c == "number" && c >= 0 && (a = Math.min(a, c)); }), a < 1 / 0 && a >= 0 && (p = e.substring(0, a + 1)); } if (o = this.tokenizer.inlineText(p)) { e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (r = o.raw.slice(-1)), s = !0; let a = t.at(-1); a?.type === "text" ? (a.raw += o.raw, a.text += o.text) : t.push(o); continue; } if (e) { this.infiniteLoopError(e.charCodeAt(0)); break; } } return t; } infiniteLoopError(e) { let t = "Infinite loop on byte: " + e; if (this.options.silent) console.error(t); else throw new Error(t); } }; var P = class { options; parser; constructor(e){ this.options = e || R; } space(e) { return ""; } code({ text: e, lang: t, escaped: n }) { let s = (t || "").match(m.notSpaceStart)?.[0], r = e.replace(m.endingNewline, "") + ` `; return s ? '
' + (n ? r : O(r, !0)) + `
` : "
" + (n ? r : O(r, !0)) + `
`; } blockquote({ tokens: e }) { return `
${this.parser.parse(e)}
`; } html({ text: e }) { return e; } def(e) { return ""; } heading({ tokens: e, depth: t }) { return `${this.parser.parseInline(e)} `; } hr(e) { return `
`; } list(e) { let t = e.ordered, n = e.start, s = ""; for(let o = 0; o < e.items.length; o++){ let p = e.items[o]; s += this.listitem(p); } let r = t ? "ol" : "ul", i = t && n !== 1 ? ' start="' + n + '"' : ""; return "<" + r + i + `> ` + s + " `; } listitem(e) { return `
  • ${this.parser.parse(e.tokens)}
  • `; } checkbox({ checked: e }) { return " '; } paragraph({ tokens: e }) { return `

    ${this.parser.parseInline(e)}

    `; } table(e) { let t = "", n = ""; for(let r = 0; r < e.header.length; r++)n += this.tablecell(e.header[r]); t += this.tablerow({ text: n }); let s = ""; for(let r = 0; r < e.rows.length; r++){ let i = e.rows[r]; n = ""; for(let o = 0; o < i.length; o++)n += this.tablecell(i[o]); s += this.tablerow({ text: n }); } return s && (s = `${s}`), ` ` + t + ` ` + s + `
    `; } tablerow({ text: e }) { return ` ${e} `; } tablecell(e) { let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td"; return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + ` `; } strong({ tokens: e }) { return `${this.parser.parseInline(e)}`; } em({ tokens: e }) { return `${this.parser.parseInline(e)}`; } codespan({ text: e }) { return `${O(e, !0)}`; } br(e) { return "
    "; } del({ tokens: e }) { return `${this.parser.parseInline(e)}`; } link({ href: e, title: t, tokens: n }) { let s = this.parser.parseInline(n), r = Y(e); if (r === null) return s; e = r; let i = '
    ", i; } image({ href: e, title: t, text: n, tokens: s }) { s && (n = this.parser.parseInline(s, this.parser.textRenderer)); let r = Y(e); if (r === null) return O(n); e = r; let i = `${O(n)}{ let o = r[i].flat(1 / 0); n = n.concat(this.walkTokens(o, t)); }) : r.tokens && (n = n.concat(this.walkTokens(r.tokens, t))); } } return n; } use(...e) { let t = this.defaults.extensions || { renderers: {}, childTokens: {} }; return e.forEach((n)=>{ let s = { ...n }; if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((r)=>{ if (!r.name) throw new Error("extension name required"); if ("renderer" in r) { let i = t.renderers[r.name]; i ? t.renderers[r.name] = function(...o) { let p = r.renderer.apply(this, o); return p === !1 && (p = i.apply(this, o)), p; } : t.renderers[r.name] = r.renderer; } if ("tokenizer" in r) { if (!r.level || r.level !== "block" && r.level !== "inline") throw new Error("extension level must be 'block' or 'inline'"); let i = t[r.level]; i ? i.unshift(r.tokenizer) : t[r.level] = [ r.tokenizer ], r.start && (r.level === "block" ? t.startBlock ? t.startBlock.push(r.start) : t.startBlock = [ r.start ] : r.level === "inline" && (t.startInline ? t.startInline.push(r.start) : t.startInline = [ r.start ])); } "childTokens" in r && r.childTokens && (t.childTokens[r.name] = r.childTokens); }), s.extensions = t), n.renderer) { let r = this.defaults.renderer || new P(this.defaults); for(let i in n.renderer){ if (!(i in r)) throw new Error(`renderer '${i}' does not exist`); if ([ "options", "parser" ].includes(i)) continue; let o = i, p = n.renderer[o], a = r[o]; r[o] = (...u)=>{ let c = p.apply(r, u); return c === !1 && (c = a.apply(r, u)), c || ""; }; } s.renderer = r; } if (n.tokenizer) { let r = this.defaults.tokenizer || new y(this.defaults); for(let i in n.tokenizer){ if (!(i in r)) throw new Error(`tokenizer '${i}' does not exist`); if ([ "options", "rules", "lexer" ].includes(i)) continue; let o = i, p = n.tokenizer[o], a = r[o]; r[o] = (...u)=>{ let c = p.apply(r, u); return c === !1 && (c = a.apply(r, u)), c; }; } s.tokenizer = r; } if (n.hooks) { let r = this.defaults.hooks || new S; for(let i in n.hooks){ if (!(i in r)) throw new Error(`hook '${i}' does not exist`); if ([ "options", "block" ].includes(i)) continue; let o = i, p = n.hooks[o], a = r[o]; S.passThroughHooks.has(i) ? r[o] = (u)=>{ if (this.defaults.async && S.passThroughHooksRespectAsync.has(i)) return (async ()=>{ let h = await p.call(r, u); return a.call(r, h); })(); let c = p.call(r, u); return a.call(r, c); } : r[o] = (...u)=>{ if (this.defaults.async) return (async ()=>{ let h = await p.apply(r, u); return h === !1 && (h = await a.apply(r, u)), h; })(); let c = p.apply(r, u); return c === !1 && (c = a.apply(r, u)), c; }; } s.hooks = r; } if (n.walkTokens) { let r = this.defaults.walkTokens, i = n.walkTokens; s.walkTokens = function(o) { let p = []; return p.push(i.call(this, o)), r && (p = p.concat(r.call(this, o))), p; }; } this.defaults = { ...this.defaults, ...s }; }), this; } setOptions(e) { return this.defaults = { ...this.defaults, ...e }, this; } lexer(e, t) { return x.lex(e, t ?? this.defaults); } parser(e, t) { return b.parse(e, t ?? this.defaults); } parseMarkdown(e) { return (n, s)=>{ let r = { ...s }, i = { ...this.defaults, ...r }, o = this.onError(!!i.silent, !!i.async); if (this.defaults.async === !0 && r.async === !1) return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.")); if (typeof n > "u" || n === null) return o(new Error("marked(): input parameter is undefined or null")); if (typeof n != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected")); if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async ()=>{ let p = i.hooks ? await i.hooks.preprocess(n) : n, u = await (i.hooks ? await i.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(p, i), c = i.hooks ? await i.hooks.processAllTokens(u) : u; i.walkTokens && await Promise.all(this.walkTokens(c, i.walkTokens)); let d = await (i.hooks ? await i.hooks.provideParser(e) : e ? b.parse : b.parseInline)(c, i); return i.hooks ? await i.hooks.postprocess(d) : d; })().catch(o); try { i.hooks && (n = i.hooks.preprocess(n)); let a = (i.hooks ? i.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(n, i); i.hooks && (a = i.hooks.processAllTokens(a)), i.walkTokens && this.walkTokens(a, i.walkTokens); let c = (i.hooks ? i.hooks.provideParser(e) : e ? b.parse : b.parseInline)(a, i); return i.hooks && (c = i.hooks.postprocess(c)), c; } catch (p) { return o(p); } }; } onError(e, t) { return (n)=>{ if (n.message += ` Please report this to https://github.com/markedjs/marked.`, e) { let s = "

    An error occurred:

    " + O(n.message + "", !0) + "
    "; return t ? Promise.resolve(s) : s; } if (t) return Promise.reject(n); throw n; }; } }; var E = new Z; function f(l, e) { return E.parse(l, e); } f.options = f.setOptions = function(l) { return E.setOptions(l), f.defaults = E.defaults, j(f.defaults), f; }; f.getDefaults = C; f.defaults = R; function kt(...l) { return E.use(...l), f.defaults = E.defaults, j(f.defaults), f; } f.use = kt; f.walkTokens = function(l, e) { return E.walkTokens(l, e); }; f.parseInline = E.parseInline; f.Parser = b; f.parser = b.parse; f.Renderer = P; f.TextRenderer = L; f.Lexer = x; f.lexer = x.lex; f.Tokenizer = y; f.Hooks = S; f.parse = f; var nn = f.options, rn = f.setOptions, sn = f.walkTokens, on = f.parseInline, an = f, ln = b.parse, pn = x.lex; ; }), "[project]/node_modules/parse-srcset/src/parse-srcset.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => { /** * Srcset Parser * * By Alex Bell | MIT License * * JS Parser for the string value that appears in markup * * @returns Array [{url: _, d: _, w: _, h:_}, ...] * * Based super duper closely on the reference algorithm at: * https://html.spec.whatwg.org/multipage/embedded-content.html#parse-a-srcset-attribute * * Most comments are copied in directly from the spec * (except for comments in parens). */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. ((r)=>r !== undefined && __turbopack_context__.v(r))(factory()); } else if (("TURBOPACK compile-time value", "object") === 'object' && module.exports) { // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. module.exports = factory(); } else { // Browser globals (root is window) root.parseSrcset = factory(); } })(/*TURBOPACK member replacement*/ __turbopack_context__.e, function() { // 1. Let input be the value passed to this algorithm. return function(input) { // UTILITY FUNCTIONS // Manual is faster than RegEx // http://bjorn.tipling.com/state-and-regular-expressions-in-javascript // http://jsperf.com/whitespace-character/5 function isSpace(c) { return c === "\u0020" || // space c === "\u0009" || // horizontal tab c === "\u000A" || // new line c === "\u000C" || // form feed c === "\u000D"; // carriage return } function collectCharacters(regEx) { var chars, match = regEx.exec(input.substring(pos)); if (match) { chars = match[0]; pos += chars.length; return chars; } } var inputLength = input.length, // (Don't use \s, to avoid matching non-breaking space) regexLeadingSpaces = /^[ \t\n\r\u000c]+/, regexLeadingCommasOrSpaces = /^[, \t\n\r\u000c]+/, regexLeadingNotSpaces = /^[^ \t\n\r\u000c]+/, regexTrailingCommas = /[,]+$/, regexNonNegativeInteger = /^\d+$/, // ( Positive or negative or unsigned integers or decimals, without or without exponents. // Must include at least one digit. // According to spec tests any decimal point must be followed by a digit. // No leading plus sign is allowed.) // https://html.spec.whatwg.org/multipage/infrastructure.html#valid-floating-point-number regexFloatingPoint = /^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/, url, descriptors, currentDescriptor, state, c, // 2. Let position be a pointer into input, initially pointing at the start // of the string. pos = 0, // 3. Let candidates be an initially empty source set. candidates = []; // 4. Splitting loop: Collect a sequence of characters that are space // characters or U+002C COMMA characters. If any U+002C COMMA characters // were collected, that is a parse error. while(true){ collectCharacters(regexLeadingCommasOrSpaces); // 5. If position is past the end of input, return candidates and abort these steps. if (pos >= inputLength) { return candidates; // (we're done, this is the sole return path) } // 6. Collect a sequence of characters that are not space characters, // and let that be url. url = collectCharacters(regexLeadingNotSpaces); // 7. Let descriptors be a new empty list. descriptors = []; // 8. If url ends with a U+002C COMMA character (,), follow these substeps: // (1). Remove all trailing U+002C COMMA characters from url. If this removed // more than one character, that is a parse error. if (url.slice(-1) === ",") { url = url.replace(regexTrailingCommas, ""); // (Jump ahead to step 9 to skip tokenization and just push the candidate). parseDescriptors(); // Otherwise, follow these substeps: } else { tokenize(); } // (close else of step 8) // 16. Return to the step labeled splitting loop. } // (Close of big while loop.) /** * Tokenizes descriptor properties prior to parsing * Returns undefined. */ function tokenize() { // 8.1. Descriptor tokeniser: Skip whitespace collectCharacters(regexLeadingSpaces); // 8.2. Let current descriptor be the empty string. currentDescriptor = ""; // 8.3. Let state be in descriptor. state = "in descriptor"; while(true){ // 8.4. Let c be the character at position. c = input.charAt(pos); // Do the following depending on the value of state. // For the purpose of this step, "EOF" is a special character representing // that position is past the end of input. // In descriptor if (state === "in descriptor") { // Do the following, depending on the value of c: // Space character // If current descriptor is not empty, append current descriptor to // descriptors and let current descriptor be the empty string. // Set state to after descriptor. if (isSpace(c)) { if (currentDescriptor) { descriptors.push(currentDescriptor); currentDescriptor = ""; state = "after descriptor"; } // U+002C COMMA (,) // Advance position to the next character in input. If current descriptor // is not empty, append current descriptor to descriptors. Jump to the step // labeled descriptor parser. } else if (c === ",") { pos += 1; if (currentDescriptor) { descriptors.push(currentDescriptor); } parseDescriptors(); return; // U+0028 LEFT PARENTHESIS (() // Append c to current descriptor. Set state to in parens. } else if (c === "\u0028") { currentDescriptor = currentDescriptor + c; state = "in parens"; // EOF // If current descriptor is not empty, append current descriptor to // descriptors. Jump to the step labeled descriptor parser. } else if (c === "") { if (currentDescriptor) { descriptors.push(currentDescriptor); } parseDescriptors(); return; // Anything else // Append c to current descriptor. } else { currentDescriptor = currentDescriptor + c; } // (end "in descriptor" // In parens } else if (state === "in parens") { // U+0029 RIGHT PARENTHESIS ()) // Append c to current descriptor. Set state to in descriptor. if (c === ")") { currentDescriptor = currentDescriptor + c; state = "in descriptor"; // EOF // Append current descriptor to descriptors. Jump to the step labeled // descriptor parser. } else if (c === "") { descriptors.push(currentDescriptor); parseDescriptors(); return; // Anything else // Append c to current descriptor. } else { currentDescriptor = currentDescriptor + c; } // After descriptor } else if (state === "after descriptor") { // Do the following, depending on the value of c: // Space character: Stay in this state. if (isSpace(c)) { // EOF: Jump to the step labeled descriptor parser. } else if (c === "") { parseDescriptors(); return; // Anything else // Set state to in descriptor. Set position to the previous character in input. } else { state = "in descriptor"; pos -= 1; } } // Advance position to the next character in input. pos += 1; // Repeat this step. } // (close while true loop) } /** * Adds descriptor properties to a candidate, pushes to the candidates array * @return undefined */ // Declared outside of the while loop so that it's only created once. function parseDescriptors() { // 9. Descriptor parser: Let error be no. var pError = false, // 10. Let width be absent. // 11. Let density be absent. // 12. Let future-compat-h be absent. (We're implementing it now as h) w, d, h, i, candidate = {}, desc, lastChar, value, intVal, floatVal; // 13. For each descriptor in descriptors, run the appropriate set of steps // from the following list: for(i = 0; i < descriptors.length; i++){ desc = descriptors[i]; lastChar = desc[desc.length - 1]; value = desc.substring(0, desc.length - 1); intVal = parseInt(value, 10); floatVal = parseFloat(value); // If the descriptor consists of a valid non-negative integer followed by // a U+0077 LATIN SMALL LETTER W character if (regexNonNegativeInteger.test(value) && lastChar === "w") { // If width and density are not both absent, then let error be yes. if (w || d) { pError = true; } // Apply the rules for parsing non-negative integers to the descriptor. // If the result is zero, let error be yes. // Otherwise, let width be the result. if (intVal === 0) { pError = true; } else { w = intVal; } // If the descriptor consists of a valid floating-point number followed by // a U+0078 LATIN SMALL LETTER X character } else if (regexFloatingPoint.test(value) && lastChar === "x") { // If width, density and future-compat-h are not all absent, then let error // be yes. if (w || d || h) { pError = true; } // Apply the rules for parsing floating-point number values to the descriptor. // If the result is less than zero, let error be yes. Otherwise, let density // be the result. if (floatVal < 0) { pError = true; } else { d = floatVal; } // If the descriptor consists of a valid non-negative integer followed by // a U+0068 LATIN SMALL LETTER H character } else if (regexNonNegativeInteger.test(value) && lastChar === "h") { // If height and density are not both absent, then let error be yes. if (h || d) { pError = true; } // Apply the rules for parsing non-negative integers to the descriptor. // If the result is zero, let error be yes. Otherwise, let future-compat-h // be the result. if (intVal === 0) { pError = true; } else { h = intVal; } // Anything else, Let error be yes. } else { pError = true; } } // (close step 13 for loop) // 15. If error is still no, then append a new image source to candidates whose // URL is url, associated with a width width if not absent and a pixel // density density if not absent. Otherwise, there is a parse error. if (!pError) { candidate.url = url; if (w) { candidate.w = w; } if (d) { candidate.d = d; } if (h) { candidate.h = h; } candidates.push(candidate); } else if (console && console.log) { console.log("Invalid srcset descriptor found in '" + input + "' at '" + desc + "'."); } } // (close parseDescriptors fn) }; }); }), "[project]/node_modules/sanitize-html/index.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => { const htmlparser = __turbopack_context__.r("[project]/node_modules/htmlparser2/dist/index.js [app-ssr] (ecmascript)"); const escapeStringRegexp = __turbopack_context__.r("[project]/node_modules/escape-string-regexp/index.js [app-ssr] (ecmascript)"); const { isPlainObject } = __turbopack_context__.r("[project]/node_modules/is-plain-object/dist/is-plain-object.js [app-ssr] (ecmascript)"); const deepmerge = __turbopack_context__.r("[project]/node_modules/deepmerge/dist/cjs.js [app-ssr] (ecmascript)"); const parseSrcset = __turbopack_context__.r("[project]/node_modules/parse-srcset/src/parse-srcset.js [app-ssr] (ecmascript)"); const { parse: postcssParse } = __turbopack_context__.r("[externals]/postcss [external] (postcss, cjs, [project]/node_modules/postcss)"); const { naughtyHref: launderNaughtyHref } = __turbopack_context__.r("[project]/node_modules/launder/index.js [app-ssr] (ecmascript)"); // Tags that can conceivably represent stand-alone media. const mediaTags = [ 'img', 'audio', 'video', 'picture', 'svg', 'object', 'map', 'iframe', 'embed' ]; // Tags that are inherently vulnerable to being used in XSS attacks. const vulnerableTags = [ 'script', 'style' ]; function each(obj, cb) { if (obj) { Object.keys(obj).forEach(function(key) { cb(obj[key], key); }); } } // Avoid false positives with .__proto__, .hasOwnProperty, etc. function has(obj, key) { return ({}).hasOwnProperty.call(obj, key); } // Returns those elements of `a` for which `cb(a)` returns truthy function filter(a, cb) { const n = []; each(a, function(v) { if (cb(v)) { n.push(v); } }); return n; } function isEmptyObject(obj) { for(const key in obj){ if (has(obj, key)) { return false; } } return true; } function stringifySrcset(parsedSrcset) { return parsedSrcset.map(function(part) { if (!part.url) { throw new Error('URL missing'); } return part.url + (part.w ? ` ${part.w}w` : '') + (part.h ? ` ${part.h}h` : '') + (part.d ? ` ${part.d}x` : ''); }).join(', '); } module.exports = sanitizeHtml; // A valid attribute name. // We use a tolerant definition based on the set of strings defined by // html.spec.whatwg.org/multipage/parsing.html#before-attribute-name-state // and html.spec.whatwg.org/multipage/parsing.html#attribute-name-state . // The characters accepted are ones which can be appended to the attribute // name buffer without triggering a parse error: // * unexpected-equals-sign-before-attribute-name // * unexpected-null-character // * unexpected-character-in-attribute-name // We exclude the empty string because it's impossible to get to the after // attribute name state with an empty attribute name buffer. const VALID_HTML_ATTRIBUTE_NAME = /^[^\0\t\n\f\r /<=>]+$/; // Ignore the _recursing flag; it's there for recursive // invocation as a guard against this exploit: // https://github.com/fb55/htmlparser2/issues/105 function sanitizeHtml(html, options, _recursing) { if (html == null) { return ''; } if (typeof html === 'number') { html = html.toString(); } let result = ''; // Used for hot swapping the result variable with an empty string // in order to "capture" the text written to it. let tempResult = ''; function Frame(tag, attribs) { const that = this; this.tag = tag; this.attribs = attribs || {}; this.tagPosition = result.length; this.text = ''; // Node inner text this.openingTagLength = 0; this.mediaChildren = []; this.updateParentNodeText = function() { if (stack.length) { const parentFrame = stack[stack.length - 1]; parentFrame.text += that.text; } }; this.updateParentNodeMediaChildren = function() { if (stack.length && mediaTags.includes(this.tag)) { const parentFrame = stack[stack.length - 1]; parentFrame.mediaChildren.push(this.tag); } }; } options = Object.assign({}, sanitizeHtml.defaults, options); options.parser = Object.assign({}, htmlParserDefaults, options.parser); const tagAllowed = function(name) { return options.allowedTags === false || (options.allowedTags || []).indexOf(name) > -1; }; // vulnerableTags vulnerableTags.forEach(function(tag) { if (tagAllowed(tag) && !options.allowVulnerableTags) { console.warn(`\n\n⚠️ Your \`allowedTags\` option includes, \`${tag}\`, which is inherently\nvulnerable to XSS attacks. Please remove it from \`allowedTags\`.\nOr, to disable this warning, add the \`allowVulnerableTags\` option\nand ensure you are accounting for this risk.\n\n`); } }); // Tags that contain something other than HTML, or where discarding // the text when the tag is disallowed makes sense for other reasons. // If we are not allowing these tags, we should drop their content too. // For other tags you would drop the tag but keep its content. // `xmp` is included because htmlparser2 treats it as a raw-text element, // so markup inside is parsed as text on input but would otherwise be // re-emitted unescaped via the `ontext` branch below, allowing XSS bypass // when `xmp` is disallowed (which is the default). const nonTextTagsArray = options.nonTextTags || [ 'script', 'style', 'textarea', 'option', 'xmp' ]; let allowedAttributesMap; let allowedAttributesGlobMap; if (options.allowedAttributes) { allowedAttributesMap = {}; allowedAttributesGlobMap = {}; each(options.allowedAttributes, function(attributes, tag) { allowedAttributesMap[tag] = []; const globRegex = []; attributes.forEach(function(obj) { if (typeof obj === 'string' && obj.indexOf('*') >= 0) { globRegex.push(escapeStringRegexp(obj).replace(/\\\*/g, '.*')); } else { allowedAttributesMap[tag].push(obj); } }); if (globRegex.length) { allowedAttributesGlobMap[tag] = new RegExp('^(' + globRegex.join('|') + ')$'); } }); } const allowedClassesMap = {}; const allowedClassesGlobMap = {}; const allowedClassesRegexMap = {}; each(options.allowedClasses, function(classes, tag) { // Implicitly allows the class attribute if (allowedAttributesMap) { if (!has(allowedAttributesMap, tag)) { allowedAttributesMap[tag] = []; } allowedAttributesMap[tag].push('class'); } allowedClassesMap[tag] = classes; if (Array.isArray(classes)) { const globRegex = []; allowedClassesMap[tag] = []; allowedClassesRegexMap[tag] = []; classes.forEach(function(obj) { if (typeof obj === 'string' && obj.indexOf('*') >= 0) { globRegex.push(escapeStringRegexp(obj).replace(/\\\*/g, '.*')); } else if (obj instanceof RegExp) { allowedClassesRegexMap[tag].push(obj); } else { allowedClassesMap[tag].push(obj); } }); if (globRegex.length) { allowedClassesGlobMap[tag] = new RegExp('^(' + globRegex.join('|') + ')$'); } } }); const transformTagsMap = {}; let transformTagsAll; each(options.transformTags, function(transform, tag) { let transFun; if (typeof transform === 'function') { transFun = transform; } else if (typeof transform === 'string') { transFun = sanitizeHtml.simpleTransform(transform); } if (tag === '*') { transformTagsAll = transFun; } else { transformTagsMap[tag] = transFun; } }); let depth; let stack; let skipMap; let transformMap; let skipText; let skipTextDepth; let addedText = false; initializeState(); const parser = new htmlparser.Parser({ onopentag: function(name, attribs) { if (options.onOpenTag) { options.onOpenTag(name, attribs); } // If `enforceHtmlBoundary` is `true` and this has found the opening // `html` tag, reset the state. if (options.enforceHtmlBoundary && name === 'html') { initializeState(); } if (skipText) { skipTextDepth++; return; } const frame = new Frame(name, attribs); stack.push(frame); let skip = false; const hasText = !!frame.text; let transformedTag; if (has(transformTagsMap, name)) { transformedTag = transformTagsMap[name](name, attribs); frame.attribs = attribs = transformedTag.attribs; if (transformedTag.text !== undefined) { frame.innerText = transformedTag.text; } if (name !== transformedTag.tagName) { frame.name = name = transformedTag.tagName; transformMap[depth] = transformedTag.tagName; } } if (transformTagsAll) { transformedTag = transformTagsAll(name, attribs); frame.attribs = attribs = transformedTag.attribs; if (name !== transformedTag.tagName) { frame.name = name = transformedTag.tagName; transformMap[depth] = transformedTag.tagName; } } if (!tagAllowed(name) || options.disallowedTagsMode === 'recursiveEscape' && !isEmptyObject(skipMap) || options.nestingLimit != null && depth >= options.nestingLimit) { skip = true; skipMap[depth] = true; if (options.disallowedTagsMode === 'discard' || options.disallowedTagsMode === 'completelyDiscard') { if (nonTextTagsArray.indexOf(name) !== -1) { skipText = true; skipTextDepth = 1; } } } depth++; if (skip) { if (options.disallowedTagsMode === 'discard' || options.disallowedTagsMode === 'completelyDiscard') { // We want the contents but not this tag if (frame.innerText && !hasText) { const escaped = escapeHtml(frame.innerText); if (options.textFilter) { result += options.textFilter(escaped, name); } else { result += escaped; } addedText = true; } return; } tempResult = result; result = ''; } result += '<' + name; if (name === 'script') { if (options.allowedScriptHostnames || options.allowedScriptDomains) { frame.innerText = ''; } } const isBeingEscaped = skip && (options.disallowedTagsMode === 'escape' || options.disallowedTagsMode === 'recursiveEscape'); const shouldPreserveEscapedAttributes = isBeingEscaped && options.preserveEscapedAttributes; if (shouldPreserveEscapedAttributes) { each(attribs, function(value, a) { result += ' ' + a + '="' + escapeHtml(value || '', true) + '"'; }); } else if (!allowedAttributesMap || has(allowedAttributesMap, name) || allowedAttributesMap['*']) { each(attribs, function(value, a) { if (!VALID_HTML_ATTRIBUTE_NAME.test(a)) { // This prevents part of an attribute name in the output from being // interpreted as the end of an attribute, or end of a tag. delete frame.attribs[a]; return; } // If the value is empty, check if the attribute is // in the allowedEmptyAttributes array. // If it is not in the allowedEmptyAttributes array, // and it is a known non-boolean attribute, delete it // List taken from https://html.spec.whatwg.org/multipage/indices.html#attributes-3 if (value === '' && !options.allowedEmptyAttributes.includes(a) && (options.nonBooleanAttributes.includes(a) || options.nonBooleanAttributes.includes('*'))) { delete frame.attribs[a]; return; } // check allowedAttributesMap for the element and attribute and modify the value // as necessary if there are specific values defined. let passedAllowedAttributesMapCheck = false; if (!allowedAttributesMap || has(allowedAttributesMap, name) && allowedAttributesMap[name].indexOf(a) !== -1 || allowedAttributesMap['*'] && allowedAttributesMap['*'].indexOf(a) !== -1 || has(allowedAttributesGlobMap, name) && allowedAttributesGlobMap[name].test(a) || allowedAttributesGlobMap['*'] && allowedAttributesGlobMap['*'].test(a)) { passedAllowedAttributesMapCheck = true; } else if (allowedAttributesMap && allowedAttributesMap[name]) { for (const o of allowedAttributesMap[name]){ if (isPlainObject(o) && o.name && o.name === a) { passedAllowedAttributesMapCheck = true; let newValue = ''; if (o.multiple === true) { // verify the values that are allowed const splitStrArray = value.split(' '); for (const s of splitStrArray){ if (o.values.indexOf(s) !== -1) { if (newValue === '') { newValue = s; } else { newValue += ' ' + s; } } } } else if (o.values.indexOf(value) >= 0) { // verified an allowed value matches the entire attribute value newValue = value; } value = newValue; } } } if (passedAllowedAttributesMapCheck) { if (options.allowedSchemesAppliedToAttributes.indexOf(a) !== -1) { if (naughtyHref(name, value)) { delete frame.attribs[a]; return; } } if (name === 'script' && a === 'src') { let allowed = true; try { const parsed = parseUrl(value); if (options.allowedScriptHostnames || options.allowedScriptDomains) { const allowedHostname = (options.allowedScriptHostnames || []).find(function(hostname) { return hostname === parsed.url.hostname; }); const allowedDomain = (options.allowedScriptDomains || []).find(function(domain) { return parsed.url.hostname === domain || parsed.url.hostname.endsWith(`.${domain}`); }); allowed = allowedHostname || allowedDomain; } } catch (e) { allowed = false; } if (!allowed) { delete frame.attribs[a]; return; } } if (name === 'iframe' && a === 'src') { let allowed = true; try { const parsed = parseUrl(value); if (parsed.isRelativeUrl) { // default value of allowIframeRelativeUrls is true // unless allowedIframeHostnames or allowedIframeDomains specified allowed = has(options, 'allowIframeRelativeUrls') ? options.allowIframeRelativeUrls : !options.allowedIframeHostnames && !options.allowedIframeDomains; } else if (options.allowedIframeHostnames || options.allowedIframeDomains) { const allowedHostname = (options.allowedIframeHostnames || []).find(function(hostname) { return hostname === parsed.url.hostname; }); const allowedDomain = (options.allowedIframeDomains || []).find(function(domain) { return parsed.url.hostname === domain || parsed.url.hostname.endsWith(`.${domain}`); }); allowed = allowedHostname || allowedDomain; } } catch (e) { // Unparseable iframe src allowed = false; } if (!allowed) { delete frame.attribs[a]; return; } } if (a === 'srcset' || a === 'imagesrcset') { try { let parsed = parseSrcset(value); parsed.forEach(function(value) { if (naughtyHref(a, value.url)) { value.evil = true; } }); parsed = filter(parsed, function(v) { return !v.evil; }); if (!parsed.length) { delete frame.attribs[a]; return; } else { value = stringifySrcset(filter(parsed, function(v) { return !v.evil; })); frame.attribs[a] = value; } } catch (e) { // Unparseable srcset delete frame.attribs[a]; return; } } if (a === 'class') { const allowedSpecificClasses = allowedClassesMap[name]; const allowedWildcardClasses = allowedClassesMap['*']; const allowedSpecificClassesGlob = allowedClassesGlobMap[name]; const allowedSpecificClassesRegex = allowedClassesRegexMap[name]; const allowedWildcardClassesRegex = allowedClassesRegexMap['*']; const allowedWildcardClassesGlob = allowedClassesGlobMap['*']; const allowedClassesGlobs = [ allowedSpecificClassesGlob, allowedWildcardClassesGlob ].concat(allowedSpecificClassesRegex, allowedWildcardClassesRegex).filter(function(t) { return t; }); if (allowedSpecificClasses && allowedWildcardClasses) { value = filterClasses(value, deepmerge(allowedSpecificClasses, allowedWildcardClasses), allowedClassesGlobs); } else { value = filterClasses(value, allowedSpecificClasses || allowedWildcardClasses, allowedClassesGlobs); } if (!value.length) { delete frame.attribs[a]; return; } } if (a === 'style') { if (options.parseStyleAttributes) { try { const abstractSyntaxTree = postcssParse(name + ' {' + value + '}', { map: false }); const filteredAST = filterCss(abstractSyntaxTree, options.allowedStyles); value = stringifyStyleAttributes(filteredAST); if (value.length === 0) { delete frame.attribs[a]; return; } } catch (e) { if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; delete frame.attribs[a]; return; } } else if (options.allowedStyles) { throw new Error('allowedStyles option cannot be used together with parseStyleAttributes: false.'); } } result += ' ' + a; if (value && value.length) { result += '="' + escapeHtml(value, true) + '"'; } else if (options.allowedEmptyAttributes.includes(a)) { result += '=""'; } } else { delete frame.attribs[a]; } }); } if (options.selfClosing.indexOf(name) !== -1) { result += ' />'; } else { result += '>'; if (frame.innerText && !hasText) { const escaped = escapeHtml(frame.innerText); if (options.textFilter) { result += options.textFilter(escaped, name); } else { result += escaped; } addedText = true; } } if (skip) { result = tempResult + escapeHtml(result); tempResult = ''; } frame.openingTagLength = result.length - frame.tagPosition; }, ontext: function(text) { if (skipText) { return; } const lastFrame = stack[stack.length - 1]; let tag; if (lastFrame) { tag = lastFrame.tag; // If inner text was set by transform function then let's use it text = lastFrame.innerText !== undefined ? lastFrame.innerText : text; } if (options.disallowedTagsMode === 'completelyDiscard' && !tagAllowed(tag)) { text = ''; } else if (tag && tagAllowed(tag) && (options.disallowedTagsMode === 'discard' || options.disallowedTagsMode === 'completelyDiscard') && (tag === 'script' || tag === 'style')) { // htmlparser2 gives us these as-is. Escaping them ruins the content. Allowing // script tags is, by definition, game over for XSS protection, so if that's // your concern, don't allow them. The same is essentially true for style tags // which have their own collection of XSS vectors. result += text; } else if (tag && tagAllowed(tag) && (options.disallowedTagsMode === 'discard' || options.disallowedTagsMode === 'completelyDiscard') && (tag === 'textarea' || tag === 'xmp')) { // ` solidus mis-close). We therefore ALWAYS escape this // content rather than passing it through. Escaping unconditionally also // closes the related SVG/MathML foreign-content bypass (where the HTML5 // parser treats `): since // we never re-emit raw text for these tags, no namespace check is // needed. The two tags need different escaping because htmlparser2 // tokenizes them differently: if (tag === 'xmp') { // is a raw-text (CDATA) element: entities are NOT decoded, so // its content reaches us as raw source that is already entity-encoded. // Escape only the angle brackets so a literal `<` cannot reopen a tag, // while leaving `&` untouched to avoid double-encoding entities that // are already encoded in the source. result += text.replace(/</g, '&lt;').replace(/>/g, '&gt;'); } else { // <textarea> is an RCDATA element: htmlparser2 (>= 11) decodes // entities inside it, so its content reaches us as plain decoded text. // It must therefore be fully escaped like any other text — escaping // `&` as well as `<`/`>` — so entities round-trip faithfully (no // double-encoding, see the CVE-2026-40186 regression tests) and no // `<` can reopen a tag. result += escapeHtml(text, false); } // Other "nonTextTags" like <option> are not raw text elements in // htmlparser2, so their contents are decoded and must be escaped below // like any other text (important to prevent XSS via entity-encoded // payloads such as <option>&lt;script&gt;...&lt;/script&gt;</option>). } else if (!addedText) { const escaped = escapeHtml(text, false); if (options.textFilter) { result += options.textFilter(escaped, tag); } else { result += escaped; } } if (stack.length) { const frame = stack[stack.length - 1]; frame.text += text; } }, onclosetag: function(name, isImplied) { if (options.onCloseTag) { options.onCloseTag(name, isImplied); } if (skipText) { skipTextDepth--; if (!skipTextDepth) { skipText = false; } else { return; } } const frame = stack.pop(); if (!frame) { // Do not crash on bad markup return; } if (frame.tag !== name) { // Another case of bad markup. // Push to stack, so that it will be used in future closing tags. stack.push(frame); return; } skipText = options.enforceHtmlBoundary ? name === 'html' : false; depth--; const skip = skipMap[depth]; if (skip) { delete skipMap[depth]; if (options.disallowedTagsMode === 'discard' || options.disallowedTagsMode === 'completelyDiscard') { frame.updateParentNodeText(); return; } tempResult = result; result = ''; } if (transformMap[depth]) { name = transformMap[depth]; delete transformMap[depth]; } if (options.exclusiveFilter) { const filterResult = options.exclusiveFilter(frame); if (filterResult === 'excludeTag') { if (skip) { // no longer escaping the tag since it's not added at all result = tempResult; tempResult = ''; } // remove the opening tag from the result result = result.substring(0, frame.tagPosition) + result.substring(frame.tagPosition + frame.openingTagLength); return; } else if (filterResult) { result = result.substring(0, frame.tagPosition); return; } } frame.updateParentNodeMediaChildren(); frame.updateParentNodeText(); if (// Already output /> options.selfClosing.indexOf(name) !== -1 || isImplied && !tagAllowed(name) && [ 'escape', 'recursiveEscape' ].indexOf(options.disallowedTagsMode) >= 0) { if (skip) { result = tempResult; tempResult = ''; } return; } result += '</' + name + '>'; if (skip) { result = tempResult + escapeHtml(result); tempResult = ''; } addedText = false; } }, options.parser); parser.write(html); parser.end(); if (options.disallowedTagsMode === 'escape' || options.disallowedTagsMode === 'recursiveEscape') { const lastParsedIndex = parser.endIndex; if (lastParsedIndex != null && lastParsedIndex >= 0 && lastParsedIndex < html.length) { const unparsed = html.substring(lastParsedIndex); result += escapeHtml(unparsed); } else if ((lastParsedIndex == null || lastParsedIndex < 0) && html.length > 0 && result === '') { result = escapeHtml(html); } } return result; //TURBOPACK unreachable ; function initializeState() { result = ''; depth = 0; stack = []; skipMap = {}; transformMap = {}; skipText = false; skipTextDepth = 0; } function escapeHtml(s, quote) { if (typeof s !== 'string') { s = s + ''; } if (options.parser.decodeEntities) { s = s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); if (quote) { s = s.replace(/"/g, '&quot;'); } } // TODO: this is inadequate because it will pass `&0;`. This approach // will not work, each & must be considered with regard to whether it // is followed by a 100% syntactically valid entity or not, and escaped // if it is not. If this bothers you, don't set parser.decodeEntities // to false. (The default is true.) s = s.replace(/&(?![a-zA-Z0-9#]{1,20};)/g, '&amp;') // Match ampersands not part of existing HTML entity .replace(/</g, '&lt;').replace(/>/g, '&gt;'); if (quote) { s = s.replace(/"/g, '&quot;'); } return s; } function naughtyHref(name, href) { // Resolve the per-tag scheme allowlist if one is configured for // this tag, otherwise fall back to the global allowedSchemes. const allowedSchemes = has(options.allowedSchemesByTag, name) ? options.allowedSchemesByTag[name] : options.allowedSchemes || []; return launderNaughtyHref(href, { allowedSchemes, allowProtocolRelative: options.allowProtocolRelative }); } function parseUrl(value) { value = value.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/, '$1//'); if (value.startsWith('relative:')) { // An attempt to exploit our workaround for base URLs being // mandatory for relative URL validation in the WHATWG // URL parser, reject it throw new Error('relative: exploit attempt'); } // naughtyHref is in charge of whether protocol relative URLs // are cool. Here we are concerned just with allowed hostnames and // whether to allow relative URLs. // // Build a placeholder "base URL" against which any reasonable // relative URL may be parsed successfully let base = 'relative://relative-site'; for(let i = 0; i < 100; i++){ base += `/${i}`; } const parsed = new URL(value, base); const isRelativeUrl = parsed && parsed.hostname === 'relative-site' && parsed.protocol === 'relative:'; return { isRelativeUrl, url: parsed }; } /** * Filters user input css properties by allowlisted regex attributes. * Modifies the abstractSyntaxTree object. * * @param {object} abstractSyntaxTree - Object representation of CSS attributes. * @property {array[Declaration]} abstractSyntaxTree.nodes[0] - * Each object contains prop and value key, i.e { prop: 'color', value: 'red' }. * @param {object} allowedStyles - Keys are properties (i.e color), * value is list of permitted regex rules (i.e /green/i). * @return {object} - The modified tree. */ function filterCss(abstractSyntaxTree, allowedStyles) { if (!allowedStyles) { return abstractSyntaxTree; } const astRules = abstractSyntaxTree.nodes[0]; let selectedRule; // Merge global and tag-specific styles into new AST. if (allowedStyles[astRules.selector] && allowedStyles['*']) { selectedRule = deepmerge(allowedStyles[astRules.selector], allowedStyles['*']); } else { selectedRule = allowedStyles[astRules.selector] || allowedStyles['*']; } if (selectedRule) { abstractSyntaxTree.nodes[0].nodes = astRules.nodes.reduce(filterDeclarations(selectedRule), []); } return abstractSyntaxTree; } /** * Extracts the style attributes from an AbstractSyntaxTree and formats those * values in the inline style attribute format. * * @param {AbstractSyntaxTree} filteredAST * @return {string} - Example: * "color:yellow;text-align:center !important;font-family:helvetica;" */ function stringifyStyleAttributes(filteredAST) { return filteredAST.nodes[0].nodes.reduce(function(extractedAttributes, attrObject) { extractedAttributes.push(`${attrObject.prop}:${attrObject.value}${attrObject.important ? ' !important' : ''}`); return extractedAttributes; }, []).join(';'); } /** * Filters the existing attributes for the given property. Discards any attributes * which don't match the allowlist. * * @param {object} selectedRule - Example: { color: red, font-family: helvetica } * @param {array} allowedDeclarationsList - List of declarations * which pass the allowlist. * @param {object} attributeObject - Object representing the current css property. * @property {string} attributeObject.type - Typically 'declaration'. * @property {string} attributeObject.prop - The CSS property, i.e 'color'. * @property {string} attributeObject.value - The corresponding value to * the css property, i.e 'red'. * @return {function} - When used in Array.reduce, * will return an array of Declaration objects */ function filterDeclarations(selectedRule) { return function(allowedDeclarationsList, attributeObject) { // If this property is allowlisted... if (has(selectedRule, attributeObject.prop)) { const matchesRegex = selectedRule[attributeObject.prop].some(function(regularExpression) { return regularExpression.test(attributeObject.value); }); if (matchesRegex) { allowedDeclarationsList.push(attributeObject); } } return allowedDeclarationsList; }; } function filterClasses(classes, allowed, allowedGlobs) { if (!allowed) { // The class attribute is allowed without filtering on this tag return classes; } classes = classes.split(/\s+/); return classes.filter(function(clss) { return allowed.indexOf(clss) !== -1 || allowedGlobs.some(function(glob) { return glob.test(clss); }); }).join(' '); } } // Defaults are accessible to you so that you can use them as a starting point // programmatically if you wish const htmlParserDefaults = { decodeEntities: true }; sanitizeHtml.defaults = { allowedTags: [ // Sections derived from MDN element categories and limited to the more // benign categories. // https://developer.mozilla.org/en-US/docs/Web/HTML/Element // Content sectioning 'address', 'article', 'aside', 'footer', 'header', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hgroup', 'main', 'nav', 'section', // Text content 'blockquote', 'dd', 'div', 'dl', 'dt', 'figcaption', 'figure', 'hr', 'li', 'menu', 'ol', 'p', 'pre', 'ul', // Inline text semantics 'a', 'abbr', 'b', 'bdi', 'bdo', 'br', 'cite', 'code', 'data', 'dfn', 'em', 'i', 'kbd', 'mark', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'time', 'u', 'var', 'wbr', // Table content 'caption', 'col', 'colgroup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr' ], // Tags that cannot be boolean nonBooleanAttributes: [ 'abbr', 'accept', 'accept-charset', 'accesskey', 'action', 'allow', 'alt', 'as', 'autocapitalize', 'autocomplete', 'blocking', 'charset', 'cite', 'class', 'color', 'cols', 'colspan', 'content', 'contenteditable', 'coords', 'crossorigin', 'data', 'datetime', 'decoding', 'dir', 'dirname', 'download', 'draggable', 'enctype', 'enterkeyhint', 'fetchpriority', 'for', 'form', 'formaction', 'formenctype', 'formmethod', 'formtarget', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'http-equiv', 'id', 'imagesizes', 'imagesrcset', 'inputmode', 'integrity', 'is', 'itemid', 'itemprop', 'itemref', 'itemtype', 'kind', 'label', 'lang', 'list', 'loading', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'name', 'nonce', 'optimum', 'pattern', 'ping', 'placeholder', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'referrerpolicy', 'rel', 'rows', 'rowspan', 'sandbox', 'scope', 'shape', 'size', 'sizes', 'slot', 'span', 'spellcheck', 'src', 'srcdoc', 'srclang', 'srcset', 'start', 'step', 'style', 'tabindex', 'target', 'title', 'translate', 'type', 'usemap', 'value', 'width', 'wrap', // Event handlers 'onauxclick', 'onafterprint', 'onbeforematch', 'onbeforeprint', 'onbeforeunload', 'onbeforetoggle', 'onblur', 'oncancel', 'oncanplay', 'oncanplaythrough', 'onchange', 'onclick', 'onclose', 'oncontextlost', 'oncontextmenu', 'oncontextrestored', 'oncopy', 'oncuechange', 'oncut', 'ondblclick', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'ondurationchange', 'onemptied', 'onended', 'onerror', 'onfocus', 'onformdata', 'onhashchange', 'oninput', 'oninvalid', 'onkeydown', 'onkeypress', 'onkeyup', 'onlanguagechange', 'onload', 'onloadeddata', 'onloadedmetadata', 'onloadstart', 'onmessage', 'onmessageerror', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onoffline', 'ononline', 'onpagehide', 'onpageshow', 'onpaste', 'onpause', 'onplay', 'onplaying', 'onpopstate', 'onprogress', 'onratechange', 'onreset', 'onresize', 'onrejectionhandled', 'onscroll', 'onscrollend', 'onsecuritypolicyviolation', 'onseeked', 'onseeking', 'onselect', 'onslotchange', 'onstalled', 'onstorage', 'onsubmit', 'onsuspend', 'ontimeupdate', 'ontoggle', 'onunhandledrejection', 'onunload', 'onvolumechange', 'onwaiting', 'onwheel' ], disallowedTagsMode: 'discard', allowedAttributes: { a: [ 'href', 'name', 'target' ], // We don't currently allow img itself by default, but // these attributes would make sense if we did. img: [ 'src', 'srcset', 'alt', 'title', 'width', 'height', 'loading' ] }, allowedEmptyAttributes: [ 'alt' ], // Lots of these won't come up by default because we don't allow them selfClosing: [ 'img', 'br', 'hr', 'area', 'base', 'basefont', 'input', 'link', 'meta', 'col' ], // URL schemes we permit allowedSchemes: [ 'http', 'https', 'ftp', 'mailto', 'tel' ], allowedSchemesByTag: {}, allowedSchemesAppliedToAttributes: [ 'href', 'src', 'cite', 'action', 'formaction', 'data', 'xlink:href', 'poster', 'background', 'ping', 'longdesc', 'usemap', 'codebase', 'classid', 'archive', 'profile', 'manifest', 'itemid', 'dynsrc', 'lowsrc' ], allowProtocolRelative: true, enforceHtmlBoundary: false, parseStyleAttributes: true, preserveEscapedAttributes: false }; sanitizeHtml.simpleTransform = function(newTagName, newAttribs, merge) { merge = merge === undefined ? true : merge; newAttribs = newAttribs || {}; return function(tagName, attribs) { let attrib; if (merge) { for(attrib in newAttribs){ attribs[attrib] = newAttribs[attrib]; } } else { attribs = newAttribs; } return { tagName: newTagName, attribs }; }; }; }), ]; //# sourceMappingURL=%5Broot-of-the-server%5D__0xg8qdz._.js.map