seo-crawl-audit 0.17.0 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundle/cli.js CHANGED
@@ -1,52 +1,55 @@
1
- import{createHash as Ao}from"node:crypto";var po="https://github.com/MelnixDev/seo-crawl-audit/blob/main/docs/rules.md",ho=[{id:"page-unreachable",severity:"error",owner:"developer",scope:"page",remediation:"Restore the page or remove references to it."},{id:"http-error",severity:"error",owner:"developer",scope:"page",remediation:"Return a successful response or a deliberate redirect."},{id:"noindex",severity:"info",owner:"seo",scope:"page",remediation:"Remove noindex when the page should appear in search."},{id:"x-robots-noindex",severity:"error",owner:"developer",scope:"page",remediation:"Remove the noindex X-Robots-Tag when indexing is intended."},{id:"robots-blocked",severity:"error",owner:"developer",scope:"page",remediation:"Allow the URL in robots.txt when it should be crawled."},{id:"missing-canonical",severity:"warning",owner:"seo",scope:"page",remediation:"Declare the preferred canonical URL when duplicate URL variants are possible."},{id:"invalid-canonical",severity:"error",owner:"developer",scope:"page",remediation:"Use an absolute or valid relative HTTP(S) canonical URL."},{id:"cross-domain-canonical",severity:"error",owner:"seo",scope:"page",remediation:"Confirm the external canonical or point it to the intended same-site URL."},{id:"canonical-target-error",severity:"error",owner:"developer",scope:"page",remediation:"Point the canonical to an accessible, indexable URL."},{id:"redirect-loop",severity:"error",owner:"developer",scope:"page",remediation:"Remove the circular redirect path."},{id:"long-redirect-chain",severity:"warning",owner:"developer",scope:"page",remediation:"Redirect directly to the final destination."},{id:"sitemap-unavailable",severity:"error",owner:"developer",scope:"site",remediation:"Restore a valid, reachable XML sitemap."},{id:"noindex-in-sitemap",severity:"error",owner:"seo",scope:"page",remediation:"Remove the URL from the sitemap or make it indexable."},{id:"redirect-in-sitemap",severity:"error",owner:"seo",scope:"page",remediation:"Replace the sitemap URL with its final canonical destination."},{id:"missing-title",severity:"error",owner:"content",scope:"page",remediation:"Add a unique, descriptive HTML title."},{id:"duplicate-title",severity:"warning",owner:"content",scope:"page",remediation:"Write a title that uniquely describes this page."},{id:"pagination-title-duplicate",severity:"error",owner:"developer",scope:"page",remediation:"Add a human-readable page number to pagination titles, preserve correct canonicals, and inspect indexing evidence in Search Console."},{id:"near-duplicate-title",severity:"warning",owner:"content",scope:"page",remediation:"Review similar titles and differentiate page intent; similarity alone does not prove indexing exclusion."},{id:"title-length",severity:"warning",owner:"content",scope:"page",remediation:"Keep the title concise and descriptive, usually 10\u201360 characters."},{id:"missing-description",severity:"warning",owner:"content",scope:"page",remediation:"Add a useful meta description."},{id:"duplicate-description",severity:"warning",owner:"content",scope:"page",remediation:"Write a unique meta description for this page."},{id:"description-length",severity:"warning",owner:"content",scope:"page",remediation:"Keep the description useful and usually between 50 and 160 characters."},{id:"missing-h1",severity:"warning",owner:"content",scope:"page",remediation:"Add one clear primary heading."},{id:"broken-internal-link",severity:"error",owner:"developer",scope:"page",remediation:"Update or remove the internal link, or restore its target."},{id:"orphan-sitemap-page",severity:"warning",owner:"seo",scope:"page",remediation:"Add meaningful internal links to the sitemap page."},{id:"crawlable-not-in-sitemap",severity:"warning",owner:"seo",scope:"page",remediation:"Add the indexable page to the sitemap or intentionally exclude it."},{id:"invalid-hreflang",severity:"warning",owner:"seo",scope:"page",remediation:"Use valid language tags and resolvable HTTP(S) alternate URLs."},{id:"malformed-json-ld",severity:"warning",owner:"developer",scope:"page",remediation:"Fix JSON syntax in the structured-data block."},{id:"http-on-https-site",severity:"warning",owner:"developer",scope:"page",remediation:"Use HTTPS for internal URLs and metadata references."},{id:"invalid-language",severity:"warning",owner:"developer",scope:"page",remediation:"Set a valid BCP 47 language tag on the html element."},{id:"duplicate-content",severity:"warning",owner:"content",scope:"page",remediation:"Consolidate duplicate pages or differentiate their main content."},{id:"multiple-h1",severity:"info",owner:"content",scope:"page",remediation:"Review whether one primary H1 would make the hierarchy clearer."},{id:"missing-open-graph",severity:"info",owner:"content",scope:"page",remediation:"Add Open Graph title, description, and image for social sharing."},{id:"missing-twitter-metadata",severity:"info",owner:"content",scope:"page",remediation:"Add Twitter card metadata when social previews matter."},{id:"image-missing-alt",severity:"info",owner:"content",scope:"page",remediation:"Add meaningful alt text, or an empty alt for decorative images."},{id:"low-word-count",severity:"info",owner:"content",scope:"page",remediation:"Review whether the page provides enough useful primary content."},{id:"robots-changed",severity:"warning",owner:"developer",scope:"site",remediation:"Review the robots.txt change and confirm that crawl access is intentional."},{id:"page-missing",severity:"error",owner:"developer",scope:"page",remediation:"Include the page in the scan or confirm that its removal is intentional."},{id:"status-regression",severity:"error",owner:"developer",scope:"page",remediation:"Restore the previous successful HTTP response."},{id:"new-noindex",severity:"error",owner:"seo",scope:"page",remediation:"Remove the newly introduced noindex unless it is intentional."},{id:"title-removed",severity:"error",owner:"content",scope:"page",remediation:"Restore a descriptive title."},{id:"title-changed",severity:"warning",owner:"content",scope:"page",remediation:"Review and approve the changed title."},{id:"description-removed",severity:"warning",owner:"content",scope:"page",remediation:"Restore a useful meta description."},{id:"canonical-removed",severity:"error",owner:"seo",scope:"page",remediation:"Restore the canonical declaration."},{id:"canonical-changed",severity:"warning",owner:"seo",scope:"page",remediation:"Confirm the new canonical target is deliberate and valid."},{id:"h1-removed",severity:"warning",owner:"content",scope:"page",remediation:"Restore a clear primary heading."},{id:"redirect-changed",severity:"warning",owner:"developer",scope:"page",remediation:"Confirm the new redirect destination is intentional."},{id:"sitemap-url-count-drop",severity:"error",owner:"seo",scope:"site",remediation:"Investigate the sitemap URL loss and restore omitted indexable pages."}],Zr=Object.freeze(ho.map(e=>Object.freeze({...e}))),go=new Map(Zr.map(e=>[e.id,e]));function Xr(e){return Array.isArray(e)?`[${e.map(Xr).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>`${t}:${Xr(r)}`).join(",")}}`:JSON.stringify(e)}function Vt(){return Zr}function As(e,t,r,n){return Ao("sha256").update(`${e}
1
+ import{createHash as fo}from"node:crypto";var Eo="https://github.com/MelnixDev/seo-crawl-audit/blob/main/docs/rules.md",To=[{id:"page-unreachable",severity:"error",owner:"developer",scope:"page",remediation:"Restore the page or remove references to it."},{id:"http-error",severity:"error",owner:"developer",scope:"page",remediation:"Return a successful response or a deliberate redirect."},{id:"noindex",severity:"info",owner:"seo",scope:"page",remediation:"Remove noindex when the page should appear in search."},{id:"x-robots-noindex",severity:"error",owner:"developer",scope:"page",remediation:"Remove the noindex X-Robots-Tag when indexing is intended."},{id:"robots-blocked",severity:"error",owner:"developer",scope:"page",remediation:"Allow the URL in robots.txt when it should be crawled."},{id:"missing-canonical",severity:"warning",owner:"seo",scope:"page",remediation:"Declare the preferred canonical URL when duplicate URL variants are possible."},{id:"invalid-canonical",severity:"error",owner:"developer",scope:"page",remediation:"Use an absolute or valid relative HTTP(S) canonical URL."},{id:"cross-domain-canonical",severity:"error",owner:"seo",scope:"page",remediation:"Confirm the external canonical or point it to the intended same-site URL."},{id:"canonical-target-error",severity:"error",owner:"developer",scope:"page",remediation:"Point the canonical to an accessible, indexable URL."},{id:"redirect-loop",severity:"error",owner:"developer",scope:"page",remediation:"Remove the circular redirect path."},{id:"long-redirect-chain",severity:"warning",owner:"developer",scope:"page",remediation:"Redirect directly to the final destination."},{id:"sitemap-unavailable",severity:"error",owner:"developer",scope:"site",remediation:"Restore a valid, reachable XML sitemap."},{id:"noindex-in-sitemap",severity:"error",owner:"seo",scope:"page",remediation:"Remove the URL from the sitemap or make it indexable."},{id:"redirect-in-sitemap",severity:"error",owner:"seo",scope:"page",remediation:"Replace the sitemap URL with its final canonical destination."},{id:"missing-title",severity:"error",owner:"content",scope:"page",remediation:"Add a unique, descriptive HTML title."},{id:"duplicate-title",severity:"warning",owner:"content",scope:"page",remediation:"Write a title that uniquely describes this page."},{id:"pagination-title-duplicate",severity:"error",owner:"developer",scope:"page",remediation:"Add a human-readable page number to pagination titles, preserve correct canonicals, and inspect indexing evidence in Search Console."},{id:"near-duplicate-title",severity:"warning",owner:"content",scope:"page",remediation:"Review similar titles and differentiate page intent; similarity alone does not prove indexing exclusion."},{id:"title-length",severity:"warning",owner:"content",scope:"page",remediation:"Keep the title concise and descriptive, usually 10\u201360 characters."},{id:"missing-description",severity:"warning",owner:"content",scope:"page",remediation:"Add a useful meta description."},{id:"duplicate-description",severity:"warning",owner:"content",scope:"page",remediation:"Write a unique meta description for this page."},{id:"description-length",severity:"warning",owner:"content",scope:"page",remediation:"Keep the description useful and usually between 50 and 160 characters."},{id:"missing-h1",severity:"warning",owner:"content",scope:"page",remediation:"Add one clear primary heading."},{id:"broken-internal-link",severity:"error",owner:"developer",scope:"page",remediation:"Update or remove the internal link, or restore its target."},{id:"orphan-sitemap-page",severity:"warning",owner:"seo",scope:"page",remediation:"Add meaningful internal links to the sitemap page."},{id:"crawlable-not-in-sitemap",severity:"warning",owner:"seo",scope:"page",remediation:"Add the indexable page to the sitemap or intentionally exclude it."},{id:"invalid-hreflang",severity:"warning",owner:"seo",scope:"page",remediation:"Use valid language tags and resolvable HTTP(S) alternate URLs."},{id:"malformed-json-ld",severity:"warning",owner:"developer",scope:"page",remediation:"Fix JSON syntax in the structured-data block."},{id:"http-on-https-site",severity:"warning",owner:"developer",scope:"page",remediation:"Use HTTPS for internal URLs and metadata references."},{id:"invalid-language",severity:"warning",owner:"developer",scope:"page",remediation:"Set a valid BCP 47 language tag on the html element."},{id:"duplicate-content",severity:"warning",owner:"content",scope:"page",remediation:"Consolidate duplicate pages or differentiate their main content."},{id:"multiple-h1",severity:"info",owner:"content",scope:"page",remediation:"Review whether one primary H1 would make the hierarchy clearer."},{id:"missing-open-graph",severity:"info",owner:"content",scope:"page",remediation:"Add Open Graph title, description, and image for social sharing."},{id:"missing-twitter-metadata",severity:"info",owner:"content",scope:"page",remediation:"Add Twitter card metadata when social previews matter."},{id:"image-missing-alt",severity:"info",owner:"content",scope:"page",remediation:"Add meaningful alt text, or an empty alt for decorative images."},{id:"low-word-count",severity:"info",owner:"content",scope:"page",remediation:"Review whether the page provides enough useful primary content."},{id:"robots-changed",severity:"warning",owner:"developer",scope:"site",remediation:"Review the robots.txt change and confirm that crawl access is intentional."},{id:"page-missing",severity:"error",owner:"developer",scope:"page",remediation:"Include the page in the scan or confirm that its removal is intentional."},{id:"status-regression",severity:"error",owner:"developer",scope:"page",remediation:"Restore the previous successful HTTP response."},{id:"new-noindex",severity:"error",owner:"seo",scope:"page",remediation:"Remove the newly introduced noindex unless it is intentional."},{id:"title-removed",severity:"error",owner:"content",scope:"page",remediation:"Restore a descriptive title."},{id:"title-changed",severity:"warning",owner:"content",scope:"page",remediation:"Review and approve the changed title."},{id:"description-removed",severity:"warning",owner:"content",scope:"page",remediation:"Restore a useful meta description."},{id:"canonical-removed",severity:"error",owner:"seo",scope:"page",remediation:"Restore the canonical declaration."},{id:"canonical-changed",severity:"warning",owner:"seo",scope:"page",remediation:"Confirm the new canonical target is deliberate and valid."},{id:"h1-removed",severity:"warning",owner:"content",scope:"page",remediation:"Restore a clear primary heading."},{id:"redirect-changed",severity:"warning",owner:"developer",scope:"page",remediation:"Confirm the new redirect destination is intentional."},{id:"sitemap-url-count-drop",severity:"error",owner:"seo",scope:"site",remediation:"Investigate the sitemap URL loss and restore omitted indexable pages."}],qr=Object.freeze(To.map(e=>Object.freeze({...e}))),bo=new Map(qr.map(e=>[e.id,e]));function $r(e){return Array.isArray(e)?`[${e.map($r).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>`${t}:${$r(r)}`).join(",")}}`:JSON.stringify(e)}function Xt(){return qr}function gs(e,t,r,n){return fo("sha256").update(`${e}
2
2
  ${t}
3
3
  ${r}
4
- ${Xr(n??null)}`).digest("hex").slice(0,24)}function O(e,t,r,n={},s){let i=go.get(e);if(!i)throw new Error(`unknown rule: ${e}`);return{fingerprint:As(e,i.scope,t,s),ruleId:e,rule:e,severity:i.severity,scope:i.scope,url:t,message:r,evidence:n,owner:i.owner,remediation:i.remediation,documentationUrl:`${po}#${e}`,after:n.actual}}function Xt(e){return!!(e.title&&!e.error&&!e.blockedByRobots&&e.status===200&&!/(^|[\s,])noindex($|[\s,])/i.test(`${e.robots??""},${e.xRobotsTag??""}`)&&(!e.canonical||e.canonical===(e.finalUrl||e.url)))}function zr(e){return e.normalize("NFKC").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function ps(e){let t=new URL(e.finalUrl||e.url);for(let r of["page","paged","p"])t.searchParams.delete(r);return t.searchParams.sort(),t.href}function hs(e){let t=[],r=new Map,n=new Map;for(let s of[...e].filter(Xt).sort((i,o)=>i.url.localeCompare(o.url))){let i=zr(s.title),o=ps(s),d=`${o}
5
- ${i}`,l=n.get(d)??[];l.push(s),n.set(d,l);let c=i.split(" ");if(c.length<6||c.length>40)continue;let m=new Set([i,...c.map((f,b)=>c.filter((y,C)=>b!==C).join(" "))]),A=new Map;for(let f of m){for(let y of r.get(f)??[]){if(y.title.trim().toLowerCase()===s.title.trim().toLowerCase()||ps(y)===o)continue;let C=zr(y.title).split(" ");2*c.filter(S=>C.includes(S)).length/(c.length+C.length)>=.9&&A.set(y.url,y)}let b=r.get(f)??[];b.length<20&&b.push(s),r.set(f,b)}let h=[...A.values()].sort((f,b)=>f.url.localeCompare(b.url))[0];h&&t.push(O("near-duplicate-title",s.url,"Title is very similar to another checked page; review page intent",{actual:s.title,target:h.url,otherTitle:h.title,method:"normalized punctuation or one-token edit, token overlap >= 90%",candidateLimit:20},[i,h.url]))}for(let s of n.values()){let i=[...new Map(s.map(o=>[o.finalUrl||o.url,o])).values()];if(!(i.length<2||!i.some(o=>["page","paged","p"].some(d=>new URL(o.url).searchParams.has(d)))))for(let o of i)t.push(O("pagination-title-duplicate",o.url,"Critical pagination title duplication across indexable URLs",{actual:o.title,urls:i.slice(0,20).map(d=>d.url),affectedCount:i.length,interpretation:"Critical risk to distinguishing pages in search; not proof of Google exclusion. Pager offsets may be zero- or one-based."},zr(o.title)))}return t}function At(e,t){return new RegExp(`(^|[\\s,])${t}($|[\\s,])`,"i").test(e??"")}function gs(e){if(e.toLowerCase()==="x-default")return!0;try{return new Intl.Locale(e),!0}catch{return!1}}function Zt(e,t){let r=new Map;for(let n of e){let s=t(n)?.trim().toLowerCase();if(!s)continue;let i=r.get(s)??[];i.push(n.url),r.set(s,i)}return new Map([...r].filter(([,n])=>n.length>1))}function ms(e){let t=[],r=c=>{t.push(c)},n=new Map(e.pages.map(c=>[c.url,c])),s=new Set(e.sitemap?.urls??[]),i=Zt(e.pages,c=>c.title),o=Zt(e.pages.filter(Xt),c=>c.title),d=Zt(e.pages,c=>c.description),l=Zt(e.pages,c=>c.contentHash);e.sitemap?.error&&r(O("sitemap-unavailable",e.sitemap.url,"The configured sitemap could not be loaded",{actual:e.sitemap.error}));for(let c of e.pages){if(c.blockedByRobots){r(O("robots-blocked",c.url,"Page is blocked by robots.txt",{actual:!0}));continue}if(c.error){r(O(c.error.includes("redirect loop")?"redirect-loop":"page-unreachable",c.url,`Page request failed: ${c.error}`,{actual:c.error,redirectChain:c.redirectChain}));continue}if((c.status===null||c.status>=400)&&r(O("http-error",c.url,`Page returned HTTP ${c.status??"unknown"}`,{actual:c.status})),At(c.robots,"noindex")&&r(O("noindex",c.url,"Page contains a noindex meta directive",{actual:c.robots})),At(c.xRobotsTag,"noindex")&&r(O("x-robots-noindex",c.url,"Page contains a noindex X-Robots-Tag",{actual:c.xRobotsTag})),!c.canonicalRaw&&!c.canonical&&r(O("missing-canonical",c.url,"Page does not declare a canonical URL",{actual:null})),c.canonicalRaw&&!c.canonical&&r(O("invalid-canonical",c.url,"Canonical URL is invalid",{actual:c.canonicalRaw})),c.canonical&&new URL(c.canonical).origin!==new URL(e.siteUrl).origin&&r(O("cross-domain-canonical",c.url,"Canonical points to another origin",{actual:c.canonical})),c.canonical){let A=n.get(c.canonical);A&&(A.error||(A.status??500)>=400)&&r(O("canonical-target-error",c.url,"Canonical target is unavailable",{target:c.canonical,actual:A.status??A.error},c.canonical))}if(c.redirectChain.length>3&&r(O("long-redirect-chain",c.url,`Page uses ${c.redirectChain.length} redirects`,{actual:c.redirectChain.length,redirectChain:c.redirectChain})),s.has(c.url)&&(At(c.robots,"noindex")||At(c.xRobotsTag,"noindex"))&&r(O("noindex-in-sitemap",c.url,"Sitemap URL is marked noindex",{actual:c.robots??c.xRobotsTag})),s.has(c.url)&&c.redirectChain.length>0&&r(O("redirect-in-sitemap",c.url,"Sitemap URL redirects",{actual:c.finalUrl,redirectChain:c.redirectChain})),!c.title)r(O("missing-title",c.url,"Page does not have a title",{actual:null}));else{if(i.get(c.title.trim().toLowerCase())){let A=Xt(c)&&!!o.get(c.title.trim().toLowerCase()),h=O("duplicate-title",c.url,A?"Critical title duplication across indexable URLs":"Title is shared by multiple pages",{actual:c.title,urls:i.get(c.title.trim().toLowerCase()),indexingRisk:A?"critical; verify Google's chosen canonical and indexing reason in Search Console":"review intentional variants"},c.title.trim().toLowerCase());A&&(h.severity="error"),r(h)}(c.title.length<10||c.title.length>60)&&r(O("title-length",c.url,`Title length is ${c.title.length} characters`,{actual:c.title.length,value:c.title}))}c.description?(d.get(c.description.trim().toLowerCase())&&r(O("duplicate-description",c.url,"Meta description is shared by multiple pages",{actual:c.description,urls:d.get(c.description.trim().toLowerCase())},c.description.trim().toLowerCase())),(c.description.length<50||c.description.length>160)&&r(O("description-length",c.url,`Description length is ${c.description.length} characters`,{actual:c.description.length,value:c.description}))):r(O("missing-description",c.url,"Page does not have a meta description",{actual:null})),c.h1Count===0?r(O("missing-h1",c.url,"Page does not contain an H1 heading",{actual:0})):c.h1Count>1&&r(O("multiple-h1",c.url,`Page contains ${c.h1Count} H1 headings`,{actual:c.h1Count}));for(let A of c.internalLinks){let h=n.get(A);h&&(h.error||(h.status??500)>=400)&&r(O("broken-internal-link",c.url,"Internal link points to an unavailable page",{target:A,actual:h.status??h.error},A))}s.has(c.url)&&c.url!==e.siteUrl&&e.linkGraph.orphanUrls.includes(c.url)&&r(O("orphan-sitemap-page",c.url,"Sitemap page has no discovered internal links",{actual:!0})),e.sitemap&&!s.has(c.url)&&!At(c.robots,"noindex")&&(c.status??500)<400&&r(O("crawlable-not-in-sitemap",c.url,"Crawlable page is absent from the sitemap",{actual:!1}));for(let A of c.hreflang)(!gs(A.lang)||!A.url)&&r(O("invalid-hreflang",c.url,"Hreflang declaration is invalid",{actual:A},A));for(let[A,h]of c.jsonLd.entries())h.valid||r(O("malformed-json-ld",c.url,"JSON-LD block contains invalid JSON",{actual:h.error,index:A},A));e.siteUrl.startsWith("https:")&&[c.url,c.canonical,...c.internalLinks].some(A=>A?.startsWith("http:"))&&r(O("http-on-https-site",c.url,"HTTPS site references an internal HTTP URL",{actual:[c.url,c.canonical,...c.internalLinks].filter(A=>A?.startsWith("http:"))})),c.lang&&!gs(c.lang)&&r(O("invalid-language",c.url,"HTML language declaration is invalid",{actual:c.lang})),c.contentHash&&l.get(c.contentHash)&&r(O("duplicate-content",c.url,"Main text is an exact duplicate of another page",{urls:l.get(c.contentHash)},c.contentHash)),(!c.openGraph.title||!c.openGraph.description||!c.openGraph.image)&&r(O("missing-open-graph",c.url,"Open Graph metadata is incomplete",{actual:c.openGraph})),(!c.twitter.card||!c.twitter.title||!c.twitter.description||!c.twitter.image)&&r(O("missing-twitter-metadata",c.url,"Twitter card metadata is incomplete",{actual:c.twitter}));let m=c.images.filter(A=>A.alt===null).map(A=>A.src);m.length>0&&r(O("image-missing-alt",c.url,`${m.length} image(s) do not have an alt attribute`,{actual:m})),c.wordCount<200&&r(O("low-word-count",c.url,`Page contains approximately ${c.wordCount} visible words`,{actual:c.wordCount}))}return t.push(...hs(e.pages)),t}var fs={error:0,warning:1,info:2};function mo(e,t){let r=(()=>{try{return new URL(e).pathname}catch{return e}})(),n=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replaceAll("**","\0").replaceAll("*","[^/]*").replaceAll("\0",".*"),s=new RegExp(`^${n}$`);return s.test(r)||s.test(e)}function fo(e,t,r){return t.find(n=>n.rule!==e.ruleId||!mo(e.url,n.urlPattern)?!1:n.expiresAt?new Date(`${n.expiresAt}T23:59:59.999Z`).getTime()>=r.getTime():!0)??null}function $e(e){return e.sort((t,r)=>fs[t.severity]-fs[r.severity]||t.url.localeCompare(r.url)||t.ruleId.localeCompare(r.ruleId)||t.fingerprint.localeCompare(r.fingerprint))}function pt(e,t,r={}){let n=r.enabledRules??t.config.enabledRules,s=n?new Set(n):null,i={...t.config.severityOverrides,...r.severityOverrides??{}},o=r.suppressions??t.config.suppressions,d=new Date(r.now??Date.now());return $e(e.filter(l=>!s||s.has(l.ruleId)).map(l=>({...l,severity:i[l.ruleId]??l.severity})).filter(l=>!fo(l,o,d)))}import{createHash as To}from"node:crypto";var W="0.17.0",_e="1.2.0",Eo="seo-crawl-audit",Re=`${Eo}/${W}`;var bo={title:null,description:null,image:null},Co={card:null,title:null,description:null,image:null};function Es(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("snapshot must be an object");return e}function Io(e){if(!e||typeof e!="object"||typeof e.url!="string")throw new Error("snapshot page URL must be a string");return e}function qr(e){return Array.isArray(e)?`[${e.map(qr).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>`${JSON.stringify(t)}:${qr(r)}`).join(",")}}`:JSON.stringify(e)}function yo(e){return To("sha256").update(qr(e)).digest("hex")}function wo(e){return{url:e.url,finalUrl:e.finalUrl??null,status:e.status??null,contentType:e.contentType??null,blockedByRobots:e.blockedByRobots??!1,error:e.error??null,title:e.title??null,description:e.description??null,canonical:e.canonical??null,canonicalRaw:e.canonicalRaw??e.canonical??null,robots:e.robots??null,xRobotsTag:e.xRobotsTag??null,lang:e.lang??null,h1Count:e.h1Count??0,openGraph:e.openGraph??bo,twitter:e.twitter??Co,hreflang:e.hreflang??[],jsonLd:e.jsonLd??[],images:e.images??[],links:[...e.links??[]].sort(),internalLinks:[...e.internalLinks??[]].sort(),externalLinks:[...e.externalLinks??[]].sort(),wordCount:e.wordCount??0,contentHash:e.contentHash??null,depth:e.depth??0,redirectChain:e.redirectChain??[],responseBytes:e.responseBytes??0}}function xo(e){let t=e.source??{},r=e.options??{},n=e.pages?.[0],s=n&&typeof n=="object"?n.url:void 0,i=e.siteUrl??e.startUrl??t.startUrl??(typeof s=="string"?s:void 0);if(!i)throw new Error("snapshot site URL must be a string");return{schemaVersion:1,url:i,sitemap:r.sitemap??t.sitemap??"auto",maxPages:r.maxPages??t.maxPages??100,concurrency:r.concurrency??5,delay:r.requestDelay??t.requestDelay??100,timeout:r.timeout??1e4,respectRobots:r.respectRobots??t.respectRobots??!0,includeQuery:r.includeQuery??t.includeQuery??!1,maxRedirects:r.maxRedirects??10,maxResponseBytes:r.maxResponseBytes??5*1024*1024,enabledRules:r.enabledRules??null,severityOverrides:r.severityOverrides??{},suppressions:r.suppressions??[],regressionBudgets:r.regressionBudgets??{},report:r.report??{}}}function So(e,t){let r=new Set(e.map(i=>i.url)),n=new Set(e.flatMap(i=>i.internalLinks)),s=new Set;for(let i of e)(i.error||i.blockedByRobots||(i.status??500)>=400)&&s.add(i.url);return{internalEdges:e.reduce((i,o)=>i+o.internalLinks.length,0),externalEdges:e.reduce((i,o)=>i+o.externalLinks.length,0),orphanUrls:t.filter(i=>r.has(i)&&!n.has(i)),brokenInternalUrls:[...s].sort()}}function No(e,t){let r=t.filter(s=>s.blockedByRobots).length,n=t.filter(s=>s.error||(s.status??500)>=400).length;return{requested:e.requested??t.length,completed:t.length,succeeded:t.length-n-r,failed:n,blockedByRobots:r,redirected:t.filter(s=>s.redirectChain.length>0||s.url!==s.finalUrl).length,durationMs:e.durationMs??0,truncated:e.truncated??!1,partial:e.partial??!1}}function ye(e){let t=Es(e),r=xo(t),n=(t.pages??[]).map(l=>wo(Io(l))).sort((l,c)=>l.url.localeCompare(c.url)),s=t.sitemap?.urls??[];if(t.sitemap&&!t.sitemap.url)throw new Error("snapshot sitemap URL must be a string");let i=t.sitemap?{url:t.sitemap.url,urls:[...s].sort(),sitemapCount:t.sitemap.sitemapCount??0,truncated:t.sitemap.truncated??!1,error:t.sitemap.error??null}:null,o=t.startUrl??r.url,d=t.truncated??!1;return{schemaVersion:2,engineVersion:W,ruleSetVersion:_e,generatedAt:t.generatedAt??new Date().toISOString(),siteUrl:o,configurationHash:yo(r),config:r,robots:{url:t.robots?.url??new URL("/robots.txt",o).href,status:t.robots?.status??null,sha256:t.robots?.sha256??null,error:t.robots?.error??null,denyAll:t.robots?.denyAll??!1},sitemap:i,pages:n,linkGraph:t.linkGraph??So(n,s),statistics:t.statistics??No(t,n),partial:t.partial??!1,source:{startUrl:o,maxPages:r.maxPages,requestDelay:r.delay,includeQuery:r.includeQuery,respectRobots:r.respectRobots,sitemap:typeof r.sitemap=="string"&&!["auto","none"].includes(r.sitemap)?r.sitemap:null},truncated:d}}function fe(e){let t=Es(e);if(!Array.isArray(t.pages))throw new Error("snapshot pages must be an array");if(t.schemaVersion===2)return ye({...t,startUrl:t.siteUrl,options:t.config,pages:t.pages,generatedAt:t.generatedAt,partial:t.partial,statistics:t.statistics,linkGraph:t.linkGraph});if(t.schemaVersion===1)return ye(t);throw new Error(`unsupported snapshot schema version: ${String(t.schemaVersion)}`)}function Le(e){if(e.schemaVersion===2)return e;let t=e,r=t.pages?.[0],n=r&&typeof r=="object"?r.url:void 0,s=typeof n=="string"?n:t.source?.startUrl??"https://invalid.local/";return ye({...t,startUrl:t.siteUrl??t.source?.startUrl??s,robots:t.robots??{url:new URL("/robots.txt",s).href,status:null,sha256:null,error:null},options:t.config??t.options??{}})}function le(e,t={}){let r=Le(e);return pt(ms(r),r,t)}function Ts(e,t){return new RegExp(`(^|[\\s,])${t}($|[\\s,])`,"i").test(e??"")}function ee(e,t,r,n,s){let i=O(e,t,r,{before:n,after:s,actual:s});return i.before=n,i.after=s,i}function bs(e,t){let r=!t.partial&&!t.truncated,n=[],s=new Map(t.pages.map(l=>[l.url,l]));e.robots.sha256&&t.robots.sha256&&e.robots.sha256!==t.robots.sha256&&n.push(ee("robots-changed",t.robots.url,"robots.txt content changed",e.robots.sha256,t.robots.sha256));let i=e.sitemap?.urls.length??0,o=t.sitemap?.urls.length??0,d=i-o;r&&i>0&&d>=Math.max(5,Math.ceil(i*.2))&&n.push(ee("sitemap-url-count-drop",t.sitemap?.url??e.sitemap?.url??t.siteUrl,`Sitemap URL count dropped by ${d}`,i,o));for(let l of e.pages){let c=s.get(l.url);if(!c){r&&n.push(ee("page-missing",l.url,"Page was not checked",l.status,null));continue}if(c.blockedByRobots&&!l.blockedByRobots){n.push(ee("robots-blocked",l.url,"Page is now blocked by robots.txt",!1,!0));continue}if(c.error&&!l.error){n.push(ee(c.error.includes("redirect loop")?"redirect-loop":"page-unreachable",l.url,`Page request failed: ${c.error}`,l.error,c.error));continue}l.status!==null&&l.status<400&&(c.status===null||c.status>=400)&&n.push(ee("status-regression",l.url,`HTTP status regressed from ${l.status} to ${c.status??"none"}`,l.status,c.status));let m=`${l.robots??""},${l.xRobotsTag??""}`,A=`${c.robots??""},${c.xRobotsTag??""}`;if(!Ts(m,"noindex")&&Ts(A,"noindex")&&n.push(ee("new-noindex",l.url,"Page now contains a noindex directive",m,A)),l.title&&!c.title?n.push(ee("title-removed",l.url,"Page title was removed",l.title,c.title)):l.title&&c.title&&l.title!==c.title&&n.push(ee("title-changed",l.url,"Page title changed",l.title,c.title)),l.description&&!c.description&&n.push(ee("description-removed",l.url,"Meta description was removed",l.description,c.description)),l.canonical&&!c.canonical)n.push(ee("canonical-removed",l.url,"Canonical URL was removed",l.canonical,c.canonical));else if(l.canonical&&c.canonical&&l.canonical!==c.canonical){let h=ee("canonical-changed",l.url,"Canonical URL changed",l.canonical,c.canonical);new URL(c.canonical).origin!==new URL(l.url).origin&&(h.severity="error"),n.push(h)}if(l.h1Count>0&&c.h1Count===0&&n.push(ee("h1-removed",l.url,"All H1 headings were removed",l.h1Count,c.h1Count)),l.finalUrl&&c.finalUrl&&l.finalUrl!==c.finalUrl){let h=ee("redirect-changed",l.url,"Final redirect URL changed",l.finalUrl,c.finalUrl);new URL(c.finalUrl).origin!==new URL(l.url).origin&&(h.severity="error"),n.push(h)}}return n}function _o(e,t,r={}){let n=Le(e),s=Le(t);return pt(bs(n,s),s,r)}function ht(e,t){return{...e,lifecycle:t}}function je(e,t,r={}){let n=Le(e),s=Le(t),i=!s.partial&&!s.truncated,o=new Set(s.pages.map(C=>C.url)),d=new Map(le(n,r).map(C=>[C.fingerprint,C])),l=new Map(le(s,r).map(C=>[C.fingerprint,C])),c=[],m=[],A=[],h=[];for(let[C,N]of l){let S=d.get(C);S?JSON.stringify(S.evidence)===JSON.stringify(N.evidence)?A.push(ht(N,"unchanged")):m.push(ht({...N,before:S.evidence,after:N.evidence},"ongoing")):c.push(ht(N,"new"))}for(let[C,N]of d)(N.scope==="page"?o.has(N.url):i)&&!l.has(C)&&h.push(ht(N,"resolved"));let f=new Set(c.map(C=>C.fingerprint));for(let C of _o(n,s,r))f.has(C.fingerprint)||c.push(ht(C,"new"));let b={...n.config.regressionBudgets,...s.config.regressionBudgets},y=Object.entries(b).flatMap(([C,N])=>{let S=c.filter(_=>_.severity===C||_.ruleId===C).length;return S>N?[{budget:C,allowed:N,actual:S}]:[]});return $e(c),$e(m),$e(A),$e(h),{complete:i,newIssues:c,ongoingIssues:m,resolvedIssues:h,unchangedIssues:A,issues:[...c,...m],budgetExceeded:y}}var en="seo-audit.config.json",Cs=Object.freeze({schemaVersion:1,url:"",sitemap:"auto",maxPages:100,concurrency:5,delay:100,timeout:1e4,respectRobots:!0,includeQuery:!1,maxRedirects:10,maxResponseBytes:5242880,enabledRules:null,severityOverrides:{},suppressions:[],regressionBudgets:{},report:{}});function gt(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} must be an object`);return e}function Oe(e,t,r,n=Number.MAX_SAFE_INTEGER){if(!Number.isInteger(e)||e<r||e>n)throw new Error(`${t} must be an integer between ${r} and ${n}`);return e}function mt(e,t){if(e!==void 0){if(typeof e!="string")throw new Error(`${t} must be a string`);return e}}function tn(e){let t=gt(e,"config"),r=new Set(["$schema","schemaVersion","url","sitemap","maxPages","concurrency","delay","timeout","respectRobots","includeQuery","maxRedirects","maxResponseBytes","enabledRules","severityOverrides","suppressions","regressionBudgets","report"]);for(let s of Object.keys(t))if(!r.has(s))throw new Error(`unknown config property: ${s}`);let n={};if(t.schemaVersion!==void 0&&t.schemaVersion!==1)throw new Error("schemaVersion must be 1");if(t.url!==void 0){let s=mt(t.url,"url");if(!/^https?:\/\//i.test(s))throw new Error("url must be an HTTP(S) URL");n.url=s}if(t.sitemap!==void 0){let s=mt(t.sitemap,"sitemap");if(!["auto","none"].includes(s)&&!/^https?:\/\//i.test(s))throw new Error("sitemap must be auto, none, or an HTTP(S) URL");n.sitemap=s}t.maxPages!==void 0&&(n.maxPages=Oe(t.maxPages,"maxPages",1)),t.concurrency!==void 0&&(n.concurrency=Oe(t.concurrency,"concurrency",1,50)),t.delay!==void 0&&(n.delay=Oe(t.delay,"delay",0)),t.timeout!==void 0&&(n.timeout=Oe(t.timeout,"timeout",1)),t.maxRedirects!==void 0&&(n.maxRedirects=Oe(t.maxRedirects,"maxRedirects",0,50)),t.maxResponseBytes!==void 0&&(n.maxResponseBytes=Oe(t.maxResponseBytes,"maxResponseBytes",1024));for(let s of["respectRobots","includeQuery"])if(t[s]!==void 0){if(typeof t[s]!="boolean")throw new Error(`${s} must be a boolean`);n[s]=t[s]}if(t.enabledRules!==void 0){if(t.enabledRules!==null&&(!Array.isArray(t.enabledRules)||t.enabledRules.some(s=>typeof s!="string")))throw new Error("enabledRules must be null or an array of rule IDs");n.enabledRules=t.enabledRules}if(t.severityOverrides!==void 0){let s=gt(t.severityOverrides,"severityOverrides");for(let[i,o]of Object.entries(s))if(!["error","warning","info"].includes(o))throw new Error(`severityOverrides.${i} must be error, warning, or info`);n.severityOverrides=s}if(t.suppressions!==void 0){if(!Array.isArray(t.suppressions))throw new Error("suppressions must be an array");n.suppressions=t.suppressions.map((s,i)=>{let o=gt(s,`suppressions[${i}]`);for(let d of["rule","urlPattern","reason"])if(typeof o[d]!="string"||o[d]==="")throw new Error(`suppressions[${i}].${d} must be a non-empty string`);if(o.expiresAt!==void 0&&!/^\d{4}-\d{2}-\d{2}$/.test(String(o.expiresAt)))throw new Error(`suppressions[${i}].expiresAt must use YYYY-MM-DD`);return o})}if(t.regressionBudgets!==void 0){let s=gt(t.regressionBudgets,"regressionBudgets");n.regressionBudgets=Object.fromEntries(Object.entries(s).map(([i,o])=>[i,Oe(o,`regressionBudgets.${i}`,0)]))}if(t.report!==void 0){let s=gt(t.report,"report"),i={},o=mt(s.agencyName,"report.agencyName"),d=mt(s.logo,"report.logo"),l=mt(s.primaryColor,"report.primaryColor");if(o!==void 0&&(i.agencyName=o),d!==void 0&&(i.logo=d),l!==void 0&&(i.primaryColor=l),i.primaryColor&&!/^#[0-9a-f]{6}$/i.test(i.primaryColor))throw new Error("report.primaryColor must be a six-digit hex color");n.report=Object.fromEntries(Object.entries(i).filter(([,c])=>c!==void 0))}return n}function be(e,t={},r={}){return{...{...Cs,...r,...t,...e},schemaVersion:1,severityOverrides:{...r.severityOverrides??{},...t.severityOverrides??{},...e.severityOverrides??{}},regressionBudgets:{...r.regressionBudgets??{},...t.regressionBudgets??{},...e.regressionBudgets??{}},report:{...r.report??{},...t.report??{},...e.report??{}},suppressions:e.suppressions??t.suppressions??r.suppressions??[]}}function zt(){}var qt=Object.freeze({debug:zt,info:zt,warn:zt,error:zt});import{setTimeout as Ro}from"node:timers/promises";function Lo(e=0,{now:t=Date.now,wait:r=Ro}={}){let n=Math.max(0,e),s=0,i=Promise.resolve();return function(){if(n===0)return Promise.resolve();let d=i.then(async()=>{let l=Math.max(0,s-t());l>0&&await r(l),s=t()+n});return i=d.catch(()=>{}),d}}function Ve(e=0,t=Lo){let r=new Map;return n=>{let s=new URL(n).origin,i=r.get(s);return i||(i=t(e),r.set(s,i)),i()}}import{createHash as Mo}from"node:crypto";import{setTimeout as Is}from"node:timers/promises";var Ee=class extends Error{redirectChain;constructor(t,r=[],n){super(t,n),this.name="RequestFailure",this.redirectChain=r}};function Oo(e){return e===429||e===500||e===502||e===503||e===504}function vo(e,t=Date.now()){if(!e)return null;let r=Number(e);if(Number.isFinite(r)&&r>=0)return Math.min(r*1e3,3e4);let n=Date.parse(e);return Number.isNaN(n)?null:Math.min(Math.max(0,n-t),3e4)}function ko(e,t){let r=AbortSignal.timeout(e);return t?AbortSignal.any([t,r]):r}async function Do(e,t,r){let n=[],s=new Set([e]),i=e;for(;;){r.signal?.throwIfAborted(),await r.gate?.(i);let o=await r.fetch(i,{...t,redirect:"manual",signal:ko(r.timeout,r.signal)}),d=o.headers.get("location");if(o.status<300||o.status>=400||!d)return{response:o,redirectChain:n};let l=new URL(d,i).href;if(n.push({url:i,status:o.status,location:l}),await o.body?.cancel(),s.has(l))throw new Ee(`redirect loop detected at ${l}`,n);if(n.length>r.maxRedirects)throw new Ee(`redirect limit of ${r.maxRedirects} exceeded`,n);s.add(l),i=l}}async function ve(e,t,r){let n;for(let s=0;s<=r.retries;s+=1)try{let i=await Do(e,t,r);if(!Oo(i.response.status)||s===r.retries)return i;let o=vo(i.response.headers.get("retry-after"));await i.response.body?.cancel();let d=Math.floor((r.random??Math.random)()*100),l=o??Math.min(250*2**s+d,3e4);await r.onEvent?.({type:"retry",url:e,attempt:s+1,delayMs:l}),await Is(l,void 0,{signal:r.signal})}catch(i){if(r.signal?.aborted)throw r.signal.reason??i;if(n=i,i instanceof Ee||s===r.retries)break;let o=Math.floor((r.random??Math.random)()*100),d=Math.min(250*2**s+o,3e4);await r.onEvent?.({type:"retry",url:e,attempt:s+1,delayMs:d}),await Is(d,void 0,{signal:r.signal})}throw n instanceof Ee?n:new Ee(n instanceof Error?n.message:String(n),[],{cause:n})}async function ke(e,t){if(!e.body)return{text:"",bytes:0,buffer:Buffer.alloc(0)};let r=e.body.getReader(),n=[],s=0;for(;;){let{done:o,value:d}=await r.read();if(o)break;if(s+=d.byteLength,s>t)throw await r.cancel(),new Ee(`response exceeds ${t} bytes`);n.push(Buffer.from(d))}let i=Buffer.concat(n);return{text:i.toString("utf8"),bytes:s,buffer:i}}function Bo(e,t){if(!t)return!1;let r=t.endsWith("$"),s=(r?t.slice(0,-1):t).replace(/[.+?^${}()|[\]\\]/g,"\\$&").replaceAll("*",".*");return new RegExp(`^${s}${r?"$":""}`).test(e)}function Po(e,t){let r=[],n=null;for(let d of e.replace(/^\uFEFF/,"").split(/\r?\n/)){let l=d.replace(/#.*$/,"").trim(),c=l.indexOf(":");if(!l||c<0)continue;let m=l.slice(0,c).trim().toLowerCase(),A=l.slice(c+1).trim();if(m==="user-agent"){(!n||n.hasRules)&&(n={agents:[],rules:[],hasRules:!1},r.push(n)),A&&n.agents.push(A.toLowerCase());continue}n&&(m==="allow"||m==="disallow")&&A&&(n.rules.push({type:m,path:A}),n.hasRules=!0)}let s=t.toLowerCase(),i=r.filter(d=>d.agents.some(l=>l!=="*"&&s.includes(l)));return(i.length>0?i:r.filter(d=>d.agents.includes("*"))).flatMap(d=>d.rules)}function ys(e,t){if(t.denyAll)return!1;let r=new URL(e),n=`${r.pathname}${r.search}`,s=(t.rules??[]).filter(i=>Bo(n,i.path)).sort((i,o)=>o.path.length-i.path.length||(i.type==="allow"?-1:1));return s.length===0||s[0]?.type==="allow"}async function er(e,t){let r=new URL("/robots.txt",e).href;try{let{response:n}=await ve(r,{headers:{accept:"text/plain,*/*;q=0.1","user-agent":t.userAgent}},{fetch:t.fetch,timeout:t.timeout,maxRedirects:t.maxRedirects,retries:t.retries,signal:t.signal,gate:t.requestGate,onEvent:t.onEvent}),{text:s}=await ke(n,Uo);return{url:r,status:n.status,body:s,sha256:Mo("sha256").update(s).digest("hex"),rules:n.ok?Po(s,t.userAgent):[],denyAll:n.status===401||n.status===403,error:null}}catch(n){if(t.signal?.aborted)throw n;return{url:r,status:null,body:"",sha256:null,rules:[],denyAll:!1,error:n instanceof Error?n.message:String(n)}}}var Uo=512*1024;import{gunzipSync as nl}from"node:zlib";var ws=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Fo=ws+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Ho="["+ws+"]["+Fo+"]*",Qo=new RegExp("^"+Ho+"$");function xs(e,t){let r=[],n=t.exec(e);for(;n;){let s=[];s.startIndex=t.lastIndex-n[0].length;let i=n.length;for(let o=0;o<i;o++)s.push(n[o]);r.push(s),n=t.exec(e)}return r}var rn=function(e){let t=Qo.exec(e);return!(t===null||typeof t>"u")};function Ss(e){return typeof e<"u"}var ft=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],tr=["__proto__","constructor","prototype"];var Yo={allowBooleanAttributes:!1,unpairedTags:[]};function rr(e,t){t=Object.assign({},Yo,t);let r=[],n=!1,s=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let i=0;i<e.length;i++)if(e[i]==="<"&&e[i+1]==="?"){if(i+=2,i=Ns(e,i),i.err)return i}else if(e[i]==="<"){let o=i;if(i++,e[i]==="!"){i=_s(e,i);continue}else{let d=!1;e[i]==="/"&&(d=!0,i++);let l="";for(;i<e.length&&e[i]!==">"&&e[i]!==" "&&e[i]!==" "&&e[i]!==`
6
- `&&e[i]!=="\r";i++)l+=e[i];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),i--),!Xo(l)){let A;return l.trim().length===0?A="Invalid space after '<'.":A="Tag '"+l+"' is an invalid name.",Y("InvalidTag",A,Z(e,i))}let c=Ko(e,i);if(c===!1)return Y("InvalidAttr","Attributes for '"+l+"' have open quote.",Z(e,i));let m=c.value;if(i=c.index,m[m.length-1]==="/"){let A=i-m.length;m=m.substring(0,m.length-1);let h=Rs(m,t);if(h===!0)n=!0;else return Y(h.err.code,h.err.msg,Z(e,A+h.err.line))}else if(d)if(c.tagClosed){if(m.trim().length>0)return Y("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Z(e,o));if(r.length===0)return Y("InvalidTag","Closing tag '"+l+"' has not been opened.",Z(e,o));{let A=r.pop();if(l!==A.tagName){let h=Z(e,A.tagStartPos);return Y("InvalidTag","Expected closing tag '"+A.tagName+"' (opened in line "+h.line+", col "+h.col+") instead of closing tag '"+l+"'.",Z(e,o))}r.length==0&&(s=!0)}}else return Y("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Z(e,i));else{let A=Rs(m,t);if(A!==!0)return Y(A.err.code,A.err.msg,Z(e,i-m.length+A.err.line));if(s===!0)return Y("InvalidXml","Multiple possible root nodes found.",Z(e,i));t.unpairedTags.indexOf(l)!==-1||r.push({tagName:l,tagStartPos:o}),n=!0}for(i++;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="!"){i++,i=_s(e,i);continue}else if(e[i+1]==="?"){if(i=Ns(e,++i),i.err)return i}else break;else if(e[i]==="&"){let A=jo(e,i);if(A==-1)return Y("InvalidChar","char '&' is not expected.",Z(e,i));i=A}else if(s===!0&&!Xe(e[i]))return Y("InvalidXml","Extra text at the end",Z(e,i));e[i]==="<"&&i--}}else{if(Xe(e[i]))continue;return Y("InvalidChar","char '"+e[i]+"' is not expected.",Z(e,i))}if(n){if(r.length==1)return Y("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",Z(e,r[0].tagStartPos));if(r.length>0)return Y("InvalidXml","Invalid '"+JSON.stringify(r.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Y("InvalidXml","Start tag expected.",1);return!0}function Xe(e){return e===" "||e===" "||e===`
7
- `||e==="\r"}function Ns(e,t){let r=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){let n=e.substr(r,t-r);if(t>5&&n==="xml")return Y("InvalidXml","XML declaration allowed only at the start of the document.",Z(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function _s(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let r=1;for(t+=8;t<e.length;t++)if(e[t]==="<")r++;else if(e[t]===">"&&(r--,r===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}var Go='"',Wo="'";function Ko(e,t){let r="",n="",s=!1;for(;t<e.length;t++){if(e[t]===Go||e[t]===Wo)n===""?n=e[t]:n!==e[t]||(n="");else if(e[t]===">"&&n===""){s=!0;break}r+=e[t]}return n!==""?!1:{value:r,index:t,tagClosed:s}}function Jo(e){let t=[],r=e.length,n=0;for(;n<r;){let s=n;for(;n<r&&Xe(e[n]);)n++;if(n>=r)break;if(e[n]==="="){n++;continue}let i=e.slice(s,n),o=n;for(;n<r&&!Xe(e[n])&&e[n]!=="=";)n++;let d=e.slice(o,n),l,c=n;for(;c<r&&Xe(e[c]);)c++;c<r&&e[c]==="="&&(l=e.slice(n,c+1),n=c+1);let m,A,h=n;for(;h<r&&Xe(e[h]);)h++;if(h<r&&(e[h]==='"'||e[h]==="'")){let b=h+1,y=e.indexOf(e[h],b);y!==-1&&(m=e[h],A=e.slice(b,y),n=y+1)}let f={startIndex:s};f[1]=i,f[2]=d,f[3]=l,f[4]=m!==void 0?!0:void 0,f[5]=m,f[6]=A,t.push(f)}return t}function Rs(e,t){let r=Jo(e),n={};for(let s=0;s<r.length;s++){if(r[s][1].length===0)return Y("InvalidAttr","Attribute '"+r[s][2]+"' has no space in starting.",Et(r[s]));if(r[s][3]!==void 0&&r[s][4]===void 0)return Y("InvalidAttr","Attribute '"+r[s][2]+"' is without value.",Et(r[s]));if(r[s][3]===void 0&&!t.allowBooleanAttributes)return Y("InvalidAttr","boolean attribute '"+r[s][2]+"' is not allowed.",Et(r[s]));let i=r[s][2];if(!Vo(i))return Y("InvalidAttr","Attribute '"+i+"' is an invalid name.",Et(r[s]));if(!Object.prototype.hasOwnProperty.call(n,i))n[i]=1;else return Y("InvalidAttr","Attribute '"+i+"' is repeated.",Et(r[s]))}return!0}function $o(e,t){let r=/\d/;for(e[t]==="x"&&(t++,r=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(r))break}return-1}function jo(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,$o(e,t);let r=0;for(;t<e.length;t++,r++)if(!(e[t].match(/\w/)&&r<20)){if(e[t]===";")break;return-1}return t}function Y(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function Vo(e){return rn(e)}function Xo(e){return rn(e)}function Z(e,t){let r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function Et(e){return e.startIndex+e[1].length}var nn={cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",euro:"\u20AC",dollar:"$",fnof:"\u0192",inr:"\u20B9",af:"\u060B",birr:"\u1265\u122D",peso:"\u20B1",rub:"\u20BD",won:"\u20A9",yuan:"\xA5",cedil:"\xB8"};var Tt={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},sn={nbsp:"\xA0",copy:"\xA9",reg:"\xAE",trade:"\u2122",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",laquo:"\xAB",raquo:"\xBB",lsquo:"\u2018",rsquo:"\u2019",ldquo:"\u201C",rdquo:"\u201D",bull:"\u2022",para:"\xB6",sect:"\xA7",deg:"\xB0",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE"};var Ze=Object.freeze({ALLOW:"allow",BLOCK:"block",THROW:"throw"}),Zo=new Set("!?\\\\/[]$%{}^&*()<>|+");function Ls(e){if(e[0]==="#")throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${e}"`);for(let t of e)if(Zo.has(t))throw new Error(`[EntityReplacer] Invalid character '${t}' in entity name: "${e}"`);return e}function bt(...e){let t=Object.create(null);for(let r of e)if(r)for(let n of Object.keys(r)){let s=r[n];if(typeof s=="string")t[n]=s;else if(s&&typeof s=="object"&&s.val!==void 0){let i=s.val;typeof i=="string"&&(t[n]=i)}}return t}var De="external",nr="base",an="all";function zo(e){return!e||e===De?new Set([De]):e===an?new Set([an]):e===nr?new Set([nr]):Array.isArray(e)?new Set(e):new Set([De])}var te=Object.freeze({allow:0,leave:1,remove:2,throw:3}),qo=new Set([9,10,13]);function ec(e){if(!e)return{xmlVersion:1,onLevel:te.allow,nullLevel:te.remove};let t=e.xmlVersion===1.1?1.1:1,r=te[e.onNCR]??te.allow,n=te[e.nullNCR]??te.remove,s=Math.max(n,te.remove);return{xmlVersion:t,onLevel:r,nullLevel:s}}var ze=class{constructor(t={}){this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof t.postCheck=="function"?t.postCheck:n=>n,this._limitTiers=zo(this._limit.applyLimitsTo??De),this._numericAllowed=t.numericAllowed??!0,this._baseMap=bt(Tt,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);let r=ec(t.ncr);this._ncrXmlVersion=r.xmlVersion,this._ncrOnLevel=r.onLevel,this._ncrNullLevel=r.nullLevel,this._onExternalEntity=typeof t.onExternalEntity=="function"?t.onExternalEntity:null,this._onInputEntity=typeof t.onInputEntity=="function"?t.onInputEntity:null}_applyRegistrationHook(t,r,n,s){if(!t)return!0;let i=t(r,n);if(i===Ze.BLOCK)return!1;if(i===Ze.THROW)throw new Error(`[EntityDecoder] Registration of ${s} entity "&${r};" was rejected by hook`);return!0}setExternalEntities(t){if(t)for(let s of Object.keys(t))Ls(s);if(!this._onExternalEntity){this._externalMap=bt(t);return}let r=bt(t),n=Object.create(null);for(let[s,i]of Object.entries(r))this._applyRegistrationHook(this._onExternalEntity,s,i,"external")&&(n[s]=i);this._externalMap=n}addExternalEntity(t,r){Ls(t),typeof r=="string"&&r.indexOf("&")===-1&&this._applyRegistrationHook(this._onExternalEntity,t,r,"external")&&(this._externalMap[t]=r)}addInputEntities(t){if(this._totalExpansions=0,this._expandedLength=0,!this._onInputEntity){this._inputMap=bt(t);return}let r=bt(t),n=Object.create(null);for(let[s,i]of Object.entries(r))this._applyRegistrationHook(this._onInputEntity,s,i,"input")&&(n[s]=i);this._inputMap=n}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=t===1.1?1.1:1}decode(t){if(typeof t!="string"||t.length===0||t.indexOf("&")===-1)return t;let r=t,n=[],s=t.length,i=0,o=0,d=this._maxTotalExpansions>0,l=this._maxExpandedLength>0,c=d||l;for(;o<s;){if(t.charCodeAt(o)!==38){o++;continue}let A=o+1;for(;A<s&&t.charCodeAt(A)!==59&&A-o<=32;)A++;if(A>=s||t.charCodeAt(A)!==59){o++;continue}let h=t.slice(o+1,A);if(h.length===0){o++;continue}let f,b;if(this._removeSet.has(h))f="",b===void 0&&(b=De);else if(this._leaveSet.has(h)){o++;continue}else if(h.charCodeAt(0)===35){let y=this._resolveNCR(h);if(y===void 0){o++;continue}f=y,b=nr}else{let y=this._resolveName(h);f=y?.value,b=y?.tier}if(f===void 0){o++;continue}if(o>i&&n.push(t.slice(i,o)),n.push(f),i=A+1,o=i,c&&this._tierCounts(b)){if(d&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(l){let y=f.length-(h.length+2);if(y>0&&(this._expandedLength+=y,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}i<s&&n.push(t.slice(i));let m=n.length===0?t:n.join("");return this._postCheck(m,r)}_tierCounts(t){return this._limitTiers.has(an)?!0:this._limitTiers.has(t)}_resolveName(t){if(t in this._inputMap)return{value:this._inputMap[t],tier:De};if(t in this._externalMap)return{value:this._externalMap[t],tier:De};if(t in this._baseMap)return{value:this._baseMap[t],tier:nr}}_classifyNCR(t){return t===0?this._ncrNullLevel:t>=55296&&t<=57343||this._ncrXmlVersion===1&&t>=1&&t<=31&&!qo.has(t)?te.remove:-1}_applyNCRAction(t,r,n){switch(t){case te.allow:return String.fromCodePoint(n);case te.remove:return"";case te.leave:return;case te.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${r}; (U+${n.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(n)}}_resolveNCR(t){let r=t.charCodeAt(1),n;if(r===120||r===88?n=parseInt(t.slice(2),16):n=parseInt(t.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;let s=this._classifyNCR(n);if(!this._numericAllowed&&s<te.remove)return;let i=s===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,s);return this._applyNCRAction(i,t,n)}};var Os=e=>ft.includes(e)?"__"+e:e,tc={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0,unicode:!1},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Os};function rc(e,t){if(typeof e!="string")return;let r=e.toLowerCase();if(ft.some(n=>r===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);if(tr.some(n=>r===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function vs(e,t){return typeof e=="boolean"?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof e=="object"&&e!==null?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??1e3),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null,appliesTo:e.appliesTo??"all"}:vs(!0)}var ks=function(e){let t=Object.assign({},tc,e),r=[{value:t.attributeNamePrefix,name:"attributeNamePrefix"},{value:t.attributesGroupName,name:"attributesGroupName"},{value:t.textNodeName,name:"textNodeName"},{value:t.cdataPropName,name:"cdataPropName"},{value:t.commentPropName,name:"commentPropName"}];for(let{value:n,name:s}of r)n&&rc(n,s);return t.onDangerousProperty===null&&(t.onDangerousProperty=Os),t.processEntities=vs(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(n=>typeof n=="string"&&n.startsWith("*.")?".."+n.substring(2):n)),t};var Be;typeof Symbol!="function"?Be="@@xmlMetadata":Be=Symbol("XML Node Metadata");var re=class{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:r})}addChild(t,r){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),this.addStartIndex(r)}addStartIndex(t){t!==void 0&&(this.child[this.child.length-1][Be]={startIndex:t})}addEndIndex(t){let r=this.child[this.child.length-1];r!==void 0&&r[Be]!==void 0&&r[Be].endIndex===void 0&&(r[Be].endIndex=t)}static getMetaDataSymbol(){return Be}};var Ds=":A-Za-z_\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",nc=Ds+"\\-\\.\\d\xB7\u0300-\u036F\u203F-\u2040",Bs=":A-Za-z_\xC0-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",sc=Bs+"\\-\\.\\d\xB7\u0300-\u036F\u0487\u203F-\u2040",on=(e,t,r="")=>{let n=e.replace(":",""),s=t.replace(":",""),i=`[${n}][${s}]*`;return{name:new RegExp(`^[${e}][${t}]*$`,r),ncName:new RegExp(`^${i}$`,r),qName:new RegExp(`^${i}(?::${i})?$`,r),nmToken:new RegExp(`^[${t}]+$`,r),nmTokens:new RegExp(`^[${t}]+(?:\\s+[${t}]+)*$`,r)}},ic=on(Ds,nc),ac=on(Bs,sc,"u"),Ps=":A-Za-z_",oc=Ps+"\\-\\.\\d",cc=on(Ps,oc),lc=(e="1.0",t=!1)=>t?cc:e==="1.1"?ac:ic;var cn=(e,{xmlVersion:t="1.0",asciiOnly:r=!1}={})=>lc(t,r).qName.test(e);var It=class{constructor(t,r){this.suppressValidationErr=!t,this.options=t,this.xmlVersion=r||1}setXmlVersion(t=1){this.xmlVersion=t}readDocType(t,r){let n=Object.create(null),s=0;if(t[r+3]==="O"&&t[r+4]==="C"&&t[r+5]==="T"&&t[r+6]==="Y"&&t[r+7]==="P"&&t[r+8]==="E"){r=r+9;let i=1,o=!1,d=!1,l=null,c="";for(;r<t.length;r++){if(l!==null){t[r]===l&&(l=null),c+=t[r];continue}if(!o&&!d&&(t[r]==='"'||t[r]==="'")){l=t[r],c+=t[r];continue}if(t[r]==="<"&&!d){if(o&&Pe(t,"!ENTITY",r)){r+=7;let m,A;if([m,A,r]=this.readEntityExp(t,r+1,this.suppressValidationErr),A.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&s>=this.options.maxEntityCount)throw new Error(`Entity count (${s+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[m]=A,s++}}else if(o&&Pe(t,"!ELEMENT",r)){r+=8;let{index:m}=this.readElementExp(t,r+1);r=m}else if(o&&Pe(t,"!ATTLIST",r))r+=8;else if(o&&Pe(t,"!NOTATION",r)){r+=9;let{index:m}=this.readNotationExp(t,r+1,this.suppressValidationErr);r=m}else if(Pe(t,"!--",r))d=!0;else throw new Error("Invalid DOCTYPE");i++,c=""}else if(t[r]===">"){if(d?t[r-1]==="-"&&t[r-2]==="-"&&(d=!1,i--):i--,i===0)break}else t[r]==="["?o=!0:c+=t[r]}if(l!==null||i!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:n,i:r}}readEntityExp(t,r){r=ne(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r])&&t[r]!=='"'&&t[r]!=="'";)r++;let s=t.substring(n,r);if(Ct(s,{xmlVersion:this.xmlVersion}),r=ne(t,r),!this.suppressValidationErr){if(t.substring(r,r+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[r]==="%")throw new Error("Parameter entities are not supported")}let i="";if([r,i]=this.readIdentifierVal(t,r,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&i.length>this.options.maxEntitySize)throw new Error(`Entity "${s}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return r--,[s,i,r]}readNotationExp(t,r){r=ne(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;let s=t.substring(n,r);!this.suppressValidationErr&&Ct(s,{xmlVersion:this.xmlVersion}),r=ne(t,r);let i=t.substring(r,r+6).toUpperCase();if(!this.suppressValidationErr&&i!=="SYSTEM"&&i!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${i}"`);r+=i.length,r=ne(t,r);let o=null,d=null;if(i==="PUBLIC")[r,o]=this.readIdentifierVal(t,r,"publicIdentifier"),r=ne(t,r),(t[r]==='"'||t[r]==="'")&&([r,d]=this.readIdentifierVal(t,r,"systemIdentifier"));else if(i==="SYSTEM"&&([r,d]=this.readIdentifierVal(t,r,"systemIdentifier"),!this.suppressValidationErr&&!d))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:o,systemIdentifier:d,index:--r}}readIdentifierVal(t,r,n){let s="",i=t[r];if(i!=='"'&&i!=="'")throw new Error(`Expected quoted string, found "${i}"`);r++;let o=r;for(;r<t.length&&t[r]!==i;)r++;if(s=t.substring(o,r),t[r]!==i)throw new Error(`Unterminated ${n} value`);return r++,[r,s]}readElementExp(t,r){r=ne(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;let s=t.substring(n,r);if(!this.suppressValidationErr&&!cn(s,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid element name: "${s}"`);r=ne(t,r);let i="";if(t[r]==="E"&&Pe(t,"MPTY",r))r+=4;else if(t[r]==="A"&&Pe(t,"NY",r))r+=2;else if(t[r]==="("){r++;let o=r;for(;r<t.length&&t[r]!==")";)r++;if(i=t.substring(o,r),t[r]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[r]}"`);return{elementName:s,contentModel:i.trim(),index:r}}readAttlistExp(t,r){r=ne(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;let s=t.substring(n,r);for(Ct(s,{xmlVersion:this.xmlVersion}),r=ne(t,r),n=r;r<t.length&&!/\s/.test(t[r]);)r++;let i=t.substring(n,r);if(!Ct(i,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid attribute name: "${i}"`);r=ne(t,r);let o="";if(t.substring(r,r+8).toUpperCase()==="NOTATION"){if(o="NOTATION",r+=8,r=ne(t,r),t[r]!=="(")throw new Error(`Expected '(', found "${t[r]}"`);r++;let l=[];for(;r<t.length&&t[r]!==")";){let c=r;for(;r<t.length&&t[r]!=="|"&&t[r]!==")";)r++;let m=t.substring(c,r);if(m=m.trim(),!Ct(m,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid notation name: "${m}"`);l.push(m),t[r]==="|"&&(r++,r=ne(t,r))}if(t[r]!==")")throw new Error("Unterminated list of notations");r++,o+=" ("+l.join("|")+")"}else{let l=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;o+=t.substring(l,r);let c=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!c.includes(o.toUpperCase()))throw new Error(`Invalid attribute type: "${o}"`)}r=ne(t,r);let d="";return t.substring(r,r+8).toUpperCase()==="#REQUIRED"?(d="#REQUIRED",r+=8):t.substring(r,r+7).toUpperCase()==="#IMPLIED"?(d="#IMPLIED",r+=7):[r,d]=this.readIdentifierVal(t,r,"ATTLIST"),{elementName:s,attributeName:i,attributeType:o,defaultValue:d,index:r}}},ne=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function Pe(e,t,r){for(let n=0;n<t.length;n++)if(t[n]!==e[r+n+1])return!1;return!0}function Ct(e,t){if(cn(e,{xmlVersion:t}))return e;throw new Error(`Invalid entity name ${e}`)}var dc=[48,1632,1776,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,65296,120782,120792,120802,120812,120822,66720,68912,69734,69872,69942,70096,70384,70736,70864,71248,71360,71472,71904,72016,72688,72784,73040,73120,73552,92768,92864,93008,123200,123632,124144,125264,130032],sr=255,ir=new Map,Ms=65535,Us=1632,qe=Us,uc=Ms-Us+1,ar=new Uint8Array(uc).fill(sr);for(let e of dc)for(let t=0;t<10;t++){let r=e+t;r<=Ms?ar[r-qe]=t:ir.set(r,t)}var Fs=48,Hs=57,Qs=45,or=new Set([8722,65293,65123]);function Ac(e){if(typeof e!="string")return e;let t=e.length;if(t===0)return e;let r=-1;for(let s=0;s<t;s++){let i=e.charCodeAt(s);if(!(i>=Fs&&i<=Hs||i===Qs)){if(i<qe){if(or.has(i)){r=s;break}continue}if(i>=55296&&i<=56319){if(s+1<t){let o=e.charCodeAt(s+1);if(o>=56320&&o<=57343){let d=65536+(i-55296<<10)+(o-56320);if(ir.has(d)){r=s;break}}}continue}if(ar[i-qe]!==sr||or.has(i)){r=s;break}}}if(r===-1)return e;let n=[];r>0&&n.push(e.slice(0,r));for(let s=r;s<t;s++){let i=e.charCodeAt(s);if(i>=Fs&&i<=Hs||i===Qs){n.push(e[s]);continue}if(i<qe){n.push(or.has(i)?"-":e[s]);continue}if(i>=55296&&i<=56319){if(s+1<t){let d=e.charCodeAt(s+1);if(d>=56320&&d<=57343){let l=65536+(i-55296<<10)+(d-56320),c=ir.get(l);if(c!==void 0){n.push(String.fromCharCode(c+48)),s++;continue}}}n.push(e[s]);continue}if(or.has(i)){n.push("-");continue}let o=ar[i-qe];n.push(o!==sr?String.fromCharCode(o+48):e[s])}return n.join("")}var Ys=Ac;var pc=/^[-+]?0x[a-fA-F0-9]+$/,hc=/^0b[01]+$/,gc=/^0o[0-7]+$/,mc=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,fc={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original",unicode:!1};function dn(e,t={}){if(t=Object.assign({},fc,t),!e||typeof e!="string")return e;let r=e.trim();if(r.length===0)return e;if(t.skipLike!==void 0&&t.skipLike.test(r))return e;if(r==="0"||t.unicode&&(r=Ys(r),r==="0"))return 0;if(t.hex&&pc.test(r))return ln(r,16);if(t.binary&&hc.test(r))return ln(r,2);if(t.octal&&gc.test(r))return ln(r,8);if(isFinite(r)){if(r.includes("e")||r.includes("E"))return Tc(e,r,t);{let n=mc.exec(r);if(n){let s=n[1]||"",i=n[2],o=bc(n[3]),d=s?r[i.length+1]===".":r[i.length]===".";if(!t.leadingZeros&&(i.length>1||i.length===1&&!d))return e;{let l=Number(r),c=String(l);if(l===0)return l;if(c.search(/[eE]/)!==-1)return t.eNotation?l:e;if(r.indexOf(".")!==-1)return c==="0"||c===o||c===`${s}${o}`?l:e;let m=i?o:r;return i?m===c||s+m===c?l:e:m===c||m===s+c?l:e}}else return e}}else{let n=Number(r);return Number.isNaN(n)?e:Cc(e,n,t)}}var Ec=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Tc(e,t,r){if(!r.eNotation)return e;let n=t.match(Ec);if(n){let s=n[1]||"",i=n[3].indexOf("e")===-1?"E":"e",o=n[2],d=s?t[o.length+1]===i:t[o.length]===i;return o.length>1&&d?e:o.length===1&&(n[3].startsWith(`.${i}`)||n[3][0]===i)?Number(t):o.length>0?r.leadingZeros&&!d?Number(t):e:Number(t)}else return e}function bc(e){if(e&&e.indexOf(".")!==-1){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e=e.slice(0,t),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1)),e}return e}function ln(e,t){let r=e.trim();if((t===2||t===8)&&(e=r.substring(2)),parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Cc(e,t,r){let n=t===1/0;switch(r.infinity.toLowerCase()){case"null":return null;case"infinity":return t;case"string":return n?"Infinity":"-Infinity";case"original":default:return e}}function un(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(let r of e)if(typeof r=="string"&&t===r||r instanceof RegExp&&r.test(t))return!0}:()=>!1}var Me=class{constructor(t,r={},n){this.pattern=t,this.separator=r.separator||".",this.segments=this._parse(t),this.data=n,this._hasDeepWildcard=this.segments.some(s=>s.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(s=>s.attrName!==void 0),this._hasPositionSelector=this.segments.some(s=>s.position!==void 0)}_parse(t){let r=[],n=0,s="";for(;n<t.length;)t[n]===this.separator?n+1<t.length&&t[n+1]===this.separator?(s.trim()&&(r.push(this._parseSegment(s.trim())),s=""),r.push({type:"deep-wildcard"}),n+=2):(s.trim()&&r.push(this._parseSegment(s.trim())),s="",n++):(s+=t[n],n++);return s.trim()&&r.push(this._parseSegment(s.trim())),r}_parseSegment(t){let r={type:"tag"},n=null,s=t,i=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(i&&(s=i[1]+i[3],i[2])){let m=i[2].slice(1,-1);m&&(n=m)}let o,d=s;if(s.includes("::")){let m=s.indexOf("::");if(o=s.substring(0,m).trim(),d=s.substring(m+2).trim(),!o)throw new Error(`Invalid namespace in pattern: ${t}`)}let l,c=null;if(d.includes(":")){let m=d.lastIndexOf(":"),A=d.substring(0,m).trim(),h=d.substring(m+1).trim();["first","last","odd","even"].includes(h)||/^nth\(\d+\)$/.test(h)?(l=A,c=h):l=d}else l=d;if(!l)throw new Error(`Invalid segment pattern: ${t}`);if(r.tag=l,o&&(r.namespace=o),n)if(n.includes("=")){let m=n.indexOf("=");r.attrName=n.substring(0,m).trim(),r.attrValue=n.substring(m+1).trim()}else r.attrName=n.trim();if(c){let m=c.match(/^nth\((\d+)\)$/);m?(r.position="nth",r.positionValue=parseInt(m[1],10)):r.position=c}return r}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}};var et=class{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._deepByTerminalTag=new Map,this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard()){let i=t.segments[t.segments.length-1];if(i&&i.type!=="deep-wildcard"&&i.tag!=="*"){let o=i.tag;this._deepByTerminalTag.has(o)||this._deepByTerminalTag.set(o,[]),this._deepByTerminalTag.get(o).push(t)}else this._deepWildcards.push(t);return this}let r=t.length,s=t.segments[t.segments.length-1]?.tag;if(!s||s==="*")this._wildcardByDepth.has(r)||this._wildcardByDepth.set(r,[]),this._wildcardByDepth.get(r).push(t);else{let i=`${r}:${s}`;this._byDepthAndTag.has(i)||this._byDepthAndTag.set(i,[]),this._byDepthAndTag.get(i).push(t)}return this}addAll(t){for(let r of t)this.add(r);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return this.findMatch(t)!==null}findMatch(t){let r=t.getDepth(),n=t.getCurrentTag(),s=`${r}:${n}`,i=this._byDepthAndTag.get(s);if(i){for(let l=0;l<i.length;l++)if(t.matches(i[l]))return i[l]}let o=this._wildcardByDepth.get(r);if(o){for(let l=0;l<o.length;l++)if(t.matches(o[l]))return o[l]}let d=this._deepByTerminalTag.get(n);if(d){for(let l=0;l<d.length;l++)if(t.matches(d[l]))return d[l]}for(let l=0;l<this._deepWildcards.length;l++)if(t.matches(this._deepWildcards[l]))return this._deepWildcards[l];return null}};var An=class{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){let t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){let t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){let r=this._matcher.path;if(r.length!==0)return r[r.length-1].values?.[t]}hasAttr(t){let r=this._matcher.path;if(r.length===0)return!1;let n=r[r.length-1];return n.values!==void 0&&t in n.values}getAnyParentAttr(t){return this._matcher.getAnyParentAttr(t)}hasAnyParentAttr(t){return this._matcher.hasAnyParentAttr(t)}getPosition(){let t=this._matcher.path;return t.length===0?-1:t[t.length-1].position??0}getCounter(){let t=this._matcher.path;return t.length===0?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,r=!0){return this._matcher.toString(t,r)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}},tt=class{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new An(this),this._keptAttrs=[]}push(t,r=null,n=null,s=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let i=this.path.length,o=this.siblingStacks[i];o||(o={counts:new Map,total:0},this.siblingStacks[i]=o);let d=n?`${n}:${t}`:t,l=o.counts.get(d)||0,c=o.total;o.counts.set(d,l+1),o.total++;let m={tag:t,position:c,counter:l};n!=null&&(m.namespace=n),r!=null&&(m.values=r),this.path.push(m);let A=this.path.length,h=s!==null?s.keep:null;if(h!=null&&h.length>0&&r)for(let f=0;f<h.length;f++){let b=h[f];r[b]!==void 0&&this._keptAttrs.push({depth:A,name:b,value:r[b]})}}pop(){if(this.path.length===0)return;this._pathStringCache=null;let t=this.path.pop();this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1);let r=this.path.length+1;for(;this._keptAttrs.length>0&&this._keptAttrs[this._keptAttrs.length-1].depth>=r;)this._keptAttrs.pop();return t}updateCurrent(t){if(this.path.length>0){let r=this.path[this.path.length-1];t!=null&&(r.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(this.path.length!==0)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(this.path.length===0)return!1;let r=this.path[this.path.length-1];return r.values!==void 0&&t in r.values}getAnyParentAttr(t){let r=this._keptAttrs;for(let n=r.length-1;n>=0;n--)if(r[n].name===t)return r[n].value}hasAnyParentAttr(t){let r=this._keptAttrs;for(let n=r.length-1;n>=0;n--)if(r[n].name===t)return!0;return!1}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,r=!0){let n=t||this.separator;if(n===this.separator&&r===!0){if(this._pathStringCache!==null)return this._pathStringCache;let i=this.path.map(o=>o.namespace?`${o.namespace}:${o.tag}`:o.tag).join(n);return this._pathStringCache=i,i}return this.path.map(i=>r&&i.namespace?`${i.namespace}:${i.tag}`:i.tag).join(n)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[],this._keptAttrs=[]}matches(t){let r=t.segments;return r.length===0?!1:t.hasDeepWildcard()?this._matchWithDeepWildcard(r):this._matchSimple(r)}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let r=0;r<t.length;r++)if(!this._matchSegment(t[r],this.path[r],r===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let r=this.path.length-1,n=t.length-1;for(;n>=0&&r>=0;){let s=t[n];if(s.type==="deep-wildcard"){if(n--,n<0)return!0;let i=t[n],o=!1;for(let d=r;d>=0;d--)if(this._matchSegment(i,this.path[d],d===this.path.length-1)){r=d-1,n--,o=!0;break}if(!o)return!1}else{if(!this._matchSegment(s,this.path[r],r===this.path.length-1))return!1;r--,n--}}return n<0}_matchSegment(t,r,n){if(t.tag!=="*"&&t.tag!==r.tag||t.namespace!==void 0&&t.namespace!=="*"&&t.namespace!==r.namespace||t.attrName!==void 0&&(!n||!r.values||!(t.attrName in r.values)||t.attrValue!==void 0&&String(r.values[t.attrName])!==String(t.attrValue)))return!1;if(t.position!==void 0){if(!n)return!1;let s=r.counter??0;if(t.position==="first"&&s!==0)return!1;if(t.position==="odd"&&s%2!==1)return!1;if(t.position==="even"&&s%2!==0)return!1;if(t.position==="nth"&&s!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>t&&{counts:new Map(t.counts),total:t.total}),keptAttrs:this._keptAttrs.map(t=>({...t}))}}restore(t){this._pathStringCache=null,this.path=t.path.map(r=>({...r})),this.siblingStacks=t.siblingStacks.map(r=>r&&{counts:new Map(r.counts),total:r.total}),this._keptAttrs=(t.keptAttrs||[]).map(r=>({...r}))}readOnly(){return this._view}};var Ic=[{id:"html-script-open",description:"<script opening tag",pattern:/<script[\s>/]/i},{id:"html-script-close",description:"</script closing tag",pattern:/<\/script[\s>]/i},{id:"html-javascript-protocol",description:"javascript: URI scheme (with optional whitespace/encoding)",pattern:/j[\t\n\r ]*a[\t\n\r ]*v[\t\n\r ]*a[\t\n\r ]*s[\t\n\r ]*c[\t\n\r ]*r[\t\n\r ]*i[\t\n\r ]*p[\t\n\r ]*t[\t\n\r ]*:/i},{id:"html-vbscript-protocol",description:"vbscript: URI scheme",pattern:/vbscript[\t\n\r ]*:/i},{id:"html-data-html",description:"data:text/html URI \u2014 can execute scripts in browsers",pattern:/data[\t\n\r ]*:[\t\n\r ]*text\/html/i},{id:"html-data-xhtml",description:"data:application/xhtml+xml URI",pattern:/data[\t\n\r ]*:[\t\n\r ]*application\/xhtml/i},{id:"html-data-svg",description:"data:image/svg+xml URI \u2014 can execute scripts",pattern:/data[\t\n\r ]*:[\t\n\r ]*image\/svg\+xml/i},{id:"html-inline-event-handler",description:"Inline event handler attributes: onclick=, onerror=, onload=, etc.",pattern:/\bon\w{1,30}\s*=/i},{id:"html-entity-obfuscated-script",description:"HTML-entity-encoded <script (e.g. &#x3C;script or &lt;script)",pattern:/(?:&#x0*3[Cc];?|&#0*60;?|&lt;)\s*script/i},{id:"html-entity-obfuscated-javascript",description:'HTML-entity-encoded javascript: (partial \u2014 catches common &#106; or &#x6a; for "j")',pattern:/(?:&#x0*6[Aa];?|&#0*106;?)\s*(?:&#x0*61;?|a)[\s\S]{0,80}script\s*:/i},{id:"html-style-expression",description:"CSS expression() \u2014 IE-era code execution in style attributes",pattern:/style[\s\S]{0,20}expression\s*\(/i},{id:"html-object-embed",description:"<object or <embed tags that can load active content",pattern:/<(?:object|embed)[\s>/]/i},{id:"html-base-tag",description:"<base href= \u2014 can hijack all relative URLs on a page",pattern:/<base[\s>]/i},{id:"html-meta-refresh",description:'<meta http-equiv="refresh" \u2014 can redirect users',pattern:/<meta[\s\S]{0,40}http-equiv[\s\S]{0,20}refresh/i},{id:"html-srcdoc",description:"srcdoc= attribute on iframes \u2014 embeds HTML that can run scripts",pattern:/srcdoc\s*=/i},{id:"html-iframe",description:"<iframe tag",pattern:/<iframe[\s>/]/i},{id:"html-form",description:"<form tag \u2014 can be used for phishing / credential harvesting injection",pattern:/<form[\s>/]/i}],Ue=Ic;var yc=[{id:"xml-cdata-injection",description:"CDATA section injection: <![CDATA[ breaks out of text node context",pattern:/<!\[CDATA\[/i},{id:"xml-cdata-close",description:"CDATA close sequence: ]]> can terminate an enclosing CDATA section",pattern:/\]\]>/},{id:"xml-processing-instruction",description:"XML processing instruction: <?xml-stylesheet or <?php etc.",pattern:/<\?(?:xml[\- ]|php|asp)/i},{id:"xml-doctype-injection",description:"DOCTYPE declaration embedded in content \u2014 can define entities",pattern:/<!DOCTYPE(?:[\s[]|$)/i},{id:"xml-entity-system",description:"SYSTEM keyword \u2014 used in external entity declarations (XXE)",pattern:/\bSYSTEM\s+["']/i},{id:"xml-entity-public",description:"PUBLIC keyword \u2014 used in external entity declarations (XXE)",pattern:/\bPUBLIC\s+["']/i},{id:"xml-entity-declaration",description:"<!ENTITY declaration \u2014 defines entities, potential XXE or entity expansion",pattern:/<!ENTITY[\s%]/i},{id:"xml-billion-laughs",description:"Entity reference chaining / billion laughs: repeated &eX; style references",pattern:/(?:&\w{1,20};){3,}/},{id:"xml-namespace-confusion",description:"xmlns: attribute injection \u2014 can redefine namespaces to confuse parsers",pattern:/\bxmlns(?::\w{1,40})?\s*=/i},{id:"xml-comment-injection",description:"<!-- comment injection \u2014 can hide content from some parsers",pattern:/<!--/},{id:"xml-comment-close",description:"--> closes an enclosing XML comment",pattern:/-->/},{id:"xml-pi-close",description:"?> closes an enclosing processing instruction",pattern:/\?>/}],Fe=yc;var wc=[{id:"svg-script-element",description:"<script element inside SVG executes JavaScript",pattern:/<script[\s>/]/i},{id:"svg-xlink-href-javascript",description:"xlink:href with javascript: \u2014 classic SVG XSS via <a> or <use>",pattern:/xlink\s*:\s*href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-href-javascript",description:"href= with javascript: in SVG context (<a>, <animate>, etc.)",pattern:/href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-foreignobject",description:"<foreignObject embeds HTML inside SVG \u2014 can execute scripts",pattern:/<foreignObject[\s>/]/i},{id:"svg-use-external",description:"<use xlink:href or href pointing to external resource (non-fragment URL)",pattern:/<use[\s\S]{0,60}(?:xlink\s*:\s*)?href\s*=\s*(?:["'][^#]|[^"'#\s>])/i},{id:"svg-animate-href",description:'<animate attributeName="href" \u2014 can dynamically change href to javascript:',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*href["']/i},{id:"svg-animate-xlinkhref",description:'<animate attributeName="xlink:href"',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*xlink\s*:\s*href["']/i},{id:"svg-set-javascript",description:'<set to="javascript:..." \u2014 sets an attribute to a javascript: URI',pattern:/<set[\s\S]{0,80}to\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-event-handler",description:"SVG-specific event handler attributes: onload=, onerror=, onactivate=, etc.",pattern:/\bon(?:load|error|activate|begin|end|repeat|focus|blur|click|mouse\w{1,20}|key\w{1,20})\s*=/i},{id:"svg-handler-generic",description:"Generic on* handler catch-all for SVG attributes",pattern:/\bon\w{1,30}\s*=/i},{id:"svg-filter-feimage",description:"<feImage href= \u2014 filter primitive that can load external resources",pattern:/<feImage[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=/i},{id:"svg-image-external",description:"<image xlink:href with http/https or javascript protocol",pattern:/<image[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=\s*["']?\s*(?:https?|javascript)\s*:/i},{id:"svg-style-javascript",description:"style= attribute containing javascript: (e.g. background:url(javascript:...))",pattern:/style\s*=[\s\S]{0,60}javascript\s*:/i}],cr=wc;var xc=[{id:"sql-block-comment-open",description:"SQL block comment open: /* ... */ \u2014 unusual in legitimate user text",pattern:/\/\*/},{id:"sql-union-select",description:"UNION SELECT \u2014 most common SQL injection aggregation attack",pattern:/\bUNION\s{1,20}(?:ALL\s{1,20})?SELECT\b/i},{id:"sql-drop-table",description:"DROP TABLE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}TABLE\b/i},{id:"sql-drop-database",description:"DROP DATABASE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}DATABASE\b/i},{id:"sql-insert-into",description:"INSERT INTO \u2014 data injection",pattern:/\bINSERT\s{1,20}INTO\b/i},{id:"sql-delete-from",description:"DELETE FROM \u2014 data deletion injection",pattern:/\bDELETE\s{1,20}FROM\b/i},{id:"sql-update-set",description:"UPDATE ... SET \u2014 data modification injection",pattern:/\bUPDATE\b[\s\S]{1,60}\bSET\b/i},{id:"sql-exec-xp",description:"EXEC xp_ \u2014 MSSQL extended stored procedure execution",pattern:/\bEXEC(?:UTE)?\s{1,20}xp_/i},{id:"sql-tautology-string",description:`Classic string tautology: ' OR '1'='1 or " OR "1"="1"`,pattern:/'\s{0,10}OR\s{0,10}'[^']{0,20}'\s*=\s*'[^']{0,20}/i},{id:"sql-tautology-numeric",description:"Numeric tautology: OR 1=1",pattern:/\bOR\s{1,10}1\s*=\s*1\b/i},{id:"sql-always-true-zero",description:"Numeric tautology: OR 0=0",pattern:/\bOR\s{1,10}0\s*=\s*0\b/i},{id:"sql-sleep-benchmark",description:"Time-based blind injection: SLEEP() or BENCHMARK()",pattern:/\b(?:SLEEP|BENCHMARK)\s*\(/i},{id:"sql-waitfor-delay",description:"MSSQL time-based blind injection: WAITFOR DELAY",pattern:/\bWAITFOR\s{1,20}DELAY\b/i},{id:"sql-char-function",description:"CHAR() function \u2014 used to obfuscate injected strings",pattern:/\bCHAR\s*\(\s*\d{1,3}/i},{id:"sql-information-schema",description:"INFORMATION_SCHEMA \u2014 reconnaissance query for table/column enumeration",pattern:/\bINFORMATION_SCHEMA\b/i}],yt=xc;var Sc=[{id:"shell-path-traversal-unix",description:"Unix path traversal: ../ \u2014 climbing the directory tree",pattern:/\.\.\//},{id:"shell-path-traversal-windows",description:"Windows path traversal: ..\\ \u2014 climbing the directory tree",pattern:/\.\.\\/},{id:"shell-path-traversal-encoded",description:"URL-encoded path traversal: %2e%2e or %2f variants",pattern:/%2e%2e|%2f\.\.|\.\.%2f/i},{id:"shell-null-byte",description:"Null byte injection: \\x00 or %00 \u2014 truncates strings in C-backed functions",pattern:/\x00|%00/},{id:"shell-semicolon",description:"Semicolon command separator: cmd1; cmd2",pattern:/;/},{id:"shell-pipe",description:"Pipe operator: cmd1 | cmd2",pattern:/\|/},{id:"shell-and-operator",description:"AND operator: cmd1 && cmd2",pattern:/&&/},{id:"shell-or-operator",description:"OR operator: cmd1 || cmd2",pattern:/\|\|/},{id:"shell-backtick",description:"Backtick command substitution: `cmd`",pattern:/`/},{id:"shell-dollar-paren",description:"Dollar-paren command substitution: $(cmd)",pattern:/\$\(/},{id:"shell-dollar-brace",description:"Dollar-brace variable expansion: ${var} \u2014 can be abused for injection",pattern:/\$\{/},{id:"shell-redirect-out",description:"Output redirection: cmd > file or cmd >> file",pattern:/>{1,2}/},{id:"shell-redirect-in",description:"Input redirection: cmd < file",pattern:/</},{id:"shell-newline-injection",description:"Newline injection: \\n or \\r \u2014 can inject new shell commands",pattern:/[\n\r]/},{id:"shell-glob-star",description:"Glob expansion: * or ? \u2014 can expand to unintended files",pattern:/[/\\][*?]/},{id:"shell-absolute-root",description:"Absolute root path injection: string starting with / or \\ (Windows UNC)",pattern:/^(?:\/|\\\\)/},{id:"shell-windows-drive",description:"Windows drive letter path injection: C:\\ or D:/",pattern:/^[a-zA-Z]:[/\\]/},{id:"shell-curl-wget",description:"curl/wget with URL or flags \u2014 can exfiltrate data or download payloads",pattern:/\b(?:curl|wget)\s+(?:https?:\/\/|ftp:\/\/|-)/i}],pn=Sc;var Nc=[{id:"redos-nested-quantifier-plus",description:"Nested + quantifier inside a group with outer quantifier: (a+)+, (.+b)*, etc.",pattern:/\([^)]*\+[^)]*\)[+*]/},{id:"redos-nested-quantifier-star",description:"Nested * quantifier: (a*)* or (a*)+ \u2014 catastrophic backtracking",pattern:/\([^)]*\*[^)]*\)[*+]/},{id:"redos-nested-groups",description:"Doubly nested quantified groups: ((a+)+) \u2014 guaranteed catastrophic",pattern:/\(\([^)]{0,40}\)[+*]\)[+*]/},{id:"redos-alternation-overlap",description:"Overlapping alternation under quantifier: (a|a)+ \u2014 ambiguous NFA paths",pattern:/\(([^|()]{1,20})\|(?:\1)(?:\|[^|()]{1,20}){0,5}\)[+*?]{1,2}/},{id:"redos-star-plus-concat",description:"(x*x)+ pattern \u2014 triggers super-linear backtracking",pattern:/\([^)]{0,10}\*[^)]{0,10}\)[+*]/},{id:"redos-dot-star-greedy",description:"(.*){n,} or (.+){n,} \u2014 repeated greedy dot quantifiers",pattern:/\(\.[*+]\)\{?\d/},{id:"redos-large-repetition",description:"Very large fixed or range repetition count {1000,} or {1000,n} \u2014 denial of service via backtracking",pattern:/\{\d{4,}(?:,\d*)?\}/},{id:"redos-catastrophic-alternation",description:"Long alternation with many similar branches \u2014 polynomial backtracking risk",pattern:/\([^)]{0,200}(?:\|[^|)]{0,50}){9,}\)/}],hn=Nc;var ae=`["'\\s]*:`,_c=[{id:"nosql-where-operator",description:"$where \u2014 executes arbitrary JavaScript server-side in MongoDB",pattern:new RegExp(`\\$where${ae}`,"i")},{id:"nosql-ne-operator",description:'$ne \u2014 "not equal" operator used to bypass equality checks',pattern:new RegExp(`\\$ne${ae}`,"i")},{id:"nosql-gt-operator",description:'$gt \u2014 "greater than" used to bypass password/value checks',pattern:new RegExp(`\\$gte?${ae}`,"i")},{id:"nosql-lt-operator",description:'$lt / $lte \u2014 "less than" bypass variants',pattern:new RegExp(`\\$lte?${ae}`,"i")},{id:"nosql-regex-operator",description:"$regex \u2014 can be used to extract data character by character (blind injection)",pattern:new RegExp(`\\$regex${ae}`,"i")},{id:"nosql-or-operator",description:"$or \u2014 logical OR; used to create always-true conditions",pattern:new RegExp(`\\$or${ae}\\s*\\[`,"i")},{id:"nosql-and-operator",description:"$and \u2014 logical AND operator injection",pattern:new RegExp(`\\$and${ae}\\s*\\[`,"i")},{id:"nosql-nor-operator",description:"$nor \u2014 logical NOR operator injection",pattern:new RegExp(`\\$nor${ae}\\s*\\[`,"i")},{id:"nosql-exists-operator",description:"$exists \u2014 can enumerate fields to determine schema",pattern:new RegExp(`\\$exists${ae}`,"i")},{id:"nosql-in-operator",description:"$in \u2014 matches any value in a list; can enumerate values",pattern:new RegExp(`\\$in${ae}\\s*\\[`,"i")},{id:"nosql-expr-operator",description:"$expr \u2014 allows aggregation expressions in queries (MongoDB 3.6+)",pattern:new RegExp(`\\$expr${ae}`,"i")},{id:"nosql-function-operator",description:"$function \u2014 executes arbitrary JavaScript in MongoDB 4.4+",pattern:new RegExp(`\\$function${ae}`,"i")},{id:"nosql-accumulator-operator",description:"$accumulator \u2014 custom aggregation with arbitrary JS execution",pattern:new RegExp(`\\$accumulator${ae}`,"i")},{id:"nosql-proto-pollution",description:"__proto__ \u2014 prototype pollution via object key injection",pattern:/__proto__/},{id:"nosql-constructor-prototype",description:"constructor.prototype \u2014 alternative prototype pollution vector (dot notation or JSON key)",pattern:/constructor[\s"':.,{\[]*prototype/i},{id:"nosql-proto-bracket",description:'["__proto__"] \u2014 bracket-notation prototype pollution',pattern:/\[["']__proto__["']\]/}],gn=_c;var Rc=[{id:"log-crlf-injection",description:"CRLF injection: literal \\r or \\n embeds fake log lines",pattern:/[\r\n]/},{id:"log-url-encoded-crlf",description:"URL-encoded CRLF: %0d, %0a, %0D, %0A \u2014 decoded by some log parsers",pattern:/%0[dDaA]/},{id:"log-unicode-newline",description:"Unicode newline variants: U+2028 (line separator), U+2029 (paragraph separator)",pattern:/[\u2028\u2029]/},{id:"log-log4shell-jndi",description:"Log4Shell: ${jndi:...} triggers remote code execution in Apache Log4j",pattern:/\$\{jndi\s*:/i},{id:"log-log4shell-obfuscated",description:"Obfuscated Log4Shell: ${::-j}... lookup-bypass prefix used to evade WAF detection",pattern:/\$\{::-/},{id:"log-log4j-lookup",description:"Log4j lookup syntax: ${env:...}, ${sys:...}, ${ctx:...} \u2014 data exfiltration",pattern:/\$\{(?:env|sys|ctx|main|map|sd|web|docker|k8s|spring)\s*:/i},{id:"log-ssti-double-brace",description:"SSTI double-brace: {{expression}} \u2014 Jinja2, Twig, Handlebars, etc.",pattern:/\{\{[\s\S]{0,80}\}\}/},{id:"log-ssti-hash-brace",description:"SSTI hash-brace: #{expression} \u2014 Thymeleaf, Velocity, Ruby ERB",pattern:/#\{[\s\S]{0,80}\}/},{id:"log-ssti-dollar-brace",description:"SSTI/EL injection: ${expression with operators or method calls} \u2014 JSP EL, Freemarker, SpEL",pattern:/\$\{[^}]*(?:\.|\(|\*|\+|\bclass\b|\bruntime\b|\bprocess\b|\bexec\b)[^}]{0,80}\}/i},{id:"log-ssti-percent-tag",description:"SSTI ERB/ASP tag: <%= expression %> \u2014 Ruby ERB, ASP",pattern:/<%=[\s\S]{0,80}%>/},{id:"log-null-byte",description:"Null byte: \\x00 or %00 \u2014 can truncate log entries in C-backed loggers",pattern:/\x00|%00/},{id:"log-ansi-escape",description:"ANSI escape sequence: ESC[ \u2014 can manipulate terminal output when logs are tailed",pattern:/\x1b\[/}],mn=Rc;var Lc=[{id:"sql-line-comment",description:"SQL line comment: -- followed by whitespace or end of string",pattern:/--(?:\s|$)/},{id:"sql-stacked-query",description:"Stacked queries: semicolon immediately followed by a SQL keyword",pattern:/;\s{0,10}(?:SELECT|INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|EXEC)\b/i},{id:"sql-hex-encoding",description:"Hex-encoded string injection: 0x41414141 style (MySQL)",pattern:/\b0x[0-9a-f]{4,}/i}],Oc=[...yt,...Lc],fn=Oc;var Gs=Object.freeze({colon:":",Tab:" ",NewLine:`
8
- `}),vc=/&(?:#[xX]0*([0-9a-fA-F]{1,6});?|#0*([0-9]{1,7});?|([a-zA-Z][a-zA-Z0-9]{1,15});)/g;function En(e){return e.indexOf("&")===-1?e:e.replace(vc,(t,r,n,s)=>{if(s!==void 0)return Object.prototype.hasOwnProperty.call(Gs,s)?Gs[s]:t;let i=r!==void 0?parseInt(r,16):parseInt(n,10);return!Number.isFinite(i)||i>1114111?t:String.fromCodePoint(i)})}Ue.label="HTML";Fe.label="XML";cr.label="SVG";Ue.decodeEntities=!0;Fe.decodeEntities=!0;cr.decodeEntities=!0;yt.label="SQL";fn.label="SQL-STRICT";pn.label="SHELL";hn.label="REDOS";gn.label="NOSQL";mn.label="LOG";var gg=Object.freeze({HTML:Ue,XML:Fe,SVG:cr,SQL:yt,"SQL-STRICT":fn,SHELL:pn,REDOS:hn,NOSQL:gn,LOG:mn});function kc(e){if(typeof e!="string")throw new TypeError(`is-unsafe: first argument must be a string, got ${typeof e}`)}function Dc(e){if(!(e instanceof RegExp)){if(Array.isArray(e)){if(e.length===0)throw new TypeError("is-unsafe: context must not be an empty array");if(Array.isArray(e[0])){for(let t of e)if(!Array.isArray(t)||t.length===0)throw new TypeError("is-unsafe: each context in the array must be a non-empty pattern array (PatternList)")}return}throw new TypeError(`is-unsafe: second argument must be a PatternList (e.g. HTML), an array of PatternLists (e.g. [HTML, XML]), or a RegExp. Got: ${typeof e}`)}}function Bc(e){return e instanceof RegExp?{lists:null,regex:e}:Array.isArray(e[0])?{lists:e,regex:null}:{lists:[e],regex:null}}function Pc(e,t){if(!t.decodeEntities)return null;let r=En(e);return r===e?null:r}function Mc(e,t){let r=t.label??"CUSTOM",n=Pc(e,t);for(let s of t)if(s.pattern.test(e)||n!==null&&s.pattern.test(n))return{context:r,id:s.id,description:s.description,pattern:s.pattern};return null}function Ws(e,t){kc(e),Dc(t);let{lists:r,regex:n}=Bc(t);if(n)return n.test(e);for(let s of r)if(Mc(e,s)!==null)return!0;return!1}function Uc(e,t){if(!e)return{};let r=t.attributesGroupName?e[t.attributesGroupName]:e;if(!r)return{};let n={};for(let s in r)if(s.startsWith(t.attributeNamePrefix)){let i=s.substring(t.attributeNamePrefix.length);n[i]=r[s]}else n[s]=r[s];return n}function Fc(e){if(!e||typeof e!="string")return;let t=e.indexOf(":");if(t!==-1&&t>0){let r=e.substring(0,t);if(r!=="xmlns")return r}}var wt=class{constructor(t,r){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Wc,this.parseTextData=Hc,this.resolveNameSpace=Qc,this.buildAttributesMap=Gc,this.isItStopNode=jc,this.replaceEntitiesValue=Jc,this.readStopNodeData=Zc,this.saveTextToParentTag=$c,this.addChild=Kc,this.ignoreAttributesFn=un(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.doctypefound=!1;let n={...Tt};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?n=this.options.htmlEntities:this.options.htmlEntities===!0&&(n={...sn,...nn}),this.entityDecoder=new ze({namedEntities:{...n,...r},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo},onInputEntity:(i,o)=>Ws(o,[Ue,Fe])?Ze.BLOCK:Ze.ALLOW})),this.matcher=new tt,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new et;let s=this.options.stopNodes;if(s&&s.length>0){for(let i=0;i<s.length;i++){let o=s[i];typeof o=="string"?this.stopNodeExpressionsSet.add(new Me(o)):o instanceof Me&&this.stopNodeExpressionsSet.add(o)}this.stopNodeExpressionsSet.seal()}}};function Hc(e,t,r,n,s,i,o){let d=this.options;if(e!==void 0&&(d.trimValues&&!n&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e,t,r));let l=d.jPath?r.toString():r,c=d.tagValueProcessor(t,e,l,s,i);return c==null?e:typeof c!=typeof e||c!==e?c:d.trimValues||e.trim()===e?Cn(e,d.parseTagValue,d.numberParseOptions):e}}function Qc(e){if(this.options.removeNSPrefix){let t=e.split(":"),r=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=r+t[1])}return e}var Yc=/([^\s=]+)\s*(=\s*(?:"([^"]*)"|'([^']*)'))?/gm;function Ks(e){return e[3]!==void 0?e[3]:e[4]}function Gc(e,t,r,n=!1){let s=this.options;if(n===!0||s.ignoreAttributes!==!0&&typeof e=="string"){let i=xs(e,Yc),o=i.length,d={},l=new Array(o),c=!1,m={};for(let f=0;f<o;f++){let b=this.resolveNameSpace(i[f][1]),y=Ks(i[f]);if(b.length&&y!==void 0){let C=y;s.trimValues&&(C=C.trim()),C=this.replaceEntitiesValue(C,r,this.readonlyMatcher),l[f]=C,m[b]=C,c=!0}}c&&typeof t=="object"&&t.updateCurrent&&t.updateCurrent(m);let A=s.jPath?t.toString():this.readonlyMatcher,h=!1;for(let f=0;f<o;f++){let b=this.resolveNameSpace(i[f][1]);if(this.ignoreAttributesFn(b,A))continue;let y=s.attributeNamePrefix+b;if(b.length)if(s.transformAttributeName&&(y=s.transformAttributeName(y)),y=Js(y,s),Ks(i[f])!==void 0){let C=l[f],N=s.attributeValueProcessor(b,C,A);N==null?d[y]=C:typeof N!=typeof C||N!==C?d[y]=N:d[y]=Cn(C,s.parseAttributeValue,s.numberParseOptions),h=!0}else s.allowBooleanAttributes&&(d[y]=!0,h=!0)}if(!h)return;if(s.attributesGroupName&&!s.preserveOrder){let f={};return f[s.attributesGroupName]=d,f}return d}}var Wc=function(e){let t=this.options,r=t.captureMetaData?[]:void 0;e=e.replace(/\r\n?/g,t.captureMetaData?(l,c)=>(l.length===2&&r.push(c-r.length),`
4
+ ${$r(n??null)}`).digest("hex").slice(0,24)}function L(e,t,r,n={},s){let i=bo.get(e);if(!i)throw new Error(`unknown rule: ${e}`);return{fingerprint:gs(e,i.scope,t,s),ruleId:e,rule:e,severity:i.severity,scope:i.scope,url:t,message:r,evidence:n,owner:i.owner,remediation:i.remediation,documentationUrl:`${Eo}#${e}`,after:n.actual}}function Zt(e){return!!(e.title&&!e.error&&!e.blockedByRobots&&e.status===200&&!/(^|[\s,])noindex($|[\s,])/i.test(`${e.robots??""},${e.xRobotsTag??""}`)&&(!e.canonical||e.canonical===(e.finalUrl||e.url)))}function zr(e){return e.normalize("NFKC").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function ms(e){let t=new URL(e.finalUrl||e.url);for(let r of["page","paged","p"])t.searchParams.delete(r);return t.searchParams.sort(),t.href}function fs(e){let t=[],r=new Map,n=new Map;for(let s of[...e].filter(Zt).sort((i,o)=>i.url.localeCompare(o.url))){let i=zr(s.title),o=ms(s),d=`${o}
5
+ ${i}`,l=n.get(d)??[];l.push(s),n.set(d,l);let c=i.split(" ");if(c.length<6||c.length>40)continue;let m=new Set([i,...c.map((f,b)=>c.filter((y,C)=>b!==C).join(" "))]),A=new Map;for(let f of m){for(let y of r.get(f)??[]){if(y.title.trim().toLowerCase()===s.title.trim().toLowerCase()||ms(y)===o)continue;let C=zr(y.title).split(" ");2*c.filter(S=>C.includes(S)).length/(c.length+C.length)>=.9&&A.set(y.url,y)}let b=r.get(f)??[];b.length<20&&b.push(s),r.set(f,b)}let h=[...A.values()].sort((f,b)=>f.url.localeCompare(b.url))[0];h&&t.push(L("near-duplicate-title",s.url,"Title is very similar to another checked page; review page intent",{actual:s.title,target:h.url,otherTitle:h.title,method:"normalized punctuation or one-token edit, token overlap >= 90%",candidateLimit:20},[i,h.url]))}for(let s of n.values()){let i=[...new Map(s.map(o=>[o.finalUrl||o.url,o])).values()];if(!(i.length<2||!i.some(o=>["page","paged","p"].some(d=>new URL(o.url).searchParams.has(d)))))for(let o of i)t.push(L("pagination-title-duplicate",o.url,"Critical pagination title duplication across indexable URLs",{actual:o.title,urls:i.slice(0,20).map(d=>d.url),affectedCount:i.length,interpretation:"Critical risk to distinguishing pages in search; not proof of Google exclusion. Pager offsets may be zero- or one-based."},zr(o.title)))}return t}function At(e,t){return new RegExp(`(^|[\\s,])${t}($|[\\s,])`,"i").test(e??"")}function Es(e){if(e.toLowerCase()==="x-default")return!0;try{return new Intl.Locale(e),!0}catch{return!1}}function $t(e,t){let r=new Map;for(let n of e){let s=t(n)?.trim().toLowerCase();if(!s)continue;let i=r.get(s)??[];i.push(n.url),r.set(s,i)}return new Map([...r].filter(([,n])=>n.length>1))}function Ts(e){let t=[],r=c=>{t.push(c)},n=new Map(e.pages.map(c=>[c.url,c])),s=new Set(e.sitemap?.urls??[]),i=$t(e.pages,c=>c.title),o=$t(e.pages.filter(Zt),c=>c.title),d=$t(e.pages,c=>c.description),l=$t(e.pages,c=>c.contentHash);e.sitemap?.error&&r(L("sitemap-unavailable",e.sitemap.url,"The configured sitemap could not be loaded",{actual:e.sitemap.error}));for(let c of e.pages){if(c.blockedByRobots){r(L("robots-blocked",c.url,"Page is blocked by robots.txt",{actual:!0}));continue}if(c.error){r(L(c.error.includes("redirect loop")?"redirect-loop":"page-unreachable",c.url,`Page request failed: ${c.error}`,{actual:c.error,redirectChain:c.redirectChain}));continue}if((c.status===null||c.status>=400)&&r(L("http-error",c.url,`Page returned HTTP ${c.status??"unknown"}`,{actual:c.status})),At(c.robots,"noindex")&&r(L("noindex",c.url,"Page contains a noindex meta directive",{actual:c.robots})),At(c.xRobotsTag,"noindex")&&r(L("x-robots-noindex",c.url,"Page contains a noindex X-Robots-Tag",{actual:c.xRobotsTag})),!c.canonicalRaw&&!c.canonical&&r(L("missing-canonical",c.url,"Page does not declare a canonical URL",{actual:null})),c.canonicalRaw&&!c.canonical&&r(L("invalid-canonical",c.url,"Canonical URL is invalid",{actual:c.canonicalRaw})),c.canonical&&new URL(c.canonical).origin!==new URL(e.siteUrl).origin&&r(L("cross-domain-canonical",c.url,"Canonical points to another origin",{actual:c.canonical})),c.canonical){let A=n.get(c.canonical);A&&(A.error||(A.status??500)>=400)&&r(L("canonical-target-error",c.url,"Canonical target is unavailable",{target:c.canonical,actual:A.status??A.error},c.canonical))}if(c.redirectChain.length>3&&r(L("long-redirect-chain",c.url,`Page uses ${c.redirectChain.length} redirects`,{actual:c.redirectChain.length,redirectChain:c.redirectChain})),s.has(c.url)&&(At(c.robots,"noindex")||At(c.xRobotsTag,"noindex"))&&r(L("noindex-in-sitemap",c.url,"Sitemap URL is marked noindex",{actual:c.robots??c.xRobotsTag})),s.has(c.url)&&c.redirectChain.length>0&&r(L("redirect-in-sitemap",c.url,"Sitemap URL redirects",{actual:c.finalUrl,redirectChain:c.redirectChain})),!c.title)r(L("missing-title",c.url,"Page does not have a title",{actual:null}));else{if(i.get(c.title.trim().toLowerCase())){let A=Zt(c)&&!!o.get(c.title.trim().toLowerCase()),h=L("duplicate-title",c.url,A?"Critical title duplication across indexable URLs":"Title is shared by multiple pages",{actual:c.title,urls:i.get(c.title.trim().toLowerCase()),indexingRisk:A?"critical; verify Google's chosen canonical and indexing reason in Search Console":"review intentional variants"},c.title.trim().toLowerCase());A&&(h.severity="error"),r(h)}(c.title.length<10||c.title.length>60)&&r(L("title-length",c.url,`Title length is ${c.title.length} characters`,{actual:c.title.length,value:c.title}))}c.description?(d.get(c.description.trim().toLowerCase())&&r(L("duplicate-description",c.url,"Meta description is shared by multiple pages",{actual:c.description,urls:d.get(c.description.trim().toLowerCase())},c.description.trim().toLowerCase())),(c.description.length<50||c.description.length>160)&&r(L("description-length",c.url,`Description length is ${c.description.length} characters`,{actual:c.description.length,value:c.description}))):r(L("missing-description",c.url,"Page does not have a meta description",{actual:null})),c.h1Count===0?r(L("missing-h1",c.url,"Page does not contain an H1 heading",{actual:0})):c.h1Count>1&&r(L("multiple-h1",c.url,`Page contains ${c.h1Count} H1 headings`,{actual:c.h1Count}));for(let A of c.internalLinks){let h=n.get(A);h&&(h.error||(h.status??500)>=400)&&r(L("broken-internal-link",c.url,"Internal link points to an unavailable page",{target:A,actual:h.status??h.error},A))}s.has(c.url)&&c.url!==e.siteUrl&&e.linkGraph.orphanUrls.includes(c.url)&&r(L("orphan-sitemap-page",c.url,"Sitemap page has no discovered internal links",{actual:!0})),e.sitemap&&!s.has(c.url)&&!At(c.robots,"noindex")&&(c.status??500)<400&&r(L("crawlable-not-in-sitemap",c.url,"Crawlable page is absent from the sitemap",{actual:!1}));for(let A of c.hreflang)(!Es(A.lang)||!A.url)&&r(L("invalid-hreflang",c.url,"Hreflang declaration is invalid",{actual:A},A));for(let[A,h]of c.jsonLd.entries())h.valid||r(L("malformed-json-ld",c.url,"JSON-LD block contains invalid JSON",{actual:h.error,index:A},A));e.siteUrl.startsWith("https:")&&[c.url,c.canonical,...c.internalLinks].some(A=>A?.startsWith("http:"))&&r(L("http-on-https-site",c.url,"HTTPS site references an internal HTTP URL",{actual:[c.url,c.canonical,...c.internalLinks].filter(A=>A?.startsWith("http:"))})),c.lang&&!Es(c.lang)&&r(L("invalid-language",c.url,"HTML language declaration is invalid",{actual:c.lang})),c.contentHash&&l.get(c.contentHash)&&r(L("duplicate-content",c.url,"Main text is an exact duplicate of another page",{urls:l.get(c.contentHash)},c.contentHash)),(!c.openGraph.title||!c.openGraph.description||!c.openGraph.image)&&r(L("missing-open-graph",c.url,"Open Graph metadata is incomplete",{actual:c.openGraph})),(!c.twitter.card||!c.twitter.title||!c.twitter.description||!c.twitter.image)&&r(L("missing-twitter-metadata",c.url,"Twitter card metadata is incomplete",{actual:c.twitter}));let m=c.images.filter(A=>A.alt===null).map(A=>A.src);m.length>0&&r(L("image-missing-alt",c.url,`${m.length} image(s) do not have an alt attribute`,{actual:m})),c.wordCount<200&&r(L("low-word-count",c.url,`Page contains approximately ${c.wordCount} visible words`,{actual:c.wordCount}))}return t.push(...fs(e.pages)),t}var bs={error:0,warning:1,info:2};function Co(e,t){let r=(()=>{try{return new URL(e).pathname}catch{return e}})(),n=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replaceAll("**","\0").replaceAll("*","[^/]*").replaceAll("\0",".*"),s=new RegExp(`^${n}$`);return s.test(r)||s.test(e)}function Io(e,t,r){return t.find(n=>n.rule!==e.ruleId||!Co(e.url,n.urlPattern)?!1:n.expiresAt?new Date(`${n.expiresAt}T23:59:59.999Z`).getTime()>=r.getTime():!0)??null}function je(e){return e.sort((t,r)=>bs[t.severity]-bs[r.severity]||t.url.localeCompare(r.url)||t.ruleId.localeCompare(r.ruleId)||t.fingerprint.localeCompare(r.fingerprint))}function pt(e,t,r={}){let n=r.enabledRules??t.config.enabledRules,s=n?new Set(n):null,i={...t.config.severityOverrides,...r.severityOverrides??{}},o=r.suppressions??t.config.suppressions,d=new Date(r.now??Date.now());return je(e.filter(l=>!s||s.has(l.ruleId)).map(l=>({...l,severity:i[l.ruleId]??l.severity})).filter(l=>!Io(l,o,d)))}import{createHash as wo}from"node:crypto";var W="0.17.2",Re="1.2.0",yo="seo-crawl-audit",_e=`${yo}/${W}`;var xo={title:null,description:null,image:null},So={card:null,title:null,description:null,image:null};function Cs(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("snapshot must be an object");return e}function No(e){if(!e||typeof e!="object"||typeof e.url!="string")throw new Error("snapshot page URL must be a string");return e}function en(e){return Array.isArray(e)?`[${e.map(en).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>`${JSON.stringify(t)}:${en(r)}`).join(",")}}`:JSON.stringify(e)}function Ro(e){return wo("sha256").update(en(e)).digest("hex")}function _o(e){return{url:e.url,finalUrl:e.finalUrl??null,status:e.status??null,contentType:e.contentType??null,blockedByRobots:e.blockedByRobots??!1,error:e.error??null,title:e.title??null,description:e.description??null,canonical:e.canonical??null,canonicalRaw:e.canonicalRaw??e.canonical??null,robots:e.robots??null,xRobotsTag:e.xRobotsTag??null,lang:e.lang??null,h1Count:e.h1Count??0,openGraph:e.openGraph??xo,twitter:e.twitter??So,hreflang:e.hreflang??[],jsonLd:e.jsonLd??[],images:e.images??[],links:[...e.links??[]].sort(),internalLinks:[...e.internalLinks??[]].sort(),externalLinks:[...e.externalLinks??[]].sort(),wordCount:e.wordCount??0,contentHash:e.contentHash??null,depth:e.depth??0,redirectChain:e.redirectChain??[],responseBytes:e.responseBytes??0}}function vo(e){let t=e.source??{},r=e.options??{},n=e.pages?.[0],s=n&&typeof n=="object"?n.url:void 0,i=e.siteUrl??e.startUrl??t.startUrl??(typeof s=="string"?s:void 0);if(!i)throw new Error("snapshot site URL must be a string");return{schemaVersion:1,url:i,sitemap:r.sitemap??t.sitemap??"auto",maxPages:r.maxPages??t.maxPages??100,concurrency:r.concurrency??5,delay:r.requestDelay??t.requestDelay??100,timeout:r.timeout??1e4,respectRobots:r.respectRobots??t.respectRobots??!0,includeQuery:r.includeQuery??t.includeQuery??!1,maxRedirects:r.maxRedirects??10,maxResponseBytes:r.maxResponseBytes??5*1024*1024,enabledRules:r.enabledRules??null,severityOverrides:r.severityOverrides??{},suppressions:r.suppressions??[],regressionBudgets:r.regressionBudgets??{},report:r.report??{}}}function Lo(e,t){let r=new Set(e.map(i=>i.url)),n=new Set(e.flatMap(i=>i.internalLinks)),s=new Set;for(let i of e)(i.error||i.blockedByRobots||(i.status??500)>=400)&&s.add(i.url);return{internalEdges:e.reduce((i,o)=>i+o.internalLinks.length,0),externalEdges:e.reduce((i,o)=>i+o.externalLinks.length,0),orphanUrls:t.filter(i=>r.has(i)&&!n.has(i)),brokenInternalUrls:[...s].sort()}}function Oo(e,t){let r=t.filter(s=>s.blockedByRobots).length,n=t.filter(s=>s.error||(s.status??500)>=400).length;return{requested:e.requested??t.length,completed:t.length,succeeded:t.length-n-r,failed:n,blockedByRobots:r,redirected:t.filter(s=>s.redirectChain.length>0||s.url!==s.finalUrl).length,durationMs:e.durationMs??0,truncated:e.truncated??!1,partial:e.partial??!1}}function ye(e){let t=Cs(e),r=vo(t),n=(t.pages??[]).map(l=>_o(No(l))).sort((l,c)=>l.url.localeCompare(c.url)),s=t.sitemap?.urls??[];if(t.sitemap&&!t.sitemap.url)throw new Error("snapshot sitemap URL must be a string");let i=t.sitemap?{url:t.sitemap.url,urls:[...s].sort(),sitemapCount:t.sitemap.sitemapCount??0,truncated:t.sitemap.truncated??!1,error:t.sitemap.error??null}:null,o=t.startUrl??r.url,d=t.truncated??!1;return{schemaVersion:2,engineVersion:W,ruleSetVersion:Re,generatedAt:t.generatedAt??new Date().toISOString(),siteUrl:o,configurationHash:Ro(r),config:r,robots:{url:t.robots?.url??new URL("/robots.txt",o).href,status:t.robots?.status??null,sha256:t.robots?.sha256??null,error:t.robots?.error??null,denyAll:t.robots?.denyAll??!1},sitemap:i,pages:n,linkGraph:t.linkGraph??Lo(n,s),statistics:t.statistics??Oo(t,n),partial:t.partial??!1,source:{startUrl:o,maxPages:r.maxPages,requestDelay:r.delay,includeQuery:r.includeQuery,respectRobots:r.respectRobots,sitemap:typeof r.sitemap=="string"&&!["auto","none"].includes(r.sitemap)?r.sitemap:null},truncated:d}}function fe(e){let t=Cs(e);if(!Array.isArray(t.pages))throw new Error("snapshot pages must be an array");if(t.schemaVersion===2)return ye({...t,startUrl:t.siteUrl,options:t.config,pages:t.pages,generatedAt:t.generatedAt,partial:t.partial,statistics:t.statistics,linkGraph:t.linkGraph});if(t.schemaVersion===1)return ye(t);throw new Error(`unsupported snapshot schema version: ${String(t.schemaVersion)}`)}function ve(e){if(e.schemaVersion===2)return e;let t=e,r=t.pages?.[0],n=r&&typeof r=="object"?r.url:void 0,s=typeof n=="string"?n:t.source?.startUrl??"https://invalid.local/";return ye({...t,startUrl:t.siteUrl??t.source?.startUrl??s,robots:t.robots??{url:new URL("/robots.txt",s).href,status:null,sha256:null,error:null},options:t.config??t.options??{}})}function le(e,t={}){let r=ve(e);return pt(Ts(r),r,t)}function Is(e,t){return new RegExp(`(^|[\\s,])${t}($|[\\s,])`,"i").test(e??"")}function ee(e,t,r,n,s){let i=L(e,t,r,{before:n,after:s,actual:s});return i.before=n,i.after=s,i}function ys(e,t){let r=!t.partial&&!t.truncated,n=[],s=new Map(t.pages.map(l=>[l.url,l]));e.robots.sha256&&t.robots.sha256&&e.robots.sha256!==t.robots.sha256&&n.push(ee("robots-changed",t.robots.url,"robots.txt content changed",e.robots.sha256,t.robots.sha256));let i=e.sitemap?.urls.length??0,o=t.sitemap?.urls.length??0,d=i-o;r&&i>0&&d>=Math.max(5,Math.ceil(i*.2))&&n.push(ee("sitemap-url-count-drop",t.sitemap?.url??e.sitemap?.url??t.siteUrl,`Sitemap URL count dropped by ${d}`,i,o));for(let l of e.pages){let c=s.get(l.url);if(!c){r&&n.push(ee("page-missing",l.url,"Page was not checked",l.status,null));continue}if(c.blockedByRobots&&!l.blockedByRobots){n.push(ee("robots-blocked",l.url,"Page is now blocked by robots.txt",!1,!0));continue}if(c.error&&!l.error){n.push(ee(c.error.includes("redirect loop")?"redirect-loop":"page-unreachable",l.url,`Page request failed: ${c.error}`,l.error,c.error));continue}l.status!==null&&l.status<400&&(c.status===null||c.status>=400)&&n.push(ee("status-regression",l.url,`HTTP status regressed from ${l.status} to ${c.status??"none"}`,l.status,c.status));let m=`${l.robots??""},${l.xRobotsTag??""}`,A=`${c.robots??""},${c.xRobotsTag??""}`;if(!Is(m,"noindex")&&Is(A,"noindex")&&n.push(ee("new-noindex",l.url,"Page now contains a noindex directive",m,A)),l.title&&!c.title?n.push(ee("title-removed",l.url,"Page title was removed",l.title,c.title)):l.title&&c.title&&l.title!==c.title&&n.push(ee("title-changed",l.url,"Page title changed",l.title,c.title)),l.description&&!c.description&&n.push(ee("description-removed",l.url,"Meta description was removed",l.description,c.description)),l.canonical&&!c.canonical)n.push(ee("canonical-removed",l.url,"Canonical URL was removed",l.canonical,c.canonical));else if(l.canonical&&c.canonical&&l.canonical!==c.canonical){let h=ee("canonical-changed",l.url,"Canonical URL changed",l.canonical,c.canonical);new URL(c.canonical).origin!==new URL(l.url).origin&&(h.severity="error"),n.push(h)}if(l.h1Count>0&&c.h1Count===0&&n.push(ee("h1-removed",l.url,"All H1 headings were removed",l.h1Count,c.h1Count)),l.finalUrl&&c.finalUrl&&l.finalUrl!==c.finalUrl){let h=ee("redirect-changed",l.url,"Final redirect URL changed",l.finalUrl,c.finalUrl);new URL(c.finalUrl).origin!==new URL(l.url).origin&&(h.severity="error"),n.push(h)}}return n}function Do(e,t,r={}){let n=ve(e),s=ve(t);return pt(ys(n,s),s,r)}function ht(e,t){return{...e,lifecycle:t}}function Ve(e,t,r={}){let n=ve(e),s=ve(t),i=!s.partial&&!s.truncated,o=new Set(s.pages.map(C=>C.url)),d=new Map(le(n,r).map(C=>[C.fingerprint,C])),l=new Map(le(s,r).map(C=>[C.fingerprint,C])),c=[],m=[],A=[],h=[];for(let[C,R]of l){let S=d.get(C);S?JSON.stringify(S.evidence)===JSON.stringify(R.evidence)?A.push(ht(R,"unchanged")):m.push(ht({...R,before:S.evidence,after:R.evidence},"ongoing")):c.push(ht(R,"new"))}for(let[C,R]of d)(R.scope==="page"?o.has(R.url):i)&&!l.has(C)&&h.push(ht(R,"resolved"));let f=new Set(c.map(C=>C.fingerprint));for(let C of Do(n,s,r))f.has(C.fingerprint)||c.push(ht(C,"new"));let b={...n.config.regressionBudgets,...s.config.regressionBudgets},y=Object.entries(b).flatMap(([C,R])=>{let S=c.filter(_=>_.severity===C||_.ruleId===C).length;return S>R?[{budget:C,allowed:R,actual:S}]:[]});return je(c),je(m),je(A),je(h),{complete:i,newIssues:c,ongoingIssues:m,resolvedIssues:h,unchangedIssues:A,issues:[...c,...m],budgetExceeded:y}}var tn="seo-audit.config.json",ws=Object.freeze({schemaVersion:1,url:"",sitemap:"auto",maxPages:100,concurrency:5,delay:100,timeout:1e4,respectRobots:!0,includeQuery:!1,maxRedirects:10,maxResponseBytes:5242880,enabledRules:null,severityOverrides:{},suppressions:[],regressionBudgets:{},report:{}});function gt(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} must be an object`);return e}function Le(e,t,r,n=Number.MAX_SAFE_INTEGER){if(!Number.isInteger(e)||e<r||e>n)throw new Error(`${t} must be an integer between ${r} and ${n}`);return e}function mt(e,t){if(e!==void 0){if(typeof e!="string")throw new Error(`${t} must be a string`);return e}}function rn(e){let t=gt(e,"config"),r=new Set(["$schema","schemaVersion","url","sitemap","maxPages","concurrency","delay","timeout","respectRobots","includeQuery","maxRedirects","maxResponseBytes","enabledRules","severityOverrides","suppressions","regressionBudgets","report"]);for(let s of Object.keys(t))if(!r.has(s))throw new Error(`unknown config property: ${s}`);let n={};if(t.schemaVersion!==void 0&&t.schemaVersion!==1)throw new Error("schemaVersion must be 1");if(t.url!==void 0){let s=mt(t.url,"url");if(!/^https?:\/\//i.test(s))throw new Error("url must be an HTTP(S) URL");n.url=s}if(t.sitemap!==void 0){let s=mt(t.sitemap,"sitemap");if(!["auto","none"].includes(s)&&!/^https?:\/\//i.test(s))throw new Error("sitemap must be auto, none, or an HTTP(S) URL");n.sitemap=s}t.maxPages!==void 0&&(n.maxPages=Le(t.maxPages,"maxPages",1)),t.concurrency!==void 0&&(n.concurrency=Le(t.concurrency,"concurrency",1,50)),t.delay!==void 0&&(n.delay=Le(t.delay,"delay",0)),t.timeout!==void 0&&(n.timeout=Le(t.timeout,"timeout",1)),t.maxRedirects!==void 0&&(n.maxRedirects=Le(t.maxRedirects,"maxRedirects",0,50)),t.maxResponseBytes!==void 0&&(n.maxResponseBytes=Le(t.maxResponseBytes,"maxResponseBytes",1024));for(let s of["respectRobots","includeQuery"])if(t[s]!==void 0){if(typeof t[s]!="boolean")throw new Error(`${s} must be a boolean`);n[s]=t[s]}if(t.enabledRules!==void 0){if(t.enabledRules!==null&&(!Array.isArray(t.enabledRules)||t.enabledRules.some(s=>typeof s!="string")))throw new Error("enabledRules must be null or an array of rule IDs");n.enabledRules=t.enabledRules}if(t.severityOverrides!==void 0){let s=gt(t.severityOverrides,"severityOverrides");for(let[i,o]of Object.entries(s))if(!["error","warning","info"].includes(o))throw new Error(`severityOverrides.${i} must be error, warning, or info`);n.severityOverrides=s}if(t.suppressions!==void 0){if(!Array.isArray(t.suppressions))throw new Error("suppressions must be an array");n.suppressions=t.suppressions.map((s,i)=>{let o=gt(s,`suppressions[${i}]`);for(let d of["rule","urlPattern","reason"])if(typeof o[d]!="string"||o[d]==="")throw new Error(`suppressions[${i}].${d} must be a non-empty string`);if(o.expiresAt!==void 0&&!/^\d{4}-\d{2}-\d{2}$/.test(String(o.expiresAt)))throw new Error(`suppressions[${i}].expiresAt must use YYYY-MM-DD`);return o})}if(t.regressionBudgets!==void 0){let s=gt(t.regressionBudgets,"regressionBudgets");n.regressionBudgets=Object.fromEntries(Object.entries(s).map(([i,o])=>[i,Le(o,`regressionBudgets.${i}`,0)]))}if(t.report!==void 0){let s=gt(t.report,"report"),i={},o=mt(s.agencyName,"report.agencyName"),d=mt(s.logo,"report.logo"),l=mt(s.primaryColor,"report.primaryColor");if(o!==void 0&&(i.agencyName=o),d!==void 0&&(i.logo=d),l!==void 0&&(i.primaryColor=l),i.primaryColor&&!/^#[0-9a-f]{6}$/i.test(i.primaryColor))throw new Error("report.primaryColor must be a six-digit hex color");n.report=Object.fromEntries(Object.entries(i).filter(([,c])=>c!==void 0))}return n}function be(e,t={},r={}){return{...{...ws,...r,...t,...e},schemaVersion:1,severityOverrides:{...r.severityOverrides??{},...t.severityOverrides??{},...e.severityOverrides??{}},regressionBudgets:{...r.regressionBudgets??{},...t.regressionBudgets??{},...e.regressionBudgets??{}},report:{...r.report??{},...t.report??{},...e.report??{}},suppressions:e.suppressions??t.suppressions??r.suppressions??[]}}function qt(){}var zt=Object.freeze({debug:qt,info:qt,warn:qt,error:qt});import{setTimeout as ko}from"node:timers/promises";function Bo(e=0,{now:t=Date.now,wait:r=ko}={}){let n=Math.max(0,e),s=0,i=Promise.resolve();return function(){if(n===0)return Promise.resolve();let d=i.then(async()=>{let l=Math.max(0,s-t());l>0&&await r(l),s=t()+n});return i=d.catch(()=>{}),d}}function Xe(e=0,t=Bo){let r=new Map;return n=>{let s=new URL(n).origin,i=r.get(s);return i||(i=t(e),r.set(s,i)),i()}}import{createHash as Yo}from"node:crypto";import{setTimeout as xs}from"node:timers/promises";var Ee=class extends Error{redirectChain;constructor(t,r=[],n){super(t,n),this.name="RequestFailure",this.redirectChain=r}};function Po(e){return e===429||e===500||e===502||e===503||e===504}function Mo(e,t=Date.now()){if(!e)return null;let r=Number(e);if(Number.isFinite(r)&&r>=0)return Math.min(r*1e3,3e4);let n=Date.parse(e);return Number.isNaN(n)?null:Math.min(Math.max(0,n-t),3e4)}function Uo(e,t){let r=AbortSignal.timeout(e);return t?AbortSignal.any([t,r]):r}async function Fo(e,t,r){let n=[],s=new Set([e]),i=e;for(;;){r.signal?.throwIfAborted(),await r.gate?.(i);let o=await r.fetch(i,{...t,redirect:"manual",signal:Uo(r.timeout,r.signal)}),d=o.headers.get("location");if(o.status<300||o.status>=400||!d)return{response:o,redirectChain:n};let l=new URL(d,i).href;if(n.push({url:i,status:o.status,location:l}),await o.body?.cancel(),s.has(l))throw new Ee(`redirect loop detected at ${l}`,n);if(n.length>r.maxRedirects)throw new Ee(`redirect limit of ${r.maxRedirects} exceeded`,n);s.add(l),i=l}}async function Oe(e,t,r){let n;for(let s=0;s<=r.retries;s+=1)try{let i=await Fo(e,t,r);if(!Po(i.response.status)||s===r.retries)return i;let o=Mo(i.response.headers.get("retry-after"));await i.response.body?.cancel();let d=Math.floor((r.random??Math.random)()*100),l=o??Math.min(250*2**s+d,3e4);await r.onEvent?.({type:"retry",url:e,attempt:s+1,delayMs:l}),await xs(l,void 0,{signal:r.signal})}catch(i){if(r.signal?.aborted)throw r.signal.reason??i;if(n=i,i instanceof Ee||s===r.retries)break;let o=Math.floor((r.random??Math.random)()*100),d=Math.min(250*2**s+o,3e4);await r.onEvent?.({type:"retry",url:e,attempt:s+1,delayMs:d}),await xs(d,void 0,{signal:r.signal})}throw n instanceof Ee?n:new Ee(n instanceof Error?n.message:String(n),[],{cause:n})}async function De(e,t){if(!e.body)return{text:"",bytes:0,buffer:Buffer.alloc(0)};let r=e.body.getReader(),n=[],s=0;for(;;){let{done:o,value:d}=await r.read();if(o)break;if(s+=d.byteLength,s>t)throw await r.cancel(),new Ee(`response exceeds ${t} bytes`);n.push(Buffer.from(d))}let i=Buffer.concat(n);return{text:i.toString("utf8"),bytes:s,buffer:i}}function Ho(e,t){if(!t)return!1;let r=t.endsWith("$"),s=(r?t.slice(0,-1):t).replace(/[.+?^${}()|[\]\\]/g,"\\$&").replaceAll("*",".*");return new RegExp(`^${s}${r?"$":""}`).test(e)}function Qo(e,t){let r=[],n=null;for(let d of e.replace(/^\uFEFF/,"").split(/\r?\n/)){let l=d.replace(/#.*$/,"").trim(),c=l.indexOf(":");if(!l||c<0)continue;let m=l.slice(0,c).trim().toLowerCase(),A=l.slice(c+1).trim();if(m==="user-agent"){(!n||n.hasRules)&&(n={agents:[],rules:[],hasRules:!1},r.push(n)),A&&n.agents.push(A.toLowerCase());continue}n&&(m==="allow"||m==="disallow")&&A&&(n.rules.push({type:m,path:A}),n.hasRules=!0)}let s=t.toLowerCase(),i=r.filter(d=>d.agents.some(l=>l!=="*"&&s.includes(l)));return(i.length>0?i:r.filter(d=>d.agents.includes("*"))).flatMap(d=>d.rules)}function Ss(e,t){if(t.denyAll)return!1;let r=new URL(e),n=`${r.pathname}${r.search}`,s=(t.rules??[]).filter(i=>Ho(n,i.path)).sort((i,o)=>o.path.length-i.path.length||(i.type==="allow"?-1:1));return s.length===0||s[0]?.type==="allow"}async function er(e,t){let r=new URL("/robots.txt",e).href;try{let{response:n}=await Oe(r,{headers:{accept:"text/plain,*/*;q=0.1","user-agent":t.userAgent}},{fetch:t.fetch,timeout:t.timeout,maxRedirects:t.maxRedirects,retries:t.retries,signal:t.signal,gate:t.requestGate,onEvent:t.onEvent}),{text:s}=await De(n,Go);return{url:r,status:n.status,body:s,sha256:Yo("sha256").update(s).digest("hex"),rules:n.ok?Qo(s,t.userAgent):[],denyAll:n.status===401||n.status===403,error:null}}catch(n){if(t.signal?.aborted)throw n;return{url:r,status:null,body:"",sha256:null,rules:[],denyAll:!1,error:n instanceof Error?n.message:String(n)}}}var Go=512*1024;import{gunzipSync as cl}from"node:zlib";var Ns=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Wo=Ns+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Ko="["+Ns+"]["+Wo+"]*",Jo=new RegExp("^"+Ko+"$");function Rs(e,t){let r=[],n=t.exec(e);for(;n;){let s=[];s.startIndex=t.lastIndex-n[0].length;let i=n.length;for(let o=0;o<i;o++)s.push(n[o]);r.push(s),n=t.exec(e)}return r}var nn=function(e){let t=Jo.exec(e);return!(t===null||typeof t>"u")};function _s(e){return typeof e<"u"}var ft=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],tr=["__proto__","constructor","prototype"];var jo={allowBooleanAttributes:!1,unpairedTags:[]};function rr(e,t){t=Object.assign({},jo,t);let r=[],n=!1,s=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let i=0;i<e.length;i++)if(e[i]==="<"&&e[i+1]==="?"){if(i+=2,i=vs(e,i),i.err)return i}else if(e[i]==="<"){let o=i;if(i++,e[i]==="!"){i=Ls(e,i);continue}else{let d=!1;e[i]==="/"&&(d=!0,i++);let l="";for(;i<e.length&&e[i]!==">"&&e[i]!==" "&&e[i]!==" "&&e[i]!==`
6
+ `&&e[i]!=="\r";i++)l+=e[i];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),i--),!tc(l)){let A;return l.trim().length===0?A="Invalid space after '<'.":A="Tag '"+l+"' is an invalid name.",Y("InvalidTag",A,$(e,i))}let c=Zo(e,i);if(c===!1)return Y("InvalidAttr","Attributes for '"+l+"' have open quote.",$(e,i));let m=c.value;if(i=c.index,m[m.length-1]==="/"){let A=i-m.length;m=m.substring(0,m.length-1);let h=Os(m,t);if(h===!0)n=!0;else return Y(h.err.code,h.err.msg,$(e,A+h.err.line))}else if(d)if(c.tagClosed){if(m.trim().length>0)return Y("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",$(e,o));if(r.length===0)return Y("InvalidTag","Closing tag '"+l+"' has not been opened.",$(e,o));{let A=r.pop();if(l!==A.tagName){let h=$(e,A.tagStartPos);return Y("InvalidTag","Expected closing tag '"+A.tagName+"' (opened in line "+h.line+", col "+h.col+") instead of closing tag '"+l+"'.",$(e,o))}r.length==0&&(s=!0)}}else return Y("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",$(e,i));else{let A=Os(m,t);if(A!==!0)return Y(A.err.code,A.err.msg,$(e,i-m.length+A.err.line));if(s===!0)return Y("InvalidXml","Multiple possible root nodes found.",$(e,i));t.unpairedTags.indexOf(l)!==-1||r.push({tagName:l,tagStartPos:o}),n=!0}for(i++;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="!"){i++,i=Ls(e,i);continue}else if(e[i+1]==="?"){if(i=vs(e,++i),i.err)return i}else break;else if(e[i]==="&"){let A=zo(e,i);if(A==-1)return Y("InvalidChar","char '&' is not expected.",$(e,i));i=A}else if(s===!0&&!Ze(e[i]))return Y("InvalidXml","Extra text at the end",$(e,i));e[i]==="<"&&i--}}else{if(Ze(e[i]))continue;return Y("InvalidChar","char '"+e[i]+"' is not expected.",$(e,i))}if(n){if(r.length==1)return Y("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",$(e,r[0].tagStartPos));if(r.length>0)return Y("InvalidXml","Invalid '"+JSON.stringify(r.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Y("InvalidXml","Start tag expected.",1);return!0}function Ze(e){return e===" "||e===" "||e===`
7
+ `||e==="\r"}function vs(e,t){let r=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){let n=e.substr(r,t-r);if(t>5&&n==="xml")return Y("InvalidXml","XML declaration allowed only at the start of the document.",$(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function Ls(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let r=1;for(t+=8;t<e.length;t++)if(e[t]==="<")r++;else if(e[t]===">"&&(r--,r===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}var Vo='"',Xo="'";function Zo(e,t){let r="",n="",s=!1;for(;t<e.length;t++){if(e[t]===Vo||e[t]===Xo)n===""?n=e[t]:n!==e[t]||(n="");else if(e[t]===">"&&n===""){s=!0;break}r+=e[t]}return n!==""?!1:{value:r,index:t,tagClosed:s}}function $o(e){let t=[],r=e.length,n=0;for(;n<r;){let s=n;for(;n<r&&Ze(e[n]);)n++;if(n>=r)break;if(e[n]==="="){n++;continue}let i=e.slice(s,n),o=n;for(;n<r&&!Ze(e[n])&&e[n]!=="=";)n++;let d=e.slice(o,n),l,c=n;for(;c<r&&Ze(e[c]);)c++;c<r&&e[c]==="="&&(l=e.slice(n,c+1),n=c+1);let m,A,h=n;for(;h<r&&Ze(e[h]);)h++;if(h<r&&(e[h]==='"'||e[h]==="'")){let b=h+1,y=e.indexOf(e[h],b);y!==-1&&(m=e[h],A=e.slice(b,y),n=y+1)}let f={startIndex:s};f[1]=i,f[2]=d,f[3]=l,f[4]=m!==void 0?!0:void 0,f[5]=m,f[6]=A,t.push(f)}return t}function Os(e,t){let r=$o(e),n={};for(let s=0;s<r.length;s++){if(r[s][1].length===0)return Y("InvalidAttr","Attribute '"+r[s][2]+"' has no space in starting.",Et(r[s]));if(r[s][3]!==void 0&&r[s][4]===void 0)return Y("InvalidAttr","Attribute '"+r[s][2]+"' is without value.",Et(r[s]));if(r[s][3]===void 0&&!t.allowBooleanAttributes)return Y("InvalidAttr","boolean attribute '"+r[s][2]+"' is not allowed.",Et(r[s]));let i=r[s][2];if(!ec(i))return Y("InvalidAttr","Attribute '"+i+"' is an invalid name.",Et(r[s]));if(!Object.prototype.hasOwnProperty.call(n,i))n[i]=1;else return Y("InvalidAttr","Attribute '"+i+"' is repeated.",Et(r[s]))}return!0}function qo(e,t){let r=/\d/;for(e[t]==="x"&&(t++,r=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(r))break}return-1}function zo(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,qo(e,t);let r=0;for(;t<e.length;t++,r++)if(!(e[t].match(/\w/)&&r<20)){if(e[t]===";")break;return-1}return t}function Y(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function ec(e){return nn(e)}function tc(e){return nn(e)}function $(e,t){let r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function Et(e){return e.startIndex+e[1].length}var sn={cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",euro:"\u20AC",dollar:"$",fnof:"\u0192",inr:"\u20B9",af:"\u060B",birr:"\u1265\u122D",peso:"\u20B1",rub:"\u20BD",won:"\u20A9",yuan:"\xA5",cedil:"\xB8"};var Tt={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},an={nbsp:"\xA0",copy:"\xA9",reg:"\xAE",trade:"\u2122",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",laquo:"\xAB",raquo:"\xBB",lsquo:"\u2018",rsquo:"\u2019",ldquo:"\u201C",rdquo:"\u201D",bull:"\u2022",para:"\xB6",sect:"\xA7",deg:"\xB0",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE"};var $e=Object.freeze({ALLOW:"allow",BLOCK:"block",THROW:"throw"}),rc=new Set("!?\\\\/[]$%{}^&*()<>|+");function Ds(e){if(e[0]==="#")throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${e}"`);for(let t of e)if(rc.has(t))throw new Error(`[EntityReplacer] Invalid character '${t}' in entity name: "${e}"`);return e}function bt(...e){let t=Object.create(null);for(let r of e)if(r)for(let n of Object.keys(r)){let s=r[n];if(typeof s=="string")t[n]=s;else if(s&&typeof s=="object"&&s.val!==void 0){let i=s.val;typeof i=="string"&&(t[n]=i)}}return t}var ke="external",nr="base",on="all";function nc(e){return!e||e===ke?new Set([ke]):e===on?new Set([on]):e===nr?new Set([nr]):Array.isArray(e)?new Set(e):new Set([ke])}var te=Object.freeze({allow:0,leave:1,remove:2,throw:3}),sc=new Set([9,10,13]);function ic(e){if(!e)return{xmlVersion:1,onLevel:te.allow,nullLevel:te.remove};let t=e.xmlVersion===1.1?1.1:1,r=te[e.onNCR]??te.allow,n=te[e.nullNCR]??te.remove,s=Math.max(n,te.remove);return{xmlVersion:t,onLevel:r,nullLevel:s}}var qe=class{constructor(t={}){this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof t.postCheck=="function"?t.postCheck:n=>n,this._limitTiers=nc(this._limit.applyLimitsTo??ke),this._numericAllowed=t.numericAllowed??!0,this._baseMap=bt(Tt,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);let r=ic(t.ncr);this._ncrXmlVersion=r.xmlVersion,this._ncrOnLevel=r.onLevel,this._ncrNullLevel=r.nullLevel,this._onExternalEntity=typeof t.onExternalEntity=="function"?t.onExternalEntity:null,this._onInputEntity=typeof t.onInputEntity=="function"?t.onInputEntity:null}_applyRegistrationHook(t,r,n,s){if(!t)return!0;let i=t(r,n);if(i===$e.BLOCK)return!1;if(i===$e.THROW)throw new Error(`[EntityDecoder] Registration of ${s} entity "&${r};" was rejected by hook`);return!0}setExternalEntities(t){if(t)for(let s of Object.keys(t))Ds(s);if(!this._onExternalEntity){this._externalMap=bt(t);return}let r=bt(t),n=Object.create(null);for(let[s,i]of Object.entries(r))this._applyRegistrationHook(this._onExternalEntity,s,i,"external")&&(n[s]=i);this._externalMap=n}addExternalEntity(t,r){Ds(t),typeof r=="string"&&r.indexOf("&")===-1&&this._applyRegistrationHook(this._onExternalEntity,t,r,"external")&&(this._externalMap[t]=r)}addInputEntities(t){if(this._totalExpansions=0,this._expandedLength=0,!this._onInputEntity){this._inputMap=bt(t);return}let r=bt(t),n=Object.create(null);for(let[s,i]of Object.entries(r))this._applyRegistrationHook(this._onInputEntity,s,i,"input")&&(n[s]=i);this._inputMap=n}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=t===1.1?1.1:1}decode(t){if(typeof t!="string"||t.length===0||t.indexOf("&")===-1)return t;let r=t,n=[],s=t.length,i=0,o=0,d=this._maxTotalExpansions>0,l=this._maxExpandedLength>0,c=d||l;for(;o<s;){if(t.charCodeAt(o)!==38){o++;continue}let A=o+1;for(;A<s&&t.charCodeAt(A)!==59&&A-o<=32;)A++;if(A>=s||t.charCodeAt(A)!==59){o++;continue}let h=t.slice(o+1,A);if(h.length===0){o++;continue}let f,b;if(this._removeSet.has(h))f="",b===void 0&&(b=ke);else if(this._leaveSet.has(h)){o++;continue}else if(h.charCodeAt(0)===35){let y=this._resolveNCR(h);if(y===void 0){o++;continue}f=y,b=nr}else{let y=this._resolveName(h);f=y?.value,b=y?.tier}if(f===void 0){o++;continue}if(o>i&&n.push(t.slice(i,o)),n.push(f),i=A+1,o=i,c&&this._tierCounts(b)){if(d&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(l){let y=f.length-(h.length+2);if(y>0&&(this._expandedLength+=y,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}i<s&&n.push(t.slice(i));let m=n.length===0?t:n.join("");return this._postCheck(m,r)}_tierCounts(t){return this._limitTiers.has(on)?!0:this._limitTiers.has(t)}_resolveName(t){if(t in this._inputMap)return{value:this._inputMap[t],tier:ke};if(t in this._externalMap)return{value:this._externalMap[t],tier:ke};if(t in this._baseMap)return{value:this._baseMap[t],tier:nr}}_classifyNCR(t){return t===0?this._ncrNullLevel:t>=55296&&t<=57343||this._ncrXmlVersion===1&&t>=1&&t<=31&&!sc.has(t)?te.remove:-1}_applyNCRAction(t,r,n){switch(t){case te.allow:return String.fromCodePoint(n);case te.remove:return"";case te.leave:return;case te.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${r}; (U+${n.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(n)}}_resolveNCR(t){let r=t.charCodeAt(1),n;if(r===120||r===88?n=parseInt(t.slice(2),16):n=parseInt(t.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;let s=this._classifyNCR(n);if(!this._numericAllowed&&s<te.remove)return;let i=s===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,s);return this._applyNCRAction(i,t,n)}};var ks=e=>ft.includes(e)?"__"+e:e,ac={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0,unicode:!1},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:ks};function oc(e,t){if(typeof e!="string")return;let r=e.toLowerCase();if(ft.some(n=>r===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);if(tr.some(n=>r===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function Bs(e,t){return typeof e=="boolean"?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof e=="object"&&e!==null?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??1e3),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null,appliesTo:e.appliesTo??"all"}:Bs(!0)}var Ps=function(e){let t=Object.assign({},ac,e),r=[{value:t.attributeNamePrefix,name:"attributeNamePrefix"},{value:t.attributesGroupName,name:"attributesGroupName"},{value:t.textNodeName,name:"textNodeName"},{value:t.cdataPropName,name:"cdataPropName"},{value:t.commentPropName,name:"commentPropName"}];for(let{value:n,name:s}of r)n&&oc(n,s);return t.onDangerousProperty===null&&(t.onDangerousProperty=ks),t.processEntities=Bs(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(n=>typeof n=="string"&&n.startsWith("*.")?".."+n.substring(2):n)),t};var Be;typeof Symbol!="function"?Be="@@xmlMetadata":Be=Symbol("XML Node Metadata");var re=class{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:r})}addChild(t,r){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),this.addStartIndex(r)}addStartIndex(t){t!==void 0&&(this.child[this.child.length-1][Be]={startIndex:t})}addEndIndex(t){let r=this.child[this.child.length-1];r!==void 0&&r[Be]!==void 0&&r[Be].endIndex===void 0&&(r[Be].endIndex=t)}static getMetaDataSymbol(){return Be}};var Ms=":A-Za-z_\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",cc=Ms+"\\-\\.\\d\xB7\u0300-\u036F\u203F-\u2040",Us=":A-Za-z_\xC0-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",lc=Us+"\\-\\.\\d\xB7\u0300-\u036F\u0487\u203F-\u2040",cn=(e,t,r="")=>{let n=e.replace(":",""),s=t.replace(":",""),i=`[${n}][${s}]*`;return{name:new RegExp(`^[${e}][${t}]*$`,r),ncName:new RegExp(`^${i}$`,r),qName:new RegExp(`^${i}(?::${i})?$`,r),nmToken:new RegExp(`^[${t}]+$`,r),nmTokens:new RegExp(`^[${t}]+(?:\\s+[${t}]+)*$`,r)}},dc=cn(Ms,cc),uc=cn(Us,lc,"u"),Fs=":A-Za-z_",Ac=Fs+"\\-\\.\\d",pc=cn(Fs,Ac),hc=(e="1.0",t=!1)=>t?pc:e==="1.1"?uc:dc;var ln=(e,{xmlVersion:t="1.0",asciiOnly:r=!1}={})=>hc(t,r).qName.test(e);var It=class{constructor(t,r){this.suppressValidationErr=!t,this.options=t,this.xmlVersion=r||1}setXmlVersion(t=1){this.xmlVersion=t}readDocType(t,r){let n=Object.create(null),s=0;if(t[r+3]==="O"&&t[r+4]==="C"&&t[r+5]==="T"&&t[r+6]==="Y"&&t[r+7]==="P"&&t[r+8]==="E"){r=r+9;let i=1,o=!1,d=!1,l=null,c="";for(;r<t.length;r++){if(l!==null){t[r]===l&&(l=null),c+=t[r];continue}if(!o&&!d&&(t[r]==='"'||t[r]==="'")){l=t[r],c+=t[r];continue}if(t[r]==="<"&&!d){if(o&&Pe(t,"!ENTITY",r)){r+=7;let m,A;if([m,A,r]=this.readEntityExp(t,r+1,this.suppressValidationErr),A.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&s>=this.options.maxEntityCount)throw new Error(`Entity count (${s+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[m]=A,s++}}else if(o&&Pe(t,"!ELEMENT",r)){r+=8;let{index:m}=this.readElementExp(t,r+1);r=m}else if(o&&Pe(t,"!ATTLIST",r))r+=8;else if(o&&Pe(t,"!NOTATION",r)){r+=9;let{index:m}=this.readNotationExp(t,r+1,this.suppressValidationErr);r=m}else if(Pe(t,"!--",r))d=!0;else throw new Error("Invalid DOCTYPE");i++,c=""}else if(t[r]===">"){if(d?t[r-1]==="-"&&t[r-2]==="-"&&(d=!1,i--):i--,i===0)break}else t[r]==="["?o=!0:c+=t[r]}if(l!==null||i!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:n,i:r}}readEntityExp(t,r){r=ne(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r])&&t[r]!=='"'&&t[r]!=="'";)r++;let s=t.substring(n,r);if(Ct(s,{xmlVersion:this.xmlVersion}),r=ne(t,r),!this.suppressValidationErr){if(t.substring(r,r+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[r]==="%")throw new Error("Parameter entities are not supported")}let i="";if([r,i]=this.readIdentifierVal(t,r,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&i.length>this.options.maxEntitySize)throw new Error(`Entity "${s}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return r--,[s,i,r]}readNotationExp(t,r){r=ne(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;let s=t.substring(n,r);!this.suppressValidationErr&&Ct(s,{xmlVersion:this.xmlVersion}),r=ne(t,r);let i=t.substring(r,r+6).toUpperCase();if(!this.suppressValidationErr&&i!=="SYSTEM"&&i!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${i}"`);r+=i.length,r=ne(t,r);let o=null,d=null;if(i==="PUBLIC")[r,o]=this.readIdentifierVal(t,r,"publicIdentifier"),r=ne(t,r),(t[r]==='"'||t[r]==="'")&&([r,d]=this.readIdentifierVal(t,r,"systemIdentifier"));else if(i==="SYSTEM"&&([r,d]=this.readIdentifierVal(t,r,"systemIdentifier"),!this.suppressValidationErr&&!d))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:o,systemIdentifier:d,index:--r}}readIdentifierVal(t,r,n){let s="",i=t[r];if(i!=='"'&&i!=="'")throw new Error(`Expected quoted string, found "${i}"`);r++;let o=r;for(;r<t.length&&t[r]!==i;)r++;if(s=t.substring(o,r),t[r]!==i)throw new Error(`Unterminated ${n} value`);return r++,[r,s]}readElementExp(t,r){r=ne(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;let s=t.substring(n,r);if(!this.suppressValidationErr&&!ln(s,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid element name: "${s}"`);r=ne(t,r);let i="";if(t[r]==="E"&&Pe(t,"MPTY",r))r+=4;else if(t[r]==="A"&&Pe(t,"NY",r))r+=2;else if(t[r]==="("){r++;let o=r;for(;r<t.length&&t[r]!==")";)r++;if(i=t.substring(o,r),t[r]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[r]}"`);return{elementName:s,contentModel:i.trim(),index:r}}readAttlistExp(t,r){r=ne(t,r);let n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;let s=t.substring(n,r);for(Ct(s,{xmlVersion:this.xmlVersion}),r=ne(t,r),n=r;r<t.length&&!/\s/.test(t[r]);)r++;let i=t.substring(n,r);if(!Ct(i,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid attribute name: "${i}"`);r=ne(t,r);let o="";if(t.substring(r,r+8).toUpperCase()==="NOTATION"){if(o="NOTATION",r+=8,r=ne(t,r),t[r]!=="(")throw new Error(`Expected '(', found "${t[r]}"`);r++;let l=[];for(;r<t.length&&t[r]!==")";){let c=r;for(;r<t.length&&t[r]!=="|"&&t[r]!==")";)r++;let m=t.substring(c,r);if(m=m.trim(),!Ct(m,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid notation name: "${m}"`);l.push(m),t[r]==="|"&&(r++,r=ne(t,r))}if(t[r]!==")")throw new Error("Unterminated list of notations");r++,o+=" ("+l.join("|")+")"}else{let l=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;o+=t.substring(l,r);let c=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!c.includes(o.toUpperCase()))throw new Error(`Invalid attribute type: "${o}"`)}r=ne(t,r);let d="";return t.substring(r,r+8).toUpperCase()==="#REQUIRED"?(d="#REQUIRED",r+=8):t.substring(r,r+7).toUpperCase()==="#IMPLIED"?(d="#IMPLIED",r+=7):[r,d]=this.readIdentifierVal(t,r,"ATTLIST"),{elementName:s,attributeName:i,attributeType:o,defaultValue:d,index:r}}},ne=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function Pe(e,t,r){for(let n=0;n<t.length;n++)if(t[n]!==e[r+n+1])return!1;return!0}function Ct(e,t){if(ln(e,{xmlVersion:t}))return e;throw new Error(`Invalid entity name ${e}`)}var gc=[48,1632,1776,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,65296,120782,120792,120802,120812,120822,66720,68912,69734,69872,69942,70096,70384,70736,70864,71248,71360,71472,71904,72016,72688,72784,73040,73120,73552,92768,92864,93008,123200,123632,124144,125264,130032],sr=255,ir=new Map,Hs=65535,Qs=1632,ze=Qs,mc=Hs-Qs+1,ar=new Uint8Array(mc).fill(sr);for(let e of gc)for(let t=0;t<10;t++){let r=e+t;r<=Hs?ar[r-ze]=t:ir.set(r,t)}var Ys=48,Gs=57,Ws=45,or=new Set([8722,65293,65123]);function fc(e){if(typeof e!="string")return e;let t=e.length;if(t===0)return e;let r=-1;for(let s=0;s<t;s++){let i=e.charCodeAt(s);if(!(i>=Ys&&i<=Gs||i===Ws)){if(i<ze){if(or.has(i)){r=s;break}continue}if(i>=55296&&i<=56319){if(s+1<t){let o=e.charCodeAt(s+1);if(o>=56320&&o<=57343){let d=65536+(i-55296<<10)+(o-56320);if(ir.has(d)){r=s;break}}}continue}if(ar[i-ze]!==sr||or.has(i)){r=s;break}}}if(r===-1)return e;let n=[];r>0&&n.push(e.slice(0,r));for(let s=r;s<t;s++){let i=e.charCodeAt(s);if(i>=Ys&&i<=Gs||i===Ws){n.push(e[s]);continue}if(i<ze){n.push(or.has(i)?"-":e[s]);continue}if(i>=55296&&i<=56319){if(s+1<t){let d=e.charCodeAt(s+1);if(d>=56320&&d<=57343){let l=65536+(i-55296<<10)+(d-56320),c=ir.get(l);if(c!==void 0){n.push(String.fromCharCode(c+48)),s++;continue}}}n.push(e[s]);continue}if(or.has(i)){n.push("-");continue}let o=ar[i-ze];n.push(o!==sr?String.fromCharCode(o+48):e[s])}return n.join("")}var Ks=fc;var Ec=/^[-+]?0x[a-fA-F0-9]+$/,Tc=/^0b[01]+$/,bc=/^0o[0-7]+$/,Cc=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Ic={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original",unicode:!1};function un(e,t={}){if(t=Object.assign({},Ic,t),!e||typeof e!="string")return e;let r=e.trim();if(r.length===0)return e;if(t.skipLike!==void 0&&t.skipLike.test(r))return e;if(r==="0"||t.unicode&&(r=Ks(r),r==="0"))return 0;if(t.hex&&Ec.test(r))return dn(r,16);if(t.binary&&Tc.test(r))return dn(r,2);if(t.octal&&bc.test(r))return dn(r,8);if(isFinite(r)){if(r.includes("e")||r.includes("E"))return wc(e,r,t);{let n=Cc.exec(r);if(n){let s=n[1]||"",i=n[2],o=xc(n[3]),d=s?r[i.length+1]===".":r[i.length]===".";if(!t.leadingZeros&&(i.length>1||i.length===1&&!d))return e;{let l=Number(r),c=String(l);if(l===0)return l;if(c.search(/[eE]/)!==-1)return t.eNotation?l:e;if(r.indexOf(".")!==-1)return c==="0"||c===o||c===`${s}${o}`?l:e;let m=i?o:r;return i?m===c||s+m===c?l:e:m===c||m===s+c?l:e}}else return e}}else{let n=Number(r);return Number.isNaN(n)?e:Sc(e,n,t)}}var yc=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function wc(e,t,r){if(!r.eNotation)return e;let n=t.match(yc);if(n){let s=n[1]||"",i=n[3].indexOf("e")===-1?"E":"e",o=n[2],d=s?t[o.length+1]===i:t[o.length]===i;return o.length>1&&d?e:o.length===1&&(n[3].startsWith(`.${i}`)||n[3][0]===i)?Number(t):o.length>0?r.leadingZeros&&!d?Number(t):e:Number(t)}else return e}function xc(e){if(e&&e.indexOf(".")!==-1){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e=e.slice(0,t),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1)),e}return e}function dn(e,t){let r=e.trim();if((t===2||t===8)&&(e=r.substring(2)),parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Sc(e,t,r){let n=t===1/0;switch(r.infinity.toLowerCase()){case"null":return null;case"infinity":return t;case"string":return n?"Infinity":"-Infinity";case"original":default:return e}}function An(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(let r of e)if(typeof r=="string"&&t===r||r instanceof RegExp&&r.test(t))return!0}:()=>!1}var Me=class{constructor(t,r={},n){this.pattern=t,this.separator=r.separator||".",this.segments=this._parse(t),this.data=n,this._hasDeepWildcard=this.segments.some(s=>s.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(s=>s.attrName!==void 0),this._hasPositionSelector=this.segments.some(s=>s.position!==void 0)}_parse(t){let r=[],n=0,s="";for(;n<t.length;)t[n]===this.separator?n+1<t.length&&t[n+1]===this.separator?(s.trim()&&(r.push(this._parseSegment(s.trim())),s=""),r.push({type:"deep-wildcard"}),n+=2):(s.trim()&&r.push(this._parseSegment(s.trim())),s="",n++):(s+=t[n],n++);return s.trim()&&r.push(this._parseSegment(s.trim())),r}_parseSegment(t){let r={type:"tag"},n=null,s=t,i=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(i&&(s=i[1]+i[3],i[2])){let m=i[2].slice(1,-1);m&&(n=m)}let o,d=s;if(s.includes("::")){let m=s.indexOf("::");if(o=s.substring(0,m).trim(),d=s.substring(m+2).trim(),!o)throw new Error(`Invalid namespace in pattern: ${t}`)}let l,c=null;if(d.includes(":")){let m=d.lastIndexOf(":"),A=d.substring(0,m).trim(),h=d.substring(m+1).trim();["first","last","odd","even"].includes(h)||/^nth\(\d+\)$/.test(h)?(l=A,c=h):l=d}else l=d;if(!l)throw new Error(`Invalid segment pattern: ${t}`);if(r.tag=l,o&&(r.namespace=o),n)if(n.includes("=")){let m=n.indexOf("=");r.attrName=n.substring(0,m).trim(),r.attrValue=n.substring(m+1).trim()}else r.attrName=n.trim();if(c){let m=c.match(/^nth\((\d+)\)$/);m?(r.position="nth",r.positionValue=parseInt(m[1],10)):r.position=c}return r}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}};var et=class{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._deepByTerminalTag=new Map,this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard()){let i=t.segments[t.segments.length-1];if(i&&i.type!=="deep-wildcard"&&i.tag!=="*"){let o=i.tag;this._deepByTerminalTag.has(o)||this._deepByTerminalTag.set(o,[]),this._deepByTerminalTag.get(o).push(t)}else this._deepWildcards.push(t);return this}let r=t.length,s=t.segments[t.segments.length-1]?.tag;if(!s||s==="*")this._wildcardByDepth.has(r)||this._wildcardByDepth.set(r,[]),this._wildcardByDepth.get(r).push(t);else{let i=`${r}:${s}`;this._byDepthAndTag.has(i)||this._byDepthAndTag.set(i,[]),this._byDepthAndTag.get(i).push(t)}return this}addAll(t){for(let r of t)this.add(r);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return this.findMatch(t)!==null}findMatch(t){let r=t.getDepth(),n=t.getCurrentTag(),s=`${r}:${n}`,i=this._byDepthAndTag.get(s);if(i){for(let l=0;l<i.length;l++)if(t.matches(i[l]))return i[l]}let o=this._wildcardByDepth.get(r);if(o){for(let l=0;l<o.length;l++)if(t.matches(o[l]))return o[l]}let d=this._deepByTerminalTag.get(n);if(d){for(let l=0;l<d.length;l++)if(t.matches(d[l]))return d[l]}for(let l=0;l<this._deepWildcards.length;l++)if(t.matches(this._deepWildcards[l]))return this._deepWildcards[l];return null}};var pn=class{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){let t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){let t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){let r=this._matcher.path;if(r.length!==0)return r[r.length-1].values?.[t]}hasAttr(t){let r=this._matcher.path;if(r.length===0)return!1;let n=r[r.length-1];return n.values!==void 0&&t in n.values}getAnyParentAttr(t){return this._matcher.getAnyParentAttr(t)}hasAnyParentAttr(t){return this._matcher.hasAnyParentAttr(t)}getPosition(){let t=this._matcher.path;return t.length===0?-1:t[t.length-1].position??0}getCounter(){let t=this._matcher.path;return t.length===0?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,r=!0){return this._matcher.toString(t,r)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}},tt=class{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new pn(this),this._keptAttrs=[]}push(t,r=null,n=null,s=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let i=this.path.length,o=this.siblingStacks[i];o||(o={counts:new Map,total:0},this.siblingStacks[i]=o);let d=n?`${n}:${t}`:t,l=o.counts.get(d)||0,c=o.total;o.counts.set(d,l+1),o.total++;let m={tag:t,position:c,counter:l};n!=null&&(m.namespace=n),r!=null&&(m.values=r),this.path.push(m);let A=this.path.length,h=s!==null?s.keep:null;if(h!=null&&h.length>0&&r)for(let f=0;f<h.length;f++){let b=h[f];r[b]!==void 0&&this._keptAttrs.push({depth:A,name:b,value:r[b]})}}pop(){if(this.path.length===0)return;this._pathStringCache=null;let t=this.path.pop();this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1);let r=this.path.length+1;for(;this._keptAttrs.length>0&&this._keptAttrs[this._keptAttrs.length-1].depth>=r;)this._keptAttrs.pop();return t}updateCurrent(t){if(this.path.length>0){let r=this.path[this.path.length-1];t!=null&&(r.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(this.path.length!==0)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(this.path.length===0)return!1;let r=this.path[this.path.length-1];return r.values!==void 0&&t in r.values}getAnyParentAttr(t){let r=this._keptAttrs;for(let n=r.length-1;n>=0;n--)if(r[n].name===t)return r[n].value}hasAnyParentAttr(t){let r=this._keptAttrs;for(let n=r.length-1;n>=0;n--)if(r[n].name===t)return!0;return!1}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,r=!0){let n=t||this.separator;if(n===this.separator&&r===!0){if(this._pathStringCache!==null)return this._pathStringCache;let i=this.path.map(o=>o.namespace?`${o.namespace}:${o.tag}`:o.tag).join(n);return this._pathStringCache=i,i}return this.path.map(i=>r&&i.namespace?`${i.namespace}:${i.tag}`:i.tag).join(n)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[],this._keptAttrs=[]}matches(t){let r=t.segments;return r.length===0?!1:t.hasDeepWildcard()?this._matchWithDeepWildcard(r):this._matchSimple(r)}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let r=0;r<t.length;r++)if(!this._matchSegment(t[r],this.path[r],r===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let r=this.path.length-1,n=t.length-1;for(;n>=0&&r>=0;){let s=t[n];if(s.type==="deep-wildcard"){if(n--,n<0)return!0;let i=t[n],o=!1;for(let d=r;d>=0;d--)if(this._matchSegment(i,this.path[d],d===this.path.length-1)){r=d-1,n--,o=!0;break}if(!o)return!1}else{if(!this._matchSegment(s,this.path[r],r===this.path.length-1))return!1;r--,n--}}return n<0}_matchSegment(t,r,n){if(t.tag!=="*"&&t.tag!==r.tag||t.namespace!==void 0&&t.namespace!=="*"&&t.namespace!==r.namespace||t.attrName!==void 0&&(!n||!r.values||!(t.attrName in r.values)||t.attrValue!==void 0&&String(r.values[t.attrName])!==String(t.attrValue)))return!1;if(t.position!==void 0){if(!n)return!1;let s=r.counter??0;if(t.position==="first"&&s!==0)return!1;if(t.position==="odd"&&s%2!==1)return!1;if(t.position==="even"&&s%2!==0)return!1;if(t.position==="nth"&&s!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>t&&{counts:new Map(t.counts),total:t.total}),keptAttrs:this._keptAttrs.map(t=>({...t}))}}restore(t){this._pathStringCache=null,this.path=t.path.map(r=>({...r})),this.siblingStacks=t.siblingStacks.map(r=>r&&{counts:new Map(r.counts),total:r.total}),this._keptAttrs=(t.keptAttrs||[]).map(r=>({...r}))}readOnly(){return this._view}};var Nc=[{id:"html-script-open",description:"<script opening tag",pattern:/<script[\s>/]/i},{id:"html-script-close",description:"</script closing tag",pattern:/<\/script[\s>]/i},{id:"html-javascript-protocol",description:"javascript: URI scheme (with optional whitespace/encoding)",pattern:/j[\t\n\r ]*a[\t\n\r ]*v[\t\n\r ]*a[\t\n\r ]*s[\t\n\r ]*c[\t\n\r ]*r[\t\n\r ]*i[\t\n\r ]*p[\t\n\r ]*t[\t\n\r ]*:/i},{id:"html-vbscript-protocol",description:"vbscript: URI scheme",pattern:/vbscript[\t\n\r ]*:/i},{id:"html-data-html",description:"data:text/html URI \u2014 can execute scripts in browsers",pattern:/data[\t\n\r ]*:[\t\n\r ]*text\/html/i},{id:"html-data-xhtml",description:"data:application/xhtml+xml URI",pattern:/data[\t\n\r ]*:[\t\n\r ]*application\/xhtml/i},{id:"html-data-svg",description:"data:image/svg+xml URI \u2014 can execute scripts",pattern:/data[\t\n\r ]*:[\t\n\r ]*image\/svg\+xml/i},{id:"html-inline-event-handler",description:"Inline event handler attributes: onclick=, onerror=, onload=, etc.",pattern:/\bon\w{1,30}\s*=/i},{id:"html-entity-obfuscated-script",description:"HTML-entity-encoded <script (e.g. &#x3C;script or &lt;script)",pattern:/(?:&#x0*3[Cc];?|&#0*60;?|&lt;)\s*script/i},{id:"html-entity-obfuscated-javascript",description:'HTML-entity-encoded javascript: (partial \u2014 catches common &#106; or &#x6a; for "j")',pattern:/(?:&#x0*6[Aa];?|&#0*106;?)\s*(?:&#x0*61;?|a)[\s\S]{0,80}script\s*:/i},{id:"html-style-expression",description:"CSS expression() \u2014 IE-era code execution in style attributes",pattern:/style[\s\S]{0,20}expression\s*\(/i},{id:"html-object-embed",description:"<object or <embed tags that can load active content",pattern:/<(?:object|embed)[\s>/]/i},{id:"html-base-tag",description:"<base href= \u2014 can hijack all relative URLs on a page",pattern:/<base[\s>]/i},{id:"html-meta-refresh",description:'<meta http-equiv="refresh" \u2014 can redirect users',pattern:/<meta[\s\S]{0,40}http-equiv[\s\S]{0,20}refresh/i},{id:"html-srcdoc",description:"srcdoc= attribute on iframes \u2014 embeds HTML that can run scripts",pattern:/srcdoc\s*=/i},{id:"html-iframe",description:"<iframe tag",pattern:/<iframe[\s>/]/i},{id:"html-form",description:"<form tag \u2014 can be used for phishing / credential harvesting injection",pattern:/<form[\s>/]/i}],Ue=Nc;var Rc=[{id:"xml-cdata-injection",description:"CDATA section injection: <![CDATA[ breaks out of text node context",pattern:/<!\[CDATA\[/i},{id:"xml-cdata-close",description:"CDATA close sequence: ]]> can terminate an enclosing CDATA section",pattern:/\]\]>/},{id:"xml-processing-instruction",description:"XML processing instruction: <?xml-stylesheet or <?php etc.",pattern:/<\?(?:xml[\- ]|php|asp)/i},{id:"xml-doctype-injection",description:"DOCTYPE declaration embedded in content \u2014 can define entities",pattern:/<!DOCTYPE(?:[\s[]|$)/i},{id:"xml-entity-system",description:"SYSTEM keyword \u2014 used in external entity declarations (XXE)",pattern:/\bSYSTEM\s+["']/i},{id:"xml-entity-public",description:"PUBLIC keyword \u2014 used in external entity declarations (XXE)",pattern:/\bPUBLIC\s+["']/i},{id:"xml-entity-declaration",description:"<!ENTITY declaration \u2014 defines entities, potential XXE or entity expansion",pattern:/<!ENTITY[\s%]/i},{id:"xml-billion-laughs",description:"Entity reference chaining / billion laughs: repeated &eX; style references",pattern:/(?:&\w{1,20};){3,}/},{id:"xml-namespace-confusion",description:"xmlns: attribute injection \u2014 can redefine namespaces to confuse parsers",pattern:/\bxmlns(?::\w{1,40})?\s*=/i},{id:"xml-comment-injection",description:"<!-- comment injection \u2014 can hide content from some parsers",pattern:/<!--/},{id:"xml-comment-close",description:"--> closes an enclosing XML comment",pattern:/-->/},{id:"xml-pi-close",description:"?> closes an enclosing processing instruction",pattern:/\?>/}],Fe=Rc;var _c=[{id:"svg-script-element",description:"<script element inside SVG executes JavaScript",pattern:/<script[\s>/]/i},{id:"svg-xlink-href-javascript",description:"xlink:href with javascript: \u2014 classic SVG XSS via <a> or <use>",pattern:/xlink\s*:\s*href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-href-javascript",description:"href= with javascript: in SVG context (<a>, <animate>, etc.)",pattern:/href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-foreignobject",description:"<foreignObject embeds HTML inside SVG \u2014 can execute scripts",pattern:/<foreignObject[\s>/]/i},{id:"svg-use-external",description:"<use xlink:href or href pointing to external resource (non-fragment URL)",pattern:/<use[\s\S]{0,60}(?:xlink\s*:\s*)?href\s*=\s*(?:["'][^#]|[^"'#\s>])/i},{id:"svg-animate-href",description:'<animate attributeName="href" \u2014 can dynamically change href to javascript:',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*href["']/i},{id:"svg-animate-xlinkhref",description:'<animate attributeName="xlink:href"',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*xlink\s*:\s*href["']/i},{id:"svg-set-javascript",description:'<set to="javascript:..." \u2014 sets an attribute to a javascript: URI',pattern:/<set[\s\S]{0,80}to\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-event-handler",description:"SVG-specific event handler attributes: onload=, onerror=, onactivate=, etc.",pattern:/\bon(?:load|error|activate|begin|end|repeat|focus|blur|click|mouse\w{1,20}|key\w{1,20})\s*=/i},{id:"svg-handler-generic",description:"Generic on* handler catch-all for SVG attributes",pattern:/\bon\w{1,30}\s*=/i},{id:"svg-filter-feimage",description:"<feImage href= \u2014 filter primitive that can load external resources",pattern:/<feImage[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=/i},{id:"svg-image-external",description:"<image xlink:href with http/https or javascript protocol",pattern:/<image[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=\s*["']?\s*(?:https?|javascript)\s*:/i},{id:"svg-style-javascript",description:"style= attribute containing javascript: (e.g. background:url(javascript:...))",pattern:/style\s*=[\s\S]{0,60}javascript\s*:/i}],cr=_c;var vc=[{id:"sql-block-comment-open",description:"SQL block comment open: /* ... */ \u2014 unusual in legitimate user text",pattern:/\/\*/},{id:"sql-union-select",description:"UNION SELECT \u2014 most common SQL injection aggregation attack",pattern:/\bUNION\s{1,20}(?:ALL\s{1,20})?SELECT\b/i},{id:"sql-drop-table",description:"DROP TABLE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}TABLE\b/i},{id:"sql-drop-database",description:"DROP DATABASE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}DATABASE\b/i},{id:"sql-insert-into",description:"INSERT INTO \u2014 data injection",pattern:/\bINSERT\s{1,20}INTO\b/i},{id:"sql-delete-from",description:"DELETE FROM \u2014 data deletion injection",pattern:/\bDELETE\s{1,20}FROM\b/i},{id:"sql-update-set",description:"UPDATE ... SET \u2014 data modification injection",pattern:/\bUPDATE\b[\s\S]{1,60}\bSET\b/i},{id:"sql-exec-xp",description:"EXEC xp_ \u2014 MSSQL extended stored procedure execution",pattern:/\bEXEC(?:UTE)?\s{1,20}xp_/i},{id:"sql-tautology-string",description:`Classic string tautology: ' OR '1'='1 or " OR "1"="1"`,pattern:/'\s{0,10}OR\s{0,10}'[^']{0,20}'\s*=\s*'[^']{0,20}/i},{id:"sql-tautology-numeric",description:"Numeric tautology: OR 1=1",pattern:/\bOR\s{1,10}1\s*=\s*1\b/i},{id:"sql-always-true-zero",description:"Numeric tautology: OR 0=0",pattern:/\bOR\s{1,10}0\s*=\s*0\b/i},{id:"sql-sleep-benchmark",description:"Time-based blind injection: SLEEP() or BENCHMARK()",pattern:/\b(?:SLEEP|BENCHMARK)\s*\(/i},{id:"sql-waitfor-delay",description:"MSSQL time-based blind injection: WAITFOR DELAY",pattern:/\bWAITFOR\s{1,20}DELAY\b/i},{id:"sql-char-function",description:"CHAR() function \u2014 used to obfuscate injected strings",pattern:/\bCHAR\s*\(\s*\d{1,3}/i},{id:"sql-information-schema",description:"INFORMATION_SCHEMA \u2014 reconnaissance query for table/column enumeration",pattern:/\bINFORMATION_SCHEMA\b/i}],yt=vc;var Lc=[{id:"shell-path-traversal-unix",description:"Unix path traversal: ../ \u2014 climbing the directory tree",pattern:/\.\.\//},{id:"shell-path-traversal-windows",description:"Windows path traversal: ..\\ \u2014 climbing the directory tree",pattern:/\.\.\\/},{id:"shell-path-traversal-encoded",description:"URL-encoded path traversal: %2e%2e or %2f variants",pattern:/%2e%2e|%2f\.\.|\.\.%2f/i},{id:"shell-null-byte",description:"Null byte injection: \\x00 or %00 \u2014 truncates strings in C-backed functions",pattern:/\x00|%00/},{id:"shell-semicolon",description:"Semicolon command separator: cmd1; cmd2",pattern:/;/},{id:"shell-pipe",description:"Pipe operator: cmd1 | cmd2",pattern:/\|/},{id:"shell-and-operator",description:"AND operator: cmd1 && cmd2",pattern:/&&/},{id:"shell-or-operator",description:"OR operator: cmd1 || cmd2",pattern:/\|\|/},{id:"shell-backtick",description:"Backtick command substitution: `cmd`",pattern:/`/},{id:"shell-dollar-paren",description:"Dollar-paren command substitution: $(cmd)",pattern:/\$\(/},{id:"shell-dollar-brace",description:"Dollar-brace variable expansion: ${var} \u2014 can be abused for injection",pattern:/\$\{/},{id:"shell-redirect-out",description:"Output redirection: cmd > file or cmd >> file",pattern:/>{1,2}/},{id:"shell-redirect-in",description:"Input redirection: cmd < file",pattern:/</},{id:"shell-newline-injection",description:"Newline injection: \\n or \\r \u2014 can inject new shell commands",pattern:/[\n\r]/},{id:"shell-glob-star",description:"Glob expansion: * or ? \u2014 can expand to unintended files",pattern:/[/\\][*?]/},{id:"shell-absolute-root",description:"Absolute root path injection: string starting with / or \\ (Windows UNC)",pattern:/^(?:\/|\\\\)/},{id:"shell-windows-drive",description:"Windows drive letter path injection: C:\\ or D:/",pattern:/^[a-zA-Z]:[/\\]/},{id:"shell-curl-wget",description:"curl/wget with URL or flags \u2014 can exfiltrate data or download payloads",pattern:/\b(?:curl|wget)\s+(?:https?:\/\/|ftp:\/\/|-)/i}],hn=Lc;var Oc=[{id:"redos-nested-quantifier-plus",description:"Nested + quantifier inside a group with outer quantifier: (a+)+, (.+b)*, etc.",pattern:/\([^)]*\+[^)]*\)[+*]/},{id:"redos-nested-quantifier-star",description:"Nested * quantifier: (a*)* or (a*)+ \u2014 catastrophic backtracking",pattern:/\([^)]*\*[^)]*\)[*+]/},{id:"redos-nested-groups",description:"Doubly nested quantified groups: ((a+)+) \u2014 guaranteed catastrophic",pattern:/\(\([^)]{0,40}\)[+*]\)[+*]/},{id:"redos-alternation-overlap",description:"Overlapping alternation under quantifier: (a|a)+ \u2014 ambiguous NFA paths",pattern:/\(([^|()]{1,20})\|(?:\1)(?:\|[^|()]{1,20}){0,5}\)[+*?]{1,2}/},{id:"redos-star-plus-concat",description:"(x*x)+ pattern \u2014 triggers super-linear backtracking",pattern:/\([^)]{0,10}\*[^)]{0,10}\)[+*]/},{id:"redos-dot-star-greedy",description:"(.*){n,} or (.+){n,} \u2014 repeated greedy dot quantifiers",pattern:/\(\.[*+]\)\{?\d/},{id:"redos-large-repetition",description:"Very large fixed or range repetition count {1000,} or {1000,n} \u2014 denial of service via backtracking",pattern:/\{\d{4,}(?:,\d*)?\}/},{id:"redos-catastrophic-alternation",description:"Long alternation with many similar branches \u2014 polynomial backtracking risk",pattern:/\([^)]{0,200}(?:\|[^|)]{0,50}){9,}\)/}],gn=Oc;var ae=`["'\\s]*:`,Dc=[{id:"nosql-where-operator",description:"$where \u2014 executes arbitrary JavaScript server-side in MongoDB",pattern:new RegExp(`\\$where${ae}`,"i")},{id:"nosql-ne-operator",description:'$ne \u2014 "not equal" operator used to bypass equality checks',pattern:new RegExp(`\\$ne${ae}`,"i")},{id:"nosql-gt-operator",description:'$gt \u2014 "greater than" used to bypass password/value checks',pattern:new RegExp(`\\$gte?${ae}`,"i")},{id:"nosql-lt-operator",description:'$lt / $lte \u2014 "less than" bypass variants',pattern:new RegExp(`\\$lte?${ae}`,"i")},{id:"nosql-regex-operator",description:"$regex \u2014 can be used to extract data character by character (blind injection)",pattern:new RegExp(`\\$regex${ae}`,"i")},{id:"nosql-or-operator",description:"$or \u2014 logical OR; used to create always-true conditions",pattern:new RegExp(`\\$or${ae}\\s*\\[`,"i")},{id:"nosql-and-operator",description:"$and \u2014 logical AND operator injection",pattern:new RegExp(`\\$and${ae}\\s*\\[`,"i")},{id:"nosql-nor-operator",description:"$nor \u2014 logical NOR operator injection",pattern:new RegExp(`\\$nor${ae}\\s*\\[`,"i")},{id:"nosql-exists-operator",description:"$exists \u2014 can enumerate fields to determine schema",pattern:new RegExp(`\\$exists${ae}`,"i")},{id:"nosql-in-operator",description:"$in \u2014 matches any value in a list; can enumerate values",pattern:new RegExp(`\\$in${ae}\\s*\\[`,"i")},{id:"nosql-expr-operator",description:"$expr \u2014 allows aggregation expressions in queries (MongoDB 3.6+)",pattern:new RegExp(`\\$expr${ae}`,"i")},{id:"nosql-function-operator",description:"$function \u2014 executes arbitrary JavaScript in MongoDB 4.4+",pattern:new RegExp(`\\$function${ae}`,"i")},{id:"nosql-accumulator-operator",description:"$accumulator \u2014 custom aggregation with arbitrary JS execution",pattern:new RegExp(`\\$accumulator${ae}`,"i")},{id:"nosql-proto-pollution",description:"__proto__ \u2014 prototype pollution via object key injection",pattern:/__proto__/},{id:"nosql-constructor-prototype",description:"constructor.prototype \u2014 alternative prototype pollution vector (dot notation or JSON key)",pattern:/constructor[\s"':.,{\[]*prototype/i},{id:"nosql-proto-bracket",description:'["__proto__"] \u2014 bracket-notation prototype pollution',pattern:/\[["']__proto__["']\]/}],mn=Dc;var kc=[{id:"log-crlf-injection",description:"CRLF injection: literal \\r or \\n embeds fake log lines",pattern:/[\r\n]/},{id:"log-url-encoded-crlf",description:"URL-encoded CRLF: %0d, %0a, %0D, %0A \u2014 decoded by some log parsers",pattern:/%0[dDaA]/},{id:"log-unicode-newline",description:"Unicode newline variants: U+2028 (line separator), U+2029 (paragraph separator)",pattern:/[\u2028\u2029]/},{id:"log-log4shell-jndi",description:"Log4Shell: ${jndi:...} triggers remote code execution in Apache Log4j",pattern:/\$\{jndi\s*:/i},{id:"log-log4shell-obfuscated",description:"Obfuscated Log4Shell: ${::-j}... lookup-bypass prefix used to evade WAF detection",pattern:/\$\{::-/},{id:"log-log4j-lookup",description:"Log4j lookup syntax: ${env:...}, ${sys:...}, ${ctx:...} \u2014 data exfiltration",pattern:/\$\{(?:env|sys|ctx|main|map|sd|web|docker|k8s|spring)\s*:/i},{id:"log-ssti-double-brace",description:"SSTI double-brace: {{expression}} \u2014 Jinja2, Twig, Handlebars, etc.",pattern:/\{\{[\s\S]{0,80}\}\}/},{id:"log-ssti-hash-brace",description:"SSTI hash-brace: #{expression} \u2014 Thymeleaf, Velocity, Ruby ERB",pattern:/#\{[\s\S]{0,80}\}/},{id:"log-ssti-dollar-brace",description:"SSTI/EL injection: ${expression with operators or method calls} \u2014 JSP EL, Freemarker, SpEL",pattern:/\$\{[^}]*(?:\.|\(|\*|\+|\bclass\b|\bruntime\b|\bprocess\b|\bexec\b)[^}]{0,80}\}/i},{id:"log-ssti-percent-tag",description:"SSTI ERB/ASP tag: <%= expression %> \u2014 Ruby ERB, ASP",pattern:/<%=[\s\S]{0,80}%>/},{id:"log-null-byte",description:"Null byte: \\x00 or %00 \u2014 can truncate log entries in C-backed loggers",pattern:/\x00|%00/},{id:"log-ansi-escape",description:"ANSI escape sequence: ESC[ \u2014 can manipulate terminal output when logs are tailed",pattern:/\x1b\[/}],fn=kc;var Bc=[{id:"sql-line-comment",description:"SQL line comment: -- followed by whitespace or end of string",pattern:/--(?:\s|$)/},{id:"sql-stacked-query",description:"Stacked queries: semicolon immediately followed by a SQL keyword",pattern:/;\s{0,10}(?:SELECT|INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|EXEC)\b/i},{id:"sql-hex-encoding",description:"Hex-encoded string injection: 0x41414141 style (MySQL)",pattern:/\b0x[0-9a-f]{4,}/i}],Pc=[...yt,...Bc],En=Pc;var Js=Object.freeze({colon:":",Tab:" ",NewLine:`
8
+ `}),Mc=/&(?:#[xX]0*([0-9a-fA-F]{1,6});?|#0*([0-9]{1,7});?|([a-zA-Z][a-zA-Z0-9]{1,15});)/g;function Tn(e){return e.indexOf("&")===-1?e:e.replace(Mc,(t,r,n,s)=>{if(s!==void 0)return Object.prototype.hasOwnProperty.call(Js,s)?Js[s]:t;let i=r!==void 0?parseInt(r,16):parseInt(n,10);return!Number.isFinite(i)||i>1114111?t:String.fromCodePoint(i)})}Ue.label="HTML";Fe.label="XML";cr.label="SVG";Ue.decodeEntities=!0;Fe.decodeEntities=!0;cr.decodeEntities=!0;yt.label="SQL";En.label="SQL-STRICT";hn.label="SHELL";gn.label="REDOS";mn.label="NOSQL";fn.label="LOG";var Tg=Object.freeze({HTML:Ue,XML:Fe,SVG:cr,SQL:yt,"SQL-STRICT":En,SHELL:hn,REDOS:gn,NOSQL:mn,LOG:fn});function Uc(e){if(typeof e!="string")throw new TypeError(`is-unsafe: first argument must be a string, got ${typeof e}`)}function Fc(e){if(!(e instanceof RegExp)){if(Array.isArray(e)){if(e.length===0)throw new TypeError("is-unsafe: context must not be an empty array");if(Array.isArray(e[0])){for(let t of e)if(!Array.isArray(t)||t.length===0)throw new TypeError("is-unsafe: each context in the array must be a non-empty pattern array (PatternList)")}return}throw new TypeError(`is-unsafe: second argument must be a PatternList (e.g. HTML), an array of PatternLists (e.g. [HTML, XML]), or a RegExp. Got: ${typeof e}`)}}function Hc(e){return e instanceof RegExp?{lists:null,regex:e}:Array.isArray(e[0])?{lists:e,regex:null}:{lists:[e],regex:null}}function Qc(e,t){if(!t.decodeEntities)return null;let r=Tn(e);return r===e?null:r}function Yc(e,t){let r=t.label??"CUSTOM",n=Qc(e,t);for(let s of t)if(s.pattern.test(e)||n!==null&&s.pattern.test(n))return{context:r,id:s.id,description:s.description,pattern:s.pattern};return null}function js(e,t){Uc(e),Fc(t);let{lists:r,regex:n}=Hc(t);if(n)return n.test(e);for(let s of r)if(Yc(e,s)!==null)return!0;return!1}function Gc(e,t){if(!e)return{};let r=t.attributesGroupName?e[t.attributesGroupName]:e;if(!r)return{};let n={};for(let s in r)if(s.startsWith(t.attributeNamePrefix)){let i=s.substring(t.attributeNamePrefix.length);n[i]=r[s]}else n[s]=r[s];return n}function Wc(e){if(!e||typeof e!="string")return;let t=e.indexOf(":");if(t!==-1&&t>0){let r=e.substring(0,t);if(r!=="xmlns")return r}}var wt=class{constructor(t,r){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Xc,this.parseTextData=Kc,this.resolveNameSpace=Jc,this.buildAttributesMap=Vc,this.isItStopNode=zc,this.replaceEntitiesValue=$c,this.readStopNodeData=rl,this.saveTextToParentTag=qc,this.addChild=Zc,this.ignoreAttributesFn=An(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.doctypefound=!1;let n={...Tt};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?n=this.options.htmlEntities:this.options.htmlEntities===!0&&(n={...an,...sn}),this.entityDecoder=new qe({namedEntities:{...n,...r},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo},onInputEntity:(i,o)=>js(o,[Ue,Fe])?$e.BLOCK:$e.ALLOW})),this.matcher=new tt,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new et;let s=this.options.stopNodes;if(s&&s.length>0){for(let i=0;i<s.length;i++){let o=s[i];typeof o=="string"?this.stopNodeExpressionsSet.add(new Me(o)):o instanceof Me&&this.stopNodeExpressionsSet.add(o)}this.stopNodeExpressionsSet.seal()}}};function Kc(e,t,r,n,s,i,o){let d=this.options;if(e!==void 0&&(d.trimValues&&!n&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e,t,r));let l=d.jPath?r.toString():r,c=d.tagValueProcessor(t,e,l,s,i);return c==null?e:typeof c!=typeof e||c!==e?c:d.trimValues||e.trim()===e?In(e,d.parseTagValue,d.numberParseOptions):e}}function Jc(e){if(this.options.removeNSPrefix){let t=e.split(":"),r=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=r+t[1])}return e}var jc=/([^\s=]+)\s*(=\s*(?:"([^"]*)"|'([^']*)'))?/gm;function Vs(e){return e[3]!==void 0?e[3]:e[4]}function Vc(e,t,r,n=!1){let s=this.options;if(n===!0||s.ignoreAttributes!==!0&&typeof e=="string"){let i=Rs(e,jc),o=i.length,d={},l=new Array(o),c=!1,m={};for(let f=0;f<o;f++){let b=this.resolveNameSpace(i[f][1]),y=Vs(i[f]);if(b.length&&y!==void 0){let C=y;s.trimValues&&(C=C.trim()),C=this.replaceEntitiesValue(C,r,this.readonlyMatcher),l[f]=C,m[b]=C,c=!0}}c&&typeof t=="object"&&t.updateCurrent&&t.updateCurrent(m);let A=s.jPath?t.toString():this.readonlyMatcher,h=!1;for(let f=0;f<o;f++){let b=this.resolveNameSpace(i[f][1]);if(this.ignoreAttributesFn(b,A))continue;let y=s.attributeNamePrefix+b;if(b.length)if(s.transformAttributeName&&(y=s.transformAttributeName(y)),y=Xs(y,s),Vs(i[f])!==void 0){let C=l[f],R=s.attributeValueProcessor(b,C,A);R==null?d[y]=C:typeof R!=typeof C||R!==C?d[y]=R:d[y]=In(C,s.parseAttributeValue,s.numberParseOptions),h=!0}else s.allowBooleanAttributes&&(d[y]=!0,h=!0)}if(!h)return;if(s.attributesGroupName&&!s.preserveOrder){let f={};return f[s.attributesGroupName]=d,f}return d}}var Xc=function(e){let t=this.options,r=t.captureMetaData?[]:void 0;e=e.replace(/\r\n?/g,t.captureMetaData?(l,c)=>(l.length===2&&r.push(c-r.length),`
9
9
  `):`
10
- `);let n=new re("!xml"),s=n,i="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0,this.doctypefound=!1;let o=new It(t.processEntities),d=e.length;for(let l=0;l<d;l++)if(e[l]==="<"){let m=e.charCodeAt(l+1);if(m===47){let A=rt(e,">",l,"Closing Tag is not closed."),h=e.substring(l+2,A).trim();if(t.removeNSPrefix){let b=h.indexOf(":");b!==-1&&(h=h.substr(b+1))}h=Tn(t.transformTagName,h,"",t).tagName,s&&(i=this.saveTextToParentTag(i,s,this.readonlyMatcher));let f=this.matcher.getCurrentTag();if(h&&t.unpairedTagsSet.has(h))throw new Error(`Unpaired tag can not be used as closing tag: </${h}>`);f&&t.unpairedTagsSet.has(f)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=this.tagsNodeStack.pop()||n,t.captureMetaData&&s&&s.addEndIndex(He(A+1,r)),i="",l=A}else if(m===63){let A=bn(e,l,!1,"?>");if(!A)throw new Error("Pi Tag is not closed.");i=this.saveTextToParentTag(i,s,this.readonlyMatcher);let h=this.buildAttributesMap(A.tagExp,this.matcher,A.tagName,!0);if(h){let f=h[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(f)||1),o.setXmlVersion(Number(f)||1)}if(!(t.ignoreDeclaration&&A.tagName==="?xml"||t.ignorePiTags)){let f=new re(A.tagName);f.add(t.textNodeName,""),A.tagName!==A.tagExp&&A.attrExpPresent&&t.ignoreAttributes!==!0&&(f[":@"]=h);let b=t.captureMetaData?He(l,r):l;this.addChild(s,f,this.readonlyMatcher,b),t.captureMetaData&&s.addEndIndex(He(A.closeIndex+2,r))}l=A.closeIndex+1}else if(m===33&&e.charCodeAt(l+2)===45&&e.charCodeAt(l+3)===45){let A=rt(e,"-->",l+4,"Comment is not closed.");if(t.commentPropName){let h=e.substring(l+4,A-2);i=this.saveTextToParentTag(i,s,this.readonlyMatcher),s.add(t.commentPropName,[{[t.textNodeName]:h}])}l=A}else if(m===33&&e.charCodeAt(l+2)===68){if(this.doctypefound)throw new Error("Multiple DOCTYPE declarations found.");this.doctypefound=!0;let A=o.readDocType(e,l);this.entityDecoder.addInputEntities(A.entities),l=A.i}else if(m===33&&e.charCodeAt(l+2)===91){let A=rt(e,"]]>",l,"CDATA is not closed.")-2,h=e.substring(l+9,A);i=this.saveTextToParentTag(i,s,this.readonlyMatcher);let f=this.parseTextData(h,s.tagname,this.readonlyMatcher,!0,!1,!0,!0);f==null&&(f=""),t.cdataPropName?s.add(t.cdataPropName,[{[t.textNodeName]:h}]):s.add(t.textNodeName,f),l=A+2}else{let A=bn(e,l,t.removeNSPrefix);if(!A){let v=e.substring(Math.max(0,l-50),Math.min(d,l+50));throw new Error(`readTagExp returned undefined at position ${l}. Context: "${v}"`)}let h=A.tagName,f=A.rawTagName,b=A.tagExp,y=A.attrExpPresent,C=A.closeIndex;if({tagName:h,tagExp:b}=Tn(t.transformTagName,h,b,t),t.strictReservedNames&&(h===t.commentPropName||h===t.cdataPropName||h===t.textNodeName||h===t.attributesGroupName))throw new Error(`Invalid tag name: ${h}`);s&&i&&s.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,s,this.readonlyMatcher,!1));let N=s;N&&t.unpairedTagsSet.has(N.tagname)&&(s=this.tagsNodeStack.pop(),this.matcher.pop());let S=!1;b.length>0&&b.lastIndexOf("/")===b.length-1&&(S=!0,h[h.length-1]==="/"?(h=h.substr(0,h.length-1),b=h):b=b.substr(0,b.length-1),y=h!==b);let _=null,B={},L;L=Fc(f),h!==n.tagname&&this.matcher.push(h,{},L),h!==b&&y&&(_=this.buildAttributesMap(b,this.matcher,h),_&&(B=Uc(_,t))),h!==n.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let M=t.captureMetaData?He(l,r):l;if(this.isCurrentNodeStopNode){let v="";if(S)l=A.closeIndex;else if(t.unpairedTagsSet.has(h))l=A.closeIndex;else{let k=this.readStopNodeData(e,f,C+1);if(!k)throw new Error(`Unexpected end of ${f}`);l=k.i,v=k.tagContent}let x=new re(h);_&&(x[":@"]=_),x.add(t.textNodeName,v),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(s,x,this.readonlyMatcher,M),t.captureMetaData&&s.addEndIndex(He(l+1,r))}else{if(S){({tagName:h,tagExp:b}=Tn(t.transformTagName,h,b,t));let v=new re(h);_&&(v[":@"]=_),this.addChild(s,v,this.readonlyMatcher,M),t.captureMetaData&&s.addEndIndex(He(C+1,r)),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(t.unpairedTagsSet.has(h)){let v=new re(h);_&&(v[":@"]=_),this.addChild(s,v,this.readonlyMatcher,M),t.captureMetaData&&s.addEndIndex(He(A.closeIndex+1,r)),this.matcher.pop(),this.isCurrentNodeStopNode=!1,l=A.closeIndex;continue}else{let v=new re(h);if(this.tagsNodeStack.length>t.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(s),_&&(v[":@"]=_),this.addChild(s,v,this.readonlyMatcher,M),s=v}i="",l=C}}}else i+=e[l];return n.child};function He(e,t){let r=0,n=t.length;for(;r<n;){let s=Math.floor((r+n)/2);t[s]<e?r=s+1:n=s}return e+r}function Kc(e,t,r,n){this.options.captureMetaData||(n=void 0);let s=this.options.jPath?r.toString():r,i=this.options.updateTag(t.tagname,s,t[":@"]);i===!1||(typeof i=="string"&&(t.tagname=i),e.addChild(t,n))}function Jc(e,t,r){let n=this.options.processEntities;if(!n||!n.enabled)return e;if(n.allowedTags){let s=this.options.jPath?r.toString():r;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(t):n.allowedTags(t,s)))return e}if(n.tagFilter){let s=this.options.jPath?r.toString():r;if(!n.tagFilter(t,s))return e}return this.entityDecoder.decode(e)}function $c(e,t,r,n){return e&&(n===void 0&&(n=t.child.length===0),e=this.parseTextData(e,t.tagname,r,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,n),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function jc(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function Vc(e,t,r=">"){let n=e.length,s=r.charCodeAt(0),i=r.length>1?r.charCodeAt(1):-1,o="",d=t;for(let l=t;l<n;l++){let c=e.charCodeAt(l);if(c===34||c===39){if(l=e.indexOf(e[l],l+1),l===-1)return}else if(c===s)if(i!==-1){if(e.charCodeAt(l+1)===i)return o+=e.substring(d,l),{data:o,index:l}}else return o+=e.substring(d,l),{data:o,index:l};else c===9&&(o+=e.substring(d,l)+" ",d=l+1)}}function rt(e,t,r,n){let s=e.indexOf(t,r);if(s===-1)throw new Error(n);return s+t.length-1}function Xc(e,t,r,n){let s=e.indexOf(t,r);if(s===-1)throw new Error(n);return s}function bn(e,t,r,n=">"){let s=Vc(e,t+1,n);if(!s)return;let i=s.data,o=s.index,d=i.search(/\s/),l=i,c=!0;d!==-1&&(l=i.substring(0,d),i=i.substring(d+1).trimStart());let m=l;if(r){let A=l.indexOf(":");A!==-1&&(l=l.substr(A+1),c=l!==s.data.substr(A+1))}return{tagName:l,tagExp:i,closeIndex:o,attrExpPresent:c,rawTagName:m}}function Zc(e,t,r){let n=r,s=1,i=!1,o=-1,d=e.length;for(;r<d;r++)if(e[r]==="<"){let l=e.charCodeAt(r+1);if(l===47){let c=Xc(e,">",r,`${t} is not closed`);if(e.substring(r+2,c).trim()===t&&(s--,s===0))return{tagContent:e.substring(n,r),i:c};r=c}else if(l===63)r=rt(e,"?>",r+1,"StopNode is not closed.");else if(l===33&&e.charCodeAt(r+2)===45&&e.charCodeAt(r+3)===45)r=rt(e,"-->",r+3,"StopNode is not closed.");else if(l===33&&e.charCodeAt(r+2)===91)r=rt(e,"]]>",r,"StopNode is not closed.")-2;else{let c=i?void 0:bn(e,r,!1);if(c)c.tagName===t&&c.tagExp[c.tagExp.length-1]!=="/"&&s++,r=c.closeIndex;else{if(i=!0,o<r&&(o=e.indexOf(">",r),o===-1))return;let m=e.indexOf("<",r+1);if(m===-1||m>o){let A=e.substring(r+1,o),h=A.search(/\s/);(h===-1?A:A.substring(0,h))===t&&A[A.length-1]!=="/"&&s++,r=o}}}}}function Cn(e,t,r){if(t&&typeof e=="string"){let n=e.trim();return n==="true"?!0:n==="false"?!1:dn(e,r)}else return Ss(e)?e:""}function Tn(e,t,r,n){if(e){let s=e(t);r===t&&(r=s),t=s}return t=Js(t,n),{tagName:t,tagExp:r}}function Js(e,t){if(tr.includes(e))throw new Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return ft.includes(e)?t.onDangerousProperty(e):e}var In=re.getMetaDataSymbol();function zc(e,t){if(!e||typeof e!="object")return{};if(!t)return e;let r={};for(let n in e)if(n.startsWith(t)){let s=n.substring(t.length);r[s]=e[n]}else r[n]=e[n];return r}function yn(e,t,r,n){return $s(e,t,r,n)}function $s(e,t,r,n){let s,i={};for(let o=0;o<e.length;o++){let d=e[o],l=qc(d);if(l!==void 0&&l!==t.textNodeName){let c=zc(d[":@"]||{},t.attributeNamePrefix);r.push(l,c)}if(l===t.textNodeName)s===void 0?s=d[l]:s+=""+d[l];else{if(l===void 0)continue;if(d[l]){let c=$s(d[l],t,r,n),m=tl(c,t);if(Object.keys(c).length===0&&t.alwaysCreateTextNode&&(c[t.textNodeName]=""),d[":@"]?el(c,d[":@"],n,t):Object.keys(c).length===1&&c[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?c=c[t.textNodeName]:Object.keys(c).length===0&&(t.alwaysCreateTextNode?c[t.textNodeName]="":c=""),d[In]!==void 0&&typeof c=="object"&&c!==null&&(c[In]=d[In]),i[l]!==void 0&&Object.prototype.hasOwnProperty.call(i,l))Array.isArray(i[l])||(i[l]=[i[l]]),i[l].push(c);else{let A=t.jPath?n.toString():n;t.isArray(l,A,m)?i[l]=[c]:i[l]=c}l!==void 0&&l!==t.textNodeName&&r.pop()}}}return typeof s=="string"?s.length>0&&(i[t.textNodeName]=s):s!==void 0&&(i[t.textNodeName]=s),i}function qc(e){let t=Object.keys(e);for(let r=0;r<t.length;r++){let n=t[r];if(n!==":@")return n}}function el(e,t,r,n){if(t){let s=Object.keys(t),i=s.length;for(let o=0;o<i;o++){let d=s[o],l=d.startsWith(n.attributeNamePrefix)?d.substring(n.attributeNamePrefix.length):d,c=n.jPath?r.toString()+"."+l:r;n.isArray(d,c,!0,!0)?e[d]=[t[d]]:e[d]=t[d]}}}function tl(e,t){let{textNodeName:r}=t,n=Object.keys(e).length;return!!(n===0||n===1&&(e[r]||typeof e[r]=="boolean"||e[r]===0))}var nt=class{constructor(t){this.externalEntities={},this.options=ks(t)}parse(t,r){if(typeof t!="string"&&t.toString)t instanceof Uint8Array&&!(typeof Buffer<"u"&&Buffer.isBuffer(t))?t=new TextDecoder("utf-8",{ignoreBOM:!0}).decode(t):t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(r){r===!0&&(r={});let i=rr(t,r);if(i!==!0)throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`)}let n=new wt(this.options,this.externalEntities),s=n.parseXml(t);return this.options.preserveOrder||s===void 0?s:yn(s,this.options,n.matcher,n.readonlyMatcher)}addEntity(t,r){if(r.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(r==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=r}static getMetaDataSymbol(){return re.getMetaDataSymbol()}};var js={validate:rr};var rl=/\.(?:avif|bmp|css|csv|docx?|eot|gif|gz|ico|jpe?g|js|json|map|mp3|mp4|mov|ogg|otf|pdf|png|pptx?|rar|rss|svg|tar|tiff?|ttf|txt|wav|webm|webp|woff2?|xlsx?|xml|zip)$/i;function G(e,t,{includeQuery:r=!1}={}){let n;try{n=t?new URL(e,t):new URL(e)}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:(n.hash="",r||(n.search=""),n.pathname.length>1&&n.pathname.endsWith("/")&&(n.pathname=n.pathname.replace(/\/+$/,"")),n.href)}function ue(e,t){try{return new URL(e).origin===t}catch{return!1}}function lr(e){try{let t=new URL(e);return!rl.test(t.pathname)}catch{return!1}}var wn=10*1024*1024,Vs=100,sl=5e4,il=new nt({ignoreAttributes:!1,removeNSPrefix:!0,trimValues:!0});function dr(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function Xs(e){return(e===void 0?[]:Array.isArray(e)?e:[e]).flatMap(r=>{let n=dr(r)?.loc;return typeof n=="string"?[n]:[]})}function al(e,t,r){let s=t.toLowerCase().endsWith(".gz")||r.includes("gzip")||e[0]===31&&e[1]===139?nl(e):e;if(s.byteLength>wn)throw new Error(`sitemap exceeds ${wn} bytes after decompression: ${t}`);return s.toString("utf8").replace(/^\uFEFF/,"")}function Zs(e,t){let r=js.validate(e);if(r!==!0)throw new Error(`invalid sitemap XML at ${t}: ${r.err.msg}`);let n=dr(il.parse(e)),s=dr(n?.sitemapindex);if(s)return{kind:"index",locations:Xs(s.sitemap)};let i=dr(n?.urlset);if(i)return{kind:"urlset",locations:Xs(i.url)};throw new Error(`XML is not a sitemap urlset or sitemapindex: ${t}`)}function zs(e){return{fetch:e.fetch??globalThis.fetch,timeout:e.timeout,maxRedirects:e.maxRedirects??10,retries:e.retries??2,signal:e.signal,gate:e.requestGate?async t=>e.requestGate?.(t):void 0,onEvent:e.onEvent}}async function qs(e,t){let{response:r}=await ve(e,{headers:{accept:"application/xml,text/xml,application/gzip,text/plain;q=0.9,*/*;q=0.1","user-agent":t.userAgent}},zs(t));if(!r.ok)throw await r.body?.cancel(),new Error(`sitemap returned HTTP ${r.status}: ${e}`);let{buffer:n}=await ke(r,wn);return al(n,e,r.headers.get("content-type")?.toLowerCase()??"")}async function ol(e,t){try{let r=await qs(e,t);return Zs(r,e),!0}catch{return!1}}async function ei(e,t){let r=G(e,void 0);if(!r)throw new Error(`invalid start URL: ${e}`);let n=new URL(r).origin,s=new URL("/robots.txt",n).href;try{if(t.robotsBody!==void 0)for(let i of t.robotsBody.matchAll(/^sitemap:\s*(\S+)\s*$/gim)){let o=i[1];if(!o)continue;let d=G(o,s,{includeQuery:!0});if(d&&ue(d,n))return d}else{let{response:i}=await ve(s,{headers:{accept:"text/plain,*/*;q=0.1","user-agent":t.userAgent}},zs({...t,siteOrigin:n}));if(i.ok){let{text:o}=await ke(i,524288);for(let d of o.matchAll(/^sitemap:\s*(\S+)\s*$/gim)){let l=d[1];if(!l)continue;let c=G(l,s,{includeQuery:!0});if(c&&ue(c,n))return c}}else await i.body?.cancel()}}catch{}for(let i of["/sitemap.xml","/sitemap.xml.gz","/sitemap_index.xml"]){let o=new URL(i,n).href;if(await ol(o,{...t,siteOrigin:n}))return o}return null}async function ur(e,t){let r=G(e,void 0,{includeQuery:!0});if(!r)throw new Error(`invalid sitemap URL: ${e}`);let n=new URL(r).origin,s=[r],i=new Set,o=[],d=new Set,l=t.maxUrls??sl,c=!1;for(;s.length>0&&i.size<Vs&&o.length<l;){let m=s.shift();if(i.has(m))continue;i.add(m);let A=Zs(await qs(m,t),m);if(A.kind==="index"){for(let h of A.locations){let f=G(h,m,{includeQuery:!0});f&&ue(f,n)&&!i.has(f)&&!s.includes(f)&&s.push(f)}s.sort();continue}for(let h of A.locations){let f=G(h,m,{includeQuery:t.includeQuery??!1});if(!(!f||d.has(f)||!ue(f,t.siteOrigin)||!lr(f))&&(d.add(f),o.push(f),o.length>=l)){c=!0;break}}}return(s.length>0||i.size>=Vs)&&(c=!0),{url:r,urls:o.sort(),sitemapCount:i.size,truncated:c,error:null}}async function xn(e,t){await e.onEvent?.(t)}async function Ae(e,t={}){let r=be(e),n=G(r.url,void 0,{includeQuery:r.includeQuery});if(!n)throw new Error(`invalid start URL: ${r.url}`);let s=new URL(n).origin,i=t.fetch??globalThis.fetch,o=Ve(r.delay),d=t.logger??qt;await xn(t,{type:"plan-start",url:n});let l=await er(n,{userAgent:Re,timeout:r.timeout,maxRedirects:r.maxRedirects,retries:2,fetch:i,signal:t.signal,requestGate:o,onEvent:t.onEvent,logger:d});await xn(t,{type:"robots",robots:l});let c=null;r.sitemap==="auto"?c=await ei(n,{timeout:r.timeout,maxRedirects:r.maxRedirects,userAgent:Re,fetch:i,signal:t.signal,requestGate:o,onEvent:t.onEvent,robotsBody:l.body}):r.sitemap!=="none"&&(c=r.sitemap);let m=null;if(c)try{m=await ur(c,{siteOrigin:s,includeQuery:r.includeQuery,maxUrls:5e4,timeout:r.timeout,maxRedirects:r.maxRedirects,retries:2,userAgent:Re,fetch:i,signal:t.signal,requestGate:o,onEvent:t.onEvent})}catch(f){m={url:c,urls:[],sitemapCount:0,truncated:!1,error:f instanceof Error?f.message:String(f)},d.warn(`Could not load sitemap ${c}: ${m.error}`)}let A=m?[...new Set([n,...m.urls])].sort((f,b)=>f===n?-1:b===n?1:f.localeCompare(b)):[n],h=m?A.length:null;return await xn(t,{type:"sitemap",sitemap:m,candidateCount:h}),{planVersion:1,config:r,startUrl:n,origin:s,userAgent:Re,robots:l,sitemap:m,candidateUrls:A,candidateCount:h,mode:m?"sitemap":"links"}}import{createHash as Ji}from"node:crypto";var cl=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),U="\uFFFD",u;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(u||(u={}));var z={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Ar(e){return e>=55296&&e<=57343}function ti(e){return e>=56320&&e<=57343}function ri(e,t){return(e-55296)*1024+9216+t}function pr(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function hr(e){return e>=64976&&e<=65007||cl.has(e)}var T;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(T||(T={}));var dl=65536,gr=class{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=dl,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,r){let{line:n,col:s,offset:i}=this,o=s+r,d=i+r;return{code:t,startLine:n,endLine:n,startCol:o,endCol:o,startOffset:d,endOffset:d}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){let r=this.html.charCodeAt(this.pos+1);if(ti(r))return this.pos++,this._addGap(),ri(t,r)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,u.EOF;return this._err(T.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,r){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=r}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,r){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(r)return this.html.startsWith(t,this.pos);for(let n=0;n<t.length;n++)if((this.html.charCodeAt(this.pos+n)|32)!==t.charCodeAt(n))return!1;return!0}peek(t){let r=this.pos+t;if(r>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,u.EOF;let n=this.html.charCodeAt(r);return n===u.CARRIAGE_RETURN?u.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,u.EOF;let t=this.html.charCodeAt(this.pos);return t===u.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,u.LINE_FEED):t===u.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Ar(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===u.LINE_FEED||t===u.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){pr(t)?this._err(T.controlCharacterInInputStream):hr(t)&&this._err(T.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}};var D;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(D||(D={}));function mr(e,t){for(let r=e.attrs.length-1;r>=0;r--)if(e.attrs[r].name===t)return e.attrs[r].value;return null}var Al=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function ni(e){return e>=55296&&e<=57343||e>1114111?65533:Al.get(e)??e}function si(e){let t=atob(e),r=t.length&-2,n=new Uint16Array(r/2);for(let s=0,i=0;s<r;s+=2){let o=t.charCodeAt(s),d=t.charCodeAt(s+1);n[i++]=o|d<<8}return n}var Sn=si("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWmg0iJ0KGFsRGlmZmVyZW50aWFsRAAAoEUh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]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})($||($={}));var Q;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Q||(Q={}));var ii=32;function Nn(e){return e>=Q.ZERO&&e<=Q.NINE}function pl(e){return e>=Q.UPPER_A&&e<=Q.UPPER_F||e>=Q.LOWER_A&&e<=Q.LOWER_F}function hl(e){return e>=Q.UPPER_A&&e<=Q.UPPER_Z||e>=Q.LOWER_A&&e<=Q.LOWER_Z||Nn(e)}function gl(e){return e===Q.EQUALS||hl(e)}var K;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(K||(K={}));var Te;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Te||(Te={}));var fr=class{decodeTree;emitCodePoint;errors;constructor(t,r,n){this.decodeTree=t,this.emitCodePoint=r,this.errors=n}state=K.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=Te.Strict;runConsumed=0;startEntity(t){this.decodeMode=t,this.state=K.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(t,r){switch(this.state){case K.EntityStart:return t.charCodeAt(r)===Q.NUM?(this.state=K.NumericStart,this.consumed+=1,this.stateNumericStart(t,r+1)):(this.state=K.NamedEntity,this.stateNamedEntity(t,r));case K.NumericStart:return this.stateNumericStart(t,r);case K.NumericDecimal:return this.stateNumericDecimal(t,r);case K.NumericHex:return this.stateNumericHex(t,r);case K.NamedEntity:return this.stateNamedEntity(t,r)}}stateNumericStart(t,r){return r>=t.length?-1:(t.charCodeAt(r)|ii)===Q.LOWER_X?(this.state=K.NumericHex,this.consumed+=1,this.stateNumericHex(t,r+1)):(this.state=K.NumericDecimal,this.stateNumericDecimal(t,r))}stateNumericHex(t,r){for(;r<t.length;){let n=t.charCodeAt(r);if(Nn(n)||pl(n)){let s=n<=Q.NINE?n-Q.ZERO:(n|ii)-Q.LOWER_A+10;this.result=this.result*16+s,this.consumed++,r++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(t,r){for(;r<t.length;){let n=t.charCodeAt(r);if(Nn(n))this.result=this.result*10+(n-Q.ZERO),this.consumed++,r++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(t,r){if(this.consumed<=r)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Q.SEMI)this.consumed+=1;else if(this.decodeMode===Te.Strict)return 0;return this.emitCodePoint(ni(this.result),this.consumed),this.errors&&(t!==Q.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,r){let{decodeTree:n}=this,s=n[this.treeIndex],i=(s&$.VALUE_LENGTH)>>14;for(;r<t.length;){if(i===0&&(s&$.FLAG13)!==0){let d=(s&$.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let l=s&$.JUMP_TABLE;if(t.charCodeAt(r)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();r++,this.excess++,this.runConsumed++}for(;this.runConsumed<d;){if(r>=t.length)return-1;let l=this.runConsumed-1,c=n[this.treeIndex+1+(l>>1)],m=l%2===0?c&255:c>>8&255;if(t.charCodeAt(r)!==m)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();r++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(d>>1),s=n[this.treeIndex],i=(s&$.VALUE_LENGTH)>>14}if(r>=t.length)break;let o=t.charCodeAt(r);if(o===Q.SEMI&&i!==0&&(s&$.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);if(this.treeIndex=ml(n,s,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return this.result===0||this.decodeMode===Te.Attribute&&(i===0||gl(o))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],i=(s&$.VALUE_LENGTH)>>14,i!==0){if(o===Q.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Te.Strict&&(s&$.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}r++,this.excess++}return-1}emitNotTerminatedNamedEntity(){let{result:t,decodeTree:r}=this,n=(r[t]&$.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,r,n){let{decodeTree:s}=this;return this.emitCodePoint(r===1?s[t]&~($.VALUE_LENGTH|$.FLAG13):s[t+1],n),r===3&&this.emitCodePoint(s[t+2],n),n}end(){switch(this.state){case K.NamedEntity:return this.result!==0&&(this.decodeMode!==Te.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case K.NumericDecimal:return this.emitNumericEntity(0,2);case K.NumericHex:return this.emitNumericEntity(0,3);case K.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case K.EntityStart:return 0}}};function ml(e,t,r,n){let s=(t&$.BRANCH_LENGTH)>>7,i=t&$.JUMP_TABLE;if(s===0)return i!==0&&n===i?r:-1;if(i){let c=n-i;return c<0||c>=s?-1:e[r+c]-1}let o=s+1>>1,d=0,l=s-1;for(;d<=l;){let c=d+l>>>1,m=c>>1,h=e[r+m]>>(c&1)*8&255;if(h<n)d=c+1;else if(h>n)l=c-1;else return e[r+o+c]}return-1}var I;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(I||(I={}));var Ce;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Ce||(Ce={}));var q;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(q||(q={}));var E;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(E||(E={}));var a;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(a||(a={}));var fl=new Map([[E.A,a.A],[E.ADDRESS,a.ADDRESS],[E.ANNOTATION_XML,a.ANNOTATION_XML],[E.APPLET,a.APPLET],[E.AREA,a.AREA],[E.ARTICLE,a.ARTICLE],[E.ASIDE,a.ASIDE],[E.B,a.B],[E.BASE,a.BASE],[E.BASEFONT,a.BASEFONT],[E.BGSOUND,a.BGSOUND],[E.BIG,a.BIG],[E.BLOCKQUOTE,a.BLOCKQUOTE],[E.BODY,a.BODY],[E.BR,a.BR],[E.BUTTON,a.BUTTON],[E.CAPTION,a.CAPTION],[E.CENTER,a.CENTER],[E.CODE,a.CODE],[E.COL,a.COL],[E.COLGROUP,a.COLGROUP],[E.DD,a.DD],[E.DESC,a.DESC],[E.DETAILS,a.DETAILS],[E.DIALOG,a.DIALOG],[E.DIR,a.DIR],[E.DIV,a.DIV],[E.DL,a.DL],[E.DT,a.DT],[E.EM,a.EM],[E.EMBED,a.EMBED],[E.FIELDSET,a.FIELDSET],[E.FIGCAPTION,a.FIGCAPTION],[E.FIGURE,a.FIGURE],[E.FONT,a.FONT],[E.FOOTER,a.FOOTER],[E.FOREIGN_OBJECT,a.FOREIGN_OBJECT],[E.FORM,a.FORM],[E.FRAME,a.FRAME],[E.FRAMESET,a.FRAMESET],[E.H1,a.H1],[E.H2,a.H2],[E.H3,a.H3],[E.H4,a.H4],[E.H5,a.H5],[E.H6,a.H6],[E.HEAD,a.HEAD],[E.HEADER,a.HEADER],[E.HGROUP,a.HGROUP],[E.HR,a.HR],[E.HTML,a.HTML],[E.I,a.I],[E.IMG,a.IMG],[E.IMAGE,a.IMAGE],[E.INPUT,a.INPUT],[E.IFRAME,a.IFRAME],[E.KEYGEN,a.KEYGEN],[E.LABEL,a.LABEL],[E.LI,a.LI],[E.LINK,a.LINK],[E.LISTING,a.LISTING],[E.MAIN,a.MAIN],[E.MALIGNMARK,a.MALIGNMARK],[E.MARQUEE,a.MARQUEE],[E.MATH,a.MATH],[E.MENU,a.MENU],[E.META,a.META],[E.MGLYPH,a.MGLYPH],[E.MI,a.MI],[E.MO,a.MO],[E.MN,a.MN],[E.MS,a.MS],[E.MTEXT,a.MTEXT],[E.NAV,a.NAV],[E.NOBR,a.NOBR],[E.NOFRAMES,a.NOFRAMES],[E.NOEMBED,a.NOEMBED],[E.NOSCRIPT,a.NOSCRIPT],[E.OBJECT,a.OBJECT],[E.OL,a.OL],[E.OPTGROUP,a.OPTGROUP],[E.OPTION,a.OPTION],[E.P,a.P],[E.PARAM,a.PARAM],[E.PLAINTEXT,a.PLAINTEXT],[E.PRE,a.PRE],[E.RB,a.RB],[E.RP,a.RP],[E.RT,a.RT],[E.RTC,a.RTC],[E.RUBY,a.RUBY],[E.S,a.S],[E.SCRIPT,a.SCRIPT],[E.SEARCH,a.SEARCH],[E.SECTION,a.SECTION],[E.SELECT,a.SELECT],[E.SOURCE,a.SOURCE],[E.SMALL,a.SMALL],[E.SPAN,a.SPAN],[E.STRIKE,a.STRIKE],[E.STRONG,a.STRONG],[E.STYLE,a.STYLE],[E.SUB,a.SUB],[E.SUMMARY,a.SUMMARY],[E.SUP,a.SUP],[E.TABLE,a.TABLE],[E.TBODY,a.TBODY],[E.TEMPLATE,a.TEMPLATE],[E.TEXTAREA,a.TEXTAREA],[E.TFOOT,a.TFOOT],[E.TD,a.TD],[E.TH,a.TH],[E.THEAD,a.THEAD],[E.TITLE,a.TITLE],[E.TR,a.TR],[E.TRACK,a.TRACK],[E.TT,a.TT],[E.U,a.U],[E.UL,a.UL],[E.SVG,a.SVG],[E.VAR,a.VAR],[E.WBR,a.WBR],[E.XMP,a.XMP]]);function Qe(e){var t;return(t=fl.get(e))!==null&&t!==void 0?t:a.UNKNOWN}var w=a,ai={[I.HTML]:new Set([w.ADDRESS,w.APPLET,w.AREA,w.ARTICLE,w.ASIDE,w.BASE,w.BASEFONT,w.BGSOUND,w.BLOCKQUOTE,w.BODY,w.BR,w.BUTTON,w.CAPTION,w.CENTER,w.COL,w.COLGROUP,w.DD,w.DETAILS,w.DIR,w.DIV,w.DL,w.DT,w.EMBED,w.FIELDSET,w.FIGCAPTION,w.FIGURE,w.FOOTER,w.FORM,w.FRAME,w.FRAMESET,w.H1,w.H2,w.H3,w.H4,w.H5,w.H6,w.HEAD,w.HEADER,w.HGROUP,w.HR,w.HTML,w.IFRAME,w.IMG,w.INPUT,w.LI,w.LINK,w.LISTING,w.MAIN,w.MARQUEE,w.MENU,w.META,w.NAV,w.NOEMBED,w.NOFRAMES,w.NOSCRIPT,w.OBJECT,w.OL,w.P,w.PARAM,w.PLAINTEXT,w.PRE,w.SCRIPT,w.SECTION,w.SELECT,w.SOURCE,w.STYLE,w.SUMMARY,w.TABLE,w.TBODY,w.TD,w.TEMPLATE,w.TEXTAREA,w.TFOOT,w.TH,w.THEAD,w.TITLE,w.TR,w.TRACK,w.UL,w.WBR,w.XMP]),[I.MATHML]:new Set([w.MI,w.MO,w.MN,w.MS,w.MTEXT,w.ANNOTATION_XML]),[I.SVG]:new Set([w.TITLE,w.FOREIGN_OBJECT,w.DESC]),[I.XLINK]:new Set,[I.XML]:new Set,[I.XMLNS]:new Set},xt=new Set([w.H1,w.H2,w.H3,w.H4,w.H5,w.H6]),pm=new Set([E.STYLE,E.SCRIPT,E.XMP,E.IFRAME,E.NOEMBED,E.NOFRAMES,E.PLAINTEXT]);var p;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(p||(p={}));var j={DATA:p.DATA,RCDATA:p.RCDATA,RAWTEXT:p.RAWTEXT,SCRIPT_DATA:p.SCRIPT_DATA,PLAINTEXT:p.PLAINTEXT,CDATA_SECTION:p.CDATA_SECTION};function Tl(e){return e>=u.DIGIT_0&&e<=u.DIGIT_9}function St(e){return e>=u.LATIN_CAPITAL_A&&e<=u.LATIN_CAPITAL_Z}function bl(e){return e>=u.LATIN_SMALL_A&&e<=u.LATIN_SMALL_Z}function we(e){return bl(e)||St(e)}function oi(e){return we(e)||Tl(e)}function Er(e){return e+32}function li(e){return e===u.SPACE||e===u.LINE_FEED||e===u.TABULATION||e===u.FORM_FEED}function ci(e){return li(e)||e===u.SOLIDUS||e===u.GREATER_THAN_SIGN}function Cl(e){return e===u.NULL?T.nullCharacterReference:e>1114111?T.characterReferenceOutsideUnicodeRange:Ar(e)?T.surrogateCharacterReference:hr(e)?T.noncharacterCharacterReference:pr(e)||e===u.CARRIAGE_RETURN?T.controlCharacterReference:null}var Nt=class{constructor(t,r){this.options=t,this.handler=r,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=p.DATA,this.returnState=p.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new gr(r),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new fr(Sn,(n,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(n)},r.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(T.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:n=>{this._err(T.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+n)},validateNumericCharacterReference:n=>{let s=Cl(n);s&&this._err(s,1)}}:void 0)}_err(t,r=0){var n,s;(s=(n=this.handler).onParseError)===null||s===void 0||s.call(n,this.preprocessor.getError(t,r))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,r,n){this.active=!0,this.preprocessor.write(t,r),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let r=0;r<t;r++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,r){return this.preprocessor.startsWith(t,r)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:D.START_TAG,tagName:"",tagID:a.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:D.END_TAG,tagName:"",tagID:a.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:D.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:D.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,r){this.currentCharacterToken={type:t,chars:r,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,r;let n=this.currentToken;if(mr(n,this.currentAttr.name)===null){if(n.attrs.push(this.currentAttr),n.location&&this.currentLocation){let s=(t=(r=n.location).attrs)!==null&&t!==void 0?t:r.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(T.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let t=this.currentToken;this.prepareToken(t),t.tagID=Qe(t.tagName),t.type===D.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(T.endTagWithAttributes),t.selfClosing&&this._err(T.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case D.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case D.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case D.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){let t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:D.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,r){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=r;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,r)}_emitCodePoint(t){let r=li(t)?D.WHITESPACE_CHARACTER:t===u.NULL?D.NULL_CHARACTER:D.CHARACTER;this._appendCharToCurrentCharacterToken(r,t<65536?String.fromCharCode(t):String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(D.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=p.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Te.Attribute:Te.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===p.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===p.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===p.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case p.DATA:{this._stateData(t);break}case p.RCDATA:{this._stateRcdata(t);break}case p.RAWTEXT:{this._stateRawtext(t);break}case p.SCRIPT_DATA:{this._stateScriptData(t);break}case p.PLAINTEXT:{this._statePlaintext(t);break}case p.TAG_OPEN:{this._stateTagOpen(t);break}case p.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case p.TAG_NAME:{this._stateTagName(t);break}case p.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case p.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case p.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case p.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case p.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case p.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case p.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case p.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case p.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case p.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case p.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case p.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case p.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case p.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case p.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case p.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case p.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case p.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case p.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case p.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case p.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case p.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case p.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case p.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case p.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case p.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case p.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case p.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case p.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case p.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case p.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case p.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case p.BOGUS_COMMENT:{this._stateBogusComment(t);break}case p.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case p.COMMENT_START:{this._stateCommentStart(t);break}case p.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case p.COMMENT:{this._stateComment(t);break}case p.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case p.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case p.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case p.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case p.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case p.COMMENT_END:{this._stateCommentEnd(t);break}case p.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case p.DOCTYPE:{this._stateDoctype(t);break}case p.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case p.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case p.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case p.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case p.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case p.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case p.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case p.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case p.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case p.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case p.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case p.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case p.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case p.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case p.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case p.CDATA_SECTION:{this._stateCdataSection(t);break}case p.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case p.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case p.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case p.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case u.LESS_THAN_SIGN:{this.state=p.TAG_OPEN;break}case u.AMPERSAND:{this._startCharacterReference();break}case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitCodePoint(t);break}case u.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case u.AMPERSAND:{this._startCharacterReference();break}case u.LESS_THAN_SIGN:{this.state=p.RCDATA_LESS_THAN_SIGN;break}case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(U);break}case u.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case u.LESS_THAN_SIGN:{this.state=p.RAWTEXT_LESS_THAN_SIGN;break}case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(U);break}case u.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_LESS_THAN_SIGN;break}case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(U);break}case u.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(U);break}case u.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(we(t))this._createStartTagToken(),this.state=p.TAG_NAME,this._stateTagName(t);else switch(t){case u.EXCLAMATION_MARK:{this.state=p.MARKUP_DECLARATION_OPEN;break}case u.SOLIDUS:{this.state=p.END_TAG_OPEN;break}case u.QUESTION_MARK:{this._err(T.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=p.BOGUS_COMMENT,this._stateBogusComment(t);break}case u.EOF:{this._err(T.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(T.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=p.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(we(t))this._createEndTagToken(),this.state=p.TAG_NAME,this._stateTagName(t);else switch(t){case u.GREATER_THAN_SIGN:{this._err(T.missingEndTagName),this.state=p.DATA;break}case u.EOF:{this._err(T.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(T.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=p.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this.state=p.BEFORE_ATTRIBUTE_NAME;break}case u.SOLIDUS:{this.state=p.SELF_CLOSING_START_TAG;break}case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentTagToken();break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.tagName+=U;break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:r.tagName+=String.fromCodePoint(St(t)?Er(t):t)}}_stateRcdataLessThanSign(t){t===u.SOLIDUS?this.state=p.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=p.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){we(t)?(this.state=p.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=p.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let r=this.currentToken;switch(r.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=p.BEFORE_ATTRIBUTE_NAME,!1;case u.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=p.SELF_CLOSING_START_TAG,!1;case u.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=p.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=p.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===u.SOLIDUS?this.state=p.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=p.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){we(t)?(this.state=p.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=p.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=p.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case u.SOLIDUS:{this.state=p.SCRIPT_DATA_END_TAG_OPEN;break}case u.EXCLAMATION_MARK:{this.state=p.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=p.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){we(t)?(this.state=p.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=p.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=p.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===u.HYPHEN_MINUS?(this.state=p.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=p.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===u.HYPHEN_MINUS?(this.state=p.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=p.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case u.HYPHEN_MINUS:{this.state=p.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(U);break}case u.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case u.HYPHEN_MINUS:{this.state=p.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.state=p.SCRIPT_DATA_ESCAPED,this._emitChars(U);break}case u.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=p.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case u.HYPHEN_MINUS:{this._emitChars("-");break}case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case u.GREATER_THAN_SIGN:{this.state=p.SCRIPT_DATA,this._emitChars(">");break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.state=p.SCRIPT_DATA_ESCAPED,this._emitChars(U);break}case u.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=p.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===u.SOLIDUS?this.state=p.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:we(t)?(this._emitChars("<"),this.state=p.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=p.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){we(t)?(this.state=p.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=p.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=p.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(z.SCRIPT,!1)&&ci(this.preprocessor.peek(z.SCRIPT.length))){this._emitCodePoint(t);for(let r=0;r<z.SCRIPT.length;r++)this._emitCodePoint(this._consume());this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=p.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case u.HYPHEN_MINUS:{this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(U);break}case u.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case u.HYPHEN_MINUS:{this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(U);break}case u.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case u.HYPHEN_MINUS:{this._emitChars("-");break}case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case u.GREATER_THAN_SIGN:{this.state=p.SCRIPT_DATA,this._emitChars(">");break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(U);break}case u.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===u.SOLIDUS?(this.state=p.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(z.SCRIPT,!1)&&ci(this.preprocessor.peek(z.SCRIPT.length))){this._emitCodePoint(t);for(let r=0;r<z.SCRIPT.length;r++)this._emitCodePoint(this._consume());this.state=p.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.SOLIDUS:case u.GREATER_THAN_SIGN:case u.EOF:{this.state=p.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case u.EQUALS_SIGN:{this._err(T.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=p.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=p.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:case u.SOLIDUS:case u.GREATER_THAN_SIGN:case u.EOF:{this._leaveAttrName(),this.state=p.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case u.EQUALS_SIGN:{this._leaveAttrName(),this.state=p.BEFORE_ATTRIBUTE_VALUE;break}case u.QUOTATION_MARK:case u.APOSTROPHE:case u.LESS_THAN_SIGN:{this._err(T.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.currentAttr.name+=U;break}default:this.currentAttr.name+=String.fromCodePoint(St(t)?Er(t):t)}}_stateAfterAttributeName(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.SOLIDUS:{this.state=p.SELF_CLOSING_START_TAG;break}case u.EQUALS_SIGN:{this.state=p.BEFORE_ATTRIBUTE_VALUE;break}case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentTagToken();break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=p.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.QUOTATION_MARK:{this.state=p.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case u.APOSTROPHE:{this.state=p.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case u.GREATER_THAN_SIGN:{this._err(T.missingAttributeValue),this.state=p.DATA,this.emitCurrentTagToken();break}default:this.state=p.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case u.QUOTATION_MARK:{this.state=p.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case u.AMPERSAND:{this._startCharacterReference();break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.currentAttr.value+=U;break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case u.APOSTROPHE:{this.state=p.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case u.AMPERSAND:{this._startCharacterReference();break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.currentAttr.value+=U;break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this._leaveAttrValue(),this.state=p.BEFORE_ATTRIBUTE_NAME;break}case u.AMPERSAND:{this._startCharacterReference();break}case u.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=p.DATA,this.emitCurrentTagToken();break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.currentAttr.value+=U;break}case u.QUOTATION_MARK:case u.APOSTROPHE:case u.LESS_THAN_SIGN:case u.EQUALS_SIGN:case u.GRAVE_ACCENT:{this._err(T.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this._leaveAttrValue(),this.state=p.BEFORE_ATTRIBUTE_NAME;break}case u.SOLIDUS:{this._leaveAttrValue(),this.state=p.SELF_CLOSING_START_TAG;break}case u.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=p.DATA,this.emitCurrentTagToken();break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this._err(T.missingWhitespaceBetweenAttributes),this.state=p.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case u.GREATER_THAN_SIGN:{let r=this.currentToken;r.selfClosing=!0,this.state=p.DATA,this.emitCurrentTagToken();break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this._err(T.unexpectedSolidusInTag),this.state=p.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){let r=this.currentToken;switch(t){case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentComment(r);break}case u.EOF:{this.emitCurrentComment(r),this._emitEOFToken();break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.data+=U;break}default:r.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(z.DASH_DASH,!0)?(this._createCommentToken(z.DASH_DASH.length+1),this.state=p.COMMENT_START):this._consumeSequenceIfMatch(z.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(z.DOCTYPE.length+1),this.state=p.DOCTYPE):this._consumeSequenceIfMatch(z.CDATA_START,!0)?this.inForeignNode?this.state=p.CDATA_SECTION:(this._err(T.cdataInHtmlContent),this._createCommentToken(z.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=p.BOGUS_COMMENT):this._ensureHibernation()||(this._err(T.incorrectlyOpenedComment),this._createCommentToken(2),this.state=p.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case u.HYPHEN_MINUS:{this.state=p.COMMENT_START_DASH;break}case u.GREATER_THAN_SIGN:{this._err(T.abruptClosingOfEmptyComment),this.state=p.DATA;let r=this.currentToken;this.emitCurrentComment(r);break}default:this.state=p.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){let r=this.currentToken;switch(t){case u.HYPHEN_MINUS:{this.state=p.COMMENT_END;break}case u.GREATER_THAN_SIGN:{this._err(T.abruptClosingOfEmptyComment),this.state=p.DATA,this.emitCurrentComment(r);break}case u.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="-",this.state=p.COMMENT,this._stateComment(t)}}_stateComment(t){let r=this.currentToken;switch(t){case u.HYPHEN_MINUS:{this.state=p.COMMENT_END_DASH;break}case u.LESS_THAN_SIGN:{r.data+="<",this.state=p.COMMENT_LESS_THAN_SIGN;break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.data+=U;break}case u.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){let r=this.currentToken;switch(t){case u.EXCLAMATION_MARK:{r.data+="!",this.state=p.COMMENT_LESS_THAN_SIGN_BANG;break}case u.LESS_THAN_SIGN:{r.data+="<";break}default:this.state=p.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===u.HYPHEN_MINUS?this.state=p.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=p.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===u.HYPHEN_MINUS?this.state=p.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=p.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==u.GREATER_THAN_SIGN&&t!==u.EOF&&this._err(T.nestedComment),this.state=p.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){let r=this.currentToken;switch(t){case u.HYPHEN_MINUS:{this.state=p.COMMENT_END;break}case u.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="-",this.state=p.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){let r=this.currentToken;switch(t){case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentComment(r);break}case u.EXCLAMATION_MARK:{this.state=p.COMMENT_END_BANG;break}case u.HYPHEN_MINUS:{r.data+="-";break}case u.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="--",this.state=p.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){let r=this.currentToken;switch(t){case u.HYPHEN_MINUS:{r.data+="--!",this.state=p.COMMENT_END_DASH;break}case u.GREATER_THAN_SIGN:{this._err(T.incorrectlyClosedComment),this.state=p.DATA,this.emitCurrentComment(r);break}case u.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="--!",this.state=p.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this.state=p.BEFORE_DOCTYPE_NAME;break}case u.GREATER_THAN_SIGN:{this.state=p.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case u.EOF:{this._err(T.eofInDoctype),this._createDoctypeToken(null);let r=this.currentToken;r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingWhitespaceBeforeDoctypeName),this.state=p.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(St(t))this._createDoctypeToken(String.fromCharCode(Er(t))),this.state=p.DOCTYPE_NAME;else switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.NULL:{this._err(T.unexpectedNullCharacter),this._createDoctypeToken(U),this.state=p.DOCTYPE_NAME;break}case u.GREATER_THAN_SIGN:{this._err(T.missingDoctypeName),this._createDoctypeToken(null);let r=this.currentToken;r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.EOF:{this._err(T.eofInDoctype),this._createDoctypeToken(null);let r=this.currentToken;r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=p.DOCTYPE_NAME}}_stateDoctypeName(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this.state=p.AFTER_DOCTYPE_NAME;break}case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.name+=U;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.name+=String.fromCodePoint(St(t)?Er(t):t)}}_stateAfterDoctypeName(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(z.PUBLIC,!1)?this.state=p.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(z.SYSTEM,!1)?this.state=p.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(T.invalidCharacterSequenceAfterDoctypeName),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this.state=p.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case u.QUOTATION_MARK:{this._err(T.missingWhitespaceAfterDoctypePublicKeyword),r.publicId="",this.state=p.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case u.APOSTROPHE:{this._err(T.missingWhitespaceAfterDoctypePublicKeyword),r.publicId="",this.state=p.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case u.GREATER_THAN_SIGN:{this._err(T.missingDoctypePublicIdentifier),r.forceQuirks=!0,this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypePublicIdentifier),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.QUOTATION_MARK:{r.publicId="",this.state=p.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case u.APOSTROPHE:{r.publicId="",this.state=p.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case u.GREATER_THAN_SIGN:{this._err(T.missingDoctypePublicIdentifier),r.forceQuirks=!0,this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypePublicIdentifier),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){let r=this.currentToken;switch(t){case u.QUOTATION_MARK:{this.state=p.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.publicId+=U;break}case u.GREATER_THAN_SIGN:{this._err(T.abruptDoctypePublicIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){let r=this.currentToken;switch(t){case u.APOSTROPHE:{this.state=p.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.publicId+=U;break}case u.GREATER_THAN_SIGN:{this._err(T.abruptDoctypePublicIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this.state=p.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.QUOTATION_MARK:{this._err(T.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case u.APOSTROPHE:{this._err(T.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.GREATER_THAN_SIGN:{this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.QUOTATION_MARK:{r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case u.APOSTROPHE:{r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this.state=p.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case u.QUOTATION_MARK:{this._err(T.missingWhitespaceAfterDoctypeSystemKeyword),r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case u.APOSTROPHE:{this._err(T.missingWhitespaceAfterDoctypeSystemKeyword),r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case u.GREATER_THAN_SIGN:{this._err(T.missingDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.QUOTATION_MARK:{r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case u.APOSTROPHE:{r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case u.GREATER_THAN_SIGN:{this._err(T.missingDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){let r=this.currentToken;switch(t){case u.QUOTATION_MARK:{this.state=p.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.systemId+=U;break}case u.GREATER_THAN_SIGN:{this._err(T.abruptDoctypeSystemIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){let r=this.currentToken;switch(t){case u.APOSTROPHE:{this.state=p.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.systemId+=U;break}case u.GREATER_THAN_SIGN:{this._err(T.abruptDoctypeSystemIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.GREATER_THAN_SIGN:{this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){let r=this.currentToken;switch(t){case u.GREATER_THAN_SIGN:{this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.NULL:{this._err(T.unexpectedNullCharacter);break}case u.EOF:{this.emitCurrentDoctype(r),this._emitEOFToken();break}default:}}_stateCdataSection(t){switch(t){case u.RIGHT_SQUARE_BRACKET:{this.state=p.CDATA_SECTION_BRACKET;break}case u.EOF:{this._err(T.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===u.RIGHT_SQUARE_BRACKET?this.state=p.CDATA_SECTION_END:(this._emitChars("]"),this.state=p.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case u.GREATER_THAN_SIGN:{this.state=p.DATA;break}case u.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=p.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(u.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&oi(this.preprocessor.peek(1))?p.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){oi(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===u.SEMICOLON&&this._err(T.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}};var pi=new Set([a.DD,a.DT,a.LI,a.OPTGROUP,a.OPTION,a.P,a.RB,a.RP,a.RT,a.RTC]),di=new Set([...pi,a.CAPTION,a.COLGROUP,a.TBODY,a.TD,a.TFOOT,a.TH,a.THEAD,a.TR]),Tr=new Set([a.APPLET,a.CAPTION,a.HTML,a.MARQUEE,a.OBJECT,a.TABLE,a.TD,a.TEMPLATE,a.TH]),Il=new Set([...Tr,a.OL,a.UL]),yl=new Set([...Tr,a.BUTTON]),ui=new Set([a.ANNOTATION_XML,a.MI,a.MN,a.MO,a.MS,a.MTEXT]),Ai=new Set([a.DESC,a.FOREIGN_OBJECT,a.TITLE]),wl=new Set([a.TR,a.TEMPLATE,a.HTML]),xl=new Set([a.TBODY,a.TFOOT,a.THEAD,a.TEMPLATE,a.HTML]),Sl=new Set([a.TABLE,a.TEMPLATE,a.HTML]),Nl=new Set([a.TD,a.TH]),br=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,r,n){this.treeAdapter=r,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=a.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===a.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===I.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,r){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=r,this.currentTagId=r,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,r,!0)}pop(){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,r){let n=this._indexOf(t);this.items[n]=r,n===this.stackTop&&(this.current=r)}insertAfter(t,r,n){let s=this._indexOf(t)+1;this.items.splice(s,0,r),this.tagIDs.splice(s,0,n),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let r=this.stackTop+1;do r=this.tagIDs.lastIndexOf(t,r-1);while(r>0&&this.treeAdapter.getNamespaceURI(this.items[r])!==I.HTML);this.shortenToLength(Math.max(r,0))}shortenToLength(t){for(;this.stackTop>=t;){let r=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(r,this.stackTop<t)}}popUntilElementPopped(t){let r=this._indexOf(t);this.shortenToLength(Math.max(r,0))}popUntilPopped(t,r){let n=this._indexOfTagNames(t,r);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(xt,I.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Nl,I.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,r){for(let n=this.stackTop;n>=0;n--)if(t.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===r)return n;return-1}clearBackTo(t,r){let n=this._indexOfTagNames(t,r);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(Sl,I.HTML)}clearBackToTableBodyContext(){this.clearBackTo(xl,I.HTML)}clearBackToTableRowContext(){this.clearBackTo(wl,I.HTML)}remove(t){let r=this._indexOf(t);r>=0&&(r===this.stackTop?this.pop():(this.items.splice(r,1),this.tagIDs.splice(r,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===a.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){let r=this._indexOf(t)-1;return r>=0?this.items[r]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===a.HTML}hasInDynamicScope(t,r){for(let n=this.stackTop;n>=0;n--){let s=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case I.HTML:{if(s===t)return!0;if(r.has(s))return!1;break}case I.SVG:{if(Ai.has(s))return!1;break}case I.MATHML:{if(ui.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Tr)}hasInListItemScope(t){return this.hasInDynamicScope(t,Il)}hasInButtonScope(t){return this.hasInDynamicScope(t,yl)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){let r=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case I.HTML:{if(xt.has(r))return!0;if(Tr.has(r))return!1;break}case I.SVG:{if(Ai.has(r))return!1;break}case I.MATHML:{if(ui.has(r))return!1;break}}}return!0}hasInTableScope(t){for(let r=this.stackTop;r>=0;r--)if(this.treeAdapter.getNamespaceURI(this.items[r])===I.HTML)switch(this.tagIDs[r]){case t:return!0;case a.TABLE:case a.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===I.HTML)switch(this.tagIDs[t]){case a.TBODY:case a.THEAD:case a.TFOOT:return!0;case a.TABLE:case a.HTML:return!1}return!0}hasInSelectScope(t){for(let r=this.stackTop;r>=0;r--)if(this.treeAdapter.getNamespaceURI(this.items[r])===I.HTML)switch(this.tagIDs[r]){case t:return!0;case a.OPTION:case a.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&pi.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&di.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&di.has(this.currentTagId);)this.pop()}};var pe;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(pe||(pe={}));var hi={type:pe.Marker},Cr=class{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,r){let n=[],s=r.length,i=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let d=0;d<this.entries.length;d++){let l=this.entries[d];if(l.type===pe.Marker)break;let{element:c}=l;if(this.treeAdapter.getTagName(c)===i&&this.treeAdapter.getNamespaceURI(c)===o){let m=this.treeAdapter.getAttrList(c);m.length===s&&n.push({idx:d,attrs:m})}}return n}_ensureNoahArkCondition(t){if(this.entries.length<3)return;let r=this.treeAdapter.getAttrList(t),n=this._getNoahArkConditionCandidates(t,r);if(n.length<3)return;let s=new Map(r.map(o=>[o.name,o.value])),i=0;for(let o=0;o<n.length;o++){let d=n[o];d.attrs.every(l=>s.get(l.name)===l.value)&&(i+=1,i>=3&&this.entries.splice(d.idx,1))}}insertMarker(){this.entries.unshift(hi)}pushElement(t,r){this._ensureNoahArkCondition(t),this.entries.unshift({type:pe.Element,element:t,token:r})}insertElementAfterBookmark(t,r){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:pe.Element,element:t,token:r})}removeEntry(t){let r=this.entries.indexOf(t);r!==-1&&this.entries.splice(r,1)}clearToLastMarker(){let t=this.entries.indexOf(hi);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){let r=this.entries.find(n=>n.type===pe.Marker||this.treeAdapter.getTagName(n.element)===t);return r&&r.type===pe.Element?r:null}getElementEntry(t){return this.entries.find(r=>r.type===pe.Element&&r.element===t)}};var he={createDocument(){return{nodeName:"#document",mode:q.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,r){return{nodeName:e,tagName:e,attrs:r,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,r){let n=e.childNodes.indexOf(r);e.childNodes.splice(n,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,r,n){let s=e.childNodes.find(i=>i.nodeName==="#documentType");if(s)s.name=t,s.publicId=r,s.systemId=n;else{let i={nodeName:"#documentType",name:t,publicId:r,systemId:n,parentNode:null};he.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let r=e.childNodes[e.childNodes.length-1];if(he.isTextNode(r)){r.value+=t;return}}he.appendChild(e,he.createTextNode(t))},insertTextBefore(e,t,r){let n=e.childNodes[e.childNodes.indexOf(r)-1];n&&he.isTextNode(n)?n.value+=t:he.insertBefore(e,he.createTextNode(t),r)},adoptAttributes(e,t){let r=new Set(e.attrs.map(n=>n.name));for(let n=0;n<t.length;n++)r.has(t[n].name)||e.attrs.push(t[n])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}};var mi="html",_l="about:legacy-compat",Rl="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",fi=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Ll=[...fi,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Ol=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Ei=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],vl=[...Ei,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function gi(e,t){return t.some(r=>e.startsWith(r))}function Ti(e){return e.name===mi&&e.publicId===null&&(e.systemId===null||e.systemId===_l)}function bi(e){if(e.name!==mi)return q.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===Rl)return q.QUIRKS;let{publicId:r}=e;if(r!==null){if(r=r.toLowerCase(),Ol.has(r))return q.QUIRKS;let n=t===null?Ll:fi;if(gi(r,n))return q.QUIRKS;if(n=t===null?Ei:vl,gi(r,n))return q.LIMITED_QUIRKS}return q.NO_QUIRKS}var Ci={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Dl="definitionurl",Bl="definitionURL",Pl=new Map(["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"].map(e=>[e.toLowerCase(),e])),Ml=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:I.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:I.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:I.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:I.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:I.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:I.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:I.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:I.XML}],["xml:space",{prefix:"xml",name:"space",namespace:I.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:I.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:I.XMLNS}]]),Ul=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),Fl=new Set([a.B,a.BIG,a.BLOCKQUOTE,a.BODY,a.BR,a.CENTER,a.CODE,a.DD,a.DIV,a.DL,a.DT,a.EM,a.EMBED,a.H1,a.H2,a.H3,a.H4,a.H5,a.H6,a.HEAD,a.HR,a.I,a.IMG,a.LI,a.LISTING,a.MENU,a.META,a.NOBR,a.OL,a.P,a.PRE,a.RUBY,a.S,a.SMALL,a.SPAN,a.STRONG,a.STRIKE,a.SUB,a.SUP,a.TABLE,a.TT,a.U,a.UL,a.VAR]);function Ii(e){let t=e.tagID;return t===a.FONT&&e.attrs.some(({name:n})=>n===Ce.COLOR||n===Ce.SIZE||n===Ce.FACE)||Fl.has(t)}function _n(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Dl){e.attrs[t].name=Bl;break}}function Rn(e){for(let t=0;t<e.attrs.length;t++){let r=Pl.get(e.attrs[t].name);r!=null&&(e.attrs[t].name=r)}}function Ir(e){for(let t=0;t<e.attrs.length;t++){let r=Ml.get(e.attrs[t].name);r&&(e.attrs[t].prefix=r.prefix,e.attrs[t].name=r.name,e.attrs[t].namespace=r.namespace)}}function yi(e){let t=Ul.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Qe(e.tagName))}function Hl(e,t){return t===I.MATHML&&(e===a.MI||e===a.MO||e===a.MN||e===a.MS||e===a.MTEXT)}function Ql(e,t,r){if(t===I.MATHML&&e===a.ANNOTATION_XML){for(let n=0;n<r.length;n++)if(r[n].name===Ce.ENCODING){let s=r[n].value.toLowerCase();return s===Ci.TEXT_HTML||s===Ci.APPLICATION_XML}}return t===I.SVG&&(e===a.FOREIGN_OBJECT||e===a.DESC||e===a.TITLE)}function wi(e,t,r,n){return(!n||n===I.HTML)&&Ql(e,t,r)||(!n||n===I.MATHML)&&Hl(e,t)}var Yl="hidden",Gl=8,Wl=3,g;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(g||(g={}));var Kl={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Ri=new Set([a.TABLE,a.TBODY,a.TFOOT,a.THEAD,a.TR]),Si={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:he,onParseError:null},Bt=class{constructor(t,r,n=null,s=null){this.fragmentContext=n,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=g.INITIAL,this.originalInsertionMode=g.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Si,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=r??this.treeAdapter.createDocument(),this.tokenizer=new Nt(this.options,this),this.activeFormattingElements=new Cr(this.treeAdapter),this.fragmentContextID=n?Qe(this.treeAdapter.getTagName(n)):a.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new br(this.document,this.treeAdapter,this)}static parse(t,r){let n=new this(r);return n.tokenizer.write(t,!0),n.document}static getFragmentParser(t,r){let n={...Si,...r};t??(t=n.treeAdapter.createElement(E.TEMPLATE,I.HTML,[]));let s=n.treeAdapter.createElement("documentmock",I.HTML,[]),i=new this(n,s,t);return i.fragmentContextID===a.TEMPLATE&&i.tmplInsertionModeStack.unshift(g.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let t=this.treeAdapter.getFirstChild(this.document),r=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,r),r}_err(t,r,n){var s;if(!this.onParseError)return;let i=(s=t.location)!==null&&s!==void 0?s:Kl,o={code:r,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:n?i.startLine:i.endLine,endCol:n?i.startCol:i.endCol,endOffset:n?i.startOffset:i.endOffset};this.onParseError(o)}onItemPush(t,r,n){var s,i;(i=(s=this.treeAdapter).onItemPush)===null||i===void 0||i.call(s,t),n&&this.openElements.stackTop>0&&this._setContextModes(t,r)}onItemPop(t,r){var n,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(n=this.treeAdapter).onItemPop)===null||s===void 0||s.call(n,t,this.openElements.current),r){let i,o;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,o=this.fragmentContextID):{current:i,currentTagId:o}=this.openElements,this._setContextModes(i,o)}}_setContextModes(t,r){let n=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===I.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&t!==void 0&&r!==void 0&&!this._isIntegrationPoint(r,t)}_switchToTextParsing(t,r){this._insertElement(t,I.HTML),this.tokenizer.state=r,this.originalInsertionMode=this.insertionMode,this.insertionMode=g.TEXT}switchToPlaintextParsing(){this.insertionMode=g.TEXT,this.originalInsertionMode=g.IN_BODY,this.tokenizer.state=j.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===E.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==I.HTML))switch(this.fragmentContextID){case a.TITLE:case a.TEXTAREA:{this.tokenizer.state=j.RCDATA;break}case a.STYLE:case a.XMP:case a.IFRAME:case a.NOEMBED:case a.NOFRAMES:case a.NOSCRIPT:{this.tokenizer.state=j.RAWTEXT;break}case a.SCRIPT:{this.tokenizer.state=j.SCRIPT_DATA;break}case a.PLAINTEXT:{this.tokenizer.state=j.PLAINTEXT;break}default:}}_setDocumentType(t){let r=t.name||"",n=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,r,n,s),t.location){let o=this.treeAdapter.getChildNodes(this.document).find(d=>this.treeAdapter.isDocumentTypeNode(d));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,r){if(this.options.sourceCodeLocationInfo){let n=r&&{...r,startTag:r};this.treeAdapter.setNodeSourceCodeLocation(t,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{let n=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(n??this.document,t)}}_appendElement(t,r){let n=this.treeAdapter.createElement(t.tagName,r,t.attrs);this._attachElementToTree(n,t.location)}_insertElement(t,r){let n=this.treeAdapter.createElement(t.tagName,r,t.attrs);this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID)}_insertFakeElement(t,r){let n=this.treeAdapter.createElement(t,I.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,r)}_insertTemplate(t){let r=this.treeAdapter.createElement(t.tagName,I.HTML,t.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(r,n),this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let t=this.treeAdapter.createElement(E.HTML,I.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,a.HTML)}_appendCommentNode(t,r){let n=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(r,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,t.location)}_insertCharacters(t){let r,n;if(this._shouldFosterParentOnInsertion()?({parent:r,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(r,t.chars,n):this.treeAdapter.insertText(r,t.chars)):(r=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(r,t.chars)),!t.location)return;let s=this.treeAdapter.getChildNodes(r),i=n?s.lastIndexOf(n):s.length,o=s[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){let{endLine:l,endCol:c,endOffset:m}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:l,endCol:c,endOffset:m})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,r){for(let n=this.treeAdapter.getFirstChild(t);n;n=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(r,n)}_setEndLocation(t,r){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&r.location){let n=r.location,s=this.treeAdapter.getTagName(t),i=r.type===D.END_TAG&&s===r.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,i)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let r,n;return this.openElements.stackTop===0&&this.fragmentContext?(r=this.fragmentContext,n=this.fragmentContextID):{current:r,currentTagId:n}=this.openElements,t.tagID===a.SVG&&this.treeAdapter.getTagName(r)===E.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(r)===I.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===a.MGLYPH||t.tagID===a.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,r,I.HTML)}_processToken(t){switch(t.type){case D.CHARACTER:{this.onCharacter(t);break}case D.NULL_CHARACTER:{this.onNullCharacter(t);break}case D.COMMENT:{this.onComment(t);break}case D.DOCTYPE:{this.onDoctype(t);break}case D.START_TAG:{this._processStartTag(t);break}case D.END_TAG:{this.onEndTag(t);break}case D.EOF:{this.onEof(t);break}case D.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,r,n){let s=this.treeAdapter.getNamespaceURI(r),i=this.treeAdapter.getAttrList(r);return wi(t,s,i,n)}_reconstructActiveFormattingElements(){let t=this.activeFormattingElements.entries.length;if(t){let r=this.activeFormattingElements.entries.findIndex(s=>s.type===pe.Marker||this.openElements.contains(s.element)),n=r===-1?t-1:r-1;for(let s=n;s>=0;s--){let i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=g.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(a.P),this.openElements.popUntilTagNamePopped(a.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case a.TR:{this.insertionMode=g.IN_ROW;return}case a.TBODY:case a.THEAD:case a.TFOOT:{this.insertionMode=g.IN_TABLE_BODY;return}case a.CAPTION:{this.insertionMode=g.IN_CAPTION;return}case a.COLGROUP:{this.insertionMode=g.IN_COLUMN_GROUP;return}case a.TABLE:{this.insertionMode=g.IN_TABLE;return}case a.BODY:{this.insertionMode=g.IN_BODY;return}case a.FRAMESET:{this.insertionMode=g.IN_FRAMESET;return}case a.SELECT:{this._resetInsertionModeForSelect(t);return}case a.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case a.HTML:{this.insertionMode=this.headElement?g.AFTER_HEAD:g.BEFORE_HEAD;return}case a.TD:case a.TH:{if(t>0){this.insertionMode=g.IN_CELL;return}break}case a.HEAD:{if(t>0){this.insertionMode=g.IN_HEAD;return}break}}this.insertionMode=g.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let r=t-1;r>0;r--){let n=this.openElements.tagIDs[r];if(n===a.TEMPLATE)break;if(n===a.TABLE){this.insertionMode=g.IN_SELECT_IN_TABLE;return}}this.insertionMode=g.IN_SELECT}_isElementCausesFosterParenting(t){return Ri.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){let r=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case a.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(r)===I.HTML)return{parent:this.treeAdapter.getTemplateContent(r),beforeElement:null};break}case a.TABLE:{let n=this.treeAdapter.getParentNode(r);return n?{parent:n,beforeElement:r}:{parent:this.openElements.items[t-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){let r=this._findFosterParentingLocation();r.beforeElement?this.treeAdapter.insertBefore(r.parent,t,r.beforeElement):this.treeAdapter.appendChild(r.parent,t)}_isSpecialElement(t,r){let n=this.treeAdapter.getNamespaceURI(t);return ai[n].has(r)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Cu(this,t);return}switch(this.insertionMode){case g.INITIAL:{_t(this,t);break}case g.BEFORE_HTML:{Lt(this,t);break}case g.BEFORE_HEAD:{Ot(this,t);break}case g.IN_HEAD:{vt(this,t);break}case g.IN_HEAD_NO_SCRIPT:{kt(this,t);break}case g.AFTER_HEAD:{Dt(this,t);break}case g.IN_BODY:case g.IN_CAPTION:case g.IN_CELL:case g.IN_TEMPLATE:{Oi(this,t);break}case g.TEXT:case g.IN_SELECT:case g.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case g.IN_TABLE:case g.IN_TABLE_BODY:case g.IN_ROW:{Ln(this,t);break}case g.IN_TABLE_TEXT:{Mi(this,t);break}case g.IN_COLUMN_GROUP:{wr(this,t);break}case g.AFTER_BODY:{xr(this,t);break}case g.AFTER_AFTER_BODY:{yr(this,t);break}default:}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){bu(this,t);return}switch(this.insertionMode){case g.INITIAL:{_t(this,t);break}case g.BEFORE_HTML:{Lt(this,t);break}case g.BEFORE_HEAD:{Ot(this,t);break}case g.IN_HEAD:{vt(this,t);break}case g.IN_HEAD_NO_SCRIPT:{kt(this,t);break}case g.AFTER_HEAD:{Dt(this,t);break}case g.TEXT:{this._insertCharacters(t);break}case g.IN_TABLE:case g.IN_TABLE_BODY:case g.IN_ROW:{Ln(this,t);break}case g.IN_COLUMN_GROUP:{wr(this,t);break}case g.AFTER_BODY:{xr(this,t);break}case g.AFTER_AFTER_BODY:{yr(this,t);break}default:}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){On(this,t);return}switch(this.insertionMode){case g.INITIAL:case g.BEFORE_HTML:case g.BEFORE_HEAD:case g.IN_HEAD:case g.IN_HEAD_NO_SCRIPT:case g.AFTER_HEAD:case g.IN_BODY:case g.IN_TABLE:case g.IN_CAPTION:case g.IN_COLUMN_GROUP:case g.IN_TABLE_BODY:case g.IN_ROW:case g.IN_CELL:case g.IN_SELECT:case g.IN_SELECT_IN_TABLE:case g.IN_TEMPLATE:case g.IN_FRAMESET:case g.AFTER_FRAMESET:{On(this,t);break}case g.IN_TABLE_TEXT:{Rt(this,t);break}case g.AFTER_BODY:{zl(this,t);break}case g.AFTER_AFTER_BODY:case g.AFTER_AFTER_FRAMESET:{ql(this,t);break}default:}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case g.INITIAL:{ed(this,t);break}case g.BEFORE_HEAD:case g.IN_HEAD:case g.IN_HEAD_NO_SCRIPT:case g.AFTER_HEAD:{this._err(t,T.misplacedDoctype);break}case g.IN_TABLE_TEXT:{Rt(this,t);break}default:}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,T.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Iu(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case g.INITIAL:{_t(this,t);break}case g.BEFORE_HTML:{td(this,t);break}case g.BEFORE_HEAD:{nd(this,t);break}case g.IN_HEAD:{ge(this,t);break}case g.IN_HEAD_NO_SCRIPT:{ad(this,t);break}case g.AFTER_HEAD:{cd(this,t);break}case g.IN_BODY:{V(this,t);break}case g.IN_TABLE:{st(this,t);break}case g.IN_TABLE_TEXT:{Rt(this,t);break}case g.IN_CAPTION:{su(this,t);break}case g.IN_COLUMN_GROUP:{Bn(this,t);break}case g.IN_TABLE_BODY:{_r(this,t);break}case g.IN_ROW:{Rr(this,t);break}case g.IN_CELL:{ou(this,t);break}case g.IN_SELECT:{Hi(this,t);break}case g.IN_SELECT_IN_TABLE:{lu(this,t);break}case g.IN_TEMPLATE:{uu(this,t);break}case g.AFTER_BODY:{pu(this,t);break}case g.IN_FRAMESET:{hu(this,t);break}case g.AFTER_FRAMESET:{mu(this,t);break}case g.AFTER_AFTER_BODY:{Eu(this,t);break}case g.AFTER_AFTER_FRAMESET:{Tu(this,t);break}default:}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?yu(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case g.INITIAL:{_t(this,t);break}case g.BEFORE_HTML:{rd(this,t);break}case g.BEFORE_HEAD:{sd(this,t);break}case g.IN_HEAD:{id(this,t);break}case g.IN_HEAD_NO_SCRIPT:{od(this,t);break}case g.AFTER_HEAD:{ld(this,t);break}case g.IN_BODY:{Nr(this,t);break}case g.TEXT:{jd(this,t);break}case g.IN_TABLE:{Pt(this,t);break}case g.IN_TABLE_TEXT:{Rt(this,t);break}case g.IN_CAPTION:{iu(this,t);break}case g.IN_COLUMN_GROUP:{au(this,t);break}case g.IN_TABLE_BODY:{vn(this,t);break}case g.IN_ROW:{Fi(this,t);break}case g.IN_CELL:{cu(this,t);break}case g.IN_SELECT:{Qi(this,t);break}case g.IN_SELECT_IN_TABLE:{du(this,t);break}case g.IN_TEMPLATE:{Au(this,t);break}case g.AFTER_BODY:{Gi(this,t);break}case g.IN_FRAMESET:{gu(this,t);break}case g.AFTER_FRAMESET:{fu(this,t);break}case g.AFTER_AFTER_BODY:{yr(this,t);break}default:}}onEof(t){switch(this.insertionMode){case g.INITIAL:{_t(this,t);break}case g.BEFORE_HTML:{Lt(this,t);break}case g.BEFORE_HEAD:{Ot(this,t);break}case g.IN_HEAD:{vt(this,t);break}case g.IN_HEAD_NO_SCRIPT:{kt(this,t);break}case g.AFTER_HEAD:{Dt(this,t);break}case g.IN_BODY:case g.IN_TABLE:case g.IN_CAPTION:case g.IN_COLUMN_GROUP:case g.IN_TABLE_BODY:case g.IN_ROW:case g.IN_CELL:case g.IN_SELECT:case g.IN_SELECT_IN_TABLE:{Bi(this,t);break}case g.TEXT:{Vd(this,t);break}case g.IN_TABLE_TEXT:{Rt(this,t);break}case g.IN_TEMPLATE:{Yi(this,t);break}case g.AFTER_BODY:case g.IN_FRAMESET:case g.AFTER_FRAMESET:case g.AFTER_AFTER_BODY:case g.AFTER_AFTER_FRAMESET:{Dn(this,t);break}default:}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===u.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case g.IN_HEAD:case g.IN_HEAD_NO_SCRIPT:case g.AFTER_HEAD:case g.TEXT:case g.IN_COLUMN_GROUP:case g.IN_SELECT:case g.IN_SELECT_IN_TABLE:case g.IN_FRAMESET:case g.AFTER_FRAMESET:{this._insertCharacters(t);break}case g.IN_BODY:case g.IN_CAPTION:case g.IN_CELL:case g.IN_TEMPLATE:case g.AFTER_BODY:case g.AFTER_AFTER_BODY:case g.AFTER_AFTER_FRAMESET:{Li(this,t);break}case g.IN_TABLE:case g.IN_TABLE_BODY:case g.IN_ROW:{Ln(this,t);break}case g.IN_TABLE_TEXT:{Pi(this,t);break}default:}}};function Jl(e,t){let r=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return r?e.openElements.contains(r.element)?e.openElements.hasInScope(t.tagID)||(r=null):(e.activeFormattingElements.removeEntry(r),r=null):Di(e,t),r}function $l(e,t){let r=null,n=e.openElements.stackTop;for(;n>=0;n--){let s=e.openElements.items[n];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[n])&&(r=s)}return r||(e.openElements.shortenToLength(Math.max(n,0)),e.activeFormattingElements.removeEntry(t)),r}function jl(e,t,r){let n=t,s=e.openElements.getCommonAncestor(t);for(let i=0,o=s;o!==r;i++,o=s){s=e.openElements.getCommonAncestor(o);let d=e.activeFormattingElements.getElementEntry(o),l=d&&i>=Wl;!d||l?(l&&e.activeFormattingElements.removeEntry(d),e.openElements.remove(o)):(o=Vl(e,d),n===t&&(e.activeFormattingElements.bookmark=d),e.treeAdapter.detachNode(n),e.treeAdapter.appendChild(o,n),n=o)}return n}function Vl(e,t){let r=e.treeAdapter.getNamespaceURI(t.element),n=e.treeAdapter.createElement(t.token.tagName,r,t.token.attrs);return e.openElements.replace(t.element,n),t.element=n,n}function Xl(e,t,r){let n=e.treeAdapter.getTagName(t),s=Qe(n);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(r);else{let i=e.treeAdapter.getNamespaceURI(t);s===a.TEMPLATE&&i===I.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,r)}}function Zl(e,t,r){let n=e.treeAdapter.getNamespaceURI(r.element),{token:s}=r,i=e.treeAdapter.createElement(s.tagName,n,s.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,s),e.activeFormattingElements.removeEntry(r),e.openElements.remove(r.element),e.openElements.insertAfter(t,i,s.tagID)}function kn(e,t){for(let r=0;r<Gl;r++){let n=Jl(e,t);if(!n)break;let s=$l(e,n);if(!s)break;e.activeFormattingElements.bookmark=n;let i=jl(e,s,n.element),o=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),o&&Xl(e,o,i),Zl(e,s,n)}}function On(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function zl(e,t){e._appendCommentNode(t,e.openElements.items[0])}function ql(e,t){e._appendCommentNode(t,e.document)}function Dn(e,t){if(e.stopped=!0,t.location){let r=e.fragmentContext?0:2;for(let n=e.openElements.stackTop;n>=r;n--)e._setEndLocation(e.openElements.items[n],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(n);if(s&&!s.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let i=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(i);o&&!o.endTag&&e._setEndLocation(i,t)}}}}function ed(e,t){e._setDocumentType(t);let r=t.forceQuirks?q.QUIRKS:bi(t);Ti(t)||e._err(t,T.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,r),e.insertionMode=g.BEFORE_HTML}function _t(e,t){e._err(t,T.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,q.QUIRKS),e.insertionMode=g.BEFORE_HTML,e._processToken(t)}function td(e,t){t.tagID===a.HTML?(e._insertElement(t,I.HTML),e.insertionMode=g.BEFORE_HEAD):Lt(e,t)}function rd(e,t){let r=t.tagID;(r===a.HTML||r===a.HEAD||r===a.BODY||r===a.BR)&&Lt(e,t)}function Lt(e,t){e._insertFakeRootElement(),e.insertionMode=g.BEFORE_HEAD,e._processToken(t)}function nd(e,t){switch(t.tagID){case a.HTML:{V(e,t);break}case a.HEAD:{e._insertElement(t,I.HTML),e.headElement=e.openElements.current,e.insertionMode=g.IN_HEAD;break}default:Ot(e,t)}}function sd(e,t){let r=t.tagID;r===a.HEAD||r===a.BODY||r===a.HTML||r===a.BR?Ot(e,t):e._err(t,T.endTagWithoutMatchingOpenElement)}function Ot(e,t){e._insertFakeElement(E.HEAD,a.HEAD),e.headElement=e.openElements.current,e.insertionMode=g.IN_HEAD,e._processToken(t)}function ge(e,t){switch(t.tagID){case a.HTML:{V(e,t);break}case a.BASE:case a.BASEFONT:case a.BGSOUND:case a.LINK:case a.META:{e._appendElement(t,I.HTML),t.ackSelfClosing=!0;break}case a.TITLE:{e._switchToTextParsing(t,j.RCDATA);break}case a.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,j.RAWTEXT):(e._insertElement(t,I.HTML),e.insertionMode=g.IN_HEAD_NO_SCRIPT);break}case a.NOFRAMES:case a.STYLE:{e._switchToTextParsing(t,j.RAWTEXT);break}case a.SCRIPT:{e._switchToTextParsing(t,j.SCRIPT_DATA);break}case a.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=g.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(g.IN_TEMPLATE);break}case a.HEAD:{e._err(t,T.misplacedStartTagForHeadElement);break}default:vt(e,t)}}function id(e,t){switch(t.tagID){case a.HEAD:{e.openElements.pop(),e.insertionMode=g.AFTER_HEAD;break}case a.BODY:case a.BR:case a.HTML:{vt(e,t);break}case a.TEMPLATE:{Ye(e,t);break}default:e._err(t,T.endTagWithoutMatchingOpenElement)}}function Ye(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==a.TEMPLATE&&e._err(t,T.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(a.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,T.endTagWithoutMatchingOpenElement)}function vt(e,t){e.openElements.pop(),e.insertionMode=g.AFTER_HEAD,e._processToken(t)}function ad(e,t){switch(t.tagID){case a.HTML:{V(e,t);break}case a.BASEFONT:case a.BGSOUND:case a.HEAD:case a.LINK:case a.META:case a.NOFRAMES:case a.STYLE:{ge(e,t);break}case a.NOSCRIPT:{e._err(t,T.nestedNoscriptInHead);break}default:kt(e,t)}}function od(e,t){switch(t.tagID){case a.NOSCRIPT:{e.openElements.pop(),e.insertionMode=g.IN_HEAD;break}case a.BR:{kt(e,t);break}default:e._err(t,T.endTagWithoutMatchingOpenElement)}}function kt(e,t){let r=t.type===D.EOF?T.openElementsLeftAfterEof:T.disallowedContentInNoscriptInHead;e._err(t,r),e.openElements.pop(),e.insertionMode=g.IN_HEAD,e._processToken(t)}function cd(e,t){switch(t.tagID){case a.HTML:{V(e,t);break}case a.BODY:{e._insertElement(t,I.HTML),e.framesetOk=!1,e.insertionMode=g.IN_BODY;break}case a.FRAMESET:{e._insertElement(t,I.HTML),e.insertionMode=g.IN_FRAMESET;break}case a.BASE:case a.BASEFONT:case a.BGSOUND:case a.LINK:case a.META:case a.NOFRAMES:case a.SCRIPT:case a.STYLE:case a.TEMPLATE:case a.TITLE:{e._err(t,T.abandonedHeadElementChild),e.openElements.push(e.headElement,a.HEAD),ge(e,t),e.openElements.remove(e.headElement);break}case a.HEAD:{e._err(t,T.misplacedStartTagForHeadElement);break}default:Dt(e,t)}}function ld(e,t){switch(t.tagID){case a.BODY:case a.HTML:case a.BR:{Dt(e,t);break}case a.TEMPLATE:{Ye(e,t);break}default:e._err(t,T.endTagWithoutMatchingOpenElement)}}function Dt(e,t){e._insertFakeElement(E.BODY,a.BODY),e.insertionMode=g.IN_BODY,Sr(e,t)}function Sr(e,t){switch(t.type){case D.CHARACTER:{Oi(e,t);break}case D.WHITESPACE_CHARACTER:{Li(e,t);break}case D.COMMENT:{On(e,t);break}case D.START_TAG:{V(e,t);break}case D.END_TAG:{Nr(e,t);break}case D.EOF:{Bi(e,t);break}default:}}function Li(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Oi(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function dd(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ud(e,t){let r=e.openElements.tryPeekProperlyNestedBodyElement();r&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(r,t.attrs))}function Ad(e,t){let r=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&r&&(e.treeAdapter.detachNode(r),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,I.HTML),e.insertionMode=g.IN_FRAMESET)}function pd(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,I.HTML)}function hd(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&xt.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,I.HTML)}function gd(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,I.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function md(e,t){let r=e.openElements.tmplCount>0;(!e.formElement||r)&&(e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,I.HTML),r||(e.formElement=e.openElements.current))}function fd(e,t){e.framesetOk=!1;let r=t.tagID;for(let n=e.openElements.stackTop;n>=0;n--){let s=e.openElements.tagIDs[n];if(r===a.LI&&s===a.LI||(r===a.DD||r===a.DT)&&(s===a.DD||s===a.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==a.ADDRESS&&s!==a.DIV&&s!==a.P&&e._isSpecialElement(e.openElements.items[n],s))break}e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,I.HTML)}function Ed(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,I.HTML),e.tokenizer.state=j.PLAINTEXT}function Td(e,t){e.openElements.hasInScope(a.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.framesetOk=!1}function bd(e,t){let r=e.activeFormattingElements.getElementEntryInScopeWithTagName(E.A);r&&(kn(e,t),e.openElements.remove(r.element),e.activeFormattingElements.removeEntry(r)),e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Cd(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Id(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(a.NOBR)&&(kn(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,I.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function yd(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function wd(e,t){e.treeAdapter.getDocumentMode(e.document)!==q.QUIRKS&&e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,I.HTML),e.framesetOk=!1,e.insertionMode=g.IN_TABLE}function vi(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,I.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function ki(e){let t=mr(e,Ce.TYPE);return t!=null&&t.toLowerCase()===Yl}function xd(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,I.HTML),ki(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Sd(e,t){e._appendElement(t,I.HTML),t.ackSelfClosing=!0}function Nd(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._appendElement(t,I.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function _d(e,t){t.tagName=E.IMG,t.tagID=a.IMG,vi(e,t)}function Rd(e,t){e._insertElement(t,I.HTML),e.skipNextNewLine=!0,e.tokenizer.state=j.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=g.TEXT}function Ld(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,j.RAWTEXT)}function Od(e,t){e.framesetOk=!1,e._switchToTextParsing(t,j.RAWTEXT)}function Ni(e,t){e._switchToTextParsing(t,j.RAWTEXT)}function vd(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===g.IN_TABLE||e.insertionMode===g.IN_CAPTION||e.insertionMode===g.IN_TABLE_BODY||e.insertionMode===g.IN_ROW||e.insertionMode===g.IN_CELL?g.IN_SELECT_IN_TABLE:g.IN_SELECT}function kd(e,t){e.openElements.currentTagId===a.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML)}function Dd(e,t){e.openElements.hasInScope(a.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,I.HTML)}function Bd(e,t){e.openElements.hasInScope(a.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(a.RTC),e._insertElement(t,I.HTML)}function Pd(e,t){e._reconstructActiveFormattingElements(),_n(t),Ir(t),t.selfClosing?e._appendElement(t,I.MATHML):e._insertElement(t,I.MATHML),t.ackSelfClosing=!0}function Md(e,t){e._reconstructActiveFormattingElements(),Rn(t),Ir(t),t.selfClosing?e._appendElement(t,I.SVG):e._insertElement(t,I.SVG),t.ackSelfClosing=!0}function _i(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML)}function V(e,t){switch(t.tagID){case a.I:case a.S:case a.B:case a.U:case a.EM:case a.TT:case a.BIG:case a.CODE:case a.FONT:case a.SMALL:case a.STRIKE:case a.STRONG:{Cd(e,t);break}case a.A:{bd(e,t);break}case a.H1:case a.H2:case a.H3:case a.H4:case a.H5:case a.H6:{hd(e,t);break}case a.P:case a.DL:case a.OL:case a.UL:case a.DIV:case a.DIR:case a.NAV:case a.MAIN:case a.MENU:case a.ASIDE:case a.CENTER:case a.FIGURE:case a.FOOTER:case a.HEADER:case a.HGROUP:case a.DIALOG:case a.DETAILS:case a.ADDRESS:case a.ARTICLE:case a.SEARCH:case a.SECTION:case a.SUMMARY:case a.FIELDSET:case a.BLOCKQUOTE:case a.FIGCAPTION:{pd(e,t);break}case a.LI:case a.DD:case a.DT:{fd(e,t);break}case a.BR:case a.IMG:case a.WBR:case a.AREA:case a.EMBED:case a.KEYGEN:{vi(e,t);break}case a.HR:{Nd(e,t);break}case a.RB:case a.RTC:{Dd(e,t);break}case a.RT:case a.RP:{Bd(e,t);break}case a.PRE:case a.LISTING:{gd(e,t);break}case a.XMP:{Ld(e,t);break}case a.SVG:{Md(e,t);break}case a.HTML:{dd(e,t);break}case a.BASE:case a.LINK:case a.META:case a.STYLE:case a.TITLE:case a.SCRIPT:case a.BGSOUND:case a.BASEFONT:case a.TEMPLATE:{ge(e,t);break}case a.BODY:{ud(e,t);break}case a.FORM:{md(e,t);break}case a.NOBR:{Id(e,t);break}case a.MATH:{Pd(e,t);break}case a.TABLE:{wd(e,t);break}case a.INPUT:{xd(e,t);break}case a.PARAM:case a.TRACK:case a.SOURCE:{Sd(e,t);break}case a.IMAGE:{_d(e,t);break}case a.BUTTON:{Td(e,t);break}case a.APPLET:case a.OBJECT:case a.MARQUEE:{yd(e,t);break}case a.IFRAME:{Od(e,t);break}case a.SELECT:{vd(e,t);break}case a.OPTION:case a.OPTGROUP:{kd(e,t);break}case a.NOEMBED:case a.NOFRAMES:{Ni(e,t);break}case a.FRAMESET:{Ad(e,t);break}case a.TEXTAREA:{Rd(e,t);break}case a.NOSCRIPT:{e.options.scriptingEnabled?Ni(e,t):_i(e,t);break}case a.PLAINTEXT:{Ed(e,t);break}case a.COL:case a.TH:case a.TD:case a.TR:case a.HEAD:case a.FRAME:case a.TBODY:case a.TFOOT:case a.THEAD:case a.CAPTION:case a.COLGROUP:break;default:_i(e,t)}}function Ud(e,t){if(e.openElements.hasInScope(a.BODY)&&(e.insertionMode=g.AFTER_BODY,e.options.sourceCodeLocationInfo)){let r=e.openElements.tryPeekProperlyNestedBodyElement();r&&e._setEndLocation(r,t)}}function Fd(e,t){e.openElements.hasInScope(a.BODY)&&(e.insertionMode=g.AFTER_BODY,Gi(e,t))}function Hd(e,t){let r=t.tagID;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r))}function Qd(e){let t=e.openElements.tmplCount>0,{formElement:r}=e;t||(e.formElement=null),(r||t)&&e.openElements.hasInScope(a.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(a.FORM):r&&e.openElements.remove(r))}function Yd(e){e.openElements.hasInButtonScope(a.P)||e._insertFakeElement(E.P,a.P),e._closePElement()}function Gd(e){e.openElements.hasInListItemScope(a.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(a.LI),e.openElements.popUntilTagNamePopped(a.LI))}function Wd(e,t){let r=t.tagID;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r))}function Kd(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Jd(e,t){let r=t.tagID;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r),e.activeFormattingElements.clearToLastMarker())}function $d(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(E.BR,a.BR),e.openElements.pop(),e.framesetOk=!1}function Di(e,t){let r=t.tagName,n=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){let i=e.openElements.items[s],o=e.openElements.tagIDs[s];if(n===o&&(n!==a.UNKNOWN||e.treeAdapter.getTagName(i)===r)){e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(i,o))break}}function Nr(e,t){switch(t.tagID){case a.A:case a.B:case a.I:case a.S:case a.U:case a.EM:case a.TT:case a.BIG:case a.CODE:case a.FONT:case a.NOBR:case a.SMALL:case a.STRIKE:case a.STRONG:{kn(e,t);break}case a.P:{Yd(e);break}case a.DL:case a.UL:case a.OL:case a.DIR:case a.DIV:case a.NAV:case a.PRE:case a.MAIN:case a.MENU:case a.ASIDE:case a.BUTTON:case a.CENTER:case a.FIGURE:case a.FOOTER:case a.HEADER:case a.HGROUP:case a.DIALOG:case a.ADDRESS:case a.ARTICLE:case a.DETAILS:case a.SEARCH:case a.SECTION:case a.SUMMARY:case a.LISTING:case a.FIELDSET:case a.BLOCKQUOTE:case a.FIGCAPTION:{Hd(e,t);break}case a.LI:{Gd(e);break}case a.DD:case a.DT:{Wd(e,t);break}case a.H1:case a.H2:case a.H3:case a.H4:case a.H5:case a.H6:{Kd(e);break}case a.BR:{$d(e);break}case a.BODY:{Ud(e,t);break}case a.HTML:{Fd(e,t);break}case a.FORM:{Qd(e);break}case a.APPLET:case a.OBJECT:case a.MARQUEE:{Jd(e,t);break}case a.TEMPLATE:{Ye(e,t);break}default:Di(e,t)}}function Bi(e,t){e.tmplInsertionModeStack.length>0?Yi(e,t):Dn(e,t)}function jd(e,t){var r;t.tagID===a.SCRIPT&&((r=e.scriptHandler)===null||r===void 0||r.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Vd(e,t){e._err(t,T.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Ln(e,t){if(e.openElements.currentTagId!==void 0&&Ri.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=g.IN_TABLE_TEXT,t.type){case D.CHARACTER:{Mi(e,t);break}case D.WHITESPACE_CHARACTER:{Pi(e,t);break}}else Mt(e,t)}function Xd(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,I.HTML),e.insertionMode=g.IN_CAPTION}function Zd(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,I.HTML),e.insertionMode=g.IN_COLUMN_GROUP}function zd(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(E.COLGROUP,a.COLGROUP),e.insertionMode=g.IN_COLUMN_GROUP,Bn(e,t)}function qd(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,I.HTML),e.insertionMode=g.IN_TABLE_BODY}function eu(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(E.TBODY,a.TBODY),e.insertionMode=g.IN_TABLE_BODY,_r(e,t)}function tu(e,t){e.openElements.hasInTableScope(a.TABLE)&&(e.openElements.popUntilTagNamePopped(a.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function ru(e,t){ki(t)?e._appendElement(t,I.HTML):Mt(e,t),t.ackSelfClosing=!0}function nu(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,I.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function st(e,t){switch(t.tagID){case a.TD:case a.TH:case a.TR:{eu(e,t);break}case a.STYLE:case a.SCRIPT:case a.TEMPLATE:{ge(e,t);break}case a.COL:{zd(e,t);break}case a.FORM:{nu(e,t);break}case a.TABLE:{tu(e,t);break}case a.TBODY:case a.TFOOT:case a.THEAD:{qd(e,t);break}case a.INPUT:{ru(e,t);break}case a.CAPTION:{Xd(e,t);break}case a.COLGROUP:{Zd(e,t);break}default:Mt(e,t)}}function Pt(e,t){switch(t.tagID){case a.TABLE:{e.openElements.hasInTableScope(a.TABLE)&&(e.openElements.popUntilTagNamePopped(a.TABLE),e._resetInsertionMode());break}case a.TEMPLATE:{Ye(e,t);break}case a.BODY:case a.CAPTION:case a.COL:case a.COLGROUP:case a.HTML:case a.TBODY:case a.TD:case a.TFOOT:case a.TH:case a.THEAD:case a.TR:break;default:Mt(e,t)}}function Mt(e,t){let r=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Sr(e,t),e.fosterParentingEnabled=r}function Pi(e,t){e.pendingCharacterTokens.push(t)}function Mi(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Rt(e,t){let r=0;if(e.hasNonWhitespacePendingCharacterToken)for(;r<e.pendingCharacterTokens.length;r++)Mt(e,e.pendingCharacterTokens[r]);else for(;r<e.pendingCharacterTokens.length;r++)e._insertCharacters(e.pendingCharacterTokens[r]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var Ui=new Set([a.CAPTION,a.COL,a.COLGROUP,a.TBODY,a.TD,a.TFOOT,a.TH,a.THEAD,a.TR]);function su(e,t){let r=t.tagID;Ui.has(r)?e.openElements.hasInTableScope(a.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=g.IN_TABLE,st(e,t)):V(e,t)}function iu(e,t){let r=t.tagID;switch(r){case a.CAPTION:case a.TABLE:{e.openElements.hasInTableScope(a.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=g.IN_TABLE,r===a.TABLE&&Pt(e,t));break}case a.BODY:case a.COL:case a.COLGROUP:case a.HTML:case a.TBODY:case a.TD:case a.TFOOT:case a.TH:case a.THEAD:case a.TR:break;default:Nr(e,t)}}function Bn(e,t){switch(t.tagID){case a.HTML:{V(e,t);break}case a.COL:{e._appendElement(t,I.HTML),t.ackSelfClosing=!0;break}case a.TEMPLATE:{ge(e,t);break}default:wr(e,t)}}function au(e,t){switch(t.tagID){case a.COLGROUP:{e.openElements.currentTagId===a.COLGROUP&&(e.openElements.pop(),e.insertionMode=g.IN_TABLE);break}case a.TEMPLATE:{Ye(e,t);break}case a.COL:break;default:wr(e,t)}}function wr(e,t){e.openElements.currentTagId===a.COLGROUP&&(e.openElements.pop(),e.insertionMode=g.IN_TABLE,e._processToken(t))}function _r(e,t){switch(t.tagID){case a.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,I.HTML),e.insertionMode=g.IN_ROW;break}case a.TH:case a.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(E.TR,a.TR),e.insertionMode=g.IN_ROW,Rr(e,t);break}case a.CAPTION:case a.COL:case a.COLGROUP:case a.TBODY:case a.TFOOT:case a.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE,st(e,t));break}default:st(e,t)}}function vn(e,t){let r=t.tagID;switch(t.tagID){case a.TBODY:case a.TFOOT:case a.THEAD:{e.openElements.hasInTableScope(r)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE);break}case a.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE,Pt(e,t));break}case a.BODY:case a.CAPTION:case a.COL:case a.COLGROUP:case a.HTML:case a.TD:case a.TH:case a.TR:break;default:Pt(e,t)}}function Rr(e,t){switch(t.tagID){case a.TH:case a.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,I.HTML),e.insertionMode=g.IN_CELL,e.activeFormattingElements.insertMarker();break}case a.CAPTION:case a.COL:case a.COLGROUP:case a.TBODY:case a.TFOOT:case a.THEAD:case a.TR:{e.openElements.hasInTableScope(a.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE_BODY,_r(e,t));break}default:st(e,t)}}function Fi(e,t){switch(t.tagID){case a.TR:{e.openElements.hasInTableScope(a.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE_BODY);break}case a.TABLE:{e.openElements.hasInTableScope(a.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE_BODY,vn(e,t));break}case a.TBODY:case a.TFOOT:case a.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(a.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE_BODY,vn(e,t));break}case a.BODY:case a.CAPTION:case a.COL:case a.COLGROUP:case a.HTML:case a.TD:case a.TH:break;default:Pt(e,t)}}function ou(e,t){let r=t.tagID;Ui.has(r)?(e.openElements.hasInTableScope(a.TD)||e.openElements.hasInTableScope(a.TH))&&(e._closeTableCell(),Rr(e,t)):V(e,t)}function cu(e,t){let r=t.tagID;switch(r){case a.TD:case a.TH:{e.openElements.hasInTableScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=g.IN_ROW);break}case a.TABLE:case a.TBODY:case a.TFOOT:case a.THEAD:case a.TR:{e.openElements.hasInTableScope(r)&&(e._closeTableCell(),Fi(e,t));break}case a.BODY:case a.CAPTION:case a.COL:case a.COLGROUP:case a.HTML:break;default:Nr(e,t)}}function Hi(e,t){switch(t.tagID){case a.HTML:{V(e,t);break}case a.OPTION:{e.openElements.currentTagId===a.OPTION&&e.openElements.pop(),e._insertElement(t,I.HTML);break}case a.OPTGROUP:{e.openElements.currentTagId===a.OPTION&&e.openElements.pop(),e.openElements.currentTagId===a.OPTGROUP&&e.openElements.pop(),e._insertElement(t,I.HTML);break}case a.HR:{e.openElements.currentTagId===a.OPTION&&e.openElements.pop(),e.openElements.currentTagId===a.OPTGROUP&&e.openElements.pop(),e._appendElement(t,I.HTML),t.ackSelfClosing=!0;break}case a.INPUT:case a.KEYGEN:case a.TEXTAREA:case a.SELECT:{e.openElements.hasInSelectScope(a.SELECT)&&(e.openElements.popUntilTagNamePopped(a.SELECT),e._resetInsertionMode(),t.tagID!==a.SELECT&&e._processStartTag(t));break}case a.SCRIPT:case a.TEMPLATE:{ge(e,t);break}default:}}function Qi(e,t){switch(t.tagID){case a.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===a.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===a.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===a.OPTGROUP&&e.openElements.pop();break}case a.OPTION:{e.openElements.currentTagId===a.OPTION&&e.openElements.pop();break}case a.SELECT:{e.openElements.hasInSelectScope(a.SELECT)&&(e.openElements.popUntilTagNamePopped(a.SELECT),e._resetInsertionMode());break}case a.TEMPLATE:{Ye(e,t);break}default:}}function lu(e,t){let r=t.tagID;r===a.CAPTION||r===a.TABLE||r===a.TBODY||r===a.TFOOT||r===a.THEAD||r===a.TR||r===a.TD||r===a.TH?(e.openElements.popUntilTagNamePopped(a.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Hi(e,t)}function du(e,t){let r=t.tagID;r===a.CAPTION||r===a.TABLE||r===a.TBODY||r===a.TFOOT||r===a.THEAD||r===a.TR||r===a.TD||r===a.TH?e.openElements.hasInTableScope(r)&&(e.openElements.popUntilTagNamePopped(a.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Qi(e,t)}function uu(e,t){switch(t.tagID){case a.BASE:case a.BASEFONT:case a.BGSOUND:case a.LINK:case a.META:case a.NOFRAMES:case a.SCRIPT:case a.STYLE:case a.TEMPLATE:case a.TITLE:{ge(e,t);break}case a.CAPTION:case a.COLGROUP:case a.TBODY:case a.TFOOT:case a.THEAD:{e.tmplInsertionModeStack[0]=g.IN_TABLE,e.insertionMode=g.IN_TABLE,st(e,t);break}case a.COL:{e.tmplInsertionModeStack[0]=g.IN_COLUMN_GROUP,e.insertionMode=g.IN_COLUMN_GROUP,Bn(e,t);break}case a.TR:{e.tmplInsertionModeStack[0]=g.IN_TABLE_BODY,e.insertionMode=g.IN_TABLE_BODY,_r(e,t);break}case a.TD:case a.TH:{e.tmplInsertionModeStack[0]=g.IN_ROW,e.insertionMode=g.IN_ROW,Rr(e,t);break}default:e.tmplInsertionModeStack[0]=g.IN_BODY,e.insertionMode=g.IN_BODY,V(e,t)}}function Au(e,t){t.tagID===a.TEMPLATE&&Ye(e,t)}function Yi(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(a.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Dn(e,t)}function pu(e,t){t.tagID===a.HTML?V(e,t):xr(e,t)}function Gi(e,t){var r;if(t.tagID===a.HTML){if(e.fragmentContext||(e.insertionMode=g.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===a.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!(!((r=e.treeAdapter.getNodeSourceCodeLocation(n))===null||r===void 0)&&r.endTag)&&e._setEndLocation(n,t)}}else xr(e,t)}function xr(e,t){e.insertionMode=g.IN_BODY,Sr(e,t)}function hu(e,t){switch(t.tagID){case a.HTML:{V(e,t);break}case a.FRAMESET:{e._insertElement(t,I.HTML);break}case a.FRAME:{e._appendElement(t,I.HTML),t.ackSelfClosing=!0;break}case a.NOFRAMES:{ge(e,t);break}default:}}function gu(e,t){t.tagID===a.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==a.FRAMESET&&(e.insertionMode=g.AFTER_FRAMESET))}function mu(e,t){switch(t.tagID){case a.HTML:{V(e,t);break}case a.NOFRAMES:{ge(e,t);break}default:}}function fu(e,t){t.tagID===a.HTML&&(e.insertionMode=g.AFTER_AFTER_FRAMESET)}function Eu(e,t){t.tagID===a.HTML?V(e,t):yr(e,t)}function yr(e,t){e.insertionMode=g.IN_BODY,Sr(e,t)}function Tu(e,t){switch(t.tagID){case a.HTML:{V(e,t);break}case a.NOFRAMES:{ge(e,t);break}default:}}function bu(e,t){t.chars=U,e._insertCharacters(t)}function Cu(e,t){e._insertCharacters(t),e.framesetOk=!1}function Wi(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==I.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Iu(e,t){if(Ii(t))Wi(e),e._startTagOutsideForeignContent(t);else{let r=e._getAdjustedCurrentElement(),n=e.treeAdapter.getNamespaceURI(r);n===I.MATHML?_n(t):n===I.SVG&&(yi(t),Rn(t)),Ir(t),t.selfClosing?e._appendElement(t,n):e._insertElement(t,n),t.ackSelfClosing=!0}}function yu(e,t){if(t.tagID===a.P||t.tagID===a.BR){Wi(e),e._endTagOutsideForeignContent(t);return}for(let r=e.openElements.stackTop;r>0;r--){let n=e.openElements.items[r];if(e.treeAdapter.getNamespaceURI(n)===I.HTML){e._endTagOutsideForeignContent(t);break}let s=e.treeAdapter.getTagName(n);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(r);break}}}var Fm=new Set([E.AREA,E.BASE,E.BASEFONT,E.BGSOUND,E.BR,E.COL,E.EMBED,E.FRAME,E.HR,E.IMG,E.INPUT,E.KEYGEN,E.LINK,E.META,E.PARAM,E.SOURCE,E.TRACK,E.WBR]);function Ki(e,t){return Bt.parse(e,t)}function oe(e,t){return e.attrs?.find(r=>r.name.toLowerCase()===t.toLowerCase())?.value??null}function Pn(e){return e.nodeName==="#text"?e.value??"":(e.childNodes??[]).map(Pn).join("")}function xe(e){return e?.replace(/\s+/g," ").trim()||null}function Mn(e){let t=Ki(e),r={title:null,description:null,canonical:null,baseHref:null,robots:null,lang:null,h1Count:0,openGraph:{title:null,description:null,image:null},twitter:{card:null,title:null,description:null,image:null},hreflang:[],jsonLd:[],images:[],links:[],wordCount:0,visibleText:""},n=[];function s(i,o=!1){let d=i.tagName?.toLowerCase(),l=o||d==="script"||d==="style"||d==="noscript"||d==="template";if(i.nodeName==="#text"&&!l){let c=xe(i.value);c&&n.push(c)}if(d==="html"&&r.lang===null&&(r.lang=xe(oe(i,"lang"))),d==="title"&&r.title===null&&(r.title=xe(Pn(i))),d==="h1"&&(r.h1Count+=1),d==="meta"){let c=oe(i,"name")?.toLowerCase(),m=oe(i,"property")?.toLowerCase(),A=xe(oe(i,"content"));c==="description"&&r.description===null?r.description=A:c==="robots"&&A?r.robots=r.robots?`${r.robots}, ${A}`:A:m==="og:title"&&r.openGraph.title===null?r.openGraph.title=A:m==="og:description"&&r.openGraph.description===null?r.openGraph.description=A:m==="og:image"&&r.openGraph.image===null?r.openGraph.image=A:c==="twitter:card"&&r.twitter.card===null?r.twitter.card=A:c==="twitter:title"&&r.twitter.title===null?r.twitter.title=A:c==="twitter:description"&&r.twitter.description===null?r.twitter.description=A:c==="twitter:image"&&r.twitter.image===null&&(r.twitter.image=A)}if(d==="base"&&r.baseHref===null&&(r.baseHref=oe(i,"href")),d==="link"){let c=oe(i,"rel")?.toLowerCase().split(/\s+/).filter(Boolean)??[];if(c.includes("canonical")&&r.canonical===null&&(r.canonical=xe(oe(i,"href"))),c.includes("alternate")){let m=xe(oe(i,"hreflang")),A=xe(oe(i,"href"));m&&A&&r.hreflang.push({lang:m,url:A})}}if(d==="a"){let c=oe(i,"href");c&&r.links.push(c)}if(d==="img"&&r.images.push({src:xe(oe(i,"src")),alt:oe(i,"alt")}),d==="script"&&oe(i,"type")?.toLowerCase()==="application/ld+json"){let c=Pn(i).trim();if(c)try{r.jsonLd.push({valid:!0,value:JSON.parse(c)})}catch(m){r.jsonLd.push({valid:!1,error:m instanceof Error?m.message:String(m)})}}for(let c of i.childNodes??[])s(c,l)}return s(t),r.visibleText=n.join(" "),r.wordCount=r.visibleText?r.visibleText.split(/\s+/u).length:0,r}function wu(e,t){return{url:e,finalUrl:null,status:null,contentType:null,blockedByRobots:!1,error:null,title:null,description:null,canonical:null,canonicalRaw:null,robots:null,xRobotsTag:null,lang:null,h1Count:0,openGraph:{title:null,description:null,image:null},twitter:{card:null,title:null,description:null,image:null},hreflang:[],jsonLd:[],images:[],links:[],internalLinks:[],externalLinks:[],wordCount:0,contentHash:null,depth:t,redirectChain:[],responseBytes:0}}async function it(e,t){await e.onEvent?.(t)}async function xu(e,t,r,n,s){let i=wu(e,t);if(n.respectRobots&&!ys(e,s))return i.blockedByRobots=!0,i;try{if(n.renderer){n.signal?.throwIfAborted(),await n.requestGate(e);let S=await n.renderer.render({url:e,timeout:n.timeout,maxResponseBytes:n.maxResponseBytes,userAgent:n.userAgent,...n.signal?{signal:n.signal}:{}});return Su(i,S,e,r,n.includeQuery)}let{response:o,redirectChain:d}=await ve(e,{headers:{accept:"text/html,application/xhtml+xml;q=0.9,*/*;q=0.1","user-agent":n.userAgent}},{...n,gate:n.requestGate,onEvent:n.onEvent}),l=o.headers.get("content-type")??"",c=l.includes("text/html")||l.includes("application/xhtml+xml"),m=G(o.url,void 0,{includeQuery:n.includeQuery});if(i.finalUrl=m,i.status=o.status,i.contentType=l||null,i.xRobotsTag=o.headers.get("x-robots-tag"),i.redirectChain=d,!c)return await o.body?.cancel(),i;let{text:A,bytes:h}=await ke(o,n.maxResponseBytes),f=Mn(A),b=$i(f.baseHref,o.url||e),y=f.canonical?G(f.canonical,b,{includeQuery:!0}):null,C=[...new Set(f.links.map(S=>G(S,b,{includeQuery:n.includeQuery})).filter(S=>!!S))].sort(),N=f.hreflang.map(S=>({lang:S.lang,url:G(S.url,b,{includeQuery:!0})}));return Object.assign(i,{...f,visibleText:void 0,baseHref:void 0,canonical:y,canonicalRaw:f.canonical,links:C,internalLinks:C.filter(S=>ue(S,r)),externalLinks:C.filter(S=>!ue(S,r)),hreflang:N,contentHash:f.visibleText?Ji("sha256").update(f.visibleText.toLowerCase()).digest("hex"):null,responseBytes:h}),i}catch(o){if(n.signal?.aborted)throw o;return i.error=o instanceof Error?o.message:String(o),o instanceof Ee&&(i.redirectChain=o.redirectChain),i}}function $i(e,t){if(e===null)return t;try{let r=new URL(e,t);return r.protocol==="data:"||r.protocol==="javascript:"?t:r.href}catch{return t}}function Su(e,t,r,n,s){let i=t.headers["content-type"]??"text/html",o=G(t.finalUrl,void 0,{includeQuery:s});if(e.finalUrl=o,e.status=t.status,e.contentType=i,e.xRobotsTag=t.headers["x-robots-tag"]??null,e.redirectChain=t.redirectChain,!i.includes("text/html")&&!i.includes("application/xhtml+xml"))return e;let d=Mn(t.html),l=$i(d.baseHref,t.finalUrl||r),c=d.canonical?G(d.canonical,l,{includeQuery:!0}):null,m=[...new Set(d.links.map(A=>G(A,l,{includeQuery:s})).filter(A=>!!A))].sort();return Object.assign(e,{...d,visibleText:void 0,baseHref:void 0,canonical:c,canonicalRaw:d.canonical,links:m,internalLinks:m.filter(A=>ue(A,n)),externalLinks:m.filter(A=>!ue(A,n)),hreflang:d.hreflang.map(A=>({lang:A.lang,url:G(A.url,l,{includeQuery:!0})})),contentHash:d.visibleText?Ji("sha256").update(d.visibleText.toLowerCase()).digest("hex"):null,responseBytes:t.responseBytes}),e}function Nu(e={}){let t=e.requestDelay??e.delay??100,r=e.requestGate;return{...e,maxPages:e.maxPages??100,concurrency:Math.max(1,e.concurrency??5),timeout:e.timeout??1e4,includeQuery:e.includeQuery??!1,respectRobots:e.respectRobots??!0,sitemap:e.sitemap??null,sitemapData:e.sitemapData??null,userAgent:e.userAgent??Re,requestDelay:t,requestGate:r?async n=>r(n):Ve(t),maxRedirects:e.maxRedirects??10,maxResponseBytes:e.maxResponseBytes??5*1024*1024,retries:e.retries??2,fetch:e.fetch??globalThis.fetch,logger:e.logger??qt}}async function _u(e,t){let r=[],n=Array.from({length:e},async()=>{for(;;){let s=await t();if(s===null)return;r.push(s)}});return await Promise.all(n),r}async function ji(e,t={}){let r=Date.now(),n=Nu(t),s=G(e,void 0,{includeQuery:n.includeQuery});if(!s)throw new Error(`invalid start URL: ${e}`);let i=new URL(s).origin;await it(n,{type:"scan-start",url:s,total:n.maxPages});let o=t.robots??await er(s,n),d=n.sitemapData;if(!d&&n.sitemap)try{d=await ur(n.sitemap,{...n,maxUrls:t.sitemapMaxUrls??5e4,siteOrigin:i})}catch(_){d={url:n.sitemap,urls:[],sitemapCount:0,truncated:!1,error:_ instanceof Error?_.message:String(_)},n.logger.warn(`Could not load sitemap ${n.sitemap}: ${d.error}`)}let c=[...new Set([s,...d?.urls??[]])].slice(0,n.maxPages).map(_=>({url:_,depth:0})),m=new Set(c.map(_=>_.url)),A=new Map((t.cachedPages??[]).map(_=>[_.url,_])),h=new Map,f=Math.max(n.maxPages*10,n.maxPages),b=!1;for(;c.length>0&&h.size<n.maxPages&&!n.signal?.aborted;){c.sort((x,k)=>x.url.localeCompare(k.url));let _=n.maxPages-h.size,B=c.slice(0,_);c.length>B.length&&(b=!0);let L=0,M=await _u(n.concurrency,async()=>{if(n.signal?.aborted||L>=B.length)return null;let x=B[L++];if(!x)return null;let k=A.get(x.url);if(!k)try{k=await xu(x.url,x.depth,i,n,o)}catch(H){if(n.signal?.aborted)return null;throw H}return h.set(x.url,k),A.has(x.url)||(await t.onBatch?.([k]),await n.storage?.saveCheckpoint?.(s,k),await it(n,{type:"checkpoint",page:k,completed:h.size,total:n.maxPages})),t.onProgress?.(h.size,n.maxPages),await it(n,{type:"page",completed:h.size,total:n.maxPages,page:k}),await it(n,{type:"progress",completed:h.size,total:n.maxPages,page:k}),{item:x,page:k}}),v=new Map;for(let{item:x,page:k}of M.sort((H,X)=>H.item.url.localeCompare(X.item.url))){let H=k.internalLinks?.length?k.internalLinks:(k.links??[]).filter(X=>ue(X,i));for(let X of[...H].sort())m.size>=f||m.has(X)||!lr(X)||(m.add(X),v.set(X,{url:X,depth:x.depth+1}))}c=[...v.values()]}let y=[...h.values()].sort((_,B)=>_.url.localeCompare(B.url)),C=!!n.signal?.aborted,N=C||b||c.length>0||(d?d.urls.length>y.length:!1)||(d?.truncated??!1),S={startUrl:s,pages:y,robots:o,sitemap:d,truncated:N,partial:C,durationMs:Date.now()-r,options:n};return S.snapshot=ye(S),C||await n.storage?.removeCheckpoint?.(s),C?await it(n,{type:"cancelled",completed:y.length,total:n.maxPages,partial:!0}):await it(n,{type:"complete",completed:y.length,total:n.maxPages}),S}function Vi(e){return"planVersion"in e}function Ru(e,t){return{schemaVersion:2,pageSchemaVersion:1,siteUrl:e.startUrl,sitemapUrl:e.sitemap?.url??null,includeQuery:e.config.includeQuery,respectRobots:e.config.respectRobots,timeout:e.config.timeout,maxRedirects:e.config.maxRedirects,maxResponseBytes:e.config.maxResponseBytes,userAgent:e.userAgent,...t?{rendererId:t}:{}}}function Lu(e){return!e.error&&(e.status===null||e.status<500)}async function at(e,t={}){let r=null,n=null,s;try{s=Vi(e)?e:await Ae(e,{...t,async onEvent(f){f.type==="robots"&&(r=f.robots),f.type==="sitemap"&&(n=f.sitemap),await t.onEvent?.(f)}})}catch(f){if(Vi(e)||!t.signal?.aborted)throw f;let b=be(e),y=G(b.url,void 0,{includeQuery:b.includeQuery});if(!y)throw new Error(`invalid start URL: ${b.url}`,{cause:f});let C=r??{url:new URL("/robots.txt",y).href,status:null,sha256:null,error:"Scan cancelled before robots.txt planning completed",denyAll:!1},N=ye({startUrl:y,pages:[],robots:C,sitemap:n,options:b,partial:!0,truncated:!0});return await t.checkpointStore?.flush?.(),await t.onEvent?.({type:"cancelled",completed:0,total:b.maxPages,partial:!0}),{snapshot:N,startUrl:y,pages:[],robots:C,sitemap:n,truncated:!0,partial:!0,durationMs:0,options:b}}if(s.planVersion!==1)throw new Error(`unsupported scan plan version: ${String(s.planVersion)}`);let i=t.limit??s.config.maxPages;if(!Number.isInteger(i)||i<=0)throw new Error("scan limit must be a positive integer");let o={...s.config,maxPages:i},d=Ve(o.delay),l=Ru(s,t.renderer?.id),c=t.checkpointStore&&t.resume!==!1?await t.checkpointStore.load(l):null,m=[...t.cachedPages??[],...c?.pages.filter(Lu)??[]],A=[...new Map(m.map(f=>[f.url,f])).values()];A.length>0&&await t.onEvent?.({type:"resume",completed:A.length,total:i});let h=await ji(s.startUrl,{...t,maxPages:i,concurrency:o.concurrency,requestDelay:o.delay,timeout:o.timeout,respectRobots:o.respectRobots,includeQuery:o.includeQuery,maxRedirects:o.maxRedirects,maxResponseBytes:o.maxResponseBytes,enabledRules:o.enabledRules,severityOverrides:o.severityOverrides,suppressions:o.suppressions,regressionBudgets:o.regressionBudgets,report:o.report,requestGate:d,robots:s.robots,sitemap:s.sitemap?.url??null,sitemapData:s.sitemap,userAgent:s.userAgent,cachedPages:A,async onBatch(f){for(let b of f)await t.checkpointStore?.append(l,b);await t.onBatch?.(f)}});return await t.checkpointStore?.flush?.(),!h.partial&&!t.retainCheckpoint&&await t.checkpointStore?.clear(l),h}function Xi(e){return/^\d+$/.test(e)?":id":/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)?":uuid":/^\d{4}-\d{2}-\d{2}$/.test(e)?":date":/^[0-9a-f]{16,}$/i.test(e)?":hash":null}function Ou(e){return e.flatMap(t=>{try{let r=new URL(t.url);return[{issue:t,url:r,segments:r.pathname.split("/").filter(Boolean)}]}catch{return[]}})}function vu(e){let t=new Map;for(let r of e)for(let n=1;n<r.segments.length;n+=1){if(Xi(r.segments[n]))continue;let s=r.segments.slice(0,n).join("/"),i=`${r.url.origin}|${r.segments.length}|${n}|${s}`,o=t.get(i)??new Set;o.add(r.segments[n]),t.set(i,o)}return new Set([...t].filter(([,r])=>r.size>=2).map(([r])=>r))}function ku(e,t){let r=e.segments.map((n,s)=>{let i=Xi(n);if(i)return i;let o=e.segments.slice(0,s).join("/"),d=`${e.url.origin}|${e.segments.length}|${s}|${o}`;return s>0&&t.has(d)?":slug":n});return`/${r.join("/")}${e.url.pathname.endsWith("/")&&r.length>0?"/":""}`}function Ge(e){return Lr(e.map(t=>({url:t,ruleId:"",severity:"info",owner:"seo"}))).map(({origin:t,template:r,urls:n})=>({origin:t,template:r,urls:n}))}function Lr(e){let t=Ou(e),r=vu(t),n=new Map;for(let s of t){let i=ku(s,r),o=`${s.url.origin}${i}`,d=n.get(o)??{origin:s.url.origin,template:i,issues:[],urls:new Set};d.issues.push(s.issue),d.urls.add(s.issue.url),n.set(o,d)}return[...n.values()].map(s=>{let i={error:0,warning:0,info:0},o={},d={};for(let c of s.issues)i[c.severity]+=1,o[c.ruleId]=(o[c.ruleId]??0)+1,d[c.owner]=(d[c.owner]??0)+1;let l=[...s.urls].sort();return{origin:s.origin,template:s.template,issueCount:s.issues.length,affectedPages:l.length,severities:i,rules:o,owners:d,urls:l,representativeUrls:l.slice(0,3)}}).sort((s,i)=>i.issueCount-s.issueCount||s.template.localeCompare(i.template)||s.origin.localeCompare(i.origin))}function Zi(e){let t=e.replaceAll("-"," ");return t.charAt(0).toUpperCase()+t.slice(1)}var Du={"page-unreachable":"\u041D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430","http-error":"HTTP-\u043F\u043E\u043C\u0438\u043B\u043A\u0430",noindex:"Noindex","x-robots-noindex":"Noindex \u0443 X-Robots-Tag","robots-blocked":"\u0417\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E robots.txt","missing-canonical":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 canonical","invalid-canonical":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 canonical","cross-domain-canonical":"Canonical \u043D\u0430 \u0456\u043D\u0448\u043E\u043C\u0443 \u0434\u043E\u043C\u0435\u043D\u0456","canonical-target-error":"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u0446\u0456\u043B\u0456 canonical","redirect-loop":"\u0426\u0438\u043A\u043B \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C","long-redirect-chain":"\u0414\u043E\u0432\u0433\u0438\u0439 \u043B\u0430\u043D\u0446\u044E\u0436\u043E\u043A \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C","sitemap-unavailable":"Sitemap \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439","noindex-in-sitemap":"Noindex \u0443 sitemap","redirect-in-sitemap":"\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0443 sitemap","missing-title":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 title","duplicate-title":"\u0414\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0438\u0439 title","pagination-title-duplicate":"\u041A\u0440\u0438\u0442\u0438\u0447\u043D\u0456 \u0434\u0443\u0431\u043B\u0456\u043A\u0430\u0442\u0438 title \u043F\u0430\u0433\u0456\u043D\u0430\u0446\u0456\u0457","near-duplicate-title":"\u0414\u0443\u0436\u0435 \u0441\u0445\u043E\u0436\u0456 title","title-length":"\u0414\u043E\u0432\u0436\u0438\u043D\u0430 title","missing-description":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 description","duplicate-description":"\u0414\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0438\u0439 description","description-length":"\u0414\u043E\u0432\u0436\u0438\u043D\u0430 description","missing-h1":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 H1","broken-internal-link":"\u041D\u0435\u0440\u043E\u0431\u043E\u0447\u0435 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F","orphan-sitemap-page":"\u0406\u0437\u043E\u043B\u044C\u043E\u0432\u0430\u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 sitemap","crawlable-not-in-sitemap":"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u044F \u0443 sitemap","invalid-hreflang":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 hreflang","malformed-json-ld":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 JSON-LD","http-on-https-site":"HTTP URL \u043D\u0430 HTTPS-\u0441\u0430\u0439\u0442\u0456","invalid-language":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0435 \u043E\u0433\u043E\u043B\u043E\u0448\u0435\u043D\u043D\u044F \u043C\u043E\u0432\u0438","duplicate-content":"\u0414\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442","multiple-h1":"\u041A\u0456\u043B\u044C\u043A\u0430 H1","missing-open-graph":"\u041D\u0435\u043F\u043E\u0432\u043D\u0456 Open Graph metadata","missing-twitter-metadata":"\u041D\u0435\u043F\u043E\u0432\u043D\u0456 Twitter metadata","image-missing-alt":"\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0431\u0435\u0437 alt","low-word-count":"\u041C\u0430\u043B\u043E \u0442\u0435\u043A\u0441\u0442\u0443","robots-changed":"robots.txt \u0437\u043C\u0456\u043D\u0435\u043D\u043E","page-missing":"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u043D\u0435 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E","status-regression":"\u0420\u0435\u0433\u0440\u0435\u0441\u0456\u044F HTTP-\u0441\u0442\u0430\u0442\u0443\u0441\u0443","new-noindex":"\u041D\u043E\u0432\u0438\u0439 noindex","title-removed":"Title \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","title-changed":"Title \u0437\u043C\u0456\u043D\u0435\u043D\u043E","description-removed":"Description \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","canonical-removed":"Canonical \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","canonical-changed":"Canonical \u0437\u043C\u0456\u043D\u0435\u043D\u043E","h1-removed":"H1 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","redirect-changed":"\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0437\u043C\u0456\u043D\u0435\u043D\u043E","sitemap-url-count-drop":"\u0417\u043C\u0435\u043D\u0448\u0435\u043D\u043D\u044F URL \u0443 sitemap"},Bu={"page-unreachable":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0430\u0431\u043E \u043F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u043D\u0430 \u043D\u0435\u0457.","http-error":"\u041F\u043E\u0432\u0435\u0440\u043D\u0456\u0442\u044C \u0443\u0441\u043F\u0456\u0448\u043D\u0443 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C \u0430\u0431\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u0435 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F.",noindex:"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C noindex, \u044F\u043A\u0449\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0430\u0454 \u0437\u2019\u044F\u0432\u043B\u044F\u0442\u0438\u0441\u044F \u0432 \u043F\u043E\u0448\u0443\u043A\u0443.","x-robots-noindex":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C noindex \u0456\u0437 X-Robots-Tag, \u044F\u043A\u0449\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0430\u0454 \u0456\u043D\u0434\u0435\u043A\u0441\u0443\u0432\u0430\u0442\u0438\u0441\u044F.","robots-blocked":"\u0414\u043E\u0437\u0432\u043E\u043B\u044C\u0442\u0435 URL \u0443 robots.txt, \u044F\u043A\u0449\u043E \u0439\u043E\u0433\u043E \u043F\u043E\u0442\u0440\u0456\u0431\u043D\u043E \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u0442\u0438.","missing-canonical":"\u0412\u043A\u0430\u0436\u0456\u0442\u044C \u0431\u0430\u0436\u0430\u043D\u0438\u0439 canonical URL, \u044F\u043A\u0449\u043E \u043C\u043E\u0436\u043B\u0438\u0432\u0456 \u0434\u0443\u0431\u043B\u0456\u043A\u0430\u0442\u0438 \u0430\u0434\u0440\u0435\u0441\u0438.","invalid-canonical":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0430\u0431\u0441\u043E\u043B\u044E\u0442\u043D\u0438\u0439 \u0430\u0431\u043E \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 \u0432\u0456\u0434\u043D\u043E\u0441\u043D\u0438\u0439 HTTP(S) canonical URL.","cross-domain-canonical":"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u0437\u043E\u0432\u043D\u0456\u0448\u043D\u0456\u0439 canonical \u0430\u0431\u043E \u0432\u043A\u0430\u0436\u0456\u0442\u044C \u043F\u043E\u0442\u0440\u0456\u0431\u043D\u0438\u0439 URL \u0446\u044C\u043E\u0433\u043E \u0441\u0430\u0439\u0442\u0443.","canonical-target-error":"\u0421\u043F\u0440\u044F\u043C\u0443\u0439\u0442\u0435 canonical \u043D\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439 URL, \u0434\u043E\u0437\u0432\u043E\u043B\u0435\u043D\u0438\u0439 \u0434\u043B\u044F \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457.","redirect-loop":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u0446\u0438\u043A\u043B\u0456\u0447\u043D\u0438\u0439 \u043C\u0430\u0440\u0448\u0440\u0443\u0442 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C.","long-redirect-chain":"\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0439\u0442\u0435 \u043E\u0434\u0440\u0430\u0437\u0443 \u043D\u0430 \u043A\u0456\u043D\u0446\u0435\u0432\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.","sitemap-unavailable":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 \u0456 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439 XML sitemap.","noindex-in-sitemap":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C URL \u0456\u0437 sitemap \u0430\u0431\u043E \u0434\u043E\u0437\u0432\u043E\u043B\u044C\u0442\u0435 \u0439\u043E\u0433\u043E \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u044E.","redirect-in-sitemap":"\u0417\u0430\u043C\u0456\u043D\u0456\u0442\u044C URL \u0443 sitemap \u043D\u0430 \u0439\u043E\u0433\u043E \u043A\u0456\u043D\u0446\u0435\u0432\u0443 canonical-\u0430\u0434\u0440\u0435\u0441\u0443.","missing-title":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0443\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u0438\u0439 \u043E\u043F\u0438\u0441\u043E\u0432\u0438\u0439 HTML title.","duplicate-title":"\u041D\u0430\u043F\u0438\u0448\u0456\u0442\u044C title, \u044F\u043A\u0438\u0439 \u0443\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u043E \u043E\u043F\u0438\u0441\u0443\u0454 \u0446\u044E \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443.","pagination-title-duplicate":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0434\u043E title; \u0437\u0431\u0435\u0440\u0435\u0436\u0456\u0442\u044C \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0456 canonical \u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043F\u0440\u0438\u0447\u0438\u043D\u0443 \u0432\u0438\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044F \u0432 Search Console.","near-duplicate-title":"\u041F\u0435\u0440\u0435\u0433\u043B\u044F\u043D\u044C\u0442\u0435 \u0441\u0445\u043E\u0436\u0456 title \u0442\u0430 \u043D\u0430\u043C\u0456\u0440\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A. \u0421\u0445\u043E\u0436\u0456\u0441\u0442\u044C \u043D\u0435 \u0434\u043E\u0432\u043E\u0434\u0438\u0442\u044C \u0432\u0438\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044F \u0437 \u0456\u043D\u0434\u0435\u043A\u0441\u0443.","title-length":"\u0417\u0440\u043E\u0431\u0456\u0442\u044C title \u0441\u0442\u0438\u0441\u043B\u0438\u043C \u0456 \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0438\u043C, \u0437\u0430\u0437\u0432\u0438\u0447\u0430\u0439 10\u201360 \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432.","missing-description":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0439 meta description.","duplicate-description":"\u041D\u0430\u043F\u0438\u0448\u0456\u0442\u044C \u0443\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u0438\u0439 meta description \u0434\u043B\u044F \u0446\u0456\u0454\u0457 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438.","description-length":"\u0417\u0440\u043E\u0431\u0456\u0442\u044C description \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u043C \u0456 \u0437\u0430\u0437\u0432\u0438\u0447\u0430\u0439 \u0434\u043E\u0432\u0436\u0438\u043D\u043E\u044E 50\u2013160 \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432.","missing-h1":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u043E\u0434\u0438\u043D \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u043B\u0438\u0439 \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A.","broken-internal-link":"\u041E\u043D\u043E\u0432\u0456\u0442\u044C \u0430\u0431\u043E \u043F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u0447\u0438 \u0432\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0439\u043E\u0433\u043E \u0446\u0456\u043B\u044C.","orphan-sitemap-page":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0456 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0456\u0437 sitemap.","crawlable-not-in-sitemap":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0434\u043E sitemap \u0430\u0431\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u043E \u0432\u0438\u043A\u043B\u044E\u0447\u0456\u0442\u044C \u0457\u0457.","invalid-hreflang":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0456 \u043C\u043E\u0432\u043D\u0456 \u0442\u0435\u0433\u0438 \u0442\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 HTTP(S) alternate URL.","malformed-json-ld":"\u0412\u0438\u043F\u0440\u0430\u0432\u0442\u0435 JSON-\u0441\u0438\u043D\u0442\u0430\u043A\u0441\u0438\u0441 \u0443 \u0431\u043B\u043E\u0446\u0456 \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u043E\u0432\u0430\u043D\u0438\u0445 \u0434\u0430\u043D\u0438\u0445.","http-on-https-site":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0439\u0442\u0435 HTTPS \u0434\u043B\u044F \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456\u0445 URL \u0456 metadata.","invalid-language":"\u0412\u043A\u0430\u0436\u0456\u0442\u044C \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 \u043C\u043E\u0432\u043D\u0438\u0439 \u0442\u0435\u0433 BCP 47 \u0432 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456 html.","duplicate-content":"\u041E\u0431\u2019\u0454\u0434\u043D\u0430\u0439\u0442\u0435 \u0434\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0430\u0431\u043E \u0437\u0440\u043E\u0431\u0456\u0442\u044C \u0457\u0445\u043D\u0456\u0439 \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442 \u0432\u0456\u0434\u043C\u0456\u043D\u043D\u0438\u043C.","multiple-h1":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435, \u0447\u0438 \u043E\u0434\u0438\u043D \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 H1 \u043D\u0435 \u0437\u0440\u043E\u0431\u0438\u0442\u044C \u0456\u0454\u0440\u0430\u0440\u0445\u0456\u044E \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u043B\u0456\u0448\u043E\u044E.","missing-open-graph":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 Open Graph title, description \u0442\u0430 image \u0434\u043B\u044F \u043F\u043E\u0448\u0438\u0440\u0435\u043D\u043D\u044F \u0432 \u0441\u043E\u0446\u043C\u0435\u0440\u0435\u0436\u0430\u0445.","missing-twitter-metadata":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 Twitter card metadata, \u044F\u043A\u0449\u043E \u0432\u0430\u0436\u043B\u0438\u0432\u0456 \u0441\u043E\u0446\u0456\u0430\u043B\u044C\u043D\u0456 \u043F\u0440\u0435\u0432\u2019\u044E.","image-missing-alt":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0438\u0439 alt \u0430\u0431\u043E \u043F\u043E\u0440\u043E\u0436\u043D\u0456\u0439 alt \u0434\u043B\u044F \u0434\u0435\u043A\u043E\u0440\u0430\u0442\u0438\u0432\u043D\u0438\u0445 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u044C.","low-word-count":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435, \u0447\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u043E\u0441\u0442\u0430\u0442\u043D\u044C\u043E \u043A\u043E\u0440\u0438\u0441\u043D\u043E\u0433\u043E \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0433\u043E \u043A\u043E\u043D\u0442\u0435\u043D\u0442\u0443.","robots-changed":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u0437\u043C\u0456\u043D\u0443 robots.txt \u0456 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u0434\u043E\u0441\u0442\u0443\u043F \u0434\u043B\u044F \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u043D\u044F \u0437\u043C\u0456\u043D\u0435\u043D\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u043E.","page-missing":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0434\u043E \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438 \u0430\u0431\u043E \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u0457\u0457 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u043E.","status-regression":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044E \u0443\u0441\u043F\u0456\u0448\u043D\u0443 HTTP-\u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C.","new-noindex":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043D\u043E\u0432\u0438\u0439 noindex, \u044F\u043A\u0449\u043E \u0439\u043E\u0433\u043E \u043D\u0435 \u0434\u043E\u0434\u0430\u043D\u043E \u043D\u0430\u0432\u043C\u0438\u0441\u043D\u043E.","title-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0438\u0439 title.","title-changed":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u0437\u043C\u0456\u043D\u0435\u043D\u0438\u0439 title.","description-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0439 meta description.","canonical-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C canonical.","canonical-changed":"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u043D\u043E\u0432\u0430 \u0446\u0456\u043B\u044C canonical \u0441\u0432\u0456\u0434\u043E\u043C\u0430 \u0439 \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0430.","h1-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u043B\u0438\u0439 \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A.","redirect-changed":"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u043D\u043E\u0432\u0430 \u0446\u0456\u043B\u044C \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0441\u0432\u0456\u0434\u043E\u043C\u0430.","sitemap-url-count-drop":"\u0414\u043E\u0441\u043B\u0456\u0434\u0456\u0442\u044C \u0432\u0442\u0440\u0430\u0442\u0443 URL \u0443 sitemap \u0456 \u043F\u043E\u0432\u0435\u0440\u043D\u0456\u0442\u044C \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0434\u043B\u044F \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457."};function Pu(e){return e.evidence?.actual??e.after}function Mu(e,t){let r=Pu(e);switch(t){case"page-unreachable":case"redirect-loop":return`\u0417\u0430\u043F\u0438\u0442 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0432\u0441\u044F \u043F\u043E\u043C\u0438\u043B\u043A\u043E\u044E: ${String(r??"\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u0430 \u043F\u043E\u043C\u0438\u043B\u043A\u0430")}`;case"http-error":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043F\u043E\u0432\u0435\u0440\u043D\u0443\u043B\u0430 HTTP ${String(r??"\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u043E")}`;case"noindex":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u0438\u0440\u0435\u043A\u0442\u0438\u0432\u0443 noindex \u0443 meta";case"x-robots-noindex":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C noindex \u0443 X-Robots-Tag";case"robots-blocked":return e.before===!1?"\u0422\u0435\u043F\u0435\u0440 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0437\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E \u0447\u0435\u0440\u0435\u0437 robots.txt":"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0437\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E \u0447\u0435\u0440\u0435\u0437 robots.txt";case"missing-canonical":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0456\u0441\u0442\u0438\u0442\u044C canonical URL";case"invalid-canonical":return"Canonical URL \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439";case"cross-domain-canonical":return"Canonical \u0432\u043A\u0430\u0437\u0443\u0454 \u043D\u0430 \u0456\u043D\u0448\u0438\u0439 \u0434\u043E\u043C\u0435\u043D";case"canonical-target-error":return"\u0426\u0456\u043B\u044C canonical \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430";case"long-redirect-chain":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454 ${String(r??0)} \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C`;case"sitemap-unavailable":return"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u043D\u0430\u043B\u0430\u0448\u0442\u043E\u0432\u0430\u043D\u0438\u0439 sitemap";case"noindex-in-sitemap":return"URL \u0456\u0437 sitemap \u043F\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 noindex";case"redirect-in-sitemap":return"URL \u0456\u0437 sitemap \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0454\u0442\u044C\u0441\u044F";case"missing-title":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0430\u0454 title";case"pagination-title-duplicate":return"\u041A\u0440\u0438\u0442\u0438\u0447\u043D\u0435 \u0434\u0443\u0431\u043B\u044E\u0432\u0430\u043D\u043D\u044F title \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u043F\u0430\u0433\u0456\u043D\u0430\u0446\u0456\u0457";case"near-duplicate-title":return"Title \u0434\u0443\u0436\u0435 \u0441\u0445\u043E\u0436\u0438\u0439 \u043D\u0430 \u0456\u043D\u0448\u0443 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0443 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443";case"duplicate-title":return"\u041A\u0456\u043B\u044C\u043A\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u043C\u0430\u044E\u0442\u044C \u043E\u0434\u043D\u0430\u043A\u043E\u0432\u0438\u0439 title";case"title-length":return`\u0414\u043E\u0432\u0436\u0438\u043D\u0430 title \u2014 ${String(r??0)} \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432`;case"missing-description":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0430\u0454 meta description";case"duplicate-description":return"\u041A\u0456\u043B\u044C\u043A\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u043C\u0430\u044E\u0442\u044C \u043E\u0434\u043D\u0430\u043A\u043E\u0432\u0438\u0439 meta description";case"description-length":return`\u0414\u043E\u0432\u0436\u0438\u043D\u0430 description \u2014 ${String(r??0)} \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432`;case"missing-h1":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430 H1";case"multiple-h1":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C H1 \u0443 \u043A\u0456\u043B\u044C\u043A\u043E\u0441\u0442\u0456: ${String(r??0)}`;case"broken-internal-link":return"\u0412\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u0432\u0435\u0434\u0435 \u043D\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0443 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443";case"orphan-sitemap-page":return"\u041D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0456\u0437 sitemap \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456\u0445 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u044C";case"crawlable-not-in-sitemap":return"\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u0434\u043B\u044F \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u043D\u044F \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u044F \u0443 sitemap";case"invalid-hreflang":return"\u041E\u0433\u043E\u043B\u043E\u0448\u0435\u043D\u043D\u044F hreflang \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0435";case"malformed-json-ld":return"\u0411\u043B\u043E\u043A JSON-LD \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 JSON";case"http-on-https-site":return"HTTPS-\u0441\u0430\u0439\u0442 \u043F\u043E\u0441\u0438\u043B\u0430\u0454\u0442\u044C\u0441\u044F \u043D\u0430 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456\u0439 HTTP URL";case"invalid-language":return"\u041E\u0433\u043E\u043B\u043E\u0448\u0435\u043D\u043D\u044F \u043C\u043E\u0432\u0438 HTML \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0435";case"duplicate-content":return"\u041E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u0442\u0435\u043A\u0441\u0442 \u0454 \u0442\u043E\u0447\u043D\u0438\u043C \u0434\u0443\u0431\u043B\u0435\u043C \u0456\u043D\u0448\u043E\u0457 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438";case"missing-open-graph":return"Open Graph metadata \u043D\u0435\u043F\u043E\u0432\u043D\u0456";case"missing-twitter-metadata":return"Twitter card metadata \u043D\u0435\u043F\u043E\u0432\u043D\u0456";case"image-missing-alt":return`${Array.isArray(r)?r.length:String(r??0)} \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u044C \u043D\u0435 \u043C\u0430\u044E\u0442\u044C \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 alt`;case"low-word-count":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u043F\u0440\u0438\u0431\u043B\u0438\u0437\u043D\u043E ${String(r??0)} \u0432\u0438\u0434\u0438\u043C\u0438\u0445 \u0441\u043B\u0456\u0432`;case"robots-changed":return"\u0412\u043C\u0456\u0441\u0442 robots.txt \u0437\u043C\u0456\u043D\u0438\u0432\u0441\u044F";case"page-missing":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u043D\u0435 \u0431\u0443\u043B\u043E \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E";case"status-regression":return`HTTP-\u0441\u0442\u0430\u0442\u0443\u0441 \u043F\u043E\u0433\u0456\u0440\u0448\u0438\u0432\u0441\u044F \u0437 ${String(e.before??"\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u043E")} \u0434\u043E ${String(e.after??"\u0432\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439")}`;case"new-noindex":return"\u0422\u0435\u043F\u0435\u0440 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u0438\u0440\u0435\u043A\u0442\u0438\u0432\u0443 noindex";case"title-removed":return"Title \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"title-changed":return"Title \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0437\u043C\u0456\u043D\u0435\u043D\u043E";case"description-removed":return"Meta description \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"canonical-removed":return"Canonical URL \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"canonical-changed":return"Canonical URL \u0437\u043C\u0456\u043D\u0435\u043D\u043E";case"h1-removed":return"\u0423\u0441\u0456 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 H1 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"redirect-changed":return"\u041A\u0456\u043D\u0446\u0435\u0432\u0438\u0439 URL \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0437\u043C\u0456\u043D\u0435\u043D\u043E";case"sitemap-url-count-drop":return`\u041A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C URL \u0443 sitemap \u0437\u043C\u0435\u043D\u0448\u0438\u043B\u0430\u0441\u044F \u043D\u0430 ${String((Number(e.before)||0)-(Number(e.after)||0))}`;default:return e.message??"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443 \u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u0443 \u043F\u043E\u0432\u0435\u0434\u0456\u043D\u043A\u0443."}}function zi(e,t){let r=e.remediation??"Review the finding and confirm the intended behavior.";return{en:{rule:Zi(t),message:e.message??"",remediation:r},uk:{rule:Du[t]??Zi(t),message:Mu(e,t),remediation:Bu[t]??"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443 \u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u0443 \u043F\u043E\u0432\u0435\u0434\u0456\u043D\u043A\u0443."}}}var qi={en:{language:"Language",titles:{partial:"Partial SEO scan report",check:"SEO regression report",scan:"SEO baseline audit"},generated:"Generated",engine:"Engine",rules:"Rules",issueLifecycle:"Issue lifecycle",partialTitle:"Partial results.",partialMessage:"This report contains the pages saved so far. Run the same scan command again to resume without requesting them twice.",incompleteTitle:"Incomplete comparison.",incompleteMessage:"Regressions found on checked pages are shown, but unchecked pages are not marked missing or resolved.",previewTitle:"Preview deployment comparison.",production:"Production",preview:"Preview",cards:{pages:"Pages checked",error:"Errors",warning:"Warnings",info:"Info",affected:"Affected pages"},analytics:{title:"Issue statistics",hint:"Select a chart item to filter the issue table.",severity:"By severity",topRules:"Most frequent checks",owners:"By owner",lifecycle:"By lifecycle",templates:"Affected page templates",total:"Total issues",noData:"No issues to chart.",filterBy:"Filter by"},history:{title:"Local scan history",hint:"Issue trends from snapshots stored on this device.",chartLabel:"Issue trend across runs.",runs:"Runs",pages:"Latest pages",newIssues:"New issues",resolvedIssues:"Resolved issues",sitemapUrls:"Sitemap URLs",maxDepth:"Maximum crawl depth"},tabs:{current:"Current / all",new:"New",ongoing:"Ongoing",resolved:"Resolved",unchanged:"Unchanged"},filters:{search:"URL or text",searchPlaceholder:"URL, check, or message",severity:"Severity",rule:"Check",template:"Page template",owner:"Owner",rows:"Rows"},all:{severity:"All severities",rule:"All checks",template:"All templates",owner:"All owners"},severities:{error:"Error",warning:"Warning",info:"Info"},owners:{seo:"SEO",content:"Content",developer:"Developer"},rows:{100:"100 per page",250:"250 per page",500:"500 per page"},guide:{error:"Errors",errorText:"need attention first.",warning:"Warnings",warningText:"are important improvements.",info:"Info",infoText:"is useful context.",score:"No opaque SEO score is used."},exportCsv:"Export CSV",previous:"Previous",next:"Next",table:{severity:"Severity",lifecycle:"Lifecycle",ruleOwner:"Check / owner",page:"Page",finding:"What was found",change:"Change",before:"Before",evidence:"Evidence / after",remediation:"Remediation",fingerprint:"Fingerprint"},empty:{cleanTitle:"No SEO issues found",cleanMessage:"The scanned pages passed all current checks.",filteredTitle:"No matching issues",filteredMessage:"Try a different lifecycle tab or clear the selected filters.",clear:"Clear filters"},lifecycle:{current:"Current",new:"New",ongoing:"Ongoing",resolved:"Resolved",unchanged:"Unchanged"},notPresent:"Not present",page:"Page",of:"of",issue:"issue",issues:"issues",docs:"docs",footer:"Generated locally. No report data was uploaded."},uk:{language:"\u041C\u043E\u0432\u0430",titles:{partial:"\u0417\u0432\u0456\u0442 \u0447\u0430\u0441\u0442\u043A\u043E\u0432\u043E\u0433\u043E SEO-\u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u043D\u044F",check:"\u0417\u0432\u0456\u0442 \u043F\u0440\u043E SEO-\u0440\u0435\u0433\u0440\u0435\u0441\u0456\u0457",scan:"\u0411\u0430\u0437\u043E\u0432\u0438\u0439 SEO-\u0430\u0443\u0434\u0438\u0442"},generated:"\u0421\u0442\u0432\u043E\u0440\u0435\u043D\u043E",engine:"\u0420\u0443\u0448\u0456\u0439",rules:"\u041F\u0440\u0430\u0432\u0438\u043B\u0430",issueLifecycle:"\u0421\u0442\u0430\u043D\u0438 \u043F\u0440\u043E\u0431\u043B\u0435\u043C",partialTitle:"\u0427\u0430\u0441\u0442\u043A\u043E\u0432\u0456 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0438.",partialMessage:"\u0417\u0432\u0456\u0442 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0443\u0436\u0435 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438. \u0417\u0430\u043F\u0443\u0441\u0442\u0456\u0442\u044C \u0442\u0443 \u0441\u0430\u043C\u0443 \u043A\u043E\u043C\u0430\u043D\u0434\u0443 \u0449\u0435 \u0440\u0430\u0437, \u0449\u043E\u0431 \u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438 \u0431\u0435\u0437 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u0438\u0445 \u0437\u0430\u043F\u0438\u0442\u0456\u0432.",incompleteTitle:"\u041D\u0435\u043F\u043E\u0432\u043D\u0435 \u043F\u043E\u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F.",incompleteMessage:"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0440\u0435\u0433\u0440\u0435\u0441\u0456\u0457 \u043D\u0430 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0438\u0445 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430\u0445, \u0430\u043B\u0435 \u043D\u0435\u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u043D\u0435 \u043F\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u043E \u044F\u043A \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u0456 \u0447\u0438 \u0432\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0456.",previewTitle:"\u041F\u043E\u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F production \u0456 preview.",production:"Production",preview:"Preview",cards:{pages:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A",error:"\u041F\u043E\u043C\u0438\u043B\u043A\u0438",warning:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u0436\u0435\u043D\u043D\u044F",info:"\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F",affected:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0437 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430\u043C\u0438"},analytics:{title:"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C",hint:"\u041E\u0431\u0435\u0440\u0456\u0442\u044C \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0433\u0440\u0430\u0444\u0456\u043A\u0430, \u0449\u043E\u0431 \u0432\u0456\u0434\u0444\u0456\u043B\u044C\u0442\u0440\u0443\u0432\u0430\u0442\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044E \u043F\u0440\u043E\u0431\u043B\u0435\u043C.",severity:"\u0417\u0430 \u0432\u0430\u0436\u043B\u0438\u0432\u0456\u0441\u0442\u044E",topRules:"\u041D\u0430\u0439\u0447\u0430\u0441\u0442\u0456\u0448\u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438",owners:"\u0417\u0430 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0438\u043C\u0438",lifecycle:"\u0417\u0430 \u0441\u0442\u0430\u043D\u043E\u043C",templates:"\u0428\u0430\u0431\u043B\u043E\u043D\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0456\u0437 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430\u043C\u0438",total:"\u0423\u0441\u044C\u043E\u0433\u043E \u043F\u0440\u043E\u0431\u043B\u0435\u043C",noData:"\u041D\u0435\u043C\u0430\u0454 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0434\u043B\u044F \u0432\u0456\u0434\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F.",filterBy:"\u0424\u0456\u043B\u044C\u0442\u0440\u0443\u0432\u0430\u0442\u0438 \u0437\u0430"},history:{title:"\u041B\u043E\u043A\u0430\u043B\u044C\u043D\u0430 \u0456\u0441\u0442\u043E\u0440\u0456\u044F \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u044C",hint:"\u0414\u0438\u043D\u0430\u043C\u0456\u043A\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0437\u0456 snapshot-\u0444\u0430\u0439\u043B\u0456\u0432, \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u0438\u0445 \u043D\u0430 \u0446\u044C\u043E\u043C\u0443 \u043F\u0440\u0438\u0441\u0442\u0440\u043E\u0457.",chartLabel:"\u0414\u0438\u043D\u0430\u043C\u0456\u043A\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0437\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u043C\u0438.",runs:"\u0417\u0430\u043F\u0443\u0441\u043A\u0438",pages:"\u0421\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0432\u043E\u0441\u0442\u0430\u043D\u043D\u0454",newIssues:"\u041D\u043E\u0432\u0456 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0438",resolvedIssues:"\u0412\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0456 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0438",sitemapUrls:"URL \u0443 sitemap",maxDepth:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430 \u0433\u043B\u0438\u0431\u0438\u043D\u0430"},tabs:{current:"\u041F\u043E\u0442\u043E\u0447\u043D\u0456 / \u0443\u0441\u0456",new:"\u041D\u043E\u0432\u0456",ongoing:"\u0422\u0440\u0438\u0432\u0430\u044E\u0442\u044C",resolved:"\u0412\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0456",unchanged:"\u0411\u0435\u0437 \u0437\u043C\u0456\u043D"},filters:{search:"URL \u0430\u0431\u043E \u0442\u0435\u043A\u0441\u0442",searchPlaceholder:"URL, \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430 \u0430\u0431\u043E \u043F\u043E\u0432\u0456\u0434\u043E\u043C\u043B\u0435\u043D\u043D\u044F",severity:"\u0412\u0430\u0436\u043B\u0438\u0432\u0456\u0441\u0442\u044C",rule:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430",template:"\u0428\u0430\u0431\u043B\u043E\u043D \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438",owner:"\u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0438\u0439",rows:"\u0420\u044F\u0434\u043A\u0438"},all:{severity:"\u0423\u0441\u0456 \u0440\u0456\u0432\u043D\u0456",rule:"\u0423\u0441\u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438",template:"\u0423\u0441\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438",owner:"\u0423\u0441\u0456 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0456"},severities:{error:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430",warning:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u0436\u0435\u043D\u043D\u044F",info:"\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F"},owners:{seo:"SEO",content:"\u041A\u043E\u043D\u0442\u0435\u043D\u0442",developer:"\u0420\u043E\u0437\u0440\u043E\u0431\u043D\u0438\u043A"},rows:{100:"100 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443",250:"250 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443",500:"500 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443"},guide:{error:"\u041F\u043E\u043C\u0438\u043B\u043A\u0438",errorText:"\u043F\u043E\u0442\u0440\u0435\u0431\u0443\u044E\u0442\u044C \u043F\u0435\u0440\u0448\u043E\u0447\u0435\u0440\u0433\u043E\u0432\u043E\u0457 \u0443\u0432\u0430\u0433\u0438.",warning:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u0436\u0435\u043D\u043D\u044F",warningText:"\u043F\u043E\u0437\u043D\u0430\u0447\u0430\u044E\u0442\u044C \u0432\u0430\u0436\u043B\u0438\u0432\u0456 \u043F\u043E\u043A\u0440\u0430\u0449\u0435\u043D\u043D\u044F.",info:"\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F",infoText:"\u0434\u0430\u0454 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442.",score:"\u041D\u0435\u043F\u0440\u043E\u0437\u043E\u0440\u0430 SEO-\u043E\u0446\u0456\u043D\u043A\u0430 \u043D\u0435 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454\u0442\u044C\u0441\u044F."},exportCsv:"\u0415\u043A\u0441\u043F\u043E\u0440\u0442 CSV",previous:"\u041D\u0430\u0437\u0430\u0434",next:"\u0414\u0430\u043B\u0456",table:{severity:"\u0412\u0430\u0436\u043B\u0438\u0432\u0456\u0441\u0442\u044C",lifecycle:"\u0421\u0442\u0430\u043D",ruleOwner:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430 / \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0438\u0439",page:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430",finding:"\u0429\u043E \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E",change:"\u0417\u043C\u0456\u043D\u0430",before:"\u0411\u0443\u043B\u043E",evidence:"\u0414\u043E\u043A\u0430\u0437 / \u0441\u0442\u0430\u043B\u043E",remediation:"\u042F\u043A \u0432\u0438\u043F\u0440\u0430\u0432\u0438\u0442\u0438",fingerprint:"\u0412\u0456\u0434\u0431\u0438\u0442\u043E\u043A"},empty:{cleanTitle:"SEO-\u043F\u0440\u043E\u0431\u043B\u0435\u043C \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E",cleanMessage:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u043F\u0440\u043E\u0439\u0448\u043B\u0438 \u0432\u0441\u0456 \u0430\u043A\u0442\u0438\u0432\u043D\u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438.",filteredTitle:"\u0417\u0431\u0456\u0433\u0456\u0432 \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E",filteredMessage:"\u041E\u0431\u0435\u0440\u0456\u0442\u044C \u0456\u043D\u0448\u0438\u0439 \u0441\u0442\u0430\u043D \u0430\u0431\u043E \u043E\u0447\u0438\u0441\u0442\u044C\u0442\u0435 \u0444\u0456\u043B\u044C\u0442\u0440\u0438.",clear:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u0444\u0456\u043B\u044C\u0442\u0440\u0438"},lifecycle:{current:"\u041F\u043E\u0442\u043E\u0447\u043D\u0430",new:"\u041D\u043E\u0432\u0430",ongoing:"\u0422\u0440\u0438\u0432\u0430\u0454",resolved:"\u0412\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430",unchanged:"\u0411\u0435\u0437 \u0437\u043C\u0456\u043D"},notPresent:"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0454",page:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430",of:"\u0437",issue:"\u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430",issues:"\u043F\u0440\u043E\u0431\u043B\u0435\u043C",docs:"\u0434\u043E\u0432\u0456\u0434\u043A\u0430",footer:"\u0421\u0442\u0432\u043E\u0440\u0435\u043D\u043E \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u043E. \u0414\u0430\u043D\u0456 \u0437\u0432\u0456\u0442\u0443 \u043D\u0456\u043A\u0443\u0434\u0438 \u043D\u0435 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0443\u0432\u0430\u043B\u0438\u0441\u044F."}};function Or(e,t){try{let r=new URL(e,t);return r.protocol!=="http:"&&r.protocol!=="https:"?null:(r.hash="",r.href)}catch{return null}}function ea(e){let t=new Map,r=new Map,n=new Map;for(let s of e){let i=Or(s.url);i&&t.set(i,s),r.set(s.url,{incoming:[],broken:[],redirects:[]})}for(let s of e){let i=r.get(s.url),o=new Set(s.internalLinks.map(d=>Or(d,s.finalUrl??s.url)));for(let d of o){if(!d||d===Or(s.url)||d===Or(s.finalUrl??s.url))continue;let l=t.get(d);if(!l)continue;let c=n.get(l.url)??new Set;c.add(s.url),n.set(l.url,c),!l.blockedByRobots&&(l.error||l.status!==null&&l.status>=400)&&i.broken.push(l.url),(l.redirectChain.length||l.finalUrl&&l.finalUrl!==l.url||l.status!==null&&l.status>=300&&l.status<400)&&i.redirects.push(l.url)}}for(let[s,i]of r)i.incoming=[...n.get(s)??[]].sort(),i.broken.sort(),i.redirects.sort();return r}var We=e=>String(e??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;"),F=(e,t)=>`<span class="locale-en">${We(e)}</span><span class="locale-uk">${We(t)}</span>`;function ta(e,t){let r=[...e].sort((n,s)=>s.counts.new+s.counts.resolved+s.counts.ongoing-(n.counts.new+n.counts.resolved+n.counts.ongoing)||n.id.localeCompare(s.id));return r.slice(0,20).map(n=>`<tr><td><button type="button" data-comparison-${t}="${We(n.id)}">${We(n.id)}</button></td><td>${n.counts.new}</td><td>${n.counts.ongoing}</td><td>${n.counts.resolved}</td><td>${n.affectedPages}</td></tr>`).join("")+(r.length>20?`<tr><td colspan="5">${F(`${r.length-20} more groups in the JSON summary`,`\u0429\u0435 ${r.length-20} \u0433\u0440\u0443\u043F \u0443 JSON-\u0437\u0432\u0435\u0434\u0435\u043D\u043D\u0456`)}</td></tr>`:"")}function ra(e){let t=e.coverage,r=e.warnings.length>0?`<p class="comparison-warning">${F("Comparison warnings","\u0417\u0430\u0441\u0442\u0435\u0440\u0435\u0436\u0435\u043D\u043D\u044F \u043F\u043E\u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F")}: ${We(e.warnings.join(", "))}</p>`:"",n=e.unverified.length>0?`<p class="comparison-warning">${e.unverified.length} ${F("apparent resolutions lack sufficient evidence and are not counted as resolved","\u043F\u043E\u0442\u0435\u043D\u0446\u0456\u0439\u043D\u0438\u0445 \u0432\u0438\u0440\u0456\u0448\u0435\u043D\u044C \u043D\u0435 \u043C\u0430\u044E\u0442\u044C \u0434\u043E\u0441\u0442\u0430\u0442\u043D\u0456\u0445 \u0434\u043E\u043A\u0430\u0437\u0456\u0432 \u0456 \u043D\u0435 \u0432\u0440\u0430\u0445\u043E\u0432\u0430\u043D\u0456 \u044F\u043A \u0432\u0438\u0440\u0456\u0448\u0435\u043D\u0456")}</p>`:"",s=`<thead><tr><th>${F("Group","\u0413\u0440\u0443\u043F\u0430")}</th><th>${F("New","\u041D\u043E\u0432\u0456")}</th><th>${F("Ongoing","\u0422\u0440\u0438\u0432\u0430\u044E\u0442\u044C")}</th><th>${F("Resolved","\u0412\u0438\u0440\u0456\u0448\u0435\u043D\u0456")}</th><th>${F("Pages","\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0438")}</th></tr></thead>`;return`<section id="local-comparison" class="analytics" aria-labelledby="local-comparison-title"><h2 id="local-comparison-title">${F("Local run comparison","\u041F\u043E\u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u0438\u0445 \u0437\u0430\u043F\u0443\u0441\u043A\u0456\u0432")}</h2>
10
+ `);let n=new re("!xml"),s=n,i="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0,this.doctypefound=!1;let o=new It(t.processEntities),d=e.length;for(let l=0;l<d;l++)if(e[l]==="<"){let m=e.charCodeAt(l+1);if(m===47){let A=rt(e,">",l,"Closing Tag is not closed."),h=e.substring(l+2,A).trim();if(t.removeNSPrefix){let b=h.indexOf(":");b!==-1&&(h=h.substr(b+1))}h=bn(t.transformTagName,h,"",t).tagName,s&&(i=this.saveTextToParentTag(i,s,this.readonlyMatcher));let f=this.matcher.getCurrentTag();if(h&&t.unpairedTagsSet.has(h))throw new Error(`Unpaired tag can not be used as closing tag: </${h}>`);f&&t.unpairedTagsSet.has(f)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=this.tagsNodeStack.pop()||n,t.captureMetaData&&s&&s.addEndIndex(He(A+1,r)),i="",l=A}else if(m===63){let A=Cn(e,l,!1,"?>");if(!A)throw new Error("Pi Tag is not closed.");i=this.saveTextToParentTag(i,s,this.readonlyMatcher);let h=this.buildAttributesMap(A.tagExp,this.matcher,A.tagName,!0);if(h){let f=h[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(f)||1),o.setXmlVersion(Number(f)||1)}if(!(t.ignoreDeclaration&&A.tagName==="?xml"||t.ignorePiTags)){let f=new re(A.tagName);f.add(t.textNodeName,""),A.tagName!==A.tagExp&&A.attrExpPresent&&t.ignoreAttributes!==!0&&(f[":@"]=h);let b=t.captureMetaData?He(l,r):l;this.addChild(s,f,this.readonlyMatcher,b),t.captureMetaData&&s.addEndIndex(He(A.closeIndex+2,r))}l=A.closeIndex+1}else if(m===33&&e.charCodeAt(l+2)===45&&e.charCodeAt(l+3)===45){let A=rt(e,"-->",l+4,"Comment is not closed.");if(t.commentPropName){let h=e.substring(l+4,A-2);i=this.saveTextToParentTag(i,s,this.readonlyMatcher),s.add(t.commentPropName,[{[t.textNodeName]:h}])}l=A}else if(m===33&&e.charCodeAt(l+2)===68){if(this.doctypefound)throw new Error("Multiple DOCTYPE declarations found.");this.doctypefound=!0;let A=o.readDocType(e,l);this.entityDecoder.addInputEntities(A.entities),l=A.i}else if(m===33&&e.charCodeAt(l+2)===91){let A=rt(e,"]]>",l,"CDATA is not closed.")-2,h=e.substring(l+9,A);i=this.saveTextToParentTag(i,s,this.readonlyMatcher);let f=this.parseTextData(h,s.tagname,this.readonlyMatcher,!0,!1,!0,!0);f==null&&(f=""),t.cdataPropName?s.add(t.cdataPropName,[{[t.textNodeName]:h}]):s.add(t.textNodeName,f),l=A+2}else{let A=Cn(e,l,t.removeNSPrefix);if(!A){let O=e.substring(Math.max(0,l-50),Math.min(d,l+50));throw new Error(`readTagExp returned undefined at position ${l}. Context: "${O}"`)}let h=A.tagName,f=A.rawTagName,b=A.tagExp,y=A.attrExpPresent,C=A.closeIndex;if({tagName:h,tagExp:b}=bn(t.transformTagName,h,b,t),t.strictReservedNames&&(h===t.commentPropName||h===t.cdataPropName||h===t.textNodeName||h===t.attributesGroupName))throw new Error(`Invalid tag name: ${h}`);s&&i&&s.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,s,this.readonlyMatcher,!1));let R=s;R&&t.unpairedTagsSet.has(R.tagname)&&(s=this.tagsNodeStack.pop(),this.matcher.pop());let S=!1;b.length>0&&b.lastIndexOf("/")===b.length-1&&(S=!0,h[h.length-1]==="/"?(h=h.substr(0,h.length-1),b=h):b=b.substr(0,b.length-1),y=h!==b);let _=null,B={},v;v=Wc(f),h!==n.tagname&&this.matcher.push(h,{},v),h!==b&&y&&(_=this.buildAttributesMap(b,this.matcher,h),_&&(B=Gc(_,t))),h!==n.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let M=t.captureMetaData?He(l,r):l;if(this.isCurrentNodeStopNode){let O="";if(S)l=A.closeIndex;else if(t.unpairedTagsSet.has(h))l=A.closeIndex;else{let D=this.readStopNodeData(e,f,C+1);if(!D)throw new Error(`Unexpected end of ${f}`);l=D.i,O=D.tagContent}let x=new re(h);_&&(x[":@"]=_),x.add(t.textNodeName,O),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(s,x,this.readonlyMatcher,M),t.captureMetaData&&s.addEndIndex(He(l+1,r))}else{if(S){({tagName:h,tagExp:b}=bn(t.transformTagName,h,b,t));let O=new re(h);_&&(O[":@"]=_),this.addChild(s,O,this.readonlyMatcher,M),t.captureMetaData&&s.addEndIndex(He(C+1,r)),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(t.unpairedTagsSet.has(h)){let O=new re(h);_&&(O[":@"]=_),this.addChild(s,O,this.readonlyMatcher,M),t.captureMetaData&&s.addEndIndex(He(A.closeIndex+1,r)),this.matcher.pop(),this.isCurrentNodeStopNode=!1,l=A.closeIndex;continue}else{let O=new re(h);if(this.tagsNodeStack.length>t.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(s),_&&(O[":@"]=_),this.addChild(s,O,this.readonlyMatcher,M),s=O}i="",l=C}}}else i+=e[l];return n.child};function He(e,t){let r=0,n=t.length;for(;r<n;){let s=Math.floor((r+n)/2);t[s]<e?r=s+1:n=s}return e+r}function Zc(e,t,r,n){this.options.captureMetaData||(n=void 0);let s=this.options.jPath?r.toString():r,i=this.options.updateTag(t.tagname,s,t[":@"]);i===!1||(typeof i=="string"&&(t.tagname=i),e.addChild(t,n))}function $c(e,t,r){let n=this.options.processEntities;if(!n||!n.enabled)return e;if(n.allowedTags){let s=this.options.jPath?r.toString():r;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(t):n.allowedTags(t,s)))return e}if(n.tagFilter){let s=this.options.jPath?r.toString():r;if(!n.tagFilter(t,s))return e}return this.entityDecoder.decode(e)}function qc(e,t,r,n){return e&&(n===void 0&&(n=t.child.length===0),e=this.parseTextData(e,t.tagname,r,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,n),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function zc(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function el(e,t,r=">"){let n=e.length,s=r.charCodeAt(0),i=r.length>1?r.charCodeAt(1):-1,o="",d=t;for(let l=t;l<n;l++){let c=e.charCodeAt(l);if(c===34||c===39){if(l=e.indexOf(e[l],l+1),l===-1)return}else if(c===s)if(i!==-1){if(e.charCodeAt(l+1)===i)return o+=e.substring(d,l),{data:o,index:l}}else return o+=e.substring(d,l),{data:o,index:l};else c===9&&(o+=e.substring(d,l)+" ",d=l+1)}}function rt(e,t,r,n){let s=e.indexOf(t,r);if(s===-1)throw new Error(n);return s+t.length-1}function tl(e,t,r,n){let s=e.indexOf(t,r);if(s===-1)throw new Error(n);return s}function Cn(e,t,r,n=">"){let s=el(e,t+1,n);if(!s)return;let i=s.data,o=s.index,d=i.search(/\s/),l=i,c=!0;d!==-1&&(l=i.substring(0,d),i=i.substring(d+1).trimStart());let m=l;if(r){let A=l.indexOf(":");A!==-1&&(l=l.substr(A+1),c=l!==s.data.substr(A+1))}return{tagName:l,tagExp:i,closeIndex:o,attrExpPresent:c,rawTagName:m}}function rl(e,t,r){let n=r,s=1,i=!1,o=-1,d=e.length;for(;r<d;r++)if(e[r]==="<"){let l=e.charCodeAt(r+1);if(l===47){let c=tl(e,">",r,`${t} is not closed`);if(e.substring(r+2,c).trim()===t&&(s--,s===0))return{tagContent:e.substring(n,r),i:c};r=c}else if(l===63)r=rt(e,"?>",r+1,"StopNode is not closed.");else if(l===33&&e.charCodeAt(r+2)===45&&e.charCodeAt(r+3)===45)r=rt(e,"-->",r+3,"StopNode is not closed.");else if(l===33&&e.charCodeAt(r+2)===91)r=rt(e,"]]>",r,"StopNode is not closed.")-2;else{let c=i?void 0:Cn(e,r,!1);if(c)c.tagName===t&&c.tagExp[c.tagExp.length-1]!=="/"&&s++,r=c.closeIndex;else{if(i=!0,o<r&&(o=e.indexOf(">",r),o===-1))return;let m=e.indexOf("<",r+1);if(m===-1||m>o){let A=e.substring(r+1,o),h=A.search(/\s/);(h===-1?A:A.substring(0,h))===t&&A[A.length-1]!=="/"&&s++,r=o}}}}}function In(e,t,r){if(t&&typeof e=="string"){let n=e.trim();return n==="true"?!0:n==="false"?!1:un(e,r)}else return _s(e)?e:""}function bn(e,t,r,n){if(e){let s=e(t);r===t&&(r=s),t=s}return t=Xs(t,n),{tagName:t,tagExp:r}}function Xs(e,t){if(tr.includes(e))throw new Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return ft.includes(e)?t.onDangerousProperty(e):e}var yn=re.getMetaDataSymbol();function nl(e,t){if(!e||typeof e!="object")return{};if(!t)return e;let r={};for(let n in e)if(n.startsWith(t)){let s=n.substring(t.length);r[s]=e[n]}else r[n]=e[n];return r}function wn(e,t,r,n){return Zs(e,t,r,n)}function Zs(e,t,r,n){let s,i={};for(let o=0;o<e.length;o++){let d=e[o],l=sl(d);if(l!==void 0&&l!==t.textNodeName){let c=nl(d[":@"]||{},t.attributeNamePrefix);r.push(l,c)}if(l===t.textNodeName)s===void 0?s=d[l]:s+=""+d[l];else{if(l===void 0)continue;if(d[l]){let c=Zs(d[l],t,r,n),m=al(c,t);if(Object.keys(c).length===0&&t.alwaysCreateTextNode&&(c[t.textNodeName]=""),d[":@"]?il(c,d[":@"],n,t):Object.keys(c).length===1&&c[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?c=c[t.textNodeName]:Object.keys(c).length===0&&(t.alwaysCreateTextNode?c[t.textNodeName]="":c=""),d[yn]!==void 0&&typeof c=="object"&&c!==null&&(c[yn]=d[yn]),i[l]!==void 0&&Object.prototype.hasOwnProperty.call(i,l))Array.isArray(i[l])||(i[l]=[i[l]]),i[l].push(c);else{let A=t.jPath?n.toString():n;t.isArray(l,A,m)?i[l]=[c]:i[l]=c}l!==void 0&&l!==t.textNodeName&&r.pop()}}}return typeof s=="string"?s.length>0&&(i[t.textNodeName]=s):s!==void 0&&(i[t.textNodeName]=s),i}function sl(e){let t=Object.keys(e);for(let r=0;r<t.length;r++){let n=t[r];if(n!==":@")return n}}function il(e,t,r,n){if(t){let s=Object.keys(t),i=s.length;for(let o=0;o<i;o++){let d=s[o],l=d.startsWith(n.attributeNamePrefix)?d.substring(n.attributeNamePrefix.length):d,c=n.jPath?r.toString()+"."+l:r;n.isArray(d,c,!0,!0)?e[d]=[t[d]]:e[d]=t[d]}}}function al(e,t){let{textNodeName:r}=t,n=Object.keys(e).length;return!!(n===0||n===1&&(e[r]||typeof e[r]=="boolean"||e[r]===0))}var nt=class{constructor(t){this.externalEntities={},this.options=Ps(t)}parse(t,r){if(typeof t!="string"&&t.toString)t instanceof Uint8Array&&!(typeof Buffer<"u"&&Buffer.isBuffer(t))?t=new TextDecoder("utf-8",{ignoreBOM:!0}).decode(t):t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(r){r===!0&&(r={});let i=rr(t,r);if(i!==!0)throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`)}let n=new wt(this.options,this.externalEntities),s=n.parseXml(t);return this.options.preserveOrder||s===void 0?s:wn(s,this.options,n.matcher,n.readonlyMatcher)}addEntity(t,r){if(r.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(r==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=r}static getMetaDataSymbol(){return re.getMetaDataSymbol()}};var $s={validate:rr};var ol=/\.(?:avif|bmp|css|csv|docx?|eot|gif|gz|ico|jpe?g|js|json|map|mp3|mp4|mov|ogg|otf|pdf|png|pptx?|rar|rss|svg|tar|tiff?|ttf|txt|wav|webm|webp|woff2?|xlsx?|xml|zip)$/i;function G(e,t,{includeQuery:r=!1}={}){let n;try{n=t?new URL(e,t):new URL(e)}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:(n.hash="",r||(n.search=""),n.pathname.length>1&&n.pathname.endsWith("/")&&(n.pathname=n.pathname.replace(/\/+$/,"")),n.href)}function ue(e,t){try{return new URL(e).origin===t}catch{return!1}}function lr(e){try{let t=new URL(e);return!ol.test(t.pathname)}catch{return!1}}var xn=10*1024*1024,qs=100,ll=5e4,dl=new nt({ignoreAttributes:!1,removeNSPrefix:!0,trimValues:!0});function dr(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function zs(e){return(e===void 0?[]:Array.isArray(e)?e:[e]).flatMap(r=>{let n=dr(r)?.loc;return typeof n=="string"?[n]:[]})}function ul(e,t,r){let s=t.toLowerCase().endsWith(".gz")||r.includes("gzip")||e[0]===31&&e[1]===139?cl(e):e;if(s.byteLength>xn)throw new Error(`sitemap exceeds ${xn} bytes after decompression: ${t}`);return s.toString("utf8").replace(/^\uFEFF/,"")}function ei(e,t){let r=$s.validate(e);if(r!==!0)throw new Error(`invalid sitemap XML at ${t}: ${r.err.msg}`);let n=dr(dl.parse(e)),s=dr(n?.sitemapindex);if(s)return{kind:"index",locations:zs(s.sitemap)};let i=dr(n?.urlset);if(i)return{kind:"urlset",locations:zs(i.url)};throw new Error(`XML is not a sitemap urlset or sitemapindex: ${t}`)}function ti(e){return{fetch:e.fetch??globalThis.fetch,timeout:e.timeout,maxRedirects:e.maxRedirects??10,retries:e.retries??2,signal:e.signal,gate:e.requestGate?async t=>e.requestGate?.(t):void 0,onEvent:e.onEvent}}async function ri(e,t){let{response:r}=await Oe(e,{headers:{accept:"application/xml,text/xml,application/gzip,text/plain;q=0.9,*/*;q=0.1","user-agent":t.userAgent}},ti(t));if(!r.ok)throw await r.body?.cancel(),new Error(`sitemap returned HTTP ${r.status}: ${e}`);let{buffer:n}=await De(r,xn);return ul(n,e,r.headers.get("content-type")?.toLowerCase()??"")}async function Al(e,t){try{let r=await ri(e,t);return ei(r,e),!0}catch{return!1}}async function ni(e,t){let r=G(e,void 0);if(!r)throw new Error(`invalid start URL: ${e}`);let n=new URL(r).origin,s=new URL("/robots.txt",n).href;try{if(t.robotsBody!==void 0)for(let i of t.robotsBody.matchAll(/^sitemap:\s*(\S+)\s*$/gim)){let o=i[1];if(!o)continue;let d=G(o,s,{includeQuery:!0});if(d&&ue(d,n))return d}else{let{response:i}=await Oe(s,{headers:{accept:"text/plain,*/*;q=0.1","user-agent":t.userAgent}},ti({...t,siteOrigin:n}));if(i.ok){let{text:o}=await De(i,524288);for(let d of o.matchAll(/^sitemap:\s*(\S+)\s*$/gim)){let l=d[1];if(!l)continue;let c=G(l,s,{includeQuery:!0});if(c&&ue(c,n))return c}}else await i.body?.cancel()}}catch{}for(let i of["/sitemap.xml","/sitemap.xml.gz","/sitemap_index.xml"]){let o=new URL(i,n).href;if(await Al(o,{...t,siteOrigin:n}))return o}return null}async function ur(e,t){let r=G(e,void 0,{includeQuery:!0});if(!r)throw new Error(`invalid sitemap URL: ${e}`);let n=new URL(r).origin,s=[r],i=new Set,o=[],d=new Set,l=t.maxUrls??ll,c=!1;for(;s.length>0&&i.size<qs&&o.length<l;){let m=s.shift();if(i.has(m))continue;i.add(m);let A=ei(await ri(m,t),m);if(A.kind==="index"){for(let h of A.locations){let f=G(h,m,{includeQuery:!0});f&&ue(f,n)&&!i.has(f)&&!s.includes(f)&&s.push(f)}s.sort();continue}for(let h of A.locations){let f=G(h,m,{includeQuery:t.includeQuery??!1});if(!(!f||d.has(f)||!ue(f,t.siteOrigin)||!lr(f))&&(d.add(f),o.push(f),o.length>=l)){c=!0;break}}}return(s.length>0||i.size>=qs)&&(c=!0),{url:r,urls:o.sort(),sitemapCount:i.size,truncated:c,error:null}}async function Sn(e,t){await e.onEvent?.(t)}async function Ae(e,t={}){let r=be(e),n=G(r.url,void 0,{includeQuery:r.includeQuery});if(!n)throw new Error(`invalid start URL: ${r.url}`);let s=new URL(n).origin,i=t.fetch??globalThis.fetch,o=Xe(r.delay),d=t.logger??zt;await Sn(t,{type:"plan-start",url:n});let l=await er(n,{userAgent:_e,timeout:r.timeout,maxRedirects:r.maxRedirects,retries:2,fetch:i,signal:t.signal,requestGate:o,onEvent:t.onEvent,logger:d});await Sn(t,{type:"robots",robots:l});let c=null;r.sitemap==="auto"?c=await ni(n,{timeout:r.timeout,maxRedirects:r.maxRedirects,userAgent:_e,fetch:i,signal:t.signal,requestGate:o,onEvent:t.onEvent,robotsBody:l.body}):r.sitemap!=="none"&&(c=r.sitemap);let m=null;if(c)try{m=await ur(c,{siteOrigin:s,includeQuery:r.includeQuery,maxUrls:5e4,timeout:r.timeout,maxRedirects:r.maxRedirects,retries:2,userAgent:_e,fetch:i,signal:t.signal,requestGate:o,onEvent:t.onEvent})}catch(f){m={url:c,urls:[],sitemapCount:0,truncated:!1,error:f instanceof Error?f.message:String(f)},d.warn(`Could not load sitemap ${c}: ${m.error}`)}let A=m?[...new Set([n,...m.urls])].sort((f,b)=>f===n?-1:b===n?1:f.localeCompare(b)):[n],h=m?A.length:null;return await Sn(t,{type:"sitemap",sitemap:m,candidateCount:h}),{planVersion:1,config:r,startUrl:n,origin:s,userAgent:_e,robots:l,sitemap:m,candidateUrls:A,candidateCount:h,mode:m?"sitemap":"links"}}import{createHash as Xi}from"node:crypto";var pl=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),U="\uFFFD",u;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(u||(u={}));var q={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Ar(e){return e>=55296&&e<=57343}function si(e){return e>=56320&&e<=57343}function ii(e,t){return(e-55296)*1024+9216+t}function pr(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function hr(e){return e>=64976&&e<=65007||pl.has(e)}var T;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(T||(T={}));var gl=65536,gr=class{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=gl,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,r){let{line:n,col:s,offset:i}=this,o=s+r,d=i+r;return{code:t,startLine:n,endLine:n,startCol:o,endCol:o,startOffset:d,endOffset:d}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){let r=this.html.charCodeAt(this.pos+1);if(si(r))return this.pos++,this._addGap(),ii(t,r)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,u.EOF;return this._err(T.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,r){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=r}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,r){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(r)return this.html.startsWith(t,this.pos);for(let n=0;n<t.length;n++)if((this.html.charCodeAt(this.pos+n)|32)!==t.charCodeAt(n))return!1;return!0}peek(t){let r=this.pos+t;if(r>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,u.EOF;let n=this.html.charCodeAt(r);return n===u.CARRIAGE_RETURN?u.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,u.EOF;let t=this.html.charCodeAt(this.pos);return t===u.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,u.LINE_FEED):t===u.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Ar(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===u.LINE_FEED||t===u.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){pr(t)?this._err(T.controlCharacterInInputStream):hr(t)&&this._err(T.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}};var k;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(k||(k={}));function mr(e,t){for(let r=e.attrs.length-1;r>=0;r--)if(e.attrs[r].name===t)return e.attrs[r].value;return null}var fl=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function ai(e){return e>=55296&&e<=57343||e>1114111?65533:fl.get(e)??e}function oi(e){let t=atob(e),r=t.length&-2,n=new Uint16Array(r/2);for(let s=0,i=0;s<r;s+=2){let o=t.charCodeAt(s),d=t.charCodeAt(s+1);n[i++]=o|d<<8}return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WV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");var j;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(j||(j={}));var Q;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Q||(Q={}));var ci=32;function Rn(e){return e>=Q.ZERO&&e<=Q.NINE}function El(e){return e>=Q.UPPER_A&&e<=Q.UPPER_F||e>=Q.LOWER_A&&e<=Q.LOWER_F}function Tl(e){return e>=Q.UPPER_A&&e<=Q.UPPER_Z||e>=Q.LOWER_A&&e<=Q.LOWER_Z||Rn(e)}function bl(e){return e===Q.EQUALS||Tl(e)}var K;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(K||(K={}));var Te;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Te||(Te={}));var fr=class{decodeTree;emitCodePoint;errors;constructor(t,r,n){this.decodeTree=t,this.emitCodePoint=r,this.errors=n}state=K.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=Te.Strict;runConsumed=0;startEntity(t){this.decodeMode=t,this.state=K.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(t,r){switch(this.state){case K.EntityStart:return t.charCodeAt(r)===Q.NUM?(this.state=K.NumericStart,this.consumed+=1,this.stateNumericStart(t,r+1)):(this.state=K.NamedEntity,this.stateNamedEntity(t,r));case K.NumericStart:return this.stateNumericStart(t,r);case K.NumericDecimal:return this.stateNumericDecimal(t,r);case K.NumericHex:return this.stateNumericHex(t,r);case K.NamedEntity:return this.stateNamedEntity(t,r)}}stateNumericStart(t,r){return r>=t.length?-1:(t.charCodeAt(r)|ci)===Q.LOWER_X?(this.state=K.NumericHex,this.consumed+=1,this.stateNumericHex(t,r+1)):(this.state=K.NumericDecimal,this.stateNumericDecimal(t,r))}stateNumericHex(t,r){for(;r<t.length;){let n=t.charCodeAt(r);if(Rn(n)||El(n)){let s=n<=Q.NINE?n-Q.ZERO:(n|ci)-Q.LOWER_A+10;this.result=this.result*16+s,this.consumed++,r++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(t,r){for(;r<t.length;){let n=t.charCodeAt(r);if(Rn(n))this.result=this.result*10+(n-Q.ZERO),this.consumed++,r++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(t,r){if(this.consumed<=r)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Q.SEMI)this.consumed+=1;else if(this.decodeMode===Te.Strict)return 0;return this.emitCodePoint(ai(this.result),this.consumed),this.errors&&(t!==Q.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,r){let{decodeTree:n}=this,s=n[this.treeIndex],i=(s&j.VALUE_LENGTH)>>14;for(;r<t.length;){if(i===0&&(s&j.FLAG13)!==0){let d=(s&j.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let l=s&j.JUMP_TABLE;if(t.charCodeAt(r)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();r++,this.excess++,this.runConsumed++}for(;this.runConsumed<d;){if(r>=t.length)return-1;let l=this.runConsumed-1,c=n[this.treeIndex+1+(l>>1)],m=l%2===0?c&255:c>>8&255;if(t.charCodeAt(r)!==m)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();r++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(d>>1),s=n[this.treeIndex],i=(s&j.VALUE_LENGTH)>>14}if(r>=t.length)break;let o=t.charCodeAt(r);if(o===Q.SEMI&&i!==0&&(s&j.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);if(this.treeIndex=Cl(n,s,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return this.result===0||this.decodeMode===Te.Attribute&&(i===0||bl(o))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],i=(s&j.VALUE_LENGTH)>>14,i!==0){if(o===Q.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Te.Strict&&(s&j.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}r++,this.excess++}return-1}emitNotTerminatedNamedEntity(){let{result:t,decodeTree:r}=this,n=(r[t]&j.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,r,n){let{decodeTree:s}=this;return this.emitCodePoint(r===1?s[t]&~(j.VALUE_LENGTH|j.FLAG13):s[t+1],n),r===3&&this.emitCodePoint(s[t+2],n),n}end(){switch(this.state){case K.NamedEntity:return this.result!==0&&(this.decodeMode!==Te.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case K.NumericDecimal:return this.emitNumericEntity(0,2);case K.NumericHex:return this.emitNumericEntity(0,3);case K.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case K.EntityStart:return 0}}};function Cl(e,t,r,n){let s=(t&j.BRANCH_LENGTH)>>7,i=t&j.JUMP_TABLE;if(s===0)return i!==0&&n===i?r:-1;if(i){let c=n-i;return c<0||c>=s?-1:e[r+c]-1}let o=s+1>>1,d=0,l=s-1;for(;d<=l;){let c=d+l>>>1,m=c>>1,h=e[r+m]>>(c&1)*8&255;if(h<n)d=c+1;else if(h>n)l=c-1;else return e[r+o+c]}return-1}var I;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(I||(I={}));var Ce;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Ce||(Ce={}));var z;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(z||(z={}));var E;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(E||(E={}));var a;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(a||(a={}));var Il=new Map([[E.A,a.A],[E.ADDRESS,a.ADDRESS],[E.ANNOTATION_XML,a.ANNOTATION_XML],[E.APPLET,a.APPLET],[E.AREA,a.AREA],[E.ARTICLE,a.ARTICLE],[E.ASIDE,a.ASIDE],[E.B,a.B],[E.BASE,a.BASE],[E.BASEFONT,a.BASEFONT],[E.BGSOUND,a.BGSOUND],[E.BIG,a.BIG],[E.BLOCKQUOTE,a.BLOCKQUOTE],[E.BODY,a.BODY],[E.BR,a.BR],[E.BUTTON,a.BUTTON],[E.CAPTION,a.CAPTION],[E.CENTER,a.CENTER],[E.CODE,a.CODE],[E.COL,a.COL],[E.COLGROUP,a.COLGROUP],[E.DD,a.DD],[E.DESC,a.DESC],[E.DETAILS,a.DETAILS],[E.DIALOG,a.DIALOG],[E.DIR,a.DIR],[E.DIV,a.DIV],[E.DL,a.DL],[E.DT,a.DT],[E.EM,a.EM],[E.EMBED,a.EMBED],[E.FIELDSET,a.FIELDSET],[E.FIGCAPTION,a.FIGCAPTION],[E.FIGURE,a.FIGURE],[E.FONT,a.FONT],[E.FOOTER,a.FOOTER],[E.FOREIGN_OBJECT,a.FOREIGN_OBJECT],[E.FORM,a.FORM],[E.FRAME,a.FRAME],[E.FRAMESET,a.FRAMESET],[E.H1,a.H1],[E.H2,a.H2],[E.H3,a.H3],[E.H4,a.H4],[E.H5,a.H5],[E.H6,a.H6],[E.HEAD,a.HEAD],[E.HEADER,a.HEADER],[E.HGROUP,a.HGROUP],[E.HR,a.HR],[E.HTML,a.HTML],[E.I,a.I],[E.IMG,a.IMG],[E.IMAGE,a.IMAGE],[E.INPUT,a.INPUT],[E.IFRAME,a.IFRAME],[E.KEYGEN,a.KEYGEN],[E.LABEL,a.LABEL],[E.LI,a.LI],[E.LINK,a.LINK],[E.LISTING,a.LISTING],[E.MAIN,a.MAIN],[E.MALIGNMARK,a.MALIGNMARK],[E.MARQUEE,a.MARQUEE],[E.MATH,a.MATH],[E.MENU,a.MENU],[E.META,a.META],[E.MGLYPH,a.MGLYPH],[E.MI,a.MI],[E.MO,a.MO],[E.MN,a.MN],[E.MS,a.MS],[E.MTEXT,a.MTEXT],[E.NAV,a.NAV],[E.NOBR,a.NOBR],[E.NOFRAMES,a.NOFRAMES],[E.NOEMBED,a.NOEMBED],[E.NOSCRIPT,a.NOSCRIPT],[E.OBJECT,a.OBJECT],[E.OL,a.OL],[E.OPTGROUP,a.OPTGROUP],[E.OPTION,a.OPTION],[E.P,a.P],[E.PARAM,a.PARAM],[E.PLAINTEXT,a.PLAINTEXT],[E.PRE,a.PRE],[E.RB,a.RB],[E.RP,a.RP],[E.RT,a.RT],[E.RTC,a.RTC],[E.RUBY,a.RUBY],[E.S,a.S],[E.SCRIPT,a.SCRIPT],[E.SEARCH,a.SEARCH],[E.SECTION,a.SECTION],[E.SELECT,a.SELECT],[E.SOURCE,a.SOURCE],[E.SMALL,a.SMALL],[E.SPAN,a.SPAN],[E.STRIKE,a.STRIKE],[E.STRONG,a.STRONG],[E.STYLE,a.STYLE],[E.SUB,a.SUB],[E.SUMMARY,a.SUMMARY],[E.SUP,a.SUP],[E.TABLE,a.TABLE],[E.TBODY,a.TBODY],[E.TEMPLATE,a.TEMPLATE],[E.TEXTAREA,a.TEXTAREA],[E.TFOOT,a.TFOOT],[E.TD,a.TD],[E.TH,a.TH],[E.THEAD,a.THEAD],[E.TITLE,a.TITLE],[E.TR,a.TR],[E.TRACK,a.TRACK],[E.TT,a.TT],[E.U,a.U],[E.UL,a.UL],[E.SVG,a.SVG],[E.VAR,a.VAR],[E.WBR,a.WBR],[E.XMP,a.XMP]]);function Qe(e){var t;return(t=Il.get(e))!==null&&t!==void 0?t:a.UNKNOWN}var w=a,li={[I.HTML]:new Set([w.ADDRESS,w.APPLET,w.AREA,w.ARTICLE,w.ASIDE,w.BASE,w.BASEFONT,w.BGSOUND,w.BLOCKQUOTE,w.BODY,w.BR,w.BUTTON,w.CAPTION,w.CENTER,w.COL,w.COLGROUP,w.DD,w.DETAILS,w.DIR,w.DIV,w.DL,w.DT,w.EMBED,w.FIELDSET,w.FIGCAPTION,w.FIGURE,w.FOOTER,w.FORM,w.FRAME,w.FRAMESET,w.H1,w.H2,w.H3,w.H4,w.H5,w.H6,w.HEAD,w.HEADER,w.HGROUP,w.HR,w.HTML,w.IFRAME,w.IMG,w.INPUT,w.LI,w.LINK,w.LISTING,w.MAIN,w.MARQUEE,w.MENU,w.META,w.NAV,w.NOEMBED,w.NOFRAMES,w.NOSCRIPT,w.OBJECT,w.OL,w.P,w.PARAM,w.PLAINTEXT,w.PRE,w.SCRIPT,w.SECTION,w.SELECT,w.SOURCE,w.STYLE,w.SUMMARY,w.TABLE,w.TBODY,w.TD,w.TEMPLATE,w.TEXTAREA,w.TFOOT,w.TH,w.THEAD,w.TITLE,w.TR,w.TRACK,w.UL,w.WBR,w.XMP]),[I.MATHML]:new Set([w.MI,w.MO,w.MN,w.MS,w.MTEXT,w.ANNOTATION_XML]),[I.SVG]:new Set([w.TITLE,w.FOREIGN_OBJECT,w.DESC]),[I.XLINK]:new Set,[I.XML]:new Set,[I.XMLNS]:new Set},xt=new Set([w.H1,w.H2,w.H3,w.H4,w.H5,w.H6]),fm=new Set([E.STYLE,E.SCRIPT,E.XMP,E.IFRAME,E.NOEMBED,E.NOFRAMES,E.PLAINTEXT]);var p;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(p||(p={}));var V={DATA:p.DATA,RCDATA:p.RCDATA,RAWTEXT:p.RAWTEXT,SCRIPT_DATA:p.SCRIPT_DATA,PLAINTEXT:p.PLAINTEXT,CDATA_SECTION:p.CDATA_SECTION};function wl(e){return e>=u.DIGIT_0&&e<=u.DIGIT_9}function St(e){return e>=u.LATIN_CAPITAL_A&&e<=u.LATIN_CAPITAL_Z}function xl(e){return e>=u.LATIN_SMALL_A&&e<=u.LATIN_SMALL_Z}function we(e){return xl(e)||St(e)}function di(e){return we(e)||wl(e)}function Er(e){return e+32}function Ai(e){return e===u.SPACE||e===u.LINE_FEED||e===u.TABULATION||e===u.FORM_FEED}function ui(e){return Ai(e)||e===u.SOLIDUS||e===u.GREATER_THAN_SIGN}function Sl(e){return e===u.NULL?T.nullCharacterReference:e>1114111?T.characterReferenceOutsideUnicodeRange:Ar(e)?T.surrogateCharacterReference:hr(e)?T.noncharacterCharacterReference:pr(e)||e===u.CARRIAGE_RETURN?T.controlCharacterReference:null}var Nt=class{constructor(t,r){this.options=t,this.handler=r,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=p.DATA,this.returnState=p.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new gr(r),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new fr(Nn,(n,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(n)},r.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(T.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:n=>{this._err(T.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+n)},validateNumericCharacterReference:n=>{let s=Sl(n);s&&this._err(s,1)}}:void 0)}_err(t,r=0){var n,s;(s=(n=this.handler).onParseError)===null||s===void 0||s.call(n,this.preprocessor.getError(t,r))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,r,n){this.active=!0,this.preprocessor.write(t,r),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let r=0;r<t;r++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,r){return this.preprocessor.startsWith(t,r)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:k.START_TAG,tagName:"",tagID:a.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:k.END_TAG,tagName:"",tagID:a.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:k.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:k.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,r){this.currentCharacterToken={type:t,chars:r,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,r;let n=this.currentToken;if(mr(n,this.currentAttr.name)===null){if(n.attrs.push(this.currentAttr),n.location&&this.currentLocation){let s=(t=(r=n.location).attrs)!==null&&t!==void 0?t:r.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(T.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let t=this.currentToken;this.prepareToken(t),t.tagID=Qe(t.tagName),t.type===k.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(T.endTagWithAttributes),t.selfClosing&&this._err(T.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case k.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case k.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case k.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){let t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:k.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,r){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=r;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,r)}_emitCodePoint(t){let r=Ai(t)?k.WHITESPACE_CHARACTER:t===u.NULL?k.NULL_CHARACTER:k.CHARACTER;this._appendCharToCurrentCharacterToken(r,t<65536?String.fromCharCode(t):String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(k.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=p.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Te.Attribute:Te.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===p.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===p.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===p.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case p.DATA:{this._stateData(t);break}case p.RCDATA:{this._stateRcdata(t);break}case p.RAWTEXT:{this._stateRawtext(t);break}case p.SCRIPT_DATA:{this._stateScriptData(t);break}case p.PLAINTEXT:{this._statePlaintext(t);break}case p.TAG_OPEN:{this._stateTagOpen(t);break}case p.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case p.TAG_NAME:{this._stateTagName(t);break}case p.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case p.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case p.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case p.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case p.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case p.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case p.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case p.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case p.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case p.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case p.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case p.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case p.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case p.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case p.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case p.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case p.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case p.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case p.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case p.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case p.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case p.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case p.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case p.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case p.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case p.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case p.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case p.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case p.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case p.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case p.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case p.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case p.BOGUS_COMMENT:{this._stateBogusComment(t);break}case p.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case p.COMMENT_START:{this._stateCommentStart(t);break}case p.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case p.COMMENT:{this._stateComment(t);break}case p.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case p.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case p.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case p.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case p.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case p.COMMENT_END:{this._stateCommentEnd(t);break}case p.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case p.DOCTYPE:{this._stateDoctype(t);break}case p.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case p.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case p.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case p.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case p.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case p.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case p.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case p.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case p.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case p.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case p.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case p.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case p.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case p.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case p.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case p.CDATA_SECTION:{this._stateCdataSection(t);break}case p.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case p.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case p.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case p.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case u.LESS_THAN_SIGN:{this.state=p.TAG_OPEN;break}case u.AMPERSAND:{this._startCharacterReference();break}case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitCodePoint(t);break}case u.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case u.AMPERSAND:{this._startCharacterReference();break}case u.LESS_THAN_SIGN:{this.state=p.RCDATA_LESS_THAN_SIGN;break}case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(U);break}case u.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case u.LESS_THAN_SIGN:{this.state=p.RAWTEXT_LESS_THAN_SIGN;break}case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(U);break}case u.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_LESS_THAN_SIGN;break}case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(U);break}case u.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(U);break}case u.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(we(t))this._createStartTagToken(),this.state=p.TAG_NAME,this._stateTagName(t);else switch(t){case u.EXCLAMATION_MARK:{this.state=p.MARKUP_DECLARATION_OPEN;break}case u.SOLIDUS:{this.state=p.END_TAG_OPEN;break}case u.QUESTION_MARK:{this._err(T.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=p.BOGUS_COMMENT,this._stateBogusComment(t);break}case u.EOF:{this._err(T.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(T.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=p.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(we(t))this._createEndTagToken(),this.state=p.TAG_NAME,this._stateTagName(t);else switch(t){case u.GREATER_THAN_SIGN:{this._err(T.missingEndTagName),this.state=p.DATA;break}case u.EOF:{this._err(T.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(T.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=p.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this.state=p.BEFORE_ATTRIBUTE_NAME;break}case u.SOLIDUS:{this.state=p.SELF_CLOSING_START_TAG;break}case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentTagToken();break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.tagName+=U;break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:r.tagName+=String.fromCodePoint(St(t)?Er(t):t)}}_stateRcdataLessThanSign(t){t===u.SOLIDUS?this.state=p.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=p.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){we(t)?(this.state=p.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=p.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let r=this.currentToken;switch(r.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=p.BEFORE_ATTRIBUTE_NAME,!1;case u.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=p.SELF_CLOSING_START_TAG,!1;case u.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=p.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=p.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===u.SOLIDUS?this.state=p.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=p.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){we(t)?(this.state=p.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=p.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=p.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case u.SOLIDUS:{this.state=p.SCRIPT_DATA_END_TAG_OPEN;break}case u.EXCLAMATION_MARK:{this.state=p.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=p.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){we(t)?(this.state=p.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=p.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=p.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===u.HYPHEN_MINUS?(this.state=p.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=p.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===u.HYPHEN_MINUS?(this.state=p.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=p.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case u.HYPHEN_MINUS:{this.state=p.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(U);break}case u.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case u.HYPHEN_MINUS:{this.state=p.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.state=p.SCRIPT_DATA_ESCAPED,this._emitChars(U);break}case u.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=p.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case u.HYPHEN_MINUS:{this._emitChars("-");break}case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case u.GREATER_THAN_SIGN:{this.state=p.SCRIPT_DATA,this._emitChars(">");break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.state=p.SCRIPT_DATA_ESCAPED,this._emitChars(U);break}case u.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=p.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===u.SOLIDUS?this.state=p.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:we(t)?(this._emitChars("<"),this.state=p.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=p.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){we(t)?(this.state=p.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=p.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=p.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(q.SCRIPT,!1)&&ui(this.preprocessor.peek(q.SCRIPT.length))){this._emitCodePoint(t);for(let r=0;r<q.SCRIPT.length;r++)this._emitCodePoint(this._consume());this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=p.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case u.HYPHEN_MINUS:{this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case u.NULL:{this._err(T.unexpectedNullCharacter),this._emitChars(U);break}case u.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case u.HYPHEN_MINUS:{this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(U);break}case u.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case u.HYPHEN_MINUS:{this._emitChars("-");break}case u.LESS_THAN_SIGN:{this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case u.GREATER_THAN_SIGN:{this.state=p.SCRIPT_DATA,this._emitChars(">");break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(U);break}case u.EOF:{this._err(T.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===u.SOLIDUS?(this.state=p.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(q.SCRIPT,!1)&&ui(this.preprocessor.peek(q.SCRIPT.length))){this._emitCodePoint(t);for(let r=0;r<q.SCRIPT.length;r++)this._emitCodePoint(this._consume());this.state=p.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=p.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.SOLIDUS:case u.GREATER_THAN_SIGN:case u.EOF:{this.state=p.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case u.EQUALS_SIGN:{this._err(T.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=p.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=p.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:case u.SOLIDUS:case u.GREATER_THAN_SIGN:case u.EOF:{this._leaveAttrName(),this.state=p.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case u.EQUALS_SIGN:{this._leaveAttrName(),this.state=p.BEFORE_ATTRIBUTE_VALUE;break}case u.QUOTATION_MARK:case u.APOSTROPHE:case u.LESS_THAN_SIGN:{this._err(T.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.currentAttr.name+=U;break}default:this.currentAttr.name+=String.fromCodePoint(St(t)?Er(t):t)}}_stateAfterAttributeName(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.SOLIDUS:{this.state=p.SELF_CLOSING_START_TAG;break}case u.EQUALS_SIGN:{this.state=p.BEFORE_ATTRIBUTE_VALUE;break}case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentTagToken();break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=p.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.QUOTATION_MARK:{this.state=p.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case u.APOSTROPHE:{this.state=p.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case u.GREATER_THAN_SIGN:{this._err(T.missingAttributeValue),this.state=p.DATA,this.emitCurrentTagToken();break}default:this.state=p.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case u.QUOTATION_MARK:{this.state=p.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case u.AMPERSAND:{this._startCharacterReference();break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.currentAttr.value+=U;break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case u.APOSTROPHE:{this.state=p.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case u.AMPERSAND:{this._startCharacterReference();break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.currentAttr.value+=U;break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this._leaveAttrValue(),this.state=p.BEFORE_ATTRIBUTE_NAME;break}case u.AMPERSAND:{this._startCharacterReference();break}case u.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=p.DATA,this.emitCurrentTagToken();break}case u.NULL:{this._err(T.unexpectedNullCharacter),this.currentAttr.value+=U;break}case u.QUOTATION_MARK:case u.APOSTROPHE:case u.LESS_THAN_SIGN:case u.EQUALS_SIGN:case u.GRAVE_ACCENT:{this._err(T.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this._leaveAttrValue(),this.state=p.BEFORE_ATTRIBUTE_NAME;break}case u.SOLIDUS:{this._leaveAttrValue(),this.state=p.SELF_CLOSING_START_TAG;break}case u.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=p.DATA,this.emitCurrentTagToken();break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this._err(T.missingWhitespaceBetweenAttributes),this.state=p.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case u.GREATER_THAN_SIGN:{let r=this.currentToken;r.selfClosing=!0,this.state=p.DATA,this.emitCurrentTagToken();break}case u.EOF:{this._err(T.eofInTag),this._emitEOFToken();break}default:this._err(T.unexpectedSolidusInTag),this.state=p.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){let r=this.currentToken;switch(t){case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentComment(r);break}case u.EOF:{this.emitCurrentComment(r),this._emitEOFToken();break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.data+=U;break}default:r.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(q.DASH_DASH,!0)?(this._createCommentToken(q.DASH_DASH.length+1),this.state=p.COMMENT_START):this._consumeSequenceIfMatch(q.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(q.DOCTYPE.length+1),this.state=p.DOCTYPE):this._consumeSequenceIfMatch(q.CDATA_START,!0)?this.inForeignNode?this.state=p.CDATA_SECTION:(this._err(T.cdataInHtmlContent),this._createCommentToken(q.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=p.BOGUS_COMMENT):this._ensureHibernation()||(this._err(T.incorrectlyOpenedComment),this._createCommentToken(2),this.state=p.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case u.HYPHEN_MINUS:{this.state=p.COMMENT_START_DASH;break}case u.GREATER_THAN_SIGN:{this._err(T.abruptClosingOfEmptyComment),this.state=p.DATA;let r=this.currentToken;this.emitCurrentComment(r);break}default:this.state=p.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){let r=this.currentToken;switch(t){case u.HYPHEN_MINUS:{this.state=p.COMMENT_END;break}case u.GREATER_THAN_SIGN:{this._err(T.abruptClosingOfEmptyComment),this.state=p.DATA,this.emitCurrentComment(r);break}case u.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="-",this.state=p.COMMENT,this._stateComment(t)}}_stateComment(t){let r=this.currentToken;switch(t){case u.HYPHEN_MINUS:{this.state=p.COMMENT_END_DASH;break}case u.LESS_THAN_SIGN:{r.data+="<",this.state=p.COMMENT_LESS_THAN_SIGN;break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.data+=U;break}case u.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){let r=this.currentToken;switch(t){case u.EXCLAMATION_MARK:{r.data+="!",this.state=p.COMMENT_LESS_THAN_SIGN_BANG;break}case u.LESS_THAN_SIGN:{r.data+="<";break}default:this.state=p.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===u.HYPHEN_MINUS?this.state=p.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=p.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===u.HYPHEN_MINUS?this.state=p.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=p.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==u.GREATER_THAN_SIGN&&t!==u.EOF&&this._err(T.nestedComment),this.state=p.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){let r=this.currentToken;switch(t){case u.HYPHEN_MINUS:{this.state=p.COMMENT_END;break}case u.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="-",this.state=p.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){let r=this.currentToken;switch(t){case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentComment(r);break}case u.EXCLAMATION_MARK:{this.state=p.COMMENT_END_BANG;break}case u.HYPHEN_MINUS:{r.data+="-";break}case u.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="--",this.state=p.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){let r=this.currentToken;switch(t){case u.HYPHEN_MINUS:{r.data+="--!",this.state=p.COMMENT_END_DASH;break}case u.GREATER_THAN_SIGN:{this._err(T.incorrectlyClosedComment),this.state=p.DATA,this.emitCurrentComment(r);break}case u.EOF:{this._err(T.eofInComment),this.emitCurrentComment(r),this._emitEOFToken();break}default:r.data+="--!",this.state=p.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this.state=p.BEFORE_DOCTYPE_NAME;break}case u.GREATER_THAN_SIGN:{this.state=p.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case u.EOF:{this._err(T.eofInDoctype),this._createDoctypeToken(null);let r=this.currentToken;r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingWhitespaceBeforeDoctypeName),this.state=p.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(St(t))this._createDoctypeToken(String.fromCharCode(Er(t))),this.state=p.DOCTYPE_NAME;else switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.NULL:{this._err(T.unexpectedNullCharacter),this._createDoctypeToken(U),this.state=p.DOCTYPE_NAME;break}case u.GREATER_THAN_SIGN:{this._err(T.missingDoctypeName),this._createDoctypeToken(null);let r=this.currentToken;r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.EOF:{this._err(T.eofInDoctype),this._createDoctypeToken(null);let r=this.currentToken;r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=p.DOCTYPE_NAME}}_stateDoctypeName(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this.state=p.AFTER_DOCTYPE_NAME;break}case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.name+=U;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.name+=String.fromCodePoint(St(t)?Er(t):t)}}_stateAfterDoctypeName(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(q.PUBLIC,!1)?this.state=p.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(q.SYSTEM,!1)?this.state=p.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(T.invalidCharacterSequenceAfterDoctypeName),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this.state=p.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case u.QUOTATION_MARK:{this._err(T.missingWhitespaceAfterDoctypePublicKeyword),r.publicId="",this.state=p.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case u.APOSTROPHE:{this._err(T.missingWhitespaceAfterDoctypePublicKeyword),r.publicId="",this.state=p.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case u.GREATER_THAN_SIGN:{this._err(T.missingDoctypePublicIdentifier),r.forceQuirks=!0,this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypePublicIdentifier),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.QUOTATION_MARK:{r.publicId="",this.state=p.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case u.APOSTROPHE:{r.publicId="",this.state=p.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case u.GREATER_THAN_SIGN:{this._err(T.missingDoctypePublicIdentifier),r.forceQuirks=!0,this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypePublicIdentifier),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){let r=this.currentToken;switch(t){case u.QUOTATION_MARK:{this.state=p.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.publicId+=U;break}case u.GREATER_THAN_SIGN:{this._err(T.abruptDoctypePublicIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){let r=this.currentToken;switch(t){case u.APOSTROPHE:{this.state=p.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.publicId+=U;break}case u.GREATER_THAN_SIGN:{this._err(T.abruptDoctypePublicIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this.state=p.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case u.GREATER_THAN_SIGN:{this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.QUOTATION_MARK:{this._err(T.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case u.APOSTROPHE:{this._err(T.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.GREATER_THAN_SIGN:{this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.QUOTATION_MARK:{r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case u.APOSTROPHE:{r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:{this.state=p.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case u.QUOTATION_MARK:{this._err(T.missingWhitespaceAfterDoctypeSystemKeyword),r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case u.APOSTROPHE:{this._err(T.missingWhitespaceAfterDoctypeSystemKeyword),r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case u.GREATER_THAN_SIGN:{this._err(T.missingDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.QUOTATION_MARK:{r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case u.APOSTROPHE:{r.systemId="",this.state=p.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case u.GREATER_THAN_SIGN:{this._err(T.missingDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=p.DATA,this.emitCurrentDoctype(r);break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.missingQuoteBeforeDoctypeSystemIdentifier),r.forceQuirks=!0,this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){let r=this.currentToken;switch(t){case u.QUOTATION_MARK:{this.state=p.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.systemId+=U;break}case u.GREATER_THAN_SIGN:{this._err(T.abruptDoctypeSystemIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){let r=this.currentToken;switch(t){case u.APOSTROPHE:{this.state=p.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case u.NULL:{this._err(T.unexpectedNullCharacter),r.systemId+=U;break}case u.GREATER_THAN_SIGN:{this._err(T.abruptDoctypeSystemIdentifier),r.forceQuirks=!0,this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:r.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){let r=this.currentToken;switch(t){case u.SPACE:case u.LINE_FEED:case u.TABULATION:case u.FORM_FEED:break;case u.GREATER_THAN_SIGN:{this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.EOF:{this._err(T.eofInDoctype),r.forceQuirks=!0,this.emitCurrentDoctype(r),this._emitEOFToken();break}default:this._err(T.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=p.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){let r=this.currentToken;switch(t){case u.GREATER_THAN_SIGN:{this.emitCurrentDoctype(r),this.state=p.DATA;break}case u.NULL:{this._err(T.unexpectedNullCharacter);break}case u.EOF:{this.emitCurrentDoctype(r),this._emitEOFToken();break}default:}}_stateCdataSection(t){switch(t){case u.RIGHT_SQUARE_BRACKET:{this.state=p.CDATA_SECTION_BRACKET;break}case u.EOF:{this._err(T.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===u.RIGHT_SQUARE_BRACKET?this.state=p.CDATA_SECTION_END:(this._emitChars("]"),this.state=p.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case u.GREATER_THAN_SIGN:{this.state=p.DATA;break}case u.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=p.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(u.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&di(this.preprocessor.peek(1))?p.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){di(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===u.SEMICOLON&&this._err(T.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}};var mi=new Set([a.DD,a.DT,a.LI,a.OPTGROUP,a.OPTION,a.P,a.RB,a.RP,a.RT,a.RTC]),pi=new Set([...mi,a.CAPTION,a.COLGROUP,a.TBODY,a.TD,a.TFOOT,a.TH,a.THEAD,a.TR]),Tr=new Set([a.APPLET,a.CAPTION,a.HTML,a.MARQUEE,a.OBJECT,a.TABLE,a.TD,a.TEMPLATE,a.TH]),Nl=new Set([...Tr,a.OL,a.UL]),Rl=new Set([...Tr,a.BUTTON]),hi=new Set([a.ANNOTATION_XML,a.MI,a.MN,a.MO,a.MS,a.MTEXT]),gi=new Set([a.DESC,a.FOREIGN_OBJECT,a.TITLE]),_l=new Set([a.TR,a.TEMPLATE,a.HTML]),vl=new Set([a.TBODY,a.TFOOT,a.THEAD,a.TEMPLATE,a.HTML]),Ll=new Set([a.TABLE,a.TEMPLATE,a.HTML]),Ol=new Set([a.TD,a.TH]),br=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,r,n){this.treeAdapter=r,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=a.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===a.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===I.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,r){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=r,this.currentTagId=r,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,r,!0)}pop(){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,r){let n=this._indexOf(t);this.items[n]=r,n===this.stackTop&&(this.current=r)}insertAfter(t,r,n){let s=this._indexOf(t)+1;this.items.splice(s,0,r),this.tagIDs.splice(s,0,n),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let r=this.stackTop+1;do r=this.tagIDs.lastIndexOf(t,r-1);while(r>0&&this.treeAdapter.getNamespaceURI(this.items[r])!==I.HTML);this.shortenToLength(Math.max(r,0))}shortenToLength(t){for(;this.stackTop>=t;){let r=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(r,this.stackTop<t)}}popUntilElementPopped(t){let r=this._indexOf(t);this.shortenToLength(Math.max(r,0))}popUntilPopped(t,r){let n=this._indexOfTagNames(t,r);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(xt,I.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Ol,I.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,r){for(let n=this.stackTop;n>=0;n--)if(t.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===r)return n;return-1}clearBackTo(t,r){let n=this._indexOfTagNames(t,r);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(Ll,I.HTML)}clearBackToTableBodyContext(){this.clearBackTo(vl,I.HTML)}clearBackToTableRowContext(){this.clearBackTo(_l,I.HTML)}remove(t){let r=this._indexOf(t);r>=0&&(r===this.stackTop?this.pop():(this.items.splice(r,1),this.tagIDs.splice(r,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===a.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){let r=this._indexOf(t)-1;return r>=0?this.items[r]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===a.HTML}hasInDynamicScope(t,r){for(let n=this.stackTop;n>=0;n--){let s=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case I.HTML:{if(s===t)return!0;if(r.has(s))return!1;break}case I.SVG:{if(gi.has(s))return!1;break}case I.MATHML:{if(hi.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Tr)}hasInListItemScope(t){return this.hasInDynamicScope(t,Nl)}hasInButtonScope(t){return this.hasInDynamicScope(t,Rl)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){let r=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case I.HTML:{if(xt.has(r))return!0;if(Tr.has(r))return!1;break}case I.SVG:{if(gi.has(r))return!1;break}case I.MATHML:{if(hi.has(r))return!1;break}}}return!0}hasInTableScope(t){for(let r=this.stackTop;r>=0;r--)if(this.treeAdapter.getNamespaceURI(this.items[r])===I.HTML)switch(this.tagIDs[r]){case t:return!0;case a.TABLE:case a.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===I.HTML)switch(this.tagIDs[t]){case a.TBODY:case a.THEAD:case a.TFOOT:return!0;case a.TABLE:case a.HTML:return!1}return!0}hasInSelectScope(t){for(let r=this.stackTop;r>=0;r--)if(this.treeAdapter.getNamespaceURI(this.items[r])===I.HTML)switch(this.tagIDs[r]){case t:return!0;case a.OPTION:case a.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&mi.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&pi.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&pi.has(this.currentTagId);)this.pop()}};var pe;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(pe||(pe={}));var fi={type:pe.Marker},Cr=class{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,r){let n=[],s=r.length,i=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let d=0;d<this.entries.length;d++){let l=this.entries[d];if(l.type===pe.Marker)break;let{element:c}=l;if(this.treeAdapter.getTagName(c)===i&&this.treeAdapter.getNamespaceURI(c)===o){let m=this.treeAdapter.getAttrList(c);m.length===s&&n.push({idx:d,attrs:m})}}return n}_ensureNoahArkCondition(t){if(this.entries.length<3)return;let r=this.treeAdapter.getAttrList(t),n=this._getNoahArkConditionCandidates(t,r);if(n.length<3)return;let s=new Map(r.map(o=>[o.name,o.value])),i=0;for(let o=0;o<n.length;o++){let d=n[o];d.attrs.every(l=>s.get(l.name)===l.value)&&(i+=1,i>=3&&this.entries.splice(d.idx,1))}}insertMarker(){this.entries.unshift(fi)}pushElement(t,r){this._ensureNoahArkCondition(t),this.entries.unshift({type:pe.Element,element:t,token:r})}insertElementAfterBookmark(t,r){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:pe.Element,element:t,token:r})}removeEntry(t){let r=this.entries.indexOf(t);r!==-1&&this.entries.splice(r,1)}clearToLastMarker(){let t=this.entries.indexOf(fi);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){let r=this.entries.find(n=>n.type===pe.Marker||this.treeAdapter.getTagName(n.element)===t);return r&&r.type===pe.Element?r:null}getElementEntry(t){return this.entries.find(r=>r.type===pe.Element&&r.element===t)}};var he={createDocument(){return{nodeName:"#document",mode:z.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,r){return{nodeName:e,tagName:e,attrs:r,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,r){let n=e.childNodes.indexOf(r);e.childNodes.splice(n,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,r,n){let s=e.childNodes.find(i=>i.nodeName==="#documentType");if(s)s.name=t,s.publicId=r,s.systemId=n;else{let i={nodeName:"#documentType",name:t,publicId:r,systemId:n,parentNode:null};he.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let r=e.childNodes[e.childNodes.length-1];if(he.isTextNode(r)){r.value+=t;return}}he.appendChild(e,he.createTextNode(t))},insertTextBefore(e,t,r){let n=e.childNodes[e.childNodes.indexOf(r)-1];n&&he.isTextNode(n)?n.value+=t:he.insertBefore(e,he.createTextNode(t),r)},adoptAttributes(e,t){let r=new Set(e.attrs.map(n=>n.name));for(let n=0;n<t.length;n++)r.has(t[n].name)||e.attrs.push(t[n])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}};var Ti="html",Dl="about:legacy-compat",kl="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",bi=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Bl=[...bi,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Pl=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Ci=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Ml=[...Ci,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Ei(e,t){return t.some(r=>e.startsWith(r))}function Ii(e){return e.name===Ti&&e.publicId===null&&(e.systemId===null||e.systemId===Dl)}function yi(e){if(e.name!==Ti)return z.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===kl)return z.QUIRKS;let{publicId:r}=e;if(r!==null){if(r=r.toLowerCase(),Pl.has(r))return z.QUIRKS;let n=t===null?Bl:bi;if(Ei(r,n))return z.QUIRKS;if(n=t===null?Ci:Ml,Ei(r,n))return z.LIMITED_QUIRKS}return z.NO_QUIRKS}var wi={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Fl="definitionurl",Hl="definitionURL",Ql=new Map(["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"].map(e=>[e.toLowerCase(),e])),Yl=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:I.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:I.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:I.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:I.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:I.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:I.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:I.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:I.XML}],["xml:space",{prefix:"xml",name:"space",namespace:I.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:I.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:I.XMLNS}]]),Gl=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),Wl=new Set([a.B,a.BIG,a.BLOCKQUOTE,a.BODY,a.BR,a.CENTER,a.CODE,a.DD,a.DIV,a.DL,a.DT,a.EM,a.EMBED,a.H1,a.H2,a.H3,a.H4,a.H5,a.H6,a.HEAD,a.HR,a.I,a.IMG,a.LI,a.LISTING,a.MENU,a.META,a.NOBR,a.OL,a.P,a.PRE,a.RUBY,a.S,a.SMALL,a.SPAN,a.STRONG,a.STRIKE,a.SUB,a.SUP,a.TABLE,a.TT,a.U,a.UL,a.VAR]);function xi(e){let t=e.tagID;return t===a.FONT&&e.attrs.some(({name:n})=>n===Ce.COLOR||n===Ce.SIZE||n===Ce.FACE)||Wl.has(t)}function _n(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Fl){e.attrs[t].name=Hl;break}}function vn(e){for(let t=0;t<e.attrs.length;t++){let r=Ql.get(e.attrs[t].name);r!=null&&(e.attrs[t].name=r)}}function Ir(e){for(let t=0;t<e.attrs.length;t++){let r=Yl.get(e.attrs[t].name);r&&(e.attrs[t].prefix=r.prefix,e.attrs[t].name=r.name,e.attrs[t].namespace=r.namespace)}}function Si(e){let t=Gl.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Qe(e.tagName))}function Kl(e,t){return t===I.MATHML&&(e===a.MI||e===a.MO||e===a.MN||e===a.MS||e===a.MTEXT)}function Jl(e,t,r){if(t===I.MATHML&&e===a.ANNOTATION_XML){for(let n=0;n<r.length;n++)if(r[n].name===Ce.ENCODING){let s=r[n].value.toLowerCase();return s===wi.TEXT_HTML||s===wi.APPLICATION_XML}}return t===I.SVG&&(e===a.FOREIGN_OBJECT||e===a.DESC||e===a.TITLE)}function Ni(e,t,r,n){return(!n||n===I.HTML)&&Jl(e,t,r)||(!n||n===I.MATHML)&&Kl(e,t)}var jl="hidden",Vl=8,Xl=3,g;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(g||(g={}));var Zl={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Oi=new Set([a.TABLE,a.TBODY,a.TFOOT,a.THEAD,a.TR]),_i={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:he,onParseError:null},Bt=class{constructor(t,r,n=null,s=null){this.fragmentContext=n,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=g.INITIAL,this.originalInsertionMode=g.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={..._i,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=r??this.treeAdapter.createDocument(),this.tokenizer=new Nt(this.options,this),this.activeFormattingElements=new Cr(this.treeAdapter),this.fragmentContextID=n?Qe(this.treeAdapter.getTagName(n)):a.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new br(this.document,this.treeAdapter,this)}static parse(t,r){let n=new this(r);return n.tokenizer.write(t,!0),n.document}static getFragmentParser(t,r){let n={..._i,...r};t??(t=n.treeAdapter.createElement(E.TEMPLATE,I.HTML,[]));let s=n.treeAdapter.createElement("documentmock",I.HTML,[]),i=new this(n,s,t);return i.fragmentContextID===a.TEMPLATE&&i.tmplInsertionModeStack.unshift(g.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let t=this.treeAdapter.getFirstChild(this.document),r=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,r),r}_err(t,r,n){var s;if(!this.onParseError)return;let i=(s=t.location)!==null&&s!==void 0?s:Zl,o={code:r,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:n?i.startLine:i.endLine,endCol:n?i.startCol:i.endCol,endOffset:n?i.startOffset:i.endOffset};this.onParseError(o)}onItemPush(t,r,n){var s,i;(i=(s=this.treeAdapter).onItemPush)===null||i===void 0||i.call(s,t),n&&this.openElements.stackTop>0&&this._setContextModes(t,r)}onItemPop(t,r){var n,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(n=this.treeAdapter).onItemPop)===null||s===void 0||s.call(n,t,this.openElements.current),r){let i,o;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,o=this.fragmentContextID):{current:i,currentTagId:o}=this.openElements,this._setContextModes(i,o)}}_setContextModes(t,r){let n=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===I.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&t!==void 0&&r!==void 0&&!this._isIntegrationPoint(r,t)}_switchToTextParsing(t,r){this._insertElement(t,I.HTML),this.tokenizer.state=r,this.originalInsertionMode=this.insertionMode,this.insertionMode=g.TEXT}switchToPlaintextParsing(){this.insertionMode=g.TEXT,this.originalInsertionMode=g.IN_BODY,this.tokenizer.state=V.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===E.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==I.HTML))switch(this.fragmentContextID){case a.TITLE:case a.TEXTAREA:{this.tokenizer.state=V.RCDATA;break}case a.STYLE:case a.XMP:case a.IFRAME:case a.NOEMBED:case a.NOFRAMES:case a.NOSCRIPT:{this.tokenizer.state=V.RAWTEXT;break}case a.SCRIPT:{this.tokenizer.state=V.SCRIPT_DATA;break}case a.PLAINTEXT:{this.tokenizer.state=V.PLAINTEXT;break}default:}}_setDocumentType(t){let r=t.name||"",n=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,r,n,s),t.location){let o=this.treeAdapter.getChildNodes(this.document).find(d=>this.treeAdapter.isDocumentTypeNode(d));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,r){if(this.options.sourceCodeLocationInfo){let n=r&&{...r,startTag:r};this.treeAdapter.setNodeSourceCodeLocation(t,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{let n=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(n??this.document,t)}}_appendElement(t,r){let n=this.treeAdapter.createElement(t.tagName,r,t.attrs);this._attachElementToTree(n,t.location)}_insertElement(t,r){let n=this.treeAdapter.createElement(t.tagName,r,t.attrs);this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID)}_insertFakeElement(t,r){let n=this.treeAdapter.createElement(t,I.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,r)}_insertTemplate(t){let r=this.treeAdapter.createElement(t.tagName,I.HTML,t.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(r,n),this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let t=this.treeAdapter.createElement(E.HTML,I.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,a.HTML)}_appendCommentNode(t,r){let n=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(r,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,t.location)}_insertCharacters(t){let r,n;if(this._shouldFosterParentOnInsertion()?({parent:r,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(r,t.chars,n):this.treeAdapter.insertText(r,t.chars)):(r=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(r,t.chars)),!t.location)return;let s=this.treeAdapter.getChildNodes(r),i=n?s.lastIndexOf(n):s.length,o=s[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){let{endLine:l,endCol:c,endOffset:m}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:l,endCol:c,endOffset:m})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,r){for(let n=this.treeAdapter.getFirstChild(t);n;n=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(r,n)}_setEndLocation(t,r){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&r.location){let n=r.location,s=this.treeAdapter.getTagName(t),i=r.type===k.END_TAG&&s===r.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,i)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let r,n;return this.openElements.stackTop===0&&this.fragmentContext?(r=this.fragmentContext,n=this.fragmentContextID):{current:r,currentTagId:n}=this.openElements,t.tagID===a.SVG&&this.treeAdapter.getTagName(r)===E.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(r)===I.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===a.MGLYPH||t.tagID===a.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,r,I.HTML)}_processToken(t){switch(t.type){case k.CHARACTER:{this.onCharacter(t);break}case k.NULL_CHARACTER:{this.onNullCharacter(t);break}case k.COMMENT:{this.onComment(t);break}case k.DOCTYPE:{this.onDoctype(t);break}case k.START_TAG:{this._processStartTag(t);break}case k.END_TAG:{this.onEndTag(t);break}case k.EOF:{this.onEof(t);break}case k.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,r,n){let s=this.treeAdapter.getNamespaceURI(r),i=this.treeAdapter.getAttrList(r);return Ni(t,s,i,n)}_reconstructActiveFormattingElements(){let t=this.activeFormattingElements.entries.length;if(t){let r=this.activeFormattingElements.entries.findIndex(s=>s.type===pe.Marker||this.openElements.contains(s.element)),n=r===-1?t-1:r-1;for(let s=n;s>=0;s--){let i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=g.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(a.P),this.openElements.popUntilTagNamePopped(a.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case a.TR:{this.insertionMode=g.IN_ROW;return}case a.TBODY:case a.THEAD:case a.TFOOT:{this.insertionMode=g.IN_TABLE_BODY;return}case a.CAPTION:{this.insertionMode=g.IN_CAPTION;return}case a.COLGROUP:{this.insertionMode=g.IN_COLUMN_GROUP;return}case a.TABLE:{this.insertionMode=g.IN_TABLE;return}case a.BODY:{this.insertionMode=g.IN_BODY;return}case a.FRAMESET:{this.insertionMode=g.IN_FRAMESET;return}case a.SELECT:{this._resetInsertionModeForSelect(t);return}case a.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case a.HTML:{this.insertionMode=this.headElement?g.AFTER_HEAD:g.BEFORE_HEAD;return}case a.TD:case a.TH:{if(t>0){this.insertionMode=g.IN_CELL;return}break}case a.HEAD:{if(t>0){this.insertionMode=g.IN_HEAD;return}break}}this.insertionMode=g.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let r=t-1;r>0;r--){let n=this.openElements.tagIDs[r];if(n===a.TEMPLATE)break;if(n===a.TABLE){this.insertionMode=g.IN_SELECT_IN_TABLE;return}}this.insertionMode=g.IN_SELECT}_isElementCausesFosterParenting(t){return Oi.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){let r=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case a.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(r)===I.HTML)return{parent:this.treeAdapter.getTemplateContent(r),beforeElement:null};break}case a.TABLE:{let n=this.treeAdapter.getParentNode(r);return n?{parent:n,beforeElement:r}:{parent:this.openElements.items[t-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){let r=this._findFosterParentingLocation();r.beforeElement?this.treeAdapter.insertBefore(r.parent,t,r.beforeElement):this.treeAdapter.appendChild(r.parent,t)}_isSpecialElement(t,r){let n=this.treeAdapter.getNamespaceURI(t);return li[n].has(r)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Su(this,t);return}switch(this.insertionMode){case g.INITIAL:{Rt(this,t);break}case g.BEFORE_HTML:{vt(this,t);break}case g.BEFORE_HEAD:{Lt(this,t);break}case g.IN_HEAD:{Ot(this,t);break}case g.IN_HEAD_NO_SCRIPT:{Dt(this,t);break}case g.AFTER_HEAD:{kt(this,t);break}case g.IN_BODY:case g.IN_CAPTION:case g.IN_CELL:case g.IN_TEMPLATE:{ki(this,t);break}case g.TEXT:case g.IN_SELECT:case g.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case g.IN_TABLE:case g.IN_TABLE_BODY:case g.IN_ROW:{Ln(this,t);break}case g.IN_TABLE_TEXT:{Hi(this,t);break}case g.IN_COLUMN_GROUP:{wr(this,t);break}case g.AFTER_BODY:{xr(this,t);break}case g.AFTER_AFTER_BODY:{yr(this,t);break}default:}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){xu(this,t);return}switch(this.insertionMode){case g.INITIAL:{Rt(this,t);break}case g.BEFORE_HTML:{vt(this,t);break}case g.BEFORE_HEAD:{Lt(this,t);break}case g.IN_HEAD:{Ot(this,t);break}case g.IN_HEAD_NO_SCRIPT:{Dt(this,t);break}case g.AFTER_HEAD:{kt(this,t);break}case g.TEXT:{this._insertCharacters(t);break}case g.IN_TABLE:case g.IN_TABLE_BODY:case g.IN_ROW:{Ln(this,t);break}case g.IN_COLUMN_GROUP:{wr(this,t);break}case g.AFTER_BODY:{xr(this,t);break}case g.AFTER_AFTER_BODY:{yr(this,t);break}default:}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){On(this,t);return}switch(this.insertionMode){case g.INITIAL:case g.BEFORE_HTML:case g.BEFORE_HEAD:case g.IN_HEAD:case g.IN_HEAD_NO_SCRIPT:case g.AFTER_HEAD:case g.IN_BODY:case g.IN_TABLE:case g.IN_CAPTION:case g.IN_COLUMN_GROUP:case g.IN_TABLE_BODY:case g.IN_ROW:case g.IN_CELL:case g.IN_SELECT:case g.IN_SELECT_IN_TABLE:case g.IN_TEMPLATE:case g.IN_FRAMESET:case g.AFTER_FRAMESET:{On(this,t);break}case g.IN_TABLE_TEXT:{_t(this,t);break}case g.AFTER_BODY:{nd(this,t);break}case g.AFTER_AFTER_BODY:case g.AFTER_AFTER_FRAMESET:{sd(this,t);break}default:}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case g.INITIAL:{id(this,t);break}case g.BEFORE_HEAD:case g.IN_HEAD:case g.IN_HEAD_NO_SCRIPT:case g.AFTER_HEAD:{this._err(t,T.misplacedDoctype);break}case g.IN_TABLE_TEXT:{_t(this,t);break}default:}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,T.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Nu(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case g.INITIAL:{Rt(this,t);break}case g.BEFORE_HTML:{ad(this,t);break}case g.BEFORE_HEAD:{cd(this,t);break}case g.IN_HEAD:{ge(this,t);break}case g.IN_HEAD_NO_SCRIPT:{ud(this,t);break}case g.AFTER_HEAD:{pd(this,t);break}case g.IN_BODY:{X(this,t);break}case g.IN_TABLE:{st(this,t);break}case g.IN_TABLE_TEXT:{_t(this,t);break}case g.IN_CAPTION:{lu(this,t);break}case g.IN_COLUMN_GROUP:{Pn(this,t);break}case g.IN_TABLE_BODY:{Rr(this,t);break}case g.IN_ROW:{_r(this,t);break}case g.IN_CELL:{Au(this,t);break}case g.IN_SELECT:{Gi(this,t);break}case g.IN_SELECT_IN_TABLE:{hu(this,t);break}case g.IN_TEMPLATE:{mu(this,t);break}case g.AFTER_BODY:{Eu(this,t);break}case g.IN_FRAMESET:{Tu(this,t);break}case g.AFTER_FRAMESET:{Cu(this,t);break}case g.AFTER_AFTER_BODY:{yu(this,t);break}case g.AFTER_AFTER_FRAMESET:{wu(this,t);break}default:}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Ru(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case g.INITIAL:{Rt(this,t);break}case g.BEFORE_HTML:{od(this,t);break}case g.BEFORE_HEAD:{ld(this,t);break}case g.IN_HEAD:{dd(this,t);break}case g.IN_HEAD_NO_SCRIPT:{Ad(this,t);break}case g.AFTER_HEAD:{hd(this,t);break}case g.IN_BODY:{Nr(this,t);break}case g.TEXT:{zd(this,t);break}case g.IN_TABLE:{Pt(this,t);break}case g.IN_TABLE_TEXT:{_t(this,t);break}case g.IN_CAPTION:{du(this,t);break}case g.IN_COLUMN_GROUP:{uu(this,t);break}case g.IN_TABLE_BODY:{Dn(this,t);break}case g.IN_ROW:{Yi(this,t);break}case g.IN_CELL:{pu(this,t);break}case g.IN_SELECT:{Wi(this,t);break}case g.IN_SELECT_IN_TABLE:{gu(this,t);break}case g.IN_TEMPLATE:{fu(this,t);break}case g.AFTER_BODY:{Ji(this,t);break}case g.IN_FRAMESET:{bu(this,t);break}case g.AFTER_FRAMESET:{Iu(this,t);break}case g.AFTER_AFTER_BODY:{yr(this,t);break}default:}}onEof(t){switch(this.insertionMode){case g.INITIAL:{Rt(this,t);break}case g.BEFORE_HTML:{vt(this,t);break}case g.BEFORE_HEAD:{Lt(this,t);break}case g.IN_HEAD:{Ot(this,t);break}case g.IN_HEAD_NO_SCRIPT:{Dt(this,t);break}case g.AFTER_HEAD:{kt(this,t);break}case g.IN_BODY:case g.IN_TABLE:case g.IN_CAPTION:case g.IN_COLUMN_GROUP:case g.IN_TABLE_BODY:case g.IN_ROW:case g.IN_CELL:case g.IN_SELECT:case g.IN_SELECT_IN_TABLE:{Ui(this,t);break}case g.TEXT:{eu(this,t);break}case g.IN_TABLE_TEXT:{_t(this,t);break}case g.IN_TEMPLATE:{Ki(this,t);break}case g.AFTER_BODY:case g.IN_FRAMESET:case g.AFTER_FRAMESET:case g.AFTER_AFTER_BODY:case g.AFTER_AFTER_FRAMESET:{Bn(this,t);break}default:}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===u.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case g.IN_HEAD:case g.IN_HEAD_NO_SCRIPT:case g.AFTER_HEAD:case g.TEXT:case g.IN_COLUMN_GROUP:case g.IN_SELECT:case g.IN_SELECT_IN_TABLE:case g.IN_FRAMESET:case g.AFTER_FRAMESET:{this._insertCharacters(t);break}case g.IN_BODY:case g.IN_CAPTION:case g.IN_CELL:case g.IN_TEMPLATE:case g.AFTER_BODY:case g.AFTER_AFTER_BODY:case g.AFTER_AFTER_FRAMESET:{Di(this,t);break}case g.IN_TABLE:case g.IN_TABLE_BODY:case g.IN_ROW:{Ln(this,t);break}case g.IN_TABLE_TEXT:{Fi(this,t);break}default:}}};function $l(e,t){let r=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return r?e.openElements.contains(r.element)?e.openElements.hasInScope(t.tagID)||(r=null):(e.activeFormattingElements.removeEntry(r),r=null):Mi(e,t),r}function ql(e,t){let r=null,n=e.openElements.stackTop;for(;n>=0;n--){let s=e.openElements.items[n];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[n])&&(r=s)}return r||(e.openElements.shortenToLength(Math.max(n,0)),e.activeFormattingElements.removeEntry(t)),r}function zl(e,t,r){let n=t,s=e.openElements.getCommonAncestor(t);for(let i=0,o=s;o!==r;i++,o=s){s=e.openElements.getCommonAncestor(o);let d=e.activeFormattingElements.getElementEntry(o),l=d&&i>=Xl;!d||l?(l&&e.activeFormattingElements.removeEntry(d),e.openElements.remove(o)):(o=ed(e,d),n===t&&(e.activeFormattingElements.bookmark=d),e.treeAdapter.detachNode(n),e.treeAdapter.appendChild(o,n),n=o)}return n}function ed(e,t){let r=e.treeAdapter.getNamespaceURI(t.element),n=e.treeAdapter.createElement(t.token.tagName,r,t.token.attrs);return e.openElements.replace(t.element,n),t.element=n,n}function td(e,t,r){let n=e.treeAdapter.getTagName(t),s=Qe(n);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(r);else{let i=e.treeAdapter.getNamespaceURI(t);s===a.TEMPLATE&&i===I.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,r)}}function rd(e,t,r){let n=e.treeAdapter.getNamespaceURI(r.element),{token:s}=r,i=e.treeAdapter.createElement(s.tagName,n,s.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,s),e.activeFormattingElements.removeEntry(r),e.openElements.remove(r.element),e.openElements.insertAfter(t,i,s.tagID)}function kn(e,t){for(let r=0;r<Vl;r++){let n=$l(e,t);if(!n)break;let s=ql(e,n);if(!s)break;e.activeFormattingElements.bookmark=n;let i=zl(e,s,n.element),o=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),o&&td(e,o,i),rd(e,s,n)}}function On(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function nd(e,t){e._appendCommentNode(t,e.openElements.items[0])}function sd(e,t){e._appendCommentNode(t,e.document)}function Bn(e,t){if(e.stopped=!0,t.location){let r=e.fragmentContext?0:2;for(let n=e.openElements.stackTop;n>=r;n--)e._setEndLocation(e.openElements.items[n],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(n);if(s&&!s.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let i=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(i);o&&!o.endTag&&e._setEndLocation(i,t)}}}}function id(e,t){e._setDocumentType(t);let r=t.forceQuirks?z.QUIRKS:yi(t);Ii(t)||e._err(t,T.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,r),e.insertionMode=g.BEFORE_HTML}function Rt(e,t){e._err(t,T.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,z.QUIRKS),e.insertionMode=g.BEFORE_HTML,e._processToken(t)}function ad(e,t){t.tagID===a.HTML?(e._insertElement(t,I.HTML),e.insertionMode=g.BEFORE_HEAD):vt(e,t)}function od(e,t){let r=t.tagID;(r===a.HTML||r===a.HEAD||r===a.BODY||r===a.BR)&&vt(e,t)}function vt(e,t){e._insertFakeRootElement(),e.insertionMode=g.BEFORE_HEAD,e._processToken(t)}function cd(e,t){switch(t.tagID){case a.HTML:{X(e,t);break}case a.HEAD:{e._insertElement(t,I.HTML),e.headElement=e.openElements.current,e.insertionMode=g.IN_HEAD;break}default:Lt(e,t)}}function ld(e,t){let r=t.tagID;r===a.HEAD||r===a.BODY||r===a.HTML||r===a.BR?Lt(e,t):e._err(t,T.endTagWithoutMatchingOpenElement)}function Lt(e,t){e._insertFakeElement(E.HEAD,a.HEAD),e.headElement=e.openElements.current,e.insertionMode=g.IN_HEAD,e._processToken(t)}function ge(e,t){switch(t.tagID){case a.HTML:{X(e,t);break}case a.BASE:case a.BASEFONT:case a.BGSOUND:case a.LINK:case a.META:{e._appendElement(t,I.HTML),t.ackSelfClosing=!0;break}case a.TITLE:{e._switchToTextParsing(t,V.RCDATA);break}case a.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,V.RAWTEXT):(e._insertElement(t,I.HTML),e.insertionMode=g.IN_HEAD_NO_SCRIPT);break}case a.NOFRAMES:case a.STYLE:{e._switchToTextParsing(t,V.RAWTEXT);break}case a.SCRIPT:{e._switchToTextParsing(t,V.SCRIPT_DATA);break}case a.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=g.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(g.IN_TEMPLATE);break}case a.HEAD:{e._err(t,T.misplacedStartTagForHeadElement);break}default:Ot(e,t)}}function dd(e,t){switch(t.tagID){case a.HEAD:{e.openElements.pop(),e.insertionMode=g.AFTER_HEAD;break}case a.BODY:case a.BR:case a.HTML:{Ot(e,t);break}case a.TEMPLATE:{Ye(e,t);break}default:e._err(t,T.endTagWithoutMatchingOpenElement)}}function Ye(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==a.TEMPLATE&&e._err(t,T.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(a.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,T.endTagWithoutMatchingOpenElement)}function Ot(e,t){e.openElements.pop(),e.insertionMode=g.AFTER_HEAD,e._processToken(t)}function ud(e,t){switch(t.tagID){case a.HTML:{X(e,t);break}case a.BASEFONT:case a.BGSOUND:case a.HEAD:case a.LINK:case a.META:case a.NOFRAMES:case a.STYLE:{ge(e,t);break}case a.NOSCRIPT:{e._err(t,T.nestedNoscriptInHead);break}default:Dt(e,t)}}function Ad(e,t){switch(t.tagID){case a.NOSCRIPT:{e.openElements.pop(),e.insertionMode=g.IN_HEAD;break}case a.BR:{Dt(e,t);break}default:e._err(t,T.endTagWithoutMatchingOpenElement)}}function Dt(e,t){let r=t.type===k.EOF?T.openElementsLeftAfterEof:T.disallowedContentInNoscriptInHead;e._err(t,r),e.openElements.pop(),e.insertionMode=g.IN_HEAD,e._processToken(t)}function pd(e,t){switch(t.tagID){case a.HTML:{X(e,t);break}case a.BODY:{e._insertElement(t,I.HTML),e.framesetOk=!1,e.insertionMode=g.IN_BODY;break}case a.FRAMESET:{e._insertElement(t,I.HTML),e.insertionMode=g.IN_FRAMESET;break}case a.BASE:case a.BASEFONT:case a.BGSOUND:case a.LINK:case a.META:case a.NOFRAMES:case a.SCRIPT:case a.STYLE:case a.TEMPLATE:case a.TITLE:{e._err(t,T.abandonedHeadElementChild),e.openElements.push(e.headElement,a.HEAD),ge(e,t),e.openElements.remove(e.headElement);break}case a.HEAD:{e._err(t,T.misplacedStartTagForHeadElement);break}default:kt(e,t)}}function hd(e,t){switch(t.tagID){case a.BODY:case a.HTML:case a.BR:{kt(e,t);break}case a.TEMPLATE:{Ye(e,t);break}default:e._err(t,T.endTagWithoutMatchingOpenElement)}}function kt(e,t){e._insertFakeElement(E.BODY,a.BODY),e.insertionMode=g.IN_BODY,Sr(e,t)}function Sr(e,t){switch(t.type){case k.CHARACTER:{ki(e,t);break}case k.WHITESPACE_CHARACTER:{Di(e,t);break}case k.COMMENT:{On(e,t);break}case k.START_TAG:{X(e,t);break}case k.END_TAG:{Nr(e,t);break}case k.EOF:{Ui(e,t);break}default:}}function Di(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function ki(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function gd(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function md(e,t){let r=e.openElements.tryPeekProperlyNestedBodyElement();r&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(r,t.attrs))}function fd(e,t){let r=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&r&&(e.treeAdapter.detachNode(r),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,I.HTML),e.insertionMode=g.IN_FRAMESET)}function Ed(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,I.HTML)}function Td(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&xt.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,I.HTML)}function bd(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,I.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Cd(e,t){let r=e.openElements.tmplCount>0;(!e.formElement||r)&&(e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,I.HTML),r||(e.formElement=e.openElements.current))}function Id(e,t){e.framesetOk=!1;let r=t.tagID;for(let n=e.openElements.stackTop;n>=0;n--){let s=e.openElements.tagIDs[n];if(r===a.LI&&s===a.LI||(r===a.DD||r===a.DT)&&(s===a.DD||s===a.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==a.ADDRESS&&s!==a.DIV&&s!==a.P&&e._isSpecialElement(e.openElements.items[n],s))break}e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,I.HTML)}function yd(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,I.HTML),e.tokenizer.state=V.PLAINTEXT}function wd(e,t){e.openElements.hasInScope(a.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.framesetOk=!1}function xd(e,t){let r=e.activeFormattingElements.getElementEntryInScopeWithTagName(E.A);r&&(kn(e,t),e.openElements.remove(r.element),e.activeFormattingElements.removeEntry(r)),e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Sd(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Nd(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(a.NOBR)&&(kn(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,I.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Rd(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function _d(e,t){e.treeAdapter.getDocumentMode(e.document)!==z.QUIRKS&&e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,I.HTML),e.framesetOk=!1,e.insertionMode=g.IN_TABLE}function Bi(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,I.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Pi(e){let t=mr(e,Ce.TYPE);return t!=null&&t.toLowerCase()===jl}function vd(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,I.HTML),Pi(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Ld(e,t){e._appendElement(t,I.HTML),t.ackSelfClosing=!0}function Od(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._appendElement(t,I.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Dd(e,t){t.tagName=E.IMG,t.tagID=a.IMG,Bi(e,t)}function kd(e,t){e._insertElement(t,I.HTML),e.skipNextNewLine=!0,e.tokenizer.state=V.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=g.TEXT}function Bd(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,V.RAWTEXT)}function Pd(e,t){e.framesetOk=!1,e._switchToTextParsing(t,V.RAWTEXT)}function vi(e,t){e._switchToTextParsing(t,V.RAWTEXT)}function Md(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===g.IN_TABLE||e.insertionMode===g.IN_CAPTION||e.insertionMode===g.IN_TABLE_BODY||e.insertionMode===g.IN_ROW||e.insertionMode===g.IN_CELL?g.IN_SELECT_IN_TABLE:g.IN_SELECT}function Ud(e,t){e.openElements.currentTagId===a.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML)}function Fd(e,t){e.openElements.hasInScope(a.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,I.HTML)}function Hd(e,t){e.openElements.hasInScope(a.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(a.RTC),e._insertElement(t,I.HTML)}function Qd(e,t){e._reconstructActiveFormattingElements(),_n(t),Ir(t),t.selfClosing?e._appendElement(t,I.MATHML):e._insertElement(t,I.MATHML),t.ackSelfClosing=!0}function Yd(e,t){e._reconstructActiveFormattingElements(),vn(t),Ir(t),t.selfClosing?e._appendElement(t,I.SVG):e._insertElement(t,I.SVG),t.ackSelfClosing=!0}function Li(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML)}function X(e,t){switch(t.tagID){case a.I:case a.S:case a.B:case a.U:case a.EM:case a.TT:case a.BIG:case a.CODE:case a.FONT:case a.SMALL:case a.STRIKE:case a.STRONG:{Sd(e,t);break}case a.A:{xd(e,t);break}case a.H1:case a.H2:case a.H3:case a.H4:case a.H5:case a.H6:{Td(e,t);break}case a.P:case a.DL:case a.OL:case a.UL:case a.DIV:case a.DIR:case a.NAV:case a.MAIN:case a.MENU:case a.ASIDE:case a.CENTER:case a.FIGURE:case a.FOOTER:case a.HEADER:case a.HGROUP:case a.DIALOG:case a.DETAILS:case a.ADDRESS:case a.ARTICLE:case a.SEARCH:case a.SECTION:case a.SUMMARY:case a.FIELDSET:case a.BLOCKQUOTE:case a.FIGCAPTION:{Ed(e,t);break}case a.LI:case a.DD:case a.DT:{Id(e,t);break}case a.BR:case a.IMG:case a.WBR:case a.AREA:case a.EMBED:case a.KEYGEN:{Bi(e,t);break}case a.HR:{Od(e,t);break}case a.RB:case a.RTC:{Fd(e,t);break}case a.RT:case a.RP:{Hd(e,t);break}case a.PRE:case a.LISTING:{bd(e,t);break}case a.XMP:{Bd(e,t);break}case a.SVG:{Yd(e,t);break}case a.HTML:{gd(e,t);break}case a.BASE:case a.LINK:case a.META:case a.STYLE:case a.TITLE:case a.SCRIPT:case a.BGSOUND:case a.BASEFONT:case a.TEMPLATE:{ge(e,t);break}case a.BODY:{md(e,t);break}case a.FORM:{Cd(e,t);break}case a.NOBR:{Nd(e,t);break}case a.MATH:{Qd(e,t);break}case a.TABLE:{_d(e,t);break}case a.INPUT:{vd(e,t);break}case a.PARAM:case a.TRACK:case a.SOURCE:{Ld(e,t);break}case a.IMAGE:{Dd(e,t);break}case a.BUTTON:{wd(e,t);break}case a.APPLET:case a.OBJECT:case a.MARQUEE:{Rd(e,t);break}case a.IFRAME:{Pd(e,t);break}case a.SELECT:{Md(e,t);break}case a.OPTION:case a.OPTGROUP:{Ud(e,t);break}case a.NOEMBED:case a.NOFRAMES:{vi(e,t);break}case a.FRAMESET:{fd(e,t);break}case a.TEXTAREA:{kd(e,t);break}case a.NOSCRIPT:{e.options.scriptingEnabled?vi(e,t):Li(e,t);break}case a.PLAINTEXT:{yd(e,t);break}case a.COL:case a.TH:case a.TD:case a.TR:case a.HEAD:case a.FRAME:case a.TBODY:case a.TFOOT:case a.THEAD:case a.CAPTION:case a.COLGROUP:break;default:Li(e,t)}}function Gd(e,t){if(e.openElements.hasInScope(a.BODY)&&(e.insertionMode=g.AFTER_BODY,e.options.sourceCodeLocationInfo)){let r=e.openElements.tryPeekProperlyNestedBodyElement();r&&e._setEndLocation(r,t)}}function Wd(e,t){e.openElements.hasInScope(a.BODY)&&(e.insertionMode=g.AFTER_BODY,Ji(e,t))}function Kd(e,t){let r=t.tagID;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r))}function Jd(e){let t=e.openElements.tmplCount>0,{formElement:r}=e;t||(e.formElement=null),(r||t)&&e.openElements.hasInScope(a.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(a.FORM):r&&e.openElements.remove(r))}function jd(e){e.openElements.hasInButtonScope(a.P)||e._insertFakeElement(E.P,a.P),e._closePElement()}function Vd(e){e.openElements.hasInListItemScope(a.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(a.LI),e.openElements.popUntilTagNamePopped(a.LI))}function Xd(e,t){let r=t.tagID;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r))}function Zd(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function $d(e,t){let r=t.tagID;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r),e.activeFormattingElements.clearToLastMarker())}function qd(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(E.BR,a.BR),e.openElements.pop(),e.framesetOk=!1}function Mi(e,t){let r=t.tagName,n=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){let i=e.openElements.items[s],o=e.openElements.tagIDs[s];if(n===o&&(n!==a.UNKNOWN||e.treeAdapter.getTagName(i)===r)){e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(i,o))break}}function Nr(e,t){switch(t.tagID){case a.A:case a.B:case a.I:case a.S:case a.U:case a.EM:case a.TT:case a.BIG:case a.CODE:case a.FONT:case a.NOBR:case a.SMALL:case a.STRIKE:case a.STRONG:{kn(e,t);break}case a.P:{jd(e);break}case a.DL:case a.UL:case a.OL:case a.DIR:case a.DIV:case a.NAV:case a.PRE:case a.MAIN:case a.MENU:case a.ASIDE:case a.BUTTON:case a.CENTER:case a.FIGURE:case a.FOOTER:case a.HEADER:case a.HGROUP:case a.DIALOG:case a.ADDRESS:case a.ARTICLE:case a.DETAILS:case a.SEARCH:case a.SECTION:case a.SUMMARY:case a.LISTING:case a.FIELDSET:case a.BLOCKQUOTE:case a.FIGCAPTION:{Kd(e,t);break}case a.LI:{Vd(e);break}case a.DD:case a.DT:{Xd(e,t);break}case a.H1:case a.H2:case a.H3:case a.H4:case a.H5:case a.H6:{Zd(e);break}case a.BR:{qd(e);break}case a.BODY:{Gd(e,t);break}case a.HTML:{Wd(e,t);break}case a.FORM:{Jd(e);break}case a.APPLET:case a.OBJECT:case a.MARQUEE:{$d(e,t);break}case a.TEMPLATE:{Ye(e,t);break}default:Mi(e,t)}}function Ui(e,t){e.tmplInsertionModeStack.length>0?Ki(e,t):Bn(e,t)}function zd(e,t){var r;t.tagID===a.SCRIPT&&((r=e.scriptHandler)===null||r===void 0||r.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function eu(e,t){e._err(t,T.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Ln(e,t){if(e.openElements.currentTagId!==void 0&&Oi.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=g.IN_TABLE_TEXT,t.type){case k.CHARACTER:{Hi(e,t);break}case k.WHITESPACE_CHARACTER:{Fi(e,t);break}}else Mt(e,t)}function tu(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,I.HTML),e.insertionMode=g.IN_CAPTION}function ru(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,I.HTML),e.insertionMode=g.IN_COLUMN_GROUP}function nu(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(E.COLGROUP,a.COLGROUP),e.insertionMode=g.IN_COLUMN_GROUP,Pn(e,t)}function su(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,I.HTML),e.insertionMode=g.IN_TABLE_BODY}function iu(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(E.TBODY,a.TBODY),e.insertionMode=g.IN_TABLE_BODY,Rr(e,t)}function au(e,t){e.openElements.hasInTableScope(a.TABLE)&&(e.openElements.popUntilTagNamePopped(a.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function ou(e,t){Pi(t)?e._appendElement(t,I.HTML):Mt(e,t),t.ackSelfClosing=!0}function cu(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,I.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function st(e,t){switch(t.tagID){case a.TD:case a.TH:case a.TR:{iu(e,t);break}case a.STYLE:case a.SCRIPT:case a.TEMPLATE:{ge(e,t);break}case a.COL:{nu(e,t);break}case a.FORM:{cu(e,t);break}case a.TABLE:{au(e,t);break}case a.TBODY:case a.TFOOT:case a.THEAD:{su(e,t);break}case a.INPUT:{ou(e,t);break}case a.CAPTION:{tu(e,t);break}case a.COLGROUP:{ru(e,t);break}default:Mt(e,t)}}function Pt(e,t){switch(t.tagID){case a.TABLE:{e.openElements.hasInTableScope(a.TABLE)&&(e.openElements.popUntilTagNamePopped(a.TABLE),e._resetInsertionMode());break}case a.TEMPLATE:{Ye(e,t);break}case a.BODY:case a.CAPTION:case a.COL:case a.COLGROUP:case a.HTML:case a.TBODY:case a.TD:case a.TFOOT:case a.TH:case a.THEAD:case a.TR:break;default:Mt(e,t)}}function Mt(e,t){let r=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Sr(e,t),e.fosterParentingEnabled=r}function Fi(e,t){e.pendingCharacterTokens.push(t)}function Hi(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function _t(e,t){let r=0;if(e.hasNonWhitespacePendingCharacterToken)for(;r<e.pendingCharacterTokens.length;r++)Mt(e,e.pendingCharacterTokens[r]);else for(;r<e.pendingCharacterTokens.length;r++)e._insertCharacters(e.pendingCharacterTokens[r]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var Qi=new Set([a.CAPTION,a.COL,a.COLGROUP,a.TBODY,a.TD,a.TFOOT,a.TH,a.THEAD,a.TR]);function lu(e,t){let r=t.tagID;Qi.has(r)?e.openElements.hasInTableScope(a.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=g.IN_TABLE,st(e,t)):X(e,t)}function du(e,t){let r=t.tagID;switch(r){case a.CAPTION:case a.TABLE:{e.openElements.hasInTableScope(a.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=g.IN_TABLE,r===a.TABLE&&Pt(e,t));break}case a.BODY:case a.COL:case a.COLGROUP:case a.HTML:case a.TBODY:case a.TD:case a.TFOOT:case a.TH:case a.THEAD:case a.TR:break;default:Nr(e,t)}}function Pn(e,t){switch(t.tagID){case a.HTML:{X(e,t);break}case a.COL:{e._appendElement(t,I.HTML),t.ackSelfClosing=!0;break}case a.TEMPLATE:{ge(e,t);break}default:wr(e,t)}}function uu(e,t){switch(t.tagID){case a.COLGROUP:{e.openElements.currentTagId===a.COLGROUP&&(e.openElements.pop(),e.insertionMode=g.IN_TABLE);break}case a.TEMPLATE:{Ye(e,t);break}case a.COL:break;default:wr(e,t)}}function wr(e,t){e.openElements.currentTagId===a.COLGROUP&&(e.openElements.pop(),e.insertionMode=g.IN_TABLE,e._processToken(t))}function Rr(e,t){switch(t.tagID){case a.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,I.HTML),e.insertionMode=g.IN_ROW;break}case a.TH:case a.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(E.TR,a.TR),e.insertionMode=g.IN_ROW,_r(e,t);break}case a.CAPTION:case a.COL:case a.COLGROUP:case a.TBODY:case a.TFOOT:case a.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE,st(e,t));break}default:st(e,t)}}function Dn(e,t){let r=t.tagID;switch(t.tagID){case a.TBODY:case a.TFOOT:case a.THEAD:{e.openElements.hasInTableScope(r)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE);break}case a.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE,Pt(e,t));break}case a.BODY:case a.CAPTION:case a.COL:case a.COLGROUP:case a.HTML:case a.TD:case a.TH:case a.TR:break;default:Pt(e,t)}}function _r(e,t){switch(t.tagID){case a.TH:case a.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,I.HTML),e.insertionMode=g.IN_CELL,e.activeFormattingElements.insertMarker();break}case a.CAPTION:case a.COL:case a.COLGROUP:case a.TBODY:case a.TFOOT:case a.THEAD:case a.TR:{e.openElements.hasInTableScope(a.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE_BODY,Rr(e,t));break}default:st(e,t)}}function Yi(e,t){switch(t.tagID){case a.TR:{e.openElements.hasInTableScope(a.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE_BODY);break}case a.TABLE:{e.openElements.hasInTableScope(a.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE_BODY,Dn(e,t));break}case a.TBODY:case a.TFOOT:case a.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(a.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=g.IN_TABLE_BODY,Dn(e,t));break}case a.BODY:case a.CAPTION:case a.COL:case a.COLGROUP:case a.HTML:case a.TD:case a.TH:break;default:Pt(e,t)}}function Au(e,t){let r=t.tagID;Qi.has(r)?(e.openElements.hasInTableScope(a.TD)||e.openElements.hasInTableScope(a.TH))&&(e._closeTableCell(),_r(e,t)):X(e,t)}function pu(e,t){let r=t.tagID;switch(r){case a.TD:case a.TH:{e.openElements.hasInTableScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=g.IN_ROW);break}case a.TABLE:case a.TBODY:case a.TFOOT:case a.THEAD:case a.TR:{e.openElements.hasInTableScope(r)&&(e._closeTableCell(),Yi(e,t));break}case a.BODY:case a.CAPTION:case a.COL:case a.COLGROUP:case a.HTML:break;default:Nr(e,t)}}function Gi(e,t){switch(t.tagID){case a.HTML:{X(e,t);break}case a.OPTION:{e.openElements.currentTagId===a.OPTION&&e.openElements.pop(),e._insertElement(t,I.HTML);break}case a.OPTGROUP:{e.openElements.currentTagId===a.OPTION&&e.openElements.pop(),e.openElements.currentTagId===a.OPTGROUP&&e.openElements.pop(),e._insertElement(t,I.HTML);break}case a.HR:{e.openElements.currentTagId===a.OPTION&&e.openElements.pop(),e.openElements.currentTagId===a.OPTGROUP&&e.openElements.pop(),e._appendElement(t,I.HTML),t.ackSelfClosing=!0;break}case a.INPUT:case a.KEYGEN:case a.TEXTAREA:case a.SELECT:{e.openElements.hasInSelectScope(a.SELECT)&&(e.openElements.popUntilTagNamePopped(a.SELECT),e._resetInsertionMode(),t.tagID!==a.SELECT&&e._processStartTag(t));break}case a.SCRIPT:case a.TEMPLATE:{ge(e,t);break}default:}}function Wi(e,t){switch(t.tagID){case a.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===a.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===a.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===a.OPTGROUP&&e.openElements.pop();break}case a.OPTION:{e.openElements.currentTagId===a.OPTION&&e.openElements.pop();break}case a.SELECT:{e.openElements.hasInSelectScope(a.SELECT)&&(e.openElements.popUntilTagNamePopped(a.SELECT),e._resetInsertionMode());break}case a.TEMPLATE:{Ye(e,t);break}default:}}function hu(e,t){let r=t.tagID;r===a.CAPTION||r===a.TABLE||r===a.TBODY||r===a.TFOOT||r===a.THEAD||r===a.TR||r===a.TD||r===a.TH?(e.openElements.popUntilTagNamePopped(a.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Gi(e,t)}function gu(e,t){let r=t.tagID;r===a.CAPTION||r===a.TABLE||r===a.TBODY||r===a.TFOOT||r===a.THEAD||r===a.TR||r===a.TD||r===a.TH?e.openElements.hasInTableScope(r)&&(e.openElements.popUntilTagNamePopped(a.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Wi(e,t)}function mu(e,t){switch(t.tagID){case a.BASE:case a.BASEFONT:case a.BGSOUND:case a.LINK:case a.META:case a.NOFRAMES:case a.SCRIPT:case a.STYLE:case a.TEMPLATE:case a.TITLE:{ge(e,t);break}case a.CAPTION:case a.COLGROUP:case a.TBODY:case a.TFOOT:case a.THEAD:{e.tmplInsertionModeStack[0]=g.IN_TABLE,e.insertionMode=g.IN_TABLE,st(e,t);break}case a.COL:{e.tmplInsertionModeStack[0]=g.IN_COLUMN_GROUP,e.insertionMode=g.IN_COLUMN_GROUP,Pn(e,t);break}case a.TR:{e.tmplInsertionModeStack[0]=g.IN_TABLE_BODY,e.insertionMode=g.IN_TABLE_BODY,Rr(e,t);break}case a.TD:case a.TH:{e.tmplInsertionModeStack[0]=g.IN_ROW,e.insertionMode=g.IN_ROW,_r(e,t);break}default:e.tmplInsertionModeStack[0]=g.IN_BODY,e.insertionMode=g.IN_BODY,X(e,t)}}function fu(e,t){t.tagID===a.TEMPLATE&&Ye(e,t)}function Ki(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(a.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Bn(e,t)}function Eu(e,t){t.tagID===a.HTML?X(e,t):xr(e,t)}function Ji(e,t){var r;if(t.tagID===a.HTML){if(e.fragmentContext||(e.insertionMode=g.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===a.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!(!((r=e.treeAdapter.getNodeSourceCodeLocation(n))===null||r===void 0)&&r.endTag)&&e._setEndLocation(n,t)}}else xr(e,t)}function xr(e,t){e.insertionMode=g.IN_BODY,Sr(e,t)}function Tu(e,t){switch(t.tagID){case a.HTML:{X(e,t);break}case a.FRAMESET:{e._insertElement(t,I.HTML);break}case a.FRAME:{e._appendElement(t,I.HTML),t.ackSelfClosing=!0;break}case a.NOFRAMES:{ge(e,t);break}default:}}function bu(e,t){t.tagID===a.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==a.FRAMESET&&(e.insertionMode=g.AFTER_FRAMESET))}function Cu(e,t){switch(t.tagID){case a.HTML:{X(e,t);break}case a.NOFRAMES:{ge(e,t);break}default:}}function Iu(e,t){t.tagID===a.HTML&&(e.insertionMode=g.AFTER_AFTER_FRAMESET)}function yu(e,t){t.tagID===a.HTML?X(e,t):yr(e,t)}function yr(e,t){e.insertionMode=g.IN_BODY,Sr(e,t)}function wu(e,t){switch(t.tagID){case a.HTML:{X(e,t);break}case a.NOFRAMES:{ge(e,t);break}default:}}function xu(e,t){t.chars=U,e._insertCharacters(t)}function Su(e,t){e._insertCharacters(t),e.framesetOk=!1}function ji(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==I.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Nu(e,t){if(xi(t))ji(e),e._startTagOutsideForeignContent(t);else{let r=e._getAdjustedCurrentElement(),n=e.treeAdapter.getNamespaceURI(r);n===I.MATHML?_n(t):n===I.SVG&&(Si(t),vn(t)),Ir(t),t.selfClosing?e._appendElement(t,n):e._insertElement(t,n),t.ackSelfClosing=!0}}function Ru(e,t){if(t.tagID===a.P||t.tagID===a.BR){ji(e),e._endTagOutsideForeignContent(t);return}for(let r=e.openElements.stackTop;r>0;r--){let n=e.openElements.items[r];if(e.treeAdapter.getNamespaceURI(n)===I.HTML){e._endTagOutsideForeignContent(t);break}let s=e.treeAdapter.getTagName(n);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(r);break}}}var Gm=new Set([E.AREA,E.BASE,E.BASEFONT,E.BGSOUND,E.BR,E.COL,E.EMBED,E.FRAME,E.HR,E.IMG,E.INPUT,E.KEYGEN,E.LINK,E.META,E.PARAM,E.SOURCE,E.TRACK,E.WBR]);function Vi(e,t){return Bt.parse(e,t)}function oe(e,t){return e.attrs?.find(r=>r.name.toLowerCase()===t.toLowerCase())?.value??null}function Mn(e){return e.nodeName==="#text"?e.value??"":(e.childNodes??[]).map(Mn).join("")}function xe(e){return e?.replace(/\s+/g," ").trim()||null}function Un(e){let t=Vi(e),r={title:null,description:null,canonical:null,baseHref:null,robots:null,lang:null,h1Count:0,openGraph:{title:null,description:null,image:null},twitter:{card:null,title:null,description:null,image:null},hreflang:[],jsonLd:[],images:[],links:[],wordCount:0,visibleText:""},n=[];function s(i,o=!1){let d=i.tagName?.toLowerCase(),l=o||d==="script"||d==="style"||d==="noscript"||d==="template";if(i.nodeName==="#text"&&!l){let c=xe(i.value);c&&n.push(c)}if(d==="html"&&r.lang===null&&(r.lang=xe(oe(i,"lang"))),d==="title"&&r.title===null&&(r.title=xe(Mn(i))),d==="h1"&&(r.h1Count+=1),d==="meta"){let c=oe(i,"name")?.toLowerCase(),m=oe(i,"property")?.toLowerCase(),A=xe(oe(i,"content"));c==="description"&&r.description===null?r.description=A:c==="robots"&&A?r.robots=r.robots?`${r.robots}, ${A}`:A:m==="og:title"&&r.openGraph.title===null?r.openGraph.title=A:m==="og:description"&&r.openGraph.description===null?r.openGraph.description=A:m==="og:image"&&r.openGraph.image===null?r.openGraph.image=A:c==="twitter:card"&&r.twitter.card===null?r.twitter.card=A:c==="twitter:title"&&r.twitter.title===null?r.twitter.title=A:c==="twitter:description"&&r.twitter.description===null?r.twitter.description=A:c==="twitter:image"&&r.twitter.image===null&&(r.twitter.image=A)}if(d==="base"&&r.baseHref===null&&(r.baseHref=oe(i,"href")),d==="link"){let c=oe(i,"rel")?.toLowerCase().split(/\s+/).filter(Boolean)??[];if(c.includes("canonical")&&r.canonical===null&&(r.canonical=xe(oe(i,"href"))),c.includes("alternate")){let m=xe(oe(i,"hreflang")),A=xe(oe(i,"href"));m&&A&&r.hreflang.push({lang:m,url:A})}}if(d==="a"){let c=oe(i,"href");c&&r.links.push(c)}if(d==="img"&&r.images.push({src:xe(oe(i,"src")),alt:oe(i,"alt")}),d==="script"&&oe(i,"type")?.toLowerCase()==="application/ld+json"){let c=Mn(i).trim();if(c)try{r.jsonLd.push({valid:!0,value:JSON.parse(c)})}catch(m){r.jsonLd.push({valid:!1,error:m instanceof Error?m.message:String(m)})}}for(let c of i.childNodes??[])s(c,l)}return s(t),r.visibleText=n.join(" "),r.wordCount=r.visibleText?r.visibleText.split(/\s+/u).length:0,r}function _u(e,t){return{url:e,finalUrl:null,status:null,contentType:null,blockedByRobots:!1,error:null,title:null,description:null,canonical:null,canonicalRaw:null,robots:null,xRobotsTag:null,lang:null,h1Count:0,openGraph:{title:null,description:null,image:null},twitter:{card:null,title:null,description:null,image:null},hreflang:[],jsonLd:[],images:[],links:[],internalLinks:[],externalLinks:[],wordCount:0,contentHash:null,depth:t,redirectChain:[],responseBytes:0}}async function it(e,t){await e.onEvent?.(t)}async function vu(e,t,r,n,s){let i=_u(e,t);if(n.respectRobots&&!Ss(e,s))return i.blockedByRobots=!0,i;try{if(n.renderer){n.signal?.throwIfAborted(),await n.requestGate(e);let S=await n.renderer.render({url:e,timeout:n.timeout,maxResponseBytes:n.maxResponseBytes,userAgent:n.userAgent,...n.signal?{signal:n.signal}:{}});return Lu(i,S,e,r,n.includeQuery)}let{response:o,redirectChain:d}=await Oe(e,{headers:{accept:"text/html,application/xhtml+xml;q=0.9,*/*;q=0.1","user-agent":n.userAgent}},{...n,gate:n.requestGate,onEvent:n.onEvent}),l=o.headers.get("content-type")??"",c=l.includes("text/html")||l.includes("application/xhtml+xml"),m=G(o.url,void 0,{includeQuery:n.includeQuery});if(i.finalUrl=m,i.status=o.status,i.contentType=l||null,i.xRobotsTag=o.headers.get("x-robots-tag"),i.redirectChain=d,!c)return await o.body?.cancel(),i;let{text:A,bytes:h}=await De(o,n.maxResponseBytes),f=Un(A),b=Zi(f.baseHref,o.url||e),y=f.canonical?G(f.canonical,b,{includeQuery:!0}):null,C=[...new Set(f.links.map(S=>G(S,b,{includeQuery:n.includeQuery})).filter(S=>!!S))].sort(),R=f.hreflang.map(S=>({lang:S.lang,url:G(S.url,b,{includeQuery:!0})}));return Object.assign(i,{...f,visibleText:void 0,baseHref:void 0,canonical:y,canonicalRaw:f.canonical,links:C,internalLinks:C.filter(S=>ue(S,r)),externalLinks:C.filter(S=>!ue(S,r)),hreflang:R,contentHash:f.visibleText?Xi("sha256").update(f.visibleText.toLowerCase()).digest("hex"):null,responseBytes:h}),i}catch(o){if(n.signal?.aborted)throw o;return i.error=o instanceof Error?o.message:String(o),o instanceof Ee&&(i.redirectChain=o.redirectChain),i}}function Zi(e,t){if(e===null)return t;try{let r=new URL(e,t);return r.protocol==="data:"||r.protocol==="javascript:"?t:r.href}catch{return t}}function Lu(e,t,r,n,s){let i=t.headers["content-type"]??"text/html",o=G(t.finalUrl,void 0,{includeQuery:s});if(e.finalUrl=o,e.status=t.status,e.contentType=i,e.xRobotsTag=t.headers["x-robots-tag"]??null,e.redirectChain=t.redirectChain,!i.includes("text/html")&&!i.includes("application/xhtml+xml"))return e;let d=Un(t.html),l=Zi(d.baseHref,t.finalUrl||r),c=d.canonical?G(d.canonical,l,{includeQuery:!0}):null,m=[...new Set(d.links.map(A=>G(A,l,{includeQuery:s})).filter(A=>!!A))].sort();return Object.assign(e,{...d,visibleText:void 0,baseHref:void 0,canonical:c,canonicalRaw:d.canonical,links:m,internalLinks:m.filter(A=>ue(A,n)),externalLinks:m.filter(A=>!ue(A,n)),hreflang:d.hreflang.map(A=>({lang:A.lang,url:G(A.url,l,{includeQuery:!0})})),contentHash:d.visibleText?Xi("sha256").update(d.visibleText.toLowerCase()).digest("hex"):null,responseBytes:t.responseBytes}),e}function Ou(e={}){let t=e.requestDelay??e.delay??100,r=e.requestGate;return{...e,maxPages:e.maxPages??100,concurrency:Math.max(1,e.concurrency??5),timeout:e.timeout??1e4,includeQuery:e.includeQuery??!1,respectRobots:e.respectRobots??!0,sitemap:e.sitemap??null,sitemapData:e.sitemapData??null,userAgent:e.userAgent??_e,requestDelay:t,requestGate:r?async n=>r(n):Xe(t),maxRedirects:e.maxRedirects??10,maxResponseBytes:e.maxResponseBytes??5*1024*1024,retries:e.retries??2,fetch:e.fetch??globalThis.fetch,logger:e.logger??zt}}async function Du(e,t){let r=[],n=Array.from({length:e},async()=>{for(;;){let s=await t();if(s===null)return;r.push(s)}});return await Promise.all(n),r}async function $i(e,t={}){let r=Date.now(),n=Ou(t),s=G(e,void 0,{includeQuery:n.includeQuery});if(!s)throw new Error(`invalid start URL: ${e}`);let i=new URL(s).origin;await it(n,{type:"scan-start",url:s,total:n.maxPages});let o=t.robots??await er(s,n),d=n.sitemapData;if(!d&&n.sitemap)try{d=await ur(n.sitemap,{...n,maxUrls:t.sitemapMaxUrls??5e4,siteOrigin:i})}catch(_){d={url:n.sitemap,urls:[],sitemapCount:0,truncated:!1,error:_ instanceof Error?_.message:String(_)},n.logger.warn(`Could not load sitemap ${n.sitemap}: ${d.error}`)}let c=[...new Set([s,...d?.urls??[]])].slice(0,n.maxPages).map(_=>({url:_,depth:0})),m=new Set(c.map(_=>_.url)),A=new Map((t.cachedPages??[]).map(_=>[_.url,_])),h=new Map,f=Math.max(n.maxPages*10,n.maxPages),b=!1;for(;c.length>0&&h.size<n.maxPages&&!n.signal?.aborted;){c.sort((x,D)=>x.url.localeCompare(D.url));let _=n.maxPages-h.size,B=c.slice(0,_);c.length>B.length&&(b=!0);let v=0,M=await Du(n.concurrency,async()=>{if(n.signal?.aborted||v>=B.length)return null;let x=B[v++];if(!x)return null;let D=A.get(x.url);if(!D)try{D=await vu(x.url,x.depth,i,n,o)}catch(H){if(n.signal?.aborted)return null;throw H}return h.set(x.url,D),A.has(x.url)||(await t.onBatch?.([D]),await n.storage?.saveCheckpoint?.(s,D),await it(n,{type:"checkpoint",page:D,completed:h.size,total:n.maxPages})),t.onProgress?.(h.size,n.maxPages),await it(n,{type:"page",completed:h.size,total:n.maxPages,page:D}),await it(n,{type:"progress",completed:h.size,total:n.maxPages,page:D}),{item:x,page:D}}),O=new Map;for(let{item:x,page:D}of M.sort((H,Z)=>H.item.url.localeCompare(Z.item.url))){let H=D.internalLinks?.length?D.internalLinks:(D.links??[]).filter(Z=>ue(Z,i));for(let Z of[...H].sort())m.size>=f||m.has(Z)||!lr(Z)||(m.add(Z),O.set(Z,{url:Z,depth:x.depth+1}))}c=[...O.values()]}let y=[...h.values()].sort((_,B)=>_.url.localeCompare(B.url)),C=!!n.signal?.aborted,R=C||b||c.length>0||(d?d.urls.length>y.length:!1)||(d?.truncated??!1),S={startUrl:s,pages:y,robots:o,sitemap:d,truncated:R,partial:C,durationMs:Date.now()-r,options:n};return S.snapshot=ye(S),C||await n.storage?.removeCheckpoint?.(s),C?await it(n,{type:"cancelled",completed:y.length,total:n.maxPages,partial:!0}):await it(n,{type:"complete",completed:y.length,total:n.maxPages}),S}function qi(e){return"planVersion"in e}function ku(e,t){return{schemaVersion:2,pageSchemaVersion:1,siteUrl:e.startUrl,sitemapUrl:e.sitemap?.url??null,includeQuery:e.config.includeQuery,respectRobots:e.config.respectRobots,timeout:e.config.timeout,maxRedirects:e.config.maxRedirects,maxResponseBytes:e.config.maxResponseBytes,userAgent:e.userAgent,...t?{rendererId:t}:{}}}function Bu(e){return!e.error&&(e.status===null||e.status<500)}async function at(e,t={}){let r=null,n=null,s;try{s=qi(e)?e:await Ae(e,{...t,async onEvent(f){f.type==="robots"&&(r=f.robots),f.type==="sitemap"&&(n=f.sitemap),await t.onEvent?.(f)}})}catch(f){if(qi(e)||!t.signal?.aborted)throw f;let b=be(e),y=G(b.url,void 0,{includeQuery:b.includeQuery});if(!y)throw new Error(`invalid start URL: ${b.url}`,{cause:f});let C=r??{url:new URL("/robots.txt",y).href,status:null,sha256:null,error:"Scan cancelled before robots.txt planning completed",denyAll:!1},R=ye({startUrl:y,pages:[],robots:C,sitemap:n,options:b,partial:!0,truncated:!0});return await t.checkpointStore?.flush?.(),await t.onEvent?.({type:"cancelled",completed:0,total:b.maxPages,partial:!0}),{snapshot:R,startUrl:y,pages:[],robots:C,sitemap:n,truncated:!0,partial:!0,durationMs:0,options:b}}if(s.planVersion!==1)throw new Error(`unsupported scan plan version: ${String(s.planVersion)}`);let i=t.limit??s.config.maxPages;if(!Number.isInteger(i)||i<=0)throw new Error("scan limit must be a positive integer");let o={...s.config,maxPages:i},d=Xe(o.delay),l=ku(s,t.renderer?.id),c=t.checkpointStore&&t.resume!==!1?await t.checkpointStore.load(l):null,m=[...t.cachedPages??[],...c?.pages.filter(Bu)??[]],A=[...new Map(m.map(f=>[f.url,f])).values()];A.length>0&&await t.onEvent?.({type:"resume",completed:A.length,total:i});let h=await $i(s.startUrl,{...t,maxPages:i,concurrency:o.concurrency,requestDelay:o.delay,timeout:o.timeout,respectRobots:o.respectRobots,includeQuery:o.includeQuery,maxRedirects:o.maxRedirects,maxResponseBytes:o.maxResponseBytes,enabledRules:o.enabledRules,severityOverrides:o.severityOverrides,suppressions:o.suppressions,regressionBudgets:o.regressionBudgets,report:o.report,requestGate:d,robots:s.robots,sitemap:s.sitemap?.url??null,sitemapData:s.sitemap,userAgent:s.userAgent,cachedPages:A,async onBatch(f){for(let b of f)await t.checkpointStore?.append(l,b);await t.onBatch?.(f)}});return await t.checkpointStore?.flush?.(),!h.partial&&!t.retainCheckpoint&&await t.checkpointStore?.clear(l),h}function zi(e){return/^\d+$/.test(e)?":id":/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)?":uuid":/^\d{4}-\d{2}-\d{2}$/.test(e)?":date":/^[0-9a-f]{16,}$/i.test(e)?":hash":null}function Pu(e){return e.flatMap(t=>{try{let r=new URL(t.url);return[{issue:t,url:r,segments:r.pathname.split("/").filter(Boolean)}]}catch{return[]}})}function Mu(e){let t=new Map;for(let r of e)for(let n=1;n<r.segments.length;n+=1){if(zi(r.segments[n]))continue;let s=r.segments.slice(0,n).join("/"),i=`${r.url.origin}|${r.segments.length}|${n}|${s}`,o=t.get(i)??new Set;o.add(r.segments[n]),t.set(i,o)}return new Set([...t].filter(([,r])=>r.size>=2).map(([r])=>r))}function Uu(e,t){let r=e.segments.map((n,s)=>{let i=zi(n);if(i)return i;let o=e.segments.slice(0,s).join("/"),d=`${e.url.origin}|${e.segments.length}|${s}|${o}`;return s>0&&t.has(d)?":slug":n});return`/${r.join("/")}${e.url.pathname.endsWith("/")&&r.length>0?"/":""}`}function Ge(e){return vr(e.map(t=>({url:t,ruleId:"",severity:"info",owner:"seo"}))).map(({origin:t,template:r,urls:n})=>({origin:t,template:r,urls:n}))}function vr(e){let t=Pu(e),r=Mu(t),n=new Map;for(let s of t){let i=Uu(s,r),o=`${s.url.origin}${i}`,d=n.get(o)??{origin:s.url.origin,template:i,issues:[],urls:new Set};d.issues.push(s.issue),d.urls.add(s.issue.url),n.set(o,d)}return[...n.values()].map(s=>{let i={error:0,warning:0,info:0},o={},d={};for(let c of s.issues)i[c.severity]+=1,o[c.ruleId]=(o[c.ruleId]??0)+1,d[c.owner]=(d[c.owner]??0)+1;let l=[...s.urls].sort();return{origin:s.origin,template:s.template,issueCount:s.issues.length,affectedPages:l.length,severities:i,rules:o,owners:d,urls:l,representativeUrls:l.slice(0,3)}}).sort((s,i)=>i.issueCount-s.issueCount||s.template.localeCompare(i.template)||s.origin.localeCompare(i.origin))}function ea(e){let t=e.replaceAll("-"," ");return t.charAt(0).toUpperCase()+t.slice(1)}var Fu={"page-unreachable":"\u041D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430","http-error":"HTTP-\u043F\u043E\u043C\u0438\u043B\u043A\u0430",noindex:"Noindex","x-robots-noindex":"Noindex \u0443 X-Robots-Tag","robots-blocked":"\u0417\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E robots.txt","missing-canonical":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 canonical","invalid-canonical":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 canonical","cross-domain-canonical":"Canonical \u043D\u0430 \u0456\u043D\u0448\u043E\u043C\u0443 \u0434\u043E\u043C\u0435\u043D\u0456","canonical-target-error":"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u0446\u0456\u043B\u0456 canonical","redirect-loop":"\u0426\u0438\u043A\u043B \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C","long-redirect-chain":"\u0414\u043E\u0432\u0433\u0438\u0439 \u043B\u0430\u043D\u0446\u044E\u0436\u043E\u043A \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C","sitemap-unavailable":"Sitemap \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439","noindex-in-sitemap":"Noindex \u0443 sitemap","redirect-in-sitemap":"\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0443 sitemap","missing-title":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 title","duplicate-title":"\u0414\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0438\u0439 title","pagination-title-duplicate":"\u041A\u0440\u0438\u0442\u0438\u0447\u043D\u0456 \u0434\u0443\u0431\u043B\u0456\u043A\u0430\u0442\u0438 title \u043F\u0430\u0433\u0456\u043D\u0430\u0446\u0456\u0457","near-duplicate-title":"\u0414\u0443\u0436\u0435 \u0441\u0445\u043E\u0436\u0456 title","title-length":"\u0414\u043E\u0432\u0436\u0438\u043D\u0430 title","missing-description":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 description","duplicate-description":"\u0414\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0438\u0439 description","description-length":"\u0414\u043E\u0432\u0436\u0438\u043D\u0430 description","missing-h1":"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 H1","broken-internal-link":"\u041D\u0435\u0440\u043E\u0431\u043E\u0447\u0435 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F","orphan-sitemap-page":"\u0406\u0437\u043E\u043B\u044C\u043E\u0432\u0430\u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 sitemap","crawlable-not-in-sitemap":"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u044F \u0443 sitemap","invalid-hreflang":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 hreflang","malformed-json-ld":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 JSON-LD","http-on-https-site":"HTTP URL \u043D\u0430 HTTPS-\u0441\u0430\u0439\u0442\u0456","invalid-language":"\u041D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0435 \u043E\u0433\u043E\u043B\u043E\u0448\u0435\u043D\u043D\u044F \u043C\u043E\u0432\u0438","duplicate-content":"\u0414\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442","multiple-h1":"\u041A\u0456\u043B\u044C\u043A\u0430 H1","missing-open-graph":"\u041D\u0435\u043F\u043E\u0432\u043D\u0456 Open Graph metadata","missing-twitter-metadata":"\u041D\u0435\u043F\u043E\u0432\u043D\u0456 Twitter metadata","image-missing-alt":"\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0431\u0435\u0437 alt","low-word-count":"\u041C\u0430\u043B\u043E \u0442\u0435\u043A\u0441\u0442\u0443","robots-changed":"robots.txt \u0437\u043C\u0456\u043D\u0435\u043D\u043E","page-missing":"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u043D\u0435 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E","status-regression":"\u0420\u0435\u0433\u0440\u0435\u0441\u0456\u044F HTTP-\u0441\u0442\u0430\u0442\u0443\u0441\u0443","new-noindex":"\u041D\u043E\u0432\u0438\u0439 noindex","title-removed":"Title \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","title-changed":"Title \u0437\u043C\u0456\u043D\u0435\u043D\u043E","description-removed":"Description \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","canonical-removed":"Canonical \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","canonical-changed":"Canonical \u0437\u043C\u0456\u043D\u0435\u043D\u043E","h1-removed":"H1 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E","redirect-changed":"\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0437\u043C\u0456\u043D\u0435\u043D\u043E","sitemap-url-count-drop":"\u0417\u043C\u0435\u043D\u0448\u0435\u043D\u043D\u044F URL \u0443 sitemap"},Hu={"page-unreachable":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0430\u0431\u043E \u043F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u043D\u0430 \u043D\u0435\u0457.","http-error":"\u041F\u043E\u0432\u0435\u0440\u043D\u0456\u0442\u044C \u0443\u0441\u043F\u0456\u0448\u043D\u0443 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C \u0430\u0431\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u0435 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F.",noindex:"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C noindex, \u044F\u043A\u0449\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0430\u0454 \u0437\u2019\u044F\u0432\u043B\u044F\u0442\u0438\u0441\u044F \u0432 \u043F\u043E\u0448\u0443\u043A\u0443.","x-robots-noindex":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C noindex \u0456\u0437 X-Robots-Tag, \u044F\u043A\u0449\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0430\u0454 \u0456\u043D\u0434\u0435\u043A\u0441\u0443\u0432\u0430\u0442\u0438\u0441\u044F.","robots-blocked":"\u0414\u043E\u0437\u0432\u043E\u043B\u044C\u0442\u0435 URL \u0443 robots.txt, \u044F\u043A\u0449\u043E \u0439\u043E\u0433\u043E \u043F\u043E\u0442\u0440\u0456\u0431\u043D\u043E \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u0442\u0438.","missing-canonical":"\u0412\u043A\u0430\u0436\u0456\u0442\u044C \u0431\u0430\u0436\u0430\u043D\u0438\u0439 canonical URL, \u044F\u043A\u0449\u043E \u043C\u043E\u0436\u043B\u0438\u0432\u0456 \u0434\u0443\u0431\u043B\u0456\u043A\u0430\u0442\u0438 \u0430\u0434\u0440\u0435\u0441\u0438.","invalid-canonical":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0430\u0431\u0441\u043E\u043B\u044E\u0442\u043D\u0438\u0439 \u0430\u0431\u043E \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 \u0432\u0456\u0434\u043D\u043E\u0441\u043D\u0438\u0439 HTTP(S) canonical URL.","cross-domain-canonical":"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u0437\u043E\u0432\u043D\u0456\u0448\u043D\u0456\u0439 canonical \u0430\u0431\u043E \u0432\u043A\u0430\u0436\u0456\u0442\u044C \u043F\u043E\u0442\u0440\u0456\u0431\u043D\u0438\u0439 URL \u0446\u044C\u043E\u0433\u043E \u0441\u0430\u0439\u0442\u0443.","canonical-target-error":"\u0421\u043F\u0440\u044F\u043C\u0443\u0439\u0442\u0435 canonical \u043D\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439 URL, \u0434\u043E\u0437\u0432\u043E\u043B\u0435\u043D\u0438\u0439 \u0434\u043B\u044F \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457.","redirect-loop":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u0446\u0438\u043A\u043B\u0456\u0447\u043D\u0438\u0439 \u043C\u0430\u0440\u0448\u0440\u0443\u0442 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C.","long-redirect-chain":"\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0439\u0442\u0435 \u043E\u0434\u0440\u0430\u0437\u0443 \u043D\u0430 \u043A\u0456\u043D\u0446\u0435\u0432\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.","sitemap-unavailable":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 \u0456 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439 XML sitemap.","noindex-in-sitemap":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C URL \u0456\u0437 sitemap \u0430\u0431\u043E \u0434\u043E\u0437\u0432\u043E\u043B\u044C\u0442\u0435 \u0439\u043E\u0433\u043E \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u044E.","redirect-in-sitemap":"\u0417\u0430\u043C\u0456\u043D\u0456\u0442\u044C URL \u0443 sitemap \u043D\u0430 \u0439\u043E\u0433\u043E \u043A\u0456\u043D\u0446\u0435\u0432\u0443 canonical-\u0430\u0434\u0440\u0435\u0441\u0443.","missing-title":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0443\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u0438\u0439 \u043E\u043F\u0438\u0441\u043E\u0432\u0438\u0439 HTML title.","duplicate-title":"\u041D\u0430\u043F\u0438\u0448\u0456\u0442\u044C title, \u044F\u043A\u0438\u0439 \u0443\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u043E \u043E\u043F\u0438\u0441\u0443\u0454 \u0446\u044E \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443.","pagination-title-duplicate":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0434\u043E title; \u0437\u0431\u0435\u0440\u0435\u0436\u0456\u0442\u044C \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0456 canonical \u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043F\u0440\u0438\u0447\u0438\u043D\u0443 \u0432\u0438\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044F \u0432 Search Console.","near-duplicate-title":"\u041F\u0435\u0440\u0435\u0433\u043B\u044F\u043D\u044C\u0442\u0435 \u0441\u0445\u043E\u0436\u0456 title \u0442\u0430 \u043D\u0430\u043C\u0456\u0440\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A. \u0421\u0445\u043E\u0436\u0456\u0441\u0442\u044C \u043D\u0435 \u0434\u043E\u0432\u043E\u0434\u0438\u0442\u044C \u0432\u0438\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044F \u0437 \u0456\u043D\u0434\u0435\u043A\u0441\u0443.","title-length":"\u0417\u0440\u043E\u0431\u0456\u0442\u044C title \u0441\u0442\u0438\u0441\u043B\u0438\u043C \u0456 \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0438\u043C, \u0437\u0430\u0437\u0432\u0438\u0447\u0430\u0439 10\u201360 \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432.","missing-description":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0439 meta description.","duplicate-description":"\u041D\u0430\u043F\u0438\u0448\u0456\u0442\u044C \u0443\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u0438\u0439 meta description \u0434\u043B\u044F \u0446\u0456\u0454\u0457 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438.","description-length":"\u0417\u0440\u043E\u0431\u0456\u0442\u044C description \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u043C \u0456 \u0437\u0430\u0437\u0432\u0438\u0447\u0430\u0439 \u0434\u043E\u0432\u0436\u0438\u043D\u043E\u044E 50\u2013160 \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432.","missing-h1":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u043E\u0434\u0438\u043D \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u043B\u0438\u0439 \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A.","broken-internal-link":"\u041E\u043D\u043E\u0432\u0456\u0442\u044C \u0430\u0431\u043E \u043F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u0447\u0438 \u0432\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0439\u043E\u0433\u043E \u0446\u0456\u043B\u044C.","orphan-sitemap-page":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0456 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0456\u0437 sitemap.","crawlable-not-in-sitemap":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0434\u043E sitemap \u0430\u0431\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u043E \u0432\u0438\u043A\u043B\u044E\u0447\u0456\u0442\u044C \u0457\u0457.","invalid-hreflang":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0456 \u043C\u043E\u0432\u043D\u0456 \u0442\u0435\u0433\u0438 \u0442\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 HTTP(S) alternate URL.","malformed-json-ld":"\u0412\u0438\u043F\u0440\u0430\u0432\u0442\u0435 JSON-\u0441\u0438\u043D\u0442\u0430\u043A\u0441\u0438\u0441 \u0443 \u0431\u043B\u043E\u0446\u0456 \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u043E\u0432\u0430\u043D\u0438\u0445 \u0434\u0430\u043D\u0438\u0445.","http-on-https-site":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0439\u0442\u0435 HTTPS \u0434\u043B\u044F \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456\u0445 URL \u0456 metadata.","invalid-language":"\u0412\u043A\u0430\u0436\u0456\u0442\u044C \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 \u043C\u043E\u0432\u043D\u0438\u0439 \u0442\u0435\u0433 BCP 47 \u0432 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456 html.","duplicate-content":"\u041E\u0431\u2019\u0454\u0434\u043D\u0430\u0439\u0442\u0435 \u0434\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0430\u0431\u043E \u0437\u0440\u043E\u0431\u0456\u0442\u044C \u0457\u0445\u043D\u0456\u0439 \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442 \u0432\u0456\u0434\u043C\u0456\u043D\u043D\u0438\u043C.","multiple-h1":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435, \u0447\u0438 \u043E\u0434\u0438\u043D \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 H1 \u043D\u0435 \u0437\u0440\u043E\u0431\u0438\u0442\u044C \u0456\u0454\u0440\u0430\u0440\u0445\u0456\u044E \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u043B\u0456\u0448\u043E\u044E.","missing-open-graph":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 Open Graph title, description \u0442\u0430 image \u0434\u043B\u044F \u043F\u043E\u0448\u0438\u0440\u0435\u043D\u043D\u044F \u0432 \u0441\u043E\u0446\u043C\u0435\u0440\u0435\u0436\u0430\u0445.","missing-twitter-metadata":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 Twitter card metadata, \u044F\u043A\u0449\u043E \u0432\u0430\u0436\u043B\u0438\u0432\u0456 \u0441\u043E\u0446\u0456\u0430\u043B\u044C\u043D\u0456 \u043F\u0440\u0435\u0432\u2019\u044E.","image-missing-alt":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0438\u0439 alt \u0430\u0431\u043E \u043F\u043E\u0440\u043E\u0436\u043D\u0456\u0439 alt \u0434\u043B\u044F \u0434\u0435\u043A\u043E\u0440\u0430\u0442\u0438\u0432\u043D\u0438\u0445 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u044C.","low-word-count":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435, \u0447\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u043E\u0441\u0442\u0430\u0442\u043D\u044C\u043E \u043A\u043E\u0440\u0438\u0441\u043D\u043E\u0433\u043E \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0433\u043E \u043A\u043E\u043D\u0442\u0435\u043D\u0442\u0443.","robots-changed":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u0437\u043C\u0456\u043D\u0443 robots.txt \u0456 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u0434\u043E\u0441\u0442\u0443\u043F \u0434\u043B\u044F \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u043D\u044F \u0437\u043C\u0456\u043D\u0435\u043D\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u043E.","page-missing":"\u0414\u043E\u0434\u0430\u0439\u0442\u0435 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0434\u043E \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438 \u0430\u0431\u043E \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u0457\u0457 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E \u0441\u0432\u0456\u0434\u043E\u043C\u043E.","status-regression":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044E \u0443\u0441\u043F\u0456\u0448\u043D\u0443 HTTP-\u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C.","new-noindex":"\u041F\u0440\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043D\u043E\u0432\u0438\u0439 noindex, \u044F\u043A\u0449\u043E \u0439\u043E\u0433\u043E \u043D\u0435 \u0434\u043E\u0434\u0430\u043D\u043E \u043D\u0430\u0432\u043C\u0438\u0441\u043D\u043E.","title-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0437\u043C\u0456\u0441\u0442\u043E\u0432\u043D\u0438\u0439 title.","title-changed":"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u0437\u043C\u0456\u043D\u0435\u043D\u0438\u0439 title.","description-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0439 meta description.","canonical-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C canonical.","canonical-changed":"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u043D\u043E\u0432\u0430 \u0446\u0456\u043B\u044C canonical \u0441\u0432\u0456\u0434\u043E\u043C\u0430 \u0439 \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0430.","h1-removed":"\u0412\u0456\u0434\u043D\u043E\u0432\u0456\u0442\u044C \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u043B\u0438\u0439 \u043E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A.","redirect-changed":"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435, \u0449\u043E \u043D\u043E\u0432\u0430 \u0446\u0456\u043B\u044C \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0441\u0432\u0456\u0434\u043E\u043C\u0430.","sitemap-url-count-drop":"\u0414\u043E\u0441\u043B\u0456\u0434\u0456\u0442\u044C \u0432\u0442\u0440\u0430\u0442\u0443 URL \u0443 sitemap \u0456 \u043F\u043E\u0432\u0435\u0440\u043D\u0456\u0442\u044C \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0434\u043B\u044F \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457."};function Qu(e){return e.evidence?.actual??e.after}function Yu(e,t){let r=Qu(e);switch(t){case"page-unreachable":case"redirect-loop":return`\u0417\u0430\u043F\u0438\u0442 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0432\u0441\u044F \u043F\u043E\u043C\u0438\u043B\u043A\u043E\u044E: ${String(r??"\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u0430 \u043F\u043E\u043C\u0438\u043B\u043A\u0430")}`;case"http-error":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043F\u043E\u0432\u0435\u0440\u043D\u0443\u043B\u0430 HTTP ${String(r??"\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u043E")}`;case"noindex":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u0438\u0440\u0435\u043A\u0442\u0438\u0432\u0443 noindex \u0443 meta";case"x-robots-noindex":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C noindex \u0443 X-Robots-Tag";case"robots-blocked":return e.before===!1?"\u0422\u0435\u043F\u0435\u0440 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0437\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E \u0447\u0435\u0440\u0435\u0437 robots.txt":"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0437\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E \u0447\u0435\u0440\u0435\u0437 robots.txt";case"missing-canonical":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0456\u0441\u0442\u0438\u0442\u044C canonical URL";case"invalid-canonical":return"Canonical URL \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439";case"cross-domain-canonical":return"Canonical \u0432\u043A\u0430\u0437\u0443\u0454 \u043D\u0430 \u0456\u043D\u0448\u0438\u0439 \u0434\u043E\u043C\u0435\u043D";case"canonical-target-error":return"\u0426\u0456\u043B\u044C canonical \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430";case"long-redirect-chain":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454 ${String(r??0)} \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044C`;case"sitemap-unavailable":return"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u043D\u0430\u043B\u0430\u0448\u0442\u043E\u0432\u0430\u043D\u0438\u0439 sitemap";case"noindex-in-sitemap":return"URL \u0456\u0437 sitemap \u043F\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 noindex";case"redirect-in-sitemap":return"URL \u0456\u0437 sitemap \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0454\u0442\u044C\u0441\u044F";case"missing-title":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0430\u0454 title";case"pagination-title-duplicate":return"\u041A\u0440\u0438\u0442\u0438\u0447\u043D\u0435 \u0434\u0443\u0431\u043B\u044E\u0432\u0430\u043D\u043D\u044F title \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u043F\u0430\u0433\u0456\u043D\u0430\u0446\u0456\u0457";case"near-duplicate-title":return"Title \u0434\u0443\u0436\u0435 \u0441\u0445\u043E\u0436\u0438\u0439 \u043D\u0430 \u0456\u043D\u0448\u0443 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0443 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443";case"duplicate-title":return"\u041A\u0456\u043B\u044C\u043A\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u043C\u0430\u044E\u0442\u044C \u043E\u0434\u043D\u0430\u043A\u043E\u0432\u0438\u0439 title";case"title-length":return`\u0414\u043E\u0432\u0436\u0438\u043D\u0430 title \u2014 ${String(r??0)} \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432`;case"missing-description":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0430\u0454 meta description";case"duplicate-description":return"\u041A\u0456\u043B\u044C\u043A\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u043C\u0430\u044E\u0442\u044C \u043E\u0434\u043D\u0430\u043A\u043E\u0432\u0438\u0439 meta description";case"description-length":return`\u0414\u043E\u0432\u0436\u0438\u043D\u0430 description \u2014 ${String(r??0)} \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432`;case"missing-h1":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043D\u0435 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430 H1";case"multiple-h1":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C H1 \u0443 \u043A\u0456\u043B\u044C\u043A\u043E\u0441\u0442\u0456: ${String(r??0)}`;case"broken-internal-link":return"\u0412\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u0432\u0435\u0434\u0435 \u043D\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0443 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443";case"orphan-sitemap-page":return"\u041D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u0456\u0437 sitemap \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456\u0445 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u044C";case"crawlable-not-in-sitemap":return"\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u0434\u043B\u044F \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u043D\u044F \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u044F \u0443 sitemap";case"invalid-hreflang":return"\u041E\u0433\u043E\u043B\u043E\u0448\u0435\u043D\u043D\u044F hreflang \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0435";case"malformed-json-ld":return"\u0411\u043B\u043E\u043A JSON-LD \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439 JSON";case"http-on-https-site":return"HTTPS-\u0441\u0430\u0439\u0442 \u043F\u043E\u0441\u0438\u043B\u0430\u0454\u0442\u044C\u0441\u044F \u043D\u0430 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456\u0439 HTTP URL";case"invalid-language":return"\u041E\u0433\u043E\u043B\u043E\u0448\u0435\u043D\u043D\u044F \u043C\u043E\u0432\u0438 HTML \u043D\u0435\u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0435";case"duplicate-content":return"\u041E\u0441\u043D\u043E\u0432\u043D\u0438\u0439 \u0442\u0435\u043A\u0441\u0442 \u0454 \u0442\u043E\u0447\u043D\u0438\u043C \u0434\u0443\u0431\u043B\u0435\u043C \u0456\u043D\u0448\u043E\u0457 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438";case"missing-open-graph":return"Open Graph metadata \u043D\u0435\u043F\u043E\u0432\u043D\u0456";case"missing-twitter-metadata":return"Twitter card metadata \u043D\u0435\u043F\u043E\u0432\u043D\u0456";case"image-missing-alt":return`${Array.isArray(r)?r.length:String(r??0)} \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u044C \u043D\u0435 \u043C\u0430\u044E\u0442\u044C \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 alt`;case"low-word-count":return`\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u043F\u0440\u0438\u0431\u043B\u0438\u0437\u043D\u043E ${String(r??0)} \u0432\u0438\u0434\u0438\u043C\u0438\u0445 \u0441\u043B\u0456\u0432`;case"robots-changed":return"\u0412\u043C\u0456\u0441\u0442 robots.txt \u0437\u043C\u0456\u043D\u0438\u0432\u0441\u044F";case"page-missing":return"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u043D\u0435 \u0431\u0443\u043B\u043E \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E";case"status-regression":return`HTTP-\u0441\u0442\u0430\u0442\u0443\u0441 \u043F\u043E\u0433\u0456\u0440\u0448\u0438\u0432\u0441\u044F \u0437 ${String(e.before??"\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u043E")} \u0434\u043E ${String(e.after??"\u0432\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439")}`;case"new-noindex":return"\u0422\u0435\u043F\u0435\u0440 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u0438\u0440\u0435\u043A\u0442\u0438\u0432\u0443 noindex";case"title-removed":return"Title \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"title-changed":return"Title \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0437\u043C\u0456\u043D\u0435\u043D\u043E";case"description-removed":return"Meta description \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"canonical-removed":return"Canonical URL \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"canonical-changed":return"Canonical URL \u0437\u043C\u0456\u043D\u0435\u043D\u043E";case"h1-removed":return"\u0423\u0441\u0456 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 H1 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E";case"redirect-changed":return"\u041A\u0456\u043D\u0446\u0435\u0432\u0438\u0439 URL \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044F \u0437\u043C\u0456\u043D\u0435\u043D\u043E";case"sitemap-url-count-drop":return`\u041A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C URL \u0443 sitemap \u0437\u043C\u0435\u043D\u0448\u0438\u043B\u0430\u0441\u044F \u043D\u0430 ${String((Number(e.before)||0)-(Number(e.after)||0))}`;default:return e.message??"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443 \u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u0443 \u043F\u043E\u0432\u0435\u0434\u0456\u043D\u043A\u0443."}}function ta(e,t){let r=e.remediation??"Review the finding and confirm the intended behavior.";return{en:{rule:ea(t),message:e.message??"",remediation:r},uk:{rule:Fu[t]??ea(t),message:Yu(e,t),remediation:Hu[t]??"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443 \u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044C\u0442\u0435 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u0443 \u043F\u043E\u0432\u0435\u0434\u0456\u043D\u043A\u0443."}}}var ra={en:{language:"Language",titles:{partial:"Partial SEO scan report",check:"SEO regression report",scan:"SEO baseline audit"},generated:"Generated",engine:"Engine",rules:"Rules",issueLifecycle:"Issue lifecycle",partialTitle:"Partial results.",partialMessage:"This report contains the pages saved so far. Run the same scan command again to resume without requesting them twice.",incompleteTitle:"Incomplete comparison.",incompleteMessage:"Regressions found on checked pages are shown, but unchecked pages are not marked missing or resolved.",previewTitle:"Preview deployment comparison.",production:"Production",preview:"Preview",cards:{pages:"Pages checked",error:"Errors",warning:"Warnings",info:"Info",affected:"Affected pages"},analytics:{title:"Issue statistics",hint:"Select a chart item to filter the issue table.",severity:"By severity",topRules:"Most frequent checks",owners:"By owner",lifecycle:"By lifecycle",templates:"Affected page templates",total:"Total issues",noData:"No issues to chart.",filterBy:"Filter by"},history:{title:"Local scan history",hint:"Issue trends from snapshots stored on this device.",chartLabel:"Issue trend across runs.",runs:"Runs",pages:"Latest pages",newIssues:"New issues",resolvedIssues:"Resolved issues",sitemapUrls:"Sitemap URLs",maxDepth:"Maximum crawl depth"},tabs:{current:"Current / all",new:"New",ongoing:"Ongoing",resolved:"Resolved",unchanged:"Unchanged"},filters:{search:"URL or text",searchPlaceholder:"URL, check, or message",severity:"Severity",rule:"Check",template:"Page template",owner:"Owner",rows:"Rows"},all:{severity:"All severities",rule:"All checks",template:"All templates",owner:"All owners"},severities:{error:"Error",warning:"Warning",info:"Info"},owners:{seo:"SEO",content:"Content",developer:"Developer"},rows:{100:"100 per page",250:"250 per page",500:"500 per page"},guide:{error:"Errors",errorText:"need attention first.",warning:"Warnings",warningText:"are important improvements.",info:"Info",infoText:"is useful context.",score:"No opaque SEO score is used."},exportCsv:"Export CSV",previous:"Previous",next:"Next",table:{severity:"Severity",lifecycle:"Lifecycle",ruleOwner:"Check / owner",page:"Page",finding:"What was found",change:"Change",before:"Before",evidence:"Evidence / after",remediation:"Remediation",fingerprint:"Fingerprint"},empty:{cleanTitle:"No SEO issues found",cleanMessage:"The scanned pages passed all current checks.",filteredTitle:"No matching issues",filteredMessage:"Try a different lifecycle tab or clear the selected filters.",clear:"Clear filters"},lifecycle:{current:"Current",new:"New",ongoing:"Ongoing",resolved:"Resolved",unchanged:"Unchanged"},notPresent:"Not present",page:"Page",of:"of",issue:"issue",issues:"issues",docs:"docs",footer:"Generated locally. No report data was uploaded."},uk:{language:"\u041C\u043E\u0432\u0430",titles:{partial:"\u0417\u0432\u0456\u0442 \u0447\u0430\u0441\u0442\u043A\u043E\u0432\u043E\u0433\u043E SEO-\u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u043D\u044F",check:"\u0417\u0432\u0456\u0442 \u043F\u0440\u043E SEO-\u0440\u0435\u0433\u0440\u0435\u0441\u0456\u0457",scan:"\u0411\u0430\u0437\u043E\u0432\u0438\u0439 SEO-\u0430\u0443\u0434\u0438\u0442"},generated:"\u0421\u0442\u0432\u043E\u0440\u0435\u043D\u043E",engine:"\u0420\u0443\u0448\u0456\u0439",rules:"\u041F\u0440\u0430\u0432\u0438\u043B\u0430",issueLifecycle:"\u0421\u0442\u0430\u043D\u0438 \u043F\u0440\u043E\u0431\u043B\u0435\u043C",partialTitle:"\u0427\u0430\u0441\u0442\u043A\u043E\u0432\u0456 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0438.",partialMessage:"\u0417\u0432\u0456\u0442 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0443\u0436\u0435 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438. \u0417\u0430\u043F\u0443\u0441\u0442\u0456\u0442\u044C \u0442\u0443 \u0441\u0430\u043C\u0443 \u043A\u043E\u043C\u0430\u043D\u0434\u0443 \u0449\u0435 \u0440\u0430\u0437, \u0449\u043E\u0431 \u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438 \u0431\u0435\u0437 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u0438\u0445 \u0437\u0430\u043F\u0438\u0442\u0456\u0432.",incompleteTitle:"\u041D\u0435\u043F\u043E\u0432\u043D\u0435 \u043F\u043E\u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F.",incompleteMessage:"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0440\u0435\u0433\u0440\u0435\u0441\u0456\u0457 \u043D\u0430 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0438\u0445 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430\u0445, \u0430\u043B\u0435 \u043D\u0435\u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u043D\u0435 \u043F\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u043E \u044F\u043A \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u0456 \u0447\u0438 \u0432\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0456.",previewTitle:"\u041F\u043E\u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F production \u0456 preview.",production:"Production",preview:"Preview",cards:{pages:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A",error:"\u041F\u043E\u043C\u0438\u043B\u043A\u0438",warning:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u0436\u0435\u043D\u043D\u044F",info:"\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F",affected:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0437 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430\u043C\u0438"},analytics:{title:"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C",hint:"\u041E\u0431\u0435\u0440\u0456\u0442\u044C \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0433\u0440\u0430\u0444\u0456\u043A\u0430, \u0449\u043E\u0431 \u0432\u0456\u0434\u0444\u0456\u043B\u044C\u0442\u0440\u0443\u0432\u0430\u0442\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044E \u043F\u0440\u043E\u0431\u043B\u0435\u043C.",severity:"\u0417\u0430 \u0432\u0430\u0436\u043B\u0438\u0432\u0456\u0441\u0442\u044E",topRules:"\u041D\u0430\u0439\u0447\u0430\u0441\u0442\u0456\u0448\u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438",owners:"\u0417\u0430 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0438\u043C\u0438",lifecycle:"\u0417\u0430 \u0441\u0442\u0430\u043D\u043E\u043C",templates:"\u0428\u0430\u0431\u043B\u043E\u043D\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0456\u0437 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430\u043C\u0438",total:"\u0423\u0441\u044C\u043E\u0433\u043E \u043F\u0440\u043E\u0431\u043B\u0435\u043C",noData:"\u041D\u0435\u043C\u0430\u0454 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0434\u043B\u044F \u0432\u0456\u0434\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F.",filterBy:"\u0424\u0456\u043B\u044C\u0442\u0440\u0443\u0432\u0430\u0442\u0438 \u0437\u0430"},history:{title:"\u041B\u043E\u043A\u0430\u043B\u044C\u043D\u0430 \u0456\u0441\u0442\u043E\u0440\u0456\u044F \u0441\u043A\u0430\u043D\u0443\u0432\u0430\u043D\u044C",hint:"\u0414\u0438\u043D\u0430\u043C\u0456\u043A\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0437\u0456 snapshot-\u0444\u0430\u0439\u043B\u0456\u0432, \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u0438\u0445 \u043D\u0430 \u0446\u044C\u043E\u043C\u0443 \u043F\u0440\u0438\u0441\u0442\u0440\u043E\u0457.",chartLabel:"\u0414\u0438\u043D\u0430\u043C\u0456\u043A\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0437\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u043C\u0438.",runs:"\u0417\u0430\u043F\u0443\u0441\u043A\u0438",pages:"\u0421\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0432\u043E\u0441\u0442\u0430\u043D\u043D\u0454",newIssues:"\u041D\u043E\u0432\u0456 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0438",resolvedIssues:"\u0412\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0456 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0438",sitemapUrls:"URL \u0443 sitemap",maxDepth:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430 \u0433\u043B\u0438\u0431\u0438\u043D\u0430"},tabs:{current:"\u041F\u043E\u0442\u043E\u0447\u043D\u0456 / \u0443\u0441\u0456",new:"\u041D\u043E\u0432\u0456",ongoing:"\u0422\u0440\u0438\u0432\u0430\u044E\u0442\u044C",resolved:"\u0412\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0456",unchanged:"\u0411\u0435\u0437 \u0437\u043C\u0456\u043D"},filters:{search:"URL \u0430\u0431\u043E \u0442\u0435\u043A\u0441\u0442",searchPlaceholder:"URL, \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430 \u0430\u0431\u043E \u043F\u043E\u0432\u0456\u0434\u043E\u043C\u043B\u0435\u043D\u043D\u044F",severity:"\u0412\u0430\u0436\u043B\u0438\u0432\u0456\u0441\u0442\u044C",rule:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430",template:"\u0428\u0430\u0431\u043B\u043E\u043D \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438",owner:"\u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0438\u0439",rows:"\u0420\u044F\u0434\u043A\u0438"},all:{severity:"\u0423\u0441\u0456 \u0440\u0456\u0432\u043D\u0456",rule:"\u0423\u0441\u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438",template:"\u0423\u0441\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438",owner:"\u0423\u0441\u0456 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0456"},severities:{error:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430",warning:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u0436\u0435\u043D\u043D\u044F",info:"\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F"},owners:{seo:"SEO",content:"\u041A\u043E\u043D\u0442\u0435\u043D\u0442",developer:"\u0420\u043E\u0437\u0440\u043E\u0431\u043D\u0438\u043A"},rows:{100:"100 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443",250:"250 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443",500:"500 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443"},guide:{error:"\u041F\u043E\u043C\u0438\u043B\u043A\u0438",errorText:"\u043F\u043E\u0442\u0440\u0435\u0431\u0443\u044E\u0442\u044C \u043F\u0435\u0440\u0448\u043E\u0447\u0435\u0440\u0433\u043E\u0432\u043E\u0457 \u0443\u0432\u0430\u0433\u0438.",warning:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u0436\u0435\u043D\u043D\u044F",warningText:"\u043F\u043E\u0437\u043D\u0430\u0447\u0430\u044E\u0442\u044C \u0432\u0430\u0436\u043B\u0438\u0432\u0456 \u043F\u043E\u043A\u0440\u0430\u0449\u0435\u043D\u043D\u044F.",info:"\u0406\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F",infoText:"\u0434\u0430\u0454 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442.",score:"\u041D\u0435\u043F\u0440\u043E\u0437\u043E\u0440\u0430 SEO-\u043E\u0446\u0456\u043D\u043A\u0430 \u043D\u0435 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454\u0442\u044C\u0441\u044F."},exportCsv:"\u0415\u043A\u0441\u043F\u043E\u0440\u0442 CSV",previous:"\u041D\u0430\u0437\u0430\u0434",next:"\u0414\u0430\u043B\u0456",table:{severity:"\u0412\u0430\u0436\u043B\u0438\u0432\u0456\u0441\u0442\u044C",lifecycle:"\u0421\u0442\u0430\u043D",ruleOwner:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430 / \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u043B\u044C\u043D\u0438\u0439",page:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430",finding:"\u0429\u043E \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E",change:"\u0417\u043C\u0456\u043D\u0430",before:"\u0411\u0443\u043B\u043E",evidence:"\u0414\u043E\u043A\u0430\u0437 / \u0441\u0442\u0430\u043B\u043E",remediation:"\u042F\u043A \u0432\u0438\u043F\u0440\u0430\u0432\u0438\u0442\u0438",fingerprint:"\u0412\u0456\u0434\u0431\u0438\u0442\u043E\u043A"},empty:{cleanTitle:"SEO-\u043F\u0440\u043E\u0431\u043B\u0435\u043C \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E",cleanMessage:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0456 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u043F\u0440\u043E\u0439\u0448\u043B\u0438 \u0432\u0441\u0456 \u0430\u043A\u0442\u0438\u0432\u043D\u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438.",filteredTitle:"\u0417\u0431\u0456\u0433\u0456\u0432 \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E",filteredMessage:"\u041E\u0431\u0435\u0440\u0456\u0442\u044C \u0456\u043D\u0448\u0438\u0439 \u0441\u0442\u0430\u043D \u0430\u0431\u043E \u043E\u0447\u0438\u0441\u0442\u044C\u0442\u0435 \u0444\u0456\u043B\u044C\u0442\u0440\u0438.",clear:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u0444\u0456\u043B\u044C\u0442\u0440\u0438"},lifecycle:{current:"\u041F\u043E\u0442\u043E\u0447\u043D\u0430",new:"\u041D\u043E\u0432\u0430",ongoing:"\u0422\u0440\u0438\u0432\u0430\u0454",resolved:"\u0412\u0438\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430",unchanged:"\u0411\u0435\u0437 \u0437\u043C\u0456\u043D"},notPresent:"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0454",page:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430",of:"\u0437",issue:"\u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430",issues:"\u043F\u0440\u043E\u0431\u043B\u0435\u043C",docs:"\u0434\u043E\u0432\u0456\u0434\u043A\u0430",footer:"\u0421\u0442\u0432\u043E\u0440\u0435\u043D\u043E \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u043E. \u0414\u0430\u043D\u0456 \u0437\u0432\u0456\u0442\u0443 \u043D\u0456\u043A\u0443\u0434\u0438 \u043D\u0435 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0443\u0432\u0430\u043B\u0438\u0441\u044F."}};var Fn="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QBMRXhpZgAATU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAgKADAAQAAAABAAAAgAAAAAD/wAARCACAAIADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQ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wq03wR4h8TeK3mF7qniO/muTNs2eRbSOXWBeT/Ecu38RA44r1eisKmHp1JxqTV3Hbyvod2GzLE4ehVw9Gdo1ElJd0ndL0vqeJ/Hz4f6t8SfBFv4d0RUN0NUs5i7sFWOEFklk5IzsRy2BycYFeoeGvD2meE9AsPDejx+XZ6dAkEQ7kL1ZvVnbLMe5JrcoqIYKlHESxSXvSSXyX9a/I6K2dYqrl1PK5S/dQlKSXnJJXfpbTtd9wooorqPJCiiigDy34x/DuD4meBb3QAqi/iH2nTpW42XUYO0E9lkBKN7HPatv4a6Dd+F/h94d8PX6CK6sNOghuEDBgswXLjI4OGJ5HBrt6K5VgqSxLxSXvNW+V7nrTzrFSy2OUylelGfOl2bVnbyfbvr1Z5RJ8KtMj+Ldt8VtPlFvP8AYZ7W+twnFxI6hElDZ+VgvDcHdgd859Xooq6OGp0eb2atzO79Xuznx2ZYnGKn9ZnzezioRv0im2l8ru1+mmyQUUUVucJ//9k=";var na=':root{--ink:#14243c;--ink-hover:#253d5f;--control-line:#7b889a;--muted:#536176;--paper:#fff;--wash:#f2f5f8;--line:#d9e0e7;--coral:#f05a40;--orange:#ffa36c;--focus:#b33420;--error:#b42318;--error-wash:#fff2f0;--warning:#945200;--warning-wash:#fff7e6;--info:#3152b7;--info-wash:#edf3ff;--success:#146c43;--success-wash:#edf8f1;--font-body:"Trebuchet MS",Arial,sans-serif;--font-heading:"Arial Rounded MT Bold","Trebuchet MS",Arial,sans-serif;--radius-control:8px;--radius-panel:12px;--radius-large:14px;--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:24px;--space-6:48px;--content-width:1280px;--gutter:48px;--gutter-small:22px}';function Lr(e,t){try{let r=new URL(e,t);return r.protocol!=="http:"&&r.protocol!=="https:"?null:(r.hash="",r.href)}catch{return null}}function sa(e){let t=new Map,r=new Map,n=new Map;for(let s of e){let i=Lr(s.url);i&&t.set(i,s),r.set(s.url,{incoming:[],broken:[],redirects:[]})}for(let s of e){let i=r.get(s.url),o=new Set(s.internalLinks.map(d=>Lr(d,s.finalUrl??s.url)));for(let d of o){if(!d||d===Lr(s.url)||d===Lr(s.finalUrl??s.url))continue;let l=t.get(d);if(!l)continue;let c=n.get(l.url)??new Set;c.add(s.url),n.set(l.url,c),!l.blockedByRobots&&(l.error||l.status!==null&&l.status>=400)&&i.broken.push(l.url),(l.redirectChain.length||l.finalUrl&&l.finalUrl!==l.url||l.status!==null&&l.status>=300&&l.status<400)&&i.redirects.push(l.url)}}for(let[s,i]of r)i.incoming=[...n.get(s)??[]].sort(),i.broken.sort(),i.redirects.sort();return r}var We=e=>String(e??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;"),F=(e,t)=>`<span class="locale-en">${We(e)}</span><span class="locale-uk">${We(t)}</span>`;function ia(e,t){let r=[...e].sort((n,s)=>s.counts.new+s.counts.resolved+s.counts.ongoing-(n.counts.new+n.counts.resolved+n.counts.ongoing)||n.id.localeCompare(s.id));return r.slice(0,20).map(n=>`<tr><td><button type="button" data-comparison-${t}="${We(n.id)}">${We(n.id)}</button></td><td>${n.counts.new}</td><td>${n.counts.ongoing}</td><td>${n.counts.resolved}</td><td>${n.affectedPages}</td></tr>`).join("")+(r.length>20?`<tr><td colspan="5">${F(`${r.length-20} more groups in the JSON summary`,`\u0429\u0435 ${r.length-20} \u0433\u0440\u0443\u043F \u0443 JSON-\u0437\u0432\u0435\u0434\u0435\u043D\u043D\u0456`)}</td></tr>`:"")}function aa(e){let t=e.coverage,r=e.warnings.length>0?`<p class="comparison-warning">${F("Comparison warnings","\u0417\u0430\u0441\u0442\u0435\u0440\u0435\u0436\u0435\u043D\u043D\u044F \u043F\u043E\u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F")}: ${We(e.warnings.join(", "))}</p>`:"",n=e.unverified.length>0?`<p class="comparison-warning">${e.unverified.length} ${F("apparent resolutions lack sufficient evidence and are not counted as resolved","\u043F\u043E\u0442\u0435\u043D\u0446\u0456\u0439\u043D\u0438\u0445 \u0432\u0438\u0440\u0456\u0448\u0435\u043D\u044C \u043D\u0435 \u043C\u0430\u044E\u0442\u044C \u0434\u043E\u0441\u0442\u0430\u0442\u043D\u0456\u0445 \u0434\u043E\u043A\u0430\u0437\u0456\u0432 \u0456 \u043D\u0435 \u0432\u0440\u0430\u0445\u043E\u0432\u0430\u043D\u0456 \u044F\u043A \u0432\u0438\u0440\u0456\u0448\u0435\u043D\u0456")}</p>`:"",s=`<thead><tr><th>${F("Group","\u0413\u0440\u0443\u043F\u0430")}</th><th>${F("New","\u041D\u043E\u0432\u0456")}</th><th>${F("Ongoing","\u0422\u0440\u0438\u0432\u0430\u044E\u0442\u044C")}</th><th>${F("Resolved","\u0412\u0438\u0440\u0456\u0448\u0435\u043D\u0456")}</th><th>${F("Pages","\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0438")}</th></tr></thead>`;return`<section id="local-comparison" class="analytics" aria-labelledby="local-comparison-title"><h2 id="local-comparison-title">${F("Local run comparison","\u041F\u043E\u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u0438\u0445 \u0437\u0430\u043F\u0443\u0441\u043A\u0456\u0432")}</h2>
11
11
  <div class="comparison-runs"><div><strong>${F("Before","\u0414\u043E")}</strong><time>${We(e.from.generatedAt)}</time><span>${e.from.pages} ${F("checked pages","\u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0438\u0445 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A")}</span></div><div><strong>${F("After","\u041F\u0456\u0441\u043B\u044F")}</strong><time>${We(e.to.generatedAt)}</time><span>${e.to.pages} ${F("checked pages","\u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0438\u0445 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A")}</span></div></div>
12
12
  <p>${F("Coverage","\u041E\u0445\u043E\u043F\u043B\u0435\u043D\u043D\u044F")}: ${t.common} ${F("common","\u0441\u043F\u0456\u043B\u044C\u043D\u0438\u0445")}, ${t.onlyBefore} ${F("only before","\u043B\u0438\u0448\u0435 \u0434\u043E")}, ${t.onlyAfter} ${F("only after","\u043B\u0438\u0448\u0435 \u043F\u0456\u0441\u043B\u044F")} \xB7 ${t.complete?F("complete","\u043F\u043E\u0432\u043D\u0435"):F("incomplete","\u043D\u0435\u043F\u043E\u0432\u043D\u0435")}</p>
13
13
  <div class="comparison-counts"><div><strong>${e.lifecycle.new}</strong>${F("New","\u041D\u043E\u0432\u0456")}</div><div><strong>${e.lifecycle.ongoing}</strong>${F("Ongoing","\u0422\u0440\u0438\u0432\u0430\u044E\u0442\u044C")}</div><div><strong>${e.lifecycle.resolved}</strong>${F("Resolved on checked pages","\u0412\u0438\u0440\u0456\u0448\u0435\u043D\u0456 \u043D\u0430 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u0438\u0445 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430\u0445")}</div><div><strong>${e.unverified.length}</strong>${F("Unverified","\u041D\u0435 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043E")}</div></div>
14
14
  ${r}${n}
15
- <div class="comparison-groups"><div><h3>${F("By rule","\u0417\u0430 \u043F\u0440\u0430\u0432\u0438\u043B\u043E\u043C")}</h3><div class="table-wrap"><table>${s}<tbody>${ta(e.byRule,"rule")}</tbody></table></div></div><div><h3>${F("By page template","\u0417\u0430 \u0448\u0430\u0431\u043B\u043E\u043D\u043E\u043C \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438")}</h3><div class="table-wrap"><table>${s}<tbody>${ta(e.byTemplate,"template")}</tbody></table></div></div></div>
15
+ <div class="comparison-groups"><div><h3>${F("By rule","\u0417\u0430 \u043F\u0440\u0430\u0432\u0438\u043B\u043E\u043C")}</h3><div class="table-wrap"><table>${s}<tbody>${ia(e.byRule,"rule")}</tbody></table></div></div><div><h3>${F("By page template","\u0417\u0430 \u0448\u0430\u0431\u043B\u043E\u043D\u043E\u043C \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438")}</h3><div class="table-wrap"><table>${s}<tbody>${ia(e.byTemplate,"template")}</tbody></table></div></div></div>
16
16
  <p class="meta">${F("Findings are re-evaluated with the selected current policy. A lower count is not proof of improvement when coverage differs.","\u041F\u0440\u043E\u0431\u043B\u0435\u043C\u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E \u043E\u0446\u0456\u043D\u0435\u043D\u043E \u0437\u0430 \u043F\u043E\u043B\u0456\u0442\u0438\u043A\u043E\u044E \u0432\u0438\u0431\u0440\u0430\u043D\u043E\u0433\u043E \u043F\u043E\u0442\u043E\u0447\u043D\u043E\u0433\u043E \u0437\u0430\u043F\u0443\u0441\u043A\u0443. \u041C\u0435\u043D\u0448\u0430 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u043D\u0435 \u0434\u043E\u0432\u043E\u0434\u0438\u0442\u044C \u043F\u043E\u043A\u0440\u0430\u0449\u0435\u043D\u043D\u044F, \u044F\u043A\u0449\u043E \u043E\u0445\u043E\u043F\u043B\u0435\u043D\u043D\u044F \u0440\u0456\u0437\u043D\u0438\u0442\u044C\u0441\u044F.")}</p>
17
- </section>`}var Uu="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%233157d5'/%3E%3Ccircle cx='27' cy='27' r='13' fill='none' stroke='white' stroke-width='6'/%3E%3Cpath d='m37 37 12 12' fill='none' stroke='white' stroke-linecap='round' stroke-width='6'/%3E%3Cpath d='m21 27 5 5 9-11' fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'/%3E%3C/svg%3E";function se(e){return String(e??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;")}function Fu(e){return JSON.stringify(e).replaceAll("<","\\u003c").replaceAll(">","\\u003e").replaceAll("&","\\u0026")}function Hu(e){let t=[],r=new Map,n=s=>{let i=r.get(s);if(i!==void 0)return i;let o=t.length;return t.push(s),r.set(s,o),o};return{strings:t,rows:e.map(s=>[s.fingerprint,n(s.ruleId),n(s.rule),n(s.severity),n(s.scope),s.url,s.message,s.evidence,n(s.owner),n(s.remediation),n(s.documentationUrl),s.before??null,s.after??null,n(s.lifecycle),n(s.template),n(s.localized.en.rule),s.localized.en.message,n(s.localized.en.remediation),n(s.localized.uk.rule),s.localized.uk.message,n(s.localized.uk.remediation),(s.before!==void 0?1:0)|(s.after!==void 0?2:0)])}}function Qu(){return'<svg class="logo product-mark" viewBox="0 0 64 64" role="img" aria-label="SEO Crawl Audit logo"><rect width="64" height="64" rx="16" fill="var(--accent)"/><circle cx="27" cy="27" r="13" fill="none" stroke="#fff" stroke-width="6"/><path d="m37 37 12 12" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="6"/><path d="m21 27 5 5 9-11" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/></svg>'}function Ut(e,t="current"){let r=e.ruleId??e.rule??"unknown";return{fingerprint:e.fingerprint??"legacy",ruleId:r,rule:e.rule??e.ruleId??"unknown",severity:e.severity??"info",scope:e.scope??"page",url:e.url??"",message:e.message??"",evidence:e.evidence??{actual:e.after},owner:e.owner??"seo",remediation:e.remediation??"Review the finding and confirm the intended behavior.",documentationUrl:e.documentationUrl??"https://github.com/MelnixDev/seo-crawl-audit/blob/main/docs/rules.md",before:e.before,after:e.after,lifecycle:e.lifecycle??t,template:"",localized:zi(e,r)}}function Un(e,t){return e.reduce((r,n)=>{let s=String(n[t]);return r[s]=(r[s]??0)+1,r},{})}function Yu(e){if(e.blockedByRobots)return"blocked";if(e.error||e.status!==null&&e.status>=400)return"error";if(e.status===null)return"unknown";if(e.redirectChain.length>0||e.finalUrl!==null&&e.finalUrl!==e.url||e.status>=300)return"redirect";if(!e.contentType)return"unknown";if(!/(?:text\/html|application\/xhtml\+xml)/i.test(e.contentType))return"non-html";let t=`${e.robots??""},${e.xRobotsTag??""}`.toLowerCase();return/(^|[:,\s])(?:noindex|none)($|[:,\s])/.test(t)?"noindex":"allowed"}function Gu(e,t,r){let n=[],s=new Map,i=A=>{if(A===null||A==="")return null;let h=s.get(A);if(h!==void 0)return h;let f=n.length;return n.push(A),s.set(A,f),f},o=new Map;r.forEach((A,h)=>{if(A.scope!=="page"||A.lifecycle==="resolved")return;let f=o.get(A.url)??{indexes:[],error:0,warning:0,info:0};f.indexes.push(h),f[A.severity]+=1,o.set(A.url,f)});let d=t?.map(A=>({url:A.url}))??e??[],l=t?ea(t):null,c=Ge(d.map(A=>A.url)),m=new Map(c.flatMap((A,h)=>A.urls.map(f=>[f,h])));return{detailed:!!t,templates:c.map(({origin:A,template:h,urls:f})=>({label:A+h,count:f.length})),urls:n,pages:d.map((A,h)=>{let f=t?.[h]??null,b=o.get(A.url)??{indexes:[],error:0,warning:0,info:0};return{u:i(A.url),template:m.get(A.url)??null,f:i(f?.finalUrl??null),s:f?.status??null,ct:f?.contentType??null,b:f?.blockedByRobots??!1,e:f?.error??null,t:f?.title??null,d:f?.description??null,c:i(f?.canonical??null),cr:i(f?.canonicalRaw??null),r:f?.robots??null,xr:f?.xRobotsTag??null,l:f?.lang??null,h:f?.h1Count??null,w:f?.wordCount??null,z:f?.responseBytes??null,depth:f?.depth??null,incoming:l?.get(A.url)?.incoming.map(i)??null,broken:l?.get(A.url)?.broken.map(i)??null,redirects:l?.get(A.url)?.redirects.map(i)??null,ix:f?Yu(f):"unknown",il:f?.internalLinks.map(i)??[],el:f?.externalLinks.map(i)??[],rc:f?.redirectChain.map(y=>({u:i(y.url),s:y.status,l:i(y.location)}))??[],issues:b.indexes,counts:{error:b.error,warning:b.warning,info:b.info}}})}}function na(e,t={}){let r=e.mode??"scan",n=e.pages??[],s=(e.issues??[]).map(R=>Ut(R)),i=[...(e.newIssues??[]).map(R=>Ut(R,"new")),...(e.ongoingIssues??[]).map(R=>Ut(R,"ongoing")),...(e.resolvedIssues??[]).map(R=>Ut(R,"resolved")),...(e.unchangedIssues??[]).map(R=>Ut(R,"unchanged"))],o=i.length>0?i:s,d=e.comparison?.kind==="local",l=d?Ge([...(e.previousPages??[]).map(R=>R.url),...n.map(R=>R.url)]):null,c=Lr(o),m=new Map((l??c).flatMap(R=>R.urls.map(P=>[P,d?R.origin+R.template:R.template])));for(let R of o)R.template=m.get(R.url)??"";let A=new Map;if(d)for(let R of o){if(!R.template)continue;let P=A.get(R.template)??{count:0,urls:new Set};P.count+=1,P.urls.add(R.url),A.set(R.template,P)}let h=d?[...A].map(([R,P])=>({template:R,issueCount:P.count,affectedPages:P.urls.size})):c,f=o.reduce((R,P)=>(R[P.severity]+=1,R),{error:0,warning:0,info:0}),b=new Set(o.map(R=>R.url)).size,y=Un(o,"rule"),C={error:0,warning:1,info:2},N=new Map;for(let R of o.filter(P=>P.lifecycle!=="resolved")){let P=N.get(R.rule);P?(P.count+=1,P.urls.add(R.url),C[R.severity]<C[P.severity]&&(P.severity=R.severity)):N.set(R.rule,{rule:R.rule,severity:R.severity,owner:R.owner,count:1,urls:new Set([R.url])})}let S=[...N.values()].map(R=>({rule:R.rule,severity:R.severity,owner:R.owner,count:R.count,affectedPages:R.urls.size})).sort((R,P)=>C[R.severity]-C[P.severity]||P.affectedPages-R.affectedPages||P.count-R.count||R.rule.localeCompare(P.rule)).slice(0,5),_={total:o.length,pagesChecked:n.length,targetPages:e.targetPages??null,affectedPages:b,severity:f,rules:Object.entries(y).map(([R,P])=>({id:R,count:P})).sort((R,P)=>P.count-R.count||R.id.localeCompare(P.id)),owners:Un(o,"owner"),lifecycle:Un(o,"lifecycle"),templates:h.map(({template:R,issueCount:P,affectedPages:uo})=>({template:R,issueCount:P,affectedPages:uo})),priorities:S},B=e.partial??!1,L=B||e.complete===!1,M=r==="check"&&e.complete===!1,v=B?"Partial SEO scan report":r==="check"?"SEO regression report":"SEO baseline audit",x={...e.branding??{},...t.branding??{}},k=/^#[0-9a-f]{6}$/i.test(x.primaryColor??"")?x.primaryColor:"#3157d5",H=x.logo&&(/^data:image\//.test(x.logo)||/^https:\/\//.test(x.logo))?`<img class="logo" src="${se(x.logo)}" alt="${se(x.agencyName??"Report logo")}">`:Qu(),X=e.generatedAt??new Date().toISOString(),ao=e.startUrl??"",ds=e.targetPages??null,Vr=r==="check",oo=o.length>25e3,co=Gu(n,e.pageDetails,o),us=Hu(o),lo=Fu({mode:r,issueRows:us.rows,issueStrings:us.strings,statistics:_,pageExplorer:co,copy:qi,partial:B,incompleteComparison:M,comparison:e.comparison??null,history:e.history??null,siteMetrics:e.siteMetrics??null});return`<!doctype html>
17
+ </section>`}function se(e){return String(e??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;")}function Gu(e){return JSON.stringify(e).replaceAll("<","\\u003c").replaceAll(">","\\u003e").replaceAll("&","\\u0026")}function Wu(e){let t=[],r=new Map,n=s=>{let i=r.get(s);if(i!==void 0)return i;let o=t.length;return t.push(s),r.set(s,o),o};return{strings:t,rows:e.map(s=>[s.fingerprint,n(s.ruleId),n(s.rule),n(s.severity),n(s.scope),s.url,s.message,s.evidence,n(s.owner),n(s.remediation),n(s.documentationUrl),s.before??null,s.after??null,n(s.lifecycle),n(s.template),n(s.localized.en.rule),s.localized.en.message,n(s.localized.en.remediation),n(s.localized.uk.rule),s.localized.uk.message,n(s.localized.uk.remediation),(s.before!==void 0?1:0)|(s.after!==void 0?2:0)])}}function Ku(){return`<img class="logo product-mark" src="${Fn}" width="52" height="52" alt="SEO Crawl Audit crab logo" aria-label="SEO Crawl Audit logo">`}function Ut(e,t="current"){let r=e.ruleId??e.rule??"unknown";return{fingerprint:e.fingerprint??"legacy",ruleId:r,rule:e.rule??e.ruleId??"unknown",severity:e.severity??"info",scope:e.scope??"page",url:e.url??"",message:e.message??"",evidence:e.evidence??{actual:e.after},owner:e.owner??"seo",remediation:e.remediation??"Review the finding and confirm the intended behavior.",documentationUrl:e.documentationUrl??"https://github.com/MelnixDev/seo-crawl-audit/blob/main/docs/rules.md",before:e.before,after:e.after,lifecycle:e.lifecycle??t,template:"",localized:ta(e,r)}}function Hn(e,t){return e.reduce((r,n)=>{let s=String(n[t]);return r[s]=(r[s]??0)+1,r},{})}function Ju(e){if(e.blockedByRobots)return"blocked";if(e.error||e.status!==null&&e.status>=400)return"error";if(e.status===null)return"unknown";if(e.redirectChain.length>0||e.finalUrl!==null&&e.finalUrl!==e.url||e.status>=300)return"redirect";if(!e.contentType)return"unknown";if(!/(?:text\/html|application\/xhtml\+xml)/i.test(e.contentType))return"non-html";let t=`${e.robots??""},${e.xRobotsTag??""}`.toLowerCase();return/(^|[:,\s])(?:noindex|none)($|[:,\s])/.test(t)?"noindex":"allowed"}function ju(e,t,r){let n=[],s=new Map,i=A=>{if(A===null||A==="")return null;let h=s.get(A);if(h!==void 0)return h;let f=n.length;return n.push(A),s.set(A,f),f},o=new Map;r.forEach((A,h)=>{if(A.scope!=="page"||A.lifecycle==="resolved")return;let f=o.get(A.url)??{indexes:[],error:0,warning:0,info:0};f.indexes.push(h),f[A.severity]+=1,o.set(A.url,f)});let d=t?.map(A=>({url:A.url}))??e??[],l=t?sa(t):null,c=Ge(d.map(A=>A.url)),m=new Map(c.flatMap((A,h)=>A.urls.map(f=>[f,h])));return{detailed:!!t,templates:c.map(({origin:A,template:h,urls:f})=>({label:A+h,count:f.length})),urls:n,pages:d.map((A,h)=>{let f=t?.[h]??null,b=o.get(A.url)??{indexes:[],error:0,warning:0,info:0};return{u:i(A.url),template:m.get(A.url)??null,f:i(f?.finalUrl??null),s:f?.status??null,ct:f?.contentType??null,b:f?.blockedByRobots??!1,e:f?.error??null,t:f?.title??null,d:f?.description??null,c:i(f?.canonical??null),cr:i(f?.canonicalRaw??null),r:f?.robots??null,xr:f?.xRobotsTag??null,l:f?.lang??null,h:f?.h1Count??null,w:f?.wordCount??null,z:f?.responseBytes??null,depth:f?.depth??null,incoming:l?.get(A.url)?.incoming.map(i)??null,broken:l?.get(A.url)?.broken.map(i)??null,redirects:l?.get(A.url)?.redirects.map(i)??null,ix:f?Ju(f):"unknown",il:f?.internalLinks.map(i)??[],el:f?.externalLinks.map(i)??[],rc:f?.redirectChain.map(y=>({u:i(y.url),s:y.status,l:i(y.location)}))??[],issues:b.indexes,counts:{error:b.error,warning:b.warning,info:b.info}}})}}function oa(e,t={}){let r=e.mode??"scan",n=e.pages??[],s=(e.issues??[]).map(N=>Ut(N)),i=[...(e.newIssues??[]).map(N=>Ut(N,"new")),...(e.ongoingIssues??[]).map(N=>Ut(N,"ongoing")),...(e.resolvedIssues??[]).map(N=>Ut(N,"resolved")),...(e.unchangedIssues??[]).map(N=>Ut(N,"unchanged"))],o=i.length>0?i:s,d=e.comparison?.kind==="local",l=d?Ge([...(e.previousPages??[]).map(N=>N.url),...n.map(N=>N.url)]):null,c=vr(o),m=new Map((l??c).flatMap(N=>N.urls.map(P=>[P,d?N.origin+N.template:N.template])));for(let N of o)N.template=m.get(N.url)??"";let A=new Map;if(d)for(let N of o){if(!N.template)continue;let P=A.get(N.template)??{count:0,urls:new Set};P.count+=1,P.urls.add(N.url),A.set(N.template,P)}let h=d?[...A].map(([N,P])=>({template:N,issueCount:P.count,affectedPages:P.urls.size})):c,f=o.reduce((N,P)=>(N[P.severity]+=1,N),{error:0,warning:0,info:0}),b=new Set(o.map(N=>N.url)).size,y=Hn(o,"rule"),C={error:0,warning:1,info:2},R=new Map;for(let N of o.filter(P=>P.lifecycle!=="resolved")){let P=R.get(N.rule);P?(P.count+=1,P.urls.add(N.url),C[N.severity]<C[P.severity]&&(P.severity=N.severity)):R.set(N.rule,{rule:N.rule,severity:N.severity,owner:N.owner,count:1,urls:new Set([N.url])})}let S=[...R.values()].map(N=>({rule:N.rule,severity:N.severity,owner:N.owner,count:N.count,affectedPages:N.urls.size})).sort((N,P)=>C[N.severity]-C[P.severity]||P.affectedPages-N.affectedPages||P.count-N.count||N.rule.localeCompare(P.rule)).slice(0,5),_={total:o.length,pagesChecked:n.length,targetPages:e.targetPages??null,affectedPages:b,severity:f,rules:Object.entries(y).map(([N,P])=>({id:N,count:P})).sort((N,P)=>P.count-N.count||N.id.localeCompare(P.id)),owners:Hn(o,"owner"),lifecycle:Hn(o,"lifecycle"),templates:h.map(({template:N,issueCount:P,affectedPages:Zr})=>({template:N,issueCount:P,affectedPages:Zr})),priorities:S},B=e.partial??!1,v=B||e.complete===!1,M=r==="check"&&e.complete===!1,O=B?"Partial SEO scan report":r==="check"?"SEO regression report":"SEO baseline audit",x={...e.branding??{},...t.branding??{}},D=/^#[0-9a-f]{6}$/i.test(x.primaryColor??"")?x.primaryColor:null,H=D??"var(--coral)",Z=D?.slice(1).match(/../g).map(N=>parseInt(N,16)/255).map(N=>N<=.04045?N/12.92:((N+.055)/1.055)**2.4).reduce((N,P,Zr)=>N+P*([.2126,.7152,.0722][Zr]??0),0),uo=Z===void 0?"var(--ink)":Z>=.179?"#000":"#fff",Ao=x.logo&&(/^data:image\//.test(x.logo)||/^https:\/\//.test(x.logo))?`<img class="logo" src="${se(x.logo)}" alt="${se(x.agencyName??"Report logo")}">`:Ku(),As=e.generatedAt??new Date().toISOString(),po=e.startUrl??"",ps=e.targetPages??null,Xr=r==="check",ho=o.length>25e3,go=ju(n,e.pageDetails,o),hs=Wu(o),mo=Gu({mode:r,issueRows:hs.rows,issueStrings:hs.strings,statistics:_,pageExplorer:go,copy:ra,partial:B,incompleteComparison:M,comparison:e.comparison??null,history:e.history??null,siteMetrics:e.siteMetrics??null});return`<!doctype html>
18
18
  <html lang="en">
19
19
  <head>
20
20
  <meta charset="utf-8">
21
21
  <meta name="viewport" content="width=device-width, initial-scale=1">
22
- <link rel="icon" href="${Uu}" type="image/svg+xml">
23
- <title>${se(v)} \xB7 SEO Crawl Audit</title>
22
+ <link rel="icon" href="${Fn}" type="image/jpeg">
23
+ <title>${se(O)} \xB7 SEO Crawl Audit</title>
24
24
  <style>
25
- :root { color-scheme: light; --bg:#f5f7fb; --surface:#fff; --muted:#64748b; --text:#172033; --line:#dbe2ea; --accent:${k}; --error:#b42318; --warning:#9a6700; --info:#175cd3; --chart-error:#d92d20; --chart-warning:#f79009; --chart-info:#2e90fa; --chart-resolved:#12b76a; }
26
- *{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}main{width:min(1600px,calc(100% - 32px));margin:32px auto 64px}header{display:flex;justify-content:space-between;gap:24px;margin-bottom:22px}.brand{display:flex;align-items:flex-start;gap:14px}.logo{width:52px;max-width:72px;height:52px;max-height:52px;object-fit:contain;flex:0 0 auto}.product-mark{filter:drop-shadow(0 8px 16px rgba(49,87,213,.2))}.eyebrow{color:var(--accent);font-weight:800;letter-spacing:.08em;text-transform:uppercase}h1{margin:4px 0 8px;font-size:clamp(27px,4vw,40px);line-height:1.1}.meta{color:var(--muted);overflow-wrap:anywhere}.header-meta{text-align:right}.language-control{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px}.language-control span{margin:0}.language-control select{width:auto;min-height:32px;padding:4px 28px 4px 8px}.notice{margin-bottom:18px;padding:12px 14px;border:1px solid #b2ccff;border-radius:12px;background:#eef4ff;color:#1849a9}.cards{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:12px;margin-bottom:18px}.card,.panel,.analytics{background:var(--surface);border:1px solid var(--line);box-shadow:0 12px 36px rgba(31,42,68,.07)}.card{padding:15px;border-radius:14px}.card strong{display:block;font-size:27px}.card span{color:var(--muted)}.error strong,.badge.error{color:var(--error)}.warning strong,.badge.warning{color:var(--warning)}.info strong,.badge.info{color:var(--info)}.analytics{margin-bottom:18px;padding:18px;border-radius:16px}.analytics-header{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:15px}.analytics h2,.analytics h3{margin:0}.analytics h2{font-size:20px}.analytics h3{font-size:14px}.analytics-grid{display:grid;grid-template-columns:repeat(4,minmax(240px,1fr));gap:14px}.chart-card{min-width:0;padding:15px;border:1px solid var(--line);border-radius:12px;background:#fbfcfe}.chart-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px}.chart-title span{color:var(--muted);font-size:12px}.severity-layout{display:grid;grid-template-columns:114px minmax(0,1fr);align-items:center;gap:12px}.donut{display:grid;width:112px;height:112px;padding:12px;border-radius:50%;background:#e2e8f0;place-items:center}.donut-inner{display:grid;width:100%;height:100%;border-radius:50%;background:var(--surface);place-content:center;text-align:center}.donut-inner strong{font-size:24px;line-height:1}.donut-inner span{max-width:76px;margin-top:5px;color:var(--muted);font-size:10px}.chart-list{display:grid;gap:7px}.chart-button{display:grid;width:100%;padding:6px 7px;border-color:transparent;background:transparent;text-align:left}.chart-button:hover,.chart-button:focus-visible{border-color:var(--line);background:#fff}.chart-button[aria-pressed="true"]{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}.chart-label{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}.chart-label-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chart-label strong{font-variant-numeric:tabular-nums}.chart-key{display:inline-block;width:9px;height:9px;margin-right:7px;border-radius:50%}.chart-key.error{background:var(--chart-error)}.chart-key.warning{background:var(--chart-warning)}.chart-key.info{background:var(--chart-info)}.chart-track{height:7px;margin-top:6px;overflow:hidden;border-radius:999px;background:#e8edf3}.chart-fill{display:block;height:100%;min-width:2px;border-radius:inherit;background:var(--accent)}.chart-fill.error{background:var(--chart-error)}.chart-fill.warning{background:var(--chart-warning)}.chart-fill.info{background:var(--chart-info)}.chart-fill.resolved{background:var(--chart-resolved)}.chart-empty{display:grid;min-height:126px;color:var(--muted);place-items:center;text-align:center}.panel{overflow:hidden;border-radius:16px}.tabs{display:flex;gap:6px;padding:12px 16px;border-bottom:1px solid var(--line);overflow:auto}.tabs button[aria-selected="true"]{background:var(--accent);border-color:var(--accent);color:#fff}.filters{display:grid;grid-template-columns:minmax(220px,2fr) repeat(5,minmax(125px,1fr));gap:10px;padding:15px;background:#f8fafc;border-bottom:1px solid var(--line)}label span{display:block;margin-bottom:4px}input,select,button{font:inherit}input,select{width:100%;min-height:40px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--text)}button{padding:7px 11px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--text);cursor:pointer}button:disabled{opacity:.45}.guide,.results-bar{display:flex;justify-content:space-between;gap:14px;padding:10px 16px;color:var(--muted);border-bottom:1px solid var(--line)}.actions,.pagination{display:flex;align-items:center;gap:8px}.table-wrap{overflow:auto}table{width:100%;min-width:1260px;border-collapse:collapse}th{position:sticky;top:0;background:#f8fafc;color:var(--muted);font-size:11px;letter-spacing:.05em;text-align:left;text-transform:uppercase}th,td{padding:11px 12px;border-top:1px solid var(--line);vertical-align:top}.badge{display:inline-flex;padding:3px 8px;border-radius:999px;background:#f1f5f9;font-size:11px;font-weight:800;text-transform:uppercase}.badge.resolved{color:#067647;background:#ecfdf3}a{color:var(--accent);text-decoration:none;overflow-wrap:anywhere}code{display:block;max-width:320px;white-space:pre-wrap;overflow-wrap:anywhere;color:#344054;font:11px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace}.remediation{max-width:260px}.fingerprint{font-size:10px;color:var(--muted)}.empty{padding:50px 20px;text-align:center;color:var(--muted)}.empty strong{display:block;color:var(--text);font-size:17px}.empty button{margin-top:14px}footer{margin-top:16px;color:var(--muted);text-align:center}
27
- .trend-layout{display:grid;grid-template-columns:minmax(0,3fr) minmax(220px,1fr);gap:18px;align-items:center}.trend-chart{width:100%;height:auto;min-height:220px;overflow:visible}.trend-grid{stroke:#dbe2ea;stroke-width:1}.trend-line{stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.trend-point{stroke:#fff;stroke-width:2}.trend-error{stroke:var(--chart-error);fill:var(--chart-error)}.trend-warning{stroke:var(--chart-warning);fill:var(--chart-warning)}.trend-info{stroke:var(--chart-info);fill:var(--chart-info)}.trend-chart .trend-line{fill:none}.trend-summary{display:grid;gap:9px}.trend-summary div{display:flex;justify-content:space-between;gap:12px;padding:9px 10px;border-radius:9px;background:#f8fafc}.trend-legend{display:flex;gap:14px;flex-wrap:wrap;margin-top:10px;color:var(--muted)}
28
- html[lang="en"] .locale-uk,html[lang="uk"] .locale-en{display:none}.comparison-runs,.comparison-counts,.comparison-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0}.comparison-runs>div,.comparison-counts>div{padding:12px;border:1px solid var(--line);border-radius:10px;background:#fbfcfe}.comparison-runs strong,.comparison-runs time,.comparison-runs span,.comparison-counts strong{display:block}.comparison-counts{grid-template-columns:repeat(4,minmax(0,1fr))}.comparison-counts strong{font-size:24px}.comparison-groups h3{margin:0 0 8px}.comparison-groups table{min-width:550px}.comparison-warning{padding:8px 10px;border-radius:8px;background:#fff7ed;color:#9a6700}
29
- .report-nav{display:flex;gap:8px;margin-bottom:18px;padding:7px;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:0 12px 36px rgba(31,42,68,.05)}.report-nav button{border-color:transparent;font-weight:700}.report-nav button[aria-selected="true"]{background:var(--accent);color:#fff}.priority-list{display:grid;grid-template-columns:repeat(5,minmax(170px,1fr));gap:10px}.priority-item{display:block;width:100%;padding:13px;border-color:var(--line);background:#fbfcfe;text-align:left}.priority-item:hover{border-color:var(--accent)}.priority-item strong,.priority-item span{display:block}.priority-item span{margin-top:5px;color:var(--muted);font-size:11px}
30
- .metrics-hero{display:grid;grid-template-columns:repeat(4,minmax(190px,1fr));gap:14px;margin-bottom:16px}.metric-card{position:relative;min-width:0;padding:16px;border:1px solid var(--line);border-radius:14px;background:#fbfcfe}.metric-card.featured{min-height:150px;padding:20px;background:linear-gradient(145deg,#fff 0%,#f7f9ff 100%);box-shadow:0 10px 28px rgba(31,42,68,.06);overflow:hidden}.metric-card.featured:before{position:absolute;inset:0 auto 0 0;width:4px;background:var(--accent);content:""}.metric-card.featured strong{font-size:34px}.metric-label{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#475467;font-weight:700}.metric-card strong{display:block;margin:7px 0;font-size:25px;line-height:1.15;overflow-wrap:anywhere}.metric-source,.metric-detail{color:var(--muted);font-size:11px}.metric-source a{color:inherit}.metric-detail{margin-top:7px}.metric-status{display:inline-flex;flex:0 0 auto;padding:2px 7px;border-radius:999px;background:#eef2ff;color:var(--accent);font-size:9px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}
31
- .metrics-insights{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:20px}.metric-insight{padding:17px;border:1px solid var(--line);border-radius:14px;background:#fbfcfe}.metric-insight-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:13px}.metric-insight h3{margin:0;font-size:15px}.metric-insight-head strong{font-size:22px}.coverage-track,.http-track{display:flex;height:12px;overflow:hidden;border-radius:999px;background:#e8edf3}.coverage-track span{background:var(--accent)}.http-track span{min-width:2px}.http-2xx{background:#12b76a}.http-3xx{background:#2e90fa}.http-4xx{background:#f79009}.http-5xx{background:#d92d20}.metric-legend{display:flex;flex-wrap:wrap;gap:8px 14px;margin-top:11px;color:var(--muted);font-size:11px}.metric-legend i{display:inline-block;width:8px;height:8px;margin-right:5px;border-radius:50%}
32
- .metrics-groups{display:grid;gap:16px}.metric-group{padding:17px;border:1px solid var(--line);border-radius:15px;background:#fff}.metric-group-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:13px}.metric-group-header h3{margin:0;font-size:16px}.metric-group-header p{max-width:620px;margin:2px 0 0;color:var(--muted);font-size:12px}.metric-group-count{color:var(--muted);font-size:11px;white-space:nowrap}.metrics-grid{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:11px}.metric-group .metric-card{background:#f8fafc;box-shadow:none}
33
- .pages-toolbar{display:grid;grid-template-columns:minmax(240px,2fr) repeat(4,minmax(130px,1fr));gap:10px;padding:15px;background:#f8fafc;border-bottom:1px solid var(--line)}.pages-table{min-width:1050px}.pages-table th button{padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:inherit;letter-spacing:inherit;text-transform:inherit}.pages-table tbody tr{cursor:pointer}.pages-table tbody tr:hover,.pages-table tbody tr:focus-within{background:#f8faff}.page-url-button{padding:0;border:0;background:transparent;color:var(--accent);text-align:left;overflow-wrap:anywhere}.issue-counts{display:flex;gap:5px;flex-wrap:wrap}.issue-pill{padding:2px 6px;border:0;border-radius:999px;background:#f1f5f9;font-size:10px;font-weight:800;cursor:pointer}.issue-pill.error{color:var(--error)}.issue-pill.warning{color:var(--warning)}.issue-pill.info{color:var(--info)}.indexability{display:inline-flex;padding:3px 7px;border-radius:999px;background:#eef2ff;color:#344054;font-size:10px;font-weight:700}.page-dialog-backdrop{position:fixed;z-index:50;inset:0;background:rgba(15,23,42,.35)}.page-dialog{position:fixed;z-index:51;inset:0 0 0 auto;width:min(680px,94vw);overflow:auto;padding:24px;background:#fff;box-shadow:-18px 0 50px rgba(15,23,42,.2)}.page-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.page-dialog-head h2{margin:0;overflow-wrap:anywhere}.detail-section{margin-top:22px}.detail-section h3{margin:0 0 10px}.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.detail-item{min-width:0;padding:10px;border-radius:9px;background:#f8fafc}.detail-item span,.detail-item strong{display:block}.detail-item span{color:var(--muted);font-size:11px}.detail-item strong{margin-top:3px;overflow-wrap:anywhere}.detail-list{display:grid;gap:7px;margin:0;padding:0;list-style:none}.detail-list li{padding:8px 10px;border-radius:8px;background:#f8fafc;overflow-wrap:anywhere}.detail-issue strong,.detail-issue span{display:block}.detail-issue span{margin-top:4px;color:var(--muted)}.pages-limited{margin:14px 16px}.pages-empty{padding:44px 20px;text-align:center;color:var(--muted)}
34
- @media(max-width:1100px){.analytics-grid{grid-template-columns:1fr 1fr}.priority-list{grid-template-columns:1fr 1fr}.trend-layout{grid-template-columns:1fr}.chart-card:last-child{grid-column:1/-1}.metrics-hero{grid-template-columns:repeat(2,1fr)}}
35
- @media(max-width:950px){main{width:calc(100% - 20px);margin-top:20px}header{display:block}.header-meta{text-align:left;margin-top:12px}.language-control{justify-content:flex-start}.cards{grid-template-columns:repeat(2,1fr)}.metrics-grid{grid-template-columns:repeat(2,1fr)}.metrics-insights{grid-template-columns:1fr}.analytics-header{align-items:flex-start;flex-direction:column}.analytics-grid{grid-template-columns:1fr}.chart-card:last-child{grid-column:auto}.filters,.pages-toolbar{grid-template-columns:1fr}.results-bar,.guide{align-items:flex-start;flex-direction:column}.detail-grid{grid-template-columns:1fr}}
36
- @media(max-width:430px){.severity-layout{grid-template-columns:1fr}.donut{margin:auto}.metrics-hero,.metrics-grid{grid-template-columns:1fr}.metric-group-header{display:block}.metric-group-count{display:block;margin-top:5px}}
37
- @media print{body{background:#fff}main{width:100%;margin:0}.filters,.tabs,.actions,.pagination,#clear-filters,.pages-toolbar,.report-nav,.page-dialog,.page-dialog-backdrop{display:none!important}.panel,.card,.analytics{box-shadow:none}.analytics-grid{grid-template-columns:1fr 1fr 1fr}.chart-button{padding:4px}.table-wrap{overflow:visible}table{min-width:0;font-size:9px}th{position:static}.remediation,code{max-width:none}a{color:#000}}
25
+ ${na}
26
+ :root{color-scheme:light;--s:var(--paper);--w:var(--wash);--i:var(--ink);--m:var(--muted);--l:var(--line);--r:var(--radius-control);--p:var(--radius-panel);--accent:${H};--accent-text:${uo};--chart-error:var(--error);--chart-warning:var(--warning);--chart-info:var(--info);--chart-resolved:var(--success)}
27
+ *{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;background:var(--s);color:var(--i);font:15px/1.6 var(--font-body)}main{max-width:var(--content-width);padding-inline:var(--gutter);margin:32px auto 64px}header{display:flex;justify-content:space-between;gap:24px;padding-bottom:24px;margin-bottom:24px;border-bottom:1px solid var(--l)}.brand{display:flex;align-items:flex-start;gap:14px;min-width:0}.logo{width:52px;max-width:72px;height:52px;max-height:52px;object-fit:contain;flex:0 0 auto}.product-mark{border-radius:var(--p)}.eyebrow{font-weight:800;letter-spacing:-.03em}h1,h2,h3{font-family:var(--font-heading);letter-spacing:-.035em;line-height:1.15}h1{margin:4px 0 10px;font-size:clamp(28px,4vw,40px)}.meta{color:var(--m);overflow-wrap:anywhere}.header-meta{text-align:right;font-size:13px}.language-control{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:12px}.language-control span{margin:0}.language-control select{width:auto;min-height:40px;padding:6px 28px 6px 10px}.notice{margin-bottom:24px;padding:16px 20px;border-left:4px solid var(--accent);background:var(--w);color:var(--i)}.cards{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:12px;margin-bottom:24px}.card,.panel,.analytics{background:var(--s);border:1px solid var(--l)}.card{padding:18px;border-radius:var(--r)}.card strong{display:block;font-size:28px;line-height:1.2;margin-bottom:8px;font-variant-numeric:tabular-nums}.card span{color:var(--m)}.error strong,.badge.error{color:var(--error)}.warning strong,.badge.warning{color:var(--warning)}.info strong,.badge.info{color:var(--info)}.analytics{margin-bottom:24px;padding:24px;border-radius:var(--p)}.analytics-header{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:20px}.analytics h2,.analytics h3{margin:0}.analytics h2{font-size:23px}.analytics h3{font-size:16px}.analytics-grid{display:grid;grid-template-columns:repeat(4,minmax(220px,1fr));gap:14px}.chart-card{min-width:0;padding:16px;border:1px solid var(--l);border-radius:var(--r);background:var(--w)}.chart-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px}.chart-title span{color:var(--m);font-size:12px}.severity-layout{display:grid;grid-template-columns:1fr;align-items:center;gap:12px}.severity-layout .donut{margin:auto}.donut{display:grid;width:112px;height:112px;padding:12px;border-radius:50%;background:var(--l);place-items:center}.donut-inner{display:grid;width:100%;height:100%;border-radius:50%;background:var(--s);place-content:center;text-align:center}.donut-inner strong{font-size:24px;line-height:1}.donut-inner span{max-width:76px;margin-top:5px;color:var(--m);font-size:11px}.chart-list{display:grid;gap:7px}.chart-button{display:grid;width:100%;min-height:0;padding:7px;border-color:transparent;background:transparent;text-align:left}.chart-button:hover{border-color:var(--l);background:var(--s)}.chart-button[aria-pressed="true"]{border-color:var(--i);background:var(--w)}.chart-label{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}.chart-label-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chart-label strong{font-variant-numeric:tabular-nums}.chart-key{display:inline-block;width:9px;height:9px;margin-right:7px;border-radius:50%}.chart-key.error{background:var(--chart-error)}.chart-key.warning{background:var(--chart-warning)}.chart-key.info{background:var(--chart-info)}.chart-track{height:7px;margin-top:6px;overflow:hidden;border-radius:999px;background:var(--w)}.chart-fill{display:block;height:100%;min-width:2px;border-radius:inherit;background:var(--accent)}.chart-fill.error{background:var(--chart-error)}.chart-fill.warning{background:var(--chart-warning)}.chart-fill.info{background:var(--chart-info)}.chart-fill.resolved{background:var(--chart-resolved)}.chart-empty{display:grid;min-height:126px;color:var(--m);place-items:center;text-align:center}.panel{overflow:hidden;border-radius:var(--p)}.tabs{display:flex;gap:8px;padding:14px 20px;border-bottom:1px solid var(--l);overflow:auto}.tabs button[aria-selected="true"]{background:var(--accent);border-color:var(--i);color:var(--accent-text)}.filters{display:grid;grid-template-columns:minmax(220px,2fr) repeat(5,minmax(125px,1fr));gap:12px;padding:20px;background:var(--w);border-bottom:1px solid var(--l)}label span{display:block;margin-bottom:6px;color:var(--m)}input,select,button{font:inherit}input,select{width:100%;min-height:44px;padding:9px 12px;border:1px solid var(--control-line);border-radius:var(--r);background:var(--s);color:var(--i)}button{min-height:40px;padding:8px 13px;border:1px solid var(--control-line);border-radius:var(--r);background:var(--s);color:var(--i);cursor:pointer}button:hover{border-color:var(--m)}button:disabled{opacity:.5;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:3px solid var(--focus);outline-offset:3px}.guide,.results-bar{display:flex;justify-content:space-between;gap:16px;padding:14px 20px;color:var(--m);border-bottom:1px solid var(--l)}.actions,.pagination{display:flex;align-items:center;gap:8px}.table-wrap{overflow:auto}table{width:100%;min-width:1260px;border-collapse:collapse}th{position:sticky;top:0;background:var(--w);color:var(--m);font-size:12px;font-weight:700;text-align:left}th,td{padding:13px 14px;border-top:1px solid var(--l);vertical-align:top}.badge{display:inline-flex;padding:4px 8px;border-radius:var(--r);background:var(--w);font-size:12px;font-weight:700}.badge.error{background:var(--error-wash)}.badge.warning{background:var(--warning-wash)}.badge.info{background:var(--info-wash)}.badge.resolved{color:var(--success);background:var(--success-wash)}a{color:var(--i);text-underline-offset:4px;overflow-wrap:anywhere}a:hover{text-decoration-thickness:2px}code{display:block;max-width:320px;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--i);font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace}.remediation{max-width:260px}.fingerprint{font-size:11px;color:var(--m)}.empty,.pages-empty{padding:48px 24px;text-align:center;color:var(--m)}.empty strong{display:block;color:var(--i);font-size:18px}.empty button{margin-top:16px}footer{margin-top:24px;padding-top:18px;border-top:1px solid var(--l);color:var(--m);font-size:13px;text-align:center}
28
+ .trend-layout{display:grid;grid-template-columns:minmax(0,3fr) minmax(220px,1fr);gap:24px;align-items:center}.trend-chart{width:100%;height:auto;min-height:220px;overflow:visible}.trend-grid{stroke:var(--l);stroke-width:1}.trend-line{stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.trend-point{stroke:var(--s);stroke-width:2}.trend-error{stroke:var(--chart-error);fill:var(--chart-error)}.trend-warning{stroke:var(--chart-warning);fill:var(--chart-warning)}.trend-info{stroke:var(--chart-info);fill:var(--chart-info)}.trend-chart .trend-line{fill:none}.trend-summary{display:grid;gap:9px}.trend-summary div{display:flex;justify-content:space-between;gap:12px;padding:12px;border-radius:var(--r);background:var(--w)}.trend-legend{display:flex;gap:14px;flex-wrap:wrap;margin-top:12px;color:var(--m)}
29
+ html[lang="en"] .locale-uk,html[lang="uk"] .locale-en{display:none}.comparison-runs,.comparison-counts,.comparison-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:16px 0}.comparison-runs>div,.comparison-counts>div{min-width:0;overflow-wrap:anywhere;padding:16px;border:1px solid var(--l);border-radius:var(--r);background:var(--w)}.comparison-runs strong,.comparison-runs time,.comparison-runs span,.comparison-counts strong{display:block}.comparison-counts{grid-template-columns:repeat(4,minmax(0,1fr))}.comparison-counts strong{font-size:25px}.comparison-groups>div{min-width:0}.comparison-groups h3{margin:0 0 12px}.comparison-groups table{min-width:550px}.comparison-warning{padding:12px 16px;border-left:4px solid var(--warning);background:var(--warning-wash);color:var(--warning)}
30
+ .report-nav{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:24px;padding-bottom:18px;border-bottom:1px solid var(--l)}.report-nav button{border-color:transparent;font-weight:700}.report-nav button[aria-selected="true"]{background:var(--accent);color:var(--accent-text);border-color:var(--i)}.priority-list{display:grid;grid-template-columns:repeat(5,minmax(170px,1fr));gap:12px}.priority-item{display:block;width:100%;padding:16px;border-color:var(--l);background:var(--w);text-align:left}.priority-item:hover{border-color:var(--accent)}.priority-item strong,.priority-item span{display:block}.priority-item span{margin-top:7px;color:var(--m);font-size:12px}
31
+ .metrics-hero{display:grid;grid-template-columns:repeat(4,minmax(190px,1fr));gap:14px;margin-bottom:20px}.metric-card{position:relative;min-width:0;padding:18px;border:1px solid var(--l);border-radius:var(--r);background:var(--w)}.metric-card.featured{min-height:150px;padding:20px;border-left:4px solid var(--accent);background:var(--s)}.metric-card.featured strong{font-size:34px}.metric-label{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--m);font-weight:700}.metric-card strong{display:block;margin:8px 0;font-size:26px;line-height:1.15;overflow-wrap:anywhere}.metric-source,.metric-detail{color:var(--m);font-size:12px}.metric-source a{color:inherit}.metric-detail{margin-top:8px}.metric-status{display:inline-flex;flex:0 0 auto;padding:3px 8px;border-radius:var(--r);background:var(--w);color:var(--i);font-size:11px;font-weight:700}
32
+ .metrics-insights{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:24px}.metric-insight{padding:20px;border:1px solid var(--l);border-radius:var(--p);background:var(--s)}.metric-insight-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px}.metric-insight h3{margin:0;font-size:17px}.metric-insight-head strong{font-size:23px}.coverage-track,.http-track{display:flex;height:12px;overflow:hidden;border-radius:999px;background:var(--w)}.coverage-track span{background:var(--accent)}.http-track span{min-width:2px}.http-2xx{background:var(--success)}.http-3xx{background:var(--info)}.http-4xx{background:var(--warning)}.http-5xx{background:var(--error)}.metric-legend{display:flex;flex-wrap:wrap;gap:8px 14px;margin-top:12px;color:var(--m);font-size:12px}.metric-legend i{display:inline-block;width:8px;height:8px;margin-right:5px;border-radius:50%}
33
+ .metrics-groups{display:grid;gap:18px}.metric-group{padding:20px;border:1px solid var(--l);border-radius:var(--p);background:var(--s)}.metric-group-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}.metric-group-header h3{margin:0;font-size:18px}.metric-group-header p{max-width:70ch;margin:5px 0 0;color:var(--m);font-size:13px}.metric-group-count{color:var(--m);font-size:12px;white-space:nowrap}.metrics-grid{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:12px}
34
+ .pages-toolbar{display:grid;grid-template-columns:minmax(240px,2fr) repeat(4,minmax(130px,1fr));gap:12px;padding:20px;background:var(--w);border-bottom:1px solid var(--l)}.pages-table{min-width:1050px}.pages-table th button{min-height:0;padding:0;border:0;background:transparent;color:inherit;font:inherit}.pages-table tbody tr{cursor:pointer}.pages-table tbody tr:hover,.pages-table tbody tr:focus-within{background:var(--w)}.page-url-button{min-height:0;padding:0;border:0;border-bottom:1px solid currentColor;border-radius:0;background:transparent;color:var(--i);text-align:left;overflow-wrap:anywhere}.issue-counts{display:flex;gap:6px;flex-wrap:wrap}.issue-pill{min-height:0;padding:3px 7px;border:0;border-radius:var(--r);background:var(--w);font-size:11px;font-weight:700;cursor:pointer}.issue-pill.error{color:var(--error);background:var(--error-wash)}.issue-pill.warning{color:var(--warning);background:var(--warning-wash)}.issue-pill.info{color:var(--info);background:var(--info-wash)}.indexability{display:inline-flex;padding:4px 8px;border-radius:var(--r);background:var(--w);color:var(--i);font-size:11px;font-weight:700}.page-dialog-backdrop{position:fixed;z-index:50;inset:0;background:rgba(20,36,60,.3)}.page-dialog{position:fixed;z-index:51;inset:0 0 0 auto;width:min(680px,94vw);overflow:auto;padding:24px;border-left:1px solid var(--l);background:var(--s)}.page-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.page-dialog-head h2{margin:0;overflow-wrap:anywhere}.detail-section{margin-top:24px}.detail-section h3{margin:0 0 12px}.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.detail-item{min-width:0;padding:12px;border-radius:var(--r);background:var(--w)}.detail-item span,.detail-item strong{display:block}.detail-item span{color:var(--m);font-size:12px}.detail-item strong{margin-top:4px;overflow-wrap:anywhere}.detail-list{display:grid;gap:8px;margin:0;padding:0;list-style:none}.detail-list li{padding:10px 12px;border-radius:var(--r);background:var(--w);overflow-wrap:anywhere}.detail-issue strong,.detail-issue span{display:block}.detail-issue span{margin-top:5px;color:var(--m)}.pages-limited{margin:16px 20px}
35
+ @media(max-width:1100px){.severity-layout{grid-template-columns:114px minmax(0,1fr)}.analytics-grid,.priority-list,.metrics-hero{grid-template-columns:1fr 1fr}.trend-layout{grid-template-columns:1fr}.filters,.pages-toolbar{grid-template-columns:1fr 1fr}.filters label:first-child,.pages-toolbar label:first-child{grid-column:1/-1}}
36
+ @media(max-width:950px){main{padding-inline:30px}.cards{grid-template-columns:repeat(2,1fr)}.metrics-grid{grid-template-columns:repeat(2,1fr)}.analytics-header{align-items:flex-start;flex-direction:column}}
37
+ @media(max-width:700px){main{padding-inline:var(--gutter-small);margin-top:24px}header{display:block}.header-meta{text-align:left;margin-top:16px}.language-control{justify-content:flex-start}.analytics{padding:18px}.analytics-grid,.priority-list,.metrics-insights,.comparison-runs,.comparison-groups,.detail-grid{grid-template-columns:1fr}.guide,.results-bar{align-items:flex-start;flex-direction:column}.actions,.pagination{flex-wrap:wrap}.comparison-counts{grid-template-columns:1fr 1fr}.report-nav{gap:6px}.report-nav button{min-height:44px}.page-dialog{padding:22px}}
38
+ @media(max-width:430px){.severity-layout{grid-template-columns:1fr}.donut{margin:auto}.filters,.pages-toolbar,.metrics-hero,.metrics-grid{grid-template-columns:1fr}.metric-group-header{display:block}.metric-group-count{display:block;margin-top:6px}}
39
+ button{transition:background-color .16s,border-color .16s}input:hover,select:hover{border-color:var(--i)}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
40
+ @media print{body{background:#fff}main{width:100%;margin:0}.filters,.tabs,.actions,.pagination,#clear-filters,.pages-toolbar,.report-nav,.page-dialog,.page-dialog-backdrop{display:none!important}.analytics-grid{grid-template-columns:1fr 1fr 1fr}.chart-button{padding:4px}.table-wrap{overflow:visible}table{min-width:0;font-size:9px}th{position:static}.remediation,code{max-width:none}a{color:#000}}
38
41
  </style>
39
42
  </head>
40
43
  <body><main>
41
- <header><div class="brand">${H}<div><div class="eyebrow">${se(x.agencyName??"SEO Crawl Audit")}</div><h1 id="report-title">${se(v)}</h1><div class="meta">${se(ao)}</div></div></div><div class="meta header-meta"><span id="generated-label">Generated</span> <time id="generated-at" datetime="${se(X)}">${se(X)}</time><br><span id="engine-label">Engine</span> ${se(e.engineVersion??W)} \xB7 <span id="rules-label">Rules</span> ${se(e.ruleSetVersion??_e)}<label class="language-control"><span id="language-label">Language</span><select id="language" aria-label="Language"><option value="en">English</option><option value="uk">\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430</option></select></label></div></header>
44
+ <header><div class="brand">${Ao}<div><div class="eyebrow">${se(x.agencyName??"SEO Crawl Audit")}</div><h1 id="report-title">${se(O)}</h1><div class="meta">${se(po)}</div></div></div><div class="meta header-meta"><span id="generated-label">Generated</span> <time id="generated-at" datetime="${se(As)}">${se(As)}</time><br><span id="engine-label">Engine</span> ${se(e.engineVersion??W)} \xB7 <span id="rules-label">Rules</span> ${se(e.ruleSetVersion??Re)}<label class="language-control"><span id="language-label">Language</span><select id="language" aria-label="Language"><option value="en">English</option><option value="uk">\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430</option></select></label></div></header>
42
45
  ${B?' <div class="notice"><strong id="partial-title">Partial results.</strong> <span id="partial-message">This report contains the pages saved so far. Run the same scan command again to resume without requesting them twice.</span></div>':""}
43
46
  ${M?' <div class="notice"><strong id="incomplete-title">Incomplete comparison.</strong> <span id="incomplete-message">Regressions found on checked pages are shown, but unchecked pages are not marked missing or resolved.</span></div>':""}
44
47
  ${e.comparison?.kind==="preview"?` <div class="notice"><strong id="preview-title">Preview deployment comparison.</strong> <span id="production-label">Production</span>: <a href="${se(e.comparison.productionUrl)}">${se(e.comparison.productionUrl)}</a> \xB7 <span id="preview-label">Preview</span>: <a href="${se(e.comparison.previewUrl)}">${se(e.comparison.previewUrl)}</a></div>`:""}
45
- ${e.comparison?.kind==="local"?ra(e.comparison.summary):""}
46
- ${oo?' <div id="large-report-notice" class="notice">This report contains more than 25,000 issues. Filters and pagination render only the visible rows to keep the report responsive.</div>':""}
48
+ ${e.comparison?.kind==="local"?aa(e.comparison.summary):""}
49
+ ${ho?' <div id="large-report-notice" class="notice">This report contains more than 25,000 issues. Filters and pagination render only the visible rows to keep the report responsive.</div>':""}
47
50
  <nav class="report-nav" aria-label="Report sections"><button type="button" data-view="overview" aria-selected="true">Overview</button><button type="button" data-view="metrics" aria-selected="false">Site Metrics</button><button type="button" data-view="pages" aria-selected="false">Pages</button><button type="button" data-view="issues" aria-selected="false">Issues</button></nav>
48
51
  <div id="overview-view" data-report-view="overview">
49
- <section class="cards"><div class="card"><strong id="pages-count">${n.length.toLocaleString("en-US")}${ds?` / ${ds.toLocaleString("en-US")}`:""}</strong><span id="pages-label">Pages checked</span></div><div class="card error"><strong id="errors-count">${f.error}</strong><span id="errors-label">Errors</span></div><div class="card warning"><strong id="warnings-count">${f.warning}</strong><span id="warnings-label">Warnings</span></div><div class="card info"><strong id="info-count">${f.info}</strong><span id="info-label">Info</span></div><div class="card"><strong id="affected-count">${b.toLocaleString("en-US")}</strong><span id="affected-label">Affected pages</span></div></section>
52
+ <section class="cards"><div class="card"><strong id="pages-count">${n.length.toLocaleString("en-US")}${ps?` / ${ps.toLocaleString("en-US")}`:""}</strong><span id="pages-label">Pages checked</span></div><div class="card error"><strong id="errors-count">${f.error}</strong><span id="errors-label">Errors</span></div><div class="card warning"><strong id="warnings-count">${f.warning}</strong><span id="warnings-label">Warnings</span></div><div class="card info"><strong id="info-count">${f.info}</strong><span id="info-label">Info</span></div><div class="card"><strong id="affected-count">${b.toLocaleString("en-US")}</strong><span id="affected-label">Affected pages</span></div></section>
50
53
  <section class="analytics" aria-labelledby="priority-title"><div class="analytics-header"><div><h2 id="priority-title">What to fix first</h2><div id="priority-hint" class="meta">Ordered by risk and affected pages, without an opaque score.</div></div></div><div id="priority-list" class="priority-list"></div></section>
51
54
  ${e.history&&e.history.points.length>0?' <section id="history-panel" class="analytics" aria-labelledby="history-title"><div class="analytics-header"><div><h2 id="history-title">Local scan history</h2><div id="history-hint" class="meta">Issue trends from snapshots stored on this device.</div></div></div><div class="trend-layout"><div><svg id="history-chart" class="trend-chart" viewBox="0 0 760 240" role="img"></svg><div class="trend-legend"><span><i class="chart-key error"></i><span id="history-errors-label">Errors</span></span><span><i class="chart-key warning"></i><span id="history-warnings-label">Warnings</span></span><span><i class="chart-key info"></i><span id="history-info-label">Info</span></span></div></div><div id="history-summary" class="trend-summary"></div></div></section>':""}
52
55
  <section id="analytics" class="analytics" aria-labelledby="analytics-title">
@@ -54,14 +57,14 @@ ${e.history&&e.history.points.length>0?' <section id="history-panel" class="ana
54
57
  <div class="analytics-grid">
55
58
  <article class="chart-card"><div class="chart-title"><h3 id="severity-chart-title">By severity</h3></div><div id="severity-chart"></div></article>
56
59
  <article class="chart-card"><div class="chart-title"><h3 id="rules-chart-title">Most frequent checks</h3><span id="rules-chart-summary"></span></div><div id="rules-chart" class="chart-list"></div></article>
57
- <article class="chart-card"><div class="chart-title"><h3 id="distribution-chart-title">${Vr?"By lifecycle":"By owner"}</h3></div><div id="distribution-chart" class="chart-list"></div></article>
60
+ <article class="chart-card"><div class="chart-title"><h3 id="distribution-chart-title">${Xr?"By lifecycle":"By owner"}</h3></div><div id="distribution-chart" class="chart-list"></div></article>
58
61
  <article class="chart-card"><div class="chart-title"><h3 id="templates-chart-title">Affected page templates</h3><span id="templates-chart-summary"></span></div><div id="templates-chart" class="chart-list"></div></article>
59
62
  </div>
60
63
  </section>
61
64
  </div>
62
65
  <section id="metrics-view" data-report-view="metrics" class="analytics" hidden><div class="analytics-header"><div><h2 id="metrics-title">Site Metrics</h2><div id="metrics-hint" class="meta">Local crawl measurements and clearly labelled external estimates.</div></div></div><div id="metrics-hero" class="metrics-hero"></div><div id="metrics-insights" class="metrics-insights"></div><div id="metrics-groups" class="metrics-groups"></div></section>
63
66
  <section id="pages-view" data-report-view="pages" class="panel" hidden>
64
- ${L?'<div id="pages-partial" class="notice pages-limited">Only pages completed by this incomplete crawl are listed.</div>':""}
67
+ ${v?'<div id="pages-partial" class="notice pages-limited">Only pages completed by this incomplete crawl are listed.</div>':""}
65
68
  <div class="pages-toolbar"><label><span id="page-search-label" class="meta">URL or title</span><input id="page-search" type="search" placeholder="Search pages"></label><label><span id="page-status-label" class="meta">HTTP status</span><select id="page-status"><option value="">All statuses</option><option value="2">2xx</option><option value="3">3xx</option><option value="4">4xx</option><option value="5">5xx</option><option value="none">No response</option></select></label><label><span id="page-indexability-label" class="meta">Indexability</span><select id="page-indexability"><option value="">All states</option><option value="allowed">No restriction detected</option><option value="noindex">Noindex</option><option value="blocked">Blocked by robots</option><option value="redirect">Redirect</option><option value="error">HTTP / network error</option><option value="non-html">Non-HTML</option><option value="unknown">Unknown</option></select></label><label><span id="page-issues-label" class="meta">Issues</span><select id="page-issues"><option value="">All pages</option><option value="yes">With issues</option><option value="no">Without issues</option><option value="error">With errors</option><option value="warning">With warnings</option><option value="info">With info</option></select></label><label><span id="page-rows-label" class="meta">Rows</span><select id="page-page-size"><option value="50">50 per page</option><option value="100" selected>100 per page</option><option value="250">250 per page</option></select></label></div>
66
69
  <div class="filters"><label><span id="page-architecture-label">Site architecture</span><select id="page-architecture"><option value="">All pages</option><option value="zero">No observed inlinks</option><option value="one">One observed inlink</option><option value="broken">Links to errors</option><option value="redirects">Links through redirects</option><option value="deep">Depth 4+</option></select></label><label><span id="page-template-label">URL template</span><input id="page-template-filter" list="page-template-options" placeholder="Filter by template"><datalist id="page-template-options"></datalist></label><span id="page-architecture-notice" class="meta">Only links from checked pages are counted. Unchecked targets are not classified as broken.</span></div>
67
70
  ${e.pageDetails?"":'<div id="pages-limited" class="notice pages-limited">This report contains URLs only. Detailed page fields are unavailable.</div>'}
@@ -73,12 +76,12 @@ ${e.history&&e.history.points.length>0?' <section id="history-panel" class="ana
73
76
  <div class="filters"><label><span id="search-label" class="meta">URL or text</span><input id="search" type="search" placeholder="URL, check, or message"></label><label><span id="severity-label" class="meta">Severity</span><select id="severity"><option value="">All severities</option><option value="error">Error</option><option value="warning">Warning</option><option value="info">Info</option></select></label><label><span id="rule-label" class="meta">Check</span><select id="rule"><option value="">All checks</option></select></label><label><span id="template-label" class="meta">Page template</span><select id="template"><option value="">All templates</option></select></label><label><span id="owner-label" class="meta">Owner</span><select id="owner"><option value="">All owners</option><option value="seo">SEO</option><option value="content">Content</option><option value="developer">Developer</option></select></label><label><span id="rows-label" class="meta">Rows</span><select id="page-size"><option value="100">100 per page</option><option value="250">250 per page</option><option value="500">500 per page</option></select></label></div>
74
77
  <div class="guide"><span><strong id="guide-error">Errors</strong> <span id="guide-error-text">need attention first.</span> <strong id="guide-warning">Warnings</strong> <span id="guide-warning-text">are important improvements.</span> <strong id="guide-info">Info</strong> <span id="guide-info-text">is useful context.</span></span><span id="score-note">No opaque SEO score is used.</span></div>
75
78
  <div class="results-bar"><span id="result-count" aria-live="polite"></span><div class="actions"><button id="export-csv" type="button">Export CSV</button><div id="pagination" class="pagination"><button id="previous" type="button">Previous</button><span id="page-info"></span><button id="next" type="button">Next</button></div></div></div>
76
- <div id="table-wrap" class="table-wrap"><table><thead><tr><th id="th-severity">Severity</th><th id="th-lifecycle">Lifecycle</th><th id="th-rule-owner">Check / owner</th><th id="th-page">Page</th><th id="th-finding">${Vr?"Change":"What was found"}</th>${Vr?'<th id="th-before">Before</th>':""}<th id="th-evidence">Evidence / after</th><th id="th-remediation">Remediation</th><th id="th-fingerprint">Fingerprint</th></tr></thead><tbody id="issues"></tbody></table></div>
79
+ <div id="table-wrap" class="table-wrap"><table><thead><tr><th id="th-severity">Severity</th><th id="th-lifecycle">Lifecycle</th><th id="th-rule-owner">Check / owner</th><th id="th-page">Page</th><th id="th-finding">${Xr?"Change":"What was found"}</th>${Xr?'<th id="th-before">Before</th>':""}<th id="th-evidence">Evidence / after</th><th id="th-remediation">Remediation</th><th id="th-fingerprint">Fingerprint</th></tr></thead><tbody id="issues"></tbody></table></div>
77
80
  <div id="empty" class="empty" hidden><strong id="empty-title">No SEO issues found</strong><span id="empty-message">The scanned pages passed all current checks.</span><button id="clear-filters" type="button">Clear filters</button></div>
78
81
  </section><div id="page-dialog-backdrop" class="page-dialog-backdrop" hidden></div><aside id="page-dialog" class="page-dialog" role="dialog" aria-modal="true" aria-labelledby="page-dialog-title" hidden><div class="page-dialog-head"><h2 id="page-dialog-title">Page details</h2><button id="page-dialog-close" type="button" aria-label="Close">\xD7</button></div><div id="page-dialog-content"></div></aside><footer id="report-footer">Generated locally. No report data was uploaded.</footer>
79
82
  </main>
80
83
  <script>
81
- const report=${lo};
84
+ const report=${mo};
82
85
  const issueString=(id)=>report.issueStrings[id];
83
86
  report.issues=report.issueRows.map((row)=>{const issue={fingerprint:row[0],ruleId:issueString(row[1]),rule:issueString(row[2]),severity:issueString(row[3]),scope:issueString(row[4]),url:row[5],message:row[6],evidence:row[7],owner:issueString(row[8]),remediation:issueString(row[9]),documentationUrl:issueString(row[10]),lifecycle:issueString(row[13]),template:issueString(row[14]),localized:{en:{rule:issueString(row[15]),message:row[16],remediation:issueString(row[17])},uk:{rule:issueString(row[18]),message:row[19],remediation:issueString(row[20])}}};if(row[21]&1)issue.before=row[11];if(row[21]&2)issue.after=row[12];return issue});delete report.issueRows;delete report.issueStrings;
84
87
  const byId=(id)=>document.querySelector("#"+id); const generatedAt=byId("generated-at"); const language=byId("language"); const search=byId("search"); const severity=byId("severity"); const rule=byId("rule"); const template=byId("template"); const owner=byId("owner"); const pageSize=byId("page-size"); const tbody=byId("issues"); const empty=byId("empty"); const emptyTitle=byId("empty-title"); const emptyMessage=byId("empty-message"); const clearFilters=byId("clear-filters"); const tableWrap=byId("table-wrap"); const resultCount=byId("result-count"); const pagination=byId("pagination"); const previous=byId("previous"); const next=byId("next"); const pageInfo=byId("page-info"); const severityChart=byId("severity-chart"); const rulesChart=byId("rules-chart"); const distributionChart=byId("distribution-chart"); const templatesChart=byId("templates-chart"); const historyChart=byId("history-chart"); const historySummary=byId("history-summary"); const metricsHero=byId("metrics-hero"); const metricsInsights=byId("metrics-insights"); const metricsGroups=byId("metrics-groups"); const priorityList=byId("priority-list"); const pageSearch=byId("page-search");const pageStatus=byId("page-status");const pageIndexability=byId("page-indexability");const pageIssues=byId("page-issues");const pagePageSize=byId("page-page-size");const pagesBody=byId("pages-body");const pagesEmpty=byId("pages-empty");const pagesTableWrap=byId("pages-table-wrap");const pageResultCount=byId("page-result-count");const pagePagination=byId("page-pagination");const pagePrevious=byId("page-previous");const pageNext=byId("page-next");const pagePageInfo=byId("page-page-info");const pageDialog=byId("page-dialog");const pageDialogBackdrop=byId("page-dialog-backdrop");const pageDialogContent=byId("page-dialog-content");const pageDialogClose=byId("page-dialog-close"); let locale="en"; let currentPage=1; let activeTab=""; let exactIssueUrl=null;let lastFiltered=[];let pagesCurrentPage=1;let pagesFiltered=[];let pageSort={key:"url",direction:1};let pageReturnFocus=null;
@@ -125,7 +128,7 @@ ${e.history&&e.history.points.length>0?' <section id="history-panel" class="ana
125
128
  const distributionOrder=report.mode==="check"?["new","ongoing","resolved","unchanged"]:["seo","content","developer"];const distribution=report.mode==="check"?stats.lifecycle:stats.owners;const visibleDistribution=distributionOrder.filter((value)=>distribution[value]>0);const distributionMax=Math.max(...visibleDistribution.map((value)=>distribution[value]));distributionChart.replaceChildren(...visibleDistribution.map((value)=>chartButton(report.mode==="check"?text.lifecycle[value]:text.owners[value],distribution[value],distributionMax,report.mode==="check"?"lifecycle":"owner",value,report.mode==="check"?value:"")));const topTemplates=stats.templates.slice(0,7);setText("templates-chart-summary",number(topTemplates.length)+" "+text.of+" "+number(stats.templates.length));const templateMax=Math.max(...topTemplates.map((item)=>item.issueCount));templatesChart.replaceChildren(...topTemplates.map((item)=>chartButton(item.template,item.issueCount,templateMax,"template",item.template)));syncChartButtons();
126
129
  }
127
130
  function renderHistory(){
128
- if(!report.history||!historyChart||!historySummary)return;const text=copy();const points=report.history.points.slice(-20);const ns="http://www.w3.org/2000/svg";const width=760,height=240,left=38,right=16,top=18,bottom=34;const maximum=Math.max(1,...points.flatMap((point)=>[point.errors,point.warnings,point.info]));const x=(index)=>left+(points.length===1?0:(width-left-right)*index/(points.length-1));const y=(value)=>top+(height-top-bottom)*(1-value/maximum);historyChart.replaceChildren();historyChart.setAttribute("aria-label",text.history.chartLabel+" "+number(points.length));for(let line=0;line<=4;line+=1){const grid=document.createElementNS(ns,"line");const value=maximum*line/4;grid.setAttribute("x1",String(left));grid.setAttribute("x2",String(width-right));grid.setAttribute("y1",String(y(value)));grid.setAttribute("y2",String(y(value)));grid.setAttribute("class","trend-grid");historyChart.append(grid)}for(const [key,className] of [["errors","error"],["warnings","warning"],["info","info"]]){const polyline=document.createElementNS(ns,"polyline");polyline.setAttribute("points",points.map((point,index)=>x(index)+","+y(point[key])).join(" "));polyline.setAttribute("class","trend-line trend-"+className);historyChart.append(polyline);for(const [index,point] of points.entries()){const circle=document.createElementNS(ns,"circle");circle.setAttribute("cx",String(x(index)));circle.setAttribute("cy",String(y(point[key])));circle.setAttribute("r","4");circle.setAttribute("class","trend-point trend-"+className);const title=document.createElementNS(ns,"title");title.textContent=new Intl.DateTimeFormat(locale==="uk"?"uk-UA":"en-US",{dateStyle:"medium",timeStyle:"short"}).format(new Date(point.generatedAt))+": "+text.severities[className]+" "+number(point[key]);circle.append(title);historyChart.append(circle)}}if(points.length>0){for(const [index,anchor] of [[0,"start"],[points.length-1,"end"]]){const label=document.createElementNS(ns,"text");label.setAttribute("x",String(x(index)));label.setAttribute("y",String(height-9));label.setAttribute("text-anchor",anchor);label.setAttribute("fill","#64748b");label.setAttribute("font-size","11");label.textContent=new Intl.DateTimeFormat(locale==="uk"?"uk-UA":"en-US",{dateStyle:"medium"}).format(new Date(points[index].generatedAt));historyChart.append(label)}}const latest=points.at(-1);historySummary.replaceChildren();if(latest){for(const [label,value] of [[text.history.runs,report.history.points.length],[text.history.pages,latest.pages],[text.history.newIssues,latest.newIssues],[text.history.resolvedIssues,latest.resolvedIssues],[text.history.sitemapUrls,latest.sitemapUrls],[text.history.maxDepth,latest.maxDepth]]){const row=document.createElement("div");const name=document.createElement("span");name.textContent=label;const amount=document.createElement("strong");amount.textContent=number(value);row.append(name,amount);historySummary.append(row)}}
131
+ if(!report.history||!historyChart||!historySummary)return;const text=copy();const points=report.history.points.slice(-20);const ns="http://www.w3.org/2000/svg";const width=760,height=240,left=38,right=16,top=18,bottom=34;const maximum=Math.max(1,...points.flatMap((point)=>[point.errors,point.warnings,point.info]));const x=(index)=>left+(points.length===1?0:(width-left-right)*index/(points.length-1));const y=(value)=>top+(height-top-bottom)*(1-value/maximum);historyChart.replaceChildren();historyChart.setAttribute("aria-label",text.history.chartLabel+" "+number(points.length));for(let line=0;line<=4;line+=1){const grid=document.createElementNS(ns,"line");const value=maximum*line/4;grid.setAttribute("x1",String(left));grid.setAttribute("x2",String(width-right));grid.setAttribute("y1",String(y(value)));grid.setAttribute("y2",String(y(value)));grid.setAttribute("class","trend-grid");historyChart.append(grid)}for(const [key,className] of [["errors","error"],["warnings","warning"],["info","info"]]){const polyline=document.createElementNS(ns,"polyline");polyline.setAttribute("points",points.map((point,index)=>x(index)+","+y(point[key])).join(" "));polyline.setAttribute("class","trend-line trend-"+className);historyChart.append(polyline);for(const [index,point] of points.entries()){const circle=document.createElementNS(ns,"circle");circle.setAttribute("cx",String(x(index)));circle.setAttribute("cy",String(y(point[key])));circle.setAttribute("r","4");circle.setAttribute("class","trend-point trend-"+className);const title=document.createElementNS(ns,"title");title.textContent=new Intl.DateTimeFormat(locale==="uk"?"uk-UA":"en-US",{dateStyle:"medium",timeStyle:"short"}).format(new Date(point.generatedAt))+": "+text.severities[className]+" "+number(point[key]);circle.append(title);historyChart.append(circle)}}if(points.length>0){for(const [index,anchor] of [[0,"start"],[points.length-1,"end"]]){const label=document.createElementNS(ns,"text");label.setAttribute("x",String(x(index)));label.setAttribute("y",String(height-9));label.setAttribute("text-anchor",anchor);label.setAttribute("fill","var(--muted)");label.setAttribute("font-size","11");label.textContent=new Intl.DateTimeFormat(locale==="uk"?"uk-UA":"en-US",{dateStyle:"medium"}).format(new Date(points[index].generatedAt));historyChart.append(label)}}const latest=points.at(-1);historySummary.replaceChildren();if(latest){for(const [label,value] of [[text.history.runs,report.history.points.length],[text.history.pages,latest.pages],[text.history.newIssues,latest.newIssues],[text.history.resolvedIssues,latest.resolvedIssues],[text.history.sitemapUrls,latest.sitemapUrls],[text.history.maxDepth,latest.maxDepth]]){const row=document.createElement("div");const name=document.createElement("span");name.textContent=label;const amount=document.createElement("strong");amount.textContent=number(value);row.append(name,amount);historySummary.append(row)}}
129
132
  if(points.length===1)historyChart.querySelectorAll("text")[1]?.remove();
130
133
  // When the first and last scans share a date, dates alone cannot distinguish the endpoints.
131
134
  if(points.length>1){const first=new Date(points[0].generatedAt);const last=new Date(points.at(-1).generatedAt);const dateFormat=new Intl.DateTimeFormat(locale==="uk"?"uk-UA":"en-US",{dateStyle:"medium"});if(dateFormat.format(first)===dateFormat.format(last)){const labels=historyChart.querySelectorAll("text");const timeFormat=new Intl.DateTimeFormat(locale==="uk"?"uk-UA":"en-US",{hour:"numeric",minute:"2-digit"});labels[0].textContent=timeFormat.format(first);labels[1].textContent=timeFormat.format(last)}}
@@ -186,18 +189,18 @@ ${e.history&&e.history.points.length>0?' <section id="history-panel" class="ana
186
189
  for(const button of document.querySelectorAll("[data-comparison-rule]")){button.addEventListener("click",()=>{const sample=report.issues.find((issue)=>issue.ruleId===button.dataset.comparisonRule);if(!sample)return;rule.value=sample.rule;currentPage=1;document.querySelector('[data-view="issues"]').click();render()})}
187
190
  for(const button of document.querySelectorAll("[data-comparison-template]")){button.addEventListener("click",()=>{template.value=button.dataset.comparisonTemplate;currentPage=1;document.querySelector('[data-view="issues"]').click();render()})}
188
191
  applyLocale();
189
- </script></body></html>`}function Wu(e){return e.reduce((t,r)=>(t[r.severity]+=1,t),{error:0,warning:0,info:0})}function Ft(e){if(e.length===0)return null;let r=[...new Map(e.map(o=>[`${o.generatedAt}|${o.configurationHash}|${o.pages.length}`,o])).values()].sort((o,d)=>o.generatedAt.localeCompare(d.generatedAt)),n=r.at(-1).siteUrl,s=r.filter(o=>o.siteUrl===n),i=s.map((o,d)=>{let l=le(o),c=Wu(l),m=d>0?s[d-1]:void 0,A=m?je(m,o):null;return{generatedAt:o.generatedAt,siteUrl:o.siteUrl,pages:o.pages.length,affectedPages:new Set(l.map(h=>h.url)).size,errors:c.error,warnings:c.warning,info:c.info,newIssues:A?.newIssues.length??0,resolvedIssues:A?.resolvedIssues.length??0,sitemapUrls:o.sitemap?.urls.length??0,maxDepth:o.pages.reduce((h,f)=>Math.max(h,f.depth),0),partial:o.partial||o.truncated}});return{siteUrl:n,points:i}}function sa(e){return{generatedAt:e.generatedAt,siteUrl:e.siteUrl,pages:e.pages.length,partial:e.partial,truncated:e.truncated,configurationHash:e.configurationHash,engineVersion:e.engineVersion,ruleSetVersion:e.ruleSetVersion}}function ia(e){let t={error:0,warning:0,info:0};for(let r of e)t[r.severity]+=1;return t}function Ht(){return{new:0,ongoing:0,resolved:0,unchanged:0}}var Ku=new Set(["page-unreachable","http-error","robots-blocked","redirect-loop","long-redirect-chain","status-regression","page-missing","redirect-changed"]),Ju=new Set(["noindex","x-robots-noindex","missing-canonical","invalid-canonical","cross-domain-canonical","canonical-target-error","noindex-in-sitemap","redirect-in-sitemap","missing-title","duplicate-title","pagination-title-duplicate","near-duplicate-title","title-length","missing-description","duplicate-description","description-length","missing-h1","broken-internal-link","orphan-sitemap-page","crawlable-not-in-sitemap","invalid-hreflang","malformed-json-ld","http-on-https-site","invalid-language","duplicate-content","multiple-h1","missing-open-graph","missing-twitter-metadata","image-missing-alt","low-word-count","new-noindex","title-removed","title-changed","description-removed","canonical-removed","canonical-changed","h1-removed"]);function $u(e,t,r,n){if(e.scope==="site")return t.partial||t.truncated||r.partial||r.truncated?"incomplete-site":null;let s=n.get(e.url);return s?s.blockedByRobots?"robots-blocked":s.error||s.status===null||s.status>=400?"request-failed":Ku.has(e.ruleId)?null:s.status>=300||!s.contentType||!/(?:text\/html|application\/xhtml\+xml)/i.test(s.contentType)?"html-unavailable":Ju.has(e.ruleId)?null:"unknown-evidence":"not-checked"}function aa(e,t){let r=new Map;for(let{lifecycle:n,issue:s}of e){let i=t(s),o=r.get(i)??{counts:Ht(),pages:new Set};o.counts[n]+=1,s.scope==="page"&&o.pages.add(s.url),r.set(i,o)}return[...r].map(([n,s])=>({id:n,counts:s.counts,affectedPages:s.pages.size})).sort((n,s)=>n.id.localeCompare(s.id))}function Qt(e,t,r){if(e.siteUrl!==t.siteUrl)throw new Error("local history snapshots must have the same site URL");let n=t.config,s=x=>({...x,config:{...x.config,enabledRules:n.enabledRules,severityOverrides:n.severityOverrides,suppressions:n.suppressions,regressionBudgets:n.regressionBudgets}}),i=s(e),o=s(t),d={now:r.evaluatedAt},l=le(i,d),c=le(o,d),m=je(i,o,d),A=[],h=new Map(t.pages.map(x=>[x.url,x])),f=m.resolvedIssues.filter(x=>{let k=$u(x,e,t,h);return k&&A.push({fingerprint:x.fingerprint,ruleId:x.ruleId,url:x.url,reason:k}),!k}),b={...m,resolvedIssues:f},y=new Set(e.pages.map(x=>x.url)),C=new Set(t.pages.map(x=>x.url)),N=[...y].filter(x=>C.has(x)).length,S=[];(e.partial||e.truncated)&&S.push("incomplete-before"),(t.partial||t.truncated)&&S.push("incomplete-after"),e.configurationHash!==t.configurationHash&&S.push("configuration-changed"),e.config.includeQuery!==t.config.includeQuery&&S.push("url-policy-changed"),e.ruleSetVersion!==t.ruleSetVersion&&S.push("rule-set-changed"),e.generatedAt===t.generatedAt&&S.push("same-timestamp"),(JSON.stringify(e.config.enabledRules)!==JSON.stringify(n.enabledRules)||JSON.stringify(e.config.severityOverrides)!==JSON.stringify(n.severityOverrides)||JSON.stringify(e.config.suppressions)!==JSON.stringify(n.suppressions))&&S.push("evaluation-policy-changed");let _=[...b.newIssues.map(x=>({lifecycle:"new",issue:x})),...b.ongoingIssues.map(x=>({lifecycle:"ongoing",issue:x})),...b.resolvedIssues.map(x=>({lifecycle:"resolved",issue:x})),...b.unchangedIssues.map(x=>({lifecycle:"unchanged",issue:x}))],B=Ht(),L={error:Ht(),warning:Ht(),info:Ht()};for(let x of _)B[x.lifecycle]+=1,L[x.issue.severity][x.lifecycle]+=1;let M=Ge([...new Set([...y,...C])]),v=new Map(M.flatMap(x=>x.urls.map(k=>[k,x.origin+x.template])));return{diff:b,summary:{schemaVersion:1,evaluatedAt:r.evaluatedAt,from:sa(e),to:sa(t),coverage:{common:N,onlyBefore:y.size-N,onlyAfter:C.size-N,complete:!(e.partial||e.truncated||t.partial||t.truncated)},evaluationPolicy:{source:"after",enabledRules:n.enabledRules?[...n.enabledRules]:null,severityOverrides:{...n.severityOverrides},suppressions:n.suppressions.map(x=>({...x})),regressionBudgets:{...n.regressionBudgets}},warnings:S,beforeFindings:ia(l),afterFindings:ia(c),lifecycle:B,lifecycleBySeverity:L,budgetExceeded:b.budgetExceeded,byRule:aa(_,x=>x.ruleId),byTemplate:aa(_,x=>x.scope==="site"?"@site":v.get(x.url)??"@unknown"),unverified:A.sort((x,k)=>x.url.localeCompare(k.url)||x.ruleId.localeCompare(k.ruleId))}}}function J(e,t,r,n,s="count",i){return{id:e,label:t,value:r,unit:s,source:{id:"crawl",label:"SEO Crawl Audit"},observedAt:n,confidence:"high",status:"available",...i?{detail:i}:{}}}function oa(e,t,r,n,s){return{id:e,label:t,value:null,unit:"count",source:r,observedAt:n,confidence:"high",status:"not-connected",...s?{detail:s}:{}}}function ju(e,t,r,n,s){return{id:e,label:t,value:r,unit:"count",source:{id:"crawl-estimate",label:"SEO Crawl Audit"},observedAt:n,confidence:"low",status:"estimate",...s?{detail:s}:{}}}function ca(e){return[e.robots,e.xRobotsTag].some(t=>/(^|[\s,])noindex($|[\s,])/i.test(t??""))}function Fn(e,t){if(Array.isArray(e))return e.reduce((i,o)=>i+Fn(o,t),0);if(!e||typeof e!="object")return 0;let r=e,n=r["@type"];return(Array.isArray(n)?n.filter(i=>i===t).length:n===t?1:0)+Object.entries(r).filter(([i])=>i!=="@type").reduce((i,[,o])=>i+Fn(o,t),0)}function vr(e,t,r){return e.filter(n=>n.status!==null&&n.status>=t&&n.status<=r).length}function ot(e){let t=e.pages,r=e.generatedAt,n=t.filter(h=>/(?:text\/html|application\/xhtml\+xml)/i.test(h.contentType??"")),s=t.filter(ca),i=n.filter(h=>!h.error&&!h.blockedByRobots&&h.status!==null&&h.status>=200&&h.status<300&&!ca(h)),o=e.sitemap?.urls.length??0,d=o>t.length&&t.length>0?Math.min(o,Math.round(i.length/t.length*o)):i.length,l=new Set(t.flatMap(h=>h.images.map(f=>f.src).filter(f=>!!f))),c=t.reduce((h,f)=>h+f.jsonLd.reduce((b,y)=>b+(y.valid?Fn(y.value,"Product"):0),0),0),m=t.reduce((h,f)=>h+f.responseBytes,0),A=t.length>0?Math.round(e.statistics.durationMs/t.length):0;return{schemaVersion:1,siteUrl:e.siteUrl,observedAt:r,metrics:[J("pages.sitemap",{en:"Sitemap URLs",uk:"URL \u0443 sitemap"},o,r),J("pages.checked",{en:"Pages checked",uk:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A"},t.length,r),J("pages.html",{en:"HTML pages",uk:"HTML-\u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438"},n.length,r),J("pages.indexable",{en:"Crawlable HTML pages",uk:"\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u0456 HTML-\u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438"},i.length,r,"count",{en:"Successful HTML pages without a detected noindex directive. This is not the Google index count.",uk:"\u0423\u0441\u043F\u0456\u0448\u043D\u0456 HTML-\u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0431\u0435\u0437 \u0432\u0438\u044F\u0432\u043B\u0435\u043D\u043E\u0457 \u0434\u0438\u0440\u0435\u043A\u0442\u0438\u0432\u0438 noindex. \u0426\u0435 \u043D\u0435 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0432 \u0456\u043D\u0434\u0435\u043A\u0441\u0456 Google."}),ju("search.indexable-estimate",{en:"Estimated indexable pages",uk:"\u041E\u0440\u0456\u0454\u043D\u0442\u043E\u0432\u043D\u0430 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0456\u043D\u0434\u0435\u043A\u0441\u043E\u0432\u0430\u043D\u0438\u0445 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A"},d,r,{en:"Estimated from the crawlable-page ratio and sitemap size. This is not the number indexed by Google.",uk:"\u041E\u0446\u0456\u043D\u043A\u0430 \u0437\u0430 \u0447\u0430\u0441\u0442\u043A\u043E\u044E \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0445 \u0434\u043B\u044F \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0456 \u0440\u043E\u0437\u043C\u0456\u0440\u043E\u043C sitemap. \u0426\u0435 \u043D\u0435 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0432 \u0456\u043D\u0434\u0435\u043A\u0441\u0456 Google."}),oa("search.google-indexed",{en:"Indexed by Google",uk:"\u041F\u0440\u043E\u0456\u043D\u0434\u0435\u043A\u0441\u043E\u0432\u0430\u043D\u043E Google"},{id:"google-search-console",label:"Google Search Console"},r,{en:"Connect an authoritative provider to confirm this value; crawlability is not proof of indexing.",uk:"\u041F\u0456\u0434\u043A\u043B\u044E\u0447\u0456\u0442\u044C \u0430\u0432\u0442\u043E\u0440\u0438\u0442\u0435\u0442\u043D\u0435 \u0434\u0436\u0435\u0440\u0435\u043B\u043E \u0434\u043B\u044F \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043D\u044F; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456\u0441\u0442\u044C \u0434\u043B\u044F crawl \u043D\u0435 \u0434\u043E\u0432\u043E\u0434\u0438\u0442\u044C \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u044E."}),oa("search.bing-indexed",{en:"Indexed by Bing",uk:"\u041F\u0440\u043E\u0456\u043D\u0434\u0435\u043A\u0441\u043E\u0432\u0430\u043D\u043E Bing"},{id:"bing-webmaster",label:"Bing Webmaster Tools"},r,{en:"Connect an authoritative provider to confirm this value.",uk:"\u041F\u0456\u0434\u043A\u043B\u044E\u0447\u0456\u0442\u044C \u0430\u0432\u0442\u043E\u0440\u0438\u0442\u0435\u0442\u043D\u0435 \u0434\u0436\u0435\u0440\u0435\u043B\u043E \u0434\u043B\u044F \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043D\u044F \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F."}),J("pages.noindex",{en:"Noindex pages",uk:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0438 noindex"},s.length,r),J("pages.robots-blocked",{en:"Blocked by robots.txt",uk:"\u0417\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E robots.txt"},t.filter(h=>h.blockedByRobots).length,r),J("assets.images",{en:"Unique images",uk:"\u0423\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u0456 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F"},l.size,r),J("commerce.products",{en:"Product entities",uk:"\u0422\u043E\u0432\u0430\u0440\u0438 Product"},c,r),J("links.internal",{en:"Internal links",uk:"\u0412\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F"},e.linkGraph.internalEdges,r),J("links.external",{en:"External links",uk:"\u0417\u043E\u0432\u043D\u0456\u0448\u043D\u0456 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F"},e.linkGraph.externalEdges,r),J("crawl.max-depth",{en:"Maximum crawl depth",uk:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430 \u0433\u043B\u0438\u0431\u0438\u043D\u0430"},Math.max(0,...t.map(h=>h.depth)),r),J("crawl.transfer",{en:"HTML transferred",uk:"\u041F\u0435\u0440\u0435\u0434\u0430\u043D\u043E HTML"},m,r,"bytes"),J("crawl.average-time",{en:"Average crawl time per page",uk:"\u0421\u0435\u0440\u0435\u0434\u043D\u0456\u0439 \u0447\u0430\u0441 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443"},A,r,"milliseconds"),J("status.2xx",{en:"HTTP 2xx",uk:"HTTP 2xx"},vr(t,200,299),r),J("status.3xx",{en:"HTTP 3xx",uk:"HTTP 3xx"},vr(t,300,399),r),J("status.4xx",{en:"HTTP 4xx",uk:"HTTP 4xx"},vr(t,400,499),r),J("status.5xx",{en:"HTTP 5xx",uk:"HTTP 5xx"},vr(t,500,599),r)]}}function ct(e,t={}){return le(e,t)}function Hn(e,t,r={}){return je(e,t,r)}import{access as qu,mkdir as eA,readFile as Wn,readdir as tA,rename as rA,writeFile as da}from"node:fs/promises";import{randomUUID as Kn}from"node:crypto";import{join as ua,resolve as Dr}from"node:path";import{setTimeout as nA}from"node:timers/promises";var Vu=Object.freeze({"search.google-site-estimate":["google-site-search","google-site-search-manual"],"domain.registration-date":["rdap"],"domain.expiration-date":["rdap"],"domain.registrar":["rdap"]});function Xu(e){return Vu[e.id]?.includes(e.source.id)===!0}function kr(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} must be an object`);return e}function Ie(e,t){if(typeof e!="string"||e==="")throw new Error(`${t} must be a non-empty string`);return e}function la(e,t){let r=kr(e,t);return{en:Ie(r.en,`${t}.en`),uk:Ie(r.uk,`${t}.uk`)}}function Zu(e,t){let r=kr(e,`metrics[${t}]`),n=["count","bytes","milliseconds","date","text"],s=["high","medium","low"],i=["available","estimate","unavailable","not-connected","error"],o=kr(r.source,`metrics[${t}].source`);if(!n.includes(String(r.unit)))throw new Error(`metrics[${t}].unit is invalid`);if(!s.includes(String(r.confidence)))throw new Error(`metrics[${t}].confidence is invalid`);if(!i.includes(String(r.status)))throw new Error(`metrics[${t}].status is invalid`);if(r.value!==null&&typeof r.value!="string"&&typeof r.value!="number")throw new Error(`metrics[${t}].value must be a number, string, or null`);let d=Ie(r.observedAt,`metrics[${t}].observedAt`);if(Number.isNaN(Date.parse(d)))throw new Error(`metrics[${t}].observedAt must be an ISO date`);let l=o.url===void 0?void 0:Ie(o.url,`metrics[${t}].source.url`);return{id:Ie(r.id,`metrics[${t}].id`),label:la(r.label,`metrics[${t}].label`),value:r.value,unit:r.unit,source:{id:Ie(o.id,`metrics[${t}].source.id`),label:Ie(o.label,`metrics[${t}].source.label`),...l?{url:l}:{}},observedAt:d,confidence:r.confidence,status:r.status,...r.stale===!0?{stale:!0}:{},...r.detail===void 0?{}:{detail:la(r.detail,`metrics[${t}].detail`)}}}function Qn(e){let t=kr(e,"site metrics state");if(t.schemaVersion!==1)throw new Error("site metrics state schemaVersion must be 1");let r=Ie(t.siteUrl,"site metrics state.siteUrl"),n=new URL(r);if(!["http:","https:"].includes(n.protocol))throw new Error("site metrics state.siteUrl must use HTTP(S)");let s=Ie(t.updatedAt,"site metrics state.updatedAt");if(Number.isNaN(Date.parse(s)))throw new Error("site metrics state.updatedAt must be an ISO date");if(!Array.isArray(t.metrics))throw new Error("site metrics state.metrics must be an array");return{schemaVersion:1,siteUrl:n.href,updatedAt:s,metrics:t.metrics.map(Zu)}}function zu(e){return e.source.id==="rdap"?6048e5:e.id==="search.google-site-estimate"?2592e6:null}function Yn(e,t=new Date){let r=t.getTime();return{...e,metrics:e.metrics.map(n=>{let s=zu(n);return s!==null&&r-Date.parse(n.observedAt)>s?{...n,stale:!0}:{...n,stale:!1}})}}function Gn(e,t){if(!t||new URL(e.siteUrl).origin!==new URL(t.siteUrl).origin)return e;let r=t.metrics.filter(Xu),n=new Map(r.map(i=>[i.id,i])),s=new Set(e.metrics.map(i=>i.id));return{...e,observedAt:t.updatedAt>e.observedAt?t.updatedAt:e.observedAt,metrics:[...e.metrics.map(i=>i.source.id==="crawl"?i:n.get(i.id)??i),...r.filter(i=>!s.has(i.id))]}}async function Aa(e,t){for(let r=0;;r+=1)try{await rA(e,t);return}catch(n){let s=n&&typeof n=="object"&&"code"in n?n.code:null;if(process.platform!=="win32"||r>=5||s!=="EPERM"&&s!=="EACCES"&&s!=="EBUSY")throw n;await nA(10*2**r)}}async function Br(e=process.cwd()){let t=Dr(e,en);try{return await qu(t),t}catch{return null}}async function Yt(e){let t=e?Dr(e):await Br();if(!t)return{};try{return tn(JSON.parse(await Wn(t,"utf8")))}catch(r){throw new Error(`invalid config ${t}: ${r instanceof Error?r.message:String(r)}`,{cause:r})}}async function Pr(e,t){let r=`${e}.${process.pid}.${Kn()}.tmp`;await da(r,`${JSON.stringify(t,null,2)}
190
- `,"utf8"),await Aa(r,e)}async function Se(e){try{return fe(JSON.parse(await Wn(e,"utf8")))}catch(t){throw t instanceof SyntaxError?new Error(`invalid snapshot JSON: ${e}`,{cause:t}):t instanceof Error&&t.message.startsWith("unsupported")?new Error(`unsupported or invalid baseline: ${e}`,{cause:t}):t}}async function pa(e,t,r=new Date){let n;try{n=JSON.parse(await Wn(e,"utf8"))}catch(i){if(i&&typeof i=="object"&&"code"in i&&i.code==="ENOENT")return null;throw i instanceof SyntaxError?new Error(`invalid site metrics JSON: ${e}`,{cause:i}):i}let s=Yn(Qn(n),r);return t&&new URL(s.siteUrl).origin!==new URL(t).origin?null:s}async function Jn(e,t,r={}){let n=ot(e);try{return Gn(n,await pa(t,e.siteUrl,r.now))}catch(s){return r.onWarning?.(`Could not load site metrics from ${t}: ${s instanceof Error?s.message:String(s)}`),n}}async function Mr(e,t,r={}){let n=`${e}.${process.pid}.${Kn()}.tmp`;await da(n,na(t,r),"utf8"),await Aa(n,e)}function sA(e){return`${e.generatedAt.replaceAll(":","-").replaceAll(".","-")}-${e.configurationHash.slice(0,8)}-${Kn()}.snapshot.json`}async function $n(e,t){let r=Dr(e);await eA(r,{recursive:!0});let n=ua(r,sA(t));return await Pr(n,t),n}async function Gt(e,t){let r=Dr(e),n;try{n=await tA(r)}catch(i){if(i&&typeof i=="object"&&"code"in i&&i.code==="ENOENT")return[];throw i}let s=[];for(let i of n.filter(o=>o.endsWith(".snapshot.json")).sort()){let o=ua(r,i),d=await Se(o);(!t||d.siteUrl===t)&&s.push({path:o,snapshot:d})}return s.sort((i,o)=>i.snapshot.generatedAt.localeCompare(o.snapshot.generatedAt)||i.path.localeCompare(o.path))}import{appendFile as iA,rename as aA,stat as ga,unlink as oA,writeFile as cA}from"node:fs/promises";import{createReadStream as ma}from"node:fs";import{createInterface as fa}from"node:readline";function lA(e){return{type:"seo-audit-checkpoint",schemaVersion:2,identity:e}}function ha(e,t){if(!e||typeof e!="object")return!1;let r=e;if(r.type!=="seo-audit-checkpoint")return!1;if(r.schemaVersion===2)return JSON.stringify(r.identity)===JSON.stringify(t);if(r.schemaVersion!==1)return!1;let n=r.source;return n?.startUrl===t.siteUrl&&(n.sitemap??null)===t.sitemapUrl&&(n.includeQuery??!1)===t.includeQuery&&(n.respectRobots??!0)===t.respectRobots}var Ur=class{path;#e=null;#t=Promise.resolve();constructor(t){this.path=t}async#r(t){let r=`${this.path}.${process.pid}.${Date.now()}.tmp`;await cA(r,`${JSON.stringify(lA(t))}
191
- `,"utf8"),await aA(r,this.path),this.#e=t}async load(t){await this.flush();try{await ga(this.path)}catch(c){if(c.code!=="ENOENT")throw c;return await this.#r(t),null}let r=ma(this.path,{encoding:"utf8"}),n=fa({input:r,crlfDelay:1/0}),s=new Map,i,o=0,d=null,l=(c,m)=>{try{let A=JSON.parse(c);A.type==="page"&&typeof A.page?.url=="string"&&s.set(A.page.url,A.page)}catch(A){throw new Error(`corrupt checkpoint record ${m} in ${this.path}`,{cause:A})}};for await(let c of n){if(o+=1,o===1){try{i=JSON.parse(c)}catch{i=null}if(!ha(i,t))return n.close(),r.destroy(),await this.#r(t),null;this.#e=t;continue}c.trim()&&(d&&l(d.line,d.lineNumber),d={line:c,lineNumber:o})}if(o===0||!ha(i,t))return await this.#r(t),null;if(d)try{l(d.line,d.lineNumber)}catch{}return{identity:t,pages:[...s.values()]}}append(t,r){return this.#t=this.#t.then(async()=>{(!this.#e||JSON.stringify(this.#e)!==JSON.stringify(t))&&await this.#r(t),await iA(this.path,`${JSON.stringify({type:"page",page:r})}
192
- `,"utf8")}),this.#t}async clear(t){if(await this.flush(),!(this.#e&&JSON.stringify(this.#e)!==JSON.stringify(t))){try{await oA(this.path)}catch(r){if(r.code!=="ENOENT")throw r}this.#e=null}}async clearCurrent(){this.#e&&await this.clear(this.#e)}async flush(){await this.#t}};function jn(e){return new Ur(e)}async function Vn(e){let t;try{t=(await ga(e)).mtime.toISOString()}catch(h){if(h.code==="ENOENT")return{path:e,status:"missing",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:null,resumable:!1,message:null};throw h}let r=ma(e,{encoding:"utf8"}),n=fa({input:r,crlfDelay:1/0}),s,i=new Set,o=0,d=null,l=(h,f)=>{try{let b=JSON.parse(h);b.type==="page"&&typeof b.page?.url=="string"&&i.add(b.page.url)}catch{return{path:e,status:"corrupt",schemaVersion:null,siteUrl:null,completedPages:i.size,updatedAt:t,resumable:!1,message:`checkpoint record ${f} is corrupt`}}return null};for await(let h of n){if(o+=1,o===1){try{s=JSON.parse(h)}catch{s=null}continue}if(h.trim()){if(d){let f=l(d.line,d.lineNumber);if(f)return f}d={line:h,lineNumber:o}}}if(!s)return{path:e,status:"corrupt",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:t,resumable:!1,message:"checkpoint header is not valid JSON"};if(typeof s!="object"||s.type!=="seo-audit-checkpoint")return{path:e,status:"incompatible",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:t,resumable:!1,message:"file is not an SEO Crawl Audit checkpoint"};let c=s,m=c.schemaVersion===1||c.schemaVersion===2?c.schemaVersion:null;if(m===null)return{path:e,status:"incompatible",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:t,resumable:!1,message:"checkpoint schema is not supported"};let A=m===2?c.identity?.siteUrl??null:c.source?.startUrl??null;if(d)try{let h=JSON.parse(d.line);h.type==="page"&&typeof h.page?.url=="string"&&i.add(h.page.url)}catch{}return{path:e,status:"ready",schemaVersion:m,siteUrl:A,completedPages:i.size,updatedAt:t,resumable:i.size>0,message:null}}import{extname as dA}from"node:path";function Fr(e){let t=dA(e);return t?`${e.slice(0,-t.length)}.checkpoint.ndjson`:`${e}.checkpoint.ndjson`}import{createHash as uA,randomUUID as AA}from"node:crypto";import{constants as Ea}from"node:fs";import{lstat as Xn,open as pA,readFile as hA,readdir as gA,rename as mA,writeFile as fA}from"node:fs/promises";import{basename as EA,join as Zn,resolve as Ta}from"node:path";function lt(e){return uA("sha256").update(e).digest("hex")}function ba(e){return EA(e)===e&&e.endsWith(".snapshot.json")&&!e.includes("/")&&!e.includes("\\")}async function Ca(e,t){if(!ba(t))throw new Error("invalid history file name");let r=Zn(e,t),n=await Xn(r);if(!n.isFile()||n.isSymbolicLink())throw new Error("history entry is not a regular file");let s=await pA(r,Ea.O_RDONLY|(Ea.O_NOFOLLOW??0));try{let i=await s.stat();if(!i.isFile()||i.ino!==n.ino||i.dev!==n.dev)throw new Error("history file changed while opening");let o=await s.readFile("utf8"),d=await Xn(r);if(!d.isFile()||d.ino!==i.ino||d.dev!==i.dev||d.size!==i.size||d.mtimeMs!==i.mtimeMs)throw new Error("history file changed while reading");return{content:o,size:i.size,mtimeMs:i.mtimeMs}}finally{await s.close()}}async function zn(e){let t=Ta(e),r;try{r=(await gA(t)).filter(ba).sort()}catch(m){if(m&&typeof m=="object"&&"code"in m&&m.code==="ENOENT")return{schemaVersion:1,revision:lt(""),entries:[],warnings:[]};throw m}let n=Zn(t,"catalog.v1.json"),s=new Map;try{let m=JSON.parse(await hA(n,"utf8"));m&&typeof m=="object"&&"entries"in m&&Array.isArray(m.entries)&&(s=new Map(m.entries.filter(A=>A&&typeof A=="object"&&"name"in A&&typeof A.name=="string").map(A=>[A.name,A])))}catch{}let i=[],o=[];for(let m of r)try{let A=await Xn(Zn(t,m));if(!A.isFile()||A.isSymbolicLink())throw new Error("not a regular file");let h=s.get(m);if(h&&h.size===A.size&&h.mtimeMs===A.mtimeMs&&h.digest&&h.runId){i.push(h);continue}let f=await Ca(t,m),b=lt(f.content),y=fe(JSON.parse(f.content));i.push({runId:lt(`${m}\0${b}`),name:m,size:f.size,mtimeMs:f.mtimeMs,digest:b,generatedAt:y.generatedAt,siteUrl:y.siteUrl,engineVersion:y.engineVersion,ruleSetVersion:y.ruleSetVersion,configurationHash:y.configurationHash,pages:y.pages.length,partial:y.partial,truncated:y.truncated})}catch(A){o.push(`${m}: ${A instanceof Error?A.message:String(A)}`)}i.sort((m,A)=>A.generatedAt.localeCompare(m.generatedAt)||A.runId.localeCompare(m.runId));let l={schemaVersion:1,revision:lt(i.map(m=>m.runId).join(`
193
- `)),entries:i,warnings:o},c=`${n}.${process.pid}.${AA()}.tmp`;return await fA(c,`${JSON.stringify(l)}
194
- `,"utf8"),await mA(c,n),l}async function Hr(e,t){let r=await Ca(Ta(e),t.name);if(r.size!==t.size||lt(r.content)!==t.digest||lt(`${t.name}\0${t.digest}`)!==t.runId)throw new Error("history run changed; reload the catalogue");return fe(JSON.parse(r.content))}import{createHash as TA}from"node:crypto";function bA(e,t){let r;try{r=new URL(e)}catch{return"Other"}for(let n of t){let s=r.origin;if(!n.startsWith(s))continue;let o=n.slice(s.length).split("/").map(d=>d.startsWith(":")?"[^/]+":d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("/");if(new RegExp(`^${o}$`).test(r.pathname))return n}return"Other"}function Ia(e,t){return{...e,config:{...e.config,enabledRules:t.enabledRules,severityOverrides:t.severityOverrides,suppressions:t.suppressions,regressionBudgets:t.regressionBudgets}}}function CA(e,t,r,n){let s={error:0,warning:0,info:0},i=0,o=0;for(let d of e)s[d.severity]+=1,r&&d.ruleId===r&&(i+=1),n&&(d.scope==="site"?"@site":bA(d.url,t))===n&&(o+=1);return{severity:s,selectedRuleCount:r?i:null,selectedTemplateCount:n?o:null}}function IA(e,t){let r=new Date(t).getTime(),n=e.suppressions.flatMap(s=>s.expiresAt?[new Date(`${s.expiresAt}T23:59:59.999Z`).getTime()+1]:[]).filter(s=>Number.isFinite(s)&&s>r).sort((s,i)=>s-i)[0];return n===void 0?"none":new Date(n).toISOString()}var dt=new Map;async function Qr(e,t={}){let r=t.limit??20;if(r!==20&&r!==50&&r!==100)throw new Error("trend limit must be 20, 50, or 100");let n=await zn(e),s=t.siteUrl??n.entries[0]?.siteUrl??null,i=n.entries.filter(N=>N.siteUrl===s).slice(0,r).reverse(),o=t.evaluatedAt??new Date().toISOString();if(!Number.isFinite(Date.parse(o)))throw new Error("invalid trend evaluation time");let d=[...n.warnings],l=Vt().map(N=>N.id);if(i.length===0)return{schemaVersion:1,siteUrl:s,revision:n.revision,evaluatedAt:o,limit:r,selectedRule:t.ruleId??null,selectedTemplate:t.template??null,templates:[],rules:l,points:[],warnings:d};let c=null,m=new Set;for(let N of[...i].reverse()){t.signal?.throwIfAborted();try{let S=await Hr(e,N);c={policy:S.config,templates:Ge(S.pages.map(_=>_.url)).map(_=>_.origin+_.template).sort((_,B)=>{let L=M=>M.split("/").filter(v=>v&&!v.startsWith(":")).length;return L(B)-L(_)||B.length-_.length||_.localeCompare(B)})};break}catch(S){m.add(N.runId),d.push(`${N.runId}: ${S instanceof Error?S.message:String(S)}`)}}if(!c)return{schemaVersion:1,siteUrl:s,revision:n.revision,evaluatedAt:o,limit:r,selectedRule:t.ruleId??null,selectedTemplate:t.template??null,templates:[],rules:l,points:[],warnings:d};let{templates:A,policy:h}=c,f=TA("sha256").update(JSON.stringify({revision:n.revision,ids:i.map(N=>N.runId),siteUrl:s,limit:r,ruleId:t.ruleId,template:t.template,policy:h,engine:W,rules:_e,suppressionDeadline:IA(h,o)})).digest("hex");if(!t.evaluatedAt&&dt.has(f))return dt.get(f);let b=[],y=null;for(let[N,S]of i.entries()){t.signal?.throwIfAborted();let _;if(m.has(S.runId)){y=null;continue}try{_=await Hr(e,S)}catch(x){d.push(`${S.runId}: ${x instanceof Error?x.message:String(x)}`),y=null;continue}let B=Ia(_,h),L=CA(le(B,{now:o}),A,t.ruleId,t.template),M=y?Qt(Ia(y.snapshot,h),B,{evaluatedAt:o}).summary:null,v=M?[...M.warnings]:[];M&&(M.coverage.onlyBefore>0||M.coverage.onlyAfter>0)&&v.push("coverage-changed"),N>0&&!y&&v.push("history-gap"),b.push({runId:S.runId,generatedAt:S.generatedAt,pages:_.pages.length,partial:_.partial,truncated:_.truncated,...L,verifiedNew:M?.lifecycle.new??null,verifiedResolved:M?.lifecycle.resolved??null,unverified:M?.unverified.length??null,warnings:v,previousRunId:y?.entry.runId??null}),y={entry:S,snapshot:_},t.onProgress?.(N+1,i.length)}let C={schemaVersion:1,siteUrl:s,revision:n.revision,evaluatedAt:o,limit:r,selectedRule:t.ruleId??null,selectedTemplate:t.template??null,templates:A,rules:l,points:b,warnings:d};return!t.evaluatedAt&&!t.signal?.aborted&&(dt.set(f,C),dt.size>8&&dt.delete(dt.keys().next().value)),C}import{parseArgs as yA}from"node:util";function ya(e){return yA({args:e,allowPositionals:!0,strict:!0,options:{baseline:{type:"string"},config:{type:"string"},output:{type:"string"},report:{type:"string"},"no-report":{type:"boolean"},"no-cache":{type:"boolean"},pages:{type:"string"},all:{type:"boolean"},"max-pages":{type:"string"},concurrency:{type:"string"},delay:{type:"string"},timeout:{type:"string"},sitemap:{type:"string"},"no-sitemap":{type:"boolean"},"include-query":{type:"boolean"},"ignore-robots":{type:"boolean"},strict:{type:"boolean"},json:{type:"boolean"},help:{type:"boolean"},version:{type:"boolean"},production:{type:"string"},preview:{type:"string"},"headers-env":{type:"string"},"production-headers-env":{type:"string"},"preview-headers-env":{type:"string"},"history-dir":{type:"string"},"trend-limit":{type:"string"},"no-history":{type:"boolean"},from:{type:"string"},to:{type:"string"},directory:{type:"string"},workflow:{type:"string"},yes:{type:"boolean"},force:{type:"boolean"},offline:{type:"boolean"},platform:{type:"string"},port:{type:"string"},"no-open":{type:"boolean"},render:{type:"string"}}})}function wa(e,t){return{...e,__config:t}}function Yr(e,t,r,n=!1){if(e===void 0)return r;let s=Number.parseInt(e,10);if(!Number.isInteger(s)||s<(n?0:1))throw new Error(`${t} must be a ${n?"non-negative":"positive"} integer`);return s}function Wt(e,t,r){if(t.sitemap&&t["no-sitemap"])throw new Error("--sitemap and --no-sitemap cannot be used together");let n=r?.config??{},s=t.__config??{},i={url:e,schemaVersion:1,maxPages:Yr(t.pages??t["max-pages"],t.pages!==void 0?"--pages":"--max-pages",s.maxPages??n.maxPages??100),concurrency:Yr(t.concurrency,"--concurrency",s.concurrency??n.concurrency??5),delay:Yr(t.delay,"--delay",s.delay??n.delay??100,!0),timeout:Yr(t.timeout,"--timeout",s.timeout??n.timeout??1e4)};return t["no-sitemap"]?i.sitemap="none":t.sitemap&&(i.sitemap=t.sitemap),t["include-query"]!==void 0&&(i.includeQuery=t["include-query"]),t["ignore-robots"]!==void 0&&(i.respectRobots=!t["ignore-robots"]),be(i,s,n)}import{dirname as ka,join as Da,resolve as ie}from"node:path";import{Buffer as wA}from"node:buffer";import{createRequire as xA}from"node:module";import{resolve as SA}from"node:path";import{pathToFileURL as NA}from"node:url";function xa(e){return e.default??e}async function _A(e){if(e)return e;try{let t="playwright",r=xA(SA(process.cwd(),"package.json")),n;try{n=NA(r.resolve(t)).href}catch(s){if(s.code!=="MODULE_NOT_FOUND")throw s;return xa(await import(t))}return xa(await import(n))}catch(t){let r=t.code,n=r==="MODULE_NOT_FOUND"||r==="ERR_MODULE_NOT_FOUND"?"Playwright is not installed. Run: npm install --save-dev playwright && npx playwright install chromium":`Playwright could not be loaded: ${t instanceof Error?t.message:String(t)}`;throw new Error(n,{cause:t})}}function RA(e){let t=0,r=[];return async function(){return t>=e&&await new Promise(s=>r.push(s)),t+=1,()=>{t-=1,r.shift()?.()}}}async function LA(e){let t=[],r=e.request().redirectedFrom();for(;r;){let n=await r.response(),s=await n?.headers();t.unshift({url:r.url(),status:n?.status()??0,location:s?.location??null}),r=r.redirectedFrom()}return t}async function Sa(e={}){let t=e.concurrency??2;if(!Number.isInteger(t)||t<1)throw new Error("Playwright renderer concurrency must be a positive integer");let r=await _A(e.playwright),n;try{n=await r.chromium.launch({headless:e.headless??!0})}catch(l){throw new Error("Chromium could not start. Run: npx playwright install chromium",{cause:l})}let s=null,i=null,o=RA(t),d=!1;return{id:"playwright-chromium-v1",async render(l){if(d)throw new Error("Playwright renderer is closed");let c=await o(),m=null;try{if(l.signal?.throwIfAborted(),!s)s=await n.newContext({userAgent:l.userAgent,acceptDownloads:!1}),i=l.userAgent;else if(i!==l.userAgent)throw new Error("A Playwright renderer cannot mix user agents in one browser context");m=await s.newPage(),await m.route("**/*",async h=>{h.request().resourceType()==="media"?await h.abort():await h.continue()}),m.on("download",h=>{h.cancel()});let A=()=>{m?.close()};l.signal?.addEventListener("abort",A,{once:!0});try{let h=await m.goto(l.url,{waitUntil:"domcontentloaded",timeout:l.timeout});if(!h)throw new Error(`Playwright did not receive a document response for ${l.url}`);if((e.networkIdleTimeout??2e3)>0)try{await m.waitForLoadState("networkidle",{timeout:Math.min(l.timeout,e.networkIdleTimeout??2e3)})}catch(C){if(l.signal?.aborted)throw C}l.signal?.throwIfAborted();let f=await m.content(),b=wA.byteLength(f);if(b>l.maxResponseBytes)throw new Error(`rendered HTML exceeds ${l.maxResponseBytes} bytes`);let y=await h.headers();return{finalUrl:m.url(),status:h.status(),headers:y,html:f,responseBytes:b,redirectChain:await LA(h)}}finally{l.signal?.removeEventListener("abort",A)}}finally{await m?.close().catch(()=>{}),c()}},async close(){d||(d=!0,await s?.close(),await n.close())}}}var OA=process.stdout.isTTY&&!process.env.NO_COLOR;function Gr(e,t){return OA?`\x1B[${e}m${t}\x1B[0m`:t}function Kt(e){return e.reduce((t,r)=>(t[r.severity]+=1,t),{error:0,warning:0,info:0})}function Wr(e){if(e.length===0){console.log(Gr("32","\u2713 No SEO regressions detected."));return}for(let r of e){let n=r.severity==="error"?Gr("31","\u2716 error"):r.severity==="warning"?Gr("33","\u26A0 warning"):Gr("34","\u2139 info");console.log(`${n} ${r.rule} ${r.url}`),console.log(` ${r.message}`),(r.before!==void 0||r.after!==void 0)&&(console.log(` before: ${JSON.stringify(r.before)}`),console.log(` after: ${JSON.stringify(r.after)}`))}let t=Kt(e);console.log(`
195
- ${t.error} error(s), ${t.warning} warning(s) detected.`)}import{createHash as vA}from"node:crypto";function Kr(e){if(!e)return{};let t=process.env[e];if(!t)throw new Error(`environment variable ${e} is empty or missing`);let r;try{r=JSON.parse(t)}catch(s){throw new Error(`environment variable ${e} must contain a JSON object`,{cause:s})}if(!r||typeof r!="object"||Array.isArray(r))throw new Error(`environment variable ${e} must contain a JSON object`);let n={};for(let[s,i]of Object.entries(r)){if(typeof i!="string")throw new Error(`header ${s} in ${e} must be a string`);try{new Headers({[s]:i})}catch(o){throw new Error(`header ${s} in ${e} is invalid`,{cause:o})}n[s]=i}return n}function qn(e,t,r=globalThis.fetch){if(Object.keys(e).length===0)return r;let n=new URL(t).origin;return(s,i)=>{let o=s instanceof Request?s.url:String(s);if(new URL(o).origin!==n)return r(s,i);let d=new Headers(s instanceof Request?s.headers:void 0);new Headers(i?.headers).forEach((l,c)=>d.set(c,l));for(let[l,c]of Object.entries(e))d.set(l,c);return r(s,{...i,headers:d})}}function Jt(e,t,r=globalThis.fetch){return qn(Kr(e),t,r)}function es(e,t){if(!t)return e;let r=vA("sha256").update(t).digest("hex").slice(0,12);return e.endsWith(".ndjson")?`${e.slice(0,-7)}.auth-${r}.ndjson`:`${e}.auth-${r}`}import{createInterface as kA}from"node:readline/promises";function _a(e,t){let r=e.trim().toLowerCase();if(r===""||r==="1")return{mode:"fixed",target:Math.min(100,t)};if(r==="2"||r==="all")return{mode:"all",target:t};if(r==="3"||r==="step")return{mode:"step",target:t};let n=Number.parseInt(r,10);return/^\d+$/.test(r)&&n>0?{mode:"fixed",target:Math.min(n,t)}:null}async function Ke(e){let t=kA({input:process.stdin,output:process.stdout});try{return(await t.question(e)).trim()}finally{t.close()}}async function Ra(e){for(;;){console.log(`
196
- Sitemap contains ${e.toLocaleString("en-US")} page(s).`),console.log("How many pages should be scanned?"),console.log(" 1) First 100"),console.log(` 2) All ${e.toLocaleString("en-US")}`),console.log(" 3) 100 at a time with confirmation"),console.log(" Or enter an exact number, for example 500.");let t=_a(await Ke("Choose [1]: "),e);if(!t){console.log("Enter 1, 2, 3, all, step, or a positive number.");continue}if(t.mode==="all"){let r=await Ke(`This will request ${e.toLocaleString("en-US")} pages. Continue? [y/N] `);if(!["y","yes"].includes(r.toLowerCase()))continue}return t}}function Na(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let r=Math.floor(t/60),n=t%60;return`${r}m ${n}s`}function DA(e,t,r){let n=t===0?1:Math.min(e/t,1),s=(n*100).toFixed(n<.1?1:0),i=Math.round(n*20),o=`[${"\u2588".repeat(i)}${"\u2591".repeat(20-i)}] ${s}% \xB7 ${e.toLocaleString("en-US")} / ${t.toLocaleString("en-US")} pages`;if(!r)return o;let d=r.elapsedMs/6e4,l=d>0?e/d:0,c=Math.max(0,t-e),m=l>0?c/l*6e4:null,A=[`elapsed ${Na(r.elapsedMs)}`,`${l.toFixed(l<10?1:0)} pages/min`,`ETA ${m===null?"\u2014":Na(m)}`,`retries ${r.retries}`,`errors ${r.errors}`];if(r.currentUrl){let h=r.currentUrl.length>60?`${r.currentUrl.slice(0,57)}\u2026`:r.currentUrl;A.push(h)}return`${o} \xB7 ${A.join(" \xB7 ")}`}function $t(e,t,r=!1,n=process.stdout,s){let i=DA(e,t,s),o=n===process.stderr?console.error:console.log;n.isTTY&&!r?(n.write(`\r${i}`),e>=t&&n.write(`
197
- `)):(n.isTTY||e>=t||e%1e3===0)&&o(i)}function La(e,t,r,n=process.stdout){let s=e.sitemap?`found, ${(e.candidateCount??e.sitemap.urls.length).toLocaleString("en-US")} URL(s)`:"not found; internal links",i=["Scan plan",` Target: ${e.startUrl}`,` Sitemap: ${s}`,` Robots: ${e.config.respectRobots?"respected":"ignored"}`,` Limit: ${t.target.toLocaleString("en-US")} page(s)`,` Concurrency: ${e.config.concurrency}`,` Delay: ${e.config.delay} ms`,` Checkpoint: ${r?"enabled":"disabled"}`];t.target>1e3&&i.push(" Notice: this is a large scan and may take a long time."),de(i.join(`
198
- `),n)}function Oa(e,t,r=process.stdout,n=Date.now){let s=n(),i=0,o=0,d=new Set;return{retry(){i+=1},progress(l,c){(l.error||l.status!==null&&l.status>=400)&&!d.has(l.url)&&(d.add(l.url),o+=1);let m=(()=>{try{return new URL(l.url).pathname||"/"}catch{return l.url}})();$t(c,e,t,r,{elapsedMs:n()-s,retries:i,errors:o,currentUrl:m})}}}function de(e,t=process.stdout){t.isTTY&&t.write("\r\x1B[2K"),t===process.stderr?console.error(e):console.log(e)}function ts(e){return e.reduce((t,r)=>((r.error||r.blockedByRobots||(r.status??500)>=400)&&(t.unavailable+=1),r.title||(t.missingTitle+=1),r.description||(t.missingDescription+=1),r.canonical||(t.missingCanonical+=1),r.h1Count===0&&(t.missingH1+=1),/(^|[\s,])noindex($|[\s,])/i.test(r.robots??"")&&(t.noindex+=1),t),{unavailable:0,missingTitle:0,missingDescription:0,missingCanonical:0,missingH1:0,noindex:0})}function rs(e){console.log(`Current health: ${e.unavailable} unavailable, ${e.missingTitle} missing title, ${e.missingDescription} missing description, ${e.missingCanonical} missing canonical, ${e.missingH1} missing H1, ${e.noindex} noindex.`)}var jt=".seo-audit.json",Ba="seo-audit-report.html",va=".seo-audit/history";function $r(e){if(e.render!==void 0&&e.render!=="http"&&e.render!=="playwright")throw new Error("--render must be http or playwright")}async function Jr(e){if($r(e),(e.render??"http")!=="http")return Sa()}async function Pa(e,t){let r=ie(e??t.output??jt),n=es(Fr(r),t["headers-env"]),s=await Vn(n),i=null;try{i=await Se(r)}catch(d){if(d.code!=="ENOENT")throw d}let o={command:"status",snapshot:i?{path:r,siteUrl:i.siteUrl,pages:i.pages.length,generatedAt:i.generatedAt,partial:i.partial,truncated:i.truncated}:null,checkpoint:s};return t.json?(console.log(JSON.stringify(o,null,2)),0):(console.log("SEO Crawl Audit status"),i?(console.log(` Snapshot: ${r}`),console.log(` Site: ${i.siteUrl}`),console.log(` Last completed result: ${i.pages.length.toLocaleString("en-US")} page(s) at ${i.generatedAt}`)):console.log(` Snapshot: not found (${r})`),s.status==="missing"?console.log(` Checkpoint: not found (${n})`):(console.log(` Checkpoint: ${s.status} (${n})`),s.siteUrl&&console.log(` Checkpoint site: ${s.siteUrl}`),console.log(` Saved pages: ${s.completedPages.toLocaleString("en-US")}`),s.updatedAt&&console.log(` Updated: ${s.updatedAt}`),s.message&&console.log(` Detail: ${s.message}`),s.resumable&&console.log(" Resume: run the same scan command again to reuse saved pages.")),0)}function Ma(e,t=!1){return t||!e["no-report"]&&(e.report!==void 0||process.stdin.isTTY&&process.stdout.isTTY&&!e.json)}async function ut(e,t,r=!1){if(!Ma(e,r))return null;let n=ie(e.report??Ba);return await Mr(n,t),n}function ce(e,t,r){if(!e)return e;try{let n=new URL(t),s=new URL(r),i=new URL(e);if(i.origin!==n.origin)return e;i.protocol=s.protocol,i.host=s.host;let o=n.pathname.replace(/\/$/,""),d=s.pathname.replace(/\/$/,"");return o&&i.pathname.startsWith(o)&&(i.pathname=`${d}${i.pathname.slice(o.length)}`||"/"),i.href}catch{return e}}function BA(e,t,r){let n=s=>s.map(i=>ce(i,t,r)??i).sort();return{...e,url:ce(e.url,t,r)??e.url,finalUrl:ce(e.finalUrl,t,r),canonical:ce(e.canonical,t,r),canonicalRaw:ce(e.canonicalRaw,t,r),links:n(e.links),internalLinks:n(e.internalLinks),externalLinks:n(e.externalLinks),images:e.images.map(s=>({...s,src:ce(s.src,t,r)})),hreflang:e.hreflang.map(s=>({...s,url:ce(s.url,t,r)})),redirectChain:e.redirectChain.map(s=>({...s,url:ce(s.url,t,r)??s.url,location:ce(s.location,t,r)}))}}function PA(e,t,r=ct(e),n={}){return{mode:t,startUrl:e.siteUrl,generatedAt:e.generatedAt,pages:e.pages,pageDetails:e.pages,issues:r,partial:e.partial,complete:!e.partial&&!e.truncated,engineVersion:e.engineVersion,ruleSetVersion:e.ruleSetVersion,branding:e.config.report,siteMetrics:ot(e),...n}}async function Je(e,t,r,n,s={}){let i=Da(ka(n),".seo-audit.metrics.json"),o=await Jn(e,i,{onWarning:d=>console.error(`Warning: ${d}`)});return PA(e,t,r,{...s,siteMetrics:o})}function Ua(e,t){return e["history-dir"]?ie(e["history-dir"]):t?Da(ka(t),va):ie(va)}async function ns(e,t,r,n){if(e["no-history"])return;let s=Ua(e,r);n&&!t.partial&&await $n(s,t);let i=await Gt(s,t.siteUrl);return Ft(i.map(o=>o.snapshot))??void 0}async function MA(e,t,r,n,s){let i=Wt(e,t,r),o=t.json?process.stderr:process.stdout,d=c=>{c.type==="plan-start"&&de(`Preparing crawl plan for ${c.url}`,o),c.type==="robots"&&de(c.robots.error?`robots.txt check failed: ${c.robots.error}`:`robots.txt checked (${c.robots.status??"unknown status"})`,o),c.type==="sitemap"&&de(c.sitemap?`Sitemap loaded: ${c.candidateCount??c.sitemap.urls.length} candidate URL(s)`:"No sitemap found; internal-link discovery will be used",o)},l=await Ae(i,{signal:s,fetch:n,onEvent:d});if(l.mode==="links"&&i.sitemap==="auto"&&process.stdin.isTTY&&process.stdout.isTTY&&!t.json){let c=await Ke("Sitemap was not found. Enter its full URL, or press Enter to crawl internal links: ");c&&(i={...i,sitemap:c},l=await Ae(i,{signal:s,fetch:n,onEvent:d}))}return l}function Fa(e,t){if(e.candidateCount===null){if(t.all)throw new Error("--all requires a sitemap");return{mode:"fixed",target:e.config.maxPages}}return t.all?{mode:"all",target:e.candidateCount}:t.pages!==void 0||t["max-pages"]!==void 0?{mode:"fixed",target:Math.min(e.config.maxPages,e.candidateCount)}:process.stdin.isTTY&&process.stdout.isTTY&&!t.json?Ra(e.candidateCount):{mode:"fixed",target:Math.min(100,e.candidateCount)}}async function Ha(e,t,r){if(!e)throw new Error("scan requires a URL");$r(t);let n=ie(t.output??jt),s=Jt(t["headers-env"],e),i=await MA(e,t,void 0,s,r),o=await Fa(i,t),d=es(Fr(n),t["headers-env"]),l=t["no-cache"]?void 0:jn(d),c=t.json?process.stderr:process.stdout;La(i,o,!!l,c);let m=new Map,A=Ma(t)?ie(t.report??Ba):null,h=0,f=-1,b=async(v=!1)=>{if(!A||m.size===0)return;let x=Date.now();if(!v&&m.size-f<100&&x-h<5e3)return;let k=fe({schemaVersion:1,startUrl:i.startUrl,robots:i.robots,sitemap:i.sitemap,options:{...i.config,maxPages:o.target},pages:[...m.values()],partial:!0,truncated:!0});await Mr(A,await Je(k,"scan",ct(k),n,{partial:!0,targetPages:o.target})),h=x,f=m.size},y=o.mode==="step"?Math.min(100,o.target):o.target,C=null,N=!1,S=await Jr(t);try{for(;y>0;){let v=Oa(y,o.mode==="step",c);C=await at(i,{signal:r,fetch:s,renderer:S,limit:y,checkpointStore:l,retainCheckpoint:!!l,async onBatch(H){for(let X of H)m.set(X.url,X);await b()},onEvent(H){H.type==="scan-start"&&de(`Starting crawl: up to ${H.total.toLocaleString("en-US")} page(s)`,t.json?process.stderr:process.stdout),H.type==="resume"&&de(`Resuming from checkpoint: ${H.completed.toLocaleString("en-US")} page(s) already available`,t.json?process.stderr:process.stdout),H.type==="retry"&&(v.retry(),de(`Retrying request (attempt ${H.attempt}) after ${H.delayMs} ms`,c)),H.type==="progress"&&v.progress(H.page,H.completed),H.type==="cancelled"&&de(`Scan interrupted after ${H.completed.toLocaleString("en-US")} page(s)`,t.json?process.stderr:process.stdout)}});for(let H of C.pages)m.set(H.url,H);if(await b(!0),C.partial||o.mode!=="step"||y>=o.target)break;rs(ts(C.pages));let x=Math.min(100,o.target-y),k=await Ke(`Check the next ${x} page(s)? [y/N] `);if(!["y","yes"].includes(k.toLowerCase())){N=!0;break}y=Math.min(o.target,y+100)}}finally{await S?.close?.()}if(!C)throw new Error("scan did not produce a result");await Pr(n,C.snapshot);let _=C.partial||N,B=await ns(t,C.snapshot,n,!_),L=_?A:await ut(t,await Je(C.snapshot,"scan",ct(C.snapshot),n,B?{history:B}:{}));_||await l?.clearCurrent();let M=ts(C.snapshot.pages);return t.json?console.log(JSON.stringify({command:"scan",pages:C.snapshot.pages.length,truncated:C.snapshot.truncated,health:M,output:n,report:L,checkpoint:_&&l?d:null},null,2)):(console.log(`Crawled ${C.snapshot.pages.length} page(s)${C.snapshot.truncated?" (limit reached)":""}.`),C.snapshot.sitemap&&console.log(`Loaded ${C.snapshot.sitemap.sitemapCount} sitemap file(s) from ${C.snapshot.sitemap.url}.`),rs(M),console.log(`Baseline saved to ${n}`),L&&console.log(`HTML report saved to ${L}`),_&&l&&console.log(`Resume checkpoint saved to ${d}`)),C.partial?130:0}async function Qa(e,t,r){$r(t);let n=ie(t.baseline??jt),s=await Se(n),i=e??s.siteUrl,o=Jt(t["headers-env"],i),d=await Ae({...Wt(i,t,s),sitemap:"none"},{signal:r,fetch:o}),l=s.pages.map(L=>({baselineUrl:L.url,targetUrl:ce(L.url,s.siteUrl,d.startUrl)??L.url})),c=[...new Set(l.map(({targetUrl:L})=>L))],m={...d,mode:"sitemap",candidateUrls:c,candidateCount:c.length,sitemap:{url:`${d.origin}/.seo-audit-targets`,urls:c,sitemapCount:0,truncated:!1,error:null}},A=await Jr(t),h;try{h=await at(m,{signal:r,fetch:o,renderer:A,limit:c.length,onEvent(L){L.type==="scan-start"&&de(`Starting regression check: ${L.total.toLocaleString("en-US")} page(s)`,t.json?process.stderr:process.stdout),L.type==="progress"&&$t(L.completed,c.length,!1,t.json?process.stderr:process.stdout)}})}finally{await A?.close?.()}let f=new Map(h.pages.map(L=>[L.url,L])),b=l.flatMap(({baselineUrl:L,targetUrl:M})=>{let v=f.get(M);return v?[{...v,url:L,finalUrl:ce(v.finalUrl,d.startUrl,s.siteUrl)}]:[]}),y=fe({...h.snapshot,siteUrl:s.siteUrl,config:{...h.snapshot.config,url:s.siteUrl},sitemap:s.sitemap,pages:b}),C=Hn(s,y,{enabledRules:y.config.enabledRules,severityOverrides:y.config.severityOverrides,suppressions:y.config.suppressions}),N=C.newIssues,S=Kt(N),_=await ns(t,y,n,!h.partial),B=await ut(t,await Je(y,"check",N,n,{...C,..._?{history:_}:{}}));return t.json?console.log(JSON.stringify({command:"check",baseline:n,pages:y.pages.length,summary:S,issues:N,lifecycle:C,report:B},null,2)):(console.log(`Checked ${y.pages.length} page(s).
199
- `),Wr(N),B&&console.log(`HTML report saved to ${B}`)),h.partial?130:S.error>0||C.budgetExceeded.length>0||t.strict&&S.warning>0?1:0}async function Ya(e,t){$r(e);let r=e.production,n=e.preview;if(!r||!n)throw new Error("compare requires --production and --preview URLs");let s=Jt(e["production-headers-env"],r),i=Jt(e["preview-headers-env"],n),o=await Ae(Wt(r,e),{signal:t,fetch:s}),d=await Fa(o,e),l=await Jr(e),c;try{c=await at(o,{signal:t,fetch:s,renderer:l,limit:d.target,onEvent(L){L.type==="scan-start"&&de(`Starting production crawl: up to ${L.total.toLocaleString("en-US")} page(s)`,e.json?process.stderr:process.stdout),L.type==="progress"&&$t(L.completed,d.target,!1,e.json?process.stderr:process.stdout)}})}finally{await l?.close?.()}if(c.partial)return 130;let m=await Ae({...Wt(n,e),sitemap:"none"},{signal:t,fetch:i}),A=c.snapshot.pages.map(L=>ce(L.url,r,n)??L.url),h={...m,mode:"sitemap",candidateUrls:[...new Set(A)].sort(),candidateCount:A.length,sitemap:{url:`${m.origin}/.seo-audit-preview-targets`,urls:[...new Set(A)].sort(),sitemapCount:0,truncated:!1,error:null}},f=await Jr(e),b;try{b=await at(h,{signal:t,fetch:i,renderer:f,limit:A.length,onEvent(L){L.type==="scan-start"&&de(`Starting preview crawl: ${L.total.toLocaleString("en-US")} page(s)`,e.json?process.stderr:process.stdout),L.type==="progress"&&$t(L.completed,A.length,!1,e.json?process.stderr:process.stdout)}})}finally{await f?.close?.()}let y=b.snapshot.pages.map(L=>BA(L,n,r)),C=fe({...b.snapshot,siteUrl:c.snapshot.siteUrl,startUrl:c.snapshot.siteUrl,config:{...b.snapshot.config,url:c.snapshot.siteUrl},robots:{...b.snapshot.robots,url:ce(b.snapshot.robots.url,n,r)??b.snapshot.robots.url},sitemap:c.snapshot.sitemap,pages:y,partial:b.snapshot.partial}),N=Hn(c.snapshot,C,{enabledRules:C.config.enabledRules,severityOverrides:C.config.severityOverrides,suppressions:C.config.suppressions}),S=N.newIssues,_=Kt(S),B=await ut(e,await Je(C,"check",S,ie(jt),{...N,comparison:{kind:"preview",productionUrl:r,previewUrl:n}}),!0);return e.json?console.log(JSON.stringify({command:"compare",production:r,preview:n,pages:C.pages.length,summary:_,issues:S,lifecycle:N,report:B},null,2)):(console.log(`Compared ${C.pages.length} production page(s) with preview.`),Wr(S),B&&console.log(`HTML report saved to ${B}`)),b.partial?130:_.error>0||N.budgetExceeded.length>0||e.strict&&_.warning>0?1:0}async function Ga(e,t){let r=ie(e??t.baseline??jt),n=await Se(r),s=await ns(t,n,r,!1),i=await ut(t,await Je(n,"scan",ct(n),r,s?{history:s}:{}),!0);return t.json?console.log(JSON.stringify({command:"report",baseline:r,pages:n.pages.length,report:i},null,2)):console.log(`HTML report saved to ${i}`),0}async function Wa(e,t){if(!!t.from!=!!t.to)throw new Error("history comparison requires both --from and --to");let r=Ua(t),n=t["trend-limit"]??"20";if(!["20","50","100"].includes(n))throw new Error("--trend-limit must be 20, 50, or 100");let s=Number(n);if(t.from&&t.to){let A=await Se(ie(t.from)),h=await Se(ie(t.to));if(A.siteUrl!==h.siteUrl)throw new Error("history snapshots must belong to the same site URL");let f=await Gt(r,h.siteUrl),b=Ft([...f.map(_=>_.snapshot),A,h]),{diff:y,summary:C}=Qt(A,h,{evaluatedAt:new Date().toISOString()}),N=await ut(t,await Je(h,"check",y.newIssues,ie(t.to),{...y,...b?{history:b}:{}}),!0),S=Kt(y.newIssues);return t.json?console.log(JSON.stringify({command:"history",from:ie(t.from),to:ie(t.to),summary:S,lifecycle:y,comparisonSummary:C,report:N,trendSummary:await Qr(r,{siteUrl:h.siteUrl,limit:s})},null,2)):(console.log(`Compared local snapshots from ${A.generatedAt} to ${h.generatedAt}.`),console.log(`Coverage: ${C.coverage.common} common pages; ${C.coverage.onlyBefore} only before; ${C.coverage.onlyAfter} only after.`),C.warnings.length>0&&console.log(`Comparison warnings: ${C.warnings.join(", ")}`),C.unverified.length>0&&console.log(`${C.unverified.length} apparent resolution(s) could not be verified.`),Wr(y.newIssues),N&&console.log(`HTML report saved to ${N}`)),0}let i;if(e)try{i=new URL(e).href}catch{throw new Error("history URL must be an HTTP(S) URL")}let o=await Gt(r,i);if(o.length===0)throw new Error(`no local history snapshots found in ${r}`);if(!i){let A=o.at(-1).snapshot.siteUrl;o=o.filter(h=>h.snapshot.siteUrl===A)}let d=o.at(-1),l=Ft(o.map(A=>A.snapshot)),c=await ut(t,await Je(d.snapshot,"scan",ct(d.snapshot),d.path,l?{history:l}:{}),!0),m=l?.points??[];if(t.json)console.log(JSON.stringify({command:"history",directory:r,snapshots:o.map((A,h)=>({path:A.path,...m[h]})),report:c,trendSummary:await Qr(r,{siteUrl:d.snapshot.siteUrl,limit:s})},null,2));else{console.log(`Local history for ${d.snapshot.siteUrl}:`);for(let[A,h]of o.entries()){let f=m[A];console.log(` ${h.snapshot.generatedAt} ${f?.pages??h.snapshot.pages.length} pages ${f?.errors??0} errors ${f?.warnings??0} warnings ${h.path}`)}c&&console.log(`HTML report saved to ${c}`)}return 0}import{mkdir as $a,readFile as UA,writeFile as ja}from"node:fs/promises";import{dirname as Va,isAbsolute as FA,join as ss,resolve as Ka}from"node:path";var HA="https://raw.githubusercontent.com/MelnixDev/seo-crawl-audit/v0/packages/core/config.schema.json",QA="seo-audit.config.json",YA=".github/workflows/seo-audit.yml",GA=[".seo-audit.checkpoint.ndjson",".seo-audit.metrics.json",".seo-audit/history/","seo-audit-report.html","seo-audit-report.html.json"];function WA(e){let t;try{t=new URL(e)}catch(r){throw new Error("init URL must be a full HTTP(S) URL",{cause:r})}if(!["http:","https:"].includes(t.protocol))throw new Error("init URL must be a full HTTP(S) URL");return t.hash="",t.href}function KA(e){let t=(e??"none").trim().toLowerCase(),n={"":"none",none:"none",manual:"manual",scheduled:"scheduled",schedule:"scheduled","pull-request":"pull-request",pull_request:"pull-request",pr:"pull-request"}[t];if(!n)throw new Error("--workflow must be none, manual, scheduled, or pull-request");return n}function JA(e){return`${JSON.stringify({$schema:HA,url:e,sitemap:"auto",maxPages:100,concurrency:5,delay:100,timeout:1e4,respectRobots:!0,includeQuery:!1,maxRedirects:10,maxResponseBytes:5*1024*1024,enabledRules:null,severityOverrides:{},suppressions:[],regressionBudgets:{error:0},report:{}},null,2)}
200
- `}function is(e="",t=""){return` - uses: actions/checkout@v6${t}
192
+ </script></body></html>`}function Vu(e){return e.reduce((t,r)=>(t[r.severity]+=1,t),{error:0,warning:0,info:0})}function Ft(e){if(e.length===0)return null;let r=[...new Map(e.map(o=>[`${o.generatedAt}|${o.configurationHash}|${o.pages.length}`,o])).values()].sort((o,d)=>o.generatedAt.localeCompare(d.generatedAt)),n=r.at(-1).siteUrl,s=r.filter(o=>o.siteUrl===n),i=s.map((o,d)=>{let l=le(o),c=Vu(l),m=d>0?s[d-1]:void 0,A=m?Ve(m,o):null;return{generatedAt:o.generatedAt,siteUrl:o.siteUrl,pages:o.pages.length,affectedPages:new Set(l.map(h=>h.url)).size,errors:c.error,warnings:c.warning,info:c.info,newIssues:A?.newIssues.length??0,resolvedIssues:A?.resolvedIssues.length??0,sitemapUrls:o.sitemap?.urls.length??0,maxDepth:o.pages.reduce((h,f)=>Math.max(h,f.depth),0),partial:o.partial||o.truncated}});return{siteUrl:n,points:i}}function ca(e){return{generatedAt:e.generatedAt,siteUrl:e.siteUrl,pages:e.pages.length,partial:e.partial,truncated:e.truncated,configurationHash:e.configurationHash,engineVersion:e.engineVersion,ruleSetVersion:e.ruleSetVersion}}function la(e){let t={error:0,warning:0,info:0};for(let r of e)t[r.severity]+=1;return t}function Ht(){return{new:0,ongoing:0,resolved:0,unchanged:0}}var Xu=new Set(["page-unreachable","http-error","robots-blocked","redirect-loop","long-redirect-chain","status-regression","page-missing","redirect-changed"]),Zu=new Set(["noindex","x-robots-noindex","missing-canonical","invalid-canonical","cross-domain-canonical","canonical-target-error","noindex-in-sitemap","redirect-in-sitemap","missing-title","duplicate-title","pagination-title-duplicate","near-duplicate-title","title-length","missing-description","duplicate-description","description-length","missing-h1","broken-internal-link","orphan-sitemap-page","crawlable-not-in-sitemap","invalid-hreflang","malformed-json-ld","http-on-https-site","invalid-language","duplicate-content","multiple-h1","missing-open-graph","missing-twitter-metadata","image-missing-alt","low-word-count","new-noindex","title-removed","title-changed","description-removed","canonical-removed","canonical-changed","h1-removed"]);function $u(e,t,r,n){if(e.scope==="site")return t.partial||t.truncated||r.partial||r.truncated?"incomplete-site":null;let s=n.get(e.url);return s?s.blockedByRobots?"robots-blocked":s.error||s.status===null||s.status>=400?"request-failed":Xu.has(e.ruleId)?null:s.status>=300||!s.contentType||!/(?:text\/html|application\/xhtml\+xml)/i.test(s.contentType)?"html-unavailable":Zu.has(e.ruleId)?null:"unknown-evidence":"not-checked"}function da(e,t){let r=new Map;for(let{lifecycle:n,issue:s}of e){let i=t(s),o=r.get(i)??{counts:Ht(),pages:new Set};o.counts[n]+=1,s.scope==="page"&&o.pages.add(s.url),r.set(i,o)}return[...r].map(([n,s])=>({id:n,counts:s.counts,affectedPages:s.pages.size})).sort((n,s)=>n.id.localeCompare(s.id))}function Qt(e,t,r){if(e.siteUrl!==t.siteUrl)throw new Error("local history snapshots must have the same site URL");let n=t.config,s=x=>({...x,config:{...x.config,enabledRules:n.enabledRules,severityOverrides:n.severityOverrides,suppressions:n.suppressions,regressionBudgets:n.regressionBudgets}}),i=s(e),o=s(t),d={now:r.evaluatedAt},l=le(i,d),c=le(o,d),m=Ve(i,o,d),A=[],h=new Map(t.pages.map(x=>[x.url,x])),f=m.resolvedIssues.filter(x=>{let D=$u(x,e,t,h);return D&&A.push({fingerprint:x.fingerprint,ruleId:x.ruleId,url:x.url,reason:D}),!D}),b={...m,resolvedIssues:f},y=new Set(e.pages.map(x=>x.url)),C=new Set(t.pages.map(x=>x.url)),R=[...y].filter(x=>C.has(x)).length,S=[];(e.partial||e.truncated)&&S.push("incomplete-before"),(t.partial||t.truncated)&&S.push("incomplete-after"),e.configurationHash!==t.configurationHash&&S.push("configuration-changed"),e.config.includeQuery!==t.config.includeQuery&&S.push("url-policy-changed"),e.ruleSetVersion!==t.ruleSetVersion&&S.push("rule-set-changed"),e.generatedAt===t.generatedAt&&S.push("same-timestamp"),(JSON.stringify(e.config.enabledRules)!==JSON.stringify(n.enabledRules)||JSON.stringify(e.config.severityOverrides)!==JSON.stringify(n.severityOverrides)||JSON.stringify(e.config.suppressions)!==JSON.stringify(n.suppressions))&&S.push("evaluation-policy-changed");let _=[...b.newIssues.map(x=>({lifecycle:"new",issue:x})),...b.ongoingIssues.map(x=>({lifecycle:"ongoing",issue:x})),...b.resolvedIssues.map(x=>({lifecycle:"resolved",issue:x})),...b.unchangedIssues.map(x=>({lifecycle:"unchanged",issue:x}))],B=Ht(),v={error:Ht(),warning:Ht(),info:Ht()};for(let x of _)B[x.lifecycle]+=1,v[x.issue.severity][x.lifecycle]+=1;let M=Ge([...new Set([...y,...C])]),O=new Map(M.flatMap(x=>x.urls.map(D=>[D,x.origin+x.template])));return{diff:b,summary:{schemaVersion:1,evaluatedAt:r.evaluatedAt,from:ca(e),to:ca(t),coverage:{common:R,onlyBefore:y.size-R,onlyAfter:C.size-R,complete:!(e.partial||e.truncated||t.partial||t.truncated)},evaluationPolicy:{source:"after",enabledRules:n.enabledRules?[...n.enabledRules]:null,severityOverrides:{...n.severityOverrides},suppressions:n.suppressions.map(x=>({...x})),regressionBudgets:{...n.regressionBudgets}},warnings:S,beforeFindings:la(l),afterFindings:la(c),lifecycle:B,lifecycleBySeverity:v,budgetExceeded:b.budgetExceeded,byRule:da(_,x=>x.ruleId),byTemplate:da(_,x=>x.scope==="site"?"@site":O.get(x.url)??"@unknown"),unverified:A.sort((x,D)=>x.url.localeCompare(D.url)||x.ruleId.localeCompare(D.ruleId))}}}function J(e,t,r,n,s="count",i){return{id:e,label:t,value:r,unit:s,source:{id:"crawl",label:"SEO Crawl Audit"},observedAt:n,confidence:"high",status:"available",...i?{detail:i}:{}}}function ua(e,t,r,n,s){return{id:e,label:t,value:null,unit:"count",source:r,observedAt:n,confidence:"high",status:"not-connected",...s?{detail:s}:{}}}function qu(e,t,r,n,s){return{id:e,label:t,value:r,unit:"count",source:{id:"crawl-estimate",label:"SEO Crawl Audit"},observedAt:n,confidence:"low",status:"estimate",...s?{detail:s}:{}}}function Aa(e){return[e.robots,e.xRobotsTag].some(t=>/(^|[\s,])noindex($|[\s,])/i.test(t??""))}function Qn(e,t){if(Array.isArray(e))return e.reduce((i,o)=>i+Qn(o,t),0);if(!e||typeof e!="object")return 0;let r=e,n=r["@type"];return(Array.isArray(n)?n.filter(i=>i===t).length:n===t?1:0)+Object.entries(r).filter(([i])=>i!=="@type").reduce((i,[,o])=>i+Qn(o,t),0)}function Or(e,t,r){return e.filter(n=>n.status!==null&&n.status>=t&&n.status<=r).length}function ot(e){let t=e.pages,r=e.generatedAt,n=t.filter(h=>/(?:text\/html|application\/xhtml\+xml)/i.test(h.contentType??"")),s=t.filter(Aa),i=n.filter(h=>!h.error&&!h.blockedByRobots&&h.status!==null&&h.status>=200&&h.status<300&&!Aa(h)),o=e.sitemap?.urls.length??0,d=o>t.length&&t.length>0?Math.min(o,Math.round(i.length/t.length*o)):i.length,l=new Set(t.flatMap(h=>h.images.map(f=>f.src).filter(f=>!!f))),c=t.reduce((h,f)=>h+f.jsonLd.reduce((b,y)=>b+(y.valid?Qn(y.value,"Product"):0),0),0),m=t.reduce((h,f)=>h+f.responseBytes,0),A=t.length>0?Math.round(e.statistics.durationMs/t.length):0;return{schemaVersion:1,siteUrl:e.siteUrl,observedAt:r,metrics:[J("pages.sitemap",{en:"Sitemap URLs",uk:"URL \u0443 sitemap"},o,r),J("pages.checked",{en:"Pages checked",uk:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A"},t.length,r),J("pages.html",{en:"HTML pages",uk:"HTML-\u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438"},n.length,r),J("pages.indexable",{en:"Crawlable HTML pages",uk:"\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u0456 HTML-\u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438"},i.length,r,"count",{en:"Successful HTML pages without a detected noindex directive. This is not the Google index count.",uk:"\u0423\u0441\u043F\u0456\u0448\u043D\u0456 HTML-\u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438 \u0431\u0435\u0437 \u0432\u0438\u044F\u0432\u043B\u0435\u043D\u043E\u0457 \u0434\u0438\u0440\u0435\u043A\u0442\u0438\u0432\u0438 noindex. \u0426\u0435 \u043D\u0435 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0432 \u0456\u043D\u0434\u0435\u043A\u0441\u0456 Google."}),qu("search.indexable-estimate",{en:"Estimated indexable pages",uk:"\u041E\u0440\u0456\u0454\u043D\u0442\u043E\u0432\u043D\u0430 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0456\u043D\u0434\u0435\u043A\u0441\u043E\u0432\u0430\u043D\u0438\u0445 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A"},d,r,{en:"Estimated from the crawlable-page ratio and sitemap size. This is not the number indexed by Google.",uk:"\u041E\u0446\u0456\u043D\u043A\u0430 \u0437\u0430 \u0447\u0430\u0441\u0442\u043A\u043E\u044E \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0445 \u0434\u043B\u044F \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u0457 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0456 \u0440\u043E\u0437\u043C\u0456\u0440\u043E\u043C sitemap. \u0426\u0435 \u043D\u0435 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0432 \u0456\u043D\u0434\u0435\u043A\u0441\u0456 Google."}),ua("search.google-indexed",{en:"Indexed by Google",uk:"\u041F\u0440\u043E\u0456\u043D\u0434\u0435\u043A\u0441\u043E\u0432\u0430\u043D\u043E Google"},{id:"google-search-console",label:"Google Search Console"},r,{en:"Connect an authoritative provider to confirm this value; crawlability is not proof of indexing.",uk:"\u041F\u0456\u0434\u043A\u043B\u044E\u0447\u0456\u0442\u044C \u0430\u0432\u0442\u043E\u0440\u0438\u0442\u0435\u0442\u043D\u0435 \u0434\u0436\u0435\u0440\u0435\u043B\u043E \u0434\u043B\u044F \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043D\u044F; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456\u0441\u0442\u044C \u0434\u043B\u044F crawl \u043D\u0435 \u0434\u043E\u0432\u043E\u0434\u0438\u0442\u044C \u0456\u043D\u0434\u0435\u043A\u0441\u0430\u0446\u0456\u044E."}),ua("search.bing-indexed",{en:"Indexed by Bing",uk:"\u041F\u0440\u043E\u0456\u043D\u0434\u0435\u043A\u0441\u043E\u0432\u0430\u043D\u043E Bing"},{id:"bing-webmaster",label:"Bing Webmaster Tools"},r,{en:"Connect an authoritative provider to confirm this value.",uk:"\u041F\u0456\u0434\u043A\u043B\u044E\u0447\u0456\u0442\u044C \u0430\u0432\u0442\u043E\u0440\u0438\u0442\u0435\u0442\u043D\u0435 \u0434\u0436\u0435\u0440\u0435\u043B\u043E \u0434\u043B\u044F \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043D\u044F \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F."}),J("pages.noindex",{en:"Noindex pages",uk:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0438 noindex"},s.length,r),J("pages.robots-blocked",{en:"Blocked by robots.txt",uk:"\u0417\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E robots.txt"},t.filter(h=>h.blockedByRobots).length,r),J("assets.images",{en:"Unique images",uk:"\u0423\u043D\u0456\u043A\u0430\u043B\u044C\u043D\u0456 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F"},l.size,r),J("commerce.products",{en:"Product entities",uk:"\u0422\u043E\u0432\u0430\u0440\u0438 Product"},c,r),J("links.internal",{en:"Internal links",uk:"\u0412\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u0456 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F"},e.linkGraph.internalEdges,r),J("links.external",{en:"External links",uk:"\u0417\u043E\u0432\u043D\u0456\u0448\u043D\u0456 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F"},e.linkGraph.externalEdges,r),J("crawl.max-depth",{en:"Maximum crawl depth",uk:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430 \u0433\u043B\u0438\u0431\u0438\u043D\u0430"},Math.max(0,...t.map(h=>h.depth)),r),J("crawl.transfer",{en:"HTML transferred",uk:"\u041F\u0435\u0440\u0435\u0434\u0430\u043D\u043E HTML"},m,r,"bytes"),J("crawl.average-time",{en:"Average crawl time per page",uk:"\u0421\u0435\u0440\u0435\u0434\u043D\u0456\u0439 \u0447\u0430\u0441 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443"},A,r,"milliseconds"),J("status.2xx",{en:"HTTP 2xx",uk:"HTTP 2xx"},Or(t,200,299),r),J("status.3xx",{en:"HTTP 3xx",uk:"HTTP 3xx"},Or(t,300,399),r),J("status.4xx",{en:"HTTP 4xx",uk:"HTTP 4xx"},Or(t,400,499),r),J("status.5xx",{en:"HTTP 5xx",uk:"HTTP 5xx"},Or(t,500,599),r)]}}function ct(e,t={}){return le(e,t)}function Yn(e,t,r={}){return Ve(e,t,r)}import{access as nA,mkdir as sA,readFile as Jn,readdir as iA,rename as aA,writeFile as ha}from"node:fs/promises";import{randomUUID as jn}from"node:crypto";import{join as ga,resolve as kr}from"node:path";import{setTimeout as oA}from"node:timers/promises";var zu=Object.freeze({"search.google-site-estimate":["google-site-search","google-site-search-manual"],"domain.registration-date":["rdap"],"domain.expiration-date":["rdap"],"domain.registrar":["rdap"]});function eA(e){return zu[e.id]?.includes(e.source.id)===!0}function Dr(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} must be an object`);return e}function Ie(e,t){if(typeof e!="string"||e==="")throw new Error(`${t} must be a non-empty string`);return e}function pa(e,t){let r=Dr(e,t);return{en:Ie(r.en,`${t}.en`),uk:Ie(r.uk,`${t}.uk`)}}function tA(e,t){let r=Dr(e,`metrics[${t}]`),n=["count","bytes","milliseconds","date","text"],s=["high","medium","low"],i=["available","estimate","unavailable","not-connected","error"],o=Dr(r.source,`metrics[${t}].source`);if(!n.includes(String(r.unit)))throw new Error(`metrics[${t}].unit is invalid`);if(!s.includes(String(r.confidence)))throw new Error(`metrics[${t}].confidence is invalid`);if(!i.includes(String(r.status)))throw new Error(`metrics[${t}].status is invalid`);if(r.value!==null&&typeof r.value!="string"&&typeof r.value!="number")throw new Error(`metrics[${t}].value must be a number, string, or null`);let d=Ie(r.observedAt,`metrics[${t}].observedAt`);if(Number.isNaN(Date.parse(d)))throw new Error(`metrics[${t}].observedAt must be an ISO date`);let l=o.url===void 0?void 0:Ie(o.url,`metrics[${t}].source.url`);return{id:Ie(r.id,`metrics[${t}].id`),label:pa(r.label,`metrics[${t}].label`),value:r.value,unit:r.unit,source:{id:Ie(o.id,`metrics[${t}].source.id`),label:Ie(o.label,`metrics[${t}].source.label`),...l?{url:l}:{}},observedAt:d,confidence:r.confidence,status:r.status,...r.stale===!0?{stale:!0}:{},...r.detail===void 0?{}:{detail:pa(r.detail,`metrics[${t}].detail`)}}}function Gn(e){let t=Dr(e,"site metrics state");if(t.schemaVersion!==1)throw new Error("site metrics state schemaVersion must be 1");let r=Ie(t.siteUrl,"site metrics state.siteUrl"),n=new URL(r);if(!["http:","https:"].includes(n.protocol))throw new Error("site metrics state.siteUrl must use HTTP(S)");let s=Ie(t.updatedAt,"site metrics state.updatedAt");if(Number.isNaN(Date.parse(s)))throw new Error("site metrics state.updatedAt must be an ISO date");if(!Array.isArray(t.metrics))throw new Error("site metrics state.metrics must be an array");return{schemaVersion:1,siteUrl:n.href,updatedAt:s,metrics:t.metrics.map(tA)}}function rA(e){return e.source.id==="rdap"?6048e5:e.id==="search.google-site-estimate"?2592e6:null}function Wn(e,t=new Date){let r=t.getTime();return{...e,metrics:e.metrics.map(n=>{let s=rA(n);return s!==null&&r-Date.parse(n.observedAt)>s?{...n,stale:!0}:{...n,stale:!1}})}}function Kn(e,t){if(!t||new URL(e.siteUrl).origin!==new URL(t.siteUrl).origin)return e;let r=t.metrics.filter(eA),n=new Map(r.map(i=>[i.id,i])),s=new Set(e.metrics.map(i=>i.id));return{...e,observedAt:t.updatedAt>e.observedAt?t.updatedAt:e.observedAt,metrics:[...e.metrics.map(i=>i.source.id==="crawl"?i:n.get(i.id)??i),...r.filter(i=>!s.has(i.id))]}}async function ma(e,t){for(let r=0;;r+=1)try{await aA(e,t);return}catch(n){let s=n&&typeof n=="object"&&"code"in n?n.code:null;if(process.platform!=="win32"||r>=5||s!=="EPERM"&&s!=="EACCES"&&s!=="EBUSY")throw n;await oA(10*2**r)}}async function Br(e=process.cwd()){let t=kr(e,tn);try{return await nA(t),t}catch{return null}}async function Yt(e){let t=e?kr(e):await Br();if(!t)return{};try{return rn(JSON.parse(await Jn(t,"utf8")))}catch(r){throw new Error(`invalid config ${t}: ${r instanceof Error?r.message:String(r)}`,{cause:r})}}async function Pr(e,t){let r=`${e}.${process.pid}.${jn()}.tmp`;await ha(r,`${JSON.stringify(t,null,2)}
193
+ `,"utf8"),await ma(r,e)}async function Se(e){try{return fe(JSON.parse(await Jn(e,"utf8")))}catch(t){throw t instanceof SyntaxError?new Error(`invalid snapshot JSON: ${e}`,{cause:t}):t instanceof Error&&t.message.startsWith("unsupported")?new Error(`unsupported or invalid baseline: ${e}`,{cause:t}):t}}async function fa(e,t,r=new Date){let n;try{n=JSON.parse(await Jn(e,"utf8"))}catch(i){if(i&&typeof i=="object"&&"code"in i&&i.code==="ENOENT")return null;throw i instanceof SyntaxError?new Error(`invalid site metrics JSON: ${e}`,{cause:i}):i}let s=Wn(Gn(n),r);return t&&new URL(s.siteUrl).origin!==new URL(t).origin?null:s}async function Vn(e,t,r={}){let n=ot(e);try{return Kn(n,await fa(t,e.siteUrl,r.now))}catch(s){return r.onWarning?.(`Could not load site metrics from ${t}: ${s instanceof Error?s.message:String(s)}`),n}}async function Mr(e,t,r={}){let n=`${e}.${process.pid}.${jn()}.tmp`;await ha(n,oa(t,r),"utf8"),await ma(n,e)}function cA(e){return`${e.generatedAt.replaceAll(":","-").replaceAll(".","-")}-${e.configurationHash.slice(0,8)}-${jn()}.snapshot.json`}async function Xn(e,t){let r=kr(e);await sA(r,{recursive:!0});let n=ga(r,cA(t));return await Pr(n,t),n}async function Gt(e,t){let r=kr(e),n;try{n=await iA(r)}catch(i){if(i&&typeof i=="object"&&"code"in i&&i.code==="ENOENT")return[];throw i}let s=[];for(let i of n.filter(o=>o.endsWith(".snapshot.json")).sort()){let o=ga(r,i),d=await Se(o);(!t||d.siteUrl===t)&&s.push({path:o,snapshot:d})}return s.sort((i,o)=>i.snapshot.generatedAt.localeCompare(o.snapshot.generatedAt)||i.path.localeCompare(o.path))}import{appendFile as lA,rename as dA,stat as Ta,unlink as uA,writeFile as AA}from"node:fs/promises";import{createReadStream as ba}from"node:fs";import{createInterface as Ca}from"node:readline";function pA(e){return{type:"seo-audit-checkpoint",schemaVersion:2,identity:e}}function Ea(e,t){if(!e||typeof e!="object")return!1;let r=e;if(r.type!=="seo-audit-checkpoint")return!1;if(r.schemaVersion===2)return JSON.stringify(r.identity)===JSON.stringify(t);if(r.schemaVersion!==1)return!1;let n=r.source;return n?.startUrl===t.siteUrl&&(n.sitemap??null)===t.sitemapUrl&&(n.includeQuery??!1)===t.includeQuery&&(n.respectRobots??!0)===t.respectRobots}var Ur=class{path;#e=null;#t=Promise.resolve();constructor(t){this.path=t}async#r(t){let r=`${this.path}.${process.pid}.${Date.now()}.tmp`;await AA(r,`${JSON.stringify(pA(t))}
194
+ `,"utf8"),await dA(r,this.path),this.#e=t}async load(t){await this.flush();try{await Ta(this.path)}catch(c){if(c.code!=="ENOENT")throw c;return await this.#r(t),null}let r=ba(this.path,{encoding:"utf8"}),n=Ca({input:r,crlfDelay:1/0}),s=new Map,i,o=0,d=null,l=(c,m)=>{try{let A=JSON.parse(c);A.type==="page"&&typeof A.page?.url=="string"&&s.set(A.page.url,A.page)}catch(A){throw new Error(`corrupt checkpoint record ${m} in ${this.path}`,{cause:A})}};for await(let c of n){if(o+=1,o===1){try{i=JSON.parse(c)}catch{i=null}if(!Ea(i,t))return n.close(),r.destroy(),await this.#r(t),null;this.#e=t;continue}c.trim()&&(d&&l(d.line,d.lineNumber),d={line:c,lineNumber:o})}if(o===0||!Ea(i,t))return await this.#r(t),null;if(d)try{l(d.line,d.lineNumber)}catch{}return{identity:t,pages:[...s.values()]}}append(t,r){return this.#t=this.#t.then(async()=>{(!this.#e||JSON.stringify(this.#e)!==JSON.stringify(t))&&await this.#r(t),await lA(this.path,`${JSON.stringify({type:"page",page:r})}
195
+ `,"utf8")}),this.#t}async clear(t){if(await this.flush(),!(this.#e&&JSON.stringify(this.#e)!==JSON.stringify(t))){try{await uA(this.path)}catch(r){if(r.code!=="ENOENT")throw r}this.#e=null}}async clearCurrent(){this.#e&&await this.clear(this.#e)}async flush(){await this.#t}};function Zn(e){return new Ur(e)}async function $n(e){let t;try{t=(await Ta(e)).mtime.toISOString()}catch(h){if(h.code==="ENOENT")return{path:e,status:"missing",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:null,resumable:!1,message:null};throw h}let r=ba(e,{encoding:"utf8"}),n=Ca({input:r,crlfDelay:1/0}),s,i=new Set,o=0,d=null,l=(h,f)=>{try{let b=JSON.parse(h);b.type==="page"&&typeof b.page?.url=="string"&&i.add(b.page.url)}catch{return{path:e,status:"corrupt",schemaVersion:null,siteUrl:null,completedPages:i.size,updatedAt:t,resumable:!1,message:`checkpoint record ${f} is corrupt`}}return null};for await(let h of n){if(o+=1,o===1){try{s=JSON.parse(h)}catch{s=null}continue}if(h.trim()){if(d){let f=l(d.line,d.lineNumber);if(f)return f}d={line:h,lineNumber:o}}}if(!s)return{path:e,status:"corrupt",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:t,resumable:!1,message:"checkpoint header is not valid JSON"};if(typeof s!="object"||s.type!=="seo-audit-checkpoint")return{path:e,status:"incompatible",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:t,resumable:!1,message:"file is not an SEO Crawl Audit checkpoint"};let c=s,m=c.schemaVersion===1||c.schemaVersion===2?c.schemaVersion:null;if(m===null)return{path:e,status:"incompatible",schemaVersion:null,siteUrl:null,completedPages:0,updatedAt:t,resumable:!1,message:"checkpoint schema is not supported"};let A=m===2?c.identity?.siteUrl??null:c.source?.startUrl??null;if(d)try{let h=JSON.parse(d.line);h.type==="page"&&typeof h.page?.url=="string"&&i.add(h.page.url)}catch{}return{path:e,status:"ready",schemaVersion:m,siteUrl:A,completedPages:i.size,updatedAt:t,resumable:i.size>0,message:null}}import{extname as hA}from"node:path";function Fr(e){let t=hA(e);return t?`${e.slice(0,-t.length)}.checkpoint.ndjson`:`${e}.checkpoint.ndjson`}import{createHash as gA,randomUUID as mA}from"node:crypto";import{constants as Ia}from"node:fs";import{lstat as qn,open as fA,readFile as EA,readdir as TA,rename as bA,writeFile as CA}from"node:fs/promises";import{basename as IA,join as zn,resolve as ya}from"node:path";function lt(e){return gA("sha256").update(e).digest("hex")}function wa(e){return IA(e)===e&&e.endsWith(".snapshot.json")&&!e.includes("/")&&!e.includes("\\")}async function xa(e,t){if(!wa(t))throw new Error("invalid history file name");let r=zn(e,t),n=await qn(r);if(!n.isFile()||n.isSymbolicLink())throw new Error("history entry is not a regular file");let s=await fA(r,Ia.O_RDONLY|(Ia.O_NOFOLLOW??0));try{let i=await s.stat();if(!i.isFile()||i.ino!==n.ino||i.dev!==n.dev)throw new Error("history file changed while opening");let o=await s.readFile("utf8"),d=await qn(r);if(!d.isFile()||d.ino!==i.ino||d.dev!==i.dev||d.size!==i.size||d.mtimeMs!==i.mtimeMs)throw new Error("history file changed while reading");return{content:o,size:i.size,mtimeMs:i.mtimeMs}}finally{await s.close()}}async function es(e){let t=ya(e),r;try{r=(await TA(t)).filter(wa).sort()}catch(m){if(m&&typeof m=="object"&&"code"in m&&m.code==="ENOENT")return{schemaVersion:1,revision:lt(""),entries:[],warnings:[]};throw m}let n=zn(t,"catalog.v1.json"),s=new Map;try{let m=JSON.parse(await EA(n,"utf8"));m&&typeof m=="object"&&"entries"in m&&Array.isArray(m.entries)&&(s=new Map(m.entries.filter(A=>A&&typeof A=="object"&&"name"in A&&typeof A.name=="string").map(A=>[A.name,A])))}catch{}let i=[],o=[];for(let m of r)try{let A=await qn(zn(t,m));if(!A.isFile()||A.isSymbolicLink())throw new Error("not a regular file");let h=s.get(m);if(h&&h.size===A.size&&h.mtimeMs===A.mtimeMs&&h.digest&&h.runId){i.push(h);continue}let f=await xa(t,m),b=lt(f.content),y=fe(JSON.parse(f.content));i.push({runId:lt(`${m}\0${b}`),name:m,size:f.size,mtimeMs:f.mtimeMs,digest:b,generatedAt:y.generatedAt,siteUrl:y.siteUrl,engineVersion:y.engineVersion,ruleSetVersion:y.ruleSetVersion,configurationHash:y.configurationHash,pages:y.pages.length,partial:y.partial,truncated:y.truncated})}catch(A){o.push(`${m}: ${A instanceof Error?A.message:String(A)}`)}i.sort((m,A)=>A.generatedAt.localeCompare(m.generatedAt)||A.runId.localeCompare(m.runId));let l={schemaVersion:1,revision:lt(i.map(m=>m.runId).join(`
196
+ `)),entries:i,warnings:o},c=`${n}.${process.pid}.${mA()}.tmp`;return await CA(c,`${JSON.stringify(l)}
197
+ `,"utf8"),await bA(c,n),l}async function Hr(e,t){let r=await xa(ya(e),t.name);if(r.size!==t.size||lt(r.content)!==t.digest||lt(`${t.name}\0${t.digest}`)!==t.runId)throw new Error("history run changed; reload the catalogue");return fe(JSON.parse(r.content))}import{createHash as yA}from"node:crypto";function wA(e,t){let r;try{r=new URL(e)}catch{return"Other"}for(let n of t){let s=r.origin;if(!n.startsWith(s))continue;let o=n.slice(s.length).split("/").map(d=>d.startsWith(":")?"[^/]+":d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("/");if(new RegExp(`^${o}$`).test(r.pathname))return n}return"Other"}function Sa(e,t){return{...e,config:{...e.config,enabledRules:t.enabledRules,severityOverrides:t.severityOverrides,suppressions:t.suppressions,regressionBudgets:t.regressionBudgets}}}function xA(e,t,r,n){let s={error:0,warning:0,info:0},i=0,o=0;for(let d of e)s[d.severity]+=1,r&&d.ruleId===r&&(i+=1),n&&(d.scope==="site"?"@site":wA(d.url,t))===n&&(o+=1);return{severity:s,selectedRuleCount:r?i:null,selectedTemplateCount:n?o:null}}function SA(e,t){let r=new Date(t).getTime(),n=e.suppressions.flatMap(s=>s.expiresAt?[new Date(`${s.expiresAt}T23:59:59.999Z`).getTime()+1]:[]).filter(s=>Number.isFinite(s)&&s>r).sort((s,i)=>s-i)[0];return n===void 0?"none":new Date(n).toISOString()}var dt=new Map;async function Qr(e,t={}){let r=t.limit??20;if(r!==20&&r!==50&&r!==100)throw new Error("trend limit must be 20, 50, or 100");let n=await es(e),s=t.siteUrl??n.entries[0]?.siteUrl??null,i=n.entries.filter(R=>R.siteUrl===s).slice(0,r).reverse(),o=t.evaluatedAt??new Date().toISOString();if(!Number.isFinite(Date.parse(o)))throw new Error("invalid trend evaluation time");let d=[...n.warnings],l=Xt().map(R=>R.id);if(i.length===0)return{schemaVersion:1,siteUrl:s,revision:n.revision,evaluatedAt:o,limit:r,selectedRule:t.ruleId??null,selectedTemplate:t.template??null,templates:[],rules:l,points:[],warnings:d};let c=null,m=new Set;for(let R of[...i].reverse()){t.signal?.throwIfAborted();try{let S=await Hr(e,R);c={policy:S.config,templates:Ge(S.pages.map(_=>_.url)).map(_=>_.origin+_.template).sort((_,B)=>{let v=M=>M.split("/").filter(O=>O&&!O.startsWith(":")).length;return v(B)-v(_)||B.length-_.length||_.localeCompare(B)})};break}catch(S){m.add(R.runId),d.push(`${R.runId}: ${S instanceof Error?S.message:String(S)}`)}}if(!c)return{schemaVersion:1,siteUrl:s,revision:n.revision,evaluatedAt:o,limit:r,selectedRule:t.ruleId??null,selectedTemplate:t.template??null,templates:[],rules:l,points:[],warnings:d};let{templates:A,policy:h}=c,f=yA("sha256").update(JSON.stringify({revision:n.revision,ids:i.map(R=>R.runId),siteUrl:s,limit:r,ruleId:t.ruleId,template:t.template,policy:h,engine:W,rules:Re,suppressionDeadline:SA(h,o)})).digest("hex");if(!t.evaluatedAt&&dt.has(f))return dt.get(f);let b=[],y=null;for(let[R,S]of i.entries()){t.signal?.throwIfAborted();let _;if(m.has(S.runId)){y=null;continue}try{_=await Hr(e,S)}catch(x){d.push(`${S.runId}: ${x instanceof Error?x.message:String(x)}`),y=null;continue}let B=Sa(_,h),v=xA(le(B,{now:o}),A,t.ruleId,t.template),M=y?Qt(Sa(y.snapshot,h),B,{evaluatedAt:o}).summary:null,O=M?[...M.warnings]:[];M&&(M.coverage.onlyBefore>0||M.coverage.onlyAfter>0)&&O.push("coverage-changed"),R>0&&!y&&O.push("history-gap"),b.push({runId:S.runId,generatedAt:S.generatedAt,pages:_.pages.length,partial:_.partial,truncated:_.truncated,...v,verifiedNew:M?.lifecycle.new??null,verifiedResolved:M?.lifecycle.resolved??null,unverified:M?.unverified.length??null,warnings:O,previousRunId:y?.entry.runId??null}),y={entry:S,snapshot:_},t.onProgress?.(R+1,i.length)}let C={schemaVersion:1,siteUrl:s,revision:n.revision,evaluatedAt:o,limit:r,selectedRule:t.ruleId??null,selectedTemplate:t.template??null,templates:A,rules:l,points:b,warnings:d};return!t.evaluatedAt&&!t.signal?.aborted&&(dt.set(f,C),dt.size>8&&dt.delete(dt.keys().next().value)),C}import{parseArgs as NA}from"node:util";function Na(e){return NA({args:e,allowPositionals:!0,strict:!0,options:{baseline:{type:"string"},config:{type:"string"},output:{type:"string"},report:{type:"string"},"no-report":{type:"boolean"},"no-cache":{type:"boolean"},pages:{type:"string"},all:{type:"boolean"},"max-pages":{type:"string"},concurrency:{type:"string"},delay:{type:"string"},timeout:{type:"string"},sitemap:{type:"string"},"no-sitemap":{type:"boolean"},"include-query":{type:"boolean"},"ignore-robots":{type:"boolean"},strict:{type:"boolean"},json:{type:"boolean"},help:{type:"boolean"},version:{type:"boolean"},production:{type:"string"},preview:{type:"string"},"headers-env":{type:"string"},"production-headers-env":{type:"string"},"preview-headers-env":{type:"string"},"history-dir":{type:"string"},"trend-limit":{type:"string"},"no-history":{type:"boolean"},from:{type:"string"},to:{type:"string"},directory:{type:"string"},workflow:{type:"string"},yes:{type:"boolean"},force:{type:"boolean"},offline:{type:"boolean"},platform:{type:"string"},port:{type:"string"},"no-open":{type:"boolean"},render:{type:"string"}}})}function Ra(e,t){return{...e,__config:t}}function Yr(e,t,r,n=!1){if(e===void 0)return r;let s=Number.parseInt(e,10);if(!Number.isInteger(s)||s<(n?0:1))throw new Error(`${t} must be a ${n?"non-negative":"positive"} integer`);return s}function Wt(e,t,r){if(t.sitemap&&t["no-sitemap"])throw new Error("--sitemap and --no-sitemap cannot be used together");let n=r?.config??{},s=t.__config??{},i={url:e,schemaVersion:1,maxPages:Yr(t.pages??t["max-pages"],t.pages!==void 0?"--pages":"--max-pages",s.maxPages??n.maxPages??100),concurrency:Yr(t.concurrency,"--concurrency",s.concurrency??n.concurrency??5),delay:Yr(t.delay,"--delay",s.delay??n.delay??100,!0),timeout:Yr(t.timeout,"--timeout",s.timeout??n.timeout??1e4)};return t["no-sitemap"]?i.sitemap="none":t.sitemap&&(i.sitemap=t.sitemap),t["include-query"]!==void 0&&(i.includeQuery=t["include-query"]),t["ignore-robots"]!==void 0&&(i.respectRobots=!t["ignore-robots"]),be(i,s,n)}import{dirname as Ma,join as Ua,resolve as ie}from"node:path";import{Buffer as RA}from"node:buffer";import{createRequire as _A}from"node:module";import{resolve as vA}from"node:path";import{pathToFileURL as LA}from"node:url";function _a(e){return e.default??e}async function OA(e){if(e)return e;try{let t="playwright",r=_A(vA(process.cwd(),"package.json")),n;try{n=LA(r.resolve(t)).href}catch(s){if(s.code!=="MODULE_NOT_FOUND")throw s;return _a(await import(t))}return _a(await import(n))}catch(t){let r=t.code,n=r==="MODULE_NOT_FOUND"||r==="ERR_MODULE_NOT_FOUND"?"Playwright is not installed. Run: npm install --save-dev playwright && npx playwright install chromium":`Playwright could not be loaded: ${t instanceof Error?t.message:String(t)}`;throw new Error(n,{cause:t})}}function DA(e){let t=0,r=[];return async function(){return t>=e&&await new Promise(s=>r.push(s)),t+=1,()=>{t-=1,r.shift()?.()}}}async function kA(e){let t=[],r=e.request().redirectedFrom();for(;r;){let n=await r.response(),s=await n?.headers();t.unshift({url:r.url(),status:n?.status()??0,location:s?.location??null}),r=r.redirectedFrom()}return t}async function va(e={}){let t=e.concurrency??2;if(!Number.isInteger(t)||t<1)throw new Error("Playwright renderer concurrency must be a positive integer");let r=await OA(e.playwright),n;try{n=await r.chromium.launch({headless:e.headless??!0})}catch(l){throw new Error("Chromium could not start. Run: npx playwright install chromium",{cause:l})}let s=null,i=null,o=DA(t),d=!1;return{id:"playwright-chromium-v1",async render(l){if(d)throw new Error("Playwright renderer is closed");let c=await o(),m=null;try{if(l.signal?.throwIfAborted(),!s)s=await n.newContext({userAgent:l.userAgent,acceptDownloads:!1}),i=l.userAgent;else if(i!==l.userAgent)throw new Error("A Playwright renderer cannot mix user agents in one browser context");m=await s.newPage(),await m.route("**/*",async h=>{h.request().resourceType()==="media"?await h.abort():await h.continue()}),m.on("download",h=>{h.cancel()});let A=()=>{m?.close()};l.signal?.addEventListener("abort",A,{once:!0});try{let h=await m.goto(l.url,{waitUntil:"domcontentloaded",timeout:l.timeout});if(!h)throw new Error(`Playwright did not receive a document response for ${l.url}`);if((e.networkIdleTimeout??2e3)>0)try{await m.waitForLoadState("networkidle",{timeout:Math.min(l.timeout,e.networkIdleTimeout??2e3)})}catch(C){if(l.signal?.aborted)throw C}l.signal?.throwIfAborted();let f=await m.content(),b=RA.byteLength(f);if(b>l.maxResponseBytes)throw new Error(`rendered HTML exceeds ${l.maxResponseBytes} bytes`);let y=await h.headers();return{finalUrl:m.url(),status:h.status(),headers:y,html:f,responseBytes:b,redirectChain:await kA(h)}}finally{l.signal?.removeEventListener("abort",A)}}finally{await m?.close().catch(()=>{}),c()}},async close(){d||(d=!0,await s?.close(),await n.close())}}}var BA=process.stdout.isTTY&&!process.env.NO_COLOR;function Gr(e,t){return BA?`\x1B[${e}m${t}\x1B[0m`:t}function Kt(e){return e.reduce((t,r)=>(t[r.severity]+=1,t),{error:0,warning:0,info:0})}function Wr(e){if(e.length===0){console.log(Gr("32","\u2713 No SEO regressions detected."));return}for(let r of e){let n=r.severity==="error"?Gr("31","\u2716 error"):r.severity==="warning"?Gr("33","\u26A0 warning"):Gr("34","\u2139 info");console.log(`${n} ${r.rule} ${r.url}`),console.log(` ${r.message}`),(r.before!==void 0||r.after!==void 0)&&(console.log(` before: ${JSON.stringify(r.before)}`),console.log(` after: ${JSON.stringify(r.after)}`))}let t=Kt(e);console.log(`
198
+ ${t.error} error(s), ${t.warning} warning(s) detected.`)}import{createHash as PA}from"node:crypto";function Kr(e){if(!e)return{};let t=process.env[e];if(!t)throw new Error(`environment variable ${e} is empty or missing`);let r;try{r=JSON.parse(t)}catch(s){throw new Error(`environment variable ${e} must contain a JSON object`,{cause:s})}if(!r||typeof r!="object"||Array.isArray(r))throw new Error(`environment variable ${e} must contain a JSON object`);let n={};for(let[s,i]of Object.entries(r)){if(typeof i!="string")throw new Error(`header ${s} in ${e} must be a string`);try{new Headers({[s]:i})}catch(o){throw new Error(`header ${s} in ${e} is invalid`,{cause:o})}n[s]=i}return n}function ts(e,t,r=globalThis.fetch){if(Object.keys(e).length===0)return r;let n=new URL(t).origin;return(s,i)=>{let o=s instanceof Request?s.url:String(s);if(new URL(o).origin!==n)return r(s,i);let d=new Headers(s instanceof Request?s.headers:void 0);new Headers(i?.headers).forEach((l,c)=>d.set(c,l));for(let[l,c]of Object.entries(e))d.set(l,c);return r(s,{...i,headers:d})}}function Jt(e,t,r=globalThis.fetch){return ts(Kr(e),t,r)}function rs(e,t){if(!t)return e;let r=PA("sha256").update(t).digest("hex").slice(0,12);return e.endsWith(".ndjson")?`${e.slice(0,-7)}.auth-${r}.ndjson`:`${e}.auth-${r}`}import{createInterface as MA}from"node:readline/promises";function Oa(e,t){let r=e.trim().toLowerCase();if(r===""||r==="1")return{mode:"fixed",target:Math.min(100,t)};if(r==="2"||r==="all")return{mode:"all",target:t};if(r==="3"||r==="step")return{mode:"step",target:t};let n=Number.parseInt(r,10);return/^\d+$/.test(r)&&n>0?{mode:"fixed",target:Math.min(n,t)}:null}async function Ke(e){let t=MA({input:process.stdin,output:process.stdout});try{return(await t.question(e)).trim()}finally{t.close()}}async function Da(e){for(;;){console.log(`
199
+ Sitemap contains ${e.toLocaleString("en-US")} page(s).`),console.log("How many pages should be scanned?"),console.log(" 1) First 100"),console.log(` 2) All ${e.toLocaleString("en-US")}`),console.log(" 3) 100 at a time with confirmation"),console.log(" Or enter an exact number, for example 500.");let t=Oa(await Ke("Choose [1]: "),e);if(!t){console.log("Enter 1, 2, 3, all, step, or a positive number.");continue}if(t.mode==="all"){let r=await Ke(`This will request ${e.toLocaleString("en-US")} pages. Continue? [y/N] `);if(!["y","yes"].includes(r.toLowerCase()))continue}return t}}function La(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let r=Math.floor(t/60),n=t%60;return`${r}m ${n}s`}function UA(e,t,r){let n=t===0?1:Math.min(e/t,1),s=(n*100).toFixed(n<.1?1:0),i=Math.round(n*20),o=`[${"\u2588".repeat(i)}${"\u2591".repeat(20-i)}] ${s}% \xB7 ${e.toLocaleString("en-US")} / ${t.toLocaleString("en-US")} pages`;if(!r)return o;let d=r.elapsedMs/6e4,l=d>0?e/d:0,c=Math.max(0,t-e),m=l>0?c/l*6e4:null,A=[`elapsed ${La(r.elapsedMs)}`,`${l.toFixed(l<10?1:0)} pages/min`,`ETA ${m===null?"\u2014":La(m)}`,`retries ${r.retries}`,`errors ${r.errors}`];if(r.currentUrl){let h=r.currentUrl.length>60?`${r.currentUrl.slice(0,57)}\u2026`:r.currentUrl;A.push(h)}return`${o} \xB7 ${A.join(" \xB7 ")}`}function jt(e,t,r=!1,n=process.stdout,s){let i=UA(e,t,s),o=n===process.stderr?console.error:console.log;n.isTTY&&!r?(n.write(`\r${i}`),e>=t&&n.write(`
200
+ `)):(n.isTTY||e>=t||e%1e3===0)&&o(i)}function ka(e,t,r,n=process.stdout){let s=e.sitemap?`found, ${(e.candidateCount??e.sitemap.urls.length).toLocaleString("en-US")} URL(s)`:"not found; internal links",i=["Scan plan",` Target: ${e.startUrl}`,` Sitemap: ${s}`,` Robots: ${e.config.respectRobots?"respected":"ignored"}`,` Limit: ${t.target.toLocaleString("en-US")} page(s)`,` Concurrency: ${e.config.concurrency}`,` Delay: ${e.config.delay} ms`,` Checkpoint: ${r?"enabled":"disabled"}`];t.target>1e3&&i.push(" Notice: this is a large scan and may take a long time."),de(i.join(`
201
+ `),n)}function Ba(e,t,r=process.stdout,n=Date.now){let s=n(),i=0,o=0,d=new Set;return{retry(){i+=1},progress(l,c){(l.error||l.status!==null&&l.status>=400)&&!d.has(l.url)&&(d.add(l.url),o+=1);let m=(()=>{try{return new URL(l.url).pathname||"/"}catch{return l.url}})();jt(c,e,t,r,{elapsedMs:n()-s,retries:i,errors:o,currentUrl:m})}}}function de(e,t=process.stdout){t.isTTY&&t.write("\r\x1B[2K"),t===process.stderr?console.error(e):console.log(e)}function ns(e){return e.reduce((t,r)=>((r.error||r.blockedByRobots||(r.status??500)>=400)&&(t.unavailable+=1),r.title||(t.missingTitle+=1),r.description||(t.missingDescription+=1),r.canonical||(t.missingCanonical+=1),r.h1Count===0&&(t.missingH1+=1),/(^|[\s,])noindex($|[\s,])/i.test(r.robots??"")&&(t.noindex+=1),t),{unavailable:0,missingTitle:0,missingDescription:0,missingCanonical:0,missingH1:0,noindex:0})}function ss(e){console.log(`Current health: ${e.unavailable} unavailable, ${e.missingTitle} missing title, ${e.missingDescription} missing description, ${e.missingCanonical} missing canonical, ${e.missingH1} missing H1, ${e.noindex} noindex.`)}var Vt=".seo-audit.json",Fa="seo-audit-report.html",Pa=".seo-audit/history";function jr(e){if(e.render!==void 0&&e.render!=="http"&&e.render!=="playwright")throw new Error("--render must be http or playwright")}async function Jr(e){if(jr(e),(e.render??"http")!=="http")return va()}async function Ha(e,t){let r=ie(e??t.output??Vt),n=rs(Fr(r),t["headers-env"]),s=await $n(n),i=null;try{i=await Se(r)}catch(d){if(d.code!=="ENOENT")throw d}let o={command:"status",snapshot:i?{path:r,siteUrl:i.siteUrl,pages:i.pages.length,generatedAt:i.generatedAt,partial:i.partial,truncated:i.truncated}:null,checkpoint:s};return t.json?(console.log(JSON.stringify(o,null,2)),0):(console.log("SEO Crawl Audit status"),i?(console.log(` Snapshot: ${r}`),console.log(` Site: ${i.siteUrl}`),console.log(` Last completed result: ${i.pages.length.toLocaleString("en-US")} page(s) at ${i.generatedAt}`)):console.log(` Snapshot: not found (${r})`),s.status==="missing"?console.log(` Checkpoint: not found (${n})`):(console.log(` Checkpoint: ${s.status} (${n})`),s.siteUrl&&console.log(` Checkpoint site: ${s.siteUrl}`),console.log(` Saved pages: ${s.completedPages.toLocaleString("en-US")}`),s.updatedAt&&console.log(` Updated: ${s.updatedAt}`),s.message&&console.log(` Detail: ${s.message}`),s.resumable&&console.log(" Resume: run the same scan command again to reuse saved pages.")),0)}function Qa(e,t=!1){return t||!e["no-report"]&&(e.report!==void 0||process.stdin.isTTY&&process.stdout.isTTY&&!e.json)}async function ut(e,t,r=!1){if(!Qa(e,r))return null;let n=ie(e.report??Fa);return await Mr(n,t),n}function ce(e,t,r){if(!e)return e;try{let n=new URL(t),s=new URL(r),i=new URL(e);if(i.origin!==n.origin)return e;i.protocol=s.protocol,i.host=s.host;let o=n.pathname.replace(/\/$/,""),d=s.pathname.replace(/\/$/,"");return o&&i.pathname.startsWith(o)&&(i.pathname=`${d}${i.pathname.slice(o.length)}`||"/"),i.href}catch{return e}}function FA(e,t,r){let n=s=>s.map(i=>ce(i,t,r)??i).sort();return{...e,url:ce(e.url,t,r)??e.url,finalUrl:ce(e.finalUrl,t,r),canonical:ce(e.canonical,t,r),canonicalRaw:ce(e.canonicalRaw,t,r),links:n(e.links),internalLinks:n(e.internalLinks),externalLinks:n(e.externalLinks),images:e.images.map(s=>({...s,src:ce(s.src,t,r)})),hreflang:e.hreflang.map(s=>({...s,url:ce(s.url,t,r)})),redirectChain:e.redirectChain.map(s=>({...s,url:ce(s.url,t,r)??s.url,location:ce(s.location,t,r)}))}}function HA(e,t,r=ct(e),n={}){return{mode:t,startUrl:e.siteUrl,generatedAt:e.generatedAt,pages:e.pages,pageDetails:e.pages,issues:r,partial:e.partial,complete:!e.partial&&!e.truncated,engineVersion:e.engineVersion,ruleSetVersion:e.ruleSetVersion,branding:e.config.report,siteMetrics:ot(e),...n}}async function Je(e,t,r,n,s={}){let i=Ua(Ma(n),".seo-audit.metrics.json"),o=await Vn(e,i,{onWarning:d=>console.error(`Warning: ${d}`)});return HA(e,t,r,{...s,siteMetrics:o})}function Ya(e,t){return e["history-dir"]?ie(e["history-dir"]):t?Ua(Ma(t),Pa):ie(Pa)}async function is(e,t,r,n){if(e["no-history"])return;let s=Ya(e,r);n&&!t.partial&&await Xn(s,t);let i=await Gt(s,t.siteUrl);return Ft(i.map(o=>o.snapshot))??void 0}async function QA(e,t,r,n,s){let i=Wt(e,t,r),o=t.json?process.stderr:process.stdout,d=c=>{c.type==="plan-start"&&de(`Preparing crawl plan for ${c.url}`,o),c.type==="robots"&&de(c.robots.error?`robots.txt check failed: ${c.robots.error}`:`robots.txt checked (${c.robots.status??"unknown status"})`,o),c.type==="sitemap"&&de(c.sitemap?`Sitemap loaded: ${c.candidateCount??c.sitemap.urls.length} candidate URL(s)`:"No sitemap found; internal-link discovery will be used",o)},l=await Ae(i,{signal:s,fetch:n,onEvent:d});if(l.mode==="links"&&i.sitemap==="auto"&&process.stdin.isTTY&&process.stdout.isTTY&&!t.json){let c=await Ke("Sitemap was not found. Enter its full URL, or press Enter to crawl internal links: ");c&&(i={...i,sitemap:c},l=await Ae(i,{signal:s,fetch:n,onEvent:d}))}return l}function Ga(e,t){if(e.candidateCount===null){if(t.all)throw new Error("--all requires a sitemap");return{mode:"fixed",target:e.config.maxPages}}return t.all?{mode:"all",target:e.candidateCount}:t.pages!==void 0||t["max-pages"]!==void 0?{mode:"fixed",target:Math.min(e.config.maxPages,e.candidateCount)}:process.stdin.isTTY&&process.stdout.isTTY&&!t.json?Da(e.candidateCount):{mode:"fixed",target:Math.min(100,e.candidateCount)}}async function Wa(e,t,r){if(!e)throw new Error("scan requires a URL");jr(t);let n=ie(t.output??Vt),s=Jt(t["headers-env"],e),i=await QA(e,t,void 0,s,r),o=await Ga(i,t),d=rs(Fr(n),t["headers-env"]),l=t["no-cache"]?void 0:Zn(d),c=t.json?process.stderr:process.stdout;ka(i,o,!!l,c);let m=new Map,A=Qa(t)?ie(t.report??Fa):null,h=0,f=-1,b=async(O=!1)=>{if(!A||m.size===0)return;let x=Date.now();if(!O&&m.size-f<100&&x-h<5e3)return;let D=fe({schemaVersion:1,startUrl:i.startUrl,robots:i.robots,sitemap:i.sitemap,options:{...i.config,maxPages:o.target},pages:[...m.values()],partial:!0,truncated:!0});await Mr(A,await Je(D,"scan",ct(D),n,{partial:!0,targetPages:o.target})),h=x,f=m.size},y=o.mode==="step"?Math.min(100,o.target):o.target,C=null,R=!1,S=await Jr(t);try{for(;y>0;){let O=Ba(y,o.mode==="step",c);C=await at(i,{signal:r,fetch:s,renderer:S,limit:y,checkpointStore:l,retainCheckpoint:!!l,async onBatch(H){for(let Z of H)m.set(Z.url,Z);await b()},onEvent(H){H.type==="scan-start"&&de(`Starting crawl: up to ${H.total.toLocaleString("en-US")} page(s)`,t.json?process.stderr:process.stdout),H.type==="resume"&&de(`Resuming from checkpoint: ${H.completed.toLocaleString("en-US")} page(s) already available`,t.json?process.stderr:process.stdout),H.type==="retry"&&(O.retry(),de(`Retrying request (attempt ${H.attempt}) after ${H.delayMs} ms`,c)),H.type==="progress"&&O.progress(H.page,H.completed),H.type==="cancelled"&&de(`Scan interrupted after ${H.completed.toLocaleString("en-US")} page(s)`,t.json?process.stderr:process.stdout)}});for(let H of C.pages)m.set(H.url,H);if(await b(!0),C.partial||o.mode!=="step"||y>=o.target)break;ss(ns(C.pages));let x=Math.min(100,o.target-y),D=await Ke(`Check the next ${x} page(s)? [y/N] `);if(!["y","yes"].includes(D.toLowerCase())){R=!0;break}y=Math.min(o.target,y+100)}}finally{await S?.close?.()}if(!C)throw new Error("scan did not produce a result");await Pr(n,C.snapshot);let _=C.partial||R,B=await is(t,C.snapshot,n,!_),v=_?A:await ut(t,await Je(C.snapshot,"scan",ct(C.snapshot),n,B?{history:B}:{}));_||await l?.clearCurrent();let M=ns(C.snapshot.pages);return t.json?console.log(JSON.stringify({command:"scan",pages:C.snapshot.pages.length,truncated:C.snapshot.truncated,health:M,output:n,report:v,checkpoint:_&&l?d:null},null,2)):(console.log(`Crawled ${C.snapshot.pages.length} page(s)${C.snapshot.truncated?" (limit reached)":""}.`),C.snapshot.sitemap&&console.log(`Loaded ${C.snapshot.sitemap.sitemapCount} sitemap file(s) from ${C.snapshot.sitemap.url}.`),ss(M),console.log(`Baseline saved to ${n}`),v&&console.log(`HTML report saved to ${v}`),_&&l&&console.log(`Resume checkpoint saved to ${d}`)),C.partial?130:0}async function Ka(e,t,r){jr(t);let n=ie(t.baseline??Vt),s=await Se(n),i=e??s.siteUrl,o=Jt(t["headers-env"],i),d=await Ae({...Wt(i,t,s),sitemap:"none"},{signal:r,fetch:o}),l=s.pages.map(v=>({baselineUrl:v.url,targetUrl:ce(v.url,s.siteUrl,d.startUrl)??v.url})),c=[...new Set(l.map(({targetUrl:v})=>v))],m={...d,mode:"sitemap",candidateUrls:c,candidateCount:c.length,sitemap:{url:`${d.origin}/.seo-audit-targets`,urls:c,sitemapCount:0,truncated:!1,error:null}},A=await Jr(t),h;try{h=await at(m,{signal:r,fetch:o,renderer:A,limit:c.length,onEvent(v){v.type==="scan-start"&&de(`Starting regression check: ${v.total.toLocaleString("en-US")} page(s)`,t.json?process.stderr:process.stdout),v.type==="progress"&&jt(v.completed,c.length,!1,t.json?process.stderr:process.stdout)}})}finally{await A?.close?.()}let f=new Map(h.pages.map(v=>[v.url,v])),b=l.flatMap(({baselineUrl:v,targetUrl:M})=>{let O=f.get(M);return O?[{...O,url:v,finalUrl:ce(O.finalUrl,d.startUrl,s.siteUrl)}]:[]}),y=fe({...h.snapshot,siteUrl:s.siteUrl,config:{...h.snapshot.config,url:s.siteUrl},sitemap:s.sitemap,pages:b}),C=Yn(s,y,{enabledRules:y.config.enabledRules,severityOverrides:y.config.severityOverrides,suppressions:y.config.suppressions}),R=C.newIssues,S=Kt(R),_=await is(t,y,n,!h.partial),B=await ut(t,await Je(y,"check",R,n,{...C,..._?{history:_}:{}}));return t.json?console.log(JSON.stringify({command:"check",baseline:n,pages:y.pages.length,summary:S,issues:R,lifecycle:C,report:B},null,2)):(console.log(`Checked ${y.pages.length} page(s).
202
+ `),Wr(R),B&&console.log(`HTML report saved to ${B}`)),h.partial?130:S.error>0||C.budgetExceeded.length>0||t.strict&&S.warning>0?1:0}async function Ja(e,t){jr(e);let r=e.production,n=e.preview;if(!r||!n)throw new Error("compare requires --production and --preview URLs");let s=Jt(e["production-headers-env"],r),i=Jt(e["preview-headers-env"],n),o=await Ae(Wt(r,e),{signal:t,fetch:s}),d=await Ga(o,e),l=await Jr(e),c;try{c=await at(o,{signal:t,fetch:s,renderer:l,limit:d.target,onEvent(v){v.type==="scan-start"&&de(`Starting production crawl: up to ${v.total.toLocaleString("en-US")} page(s)`,e.json?process.stderr:process.stdout),v.type==="progress"&&jt(v.completed,d.target,!1,e.json?process.stderr:process.stdout)}})}finally{await l?.close?.()}if(c.partial)return 130;let m=await Ae({...Wt(n,e),sitemap:"none"},{signal:t,fetch:i}),A=c.snapshot.pages.map(v=>ce(v.url,r,n)??v.url),h={...m,mode:"sitemap",candidateUrls:[...new Set(A)].sort(),candidateCount:A.length,sitemap:{url:`${m.origin}/.seo-audit-preview-targets`,urls:[...new Set(A)].sort(),sitemapCount:0,truncated:!1,error:null}},f=await Jr(e),b;try{b=await at(h,{signal:t,fetch:i,renderer:f,limit:A.length,onEvent(v){v.type==="scan-start"&&de(`Starting preview crawl: ${v.total.toLocaleString("en-US")} page(s)`,e.json?process.stderr:process.stdout),v.type==="progress"&&jt(v.completed,A.length,!1,e.json?process.stderr:process.stdout)}})}finally{await f?.close?.()}let y=b.snapshot.pages.map(v=>FA(v,n,r)),C=fe({...b.snapshot,siteUrl:c.snapshot.siteUrl,startUrl:c.snapshot.siteUrl,config:{...b.snapshot.config,url:c.snapshot.siteUrl},robots:{...b.snapshot.robots,url:ce(b.snapshot.robots.url,n,r)??b.snapshot.robots.url},sitemap:c.snapshot.sitemap,pages:y,partial:b.snapshot.partial}),R=Yn(c.snapshot,C,{enabledRules:C.config.enabledRules,severityOverrides:C.config.severityOverrides,suppressions:C.config.suppressions}),S=R.newIssues,_=Kt(S),B=await ut(e,await Je(C,"check",S,ie(Vt),{...R,comparison:{kind:"preview",productionUrl:r,previewUrl:n}}),!0);return e.json?console.log(JSON.stringify({command:"compare",production:r,preview:n,pages:C.pages.length,summary:_,issues:S,lifecycle:R,report:B},null,2)):(console.log(`Compared ${C.pages.length} production page(s) with preview.`),Wr(S),B&&console.log(`HTML report saved to ${B}`)),b.partial?130:_.error>0||R.budgetExceeded.length>0||e.strict&&_.warning>0?1:0}async function ja(e,t){let r=ie(e??t.baseline??Vt),n=await Se(r),s=await is(t,n,r,!1),i=await ut(t,await Je(n,"scan",ct(n),r,s?{history:s}:{}),!0);return t.json?console.log(JSON.stringify({command:"report",baseline:r,pages:n.pages.length,report:i},null,2)):console.log(`HTML report saved to ${i}`),0}async function Va(e,t){if(!!t.from!=!!t.to)throw new Error("history comparison requires both --from and --to");let r=Ya(t),n=t["trend-limit"]??"20";if(!["20","50","100"].includes(n))throw new Error("--trend-limit must be 20, 50, or 100");let s=Number(n);if(t.from&&t.to){let A=await Se(ie(t.from)),h=await Se(ie(t.to));if(A.siteUrl!==h.siteUrl)throw new Error("history snapshots must belong to the same site URL");let f=await Gt(r,h.siteUrl),b=Ft([...f.map(_=>_.snapshot),A,h]),{diff:y,summary:C}=Qt(A,h,{evaluatedAt:new Date().toISOString()}),R=await ut(t,await Je(h,"check",y.newIssues,ie(t.to),{...y,...b?{history:b}:{}}),!0),S=Kt(y.newIssues);return t.json?console.log(JSON.stringify({command:"history",from:ie(t.from),to:ie(t.to),summary:S,lifecycle:y,comparisonSummary:C,report:R,trendSummary:await Qr(r,{siteUrl:h.siteUrl,limit:s})},null,2)):(console.log(`Compared local snapshots from ${A.generatedAt} to ${h.generatedAt}.`),console.log(`Coverage: ${C.coverage.common} common pages; ${C.coverage.onlyBefore} only before; ${C.coverage.onlyAfter} only after.`),C.warnings.length>0&&console.log(`Comparison warnings: ${C.warnings.join(", ")}`),C.unverified.length>0&&console.log(`${C.unverified.length} apparent resolution(s) could not be verified.`),Wr(y.newIssues),R&&console.log(`HTML report saved to ${R}`)),0}let i;if(e)try{i=new URL(e).href}catch{throw new Error("history URL must be an HTTP(S) URL")}let o=await Gt(r,i);if(o.length===0)throw new Error(`no local history snapshots found in ${r}`);if(!i){let A=o.at(-1).snapshot.siteUrl;o=o.filter(h=>h.snapshot.siteUrl===A)}let d=o.at(-1),l=Ft(o.map(A=>A.snapshot)),c=await ut(t,await Je(d.snapshot,"scan",ct(d.snapshot),d.path,l?{history:l}:{}),!0),m=l?.points??[];if(t.json)console.log(JSON.stringify({command:"history",directory:r,snapshots:o.map((A,h)=>({path:A.path,...m[h]})),report:c,trendSummary:await Qr(r,{siteUrl:d.snapshot.siteUrl,limit:s})},null,2));else{console.log(`Local history for ${d.snapshot.siteUrl}:`);for(let[A,h]of o.entries()){let f=m[A];console.log(` ${h.snapshot.generatedAt} ${f?.pages??h.snapshot.pages.length} pages ${f?.errors??0} errors ${f?.warnings??0} warnings ${h.path}`)}c&&console.log(`HTML report saved to ${c}`)}return 0}import{mkdir as $a,readFile as YA,writeFile as qa}from"node:fs/promises";import{dirname as za,isAbsolute as GA,join as as,resolve as Xa}from"node:path";var WA="https://raw.githubusercontent.com/MelnixDev/seo-crawl-audit/v0/packages/core/config.schema.json",KA="seo-audit.config.json",JA=".github/workflows/seo-audit.yml",jA=[".seo-audit.checkpoint.ndjson",".seo-audit.metrics.json",".seo-audit/history/","seo-audit-report.html","seo-audit-report.html.json"];function VA(e){let t;try{t=new URL(e)}catch(r){throw new Error("init URL must be a full HTTP(S) URL",{cause:r})}if(!["http:","https:"].includes(t.protocol))throw new Error("init URL must be a full HTTP(S) URL");return t.hash="",t.href}function XA(e){let t=(e??"none").trim().toLowerCase(),n={"":"none",none:"none",manual:"manual",scheduled:"scheduled",schedule:"scheduled","pull-request":"pull-request",pull_request:"pull-request",pr:"pull-request"}[t];if(!n)throw new Error("--workflow must be none, manual, scheduled, or pull-request");return n}function ZA(e){return`${JSON.stringify({$schema:WA,url:e,sitemap:"auto",maxPages:100,concurrency:5,delay:100,timeout:1e4,respectRobots:!0,includeQuery:!1,maxRedirects:10,maxResponseBytes:5*1024*1024,enabledRules:null,severityOverrides:{},suppressions:[],regressionBudgets:{error:0},report:{}},null,2)}
203
+ `}function os(e="",t=""){return` - uses: actions/checkout@v6${t}
201
204
  - name: Run SEO Crawl Audit
202
205
  id: seo
203
206
  uses: MelnixDev/seo-crawl-audit@v${W}
@@ -226,7 +229,7 @@ jobs:
226
229
  audit:
227
230
  runs-on: ubuntu-latest
228
231
  steps:
229
- ${is()}`:e==="scheduled"?`name: Scheduled SEO audit
232
+ ${os()}`:e==="scheduled"?`name: Scheduled SEO audit
230
233
 
231
234
  on:
232
235
  workflow_dispatch:
@@ -240,7 +243,7 @@ jobs:
240
243
  audit:
241
244
  runs-on: ubuntu-latest
242
245
  steps:
243
- ${is()}`:`name: SEO preview regression check
246
+ ${os()}`:`name: SEO preview regression check
244
247
 
245
248
  on:
246
249
  pull_request:
@@ -252,7 +255,7 @@ jobs:
252
255
  audit:
253
256
  runs-on: ubuntu-latest
254
257
  steps:
255
- ${is(`
258
+ ${os(`
256
259
  url: \${{ vars.SEO_AUDIT_PREVIEW_URL }}
257
260
  baseline: .seo-audit.json`,`
258
261
  - name: Validate preview audit setup
@@ -266,19 +269,19 @@ ${is(`
266
269
  if [ ! -f .seo-audit.json ]; then
267
270
  echo "Commit .seo-audit.json as the production baseline." >&2
268
271
  exit 1
269
- fi`)}`}function Xa(e){return e&&typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:void 0}async function Za(e){try{return await UA(e,"utf8")}catch(t){if(Xa(t)==="ENOENT")return null;throw t}}async function jA(e,t){if(t.force)return!0;if(!t.interactive||!t.ask)return!1;let r=await t.ask(`${e} already exists. Replace it? [y/N] `);return["y","yes"].includes(r.trim().toLowerCase())}async function Ja(e,t,r){let n=await Za(e);if(n===t)return{path:e,status:"unchanged"};if(n!==null&&!await jA(e,r))return{path:e,status:"skipped"};await $a(Va(e),{recursive:!0});try{await ja(e,t,n===null?{encoding:"utf8",flag:"wx"}:{encoding:"utf8"})}catch(s){if(n===null&&Xa(s)==="EEXIST")return{path:e,status:"skipped"};throw s}return{path:e,status:n===null?"created":"updated"}}async function VA(e,t){let r=await Za(e),n=new Set((r??"").split(/\r?\n/u)),s=GA.filter(l=>!n.has(l));if(s.length===0)return{path:e,status:"unchanged"};if(r!==null&&!t.force&&!t.yes){if(!t.interactive||!t.ask)return{path:e,status:"skipped"};let l=await t.ask(`Add SEO Crawl Audit recommendations to ${e}? [Y/n] `);if(["n","no"].includes(l.trim().toLowerCase()))return{path:e,status:"skipped"}}let i=r&&!r.endsWith(`
272
+ fi`)}`}function eo(e){return e&&typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:void 0}async function to(e){try{return await YA(e,"utf8")}catch(t){if(eo(t)==="ENOENT")return null;throw t}}async function qA(e,t){if(t.force)return!0;if(!t.interactive||!t.ask)return!1;let r=await t.ask(`${e} already exists. Replace it? [y/N] `);return["y","yes"].includes(r.trim().toLowerCase())}async function Za(e,t,r){let n=await to(e);if(n===t)return{path:e,status:"unchanged"};if(n!==null&&!await qA(e,r))return{path:e,status:"skipped"};await $a(za(e),{recursive:!0});try{await qa(e,t,n===null?{encoding:"utf8",flag:"wx"}:{encoding:"utf8"})}catch(s){if(n===null&&eo(s)==="EEXIST")return{path:e,status:"skipped"};throw s}return{path:e,status:n===null?"created":"updated"}}async function zA(e,t){let r=await to(e),n=new Set((r??"").split(/\r?\n/u)),s=jA.filter(l=>!n.has(l));if(s.length===0)return{path:e,status:"unchanged"};if(r!==null&&!t.force&&!t.yes){if(!t.interactive||!t.ask)return{path:e,status:"skipped"};let l=await t.ask(`Add SEO Crawl Audit recommendations to ${e}? [Y/n] `);if(["n","no"].includes(l.trim().toLowerCase()))return{path:e,status:"skipped"}}let i=r&&!r.endsWith(`
270
273
  `)?`
271
274
  `:"",o=r===null||!r.includes("# SEO Crawl Audit")?`# SEO Crawl Audit
272
275
  `:"",d=`${i}${o}${s.join(`
273
276
  `)}
274
- `;return await $a(Va(e),{recursive:!0}),await ja(e,`${r??""}${d}`,"utf8"),{path:e,status:r===null?"created":"updated"}}async function XA(e={}){let t=Ka(e.directory??process.cwd()),r=e.interactive??!!(process.stdin.isTTY&&process.stdout.isTTY),n=e.ask??Ke,s=e.url?.trim()??"";if(!s&&r&&!e.yes&&(s=await n("Full site URL: ")),!s)throw new Error("init requires a full site URL");let i=WA(s),o=e.workflow;o===void 0&&r&&!e.yes&&(o=await n("GitHub workflow [none/manual/scheduled/pull-request] (none): "));let d=KA(o),l=e.configPath?FA(e.configPath)?e.configPath:Ka(t,e.configPath):ss(t,QA),c={force:e.force??!1,yes:e.yes??!1,interactive:r,ask:n},m=[await Ja(l,JA(i),c),await VA(ss(t,".gitignore"),c)];return d!=="none"&&m.push(await Ja(ss(t,YA),$A(d),c)),{directory:t,url:i,workflow:d,files:m}}async function za(e,t){let r=await XA({...t.directory!==void 0?{directory:t.directory}:{},...e!==void 0?{url:e}:{},...t.config!==void 0?{configPath:t.config}:{},...t.workflow!==void 0?{workflow:t.workflow}:{},...t.yes!==void 0?{yes:t.yes}:{},...t.force!==void 0?{force:t.force}:{}});if(t.json)return console.log(JSON.stringify({command:"init",...r},null,2)),0;console.log(`Initialized SEO Crawl Audit for ${r.url}`);for(let n of r.files)console.log(` ${n.status.padEnd(9)} ${n.path}`);return r.workflow==="pull-request"&&console.log("Set the SEO_AUDIT_PREVIEW_URL repository variable and commit .seo-audit.json before enabling the PR check."),console.log("Review seo-audit.config.json, then run: seo-audit scan"),0}import{access as ZA,stat as zA}from"node:fs/promises";import{constants as qA}from"node:fs";import{dirname as as,isAbsolute as ep,resolve as os}from"node:path";var qa=[20,19,0],tp=".seo-audit.json",rp="seo-audit-report.html",np=".seo-audit/history";function sp(e){let t=/^(\d+)\.(\d+)\.(\d+)/u.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:[0,0,0]}function ip(e){let t=sp(e);for(let r=0;r<qa.length;r+=1){let n=t[r]??0,s=qa[r]??0;if(n>s)return!0;if(n<s)return!1}return!0}function ap(e){try{let t=new URL(e);return["http:","https:"].includes(t.protocol)?(t.hash="",t.href):null}catch{return null}}function jr(e,t){return ep(t)?t:os(e,t)}async function op(e){let t=os(e);for(;;){try{if((await zA(t)).isDirectory())return t}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ENOENT")throw n}let r=as(t);if(r===t)throw new Error(`no existing parent directory for ${e}`);t=r}}async function cp(e,t){let r=[as(jr(e,t.outputPath??tp)),...t.reportEnabled===!1?[]:[as(jr(e,t.reportPath??rp))],...t.historyEnabled===!1?[]:[jr(e,t.historyPath??np)]];try{let n=[...new Set(await Promise.all(r.map(op)))];return await Promise.all(n.map(s=>ZA(s,qA.W_OK))),{id:"storage",status:"pass",message:`Output locations are writable through ${n.join(", ")}`,evidence:{directories:n}}}catch(n){return{id:"storage",status:"fail",message:n instanceof Error?n.message:String(n),remediation:"Create the output directory or grant the current user write access."}}}function lp(e,t){let r=AbortSignal.timeout(e);return t?AbortSignal.any([t,r]):r}async function dp(e,t,r,n){try{let s=await r(e,{headers:{accept:"text/html,application/xhtml+xml;q=0.9,*/*;q=0.1","user-agent":`SEO-Crawl-Audit-Doctor/${W}`},redirect:"follow",signal:lp(t.timeout,n)}),i=s.headers.get("content-type")??"";return await s.body?.cancel(),s.status>=400?{id:"homepage",status:"fail",message:`Start URL returned HTTP ${s.status}`,remediation:s.status===401||s.status===403?"Configure authenticated request headers before auditing this site.":"Confirm that the URL is correct and publicly reachable.",evidence:{status:s.status,contentType:i}}:i.toLowerCase().includes("html")?{id:"homepage",status:"pass",message:`Start URL returned HTTP ${s.status} HTML`,evidence:{status:s.status,contentType:i}}:{id:"homepage",status:"warning",message:`Start URL returned ${i||"an unknown content type"}`,remediation:"Use a URL that returns server-rendered HTML.",evidence:{status:s.status,contentType:i}}}catch(s){return n?.throwIfAborted(),{id:"homepage",status:"fail",message:`Could not request the start URL: ${s instanceof Error?s.message:String(s)}`,remediation:"Check DNS, TLS, firewall access, and the configured timeout."}}}function up(e){return e.reduce((t,r)=>(t[r.status]+=1,t),{pass:0,warning:0,fail:0,skipped:0})}async function Ap(e={}){let t=os(e.directory??process.cwd()),r=[],n=e.runtimeVersion??process.versions.node;r.push(ip(n)?{id:"runtime",status:"pass",message:`Node.js ${n} satisfies >=20.19`}:{id:"runtime",status:"fail",message:`Node.js ${n} is older than 20.19`,remediation:"Install Node.js 20.19 or newer on the machine running SEO Crawl Audit."});let i=(e.configPath?jr(t,e.configPath):null)??await Br(t),o={};if(!i)r.push({id:"config",status:"warning",message:"seo-audit.config.json was not found",remediation:"Run seo-audit init <url> to create a safe project configuration."});else try{o=await Yt(i),r.push({id:"config",status:"pass",message:`Configuration is valid: ${i}`,evidence:{path:i}})}catch(A){r.push({id:"config",status:"fail",message:A instanceof Error?A.message:String(A),remediation:"Fix the reported property or regenerate the file with seo-audit init --force."})}let d=e.url??o.url??"",l=ap(d);l?r.push({id:"target",status:"pass",message:`Target URL is ${l}`,evidence:{url:l}}):r.push({id:"target",status:"fail",message:d?"Target is not a full HTTP(S) URL":"No target URL was provided",remediation:"Pass seo-audit doctor https://example.com/ or set url in seo-audit.config.json."}),r.push(await cp(t,e));let c=e.offline??!1;if(c||!l){let A=c?"Skipped by --offline":"Skipped because the target URL is invalid";for(let h of["homepage","robots","sitemap"])r.push({id:h,status:"skipped",message:A})}else{let A=be({url:l},o),h=qn(e.requestHeaders??{},l,e.fetch??globalThis.fetch);r.push(await dp(l,A,h,e.signal));try{let f=await Ae(A,{fetch:h,signal:e.signal});f.robots.denyAll&&A.respectRobots?r.push({id:"robots",status:"fail",message:`robots.txt returned HTTP ${f.robots.status??"unknown"} and blocks crawling`,remediation:"Allow the audit user agent or explicitly choose --ignore-robots when authorized.",evidence:{url:f.robots.url,status:f.robots.status,denyAll:!0}}):f.robots.error||f.robots.status===null||(f.robots.status??500)>=400?r.push({id:"robots",status:"warning",message:f.robots.error??`robots.txt returned HTTP ${f.robots.status??"unknown"}`,remediation:"Publish a readable robots.txt when crawler policy needs to be explicit.",evidence:{url:f.robots.url,status:f.robots.status}}):r.push({id:"robots",status:"pass",message:`robots.txt returned HTTP ${f.robots.status}`,evidence:{url:f.robots.url,status:f.robots.status,denyAll:f.robots.denyAll??!1}}),A.sitemap==="none"?r.push({id:"sitemap",status:"skipped",message:"Sitemap discovery is disabled by configuration"}):f.sitemap?f.sitemap.error?r.push({id:"sitemap",status:A.sitemap==="auto"?"warning":"fail",message:f.sitemap.error,remediation:"Check the sitemap URL, XML syntax, response size, and HTTP status.",evidence:{url:f.sitemap.url}}):f.sitemap.urls.length===0?r.push({id:"sitemap",status:"warning",message:`Sitemap contains no crawlable same-origin URLs: ${f.sitemap.url}`,remediation:"Add canonical site URLs to the sitemap or verify the configured site origin."}):r.push({id:"sitemap",status:"pass",message:`Loaded ${f.sitemap.urls.length} URL(s) from ${f.sitemap.sitemapCount} sitemap file(s)`,evidence:{url:f.sitemap.url,urls:f.sitemap.urls.length,sitemapCount:f.sitemap.sitemapCount,truncated:f.sitemap.truncated}}):r.push({id:"sitemap",status:"warning",message:"No sitemap was discovered",remediation:"Publish a sitemap or set sitemap to none when link-only crawling is intentional."})}catch(f){e.signal?.throwIfAborted(),r.push({id:"robots",status:"fail",message:`Planning failed: ${f instanceof Error?f.message:String(f)}`,remediation:"Check network access, robots.txt redirects, sitemap responses, and timeout settings."}),r.push({id:"sitemap",status:"skipped",message:"Skipped because scan planning failed"})}}let m=up(r);return{healthy:m.fail===0,offline:c,url:l,checks:r,summary:m}}function pp(e){console.log("SEO Crawl Audit doctor");let t={pass:"PASS",warning:"WARN",fail:"FAIL",skipped:"SKIP"};for(let r of e.checks)console.log(`[${t[r.status]}] ${r.id}: ${r.message}`),r.remediation&&console.log(` Fix: ${r.remediation}`);console.log(e.healthy?`Ready with ${e.summary.warning} warning(s) and ${e.summary.skipped} skipped check(s).`:`Not ready: ${e.summary.fail} check(s) failed.`)}async function eo(e,t,r){let n=await Ap({...t.directory!==void 0?{directory:t.directory}:{},...e!==void 0?{url:e}:{},...t.config!==void 0?{configPath:t.config}:{},...t.output!==void 0?{outputPath:t.output}:{},...t.report!==void 0?{reportPath:t.report}:{},...t["history-dir"]!==void 0?{historyPath:t["history-dir"]}:{},reportEnabled:t["no-report"]!==!0,historyEnabled:t["no-history"]!==!0,offline:t.offline===!0,requestHeaders:Kr(t["headers-env"]),...r!==void 0?{signal:r}:{}});return t.json?console.log(JSON.stringify({command:"doctor",...n},null,2)):pp(n),n.healthy?0:1}import{lstat as hp,mkdir as ro,readFile as cs,realpath as to,writeFile as no}from"node:fs/promises";import{dirname as ls,join as me,relative as gp,resolve as so}from"node:path";import{fileURLToPath as mp}from"node:url";var fp=so(mp(new URL("../agent-skill/seo-crawl-audit",import.meta.url)));async function Ep(e,t){let r=await to(e),n=t;for(;;)try{let s=await to(n),i=gp(r,s);if(i===".."||i.startsWith(`..${process.platform==="win32"?"\\":"/"}`))throw new Error(`generated agent path escapes the project through a symlink: ${t}`);return}catch(s){if(s.code!=="ENOENT")throw s;try{if((await hp(n)).isSymbolicLink())throw new Error(`generated agent path escapes the project through an unresolved symlink: ${t}`)}catch(o){if(o.code!=="ENOENT")throw o}let i=ls(n);if(i===n)throw s;n=i}}function Tp(e){let t=(e??"all").toLowerCase();if(t==="all")return["codex","claude","opencode"];if(["codex","claude","opencode"].includes(t))return[t];throw new Error("--platform must be codex, claude, opencode, or all")}async function bp(e,t,r){let n=null;try{n=await cs(t,"utf8")}catch(i){if(i.code!=="ENOENT")throw i}let s=await cs(e,"utf8");return n===s?{path:t,status:"unchanged"}:n!==null&&!r?{path:t,status:"skipped"}:(await ro(ls(t),{recursive:!0}),await no(t,s,"utf8"),{path:t,status:n===null?"created":"updated"})}async function Cp(e,t,r){let n=null;try{n=await cs(e,"utf8")}catch(s){if(s.code!=="ENOENT")throw s}return n===t?{path:e,status:"unchanged"}:n!==null&&!r?{path:e,status:"skipped"}:(await ro(ls(e),{recursive:!0}),await no(e,t,"utf8"),{path:e,status:n===null?"created":"updated"})}function Ip(){return`[mcp_servers.seo-crawl-audit]
277
+ `;return await $a(za(e),{recursive:!0}),await qa(e,`${r??""}${d}`,"utf8"),{path:e,status:r===null?"created":"updated"}}async function ep(e={}){let t=Xa(e.directory??process.cwd()),r=e.interactive??!!(process.stdin.isTTY&&process.stdout.isTTY),n=e.ask??Ke,s=e.url?.trim()??"";if(!s&&r&&!e.yes&&(s=await n("Full site URL: ")),!s)throw new Error("init requires a full site URL");let i=VA(s),o=e.workflow;o===void 0&&r&&!e.yes&&(o=await n("GitHub workflow [none/manual/scheduled/pull-request] (none): "));let d=XA(o),l=e.configPath?GA(e.configPath)?e.configPath:Xa(t,e.configPath):as(t,KA),c={force:e.force??!1,yes:e.yes??!1,interactive:r,ask:n},m=[await Za(l,ZA(i),c),await zA(as(t,".gitignore"),c)];return d!=="none"&&m.push(await Za(as(t,JA),$A(d),c)),{directory:t,url:i,workflow:d,files:m}}async function ro(e,t){let r=await ep({...t.directory!==void 0?{directory:t.directory}:{},...e!==void 0?{url:e}:{},...t.config!==void 0?{configPath:t.config}:{},...t.workflow!==void 0?{workflow:t.workflow}:{},...t.yes!==void 0?{yes:t.yes}:{},...t.force!==void 0?{force:t.force}:{}});if(t.json)return console.log(JSON.stringify({command:"init",...r},null,2)),0;console.log(`Initialized SEO Crawl Audit for ${r.url}`);for(let n of r.files)console.log(` ${n.status.padEnd(9)} ${n.path}`);return r.workflow==="pull-request"&&console.log("Set the SEO_AUDIT_PREVIEW_URL repository variable and commit .seo-audit.json before enabling the PR check."),console.log("Review seo-audit.config.json, then run: seo-audit scan"),0}import{access as tp,stat as rp}from"node:fs/promises";import{constants as np}from"node:fs";import{dirname as cs,isAbsolute as sp,resolve as ls}from"node:path";var no=[20,19,0],ip=".seo-audit.json",ap="seo-audit-report.html",op=".seo-audit/history";function cp(e){let t=/^(\d+)\.(\d+)\.(\d+)/u.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:[0,0,0]}function lp(e){let t=cp(e);for(let r=0;r<no.length;r+=1){let n=t[r]??0,s=no[r]??0;if(n>s)return!0;if(n<s)return!1}return!0}function dp(e){try{let t=new URL(e);return["http:","https:"].includes(t.protocol)?(t.hash="",t.href):null}catch{return null}}function Vr(e,t){return sp(t)?t:ls(e,t)}async function up(e){let t=ls(e);for(;;){try{if((await rp(t)).isDirectory())return t}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ENOENT")throw n}let r=cs(t);if(r===t)throw new Error(`no existing parent directory for ${e}`);t=r}}async function Ap(e,t){let r=[cs(Vr(e,t.outputPath??ip)),...t.reportEnabled===!1?[]:[cs(Vr(e,t.reportPath??ap))],...t.historyEnabled===!1?[]:[Vr(e,t.historyPath??op)]];try{let n=[...new Set(await Promise.all(r.map(up)))];return await Promise.all(n.map(s=>tp(s,np.W_OK))),{id:"storage",status:"pass",message:`Output locations are writable through ${n.join(", ")}`,evidence:{directories:n}}}catch(n){return{id:"storage",status:"fail",message:n instanceof Error?n.message:String(n),remediation:"Create the output directory or grant the current user write access."}}}function pp(e,t){let r=AbortSignal.timeout(e);return t?AbortSignal.any([t,r]):r}async function hp(e,t,r,n){try{let s=await r(e,{headers:{accept:"text/html,application/xhtml+xml;q=0.9,*/*;q=0.1","user-agent":`SEO-Crawl-Audit-Doctor/${W}`},redirect:"follow",signal:pp(t.timeout,n)}),i=s.headers.get("content-type")??"";return await s.body?.cancel(),s.status>=400?{id:"homepage",status:"fail",message:`Start URL returned HTTP ${s.status}`,remediation:s.status===401||s.status===403?"Configure authenticated request headers before auditing this site.":"Confirm that the URL is correct and publicly reachable.",evidence:{status:s.status,contentType:i}}:i.toLowerCase().includes("html")?{id:"homepage",status:"pass",message:`Start URL returned HTTP ${s.status} HTML`,evidence:{status:s.status,contentType:i}}:{id:"homepage",status:"warning",message:`Start URL returned ${i||"an unknown content type"}`,remediation:"Use a URL that returns server-rendered HTML.",evidence:{status:s.status,contentType:i}}}catch(s){return n?.throwIfAborted(),{id:"homepage",status:"fail",message:`Could not request the start URL: ${s instanceof Error?s.message:String(s)}`,remediation:"Check DNS, TLS, firewall access, and the configured timeout."}}}function gp(e){return e.reduce((t,r)=>(t[r.status]+=1,t),{pass:0,warning:0,fail:0,skipped:0})}async function mp(e={}){let t=ls(e.directory??process.cwd()),r=[],n=e.runtimeVersion??process.versions.node;r.push(lp(n)?{id:"runtime",status:"pass",message:`Node.js ${n} satisfies >=20.19`}:{id:"runtime",status:"fail",message:`Node.js ${n} is older than 20.19`,remediation:"Install Node.js 20.19 or newer on the machine running SEO Crawl Audit."});let i=(e.configPath?Vr(t,e.configPath):null)??await Br(t),o={};if(!i)r.push({id:"config",status:"warning",message:"seo-audit.config.json was not found",remediation:"Run seo-audit init <url> to create a safe project configuration."});else try{o=await Yt(i),r.push({id:"config",status:"pass",message:`Configuration is valid: ${i}`,evidence:{path:i}})}catch(A){r.push({id:"config",status:"fail",message:A instanceof Error?A.message:String(A),remediation:"Fix the reported property or regenerate the file with seo-audit init --force."})}let d=e.url??o.url??"",l=dp(d);l?r.push({id:"target",status:"pass",message:`Target URL is ${l}`,evidence:{url:l}}):r.push({id:"target",status:"fail",message:d?"Target is not a full HTTP(S) URL":"No target URL was provided",remediation:"Pass seo-audit doctor https://example.com/ or set url in seo-audit.config.json."}),r.push(await Ap(t,e));let c=e.offline??!1;if(c||!l){let A=c?"Skipped by --offline":"Skipped because the target URL is invalid";for(let h of["homepage","robots","sitemap"])r.push({id:h,status:"skipped",message:A})}else{let A=be({url:l},o),h=ts(e.requestHeaders??{},l,e.fetch??globalThis.fetch);r.push(await hp(l,A,h,e.signal));try{let f=await Ae(A,{fetch:h,signal:e.signal});f.robots.denyAll&&A.respectRobots?r.push({id:"robots",status:"fail",message:`robots.txt returned HTTP ${f.robots.status??"unknown"} and blocks crawling`,remediation:"Allow the audit user agent or explicitly choose --ignore-robots when authorized.",evidence:{url:f.robots.url,status:f.robots.status,denyAll:!0}}):f.robots.error||f.robots.status===null||(f.robots.status??500)>=400?r.push({id:"robots",status:"warning",message:f.robots.error??`robots.txt returned HTTP ${f.robots.status??"unknown"}`,remediation:"Publish a readable robots.txt when crawler policy needs to be explicit.",evidence:{url:f.robots.url,status:f.robots.status}}):r.push({id:"robots",status:"pass",message:`robots.txt returned HTTP ${f.robots.status}`,evidence:{url:f.robots.url,status:f.robots.status,denyAll:f.robots.denyAll??!1}}),A.sitemap==="none"?r.push({id:"sitemap",status:"skipped",message:"Sitemap discovery is disabled by configuration"}):f.sitemap?f.sitemap.error?r.push({id:"sitemap",status:A.sitemap==="auto"?"warning":"fail",message:f.sitemap.error,remediation:"Check the sitemap URL, XML syntax, response size, and HTTP status.",evidence:{url:f.sitemap.url}}):f.sitemap.urls.length===0?r.push({id:"sitemap",status:"warning",message:`Sitemap contains no crawlable same-origin URLs: ${f.sitemap.url}`,remediation:"Add canonical site URLs to the sitemap or verify the configured site origin."}):r.push({id:"sitemap",status:"pass",message:`Loaded ${f.sitemap.urls.length} URL(s) from ${f.sitemap.sitemapCount} sitemap file(s)`,evidence:{url:f.sitemap.url,urls:f.sitemap.urls.length,sitemapCount:f.sitemap.sitemapCount,truncated:f.sitemap.truncated}}):r.push({id:"sitemap",status:"warning",message:"No sitemap was discovered",remediation:"Publish a sitemap or set sitemap to none when link-only crawling is intentional."})}catch(f){e.signal?.throwIfAborted(),r.push({id:"robots",status:"fail",message:`Planning failed: ${f instanceof Error?f.message:String(f)}`,remediation:"Check network access, robots.txt redirects, sitemap responses, and timeout settings."}),r.push({id:"sitemap",status:"skipped",message:"Skipped because scan planning failed"})}}let m=gp(r);return{healthy:m.fail===0,offline:c,url:l,checks:r,summary:m}}function fp(e){console.log("SEO Crawl Audit doctor");let t={pass:"PASS",warning:"WARN",fail:"FAIL",skipped:"SKIP"};for(let r of e.checks)console.log(`[${t[r.status]}] ${r.id}: ${r.message}`),r.remediation&&console.log(` Fix: ${r.remediation}`);console.log(e.healthy?`Ready with ${e.summary.warning} warning(s) and ${e.summary.skipped} skipped check(s).`:`Not ready: ${e.summary.fail} check(s) failed.`)}async function so(e,t,r){let n=await mp({...t.directory!==void 0?{directory:t.directory}:{},...e!==void 0?{url:e}:{},...t.config!==void 0?{configPath:t.config}:{},...t.output!==void 0?{outputPath:t.output}:{},...t.report!==void 0?{reportPath:t.report}:{},...t["history-dir"]!==void 0?{historyPath:t["history-dir"]}:{},reportEnabled:t["no-report"]!==!0,historyEnabled:t["no-history"]!==!0,offline:t.offline===!0,requestHeaders:Kr(t["headers-env"]),...r!==void 0?{signal:r}:{}});return t.json?console.log(JSON.stringify({command:"doctor",...n},null,2)):fp(n),n.healthy?0:1}import{lstat as Ep,mkdir as ao,readFile as ds,realpath as io,writeFile as oo}from"node:fs/promises";import{dirname as us,join as me,relative as Tp,resolve as co}from"node:path";import{fileURLToPath as bp}from"node:url";var Cp=co(bp(new URL("../agent-skill/seo-crawl-audit",import.meta.url)));async function Ip(e,t){let r=await io(e),n=t;for(;;)try{let s=await io(n),i=Tp(r,s);if(i===".."||i.startsWith(`..${process.platform==="win32"?"\\":"/"}`))throw new Error(`generated agent path escapes the project through a symlink: ${t}`);return}catch(s){if(s.code!=="ENOENT")throw s;try{if((await Ep(n)).isSymbolicLink())throw new Error(`generated agent path escapes the project through an unresolved symlink: ${t}`)}catch(o){if(o.code!=="ENOENT")throw o}let i=us(n);if(i===n)throw s;n=i}}function yp(e){let t=(e??"all").toLowerCase();if(t==="all")return["codex","claude","opencode"];if(["codex","claude","opencode"].includes(t))return[t];throw new Error("--platform must be codex, claude, opencode, or all")}async function wp(e,t,r){let n=null;try{n=await ds(t,"utf8")}catch(i){if(i.code!=="ENOENT")throw i}let s=await ds(e,"utf8");return n===s?{path:t,status:"unchanged"}:n!==null&&!r?{path:t,status:"skipped"}:(await ao(us(t),{recursive:!0}),await oo(t,s,"utf8"),{path:t,status:n===null?"created":"updated"})}async function xp(e,t,r){let n=null;try{n=await ds(e,"utf8")}catch(s){if(s.code!=="ENOENT")throw s}return n===t?{path:e,status:"unchanged"}:n!==null&&!r?{path:e,status:"skipped"}:(await ao(us(e),{recursive:!0}),await oo(e,t,"utf8"),{path:e,status:n===null?"created":"updated"})}function Sp(){return`[mcp_servers.seo-crawl-audit]
275
278
  command = "npx"
276
279
  args = ["-y", "seo-crawl-audit@0.9", "mcp"]
277
280
  tool_timeout_sec = 600
278
- `}function yp(){return`${JSON.stringify({mcpServers:{"seo-crawl-audit":{command:"npx",args:["-y","seo-crawl-audit@0.9","mcp"]}}},null,2)}
279
- `}function wp(){return`${JSON.stringify({$schema:"https://opencode.ai/config.json",mcp:{"seo-crawl-audit":{type:"local",command:["npx","-y","seo-crawl-audit@0.9","mcp"],enabled:!0,timeout:6e5}}},null,2)}
280
- `}async function xp(e={}){let t=so(e.directory??process.cwd()),r=Tp(e.platform),n=[],s=[],i=new Set,o=new Set;for(let d of r)o.add(d==="claude"?me(t,".claude/skills/seo-crawl-audit/SKILL.md"):me(t,".agents/skills/seo-crawl-audit/SKILL.md")),o.add(d==="codex"?me(t,".codex/config.toml"):d==="claude"?me(t,".mcp.json"):me(t,"opencode.json"));await Promise.all([...o].map(d=>Ep(t,d)));for(let d of r){let l=d==="claude"?me(t,".claude/skills/seo-crawl-audit/SKILL.md"):me(t,".agents/skills/seo-crawl-audit/SKILL.md");i.has(l)||(n.push(await bp(me(fp,"SKILL.md"),l,e.force??!1)),i.add(l));let c=d==="codex"?me(t,".codex/config.toml"):d==="claude"?me(t,".mcp.json"):me(t,"opencode.json"),m=d==="codex"?Ip():d==="claude"?yp():wp(),A=await Cp(c,m,e.force??!1);n.push(A),A.status==="skipped"&&s.push(`${d} config snippet:
281
- ${m}`)}return{directory:t,platform:e.platform==="all"||!e.platform?"all":r[0],files:n,snippets:s}}async function io(e){let t=await xp({directory:e.directory,platform:e.platform,force:e.force});if(e.json)return console.log(JSON.stringify({command:"agent-init",...t},null,2)),0;console.log(`Prepared SEO Crawl Audit agent integration in ${t.directory}`);for(let r of t.files)console.log(` ${r.status.padEnd(7)} ${r.path}`);for(let r of t.snippets)console.log(`
281
+ `}function Np(){return`${JSON.stringify({mcpServers:{"seo-crawl-audit":{command:"npx",args:["-y","seo-crawl-audit@0.9","mcp"]}}},null,2)}
282
+ `}function Rp(){return`${JSON.stringify({$schema:"https://opencode.ai/config.json",mcp:{"seo-crawl-audit":{type:"local",command:["npx","-y","seo-crawl-audit@0.9","mcp"],enabled:!0,timeout:6e5}}},null,2)}
283
+ `}async function _p(e={}){let t=co(e.directory??process.cwd()),r=yp(e.platform),n=[],s=[],i=new Set,o=new Set;for(let d of r)o.add(d==="claude"?me(t,".claude/skills/seo-crawl-audit/SKILL.md"):me(t,".agents/skills/seo-crawl-audit/SKILL.md")),o.add(d==="codex"?me(t,".codex/config.toml"):d==="claude"?me(t,".mcp.json"):me(t,"opencode.json"));await Promise.all([...o].map(d=>Ip(t,d)));for(let d of r){let l=d==="claude"?me(t,".claude/skills/seo-crawl-audit/SKILL.md"):me(t,".agents/skills/seo-crawl-audit/SKILL.md");i.has(l)||(n.push(await wp(me(Cp,"SKILL.md"),l,e.force??!1)),i.add(l));let c=d==="codex"?me(t,".codex/config.toml"):d==="claude"?me(t,".mcp.json"):me(t,"opencode.json"),m=d==="codex"?Sp():d==="claude"?Np():Rp(),A=await xp(c,m,e.force??!1);n.push(A),A.status==="skipped"&&s.push(`${d} config snippet:
284
+ ${m}`)}return{directory:t,platform:e.platform==="all"||!e.platform?"all":r[0],files:n,snippets:s}}async function lo(e){let t=await _p({directory:e.directory,platform:e.platform,force:e.force});if(e.json)return console.log(JSON.stringify({command:"agent-init",...t},null,2)),0;console.log(`Prepared SEO Crawl Audit agent integration in ${t.directory}`);for(let r of t.files)console.log(` ${r.status.padEnd(7)} ${r.path}`);for(let r of t.snippets)console.log(`
282
285
  ${r}`);return console.log("Restart the agent client after enabling its project MCP configuration."),0}var Ne=`seo-audit ${W}
283
286
 
284
287
  Local-first SEO crawler, audit, and regression checker.
@@ -359,8 +362,8 @@ Exit codes:
359
362
  1 SEO regressions detected
360
363
  2 Invalid input or crawler failure
361
364
  130 Scan interrupted after saving partial results
362
- `;async function MT(e=process.argv.slice(2),t={}){let r;try{r=ya(e)}catch(l){return console.error(`${l instanceof Error?l.message:String(l)}
365
+ `;async function KT(e=process.argv.slice(2),t={}){let r;try{r=Na(e)}catch(l){return console.error(`${l instanceof Error?l.message:String(l)}
363
366
 
364
- ${Ne}`),2}let{values:n}=r,{positionals:s}=r;if(s[0]==="init"){if(n.help)return console.log(Ne),0;if(n.version)return console.log(W),0;if(s.length>2)return console.error(`Unexpected argument: ${s[2]}`),2;try{return await za(s[1],n)}catch(l){return console.error(`seo-audit: ${l instanceof Error?l.message:String(l)}`),2}}if(s[0]==="doctor"){if(s.length>2)return console.error(`Unexpected argument: ${s[2]}`),2;if(n.help)return console.log(Ne),0;if(n.version)return console.log(W),0;try{return await eo(s[1],n,t.signal)}catch(l){return console.error(`seo-audit: ${l instanceof Error?l.message:String(l)}`),t.signal?.aborted?130:2}}if(s[0]==="agent-init"){if(s.length>1)return console.error(`Unexpected argument: ${s[1]}`),2;if(n.help)return console.log(Ne),0;if(n.version)return console.log(W),0;try{return await io(n)}catch(l){return console.error(`seo-audit: ${l instanceof Error?l.message:String(l)}`),2}}if(s[0]==="status"){if(s.length>2)return console.error(`Unexpected argument: ${s[2]}`),2;if(n.help)return console.log(Ne),0;if(n.version)return console.log(W),0;try{return await Pa(s[1],n)}catch(l){return console.error(`seo-audit: ${l instanceof Error?l.message:String(l)}`),2}}if(s[0]==="serve"){if(s.length>2)return console.error(`Unexpected argument: ${s[2]}`),2;if(n.help)return console.log(Ne),0;let l=n.port===void 0?4179:Number.parseInt(n.port,10);if(!Number.isInteger(l)||l<0||l>65535)return console.error("seo-audit: --port must be an integer between 0 and 65535"),2;let c=s[1];if(c)try{let m=new URL(c);if(m.protocol!=="http:"&&m.protocol!=="https:")throw new Error("unsupported protocol")}catch{return console.error("seo-audit: serve URL must be a complete http:// or https:// URL"),2}try{let{serveCommand:m}=await import("./server.js");return await m(l,t.signal,{openBrowser:!n["no-open"],...c?{initialUrl:c}:{}})}catch(m){return console.error(`seo-audit: ${m instanceof Error?m.message:String(m)}`),2}}try{n=wa(n,await Yt(n.config))}catch(l){return console.error(`seo-audit: ${l instanceof Error?l.message:String(l)}`),2}if(n.version)return console.log(W),0;if(n.help||s.length===0)return console.log(Ne),0;let[i,o,...d]=s;if(i&&/^https?:\/\//i.test(i)&&(d=s.slice(1),o=i,i="scan"),(i==="scan"||i==="check")&&!o&&n.__config?.url&&(o=n.__config.url),d.length>0)return console.error(`Unexpected argument: ${d[0]}`),2;try{return i==="scan"?await Ha(o,n,t.signal):i==="check"?await Qa(o,n,t.signal):i==="compare"?await Ya(n,t.signal):i==="history"?await Wa(o,n):i==="report"?await Ga(o,n):(console.error(`Unknown command: ${String(i)}
367
+ ${Ne}`),2}let{values:n}=r,{positionals:s}=r;if(s[0]==="init"){if(n.help)return console.log(Ne),0;if(n.version)return console.log(W),0;if(s.length>2)return console.error(`Unexpected argument: ${s[2]}`),2;try{return await ro(s[1],n)}catch(l){return console.error(`seo-audit: ${l instanceof Error?l.message:String(l)}`),2}}if(s[0]==="doctor"){if(s.length>2)return console.error(`Unexpected argument: ${s[2]}`),2;if(n.help)return console.log(Ne),0;if(n.version)return console.log(W),0;try{return await so(s[1],n,t.signal)}catch(l){return console.error(`seo-audit: ${l instanceof Error?l.message:String(l)}`),t.signal?.aborted?130:2}}if(s[0]==="agent-init"){if(s.length>1)return console.error(`Unexpected argument: ${s[1]}`),2;if(n.help)return console.log(Ne),0;if(n.version)return console.log(W),0;try{return await lo(n)}catch(l){return console.error(`seo-audit: ${l instanceof Error?l.message:String(l)}`),2}}if(s[0]==="status"){if(s.length>2)return console.error(`Unexpected argument: ${s[2]}`),2;if(n.help)return console.log(Ne),0;if(n.version)return console.log(W),0;try{return await Ha(s[1],n)}catch(l){return console.error(`seo-audit: ${l instanceof Error?l.message:String(l)}`),2}}if(s[0]==="serve"){if(s.length>2)return console.error(`Unexpected argument: ${s[2]}`),2;if(n.help)return console.log(Ne),0;let l=n.port===void 0?4179:Number.parseInt(n.port,10);if(!Number.isInteger(l)||l<0||l>65535)return console.error("seo-audit: --port must be an integer between 0 and 65535"),2;let c=s[1];if(c)try{let m=new URL(c);if(m.protocol!=="http:"&&m.protocol!=="https:")throw new Error("unsupported protocol")}catch{return console.error("seo-audit: serve URL must be a complete http:// or https:// URL"),2}try{let{serveCommand:m}=await import("./server.js");return await m(l,t.signal,{openBrowser:!n["no-open"],...c?{initialUrl:c}:{}})}catch(m){return console.error(`seo-audit: ${m instanceof Error?m.message:String(m)}`),2}}try{n=Ra(n,await Yt(n.config))}catch(l){return console.error(`seo-audit: ${l instanceof Error?l.message:String(l)}`),2}if(n.version)return console.log(W),0;if(n.help||s.length===0)return console.log(Ne),0;let[i,o,...d]=s;if(i&&/^https?:\/\//i.test(i)&&(d=s.slice(1),o=i,i="scan"),(i==="scan"||i==="check")&&!o&&n.__config?.url&&(o=n.__config.url),d.length>0)return console.error(`Unexpected argument: ${d[0]}`),2;try{return i==="scan"?await Wa(o,n,t.signal):i==="check"?await Ka(o,n,t.signal):i==="compare"?await Ja(n,t.signal):i==="history"?await Va(o,n):i==="report"?await ja(o,n):(console.error(`Unknown command: ${String(i)}
365
368
 
366
- ${Ne}`),2)}catch(l){return console.error(`seo-audit: ${l instanceof Error?l.message:String(l)}`),t.signal?.aborted?130:2}}export{MT as main,_a as parseScanMenuSelection};
369
+ ${Ne}`),2)}catch(l){return console.error(`seo-audit: ${l instanceof Error?l.message:String(l)}`),t.signal?.aborted?130:2}}export{KT as main,Oa as parseScanMenuSelection};