UNPKG

highlight.run

Version:

Open source, fullstack monitoring. Capture frontend errors, record server side logs, and visualize what broke with session replay.

1,680 lines (1,679 loc) 442 kB
var ga = Object.defineProperty, Xa = Object.defineProperties; var Ga = Object.getOwnPropertyDescriptors; var At = Object.getOwnPropertySymbols; var Ur = Object.prototype.hasOwnProperty, Kr = Object.prototype.propertyIsEnumerable; var is = (s, e, t) => e in s ? ga(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, x = (s, e) => { for (var t in e || (e = {})) Ur.call(e, t) && is(s, t, e[t]); if (At) for (var t of At(e)) Kr.call(e, t) && is(s, t, e[t]); return s; }, re = (s, e) => Xa(s, Ga(e)); var Qe = (s, e) => { var t = {}; for (var i in s) Ur.call(s, i) && e.indexOf(i) < 0 && (t[i] = s[i]); if (s != null && At) for (var i of At(s)) e.indexOf(i) < 0 && Kr.call(s, i) && (t[i] = s[i]); return t; }; var L = (s, e, t) => is(s, typeof e != "symbol" ? e + "" : e, t); var ne = (s, e, t) => new Promise((i, r) => { var n = (l) => { try { a(t.next(l)); } catch (u) { r(u); } }, o = (l) => { try { a(t.throw(l)); } catch (u) { r(u); } }, a = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(n, o); a((t = t.apply(s, e)).next()); }); import { y as hl, z as Sa, a as we, S as ve, d as je, g as ss, r as Fr, G as rs, b as Ia, c as Va, n as Ra, o as Wa, l as Mr, e as ns, f as gt, F as zr, V as Ca, P as wa, h as xa, q as La, H as Hr, M as Ja, i as ka, s as va, L as Ya, A as Na, B as Ta, C as Ua, D as Ka, p as Fa, k as Or, u as Ma, E as za, x as Ha, I as Pr, J as Oa, K as Pa, N as Ea, O as Ba, Q as Qa, R as Da, T as ja } from "./common-Cqt7tQ3r.js"; import { L as Aa, i as Fe } from "./buffer-DIFxvF2Q.js"; import { LDRecord as _a } from "./LDRecord.js"; const $a = { key: "_sid" }, qa = "rrweb/sequential-id@1", ec = (s) => { const e = $a; let t = 0; return { name: qa, eventProcessor(i) { return Object.assign(i, { [e.key]: ++t }), i; }, options: e }; }; var tc = Object.defineProperty, ic = (s, e, t) => e in s ? tc(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, X = (s, e, t) => ic(s, typeof e != "symbol" ? e + "" : e, t), Er, sc = Object.defineProperty, rc = (s, e, t) => e in s ? sc(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, Br = (s, e, t) => rc(s, typeof e != "symbol" ? e + "" : e, t), ie = /* @__PURE__ */ ((s) => (s[s.Document = 0] = "Document", s[s.DocumentType = 1] = "DocumentType", s[s.Element = 2] = "Element", s[s.Text = 3] = "Text", s[s.CDATA = 4] = "CDATA", s[s.Comment = 5] = "Comment", s))(ie || {}); const _t = /* @__PURE__ */ new Map(), Qr = /* @__PURE__ */ new WeakSet(); function Dr(s) { return s !== null && typeof s == "object" && "complete" in s && "naturalWidth" in s && "naturalHeight" in s && "src" in s && "onload" in s; } function nc(s) { if (Qr.has(s)) return; Qr.add(s); const e = s.drawImage.bind(s); s.drawImage = function(t, ...i) { const r = _t.get(s); r && (r.cancelled = !0); const n = () => { i.length === 2 && Dr(t) && i.push(t.naturalWidth || t.width, t.naturalHeight || t.height), e(t, ...i); }; if (Dr(t) && !t.complete) { const o = { cancelled: !1 }; _t.set(s, o); const a = () => { o.cancelled || (_t.delete(s), n()); }, l = () => { if (!o.cancelled) { _t.delete(s); try { n(); } catch (u) { } } }; t.onload = a, t.onerror = l; } else n(); }; } const jr = { Node: ["childNodes", "parentNode", "parentElement", "textContent"], ShadowRoot: ["host", "styleSheets"], Element: ["shadowRoot", "querySelector", "querySelectorAll"], MutationObserver: [] }, Ar = { Node: ["contains", "getRootNode"], ShadowRoot: ["getSelection"], Element: [], MutationObserver: ["constructor"] }, $t = {}, lc = () => !!globalThis.Zone; function or(s) { if ($t[s]) return $t[s]; const e = globalThis[s], t = e.prototype, i = s in jr ? jr[s] : void 0, r = !!(i && // @ts-expect-error 2345 i.every( (a) => { var l, u; return !!((u = (l = Object.getOwnPropertyDescriptor(t, a)) == null ? void 0 : l.get) != null && u.toString().includes("[native code]")); } )), n = s in Ar ? Ar[s] : void 0, o = !!(n && n.every( // @ts-expect-error 2345 (a) => { var l; return typeof t[a] == "function" && ((l = t[a]) == null ? void 0 : l.toString().includes("[native code]")); } )); if (r && o && !lc()) return $t[s] = e.prototype, e.prototype; try { const a = document.createElement("iframe"); document.body.appendChild(a); const l = a.contentWindow; if (!l) return e.prototype; const u = l[s].prototype; return document.body.removeChild(a), u ? $t[s] = u : t; } catch (a) { return t; } } const ls = {}; function He(s, e, t) { var i; const r = `${s}.${String(t)}`; if (ls[r]) return ls[r].call( e ); const n = or(s), o = (i = Object.getOwnPropertyDescriptor( n, t )) == null ? void 0 : i.get; return o ? (ls[r] = o, o.call(e)) : e[t]; } const os = {}; function dl(s, e, t) { const i = `${s}.${String(t)}`; if (os[i]) return os[i].bind( e ); const n = or(s)[t]; return typeof n != "function" ? e[t] : (os[i] = n, n.bind(e)); } function oc(s) { return He("Node", s, "childNodes"); } function ac(s) { return He("Node", s, "parentNode"); } function cc(s) { return He("Node", s, "parentElement"); } function uc(s) { return He("Node", s, "textContent"); } function hc(s, e) { return dl("Node", s, "contains")(e); } function dc(s) { return dl("Node", s, "getRootNode")(); } function pc(s) { return !s || !("host" in s) ? null : He("ShadowRoot", s, "host"); } function mc(s) { return s.styleSheets; } function fc(s) { return !s || !("shadowRoot" in s) ? null : He("Element", s, "shadowRoot"); } function bc(s, e) { return He("Element", s, "querySelector")(e); } function Zc(s, e) { return He("Element", s, "querySelectorAll")(e); } function yc() { return or("MutationObserver").constructor; } function gc(s, e, t) { try { if (!(e in s)) return () => { }; const i = s[e], r = t(i); return typeof r == "function" && (r.prototype = r.prototype || {}, Object.defineProperties(r, { __rrweb_original__: { enumerable: !1, value: i } })), s[e] = r, () => { s[e] = i; }; } catch (i) { return () => { }; } } const le = { childNodes: oc, parentNode: ac, parentElement: cc, textContent: uc, contains: hc, getRootNode: dc, host: pc, styleSheets: mc, shadowRoot: fc, querySelector: bc, querySelectorAll: Zc, mutationObserver: yc, patch: gc, wrapCanvasContextDrawImage: nc }; function pl(s) { return s.nodeType === s.ELEMENT_NODE; } function wt(s) { const e = ( // anchor and textarea elements also have a `host` property // but only shadow roots have a `mode` property s && "host" in s && "mode" in s && le.host(s) || null ); return !!(e && "shadowRoot" in e && le.shadowRoot(e) === s); } function xt(s) { return Object.prototype.toString.call(s) === "[object ShadowRoot]"; } function Xc(s) { return s.includes(" background-clip: text;") && !s.includes(" -webkit-background-clip: text;") && (s = s.replace( /\sbackground-clip:\s*text;/g, " -webkit-background-clip: text; background-clip: text;" )), s; } function Gc(s) { const { cssText: e } = s; if (e.split('"').length < 3) return e; const t = ["@import", `url(${JSON.stringify(s.href)})`]; return s.layerName === "" ? t.push("layer") : s.layerName && t.push(`layer(${s.layerName})`), s.supportsText && t.push(`supports(${s.supportsText})`), s.media.length && t.push(s.media.mediaText), t.join(" ") + ";"; } function Ss(s) { try { const e = s.rules || s.cssRules; if (!e) return null; let t = s.href; !t && s.ownerNode && s.ownerNode.ownerDocument && (t = s.ownerNode.ownerDocument.location.href); const i = Array.from( e, (r) => ml(r, t) ).join(""); return Xc(i); } catch (e) { return null; } } function ml(s, e) { if (Ic(s)) { let t; try { t = // for same-origin stylesheets, // we can access the imported stylesheet rules directly Ss(s.styleSheet) || // work around browser issues with the raw string `@import url(...)` statement Gc(s); } catch (i) { t = s.cssText; } return s.styleSheet.href ? xi(t, s.styleSheet.href) : t; } else { let t = s.cssText; return Vc(s) && s.selectorText.includes(":") && (t = Sc(t)), e ? xi(t, e) : t; } } function Sc(s) { const e = /(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm; return s.replace(e, "$1\\$2"); } function Ic(s) { return "styleSheet" in s; } function Vc(s) { return "selectorText" in s; } class fl { constructor() { Br(this, "idNodeMap", /* @__PURE__ */ new Map()), Br(this, "nodeMetaMap", /* @__PURE__ */ new WeakMap()); } getId(e) { var t; if (!e) return -1; const i = (t = this.getMeta(e)) == null ? void 0 : t.id; return i != null ? i : -1; } getNode(e) { return this.idNodeMap.get(e) || null; } getIds() { return Array.from(this.idNodeMap.keys()); } getMeta(e) { return this.nodeMetaMap.get(e) || null; } // removes the node from idNodeMap // doesn't remove the node from nodeMetaMap removeNodeFromMap(e) { const t = this.getId(e); this.idNodeMap.delete(t), e.childNodes && e.childNodes.forEach( (i) => this.removeNodeFromMap(i) ); } has(e) { return this.idNodeMap.has(e); } hasNode(e) { return this.nodeMetaMap.has(e); } add(e, t) { const i = t.id; this.idNodeMap.set(i, e), this.nodeMetaMap.set(e, t); } replace(e, t) { const i = this.getNode(e); if (i) { const r = this.nodeMetaMap.get(i); r && this.nodeMetaMap.set(t, r); } this.idNodeMap.set(e, t); } reset() { this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap(); } } function Rc() { return new fl(); } function Ci({ element: s, maskInputOptions: e, tagName: t, type: i, value: r, overwriteRecord: n, maskInputFn: o }) { let a = r || ""; return yl({ maskInputOptions: e, tagName: t, type: i, overwriteRecord: n }) && (o ? a = o(a, s) : a = "*".repeat(a.length)), a; } function ct(s) { return s.toLowerCase(); } const _r = "__rrweb_original__"; function Wc(s) { const e = s.getContext("2d"); if (!e) return !0; const t = 50; for (let i = 0; i < s.width; i += t) for (let r = 0; r < s.height; r += t) { const n = e.getImageData, o = _r in n ? n[_r] : n; if (new Uint32Array( // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access o.call( e, i, r, Math.min(t, s.width - i), Math.min(t, s.height - r) ).data.buffer ).some((l) => l !== 0)) return !1; } return !0; } function wi(s) { const e = s.type; return s.hasAttribute("data-rr-is-password") ? "password" : e ? ( // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ct(e) ) : null; } function bl(s, e) { var n; let t; try { t = new URL(s, window.location.href); } catch (o) { return null; } const i = /\.([0-9a-z]+)(?:$)/i, r = t.pathname.match(i); return (n = r == null ? void 0 : r[1]) != null ? n : null; } function Cc(s) { let e = ""; return s.indexOf("//") > -1 ? e = s.split("/").slice(0, 3).join("/") : e = s.split("/")[0], e = e.split("?")[0], e; } const wc = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm, xc = /^(?:[a-z+]+:)?\/\//i, Lc = /^www\..*/i, Jc = /^(data:)([^,]*),(.*)/i; function xi(s, e) { return (s || "").replace( wc, (t, i, r, n, o, a) => { const l = r || o || a, u = i || n || ""; if (!l) return t; if (xc.test(l) || Lc.test(l)) return `url(${u}${l}${u})`; if (Jc.test(l)) return `url(${u}${l}${u})`; if (l[0] === "/") return `url(${u}${Cc(e) + l}${u})`; const c = e.split("/"), h = l.split("/"); c.pop(); for (const p of h) p !== "." && (p === ".." ? c.pop() : c.push(p)); return `url(${u}${c.join("/")}${u})`; } ); } function qt(s, e = !1) { return e ? s.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "") : s.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "").replace(/0px/g, "0"); } function kc(s, e, t = !1) { const i = Array.from(e.childNodes), r = []; let n = 0; if (i.length > 1 && s && typeof s == "string") { let o = qt(s, t); const a = o.length / s.length; for (let l = 1; l < i.length; l++) if (i[l].textContent && typeof i[l].textContent == "string") { const u = qt( i[l].textContent, t ), c = 100; let h = 3; for (; h < u.length && // keep consuming css identifiers (to get a decent chunk more quickly) (u[h].match(/[a-zA-Z0-9]/) || // substring needs to be unique to this section u.indexOf(u.substring(0, h), 1) !== -1); h++) ; for (; h < u.length; h++) { let p = u.substring(0, h), d = o.split(p), b = -1; if (d.length === 2) b = d[0].length; else if (d.length > 2 && d[0] === "" && i[l - 1].textContent !== "") b = o.indexOf(p, 1); else if (d.length === 1) { if (p = p.substring( 0, p.length - 1 ), d = o.split(p), d.length <= 1) return r.push(s), r; h = c + 1; } else h === u.length - 1 && (b = o.indexOf(p)); if (d.length >= 2 && h > c) { const m = i[l - 1].textContent; if (m && typeof m == "string") { const f = qt(m).length; b = o.indexOf(p, f); } b === -1 && (b = d[0].length); } if (b !== -1) { let m = Math.floor(b / a); for (; m > 0 && m < s.length; ) { if (n += 1, n > 50 * i.length) return r.push(s), r; const f = qt( s.substring(0, m), t ); if (f.length === b) { r.push(s.substring(0, m)), s = s.substring(m), o = o.substring(b); break; } else f.length < b ? m += Math.max( 1, Math.floor((b - f.length) / a) ) : m -= Math.max( 1, Math.floor((f.length - b) * a) ); } break; } } } } return r.push(s), r; } function vc(s, e) { return kc(s, e).join("/* rr_split */"); } function ar(s) { return s = s.replace(/[^ -~]+/g, ""), s = (s == null ? void 0 : s.split(" ").map((e) => e ? Math.random().toString(20).substring(2, e.length + 2) : "").join(" ")) || "", s; } function Is(s) { return s === "img" || s === "video" || s === "audio" || s === "source"; } const Yc = new RegExp( /[a-zA-Z0-9.!#$%&'*+=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*/ ), Nc = new RegExp(/[0-9]{9,16}/), Tc = new RegExp(/[0-9]{3}-?[0-9]{2}-?[0-9]{4}/), Uc = new RegExp( /[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}/ ), Kc = new RegExp(/[0-9]{4}-?[0-9]{4}-?[0-9]{4}-?[0-9]{4}/), Fc = new RegExp( /[0-9]{1,5}.?[0-9]{0,3}\s[a-zA-Z]{2,30}\s[a-zA-Z]{2,15}/ ), Mc = new RegExp(/(?:[0-9]{1,3}.){3}[0-9]{1,3}/), zc = [ Yc, Nc, Tc, Uc, Kc, Fc, Mc ]; function Zl(s) { return s ? zc.some((e) => e.test(s)) : !1; } const yl = ({ maskInputOptions: s, tagName: e, type: t, overwriteRecord: i }) => { const r = t && t.toLowerCase(); return i !== "true" && (!!s[e.toLowerCase()] || !!(r && s[r])); }; let Hc = 1; const Oc = new RegExp("[^a-z0-9-_:]"), vt = -2; function gl() { return Hc++; } function Pc(s) { if (s instanceof HTMLFormElement) return "form"; const e = ct(s.tagName); return Oc.test(e) ? "div" : e; } let st, $r; const Ec = /^[^ \t\n\r\u000c]+/, Bc = /^[, \t\n\r\u000c]+/; function Qc(s, e) { if (e.trim() === "") return e; let t = 0; function i(n) { let o; const a = n.exec(e.substring(t)); return a ? (o = a[0], t += o.length, o) : ""; } const r = []; for (; i(Bc), !(t >= e.length); ) { let n = i(Ec); if (n.slice(-1) === ",") n = lt(s, n.substring(0, n.length - 1)), r.push(n); else { let o = ""; n = lt(s, n); let a = !1; for (; ; ) { const l = e.charAt(t); if (l === "") { r.push((n + o).trim()); break; } else if (a) l === ")" && (a = !1); else if (l === ",") { t += 1, r.push((n + o).trim()); break; } else l === "(" && (a = !0); o += l, t += 1; } } } return r.join(", "); } const qr = /* @__PURE__ */ new WeakMap(); function lt(s, e) { return !e || e.trim() === "" ? e : cr(s, e); } function Dc(s) { return !!(s.tagName === "svg" || s.ownerSVGElement); } function cr(s, e) { let t = qr.get(s); if (t || (t = s.createElement("a"), qr.set(s, t)), !e) e = ""; else if (e.startsWith("blob:") || e.startsWith("data:")) return e; return t.setAttribute("href", e), t.href; } function Xl(s, e, t, i) { return i && (t === "src" || t === "href" && !(e === "use" && i[0] === "#") || t === "xlink:href" && i[0] !== "#" || t === "background" && (e === "table" || e === "td" || e === "th") ? lt(s, i) : t === "srcset" ? Qc(s, i) : t === "style" ? xi(i, cr(s)) : e === "object" && t === "data" ? lt(s, i) : i); } function Gl(s, e, t) { return (s === "video" || s === "audio") && e === "autoplay"; } function en(s, e, t) { try { if (typeof e == "string") { if (s.classList.contains(e)) return !0; } else for (let i = s.classList.length; i--; ) { const r = s.classList[i]; if (e.test(r)) return !0; } if (t) return s.matches(t); } catch (i) { } return !1; } function Li(s, e, t) { if (!s) return !1; if (s.nodeType !== s.ELEMENT_NODE) return t ? Li(le.parentNode(s), e, t) : !1; for (let i = s.classList.length; i--; ) { const r = s.classList[i]; if (e.test(r)) return !0; } return t ? Li(le.parentNode(s), e, t) : !1; } function Sl(s, e, t, i) { let r; if (pl(s)) { if (r = s, !le.childNodes(r).length) return !1; } else { if (le.parentElement(s) === null) return !1; r = le.parentElement(s); } try { if (typeof e == "string") { if (i) { if (r.closest(`.${e}`)) return !0; } else if (r.classList.contains(e)) return !0; } else if (Li(r, e, i)) return !0; if (t) { if (i) { if (r.closest(t)) return !0; } else if (r.matches(t)) return !0; } } catch (n) { } return !1; } function jc(s, e, t) { const i = s.contentWindow; if (!i) return; let r = !1, n; try { n = i.document.readyState; } catch (a) { return; } if (n !== "complete") { const a = setTimeout(() => { r || (e(), r = !0); }, t); s.addEventListener("load", () => { clearTimeout(a), r = !0, e(); }); return; } const o = "about:blank"; if (i.location.href !== o || s.src === o || s.src === "") return setTimeout(e, 0), s.addEventListener("load", e); s.addEventListener("load", e); } function Ac(s, e, t) { let i = !1, r; try { r = s.sheet; } catch (o) { return; } if (r) return; const n = setTimeout(() => { i || (e(), i = !0); }, t); s.addEventListener("load", () => { clearTimeout(n), i = !0, e(); }); } function _c(s, e) { const { doc: t, mirror: i, blockClass: r, blockSelector: n, needsMask: o, inlineStylesheet: a, maskInputOptions: l = {}, maskTextClass: u, maskTextFn: c, maskInputFn: h, dataURLOptions: p = {}, inlineImages: d, inlineVideos: b, recordCanvas: m, keepIframeSrcFn: f, newlyAddedElement: V = !1, cssCaptured: G = !1, privacySetting: g } = e, S = $c(t, i); switch (s.nodeType) { case s.DOCUMENT_NODE: return s.compatMode !== "CSS1Compat" ? { type: ie.Document, childNodes: [], compatMode: s.compatMode // probably "BackCompat" } : { type: ie.Document, childNodes: [] }; case s.DOCUMENT_TYPE_NODE: return { type: ie.DocumentType, name: s.name, publicId: s.publicId, systemId: s.systemId, rootId: S }; case s.ELEMENT_NODE: return eu(s, { doc: t, blockClass: r, blockSelector: n, inlineStylesheet: a, maskInputOptions: l, maskInputFn: h, maskTextClass: u, dataURLOptions: p, inlineImages: d, inlineVideos: b, recordCanvas: m, keepIframeSrcFn: f, newlyAddedElement: V, privacySetting: g, rootId: S }); case s.TEXT_NODE: return qc(s, { doc: t, needsMask: o, maskTextFn: c, privacySetting: g, rootId: S, cssCaptured: G }); case s.CDATA_SECTION_NODE: return { type: ie.CDATA, textContent: "", rootId: S }; case s.COMMENT_NODE: return { type: ie.Comment, textContent: le.textContent(s) || "", rootId: S }; default: return !1; } } function $c(s, e) { if (!e.hasNode(s)) return; const t = e.getId(s); return t === 1 ? void 0 : t; } function qc(s, e) { var t; const { needsMask: i, maskTextFn: r, privacySetting: n, rootId: o, cssCaptured: a } = e, l = le.parentNode(s), u = l && l.tagName; let c = ""; const h = u === "STYLE" ? !0 : void 0, p = u === "SCRIPT" ? !0 : void 0; p ? c = "SCRIPT_PLACEHOLDER" : a || (c = le.textContent(s), h && c && (c = xi(c, cr(e.doc)))), !h && !p && c && i && (c = r ? r(c, le.parentElement(s)) : c.replace(/[\S]/g, "*")); const d = n === "strict", b = (t = s.parentElement) == null ? void 0 : t.getAttribute("data-hl-record"), m = n === "default" && Zl(c); return (d || m) && !b && u && !(/* @__PURE__ */ new Set([ "HEAD", "TITLE", "STYLE", "SCRIPT", "HTML", "BODY", "NOSCRIPT" ])).has(u) && c && (c = ar(c)), { type: ie.Text, textContent: c || "", rootId: o }; } function eu(s, e) { const { doc: t, blockClass: i, blockSelector: r, inlineStylesheet: n, maskInputOptions: o = {}, maskInputFn: a, maskTextClass: l, dataURLOptions: u = {}, inlineImages: c, inlineVideos: h, recordCanvas: p, keepIframeSrcFn: d, newlyAddedElement: b = !1, privacySetting: m, rootId: f } = e; let V = en(s, i, r); const G = en(s, l, null), g = m === "strict"; let S = Pc(s), y = {}; const W = s.attributes.length; for (let Z = 0; Z < W; Z++) { const I = s.attributes[Z]; Gl(S, I.name) || (y[I.name] = Xl( t, S, ct(I.name), I.value )); } if (S === "link" && n) { const Z = Array.from(t.styleSheets).find((Y) => Y.href === s.href); let I = null; Z && (I = Ss(Z)), I && (delete y.rel, delete y.href, y._cssText = I); } if (S === "style" && s.sheet) { let Z = Ss( s.sheet ); Z && (s.childNodes.length > 1 && (Z = vc(Z, s)), y._cssText = Z); } if (S === "input" || S === "textarea" || S === "select") { const Z = s.value, I = s.checked; y.type !== "radio" && y.type !== "checkbox" && y.type !== "submit" && y.type !== "button" && Z ? y.value = Ci({ element: s, type: wi(s), tagName: S, value: Z, overwriteRecord: s.getAttribute("data-hl-record"), maskInputOptions: o, maskInputFn: a }) : I && (y.checked = I); } if (S === "option" && (s.selected && !o.select ? y.selected = !0 : delete y.selected), S === "dialog" && s.open && (y.rr_open_mode = s.matches("dialog:modal") ? "modal" : "non-modal"), S === "canvas" && p) { if (s.__context === "2d") Wc(s); else if (!("__context" in s)) { const Z = s.toDataURL( u.type, u.quality ), I = t.createElement("canvas"); I.width = s.width, I.height = s.height; const Y = I.toDataURL( u.type, u.quality ); Z !== Y && (y.rr_dataURL = Z); } } if (S === "img" && c && !V && !G && !g) { st || (st = t.createElement("canvas"), $r = st.getContext("2d")); const Z = s, I = Z.currentSrc || Z.getAttribute("src") || "<unknown-src>", Y = Z.crossOrigin, v = () => { Z.removeEventListener("load", v); try { st.width = Z.naturalWidth, st.height = Z.naturalHeight, $r.drawImage(Z, 0, 0), y.rr_dataURL = st.toDataURL( u.type, u.quality ); } catch (Q) { if (Z.crossOrigin !== "anonymous") { Z.crossOrigin = "anonymous", Z.complete && Z.naturalWidth !== 0 ? v() : Z.addEventListener("load", v); return; } else console.warn( `Cannot inline img src=${I}! Error: ${Q}` ); } Z.crossOrigin === "anonymous" && (Y ? y.crossOrigin = Y : Z.removeAttribute("crossorigin")); }; Z.complete && Z.naturalWidth !== 0 ? v() : Z.addEventListener("load", v); } if (S === "audio" || S === "video") { const Z = y; Z.rr_mediaState = s.paused ? "paused" : "played", Z.rr_mediaCurrentTime = s.currentTime, Z.rr_mediaPlaybackRate = s.playbackRate, Z.rr_mediaMuted = s.muted, Z.rr_mediaLoop = s.loop, Z.rr_mediaVolume = s.volume; } if (b || (s.scrollLeft && (y.rr_scrollLeft = s.scrollLeft), s.scrollTop && (y.rr_scrollTop = s.scrollTop)), V || G || g && Is(S)) { const { width: Z, height: I } = s.getBoundingClientRect(); y = { class: y.class, rr_width: `${Z}px`, rr_height: `${I}px` }; } g && Is(S) && (V = !0), S === "iframe" && !d(y.src) && (s.contentDocument || (y.rr_src = y.src), delete y.src); let C; try { customElements.get(S) && (C = !0); } catch (Z) { } const R = (Z) => { const { width: I, height: Y } = Z.getBoundingClientRect(); y = { width: I, height: Y, rr_width: `${I}px`, rr_height: `${Y}px`, rr_inlined_video: !0, class: y.class, style: y.style }, S = "canvas"; const v = t.createElement("canvas"); v.width = s.width, v.height = s.height, y.rr_dataURL = v.toDataURL( u.type, u.quality ); }; if (S === "video") { const Z = s; c && (Z.src === "" || Z.src.indexOf("blob:") !== -1) && R(Z), h && Z.src !== "" && Z.src.indexOf("blob:") === -1 && R(Z); } return { type: ie.Element, tagName: S, attributes: y, childNodes: [], isSVG: Dc(s) || void 0, needBlock: V, needMask: G, rootId: f, isCustom: C }; } function B(s) { return s == null ? "" : s.toLowerCase(); } function tu(s, e) { if (e.comment && s.type === ie.Comment) return !0; if (s.type === ie.Element) { if (e.script && // script tag (s.tagName === "script" || // (module)preload link s.tagName === "link" && (s.attributes.rel === "preload" && s.attributes.as === "script" || s.attributes.rel === "modulepreload") || // prefetch link s.tagName === "link" && s.attributes.rel === "prefetch" && typeof s.attributes.href == "string" && bl(s.attributes.href) === "js")) return !0; if (e.headFavicon && (s.tagName === "link" && s.attributes.rel === "shortcut icon" || s.tagName === "meta" && (B(s.attributes.name).match( /^msapplication-tile(image|color)$/ ) || B(s.attributes.name) === "application-name" || B(s.attributes.rel) === "icon" || B(s.attributes.rel) === "apple-touch-icon" || B(s.attributes.rel) === "shortcut icon"))) return !0; if (s.tagName === "meta") { if (e.headMetaDescKeywords && B(s.attributes.name).match(/^description|keywords$/)) return !0; if (e.headMetaSocial && (B(s.attributes.property).match(/^(og|twitter|fb):/) || // og = opengraph (facebook) B(s.attributes.name).match(/^(og|twitter):/) || B(s.attributes.name) === "pinterest")) return !0; if (e.headMetaRobots && (B(s.attributes.name) === "robots" || B(s.attributes.name) === "googlebot" || B(s.attributes.name) === "bingbot")) return !0; if (e.headMetaHttpEquiv && s.attributes["http-equiv"] !== void 0) return !0; if (e.headMetaAuthorship && (B(s.attributes.name) === "author" || B(s.attributes.name) === "generator" || B(s.attributes.name) === "framework" || B(s.attributes.name) === "publisher" || B(s.attributes.name) === "progid" || B(s.attributes.property).match(/^article:/) || B(s.attributes.property).match(/^product:/))) return !0; if (e.headMetaVerification && (B(s.attributes.name) === "google-site-verification" || B(s.attributes.name) === "yandex-verification" || B(s.attributes.name) === "csrf-token" || B(s.attributes.name) === "p:domain_verify" || B(s.attributes.name) === "verify-v1" || B(s.attributes.name) === "verification" || B(s.attributes.name) === "shopify-checkout-api-token")) return !0; } } return !1; } function ot(s, e) { const { doc: t, mirror: i, blockClass: r, blockSelector: n, maskTextClass: o, maskTextSelector: a, skipChild: l = !1, inlineStylesheet: u = !0, maskInputOptions: c = {}, maskTextFn: h, maskInputFn: p, slimDOMOptions: d, dataURLOptions: b = {}, inlineImages: m = !1, inlineVideos: f = !1, recordCanvas: V = !1, onSerialize: G, onIframeLoad: g, iframeLoadTimeout: S = 5e3, onStylesheetLoad: y, stylesheetLoadTimeout: W = 5e3, keepIframeSrcFn: C = () => !1, newlyAddedElement: R = !1, cssCaptured: Z = !1, privacySetting: I } = e; let { needsMask: Y } = e, { preserveWhiteSpace: v = !0 } = e; Y || (Y = Sl( s, o, a, Y === void 0 )); const Q = _c(s, { doc: t, mirror: i, blockClass: r, blockSelector: n, needsMask: Y, inlineStylesheet: u, maskInputOptions: c, maskTextClass: o, maskTextFn: h, maskInputFn: p, dataURLOptions: b, inlineImages: m, inlineVideos: f, recordCanvas: V, keepIframeSrcFn: C, newlyAddedElement: R, cssCaptured: Z, privacySetting: I }); if (!Q) return console.warn(s, "not serialized"), null; let A; i.hasNode(s) ? A = i.getId(s) : tu(Q, d) || !v && Q.type === ie.Text && !Q.textContent.replace(/^\s+|\s+$/gm, "").length ? A = vt : A = gl(); const w = Object.assign(Q, { id: A }); if (i.add(s, w), A === vt) return null; G && G(s); let te = !l, H = I, D = I === "strict"; if (w.type === ie.Element) { if (te = te && !w.needBlock, D || (D = !!w.needBlock || !!w.needMask), H = D ? "strict" : H, D && Is(w.tagName)) { const O = s.cloneNode(); O.src = "", i.add(O, w); } delete w.needBlock, delete w.needMask; const E = le.shadowRoot(s); E && xt(E) && (w.isShadowHost = !0); } if ((w.type === ie.Document || w.type === ie.Element) && te) { d.headWhitespace && w.type === ie.Element && w.tagName === "head" && (v = !1); const E = { doc: t, mirror: i, blockClass: r, blockSelector: n, needsMask: Y, maskTextClass: o, maskTextSelector: a, skipChild: l, inlineStylesheet: u, maskInputOptions: c, maskTextFn: h, maskInputFn: p, slimDOMOptions: d, dataURLOptions: b, inlineImages: m, inlineVideos: f, recordCanvas: V, preserveWhiteSpace: v, onSerialize: G, onIframeLoad: g, iframeLoadTimeout: S, onStylesheetLoad: y, stylesheetLoadTimeout: W, keepIframeSrcFn: C, cssCaptured: !1, privacySetting: H }; if (!(w.type === ie.Element && w.tagName === "textarea" && w.attributes.value !== void 0)) { w.type === ie.Element && w.attributes._cssText !== void 0 && typeof w.attributes._cssText == "string" && (E.cssCaptured = !0); for (const pe of Array.from(le.childNodes(s))) { const ae = ot(pe, E); ae && w.childNodes.push(ae); } } let O = null; if (pl(s) && (O = le.shadowRoot(s))) for (const pe of Array.from(le.childNodes(O))) { const ae = ot(pe, E); ae && (xt(O) && (ae.isShadow = !0), w.childNodes.push(ae)); } } const ee = le.parentNode(s); return ee && wt(ee) && xt(ee) && (w.isShadow = !0), w.type === ie.Element && w.tagName === "iframe" && jc( s, () => { const E = s.contentDocument; if (E && g) { const O = ot(E, { doc: E, mirror: i, blockClass: r, blockSelector: n, needsMask: Y, maskTextClass: o, maskTextSelector: a, skipChild: !1, inlineStylesheet: u, maskInputOptions: c, maskTextFn: h, maskInputFn: p, slimDOMOptions: d, dataURLOptions: b, inlineImages: m, inlineVideos: f, recordCanvas: V, preserveWhiteSpace: v, onSerialize: G, onIframeLoad: g, iframeLoadTimeout: S, onStylesheetLoad: y, stylesheetLoadTimeout: W, keepIframeSrcFn: C, privacySetting: I }); O && g( s, O ); } }, S ), w.type === ie.Element && w.tagName === "link" && typeof w.attributes.rel == "string" && (w.attributes.rel === "stylesheet" || w.attributes.rel === "preload" && typeof w.attributes.href == "string" && bl(w.attributes.href) === "css") && Ac( s, () => { if (y) { const E = ot(s, { doc: t, mirror: i, blockClass: r, blockSelector: n, needsMask: Y, maskTextClass: o, maskTextSelector: a, skipChild: !1, inlineStylesheet: u, maskInputOptions: c, maskTextFn: h, maskInputFn: p, slimDOMOptions: d, dataURLOptions: b, inlineImages: m, inlineVideos: f, recordCanvas: V, preserveWhiteSpace: v, onSerialize: G, onIframeLoad: g, iframeLoadTimeout: S, onStylesheetLoad: y, stylesheetLoadTimeout: W, keepIframeSrcFn: C, privacySetting: I }); E && y( s, E ); } }, W ), w; } function iu(s, e) { const { mirror: t = new fl(), blockClass: i = "highlight-block", blockSelector: r = null, maskTextClass: n = "highlight-mask", maskTextSelector: o = null, inlineStylesheet: a = !0, inlineImages: l = !1, inlineVideos: u = !1, recordCanvas: c = !1, maskAllInputs: h = !1, maskTextFn: p, maskInputFn: d, slimDOM: b = !1, dataURLOptions: m, preserveWhiteSpace: f, onSerialize: V, onIframeLoad: G, iframeLoadTimeout: g, onStylesheetLoad: S, stylesheetLoadTimeout: y, keepIframeSrcFn: W = () => !1, privacySetting: C = "default" } = e || {}; return ot(s, { doc: s, mirror: t, blockClass: i, blockSelector: r, maskTextClass: n, maskTextSelector: o, skipChild: !1, inlineStylesheet: a, maskInputOptions: h === !0 ? { color: !0, date: !0, "datetime-local": !0, email: !0, month: !0, number: !0, range: !0, search: !0, tel: !0, text: !0, time: !0, url: !0, week: !0, textarea: !0, select: !0, password: !0 } : h === !1 ? { password: !0 } : h, maskTextFn: p, maskInputFn: d, slimDOMOptions: b || b === "all" ? ( // if true: set of sensible options that should not throw away any information { script: !0, comment: !0, headFavicon: !0, headWhitespace: !0, headMetaDescKeywords: b === "all", // destructive headMetaSocial: !0, headMetaRobots: !0, headMetaHttpEquiv: !0, headMetaAuthorship: !0, headMetaVerification: !0 } ) : b || {}, dataURLOptions: m, inlineImages: l, inlineVideos: u, recordCanvas: c, preserveWhiteSpace: f, onSerialize: V, onIframeLoad: G, iframeLoadTimeout: g, onStylesheetLoad: S, stylesheetLoadTimeout: y, keepIframeSrcFn: W, newlyAddedElement: !1, privacySetting: C }); } function su(s) { if (s.__esModule) return s; var e = s.default; if (typeof e == "function") { var t = function i() { return this instanceof i ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments); }; t.prototype = e.prototype; } else t = {}; return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(s).forEach(function(i) { var r = Object.getOwnPropertyDescriptor(s, i); Object.defineProperty(t, i, r.get ? r : { enumerable: !0, get: function() { return s[i]; } }); }), t; } var ur = { exports: {} }, J = String, Il = function() { return { isColorSupported: !1, reset: J, bold: J, dim: J, italic: J, underline: J, inverse: J, hidden: J, strikethrough: J, black: J, red: J, green: J, yellow: J, blue: J, magenta: J, cyan: J, white: J, gray: J, bgBlack: J, bgRed: J, bgGreen: J, bgYellow: J, bgBlue: J, bgMagenta: J, bgCyan: J, bgWhite: J, blackBright: J, redBright: J, greenBright: J, yellowBright: J, blueBright: J, magentaBright: J, cyanBright: J, whiteBright: J, bgBlackBright: J, bgRedBright: J, bgGreenBright: J, bgYellowBright: J, bgBlueBright: J, bgMagentaBright: J, bgCyanBright: J, bgWhiteBright: J }; }; ur.exports = Il(); ur.exports.createColors = Il; var ru = ur.exports; const nu = {}, lu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: nu }, Symbol.toStringTag, { value: "Module" })), Ge = /* @__PURE__ */ su(lu); let tn = ru, sn = Ge, Vs = class Vl extends Error { constructor(e, t, i, r, n, o) { super(e), this.name = "CssSyntaxError", this.reason = e, n && (this.file = n), r && (this.source = r), o && (this.plugin = o), typeof t != "undefined" && typeof i != "undefined" && (typeof t == "number" ? (this.line = t, this.column = i) : (this.line = t.line, this.column = t.column, this.endLine = i.line, this.endColumn = i.column)), this.setMessage(), Error.captureStackTrace && Error.captureStackTrace(this, Vl); } setMessage() { this.message = this.plugin ? this.plugin + ": " : "", this.message += this.file ? this.file : "<css input>", typeof this.line != "undefined" && (this.message += ":" + this.line + ":" + this.column), this.message += ": " + this.reason; } showSourceCode(e) { if (!this.source) return ""; let t = this.source; e == null && (e = tn.isColorSupported); let i = (c) => c, r = (c) => c, n = (c) => c; if (e) { let { bold: c, gray: h, red: p } = tn.createColors(!0); r = (d) => c(p(d)), i = (d) => h(d), sn && (n = (d) => sn(d)); } let o = t.split(/\r?\n/), a = Math.max(this.line - 3, 0), l = Math.min(this.line + 2, o.length), u = String(l).length; return o.slice(a, l).map((c, h) => { let p = a + 1 + h, d = " " + (" " + p).slice(-u) + " | "; if (p === this.line) { if (c.length > 160) { let m = 20, f = Math.max(0, this.column - m), V = Math.max( this.column + m, this.endColumn + m ), G = c.slice(f, V), g = i(d.replace(/\d/g, " ")) + c.slice(0, Math.min(this.column - 1, m - 1)).replace(/[^\t]/g, " "); return r(">") + i(d) + n(G) + ` ` + g + r("^"); } let b = i(d.replace(/\d/g, " ")) + c.slice(0, this.column - 1).replace(/[^\t]/g, " "); return r(">") + i(d) + n(c) + ` ` + b + r("^"); } return " " + i(d) + n(c); }).join(` `); } toString() { let e = this.showSourceCode(); return e && (e = ` ` + e + ` `), this.name + ": " + this.message + e; } }; var hr = Vs; Vs.default = Vs; const rn = { after: ` `, beforeClose: ` `, beforeComment: ` `, beforeDecl: ` `, beforeOpen: " ", beforeRule: ` `, colon: ": ", commentLeft: " ", commentRight: " ", emptyBody: "", indent: " ", semicolon: !1 }; function ou(s) { return s[0].toUpperCase() + s.slice(1); } let Rs = class { constructor(e) { this.builder = e; } atrule(e, t) { let i = "@" + e.name, r = e.params ? this.rawValue(e, "params") : ""; if (typeof e.raws.afterName != "undefined" ? i += e.raws.afterName : r && (i += " "), e.nodes) this.block(e, i + r); else { let n = (e.raws.between || "") + (t ? ";" : ""); this.builder(i + r + n, e); } } beforeAfter(e, t) { let i; e.type === "decl" ? i = this.raw(e, null, "beforeDecl") : e.type === "comment" ? i = this.raw(e, null, "beforeComment") : t === "before" ? i = this.raw(e, null, "beforeRule") : i = this.raw(e, null, "beforeClose"); let r = e.parent, n = 0; for (; r && r.type !== "root"; ) n += 1, r = r.parent; if (i.includes(` `)) { let o = this.raw(e, null, "indent"); if (o.length) for (let a = 0; a < n; a++) i += o; } return i; } block(e, t) { let i = this.raw(e, "between", "beforeOpen"); this.builder(t + i + "{", e, "start"); let r; e.nodes && e.nodes.length ? (this.body(e), r = this.raw(e, "after")) : r = this.raw(e, "after", "emptyBody"), r && this.builder(r), this.builder("}", e, "end"); } body(e) { let t = e.nodes.length - 1; for (; t > 0 && e.nodes[t].type === "comment"; ) t -= 1; let i = this.raw(e, "semicolon"); for (let r = 0; r < e.nodes.length; r++) { let n = e.nodes[r], o = this.raw(n, "before"); o && this.builder(o), this.stringify(n, t !== r || i); } } comment(e) { let t = this.raw(e, "left", "commentLeft"), i = this.raw(e, "right", "commentRight"); this.builder("/*" + t + e.text + i + "*/", e); } decl(e, t) { let i = this.raw(e, "between", "colon"), r = e.prop + i + this.rawValue(e, "value"); e.important && (r += e.raws.important || " !important"), t && (r += ";"), this.builder(r, e); } document(e) { this.body(e); } raw(e, t, i) { let r; if (i || (i = t), t && (r = e.raws[t], typeof r != "undefined")) return r; let n = e.parent; if (i === "before" && (!n || n.type === "root" && n.first === e || n && n.type === "document")) return ""; if (!n) return rn[i]; let o = e.root(); if (o.rawCache || (o.rawCache = {}), typeof o.rawCache[i] != "undefined") return o.rawCache[i]; if (i === "before" || i === "after") return this.beforeAfter(e, i); { let a = "raw" + ou(i); this[a] ? r = this[a](o, e) : o.walk((l) => { if (r = l.raws[t], typeof r != "undefined") return !1; }); } return typeof r == "undefined" && (r = rn[i]), o.rawCache[i] = r, r; } rawBeforeClose(e) { let t; return e.walk((i) => { if (i.nodes && i.nodes.length > 0 && typeof i.raws.after != "undefined") return t = i.raws.after, t.includes(` `) && (t = t.replace(/[^\n]+$/, "")), !1; }), t && (t = t.replace(/\S/g, "")), t; } rawBeforeComment(e, t) { let i; return e.walkComments((r) => { if (typeof r.raws.before != "undefined") return i = r.raws.before, i.includes(` `) && (i = i.replace(/[^\n]+$/, "")), !1; }), typeof i == "undefined" ? i = this.raw(t, null, "beforeDecl") : i && (i = i.replace(/\S/g, "")), i; } rawBeforeDecl(e, t) { let i; return e.walkDecls((r) => { if (typeof r.raws.before != "undefined") return i = r.raws.before, i.includes(` `) && (i = i.replace(/[^\n]+$/, "")), !1; }), typeof i == "undefined" ? i = this.raw(t, null, "beforeRule") : i && (i = i.replace(/\S/g, "")), i; } rawBeforeOpen(e) { let t; return e.walk((i) => { if (i.type !== "decl" && (t = i.raws.between, typeof t != "undefined")) return !1; }), t; } rawBeforeRule(e) { let t; return e.walk((i) => { if (i.nodes && (i.parent !== e || e.first !== i) && typeof i.raws.before != "undefined") return t = i.raws.before, t.includes(` `) && (t = t.replace(/[^\n]+$/, "")), !1; }), t && (t = t.replace(/\S/g, "")), t; } rawColon(e) { let t; return e.walkDecls((i) => { if (typeof i.raws.between != "undefined") return t = i.raws.between.replace(/[^\s:]/g, ""), !1; }), t; } rawEmptyBody(e) { let t; return e.walk((i) => { if (i.nodes && i.nodes.length === 0 && (t = i.raws.after, typeof t != "undefined")) return !1; }), t; } rawIndent(e) { if (e.raws.indent) return e.raws.indent; let t; return e.walk((i) => { let r = i.parent; if (r && r !== e && r.parent && r.parent === e && typeof i.raws.before != "undefined") { let n = i.raws.before.split(` `); return t = n[n.length - 1], t = t.replace(/\S/g, ""), !1; } }), t; } rawSemicolon(e) { let t; return e.walk((i) => { if (i.nodes && i.nodes.length && i.last.type === "decl" && (t = i.raws.semicolon, typeof t != "undefined")) return !1; }), t; } rawValue(e, t) { let i = e[t], r = e.raws[t]; return r && r.value === i ? r.raw : i; } root(e) { this.body(e), e.raws.after && this.builder(e.raws.after); } rule(e) { this.block(e, this.rawValue(e, "selector")), e.raws.ownSemicolon && this.builder(e.raws.ownSemicolon, e, "end"); } stringify(e, t) { if (!this[e.type]) throw new Error( "Unknown AST node type " + e.type + ". Maybe you need to change PostCSS stringifier." ); this[e.type](e, t); } }; var Rl = Rs; Rs.default = Rs; let au = Rl; function Ws(s, e) { new au(e).stringify(s); } var Oi = Ws; Ws.default = Ws; var Pt = {}; Pt.isClean = Symbol("isClean"); Pt.my = Symbol("my"); let cu = hr, uu = Rl, hu = Oi, { isClean: Xt, my: du } = Pt; function Cs(s, e) { let t = new s.constructor(); for (let i in s) { if (!Object.prototype.hasOwnProperty.call(s, i) || i === "proxyCache") continue; let r = s[i], n = typeof r; i === "parent" && n === "object" ? e && (t[i] = e) : i === "source" ? t[i] = r : Array.isArray(r) ? t[i] = r.map((o) => Cs(o, t)) : (n === "object" && r !== null && (r = Cs(r)), t[i] = r); } return t; } function Le(s, e) { if (e && typeof e.offset != "undefined") return e.offset; let t = 1, i = 1, r = 0; for (let n = 0; n < s.length; n++) { if (i === e.line && t === e.column) { r = n; break; } s[n] === ` ` ? (t = 1, i += 1) : t += 1; } return r; } let ws = class { get proxyOf() { return this; } constructor(e = {}) { this.raws = {}, this[Xt] = !1, this[du] = !0; for (let t in e) if (t === "nodes") { this.nodes = []; for (let i of e[t]) typeof i.clone == "function" ? this.append(i.clone()) : this.append(i); } else this[t] = e[t]; } addToError(e) { if (e.postcssNode = this, e.stack && this.source && /\n\s{4}at /.test(e.stack)) { let t = this.source; e.stack = e.stack.replace( /\n\s{4}at /, `$&${t.input.from}:${t.start.line}:${t.start.column}$&` ); } return e; } after(e) { return this.parent.insertAfter(this, e), this; } assign(e = {}) { for (let t in e) this[t] = e[t]; return this; } before(e) { return this.parent.insertBefore(this, e), this; } cleanRaws(e) { delete this.raws.before, delete this.raws.after, e || delete this.raws.between; } clone(e = {}) { let t = Cs(this); for (let i in e) t[i] = e[i]; return t; } cloneAfter(e = {}) { let t = this.clone(e); return this.parent.insertAfter(this, t), t; } cloneBefore(e = {}) { let t = this.clone(e); return this.parent.insertBefore(this, t), t; } error(e, t = {}) { if (this.source) { let { end: i, start: r } = this.rangeBy(t); return this.source.input.error( e, { column: r.column, line: r.line }, { column: i.column, line: i.line }, t ); } return new cu(e); } getProxyProcessor() { return { get(e, t) { return t === "proxyOf" ? e : t === "root" ? () => e.root().toProxy() : e[t]; }, set(e, t, i) { return e[t] === i || (e[t] = i, (t === "prop" || t === "value" || t === "name" || t === "params" || t === "important" || /* c8 ignore next */ t === "text") && e.markDirty()), !0; } }; } /* c8 ignore next 3 */ markClean() { this[Xt] = !0; } markDirty() { if (this[Xt]) { this[Xt] = !1; let e = this; for (; e = e.parent; ) e[Xt] = !1; } } next() { if (!this.parent) return; let e = this.parent.index(this); return this.parent.nodes[e + 1]; } positionBy(e = {}) { let t = this.source.start; if (e.index) t = this.positionInside(e.index); else if (e.word) { let i = "document" in this.source.input ? this.source.input.document : this.source.input.css, n = i.slice( Le(i, this.source.start), Le(i, this.source.end) ).indexOf(e.word); n !== -1 && (t = this.positionInside(n)); } return t; } positionInside(e) { let t = this.source.start.column, i = this.source.start.line, r = "document" in this.source.input ? this.source.input.document : this.source.input.css, n = Le(r, this.source.start), o = n + e; for (let a = n; a < o; a++) r[a] === ` ` ? (t = 1, i += 1) : t += 1; return { column: t, line: i, offset: o }; } prev() { if (!this.parent) return; l