single-file.js 290 KB

1
  1. !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).singlefile={})}(this,(function(e){"use strict";const t="single-file-load-image",n="single-file-image-loaded",r=globalThis.browser,a=(e,t,n)=>globalThis.addEventListener(e,t,n),o=e=>globalThis.dispatchEvent(e),s=globalThis.CustomEvent,i=globalThis.document,l=globalThis.HTMLDocument;let c;if(c=window._singleFile_fontFaces?window._singleFile_fontFaces:window._singleFile_fontFaces=[],i instanceof l&&r&&r.runtime&&r.runtime.getURL){a("single-file-new-font-face",(e=>{const t=e.detail;c.find((e=>JSON.stringify(e)==JSON.stringify(t)))||c.push(e.detail)})),a("single-file-delete-font",(e=>{const t=e.detail,n=c.findIndex((e=>e["family-name"]==t["family-name"]));-1!=n&&c.splice(n,1)})),a("single-file-clear-fonts",(()=>c=[]));let e=i.createElement("script");e.src="data:,("+function(){"undefined"==typeof globalThis&&(window.globalThis=window);const e=globalThis.document,t=globalThis.console,n=e=>globalThis.dispatchEvent(e),r=globalThis.CustomEvent,a=globalThis.FileReader,o=globalThis.Blob,s=t&&t.warn&&((...e)=>t.warn(...e))||(()=>{}),i="single-file-new-font-face",l="single-file-delete-font",c="single-file-clear-fonts",u={family:"font-family",style:"font-style",weight:"font-weight",stretch:"font-stretch",unicodeRange:"unicode-range",variant:"font-variant",featureSettings:"font-feature-settings"};if(globalThis.FontFace){const t=globalThis.FontFace;let a;globalThis.FontFace=function(){return a||(s("SingleFile is hooking the FontFace constructor, document.fonts.delete and document.fonts.clear to handle dynamically loaded fonts."),a=!0),h(...arguments).then((e=>n(new r(i,{detail:e})))),new t(...arguments)},globalThis.FontFace.toString=function(){return"function FontFace() { [native code] }"};const o=e.fonts.delete;e.fonts.delete=function(t){return h(t.family).then((e=>n(new r(l,{detail:e})))),o.call(e.fonts,t)},e.fonts.delete.toString=function(){return"function delete() { [native code] }"};const u=e.fonts.clear;e.fonts.clear=function(){return n(new r(c)),u.call(e.fonts)},e.fonts.clear.toString=function(){return"function clear() { [native code] }"}}async function h(e,t,n){const r={};return r["font-family"]=e,r.src=t,n&&Object.keys(n).forEach((e=>{u[e]&&(r[u[e]]=n[e])})),new Promise((e=>{if(r.src instanceof ArrayBuffer){const t=new a;t.readAsDataURL(new o([r.src])),t.addEventListener("load",(()=>{r.src="url("+t.result+")",e(r)}))}else e(r)}))}}.toString()+")()",(i.documentElement||i).appendChild(e),e.remove(),e=i.createElement("script"),e.src=r.runtime.getURL("/dist/web/hooks/hooks-frames-web.js"),e.async=!1,(i.documentElement||i).appendChild(e),e.remove()}function u(){return c}function h(e){e.loadDeferredImagesBlockCookies&&o(new s("single-file-block-cookies-start")),e.loadDeferredImagesBlockStorage&&o(new s("single-file-block-storage-start")),e.loadDeferredImagesKeepZoomLevel?o(new s("single-file-load-deferred-images-keep-zoom-level-start")):o(new s("single-file-load-deferred-images-start"))}function d(e){e.loadDeferredImagesBlockCookies&&o(new s("single-file-block-cookies-end")),e.loadDeferredImagesBlockStorage&&o(new s("single-file-block-storage-end")),e.loadDeferredImagesKeepZoomLevel?o(new s("single-file-load-deferred-images-keep-zoom-level-end")):o(new s("single-file-load-deferred-images-end"))}function p(e){e.loadDeferredImagesKeepZoomLevel?o(new s("single-file-load-deferred-images-keep-zoom-level-reset")):o(new s("single-file-load-deferred-images-reset"))}var m=Object.freeze({__proto__:null,getFontsData:u,loadDeferredImagesStart:h,loadDeferredImagesEnd:d,loadDeferredImagesResetZoomLevel:p,LOAD_IMAGE_EVENT:t,IMAGE_LOADED_EVENT:n});const f=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig");function g(e){return e.replace(f,((e,t,n)=>{const r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)}))}var y=Object.freeze({__proto__:null,process:g});const b="single-file-on-before-capture",v="single-file-on-after-capture",k="data-single-file-removed-content",w="data-single-file-hidden-content",x="data-single-file-kept-content",S="data-single-file-hidden-frame",E="data-single-file-preserved-space-element",A="data-single-file-shadow-root-element",T="data-single-file-win-id",C="data-single-file-image",R="data-single-file-poster",_="data-single-file-canvas",I="data-single-file-import",L="data-single-file-input-value",P="data-single-file-lazy-loaded-src",N="data-single-file-stylesheet",z="data-single-file-disabled-noscript",M="data-single-file-selected-content",D="data-single-file-async-script",O="*:not(base):not(link):not(meta):not(noscript):not(script):not(style):not(template):not(title)",U=["NOSCRIPT","DISABLED-NOSCRIPT","META","LINK","STYLE","TITLE","TEMPLATE","SOURCE","OBJECT","SCRIPT","HEAD"],F=/^'(.*?)'$/,B=/^"(.*?)"$/,q={regular:"400",normal:"400",bold:"700",bolder:"700",lighter:"100"},j="Page saved with SingleFile",H="Archive processed by SingleFile",W="single-file-ui-element",V=(e,t,n)=>globalThis.addEventListener(e,t,n);function $(e){e.querySelectorAll("meta[http-equiv=refresh]").forEach((e=>{e.removeAttribute("http-equiv"),e.setAttribute("disabled-http-equiv","refresh")}))}function Y(e,t,n){let r;return e.querySelectorAll("noscript:not([data-single-file-disabled-noscript])").forEach((e=>{e.setAttribute(z,e.textContent),e.textContent=""})),$(e),e.head&&e.head.querySelectorAll(O).forEach((e=>e.hidden=!0)),e.querySelectorAll("svg foreignObject").forEach((e=>{const t=e.querySelectorAll("html > head > "+O+", html > body > "+O);t.length&&(Array.from(e.childNodes).forEach((e=>e.remove())),t.forEach((t=>e.appendChild(t))))})),r=t&&e.documentElement?G(t,e,e.documentElement,n):{canvases:[],images:[],posters:[],usedFonts:[],shadowRoots:[],imports:[],markedElements:[]},{canvases:r.canvases,fonts:u(),stylesheets:X(e),images:r.images,posters:r.posters,usedFonts:Array.from(r.usedFonts.values()),shadowRoots:r.shadowRoots,imports:r.imports,referrer:e.referrer,markedElements:r.markedElements}}function G(e,t,n,r,a={usedFonts:new Map,canvases:[],images:[],posters:[],shadowRoots:[],imports:[],markedElements:[]},o){return Array.from(n.childNodes).filter((t=>t instanceof e.HTMLElement||t instanceof e.SVGElement)).forEach((n=>{let s,i,l;if(!r.autoSaveExternalSave&&(r.removeHiddenElements||r.removeUnusedFonts||r.compressHTML)&&(l=e.getComputedStyle(n),n instanceof e.HTMLElement&&r.removeHiddenElements&&(i=(o||n.closest("html > head"))&&U.includes(n.tagName)||n.closest("details"),i||(s=o||function(e,t){let n=!1;if(t){const r=t.getPropertyValue("display"),a=t.getPropertyValue("opacity"),o=t.getPropertyValue("visibility");if(n="none"==r,!n&&("0"==a||"hidden"==o)&&e.getBoundingClientRect){const t=e.getBoundingClientRect();n=!t.width&&!t.height}}return Boolean(n)}(n,l),s&&(n.setAttribute(w,""),a.markedElements.push(n)))),!s)){if(r.compressHTML&&l){const e=l.getPropertyValue("white-space");e&&e.startsWith("pre")&&(n.setAttribute(E,""),a.markedElements.push(n))}r.removeUnusedFonts&&(K(l,r,a.usedFonts),K(e.getComputedStyle(n,":first-letter"),r,a.usedFonts),K(e.getComputedStyle(n,":before"),r,a.usedFonts),K(e.getComputedStyle(n,":after"),r,a.usedFonts))}!function(e,t,n,r,a,o,s){if("CANVAS"==n.tagName)try{const t=ee(e,n,s);a.canvases.push({dataURI:n.toDataURL("image/png",""),width:t.width,height:t.height}),n.setAttribute(_,a.canvases.length-1),a.markedElements.push(n)}catch(e){}if("IMG"==n.tagName){const t={currentSrc:o?"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==":r.loadDeferredImages&&n.getAttribute(P)||n.currentSrc};if(a.images.push(t),n.setAttribute(C,a.images.length-1),a.markedElements.push(n),n.removeAttribute(P),s=s||e.getComputedStyle(n)){t.size=ee(e,n,s);const r=s.getPropertyValue("box-shadow"),a=s.getPropertyValue("background-image");r&&"none"!=r||a&&"none"!=a||!(t.size.pxWidth>1||t.size.pxHeight>1)||(t.replaceable=!0,t.backgroundColor=s.getPropertyValue("background-color"),t.objectFit=s.getPropertyValue("object-fit"),t.boxSizing=s.getPropertyValue("box-sizing"),t.objectPosition=s.getPropertyValue("object-position"))}}if("VIDEO"==n.tagName&&!n.poster){const e=t.createElement("canvas"),r=e.getContext("2d");e.width=n.clientWidth,e.height=n.clientHeight;try{r.drawImage(n,0,0,e.width,e.height),a.posters.push(e.toDataURL("image/png","")),n.setAttribute(R,a.posters.length-1),a.markedElements.push(n)}catch(e){}}"IFRAME"==n.tagName&&o&&r.removeHiddenElements&&(n.setAttribute(S,""),a.markedElements.push(n));"LINK"==n.tagName&&n.import&&n.import.documentElement&&(a.imports.push({content:ne(n.import)}),n.setAttribute(I,a.imports.length-1),a.markedElements.push(n));"INPUT"==n.tagName&&("password"!=n.type&&(n.setAttribute(L,n.value),a.markedElements.push(n)),"radio"!=n.type&&"checkbox"!=n.type||(n.setAttribute(L,n.checked),a.markedElements.push(n)));"TEXTAREA"==n.tagName&&(n.setAttribute(L,n.value),a.markedElements.push(n));"SELECT"==n.tagName&&n.querySelectorAll("option").forEach((e=>{e.selected&&(e.setAttribute(L,""),a.markedElements.push(e))}));"SCRIPT"==n.tagName&&(n.async&&""!=n.getAttribute("async")&&"async"!=n.getAttribute("async")&&(n.setAttribute(D,""),a.markedElements.push(n)),n.textContent=n.textContent.replace(/<\/script>/gi,"<\\/script>"))}(e,t,n,r,a,s,l);const c=!(n instanceof e.SVGElement)&&Q(n);if(c&&!n.classList.contains(W)){const o={};n.setAttribute(A,a.shadowRoots.length),a.markedElements.push(n),a.shadowRoots.push(o),G(e,t,c,r,a,s),o.content=c.innerHTML,o.delegatesFocus=c.delegatesFocus,o.mode=c.mode,c.adoptedStyleSheets&&c.adoptedStyleSheets.length&&(o.adoptedStyleSheets=Array.from(c.adoptedStyleSheets).map((e=>Array.from(e.cssRules).map((e=>e.cssText)).join("\n"))))}G(e,t,n,r,a,s),!r.autoSaveExternalSave&&r.removeHiddenElements&&o&&(i||""==n.getAttribute(x)?n.parentElement&&(n.parentElement.setAttribute(x,""),a.markedElements.push(n.parentElement)):s&&(n.setAttribute(k,""),a.markedElements.push(n)))})),a}function K(e,t,n){if(e){const r=e.getPropertyValue("font-style")||"normal";e.getPropertyValue("font-family").split(",").forEach((a=>{if(a=J(a),!t.loadedFonts||t.loadedFonts.find((e=>J(e.family)==a&&e.style==r))){const t=ae(e.getPropertyValue("font-weight")),o=e.getPropertyValue("font-variant")||"normal",s=[a,t,r,o];n.set(JSON.stringify(s),[a,t,r,o])}}))}}function Q(e){const t=globalThis.chrome;if(e.openOrClosedShadowRoot)return e.openOrClosedShadowRoot;if(!(t&&t.dom&&t.dom.openOrClosedShadowRoot))return e.shadowRoot;try{return t.dom.openOrClosedShadowRoot(e)}catch(t){return e.shadowRoot}}function J(e=""){return re(g(e.trim())).toLowerCase()}function Z(e,t){if(e.querySelectorAll("[data-single-file-disabled-noscript]").forEach((e=>{e.textContent=e.getAttribute(z),e.removeAttribute(z)})),e.querySelectorAll("meta[disabled-http-equiv]").forEach((e=>{e.setAttribute("http-equiv",e.getAttribute("disabled-http-equiv")),e.removeAttribute("disabled-http-equiv")})),e.head&&e.head.querySelectorAll("*:not(base):not(link):not(meta):not(noscript):not(script):not(style):not(template):not(title)").forEach((e=>e.removeAttribute("hidden"))),!t){const n=[k,S,w,E,C,R,_,L,A,I,N,D];t=e.querySelectorAll(n.map((e=>"["+e+"]")).join(","))}t.forEach((e=>{e.removeAttribute(k),e.removeAttribute(w),e.removeAttribute(x),e.removeAttribute(S),e.removeAttribute(E),e.removeAttribute(C),e.removeAttribute(R),e.removeAttribute(_),e.removeAttribute(L),e.removeAttribute(A),e.removeAttribute(I),e.removeAttribute(N),e.removeAttribute(D)}))}function X(e){if(e){const t=[];return e.querySelectorAll("style").forEach(((n,r)=>{try{const a=e.createElement("style");a.textContent=n.textContent,e.body.appendChild(a);const o=a.sheet;a.remove(),o&&o.cssRules.length==n.sheet.cssRules.length||(n.setAttribute(N,r),t[r]=Array.from(n.sheet.cssRules).map((e=>e.cssText)).join("\n"))}catch(e){}})),t}}function ee(e,t,n){let r=t.naturalWidth,a=t.naturalHeight;if(!r&&!a){let o,s,i,l,c,u,h,d,p=!1;if("content-box"==(n=n||e.getComputedStyle(t)).getPropertyValue("box-sizing")){const e=t.style.getPropertyValue("box-sizing"),n=t.style.getPropertyPriority("box-sizing"),r=t.clientWidth;t.style.setProperty("box-sizing","border-box","important"),p=t.clientWidth!=r,e?t.style.setProperty("box-sizing",e,n):t.style.removeProperty("box-sizing")}o=te("padding-left",n),s=te("padding-right",n),i=te("padding-top",n),l=te("padding-bottom",n),p?(c=te("border-left-width",n),u=te("border-right-width",n),h=te("border-top-width",n),d=te("border-bottom-width",n)):c=u=h=d=0,r=Math.max(0,t.clientWidth-o-s-c-u),a=Math.max(0,t.clientHeight-i-l-h-d)}return{pxWidth:r,pxHeight:a}}function te(e,t){if(t.getPropertyValue(e).endsWith("px"))return parseFloat(t.getPropertyValue(e))}function ne(e){const t=e.doctype;let n="";return t&&(n="<!DOCTYPE "+t.nodeName,t.publicId?(n+=' PUBLIC "'+t.publicId+'"',t.systemId&&(n+=' "'+t.systemId+'"')):t.systemId&&(n+=' SYSTEM "'+t.systemId+'"'),t.internalSubset&&(n+=" ["+t.internalSubset+"]"),n+="> "),n+e.documentElement.outerHTML}function re(e){return(e=e.match(F)?e.replace(F,"$1"):e.replace(B,"$1")).trim()}function ae(e){return q[e.toLowerCase().trim()]||e}function oe(e){return e.flat?e.flat():e.reduce(((e,t)=>e.concat(Array.isArray(t)?oe(t):t)),[])}var se=Object.freeze({__proto__:null,initUserScriptHandler:function(){V("single-file-user-script-init",(()=>globalThis._singleFile_waitForUserScript=async e=>{const t=new CustomEvent(e+"-request",{cancelable:!0}),n=new Promise((t=>V(e+"-response",t)));(e=>{globalThis.dispatchEvent(e)})(t),t.defaultPrevented&&await n}))},initDoc:$,preProcessDoc:Y,postProcessDoc:Z,serialize:ne,removeQuotes:re,flatten:oe,getFontWeight:ae,normalizeFontFamily:J,getShadowRoot:Q,ON_BEFORE_CAPTURE_EVENT_NAME:b,ON_AFTER_CAPTURE_EVENT_NAME:v,WIN_ID_ATTRIBUTE_NAME:T,PRESERVED_SPACE_ELEMENT_ATTRIBUTE_NAME:E,REMOVED_CONTENT_ATTRIBUTE_NAME:k,HIDDEN_CONTENT_ATTRIBUTE_NAME:w,HIDDEN_FRAME_ATTRIBUTE_NAME:S,IMAGE_ATTRIBUTE_NAME:C,POSTER_ATTRIBUTE_NAME:R,CANVAS_ATTRIBUTE_NAME:_,INPUT_VALUE_ATTRIBUTE_NAME:L,SHADOW_ROOT_ATTRIBUTE_NAME:A,HTML_IMPORT_ATTRIBUTE_NAME:I,LAZY_SRC_ATTRIBUTE_NAME:P,STYLESHEET_ATTRIBUTE_NAME:N,SELECTED_CONTENT_ATTRIBUTE_NAME:M,ASYNC_SCRIPT_ATTRIBUTE_NAME:D,COMMENT_HEADER:j,COMMENT_HEADER_LEGACY:H,SINGLE_FILE_UI_ELEMENT_CLASS:W});const ie=P,le=W,ce="attributes",ue=globalThis.browser,he=globalThis.document,de=globalThis.MutationObserver,pe=(e,t,n)=>globalThis.addEventListener(e,t,n),me=(e,t,n)=>globalThis.removeEventListener(e,t,n),fe=new Map;async function ge(e){if(he.documentElement){fe.clear();const r=Math.max(he.documentElement.scrollHeight-1.5*he.documentElement.clientHeight,0),a=Math.max(he.documentElement.scrollWidth-1.5*he.documentElement.clientWidth,0);if(globalThis.scrollY<=r&&globalThis.scrollX<=a)return function(e){return new Promise((async r=>{let a;const o=new Set,s=new de((async t=>{if((t=t.filter((e=>e.type==ce))).length){t.filter((e=>{if("src"==e.attributeName&&(e.target.setAttribute(ie,e.target.src),e.target.addEventListener("load",l)),"src"==e.attributeName||"srcset"==e.attributeName||"SOURCE"==e.target.tagName)return!e.target.classList||!e.target.classList.contains(le)})).length&&(a=!0,await ve(s,e,d),o.size||await be(s,e,d))}}));async function i(t){await we("idleTimeout",(async()=>{a?(Se("idleTimeout"),await i(Math.max(500,t/2))):(Se("loadTimeout"),Se("maxTimeout"),ke(s,e,d))}),t)}function l(e){const t=e.target;t.removeAttribute(ie),t.removeEventListener("load",l)}async function c(t){a=!0,await ve(s,e,d),await be(s,e,d),t.detail&&o.add(t.detail)}async function u(t){await ve(s,e,d),await be(s,e,d),o.delete(t.detail),o.size||await be(s,e,d)}function d(e){s.disconnect(),me(t,c),me(n,u),r(e)}await i(2*e.loadDeferredImagesMaxIdleTime),await ve(s,e,d),s.observe(he,{subtree:!0,childList:!0,attributes:!0}),pe(t,c),pe(n,u),h(e)}))}(e)}}function ye(e){p(e)}async function be(e,t,n){await we("loadTimeout",(()=>ke(e,t,n)),t.loadDeferredImagesMaxIdleTime)}async function ve(e,t,n){await we("maxTimeout",(async()=>{await Se("loadTimeout"),await ke(e,t,n)}),10*t.loadDeferredImagesMaxIdleTime)}async function ke(e,t,n){await Se("idleTimeout"),d(t),await we("endTimeout",(async()=>{await Se("maxTimeout"),n()}),t.loadDeferredImagesMaxIdleTime/2),e.disconnect()}async function we(e,t,n){if(ue&&ue.runtime&&ue.runtime.sendMessage){if(!fe.get(e)||!fe.get(e).pending){const r={callback:t,pending:!0};fe.set(e,r);try{await ue.runtime.sendMessage({method:"singlefile.lazyTimeout.setTimeout",type:e,delay:n})}catch(r){xe(e,t,n)}r.pending=!1}}else xe(e,t,n)}function xe(e,t,n){const r=fe.get(e);r&&globalThis.clearTimeout(r),fe.set(e,t),globalThis.setTimeout(t,n)}async function Se(e){if(ue&&ue.runtime&&ue.runtime.sendMessage)try{await ue.runtime.sendMessage({method:"singlefile.lazyTimeout.clearTimeout",type:e})}catch(t){Ee(e)}else Ee(e)}function Ee(e){const t=fe.get(e);fe.delete(e),t&&globalThis.clearTimeout(t)}ue&&ue.runtime&&ue.runtime.onMessage&&ue.runtime.onMessage.addListener&&ue.runtime.onMessage.addListener((e=>{if("singlefile.lazyTimeout.onTimeout"==e.method){const t=fe.get(e.type);if(t){fe.delete(e.type);try{t.callback()}catch(t){Ee(e.type)}}}}));var Ae=Object.freeze({__proto__:null,process:ge,resetZoomLevel:ye});const Te={ON_BEFORE_CAPTURE_EVENT_NAME:b,ON_AFTER_CAPTURE_EVENT_NAME:v,WIN_ID_ATTRIBUTE_NAME:T,preProcessDoc:Y,serialize:ne,postProcessDoc:Z,getShadowRoot:Q},Ce="__frameTree__::",Re='iframe, frame, object[type="text/html"][data]',_e="singlefile.frameTree.initRequest",Ie="singlefile.frameTree.ackInitRequest",Le="singlefile.frameTree.cleanupRequest",Pe="singlefile.frameTree.initResponse",Ne=".",ze=globalThis.window==globalThis.top,Me=globalThis.browser,De=globalThis.top,Oe=globalThis.MessageChannel,Ue=globalThis.document,Fe=new Map;let Be;var qe,je,He;function We(){return globalThis.crypto.getRandomValues(new Uint32Array(32)).join("")}async function Ve(e){const t=e.sessionId,n=globalThis._singleFile_waitForUserScript;ze||(Be=globalThis.frameId=e.windowId),Ge(Ue,e.options,Be,t),ze||(e.options.userScriptEnabled&&n&&await n(Te.ON_BEFORE_CAPTURE_EVENT_NAME),Ze({frames:[et(Ue,globalThis,Be,e.options)],sessionId:t,requestedFrameId:Ue.documentElement.dataset.requestedFrameId&&Be}),e.options.userScriptEnabled&&n&&await n(Te.ON_AFTER_CAPTURE_EVENT_NAME),delete Ue.documentElement.dataset.requestedFrameId)}function $e(e){const t=e.sessionId;Je(tt(Ue),e.windowId,t)}function Ye(e){e.frames.forEach((t=>Ke("responseTimeouts",e.sessionId,t.windowId)));const t=Fe.get(e.sessionId);if(t){e.requestedFrameId&&(t.requestedFrameId=e.requestedFrameId),e.frames.forEach((e=>{let n=t.frames.find((t=>e.windowId==t.windowId));n||(n={windowId:e.windowId},t.frames.push(n)),n.processed||(n.content=e.content,n.baseURI=e.baseURI,n.title=e.title,n.canvases=e.canvases,n.fonts=e.fonts,n.stylesheets=e.stylesheets,n.images=e.images,n.posters=e.posters,n.usedFonts=e.usedFonts,n.shadowRoots=e.shadowRoots,n.imports=e.imports,n.processed=e.processed)}));t.frames.filter((e=>!e.processed)).length||(t.frames=t.frames.sort(((e,t)=>t.windowId.split(Ne).length-e.windowId.split(Ne).length)),t.resolve&&(t.requestedFrameId&&t.frames.forEach((e=>{e.windowId==t.requestedFrameId&&(e.requestedFrame=!0)})),t.resolve(t.frames)))}}function Ge(e,t,n,r){const a=tt(e);!function(e,t,n,r,a){const o=[];let s;Fe.get(a)?s=Fe.get(a).requestTimeouts:(s={},Fe.set(a,{requestTimeouts:s}));t.forEach(((e,t)=>{const n=r+Ne+t;e.setAttribute(Te.WIN_ID_ATTRIBUTE_NAME,n),o.push({windowId:n})})),Ze({frames:o,sessionId:a,requestedFrameId:e.documentElement.dataset.requestedFrameId&&r}),t.forEach(((e,t)=>{const o=r+Ne+t;try{Xe(e.contentWindow,{method:_e,windowId:o,sessionId:a,options:n})}catch(e){}s[o]=globalThis.setTimeout((()=>Ze({frames:[{windowId:o,processed:!0}],sessionId:a})),750)})),delete e.documentElement.dataset.requestedFrameId}(e,a,t,n,r),a.length&&function(e,t,n,r,a){const o=[];t.forEach(((e,t)=>{const s=r+Ne+t;let i;try{i=e.contentDocument}catch(e){}if(i)try{const t=e.contentWindow;t.stop(),Ke("requestTimeouts",a,s),Ge(i,n,s,a),o.push(et(i,t,s,n))}catch(e){o.push({windowId:s,processed:!0})}})),Ze({frames:o,sessionId:a,requestedFrameId:e.documentElement.dataset.requestedFrameId&&r}),delete e.documentElement.dataset.requestedFrameId}(e,a,t,n,r)}function Ke(e,t,n){const r=Fe.get(t);if(r&&r[e]){const t=r[e][n];t&&(globalThis.clearTimeout(t),delete r[e][n])}}function Qe(e,t){const n=Fe.get(e);n&&n.responseTimeouts&&(n.responseTimeouts[t]=globalThis.setTimeout((()=>Ze({frames:[{windowId:t,processed:!0}],sessionId:e})),1e4))}function Je(e,t,n){e.forEach(((e,r)=>{const a=t+Ne+r;e.removeAttribute(Te.WIN_ID_ATTRIBUTE_NAME);try{Xe(e.contentWindow,{method:Le,windowId:a,sessionId:n})}catch(e){}})),e.forEach(((e,r)=>{const a=t+Ne+r;let o;try{o=e.contentDocument}catch(e){}if(o)try{Je(tt(o),a,n)}catch(e){}}))}function Ze(e){e.method=Pe;try{De.singlefile.processors.frameTree.initResponse(e)}catch(t){Xe(De,e,!0)}}function Xe(e,t,n){if(e==De&&Me&&Me.runtime&&Me.runtime.sendMessage)Me.runtime.sendMessage(t);else if(n){const n=new Oe;e.postMessage(Ce+JSON.stringify({method:t.method,sessionId:t.sessionId}),"*",[n.port2]),n.port1.postMessage(t)}else e.postMessage(Ce+JSON.stringify(t),"*")}function et(e,t,n,r){const a=Te.preProcessDoc(e,t,r),o=Te.serialize(e);Te.postProcessDoc(e,a.markedElements);return{windowId:n,content:o,baseURI:e.baseURI.split("#")[0],title:e.title,canvases:a.canvases,fonts:a.fonts,stylesheets:a.stylesheets,images:a.images,posters:a.posters,usedFonts:a.usedFonts,shadowRoots:a.shadowRoots,imports:a.imports,processed:!0}}function tt(e){let t=Array.from(e.querySelectorAll(Re));return e.querySelectorAll("*").forEach((e=>{const n=Te.getShadowRoot(e);n&&(t=t.concat(...n.querySelectorAll(Re)))})),t}ze&&(Be="0",Me&&Me.runtime&&Me.runtime.onMessage&&Me.runtime.onMessage.addListener&&Me.runtime.onMessage.addListener((e=>e.method==Pe?(Ye(e),Promise.resolve({})):e.method==Ie?(Ke("requestTimeouts",e.sessionId,e.windowId),Qe(e.sessionId,e.windowId),Promise.resolve({})):void 0))),qe="message",je=async e=>{if("string"==typeof e.data&&e.data.startsWith(Ce)){e.preventDefault(),e.stopPropagation();const t=JSON.parse(e.data.substring(Ce.length));t.method==_e?(e.source&&Xe(e.source,{method:Ie,windowId:t.windowId,sessionId:t.sessionId}),ze||(globalThis.stop(),t.options.loadDeferredImages&&ge(t.options),await Ve(t))):t.method==Ie?(Ke("requestTimeouts",t.sessionId,t.windowId),Qe(t.sessionId,t.windowId)):t.method==Le?$e(t):t.method==Pe&&Fe.get(t.sessionId)&&(e.ports[0].onmessage=e=>Ye(e.data))}},He=!0,globalThis.addEventListener(qe,je,He);var nt=Object.freeze({__proto__:null,getAsync:function(e){const t=We();return e=JSON.parse(JSON.stringify(e)),new Promise((n=>{Fe.set(t,{frames:[],requestTimeouts:{},responseTimeouts:{},resolve:e=>{e.sessionId=t,n(e)}}),Ve({windowId:Be,sessionId:t,options:e})}))},getSync:function(e){const t=We();e=JSON.parse(JSON.stringify(e)),Fe.set(t,{frames:[],requestTimeouts:{},responseTimeouts:{}}),function(e){const t=e.sessionId,n=globalThis._singleFile_waitForUserScript;ze||(Be=globalThis.frameId=e.windowId);Ge(Ue,e.options,Be,t),ze||(e.options.userScriptEnabled&&n&&n(Te.ON_BEFORE_CAPTURE_EVENT_NAME),Ze({frames:[et(Ue,globalThis,Be,e.options)],sessionId:t,requestedFrameId:Ue.documentElement.dataset.requestedFrameId&&Be}),e.options.userScriptEnabled&&n&&n(Te.ON_AFTER_CAPTURE_EVENT_NAME),delete Ue.documentElement.dataset.requestedFrameId)}({windowId:Be,sessionId:t,options:e});const n=Fe.get(t).frames;return n.sessionId=t,n},cleanup:function(e){Fe.delete(e),$e({windowId:Be,sessionId:e,options:{sessionId:e}})},initResponse:Ye,TIMEOUT_INIT_REQUEST_MESSAGE:750});const rt=globalThis.browser,at=globalThis.document;if(at instanceof globalThis.HTMLDocument){const e=at.createElement("script");e.async=!1,rt&&rt.runtime&&rt.runtime.getURL&&(e.src=rt.runtime.getURL("/dist/web/hooks/hooks-web.js"),e.async=!1),(at.documentElement||at).appendChild(e),e.remove()}var ot=Object.freeze({__proto__:null}),st=Object.freeze({__proto__:null,frameTree:nt,hooks:ot,hooksFrames:m,lazy:Ae});const it=/^'(.*?)'$/,lt=/^"(.*?)"$/,ct=["inherit","initial","unset"],ut=["caption","icon","menu","message-box","small-caption","status-bar"],ht=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"],dt=["normal","italic","oblique"],pt=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"],mt=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"],ft={splitBySpaces:function(e){return wt(e,[" ","\n","\t"])},split:wt,splitByCommas:function(e){return wt(e,[","],{last:!0})}},gt={isSize:function(e){return!isNaN(parseFloat(e))||-1!==e.indexOf("/")||-1!==mt.indexOf(e)}},yt="[parse-css-font] ";function bt(e){if("string"!=typeof e)throw new TypeError(yt+"Expected a string.");if(""===e)throw vt("Cannot parse an empty string.");if(-1!==ut.indexOf(e))return{system:e};const t={lineHeight:"normal",stretch:"normal",style:"normal",variant:"normal",weight:"normal"};let n=!1;const r=ft.splitBySpaces(e);let a=r.shift();for(;a;a=r.shift())if("normal"!==a&&-1===ct.indexOf(a))if(-1===ht.indexOf(a))if(-1===dt.indexOf(a))if(-1===pt.indexOf(a)){if(gt.isSize(a)){const e=ft.split(a,["/"]);if(t.size=e[0],e[1]?t.lineHeight=kt(e[1]):"/"===r[0]&&(r.shift(),t.lineHeight=kt(r.shift())),!r.length)throw vt("Missing required font-family.");return t.family=ft.splitByCommas(r.join(" ")).map(xt),t}if("normal"!==t.variant)throw vt("Unknown or unsupported font token: "+t.variant);n||(t.variant=a)}else{if(n)continue;t.stretch=a}else{if(n)continue;t.style=a}else{if(n)continue;t.weight=a}else["style","variant","weight","stretch"].forEach((e=>{t[e]=a})),n=!0;throw vt("Missing required font-size.")}function vt(e){return new Error(yt+e)}function kt(e){const t=parseFloat(e);return t.toString()===e?t:e}function wt(e,t,{last:n=!1}={}){if("string"!=typeof e)throw new TypeError("expected a string");if(!Array.isArray(t))throw new TypeError("expected a string array of separators");if("boolean"!=typeof n)throw new TypeError("expected a Boolean value for options.last");const r=[];let a="",o=!1,s=0,i=!1,l=!1;for(const n of e)i?l?l=!1:"\\"===n?l=!0:n===i&&(i=!1):'"'===n||"'"===n?i=n:"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&-1!==t.indexOf(n)&&(o=!0),o?(""!==a&&r.push(a.trim()),a="",o=!1):a+=n;return(n||""!==a)&&r.push(a.trim()),r}function xt(e){return(e=e.match(it)?e.replace(it,"$1"):e.replace(lt,"$1")).trim()}var St=Object.freeze({__proto__:null,parse:bt});function Et(e,t=0){const n=[{mode:"normal",character:null}],r=[];let a=0,o="",s=null,i=null,l=t,c=e;"("===e[0]&&")"===e[e.length-1]&&(c=e.substring(1,e.length-1),l++);for(let e=0;e<c.length;e++){const t=c[e];if("'"!==t&&'"'!==t||(!0===n[a].isCalculationEnabled?(n.push({mode:"string",isCalculationEnabled:!1,character:t}),a++):"string"===n[a].mode&&n[a].character===t&&"\\"!==c[e-1]&&(n.pop(),a--)),"{"===t?(n.push({mode:"interpolation",isCalculationEnabled:!0}),a++):"}"===t&&(n.pop(),a--),"normal"===n[a].mode&&":"===t){const t=c.substring(e+1);i={type:"value",before:/^(\s*)/.exec(t)[1],after:/(\s*)$/.exec(t)[1],value:t.trim()},i.sourceIndex=i.before.length+e+1+l,s={type:"colon",sourceIndex:e+l,after:i.before,value:":"};break}o+=t}return o={type:"media-feature",before:/^(\s*)/.exec(o)[1],after:/(\s*)$/.exec(o)[1],value:o.trim()},o.sourceIndex=o.before.length+l,r.push(o),null!==s&&(s.before=o.after,r.push(s)),null!==i&&r.push(i),r}function At(e,t=0){const n=[];let r,a=0,o=!1;r={before:"",after:"",value:""};for(let s=0;s<e.length;s++){const i=e[s];o?(r.value+=i,"{"!==i&&"("!==i||a++,")"!==i&&"}"!==i||a--):-1!==i.search(/\s/)?r.before+=i:("("===i&&(r.type="media-feature-expression",a++),r.value=i,r.sourceIndex=t+s,o=!0),!o||0!==a||")"!==i&&s!==e.length-1&&-1===e[s+1].search(/\s/)||(-1!==["not","only","and"].indexOf(r.value)&&(r.type="keyword"),"media-feature-expression"===r.type&&(r.nodes=Et(r.value,r.sourceIndex)),n.push(Array.isArray(r.nodes)?new Ct(r):new Rt(r)),r={before:"",after:"",value:""},o=!1)}for(let e=0;e<n.length;e++)if(r=n[e],e>0&&(n[e-1].after=r.before),void 0===r.type){if(e>0){if("media-feature-expression"===n[e-1].type){r.type="keyword";continue}if("not"===n[e-1].value||"only"===n[e-1].value){r.type="media-type";continue}if("and"===n[e-1].value){r.type="media-feature-expression";continue}"media-type"===n[e-1].type&&(n[e+1]?r.type="media-feature-expression"===n[e+1].type?"keyword":"media-feature-expression":r.type="media-feature-expression")}if(0===e){if(!n[e+1]){r.type="media-type";continue}if(n[e+1]&&("media-feature-expression"===n[e+1].type||"keyword"===n[e+1].type)){r.type="media-type";continue}if(n[e+2]){if("media-feature-expression"===n[e+2].type){r.type="media-type",n[e+1].type="keyword";continue}if("keyword"===n[e+2].type){r.type="keyword",n[e+1].type="media-type";continue}}if(n[e+3]&&"media-feature-expression"===n[e+3].type){r.type="keyword",n[e+1].type="media-type",n[e+2].type="keyword";continue}}}return n}function Tt(e){const t=[];let n=0,r=0;const a=/^(\s*)url\s*\(/.exec(e);if(null!==a){let r=a[0].length,o=1;for(;o>0;){const t=e[r];"("===t&&o++,")"===t&&o--,r++}t.unshift(new Rt({type:"url",value:e.substring(0,r).trim(),sourceIndex:a[1].length,before:a[1],after:/^(\s*)/.exec(e.substring(r))[1]})),n=r}for(let a=n;a<e.length;a++){const o=e[a];if("("===o&&r++,")"===o&&r--,0===r&&","===o){const r=e.substring(n,a),o=/^(\s*)/.exec(r)[1];t.push(new Ct({type:"media-query",value:r.trim(),sourceIndex:n+o.length,nodes:At(r,n),before:o,after:/(\s*)$/.exec(r)[1]})),n=a+1}}const o=e.substring(n),s=/^(\s*)/.exec(o)[1];return t.push(new Ct({type:"media-query",value:o.trim(),sourceIndex:n+s.length,nodes:At(o,n),before:s,after:/(\s*)$/.exec(o)[1]})),t}function Ct(e){this.constructor(e),this.nodes=e.nodes,void 0===this.after&&(this.after=this.nodes.length>0?this.nodes[this.nodes.length-1].after:""),void 0===this.before&&(this.before=this.nodes.length>0?this.nodes[0].before:""),void 0===this.sourceIndex&&(this.sourceIndex=this.before.length),this.nodes.forEach((e=>{e.parent=this}))}function Rt(e){this.after=e.after,this.before=e.before,this.type=e.type,this.value=e.value,this.sourceIndex=e.sourceIndex}Ct.prototype=Object.create(Rt.prototype),Ct.constructor=Rt,Ct.prototype.walk=function(e,t){const n="string"==typeof e||e instanceof RegExp,r=n?t:e,a="string"==typeof e?new RegExp(e):e;for(let o=0;o<this.nodes.length;o++){const s=this.nodes[o];if((!n||a.test(s.type))&&r&&!1===r(s,o,this.nodes))return!1;if(s.nodes&&!1===s.walk(e,t))return!1}return!0},Ct.prototype.each=function(e=(()=>{})){for(let t=0;t<this.nodes.length;t++){if(!1===e(this.nodes[t],t,this.nodes))return!1}return!0};var _t=Object.freeze({__proto__:null,parseMediaList:Tt});const It="___PRESERVED_TOKEN_",Lt={maxLineLen:0,expandVars:!1,uglyComments:!1,cuteComments:!1,debug:!1,output:""},Pt=/url\(\s*(["']?)data:/g,Nt=/\s+/g,zt=/\n/g;const Mt=/(=\s*?["']?)?#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])(\}|[^0-9a-f{][^{]*?\})/gi;const Dt=/@[a-z0-9-_]*keyframes\s+[a-z0-9-_]+\s*{/gi,Ot=/(^\s|\s$)/g;const Ut=/("([^\\"]|\\.|\\)*")|('([^\\']|\\.|\\)*')/g,Ft=/progid:DXImageTransform.Microsoft.Alpha\(Opacity=/gi,Bt=/\r\n/g,qt=/[\r\n]/g,jt=/@variables\s*\{\s*([^}]+)\s*\}/g,Ht=/\s*([a-z0-9-]+)\s*:\s*([^;}]+)\s*/gi,Wt=/var\s*\(\s*([^)]+)\s*\)/g,Vt=/calc\(([^;}]*)\)/g,$t=/(^\s*|\s*$)/g,Yt=/\( /g,Gt=/ \)/g,Kt=/\s*filter:\s*progid:DXImageTransform.Microsoft.Matrix\(([^)]+)\);/g,Qt=/(^|\})(([^{:])+:)+([^{]*{)/g,Jt=/\s+([!{;:>+()\],])/g,Zt=/([^\\])\s+([}])/g,Xt=/!important/g,en=/___PSEUDOCLASSCOLON___/g,tn=/:/g,nn=/\s*(animation|animation-delay|animation-duration|transition|transition-delay|transition-duration):\s*([^;}]+)/gi,rn=/(^|\D)0?\.?0(m?s)/gi,an=/\s*(flex|flex-basis):\s*([^;}]+)/gi,on=/\s+/,sn=/(hsla?)\(([^)]+)\)/g,ln=/(^\s+|\s+$)/g,cn=/:first-(line|letter)(\{|,)/gi,un=/^(.*)(@charset)( "[^"]*";)/gi,hn=/^((\s*)(@charset)( [^;]+;\s*))+/gi,dn=/@(font-face|import|(?:-(?:atsc|khtml|moz|ms|o|wap|webkit)-)?keyframe|media|page|namespace)/gi,pn=/:(active|after|before|checked|disabled|empty|enabled|first-(?:child|of-type)|focus|hover|last-(?:child|of-type)|link|only-(?:child|of-type)|root|:selection|target|visited)/gi,mn=/^(.*)(@charset "[^"]*";)/g,fn=/^(\s*@charset [^;]+;\s*)+/g,gn=/:(lang|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|(?:-(?:atsc|khtml|moz|ms|o|wap|webkit)-)?any)\(/gi,yn=/([:,( ]\s*)(attr|color-stop|from|rgba|to|url|(?:-(?:atsc|khtml|moz|ms|o|wap|webkit)-)?(?:calc|max|min|(?:repeating-)?(?:linear|radial)-gradient)|-webkit-gradient)/gi,bn=/\s*\/\*/g,vn=/\*\/\s*/g,kn=/\band\(/gi,wn=/([^:])not\(/gi,xn=/\bor\(/gi,Sn=/([!{}:;>+([,])\s+/g,En=/;+\}/g,An=/([0-9])\.0(ex|ch|r?em|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|g?rad|turn|m?s|k?Hz|dpi|dpcm|dppx|%| |;)/gi,Tn=/:0 0 0 0(;|\})/g,Cn=/:0 0 0(;|\})/g,Rn=/(transform-origin|webkit-transform-origin|moz-transform-origin|o-transform-origin|ms-transform-origin|box-shadow):0(;|\})/gi,_n=/(:|\s)0+\.(\d+)/g,In=/rgb\s*\(\s*([0-9,\s]+)\s*\)/gi,Ln=/(border|border-top|border-right|border-bottom|border-left|outline|background):none(;|\})/gi,Pn=/progid:DXImageTransform\.Microsoft\.Alpha\(Opacity=/gi,Nn=/\(([-A-Za-z]+):([0-9]+)\/([0-9]+)\)/g,zn=/___QUERY_FRACTION___/g,Mn=/;;+/g,Dn=/(:|\s)(#f00)(;|})/g,On=/___PRESERVED_NEWLINE___/g,Un=/(:|\s)(#000080)(;|})/g,Fn=/(:|\s)(#808080)(;|})/g,Bn=/(:|\s)(#808000)(;|})/g,qn=/(:|\s)(#800080)(;|})/g,jn=/(:|\s)(#c0c0c0)(;|})/g,Hn=/(:|\s)(#008080)(;|})/g,Wn=/(:|\s)(#ffa500)(;|})/g,Vn=/(:|\s)(#800000)(;|})/g;function $n(e="",t=Lt){const n=[],r=[];let a;const o=e;e=function(e,t){const n=[];let r,a=0;for(;;){const o=e.indexOf("/*",a);if(!(o>-1))break;if(r=e.indexOf("*/",o+2),!(r>-1)){r=-2;break}t.push(e.slice(o+2,r)),n.push(e.slice(a,o)),n.push("/*___PRESERVE_CANDIDATE_COMMENT_"+(t.length-1)+"___*/"),a=r+2}return n.push(e.slice(r+2)),n.join("")}(e=function(e,t){const n=Pt,r=e.length-1,a=[];let o,s=0;for(;null!==(o=n.exec(e));){const i=o.index+4;let l=o[1];0===l.length&&(l=")");let c=!1,u=n.lastIndex-1;for(;!1===c&&u+1<=r&&-1!=u;)u=e.indexOf(l,u+1),u>0&&"\\"!==e.charAt(u-1)&&(c=!0,")"!=l&&(u=e.indexOf(")",u)));if(a.push(e.substring(s,o.index)),c){let n=e.substring(i,u);const r=n.split(",");r.length>1&&";base64"==r[0].slice(-7)?n=n.replace(Nt,""):(n=n.replace(zt," "),n=n.replace(Nt," "),n=n.replace(ln,"")),t.push(n);const o="url(___PRESERVED_TOKEN_"+(t.length-1)+"___)";a.push(o),s=u+1}else a.push(e.substring(o.index,n.lastIndex)),s=n.lastIndex}return a.push(e.substring(s)),a.join("")}(e,r),n),a=Ut,e=e.replace(a,(e=>{const t=e.substring(0,1);if((e=e.slice(1,-1)).indexOf("___PRESERVE_CANDIDATE_COMMENT_")>=0)for(let t=0,r=n.length;t<r;t+=1)e=e.replace("___PRESERVE_CANDIDATE_COMMENT_"+t+"___",n[t]);return e=e.replace(Ft,"alpha(opacity="),r.push(e),t+It+(r.length-1)+"___"+t}));for(let a=0,o=n.length;a<o;a+=1){const o=n[a],s="___PRESERVE_CANDIDATE_COMMENT_"+a+"___";if("!"!==o.charAt(0))if("\\"!==o.charAt(o.length-1)){if(0===o.length){const t=e.indexOf(s);t>2&&">"===e.charAt(t-3)&&(r.push(""),e=e.replace(s,It+(r.length-1)+"___"))}e=e.replace(`/*${s}*/`,"")}else r.push("\\"),e=e.replace(s,It+(r.length-1)+"___"),a+=1,r.push(""),e=e.replace("___PRESERVE_CANDIDATE_COMMENT_"+a+"___",It+(r.length-1)+"___");else t.cuteComments?r.push(o.substring(1).replace(Bt,"\n")):t.uglyComments?r.push(o.substring(1).replace(qt,"")):r.push(o),e=e.replace(s,It+(r.length-1)+"___")}if(t.expandVars){const t={};a=jt,e=e.replace(a,((e,n)=>(a=Ht,n.replace(a,((e,n,r)=>(n&&r&&(t[n]=r),""))),""))),a=Wt,e=e.replace(a,((e,n)=>t[n]||"none"))}if(e=e.replace(Nt," "),a=Vt,e=e.replace(a,((e,t)=>(r.push("calc("+t.replace($t,"").replace(Yt,"(").replace(Gt,")")+")"),It+(r.length-1)+"___"))),a=Kt,e=e.replace(a,((e,t)=>(r.push(t),"filter:progid:DXImageTransform.Microsoft.Matrix(___PRESERVED_TOKEN_"+(r.length-1)+"___);"))),a=Qt,e=(e=(e=(e=(e=e.replace(a,(e=>e.replace(tn,"___PSEUDOCLASSCOLON___")))).replace(Jt,"$1")).replace(Zt,"$1$2")).replace(Xt," !important")).replace(en,":"),a=nn,e=e.replace(a,((e,t,n)=>t+":"+(n=n.replace(rn,((e,t,n)=>(r.push("0"+n),t+It+(r.length-1)+"___")))))),a=an,e=(e=function(e,t){const n=Dt;let r,a=0;const o=(e,n)=>{"0"===(e=e.replace(Ot,"")).charAt(0)&&(t.push(e),r[n]=It+(t.length-1)+"___")};for(;;){let t=0;r="";let s=e.slice(a).search(n);if(s<0)break;a+=s,s=a;const i=e.length,l=[];for(;a<i;++a){const n=e.charAt(a);if("{"===n)0===t?l.push(r.replace(Ot,"")):1===t&&(r=r.split(","),r.forEach(o),l.push(r.join(",").replace(Ot,""))),r="",t+=1;else if("}"===n){if(2===t)l.push("{"+r.replace(Ot,"")+"}"),r="";else if(1===t){e=e.slice(0,s)+l.shift()+"{"+l.join("")+e.slice(a);break}t-=1}if(t<0)break;"{"!==n&&"}"!==n&&(r+=n)}}return e}(e=(e=e.replace(a,((e,t,n)=>{let a=n.split(on);return r.push(a.pop()),a.push(It+(r.length-1)+"___"),a=a.join(" "),`${t}:${a}`}))).replace(sn,((e,t,n)=>{const a=[];return n.split(",").forEach((e=>{"0%"===(e=e.replace(ln,""))?(r.push("0%"),a.push(It+(r.length-1)+"___")):a.push(e)})),t+"("+a.join(",")+")"})),r)).replace(cn,((e,t,n)=>":first-"+t.toLowerCase()+" "+n)),e=t.cuteComments?(e=e.replace(bn,"___PRESERVED_NEWLINE___/*")).replace(vn,"*/___PRESERVED_NEWLINE___"):e.replace(vn,"*/"),a=un,e=e.replace(a,((e,t,n,r)=>n.toLowerCase()+r+t)),a=hn,e=e.replace(a,((e,t,n,r,a)=>n+r.toLowerCase()+a)),a=dn,e=e.replace(a,((e,t)=>"@"+t.toLowerCase())),a=pn,e=(e=(e=e.replace(a,((e,t)=>":"+t.toLowerCase()))).replace(mn,"$2$1")).replace(fn,"$1"),a=gn,e=e.replace(a,((e,t)=>":"+t.toLowerCase()+"(")),a=yn,e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(a,((e,t,n)=>t+n.toLowerCase()))).replace(kn,"and (")).replace(wn,"$1not (")).replace(xn,"or (")).replace(Sn,"$1")).replace(En,"}")).replace(An,"$1$2")).replace(Tn,":0$1")).replace(Cn,":0$1"),a=Rn,e=(e=e.replace(a,((e,t,n)=>t.toLowerCase()+":0 0"+n))).replace(_n,"$1.$2"),a=In,e=(e=(e=(e=(e=(e=(e=(e=(e=(e=function(e){const t=Mt,n=[];let r,a=0;for(;null!==(r=t.exec(e));)n.push(e.substring(a,r.index)),r[1]?n.push(r[1]+"#"+(r[2]+r[3]+r[4]+r[5]+r[6]+r[7])):r[2].toLowerCase()==r[3].toLowerCase()&&r[4].toLowerCase()==r[5].toLowerCase()&&r[6].toLowerCase()==r[7].toLowerCase()?n.push("#"+(r[3]+r[5]+r[7]).toLowerCase()):n.push("#"+(r[2]+r[3]+r[4]+r[5]+r[6]+r[7]).toLowerCase()),a=t.lastIndex=t.lastIndex-r[8].length;return n.push(e.substring(a)),n.join("")}(e=e.replace(a,((e,t)=>{const n=t.split(",");let r="#";for(let e=0;e<n.length;e+=1){let t=parseInt(n[e],10);t<16&&(r+="0"),t>255&&(t=255),r+=t.toString(16)}return r})))).replace(Dn,"$1red$3")).replace(Un,"$1navy$3")).replace(Fn,"$1gray$3")).replace(Bn,"$1olive$3")).replace(qn,"$1purple$3")).replace(jn,"$1silver$3")).replace(Hn,"$1teal$3")).replace(Wn,"$1orange$3")).replace(Vn,"$1maroon$3"),a=Ln,e=(e=(e=(e=e.replace(a,((e,t,n)=>t.toLowerCase()+":0"+n))).replace(Pn,"alpha(opacity=")).replace(Nn,"($1:$2___QUERY_FRACTION___$3)")).replace(zn,"/"),t.maxLineLen>0){const n=[];let r=[];for(let a=0,o=e.length;a<o;a+=1){const o=e.charAt(a);r.push(o),"}"===o&&r.length>t.maxLineLen&&(n.push(r.join("")),r=[])}r.length&&n.push(r.join("")),e=n.join("\n")}if(e=(e=e.replace(Mn,";")).replace($t,""),r.length>1e3)return o;for(let t=r.length-1;t>=0;t--)e=e.replace(It+t+"___",r[t],"g");return e=e.replace(On,"\n")}var Yn=Object.freeze({__proto__:null,defaultOptions:Lt,processString:$n});function Gn(e){return{prev:null,next:null,data:e}}function Kn(e,t,n){var r;return null!==Jn?(r=Jn,Jn=Jn.cursor,r.prev=t,r.next=n,r.cursor=e.cursor):r={prev:t,next:n,cursor:e.cursor},e.cursor=r,r}function Qn(e){var t=e.cursor;e.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=Jn,Jn=t}var Jn=null,Zn=function(){this.cursor=null,this.head=null,this.tail=null};Zn.createItem=Gn,Zn.prototype.createItem=Gn,Zn.prototype.updateCursors=function(e,t,n,r){for(var a=this.cursor;null!==a;)a.prev===e&&(a.prev=t),a.next===n&&(a.next=r),a=a.cursor},Zn.prototype.getSize=function(){for(var e=0,t=this.head;t;)e++,t=t.next;return e},Zn.prototype.fromArray=function(e){var t=null;this.head=null;for(var n=0;n<e.length;n++){var r=Gn(e[n]);null!==t?t.next=r:this.head=r,r.prev=t,t=r}return this.tail=t,this},Zn.prototype.toArray=function(){for(var e=this.head,t=[];e;)t.push(e.data),e=e.next;return t},Zn.prototype.toJSON=Zn.prototype.toArray,Zn.prototype.isEmpty=function(){return null===this.head},Zn.prototype.first=function(){return this.head&&this.head.data},Zn.prototype.last=function(){return this.tail&&this.tail.data},Zn.prototype.each=function(e,t){var n;void 0===t&&(t=this);for(var r=Kn(this,null,this.head);null!==r.next;)n=r.next,r.next=n.next,e.call(t,n.data,n,this);Qn(this)},Zn.prototype.forEach=Zn.prototype.each,Zn.prototype.eachRight=function(e,t){var n;void 0===t&&(t=this);for(var r=Kn(this,this.tail,null);null!==r.prev;)n=r.prev,r.prev=n.prev,e.call(t,n.data,n,this);Qn(this)},Zn.prototype.forEachRight=Zn.prototype.eachRight,Zn.prototype.reduce=function(e,t,n){var r;void 0===n&&(n=this);for(var a=Kn(this,null,this.head),o=t;null!==a.next;)r=a.next,a.next=r.next,o=e.call(n,o,r.data,r,this);return Qn(this),o},Zn.prototype.reduceRight=function(e,t,n){var r;void 0===n&&(n=this);for(var a=Kn(this,this.tail,null),o=t;null!==a.prev;)r=a.prev,a.prev=r.prev,o=e.call(n,o,r.data,r,this);return Qn(this),o},Zn.prototype.nextUntil=function(e,t,n){if(null!==e){var r;void 0===n&&(n=this);for(var a=Kn(this,null,e);null!==a.next&&(r=a.next,a.next=r.next,!t.call(n,r.data,r,this)););Qn(this)}},Zn.prototype.prevUntil=function(e,t,n){if(null!==e){var r;void 0===n&&(n=this);for(var a=Kn(this,e,null);null!==a.prev&&(r=a.prev,a.prev=r.prev,!t.call(n,r.data,r,this)););Qn(this)}},Zn.prototype.some=function(e,t){var n=this.head;for(void 0===t&&(t=this);null!==n;){if(e.call(t,n.data,n,this))return!0;n=n.next}return!1},Zn.prototype.map=function(e,t){var n=new Zn,r=this.head;for(void 0===t&&(t=this);null!==r;)n.appendData(e.call(t,r.data,r,this)),r=r.next;return n},Zn.prototype.filter=function(e,t){var n=new Zn,r=this.head;for(void 0===t&&(t=this);null!==r;)e.call(t,r.data,r,this)&&n.appendData(r.data),r=r.next;return n},Zn.prototype.clear=function(){this.head=null,this.tail=null},Zn.prototype.copy=function(){for(var e=new Zn,t=this.head;null!==t;)e.insert(Gn(t.data)),t=t.next;return e},Zn.prototype.prepend=function(e){return this.updateCursors(null,e,this.head,e),null!==this.head?(this.head.prev=e,e.next=this.head):this.tail=e,this.head=e,this},Zn.prototype.prependData=function(e){return this.prepend(Gn(e))},Zn.prototype.append=function(e){return this.insert(e)},Zn.prototype.appendData=function(e){return this.insert(Gn(e))},Zn.prototype.insert=function(e,t){if(null!=t)if(this.updateCursors(t.prev,e,t,e),null===t.prev){if(this.head!==t)throw new Error("before doesn't belong to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else this.updateCursors(this.tail,e,null,e),null!==this.tail?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e;return this},Zn.prototype.insertData=function(e,t){return this.insert(Gn(e),t)},Zn.prototype.remove=function(e){if(this.updateCursors(e,e.prev,e,e.next),null!==e.prev)e.prev.next=e.next;else{if(this.head!==e)throw new Error("item doesn't belong to list");this.head=e.next}if(null!==e.next)e.next.prev=e.prev;else{if(this.tail!==e)throw new Error("item doesn't belong to list");this.tail=e.prev}return e.prev=null,e.next=null,e},Zn.prototype.push=function(e){this.insert(Gn(e))},Zn.prototype.pop=function(){if(null!==this.tail)return this.remove(this.tail)},Zn.prototype.unshift=function(e){this.prepend(Gn(e))},Zn.prototype.shift=function(){if(null!==this.head)return this.remove(this.head)},Zn.prototype.prependList=function(e){return this.insertList(e,this.head)},Zn.prototype.appendList=function(e){return this.insertList(e)},Zn.prototype.insertList=function(e,t){return null===e.head||(null!=t?(this.updateCursors(t.prev,e.tail,t,e.head),null!==t.prev?(t.prev.next=e.head,e.head.prev=t.prev):this.head=e.head,t.prev=e.tail,e.tail.next=t):(this.updateCursors(this.tail,e.tail,null,e.head),null!==this.tail?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail),e.head=null,e.tail=null),this},Zn.prototype.replace=function(e,t){"head"in t?this.insertList(t,e):this.insert(t,e),this.remove(e)};var Xn=Zn,er=function(e,t){var n=Object.create(SyntaxError.prototype),r=new Error;return n.name=e,n.message=t,Object.defineProperty(n,"stack",{get:function(){return(r.stack||"").replace(/^(.+\n){1,3}/,e+": "+t+"\n")}}),n},tr=" ";function nr(e,t){function n(e,t){return r.slice(e,t).map((function(t,n){for(var r=String(e+n+1);r.length<l;)r=" "+r;return r+" |"+t})).join("\n")}var r=e.source.split(/\r\n?|\n|\f/),a=e.line,o=e.column,s=Math.max(1,a-t)-1,i=Math.min(a+t,r.length+1),l=Math.max(4,String(i).length)+1,c=0;(o+=(tr.length-1)*(r[a-1].substr(0,o-1).match(/\t/g)||[]).length)>100&&(c=o-60+3,o=58);for(var u=s;u<=i;u++)u>=0&&u<r.length&&(r[u]=r[u].replace(/\t/g,tr),r[u]=(c>0&&r[u].length>c?"…":"")+r[u].substr(c,98)+(r[u].length>c+100-1?"…":""));return[n(s,a),new Array(o+l+2).join("-")+"^",n(a,i)].filter(Boolean).join("\n")}var rr=function(e,t,n,r,a){var o=er("SyntaxError",e);return o.source=t,o.offset=n,o.line=r,o.column=a,o.sourceFragment=function(e){return nr(o,isNaN(e)?0:e)},Object.defineProperty(o,"formattedMessage",{get:function(){return"Parse error: "+o.message+"\n"+nr(o,2)}}),o.parseError={offset:n,line:r,column:a},o},ar={EOF:0,Ident:1,Function:2,AtKeyword:3,Hash:4,String:5,BadString:6,Url:7,BadUrl:8,Delim:9,Number:10,Percentage:11,Dimension:12,WhiteSpace:13,CDO:14,CDC:15,Colon:16,Semicolon:17,Comma:18,LeftSquareBracket:19,RightSquareBracket:20,LeftParenthesis:21,RightParenthesis:22,LeftCurlyBracket:23,RightCurlyBracket:24,Comment:25},or=Object.keys(ar).reduce((function(e,t){return e[ar[t]]=t,e}),{}),sr={TYPE:ar,NAME:or};function ir(e){return e>=48&&e<=57}function lr(e){return e>=65&&e<=90}function cr(e){return e>=97&&e<=122}function ur(e){return lr(e)||cr(e)}function hr(e){return e>=128}function dr(e){return ur(e)||hr(e)||95===e}function pr(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function mr(e){return 10===e||13===e||12===e}function fr(e){return mr(e)||32===e||9===e}function gr(e,t){return 92===e&&(!mr(t)&&0!==t)}var yr=new Array(128);vr.Eof=128,vr.WhiteSpace=130,vr.Digit=131,vr.NameStart=132,vr.NonPrintable=133;for(var br=0;br<yr.length;br++)switch(!0){case fr(br):yr[br]=vr.WhiteSpace;break;case ir(br):yr[br]=vr.Digit;break;case dr(br):yr[br]=vr.NameStart;break;case pr(br):yr[br]=vr.NonPrintable;break;default:yr[br]=br||vr.Eof}function vr(e){return e<128?yr[e]:vr.NameStart}var kr={isDigit:ir,isHexDigit:function(e){return ir(e)||e>=65&&e<=70||e>=97&&e<=102},isUppercaseLetter:lr,isLowercaseLetter:cr,isLetter:ur,isNonAscii:hr,isNameStart:dr,isName:function(e){return dr(e)||ir(e)||45===e},isNonPrintable:pr,isNewline:mr,isWhiteSpace:fr,isValidEscape:gr,isIdentifierStart:function(e,t,n){return 45===e?dr(t)||45===t||gr(t,n):!!dr(e)||92===e&&gr(e,t)},isNumberStart:function(e,t,n){return 43===e||45===e?ir(t)?2:46===t&&ir(n)?3:0:46===e?ir(t)?2:0:ir(e)?1:0},isBOM:function(e){return 65279===e||65534===e?1:0},charCodeCategory:vr},wr=kr.isDigit,xr=kr.isHexDigit,Sr=kr.isUppercaseLetter,Er=kr.isName,Ar=kr.isWhiteSpace,Tr=kr.isValidEscape;function Cr(e,t){return t<e.length?e.charCodeAt(t):0}function Rr(e,t,n){return 13===n&&10===Cr(e,t+1)?2:1}function _r(e,t,n){var r=e.charCodeAt(t);return Sr(r)&&(r|=32),r===n}function Ir(e,t){for(;t<e.length&&wr(e.charCodeAt(t));t++);return t}function Lr(e,t){if(xr(Cr(e,(t+=2)-1))){for(var n=Math.min(e.length,t+5);t<n&&xr(Cr(e,t));t++);var r=Cr(e,t);Ar(r)&&(t+=Rr(e,t,r))}return t}var Pr={consumeEscaped:Lr,consumeName:function(e,t){for(;t<e.length;t++){var n=e.charCodeAt(t);if(!Er(n)){if(!Tr(n,Cr(e,t+1)))break;t=Lr(e,t)-1}}return t},consumeNumber:function(e,t){var n=e.charCodeAt(t);if(43!==n&&45!==n||(n=e.charCodeAt(t+=1)),wr(n)&&(t=Ir(e,t+1),n=e.charCodeAt(t)),46===n&&wr(e.charCodeAt(t+1))&&(n=e.charCodeAt(t+=2),t=Ir(e,t)),_r(e,t,101)){var r=0;45!==(n=e.charCodeAt(t+1))&&43!==n||(r=1,n=e.charCodeAt(t+2)),wr(n)&&(t=Ir(e,t+1+r+1))}return t},consumeBadUrlRemnants:function(e,t){for(;t<e.length;t++){var n=e.charCodeAt(t);if(41===n){t++;break}Tr(n,Cr(e,t+1))&&(t=Lr(e,t))}return t},cmpChar:_r,cmpStr:function(e,t,n,r){if(n-t!==r.length)return!1;if(t<0||n>e.length)return!1;for(var a=t;a<n;a++){var o=e.charCodeAt(a),s=r.charCodeAt(a-t);if(Sr(o)&&(o|=32),o!==s)return!1}return!0},getNewlineLength:Rr,findWhiteSpaceStart:function(e,t){for(;t>=0&&Ar(e.charCodeAt(t));t--);return t+1},findWhiteSpaceEnd:function(e,t){for(;t<e.length&&Ar(e.charCodeAt(t));t++);return t}},Nr=sr.TYPE,zr=sr.NAME,Mr=Pr.cmpStr,Dr=Nr.EOF,Or=Nr.WhiteSpace,Ur=Nr.Comment,Fr=16777215,Br=24,qr=function(){this.offsetAndType=null,this.balance=null,this.reset()};qr.prototype={reset:function(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset},lookupType:function(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e]>>Br:Dr},lookupOffset:function(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e-1]&Fr:this.source.length},lookupValue:function(e,t){return(e+=this.tokenIndex)<this.tokenCount&&Mr(this.source,this.offsetAndType[e-1]&Fr,this.offsetAndType[e]&Fr,t)},getTokenStart:function(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&Fr:this.offsetAndType[this.tokenCount]&Fr:this.firstCharOffset},getRawLength:function(e,t){var n,r=e,a=this.offsetAndType[Math.max(r-1,0)]&Fr;e:for(;r<this.tokenCount&&!((n=this.balance[r])<e);r++)switch(t(this.offsetAndType[r]>>Br,this.source,a)){case 1:break e;case 2:r++;break e;default:this.balance[n]===r&&(r=n),a=this.offsetAndType[r]&Fr}return r-this.tokenIndex},isBalanceEdge:function(e){return this.balance[this.tokenIndex]<e},isDelim:function(e,t){return t?this.lookupType(t)===Nr.Delim&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===Nr.Delim&&this.source.charCodeAt(this.tokenStart)===e},getTokenValue:function(){return this.source.substring(this.tokenStart,this.tokenEnd)},getTokenLength:function(){return this.tokenEnd-this.tokenStart},substrToCursor:function(e){return this.source.substring(e,this.tokenStart)},skipWS:function(){for(var e=this.tokenIndex,t=0;e<this.tokenCount&&this.offsetAndType[e]>>Br===Or;e++,t++);t>0&&this.skip(t)},skipSC:function(){for(;this.tokenType===Or||this.tokenType===Ur;)this.next()},skip:function(e){var t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&Fr,t=this.offsetAndType[t],this.tokenType=t>>Br,this.tokenEnd=t&Fr):(this.tokenIndex=this.tokenCount,this.next())},next:function(){var e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>Br,this.tokenEnd=e&Fr):(this.tokenIndex=this.tokenCount,this.eof=!0,this.tokenType=Dr,this.tokenStart=this.tokenEnd=this.source.length)},forEachToken(e){for(var t=0,n=this.firstCharOffset;t<this.tokenCount;t++){var r=n,a=this.offsetAndType[t],o=a&Fr;n=o,e(a>>Br,r,o,t)}},dump(){var e=new Array(this.tokenCount);return this.forEachToken(((t,n,r,a)=>{e[a]={idx:a,type:zr[t],chunk:this.source.substring(n,r),balance:this.balance[a]}})),e}};var jr=qr;function Hr(e){return e}function Wr(e,t,n,r){var a,o;switch(e.type){case"Group":a=function(e,t,n,r){var a=" "===e.combinator||r?e.combinator:" "+e.combinator+" ",o=e.terms.map((function(e){return Wr(e,t,n,r)})).join(a);return(e.explicit||n)&&(o=(r||","===o[0]?"[":"[ ")+o+(r?"]":" ]")),o}(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return Wr(e.term,t,n,r)+t(0===(o=e).min&&0===o.max?"*":0===o.min&&1===o.max?"?":1===o.min&&0===o.max?o.comma?"#":"+":1===o.min&&1===o.max?"":(o.comma?"#":"")+(o.min===o.max?"{"+o.min+"}":"{"+o.min+","+(0!==o.max?o.max:"")+"}"),e);case"Type":a="<"+e.name+(e.opts?t(function(e){switch(e.type){case"Range":return" ["+(null===e.min?"-∞":e.min)+","+(null===e.max?"∞":e.max)+"]";default:throw new Error("Unknown node type `"+e.type+"`")}}(e.opts),e.opts):"")+">";break;case"Property":a="<'"+e.name+"'>";break;case"Keyword":a=e.name;break;case"AtKeyword":a="@"+e.name;break;case"Function":a=e.name+"(";break;case"String":case"Token":a=e.value;break;case"Comma":a=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(a,e)}var Vr=function(e,t){var n=Hr,r=!1,a=!1;return"function"==typeof t?n=t:t&&(r=Boolean(t.forceBraces),a=Boolean(t.compact),"function"==typeof t.decorate&&(n=t.decorate)),Wr(e,n,r,a)};const $r={offset:0,line:1,column:1};function Yr(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?Gr(n):n:null}function Gr({offset:e,line:t,column:n},r){const a={offset:e,line:t,column:n};if(r){const e=r.split(/\n|\r\n?|\f/);a.offset+=r.length,a.line+=e.length-1,a.column=1===e.length?a.column+r.length:e.pop().length+1}return a}var Kr=function(e,t){const n=er("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},Qr=function(e,t,n,r){const a=er("SyntaxMatchError",e),{css:o,mismatchOffset:s,mismatchLength:i,start:l,end:c}=function(e,t){const n=e.tokens,r=e.longestMatch,a=r<n.length&&n[r].node||null,o=a!==t?a:null;let s,i,l=0,c=0,u=0,h="";for(let e=0;e<n.length;e++){const t=n[e].value;e===r&&(c=t.length,l=h.length),null!==o&&n[e].node===o&&(e<=r?u++:u=0),h+=t}return r===n.length||u>1?(s=Yr(o||t,"end")||Gr($r,h),i=Gr(s)):(s=Yr(o,"start")||Gr(Yr(t,"start")||$r,h.slice(0,l)),i=Yr(o,"end")||Gr(s,h.substr(l,c))),{css:h,mismatchOffset:l,mismatchLength:c,start:s,end:i}}(r,n);return a.rawMessage=e,a.syntax=t?Vr(t):"<generic>",a.css=o,a.mismatchOffset=s,a.mismatchLength=i,a.message=e+"\n syntax: "+a.syntax+"\n value: "+(o||"<empty string>")+"\n --------"+new Array(a.mismatchOffset+1).join("-")+"^",Object.assign(a,l),a.loc={source:n&&n.loc&&n.loc.source||"<unknown>",start:l,end:c},a},Jr=Object.prototype.hasOwnProperty,Zr=Object.create(null),Xr=Object.create(null);function ea(e,t){return t=t||0,e.length-t>=2&&45===e.charCodeAt(t)&&45===e.charCodeAt(t+1)}function ta(e,t){if(t=t||0,e.length-t>=3&&45===e.charCodeAt(t)&&45!==e.charCodeAt(t+1)){var n=e.indexOf("-",t+2);if(-1!==n)return e.substring(t,n+1)}return""}var na={keyword:function(e){if(Jr.call(Zr,e))return Zr[e];var t=e.toLowerCase();if(Jr.call(Zr,t))return Zr[e]=Zr[t];var n=ea(t,0),r=n?"":ta(t,0);return Zr[e]=Object.freeze({basename:t.substr(r.length),name:t,vendor:r,prefix:r,custom:n})},property:function(e){if(Jr.call(Xr,e))return Xr[e];var t=e,n=e[0];"/"===n?n="/"===e[1]?"//":"/":"_"!==n&&"*"!==n&&"$"!==n&&"#"!==n&&"+"!==n&&"&"!==n&&(n="");var r=ea(t,n.length);if(!r&&(t=t.toLowerCase(),Jr.call(Xr,t)))return Xr[e]=Xr[t];var a=r?"":ta(t,n.length),o=t.substr(0,n.length+a.length);return Xr[e]=Object.freeze({basename:t.substr(o.length),name:t.substr(n.length),hack:n,vendor:a,prefix:o,custom:r})},isCustomProperty:ea,vendorPrefix:ta},ra="undefined"!=typeof Uint32Array?Uint32Array:Array,aa=function(e,t){return null===e||e.length<t?new ra(Math.max(t+1024,16384)):e},oa=sr.TYPE,sa=kr.isNewline,ia=kr.isName,la=kr.isValidEscape,ca=kr.isNumberStart,ua=kr.isIdentifierStart,ha=kr.charCodeCategory,da=kr.isBOM,pa=Pr.cmpStr,ma=Pr.getNewlineLength,fa=Pr.findWhiteSpaceEnd,ga=Pr.consumeEscaped,ya=Pr.consumeName,ba=Pr.consumeNumber,va=Pr.consumeBadUrlRemnants,ka=16777215,wa=24;function xa(e,t){function n(t){return t<s?e.charCodeAt(t):0}function r(){return h=ba(e,h),ua(n(h),n(h+1),n(h+2))?(g=oa.Dimension,void(h=ya(e,h))):37===n(h)?(g=oa.Percentage,void h++):void(g=oa.Number)}function a(){const t=h;return h=ya(e,h),pa(e,t,h,"url")&&40===n(h)?34===n(h=fa(e,h+1))||39===n(h)?(g=oa.Function,void(h=t+4)):void function(){for(g=oa.Url,h=fa(e,h);h<e.length;h++){var t=e.charCodeAt(h);switch(ha(t)){case 41:return void h++;case ha.Eof:return;case ha.WhiteSpace:return 41===n(h=fa(e,h))||h>=e.length?void(h<e.length&&h++):(h=va(e,h),void(g=oa.BadUrl));case 34:case 39:case 40:case ha.NonPrintable:return h=va(e,h),void(g=oa.BadUrl);case 92:if(la(t,n(h+1))){h=ga(e,h)-1;break}return h=va(e,h),void(g=oa.BadUrl)}}}():40===n(h)?(g=oa.Function,void h++):void(g=oa.Ident)}function o(t){for(t||(t=n(h++)),g=oa.String;h<e.length;h++){var r=e.charCodeAt(h);switch(ha(r)){case t:return void h++;case ha.Eof:return;case ha.WhiteSpace:if(sa(r))return h+=ma(e,h,r),void(g=oa.BadString);break;case 92:if(h===e.length-1)break;var a=n(h+1);sa(a)?h+=ma(e,h+1,a):la(r,a)&&(h=ga(e,h)-1)}}}t||(t=new jr);for(var s=(e=String(e||"")).length,i=aa(t.offsetAndType,s+1),l=aa(t.balance,s+1),c=0,u=da(n(0)),h=u,d=0,p=0,m=0;h<s;){var f=e.charCodeAt(h),g=0;switch(l[c]=s,ha(f)){case ha.WhiteSpace:g=oa.WhiteSpace,h=fa(e,h+1);break;case 34:o();break;case 35:ia(n(h+1))||la(n(h+1),n(h+2))?(g=oa.Hash,h=ya(e,h+1)):(g=oa.Delim,h++);break;case 39:o();break;case 40:g=oa.LeftParenthesis,h++;break;case 41:g=oa.RightParenthesis,h++;break;case 43:ca(f,n(h+1),n(h+2))?r():(g=oa.Delim,h++);break;case 44:g=oa.Comma,h++;break;case 45:ca(f,n(h+1),n(h+2))?r():45===n(h+1)&&62===n(h+2)?(g=oa.CDC,h+=3):ua(f,n(h+1),n(h+2))?a():(g=oa.Delim,h++);break;case 46:ca(f,n(h+1),n(h+2))?r():(g=oa.Delim,h++);break;case 47:42===n(h+1)?(g=oa.Comment,1===(h=e.indexOf("*/",h+2)+2)&&(h=e.length)):(g=oa.Delim,h++);break;case 58:g=oa.Colon,h++;break;case 59:g=oa.Semicolon,h++;break;case 60:33===n(h+1)&&45===n(h+2)&&45===n(h+3)?(g=oa.CDO,h+=4):(g=oa.Delim,h++);break;case 64:ua(n(h+1),n(h+2),n(h+3))?(g=oa.AtKeyword,h=ya(e,h+1)):(g=oa.Delim,h++);break;case 91:g=oa.LeftSquareBracket,h++;break;case 92:la(f,n(h+1))?a():(g=oa.Delim,h++);break;case 93:g=oa.RightSquareBracket,h++;break;case 123:g=oa.LeftCurlyBracket,h++;break;case 125:g=oa.RightCurlyBracket,h++;break;case ha.Digit:r();break;case ha.NameStart:a();break;case ha.Eof:break;default:g=oa.Delim,h++}switch(g){case d:for(d=(p=l[m=p&ka])>>wa,l[c]=m,l[m++]=c;m<c;m++)l[m]===s&&(l[m]=c);break;case oa.LeftParenthesis:case oa.Function:l[c]=p,p=(d=oa.RightParenthesis)<<wa|c;break;case oa.LeftSquareBracket:l[c]=p,p=(d=oa.RightSquareBracket)<<wa|c;break;case oa.LeftCurlyBracket:l[c]=p,p=(d=oa.RightCurlyBracket)<<wa|c}i[c++]=g<<wa|h}for(i[c]=oa.EOF<<wa|h,l[c]=s,l[s]=s;0!==p;)p=l[m=p&ka],l[m]=s;return t.source=e,t.firstCharOffset=u,t.offsetAndType=i,t.tokenCount=c,t.balance=l,t.reset(),t.next(),t}Object.keys(sr).forEach((function(e){xa[e]=sr[e]})),Object.keys(kr).forEach((function(e){xa[e]=kr[e]})),Object.keys(Pr).forEach((function(e){xa[e]=Pr[e]}));var Sa=xa,Ea=Sa.isDigit,Aa=Sa.cmpChar,Ta=Sa.TYPE,Ca=Ta.Delim,Ra=Ta.WhiteSpace,_a=Ta.Comment,Ia=Ta.Ident,La=Ta.Number,Pa=Ta.Dimension,Na=45,za=!0;function Ma(e,t){return null!==e&&e.type===Ca&&e.value.charCodeAt(0)===t}function Da(e,t,n){for(;null!==e&&(e.type===Ra||e.type===_a);)e=n(++t);return t}function Oa(e,t,n,r){if(!e)return 0;var a=e.value.charCodeAt(t);if(43===a||a===Na){if(n)return 0;t++}for(;t<e.value.length;t++)if(!Ea(e.value.charCodeAt(t)))return 0;return r+1}function Ua(e,t,n){var r=!1,a=Da(e,t,n);if(null===(e=n(a)))return t;if(e.type!==La){if(!Ma(e,43)&&!Ma(e,Na))return t;if(r=!0,a=Da(n(++a),a,n),null===(e=n(a))&&e.type!==La)return 0}if(!r){var o=e.value.charCodeAt(0);if(43!==o&&o!==Na)return 0}return Oa(e,r?0:1,r,a)}var Fa=Sa.isHexDigit,Ba=Sa.cmpChar,qa=Sa.TYPE,ja=qa.Ident,Ha=qa.Delim,Wa=qa.Number,Va=qa.Dimension;function $a(e,t){return null!==e&&e.type===Ha&&e.value.charCodeAt(0)===t}function Ya(e,t){return e.value.charCodeAt(0)===t}function Ga(e,t,n){for(var r=t,a=0;r<e.value.length;r++){var o=e.value.charCodeAt(r);if(45===o&&n&&0!==a)return Ga(e,t+a+1,!1)>0?6:0;if(!Fa(o))return 0;if(++a>6)return 0}return a}function Ka(e,t,n){if(!e)return 0;for(;$a(n(t),63);){if(++e>6)return 0;t++}return t}var Qa=Sa.isIdentifierStart,Ja=Sa.isHexDigit,Za=Sa.isDigit,Xa=Sa.cmpStr,eo=Sa.consumeNumber,to=Sa.TYPE,no=["unset","initial","inherit"],ro=["calc(","-moz-calc(","-webkit-calc("];function ao(e,t){return t<e.length?e.charCodeAt(t):0}function oo(e,t){return Xa(e,0,e.length,t)}function so(e,t){for(var n=0;n<t.length;n++)if(oo(e,t[n]))return!0;return!1}function io(e,t){return t===e.length-2&&(92===e.charCodeAt(t)&&Za(e.charCodeAt(t+1)))}function lo(e,t,n){if(e&&"Range"===e.type){var r=Number(void 0!==n&&n!==t.length?t.substr(0,n):t);if(isNaN(r))return!0;if(null!==e.min&&r<e.min)return!0;if(null!==e.max&&r>e.max)return!0}return!1}function co(e,t){var n=e.index,r=0;do{if(r++,e.balance<=n)break}while(e=t(r));return r}function uo(e){return function(t,n,r){return null===t?0:t.type===to.Function&&so(t.value,ro)?co(t,n):e(t,n,r)}}function ho(e){return function(t){return null===t||t.type!==e?0:1}}function po(e){return function(t,n,r){if(null===t||t.type!==to.Dimension)return 0;var a=eo(t.value,0);if(null!==e){var o=t.value.indexOf("\\",a),s=-1!==o&&io(t.value,o)?t.value.substring(a,o):t.value.substr(a);if(!1===e.hasOwnProperty(s.toLowerCase()))return 0}return lo(r,t.value,a)?0:1}}function mo(e){return"function"!=typeof e&&(e=function(){return 0}),function(t,n,r){return null!==t&&t.type===to.Number&&0===Number(t.value)?1:e(t,n,r)}}var fo,go={"ident-token":ho(to.Ident),"function-token":ho(to.Function),"at-keyword-token":ho(to.AtKeyword),"hash-token":ho(to.Hash),"string-token":ho(to.String),"bad-string-token":ho(to.BadString),"url-token":ho(to.Url),"bad-url-token":ho(to.BadUrl),"delim-token":ho(to.Delim),"number-token":ho(to.Number),"percentage-token":ho(to.Percentage),"dimension-token":ho(to.Dimension),"whitespace-token":ho(to.WhiteSpace),"CDO-token":ho(to.CDO),"CDC-token":ho(to.CDC),"colon-token":ho(to.Colon),"semicolon-token":ho(to.Semicolon),"comma-token":ho(to.Comma),"[-token":ho(to.LeftSquareBracket),"]-token":ho(to.RightSquareBracket),"(-token":ho(to.LeftParenthesis),")-token":ho(to.RightParenthesis),"{-token":ho(to.LeftCurlyBracket),"}-token":ho(to.RightCurlyBracket),string:ho(to.String),ident:ho(to.Ident),"custom-ident":function(e){if(null===e||e.type!==to.Ident)return 0;var t=e.value.toLowerCase();return so(t,no)||oo(t,"default")?0:1},"custom-property-name":function(e){return null===e||e.type!==to.Ident||45!==ao(e.value,0)||45!==ao(e.value,1)?0:1},"hex-color":function(e){if(null===e||e.type!==to.Hash)return 0;var t=e.value.length;if(4!==t&&5!==t&&7!==t&&9!==t)return 0;for(var n=1;n<t;n++)if(!Ja(e.value.charCodeAt(n)))return 0;return 1},"id-selector":function(e){return null===e||e.type!==to.Hash?0:Qa(ao(e.value,1),ao(e.value,2),ao(e.value,3))?1:0},"an-plus-b":function(e,t){var n=0;if(!e)return 0;if(e.type===La)return Oa(e,0,false,n);if(e.type===Ia&&e.value.charCodeAt(0)===Na){if(!Aa(e.value,1,110))return 0;switch(e.value.length){case 2:return Ua(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==Na?0:(n=Da(t(++n),n,t),Oa(e=t(n),0,za,n));default:return e.value.charCodeAt(2)!==Na?0:Oa(e,3,za,n)}}else if(e.type===Ia||Ma(e,43)&&t(n+1).type===Ia){if(e.type!==Ia&&(e=t(++n)),null===e||!Aa(e.value,0,110))return 0;switch(e.value.length){case 1:return Ua(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==Na?0:(n=Da(t(++n),n,t),Oa(e=t(n),0,za,n));default:return e.value.charCodeAt(1)!==Na?0:Oa(e,2,za,n)}}else if(e.type===Pa){for(var r=e.value.charCodeAt(0),a=43===r||r===Na?1:0,o=a;o<e.value.length&&Ea(e.value.charCodeAt(o));o++);return o===a?0:Aa(e.value,o,110)?o+1===e.value.length?Ua(t(++n),n,t):e.value.charCodeAt(o+1)!==Na?0:o+2===e.value.length?(n=Da(t(++n),n,t),Oa(e=t(n),0,za,n)):Oa(e,o+2,za,n):0}return 0},urange:function(e,t){var n=0;if(null===e||e.type!==ja||!Ba(e.value,0,117))return 0;if(null===(e=t(++n)))return 0;if($a(e,43))return null===(e=t(++n))?0:e.type===ja?Ka(Ga(e,0,!0),++n,t):$a(e,63)?Ka(1,++n,t):0;if(e.type===Wa){if(!Ya(e,43))return 0;var r=Ga(e,1,!0);return 0===r?0:null===(e=t(++n))?n:e.type===Va||e.type===Wa?Ya(e,45)&&Ga(e,1,!1)?n+1:0:Ka(r,n,t)}return e.type===Va&&Ya(e,43)?Ka(Ga(e,1,!0),++n,t):0},"declaration-value":function(e,t){if(!e)return 0;var n=0,r=0,a=e.index;e:do{switch(e.type){case to.BadString:case to.BadUrl:break e;case to.RightCurlyBracket:case to.RightParenthesis:case to.RightSquareBracket:if(e.balance>e.index||e.balance<a)break e;r--;break;case to.Semicolon:if(0===r)break e;break;case to.Delim:if("!"===e.value&&0===r)break e;break;case to.Function:case to.LeftParenthesis:case to.LeftSquareBracket:case to.LeftCurlyBracket:r++}if(n++,e.balance<=a)break}while(e=t(n));return n},"any-value":function(e,t){if(!e)return 0;var n=e.index,r=0;e:do{switch(e.type){case to.BadString:case to.BadUrl:break e;case to.RightCurlyBracket:case to.RightParenthesis:case to.RightSquareBracket:if(e.balance>e.index||e.balance<n)break e}if(r++,e.balance<=n)break}while(e=t(r));return r},dimension:uo(po(null)),angle:uo(po({deg:!0,grad:!0,rad:!0,turn:!0})),decibel:uo(po({db:!0})),frequency:uo(po({hz:!0,khz:!0})),flex:uo(po({fr:!0})),length:uo(mo(po({px:!0,mm:!0,cm:!0,in:!0,pt:!0,pc:!0,q:!0,em:!0,ex:!0,ch:!0,rem:!0,vh:!0,vw:!0,vmin:!0,vmax:!0,vm:!0}))),resolution:uo(po({dpi:!0,dpcm:!0,dppx:!0,x:!0})),semitones:uo(po({st:!0})),time:uo(po({s:!0,ms:!0})),percentage:uo((function(e,t,n){return null===e||e.type!==to.Percentage||lo(n,e.value,e.value.length-1)?0:1})),zero:mo(),number:uo((function(e,t,n){if(null===e)return 0;var r=eo(e.value,0);return r===e.value.length||io(e.value,r)?lo(n,e.value,r)?0:1:0})),integer:uo((function(e,t,n){if(null===e||e.type!==to.Number)return 0;for(var r=43===e.value.charCodeAt(0)||45===e.value.charCodeAt(0)?1:0;r<e.value.length;r++)if(!Za(e.value.charCodeAt(r)))return 0;return lo(n,e.value,r)?0:1})),"-ms-legacy-expression":(fo="expression",fo+="(",function(e,t){return null!==e&&oo(e.value,fo)?co(e,t):0})},yo=function(e,t,n){var r=er("SyntaxError",e);return r.input=t,r.offset=n,r.rawMessage=e,r.message=r.rawMessage+"\n "+r.input+"\n--"+new Array((r.offset||r.input.length)+1).join("-")+"^",r},bo=function(e){this.str=e,this.pos=0};bo.prototype={charCodeAt:function(e){return e<this.str.length?this.str.charCodeAt(e):0},charCode:function(){return this.charCodeAt(this.pos)},nextCharCode:function(){return this.charCodeAt(this.pos+1)},nextNonWsCode:function(e){return this.charCodeAt(this.findWsEnd(e))},findWsEnd:function(e){for(;e<this.str.length;e++){var t=this.str.charCodeAt(e);if(13!==t&&10!==t&&12!==t&&32!==t&&9!==t)break}return e},substringToPos:function(e){return this.str.substring(this.pos,this.pos=e)},eat:function(e){this.charCode()!==e&&this.error("Expect `"+String.fromCharCode(e)+"`"),this.pos++},peek:function(){return this.pos<this.str.length?this.str.charAt(this.pos++):""},error:function(e){throw new yo(e,this.str,this.pos)}};var vo=bo,ko=123,wo=function(e){for(var t="function"==typeof Uint32Array?new Uint32Array(128):new Array(128),n=0;n<128;n++)t[n]=e(String.fromCharCode(n))?1:0;return t}((function(e){return/[a-zA-Z0-9\-]/.test(e)})),xo={" ":1,"&&":2,"||":3,"|":4};function So(e){return e.substringToPos(e.findWsEnd(e.pos))}function Eo(e){for(var t=e.pos;t<e.str.length;t++){var n=e.str.charCodeAt(t);if(n>=128||0===wo[n])break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function Ao(e){for(var t=e.pos;t<e.str.length;t++){var n=e.str.charCodeAt(t);if(n<48||n>57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function To(e){var t=e.str.indexOf("'",e.pos+1);return-1===t&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function Co(e){var t,n=null;return e.eat(ko),t=Ao(e),44===e.charCode()?(e.pos++,125!==e.charCode()&&(n=Ao(e))):n=t,e.eat(125),{min:Number(t),max:n?Number(n):0}}function Ro(e,t){var n=function(e){var t=null,n=!1;switch(e.charCode()){case 42:e.pos++,t={min:0,max:0};break;case 43:e.pos++,t={min:1,max:0};break;case 63:e.pos++,t={min:0,max:1};break;case 35:e.pos++,n=!0,t=e.charCode()===ko?Co(e):{min:1,max:0};break;case ko:t=Co(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}(e);return null!==n?(n.term=t,n):t}function _o(e){var t=e.peek();return""===t?null:{type:"Token",value:t}}function Io(e){var t,n=null;return e.eat(60),t=Eo(e),40===e.charCode()&&41===e.nextCharCode()&&(e.pos+=2,t+="()"),91===e.charCodeAt(e.findWsEnd(e.pos))&&(So(e),n=function(e){var t=null,n=null,r=1;return e.eat(91),45===e.charCode()&&(e.peek(),r=-1),-1==r&&8734===e.charCode()?e.peek():t=r*Number(Ao(e)),So(e),e.eat(44),So(e),8734===e.charCode()?e.peek():(r=1,45===e.charCode()&&(e.peek(),r=-1),n=r*Number(Ao(e))),e.eat(93),null===t&&null===n?null:{type:"Range",min:t,max:n}}(e)),e.eat(62),Ro(e,{type:"Type",name:t,opts:n})}function Lo(e,t){function n(e,t){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:!1}}for(t=Object.keys(t).sort((function(e,t){return xo[e]-xo[t]}));t.length>0;){for(var r=t.shift(),a=0,o=0;a<e.length;a++){var s=e[a];"Combinator"===s.type&&(s.value===r?(-1===o&&(o=a-1),e.splice(a,1),a--):(-1!==o&&a-o>1&&(e.splice(o,a-o,n(e.slice(o,a),r)),a=o+1),o=-1))}-1!==o&&t.length&&e.splice(o,a-o,n(e.slice(o,a),r))}return r}function Po(e){for(var t,n=[],r={},a=null,o=e.pos;t=No(e);)"Spaces"!==t.type&&("Combinator"===t.type?(null!==a&&"Combinator"!==a.type||(e.pos=o,e.error("Unexpected combinator")),r[t.value]=!0):null!==a&&"Combinator"!==a.type&&(r[" "]=!0,n.push({type:"Combinator",value:" "})),n.push(t),a=t,o=e.pos);return null!==a&&"Combinator"===a.type&&(e.pos-=o,e.error("Unexpected combinator")),{type:"Group",terms:n,combinator:Lo(n,r)||" ",disallowEmpty:!1,explicit:!1}}function No(e){var t=e.charCode();if(t<128&&1===wo[t])return function(e){var t;return t=Eo(e),40===e.charCode()?(e.pos++,{type:"Function",name:t}):Ro(e,{type:"Keyword",name:t})}(e);switch(t){case 93:break;case 91:return Ro(e,function(e){var t;return e.eat(91),t=Po(e),e.eat(93),t.explicit=!0,33===e.charCode()&&(e.pos++,t.disallowEmpty=!0),t}(e));case 60:return 39===e.nextCharCode()?function(e){var t;return e.eat(60),e.eat(39),t=Eo(e),e.eat(39),e.eat(62),Ro(e,{type:"Property",name:t})}(e):Io(e);case 124:return{type:"Combinator",value:e.substringToPos(124===e.nextCharCode()?e.pos+2:e.pos+1)};case 38:return e.pos++,e.eat(38),{type:"Combinator",value:"&&"};case 44:return e.pos++,{type:"Comma"};case 39:return Ro(e,{type:"String",value:To(e)});case 32:case 9:case 10:case 13:case 12:return{type:"Spaces",value:So(e)};case 64:return(t=e.nextCharCode())<128&&1===wo[t]?(e.pos++,{type:"AtKeyword",name:Eo(e)}):_o(e);case 42:case 43:case 63:case 35:case 33:break;case ko:if((t=e.nextCharCode())<48||t>57)return _o(e);break;default:return _o(e)}}function zo(e){var t=new vo(e),n=Po(t);return t.pos!==e.length&&t.error("Unexpected input"),1===n.terms.length&&"Group"===n.terms[0].type&&(n=n.terms[0]),n}zo("[a&&<b>#|<'c'>*||e() f{2} /,(% g#{1,2} h{2,})]!");var Mo=zo,Do=function(){};function Oo(e){return"function"==typeof e?e:Do}var Uo=function(e,t,n){var r=Do,a=Do;if("function"==typeof t?r=t:t&&(r=Oo(t.enter),a=Oo(t.leave)),r===Do&&a===Do)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");!function e(t){switch(r.call(n,t),t.type){case"Group":t.terms.forEach(e);break;case"Multiplier":e(t.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+t.type)}a.call(n,t)}(e)},Fo=new jr,Bo={decorator:function(e){var t=null,n={len:0,node:null},r=[n],a="";return{children:e.children,node:function(n){var r=t;t=n,e.node.call(this,n),t=r},chunk:function(e){a+=e,n.node!==t?r.push({len:e.length,node:t}):n.len+=e.length},result:function(){return qo(a,r)}}}};function qo(e,t){var n=[],r=0,a=0,o=t?t[a].node:null;for(Sa(e,Fo);!Fo.eof;){if(t)for(;a<t.length&&r+t[a].len<=Fo.tokenStart;)r+=t[a++].len,o=t[a].node;n.push({type:Fo.tokenType,value:Fo.getTokenValue(),index:Fo.tokenIndex,balance:Fo.balance[Fo.tokenIndex],node:o}),Fo.next()}return n}var jo={type:"Match"},Ho={type:"Mismatch"},Wo={type:"DisallowEmpty"};function Vo(e,t,n){return t===jo&&n===Ho||e===jo&&t===jo&&n===jo?e:("If"===e.type&&e.else===Ho&&t===jo&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function $o(e){return e.length>2&&40===e.charCodeAt(e.length-2)&&41===e.charCodeAt(e.length-1)}function Yo(e){return"Keyword"===e.type||"AtKeyword"===e.type||"Function"===e.type||"Type"===e.type&&$o(e.name)}function Go(e,t,n){switch(e){case" ":for(var r=jo,a=t.length-1;a>=0;a--){r=Vo(i=t[a],r,Ho)}return r;case"|":r=Ho;var o=null;for(a=t.length-1;a>=0;a--){if(Yo(i=t[a])&&(null===o&&a>0&&Yo(t[a-1])&&(r=Vo({type:"Enum",map:o=Object.create(null)},jo,r)),null!==o)){var s=($o(i.name)?i.name.slice(0,-1):i.name).toLowerCase();if(s in o==!1){o[s]=i;continue}}o=null,r=Vo(i,jo,r)}return r;case"&&":if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};for(r=Ho,a=t.length-1;a>=0;a--){var i=t[a];l=t.length>1?Go(e,t.filter((function(e){return e!==i})),!1):jo,r=Vo(i,l,r)}return r;case"||":if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};for(r=n?jo:Ho,a=t.length-1;a>=0;a--){var l;i=t[a];l=t.length>1?Go(e,t.filter((function(e){return e!==i})),!0):jo,r=Vo(i,l,r)}return r}}function Ko(e){if("function"==typeof e)return{type:"Generic",fn:e};switch(e.type){case"Group":var t=Go(e.combinator,e.terms.map(Ko),!1);return e.disallowEmpty&&(t=Vo(t,Wo,Ho)),t;case"Multiplier":return function(e){var t=jo,n=Ko(e.term);if(0===e.max)n=Vo(n,Wo,Ho),(t=Vo(n,null,Ho)).then=Vo(jo,jo,t),e.comma&&(t.then.else=Vo({type:"Comma",syntax:e},t,Ho));else for(var r=e.min||1;r<=e.max;r++)e.comma&&t!==jo&&(t=Vo({type:"Comma",syntax:e},t,Ho)),t=Vo(n,Vo(jo,jo,t),Ho);if(0===e.min)t=Vo(jo,jo,t);else for(r=0;r<e.min-1;r++)e.comma&&t!==jo&&(t=Vo({type:"Comma",syntax:e},t,Ho)),t=Vo(n,t,Ho);return t}(e);case"Type":case"Property":return{type:e.type,name:e.name,syntax:e};case"Keyword":return{type:e.type,name:e.name.toLowerCase(),syntax:e};case"AtKeyword":return{type:e.type,name:"@"+e.name.toLowerCase(),syntax:e};case"Function":return{type:e.type,name:e.name.toLowerCase()+"(",syntax:e};case"String":return 3===e.value.length?{type:"Token",value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,"'"),syntax:e};case"Token":return{type:e.type,value:e.value,syntax:e};case"Comma":return{type:e.type,syntax:e};default:throw new Error("Unknown node type:",e.type)}}var Qo=jo,Jo=Ho,Zo=Wo,Xo=function(e,t){return"string"==typeof e&&(e=Mo(e)),{type:"MatchGraph",match:Ko(e),syntax:t||null,source:e}},es=Object.prototype.hasOwnProperty,ts=Qo,ns=Jo,rs=Zo,as=sr.TYPE,os="Match";function ss(e){for(var t=null,n=null,r=e;null!==r;)n=r.prev,r.prev=t,t=r,r=n;return t}function is(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>=65&&r<=90&&(r|=32),r!==t.charCodeAt(n))return!1}return!0}function ls(e){return null===e||(e.type===as.Comma||e.type===as.Function||e.type===as.LeftParenthesis||e.type===as.LeftSquareBracket||e.type===as.LeftCurlyBracket||function(e){return e.type===as.Delim&&"?"!==e.value}(e))}function cs(e){return null===e||(e.type===as.RightParenthesis||e.type===as.RightSquareBracket||e.type===as.RightCurlyBracket||e.type===as.Delim)}function us(e,t,n){function r(){do{y++,g=y<e.length?e[y]:null}while(null!==g&&(g.type===as.WhiteSpace||g.type===as.Comment))}function a(t){var n=y+t;return n<e.length?e[n]:null}function o(e,t){return{nextState:e,matchStack:v,syntaxStack:u,thenStack:h,tokenIndex:y,prev:t}}function s(e){h={nextState:e,matchStack:v,syntaxStack:u,prev:h}}function i(e){d=o(e,d)}function l(){v={type:1,syntax:t.syntax,token:g,prev:v},r(),p=null,y>b&&(b=y)}function c(){v=2===v.type?v.prev:{type:3,syntax:u.syntax,token:v.token,prev:v},u=u.prev}var u=null,h=null,d=null,p=null,m=0,f=null,g=null,y=-1,b=0,v={type:0,syntax:null,token:null,prev:null};for(r();null===f&&++m<15e3;)switch(t.type){case"Match":if(null===h){if(null!==g&&(y!==e.length-1||"\\0"!==g.value&&"\\9"!==g.value)){t=ns;break}f=os;break}if((t=h.nextState)===rs){if(h.matchStack===v){t=ns;break}t=ts}for(;h.syntaxStack!==u;)c();h=h.prev;break;case"Mismatch":if(null!==p&&!1!==p)(null===d||y>d.tokenIndex)&&(d=p,p=!1);else if(null===d){f="Mismatch";break}t=d.nextState,h=d.thenStack,u=d.syntaxStack,v=d.matchStack,y=d.tokenIndex,g=y<e.length?e[y]:null,d=d.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==ns&&i(t.else),t.then!==ts&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":var k=t.syntax.terms;if(t.index===k.length){if(0===t.mask||t.syntax.all){t=ns;break}t=ts;break}if(t.mask===(1<<k.length)-1){t=ts;break}for(;t.index<k.length;t.index++){var w=1<<t.index;if(0==(t.mask&w)){i(t),s({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|w}),t=k[t.index++];break}}break;case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(null!==g)if(-1!==(T=g.value.toLowerCase()).indexOf("\\")&&(T=T.replace(/\\[09].*$/,"")),es.call(t.map,T)){t=t.map[T];break}t=ns;break;case"Generic":var x=null!==u?u.opts:null,S=y+Math.floor(t.fn(g,a,x));if(!isNaN(S)&&S>y){for(;y<S;)l();t=ts}else t=ns;break;case"Type":case"Property":var E="Type"===t.type?"types":"properties",A=es.call(n,E)?n[E][t.name]:null;if(!A||!A.match)throw new Error("Bad syntax reference: "+("Type"===t.type?"<"+t.name+">":"<'"+t.name+"'>"));if(!1!==p&&null!==g&&"Type"===t.type)if("custom-ident"===t.name&&g.type===as.Ident||"length"===t.name&&"0"===g.value){null===p&&(p=o(t,d)),t=ns;break}u={syntax:t.syntax,opts:t.syntax.opts||null!==u&&u.opts||null,prev:u},v={type:2,syntax:t.syntax,token:v.token,prev:v},t=A.match;break;case"Keyword":var T=t.name;if(null!==g){var C=g.value;if(-1!==C.indexOf("\\")&&(C=C.replace(/\\[09].*$/,"")),is(C,T)){l(),t=ts;break}}t=ns;break;case"AtKeyword":case"Function":if(null!==g&&is(g.value,t.name)){l(),t=ts;break}t=ns;break;case"Token":if(null!==g&&g.value===t.value){l(),t=ts;break}t=ns;break;case"Comma":null!==g&&g.type===as.Comma?ls(v.token)?t=ns:(l(),t=cs(g)?ns:ts):t=ls(v.token)||cs(g)?ts:ns;break;case"String":var R="";for(S=y;S<e.length&&R.length<t.value.length;S++)R+=e[S].value;if(is(R,t.value)){for(;y<S;)l();t=ts}else t=ns;break;default:throw new Error("Unknown node type: "+t.type)}switch(m,f){case null:console.warn("[csstree-match] BREAK after 15000 iterations"),f="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",v=null;break;case os:for(;null!==u;)c();break;default:v=null}return{tokens:e,reason:f,iterations:m,match:v,longestMatch:b}}var hs=function(e,t,n){var r=us(e,t,n||{});if(null===r.match)return r;var a=r.match,o=r.match={syntax:t.syntax||null,match:[]},s=[o];for(a=ss(a).prev;null!==a;){switch(a.type){case 2:o.match.push(o={syntax:a.syntax,match:[]}),s.push(o);break;case 3:s.pop(),o=s[s.length-1];break;default:o.match.push({syntax:a.syntax||null,token:a.token.value,node:a.token.node})}a=a.prev}return r};function ds(e){function t(e){return null!==e&&("Type"===e.type||"Property"===e.type||"Keyword"===e.type)}var n=null;return null!==this.matched&&function r(a){if(Array.isArray(a.match)){for(var o=0;o<a.match.length;o++)if(r(a.match[o]))return t(a.syntax)&&n.unshift(a.syntax),!0}else if(a.node===e)return n=t(a.syntax)?[a.syntax]:[],!0;return!1}(this.matched),n}function ps(e,t,n){var r=ds.call(e,t);return null!==r&&r.some(n)}var ms={getTrace:ds,isType:function(e,t){return ps(this,e,(function(e){return"Type"===e.type&&e.name===t}))},isProperty:function(e,t){return ps(this,e,(function(e){return"Property"===e.type&&e.name===t}))},isKeyword:function(e){return ps(this,e,(function(e){return"Keyword"===e.type}))}};function fs(e){return"node"in e?e.node:fs(e.match[0])}function gs(e){return"node"in e?e.node:gs(e.match[e.match.length-1])}var ys={matchFragments:function(e,t,n,r,a){var o=[];return null!==n.matched&&function n(s){if(null!==s.syntax&&s.syntax.type===r&&s.syntax.name===a){var i=fs(s),l=gs(s);e.syntax.walk(t,(function(e,t,n){if(e===i){var r=new Xn;do{if(r.appendData(t.data),t.data===l)break;t=t.next}while(null!==t);o.push({parent:n,nodes:r})}}))}Array.isArray(s.match)&&s.match.forEach(n)}(n.matched),o}},bs=Object.prototype.hasOwnProperty;function vs(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&e>=0}function ks(e){return Boolean(e)&&vs(e.offset)&&vs(e.line)&&vs(e.column)}function ws(e,t){return function(n,r){if(!n||n.constructor!==Object)return r(n,"Type of node should be an Object");for(var a in n){var o=!0;if(!1!==bs.call(n,a)){if("type"===a)n.type!==e&&r(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if("loc"===a){if(null===n.loc)continue;if(n.loc&&n.loc.constructor===Object)if("string"!=typeof n.loc.source)a+=".source";else if(ks(n.loc.start)){if(ks(n.loc.end))continue;a+=".end"}else a+=".start";o=!1}else if(t.hasOwnProperty(a)){var s=0;for(o=!1;!o&&s<t[a].length;s++){var i=t[a][s];switch(i){case String:o="string"==typeof n[a];break;case Boolean:o="boolean"==typeof n[a];break;case null:o=null===n[a];break;default:"string"==typeof i?o=n[a]&&n[a].type===i:Array.isArray(i)&&(o=n[a]instanceof Xn)}}}else r(n,"Unknown field `"+a+"` for "+e+" node type");o||r(n,"Bad value for `"+e+"."+a+"`")}}for(var a in t)bs.call(t,a)&&!1===bs.call(n,a)&&r(n,"Field `"+e+"."+a+"` is missed")}}function xs(e,t){var n=t.structure,r={type:String,loc:!0},a={type:'"'+e+'"'};for(var o in n)if(!1!==bs.call(n,o)){for(var s=[],i=r[o]=Array.isArray(n[o])?n[o].slice():[n[o]],l=0;l<i.length;l++){var c=i[l];if(c===String||c===Boolean)s.push(c.name);else if(null===c)s.push("null");else if("string"==typeof c)s.push("<"+c+">");else{if(!Array.isArray(c))throw new Error("Wrong value `"+c+"` in `"+e+"."+o+"` structure definition");s.push("List")}}a[o]=s.join(" | ")}return{docs:a,check:ws(e,r)}}var Ss=Kr,Es=Qr,As=Xo,Ts=hs,Cs=function(e){var t={};if(e.node)for(var n in e.node)if(bs.call(e.node,n)){var r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=xs(n,r)}return t},Rs=As("inherit | initial | unset"),_s=As("inherit | initial | unset | <-ms-legacy-expression>");function Is(e,t,n){var r={};for(var a in e)e[a].syntax&&(r[a]=n?e[a].syntax:Vr(e[a].syntax,{compact:t}));return r}function Ls(e,t,n){const r={};for(const[a,o]of Object.entries(e))r[a]={prelude:o.prelude&&(n?o.prelude.syntax:Vr(o.prelude.syntax,{compact:t})),descriptors:o.descriptors&&Is(o.descriptors,t,n)};return r}function Ps(e,t,n){return{matched:e,iterations:n,error:t,getTrace:ms.getTrace,isType:ms.isType,isProperty:ms.isProperty,isKeyword:ms.isKeyword}}function Ns(e,t,n,r){var a,o=function(e,t){return"string"==typeof e?qo(e,null):t.generate(e,Bo)}(n,e.syntax);return function(e){for(var t=0;t<e.length;t++)if("var("===e[t].value.toLowerCase())return!0;return!1}(o)?Ps(null,new Error("Matching for a tree with var() is not supported")):(r&&(a=Ts(o,e.valueCommonSyntax,e)),r&&a.match||(a=Ts(o,t.match,e)).match?Ps(a.match,null,a.iterations):Ps(null,new Es(a.reason,t.syntax,n,a),a.iterations))}var zs=function(e,t,n){if(this.valueCommonSyntax=Rs,this.syntax=t,this.generic=!1,this.atrules={},this.properties={},this.types={},this.structure=n||Cs(e),e){if(e.types)for(var r in e.types)this.addType_(r,e.types[r]);if(e.generic)for(var r in this.generic=!0,go)this.addType_(r,go[r]);if(e.atrules)for(var r in e.atrules)this.addAtrule_(r,e.atrules[r]);if(e.properties)for(var r in e.properties)this.addProperty_(r,e.properties[r])}};zs.prototype={structure:{},checkStructure:function(e){function t(e,t){r.push({node:e,message:t})}var n=this.structure,r=[];return this.syntax.walk(e,(function(e){n.hasOwnProperty(e.type)?n[e.type].check(e,t):t(e,"Unknown node type `"+e.type+"`")})),!!r.length&&r},createDescriptor:function(e,t,n,r=null){var a={type:t,name:n},o={type:t,name:n,parent:r,syntax:null,match:null};return"function"==typeof e?o.match=As(e,a):("string"==typeof e?Object.defineProperty(o,"syntax",{get:function(){return Object.defineProperty(o,"syntax",{value:Mo(e)}),o.syntax}}):o.syntax=e,Object.defineProperty(o,"match",{get:function(){return Object.defineProperty(o,"match",{value:As(o.syntax,a)}),o.match}})),o},addAtrule_:function(e,t){t&&(this.atrules[e]={type:"Atrule",name:e,prelude:t.prelude?this.createDescriptor(t.prelude,"AtrulePrelude",e):null,descriptors:t.descriptors?Object.keys(t.descriptors).reduce(((n,r)=>(n[r]=this.createDescriptor(t.descriptors[r],"AtruleDescriptor",r,e),n)),{}):null})},addProperty_:function(e,t){t&&(this.properties[e]=this.createDescriptor(t,"Property",e))},addType_:function(e,t){t&&(this.types[e]=this.createDescriptor(t,"Type",e),t===go["-ms-legacy-expression"]&&(this.valueCommonSyntax=_s))},checkAtruleName:function(e){if(!this.getAtrule(e))return new Ss("Unknown at-rule","@"+e)},checkAtrulePrelude:function(e,t){let n=this.checkAtruleName(e);if(n)return n;var r=this.getAtrule(e);return!r.prelude&&t?new SyntaxError("At-rule `@"+e+"` should not contain a prelude"):r.prelude&&!t?new SyntaxError("At-rule `@"+e+"` should contain a prelude"):void 0},checkAtruleDescriptorName:function(e,t){let n=this.checkAtruleName(e);if(n)return n;var r=this.getAtrule(e),a=na.keyword(t);return r.descriptors?r.descriptors[a.name]||r.descriptors[a.basename]?void 0:new Ss("Unknown at-rule descriptor",t):new SyntaxError("At-rule `@"+e+"` has no known descriptors")},checkPropertyName:function(e){return na.property(e).custom?new Error("Lexer matching doesn't applicable for custom properties"):this.getProperty(e)?void 0:new Ss("Unknown property",e)},matchAtrulePrelude:function(e,t){var n=this.checkAtrulePrelude(e,t);return n?Ps(null,n):t?Ns(this,this.getAtrule(e).prelude,t,!1):Ps(null,null)},matchAtruleDescriptor:function(e,t,n){var r=this.checkAtruleDescriptorName(e,t);if(r)return Ps(null,r);var a=this.getAtrule(e),o=na.keyword(t);return Ns(this,a.descriptors[o.name]||a.descriptors[o.basename],n,!1)},matchDeclaration:function(e){return"Declaration"!==e.type?Ps(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)},matchProperty:function(e,t){var n=this.checkPropertyName(e);return n?Ps(null,n):Ns(this,this.getProperty(e),t,!0)},matchType:function(e,t){var n=this.getType(e);return n?Ns(this,n,t,!1):Ps(null,new Ss("Unknown type",e))},match:function(e,t){return"string"==typeof e||e&&e.type?("string"!=typeof e&&e.match||(e=this.createDescriptor(e,"Type","anonymous")),Ns(this,e,t,!1)):Ps(null,new Ss("Bad syntax"))},findValueFragments:function(e,t,n,r){return ys.matchFragments(this,t,this.matchProperty(e,t),n,r)},findDeclarationValueFragments:function(e,t,n){return ys.matchFragments(this,e.value,this.matchDeclaration(e),t,n)},findAllFragments:function(e,t,n){var r=[];return this.syntax.walk(e,{visit:"Declaration",enter:function(e){r.push.apply(r,this.findDeclarationValueFragments(e,t,n))}.bind(this)}),r},getAtrule:function(e,t=!0){var n=na.keyword(e);return(n.vendor&&t?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null},getAtrulePrelude:function(e,t=!0){const n=this.getAtrule(e,t);return n&&n.prelude||null},getAtruleDescriptor:function(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null},getProperty:function(e,t=!0){var n=na.property(e);return(n.vendor&&t?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null},getType:function(e){return this.types.hasOwnProperty(e)?this.types[e]:null},validate:function(){function e(r,a,o,s){if(o.hasOwnProperty(a))return o[a];o[a]=!1,null!==s.syntax&&Uo(s.syntax,(function(s){if("Type"===s.type||"Property"===s.type){var i="Type"===s.type?r.types:r.properties,l="Type"===s.type?t:n;i.hasOwnProperty(s.name)&&!e(r,s.name,l,i[s.name])||(o[a]=!0)}}),this)}var t={},n={};for(var r in this.types)e(this,r,t,this.types[r]);for(var r in this.properties)e(this,r,n,this.properties[r]);return t=Object.keys(t).filter((function(e){return t[e]})),n=Object.keys(n).filter((function(e){return n[e]})),t.length||n.length?{types:t,properties:n}:null},dump:function(e,t){return{generic:this.generic,types:Is(this.types,!t,e),properties:Is(this.properties,!t,e),atrules:Ls(this.atrules,!t,e)}},toString:function(){return JSON.stringify(this.dump())}};var Ms=zs,Ds={SyntaxError:yo,parse:Mo,generate:Vr,walk:Uo},Os=Sa.isBOM;var Us=function(){this.lines=null,this.columns=null,this.linesAndColumnsComputed=!1};Us.prototype={setSource:function(e,t,n,r){this.source=e,this.startOffset=void 0===t?0:t,this.startLine=void 0===n?1:n,this.startColumn=void 0===r?1:r,this.linesAndColumnsComputed=!1},ensureLinesAndColumnsComputed:function(){this.linesAndColumnsComputed||(!function(e,t){for(var n=t.length,r=aa(e.lines,n),a=e.startLine,o=aa(e.columns,n),s=e.startColumn,i=t.length>0?Os(t.charCodeAt(0)):0;i<n;i++){var l=t.charCodeAt(i);r[i]=a,o[i]=s++,10!==l&&13!==l&&12!==l||(13===l&&i+1<n&&10===t.charCodeAt(i+1)&&(r[++i]=a,o[i]=s),a++,s=1)}r[i]=a,o[i]=s,e.lines=r,e.columns=o}(this,this.source),this.linesAndColumnsComputed=!0)},getLocation:function(e,t){return this.ensureLinesAndColumnsComputed(),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}},getLocationRange:function(e,t,n){return this.ensureLinesAndColumnsComputed(),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}};var Fs=Us,Bs=Sa.TYPE,qs=Bs.WhiteSpace,js=Bs.Comment,Hs=function(e){var t=this.createList(),n=null,r={recognizer:e,space:null,ignoreWS:!1,ignoreWSAfter:!1};for(this.scanner.skipSC();!this.scanner.eof;){switch(this.scanner.tokenType){case js:this.scanner.next();continue;case qs:r.ignoreWS?this.scanner.next():r.space=this.WhiteSpace();continue}if(void 0===(n=e.getNode.call(this,r)))break;null!==r.space&&(t.push(r.space),r.space=null),t.push(n),r.ignoreWSAfter?(r.ignoreWSAfter=!1,r.ignoreWS=!0):r.ignoreWS=!1}return t},{findWhiteSpaceStart:Ws,cmpStr:Vs}=Pr,$s=function(){},Ys=sr.TYPE,Gs=sr.NAME,Ks=Ys.WhiteSpace,Qs=Ys.Comment,Js=Ys.Ident,Zs=Ys.Function,Xs=Ys.Url,ei=Ys.Hash,ti=Ys.Percentage,ni=Ys.Number;function ri(e){return function(){return this[e]()}}var ai=function(e){var t={scanner:new jr,locationMap:new Fs,filename:"<unknown>",needPositions:!1,onParseError:$s,onParseErrorThrow:!1,parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Hs,createList:function(){return new Xn},createSingleNodeList:function(e){return(new Xn).appendData(e)},getFirstListNode:function(e){return e&&e.first()},getLastListNode:function(e){return e.last()},parseWithFallback:function(e,t){var n=this.scanner.tokenIndex;try{return e.call(this)}catch(e){if(this.onParseErrorThrow)throw e;var r=t.call(this,n);return this.onParseErrorThrow=!0,this.onParseError(e,r),this.onParseErrorThrow=!1,r}},lookupNonWSType:function(e){do{var t=this.scanner.lookupType(e++);if(t!==Ks)return t}while(0!==t);return 0},eat:function(e){if(this.scanner.tokenType!==e){var t=this.scanner.tokenStart,n=Gs[e]+" is expected";switch(e){case Js:this.scanner.tokenType===Zs||this.scanner.tokenType===Xs?(t=this.scanner.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case ei:this.scanner.isDelim(35)&&(this.scanner.next(),t++,n="Name is expected");break;case ti:this.scanner.tokenType===ni&&(t=this.scanner.tokenEnd,n="Percent sign is expected");break;default:this.scanner.source.charCodeAt(this.scanner.tokenStart)===e&&(t+=1)}this.error(n,t)}this.scanner.next()},consume:function(e){var t=this.scanner.getTokenValue();return this.eat(e),t},consumeFunctionName:function(){var e=this.scanner.source.substring(this.scanner.tokenStart,this.scanner.tokenEnd-1);return this.eat(Zs),e},getLocation:function(e,t){return this.needPositions?this.locationMap.getLocationRange(e,t,this.filename):null},getLocationFromList:function(e){if(this.needPositions){var t=this.getFirstListNode(e),n=this.getLastListNode(e);return this.locationMap.getLocationRange(null!==t?t.loc.start.offset-this.locationMap.startOffset:this.scanner.tokenStart,null!==n?n.loc.end.offset-this.locationMap.startOffset:this.scanner.tokenStart,this.filename)}return null},error:function(e,t){var n=void 0!==t&&t<this.scanner.source.length?this.locationMap.getLocation(t):this.scanner.eof?this.locationMap.getLocation(Ws(this.scanner.source,this.scanner.source.length-1)):this.locationMap.getLocation(this.scanner.tokenStart);throw new rr(e||"Unexpected input",this.scanner.source,n.offset,n.line,n.column)}};for(var n in e=function(e){var t={context:{},scope:{},atrule:{},pseudo:{}};if(e.parseContext)for(var n in e.parseContext)switch(typeof e.parseContext[n]){case"function":t.context[n]=e.parseContext[n];break;case"string":t.context[n]=ri(e.parseContext[n])}if(e.scope)for(var n in e.scope)t.scope[n]=e.scope[n];if(e.atrule)for(var n in e.atrule){var r=e.atrule[n];r.parse&&(t.atrule[n]=r.parse)}if(e.pseudo)for(var n in e.pseudo){var a=e.pseudo[n];a.parse&&(t.pseudo[n]=a.parse)}if(e.node)for(var n in e.node)t[n]=e.node[n].parse;return t}(e||{}))t[n]=e[n];return function(e,n){var r,a=(n=n||{}).context||"default",o=n.onComment;if(Sa(e,t.scanner),t.locationMap.setSource(e,n.offset,n.line,n.column),t.filename=n.filename||"<unknown>",t.needPositions=Boolean(n.positions),t.onParseError="function"==typeof n.onParseError?n.onParseError:$s,t.onParseErrorThrow=!1,t.parseAtrulePrelude=!("parseAtrulePrelude"in n)||Boolean(n.parseAtrulePrelude),t.parseRulePrelude=!("parseRulePrelude"in n)||Boolean(n.parseRulePrelude),t.parseValue=!("parseValue"in n)||Boolean(n.parseValue),t.parseCustomProperty="parseCustomProperty"in n&&Boolean(n.parseCustomProperty),!t.context.hasOwnProperty(a))throw new Error("Unknown context `"+a+"`");return"function"==typeof o&&t.scanner.forEachToken(((n,r,a)=>{if(n===Qs){const n=t.getLocation(r,a),s=Vs(e,a-2,a,"*/")?e.slice(r+2,a-2):e.slice(r+2,a);o(s,n)}})),r=t.context[a].call(t,n),t.scanner.eof||t.error(),r}},oi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),si=function(e){if(0<=e&&e<oi.length)return oi[e];throw new TypeError("Must be between 0 and 63: "+e)};var ii=function(e){var t,n="",r=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&r,(r>>>=5)>0&&(t|=32),n+=si(t)}while(r>0);return n};var li=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function a(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function o(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function s(e){var n=e,r=a(e);if(r){if(!r.path)return e;n=r.path}for(var s,i=t.isAbsolute(n),l=n.split(/\/+/),c=0,u=l.length-1;u>=0;u--)"."===(s=l[u])?l.splice(u,1):".."===s?c++:c>0&&(""===s?(l.splice(u+1,c),c=0):(l.splice(u,2),c--));return""===(n=l.join("/"))&&(n=i?"/":"."),r?(r.path=n,o(r)):n}function i(e,t){""===e&&(e="."),""===t&&(t=".");var n=a(t),i=a(e);if(i&&(e=i.path||"/"),n&&!n.scheme)return i&&(n.scheme=i.scheme),o(n);if(n||t.match(r))return t;if(i&&!i.host&&!i.path)return i.host=t,o(i);var l="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return i?(i.path=l,o(i)):l}t.urlParse=a,t.urlGenerate=o,t.normalize=s,t.join=i,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var l=!("__proto__"in Object.create(null));function c(e){return e}function u(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function h(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=l?c:function(e){return u(e)?"$"+e:e},t.fromSetString=l?c:function(e){return u(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=h(e.source,t.source);return 0!==r||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)||n||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=e.generatedLine-t.generatedLine)?r:h(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=h(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:h(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=h(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:h(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=a(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var l=r.path.lastIndexOf("/");l>=0&&(r.path=r.path.substring(0,l+1))}t=i(o(r),t)}return s(t)}}));li.getArg,li.urlParse,li.urlGenerate,li.normalize,li.join,li.isAbsolute,li.relative,li.toSetString,li.fromSetString,li.compareByOriginalPositions,li.compareByGeneratedPositionsDeflated,li.compareByGeneratedPositionsInflated,li.parseSourceMapInput,li.computeSourceURL;var ci=Object.prototype.hasOwnProperty,ui="undefined"!=typeof Map;function hi(){this._array=[],this._set=ui?new Map:Object.create(null)}hi.fromArray=function(e,t){for(var n=new hi,r=0,a=e.length;r<a;r++)n.add(e[r],t);return n},hi.prototype.size=function(){return ui?this._set.size:Object.getOwnPropertyNames(this._set).length},hi.prototype.add=function(e,t){var n=ui?e:li.toSetString(e),r=ui?this.has(e):ci.call(this._set,n),a=this._array.length;r&&!t||this._array.push(e),r||(ui?this._set.set(e,a):this._set[n]=a)},hi.prototype.has=function(e){if(ui)return this._set.has(e);var t=li.toSetString(e);return ci.call(this._set,t)},hi.prototype.indexOf=function(e){if(ui){var t=this._set.get(e);if(t>=0)return t}else{var n=li.toSetString(e);if(ci.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},hi.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},hi.prototype.toArray=function(){return this._array.slice()};var di={ArraySet:hi};function pi(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}pi.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},pi.prototype.add=function(e){var t,n,r,a,o,s;t=this._last,n=e,r=t.generatedLine,a=n.generatedLine,o=t.generatedColumn,s=n.generatedColumn,a>r||a==r&&s>=o||li.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},pi.prototype.toArray=function(){return this._sorted||(this._array.sort(li.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};var mi=di.ArraySet,fi={MappingList:pi}.MappingList;function gi(e){e||(e={}),this._file=li.getArg(e,"file",null),this._sourceRoot=li.getArg(e,"sourceRoot",null),this._skipValidation=li.getArg(e,"skipValidation",!1),this._sources=new mi,this._names=new mi,this._mappings=new fi,this._sourcesContents=null}gi.prototype._version=3,gi.fromSourceMap=function(e){var t=e.sourceRoot,n=new gi({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=li.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)})),e.sources.forEach((function(r){var a=r;null!==t&&(a=li.relative(t,r)),n._sources.has(a)||n._sources.add(a);var o=e.sourceContentFor(r);null!=o&&n.setSourceContent(r,o)})),n},gi.prototype.addMapping=function(e){var t=li.getArg(e,"generated"),n=li.getArg(e,"original",null),r=li.getArg(e,"source",null),a=li.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,a),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=a&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:a})},gi.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=li.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[li.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[li.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},gi.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var a=this._sourceRoot;null!=a&&(r=li.relative(a,r));var o=new mi,s=new mi;this._mappings.unsortedForEach((function(t){if(t.source===r&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=n&&(t.source=li.join(n,t.source)),null!=a&&(t.source=li.relative(a,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var l=t.source;null==l||o.has(l)||o.add(l);var c=t.name;null==c||s.has(c)||s.add(c)}),this),this._sources=o,this._names=s,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=li.join(n,t)),null!=a&&(t=li.relative(a,t)),this.setSourceContent(t,r))}),this)},gi.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},gi.prototype._serializeMappings=function(){for(var e,t,n,r,a=0,o=1,s=0,i=0,l=0,c=0,u="",h=this._mappings.toArray(),d=0,p=h.length;d<p;d++){if(e="",(t=h[d]).generatedLine!==o)for(a=0;t.generatedLine!==o;)e+=";",o++;else if(d>0){if(!li.compareByGeneratedPositionsInflated(t,h[d-1]))continue;e+=","}e+=ii(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(r=this._sources.indexOf(t.source),e+=ii(r-c),c=r,e+=ii(t.originalLine-1-i),i=t.originalLine-1,e+=ii(t.originalColumn-s),s=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=ii(n-l),l=n)),u+=e}return u},gi.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=li.relative(t,e));var n=li.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},gi.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},gi.prototype.toString=function(){return JSON.stringify(this.toJSON())};var yi={SourceMapGenerator:gi}.SourceMapGenerator,bi={Atrule:!0,Selector:!0,Declaration:!0},vi=Object.prototype.hasOwnProperty;function ki(e,t){var n=e.children,r=null;"function"!=typeof t?n.forEach(this.node,this):n.forEach((function(e){null!==r&&t.call(this,r),this.node(e),r=e}),this)}var wi=function(e){function t(e){if(!vi.call(n,e.type))throw new Error("Unknown node type: "+e.type);n[e.type].call(this,e)}var n={};if(e.node)for(var r in e.node)n[r]=e.node[r].generate;return function(e,n){var r="",a={children:ki,node:t,chunk:function(e){r+=e},result:function(){return r}};return n&&("function"==typeof n.decorator&&(a=n.decorator(a)),n.sourceMap&&(a=function(e){var t=new yi,n=1,r=0,a={line:1,column:0},o={line:0,column:0},s=!1,i={line:1,column:0},l={generated:i},c=e.node;e.node=function(e){if(e.loc&&e.loc.start&&bi.hasOwnProperty(e.type)){var u=e.loc.start.line,h=e.loc.start.column-1;o.line===u&&o.column===h||(o.line=u,o.column=h,a.line=n,a.column=r,s&&(s=!1,a.line===i.line&&a.column===i.column||t.addMapping(l)),s=!0,t.addMapping({source:e.loc.source,original:o,generated:a}))}c.call(this,e),s&&bi.hasOwnProperty(e.type)&&(i.line=n,i.column=r)};var u=e.chunk;e.chunk=function(e){for(var t=0;t<e.length;t++)10===e.charCodeAt(t)?(n++,r=0):r++;u(e)};var h=e.result;return e.result=function(){return s&&t.addMapping(l),{css:h(),map:t}},e}(a))),a.node(e),a.result()}},xi=Object.prototype.hasOwnProperty,Si=function(){};function Ei(e){return"function"==typeof e?e:Si}function Ai(e,t){return function(n,r,a){n.type===t&&e.call(this,n,r,a)}}function Ti(e,t){var n=t.structure,r=[];for(var a in n)if(!1!==xi.call(n,a)){var o=n[a],s={name:a,type:!1,nullable:!1};Array.isArray(n[a])||(o=[n[a]]);for(var i=0;i<o.length;i++){var l=o[i];null===l?s.nullable=!0:"string"==typeof l?s.type="node":Array.isArray(l)&&(s.type="list")}s.type&&r.push(s)}return r.length?{context:t.walkContext,fields:r}:null}function Ci(e,t){var n=e.fields.slice(),r=e.context,a="string"==typeof r;return t&&n.reverse(),function(e,o,s,i){var l;a&&(l=o[r],o[r]=e);for(var c=0;c<n.length;c++){var u=n[c],h=e[u.name];if(!u.nullable||h)if("list"===u.type){if(t?h.reduceRight(i,!1):h.reduce(i,!1))return!0}else if(s(h))return!0}a&&(o[r]=l)}}function Ri(e){return{Atrule:{StyleSheet:e.StyleSheet,Atrule:e.Atrule,Rule:e.Rule,Block:e.Block},Rule:{StyleSheet:e.StyleSheet,Atrule:e.Atrule,Rule:e.Rule,Block:e.Block},Declaration:{StyleSheet:e.StyleSheet,Atrule:e.Atrule,Rule:e.Rule,Block:e.Block,DeclarationList:e.DeclarationList}}}var _i=function(e){var t=function(e){var t={};for(var n in e.node)if(xi.call(e.node,n)){var r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=Ti(0,r)}return t}(e),n={},r={},a=Symbol("break-walk"),o=Symbol("skip-node");for(var s in t)xi.call(t,s)&&null!==t[s]&&(n[s]=Ci(t[s],!1),r[s]=Ci(t[s],!0));var i=Ri(n),l=Ri(r),c=function(e,s){function c(e,t,n){var r=h.call(m,e,t,n);return r===a||r!==o&&(!(!p.hasOwnProperty(e.type)||!p[e.type](e,m,c,u))||d.call(m,e,t,n)===a)}var u=(e,t,n,r)=>e||c(t,n,r),h=Si,d=Si,p=n,m={break:a,skip:o,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof s)h=s;else if(s&&(h=Ei(s.enter),d=Ei(s.leave),s.reverse&&(p=r),s.visit)){if(i.hasOwnProperty(s.visit))p=s.reverse?l[s.visit]:i[s.visit];else if(!t.hasOwnProperty(s.visit))throw new Error("Bad value `"+s.visit+"` for `visit` option (should be: "+Object.keys(t).join(", ")+")");h=Ai(h,s.visit),d=Ai(d,s.visit)}if(h===Si&&d===Si)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");c(e)};return c.break=a,c.skip=o,c.find=function(e,t){var n=null;return c(e,(function(e,r,o){if(t.call(this,e,r,o))return n=e,a})),n},c.findLast=function(e,t){var n=null;return c(e,{reverse:!0,enter:function(e,r,o){if(t.call(this,e,r,o))return n=e,a}}),n},c.findAll=function(e,t){var n=[];return c(e,(function(e,r,a){t.call(this,e,r,a)&&n.push(e)})),n},c},Ii=function e(t){var n={};for(var r in t){var a=t[r];a&&(Array.isArray(a)||a instanceof Xn?a=a.map(e):a.constructor===Object&&(a=e(a))),n[r]=a}return n};const Li=Object.prototype.hasOwnProperty,Pi={generic:!0,types:Di,atrules:{prelude:Oi,descriptors:Oi},properties:Di,parseContext:function(e,t){return Object.assign(e,t)},scope:function e(t,n){for(const r in n)Li.call(n,r)&&(Ni(t[r])?e(t[r],zi(n[r])):t[r]=zi(n[r]));return t},atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function Ni(e){return e&&e.constructor===Object}function zi(e){return Ni(e)?Object.assign({},e):e}function Mi(e,t){return"string"==typeof t&&/^\s*\|/.test(t)?"string"==typeof e?e+t:t.replace(/^\s*\|\s*/,""):t||null}function Di(e,t){if("string"==typeof t)return Mi(e,t);const n=Object.assign({},e);for(let r in t)Li.call(t,r)&&(n[r]=Mi(Li.call(e,r)?e[r]:void 0,t[r]));return n}function Oi(e,t){const n=Di(e,t);return!Ni(n)||Object.keys(n).length?n:null}function Ui(e,t,n){for(const r in n)if(!1!==Li.call(n,r))if(!0===n[r])r in t&&Li.call(t,r)&&(e[r]=zi(t[r]));else if(n[r])if("function"==typeof n[r]){const a=n[r];e[r]=a({},e[r]),e[r]=a(e[r]||{},t[r])}else if(Ni(n[r])){const a={};for(let t in e[r])a[t]=Ui({},e[r][t],n[r]);for(let e in t[r])a[e]=Ui(a[e]||{},t[r][e],n[r]);e[r]=a}else if(Array.isArray(n[r])){const a={},o=n[r].reduce((function(e,t){return e[t]=!0,e}),{});for(const[t,n]of Object.entries(e[r]||{}))a[t]={},n&&Ui(a[t],n,o);for(const e in t[r])Li.call(t[r],e)&&(a[e]||(a[e]={}),t[r]&&t[r][e]&&Ui(a[e],t[r][e],o));e[r]=a}return e}var Fi=(e,t)=>Ui(e,t,Pi);function Bi(e){var t=ai(e),n=_i(e),r=wi(e),a=function(e){return{fromPlainObject:function(t){return e(t,{enter:function(e){e.children&&e.children instanceof Xn==0&&(e.children=(new Xn).fromArray(e.children))}}),t},toPlainObject:function(t){return e(t,{leave:function(e){e.children&&e.children instanceof Xn&&(e.children=e.children.toArray())}}),t}}}(n),o={List:Xn,SyntaxError:rr,TokenStream:jr,Lexer:Ms,vendorPrefix:na.vendorPrefix,keyword:na.keyword,property:na.property,isCustomProperty:na.isCustomProperty,definitionSyntax:Ds,lexer:null,createLexer:function(e){return new Ms(e,o,o.lexer.structure)},tokenize:Sa,parse:t,walk:n,generate:r,find:n.find,findLast:n.findLast,findAll:n.findAll,clone:Ii,fromPlainObject:a.fromPlainObject,toPlainObject:a.toPlainObject,createSyntax:function(e){return Bi(Fi({},e))},fork:function(t){var n=Fi({},e);return Bi("function"==typeof t?t(n,Object.assign):Fi(n,t))}};return o.lexer=new Ms({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},o),o}var qi=function(e){return Bi(Fi({},e))},ji={generic:!0,types:{"absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","alpha-value":"<number>|<percentage>","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>","angular-color-stop":"<color>&&<color-stop-angle>?","angular-color-stop-list":"[<angular-color-stop> [, <angular-color-hint>]?]# , <angular-color-stop>","animateable-feature":"scroll-position|contents|<custom-ident>",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <type-or-unit>? [, <attr-fallback>]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<circle()>|<ellipse()>|<polygon()>|<path()>","bg-image":"none|<image>","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage>|auto]{1,2}|cover|contain","blur()":"blur( <length> )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( <number-percentage> )","calc()":"calc( <calc-sum> )","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-value":"<number>|<dimension>|<percentage>|( <calc-sum> )","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( [<shape-radius>]? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hex-color>|<named-color>|currentcolor|<deprecated-system-color>","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"<angle-percentage>{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"[<linear-color-stop> [, <linear-color-hint>]?]# , <linear-color-stop>",combinator:"'>'|'+'|'~'|['||']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>* [<pseudo-element-selector> <pseudo-class-selector>*]*]!","compound-selector-list":"<compound-selector>#","complex-selector":"<compound-selector> [<combinator>? <compound-selector>]*","complex-selector-list":"<complex-selector>#","conic-gradient()":"conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<quote>|<target>|<leader()>|<attr()>|counter( <ident> , <'list-style-type'>? )]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contrast()":"contrast( [<number-percentage>] )","counter()":"counter( <custom-ident> , <counter-style>? )","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <custom-ident> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( <length>{2,3} <color>? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( [<shape-radius>{2}]? [at <position>]? )","ending-shape":"circle|ellipse","env()":"env( <custom-ident> , <declaration-value>? )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","fill-rule":"nonzero|evenodd","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-function-list":"[<filter-function>|<url>]+","final-bg-layer":"<'background-color'>||<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","fit-content()":"fit-content( [<length>|<percentage>] )","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<positive-integer>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|<number [1,1000]>","frequency-percentage":"<frequency>|<percentage>","general-enclosed":"[<function-token> <any-value> )]|( <ident> <any-value> )","generic-family":"serif|sans-serif|cursive|fantasy|monospace|-apple-system","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( <number-percentage> )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )","hsla()":"hsla( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )",hue:"<number>|<angle>","hue-rotate()":"hue-rotate( <angle> )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] <resolution>","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length>|<percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( <number-percentage> )","keyframes-name":"<custom-ident>|<string>","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-block-list":"<keyframe-block>+","keyframe-selector":"from|to|<percentage>","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","line-names":"'[' <custom-ident>* ']'","line-name-list":"[<line-names>|<name-repeat>]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-gradient()":"linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length>|<percentage>|min-content|max-content|auto] , [<length>|<percentage>|<flex>|min-content|max-content|auto] )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|<-non-standard-color>","namespace-prefix":"<ident>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"<an-plus-b>|even|odd","opacity()":"opacity( [<number-percentage>] )","overflow-position":"unsafe|safe","outline-radius":"<length>|<percentage>","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[<page-selector>#]?","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","path()":"path( [<fill-rule> ,]? <string> )","paint()":"paint( <ident> , <declaration-value>? )","perspective()":"perspective( <length> )","polygon()":"polygon( <fill-rule>? , [<length-percentage> <length-percentage>]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-linear-gradient()":"repeating-linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","repeating-radial-gradient()":"repeating-radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","rgb()":"rgb( <percentage>{3} [/ <alpha-value>]? )|rgb( <number>{3} [/ <alpha-value>]? )|rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )","rgba()":"rgba( <percentage>{3} [/ <alpha-value>]? )|rgba( <number>{3} [/ <alpha-value>]? )|rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","saturate()":"saturate( <number-percentage> )","scale()":"scale( <number> , <number>? )","scale3d()":"scale3d( <number> , <number> , <number> )","scaleX()":"scaleX( <number> )","scaleY()":"scaleY( <number> )","scaleZ()":"scaleZ( <number> )","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"<length-percentage>|closest-side|farthest-side","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sepia()":"sepia( <number-percentage> )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","single-animation":"<time>||<timing-function>||<time>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-transition":"[none|<single-transition-property>]||<time>||<timing-function>||<time>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-timing-function":"step-start|step-end|steps( <integer> [, <step-position>]? )","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-decl":"( <declaration> )","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","time-percentage":"<time>|<percentage>","timing-function":"linear|<cubic-bezier-timing-function>|<step-timing-function>","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<positive-integer>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( [<length>|<percentage>] )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","viewport-length":"auto|<length-percentage>","wq-name":"<ns-prefix>? <ident-token>","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-width":"fill-available|min-intrinsic|intrinsic|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content|-webkit-min-content|-webkit-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-webkit-mask-clip-style":"border|border-box|padding|padding-box|content|content-box|text","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )","-ms-filter":"<string>",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>","border-radius":"<length-percentage>{1,2}",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral",left:"<length>|auto","mask-image":"<mask-reference>#","name-repeat":"repeat( [<positive-integer>|auto-fill] , <line-names>+ )",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger",ratio:"<integer> / <integer>",right:"<length>|auto","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto","track-group":"'(' [<string>* <track-minmax> <string>*]+ ')' ['[' <positive-integer> ']']?|<track-minmax>","track-list-v0":"[<string>* <track-group> <string>*]+|none","track-minmax":"minmax( <track-breadth> , <track-breadth> )|auto|<track-breadth>|fit-content",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,∞]>","positive-integer":"<integer [0,∞]>","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zooming":"none|zoom","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"<integer [0,1]>","-moz-image-region":"<shape>|auto","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<'color'>","-webkit-border-before-color":"<'color'>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<box>|border|padding|content|text]||[<box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<box>|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",all:"initial|inherit|unset|revert",animation:"<single-animation>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"<time>#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-timing-function":"<timing-function>#",appearance:"none|auto|textfield|menulist-button|<compat-auto>","aspect-ratio":"auto|<ratio>",azimuth:"<angle>|[[left-side|far-left|left|center-left|center|center-right|right|far-right|right-side]||behind]|leftwards|rightwards","backdrop-filter":"none|<filter-function-list>","backface-visibility":"visible|hidden",background:"[<bg-layer> ,]* <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<box>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","block-overflow":"clip|ellipsis|<string>","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-top-width'>||<'border-top-style'>||<'color'>","border-block-color":"<'border-top-color'>{1,2}","border-block-style":"<'border-top-style'>","border-block-width":"<'border-top-width'>","border-block-end":"<'border-top-width'>||<'border-top-style'>||<'color'>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<'color'>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage>{1,2}","border-bottom-right-radius":"<length-percentage>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"collapse|separate","border-color":"<color>{1,4}","border-end-end-radius":"<length-percentage>{1,2}","border-end-start-radius":"<length-percentage>{1,2}","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length>|<number>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"<number-percentage>{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage>|<number>|auto]{1,4}","border-inline":"<'border-top-width'>||<'border-top-style'>||<'color'>","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<'color'>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-style":"<'border-top-style'>","border-inline-width":"<'border-top-width'>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<'color'>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage>{1,4} [/ <length-percentage>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length> <length>?","border-start-end-radius":"<length-percentage>{1,2}","border-start-start-radius":"<length-percentage>{1,2}","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage>{1,2}","border-top-right-radius":"<length-percentage>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"<length>|<percentage>|auto","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom|block-start|block-end|inline-start|inline-end","caret-color":"auto|<color>",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none",color:"<color>","color-adjust":"economy|exact","column-count":"<integer>|auto","column-fill":"auto|balance|balance-all","column-gap":"normal|<length-percentage>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"<length>|auto",columns:"<'column-width'>||<'column-count'>",contain:"none|strict|content|[size||layout||style||paint]",content:"normal|none|[<content-replacement>|<content-list>] [/ <string>]?","counter-increment":"[<custom-ident> <integer>?]+|none","counter-reset":"[<custom-ident> <integer>?]+|none","counter-set":"[<custom-ident> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","empty-cells":"show|hide",filter:"none|<filter-function-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end",font:"[[<'font-style'>||<font-variant-css21>||<'font-weight'>||<'font-stretch'>]? <'font-size'> [/ <'line-height'>]? <'font-family'>]|caption|icon|menu|message-box|small-caption|status-bar","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-variation-settings":"normal|[<string> <number>]#","font-size":"<absolute-size>|<relative-size>|<length-percentage>","font-size-adjust":"none|<number>","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style]","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-weight":"<font-weight-absolute>|bolder|lighter",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length>|<percentage>|min-content|max-content|fit-content( <length-percentage> )",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>",isolation:"auto|isolate","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"<length>|<percentage>|auto","letter-spacing":"normal|<length-percentage>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<url>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"[<length>|<percentage>|auto]{1,4}","margin-block":"<'margin-left'>{1,2}","margin-block-end":"<'margin-left'>","margin-block-start":"<'margin-left'>","margin-bottom":"<length>|<percentage>|auto","margin-inline":"<'margin-left'>{1,2}","margin-inline-end":"<'margin-left'>","margin-inline-start":"<'margin-left'>","margin-left":"<length>|<percentage>|auto","margin-right":"<length>|<percentage>|auto","margin-top":"<length>|<percentage>|auto","margin-trim":"none|in-flow|all",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<geometry-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<geometry-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage>|min-content|max-content|fit-content( <length-percentage> )","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage>|min-content|max-content|fit-content( <length-percentage> )|<-non-standard-width>","min-block-size":"<'min-width'>","min-height":"auto|<length>|<percentage>|min-content|max-content|fit-content( <length-percentage> )","min-inline-size":"<'min-width'>","min-width":"auto|<length-percentage>|min-content|max-content|fit-content( <length-percentage> )|<-non-standard-width>","mix-blend-mode":"<blend-mode>","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|ray( [<angle>&&<size>&&contain?] )|<path()>|<url>|[<basic-shape>||<geometry-box>]","offset-position":"auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<alpha-value>",order:"<integer>",orphans:"<integer>",outline:"[<'outline-color'>||<'outline-style'>||<'outline-width'>]","outline-color":"<color>|invert","outline-offset":"<length>","outline-style":"auto|<'border-style'>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto","overflow-clip-box":"padding-box|content-box","overflow-inline":"visible|hidden|clip|scroll|auto","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto","overflow-y":"visible|hidden|clip|scroll|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"[<length>|<percentage>]{1,4}","padding-block":"<'padding-left'>{1,2}","padding-block-end":"<'padding-left'>","padding-block-start":"<'padding-left'>","padding-bottom":"<length>|<percentage>","padding-inline":"<'padding-left'>{1,2}","padding-inline-end":"<'padding-left'>","padding-inline-start":"<'padding-left'>","padding-left":"<length>|<percentage>","padding-right":"<length>|<percentage>","padding-top":"<length>|<percentage>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky",quotes:"none|auto|[<string> <string>]+",resize:"none|both|horizontal|vertical|block|inline",right:"<length>|<percentage>|auto",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-position":"over|under|inter-character",scale:"none|<number>{1,3}","scrollbar-color":"auto|dark|light|<color>{2}","scrollbar-gutter":"auto|[stable|always]&&both?&&force?","scrollbar-width":"auto|thin|none","scroll-behavior":"auto|smooth","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-start":"<length>","scroll-margin-block-end":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-start":"<length>","scroll-margin-inline-end":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","shape-image-threshold":"<alpha-value>","shape-margin":"<length-percentage>","shape-outside":"none|<shape-box>||<basic-shape>|<image>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"[over|under]&&[right|left]","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-transform":"none|capitalize|uppercase|lowercase|full-width|full-size-kana","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]",top:"<length>|<percentage>|auto","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<timing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|contain|all","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>",visibility:"visible|hidden|collapse","white-space":"normal|pre|nowrap|pre-wrap|pre-line|break-spaces",widows:"<integer>",width:"auto|<length>|<percentage>|min-content|max-content|fit-content( <length-percentage> )|fit-content|-moz-fit-content|-webkit-fit-content","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word","word-spacing":"normal|<length-percentage>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>","z-index":"auto|<integer>",zoom:"normal|reset|<number>|<percentage>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto","-webkit-user-select":"auto|none|text|all","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical","baseline-shift":"baseline|sub|super|<svg-length>",behavior:"<url>+","clip-rule":"nonzero|evenodd",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge",fill:"<paint>","fill-opacity":"<number-zero-one>","fill-rule":"nonzero|evenodd","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision",src:"[<url> [format( <string># )]?|local( <family-name> )]#",speak:"auto|none|normal","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]",stroke:"<paint>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<number-zero-one>","stroke-width":"<svg-length>","text-anchor":"start|middle|end","unicode-range":"<urange>#","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-face":{prelude:null,descriptors:{"font-display":"[auto|block|swap|fallback|optional]","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-variation-settings":"normal|[<string> <number>]#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-weight":"<font-weight-absolute>{1,2}","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},import:{prelude:"[<string>|<url>] [<media-query-list>]?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]",size:"<length>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},property:{prelude:"<custom-property-name>",descriptors:{syntax:"<string>",inherits:"true|false","initial-value":"<string>"}},supports:{prelude:"<supports-condition>",descriptors:null},viewport:{prelude:null,descriptors:{height:"<viewport-length>{1,2}","max-height":"<viewport-length>","max-width":"<viewport-length>","max-zoom":"auto|<number>|<percentage>","min-height":"<viewport-length>","min-width":"<viewport-length>","min-zoom":"auto|<number>|<percentage>",orientation:"auto|portrait|landscape","user-zoom":"zoom|fixed","viewport-fit":"auto|contain|cover",width:"<viewport-length>{1,2}",zoom:"auto|<number>|<percentage>"}}}},Hi=Sa.cmpChar,Wi=Sa.isDigit,Vi=Sa.TYPE,$i=Vi.WhiteSpace,Yi=Vi.Comment,Gi=Vi.Ident,Ki=Vi.Number,Qi=Vi.Dimension,Ji=43,Zi=45,Xi=110,el=!0;function tl(e,t){var n=this.scanner.tokenStart+e,r=this.scanner.source.charCodeAt(n);for(r!==Ji&&r!==Zi||(t&&this.error("Number sign is not allowed"),n++);n<this.scanner.tokenEnd;n++)Wi(this.scanner.source.charCodeAt(n))||this.error("Integer is expected",n)}function nl(e){return tl.call(this,0,e)}function rl(e,t){if(!Hi(this.scanner.source,this.scanner.tokenStart+e,t)){var n="";switch(t){case Xi:n="N is expected";break;case Zi:n="HyphenMinus is expected"}this.error(n,this.scanner.tokenStart+e)}}function al(){for(var e=0,t=0,n=this.scanner.tokenType;n===$i||n===Yi;)n=this.scanner.lookupType(++e);if(n!==Ki){if(!this.scanner.isDelim(Ji,e)&&!this.scanner.isDelim(Zi,e))return null;t=this.scanner.isDelim(Ji,e)?Ji:Zi;do{n=this.scanner.lookupType(++e)}while(n===$i||n===Yi);n!==Ki&&(this.scanner.skip(e),nl.call(this,el))}return e>0&&this.scanner.skip(e),0===t&&(n=this.scanner.source.charCodeAt(this.scanner.tokenStart))!==Ji&&n!==Zi&&this.error("Number sign is expected"),nl.call(this,0!==t),t===Zi?"-"+this.consume(Ki):this.consume(Ki)}var ol={name:"AnPlusB",structure:{a:[String,null],b:[String,null]},parse:function(){var e=this.scanner.tokenStart,t=null,n=null;if(this.scanner.tokenType===Ki)nl.call(this,false),n=this.consume(Ki);else if(this.scanner.tokenType===Gi&&Hi(this.scanner.source,this.scanner.tokenStart,Zi))switch(t="-1",rl.call(this,1,Xi),this.scanner.getTokenLength()){case 2:this.scanner.next(),n=al.call(this);break;case 3:rl.call(this,2,Zi),this.scanner.next(),this.scanner.skipSC(),nl.call(this,el),n="-"+this.consume(Ki);break;default:rl.call(this,2,Zi),tl.call(this,3,el),this.scanner.next(),n=this.scanner.substrToCursor(e+2)}else if(this.scanner.tokenType===Gi||this.scanner.isDelim(Ji)&&this.scanner.lookupType(1)===Gi){var r=0;switch(t="1",this.scanner.isDelim(Ji)&&(r=1,this.scanner.next()),rl.call(this,0,Xi),this.scanner.getTokenLength()){case 1:this.scanner.next(),n=al.call(this);break;case 2:rl.call(this,1,Zi),this.scanner.next(),this.scanner.skipSC(),nl.call(this,el),n="-"+this.consume(Ki);break;default:rl.call(this,1,Zi),tl.call(this,2,el),this.scanner.next(),n=this.scanner.substrToCursor(e+r+1)}}else if(this.scanner.tokenType===Qi){for(var a=this.scanner.source.charCodeAt(this.scanner.tokenStart),o=(r=a===Ji||a===Zi,this.scanner.tokenStart+r);o<this.scanner.tokenEnd&&Wi(this.scanner.source.charCodeAt(o));o++);o===this.scanner.tokenStart+r&&this.error("Integer is expected",this.scanner.tokenStart+r),rl.call(this,o-this.scanner.tokenStart,Xi),t=this.scanner.source.substring(e,o),o+1===this.scanner.tokenEnd?(this.scanner.next(),n=al.call(this)):(rl.call(this,o-this.scanner.tokenStart+1,Zi),o+2===this.scanner.tokenEnd?(this.scanner.next(),this.scanner.skipSC(),nl.call(this,el),n="-"+this.consume(Ki)):(tl.call(this,o-this.scanner.tokenStart+2,el),this.scanner.next(),n=this.scanner.substrToCursor(o+1)))}else this.error();return null!==t&&t.charCodeAt(0)===Ji&&(t=t.substr(1)),null!==n&&n.charCodeAt(0)===Ji&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.scanner.tokenStart),a:t,b:n}},generate:function(e){var t=null!==e.a&&void 0!==e.a,n=null!==e.b&&void 0!==e.b;t?(this.chunk("+1"===e.a?"+n":"1"===e.a?"n":"-1"===e.a?"-n":e.a+"n"),n&&("-"===(n=String(e.b)).charAt(0)||"+"===n.charAt(0)?(this.chunk(n.charAt(0)),this.chunk(n.substr(1))):(this.chunk("+"),this.chunk(n)))):this.chunk(String(e.b))}},sl=Sa.TYPE,il=sl.WhiteSpace,ll=sl.Semicolon,cl=sl.LeftCurlyBracket,ul=sl.Delim;function hl(){return this.scanner.tokenIndex>0&&this.scanner.lookupType(-1)===il?this.scanner.tokenIndex>1?this.scanner.getTokenStart(this.scanner.tokenIndex-1):this.scanner.firstCharOffset:this.scanner.tokenStart}function dl(){return 0}var pl={name:"Raw",structure:{value:String},parse:function(e,t,n){var r,a=this.scanner.getTokenStart(e);return this.scanner.skip(this.scanner.getRawLength(e,t||dl)),r=n&&this.scanner.tokenStart>a?hl.call(this):this.scanner.tokenStart,{type:"Raw",loc:this.getLocation(a,r),value:this.scanner.source.substring(a,r)}},generate:function(e){this.chunk(e.value)},mode:{default:dl,leftCurlyBracket:function(e){return e===cl?1:0},leftCurlyBracketOrSemicolon:function(e){return e===cl||e===ll?1:0},exclamationMarkOrSemicolon:function(e,t,n){return e===ul&&33===t.charCodeAt(n)||e===ll?1:0},semicolonIncluded:function(e){return e===ll?2:0}}},ml=Sa.TYPE,fl=pl.mode,gl=ml.AtKeyword,yl=ml.Semicolon,bl=ml.LeftCurlyBracket,vl=ml.RightCurlyBracket;function kl(e){return this.Raw(e,fl.leftCurlyBracketOrSemicolon,!0)}function wl(){for(var e,t=1;e=this.scanner.lookupType(t);t++){if(e===vl)return!0;if(e===bl||e===gl)return!1}return!1}var xl={name:"Atrule",structure:{name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]},parse:function(){var e,t,n=this.scanner.tokenStart,r=null,a=null;switch(this.eat(gl),t=(e=this.scanner.substrToCursor(n+1)).toLowerCase(),this.scanner.skipSC(),!1===this.scanner.eof&&this.scanner.tokenType!==bl&&this.scanner.tokenType!==yl&&(this.parseAtrulePrelude?"AtrulePrelude"===(r=this.parseWithFallback(this.AtrulePrelude.bind(this,e),kl)).type&&null===r.children.head&&(r=null):r=kl.call(this,this.scanner.tokenIndex),this.scanner.skipSC()),this.scanner.tokenType){case yl:this.scanner.next();break;case bl:a=this.atrule.hasOwnProperty(t)&&"function"==typeof this.atrule[t].block?this.atrule[t].block.call(this):this.Block(wl.call(this))}return{type:"Atrule",loc:this.getLocation(n,this.scanner.tokenStart),name:e,prelude:r,block:a}},generate:function(e){this.chunk("@"),this.chunk(e.name),null!==e.prelude&&(this.chunk(" "),this.node(e.prelude)),e.block?this.node(e.block):this.chunk(";")},walkContext:"atrule"},Sl=Sa.TYPE,El=Sl.Semicolon,Al=Sl.LeftCurlyBracket,Tl={name:"AtrulePrelude",structure:{children:[[]]},parse:function(e){var t=null;return null!==e&&(e=e.toLowerCase()),this.scanner.skipSC(),t=this.atrule.hasOwnProperty(e)&&"function"==typeof this.atrule[e].prelude?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.scanner.skipSC(),!0!==this.scanner.eof&&this.scanner.tokenType!==Al&&this.scanner.tokenType!==El&&this.error("Semicolon or block is expected"),null===t&&(t=this.createList()),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}},generate:function(e){this.children(e)},walkContext:"atrulePrelude"},Cl=Sa.TYPE,Rl=Cl.Ident,_l=Cl.String,Il=Cl.Colon,Ll=Cl.LeftSquareBracket,Pl=Cl.RightSquareBracket;function Nl(){this.scanner.eof&&this.error("Unexpected end of input");var e=this.scanner.tokenStart,t=!1,n=!0;return this.scanner.isDelim(42)?(t=!0,n=!1,this.scanner.next()):this.scanner.isDelim(124)||this.eat(Rl),this.scanner.isDelim(124)?61!==this.scanner.source.charCodeAt(this.scanner.tokenStart+1)?(this.scanner.next(),this.eat(Rl)):t&&this.error("Identifier is expected",this.scanner.tokenEnd):t&&this.error("Vertical line is expected"),n&&this.scanner.tokenType===Il&&(this.scanner.next(),this.eat(Rl)),{type:"Identifier",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e)}}function zl(){var e=this.scanner.tokenStart,t=this.scanner.source.charCodeAt(e);return 61!==t&&126!==t&&94!==t&&36!==t&&42!==t&&124!==t&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.scanner.next(),61!==t&&(this.scanner.isDelim(61)||this.error("Equal sign is expected"),this.scanner.next()),this.scanner.substrToCursor(e)}var Ml={name:"AttributeSelector",structure:{name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]},parse:function(){var e,t=this.scanner.tokenStart,n=null,r=null,a=null;return this.eat(Ll),this.scanner.skipSC(),e=Nl.call(this),this.scanner.skipSC(),this.scanner.tokenType!==Pl&&(this.scanner.tokenType!==Rl&&(n=zl.call(this),this.scanner.skipSC(),r=this.scanner.tokenType===_l?this.String():this.Identifier(),this.scanner.skipSC()),this.scanner.tokenType===Rl&&(a=this.scanner.getTokenValue(),this.scanner.next(),this.scanner.skipSC())),this.eat(Pl),{type:"AttributeSelector",loc:this.getLocation(t,this.scanner.tokenStart),name:e,matcher:n,value:r,flags:a}},generate:function(e){var t=" ";this.chunk("["),this.node(e.name),null!==e.matcher&&(this.chunk(e.matcher),null!==e.value&&(this.node(e.value),"String"===e.value.type&&(t=""))),null!==e.flags&&(this.chunk(t),this.chunk(e.flags)),this.chunk("]")}},Dl=Sa.TYPE,Ol=pl.mode,Ul=Dl.WhiteSpace,Fl=Dl.Comment,Bl=Dl.Semicolon,ql=Dl.AtKeyword,jl=Dl.LeftCurlyBracket,Hl=Dl.RightCurlyBracket;function Wl(e){return this.Raw(e,null,!0)}function Vl(){return this.parseWithFallback(this.Rule,Wl)}function $l(e){return this.Raw(e,Ol.semicolonIncluded,!0)}function Yl(){if(this.scanner.tokenType===Bl)return $l.call(this,this.scanner.tokenIndex);var e=this.parseWithFallback(this.Declaration,$l);return this.scanner.tokenType===Bl&&this.scanner.next(),e}var Gl={name:"Block",structure:{children:[["Atrule","Rule","Declaration"]]},parse:function(e){var t=e?Yl:Vl,n=this.scanner.tokenStart,r=this.createList();this.eat(jl);e:for(;!this.scanner.eof;)switch(this.scanner.tokenType){case Hl:break e;case Ul:case Fl:this.scanner.next();break;case ql:r.push(this.parseWithFallback(this.Atrule,Wl));break;default:r.push(t.call(this))}return this.scanner.eof||this.eat(Hl),{type:"Block",loc:this.getLocation(n,this.scanner.tokenStart),children:r}},generate:function(e){this.chunk("{"),this.children(e,(function(e){"Declaration"===e.type&&this.chunk(";")})),this.chunk("}")},walkContext:"block"},Kl=Sa.TYPE,Ql=Kl.LeftSquareBracket,Jl=Kl.RightSquareBracket,Zl={name:"Brackets",structure:{children:[[]]},parse:function(e,t){var n,r=this.scanner.tokenStart;return this.eat(Ql),n=e.call(this,t),this.scanner.eof||this.eat(Jl),{type:"Brackets",loc:this.getLocation(r,this.scanner.tokenStart),children:n}},generate:function(e){this.chunk("["),this.children(e),this.chunk("]")}},Xl=Sa.TYPE.CDC,ec={name:"CDC",structure:[],parse:function(){var e=this.scanner.tokenStart;return this.eat(Xl),{type:"CDC",loc:this.getLocation(e,this.scanner.tokenStart)}},generate:function(){this.chunk("--\x3e")}},tc=Sa.TYPE.CDO,nc={name:"CDO",structure:[],parse:function(){var e=this.scanner.tokenStart;return this.eat(tc),{type:"CDO",loc:this.getLocation(e,this.scanner.tokenStart)}},generate:function(){this.chunk("\x3c!--")}},rc=Sa.TYPE.Ident,ac={name:"ClassSelector",structure:{name:String},parse:function(){return this.scanner.isDelim(46)||this.error("Full stop is expected"),this.scanner.next(),{type:"ClassSelector",loc:this.getLocation(this.scanner.tokenStart-1,this.scanner.tokenEnd),name:this.consume(rc)}},generate:function(e){this.chunk("."),this.chunk(e.name)}},oc=Sa.TYPE.Ident,sc={name:"Combinator",structure:{name:String},parse:function(){var e=this.scanner.tokenStart;switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case 62:case 43:case 126:this.scanner.next();break;case 47:this.scanner.next(),this.scanner.tokenType===oc&&!1!==this.scanner.lookupValue(0,"deep")||this.error("Identifier `deep` is expected"),this.scanner.next(),this.scanner.isDelim(47)||this.error("Solidus is expected"),this.scanner.next();break;default:this.error("Combinator is expected")}return{type:"Combinator",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.name)}},ic=Sa.TYPE.Comment,lc={name:"Comment",structure:{value:String},parse:function(){var e=this.scanner.tokenStart,t=this.scanner.tokenEnd;return this.eat(ic),t-e+2>=2&&42===this.scanner.source.charCodeAt(t-2)&&47===this.scanner.source.charCodeAt(t-1)&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.source.substring(e+2,t)}},generate:function(e){this.chunk("/*"),this.chunk(e.value),this.chunk("*/")}},cc=na.isCustomProperty,uc=Sa.TYPE,hc=pl.mode,dc=uc.Ident,pc=uc.Hash,mc=uc.Colon,fc=uc.Semicolon,gc=uc.Delim,yc=uc.WhiteSpace;function bc(e){return this.Raw(e,hc.exclamationMarkOrSemicolon,!0)}function vc(e){return this.Raw(e,hc.exclamationMarkOrSemicolon,!1)}function kc(){var e=this.scanner.tokenIndex,t=this.Value();return"Raw"!==t.type&&!1===this.scanner.eof&&this.scanner.tokenType!==fc&&!1===this.scanner.isDelim(33)&&!1===this.scanner.isBalanceEdge(e)&&this.error(),t}var wc={name:"Declaration",structure:{important:[Boolean,String],property:String,value:["Value","Raw"]},parse:function(){var e,t=this.scanner.tokenStart,n=this.scanner.tokenIndex,r=xc.call(this),a=cc(r),o=a?this.parseCustomProperty:this.parseValue,s=a?vc:bc,i=!1;this.scanner.skipSC(),this.eat(mc);const l=this.scanner.tokenIndex;if(a||this.scanner.skipSC(),e=o?this.parseWithFallback(kc,s):s.call(this,this.scanner.tokenIndex),a&&"Value"===e.type&&e.children.isEmpty())for(let t=l-this.scanner.tokenIndex;t<=0;t++)if(this.scanner.lookupType(t)===yc){e.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}return this.scanner.isDelim(33)&&(i=Sc.call(this),this.scanner.skipSC()),!1===this.scanner.eof&&this.scanner.tokenType!==fc&&!1===this.scanner.isBalanceEdge(n)&&this.error(),{type:"Declaration",loc:this.getLocation(t,this.scanner.tokenStart),important:i,property:r,value:e}},generate:function(e){this.chunk(e.property),this.chunk(":"),this.node(e.value),e.important&&this.chunk(!0===e.important?"!important":"!"+e.important)},walkContext:"declaration"};function xc(){var e=this.scanner.tokenStart;if(this.scanner.tokenType===gc)switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.scanner.next();break;case 47:this.scanner.next(),this.scanner.isDelim(47)&&this.scanner.next()}return this.scanner.tokenType===pc?this.eat(pc):this.eat(dc),this.scanner.substrToCursor(e)}function Sc(){this.eat(gc),this.scanner.skipSC();var e=this.consume(dc);return"important"===e||e}var Ec=Sa.TYPE,Ac=pl.mode,Tc=Ec.WhiteSpace,Cc=Ec.Comment,Rc=Ec.Semicolon;function _c(e){return this.Raw(e,Ac.semicolonIncluded,!0)}var Ic={name:"DeclarationList",structure:{children:[["Declaration"]]},parse:function(){for(var e=this.createList();!this.scanner.eof;)switch(this.scanner.tokenType){case Tc:case Cc:case Rc:this.scanner.next();break;default:e.push(this.parseWithFallback(this.Declaration,_c))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e,(function(e){"Declaration"===e.type&&this.chunk(";")}))}},Lc=Pr.consumeNumber,Pc=Sa.TYPE.Dimension,Nc={name:"Dimension",structure:{value:String,unit:String},parse:function(){var e=this.scanner.tokenStart,t=Lc(this.scanner.source,e);return this.eat(Pc),{type:"Dimension",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.source.substring(e,t),unit:this.scanner.source.substring(t,this.scanner.tokenStart)}},generate:function(e){this.chunk(e.value),this.chunk(e.unit)}},zc=Sa.TYPE.RightParenthesis,Mc={name:"Function",structure:{name:String,children:[[]]},parse:function(e,t){var n,r=this.scanner.tokenStart,a=this.consumeFunctionName(),o=a.toLowerCase();return n=t.hasOwnProperty(o)?t[o].call(this,t):e.call(this,t),this.scanner.eof||this.eat(zc),{type:"Function",loc:this.getLocation(r,this.scanner.tokenStart),name:a,children:n}},generate:function(e){this.chunk(e.name),this.chunk("("),this.children(e),this.chunk(")")},walkContext:"function"},Dc=Sa.TYPE.Hash,Oc={name:"Hash",structure:{value:String},parse:function(){var e=this.scanner.tokenStart;return this.eat(Dc),{type:"Hash",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.substrToCursor(e+1)}},generate:function(e){this.chunk("#"),this.chunk(e.value)}},Uc=Sa.TYPE.Ident,Fc={name:"Identifier",structure:{name:String},parse:function(){return{type:"Identifier",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),name:this.consume(Uc)}},generate:function(e){this.chunk(e.name)}},Bc=Sa.TYPE.Hash,qc={name:"IdSelector",structure:{name:String},parse:function(){var e=this.scanner.tokenStart;return this.eat(Bc),{type:"IdSelector",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e+1)}},generate:function(e){this.chunk("#"),this.chunk(e.name)}},jc=Sa.TYPE,Hc=jc.Ident,Wc=jc.Number,Vc=jc.Dimension,$c=jc.LeftParenthesis,Yc=jc.RightParenthesis,Gc=jc.Colon,Kc=jc.Delim,Qc={name:"MediaFeature",structure:{name:String,value:["Identifier","Number","Dimension","Ratio",null]},parse:function(){var e,t=this.scanner.tokenStart,n=null;if(this.eat($c),this.scanner.skipSC(),e=this.consume(Hc),this.scanner.skipSC(),this.scanner.tokenType!==Yc){switch(this.eat(Gc),this.scanner.skipSC(),this.scanner.tokenType){case Wc:n=this.lookupNonWSType(1)===Kc?this.Ratio():this.Number();break;case Vc:n=this.Dimension();break;case Hc:n=this.Identifier();break;default:this.error("Number, dimension, ratio or identifier is expected")}this.scanner.skipSC()}return this.eat(Yc),{type:"MediaFeature",loc:this.getLocation(t,this.scanner.tokenStart),name:e,value:n}},generate:function(e){this.chunk("("),this.chunk(e.name),null!==e.value&&(this.chunk(":"),this.node(e.value)),this.chunk(")")}},Jc=Sa.TYPE,Zc=Jc.WhiteSpace,Xc=Jc.Comment,eu=Jc.Ident,tu=Jc.LeftParenthesis,nu={name:"MediaQuery",structure:{children:[["Identifier","MediaFeature","WhiteSpace"]]},parse:function(){this.scanner.skipSC();var e=this.createList(),t=null,n=null;e:for(;!this.scanner.eof;){switch(this.scanner.tokenType){case Xc:this.scanner.next();continue;case Zc:n=this.WhiteSpace();continue;case eu:t=this.Identifier();break;case tu:t=this.MediaFeature();break;default:break e}null!==n&&(e.push(n),n=null),e.push(t)}return null===t&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e)}},ru=Sa.TYPE.Comma,au={name:"MediaQueryList",structure:{children:[["MediaQuery"]]},parse:function(e){var t=this.createList();for(this.scanner.skipSC();!this.scanner.eof&&(t.push(this.MediaQuery(e)),this.scanner.tokenType===ru);)this.scanner.next();return{type:"MediaQueryList",loc:this.getLocationFromList(t),children:t}},generate:function(e){this.children(e,(function(){this.chunk(",")}))}},ou=Sa.TYPE.Number,su={name:"Number",structure:{value:String},parse:function(){return{type:"Number",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),value:this.consume(ou)}},generate:function(e){this.chunk(e.value)}},iu={name:"Operator",structure:{value:String},parse:function(){var e=this.scanner.tokenStart;return this.scanner.next(),{type:"Operator",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.value)}},lu=Sa.TYPE,cu=lu.LeftParenthesis,uu=lu.RightParenthesis,hu={name:"Parentheses",structure:{children:[[]]},parse:function(e,t){var n,r=this.scanner.tokenStart;return this.eat(cu),n=e.call(this,t),this.scanner.eof||this.eat(uu),{type:"Parentheses",loc:this.getLocation(r,this.scanner.tokenStart),children:n}},generate:function(e){this.chunk("("),this.children(e),this.chunk(")")}},du=Pr.consumeNumber,pu=Sa.TYPE.Percentage,mu={name:"Percentage",structure:{value:String},parse:function(){var e=this.scanner.tokenStart,t=du(this.scanner.source,e);return this.eat(pu),{type:"Percentage",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.source.substring(e,t)}},generate:function(e){this.chunk(e.value),this.chunk("%")}},fu=Sa.TYPE,gu=fu.Ident,yu=fu.Function,bu=fu.Colon,vu=fu.RightParenthesis,ku={name:"PseudoClassSelector",structure:{name:String,children:[["Raw"],null]},parse:function(){var e,t,n=this.scanner.tokenStart,r=null;return this.eat(bu),this.scanner.tokenType===yu?(t=(e=this.consumeFunctionName()).toLowerCase(),this.pseudo.hasOwnProperty(t)?(this.scanner.skipSC(),r=this.pseudo[t].call(this),this.scanner.skipSC()):(r=this.createList()).push(this.Raw(this.scanner.tokenIndex,null,!1)),this.eat(vu)):e=this.consume(gu),{type:"PseudoClassSelector",loc:this.getLocation(n,this.scanner.tokenStart),name:e,children:r}},generate:function(e){this.chunk(":"),this.chunk(e.name),null!==e.children&&(this.chunk("("),this.children(e),this.chunk(")"))},walkContext:"function"},wu=Sa.TYPE,xu=wu.Ident,Su=wu.Function,Eu=wu.Colon,Au=wu.RightParenthesis,Tu={name:"PseudoElementSelector",structure:{name:String,children:[["Raw"],null]},parse:function(){var e,t,n=this.scanner.tokenStart,r=null;return this.eat(Eu),this.eat(Eu),this.scanner.tokenType===Su?(t=(e=this.consumeFunctionName()).toLowerCase(),this.pseudo.hasOwnProperty(t)?(this.scanner.skipSC(),r=this.pseudo[t].call(this),this.scanner.skipSC()):(r=this.createList()).push(this.Raw(this.scanner.tokenIndex,null,!1)),this.eat(Au)):e=this.consume(xu),{type:"PseudoElementSelector",loc:this.getLocation(n,this.scanner.tokenStart),name:e,children:r}},generate:function(e){this.chunk("::"),this.chunk(e.name),null!==e.children&&(this.chunk("("),this.children(e),this.chunk(")"))},walkContext:"function"},Cu=Sa.isDigit,Ru=Sa.TYPE,_u=Ru.Number,Iu=Ru.Delim;function Lu(){this.scanner.skipWS();for(var e=this.consume(_u),t=0;t<e.length;t++){var n=e.charCodeAt(t);Cu(n)||46===n||this.error("Unsigned number is expected",this.scanner.tokenStart-e.length+t)}return 0===Number(e)&&this.error("Zero number is not allowed",this.scanner.tokenStart-e.length),e}var Pu={name:"Ratio",structure:{left:String,right:String},parse:function(){var e,t=this.scanner.tokenStart,n=Lu.call(this);return this.scanner.skipWS(),this.scanner.isDelim(47)||this.error("Solidus is expected"),this.eat(Iu),e=Lu.call(this),{type:"Ratio",loc:this.getLocation(t,this.scanner.tokenStart),left:n,right:e}},generate:function(e){this.chunk(e.left),this.chunk("/"),this.chunk(e.right)}},Nu=Sa.TYPE,zu=pl.mode,Mu=Nu.LeftCurlyBracket;function Du(e){return this.Raw(e,zu.leftCurlyBracket,!0)}function Ou(){var e=this.SelectorList();return"Raw"!==e.type&&!1===this.scanner.eof&&this.scanner.tokenType!==Mu&&this.error(),e}var Uu={name:"Rule",structure:{prelude:["SelectorList","Raw"],block:["Block"]},parse:function(){var e,t,n=this.scanner.tokenIndex,r=this.scanner.tokenStart;return e=this.parseRulePrelude?this.parseWithFallback(Ou,Du):Du.call(this,n),t=this.Block(!0),{type:"Rule",loc:this.getLocation(r,this.scanner.tokenStart),prelude:e,block:t}},generate:function(e){this.node(e.prelude),this.node(e.block)},walkContext:"rule"},Fu=Sa.TYPE.Comma,Bu={name:"SelectorList",structure:{children:[["Selector","Raw"]]},parse:function(){for(var e=this.createList();!this.scanner.eof&&(e.push(this.Selector()),this.scanner.tokenType===Fu);)this.scanner.next();return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e,(function(){this.chunk(",")}))},walkContext:"selector"},qu=Sa.TYPE.String,ju={name:"String",structure:{value:String},parse:function(){return{type:"String",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),value:this.consume(qu)}},generate:function(e){this.chunk(e.value)}},Hu=Sa.TYPE,Wu=Hu.WhiteSpace,Vu=Hu.Comment,$u=Hu.AtKeyword,Yu=Hu.CDO,Gu=Hu.CDC;function Ku(e){return this.Raw(e,null,!1)}var Qu={name:"StyleSheet",structure:{children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]},parse:function(){for(var e,t=this.scanner.tokenStart,n=this.createList();!this.scanner.eof;){switch(this.scanner.tokenType){case Wu:this.scanner.next();continue;case Vu:if(33!==this.scanner.source.charCodeAt(this.scanner.tokenStart+2)){this.scanner.next();continue}e=this.Comment();break;case Yu:e=this.CDO();break;case Gu:e=this.CDC();break;case $u:e=this.parseWithFallback(this.Atrule,Ku);break;default:e=this.parseWithFallback(this.Rule,Ku)}n.push(e)}return{type:"StyleSheet",loc:this.getLocation(t,this.scanner.tokenStart),children:n}},generate:function(e){this.children(e)},walkContext:"stylesheet"},Ju=Sa.TYPE.Ident;function Zu(){this.scanner.tokenType!==Ju&&!1===this.scanner.isDelim(42)&&this.error("Identifier or asterisk is expected"),this.scanner.next()}var Xu={name:"TypeSelector",structure:{name:String},parse:function(){var e=this.scanner.tokenStart;return this.scanner.isDelim(124)?(this.scanner.next(),Zu.call(this)):(Zu.call(this),this.scanner.isDelim(124)&&(this.scanner.next(),Zu.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.name)}},eh=Sa.isHexDigit,th=Sa.cmpChar,nh=Sa.TYPE,rh=Sa.NAME,ah=nh.Ident,oh=nh.Number,sh=nh.Dimension;function ih(e,t){for(var n=this.scanner.tokenStart+e,r=0;n<this.scanner.tokenEnd;n++){var a=this.scanner.source.charCodeAt(n);if(45===a&&t&&0!==r)return 0===ih.call(this,e+r+1,!1)&&this.error(),-1;eh(a)||this.error(t&&0!==r?"HyphenMinus"+(r<6?" or hex digit":"")+" is expected":r<6?"Hex digit is expected":"Unexpected input",n),++r>6&&this.error("Too many hex digits",n)}return this.scanner.next(),r}function lh(e){for(var t=0;this.scanner.isDelim(63);)++t>e&&this.error("Too many question marks"),this.scanner.next()}function ch(e){this.scanner.source.charCodeAt(this.scanner.tokenStart)!==e&&this.error(rh[e]+" is expected")}function uh(){var e=0;return this.scanner.isDelim(43)?(this.scanner.next(),this.scanner.tokenType===ah?void((e=ih.call(this,0,!0))>0&&lh.call(this,6-e)):this.scanner.isDelim(63)?(this.scanner.next(),void lh.call(this,5)):void this.error("Hex digit or question mark is expected")):this.scanner.tokenType===oh?(ch.call(this,43),e=ih.call(this,1,!0),this.scanner.isDelim(63)?void lh.call(this,6-e):this.scanner.tokenType===sh||this.scanner.tokenType===oh?(ch.call(this,45),void ih.call(this,1,!1)):void 0):this.scanner.tokenType===sh?(ch.call(this,43),void((e=ih.call(this,1,!0))>0&&lh.call(this,6-e))):void this.error()}var hh={name:"UnicodeRange",structure:{value:String},parse:function(){var e=this.scanner.tokenStart;return th(this.scanner.source,e,117)||this.error("U is expected"),th(this.scanner.source,e+1,43)||this.error("Plus sign is expected"),this.scanner.next(),uh.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.value)}},dh=Sa.isWhiteSpace,ph=Sa.cmpStr,mh=Sa.TYPE,fh=mh.Function,gh=mh.Url,yh=mh.RightParenthesis,bh={name:"Url",structure:{value:["String","Raw"]},parse:function(){var e,t=this.scanner.tokenStart;switch(this.scanner.tokenType){case gh:for(var n=t+4,r=this.scanner.tokenEnd-1;n<r&&dh(this.scanner.source.charCodeAt(n));)n++;for(;n<r&&dh(this.scanner.source.charCodeAt(r-1));)r--;e={type:"Raw",loc:this.getLocation(n,r),value:this.scanner.source.substring(n,r)},this.eat(gh);break;case fh:ph(this.scanner.source,this.scanner.tokenStart,this.scanner.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(fh),this.scanner.skipSC(),e=this.String(),this.scanner.skipSC(),this.eat(yh);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(t,this.scanner.tokenStart),value:e}},generate:function(e){this.chunk("url"),this.chunk("("),this.node(e.value),this.chunk(")")}},vh=Sa.TYPE.WhiteSpace,kh=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),wh={AnPlusB:ol,Atrule:xl,AtrulePrelude:Tl,AttributeSelector:Ml,Block:Gl,Brackets:Zl,CDC:ec,CDO:nc,ClassSelector:ac,Combinator:sc,Comment:lc,Declaration:wc,DeclarationList:Ic,Dimension:Nc,Function:Mc,Hash:Oc,Identifier:Fc,IdSelector:qc,MediaFeature:Qc,MediaQuery:nu,MediaQueryList:au,Nth:{name:"Nth",structure:{nth:["AnPlusB","Identifier"],selector:["SelectorList",null]},parse:function(e){this.scanner.skipSC();var t,n=this.scanner.tokenStart,r=n,a=null;return t=this.scanner.lookupValue(0,"odd")||this.scanner.lookupValue(0,"even")?this.Identifier():this.AnPlusB(),this.scanner.skipSC(),e&&this.scanner.lookupValue(0,"of")?(this.scanner.next(),a=this.SelectorList(),this.needPositions&&(r=this.getLastListNode(a.children).loc.end.offset)):this.needPositions&&(r=t.loc.end.offset),{type:"Nth",loc:this.getLocation(n,r),nth:t,selector:a}},generate:function(e){this.node(e.nth),null!==e.selector&&(this.chunk(" of "),this.node(e.selector))}},Number:su,Operator:iu,Parentheses:hu,Percentage:mu,PseudoClassSelector:ku,PseudoElementSelector:Tu,Ratio:Pu,Raw:pl,Rule:Uu,Selector:{name:"Selector",structure:{children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]},parse:function(){var e=this.readSequence(this.scope.Selector);return null===this.getFirstListNode(e)&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e)}},SelectorList:Bu,String:ju,StyleSheet:Qu,TypeSelector:Xu,UnicodeRange:hh,Url:bh,Value:{name:"Value",structure:{children:[[]]},parse:function(){var e=this.scanner.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.scanner.tokenStart),children:t}},generate:function(e){this.children(e)}},WhiteSpace:{name:"WhiteSpace",structure:{value:String},parse:function(){return this.eat(vh),kh},generate:function(e){this.chunk(e.value)}}},xh={generic:!0,types:ji.types,atrules:ji.atrules,properties:ji.properties,node:wh},Sh=Sa.cmpChar,Eh=Sa.cmpStr,Ah=Sa.TYPE,Th=Ah.Ident,Ch=Ah.String,Rh=Ah.Number,_h=Ah.Function,Ih=Ah.Url,Lh=Ah.Hash,Ph=Ah.Dimension,Nh=Ah.Percentage,zh=Ah.LeftParenthesis,Mh=Ah.LeftSquareBracket,Dh=Ah.Comma,Oh=Ah.Delim,Uh=function(e){switch(this.scanner.tokenType){case Lh:return this.Hash();case Dh:return e.space=null,e.ignoreWSAfter=!0,this.Operator();case zh:return this.Parentheses(this.readSequence,e.recognizer);case Mh:return this.Brackets(this.readSequence,e.recognizer);case Ch:return this.String();case Ph:return this.Dimension();case Nh:return this.Percentage();case Rh:return this.Number();case _h:return Eh(this.scanner.source,this.scanner.tokenStart,this.scanner.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case Ih:return this.Url();case Th:return Sh(this.scanner.source,this.scanner.tokenStart,117)&&Sh(this.scanner.source,this.scanner.tokenStart+1,43)?this.UnicodeRange():this.Identifier();case Oh:var t=this.scanner.source.charCodeAt(this.scanner.tokenStart);if(47===t||42===t||43===t||45===t)return this.Operator();35===t&&this.error("Hex or identifier is expected",this.scanner.tokenStart+1)}},Fh={getNode:Uh},Bh=Sa.TYPE,qh=Bh.Delim,jh=Bh.Ident,Hh=Bh.Dimension,Wh=Bh.Percentage,Vh=Bh.Number,$h=Bh.Hash,Yh=Bh.Colon,Gh=Bh.LeftSquareBracket;var Kh={getNode:function(e){switch(this.scanner.tokenType){case Gh:return this.AttributeSelector();case $h:return this.IdSelector();case Yh:return this.scanner.lookupType(1)===Yh?this.PseudoElementSelector():this.PseudoClassSelector();case jh:return this.TypeSelector();case Vh:case Wh:return this.Percentage();case Hh:46===this.scanner.source.charCodeAt(this.scanner.tokenStart)&&this.error("Identifier is expected",this.scanner.tokenStart+1);break;case qh:switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case 43:case 62:case 126:return e.space=null,e.ignoreWSAfter=!0,this.Combinator();case 47:return this.Combinator();case 46:return this.ClassSelector();case 42:case 124:return this.TypeSelector();case 35:return this.IdSelector()}}}},Qh=Sa.TYPE,Jh=pl.mode,Zh=Qh.Comma,Xh=Qh.WhiteSpace,ed={AtrulePrelude:Fh,Selector:Kh,Value:{getNode:Uh,expression:function(){return this.createSingleNodeList(this.Raw(this.scanner.tokenIndex,null,!1))},var:function(){var e=this.createList();if(this.scanner.skipSC(),e.push(this.Identifier()),this.scanner.skipSC(),this.scanner.tokenType===Zh){e.push(this.Operator());const t=this.scanner.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.scanner.tokenIndex,Jh.exclamationMarkOrSemicolon,!1);if("Value"===n.type&&n.children.isEmpty())for(let e=t-this.scanner.tokenIndex;e<=0;e++)if(this.scanner.lookupType(e)===Xh){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}e.push(n)}return e}}},td=Sa.TYPE,nd=td.String,rd=td.Ident,ad=td.Url,od=td.Function,sd=td.LeftParenthesis,id={parse:{prelude:function(){var e=this.createList();switch(this.scanner.skipSC(),this.scanner.tokenType){case nd:e.push(this.String());break;case ad:case od:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.lookupNonWSType(0)!==rd&&this.lookupNonWSType(0)!==sd||(e.push(this.WhiteSpace()),e.push(this.MediaQueryList())),e},block:null}},ld=Sa.TYPE,cd=ld.WhiteSpace,ud=ld.Comment,hd=ld.Ident,dd=ld.Function,pd=ld.Colon,md=ld.LeftParenthesis;function fd(){return this.createSingleNodeList(this.Raw(this.scanner.tokenIndex,null,!1))}function gd(){return this.scanner.skipSC(),this.scanner.tokenType===hd&&this.lookupNonWSType(1)===pd?this.createSingleNodeList(this.Declaration()):yd.call(this)}function yd(){var e,t=this.createList(),n=null;this.scanner.skipSC();e:for(;!this.scanner.eof;){switch(this.scanner.tokenType){case cd:n=this.WhiteSpace();continue;case ud:this.scanner.next();continue;case dd:e=this.Function(fd,this.scope.AtrulePrelude);break;case hd:e=this.Identifier();break;case md:e=this.Parentheses(gd,this.scope.AtrulePrelude);break;default:break e}null!==n&&(t.push(n),n=null),t.push(e)}return t}var bd,vd={parse:function(){return this.createSingleNodeList(this.SelectorList())}},kd={parse:function(){return this.createSingleNodeList(this.Nth(true))}},wd={parse:function(){return this.createSingleNodeList(this.Nth(false))}},xd={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude:function(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",rule:"Rule",selectorList:"SelectorList",selector:"Selector",block:function(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},scope:ed,atrule:{"font-face":{parse:{prelude:null,block:function(){return this.Block(!0)}}},import:id,media:{parse:{prelude:function(){return this.createSingleNodeList(this.MediaQueryList())},block:function(){return this.Block(!1)}}},page:{parse:{prelude:function(){return this.createSingleNodeList(this.SelectorList())},block:function(){return this.Block(!0)}}},supports:{parse:{prelude:function(){var e=yd.call(this);return null===this.getFirstListNode(e)&&this.error("Condition is expected"),e},block:function(){return this.Block(!1)}}}},pseudo:{dir:{parse:function(){return this.createSingleNodeList(this.Identifier())}},has:{parse:function(){return this.createSingleNodeList(this.SelectorList())}},lang:{parse:function(){return this.createSingleNodeList(this.Identifier())}},matches:vd,not:vd,"nth-child":kd,"nth-last-child":kd,"nth-last-of-type":wd,"nth-of-type":wd,slotted:{parse:function(){return this.createSingleNodeList(this.Selector())}}},node:wh},Sd={node:wh},Ed="1.1.3",Ad={version:Ed},Td=(bd=Object.freeze({__proto__:null,version:Ed,default:Ad}))&&bd.default||bd;var Cd=qi(function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}(xh,xd,Sd)),Rd=Td.version;Cd.version=Rd;var _d=Cd;const Id=_d.generate,Ld=_d.parse;var Pd=Object.freeze({__proto__:null,generate:Id,parse:Ld});function Nd(e){function t(e){return" "===e||"\t"===e||"\n"===e||"\f"===e||"\r"===e}function n(t){let n;const r=t.exec(e.substring(f));if(r)return n=r[0],f+=n.length,n}const r=e.length,a=/^[ \t\n\r\u000c]+/,o=/^[, \t\n\r\u000c]+/,s=/^[^ \t\n\r\u000c]+/,i=/[,]+$/,l=/^\d+$/,c=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;let u,h,d,p,m,f=0;const g=[];for(;;){if(n(o),f>=r)return g;u=n(s),h=[],","===u.slice(-1)?(u=u.replace(i,""),b()):y()}function y(){for(n(a),d="",p="in descriptor";;){if(m=e.charAt(f),"in descriptor"===p)if(t(m))d&&(h.push(d),d="",p="after descriptor");else{if(","===m)return f+=1,d&&h.push(d),void b();if("("===m)d+=m,p="in parens";else{if(""===m)return d&&h.push(d),void b();d+=m}}else if("in parens"===p)if(")"===m)d+=m,p="in descriptor";else{if(""===m)return h.push(d),void b();d+=m}else if("after descriptor"===p)if(t(m));else{if(""===m)return void b();p="in descriptor",f-=1}f+=1}}function b(){let t,n,r,a,o,s,i,d,p,m=!1;const f={};for(a=0;a<h.length;a++)o=h[a],s=o[o.length-1],i=o.substring(0,o.length-1),d=parseInt(i,10),p=parseFloat(i),l.test(i)&&"w"===s?((t||n)&&(m=!0),0===d?m=!0:t=d):c.test(i)&&"x"===s?((t||n||r)&&(m=!0),p<0?m=!0:n=p):l.test(i)&&"h"===s?((r||n)&&(m=!0),0===d?m=!0:r=d):m=!0;m?console&&console.log&&console.log('Invalid srcset descriptor found in "'+e+'" at "'+o+'".'):(f.url=u,t&&(f.w=t),n&&(f.d=n),r&&(f.h=r),g.push(f))}}var zd=Object.freeze({__proto__:null,process:Nd});let Md,Dd,Od,Ud;Md={},Md.removeLeadingAndTrailingHTTPWhitespace=e=>e.replace(/^[ \t\n\r]+/,"").replace(/[ \t\n\r]+$/,""),Md.removeTrailingHTTPWhitespace=e=>e.replace(/[ \t\n\r]+$/,""),Md.isHTTPWhitespaceChar=e=>" "===e||"\t"===e||"\n"===e||"\r"===e,Md.solelyContainsHTTPTokenCodePoints=e=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/.test(e),Md.soleyContainsHTTPQuotedStringTokenCodePoints=e=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/.test(e),Md.asciiLowercase=e=>e.replace(/[A-Z]/g,(e=>e.toLowerCase())),Md.collectAnHTTPQuotedString=(e,t)=>{let n="";for(t++;;){for(;t<e.length&&'"'!==e[t]&&"\\"!==e[t];)n+=e[t],++t;if(t>=e.length)break;const r=e[t];if(++t,"\\"!==r)break;if(t>=e.length){n+="\\";break}n+=e[t],++t}return[n,t]};{const{solelyContainsHTTPTokenCodePoints:e}=Md;Od=t=>{let n=`${t.type}/${t.subtype}`;if(0===t.parameters.size)return n;for(let[r,a]of t.parameters)n+=";",n+=r,n+="=",e(a)&&0!==a.length||(a=a.replace(/(["\\])/g,"\\$1"),a=`"${a}"`),n+=a;return n}}{const{removeLeadingAndTrailingHTTPWhitespace:e,removeTrailingHTTPWhitespace:t,isHTTPWhitespaceChar:n,solelyContainsHTTPTokenCodePoints:r,soleyContainsHTTPQuotedStringTokenCodePoints:a,asciiLowercase:o,collectAnHTTPQuotedString:s}=Md;Dd=i=>{i=e(i);let l=0,c="";for(;l<i.length&&"/"!==i[l];)c+=i[l],++l;if(0===c.length||!r(c))return null;if(l>=i.length)return null;++l;let u="";for(;l<i.length&&";"!==i[l];)u+=i[l],++l;if(u=t(u),0===u.length||!r(u))return null;const h={type:o(c),subtype:o(u),parameters:new Map};for(;l<i.length;){for(++l;n(i[l]);)++l;let e="";for(;l<i.length&&";"!==i[l]&&"="!==i[l];)e+=i[l],++l;if(e=o(e),l<i.length){if(";"===i[l])continue;++l}let c=null;if('"'===i[l])for([c,l]=s(i,l);l<i.length&&";"!==i[l];)++l;else{for(c="";l<i.length&&";"!==i[l];)c+=i[l],++l;if(c=t(c),""===c)continue}e.length>0&&r(e)&&a(c)&&!h.parameters.has(e)&&h.parameters.set(e,c)}return h}}{const e=Dd,t=Od,{asciiLowercase:n,solelyContainsHTTPTokenCodePoints:r,soleyContainsHTTPQuotedStringTokenCodePoints:a}=Md;Ud=class{constructor(t){t=String(t);const n=e(t);if(null===n)throw new Error(`Could not parse MIME type string "${t}"`);this._type=n.type,this._subtype=n.subtype,this._parameters=new o(n.parameters)}static parse(e){try{return new this(e)}catch(e){return null}}get essence(){return`${this.type}/${this.subtype}`}get type(){return this._type}set type(e){if(0===(e=n(String(e))).length)throw new Error("Invalid type: must be a non-empty string");if(!r(e))throw new Error(`Invalid type ${e}: must contain only HTTP token code points`);this._type=e}get subtype(){return this._subtype}set subtype(e){if(0===(e=n(String(e))).length)throw new Error("Invalid subtype: must be a non-empty string");if(!r(e))throw new Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return t(this)}isJavaScript({allowParameters:e=!1}={}){switch(this._type){case"text":switch(this._subtype){case"ecmascript":case"javascript":case"javascript1.0":case"javascript1.1":case"javascript1.2":case"javascript1.3":case"javascript1.4":case"javascript1.5":case"jscript":case"livescript":case"x-ecmascript":case"x-javascript":return e||0===this._parameters.size;default:return!1}case"application":switch(this._subtype){case"ecmascript":case"javascript":case"x-ecmascript":case"x-javascript":return e||0===this._parameters.size;default:return!1}default:return!1}}isXML(){return"xml"===this._subtype&&("text"===this._type||"application"===this._type)||this._subtype.endsWith("+xml")}isHTML(){return"html"===this._subtype&&"text"===this._type}};class o{constructor(e){this._map=e}get size(){return this._map.size}get(e){return e=n(String(e)),this._map.get(e)}has(e){return e=n(String(e)),this._map.has(e)}set(e,t){if(e=n(String(e)),t=String(t),!r(e))throw new Error(`Invalid MIME type parameter name "${e}": only HTTP token code points are valid.`);if(!a(t))throw new Error(`Invalid MIME type parameter value "${t}": only HTTP quoted-string token code points are valid.`);return this._map.set(e,t)}clear(){this._map.clear()}delete(e){return e=n(String(e)),this._map.delete(e)}forEach(e,t){this._map.forEach(e,t)}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}[Symbol.iterator](){return this._map[Symbol.iterator]()}}}var Fd=Object.freeze({__proto__:null,fontPropertyParser:St,mediaQueryParser:_t,cssMinifier:Yn,cssTree:Pd,cssUnescape:y,srcsetParser:zd,get MIMEType(){return Ud}});const Bd={normalizeFontFamily:J,getFontWeight:ae},qd=globalThis.FontFace,jd=/url\s*\(\s*'(.*?)'\s*\)/i,Hd=/url\s*\(\s*"(.*?)"\s*\)/i,Wd=/url\s*\(\s*(.*?)\s*\)/i,Vd=/(url|local)\(.*?\)\s*(,|$)/g,$d=/^'(.*?)'$/,Yd=/^"(.*?)"$/,Gd=/^url\(\s*["']?data:font\/(woff2?)/,Kd=/^url\(\s*["']?data:application\/x-font-(woff)/,Qd=/\.([^.?#]+)((\?|#).*?)?$/,Jd=/format\((.*?)\)\s*,?$/,Zd=/(.*?)\s*,?$/,Xd=/^url\(["']?data:[^,]*,?["']?\)/,ep="local(",tp={"ultra-condensed":"50%","extra-condensed":"62.5%",condensed:"75%","semi-condensed":"87.5%",normal:"100%","semi-expanded":"112.5%",expanded:"125%","extra-expanded":"150%","ultra-expanded":"200%"};async function np(e,t,n,r){const a={fonts:new Map,medias:new Map,supports:new Map},o={rules:{processed:0,discarded:0},fonts:{processed:0,discarded:0}};let s=0;return t.forEach((t=>{const n=t.stylesheet.children;if(n)if(o.rules.processed+=n.getSize(),o.rules.discarded+=n.getSize(),t.mediaText&&"all"!=t.mediaText){const r=cp();a.medias.set("media-"+s+"-"+t.mediaText,r),rp(e,n,s,r)}else rp(e,n,s,a);s++})),ap(a),await Promise.all([...t].map((async([,e],t)=>{const s=e.stylesheet.children,i=e.mediaText;s&&(i&&"all"!=i?await op(s,t,a.medias.get("media-"+t+"-"+i),n,r,o):await op(s,t,a,n,r,o),o.rules.discarded-=s.getSize())}))),o}function rp(e,t,n,r){let a=0,o=0;t.forEach((t=>{if("Atrule"==t.type&&"media"==t.name&&t.block&&t.block.children&&t.prelude){const o=Id(t.prelude),s=cp();r.medias.set("media-"+n+"-"+a+"-"+o,s),a++,rp(e,t.block.children,n,s)}else if("Atrule"==t.type&&"supports"==t.name&&t.block&&t.block.children&&t.prelude){const a=Id(t.prelude),s=cp();r.supports.set("supports-"+n+"-"+o+"-"+a,s),o++,rp(e,t.block.children,n,s)}else if("Atrule"==t.type&&"font-face"==t.name&&t.block&&t.block.children){const e=lp(t);let n=r.fonts.get(e);n||(n=[],r.fonts.set(e,n));const a=ip(t,"src");if(a){const e=a.match(Vd);e&&e.forEach((e=>n.unshift(e)))}}}))}function ap(e){e.fonts.forEach(((t,n)=>{e.fonts.set(n,t.map((e=>{const t=e.match(Jd);let n;const r=e.match(jd)||e.match(Hd)||e.match(Wd),a=r&&r[1];if(t&&t[1]&&(n=t[1].replace($d,"$1").replace(Yd,"$1").toLowerCase()),!n){const t=e.match(Gd);if(t&&t[1])n=t[1];else{const t=e.match(Kd);t&&t[1]&&(n=t[1])}}if(!n&&a){const e=a.match(Qd);e&&e[1]&&(n=e[1])}return{src:e.match(Zd)[1],fontUrl:a,format:n}})))})),e.medias.forEach((e=>ap(e))),e.supports.forEach((e=>ap(e)))}async function op(e,t,n,r,a,o){const s=[];let i=0,l=0;for(let c=e.head;c;c=c.next){const e=c.data;if("Atrule"==e.type&&"media"==e.name&&e.block&&e.block.children&&e.prelude){const s=Id(e.prelude);await op(e.block.children,t,n.medias.get("media-"+t+"-"+i+"-"+s),r,a,o),i++}else if("Atrule"==e.type&&"supports"==e.name&&e.block&&e.block.children&&e.prelude){const s=Id(e.prelude);await op(e.block.children,t,n.supports.get("supports-"+t+"-"+l+"-"+s),r,a,o),l++}else if("Atrule"==e.type&&"font-face"==e.name){const t=lp(e),i=n.fonts.get(t);if(i){await sp(e,i,r,a,o)&&n.fonts.delete(t)}else s.push(c)}}s.forEach((t=>e.remove(t)))}async function sp(e,t,n,r,a){const o=[];for(let t=e.block.children.head;t;t=t.next)"src"==t.data.property&&o.push(t);o.pop(),o.forEach((t=>e.block.children.remove(t)));const s=e.block.children.filter((e=>"src"==e.property)).tail;if(s){await Promise.all(t.map((async(e,t)=>{if(r.has(e.src))e.valid=r.get(e.src);else{if(qd){const r=new qd("test-font",e.src);try{await r.load(),await r.loaded,e.valid=!0}catch(r){const a=n.get(s.data);if(a){const n=a[a.length-t-1];if(n){const t=new qd("test-font","url("+n+")");try{await Promise.race([t.load().then((()=>t.loaded)).then((()=>e.valid=!0)),new Promise((t=>globalThis.setTimeout((()=>{e.valid=!0,t()}),5e3)))])}catch(e){}}}else e.valid=!0}}else e.valid=!0;r.set(e.src,e.valid)}})));const e=(e,n)=>t.find((t=>!t.src.match(Xd)&&t.format==e&&(!n||t.valid))),o=e=>t.filter((t=>t==e||t.src.startsWith(ep)));a.fonts.processed+=t.length,a.fonts.discarded+=t.length;const i=e("woff2-variations",!0)||e("woff2",!0)||e("woff",!0);if(i)t=o(i);else{const n=e("truetype-variations",!0)||e("truetype",!0);if(n)t=o(n);else{const n=e("opentype")||e("embedded-opentype");t=n?o(n):t.filter((e=>!e.src.match(Xd)&&e.valid||e.src.startsWith(ep)))}}a.fonts.discarded-=t.length,t.reverse();try{s.data.value=Ld(t.map((e=>e.src)).join(","),{context:"value"})}catch(e){}return!0}return!1}function ip(e,t){let n;if(e.block.children&&(n=e.block.children.filter((e=>{try{return e.property==t&&!Id(e.value).match(/\\9$/)}catch(n){return e.property==t}})).tail),n)try{return Id(n.data.value)}catch(e){}}function lp(e){return JSON.stringify([Bd.normalizeFontFamily(ip(e,"font-family")),Bd.getFontWeight(ip(e,"font-weight")||"400"),ip(e,"font-style")||"normal",ip(e,"unicode-range"),(t=ip(e,"font-stretch"),tp[t]||t),ip(e,"font-variant")||"normal",ip(e,"font-feature-settings"),ip(e,"font-variation-settings")]);var t}function cp(){return{fonts:new Map,medias:new Map,supports:new Map}}var up=Object.freeze({__proto__:null,process:np});const hp={normalizeFontFamily:J,flatten:oe,getFontWeight:ae,removeQuotes:re},dp=/\s*,\s*/,pp=/-/,mp=/\?/g,fp=/^U\+/i,gp=[/^normal$/,/^italic$/,/^oblique$/,/^oblique\s+/];function yp(e,t,n,r){const a={rules:{processed:0,discarded:0},fonts:{processed:0,discarded:0}},o={declared:[],used:[]},s=e.createElement("style");let i="";e.body.appendChild(s),t.forEach((t=>{const n=t.stylesheet.children;n&&(a.processed+=n.getSize(),a.discarded+=n.getSize(),bp(n,o),i=Cp(e,n,s,i))})),n.forEach((e=>{const t=Sp(e);t.length&&o.used.push(t),i=Rp(e.children,s,i)})),s.remove(),i+=e.body.innerText,globalThis.getComputedStyle&&r.doc&&(o.used=o.used.map((e=>e.map((e=>{const t=e.match(/^var\((--.*)\)$/);if(t&&t[1]){const n=globalThis.getComputedStyle(r.doc.body).getPropertyValue(t[1]);return n&&n.split(",").map((e=>hp.normalizeFontFamily(e)))||e}return e})))),o.used=o.used.map((e=>hp.flatten(e))));let l,c;return o.used.find((e=>e.find((e=>e.startsWith("var(--")))))?l=[]:(c=new Map,o.used.forEach((e=>e.forEach((e=>{if(o.declared.find((t=>t.fontFamily==e))){const t=r.usedFonts&&r.usedFonts.filter((t=>t[0]==e));t&&t.length&&c.set(e,t)}})))),l=o.declared.filter((e=>!c.has(e.fontFamily)))),t.forEach((e=>{const t=e.stylesheet.children;t&&(vp(t,o.declared,l,c,i),a.rules.discarded-=t.getSize())})),a}function bp(e,t){e.forEach((e=>{if("Atrule"==e.type&&("media"==e.name||"supports"==e.name)&&e.block&&e.block.children)bp(e.block.children,t);else if("Rule"==e.type){const n=Sp(e.block);n.length&&t.used.push(n)}else if("Atrule"==e.type&&"font-face"==e.name){const n=hp.normalizeFontFamily(xp(e.block.children,"font-family"));if(n){const r=xp(e.block.children,"font-weight")||"400",a=xp(e.block.children,"font-style")||"normal",o=xp(e.block.children,"font-variant")||"normal";r.split(",").forEach((e=>t.declared.push({fontFamily:n,fontWeight:hp.getFontWeight(hp.removeQuotes(e)),fontStyle:a,fontVariant:o})))}}}))}function vp(e,t,n,r,a){const o=[];for(let s=e.head;s;s=s.next){const e=s.data;if("Atrule"==e.type&&("media"==e.name||"supports"==e.name)&&e.block&&e.block.children)vp(e.block.children,t,n,r,a);else if("Atrule"==e.type&&"font-face"==e.name){const i=hp.normalizeFontFamily(xp(e.block.children,"font-family"));if(i){const l=xp(e.block.children,"unicode-range");!n.find((e=>e.fontFamily==i))&&Ip(a,l)&&kp(e,i,t,r)||o.push(s)}const l=[];for(let t=e.block.children.head;t;t=t.next)"font-display"==t.data.property&&l.push(t);l.length&&l.forEach((t=>e.block.children.remove(t)))}}o.forEach((t=>e.remove(t)))}function kp(e,t,n,r){let a;const o=r&&r.get(t);if(o&&o.length){let r=xp(e.block.children,"font-style")||"normal";if(gp.find((e=>r.trim().match(e)))){const s=hp.getFontWeight(xp(e.block.children,"font-weight")||"400"),i=n.filter((e=>e.fontFamily==t&&e.fontStyle==r)).map((e=>e.fontWeight)).sort(((e,t)=>e-t));let l=o.map((e=>Ep(e,r,i)));a=wp(s,l),a||(l=o.map((e=>((e=Array.from(e))[2]="normal",Ep(e,r,i))))),a=wp(s,l)}else a=!0}else a=!0;return a}function wp(e,t){return e.split(",").find((e=>t.includes(hp.getFontWeight(hp.removeQuotes(e)))))}function xp(e,t){let n;if(e&&(n=e.filter((e=>e.property==t)).tail),n)try{return hp.removeQuotes(Id(n.data.value)).toLowerCase()}catch(e){}}function Sp(e){let t=e.children.filter((e=>"font-family"==e.property)).tail,n=[];if(t){let e="";t.data.value.children?t.data.value.children.forEach((t=>{"Operator"==t.type&&","==t.value&&e?(n.push(hp.normalizeFontFamily(e)),e=""):e+=Id(t)})):t=Id(t.data.value),e&&n.push(hp.normalizeFontFamily(e))}const r=e.children.filter((e=>"font"==e.property)).tail;if(r&&r.data&&r.data.value)try{bt(Id(r.data.value)).family.forEach((e=>n.push(hp.normalizeFontFamily(e))))}catch(e){}return n}function Ep(e,t,n){let r;if(e[2]==t){let t=Number(e[1]);n.length>1?(t>=400&&t<=500&&(r=n.find((e=>e>=t&&e<=500)),r||(r=Ap(t,n)),r||(r=Tp(t,n))),t<400&&(r=n.slice().reverse().find((e=>e<=t)),r||(r=Tp(t,n))),t>500&&(r=n.find((e=>e>=t)),r||(r=Ap(t,n)))):r=n[0]}return r}function Ap(e,t){return t.slice().reverse().find((t=>t<e))}function Tp(e,t){return t.find((t=>t>e))}function Cp(e,t,n,r){return t.forEach((t=>{t.block&&t.block.children&&t.prelude&&t.prelude.children&&("Atrule"!=t.type||"media"!=t.name&&"supports"!=t.name?"Rule"==t.type&&(r=Rp(t.block.children,n,r)):r=Cp(e,t.block.children,n,r))})),r}function Rp(e,t,n){const r=_p(e,"content",t),a=_p(e,"quotes",t);return n.includes(r)||(n+=r),n.includes(a)||(n+=a),n}function _p(e,t,n){const r=xp(e,t)||"";return r?(n.textContent='tmp { content:"'+r+'"}',n.sheet&&n.sheet.cssRules?hp.removeQuotes(n.sheet.cssRules[0].style.getPropertyValue("content")):r):""}function Ip(e,t){if(t){const n=t.split(dp);let r;const a=n.filter((t=>{const n=t.split(pp);let a;if(2==n.length&&(n[0]=Lp(n[0]),a="["+n[0]+"-"+Lp("U+"+n[1])+"]"),1==n.length)if(n[0].includes("?")){const e=Lp(n[0]),t=e;a="["+e.replace(mp,"0")+"-"+t.replace(mp,"F")+"]"}else n[0]&&(a="["+Lp(n[0])+"]");if(a)try{return new RegExp(a,"u").test(e)}catch(e){return r=!0,!1}return!0}));return!r&&(!n.length||a.length)}return!0}function Lp(e){for(e=e.replace(fp,"");e.length<6;)e="0"+e;return"\\u{"+e+"}"}var Pp=Object.freeze({__proto__:null,process:yp});const Np="all",zp=["after","before","first-letter","first-line","placeholder","selection","part","marker"],Mp="sf-hidden",Dp=/-(ms|webkit|moz|o)-/;class Op{constructor(e,t,n){this.doc=e,this.mediaAllInfo=Fp(Np);const r=new Map;let a=0;const o=e.createElement("style");e.body.appendChild(o),t.forEach((t=>{if(!t.scoped){const s=t.stylesheet.children;if(s)if(t.mediaText&&t.mediaText!=Np){const i=Fp(t.mediaText);this.mediaAllInfo.medias.set("style-"+a+"-"+t.mediaText,i),Bp(e,s,i,a,n,r,o)}else Bp(e,s,this.mediaAllInfo,a,n,r,o)}a++})),Wp(this.mediaAllInfo),jp(this.mediaAllInfo,[],this.mediaAllInfo,o),o.remove()}getMediaAllInfo(){return this.mediaAllInfo}}function Up(e,t,n){return new Op(e,t,n).getMediaAllInfo()}function Fp(e){const t={media:e,elements:new Map,medias:new Map,rules:new Map,pseudoRules:new Map};return e==Np&&(t.matchedStyles=new Map),t}function Bp(e,t,n,r,a,o,s){let i=0,l=0;t.forEach((t=>{if(t.block&&t.block.children&&t.prelude&&t.prelude.children)if("Atrule"==t.type&&"media"==t.name){const l=Id(t.prelude),c=Fp(l);n.medias.set("rule-"+r+"-"+i+"-"+l,c),i++,Bp(e,t.block.children,c,r,a,o,s)}else if("Rule"==t.type){const i=t.prelude.children.toArray(),c=t.prelude.children.toArray().map((e=>Id(e))),u={ruleData:t,mediaInfo:n,ruleIndex:l,sheetIndex:r,matchedSelectors:new Set,declarations:new Set,selectors:i,selectorsText:c};if(!function(e,t){return t.textContent=e+"{}",t.sheet?!t.sheet.cssRules.length:t.sheet}(c.join(","),s))for(let n=t.prelude.children.head,r=0;n;n=n.next,r++){const t=c[r];qp(e,{selector:n,selectorText:t,ruleInfo:u},a,o)}l++}}))}function qp(e,t,n,r){const a=function(e,t){const n=[];r(e={data:Ld(Id(e.data),{context:"selector"})}),n.length&&(n.forEach((({parentSelector:e,selector:t})=>{0!=e.data.children.getSize()&&t.prev&&"Combinator"!=t.prev.data.type&&"WhiteSpace"!=t.prev.data.type?e.data.children.remove(t):e.data.children.replace(t,Ld("*",{context:"selector"}).children.head)})),t=Id(e.data).trim());return t;function r(e,t){if(e.data.children)for(let t=e.data.children.head;t;t=t.next)r(t,e);("PseudoClassSelector"==e.data.type||"PseudoElementSelector"==e.data.type&&(a(e)||zp.includes(e.data.name)))&&n.push({parentSelector:t,selector:e})}function a(e){const t=e.data.name;return t.startsWith("-")||t.startsWith("\\-")}}(t.selector,t.selectorText),o=a!=t.selectorText?a:t.selectorText,s=r.get(o);let i=s;if(!i)try{i=e.querySelectorAll(o),".sf-hidden"!=o&&(i=Array.from(e.querySelectorAll(o)).filter((e=>!e.classList.contains(Mp)&&("none"!=e.style.getPropertyValue("display")||"important"!=e.style.getPropertyPriority("display")))))}catch(e){}if(i&&(s||r.set(o,i),i.length))if(a==t.selectorText)i.forEach((e=>function(e,t,n){const r=t.ruleInfo.mediaInfo,a=n.get(e);let o=r.elements.get(e);o||(o=[],a&&o.push({styleInfo:{styleData:a,declarations:new Set}}),r.elements.set(e,o));const s=Vp(t.selector.data);s.ruleIndex=t.ruleInfo.ruleIndex,s.sheetIndex=t.ruleInfo.sheetIndex,t.specificity=s,o.push(t)}(e,t,n)));else{let e=t.ruleInfo.mediaInfo.pseudoRules.get(t.ruleInfo.ruleData);e||(e=new Set,t.ruleInfo.mediaInfo.pseudoRules.set(t.ruleInfo.ruleData,e)),e.add(t.selectorText)}}function jp(e,t,n,r){e.elements.forEach((a=>function(e,t){const n=new Map,r=new Set;return e.forEach((e=>{let a;a=e.styleInfo?e.styleInfo.styleData.children:e.ruleInfo.ruleData.block.children,function(e,t,n,r,a){for(let o=t.tail;o;o=o.prev){const t=o.data,s=Id(t);if("Declaration"==t.type&&(s.match(Dp)||!r.has(t.property)||t.important)&&!Hp(s,a)){const a=e.get(t);(!a||t.important&&!a.important)&&(e.set(t,{selectorInfo:n,important:t.important}),s.match(Dp)||r.add(t.property))}}}(n,a,e,r,t)})),n}(a,r).forEach(((r,a)=>{if(r.selectorInfo.ruleInfo||e==n){let o;if(r.selectorInfo.ruleInfo){o=r.selectorInfo.ruleInfo;const n=o.ruleData;([e,...t].find((e=>e.rules.get(n)))||e).rules.set(n,o),n&&o.matchedSelectors.add(r.selectorInfo.selectorText)}else{o=r.selectorInfo.styleInfo;const e=o.styleData;n.matchedStyles.get(e)||n.matchedStyles.set(e,o)}o.declarations.has(a)||o.declarations.add(a)}})))),delete e.elements,e.medias.forEach((a=>jp(a,[e,...t],n,r)))}function Hp(e,t){let n;return t.textContent="single-file-declaration { "+e+"}",t.sheet&&!t.sheet.cssRules[0].style.length&&(e.match(Dp)||(n=!0)),n}function Wp(e){e.elements.forEach((e=>e.sort(((e,t)=>{return e.styleInfo&&!t.styleInfo?-1:!e.styleInfo&&t.styleInfo?1:(n=e.specificity,r=t.specificity,n.a>r.a?-1:n.a<r.a?1:n.b>r.b?-1:n.b<r.b?1:n.c>r.c?-1:n.c<r.c?1:n.sheetIndex>r.sheetIndex?-1:n.sheetIndex<r.sheetIndex?1:n.ruleIndex>r.ruleIndex?-1:n.ruleIndex<r.ruleIndex?1:-1);var n,r})))),e.medias.forEach(Wp)}function Vp(e,t={a:0,b:0,c:0}){return"IdSelector"==e.type&&t.a++,("ClassSelector"==e.type||"AttributeSelector"==e.type||"PseudoClassSelector"==e.type&&"not"!=e.name)&&t.b++,("TypeSelector"==e.type&&"*"!=e.name||"PseudoElementSelector"==e.type)&&t.c++,e.children&&e.children.forEach((e=>Vp(e,t))),t}var $p=Object.freeze({__proto__:null,getMediaAllInfo:Up});const Yp={flatten:oe},Gp="all",Kp="screen";function Qp(e){const t={processed:0,discarded:0};return e.forEach(((n,r)=>{if(Zp(n.mediaText||Gp,Kp)&&n.stylesheet.children){Jp(n.stylesheet.children,t).forEach((({cssRules:e,cssRule:t})=>e.remove(t)))}else e.delete(r)})),t}function Jp(e,t,n=[]){for(let r=e.head;r;r=r.next){const a=r.data;"Atrule"==a.type&&"media"==a.name&&a.block&&a.block.children&&a.prelude&&a.prelude.children&&(t.processed++,Zp(Id(a.prelude),Kp)?Jp(a.block.children,t,n):(n.push({cssRules:e,cssRule:r}),t.discarded++))}return n}function Zp(e,t){return Yp.flatten(Tt(e).map((e=>Xp(e,t)))).find((e=>!e.not&&(e.value==t||e.value==Gp)||e.not&&(e.value==Gp||e.value!=t)))}function Xp(e,t,n=[]){return e.nodes.map(((r,a)=>{if("media-query"==r.type)return Xp(r,t,n);if("media-type"==r.type){const t={not:Boolean(a&&"keyword"==e.nodes[0].type&&"not"==e.nodes[0].value),value:r.value};n.find((e=>t.not==e.not&&t.value==e.value))||n.push(t)}})),n.length||n.push({not:!1,value:Gp}),n}var em=Object.freeze({__proto__:null,process:Qp});function tm(e,t,n){const r={processed:0,discarded:0};let a=0;return e.forEach((e=>{if(!e.scoped){const t=e.stylesheet.children;if(t){let o;r.processed+=t.getSize(),r.discarded+=t.getSize(),o=e.mediaText&&"all"!=e.mediaText?n.medias.get("style-"+a+"-"+e.mediaText):n,nm(t,a,o),r.discarded-=t.getSize()}}a++})),t.forEach((e=>function(e,t){const n=[],r=t.matchedStyles.get(e);if(r){let t;for(let a=e.children.head;a&&!t;a=a.next)r.declarations.has(a.data)||n.push(a);n.forEach((t=>e.children.remove(t)))}}(e,n))),r}function nm(e,t,n){let r=0;const a=[];for(let o=e.head;o;o=o.next){const e=o.data;if(e.block&&e.block.children&&e.prelude&&e.prelude.children){if("Atrule"==e.type&&"media"==e.name){const s=Id(e.prelude);nm(e.block.children,t,n.medias.get("rule-"+t+"-"+r+"-"+s)),e.prelude.children.getSize()&&e.block.children.getSize()||a.push(o),r++}else if("Rule"==e.type){const t=n.rules.get(e),r=n.pseudoRules.get(e);t||r?t&&(rm(e,t,r),e.prelude.children.getSize()&&e.block.children.getSize()||a.push(o)):a.push(o)}}else e&&"Raw"!=e.type&&("Rule"!=e.type||e.prelude&&"Raw"!=e.prelude.type)||a.push(o)}a.forEach((t=>e.remove(t)))}function rm(e,t,n){const r=[],a=[];let o;for(let r=e.prelude.children.head;r;r=r.next){const e=Id(r.data);n&&n.has(e)&&(o=!0),t.matchedSelectors.has(e)||n&&n.has(e)||a.push(r)}if(!o)for(let n=e.block.children.tail;n;n=n.prev)t.declarations.has(n.data)||r.push(n);r.forEach((t=>e.block.children.remove(t))),a.forEach((t=>e.prelude.children.remove(t)))}var am=Object.freeze({__proto__:null,process:tm});const om="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";function sm(e){e.querySelectorAll("picture").forEach((e=>{const t=e.querySelector("img");if(t){let{src:n,srcset:r}=im(t);if(!n){const t=function(e){let t=e.find((e=>e.src)),n=t&&t.src,r=t&&t.srcset;n||(t=e.find((e=>cm(e.src))),n=t&&t.src,n==om&&(n=null));r||(t=e.find((e=>cm(e.srcset))),r=t&&t.srcset,r==om&&(r=null));return{src:n,srcset:r}}(Array.from(e.querySelectorAll("source")).reverse());n=t.src,r||(r=t.srcset)}lm({src:n,srcset:r},t,e)}})),e.querySelectorAll(":not(picture) > img[srcset]").forEach((e=>lm(im(e),e)))}function im(e){let t=e.getAttribute("src");t==om&&(t=null);let n=cm(e.getAttribute("srcset"));return n==om&&(n=null),{src:t,srcset:n}}function lm(e,t,n){e.src?(t.setAttribute("src",e.src),t.setAttribute("srcset",""),t.setAttribute("sizes","")):(t.setAttribute("src",om),e.srcset?t.setAttribute("srcset",e.srcset):(t.setAttribute("srcset",""),t.setAttribute("sizes",""))),n&&n.querySelectorAll("source").forEach((e=>e.remove()))}function cm(e){if(e){const t=Nd(e);if(t.length)return t.find((e=>e.url)).url}}var um=Object.freeze({__proto__:null,process:sm});const hm=["allowfullscreen","async","autofocus","autoplay","checked","compact","controls","declare","default","defaultchecked","defaultmuted","defaultselected","defer","disabled","enabled","formnovalidate","hidden","indeterminate","inert","ismap","itemscope","loop","multiple","muted","nohref","noresize","noshade","novalidate","nowrap","open","pauseonexit","readonly","required","reversed","scoped","seamless","selected","sortable","truespeed","typemustmatch","visible"],dm=["script","style","pre","textarea"],pm=["id","class","style","lang","dir","onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmousemove","onmouseout","onkeypress","onkeydown","onkeyup"],mm={form:{method:"get"},script:{language:"javascript",type:"text/javascript",charset:e=>!e.getAttribute("src")},style:{media:"all",type:"text/css"},link:{media:"all"}},fm=/[ \t\f\r]+/g,gm=/[\n]+/g,ym=/^\s+$/,bm=[function(e){1==e.nodeType&&Array.from(e.attributes).forEach((t=>{hm.includes(t.name)&&e.setAttribute(t.name,"")}))},function(e){3==e.nodeType&&e.previousSibling&&3==e.previousSibling.nodeType&&(e.textContent=e.previousSibling.textContent+e.textContent,e.previousSibling.remove())},function(e,t){if(3==e.nodeType){let n=e.parentElement;if(!(""==n.getAttribute(t.PRESERVED_SPACE_ELEMENT_ATTRIBUTE_NAME))){const t=e.textContent;let r=km(n);for(;r;)n=n.parentElement,r=n&&km(n);(!n||r)&&t.length>1&&(e.textContent=t.replace(fm,function(e){return e.parentElement&&"HEAD"==e.parentElement.tagName?"\n":" "}(e)).replace(gm,"\n"))}}},function(e){if(8==e.nodeType&&"HTML"!=e.parentElement.tagName)return!e.textContent.toLowerCase().trim().startsWith("[if")},function(e){1==e.nodeType&&Array.from(e.attributes).forEach((t=>{if(pm.includes(t.name.toLowerCase())){const n=e.getAttribute(t.name);(""==n||(n||"").match(ym))&&e.removeAttribute(t.name)}}))},function(e){if(1==e.nodeType){const t=mm[e.tagName.toLowerCase()];t&&Object.keys(t).forEach((n=>{const r=t[n];("function"==typeof r?r(e):e.getAttribute(n)==r)&&e.removeAttribute(n)}))}},function(e){if(1==e.nodeType&&"SCRIPT"==e.tagName&&"application/ld+json"==e.type&&e.textContent.trim())try{e.textContent=JSON.stringify(JSON.parse(e.textContent))}catch(e){}},e=>function(e,t,n){if(1==e.nodeType&&e.tagName.toLowerCase()==t.toLowerCase()){let t=e.previousSibling;const r=[];for(;t&&3==t.nodeType&&!t.textContent.trim();)r.push(t),t=t.previousSibling;t&&1==t.nodeType&&t.tagName==e.tagName&&n(e,t)&&(e.textContent=t.textContent+e.textContent,r.forEach((e=>e.remove())),t.remove())}}(e,"style",((e,t)=>e.parentElement&&"HEAD"==e.parentElement.tagName&&e.media==t.media&&e.title==t.title))];function vm(e,t){!function(e){e.querySelectorAll("style, script:not([src])").forEach((e=>{e.textContent.trim()||e.remove()}))}(e);const n=e.createTreeWalker(e.documentElement,4294967295,null,!1);let r=n.nextNode();for(;r;){const e=bm.find((e=>e(r,t))),a=r;r=n.nextNode(),e&&a.remove()}}function km(e){return e&&!dm.includes(e.tagName.toLowerCase())}var wm=Object.freeze({__proto__:null,process:vm});const xm=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Sm=[{tagName:"head",accept:e=>!e.childNodes.length||1==e.childNodes[0].nodeType},{tagName:"body",accept:e=>!e.childNodes.length}],Em=[{tagName:"html",accept:e=>!e||8!=e.nodeType},{tagName:"head",accept:e=>!e||8!=e.nodeType&&(3!=e.nodeType||!Rm(e.textContent))},{tagName:"body",accept:e=>!e||8!=e.nodeType},{tagName:"li",accept:(e,t)=>!e&&t.parentElement&&("UL"==t.parentElement.tagName||"OL"==t.parentElement.tagName)||e&&["LI"].includes(e.tagName)},{tagName:"dt",accept:e=>!e||["DT","DD"].includes(e.tagName)},{tagName:"p",accept:e=>e&&["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIV","DL","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","MAIN","NAV","OL","P","PRE","SECTION","TABLE","UL"].includes(e.tagName)},{tagName:"dd",accept:e=>!e||["DT","DD"].includes(e.tagName)},{tagName:"rt",accept:e=>!e||["RT","RP"].includes(e.tagName)},{tagName:"rp",accept:e=>!e||["RT","RP"].includes(e.tagName)},{tagName:"optgroup",accept:e=>!e||["OPTGROUP"].includes(e.tagName)},{tagName:"option",accept:e=>!e||["OPTION","OPTGROUP"].includes(e.tagName)},{tagName:"colgroup",accept:e=>!e||8!=e.nodeType&&(3!=e.nodeType||!Rm(e.textContent))},{tagName:"caption",accept:e=>!e||8!=e.nodeType&&(3!=e.nodeType||!Rm(e.textContent))},{tagName:"thead",accept:e=>!e||["TBODY","TFOOT"].includes(e.tagName)},{tagName:"tbody",accept:e=>!e||["TBODY","TFOOT"].includes(e.tagName)},{tagName:"tfoot",accept:e=>!e},{tagName:"tr",accept:e=>!e||["TR"].includes(e.tagName)},{tagName:"td",accept:e=>!e||["TD","TH"].includes(e.tagName)},{tagName:"th",accept:e=>!e||["TD","TH"].includes(e.tagName)}],Am=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"];function Tm(e,t){const n=e.doctype;let r="";return n&&(r="<!DOCTYPE "+n.nodeName,n.publicId?(r+=' PUBLIC "'+n.publicId+'"',n.systemId&&(r+=' "'+n.systemId+'"')):n.systemId&&(r+=' SYSTEM "'+n.systemId+'"'),n.internalSubset&&(r+=" ["+n.internalSubset+"]"),r+="> "),r+Cm(e.documentElement,t)}function Cm(e,t,n){return 3==e.nodeType?function(e){const t=e.parentNode;let n;t&&1==t.nodeType&&(n=t.tagName.toLowerCase());return!n||Am.includes(n)?"script"==n?e.textContent.replace(/<\//gi,"<\\/").replace(/\/>/gi,"\\/>"):e.textContent:e.textContent.replace(/&/g,"&amp;").replace(/\u00a0/g,"&nbsp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}(e):8==e.nodeType?"\x3c!--"+e.textContent+"--\x3e":1==e.nodeType?function(e,t,n){const r=e.tagName.toLowerCase(),a=t&&Sm.find((t=>r==t.tagName&&t.accept(e)));let o="";a&&!e.attributes.length||(o="<"+r,Array.from(e.attributes).forEach((n=>o+=function(e,t,n){const r=e.name;let a="";if(!r.match(/["'>/=]/)){let o,s=e.value;n&&"class"==r&&(s=Array.from(t.classList).map((e=>e.trim())).join(" ")),s=s.replace(/&/g,"&amp;").replace(/\u00a0/g,"&nbsp;"),s.includes('"')&&(s.includes("'")||!n?s=s.replace(/"/g,"&quot;"):o=!0);const i=!n||!s.match(/^[^ \t\n\f\r'"`=<>]+$/);a+=" ",e.namespace?"http://www.w3.org/XML/1998/namespace"==e.namespaceURI?a+="xml:"+r:"http://www.w3.org/2000/xmlns/"==e.namespaceURI?("xmlns"!==r&&(a+="xmlns:"),a+=r):"http://www.w3.org/1999/xlink"==e.namespaceURI?a+="xlink:"+r:a+=r:a+=r,""!=s&&(a+="=",i&&(a+=o?"'":'"'),a+=s,i&&(a+=o?"'":'"'))}return a}(n,e,t))),o+=">");"TEMPLATE"!=e.tagName||e.childNodes.length?Array.from(e.childNodes).forEach((e=>o+=Cm(e,t,n||"svg"==r))):o+=e.innerHTML;const s=t&&Em.find((t=>r==t.tagName&&t.accept(e.nextSibling,e)));(n||!s&&!xm.includes(r))&&(o+="</"+r+">");return o}(e,t,n):void 0}function Rm(e){return Boolean(e.match(/^[ \t\n\f\r]/))}var _m=Object.freeze({__proto__:null,process:Tm}),Im=Object.freeze({__proto__:null,fontsAltMinifier:up,fontsMinifier:Pp,matchedRules:$p,mediasAltMinifier:em,cssRulesMinifier:am,imagesAltMinifier:um,htmlMinifier:wm,serializer:_m});const Lm=globalThis.Set,Pm=globalThis.Map;let Nm,zm;class Mm{constructor(e){this.options=e}async run(){const e=globalThis._singleFile_waitForUserScript;this.options.userScriptEnabled&&e&&await e(Nm.ON_BEFORE_CAPTURE_EVENT_NAME),this.runner=new Gm(this.options,!0),await this.runner.loadPage(),await this.runner.initialize(),this.options.userScriptEnabled&&e&&await e(Nm.ON_AFTER_CAPTURE_EVENT_NAME),await this.runner.run()}cancel(){this.cancelled=!0,this.runner&&this.runner.cancel()}getPageData(){return this.runner.getPageData()}}const Dm="page-loading",Om="page-loaded",Um="resource-initializing",Fm="resources-initialized",Bm="resource-loaded",qm="page-ended",jm="stage-started",Hm="stage-ended",Wm="stage-task-started",Vm="stage-task-ended";class $m{constructor(e,t){return{type:e,detail:t,PAGE_LOADING:Dm,PAGE_LOADED:Om,RESOURCES_INITIALIZING:Um,RESOURCES_INITIALIZED:Fm,RESOURCE_LOADED:Bm,PAGE_ENDED:qm,STAGE_STARTED:jm,STAGE_ENDED:Hm,STAGE_TASK_STARTED:Wm,STAGE_TASK_ENDED:Vm}}}const Ym=[{sequential:[{action:"preProcessPage"},{option:"loadDeferredImagesKeepZoomLevel",action:"resetZoomLevel"},{action:"replaceStyleContents"},{action:"resetCharsetMeta"},{option:"saveFavicon",action:"saveFavicon"},{action:"replaceCanvasElements"},{action:"insertFonts"},{action:"insertShadowRootContents"},{action:"setInputValues"},{option:"removeScripts",action:"removeScripts"},{option:"selected",action:"removeUnselectedElements"},{option:"removeVideoSrc",action:"insertVideoPosters"},{option:"removeFrames",action:"removeFrames"},{option:"removeVideoSrc",action:"removeVideoSources"},{option:"removeAudioSrc",action:"removeAudioSources"},{action:"removeDiscardedResources"},{option:"removeHiddenElements",action:"removeHiddenElements"},{action:"resolveHrefs"},{action:"resolveStyleAttributeURLs"}],parallel:[{action:"resolveStylesheetURLs"},{option:"!removeFrames",action:"resolveFrameURLs"},{action:"resolveHtmlImportURLs"}]},{sequential:[{option:"removeUnusedStyles",action:"removeUnusedStyles"},{option:"removeAlternativeMedias",action:"removeAlternativeMedias"},{option:"removeUnusedFonts",action:"removeUnusedFonts"}],parallel:[{action:"processStylesheets"},{action:"processStyleAttributes"},{action:"processPageResources"},{option:"!removeScripts",action:"processScripts"}]},{sequential:[{option:"removeAlternativeImages",action:"removeAlternativeImages"}],parallel:[{option:"removeAlternativeFonts",action:"removeAlternativeFonts"},{option:"!removeFrames",action:"processFrames"},{option:"!removeImports",action:"processHtmlImports"}]},{sequential:[{action:"replaceStylesheets"},{action:"replaceStyleAttributes"},{action:"insertVariables"},{option:"compressHTML",action:"compressHTML"},{action:"cleanupPage"}],parallel:[{option:"enableMaff",action:"insertMAFFMetaData"},{action:"setDocInfo"}]}];class Gm{constructor(e,t){const n=t&&e.doc;this.root=t,this.options=e,this.options.url=this.options.url||n&&this.options.doc.location.href;const r=this.options.url.match(/^.*\//);if(this.options.resourceReferrer=this.options.passReferrerOnError&&r&&r[0],this.options.baseURI=n&&this.options.doc.baseURI,this.options.rootDocument=t,this.options.updatedResources=this.options.updatedResources||{},this.options.fontTests=new Pm,this.batchRequest=new Km,this.processor=new of(e,this.batchRequest),n){const e=Nm.preProcessDoc(this.options.doc,this.options.win,this.options);this.options.canvases=e.canvases,this.options.fonts=e.fonts,this.options.stylesheets=e.stylesheets,this.options.images=e.images,this.options.posters=e.posters,this.options.usedFonts=e.usedFonts,this.options.shadowRoots=e.shadowRoots,this.options.imports=e.imports,this.options.referrer=e.referrer,this.markedElements=e.markedElements}this.options.saveRawPage&&(this.options.removeFrames=!0),this.options.content=this.options.content||(n?Nm.serialize(this.options.doc):null),this.onprogress=e.onprogress||(()=>{})}async loadPage(){this.onprogress(new $m(Dm,{pageURL:this.options.url,frame:!this.root})),await this.processor.loadPage(this.options.content),this.onprogress(new $m(Om,{pageURL:this.options.url,frame:!this.root}))}async initialize(){this.onprogress(new $m(Um,{pageURL:this.options.url})),await this.executeStage(0),this.pendingPromises=this.executeStage(1),this.root&&this.options.doc&&Nm.postProcessDoc(this.options.doc,this.markedElements)}cancel(){function e(e){e.runner&&e.runner.cancel()}this.cancelled=!0,this.batchRequest.cancel(),this.root&&(this.options.frames&&this.options.frames.forEach(e),this.options.imports&&this.options.imports.forEach(e))}async run(){this.root&&(this.processor.initialize(this.batchRequest),this.onprogress(new $m(Fm,{pageURL:this.options.url,max:this.processor.maxResources}))),await this.batchRequest.run((e=>{e.pageURL=this.options.url,this.onprogress(new $m(Bm,e))}),this.options),await this.pendingPromises,this.options.doc=null,this.options.win=null,await this.executeStage(2),await this.executeStage(3),this.processor.finalize()}getDocument(){return this.processor.doc}getStyleSheets(){return this.processor.stylesheets}getPageData(){return this.root&&this.onprogress(new $m(qm,{pageURL:this.options.url})),this.processor.getPageData()}async executeStage(e){const t=!this.root;let n;return this.onprogress(new $m(jm,{pageURL:this.options.url,step:e,frame:t})),Ym[e].sequential.forEach((n=>{this.onprogress(new $m(Wm,{pageURL:this.options.url,step:e,task:n.action,frame:t})),this.cancelled||this.executeTask(n),this.onprogress(new $m(Vm,{pageURL:this.options.url,step:e,task:n.action,frame:t}))})),n=Ym[e].parallel?await Promise.all(Ym[e].parallel.map((async n=>{this.onprogress(new $m(Wm,{pageURL:this.options.url,step:e,task:n.action,frame:t})),this.cancelled||await this.executeTask(n),this.onprogress(new $m(Vm,{pageURL:this.options.url,step:e,task:n.action,frame:t}))}))):Promise.resolve(),this.onprogress(new $m(Hm,{pageURL:this.options.url,step:e,frame:t})),n}executeTask(e){if(!e.option||e.option.startsWith("!")&&!this.options[e.option]||this.options[e.option])return this.processor[e.action]()}}class Km{constructor(){this.requests=new Pm,this.duplicates=new Pm}addURL(e,t,n,r){return new Promise(((a,o)=>{const s=JSON.stringify([e,t,n]);let i=this.requests.get(s);i||(i=[],this.requests.set(s,i));const l={resolve:a,reject:o};if(i.push(l),r){let e=this.duplicates.get(s);e||(e=[],this.duplicates.set(s,e)),e.push(l)}}))}getMaxResources(){return this.requests.size}run(e,t){const n=[...this.requests.keys()];let r=0;return Promise.all(n.map((async n=>{const[a,o,s]=JSON.parse(n),i=this.requests.get(n);try{const l=r;r+=1;const c=await Nm.getContent(a,{asBinary:o,expectedType:s,maxResourceSize:t.maxResourceSize,maxResourceSizeEnabled:t.maxResourceSizeEnabled,frameId:t.windowId,resourceReferrer:t.resourceReferrer});e({url:a}),this.cancelled||i.forEach((e=>{const t=this.duplicates.get(n),r=t&&t.length>1&&t.includes(e);e.resolve({content:c.data,indexResource:l,duplicate:r})}))}catch(t){r+=1,e({url:a}),i.forEach((e=>e.reject(t)))}this.requests.delete(n)})))}cancel(){this.cancelled=!0;[...this.requests.keys()].forEach((e=>{this.requests.get(e).forEach((e=>e.reject())),this.requests.delete(e)}))}}const Qm=["data:text/"],Jm="data:image/svg+xml",Zm="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Xm=/<script/gi,ef=/<noscript/gi,tf="shadowmode",nf="delegatesfocus",rf="data-template-shadow-root",af="utf-8";class of{constructor(e,t){this.options=e,this.stats=new Vf(e),this.baseURI=Lf(e.baseURI||e.url),this.batchRequest=t,this.stylesheets=new Pm,this.styles=new Pm,this.cssVariables=new Pm,this.fontTests=e.fontTests}initialize(){this.options.saveDate=new Date,this.options.saveUrl=this.options.url,this.options.enableMaff&&(this.maffMetaDataPromise=this.batchRequest.addURL(Nm.resolveURL("index.rdf",this.options.baseURI||this.options.url))),this.maxResources=this.batchRequest.getMaxResources(),this.options.saveRawPage||this.options.removeFrames||!this.options.frames||this.options.frames.forEach((e=>this.maxResources+=e.maxResources||0)),!this.options.removeImports&&this.options.imports&&this.options.imports.forEach((e=>this.maxResources+=e.maxResources||0)),this.stats.set("processed","resources",this.maxResources)}async loadPage(e,t){let n;if(e&&!this.options.saveRawPage||(n=await Nm.getContent(this.baseURI,{maxResourceSize:this.options.maxResourceSize,maxResourceSizeEnabled:this.options.maxResourceSizeEnabled,charset:t,frameId:this.options.windowId,resourceReferrer:this.options.resourceReferrer}),e=n.data),this.doc=Nm.parseDocContent(e,this.baseURI),this.options.saveRawPage){let t;if(this.doc.querySelectorAll('meta[charset], meta[http-equiv="content-type"]').forEach((e=>{const n=e.content.split(";")[1];n&&!t&&(t=n.split("=")[1].trim().toLowerCase())})),t&&t.toLowerCase()!=n.charset.toLowerCase())return this.loadPage(e,t)}this.workStyleElement=this.doc.createElement("style"),this.doc.body.appendChild(this.workStyleElement),this.onEventAttributeNames=function(e){const t=e.createElement("div"),n=[];for(const e in t)e.startsWith("on")&&n.push(e);return n.push("onunload"),n}(this.doc)}finalize(){this.workStyleElement.parentNode&&this.workStyleElement.remove()}async getPageData(){Nm.postProcessDoc(this.doc);const e=Nm.parseURL(this.baseURI);if(this.options.insertSingleFileComment){const e=this.doc.documentElement.firstChild;let t=this.options.saveUrl,n=this.options.saveDate;if(8==e.nodeType&&(e.textContent.includes(Nm.COMMENT_HEADER_LEGACY)||e.textContent.includes(Nm.COMMENT_HEADER))){const r=this.doc.documentElement.firstChild.textContent.split("\n"),[,,a,o]=r;t=a.split("url: ")[1],n=o.split("saved date: ")[1],e.remove()}const r=(this.options.infobarContent||"").replace(/\\n/g,"\n").replace(/\\t/g,"\t"),a=this.doc.createComment("\n "+(this.options.useLegacyCommentHeader?Nm.COMMENT_HEADER_LEGACY:Nm.COMMENT_HEADER)+" \n url: "+t+" \n saved date: "+n+(r?" \n info: "+r:"")+"\n");this.doc.documentElement.insertBefore(a,this.doc.documentElement.firstChild)}if(this.options.insertCanonicalLink&&this.options.saveUrl.match(mf)){let e=this.doc.querySelector("link[rel=canonical]");e||(e=this.doc.createElement("link"),e.setAttribute("rel","canonical"),this.doc.head.appendChild(e)),e&&!e.href&&(e.href=this.options.saveUrl)}if(this.options.insertMetaCSP){const e=this.doc.createElement("meta");e.httpEquiv="content-security-policy",e.content="default-src 'none'; font-src 'self' data:; img-src 'self' data:; style-src 'unsafe-inline'; media-src 'self' data:; script-src 'unsafe-inline' data:;",this.doc.head.appendChild(e)}if(this.options.insertMetaNoIndex){let e=this.doc.querySelector("meta[name=robots][content*=noindex]");e||(e=this.doc.createElement("meta"),e.setAttribute("name","robots"),e.setAttribute("content","noindex"),this.doc.head.appendChild(e))}let t;this.options.displayStats&&(t=Nm.getContentSize(this.doc.documentElement.outerHTML));const n=Nm.serialize(this.doc,this.options.compressHTML);if(this.options.displayStats){const e=Nm.getContentSize(n);this.stats.set("processed","HTML bytes",e),this.stats.add("discarded","HTML bytes",t-e)}let r=await pf.evalTemplate(this.options.filenameTemplate,this.options,n)||"";const a=this.options.filenameReplacementCharacter;if(r=Nm.getValidFilename(r,this.options.filenameReplacedCharacters,a),this.options.backgroundSave||(r=r.replace(/\//g,a)),!this.options.saveToGDrive&&!this.options.saveWithCompanion&&Nm.getContentSize(r)>this.options.filenameMaxLength){const e=r.match(/(\.[^.]{3,4})$/),t=e&&e[0]&&e[0].length>1?e[0]:"";r=await Nm.truncateText(r,this.options.filenameMaxLength-t.length),r=r+"…"+t}r||(r="Unnamed page");const o=this.baseURI.match(/([^/]*)\/?(\.html?.*)$/)||this.baseURI.match(/\/\/([^/]*)\/?$/),s={stats:this.stats.data,title:this.options.title||(this.baseURI&&o?o[1]:e.hostname?e.hostname:""),filename:r,content:n};return this.options.addProof&&(s.hash=await Nm.digest("SHA-256",n)),this.options.retrieveLinks&&(s.links=Array.from(new Lm(Array.from(this.doc.links).map((e=>e.href))))),s}preProcessPage(){this.options.win&&this.doc.body.querySelectorAll(':not(svg) title, meta, link[href][rel*="icon"]').forEach((e=>e instanceof this.options.win.HTMLElement&&this.doc.head.appendChild(e))),this.options.images&&!this.options.saveRawPage&&(this.doc.querySelectorAll("img["+Nm.IMAGE_ATTRIBUTE_NAME+"]").forEach((e=>{const t=e.getAttribute(Nm.IMAGE_ATTRIBUTE_NAME);if(t){const n=this.options.images[Number(t)];n&&(this.options.removeHiddenElements&&(n.size&&!n.size.pxWidth&&!n.size.pxHeight||""==e.getAttribute(Nm.HIDDEN_CONTENT_ATTRIBUTE_NAME))?e.setAttribute("src",Zm):(n.currentSrc&&(e.dataset.singleFileOriginURL=e.getAttribute("src"),e.setAttribute("src",n.currentSrc)),this.options.loadDeferredImages&&(e.getAttribute("src")&&e.getAttribute("src")!=Zm||!e.getAttribute("data-src")||(n.src=e.dataset.src,e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")))))}})),this.options.loadDeferredImages&&this.doc.querySelectorAll("img[data-srcset]").forEach((e=>{!e.getAttribute("srcset")&&e.getAttribute("data-srcset")&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"))})))}replaceStyleContents(){this.options.stylesheets&&this.doc.querySelectorAll("style").forEach(((e,t)=>{if(e.getAttribute(Nm.STYLESHEET_ATTRIBUTE_NAME)){const n=this.options.stylesheets[Number(t)];n&&(e.textContent=n)}}))}removeUnselectedElements(){function e(e){1==e.nodeType&&e.querySelector("svg,style,link")||!n(e)?t(e):e.remove()}function t(t){n(t)&&(t.style.setProperty("display","none","important"),Array.from(t.childNodes).forEach(e))}function n(e){if(1==e.nodeType){const t=e.tagName&&e.tagName.toLowerCase();return"svg"!=t&&"style"!=t&&"link"!=t}}!function n(r){let a=!1;Array.from(r.childNodes).forEach((r=>{if(1==r.nodeType){const o=""==r.getAttribute(Nm.SELECTED_CONTENT_ATTRIBUTE_NAME);a=a||o,o?(r.removeAttribute(Nm.SELECTED_CONTENT_ATTRIBUTE_NAME),n(r)):a?e(r):t(r)}}))}(this.doc.body),this.doc.body.removeAttribute(Nm.SELECTED_CONTENT_ATTRIBUTE_NAME)}insertVideoPosters(){this.options.posters&&this.doc.querySelectorAll("video[src], video > source[src]").forEach((e=>{let t;t="VIDEO"==e.tagName?e:e.parentElement;const n=e.getAttribute(Nm.POSTER_ATTRIBUTE_NAME);if(n){const e=this.options.posters[Number(n)];!t.poster&&e&&t.setAttribute("poster",e)}}))}removeFrames(){const e=this.doc.querySelectorAll('iframe, frame, object[type="text/html"][data]');this.stats.set("discarded","frames",e.length),this.stats.set("processed","frames",e.length),this.doc.querySelectorAll('iframe, frame, object[type="text/html"][data]').forEach((e=>e.remove()))}removeScripts(){this.onEventAttributeNames.forEach((e=>this.doc.querySelectorAll("["+e+"]").forEach((t=>t.removeAttribute(e))))),this.doc.querySelectorAll("[href]").forEach((e=>{e.href&&e.href.match&&e.href.match(/^\s*javascript:/)&&e.setAttribute("href","")})),this.doc.querySelectorAll("[src]").forEach((e=>{e.src&&e.src.match(/^\s*javascript:/)&&e.removeAttribute("src")}));const e=this.doc.querySelectorAll('script:not([type="application/ld+json"]):not([data-template-shadow-root])');this.stats.set("discarded","scripts",e.length),this.stats.set("processed","scripts",e.length),e.forEach((e=>e.remove()))}removeVideoSources(){const e=this.doc.querySelectorAll("video[src], video > source");this.stats.set("discarded","video sources",e.length),this.stats.set("processed","video sources",e.length),e.forEach((t=>{"SOURCE"==t.tagName?t.remove():e.forEach((e=>e.removeAttribute("src")))}))}removeAudioSources(){const e=this.doc.querySelectorAll("audio[src], audio > source[src]");this.stats.set("discarded","audio sources",e.length),this.stats.set("processed","audio sources",e.length),e.forEach((t=>{"SOURCE"==t.tagName?t.remove():e.forEach((e=>e.removeAttribute("src")))}))}removeDiscardedResources(){this.doc.querySelectorAll("."+Nm.SINGLE_FILE_UI_ELEMENT_CLASS).forEach((e=>e.remove())),this.doc.querySelectorAll('meta[http-equiv=refresh], meta[disabled-http-equiv], meta[http-equiv="content-security-policy"]').forEach((e=>e.remove()));const e=this.doc.querySelectorAll('applet, object[data]:not([type="image/svg+xml"]):not([type="image/svg-xml"]):not([type="text/html"]), embed[src]:not([src*=".svg"]):not([src*=".pdf"])');this.stats.set("discarded","objects",e.length),this.stats.set("processed","objects",e.length),e.forEach((e=>e.remove()));this.doc.querySelectorAll("link[rel~=preconnect], link[rel~=prerender], link[rel~=dns-prefetch], link[rel~=preload], link[rel~=manifest], link[rel~=prefetch]").forEach((e=>{let t;t=this.options.removeScripts?/(preconnect|prerender|dns-prefetch|preload|prefetch|manifest)/g:/(preconnect|prerender|dns-prefetch|prefetch|manifest)/g;const n=e.getAttribute("rel").replace(t,"").trim();n.length?e.setAttribute("rel",n):e.remove()})),this.doc.querySelectorAll('link[rel*=stylesheet][rel*=alternate][title],link[rel*=stylesheet]:not([href]),link[rel*=stylesheet][href=""]').forEach((e=>e.remove())),this.options.removeHiddenElements&&this.doc.querySelectorAll("input[type=hidden]").forEach((e=>e.remove())),this.options.saveFavicon||this.doc.querySelectorAll('link[rel*="icon"]').forEach((e=>e.remove())),this.doc.querySelectorAll("a[ping]").forEach((e=>e.removeAttribute("ping")))}resetCharsetMeta(){let e;this.doc.querySelectorAll('meta[charset], meta[http-equiv="content-type"]').forEach((t=>{const n=t.content.split(";")[1];n&&!e&&(e=n.split("=")[1],e&&(this.charset=e.trim().toLowerCase())),t.remove()}));const t=this.doc.createElement("meta");t.setAttribute("charset",af),this.doc.head.firstChild?this.doc.head.insertBefore(t,this.doc.head.firstChild):this.doc.head.appendChild(t)}setInputValues(){this.doc.querySelectorAll("input:not([type=radio]):not([type=checkbox])").forEach((e=>{const t=e.getAttribute(Nm.INPUT_VALUE_ATTRIBUTE_NAME);e.setAttribute("value",t||"")})),this.doc.querySelectorAll("input[type=radio], input[type=checkbox]").forEach((e=>{"true"==e.getAttribute(Nm.INPUT_VALUE_ATTRIBUTE_NAME)&&e.setAttribute("checked","")})),this.doc.querySelectorAll("textarea").forEach((e=>{const t=e.getAttribute(Nm.INPUT_VALUE_ATTRIBUTE_NAME);e.textContent=t||""})),this.doc.querySelectorAll("select").forEach((e=>{e.querySelectorAll("option").forEach((e=>{null!=e.getAttribute(Nm.INPUT_VALUE_ATTRIBUTE_NAME)&&e.setAttribute("selected","")}))}))}saveFavicon(){let e=this.doc.querySelector('link[href][rel="icon"]');e||(e=this.doc.querySelector('link[href][rel="shortcut icon"]')),e||(e=this.doc.createElement("link"),e.setAttribute("type","image/x-icon"),e.setAttribute("rel","shortcut icon"),e.setAttribute("href","/favicon.ico")),this.doc.head.appendChild(e)}replaceCanvasElements(){this.options.canvases&&this.doc.querySelectorAll("canvas").forEach((e=>{const t=e.getAttribute(Nm.CANVAS_ATTRIBUTE_NAME);if(t){const n=this.options.canvases[Number(t)];n&&(pf.setBackgroundImage(e,"url("+n.dataURI+")"),this.stats.add("processed","canvas",1))}}))}insertFonts(){if(this.options.fonts&&this.options.fonts.length){let e="";if(this.options.fonts.forEach((t=>{if(t["font-family"]&&t.src){e+="@font-face{";let n="";Object.keys(t).forEach((e=>{n&&(n+=";"),n+=e+":"+t[e]})),e+=n+"}"}})),e){const t=this.doc.createElement("style");t.textContent=e;const n=this.doc.querySelector("style");n?n.parentElement.insertBefore(t,n):this.doc.head.insertBefore(t,this.doc.head.firstChild)}}}removeHiddenElements(){const e=this.doc.querySelectorAll("["+Nm.HIDDEN_CONTENT_ATTRIBUTE_NAME+"]"),t=this.doc.querySelectorAll("["+Nm.REMOVED_CONTENT_ATTRIBUTE_NAME+"]");if(this.stats.set("discarded","hidden elements",t.length),this.stats.set("processed","hidden elements",t.length),e.length){const t=this.doc.createElement("style");t.textContent=".sf-hidden{display:none!important;}",this.doc.head.appendChild(t),e.forEach((e=>{"none"!=e.style.getPropertyValue("display")&&("important"==e.style.getPropertyPriority("display")?e.style.setProperty("display","none","important"):e.classList.add("sf-hidden"))}))}t.forEach((e=>e.remove()))}resolveHrefs(){this.doc.querySelectorAll("a[href], area[href], link[href]").forEach((e=>{const t=e.getAttribute("href").trim();if(!Bf(t)){let n;try{n=Nm.resolveURL(t,this.options.baseURI||this.options.url)}catch(e){}if(n){const t=Lf(this.options.url);!n.startsWith(t+"#")||n.startsWith(t+"#!")||this.options.resolveFragmentIdentifierURLs||(n=n.substring(t.length));try{e.setAttribute("href",n)}catch(e){}}}}))}resolveStyleAttributeURLs(){this.doc.querySelectorAll("[style]").forEach((e=>{let t=e.getAttribute("style");this.options.compressCSS&&(t=Nm.compressCSS(t)),t=pf.resolveStylesheetURLs(t,this.baseURI,this.workStyleElement);const n=zm.parse(t,{context:"declarationList"});this.styles.set(e,n)}))}async resolveStylesheetURLs(){if(await Promise.all(Array.from(this.doc.querySelectorAll("style, link[rel*=stylesheet]")).map((async t=>{const n={maxResourceSize:this.options.maxResourceSize,maxResourceSizeEnabled:this.options.maxResourceSizeEnabled,url:this.options.url,charset:this.charset,compressCSS:this.options.compressCSS,updatedResources:this.options.updatedResources,rootDocument:this.options.rootDocument,frameId:this.options.windowId,resourceReferrer:this.options.resourceReferrer};let r;t.media&&(r=t.media.toLowerCase());const a={mediaText:r};t.closest("[shadowmode]")&&(a.scoped=!0),"LINK"==t.tagName&&t.charset&&(n.charset=t.charset),await e(t,a,this.stylesheets,this.baseURI,n,this.workStyleElement)}))),this.options.rootDocument){const t=Object.keys(this.options.updatedResources).filter((e=>"stylesheet"==this.options.updatedResources[e].type&&!this.options.updatedResources[e].retrieved)).map((e=>this.options.updatedResources[e]));await Promise.all(t.map((async t=>{t.retrieved=!0;const n=this.doc.createElement("style");this.doc.body.appendChild(n),n.textContent=t.content,await e(n,{},this.stylesheets,this.baseURI,this.options,this.workStyleElement)})))}async function e(e,n,r,a,o,s){r.set(e,n);let i,l=await t(e,a,o,s);Nf(l,o.charset)||(o=Object.assign({},o,{charset:zf(l)}),l=await t(e,a,o,s));try{i=zm.parse(Hf(l))}catch(e){}i&&i.children?(o.compressCSS&&pf.removeSingleLineCssComments(i),n.stylesheet=i):r.delete(e)}async function t(e,t,n,r){let a;return a="LINK"==e.tagName?await pf.resolveLinkStylesheetURLs(e.href,t,n,r):await pf.resolveImportURLs(e.textContent,t,n,r),a||""}}async resolveFrameURLs(){if(!this.options.saveRawPage){const e=Array.from(this.doc.querySelectorAll('iframe, frame, object[type="text/html"][data]'));await Promise.all(e.map((async e=>{"OBJECT"==e.tagName?e.setAttribute("data","data:text/html,"):(e.removeAttribute("src"),e.removeAttribute("srcdoc")),Array.from(e.childNodes).forEach((e=>e.remove()));const t=e.getAttribute(Nm.WIN_ID_ATTRIBUTE_NAME);if(this.options.frames&&t){const n=this.options.frames.find((e=>e.windowId==t));n&&await async function(e,t,n,r,a){a.insertSingleFileComment=!1,a.insertCanonicalLink=!1,a.insertMetaNoIndex=!1,a.saveFavicon=!1,a.url=e.baseURI,a.windowId=n,e.content&&(a.content=e.content,a.canvases=e.canvases,a.fonts=e.fonts,a.stylesheets=e.stylesheets,a.images=e.images,a.posters=e.posters,a.usedFonts=e.usedFonts,a.shadowRoots=e.shadowRoots,a.imports=e.imports,e.runner=new Gm(a),e.frameElement=t,await e.runner.loadPage(),await e.runner.initialize(),e.maxResources=r.getMaxResources())}(n,e,t,this.batchRequest,Object.create(this.options))}})))}}insertShadowRootContents(){const e=this.doc,t=this.options;if(this.options.shadowRoots&&this.options.shadowRoots.length){!function n(r){Array.from(r.querySelectorAll("["+Nm.SHADOW_ROOT_ATTRIBUTE_NAME+"]")).forEach((r=>{const a=r.getAttribute(Nm.SHADOW_ROOT_ATTRIBUTE_NAME);if(a){const o=t.shadowRoots[Number(a)];if(o){const t=e.createElement("template");t.setAttribute(tf,o.mode),o.delegatesFocus&&t.setAttribute(nf),o.adoptedStyleSheets&&o.adoptedStyleSheets.forEach((n=>{const r=e.createElement("style");r.textContent=n,t.appendChild(r)}));const a=Nm.parseDocContent(o.content);if(a.head){const e=a.head.querySelector("meta[charset]");e&&e.remove(),a.head.childNodes.forEach((e=>t.appendChild(a.importNode(e,!0))))}a.body&&a.body.childNodes.forEach((e=>t.appendChild(a.importNode(e,!0)))),n(t),r.firstChild?r.insertBefore(t,r.firstChild):r.appendChild(t)}}}))}(this.doc),this.options.removeScripts&&this.doc.querySelectorAll("script[data-template-shadow-root]").forEach((e=>e.remove()));const n=e.createElement("script");n.setAttribute(rf,""),n.textContent='(()=>{document.currentScript.remove();processNode(document);function processNode(node){node.querySelectorAll("template[shadowmode]").forEach(element=>{let shadowRoot = element.parentElement.shadowRoot;if (!shadowRoot) {try {shadowRoot=element.parentElement.attachShadow({mode:element.getAttribute("shadowmode"),delegatesFocus:Boolean(element.getAttribute("delegatesfocus"))});shadowRoot.innerHTML=element.innerHTML;element.remove()} catch (error) {} if (shadowRoot) {processNode(shadowRoot)}}})}})()',e.body.appendChild(n)}}async resolveHtmlImportURLs(){const e=Array.from(this.doc.querySelectorAll("link[rel=import][href]"));await Promise.all(e.map((async e=>{const t=e.href;e.removeAttribute("href");const n=Object.create(this.options);n.insertSingleFileComment=!1,n.insertCanonicalLink=!1,n.insertMetaNoIndex=!1,n.saveFavicon=!1,n.removeUnusedStyles=!1,n.removeAlternativeMedias=!1,n.removeUnusedFonts=!1,n.removeHiddenElements=!1,n.url=t;const r=e.getAttribute(Nm.HTML_IMPORT_ATTRIBUTE_NAME);if(r){const t=n.imports[Number(r)];t&&(n.content=t.content,t.runner=new Gm(n),await t.runner.loadPage(),await t.runner.initialize(),n.removeImports||(t.maxResources=t.runner.batchRequest.getMaxResources()),t.runner.getStyleSheets().forEach((t=>{const n=this.doc.createElement("style");e.insertAdjacentElement("afterEnd",n),this.stylesheets.set(n,t)})))}n.removeImports&&(e.remove(),this.stats.add("discarded","HTML imports",1))})))}removeUnusedStyles(){this.mediaAllInfo||(this.mediaAllInfo=Nm.getMediaAllInfo(this.doc,this.stylesheets,this.styles));const e=Nm.minifyCSSRules(this.stylesheets,this.styles,this.mediaAllInfo);this.stats.set("processed","CSS rules",e.processed),this.stats.set("discarded","CSS rules",e.discarded)}removeUnusedFonts(){Nm.removeUnusedFonts(this.doc,this.stylesheets,this.styles,this.options)}removeAlternativeMedias(){const e=Nm.minifyMedias(this.stylesheets);this.stats.set("processed","medias",e.processed),this.stats.set("discarded","medias",e.discarded)}async processStylesheets(){this.options.fontURLs=new Pm,await Promise.all([...this.stylesheets].map((([,e])=>pf.processStylesheet(e.stylesheet.children,this.baseURI,this.options,this.cssVariables,this.batchRequest))))}async processStyleAttributes(){return Promise.all([...this.styles].map((([,e])=>pf.processStyle(e.children.toArray(),this.baseURI,this.options,this.cssVariables,this.batchRequest))))}async processPageResources(){let e=[['link[href][rel*="icon"]',"href",!1,!0],['object[type="image/svg+xml"], object[type="image/svg-xml"]',"data"],["img[src], input[src][type=image]","src",!0],['embed[src*=".svg"], embed[src*=".pdf"]',"src"],["video[poster]","poster"],["*[background]","background"],["image","xlink:href"],["image","href"]].map((([e,t,n,r])=>pf.processAttribute(this.doc.querySelectorAll(e),t,this.baseURI,this.options,this.cssVariables,this.styles,this.batchRequest,n,r)));e=e.concat([pf.processXLinks(this.doc.querySelectorAll("use"),this.baseURI,this.options,this.batchRequest),pf.processSrcset(this.doc.querySelectorAll("img[srcset], source[srcset]"),"srcset",this.baseURI,this.batchRequest)]),this.options.removeAudioSrc||e.push(pf.processAttribute(this.doc.querySelectorAll("audio[src], audio > source[src]"),"src",this.baseURI,this.options,this.cssVariables,this.styles,this.batchRequest)),this.options.removeVideoSrc||e.push(pf.processAttribute(this.doc.querySelectorAll("video[src], video > source[src]"),"src",this.baseURI,this.options,this.cssVariables,this.styles,this.batchRequest)),await Promise.all(e),this.options.saveFavicon&&pf.processShortcutIcons(this.doc)}async processScripts(){await Promise.all(Array.from(this.doc.querySelectorAll("script[src], link[rel=preload][as=script][href]")).map((async e=>{let t,n;n="SCRIPT"==e.tagName?e.getAttribute("src"):e.getAttribute("href"),e.removeAttribute("integrity"),e.textContent="";try{t=Nm.resolveURL(n,this.baseURI)}catch(e){}if(jf(t)){"SCRIPT"==e.tagName?e.removeAttribute("src"):e.removeAttribute("href"),this.stats.add("processed","scripts",1);const n=await Nm.getContent(t,{asBinary:!0,charset:this.charset!=af&&this.charset,maxResourceSize:this.options.maxResourceSize,maxResourceSizeEnabled:this.options.maxResourceSizeEnabled,frameId:this.options.windowId,resourceReferrer:this.options.resourceReferrer});if(n.data=If(t,n,this.options),"SCRIPT"==e.tagName)e.setAttribute("src",n.data),""!=e.getAttribute("async")&&"async"!=e.getAttribute("async")&&""!=e.getAttribute(Nm.ASYNC_SCRIPT_ATTRIBUTE_NAME)||e.setAttribute("async","");else{const t=this.doc.createElement("script");t.setAttribute("src",n.data),t.setAttribute("async",""),e.parentElement.replaceChild(t,e)}}})))}removeAlternativeImages(){Nm.removeAlternativeImages(this.doc)}async removeAlternativeFonts(){await Nm.removeAlternativeFonts(this.doc,this.stylesheets,this.options.fontURLs,this.options.fontTests)}async processFrames(){if(this.options.frames){const e=Array.from(this.doc.querySelectorAll('iframe, frame, object[type="text/html"][data]'));await Promise.all(e.map((async e=>{const t=e.getAttribute(Nm.WIN_ID_ATTRIBUTE_NAME);if(t){const n=this.options.frames.find((e=>e.windowId==t));if(n)if(this.options.frames=this.options.frames.filter((e=>e.windowId!=t)),n.runner&&""!=e.getAttribute(Nm.HIDDEN_FRAME_ATTRIBUTE_NAME)){this.stats.add("processed","frames",1),await n.runner.run();const t=await n.runner.getPageData();e.removeAttribute(Nm.WIN_ID_ATTRIBUTE_NAME);let r="allow-popups allow-top-navigation allow-top-navigation-by-user-activation";(t.content.match(ef)||t.content.match(Xm))&&(r+=" allow-scripts allow-same-origin"),e.setAttribute("sandbox",r),"OBJECT"==e.tagName?e.setAttribute("data","data:text/html,"+t.content):"FRAME"==e.tagName?e.setAttribute("src","data:text/html,"+t.content.replace(/%/g,"%25").replace(/#/g,"%23")):(e.setAttribute("srcdoc",t.content),e.removeAttribute("src")),this.stats.addAll(t)}else e.removeAttribute(Nm.WIN_ID_ATTRIBUTE_NAME),this.stats.add("discarded","frames",1)}})))}}async processHtmlImports(){const e=Array.from(this.doc.querySelectorAll("link[rel=import]"));await Promise.all(e.map((async e=>{const t=e.getAttribute(Nm.HTML_IMPORT_ATTRIBUTE_NAME);if(t){const n=this.options.imports[Number(t)];if(n.runner){this.stats.add("processed","HTML imports",1),await n.runner.run();const t=await n.runner.getPageData();e.removeAttribute(Nm.HTML_IMPORT_ATTRIBUTE_NAME),e.setAttribute("href","data:text/html,"+t.content),this.stats.addAll(t)}else this.stats.add("discarded","HTML imports",1)}})))}replaceStylesheets(){this.doc.querySelectorAll("style").forEach((e=>{const t=this.stylesheets.get(e);if(t){this.stylesheets.delete(e);let n=zm.generate(t.stylesheet);e.textContent=n,t.mediaText&&(e.media=t.mediaText)}else e.remove()})),this.doc.querySelectorAll("link[rel*=stylesheet]").forEach((e=>{const t=this.stylesheets.get(e);if(t){this.stylesheets.delete(e);const n=this.doc.createElement("style");t.mediaText&&(n.media=t.mediaText);let r=zm.generate(t.stylesheet);n.textContent=r,e.parentElement.replaceChild(n,e)}else e.remove()}))}replaceStyleAttributes(){this.doc.querySelectorAll("[style]").forEach((e=>{const t=this.styles.get(e);if(t){this.styles.delete(e);let n=zm.generate(t);e.setAttribute("style",n)}else e.setAttribute("style","")}))}insertVariables(){if(this.cssVariables.size){const e=this.doc.createElement("style"),t=this.doc.head.querySelector("style");t?this.doc.head.insertBefore(e,t):this.doc.head.appendChild(e);let n="";this.cssVariables.forEach(((e,t)=>{this.cssVariables.delete(t),n&&(n+=";"),n+=`${hf+t}:url("${e}")`})),e.textContent=":root{"+n+"}"}}compressHTML(){let e;this.options.displayStats&&(e=Nm.getContentSize(this.doc.documentElement.outerHTML)),Nm.minifyHTML(this.doc,{PRESERVED_SPACE_ELEMENT_ATTRIBUTE_NAME:Nm.PRESERVED_SPACE_ELEMENT_ATTRIBUTE_NAME}),this.options.displayStats&&this.stats.add("discarded","HTML bytes",e-Nm.getContentSize(this.doc.documentElement.outerHTML))}cleanupPage(){this.doc.querySelectorAll("base").forEach((e=>e.remove()));const e=this.doc.head.querySelector("meta[charset]");e&&(this.doc.head.insertBefore(e,this.doc.head.firstChild),1==this.doc.head.querySelectorAll("*").length&&0==this.doc.body.childNodes.length&&this.doc.head.querySelector("meta[charset]").remove())}resetZoomLevel(){const e=this.doc.documentElement.style.getPropertyValue("-sf-transform"),t=this.doc.documentElement.style.getPropertyPriority("-sf-transform"),n=this.doc.documentElement.style.getPropertyValue("-sf-transform-origin"),r=this.doc.documentElement.style.getPropertyPriority("-sf-transform-origin"),a=this.doc.documentElement.style.getPropertyValue("-sf-min-height"),o=this.doc.documentElement.style.getPropertyPriority("-sf-min-height");this.doc.documentElement.style.setProperty("transform",e,t),this.doc.documentElement.style.setProperty("transform-origin",n,r),this.doc.documentElement.style.setProperty("min-height",a,o),this.doc.documentElement.style.removeProperty("-sf-transform"),this.doc.documentElement.style.removeProperty("-sf-transform-origin"),this.doc.documentElement.style.removeProperty("-sf-min-height")}async insertMAFFMetaData(){const e=await this.maffMetaDataPromise;if(e&&e.content){const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",n=Nm.parseXMLContent(e.content),r=n.querySelector("RDF > Description > originalurl"),a=n.querySelector("RDF > Description > archivetime");if(r&&(this.options.saveUrl=r.getAttributeNS(t,"resource")),a){const e=a.getAttributeNS(t,"resource");if(e){const t=new Date(e);isNaN(t.getTime())||(this.options.saveDate=new Date(e))}}}}async setDocInfo(){const e=this.doc.querySelector("title"),t=this.doc.querySelector("meta[name=description]"),n=this.doc.querySelector("meta[name=author]"),r=this.doc.querySelector("meta[name=creator]"),a=this.doc.querySelector("meta[name=publisher]"),o=this.doc.querySelector("h1");this.options.title=e?e.textContent.trim():"",this.options.info={description:t&&t.content?t.content.trim():"",lang:this.doc.documentElement.lang,author:n&&n.content?n.content.trim():"",creator:r&&r.content?r.content.trim():"",publisher:a&&a.content?a.content.trim():"",heading:o&&o.textContent?o.textContent.trim():""},this.options.infobarContent=await pf.evalTemplate(this.options.infobarTemplate,this.options,null,!0)}}const sf="data:",lf="about:blank",cf="data:null;base64,",uf=/(#.+?)$/,hf="--sf-img-",df=524288;class pf{static async evalTemplate(e="",t,n,r){const a=Nm.parseURL(t.saveUrl);e=await Mf(e,"page-title",(()=>t.title||"No title"),r,t.filenameReplacementCharacter),e=await Mf(e,"page-heading",(()=>t.info.heading||"No heading"),r,t.filenameReplacementCharacter),e=await Mf(e,"page-language",(()=>t.info.lang||"No language"),r,t.filenameReplacementCharacter),e=await Mf(e,"page-description",(()=>t.info.description||"No description"),r,t.filenameReplacementCharacter),e=await Mf(e,"page-author",(()=>t.info.author||"No author"),r,t.filenameReplacementCharacter),e=await Mf(e,"page-creator",(()=>t.info.creator||"No creator"),r,t.filenameReplacementCharacter),e=await Mf(e,"page-publisher",(()=>t.info.publisher||"No publisher"),r,t.filenameReplacementCharacter),await l(t.saveDate),await l(t.visitDate,"visit-"),e=await Mf(e,"url-hash",(()=>a.hash.substring(1)||"No hash"),r,t.filenameReplacementCharacter),e=await Mf(e,"url-host",(()=>a.host.replace(/\/$/,"")||"No host"),r,t.filenameReplacementCharacter),e=await Mf(e,"url-hostname",(()=>a.hostname.replace(/\/$/,"")||"No hostname"),r,t.filenameReplacementCharacter),e=await Mf(e,"url-href",(()=>i(a.href)||"No href"),void 0===r||r,t.filenameReplacementCharacter),e=await Mf(e,"url-href-flat",(()=>i(a.href)||"No href"),!1,t.filenameReplacementCharacter),e=await Mf(e,"url-referrer",(()=>i(t.referrer)||"No referrer"),void 0===r||r,t.filenameReplacementCharacter),e=await Mf(e,"url-referrer-flat",(()=>i(t.referrer)||"No referrer"),!1,t.filenameReplacementCharacter),e=await Mf(e,"url-password",(()=>a.password||"No password"),r,t.filenameReplacementCharacter),e=await Mf(e,"url-pathname",(()=>i(a.pathname).replace(/^\//,"").replace(/\/$/,"")||"No pathname"),void 0===r||r,t.filenameReplacementCharacter),e=await Mf(e,"url-pathname-flat",(()=>i(a.pathname)||"No pathname"),!1,t.filenameReplacementCharacter),e=await Mf(e,"url-port",(()=>a.port||"No port"),r,t.filenameReplacementCharacter),e=await Mf(e,"url-protocol",(()=>a.protocol||"No protocol"),r,t.filenameReplacementCharacter),e=await Mf(e,"url-search",(()=>a.search.substring(1)||"No search"),r,t.filenameReplacementCharacter);const o=a.search.substring(1).split("&").map((e=>e.split("=")));for(const[n,a]of o)e=await Mf(e,"url-search-"+n,(()=>a||""),r,t.filenameReplacementCharacter);e=e.replace(/{\s*url-search-[^}\s]*\s*}/gi,""),e=await Mf(e,"url-username",(()=>a.username||"No username"),r,t.filenameReplacementCharacter),e=await Mf(e,"tab-id",(()=>String(t.tabId||"No tab id")),r,t.filenameReplacementCharacter),e=await Mf(e,"tab-index",(()=>String(t.tabIndex||"No tab index")),r,t.filenameReplacementCharacter),e=await Mf(e,"url-last-segment",(()=>i(function(e,t){let n=e.pathname.match(/\/([^/]+)$/),r=n&&n[0];r||(n=e.href.match(/([^/]+)\/?$/),r=n&&n[0]);r||(n=r.match(/(.*)\.[^.]+$/),r=n&&n[0]);r||(r=e.hostname.replace(/\/+/g,t).replace(/\/$/,""));n=r.match(/(.*)\.[^.]+$/),n&&n[1]&&(r=n[1]);return r=r.replace(/\/$/,"").replace(/^\//,""),r}(a,t.filenameReplacementCharacter))||"No last segment"),r,t.filenameReplacementCharacter),n&&(e=await Mf(e,"digest-sha-256",(async()=>Nm.digest("SHA-256",n)),r,t.filenameReplacementCharacter),e=await Mf(e,"digest-sha-384",(async()=>Nm.digest("SHA-384",n)),r,t.filenameReplacementCharacter),e=await Mf(e,"digest-sha-512",(async()=>Nm.digest("SHA-512",n)),r,t.filenameReplacementCharacter));const s=t.bookmarkFolders&&t.bookmarkFolders.join("/")||"";return e=await Mf(e,"bookmark-pathname",(()=>s),void 0===r||r,t.filenameReplacementCharacter),e=await Mf(e,"bookmark-pathname-flat",(()=>s),!1,t.filenameReplacementCharacter),(e=await Mf(e,"profile-name",(()=>t.profileName),r,t.filenameReplacementCharacter)).trim();function i(e){try{return decodeURI(e)}catch(t){return e}}async function l(n,a=""){n&&(e=await Mf(e,a+"datetime-iso",(()=>n.toISOString()),r,t.filenameReplacementCharacter),e=await Mf(e,a+"date-iso",(()=>n.toISOString().split("T")[0]),r,t.filenameReplacementCharacter),e=await Mf(e,a+"time-iso",(()=>n.toISOString().split("T")[1].split("Z")[0]),r,t.filenameReplacementCharacter),e=await Mf(e,a+"date-locale",(()=>n.toLocaleDateString()),r,t.filenameReplacementCharacter),e=await Mf(e,a+"time-locale",(()=>n.toLocaleTimeString()),r,t.filenameReplacementCharacter),e=await Mf(e,a+"day-locale",(()=>String(n.getDate()).padStart(2,"0")),r,t.filenameReplacementCharacter),e=await Mf(e,a+"month-locale",(()=>String(n.getMonth()+1).padStart(2,"0")),r,t.filenameReplacementCharacter),e=await Mf(e,a+"year-locale",(()=>String(n.getFullYear())),r,t.filenameReplacementCharacter),e=await Mf(e,a+"datetime-locale",(()=>n.toLocaleString()),r,t.filenameReplacementCharacter),e=await Mf(e,a+"datetime-utc",(()=>n.toUTCString()),r,t.filenameReplacementCharacter),e=await Mf(e,a+"day-utc",(()=>String(n.getUTCDate()).padStart(2,"0")),r,t.filenameReplacementCharacter),e=await Mf(e,a+"month-utc",(()=>String(n.getUTCMonth()+1).padStart(2,"0")),r,t.filenameReplacementCharacter),e=await Mf(e,a+"year-utc",(()=>String(n.getUTCFullYear())),r,t.filenameReplacementCharacter),e=await Mf(e,a+"hours-locale",(()=>String(n.getHours()).padStart(2,"0")),r,t.filenameReplacementCharacter),e=await Mf(e,a+"minutes-locale",(()=>String(n.getMinutes()).padStart(2,"0")),r,t.filenameReplacementCharacter),e=await Mf(e,a+"seconds-locale",(()=>String(n.getSeconds()).padStart(2,"0")),r,t.filenameReplacementCharacter),e=await Mf(e,a+"hours-utc",(()=>String(n.getUTCHours()).padStart(2,"0")),r,t.filenameReplacementCharacter),e=await Mf(e,a+"minutes-utc",(()=>String(n.getUTCMinutes()).padStart(2,"0")),r,t.filenameReplacementCharacter),e=await Mf(e,a+"seconds-utc",(()=>String(n.getUTCSeconds()).padStart(2,"0")),r,t.filenameReplacementCharacter),e=await Mf(e,a+"time-ms",(()=>String(n.getTime())),r,t.filenameReplacementCharacter))}}static setBackgroundImage(e,t,n){e.style.setProperty("background-blend-mode","normal","important"),e.style.setProperty("background-clip","content-box","important"),e.style.setProperty("background-position",n&&n["background-position"]?n["background-position"]:"center","important"),e.style.setProperty("background-color",n&&n["background-color"]?n["background-color"]:"transparent","important"),e.style.setProperty("background-image",t,"important"),e.style.setProperty("background-size",n&&n["background-size"]?n["background-size"]:"100% 100%","important"),e.style.setProperty("background-origin","content-box","important"),e.style.setProperty("background-repeat","no-repeat","important")}static processShortcutIcons(e){let t=Uf(Array.from(e.querySelectorAll('link[href][rel="icon"], link[href][rel="shortcut icon"]')));t||(t=Uf(Array.from(e.querySelectorAll('link[href][rel*="icon"]'))),t&&(t.rel="icon")),t&&e.querySelectorAll('link[href][rel*="icon"]').forEach((e=>{e!=t&&e.remove()}))}static removeSingleLineCssComments(e){const t=[];for(let n=e.children.head;n;n=n.next){const e=n.data;"Raw"==e.type&&e.value&&e.value.trim().startsWith("//")&&t.push(n)}t.forEach((t=>e.children.remove(t)))}static async resolveImportURLs(e,t,n,r,a=new Lm){const o=function(e){return e.match(xf)||[]}(e=pf.resolveStylesheetURLs(e,t,r));return await Promise.all(o.map((async o=>{const s=function(e){const t=e.match(Sf)||e.match(Ef)||e.match(Af)||e.match(Tf)||e.match(Cf)||e.match(Rf);if(t){const[,e,n]=t;return{resourceURL:e,media:n}}}(o);if(s){const i=Df(o);let l=Lf(s.resourceURL);if(!Bf(l)&&qf(l)){try{l=Nm.resolveURL(s.resourceURL,t)}catch(e){}if(jf(l)&&!a.has(l)){const t=await async function(e){const t=await Nm.getContent(e,{maxResourceSize:n.maxResourceSize,maxResourceSizeEnabled:n.maxResourceSizeEnabled,validateTextContentType:!0,frameId:n.frameId,charset:n.charset,resourceReferrer:n.resourceReferrer});return Nf(t.data,t.charset||n.charset)?t:(n=Object.assign({},n,{charset:zf(t.data)}),Nm.getContent(e,{maxResourceSize:n.maxResourceSize,maxResourceSizeEnabled:n.maxResourceSizeEnabled,validateTextContentType:!0,frameId:n.frameId,charset:n.charset,resourceReferrer:n.resourceReferrer}))}(l);l=t.resourceURL,t.data=If(l,t,n),t.data&&t.data.match(/^<!doctype /i)&&(t.data="");let c=Hf(t.data);if(n.compressCSS&&(c=Nm.compressCSS(c)),c=function(e,t){return t?"@media "+t+"{ "+e+" }":e}(c,s.media),e.includes(o)){const t=new Lm(a);t.add(l),c=await pf.resolveImportURLs(c,l,n,r,t),r.textContent=c,e=r.sheet&&r.sheet.cssRules.length||!r.sheet&&c?e.replace(i,c):e.replace(i,"")}}else e=e.replace(i,"")}else e=e.replace(i,"")}}))),e}static resolveStylesheetURLs(e,t,n){return Of(e,!0).map((r=>{const a=Ff(r);let o=Lf(a);if(n.textContent='tmp { content:"'+o+'"}',n.sheet&&n.sheet.cssRules&&(o=Nm.removeQuotes(n.sheet.cssRules[0].style.getPropertyValue("content"))),!Bf(o))if(!o||qf(o)){let n;if(!a.startsWith("#"))try{n=Nm.resolveURL(o,t)}catch(e){}if(jf(n)&&o!=n&&e.includes(r))try{e=e.replace(Df(r),a?r.replace(a,n):"url("+n+")")}catch(e){}}else{let t;t=a?r.replace(a,cf):"url(data:null;base64,)",e=e.replace(Df(r),t)}})),e}static async resolveLinkStylesheetURLs(e,t,n,r){if((e=Lf(e))&&e!=t&&e!=lf){const a=await Nm.getContent(e,{maxResourceSize:n.maxResourceSize,maxResourceSizeEnabled:n.maxResourceSizeEnabled,charset:n.charset,frameId:n.frameId,resourceReferrer:n.resourceReferrer,validateTextContentType:!0});if(!Nf(a.data,a.charset||n.charset))return n=Object.assign({},n,{charset:zf(a.data)}),pf.resolveLinkStylesheetURLs(e,t,n,r);e=a.resourceURL,a.data=If(a.resourceURL,a,n),a.data&&a.data.match(/^<!doctype /i)&&(a.data="");let o=Hf(a.data);return n.compressCSS&&(o=Nm.compressCSS(o)),o=await pf.resolveImportURLs(o,e,n,r),o}}static async processStylesheet(e,t,n,r,a){const o=[],s=[];for(let l=e.head;l;l=l.next){const e=l.data;"Atrule"==e.type&&"charset"==e.name?s.push(l):e.block&&e.block.children&&("Rule"==e.type?o.push(this.processStyle(e.block.children.toArray(),t,n,r,a)):"Atrule"!=e.type||"media"!=e.name&&"supports"!=e.name?"Atrule"==e.type&&"font-face"==e.name&&o.push(i(e,n.fontURLs)):o.push(this.processStylesheet(e.block.children,t,n,r,a)))}async function i(e,t){await Promise.all(e.block.children.toArray().map((async e=>{if("Declaration"==e.type&&e.value.children){const n=Of(Pf(e.value),!0);await Promise.all(n.map((async n=>{const r=Ff(n),o=Lf(r);if(!Bf(o)&&jf(o)){let{content:n}=await a.addURL(o,!0,"font"),s=t.get(e);s||(s=[],t.set(e,s)),s.push(o),function(e,t,n){e.value.children.forEach((e=>{"Url"==e.type&&Nm.removeQuotes(Pf(e.value))==t&&(e.value.value=n)}))}(e,r,n)}})))}})))}s.forEach((t=>e.remove(t))),await Promise.all(o)}static async processStyle(e,t,n,r,a){function o(e,t,n,r=0){for(let a=t.head;a;a=a.next)a.data.children&&o(e,a.data.children,n,r+1),"Url"==a.data.type&&Nm.removeQuotes(Pf(a.data.value))==e&&n(a,t,0==r)}await Promise.all(e.map((async e=>{if(e.value&&!e.value.children&&"Raw"==e.value.type)try{e.value=zm.parse(e.value.value,{context:"value"})}catch(e){}if("Declaration"==e.type&&e.value.children){const t=Of(Pf(e.value));await Promise.all(t.map((async t=>{const s=Ff(t),i=Lf(s);if(!Bf(i)&&jf(i)){let t,{content:l,indexResource:c,duplicate:u}=await a.addURL(i,!0,"image",!0);const h=[];o(s,e.value.children,((e,r,a)=>{if(!s.startsWith("#"))if(u&&n.groupDuplicateImages&&a&&Nm.getContentSize(l)<df){const n=zm.parse("var("+hf+c+")",{context:"value"}).children.head;h.push({parent:r,token:e,value:n}),t=!0}else e.data.value.value=l})),t&&(r.set(c,l),h.forEach((({parent:e,token:t,value:n})=>e.replace(t,n))))}})))}})))}static async processAttribute(e,t,n,r,a,o,s,i,l){await Promise.all(Array.from(e).map((async e=>{let c=e.getAttribute(t);if(null!=c){c=Lf(c);let u=e.dataset.singleFileOriginURL;if(delete e.dataset.singleFileOriginURL,!Bf(c)&&(e.setAttribute(t,Zm),qf(c))){try{c=Nm.resolveURL(c,n)}catch(e){}if(jf(c)){let{content:h,indexResource:d,duplicate:p}=await s.addURL(c,!0,"image","IMG"==e.tagName&&"src"==t);if(u&&h==cf){try{u=Nm.resolveURL(u,n)}catch(e){}try{c=u,h=(await Nm.getContent(c,{asBinary:!0,expectedType:"image",maxResourceSize:r.maxResourceSize,maxResourceSizeEnabled:r.maxResourceSizeEnabled,frameId:r.windowId,resourceReferrer:r.resourceReferrer})).data}catch(e){}}if(l&&h==cf)e.remove();else{if(!Qm.filter((e=>h.startsWith(e))).length){const n=h.startsWith(Jm);if(i&&p&&r.groupDuplicateImages&&!n&&Nm.getContentSize(h)<df)if(pf.replaceImageSource(e,hf+d,r)){a.set(d,h);const t=zm.parse(e.getAttribute("style"),{context:"declarationList"});o.set(e,t)}else e.setAttribute(t,h);else e.setAttribute(t,h)}}}}}})))}static async processXLinks(e,t,n,r){let a="xlink:href";await Promise.all(Array.from(e).map((async e=>{let o=e.getAttribute(a);null==o&&(a="href",o=e.getAttribute(a));let s=Lf(o);if(qf(s)&&!Bf(s)){e.setAttribute(a,Zm);try{s=Nm.resolveURL(s,t)}catch(e){}if(jf(s)){const{content:t}=await r.addURL(s),n=o.match(uf);if(n&&n[0]){let r;try{r=Nm.parseSVGContent(t).querySelector(n[0])}catch(e){}r&&(e.setAttribute(a,n[0]),e.parentElement.insertBefore(r,e.parentElement.firstChild))}else e.setAttribute(a,"data:image/svg+xml,"+t)}}else s==n.url&&e.setAttribute(a,o.substring(s.length))})))}static async processSrcset(e,t,n,r){await Promise.all(Array.from(e).map((async e=>{const a=Nm.parseSrcset(e.getAttribute(t)),o=await Promise.all(a.map((async e=>{let t=Lf(e.url);if(Bf(t))return t+(e.w?" "+e.w+"w":e.d?" "+e.d+"x":"");if(qf(t)){try{t=Nm.resolveURL(t,n)}catch(e){}if(jf(t)){const{content:n}=await r.addURL(t,!0,"image");return Qm.filter((e=>n.startsWith(e))).length?"":n+(e.w?" "+e.w+"w":e.d?" "+e.d+"x":"")}return""}return""})));e.setAttribute(t,o.join(", "))})))}static replaceImageSource(e,t,n){if(e.getAttribute(Nm.IMAGE_ATTRIBUTE_NAME)){const r=n.images[Number(e.getAttribute(Nm.IMAGE_ATTRIBUTE_NAME))];if(r&&r.replaceable){e.setAttribute("src",`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="${r.size.pxWidth}" height="${r.size.pxHeight}"><rect fill-opacity="0"/></svg>`);const n={};return("content"==r.objectFit||"cover"==r.objectFit)&&r.objectFit&&(n["background-size"]=r.objectFit),r.objectPosition&&(n["background-position"]=r.objectPosition),r.backgroundColor&&(n["background-color"]=r.backgroundColor),pf.setBackgroundImage(e,"var("+t+")",n),e.removeAttribute(Nm.IMAGE_ATTRIBUTE_NAME),!0}}}}const mf=/^https?:\/\//,ff=/^file:\/\//,gf=/^https?:\/\/+\s*$/,yf=/^(https?:\/\/|file:\/\/|blob:).+/,bf=/(url\s*\(\s*'(.*?)'\s*\))|(url\s*\(\s*"(.*?)"\s*\))|(url\s*\(\s*(.*?)\s*\))/gi,vf=/^url\s*\(\s*'(.*?)'\s*\)$/i,kf=/^url\s*\(\s*"(.*?)"\s*\)$/i,wf=/^url\s*\(\s*(.*?)\s*\)$/i,xf=/(@import\s*url\s*\(\s*'(.*?)'\s*\)\s*(.*?)(;|$|}))|(@import\s*url\s*\(\s*"(.*?)"\s*\)\s*(.*?)(;|$|}))|(@import\s*url\s*\(\s*(.*?)\s*\)\s*(.*?)(;|$|}))|(@import\s*'(.*?)'\s*(.*?)(;|$|}))|(@import\s*"(.*?)"\s*(.*?)(;|$|}))|(@import\s*(.*?)\s*(.*?)(;|$|}))/gi,Sf=/@import\s*url\s*\(\s*'(.*?)'\s*\)\s*(.*?)(;|$|})/i,Ef=/@import\s*url\s*\(\s*"(.*?)"\s*\)\s*(.*?)(;|$|})/i,Af=/@import\s*url\s*\(\s*(.*?)\s*\)\s*(.*?)(;|$|})/i,Tf=/@import\s*'(.*?)'\s*(.*?)(;|$|})/i,Cf=/@import\s*"(.*?)"\s*(.*?)(;|$|})/i,Rf=/@import\s*(.*?)\s*(.*?)(;|$|})/i,_f=/([{}()^$&.*?/+|[\\\\]|\]|-)/g;function If(e,t,n){return n.rootDocument&&n.updatedResources[e]?(n.updatedResources[e].retrieved=!0,n.updatedResources[e].content):t.data||""}function Lf(e){return!e||e.startsWith(sf)?e:e.split("#")[0]}function Pf(e){let t="";try{t=zm.generate(e)}catch(e){}return t}function Nf(e,t="utf-8"){const n=zf(e);return!n||n==t.toLowerCase()}function zf(e){const t=e.match(/^@charset\s+"([^"]*)";/i);if(t&&t[1])return t[1].toLowerCase().trim()}async function Mf(e,t,n,r,a){let o;if(e){const s="{\\s*"+t.replace(/\W|_/g,"[$&]")+"\\s*}";let i=new RegExp(s+"\\[\\d+\\]","g");if(e.match(i)){const t=e.match(i)[0];o=Number(t.match(/\[(\d+)\]$/)[1]),(isNaN(o)||o<=0)&&(o=null)}else i=new RegExp(s,"g");if(e.match(i)){let t=await n();return r||(t=t.replace(/\/+/g,a)),o&&(t=await Nm.truncateText(t,o)),e.replace(i,t)}}return e}function Df(e){return new RegExp(e.replace(_f,"\\$1"),"gi")}function Of(e,t){const n=e.match(bf)||[];return t?[...new Lm(n)]:n}function Uf(e){return(e=e.filter((e=>e.href!=Zm))).sort(((e,t)=>(parseInt(t.sizes,10)||16)-(parseInt(e.sizes,10)||16))),e[0]}function Ff(e){const t=e.match(vf)||e.match(kf)||e.match(wf);return t&&t[1]}function Bf(e){return e&&(e.startsWith(sf)||e==lf)}function qf(e){return e&&!e.match(gf)}function jf(e){return qf(e)&&(e.match(mf)||e.match(ff)||e.startsWith("blob:"))&&e.match(yf)}function Hf(e){try{return e.replace(/\/\*(.|\s)*?\*\//g,"")}catch(t){let n,r;do{n=e.indexOf("/*"),r=e.indexOf("*/",n+2),-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substr(r+2))}while(-1!=n&&-1!=r);return e}}const Wf={discarded:{"HTML bytes":0,"hidden elements":0,"HTML imports":0,scripts:0,objects:0,"audio sources":0,"video sources":0,frames:0,"CSS rules":0,canvas:0,stylesheets:0,resources:0,medias:0},processed:{"HTML bytes":0,"hidden elements":0,"HTML imports":0,scripts:0,objects:0,"audio sources":0,"video sources":0,frames:0,"CSS rules":0,canvas:0,stylesheets:0,resources:0,medias:0}};class Vf{constructor(e){this.options=e,e.displayStats&&(this.data=JSON.parse(JSON.stringify(Wf)))}set(e,t,n){this.options.displayStats&&(this.data[e][t]=n)}add(e,t,n){this.options.displayStats&&(this.data[e][t]+=n)}addAll(e){this.options.displayStats&&(Object.keys(this.data.discarded).forEach((t=>this.add("discarded",t,e.stats.discarded[t]||0))),Object.keys(this.data.processed).forEach((t=>this.add("processed",t,e.stats.processed[t]||0))))}}const $f=1048576,Yf=["~","+","\\\\","?","%","*",":","|",'"',"<",">","\0-",""],Gf=globalThis.URL,Kf=globalThis.DOMParser,Qf=globalThis.Blob,Jf=globalThis.FileReader,Zf=e=>globalThis.fetch(e),Xf=globalThis.crypto,eg=globalThis.TextDecoder,tg=globalThis.TextEncoder;function ng(e){return(e=e||{}).fetch=e.fetch||Zf,e.frameFetch=e.frameFetch||e.fetch||Zf,{getContent:async function(t,n){let r;const a=e.fetch,o=e.frameFetch;try{if(n.frameId)try{r=await o(t,{frameId:n.frameId,referrer:n.resourceReferrer})}catch(e){r=await a(t)}else r=await a(t,{referrer:n.resourceReferrer})}catch(e){return{data:n.asBinary?"data:null;base64,":"",resourceURL:t}}let s;try{s=await r.arrayBuffer()}catch(e){return{data:n.asBinary?"data:null;base64,":"",resourceURL:t}}t=r.url||t;let i,l="";try{const e=new Ud(r.headers.get("content-type"));l=e.type+"/"+e.subtype,i=e.parameters.get("charset")}catch(e){}l||(l=function(e,t){if("image"==e){if(n([255,255,255,255],[0,0,1,0]))return"image/x-icon";if(n([255,255,255,255],[0,0,2,0]))return"image/x-icon";if(n([255,255],[78,77]))return"image/bmp";if(n([255,255,255,255,255,255],[71,73,70,56,57,97]))return"image/gif";if(n([255,255,255,255,255,255],[71,73,70,56,59,97]))return"image/gif";if(n([255,255,255,255,0,0,0,0,255,255,255,255,255,255],[82,73,70,70,0,0,0,0,87,69,66,80,86,80]))return"image/webp";if(n([255,255,255,255,255,255,255,255],[137,80,78,71,13,10,26,10]))return"image/png";if(n([255,255,255],[255,216,255]))return"image/jpeg"}if("font"==e){if(n([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76,80]))return"application/vnd.ms-fontobject";if(n([255,255,255,255],[0,1,0,0]))return"font/ttf";if(n([255,255,255,255],[79,84,84,79]))return"font/otf";if(n([255,255,255,255],[116,116,99,102]))return"font/collection";if(n([255,255,255,255],[119,79,70,70]))return"font/woff";if(n([255,255,255,255],[119,79,70,50]))return"font/woff2"}function n(e,n){let r=!0,a=0;if(t.byteLength>=n.length){const o=new Uint8Array(t,0,e.length);for(a=0;a<e.length&&r;a++)r=r&&(o[a]&e[a])==n[a];return r}}}(n.expectedType,s));!i&&n.charset&&(i=n.charset);if(n.asBinary)try{if(n.maxResourceSizeEnabled&&s.byteLength>n.maxResourceSize*$f)return{data:"data:null;base64,",resourceURL:t};{const e=new Jf;e.readAsDataURL(new Qf([s],{type:l+(n.charset?";charset="+n.charset:"")}));return{data:await new Promise(((t,n)=>{e.addEventListener("load",(()=>t(e.result)),!1),e.addEventListener("error",n,!1)})),resourceURL:t}}}catch(e){return{data:"data:null;base64,",resourceURL:t}}else{if(r.status>=400||n.validateTextContentType&&l&&!l.startsWith("text/"))return{data:"",resourceURL:t};if(i||(i="utf-8"),n.maxResourceSizeEnabled&&s.byteLength>n.maxResourceSize*$f)return{data:"",resourceURL:t,charset:i};try{return{data:new eg(i).decode(s),resourceURL:t,charset:i}}catch(e){try{return i="utf-8",{data:new eg(i).decode(s),resourceURL:t,charset:i}}catch(e){return{data:"",resourceURL:t,charset:i}}}}},parseURL:(e,t)=>void 0===t?new Gf(e):new Gf(e,t),resolveURL(e,t){return this.parseURL(e,t).href},getValidFilename:(e,t=Yf,n="_")=>(t.forEach((t=>e=e.replace(new RegExp("["+t+"]+","g"),n))),e=e.replace(/\.\.\//g,"").replace(/^\/+/,"").replace(/\/+/g,"/").replace(/\/$/,"").replace(/\.$/,"").replace(/\.\//g,"."+n).replace(/\/\./g,"/"+n)),parseDocContent(e,t){const n=(new Kf).parseFromString(e,"text/html");n.head||n.documentElement.insertBefore(n.createElement("HEAD"),n.body);let r=n.querySelector("base");return r&&r.getAttribute("href")||(r&&r.remove(),r=n.createElement("base"),r.setAttribute("href",t),n.head.insertBefore(r,n.head.firstChild)),n},parseXMLContent:e=>(new Kf).parseFromString(e,"text/xml"),parseSVGContent:e=>(new Kf).parseFromString(e,"image/svg+xml"),async digest(e,t){try{return function(e){const t=[],n=new DataView(e);for(let e=0;e<n.byteLength;e+=4){const r="00000000",a=(r+n.getUint32(e).toString(16)).slice(-r.length);t.push(a)}return t.join("")}(await Xf.subtle.digest(e,new tg("utf-8").encode(t)))}catch(e){return""}},getContentSize:e=>new Qf([e]).size,truncateText(e,t){const n=new Qf([e]),r=new Jf;return r.readAsText(n.slice(0,t)),new Promise(((n,a)=>{r.addEventListener("load",(()=>{e.startsWith(r.result)?n(r.result):this.truncateText(e,t-1).then(n).catch(a)}),!1),r.addEventListener("error",a,!1)}))},minifyHTML:(e,t)=>vm(e,t),minifyCSSRules:(e,t,n)=>tm(e,t,n),removeUnusedFonts:(e,t,n,r)=>yp(e,t,n,r),removeAlternativeFonts:(e,t,n,r)=>np(e,t,n,r),getMediaAllInfo:(e,t,n)=>Up(e,t,n),compressCSS:(e,t)=>$n(e,t),minifyMedias:e=>Qp(e),removeAlternativeImages:e=>sm(e),parseSrcset:e=>Nd(e),preProcessDoc:(e,t,n)=>Y(e,t,n),postProcessDoc(e,t){Z(e,t)},serialize:(e,t)=>Tm(e,t),removeQuotes:e=>re(e),ON_BEFORE_CAPTURE_EVENT_NAME:b,ON_AFTER_CAPTURE_EVENT_NAME:v,WIN_ID_ATTRIBUTE_NAME:T,REMOVED_CONTENT_ATTRIBUTE_NAME:k,HIDDEN_CONTENT_ATTRIBUTE_NAME:w,HIDDEN_FRAME_ATTRIBUTE_NAME:S,IMAGE_ATTRIBUTE_NAME:C,POSTER_ATTRIBUTE_NAME:R,CANVAS_ATTRIBUTE_NAME:_,HTML_IMPORT_ATTRIBUTE_NAME:I,INPUT_VALUE_ATTRIBUTE_NAME:L,SHADOW_ROOT_ATTRIBUTE_NAME:A,PRESERVED_SPACE_ELEMENT_ATTRIBUTE_NAME:E,STYLESHEET_ATTRIBUTE_NAME:N,SELECTED_CONTENT_ATTRIBUTE_NAME:M,COMMENT_HEADER:j,COMMENT_HEADER_LEGACY:H,SINGLE_FILE_UI_ELEMENT_CLASS:W}}function rg(t){e.SingleFile=function(...e){return[Nm,zm]=e,Mm}(ng(t),Pd)}e.SingleFile=void 0,e.getPageData=async function(t={},n,r=globalThis.document,a=globalThis){const o=nt;let s;if(rg(n),r&&a){$(r);const e=[];if(!t.saveRawPage){if(!t.removeFrames&&o&&globalThis.frames&&globalThis.frames.length){let n;n=t.loadDeferredImages?new Promise((e=>globalThis.setTimeout((()=>e(o.getAsync(t))),t.loadDeferredImagesMaxIdleTime-o.TIMEOUT_INIT_REQUEST_MESSAGE))):o.getAsync(t),e.push(n)}t.loadDeferredImages&&e.push(ge(t))}[t.frames]=await Promise.all(e),s=t.frames&&t.frames.sessionId}t.doc=r,t.win=a,t.insertCanonicalLink=!0,t.onprogress=e=>{e.type===e.RESOURCES_INITIALIZED&&r&&a&&t.loadDeferredImages&&ye(t)};const i=new e.SingleFile(t);return await i.run(),s&&o.cleanup(s),await i.getPageData()},e.helper=se,e.init=rg,e.modules=Im,e.processors=st,e.vendor=Fd,Object.defineProperty(e,"__esModule",{value:!0})}));