const visitSkip=Symbol() const visit=(node,visitor,parentNode)=>{const callbacks=visitor[node.type] if(callbacks?.enter){const symbol=callbacks.enter(node,parentNode) if(symbol===visitSkip)return}if(node.type==="root")for(const child of node.children)visit(child,visitor,node) if(node.type==="element"&&parentNode.children.includes(node))for(const child of node.children)visit(child,visitor,node) callbacks?.exit&&callbacks.exit(node,parentNode)} const invokePlugins=(ast,info,plugins,overrides,globalOverrides)=>{for(const plugin of plugins){const override=overrides?.[plugin.name] if(override===false)continue const params={...plugin.params,...globalOverrides,...override} const visitor=plugin.fn(ast,params,info) visitor!=null&&visit(ast,visitor)}} const createPreset=({name:name,plugins:plugins})=>({name:name,isPreset:true,plugins:Object.freeze(plugins),fn:(ast,params,info)=>{const{floatPrecision:floatPrecision,overrides:overrides}=params const globalOverrides={} floatPrecision!=null&&(globalOverrides.floatPrecision=floatPrecision) if(overrides){const pluginNames=plugins.map((({name:name})=>name)) for(const pluginName of Object.keys(overrides))pluginNames.includes(pluginName)||console.warn(`You are trying to configure ${pluginName} which is not part of ${name}.\nTry to put it before or after, for example\n\nplugins: [\n {\n name: '${name}',\n },\n '${pluginName}'\n]\n`)}invokePlugins(ast,info,plugins,overrides,globalOverrides)}}) var ElementType;(function(ElementType){ElementType["Root"]="root" ElementType["Text"]="text" ElementType["Directive"]="directive" ElementType["Comment"]="comment" ElementType["Script"]="script" ElementType["Style"]="style" ElementType["Tag"]="tag" ElementType["CDATA"]="cdata" ElementType["Doctype"]="doctype"})(ElementType||(ElementType={})) function isTag$2(elem){return elem.type===ElementType.Tag||elem.type===ElementType.Script||elem.type===ElementType.Style}const Root=ElementType.Root const Text=ElementType.Text const Directive=ElementType.Directive const Comment$4=ElementType.Comment const Script=ElementType.Script const Style=ElementType.Style const Tag=ElementType.Tag const CDATA=ElementType.CDATA const Doctype=ElementType.Doctype function isTag$1(node){return isTag$2(node)}function isCDATA(node){return node.type===ElementType.CDATA}function isText(node){return node.type===ElementType.Text}function isComment(node){return node.type===ElementType.Comment}function isDocument(node){return node.type===ElementType.Root}function hasChildren(node){return Object.prototype.hasOwnProperty.call(node,"children")}const xmlReplacer=/["&'<>$\x80-\uFFFF]/g const xmlCodeMap=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]) const getCodePoint=String.prototype.codePointAt!=null?(str,index)=>str.codePointAt(index):(c,index)=>(c.charCodeAt(index)&0xfc00)===0xd800?0x400*(c.charCodeAt(index)-0xd800)+c.charCodeAt(index+1)-0xdc00+0x10000:c.charCodeAt(index) function encodeXML(str){let ret="" let lastIdx=0 let match while((match=xmlReplacer.exec(str))!==null){const i=match.index const char=str.charCodeAt(i) const next=xmlCodeMap.get(char) if(next!==void 0){ret+=str.substring(lastIdx,i)+next lastIdx=i+1}else{ret+=`${str.substring(lastIdx,i)}&#x${getCodePoint(str,i).toString(16)};` lastIdx=xmlReplacer.lastIndex+=Number((char&0xfc00)===0xd800)}}return ret+str.substr(lastIdx)}function getEscaper(regex,map){return function escape(data){let match let lastIdx=0 let result="" while(match=regex.exec(data)){lastIdx!==match.index&&(result+=data.substring(lastIdx,match.index)) result+=map.get(match[0].charCodeAt(0)) lastIdx=match.index+1}return result+data.substring(lastIdx)}}const escapeAttribute=getEscaper(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])) const escapeText=getEscaper(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]])) const elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((val=>[val.toLowerCase(),val]))) const attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((val=>[val.toLowerCase(),val]))) const unencodedElements=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]) function replaceQuotes(value){return value.replace(/"/g,""")}function formatAttributes(attributes,opts){var _a if(!attributes)return const encode=((_a=opts.encodeEntities)!==null&&_a!==void 0?_a:opts.decodeEntities)===false?replaceQuotes:opts.xmlMode||opts.encodeEntities!=="utf8"?encodeXML:escapeAttribute return Object.keys(attributes).map((key=>{var _a,_b const value=(_a=attributes[key])!==null&&_a!==void 0?_a:"" opts.xmlMode==="foreign"&&(key=(_b=attributeNames.get(key))!==null&&_b!==void 0?_b:key) if(!opts.emptyAttrs&&!opts.xmlMode&&value==="")return key return`${key}="${encode(value)}"`})).join(" ")}const singleTag=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]) function render(node,options={}){const nodes="length"in node?node:[node] let output="" for(let i=0;i0&&(tag+=render(elem.children,opts)) !opts.xmlMode&&singleTag.has(elem.name)||(tag+=``)}return tag}function renderDirective(elem){return`<${elem.data}>`}function renderText(elem,opts){var _a let data=elem.data||"";((_a=opts.encodeEntities)!==null&&_a!==void 0?_a:opts.decodeEntities)===false||!opts.xmlMode&&elem.parent&&unencodedElements.has(elem.parent.name)||(data=opts.xmlMode||opts.encodeEntities!=="utf8"?encodeXML(data):escapeText(data)) return data}function renderCdata(elem){return``}function renderComment(elem){return`\x3c!--${elem.data}--\x3e`}function getOuterHTML(node,options){return render(node,options)}function getInnerHTML(node,options){return hasChildren(node)?node.children.map((node=>getOuterHTML(node,options))).join(""):""}function getText$1(node){if(Array.isArray(node))return node.map(getText$1).join("") if(isTag$1(node))return node.name==="br"?"\n":getText$1(node.children) if(isCDATA(node))return getText$1(node.children) if(isText(node))return node.data return""}function textContent(node){if(Array.isArray(node))return node.map(textContent).join("") if(hasChildren(node)&&!isComment(node))return textContent(node.children) if(isText(node))return node.data return""}function innerText(node){if(Array.isArray(node))return node.map(innerText).join("") if(hasChildren(node)&&(node.type===ElementType.Tag||isCDATA(node)))return innerText(node.children) if(isText(node))return node.data return""}function getChildren$1(elem){return hasChildren(elem)?elem.children:[]}function getParent(elem){return elem.parent||null}function getSiblings(elem){const parent=getParent(elem) if(parent!=null)return getChildren$1(parent) const siblings=[elem] let{prev:prev,next:next}=elem while(prev!=null){siblings.unshift(prev);({prev:prev}=prev)}while(next!=null){siblings.push(next);({next:next}=next)}return siblings}function getAttributeValue$1(elem,name){var _a return(_a=elem.attribs)===null||_a===void 0?void 0:_a[name]}function hasAttrib$1(elem,name){return elem.attribs!=null&&Object.prototype.hasOwnProperty.call(elem.attribs,name)&&elem.attribs[name]!=null}function getName$1(elem){return elem.name}function nextElementSibling(elem){let{next:next}=elem while(next!==null&&!isTag$1(next))({next:next}=next) return next}function prevElementSibling(elem){let{prev:prev}=elem while(prev!==null&&!isTag$1(prev))({prev:prev}=prev) return prev}function removeElement(elem){elem.prev&&(elem.prev.next=elem.next) elem.next&&(elem.next.prev=elem.prev) if(elem.parent){const childs=elem.parent.children const childsIndex=childs.lastIndexOf(elem) childsIndex>=0&&childs.splice(childsIndex,1)}elem.next=null elem.prev=null elem.parent=null}function replaceElement(elem,replacement){const prev=replacement.prev=elem.prev prev&&(prev.next=replacement) const next=replacement.next=elem.next next&&(next.prev=replacement) const parent=replacement.parent=elem.parent if(parent){const childs=parent.children childs[childs.lastIndexOf(elem)]=replacement elem.parent=null}}function appendChild(parent,child){removeElement(child) child.next=null child.parent=parent if(parent.children.push(child)>1){const sibling=parent.children[parent.children.length-2] sibling.next=child child.prev=sibling}else child.prev=null}function append$1(elem,next){removeElement(next) const{parent:parent}=elem const currNext=elem.next next.next=currNext next.prev=elem elem.next=next next.parent=parent if(currNext){currNext.prev=next if(parent){const childs=parent.children childs.splice(childs.lastIndexOf(currNext),0,next)}}else parent&&parent.children.push(next)}function prependChild(parent,child){removeElement(child) child.parent=parent child.prev=null if(parent.children.unshift(child)!==1){const sibling=parent.children[1] sibling.prev=child child.next=sibling}else child.next=null}function prepend(elem,prev){removeElement(prev) const{parent:parent}=elem if(parent){const childs=parent.children childs.splice(childs.indexOf(elem),0,prev)}elem.prev&&(elem.prev.next=prev) prev.parent=parent prev.prev=elem.prev prev.next=elem elem.prev=prev}function filter(test,node,recurse=true,limit=1/0){return find$3(test,Array.isArray(node)?node:[node],recurse,limit)}function find$3(test,nodes,recurse,limit){const result=[] const nodeStack=[nodes] const indexStack=[0] for(;;){if(indexStack[0]>=nodeStack[0].length){if(indexStack.length===1)return result nodeStack.shift() indexStack.shift() continue}const elem=nodeStack[0][indexStack[0]++] if(test(elem)){result.push(elem) if(--limit<=0)return result}if(recurse&&hasChildren(elem)&&elem.children.length>0){indexStack.unshift(0) nodeStack.unshift(elem.children)}}}function findOneChild(test,nodes){return nodes.find(test)}function findOne$1(test,nodes,recurse=true){let elem=null for(let i=0;i0&&(elem=findOne$1(test,node.children,true))}return elem}function existsOne$1(test,nodes){return nodes.some((checked=>isTag$1(checked)&&(test(checked)||existsOne$1(test,checked.children))))}function findAll$4(test,nodes){const result=[] const nodeStack=[nodes] const indexStack=[0] for(;;){if(indexStack[0]>=nodeStack[0].length){if(nodeStack.length===1)return result nodeStack.shift() indexStack.shift() continue}const elem=nodeStack[0][indexStack[0]++] if(!isTag$1(elem))continue test(elem)&&result.push(elem) if(elem.children.length>0){indexStack.unshift(0) nodeStack.unshift(elem.children)}}}const Checks={tag_name(name){if(typeof name==="function")return elem=>isTag$1(elem)&&name(elem.name) if(name==="*")return isTag$1 return elem=>isTag$1(elem)&&elem.name===name},tag_type(type){if(typeof type==="function")return elem=>type(elem.type) return elem=>elem.type===type},tag_contains(data){if(typeof data==="function")return elem=>isText(elem)&&data(elem.data) return elem=>isText(elem)&&elem.data===data}} function getAttribCheck(attrib,value){if(typeof value==="function")return elem=>isTag$1(elem)&&value(elem.attribs[attrib]) return elem=>isTag$1(elem)&&elem.attribs[attrib]===value}function combineFuncs(a,b){return elem=>a(elem)||b(elem)}function compileTest(options){const funcs=Object.keys(options).map((key=>{const value=options[key] return Object.prototype.hasOwnProperty.call(Checks,key)?Checks[key](value):getAttribCheck(key,value)})) return funcs.length===0?null:funcs.reduce(combineFuncs)}function testElement(options,node){const test=compileTest(options) return!test||test(node)}function getElements(options,nodes,recurse,limit=1/0){const test=compileTest(options) return test?filter(test,nodes,recurse,limit):[]}function getElementById(id,nodes,recurse=true){Array.isArray(nodes)||(nodes=[nodes]) return findOne$1(getAttribCheck("id",id),nodes,recurse)}function getElementsByTagName(tagName,nodes,recurse=true,limit=1/0){return filter(Checks["tag_name"](tagName),nodes,recurse,limit)}function getElementsByTagType(type,nodes,recurse=true,limit=1/0){return filter(Checks["tag_type"](type),nodes,recurse,limit)}function removeSubsets(nodes){let idx=nodes.length while(--idx>=0){const node=nodes[idx] if(idx>0&&nodes.lastIndexOf(node,idx-1)>=0){nodes.splice(idx,1) continue}for(let ancestor=node.parent;ancestor;ancestor=ancestor.parent)if(nodes.includes(ancestor)){nodes.splice(idx,1) break}}return nodes}var DocumentPosition;(function(DocumentPosition){DocumentPosition[DocumentPosition["DISCONNECTED"]=1]="DISCONNECTED" DocumentPosition[DocumentPosition["PRECEDING"]=2]="PRECEDING" DocumentPosition[DocumentPosition["FOLLOWING"]=4]="FOLLOWING" DocumentPosition[DocumentPosition["CONTAINS"]=8]="CONTAINS" DocumentPosition[DocumentPosition["CONTAINED_BY"]=16]="CONTAINED_BY"})(DocumentPosition||(DocumentPosition={})) function compareDocumentPosition(nodeA,nodeB){const aParents=[] const bParents=[] if(nodeA===nodeB)return 0 let current=hasChildren(nodeA)?nodeA:nodeA.parent while(current){aParents.unshift(current) current=current.parent}current=hasChildren(nodeB)?nodeB:nodeB.parent while(current){bParents.unshift(current) current=current.parent}const maxIdx=Math.min(aParents.length,bParents.length) let idx=0 while(idxsiblings.indexOf(bSibling)){if(sharedParent===nodeB)return DocumentPosition.FOLLOWING|DocumentPosition.CONTAINED_BY return DocumentPosition.FOLLOWING}if(sharedParent===nodeA)return DocumentPosition.PRECEDING|DocumentPosition.CONTAINS return DocumentPosition.PRECEDING}function uniqueSort(nodes){nodes=nodes.filter(((node,i,arr)=>!arr.includes(node,i+1))) nodes.sort(((a,b)=>{const relative=compareDocumentPosition(a,b) if(relative&DocumentPosition.PRECEDING)return-1 if(relative&DocumentPosition.FOLLOWING)return 1 return 0})) return nodes}function getFeed(doc){const feedRoot=getOneElement(isValidFeed,doc) return feedRoot?feedRoot.name==="feed"?getAtomFeed(feedRoot):getRssFeed(feedRoot):null}function getAtomFeed(feedRoot){var _a const childs=feedRoot.children const feed={type:"atom",items:getElementsByTagName("entry",childs).map((item=>{var _a const{children:children}=item const entry={media:getMediaElements(children)} addConditionally(entry,"id","id",children) addConditionally(entry,"title","title",children) const href=(_a=getOneElement("link",children))===null||_a===void 0?void 0:_a.attribs["href"] href&&(entry.link=href) const description=fetch("summary",children)||fetch("content",children) description&&(entry.description=description) const pubDate=fetch("updated",children) pubDate&&(entry.pubDate=new Date(pubDate)) return entry}))} addConditionally(feed,"id","id",childs) addConditionally(feed,"title","title",childs) const href=(_a=getOneElement("link",childs))===null||_a===void 0?void 0:_a.attribs["href"] href&&(feed.link=href) addConditionally(feed,"description","subtitle",childs) const updated=fetch("updated",childs) updated&&(feed.updated=new Date(updated)) addConditionally(feed,"author","email",childs,true) return feed}function getRssFeed(feedRoot){var _a,_b const childs=(_b=(_a=getOneElement("channel",feedRoot.children))===null||_a===void 0?void 0:_a.children)!==null&&_b!==void 0?_b:[] const feed={type:feedRoot.name.substr(0,3),id:"",items:getElementsByTagName("item",feedRoot.children).map((item=>{const{children:children}=item const entry={media:getMediaElements(children)} addConditionally(entry,"id","guid",children) addConditionally(entry,"title","title",children) addConditionally(entry,"link","link",children) addConditionally(entry,"description","description",children) const pubDate=fetch("pubDate",children)||fetch("dc:date",children) pubDate&&(entry.pubDate=new Date(pubDate)) return entry}))} addConditionally(feed,"title","title",childs) addConditionally(feed,"link","link",childs) addConditionally(feed,"description","description",childs) const updated=fetch("lastBuildDate",childs) updated&&(feed.updated=new Date(updated)) addConditionally(feed,"author","managingEditor",childs,true) return feed}const MEDIA_KEYS_STRING=["url","type","lang"] const MEDIA_KEYS_INT=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"] function getMediaElements(where){return getElementsByTagName("media:content",where).map((elem=>{const{attribs:attribs}=elem const media={medium:attribs["medium"],isDefault:!!attribs["isDefault"]} for(const attrib of MEDIA_KEYS_STRING)attribs[attrib]&&(media[attrib]=attribs[attrib]) for(const attrib of MEDIA_KEYS_INT)attribs[attrib]&&(media[attrib]=parseInt(attribs[attrib],10)) attribs["expression"]&&(media.expression=attribs["expression"]) return media}))}function getOneElement(tagName,node){return getElementsByTagName(tagName,node,true,1)[0]}function fetch(tagName,where,recurse=false){return textContent(getElementsByTagName(tagName,where,recurse,1)).trim()}function addConditionally(obj,prop,tagName,where,recurse=false){const val=fetch(tagName,where,recurse) val&&(obj[prop]=val)}function isValidFeed(value){return value==="rss"||value==="feed"||value==="rdf:RDF"}var DomUtils=Object.freeze({__proto__:null,get DocumentPosition(){return DocumentPosition},append:append$1,appendChild:appendChild,compareDocumentPosition:compareDocumentPosition,existsOne:existsOne$1,filter:filter,find:find$3,findAll:findAll$4,findOne:findOne$1,findOneChild:findOneChild,getAttributeValue:getAttributeValue$1,getChildren:getChildren$1,getElementById:getElementById,getElements:getElements,getElementsByTagName:getElementsByTagName,getElementsByTagType:getElementsByTagType,getFeed:getFeed,getInnerHTML:getInnerHTML,getName:getName$1,getOuterHTML:getOuterHTML,getParent:getParent,getSiblings:getSiblings,getText:getText$1,hasAttrib:hasAttrib$1,hasChildren:hasChildren,innerText:innerText,isCDATA:isCDATA,isComment:isComment,isDocument:isDocument,isTag:isTag$1,isText:isText,nextElementSibling:nextElementSibling,prepend:prepend,prependChild:prependChild,prevElementSibling:prevElementSibling,removeElement:removeElement,removeSubsets:removeSubsets,replaceElement:replaceElement,testElement:testElement,textContent:textContent,uniqueSort:uniqueSort}) function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x["default"]:x}var boolbase={trueFunc:function trueFunc(){return true},falseFunc:function falseFunc(){return false}} var boolbase$1=getDefaultExportFromCjs(boolbase) var SelectorType;(function(SelectorType){SelectorType["Attribute"]="attribute" SelectorType["Pseudo"]="pseudo" SelectorType["PseudoElement"]="pseudo-element" SelectorType["Tag"]="tag" SelectorType["Universal"]="universal" SelectorType["Adjacent"]="adjacent" SelectorType["Child"]="child" SelectorType["Descendant"]="descendant" SelectorType["Parent"]="parent" SelectorType["Sibling"]="sibling" SelectorType["ColumnCombinator"]="column-combinator"})(SelectorType||(SelectorType={})) var AttributeAction;(function(AttributeAction){AttributeAction["Any"]="any" AttributeAction["Element"]="element" AttributeAction["End"]="end" AttributeAction["Equals"]="equals" AttributeAction["Exists"]="exists" AttributeAction["Hyphen"]="hyphen" AttributeAction["Not"]="not" AttributeAction["Start"]="start"})(AttributeAction||(AttributeAction={})) const reName=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/ const reEscape=/\\([\da-f]{1,6}\s?|(\s)|.)/gi const actionTypes=new Map([[126,AttributeAction.Element],[94,AttributeAction.Start],[36,AttributeAction.End],[42,AttributeAction.Any],[33,AttributeAction.Not],[124,AttributeAction.Hyphen]]) const unpackPseudos=new Set(["has","not","matches","is","where","host","host-context"]) function isTraversal$1(selector){switch(selector.type){case SelectorType.Adjacent:case SelectorType.Child:case SelectorType.Descendant:case SelectorType.Parent:case SelectorType.Sibling:case SelectorType.ColumnCombinator:return true default:return false}}const stripQuotesFromPseudos=new Set(["contains","icontains"]) function funescape(_,escaped,escapedWhitespace){const high=parseInt(escaped,16)-0x10000 return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+0x10000):String.fromCharCode(high>>10|0xd800,high&0x3ff|0xdc00)}function unescapeCSS(str){return str.replace(reEscape,funescape)}function isQuote(c){return c===39||c===34}function isWhitespace(c){return c===32||c===9||c===10||c===12||c===13}function parse$1w(selector){const subselects=[] const endIndex=parseSelector(subselects,`${selector}`,0) if(endIndex0&&selectorIndex0&&isTraversal$1(tokens[tokens.length-1]))throw new Error("Did not expect successive traversals.")}function addTraversal(type){if(tokens.length>0&&tokens[tokens.length-1].type===SelectorType.Descendant){tokens[tokens.length-1].type=type return}ensureNotTraversal() tokens.push({type:type})}function addSpecialAttribute(name,action){tokens.push({type:SelectorType.Attribute,name:name,action:action,value:getName(1),namespace:null,ignoreCase:"quirks"})}function finalizeSubselector(){tokens.length&&tokens[tokens.length-1].type===SelectorType.Descendant&&tokens.pop() if(tokens.length===0)throw new Error("Empty sub-selector") subselects.push(tokens)}stripWhitespace(0) if(selector.length===selectorIndex)return selectorIndex loop:while(selectorIndex=0&&procNew>=1)}else if(token.type===SelectorType.Pseudo)if(token.data)if(token.name==="has"||token.name==="contains")proc=0 else if(Array.isArray(token.data)){proc=Math.min(...token.data.map((d=>Math.min(...d.map(getProcedure))))) proc<0&&(proc=0)}else proc=2 else proc=3 return proc}const reChars=/[-[\]{}()*+?.,\\^$|#\s]/g function escapeRegex(value){return value.replace(reChars,"\\$&")}const caseInsensitiveAttributes=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]) function shouldIgnoreCase(selector,options){return typeof selector.ignoreCase==="boolean"?selector.ignoreCase:selector.ignoreCase==="quirks"?!!options.quirksMode:!options.xmlMode&&caseInsensitiveAttributes.has(selector.name)}const attributeRules={equals(next,data,options){const{adapter:adapter}=options const{name:name}=data let{value:value}=data if(shouldIgnoreCase(data,options)){value=value.toLowerCase() return elem=>{const attr=adapter.getAttributeValue(elem,name) return attr!=null&&attr.length===value.length&&attr.toLowerCase()===value&&next(elem)}}return elem=>adapter.getAttributeValue(elem,name)===value&&next(elem)},hyphen(next,data,options){const{adapter:adapter}=options const{name:name}=data let{value:value}=data const len=value.length if(shouldIgnoreCase(data,options)){value=value.toLowerCase() return function hyphenIC(elem){const attr=adapter.getAttributeValue(elem,name) return attr!=null&&(attr.length===len||attr.charAt(len)==="-")&&attr.substr(0,len).toLowerCase()===value&&next(elem)}}return function hyphen(elem){const attr=adapter.getAttributeValue(elem,name) return attr!=null&&(attr.length===len||attr.charAt(len)==="-")&&attr.substr(0,len)===value&&next(elem)}},element(next,data,options){const{adapter:adapter}=options const{name:name,value:value}=data if(/\s/.test(value))return boolbase$1.falseFunc const regex=new RegExp(`(?:^|\\s)${escapeRegex(value)}(?:$|\\s)`,shouldIgnoreCase(data,options)?"i":"") return function element(elem){const attr=adapter.getAttributeValue(elem,name) return attr!=null&&attr.length>=value.length&®ex.test(attr)&&next(elem)}},exists:(next,{name:name},{adapter:adapter})=>elem=>adapter.hasAttrib(elem,name)&&next(elem),start(next,data,options){const{adapter:adapter}=options const{name:name}=data let{value:value}=data const len=value.length if(len===0)return boolbase$1.falseFunc if(shouldIgnoreCase(data,options)){value=value.toLowerCase() return elem=>{const attr=adapter.getAttributeValue(elem,name) return attr!=null&&attr.length>=len&&attr.substr(0,len).toLowerCase()===value&&next(elem)}}return elem=>{var _a return!!((_a=adapter.getAttributeValue(elem,name))===null||_a===void 0?void 0:_a.startsWith(value))&&next(elem)}},end(next,data,options){const{adapter:adapter}=options const{name:name}=data let{value:value}=data const len=-value.length if(len===0)return boolbase$1.falseFunc if(shouldIgnoreCase(data,options)){value=value.toLowerCase() return elem=>{var _a return((_a=adapter.getAttributeValue(elem,name))===null||_a===void 0?void 0:_a.substr(len).toLowerCase())===value&&next(elem)}}return elem=>{var _a return!!((_a=adapter.getAttributeValue(elem,name))===null||_a===void 0?void 0:_a.endsWith(value))&&next(elem)}},any(next,data,options){const{adapter:adapter}=options const{name:name,value:value}=data if(value==="")return boolbase$1.falseFunc if(shouldIgnoreCase(data,options)){const regex=new RegExp(escapeRegex(value),"i") return function anyIC(elem){const attr=adapter.getAttributeValue(elem,name) return attr!=null&&attr.length>=value.length&®ex.test(attr)&&next(elem)}}return elem=>{var _a return!!((_a=adapter.getAttributeValue(elem,name))===null||_a===void 0?void 0:_a.includes(value))&&next(elem)}},not(next,data,options){const{adapter:adapter}=options const{name:name}=data let{value:value}=data if(value==="")return elem=>!!adapter.getAttributeValue(elem,name)&&next(elem) if(shouldIgnoreCase(data,options)){value=value.toLowerCase() return elem=>{const attr=adapter.getAttributeValue(elem,name) return(attr==null||attr.length!==value.length||attr.toLowerCase()!==value)&&next(elem)}}return elem=>adapter.getAttributeValue(elem,name)!==value&&next(elem)}} const whitespace=new Set([9,10,12,13,32]) const ZERO="0".charCodeAt(0) const NINE="9".charCodeAt(0) function parse$1v(formula){formula=formula.trim().toLowerCase() if(formula==="even")return[2,0] if(formula==="odd")return[2,1] let idx=0 let a=0 let sign=readSign() let number=readNumber() if(idx=ZERO&&formula.charCodeAt(idx)<=NINE){value=value*10+(formula.charCodeAt(idx)-ZERO) idx++}return idx===start?null:value}function skipWhitespace(){while(idxindex<=b if(a===0)return index=>index===b if(a===1)return b<0?boolbase$1.trueFunc:index=>index>=b const absA=Math.abs(a) const bMod=(b%absA+absA)%absA return a>1?index=>index>=b&&index%absA===bMod:index=>index<=b&&index%absA===bMod}function nthCheck(formula){return compile$1(parse$1v(formula))}function getChildFunc(next,adapter){return elem=>{const parent=adapter.getParent(elem) return parent!=null&&adapter.isTag(parent)&&next(elem)}}const filters$1={contains:(next,text,{adapter:adapter})=>function contains(elem){return next(elem)&&adapter.getText(elem).includes(text)},icontains(next,text,{adapter:adapter}){const itext=text.toLowerCase() return function icontains(elem){return next(elem)&&adapter.getText(elem).toLowerCase().includes(itext)}},"nth-child"(next,rule,{adapter:adapter,equals:equals}){const func=nthCheck(rule) if(func===boolbase$1.falseFunc)return boolbase$1.falseFunc if(func===boolbase$1.trueFunc)return getChildFunc(next,adapter) return function nthChild(elem){const siblings=adapter.getSiblings(elem) let pos=0 for(let i=0;i=0;i--){if(equals(elem,siblings[i]))break adapter.isTag(siblings[i])&&pos++}return func(pos)&&next(elem)}},"nth-of-type"(next,rule,{adapter:adapter,equals:equals}){const func=nthCheck(rule) if(func===boolbase$1.falseFunc)return boolbase$1.falseFunc if(func===boolbase$1.trueFunc)return getChildFunc(next,adapter) return function nthOfType(elem){const siblings=adapter.getSiblings(elem) let pos=0 for(let i=0;i=0;i--){const currentSibling=siblings[i] if(equals(elem,currentSibling))break adapter.isTag(currentSibling)&&adapter.getName(currentSibling)===adapter.getName(elem)&&pos++}return func(pos)&&next(elem)}},root:(next,_rule,{adapter:adapter})=>elem=>{const parent=adapter.getParent(elem) return(parent==null||!adapter.isTag(parent))&&next(elem)},scope(next,rule,options,context){const{equals:equals}=options if(!context||context.length===0)return filters$1["root"](next,rule,options) if(context.length===1)return elem=>equals(context[0],elem)&&next(elem) return elem=>context.includes(elem)&&next(elem)},hover:dynamicStatePseudo("isHovered"),visited:dynamicStatePseudo("isVisited"),active:dynamicStatePseudo("isActive")} function dynamicStatePseudo(name){return function dynamicPseudo(next,_rule,{adapter:adapter}){const func=adapter[name] if(typeof func!=="function")return boolbase$1.falseFunc return function active(elem){return func(elem)&&next(elem)}}}const pseudos={empty:(elem,{adapter:adapter})=>!adapter.getChildren(elem).some((elem=>adapter.isTag(elem)||adapter.getText(elem)!=="")),"first-child"(elem,{adapter:adapter,equals:equals}){if(adapter.prevElementSibling)return adapter.prevElementSibling(elem)==null const firstChild=adapter.getSiblings(elem).find((elem=>adapter.isTag(elem))) return firstChild!=null&&equals(elem,firstChild)},"last-child"(elem,{adapter:adapter,equals:equals}){const siblings=adapter.getSiblings(elem) for(let i=siblings.length-1;i>=0;i--){if(equals(elem,siblings[i]))return true if(adapter.isTag(siblings[i]))break}return false},"first-of-type"(elem,{adapter:adapter,equals:equals}){const siblings=adapter.getSiblings(elem) const elemName=adapter.getName(elem) for(let i=0;i=0;i--){const currentSibling=siblings[i] if(equals(elem,currentSibling))return true if(adapter.isTag(currentSibling)&&adapter.getName(currentSibling)===elemName)break}return false},"only-of-type"(elem,{adapter:adapter,equals:equals}){const elemName=adapter.getName(elem) return adapter.getSiblings(elem).every((sibling=>equals(elem,sibling)||!adapter.isTag(sibling)||adapter.getName(sibling)!==elemName))},"only-child":(elem,{adapter:adapter,equals:equals})=>adapter.getSiblings(elem).every((sibling=>equals(elem,sibling)||!adapter.isTag(sibling)))} function verifyPseudoArgs(func,name,subselect,argIndex){if(subselect===null){if(func.length>argIndex)throw new Error(`Pseudo-class :${name} requires an argument`)}else if(func.length===argIndex)throw new Error(`Pseudo-class :${name} doesn't have any arguments`)}const aliases={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:":is(\n :is(button, input, select, textarea, optgroup, option)[disabled],\n optgroup[disabled] > option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )",enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"} const PLACEHOLDER_ELEMENT={} function ensureIsTag(next,adapter){if(next===boolbase$1.falseFunc)return boolbase$1.falseFunc return elem=>adapter.isTag(elem)&&next(elem)}function getNextSiblings(elem,adapter){const siblings=adapter.getSiblings(elem) if(siblings.length<=1)return[] const elemIndex=siblings.indexOf(elem) if(elemIndex<0||elemIndex===siblings.length-1)return[] return siblings.slice(elemIndex+1).filter(adapter.isTag)}function copyOptions(options){return{xmlMode:!!options.xmlMode,lowerCaseAttributeNames:!!options.lowerCaseAttributeNames,lowerCaseTags:!!options.lowerCaseTags,quirksMode:!!options.quirksMode,cacheResults:!!options.cacheResults,pseudos:options.pseudos,adapter:options.adapter,equals:options.equals}}const is$1=(next,token,options,context,compileToken)=>{const func=compileToken(token,copyOptions(options),context) return func===boolbase$1.trueFunc?next:func===boolbase$1.falseFunc?boolbase$1.falseFunc:elem=>func(elem)&&next(elem)} const subselects={is:is$1,matches:is$1,where:is$1,not(next,token,options,context,compileToken){const func=compileToken(token,copyOptions(options),context) return func===boolbase$1.falseFunc?next:func===boolbase$1.trueFunc?boolbase$1.falseFunc:elem=>!func(elem)&&next(elem)},has(next,subselect,options,_context,compileToken){const{adapter:adapter}=options const opts=copyOptions(options) opts.relativeSelector=true const context=subselect.some((s=>s.some(isTraversal)))?[PLACEHOLDER_ELEMENT]:void 0 const compiled=compileToken(subselect,opts,context) if(compiled===boolbase$1.falseFunc)return boolbase$1.falseFunc const hasElement=ensureIsTag(compiled,adapter) if(context&&compiled!==boolbase$1.trueFunc){const{shouldTestNextSiblings:shouldTestNextSiblings=false}=compiled return elem=>{if(!next(elem))return false context[0]=elem const childs=adapter.getChildren(elem) const nextElements=shouldTestNextSiblings?[...childs,...getNextSiblings(elem,adapter)]:childs return adapter.existsOne(hasElement,nextElements)}}return elem=>next(elem)&&adapter.existsOne(hasElement,adapter.getChildren(elem))}} function compilePseudoSelector(next,selector,options,context,compileToken){var _a const{name:name,data:data}=selector if(Array.isArray(data)){if(!(name in subselects))throw new Error(`Unknown pseudo-class :${name}(${data})`) return subselects[name](next,data,options,context,compileToken)}const userPseudo=(_a=options.pseudos)===null||_a===void 0?void 0:_a[name] const stringPseudo=typeof userPseudo==="string"?userPseudo:aliases[name] if(typeof stringPseudo==="string"){if(data!=null)throw new Error(`Pseudo ${name} doesn't have any arguments`) const alias=parse$1w(stringPseudo) return subselects["is"](next,alias,options,context,compileToken)}if(typeof userPseudo==="function"){verifyPseudoArgs(userPseudo,name,data,1) return elem=>userPseudo(elem,data)&&next(elem)}if(name in filters$1)return filters$1[name](next,data,options,context) if(name in pseudos){const pseudo=pseudos[name] verifyPseudoArgs(pseudo,name,data,2) return elem=>pseudo(elem,options,data)&&next(elem)}throw new Error(`Unknown pseudo-class :${name}`)}function getElementParent(node,adapter){const parent=adapter.getParent(node) if(parent&&adapter.isTag(parent))return parent return null}function compileGeneralSelector(next,selector,options,context,compileToken){const{adapter:adapter,equals:equals}=options switch(selector.type){case SelectorType.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select") case SelectorType.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select") case SelectorType.Attribute:if(selector.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select") options.xmlMode&&!options.lowerCaseAttributeNames||(selector.name=selector.name.toLowerCase()) return attributeRules[selector.action](next,selector,options) case SelectorType.Pseudo:return compilePseudoSelector(next,selector,options,context,compileToken) case SelectorType.Tag:{if(selector.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select") let{name:name}=selector options.xmlMode&&!options.lowerCaseTags||(name=name.toLowerCase()) return function tag(elem){return adapter.getName(elem)===name&&next(elem)}}case SelectorType.Descendant:{if(options.cacheResults===false||typeof WeakSet==="undefined")return function descendant(elem){let current=elem while(current=getElementParent(current,adapter))if(next(current))return true return false} const isFalseCache=new WeakSet return function cachedDescendant(elem){let current=elem while(current=getElementParent(current,adapter))if(!isFalseCache.has(current)){if(adapter.isTag(current)&&next(current))return true isFalseCache.add(current)}return false}}case"_flexibleDescendant":return function flexibleDescendant(elem){let current=elem do{if(next(current))return true}while(current=getElementParent(current,adapter)) return false} case SelectorType.Parent:return function parent(elem){return adapter.getChildren(elem).some((elem=>adapter.isTag(elem)&&next(elem)))} case SelectorType.Child:return function child(elem){const parent=adapter.getParent(elem) return parent!=null&&adapter.isTag(parent)&&next(parent)} case SelectorType.Sibling:return function sibling(elem){const siblings=adapter.getSiblings(elem) for(let i=0;idata.some(includesScopePseudo))))}const DESCENDANT_TOKEN={type:SelectorType.Descendant} const FLEXIBLE_DESCENDANT_TOKEN={type:"_flexibleDescendant"} const SCOPE_TOKEN={type:SelectorType.Pseudo,name:"scope",data:null} function absolutize(token,{adapter:adapter},context){const hasContext=!!(context===null||context===void 0?void 0:context.every((e=>{const parent=adapter.isTag(e)&&adapter.getParent(e) return e===PLACEHOLDER_ELEMENT||parent&&adapter.isTag(parent)}))) for(const t of token){if(t.length>0&&isTraversal(t[0])&&t[0].type!==SelectorType.Descendant);else{if(!hasContext||t.some(includesScopePseudo))continue t.unshift(DESCENDANT_TOKEN)}t.unshift(SCOPE_TOKEN)}}function compileToken(token,options,context){var _a token.forEach(sortByProcedure) context=(_a=options.context)!==null&&_a!==void 0?_a:context const isArrayContext=Array.isArray(context) const finalContext=context&&(Array.isArray(context)?context:[context]) if(options.relativeSelector!==false)absolutize(token,options,finalContext) else if(token.some((t=>t.length>0&&isTraversal(t[0]))))throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled") let shouldTestNextSiblings=false const query=token.map((rules=>{if(rules.length>=2){const[first,second]=rules first.type!==SelectorType.Pseudo||first.name!=="scope"||(isArrayContext&&second.type===SelectorType.Descendant?rules[1]=FLEXIBLE_DESCENDANT_TOKEN:second.type!==SelectorType.Adjacent&&second.type!==SelectorType.Sibling||(shouldTestNextSiblings=true))}return compileRules(rules,options,finalContext)})).reduce(reduceRules,boolbase$1.falseFunc) query.shouldTestNextSiblings=shouldTestNextSiblings return query}function compileRules(rules,options,context){var _a return rules.reduce(((previous,rule)=>previous===boolbase$1.falseFunc?boolbase$1.falseFunc:compileGeneralSelector(previous,rule,options,context,compileToken)),(_a=options.rootFunc)!==null&&_a!==void 0?_a:boolbase$1.trueFunc)}function reduceRules(a,b){if(b===boolbase$1.falseFunc||a===boolbase$1.trueFunc)return a if(a===boolbase$1.falseFunc||b===boolbase$1.trueFunc)return b return function combine(elem){return a(elem)||b(elem)}}const defaultEquals=(a,b)=>a===b const defaultOptions={adapter:DomUtils,equals:defaultEquals} function convertOptionFormats(options){var _a,_b,_c,_d const opts=options!==null&&options!==void 0?options:defaultOptions;(_a=opts.adapter)!==null&&_a!==void 0?_a:opts.adapter=DomUtils;(_b=opts.equals)!==null&&_b!==void 0?_b:opts.equals=(_d=(_c=opts.adapter)===null||_c===void 0?void 0:_c.equals)!==null&&_d!==void 0?_d:defaultEquals return opts}function getSelectorFunc(searchFunc){return function select(query,elements,options){const opts=convertOptionFormats(options) typeof query!=="function"&&(query=compileUnsafe(query,opts,elements)) const filteredElements=prepareContext(elements,opts.adapter,query.shouldTestNextSiblings) return searchFunc(query,filteredElements,opts)}}function prepareContext(elems,adapter,shouldTestNextSiblings=false){shouldTestNextSiblings&&(elems=appendNextSiblings(elems,adapter)) return Array.isArray(elems)?adapter.removeSubsets(elems):adapter.getChildren(elems)}function appendNextSiblings(elem,adapter){const elems=Array.isArray(elem)?elem.slice(0):[elem] const elemsLength=elems.length for(let i=0;iquery!==boolbase$1.falseFunc&&elems&&elems.length!==0?options.adapter.findAll(query,elems):[])) const selectOne=getSelectorFunc(((query,elems,options)=>query!==boolbase$1.falseFunc&&elems&&elems.length!==0?options.adapter.findOne(query,elems):null)) function is(elem,query,options){const opts=convertOptionFormats(options) return(typeof query==="function"?query:compile(query,opts))(elem)}function mapNodesToParents(node){const parents=new Map for(const child of node.children){parents.set(child,node) visit(child,{element:{enter:(child,parent)=>{parents.set(child,parent)}}},node)}return parents}const isTag=node=>node.type==="element" const existsOne=(test,elems)=>elems.some((elem=>isTag(elem)&&(test(elem)||existsOne(test,getChildren(elem))))) const getAttributeValue=(elem,name)=>elem.attributes[name] const getChildren=node=>node.children||[] const getName=elemAst=>elemAst.name const getText=node=>{if(node.children[0].type==="text"||node.children[0].type==="cdata")return node.children[0].value return""} const hasAttrib=(elem,name)=>elem.attributes[name]!==void 0 const findAll$3=(test,elems)=>{const result=[] for(const elem of elems)if(isTag(elem)){test(elem)&&result.push(elem) result.push(...findAll$3(test,getChildren(elem)))}return result} const findOne=(test,elems)=>{for(const elem of elems)if(isTag(elem)){if(test(elem))return elem const result=findOne(test,getChildren(elem)) if(result)return result}return null} function createAdapter(relativeNode,parents){const getParent=node=>{parents||(parents=mapNodesToParents(relativeNode)) return parents.get(node)||null} const getSiblings=elem=>{const parent=getParent(elem) return parent?getChildren(parent):[]} const removeSubsets=nodes=>{let idx=nodes.length let node let ancestor let replace while(--idx>-1){node=ancestor=nodes[idx] nodes[idx]=null replace=true while(ancestor){if(nodes.includes(ancestor)){replace=false nodes.splice(idx,1) break}ancestor=getParent(ancestor)}replace&&(nodes[idx]=node)}return nodes} return{isTag:isTag,existsOne:existsOne,getAttributeValue:getAttributeValue,getChildren:getChildren,getName:getName,getParent:getParent,getSiblings:getSiblings,getText:getText,hasAttrib:hasAttrib,removeSubsets:removeSubsets,findAll:findAll$3,findOne:findOne}}function createCssSelectOptions(relativeNode,parents){return{xmlMode:true,adapter:createAdapter(relativeNode,parents)}}const querySelectorAll=(node,selector,parents)=>selectAll(selector,node,createCssSelectOptions(node,parents)) const querySelector=(node,selector,parents)=>selectOne(selector,node,createCssSelectOptions(node,parents)) const matches=(node,selector,parents)=>is(node,selector,createCssSelectOptions(node,parents)) const detachNodeFromParent=(node,parentNode)=>{parentNode.children=parentNode.children.filter((child=>child!==node))} const name$2d="removeDoctype" const description$Q="removes doctype declaration" const fn$Q=()=>({doctype:{enter:(node,parentNode)=>{detachNodeFromParent(node,parentNode)}}}) var removeDoctype=Object.freeze({__proto__:null,description:description$Q,fn:fn$Q,name:name$2d}) const name$2c="removeXMLProcInst" const description$P="removes XML processing instructions" const fn$P=()=>({instruction:{enter:(node,parentNode)=>{node.name==="xml"&&detachNodeFromParent(node,parentNode)}}}) var removeXMLProcInst=Object.freeze({__proto__:null,description:description$P,fn:fn$P,name:name$2c}) const name$2b="removeComments" const description$O="removes comments" const DEFAULT_PRESERVE_PATTERNS=[/^!/] const fn$O=(_root,params)=>{const{preservePatterns:preservePatterns=DEFAULT_PRESERVE_PATTERNS}=params return{comment:{enter:(node,parentNode)=>{if(preservePatterns){if(!Array.isArray(preservePatterns))throw Error(`Expected array in removeComments preservePatterns parameter but received ${preservePatterns}`) const matches=preservePatterns.some((pattern=>new RegExp(pattern).test(node.value))) if(matches)return}detachNodeFromParent(node,parentNode)}}}} var removeComments=Object.freeze({__proto__:null,description:description$O,fn:fn$O,name:name$2b}) const elemsGroups={animation:new Set(["animate","animateColor","animateMotion","animateTransform","set"]),descriptive:new Set(["desc","metadata","title"]),shape:new Set(["circle","ellipse","line","path","polygon","polyline","rect"]),structural:new Set(["defs","g","svg","symbol","use"]),paintServer:new Set(["hatch","linearGradient","meshGradient","pattern","radialGradient","solidColor"]),nonRendering:new Set(["clipPath","filter","linearGradient","marker","mask","pattern","radialGradient","solidColor","symbol"]),container:new Set(["a","defs","foreignObject","g","marker","mask","missing-glyph","pattern","svg","switch","symbol"]),textContent:new Set(["a","altGlyph","altGlyphDef","altGlyphItem","glyph","glyphRef","text","textPath","tref","tspan"]),textContentChild:new Set(["altGlyph","textPath","tref","tspan"]),lightSource:new Set(["feDiffuseLighting","feDistantLight","fePointLight","feSpecularLighting","feSpotLight"]),filterPrimitive:new Set(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence"])} const textElems=new Set([...elemsGroups.textContent,"pre","title"]) const pathElems=new Set(["glyph","missing-glyph","path"]) const attrsGroups={animationAddition:new Set(["additive","accumulate"]),animationAttributeTarget:new Set(["attributeType","attributeName"]),animationEvent:new Set(["onbegin","onend","onrepeat","onload"]),animationTiming:new Set(["begin","dur","end","fill","max","min","repeatCount","repeatDur","restart"]),animationValue:new Set(["by","calcMode","from","keySplines","keyTimes","to","values"]),conditionalProcessing:new Set(["requiredExtensions","requiredFeatures","systemLanguage"]),core:new Set(["id","tabindex","xml:base","xml:lang","xml:space"]),graphicalEvent:new Set(["onactivate","onclick","onfocusin","onfocusout","onload","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup"]),presentation:new Set(["alignment-baseline","baseline-shift","clip-path","clip-rule","clip","color-interpolation-filters","color-interpolation","color-profile","color-rendering","color","cursor","direction","display","dominant-baseline","enable-background","fill-opacity","fill-rule","fill","filter","flood-color","flood-opacity","font-family","font-size-adjust","font-size","font-stretch","font-style","font-variant","font-weight","glyph-orientation-horizontal","glyph-orientation-vertical","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","stroke","text-anchor","text-decoration","text-overflow","text-rendering","transform-origin","transform","unicode-bidi","vector-effect","visibility","word-spacing","writing-mode"]),xlink:new Set(["xlink:actuate","xlink:arcrole","xlink:href","xlink:role","xlink:show","xlink:title","xlink:type"]),documentEvent:new Set(["onabort","onerror","onresize","onscroll","onunload","onzoom"]),documentElementEvent:new Set(["oncopy","oncut","onpaste"]),globalEvent:new Set(["oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onresize","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","onvolumechange","onwaiting"]),filterPrimitive:new Set(["x","y","width","height","result"]),transferFunction:new Set(["amplitude","exponent","intercept","offset","slope","tableValues","type"])} const attrsGroupsDefaults={core:{"xml:space":"default"},presentation:{clip:"auto","clip-path":"none","clip-rule":"nonzero",mask:"none",opacity:"1","stop-color":"#000","stop-opacity":"1","fill-opacity":"1","fill-rule":"nonzero",fill:"#000",stroke:"none","stroke-width":"1","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-dashoffset":"0","stroke-opacity":"1","paint-order":"normal","vector-effect":"none",display:"inline",visibility:"visible","marker-start":"none","marker-mid":"none","marker-end":"none","color-interpolation":"sRGB","color-interpolation-filters":"linearRGB","color-rendering":"auto","shape-rendering":"auto","text-rendering":"auto","image-rendering":"auto","font-style":"normal","font-variant":"normal","font-weight":"normal","font-stretch":"normal","font-size":"medium","font-size-adjust":"none",kerning:"auto","letter-spacing":"normal","word-spacing":"normal","text-decoration":"none","text-anchor":"start","text-overflow":"clip","writing-mode":"lr-tb","glyph-orientation-vertical":"auto","glyph-orientation-horizontal":"0deg",direction:"ltr","unicode-bidi":"normal","dominant-baseline":"auto","alignment-baseline":"baseline","baseline-shift":"baseline"},transferFunction:{slope:"1",intercept:"0",amplitude:"1",exponent:"1",offset:"0"}} const attrsGroupsDeprecated={animationAttributeTarget:{unsafe:new Set(["attributeType"])},conditionalProcessing:{unsafe:new Set(["requiredFeatures"])},core:{unsafe:new Set(["xml:base","xml:lang","xml:space"])},presentation:{unsafe:new Set(["clip","color-profile","enable-background","glyph-orientation-horizontal","glyph-orientation-vertical","kerning"])}} const elems={a:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation","xlink"]),attrs:new Set(["class","externalResourcesRequired","style","target","transform"]),defaults:{target:"_self"},contentGroups:new Set(["animation","descriptive","paintServer","shape","structural"]),content:new Set(["a","altGlyphDef","clipPath","color-profile","cursor","filter","font-face","font","foreignObject","image","marker","mask","pattern","script","style","switch","text","view","tspan"])},altGlyph:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation","xlink"]),attrs:new Set(["class","dx","dy","externalResourcesRequired","format","glyphRef","rotate","style","x","y"])},altGlyphDef:{attrsGroups:new Set(["core"]),content:new Set(["glyphRef"])},altGlyphItem:{attrsGroups:new Set(["core"]),content:new Set(["glyphRef","altGlyphItem"])},animate:{attrsGroups:new Set(["animationAddition","animationAttributeTarget","animationEvent","animationTiming","animationValue","conditionalProcessing","core","presentation","xlink"]),attrs:new Set(["externalResourcesRequired"]),contentGroups:new Set(["descriptive"])},animateColor:{attrsGroups:new Set(["animationAddition","animationAttributeTarget","animationEvent","animationTiming","animationValue","conditionalProcessing","core","presentation","xlink"]),attrs:new Set(["externalResourcesRequired"]),contentGroups:new Set(["descriptive"])},animateMotion:{attrsGroups:new Set(["animationAddition","animationEvent","animationTiming","animationValue","conditionalProcessing","core","xlink"]),attrs:new Set(["externalResourcesRequired","keyPoints","origin","path","rotate"]),defaults:{rotate:"0"},contentGroups:new Set(["descriptive"]),content:new Set(["mpath"])},animateTransform:{attrsGroups:new Set(["animationAddition","animationAttributeTarget","animationEvent","animationTiming","animationValue","conditionalProcessing","core","xlink"]),attrs:new Set(["externalResourcesRequired","type"]),contentGroups:new Set(["descriptive"])},circle:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","cx","cy","externalResourcesRequired","r","style","transform"]),defaults:{cx:"0",cy:"0"},contentGroups:new Set(["animation","descriptive"])},clipPath:{attrsGroups:new Set(["conditionalProcessing","core","presentation"]),attrs:new Set(["class","clipPathUnits","externalResourcesRequired","style","transform"]),defaults:{clipPathUnits:"userSpaceOnUse"},contentGroups:new Set(["animation","descriptive","shape"]),content:new Set(["text","use"])},"color-profile":{attrsGroups:new Set(["core","xlink"]),attrs:new Set(["local","name","rendering-intent"]),defaults:{name:"sRGB","rendering-intent":"auto"},deprecated:{unsafe:new Set(["name"])},contentGroups:new Set(["descriptive"])},cursor:{attrsGroups:new Set(["core","conditionalProcessing","xlink"]),attrs:new Set(["externalResourcesRequired","x","y"]),defaults:{x:"0",y:"0"},contentGroups:new Set(["descriptive"])},defs:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","externalResourcesRequired","style","transform"]),contentGroups:new Set(["animation","descriptive","paintServer","shape","structural"]),content:new Set(["a","altGlyphDef","clipPath","color-profile","cursor","filter","font-face","font","foreignObject","image","marker","mask","pattern","script","style","switch","text","view"])},desc:{attrsGroups:new Set(["core"]),attrs:new Set(["class","style"])},ellipse:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","cx","cy","externalResourcesRequired","rx","ry","style","transform"]),defaults:{cx:"0",cy:"0"},contentGroups:new Set(["animation","descriptive"])},feBlend:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","style","in","in2","mode"]),defaults:{mode:"normal"},content:new Set(["animate","set"])},feColorMatrix:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","style","in","type","values"]),defaults:{type:"matrix"},content:new Set(["animate","set"])},feComponentTransfer:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","style","in"]),content:new Set(["feFuncA","feFuncB","feFuncG","feFuncR"])},feComposite:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","in","in2","k1","k2","k3","k4","operator","style"]),defaults:{operator:"over",k1:"0",k2:"0",k3:"0",k4:"0"},content:new Set(["animate","set"])},feConvolveMatrix:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","in","kernelMatrix","order","style","bias","divisor","edgeMode","targetX","targetY","kernelUnitLength","preserveAlpha"]),defaults:{order:"3",bias:"0",edgeMode:"duplicate",preserveAlpha:"false"},content:new Set(["animate","set"])},feDiffuseLighting:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","diffuseConstant","in","kernelUnitLength","style","surfaceScale"]),defaults:{surfaceScale:"1",diffuseConstant:"1"},contentGroups:new Set(["descriptive"]),content:new Set(["feDistantLight","fePointLight","feSpotLight"])},feDisplacementMap:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","in","in2","scale","style","xChannelSelector","yChannelSelector"]),defaults:{scale:"0",xChannelSelector:"A",yChannelSelector:"A"},content:new Set(["animate","set"])},feDistantLight:{attrsGroups:new Set(["core"]),attrs:new Set(["azimuth","elevation"]),defaults:{azimuth:"0",elevation:"0"},content:new Set(["animate","set"])},feFlood:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","style"]),content:new Set(["animate","animateColor","set"])},feFuncA:{attrsGroups:new Set(["core","transferFunction"]),content:new Set(["set","animate"])},feFuncB:{attrsGroups:new Set(["core","transferFunction"]),content:new Set(["set","animate"])},feFuncG:{attrsGroups:new Set(["core","transferFunction"]),content:new Set(["set","animate"])},feFuncR:{attrsGroups:new Set(["core","transferFunction"]),content:new Set(["set","animate"])},feGaussianBlur:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","style","in","stdDeviation"]),defaults:{stdDeviation:"0"},content:new Set(["set","animate"])},feImage:{attrsGroups:new Set(["core","presentation","filterPrimitive","xlink"]),attrs:new Set(["class","externalResourcesRequired","href","preserveAspectRatio","style","xlink:href"]),defaults:{preserveAspectRatio:"xMidYMid meet"},content:new Set(["animate","animateTransform","set"])},feMerge:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","style"]),content:new Set(["feMergeNode"])},feMergeNode:{attrsGroups:new Set(["core"]),attrs:new Set(["in"]),content:new Set(["animate","set"])},feMorphology:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","style","in","operator","radius"]),defaults:{operator:"erode",radius:"0"},content:new Set(["animate","set"])},feOffset:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","style","in","dx","dy"]),defaults:{dx:"0",dy:"0"},content:new Set(["animate","set"])},fePointLight:{attrsGroups:new Set(["core"]),attrs:new Set(["x","y","z"]),defaults:{x:"0",y:"0",z:"0"},content:new Set(["animate","set"])},feSpecularLighting:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","in","kernelUnitLength","specularConstant","specularExponent","style","surfaceScale"]),defaults:{surfaceScale:"1",specularConstant:"1",specularExponent:"1"},contentGroups:new Set(["descriptive","lightSource"])},feSpotLight:{attrsGroups:new Set(["core"]),attrs:new Set(["limitingConeAngle","pointsAtX","pointsAtY","pointsAtZ","specularExponent","x","y","z"]),defaults:{x:"0",y:"0",z:"0",pointsAtX:"0",pointsAtY:"0",pointsAtZ:"0",specularExponent:"1"},content:new Set(["animate","set"])},feTile:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["class","style","in"]),content:new Set(["animate","set"])},feTurbulence:{attrsGroups:new Set(["core","presentation","filterPrimitive"]),attrs:new Set(["baseFrequency","class","numOctaves","seed","stitchTiles","style","type"]),defaults:{baseFrequency:"0",numOctaves:"1",seed:"0",stitchTiles:"noStitch",type:"turbulence"},content:new Set(["animate","set"])},filter:{attrsGroups:new Set(["core","presentation","xlink"]),attrs:new Set(["class","externalResourcesRequired","filterRes","filterUnits","height","href","primitiveUnits","style","width","x","xlink:href","y"]),defaults:{primitiveUnits:"userSpaceOnUse",x:"-10%",y:"-10%",width:"120%",height:"120%"},deprecated:{unsafe:new Set(["filterRes"])},contentGroups:new Set(["descriptive","filterPrimitive"]),content:new Set(["animate","set"])},font:{attrsGroups:new Set(["core","presentation"]),attrs:new Set(["class","externalResourcesRequired","horiz-adv-x","horiz-origin-x","horiz-origin-y","style","vert-adv-y","vert-origin-x","vert-origin-y"]),defaults:{"horiz-origin-x":"0","horiz-origin-y":"0"},deprecated:{unsafe:new Set(["horiz-origin-x","horiz-origin-y","vert-adv-y","vert-origin-x","vert-origin-y"])},contentGroups:new Set(["descriptive"]),content:new Set(["font-face","glyph","hkern","missing-glyph","vkern"])},"font-face":{attrsGroups:new Set(["core"]),attrs:new Set(["font-family","font-style","font-variant","font-weight","font-stretch","font-size","unicode-range","units-per-em","panose-1","stemv","stemh","slope","cap-height","x-height","accent-height","ascent","descent","widths","bbox","ideographic","alphabetic","mathematical","hanging","v-ideographic","v-alphabetic","v-mathematical","v-hanging","underline-position","underline-thickness","strikethrough-position","strikethrough-thickness","overline-position","overline-thickness"]),defaults:{"font-style":"all","font-variant":"normal","font-weight":"all","font-stretch":"normal","unicode-range":"U+0-10FFFF","units-per-em":"1000","panose-1":"0 0 0 0 0 0 0 0 0 0",slope:"0"},deprecated:{unsafe:new Set(["accent-height","alphabetic","ascent","bbox","cap-height","descent","hanging","ideographic","mathematical","panose-1","slope","stemh","stemv","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","widths","x-height"])},contentGroups:new Set(["descriptive"]),content:new Set(["font-face-src"])},"font-face-format":{attrsGroups:new Set(["core"]),attrs:new Set(["string"]),deprecated:{unsafe:new Set(["string"])}},"font-face-name":{attrsGroups:new Set(["core"]),attrs:new Set(["name"]),deprecated:{unsafe:new Set(["name"])}},"font-face-src":{attrsGroups:new Set(["core"]),content:new Set(["font-face-name","font-face-uri"])},"font-face-uri":{attrsGroups:new Set(["core","xlink"]),attrs:new Set(["href","xlink:href"]),content:new Set(["font-face-format"])},foreignObject:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","externalResourcesRequired","height","style","transform","width","x","y"]),defaults:{x:"0",y:"0"}},g:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","externalResourcesRequired","style","transform"]),contentGroups:new Set(["animation","descriptive","paintServer","shape","structural"]),content:new Set(["a","altGlyphDef","clipPath","color-profile","cursor","filter","font-face","font","foreignObject","image","marker","mask","pattern","script","style","switch","text","view"])},glyph:{attrsGroups:new Set(["core","presentation"]),attrs:new Set(["arabic-form","class","d","glyph-name","horiz-adv-x","lang","orientation","style","unicode","vert-adv-y","vert-origin-x","vert-origin-y"]),defaults:{"arabic-form":"initial"},deprecated:{unsafe:new Set(["arabic-form","glyph-name","horiz-adv-x","orientation","unicode","vert-adv-y","vert-origin-x","vert-origin-y"])},contentGroups:new Set(["animation","descriptive","paintServer","shape","structural"]),content:new Set(["a","altGlyphDef","clipPath","color-profile","cursor","filter","font-face","font","foreignObject","image","marker","mask","pattern","script","style","switch","text","view"])},glyphRef:{attrsGroups:new Set(["core","presentation"]),attrs:new Set(["class","d","horiz-adv-x","style","vert-adv-y","vert-origin-x","vert-origin-y"]),deprecated:{unsafe:new Set(["horiz-adv-x","vert-adv-y","vert-origin-x","vert-origin-y"])},contentGroups:new Set(["animation","descriptive","paintServer","shape","structural"]),content:new Set(["a","altGlyphDef","clipPath","color-profile","cursor","filter","font-face","font","foreignObject","image","marker","mask","pattern","script","style","switch","text","view"])},hatch:{attrsGroups:new Set(["core","presentation","xlink"]),attrs:new Set(["class","hatchContentUnits","hatchUnits","pitch","rotate","style","transform","x","y"]),defaults:{hatchUnits:"objectBoundingBox",hatchContentUnits:"userSpaceOnUse",x:"0",y:"0",pitch:"0",rotate:"0"},contentGroups:new Set(["animation","descriptive"]),content:new Set(["hatchPath"])},hatchPath:{attrsGroups:new Set(["core","presentation","xlink"]),attrs:new Set(["class","style","d","offset"]),defaults:{offset:"0"},contentGroups:new Set(["animation","descriptive"])},hkern:{attrsGroups:new Set(["core"]),attrs:new Set(["u1","g1","u2","g2","k"]),deprecated:{unsafe:new Set(["g1","g2","k","u1","u2"])}},image:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation","xlink"]),attrs:new Set(["class","externalResourcesRequired","height","href","preserveAspectRatio","style","transform","width","x","xlink:href","y"]),defaults:{x:"0",y:"0",preserveAspectRatio:"xMidYMid meet"},contentGroups:new Set(["animation","descriptive"])},line:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","externalResourcesRequired","style","transform","x1","x2","y1","y2"]),defaults:{x1:"0",y1:"0",x2:"0",y2:"0"},contentGroups:new Set(["animation","descriptive"])},linearGradient:{attrsGroups:new Set(["core","presentation","xlink"]),attrs:new Set(["class","externalResourcesRequired","gradientTransform","gradientUnits","href","spreadMethod","style","x1","x2","xlink:href","y1","y2"]),defaults:{x1:"0",y1:"0",x2:"100%",y2:"0",spreadMethod:"pad"},contentGroups:new Set(["descriptive"]),content:new Set(["animate","animateTransform","set","stop"])},marker:{attrsGroups:new Set(["core","presentation"]),attrs:new Set(["class","externalResourcesRequired","markerHeight","markerUnits","markerWidth","orient","preserveAspectRatio","refX","refY","style","viewBox"]),defaults:{markerUnits:"strokeWidth",refX:"0",refY:"0",markerWidth:"3",markerHeight:"3"},contentGroups:new Set(["animation","descriptive","paintServer","shape","structural"]),content:new Set(["a","altGlyphDef","clipPath","color-profile","cursor","filter","font-face","font","foreignObject","image","marker","mask","pattern","script","style","switch","text","view"])},mask:{attrsGroups:new Set(["conditionalProcessing","core","presentation"]),attrs:new Set(["class","externalResourcesRequired","height","mask-type","maskContentUnits","maskUnits","style","width","x","y"]),defaults:{maskUnits:"objectBoundingBox",maskContentUnits:"userSpaceOnUse",x:"-10%",y:"-10%",width:"120%",height:"120%"},contentGroups:new Set(["animation","descriptive","paintServer","shape","structural"]),content:new Set(["a","altGlyphDef","clipPath","color-profile","cursor","filter","font-face","font","foreignObject","image","marker","mask","pattern","script","style","switch","text","view"])},metadata:{attrsGroups:new Set(["core"])},"missing-glyph":{attrsGroups:new Set(["core","presentation"]),attrs:new Set(["class","d","horiz-adv-x","style","vert-adv-y","vert-origin-x","vert-origin-y"]),deprecated:{unsafe:new Set(["horiz-adv-x","vert-adv-y","vert-origin-x","vert-origin-y"])},contentGroups:new Set(["animation","descriptive","paintServer","shape","structural"]),content:new Set(["a","altGlyphDef","clipPath","color-profile","cursor","filter","font-face","font","foreignObject","image","marker","mask","pattern","script","style","switch","text","view"])},mpath:{attrsGroups:new Set(["core","xlink"]),attrs:new Set(["externalResourcesRequired","href","xlink:href"]),contentGroups:new Set(["descriptive"])},path:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","d","externalResourcesRequired","pathLength","style","transform"]),contentGroups:new Set(["animation","descriptive"])},pattern:{attrsGroups:new Set(["conditionalProcessing","core","presentation","xlink"]),attrs:new Set(["class","externalResourcesRequired","height","href","patternContentUnits","patternTransform","patternUnits","preserveAspectRatio","style","viewBox","width","x","xlink:href","y"]),defaults:{patternUnits:"objectBoundingBox",patternContentUnits:"userSpaceOnUse",x:"0",y:"0",width:"0",height:"0",preserveAspectRatio:"xMidYMid meet"},contentGroups:new Set(["animation","descriptive","paintServer","shape","structural"]),content:new Set(["a","altGlyphDef","clipPath","color-profile","cursor","filter","font-face","font","foreignObject","image","marker","mask","pattern","script","style","switch","text","view"])},polygon:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","externalResourcesRequired","points","style","transform"]),contentGroups:new Set(["animation","descriptive"])},polyline:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","externalResourcesRequired","points","style","transform"]),contentGroups:new Set(["animation","descriptive"])},radialGradient:{attrsGroups:new Set(["core","presentation","xlink"]),attrs:new Set(["class","cx","cy","externalResourcesRequired","fr","fx","fy","gradientTransform","gradientUnits","href","r","spreadMethod","style","xlink:href"]),defaults:{gradientUnits:"objectBoundingBox",cx:"50%",cy:"50%",r:"50%"},contentGroups:new Set(["descriptive"]),content:new Set(["animate","animateTransform","set","stop"])},meshGradient:{attrsGroups:new Set(["core","presentation","xlink"]),attrs:new Set(["class","style","x","y","gradientUnits","transform"]),contentGroups:new Set(["descriptive","paintServer","animation"]),content:new Set(["meshRow"])},meshRow:{attrsGroups:new Set(["core","presentation"]),attrs:new Set(["class","style"]),contentGroups:new Set(["descriptive"]),content:new Set(["meshPatch"])},meshPatch:{attrsGroups:new Set(["core","presentation"]),attrs:new Set(["class","style"]),contentGroups:new Set(["descriptive"]),content:new Set(["stop"])},rect:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","externalResourcesRequired","height","rx","ry","style","transform","width","x","y"]),defaults:{x:"0",y:"0"},contentGroups:new Set(["animation","descriptive"])},script:{attrsGroups:new Set(["core","xlink"]),attrs:new Set(["externalResourcesRequired","type","href","xlink:href"])},set:{attrsGroups:new Set(["animation","animationAttributeTarget","animationTiming","conditionalProcessing","core","xlink"]),attrs:new Set(["externalResourcesRequired","to"]),contentGroups:new Set(["descriptive"])},solidColor:{attrsGroups:new Set(["core","presentation"]),attrs:new Set(["class","style"]),contentGroups:new Set(["paintServer"])},stop:{attrsGroups:new Set(["core","presentation"]),attrs:new Set(["class","style","offset","path"]),content:new Set(["animate","animateColor","set"])},style:{attrsGroups:new Set(["core"]),attrs:new Set(["type","media","title"]),defaults:{type:"text/css"}},svg:{attrsGroups:new Set(["conditionalProcessing","core","documentEvent","graphicalEvent","presentation"]),attrs:new Set(["baseProfile","class","contentScriptType","contentStyleType","height","preserveAspectRatio","style","version","viewBox","width","x","y","zoomAndPan"]),defaults:{x:"0",y:"0",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid meet",zoomAndPan:"magnify",version:"1.1",baseProfile:"none",contentScriptType:"application/ecmascript",contentStyleType:"text/css"},deprecated:{safe:new Set(["version"]),unsafe:new Set(["baseProfile","contentScriptType","contentStyleType","zoomAndPan"])},contentGroups:new Set(["animation","descriptive","paintServer","shape","structural"]),content:new Set(["a","altGlyphDef","clipPath","color-profile","cursor","filter","font-face","font","foreignObject","image","marker","mask","pattern","script","style","switch","text","view"])},switch:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","externalResourcesRequired","style","transform"]),contentGroups:new Set(["animation","descriptive","shape"]),content:new Set(["a","foreignObject","g","image","svg","switch","text","use"])},symbol:{attrsGroups:new Set(["core","graphicalEvent","presentation"]),attrs:new Set(["class","externalResourcesRequired","preserveAspectRatio","refX","refY","style","viewBox"]),defaults:{refX:"0",refY:"0"},contentGroups:new Set(["animation","descriptive","paintServer","shape","structural"]),content:new Set(["a","altGlyphDef","clipPath","color-profile","cursor","filter","font-face","font","foreignObject","image","marker","mask","pattern","script","style","switch","text","view"])},text:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","dx","dy","externalResourcesRequired","lengthAdjust","rotate","style","textLength","transform","x","y"]),defaults:{x:"0",y:"0",lengthAdjust:"spacing"},contentGroups:new Set(["animation","descriptive","textContentChild"]),content:new Set(["a"])},textPath:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation","xlink"]),attrs:new Set(["class","d","externalResourcesRequired","href","method","spacing","startOffset","style","xlink:href"]),defaults:{startOffset:"0",method:"align",spacing:"exact"},contentGroups:new Set(["descriptive"]),content:new Set(["a","altGlyph","animate","animateColor","set","tref","tspan"])},title:{attrsGroups:new Set(["core"]),attrs:new Set(["class","style"])},tref:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation","xlink"]),attrs:new Set(["class","externalResourcesRequired","href","style","xlink:href"]),contentGroups:new Set(["descriptive"]),content:new Set(["animate","animateColor","set"])},tspan:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation"]),attrs:new Set(["class","dx","dy","externalResourcesRequired","lengthAdjust","rotate","style","textLength","x","y"]),contentGroups:new Set(["descriptive"]),content:new Set(["a","altGlyph","animate","animateColor","set","tref","tspan"])},use:{attrsGroups:new Set(["conditionalProcessing","core","graphicalEvent","presentation","xlink"]),attrs:new Set(["class","externalResourcesRequired","height","href","style","transform","width","x","xlink:href","y"]),defaults:{x:"0",y:"0"},contentGroups:new Set(["animation","descriptive"])},view:{attrsGroups:new Set(["core"]),attrs:new Set(["externalResourcesRequired","preserveAspectRatio","viewBox","viewTarget","zoomAndPan"]),deprecated:{unsafe:new Set(["viewTarget","zoomAndPan"])},contentGroups:new Set(["descriptive"])},vkern:{attrsGroups:new Set(["core"]),attrs:new Set(["u1","g1","u2","g2","k"]),deprecated:{unsafe:new Set(["g1","g2","k","u1","u2"])}}} const editorNamespaces=new Set(["http://creativecommons.org/ns#","http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd","http://krita.org/namespaces/svg/krita","http://ns.adobe.com/AdobeIllustrator/10.0/","http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/","http://ns.adobe.com/Extensibility/1.0/","http://ns.adobe.com/Flows/1.0/","http://ns.adobe.com/GenericCustomNamespace/1.0/","http://ns.adobe.com/Graphs/1.0/","http://ns.adobe.com/ImageReplacement/1.0/","http://ns.adobe.com/SaveForWeb/1.0/","http://ns.adobe.com/Variables/1.0/","http://ns.adobe.com/XPath/1.0/","http://purl.org/dc/elements/1.1/","http://schemas.microsoft.com/visio/2003/SVGExtensions/","http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd","http://taptrix.com/vectorillustrator/svg_extensions","http://www.bohemiancoding.com/sketch/ns","http://www.figma.com/figma/ns","http://www.inkscape.org/namespaces/inkscape","http://www.serif.com/","http://www.vector.evaxdesign.sk","http://www.w3.org/1999/02/22-rdf-syntax-ns#","https://boxy-svg.com"]) const referencesProps=new Set(["clip-path","color-profile","fill","filter","marker-end","marker-mid","marker-start","mask","stroke","style"]) const inheritableAttrs=new Set(["clip-rule","color-interpolation-filters","color-interpolation","color-profile","color-rendering","color","cursor","direction","dominant-baseline","fill-opacity","fill-rule","fill","font-family","font-size-adjust","font-size","font-stretch","font-style","font-variant","font-weight","font","glyph-orientation-horizontal","glyph-orientation-vertical","image-rendering","letter-spacing","marker-end","marker-mid","marker-start","marker","paint-order","pointer-events","shape-rendering","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","stroke","text-anchor","text-rendering","transform","visibility","word-spacing","writing-mode"]) const presentationNonInheritableGroupAttrs=new Set(["clip-path","display","filter","mask","opacity","text-decoration","transform","unicode-bidi"]) const colorsNames={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#639",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"} const colorsShortNames={"#f0ffff":"azure","#f5f5dc":"beige","#ffe4c4":"bisque","#a52a2a":"brown","#ff7f50":"coral","#ffd700":"gold","#808080":"gray","#008000":"green","#4b0082":"indigo","#fffff0":"ivory","#f0e68c":"khaki","#faf0e6":"linen","#800000":"maroon","#000080":"navy","#808000":"olive","#ffa500":"orange","#da70d6":"orchid","#cd853f":"peru","#ffc0cb":"pink","#dda0dd":"plum","#800080":"purple","#f00":"red","#ff0000":"red","#fa8072":"salmon","#a0522d":"sienna","#c0c0c0":"silver","#fffafa":"snow","#d2b48c":"tan","#008080":"teal","#ff6347":"tomato","#ee82ee":"violet","#f5deb3":"wheat"} const colorsProps=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]) const pseudoClasses={displayState:new Set(["fullscreen","modal","picture-in-picture"]),input:new Set(["autofill","blank","checked","default","disabled","enabled","in-range","indeterminate","invalid","optional","out-of-range","placeholder-shown","read-only","read-write","required","user-invalid","valid"]),linguistic:new Set(["dir","lang"]),location:new Set(["any-link","link","local-link","scope","target-within","target","visited"]),resourceState:new Set(["playing","paused"]),timeDimensional:new Set(["current","past","future"]),treeStructural:new Set(["empty","first-child","first-of-type","last-child","last-of-type","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","root"]),userAction:new Set(["active","focus-visible","focus-within","focus","hover"]),functional:new Set(["is","not","where","has"])} var _collections=Object.freeze({__proto__:null,attrsGroups:attrsGroups,attrsGroupsDefaults:attrsGroupsDefaults,attrsGroupsDeprecated:attrsGroupsDeprecated,colorsNames:colorsNames,colorsProps:colorsProps,colorsShortNames:colorsShortNames,editorNamespaces:editorNamespaces,elems:elems,elemsGroups:elemsGroups,inheritableAttrs:inheritableAttrs,pathElems:pathElems,presentationNonInheritableGroupAttrs:presentationNonInheritableGroupAttrs,pseudoClasses:pseudoClasses,referencesProps:referencesProps,textElems:textElems}) const EOF$3=0 const Ident$1=1 const Function$3=2 const AtKeyword$1=3 const Hash$3=4 const String$4=5 const BadString$1=6 const Url$4=7 const BadUrl$1=8 const Delim$1=9 const Number$5=10 const Percentage$3=11 const Dimension$3=12 const WhiteSpace$3=13 const CDO$3=14 const CDC$3=15 const Colon$1=16 const Semicolon$1=17 const Comma$1=18 const LeftSquareBracket$1=19 const RightSquareBracket$1=20 const LeftParenthesis$1=21 const RightParenthesis$1=22 const LeftCurlyBracket$1=23 const RightCurlyBracket$1=24 const Comment$3=25 const EOF$2=0 function isDigit$2(code){return code>=0x0030&&code<=0x0039}function isHexDigit$1(code){return isDigit$2(code)||code>=0x0041&&code<=0x0046||code>=0x0061&&code<=0x0066}function isUppercaseLetter$1(code){return code>=0x0041&&code<=0x005A}function isLowercaseLetter$1(code){return code>=0x0061&&code<=0x007A}function isLetter$1(code){return isUppercaseLetter$1(code)||isLowercaseLetter$1(code)}function isNonAscii$1(code){return code>=0x0080}function isNameStart$1(code){return isLetter$1(code)||isNonAscii$1(code)||code===0x005F}function isName$1(code){return isNameStart$1(code)||isDigit$2(code)||code===0x002D}function isNonPrintable$1(code){return code>=0x0000&&code<=0x0008||code===0x000B||code>=0x000E&&code<=0x001F||code===0x007F}function isNewline$1(code){return code===0x000A||code===0x000D||code===0x000C}function isWhiteSpace$2(code){return isNewline$1(code)||code===0x0020||code===0x0009}function isValidEscape$1(first,second){if(first!==0x005C)return false if(isNewline$1(second)||second===EOF$2)return false return true}function isIdentifierStart$1(first,second,third){if(first===0x002D)return isNameStart$1(second)||second===0x002D||isValidEscape$1(second,third) if(isNameStart$1(first))return true if(first===0x005C)return isValidEscape$1(first,second) return false}function isNumberStart$1(first,second,third){if(first===0x002B||first===0x002D){if(isDigit$2(second))return 2 return second===0x002E&&isDigit$2(third)?3:0}if(first===0x002E)return isDigit$2(second)?2:0 if(isDigit$2(first))return 1 return 0}function isBOM$1(code){if(code===0xFEFF)return 1 if(code===0xFFFE)return 1 return 0}const CATEGORY$1=new Array(0x80) const EofCategory$1=0x80 const WhiteSpaceCategory$1=0x82 const DigitCategory$1=0x83 const NameStartCategory$1=0x84 const NonPrintableCategory$1=0x85 for(let i=0;itestStr.length)return false for(let i=start;i=0;offset--)if(!isWhiteSpace$2(source.charCodeAt(offset)))break return offset+1}function findWhiteSpaceEnd$1(source,offset){for(;offset=0xD800&&code<=0xDFFF||code>0x10FFFF)&&(code=0xFFFD) return String.fromCodePoint(code)}var tokenNames$1=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"] const MIN_SIZE$1=16384 function adoptBuffer$1(buffer=null,size){if(buffer===null||buffer.length0?isBOM$1(source.charCodeAt(0)):0 const lines=adoptBuffer$1(host.lines,sourceLength) const columns=adoptBuffer$1(host.columns,sourceLength) let line=host.startLine let column=host.startColumn for(let i=startOffset;i{})){source=String(source||"") const sourceLength=source.length const offsetAndType=adoptBuffer$1(this.offsetAndType,source.length+1) const balance=adoptBuffer$1(this.balance,source.length+1) let tokenCount=0 let balanceCloseType=0 let balanceStart=0 let firstCharOffset=-1 this.offsetAndType=null this.balance=null tokenize(source,((type,start,end)=>{switch(type){default:balance[tokenCount]=sourceLength break case balanceCloseType:{let balancePrev=balanceStart&OFFSET_MASK$1 balanceStart=balance[balancePrev] balanceCloseType=balanceStart>>TYPE_SHIFT$1 balance[tokenCount]=balancePrev balance[balancePrev++]=tokenCount for(;balancePrev>TYPE_SHIFT$1 return EOF$3}lookupTypeNonSC(idx){for(let offset=this.tokenIndex;offset>TYPE_SHIFT$1 if(tokenType!==WhiteSpace$3&&tokenType!==Comment$3&&idx--===0)return tokenType}return EOF$3}lookupOffset(offset){offset+=this.tokenIndex if(offset>TYPE_SHIFT$1 if(tokenType!==WhiteSpace$3&&tokenType!==Comment$3&&idx--===0)return offset-this.tokenIndex}return EOF$3}lookupValue(offset,referenceStr){offset+=this.tokenIndex if(offset0)return tokenIndex>TYPE_SHIFT$1 this.tokenEnd=next&OFFSET_MASK$1}else{this.tokenIndex=this.tokenCount this.next()}}next(){let next=this.tokenIndex+1 if(next>TYPE_SHIFT$1 this.tokenEnd=next&OFFSET_MASK$1}else{this.eof=true this.tokenIndex=this.tokenCount this.tokenType=EOF$3 this.tokenStart=this.tokenEnd=this.source.length}}skipSC(){while(this.tokenType===WhiteSpace$3||this.tokenType===Comment$3)this.next()}skipUntilBalanced(startToken,stopConsume){let cursor=startToken let balanceEnd let offset loop:for(;cursor0?this.offsetAndType[cursor-1]&OFFSET_MASK$1:this.firstCharOffset switch(stopConsume(this.source.charCodeAt(offset))){case 1:break loop case 2:cursor++ break loop default:this.balance[balanceEnd]===cursor&&(cursor=balanceEnd)}}this.skip(cursor-this.tokenIndex)}forEachToken(fn){for(let i=0,offset=this.firstCharOffset;i>TYPE_SHIFT$1 offset=end fn(type,start,end,i)}}dump(){const tokens=new Array(this.tokenCount) this.forEachToken(((type,start,end,index)=>{tokens[index]={idx:index,type:tokenNames$1[type],chunk:this.source.substring(start,end),balance:this.balance[index]}})) return tokens}} function tokenize$4(source,onToken){function getCharCode(offset){return offset=source.length){offsetString(start+idx+1).padStart(maxNumLength)+" |"+line)).join("\n")}const prelines="\n".repeat(Math.max(baseLine-1,0)) const precolumns=" ".repeat(Math.max(baseColumn-1,0)) const lines=(prelines+precolumns+source).split(/\r\n?|\n|\f/) const startLine=Math.max(1,line-extraLines)-1 const endLine=Math.min(line+extraLines,lines.length+1) const maxNumLength=Math.max(4,String(endLine).length)+1 let cutLeft=0 column+=(TAB_REPLACEMENT$1.length-1)*(lines[line-1].substr(0,column-1).match(/\t/g)||[]).length if(column>MAX_LINE_LENGTH$1){cutLeft=column-OFFSET_CORRECTION$1+3 column=OFFSET_CORRECTION$1-2}for(let i=startLine;i<=endLine;i++)if(i>=0&&i0&&lines[i].length>cutLeft?"…":"")+lines[i].substr(cutLeft,MAX_LINE_LENGTH$1-2)+(lines[i].length>cutLeft+MAX_LINE_LENGTH$1-1?"…":"")}return[processLines(startLine,line),new Array(column+maxNumLength+2).join("-")+"^",processLines(line,endLine)].filter(Boolean).join("\n").replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function SyntaxError$4(message,source,offset,line,column,baseLine=1,baseColumn=1){const error=Object.assign(createCustomError$1("SyntaxError",message),{source:source,offset:offset,line:line,column:column,sourceFragment:extraLines=>sourceFragment$1({source:source,line:line,column:column,baseLine:baseLine,baseColumn:baseColumn},isNaN(extraLines)?0:extraLines),get formattedMessage(){return`Parse error: ${message}\n`+sourceFragment$1({source:source,line:line,column:column,baseLine:baseLine,baseColumn:baseColumn},2)}}) return error}function readSequence$2(recognizer){const children=this.createList() let space=false const context={recognizer:recognizer} while(!this.eof){switch(this.tokenType){case Comment$3:this.next() continue case WhiteSpace$3:space=true this.next() continue}let child=recognizer.getNode.call(this,context) if(child===void 0)break if(space){recognizer.onWhiteSpace&&recognizer.onWhiteSpace.call(this,child,children,context) space=false}children.push(child)}space&&recognizer.onWhiteSpace&&recognizer.onWhiteSpace.call(this,null,children,context) return children}const NOOP$1=()=>{} const EXCLAMATIONMARK$7=0x0021 const NUMBERSIGN$9=0x0023 const SEMICOLON$1=0x003B const LEFTCURLYBRACKET$3=0x007B const NULL$1=0 function createParseContext$1(name){return function(){return this[name]()}}function fetchParseValues$1(dict){const result=Object.create(null) for(const name of Object.keys(dict)){const item=dict[name] const fn=item.parse||item fn&&(result[name]=fn)}return result}function processConfig$1(config){const parseConfig={context:Object.create(null),features:Object.assign(Object.create(null),config.features),scope:Object.assign(Object.create(null),config.scope),atrule:fetchParseValues$1(config.atrule),pseudo:fetchParseValues$1(config.pseudo),node:fetchParseValues$1(config.node)} for(const[name,context]of Object.entries(config.parseContext))switch(typeof context){case"function":parseConfig.context[name]=context break case"string":parseConfig.context[name]=createParseContext$1(context) break}return{config:parseConfig,...parseConfig,...parseConfig.node}}function createParser$1(config){let source="" let filename="" let needPositions=false let onParseError=NOOP$1 let onParseErrorThrow=false const locationMap=new OffsetToLocation$1 const parser=Object.assign(new TokenStream$1,processConfig$1(config||{}),{parseAtrulePrelude:true,parseRulePrelude:true,parseValue:true,parseCustomProperty:false,readSequence:readSequence$2,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket:code=>code===LEFTCURLYBRACKET$3?1:0,consumeUntilLeftCurlyBracketOrSemicolon:code=>code===LEFTCURLYBRACKET$3||code===SEMICOLON$1?1:0,consumeUntilExclamationMarkOrSemicolon:code=>code===EXCLAMATIONMARK$7||code===SEMICOLON$1?1:0,consumeUntilSemicolonIncluded:code=>code===SEMICOLON$1?2:0,createList:()=>new List$1,createSingleNodeList:node=>(new List$1).appendData(node),getFirstListNode:list=>list&&list.first,getLastListNode:list=>list&&list.last,parseWithFallback(consumer,fallback){const startIndex=this.tokenIndex try{return consumer.call(this)}catch(e){if(onParseErrorThrow)throw e this.skip(startIndex-this.tokenIndex) const fallbackNode=fallback.call(this) onParseErrorThrow=true onParseError(e,fallbackNode) onParseErrorThrow=false return fallbackNode}},lookupNonWSType(offset){let type do{type=this.lookupType(offset++) if(type!==WhiteSpace$3&&type!==Comment$3)return type}while(type!==NULL$1) return NULL$1},charCodeAt:offset=>offset>=0&&offsetsource.substring(offsetStart,offsetEnd),substrToCursor(start){return this.source.substring(start,this.tokenStart)},cmpChar:(offset,charCode)=>cmpChar$1(source,offset,charCode),cmpStr:(offsetStart,offsetEnd,str)=>cmpStr$1(source,offsetStart,offsetEnd,str),consume(tokenType){const start=this.tokenStart this.eat(tokenType) return this.substrToCursor(start)},consumeFunctionName(){const name=source.substring(this.tokenStart,this.tokenEnd-1) this.eat(Function$3) return name},consumeNumber(type){const number=source.substring(this.tokenStart,consumeNumber$2(source,this.tokenStart)) this.eat(type) return number},eat(tokenType){if(this.tokenType!==tokenType){const tokenName=tokenNames$1[tokenType].slice(0,-6).replace(/-/g," ").replace(/^./,(m=>m.toUpperCase())) let message=`${/[[\](){}]/.test(tokenName)?`"${tokenName}"`:tokenName} is expected` let offset=this.tokenStart switch(tokenType){case Ident$1:if(this.tokenType===Function$3||this.tokenType===Url$4){offset=this.tokenEnd-1 message="Identifier is expected but function found"}else message="Identifier is expected" break case Hash$3:if(this.isDelim(NUMBERSIGN$9)){this.next() offset++ message="Name is expected"}break case Percentage$3:if(this.tokenType===Number$5){offset=this.tokenEnd message="Percent sign is expected"}break}this.error(message,offset)}this.next()},eatIdent(name){this.tokenType===Ident$1&&this.lookupValue(0,name)!==false||this.error(`Identifier "${name}" is expected`) this.next()},eatDelim(code){this.isDelim(code)||this.error(`Delim "${String.fromCharCode(code)}" is expected`) this.next()},getLocation(start,end){if(needPositions)return locationMap.getLocationRange(start,end,filename) return null},getLocationFromList(list){if(needPositions){const head=this.getFirstListNode(list) const tail=this.getLastListNode(list) return locationMap.getLocationRange(head!==null?head.loc.start.offset-locationMap.startOffset:this.tokenStart,tail!==null?tail.loc.end.offset-locationMap.startOffset:this.tokenStart,filename)}return null},error(message,offset){const location=typeof offset!=="undefined"&&offset" needPositions=Boolean(options.positions) onParseError=typeof options.onParseError==="function"?options.onParseError:NOOP$1 onParseErrorThrow=false parser.parseAtrulePrelude=!("parseAtrulePrelude"in options)||Boolean(options.parseAtrulePrelude) parser.parseRulePrelude=!("parseRulePrelude"in options)||Boolean(options.parseRulePrelude) parser.parseValue=!("parseValue"in options)||Boolean(options.parseValue) parser.parseCustomProperty="parseCustomProperty"in options&&Boolean(options.parseCustomProperty) const{context:context="default",onComment:onComment}=options if(context in parser.context===false)throw new Error("Unknown context `"+context+"`") typeof onComment==="function"&&parser.forEachToken(((type,start,end)=>{if(type===Comment$3){const loc=parser.getLocation(start,end) const value=cmpStr$1(source,end-2,end,"*/")?source.slice(start+2,end-2):source.slice(start+2,end) onComment(value,loc)}})) const ast=parser.context[context].call(parser,options) parser.eof||parser.error() return ast} return Object.assign(parse,{SyntaxError:SyntaxError$4,config:parser.config})}var base64Vlq={} var base64$1={} var intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("") base64$1.encode=function(number){if(0<=number&&number>1 return isNegative?-shifted:shifted}base64Vlq.encode=function base64VLQ_encode(aValue){var encoded="" var digit var vlq=toVLQSigned(aValue) do{digit=vlq&VLQ_BASE_MASK vlq>>>=VLQ_BASE_SHIFT vlq>0&&(digit|=VLQ_CONTINUATION_BIT) encoded+=base64.encode(digit)}while(vlq>0) return encoded} base64Vlq.decode=function base64VLQ_decode(aStr,aIndex,aOutParam){var strLen=aStr.length var result=0 var shift=0 var continuation,digit do{if(aIndex>=strLen)throw new Error("Expected more digits in base 64 VLQ value.") digit=base64.decode(aStr.charCodeAt(aIndex++)) if(digit===-1)throw new Error("Invalid base64 digit: "+aStr.charAt(aIndex-1)) continuation=!!(digit&VLQ_CONTINUATION_BIT) digit&=VLQ_BASE_MASK result+=digit<MAX_CACHED_INPUTS&&cache.pop() return result}}var normalize=lruMemoize((function normalize(aPath){var path=aPath var url=urlParse(aPath) if(url){if(!url.path)return aPath path=url.path}var isAbsolute=exports.isAbsolute(path) var parts=[] var start=0 var i=0 while(true){start=i i=path.indexOf("/",start) if(i===-1){parts.push(path.slice(start)) break}parts.push(path.slice(start,i)) while(i=0;i--){part=parts[i] if(part===".")parts.splice(i,1) else if(part==="..")up++ else if(up>0)if(part===""){parts.splice(i+1,up) up=0}else{parts.splice(i,2) up--}}path=parts.join("/") path===""&&(path=isAbsolute?"/":".") if(url){url.path=path return urlGenerate(url)}return path})) exports.normalize=normalize function join(aRoot,aPath){aRoot===""&&(aRoot=".") aPath===""&&(aPath=".") var aPathUrl=urlParse(aPath) var aRootUrl=urlParse(aRoot) aRootUrl&&(aRoot=aRootUrl.path||"/") if(aPathUrl&&!aPathUrl.scheme){aRootUrl&&(aPathUrl.scheme=aRootUrl.scheme) return urlGenerate(aPathUrl)}if(aPathUrl||aPath.match(dataUrlRegexp))return aPath if(aRootUrl&&!aRootUrl.host&&!aRootUrl.path){aRootUrl.host=aPath return urlGenerate(aRootUrl)}var joined=aPath.charAt(0)==="/"?aPath:normalize(aRoot.replace(/\/+$/,"")+"/"+aPath) if(aRootUrl){aRootUrl.path=joined return urlGenerate(aRootUrl)}return joined}exports.join=join exports.isAbsolute=function(aPath){return aPath.charAt(0)==="/"||urlRegexp.test(aPath)} function relative(aRoot,aPath){aRoot===""&&(aRoot=".") aRoot=aRoot.replace(/\/$/,"") var level=0 while(aPath.indexOf(aRoot+"/")!==0){var index=aRoot.lastIndexOf("/") if(index<0)return aPath aRoot=aRoot.slice(0,index) if(aRoot.match(/^([^\/]+:\/)?\/*$/))return aPath;++level}return Array(level+1).join("../")+aPath.substr(aRoot.length+1)}exports.relative=relative var supportsNullProto=function(){var obj=Object.create(null) return!("__proto__"in obj)}() function identity(s){return s}function toSetString(aStr){if(isProtoString(aStr))return"$"+aStr return aStr}exports.toSetString=supportsNullProto?identity:toSetString function fromSetString(aStr){if(isProtoString(aStr))return aStr.slice(1) return aStr}exports.fromSetString=supportsNullProto?identity:fromSetString function isProtoString(s){if(!s)return false var length=s.length if(length<9)return false if(s.charCodeAt(length-1)!==95||s.charCodeAt(length-2)!==95||s.charCodeAt(length-3)!==111||s.charCodeAt(length-4)!==116||s.charCodeAt(length-5)!==111||s.charCodeAt(length-6)!==114||s.charCodeAt(length-7)!==112||s.charCodeAt(length-8)!==95||s.charCodeAt(length-9)!==95)return false for(var i=length-10;i>=0;i--)if(s.charCodeAt(i)!==36)return false return true}function compareByOriginalPositions(mappingA,mappingB,onlyCompareOriginal){var cmp=strcmp(mappingA.source,mappingB.source) if(cmp!==0)return cmp cmp=mappingA.originalLine-mappingB.originalLine if(cmp!==0)return cmp cmp=mappingA.originalColumn-mappingB.originalColumn if(cmp!==0||onlyCompareOriginal)return cmp cmp=mappingA.generatedColumn-mappingB.generatedColumn if(cmp!==0)return cmp cmp=mappingA.generatedLine-mappingB.generatedLine if(cmp!==0)return cmp return strcmp(mappingA.name,mappingB.name)}exports.compareByOriginalPositions=compareByOriginalPositions function compareByOriginalPositionsNoSource(mappingA,mappingB,onlyCompareOriginal){var cmp cmp=mappingA.originalLine-mappingB.originalLine if(cmp!==0)return cmp cmp=mappingA.originalColumn-mappingB.originalColumn if(cmp!==0||onlyCompareOriginal)return cmp cmp=mappingA.generatedColumn-mappingB.generatedColumn if(cmp!==0)return cmp cmp=mappingA.generatedLine-mappingB.generatedLine if(cmp!==0)return cmp return strcmp(mappingA.name,mappingB.name)}exports.compareByOriginalPositionsNoSource=compareByOriginalPositionsNoSource function compareByGeneratedPositionsDeflated(mappingA,mappingB,onlyCompareGenerated){var cmp=mappingA.generatedLine-mappingB.generatedLine if(cmp!==0)return cmp cmp=mappingA.generatedColumn-mappingB.generatedColumn if(cmp!==0||onlyCompareGenerated)return cmp cmp=strcmp(mappingA.source,mappingB.source) if(cmp!==0)return cmp cmp=mappingA.originalLine-mappingB.originalLine if(cmp!==0)return cmp cmp=mappingA.originalColumn-mappingB.originalColumn if(cmp!==0)return cmp return strcmp(mappingA.name,mappingB.name)}exports.compareByGeneratedPositionsDeflated=compareByGeneratedPositionsDeflated function compareByGeneratedPositionsDeflatedNoLine(mappingA,mappingB,onlyCompareGenerated){var cmp=mappingA.generatedColumn-mappingB.generatedColumn if(cmp!==0||onlyCompareGenerated)return cmp cmp=strcmp(mappingA.source,mappingB.source) if(cmp!==0)return cmp cmp=mappingA.originalLine-mappingB.originalLine if(cmp!==0)return cmp cmp=mappingA.originalColumn-mappingB.originalColumn if(cmp!==0)return cmp return strcmp(mappingA.name,mappingB.name)}exports.compareByGeneratedPositionsDeflatedNoLine=compareByGeneratedPositionsDeflatedNoLine function strcmp(aStr1,aStr2){if(aStr1===aStr2)return 0 if(aStr1===null)return 1 if(aStr2===null)return-1 if(aStr1>aStr2)return 1 return-1}function compareByGeneratedPositionsInflated(mappingA,mappingB){var cmp=mappingA.generatedLine-mappingB.generatedLine if(cmp!==0)return cmp cmp=mappingA.generatedColumn-mappingB.generatedColumn if(cmp!==0)return cmp cmp=strcmp(mappingA.source,mappingB.source) if(cmp!==0)return cmp cmp=mappingA.originalLine-mappingB.originalLine if(cmp!==0)return cmp cmp=mappingA.originalColumn-mappingB.originalColumn if(cmp!==0)return cmp return strcmp(mappingA.name,mappingB.name)}exports.compareByGeneratedPositionsInflated=compareByGeneratedPositionsInflated function parseSourceMapInput(str){return JSON.parse(str.replace(/^\)]}'[^\n]*\n/,""))}exports.parseSourceMapInput=parseSourceMapInput function computeSourceURL(sourceRoot,sourceURL,sourceMapURL){sourceURL=sourceURL||"" if(sourceRoot){sourceRoot[sourceRoot.length-1]!=="/"&&sourceURL[0]!=="/"&&(sourceRoot+="/") sourceURL=sourceRoot+sourceURL}if(sourceMapURL){var parsed=urlParse(sourceMapURL) if(!parsed)throw new Error("sourceMapURL could not be parsed") if(parsed.path){var index=parsed.path.lastIndexOf("/") index>=0&&(parsed.path=parsed.path.substring(0,index+1))}sourceURL=join(urlGenerate(parsed),sourceURL)}return normalize(sourceURL)}exports.computeSourceURL=computeSourceURL})(util$3) var arraySet={} var util$2=util$3 var has=Object.prototype.hasOwnProperty var hasNativeMap=typeof Map!=="undefined" function ArraySet$1(){this._array=[] this._set=hasNativeMap?new Map:Object.create(null)}ArraySet$1.fromArray=function ArraySet_fromArray(aArray,aAllowDuplicates){var set=new ArraySet$1 for(var i=0,len=aArray.length;i=0)return idx}else{var sStr=util$2.toSetString(aStr) if(has.call(this._set,sStr))return this._set[sStr]}throw new Error('"'+aStr+'" is not in the set.')} ArraySet$1.prototype.at=function ArraySet_at(aIdx){if(aIdx>=0&&aIdxlineA||lineB==lineA&&columnB>=columnA||util$1.compareByGeneratedPositionsInflated(mappingA,mappingB)<=0}function MappingList$1(){this._array=[] this._sorted=true this._last={generatedLine:-1,generatedColumn:0}}MappingList$1.prototype.unsortedForEach=function MappingList_forEach(aCallback,aThisArg){this._array.forEach(aCallback,aThisArg)} MappingList$1.prototype.add=function MappingList_add(aMapping){if(generatedPositionAfter(this._last,aMapping)){this._last=aMapping this._array.push(aMapping)}else{this._sorted=false this._array.push(aMapping)}} MappingList$1.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(util$1.compareByGeneratedPositionsInflated) this._sorted=true}return this._array} mappingList.MappingList=MappingList$1 var base64VLQ=base64Vlq var util=util$3 var ArraySet=arraySet.ArraySet var MappingList=mappingList.MappingList function SourceMapGenerator(aArgs){aArgs||(aArgs={}) this._file=util.getArg(aArgs,"file",null) this._sourceRoot=util.getArg(aArgs,"sourceRoot",null) this._skipValidation=util.getArg(aArgs,"skipValidation",false) this._ignoreInvalidMapping=util.getArg(aArgs,"ignoreInvalidMapping",false) this._sources=new ArraySet this._names=new ArraySet this._mappings=new MappingList this._sourcesContents=null}SourceMapGenerator.prototype._version=3 SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(aSourceMapConsumer,generatorOps){var sourceRoot=aSourceMapConsumer.sourceRoot var generator=new SourceMapGenerator(Object.assign(generatorOps||{},{file:aSourceMapConsumer.file,sourceRoot:sourceRoot})) aSourceMapConsumer.eachMapping((function(mapping){var newMapping={generated:{line:mapping.generatedLine,column:mapping.generatedColumn}} if(mapping.source!=null){newMapping.source=mapping.source sourceRoot!=null&&(newMapping.source=util.relative(sourceRoot,newMapping.source)) newMapping.original={line:mapping.originalLine,column:mapping.originalColumn} mapping.name!=null&&(newMapping.name=mapping.name)}generator.addMapping(newMapping)})) aSourceMapConsumer.sources.forEach((function(sourceFile){var sourceRelative=sourceFile sourceRoot!==null&&(sourceRelative=util.relative(sourceRoot,sourceFile)) generator._sources.has(sourceRelative)||generator._sources.add(sourceRelative) var content=aSourceMapConsumer.sourceContentFor(sourceFile) content!=null&&generator.setSourceContent(sourceFile,content)})) return generator} SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(aArgs){var generated=util.getArg(aArgs,"generated") var original=util.getArg(aArgs,"original",null) var source=util.getArg(aArgs,"source",null) var name=util.getArg(aArgs,"name",null) if(!this._skipValidation&&this._validateMapping(generated,original,source,name)===false)return if(source!=null){source=String(source) this._sources.has(source)||this._sources.add(source)}if(name!=null){name=String(name) this._names.has(name)||this._names.add(name)}this._mappings.add({generatedLine:generated.line,generatedColumn:generated.column,originalLine:original!=null&&original.line,originalColumn:original!=null&&original.column,source:source,name:name})} SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(aSourceFile,aSourceContent){var source=aSourceFile this._sourceRoot!=null&&(source=util.relative(this._sourceRoot,source)) if(aSourceContent!=null){this._sourcesContents||(this._sourcesContents=Object.create(null)) this._sourcesContents[util.toSetString(source)]=aSourceContent}else if(this._sourcesContents){delete this._sourcesContents[util.toSetString(source)] Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null)}} SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(aSourceMapConsumer,aSourceFile,aSourceMapPath){var sourceFile=aSourceFile if(aSourceFile==null){if(aSourceMapConsumer.file==null)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.') sourceFile=aSourceMapConsumer.file}var sourceRoot=this._sourceRoot sourceRoot!=null&&(sourceFile=util.relative(sourceRoot,sourceFile)) var newSources=new ArraySet var newNames=new ArraySet this._mappings.unsortedForEach((function(mapping){if(mapping.source===sourceFile&&mapping.originalLine!=null){var original=aSourceMapConsumer.originalPositionFor({line:mapping.originalLine,column:mapping.originalColumn}) if(original.source!=null){mapping.source=original.source aSourceMapPath!=null&&(mapping.source=util.join(aSourceMapPath,mapping.source)) sourceRoot!=null&&(mapping.source=util.relative(sourceRoot,mapping.source)) mapping.originalLine=original.line mapping.originalColumn=original.column original.name!=null&&(mapping.name=original.name)}}var source=mapping.source source==null||newSources.has(source)||newSources.add(source) var name=mapping.name name==null||newNames.has(name)||newNames.add(name)}),this) this._sources=newSources this._names=newNames aSourceMapConsumer.sources.forEach((function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile) if(content!=null){aSourceMapPath!=null&&(sourceFile=util.join(aSourceMapPath,sourceFile)) sourceRoot!=null&&(sourceFile=util.relative(sourceRoot,sourceFile)) this.setSourceContent(sourceFile,content)}}),this)} SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(aGenerated,aOriginal,aSource,aName){if(aOriginal&&typeof aOriginal.line!=="number"&&typeof aOriginal.column!=="number"){var message="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(this._ignoreInvalidMapping){typeof console!=="undefined"&&console.warn&&console.warn(message) return false}throw new Error(message)}if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aGenerated.line>0&&aGenerated.column>=0&&!aOriginal&&!aSource&&!aName)return if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aOriginal&&"line"in aOriginal&&"column"in aOriginal&&aGenerated.line>0&&aGenerated.column>=0&&aOriginal.line>0&&aOriginal.column>=0&&aSource)return var message="Invalid mapping: "+JSON.stringify({generated:aGenerated,source:aSource,original:aOriginal,name:aName}) if(this._ignoreInvalidMapping){typeof console!=="undefined"&&console.warn&&console.warn(message) return false}throw new Error(message)} SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var previousGeneratedColumn=0 var previousGeneratedLine=1 var previousOriginalColumn=0 var previousOriginalLine=0 var previousName=0 var previousSource=0 var result="" var next var mapping var nameIdx var sourceIdx var mappings=this._mappings.toArray() for(var i=0,len=mappings.length;i0){if(!util.compareByGeneratedPositionsInflated(mapping,mappings[i-1]))continue next+=","}next+=base64VLQ.encode(mapping.generatedColumn-previousGeneratedColumn) previousGeneratedColumn=mapping.generatedColumn if(mapping.source!=null){sourceIdx=this._sources.indexOf(mapping.source) next+=base64VLQ.encode(sourceIdx-previousSource) previousSource=sourceIdx next+=base64VLQ.encode(mapping.originalLine-1-previousOriginalLine) previousOriginalLine=mapping.originalLine-1 next+=base64VLQ.encode(mapping.originalColumn-previousOriginalColumn) previousOriginalColumn=mapping.originalColumn if(mapping.name!=null){nameIdx=this._names.indexOf(mapping.name) next+=base64VLQ.encode(nameIdx-previousName) previousName=nameIdx}}result+=next}return result} SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(aSources,aSourceRoot){return aSources.map((function(source){if(!this._sourcesContents)return null aSourceRoot!=null&&(source=util.relative(aSourceRoot,source)) var key=util.toSetString(source) return Object.prototype.hasOwnProperty.call(this._sourcesContents,key)?this._sourcesContents[key]:null}),this)} SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var map={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()} this._file!=null&&(map.file=this._file) this._sourceRoot!=null&&(map.sourceRoot=this._sourceRoot) this._sourcesContents&&(map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot)) return map} SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())} var SourceMapGenerator_1=SourceMapGenerator const trackNodes$1=new Set(["Atrule","Selector","Declaration"]) function generateSourceMap$1(handlers){const map=new SourceMapGenerator_1 const generated={line:1,column:0} const original={line:0,column:0} const activatedGenerated={line:1,column:0} const activatedMapping={generated:activatedGenerated} let line=1 let column=0 let sourceMappingActive=false const origHandlersNode=handlers.node handlers.node=function(node){if(node.loc&&node.loc.start&&trackNodes$1.has(node.type)){const nodeLine=node.loc.start.line const nodeColumn=node.loc.start.column-1 if(original.line!==nodeLine||original.column!==nodeColumn){original.line=nodeLine original.column=nodeColumn generated.line=line generated.column=column if(sourceMappingActive){sourceMappingActive=false generated.line===activatedGenerated.line&&generated.column===activatedGenerated.column||map.addMapping(activatedMapping)}sourceMappingActive=true map.addMapping({source:node.loc.source,original:original,generated:generated})}}origHandlersNode.call(this,node) if(sourceMappingActive&&trackNodes$1.has(node.type)){activatedGenerated.line=line activatedGenerated.column=column}} const origHandlersEmit=handlers.emit handlers.emit=function(value,type,auto){for(let i=0;i{type===Delim$1&&(type=value) if(typeof type==="string"){const charCode=type.charCodeAt(0) return charCode>0x7F?0x8000:charCode<<8}return type} const specPairs$1=[[Ident$1,Ident$1],[Ident$1,Function$3],[Ident$1,Url$4],[Ident$1,BadUrl$1],[Ident$1,"-"],[Ident$1,Number$5],[Ident$1,Percentage$3],[Ident$1,Dimension$3],[Ident$1,CDC$3],[Ident$1,LeftParenthesis$1],[AtKeyword$1,Ident$1],[AtKeyword$1,Function$3],[AtKeyword$1,Url$4],[AtKeyword$1,BadUrl$1],[AtKeyword$1,"-"],[AtKeyword$1,Number$5],[AtKeyword$1,Percentage$3],[AtKeyword$1,Dimension$3],[AtKeyword$1,CDC$3],[Hash$3,Ident$1],[Hash$3,Function$3],[Hash$3,Url$4],[Hash$3,BadUrl$1],[Hash$3,"-"],[Hash$3,Number$5],[Hash$3,Percentage$3],[Hash$3,Dimension$3],[Hash$3,CDC$3],[Dimension$3,Ident$1],[Dimension$3,Function$3],[Dimension$3,Url$4],[Dimension$3,BadUrl$1],[Dimension$3,"-"],[Dimension$3,Number$5],[Dimension$3,Percentage$3],[Dimension$3,Dimension$3],[Dimension$3,CDC$3],["#",Ident$1],["#",Function$3],["#",Url$4],["#",BadUrl$1],["#","-"],["#",Number$5],["#",Percentage$3],["#",Dimension$3],["#",CDC$3],["-",Ident$1],["-",Function$3],["-",Url$4],["-",BadUrl$1],["-","-"],["-",Number$5],["-",Percentage$3],["-",Dimension$3],["-",CDC$3],[Number$5,Ident$1],[Number$5,Function$3],[Number$5,Url$4],[Number$5,BadUrl$1],[Number$5,Number$5],[Number$5,Percentage$3],[Number$5,Dimension$3],[Number$5,"%"],[Number$5,CDC$3],["@",Ident$1],["@",Function$3],["@",Url$4],["@",BadUrl$1],["@","-"],["@",CDC$3],[".",Number$5],[".",Percentage$3],[".",Dimension$3],["+",Number$5],["+",Percentage$3],["+",Dimension$3],["/","*"]] const safePairs$1=specPairs$1.concat([[Ident$1,Hash$3],[Dimension$3,Hash$3],[Hash$3,Hash$3],[AtKeyword$1,LeftParenthesis$1],[AtKeyword$1,String$4],[AtKeyword$1,Colon$1],[Percentage$3,Percentage$3],[Percentage$3,Dimension$3],[Percentage$3,Function$3],[Percentage$3,"-"],[RightParenthesis$1,Ident$1],[RightParenthesis$1,Function$3],[RightParenthesis$1,Percentage$3],[RightParenthesis$1,Dimension$3],[RightParenthesis$1,Hash$3],[RightParenthesis$1,"-"]]) function createMap$1(pairs){const isWhiteSpaceRequired=new Set(pairs.map((([prev,next])=>code$1(prev)<<16|code$1(next)))) return function(prevCode,type,value){const nextCode=code$1(type,value) const nextCharCode=value.charCodeAt(0) const emitWs=nextCharCode===HYPHENMINUS$d&&type!==Ident$1&&type!==Function$3&&type!==CDC$3||nextCharCode===PLUSSIGN$j?isWhiteSpaceRequired.has(prevCode<<16|nextCharCode<<8):isWhiteSpaceRequired.has(prevCode<<16|nextCode) emitWs&&this.emit(" ",WhiteSpace$3,true) return nextCode}}const spec$1=createMap$1(specPairs$1) const safe$1=createMap$1(safePairs$1) var tokenBefore$1=Object.freeze({__proto__:null,safe:safe$1,spec:spec$1}) const REVERSESOLIDUS$1=0x005c function processChildren$1(node,delimeter){if(typeof delimeter==="function"){let prev=null node.children.forEach((node=>{prev!==null&&delimeter.call(this,prev) this.node(node) prev=node})) return}node.children.forEach(this.node,this)}function processChunk$1(chunk){tokenize$4(chunk,((type,start,end)=>{this.token(type,chunk.slice(start,end))}))}function createGenerator$1(config){const types=new Map for(let[name,item]of Object.entries(config.node)){const fn=item.generate||item typeof fn==="function"&&types.set(name,item.generate||item)}return function(node,options){let buffer="" let prevCode=0 let handlers={node(node){if(!types.has(node.type))throw new Error("Unknown node type: "+node.type) types.get(node.type).call(publicApi,node)},tokenBefore:safe$1,token(type,value){prevCode=this.tokenBefore(prevCode,type,value) this.emit(value,type,false) type===Delim$1&&value.charCodeAt(0)===REVERSESOLIDUS$1&&this.emit("\n",WhiteSpace$3,true)},emit(value){buffer+=value},result:()=>buffer} if(options){typeof options.decorator==="function"&&(handlers=options.decorator(handlers)) options.sourceMap&&(handlers=generateSourceMap$1(handlers)) options.mode in tokenBefore$1&&(handlers.tokenBefore=tokenBefore$1[options.mode])}const publicApi={node:node=>handlers.node(node),children:processChildren$1,token:(type,value)=>handlers.token(type,value),tokenize:processChunk$1} handlers.node(node) return handlers.result()}}function createConvertor$1(walk){return{fromPlainObject(ast){walk(ast,{enter(node){node.children&&node.children instanceof List$1===false&&(node.children=(new List$1).fromArray(node.children))}}) return ast},toPlainObject(ast){walk(ast,{leave(node){node.children&&node.children instanceof List$1&&(node.children=node.children.toArray())}}) return ast}}}const{hasOwnProperty:hasOwnProperty$b}=Object.prototype const noop$5=function(){} function ensureFunction$3(value){return typeof value==="function"?value:noop$5}function invokeForType$1(fn,type){return function(node,item,list){node.type===type&&fn.call(this,node,item,list)}}function getWalkersFromStructure$1(name,nodeType){const structure=nodeType.structure const walkers=[] for(const key in structure){if(hasOwnProperty$b.call(structure,key)===false)continue let fieldTypes=structure[key] const walker={name:key,type:false,nullable:false} Array.isArray(fieldTypes)||(fieldTypes=[fieldTypes]) for(const fieldType of fieldTypes)fieldType===null?walker.nullable=true:typeof fieldType==="string"?walker.type="node":Array.isArray(fieldType)&&(walker.type="list") walker.type&&walkers.push(walker)}if(walkers.length)return{context:nodeType.walkContext,fields:walkers} return null}function getTypesFromConfig$1(config){const types={} for(const name in config.node)if(hasOwnProperty$b.call(config.node,name)){const nodeType=config.node[name] if(!nodeType.structure)throw new Error("Missed `structure` field in `"+name+"` node type definition") types[name]=getWalkersFromStructure$1(name,nodeType)}return types}function createTypeIterator$1(config,reverse){const fields=config.fields.slice() const contextName=config.context const useContext=typeof contextName==="string" reverse&&fields.reverse() return function(node,context,walk,walkReducer){let prevContextValue if(useContext){prevContextValue=context[contextName] context[contextName]=node}for(const field of fields){const ref=node[field.name] if(!field.nullable||ref)if(field.type==="list"){const breakWalk=reverse?ref.reduceRight(walkReducer,false):ref.reduce(walkReducer,false) if(breakWalk)return true}else if(walk(ref))return true}useContext&&(context[contextName]=prevContextValue)}}function createFastTraveralMap$1({StyleSheet:StyleSheet,Atrule:Atrule,Rule:Rule,Block:Block,DeclarationList:DeclarationList}){return{Atrule:{StyleSheet:StyleSheet,Atrule:Atrule,Rule:Rule,Block:Block},Rule:{StyleSheet:StyleSheet,Atrule:Atrule,Rule:Rule,Block:Block},Declaration:{StyleSheet:StyleSheet,Atrule:Atrule,Rule:Rule,Block:Block,DeclarationList:DeclarationList}}}function createWalker$1(config){const types=getTypesFromConfig$1(config) const iteratorsNatural={} const iteratorsReverse={} const breakWalk=Symbol("break-walk") const skipNode=Symbol("skip-node") for(const name in types)if(hasOwnProperty$b.call(types,name)&&types[name]!==null){iteratorsNatural[name]=createTypeIterator$1(types[name],false) iteratorsReverse[name]=createTypeIterator$1(types[name],true)}const fastTraversalIteratorsNatural=createFastTraveralMap$1(iteratorsNatural) const fastTraversalIteratorsReverse=createFastTraveralMap$1(iteratorsReverse) const walk=function(root,options){function walkNode(node,item,list){const enterRet=enter.call(context,node,item,list) if(enterRet===breakWalk)return true if(enterRet===skipNode)return false if(iterators.hasOwnProperty(node.type)&&iterators[node.type](node,context,walkNode,walkReducer))return true if(leave.call(context,node,item,list)===breakWalk)return true return false}let enter=noop$5 let leave=noop$5 let iterators=iteratorsNatural let walkReducer=(ret,data,item,list)=>ret||walkNode(data,item,list) const context={break:breakWalk,skip:skipNode,root:root,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null} if(typeof options==="function")enter=options else if(options){enter=ensureFunction$3(options.enter) leave=ensureFunction$3(options.leave) options.reverse&&(iterators=iteratorsReverse) if(options.visit){if(fastTraversalIteratorsNatural.hasOwnProperty(options.visit))iterators=options.reverse?fastTraversalIteratorsReverse[options.visit]:fastTraversalIteratorsNatural[options.visit] else if(!types.hasOwnProperty(options.visit))throw new Error("Bad value `"+options.visit+"` for `visit` option (should be: "+Object.keys(types).sort().join(", ")+")") enter=invokeForType$1(enter,options.visit) leave=invokeForType$1(leave,options.visit)}}if(enter===noop$5&&leave===noop$5)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function") walkNode(root)} walk.break=breakWalk walk.skip=skipNode walk.find=function(ast,fn){let found=null walk(ast,(function(node,item,list){if(fn.call(this,node,item,list)){found=node return breakWalk}})) return found} walk.findLast=function(ast,fn){let found=null walk(ast,{reverse:true,enter(node,item,list){if(fn.call(this,node,item,list)){found=node return breakWalk}}}) return found} walk.findAll=function(ast,fn){const found=[] walk(ast,(function(node,item,list){fn.call(this,node,item,list)&&found.push(node)})) return found} return walk}function noop$4(value){return value}function generateMultiplier$1(multiplier){const{min:min,max:max,comma:comma}=multiplier if(min===0&&max===0)return comma?"#?":"*" if(min===0&&max===1)return"?" if(min===1&&max===0)return comma?"#":"+" if(min===1&&max===1)return"" return(comma?"#":"")+(min===max?"{"+min+"}":"{"+min+","+(max!==0?max:"")+"}")}function generateTypeOpts$1(node){switch(node.type){case"Range":return" ["+(node.min===null?"-∞":node.min)+","+(node.max===null?"∞":node.max)+"]" default:throw new Error("Unknown node type `"+node.type+"`")}}function generateSequence$1(node,decorate,forceBraces,compact){const combinator=node.combinator===" "||compact?node.combinator:" "+node.combinator+" " const result=node.terms.map((term=>internalGenerate$1(term,decorate,forceBraces,compact))).join(combinator) if(node.explicit||forceBraces)return(compact||result[0]===","?"[":"[ ")+result+(compact?"]":" ]") return result}function internalGenerate$1(node,decorate,forceBraces,compact){let result switch(node.type){case"Group":result=generateSequence$1(node,decorate,forceBraces,compact)+(node.disallowEmpty?"!":"") break case"Multiplier":return internalGenerate$1(node.term,decorate,forceBraces,compact)+decorate(generateMultiplier$1(node),node) case"Type":result="<"+node.name+(node.opts?decorate(generateTypeOpts$1(node.opts),node.opts):"")+">" break case"Property":result="<'"+node.name+"'>" break case"Keyword":result=node.name break case"AtKeyword":result="@"+node.name break case"Function":result=node.name+"(" break case"String":case"Token":result=node.value break case"Comma":result="," break default:throw new Error("Unknown node type `"+node.type+"`")}return decorate(result,node)}function generate$1u(node,options){let decorate=noop$4 let forceBraces=false let compact=false if(typeof options==="function")decorate=options else if(options){forceBraces=Boolean(options.forceBraces) compact=Boolean(options.compact) typeof options.decorate==="function"&&(decorate=options.decorate)}return internalGenerate$1(node,decorate,forceBraces,compact)}const defaultLoc$1={offset:0,line:1,column:1} function locateMismatch$1(matchResult,node){const tokens=matchResult.tokens const longestMatch=matchResult.longestMatch const mismatchNode=longestMatch1){start=fromLoc$1(badNode||node,"end")||buildLoc$1(defaultLoc$1,css) end=buildLoc$1(start)}else{start=fromLoc$1(badNode,"start")||buildLoc$1(fromLoc$1(node,"start")||defaultLoc$1,css.slice(0,mismatchOffset)) end=fromLoc$1(badNode,"end")||buildLoc$1(start,css.substr(mismatchOffset,mismatchLength))}return{css:css,mismatchOffset:mismatchOffset,mismatchLength:mismatchLength,start:start,end:end}}function fromLoc$1(node,point){const value=node&&node.loc&&node.loc[point] if(value)return"line"in value?buildLoc$1(value):value return null}function buildLoc$1({offset:offset,line:line,column:column},extra){const loc={offset:offset,line:line,column:column} if(extra){const lines=extra.split(/\n|\r\n?|\f/) loc.offset+=extra.length loc.line+=lines.length-1 loc.column=lines.length===1?loc.column+extra.length:lines.pop().length+1}return loc}const SyntaxReferenceError$1=function(type,referenceName){const error=createCustomError$1("SyntaxReferenceError",type+(referenceName?" `"+referenceName+"`":"")) error.reference=referenceName return error} const SyntaxMatchError$1=function(message,syntax,node,matchResult){const error=createCustomError$1("SyntaxMatchError",message) const{css:css,mismatchOffset:mismatchOffset,mismatchLength:mismatchLength,start:start,end:end}=locateMismatch$1(matchResult,node) error.rawMessage=message error.syntax=syntax?generate$1u(syntax):"" error.css=css error.mismatchOffset=mismatchOffset error.mismatchLength=mismatchLength error.message=message+"\n syntax: "+error.syntax+"\n value: "+(css||"")+"\n --------"+new Array(error.mismatchOffset+1).join("-")+"^" Object.assign(error,start) error.loc={source:node&&node.loc&&node.loc.source||"",start:start,end:end} return error} const keywords$1=new Map const properties$1=new Map const HYPHENMINUS$c=45 const keyword$1=getKeywordDescriptor$1 const property$1=getPropertyDescriptor$1 function isCustomProperty$1(str,offset){offset=offset||0 return str.length-offset>=2&&str.charCodeAt(offset)===HYPHENMINUS$c&&str.charCodeAt(offset+1)===HYPHENMINUS$c}function getVendorPrefix$1(str,offset){offset=offset||0 if(str.length-offset>=3&&str.charCodeAt(offset)===HYPHENMINUS$c&&str.charCodeAt(offset+1)!==HYPHENMINUS$c){const secondDashIndex=str.indexOf("-",offset+2) if(secondDashIndex!==-1)return str.substring(offset,secondDashIndex+1)}return""}function getKeywordDescriptor$1(keyword){if(keywords$1.has(keyword))return keywords$1.get(keyword) const name=keyword.toLowerCase() let descriptor=keywords$1.get(name) if(descriptor===void 0){const custom=isCustomProperty$1(name,0) const vendor=custom?"":getVendorPrefix$1(name,0) descriptor=Object.freeze({basename:name.substr(vendor.length),name:name,prefix:vendor,vendor:vendor,custom:custom})}keywords$1.set(keyword,descriptor) return descriptor}function getPropertyDescriptor$1(property){if(properties$1.has(property))return properties$1.get(property) let name=property let hack=property[0] hack==="/"?hack=property[1]==="/"?"//":"/":hack!=="_"&&hack!=="*"&&hack!=="$"&&hack!=="#"&&hack!=="+"&&hack!=="&"&&(hack="") const custom=isCustomProperty$1(name,hack.length) if(!custom){name=name.toLowerCase() if(properties$1.has(name)){const descriptor=properties$1.get(name) properties$1.set(property,descriptor) return descriptor}}const vendor=custom?"":getVendorPrefix$1(name,hack.length) const prefix=name.substr(0,hack.length+vendor.length) const descriptor=Object.freeze({basename:name.substr(prefix.length),name:name.substr(hack.length),hack:hack,vendor:vendor,prefix:prefix,custom:custom}) properties$1.set(property,descriptor) return descriptor}const cssWideKeywords$1=["initial","inherit","unset","revert","revert-layer"] const PLUSSIGN$i=0x002B const HYPHENMINUS$b=0x002D const N$8=0x006E const DISALLOW_SIGN$3=true const ALLOW_SIGN$3=false function isDelim$3(token,code){return token!==null&&token.type===Delim$1&&token.value.charCodeAt(0)===code}function skipSC$1(token,offset,getNextToken){while(token!==null&&(token.type===WhiteSpace$3||token.type===Comment$3))token=getNextToken(++offset) return offset}function checkInteger$3(token,valueOffset,disallowSign,offset){if(!token)return 0 const code=token.value.charCodeAt(valueOffset) if(code===PLUSSIGN$i||code===HYPHENMINUS$b){if(disallowSign)return 0 valueOffset++}for(;valueOffset6)return 0}return hexlen}function withQuestionMarkSequence$1(consumed,length,getNextToken){if(!consumed)return 0 while(isDelim$2(getNextToken(length),QUESTIONMARK$5)){if(++consumed>6)return 0 length++}return length}function urange$1(token,getNextToken){let length=0 if(token===null||token.type!==Ident$1||!cmpChar$1(token.value,0,U$3))return 0 token=getNextToken(++length) if(token===null)return 0 if(isDelim$2(token,PLUSSIGN$h)){token=getNextToken(++length) if(token===null)return 0 if(token.type===Ident$1)return withQuestionMarkSequence$1(hexSequence$1(token,0,true),++length,getNextToken) if(isDelim$2(token,QUESTIONMARK$5))return withQuestionMarkSequence$1(1,++length,getNextToken) return 0}if(token.type===Number$5){const consumedHexLength=hexSequence$1(token,1,true) if(consumedHexLength===0)return 0 token=getNextToken(++length) if(token===null)return length if(token.type===Dimension$3||token.type===Number$5){if(!startsWith$3(token,HYPHENMINUS$a)||!hexSequence$1(token,1,false))return 0 return length+1}return withQuestionMarkSequence$1(consumedHexLength,length,getNextToken)}if(token.type===Dimension$3)return withQuestionMarkSequence$1(hexSequence$1(token,1,true),++length,getNextToken) return 0}const calcFunctionNames$1=["calc(","-moz-calc(","-webkit-calc("] const balancePair$2=new Map([[Function$3,RightParenthesis$1],[LeftParenthesis$1,RightParenthesis$1],[LeftSquareBracket$1,RightSquareBracket$1],[LeftCurlyBracket$1,RightCurlyBracket$1]]) function charCodeAt$1(str,index){return indexopts.max&&typeof opts.max!=="string")return true}return false}function consumeFunction$1(token,getNextToken){let balanceCloseType=0 let balanceStash=[] let length=0 scan:do{switch(token.type){case RightCurlyBracket$1:case RightParenthesis$1:case RightSquareBracket$1:if(token.type!==balanceCloseType)break scan balanceCloseType=balanceStash.pop() if(balanceStash.length===0){length++ break scan}break case Function$3:case LeftParenthesis$1:case LeftSquareBracket$1:case LeftCurlyBracket$1:balanceStash.push(balanceCloseType) balanceCloseType=balancePair$2.get(token.type) break}length++}while(token=getNextToken(length)) return length}function calc$1(next){return function(token,getNextToken,opts){if(token===null)return 0 if(token.type===Function$3&&eqStrAny$1(token.value,calcFunctionNames$1))return consumeFunction$1(token,getNextToken) return next(token,getNextToken,opts)}}function tokenType$1(expectedTokenType){return function(token){if(token===null||token.type!==expectedTokenType)return 0 return 1}}function customIdent$1(token){if(token===null||token.type!==Ident$1)return 0 const name=token.value.toLowerCase() if(eqStrAny$1(name,cssWideKeywords$1))return 0 if(eqStr$1(name,"default"))return 0 return 1}function dashedIdent(token){if(token===null||token.type!==Ident$1)return 0 if(charCodeAt$1(token.value,0)!==0x002D||charCodeAt$1(token.value,1)!==0x002D)return 0 return 1}function customPropertyName$1(token){if(!dashedIdent(token))return 0 if(token.value==="--")return 0 return 1}function hexColor$1(token){if(token===null||token.type!==Hash$3)return 0 const length=token.value.length if(length!==4&&length!==5&&length!==7&&length!==9)return 0 for(let i=1;i/[a-zA-Z0-9\-]/.test(String.fromCharCode(idx))?1:0)) const COMBINATOR_PRECEDENCE$1={" ":1,"&&":2,"||":3,"|":4} function scanSpaces$1(tokenizer){return tokenizer.substringToPos(tokenizer.findWsEnd(tokenizer.pos))}function scanWord$1(tokenizer){let end=tokenizer.pos for(;end=128||NAME_CHAR$1[code]===0)break}tokenizer.pos===end&&tokenizer.error("Expect a keyword") return tokenizer.substringToPos(end)}function scanNumber$1(tokenizer){let end=tokenizer.pos for(;end57)break}tokenizer.pos===end&&tokenizer.error("Expect a number") return tokenizer.substringToPos(end)}function scanString$1(tokenizer){const end=tokenizer.str.indexOf("'",tokenizer.pos+1) if(end===-1){tokenizer.pos=tokenizer.str.length tokenizer.error("Expect an apostrophe")}return tokenizer.substringToPos(end+1)}function readMultiplierRange$1(tokenizer){let min=null let max=null tokenizer.eat(LEFTCURLYBRACKET$2) tokenizer.skipWs() min=scanNumber$1(tokenizer) tokenizer.skipWs() if(tokenizer.charCode()===COMMA$1){tokenizer.pos++ tokenizer.skipWs() if(tokenizer.charCode()!==RIGHTCURLYBRACKET$1){max=scanNumber$1(tokenizer) tokenizer.skipWs()}}else max=min tokenizer.eat(RIGHTCURLYBRACKET$1) return{min:Number(min),max:max?Number(max):0}}function readMultiplier$1(tokenizer){let range=null let comma=false switch(tokenizer.charCode()){case ASTERISK$d:tokenizer.pos++ range={min:0,max:0} break case PLUSSIGN$g:tokenizer.pos++ range={min:1,max:0} break case QUESTIONMARK$4:tokenizer.pos++ range={min:0,max:1} break case NUMBERSIGN$8:tokenizer.pos++ comma=true if(tokenizer.charCode()===LEFTCURLYBRACKET$2)range=readMultiplierRange$1(tokenizer) else if(tokenizer.charCode()===QUESTIONMARK$4){tokenizer.pos++ range={min:0,max:0}}else range={min:1,max:0} break case LEFTCURLYBRACKET$2:range=readMultiplierRange$1(tokenizer) break default:return null}return{type:"Multiplier",comma:comma,min:range.min,max:range.max,term:null}}function maybeMultiplied$1(tokenizer,node){const multiplier=readMultiplier$1(tokenizer) if(multiplier!==null){multiplier.term=node if(tokenizer.charCode()===NUMBERSIGN$8&&tokenizer.charCodeAt(tokenizer.pos-1)===PLUSSIGN$g)return maybeMultiplied$1(tokenizer,multiplier) return multiplier}return node}function maybeToken$1(tokenizer){const ch=tokenizer.peek() if(ch==="")return null return{type:"Token",value:ch}}function readProperty$3(tokenizer){let name tokenizer.eat(LESSTHANSIGN$2) tokenizer.eat(APOSTROPHE$5) name=scanWord$1(tokenizer) tokenizer.eat(APOSTROPHE$5) tokenizer.eat(GREATERTHANSIGN$6) return maybeMultiplied$1(tokenizer,{type:"Property",name:name})}function readTypeRange$1(tokenizer){let min=null let max=null let sign=1 tokenizer.eat(LEFTSQUAREBRACKET$1) if(tokenizer.charCode()===HYPERMINUS$1){tokenizer.peek() sign=-1}if(sign==-1&&tokenizer.charCode()===INFINITY$1)tokenizer.peek() else{min=sign*Number(scanNumber$1(tokenizer)) NAME_CHAR$1[tokenizer.charCode()]!==0&&(min+=scanWord$1(tokenizer))}scanSpaces$1(tokenizer) tokenizer.eat(COMMA$1) scanSpaces$1(tokenizer) if(tokenizer.charCode()===INFINITY$1)tokenizer.peek() else{sign=1 if(tokenizer.charCode()===HYPERMINUS$1){tokenizer.peek() sign=-1}max=sign*Number(scanNumber$1(tokenizer)) NAME_CHAR$1[tokenizer.charCode()]!==0&&(max+=scanWord$1(tokenizer))}tokenizer.eat(RIGHTSQUAREBRACKET$1) return{type:"Range",min:min,max:max}}function readType$1(tokenizer){let name let opts=null tokenizer.eat(LESSTHANSIGN$2) name=scanWord$1(tokenizer) if(tokenizer.charCode()===LEFTPARENTHESIS$5&&tokenizer.nextCharCode()===RIGHTPARENTHESIS$5){tokenizer.pos+=2 name+="()"}if(tokenizer.charCodeAt(tokenizer.findWsEnd(tokenizer.pos))===LEFTSQUAREBRACKET$1){scanSpaces$1(tokenizer) opts=readTypeRange$1(tokenizer)}tokenizer.eat(GREATERTHANSIGN$6) return maybeMultiplied$1(tokenizer,{type:"Type",name:name,opts:opts})}function readKeywordOrFunction$1(tokenizer){const name=scanWord$1(tokenizer) if(tokenizer.charCode()===LEFTPARENTHESIS$5){tokenizer.pos++ return{type:"Function",name:name}}return maybeMultiplied$1(tokenizer,{type:"Keyword",name:name})}function regroupTerms$1(terms,combinators){function createGroup(terms,combinator){return{type:"Group",terms:terms,combinator:combinator,disallowEmpty:false,explicit:false}}let combinator combinators=Object.keys(combinators).sort(((a,b)=>COMBINATOR_PRECEDENCE$1[a]-COMBINATOR_PRECEDENCE$1[b])) while(combinators.length>0){combinator=combinators.shift() let i=0 let subgroupStart=0 for(;i1){terms.splice(subgroupStart,i-subgroupStart,createGroup(terms.slice(subgroupStart,i),combinator)) i=subgroupStart+1}subgroupStart=-1}}subgroupStart!==-1&&combinators.length&&terms.splice(subgroupStart,i-subgroupStart,createGroup(terms.slice(subgroupStart,i),combinator))}return combinator}function readImplicitGroup$1(tokenizer){const terms=[] const combinators={} let token let prevToken=null let prevTokenPos=tokenizer.pos while(token=peek$1(tokenizer))if(token.type!=="Spaces"){if(token.type==="Combinator"){if(prevToken===null||prevToken.type==="Combinator"){tokenizer.pos=prevTokenPos tokenizer.error("Unexpected combinator")}combinators[token.value]=true}else if(prevToken!==null&&prevToken.type!=="Combinator"){combinators[" "]=true terms.push({type:"Combinator",value:" "})}terms.push(token) prevToken=token prevTokenPos=tokenizer.pos}if(prevToken!==null&&prevToken.type==="Combinator"){tokenizer.pos-=prevTokenPos tokenizer.error("Unexpected combinator")}return{type:"Group",terms:terms,combinator:regroupTerms$1(terms,combinators)||" ",disallowEmpty:false,explicit:false}}function readGroup$1(tokenizer){let result tokenizer.eat(LEFTSQUAREBRACKET$1) result=readImplicitGroup$1(tokenizer) tokenizer.eat(RIGHTSQUAREBRACKET$1) result.explicit=true if(tokenizer.charCode()===EXCLAMATIONMARK$6){tokenizer.pos++ result.disallowEmpty=true}return result}function peek$1(tokenizer){let code=tokenizer.charCode() if(code<128&&NAME_CHAR$1[code]===1)return readKeywordOrFunction$1(tokenizer) switch(code){case RIGHTSQUAREBRACKET$1:break case LEFTSQUAREBRACKET$1:return maybeMultiplied$1(tokenizer,readGroup$1(tokenizer)) case LESSTHANSIGN$2:return tokenizer.nextCharCode()===APOSTROPHE$5?readProperty$3(tokenizer):readType$1(tokenizer) case VERTICALLINE$7:return{type:"Combinator",value:tokenizer.substringToPos(tokenizer.pos+(tokenizer.nextCharCode()===VERTICALLINE$7?2:1))} case AMPERSAND$7:tokenizer.pos++ tokenizer.eat(AMPERSAND$7) return{type:"Combinator",value:"&&"} case COMMA$1:tokenizer.pos++ return{type:"Comma"} case APOSTROPHE$5:return maybeMultiplied$1(tokenizer,{type:"String",value:scanString$1(tokenizer)}) case SPACE$6:case TAB$2:case N$6:case R$3:case F$3:return{type:"Spaces",value:scanSpaces$1(tokenizer)} case COMMERCIALAT$1:code=tokenizer.nextCharCode() if(code<128&&NAME_CHAR$1[code]===1){tokenizer.pos++ return{type:"AtKeyword",name:scanWord$1(tokenizer)}}return maybeToken$1(tokenizer) case ASTERISK$d:case PLUSSIGN$g:case QUESTIONMARK$4:case NUMBERSIGN$8:case EXCLAMATIONMARK$6:break case LEFTCURLYBRACKET$2:code=tokenizer.nextCharCode() if(code<48||code>57)return maybeToken$1(tokenizer) break default:return maybeToken$1(tokenizer)}}function parse$1u(source){const tokenizer=new Tokenizer$1(source) const result=readImplicitGroup$1(tokenizer) tokenizer.pos!==source.length&&tokenizer.error("Unexpected input") if(result.terms.length===1&&result.terms[0].type==="Group")return result.terms[0] return result}const noop$3=function(){} function ensureFunction$2(value){return typeof value==="function"?value:noop$3}function walk$4(node,options,context){function walk(node){enter.call(context,node) switch(node.type){case"Group":node.terms.forEach(walk) break case"Multiplier":walk(node.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: "+node.type)}leave.call(context,node)}let enter=noop$3 let leave=noop$3 if(typeof options==="function")enter=options else if(options){enter=ensureFunction$2(options.enter) leave=ensureFunction$2(options.leave)}if(enter===noop$3&&leave===noop$3)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function") walk(node)}const astToTokens$1={decorator(handlers){const tokens=[] let curNode=null return{...handlers,node(node){const tmp=curNode curNode=node handlers.node.call(this,node) curNode=tmp},emit(value,type,auto){tokens.push({type:type,value:value,node:auto?null:curNode})},result:()=>tokens}}} function stringToTokens$1(str){const tokens=[] tokenize$4(str,((type,start,end)=>tokens.push({type:type,value:str.slice(start,end),node:null}))) return tokens}function prepareTokens$1(value,syntax){if(typeof value==="string")return stringToTokens$1(value) return syntax.generate(value,astToTokens$1)}const MATCH$1={type:"Match"} const MISMATCH$1={type:"Mismatch"} const DISALLOW_EMPTY$1={type:"DisallowEmpty"} const LEFTPARENTHESIS$4=40 const RIGHTPARENTHESIS$4=41 function createCondition$1(match,thenBranch,elseBranch){if(thenBranch===MATCH$1&&elseBranch===MISMATCH$1)return match if(match===MATCH$1&&thenBranch===MATCH$1&&elseBranch===MATCH$1)return match if(match.type==="If"&&match.else===MISMATCH$1&&thenBranch===MATCH$1){thenBranch=match.then match=match.match}return{type:"If",match:match,then:thenBranch,else:elseBranch}}function isFunctionType$1(name){return name.length>2&&name.charCodeAt(name.length-2)===LEFTPARENTHESIS$4&&name.charCodeAt(name.length-1)===RIGHTPARENTHESIS$4}function isEnumCapatible$1(term){return term.type==="Keyword"||term.type==="AtKeyword"||term.type==="Function"||term.type==="Type"&&isFunctionType$1(term.name)}function buildGroupMatchGraph$1(combinator,terms,atLeastOneTermMatched){switch(combinator){case" ":{let result=MATCH$1 for(let i=terms.length-1;i>=0;i--){const term=terms[i] result=createCondition$1(term,result,MISMATCH$1)}return result}case"|":{let result=MISMATCH$1 let map=null for(let i=terms.length-1;i>=0;i--){let term=terms[i] if(isEnumCapatible$1(term)){if(map===null&&i>0&&isEnumCapatible$1(terms[i-1])){map=Object.create(null) result=createCondition$1({type:"Enum",map:map},MATCH$1,result)}if(map!==null){const key=(isFunctionType$1(term.name)?term.name.slice(0,-1):term.name).toLowerCase() if(key in map===false){map[key]=term continue}}}map=null result=createCondition$1(term,MATCH$1,result)}return result}case"&&":{if(terms.length>5)return{type:"MatchOnce",terms:terms,all:true} let result=MISMATCH$1 for(let i=terms.length-1;i>=0;i--){const term=terms[i] let thenClause thenClause=terms.length>1?buildGroupMatchGraph$1(combinator,terms.filter((function(newGroupTerm){return newGroupTerm!==term})),false):MATCH$1 result=createCondition$1(term,thenClause,result)}return result}case"||":{if(terms.length>5)return{type:"MatchOnce",terms:terms,all:false} let result=atLeastOneTermMatched?MATCH$1:MISMATCH$1 for(let i=terms.length-1;i>=0;i--){const term=terms[i] let thenClause thenClause=terms.length>1?buildGroupMatchGraph$1(combinator,terms.filter((function(newGroupTerm){return newGroupTerm!==term})),true):MATCH$1 result=createCondition$1(term,thenClause,result)}return result}}}function buildMultiplierMatchGraph$1(node){let result=MATCH$1 let matchTerm=buildMatchGraphInternal$1(node.term) if(node.max===0){matchTerm=createCondition$1(matchTerm,DISALLOW_EMPTY$1,MISMATCH$1) result=createCondition$1(matchTerm,null,MISMATCH$1) result.then=createCondition$1(MATCH$1,MATCH$1,result) node.comma&&(result.then.else=createCondition$1({type:"Comma",syntax:node},result,MISMATCH$1))}else for(let i=node.min||1;i<=node.max;i++){node.comma&&result!==MATCH$1&&(result=createCondition$1({type:"Comma",syntax:node},result,MISMATCH$1)) result=createCondition$1(matchTerm,createCondition$1(MATCH$1,MATCH$1,result),MISMATCH$1)}if(node.min===0)result=createCondition$1(MATCH$1,MATCH$1,result) else for(let i=0;i=0x0041&&testCode<=0x005A&&(testCode|=32) if(testCode!==referenceCode)return false}return true}function isContextEdgeDelim$1(token){if(token.type!==Delim$1)return false return token.value!=="?"}function isCommaContextStart$1(token){if(token===null)return true return token.type===Comma$1||token.type===Function$3||token.type===LeftParenthesis$1||token.type===LeftSquareBracket$1||token.type===LeftCurlyBracket$1||isContextEdgeDelim$1(token)}function isCommaContextEnd$1(token){if(token===null)return true return token.type===RightParenthesis$1||token.type===RightSquareBracket$1||token.type===RightCurlyBracket$1||token.type===Delim$1&&token.value==="/"}function internalMatch$1(tokens,state,syntaxes){function moveToNextToken(){do{tokenIndex++ token=tokenIndexlongestMatch&&(longestMatch=tokenIndex)}function openSyntax(){syntaxStack={syntax:state.syntax,opts:state.syntax.opts||syntaxStack!==null&&syntaxStack.opts||null,prev:syntaxStack} matchStack={type:OPEN_SYNTAX$1,syntax:state.syntax,token:matchStack.token,prev:matchStack}}function closeSyntax(){matchStack=matchStack.type===OPEN_SYNTAX$1?matchStack.prev:{type:CLOSE_SYNTAX$1,syntax:syntaxStack.syntax,token:matchStack.token,prev:matchStack} syntaxStack=syntaxStack.prev}let syntaxStack=null let thenStack=null let elseStack=null let syntaxStash=null let iterationCount=0 let exitReason=null let token=null let tokenIndex=-1 let longestMatch=0 let matchStack={type:STUB$1,syntax:null,token:null,prev:null} moveToNextToken() while(exitReason===null&&++iterationCountelseStack.tokenIndex){elseStack=syntaxStash syntaxStash=false}}else if(elseStack===null){exitReason=EXIT_REASON_MISMATCH$1 break}state=elseStack.nextState thenStack=elseStack.thenStack syntaxStack=elseStack.syntaxStack matchStack=elseStack.matchStack tokenIndex=elseStack.tokenIndex token=tokenIndextokenIndex){while(tokenIndex":"<'"+state.name+"'>")) if(syntaxStash!==false&&token!==null&&state.type==="Type"){const lowPriorityMatching=state.name==="custom-ident"&&token.type===Ident$1||state.name==="length"&&token.value==="0" if(lowPriorityMatching){syntaxStash===null&&(syntaxStash=stateSnapshotFromSyntax(state,elseStack)) state=MISMATCH$1 break}}openSyntax() state=dictSyntax.matchRef||dictSyntax.match break}case"Keyword":{const name=state.name if(token!==null){let keywordName=token.value keywordName.indexOf("\\")!==-1&&(keywordName=keywordName.replace(/\\[09].*$/,"")) if(areStringsEqualCaseInsensitive$1(keywordName,name)){addTokenToMatch() state=MATCH$1 break}}state=MISMATCH$1 break}case"AtKeyword":case"Function":if(token!==null&&areStringsEqualCaseInsensitive$1(token.value,state.name)){addTokenToMatch() state=MATCH$1 break}state=MISMATCH$1 break case"Token":if(token!==null&&token.value===state.value){addTokenToMatch() state=MATCH$1 break}state=MISMATCH$1 break case"Comma":if(token!==null&&token.type===Comma$1)if(isCommaContextStart$1(matchStack.token))state=MISMATCH$1 else{addTokenToMatch() state=isCommaContextEnd$1(token)?MISMATCH$1:MATCH$1}else state=isCommaContextStart$1(matchStack.token)||isCommaContextEnd$1(token)?MATCH$1:MISMATCH$1 break case"String":let string="" let lastTokenIndex=tokenIndex for(;lastTokenIndexmatch.type==="Type"&&match.name===type))}function isProperty$1(node,property){return testNode$1(this,node,(match=>match.type==="Property"&&match.name===property))}function isKeyword$1(node){return testNode$1(this,node,(match=>match.type==="Keyword"))}function testNode$1(match,node,fn){const trace=getTrace$1.call(match,node) if(trace===null)return false return trace.some(fn)}var trace$1=Object.freeze({__proto__:null,getTrace:getTrace$1,isKeyword:isKeyword$1,isProperty:isProperty$1,isType:isType$1}) function getFirstMatchNode$1(matchNode){if("node"in matchNode)return matchNode.node return getFirstMatchNode$1(matchNode.match[0])}function getLastMatchNode$1(matchNode){if("node"in matchNode)return matchNode.node return getLastMatchNode$1(matchNode.match[matchNode.match.length-1])}function matchFragments$1(lexer,ast,match,type,name){function findFragments(matchNode){if(matchNode.syntax!==null&&matchNode.syntax.type===type&&matchNode.syntax.name===name){const start=getFirstMatchNode$1(matchNode) const end=getLastMatchNode$1(matchNode) lexer.syntax.walk(ast,(function(node,item,list){if(node===start){const nodes=new List$1 do{nodes.appendData(item.data) if(item.data===end)break item=item.next}while(item!==null) fragments.push({parent:list,nodes:nodes})}}))}Array.isArray(matchNode.match)&&matchNode.match.forEach(findFragments)}const fragments=[] match.matched!==null&&findFragments(match.matched) return fragments}const{hasOwnProperty:hasOwnProperty$9}=Object.prototype function isValidNumber$1(value){return typeof value==="number"&&isFinite(value)&&Math.floor(value)===value&&value>=0}function isValidLocation$1(loc){return Boolean(loc)&&isValidNumber$1(loc.offset)&&isValidNumber$1(loc.line)&&isValidNumber$1(loc.column)}function createNodeStructureChecker$1(type,fields){return function checkNode(node,warn){if(!node||node.constructor!==Object)return warn(node,"Type of node should be an Object") for(let key in node){let valid=true if(hasOwnProperty$9.call(node,key)===false)continue if(key==="type")node.type!==type&&warn(node,"Wrong node type `"+node.type+"`, expected `"+type+"`") else if(key==="loc"){if(node.loc===null)continue if(node.loc&&node.loc.constructor===Object)if(typeof node.loc.source!=="string")key+=".source" else if(isValidLocation$1(node.loc.start)){if(isValidLocation$1(node.loc.end))continue key+=".end"}else key+=".start" valid=false}else if(fields.hasOwnProperty(key)){valid=false for(let i=0;!valid&&i")}}return docsTypes.join(" | ")}function processStructure$1(name,nodeType){const structure=nodeType.structure const fields={type:String,loc:true} const docs={type:'"'+name+'"'} for(const key in structure){if(hasOwnProperty$9.call(structure,key)===false)continue const fieldTypes=fields[key]=Array.isArray(structure[key])?structure[key].slice():[structure[key]] docs[key]=genTypesList(fieldTypes,name+"."+key)}return{docs:docs,check:createNodeStructureChecker$1(name,fields)}}function getStructureFromConfig$1(config){const structure={} if(config.node)for(const name in config.node)if(hasOwnProperty$9.call(config.node,name)){const nodeType=config.node[name] if(!nodeType.structure)throw new Error("Missed `structure` field in `"+name+"` node type definition") structure[name]=processStructure$1(name,nodeType)}return structure}function dumpMapSyntax$1(map,compact,syntaxAsAst){const result={} for(const name in map)map[name].syntax&&(result[name]=syntaxAsAst?map[name].syntax:generate$1u(map[name].syntax,{compact:compact})) return result}function dumpAtruleMapSyntax$1(map,compact,syntaxAsAst){const result={} for(const[name,atrule]of Object.entries(map))result[name]={prelude:atrule.prelude&&(syntaxAsAst?atrule.prelude.syntax:generate$1u(atrule.prelude.syntax,{compact:compact})),descriptors:atrule.descriptors&&dumpMapSyntax$1(atrule.descriptors,compact,syntaxAsAst)} return result}function valueHasVar$1(tokens){for(let i=0;i{map[descName]=this.createDescriptor(syntax.descriptors[descName],"AtruleDescriptor",descName,name) return map}),Object.create(null)):null}}addProperty_(name,syntax){if(!syntax)return this.properties[name]=this.createDescriptor(syntax,"Property",name)}addType_(name,syntax){if(!syntax)return this.types[name]=this.createDescriptor(syntax,"Type",name)}checkAtruleName(atruleName){if(!this.getAtrule(atruleName))return new SyntaxReferenceError$1("Unknown at-rule","@"+atruleName)}checkAtrulePrelude(atruleName,prelude){const error=this.checkAtruleName(atruleName) if(error)return error const atrule=this.getAtrule(atruleName) if(!atrule.prelude&&prelude)return new SyntaxError("At-rule `@"+atruleName+"` should not contain a prelude") if(atrule.prelude&&!prelude&&!matchSyntax$1(this,atrule.prelude,"",false).matched)return new SyntaxError("At-rule `@"+atruleName+"` should contain a prelude")}checkAtruleDescriptorName(atruleName,descriptorName){const error=this.checkAtruleName(atruleName) if(error)return error const atrule=this.getAtrule(atruleName) const descriptor=keyword$1(descriptorName) if(!atrule.descriptors)return new SyntaxError("At-rule `@"+atruleName+"` has no known descriptors") if(!atrule.descriptors[descriptor.name]&&!atrule.descriptors[descriptor.basename])return new SyntaxReferenceError$1("Unknown at-rule descriptor",descriptorName)}checkPropertyName(propertyName){if(!this.getProperty(propertyName))return new SyntaxReferenceError$1("Unknown property",propertyName)}matchAtrulePrelude(atruleName,prelude){const error=this.checkAtrulePrelude(atruleName,prelude) if(error)return buildMatchResult$1(null,error) const atrule=this.getAtrule(atruleName) if(!atrule.prelude)return buildMatchResult$1(null,null) return matchSyntax$1(this,atrule.prelude,prelude||"",false)}matchAtruleDescriptor(atruleName,descriptorName,value){const error=this.checkAtruleDescriptorName(atruleName,descriptorName) if(error)return buildMatchResult$1(null,error) const atrule=this.getAtrule(atruleName) const descriptor=keyword$1(descriptorName) return matchSyntax$1(this,atrule.descriptors[descriptor.name]||atrule.descriptors[descriptor.basename],value,false)}matchDeclaration(node){if(node.type!=="Declaration")return buildMatchResult$1(null,new Error("Not a Declaration node")) return this.matchProperty(node.property,node.value)}matchProperty(propertyName,value){if(property$1(propertyName).custom)return buildMatchResult$1(null,new Error("Lexer matching doesn't applicable for custom properties")) const error=this.checkPropertyName(propertyName) if(error)return buildMatchResult$1(null,error) return matchSyntax$1(this,this.getProperty(propertyName),value,true)}matchType(typeName,value){const typeSyntax=this.getType(typeName) if(!typeSyntax)return buildMatchResult$1(null,new SyntaxReferenceError$1("Unknown type",typeName)) return matchSyntax$1(this,typeSyntax,value,false)}match(syntax,value){if(typeof syntax!=="string"&&(!syntax||!syntax.type))return buildMatchResult$1(null,new SyntaxReferenceError$1("Bad syntax")) typeof syntax!=="string"&&syntax.match||(syntax=this.createDescriptor(syntax,"Type","anonymous")) return matchSyntax$1(this,syntax,value,false)}findValueFragments(propertyName,value,type,name){return matchFragments$1(this,value,this.matchProperty(propertyName,value),type,name)}findDeclarationValueFragments(declaration,type,name){return matchFragments$1(this,declaration.value,this.matchDeclaration(declaration),type,name)}findAllFragments(ast,type,name){const result=[] this.syntax.walk(ast,{visit:"Declaration",enter:declaration=>{result.push.apply(result,this.findDeclarationValueFragments(declaration,type,name))}}) return result}getAtrule(atruleName,fallbackBasename=true){const atrule=keyword$1(atruleName) const atruleEntry=atrule.vendor&&fallbackBasename?this.atrules[atrule.name]||this.atrules[atrule.basename]:this.atrules[atrule.name] return atruleEntry||null}getAtrulePrelude(atruleName,fallbackBasename=true){const atrule=this.getAtrule(atruleName,fallbackBasename) return atrule&&atrule.prelude||null}getAtruleDescriptor(atruleName,name){return this.atrules.hasOwnProperty(atruleName)&&this.atrules.declarators&&this.atrules[atruleName].declarators[name]||null}getProperty(propertyName,fallbackBasename=true){const property=property$1(propertyName) const propertyEntry=property.vendor&&fallbackBasename?this.properties[property.name]||this.properties[property.basename]:this.properties[property.name] return propertyEntry||null}getType(name){return hasOwnProperty.call(this.types,name)?this.types[name]:null}validate(){function syntaxRef(name,isType){return isType?`<${name}>`:`<'${name}'>`}function validate(syntax,name,broken,descriptor){if(broken.has(name))return broken.get(name) broken.set(name,false) descriptor.syntax!==null&&walk$4(descriptor.syntax,(function(node){if(node.type!=="Type"&&node.type!=="Property")return const map=node.type==="Type"?syntax.types:syntax.properties const brokenMap=node.type==="Type"?brokenTypes:brokenProperties if(hasOwnProperty.call(map,node.name)){if(validate(syntax,node.name,brokenMap,map[node.name])){errors.push(`${syntaxRef(name,broken===brokenTypes)} used broken syntax definition ${syntaxRef(node.name,node.type==="Type")}`) broken.set(name,true)}}else{errors.push(`${syntaxRef(name,broken===brokenTypes)} used missed syntax definition ${syntaxRef(node.name,node.type==="Type")}`) broken.set(name,true)}}),this)}const errors=[] let brokenTypes=new Map let brokenProperties=new Map for(const key in this.types)validate(this,key,brokenTypes,this.types[key]) for(const key in this.properties)validate(this,key,brokenProperties,this.properties[key]) const brokenTypesArray=[...brokenTypes.keys()].filter((name=>brokenTypes.get(name))) const brokenPropertiesArray=[...brokenProperties.keys()].filter((name=>brokenProperties.get(name))) if(brokenTypesArray.length||brokenPropertiesArray.length)return{errors:errors,types:brokenTypesArray,properties:brokenPropertiesArray} return null}dump(syntaxAsAst,pretty){return{generic:this.generic,cssWideKeywords:this.cssWideKeywords,units:this.units,types:dumpMapSyntax$1(this.types,!pretty,syntaxAsAst),properties:dumpMapSyntax$1(this.properties,!pretty,syntaxAsAst),atrules:dumpAtruleMapSyntax$1(this.atrules,!pretty,syntaxAsAst)}}toString(){return JSON.stringify(this.dump())}} function appendOrSet(a,b){if(typeof b==="string"&&/^\s*\|/.test(b))return typeof a==="string"?a+b:b.replace(/^\s*\|\s*/,"") return b||null}function sliceProps(obj,props){const result=Object.create(null) for(const[key,value]of Object.entries(obj))if(value){result[key]={} for(const prop of Object.keys(value))props.includes(prop)&&(result[key][prop]=value[prop])}return result}function mix$2(dest,src){const result={...dest} for(const[prop,value]of Object.entries(src))switch(prop){case"generic":result[prop]=Boolean(value) break case"cssWideKeywords":result[prop]=dest[prop]?[...dest[prop],...value]:value||[] break case"units":result[prop]={...dest[prop]} for(const[name,patch]of Object.entries(value))result[prop][name]=Array.isArray(patch)?patch:[] break case"atrules":result[prop]={...dest[prop]} for(const[name,atrule]of Object.entries(value)){const exists=result[prop][name]||{} const current=result[prop][name]={prelude:exists.prelude||null,descriptors:{...exists.descriptors}} if(!atrule)continue current.prelude=atrule.prelude?appendOrSet(current.prelude,atrule.prelude):current.prelude||null for(const[descriptorName,descriptorValue]of Object.entries(atrule.descriptors||{}))current.descriptors[descriptorName]=descriptorValue?appendOrSet(current.descriptors[descriptorName],descriptorValue):null Object.keys(current.descriptors).length||(current.descriptors=null)}break case"types":case"properties":result[prop]={...dest[prop]} for(const[name,syntax]of Object.entries(value))result[prop][name]=appendOrSet(result[prop][name],syntax) break case"scope":case"features":result[prop]={...dest[prop]} for(const[name,props]of Object.entries(value))result[prop][name]={...result[prop][name],...props} break case"parseContext":result[prop]={...dest[prop],...value} break case"atrule":case"pseudo":result[prop]={...dest[prop],...sliceProps(value,["parse"])} break case"node":result[prop]={...dest[prop],...sliceProps(value,["name","structure","parse","generate","walkContext"])} break}return result}function createSyntax$2(config){const parse=createParser$1(config) const walk=createWalker$1(config) const generate=createGenerator$1(config) const{fromPlainObject:fromPlainObject,toPlainObject:toPlainObject}=createConvertor$1(walk) const syntax={lexer:null,createLexer:config=>new Lexer$1(config,syntax,syntax.lexer.structure),tokenize:tokenize$4,parse:parse,generate:generate,walk:walk,find:walk.find,findLast:walk.findLast,findAll:walk.findAll,fromPlainObject:fromPlainObject,toPlainObject:toPlainObject,fork(extension){const base=mix$2({},config) return createSyntax$2(typeof extension==="function"?extension(base):mix$2(base,extension))}} syntax.lexer=new Lexer$1({generic:config.generic,cssWideKeywords:config.cssWideKeywords,units:config.units,types:config.types,atrules:config.atrules,properties:config.properties,node:config.node},syntax) return syntax}var createSyntax$3=config=>createSyntax$2(mix$2({},config)) var definitions$1={generic:true,cssWideKeywords:["initial","inherit","unset","revert","revert-layer"],units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( )","alpha-value":"|","angle-percentage":"|","angular-color-hint":"","angular-color-stop":"&&?","angular-color-stop-list":"[ [, ]?]# , ","animateable-feature":"scroll-position|contents|","asin()":"asin( )","atan()":"atan( )","atan2()":"atan2( , )",attachment:"scroll|fixed|local","attr()":"attr( ? [, ]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' ']'|'[' [|] ? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [? ]+ ? )","auto-track-list":"[? [|]]* ? [? [|]]* ?",axis:"block|inline|vertical|horizontal","baseline-position":"[first|last]? baseline","basic-shape":"||||||","bg-image":"none|","bg-layer":"|| [/ ]?||||||||","bg-position":"[[left|center|right|top|bottom|]|[left|center|right|] [top|center|bottom|]|[center|[left|right] ?]&&[center|[top|bottom] ?]]","bg-size":"[|auto]{1,2}|cover|contain","blur()":"blur( )","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( )","calc()":"calc( )","calc-sum":" [['+'|'-'] ]*","calc-product":" ['*' |'/' ]*","calc-value":"||||( )","calc-constant":"e|pi|infinity|-infinity|NaN","cf-final-image":"|","cf-mixing-image":"?&&","circle()":"circle( []? [at ]? )","clamp()":"clamp( #{3} )","class-selector":"'.' ","clip-source":"",color:"|currentColor||||<-non-standard-color>","color-stop":"|","color-stop-angle":"{1,2}","color-stop-length":"{1,2}","color-stop-list":"[ [, ]?]# , ","color-interpolation-method":"in [| ?|]",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":"[? *]!","compound-selector-list":"#","complex-selector":" [? ]*","complex-selector-list":"#","conic-gradient()":"conic-gradient( [from ]? [at ]? , )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[|contents||||||]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"","contrast()":"contrast( [] )","cos()":"cos( )",counter:"|","counter()":"counter( , ? )","counter-name":"","counter-style":"|symbols( )","counter-style-name":"","counters()":"counters( , , ? )","cross-fade()":"cross-fade( , ? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( , , , )","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":"?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( {2,3} ? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( , [first|start|last|first-except]? )|element( )","ellipse()":"ellipse( [{2}]? [at ]? )","ending-shape":"circle|ellipse","env()":"env( , ? )","exp()":"exp( )","explicit-track-list":"[? ]+ ?","family-name":"|+","feature-tag-value":" [|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":" '{' '}'","feature-value-block-list":"+","feature-value-declaration":" : + ;","feature-value-declaration-list":"","feature-value-name":"","fill-rule":"nonzero|evenodd","filter-function":"|||||||||","filter-function-list":"[|]+","final-bg-layer":"<'background-color'>|||| [/ ]?||||||||","fixed-breadth":"","fixed-repeat":"repeat( [] , [? ]+ ? )","fixed-size":"|minmax( , )|minmax( , )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|","frequency-percentage":"|","general-enclosed":"[ ? )]|[( ? )]","generic-family":"|||<-non-standard-generic-family>","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"|fill-box|stroke-box|view-box",gradient:"||||||<-legacy-gradient>","grayscale()":"grayscale( )","grid-line":"auto||[&&?]|[span&&[||]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( [/ ]? )|hsl( , , , ? )","hsla()":"hsla( [/ ]? )|hsla( , , , ? )",hue:"|","hue-rotate()":"hue-rotate( )","hue-interpolation-method":"[shorter|longer|increasing|decreasing] hue","hwb()":"hwb( [|none] [|none] [|none] [/ [|none]]? )","hypot()":"hypot( # )",image:"||||||","image()":"image( ? [? , ?]! )","image-set()":"image-set( # )","image-set-option":"[|] [||type( )]","image-src":"|","image-tags":"ltr|rtl","inflexible-breadth":"|min-content|max-content|auto","inset()":"inset( {1,4} [round <'border-radius'>]? )","invert()":"invert( )","keyframes-name":"|","keyframe-block":"# { }","keyframe-block-list":"+","keyframe-selector":"from|to|| ","lab()":"lab( [||none] [||none] [||none] [/ [|none]]? )","layer()":"layer( )","layer-name":" ['.' ]*","lch()":"lch( [||none] [||none] [|none] [/ [|none]]? )","leader()":"leader( )","leader-type":"dotted|solid|space|","length-percentage":"|","light-dark()":"light-dark( , )","line-names":"'[' * ']'","line-name-list":"[|]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"|thin|medium|thick","linear-color-hint":"","linear-color-stop":" ?","linear-gradient()":"linear-gradient( [[|to ]||]? , )","log()":"log( , ? )","mask-layer":"|| [/ ]?||||||[|no-clip]||||","mask-position":"[|left|center|right] [|top|center|bottom]?","mask-reference":"none||","mask-source":"","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( #{6} )","matrix3d()":"matrix3d( #{16} )","max()":"max( # )","media-and":" [and ]+","media-condition":"|||","media-condition-without-or":"||","media-feature":"( [||] )","media-in-parens":"( )||","media-not":"not ","media-or":" [or ]+","media-query":"|[not|only]? [and ]?","media-query-list":"#","media-type":"","mf-boolean":"","mf-name":"","mf-plain":" : ","mf-range":" ['<'|'>']? '='? | ['<'|'>']? '='? | '<' '='? '<' '='? | '>' '='? '>' '='? ","mf-value":"|||","min()":"min( # )","minmax()":"minmax( [|min-content|max-content|auto] , [||min-content|max-content|auto] )","mod()":"mod( , )","name-repeat":"repeat( [|auto-fill] , + )","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","namespace-prefix":"","ns-prefix":"[|'*']? '|'","number-percentage":"|","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"|even|odd","opacity()":"opacity( [] )","overflow-position":"unsafe|safe","outline-radius":"|","page-body":"? [; ]?| ","page-margin-box":" '{' '}'","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-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [ ,]? )","paint()":"paint( , ? )","perspective()":"perspective( [|none] )","polygon()":"polygon( ? , [ ]# )","polar-color-space":"hsl|hwb|lch|oklch",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|] [top|center|bottom|]?|[[left|right] ]&&[[top|bottom] ]]","pow()":"pow( , )","pseudo-class-selector":"':' |':' ')'","pseudo-element-selector":"':' |","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [||]? [at ]? , )",ratio:" [/ ]?","ray()":"ray( &&?&&contain?&&[at ]? )","ray-size":"closest-side|closest-corner|farthest-side|farthest-corner|sides","rectangular-color-space":"srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65","relative-selector":"? ","relative-selector-list":"#","relative-size":"larger|smaller","rem()":"rem( , )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from ]? [at ]? , )","repeating-linear-gradient()":"repeating-linear-gradient( [|to ]? , )","repeating-radial-gradient()":"repeating-radial-gradient( [||]? [at ]? , )","reversed-counter-name":"reversed( )","rgb()":"rgb( {3} [/ ]? )|rgb( {3} [/ ]? )|rgb( #{3} , ? )|rgb( #{3} , ? )","rgba()":"rgba( {3} [/ ]? )|rgba( {3} [/ ]? )|rgba( #{3} , ? )|rgba( #{3} , ? )","rotate()":"rotate( [|] )","rotate3d()":"rotate3d( , , , [|] )","rotateX()":"rotateX( [|] )","rotateY()":"rotateY( [|] )","rotateZ()":"rotateZ( [|] )","round()":"round( ? , , )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( )","scale()":"scale( [|]#{1,2} )","scale3d()":"scale3d( [|]#{3} )","scaleX()":"scaleX( [|] )","scaleY()":"scaleY( [|] )","scaleZ()":"scaleZ( [|] )","scroll()":"scroll( [||]? )",scroller:"root|nearest","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"|closest-side|farthest-side","sign()":"sign( )","skew()":"skew( [|] , [|]? )","skewX()":"skewX( [|] )","skewY()":"skewY( [|] )","sepia()":"sepia( )",shadow:"inset?&&{2,4}&&?","shadow-t":"[{2,3}&&?]",shape:"rect( , , , )|rect( )","shape-box":"|margin-box","side-or-corner":"[left|right]||[top|bottom]","sin()":"sin( )","single-animation":"<'animation-duration'>||||<'animation-delay'>||||||||||[none|]||","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|||","single-transition":"[none|]||