vendor: 20,599 bytes, lines 1-255
1const visitSkip=Symbol() 2const visit=(node,visitor,parentNode)=>{const callbacks=visitor[node.type] 3if(callbacks?.enter){const symbol=callbacks.enter(node,parentNode) 4if(symbol===visitSkip)return}if(node.type==="root")for(const child of node.children)visit(child,visitor,node) 5if(node.type==="element"&&parentNode.children.includes(node))for(const child of node.children)visit(child,visitor,node) 6callbacks?.exit&&callbacks.exit(node,parentNode)} 7const invokePlugins=(ast,info,plugins,overrides,globalOverrides)=>{for(const plugin of plugins){const override=overrides?.[plugin.name] 8if(override===false)continue 9const params={...plugin.params,...globalOverrides,...override} 10const visitor=plugin.fn(ast,params,info) 11visitor!=null&&visit(ast,visitor)}} 12const createPreset=({name:name,plugins:plugins})=>({name:name,isPreset:true,plugins:Object.freeze(plugins),fn:(ast,params,info)=>{const{floatPrecision:floatPrecision,overrides:overrides}=params 13const globalOverrides={} 14floatPrecision!=null&&(globalOverrides.floatPrecision=floatPrecision) 15if(overrides){const pluginNames=plugins.map((({name:name})=>name)) 16for(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)}}) 17var ElementType;(function(ElementType){ElementType["Root"]="root" 18ElementType["Text"]="text" 19ElementType["Directive"]="directive" 20ElementType["Comment"]="comment" 21ElementType["Script"]="script" 22ElementType["Style"]="style" 23ElementType["Tag"]="tag" 24ElementType["CDATA"]="cdata" 25ElementType["Doctype"]="doctype"})(ElementType||(ElementType={})) 26function isTag$2(elem){return elem.type===ElementType.Tag||elem.type===ElementType.Script||elem.type===ElementType.Style}const Root=ElementType.Root 27const Text=ElementType.Text 28const Directive=ElementType.Directive 29const Comment$4=ElementType.Comment 30const Script=ElementType.Script 31const Style=ElementType.Style 32const Tag=ElementType.Tag 33const CDATA=ElementType.CDATA 34const Doctype=ElementType.Doctype 35function 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 36const xmlCodeMap=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]) 37const 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) 38function encodeXML(str){let ret="" 39let lastIdx=0 40let match 41while((match=xmlReplacer.exec(str))!==null){const i=match.index 42const char=str.charCodeAt(i) 43const next=xmlCodeMap.get(char) 44if(next!==void 0){ret+=str.substring(lastIdx,i)+next 45lastIdx=i+1}else{ret+=`${str.substring(lastIdx,i)}&#x${getCodePoint(str,i).toString(16)};` 46lastIdx=xmlReplacer.lastIndex+=Number((char&0xfc00)===0xd800)}}return ret+str.substr(lastIdx)}function getEscaper(regex,map){return function escape(data){let match 47let lastIdx=0 48let result="" 49while(match=regex.exec(data)){lastIdx!==match.index&&(result+=data.substring(lastIdx,match.index)) 50result+=map.get(match[0].charCodeAt(0)) 51lastIdx=match.index+1}return result+data.substring(lastIdx)}}const escapeAttribute=getEscaper(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])) 52const escapeText=getEscaper(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]])) 53const 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]))) 54const 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]))) 55const unencodedElements=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]) 56function replaceQuotes(value){return value.replace(/"/g,""")}function formatAttributes(attributes,opts){var _a 57if(!attributes)return 58const encode=((_a=opts.encodeEntities)!==null&&_a!==void 0?_a:opts.decodeEntities)===false?replaceQuotes:opts.xmlMode||opts.encodeEntities!=="utf8"?encodeXML:escapeAttribute 59return Object.keys(attributes).map((key=>{var _a,_b 60const value=(_a=attributes[key])!==null&&_a!==void 0?_a:"" 61opts.xmlMode==="foreign"&&(key=(_b=attributeNames.get(key))!==null&&_b!==void 0?_b:key) 62if(!opts.emptyAttrs&&!opts.xmlMode&&value==="")return key 63return`${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"]) 64function render(node,options={}){const nodes="length"in node?node:[node] 65let output="" 66for(let i=0;i<nodes.length;i++)output+=renderNode(nodes[i],options) 67return output}function renderNode(node,options){switch(node.type){case Root:return render(node.children,options) 68case Doctype:case Directive:return renderDirective(node) 69case Comment$4:return renderComment(node) 70case CDATA:return renderCdata(node) 71case Script:case Style:case Tag:return renderTag(node,options) 72case Text:return renderText(node,options)}}const foreignModeIntegrationPoints=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]) 73const foreignElements=new Set(["svg","math"]) 74function renderTag(elem,opts){var _a 75if(opts.xmlMode==="foreign"){elem.name=(_a=elementNames.get(elem.name))!==null&&_a!==void 0?_a:elem.name 76elem.parent&&foreignModeIntegrationPoints.has(elem.parent.name)&&(opts={...opts,xmlMode:false})}!opts.xmlMode&&foreignElements.has(elem.name)&&(opts={...opts,xmlMode:"foreign"}) 77let tag=`<${elem.name}` 78const attribs=formatAttributes(elem.attribs,opts) 79attribs&&(tag+=` ${attribs}`) 80if(elem.children.length===0&&(opts.xmlMode?opts.selfClosingTags!==false:opts.selfClosingTags&&singleTag.has(elem.name))){opts.xmlMode||(tag+=" ") 81tag+="/>"}else{tag+=">" 82elem.children.length>0&&(tag+=render(elem.children,opts)) 83!opts.xmlMode&&singleTag.has(elem.name)||(tag+=`</${elem.name}>`)}return tag}function renderDirective(elem){return`<${elem.data}>`}function renderText(elem,opts){var _a 84let 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)) 85return data}function renderCdata(elem){return`<![CDATA[${elem.children[0].data}]]>`}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("") 86if(isTag$1(node))return node.name==="br"?"\n":getText$1(node.children) 87if(isCDATA(node))return getText$1(node.children) 88if(isText(node))return node.data 89return""}function textContent(node){if(Array.isArray(node))return node.map(textContent).join("") 90if(hasChildren(node)&&!isComment(node))return textContent(node.children) 91if(isText(node))return node.data 92return""}function innerText(node){if(Array.isArray(node))return node.map(innerText).join("") 93if(hasChildren(node)&&(node.type===ElementType.Tag||isCDATA(node)))return innerText(node.children) 94if(isText(node))return node.data 95return""}function getChildren$1(elem){return hasChildren(elem)?elem.children:[]}function getParent(elem){return elem.parent||null}function getSiblings(elem){const parent=getParent(elem) 96if(parent!=null)return getChildren$1(parent) 97const siblings=[elem] 98let{prev:prev,next:next}=elem 99while(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 100return(_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 101while(next!==null&&!isTag$1(next))({next:next}=next) 102return next}function prevElementSibling(elem){let{prev:prev}=elem 103while(prev!==null&&!isTag$1(prev))({prev:prev}=prev) 104return prev}function removeElement(elem){elem.prev&&(elem.prev.next=elem.next) 105elem.next&&(elem.next.prev=elem.prev) 106if(elem.parent){const childs=elem.parent.children 107const childsIndex=childs.lastIndexOf(elem) 108childsIndex>=0&&childs.splice(childsIndex,1)}elem.next=null 109elem.prev=null 110elem.parent=null}function replaceElement(elem,replacement){const prev=replacement.prev=elem.prev 111prev&&(prev.next=replacement) 112const next=replacement.next=elem.next 113next&&(next.prev=replacement) 114const parent=replacement.parent=elem.parent 115if(parent){const childs=parent.children 116childs[childs.lastIndexOf(elem)]=replacement 117elem.parent=null}}function appendChild(parent,child){removeElement(child) 118child.next=null 119child.parent=parent 120if(parent.children.push(child)>1){const sibling=parent.children[parent.children.length-2] 121sibling.next=child 122child.prev=sibling}else child.prev=null}function append$1(elem,next){removeElement(next) 123const{parent:parent}=elem 124const currNext=elem.next 125next.next=currNext 126next.prev=elem 127elem.next=next 128next.parent=parent 129if(currNext){currNext.prev=next 130if(parent){const childs=parent.children 131childs.splice(childs.lastIndexOf(currNext),0,next)}}else parent&&parent.children.push(next)}function prependChild(parent,child){removeElement(child) 132child.parent=parent 133child.prev=null 134if(parent.children.unshift(child)!==1){const sibling=parent.children[1] 135sibling.prev=child 136child.next=sibling}else child.next=null}function prepend(elem,prev){removeElement(prev) 137const{parent:parent}=elem 138if(parent){const childs=parent.children 139childs.splice(childs.indexOf(elem),0,prev)}elem.prev&&(elem.prev.next=prev) 140prev.parent=parent 141prev.prev=elem.prev 142prev.next=elem 143elem.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=[] 144const nodeStack=[nodes] 145const indexStack=[0] 146for(;;){if(indexStack[0]>=nodeStack[0].length){if(indexStack.length===1)return result 147nodeStack.shift() 148indexStack.shift() 149continue}const elem=nodeStack[0][indexStack[0]++] 150if(test(elem)){result.push(elem) 151if(--limit<=0)return result}if(recurse&&hasChildren(elem)&&elem.children.length>0){indexStack.unshift(0) 152nodeStack.unshift(elem.children)}}}function findOneChild(test,nodes){return nodes.find(test)}function findOne$1(test,nodes,recurse=true){let elem=null 153for(let i=0;i<nodes.length&&!elem;i++){const node=nodes[i] 154if(!isTag$1(node))continue 155test(node)?elem=node:recurse&&node.children.length>0&&(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=[] 156const nodeStack=[nodes] 157const indexStack=[0] 158for(;;){if(indexStack[0]>=nodeStack[0].length){if(nodeStack.length===1)return result 159nodeStack.shift() 160indexStack.shift() 161continue}const elem=nodeStack[0][indexStack[0]++] 162if(!isTag$1(elem))continue 163test(elem)&&result.push(elem) 164if(elem.children.length>0){indexStack.unshift(0) 165nodeStack.unshift(elem.children)}}}const Checks={tag_name(name){if(typeof name==="function")return elem=>isTag$1(elem)&&name(elem.name) 166if(name==="*")return isTag$1 167return elem=>isTag$1(elem)&&elem.name===name},tag_type(type){if(typeof type==="function")return elem=>type(elem.type) 168return elem=>elem.type===type},tag_contains(data){if(typeof data==="function")return elem=>isText(elem)&&data(elem.data) 169return elem=>isText(elem)&&elem.data===data}} 170function getAttribCheck(attrib,value){if(typeof value==="function")return elem=>isTag$1(elem)&&value(elem.attribs[attrib]) 171return 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] 172return Object.prototype.hasOwnProperty.call(Checks,key)?Checks[key](value):getAttribCheck(key,value)})) 173return funcs.length===0?null:funcs.reduce(combineFuncs)}function testElement(options,node){const test=compileTest(options) 174return!test||test(node)}function getElements(options,nodes,recurse,limit=1/0){const test=compileTest(options) 175return test?filter(test,nodes,recurse,limit):[]}function getElementById(id,nodes,recurse=true){Array.isArray(nodes)||(nodes=[nodes]) 176return 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 177while(--idx>=0){const node=nodes[idx] 178if(idx>0&&nodes.lastIndexOf(node,idx-1)>=0){nodes.splice(idx,1) 179continue}for(let ancestor=node.parent;ancestor;ancestor=ancestor.parent)if(nodes.includes(ancestor)){nodes.splice(idx,1) 180break}}return nodes}var DocumentPosition;(function(DocumentPosition){DocumentPosition[DocumentPosition["DISCONNECTED"]=1]="DISCONNECTED" 181DocumentPosition[DocumentPosition["PRECEDING"]=2]="PRECEDING" 182DocumentPosition[DocumentPosition["FOLLOWING"]=4]="FOLLOWING" 183DocumentPosition[DocumentPosition["CONTAINS"]=8]="CONTAINS" 184DocumentPosition[DocumentPosition["CONTAINED_BY"]=16]="CONTAINED_BY"})(DocumentPosition||(DocumentPosition={})) 185function compareDocumentPosition(nodeA,nodeB){const aParents=[] 186const bParents=[] 187if(nodeA===nodeB)return 0 188let current=hasChildren(nodeA)?nodeA:nodeA.parent 189while(current){aParents.unshift(current) 190current=current.parent}current=hasChildren(nodeB)?nodeB:nodeB.parent 191while(current){bParents.unshift(current) 192current=current.parent}const maxIdx=Math.min(aParents.length,bParents.length) 193let idx=0 194while(idx<maxIdx&&aParents[idx]===bParents[idx])idx++ 195if(idx===0)return DocumentPosition.DISCONNECTED 196const sharedParent=aParents[idx-1] 197const siblings=sharedParent.children 198const aSibling=aParents[idx] 199const bSibling=bParents[idx] 200if(siblings.indexOf(aSibling)>siblings.indexOf(bSibling)){if(sharedParent===nodeB)return DocumentPosition.FOLLOWING|DocumentPosition.CONTAINED_BY 201return DocumentPosition.FOLLOWING}if(sharedParent===nodeA)return DocumentPosition.PRECEDING|DocumentPosition.CONTAINS 202return DocumentPosition.PRECEDING}function uniqueSort(nodes){nodes=nodes.filter(((node,i,arr)=>!arr.includes(node,i+1))) 203nodes.sort(((a,b)=>{const relative=compareDocumentPosition(a,b) 204if(relative&DocumentPosition.PRECEDING)return-1 205if(relative&DocumentPosition.FOLLOWING)return 1 206return 0})) 207return nodes}function getFeed(doc){const feedRoot=getOneElement(isValidFeed,doc) 208return feedRoot?feedRoot.name==="feed"?getAtomFeed(feedRoot):getRssFeed(feedRoot):null}function getAtomFeed(feedRoot){var _a 209const childs=feedRoot.children 210const feed={type:"atom",items:getElementsByTagName("entry",childs).map((item=>{var _a 211const{children:children}=item 212const entry={media:getMediaElements(children)} 213addConditionally(entry,"id","id",children) 214addConditionally(entry,"title","title",children) 215const href=(_a=getOneElement("link",children))===null||_a===void 0?void 0:_a.attribs["href"] 216href&&(entry.link=href) 217const description=fetch("summary",children)||fetch("content",children) 218description&&(entry.description=description) 219const pubDate=fetch("updated",children) 220pubDate&&(entry.pubDate=new Date(pubDate)) 221return entry}))} 222addConditionally(feed,"id","id",childs) 223addConditionally(feed,"title","title",childs) 224const href=(_a=getOneElement("link",childs))===null||_a===void 0?void 0:_a.attribs["href"] 225href&&(feed.link=href) 226addConditionally(feed,"description","subtitle",childs) 227const updated=fetch("updated",childs) 228updated&&(feed.updated=new Date(updated)) 229addConditionally(feed,"author","email",childs,true) 230return feed}function getRssFeed(feedRoot){var _a,_b 231const childs=(_b=(_a=getOneElement("channel",feedRoot.children))===null||_a===void 0?void 0:_a.children)!==null&&_b!==void 0?_b:[] 232const feed={type:feedRoot.name.substr(0,3),id:"",items:getElementsByTagName("item",feedRoot.children).map((item=>{const{children:children}=item 233const entry={media:getMediaElements(children)} 234addConditionally(entry,"id","guid",children) 235addConditionally(entry,"title","title",children) 236addConditionally(entry,"link","link",children) 237addConditionally(entry,"description","description",children) 238const pubDate=fetch("pubDate",children)||fetch("dc:date",children) 239pubDate&&(entry.pubDate=new Date(pubDate)) 240return entry}))} 241addConditionally(feed,"title","title",childs) 242addConditionally(feed,"link","link",childs) 243addConditionally(feed,"description","description",childs) 244const updated=fetch("lastBuildDate",childs) 245updated&&(feed.updated=new Date(updated)) 246addConditionally(feed,"author","managingEditor",childs,true) 247return feed}const MEDIA_KEYS_STRING=["url","type","lang"] 248const MEDIA_KEYS_INT=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"] 249function getMediaElements(where){return getElementsByTagName("media:content",where).map((elem=>{const{attribs:attribs}=elem 250const media={medium:attribs["medium"],isDefault:!!attribs["isDefault"]} 251for(const attrib of MEDIA_KEYS_STRING)attribs[attrib]&&(media[attrib]=attribs[attrib]) 252for(const attrib of MEDIA_KEYS_INT)attribs[attrib]&&(media[attrib]=parseInt(attribs[attrib],10)) 253attribs["expression"]&&(media.expression=attribs["expression"]) 254return 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) 255val&&(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,prepe
255nd:prepend,prependChild:prependChild,prevElementSibling:prevElementSibling,removeElement:removeElement,removeSubsets:removeSubsets,replaceElement:replaceElement,testElement:testElement,textContent:textContent,uniqueSort:uniqueSort}) 256function 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}} 257var boolbase$1=getDefaultExportFromCjs(boolbase) 258var SelectorType;(function(SelectorType){SelectorType["Attribute"]="attribute" 259SelectorType["Pseudo"]="pseudo" 260SelectorType["PseudoElement"]="pseudo-element" 261SelectorType["Tag"]="tag" 262SelectorType["Universal"]="universal" 263SelectorType["Adjacent"]="adjacent" 264SelectorType["Child"]="child" 265SelectorType["Descendant"]="descendant" 266SelectorType["Parent"]="parent" 267SelectorType["Sibling"]="sibling" 268SelectorType["ColumnCombinator"]="column-combinator"})(SelectorType||(SelectorType={})) 269var AttributeAction;(function(AttributeAction){AttributeAction["Any"]="any" 270AttributeAction["Element"]="element" 271AttributeAction["End"]="end" 272AttributeAction["Equals"]="equals" 273AttributeAction["Exists"]="exists" 274AttributeAction["Hyphen"]="hyphen" 275AttributeAction["Not"]="not" 276AttributeAction["Start"]="start"})(AttributeAction||(AttributeAction={})) 277const reName=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/ 278const reEscape=/\\([\da-f]{1,6}\s?|(\s)|.)/gi 279const actionTypes=new Map([[126,AttributeAction.Element],[94,AttributeAction.Start],[36,AttributeAction.End],[42,AttributeAction.Any],[33,AttributeAction.Not],[124,AttributeAction.Hyphen]]) 280const unpackPseudos=new Set(["has","not","matches","is","where","host","host-context"]) 281function isTraversal$1(selector){switch(selector.type){case SelectorType.Adjacent:case SelectorType.Child:case SelectorType.De
281scendant:case SelectorType.Parent:case SelectorType.Sibling:case SelectorType.ColumnCombinator:return true 282default:return false}}const stripQuotesFromPseudos=new Set(["contains","icontains"]) 283function funescape(_,escaped,escapedWhitespace){const high=parseInt(escaped,16)-0x10000 284return 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=[] 285const endIndex=parseSelector(subselects,`${selector}`,0) 286if(endIndex<selector.length)throw new Error(`Unmatched selector: ${selector.slice(endIndex)}`) 287return subselects}function parseSelector(subselects,selector,selectorIndex){let tokens=[] 288function getName(offset){const match=selector.slice(selectorIndex+offset).match(reName) 289if(!match)throw new Error(`Expected name, found ${selector.slice(selectorIndex)}`) 290const[name]=match 291selectorIndex+=offset+name.length 292return unescapeCSS(name)}function stripWhitespace(offset){selectorIndex+=offset 293while(selectorIndex<selector.length&&isWhitespace(selector.charCodeAt(selectorIndex)))selectorIndex++}function readValueWithParenthesis(){selectorIndex+=1 294const start=selectorIndex 295let counter=1 296for(;counter>0&&selectorIndex<selector.length;selectorIndex++)selector.charCodeAt(selectorIndex)!==40||isEscaped(selectorIndex)?selector.charCodeAt(selectorIndex)!==41||isEscaped(selectorIndex)||counter--:counter++ 297if(counter)throw new Error("Parenthesis not matched") 298return unescapeCSS(selector.slice(start,selectorIndex-1))}function isEscaped(pos){let slashCount=0 299while(selector.charCodeAt(--pos)===92)slashCount++ 300return(slashCount&1)===1}function ensureNotTraversal(){if(tokens.length>0&&isTraversal$1(tokens[tokens.length-1]))throw new Error("Did not expect successive traversals.")}function addTraversal(type){if(tokens.length>
3000&&tokens[tokens.length-1].type===SelectorType.Descendant){tokens[tokens.length-1].type=type 301return}ensureNotTraversal() 302tokens.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() 303if(tokens.length===0)throw new Error("Empty sub-selector") 304subselects.push(tokens)}stripWhitespace(0) 305if(selector.length===selectorIndex)return selectorIndex 306loop:while(selectorIndex<selector.length){const firstChar=selector.charCodeAt(selectorIndex) 307switch(firstChar){case 32:case 9:case 10:case 12:case 13:if(tokens.length===0||tokens[0].type!==SelectorType.Descendant){ensureNotTraversal() 308tokens.push({type:SelectorType.Descendant})}stripWhitespace(1) 309break 310case 62:addTraversal(SelectorType.Child) 311stripWhitespace(1) 312break 313case 60:addTraversal(SelectorType.Parent) 314stripWhitespace(1) 315break 316case 126:addTraversal(SelectorType.Sibling) 317stripWhitespace(1) 318break 319case 43:addTraversal(SelectorType.Adjacent) 320stripWhitespace(1) 321break 322case 46:addSpecialAttribute("class",AttributeAction.Element) 323break 324case 35:addSpecialAttribute("id",AttributeAction.Equals) 325break 326case 91:{stripWhitespace(1) 327let name 328let namespace=null 329if(selector.charCodeAt(selectorIndex)===124)name=getName(1) 330else if(selector.startsWith("*|",selectorIndex)){namespace="*" 331name=getName(2)}else{name=getName(0) 332if(selector.charCodeAt(selectorIndex)===124&&selector.charCodeAt(selectorIndex+1)!==61){namespace=name 333name=getName(1)}}stripWhitespace(0) 334let action=AttributeAction.Exists 335const possibleAction=actionTypes.get(selector.charCodeAt(selectorIndex)) 336if(possibleAction){action=possibleAction 337if(selector.charCodeAt(selectorIndex+1)!==61)throw new Error("Expected `=`") 338stripWhitespace(2)}else if(selector.charCodeAt(selectorIndex)===61){action=AttributeAction.Equals 339stripWhitespace(1)}let value="" 340let ignoreCase=null 341if(action!=="exists"){if(isQuote(selector.charCodeAt(selectorIndex))){const quote=selector.charCodeAt(selectorIndex) 342let sectionEnd=selectorIndex+1 343while(sectionEnd<selector.length&&(selector.charCodeAt(sectionEnd)!==quote||isEscaped(sectionEnd)))sectionEnd+=1 344if(selector.charCodeAt(sectionEnd)!==quote)throw new Error("Attribute value didn't end") 345value=unescapeCSS(selector.slice(selectorIndex+1,sectionEnd)) 346selectorIndex=sectionEnd+1}else{const valueStart=selectorIndex 347while(selectorIndex<selector.length&&(!isWhitespace(selector.charCodeAt(selectorIndex))&&selector.charCodeAt(selectorIndex)!==93||isEscaped(selectorIndex)))selectorIndex+=1 348value=unescapeCSS(selector.slice(valueStart,selectorIndex))}stripWhitespace(0) 349const forceIgnore=selector.charCodeAt(selectorIndex)|0x20 350if(forceIgnore===115){ignoreCase=false 351stripWhitespace(1)}else if(forceIgnore===105){ignoreCase=true 352stripWhitespace(1)}}if(selector.charCodeAt(selectorIndex)!==93)throw new Error("Attribute selector didn't terminate") 353selectorIndex+=1 354const attributeSelector={type:SelectorType.Attribute,name:name,action:action,value:value,namespace:namespace,ignoreCase:ignoreCase} 355tokens.push(attributeSelector) 356break}case 58:{if(selector.charCodeAt(selectorIndex+1)===58){tokens.push({type:SelectorType.PseudoElement,name:getName(2).toLowerCase(),data:selector.charCodeAt(selectorIndex)===40?readValueWithParenthesis():null}) 357continue}const name=getName(1).toLowerCase() 358let data=null 359if(selector.charCodeAt(selectorIndex)===40)if(unpackPseudos.has(name)){if(isQuote(selector.charCodeAt(selectorIndex+1)))throw new Error(`Pseudo-selector ${name} cannot be quoted`) 360data=[] 361selectorIndex=parseSelector(data,selector,selectorIndex+1) 362if(selector.charCodeAt(selectorIndex)!==41)throw new Error(`Missing closing parenthesis in :${name} (${selector})`) 363selectorIndex+=1}else{data=readValueWithParenthesis() 364if(stripQuotesFromPseudos.has(name)){const quot=data.charCodeAt(0) 365quot===data.charCodeAt(data.length-1)&&isQuote(quot)&&(data=data.slice(1,-1))}data=unescapeCSS(data)}tokens.push({type:SelectorType.Pseudo,name:name,data:data}) 366break}case 44:finalizeSubselector() 367tokens=[] 368stripWhitespace(1) 369break
370default:{if(selector.startsWith("/*",selectorIndex)){const endIndex=selector.indexOf("*/",selectorIndex+2) 371if(endIndex<0)throw new Error("Comment was not terminated") 372selectorIndex=endIndex+2 373tokens.length===0&&stripWhitespace(0) 374break}let namespace=null 375let name 376if(firstChar===42){selectorIndex+=1 377name="*"}else if(firstChar===124){name="" 378if(selector.charCodeAt(selectorIndex+1)===124){addTraversal(SelectorType.ColumnCombinator) 379stripWhitespace(2) 380break}}else{if(!reName.test(selector.slice(selectorIndex)))break loop 381name=getName(0)}if(selector.charCodeAt(selectorIndex)===124&&selector.charCodeAt(selectorIndex+1)!==124){namespace=name 382if(selector.charCodeAt(selectorIndex+1)===42){name="*" 383selectorIndex+=2}else name=getName(1)}tokens.push(name==="*"?{type:SelectorType.Universal,namespace:namespace}:{type:SelectorType.Tag,name:name,namespace:namespace})}}}finalizeSubselector() 384return selectorIndex}const procedure=new Map([[SelectorType.Universal,50],[SelectorType.Tag,30],[SelectorType.Attribute,1],[SelectorType.Pseudo,0]]) 385function isTraversal(token){return!procedure.has(token.type)}const attributes=new Map([[AttributeAction.Exists,10],[AttributeAction.Equals,8],[AttributeAction.Not,7],[AttributeAction.Start,6],[AttributeAction.End,6],[AttributeAction.Any,5]]) 386function sortByProcedure(arr){const procs=arr.map(getProcedure) 387for(let i=1;i<arr.length;i++){const procNew=procs[i] 388if(procNew<0)continue 389for(let j=i-1;j>=0&&procNew<procs[j];j--){const token=arr[j+1] 390arr[j+1]=arr[j] 391arr[j]=token 392procs[j+1]=procs[j] 393procs[j]=procNew}}}function getProcedure(token){var _a,_b 394let proc=(_a=procedure.get(token.type))!==null&&_a!==void 0?_a:-1 395if(token.type===SelectorType.Attribute){proc=(_b=attributes.get(token.action))!==null&&_b!==void 0?_b:4 396token.action===AttributeAction.Equals&&token.name==="id"&&(proc=9) 397token.ignoreCase&&(proc>>=1)}else if(token.type===SelectorType.Pseudo)if(token.data)if(token.name==="has"||token.name==="contains")proc=0 398else if(Array.isArray(token.data)){proc=Math.min(...token.data.map((d=>Math.min(...d.map(getProcedure))))) 399proc<0&&(proc=0)}else proc=2 400else proc=3 401return proc}const reChars=/[-[\]{}()*+?.,\\^$|#\s]/g 402function 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"]) 403function 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 404const{name:name}=data 405let{value:value}=data 406if(shouldIgnoreCase(data,options)){value=value.toLowerCase() 407return elem=>{const attr=adapter.getAttributeValue(elem,name) 408return 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 409const{name:name}=data 410let{value:value}=data 411const len=value.length 412if(shouldIgnoreCase(data,options)){value=value.toLowerCase() 413return function hyphenIC(elem){const attr=adapter.getAttributeValue(elem,name) 414return 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) 415return attr!=null&&(attr.length===len||attr.charAt(len)==="-")&&attr.substr(0,len)===value&&next(elem)}}
415,element(next,data,options){const{adapter:adapter}=options 416const{name:name,value:value}=data 417if(/\s/.test(value))return boolbase$1.falseFunc 418const regex=new RegExp(`(?:^|\\s)${escapeRegex(value)}(?:$|\\s)`,shouldIgnoreCase(data,options)?"i":"") 419return function element(elem){const attr=adapter.getAttributeValue(elem,name) 420return 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 421const{name:name}=data 422let{value:value}=data 423const len=value.length 424if(len===0)return boolbase$1.falseFunc 425if(shouldIgnoreCase(data,options)){value=value.toLowerCase() 426return elem=>{const attr=adapter.getAttributeValue(elem,name) 427return attr!=null&&attr.length>=len&&attr.substr(0,len).toLowerCase()===value&&next(elem)}}return elem=>{var _a 428return!!((_a=adapter.getAttributeValue(elem,name))===null||_a===void 0?void 0:_a.startsWith(value))&&next(elem)}},end(next,data,options){const{adapter:adapter}=options 429const{name:name}=data 430let{value:value}=data 431const len=-value.length 432if(len===0)return boolbase$1.falseFunc 433if(shouldIgnoreCase(data,options)){value=value.toLowerCase() 434return elem=>{var _a 435return((_a=adapter.getAttributeValue(elem,name))===null||_a===void 0?void 0:_a.substr(len).toLowerCase())===value&&next(elem)}}return elem=>{var _a 436return!!((_a=adapter.getAttributeValue(elem,name))===null||_a===void 0?void 0:_a.endsWith(value))&&next(elem)}},any(next,data,options){const{adapter:adapter}=options 437const{name:name,value:value}=data 438if(value==="")return boolbase$1.falseFunc 439if(shouldIgnoreCase(data,options)){const regex=new RegExp(escapeRegex(value),"i") 440return function anyIC(elem){const attr=adapter.getAttributeValue(elem,name) 441return attr!=null&&attr.length>=value.length&®ex.test(attr)&&next(elem)}}return elem=>{var _a 442return!!((_a=adapter.getAttributeValue(elem,name))===null||_a===void 0?void 0:_a.includes(value))&&next(elem)}},not(next,data,options){const{adapter:adapter}=options 443const{name:name}=data 444let{value:value}=data 445if(value==="")return elem=>!!adapter.getAttributeValue(elem,name)&&next(elem) 446if(shouldIgnoreCase(data,options)){value=value.toLowerCase() 447return elem=>{const attr=adapter.getAttributeValue(elem,name) 448return(attr==null||attr.length!==value.length||attr.toLowerCase()!==value)&&next(elem)}}return elem=>adapter.getAttributeValue(elem,name)!==value&&next(elem)}} 449const whitespace=new Set([9,10,12,13,32]) 450const ZERO="0".charCodeAt(0) 451const NINE="9".charCodeAt(0) 452function parse$1v(formula){formula=formula.trim().toLowerCase() 453if(formula==="even")return[2,0] 454if(formula==="odd")return[2,1] 455let idx=0 456let a=0 457let sign=readSign() 458let number=readNumber() 459if(idx<formula.length&&formula.charAt(idx)==="n"){idx++ 460a=sign*(number!==null&&number!==void 0?number:1) 461skipWhitespace() 462if(idx<formula.length){sign=readSign() 463skipWhitespace() 464number=readNumber()}else sign=number=0}if(number===null||idx<formula.length)throw new Error(`n-th rule couldn't be parsed ('${formula}')`) 465return[a,sign*number] 466function readSign(){if(formula.charAt(idx)==="-"){idx++ 467return-1}formula.charAt(idx)==="+"&&idx++ 468return 1}function readNumber(){const start=idx 469let value=0 470while(idx<formula.length&&formula.charCodeAt(idx)>=ZERO&&formula.charCodeAt(idx)<=NINE){value=value*10+(formula.charCodeAt(idx)-ZERO) 471idx++}return idx===start?null:value}function skipWhitespace(){while(idx<formula.length&&whitespace.has(formula.charCodeAt(idx)))idx++}}function compile$1(parsed){const a=parsed[0] 472const b=parsed[1]-1 473if(b<0&&a<=0)return boolbase$1.falseFunc 474if(a===-1)return index=>index<=b 475if(a===0)return index=>index===b 476if(a===1)return b<0?boolbase$1.trueFunc:index=>index>=b 477const absA=Math.abs(a) 478const bMod=(b%absA+absA)%absA 479return 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) 480return 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() 481return function icontains(elem){return next(elem)&&adapter.getText(elem).toLowerCase().includes(itext)}},"nth-child"(next,rule,{adapter:adapter,equals:equals}){const func=nthCheck(rule) 482if(func===boolbase$1.falseFunc)return boolbase$1.falseFunc 483if(func===boolbase$1.trueFunc)return getChildFunc(next,adapter) 484return function nthChild(elem){const siblings=adapter.getSiblings(elem) 485let pos=0 486for(let i=0;i<siblings.length;i++){if(equals(elem,siblings[i]))break 487adapter.isTag(siblings[i])&&pos++}return func(pos)&&next(elem)}},"nth-last-child"(next,rule,{adapter:adapter,equals:equals}){const func=nthCheck(rule) 488if(func===boolbase$1.falseFunc)return boolbase$1.falseFunc 489if(func===boolbase$1.trueFunc)return getChildFunc(next,adapter) 490return function nthLastChild(elem){const siblings=adapter.getSiblings(elem) 491let pos=0 492for(let i=siblings.length-1;i>=0;i--){if(equals(elem,siblings[i]))break 493adapter.isTag(siblings[i])&&pos++}return func(pos)&&next(elem)}},"nth-of-type"(next,rule,{adapter:adapter,equals:equals}){const func=nthCheck(rule) 494if(func===boolbase$1.falseFunc)return boolbase$1.falseFunc 495if(func===boolbase$1.trueFunc)return getChildFunc(next,adapter) 496return function nthOfType(elem){const siblings=adapter.getSiblings(elem) 497let pos=0 498for(let i=0;i<siblings.length;i++){const currentSibling=siblings[i] 499if(equals(elem,currentSibling))break 500adapter.isTag(currentSibling)&&adapter.getName(currentSibling)===adapter.getName(elem)&&pos++}return func(pos)&&next(elem)}},"nth-last-of-type"(next,rule,{adapter:adapter,equals:equals}){const func=nthCheck(rule) 501if(func===boolbase$1.falseFunc)return boolbase$1.falseFunc 502if(func===boolbase$1.trueFunc)return getChildFunc(next,adapter) 503return function nthLastOfType(elem){const siblings=adapter.getSiblings(elem) 504let pos=0 505for(let i=siblings.length-1;i>=0;i--){const currentSibling=siblings[i] 506if(equals(elem,currentSibling))break 507adapter.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) 508return(parent==null||!adapter.isTag(parent))&&next(elem)},scope(next,rule,options,context){const{equals:equals}=options 509if(!context||context.length===0)return filters$1["root"](next,rule,options) 510if(context.length===1)return elem=>equals(context[0],elem)&&next(elem) 511return elem=>context.includes(elem)&&next(elem)}
511,hover:dynamicStatePseudo("isHovered"),visited:dynamicStatePseudo("isVisited"),active:dynamicStatePseudo("isActive")} 512function dynamicStatePseudo(name){return function dynamicPseudo(next,_rule,{adapter:adapter}){const func=adapter[name] 513if(typeof func!=="function")return boolbase$1.falseFunc 514return 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 515const firstChild=adapter.getSiblings(elem).find((elem=>adapter.isTag(elem))) 516return firstChild!=null&&equals(elem,firstChild)},"last-child"(elem,{adapter:adapter,equals:equals}){const siblings=adapter.getSiblings(elem) 517for(let i=siblings.length-1;i>=0;i--){if(equals(elem,siblings[i]))return true 518if(adapter.isTag(siblings[i]))break}return false},"first-of-type"(elem,{adapter:adapter,equals:equals}){const siblings=adapter.getSiblings(elem) 519const elemName=adapter.getName(elem) 520for(let i=0;i<siblings.length;i++){const currentSibling=siblings[i] 521if(equals(elem,currentSibling))return true 522if(adapter.isTag(currentSibling)&&adapter.getName(currentSibling)===elemName)break}return false},"last-of-type"(elem,{adapter:adapter,equals:equals}){const siblings=adapter.getSiblings(elem) 523const elemName=adapter.getName(elem) 524for(let i=siblings.length-1;i>=0;i--){const currentSibling=siblings[i] 525if(equals(elem,currentSibling))return true 526if(adapter.isTag(currentSibling)&&adapter.getName(currentSibling)===elemName)break}return false},"only-of-type"(elem,{adapter:adapter,equals:equals}){const elemName=adapter.getName(elem) 527return 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)))} 528function 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])"} 529const PLACEHOLDER_ELEMENT={} 530function ensureIsTag(next,adapter){if(next===boolbase$1.falseFunc)return boolbase$1.falseFunc 531return elem=>adapter.isTag(elem)&&next(elem)}function getNextSiblings(elem,adapter){const siblings=adapter.getSiblings(elem) 532if(siblings.length<=1)return[] 533const elemIndex=siblings.indexOf(elem) 534if(elemIndex<0||elemIndex===siblings.length-1)return[] 535return 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) 536return func===boolbase$1.trueFunc?next:func===boolbase$1.falseFunc?boolbase$1.falseFunc:elem=>func(elem)&&next(elem)} 537const subselects={is:is$1,matches:is$1,where:is$1,not(next,token,options,context,compileToken){const func=compileToken(token,copyOptions(options),context) 538return func===boolbase$1.falseFunc?next:func===boolbase$1.trueFunc?boolbase$1.falseFunc:elem=>!func(elem)&&next(elem)}
538,has(next,subselect,options,_context,compileToken){const{adapter:adapter}=options 539const opts=copyOptions(options) 540opts.relativeSelector=true 541const context=subselect.some((s=>s.some(isTraversal)))?[PLACEHOLDER_ELEMENT]:void 0 542const compiled=compileToken(subselect,opts,context) 543if(compiled===boolbase$1.falseFunc)return boolbase$1.falseFunc 544const hasElement=ensureIsTag(compiled,adapter) 545if(context&&compiled!==boolbase$1.trueFunc){const{shouldTestNextSiblings:shouldTestNextSiblings=false}=compiled 546return elem=>{if(!next(elem))return false 547context[0]=elem 548const childs=adapter.getChildren(elem) 549const nextElements=shouldTestNextSiblings?[...childs,...getNextSiblings(elem,adapter)]:childs 550return adapter.existsOne(hasElement,nextElements)}}return elem=>next(elem)&&adapter.existsOne(hasElement,adapter.getChildren(elem))}} 551function compilePseudoSelector(next,selector,options,context,compileToken){var _a 552const{name:name,data:data}=selector 553if(Array.isArray(data)){if(!(name in subselects))throw new Error(`Unknown pseudo-class :${name}(${data})`) 554return subselects[name](next,data,options,context,compileToken)}const userPseudo=(_a=options.pseudos)===null||_a===void 0?void 0:_a[name] 555const stringPseudo=typeof userPseudo==="string"?userPseudo:aliases[name] 556if(typeof stringPseudo==="string"){if(data!=null)throw new Error(`Pseudo ${name} doesn't have any arguments`) 557const alias=parse$1w(stringPseudo) 558return subselects["is"](next,alias,options,context,compileToken)}if(typeof userPseudo==="function"){verifyPseudoArgs(userPseudo,name,data,1) 559return elem=>userPseudo(elem,data)&&next(elem)}if(name in filters$1)return filters$1[name](next,data,options,context) 560if(name in pseudos){const pseudo=pseudos[name] 561verifyPseudoArgs(pseudo,name,data,2) 562return elem=>pseudo(elem,options,data)&&next(elem)}throw new Error(`Unknown pseudo-class :${name}`)}function getElementParent(node,adapter){const parent=adapter.getParent(node) 563if(parent&&adapter.isTag(parent))return parent 564return null}function compileGeneralSelector(next,selector,options,context,compileToken){const{adapter:adapter,equals:equals}=options 565switch(selector.type){case SelectorType.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select") 566case SelectorType.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select") 567case SelectorType.Attribute:if(selector.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select") 568options.xmlMode&&!options.lowerCaseAttributeNames||(selector.name=selector.name.toLowerCase()) 569return attributeRules[selector.action](next,selector,options) 570case SelectorType.Pseudo:return compilePseudoSelector(next,selector,options,context,compileToken) 571case SelectorType.Tag:{if(selector.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select") 572let{name:name}=selector 573options.xmlMode&&!options.lowerCaseTags||(name=name.toLowerCase()) 574return function tag(elem){return adapter.getName(elem)===name&&next(elem)}}
574case SelectorType.Descendant:{if(options.cacheResults===false||typeof WeakSet==="undefined")return function descendant(elem){let current=elem 575while(current=getElementParent(current,adapter))if(next(current))return true 576return false} 577const isFalseCache=new WeakSet 578return function cachedDescendant(elem){let current=elem 579while(current=getElementParent(current,adapter))if(!isFalseCache.has(current)){if(adapter.isTag(current)&&next(current))return true 580isFalseCache.add(current)}return false}}case"_flexibleDescendant":return function flexibleDescendant(elem){let current=elem 581do{if(next(current))return true}while(current=getElementParent(current,adapter)) 582return false} 583case SelectorType.Parent:return function parent(elem){return adapter.getChildren(elem).some((elem=>adapter.isTag(elem)&&next(elem)))} 584case SelectorType.Child:return function child(elem){const parent=adapter.getParent(elem) 585return parent!=null&&adapter.isTag(parent)&&next(parent)} 586case SelectorType.Sibling:return function sibling(elem){const siblings=adapter.getSiblings(elem) 587for(let i=0;i<siblings.length;i++){const currentSibling=siblings[i] 588if(equals(elem,currentSibling))break 589if(adapter.isTag(currentSibling)&&next(currentSibling))return true}return false} 590case SelectorType.Adjacent:if(adapter.prevElementSibling)return function adjacent(elem){const previous=adapter.prevElementSibling(elem) 591return previous!=null&&next(previous)} 592return function adjacent(elem){const siblings=adapter.getSiblings(elem) 593let lastElement 594for(let i=0;i<siblings.length;i++){const currentSibling=siblings[i] 595if(equals(elem,currentSibling))break 596adapter.isTag(currentSibling)&&(lastElement=currentSibling)}return!!lastElement&&next(lastElement)} 597case SelectorType.Universal:if(selector.namespace!=null&&selector.namespace!=="*")throw new Error("Namespaced universal selectors are not yet supported by css-select") 598return next}}function compile(selector,options,context){const next=compileUnsafe(selector,options,context) 599return ensureIsTag(next,options.adapter)}function compileUnsafe(selector,options,context){const token=typeof selector==="string"?parse$1w(selector):selector 600return compileToken(token,options,context)}function includesScopePseudo(t){return t.type===SelectorType.Pseudo&&(t.name==="scope"||Array.isArray(t.data)&&t.data.some((data=>data.some(includesScopePseudo))))}
600const DESCENDANT_TOKEN={type:SelectorType.Descendant} 601const FLEXIBLE_DESCENDANT_TOKEN={type:"_flexibleDescendant"} 602const SCOPE_TOKEN={type:SelectorType.Pseudo,name:"scope",data:null} 603function 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) 604return e===PLACEHOLDER_ELEMENT||parent&&adapter.isTag(parent)}))) 605for(const t of token){if(t.length>0&&isTraversal(t[0])&&t[0].type!==SelectorType.Descendant);else{if(!hasContext||t.some(includesScopePseudo))continue 606t.unshift(DESCENDANT_TOKEN)}t.unshift(SCOPE_TOKEN)}}function compileToken(token,options,context){var _a 607token.forEach(sortByProcedure) 608context=(_a=options.context)!==null&&_a!==void 0?_a:context 609const isArrayContext=Array.isArray(context) 610const finalContext=context&&(Array.isArray(context)?context:[context]) 611if(options.relativeSelector!==false)absolutize(token,options,finalContext) 612else if(token.some((t=>t.length>0&&isTraversal(t[0]))))throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled") 613let shouldTestNextSiblings=false 614const query=token.map((rules=>{if(rules.length>=2){const[first,second]=rules 615first.type!==SelectorType.Pseudo||first.name!=="scope"||(isArrayContext&&second.type===SelectorType.De
615scendant?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) 616query.shouldTestNextSiblings=shouldTestNextSiblings 617return query}function compileRules(rules,options,context){var _a 618return 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 619if(a===boolbase$1.falseFunc||b===boolbase$1.trueFunc)return b 620return function combine(elem){return a(elem)||b(elem)}}const defaultEquals=(a,b)=>a===b 621const defaultOptions={adapter:DomUtils,equals:defaultEquals} 622function convertOptionFormats(options){var _a,_b,_c,_d 623const 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 624return opts}function getSelectorFunc(searchFunc){return function select(query,elements,options){const opts=convertOptionFormats(options) 625typeof query!=="function"&&(query=compileUnsafe(query,opts,elements)) 626const filteredElements=prepareContext(elements,opts.adapter,query.shouldTestNextSiblings) 627return searchFunc(query,filteredElements,opts)}}function prepareContext(elems,adapter,shouldTestNextSiblings=false){shouldTestNextSiblings&&(elems=appendNextSiblings(elems,adapter)) 628return Array.isArray(elems)?adapter.removeSubsets(elems):adapter.getChildren(elems)}function appendNextSiblings(elem,adapter){const elems=Array.isArray(elem)?elem.slice(0):[elem] 629const elemsLength=elems.length 630for(let i=0;i<elemsLength;i++){const nextSiblings=getNextSiblings(elems[i],adapter) 631elems.push(...nextSiblings)}return elems}const selectAll=getSelectorFunc(((query,elems,options)=>query!==boolbase$1.falseFunc&&elems&&elems.length!==0?options.adapter.findAll(query,elems):[])) 632const selectOne=getSelectorFunc(((query,elems,options)=>query!==boolbase$1.falseFunc&&elems&&elems.length!==0?options.adapter.findOne(query,elems):null)) 633function is(elem,query,options){const opts=convertOptionFormats(options) 634return(typeof query==="function"?query:compile(query,opts))(elem)}function mapNodesToParents(node){const parents=new Map 635for(const child of node.children){parents.set(child,node) 636visit(child,{element:{enter:(child,parent)=>{parents.set(child,parent)}}},node)}return parents}const isTag=node=>node.type==="element" 637const existsOne=(test,elems)=>elems.some((elem=>isTag(elem)&&(test(elem)||existsOne(test,getChildren(elem))))) 638const getAttributeValue=(elem,name)=>elem.attributes[name] 639const getChildren=node=>node.children||[] 640const getName=elemAst=>elemAst.name 641const getText=node=>{if(node.children[0].type==="text"||node.children[0].type==="cdata")return node.children[0].value 642return""} 643const hasAttrib=(elem,name)=>elem.attributes[name]!==void 0 644const findAll$3=(test,elems)=>{const result=[] 645for(const elem of elems)if(isTag(elem)){test(elem)&&result.push(elem) 646result.push(...findAll$3(test,getChildren(elem)))}return result} 647const findOne=(test,elems)=>{for(const elem of elems)if(isTag(elem)){if(test(elem))return elem 648const result=findOne(test,getChildren(elem)) 649if(result)return result}return null} 650function createAdapter(relativeNode,parents){const getParent=node=>{parents||(parents=mapNodesToParents(relativeNode)) 651return parents.get(node)||null} 652const getSiblings=elem=>{const parent=getParent(elem) 653return parent?getChildren(parent):[]} 654const removeSubsets=nodes=>{let idx=nodes.length 655let node 656let ancestor 657let replace 658while(--idx>-1){node=ancestor=nodes[idx] 659nodes[idx]=null 660replace=true 661while(ancestor){if(nodes.includes(ancestor)){replace=false 662nodes.splice(idx,1) 663break}ancestor=getParent(ancestor)}replace&&(nodes[idx]=node)}return nodes} 664return{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)) 665const querySelector=(node,selector,parents)=>selectOne(selector,node,createCssSelectOptions(node,parents)) 666const matches=(node,selector,parents)=>is(node,selector,createCssSelectOptions(node,parents)) 667const detachNodeFromParent=(node,parentNode)=>{parentNode.children=parentNode.children.filter((child=>child!==node))} 668const name$2d="removeDoctype" 669const description$Q="removes doctype declaration" 670const fn$Q=()=>({doctype:{enter:(node,parentNode)=>{detachNodeFromParent(node,parentNode)}}}) 671var removeDoctype=Object.freeze({__proto__:null,description:description$Q,fn:fn$Q,name:name$2d}) 672const name$2c="removeXMLProcInst" 673const description$P="removes XML processing instructions" 674const fn$P=()=>({instruction:{enter:(node,parentNode)=>{node.name==="xml"&&detachNodeFromParent(node,parentNode)}}}) 675var removeXMLProcInst=Object.freeze({__proto__:null,description:description$P,fn:fn$P,name:name$2c}) 676const name$2b="removeComments" 677const description$O="removes comments" 678const DEFAULT_PRESERVE_PATTERNS=[/^!/] 679const fn$O=(_root,params)=>{const{preservePatterns:preservePatterns=DEFAULT_PRESERVE_PATTERNS}=params 680return{comment:{enter:(node,parentNode)=>{if(preservePatterns){if(!Array.isArray(preservePatterns))throw Error(`Expected array in removeComments preservePatterns parameter but received ${preservePatterns}
680`) 681const matches=preservePatterns.some((pattern=>new RegExp(pattern).test(node.value))) 682if(matches)return}detachNodeFromParent(node,parentNode)}}}} 683var removeComments=Object.freeze({__proto__:null,description:description$O,fn:fn$O,name:name$2b
vendor: 35,581 bytes, lines 683-698
683}) 684const 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"])} 685const textElems=new Set([...elemsGroups.textContent,"pre","title"]) 686const pathElems=new Set(["glyph","missing-glyph","path"]) 687const 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"])} 688const 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"}} 689const 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"])}} 690const 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"])}}} 691const 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"]) 692const referencesProps=new Set(["clip-path","color-profile","fill","filter","marker-end","marker-mid","marker-start","mask","stroke","style"]) 693const 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"]) 694const presentationNonInheritableGroupAttrs=new Set(["clip-path","display","filter","mask","opacity","text-decoration","transform","unicode-bidi"]) 695const 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"} 696const 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"} 697const colorsProps=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]) 698const 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
vendor: 7,665 bytes, lines 698-795
698: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"])} 699var _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}) 700const EOF$3=0 701const Ident$1=1 702const Function$3=2 703const AtKeyword$1=3 704const Hash$3=4 705const String$4=5 706const BadString$1=6 707const Url$4=7 708const BadUrl$1=8 709const Delim$1=9 710const Number$5=10 711const Percentage$3=11 712const Dimension$3=12 713const WhiteSpace$3=13 714const CDO$3=14 715const CDC$3=15 716const Colon$1=16 717const Semicolon$1=17 718const Comma$1=18 719const LeftSquareBracket$1=19 720const RightSquareBracket$1=20 721const LeftParenthesis$1=21 722const RightParenthesis$1=22 723const LeftCurlyBracket$1=23 724const RightCurlyBracket$1=24 725const Comment$3=25 726const EOF$2=0 727function 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 728if(isNewline$1(second)||second===EOF$2)return false 729return true}function isIdentifierStart$1(first,second,third){if(first===0x002D)return isNameStart$1(second)||second===0x002D||isValidEscape$1(second,third) 730if(isNameStart$1(first))return true 731if(first===0x005C)return isValidEscape$1(first,second) 732return false}function isNumberStart$1(first,second,third){if(first===0x002B||first===0x002D){if(isDigit$2(second))return 2 733return second===0x002E&&isDigit$2(third)?3:0}if(first===0x002E)return isDigit$2(second)?2:0 734if(isDigit$2(first))return 1 735return 0}function isBOM$1(code){if(code===0xFEFF)return 1 736if(code===0xFFFE)return 1 737return 0}const CATEGORY$1=new Array(0x80) 738const EofCategory$1=0x80 739const WhiteSpaceCategory$1=0x82 740const DigitCategory$1=0x83 741const NameStartCategory$1=0x84 742const NonPrintableCategory$1=0x85 743for(let i=0;i<CATEGORY$1.length;i++)CATEGORY$1[i]=isWhiteSpace$2(i)&&WhiteSpaceCategory$1||isDigit$2(i)&&DigitCategory$1||isNameStart$1(i)&&NameStartCategory$1||isNonPrintable$1(i)&&NonPrintableCategory$1||i||EofCategory$1 744function charCodeCategory$1(code){return code<0x80?CATEGORY$1[code]:NameStartCategory$1}function getCharCode$1(source,offset){return offset<source.length?source.charCodeAt(offset):0}function getNewlineLength$1(source,offset,code){if(code===13&&getCharCode$1(source,offset+1)===10)return 2 745return 1}function cmpChar$1(testStr,offset,referenceCode){let code=testStr.charCodeAt(offset) 746isUppercaseLetter$1(code)&&(code|=32) 747return code===referenceCode}function cmpStr$1(testStr,start,end,referenceStr){if(end-start!==referenceStr.length)return false 748if(start<0||end>testStr.length)return false 749for(let i=start;i<end;i++){const referenceCode=referenceStr.charCodeAt(i-start) 750let testCode=testStr.charCodeAt(i) 751isUppercaseLetter$1(testCode)&&(testCode|=32) 752if(testCode!==referenceCode)return false}return true}function findWhiteSpaceStart$1(source,offset){for(;offset>=0;offset--)if(!isWhiteSpace$2(source.charCodeAt(offset)))break 753return offset+1}function findWhiteSpaceEnd$1(source,offset){for(;offset<source.length;offset++)if(!isWhiteSpace$2(source.charCodeAt(offset)))break 754return offset}function findDecimalNumberEnd$1(source,offset){for(;offset<source.length;offset++)if(!isDigit$2(source.charCodeAt(offset)))break 755return offset}function consumeEscaped$1(source,offset){offset+=2 756if(isHexDigit$1(getCharCode$1(source,offset-1))){for(const maxOffset=Math.min(source.length,offset+5);offset<maxOffset;offset++)if(!isHexDigit$1(getCharCode$1(source,offset)))break 757const code=getCharCode$1(source,offset) 758isWhiteSpace$2(code)&&(offset+=getNewlineLength$1(source,offset,code))}return offset}function consumeName$1(source,offset){for(;offset<source.length;offset++){const code=source.charCodeAt(offset) 759if(isName$1(code))continue 760if(isValidEscape$1(code,getCharCode$1(source,offset+1))){offset=consumeEscaped$1(source,offset)-1 761continue}break}return offset}function consumeNumber$2(source,offset){let code=source.charCodeAt(offset) 762code!==0x002B&&code!==0x002D||(code=source.charCodeAt(offset+=1)) 763if(isDigit$2(code)){offset=findDecimalNumberEnd$1(source,offset+1) 764code=source.charCodeAt(offset)}if(code===0x002E&&isDigit$2(source.charCodeAt(offset+1))){offset+=2 765offset=findDecimalNumberEnd$1(source,offset)}if(cmpChar$1(source,offset,101)){let sign=0 766code=source.charCodeAt(offset+1) 767if(code===0x002D||code===0x002B){sign=1 768code=source.charCodeAt(offset+2)}isDigit$2(code)&&(offset=findDecimalNumberEnd$1(source,offset+1+sign+1))}return offset}function consumeBadUrlRemnants$1(source,offset){for(;offset<source.length;offset++){const code=source.charCodeAt(offset) 769if(code===0x0029){offset++ 770break}isValidEscape$1(code,getCharCode$1(source,offset+1))&&(offset=consumeEscaped$1(source,offset))}return offset}function decodeEscaped$1(escaped){if(escaped.length===1&&!isHexDigit$1(escaped.charCodeAt(0)))return escaped[0] 771let code=parseInt(escaped,16);(code===0||code>=0xD800&&code<=0xDFFF||code>0x10FFFF)&&(code=0xFFFD) 772return 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"] 773const MIN_SIZE$1=16384 774function adoptBuffer$1(buffer=null,size){if(buffer===null||buffer.length<size)return new Uint32Array(Math.max(size+1024,MIN_SIZE$1)) 775return buffer}const N$9=10 776const F$5=12 777const R$5=13 778function computeLinesAndColumns$1(host){const source=host.source 779const sourceLength=source.length 780const startOffset=source.length>0?isBOM$1(source.charCodeAt(0)):0 781const lines=adoptBuffer$1(host.lines,sourceLength) 782const columns=adoptBuffer$1(host.columns,sourceLength) 783let line=host.startLine 784let column=host.startColumn 785for(let i=startOffset;i<sourceLength;i++){const code=source.charCodeAt(i) 786lines[i]=line 787columns[i]=column++ 788if(code===N$9||code===R$5||code===F$5){if(code===R$5&&i+1<sourceLength&&source.charCodeAt(i+1)===N$9){i++ 789lines[i]=line 790columns[i]=column}line++ 791column=1}}lines[sourceLength]=line 792columns[sourceLength]=column 793host.lines=lines 794host.columns=columns 795host.computed=true}let OffsetToLocation$1=class OffsetToLocation{constructor(
vendor: 5,917 bytes, lines 795-885
795){this.lines=null 796this.columns=null 797this.computed=false}setSource(source,startOffset=0,startLine=1,startColumn=1){this.source=source 798this.startOffset=startOffset 799this.startLine=startLine 800this.startColumn=startColumn 801this.computed=false}getLocation(offset,filename){this.computed||computeLinesAndColumns$1(this) 802return{source:filename,offset:this.startOffset+offset,line:this.lines[offset],column:this.columns[offset]}}getLocationRange(start,end,filename){this.computed||computeLinesAndColumns$1(this) 803return{source:filename,start:{offset:this.startOffset+start,line:this.lines[start],column:this.columns[start]},end:{offset:this.startOffset+end,line:this.lines[end],column:this.columns[end]}}}} 804const OFFSET_MASK$1=0x00FFFFFF 805const TYPE_SHIFT$1=24 806const balancePair$3=new Map([[Function$3,RightParenthesis$1],[LeftParenthesis$1,RightParenthesis$1],[LeftSquareBracket$1,RightSquareBracket$1],[LeftCurlyBracket$1,RightCurlyBracket$1]]) 807let TokenStream$1=class TokenStream{constructor(source,tokenize){this.setSource(source,tokenize)}reset(){this.eof=false 808this.tokenIndex=-1 809this.tokenType=0 810this.tokenStart=this.firstCharOffset 811this.tokenEnd=this.firstCharOffset}setSource(source="",tokenize=(()=>{})){source=String(source||"") 812const sourceLength=source.length 813const offsetAndType=adoptBuffer$1(this.offsetAndType,source.length+1) 814const balance=adoptBuffer$1(this.balance,source.length+1) 815let tokenCount=0 816let balanceCloseType=0 817let balanceStart=0 818let firstCharOffset=-1 819this.offsetAndType=null 820this.balance=null 821tokenize(source,((type,start,end)=>{switch(type){default:balance[tokenCount]=sourceLength 822break 823case balanceCloseType:{let balancePrev=balanceStart&OFFSET_MASK$1 824balanceStart=balance[balancePrev] 825balanceCloseType=balanceStart>>TYPE_SHIFT$1 826balance[tokenCount]=balancePrev 827balance[balancePrev++]=tokenCount 828for(;balancePrev<tokenCount;balancePrev++)balance[balancePrev]===sourceLength&&(balance[balancePrev]=tokenCount) 829break}case LeftParenthesis$1:case Function$3:case LeftSquareBracket$1:case LeftCurlyBracket$1:balance[tokenCount]=balanceStart 830balanceCloseType=balancePair$3.get(type) 831balanceStart=balanceCloseType<<TYPE_SHIFT$1|tokenCount 832break}offsetAndType[tokenCount++]=type<<TYPE_SHIFT$1|end 833firstCharOffset===-1&&(firstCharOffset=start)})) 834offsetAndType[tokenCount]=EOF$3<<TYPE_SHIFT$1|sourceLength 835balance[tokenCount]=sourceLength 836balance[sourceLength]=sourceLength 837while(balanceStart!==0){const balancePrev=balanceStart&OFFSET_MASK$1 838balanceStart=balance[balancePrev] 839balance[balancePrev]=sourceLength}this.source=source 840this.firstCharOffset=firstCharOffset===-1?0:firstCharOffset 841this.tokenCount=tokenCount 842this.offsetAndType=offsetAndType 843this.balance=balance 844this.reset() 845this.next()}lookupType(offset){offset+=this.tokenIndex 846if(offset<this.tokenCount)return this.offsetAndType[offset]>>TYPE_SHIFT$1 847return EOF$3}lookupTypeNonSC(idx){for(let offset=this.tokenIndex;offset<this.tokenCount;offset++){const tokenType=this.offsetAndType[offset]>>TYPE_SHIFT$1 848if(tokenType!==WhiteSpace$3&&tokenType!==Comment$3&&idx--===0)return tokenType}return EOF$3}lookupOffset(offset){offset+=this.tokenIndex 849if(offset<this.tokenCount)return this.offsetAndType[offset-1]&OFFSET_MASK$1 850return this.source.length}lookupOffsetNonSC(idx){for(let offset=this.tokenIndex;offset<this.tokenCount;offset++){const tokenType=this.offsetAndType[offset]>>TYPE_SHIFT$1 851if(tokenType!==WhiteSpace$3&&tokenType!==Comment$3&&idx--===0)return offset-this.tokenIndex}return EOF$3}lookupValue(offset,referenceStr){offset+=this.tokenIndex 852if(offset<this.tokenCount)return cmpStr$1(this.source,this.offsetAndType[offset-1]&OFFSET_MASK$1,this.offsetAndType[offset]&OFFSET_MASK$1,referenceStr) 853return false}getTokenStart(tokenIndex){if(tokenIndex===this.tokenIndex)return this.tokenStart 854if(tokenIndex>0)return tokenIndex<this.tokenCount?this.offsetAndType[tokenIndex-1]&OFFSET_MASK$1:this.offsetAndType[this.tokenCount]&OFFSET_MASK$1 855return this.firstCharOffset}substrToCursor(start){return this.source.substring(start,this.tokenStart)}isBalanceEdge(pos){return this.balance[this.tokenIndex]<pos}isDelim(code,offset){if(offset)return this.lookupType(offset)===Delim$1&&this.source.charCodeAt(this.lookupOffset(offset))===code 856return this.tokenType===Delim$1&&this.source.charCodeAt(this.tokenStart)===code}skip(tokenCount){let next=this.tokenIndex+tokenCount 857if(next<this.tokenCount){this.tokenIndex=next 858this.tokenStart=this.offsetAndType[next-1]&OFFSET_MASK$1 859next=this.offsetAndType[next] 860this.tokenType=next>>TYPE_SHIFT$1 861this.tokenEnd=next&OFFSET_MASK$1}else{this.tokenIndex=this.tokenCount 862this.next()}}next(){let next=this.tokenIndex+1 863if(next<this.tokenCount){this.tokenIndex=next 864this.tokenStart=this.tokenEnd 865next=this.offsetAndType[next] 866this.tokenType=next>>TYPE_SHIFT$1 867this.tokenEnd=next&OFFSET_MASK$1}else{this.eof=true 868this.tokenIndex=this.tokenCount 869this.tokenType=EOF$3 870this.tokenStart=this.tokenEnd=this.source.length}}skipSC(){while(this.tokenType===WhiteSpace$3||this.tokenType===Comment$3)this.next()}skipUntilBalanced(startToken,stopConsume){let cursor=startToken 871let balanceEnd 872let offset 873loop:for(;cursor<this.tokenCount;cursor++){balanceEnd=this.balance[cursor] 874if(balanceEnd<startToken)break loop 875offset=cursor>0?this.offsetAndType[cursor-1]&OFFSET_MASK$1:this.firstCharOffset 876switch(stopConsume(this.source.charCodeAt(offset))){case 1:break loop 877case 2:cursor++ 878break loop 879default:this.balance[balanceEnd]===cursor&&(cursor=balanceEnd)}}this.skip(cursor-this.tokenIndex)}forEachToken(fn){for(let i=0,offset=this.firstCharOffset;i<this.tokenCount;i++){const start=offset 880const item=this.offsetAndType[i] 881const end=item&OFFSET_MASK$1 882const type=item>>TYPE_SHIFT$1 883offset=end 884fn(type,start,end,i)}}dump(){const tokens=new Array(this.tokenCount) 885this.forEachToken(((type,start,end,index)=>{tokens[index]={idx:index,type:tokenNames$1[type],chunk:this.source.substring(start,end),balance:this.balance[index]}})
vendor: 10,434 bytes, lines 885-1092
885) 886return tokens}} 887function tokenize$4(source,onToken){function getCharCode(offset){return offset<sourceLength?source.charCodeAt(offset):0}function consumeNumericToken(){offset=consumeNumber$2(source,offset) 888if(isIdentifierStart$1(getCharCode(offset),getCharCode(offset+1),getCharCode(offset+2))){type=Dimension$3 889offset=consumeName$1(source,offset) 890return}if(getCharCode(offset)===0x0025){type=Percentage$3 891offset++ 892return}type=Number$5}function consumeIdentLikeToken(){const nameStartOffset=offset 893offset=consumeName$1(source,offset) 894if(cmpStr$1(source,nameStartOffset,offset,"url")&&getCharCode(offset)===0x0028){offset=findWhiteSpaceEnd$1(source,offset+1) 895if(getCharCode(offset)===0x0022||getCharCode(offset)===0x0027){type=Function$3 896offset=nameStartOffset+4 897return}consumeUrlToken() 898return}if(getCharCode(offset)===0x0028){type=Function$3 899offset++ 900return}type=Ident$1}function consumeStringToken(endingCodePoint){endingCodePoint||(endingCodePoint=getCharCode(offset++)) 901type=String$4 902for(;offset<source.length;offset++){const code=source.charCodeAt(offset) 903switch(charCodeCategory$1(code)){case endingCodePoint:offset++ 904return 905case WhiteSpaceCategory$1:if(isNewline$1(code)){offset+=getNewlineLength$1(source,offset,code) 906type=BadString$1 907return}break 908case 0x005C:if(offset===source.length-1)break 909const nextCode=getCharCode(offset+1) 910isNewline$1(nextCode)?offset+=getNewlineLength$1(source,offset+1,nextCode):isValidEscape$1(code,nextCode)&&(offset=consumeEscaped$1(source,offset)-1) 911break}}}function consumeUrlToken(){type=Url$4 912offset=findWhiteSpaceEnd$1(source,offset) 913for(;offset<source.length;offset++){const code=source.charCodeAt(offset) 914switch(charCodeCategory$1(code)){case 0x0029:offset++ 915return 916case WhiteSpaceCategory$1:offset=findWhiteSpaceEnd$1(source,offset) 917if(getCharCode(offset)===0x0029||offset>=source.length){offset<source.length&&offset++ 918return}offset=consumeBadUrlRemnants$1(source,offset) 919type=BadUrl$1 920return 921case 0x0022:case 0x0027:case 0x0028:case NonPrintableCategory$1:offset=consumeBadUrlRemnants$1(source,offset) 922type=BadUrl$1 923return 924case 0x005C:if(isValidEscape$1(code,getCharCode(offset+1))){offset=consumeEscaped$1(source,offset)-1 925break}offset=consumeBadUrlRemnants$1(source,offset) 926type=BadUrl$1 927return}}}source=String(source||"") 928const sourceLength=source.length 929let start=isBOM$1(getCharCode(0)) 930let offset=start 931let type 932while(offset<sourceLength){const code=source.charCodeAt(offset) 933switch(charCodeCategory$1(code)){case WhiteSpaceCategory$1:type=WhiteSpace$3 934offset=findWhiteSpaceEnd$1(source,offset+1) 935break 936case 0x0022:consumeStringToken() 937break 938case 0x0023:if(isName$1(getCharCode(offset+1))||isValidEscape$1(getCharCode(offset+1),getCharCode(offset+2))){type=Hash$3 939offset=consumeName$1(source,offset+1)}else{type=Delim$1 940offset++}break 941case 0x0027:consumeStringToken() 942break 943case 0x0028:type=LeftParenthesis$1 944offset++ 945break 946case 0x0029:type=RightParenthesis$1 947offset++ 948break 949case 0x002B:if(isNumberStart$1(code,getCharCode(offset+1),getCharCode(offset+2)))consumeNumericToken() 950else{type=Delim$1 951offset++}break 952case 0x002C:type=Comma$1 953offset++ 954break 955case 0x002D:if(isNumberStart$1(code,getCharCode(offset+1),getCharCode(offset+2)))consumeNumericToken() 956else if(getCharCode(offset+1)===0x002D&&getCharCode(offset+2)===0x003E){type=CDC$3 957offset+=3}else if(isIdentifierStart$1(code,getCharCode(offset+1),getCharCode(offset+2)))consumeIdentLikeToken() 958else{type=Delim$1 959offset++}break 960case 0x002E:if(isNumberStart$1(code,getCharCode(offset+1),getCharCode(offset+2)))consumeNumericToken() 961else{type=Delim$1 962offset++}break 963case 0x002F:if(getCharCode(offset+1)===0x002A){type=Comment$3 964offset=source.indexOf("*/",offset+2) 965offset=offset===-1?source.length:offset+2}else{type=Delim$1 966offset++}break 967case 0x003A:type=Colon$1 968offset++ 969break 970case 0x003B:type=Semicolon$1 971offset++ 972break 973case 0x003C:if(getCharCode(offset+1)===0x0021&&getCharCode(offset+2)===0x002D&&getCharCode(offset+3)===0x002D){type=CDO$3 974offset+=4}else{type=Delim$1 975offset++}break 976case 0x0040:if(isIdentifierStart$1(getCharCode(offset+1),getCharCode(offset+2),getCharCode(offset+3))){type=AtKeyword$1 977offset=consumeName$1(source,offset+1)}else{type=Delim$1 978offset++}break 979case 0x005B:type=LeftSquareBracket$1 980offset++ 981break 982case 0x005C:if(isValidEscape$1(code,getCharCode(offset+1)))consumeIdentLikeToken() 983else{type=Delim$1 984offset++}break 985case 0x005D:type=RightSquareBracket$1 986offset++ 987break 988case 0x007B:type=LeftCurlyBracket$1 989offset++ 990break 991case 0x007D:type=RightCurlyBracket$1 992offset++ 993break 994case DigitCategory$1:consumeNumericToken() 995break 996case NameStartCategory$1:consumeIdentLikeToken() 997break 998default:type=Delim$1 999offset++}onToken(type,start,start=offset)}}let releasedCursors$1=null 1000let List$1=class List{static createItem(data){return{prev:null,next:null,data:data}}constructor(){this.head=null 1001this.tail=null 1002this.cursor=null}createItem(data){return List.createItem(data)}allocateCursor(prev,next){let cursor 1003if(releasedCursors$1!==null){cursor=releasedCursors$1 1004releasedCursors$1=releasedCursors$1.cursor 1005cursor.prev=prev 1006cursor.next=next 1007cursor.cursor=this.cursor}else cursor={prev:prev,next:next,cursor:this.cursor} 1008this.cursor=cursor 1009return cursor}releaseCursor(){const{cursor:cursor}=this 1010this.cursor=cursor.cursor 1011cursor.prev=null 1012cursor.next=null 1013cursor.cursor=releasedCursors$1 1014releasedCursors$1=cursor}updateCursors(prevOld,prevNew,nextOld,nextNew){let{cursor:cursor}=this 1015while(cursor!==null){cursor.prev===prevOld&&(cursor.prev=prevNew) 1016cursor.next===nextOld&&(cursor.next=nextNew) 1017cursor=cursor.cursor}}*[Symbol.iterator](){for(let cursor=this.head;cursor!==null;cursor=cursor.next)yield cursor.data}get size(){let size=0 1018for(let cursor=this.head;cursor!==null;cursor=cursor.next)size++ 1019return size}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(array){let cursor=null 1020this.head=null 1021for(let data of array){const item=List.createItem(data) 1022cursor!==null?cursor.next=item:this.head=item 1023item.prev=cursor 1024cursor=item}this.tail=cursor 1025return this}toArray(){return[...this]}toJSON(){return[...this]}forEach(fn,thisArg=this){const cursor=this.allocateCursor(null,this.head) 1026while(cursor.next!==null){const item=cursor.next 1027cursor.next=item.next 1028fn.call(thisArg,item.data,item,this)}this.releaseCursor()}forEachRight(fn,thisArg=this){const cursor=this.allocateCursor(this.tail,null) 1029while(cursor.prev!==null){const item=cursor.prev 1030cursor.prev=item.prev 1031fn.call(thisArg,item.data,item,this)}this.releaseCursor()}reduce(fn,initialValue,thisArg=this){let cursor=this.allocateCursor(null,this.head) 1032let acc=initialValue 1033let item 1034while(cursor.next!==null){item=cursor.next 1035cursor.next=item.next 1036acc=fn.call(thisArg,acc,item.data,item,this)}this.releaseCursor() 1037return acc}reduceRight(fn,initialValue,thisArg=this){let cursor=this.allocateCursor(this.tail,null) 1038let acc=initialValue 1039let item 1040while(cursor.prev!==null){item=cursor.prev 1041cursor.prev=item.prev 1042acc=fn.call(thisArg,acc,item.data,item,this)}this.releaseCursor() 1043return acc}some(fn,thisArg=this){for(let cursor=this.head;cursor!==null;cursor=cursor.next)if(fn.call(thisArg,cursor.data,cursor,this))return true 1044return false}map(fn,thisArg=this){const result=new List 1045for(let cursor=this.head;cursor!==null;cursor=cursor.next)result.appendData(fn.call(thisArg,cursor.data,cursor,this)) 1046return result}filter(fn,thisArg=this){const result=new List 1047for(let cursor=this.head;cursor!==null;cursor=cursor.next)fn.call(thisArg,cursor.data,cursor,this)&&result.appendData(cursor.data) 1048return result}nextUntil(start,fn,thisArg=this){if(start===null)return 1049const cursor=this.allocateCursor(null,start) 1050while(cursor.next!==null){const item=cursor.next 1051cursor.next=item.next 1052if(fn.call(thisArg,item.data,item,this))break}this.releaseCursor()}prevUntil(start,fn,thisArg=this){if(start===null)return 1053const cursor=this.allocateCursor(start,null) 1054while(cursor.prev!==null){const item=cursor.prev 1055cursor.prev=item.prev 1056if(fn.call(thisArg,item.data,item,this))break}this.releaseCursor()}clear(){this.head=null 1057this.tail=null}copy(){const result=new List 1058for(let data of this)result.appendData(data) 1059return result}prepend(item){this.updateCursors(null,item,this.head,item) 1060if(this.head!==null){this.head.prev=item 1061item.next=this.head}else this.tail=item 1062this.head=item 1063return this}prependData(data){return this.prepend(List.createItem(data))}append(item){return this.insert(item)}appendData(data){return this.insert(List.createItem(data))}insert(item,before=null){if(before!==null){this.updateCursors(before.prev,item,before,item) 1064if(before.prev===null){if(this.head!==before)throw new Error("before doesn't belong to list") 1065this.head=item 1066before.prev=item 1067item.next=before 1068this.updateCursors(null,item)}else{before.prev.next=item 1069item.prev=before.prev 1070before.prev=item 1071item.next=before}}else{this.updateCursors(this.tail,item,null,item) 1072if(this.tail!==null){this.tail.next=item 1073item.prev=this.tail}else this.head=item 1074this.tail=item}return this}insertData(data,before){return this.insert(List.createItem(data),before)}remove(item){this.updateCursors(item,item.prev,item,item.next) 1075if(item.prev!==null)item.prev.next=item.next 1076else{if(this.head!==item)throw new Error("item doesn't belong to list") 1077this.head=item.next}if(item.next!==null)item.next.prev=item.prev 1078else{if(this.tail!==item)throw new Error("item doesn't belong to list") 1079this.tail=item.prev}item.prev=null 1080item.next=null 1081return item}push(data){this.insert(List.createItem(data))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(data){this.prepend(List.createItem(data))}shift(){return this.head!==null?this.remove(this.head):null}prependList(list){return this.insertList(list,this.head)}appendList(list){return this.insertList(list)}insertList(list,before){if(list.head===null)return this 1082if(before!==void 0&&before!==null){this.updateCursors(before.prev,list.tail,before,list.head) 1083if(before.prev!==null){before.prev.next=list.head 1084list.head.prev=before.prev}else this.head=list.head 1085before.prev=list.tail 1086list.tail.next=before}else{this.updateCursors(this.tail,list.tail,null,list.head) 1087if(this.tail!==null){this.tail.next=list.head 1088list.head.prev=this.tail}else this.head=list.head 1089this.tail=list.tail}list.head=null 1090list.tail=null 1091return this}replace(oldItem,newItemOrList){"head"in newItemOrList?this.insertList(newItemOrList,oldItem):this.insert(newItemOrList,oldItem) 1092this.remove(oldItem)}}
vendor: 17,884 bytes, lines 1092-1376
1092 1093function createCustomError$1(name,message){const error=Object.create(SyntaxError.prototype) 1094const errorStack=new Error 1095return Object.assign(error,{name:name,message:message,get stack(){return(errorStack.stack||"").replace(/^(.+\n){1,3}/,`${name}: ${message}\n`)}})}const MAX_LINE_LENGTH$1=100 1096const OFFSET_CORRECTION$1=60 1097const TAB_REPLACEMENT$1=" " 1098function sourceFragment$1({source:source,line:line,column:column,baseLine:baseLine,baseColumn:baseColumn},extraLines){function processLines(start,end){return lines.slice(start,end).map(((line,idx)=>String(start+idx+1).padStart(maxNumLength)+" |"+line)).join("\n")}const prelines="\n".repeat(Math.max(baseLine-1,0)) 1099const precolumns=" ".repeat(Math.max(baseColumn-1,0)) 1100const lines=(prelines+precolumns+source).split(/\r\n?|\n|\f/) 1101const startLine=Math.max(1,line-extraLines)-1 1102const endLine=Math.min(line+extraLines,lines.length+1) 1103const maxNumLength=Math.max(4,String(endLine).length)+1 1104let cutLeft=0 1105column+=(TAB_REPLACEMENT$1.length-1)*(lines[line-1].substr(0,column-1).match(/\t/g)||[]).length 1106if(column>MAX_LINE_LENGTH$1){cutLeft=column-OFFSET_CORRECTION$1+3 1107column=OFFSET_CORRECTION$1-2}for(let i=startLine;i<=endLine;i++)if(i>=0&&i<lines.length){lines[i]=lines[i].replace(/\t/g,TAB_REPLACEMENT$1) 1108lines[i]=(cutLeft>0&&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)}}) 1109return error}function readSequence$2(recognizer){const children=this.createList() 1110let space=false 1111const context={recognizer:recognizer} 1112while(!this.eof){switch(this.tokenType){case Comment$3:this.next() 1113continue 1114case WhiteSpace$3:space=true 1115this.next() 1116continue}let child=recognizer.getNode.call(this,context) 1117if(child===void 0)break 1118if(space){recognizer.onWhiteSpace&&recognizer.onWhiteSpace.call(this,child,children,context) 1119space=false}children.push(child)}space&&recognizer.onWhiteSpace&&recognizer.onWhiteSpace.call(this,null,children,context) 1120return children}const NOOP$1=()=>{} 1121const EXCLAMATIONMARK$7=0x0021 1122const NUMBERSIGN$9=0x0023 1123const SEMICOLON$1=0x003B 1124const LEFTCURLYBRACKET$3=0x007B 1125const NULL$1=0 1126function createParseContext$1(name){return function(){return this[name]()}}function fetchParseValues$1(dict){const result=Object.create(null) 1127for(const name of Object.keys(dict)){const item=dict[name] 1128const fn=item.parse||item 1129fn&&(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)} 1130for(const[name,context]of Object.entries(config.parseContext))switch(typeof context){case"function":parseConfig.context[name]=context 1131break 1132case"string":parseConfig.context[name]=createParseContext$1(context) 1133break}return{config:parseConfig,...parseConfig,...parseConfig.node}}function createParser$1(config){let source="" 1134let filename="<unknown>" 1135let needPositions=false 1136let onParseError=NOOP$1 1137let onParseErrorThrow=false 1138const locationMap=new OffsetToLocation$1 1139const 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 1140try{return consumer.call(this)}catch(e){if(onParseErrorThrow)throw e 1141this.skip(startIndex-this.tokenIndex) 1142const fallbackNode=fallback.call(this) 1143onParseErrorThrow=true 1144onParseError(e,fallbackNode) 1145onParseErrorThrow=false 1146return fallbackNode}},lookupNonWSType(offset){let type 1147do{type=this.lookupType(offset++) 1148if(type!==WhiteSpace$3&&type!==Comment$3)return type}while(type!==NULL$1) 1149return NULL$1},charCodeAt:offset=>offset>=0&&offset<source.length?source.charCodeAt(offset):0,substring:(offsetStart,offsetEnd)=>source.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 1150this.eat(tokenType) 1151return this.substrToCursor(start)},consumeFunctionName(){const name=source.substring(this.tokenStart,this.tokenEnd-1) 1152this.eat(Function$3) 1153return name},consumeNumber(type){const number=source.substring(this.tokenStart,consumeNumber$2(source,this.tokenStart)) 1154this.eat(type) 1155return number},eat(tokenType){if(this.tokenType!==tokenType){const tokenName=tokenNames$1[tokenType].slice(0,-6).replace(/-/g," ").replace(/^./,(m=>m.toUpperCase())) 1156let message=`${/[[\](){}]/.test(tokenName)?`"${tokenName}"`:tokenName} is expected` 1157let offset=this.tokenStart 1158switch(tokenType){case Ident$1:if(this.tokenType===Function$3||this.tokenType===Url$4){offset=this.tokenEnd-1 1159message="Identifier is expected but function found"}else message="Identifier is expected" 1160break 1161case Hash$3:if(this.isDelim(NUMBERSIGN$9)){this.next() 1162offset++ 1163message="Name is expected"}break 1164case Percentage$3:if(this.tokenType===Number$5){offset=this.tokenEnd 1165message="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`) 1166this.next()},eatDelim(code){this.isDelim(code)||this.error(`Delim "${String.fromCharCode(code)}" is expected`) 1167this.next()},getLocation(start,end){if(needPositions)return locationMap.getLocationRange(start,end,filename) 1168return null},getLocationFromList(list){if(needPositions){const head=this.getFirstListNode(list) 1169const tail=this.getLastListNode(list) 1170return 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<source.length?locationMap.getLocation(offset):this.eof?locationMap.getLocation(findWhiteSpaceStart$1(source,source.length-1)):locationMap.getLocation(this.tokenStart) 1171throw new SyntaxError$4(message||"Unexpected input",source,location.offset,location.line,location.column,locationMap.startLine,locationMap.startColumn)}}) 1172const parse=function(source_,options){source=source_ 1173options=options||{} 1174parser.setSource(source,tokenize$4) 1175locationMap.setSource(source,options.offset,options.line,options.column) 1176filename=options.filename||"<unknown>" 1177needPositions=Boolean(options.positions) 1178onParseError=typeof options.onParseError==="function"?options.onParseError:NOOP$1 1179onParseErrorThrow=false 1180parser.parseAtrulePrelude=!("parseAtrulePrelude"in options)||Boolean(options.parseAtrulePrelude) 1181parser.parseRulePrelude=!("parseRulePrelude"in options)||Boolean(options.parseRulePrelude) 1182parser.parseValue=!("parseValue"in options)||Boolean(options.parseValue) 1183parser.parseCustomProperty="parseCustomProperty"in options&&Boolean(options.parseCustomProperty) 1184const{context:context="default",onComment:onComment}=options 1185if(context in parser.context===false)throw new Error("Unknown context `"+context+"`") 1186typeof onComment==="function"&&parser.forEachToken(((type,start,end)=>{if(type===Comment$3){const loc=parser.getLocation(start,end) 1187const value=cmpStr$1(source,end-2,end,"*/")?source.slice(start+2,end-2):source.slice(start+2,end) 1188onComment(value,loc)}})) 1189const ast=parser.context[context].call(parser,options) 1190parser.eof||parser.error() 1191return ast} 1192return Object.assign(parse,{SyntaxError:SyntaxError$4,config:parser.config})}var base64Vlq={} 1193var base64$1={} 1194var intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("") 1195base64$1.encode=function(number){if(0<=number&&number<intToCharMap.length)return intToCharMap[number] 1196throw new TypeError("Must be between 0 and 63: "+number)} 1197base64$1.decode=function(charCode){var bigA=65 1198var bigZ=90 1199var littleA=97 1200var littleZ=122 1201var zero=48 1202var nine=57 1203var plus=43 1204var slash=47 1205var littleOffset=26 1206var numberOffset=52 1207if(bigA<=charCode&&charCode<=bigZ)return charCode-bigA 1208if(littleA<=charCode&&charCode<=littleZ)return charCode-littleA+littleOffset 1209if(zero<=charCode&&charCode<=nine)return charCode-zero+numberOffset 1210if(charCode==plus)return 62 1211if(charCode==slash)return 63 1212return-1} 1213var base64=base64$1 1214var VLQ_BASE_SHIFT=5 1215var VLQ_BASE=1<<VLQ_BASE_SHIFT 1216var VLQ_BASE_MASK=VLQ_BASE-1 1217var VLQ_CONTINUATION_BIT=VLQ_BASE 1218function toVLQSigned(aValue){return aValue<0?1+(-aValue<<1):0+(aValue<<1)}function fromVLQSigned(aValue){var isNegative=(aValue&1)===1 1219var shifted=aValue>>1 1220return isNegative?-shifted:shifted}base64Vlq.encode=function base64VLQ_encode(aValue){var encoded="" 1221var digit 1222var vlq=toVLQSigned(aValue) 1223do{digit=vlq&VLQ_BASE_MASK 1224vlq>>>=VLQ_BASE_SHIFT 1225vlq>0&&(digit|=VLQ_CONTINUATION_BIT) 1226encoded+=base64.encode(digit)}while(vlq>0) 1227return encoded} 1228base64Vlq.decode=function base64VLQ_decode(aStr,aIndex,aOutParam){var strLen=aStr.length 1229var result=0 1230var shift=0 1231var continuation,digit 1232do{if(aIndex>=strLen)throw new Error("Expected more digits in base 64 VLQ value.") 1233digit=base64.decode(aStr.charCodeAt(aIndex++)) 1234if(digit===-1)throw new Error("Invalid base64 digit: "+aStr.charAt(aIndex-1)) 1235continuation=!!(digit&VLQ_CONTINUATION_BIT) 1236digit&=VLQ_BASE_MASK 1237result+=digit<<shift 1238shift+=VLQ_BASE_SHIFT}while(continuation) 1239aOutParam.value=fromVLQSigned(result) 1240aOutParam.rest=aIndex} 1241var util$3={};(function(exports){function getArg(aArgs,aName,aDefaultValue){if(aName in aArgs)return aArgs[aName] 1242if(arguments.length===3)return aDefaultValue 1243throw new Error('"'+aName+'" is a required argument.')}exports.getArg=getArg 1244var urlRegexp=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/ 1245var dataUrlRegexp=/^data:.+\,.+$/ 1246function urlParse(aUrl){var match=aUrl.match(urlRegexp) 1247if(!match)return null 1248return{scheme:match[1],auth:match[2],host:match[3],port:match[4],path:match[5]}}exports.urlParse=urlParse 1249function urlGenerate(aParsedUrl){var url="" 1250aParsedUrl.scheme&&(url+=aParsedUrl.scheme+":") 1251url+="//" 1252aParsedUrl.auth&&(url+=aParsedUrl.auth+"@") 1253aParsedUrl.host&&(url+=aParsedUrl.host) 1254aParsedUrl.port&&(url+=":"+aParsedUrl.port) 1255aParsedUrl.path&&(url+=aParsedUrl.path) 1256return url}exports.urlGenerate=urlGenerate 1257var MAX_CACHED_INPUTS=32 1258function lruMemoize(f){var cache=[] 1259return function(input){for(var i=0;i<cache.length;i++)if(cache[i].input===input){var temp=cache[0] 1260cache[0]=cache[i] 1261cache[i]=temp 1262return cache[0].result}var result=f(input) 1263cache.unshift({input:input,result:result}) 1264cache.length>MAX_CACHED_INPUTS&&cache.pop() 1265return result}}var normalize=lruMemoize((function normalize(aPath){var path=aPath 1266var url=urlParse(aPath) 1267if(url){if(!url.path)return aPath 1268path=url.path}var isAbsolute=exports.isAbsolute(path) 1269var parts=[] 1270var start=0 1271var i=0 1272while(true){start=i 1273i=path.indexOf("/",start) 1274if(i===-1){parts.push(path.slice(start)) 1275break}parts.push(path.slice(start,i)) 1276while(i<path.length&&path[i]==="/")i++}for(var part,up=0,i=parts.length-1;i>=0;i--){part=parts[i] 1277if(part===".")parts.splice(i,1) 1278else if(part==="..")up++ 1279else if(up>0)if(part===""){parts.splice(i+1,up) 1280up=0}else{parts.splice(i,2) 1281up--}}path=parts.join("/") 1282path===""&&(path=isAbsolute?"/":".") 1283if(url){url.path=path 1284return urlGenerate(url)}return path})) 1285exports.normalize=normalize 1286function join(aRoot,aPath){aRoot===""&&(aRoot=".") 1287aPath===""&&(aPath=".") 1288var aPathUrl=urlParse(aPath) 1289var aRootUrl=urlParse(aRoot) 1290aRootUrl&&(aRoot=aRootUrl.path||"/") 1291if(aPathUrl&&!aPathUrl.scheme){aRootUrl&&(aPathUrl.scheme=aRootUrl.scheme) 1292return urlGenerate(aPathUrl)}if(aPathUrl||aPath.match(dataUrlRegexp))return aPath 1293if(aRootUrl&&!aRootUrl.host&&!aRootUrl.path){aRootUrl.host=aPath 1294return urlGenerate(aRootUrl)}var joined=aPath.charAt(0)==="/"?aPath:normalize(aRoot.replace(/\/+$/,"")+"/"+aPath) 1295if(aRootUrl){aRootUrl.path=joined 1296return urlGenerate(aRootUrl)}return joined}exports.join=join 1297exports.isAbsolute=function(aPath){return aPath.charAt(0)==="/"||urlRegexp.test(aPath)} 1298function relative(aRoot,aPath){aRoot===""&&(aRoot=".") 1299aRoot=aRoot.replace(/\/$/,"") 1300var level=0 1301while(aPath.indexOf(aRoot+"/")!==0){var index=aRoot.lastIndexOf("/") 1302if(index<0)return aPath 1303aRoot=aRoot.slice(0,index) 1304if(aRoot.match(/^([^\/]+:\/)?\/*$/))return aPath;++level}return Array(level+1).join("../")+aPath.substr(aRoot.length+1)}exports.relative=relative 1305var supportsNullProto=function(){var obj=Object.create(null) 1306return!("__proto__"in obj)}() 1307function identity(s){return s}function toSetString(aStr){if(isProtoString(aStr))return"$"+aStr 1308return aStr}exports.toSetString=supportsNullProto?identity:toSetString 1309function fromSetString(aStr){if(isProtoString(aStr))return aStr.slice(1) 1310return aStr}exports.fromSetString=supportsNullProto?identity:fromSetString 1311function isProtoString(s){if(!s)return false 1312var length=s.length 1313if(length<9)return false 1314if(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 1315for(var i=length-10;i>=0;i--)if(s.charCodeAt(i)!==36)return false 1316return true}function compareByOriginalPositions(mappingA,mappingB,onlyCompareOriginal){var cmp=strcmp(mappingA.source,mappingB.source) 1317if(cmp!==0)return cmp 1318cmp=mappingA.originalLine-mappingB.originalLine 1319if(cmp!==0)return cmp 1320cmp=mappingA.originalColumn-mappingB.originalColumn 1321if(cmp!==0||onlyCompareOriginal)return cmp 1322cmp=mappingA.generatedColumn-mappingB.generatedColumn 1323if(cmp!==0)return cmp 1324cmp=mappingA.generatedLine-mappingB.generatedLine 1325if(cmp!==0)return cmp 1326return strcmp(mappingA.name,mappingB.name)}exports.compareByOriginalPositions=compareByOriginalPositions 1327function compareByOriginalPositionsNoSource(mappingA,mappingB,onlyCompareOriginal){var cmp 1328cmp=mappingA.originalLine-mappingB.originalLine 1329if(cmp!==0)return cmp 1330cmp=mappingA.originalColumn-mappingB.originalColumn 1331if(cmp!==0||onlyCompareOriginal)return cmp 1332cmp=mappingA.generatedColumn-mappingB.generatedColumn 1333if(cmp!==0)return cmp 1334cmp=mappingA.generatedLine-mappingB.generatedLine 1335if(cmp!==0)return cmp 1336return strcmp(mappingA.name,mappingB.name)}exports.compareByOriginalPositionsNoSource=compareByOriginalPositionsNoSource 1337function compareByGeneratedPositionsDeflated(mappingA,mappingB,onlyCompareGenerated){var cmp=mappingA.generatedLine-mappingB.generatedLine 1338if(cmp!==0)return cmp 1339cmp=mappingA.generatedColumn-mappingB.generatedColumn 1340if(cmp!==0||onlyCompareGenerated)return cmp 1341cmp=strcmp(mappingA.source,mappingB.source) 1342if(cmp!==0)return cmp 1343cmp=mappingA.originalLine-mappingB.originalLine 1344if(cmp!==0)return cmp 1345cmp=mappingA.originalColumn-mappingB.originalColumn 1346if(cmp!==0)return cmp 1347return strcmp(mappingA.name,mappingB.name)}exports.compareByGeneratedPositionsDeflated=compareByGeneratedPositionsDeflated 1348function compareByGeneratedPositionsDeflatedNoLine(mappingA,mappingB,onlyCompareGenerated){var cmp=mappingA.generatedColumn-mappingB.generatedColumn 1349if(cmp!==0||onlyCompareGenerated)return cmp 1350cmp=strcmp(mappingA.source,mappingB.source) 1351if(cmp!==0)return cmp 1352cmp=mappingA.originalLine-mappingB.originalLine 1353if(cmp!==0)return cmp 1354cmp=mappingA.originalColumn-mappingB.originalColumn 1355if(cmp!==0)return cmp 1356return strcmp(mappingA.name,mappingB.name)}exports.compareByGeneratedPositionsDeflatedNoLine=compareByGeneratedPositionsDeflatedNoLine 1357function strcmp(aStr1,aStr2){if(aStr1===aStr2)return 0 1358if(aStr1===null)return 1 1359if(aStr2===null)return-1 1360if(aStr1>aStr2)return 1 1361return-1}function compareByGeneratedPositionsInflated(mappingA,mappingB){var cmp=mappingA.generatedLine-mappingB.generatedLine 1362if(cmp!==0)return cmp 1363cmp=mappingA.generatedColumn-mappingB.generatedColumn 1364if(cmp!==0)return cmp 1365cmp=strcmp(mappingA.source,mappingB.source) 1366if(cmp!==0)return cmp 1367cmp=mappingA.originalLine-mappingB.originalLine 1368if(cmp!==0)return cmp 1369cmp=mappingA.originalColumn-mappingB.originalColumn 1370if(cmp!==0)return cmp 1371return strcmp(mappingA.name,mappingB.name)}exports.compareByGeneratedPositionsInflated=compareByGeneratedPositionsInflated 1372function parseSourceMapInput(str){return JSON.parse(str.replace(/^\)]}'[^\n]*\n/,""))}exports.parseSourceMapInput=parseSourceMapInput 1373function computeSourceURL(sourceRoot,sourceURL,sourceMapURL){sourceURL=sourceURL||"" 1374if(sourceRoot){sourceRoot[sourceRoot.length-1]!=="/"&&sourceURL[0]!=="/"&&(sourceRoot+="/") 1375sourceURL=sourceRoot+sourceURL}if(sourceMapURL){var parsed=urlParse(sourceMapURL) 1376if(!parsed)throw new Error("sourceMapURL could not be parsed")
1377if(parsed.path){var index=parsed.path.lastIndexOf("/") 1378index>=0&&(parsed.path=parsed.path.substring(0,index+1))}sourceURL=join(urlGenerate(parsed),sourceURL)}return normalize(sourceURL)}exports.computeSourceURL=computeSourceURL})(util$3) 1379var arraySet={} 1380var util$2=util$3 1381var has=Object.prototype.hasOwnProperty 1382var hasNativeMap=typeof Map!=="undefined" 1383function ArraySet$1(){this._array=[] 1384this._set=hasNativeMap?new Map:Object.create(null)}ArraySet$1.fromArray=function ArraySet_fromArray(aArray,aAllowDuplicates){var set=new ArraySet$1 1385for(var i=0,len=aArray.length;i<len;i++)set.add(aArray[i],aAllowDuplicates) 1386return set} 1387ArraySet$1.prototype.size=function ArraySet_size(){return hasNativeMap?this._set.size:Object.getOwnPropertyNames(this._set).length} 1388ArraySet$1.prototype.add=function ArraySet_add(aStr,aAllowDuplicates){var sStr=hasNativeMap?aStr:util$2.toSetString(aStr) 1389var isDuplicate=hasNativeMap?this.has(aStr):has.call(this._set,sStr) 1390var idx=this._array.length 1391isDuplicate&&!aAllowDuplicates||this._array.push(aStr) 1392isDuplicate||(hasNativeMap?this._set.set(aStr,idx):this._set[sStr]=idx)} 1393ArraySet$1.prototype.has=function ArraySet_has(aStr){if(hasNativeMap)return this._set.has(aStr) 1394var sStr=util$2.toSetString(aStr) 1395return has.call(this._set,sStr)} 1396ArraySet$1.prototype.indexOf=function ArraySet_indexOf(aStr){if(hasNativeMap){var idx=this._set.get(aStr) 1397if(idx>=0)return idx}else{var sStr=util$2.toSetString(aStr) 1398if(has.call(this._set,sStr))return this._set[sStr]}throw new Error('"'+aStr+'" is not in the set.')} 1399ArraySet$1.prototype.at=function ArraySet_at(aIdx){if(aIdx>=0&&aIdx<this._array.length)return this._array[aIdx] 1400throw new Error("No element indexed by "+aIdx)} 1401ArraySet$1.prototype.toArray=function ArraySet_toArray(){return this._array.slice()} 1402arraySet.ArraySet=ArraySet$1 1403var mappingList={} 1404var util$1=util$3 1405function generatedPositionAfter(mappingA,mappingB){var lineA=mappingA.generatedLine 1406var lineB=mappingB.generatedLine 1407var columnA=mappingA.generatedColumn 1408var columnB=mappingB.generatedColumn 1409return lineB>lineA||lineB==lineA&&columnB>=columnA||util$1.compareByGeneratedPositionsInflated(mappingA,mappingB)<=0}function MappingList$1(){this._array=[] 1410this._sorted=true 1411this._last={generatedLine:-1,generatedColumn:0}}MappingList$1.prototype.unsortedForEach=function MappingList_forEach(aCallback,aThisArg){this._array.forEach(aCallback,aThisArg)} 1412MappingList$1.prototype.add=function MappingList_add(aMapping){if(generatedPositionAfter(this._last,aMapping)){this._last=aMapping 1413this._array.push(aMapping)}else{this._sorted=false 1414this._array.push(aMapping)}} 1415MappingList$1.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(util$1.compareByGeneratedPositionsInflated) 1416this._sorted=true}return this._array} 1417mappingList.MappingList=MappingList$1 1418var base64VLQ=base64Vlq 1419var util=util$3 1420var ArraySet=arraySet.ArraySet 1421var MappingList=mappingList.MappingList 1422function SourceMapGenerator(aArgs){aArgs||(aArgs={}) 1423this._file=util.getArg(aArgs,"file",null) 1424this._sourceRoot=util.getArg(aArgs,"sourceRoot",null) 1425this._skipValidation=util.getArg(aArgs,"skipValidation",false) 1426this._ignoreInvalidMapping=util.getArg(aArgs,"ignoreInvalidMapping",false) 1427this._sources=new ArraySet 1428this._names=new ArraySet 1429this._mappings=new MappingList 1430this._sourcesContents=null}SourceMapGenerator.prototype._version=3 1431SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(aSourceMapConsumer,generatorOps){var sourceRoot=aSourceMapConsumer.sourceRoot 1432var generator=new SourceMapGenerator(Object.assign(generatorOps||{},{file:aSourceMapConsumer.file,sourceRoot:sourceRoot})) 1433aSourceMapConsumer.eachMapping((function(mapping){var newMapping={generated:{line:mapping.generatedLine,column:mapping.generatedColumn}} 1434if(mapping.source!=null){newMapping.source=mapping.source 1435sourceRoot!=null&&(newMapping.source=util.relative(sourceRoot,newMapping.source)) 1436newMapping.original={line:mapping.originalLine,column:mapping.originalColumn} 1437mapping.name!=null&&(newMapping.name=mapping.name)}generator.addMapping(newMapping)}))
vendor: 78,592 bytes, lines 1438-2434
1438aSourceMapConsumer.sources.forEach((function(sourceFile){var sourceRelative=sourceFile 1439sourceRoot!==null&&(sourceRelative=util.relative(sourceRoot,sourceFile)) 1440generator._sources.has(sourceRelative)||generator._sources.add(sourceRelative) 1441var content=aSourceMapConsumer.sourceContentFor(sourceFile) 1442content!=null&&generator.setSourceContent(sourceFile,content)})) 1443return generator} 1444SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(aArgs){var generated=util.getArg(aArgs,"generated") 1445var original=util.getArg(aArgs,"original",null) 1446var source=util.getArg(aArgs,"source",null) 1447var name=util.getArg(aArgs,"name",null) 1448if(!this._skipValidation&&this._validateMapping(generated,original,source,name)===false)return 1449if(source!=null){source=String(source) 1450this._sources.has(source)||this._sources.add(source)}if(name!=null){name=String(name) 1451this._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})} 1452SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(aSourceFile,aSourceContent){var source=aSourceFile 1453this._sourceRoot!=null&&(source=util.relative(this._sourceRoot,source)) 1454if(aSourceContent!=null){this._sourcesContents||(this._sourcesContents=Object.create(null)) 1455this._sourcesContents[util.toSetString(source)]=aSourceContent}else if(this._sourcesContents){delete this._sourcesContents[util.toSetString(source)] 1456Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null)}} 1457SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(aSourceMapConsumer,aSourceFile,aSourceMapPath){var sourceFile=aSourceFile 1458if(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.') 1459sourceFile=aSourceMapConsumer.file}var sourceRoot=this._sourceRoot 1460sourceRoot!=null&&(sourceFile=util.relative(sourceRoot,sourceFile)) 1461var newSources=new ArraySet 1462var newNames=new ArraySet 1463this._mappings.unsortedForEach((function(mapping){if(mapping.source===sourceFile&&mapping.originalLine!=null){var original=aSourceMapConsumer.originalPositionFor({line:mapping.originalLine,column:mapping.originalColumn}) 1464if(original.source!=null){mapping.source=original.source 1465aSourceMapPath!=null&&(mapping.source=util.join(aSourceMapPath,mapping.source)) 1466sourceRoot!=null&&(mapping.source=util.relative(sourceRoot,mapping.source)) 1467mapping.originalLine=original.line 1468mapping.originalColumn=original.column 1469original.name!=null&&(mapping.name=original.name)}}var source=mapping.source 1470source==null||newSources.has(source)||newSources.add(source) 1471var name=mapping.name 1472name==null||newNames.has(name)||newNames.add(name)}),this) 1473this._sources=newSources 1474this._names=newNames 1475aSourceMapConsumer.sources.forEach((function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile) 1476if(content!=null){aSourceMapPath!=null&&(sourceFile=util.join(aSourceMapPath,sourceFile)) 1477sourceRoot!=null&&(sourceFile=util.relative(sourceRoot,sourceFile)) 1478this.setSourceContent(sourceFile,content)}}),this)} 1479SourceMapGenerator.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." 1480if(this._ignoreInvalidMapping){typeof console!=="undefined"&&console.warn&&console.warn(message) 1481return false}throw new Error(message)}if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aGenerated.line>0&&aGenerated.column>=0&&!aOriginal&&!aSource&&!aName)return 1482if(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 1483var message="Invalid mapping: "+JSON.stringify({generated:aGenerated,source:aSource,original:aOriginal,name:aName}) 1484if(this._ignoreInvalidMapping){typeof console!=="undefined"&&console.warn&&console.warn(message) 1485return false}throw new Error(message)} 1486SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var previousGeneratedColumn=0 1487var previousGeneratedLine=1 1488var previousOriginalColumn=0 1489var previousOriginalLine=0 1490var previousName=0 1491var previousSource=0 1492var result="" 1493var next 1494var mapping 1495var nameIdx 1496var sourceIdx 1497var mappings=this._mappings.toArray() 1498for(var i=0,len=mappings.length;i<len;i++){mapping=mappings[i] 1499next="" 1500if(mapping.generatedLine!==previousGeneratedLine){previousGeneratedColumn=0 1501while(mapping.generatedLine!==previousGeneratedLine){next+=";" 1502previousGeneratedLine++}}else if(i>0){if(!util.compareByGeneratedPositionsInflated(mapping,mappings[i-1]))continue 1503next+=","}next+=base64VLQ.encode(mapping.generatedColumn-previousGeneratedColumn) 1504previousGeneratedColumn=mapping.generatedColumn 1505if(mapping.source!=null){sourceIdx=this._sources.indexOf(mapping.source) 1506next+=base64VLQ.encode(sourceIdx-previousSource) 1507previousSource=sourceIdx 1508next+=base64VLQ.encode(mapping.originalLine-1-previousOriginalLine) 1509previousOriginalLine=mapping.originalLine-1 1510next+=base64VLQ.encode(mapping.originalColumn-previousOriginalColumn) 1511previousOriginalColumn=mapping.originalColumn 1512if(mapping.name!=null){nameIdx=this._names.indexOf(mapping.name) 1513next+=base64VLQ.encode(nameIdx-previousName) 1514previousName=nameIdx}}result+=next}return result} 1515SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(aSources,aSourceRoot){return aSources.map((function(source){if(!this._sourcesContents)return null 1516aSourceRoot!=null&&(source=util.relative(aSourceRoot,source)) 1517var key=util.toSetString(source) 1518return Object.prototype.hasOwnProperty.call(this._sourcesContents,key)?this._sourcesContents[key]:null}),this)} 1519SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var map={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()} 1520this._file!=null&&(map.file=this._file) 1521this._sourceRoot!=null&&(map.sourceRoot=this._sourceRoot) 1522this._sourcesContents&&(map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot)) 1523return map} 1524SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())} 1525var SourceMapGenerator_1=SourceMapGenerator 1526const trackNodes$1=new Set(["Atrule","Selector","Declaration"]) 1527function generateSourceMap$1(handlers){const map=new SourceMapGenerator_1 1528const generated={line:1,column:0} 1529const original={line:0,column:0} 1530const activatedGenerated={line:1,column:0} 1531const activatedMapping={generated:activatedGenerated} 1532let line=1 1533let column=0 1534let sourceMappingActive=false 1535const origHandlersNode=handlers.node 1536handlers.node=function(node){if(node.loc&&node.loc.start&&trackNodes$1.has(node.type)){const nodeLine=node.loc.start.line 1537const nodeColumn=node.loc.start.column-1 1538if(original.line!==nodeLine||original.column!==nodeColumn){original.line=nodeLine 1539original.column=nodeColumn 1540generated.line=line 1541generated.column=column 1542if(sourceMappingActive){sourceMappingActive=false 1543generated.line===activatedGenerated.line&&generated.column===activatedGenerated.column||map.addMapping(activatedMapping)}sourceMappingActive=true 1544map.addMapping({source:node.loc.source,original:original,generated:generated})}}origHandlersNode.call(this,node) 1545if(sourceMappingActive&&trackNodes$1.has(node.type)){activatedGenerated.line=line 1546activatedGenerated.column=column}} 1547const origHandlersEmit=handlers.emit 1548handlers.emit=function(value,type,auto){for(let i=0;i<value.length;i++)if(value.charCodeAt(i)===10){line++ 1549column=0}else column++ 1550origHandlersEmit(value,type,auto)} 1551const origHandlersResult=handlers.result 1552handlers.result=function(){sourceMappingActive&&map.addMapping(activatedMapping) 1553return{css:origHandlersResult(),map:map}} 1554return handlers}const PLUSSIGN$j=0x002B 1555const HYPHENMINUS$d=0x002D 1556const code$1=(type,value)=>{type===Delim$1&&(type=value) 1557if(typeof type==="string"){const charCode=type.charCodeAt(0) 1558return charCode>0x7F?0x8000:charCode<<8}return type} 1559const 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],["/","*"]] 1560const 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,"-"]]) 1561function createMap$1(pairs){const isWhiteSpaceRequired=new Set(pairs.map((([prev,next])=>code$1(prev)<<16|code$1(next)))) 1562return function(prevCode,type,value){const nextCode=code$1(type,value) 1563const nextCharCode=value.charCodeAt(0) 1564const 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) 1565emitWs&&this.emit(" ",WhiteSpace$3,true) 1566return nextCode}}const spec$1=createMap$1(specPairs$1) 1567const safe$1=createMap$1(safePairs$1) 1568var tokenBefore$1=Object.freeze({__proto__:null,safe:safe$1,spec:spec$1}) 1569const REVERSESOLIDUS$1=0x005c 1570function processChildren$1(node,delimeter){if(typeof delimeter==="function"){let prev=null 1571node.children.forEach((node=>{prev!==null&&delimeter.call(this,prev) 1572this.node(node) 1573prev=node})) 1574return}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 1575for(let[name,item]of Object.entries(config.node)){const fn=item.generate||item 1576typeof fn==="function"&&types.set(name,item.generate||item)}return function(node,options){let buffer="" 1577let prevCode=0 1578let handlers={node(node){if(!types.has(node.type))throw new Error("Unknown node type: "+node.type) 1579types.get(node.type).call(publicApi,node)},tokenBefore:safe$1,token(type,value){prevCode=this.tokenBefore(prevCode,type,value) 1580this.emit(value,type,false) 1581type===Delim$1&&value.charCodeAt(0)===REVERSESOLIDUS$1&&this.emit("\n",WhiteSpace$3,true)},emit(value){buffer+=value},result:()=>buffer} 1582if(options){typeof options.decorator==="function"&&(handlers=options.decorator(handlers)) 1583options.sourceMap&&(handlers=generateSourceMap$1(handlers)) 1584options.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} 1585handlers.node(node) 1586return 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))}}) 1587return ast},toPlainObject(ast){walk(ast,{leave(node){node.children&&node.children instanceof List$1&&(node.children=node.children.toArray())}}) 1588return ast}}}const{hasOwnProperty:hasOwnProperty$b}=Object.prototype 1589const noop$5=function(){} 1590function 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 1591const walkers=[] 1592for(const key in structure){if(hasOwnProperty$b.call(structure,key)===false)continue 1593let fieldTypes=structure[key] 1594const walker={name:key,type:false,nullable:false} 1595Array.isArray(fieldTypes)||(fieldTypes=[fieldTypes]) 1596for(const fieldType of fieldTypes)fieldType===null?walker.nullable=true:typeof fieldType==="string"?walker.type="node":Array.isArray(fieldType)&&(walker.type="list") 1597walker.type&&walkers.push(walker)}if(walkers.length)return{context:nodeType.walkContext,fields:walkers} 1598return null}function getTypesFromConfig$1(config){const types={} 1599for(const name in config.node)if(hasOwnProperty$b.call(config.node,name)){const nodeType=config.node[name] 1600if(!nodeType.structure)throw new Error("Missed `structure` field in `"+name+"` node type definition") 1601types[name]=getWalkersFromStructure$1(name,nodeType)}return types}function createTypeIterator$1(config,reverse){const fields=config.fields.slice() 1602const contextName=config.context 1603const useContext=typeof contextName==="string" 1604reverse&&fields.reverse() 1605return function(node,context,walk,walkReducer){let prevContextValue 1606if(useContext){prevContextValue=context[contextName] 1607context[contextName]=node}for(const field of fields){const ref=node[field.name] 1608if(!field.nullable||ref)if(field.type==="list"){const breakWalk=reverse?ref.reduceRight(walkReducer,false):ref.reduce(walkReducer,false) 1609if(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) 1610const iteratorsNatural={} 1611const iteratorsReverse={} 1612const breakWalk=Symbol("break-walk") 1613const skipNode=Symbol("skip-node") 1614for(const name in types)if(hasOwnProperty$b.call(types,name)&&types[name]!==null){iteratorsNatural[name]=createTypeIterator$1(types[name],false) 1615iteratorsReverse[name]=createTypeIterator$1(types[name],true)}const fastTraversalIteratorsNatural=createFastTraveralMap$1(iteratorsNatural) 1616const fastTraversalIteratorsReverse=createFastTraveralMap$1(iteratorsReverse) 1617const walk=function(root,options){function walkNode(node,item,list){const enterRet=enter.call(context,node,item,list) 1618if(enterRet===breakWalk)return true 1619if(enterRet===skipNode)return false 1620if(iterators.hasOwnProperty(node.type)&&iterators[node.type](node,context,walkNode,walkReducer))return true 1621if(leave.call(context,node,item,list)===breakWalk)return true 1622return false}let enter=noop$5 1623let leave=noop$5 1624let iterators=iteratorsNatural 1625let walkReducer=(ret,data,item,list)=>ret||walkNode(data,item,list) 1626const context={break:breakWalk,skip:skipNode,root:root,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null} 1627if(typeof options==="function")enter=options 1628else if(options){enter=ensureFunction$3(options.enter) 1629leave=ensureFunction$3(options.leave) 1630options.reverse&&(iterators=iteratorsReverse) 1631if(options.visit){if(fastTraversalIteratorsNatural.hasOwnProperty(options.visit))iterators=options.reverse?fastTraversalIteratorsReverse[options.visit]:fastTraversalIteratorsNatural[options.visit] 1632else if(!types.hasOwnProperty(options.visit))throw new Error("Bad value `"+options.visit+"` for `visit` option (should be: "+Object.keys(types).sort().join(", ")+")") 1633enter=invokeForType$1(enter,options.visit) 1634leave=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") 1635walkNode(root)} 1636walk.break=breakWalk 1637walk.skip=skipNode 1638walk.find=function(ast,fn){let found=null 1639walk(ast,(function(node,item,list){if(fn.call(this,node,item,list)){found=node 1640return breakWalk}})) 1641return found} 1642walk.findLast=function(ast,fn){let found=null 1643walk(ast,{reverse:true,enter(node,item,list){if(fn.call(this,node,item,list)){found=node 1644return breakWalk}}}) 1645return found} 1646walk.findAll=function(ast,fn){const found=[] 1647walk(ast,(function(node,item,list){fn.call(this,node,item,list)&&found.push(node)})) 1648return found} 1649return walk}function noop$4(value){return value}function generateMultiplier$1(multiplier){const{min:min,max:max,comma:comma}=multiplier 1650if(min===0&&max===0)return comma?"#?":"*" 1651if(min===0&&max===1)return"?" 1652if(min===1&&max===0)return comma?"#":"+" 1653if(min===1&&max===1)return"" 1654return(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)+"]" 1655default:throw new Error("Unknown node type `"+node.type+"`")}}function generateSequence$1(node,decorate,forceBraces,compact){const combinator=node.combinator===" "||compact?node.combinator:" "+node.combinator+" " 1656const result=node.terms.map((term=>internalGenerate$1(term,decorate,forceBraces,compact))).join(combinator) 1657if(node.explicit||forceBraces)return(compact||result[0]===","?"[":"[ ")+result+(compact?"]":" ]") 1658return result}function internalGenerate$1(node,decorate,forceBraces,compact){let result 1659switch(node.type){case"Group":result=generateSequence$1(node,decorate,forceBraces,compact)+(node.disallowEmpty?"!":"") 1660break 1661case"Multiplier":return internalGenerate$1(node.term,decorate,forceBraces,compact)+decorate(generateMultiplier$1(node),node) 1662case"Type":result="<"+node.name+(node.opts?decorate(generateTypeOpts$1(node.opts),node.opts):"")+">" 1663break 1664case"Property":result="<'"+node.name+"'>" 1665break 1666case"Keyword":result=node.name 1667break 1668case"AtKeyword":result="@"+node.name 1669break 1670case"Function":result=node.name+"(" 1671break 1672case"String":case"Token":result=node.value 1673break 1674case"Comma":result="," 1675break 1676default:throw new Error("Unknown node type `"+node.type+"`")}return decorate(result,node)}function generate$1u(node,options){let decorate=noop$4 1677let forceBraces=false 1678let compact=false 1679if(typeof options==="function")decorate=options 1680else if(options){forceBraces=Boolean(options.forceBraces) 1681compact=Boolean(options.compact) 1682typeof options.decorate==="function"&&(decorate=options.decorate)}return internalGenerate$1(node,decorate,forceBraces,compact)}const defaultLoc$1={offset:0,line:1,column:1} 1683function locateMismatch$1(matchResult,node){const tokens=matchResult.tokens 1684const longestMatch=matchResult.longestMatch 1685const mismatchNode=longestMatch<tokens.length&&tokens[longestMatch].node||null 1686const badNode=mismatchNode!==node?mismatchNode:null 1687let mismatchOffset=0 1688let mismatchLength=0 1689let entries=0 1690let css="" 1691let start 1692let end 1693for(let i=0;i<tokens.length;i++){const token=tokens[i].value 1694if(i===longestMatch){mismatchLength=token.length 1695mismatchOffset=css.length}badNode!==null&&tokens[i].node===badNode&&(i<=longestMatch?entries++:entries=0) 1696css+=token}if(longestMatch===tokens.length||entries>1){start=fromLoc$1(badNode||node,"end")||buildLoc$1(defaultLoc$1,css) 1697end=buildLoc$1(start)}else{start=fromLoc$1(badNode,"start")||buildLoc$1(fromLoc$1(node,"start")||defaultLoc$1,css.slice(0,mismatchOffset)) 1698end=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] 1699if(value)return"line"in value?buildLoc$1(value):value 1700return null}function buildLoc$1({offset:offset,line:line,column:column},extra){const loc={offset:offset,line:line,column:column} 1701if(extra){const lines=extra.split(/\n|\r\n?|\f/) 1702loc.offset+=extra.length 1703loc.line+=lines.length-1 1704loc.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+"`":"")) 1705error.reference=referenceName 1706return error} 1707const SyntaxMatchError$1=function(message,syntax,node,matchResult){const error=createCustomError$1("SyntaxMatchError",message) 1708const{css:css,mismatchOffset:mismatchOffset,mismatchLength:mismatchLength,start:start,end:end}=locateMismatch$1(matchResult,node) 1709error.rawMessage=message 1710error.syntax=syntax?generate$1u(syntax):"<generic>" 1711error.css=css 1712error.mismatchOffset=mismatchOffset 1713error.mismatchLength=mismatchLength 1714error.message=message+"\n syntax: "+error.syntax+"\n value: "+(css||"<empty string>")+"\n --------"+new Array(error.mismatchOffset+1).join("-")+"^" 1715Object.assign(error,start) 1716error.loc={source:node&&node.loc&&node.loc.source||"<unknown>",start:start,end:end} 1717return error} 1718const keywords$1=new Map 1719const properties$1=new Map 1720const HYPHENMINUS$c=45 1721const keyword$1=getKeywordDescriptor$1 1722const property$1=getPropertyDescriptor$1 1723function isCustomProperty$1(str,offset){offset=offset||0 1724return str.length-offset>=2&&str.charCodeAt(offset)===HYPHENMINUS$c&&str.charCodeAt(offset+1)===HYPHENMINUS$c}function getVendorPrefix$1(str,offset){offset=offset||0 1725if(str.length-offset>=3&&str.charCodeAt(offset)===HYPHENMINUS$c&&str.charCodeAt(offset+1)!==HYPHENMINUS$c){const secondDashIndex=str.indexOf("-",offset+2) 1726if(secondDashIndex!==-1)return str.substring(offset,secondDashIndex+1)}return""}function getKeywordDescriptor$1(keyword){if(keywords$1.has(keyword))return keywords$1.get(keyword) 1727const name=keyword.toLowerCase() 1728let descriptor=keywords$1.get(name) 1729if(descriptor===void 0){const custom=isCustomProperty$1(name,0) 1730const vendor=custom?"":getVendorPrefix$1(name,0) 1731descriptor=Object.freeze({basename:name.substr(vendor.length),name:name,prefix:vendor,vendor:vendor,custom:custom})}keywords$1.set(keyword,descriptor) 1732return descriptor}function getPropertyDescriptor$1(property){if(properties$1.has(property))return properties$1.get(property) 1733let name=property 1734let hack=property[0] 1735hack==="/"?hack=property[1]==="/"?"//":"/":hack!=="_"&&hack!=="*"&&hack!=="$"&&hack!=="#"&&hack!=="+"&&hack!=="&"&&(hack="") 1736const custom=isCustomProperty$1(name,hack.length) 1737if(!custom){name=name.toLowerCase() 1738if(properties$1.has(name)){const descriptor=properties$1.get(name) 1739properties$1.set(property,descriptor) 1740return descriptor}}const vendor=custom?"":getVendorPrefix$1(name,hack.length) 1741const prefix=name.substr(0,hack.length+vendor.length) 1742const descriptor=Object.freeze({basename:name.substr(prefix.length),name:name.substr(hack.length),hack:hack,vendor:vendor,prefix:prefix,custom:custom}) 1743properties$1.set(property,descriptor) 1744return descriptor}const cssWideKeywords$1=["initial","inherit","unset","revert","revert-layer"] 1745const PLUSSIGN$i=0x002B 1746const HYPHENMINUS$b=0x002D 1747const N$8=0x006E 1748const DISALLOW_SIGN$3=true 1749const ALLOW_SIGN$3=false 1750function 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) 1751return offset}function checkInteger$3(token,valueOffset,disallowSign,offset){if(!token)return 0 1752const code=token.value.charCodeAt(valueOffset) 1753if(code===PLUSSIGN$i||code===HYPHENMINUS$b){if(disallowSign)return 0 1754valueOffset++}for(;valueOffset<token.value.length;valueOffset++)if(!isDigit$2(token.value.charCodeAt(valueOffset)))return 0 1755return offset+1}function consumeB$3(token,offset_,getNextToken){let sign=false 1756let offset=skipSC$1(token,offset_,getNextToken) 1757token=getNextToken(offset) 1758if(token===null)return offset_ 1759if(token.type!==Number$5){if(!isDelim$3(token,PLUSSIGN$i)&&!isDelim$3(token,HYPHENMINUS$b))return offset_ 1760sign=true 1761offset=skipSC$1(getNextToken(++offset),offset,getNextToken) 1762token=getNextToken(offset) 1763if(token===null||token.type!==Number$5)return 0}if(!sign){const code=token.value.charCodeAt(0) 1764if(code!==PLUSSIGN$i&&code!==HYPHENMINUS$b)return 0}return checkInteger$3(token,sign?0:1,sign,offset)}function anPlusB$1(token,getNextToken){let offset=0 1765if(!token)return 0 1766if(token.type===Number$5)return checkInteger$3(token,0,ALLOW_SIGN$3,offset) 1767if(token.type===Ident$1&&token.value.charCodeAt(0)===HYPHENMINUS$b){if(!cmpChar$1(token.value,1,N$8))return 0 1768switch(token.value.length){case 2:return consumeB$3(getNextToken(++offset),offset,getNextToken) 1769case 3:if(token.value.charCodeAt(2)!==HYPHENMINUS$b)return 0 1770offset=skipSC$1(getNextToken(++offset),offset,getNextToken) 1771token=getNextToken(offset) 1772return checkInteger$3(token,0,DISALLOW_SIGN$3,offset) 1773default:if(token.value.charCodeAt(2)!==HYPHENMINUS$b)return 0 1774return checkInteger$3(token,3,DISALLOW_SIGN$3,offset)}}else if(token.type===Ident$1||isDelim$3(token,PLUSSIGN$i)&&getNextToken(offset+1).type===Ident$1){token.type!==Ident$1&&(token=getNextToken(++offset)) 1775if(token===null||!cmpChar$1(token.value,0,N$8))return 0 1776switch(token.value.length){case 1:return consumeB$3(getNextToken(++offset),offset,getNextToken) 1777case 2:if(token.value.charCodeAt(1)!==HYPHENMINUS$b)return 0 1778offset=skipSC$1(getNextToken(++offset),offset,getNextToken) 1779token=getNextToken(offset) 1780return checkInteger$3(token,0,DISALLOW_SIGN$3,offset) 1781default:if(token.value.charCodeAt(1)!==HYPHENMINUS$b)return 0 1782return checkInteger$3(token,2,DISALLOW_SIGN$3,offset)}}else if(token.type===Dimension$3){let code=token.value.charCodeAt(0) 1783let sign=code===PLUSSIGN$i||code===HYPHENMINUS$b?1:0 1784let i=sign 1785for(;i<token.value.length;i++)if(!isDigit$2(token.value.charCodeAt(i)))break 1786if(i===sign)return 0 1787if(!cmpChar$1(token.value,i,N$8))return 0 1788if(i+1===token.value.length)return consumeB$3(getNextToken(++offset),offset,getNextToken) 1789if(token.value.charCodeAt(i+1)!==HYPHENMINUS$b)return 0 1790if(i+2===token.value.length){offset=skipSC$1(getNextToken(++offset),offset,getNextToken) 1791token=getNextToken(offset) 1792return checkInteger$3(token,0,DISALLOW_SIGN$3,offset)}return checkInteger$3(token,i+2,DISALLOW_SIGN$3,offset)}return 0}const PLUSSIGN$h=0x002B 1793const HYPHENMINUS$a=0x002D 1794const QUESTIONMARK$5=0x003F 1795const U$3=0x0075 1796function isDelim$2(token,code){return token!==null&&token.type===Delim$1&&token.value.charCodeAt(0)===code}function startsWith$3(token,code){return token.value.charCodeAt(0)===code}function hexSequence$1(token,offset,allowDash){let hexlen=0 1797for(let pos=offset;pos<token.value.length;pos++){const code=token.value.charCodeAt(pos) 1798if(code===HYPHENMINUS$a&&allowDash&&hexlen!==0){hexSequence$1(token,offset+hexlen+1,false) 1799return 6}if(!isHexDigit$1(code))return 0 1800if(++hexlen>6)return 0}return hexlen}function withQuestionMarkSequence$1(consumed,length,getNextToken){if(!consumed)return 0 1801while(isDelim$2(getNextToken(length),QUESTIONMARK$5)){if(++consumed>6)return 0 1802length++}return length}function urange$1(token,getNextToken){let length=0 1803if(token===null||token.type!==Ident$1||!cmpChar$1(token.value,0,U$3))return 0 1804token=getNextToken(++length) 1805if(token===null)return 0 1806if(isDelim$2(token,PLUSSIGN$h)){token=getNextToken(++length) 1807if(token===null)return 0 1808if(token.type===Ident$1)return withQuestionMarkSequence$1(hexSequence$1(token,0,true),++length,getNextToken) 1809if(isDelim$2(token,QUESTIONMARK$5))return withQuestionMarkSequence$1(1,++length,getNextToken) 1810return 0}if(token.type===Number$5){const consumedHexLength=hexSequence$1(token,1,true) 1811if(consumedHexLength===0)return 0 1812token=getNextToken(++length) 1813if(token===null)return length 1814if(token.type===Dimension$3||token.type===Number$5){if(!startsWith$3(token,HYPHENMINUS$a)||!hexSequence$1(token,1,false))return 0 1815return length+1}return withQuestionMarkSequence$1(consumedHexLength,length,getNextToken)}if(token.type===Dimension$3)return withQuestionMarkSequence$1(hexSequence$1(token,1,true),++length,getNextToken) 1816return 0}const calcFunctionNames$1=["calc(","-moz-calc(","-webkit-calc("] 1817const balancePair$2=new Map([[Function$3,RightParenthesis$1],[LeftParenthesis$1,RightParenthesis$1],[LeftSquareBracket$1,RightSquareBracket$1],[LeftCurlyBracket$1,RightCurlyBracket$1]]) 1818function charCodeAt$1(str,index){return index<str.length?str.charCodeAt(index):0}function eqStr$1(actual,expected){return cmpStr$1(actual,0,actual.length,expected)}function eqStrAny$1(actual,expected){for(let i=0;i<expected.length;i++)if(eqStr$1(actual,expected[i]))return true 1819return false}function isPostfixIeHack$1(str,offset){if(offset!==str.length-2)return false 1820return charCodeAt$1(str,offset)===0x005C&&isDigit$2(charCodeAt$1(str,offset+1))}function outOfRange$1(opts,value,numEnd){if(opts&&opts.type==="Range"){const num=Number(numEnd!==void 0&&numEnd!==value.length?value.substr(0,numEnd):value) 1821if(isNaN(num))return true 1822if(opts.min!==null&&num<opts.min&&typeof opts.min!=="string")return true 1823if(opts.max!==null&&num>opts.max&&typeof opts.max!=="string")return true}return false}function consumeFunction$1(token,getNextToken){let balanceCloseType=0 1824let balanceStash=[] 1825let length=0 1826scan:do{switch(token.type){case RightCurlyBracket$1:case RightParenthesis$1:case RightSquareBracket$1:if(token.type!==balanceCloseType)break scan 1827balanceCloseType=balanceStash.pop() 1828if(balanceStash.length===0){length++ 1829break scan}break 1830case Function$3:case LeftParenthesis$1:case LeftSquareBracket$1:case LeftCurlyBracket$1:balanceStash.push(balanceCloseType) 1831balanceCloseType=balancePair$2.get(token.type) 1832break}length++}while(token=getNextToken(length)) 1833return length}function calc$1(next){return function(token,getNextToken,opts){if(token===null)return 0 1834if(token.type===Function$3&&eqStrAny$1(token.value,calcFunctionNames$1))return consumeFunction$1(token,getNextToken) 1835return next(token,getNextToken,opts)}}function tokenType$1(expectedTokenType){return function(token){if(token===null||token.type!==expectedTokenType)return 0 1836return 1}}function customIdent$1(token){if(token===null||token.type!==Ident$1)return 0 1837const name=token.value.toLowerCase() 1838if(eqStrAny$1(name,cssWideKeywords$1))return 0 1839if(eqStr$1(name,"default"))return 0 1840return 1}function dashedIdent(token){if(token===null||token.type!==Ident$1)return 0 1841if(charCodeAt$1(token.value,0)!==0x002D||charCodeAt$1(token.value,1)!==0x002D)return 0 1842return 1}function customPropertyName$1(token){if(!dashedIdent(token))return 0 1843if(token.value==="--")return 0 1844return 1}function hexColor$1(token){if(token===null||token.type!==Hash$3)return 0 1845const length=token.value.length 1846if(length!==4&&length!==5&&length!==7&&length!==9)return 0 1847for(let i=1;i<length;i++)if(!isHexDigit$1(charCodeAt$1(token.value,i)))return 0 1848return 1}function idSelector$1(token){if(token===null||token.type!==Hash$3)return 0 1849if(!isIdentifierStart$1(charCodeAt$1(token.value,1),charCodeAt$1(token.value,2),charCodeAt$1(token.value,3)))return 0 1850return 1}function declarationValue$1(token,getNextToken){if(!token)return 0 1851let balanceCloseType=0 1852let balanceStash=[] 1853let length=0 1854scan:do{switch(token.type){case BadString$1:case BadUrl$1:break scan 1855case RightCurlyBracket$1:case RightParenthesis$1:case RightSquareBracket$1:if(token.type!==balanceCloseType)break scan 1856balanceCloseType=balanceStash.pop() 1857break 1858case Semicolon$1:if(balanceCloseType===0)break scan 1859break 1860case Delim$1:if(balanceCloseType===0&&token.value==="!")break scan 1861break 1862case Function$3:case LeftParenthesis$1:case LeftSquareBracket$1:case LeftCurlyBracket$1:balanceStash.push(balanceCloseType) 1863balanceCloseType=balancePair$2.get(token.type) 1864break}length++}while(token=getNextToken(length)) 1865return length}function anyValue$1(token,getNextToken){if(!token)return 0 1866let balanceCloseType=0 1867let balanceStash=[] 1868let length=0 1869scan:do{switch(token.type){case BadString$1:case BadUrl$1:break scan 1870case RightCurlyBracket$1:case RightParenthesis$1:case RightSquareBracket$1:if(token.type!==balanceCloseType)break scan 1871balanceCloseType=balanceStash.pop() 1872break 1873case Function$3:case LeftParenthesis$1:case LeftSquareBracket$1:case LeftCurlyBracket$1:balanceStash.push(balanceCloseType) 1874balanceCloseType=balancePair$2.get(token.type) 1875break}length++}while(token=getNextToken(length)) 1876return length}function dimension$1(type){type&&(type=new Set(type)) 1877return function(token,getNextToken,opts){if(token===null||token.type!==Dimension$3)return 0 1878const numberEnd=consumeNumber$2(token.value,0) 1879if(type!==null){const reverseSolidusOffset=token.value.indexOf("\\",numberEnd) 1880const unit=reverseSolidusOffset!==-1&&isPostfixIeHack$1(token.value,reverseSolidusOffset)?token.value.substring(numberEnd,reverseSolidusOffset):token.value.substr(numberEnd) 1881if(type.has(unit.toLowerCase())===false)return 0}if(outOfRange$1(opts,token.value,numberEnd))return 0 1882return 1}}function percentage$1(token,getNextToken,opts){if(token===null||token.type!==Percentage$3)return 0 1883if(outOfRange$1(opts,token.value,token.value.length-1))return 0 1884return 1}function zero$1(next){typeof next!=="function"&&(next=function(){return 0}) 1885return function(token,getNextToken,opts){if(token!==null&&token.type===Number$5&&Number(token.value)===0)return 1 1886return next(token,getNextToken,opts)}}function number$1(token,getNextToken,opts){if(token===null)return 0 1887const numberEnd=consumeNumber$2(token.value,0) 1888const isNumber=numberEnd===token.value.length 1889if(!isNumber&&!isPostfixIeHack$1(token.value,numberEnd))return 0 1890if(outOfRange$1(opts,token.value,numberEnd))return 0 1891return 1}function integer$1(token,getNextToken,opts){if(token===null||token.type!==Number$5)return 0 1892let i=charCodeAt$1(token.value,0)===0x002B||charCodeAt$1(token.value,0)===0x002D?1:0 1893for(;i<token.value.length;i++)if(!isDigit$2(charCodeAt$1(token.value,i)))return 0 1894if(outOfRange$1(opts,token.value,i))return 0 1895return 1}const tokenTypes={"ident-token":tokenType$1(Ident$1),"function-token":tokenType$1(Function$3),"at-keyword-token":tokenType$1(AtKeyword$1),"hash-token":tokenType$1(Hash$3),"string-token":tokenType$1(String$4),"bad-string-token":tokenType$1(BadString$1),"url-token":tokenType$1(Url$4),"bad-url-token":tokenType$1(BadUrl$1),"delim-token":tokenType$1(Delim$1),"number-token":tokenType$1(Number$5),"percentage-token":tokenType$1(Percentage$3),"dimension-token":tokenType$1(Dimension$3),"whitespace-token":tokenType$1(WhiteSpace$3),"CDO-token":tokenType$1(CDO$3),"CDC-token":tokenType$1(CDC$3),"colon-token":tokenType$1(Colon$1),"semicolon-token":tokenType$1(Semicolon$1),"comma-token":tokenType$1(Comma$1),"[-token":tokenType$1(LeftSquareBracket$1),"]-token":tokenType$1(RightSquareBracket$1),"(-token":tokenType$1(LeftParenthesis$1),")-token":tokenType$1(RightParenthesis$1),"{-token":tokenType$1(LeftCurlyBracket$1),"}-token":tokenType$1(RightCurlyBracket$1)} 1896const productionTypes={string:tokenType$1(String$4),ident:tokenType$1(Ident$1),percentage:calc$1(percentage$1),zero:zero$1(),number:calc$1(number$1),integer:calc$1(integer$1),"custom-ident":customIdent$1,"dashed-ident":dashedIdent,"custom-property-name":customPropertyName$1,"hex-color":hexColor$1,"id-selector":idSelector$1,"an-plus-b":anPlusB$1,urange:urange$1,"declaration-value":declarationValue$1,"any-value":anyValue$1} 1897function createDemensionTypes(units){const{angle:angle,decibel:decibel,frequency:frequency,flex:flex,length:length,resolution:resolution,semitones:semitones,time:time}=units||{} 1898return{dimension:calc$1(dimension$1(null)),angle:calc$1(dimension$1(angle)),decibel:calc$1(dimension$1(decibel)),frequency:calc$1(dimension$1(frequency)),flex:calc$1(dimension$1(flex)),length:calc$1(zero$1(dimension$1(length))),resolution:calc$1(dimension$1(resolution)),semitones:calc$1(dimension$1(semitones)),time:calc$1(dimension$1(time))}}function createGenericTypes(units){return{...tokenTypes,...productionTypes,...createDemensionTypes(units)}}const 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"] 1899const angle=["deg","grad","rad","turn"] 1900const time=["s","ms"] 1901const frequency=["hz","khz"] 1902const resolution=["dpi","dpcm","dppx","x"] 1903const flex=["fr"] 1904const decibel=["db"] 1905const semitones=["st"] 1906var units=Object.freeze({__proto__:null,angle:angle,decibel:decibel,flex:flex,frequency:frequency,length:length,resolution:resolution,semitones:semitones,time:time}) 1907function SyntaxError$3(message,input,offset){return Object.assign(createCustomError$1("SyntaxError",message),{input:input,offset:offset,rawMessage:message,message:message+"\n "+input+"\n--"+new Array((offset||input.length)+1).join("-")+"^"})}const TAB$3=9 1908const N$7=10 1909const F$4=12 1910const R$4=13 1911const SPACE$7=32 1912let Tokenizer$1=class Tokenizer{constructor(str){this.str=str 1913this.pos=0}charCodeAt(pos){return pos<this.str.length?this.str.charCodeAt(pos):0}charCode(){return this.charCodeAt(this.pos)}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(pos){return this.charCodeAt(this.findWsEnd(pos))}skipWs(){this.pos=this.findWsEnd(this.pos)}findWsEnd(pos){for(;pos<this.str.length;pos++){const code=this.str.charCodeAt(pos) 1914if(code!==R$4&&code!==N$7&&code!==F$4&&code!==SPACE$7&&code!==TAB$3)break}return pos}substringToPos(end){return this.str.substring(this.pos,this.pos=end)}eat(code){this.charCode()!==code&&this.error("Expect `"+String.fromCharCode(code)+"`") 1915this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(message){throw new SyntaxError$3(message,this.str,this.pos)}} 1916const TAB$2=9 1917const N$6=10 1918const F$3=12 1919const R$3=13 1920const SPACE$6=32 1921const EXCLAMATIONMARK$6=33 1922const NUMBERSIGN$8=35 1923const AMPERSAND$7=38 1924const APOSTROPHE$5=39 1925const LEFTPARENTHESIS$5=40 1926const RIGHTPARENTHESIS$5=41 1927const ASTERISK$d=42 1928const PLUSSIGN$g=43 1929const COMMA$1=44 1930const HYPERMINUS$1=45 1931const LESSTHANSIGN$2=60 1932const GREATERTHANSIGN$6=62 1933const QUESTIONMARK$4=63 1934const COMMERCIALAT$1=64 1935const LEFTSQUAREBRACKET$1=91 1936const RIGHTSQUAREBRACKET$1=93 1937const LEFTCURLYBRACKET$2=123 1938const VERTICALLINE$7=124 1939const RIGHTCURLYBRACKET$1=125 1940const INFINITY$1=8734 1941const NAME_CHAR$1=new Uint8Array(128).map(((_,idx)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(idx))?1:0)) 1942const COMBINATOR_PRECEDENCE$1={" ":1,"&&":2,"||":3,"|":4} 1943function scanSpaces$1(tokenizer){return tokenizer.substringToPos(tokenizer.findWsEnd(tokenizer.pos))}function scanWord$1(tokenizer){let end=tokenizer.pos 1944for(;end<tokenizer.str.length;end++){const code=tokenizer.str.charCodeAt(end) 1945if(code>=128||NAME_CHAR$1[code]===0)break}tokenizer.pos===end&&tokenizer.error("Expect a keyword") 1946return tokenizer.substringToPos(end)}function scanNumber$1(tokenizer){let end=tokenizer.pos 1947for(;end<tokenizer.str.length;end++){const code=tokenizer.str.charCodeAt(end) 1948if(code<48||code>57)break}tokenizer.pos===end&&tokenizer.error("Expect a number") 1949return tokenizer.substringToPos(end)}function scanString$1(tokenizer){const end=tokenizer.str.indexOf("'",tokenizer.pos+1) 1950if(end===-1){tokenizer.pos=tokenizer.str.length 1951tokenizer.error("Expect an apostrophe")}return tokenizer.substringToPos(end+1)}function readMultiplierRange$1(tokenizer){let min=null 1952let max=null 1953tokenizer.eat(LEFTCURLYBRACKET$2) 1954tokenizer.skipWs() 1955min=scanNumber$1(tokenizer) 1956tokenizer.skipWs() 1957if(tokenizer.charCode()===COMMA$1){tokenizer.pos++ 1958tokenizer.skipWs() 1959if(tokenizer.charCode()!==RIGHTCURLYBRACKET$1){max=scanNumber$1(tokenizer) 1960tokenizer.skipWs()}}else max=min 1961tokenizer.eat(RIGHTCURLYBRACKET$1) 1962return{min:Number(min),max:max?Number(max):0}}function readMultiplier$1(tokenizer){let range=null 1963let comma=false 1964switch(tokenizer.charCode()){case ASTERISK$d:tokenizer.pos++ 1965range={min:0,max:0} 1966break 1967case PLUSSIGN$g:tokenizer.pos++ 1968range={min:1,max:0} 1969break 1970case QUESTIONMARK$4:tokenizer.pos++ 1971range={min:0,max:1} 1972break 1973case NUMBERSIGN$8:tokenizer.pos++ 1974comma=true 1975if(tokenizer.charCode()===LEFTCURLYBRACKET$2)range=readMultiplierRange$1(tokenizer) 1976else if(tokenizer.charCode()===QUESTIONMARK$4){tokenizer.pos++ 1977range={min:0,max:0}}else range={min:1,max:0} 1978break 1979case LEFTCURLYBRACKET$2:range=readMultiplierRange$1(tokenizer) 1980break 1981default: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) 1982if(multiplier!==null){multiplier.term=node 1983if(tokenizer.charCode()===NUMBERSIGN$8&&tokenizer.charCodeAt(tokenizer.pos-1)===PLUSSIGN$g)return maybeMultiplied$1(tokenizer,multiplier) 1984return multiplier}return node}function maybeToken$1(tokenizer){const ch=tokenizer.peek() 1985if(ch==="")return null 1986return{type:"Token",value:ch}}function readProperty$3(tokenizer){let name 1987tokenizer.eat(LESSTHANSIGN$2) 1988tokenizer.eat(APOSTROPHE$5) 1989name=scanWord$1(tokenizer) 1990tokenizer.eat(APOSTROPHE$5) 1991tokenizer.eat(GREATERTHANSIGN$6) 1992return maybeMultiplied$1(tokenizer,{type:"Property",name:name})}function readTypeRange$1(tokenizer){let min=null 1993let max=null 1994let sign=1 1995tokenizer.eat(LEFTSQUAREBRACKET$1) 1996if(tokenizer.charCode()===HYPERMINUS$1){tokenizer.peek() 1997sign=-1}if(sign==-1&&tokenizer.charCode()===INFINITY$1)tokenizer.peek() 1998else{min=sign*Number(scanNumber$1(tokenizer)) 1999NAME_CHAR$1[tokenizer.charCode()]!==0&&(min+=scanWord$1(tokenizer))}scanSpaces$1(tokenizer) 2000tokenizer.eat(COMMA$1) 2001scanSpaces$1(tokenizer) 2002if(tokenizer.charCode()===INFINITY$1)tokenizer.peek() 2003else{sign=1 2004if(tokenizer.charCode()===HYPERMINUS$1){tokenizer.peek() 2005sign=-1}max=sign*Number(scanNumber$1(tokenizer)) 2006NAME_CHAR$1[tokenizer.charCode()]!==0&&(max+=scanWord$1(tokenizer))}tokenizer.eat(RIGHTSQUAREBRACKET$1) 2007return{type:"Range",min:min,max:max}}function readType$1(tokenizer){let name 2008let opts=null 2009tokenizer.eat(LESSTHANSIGN$2) 2010name=scanWord$1(tokenizer) 2011if(tokenizer.charCode()===LEFTPARENTHESIS$5&&tokenizer.nextCharCode()===RIGHTPARENTHESIS$5){tokenizer.pos+=2 2012name+="()"}if(tokenizer.charCodeAt(tokenizer.findWsEnd(tokenizer.pos))===LEFTSQUAREBRACKET$1){scanSpaces$1(tokenizer) 2013opts=readTypeRange$1(tokenizer)}tokenizer.eat(GREATERTHANSIGN$6) 2014return maybeMultiplied$1(tokenizer,{type:"Type",name:name,opts:opts})}function readKeywordOrFunction$1(tokenizer){const name=scanWord$1(tokenizer) 2015if(tokenizer.charCode()===LEFTPARENTHESIS$5){tokenizer.pos++ 2016return{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 2017combinators=Object.keys(combinators).sort(((a,b)=>COMBINATOR_PRECEDENCE$1[a]-COMBINATOR_PRECEDENCE$1[b])) 2018while(combinators.length>0){combinator=combinators.shift() 2019let i=0 2020let subgroupStart=0 2021for(;i<terms.length;i++){const term=terms[i] 2022if(term.type==="Combinator")if(term.value===combinator){subgroupStart===-1&&(subgroupStart=i-1) 2023terms.splice(i,1) 2024i--}else{if(subgroupStart!==-1&&i-subgroupStart>1){terms.splice(subgroupStart,i-subgroupStart,createGroup(terms.slice(subgroupStart,i),combinator)) 2025i=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=[] 2026const combinators={} 2027let token 2028let prevToken=null 2029let prevTokenPos=tokenizer.pos 2030while(token=peek$1(tokenizer))if(token.type!=="Spaces"){if(token.type==="Combinator"){if(prevToken===null||prevToken.type==="Combinator"){tokenizer.pos=prevTokenPos 2031tokenizer.error("Unexpected combinator")}combinators[token.value]=true}else if(prevToken!==null&&prevToken.type!=="Combinator"){combinators[" "]=true 2032terms.push({type:"Combinator",value:" "})}terms.push(token) 2033prevToken=token 2034prevTokenPos=tokenizer.pos}if(prevToken!==null&&prevToken.type==="Combinator"){tokenizer.pos-=prevTokenPos 2035tokenizer.error("Unexpected combinator")}return{type:"Group",terms:terms,combinator:regroupTerms$1(terms,combinators)||" ",disallowEmpty:false,explicit:false}}function readGroup$1(tokenizer){let result 2036tokenizer.eat(LEFTSQUAREBRACKET$1) 2037result=readImplicitGroup$1(tokenizer) 2038tokenizer.eat(RIGHTSQUAREBRACKET$1) 2039result.explicit=true 2040if(tokenizer.charCode()===EXCLAMATIONMARK$6){tokenizer.pos++ 2041result.disallowEmpty=true}return result}function peek$1(tokenizer){let code=tokenizer.charCode() 2042if(code<128&&NAME_CHAR$1[code]===1)return readKeywordOrFunction$1(tokenizer) 2043switch(code){case RIGHTSQUAREBRACKET$1:break 2044case LEFTSQUAREBRACKET$1:return maybeMultiplied$1(tokenizer,readGroup$1(tokenizer)) 2045case LESSTHANSIGN$2:return tokenizer.nextCharCode()===APOSTROPHE$5?readProperty$3(tokenizer):readType$1(tokenizer) 2046case VERTICALLINE$7:return{type:"Combinator",value:tokenizer.substringToPos(tokenizer.pos+(tokenizer.nextCharCode()===VERTICALLINE$7?2:1))} 2047case AMPERSAND$7:tokenizer.pos++ 2048tokenizer.eat(AMPERSAND$7) 2049return{type:"Combinator",value:"&&"} 2050case COMMA$1:tokenizer.pos++ 2051return{type:"Comma"} 2052case APOSTROPHE$5:return maybeMultiplied$1(tokenizer,{type:"String",value:scanString$1(tokenizer)}) 2053case SPACE$6:case TAB$2:case N$6:case R$3:case F$3:return{type:"Spaces",value:scanSpaces$1(tokenizer)} 2054case COMMERCIALAT$1:code=tokenizer.nextCharCode() 2055if(code<128&&NAME_CHAR$1[code]===1){tokenizer.pos++ 2056return{type:"AtKeyword",name:scanWord$1(tokenizer)}}return maybeToken$1(tokenizer) 2057case ASTERISK$d:case PLUSSIGN$g:case QUESTIONMARK$4:case NUMBERSIGN$8:case EXCLAMATIONMARK$6:break 2058case LEFTCURLYBRACKET$2:code=tokenizer.nextCharCode() 2059if(code<48||code>57)return maybeToken$1(tokenizer) 2060break 2061default:return maybeToken$1(tokenizer)}}function parse$1u(source){const tokenizer=new Tokenizer$1(source) 2062const result=readImplicitGroup$1(tokenizer) 2063tokenizer.pos!==source.length&&tokenizer.error("Unexpected input") 2064if(result.terms.length===1&&result.terms[0].type==="Group")return result.terms[0] 2065return result}const noop$3=function(){} 2066function ensureFunction$2(value){return typeof value==="function"?value:noop$3}function walk$4(node,options,context){function walk(node){enter.call(context,node) 2067switch(node.type){case"Group":node.terms.forEach(walk) 2068break 2069case"Multiplier":walk(node.term) 2070break 2071case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break 2072default:throw new Error("Unknown type: "+node.type)}leave.call(context,node)}let enter=noop$3 2073let leave=noop$3 2074if(typeof options==="function")enter=options 2075else if(options){enter=ensureFunction$2(options.enter) 2076leave=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") 2077walk(node)}const astToTokens$1={decorator(handlers){const tokens=[] 2078let curNode=null 2079return{...handlers,node(node){const tmp=curNode 2080curNode=node 2081handlers.node.call(this,node) 2082curNode=tmp},emit(value,type,auto){tokens.push({type:type,value:value,node:auto?null:curNode})},result:()=>tokens}}} 2083function stringToTokens$1(str){const tokens=[] 2084tokenize$4(str,((type,start,end)=>tokens.push({type:type,value:str.slice(start,end),node:null}))) 2085return tokens}function prepareTokens$1(value,syntax){if(typeof value==="string")return stringToTokens$1(value) 2086return syntax.generate(value,astToTokens$1)}const MATCH$1={type:"Match"} 2087const MISMATCH$1={type:"Mismatch"} 2088const DISALLOW_EMPTY$1={type:"DisallowEmpty"} 2089const LEFTPARENTHESIS$4=40 2090const RIGHTPARENTHESIS$4=41 2091function createCondition$1(match,thenBranch,elseBranch){if(thenBranch===MATCH$1&&elseBranch===MISMATCH$1)return match 2092if(match===MATCH$1&&thenBranch===MATCH$1&&elseBranch===MATCH$1)return match 2093if(match.type==="If"&&match.else===MISMATCH$1&&thenBranch===MATCH$1){thenBranch=match.then 2094match=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 2095for(let i=terms.length-1;i>=0;i--){const term=terms[i] 2096result=createCondition$1(term,result,MISMATCH$1)}return result}case"|":{let result=MISMATCH$1 2097let map=null 2098for(let i=terms.length-1;i>=0;i--){let term=terms[i] 2099if(isEnumCapatible$1(term)){if(map===null&&i>0&&isEnumCapatible$1(terms[i-1])){map=Object.create(null) 2100result=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() 2101if(key in map===false){map[key]=term 2102continue}}}map=null 2103result=createCondition$1(term,MATCH$1,result)}return result}case"&&":{if(terms.length>5)return{type:"MatchOnce",terms:terms,all:true} 2104let result=MISMATCH$1 2105for(let i=terms.length-1;i>=0;i--){const term=terms[i] 2106let thenClause 2107thenClause=terms.length>1?buildGroupMatchGraph$1(combinator,terms.filter((function(newGroupTerm){return newGroupTerm!==term})),false):MATCH$1 2108result=createCondition$1(term,thenClause,result)}return result}case"||":{if(terms.length>5)return{type:"MatchOnce",terms:terms,all:false} 2109let result=atLeastOneTermMatched?MATCH$1:MISMATCH$1 2110for(let i=terms.length-1;i>=0;i--){const term=terms[i] 2111let thenClause 2112thenClause=terms.length>1?buildGroupMatchGraph$1(combinator,terms.filter((function(newGroupTerm){return newGroupTerm!==term})),true):MATCH$1 2113result=createCondition$1(term,thenClause,result)}return result}}}function buildMultiplierMatchGraph$1(node){let result=MATCH$1 2114let matchTerm=buildMatchGraphInternal$1(node.term) 2115if(node.max===0){matchTerm=createCondition$1(matchTerm,DISALLOW_EMPTY$1,MISMATCH$1) 2116result=createCondition$1(matchTerm,null,MISMATCH$1) 2117result.then=createCondition$1(MATCH$1,MATCH$1,result) 2118node.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)) 2119result=createCondition$1(matchTerm,createCondition$1(MATCH$1,MATCH$1,result),MISMATCH$1)}if(node.min===0)result=createCondition$1(MATCH$1,MATCH$1,result) 2120else for(let i=0;i<node.min-1;i++){node.comma&&result!==MATCH$1&&(result=createCondition$1({type:"Comma",syntax:node},result,MISMATCH$1)) 2121result=createCondition$1(matchTerm,result,MISMATCH$1)}return result}function buildMatchGraphInternal$1(node){if(typeof node==="function")return{type:"Generic",fn:node} 2122switch(node.type){case"Group":{let result=buildGroupMatchGraph$1(node.combinator,node.terms.map(buildMatchGraphInternal$1),false) 2123node.disallowEmpty&&(result=createCondition$1(result,DISALLOW_EMPTY$1,MISMATCH$1)) 2124return result}case"Multiplier":return buildMultiplierMatchGraph$1(node) 2125case"Type":case"Property":return{type:node.type,name:node.name,syntax:node} 2126case"Keyword":return{type:node.type,name:node.name.toLowerCase(),syntax:node} 2127case"AtKeyword":return{type:node.type,name:"@"+node.name.toLowerCase(),syntax:node} 2128case"Function":return{type:node.type,name:node.name.toLowerCase()+"(",syntax:node} 2129case"String":if(node.value.length===3)return{type:"Token",value:node.value.charAt(1),syntax:node} 2130return{type:node.type,value:node.value.substr(1,node.value.length-2).replace(/\\'/g,"'"),syntax:node} 2131case"Token":return{type:node.type,value:node.value,syntax:node} 2132case"Comma":return{type:node.type,syntax:node} 2133default:throw new Error("Unknown node type:",node.type)}}function buildMatchGraph$1(syntaxTree,ref){typeof syntaxTree==="string"&&(syntaxTree=parse$1u(syntaxTree)) 2134return{type:"MatchGraph",match:buildMatchGraphInternal$1(syntaxTree),syntax:ref||null,source:syntaxTree}}const{hasOwnProperty:hasOwnProperty$a}=Object.prototype 2135const STUB$1=0 2136const TOKEN$1=1 2137const OPEN_SYNTAX$1=2 2138const CLOSE_SYNTAX$1=3 2139const EXIT_REASON_MATCH$1="Match" 2140const EXIT_REASON_MISMATCH$1="Mismatch" 2141const EXIT_REASON_ITERATION_LIMIT$1="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)" 2142const ITERATION_LIMIT$1=15000 2143function reverseList$1(list){let prev=null 2144let next=null 2145let item=list 2146while(item!==null){next=item.prev 2147item.prev=prev 2148prev=item 2149item=next}return prev}function areStringsEqualCaseInsensitive$1(testStr,referenceStr){if(testStr.length!==referenceStr.length)return false 2150for(let i=0;i<testStr.length;i++){const referenceCode=referenceStr.charCodeAt(i) 2151let testCode=testStr.charCodeAt(i) 2152testCode>=0x0041&&testCode<=0x005A&&(testCode|=32) 2153if(testCode!==referenceCode)return false}return true}function isContextEdgeDelim$1(token){if(token.type!==Delim$1)return false 2154return token.value!=="?"}function isCommaContextStart$1(token){if(token===null)return true 2155return 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 2156return 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++ 2157token=tokenIndex<tokens.length?tokens[tokenIndex]:null}while(token!==null&&(token.type===WhiteSpace$3||token.type===Comment$3))}function getNextToken(offset){const nextIndex=tokenIndex+offset 2158return nextIndex<tokens.length?tokens[nextIndex]:null}function stateSnapshotFromSyntax(nextState,prev){return{nextState:nextState,matchStack:matchStack,syntaxStack:syntaxStack,thenStack:thenStack,tokenIndex:tokenIndex,prev:prev}}function pushThenStack(nextState){thenStack={nextState:nextState,matchStack:matchStack,syntaxStack:syntaxStack,prev:thenStack}}function pushElseStack(nextState){elseStack=stateSnapshotFromSyntax(nextState,elseStack)}function addTokenToMatch(){matchStack={type:TOKEN$1,syntax:state.syntax,token:token,prev:matchStack} 2159moveToNextToken() 2160syntaxStash=null 2161tokenIndex>longestMatch&&(longestMatch=tokenIndex)}function openSyntax(){syntaxStack={syntax:state.syntax,opts:state.syntax.opts||syntaxStack!==null&&syntaxStack.opts||null,prev:syntaxStack} 2162matchStack={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} 2163syntaxStack=syntaxStack.prev}let syntaxStack=null 2164let thenStack=null 2165let elseStack=null 2166let syntaxStash=null 2167let iterationCount=0 2168let exitReason=null 2169let token=null 2170let tokenIndex=-1 2171let longestMatch=0 2172let matchStack={type:STUB$1,syntax:null,token:null,prev:null} 2173moveToNextToken() 2174while(exitReason===null&&++iterationCount<ITERATION_LIMIT$1)switch(state.type){case"Match":if(thenStack===null){if(token!==null&&(tokenIndex!==tokens.length-1||token.value!=="\\0"&&token.value!=="\\9")){state=MISMATCH$1 2175break}exitReason=EXIT_REASON_MATCH$1 2176break}state=thenStack.nextState 2177if(state===DISALLOW_EMPTY$1){if(thenStack.matchStack===matchStack){state=MISMATCH$1 2178break}state=MATCH$1}while(thenStack.syntaxStack!==syntaxStack)closeSyntax() 2179thenStack=thenStack.prev 2180break 2181case"Mismatch":if(syntaxStash!==null&&syntaxStash!==false){if(elseStack===null||tokenIndex>elseStack.tokenIndex){elseStack=syntaxStash 2182syntaxStash=false}}else if(elseStack===null){exitReason=EXIT_REASON_MISMATCH$1 2183break}state=elseStack.nextState 2184thenStack=elseStack.thenStack 2185syntaxStack=elseStack.syntaxStack 2186matchStack=elseStack.matchStack 2187tokenIndex=elseStack.tokenIndex 2188token=tokenIndex<tokens.length?tokens[tokenIndex]:null 2189elseStack=elseStack.prev 2190break 2191case"MatchGraph":state=state.match 2192break 2193case"If":state.else!==MISMATCH$1&&pushElseStack(state.else) 2194state.then!==MATCH$1&&pushThenStack(state.then) 2195state=state.match 2196break 2197case"MatchOnce":state={type:"MatchOnceBuffer",syntax:state,index:0,mask:0} 2198break 2199case"MatchOnceBuffer":{const terms=state.syntax.terms 2200if(state.index===terms.length){if(state.mask===0||state.syntax.all){state=MISMATCH$1 2201break}state=MATCH$1 2202break}if(state.mask===(1<<terms.length)-1){state=MATCH$1 2203break}for(;state.index<terms.length;state.index++){const matchFlag=1<<state.index 2204if((state.mask&matchFlag)===0){pushElseStack(state) 2205pushThenStack({type:"AddMatchOnce",syntax:state.syntax,mask:state.mask|matchFlag}) 2206state=terms[state.index++] 2207break}}break}case"AddMatchOnce":state={type:"MatchOnceBuffer",syntax:state.syntax,index:0,mask:state.mask} 2208break 2209case"Enum":if(token!==null){let name=token.value.toLowerCase() 2210name.indexOf("\\")!==-1&&(name=name.replace(/\\[09].*$/,"")) 2211if(hasOwnProperty$a.call(state.map,name)){state=state.map[name] 2212break}}state=MISMATCH$1 2213break 2214case"Generic":{const opts=syntaxStack!==null?syntaxStack.opts:null 2215const lastTokenIndex=tokenIndex+Math.floor(state.fn(token,getNextToken,opts)) 2216if(!isNaN(lastTokenIndex)&&lastTokenIndex>tokenIndex){while(tokenIndex<lastTokenIndex)addTokenToMatch() 2217state=MATCH$1}else state=MISMATCH$1 2218break}case"Type":case"Property":{const syntaxDict=state.type==="Type"?"types":"properties" 2219const dictSyntax=hasOwnProperty$a.call(syntaxes,syntaxDict)?syntaxes[syntaxDict][state.name]:null 2220if(!dictSyntax||!dictSyntax.match)throw new Error("Bad syntax reference: "+(state.type==="Type"?"<"+state.name+">":"<'"+state.name+"'>")) 2221if(syntaxStash!==false&&token!==null&&state.type==="Type"){const lowPriorityMatching=state.name==="custom-ident"&&token.type===Ident$1||state.name==="length"&&token.value==="0" 2222if(lowPriorityMatching){syntaxStash===null&&(syntaxStash=stateSnapshotFromSyntax(state,elseStack)) 2223state=MISMATCH$1 2224break}}openSyntax() 2225state=dictSyntax.matchRef||dictSyntax.match 2226break}case"Keyword":{const name=state.name 2227if(token!==null){let keywordName=token.value 2228keywordName.indexOf("\\")!==-1&&(keywordName=keywordName.replace(/\\[09].*$/,"")) 2229if(areStringsEqualCaseInsensitive$1(keywordName,name)){addTokenToMatch() 2230state=MATCH$1 2231break}}state=MISMATCH$1 2232break}case"AtKeyword":case"Function":if(token!==null&&areStringsEqualCaseInsensitive$1(token.value,state.name)){addTokenToMatch() 2233state=MATCH$1 2234break}state=MISMATCH$1 2235break 2236case"Token":if(token!==null&&token.value===state.value){addTokenToMatch() 2237state=MATCH$1 2238break}state=MISMATCH$1 2239break 2240case"Comma":if(token!==null&&token.type===Comma$1)if(isCommaContextStart$1(matchStack.token))state=MISMATCH$1 2241else{addTokenToMatch() 2242state=isCommaContextEnd$1(token)?MISMATCH$1:MATCH$1}else state=isCommaContextStart$1(matchStack.token)||isCommaContextEnd$1(token)?MATCH$1:MISMATCH$1 2243break 2244case"String":let string="" 2245let lastTokenIndex=tokenIndex 2246for(;lastTokenIndex<tokens.length&&string.length<state.value.length;lastTokenIndex++)string+=tokens[lastTokenIndex].value 2247if(areStringsEqualCaseInsensitive$1(string,state.value)){while(tokenIndex<lastTokenIndex)addTokenToMatch() 2248state=MATCH$1}else state=MISMATCH$1 2249break 2250default:throw new Error("Unknown node type: "+state.type)}switch(exitReason){case null:console.warn("[csstree-match] BREAK after "+ITERATION_LIMIT$1+" iterations") 2251exitReason=EXIT_REASON_ITERATION_LIMIT$1 2252matchStack=null 2253break 2254case EXIT_REASON_MATCH$1:while(syntaxStack!==null)closeSyntax() 2255break 2256default:matchStack=null}return{tokens:tokens,reason:exitReason,iterations:iterationCount,match:matchStack,longestMatch:longestMatch}}function matchAsTree$1(tokens,matchGraph,syntaxes){const matchResult=internalMatch$1(tokens,matchGraph,syntaxes||{}) 2257if(matchResult.match===null)return matchResult 2258let item=matchResult.match 2259let host=matchResult.match={syntax:matchGraph.syntax||null,match:[]} 2260const hostStack=[host] 2261item=reverseList$1(item).prev 2262while(item!==null){switch(item.type){case OPEN_SYNTAX$1:host.match.push(host={syntax:item.syntax,match:[]}) 2263hostStack.push(host) 2264break 2265case CLOSE_SYNTAX$1:hostStack.pop() 2266host=hostStack[hostStack.length-1] 2267break 2268default:host.match.push({syntax:item.syntax||null,token:item.token.value,node:item.token.node})}item=item.prev}return matchResult}function getTrace$1(node){function shouldPutToTrace(syntax){if(syntax===null)return false 2269return syntax.type==="Type"||syntax.type==="Property"||syntax.type==="Keyword"}function hasMatch(matchNode){if(Array.isArray(matchNode.match)){for(let i=0;i<matchNode.match.length;i++)if(hasMatch(matchNode.match[i])){shouldPutToTrace(matchNode.syntax)&&result.unshift(matchNode.syntax) 2270return true}}else if(matchNode.node===node){result=shouldPutToTrace(matchNode.syntax)?[matchNode.syntax]:[] 2271return true}return false}let result=null 2272this.matched!==null&&hasMatch(this.matched) 2273return result}function isType$1(node,type){return testNode$1(this,node,(match=>match.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) 2274if(trace===null)return false 2275return trace.some(fn)}var trace$1=Object.freeze({__proto__:null,getTrace:getTrace$1,isKeyword:isKeyword$1,isProperty:isProperty$1,isType:isType$1}) 2276function getFirstMatchNode$1(matchNode){if("node"in matchNode)return matchNode.node 2277return getFirstMatchNode$1(matchNode.match[0])}function getLastMatchNode$1(matchNode){if("node"in matchNode)return matchNode.node 2278return 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) 2279const end=getLastMatchNode$1(matchNode) 2280lexer.syntax.walk(ast,(function(node,item,list){if(node===start){const nodes=new List$1 2281do{nodes.appendData(item.data) 2282if(item.data===end)break 2283item=item.next}while(item!==null) 2284fragments.push({parent:list,nodes:nodes})}}))}Array.isArray(matchNode.match)&&matchNode.match.forEach(findFragments)}const fragments=[] 2285match.matched!==null&&findFragments(match.matched) 2286return fragments}const{hasOwnProperty:hasOwnProperty$9}=Object.prototype 2287function 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") 2288for(let key in node){let valid=true 2289if(hasOwnProperty$9.call(node,key)===false)continue 2290if(key==="type")node.type!==type&&warn(node,"Wrong node type `"+node.type+"`, expected `"+type+"`") 2291else if(key==="loc"){if(node.loc===null)continue 2292if(node.loc&&node.loc.constructor===Object)if(typeof node.loc.source!=="string")key+=".source" 2293else if(isValidLocation$1(node.loc.start)){if(isValidLocation$1(node.loc.end))continue 2294key+=".end"}else key+=".start" 2295valid=false}else if(fields.hasOwnProperty(key)){valid=false 2296for(let i=0;!valid&&i<fields[key].length;i++){const fieldType=fields[key][i] 2297switch(fieldType){case String:valid=typeof node[key]==="string" 2298break 2299case Boolean:valid=typeof node[key]==="boolean" 2300break 2301case null:valid=node[key]===null 2302break 2303default:typeof fieldType==="string"?valid=node[key]&&node[key].type===fieldType:Array.isArray(fieldType)&&(valid=node[key]instanceof List$1)}}}else warn(node,"Unknown field `"+key+"` for "+type+" node type") 2304valid||warn(node,"Bad value for `"+type+"."+key+"`")}for(const key in fields)hasOwnProperty$9.call(fields,key)&&hasOwnProperty$9.call(node,key)===false&&warn(node,"Field `"+type+"."+key+"` is missed")}}function genTypesList(fieldTypes,path){const docsTypes=[] 2305for(let i=0;i<fieldTypes.length;i++){const fieldType=fieldTypes[i] 2306if(fieldType===String||fieldType===Boolean)docsTypes.push(fieldType.name.toLowerCase()) 2307else if(fieldType===null)docsTypes.push("null") 2308else if(typeof fieldType==="string")docsTypes.push(fieldType) 2309else{if(!Array.isArray(fieldType))throw new Error("Wrong value `"+fieldType+"` in `"+path+"` structure definition") 2310docsTypes.push("List<"+(genTypesList(fieldType,path)||"any")+">")}}return docsTypes.join(" | ")}function processStructure$1(name,nodeType){const structure=nodeType.structure 2311const fields={type:String,loc:true} 2312const docs={type:'"'+name+'"'} 2313for(const key in structure){if(hasOwnProperty$9.call(structure,key)===false)continue 2314const fieldTypes=fields[key]=Array.isArray(structure[key])?structure[key].slice():[structure[key]] 2315docs[key]=genTypesList(fieldTypes,name+"."+key)}return{docs:docs,check:createNodeStructureChecker$1(name,fields)}}function getStructureFromConfig$1(config){const structure={} 2316if(config.node)for(const name in config.node)if(hasOwnProperty$9.call(config.node,name)){const nodeType=config.node[name] 2317if(!nodeType.structure)throw new Error("Missed `structure` field in `"+name+"` node type definition") 2318structure[name]=processStructure$1(name,nodeType)}return structure}function dumpMapSyntax$1(map,compact,syntaxAsAst){const result={} 2319for(const name in map)map[name].syntax&&(result[name]=syntaxAsAst?map[name].syntax:generate$1u(map[name].syntax,{compact:compact})) 2320return result}function dumpAtruleMapSyntax$1(map,compact,syntaxAsAst){const result={} 2321for(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)} 2322return result}function valueHasVar$1(tokens){for(let i=0;i<tokens.length;i++)if(tokens[i].value.toLowerCase()==="var(")return true 2323return false}function syntaxHasTopLevelCommaMultiplier(syntax){const singleTerm=syntax.terms[0] 2324return syntax.explicit===false&&syntax.terms.length===1&&singleTerm.type==="Multiplier"&&singleTerm.comma===true}function buildMatchResult$1(matched,error,iterations){return{matched:matched,iterations:iterations,error:error,...trace$1}}function matchSyntax$1(lexer,syntax,value,useCssWideKeywords){const tokens=prepareTokens$1(value,lexer.syntax) 2325let result 2326if(valueHasVar$1(tokens))return buildMatchResult$1(null,new Error("Matching for a tree with var() is not supported")) 2327useCssWideKeywords&&(result=matchAsTree$1(tokens,lexer.cssWideKeywordsSyntax,lexer)) 2328if(!useCssWideKeywords||!result.match){result=matchAsTree$1(tokens,syntax.match,lexer) 2329if(!result.match)return buildMatchResult$1(null,new SyntaxMatchError$1(result.reason,syntax.syntax,value,result),result.iterations)}return buildMatchResult$1(result.match,null,result.iterations)}let Lexer$1=class Lexer{constructor(config,syntax,structure){this.cssWideKeywords=cssWideKeywords$1 2330this.syntax=syntax 2331this.generic=false 2332this.units={...units} 2333this.atrules=Object.create(null) 2334this.properties=Object.create(null) 2335this.types=Object.create(null) 2336this.structure=structure||getStructureFromConfig$1(config) 2337if(config){config.cssWideKeywords&&(this.cssWideKeywords=config.cssWideKeywords) 2338if(config.units)for(const group of Object.keys(units))Array.isArray(config.units[group])&&(this.units[group]=config.units[group]) 2339if(config.types)for(const[name,type]of Object.entries(config.types))this.addType_(name,type) 2340if(config.generic){this.generic=true 2341for(const[name,value]of Object.entries(createGenericTypes(this.units)))this.addType_(name,value)}if(config.atrules)for(const[name,atrule]of Object.entries(config.atrules))this.addAtrule_(name,atrule) 2342if(config.properties)for(const[name,property]of Object.entries(config.properties))this.addProperty_(name,property)}this.cssWideKeywordsSyntax=buildMatchGraph$1(this.cssWideKeywords.join(" | "))}checkStructure(ast){function collectWarning(node,message){warns.push({node:node,message:message})}const structure=this.structure 2343const warns=[] 2344this.syntax.walk(ast,(function(node){structure.hasOwnProperty(node.type)?structure[node.type].check(node,collectWarning):collectWarning(node,"Unknown node type `"+node.type+"`")})) 2345return!!warns.length&&warns}createDescriptor(syntax,type,name,parent=null){const ref={type:type,name:name} 2346const descriptor={type:type,name:name,parent:parent,serializable:typeof syntax==="string"||syntax&&typeof syntax.type==="string",syntax:null,match:null,matchRef:null} 2347if(typeof syntax==="function")descriptor.match=buildMatchGraph$1(syntax,ref) 2348else{typeof syntax==="string"?Object.defineProperty(descriptor,"syntax",{get(){Object.defineProperty(descriptor,"syntax",{value:parse$1u(syntax)}) 2349return descriptor.syntax}}):descriptor.syntax=syntax 2350Object.defineProperty(descriptor,"match",{get(){Object.defineProperty(descriptor,"match",{value:buildMatchGraph$1(descriptor.syntax,ref)}) 2351return descriptor.match}}) 2352type==="Property"&&Object.defineProperty(descriptor,"matchRef",{get(){const syntax=descriptor.syntax 2353const value=syntaxHasTopLevelCommaMultiplier(syntax)?buildMatchGraph$1({...syntax,terms:[syntax.terms[0].term]},ref):null 2354Object.defineProperty(descriptor,"matchRef",{value:value}) 2355return value}})}return descriptor}addAtrule_(name,syntax){if(!syntax)return 2356this.atrules[name]={type:"Atrule",name:name,prelude:syntax.prelude?this.createDescriptor(syntax.prelude,"AtrulePrelude",name):null,descriptors:syntax.descriptors?Object.keys(syntax.descriptors).reduce(((map,descName)=>{map[descName]=this.createDescriptor(syntax.descriptors[descName],"AtruleDescriptor",descName,name) 2357return map}),Object.create(null)):null}}addProperty_(name,syntax){if(!syntax)return 2358this.properties[name]=this.createDescriptor(syntax,"Property",name)}addType_(name,syntax){if(!syntax)return 2359this.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) 2360if(error)return error 2361const atrule=this.getAtrule(atruleName) 2362if(!atrule.prelude&&prelude)return new SyntaxError("At-rule `@"+atruleName+"` should not contain a prelude") 2363if(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) 2364if(error)return error 2365const atrule=this.getAtrule(atruleName) 2366const descriptor=keyword$1(descriptorName) 2367if(!atrule.descriptors)return new SyntaxError("At-rule `@"+atruleName+"` has no known descriptors") 2368if(!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) 2369if(error)return buildMatchResult$1(null,error) 2370const atrule=this.getAtrule(atruleName) 2371if(!atrule.prelude)return buildMatchResult$1(null,null) 2372return matchSyntax$1(this,atrule.prelude,prelude||"",false)}matchAtruleDescriptor(atruleName,descriptorName,value){const error=this.checkAtruleDescriptorName(atruleName,descriptorName) 2373if(error)return buildMatchResult$1(null,error) 2374const atrule=this.getAtrule(atruleName) 2375const descriptor=keyword$1(descriptorName) 2376return 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")) 2377return 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")) 2378const error=this.checkPropertyName(propertyName) 2379if(error)return buildMatchResult$1(null,error) 2380return matchSyntax$1(this,this.getProperty(propertyName),value,true)}matchType(typeName,value){const typeSyntax=this.getType(typeName) 2381if(!typeSyntax)return buildMatchResult$1(null,new SyntaxReferenceError$1("Unknown type",typeName)) 2382return 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")) 2383typeof syntax!=="string"&&syntax.match||(syntax=this.createDescriptor(syntax,"Type","anonymous")) 2384return 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=[] 2385this.syntax.walk(ast,{visit:"Declaration",enter:declaration=>{result.push.apply(result,this.findDeclarationValueFragments(declaration,type,name))}}) 2386return result}getAtrule(atruleName,fallbackBasename=true){const atrule=keyword$1(atruleName) 2387const atruleEntry=atrule.vendor&&fallbackBasename?this.atrules[atrule.name]||this.atrules[atrule.basename]:this.atrules[atrule.name] 2388return atruleEntry||null}getAtrulePrelude(atruleName,fallbackBasename=true){const atrule=this.getAtrule(atruleName,fallbackBasename) 2389return 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) 2390const propertyEntry=property.vendor&&fallbackBasename?this.properties[property.name]||this.properties[property.basename]:this.properties[property.name] 2391return 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) 2392broken.set(name,false) 2393descriptor.syntax!==null&&walk$4(descriptor.syntax,(function(node){if(node.type!=="Type"&&node.type!=="Property")return 2394const map=node.type==="Type"?syntax.types:syntax.properties 2395const brokenMap=node.type==="Type"?brokenTypes:brokenProperties 2396if(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")}`) 2397broken.set(name,true)}}else{errors.push(`${syntaxRef(name,broken===brokenTypes)} used missed syntax definition ${syntaxRef(node.name,node.type==="Type")}`) 2398broken.set(name,true)}}),this)}const errors=[] 2399let brokenTypes=new Map 2400let brokenProperties=new Map 2401for(const key in this.types)validate(this,key,brokenTypes,this.types[key]) 2402for(const key in this.properties)validate(this,key,brokenProperties,this.properties[key]) 2403const brokenTypesArray=[...brokenTypes.keys()].filter((name=>brokenTypes.get(name))) 2404const brokenPropertiesArray=[...brokenProperties.keys()].filter((name=>brokenProperties.get(name))) 2405if(brokenTypesArray.length||brokenPropertiesArray.length)return{errors:errors,types:brokenTypesArray,properties:brokenPropertiesArray} 2406return 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())}} 2407function appendOrSet(a,b){if(typeof b==="string"&&/^\s*\|/.test(b))return typeof a==="string"?a+b:b.replace(/^\s*\|\s*/,"") 2408return b||null}function sliceProps(obj,props){const result=Object.create(null) 2409for(const[key,value]of Object.entries(obj))if(value){result[key]={} 2410for(const prop of Object.keys(value))props.includes(prop)&&(result[key][prop]=value[prop])}return result}function mix$2(dest,src){const result={...dest} 2411for(const[prop,value]of Object.entries(src))switch(prop){case"generic":result[prop]=Boolean(value) 2412break 2413case"cssWideKeywords":result[prop]=dest[prop]?[...dest[prop],...value]:value||[] 2414break 2415case"units":result[prop]={...dest[prop]} 2416for(const[name,patch]of Object.entries(value))result[prop][name]=Array.isArray(patch)?patch:[] 2417break 2418case"atrules":result[prop]={...dest[prop]} 2419for(const[name,atrule]of Object.entries(value)){const exists=result[prop][name]||{} 2420const current=result[prop][name]={prelude:exists.prelude||null,descriptors:{...exists.descriptors}} 2421if(!atrule)continue 2422current.prelude=atrule.prelude?appendOrSet(current.prelude,atrule.prelude):current.prelude||null 2423for(const[descriptorName,descriptorValue]of Object.entries(atrule.descriptors||{}))current.descriptors[descriptorName]=descriptorValue?appendOrSet(current.descriptors[descriptorName],descriptorValue):null 2424Object.keys(current.descriptors).length||(current.descriptors=null)}break 2425case"types":case"properties":result[prop]={...dest[prop]} 2426for(const[name,syntax]of Object.entries(value))result[prop][name]=appendOrSet(result[prop][name],syntax) 2427break 2428case"scope":case"features":result[prop]={...dest[prop]} 2429for(const[name,props]of Object.entries(value))result[prop][name]={...result[prop][name],...props} 2430break 2431case"parseContext":result[prop]={...dest[prop],...value} 2432break 2433case"atrule":case"pseudo":result[prop]={...dest[prop],...sliceProps(value,["parse"])} 2434break
2435case"node":result[prop]={...dest[prop],...sliceProps(value,["name","structure","parse","generate","walkContext"])} 2436break}return result}function createSyntax$2(config){const parse=createParser$1(config) 2437const walk=createWalker$1(config) 2438const generate=createGenerator$1(config) 2439const{fromPlainObject:fromPlainObject,toPlainObject:toPlainObject}=createConvertor$1(walk) 2440const 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) 2441return createSyntax$2(typeof extension==="function"?extension(base):mix$2(base,extension))}} 2442syntax.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) 2443return syntax}var createSyntax$3=config=>createSyntax$2(mix$2({},config)) 2444var 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( <calc-sum> )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( <calc-sum> )","alpha-value":"<number>|<percentage>","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>","angular-color-stop":"<color>&&<color-stop-angle>?","angular-color-stop-list":"[<angular-color-stop> [, <angular-color-hint>]?]# , <angular-color-stop>","animateable-feature":"scroll-position|contents|<custom-ident>","asin()":"asin( <calc-sum> )","atan()":"atan( <calc-sum> )","atan2()":"atan2( <calc-sum> , <calc-sum> )",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <type-or-unit>? [, <attr-fallback>]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?",axis:"block|inline|vertical|horizontal","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<xywh()>|<rect()>|<circle()>|<ellipse()>|<polygon()>|<path()>","bg-image":"none|<image>","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage>|auto]{1,2}|cover|contain","blur()":"blur( <length> )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( <number-percentage> )","calc()":"calc( <calc-sum> )","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-value":"<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )","calc-constant":"e|pi|infinity|-infinity|NaN","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( [<shape-radius>]? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<color-base>|currentColor|<system-color>|<device-cmyk()>|<light-dark()>|<-non-standard-color>","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"<angle-percentage>{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"[<linear-color-stop> [, <linear-color-hint>]?]# , <linear-color-stop>","color-interpolation-method":"in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]",combinator:"'>'|'+'|'~'|['|' '|']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>*]!","compound-selector-list":"<compound-selector>#","complex-selector":"<complex-selector-unit> [<combinator>? <complex-selector-unit>]*","complex-selector-list":"<complex-selector>#","conic-gradient()":"conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contrast()":"contrast( [<number-percentage>
2444] )","cos()":"cos( <calc-sum> )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( <length>{2,3} <color>? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( [<shape-radius>{2}]? [at <position>]? )","ending-shape":"circle|ellipse","env()":"env( <custom-ident> , <declaration-value>? )","exp()":"exp( <calc-sum> )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","fill-rule":"nonzero|evenodd","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-function-list":"[<filter-function>|<url>]+","final-bg-layer":"<'background-color'>||<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,â]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|<number [1,1000]>","frequency-percentage":"<frequency>|<percentage>","general-enclosed":"[<function-token> <any-value>? )]|[( <any-value>? )]","generic-family":"<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( <number-percentage> )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )","hsla()":"hsla( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )",hue:"<number>|<angle>","hue-rotate()":"hue-rotate( <angle> )","hue-interpolation-method":"[shorter|longer|increasing|decreasing] hue","hwb()":"hwb( [<hue>|none] [<percentage>|none] [<percentage>|none] [/ [<alpha-value>|none]]? )","hypot()":"hypot( <calc-sum># )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length-percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( <number-percentage> )","keyframes-name":"<custom-ident>|<string>","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-block-list":"<keyframe-block>+","keyframe-selector":"from|to|<percentage>|<timeline-range-name> <percentage>","lab()":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","lch()":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","light-dark()":"light-dark( <color> , <color> )","line-names":"'[' <custom-ident>* ']'","line-name-list":"[<line-names>|<name-repeat>]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-gradient()":"linear-gradient( [[<angle>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list> )","log()":"log( <calc-sum> , <calc-sum>? )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>
2444#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )","mod()":"mod( <calc-sum> , <calc-sum> )","name-repeat":"repeat( [<integer [1,â]>|auto-fill] , <line-names>+ )","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":"<ident>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"<an-plus-b>|even|odd","opacity()":"opacity( [<number-percentage>] )","overflow-position":"unsafe|safe","outline-radius":"<length>|<percentage>","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[<page-selector>#]?","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [<fill-rule> ,]? <string> )","paint()":"paint( <ident> , <declaration-value>? )","perspective()":"perspective( [<length [0,â]>|none] )","polygon()":"polygon( <fill-rule>? , [<length-percentage> <length-percentage>]# )","polar-color-space":"hsl|hwb|lch|oklch",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","pow()":"pow( <calc-sum> , <calc-sum> )","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>|<legacy-pseudo-element-selector>","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )",ratio:"<number [0,â]> [/ <number [0,â]>]?","ray()":"ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )","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":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","rem()":"rem( <calc-sum> , <calc-sum> )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","repeating-linear-gradient()":"repeating-linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","repeating-radial-gradient()":"repeating-radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","reversed-counter-name":"reversed( <counter-name> )","rgb()":"rgb( <percentage>{3} [/ <alpha-value>]? )|rgb( <number>{3} [/ <alpha-value>]? )|rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )","rgba()":"rgba( <percentage>{3} [/ <alpha-value>]? )|rgba( <number>{3} [/ <alpha-value>]? )|rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","round()":"round( <rounding-strategy>? , <calc-sum> , <calc-sum> )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( <number-percentage> )","scale()":"scale( [<number>|<percentage>]#{1,2} )","scale3d()":"scale3d( [<number>|<percentage>]#{3} )","scaleX()":"scaleX( [<number>|<percentage>] )","scaleY()":"scaleY( [<number>|<percentage>] )","scaleZ()":"scaleZ( [<number>|<percentage>] )","scroll()":"scroll( [<axis>||<scroller>]? )",scroller:"root|nearest","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"<length-percentage>|closest-side|farthest-side","sign()":"sign( <calc-sum> )","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>
2444]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sepia()":"sepia( <number-percentage> )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","sin()":"sin( <calc-sum> )","single-animation":"<'animation-duration'>||<easing-function>||<'animation-delay'>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]||<single-animation-timeline>","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<dashed-ident>|<scroll()>|<view()>","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>||<transition-behavior-value>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","sqrt()":"sqrt( <calc-sum> )","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-timing-function":"step-start|step-end|steps( <integer> [, <step-position>]? )","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-decl":"( <declaration> )","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>","tan()":"tan( <calc-sum> )",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","time-percentage":"<time>|<percentage>","timeline-range-name":"cover|contain|entry|exit|entry-crossing|exit-crossing","easing-function":"linear|<cubic-bezier-timing-function>|<step-timing-function>","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,â]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( <length-percentage> )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","transition-behavior-value":"normal|allow-discrete","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","view()":"view( [<axis>||<'view-timeline-inset'>]? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"overlay|-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-size":"intrinsic|min-intrinsic|-webkit-fill-available|-webkit-fit-content|-webkit-min-content|-webkit-max-content|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point>
2444 [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )","absolute-color-base":"<hex-color>|<absolute-color-function>|<named-color>|transparent","absolute-color-function":"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<color()>",age:"child|young|old","anchor-name":"<dashed-ident>","attr-name":"<wq-name>","attr-fallback":"<any-value>","bg-clip":"<box>|border|text",bottom:"<length>|auto","container-name":"<custom-ident>","container-condition":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","coord-box":"content-box|padding-box|border-box|fill-box|stroke-box|view-box","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","generic-script-specific":"generic( kai )|generic( fangsong )|generic( nastaliq )","generic-complete":"serif|sans-serif|system-ui|cursive|fantasy|math|monospace","generic-incomplete":"ui-serif|ui-sans-serif|ui-monospace|ui-rounded","-non-standard-generic-family":"-apple-system|BlinkMacSystemFont",left:"<length>|auto","color-base":"<hex-color>|<color-function>|<named-color>|<color-mix()>|transparent","color-function":"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<color()>","system-color":"AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText","device-cmyk()":"<legacy-device-cmyk-syntax>|<modern-device-cmyk-syntax>","legacy-device-cmyk-syntax":"device-cmyk( <number>#{4} )","modern-device-cmyk-syntax":"device-cmyk( <cmyk-component>{4} [/ [<alpha-value>|none]]? )","cmyk-component":"<number>|<percentage>|none","color-mix()":"color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )","color-space":"<rectangular-color-space>|<polar-color-space>|<custom-color-space>","custom-color-space":"<dashed-ident>",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke","palette-identifier":"<dashed-ident>",right:"<length>|auto","scope-start":"<forgiving-selector-list>","scope-end":"<forgiving-selector-list>","forgiving-selector-list":"<complex-real-selector-list>","forgiving-relative-selector-list":"<relative-real-selector-list>","selector-list":"<complex-selector-list>","complex-real-selector-list":"<complex-real-selector>#","simple-selector-list":"<simple-selector>#","relative-real-selector-list":"<relative-real-selector>#","complex-selector-unit":"[<compound-selector>? <pseudo-compound-selector>*]!","complex-real-selector":"<compound-selector> [<combinator>? <compound-selector>]*","relative-real-selector":"<combinator>? <complex-real-selector>","pseudo-compound-selector":"<pseudo-element-selector> <pseudo-class-selector>*","simple-selector":"<type-selector>|<subclass-selector>","legacy-pseudo-element-selector":"':' [before|after|first-line|first-letter]","single-animation-composition":"replace|add|accumulate","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,â]>","color()":"color( <colorspace-params> [/ [<alpha-value>|none]]? )","colorspace-params":"[<predefined-rgb-params>|<xyz-params>]","predefined-rgb-params":"<predefined-rgb> [<number>|<percentage>|none]{3}","predefined-rgb":"srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020","xyz-params":"<xyz-space> [<number>|<percentage>|none]{3}","xyz-space":"xyz|xyz-d50|xyz-d65","oklab()":"oklab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","oklch()":"oklch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","offset-path":"<ray()>|<url>|<basic-shape>","rect()":"rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )","xywh()":"xywh( <length-percentage>{2} <length-percentage [0,â]>{2} [round <'border-radius'>]? )","query-in-parens":"( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>","size-feature":"<mf-plain>|<mf-boolean>|<mf-range>","style-feature":"<declaration>","style-query":"<style-condition>|<style-feature>","style-condition":"not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]","style-in-parens":"( <style-condition> )|( <style-feature> )|<general-enclosed>","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box","inset-
2444area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]","position-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|center|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|center|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]","anchor()":"anchor( <anchor-element>?&&<anchor-side> , <length-percentage>? )","anchor-side":"inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center","anchor-size()":"anchor-size( [<anchor-element>||<anchor-size>]? , <length-percentage>? )","anchor-size":"width|height|block|inline|self-block|self-inline","anchor-element":"<dashed-ident>","try-size":"most-width|most-height|most-block-size|most-inline-size","try-tactic":"flip-block||flip-inline||flip-start","font-variant-css2":"normal|small-caps","font-width-css3":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","system-family-name":"caption|icon|menu|message-box|small-caption|status-bar
vendor: 8,529 bytes, line 2444
2444"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zooming":"none|zoom","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-image-region":"<shape>|auto","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<color>","-webkit-border-before-color":"<color>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<box>|border|padding|content|text]||[<box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<box>|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",all:"initial|inherit|unset|revert|revert-layer",
2444"anchor-name":"none|<dashed-ident>#","anchor-scope":"none|all|<dashed-ident>#",animation:"<single-animation>#","animation-composition":"<single-animation-composition>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"<time>#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-range":"[<'animation-range-start'> <'animation-range-end'>?]#","animation-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-timing-function":"<easing-function>#","animation-timeline":"<single-animation-timeline>#",appearance:"none|auto|textfield|menulist-button|<compat-auto>","aspect-ratio":"auto||<ratio>",azimuth:"<angle>|[[left-side|far-left|left|center-left|center|center-right|right|far-right|right-side]||behind]|leftwards|rightwards","backdrop-filter":"none|<filter-function-list>","backface-visibility":"visible|hidden",background:"[<bg-layer> ,]* <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-color":"<'border-top-color'>{1,2}","border-block-style":"<'border-top-style'>","border-block-width":"<'border-top-width'>","border-block-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage>{1,2}","border-bottom-right-radius":"<length-percentage>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"collapse|separate","border-color":"<color>{1,4}","border-end-end-radius":"<length-percentage>{1,2}","border-end-start-radius":"<length-percentage>{1,2}","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length>|<number>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"<number-percentage>{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage>|<number>|auto]{1,4}","border-inline":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-style":"<'border-top-style'>","border-inline-width":"<'border-top-width'>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage>{1,4} [/ <length-percentage>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length> <length>?","border-start-end-radius":"<length-percentage>{1,2}","border-start-start-radius":"<length-percentage>{1,2}","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage>{1,2}","border-top-right-radius":"<length-percentage>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"<length>|<percentage>|auto","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-p
2444age|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom|block-start|block-end|inline-start|inline-end",caret:"<'caret-color'>||<'caret-shape'>","caret-color":"auto|<color>","caret-shape":"auto|bar|block|underscore",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none","clip-rule":"nonzero|evenodd",color:"<color>","color-interpolation-filters":"auto|sRGB|linearRGB","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance","column-gap":"normal|<length-percentage>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"<length>|auto",columns:"<'column-width'>||<'column-count'>",contain:"none|strict|content|[[size||inline-size]||layout||style||paint]","contain-intrinsic-size":"[auto? [none|<length>]]{1,2}","contain-intrinsic-block-size":"auto? [none|<length>]","contain-intrinsic-height":"auto? [none|<length>]","contain-intrinsic-inline-size":"auto? [none|<length>]","contain-intrinsic-width":"auto? [none|<length>]",container:"<'container-name'> [/ <'container-type'>]?","container-name":"none|<custom-ident>+","container-type":"normal||[size|inline-size]",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>]+]?","content-visibility":"visible|auto|hidden","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",d:"none|path( <string> )",cx:"<length>|<percentage>",cy:"<length>|<percentage>",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge","empty-cells":"show|hide","field-sizing":"content|fixed",fill:"<paint>","fill-opacity":"<number-zero-one>","fill-rule":"nonzero|evenodd",filter:"none|<filter-function-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end",font:"[[<'font-style'>||<font-variant-css2>||<'font-weight'>||<font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'>#]|<system-family-name>|<-non-standard-font>","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-palette":"normal|light|dark|<palette-identifier>","font-variation-settings":"normal|[<string> <number>]#","font-size":"<absolute-size>|<relative-size>|<length-percentage>","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps||position]","font-synthesis-position":"auto|none","font-synthesis-small-caps":"auto|none","font-synthesis-style":"auto|none","font-synthesis-weight":"auto|none","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-emoji":"normal|text|emoji|unicode","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-weight":"<font-we
2444ight-absolute>|bolder|lighter","forced-color-adjust":"auto|none",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","hyphenate-character":"auto|<string>","hyphenate-limit-chars":"[auto|<integer>]{1,3}",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>","input-security":"auto|none",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>","interpolate-size":"numeric-only|allow-keywords",isolation:"auto|isolate","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"<length>|<percentage>|auto","letter-spacing":"normal|<length-percentage>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"[<length>|<percentage>|auto]{1,4}","margin-block":"<'margin-left'>{1,2}","margin-block-end":"<'margin-left'>","margin-block-start":"<'margin-left'>","margin-bottom":"<length>|<percentage>|auto","margin-inline":"<'margin-left'>{1,2}","margin-inline-end":"<'margin-left'>","margin-inline-start":"<'margin-left'>","margin-left":"<length>|<percentage>|auto","margin-right":"<length>|<percentage>|auto","margin-top":"<length>|<percentage>|auto","margin-trim":"none|in-flow|all",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<geometry-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<geometry-box>
2444#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-depth":"auto-add|add( <integer> )|<integer>","math-shift":"normal|compact","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","min-block-size":"<'min-width'>","min-height":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","min-inline-size":"<'min-width'>","min-width":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","mix-blend-mode":"<blend-mode>|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|<offset-path>||<coord-box>","offset-position":"normal|auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<alpha-value>",order:"<integer>",orphans:"<integer>",outline:"[<'outline-width'>||<'outline-style'>||<'outline-color'>]","outline-color":"auto|<color>","outline-offset":"<length>","outline-style":"auto|<'border-style'>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,â]>","overflow-inline":"visible|hidden|clip|scroll|auto","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto","overflow-y":"visible|hidden|clip|scroll|auto",overlay:"none|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"[<length>|<percentage>]{1,4}","padding-block":"<'padding-left'>{1,2}","padding-block-end":"<'padding-left'>","padding-block-start":"<'padding-left'>","padding-bottom":"<length>|<percentage>","padding-inline":"<'padding-left'>{1,2}","padding-inline-end":"<'padding-left'>","padding-inline-start":"<'padding-left'>","padding-left":"<length>|<percentage>","padding-right":"<length>|<percentage>","padding-top":"<length>|<percentage>",page:"auto|<custom-ident>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky","position-anchor":"auto|<anchor-name>","position-area":"none|<position-area>","position-try":"<'position-try-order'>? <'position-try-fallbacks'>","position-try-fallbacks":"none|[[<dashed-ident>||<try-tactic>]|<'position-area'>]#","position-try-order":"normal|<try-size>","position-visibility":"always|[anchors-valid||anchors-visible||no-overflow]","print-color-adjust":"economy|exact",quotes:"none|auto|[<string> <string>]+",r:"<length>|<percentage>",resize:"none|both|horizontal|vertical|block|inline",right:"<length>|<percentage>|auto",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-position":"[alternate||[over|under]]|inter-character",rx:"<length>|<percentage>",ry:"<length>|<percentage>",scale:"none|<number>{1,3}","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","scroll-behavior":"auto|smooth","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}
2444","scroll-margin-block-start":"<length>","scroll-margin-block-end":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-start":"<length>","scroll-margin-inline-end":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","scroll-timeline":"[<'scroll-timeline-name'>||<'scroll-timeline-axis'>]#","scroll-timeline-axis":"[block|inline|x|y]#","scroll-timeline-name":"[none|<dashed-ident>]#","shape-image-threshold":"<alpha-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision",stroke:"<paint>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<'opacity'>","stroke-width":"<svg-length>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-anchor":"start|middle|end","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"auto|[over|under]&&[right|left]?","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-spacing-trim":"space-all|normal|space-first|trim-start|trim-both|trim-all|auto","text-transform":"none|capitalize|uppercase|lowercase|full-width|full-size-kana","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]","text-wrap":"<'text-wrap-mode'>||<'text-wrap-style'>","text-wrap-mode":"auto|wrap|nowrap","text-wrap-style":"auto|balance|stable|pretty","timeline-scope":"none|<dashed-ident>#",top:"<length>|<percentage>|auto","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-behavior":"<transition-behavior-value>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>
2444?]?","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|contain|all","vector-effect":"none|non-scaling-stroke|non-scaling-size|non-rotation|fixed-position","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>","view-timeline":"[<'view-timeline-name'> <'view-timeline-axis'>?]#","view-timeline-axis":"[block|inline|x|y]#","view-timeline-inset":"[[auto|<length-percentage>]{1,2}]#","view-timeline-name":"none|<dashed-ident>#","view-transition-name":"none|<custom-ident>",visibility:"visible|hidden|collapse","white-space":"normal|pre|nowrap|pre-wrap|pre-line|break-spaces|[<'white-space-collapse'>||<'text-wrap'>||<'white-space-trim'>]","white-space-collapse":"collapse|discard|preserve|preserve-breaks|preserve-spaces|break-spaces",widows:"<integer>",width:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word|auto-phrase","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>",x:"<length>|<percentage>",y:"<length>|<percentage>","z-index":"auto|<integer>",zoom:"normal|reset|<number>|<percentage>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto","-webkit-user-select":"auto|none|text|all","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical","baseline-shift":"baseline|sub|super|<svg-length>",behavior:"<url>+",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong",src:"[<url> [format( <string># )]?|local( <family-name> )]#",speak:"auto|never|always","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]","unicode-range":"<urange>#","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]","white-space-trim":"none|discard-before||discard-after||discard-inner"}
2444,atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-palette-values":{prelude:"<dashed-ident>",descriptors:{"base-palette":"light|dark|<integer [0,â]>","font-family":"<family-name>#","override-colors":"[<integer [0,â]> <absolute-color-base>]#"}},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"[auto|block|swap|fallback|optional]","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-variation-settings":"normal|[<string> <number>]#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-weight":"<font-weight-absolute>{1,2}","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]","page-orientation":"upright|rotate-left|rotate-right",size:"<length>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},"position-try":{prelude:"<dashed-ident>",descriptors:{top:"<'top'>",left:"<'left'>",bottom:"<'bottom'>",right:"<'right'>","inset-block-start":"<'inset-block-start'>","inset-block-end":"<'inset-block-end'>","inset-inline-start":"<'inset-inline-start'>","inset-inline-end":"<'inset-inline-end'>","inset-block":"<'inset-block'>","inset-inline":"<'inset-inline'>",inset:"<'inset'>","margin-top":"<'margin-top'>","margin-left":"<'margin-left'>","margin-bottom":"<'margin-bottom'>","margin-right":"<'margin-right'>","margin-block-start":"<'margin-block-start'>","margin-block-end":"<'margin-block-end'>","margin-inline-start":"<'margin-inline-start'>","margin-inline-end":"<'margin-inline-end'>",margin:"<'margin'>","margin-block":"<'margin-block'>","margin-inline":"<'margin-inline'>",width:"<'width'>",height:"<'height'>","min-width":"<'min-width'>","min-height":"<'min-height'>","max-width":"<'max-width'>","max-height":"<'max-height'>","block-size":"<'block-size'>","inline-size":"<'inline-size'>","min-block-size":"<'min-block-size'>","min-inline-size":"<'min-inline-size'>","max-block-size":"<'max-block-size'>","max-inline-size":"<'max-inline-size'>","align-self":"<'align-self'>|anchor-center","justify-self":"<'justify-self'>|anchor-center"}},property:{prelude:"<custom-property-name>",descriptors:{syntax:"<string>",inherits:"true|false","initial-value":"<declaration-value>?"}},scope:{prelude:"[( <scope-start> )]? [to ( <scope-end> )]?",descriptors:null},"starting-style":{prelude:null,descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},container:{prelude:"[<container-name>]? <container-condition>",descriptors:null},nest:{prelude:"<complex-selector-list>",descriptors:null
vendor: 10,297 bytes, lines 2444-2612
2444}}} 2445const PLUSSIGN$f=0x002B 2446const HYPHENMINUS$9=0x002D 2447const N$5=0x006E 2448const DISALLOW_SIGN$2=true 2449const ALLOW_SIGN$2=false 2450function checkInteger$2(offset,disallowSign){let pos=this.tokenStart+offset 2451const code=this.charCodeAt(pos) 2452if(code===PLUSSIGN$f||code===HYPHENMINUS$9){disallowSign&&this.error("Number sign is not allowed") 2453pos++}for(;pos<this.tokenEnd;pos++)isDigit$2(this.charCodeAt(pos))||this.error("Integer is expected",pos)}function checkTokenIsInteger$1(disallowSign){return checkInteger$2.call(this,0,disallowSign)}function expectCharCode$1(offset,code){if(!this.cmpChar(this.tokenStart+offset,code)){let msg="" 2454switch(code){case N$5:msg="N is expected" 2455break 2456case HYPHENMINUS$9:msg="HyphenMinus is expected" 2457break}this.error(msg,this.tokenStart+offset)}}function consumeB$2(){let offset=0 2458let sign=0 2459let type=this.tokenType 2460while(type===WhiteSpace$3||type===Comment$3)type=this.lookupType(++offset) 2461if(type!==Number$5){if(!this.isDelim(PLUSSIGN$f,offset)&&!this.isDelim(HYPHENMINUS$9,offset))return null 2462sign=this.isDelim(PLUSSIGN$f,offset)?PLUSSIGN$f:HYPHENMINUS$9 2463do{type=this.lookupType(++offset)}while(type===WhiteSpace$3||type===Comment$3) 2464if(type!==Number$5){this.skip(offset) 2465checkTokenIsInteger$1.call(this,DISALLOW_SIGN$2)}}offset>0&&this.skip(offset) 2466if(sign===0){type=this.charCodeAt(this.tokenStart) 2467type!==PLUSSIGN$f&&type!==HYPHENMINUS$9&&this.error("Number sign is expected")}checkTokenIsInteger$1.call(this,sign!==0) 2468return sign===HYPHENMINUS$9?"-"+this.consume(Number$5):this.consume(Number$5)}const name$2a="AnPlusB" 2469const structure$1o={a:[String,null],b:[String,null]} 2470function parse$1t(){const start=this.tokenStart 2471let a=null 2472let b=null 2473if(this.tokenType===Number$5){checkTokenIsInteger$1.call(this,ALLOW_SIGN$2) 2474b=this.consume(Number$5)}else if(this.tokenType===Ident$1&&this.cmpChar(this.tokenStart,HYPHENMINUS$9)){a="-1" 2475expectCharCode$1.call(this,1,N$5) 2476switch(this.tokenEnd-this.tokenStart){case 2:this.next() 2477b=consumeB$2.call(this) 2478break 2479case 3:expectCharCode$1.call(this,2,HYPHENMINUS$9) 2480this.next() 2481this.skipSC() 2482checkTokenIsInteger$1.call(this,DISALLOW_SIGN$2) 2483b="-"+this.consume(Number$5) 2484break 2485default:expectCharCode$1.call(this,2,HYPHENMINUS$9) 2486checkInteger$2.call(this,3,DISALLOW_SIGN$2) 2487this.next() 2488b=this.substrToCursor(start+2)}}else if(this.tokenType===Ident$1||this.isDelim(PLUSSIGN$f)&&this.lookupType(1)===Ident$1){let sign=0 2489a="1" 2490if(this.isDelim(PLUSSIGN$f)){sign=1 2491this.next()}expectCharCode$1.call(this,0,N$5) 2492switch(this.tokenEnd-this.tokenStart){case 1:this.next() 2493b=consumeB$2.call(this) 2494break 2495case 2:expectCharCode$1.call(this,1,HYPHENMINUS$9) 2496this.next() 2497this.skipSC() 2498checkTokenIsInteger$1.call(this,DISALLOW_SIGN$2) 2499b="-"+this.consume(Number$5) 2500break 2501default:expectCharCode$1.call(this,1,HYPHENMINUS$9) 2502checkInteger$2.call(this,2,DISALLOW_SIGN$2) 2503this.next() 2504b=this.substrToCursor(start+sign+1)}}else if(this.tokenType===Dimension$3){const code=this.charCodeAt(this.tokenStart) 2505const sign=code===PLUSSIGN$f||code===HYPHENMINUS$9 2506let i=this.tokenStart+sign 2507for(;i<this.tokenEnd;i++)if(!isDigit$2(this.charCodeAt(i)))break 2508i===this.tokenStart+sign&&this.error("Integer is expected",this.tokenStart+sign) 2509expectCharCode$1.call(this,i-this.tokenStart,N$5) 2510a=this.substring(start,i) 2511if(i+1===this.tokenEnd){this.next() 2512b=consumeB$2.call(this)}else{expectCharCode$1.call(this,i-this.tokenStart+1,HYPHENMINUS$9) 2513if(i+2===this.tokenEnd){this.next() 2514this.skipSC() 2515checkTokenIsInteger$1.call(this,DISALLOW_SIGN$2) 2516b="-"+this.consume(Number$5)}else{checkInteger$2.call(this,i-this.tokenStart+2,DISALLOW_SIGN$2) 2517this.next() 2518b=this.substrToCursor(i+1)}}}else this.error() 2519a!==null&&a.charCodeAt(0)===PLUSSIGN$f&&(a=a.substr(1)) 2520b!==null&&b.charCodeAt(0)===PLUSSIGN$f&&(b=b.substr(1)) 2521return{type:"AnPlusB",loc:this.getLocation(start,this.tokenStart),a:a,b:b}}function generate$1t(node){if(node.a){const a=(node.a==="+1"||node.a==="1"?"n":node.a==="-1"&&"-n")||node.a+"n" 2522if(node.b){const b=node.b[0]==="-"||node.b[0]==="+"?node.b:"+"+node.b 2523this.tokenize(a+b)}else this.tokenize(a)}else this.tokenize(node.b)}var AnPlusB$1=Object.freeze({__proto__:null,generate:generate$1t,name:name$2a,parse:parse$1t,structure:structure$1o}) 2524function consumeRaw$a(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,true)}function isDeclarationBlockAtrule$1(){for(let offset=1,type;type=this.lookupType(offset);offset++){if(type===RightCurlyBracket$1)return true 2525if(type===LeftCurlyBracket$1||type===AtKeyword$1)return false}return false}const name$29="Atrule" 2526const walkContext$j="atrule" 2527const structure$1n={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]} 2528function parse$1s(isDeclaration=false){const start=this.tokenStart 2529let name 2530let nameLowerCase 2531let prelude=null 2532let block=null 2533this.eat(AtKeyword$1) 2534name=this.substrToCursor(start+1) 2535nameLowerCase=name.toLowerCase() 2536this.skipSC() 2537if(this.eof===false&&this.tokenType!==LeftCurlyBracket$1&&this.tokenType!==Semicolon$1){prelude=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,name,isDeclaration),consumeRaw$a):consumeRaw$a.call(this,this.tokenIndex) 2538this.skipSC()}switch(this.tokenType){case Semicolon$1:this.next() 2539break 2540case LeftCurlyBracket$1:block=hasOwnProperty.call(this.atrule,nameLowerCase)&&typeof this.atrule[nameLowerCase].block==="function"?this.atrule[nameLowerCase].block.call(this,isDeclaration):this.Block(isDeclarationBlockAtrule$1.call(this)) 2541break}return{type:"Atrule",loc:this.getLocation(start,this.tokenStart),name:name,prelude:prelude,block:block}}function generate$1s(node){this.token(AtKeyword$1,"@"+node.name) 2542node.prelude!==null&&this.node(node.prelude) 2543node.block?this.node(node.block):this.token(Semicolon$1,";")}var Atrule$2=Object.freeze({__proto__:null,generate:generate$1s,name:name$29,parse:parse$1s,structure:structure$1n,walkContext:walkContext$j}) 2544const name$28="AtrulePrelude" 2545const walkContext$i="atrulePrelude" 2546const structure$1m={children:[[]]} 2547function parse$1r(name){let children=null 2548name!==null&&(name=name.toLowerCase()) 2549this.skipSC() 2550children=hasOwnProperty.call(this.atrule,name)&&typeof this.atrule[name].prelude==="function"?this.atrule[name].prelude.call(this):this.readSequence(this.scope.AtrulePrelude) 2551this.skipSC() 2552this.eof!==true&&this.tokenType!==LeftCurlyBracket$1&&this.tokenType!==Semicolon$1&&this.error("Semicolon or block is expected") 2553return{type:"AtrulePrelude",loc:this.getLocationFromList(children),children:children}}function generate$1r(node){this.children(node)}var AtrulePrelude$1=Object.freeze({__proto__:null,generate:generate$1r,name:name$28,parse:parse$1r,structure:structure$1m,walkContext:walkContext$i}) 2554const DOLLARSIGN$3=0x0024 2555const ASTERISK$c=0x002A 2556const EQUALSSIGN$2=0x003D 2557const CIRCUMFLEXACCENT$1=0x005E 2558const VERTICALLINE$6=0x007C 2559const TILDE$5=0x007E 2560function getAttributeName$1(){this.eof&&this.error("Unexpected end of input") 2561const start=this.tokenStart 2562let expectIdent=false 2563if(this.isDelim(ASTERISK$c)){expectIdent=true 2564this.next()}else this.isDelim(VERTICALLINE$6)||this.eat(Ident$1) 2565if(this.isDelim(VERTICALLINE$6))if(this.charCodeAt(this.tokenStart+1)!==EQUALSSIGN$2){this.next() 2566this.eat(Ident$1)}else expectIdent&&this.error("Identifier is expected",this.tokenEnd) 2567else expectIdent&&this.error("Vertical line is expected") 2568return{type:"Identifier",loc:this.getLocation(start,this.tokenStart),name:this.substrToCursor(start)}}function getOperator$1(){const start=this.tokenStart 2569const code=this.charCodeAt(start) 2570code!==EQUALSSIGN$2&&code!==TILDE$5&&code!==CIRCUMFLEXACCENT$1&&code!==DOLLARSIGN$3&&code!==ASTERISK$c&&code!==VERTICALLINE$6&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected") 2571this.next() 2572if(code!==EQUALSSIGN$2){this.isDelim(EQUALSSIGN$2)||this.error("Equal sign is expected") 2573this.next()}return this.substrToCursor(start)}const name$27="AttributeSelector" 2574const structure$1l={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]} 2575function parse$1q(){const start=this.tokenStart 2576let name 2577let matcher=null 2578let value=null 2579let flags=null 2580this.eat(LeftSquareBracket$1) 2581this.skipSC() 2582name=getAttributeName$1.call(this) 2583this.skipSC() 2584if(this.tokenType!==RightSquareBracket$1){if(this.tokenType!==Ident$1){matcher=getOperator$1.call(this) 2585this.skipSC() 2586value=this.tokenType===String$4?this.String():this.Identifier() 2587this.skipSC()}if(this.tokenType===Ident$1){flags=this.consume(Ident$1) 2588this.skipSC()}}this.eat(RightSquareBracket$1) 2589return{type:"AttributeSelector",loc:this.getLocation(start,this.tokenStart),name:name,matcher:matcher,value:value,flags:flags}}function generate$1q(node){this.token(Delim$1,"[") 2590this.node(node.name) 2591if(node.matcher!==null){this.tokenize(node.matcher) 2592this.node(node.value)}node.flags!==null&&this.token(Ident$1,node.flags) 2593this.token(Delim$1,"]")}var AttributeSelector$2=Object.freeze({__proto__:null,generate:generate$1q,name:name$27,parse:parse$1q,structure:structure$1l}) 2594const AMPERSAND$6=0x0026 2595function consumeRaw$9(){return this.Raw(null,true)}function consumeRule$1(){return this.parseWithFallback(this.Rule,consumeRaw$9)}function consumeRawDeclaration$1(){return this.Raw(this.consumeUntilSemicolonIncluded,true)}function consumeDeclaration$1(){if(this.tokenType===Semicolon$1)return consumeRawDeclaration$1.call(this,this.tokenIndex) 2596const node=this.parseWithFallback(this.Declaration,consumeRawDeclaration$1) 2597this.tokenType===Semicolon$1&&this.next() 2598return node}const name$26="Block" 2599const walkContext$h="block" 2600const structure$1k={children:[["Atrule","Rule","Declaration"]]} 2601function parse$1p(isStyleBlock){const consumer=isStyleBlock?consumeDeclaration$1:consumeRule$1 2602const start=this.tokenStart 2603let children=this.createList() 2604this.eat(LeftCurlyBracket$1) 2605scan:while(!this.eof)switch(this.tokenType){case RightCurlyBracket$1:break scan 2606case WhiteSpace$3:case Comment$3:this.next() 2607break 2608case AtKeyword$1:children.push(this.parseWithFallback(this.Atrule.bind(this,isStyleBlock),consumeRaw$9)) 2609break 2610default:isStyleBlock&&this.isDelim(AMPERSAND$6)?children.push(consumeRule$1.call(this)):children.push(consumer.call(this))}this.eof||this.eat(RightCurlyBracket$1) 2611return{type:"Block",loc:this.getLocation(start,this.tokenStart),children:children}}function generate$1p(node){this.token(LeftCurlyBracket$1,"{") 2612this.children(node,
vendor: 3,671 bytes, lines 2612-2670
2612(prev=>{prev.type==="Declaration"&&this.token(Semicolon$1,";")})) 2613this.token(RightCurlyBracket$1,"}")}var Block$1=Object.freeze({__proto__:null,generate:generate$1p,name:name$26,parse:parse$1p,structure:structure$1k,walkContext:walkContext$h}) 2614const name$25="Brackets" 2615const structure$1j={children:[[]]} 2616function parse$1o(readSequence,recognizer){const start=this.tokenStart 2617let children=null 2618this.eat(LeftSquareBracket$1) 2619children=readSequence.call(this,recognizer) 2620this.eof||this.eat(RightSquareBracket$1) 2621return{type:"Brackets",loc:this.getLocation(start,this.tokenStart),children:children}}function generate$1o(node){this.token(Delim$1,"[") 2622this.children(node) 2623this.token(Delim$1,"]")}var Brackets$1=Object.freeze({__proto__:null,generate:generate$1o,name:name$25,parse:parse$1o,structure:structure$1j}) 2624const name$24="CDC" 2625const structure$1i=[] 2626function parse$1n(){const start=this.tokenStart 2627this.eat(CDC$3) 2628return{type:"CDC",loc:this.getLocation(start,this.tokenStart)}}function generate$1n(){this.token(CDC$3,"--\x3e")}var CDC$2=Object.freeze({__proto__:null,generate:generate$1n,name:name$24,parse:parse$1n,structure:structure$1i}) 2629const name$23="CDO" 2630const structure$1h=[] 2631function parse$1m(){const start=this.tokenStart 2632this.eat(CDO$3) 2633return{type:"CDO",loc:this.getLocation(start,this.tokenStart)}}function generate$1m(){this.token(CDO$3,"\x3c!--")}var CDO$2=Object.freeze({__proto__:null,generate:generate$1m,name:name$23,parse:parse$1m,structure:structure$1h}) 2634const FULLSTOP$5=0x002E 2635const name$22="ClassSelector" 2636const structure$1g={name:String} 2637function parse$1l(){this.eatDelim(FULLSTOP$5) 2638return{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(Ident$1)}}function generate$1l(node){this.token(Delim$1,".") 2639this.token(Ident$1,node.name)}var ClassSelector$1=Object.freeze({__proto__:null,generate:generate$1l,name:name$22,parse:parse$1l,structure:structure$1g}) 2640const PLUSSIGN$e=0x002B 2641const SOLIDUS$d=0x002F 2642const GREATERTHANSIGN$5=0x003E 2643const TILDE$4=0x007E 2644const name$21="Combinator" 2645const structure$1f={name:String} 2646function parse$1k(){const start=this.tokenStart 2647let name 2648switch(this.tokenType){case WhiteSpace$3:name=" " 2649break 2650case Delim$1:switch(this.charCodeAt(this.tokenStart)){case GREATERTHANSIGN$5:case PLUSSIGN$e:case TILDE$4:this.next() 2651break 2652case SOLIDUS$d:this.next() 2653this.eatIdent("deep") 2654this.eatDelim(SOLIDUS$d) 2655break 2656default:this.error("Combinator is expected")}name=this.substrToCursor(start) 2657break}return{type:"Combinator",loc:this.getLocation(start,this.tokenStart),name:name}}function generate$1k(node){this.tokenize(node.name)}var Combinator$1=Object.freeze({__proto__:null,generate:generate$1k,name:name$21,parse:parse$1k,structure:structure$1f}) 2658const ASTERISK$b=0x002A 2659const SOLIDUS$c=0x002F 2660const name$20="Comment" 2661const structure$1e={value:String} 2662function parse$1j(){const start=this.tokenStart 2663let end=this.tokenEnd 2664this.eat(Comment$3) 2665end-start+2>=2&&this.charCodeAt(end-2)===ASTERISK$b&&this.charCodeAt(end-1)===SOLIDUS$c&&(end-=2) 2666return{type:"Comment",loc:this.getLocation(start,this.tokenStart),value:this.substring(start+2,end)}}function generate$1j(node){this.token(Comment$3,"/*"+node.value+"*/")}var Comment$2=Object.freeze({__proto__:null,generate:generate$1j,name:name$20,parse:parse$1j,structure:structure$1e}) 2667const likelyFeatureToken=new Set([Colon$1,RightParenthesis$1,EOF$3]) 2668const name$1$="Condition" 2669const structure$1d={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]} 2670function featureOrRange(kind){if(this.lookupTypeNonSC(1)===Ident$1&&likelyFeatureToken.has(this.lookupTypeNonSC(2)))return this.Feature
2670(kind) 2671return this.FeatureRange(kind)}const parentheses$1={media:featureOrRange,container:featureOrRange,supports(){return this.SupportsDeclaration()}} 2672function parse$1i(kind="media"){const children=this.createList() 2673scan:while(!this.eof)switch(this.tokenType){case Comment$3:case WhiteSpace$3:this.next() 2674continue 2675case Ident$1:children.push(this.Identifier()) 2676break 2677case LeftParenthesis$1:{let term=this.parseWithFallback((()=>parentheses$1[kind].call(this,kind)),(()=>null)) 2678term||(term=this.parseWithFallback((()=>{this.eat(LeftParenthesis$1) 2679const res=this.Condition(kind) 2680this.eat(RightParenthesis$1) 2681return res}),(()=>this.GeneralEnclosed(kind)))) 2682children.push(term) 2683break}case Function$3:{let term=this.parseWithFallback((()=>this.FeatureFunction(kind)),(()=>null)) 2684term||(term=this.GeneralEnclosed(kind)) 2685children.push(term) 2686break}default:break scan}children.isEmpty&&this.error("Condition is expected") 2687return{type:"Condition",loc:this.getLocationFromList(children),kind:kind,children:children}}function generate$1i(node){node.children.forEach((child=>{if(child.type==="Condition"){this.token(LeftParenthesis$1,"(") 2688this.node(child) 2689this.token(RightParenthesis$1,")")}else this.node(child)}))}var Condition=Object.freeze({__proto__:null,generate:generate$1i,name:name$1$,parse:parse$1i,structure:structure$1d}) 2690const EXCLAMATIONMARK$5=0x0021 2691const NUMBERSIGN$7=0x0023 2692const DOLLARSIGN$2=0x0024 2693const AMPERSAND$5=0x0026 2694const ASTERISK$a=0x002A 2695const PLUSSIGN$d=0x002B 2696const SOLIDUS$b=0x002F 2697function consumeValueRaw$1(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,true)}function consumeCustomPropertyRaw$1(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,false)}function consumeValue$1(){const startValueToken=this.tokenIndex 2698const value=this.Value() 2699value.type!=="Raw"&&this.eof===false&&this.tokenType!==Semicolon$1&&this.isDelim(EXCLAMATIONMARK$5)===false&&this.isBalanceEdge(startValueToken)===false&&this.error() 2700return value}const name$1_="Declaration" 2701const walkContext$g="declaration" 2702const structure$1c={important:[Boolean,String],property:String,value:["Value","Raw"]} 2703function parse$1h(){const start=this.tokenStart 2704const startToken=this.tokenIndex 2705const property=readProperty$2.call(this) 2706const customProperty=isCustomProperty$1(property) 2707const parseValue=customProperty?this.parseCustomProperty:this.parseValue 2708const consumeRaw=customProperty?consumeCustomPropertyRaw$1:consumeValueRaw$1 2709let important=false 2710let value 2711this.skipSC() 2712this.eat(Colon$1) 2713const valueStart=this.tokenIndex 2714customProperty||this.skipSC() 2715value=parseValue?this.parseWithFallback(consumeValue$1,consumeRaw):consumeRaw.call(this,this.tokenIndex) 2716if(customProperty&&value.type==="Value"&&value.children.isEmpty)for(let offset=valueStart-this.tokenIndex;offset<=0;offset++)if(this.lookupType(offset)===WhiteSpace$3){value.children.appendData({type:"WhiteSpace",loc:null,value:" "}) 2717break}if(this.isDelim(EXCLAMATIONMARK$5)){important=getImportant$1.call(this) 2718this.skipSC()}this.eof===false&&this.tokenType!==Semicolon$1&&this.isBalanceEdge(startToken)===false&&this.error() 2719return{type:"Declaration",loc:this.getLocation(start,this.tokenStart),important:important,property:property,value:value}}function generate$1h(node){this.token(Ident$1,node.property) 2720this.token(Colon$1,":") 2721this.node(node.value) 2722if(node.important){this.token(Delim$1,"!") 2723this.token(Ident$1,node.important===true?"important":node.important)}}function readProperty$2(){const start=this.tokenStart 2724if(this.tokenType===Delim$1)switch(this.charCodeAt(this.tokenStart)){case ASTERISK$a:case DOLLARSIGN$2:case PLUSSIGN$d:case NUMBERSIGN$7:case AMPERSAND$5:this.next() 2725break 2726case SOLIDUS$b:this.next() 2727this.isDelim(SOLIDUS$b)&&this.next() 2728break}this.tokenType===Hash$3?this.eat(Hash$3):this.eat(Ident$1) 2729return this.substrToCursor(start)}function getImportant$1(){this.eat(Delim$1) 2730this.skipSC() 2731const important=this.consume(Ident$1) 2732return important==="important"||important}var Declaration$1=Object.freeze({__proto__:null,generate:generate$1h,name:name$1_,parse:parse$1h,structure:structure$1c,walkContext:walkContext$g}) 2733const AMPERSAND$4=0x0026 2734function consumeRaw$8(){return this.Raw(this.consumeUntilSemicolonIncluded,true)}const name$1Z="DeclarationList" 2735const structure$1b={children:[["Declaration","Atrule","Rule"]]}
vendor: 6,509 bytes, lines 2736-2837
2736function parse$1g(){const children=this.createList() 2737while(!this.eof)switch(this.tokenType){case WhiteSpace$3:case Comment$3:case Semicolon$1:this.next() 2738break 2739case AtKeyword$1:children.push(this.parseWithFallback(this.Atrule.bind(this,true),consumeRaw$8)) 2740break 2741default:this.isDelim(AMPERSAND$4)?children.push(this.parseWithFallback(this.Rule,consumeRaw$8)):children.push(this.parseWithFallback(this.Declaration,consumeRaw$8))}return{type:"DeclarationList",loc:this.getLocationFromList(children),children:children}}function generate$1g(node){this.children(node,(prev=>{prev.type==="Declaration"&&this.token(Semicolon$1,";")}))}var DeclarationList$1=Object.freeze({__proto__:null,generate:generate$1g,name:name$1Z,parse:parse$1g,structure:structure$1b}) 2742const name$1Y="Dimension" 2743const structure$1a={value:String,unit:String} 2744function parse$1f(){const start=this.tokenStart 2745const value=this.consumeNumber(Dimension$3) 2746return{type:"Dimension",loc:this.getLocation(start,this.tokenStart),value:value,unit:this.substring(start+value.length,this.tokenStart)}}function generate$1f(node){this.token(Dimension$3,node.value+node.unit)}var Dimension$2=Object.freeze({__proto__:null,generate:generate$1f,name:name$1Y,parse:parse$1f,structure:structure$1a}) 2747const SOLIDUS$a=0x002F 2748const name$1X="Feature" 2749const structure$19={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]} 2750function parse$1e(kind){const start=this.tokenStart 2751let name 2752let value=null 2753this.eat(LeftParenthesis$1) 2754this.skipSC() 2755name=this.consume(Ident$1) 2756this.skipSC() 2757if(this.tokenType!==RightParenthesis$1){this.eat(Colon$1) 2758this.skipSC() 2759switch(this.tokenType){case Number$5:value=this.lookupNonWSType(1)===Delim$1?this.Ratio():this.Number() 2760break 2761case Dimension$3:value=this.Dimension() 2762break 2763case Ident$1:value=this.Identifier() 2764break 2765case Function$3:value=this.parseWithFallback((()=>{const res=this.Function(this.readSequence,this.scope.Value) 2766this.skipSC() 2767this.isDelim(SOLIDUS$a)&&this.error() 2768return res}),(()=>this.Ratio())) 2769break 2770default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}this.eof||this.eat(RightParenthesis$1) 2771return{type:"Feature",loc:this.getLocation(start,this.tokenStart),kind:kind,name:name,value:value}}function generate$1e(node){this.token(LeftParenthesis$1,"(") 2772this.token(Ident$1,node.name) 2773if(node.value!==null){this.token(Colon$1,":") 2774this.node(node.value)}this.token(RightParenthesis$1,")")}var Feature=Object.freeze({__proto__:null,generate:generate$1e,name:name$1X,parse:parse$1e,structure:structure$19}) 2775const name$1W="FeatureFunction" 2776const structure$18={kind:String,feature:String,value:["Declaration","Selector"]} 2777function getFeatureParser(kind,name){const featuresOfKind=this.features[kind]||{} 2778const parser=featuresOfKind[name] 2779typeof parser!=="function"&&this.error(`Unknown feature ${name}()`) 2780return parser}function parse$1d(kind="unknown"){const start=this.tokenStart 2781const functionName=this.consumeFunctionName() 2782const valueParser=getFeatureParser.call(this,kind,functionName.toLowerCase()) 2783this.skipSC() 2784const value=this.parseWithFallback((()=>{const startValueToken=this.tokenIndex 2785const value=valueParser.call(this) 2786this.eof===false&&this.isBalanceEdge(startValueToken)===false&&this.error() 2787return value}),(()=>this.Raw(null,false))) 2788this.eof||this.eat(RightParenthesis$1) 2789return{type:"FeatureFunction",loc:this.getLocation(start,this.tokenStart),kind:kind,feature:functionName,value:value}}function generate$1d(node){this.token(Function$3,node.feature+"(") 2790this.node(node.value) 2791this.token(RightParenthesis$1,")")}var FeatureFunction=Object.freeze({__proto__:null,generate:generate$1d,name:name$1W,parse:parse$1d,structure:structure$18}) 2792const SOLIDUS$9=0x002F 2793const LESSTHANSIGN$1=0x003C 2794const EQUALSSIGN$1=0x003D 2795const GREATERTHANSIGN$4=0x003E 2796const name$1V="FeatureRange" 2797const structure$17={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]} 2798function readTerm(){this.skipSC() 2799switch(this.tokenType){case Number$5:return this.isDelim(SOLIDUS$9,this.lookupOffsetNonSC(1))?this.Ratio():this.Number() 2800case Dimension$3:return this.Dimension() 2801case Ident$1:return this.Identifier() 2802case Function$3:return this.parseWithFallback((()=>{const res=this.Function(this.readSequence,this.scope.Value) 2803this.skipSC() 2804this.isDelim(SOLIDUS$9)&&this.error() 2805return res}),(()=>this.Ratio())) 2806default:this.error("Number, dimension, ratio or identifier is expected")}}function readComparison(expectColon){this.skipSC() 2807if(this.isDelim(LESSTHANSIGN$1)||this.isDelim(GREATERTHANSIGN$4)){const value=this.source[this.tokenStart] 2808this.next() 2809if(this.isDelim(EQUALSSIGN$1)){this.next() 2810return value+"="}return value}if(this.isDelim(EQUALSSIGN$1))return"=" 2811this.error(`Expected ${expectColon?'":", ':""}"<", ">", "=" or ")"`)}function parse$1c(kind="unknown"){const start=this.tokenStart 2812this.skipSC() 2813this.eat(LeftParenthesis$1) 2814const left=readTerm.call(this) 2815const leftComparison=readComparison.call(this,left.type==="Identifier") 2816const middle=readTerm.call(this) 2817let rightComparison=null 2818let right=null 2819if(this.lookupNonWSType(0)!==RightParenthesis$1){rightComparison=readComparison.call(this) 2820right=readTerm.call(this)}this.skipSC() 2821this.eat(RightParenthesis$1) 2822return{type:"FeatureRange",loc:this.getLocation(start,this.tokenStart),kind:kind,left:left,leftComparison:leftComparison,middle:middle,rightComparison:rightComparison,right:right}}function generate$1c(node){this.token(LeftParenthesis$1,"(") 2823this.node(node.left) 2824this.tokenize(node.leftComparison) 2825this.node(node.middle) 2826if(node.right){this.tokenize(node.rightComparison) 2827this.node(node.right)}this.token(RightParenthesis$1,")")}var FeatureRange=Object.freeze({__proto__:null,generate:generate$1c,name:name$1V,parse:parse$1c,structure:structure$17}) 2828const name$1U="Function" 2829const walkContext$f="function" 2830const structure$16={name:String,children:[[]]} 2831function parse$1b(readSequence,recognizer){const start=this.tokenStart 2832const name=this.consumeFunctionName() 2833const nameLowerCase=name.toLowerCase() 2834let children 2835children=recognizer.hasOwnProperty(nameLowerCase)?recognizer[nameLowerCase].call(this,recognizer):readSequence.call(this,recognizer) 2836this.eof||this.eat(RightParenthesis$1) 2837return{type:"Function",loc:this.getLocation(start,this.tokenStart),name:name,children:children}}
2837function generate$1b(node){this.token(Function$3,node.name+"(") 2838this.children(node) 2839this.token(RightParenthesis$1,")")}var Function$2=Object.freeze({__proto__:null,generate:generate$1b,name:name$1U,parse:parse$1b,structure:structure$16,walkContext:walkContext$f}) 2840const name$1T="GeneralEnclosed" 2841const structure$15={kind:String,function:[String,null],children:[[]]} 2842function parse$1a(kind){const start=this.tokenStart 2843let functionName=null 2844this.tokenType===Function$3?functionName=this.consumeFunctionName():this.eat(LeftParenthesis$1) 2845const children=this.parseWithFallback((()=>{const startValueToken=this.tokenIndex 2846const children=this.readSequence(this.scope.Value) 2847this.eof===false&&this.isBalanceEdge(startValueToken)===false&&this.error() 2848return children}),(()=>this.createSingleNodeList(this.Raw(null,false)))) 2849this.eof||this.eat(RightParenthesis$1) 2850return{type:"GeneralEnclosed",loc:this.getLocation(start,this.tokenStart),kind:kind,function:functionName,children:children}}function generate$1a(node){node.function?this.token(Function$3,node.function+"("):this.token(LeftParenthesis$1,"(") 2851this.children(node) 2852this.token(RightParenthesis$1,")")}var GeneralEnclosed=Object.freeze({__proto__:null,generate:generate$1a,name:name$1T,parse:parse$1a,structure:structure$15}) 2853const xxx$1="XXX" 2854const name$1S="Hash" 2855const structure$14={value:String} 2856function parse$19(){const start=this.tokenStart 2857this.eat(Hash$3) 2858return{type:"Hash",loc:this.getLocation(start,this.tokenStart),value:this.substrToCursor(start+1)}}function generate$19(node){this.token(Hash$3,"#"+node.value)}var Hash$2=Object.freeze({__proto__:null,generate:generate$19,name:name$1S,parse:parse$19,structure:structure$14,xxx:xxx$1}) 2859const name$1R="Identifier" 2860const structure$13={name:String} 2861function parse$18(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(Ident$1)}}function generate$18(node){this.token(Ident$1,node.name)}var Identifier$1=Object.freeze({__proto__:null,generate:generate$18,name:name$1R,parse:parse$18,structure:structure$13}) 2862const name$1Q="IdSelector" 2863const structure$12={name:String} 2864function parse$17(){const start=this.tokenStart 2865this.eat(Hash$3) 2866return{type:"IdSelector",loc:this.getLocation(start,this.tokenStart),name:this.substrToCursor(start+1)}}function generate$17(node){this.token(Delim$1,"#"+node.name)}var IdSelector$1=Object.freeze({__proto__:null,generate:generate$17,name:name$1Q,parse:parse$17,structure:structure$12}) 2867const FULLSTOP$4=0x002E 2868const name$1P="Layer" 2869const structure$11={name:String} 2870function parse$16(){let name=this.consume(Ident$1) 2871while(this.isDelim(FULLSTOP$4)){this.eat(Delim$1) 2872name+="."+this.consume(Ident$1)}return{type:"Layer",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:name}}function generate$16(node){this.tokenize(node.name)}var Layer=Object.freeze({__proto__:null,generate:generate$16,name:name$1P,parse:parse$16,structure:structure$11}) 2873const name$1O="LayerList" 2874const structure$10={children:[["Layer"]]}
vendor: 2,069 bytes, lines 2875-2907
2875function parse$15(){const children=this.createList() 2876this.skipSC() 2877while(!this.eof){children.push(this.Layer()) 2878if(this.lookupTypeNonSC(0)!==Comma$1)break 2879this.skipSC() 2880this.next() 2881this.skipSC()}return{type:"LayerList",loc:this.getLocationFromList(children),children:children}}function generate$15(node){this.children(node,(()=>this.token(Comma$1,",")))}var LayerList=Object.freeze({__proto__:null,generate:generate$15,name:name$1O,parse:parse$15,structure:structure$10}) 2882const name$1N="MediaQuery" 2883const structure$$={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]} 2884function parse$14(){const start=this.tokenStart 2885let modifier=null 2886let mediaType=null 2887let condition=null 2888this.skipSC() 2889if(this.tokenType===Ident$1&&this.lookupTypeNonSC(1)!==LeftParenthesis$1){const ident=this.consume(Ident$1) 2890const identLowerCase=ident.toLowerCase() 2891if(identLowerCase==="not"||identLowerCase==="only"){this.skipSC() 2892modifier=identLowerCase 2893mediaType=this.consume(Ident$1)}else mediaType=ident 2894switch(this.lookupTypeNonSC(0)){case Ident$1:this.skipSC() 2895this.eatIdent("and") 2896condition=this.Condition("media") 2897break 2898case LeftCurlyBracket$1:case Semicolon$1:case Comma$1:case EOF$3:break 2899default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case Ident$1:case LeftParenthesis$1:case Function$3:condition=this.Condition("media") 2900break 2901case LeftCurlyBracket$1:case Semicolon$1:case EOF$3:break 2902default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(start,this.tokenStart),modifier:modifier,mediaType:mediaType,condition:condition}}function generate$14(node){if(node.mediaType){node.modifier&&this.token(Ident$1,node.modifier) 2903this.token(Ident$1,node.mediaType) 2904if(node.condition){this.token(Ident$1,"and") 2905this.node(node.condition)}}else node.condition&&this.node(node.condition)}var MediaQuery$1=Object.freeze({__proto__:null,generate:generate$14,name:name$1N,parse:parse$14,structure:structure$$}) 2906const name$1M="MediaQueryList" 2907const structure$_={children:[["MediaQuery"]]}
2908function parse$13(){const children=this.createList() 2909this.skipSC() 2910while(!this.eof){children.push(this.MediaQuery()) 2911if(this.tokenType!==Comma$1)break 2912this.next()}return{type:"MediaQueryList",loc:this.getLocationFromList(children),children:children}}function generate$13(node){this.children(node,(()=>this.token(Comma$1,",")
vendor: 8,184 bytes, lines 2912-3040
2912))}var MediaQueryList$1=Object.freeze({__proto__:null,generate:generate$13,name:name$1M,parse:parse$13,structure:structure$_}) 2913const AMPERSAND$3=0x0026 2914const name$1L="NestingSelector" 2915const structure$Z={} 2916function parse$12(){const start=this.tokenStart 2917this.eatDelim(AMPERSAND$3) 2918return{type:"NestingSelector",loc:this.getLocation(start,this.tokenStart)}}function generate$12(){this.token(Delim$1,"&")}var NestingSelector=Object.freeze({__proto__:null,generate:generate$12,name:name$1L,parse:parse$12,structure:structure$Z}) 2919const name$1K="Nth" 2920const structure$Y={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]} 2921function parse$11(){this.skipSC() 2922const start=this.tokenStart 2923let end=start 2924let selector=null 2925let nth 2926nth=this.lookupValue(0,"odd")||this.lookupValue(0,"even")?this.Identifier():this.AnPlusB() 2927end=this.tokenStart 2928this.skipSC() 2929if(this.lookupValue(0,"of")){this.next() 2930selector=this.SelectorList() 2931end=this.tokenStart}return{type:"Nth",loc:this.getLocation(start,end),nth:nth,selector:selector}}function generate$11(node){this.node(node.nth) 2932if(node.selector!==null){this.token(Ident$1,"of") 2933this.node(node.selector)}}var Nth$1=Object.freeze({__proto__:null,generate:generate$11,name:name$1K,parse:parse$11,structure:structure$Y}) 2934const name$1J="Number" 2935const structure$X={value:String} 2936function parse$10(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(Number$5)}}function generate$10(node){this.token(Number$5,node.value)}var Number$4=Object.freeze({__proto__:null,generate:generate$10,name:name$1J,parse:parse$10,structure:structure$X}) 2937const name$1I="Operator" 2938const structure$W={value:String} 2939function parse$$(){const start=this.tokenStart 2940this.next() 2941return{type:"Operator",loc:this.getLocation(start,this.tokenStart),value:this.substrToCursor(start)}}function generate$$(node){this.tokenize(node.value)}var Operator$1=Object.freeze({__proto__:null,generate:generate$$,name:name$1I,parse:parse$$,structure:structure$W}) 2942const name$1H="Parentheses" 2943const structure$V={children:[[]]} 2944function parse$_(readSequence,recognizer){const start=this.tokenStart 2945let children=null 2946this.eat(LeftParenthesis$1) 2947children=readSequence.call(this,recognizer) 2948this.eof||this.eat(RightParenthesis$1) 2949return{type:"Parentheses",loc:this.getLocation(start,this.tokenStart),children:children}}function generate$_(node){this.token(LeftParenthesis$1,"(") 2950this.children(node) 2951this.token(RightParenthesis$1,")")}var Parentheses$1=Object.freeze({__proto__:null,generate:generate$_,name:name$1H,parse:parse$_,structure:structure$V}) 2952const name$1G="Percentage" 2953const structure$U={value:String} 2954function parse$Z(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(Percentage$3)}}function generate$Z(node){this.token(Percentage$3,node.value+"%")}var Percentage$2=Object.freeze({__proto__:null,generate:generate$Z,name:name$1G,parse:parse$Z,structure:structure$U}) 2955const name$1F="PseudoClassSelector" 2956const walkContext$e="function" 2957const structure$T={name:String,children:[["Raw"],null]} 2958function parse$Y(){const start=this.tokenStart 2959let children=null 2960let name 2961let nameLowerCase 2962this.eat(Colon$1) 2963if(this.tokenType===Function$3){name=this.consumeFunctionName() 2964nameLowerCase=name.toLowerCase() 2965if(this.lookupNonWSType(0)==RightParenthesis$1)children=this.createList() 2966else if(hasOwnProperty.call(this.pseudo,nameLowerCase)){this.skipSC() 2967children=this.pseudo[nameLowerCase].call(this) 2968this.skipSC()}else{children=this.createList() 2969children.push(this.Raw(null,false))}this.eat(RightParenthesis$1)}else name=this.consume(Ident$1) 2970return{type:"PseudoClassSelector",loc:this.getLocation(start,this.tokenStart),name:name,children:children}}function generate$Y(node){this.token(Colon$1,":") 2971if(node.children===null)this.token(Ident$1,node.name) 2972else{this.token(Function$3,node.name+"(") 2973this.children(node) 2974this.token(RightParenthesis$1,")")}}var PseudoClassSelector$1=Object.freeze({__proto__:null,generate:generate$Y,name:name$1F,parse:parse$Y,structure:structure$T,walkContext:walkContext$e}) 2975const name$1E="PseudoElementSelector" 2976const walkContext$d="function" 2977const structure$S={name:String,children:[["Raw"],null]} 2978function parse$X(){const start=this.tokenStart 2979let children=null 2980let name 2981let nameLowerCase 2982this.eat(Colon$1) 2983this.eat(Colon$1) 2984if(this.tokenType===Function$3){name=this.consumeFunctionName() 2985nameLowerCase=name.toLowerCase() 2986if(this.lookupNonWSType(0)==RightParenthesis$1)children=this.createList() 2987else if(hasOwnProperty.call(this.pseudo,nameLowerCase)){this.skipSC() 2988children=this.pseudo[nameLowerCase].call(this) 2989this.skipSC()}else{children=this.createList() 2990children.push(this.Raw(null,false))}this.eat(RightParenthesis$1)}else name=this.consume(Ident$1) 2991return{type:"PseudoElementSelector",loc:this.getLocation(start,this.tokenStart),name:name,children:children}}function generate$X(node){this.token(Colon$1,":") 2992this.token(Colon$1,":") 2993if(node.children===null)this.token(Ident$1,node.name) 2994else{this.token(Function$3,node.name+"(") 2995this.children(node) 2996this.token(RightParenthesis$1,")")}}var PseudoElementSelector$1=Object.freeze({__proto__:null,generate:generate$X,name:name$1E,parse:parse$X,structure:structure$S,walkContext:walkContext$d}) 2997const SOLIDUS$8=0x002F 2998function consumeTerm(){this.skipSC() 2999switch(this.tokenType){case Number$5:return this.Number() 3000case Function$3:return this.Function(this.readSequence,this.scope.Value) 3001default:this.error("Number of function is expected")}}const name$1D="Ratio" 3002const structure$R={left:["Number","Function"],right:["Number","Function",null]} 3003function parse$W(){const start=this.tokenStart 3004const left=consumeTerm.call(this) 3005let right=null 3006this.skipSC() 3007if(this.isDelim(SOLIDUS$8)){this.eatDelim(SOLIDUS$8) 3008right=consumeTerm.call(this)}return{type:"Ratio",loc:this.getLocation(start,this.tokenStart),left:left,right:right}}function generate$W(node){this.node(node.left) 3009this.token(Delim$1,"/") 3010node.right?this.node(node.right):this.node(Number$5,1)}var Ratio$1=Object.freeze({__proto__:null,generate:generate$W,name:name$1D,parse:parse$W,structure:structure$R}) 3011function getOffsetExcludeWS$1(){if(this.tokenIndex>0&&this.lookupType(-1)===WhiteSpace$3)return this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset 3012return this.tokenStart}const name$1C="Raw" 3013const structure$Q={value:String} 3014function parse$V(consumeUntil,excludeWhiteSpace){const startOffset=this.getTokenStart(this.tokenIndex) 3015let endOffset 3016this.skipUntilBalanced(this.tokenIndex,consumeUntil||this.consumeUntilBalanceEnd) 3017endOffset=excludeWhiteSpace&&this.tokenStart>startOffset?getOffsetExcludeWS$1.call(this):this.tokenStart 3018return{type:"Raw",loc:this.getLocation(startOffset,endOffset),value:this.substring(startOffset,endOffset)}}function generate$V(node){this.tokenize(node.value)}var Raw$1=Object.freeze({__proto__:null,generate:generate$V,name:name$1C,parse:parse$V,structure:structure$Q}) 3019function consumeRaw$7(){return this.Raw(this.consumeUntilLeftCurlyBracket,true)}function consumePrelude$1(){const prelude=this.SelectorList() 3020prelude.type!=="Raw"&&this.eof===false&&this.tokenType!==LeftCurlyBracket$1&&this.error() 3021return prelude}const name$1B="Rule" 3022const walkContext$c="rule" 3023const structure$P={prelude:["SelectorList","Raw"],block:["Block"]} 3024function parse$U(){const startToken=this.tokenIndex 3025const startOffset=this.tokenStart 3026let prelude 3027let block 3028prelude=this.parseRulePrelude?this.parseWithFallback(consumePrelude$1,consumeRaw$7):consumeRaw$7.call(this,startToken) 3029block=this.Block(true) 3030return{type:"Rule",loc:this.getLocation(startOffset,this.tokenStart),prelude:prelude,block:block}}function generate$U(node){this.node(node.prelude) 3031this.node(node.block)}var Rule$1=Object.freeze({__proto__:null,generate:generate$U,name:name$1B,parse:parse$U,structure:structure$P,walkContext:walkContext$c}) 3032const name$1A="Scope" 3033const structure$O={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]} 3034function parse$T(){let root=null 3035let limit=null 3036this.skipSC() 3037const startOffset=this.tokenStart 3038if(this.tokenType===LeftParenthesis$1){this.next() 3039this.skipSC() 3040root=this.parseWithFallback(this.SelectorList,(
3040()=>this.Raw(false,true))) 3041this.skipSC() 3042this.eat(RightParenthesis$1)}if(this.lookupNonWSType(0)===Ident$1){this.skipSC() 3043this.eatIdent("to") 3044this.skipSC() 3045this.eat(LeftParenthesis$1) 3046this.skipSC() 3047limit=this.parseWithFallback(this.SelectorList,(()=>this.Raw(false,true))) 3048this.skipSC() 3049this.eat(RightParenthesis$1)}return{type:"Scope",loc:this.getLocation(startOffset,this.tokenStart),root:root,limit:limit}}function generate$T(node){if(node.root){this.token(LeftParenthesis$1,"(") 3050this.node(node.root) 3051this.token(RightParenthesis$1,")")}if(node.limit){this.token(Ident$1,"to") 3052this.token(LeftParenthesis$1,"(") 3053this.node(node.limit) 3054this.token(RightParenthesis$1,")")}}var Scope=Object.freeze({__proto__:null,generate:generate$T,name:name$1A,parse:parse$T,structure:structure$O}) 3055const name$1z="Selector" 3056const structure$N={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]} 3057function parse$S(){const children=this.readSequence(this.scope.Selector) 3058this.getFirstListNode(children)===null&&this.error("Selector is expected") 3059return{type:"Selector",loc:this.getLocationFromList(children),children:children}}function generate$S(node){this.children(node)}var Selector$1=Object.freeze({__proto__:null,generate:generate$S,name:name$1z,parse:parse$S,structure:structure$N}) 3060const name$1y="SelectorList" 3061const walkContext$b="selector" 3062const structure$M={children:[["Selector","Raw"]]}
3063function parse$R(){const children=this.createList() 3064while(!this.eof){children.push(this.Selector()) 3065if(this.tokenType===Comma$1){this.next() 3066continue}break}return{type:"SelectorList",loc:this.getLocationFromList(children),children:children}}function generate$R(node){this.children(node,(()=>this.token(Comma$1,",")
vendor: 14,823 bytes, lines 3066-3276
3066))}var SelectorList$1=Object.freeze({__proto__:null,generate:generate$R,name:name$1y,parse:parse$R,structure:structure$M,walkContext:walkContext$b}) 3067const REVERSE_SOLIDUS$3=0x005c 3068const QUOTATION_MARK$3=0x0022 3069const APOSTROPHE$4=0x0027 3070function decode$3(str){const len=str.length 3071const firstChar=str.charCodeAt(0) 3072const start=firstChar===QUOTATION_MARK$3||firstChar===APOSTROPHE$4?1:0 3073const end=start===1&&len>1&&str.charCodeAt(len-1)===firstChar?len-2:len-1 3074let decoded="" 3075for(let i=start;i<=end;i++){let code=str.charCodeAt(i) 3076if(code===REVERSE_SOLIDUS$3){if(i===end){i!==len-1&&(decoded=str.substr(i+1)) 3077break}code=str.charCodeAt(++i) 3078if(isValidEscape$1(REVERSE_SOLIDUS$3,code)){const escapeStart=i-1 3079const escapeEnd=consumeEscaped$1(str,escapeStart) 3080i=escapeEnd-1 3081decoded+=decodeEscaped$1(str.substring(escapeStart+1,escapeEnd))}else code===0x000d&&str.charCodeAt(i+1)===0x000a&&i++}else decoded+=str[i]}return decoded}function encode$3(str,apostrophe){const quote='"' 3082const quoteCode=QUOTATION_MARK$3 3083let encoded="" 3084let wsBeforeHexIsNeeded=false 3085for(let i=0;i<str.length;i++){const code=str.charCodeAt(i) 3086if(code===0x0000){encoded+="�" 3087continue}if(code<=0x001f||code===0x007F){encoded+="\\"+code.toString(16) 3088wsBeforeHexIsNeeded=true 3089continue}if(code===quoteCode||code===REVERSE_SOLIDUS$3){encoded+="\\"+str.charAt(i) 3090wsBeforeHexIsNeeded=false}else{wsBeforeHexIsNeeded&&(isHexDigit$1(code)||isWhiteSpace$2(code))&&(encoded+=" ") 3091encoded+=str.charAt(i) 3092wsBeforeHexIsNeeded=false}}return quote+encoded+quote}const name$1x="String" 3093const structure$L={value:String} 3094function parse$Q(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:decode$3(this.consume(String$4))}}function generate$Q(node){this.token(String$4,encode$3(node.value))}var String$3=Object.freeze({__proto__:null,generate:generate$Q,name:name$1x,parse:parse$Q,structure:structure$L}) 3095const EXCLAMATIONMARK$4=0x0021 3096function consumeRaw$6(){return this.Raw(null,false)}const name$1w="StyleSheet" 3097const walkContext$a="stylesheet" 3098const structure$K={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]} 3099function parse$P(){const start=this.tokenStart 3100const children=this.createList() 3101let child 3102while(!this.eof){switch(this.tokenType){case WhiteSpace$3:this.next() 3103continue 3104case Comment$3:if(this.charCodeAt(this.tokenStart+2)!==EXCLAMATIONMARK$4){this.next() 3105continue}child=this.Comment() 3106break 3107case CDO$3:child=this.CDO() 3108break 3109case CDC$3:child=this.CDC() 3110break 3111case AtKeyword$1:child=this.parseWithFallback(this.Atrule,consumeRaw$6) 3112break 3113default:child=this.parseWithFallback(this.Rule,consumeRaw$6)}children.push(child)}return{type:"StyleSheet",loc:this.getLocation(start,this.tokenStart),children:children}}function generate$P(node){this.children(node)}var StyleSheet$1=Object.freeze({__proto__:null,generate:generate$P,name:name$1w,parse:parse$P,structure:structure$K,walkContext:walkContext$a}) 3114const name$1v="SupportsDeclaration" 3115const structure$J={declaration:"Declaration"} 3116function parse$O(){const start=this.tokenStart 3117this.eat(LeftParenthesis$1) 3118this.skipSC() 3119const declaration=this.Declaration() 3120this.eof||this.eat(RightParenthesis$1) 3121return{type:"SupportsDeclaration",loc:this.getLocation(start,this.tokenStart),declaration:declaration}}function generate$O(node){this.token(LeftParenthesis$1,"(") 3122this.node(node.declaration) 3123this.token(RightParenthesis$1,")")}var SupportsDeclaration=Object.freeze({__proto__:null,generate:generate$O,name:name$1v,parse:parse$O,structure:structure$J}) 3124const ASTERISK$9=0x002A 3125const VERTICALLINE$5=0x007C 3126function eatIdentifierOrAsterisk$1(){this.tokenType!==Ident$1&&this.isDelim(ASTERISK$9)===false&&this.error("Identifier or asterisk is expected") 3127this.next()}const name$1u="TypeSelector" 3128const structure$I={name:String} 3129function parse$N(){const start=this.tokenStart 3130if(this.isDelim(VERTICALLINE$5)){this.next() 3131eatIdentifierOrAsterisk$1.call(this)}else{eatIdentifierOrAsterisk$1.call(this) 3132if(this.isDelim(VERTICALLINE$5)){this.next() 3133eatIdentifierOrAsterisk$1.call(this)}}return{type:"TypeSelector",loc:this.getLocation(start,this.tokenStart),name:this.substrToCursor(start)}}function generate$N(node){this.tokenize(node.name)}var TypeSelector$1=Object.freeze({__proto__:null,generate:generate$N,name:name$1u,parse:parse$N,structure:structure$I}) 3134const PLUSSIGN$c=0x002B 3135const HYPHENMINUS$8=0x002D 3136const QUESTIONMARK$3=0x003F 3137function eatHexSequence$1(offset,allowDash){let len=0 3138for(let pos=this.tokenStart+offset;pos<this.tokenEnd;pos++){const code=this.charCodeAt(pos) 3139if(code===HYPHENMINUS$8&&allowDash&&len!==0){eatHexSequence$1.call(this,offset+len+1,false) 3140return-1}isHexDigit$1(code)||this.error(allowDash&&len!==0?"Hyphen minus"+(len<6?" or hex digit":"")+" is expected":len<6?"Hex digit is expected":"Unexpected input",pos);++len>6&&this.error("Too many hex digits",pos)}this.next() 3141return len}function eatQuestionMarkSequence$1(max){let count=0 3142while(this.isDelim(QUESTIONMARK$3)){++count>max&&this.error("Too many question marks") 3143this.next()}}function startsWith$2(code){this.charCodeAt(this.tokenStart)!==code&&this.error((code===PLUSSIGN$c?"Plus sign":"Hyphen minus")+" is expected")}function scanUnicodeRange$1(){let hexLength=0 3144switch(this.tokenType){case Number$5:hexLength=eatHexSequence$1.call(this,1,true) 3145if(this.isDelim(QUESTIONMARK$3)){eatQuestionMarkSequence$1.call(this,6-hexLength) 3146break}if(this.tokenType===Dimension$3||this.tokenType===Number$5){startsWith$2.call(this,HYPHENMINUS$8) 3147eatHexSequence$1.call(this,1,false) 3148break}break 3149case Dimension$3:hexLength=eatHexSequence$1.call(this,1,true) 3150hexLength>0&&eatQuestionMarkSequence$1.call(this,6-hexLength) 3151break 3152default:this.eatDelim(PLUSSIGN$c) 3153if(this.tokenType===Ident$1){hexLength=eatHexSequence$1.call(this,0,true) 3154hexLength>0&&eatQuestionMarkSequence$1.call(this,6-hexLength) 3155break}if(this.isDelim(QUESTIONMARK$3)){this.next() 3156eatQuestionMarkSequence$1.call(this,5) 3157break}this.error("Hex digit or question mark is expected")}}const name$1t="UnicodeRange" 3158const structure$H={value:String} 3159function parse$M(){const start=this.tokenStart 3160this.eatIdent("u") 3161scanUnicodeRange$1.call(this) 3162return{type:"UnicodeRange",loc:this.getLocation(start,this.tokenStart),value:this.substrToCursor(start)}}function generate$M(node){this.tokenize(node.value)}var UnicodeRange$1=Object.freeze({__proto__:null,generate:generate$M,name:name$1t,parse:parse$M,structure:structure$H}) 3163const SPACE$5=0x0020 3164const REVERSE_SOLIDUS$2=0x005c 3165const QUOTATION_MARK$2=0x0022 3166const APOSTROPHE$3=0x0027 3167const LEFTPARENTHESIS$3=0x0028 3168const RIGHTPARENTHESIS$3=0x0029 3169function decode$2(str){const len=str.length 3170let start=4 3171let end=str.charCodeAt(len-1)===RIGHTPARENTHESIS$3?len-2:len-1 3172let decoded="" 3173while(start<end&&isWhiteSpace$2(str.charCodeAt(start)))start++ 3174while(start<end&&isWhiteSpace$2(str.charCodeAt(end)))end-- 3175for(let i=start;i<=end;i++){let code=str.charCodeAt(i) 3176if(code===REVERSE_SOLIDUS$2){if(i===end){i!==len-1&&(decoded=str.substr(i+1)) 3177break}code=str.charCodeAt(++i) 3178if(isValidEscape$1(REVERSE_SOLIDUS$2,code)){const escapeStart=i-1 3179const escapeEnd=consumeEscaped$1(str,escapeStart) 3180i=escapeEnd-1 3181decoded+=decodeEscaped$1(str.substring(escapeStart+1,escapeEnd))}else code===0x000d&&str.charCodeAt(i+1)===0x000a&&i++}else decoded+=str[i]}return decoded}function encode$2(str){let encoded="" 3182let wsBeforeHexIsNeeded=false 3183for(let i=0;i<str.length;i++){const code=str.charCodeAt(i) 3184if(code===0x0000){encoded+="�" 3185continue}if(code<=0x001f||code===0x007F){encoded+="\\"+code.toString(16) 3186wsBeforeHexIsNeeded=true 3187continue}if(code===SPACE$5||code===REVERSE_SOLIDUS$2||code===QUOTATION_MARK$2||code===APOSTROPHE$3||code===LEFTPARENTHESIS$3||code===RIGHTPARENTHESIS$3){encoded+="\\"+str.charAt(i) 3188wsBeforeHexIsNeeded=false}else{wsBeforeHexIsNeeded&&isHexDigit$1(code)&&(encoded+=" ") 3189encoded+=str.charAt(i) 3190wsBeforeHexIsNeeded=false}}return"url("+encoded+")"}const name$1s="Url" 3191const structure$G={value:String} 3192function parse$L(){const start=this.tokenStart 3193let value 3194switch(this.tokenType){case Url$4:value=decode$2(this.consume(Url$4)) 3195break 3196case Function$3:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`") 3197this.eat(Function$3) 3198this.skipSC() 3199value=decode$3(this.consume(String$4)) 3200this.skipSC() 3201this.eof||this.eat(RightParenthesis$1) 3202break 3203default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(start,this.tokenStart),value:value}}function generate$L(node){this.token(Url$4,encode$2(node.value))}var Url$3=Object.freeze({__proto__:null,generate:generate$L,name:name$1s,parse:parse$L,structure:structure$G}) 3204const name$1r="Value" 3205const structure$F={children:[[]]} 3206function parse$K(){const start=this.tokenStart 3207const children=this.readSequence(this.scope.Value) 3208return{type:"Value",loc:this.getLocation(start,this.tokenStart),children:children}}function generate$K(node){this.children(node)}var Value$1=Object.freeze({__proto__:null,generate:generate$K,name:name$1r,parse:parse$K,structure:structure$F}) 3209const SPACE$4=Object.freeze({type:"WhiteSpace",loc:null,value:" "}) 3210const name$1q="WhiteSpace" 3211const structure$E={value:String} 3212function parse$J(){this.eat(WhiteSpace$3) 3213return SPACE$4}function generate$J(node){this.token(WhiteSpace$3,node.value)}var WhiteSpace$2=Object.freeze({__proto__:null,generate:generate$J,name:name$1q,parse:parse$J,structure:structure$E}) 3214var node$3=Object.freeze({__proto__:null,AnPlusB:AnPlusB$1,Atrule:Atrule$2,AtrulePrelude:AtrulePrelude$1,AttributeSelector:AttributeSelector$2,Block:Block$1,Brackets:Brackets$1,CDC:CDC$2,CDO:CDO$2,ClassSelector:ClassSelector$1,Combinator:Combinator$1,Comment:Comment$2,Condition:Condition,Declaration:Declaration$1,DeclarationList:DeclarationList$1,Dimension:Dimension$2,Feature:Feature,FeatureFunction:FeatureFunction,FeatureRange:FeatureRange,Function:Function$2,GeneralEnclosed:GeneralEnclosed,Hash:Hash$2,IdSelector:IdSelector$1,Identifier:Identifier$1,Layer:Layer,LayerList:LayerList,MediaQuery:MediaQuery$1,MediaQueryList:MediaQueryList$1,NestingSelector:NestingSelector,Nth:Nth$1,Number:Number$4,Operator:Operator$1,Parentheses:Parentheses$1,Percentage:Percentage$2,PseudoClassSelector:PseudoClassSelector$1,PseudoElementSelector:PseudoElementSelector$1,Ratio:Ratio$1,Raw:Raw$1,Rule:Rule$1,Scope:Scope,Selector:Selector$1,SelectorList:SelectorList$1,String:String$3,StyleSheet:StyleSheet$1,SupportsDeclaration:SupportsDeclaration,TypeSelector:TypeSelector$1,UnicodeRange:UnicodeRange$1,Url:Url$3,Value:Value$1,WhiteSpace:WhiteSpace$2}) 3215var lexerConfig$1={generic:true,cssWideKeywords:cssWideKeywords$1,...definitions$1,node:node$3} 3216const NUMBERSIGN$6=0x0023 3217const ASTERISK$8=0x002A 3218const PLUSSIGN$b=0x002B 3219const HYPHENMINUS$7=0x002D 3220const SOLIDUS$7=0x002F 3221const U$2=0x0075 3222function defaultRecognizer$1(context){switch(this.tokenType){case Hash$3:return this.Hash() 3223case Comma$1:return this.Operator() 3224case LeftParenthesis$1:return this.Parentheses(this.readSequence,context.recognizer) 3225case LeftSquareBracket$1:return this.Brackets(this.readSequence,context.recognizer) 3226case String$4:return this.String() 3227case Dimension$3:return this.Dimension() 3228case Percentage$3:return this.Percentage() 3229case Number$5:return this.Number() 3230case Function$3:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,context.recognizer) 3231case Url$4:return this.Url() 3232case Ident$1:return this.cmpChar(this.tokenStart,U$2)&&this.cmpChar(this.tokenStart+1,PLUSSIGN$b)?this.UnicodeRange():this.Identifier() 3233case Delim$1:{const code=this.charCodeAt(this.tokenStart) 3234if(code===SOLIDUS$7||code===ASTERISK$8||code===PLUSSIGN$b||code===HYPHENMINUS$7)return this.Operator() 3235code===NUMBERSIGN$6&&this.error("Hex or identifier is expected",this.tokenStart+1) 3236break}}}var atrulePrelude$1={getNode:defaultRecognizer$1} 3237const NUMBERSIGN$5=0x0023 3238const AMPERSAND$2=0x0026 3239const ASTERISK$7=0x002A 3240const PLUSSIGN$a=0x002B 3241const SOLIDUS$6=0x002F 3242const FULLSTOP$3=0x002E 3243const GREATERTHANSIGN$3=0x003E 3244const VERTICALLINE$4=0x007C 3245const TILDE$3=0x007E 3246function onWhiteSpace$1(next,children){children.last!==null&&children.last.type!=="Combinator"&&next!==null&&next.type!=="Combinator"&&children.push({type:"Combinator",loc:null,name:" "})}function getNode$1(){switch(this.tokenType){case LeftSquareBracket$1:return this.AttributeSelector() 3247case Hash$3:return this.IdSelector() 3248case Colon$1:return this.lookupType(1)===Colon$1?this.PseudoElementSelector():this.PseudoClassSelector() 3249case Ident$1:return this.TypeSelector() 3250case Number$5:case Percentage$3:return this.Percentage() 3251case Dimension$3:this.charCodeAt(this.tokenStart)===FULLSTOP$3&&this.error("Identifier is expected",this.tokenStart+1) 3252break 3253case Delim$1:{const code=this.charCodeAt(this.tokenStart) 3254switch(code){case PLUSSIGN$a:case GREATERTHANSIGN$3:case TILDE$3:case SOLIDUS$6:return this.Combinator() 3255case FULLSTOP$3:return this.ClassSelector() 3256case ASTERISK$7:case VERTICALLINE$4:return this.TypeSelector() 3257case NUMBERSIGN$5:return this.IdSelector() 3258case AMPERSAND$2:return this.NestingSelector()}break}}}var selector$3={onWhiteSpace:onWhiteSpace$1,getNode:getNode$1} 3259function expressionFn$1(){return this.createSingleNodeList(this.Raw(null,false))}function varFn$1(){const children=this.createList() 3260this.skipSC() 3261children.push(this.Identifier()) 3262this.skipSC() 3263if(this.tokenType===Comma$1){children.push(this.Operator()) 3264const startIndex=this.tokenIndex 3265const value=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,false) 3266if(value.type==="Value"&&value.children.isEmpty)for(let offset=startIndex-this.tokenIndex;offset<=0;offset++)if(this.lookupType(offset)===WhiteSpace$3){value.children.appendData({type:"WhiteSpace",loc:null,value:" "}) 3267break}children.push(value)}return children}function isPlusMinusOperator$1(node){return node!==null&&node.type==="Operator"&&(node.value[node.value.length-1]==="-"||node.value[node.value.length-1]==="+")}var value$1={getNode:defaultRecognizer$1,onWhiteSpace(next,children){isPlusMinusOperator$1(next)&&(next.value=" "+next.value) 3268isPlusMinusOperator$1(children.last)&&(children.last.value+=" ")},expression:expressionFn$1,var:varFn$1} 3269var scope$2=Object.freeze({__proto__:null,AtrulePrelude:atrulePrelude$1,Selector:selector$3,Value:value$1}) 3270const nonContainerNameKeywords=new Set(["none","and","not","or"]) 3271var container={parse:{prelude(){const children=this.createList() 3272if(this.tokenType===Ident$1){const name=this.substring(this.tokenStart,this.tokenEnd) 3273nonContainerNameKeywords.has(name.toLowerCase())||children.push(this.Identifier())}children.push(this.Condition("container")) 3274return children},block(nested=false){return this.Block(nested)}}} 3275var fontFace$1={parse:{prelude:null,block(){return this.Block(true)}}} 3276function parseWithFallback(parse,fallback){return this.parseWithFallback((
3276()=>{try{return parse.call(this)}finally{this.skipSC() 3277this.lookupNonWSType(0)!==RightParenthesis$1&&this.error()}}),fallback||(()=>this.Raw(null,true)))}const parseFunctions={layer(){this.skipSC() 3278const children=this.createList() 3279const node=parseWithFallback.call(this,this.Layer) 3280node.type==="Raw"&&node.value===""||children.push(node) 3281return children},supports(){this.skipSC() 3282const children=this.createList() 3283const node=parseWithFallback.call(this,this.Declaration,(()=>parseWithFallback.call(this,(()=>this.Condition("supports"))
vendor: 13,025 bytes, lines 3283-3438
3283))) 3284node.type==="Raw"&&node.value===""||children.push(node) 3285return children}} 3286var importAtrule$1={parse:{prelude(){const children=this.createList() 3287switch(this.tokenType){case String$4:children.push(this.String()) 3288break 3289case Url$4:case Function$3:children.push(this.Url()) 3290break 3291default:this.error("String or url() is expected")}this.skipSC() 3292this.tokenType===Ident$1&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?children.push(this.Identifier()):this.tokenType===Function$3&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&children.push(this.Function(null,parseFunctions)) 3293this.skipSC() 3294this.tokenType===Function$3&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&children.push(this.Function(null,parseFunctions)) 3295this.lookupNonWSType(0)!==Ident$1&&this.lookupNonWSType(0)!==LeftParenthesis$1||children.push(this.MediaQueryList()) 3296return children},block:null}} 3297var layer={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(false)}}} 3298var media$1={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(nested=false){return this.Block(nested)}}} 3299var nest={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(true)}}} 3300var page$1={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(true)}}} 3301var scope$1={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(nested=false){return this.Block(nested)}}} 3302var startingStyle={parse:{prelude:null,block(nested=false){return this.Block(nested)}}} 3303var supports$1={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(nested=false){return this.Block(nested)}}} 3304var atrule$1={container:container,"font-face":fontFace$1,import:importAtrule$1,layer:layer,media:media$1,nest:nest,page:page$1,scope:scope$1,"starting-style":startingStyle,supports:supports$1} 3305function parseLanguageRangeList(){const children=this.createList() 3306this.skipSC() 3307loop:while(!this.eof){switch(this.tokenType){case Ident$1:children.push(this.Identifier()) 3308break 3309case String$4:children.push(this.String()) 3310break 3311case Comma$1:children.push(this.Operator()) 3312break 3313case RightParenthesis$1:break loop 3314default:this.error("Identifier, string or comma is expected")}this.skipSC()}return children}const selectorList$1={parse(){return this.createSingleNodeList(this.SelectorList())}} 3315const selector$2={parse(){return this.createSingleNodeList(this.Selector())}} 3316const identList$1={parse(){return this.createSingleNodeList(this.Identifier())}} 3317const langList={parse:parseLanguageRangeList} 3318const nth$1={parse(){return this.createSingleNodeList(this.Nth())}} 3319var pseudo$1={dir:identList$1,has:selectorList$1,lang:langList,matches:selectorList$1,is:selectorList$1,"-moz-any":selectorList$1,"-webkit-any":selectorList$1,where:selectorList$1,not:selectorList$1,"nth-child":nth$1,"nth-last-child":nth$1,"nth-last-of-type":nth$1,"nth-of-type":nth$1,slotted:selector$2,host:selector$2,"host-context":selector$2} 3320var node$2=Object.freeze({__proto__:null,AnPlusB:parse$1t,Atrule:parse$1s,AtrulePrelude:parse$1r,AttributeSelector:parse$1q,Block:parse$1p,Brackets:parse$1o,CDC:parse$1n,CDO:parse$1m,ClassSelector:parse$1l,Combinator:parse$1k,Comment:parse$1j,Condition:parse$1i,Declaration:parse$1h,DeclarationList:parse$1g,Dimension:parse$1f,Feature:parse$1e,FeatureFunction:parse$1d,FeatureRange:parse$1c,Function:parse$1b,GeneralEnclosed:parse$1a,Hash:parse$19,IdSelector:parse$17,Identifier:parse$18,Layer:parse$16,LayerList:parse$15,MediaQuery:parse$14,MediaQueryList:parse$13,NestingSelector:parse$12,Nth:parse$11,Number:parse$10,Operator:parse$$,Parentheses:parse$_,Percentage:parse$Z,PseudoClassSelector:parse$Y,PseudoElementSelector:parse$X,Ratio:parse$W,Raw:parse$V,Rule:parse$U,Scope:parse$T,Selector:parse$S,SelectorList:parse$R,String:parse$Q,StyleSheet:parse$P,SupportsDeclaration:parse$O,TypeSelector:parse$N,UnicodeRange:parse$M,Url:parse$L,Value:parse$K,WhiteSpace:parse$J}) 3321var parserConfig$1={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(options){return this.AtrulePrelude(options.atrule?String(options.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(options){return this.Condition(options.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(true)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:scope$2,atrule:atrule$1,pseudo:pseudo$1,node:node$2} 3322var walkerConfig$1={node:node$3} 3323var syntax$2=createSyntax$3({...lexerConfig$1,...parserConfig$1,...walkerConfig$1}) 3324function clone$1(node){const result={} 3325for(const key of Object.keys(node)){let value=node[key] 3326value&&(Array.isArray(value)||value instanceof List$1?value=value.map(clone$1):value.constructor===Object&&(value=clone$1(value))) 3327result[key]=value}return result}const{tokenize:tokenize$3,parse:parse$I,generate:generate$I,lexer:lexer$2,createLexer:createLexer$1,walk:walk$3,find:find$2,findLast:findLast$2,findAll:findAll$2,toPlainObject:toPlainObject$2,fromPlainObject:fromPlainObject$2,fork:fork$1}=syntax$2 3328const EOF$1=0 3329const Ident=1 3330const Function$1=2 3331const AtKeyword=3 3332const Hash$1=4 3333const String$2=5 3334const BadString=6 3335const Url$2=7 3336const BadUrl=8 3337const Delim=9 3338const Number$3=10 3339const Percentage$1=11 3340const Dimension$1=12 3341const WhiteSpace$1=13 3342const CDO$1=14 3343const CDC$1=15 3344const Colon=16 3345const Semicolon=17 3346const Comma=18 3347const LeftSquareBracket=19 3348const RightSquareBracket=20 3349const LeftParenthesis=21 3350const RightParenthesis=22 3351const LeftCurlyBracket=23 3352const RightCurlyBracket=24 3353const Comment$1=25 3354const EOF=0 3355function isDigit$1(code){return code>=0x0030&&code<=0x0039}function isHexDigit(code){return isDigit$1(code)||code>=0x0041&&code<=0x0046||code>=0x0061&&code<=0x0066}function isUppercaseLetter(code){return code>=0x0041&&code<=0x005A}function isLowercaseLetter(code){return code>=0x0061&&code<=0x007A}function isLetter(code){return isUppercaseLetter(code)||isLowercaseLetter(code)}function isNonAscii(code){return code>=0x0080}function isNameStart(code){return isLetter(code)||isNonAscii(code)||code===0x005F}function isName(code){return isNameStart(code)||isDigit$1(code)||code===0x002D}function isNonPrintable(code){return code>=0x0000&&code<=0x0008||code===0x000B||code>=0x000E&&code<=0x001F||code===0x007F}function isNewline(code){return code===0x000A||code===0x000D||code===0x000C}function isWhiteSpace$1(code){return isNewline(code)||code===0x0020||code===0x0009}function isValidEscape(first,second){if(first!==0x005C)return false 3356if(isNewline(second)||second===EOF)return false 3357return true}function isIdentifierStart(first,second,third){if(first===0x002D)return isNameStart(second)||second===0x002D||isValidEscape(second,third) 3358if(isNameStart(first))return true 3359if(first===0x005C)return isValidEscape(first,second) 3360return false}function isNumberStart(first,second,third){if(first===0x002B||first===0x002D){if(isDigit$1(second))return 2 3361return second===0x002E&&isDigit$1(third)?3:0}if(first===0x002E)return isDigit$1(second)?2:0 3362if(isDigit$1(first))return 1 3363return 0}function isBOM(code){if(code===0xFEFF)return 1 3364if(code===0xFFFE)return 1 3365return 0}const CATEGORY=new Array(0x80) 3366const EofCategory=0x80 3367const WhiteSpaceCategory=0x82 3368const DigitCategory=0x83 3369const NameStartCategory=0x84 3370const NonPrintableCategory=0x85 3371for(let i=0;i<CATEGORY.length;i++)CATEGORY[i]=isWhiteSpace$1(i)&&WhiteSpaceCategory||isDigit$1(i)&&DigitCategory||isNameStart(i)&&NameStartCategory||isNonPrintable(i)&&NonPrintableCategory||i||EofCategory 3372function charCodeCategory(code){return code<0x80?CATEGORY[code]:NameStartCategory}function getCharCode(source,offset){return offset<source.length?source.charCodeAt(offset):0}function getNewlineLength(source,offset,code){if(code===13&&getCharCode(source,offset+1)===10)return 2 3373return 1}function cmpChar(testStr,offset,referenceCode){let code=testStr.charCodeAt(offset) 3374isUppercaseLetter(code)&&(code|=32) 3375return code===referenceCode}function cmpStr(testStr,start,end,referenceStr){if(end-start!==referenceStr.length)return false 3376if(start<0||end>testStr.length)return false 3377for(let i=start;i<end;i++){const referenceCode=referenceStr.charCodeAt(i-start) 3378let testCode=testStr.charCodeAt(i) 3379isUppercaseLetter(testCode)&&(testCode|=32) 3380if(testCode!==referenceCode)return false}return true}function findWhiteSpaceStart(source,offset){for(;offset>=0;offset--)if(!isWhiteSpace$1(source.charCodeAt(offset)))break 3381return offset+1}function findWhiteSpaceEnd(source,offset){for(;offset<source.length;offset++)if(!isWhiteSpace$1(source.charCodeAt(offset)))break 3382return offset}function findDecimalNumberEnd(source,offset){for(;offset<source.length;offset++)if(!isDigit$1(source.charCodeAt(offset)))break 3383return offset}function consumeEscaped(source,offset){offset+=2 3384if(isHexDigit(getCharCode(source,offset-1))){for(const maxOffset=Math.min(source.length,offset+5);offset<maxOffset;offset++)if(!isHexDigit(getCharCode(source,offset)))break 3385const code=getCharCode(source,offset) 3386isWhiteSpace$1(code)&&(offset+=getNewlineLength(source,offset,code))}return offset}function consumeName(source,offset){for(;offset<source.length;offset++){const code=source.charCodeAt(offset) 3387if(isName(code))continue 3388if(isValidEscape(code,getCharCode(source,offset+1))){offset=consumeEscaped(source,offset)-1 3389continue}break}return offset}function consumeNumber$1(source,offset){let code=source.charCodeAt(offset) 3390code!==0x002B&&code!==0x002D||(code=source.charCodeAt(offset+=1)) 3391if(isDigit$1(code)){offset=findDecimalNumberEnd(source,offset+1) 3392code=source.charCodeAt(offset)}if(code===0x002E&&isDigit$1(source.charCodeAt(offset+1))){offset+=2 3393offset=findDecimalNumberEnd(source,offset)}if(cmpChar(source,offset,101)){let sign=0 3394code=source.charCodeAt(offset+1) 3395if(code===0x002D||code===0x002B){sign=1 3396code=source.charCodeAt(offset+2)}isDigit$1(code)&&(offset=findDecimalNumberEnd(source,offset+1+sign+1))}return offset}function consumeBadUrlRemnants(source,offset){for(;offset<source.length;offset++){const code=source.charCodeAt(offset) 3397if(code===0x0029){offset++ 3398break}isValidEscape(code,getCharCode(source,offset+1))&&(offset=consumeEscaped(source,offset))}return offset}function decodeEscaped(escaped){if(escaped.length===1&&!isHexDigit(escaped.charCodeAt(0)))return escaped[0] 3399let code=parseInt(escaped,16);(code===0||code>=0xD800&&code<=0xDFFF||code>0x10FFFF)&&(code=0xFFFD) 3400return String.fromCodePoint(code)}var tokenNames=["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"] 3401const MIN_SIZE=16384 3402function adoptBuffer(buffer=null,size){if(buffer===null||buffer.length<size)return new Uint32Array(Math.max(size+1024,MIN_SIZE)) 3403return buffer}const N$4=10 3404const F$2=12 3405const R$2=13 3406function computeLinesAndColumns(host){const source=host.source 3407const sourceLength=source.length 3408const startOffset=source.length>0?isBOM(source.charCodeAt(0)):0 3409const lines=adoptBuffer(host.lines,sourceLength) 3410const columns=adoptBuffer(host.columns,sourceLength) 3411let line=host.startLine 3412let column=host.startColumn 3413for(let i=startOffset;i<sourceLength;i++){const code=source.charCodeAt(i) 3414lines[i]=line 3415columns[i]=column++ 3416if(code===N$4||code===R$2||code===F$2){if(code===R$2&&i+1<sourceLength&&source.charCodeAt(i+1)===N$4){i++ 3417lines[i]=line 3418columns[i]=column}line++ 3419column=1}}lines[sourceLength]=line 3420columns[sourceLength]=column 3421host.lines=lines 3422host.columns=columns 3423host.computed=true}class OffsetToLocation{constructor(){this.lines=null 3424this.columns=null 3425this.computed=false}setSource(source,startOffset=0,startLine=1,startColumn=1){this.source=source 3426this.startOffset=startOffset 3427this.startLine=startLine 3428this.startColumn=startColumn 3429this.computed=false}getLocation(offset,filename){this.computed||computeLinesAndColumns(this) 3430return{source:filename,offset:this.startOffset+offset,line:this.lines[offset],column:this.columns[offset]}}getLocationRange(start,end,filename){this.computed||computeLinesAndColumns(this) 3431return{source:filename,start:{offset:this.startOffset+start,line:this.lines[start],column:this.columns[start]},end:{offset:this.startOffset+end,line:this.lines[end],column:this.columns[end]}}}}const OFFSET_MASK=0x00FFFFFF 3432const TYPE_SHIFT=24 3433const balancePair$1=new Map([[Function$1,RightParenthesis],[LeftParenthesis,RightParenthesis],[LeftSquareBracket,RightSquareBracket],[LeftCurlyBracket,RightCurlyBracket]]) 3434class TokenStream{constructor(source,tokenize){this.setSource(source,tokenize)}reset(){this.eof=false 3435this.tokenIndex=-1 3436this.tokenType=0 3437this.tokenStart=this.firstCharOffset 3438this.tokenEnd=this.firstCharOffset}setSource(source="",tokenize=(
vendor: 4,184 bytes, lines 3438-3510
3438()=>{})){source=String(source||"") 3439const sourceLength=source.length 3440const offsetAndType=adoptBuffer(this.offsetAndType,source.length+1) 3441const balance=adoptBuffer(this.balance,source.length+1) 3442let tokenCount=0 3443let balanceCloseType=0 3444let balanceStart=0 3445let firstCharOffset=-1 3446this.offsetAndType=null 3447this.balance=null 3448tokenize(source,((type,start,end)=>{switch(type){default:balance[tokenCount]=sourceLength 3449break 3450case balanceCloseType:{let balancePrev=balanceStart&OFFSET_MASK 3451balanceStart=balance[balancePrev] 3452balanceCloseType=balanceStart>>TYPE_SHIFT 3453balance[tokenCount]=balancePrev 3454balance[balancePrev++]=tokenCount 3455for(;balancePrev<tokenCount;balancePrev++)balance[balancePrev]===sourceLength&&(balance[balancePrev]=tokenCount) 3456break}case LeftParenthesis:case Function$1:case LeftSquareBracket:case LeftCurlyBracket:balance[tokenCount]=balanceStart 3457balanceCloseType=balancePair$1.get(type) 3458balanceStart=balanceCloseType<<TYPE_SHIFT|tokenCount 3459break}offsetAndType[tokenCount++]=type<<TYPE_SHIFT|end 3460firstCharOffset===-1&&(firstCharOffset=start)})) 3461offsetAndType[tokenCount]=EOF$1<<TYPE_SHIFT|sourceLength 3462balance[tokenCount]=sourceLength 3463balance[sourceLength]=sourceLength 3464while(balanceStart!==0){const balancePrev=balanceStart&OFFSET_MASK 3465balanceStart=balance[balancePrev] 3466balance[balancePrev]=sourceLength}this.source=source 3467this.firstCharOffset=firstCharOffset===-1?0:firstCharOffset 3468this.tokenCount=tokenCount 3469this.offsetAndType=offsetAndType 3470this.balance=balance 3471this.reset() 3472this.next()}lookupType(offset){offset+=this.tokenIndex 3473if(offset<this.tokenCount)return this.offsetAndType[offset]>>TYPE_SHIFT 3474return EOF$1}lookupOffset(offset){offset+=this.tokenIndex 3475if(offset<this.tokenCount)return this.offsetAndType[offset-1]&OFFSET_MASK 3476return this.source.length}lookupValue(offset,referenceStr){offset+=this.tokenIndex 3477if(offset<this.tokenCount)return cmpStr(this.source,this.offsetAndType[offset-1]&OFFSET_MASK,this.offsetAndType[offset]&OFFSET_MASK,referenceStr) 3478return false}getTokenStart(tokenIndex){if(tokenIndex===this.tokenIndex)return this.tokenStart 3479if(tokenIndex>0)return tokenIndex<this.tokenCount?this.offsetAndType[tokenIndex-1]&OFFSET_MASK:this.offsetAndType[this.tokenCount]&OFFSET_MASK 3480return this.firstCharOffset}substrToCursor(start){return this.source.substring(start,this.tokenStart)}isBalanceEdge(pos){return this.balance[this.tokenIndex]<pos}isDelim(code,offset){if(offset)return this.lookupType(offset)===Delim&&this.source.charCodeAt(this.lookupOffset(offset))===code 3481return this.tokenType===Delim&&this.source.charCodeAt(this.tokenStart)===code}skip(tokenCount){let next=this.tokenIndex+tokenCount 3482if(next<this.tokenCount){this.tokenIndex=next 3483this.tokenStart=this.offsetAndType[next-1]&OFFSET_MASK 3484next=this.offsetAndType[next] 3485this.tokenType=next>>TYPE_SHIFT 3486this.tokenEnd=next&OFFSET_MASK}else{this.tokenIndex=this.tokenCount 3487this.next()}}next(){let next=this.tokenIndex+1 3488if(next<this.tokenCount){this.tokenIndex=next 3489this.tokenStart=this.tokenEnd 3490next=this.offsetAndType[next] 3491this.tokenType=next>>TYPE_SHIFT 3492this.tokenEnd=next&OFFSET_MASK}else{this.eof=true 3493this.tokenIndex=this.tokenCount 3494this.tokenType=EOF$1 3495this.tokenStart=this.tokenEnd=this.source.length}}skipSC(){while(this.tokenType===WhiteSpace$1||this.tokenType===Comment$1)this.next()}skipUntilBalanced(startToken,stopConsume){let cursor=startToken 3496let balanceEnd 3497let offset 3498loop:for(;cursor<this.tokenCount;cursor++){balanceEnd=this.balance[cursor] 3499if(balanceEnd<startToken)break loop 3500offset=cursor>0?this.offsetAndType[cursor-1]&OFFSET_MASK:this.firstCharOffset 3501switch(stopConsume(this.source.charCodeAt(offset))){case 1:break loop 3502case 2:cursor++ 3503break loop 3504default:this.balance[balanceEnd]===cursor&&(cursor=balanceEnd)}}this.skip(cursor-this.tokenIndex)}forEachToken(fn){for(let i=0,offset=this.firstCharOffset;i<this.tokenCount;i++){const start=offset 3505const item=this.offsetAndType[i] 3506const end=item&OFFSET_MASK 3507const type=item>>TYPE_SHIFT 3508offset=end 3509fn(type,start,end,i)}}dump(){const tokens=new Array(this.tokenCount) 3510this.forEachToken(((type,start,end,index)=>{tokens[index]={idx:index,type:tokenNames[type],chunk:this.source.substring(start,end),balance:this.balance[index]}})
vendor: 10,771 bytes, lines 3510-3721
3510) 3511return tokens}}function tokenize$2(source,onToken){function getCharCode(offset){return offset<sourceLength?source.charCodeAt(offset):0}function consumeNumericToken(){offset=consumeNumber$1(source,offset) 3512if(isIdentifierStart(getCharCode(offset),getCharCode(offset+1),getCharCode(offset+2))){type=Dimension$1 3513offset=consumeName(source,offset) 3514return}if(getCharCode(offset)===0x0025){type=Percentage$1 3515offset++ 3516return}type=Number$3}function consumeIdentLikeToken(){const nameStartOffset=offset 3517offset=consumeName(source,offset) 3518if(cmpStr(source,nameStartOffset,offset,"url")&&getCharCode(offset)===0x0028){offset=findWhiteSpaceEnd(source,offset+1) 3519if(getCharCode(offset)===0x0022||getCharCode(offset)===0x0027){type=Function$1 3520offset=nameStartOffset+4 3521return}consumeUrlToken() 3522return}if(getCharCode(offset)===0x0028){type=Function$1 3523offset++ 3524return}type=Ident}function consumeStringToken(endingCodePoint){endingCodePoint||(endingCodePoint=getCharCode(offset++)) 3525type=String$2 3526for(;offset<source.length;offset++){const code=source.charCodeAt(offset) 3527switch(charCodeCategory(code)){case endingCodePoint:offset++ 3528return 3529case WhiteSpaceCategory:if(isNewline(code)){offset+=getNewlineLength(source,offset,code) 3530type=BadString 3531return}break 3532case 0x005C:if(offset===source.length-1)break 3533const nextCode=getCharCode(offset+1) 3534isNewline(nextCode)?offset+=getNewlineLength(source,offset+1,nextCode):isValidEscape(code,nextCode)&&(offset=consumeEscaped(source,offset)-1) 3535break}}}function consumeUrlToken(){type=Url$2 3536offset=findWhiteSpaceEnd(source,offset) 3537for(;offset<source.length;offset++){const code=source.charCodeAt(offset) 3538switch(charCodeCategory(code)){case 0x0029:offset++ 3539return 3540case WhiteSpaceCategory:offset=findWhiteSpaceEnd(source,offset) 3541if(getCharCode(offset)===0x0029||offset>=source.length){offset<source.length&&offset++ 3542return}offset=consumeBadUrlRemnants(source,offset) 3543type=BadUrl 3544return 3545case 0x0022:case 0x0027:case 0x0028:case NonPrintableCategory:offset=consumeBadUrlRemnants(source,offset) 3546type=BadUrl 3547return 3548case 0x005C:if(isValidEscape(code,getCharCode(offset+1))){offset=consumeEscaped(source,offset)-1 3549break}offset=consumeBadUrlRemnants(source,offset) 3550type=BadUrl 3551return}}}source=String(source||"") 3552const sourceLength=source.length 3553let start=isBOM(getCharCode(0)) 3554let offset=start 3555let type 3556while(offset<sourceLength){const code=source.charCodeAt(offset) 3557switch(charCodeCategory(code)){case WhiteSpaceCategory:type=WhiteSpace$1 3558offset=findWhiteSpaceEnd(source,offset+1) 3559break 3560case 0x0022:consumeStringToken() 3561break 3562case 0x0023:if(isName(getCharCode(offset+1))||isValidEscape(getCharCode(offset+1),getCharCode(offset+2))){type=Hash$1 3563offset=consumeName(source,offset+1)}else{type=Delim 3564offset++}break 3565case 0x0027:consumeStringToken() 3566break 3567case 0x0028:type=LeftParenthesis 3568offset++ 3569break 3570case 0x0029:type=RightParenthesis 3571offset++ 3572break 3573case 0x002B:if(isNumberStart(code,getCharCode(offset+1),getCharCode(offset+2)))consumeNumericToken() 3574else{type=Delim 3575offset++}break 3576case 0x002C:type=Comma 3577offset++ 3578break 3579case 0x002D:if(isNumberStart(code,getCharCode(offset+1),getCharCode(offset+2)))consumeNumericToken() 3580else if(getCharCode(offset+1)===0x002D&&getCharCode(offset+2)===0x003E){type=CDC$1 3581offset+=3}else if(isIdentifierStart(code,getCharCode(offset+1),getCharCode(offset+2)))consumeIdentLikeToken() 3582else{type=Delim 3583offset++}break 3584case 0x002E:if(isNumberStart(code,getCharCode(offset+1),getCharCode(offset+2)))consumeNumericToken() 3585else{type=Delim 3586offset++}break 3587case 0x002F:if(getCharCode(offset+1)===0x002A){type=Comment$1 3588offset=source.indexOf("*/",offset+2) 3589offset=offset===-1?source.length:offset+2}else{type=Delim 3590offset++}break 3591case 0x003A:type=Colon 3592offset++ 3593break 3594case 0x003B:type=Semicolon 3595offset++ 3596break 3597case 0x003C:if(getCharCode(offset+1)===0x0021&&getCharCode(offset+2)===0x002D&&getCharCode(offset+3)===0x002D){type=CDO$1 3598offset+=4}else{type=Delim 3599offset++}break 3600case 0x0040:if(isIdentifierStart(getCharCode(offset+1),getCharCode(offset+2),getCharCode(offset+3))){type=AtKeyword 3601offset=consumeName(source,offset+1)}else{type=Delim 3602offset++}break 3603case 0x005B:type=LeftSquareBracket 3604offset++ 3605break 3606case 0x005C:if(isValidEscape(code,getCharCode(offset+1)))consumeIdentLikeToken() 3607else{type=Delim 3608offset++}break 3609case 0x005D:type=RightSquareBracket 3610offset++ 3611break 3612case 0x007B:type=LeftCurlyBracket 3613offset++ 3614break 3615case 0x007D:type=RightCurlyBracket 3616offset++ 3617break 3618case DigitCategory:consumeNumericToken() 3619break 3620case NameStartCategory:consumeIdentLikeToken() 3621break 3622default:type=Delim 3623offset++}onToken(type,start,start=offset)}}let releasedCursors=null 3624class List{static createItem(data){return{prev:null,next:null,data:data}}constructor(){this.head=null 3625this.tail=null 3626this.cursor=null}createItem(data){return List.createItem(data)}allocateCursor(prev,next){let cursor 3627if(releasedCursors!==null){cursor=releasedCursors 3628releasedCursors=releasedCursors.cursor 3629cursor.prev=prev 3630cursor.next=next 3631cursor.cursor=this.cursor}else cursor={prev:prev,next:next,cursor:this.cursor} 3632this.cursor=cursor 3633return cursor}releaseCursor(){const{cursor:cursor}=this 3634this.cursor=cursor.cursor 3635cursor.prev=null 3636cursor.next=null 3637cursor.cursor=releasedCursors 3638releasedCursors=cursor}updateCursors(prevOld,prevNew,nextOld,nextNew){let{cursor:cursor}=this 3639while(cursor!==null){cursor.prev===prevOld&&(cursor.prev=prevNew) 3640cursor.next===nextOld&&(cursor.next=nextNew) 3641cursor=cursor.cursor}}*[Symbol.iterator](){for(let cursor=this.head;cursor!==null;cursor=cursor.next)yield cursor.data}get size(){let size=0 3642for(let cursor=this.head;cursor!==null;cursor=cursor.next)size++ 3643return size}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(array){let cursor=null 3644this.head=null 3645for(let data of array){const item=List.createItem(data) 3646cursor!==null?cursor.next=item:this.head=item 3647item.prev=cursor 3648cursor=item}this.tail=cursor 3649return this}toArray(){return[...this]}toJSON(){return[...this]}forEach(fn,thisArg=this){const cursor=this.allocateCursor(null,this.head) 3650while(cursor.next!==null){const item=cursor.next 3651cursor.next=item.next 3652fn.call(thisArg,item.data,item,this)}this.releaseCursor()}forEachRight(fn,thisArg=this){const cursor=this.allocateCursor(this.tail,null) 3653while(cursor.prev!==null){const item=cursor.prev 3654cursor.prev=item.prev 3655fn.call(thisArg,item.data,item,this)}this.releaseCursor()}reduce(fn,initialValue,thisArg=this){let cursor=this.allocateCursor(null,this.head) 3656let acc=initialValue 3657let item 3658while(cursor.next!==null){item=cursor.next 3659cursor.next=item.next 3660acc=fn.call(thisArg,acc,item.data,item,this)}this.releaseCursor() 3661return acc}reduceRight(fn,initialValue,thisArg=this){let cursor=this.allocateCursor(this.tail,null) 3662let acc=initialValue 3663let item 3664while(cursor.prev!==null){item=cursor.prev 3665cursor.prev=item.prev 3666acc=fn.call(thisArg,acc,item.data,item,this)}this.releaseCursor() 3667return acc}some(fn,thisArg=this){for(let cursor=this.head;cursor!==null;cursor=cursor.next)if(fn.call(thisArg,cursor.data,cursor,this))return true 3668return false}map(fn,thisArg=this){const result=new List 3669for(let cursor=this.head;cursor!==null;cursor=cursor.next)result.appendData(fn.call(thisArg,cursor.data,cursor,this)) 3670return result}filter(fn,thisArg=this){const result=new List 3671for(let cursor=this.head;cursor!==null;cursor=cursor.next)fn.call(thisArg,cursor.data,cursor,this)&&result.appendData(cursor.data) 3672return result}nextUntil(start,fn,thisArg=this){if(start===null)return 3673const cursor=this.allocateCursor(null,start) 3674while(cursor.next!==null){const item=cursor.next 3675cursor.next=item.next 3676if(fn.call(thisArg,item.data,item,this))break}this.releaseCursor()}prevUntil(start,fn,thisArg=this){if(start===null)return 3677const cursor=this.allocateCursor(start,null) 3678while(cursor.prev!==null){const item=cursor.prev 3679cursor.prev=item.prev 3680if(fn.call(thisArg,item.data,item,this))break}this.releaseCursor()}clear(){this.head=null 3681this.tail=null}copy(){const result=new List 3682for(let data of this)result.appendData(data) 3683return result}prepend(item){this.updateCursors(null,item,this.head,item) 3684if(this.head!==null){this.head.prev=item 3685item.next=this.head}else this.tail=item 3686this.head=item 3687return this}prependData(data){return this.prepend(List.createItem(data))}append(item){return this.insert(item)}appendData(data){return this.insert(List.createItem(data))}insert(item,before=null){if(before!==null){this.updateCursors(before.prev,item,before,item) 3688if(before.prev===null){if(this.head!==before)throw new Error("before doesn't belong to list") 3689this.head=item 3690before.prev=item 3691item.next=before 3692this.updateCursors(null,item)}else{before.prev.next=item 3693item.prev=before.prev 3694before.prev=item 3695item.next=before}}else{this.updateCursors(this.tail,item,null,item) 3696if(this.tail!==null){this.tail.next=item 3697item.prev=this.tail}else this.head=item 3698this.tail=item}return this}insertData(data,before){return this.insert(List.createItem(data),before)}remove(item){this.updateCursors(item,item.prev,item,item.next) 3699if(item.prev!==null)item.prev.next=item.next 3700else{if(this.head!==item)throw new Error("item doesn't belong to list") 3701this.head=item.next}if(item.next!==null)item.next.prev=item.prev 3702else{if(this.tail!==item)throw new Error("item doesn't belong to list") 3703this.tail=item.prev}item.prev=null 3704item.next=null 3705return item}push(data){this.insert(List.createItem(data))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(data){this.prepend(List.createItem(data))}shift(){return this.head!==null?this.remove(this.head):null}prependList(list){return this.insertList(list,this.head)}appendList(list){return this.insertList(list)}insertList(list,before){if(list.head===null)return this 3706if(before!==void 0&&before!==null){this.updateCursors(before.prev,list.tail,before,list.head) 3707if(before.prev!==null){before.prev.next=list.head 3708list.head.prev=before.prev}else this.head=list.head 3709before.prev=list.tail 3710list.tail.next=before}else{this.updateCursors(this.tail,list.tail,null,list.head) 3711if(this.tail!==null){this.tail.next=list.head 3712list.head.prev=this.tail}else this.head=list.head 3713this.tail=list.tail}list.head=null 3714list.tail=null 3715return this}replace(oldItem,newItemOrList){"head"in newItemOrList?this.insertList(newItemOrList,oldItem):this.insert(newItemOrList,oldItem) 3716this.remove(oldItem)}}function createCustomError(name,message){const error=Object.create(SyntaxError.prototype) 3717const errorStack=new Error 3718return Object.assign(error,{name:name,message:message,get stack(){return(errorStack.stack||"").replace(/^(.+\n){1,3}/,`${name}: ${message}\n`)}})}const MAX_LINE_LENGTH=100 3719const OFFSET_CORRECTION=60 3720const TAB_REPLACEMENT=" " 3721function sourceFragment({source:source,line:line,column:column},extraLines){function processLines(start,end){return lines.slice(start,end).map((
vendor: 19,224 bytes, lines 3721-3943
3721(line,idx)=>String(start+idx+1).padStart(maxNumLength)+" |"+line)).join("\n")}const lines=source.split(/\r\n?|\n|\f/) 3722const startLine=Math.max(1,line-extraLines)-1 3723const endLine=Math.min(line+extraLines,lines.length+1) 3724const maxNumLength=Math.max(4,String(endLine).length)+1 3725let cutLeft=0 3726column+=(TAB_REPLACEMENT.length-1)*(lines[line-1].substr(0,column-1).match(/\t/g)||[]).length 3727if(column>MAX_LINE_LENGTH){cutLeft=column-OFFSET_CORRECTION+3 3728column=OFFSET_CORRECTION-2}for(let i=startLine;i<=endLine;i++)if(i>=0&&i<lines.length){lines[i]=lines[i].replace(/\t/g,TAB_REPLACEMENT) 3729lines[i]=(cutLeft>0&&lines[i].length>cutLeft?"â¦":"")+lines[i].substr(cutLeft,MAX_LINE_LENGTH-2)+(lines[i].length>cutLeft+MAX_LINE_LENGTH-1?"â¦":"")}return[processLines(startLine,line),new Array(column+maxNumLength+2).join("-")+"^",processLines(line,endLine)].filter(Boolean).join("\n")}function SyntaxError$2(message,source,offset,line,column){const error=Object.assign(createCustomError("SyntaxError",message),{source:source,offset:offset,line:line,column:column,sourceFragment:extraLines=>sourceFragment({source:source,line:line,column:column},isNaN(extraLines)?0:extraLines),get formattedMessage(){return`Parse error: ${message}\n`+sourceFragment({source:source,line:line,column:column},2)}}) 3730return error}function readSequence$1(recognizer){const children=this.createList() 3731let space=false 3732const context={recognizer:recognizer} 3733while(!this.eof){switch(this.tokenType){case Comment$1:this.next() 3734continue 3735case WhiteSpace$1:space=true 3736this.next() 3737continue}let child=recognizer.getNode.call(this,context) 3738if(child===void 0)break 3739if(space){recognizer.onWhiteSpace&&recognizer.onWhiteSpace.call(this,child,children,context) 3740space=false}children.push(child)}space&&recognizer.onWhiteSpace&&recognizer.onWhiteSpace.call(this,null,children,context) 3741return children}const NOOP=()=>{} 3742const EXCLAMATIONMARK$3=0x0021 3743const NUMBERSIGN$4=0x0023 3744const SEMICOLON=0x003B 3745const LEFTCURLYBRACKET$1=0x007B 3746const NULL=0 3747function createParseContext(name){return function(){return this[name]()}}function fetchParseValues(dict){const result=Object.create(null) 3748for(const name in dict){const item=dict[name] 3749const fn=item.parse||item 3750fn&&(result[name]=fn)}return result}function processConfig(config){const parseConfig={context:Object.create(null),scope:Object.assign(Object.create(null),config.scope),atrule:fetchParseValues(config.atrule),pseudo:fetchParseValues(config.pseudo),node:fetchParseValues(config.node)} 3751for(const name in config.parseContext)switch(typeof config.parseContext[name]){case"function":parseConfig.context[name]=config.parseContext[name] 3752break 3753case"string":parseConfig.context[name]=createParseContext(config.parseContext[name]) 3754break}return{config:parseConfig,...parseConfig,...parseConfig.node}}function createParser(config){let source="" 3755let filename="<unknown>" 3756let needPositions=false 3757let onParseError=NOOP 3758let onParseErrorThrow=false 3759const locationMap=new OffsetToLocation 3760const parser=Object.assign(new TokenStream,processConfig(config||{}),{parseAtrulePrelude:true,parseRulePrelude:true,parseValue:true,parseCustomProperty:false,readSequence:readSequence$1,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket:code=>code===LEFTCURLYBRACKET$1?1:0,consumeUntilLeftCurlyBracketOrSemicolon:code=>code===LEFTCURLYBRACKET$1||code===SEMICOLON?1:0,consumeUntilExclamationMarkOrSemicolon:code=>code===EXCLAMATIONMARK$3||code===SEMICOLON?1:0,consumeUntilSemicolonIncluded:code=>code===SEMICOLON?2:0,createList:()=>new List,createSingleNodeList:node=>(new List).appendData(node),getFirstListNode:list=>list&&list.first,getLastListNode:list=>list&&list.last,parseWithFallback(consumer,fallback){const startToken=this.tokenIndex 3761try{return consumer.call(this)}catch(e){if(onParseErrorThrow)throw e 3762const fallbackNode=fallback.call(this,startToken) 3763onParseErrorThrow=true 3764onParseError(e,fallbackNode) 3765onParseErrorThrow=false 3766return fallbackNode}},lookupNonWSType(offset){let type 3767do{type=this.lookupType(offset++) 3768if(type!==WhiteSpace$1)return type}while(type!==NULL) 3769return NULL},charCodeAt:offset=>offset>=0&&offset<source.length?source.charCodeAt(offset):0,substring:(offsetStart,offsetEnd)=>source.substring(offsetStart,offsetEnd),substrToCursor(start){return this.source.substring(start,this.tokenStart)},cmpChar:(offset,charCode)=>cmpChar(source,offset,charCode),cmpStr:(offsetStart,offsetEnd,str)=>cmpStr(source,offsetStart,offsetEnd,str),consume(tokenType){const start=this.tokenStart 3770this.eat(tokenType) 3771return this.substrToCursor(start)},consumeFunctionName(){const name=source.substring(this.tokenStart,this.tokenEnd-1) 3772this.eat(Function$1) 3773return name},consumeNumber(type){const number=source.substring(this.tokenStart,consumeNumber$1(source,this.tokenStart)) 3774this.eat(type) 3775return number},eat(tokenType){if(this.tokenType!==tokenType){const tokenName=tokenNames[tokenType].slice(0,-6).replace(/-/g," ").replace(/^./,(m=>m.toUpperCase())) 3776let message=`${/[[\](){}]/.test(tokenName)?`"${tokenName}"`:tokenName} is expected` 3777let offset=this.tokenStart 3778switch(tokenType){case Ident:if(this.tokenType===Function$1||this.tokenType===Url$2){offset=this.tokenEnd-1 3779message="Identifier is expected but function found"}else message="Identifier is expected" 3780break 3781case Hash$1:if(this.isDelim(NUMBERSIGN$4)){this.next() 3782offset++ 3783message="Name is expected"}break 3784case Percentage$1:if(this.tokenType===Number$3){offset=this.tokenEnd 3785message="Percent sign is expected"}break}this.error(message,offset)}this.next()},eatIdent(name){this.tokenType===Ident&&this.lookupValue(0,name)!==false||this.error(`Identifier "${name}" is expected`) 3786this.next()},eatDelim(code){this.isDelim(code)||this.error(`Delim "${String.fromCharCode(code)}" is expected`) 3787this.next()},getLocation(start,end){if(needPositions)return locationMap.getLocationRange(start,end,filename) 3788return null},getLocationFromList(list){if(needPositions){const head=this.getFirstListNode(list) 3789const tail=this.getLastListNode(list) 3790return 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<source.length?locationMap.getLocation(offset):this.eof?locationMap.getLocation(findWhiteSpaceStart(source,source.length-1)):locationMap.getLocation(this.tokenStart) 3791throw new SyntaxError$2(message||"Unexpected input",source,location.offset,location.line,location.column)}}) 3792const parse=function(source_,options){source=source_ 3793options=options||{} 3794parser.setSource(source,tokenize$2) 3795locationMap.setSource(source,options.offset,options.line,options.column) 3796filename=options.filename||"<unknown>" 3797needPositions=Boolean(options.positions) 3798onParseError=typeof options.onParseError==="function"?options.onParseError:NOOP 3799onParseErrorThrow=false 3800parser.parseAtrulePrelude=!("parseAtrulePrelude"in options)||Boolean(options.parseAtrulePrelude) 3801parser.parseRulePrelude=!("parseRulePrelude"in options)||Boolean(options.parseRulePrelude) 3802parser.parseValue=!("parseValue"in options)||Boolean(options.parseValue) 3803parser.parseCustomProperty="parseCustomProperty"in options&&Boolean(options.parseCustomProperty) 3804const{context:context="default",onComment:onComment}=options 3805if(context in parser.context===false)throw new Error("Unknown context `"+context+"`") 3806typeof onComment==="function"&&parser.forEachToken(((type,start,end)=>{if(type===Comment$1){const loc=parser.getLocation(start,end) 3807const value=cmpStr(source,end-2,end,"*/")?source.slice(start+2,end-2):source.slice(start+2,end) 3808onComment(value,loc)}})) 3809const ast=parser.context[context].call(parser,options) 3810parser.eof||parser.error() 3811return ast} 3812return Object.assign(parse,{SyntaxError:SyntaxError$2,config:parser.config})}const trackNodes=new Set(["Atrule","Selector","Declaration"]) 3813function generateSourceMap(handlers){const map=new SourceMapGenerator_1 3814const generated={line:1,column:0} 3815const original={line:0,column:0} 3816const activatedGenerated={line:1,column:0} 3817const activatedMapping={generated:activatedGenerated} 3818let line=1 3819let column=0 3820let sourceMappingActive=false 3821const origHandlersNode=handlers.node 3822handlers.node=function(node){if(node.loc&&node.loc.start&&trackNodes.has(node.type)){const nodeLine=node.loc.start.line 3823const nodeColumn=node.loc.start.column-1 3824if(original.line!==nodeLine||original.column!==nodeColumn){original.line=nodeLine 3825original.column=nodeColumn 3826generated.line=line 3827generated.column=column 3828if(sourceMappingActive){sourceMappingActive=false 3829generated.line===activatedGenerated.line&&generated.column===activatedGenerated.column||map.addMapping(activatedMapping)}sourceMappingActive=true 3830map.addMapping({source:node.loc.source,original:original,generated:generated})}}origHandlersNode.call(this,node) 3831if(sourceMappingActive&&trackNodes.has(node.type)){activatedGenerated.line=line 3832activatedGenerated.column=column}} 3833const origHandlersEmit=handlers.emit 3834handlers.emit=function(value,type,auto){for(let i=0;i<value.length;i++)if(value.charCodeAt(i)===10){line++ 3835column=0}else column++ 3836origHandlersEmit(value,type,auto)} 3837const origHandlersResult=handlers.result 3838handlers.result=function(){sourceMappingActive&&map.addMapping(activatedMapping) 3839return{css:origHandlersResult(),map:map}} 3840return handlers}const PLUSSIGN$9=0x002B 3841const HYPHENMINUS$6=0x002D 3842const code=(type,value)=>{type===Delim&&(type=value) 3843if(typeof type==="string"){const charCode=type.charCodeAt(0) 3844return charCode>0x7F?0x8000:charCode<<8}return type} 3845const specPairs=[[Ident,Ident],[Ident,Function$1],[Ident,Url$2],[Ident,BadUrl],[Ident,"-"],[Ident,Number$3],[Ident,Percentage$1],[Ident,Dimension$1],[Ident,CDC$1],[Ident,LeftParenthesis],[AtKeyword,Ident],[AtKeyword,Function$1],[AtKeyword,Url$2],[AtKeyword,BadUrl],[AtKeyword,"-"],[AtKeyword,Number$3],[AtKeyword,Percentage$1],[AtKeyword,Dimension$1],[AtKeyword,CDC$1],[Hash$1,Ident],[Hash$1,Function$1],[Hash$1,Url$2],[Hash$1,BadUrl],[Hash$1,"-"],[Hash$1,Number$3],[Hash$1,Percentage$1],[Hash$1,Dimension$1],[Hash$1,CDC$1],[Dimension$1,Ident],[Dimension$1,Function$1],[Dimension$1,Url$2],[Dimension$1,BadUrl],[Dimension$1,"-"],[Dimension$1,Number$3],[Dimension$1,Percentage$1],[Dimension$1,Dimension$1],[Dimension$1,CDC$1],["#",Ident],["#",Function$1],["#",Url$2],["#",BadUrl],["#","-"],["#",Number$3],["#",Percentage$1],["#",Dimension$1],["#",CDC$1],["-",Ident],["-",Function$1],["-",Url$2],["-",BadUrl],["-","-"],["-",Number$3],["-",Percentage$1],["-",Dimension$1],["-",CDC$1],[Number$3,Ident],[Number$3,Function$1],[Number$3,Url$2],[Number$3,BadUrl],[Number$3,Number$3],[Number$3,Percentage$1],[Number$3,Dimension$1],[Number$3,"%"],[Number$3,CDC$1],["@",Ident],["@",Function$1],["@",Url$2],["@",BadUrl],["@","-"],["@",CDC$1],[".",Number$3],[".",Percentage$1],[".",Dimension$1],["+",Number$3],["+",Percentage$1],["+",Dimension$1],["/","*"]] 3846const safePairs=specPairs.concat([[Ident,Hash$1],[Dimension$1,Hash$1],[Hash$1,Hash$1],[AtKeyword,LeftParenthesis],[AtKeyword,String$2],[AtKeyword,Colon],[Percentage$1,Percentage$1],[Percentage$1,Dimension$1],[Percentage$1,Function$1],[Percentage$1,"-"],[RightParenthesis,Ident],[RightParenthesis,Function$1],[RightParenthesis,Percentage$1],[RightParenthesis,Dimension$1],[RightParenthesis,Hash$1],[RightParenthesis,"-"]]) 3847function createMap(pairs){const isWhiteSpaceRequired=new Set(pairs.map((([prev,next])=>code(prev)<<16|code(next)))) 3848return function(prevCode,type,value){const nextCode=code(type,value) 3849const nextCharCode=value.charCodeAt(0) 3850const emitWs=nextCharCode===HYPHENMINUS$6&&type!==Ident&&type!==Function$1&&type!==CDC$1||nextCharCode===PLUSSIGN$9?isWhiteSpaceRequired.has(prevCode<<16|nextCharCode<<8):isWhiteSpaceRequired.has(prevCode<<16|nextCode) 3851emitWs&&this.emit(" ",WhiteSpace$1,true) 3852return nextCode}}const spec=createMap(specPairs) 3853const safe=createMap(safePairs) 3854var tokenBefore=Object.freeze({__proto__:null,safe:safe,spec:spec}) 3855const REVERSESOLIDUS=0x005c 3856function processChildren(node,delimeter){if(typeof delimeter==="function"){let prev=null 3857node.children.forEach((node=>{prev!==null&&delimeter.call(this,prev) 3858this.node(node) 3859prev=node})) 3860return}node.children.forEach(this.node,this)}function processChunk(chunk){tokenize$2(chunk,((type,start,end)=>{this.token(type,chunk.slice(start,end))}))}function createGenerator(config){const types=new Map 3861for(let name in config.node){const item=config.node[name] 3862const fn=item.generate||item 3863typeof fn==="function"&&types.set(name,item.generate||item)}return function(node,options){let buffer="" 3864let prevCode=0 3865let handlers={node(node){if(!types.has(node.type))throw new Error("Unknown node type: "+node.type) 3866types.get(node.type).call(publicApi,node)},tokenBefore:safe,token(type,value){prevCode=this.tokenBefore(prevCode,type,value) 3867this.emit(value,type,false) 3868type===Delim&&value.charCodeAt(0)===REVERSESOLIDUS&&this.emit("\n",WhiteSpace$1,true)},emit(value){buffer+=value},result:()=>buffer} 3869if(options){typeof options.decorator==="function"&&(handlers=options.decorator(handlers)) 3870options.sourceMap&&(handlers=generateSourceMap(handlers)) 3871options.mode in tokenBefore&&(handlers.tokenBefore=tokenBefore[options.mode])}const publicApi={node:node=>handlers.node(node),children:processChildren,token:(type,value)=>handlers.token(type,value),tokenize:processChunk} 3872handlers.node(node) 3873return handlers.result()}}function createConvertor(walk){return{fromPlainObject(ast){walk(ast,{enter(node){node.children&&node.children instanceof List===false&&(node.children=(new List).fromArray(node.children))}}) 3874return ast},toPlainObject(ast){walk(ast,{leave(node){node.children&&node.children instanceof List&&(node.children=node.children.toArray())}}) 3875return ast}}}const{hasOwnProperty:hasOwnProperty$8}=Object.prototype 3876const noop$2=function(){} 3877function ensureFunction$1(value){return typeof value==="function"?value:noop$2}function invokeForType(fn,type){return function(node,item,list){node.type===type&&fn.call(this,node,item,list)}}function getWalkersFromStructure(name,nodeType){const structure=nodeType.structure 3878const walkers=[] 3879for(const key in structure){if(hasOwnProperty$8.call(structure,key)===false)continue 3880let fieldTypes=structure[key] 3881const walker={name:key,type:false,nullable:false} 3882Array.isArray(fieldTypes)||(fieldTypes=[fieldTypes]) 3883for(const fieldType of fieldTypes)fieldType===null?walker.nullable=true:typeof fieldType==="string"?walker.type="node":Array.isArray(fieldType)&&(walker.type="list") 3884walker.type&&walkers.push(walker)}if(walkers.length)return{context:nodeType.walkContext,fields:walkers} 3885return null}function getTypesFromConfig(config){const types={} 3886for(const name in config.node)if(hasOwnProperty$8.call(config.node,name)){const nodeType=config.node[name] 3887if(!nodeType.structure)throw new Error("Missed `structure` field in `"+name+"` node type definition") 3888types[name]=getWalkersFromStructure(name,nodeType)}return types}function createTypeIterator(config,reverse){const fields=config.fields.slice() 3889const contextName=config.context 3890const useContext=typeof contextName==="string" 3891reverse&&fields.reverse() 3892return function(node,context,walk,walkReducer){let prevContextValue 3893if(useContext){prevContextValue=context[contextName] 3894context[contextName]=node}for(const field of fields){const ref=node[field.name] 3895if(!field.nullable||ref)if(field.type==="list"){const breakWalk=reverse?ref.reduceRight(walkReducer,false):ref.reduce(walkReducer,false) 3896if(breakWalk)return true}else if(walk(ref))return true}useContext&&(context[contextName]=prevContextValue)}}function createFastTraveralMap({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(config){const types=getTypesFromConfig(config) 3897const iteratorsNatural={} 3898const iteratorsReverse={} 3899const breakWalk=Symbol("break-walk") 3900const skipNode=Symbol("skip-node") 3901for(const name in types)if(hasOwnProperty$8.call(types,name)&&types[name]!==null){iteratorsNatural[name]=createTypeIterator(types[name],false) 3902iteratorsReverse[name]=createTypeIterator(types[name],true)}const fastTraversalIteratorsNatural=createFastTraveralMap(iteratorsNatural) 3903const fastTraversalIteratorsReverse=createFastTraveralMap(iteratorsReverse) 3904const walk=function(root,options){function walkNode(node,item,list){const enterRet=enter.call(context,node,item,list) 3905if(enterRet===breakWalk)return true 3906if(enterRet===skipNode)return false 3907if(iterators.hasOwnProperty(node.type)&&iterators[node.type](node,context,walkNode,walkReducer))return true 3908if(leave.call(context,node,item,list)===breakWalk)return true 3909return false}let enter=noop$2 3910let leave=noop$2 3911let iterators=iteratorsNatural 3912let walkReducer=(ret,data,item,list)=>ret||walkNode(data,item,list) 3913const context={break:breakWalk,skip:skipNode,root:root,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null} 3914if(typeof options==="function")enter=options 3915else if(options){enter=ensureFunction$1(options.enter) 3916leave=ensureFunction$1(options.leave) 3917options.reverse&&(iterators=iteratorsReverse) 3918if(options.visit){if(fastTraversalIteratorsNatural.hasOwnProperty(options.visit))iterators=options.reverse?fastTraversalIteratorsReverse[options.visit]:fastTraversalIteratorsNatural[options.visit] 3919else if(!types.hasOwnProperty(options.visit))throw new Error("Bad value `"+options.visit+"` for `visit` option (should be: "+Object.keys(types).sort().join(", ")+")") 3920enter=invokeForType(enter,options.visit) 3921leave=invokeForType(leave,options.visit)}}if(enter===noop$2&&leave===noop$2)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function") 3922walkNode(root)} 3923walk.break=breakWalk 3924walk.skip=skipNode 3925walk.find=function(ast,fn){let found=null 3926walk(ast,(function(node,item,list){if(fn.call(this,node,item,list)){found=node 3927return breakWalk}})) 3928return found} 3929walk.findLast=function(ast,fn){let found=null 3930walk(ast,{reverse:true,enter(node,item,list){if(fn.call(this,node,item,list)){found=node 3931return breakWalk}}}) 3932return found} 3933walk.findAll=function(ast,fn){const found=[] 3934walk(ast,(function(node,item,list){fn.call(this,node,item,list)&&found.push(node)})) 3935return found} 3936return walk}function noop$1(value){return value}function generateMultiplier(multiplier){const{min:min,max:max,comma:comma}=multiplier 3937if(min===0&&max===0)return comma?"#?":"*" 3938if(min===0&&max===1)return"?" 3939if(min===1&&max===0)return comma?"#":"+" 3940if(min===1&&max===1)return"" 3941return(comma?"#":"")+(min===max?"{"+min+"}":"{"+min+","+(max!==0?max:"")+"}")}function generateTypeOpts(node){switch(node.type){case"Range":return" ["+(node.min===null?"-â":node.min)+","+(node.max===null?"â":node.max)+"]" 3942default:throw new Error("Unknown node type `"+node.type+"`")}}function generateSequence(node,decorate,forceBraces,compact){const combinator=node.combinator===" "||compact?node.combinator:" "+node.combinator+" " 3943const result=node.terms.map((term=>internalGenerate(term,decorate,forceBraces,compact)
vendor: 19,616 bytes, lines 3943-4222
3943)).join(combinator) 3944if(node.explicit||forceBraces)return(compact||result[0]===","?"[":"[ ")+result+(compact?"]":" ]") 3945return result}function internalGenerate(node,decorate,forceBraces,compact){let result 3946switch(node.type){case"Group":result=generateSequence(node,decorate,forceBraces,compact)+(node.disallowEmpty?"!":"") 3947break 3948case"Multiplier":return internalGenerate(node.term,decorate,forceBraces,compact)+decorate(generateMultiplier(node),node) 3949case"Type":result="<"+node.name+(node.opts?decorate(generateTypeOpts(node.opts),node.opts):"")+">" 3950break 3951case"Property":result="<'"+node.name+"'>" 3952break 3953case"Keyword":result=node.name 3954break 3955case"AtKeyword":result="@"+node.name 3956break 3957case"Function":result=node.name+"(" 3958break 3959case"String":case"Token":result=node.value 3960break 3961case"Comma":result="," 3962break 3963default:throw new Error("Unknown node type `"+node.type+"`")}return decorate(result,node)}function generate$H(node,options){let decorate=noop$1 3964let forceBraces=false 3965let compact=false 3966if(typeof options==="function")decorate=options 3967else if(options){forceBraces=Boolean(options.forceBraces) 3968compact=Boolean(options.compact) 3969typeof options.decorate==="function"&&(decorate=options.decorate)}return internalGenerate(node,decorate,forceBraces,compact)}const defaultLoc={offset:0,line:1,column:1} 3970function locateMismatch(matchResult,node){const tokens=matchResult.tokens 3971const longestMatch=matchResult.longestMatch 3972const mismatchNode=longestMatch<tokens.length&&tokens[longestMatch].node||null 3973const badNode=mismatchNode!==node?mismatchNode:null 3974let mismatchOffset=0 3975let mismatchLength=0 3976let entries=0 3977let css="" 3978let start 3979let end 3980for(let i=0;i<tokens.length;i++){const token=tokens[i].value 3981if(i===longestMatch){mismatchLength=token.length 3982mismatchOffset=css.length}badNode!==null&&tokens[i].node===badNode&&(i<=longestMatch?entries++:entries=0) 3983css+=token}if(longestMatch===tokens.length||entries>1){start=fromLoc(badNode||node,"end")||buildLoc(defaultLoc,css) 3984end=buildLoc(start)}else{start=fromLoc(badNode,"start")||buildLoc(fromLoc(node,"start")||defaultLoc,css.slice(0,mismatchOffset)) 3985end=fromLoc(badNode,"end")||buildLoc(start,css.substr(mismatchOffset,mismatchLength))}return{css:css,mismatchOffset:mismatchOffset,mismatchLength:mismatchLength,start:start,end:end}}function fromLoc(node,point){const value=node&&node.loc&&node.loc[point] 3986if(value)return"line"in value?buildLoc(value):value 3987return null}function buildLoc({offset:offset,line:line,column:column},extra){const loc={offset:offset,line:line,column:column} 3988if(extra){const lines=extra.split(/\n|\r\n?|\f/) 3989loc.offset+=extra.length 3990loc.line+=lines.length-1 3991loc.column=lines.length===1?loc.column+extra.length:lines.pop().length+1}return loc}const SyntaxReferenceError=function(type,referenceName){const error=createCustomError("SyntaxReferenceError",type+(referenceName?" `"+referenceName+"`":"")) 3992error.reference=referenceName 3993return error} 3994const SyntaxMatchError=function(message,syntax,node,matchResult){const error=createCustomError("SyntaxMatchError",message) 3995const{css:css,mismatchOffset:mismatchOffset,mismatchLength:mismatchLength,start:start,end:end}=locateMismatch(matchResult,node) 3996error.rawMessage=message 3997error.syntax=syntax?generate$H(syntax):"<generic>" 3998error.css=css 3999error.mismatchOffset=mismatchOffset 4000error.mismatchLength=mismatchLength 4001error.message=message+"\n syntax: "+error.syntax+"\n value: "+(css||"<empty string>")+"\n --------"+new Array(error.mismatchOffset+1).join("-")+"^" 4002Object.assign(error,start) 4003error.loc={source:node&&node.loc&&node.loc.source||"<unknown>",start:start,end:end} 4004return error} 4005const keywords=new Map 4006const properties=new Map 4007const HYPHENMINUS$5=45 4008const keyword=getKeywordDescriptor 4009const property=getPropertyDescriptor 4010function isCustomProperty(str,offset){offset=offset||0 4011return str.length-offset>=2&&str.charCodeAt(offset)===HYPHENMINUS$5&&str.charCodeAt(offset+1)===HYPHENMINUS$5}function getVendorPrefix(str,offset){offset=offset||0 4012if(str.length-offset>=3&&str.charCodeAt(offset)===HYPHENMINUS$5&&str.charCodeAt(offset+1)!==HYPHENMINUS$5){const secondDashIndex=str.indexOf("-",offset+2) 4013if(secondDashIndex!==-1)return str.substring(offset,secondDashIndex+1)}return""}function getKeywordDescriptor(keyword){if(keywords.has(keyword))return keywords.get(keyword) 4014const name=keyword.toLowerCase() 4015let descriptor=keywords.get(name) 4016if(descriptor===void 0){const custom=isCustomProperty(name,0) 4017const vendor=custom?"":getVendorPrefix(name,0) 4018descriptor=Object.freeze({basename:name.substr(vendor.length),name:name,prefix:vendor,vendor:vendor,custom:custom})}keywords.set(keyword,descriptor) 4019return descriptor}function getPropertyDescriptor(property){if(properties.has(property))return properties.get(property) 4020let name=property 4021let hack=property[0] 4022hack==="/"?hack=property[1]==="/"?"//":"/":hack!=="_"&&hack!=="*"&&hack!=="$"&&hack!=="#"&&hack!=="+"&&hack!=="&"&&(hack="") 4023const custom=isCustomProperty(name,hack.length) 4024if(!custom){name=name.toLowerCase() 4025if(properties.has(name)){const descriptor=properties.get(name) 4026properties.set(property,descriptor) 4027return descriptor}}const vendor=custom?"":getVendorPrefix(name,hack.length) 4028const prefix=name.substr(0,hack.length+vendor.length) 4029const descriptor=Object.freeze({basename:name.substr(prefix.length),name:name.substr(hack.length),hack:hack,vendor:vendor,prefix:prefix,custom:custom}) 4030properties.set(property,descriptor) 4031return descriptor}const cssWideKeywords=["initial","inherit","unset","revert","revert-layer"] 4032const PLUSSIGN$8=0x002B 4033const HYPHENMINUS$4=0x002D 4034const N$3=0x006E 4035const DISALLOW_SIGN$1=true 4036const ALLOW_SIGN$1=false 4037function isDelim$1(token,code){return token!==null&&token.type===Delim&&token.value.charCodeAt(0)===code}function skipSC(token,offset,getNextToken){while(token!==null&&(token.type===WhiteSpace$1||token.type===Comment$1))token=getNextToken(++offset) 4038return offset}function checkInteger$1(token,valueOffset,disallowSign,offset){if(!token)return 0 4039const code=token.value.charCodeAt(valueOffset) 4040if(code===PLUSSIGN$8||code===HYPHENMINUS$4){if(disallowSign)return 0 4041valueOffset++}for(;valueOffset<token.value.length;valueOffset++)if(!isDigit$1(token.value.charCodeAt(valueOffset)))return 0 4042return offset+1}function consumeB$1(token,offset_,getNextToken){let sign=false 4043let offset=skipSC(token,offset_,getNextToken) 4044token=getNextToken(offset) 4045if(token===null)return offset_ 4046if(token.type!==Number$3){if(!isDelim$1(token,PLUSSIGN$8)&&!isDelim$1(token,HYPHENMINUS$4))return offset_ 4047sign=true 4048offset=skipSC(getNextToken(++offset),offset,getNextToken) 4049token=getNextToken(offset) 4050if(token===null||token.type!==Number$3)return 0}if(!sign){const code=token.value.charCodeAt(0) 4051if(code!==PLUSSIGN$8&&code!==HYPHENMINUS$4)return 0}return checkInteger$1(token,sign?0:1,sign,offset)}function anPlusB(token,getNextToken){let offset=0 4052if(!token)return 0 4053if(token.type===Number$3)return checkInteger$1(token,0,ALLOW_SIGN$1,offset) 4054if(token.type===Ident&&token.value.charCodeAt(0)===HYPHENMINUS$4){if(!cmpChar(token.value,1,N$3))return 0 4055switch(token.value.length){case 2:return consumeB$1(getNextToken(++offset),offset,getNextToken) 4056case 3:if(token.value.charCodeAt(2)!==HYPHENMINUS$4)return 0 4057offset=skipSC(getNextToken(++offset),offset,getNextToken) 4058token=getNextToken(offset) 4059return checkInteger$1(token,0,DISALLOW_SIGN$1,offset) 4060default:if(token.value.charCodeAt(2)!==HYPHENMINUS$4)return 0 4061return checkInteger$1(token,3,DISALLOW_SIGN$1,offset)}}else if(token.type===Ident||isDelim$1(token,PLUSSIGN$8)&&getNextToken(offset+1).type===Ident){token.type!==Ident&&(token=getNextToken(++offset)) 4062if(token===null||!cmpChar(token.value,0,N$3))return 0 4063switch(token.value.length){case 1:return consumeB$1(getNextToken(++offset),offset,getNextToken) 4064case 2:if(token.value.charCodeAt(1)!==HYPHENMINUS$4)return 0 4065offset=skipSC(getNextToken(++offset),offset,getNextToken) 4066token=getNextToken(offset) 4067return checkInteger$1(token,0,DISALLOW_SIGN$1,offset) 4068default:if(token.value.charCodeAt(1)!==HYPHENMINUS$4)return 0 4069return checkInteger$1(token,2,DISALLOW_SIGN$1,offset)}}else if(token.type===Dimension$1){let code=token.value.charCodeAt(0) 4070let sign=code===PLUSSIGN$8||code===HYPHENMINUS$4?1:0 4071let i=sign 4072for(;i<token.value.length;i++)if(!isDigit$1(token.value.charCodeAt(i)))break 4073if(i===sign)return 0 4074if(!cmpChar(token.value,i,N$3))return 0 4075if(i+1===token.value.length)return consumeB$1(getNextToken(++offset),offset,getNextToken) 4076if(token.value.charCodeAt(i+1)!==HYPHENMINUS$4)return 0 4077if(i+2===token.value.length){offset=skipSC(getNextToken(++offset),offset,getNextToken) 4078token=getNextToken(offset) 4079return checkInteger$1(token,0,DISALLOW_SIGN$1,offset)}return checkInteger$1(token,i+2,DISALLOW_SIGN$1,offset)}return 0}const PLUSSIGN$7=0x002B 4080const HYPHENMINUS$3=0x002D 4081const QUESTIONMARK$2=0x003F 4082const U$1=0x0075 4083function isDelim(token,code){return token!==null&&token.type===Delim&&token.value.charCodeAt(0)===code}function startsWith$1(token,code){return token.value.charCodeAt(0)===code}function hexSequence(token,offset,allowDash){let hexlen=0 4084for(let pos=offset;pos<token.value.length;pos++){const code=token.value.charCodeAt(pos) 4085if(code===HYPHENMINUS$3&&allowDash&&hexlen!==0){hexSequence(token,offset+hexlen+1,false) 4086return 6}if(!isHexDigit(code))return 0 4087if(++hexlen>6)return 0}return hexlen}function withQuestionMarkSequence(consumed,length,getNextToken){if(!consumed)return 0 4088while(isDelim(getNextToken(length),QUESTIONMARK$2)){if(++consumed>6)return 0 4089length++}return length}function urange(token,getNextToken){let length=0 4090if(token===null||token.type!==Ident||!cmpChar(token.value,0,U$1))return 0 4091token=getNextToken(++length) 4092if(token===null)return 0 4093if(isDelim(token,PLUSSIGN$7)){token=getNextToken(++length) 4094if(token===null)return 0 4095if(token.type===Ident)return withQuestionMarkSequence(hexSequence(token,0,true),++length,getNextToken) 4096if(isDelim(token,QUESTIONMARK$2))return withQuestionMarkSequence(1,++length,getNextToken) 4097return 0}if(token.type===Number$3){const consumedHexLength=hexSequence(token,1,true) 4098if(consumedHexLength===0)return 0 4099token=getNextToken(++length) 4100if(token===null)return length 4101if(token.type===Dimension$1||token.type===Number$3){if(!startsWith$1(token,HYPHENMINUS$3)||!hexSequence(token,1,false))return 0 4102return length+1}return withQuestionMarkSequence(consumedHexLength,length,getNextToken)}if(token.type===Dimension$1)return withQuestionMarkSequence(hexSequence(token,1,true),++length,getNextToken) 4103return 0}const calcFunctionNames=["calc(","-moz-calc(","-webkit-calc("] 4104const balancePair=new Map([[Function$1,RightParenthesis],[LeftParenthesis,RightParenthesis],[LeftSquareBracket,RightSquareBracket],[LeftCurlyBracket,RightCurlyBracket]]) 4105const 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"] 4106const ANGLE=["deg","grad","rad","turn"] 4107const TIME=["s","ms"] 4108const FREQUENCY=["hz","khz"] 4109const RESOLUTION=["dpi","dpcm","dppx","x"] 4110const FLEX=["fr"] 4111const DECIBEL=["db"] 4112const SEMITONES=["st"] 4113function charCodeAt(str,index){return index<str.length?str.charCodeAt(index):0}function eqStr(actual,expected){return cmpStr(actual,0,actual.length,expected)}function eqStrAny(actual,expected){for(let i=0;i<expected.length;i++)if(eqStr(actual,expected[i]))return true 4114return false}function isPostfixIeHack(str,offset){if(offset!==str.length-2)return false 4115return charCodeAt(str,offset)===0x005C&&isDigit$1(charCodeAt(str,offset+1))}function outOfRange(opts,value,numEnd){if(opts&&opts.type==="Range"){const num=Number(numEnd!==void 0&&numEnd!==value.length?value.substr(0,numEnd):value) 4116if(isNaN(num))return true 4117if(opts.min!==null&&num<opts.min&&typeof opts.min!=="string")return true 4118if(opts.max!==null&&num>opts.max&&typeof opts.max!=="string")return true}return false}function consumeFunction(token,getNextToken){let balanceCloseType=0 4119let balanceStash=[] 4120let length=0 4121scan:do{switch(token.type){case RightCurlyBracket:case RightParenthesis:case RightSquareBracket:if(token.type!==balanceCloseType)break scan 4122balanceCloseType=balanceStash.pop() 4123if(balanceStash.length===0){length++ 4124break scan}break 4125case Function$1:case LeftParenthesis:case LeftSquareBracket:case LeftCurlyBracket:balanceStash.push(balanceCloseType) 4126balanceCloseType=balancePair.get(token.type) 4127break}length++}while(token=getNextToken(length)) 4128return length}function calc(next){return function(token,getNextToken,opts){if(token===null)return 0 4129if(token.type===Function$1&&eqStrAny(token.value,calcFunctionNames))return consumeFunction(token,getNextToken) 4130return next(token,getNextToken,opts)}}function tokenType(expectedTokenType){return function(token){if(token===null||token.type!==expectedTokenType)return 0 4131return 1}}function customIdent(token){if(token===null||token.type!==Ident)return 0 4132const name=token.value.toLowerCase() 4133if(eqStrAny(name,cssWideKeywords))return 0 4134if(eqStr(name,"default"))return 0 4135return 1}function customPropertyName(token){if(token===null||token.type!==Ident)return 0 4136if(charCodeAt(token.value,0)!==0x002D||charCodeAt(token.value,1)!==0x002D)return 0 4137return 1}function hexColor(token){if(token===null||token.type!==Hash$1)return 0 4138const length=token.value.length 4139if(length!==4&&length!==5&&length!==7&&length!==9)return 0 4140for(let i=1;i<length;i++)if(!isHexDigit(charCodeAt(token.value,i)))return 0 4141return 1}function idSelector(token){if(token===null||token.type!==Hash$1)return 0 4142if(!isIdentifierStart(charCodeAt(token.value,1),charCodeAt(token.value,2),charCodeAt(token.value,3)))return 0 4143return 1}function declarationValue(token,getNextToken){if(!token)return 0 4144let balanceCloseType=0 4145let balanceStash=[] 4146let length=0 4147scan:do{switch(token.type){case BadString:case BadUrl:break scan 4148case RightCurlyBracket:case RightParenthesis:case RightSquareBracket:if(token.type!==balanceCloseType)break scan 4149balanceCloseType=balanceStash.pop() 4150break 4151case Semicolon:if(balanceCloseType===0)break scan 4152break 4153case Delim:if(balanceCloseType===0&&token.value==="!")break scan 4154break 4155case Function$1:case LeftParenthesis:case LeftSquareBracket:case LeftCurlyBracket:balanceStash.push(balanceCloseType) 4156balanceCloseType=balancePair.get(token.type) 4157break}length++}while(token=getNextToken(length)) 4158return length}function anyValue(token,getNextToken){if(!token)return 0 4159let balanceCloseType=0 4160let balanceStash=[] 4161let length=0 4162scan:do{switch(token.type){case BadString:case BadUrl:break scan 4163case RightCurlyBracket:case RightParenthesis:case RightSquareBracket:if(token.type!==balanceCloseType)break scan 4164balanceCloseType=balanceStash.pop() 4165break 4166case Function$1:case LeftParenthesis:case LeftSquareBracket:case LeftCurlyBracket:balanceStash.push(balanceCloseType) 4167balanceCloseType=balancePair.get(token.type) 4168break}length++}while(token=getNextToken(length)) 4169return length}function dimension(type){type&&(type=new Set(type)) 4170return function(token,getNextToken,opts){if(token===null||token.type!==Dimension$1)return 0 4171const numberEnd=consumeNumber$1(token.value,0) 4172if(type!==null){const reverseSolidusOffset=token.value.indexOf("\\",numberEnd) 4173const unit=reverseSolidusOffset!==-1&&isPostfixIeHack(token.value,reverseSolidusOffset)?token.value.substring(numberEnd,reverseSolidusOffset):token.value.substr(numberEnd) 4174if(type.has(unit.toLowerCase())===false)return 0}if(outOfRange(opts,token.value,numberEnd))return 0 4175return 1}}function percentage(token,getNextToken,opts){if(token===null||token.type!==Percentage$1)return 0 4176if(outOfRange(opts,token.value,token.value.length-1))return 0 4177return 1}function zero(next){typeof next!=="function"&&(next=function(){return 0}) 4178return function(token,getNextToken,opts){if(token!==null&&token.type===Number$3&&Number(token.value)===0)return 1 4179return next(token,getNextToken,opts)}}function number(token,getNextToken,opts){if(token===null)return 0 4180const numberEnd=consumeNumber$1(token.value,0) 4181const isNumber=numberEnd===token.value.length 4182if(!isNumber&&!isPostfixIeHack(token.value,numberEnd))return 0 4183if(outOfRange(opts,token.value,numberEnd))return 0 4184return 1}function integer(token,getNextToken,opts){if(token===null||token.type!==Number$3)return 0 4185let i=charCodeAt(token.value,0)===0x002B||charCodeAt(token.value,0)===0x002D?1:0 4186for(;i<token.value.length;i++)if(!isDigit$1(charCodeAt(token.value,i)))return 0 4187if(outOfRange(opts,token.value,i))return 0 4188return 1}var generic={"ident-token":tokenType(Ident),"function-token":tokenType(Function$1),"at-keyword-token":tokenType(AtKeyword),"hash-token":tokenType(Hash$1),"string-token":tokenType(String$2),"bad-string-token":tokenType(BadString),"url-token":tokenType(Url$2),"bad-url-token":tokenType(BadUrl),"delim-token":tokenType(Delim),"number-token":tokenType(Number$3),"percentage-token":tokenType(Percentage$1),"dimension-token":tokenType(Dimension$1),"whitespace-token":tokenType(WhiteSpace$1),"CDO-token":tokenType(CDO$1),"CDC-token":tokenType(CDC$1),"colon-token":tokenType(Colon),"semicolon-token":tokenType(Semicolon),"comma-token":tokenType(Comma),"[-token":tokenType(LeftSquareBracket),"]-token":tokenType(RightSquareBracket),"(-token":tokenType(LeftParenthesis),")-token":tokenType(RightParenthesis),"{-token":tokenType(LeftCurlyBracket),"}-token":tokenType(RightCurlyBracket),string:tokenType(String$2),ident:tokenType(Ident),"custom-ident":customIdent,"custom-property-name":customPropertyName,"hex-color":hexColor,"id-selector":idSelector,"an-plus-b":anPlusB,urange:urange,"declaration-value":declarationValue,"any-value":anyValue,dimension:calc(dimension(null)),angle:calc(dimension(ANGLE)),decibel:calc(dimension(DECIBEL)),frequency:calc(dimension(FREQUENCY)),flex:calc(dimension(FLEX)),length:calc(zero(dimension(LENGTH))),resolution:calc(dimension(RESOLUTION)),semitones:calc(dimension(SEMITONES)),time:calc(dimension(TIME)),percentage:calc(percentage),zero:zero(),number:calc(number),integer:calc(integer)} 4189function SyntaxError$1(message,input,offset){return Object.assign(createCustomError("SyntaxError",message),{input:input,offset:offset,rawMessage:message,message:message+"\n "+input+"\n--"+new Array((offset||input.length)+1).join("-")+"^"})}const TAB$1=9 4190const N$2=10 4191const F$1=12 4192const R$1=13 4193const SPACE$3=32 4194class Tokenizer{constructor(str){this.str=str 4195this.pos=0}charCodeAt(pos){return pos<this.str.length?this.str.charCodeAt(pos):0}charCode(){return this.charCodeAt(this.pos)}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(pos){return this.charCodeAt(this.findWsEnd(pos))}findWsEnd(pos){for(;pos<this.str.length;pos++){const code=this.str.charCodeAt(pos) 4196if(code!==R$1&&code!==N$2&&code!==F$1&&code!==SPACE$3&&code!==TAB$1)break}return pos}substringToPos(end){return this.str.substring(this.pos,this.pos=end)}eat(code){this.charCode()!==code&&this.error("Expect `"+String.fromCharCode(code)+"`") 4197this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(message){throw new SyntaxError$1(message,this.str,this.pos)}}const TAB=9 4198const N$1=10 4199const F=12 4200const R=13 4201const SPACE$2=32 4202const EXCLAMATIONMARK$2=33 4203const NUMBERSIGN$3=35 4204const AMPERSAND$1=38 4205const APOSTROPHE$2=39 4206const LEFTPARENTHESIS$2=40 4207const RIGHTPARENTHESIS$2=41 4208const ASTERISK$6=42 4209const PLUSSIGN$6=43 4210const COMMA=44 4211const HYPERMINUS=45 4212const LESSTHANSIGN=60 4213const GREATERTHANSIGN$2=62 4214const QUESTIONMARK$1=63 4215const COMMERCIALAT=64 4216const LEFTSQUAREBRACKET=91 4217const RIGHTSQUAREBRACKET=93 4218const LEFTCURLYBRACKET=123 4219const VERTICALLINE$3=124 4220const RIGHTCURLYBRACKET=125 4221const INFINITY=8734 4222const NAME_CHAR=new Uint8Array(128).map((
vendor: 37,165 bytes, lines 4222-4690
4222(_,idx)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(idx))?1:0)) 4223const COMBINATOR_PRECEDENCE={" ":1,"&&":2,"||":3,"|":4} 4224function scanSpaces(tokenizer){return tokenizer.substringToPos(tokenizer.findWsEnd(tokenizer.pos))}function scanWord(tokenizer){let end=tokenizer.pos 4225for(;end<tokenizer.str.length;end++){const code=tokenizer.str.charCodeAt(end) 4226if(code>=128||NAME_CHAR[code]===0)break}tokenizer.pos===end&&tokenizer.error("Expect a keyword") 4227return tokenizer.substringToPos(end)}function scanNumber(tokenizer){let end=tokenizer.pos 4228for(;end<tokenizer.str.length;end++){const code=tokenizer.str.charCodeAt(end) 4229if(code<48||code>57)break}tokenizer.pos===end&&tokenizer.error("Expect a number") 4230return tokenizer.substringToPos(end)}function scanString(tokenizer){const end=tokenizer.str.indexOf("'",tokenizer.pos+1) 4231if(end===-1){tokenizer.pos=tokenizer.str.length 4232tokenizer.error("Expect an apostrophe")}return tokenizer.substringToPos(end+1)}function readMultiplierRange(tokenizer){let min=null 4233let max=null 4234tokenizer.eat(LEFTCURLYBRACKET) 4235min=scanNumber(tokenizer) 4236if(tokenizer.charCode()===COMMA){tokenizer.pos++ 4237tokenizer.charCode()!==RIGHTCURLYBRACKET&&(max=scanNumber(tokenizer))}else max=min 4238tokenizer.eat(RIGHTCURLYBRACKET) 4239return{min:Number(min),max:max?Number(max):0}}function readMultiplier(tokenizer){let range=null 4240let comma=false 4241switch(tokenizer.charCode()){case ASTERISK$6:tokenizer.pos++ 4242range={min:0,max:0} 4243break 4244case PLUSSIGN$6:tokenizer.pos++ 4245range={min:1,max:0} 4246break 4247case QUESTIONMARK$1:tokenizer.pos++ 4248range={min:0,max:1} 4249break 4250case NUMBERSIGN$3:tokenizer.pos++ 4251comma=true 4252if(tokenizer.charCode()===LEFTCURLYBRACKET)range=readMultiplierRange(tokenizer) 4253else if(tokenizer.charCode()===QUESTIONMARK$1){tokenizer.pos++ 4254range={min:0,max:0}}else range={min:1,max:0} 4255break 4256case LEFTCURLYBRACKET:range=readMultiplierRange(tokenizer) 4257break 4258default:return null}return{type:"Multiplier",comma:comma,min:range.min,max:range.max,term:null}}function maybeMultiplied(tokenizer,node){const multiplier=readMultiplier(tokenizer) 4259if(multiplier!==null){multiplier.term=node 4260if(tokenizer.charCode()===NUMBERSIGN$3&&tokenizer.charCodeAt(tokenizer.pos-1)===PLUSSIGN$6)return maybeMultiplied(tokenizer,multiplier) 4261return multiplier}return node}function maybeToken(tokenizer){const ch=tokenizer.peek() 4262if(ch==="")return null 4263return{type:"Token",value:ch}}function readProperty$1(tokenizer){let name 4264tokenizer.eat(LESSTHANSIGN) 4265tokenizer.eat(APOSTROPHE$2) 4266name=scanWord(tokenizer) 4267tokenizer.eat(APOSTROPHE$2) 4268tokenizer.eat(GREATERTHANSIGN$2) 4269return maybeMultiplied(tokenizer,{type:"Property",name:name})}function readTypeRange(tokenizer){let min=null 4270let max=null 4271let sign=1 4272tokenizer.eat(LEFTSQUAREBRACKET) 4273if(tokenizer.charCode()===HYPERMINUS){tokenizer.peek() 4274sign=-1}if(sign==-1&&tokenizer.charCode()===INFINITY)tokenizer.peek() 4275else{min=sign*Number(scanNumber(tokenizer)) 4276NAME_CHAR[tokenizer.charCode()]!==0&&(min+=scanWord(tokenizer))}scanSpaces(tokenizer) 4277tokenizer.eat(COMMA) 4278scanSpaces(tokenizer) 4279if(tokenizer.charCode()===INFINITY)tokenizer.peek() 4280else{sign=1 4281if(tokenizer.charCode()===HYPERMINUS){tokenizer.peek() 4282sign=-1}max=sign*Number(scanNumber(tokenizer)) 4283NAME_CHAR[tokenizer.charCode()]!==0&&(max+=scanWord(tokenizer))}tokenizer.eat(RIGHTSQUAREBRACKET) 4284return{type:"Range",min:min,max:max}}function readType(tokenizer){let name 4285let opts=null 4286tokenizer.eat(LESSTHANSIGN) 4287name=scanWord(tokenizer) 4288if(tokenizer.charCode()===LEFTPARENTHESIS$2&&tokenizer.nextCharCode()===RIGHTPARENTHESIS$2){tokenizer.pos+=2 4289name+="()"}if(tokenizer.charCodeAt(tokenizer.findWsEnd(tokenizer.pos))===LEFTSQUAREBRACKET){scanSpaces(tokenizer) 4290opts=readTypeRange(tokenizer)}tokenizer.eat(GREATERTHANSIGN$2) 4291return maybeMultiplied(tokenizer,{type:"Type",name:name,opts:opts})}function readKeywordOrFunction(tokenizer){const name=scanWord(tokenizer) 4292if(tokenizer.charCode()===LEFTPARENTHESIS$2){tokenizer.pos++ 4293return{type:"Function",name:name}}return maybeMultiplied(tokenizer,{type:"Keyword",name:name})}function regroupTerms(terms,combinators){function createGroup(terms,combinator){return{type:"Group",terms:terms,combinator:combinator,disallowEmpty:false,explicit:false}}let combinator 4294combinators=Object.keys(combinators).sort(((a,b)=>COMBINATOR_PRECEDENCE[a]-COMBINATOR_PRECEDENCE[b])) 4295while(combinators.length>0){combinator=combinators.shift() 4296let i=0 4297let subgroupStart=0 4298for(;i<terms.length;i++){const term=terms[i] 4299if(term.type==="Combinator")if(term.value===combinator){subgroupStart===-1&&(subgroupStart=i-1) 4300terms.splice(i,1) 4301i--}else{if(subgroupStart!==-1&&i-subgroupStart>1){terms.splice(subgroupStart,i-subgroupStart,createGroup(terms.slice(subgroupStart,i),combinator)) 4302i=subgroupStart+1}subgroupStart=-1}}subgroupStart!==-1&&combinators.length&&terms.splice(subgroupStart,i-subgroupStart,createGroup(terms.slice(subgroupStart,i),combinator))}return combinator}function readImplicitGroup(tokenizer){const terms=[] 4303const combinators={} 4304let token 4305let prevToken=null 4306let prevTokenPos=tokenizer.pos 4307while(token=peek(tokenizer))if(token.type!=="Spaces"){if(token.type==="Combinator"){if(prevToken===null||prevToken.type==="Combinator"){tokenizer.pos=prevTokenPos 4308tokenizer.error("Unexpected combinator")}combinators[token.value]=true}else if(prevToken!==null&&prevToken.type!=="Combinator"){combinators[" "]=true 4309terms.push({type:"Combinator",value:" "})}terms.push(token) 4310prevToken=token 4311prevTokenPos=tokenizer.pos}if(prevToken!==null&&prevToken.type==="Combinator"){tokenizer.pos-=prevTokenPos 4312tokenizer.error("Unexpected combinator")}return{type:"Group",terms:terms,combinator:regroupTerms(terms,combinators)||" ",disallowEmpty:false,explicit:false}}function readGroup(tokenizer){let result 4313tokenizer.eat(LEFTSQUAREBRACKET) 4314result=readImplicitGroup(tokenizer) 4315tokenizer.eat(RIGHTSQUAREBRACKET) 4316result.explicit=true 4317if(tokenizer.charCode()===EXCLAMATIONMARK$2){tokenizer.pos++ 4318result.disallowEmpty=true}return result}function peek(tokenizer){let code=tokenizer.charCode() 4319if(code<128&&NAME_CHAR[code]===1)return readKeywordOrFunction(tokenizer) 4320switch(code){case RIGHTSQUAREBRACKET:break 4321case LEFTSQUAREBRACKET:return maybeMultiplied(tokenizer,readGroup(tokenizer)) 4322case LESSTHANSIGN:return tokenizer.nextCharCode()===APOSTROPHE$2?readProperty$1(tokenizer):readType(tokenizer) 4323case VERTICALLINE$3:return{type:"Combinator",value:tokenizer.substringToPos(tokenizer.pos+(tokenizer.nextCharCode()===VERTICALLINE$3?2:1))} 4324case AMPERSAND$1:tokenizer.pos++ 4325tokenizer.eat(AMPERSAND$1) 4326return{type:"Combinator",value:"&&"} 4327case COMMA:tokenizer.pos++ 4328return{type:"Comma"} 4329case APOSTROPHE$2:return maybeMultiplied(tokenizer,{type:"String",value:scanString(tokenizer)}) 4330case SPACE$2:case TAB:case N$1:case R:case F:return{type:"Spaces",value:scanSpaces(tokenizer)} 4331case COMMERCIALAT:code=tokenizer.nextCharCode() 4332if(code<128&&NAME_CHAR[code]===1){tokenizer.pos++ 4333return{type:"AtKeyword",name:scanWord(tokenizer)}}return maybeToken(tokenizer) 4334case ASTERISK$6:case PLUSSIGN$6:case QUESTIONMARK$1:case NUMBERSIGN$3:case EXCLAMATIONMARK$2:break 4335case LEFTCURLYBRACKET:code=tokenizer.nextCharCode() 4336if(code<48||code>57)return maybeToken(tokenizer) 4337break 4338default:return maybeToken(tokenizer)}}function parse$H(source){const tokenizer=new Tokenizer(source) 4339const result=readImplicitGroup(tokenizer) 4340tokenizer.pos!==source.length&&tokenizer.error("Unexpected input") 4341if(result.terms.length===1&&result.terms[0].type==="Group")return result.terms[0] 4342return result}const noop=function(){} 4343function ensureFunction(value){return typeof value==="function"?value:noop}function walk$2(node,options,context){function walk(node){enter.call(context,node) 4344switch(node.type){case"Group":node.terms.forEach(walk) 4345break 4346case"Multiplier":walk(node.term) 4347break 4348case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break 4349default:throw new Error("Unknown type: "+node.type)}leave.call(context,node)}let enter=noop 4350let leave=noop 4351if(typeof options==="function")enter=options 4352else if(options){enter=ensureFunction(options.enter) 4353leave=ensureFunction(options.leave)}if(enter===noop&&leave===noop)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function") 4354walk(node)}const astToTokens={decorator(handlers){const tokens=[] 4355let curNode=null 4356return{...handlers,node(node){const tmp=curNode 4357curNode=node 4358handlers.node.call(this,node) 4359curNode=tmp},emit(value,type,auto){tokens.push({type:type,value:value,node:auto?null:curNode})},result:()=>tokens}}} 4360function stringToTokens(str){const tokens=[] 4361tokenize$2(str,((type,start,end)=>tokens.push({type:type,value:str.slice(start,end),node:null}))) 4362return tokens}function prepareTokens(value,syntax){if(typeof value==="string")return stringToTokens(value) 4363return syntax.generate(value,astToTokens)}const MATCH={type:"Match"} 4364const MISMATCH={type:"Mismatch"} 4365const DISALLOW_EMPTY={type:"DisallowEmpty"} 4366const LEFTPARENTHESIS$1=40 4367const RIGHTPARENTHESIS$1=41 4368function createCondition(match,thenBranch,elseBranch){if(thenBranch===MATCH&&elseBranch===MISMATCH)return match 4369if(match===MATCH&&thenBranch===MATCH&&elseBranch===MATCH)return match 4370if(match.type==="If"&&match.else===MISMATCH&&thenBranch===MATCH){thenBranch=match.then 4371match=match.match}return{type:"If",match:match,then:thenBranch,else:elseBranch}}function isFunctionType(name){return name.length>2&&name.charCodeAt(name.length-2)===LEFTPARENTHESIS$1&&name.charCodeAt(name.length-1)===RIGHTPARENTHESIS$1}function isEnumCapatible(term){return term.type==="Keyword"||term.type==="AtKeyword"||term.type==="Function"||term.type==="Type"&&isFunctionType(term.name)}function buildGroupMatchGraph(combinator,terms,atLeastOneTermMatched){switch(combinator){case" ":{let result=MATCH 4372for(let i=terms.length-1;i>=0;i--){const term=terms[i] 4373result=createCondition(term,result,MISMATCH)}return result}case"|":{let result=MISMATCH 4374let map=null 4375for(let i=terms.length-1;i>=0;i--){let term=terms[i] 4376if(isEnumCapatible(term)){if(map===null&&i>0&&isEnumCapatible(terms[i-1])){map=Object.create(null) 4377result=createCondition({type:"Enum",map:map},MATCH,result)}if(map!==null){const key=(isFunctionType(term.name)?term.name.slice(0,-1):term.name).toLowerCase() 4378if(key in map===false){map[key]=term 4379continue}}}map=null 4380result=createCondition(term,MATCH,result)}return result}case"&&":{if(terms.length>5)return{type:"MatchOnce",terms:terms,all:true} 4381let result=MISMATCH 4382for(let i=terms.length-1;i>=0;i--){const term=terms[i] 4383let thenClause 4384thenClause=terms.length>1?buildGroupMatchGraph(combinator,terms.filter((function(newGroupTerm){return newGroupTerm!==term})),false):MATCH 4385result=createCondition(term,thenClause,result)}return result}case"||":{if(terms.length>5)return{type:"MatchOnce",terms:terms,all:false} 4386let result=atLeastOneTermMatched?MATCH:MISMATCH 4387for(let i=terms.length-1;i>=0;i--){const term=terms[i] 4388let thenClause 4389thenClause=terms.length>1?buildGroupMatchGraph(combinator,terms.filter((function(newGroupTerm){return newGroupTerm!==term})),true):MATCH 4390result=createCondition(term,thenClause,result)}return result}}}function buildMultiplierMatchGraph(node){let result=MATCH 4391let matchTerm=buildMatchGraphInternal(node.term) 4392if(node.max===0){matchTerm=createCondition(matchTerm,DISALLOW_EMPTY,MISMATCH) 4393result=createCondition(matchTerm,null,MISMATCH) 4394result.then=createCondition(MATCH,MATCH,result) 4395node.comma&&(result.then.else=createCondition({type:"Comma",syntax:node},result,MISMATCH))}else for(let i=node.min||1;i<=node.max;i++){node.comma&&result!==MATCH&&(result=createCondition({type:"Comma",syntax:node},result,MISMATCH)) 4396result=createCondition(matchTerm,createCondition(MATCH,MATCH,result),MISMATCH)}if(node.min===0)result=createCondition(MATCH,MATCH,result) 4397else for(let i=0;i<node.min-1;i++){node.comma&&result!==MATCH&&(result=createCondition({type:"Comma",syntax:node},result,MISMATCH)) 4398result=createCondition(matchTerm,result,MISMATCH)}return result}function buildMatchGraphInternal(node){if(typeof node==="function")return{type:"Generic",fn:node} 4399switch(node.type){case"Group":{let result=buildGroupMatchGraph(node.combinator,node.terms.map(buildMatchGraphInternal),false) 4400node.disallowEmpty&&(result=createCondition(result,DISALLOW_EMPTY,MISMATCH)) 4401return result}case"Multiplier":return buildMultiplierMatchGraph(node) 4402case"Type":case"Property":return{type:node.type,name:node.name,syntax:node} 4403case"Keyword":return{type:node.type,name:node.name.toLowerCase(),syntax:node} 4404case"AtKeyword":return{type:node.type,name:"@"+node.name.toLowerCase(),syntax:node} 4405case"Function":return{type:node.type,name:node.name.toLowerCase()+"(",syntax:node} 4406case"String":if(node.value.length===3)return{type:"Token",value:node.value.charAt(1),syntax:node} 4407return{type:node.type,value:node.value.substr(1,node.value.length-2).replace(/\\'/g,"'"),syntax:node} 4408case"Token":return{type:node.type,value:node.value,syntax:node} 4409case"Comma":return{type:node.type,syntax:node} 4410default:throw new Error("Unknown node type:",node.type)}}function buildMatchGraph(syntaxTree,ref){typeof syntaxTree==="string"&&(syntaxTree=parse$H(syntaxTree)) 4411return{type:"MatchGraph",match:buildMatchGraphInternal(syntaxTree),syntax:ref||null,source:syntaxTree}}const{hasOwnProperty:hasOwnProperty$7}=Object.prototype 4412const STUB=0 4413const TOKEN=1 4414const OPEN_SYNTAX=2 4415const CLOSE_SYNTAX=3 4416const EXIT_REASON_MATCH="Match" 4417const EXIT_REASON_MISMATCH="Mismatch" 4418const EXIT_REASON_ITERATION_LIMIT="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)" 4419const ITERATION_LIMIT=15000 4420function reverseList(list){let prev=null 4421let next=null 4422let item=list 4423while(item!==null){next=item.prev 4424item.prev=prev 4425prev=item 4426item=next}return prev}function areStringsEqualCaseInsensitive(testStr,referenceStr){if(testStr.length!==referenceStr.length)return false 4427for(let i=0;i<testStr.length;i++){const referenceCode=referenceStr.charCodeAt(i) 4428let testCode=testStr.charCodeAt(i) 4429testCode>=0x0041&&testCode<=0x005A&&(testCode|=32) 4430if(testCode!==referenceCode)return false}return true}function isContextEdgeDelim(token){if(token.type!==Delim)return false 4431return token.value!=="?"}function isCommaContextStart(token){if(token===null)return true 4432return token.type===Comma||token.type===Function$1||token.type===LeftParenthesis||token.type===LeftSquareBracket||token.type===LeftCurlyBracket||isContextEdgeDelim(token)}function isCommaContextEnd(token){if(token===null)return true 4433return token.type===RightParenthesis||token.type===RightSquareBracket||token.type===RightCurlyBracket||token.type===Delim&&token.value==="/"}function internalMatch(tokens,state,syntaxes){function moveToNextToken(){do{tokenIndex++ 4434token=tokenIndex<tokens.length?tokens[tokenIndex]:null}while(token!==null&&(token.type===WhiteSpace$1||token.type===Comment$1))}function getNextToken(offset){const nextIndex=tokenIndex+offset 4435return nextIndex<tokens.length?tokens[nextIndex]:null}function stateSnapshotFromSyntax(nextState,prev){return{nextState:nextState,matchStack:matchStack,syntaxStack:syntaxStack,thenStack:thenStack,tokenIndex:tokenIndex,prev:prev}}function pushThenStack(nextState){thenStack={nextState:nextState,matchStack:matchStack,syntaxStack:syntaxStack,prev:thenStack}}function pushElseStack(nextState){elseStack=stateSnapshotFromSyntax(nextState,elseStack)}function addTokenToMatch(){matchStack={type:TOKEN,syntax:state.syntax,token:token,prev:matchStack} 4436moveToNextToken() 4437syntaxStash=null 4438tokenIndex>longestMatch&&(longestMatch=tokenIndex)}function openSyntax(){syntaxStack={syntax:state.syntax,opts:state.syntax.opts||syntaxStack!==null&&syntaxStack.opts||null,prev:syntaxStack} 4439matchStack={type:OPEN_SYNTAX,syntax:state.syntax,token:matchStack.token,prev:matchStack}}function closeSyntax(){matchStack=matchStack.type===OPEN_SYNTAX?matchStack.prev:{type:CLOSE_SYNTAX,syntax:syntaxStack.syntax,token:matchStack.token,prev:matchStack} 4440syntaxStack=syntaxStack.prev}let syntaxStack=null 4441let thenStack=null 4442let elseStack=null 4443let syntaxStash=null 4444let iterationCount=0 4445let exitReason=null 4446let token=null 4447let tokenIndex=-1 4448let longestMatch=0 4449let matchStack={type:STUB,syntax:null,token:null,prev:null} 4450moveToNextToken() 4451while(exitReason===null&&++iterationCount<ITERATION_LIMIT)switch(state.type){case"Match":if(thenStack===null){if(token!==null&&(tokenIndex!==tokens.length-1||token.value!=="\\0"&&token.value!=="\\9")){state=MISMATCH 4452break}exitReason=EXIT_REASON_MATCH 4453break}state=thenStack.nextState 4454if(state===DISALLOW_EMPTY){if(thenStack.matchStack===matchStack){state=MISMATCH 4455break}state=MATCH}while(thenStack.syntaxStack!==syntaxStack)closeSyntax() 4456thenStack=thenStack.prev 4457break 4458case"Mismatch":if(syntaxStash!==null&&syntaxStash!==false){if(elseStack===null||tokenIndex>elseStack.tokenIndex){elseStack=syntaxStash 4459syntaxStash=false}}else if(elseStack===null){exitReason=EXIT_REASON_MISMATCH 4460break}state=elseStack.nextState 4461thenStack=elseStack.thenStack 4462syntaxStack=elseStack.syntaxStack 4463matchStack=elseStack.matchStack 4464tokenIndex=elseStack.tokenIndex 4465token=tokenIndex<tokens.length?tokens[tokenIndex]:null 4466elseStack=elseStack.prev 4467break 4468case"MatchGraph":state=state.match 4469break 4470case"If":state.else!==MISMATCH&&pushElseStack(state.else) 4471state.then!==MATCH&&pushThenStack(state.then) 4472state=state.match 4473break 4474case"MatchOnce":state={type:"MatchOnceBuffer",syntax:state,index:0,mask:0} 4475break 4476case"MatchOnceBuffer":{const terms=state.syntax.terms 4477if(state.index===terms.length){if(state.mask===0||state.syntax.all){state=MISMATCH 4478break}state=MATCH 4479break}if(state.mask===(1<<terms.length)-1){state=MATCH 4480break}for(;state.index<terms.length;state.index++){const matchFlag=1<<state.index 4481if((state.mask&matchFlag)===0){pushElseStack(state) 4482pushThenStack({type:"AddMatchOnce",syntax:state.syntax,mask:state.mask|matchFlag}) 4483state=terms[state.index++] 4484break}}break}case"AddMatchOnce":state={type:"MatchOnceBuffer",syntax:state.syntax,index:0,mask:state.mask} 4485break 4486case"Enum":if(token!==null){let name=token.value.toLowerCase() 4487name.indexOf("\\")!==-1&&(name=name.replace(/\\[09].*$/,"")) 4488if(hasOwnProperty$7.call(state.map,name)){state=state.map[name] 4489break}}state=MISMATCH 4490break 4491case"Generic":{const opts=syntaxStack!==null?syntaxStack.opts:null 4492const lastTokenIndex=tokenIndex+Math.floor(state.fn(token,getNextToken,opts)) 4493if(!isNaN(lastTokenIndex)&&lastTokenIndex>tokenIndex){while(tokenIndex<lastTokenIndex)addTokenToMatch() 4494state=MATCH}else state=MISMATCH 4495break}case"Type":case"Property":{const syntaxDict=state.type==="Type"?"types":"properties" 4496const dictSyntax=hasOwnProperty$7.call(syntaxes,syntaxDict)?syntaxes[syntaxDict][state.name]:null 4497if(!dictSyntax||!dictSyntax.match)throw new Error("Bad syntax reference: "+(state.type==="Type"?"<"+state.name+">":"<'"+state.name+"'>")) 4498if(syntaxStash!==false&&token!==null&&state.type==="Type"){const lowPriorityMatching=state.name==="custom-ident"&&token.type===Ident||state.name==="length"&&token.value==="0" 4499if(lowPriorityMatching){syntaxStash===null&&(syntaxStash=stateSnapshotFromSyntax(state,elseStack)) 4500state=MISMATCH 4501break}}openSyntax() 4502state=dictSyntax.match 4503break}case"Keyword":{const name=state.name 4504if(token!==null){let keywordName=token.value 4505keywordName.indexOf("\\")!==-1&&(keywordName=keywordName.replace(/\\[09].*$/,"")) 4506if(areStringsEqualCaseInsensitive(keywordName,name)){addTokenToMatch() 4507state=MATCH 4508break}}state=MISMATCH 4509break}case"AtKeyword":case"Function":if(token!==null&&areStringsEqualCaseInsensitive(token.value,state.name)){addTokenToMatch() 4510state=MATCH 4511break}state=MISMATCH 4512break 4513case"Token":if(token!==null&&token.value===state.value){addTokenToMatch() 4514state=MATCH 4515break}state=MISMATCH 4516break 4517case"Comma":if(token!==null&&token.type===Comma)if(isCommaContextStart(matchStack.token))state=MISMATCH 4518else{addTokenToMatch() 4519state=isCommaContextEnd(token)?MISMATCH:MATCH}else state=isCommaContextStart(matchStack.token)||isCommaContextEnd(token)?MATCH:MISMATCH 4520break 4521case"String":let string="" 4522let lastTokenIndex=tokenIndex 4523for(;lastTokenIndex<tokens.length&&string.length<state.value.length;lastTokenIndex++)string+=tokens[lastTokenIndex].value 4524if(areStringsEqualCaseInsensitive(string,state.value)){while(tokenIndex<lastTokenIndex)addTokenToMatch() 4525state=MATCH}else state=MISMATCH 4526break 4527default:throw new Error("Unknown node type: "+state.type)}switch(exitReason){case null:console.warn("[csstree-match] BREAK after "+ITERATION_LIMIT+" iterations") 4528exitReason=EXIT_REASON_ITERATION_LIMIT 4529matchStack=null 4530break 4531case EXIT_REASON_MATCH:while(syntaxStack!==null)closeSyntax() 4532break 4533default:matchStack=null}return{tokens:tokens,reason:exitReason,iterations:iterationCount,match:matchStack,longestMatch:longestMatch}}function matchAsTree(tokens,matchGraph,syntaxes){const matchResult=internalMatch(tokens,matchGraph,syntaxes||{}) 4534if(matchResult.match===null)return matchResult 4535let item=matchResult.match 4536let host=matchResult.match={syntax:matchGraph.syntax||null,match:[]} 4537const hostStack=[host] 4538item=reverseList(item).prev 4539while(item!==null){switch(item.type){case OPEN_SYNTAX:host.match.push(host={syntax:item.syntax,match:[]}) 4540hostStack.push(host) 4541break 4542case CLOSE_SYNTAX:hostStack.pop() 4543host=hostStack[hostStack.length-1] 4544break 4545default:host.match.push({syntax:item.syntax||null,token:item.token.value,node:item.token.node})}item=item.prev}return matchResult}function getTrace(node){function shouldPutToTrace(syntax){if(syntax===null)return false 4546return syntax.type==="Type"||syntax.type==="Property"||syntax.type==="Keyword"}function hasMatch(matchNode){if(Array.isArray(matchNode.match)){for(let i=0;i<matchNode.match.length;i++)if(hasMatch(matchNode.match[i])){shouldPutToTrace(matchNode.syntax)&&result.unshift(matchNode.syntax) 4547return true}}else if(matchNode.node===node){result=shouldPutToTrace(matchNode.syntax)?[matchNode.syntax]:[] 4548return true}return false}let result=null 4549this.matched!==null&&hasMatch(this.matched) 4550return result}function isType(node,type){return testNode(this,node,(match=>match.type==="Type"&&match.name===type))}function isProperty(node,property){return testNode(this,node,(match=>match.type==="Property"&&match.name===property))}function isKeyword(node){return testNode(this,node,(match=>match.type==="Keyword"))}function testNode(match,node,fn){const trace=getTrace.call(match,node) 4551if(trace===null)return false 4552return trace.some(fn)}var trace=Object.freeze({__proto__:null,getTrace:getTrace,isKeyword:isKeyword,isProperty:isProperty,isType:isType}) 4553function getFirstMatchNode(matchNode){if("node"in matchNode)return matchNode.node 4554return getFirstMatchNode(matchNode.match[0])}function getLastMatchNode(matchNode){if("node"in matchNode)return matchNode.node 4555return getLastMatchNode(matchNode.match[matchNode.match.length-1])}function matchFragments(lexer,ast,match,type,name){function findFragments(matchNode){if(matchNode.syntax!==null&&matchNode.syntax.type===type&&matchNode.syntax.name===name){const start=getFirstMatchNode(matchNode) 4556const end=getLastMatchNode(matchNode) 4557lexer.syntax.walk(ast,(function(node,item,list){if(node===start){const nodes=new List 4558do{nodes.appendData(item.data) 4559if(item.data===end)break 4560item=item.next}while(item!==null) 4561fragments.push({parent:list,nodes:nodes})}}))}Array.isArray(matchNode.match)&&matchNode.match.forEach(findFragments)}const fragments=[] 4562match.matched!==null&&findFragments(match.matched) 4563return fragments}const{hasOwnProperty:hasOwnProperty$6}=Object.prototype 4564function isValidNumber(value){return typeof value==="number"&&isFinite(value)&&Math.floor(value)===value&&value>=0}function isValidLocation(loc){return Boolean(loc)&&isValidNumber(loc.offset)&&isValidNumber(loc.line)&&isValidNumber(loc.column)}function createNodeStructureChecker(type,fields){return function checkNode(node,warn){if(!node||node.constructor!==Object)return warn(node,"Type of node should be an Object") 4565for(let key in node){let valid=true 4566if(hasOwnProperty$6.call(node,key)===false)continue 4567if(key==="type")node.type!==type&&warn(node,"Wrong node type `"+node.type+"`, expected `"+type+"`") 4568else if(key==="loc"){if(node.loc===null)continue 4569if(node.loc&&node.loc.constructor===Object)if(typeof node.loc.source!=="string")key+=".source" 4570else if(isValidLocation(node.loc.start)){if(isValidLocation(node.loc.end))continue 4571key+=".end"}else key+=".start" 4572valid=false}else if(fields.hasOwnProperty(key)){valid=false 4573for(let i=0;!valid&&i<fields[key].length;i++){const fieldType=fields[key][i] 4574switch(fieldType){case String:valid=typeof node[key]==="string" 4575break 4576case Boolean:valid=typeof node[key]==="boolean" 4577break 4578case null:valid=node[key]===null 4579break 4580default:typeof fieldType==="string"?valid=node[key]&&node[key].type===fieldType:Array.isArray(fieldType)&&(valid=node[key]instanceof List)}}}else warn(node,"Unknown field `"+key+"` for "+type+" node type") 4581valid||warn(node,"Bad value for `"+type+"."+key+"`")}for(const key in fields)hasOwnProperty$6.call(fields,key)&&hasOwnProperty$6.call(node,key)===false&&warn(node,"Field `"+type+"."+key+"` is missed")}}function processStructure(name,nodeType){const structure=nodeType.structure 4582const fields={type:String,loc:true} 4583const docs={type:'"'+name+'"'} 4584for(const key in structure){if(hasOwnProperty$6.call(structure,key)===false)continue 4585const docsTypes=[] 4586const fieldTypes=fields[key]=Array.isArray(structure[key])?structure[key].slice():[structure[key]] 4587for(let i=0;i<fieldTypes.length;i++){const fieldType=fieldTypes[i] 4588if(fieldType===String||fieldType===Boolean)docsTypes.push(fieldType.name) 4589else if(fieldType===null)docsTypes.push("null") 4590else if(typeof fieldType==="string")docsTypes.push("<"+fieldType+">") 4591else{if(!Array.isArray(fieldType))throw new Error("Wrong value `"+fieldType+"` in `"+name+"."+key+"` structure definition") 4592docsTypes.push("List")}}docs[key]=docsTypes.join(" | ")}return{docs:docs,check:createNodeStructureChecker(name,fields)}}function getStructureFromConfig(config){const structure={} 4593if(config.node)for(const name in config.node)if(hasOwnProperty$6.call(config.node,name)){const nodeType=config.node[name] 4594if(!nodeType.structure)throw new Error("Missed `structure` field in `"+name+"` node type definition") 4595structure[name]=processStructure(name,nodeType)}return structure}const cssWideKeywordsSyntax=buildMatchGraph(cssWideKeywords.join(" | ")) 4596function dumpMapSyntax(map,compact,syntaxAsAst){const result={} 4597for(const name in map)map[name].syntax&&(result[name]=syntaxAsAst?map[name].syntax:generate$H(map[name].syntax,{compact:compact})) 4598return result}function dumpAtruleMapSyntax(map,compact,syntaxAsAst){const result={} 4599for(const[name,atrule]of Object.entries(map))result[name]={prelude:atrule.prelude&&(syntaxAsAst?atrule.prelude.syntax:generate$H(atrule.prelude.syntax,{compact:compact})),descriptors:atrule.descriptors&&dumpMapSyntax(atrule.descriptors,compact,syntaxAsAst)} 4600return result}function valueHasVar(tokens){for(let i=0;i<tokens.length;i++)if(tokens[i].value.toLowerCase()==="var(")return true 4601return false}function buildMatchResult(matched,error,iterations){return{matched:matched,iterations:iterations,error:error,...trace}}function matchSyntax(lexer,syntax,value,useCssWideKeywords){const tokens=prepareTokens(value,lexer.syntax) 4602let result 4603if(valueHasVar(tokens))return buildMatchResult(null,new Error("Matching for a tree with var() is not supported")) 4604useCssWideKeywords&&(result=matchAsTree(tokens,lexer.cssWideKeywordsSyntax,lexer)) 4605if(!useCssWideKeywords||!result.match){result=matchAsTree(tokens,syntax.match,lexer) 4606if(!result.match)return buildMatchResult(null,new SyntaxMatchError(result.reason,syntax.syntax,value,result),result.iterations)}return buildMatchResult(result.match,null,result.iterations)}class Lexer{constructor(config,syntax,structure){this.cssWideKeywordsSyntax=cssWideKeywordsSyntax 4607this.syntax=syntax 4608this.generic=false 4609this.atrules=Object.create(null) 4610this.properties=Object.create(null) 4611this.types=Object.create(null) 4612this.structure=structure||getStructureFromConfig(config) 4613if(config){if(config.types)for(const name in config.types)this.addType_(name,config.types[name]) 4614if(config.generic){this.generic=true 4615for(const name in generic)this.addType_(name,generic[name])}if(config.atrules)for(const name in config.atrules)this.addAtrule_(name,config.atrules[name]) 4616if(config.properties)for(const name in config.properties)this.addProperty_(name,config.properties[name])}}checkStructure(ast){function collectWarning(node,message){warns.push({node:node,message:message})}const structure=this.structure 4617const warns=[] 4618this.syntax.walk(ast,(function(node){structure.hasOwnProperty(node.type)?structure[node.type].check(node,collectWarning):collectWarning(node,"Unknown node type `"+node.type+"`")})) 4619return!!warns.length&&warns}createDescriptor(syntax,type,name,parent=null){const ref={type:type,name:name} 4620const descriptor={type:type,name:name,parent:parent,serializable:typeof syntax==="string"||syntax&&typeof syntax.type==="string",syntax:null,match:null} 4621if(typeof syntax==="function")descriptor.match=buildMatchGraph(syntax,ref) 4622else{typeof syntax==="string"?Object.defineProperty(descriptor,"syntax",{get(){Object.defineProperty(descriptor,"syntax",{value:parse$H(syntax)}) 4623return descriptor.syntax}}):descriptor.syntax=syntax 4624Object.defineProperty(descriptor,"match",{get(){Object.defineProperty(descriptor,"match",{value:buildMatchGraph(descriptor.syntax,ref)}) 4625return descriptor.match}})}return descriptor}addAtrule_(name,syntax){if(!syntax)return 4626this.atrules[name]={type:"Atrule",name:name,prelude:syntax.prelude?this.createDescriptor(syntax.prelude,"AtrulePrelude",name):null,descriptors:syntax.descriptors?Object.keys(syntax.descriptors).reduce(((map,descName)=>{map[descName]=this.createDescriptor(syntax.descriptors[descName],"AtruleDescriptor",descName,name) 4627return map}),Object.create(null)):null}}addProperty_(name,syntax){if(!syntax)return 4628this.properties[name]=this.createDescriptor(syntax,"Property",name)}addType_(name,syntax){if(!syntax)return 4629this.types[name]=this.createDescriptor(syntax,"Type",name)}checkAtruleName(atruleName){if(!this.getAtrule(atruleName))return new SyntaxReferenceError("Unknown at-rule","@"+atruleName)}checkAtrulePrelude(atruleName,prelude){const error=this.checkAtruleName(atruleName) 4630if(error)return error 4631const atrule=this.getAtrule(atruleName) 4632if(!atrule.prelude&&prelude)return new SyntaxError("At-rule `@"+atruleName+"` should not contain a prelude") 4633if(atrule.prelude&&!prelude&&!matchSyntax(this,atrule.prelude,"",false).matched)return new SyntaxError("At-rule `@"+atruleName+"` should contain a prelude")}checkAtruleDescriptorName(atruleName,descriptorName){const error=this.checkAtruleName(atruleName) 4634if(error)return error 4635const atrule=this.getAtrule(atruleName) 4636const descriptor=keyword(descriptorName) 4637if(!atrule.descriptors)return new SyntaxError("At-rule `@"+atruleName+"` has no known descriptors") 4638if(!atrule.descriptors[descriptor.name]&&!atrule.descriptors[descriptor.basename])return new SyntaxReferenceError("Unknown at-rule descriptor",descriptorName)}checkPropertyName(propertyName){if(!this.getProperty(propertyName))return new SyntaxReferenceError("Unknown property",propertyName)}matchAtrulePrelude(atruleName,prelude){const error=this.checkAtrulePrelude(atruleName,prelude) 4639if(error)return buildMatchResult(null,error) 4640const atrule=this.getAtrule(atruleName) 4641if(!atrule.prelude)return buildMatchResult(null,null) 4642return matchSyntax(this,atrule.prelude,prelude||"",false)}matchAtruleDescriptor(atruleName,descriptorName,value){const error=this.checkAtruleDescriptorName(atruleName,descriptorName) 4643if(error)return buildMatchResult(null,error) 4644const atrule=this.getAtrule(atruleName) 4645const descriptor=keyword(descriptorName) 4646return matchSyntax(this,atrule.descriptors[descriptor.name]||atrule.descriptors[descriptor.basename],value,false)}matchDeclaration(node){if(node.type!=="Declaration")return buildMatchResult(null,new Error("Not a Declaration node")) 4647return this.matchProperty(node.property,node.value)}matchProperty(propertyName,value){if(property(propertyName).custom)return buildMatchResult(null,new Error("Lexer matching doesn't applicable for custom properties")) 4648const error=this.checkPropertyName(propertyName) 4649if(error)return buildMatchResult(null,error) 4650return matchSyntax(this,this.getProperty(propertyName),value,true)}matchType(typeName,value){const typeSyntax=this.getType(typeName) 4651if(!typeSyntax)return buildMatchResult(null,new SyntaxReferenceError("Unknown type",typeName)) 4652return matchSyntax(this,typeSyntax,value,false)}match(syntax,value){if(typeof syntax!=="string"&&(!syntax||!syntax.type))return buildMatchResult(null,new SyntaxReferenceError("Bad syntax")) 4653typeof syntax!=="string"&&syntax.match||(syntax=this.createDescriptor(syntax,"Type","anonymous")) 4654return matchSyntax(this,syntax,value,false)}findValueFragments(propertyName,value,type,name){return matchFragments(this,value,this.matchProperty(propertyName,value),type,name)}findDeclarationValueFragments(declaration,type,name){return matchFragments(this,declaration.value,this.matchDeclaration(declaration),type,name)}findAllFragments(ast,type,name){const result=[] 4655this.syntax.walk(ast,{visit:"Declaration",enter:declaration=>{result.push.apply(result,this.findDeclarationValueFragments(declaration,type,name))}}) 4656return result}getAtrule(atruleName,fallbackBasename=true){const atrule=keyword(atruleName) 4657const atruleEntry=atrule.vendor&&fallbackBasename?this.atrules[atrule.name]||this.atrules[atrule.basename]:this.atrules[atrule.name] 4658return atruleEntry||null}getAtrulePrelude(atruleName,fallbackBasename=true){const atrule=this.getAtrule(atruleName,fallbackBasename) 4659return 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$1=property(propertyName) 4660const propertyEntry=property$1.vendor&&fallbackBasename?this.properties[property$1.name]||this.properties[property$1.basename]:this.properties[property$1.name] 4661return propertyEntry||null}getType(name){return hasOwnProperty.call(this.types,name)?this.types[name]:null}validate(){function validate(syntax,name,broken,descriptor){if(broken.has(name))return broken.get(name) 4662broken.set(name,false) 4663descriptor.syntax!==null&&walk$2(descriptor.syntax,(function(node){if(node.type!=="Type"&&node.type!=="Property")return 4664const map=node.type==="Type"?syntax.types:syntax.properties 4665const brokenMap=node.type==="Type"?brokenTypes:brokenProperties 4666hasOwnProperty.call(map,node.name)&&!validate(syntax,node.name,brokenMap,map[node.name])||broken.set(name,true)}),this)}let brokenTypes=new Map 4667let brokenProperties=new Map 4668for(const key in this.types)validate(this,key,brokenTypes,this.types[key]) 4669for(const key in this.properties)validate(this,key,brokenProperties,this.properties[key]) 4670brokenTypes=[...brokenTypes.keys()].filter((name=>brokenTypes.get(name))) 4671brokenProperties=[...brokenProperties.keys()].filter((name=>brokenProperties.get(name))) 4672if(brokenTypes.length||brokenProperties.length)return{types:brokenTypes,properties:brokenProperties} 4673return null}dump(syntaxAsAst,pretty){return{generic:this.generic,types:dumpMapSyntax(this.types,!pretty,syntaxAsAst),properties:dumpMapSyntax(this.properties,!pretty,syntaxAsAst),atrules:dumpAtruleMapSyntax(this.atrules,!pretty,syntaxAsAst)}}toString(){return JSON.stringify(this.dump())}}const{hasOwnProperty:hasOwnProperty$5}=Object.prototype 4674const shape={generic:true,types:appendOrAssign,atrules:{prelude:appendOrAssignOrNull,descriptors:appendOrAssignOrNull},properties:appendOrAssign,parseContext:assign,scope:deepAssign,atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]} 4675function isObject(value){return value&&value.constructor===Object}function copy(value){return isObject(value)?{...value}:value}function assign(dest,src){return Object.assign(dest,src)}function deepAssign(dest,src){for(const key in src)hasOwnProperty$5.call(src,key)&&(isObject(dest[key])?deepAssign(dest[key],src[key]):dest[key]=copy(src[key])) 4676return dest}function append(a,b){if(typeof b==="string"&&/^\s*\|/.test(b))return typeof a==="string"?a+b:b.replace(/^\s*\|\s*/,"") 4677return b||null}function appendOrAssign(a,b){if(typeof b==="string")return append(a,b) 4678const result={...a} 4679for(let key in b)hasOwnProperty$5.call(b,key)&&(result[key]=append(hasOwnProperty$5.call(a,key)?a[key]:void 0,b[key])) 4680return result}function appendOrAssignOrNull(a,b){const result=appendOrAssign(a,b) 4681return!isObject(result)||Object.keys(result).length?result:null}function mix(dest,src,shape){for(const key in shape){if(hasOwnProperty$5.call(shape,key)===false)continue 4682if(shape[key]===true)hasOwnProperty$5.call(src,key)&&(dest[key]=copy(src[key])) 4683else if(shape[key])if(typeof shape[key]==="function"){const fn=shape[key] 4684dest[key]=fn({},dest[key]) 4685dest[key]=fn(dest[key]||{},src[key])}else if(isObject(shape[key])){const result={} 4686for(let name in dest[key])result[name]=mix({},dest[key][name],shape[key]) 4687for(let name in src[key])result[name]=mix(result[name]||{},src[key][name],shape[key]) 4688dest[key]=result}else if(Array.isArray(shape[key])){const res={} 4689const innerShape=shape[key].reduce((function(s,k){s[k]=true 4690return s})
vendor: 74,954 bytes, lines 4690-4869
4690,{}) 4691for(const[name,value]of Object.entries(dest[key]||{})){res[name]={} 4692value&&mix(res[name],value,innerShape)}for(const name in src[key])if(hasOwnProperty$5.call(src[key],name)){res[name]||(res[name]={}) 4693src[key]&&src[key][name]&&mix(res[name],src[key][name],innerShape)}dest[key]=res}}return dest}var mix$1=(dest,src)=>mix(dest,src,shape) 4694function createSyntax(config){const parse=createParser(config) 4695const walk=createWalker(config) 4696const generate=createGenerator(config) 4697const{fromPlainObject:fromPlainObject,toPlainObject:toPlainObject}=createConvertor(walk) 4698const syntax={lexer:null,createLexer:config=>new Lexer(config,syntax,syntax.lexer.structure),tokenize:tokenize$2,parse:parse,generate:generate,walk:walk,find:walk.find,findLast:walk.findLast,findAll:walk.findAll,fromPlainObject:fromPlainObject,toPlainObject:toPlainObject,fork(extension){const base=mix$1({},config) 4699return createSyntax(typeof extension==="function"?extension(base,Object.assign):mix$1(base,extension))}} 4700syntax.lexer=new Lexer({generic:true,types:config.types,atrules:config.atrules,properties:config.properties,node:config.node},syntax) 4701return syntax}var createSyntax$1=config=>createSyntax(mix$1({},config)) 4702var definitions={generic:true,types:{"absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","alpha-value":"<number>|<percentage>","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>","angular-color-stop":"<color>&&<color-stop-angle>?","angular-color-stop-list":"[<angular-color-stop> [, <angular-color-hint>]?]# , <angular-color-stop>","animateable-feature":"scroll-position|contents|<custom-ident>",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <type-or-unit>? [, <attr-fallback>]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<circle()>|<ellipse()>|<polygon()>|<path()>","bg-image":"none|<image>","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage>|auto]{1,2}|cover|contain","blur()":"blur( <length> )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( <number-percentage> )","calc()":"calc( <calc-sum> )","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-value":"<number>|<dimension>|<percentage>|( <calc-sum> )","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( [<shape-radius>]? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<hex-color>|<named-color>|currentcolor|<deprecated-system-color>","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"<angle-percentage>{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"[<linear-color-stop> [, <linear-color-hint>]?]# , <linear-color-stop>",combinator:"'>'|'+'|'~'|['||']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>* [<pseudo-element-selector> <pseudo-class-selector>*]*]!","compound-selector-list":"<compound-selector>#","complex-selector":"<compound-selector> [<combinator>? <compound-selector>]*","complex-selector-list":"<complex-selector>#","conic-gradient()":"conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contrast()":"contrast( [<number-percentage>] )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( <length>{2,3} <color>? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( [<shape-radius>{2}]? [at <position>]? )","ending-shape":"circle|ellipse","env()":"env( <custom-ident> , <declaration-value>? )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","fill-rule":"nonzero|evenodd","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-function-list":"[<filter-function>|<url>]+","final-bg-layer":"<'background-color'>||<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","fit-content()":"fit-content( [<length>|<percentage>] )","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,â]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|<number [1,1000]>","frequency-percentage":"<frequency>|<percentage>","general-enclosed":"[<function-token> <any-value> )]|( <ident> <any-value> )","generic-family":"serif|sans-serif|cursive|fantasy|monospace|-apple-system","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( <number-percentage> )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )","hsla()":"hsla( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )",hue:"<number>|<angle>","hue-rotate()":"hue-rotate( <angle> )","hwb()":"hwb( [<hue>|none] [<percentage>|none] [<percentage>|none] [/ [<alpha-value>|none]]? )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length>|<percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( <number-percentage> )","keyframes-name":"<custom-ident>|<string>","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-block-list":"<keyframe-block>+","keyframe-selector":"from|to|<percentage>","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","line-names":"'[' <custom-ident>* ']'","line-name-list":"[<line-names>|<name-repeat>]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-gradient()":"linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length>|<percentage>|min-content|max-content|auto] , [<length>|<percentage>|<flex>|min-content|max-content|auto] )","name-repeat":"repeat( [<integer [1,â]>|auto-fill] , <line-names>+ )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|<-non-standard-color>","namespace-prefix":"<ident>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"<an-plus-b>|even|odd","opacity()":"opacity( [<number-percentage>] )","overflow-position":"unsafe|safe","outline-radius":"<length>|<percentage>","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[<page-selector>#]?","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [<fill-rule> ,]? <string> )","paint()":"paint( <ident> , <declaration-value>? )","perspective()":"perspective( <length> )","polygon()":"polygon( <fill-rule>? , [<length-percentage> <length-percentage>]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","repeating-linear-gradient()":"repeating-linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","repeating-radial-gradient()":"repeating-radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","rgb()":"rgb( <percentage>{3} [/ <alpha-value>]? )|rgb( <number>{3} [/ <alpha-value>]? )|rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )","rgba()":"rgba( <percentage>{3} [/ <alpha-value>]? )|rgba( <number>{3} [/ <alpha-value>]? )|rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","saturate()":"saturate( <number-percentage> )","scale()":"scale( <number> , <number>? )","scale3d()":"scale3d( <number> , <number> , <number> )","scaleX()":"scaleX( <number> )","scaleY()":"scaleY( <number> )","scaleZ()":"scaleZ( <number> )","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"<length-percentage>|closest-side|farthest-side","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sepia()":"sepia( <number-percentage> )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","single-animation":"<time>||<easing-function>||<time>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<timeline-name>","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-timing-function":"step-start|step-end|steps( <integer> [, <step-position>]? )","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-decl":"( <declaration> )","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","time-percentage":"<time>|<percentage>","timeline-name":"<custom-ident>|<string>","easing-function":"linear|<cubic-bezier-timing-function>|<step-timing-function>","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,â]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( [<length>|<percentage>] )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-width":"fill-available|min-intrinsic|intrinsic|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content|-webkit-min-content|-webkit-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-webkit-mask-clip-style":"border|border-box|padding|padding-box|content|content-box|text","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )","-ms-filter":"<string>",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>","bg-clip":"<box>|border|text","border-radius":"<length-percentage>{1,2}",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","lab()":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","lch()":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )",left:"<length>|auto","mask-image":"<mask-reference>#",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke",ratio:"<number [0,â]> [/ <number [0,â]>]?","reversed-counter-name":"reversed( <counter-name> )",right:"<length>|auto","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto","track-group":"'(' [<string>* <track-minmax> <string>*]+ ')' ['[' <positive-integer> ']']?|<track-minmax>","track-list-v0":"[<string>* <track-group> <string>*]+|none","track-minmax":"minmax( <track-breadth> , <track-breadth> )|auto|<track-breadth>|fit-content",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,â]>","positive-integer":"<integer [0,â]>","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zooming":"none|zoom","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-image-region":"<shape>|auto","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<color>","-webkit-border-before-color":"<color>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<box>|border|padding|content|text]||[<box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<box>|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",all:"initial|inherit|unset|revert|revert-layer",animation:"<single-animation>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"<time>#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-timing-function":"<easing-function>#","animation-timeline":"<single-animation-timeline>#",appearance:"none|auto|textfield|menulist-button|<compat-auto>","aspect-ratio":"auto|<ratio>",azimuth:"<angle>|[[left-side|far-left|left|center-left|center|center-right|right|far-right|right-side]||behind]|leftwards|rightwards","backdrop-filter":"none|<filter-function-list>","backface-visibility":"visible|hidden",background:"[<bg-layer> ,]* <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","block-overflow":"clip|ellipsis|<string>","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-color":"<'border-top-color'>{1,2}","border-block-style":"<'border-top-style'>","border-block-width":"<'border-top-width'>","border-block-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage>{1,2}","border-bottom-right-radius":"<length-percentage>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"collapse|separate","border-color":"<color>{1,4}","border-end-end-radius":"<length-percentage>{1,2}","border-end-start-radius":"<length-percentage>{1,2}","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length>|<number>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"<number-percentage>{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage>|<number>|auto]{1,4}","border-inline":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-style":"<'border-top-style'>","border-inline-width":"<'border-top-width'>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage>{1,4} [/ <length-percentage>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length> <length>?","border-start-end-radius":"<length-percentage>{1,2}","border-start-start-radius":"<length-percentage>{1,2}","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage>{1,2}","border-top-right-radius":"<length-percentage>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"<length>|<percentage>|auto","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom|block-start|block-end|inline-start|inline-end","caret-color":"auto|<color>",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none",color:"<color>","print-color-adjust":"economy|exact","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance|balance-all","column-gap":"normal|<length-percentage>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"<length>|auto",columns:"<'column-width'>||<'column-count'>",contain:"none|strict|content|[size||layout||style||paint]",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>]+]?","content-visibility":"visible|auto|hidden","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","empty-cells":"show|hide",filter:"none|<filter-function-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end",font:"[[<'font-style'>||<font-variant-css21>||<'font-weight'>||<'font-stretch'>]? <'font-size'> [/ <'line-height'>]? <'font-family'>]|caption|icon|menu|message-box|small-caption|status-bar","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-variation-settings":"normal|[<string> <number>]#","font-size":"<absolute-size>|<relative-size>|<length-percentage>","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps]","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-weight":"<font-weight-absolute>|bolder|lighter","forced-color-adjust":"auto|none",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","hyphenate-character":"auto|<string>",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>","input-security":"auto|none",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>",isolation:"auto|isolate","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"<length>|<percentage>|auto","letter-spacing":"normal|<length-percentage>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"[<length>|<percentage>|auto]{1,4}","margin-block":"<'margin-left'>{1,2}","margin-block-end":"<'margin-left'>","margin-block-start":"<'margin-left'>","margin-bottom":"<length>|<percentage>|auto","margin-inline":"<'margin-left'>{1,2}","margin-inline-end":"<'margin-left'>","margin-inline-start":"<'margin-left'>","margin-left":"<length>|<percentage>|auto","margin-right":"<length>|<percentage>|auto","margin-top":"<length>|<percentage>|auto","margin-trim":"none|in-flow|all",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<geometry-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<geometry-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|<-non-standard-width>","min-block-size":"<'min-width'>","min-height":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","min-inline-size":"<'min-width'>","min-width":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|<-non-standard-width>","mix-blend-mode":"<blend-mode>|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|ray( [<angle>&&<size>&&contain?] )|<path()>|<url>|[<basic-shape>||<geometry-box>]","offset-position":"auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<alpha-value>",order:"<integer>",orphans:"<integer>",outline:"[<'outline-color'>||<'outline-style'>||<'outline-width'>]","outline-color":"<color>|invert","outline-offset":"<length>","outline-style":"auto|<'border-style'>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,â]>","overflow-inline":"visible|hidden|clip|scroll|auto","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto","overflow-y":"visible|hidden|clip|scroll|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"[<length>|<percentage>]{1,4}","padding-block":"<'padding-left'>{1,2}","padding-block-end":"<'padding-left'>","padding-block-start":"<'padding-left'>","padding-bottom":"<length>|<percentage>","padding-inline":"<'padding-left'>{1,2}","padding-inline-end":"<'padding-left'>","padding-inline-start":"<'padding-left'>","padding-left":"<length>|<percentage>","padding-right":"<length>|<percentage>","padding-top":"<length>|<percentage>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky",quotes:"none|auto|[<string> <string>]+",resize:"none|both|horizontal|vertical|block|inline",right:"<length>|<percentage>|auto",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-position":"[alternate||[over|under]]|inter-character",scale:"none|<number>{1,3}","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","scroll-behavior":"auto|smooth","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-start":"<length>","scroll-margin-block-end":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-start":"<length>","scroll-margin-inline-end":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","shape-image-threshold":"<alpha-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"[over|under]&&[right|left]","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-transform":"none|capitalize|uppercase|lowercase|full-width|full-size-kana","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]",top:"<length>|<percentage>|auto","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|contain|all","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>",visibility:"visible|hidden|collapse","white-space":"normal|pre|nowrap|pre-wrap|pre-line|break-spaces",widows:"<integer>",width:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|fill|stretch|intrinsic|-moz-max-content|-webkit-max-content|-moz-fit-content|-webkit-fit-content","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>","z-index":"auto|<integer>",zoom:"normal|reset|<number>|<percentage>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto","-webkit-user-select":"auto|none|text|all","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical","baseline-shift":"baseline|sub|super|<svg-length>",behavior:"<url>+","clip-rule":"nonzero|evenodd",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge",fill:"<paint>","fill-opacity":"<number-zero-one>","fill-rule":"nonzero|evenodd","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision",src:"[<url> [format( <string># )]?|local( <family-name> )]#",speak:"auto|none|normal","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]",stroke:"<paint>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<number-zero-one>","stroke-width":"<svg-length>","text-anchor":"start|middle|end","unicode-range":"<urange>#","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"[auto|block|swap|fallback|optional]","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-variation-settings":"normal|[<string> <number>]#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-weight":"<font-weight-absolute>{1,2}","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]",size:"<length>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},property:{prelude:"<custom-property-name>",descriptors:{syntax:"<string>",inherits:"true|false","initial-value":"<string>"}},"scroll-timeline":{prelude:"<timeline-name>",descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},viewport:{prelude:null,descriptors:{height:"<viewport-length>{1,2}","max-height":"<viewport-length>","max-width":"<viewport-length>","max-zoom":"auto|<number>|<percentage>","min-height":"<viewport-length>","min-width":"<viewport-length>","min-zoom":"auto|<number>|<percentage>",orientation:"auto|portrait|landscape","user-zoom":"zoom|fixed","viewport-fit":"auto|contain|cover",width:"<viewport-length>{1,2}",zoom:"auto|<number>|<percentage>"}}}} 4703const PLUSSIGN$5=0x002B 4704const HYPHENMINUS$2=0x002D 4705const N=0x006E 4706const DISALLOW_SIGN=true 4707const ALLOW_SIGN=false 4708function checkInteger(offset,disallowSign){let pos=this.tokenStart+offset 4709const code=this.charCodeAt(pos) 4710if(code===PLUSSIGN$5||code===HYPHENMINUS$2){disallowSign&&this.error("Number sign is not allowed") 4711pos++}for(;pos<this.tokenEnd;pos++)isDigit$1(this.charCodeAt(pos))||this.error("Integer is expected",pos)}function checkTokenIsInteger(disallowSign){return checkInteger.call(this,0,disallowSign)}function expectCharCode(offset,code){if(!this.cmpChar(this.tokenStart+offset,code)){let msg="" 4712switch(code){case N:msg="N is expected" 4713break 4714case HYPHENMINUS$2:msg="HyphenMinus is expected" 4715break}this.error(msg,this.tokenStart+offset)}}function consumeB(){let offset=0 4716let sign=0 4717let type=this.tokenType 4718while(type===WhiteSpace$1||type===Comment$1)type=this.lookupType(++offset) 4719if(type!==Number$3){if(!this.isDelim(PLUSSIGN$5,offset)&&!this.isDelim(HYPHENMINUS$2,offset))return null 4720sign=this.isDelim(PLUSSIGN$5,offset)?PLUSSIGN$5:HYPHENMINUS$2 4721do{type=this.lookupType(++offset)}while(type===WhiteSpace$1||type===Comment$1) 4722if(type!==Number$3){this.skip(offset) 4723checkTokenIsInteger.call(this,DISALLOW_SIGN)}}offset>0&&this.skip(offset) 4724if(sign===0){type=this.charCodeAt(this.tokenStart) 4725type!==PLUSSIGN$5&&type!==HYPHENMINUS$2&&this.error("Number sign is expected")}checkTokenIsInteger.call(this,sign!==0) 4726return sign===HYPHENMINUS$2?"-"+this.consume(Number$3):this.consume(Number$3)}const name$1p="AnPlusB" 4727const structure$D={a:[String,null],b:[String,null]} 4728function parse$G(){const start=this.tokenStart 4729let a=null 4730let b=null 4731if(this.tokenType===Number$3){checkTokenIsInteger.call(this,ALLOW_SIGN) 4732b=this.consume(Number$3)}else if(this.tokenType===Ident&&this.cmpChar(this.tokenStart,HYPHENMINUS$2)){a="-1" 4733expectCharCode.call(this,1,N) 4734switch(this.tokenEnd-this.tokenStart){case 2:this.next() 4735b=consumeB.call(this) 4736break 4737case 3:expectCharCode.call(this,2,HYPHENMINUS$2) 4738this.next() 4739this.skipSC() 4740checkTokenIsInteger.call(this,DISALLOW_SIGN) 4741b="-"+this.consume(Number$3) 4742break 4743default:expectCharCode.call(this,2,HYPHENMINUS$2) 4744checkInteger.call(this,3,DISALLOW_SIGN) 4745this.next() 4746b=this.substrToCursor(start+2)}}else if(this.tokenType===Ident||this.isDelim(PLUSSIGN$5)&&this.lookupType(1)===Ident){let sign=0 4747a="1" 4748if(this.isDelim(PLUSSIGN$5)){sign=1 4749this.next()}expectCharCode.call(this,0,N) 4750switch(this.tokenEnd-this.tokenStart){case 1:this.next() 4751b=consumeB.call(this) 4752break 4753case 2:expectCharCode.call(this,1,HYPHENMINUS$2) 4754this.next() 4755this.skipSC() 4756checkTokenIsInteger.call(this,DISALLOW_SIGN) 4757b="-"+this.consume(Number$3) 4758break 4759default:expectCharCode.call(this,1,HYPHENMINUS$2) 4760checkInteger.call(this,2,DISALLOW_SIGN) 4761this.next() 4762b=this.substrToCursor(start+sign+1)}}else if(this.tokenType===Dimension$1){const code=this.charCodeAt(this.tokenStart) 4763const sign=code===PLUSSIGN$5||code===HYPHENMINUS$2 4764let i=this.tokenStart+sign 4765for(;i<this.tokenEnd;i++)if(!isDigit$1(this.charCodeAt(i)))break 4766i===this.tokenStart+sign&&this.error("Integer is expected",this.tokenStart+sign) 4767expectCharCode.call(this,i-this.tokenStart,N) 4768a=this.substring(start,i) 4769if(i+1===this.tokenEnd){this.next() 4770b=consumeB.call(this)}else{expectCharCode.call(this,i-this.tokenStart+1,HYPHENMINUS$2) 4771if(i+2===this.tokenEnd){this.next() 4772this.skipSC() 4773checkTokenIsInteger.call(this,DISALLOW_SIGN) 4774b="-"+this.consume(Number$3)}else{checkInteger.call(this,i-this.tokenStart+2,DISALLOW_SIGN) 4775this.next() 4776b=this.substrToCursor(i+1)}}}else this.error() 4777a!==null&&a.charCodeAt(0)===PLUSSIGN$5&&(a=a.substr(1)) 4778b!==null&&b.charCodeAt(0)===PLUSSIGN$5&&(b=b.substr(1)) 4779return{type:"AnPlusB",loc:this.getLocation(start,this.tokenStart),a:a,b:b}}function generate$G(node){if(node.a){const a=(node.a==="+1"||node.a==="1"?"n":node.a==="-1"&&"-n")||node.a+"n" 4780if(node.b){const b=node.b[0]==="-"||node.b[0]==="+"?node.b:"+"+node.b 4781this.tokenize(a+b)}else this.tokenize(a)}else this.tokenize(node.b)}var AnPlusB=Object.freeze({__proto__:null,generate:generate$G,name:name$1p,parse:parse$G,structure:structure$D}) 4782function consumeRaw$5(startToken){return this.Raw(startToken,this.consumeUntilLeftCurlyBracketOrSemicolon,true)}function isDeclarationBlockAtrule(){for(let offset=1,type;type=this.lookupType(offset);offset++){if(type===RightCurlyBracket)return true 4783if(type===LeftCurlyBracket||type===AtKeyword)return false}return false}const name$1o="Atrule" 4784const walkContext$9="atrule" 4785const structure$C={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]} 4786function parse$F(){const start=this.tokenStart 4787let name 4788let nameLowerCase 4789let prelude=null 4790let block=null 4791this.eat(AtKeyword) 4792name=this.substrToCursor(start+1) 4793nameLowerCase=name.toLowerCase() 4794this.skipSC() 4795if(this.eof===false&&this.tokenType!==LeftCurlyBracket&&this.tokenType!==Semicolon){prelude=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,name),consumeRaw$5):consumeRaw$5.call(this,this.tokenIndex) 4796this.skipSC()}switch(this.tokenType){case Semicolon:this.next() 4797break 4798case LeftCurlyBracket:block=hasOwnProperty.call(this.atrule,nameLowerCase)&&typeof this.atrule[nameLowerCase].block==="function"?this.atrule[nameLowerCase].block.call(this):this.Block(isDeclarationBlockAtrule.call(this)) 4799break}return{type:"Atrule",loc:this.getLocation(start,this.tokenStart),name:name,prelude:prelude,block:block}}function generate$F(node){this.token(AtKeyword,"@"+node.name) 4800node.prelude!==null&&this.node(node.prelude) 4801node.block?this.node(node.block):this.token(Semicolon,";")}var Atrule$1=Object.freeze({__proto__:null,generate:generate$F,name:name$1o,parse:parse$F,structure:structure$C,walkContext:walkContext$9}) 4802const name$1n="AtrulePrelude" 4803const walkContext$8="atrulePrelude" 4804const structure$B={children:[[]]} 4805function parse$E(name){let children=null 4806name!==null&&(name=name.toLowerCase()) 4807this.skipSC() 4808children=hasOwnProperty.call(this.atrule,name)&&typeof this.atrule[name].prelude==="function"?this.atrule[name].prelude.call(this):this.readSequence(this.scope.AtrulePrelude) 4809this.skipSC() 4810this.eof!==true&&this.tokenType!==LeftCurlyBracket&&this.tokenType!==Semicolon&&this.error("Semicolon or block is expected") 4811return{type:"AtrulePrelude",loc:this.getLocationFromList(children),children:children}}function generate$E(node){this.children(node)}var AtrulePrelude=Object.freeze({__proto__:null,generate:generate$E,name:name$1n,parse:parse$E,structure:structure$B,walkContext:walkContext$8}) 4812const DOLLARSIGN$1=0x0024 4813const ASTERISK$5=0x002A 4814const EQUALSSIGN=0x003D 4815const CIRCUMFLEXACCENT=0x005E 4816const VERTICALLINE$2=0x007C 4817const TILDE$2=0x007E 4818function getAttributeName(){this.eof&&this.error("Unexpected end of input") 4819const start=this.tokenStart 4820let expectIdent=false 4821if(this.isDelim(ASTERISK$5)){expectIdent=true 4822this.next()}else this.isDelim(VERTICALLINE$2)||this.eat(Ident) 4823if(this.isDelim(VERTICALLINE$2))if(this.charCodeAt(this.tokenStart+1)!==EQUALSSIGN){this.next() 4824this.eat(Ident)}else expectIdent&&this.error("Identifier is expected",this.tokenEnd) 4825else expectIdent&&this.error("Vertical line is expected") 4826return{type:"Identifier",loc:this.getLocation(start,this.tokenStart),name:this.substrToCursor(start)}}function getOperator(){const start=this.tokenStart 4827const code=this.charCodeAt(start) 4828code!==EQUALSSIGN&&code!==TILDE$2&&code!==CIRCUMFLEXACCENT&&code!==DOLLARSIGN$1&&code!==ASTERISK$5&&code!==VERTICALLINE$2&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected") 4829this.next() 4830if(code!==EQUALSSIGN){this.isDelim(EQUALSSIGN)||this.error("Equal sign is expected") 4831this.next()}return this.substrToCursor(start)}const name$1m="AttributeSelector" 4832const structure$A={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]} 4833function parse$D(){const start=this.tokenStart 4834let name 4835let matcher=null 4836let value=null 4837let flags=null 4838this.eat(LeftSquareBracket) 4839this.skipSC() 4840name=getAttributeName.call(this) 4841this.skipSC() 4842if(this.tokenType!==RightSquareBracket){if(this.tokenType!==Ident){matcher=getOperator.call(this) 4843this.skipSC() 4844value=this.tokenType===String$2?this.String():this.Identifier() 4845this.skipSC()}if(this.tokenType===Ident){flags=this.consume(Ident) 4846this.skipSC()}}this.eat(RightSquareBracket) 4847return{type:"AttributeSelector",loc:this.getLocation(start,this.tokenStart),name:name,matcher:matcher,value:value,flags:flags}}function generate$D(node){this.token(Delim,"[") 4848this.node(node.name) 4849if(node.matcher!==null){this.tokenize(node.matcher) 4850this.node(node.value)}node.flags!==null&&this.token(Ident,node.flags) 4851this.token(Delim,"]")}var AttributeSelector$1=Object.freeze({__proto__:null,generate:generate$D,name:name$1m,parse:parse$D,structure:structure$A}) 4852function consumeRaw$4(startToken){return this.Raw(startToken,null,true)}function consumeRule(){return this.parseWithFallback(this.Rule,consumeRaw$4)}function consumeRawDeclaration(startToken){return this.Raw(startToken,this.consumeUntilSemicolonIncluded,true)}function consumeDeclaration(){if(this.tokenType===Semicolon)return consumeRawDeclaration.call(this,this.tokenIndex) 4853const node=this.parseWithFallback(this.Declaration,consumeRawDeclaration) 4854this.tokenType===Semicolon&&this.next() 4855return node}const name$1l="Block" 4856const walkContext$7="block" 4857const structure$z={children:[["Atrule","Rule","Declaration"]]} 4858function parse$C(isDeclaration){const consumer=isDeclaration?consumeDeclaration:consumeRule 4859const start=this.tokenStart 4860let children=this.createList() 4861this.eat(LeftCurlyBracket) 4862scan:while(!this.eof)switch(this.tokenType){case RightCurlyBracket:break scan 4863case WhiteSpace$1:case Comment$1:this.next() 4864break 4865case AtKeyword:children.push(this.parseWithFallback(this.Atrule,consumeRaw$4)) 4866break 4867default:children.push(consumer.call(this))}this.eof||this.eat(RightCurlyBracket) 4868return{type:"Block",loc:this.getLocation(start,this.tokenStart),children:children}}function generate$C(node){this.token(LeftCurlyBracket,"{") 4869this.children(node,
vendor: 11,343 bytes, lines 4869-5045
4869(prev=>{prev.type==="Declaration"&&this.token(Semicolon,";")})) 4870this.token(RightCurlyBracket,"}")}var Block=Object.freeze({__proto__:null,generate:generate$C,name:name$1l,parse:parse$C,structure:structure$z,walkContext:walkContext$7}) 4871const name$1k="Brackets" 4872const structure$y={children:[[]]} 4873function parse$B(readSequence,recognizer){const start=this.tokenStart 4874let children=null 4875this.eat(LeftSquareBracket) 4876children=readSequence.call(this,recognizer) 4877this.eof||this.eat(RightSquareBracket) 4878return{type:"Brackets",loc:this.getLocation(start,this.tokenStart),children:children}}function generate$B(node){this.token(Delim,"[") 4879this.children(node) 4880this.token(Delim,"]")}var Brackets=Object.freeze({__proto__:null,generate:generate$B,name:name$1k,parse:parse$B,structure:structure$y}) 4881const name$1j="CDC" 4882const structure$x=[] 4883function parse$A(){const start=this.tokenStart 4884this.eat(CDC$1) 4885return{type:"CDC",loc:this.getLocation(start,this.tokenStart)}}function generate$A(){this.token(CDC$1,"--\x3e")}var CDC=Object.freeze({__proto__:null,generate:generate$A,name:name$1j,parse:parse$A,structure:structure$x}) 4886const name$1i="CDO" 4887const structure$w=[] 4888function parse$z(){const start=this.tokenStart 4889this.eat(CDO$1) 4890return{type:"CDO",loc:this.getLocation(start,this.tokenStart)}}function generate$z(){this.token(CDO$1,"\x3c!--")}var CDO=Object.freeze({__proto__:null,generate:generate$z,name:name$1i,parse:parse$z,structure:structure$w}) 4891const FULLSTOP$2=0x002E 4892const name$1h="ClassSelector" 4893const structure$v={name:String} 4894function parse$y(){this.eatDelim(FULLSTOP$2) 4895return{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(Ident)}}function generate$y(node){this.token(Delim,".") 4896this.token(Ident,node.name)}var ClassSelector=Object.freeze({__proto__:null,generate:generate$y,name:name$1h,parse:parse$y,structure:structure$v}) 4897const PLUSSIGN$4=0x002B 4898const SOLIDUS$5=0x002F 4899const GREATERTHANSIGN$1=0x003E 4900const TILDE$1=0x007E 4901const name$1g="Combinator" 4902const structure$u={name:String} 4903function parse$x(){const start=this.tokenStart 4904let name 4905switch(this.tokenType){case WhiteSpace$1:name=" " 4906break 4907case Delim:switch(this.charCodeAt(this.tokenStart)){case GREATERTHANSIGN$1:case PLUSSIGN$4:case TILDE$1:this.next() 4908break 4909case SOLIDUS$5:this.next() 4910this.eatIdent("deep") 4911this.eatDelim(SOLIDUS$5) 4912break 4913default:this.error("Combinator is expected")}name=this.substrToCursor(start) 4914break}return{type:"Combinator",loc:this.getLocation(start,this.tokenStart),name:name}}function generate$x(node){this.tokenize(node.name)}var Combinator=Object.freeze({__proto__:null,generate:generate$x,name:name$1g,parse:parse$x,structure:structure$u}) 4915const ASTERISK$4=0x002A 4916const SOLIDUS$4=0x002F 4917const name$1f="Comment" 4918const structure$t={value:String} 4919function parse$w(){const start=this.tokenStart 4920let end=this.tokenEnd 4921this.eat(Comment$1) 4922end-start+2>=2&&this.charCodeAt(end-2)===ASTERISK$4&&this.charCodeAt(end-1)===SOLIDUS$4&&(end-=2) 4923return{type:"Comment",loc:this.getLocation(start,this.tokenStart),value:this.substring(start+2,end)}}function generate$w(node){this.token(Comment$1,"/*"+node.value+"*/")}var Comment=Object.freeze({__proto__:null,generate:generate$w,name:name$1f,parse:parse$w,structure:structure$t}) 4924const EXCLAMATIONMARK$1=0x0021 4925const NUMBERSIGN$2=0x0023 4926const DOLLARSIGN=0x0024 4927const AMPERSAND=0x0026 4928const ASTERISK$3=0x002A 4929const PLUSSIGN$3=0x002B 4930const SOLIDUS$3=0x002F 4931function consumeValueRaw(startToken){return this.Raw(startToken,this.consumeUntilExclamationMarkOrSemicolon,true)}function consumeCustomPropertyRaw(startToken){return this.Raw(startToken,this.consumeUntilExclamationMarkOrSemicolon,false)}function consumeValue(){const startValueToken=this.tokenIndex 4932const value=this.Value() 4933value.type!=="Raw"&&this.eof===false&&this.tokenType!==Semicolon&&this.isDelim(EXCLAMATIONMARK$1)===false&&this.isBalanceEdge(startValueToken)===false&&this.error() 4934return value}const name$1e="Declaration" 4935const walkContext$6="declaration" 4936const structure$s={important:[Boolean,String],property:String,value:["Value","Raw"]} 4937function parse$v(){const start=this.tokenStart 4938const startToken=this.tokenIndex 4939const property=readProperty.call(this) 4940const customProperty=isCustomProperty(property) 4941const parseValue=customProperty?this.parseCustomProperty:this.parseValue 4942const consumeRaw=customProperty?consumeCustomPropertyRaw:consumeValueRaw 4943let important=false 4944let value 4945this.skipSC() 4946this.eat(Colon) 4947const valueStart=this.tokenIndex 4948customProperty||this.skipSC() 4949value=parseValue?this.parseWithFallback(consumeValue,consumeRaw):consumeRaw.call(this,this.tokenIndex) 4950if(customProperty&&value.type==="Value"&&value.children.isEmpty)for(let offset=valueStart-this.tokenIndex;offset<=0;offset++)if(this.lookupType(offset)===WhiteSpace$1){value.children.appendData({type:"WhiteSpace",loc:null,value:" "}) 4951break}if(this.isDelim(EXCLAMATIONMARK$1)){important=getImportant.call(this) 4952this.skipSC()}this.eof===false&&this.tokenType!==Semicolon&&this.isBalanceEdge(startToken)===false&&this.error() 4953return{type:"Declaration",loc:this.getLocation(start,this.tokenStart),important:important,property:property,value:value}}function generate$v(node){this.token(Ident,node.property) 4954this.token(Colon,":") 4955this.node(node.value) 4956if(node.important){this.token(Delim,"!") 4957this.token(Ident,node.important===true?"important":node.important)}}function readProperty(){const start=this.tokenStart 4958if(this.tokenType===Delim)switch(this.charCodeAt(this.tokenStart)){case ASTERISK$3:case DOLLARSIGN:case PLUSSIGN$3:case NUMBERSIGN$2:case AMPERSAND:this.next() 4959break 4960case SOLIDUS$3:this.next() 4961this.isDelim(SOLIDUS$3)&&this.next() 4962break}this.tokenType===Hash$1?this.eat(Hash$1):this.eat(Ident) 4963return this.substrToCursor(start)}function getImportant(){this.eat(Delim) 4964this.skipSC() 4965const important=this.consume(Ident) 4966return important==="important"||important}var Declaration=Object.freeze({__proto__:null,generate:generate$v,name:name$1e,parse:parse$v,structure:structure$s,walkContext:walkContext$6}) 4967function consumeRaw$3(startToken){return this.Raw(startToken,this.consumeUntilSemicolonIncluded,true)}const name$1d="DeclarationList" 4968const structure$r={children:[["Declaration"]]} 4969function parse$u(){const children=this.createList() 4970while(!this.eof)switch(this.tokenType){case WhiteSpace$1:case Comment$1:case Semicolon:this.next() 4971break 4972default:children.push(this.parseWithFallback(this.Declaration,consumeRaw$3))}return{type:"DeclarationList",loc:this.getLocationFromList(children),children:children}}function generate$u(node){this.children(node,(prev=>{prev.type==="Declaration"&&this.token(Semicolon,";")}))}var DeclarationList=Object.freeze({__proto__:null,generate:generate$u,name:name$1d,parse:parse$u,structure:structure$r}) 4973const name$1c="Dimension" 4974const structure$q={value:String,unit:String} 4975function parse$t(){const start=this.tokenStart 4976const value=this.consumeNumber(Dimension$1) 4977return{type:"Dimension",loc:this.getLocation(start,this.tokenStart),value:value,unit:this.substring(start+value.length,this.tokenStart)}}function generate$t(node){this.token(Dimension$1,node.value+node.unit)}var Dimension=Object.freeze({__proto__:null,generate:generate$t,name:name$1c,parse:parse$t,structure:structure$q}) 4978const name$1b="Function" 4979const walkContext$5="function" 4980const structure$p={name:String,children:[[]]} 4981function parse$s(readSequence,recognizer){const start=this.tokenStart 4982const name=this.consumeFunctionName() 4983const nameLowerCase=name.toLowerCase() 4984let children 4985children=recognizer.hasOwnProperty(nameLowerCase)?recognizer[nameLowerCase].call(this,recognizer):readSequence.call(this,recognizer) 4986this.eof||this.eat(RightParenthesis) 4987return{type:"Function",loc:this.getLocation(start,this.tokenStart),name:name,children:children}}function generate$s(node){this.token(Function$1,node.name+"(") 4988this.children(node) 4989this.token(RightParenthesis,")")}var Function=Object.freeze({__proto__:null,generate:generate$s,name:name$1b,parse:parse$s,structure:structure$p,walkContext:walkContext$5}) 4990const xxx="XXX" 4991const name$1a="Hash" 4992const structure$o={value:String} 4993function parse$r(){const start=this.tokenStart 4994this.eat(Hash$1) 4995return{type:"Hash",loc:this.getLocation(start,this.tokenStart),value:this.substrToCursor(start+1)}}function generate$r(node){this.token(Hash$1,"#"+node.value)}var Hash=Object.freeze({__proto__:null,generate:generate$r,name:name$1a,parse:parse$r,structure:structure$o,xxx:xxx}) 4996const name$19="Identifier" 4997const structure$n={name:String} 4998function parse$q(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(Ident)}}function generate$q(node){this.token(Ident,node.name)}var Identifier=Object.freeze({__proto__:null,generate:generate$q,name:name$19,parse:parse$q,structure:structure$n}) 4999const name$18="IdSelector" 5000const structure$m={name:String} 5001function parse$p(){const start=this.tokenStart 5002this.eat(Hash$1) 5003return{type:"IdSelector",loc:this.getLocation(start,this.tokenStart),name:this.substrToCursor(start+1)}}function generate$p(node){this.token(Delim,"#"+node.name)}var IdSelector=Object.freeze({__proto__:null,generate:generate$p,name:name$18,parse:parse$p,structure:structure$m}) 5004const name$17="MediaFeature" 5005const structure$l={name:String,value:["Identifier","Number","Dimension","Ratio",null]} 5006function parse$o(){const start=this.tokenStart 5007let name 5008let value=null 5009this.eat(LeftParenthesis) 5010this.skipSC() 5011name=this.consume(Ident) 5012this.skipSC() 5013if(this.tokenType!==RightParenthesis){this.eat(Colon) 5014this.skipSC() 5015switch(this.tokenType){case Number$3:value=this.lookupNonWSType(1)===Delim?this.Ratio():this.Number() 5016break 5017case Dimension$1:value=this.Dimension() 5018break 5019case Ident:value=this.Identifier() 5020break 5021default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}this.eat(RightParenthesis) 5022return{type:"MediaFeature",loc:this.getLocation(start,this.tokenStart),name:name,value:value}}function generate$o(node){this.token(LeftParenthesis,"(") 5023this.token(Ident,node.name) 5024if(node.value!==null){this.token(Colon,":") 5025this.node(node.value)}this.token(RightParenthesis,")")}var MediaFeature=Object.freeze({__proto__:null,generate:generate$o,name:name$17,parse:parse$o,structure:structure$l}) 5026const name$16="MediaQuery" 5027const structure$k={children:[["Identifier","MediaFeature","WhiteSpace"]]} 5028function parse$n(){const children=this.createList() 5029let child=null 5030this.skipSC() 5031scan:while(!this.eof){switch(this.tokenType){case Comment$1:case WhiteSpace$1:this.next() 5032continue 5033case Ident:child=this.Identifier() 5034break 5035case LeftParenthesis:child=this.MediaFeature() 5036break 5037default:break scan}children.push(child)}child===null&&this.error("Identifier or parenthesis is expected") 5038return{type:"MediaQuery",loc:this.getLocationFromList(children),children:children}}function generate$n(node){this.children(node)}var MediaQuery=Object.freeze({__proto__:null,generate:generate$n,name:name$16,parse:parse$n,structure:structure$k}) 5039const name$15="MediaQueryList" 5040const structure$j={children:[["MediaQuery"]]} 5041function parse$m(){const children=this.createList() 5042this.skipSC() 5043while(!this.eof){children.push(this.MediaQuery()) 5044if(this.tokenType!==Comma)break 5045this.next()}return{type:"MediaQueryList",loc:this.getLocationFromList(children),children:children}}function generate$m(node){this.children(node,(()=>this.token(Comma,",")
vendor: 8,323 bytes, lines 5045-5171
5045))}var MediaQueryList=Object.freeze({__proto__:null,generate:generate$m,name:name$15,parse:parse$m,structure:structure$j}) 5046const name$14="Nth" 5047const structure$i={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]} 5048function parse$l(){this.skipSC() 5049const start=this.tokenStart 5050let end=start 5051let selector=null 5052let nth 5053nth=this.lookupValue(0,"odd")||this.lookupValue(0,"even")?this.Identifier():this.AnPlusB() 5054end=this.tokenStart 5055this.skipSC() 5056if(this.lookupValue(0,"of")){this.next() 5057selector=this.SelectorList() 5058end=this.tokenStart}return{type:"Nth",loc:this.getLocation(start,end),nth:nth,selector:selector}}function generate$l(node){this.node(node.nth) 5059if(node.selector!==null){this.token(Ident,"of") 5060this.node(node.selector)}}var Nth=Object.freeze({__proto__:null,generate:generate$l,name:name$14,parse:parse$l,structure:structure$i}) 5061const name$13="Number" 5062const structure$h={value:String} 5063function parse$k(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(Number$3)}}function generate$k(node){this.token(Number$3,node.value)}var Number$2=Object.freeze({__proto__:null,generate:generate$k,name:name$13,parse:parse$k,structure:structure$h}) 5064const name$12="Operator" 5065const structure$g={value:String} 5066function parse$j(){const start=this.tokenStart 5067this.next() 5068return{type:"Operator",loc:this.getLocation(start,this.tokenStart),value:this.substrToCursor(start)}}function generate$j(node){this.tokenize(node.value)}var Operator=Object.freeze({__proto__:null,generate:generate$j,name:name$12,parse:parse$j,structure:structure$g}) 5069const name$11="Parentheses" 5070const structure$f={children:[[]]} 5071function parse$i(readSequence,recognizer){const start=this.tokenStart 5072let children=null 5073this.eat(LeftParenthesis) 5074children=readSequence.call(this,recognizer) 5075this.eof||this.eat(RightParenthesis) 5076return{type:"Parentheses",loc:this.getLocation(start,this.tokenStart),children:children}}function generate$i(node){this.token(LeftParenthesis,"(") 5077this.children(node) 5078this.token(RightParenthesis,")")}var Parentheses=Object.freeze({__proto__:null,generate:generate$i,name:name$11,parse:parse$i,structure:structure$f}) 5079const name$10="Percentage" 5080const structure$e={value:String} 5081function parse$h(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(Percentage$1)}}function generate$h(node){this.token(Percentage$1,node.value+"%")}var Percentage=Object.freeze({__proto__:null,generate:generate$h,name:name$10,parse:parse$h,structure:structure$e}) 5082const name$$="PseudoClassSelector" 5083const walkContext$4="function" 5084const structure$d={name:String,children:[["Raw"],null]} 5085function parse$g(){const start=this.tokenStart 5086let children=null 5087let name 5088let nameLowerCase 5089this.eat(Colon) 5090if(this.tokenType===Function$1){name=this.consumeFunctionName() 5091nameLowerCase=name.toLowerCase() 5092if(hasOwnProperty.call(this.pseudo,nameLowerCase)){this.skipSC() 5093children=this.pseudo[nameLowerCase].call(this) 5094this.skipSC()}else{children=this.createList() 5095children.push(this.Raw(this.tokenIndex,null,false))}this.eat(RightParenthesis)}else name=this.consume(Ident) 5096return{type:"PseudoClassSelector",loc:this.getLocation(start,this.tokenStart),name:name,children:children}}function generate$g(node){this.token(Colon,":") 5097if(node.children===null)this.token(Ident,node.name) 5098else{this.token(Function$1,node.name+"(") 5099this.children(node) 5100this.token(RightParenthesis,")")}}var PseudoClassSelector=Object.freeze({__proto__:null,generate:generate$g,name:name$$,parse:parse$g,structure:structure$d,walkContext:walkContext$4}) 5101const name$_="PseudoElementSelector" 5102const walkContext$3="function" 5103const structure$c={name:String,children:[["Raw"],null]} 5104function parse$f(){const start=this.tokenStart 5105let children=null 5106let name 5107let nameLowerCase 5108this.eat(Colon) 5109this.eat(Colon) 5110if(this.tokenType===Function$1){name=this.consumeFunctionName() 5111nameLowerCase=name.toLowerCase() 5112if(hasOwnProperty.call(this.pseudo,nameLowerCase)){this.skipSC() 5113children=this.pseudo[nameLowerCase].call(this) 5114this.skipSC()}else{children=this.createList() 5115children.push(this.Raw(this.tokenIndex,null,false))}this.eat(RightParenthesis)}else name=this.consume(Ident) 5116return{type:"PseudoElementSelector",loc:this.getLocation(start,this.tokenStart),name:name,children:children}}function generate$f(node){this.token(Colon,":") 5117this.token(Colon,":") 5118if(node.children===null)this.token(Ident,node.name) 5119else{this.token(Function$1,node.name+"(") 5120this.children(node) 5121this.token(RightParenthesis,")")}}var PseudoElementSelector=Object.freeze({__proto__:null,generate:generate$f,name:name$_,parse:parse$f,structure:structure$c,walkContext:walkContext$3}) 5122const SOLIDUS$2=0x002F 5123const FULLSTOP$1=0x002E 5124function consumeNumber(){this.skipSC() 5125const value=this.consume(Number$3) 5126for(let i=0;i<value.length;i++){const code=value.charCodeAt(i) 5127isDigit$1(code)||code===FULLSTOP$1||this.error("Unsigned number is expected",this.tokenStart-value.length+i)}Number(value)===0&&this.error("Zero number is not allowed",this.tokenStart-value.length) 5128return value}const name$Z="Ratio" 5129const structure$b={left:String,right:String} 5130function parse$e(){const start=this.tokenStart 5131const left=consumeNumber.call(this) 5132let right 5133this.skipSC() 5134this.eatDelim(SOLIDUS$2) 5135right=consumeNumber.call(this) 5136return{type:"Ratio",loc:this.getLocation(start,this.tokenStart),left:left,right:right}}function generate$e(node){this.token(Number$3,node.left) 5137this.token(Delim,"/") 5138this.token(Number$3,node.right)}var Ratio=Object.freeze({__proto__:null,generate:generate$e,name:name$Z,parse:parse$e,structure:structure$b}) 5139function getOffsetExcludeWS(){if(this.tokenIndex>0&&this.lookupType(-1)===WhiteSpace$1)return this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset 5140return this.tokenStart}const name$Y="Raw" 5141const structure$a={value:String} 5142function parse$d(startToken,consumeUntil,excludeWhiteSpace){const startOffset=this.getTokenStart(startToken) 5143let endOffset 5144this.skipUntilBalanced(startToken,consumeUntil||this.consumeUntilBalanceEnd) 5145endOffset=excludeWhiteSpace&&this.tokenStart>startOffset?getOffsetExcludeWS.call(this):this.tokenStart 5146return{type:"Raw",loc:this.getLocation(startOffset,endOffset),value:this.substring(startOffset,endOffset)}}function generate$d(node){this.tokenize(node.value)}var Raw=Object.freeze({__proto__:null,generate:generate$d,name:name$Y,parse:parse$d,structure:structure$a}) 5147function consumeRaw$2(startToken){return this.Raw(startToken,this.consumeUntilLeftCurlyBracket,true)}function consumePrelude(){const prelude=this.SelectorList() 5148prelude.type!=="Raw"&&this.eof===false&&this.tokenType!==LeftCurlyBracket&&this.error() 5149return prelude}const name$X="Rule" 5150const walkContext$2="rule" 5151const structure$9={prelude:["SelectorList","Raw"],block:["Block"]} 5152function parse$c(){const startToken=this.tokenIndex 5153const startOffset=this.tokenStart 5154let prelude 5155let block 5156prelude=this.parseRulePrelude?this.parseWithFallback(consumePrelude,consumeRaw$2):consumeRaw$2.call(this,startToken) 5157block=this.Block(true) 5158return{type:"Rule",loc:this.getLocation(startOffset,this.tokenStart),prelude:prelude,block:block}}function generate$c(node){this.node(node.prelude) 5159this.node(node.block)}var Rule=Object.freeze({__proto__:null,generate:generate$c,name:name$X,parse:parse$c,structure:structure$9,walkContext:walkContext$2}) 5160const name$W="Selector" 5161const structure$8={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]} 5162function parse$b(){const children=this.readSequence(this.scope.Selector) 5163this.getFirstListNode(children)===null&&this.error("Selector is expected") 5164return{type:"Selector",loc:this.getLocationFromList(children),children:children}}function generate$b(node){this.children(node)}var Selector=Object.freeze({__proto__:null,generate:generate$b,name:name$W,parse:parse$b,structure:structure$8}) 5165const name$V="SelectorList" 5166const walkContext$1="selector" 5167const structure$7={children:[["Selector","Raw"]]} 5168function parse$a(){const children=this.createList() 5169while(!this.eof){children.push(this.Selector()) 5170if(this.tokenType===Comma){this.next() 5171continue}break}return{type:"SelectorList",loc:this.getLocationFromList(children),children:children}}function generate$a(node){this.children(node,(
5171()=>this.token(Comma,",")
vendor: 18,815 bytes, lines 5171-5424
5171))}var SelectorList=Object.freeze({__proto__:null,generate:generate$a,name:name$V,parse:parse$a,structure:structure$7,walkContext:walkContext$1}) 5172const REVERSE_SOLIDUS$1=0x005c 5173const QUOTATION_MARK$1=0x0022 5174const APOSTROPHE$1=0x0027 5175function decode$1(str){const len=str.length 5176const firstChar=str.charCodeAt(0) 5177const start=firstChar===QUOTATION_MARK$1||firstChar===APOSTROPHE$1?1:0 5178const end=start===1&&len>1&&str.charCodeAt(len-1)===firstChar?len-2:len-1 5179let decoded="" 5180for(let i=start;i<=end;i++){let code=str.charCodeAt(i) 5181if(code===REVERSE_SOLIDUS$1){if(i===end){i!==len-1&&(decoded=str.substr(i+1)) 5182break}code=str.charCodeAt(++i) 5183if(isValidEscape(REVERSE_SOLIDUS$1,code)){const escapeStart=i-1 5184const escapeEnd=consumeEscaped(str,escapeStart) 5185i=escapeEnd-1 5186decoded+=decodeEscaped(str.substring(escapeStart+1,escapeEnd))}else code===0x000d&&str.charCodeAt(i+1)===0x000a&&i++}else decoded+=str[i]}return decoded}function encode$1(str,apostrophe){const quote=apostrophe?"'":'"' 5187const quoteCode=apostrophe?APOSTROPHE$1:QUOTATION_MARK$1 5188let encoded="" 5189let wsBeforeHexIsNeeded=false 5190for(let i=0;i<str.length;i++){const code=str.charCodeAt(i) 5191if(code===0x0000){encoded+="�" 5192continue}if(code<=0x001f||code===0x007F){encoded+="\\"+code.toString(16) 5193wsBeforeHexIsNeeded=true 5194continue}if(code===quoteCode||code===REVERSE_SOLIDUS$1){encoded+="\\"+str.charAt(i) 5195wsBeforeHexIsNeeded=false}else{wsBeforeHexIsNeeded&&(isHexDigit(code)||isWhiteSpace$1(code))&&(encoded+=" ") 5196encoded+=str.charAt(i) 5197wsBeforeHexIsNeeded=false}}return quote+encoded+quote}const name$U="String" 5198const structure$6={value:String} 5199function parse$9(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:decode$1(this.consume(String$2))}}function generate$9(node){this.token(String$2,encode$1(node.value))}var String$1=Object.freeze({__proto__:null,generate:generate$9,name:name$U,parse:parse$9,structure:structure$6}) 5200const EXCLAMATIONMARK=0x0021 5201function consumeRaw$1(startToken){return this.Raw(startToken,null,false)}const name$T="StyleSheet" 5202const walkContext="stylesheet" 5203const structure$5={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]} 5204function parse$8(){const start=this.tokenStart 5205const children=this.createList() 5206let child 5207while(!this.eof){switch(this.tokenType){case WhiteSpace$1:this.next() 5208continue 5209case Comment$1:if(this.charCodeAt(this.tokenStart+2)!==EXCLAMATIONMARK){this.next() 5210continue}child=this.Comment() 5211break 5212case CDO$1:child=this.CDO() 5213break 5214case CDC$1:child=this.CDC() 5215break 5216case AtKeyword:child=this.parseWithFallback(this.Atrule,consumeRaw$1) 5217break 5218default:child=this.parseWithFallback(this.Rule,consumeRaw$1)}children.push(child)}return{type:"StyleSheet",loc:this.getLocation(start,this.tokenStart),children:children}}function generate$8(node){this.children(node)}var StyleSheet=Object.freeze({__proto__:null,generate:generate$8,name:name$T,parse:parse$8,structure:structure$5,walkContext:walkContext}) 5219const ASTERISK$2=0x002A 5220const VERTICALLINE$1=0x007C 5221function eatIdentifierOrAsterisk(){this.tokenType!==Ident&&this.isDelim(ASTERISK$2)===false&&this.error("Identifier or asterisk is expected") 5222this.next()}const name$S="TypeSelector" 5223const structure$4={name:String} 5224function parse$7(){const start=this.tokenStart 5225if(this.isDelim(VERTICALLINE$1)){this.next() 5226eatIdentifierOrAsterisk.call(this)}else{eatIdentifierOrAsterisk.call(this) 5227if(this.isDelim(VERTICALLINE$1)){this.next() 5228eatIdentifierOrAsterisk.call(this)}}return{type:"TypeSelector",loc:this.getLocation(start,this.tokenStart),name:this.substrToCursor(start)}}function generate$7(node){this.tokenize(node.name)}var TypeSelector=Object.freeze({__proto__:null,generate:generate$7,name:name$S,parse:parse$7,structure:structure$4}) 5229const PLUSSIGN$2=0x002B 5230const HYPHENMINUS$1=0x002D 5231const QUESTIONMARK=0x003F 5232function eatHexSequence(offset,allowDash){let len=0 5233for(let pos=this.tokenStart+offset;pos<this.tokenEnd;pos++){const code=this.charCodeAt(pos) 5234if(code===HYPHENMINUS$1&&allowDash&&len!==0){eatHexSequence.call(this,offset+len+1,false) 5235return-1}isHexDigit(code)||this.error(allowDash&&len!==0?"Hyphen minus"+(len<6?" or hex digit":"")+" is expected":len<6?"Hex digit is expected":"Unexpected input",pos);++len>6&&this.error("Too many hex digits",pos)}this.next() 5236return len}function eatQuestionMarkSequence(max){let count=0 5237while(this.isDelim(QUESTIONMARK)){++count>max&&this.error("Too many question marks") 5238this.next()}}function startsWith(code){this.charCodeAt(this.tokenStart)!==code&&this.error((code===PLUSSIGN$2?"Plus sign":"Hyphen minus")+" is expected")}function scanUnicodeRange(){let hexLength=0 5239switch(this.tokenType){case Number$3:hexLength=eatHexSequence.call(this,1,true) 5240if(this.isDelim(QUESTIONMARK)){eatQuestionMarkSequence.call(this,6-hexLength) 5241break}if(this.tokenType===Dimension$1||this.tokenType===Number$3){startsWith.call(this,HYPHENMINUS$1) 5242eatHexSequence.call(this,1,false) 5243break}break 5244case Dimension$1:hexLength=eatHexSequence.call(this,1,true) 5245hexLength>0&&eatQuestionMarkSequence.call(this,6-hexLength) 5246break 5247default:this.eatDelim(PLUSSIGN$2) 5248if(this.tokenType===Ident){hexLength=eatHexSequence.call(this,0,true) 5249hexLength>0&&eatQuestionMarkSequence.call(this,6-hexLength) 5250break}if(this.isDelim(QUESTIONMARK)){this.next() 5251eatQuestionMarkSequence.call(this,5) 5252break}this.error("Hex digit or question mark is expected")}}const name$R="UnicodeRange" 5253const structure$3={value:String} 5254function parse$6(){const start=this.tokenStart 5255this.eatIdent("u") 5256scanUnicodeRange.call(this) 5257return{type:"UnicodeRange",loc:this.getLocation(start,this.tokenStart),value:this.substrToCursor(start)}}function generate$6(node){this.tokenize(node.value)}var UnicodeRange=Object.freeze({__proto__:null,generate:generate$6,name:name$R,parse:parse$6,structure:structure$3}) 5258const SPACE$1=0x0020 5259const REVERSE_SOLIDUS=0x005c 5260const QUOTATION_MARK=0x0022 5261const APOSTROPHE=0x0027 5262const LEFTPARENTHESIS=0x0028 5263const RIGHTPARENTHESIS=0x0029 5264function decode(str){const len=str.length 5265let start=4 5266let end=str.charCodeAt(len-1)===RIGHTPARENTHESIS?len-2:len-1 5267let decoded="" 5268while(start<end&&isWhiteSpace$1(str.charCodeAt(start)))start++ 5269while(start<end&&isWhiteSpace$1(str.charCodeAt(end)))end-- 5270for(let i=start;i<=end;i++){let code=str.charCodeAt(i) 5271if(code===REVERSE_SOLIDUS){if(i===end){i!==len-1&&(decoded=str.substr(i+1)) 5272break}code=str.charCodeAt(++i) 5273if(isValidEscape(REVERSE_SOLIDUS,code)){const escapeStart=i-1 5274const escapeEnd=consumeEscaped(str,escapeStart) 5275i=escapeEnd-1 5276decoded+=decodeEscaped(str.substring(escapeStart+1,escapeEnd))}else code===0x000d&&str.charCodeAt(i+1)===0x000a&&i++}else decoded+=str[i]}return decoded}function encode(str){let encoded="" 5277let wsBeforeHexIsNeeded=false 5278for(let i=0;i<str.length;i++){const code=str.charCodeAt(i) 5279if(code===0x0000){encoded+="�" 5280continue}if(code<=0x001f||code===0x007F){encoded+="\\"+code.toString(16) 5281wsBeforeHexIsNeeded=true 5282continue}if(code===SPACE$1||code===REVERSE_SOLIDUS||code===QUOTATION_MARK||code===APOSTROPHE||code===LEFTPARENTHESIS||code===RIGHTPARENTHESIS){encoded+="\\"+str.charAt(i) 5283wsBeforeHexIsNeeded=false}else{wsBeforeHexIsNeeded&&isHexDigit(code)&&(encoded+=" ") 5284encoded+=str.charAt(i) 5285wsBeforeHexIsNeeded=false}}return"url("+encoded+")"}const name$Q="Url" 5286const structure$2={value:String} 5287function parse$5(){const start=this.tokenStart 5288let value 5289switch(this.tokenType){case Url$2:value=decode(this.consume(Url$2)) 5290break 5291case Function$1:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`") 5292this.eat(Function$1) 5293this.skipSC() 5294value=decode$1(this.consume(String$2)) 5295this.skipSC() 5296this.eof||this.eat(RightParenthesis) 5297break 5298default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(start,this.tokenStart),value:value}}function generate$5(node){this.token(Url$2,encode(node.value))}var Url$1=Object.freeze({__proto__:null,generate:generate$5,name:name$Q,parse:parse$5,structure:structure$2}) 5299const name$P="Value" 5300const structure$1={children:[[]]} 5301function parse$4(){const start=this.tokenStart 5302const children=this.readSequence(this.scope.Value) 5303return{type:"Value",loc:this.getLocation(start,this.tokenStart),children:children}}function generate$4(node){this.children(node)}var Value=Object.freeze({__proto__:null,generate:generate$4,name:name$P,parse:parse$4,structure:structure$1}) 5304const SPACE=Object.freeze({type:"WhiteSpace",loc:null,value:" "}) 5305const name$O="WhiteSpace" 5306const structure={value:String} 5307function parse$3(){this.eat(WhiteSpace$1) 5308return SPACE}function generate$3(node){this.token(WhiteSpace$1,node.value)}var WhiteSpace=Object.freeze({__proto__:null,generate:generate$3,name:name$O,parse:parse$3,structure:structure}) 5309var node$1=Object.freeze({__proto__:null,AnPlusB:AnPlusB,Atrule:Atrule$1,AtrulePrelude:AtrulePrelude,AttributeSelector:AttributeSelector$1,Block:Block,Brackets:Brackets,CDC:CDC,CDO:CDO,ClassSelector:ClassSelector,Combinator:Combinator,Comment:Comment,Declaration:Declaration,DeclarationList:DeclarationList,Dimension:Dimension,Function:Function,Hash:Hash,IdSelector:IdSelector,Identifier:Identifier,MediaFeature:MediaFeature,MediaQuery:MediaQuery,MediaQueryList:MediaQueryList,Nth:Nth,Number:Number$2,Operator:Operator,Parentheses:Parentheses,Percentage:Percentage,PseudoClassSelector:PseudoClassSelector,PseudoElementSelector:PseudoElementSelector,Ratio:Ratio,Raw:Raw,Rule:Rule,Selector:Selector,SelectorList:SelectorList,String:String$1,StyleSheet:StyleSheet,TypeSelector:TypeSelector,UnicodeRange:UnicodeRange,Url:Url$1,Value:Value,WhiteSpace:WhiteSpace}) 5310var lexerConfig={generic:true,...definitions,node:node$1} 5311const NUMBERSIGN$1=0x0023 5312const ASTERISK$1=0x002A 5313const PLUSSIGN$1=0x002B 5314const HYPHENMINUS=0x002D 5315const SOLIDUS$1=0x002F 5316const U=0x0075 5317function defaultRecognizer(context){switch(this.tokenType){case Hash$1:return this.Hash() 5318case Comma:return this.Operator() 5319case LeftParenthesis:return this.Parentheses(this.readSequence,context.recognizer) 5320case LeftSquareBracket:return this.Brackets(this.readSequence,context.recognizer) 5321case String$2:return this.String() 5322case Dimension$1:return this.Dimension() 5323case Percentage$1:return this.Percentage() 5324case Number$3:return this.Number() 5325case Function$1:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,context.recognizer) 5326case Url$2:return this.Url() 5327case Ident:return this.cmpChar(this.tokenStart,U)&&this.cmpChar(this.tokenStart+1,PLUSSIGN$1)?this.UnicodeRange():this.Identifier() 5328case Delim:{const code=this.charCodeAt(this.tokenStart) 5329if(code===SOLIDUS$1||code===ASTERISK$1||code===PLUSSIGN$1||code===HYPHENMINUS)return this.Operator() 5330code===NUMBERSIGN$1&&this.error("Hex or identifier is expected",this.tokenStart+1) 5331break}}}var atrulePrelude={getNode:defaultRecognizer} 5332const NUMBERSIGN=0x0023 5333const ASTERISK=0x002A 5334const PLUSSIGN=0x002B 5335const SOLIDUS=0x002F 5336const FULLSTOP=0x002E 5337const GREATERTHANSIGN=0x003E 5338const VERTICALLINE=0x007C 5339const TILDE=0x007E 5340function onWhiteSpace(next,children){children.last!==null&&children.last.type!=="Combinator"&&next!==null&&next.type!=="Combinator"&&children.push({type:"Combinator",loc:null,name:" "})}function getNode(){switch(this.tokenType){case LeftSquareBracket:return this.AttributeSelector() 5341case Hash$1:return this.IdSelector() 5342case Colon:return this.lookupType(1)===Colon?this.PseudoElementSelector():this.PseudoClassSelector() 5343case Ident:return this.TypeSelector() 5344case Number$3:case Percentage$1:return this.Percentage() 5345case Dimension$1:this.charCodeAt(this.tokenStart)===FULLSTOP&&this.error("Identifier is expected",this.tokenStart+1) 5346break 5347case Delim:{const code=this.charCodeAt(this.tokenStart) 5348switch(code){case PLUSSIGN:case GREATERTHANSIGN:case TILDE:case SOLIDUS:return this.Combinator() 5349case FULLSTOP:return this.ClassSelector() 5350case ASTERISK:case VERTICALLINE:return this.TypeSelector() 5351case NUMBERSIGN:return this.IdSelector()}break}}}var selector$1={onWhiteSpace:onWhiteSpace,getNode:getNode} 5352function expressionFn(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,false))}function varFn(){const children=this.createList() 5353this.skipSC() 5354children.push(this.Identifier()) 5355this.skipSC() 5356if(this.tokenType===Comma){children.push(this.Operator()) 5357const startIndex=this.tokenIndex 5358const value=this.parseCustomProperty?this.Value(null):this.Raw(this.tokenIndex,this.consumeUntilExclamationMarkOrSemicolon,false) 5359if(value.type==="Value"&&value.children.isEmpty)for(let offset=startIndex-this.tokenIndex;offset<=0;offset++)if(this.lookupType(offset)===WhiteSpace$1){value.children.appendData({type:"WhiteSpace",loc:null,value:" "}) 5360break}children.push(value)}return children}function isPlusMinusOperator(node){return node!==null&&node.type==="Operator"&&(node.value[node.value.length-1]==="-"||node.value[node.value.length-1]==="+")}var value={getNode:defaultRecognizer,onWhiteSpace(next,children){isPlusMinusOperator(next)&&(next.value=" "+next.value) 5361isPlusMinusOperator(children.last)&&(children.last.value+=" ")},expression:expressionFn,var:varFn} 5362var scope=Object.freeze({__proto__:null,AtrulePrelude:atrulePrelude,Selector:selector$1,Value:value}) 5363var fontFace={parse:{prelude:null,block(){return this.Block(true)}}} 5364var importAtrule={parse:{prelude(){const children=this.createList() 5365this.skipSC() 5366switch(this.tokenType){case String$2:children.push(this.String()) 5367break 5368case Url$2:case Function$1:children.push(this.Url()) 5369break 5370default:this.error("String or url() is expected")}this.lookupNonWSType(0)!==Ident&&this.lookupNonWSType(0)!==LeftParenthesis||children.push(this.MediaQueryList()) 5371return children},block:null}} 5372var media={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(){return this.Block(false)}}} 5373var page={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(true)}}} 5374function consumeRaw(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,false))}function parentheses(){this.skipSC() 5375if(this.tokenType===Ident&&this.lookupNonWSType(1)===Colon)return this.createSingleNodeList(this.Declaration()) 5376return readSequence.call(this)}function readSequence(){const children=this.createList() 5377let child 5378this.skipSC() 5379scan:while(!this.eof){switch(this.tokenType){case Comment$1:case WhiteSpace$1:this.next() 5380continue 5381case Function$1:child=this.Function(consumeRaw,this.scope.AtrulePrelude) 5382break 5383case Ident:child=this.Identifier() 5384break 5385case LeftParenthesis:child=this.Parentheses(parentheses,this.scope.AtrulePrelude) 5386break 5387default:break scan}children.push(child)}return children}var supports={parse:{prelude(){const children=readSequence.call(this) 5388this.getFirstListNode(children)===null&&this.error("Condition is expected") 5389return children},block(){return this.Block(false)}}} 5390var atrule={"font-face":fontFace,import:importAtrule,media:media,page:page,supports:supports} 5391const selectorList={parse(){return this.createSingleNodeList(this.SelectorList())}} 5392const selector={parse(){return this.createSingleNodeList(this.Selector())}} 5393const identList={parse(){return this.createSingleNodeList(this.Identifier())}} 5394const nth={parse(){return this.createSingleNodeList(this.Nth())}} 5395var pseudo={dir:identList,has:selectorList,lang:identList,matches:selectorList,is:selectorList,"-moz-any":selectorList,"-webkit-any":selectorList,where:selectorList,not:selectorList,"nth-child":nth,"nth-last-child":nth,"nth-last-of-type":nth,"nth-of-type":nth,slotted:selector} 5396var node=Object.freeze({__proto__:null,AnPlusB:parse$G,Atrule:parse$F,AtrulePrelude:parse$E,AttributeSelector:parse$D,Block:parse$C,Brackets:parse$B,CDC:parse$A,CDO:parse$z,ClassSelector:parse$y,Combinator:parse$x,Comment:parse$w,Declaration:parse$v,DeclarationList:parse$u,Dimension:parse$t,Function:parse$s,Hash:parse$r,IdSelector:parse$p,Identifier:parse$q,MediaFeature:parse$o,MediaQuery:parse$n,MediaQueryList:parse$m,Nth:parse$l,Number:parse$k,Operator:parse$j,Parentheses:parse$i,Percentage:parse$h,PseudoClassSelector:parse$g,PseudoElementSelector:parse$f,Ratio:parse$e,Raw:parse$d,Rule:parse$c,Selector:parse$b,SelectorList:parse$a,String:parse$9,StyleSheet:parse$8,TypeSelector:parse$7,UnicodeRange:parse$6,Url:parse$5,Value:parse$4,WhiteSpace:parse$3}) 5397var parserConfig={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(options){return this.AtrulePrelude(options.atrule?String(options.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(true)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},scope:scope,atrule:atrule,pseudo:pseudo,node:node} 5398var walkerConfig={node:node$1} 5399var syntax$1=createSyntax$1({...lexerConfig,...parserConfig,...walkerConfig}) 5400function clone(node){const result={} 5401for(const key in node){let value=node[key] 5402value&&(Array.isArray(value)||value instanceof List?value=value.map(clone):value.constructor===Object&&(value=clone(value))) 5403result[key]=value}return result}const{tokenize:tokenize$1,parse:parse$2,generate:generate$2,lexer:lexer$1,createLexer:createLexer,walk:walk$1,find:find$1,findLast:findLast$1,findAll:findAll$1,toPlainObject:toPlainObject$1,fromPlainObject:fromPlainObject$1,fork:fork}=syntax$1 5404const{hasOwnProperty:hasOwnProperty$4}=Object.prototype 5405function buildMap(list,caseInsensitive){const map=Object.create(null) 5406if(!Array.isArray(list))return null 5407for(let name of list){caseInsensitive&&(name=name.toLowerCase()) 5408map[name]=true}return map}function buildList(data){if(!data)return null 5409const tags=buildMap(data.tags,true) 5410const ids=buildMap(data.ids) 5411const classes=buildMap(data.classes) 5412if(tags===null&&ids===null&&classes===null)return null 5413return{tags:tags,ids:ids,classes:classes}}function buildIndex(data){let scopes=false 5414if(data.scopes&&Array.isArray(data.scopes)){scopes=Object.create(null) 5415for(let i=0;i<data.scopes.length;i++){const list=data.scopes[i] 5416if(!list||!Array.isArray(list))throw new Error("Wrong usage format") 5417for(const name of list){if(hasOwnProperty$4.call(scopes,name))throw new Error(`Class can't be used for several scopes: ${name}`) 5418scopes[name]=i+1}}}return{whitelist:buildList(data),blacklist:buildList(data.blacklist),scopes:scopes}}function hasNoChildren(node){return!node||!node.children||node.children.isEmpty}function isNodeChildrenList(node,list){return node!==null&&node.children===list}function cleanAtrule(node,item,list){if(node.block){this.stylesheet!==null&&(this.stylesheet.firstAtrulesAllowed=false) 5419if(hasNoChildren(node.block)){list.remove(item) 5420return}}switch(node.name){case"charset":if(hasNoChildren(node.prelude)){list.remove(item) 5421return}if(item.prev){list.remove(item) 5422return}break 5423case"import":if(this.stylesheet===null||!this.stylesheet.firstAtrulesAllowed){list.remove(item) 5424return}list.prevUntil(item.prev,
5424(function(rule){if(rule.type==="Atrule"&&(rule.name==="import"||rule.name==="charset"))return 5425this.root.firstAtrulesAllowed=false 5426list.remove(item) 5427return true}),this) 5428break 5429default:{const name=keyword(node.name).basename 5430name!=="keyframes"&&name!=="media"&&name!=="supports"||(hasNoChildren(node.prelude)||hasNoChildren(node.block))&&list.remove(item)}}}function cleanComment(data,item,list){list.remove(item)}function cleanDeclartion(node,item,list){if(node.value.children&&node.value.children.isEmpty){list.remove(item) 5431return}property(node.property).custom&&/\S/.test(node.value.value)&&(node.value.value=node.value.value.trim())}function cleanRaw(node,item,list){(isNodeChildrenList(this.stylesheet,list)||isNodeChildrenList(this.block,list))&&list.remove(item)}const{hasOwnProperty:hasOwnProperty$3}=Object.prototype 5432const skipUsageFilteringAtrule=new Set(["keyframes"]) 5433function cleanUnused(selectorList,usageData){selectorList.children.forEach(((selector,item,list)=>{let shouldRemove=false 5434walk$1(selector,(function(node){if(this.selector===null||this.selector===selectorList)switch(node.type){case"SelectorList":this.function!==null&&this.function.name.toLowerCase()==="not"||cleanUnused(node,usageData)&&(shouldRemove=true) 5435break 5436case"ClassSelector":usageData.whitelist===null||usageData.whitelist.classes===null||hasOwnProperty$3.call(usageData.whitelist.classes,node.name)||(shouldRemove=true) 5437usageData.blacklist!==null&&usageData.blacklist.classes!==null&&hasOwnProperty$3.call(usageData.blacklist.classes,node.name)&&(shouldRemove=true) 5438break 5439case"IdSelector":usageData.whitelist===null||usageData.whitelist.ids===null||hasOwnProperty$3.call(usageData.whitelist.ids,node.name)||(shouldRemove=true) 5440usageData.blacklist!==null&&usageData.blacklist.ids!==null&&hasOwnProperty$3.call(usageData.blacklist.ids,node.name)&&(shouldRemove=true) 5441break 5442case"TypeSelector":if(node.name.charAt(node.name.length-1)!=="*"){usageData.whitelist===null||usageData.whitelist.tags===null||hasOwnProperty$3.call(usageData.whitelist.tags,node.name.toLowerCase())||(shouldRemove=true) 5443usageData.blacklist!==null&&usageData.blacklist.tags!==null&&hasOwnProperty$3.call(usageData.blacklist.tags,node.name.toLowerCase())&&(shouldRemove=true)}break}})) 5444shouldRemove&&list.remove(item)})) 5445return selectorList.children.isEmpty}function cleanRule(node,item,list,options){if(hasNoChildren(node.prelude)||hasNoChildren(node.block)){list.remove(item) 5446return}if(this.atrule&&skipUsageFilteringAtrule.has(keyword(this.atrule.name).basename))return 5447const{usage:usage}=options 5448if(usage&&(usage.whitelist!==null||usage.blacklist!==null)){cleanUnused(node.prelude,usage) 5449if(hasNoChildren(node.prelude)){list.remove(item) 5450return}}}function cleanTypeSelector(node,item,list){const name=item.data.name 5451if(name!=="*")return 5452const nextType=item.next&&item.next.data.type 5453nextType!=="IdSelector"&&nextType!=="ClassSelector"&&nextType!=="AttributeSelector"&&nextType!=="PseudoClassSelector"&&nextType!=="PseudoElementSelector"||list.remove(item)}function cleanWhitespace(node,item,list){list.remove(item)}const handlers$2={Atrule:cleanAtrule,Comment:cleanComment,Declaration:cleanDeclartion,Raw:cleanRaw,Rule:cleanRule,TypeSelector:cleanTypeSelector,WhiteSpace:cleanWhitespace} 5454function clean(ast,options){walk$1(ast,{leave(node,item,list){handlers$2.hasOwnProperty(node.type)&&handlers$2[node.type].call(this,node,item,list,options)}})}function compressKeyframes(node){node.block.children.forEach((rule=>{rule.prelude.children.forEach((simpleselector=>{simpleselector.children.forEach(((data,item)=>{data.type==="Percentage"&&data.value==="100"?item.data={type:"TypeSelector",loc:data.loc,name:"to"}:data.type==="TypeSelector"&&data.name==="from"&&(item.data={type:"Percentage",loc:data.loc,value:"0"})}))}))}))}function Atrule(node){keyword(node.name).basename==="keyframes"&&compressKeyframes(node)}const blockUnquoteRx=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/ 5455function canUnquote(value){if(value===""||value==="-")return false 5456return!blockUnquoteRx.test(value)}function AttributeSelector(node){const attrValue=node.value 5457if(!attrValue||attrValue.type!=="String")return 5458canUnquote(attrValue.value)&&(node.value={type:"Identifier",loc:attrValue.loc,name:attrValue.value})}function compressFont(node){const list=node.children 5459list.forEachRight((function(node,item){if(node.type==="Identifier")if(node.name==="bold")item.data={type:"Number",loc:node.loc,value:"700"} 5460else if(node.name==="normal"){const prev=item.prev 5461prev&&prev.data.type==="Operator"&&prev.data.value==="/"&&this.remove(prev) 5462this.remove(item)}})) 5463list.isEmpty&&list.insert(list.createItem({type:"Identifier",name:"normal"}))}function compressFontWeight(node){const value=node.children.head.data 5464if(value.type==="Identifier")switch(value.name){case"normal":node.children.head.data={type:"Number",loc:value.loc,value:"400"} 5465break 5466case"bold":node.children.head.data={type:"Number",loc:value.loc,value:"700"} 5467break}}
5467function compressBackground(node){function flush(){buffer.length||buffer.unshift({type:"Number",loc:null,value:"0"},{type:"Number",loc:null,value:"0"}) 5468newValue.push.apply(newValue,buffer) 5469buffer=[]}let newValue=[] 5470let buffer=[] 5471node.children.forEach((node=>{if(node.type==="Operator"&&node.value===","){flush() 5472newValue.push(node) 5473return}if(node.type==="Identifier"&&(node.name==="transparent"||node.name==="none"||node.name==="repeat"||node.name==="scroll"))return 5474buffer.push(node)})) 5475flush() 5476node.children=(new List).fromArray(newValue)}function compressBorder(node){node.children.forEach(((node,item,list)=>{node.type==="Identifier"&&node.name.toLowerCase()==="none"&&(list.head===list.tail?item.data={type:"Number",loc:node.loc,value:"0"}:list.remove(item))}))}const handlers$1={font:compressFont,"font-weight":compressFontWeight,background:compressBackground,border:compressBorder,outline:compressBorder} 5477function compressValue(node){if(!this.declaration)return 5478const property$1=property(this.declaration.property) 5479handlers$1.hasOwnProperty(property$1.basename)&&handlers$1[property$1.basename](node)}const OMIT_PLUSSIGN=/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/ 5480function packNumber(value,item){const regexp=OMIT_PLUSSIGN 5481value=String(value).replace(regexp,"$1$2$3") 5482value!==""&&value!=="-"||(value="0") 5483return value}function Number$1(node){node.value=packNumber(node.value)}const MATH_FUNCTIONS=new Set(["calc","min","max","clamp"]) 5484const LENGTH_UNIT=new Set(["px","mm","cm","in","pt","pc","em","ex","ch","rem","vh","vw","vmin","vmax","vm"]) 5485function compressDimension(node,item){const value=packNumber(node.value) 5486node.value=value 5487if(value==="0"&&this.declaration!==null&&this.atrulePrelude===null){const unit=node.unit.toLowerCase() 5488if(!LENGTH_UNIT.has(unit))return 5489if(this.declaration.property==="-ms-flex"||this.declaration.property==="flex")return 5490if(this.function&&MATH_FUNCTIONS.has(this.function.name))return 5491item.data={type:"Number",loc:node.loc,value:value}}}const blacklist=new Set(["width","min-width","max-width","height","min-height","max-height","flex","-ms-flex"]) 5492function compressPercentage(node,item){node.value=packNumber(node.value) 5493if(node.value==="0"&&this.declaration&&!blacklist.has(this.declaration.property)){item.data={type:"Number",loc:node.loc,value:node.value} 5494lexer$1.matchDeclaration(this.declaration).isType(item.data,"length")||(item.data=node)}}function Url(node){node.value=node.value.replace(/\\/g,"/")}const NAME_TO_HEX={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",darkgrey:"a9a9a9",darkgreen:"006400",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",grey:"808080",green:"008000",greenyellow:"adff2f",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",lightgrey:"d3d3d3",lightgreen:"90ee9
54940",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"} 5495const HEX_TO_NAME={800000:"maroon",800080:"purple",808000:"olive",808080:"gray","00ffff":"cyan",f0ffff:"azure",f5f5dc:"beige",ffe4c4:"bisque","000000":"black","0000ff":"blue",a52a2a:"brown",ff7f50:"coral",ffd700:"gold","008000":"green","4b0082":"indigo",fffff0:"ivory",f0e68c:"khaki","00ff00":"lime",faf0e6:"linen","000080":"navy",ffa500:"orange",da70d6:"orchid",cd853f:"peru",ffc0cb:"pink",dda0dd:"plum",f00:"red",ff0000:"red",fa8072:"salmon",a0522d:"sienna",c0c0c0:"silver",fffafa:"snow",d2b48c:"tan","008080":"teal",ff6347:"tomato",ee82ee:"violet",f5deb3:"wheat",ffffff:"white",ffff00:"yellow"} 5496function hueToRgb(p,q,t){t<0&&(t+=1) 5497t>1&&(t-=1) 5498if(t<1/6)return p+6*(q-p)*t 5499if(t<.5)return q 5500if(t<2/3)return p+(q-p)*(2/3-t)*6 5501return p}function hslToRgb(h,s,l,a){let r 5502let g 5503let b 5504if(s===0)r=g=b=l 5505else{const q=l<0.5?l*(1+s):l+s-l*s 5506const p=2*l-q 5507r=hueToRgb(p,q,h+1/3) 5508g=hueToRgb(p,q,h) 5509b=hueToRgb(p,q,h-1/3)}return[Math.round(r*255),Math.round(g*255),Math.round(b*255),a]}function toHex(value){value=value.toString(16) 5510return value.length===1?"0"+value:value}function parseFunctionArgs(functionArgs,count,rgb){let cursor=functionArgs.head 5511let args=[] 5512let wasValue=false 5513while(cursor!==null){const{type:type,value:value}=cursor.data 5514switch(type){case"Number":case"Percentage":if(wasValue)return 5515wasValue=true 5516args.push({type:type,value:Number(value)}) 5517break 5518case"Operator":if(value===","){if(!wasValue)return 5519wasValue=false}else if(wasValue||value!=="+")return 5520break 5521default:return}cursor=cursor.next}if(args.length!==count)return 5522if(args.length===4){if(args[3].type!=="Number")return 5523args[3].type="Alpha"}if(rgb){if(args[0].type!==args[1].type||args[0].type!==args[2].type)return}else{if(args[0].type!=="Number"||args[1].type!=="Percentage"||args[2].type!=="Percentage")return 5524args[0].type="Angle"}return args.map((function(arg){let value=Math.max(0,arg.value) 5525switch(arg.type){case"Number":value=Math.min(value,255) 5526break 5527case"Percentage":value=Math.min(value,100)/100 5528if(!rgb)return value 5529value*=255 5530break 5531case"Angle":return(value%360+360)%360/360 5532case"Alpha":return Math.min(value,1)}return Math.round(value)}))}function compressFunction(node,item){let functionName=node.name 5533let args 5534if(functionName==="rgba"||functionName==="hsla"){args=parseFunctionArgs(node.children,4,functionName==="rgba") 5535if(!args)return 5536if(functionName==="hsla"){args=hslToRgb(...args) 5537node.name="rgba"}if(args[3]===0){const scopeFunctionName=this.function&&this.function.name 5538if(args[0]===0&&args[1]===0&&args[2]===0||!/^(?:to|from|color-stop)$|gradient$/i.test(scopeFunctionName)){item.data={type:"Identifier",loc:node.loc,name:"transparent"} 5539return}}if(args[3]!==1){node.children.forEach(((node,item,list)=>{if(node.type==="Operator"){node.value!==","&&list.remove(item) 5540return}item.data={type:"Number",loc:node.loc,value:packNumber(args.shift())}})) 5541return}functionName="rgb"}if(functionName==="hsl"){args=args||parseFunctionArgs(node.children,3,false) 5542if(!args)return 5543args=hslToRgb(...args) 5544functionName="rgb"}if(functionName==="rgb"){args=args||parseFunctionArgs(node.children,3,true) 5545if(!args)return 5546item.data={type:"Hash",loc:node.loc,value:toHex(args[0])+toHex(args[1])+toHex(args[2])} 5547compressHex(item.data,item)}}function compressIdent(node,item){if(this.declaration===null)return 5548let color=node.name.toLowerCase() 5549if(NAME_TO_HEX.hasOwnProperty(color)&&lexer$1.matchDeclaration(this.declaration).isType(node,"color")){const hex=NAME_TO_HEX[color] 5550if(hex.length+1<=color.length)item.data={type:"Hash",loc:node.loc,value:hex} 5551else{color==="grey"&&(color="gray") 5552node.name=color}}}function compressHex(node,item){let color=node.value.toLowerCase() 5553color.length===6&&color[0]===color[1]&&color[2]===color[3]&&color[4]===color[5]&&(color=color[0]+color[2]+color[4]) 5554HEX_TO_NAME[color]?item.data={type:"Identifier",loc:node.loc,name:HEX_TO_NAME[color]}:node.value=color}const handlers={Atrule:Atrule,AttributeSelector:AttributeSelector,Value:compressValue,Dimension:compressDimension,Percentage:compressPercentage,Number:Number$1,Url:Url,Hash:compressHex,Identifier:compressIdent,Function:compressFunction} 5555function replace(ast){walk$1(ast,{leave(node,item,list){handlers.hasOwnProperty(node.type)&&handlers[node.type].call(this,node,item,list)}})}class Index{constructor(){this.map=new Map}resolve(str){let index=this.map.get(str) 5556if(index===void 0){index=this.map.size+1 5557this.map.set(str,index)}return index}}function createDeclarationIndexer(){const ids=new Index 5558return function markDeclaration(node){const id=generate$2(node) 5559node.id=ids.resolve(id) 5560node.length=id.length 5561node.fingerprint=null 5562return node}}function ensureSelectorList(node){if(node.type==="Raw")return parse$2(node.value,{context:"selectorList"}) 5563return node}function maxSpecificity(a,b){for(let i=0;i<3;i++)if(a[i]!==b[i])return a[i]>b[i]?a:b 5564return a}function maxSelectorListSpecificity(selectorList){return ensureSelectorList(selectorList).children.reduce(((result,node)=>maxSpecificity(specificity(node),result)),[0,0,0])}function specificity(simpleSelector){let A=0 5565let B=0 5566let C=0
vendor: 16,526 bytes, lines 5567-5780
5567simpleSelector.children.forEach((node=>{switch(node.type){case"IdSelector":A++ 5568break 5569case"ClassSelector":case"AttributeSelector":B++ 5570break 5571case"PseudoClassSelector":switch(node.name.toLowerCase()){case"not":case"has":case"is":case"matches":case"-webkit-any":case"-moz-any":{const[a,b,c]=maxSelectorListSpecificity(node.children.first) 5572A+=a 5573B+=b 5574C+=c 5575break}case"nth-child":case"nth-last-child":{const arg=node.children.first 5576if(arg.type==="Nth"&&arg.selector){const[a,b,c]=maxSelectorListSpecificity(arg.selector) 5577A+=a 5578B+=b+1 5579C+=c}else B++ 5580break}case"where":break 5581case"before":case"after":case"first-line":case"first-letter":C++ 5582break 5583default:B++}break 5584case"TypeSelector":node.name.endsWith("*")||C++ 5585break 5586case"PseudoElementSelector":C++ 5587break}})) 5588return[A,B,C]}const nonFreezePseudoElements=new Set(["first-letter","first-line","after","before"]) 5589const nonFreezePseudoClasses=new Set(["link","visited","hover","active","first-letter","first-line","after","before"]) 5590function processSelector(node,usageData){const pseudos=new Set 5591node.prelude.children.forEach((function(simpleSelector){let tagName="*" 5592let scope=0 5593simpleSelector.children.forEach((function(node){switch(node.type){case"ClassSelector":if(usageData&&usageData.scopes){const classScope=usageData.scopes[node.name]||0 5594if(scope!==0&&classScope!==scope)throw new Error("Selector can't has classes from different scopes: "+generate$2(simpleSelector)) 5595scope=classScope}break 5596case"PseudoClassSelector":{const name=node.name.toLowerCase() 5597nonFreezePseudoClasses.has(name)||pseudos.add(`:${name}`) 5598break}case"PseudoElementSelector":{const name=node.name.toLowerCase() 5599nonFreezePseudoElements.has(name)||pseudos.add(`::${name}`) 5600break}case"TypeSelector":tagName=node.name.toLowerCase() 5601break 5602case"AttributeSelector":node.flags&&pseudos.add(`[${node.flags.toLowerCase()}]`) 5603break 5604case"Combinator":tagName="*" 5605break}})) 5606simpleSelector.compareMarker=specificity(simpleSelector).toString() 5607simpleSelector.id=null 5608simpleSelector.id=generate$2(simpleSelector) 5609scope&&(simpleSelector.compareMarker+=":"+scope) 5610tagName!=="*"&&(simpleSelector.compareMarker+=","+tagName)})) 5611node.pseudoSignature=pseudos.size>0&&[...pseudos].sort().join(",")}function prepare(ast,options){const markDeclaration=createDeclarationIndexer() 5612walk$1(ast,{visit:"Rule",enter(node){node.block.children.forEach(markDeclaration) 5613processSelector(node,options.usage)}}) 5614walk$1(ast,{visit:"Atrule",enter(node){if(node.prelude){node.prelude.id=null 5615node.prelude.id=generate$2(node.prelude)}if(keyword(node.name).basename==="keyframes"){node.block.avoidRulesMerge=true 5616node.block.children.forEach((function(rule){rule.prelude.children.forEach((function(simpleselector){simpleselector.compareMarker=simpleselector.id}))}))}}}) 5617return{declaration:markDeclaration}}const{hasOwnProperty:hasOwnProperty$2}=Object.prototype 5618function addRuleToMap(map,item,list,single){const node=item.data 5619const name=keyword(node.name).basename 5620const id=node.name.toLowerCase()+"/"+(node.prelude?node.prelude.id:null) 5621hasOwnProperty$2.call(map,name)||(map[name]=Object.create(null)) 5622single&&delete map[name][id] 5623hasOwnProperty$2.call(map[name],id)||(map[name][id]=new List) 5624map[name][id].append(list.remove(item))}function relocateAtrules(ast,options){const collected=Object.create(null) 5625let topInjectPoint=null 5626ast.children.forEach((function(node,item,list){if(node.type==="Atrule"){const name=keyword(node.name).basename 5627switch(name){case"keyframes":addRuleToMap(collected,item,list,true) 5628return 5629case"media":if(options.forceMediaMerge){addRuleToMap(collected,item,list,false) 5630return}break}topInjectPoint===null&&name!=="charset"&&name!=="import"&&(topInjectPoint=item)}else topInjectPoint===null&&(topInjectPoint=item)})) 5631for(const atrule in collected)for(const id in collected[atrule])ast.children.insertList(collected[atrule][id],atrule==="media"?null:topInjectPoint)}function isMediaRule(node){return node.type==="Atrule"&&node.name==="media"}function processAtrule(node,item,list){if(!isMediaRule(node))return 5632const prev=item.prev&&item.prev.data 5633if(!prev||!isMediaRule(prev))return 5634if(node.prelude&&prev.prelude&&node.prelude.id===prev.prelude.id){prev.block.children.appendList(node.block.children) 5635list.remove(item)}}function rejoinAtrule(ast,options){relocateAtrules(ast,options) 5636walk$1(ast,{visit:"Atrule",reverse:true,enter:processAtrule})}const{hasOwnProperty:hasOwnProperty$1}=Object.prototype 5637function isEqualSelectors(a,b){let cursor1=a.head 5638let cursor2=b.head 5639while(cursor1!==null&&cursor2!==null&&cursor1.data.id===cursor2.data.id){cursor1=cursor1.next 5640cursor2=cursor2.next}return cursor1===null&&cursor2===null}function isEqualDeclarations(a,b){let cursor1=a.head 5641let cursor2=b.head 5642while(cursor1!==null&&cursor2!==null&&cursor1.data.id===cursor2.data.id){cursor1=cursor1.next 5643cursor2=cursor2.next}return cursor1===null&&cursor2===null}function compareDeclarations(declarations1,declarations2){const result={eq:[],ne1:[],ne2:[],ne2overrided:[]} 5644const fingerprints=Object.create(null) 5645const declarations2hash=Object.create(null) 5646for(let cursor=declarations2.head;cursor;cursor=cursor.next)declarations2hash[cursor.data.id]=true 5647for(let cursor=declarations1.head;cursor;cursor=cursor.next){const data=cursor.data 5648data.fingerprint&&(fingerprints[data.fingerprint]=data.important) 5649if(declarations2hash[data.id]){declarations2hash[data.id]=false 5650result.eq.push(data)}else result.ne1.push(data)}for(let cursor=declarations2.head;cursor;cursor=cursor.next){const data=cursor.data 5651if(declarations2hash[data.id]){(!hasOwnProperty$1.call(fingerprints,data.fingerprint)||!fingerprints[data.fingerprint]&&data.important)&&result.ne2.push(data) 5652result.ne2overrided.push(data)}}return result}function addSelectors(dest,source){source.forEach((sourceData=>{const newStr=sourceData.id 5653let cursor=dest.head 5654while(cursor){const nextStr=cursor.data.id 5655if(nextStr===newStr)return 5656if(nextStr>newStr)break 5657cursor=cursor.next}dest.insert(dest.createItem(sourceData),cursor)})) 5658return dest}function hasSimilarSelectors(selectors1,selectors2){let cursor1=selectors1.head 5659while(cursor1!==null){let cursor2=selectors2.head 5660while(cursor2!==null){if(cursor1.data.compareMarker===cursor2.data.compareMarker)return true 5661cursor2=cursor2.next}cursor1=cursor1.next}return false}function unsafeToSkipNode(node){switch(node.type){case"Rule":return hasSimilarSelectors(node.prelude.children,this) 5662case"Atrule":if(node.block)return node.block.children.some(unsafeToSkipNode,this) 5663break 5664case"Declaration":return false}return true}function processRule$5(node,item,list){const selectors=node.prelude.children 5665const declarations=node.block.children 5666list.prevUntil(item.prev,(function(prev){if(prev.type!=="Rule")return unsafeToSkipNode.call(selectors,prev) 5667const prevSelectors=prev.prelude.children 5668const prevDeclarations=prev.block.children 5669if(node.pseudoSignature===prev.pseudoSignature){if(isEqualSelectors(prevSelectors,selectors)){prevDeclarations.appendList(declarations) 5670list.remove(item) 5671return true}if(isEqualDeclarations(declarations,prevDeclarations)){addSelectors(prevSelectors,selectors) 5672list.remove(item) 5673return true}}return hasSimilarSelectors(selectors,prevSelectors)}))}function initialMergeRule(ast){walk$1(ast,{visit:"Rule",enter:processRule$5})}function processRule$4(node,item,list){const selectors=node.prelude.children 5674while(selectors.head!==selectors.tail){const newSelectors=new List 5675newSelectors.insert(selectors.remove(selectors.head)) 5676list.insert(list.createItem({type:"Rule",loc:node.loc,prelude:{type:"SelectorList",loc:node.prelude.loc,children:newSelectors},block:{type:"Block",loc:node.block.loc,children:node.block.children.copy()},pseudoSignature:node.pseudoSignature}),item)}}function disjoinRule(ast){walk$1(ast,{visit:"Rule",reverse:true,enter:processRule$4})}const REPLACE=1 5677const REMOVE=2 5678const TOP=0 5679const RIGHT=1 5680const BOTTOM=2 5681const LEFT=3 5682const SIDES=["top","right","bottom","left"] 5683const SIDE={"margin-top":"top","margin-right":"right","margin-bottom":"bottom","margin-left":"left","padding-top":"top","padding-right":"right","padding-bottom":"bottom","padding-left":"left","border-top-color":"top","border-right-color":"right","border-bottom-color":"bottom","border-left-color":"left","border-top-width":"top","border-right-width":"right","border-bottom-width":"bottom","border-left-width":"left","border-top-style":"top","border-right-style":"right","border-bottom-style":"bottom","border-left-style":"left"} 5684const MAIN_PROPERTY={margin:"margin","margin-top":"margin","margin-right":"margin","margin-bottom":"margin","margin-left":"margin",padding:"padding","padding-top":"padding","padding-right":"padding","padding-bottom":"padding","padding-left":"padding","border-color":"border-color","border-top-color":"border-color","border-right-color":"border-color","border-bottom-color":"border-color","border-left-color":"border-color","border-width":"border-width","border-top-width":"border-width","border-right-width":"border-width","border-bottom-width":"border-width","border-left-width":"border-width","border-style":"border-style","border-top-style":"border-style","border-right-style":"border-style","border-bottom-style":"border-style","border-left-style":"border-style"} 5685class TRBL{constructor(name){this.name=name 5686this.loc=null 5687this.iehack=void 0 5688this.sides={top:null,right:null,bottom:null,left:null}}getValueSequence(declaration,count){const values=[] 5689let iehack="" 5690const hasBadValues=declaration.value.type!=="Value"||declaration.value.children.some((function(child){let special=false 5691switch(child.type){case"Identifier":switch(child.name){case"\\0":case"\\9":iehack=child.name 5692return 5693case"inherit":case"initial":case"unset":case"revert":special=child.name 5694break}break 5695case"Dimension":switch(child.unit){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":special=child.unit 5696break}break 5697case"Hash":case"Number":case"Percentage":break 5698case"Function":if(child.name==="var")return true 5699special=child.name 5700break 5701default:return true}values.push({node:child,special:special,important:declaration.important})})) 5702if(hasBadValues||values.length>count)return false 5703if(typeof this.iehack==="string"&&this.iehack!==iehack)return false 5704this.iehack=iehack 5705return values}canOverride(side,value){const currentValue=this.sides[side] 5706return!currentValue||value.important&&!currentValue.important}add(name,declaration){function attemptToAdd(){const sides=this.sides 5707const side=SIDE[name] 5708if(side){if(side in sides===false)return false 5709const values=this.getValueSequence(declaration,1) 5710if(!values||!values.length)return false 5711for(const key in sides)if(sides[key]!==null&&sides[key].special!==values[0].special)return false 5712if(!this.canOverride(side,values[0]))return true 5713sides[side]=values[0] 5714return true}if(name===this.name){const values=this.getValueSequence(declaration,4) 5715if(!values||!values.length)return false 5716switch(values.length){case 1:values[RIGHT]=values[TOP] 5717values[BOTTOM]=values[TOP] 5718values[LEFT]=values[TOP] 5719break 5720case 2:values[BOTTOM]=values[TOP] 5721values[LEFT]=values[RIGHT] 5722break 5723case 3:values[LEFT]=values[RIGHT] 5724break}for(let i=0;i<4;i++)for(const key in sides)if(sides[key]!==null&&sides[key].special!==values[i].special)return false 5725for(let i=0;i<4;i++)this.canOverride(SIDES[i],values[i])&&(sides[SIDES[i]]=values[i]) 5726return true}}if(!attemptToAdd.call(this))return false 5727this.loc||(this.loc=declaration.loc) 5728return true}isOkToMinimize(){const top=this.sides.top 5729const right=this.sides.right 5730const bottom=this.sides.bottom 5731const left=this.sides.left 5732if(top&&right&&bottom&&left){const important=top.important+right.important+bottom.important+left.important 5733return important===0||important===4}return false}getValue(){const result=new List 5734const sides=this.sides 5735const values=[sides.top,sides.right,sides.bottom,sides.left] 5736const stringValues=[generate$2(sides.top.node),generate$2(sides.right.node),generate$2(sides.bottom.node),generate$2(sides.left.node)] 5737if(stringValues[LEFT]===stringValues[RIGHT]){values.pop() 5738if(stringValues[BOTTOM]===stringValues[TOP]){values.pop() 5739stringValues[RIGHT]===stringValues[TOP]&&values.pop()}}for(let i=0;i<values.length;i++)result.appendData(values[i].node) 5740this.iehack&&result.appendData({type:"Identifier",loc:null,name:this.iehack}) 5741return{type:"Value",loc:null,children:result}}getDeclaration(){return{type:"Declaration",loc:this.loc,important:this.sides.top.important,property:this.name,value:this.getValue()}}}function processRule$3(rule,shorts,shortDeclarations,lastShortSelector){const declarations=rule.block.children 5742const selector=rule.prelude.children.first.id 5743rule.block.children.forEachRight((function(declaration,item){const property=declaration.property 5744if(!MAIN_PROPERTY.hasOwnProperty(property))return 5745const key=MAIN_PROPERTY[property] 5746let shorthand 5747let operation 5748if((!lastShortSelector||selector===lastShortSelector)&&key in shorts){operation=REMOVE 5749shorthand=shorts[key]}if(!shorthand||!shorthand.add(property,declaration)){operation=REPLACE 5750shorthand=new TRBL(key) 5751if(!shorthand.add(property,declaration)){lastShortSelector=null 5752return}}shorts[key]=shorthand 5753shortDeclarations.push({operation:operation,block:declarations,item:item,shorthand:shorthand}) 5754lastShortSelector=selector})) 5755return lastShortSelector}function processShorthands(shortDeclarations,markDeclaration){shortDeclarations.forEach((function(item){const shorthand=item.shorthand 5756if(!shorthand.isOkToMinimize())return 5757item.operation===REPLACE?item.item.data=markDeclaration(shorthand.getDeclaration()):item.block.remove(item.item)}))}function restructBlock$1(ast,indexer){const stylesheetMap={} 5758const shortDeclarations=[] 5759walk$1(ast,{visit:"Rule",reverse:true,enter(node){const stylesheet=this.block||this.stylesheet 5760const ruleId=(node.pseudoSignature||"")+"|"+node.prelude.children.first.id 5761let ruleMap 5762let shorts 5763if(stylesheetMap.hasOwnProperty(stylesheet.id))ruleMap=stylesheetMap[stylesheet.id] 5764else{ruleMap={lastShortSelector:null} 5765stylesheetMap[stylesheet.id]=ruleMap}if(ruleMap.hasOwnProperty(ruleId))shorts=ruleMap[ruleId] 5766else{shorts={} 5767ruleMap[ruleId]=shorts}ruleMap.lastShortSelector=processRule$3.call(this,node,shorts,shortDeclarations,ruleMap.lastShortSelector)}}) 5768processShorthands(shortDeclarations,indexer.declaration)}let fingerprintId=1 5769const dontRestructure=new Set(["src"]) 5770const DONT_MIX_VALUE={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i} 5771const SAFE_VALUES={cursor:["auto","crosshair","default","move","text","wait","help","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","pointer","progress","not-allowed","no-drop","vertical-text","all-scroll","col-resize","row-resize"],overflow:["hidden","visible","scroll","auto"],position:["static","relative","absolute","fixed"]} 5772const NEEDLESS_TABLE={"border-width":["border"],"border-style":["border"],"border-color":["border"],"border-top":["border"],"border-right":["border"],"border-bottom":["border"],"border-left":["border"],"border-top-width":["border-top","border-width","border"],"border-right-width":["border-right","border-width","border"],"border-bottom-width":["border-bottom","border-width","border"],"border-left-width":["border-left","border-width","border"],"border-top-style":["border-top","border-style","border"],"border-right-style":["border-right","border-style","border"],"border-bottom-style":["border-bottom","border-style","border"],"border-left-style":["border-left","border-style","border"],"border-top-color":["border-top","border-color","border"],"border-right-color":["border-right","border-color","border"],"border-bottom-color":["border-bottom","border-color","border"],"border-left-color":["border-left","border-color","border"],"margin-top":["margin"],"margin-right":["margin"],"margin-bottom":["margin"],"margin-left":["margin"],"padding-top":["padding"],"padding-right":["padding"],"padding-bottom":["padding"],"padding-left":["padding"],"font-style":["font"],"font-variant":["font"],"font-weight":["font"],"font-size":["font"],"font-family":["font"],"list-style-type":["list-style"],"list-style-position":["list-style"],"list-style-image":["list-style"]} 5773function getPropertyFingerprint(propertyName,declaration,fingerprints){const realName=property(propertyName).basename 5774if(realName==="background")return propertyName+":"+generate$2(declaration.value) 5775const declarationId=declaration.id 5776let fingerprint=fingerprints[declarationId] 5777if(!fingerprint){switch(declaration.value.type){case"Value":const special={} 5778let vendorId="" 5779let iehack="" 5780let raw=false
5781declaration.value.children.forEach((function walk(node){switch(node.type){case"Value":case"Brackets":case"Parentheses":node.children.forEach(walk) 5782break 5783case"Raw":raw=true 5784break 5785case"Identifier":{const{name:name}=node 5786vendorId||(vendorId=keyword(name).vendor);/\\[09]/.test(name)&&(iehack=RegExp.lastMatch) 5787SAFE_VALUES.hasOwnProperty(realName)?SAFE_VALUES[realName].indexOf(name)===-1&&(special[name]=true):DONT_MIX_VALUE.hasOwnProperty(realName)&&DONT_MIX_VALUE[realName].test(name)&&(special[name]=true) 5788break}case"Function":{let{name:name}=node 5789vendorId||(vendorId=keyword(name).vendor) 5790if(name==="rect"){const hasComma=node.children.some((node=>node.type==="Operator"&&node.value===",")) 5791hasComma||(name="rect-backward")}special[name+"()"]=true 5792node.children.forEach(walk) 5793break}case"Dimension":{const{unit:unit}=node;/\\[09]/.test(unit)&&(iehack=RegExp.lastMatch) 5794switch(unit){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":special[unit]=true 5795break}break}}})) 5796fingerprint=raw?"!"+fingerprintId++:"!"+Object.keys(special).sort()+"|"+iehack+vendorId 5797break 5798case"Raw":fingerprint="!"+declaration.value.value 5799break 5800default:fingerprint=generate$2(declaration.value)}fingerprints[declarationId]=fingerprint}return propertyName+fingerprint}function needless(props,declaration,fingerprints){const property$1=property(declaration.property) 5801if(NEEDLESS_TABLE.hasOwnProperty(property$1.basename)){const table=NEEDLESS_TABLE[property$1.basename] 5802for(const entry of table){const ppre=getPropertyFingerprint(property$1.prefix+entry,declaration,fingerprints) 5803const prev=props.hasOwnProperty(ppre)?props[ppre]:null 5804if(prev&&(!declaration.important||prev.item.data.important))return prev}}}function processRule$2(rule,item,list,props,fingerprints){const declarations=rule.block.children 5805declarations.forEachRight((function(declaration,declarationItem){const{property:property}=declaration 5806const fingerprint=getPropertyFingerprint(property,declaration,fingerprints) 5807const prev=props[fingerprint] 5808if(prev&&!dontRestructure.has(property))if(declaration.important&&!prev.item.data.important){props[fingerprint]={block:declarations,item:declarationItem} 5809prev.block.remove(prev.item)}else declarations.remove(declarationItem) 5810else{const prev=needless(props,declaration,fingerprints) 5811if(prev)declarations.remove(declarationItem) 5812else{declaration.fingerprint=fingerprint 5813props[fingerprint]={block:declarations,item:declarationItem}}}})) 5814declarations.isEmpty&&list.remove(item)}function restructBlock(ast){const stylesheetMap={} 5815const fingerprints=Object.create(null) 5816walk$1(ast,{visit:"Rule",reverse:true,enter(node,item,list){const stylesheet=this.block||this.stylesheet 5817const ruleId=(node.pseudoSignature||"")+"|"+node.prelude.children.first.id 5818let ruleMap 5819let props 5820if(stylesheetMap.hasOwnProperty(stylesheet.id))ruleMap=stylesheetMap[stylesheet.id] 5821else{ruleMap={} 5822stylesheetMap[stylesheet.id]=ruleMap}if(ruleMap.hasOwnProperty(ruleId))props=ruleMap[ruleId] 5823else{props={} 5824ruleMap[ruleId]=props}processRule$2.call(this,node,item,list,props,fingerprints)}})}function processRule$1(node,item,list){const selectors=node.prelude.children 5825const declarations=node.block.children 5826const nodeCompareMarker=selectors.first.compareMarker 5827const skippedCompareMarkers={} 5828list.nextUntil(item.next,(function(next,nextItem){if(next.type!=="Rule")return unsafeToSkipNode.call(selectors,next) 5829if(node.pseudoSignature!==next.pseudoSignature)return true 5830const nextFirstSelector=next.prelude.children.head 5831const nextDeclarations=next.block.children 5832const nextCompareMarker=nextFirstSelector.data.compareMarker 5833if(nextCompareMarker in skippedCompareMarkers)return true 5834if(selectors.head===selectors.tail&&selectors.first.id===nextFirstSelector.data.id){declarations.appendList(nextDeclarations) 5835list.remove(nextItem) 5836return}if(isEqualDeclarations(declarations,nextDeclarations)){const nextStr=nextFirstSelector.data.id 5837selectors.some(((data,item)=>{const curStr=data.id 5838if(nextStr<curStr){selectors.insert(nextFirstSelector,item) 5839return true}if(!item.next){selectors.insert(nextFirstSelector) 5840return true}})) 5841list.remove(nextItem) 5842return}if(nextCompareMarker===nodeCompareMarker)return true 5843skippedCompareMarkers[nextCompareMarker]=true}))}function mergeRule(ast){walk$1(ast,{visit:"Rule",enter:processRule$1})}function calcSelectorLength(list){return list.reduce(((res,data)=>res+data.id.length+1),0)-1}function calcDeclarationsLength(tokens){let length=0 5844for(const token of tokens)length+=token.length 5845return length+tokens.length-1}function processRule(node,item,list){const avoidRulesMerge=this.block!==null&&this.block.avoidRulesMerge 5846const selectors=node.prelude.children 5847const block=node.block 5848const disallowDownMarkers=Object.create(null) 5849let allowMergeUp=true 5850let allowMergeDown=true 5851list.prevUntil(item.prev,(function(prev,prevItem){const prevBlock=prev.block 5852const prevType=prev.type 5853if(prevType!=="Rule"){const unsafe=unsafeToSkipNode.call(selectors,prev) 5854!unsafe&&prevType==="Atrule"&&prevBlock&&walk$1(prevBlock,{visit:"Rule",enter(node){node.prelude.children.forEac
5854h((data=>{disallowDownMarkers[data.compareMarker]=true}))}}) 5855return unsafe}if(node.pseudoSignature!==prev.pseudoSignature)return true 5856const prevSelectors=prev.prelude.children 5857allowMergeDown=!prevSelectors.some((selector=>selector.compareMarker in disallowDownMarkers)) 5858if(!allowMergeDown&&!allowMergeUp)return true 5859if(allowMergeUp&&isEqualSelectors(prevSelectors,selectors)){prevBlock.children.appendList(block.children) 5860list.remove(item) 5861return true}const diff=compareDeclarations(block.children,prevBlock.children) 5862if(diff.eq.length){if(!diff.ne1.length&&!diff.ne2.length){if(allowMergeDown){addSelectors(selectors,prevSelectors) 5863list.remove(prevItem)}return true}if(!avoidRulesMerge)if(diff.ne1.length&&!diff.ne2.length){const selectorLength=calcSelectorLength(selectors) 5864const blockLength=calcDeclarationsLength(diff.eq) 5865if(allowMergeUp&&selectorLength<blockLength){addSelectors(prevSelectors,selectors) 5866block.children.fromArray(diff.ne1)}}else if(!diff.ne1.length&&diff.ne2.length){const selectorLength=calcSelectorLength(prevSelectors) 5867const blockLength=calcDeclarationsLength(diff.eq) 5868if(allowMergeDown&&selectorLength<blockLength){addSelectors(selectors,prevSelectors) 5869prevBlock.children.fromArray(diff.ne2)}}else{const newSelector={type:"SelectorList",loc:null,children:addSelectors(prevSelectors.copy(),selectors)} 5870const newBlockLength=calcSelectorLength(newSelector.children)+2 5871const blockLength=calcDeclarationsLength(diff.eq) 5872if(blockLength>=newBlockLength){const newItem=list.createItem({type:"Rule",loc:null,prelude:newSelector,block:{type:"Block",loc:null,children:(new List).fromArray(diff.eq)},pseudoSignature:node.pseudoSignature}) 5873block.children.fromArray(diff.ne1) 5874prevBlock.children.fromArray(diff.ne2overrided) 5875allowMergeUp?list.insert(newItem,prevItem):list.insert(newItem,item) 5876return true}}}allowMergeUp&&(allowMergeUp=!prevSelectors.some((prevSelector=>selectors.some((selector=>selector.compareMarker===prevSelector.compareMarker))))) 5877prevSelectors.forEach((data=>{disallowDownMarkers[data.compareMarker]=true}))}))}function restructRule(ast){walk$1(ast,{visit:"Rule",reverse:true,enter:processRule})}function restructure(ast,options){const indexer=prepare(ast,options) 5878options.logger("prepare",ast) 5879rejoinAtrule(ast,options) 5880options.logger("mergeAtrule",ast) 5881initialMergeRule(ast) 5882options.logger("initialMergeRuleset",ast) 5883disjoinRule(ast) 5884options.logger("disjoinRuleset",ast) 5885restructBlock$1(ast,indexer) 5886options.logger("restructShorthand",ast) 5887restructBlock(ast) 5888options.logger("restructBlock",ast) 5889mergeRule(ast) 5890options.logger("mergeRuleset",ast) 5891restructRule(ast) 5892options.logger("restructRuleset",ast)}function readChunk(input,specialComments){const children=new List 5893let nonSpaceTokenInBuffer=false 5894let protectedComment 5895input.nextUntil(input.head,((node,item,list)=>{if(node.type==="Comment"){if(!specialComments||node.value.charAt(0)!=="!"){list.remove(item) 5896return}if(nonSpaceTokenInBuffer||protectedComment)return true 5897list.remove(item) 5898protectedComment=node 5899return}node.type!=="WhiteSpace"&&(nonSpaceTokenInBuffer=true) 5900children.insert(list.remove(item))})) 5901return{comment:protectedComment,stylesheet:{type:"StyleSheet",loc:null,children:children}}}function compressChunk(ast,firstAtrulesAllowed,num,options){options.logger(`Compress block #${num}`,null,true) 5902let seed=1 5903if(ast.type==="StyleSheet"){ast.firstAtrulesAllowed=firstAtrulesAllowed 5904ast.id=seed++}walk$1(ast,{visit:"Atrule",enter(node){node.block!==null&&(node.block.id=seed++)}}) 5905options.logger("init",ast) 5906clean(ast,options) 5907options.logger("clean",ast) 5908replace(ast) 5909options.logger("replace",ast) 5910options.restructuring&&restructure(ast,options) 5911return ast}function getCommentsOption(options){let comments="comments"in options?options.comments:"exclamation" 5912typeof comments==="boolean"?comments=!!comments&&"exclamation":comments!=="exclamation"&&comments!=="first-exclamation"&&(comments=false) 5913return comments}function getRestructureOption(options){if("restructure"in options)return options.restructure 5914return!("restructuring"in options)||options.restructuring}function wrapBlock(block){return(new List).appendData({type:"Rule",loc:null,prelude:{type:"SelectorList",loc:null,children:(new List).appendData({type:"Selector",loc:null,children:(new List).appendData({type:"TypeSelector",loc:null,name:"x"})})},block:block})}function compress$1(ast,options){ast=ast||{type:"StyleSheet",loc:null,children:new List} 5915options=options||{} 5916const compressOptions={logger:typeof options.logger==="function"?options.logger:function(){}
vendor: 8,676 bytes, lines 5916-6019
5916,restructuring:getRestructureOption(options),forceMediaMerge:Boolean(options.forceMediaMerge),usage:!!options.usage&&buildIndex(options.usage)} 5917const output=new List 5918let specialComments=getCommentsOption(options) 5919let firstAtrulesAllowed=true 5920let input 5921let chunk 5922let chunkNum=1 5923let chunkChildren 5924options.clone&&(ast=clone(ast)) 5925if(ast.type==="StyleSheet"){input=ast.children 5926ast.children=output}else input=wrapBlock(ast) 5927do{chunk=readChunk(input,Boolean(specialComments)) 5928compressChunk(chunk.stylesheet,firstAtrulesAllowed,chunkNum++,compressOptions) 5929chunkChildren=chunk.stylesheet.children 5930if(chunk.comment){output.isEmpty||output.insert(List.createItem({type:"Raw",value:"\n"})) 5931output.insert(List.createItem(chunk.comment)) 5932chunkChildren.isEmpty||output.insert(List.createItem({type:"Raw",value:"\n"}))}if(firstAtrulesAllowed&&!chunkChildren.isEmpty){const lastRule=chunkChildren.last;(lastRule.type!=="Atrule"||lastRule.name!=="import"&&lastRule.name!=="charset")&&(firstAtrulesAllowed=false)}specialComments!=="exclamation"&&(specialComments=false) 5933output.appendList(chunkChildren)}while(!input.isEmpty) 5934return{ast:ast}}function encodeString(value){const stringApostrophe=encode$1(value,true) 5935const stringQuote=encode$1(value) 5936return stringApostrophe.length<stringQuote.length?stringApostrophe:stringQuote}const{lexer:lexer,tokenize:tokenize,parse:parse$1,generate:generate$1,walk:walk,find:find,findLast:findLast,findAll:findAll,fromPlainObject:fromPlainObject,toPlainObject:toPlainObject}=fork({node:{String:{generate(node){this.token(String$2,encodeString(node.value))}},Url:{generate(node){const encodedUrl=encode(node.value) 5937const string=encodeString(node.value) 5938this.token(Url$2,encodedUrl.length<=string.length+5?encodedUrl:"url("+string+")")}}}}) 5939var syntax=Object.freeze({__proto__:null,compress:compress$1,find:find,findAll:findAll,findLast:findLast,fromPlainObject:fromPlainObject,generate:generate$1,lexer:lexer,parse:parse$1,specificity:specificity,toPlainObject:toPlainObject,tokenize:tokenize,walk:walk}) 5940const{parse:parse,generate:generate,compress:compress}=syntax 5941function debugOutput(name,options,startTime,data){options.debug&&console.error(`## ${name} done in %d ms\n`,Date.now()-startTime) 5942return data}function createDefaultLogger(level){let lastDebug 5943return function logger(title,ast){let line=title 5944ast&&(line=`[${((Date.now()-lastDebug)/1000).toFixed(3)}s] ${line}`) 5945if(level>1&&ast){let css=generate(ast) 5946level===2&&css.length>256&&(css=css.substr(0,256)+"...") 5947line+=`\n ${css}\n`}console.error(line) 5948lastDebug=Date.now()}}function buildCompressOptions(options){options={...options} 5949typeof options.logger!=="function"&&options.debug&&(options.logger=createDefaultLogger(options.debug)) 5950return options}function runHandler(ast,options,handlers){Array.isArray(handlers)||(handlers=[handlers]) 5951handlers.forEach((fn=>fn(ast,options)))}function minify(context,source,options){options=options||{} 5952const filename=options.filename||"<unknown>" 5953let result 5954const ast=debugOutput("parsing",options,Date.now(),parse(source,{context:context,filename:filename,positions:Boolean(options.sourceMap)})) 5955options.beforeCompress&&debugOutput("beforeCompress",options,Date.now(),runHandler(ast,options,options.beforeCompress)) 5956const compressResult=debugOutput("compress",options,Date.now(),compress(ast,buildCompressOptions(options))) 5957options.afterCompress&&debugOutput("afterCompress",options,Date.now(),runHandler(compressResult,options,options.afterCompress)) 5958result=options.sourceMap?debugOutput("generate(sourceMap: true)",options,Date.now(),(()=>{const tmp=generate(compressResult.ast,{sourceMap:true}) 5959tmp.map._file=filename 5960tmp.map.setSourceContent(filename,source) 5961return tmp})()):debugOutput("generate",options,Date.now(),{css:generate(compressResult.ast),map:null}) 5962return result}function minifyStylesheet(source,options){return minify("stylesheet",source,options)}function minifyBlock(source,options){return minify("declarationList",source,options)}const csstreeWalkSkip=walk$3.skip 5963const parseRule=(ruleNode,dynamic)=>{const declarations=[] 5964ruleNode.block.children.forEach((cssNode=>{cssNode.type==="Declaration"&&declarations.push({name:cssNode.property,value:generate$I(cssNode.value),important:cssNode.important===true})})) 5965const rules=[] 5966walk$3(ruleNode.prelude,(node=>{if(node.type==="Selector"){const newNode=clone$1(node) 5967let hasPseudoClasses=false 5968walk$3(newNode,((pseudoClassNode,item,list)=>{if(pseudoClassNode.type==="PseudoClassSelector"){hasPseudoClasses=true 5969list.remove(item)}})) 5970rules.push({specificity:specificity(node),dynamic:hasPseudoClasses||dynamic,selector:generate$I(newNode),declarations:declarations})}})) 5971return rules} 5972const parseStylesheet=(css,dynamic)=>{const rules=[] 5973const ast=parse$I(css,{parseValue:false,parseAtrulePrelude:false}) 5974walk$3(ast,(cssNode=>{if(cssNode.type==="Rule"){rules.push(...parseRule(cssNode,dynamic||false)) 5975return csstreeWalkSkip}if(cssNode.type==="Atrule"){if(["keyframes","-webkit-keyframes","-o-keyframes","-moz-keyframes"].includes(cssNode.name))return csstreeWalkSkip 5976walk$3(cssNode,(ruleNode=>{if(ruleNode.type==="Rule"){rules.push(...parseRule(ruleNode,dynamic||true)) 5977return csstreeWalkSkip}})) 5978return csstreeWalkSkip}})) 5979return rules} 5980const parseStyleDeclarations=css=>{const declarations=[] 5981const ast=parse$I(css,{context:"declarationList",parseValue:false}) 5982walk$3(ast,(cssNode=>{cssNode.type==="Declaration"&&declarations.push({name:cssNode.property,value:generate$I(cssNode.value),important:cssNode.important===true})})) 5983return declarations} 5984const computeOwnStyle=(stylesheet,node,parents)=>{const computedStyle={} 5985const importantStyles=new Map 5986for(const[name,value]of Object.entries(node.attributes))if(attrsGroups.presentation.has(name)){computedStyle[name]={type:"static",inherited:false,value:value} 5987importantStyles.set(name,false)}for(const{selector:selector,declarations:declarations,dynamic:dynamic}of stylesheet.rules)if(matches(node,selector,parents))for(const{name:name,value:value,important:important}of declarations){const computed=computedStyle[name] 5988if(computed&&computed.type==="dynamic")continue 5989if(dynamic){computedStyle[name]={type:"dynamic",inherited:false} 5990continue}if(computed==null||important===true||importantStyles.get(name)===false){computedStyle[name]={type:"static",inherited:false,value:value} 5991importantStyles.set(name,important)}}const styleDeclarations=node.attributes.style==null?[]:parseStyleDeclarations(node.attributes.style) 5992for(const{name:name,value:value,important:important}of styleDeclarations){const computed=computedStyle[name] 5993if(computed&&computed.type==="dynamic")continue 5994if(computed==null||important===true||importantStyles.get(name)===false){computedStyle[name]={type:"static",inherited:false,value:value} 5995importantStyles.set(name,important)}}return computedStyle} 5996const compareSpecificity=(a,b)=>{for(let i=0;i<4;i+=1){if(a[i]<b[i])return-1 5997if(a[i]>b[i])return 1}return 0} 5998const collectStylesheet=root=>{const rules=[] 5999const parents=new Map 6000visit(root,{element:{enter:(node,parentNode)=>{parents.set(node,parentNode) 6001if(node.name!=="style")return 6002if(node.attributes.type==null||node.attributes.type===""||node.attributes.type==="text/css"){const dynamic=node.attributes.media!=null&&node.attributes.media!=="all" 6003for(const child of node.children)child.type!=="text"&&child.type!=="cdata"||rules.push(...parseStylesheet(child.value,dynamic))}}}}) 6004rules.sort(((a,b)=>compareSpecificity(a.specificity,b.specificity))) 6005return{rules:rules,parents:parents}} 6006const computeStyle=(stylesheet,node)=>{const{parents:parents}=stylesheet 6007const computedStyles=computeOwnStyle(stylesheet,node,parents) 6008let parent=parents.get(node) 6009while(parent!=null&&parent.type!=="root"){const inheritedStyles=computeOwnStyle(stylesheet,parent,parents) 6010for(const[name,computed]of Object.entries(inheritedStyles))computedStyles[name]==null&&inheritableAttrs.has(name)&&!presentationNonInheritableGroupAttrs.has(name)&&(computedStyles[name]={...computed,inherited:true}) 6011parent=parents.get(parent)}return computedStyles} 6012const includesAttrSelector=(selector,name,value=null,traversed=false)=>{const selectors=parse$1w(typeof selector==="string"?selector:generate$I(selector.data)) 6013for(const subselector of selectors){const hasAttrSelector=subselector.some(((segment,index)=>{if(traversed){if(index===subselector.length-1)return false 6014const isNextTraversal=isTraversal$1(subselector[index+1]) 6015if(!isNextTraversal)return false}if(segment.type!=="attribute"||segment.name!==name)return false 6016return value==null||segment.value===value})) 6017if(hasAttrSelector)return true}return false} 6018const name$N="removeDeprecatedAttrs" 6019const description$N="removes deprecated attributes"
6020function extractAttributesInStylesheet(stylesheet){const attributesInStylesheet=new Set 6021stylesheet.rules.forEach((rule=>{const selectors=parse$1w(rule.selector) 6022selectors.forEach((subselector=>{subselector.forEach((segment=>{if(segment.type!=="attribute")return 6023attributesInStylesheet.add(segment.name)}))}))})) 6024return attributesInStylesheet}function processAttributes(node,deprecatedAttrs,params,attributesInStylesheet){if(!deprecatedAttrs)return 6025deprecatedAttrs.safe&&deprecatedAttrs.safe.forEach((name=>{if(attributesInStylesheet.has(name))return 6026delete node.attributes[name]})) 6027params.removeUnsafe&&deprecatedAttrs.unsafe&&deprecatedAttrs.unsafe.forEach((name=>{if(attributesInStylesheet.has(name))return 6028delete node.attributes[name]}))}function fn$N(root,params){const stylesheet=collectStylesheet(root) 6029const attributesInStylesheet=extractAttributesInStylesheet(stylesheet) 6030return{element:{enter:node=>{const elemConfig=elems[node.name] 6031if(!elemConfig)return 6032elemConfig.attrsGroups.has("core")&&node.attributes["xml:lang"]&&!attributesInStylesheet.has("xml:lang")&&node.attributes["lang"]&&delete node.attributes["xml:lang"] 6033elemConfig.attrsGroups.forEach((attrsGroup=>{processAttributes(node,attrsGroupsDeprecated[attrsGroup],params,attributesInStylesheet)})) 6034processAttributes(node,elemConfig.deprecated,params,attributesInStylesheet)}}}}var removeDeprecatedAttrs=Object.freeze({__proto__:null,description:description$N,fn:fn$N,name:name$N}) 6035const name$M="removeMetadata" 6036const description$M="removes <metadata>" 6037const fn$M=()=>({element:{enter:(node,parentNode)=>{node.name==="metadata"&&detachNodeFromParent(node,parentNode)}}}) 6038var removeMetadata=Object.freeze({__proto__:null,description:description$M,fn:fn$M,name:name$M}) 6039const name$L="removeEditorsNSData" 6040const description$L="removes editors namespaces, elements and attributes" 6041const fn$L=(_root,params)=>{let namespaces=[...editorNamespaces] 6042Array.isArray(params.additionalNamespaces)&&(namespaces=[...editorNamespaces,...params.additionalNamespaces]) 6043const prefixes=[] 6044return{element:{enter:(node,parentNode)=>{if(node.name==="svg")for(const[name,value]of Object.entries(node.attributes))if(name.startsWith("xmlns:")&&namespaces.includes(value)){prefixes.push(name.slice(6)) 6045delete node.attributes[name]}for(const name of Object.keys(node.attributes))if(name.includes(":")){const[prefix]=name.split(":") 6046prefixes.includes(prefix)&&delete node.attributes[name]}if(node.name.includes(":")){const[prefix]=node.name.split(":") 6047prefixes.includes(prefix)&&detachNodeFromParent(node,parentNode)}}}}} 6048var removeEditorsNSData=Object.freeze({__proto__:null,description:description$L,fn:fn$L,name:name$L}) 6049const name$K="cleanupAttrs" 6050const description$K="cleanups attributes from newlines, trailing and repeating spaces" 6051const regNewlinesNeedSpace=/(\S)\r?\n(\S)/g 6052const regNewlines=/\r?\n/g 6053const regSpaces=/\s{2,}/g 6054const fn$K=(root,params)=>{const{newlines:newlines=true,trim:trim=true,spaces:spaces=true}=params 6055return{element:{enter:node=>{for(const name of Object.keys(node.attributes)){if(newlines){node.attributes[name]=node.attributes[name].replace(regNewlinesNeedSpace,((match,p1,p2)=>p1+" "+p2)) 6056node.attributes[name]=node.attributes[name].replace(regNewlines,"")}trim&&(node.attributes[name]=node.attributes[name].trim()) 6057spaces&&(node.attributes[name]=node.attributes[name].replace(regSpaces," "))}}}}} 6058var cleanupAttrs=Object.freeze({__proto__:null,description:description$K,fn:fn$K,name:name$K}) 6059const name$J="mergeStyles" 6060const description$J="merge multiple style elements into one" 6061const fn$J=()=>{let firstStyleElement=null 6062let collectedStyles="" 6063let styleContentType="text" 6064return{element:{enter:(node,parentNode)=>{if(node.name==="foreignObject")return visitSkip 6065if(node.name!=="style")return 6066if(node.attributes.type!=null&&node.attributes.type!==""&&node.attributes.type!=="text/css")return 6067let css="" 6068for(const child of node.children){child.type==="text"&&(css+=child.value) 6069if(child.type==="cdata"){styleContentType="cdata" 6070css+=child.value}}if(css.trim().length===0){detachNodeFromParent(node,parentNode) 6071return}if(node.attributes.media==null)collectedStyles+=css 6072else{collectedStyles+=`@media ${node.attributes.media}{${css}}` 6073delete node.attributes.media}if(firstStyleElement==null)firstStyleElement=node 6074else{detachNodeFromParent(node,parentNode) 6075const child={type:styleContentType,value:collectedStyles} 6076firstStyleElement.children=[child]}}}}} 6077var mergeStyles=Object.freeze({__proto__:null,description:description$J,fn:fn$J,name:name$J}) 6078const name$I="inlineStyles" 6079const description$I="inline styles (additional options)" 6080const preservedPseudos=[...pseudoClasses.functional,...pseudoClasses.treeStructural] 6081const fn$I=(root,params)=>{const{onlyMatchedOnce:onlyMatchedOnce=true,removeMatchedSelectors:removeMatchedSelectors=true,useMqs:useMqs=["","screen"],usePseudos:usePseudos=[""]}=params 6082const styles=[] 6083const selectors=[] 6084return{element:{enter:(node,parentNode)=>{if(node.name==="foreignObject")return visitSkip 6085if(node.name!=="style"||node.children.length===0)return 6086if(node.attributes.type!=null&&node.attributes.type!==""&&node.attributes.type!=="text/css")return 6087const cssText=node.children.filter((child=>child.type==="text"||child.type==="cdata")).map((child=>child.value)).join("") 6088let cssAst=null 6089try{cssAst=parse$I(cssText,{parseValue:false,parseCustomProperty:false})}catch{return}cssAst.type==="StyleSheet"&&styles.push({node:node,parentNode:parentNode,cssAst:cssAst}) 6090walk$3(cssAst,{visit:"Rule",enter(node){const atrule=this.atrule 6091let mediaQuery="" 6092if(atrule!=null){mediaQuery=atrule.name 6093atrule.prelude!=null&&(mediaQuery+=` ${generate$I(atrule.prelude)}`)}if(!useMqs.includes(mediaQuery))return 6094node.prelude.type==="SelectorList"&&node.prelude.children.forEac
6094h(((childNode,item)=>{if(childNode.type==="Selector"){const pseudos=[] 6095childNode.children.forEach(((grandchildNode,grandchildItem,grandchildList)=>{const isPseudo=grandchildNode.type==="PseudoClassSelector"||grandchildNode.type==="PseudoElementSelector" 6096isPseudo&&!preservedPseudos.includes(grandchildNode.name)&&pseudos.push({item:grandchildItem,list:grandchildList})})) 6097const pseudoSelectors=generate$I({type:"Selector",children:(new List$1).fromArray(pseudos.map((pseudo=>pseudo.item.data)))}) 6098if(usePseudos.includes(pseudoSelectors))for(const pseudo of pseudos)pseudo.list.remove(pseudo.item) 6099selectors.push({node:childNode,rule:node,item:item})}}))}})}},root:{exit:()=>{if(styles.length===0)return 6100const sortedSelectors=selectors.slice().sort(((a,b)=>{const aSpecificity=specificity(a.item.data) 6101const bSpecificity=specificity(b.item.data) 6102return compareSpecificity(aSpecificity,bSpecificity)})).reverse() 6103for(const selector of sortedSelectors){const selectorText=generate$I(selector.item.data) 6104const matchedElements=[] 6105try{for(const node of querySelectorAll(root,selectorText))node.type==="element"&&matchedElements.push(node)}catch{continue}if(matchedElements.length===0)continue 6106if(onlyMatchedOnce&&matchedElements.length>1)continue 6107for(const selectedEl of matchedElements){const styleDeclarationList=parse$I(selectedEl.attributes.style??"",{context:"declarationList",parseValue:false}) 6108if(styleDeclarationList.type!=="DeclarationList")continue 6109const styleDeclarationItems=new Map 6110let firstListItem 6111walk$3(styleDeclarationList,{visit:"Declaration",enter(node,item){firstListItem==null&&(firstListItem=item) 6112styleDeclarationItems.set(node.property.toLowerCase(),item)}}) 6113walk$3(selector.rule,{visit:"Declaration",enter(ruleDeclaration){const property=ruleDeclaration.property 6114attrsGroups.presentation.has(property)&&!selectors.some((selector=>includesAttrSelector(selector.item,property)))&&delete selectedEl.attributes[property] 6115const matchedItem=styleDeclarationItems.get(property) 6116const ruleDeclarationItem=styleDeclarationList.children.createItem(ruleDeclaration) 6117if(matchedItem==null)styleDeclarationList.children.insert(ruleDeclarationItem,firstListItem) 6118else if(matchedItem.data.important!==true&&ruleDeclaration.important===true){styleDeclarationList.children.replace(matchedItem,ruleDeclarationItem) 6119styleDeclarationItems.set(property,ruleDeclarationItem)}}}) 6120const newStyles=generate$I(styleDeclarationList) 6121newStyles.length!==0&&(selectedEl.attributes.style=newStyles)}removeMatchedSelectors&&matchedElements.length!==0&&selector.rule.prelude.type==="SelectorList"&&selector.rule.prelude.children.remove(selector.item) 6122selector.matchedElements=matchedElements}if(!removeMatchedSelectors)return 6123for(const selector of sortedSelectors){if(selector.matchedElements==null)continue 6124if(onlyMatchedOnce&&selector.matchedElements.length>1)continue 6125for(const selectedEl of selector.matchedElements){const classList=new Set(selectedEl.attributes.class==null?null:selectedEl.attributes.class.split(" ")) 6126for(const child of selector.node.children)child.type!=="ClassSelector"||selectors.some((selector=>includesAttrSelector(selector.item,"class",child.name,true)))||classList.delete(child.name) 6127classList.size===0?delete selectedEl.attributes.class:selectedEl.attributes.class=Array.from(classList).join(" ") 6128const firstSubSelector=selector.node.children.first 6129firstSubSelector?.type!=="IdSelector"||selectedEl.attributes.id!==firstSubSelector.name||selectors.some((selector=>includesAttrSelector(selector.item,"id",firstSubSelector.name,true)))||delete selectedEl.attributes.id}}for(const style of styles){walk$3(style.cssAst,{visit:"Rule",enter:function(node,item,list){node.type==="Rule"&&node.prelude.type==="SelectorList"&&node.prelude.children.isEmpty&&list.remove(item)}}) 6130if(style.cssAst.children.isEmpty)detachNodeFromParent(style.node,style.parentNode) 6131else{const firstChild=style.node.children[0] 6132firstChild.type!=="text"&&firstChild.type!=="cdata"||(firstChild.value=generate$I(style.cssAst))}}}}}} 6133var inlineStyles=Object.freeze({__proto__:null,description:description$I,fn:fn$I,name:name$I}) 6134const regReferencesUrl=/\burl\((["'])?#(.+?)\1\)/g
6135const regReferencesHref=/^#(.+?)$/ 6136const regReferencesBegin=/(\w+)\.[a-zA-Z]/ 6137const encodeSVGDatauri=(str,type)=>{let prefix="data:image/svg+xml" 6138if(type&&type!=="base64")type==="enc"?str=prefix+","+encodeURIComponent(str):type==="unenc"&&(str=prefix+","+str) 6139else{prefix+=";base64," 6140str=prefix+Buffer.from(str).toString("base64")}return str} 6141const cleanupOutData=(data,params,command)=>{let str="" 6142let delimiter 6143let prev 6144data.forEach(((item,i)=>{delimiter=" " 6145i==0&&(delimiter="") 6146params.noSpaceAfterFlags&&command=="a" 6147const itemStr=params.leadingZero?removeLeadingZero(item):item.toString() 6148params.negativeExtraSpace&&delimiter!=""&&(item<0||itemStr.charAt(0)==="."&&prev%1!==0)&&(delimiter="") 6149prev=item 6150str+=delimiter+itemStr})) 6151return str} 6152const removeLeadingZero=value=>{const strValue=value.toString() 6153if(0<value&&value<1&&strValue.startsWith("0"))return strValue.slice(1) 6154if(-1<value&&value<0&&strValue[1]==="0")return strValue[0]+strValue.slice(2) 6155return strValue} 6156const hasScripts=node=>{if(node.name==="script"&&node.children.length!==0)return true 6157if(node.name==="a"){const hasJsLinks=Object.entries(node.attributes).some((([attrKey,attrValue])=>(attrKey==="href"||attrKey.endsWith(":href"))&&attrValue!=null&&attrValue.trimStart().startsWith("javascript:"))) 6158if(hasJsLinks)return true}const eventAttrs=[...attrsGroups.animationEvent,...attrsGroups.documentEvent,...attrsGroups.documentElementEvent,...attrsGroups.globalEvent,...attrsGroups.graphicalEvent] 6159return eventAttrs.some((attr=>node.attributes[attr]!=null))} 6160const includesUrlReference=body=>new RegExp(regReferencesUrl).test(body) 6161const findReferences=(attribute,value)=>{const results=[] 6162if(referencesProps.has(attribute)){const matches=value.matchAll(regReferencesUrl) 6163for(const match of matches)results.push(match[2])}if(attribute==="href"||attribute.endsWith(":href")){const match=regReferencesHref.exec(value) 6164match!=null&&results.push(match[1])}if(attribute==="begin"){const match=regReferencesBegin.exec(value) 6165match!=null&&results.push(match[1])}return results.map((body=>decodeURI(body)))} 6166const toFixed=(num,precision)=>{const pow=10**precision 6167return Math.round(num*pow)/pow} 6168const name$H="minifyStyles" 6169const description$H="minifies styles and removes unused styles" 6170const fn$H=(_root,{usage:usage,...params})=>{const styleElements=new Map 6171const elementsWithStyleAttributes=[] 6172const tagsUsage=new Set 6173const idsUsage=new Set 6174const classesUsage=new Set 6175let enableTagsUsage=true 6176let enableIdsUsage=true 6177let enableClassesUsage=true 6178let forceUsageDeoptimized=false 6179if(typeof usage==="boolean"){enableTagsUsage=usage 6180enableIdsUsage=usage 6181enableClassesUsage=usage}else if(usage){enableTagsUsage=usage.tags==null||usage.tags 6182enableIdsUsage=usage.ids==null||usage.ids 6183enableClassesUsage=usage.classes==null||usage.classes 6184forceUsageDeoptimized=usage.force!=null&&usage.force}let deoptimized=false 6185return{element:{enter:(node,parentNode)=>{hasScripts(node)&&(deoptimized=true) 6186tagsUsage.add(node.name) 6187node.attributes.id!=null&&idsUsage.add(node.attributes.id) 6188if(node.attributes.class!=null)for(const className of node.attributes.class.split(/\s+/))classesUsage.add(className) 6189node.name==="style"&&node.children.length!==0?styleElements.set(node,parentNode):node.attributes.style!=null&&elementsWithStyleAttributes.push(node)}},root:{exit:()=>{const cssoUsage={} 6190if(!deoptimized||forceUsageDeoptimized){enableTagsUsage&&(cssoUsage.tags=Array.from(tagsUsage)) 6191enableIdsUsage&&(cssoUsage.ids=Array.from(idsUsage)) 6192enableClassesUsage&&(cssoUsage.classes=Array.from(classesUsage))}for(const[styleNode,styleNodeParent]of styleElements.entries())if(styleNode.children[0].type==="text"||styleNode.children[0].type==="cdata"){const cssText=styleNode.children[0].value 6193const minified=minifyStylesheet(cssText,{...params,usage:cssoUsage}).css 6194if(minified.length===0){detachNodeFromParent(styleNode,styleNodeParent) 6195continue}if(cssText.indexOf(">")>=0||cssText.indexOf("<")>=0){styleNode.children[0].type="cdata" 6196styleNode.children[0].value=minified}else{styleNode.children[0].type="text" 6197styleNode.children[0].value=minified}}for(const node of elementsWithStyleAttributes){const elemStyle=node.attributes.style 6198node.attributes.style=minifyBlock(elemStyle,{...params}).css}}}}} 6199var minifyStyles=Object.freeze({__proto__:null,description:description$H,fn:fn$H,name:name$H})
vendor: 10,681 bytes, lines 6200-6325
6200const name$G="cleanupIds" 6201const description$G="removes unused IDs and minifies used" 6202const generateIdChars=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] 6203const maxIdIndex=generateIdChars.length-1 6204const hasStringPrefix=(string,prefixes)=>{for(const prefix of prefixes)if(string.startsWith(prefix))return true 6205return false} 6206const generateId=currentId=>{if(currentId==null)return[0] 6207currentId[currentId.length-1]+=1 6208for(let i=currentId.length-1;i>0;i--)if(currentId[i]>maxIdIndex){currentId[i]=0 6209currentId[i-1]!==void 0&¤tId[i-1]++}if(currentId[0]>maxIdIndex){currentId[0]=0 6210currentId.unshift(0)}return currentId} 6211const getIdString=arr=>arr.map((i=>generateIdChars[i])).join("") 6212const fn$G=(_root,params)=>{const{remove:remove=true,minify:minify=true,preserve:preserve=[],preservePrefixes:preservePrefixes=[],force:force=false}=params 6213const preserveIds=new Set(Array.isArray(preserve)?preserve:preserve?[preserve]:[]) 6214const preserveIdPrefixes=Array.isArray(preservePrefixes)?preservePrefixes:preservePrefixes?[preservePrefixes]:[] 6215const nodeById=new Map 6216const referencesById=new Map 6217let deoptimized=false 6218return{element:{enter:node=>{if(!force){if(node.name==="style"&&node.children.length!==0||hasScripts(node)){deoptimized=true 6219return}if(node.name==="svg"){let hasDefsOnly=true 6220for(const child of node.children)if(child.type!=="element"||child.name!=="defs"){hasDefsOnly=false 6221break}if(hasDefsOnly)return visitSkip}}for(const[name,value]of Object.entries(node.attributes))if(name==="id"){const id=value 6222nodeById.has(id)?delete node.attributes.id:nodeById.set(id,node)}else{const ids=findReferences(name,value) 6223for(const id of ids){let refs=referencesById.get(id) 6224if(refs==null){refs=[] 6225referencesById.set(id,refs)}refs.push({element:node,name:name})}}}},root:{exit:()=>{if(deoptimized)return 6226const isIdPreserved=id=>preserveIds.has(id)||hasStringPrefix(id,preserveIdPrefixes) 6227let currentId=null 6228for(const[id,refs]of referencesById){const node=nodeById.get(id) 6229if(node!=null){if(minify&&isIdPreserved(id)===false){let currentIdString 6230do{currentId=generateId(currentId) 6231currentIdString=getIdString(currentId)}while(isIdPreserved(currentIdString)||referencesById.has(currentIdString)&&nodeById.get(currentIdString)==null) 6232node.attributes.id=currentIdString 6233for(const{element:element,name:name}of refs){const value=element.attributes[name] 6234value.includes("#")?element.attributes[name]=value.replace(`#${encodeURI(id)}`,`#${currentIdString}`).replace(`#${id}`,`#${currentIdString}`):element.attributes[name]=value.replace(`${id}.`,`${currentIdString}.`)}}nodeById.delete(id)}}if(remove)for(const[id,node]of nodeById)isIdPreserved(id)===false&&delete node.attributes.id}}}} 6235var cleanupIds=Object.freeze({__proto__:null,description:description$G,fn:fn$G,name:name$G}) 6236const name$F="removeUselessDefs" 6237const description$F="removes elements in <defs> without id" 6238const fn$F=()=>({element:{enter:(node,parentNode)=>{if(node.name==="defs"||elemsGroups.nonRendering.has(node.name)&&node.attributes.id==null){const usefulNodes=[] 6239collectUsefulNodes(node,usefulNodes) 6240usefulNodes.length===0&&detachNodeFromParent(node,parentNode) 6241node.children=usefulNodes}}}}) 6242const collectUsefulNodes=(node,usefulNodes)=>{for(const child of node.children)child.type==="element"&&(child.attributes.id!=null||child.name==="style"?usefulNodes.push(child):collectUsefulNodes(child,usefulNodes))} 6243var removeUselessDefs=Object.freeze({__proto__:null,description:description$F,fn:fn$F,name:name$F}) 6244const name$E="cleanupNumericValues" 6245const description$E='rounds numeric values to the fixed precision, removes default "px" units' 6246const regNumericValues$3=/^([-+]?\d*\.?\d+([eE][-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/ 6247const absoluteLengths$1={cm:96/2.54,mm:96/25.4,in:96,pt:4/3,pc:16,px:1} 6248const fn$E=(_root,params)=>{const{floatPrecision:floatPrecision=3,leadingZero:leadingZero=true,defaultPx:defaultPx=true,convertToPx:convertToPx=true}=params 6249return{element:{enter:node=>{if(node.attributes.viewBox!=null){const nums=node.attributes.viewBox.trim().split(/(?:\s,?|,)\s*/g) 6250node.attributes.viewBox=nums.map((value=>{const num=Number(value) 6251return Number.isNaN(num)?value:Number(num.toFixed(floatPrecision))})).join(" ")}for(const[name,value]of Object.entries(node.attributes)){if(name==="version")continue 6252const match=regNumericValues$3.exec(value) 6253if(match){let num=Number(Number(match[1]).toFixed(floatPrecision)) 6254const matchedUnit=match[3]||"" 6255let units=matchedUnit 6256if(convertToPx&&units!==""&&units in absoluteLengths$1){const pxNum=Number((absoluteLengths$1[units]*Number(match[1])).toFixed(floatPrecision)) 6257if(pxNum.toString().length<match[0].length){num=pxNum 6258units="px"}}let str 6259str=leadingZero?removeLeadingZero(num):num.toString() 6260defaultPx&&units==="px"&&(units="") 6261node.attributes[name]=str+units}}}}}} 6262var cleanupNumericValues=Object.freeze({__proto__:null,description:description$E,fn:fn$E,name:name$E}) 6263const name$D="convertColors" 6264const description$D="converts colors: rgb() to #rrggbb and #rrggbb to #rgb" 6265const rNumber="([+-]?(?:\\d*\\.\\d+|\\d+\\.?)%?)" 6266const rComma="(?:\\s*,\\s*|\\s+)" 6267const regRGB=new RegExp("^rgb\\(\\s*"+rNumber+rComma+rNumber+rComma+rNumber+"\\s*\\)$") 6268const regHEX=/^#(([a-fA-F0-9])\2){3}$/ 6269const convertRgbToHex=([r,g,b])=>{const hexNumber=(256+r<<8|g)<<8|b 6270return"#"+hexNumber.toString(16).slice(1).toUpperCase()} 6271const fn$D=(_root,params)=>{const{currentColor:currentColor=false,names2hex:names2hex=true,rgb2hex:rgb2hex=true,convertCase:convertCase="lower",shorthex:shorthex=true,shortname:shortname=true}=params 6272let maskCounter=0 6273return{element:{enter:node=>{node.name==="mask"&&maskCounter++ 6274for(const[name,value]of Object.entries(node.attributes))if(colorsProps.has(name)){let val=value 6275if(currentColor&&maskCounter===0){let matched 6276matched=typeof currentColor==="string"?val===currentColor:currentColor instanceof RegExp?currentColor.exec(val)!=null:val!=="none" 6277matched&&(val="currentColor")}if(names2hex){const colorName=val.toLowerCase() 6278colorsNames[colorName]!=null&&(val=colorsNames[colorName])}if(rgb2hex){const match=val.match(regRGB) 6279if(match!=null){const nums=match.slice(1,4).map((m=>{let n 6280n=m.indexOf("%")>-1?Math.round(parseFloat(m)*2.55):Number(m) 6281return Math.max(0,Math.min(n,255))})) 6282val=convertRgbToHex(nums)}}convertCase&&!includesUrlReference(val)&&val!=="currentColor"&&(convertCase==="lower"?val=val.toLowerCase():convertCase==="upper"&&(val=val.toUpperCase())) 6283if(shorthex){const match=regHEX.exec(val) 6284match!=null&&(val="#"+match[0][1]+match[0][3]+match[0][5])}if(shortname){const colorName=val.toLowerCase() 6285colorsShortNames[colorName]!=null&&(val=colorsShortNames[colorName])}node.attributes[name]=val}},exit:node=>{node.name==="mask"&&maskCounter--}}}} 6286var convertColors=Object.freeze({__proto__:null,description:description$D,fn:fn$D,name:name$D}) 6287const name$C="removeUnknownsAndDefaults" 6288const description$C="removes unknown elements content and attributes, removes attrs with default values" 6289const allowedChildrenPerElement=new Map 6290const allowedAttributesPerElement=new Map 6291const attributesDefaultsPerElement=new Map 6292for(const[name,config]of Object.entries(elems)){const allowedChildren=new Set 6293if(config.content)for(const elementName of config.content)allowedChildren.add(elementName) 6294if(config.contentGroups)for(const contentGroupName of config.contentGroups){const elemsGroup=elemsGroups[contentGroupName] 6295if(elemsGroup)for(const elementName of elemsGroup)allowedChildren.add(elementName)}const allowedAttributes=new Set 6296if(config.attrs)for(const attrName of config.attrs)allowedAttributes.add(attrName) 6297const attributesDefaults=new Map 6298if(config.defaults)for(const[attrName,defaultValue]of Object.entries(config.defaults))attributesDefaults.set(attrName,defaultValue) 6299for(const attrsGroupName of config.attrsGroups){const attrsGroup=attrsGroups[attrsGroupName] 6300if(attrsGroup)for(const attrName of attrsGroup)allowedAttributes.add(attrName) 6301const groupDefaults=attrsGroupsDefaults[attrsGroupName] 6302if(groupDefaults)for(const[attrName,defaultValue]of Object.entries(groupDefaults))attributesDefaults.set(attrName,defaultValue)}allowedChildrenPerElement.set(name,allowedChildren) 6303allowedAttributesPerElement.set(name,allowedAttributes) 6304attributesDefaultsPerElement.set(name,attributesDefaults)}const fn$C=(root,params)=>{const{unknownContent:unknownContent=true,unknownAttrs:unknownAttrs=true,defaultAttrs:defaultAttrs=true,defaultMarkupDeclarations:defaultMarkupDeclarations=true,uselessOverrides:uselessOverrides=true,keepDataAttrs:keepDataAttrs=true,keepAriaAttrs:keepAriaAttrs=true,keepRoleAttr:keepRoleAttr=false}=params 6305const stylesheet=collectStylesheet(root) 6306return{instruction:{enter:node=>{defaultMarkupDeclarations&&(node.value=node.value.replace(/\s*standalone\s*=\s*(["'])no\1/,""))}},element:{enter:(node,parentNode)=>{if(node.name.includes(":"))return 6307if(node.name==="foreignObject")return visitSkip 6308if(unknownContent&&parentNode.type==="element"){const allowedChildren=allowedChildrenPerElement.get(parentNode.name) 6309if(allowedChildren==null||allowedChildren.size===0){if(allowedChildrenPerElement.get(node.name)==null){detachNodeFromParent(node,parentNode) 6310return}}else if(allowedChildren.has(node.name)===false){detachNodeFromParent(node,parentNode) 6311return}}const allowedAttributes=allowedAttributesPerElement.get(node.name) 6312const attributesDefaults=attributesDefaultsPerElement.get(node.name) 6313const computedParentStyle=parentNode.type==="element"?computeStyle(stylesheet,parentNode):null 6314for(const[name,value]of Object.entries(node.attributes)){if(keepDataAttrs&&name.startsWith("data-"))continue 6315if(keepAriaAttrs&&name.startsWith("aria-"))continue 6316if(keepRoleAttr&&name==="role")continue 6317if(name==="xmlns")continue 6318if(name.includes(":")){const[prefix]=name.split(":") 6319if(prefix!=="xml"&&prefix!=="xlink")continue}unknownAttrs&&allowedAttributes&&allowedAttributes.has(name)===false&&delete node.attributes[name] 6320defaultAttrs&&node.attributes.id==null&&attributesDefaults&&attributesDefaults.get(name)===value&&computedParentStyle?.[name]==null&&delete node.attributes[name] 6321if(uselessOverrides&&node.attributes.id==null){const style=computedParentStyle?.[name] 6322presentationNonInheritableGroupAttrs.has(name)===false&&style!=null&&style.type==="static"&&style.value===value&&delete node.attributes[name]}}}}}} 6323var removeUnknownsAndDefaults=Object.freeze({__proto__:null,description:description$C,fn:fn$C,name:name$C}) 6324const name$B="removeNonInheritableGroupAttrs" 6325const description$B="removes non-inheritable group's presentational attributes"
vendor: 13,293 bytes, lines 6326-6491
6326const fn$B=()=>({element:{enter:node=>{if(node.name==="g")for(const name of Object.keys(node.attributes))!attrsGroups.presentation.has(name)||inheritableAttrs.has(name)||presentationNonInheritableGroupAttrs.has(name)||delete node.attributes[name]}}}) 6327var removeNonInheritableGroupAttrs=Object.freeze({__proto__:null,description:description$B,fn:fn$B,name:name$B}) 6328const name$A="removeUselessStrokeAndFill" 6329const description$A="removes useless stroke and fill attributes" 6330const fn$A=(root,params)=>{const{stroke:removeStroke=true,fill:removeFill=true,removeNone:removeNone=false}=params 6331let hasStyleOrScript=false 6332visit(root,{element:{enter:node=>{(node.name==="style"||hasScripts(node))&&(hasStyleOrScript=true)}}}) 6333if(hasStyleOrScript)return null 6334const stylesheet=collectStylesheet(root) 6335return{element:{enter:(node,parentNode)=>{if(node.attributes.id!=null)return visitSkip 6336if(!elemsGroups.shape.has(node.name))return 6337const computedStyle=computeStyle(stylesheet,node) 6338const stroke=computedStyle.stroke 6339const strokeOpacity=computedStyle["stroke-opacity"] 6340const strokeWidth=computedStyle["stroke-width"] 6341const markerEnd=computedStyle["marker-end"] 6342const fill=computedStyle.fill 6343const fillOpacity=computedStyle["fill-opacity"] 6344const computedParentStyle=parentNode.type==="element"?computeStyle(stylesheet,parentNode):null 6345const parentStroke=computedParentStyle==null?null:computedParentStyle.stroke 6346if(removeStroke&&(stroke==null||stroke.type==="static"&&stroke.value=="none"||strokeOpacity!=null&&strokeOpacity.type==="static"&&strokeOpacity.value==="0"||strokeWidth!=null&&strokeWidth.type==="static"&&strokeWidth.value==="0")&&(strokeWidth!=null&&strokeWidth.type==="static"&&strokeWidth.value==="0"||markerEnd==null)){for(const name of Object.keys(node.attributes))name.startsWith("stroke")&&delete node.attributes[name] 6347parentStroke!=null&&parentStroke.type==="static"&&parentStroke.value!=="none"&&(node.attributes.stroke="none")}if(removeFill&&(fill!=null&&fill.type==="static"&&fill.value==="none"||fillOpacity!=null&&fillOpacity.type==="static"&&fillOpacity.value==="0")){for(const name of Object.keys(node.attributes))name.startsWith("fill-")&&delete node.attributes[name];(fill==null||fill.type==="static"&&fill.value!=="none")&&(node.attributes.fill="none")}removeNone&&(stroke!=null&&node.attributes.stroke!=="none"||(fill==null||fill.type!=="static"||fill.value!=="none")&&node.attributes.fill!=="none"||detachNodeFromParent(node,parentNode))}}}} 6348var removeUselessStrokeAndFill=Object.freeze({__proto__:null,description:description$A,fn:fn$A,name:name$A}) 6349const name$z="cleanupEnableBackground" 6350const description$z="remove or cleanup enable-background attribute when possible" 6351const regEnableBackground=/^new\s0\s0\s([-+]?\d*\.?\d+([eE][-+]?\d+)?)\s([-+]?\d*\.?\d+([eE][-+]?\d+)?)$/ 6352const fn$z=root=>{let hasFilter=false 6353visit(root,{element:{enter:node=>{node.name==="filter"&&(hasFilter=true)}}}) 6354return{element:{enter:node=>{let newStyle=null 6355let enableBackgroundDeclaration=null 6356if(node.attributes.style!=null){newStyle=parse$I(node.attributes.style,{context:"declarationList"}) 6357if(newStyle.type==="DeclarationList"){const enableBackgroundDeclarations=[] 6358walk$3(newStyle,((node,nodeItem)=>{if(node.type==="Declaration"&&node.property==="enable-background"){enableBackgroundDeclarations.push(nodeItem) 6359enableBackgroundDeclaration=nodeItem}})) 6360for(let i=0;i<enableBackgroundDeclarations.length-1;i++)newStyle.children.remove(enableBackgroundDeclarations[i])}}if(!hasFilter){delete node.attributes["enable-background"] 6361if(newStyle?.type==="DeclarationList"){enableBackgroundDeclaration&&newStyle.children.remove(enableBackgroundDeclaration) 6362newStyle.children.isEmpty?delete node.attributes.style:node.attributes.style=generate$I(newStyle)}return}const hasDimensions=node.attributes.width!=null&&node.attributes.height!=null 6363if((node.name==="svg"||node.name==="mask"||node.name==="pattern")&&hasDimensions){const attrValue=node.attributes["enable-background"] 6364const attrCleaned=cleanupValue(attrValue,node.name,node.attributes.width,node.attributes.height) 6365attrCleaned?node.attributes["enable-background"]=attrCleaned:delete node.attributes["enable-background"] 6366if(newStyle?.type==="DeclarationList"&&enableBackgroundDeclaration){const styleValue=generate$I(enableBackgroundDeclaration.data.value) 6367const styleCleaned=cleanupValue(styleValue,node.name,node.attributes.width,node.attributes.height) 6368styleCleaned?enableBackgroundDeclaration.data.value={type:"Raw",value:styleCleaned}:newStyle.children.remove(enableBackgroundDeclaration)}}newStyle?.type==="DeclarationList"&&(newStyle.children.isEmpty?delete node.attributes.style:node.attributes.style=generate$I(newStyle))}}}} 6369const cleanupValue=(value,nodeName,width,height)=>{const match=regEnableBackground.exec(value) 6370if(match!=null&&width===match[1]&&height===match[3])return nodeName==="svg"?void 0:"new" 6371return value} 6372var cleanupEnableBackground=Object.freeze({__proto__:null,description:description$z,fn:fn$z,name:name$z}) 6373const argsCountPerCommand={M:2,m:2,Z:0,z:0,L:2,l:2,H:1,h:1,V:1,v:1,C:6,c:6,S:4,s:4,Q:4,q:4,T:2,t:2,A:7,a:7} 6374const isCommand=c=>c in argsCountPerCommand 6375const isWhiteSpace=c=>c===" "||c==="\t"||c==="\r"||c==="\n" 6376const isDigit=c=>{const codePoint=c.codePointAt(0) 6377if(codePoint==null)return false 6378return 48<=codePoint&&codePoint<=57} 6379const readNumber=(string,cursor)=>{let i=cursor 6380let value="" 6381let state="none" 6382for(;i<string.length;i+=1){const c=string[i] 6383if(c==="+"||c==="-"){if(state==="none"){state="sign" 6384value+=c 6385continue}if(state==="e"){state="exponent_sign" 6386value+=c 6387continue}}if(isDigit(c)){if(state==="none"||state==="sign"||state==="whole"){state="whole" 6388value+=c 6389continue}if(state==="decimal_point"||state==="decimal"){state="decimal" 6390value+=c 6391continue}if(state==="e"||state==="exponent_sign"||state==="exponent"){state="exponent" 6392value+=c 6393continue}}if(c==="."&&(state==="none"||state==="sign"||state==="whole")){state="decimal_point" 6394value+=c 6395continue}if((c==="E"||c=="e")&&(state==="whole"||state==="decimal_point"||state==="decimal")){state="e" 6396value+=c 6397continue}break}const number=Number.parseFloat(value) 6398return Number.isNaN(number)?[cursor,null]:[i-1,number]} 6399const parsePathData=string=>{const pathData=[] 6400let command=null 6401let args=[] 6402let argsCount=0 6403let canHaveComma=false 6404let hadComma=false 6405for(let i=0;i<string.length;i+=1){const c=string.charAt(i) 6406if(isWhiteSpace(c))continue 6407if(canHaveComma&&c===","){if(hadComma)break 6408hadComma=true 6409continue}if(isCommand(c)){if(hadComma)return pathData 6410if(command==null){if(c!=="M"&&c!=="m")return pathData}else if(args.length!==0)return pathData 6411command=c 6412args=[] 6413argsCount=argsCountPerCommand[command] 6414canHaveComma=false 6415argsCount===0&&pathData.push({command:command,args:args}) 6416continue}if(command==null)return pathData 6417let newCursor=i 6418let number=null 6419if(command==="A"||command==="a"){const position=args.length 6420position!==0&&position!==1||c!=="+"&&c!=="-"&&([newCursor,number]=readNumber(string,i)) 6421position!==2&&position!==5&&position!==6||([newCursor,number]=readNumber(string,i)) 6422if(position===3||position===4){c==="0"&&(number=0) 6423c==="1"&&(number=1)}}else[newCursor,number]=readNumber(string,i) 6424if(number==null)return pathData 6425args.push(number) 6426canHaveComma=true 6427hadComma=false 6428i=newCursor 6429if(args.length===argsCount){pathData.push({command:command,args:args}) 6430command==="M"&&(command="L") 6431command==="m"&&(command="l") 6432args=[]}}return pathData} 6433const roundAndStringify=(number,precision)=>{precision!=null&&(number=toFixed(number,precision)) 6434return{roundedStr:removeLeadingZero(number),rounded:number}} 6435const stringifyArgs=(command,args,precision,disableSpaceAfterFlags)=>{let result="" 6436let previous 6437for(let i=0;i<args.length;i++){const{roundedStr:roundedStr,rounded:rounded}=roundAndStringify(args[i],precision) 6438!disableSpaceAfterFlags||command!=="A"&&command!=="a"||i%7!==4&&i%7!==5?i===0||rounded<0?result+=roundedStr:Number.isInteger(previous)||isDigit(roundedStr[0])?result+=` ${roundedStr}`:result+=roundedStr:result+=roundedStr 6439previous=rounded}return result} 6440const stringifyPathData=({pathData:pathData,precision:precision,disableSpaceAfterFlags:disableSpaceAfterFlags})=>{if(pathData.length===1){const{command:command,args:args}=pathData[0] 6441return command+stringifyArgs(command,args,precision,disableSpaceAfterFlags)}let result="" 6442let prev={...pathData[0]} 6443pathData[1].command==="L"?prev.command="M":pathData[1].command==="l"&&(prev.command="m") 6444for(let i=1;i<pathData.length;i++){const{command:command,args:args}=pathData[i] 6445if(prev.command===command&&prev.command!=="M"&&prev.command!=="m"||prev.command==="M"&&command==="L"||prev.command==="m"&&command==="l"){prev.args=[...prev.args,...args] 6446i===pathData.length-1&&(result+=prev.command+stringifyArgs(prev.command,prev.args,precision,disableSpaceAfterFlags))}else{result+=prev.command+stringifyArgs(prev.command,prev.args,precision,disableSpaceAfterFlags) 6447i===pathData.length-1?result+=command+stringifyArgs(command,args,precision,disableSpaceAfterFlags):prev={command:command,args:args}}}return result} 6448const nonRendering=elemsGroups.nonRendering 6449const name$y="removeHiddenElems" 6450const description$y="removes hidden elements (zero sized, with absent attributes)" 6451const fn$y=(root,params)=>{const{isHidden:isHidden=true,displayNone:displayNone=true,opacity0:opacity0=true,circleR0:circleR0=true,ellipseRX0:ellipseRX0=true,ellipseRY0:ellipseRY0=true,rectWidth0:rectWidth0=true,rectHeight0:rectHeight0=true,patternWidth0:patternWidth0=true,patternHeight0:patternHeight0=true,imageWidth0:imageWidth0=true,imageHeight0:imageHeight0=true,pathEmptyD:pathEmptyD=true,polylineEmptyPoints:polylineEmptyPoints=true,polygonEmptyPoints:polygonEmptyPoints=true}=params 6452const stylesheet=collectStylesheet(root) 6453const nonRenderedNodes=new Map 6454const removedDefIds=new Set 6455const allDefs=new Map 6456const allReferences=new Set 6457const referencesById=new Map 6458let deoptimized=false 6459function canRemoveNonRenderingNode(node){if(allReferences.has(node.attributes.id))return false 6460for(const child of node.children)if(child.type==="element"&&!canRemoveNonRenderingNode(child))return false 6461return true}function removeElement(node,parentNode){node.type==="element"&&node.attributes.id!=null&&parentNode.type==="element"&&parentNode.name==="defs"&&removedDefIds.add(node.attributes.id) 6462detachNodeFromParent(node,parentNode)}visit(root,{element:{enter:(node,parentNode)=>{if(nonRendering.has(node.name)){nonRenderedNodes.set(node,parentNode) 6463return visitSkip}const computedStyle=computeStyle(stylesheet,node) 6464if(opacity0&&computedStyle.opacity&&computedStyle.opacity.type==="static"&&computedStyle.opacity.value==="0"){if(node.name==="path"){nonRenderedNodes.set(node,parentNode) 6465return visitSkip}removeElement(node,parentNode)}}}}) 6466return{element:{enter:(node,parentNode)=>{if(node.name==="style"&&node.children.length!==0||hasScripts(node)){deoptimized=true 6467return}node.name==="defs"&&allDefs.set(node,parentNode) 6468if(node.name==="use")for(const attr of Object.keys(node.attributes)){if(attr!=="href"&&!attr.endsWith(":href"))continue 6469const value=node.attributes[attr] 6470const id=value.slice(1) 6471let refs=referencesById.get(id) 6472if(!refs){refs=[] 6473referencesById.set(id,refs)}refs.push({node:node,parentNode:parentNode})}const computedStyle=computeStyle(stylesheet,node) 6474if(isHidden&&computedStyle.visibility&&computedStyle.visibility.type==="static"&&computedStyle.visibility.value==="hidden"&&querySelector(node,"[visibility=visible]")==null){removeElement(node,parentNode) 6475return}if(displayNone&&computedStyle.display&&computedStyle.display.type==="static"&&computedStyle.display.value==="none"&&node.name!=="marker"){removeElement(node,parentNode) 6476return}if(circleR0&&node.name==="circle"&&node.children.length===0&&node.attributes.r==="0"){removeElement(node,parentNode) 6477return}if(ellipseRX0&&node.name==="ellipse"&&node.children.length===0&&node.attributes.rx==="0"){removeElement(node,parentNode) 6478return}if(ellipseRY0&&node.name==="ellipse"&&node.children.length===0&&node.attributes.ry==="0"){removeElement(node,parentNode) 6479return}if(rectWidth0&&node.name==="rect"&&node.children.length===0&&node.attributes.width==="0"){removeElement(node,parentNode) 6480return}if(rectHeight0&&rectWidth0&&node.name==="rect"&&node.children.length===0&&node.attributes.height==="0"){removeElement(node,parentNode) 6481return}if(patternWidth0&&node.name==="pattern"&&node.attributes.width==="0"){removeElement(node,parentNode) 6482return}if(patternHeight0&&node.name==="pattern"&&node.attributes.height==="0"){removeElement(node,parentNode) 6483return}if(imageWidth0&&node.name==="image"&&node.attributes.width==="0"){removeElement(node,parentNode) 6484return}if(imageHeight0&&node.name==="image"&&node.attributes.height==="0"){removeElement(node,parentNode) 6485return}if(pathEmptyD&&node.name==="path"){if(node.attributes.d==null){removeElement(node,parentNode) 6486return}const pathData=parsePathData(node.attributes.d) 6487if(pathData.length===0){removeElement(node,parentNode) 6488return}if(pathData.length===1&&computedStyle["marker-start"]==null&&computedStyle["marker-end"]==null){removeElement(node,parentNode) 6489return}}if(polylineEmptyPoints&&node.name==="polyline"&&node.attributes.points==null){removeElement(node,parentNode) 6490return}if(polygonEmptyPoints&&node.name==="polygon"&&node.attributes.points==null){removeElement(node,parentNode) 6491return
vendor: 6,813 bytes, lines 6491-6587
6491}for(const[name,value]of Object.entries(node.attributes)){const ids=findReferences(name,value) 6492for(const id of ids)allReferences.add(id)}}},root:{exit:()=>{for(const id of removedDefIds){const refs=referencesById.get(id) 6493if(refs)for(const{node:node,parentNode:parentNode}of refs)detachNodeFromParent(node,parentNode)}if(!deoptimized)for(const[nonRenderedNode,nonRenderedParent]of nonRenderedNodes.entries())canRemoveNonRenderingNode(nonRenderedNode)&&detachNodeFromParent(nonRenderedNode,nonRenderedParent) 6494for(const[node,parentNode]of allDefs.entries())node.children.length===0&&detachNodeFromParent(node,parentNode)}}}} 6495var removeHiddenElems=Object.freeze({__proto__:null,description:description$y,fn:fn$y,name:name$y}) 6496const name$x="removeEmptyText" 6497const description$x="removes empty <text> elements" 6498const fn$x=(root,params)=>{const{text:text=true,tspan:tspan=true,tref:tref=true}=params 6499return{element:{enter:(node,parentNode)=>{text&&node.name==="text"&&node.children.length===0&&detachNodeFromParent(node,parentNode) 6500tspan&&node.name==="tspan"&&node.children.length===0&&detachNodeFromParent(node,parentNode) 6501tref&&node.name==="tref"&&node.attributes["xlink:href"]==null&&detachNodeFromParent(node,parentNode)}}}} 6502var removeEmptyText=Object.freeze({__proto__:null,description:description$x,fn:fn$x,name:name$x}) 6503const name$w="convertShapeToPath" 6504const description$w="converts basic shapes to more compact path form" 6505const regNumber=/[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g 6506const fn$w=(root,params)=>{const{convertArcs:convertArcs=false,floatPrecision:precision}=params 6507return{element:{enter:(node,parentNode)=>{if(node.name==="rect"&&node.attributes.width!=null&&node.attributes.height!=null&&node.attributes.rx==null&&node.attributes.ry==null){const x=Number(node.attributes.x||"0") 6508const y=Number(node.attributes.y||"0") 6509const width=Number(node.attributes.width) 6510const height=Number(node.attributes.height) 6511if(Number.isNaN(x-y+width-height))return 6512const pathData=[{command:"M",args:[x,y]},{command:"H",args:[x+width]},{command:"V",args:[y+height]},{command:"H",args:[x]},{command:"z",args:[]}] 6513node.name="path" 6514node.attributes.d=stringifyPathData({pathData:pathData,precision:precision}) 6515delete node.attributes.x 6516delete node.attributes.y 6517delete node.attributes.width 6518delete node.attributes.height}if(node.name==="line"){const x1=Number(node.attributes.x1||"0") 6519const y1=Number(node.attributes.y1||"0") 6520const x2=Number(node.attributes.x2||"0") 6521const y2=Number(node.attributes.y2||"0") 6522if(Number.isNaN(x1-y1+x2-y2))return 6523const pathData=[{command:"M",args:[x1,y1]},{command:"L",args:[x2,y2]}] 6524node.name="path" 6525node.attributes.d=stringifyPathData({pathData:pathData,precision:precision}) 6526delete node.attributes.x1 6527delete node.attributes.y1 6528delete node.attributes.x2 6529delete node.attributes.y2}if((node.name==="polyline"||node.name==="polygon")&&node.attributes.points!=null){const coords=(node.attributes.points.match(regNumber)||[]).map(Number) 6530if(coords.length<4){detachNodeFromParent(node,parentNode) 6531return}const pathData=[] 6532for(let i=0;i<coords.length;i+=2)pathData.push({command:i===0?"M":"L",args:coords.slice(i,i+2)}) 6533node.name==="polygon"&&pathData.push({command:"z",args:[]}) 6534node.name="path" 6535node.attributes.d=stringifyPathData({pathData:pathData,precision:precision}) 6536delete node.attributes.points}if(node.name==="circle"&&convertArcs){const cx=Number(node.attributes.cx||"0") 6537const cy=Number(node.attributes.cy||"0") 6538const r=Number(node.attributes.r||"0") 6539if(Number.isNaN(cx-cy+r))return 6540const pathData=[{command:"M",args:[cx,cy-r]},{command:"A",args:[r,r,0,1,0,cx,cy+r]},{command:"A",args:[r,r,0,1,0,cx,cy-r]},{command:"z",args:[]}] 6541node.name="path" 6542node.attributes.d=stringifyPathData({pathData:pathData,precision:precision}) 6543delete node.attributes.cx 6544delete node.attributes.cy 6545delete node.attributes.r}if(node.name==="ellipse"&&convertArcs){const ecx=Number(node.attributes.cx||"0") 6546const ecy=Number(node.attributes.cy||"0") 6547const rx=Number(node.attributes.rx||"0") 6548const ry=Number(node.attributes.ry||"0") 6549if(Number.isNaN(ecx-ecy+rx-ry))return 6550const pathData=[{command:"M",args:[ecx,ecy-ry]},{command:"A",args:[rx,ry,0,1,0,ecx,ecy+ry]},{command:"A",args:[rx,ry,0,1,0,ecx,ecy-ry]},{command:"z",args:[]}] 6551node.name="path" 6552node.attributes.d=stringifyPathData({pathData:pathData,precision:precision}) 6553delete node.attributes.cx 6554delete node.attributes.cy 6555delete node.attributes.rx 6556delete node.attributes.ry}}}}} 6557var convertShapeToPath=Object.freeze({__proto__:null,description:description$w,fn:fn$w,name:name$w}) 6558const name$v="convertEllipseToCircle" 6559const description$v="converts non-eccentric <ellipse>s to <circle>s" 6560const fn$v=()=>({element:{enter:node=>{if(node.name==="ellipse"){const rx=node.attributes.rx||"0" 6561const ry=node.attributes.ry||"0" 6562if(rx===ry||rx==="auto"||ry==="auto"){node.name="circle" 6563const radius=rx==="auto"?ry:rx 6564delete node.attributes.rx 6565delete node.attributes.ry 6566node.attributes.r=radius}}}}}) 6567var convertEllipseToCircle=Object.freeze({__proto__:null,description:description$v,fn:fn$v,name:name$v}) 6568const name$u="moveElemsAttrsToGroup" 6569const description$u="Move common attributes of group children to the group" 6570const fn$u=root=>{let deoptimizedWithStyles=false 6571visit(root,{element:{enter:node=>{node.name==="style"&&(deoptimizedWithStyles=true)}}}) 6572return{element:{exit:node=>{if(node.name!=="g"||node.children.length<=1)return 6573if(deoptimizedWithStyles)return 6574const commonAttributes=new Map 6575let initial=true 6576let everyChildIsPath=true 6577for(const child of node.children)if(child.type==="element"){pathElems.has(child.name)||(everyChildIsPath=false) 6578if(initial){initial=false 6579for(const[name,value]of Object.entries(child.attributes))inheritableAttrs.has(name)&&commonAttributes.set(name,value)}else for(const[name,value]of commonAttributes)child.attributes[name]!==value&&commonAttributes.delete(name)}node.attributes["filter"]==null&&node.attributes["clip-path"]==null&&node.attributes.mask==null||commonAttributes.delete("transform") 6580everyChildIsPath&&commonAttributes.delete("transform") 6581for(const[name,value]of commonAttributes)name==="transform"?node.attributes.transform!=null?node.attributes.transform=`${node.attributes.transform} ${value}`:node.attributes.transform=value:node.attributes[name]=value 6582for(const child of node.children)if(child.type==="element")for(const[name]of commonAttributes)delete child.attributes[name]}}}} 6583var moveElemsAttrsToGroup=Object.freeze({__proto__:null,description:description$u,fn:fn$u,name:name$u}) 6584const name$t="moveGroupAttrsToElems" 6585const description$t="moves some group attributes to the content elements" 6586const pathElemsWithGroupsAndText=[...pathElems,"g","text"] 6587const fn$t=()=>({element:{enter:node=>{if(node.name==="g"&&node.children.length!==0&&node.attributes.transform!=null&&Object.entries(node.attributes).some((
vendor: 9,779 bytes, lines 6587-6737
6587([name,value])=>referencesProps.has(name)&&includesUrlReference(value)))===false&&node.children.every((child=>child.type==="element"&&pathElemsWithGroupsAndText.includes(child.name)&&child.attributes.id==null))){for(const child of node.children){const value=node.attributes.transform 6588child.type==="element"&&(child.attributes.transform!=null?child.attributes.transform=`${value} ${child.attributes.transform}`:child.attributes.transform=value)}delete node.attributes.transform}}}}) 6589var moveGroupAttrsToElems=Object.freeze({__proto__:null,description:description$t,fn:fn$t,name:name$t}) 6590const name$s="collapseGroups" 6591const description$s="collapses useless groups" 6592const hasAnimatedAttr=(node,name)=>{if(node.type==="element"){if(elemsGroups.animation.has(node.name)&&node.attributes.attributeName===name)return true 6593for(const child of node.children)if(hasAnimatedAttr(child,name))return true}return false} 6594const fn$s=root=>{const stylesheet=collectStylesheet(root) 6595return{element:{exit:(node,parentNode)=>{if(parentNode.type==="root"||parentNode.name==="switch")return 6596if(node.name!=="g"||node.children.length===0)return 6597if(Object.keys(node.attributes).length!==0&&node.children.length===1){const firstChild=node.children[0] 6598const nodeHasFilter=!!(node.attributes.filter||computeStyle(stylesheet,node).filter) 6599if(firstChild.type==="element"&&firstChild.attributes.id==null&&!nodeHasFilter&&(node.attributes.class==null||firstChild.attributes.class==null)&&(node.attributes["clip-path"]==null&&node.attributes.mask==null||firstChild.name==="g"&&node.attributes.transform==null&&firstChild.attributes.transform==null)){const newChildElemAttrs={...firstChild.attributes} 6600for(const[name,value]of Object.entries(node.attributes)){if(hasAnimatedAttr(firstChild,name))return 6601if(newChildElemAttrs[name]==null)newChildElemAttrs[name]=value 6602else if(name==="transform")newChildElemAttrs[name]=value+" "+newChildElemAttrs[name] 6603else if(newChildElemAttrs[name]==="inherit")newChildElemAttrs[name]=value 6604else if(!inheritableAttrs.has(name)&&newChildElemAttrs[name]!==value)return}node.attributes={} 6605firstChild.attributes=newChildElemAttrs}}if(Object.keys(node.attributes).length===0){for(const child of node.children)if(child.type==="element"&&elemsGroups.animation.has(child.name))return 6606const index=parentNode.children.indexOf(node) 6607parentNode.children.splice(index,1,...node.children)}}}}} 6608var collapseGroups=Object.freeze({__proto__:null,description:description$s,fn:fn$s,name:name$s}) 6609let prevCtrlPoint 6610const path2js=path=>{if(path.pathJS)return path.pathJS 6611const pathData=[] 6612const newPathData=parsePathData(path.attributes.d) 6613for(const{command:command,args:args}of newPathData)pathData.push({command:command,args:args}) 6614pathData.length&&pathData[0].command=="m"&&(pathData[0].command="M") 6615path.pathJS=pathData 6616return pathData} 6617const convertRelativeToAbsolute=data=>{const newData=[] 6618const start=[0,0] 6619const cursor=[0,0] 6620for(let{command:command,args:args}of data){args=args.slice() 6621if(command==="m"){args[0]+=cursor[0] 6622args[1]+=cursor[1] 6623command="M"}if(command==="M"){cursor[0]=args[0] 6624cursor[1]=args[1] 6625start[0]=cursor[0] 6626start[1]=cursor[1]}if(command==="h"){args[0]+=cursor[0] 6627command="H"}command==="H"&&(cursor[0]=args[0]) 6628if(command==="v"){args[0]+=cursor[1] 6629command="V"}command==="V"&&(cursor[1]=args[0]) 6630if(command==="l"){args[0]+=cursor[0] 6631args[1]+=cursor[1] 6632command="L"}if(command==="L"){cursor[0]=args[0] 6633cursor[1]=args[1]}if(command==="c"){args[0]+=cursor[0] 6634args[1]+=cursor[1] 6635args[2]+=cursor[0] 6636args[3]+=cursor[1] 6637args[4]+=cursor[0] 6638args[5]+=cursor[1] 6639command="C"}if(command==="C"){cursor[0]=args[4] 6640cursor[1]=args[5]}if(command==="s"){args[0]+=cursor[0] 6641args[1]+=cursor[1] 6642args[2]+=cursor[0] 6643args[3]+=cursor[1] 6644command="S"}if(command==="S"){cursor[0]=args[2] 6645cursor[1]=args[3]}if(command==="q"){args[0]+=cursor[0] 6646args[1]+=cursor[1] 6647args[2]+=cursor[0] 6648args[3]+=cursor[1] 6649command="Q"}if(command==="Q"){cursor[0]=args[2] 6650cursor[1]=args[3]}if(command==="t"){args[0]+=cursor[0] 6651args[1]+=cursor[1] 6652command="T"}if(command==="T"){cursor[0]=args[0] 6653cursor[1]=args[1]}if(command==="a"){args[5]+=cursor[0] 6654args[6]+=cursor[1] 6655command="A"}if(command==="A"){cursor[0]=args[5] 6656cursor[1]=args[6]}if(command==="z"||command==="Z"){cursor[0]=start[0] 6657cursor[1]=start[1] 6658command="z"}newData.push({command:command,args:args})}return newData} 6659const js2path=function(path,data,params){path.pathJS=data 6660const pathData=[] 6661for(const item of data){if(pathData.length!==0&&(item.command==="M"||item.command==="m")){const last=pathData[pathData.length-1] 6662last.command!=="M"&&last.command!=="m"||pathData.pop()}pathData.push({command:item.command,args:item.args})}path.attributes.d=stringifyPathData({pathData:pathData,precision:params.floatPrecision,disableSpaceAfterFlags:params.noSpaceAfterFlags})} 6663function set(dest,source){dest[0]=source[source.length-2] 6664dest[1]=source[source.length-1] 6665return dest}const intersects=function(path1,path2){const points1=gatherPoints(convertRelativeToAbsolute(path1)) 6666const points2=gatherPoints(convertRelativeToAbsolute(path2)) 6667if(points1.maxX<=points2.minX||points2.maxX<=points1.minX||points1.maxY<=points2.minY||points2.maxY<=points1.minY||points1.list.every((set1=>points2.list.every((set2=>set1.list[set1.maxX][0]<=set2.list[set2.minX][0]||set2.list[set2.maxX][0]<=set1.list[set1.minX][0]||set1.list[set1.maxY][1]<=set2.list[set2.minY][1]||set2.list[set2.maxY][1]<=set1.list[set1.minY][1])))))return false 6668const hullNest1=points1.list.map(convexHull) 6669const hullNest2=points2.list.map(convexHull) 6670return hullNest1.some((function(hull1){if(hull1.list.length<3)return false 6671return hullNest2.some((function(hull2){if(hull2.list.length<3)return false 6672const simplex=[getSupport(hull1,hull2,[1,0])] 6673const direction=minus(simplex[0]) 6674let iterations=1e4 6675while(true){if(iterations--==0){console.error("Error: infinite loop while processing mergePaths plugin.") 6676return true}simplex.push(getSupport(hull1,hull2,direction)) 6677if(dot(direction,simplex[simplex.length-1])<=0)return false 6678if(processSimplex(simplex,direction))return true}}))})) 6679function getSupport(a,b,direction){return sub(supportPoint(a,direction),supportPoint(b,minus(direction)))}function supportPoint(polygon,direction){let index=direction[1]>=0?direction[0]<0?polygon.maxY:polygon.maxX:direction[0]<0?polygon.minX:polygon.minY 6680let max=-1/0 6681let value 6682while((value=dot(polygon.list[index],direction))>max){max=value 6683index=++index%polygon.list.length}return polygon.list[(index||polygon.list.length)-1]}} 6684function processSimplex(simplex,direction){if(simplex.length==2){const a=simplex[1] 6685const b=simplex[0] 6686const AO=minus(simplex[1]) 6687const AB=sub(b,a) 6688if(dot(AO,AB)>0)set(direction,orth(AB,a)) 6689else{set(direction,AO) 6690simplex.shift()}}else{const a=simplex[2] 6691const b=simplex[1] 6692const c=simplex[0] 6693const AB=sub(b,a) 6694const AC=sub(c,a) 6695const AO=minus(a) 6696const ACB=orth(AB,AC) 6697const ABC=orth(AC,AB) 6698if(dot(ACB,AO)>0)if(dot(AB,AO)>0){set(direction,ACB) 6699simplex.shift()}else{set(direction,AO) 6700simplex.splice(0,2)}else{if(!(dot(ABC,AO)>0))return true 6701if(dot(AC,AO)>0){set(direction,ABC) 6702simplex.splice(1,1)}else{set(direction,AO) 6703simplex.splice(0,2)}}}return false}function minus(v){return[-v[0],-v[1]]}function sub(v1,v2){return[v1[0]-v2[0],v1[1]-v2[1]]}function dot(v1,v2){return v1[0]*v2[0]+v1[1]*v2[1]}function orth(v,from){const o=[-v[1],v[0]] 6704return dot(o,minus(from))<0?minus(o):o}function gatherPoints(pathData){const points={list:[],minX:0,minY:0,maxX:0,maxY:0} 6705const addPoint=(path,point)=>{if(!path.list.length||point[1]>path.list[path.maxY][1]){path.maxY=path.list.length 6706points.maxY=points.list.length?Math.max(point[1],points.maxY):point[1]}if(!path.list.length||point[0]>path.list[path.maxX][0]){path.maxX=path.list.length 6707points.maxX=points.list.length?Math.max(point[0],points.maxX):point[0]}if(!path.list.length||point[1]<path.list[path.minY][1]){path.minY=path.list.length 6708points.minY=points.list.length?Math.min(point[1],points.minY):point[1]}if(!path.list.length||point[0]<path.list[path.minX][0]){path.minX=path.list.length 6709points.minX=points.list.length?Math.min(point[0],points.minX):point[0]}path.list.push(point)} 6710for(let i=0;i<pathData.length;i+=1){const pathDataItem=pathData[i] 6711let subPath=points.list.length===0?{list:[],minX:0,minY:0,maxX:0,maxY:0}:points.list[points.list.length-1] 6712const prev=i===0?null:pathData[i-1] 6713let basePoint=subPath.list.length===0?null:subPath.list[subPath.list.length-1] 6714const data=pathDataItem.args 6715let ctrlPoint=basePoint 6716const toAbsolute=(n,i)=>n+(basePoint==null?0:basePoint[i%2]) 6717switch(pathDataItem.command){case"M":subPath={list:[],minX:0,minY:0,maxX:0,maxY:0} 6718points.list.push(subPath) 6719break 6720case"H":basePoint!=null&&addPoint(subPath,[data[0],basePoint[1]]) 6721break 6722case"V":basePoint!=null&&addPoint(subPath,[basePoint[0],data[0]]) 6723break 6724case"Q":addPoint(subPath,data.slice(0,2)) 6725prevCtrlPoint=[data[2]-data[0],data[3]-data[1]] 6726break 6727case"T":if(basePoint!=null&&prev!=null&&(prev.command=="Q"||prev.command=="T")){ctrlPoint=[basePoint[0]+prevCtrlPoint[0],basePoint[1]+prevCtrlPoint[1]] 6728addPoint(subPath,ctrlPoint) 6729prevCtrlPoint=[data[0]-ctrlPoint[0],data[1]-ctrlPoint[1]]}break 6730case"C":basePoint!=null&&addPoint(subPath,[0.5*(basePoint[0]+data[0]),0.5*(basePoint[1]+data[1])]) 6731addPoint(subPath,[0.5*(data[0]+data[2]),0.5*(data[1]+data[3])]) 6732addPoint(subPath,[0.5*(data[2]+data[4]),0.5*(data[3]+data[5])]) 6733prevCtrlPoint=[data[4]-data[2],data[5]-data[3]] 6734break 6735case"S":if(basePoint!=null&&prev!=null&&(prev.command=="C"||prev.command=="S")){addPoint(subPath,[basePoint[0]+0.5*prevCtrlPoint[0],basePoint[1]+0.5*prevCtrlPoint[1]]) 6736ctrlPoint=[basePoint[0]+prevCtrlPoint[0],basePoint[1]+prevCtrlPoint[1]]}ctrlPoint!=null&&addPoint(subPath,[0.5*(ctrlPoint[0]+data[0]),0.5*(ctrlPoint[1]+data[1])]) 6737addPoint(subPath,[0.5*(data[0]+data[2]),0.5*(data[1]+data[3])])
vendor: 6,564 bytes, lines 6738-6870
6738prevCtrlPoint=[data[2]-data[0],data[3]-data[1]] 6739break 6740case"A":if(basePoint!=null){const curves=a2c.apply(0,basePoint.concat(data)) 6741for(var cData;(cData=curves.splice(0,6).map(toAbsolute)).length;){basePoint!=null&&addPoint(subPath,[0.5*(basePoint[0]+cData[0]),0.5*(basePoint[1]+cData[1])]) 6742addPoint(subPath,[0.5*(cData[0]+cData[2]),0.5*(cData[1]+cData[3])]) 6743addPoint(subPath,[0.5*(cData[2]+cData[4]),0.5*(cData[3]+cData[5])]) 6744curves.length&&addPoint(subPath,basePoint=cData.slice(-2))}}break}data.length>=2&&addPoint(subPath,data.slice(-2))}return points}function convexHull(points){points.list.sort((function(a,b){return a[0]==b[0]?a[1]-b[1]:a[0]-b[0]})) 6745const lower=[] 6746let minY=0 6747let bottom=0 6748for(let i=0;i<points.list.length;i++){while(lower.length>=2&&cross(lower[lower.length-2],lower[lower.length-1],points.list[i])<=0)lower.pop() 6749if(points.list[i][1]<points.list[minY][1]){minY=i 6750bottom=lower.length}lower.push(points.list[i])}const upper=[] 6751let maxY=points.list.length-1 6752let top=0 6753for(let i=points.list.length;i--;){while(upper.length>=2&&cross(upper[upper.length-2],upper[upper.length-1],points.list[i])<=0)upper.pop() 6754if(points.list[i][1]>points.list[maxY][1]){maxY=i 6755top=upper.length}upper.push(points.list[i])}upper.pop() 6756lower.pop() 6757const hullList=lower.concat(upper) 6758const hull={list:hullList,minX:0,maxX:lower.length,minY:bottom,maxY:(lower.length+top)%hullList.length} 6759return hull}function cross(o,a,b){return(a[0]-o[0])*(b[1]-o[1])-(a[1]-o[1])*(b[0]-o[0])}const a2c=(x1,y1,rx,ry,angle,large_arc_flag,sweep_flag,x2,y2,recursive)=>{const _120=Math.PI*120/180 6760const rad=Math.PI/180*(+angle||0) 6761let res=[] 6762const rotateX=(x,y,rad)=>x*Math.cos(rad)-y*Math.sin(rad) 6763const rotateY=(x,y,rad)=>x*Math.sin(rad)+y*Math.cos(rad) 6764if(recursive){f1=recursive[0] 6765f2=recursive[1] 6766cx=recursive[2] 6767cy=recursive[3]}else{x1=rotateX(x1,y1,-rad) 6768y1=rotateY(x1,y1,-rad) 6769x2=rotateX(x2,y2,-rad) 6770y2=rotateY(x2,y2,-rad) 6771const x=(x1-x2)/2 6772const y=(y1-y2)/2 6773let h=x*x/(rx*rx)+y*y/(ry*ry) 6774if(h>1){h=Math.sqrt(h) 6775rx*=h 6776ry*=h}const rx2=rx*rx 6777const ry2=ry*ry 6778const k=(large_arc_flag==sweep_flag?-1:1)*Math.sqrt(Math.abs((rx2*ry2-rx2*y*y-ry2*x*x)/(rx2*y*y+ry2*x*x))) 6779var cx=k*rx*y/ry+(x1+x2)/2 6780var cy=k*-ry*x/rx+(y1+y2)/2 6781var f1=Math.asin(Number(((y1-cy)/ry).toFixed(9))) 6782var f2=Math.asin(Number(((y2-cy)/ry).toFixed(9))) 6783f1=x1<cx?Math.PI-f1:f1 6784f2=x2<cx?Math.PI-f2:f2 6785f1<0&&(f1=Math.PI*2+f1) 6786f2<0&&(f2=Math.PI*2+f2) 6787sweep_flag&&f1>f2&&(f1-=Math.PI*2) 6788!sweep_flag&&f2>f1&&(f2-=Math.PI*2)}let df=f2-f1 6789if(Math.abs(df)>_120){const f2old=f2 6790const x2old=x2 6791const y2old=y2 6792f2=f1+_120*(sweep_flag&&f2>f1?1:-1) 6793x2=cx+rx*Math.cos(f2) 6794y2=cy+ry*Math.sin(f2) 6795res=a2c(x2,y2,rx,ry,angle,0,sweep_flag,x2old,y2old,[f2,f2old,cx,cy])}df=f2-f1 6796const c1=Math.cos(f1) 6797const s1=Math.sin(f1) 6798const c2=Math.cos(f2) 6799const s2=Math.sin(f2) 6800const t=Math.tan(df/4) 6801const hx=4/3*rx*t 6802const hy=4/3*ry*t 6803const m=[-hx*s1,hy*c1,x2+hx*s2-x1,y2-hy*c2-y1,x2-x1,y2-y1] 6804if(recursive)return m.concat(res) 6805{res=m.concat(res) 6806const newres=[] 6807for(let i=0,n=res.length;i<n;i++)newres[i]=i%2?rotateY(res[i-1],res[i],rad):rotateX(res[i],res[i+1],rad) 6808return newres}} 6809const transformTypes=new Set(["matrix","rotate","scale","skewX","skewY","translate"]) 6810const regTransformSplit=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/ 6811const regNumericValues$2=/[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g 6812const transform2js=transformString=>{const transforms=[] 6813let currentTransform=null 6814for(const item of transformString.split(regTransformSplit)){if(!item)continue 6815if(transformTypes.has(item)){currentTransform={name:item,data:[]} 6816transforms.push(currentTransform)}else{let num 6817while(num=regNumericValues$2.exec(item)){num=Number(num) 6818currentTransform!=null&¤tTransform.data.push(num)}}}return currentTransform==null||currentTransform.data.length==0?[]:transforms} 6819const transformsMultiply=transforms=>{const matrixData=transforms.map((transform=>{if(transform.name==="matrix")return transform.data 6820return transformToMatrix(transform)})) 6821const matrixTransform={name:"matrix",data:matrixData.length>0?matrixData.reduce(multiplyTransformMatrices):[]} 6822return matrixTransform} 6823const mth={rad:deg=>deg*Math.PI/180,deg:rad=>rad*180/Math.PI,cos:deg=>Math.cos(mth.rad(deg)),acos:(val,floatPrecision)=>toFixed(mth.deg(Math.acos(val)),floatPrecision),sin:deg=>Math.sin(mth.rad(deg)),asin:(val,floatPrecision)=>toFixed(mth.deg(Math.asin(val)),floatPrecision),tan:deg=>Math.tan(mth.rad(deg)),atan:(val,floatPrecision)=>toFixed(mth.deg(Math.atan(val)),floatPrecision)} 6824const getDecompositions=matrix=>{const decompositions=[] 6825const qrab=decomposeQRAB(matrix) 6826const qrcd=decomposeQRCD(matrix) 6827qrab&&decompositions.push(qrab) 6828qrcd&&decompositions.push(qrcd) 6829return decompositions} 6830const decomposeQRAB=matrix=>{const data=matrix.data 6831const[a,b,c,d,e,f]=data 6832const delta=a*d-b*c 6833if(delta===0)return 6834const r=Math.hypot(a,b) 6835if(r===0)return 6836const decomposition=[] 6837const cosOfRotationAngle=a/r;(e||f)&&decomposition.push({name:"translate",data:[e,f]}) 6838if(cosOfRotationAngle!==1){const rotationAngleRads=Math.acos(cosOfRotationAngle) 6839decomposition.push({name:"rotate",data:[mth.deg(b<0?-rotationAngleRads:rotationAngleRads),0,0]})}const sx=r 6840const sy=delta/sx 6841sx===1&&sy===1||decomposition.push({name:"scale",data:[sx,sy]}) 6842const ac_plus_bd=a*c+b*d 6843ac_plus_bd&&decomposition.push({name:"skewX",data:[mth.deg(Math.atan(ac_plus_bd/(a*a+b*b)))]}) 6844return decomposition} 6845const decomposeQRCD=matrix=>{const data=matrix.data 6846const[a,b,c,d,e,f]=data 6847const delta=a*d-b*c 6848if(delta===0)return 6849const s=Math.hypot(c,d) 6850if(s===0)return 6851const decomposition=[];(e||f)&&decomposition.push({name:"translate",data:[e,f]}) 6852const rotationAngleRads=Math.PI/2-(d<0?-1:1)*Math.acos(-c/s) 6853decomposition.push({name:"rotate",data:[mth.deg(rotationAngleRads),0,0]}) 6854const sx=delta/s 6855const sy=s 6856sx===1&&sy===1||decomposition.push({name:"scale",data:[sx,sy]}) 6857const ac_plus_bd=a*c+b*d 6858ac_plus_bd&&decomposition.push({name:"skewY",data:[mth.deg(Math.atan(ac_plus_bd/(c*c+d*d)))]}) 6859return decomposition} 6860const mergeTranslateAndRotate=(tx,ty,a)=>{const rotationAngleRads=mth.rad(a) 6861const d=1-Math.cos(rotationAngleRads) 6862const e=Math.sin(rotationAngleRads) 6863const cy=(d*ty+e*tx)/(d*d+e*e) 6864const cx=(tx-e*cy)/d 6865return{name:"rotate",data:[a,cx,cy]}} 6866const isIdentityTransform=t=>{switch(t.name){case"rotate":case"skewX":case"skewY":return t.data[0]===0 6867case"scale":return t.data[0]===1&&t.data[1]===1 6868case"translate":return t.data[0]===0&&t.data[1]===0}return false} 6869const optimize$1=(roundedTransforms,rawTransforms)=>{const optimizedTransforms=[] 6870for(let index=0;
vendor: 7,431 bytes, lines 6870-6974
6870index<roundedTransforms.length;index++){const roundedTransform=roundedTransforms[index] 6871if(isIdentityTransform(roundedTransform))continue 6872const data=roundedTransform.data 6873switch(roundedTransform.name){case"rotate":switch(data[0]){case 180:case-180:{const next=roundedTransforms[index+1] 6874if(next&&next.name==="scale"){optimizedTransforms.push(createScaleTransform(next.data.map((v=>-v)))) 6875index++}else optimizedTransforms.push({name:"scale",data:[-1]})}continue}optimizedTransforms.push({name:"rotate",data:data.slice(0,data[1]||data[2]?3:1)}) 6876break 6877case"scale":optimizedTransforms.push(createScaleTransform(data)) 6878break 6879case"skewX":case"skewY":optimizedTransforms.push({name:roundedTransform.name,data:[data[0]]}) 6880break 6881case"translate":{const next=roundedTransforms[index+1] 6882if(next&&next.name==="rotate"&&next.data[0]!==180&&next.data[0]!==-180&&next.data[0]!==0&&next.data[1]===0&&next.data[2]===0){const data=rawTransforms[index].data 6883optimizedTransforms.push(mergeTranslateAndRotate(data[0],data[1],rawTransforms[index+1].data[0])) 6884index++ 6885continue}}optimizedTransforms.push({name:"translate",data:data.slice(0,data[1]?2:1)}) 6886break}}return optimizedTransforms.length?optimizedTransforms:[{name:"scale",data:[1]}]} 6887const createScaleTransform=data=>{const scaleData=data.slice(0,data[0]===data[1]?1:2) 6888return{name:"scale",data:scaleData}} 6889const matrixToTransform=(origMatrix,params)=>{const decomposed=getDecompositions(origMatrix) 6890let shortest 6891let shortestLen=Number.MAX_VALUE 6892for(const decomposition of decomposed){const roundedTransforms=decomposition.map((transformItem=>{const transformCopy={name:transformItem.name,data:[...transformItem.data]} 6893return roundTransform(transformCopy,params)})) 6894const optimized=optimize$1(roundedTransforms,decomposition) 6895const len=js2transform(optimized,params).length 6896if(len<shortestLen){shortest=optimized 6897shortestLen=len}}return shortest??[origMatrix]} 6898const transformToMatrix=transform=>{if(transform.name==="matrix")return transform.data 6899switch(transform.name){case"translate":return[1,0,0,1,transform.data[0],transform.data[1]||0] 6900case"scale":return[transform.data[0],0,0,transform.data[1]??transform.data[0],0,0] 6901case"rotate":var cos=mth.cos(transform.data[0]) 6902var sin=mth.sin(transform.data[0]) 6903var cx=transform.data[1]||0 6904var cy=transform.data[2]||0 6905return[cos,sin,-sin,cos,(1-cos)*cx+sin*cy,(1-cos)*cy-sin*cx] 6906case"skewX":return[1,0,mth.tan(transform.data[0]),1,0,0] 6907case"skewY":return[1,mth.tan(transform.data[0]),0,1,0,0] 6908default:throw Error(`Unknown transform ${transform.name}`)}} 6909const transformArc=(cursor,arc,transform)=>{const x=arc[5]-cursor[0] 6910const y=arc[6]-cursor[1] 6911let a=arc[0] 6912let b=arc[1] 6913const rot=arc[2]*Math.PI/180 6914const cos=Math.cos(rot) 6915const sin=Math.sin(rot) 6916if(a>0&&b>0){let h=Math.pow(x*cos+y*sin,2)/(4*a*a)+Math.pow(y*cos-x*sin,2)/(4*b*b) 6917if(h>1){h=Math.sqrt(h) 6918a*=h 6919b*=h}}const ellipse=[a*cos,a*sin,-b*sin,b*cos,0,0] 6920const m=multiplyTransformMatrices(transform,ellipse) 6921const lastCol=m[2]*m[2]+m[3]*m[3] 6922const squareSum=m[0]*m[0]+m[1]*m[1]+lastCol 6923const root=Math.hypot(m[0]-m[3],m[1]+m[2])*Math.hypot(m[0]+m[3],m[1]-m[2]) 6924if(root){const majorAxisSqr=(squareSum+root)/2 6925const minorAxisSqr=(squareSum-root)/2 6926const major=Math.abs(majorAxisSqr-lastCol)>1e-6 6927const sub=(major?majorAxisSqr:minorAxisSqr)-lastCol 6928const rowsSum=m[0]*m[2]+m[1]*m[3] 6929const term1=m[0]*sub+m[2]*rowsSum 6930const term2=m[1]*sub+m[3]*rowsSum 6931arc[0]=Math.sqrt(majorAxisSqr) 6932arc[1]=Math.sqrt(minorAxisSqr) 6933arc[2]=((major?term2<0:term1>0)?-1:1)*Math.acos((major?term1:term2)/Math.hypot(term1,term2))*180/Math.PI}else{arc[0]=arc[1]=Math.sqrt(squareSum/2) 6934arc[2]=0}transform[0]<0!==transform[3]<0&&(arc[4]=1-arc[4]) 6935return arc} 6936const multiplyTransformMatrices=(a,b)=>[a[0]*b[0]+a[2]*b[1],a[1]*b[0]+a[3]*b[1],a[0]*b[2]+a[2]*b[3],a[1]*b[2]+a[3]*b[3],a[0]*b[4]+a[2]*b[5]+a[4],a[1]*b[4]+a[3]*b[5]+a[5]] 6937const roundTransform=(transform,params)=>{switch(transform.name){case"translate":transform.data=floatRound(transform.data,params) 6938break 6939case"rotate":transform.data=[...degRound(transform.data.slice(0,1),params),...floatRound(transform.data.slice(1),params)] 6940break 6941case"skewX":case"skewY":transform.data=degRound(transform.data,params) 6942break 6943case"scale":transform.data=transformRound(transform.data,params) 6944break 6945case"matrix":transform.data=[...transformRound(transform.data.slice(0,4),params),...floatRound(transform.data.slice(4),params)] 6946break}return transform} 6947const degRound=(data,params)=>params.degPrecision!=null&¶ms.degPrecision>=1&¶ms.floatPrecision<20?smartRound(params.degPrecision,data):round$1(data) 6948const floatRound=(data,params)=>params.floatPrecision>=1&¶ms.floatPrecision<20?smartRound(params.floatPrecision,data):round$1(data) 6949const transformRound=(data,params)=>params.transformPrecision>=1&¶ms.floatPrecision<20?smartRound(params.transformPrecision,data):round$1(data) 6950const round$1=data=>data.map(Math.round) 6951const smartRound=(precision,data)=>{for(let i=data.length,tolerance=+Math.pow(0.1,precision).toFixed(precision);i--;)if(toFixed(data[i],precision)!==data[i]){const rounded=+data[i].toFixed(precision-1) 6952data[i]=+Math.abs(rounded-data[i]).toFixed(precision+1)>=tolerance?+data[i].toFixed(precision):rounded}return data} 6953const js2transform=(transformJS,params)=>{const transformString=transformJS.map((transform=>{roundTransform(transform,params) 6954return`${transform.name}(${cleanupOutData(transform.data,params)})`})).join("") 6955return transformString} 6956const regNumericValues$1=/[-+]?(\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g 6957const applyTransforms=(root,params)=>{const stylesheet=collectStylesheet(root) 6958return{element:{enter:node=>{if(node.attributes.d==null)return 6959if(node.attributes.id!=null)return 6960if(node.attributes.transform==null||node.attributes.transform===""||node.attributes.style!=null||Object.entries(node.attributes).some((([name,value])=>referencesProps.has(name)&&includesUrlReference(value))))return 6961const computedStyle=computeStyle(stylesheet,node) 6962const transformStyle=computedStyle.transform 6963if(transformStyle.type==="static"&&transformStyle.value!==node.attributes.transform)return 6964const matrix=transformsMultiply(transform2js(node.attributes.transform)) 6965const stroke=computedStyle.stroke?.type==="static"?computedStyle.stroke.value:null 6966const strokeWidth=computedStyle["stroke-width"]?.type==="static"?computedStyle["stroke-width"].value:null 6967const transformPrecision=params.transformPrecision 6968if(computedStyle.stroke?.type==="dynamic"||computedStyle["stroke-width"]?.type==="dynamic")return 6969const scale=Number(Math.hypot(matrix.data[0],matrix.data[1]).toFixed(transformPrecision)) 6970if(stroke&&stroke!="none"){if(!params.applyTransformsStroked)return 6971if((matrix.data[0]!==matrix.data[3]||matrix.data[1]!==-matrix.data[2])&&(matrix.data[0]!==-matrix.data[3]||matrix.data[1]!==matrix.data[2]))return 6972if(scale!==1&&node.attributes["vector-effect"]!=="non-scaling-stroke"){node.attributes["stroke-width"]=(strokeWidth||attrsGroupsDefaults.presentation["stroke-width"]).trim().replace(regNumericValues$1,(num=>removeLeadingZero(Number(num)*scale))) 6973node.attributes["stroke-dashoffset"]!=null&&(node.attributes["stroke-dashoffset"]=node.attributes["stroke-dashoffset"].trim().replace(regNumericValues$1,(num=>removeLeadingZero(Number(num)*scale)))) 6974node.attributes["stroke-dasharray"]!=null&&(node.attributes["stroke-dasharray"]=node.attributes["stroke-dasharray"].trim().replace(regNumericValues$1,(num=>removeLeadingZero(Number(num)*scale)
vendor: 6,191 bytes, lines 6974-7106
6974)))}}const pathData=path2js(node) 6975applyMatrixToPathData(pathData,matrix.data) 6976delete node.attributes.transform}}}} 6977const transformAbsolutePoint=(matrix,x,y)=>{const newX=matrix[0]*x+matrix[2]*y+matrix[4] 6978const newY=matrix[1]*x+matrix[3]*y+matrix[5] 6979return[newX,newY]} 6980const transformRelativePoint=(matrix,x,y)=>{const newX=matrix[0]*x+matrix[2]*y 6981const newY=matrix[1]*x+matrix[3]*y 6982return[newX,newY]} 6983const applyMatrixToPathData=(pathData,matrix)=>{const start=[0,0] 6984const cursor=[0,0] 6985for(const pathItem of pathData){let{command:command,args:args}=pathItem 6986if(command==="M"){cursor[0]=args[0] 6987cursor[1]=args[1] 6988start[0]=cursor[0] 6989start[1]=cursor[1] 6990const[x,y]=transformAbsolutePoint(matrix,args[0],args[1]) 6991args[0]=x 6992args[1]=y}if(command==="m"){cursor[0]+=args[0] 6993cursor[1]+=args[1] 6994start[0]=cursor[0] 6995start[1]=cursor[1] 6996const[x,y]=transformRelativePoint(matrix,args[0],args[1]) 6997args[0]=x 6998args[1]=y}if(command==="H"){command="L" 6999args=[args[0],cursor[1]]}if(command==="h"){command="l" 7000args=[args[0],0]}if(command==="V"){command="L" 7001args=[cursor[0],args[0]]}if(command==="v"){command="l" 7002args=[0,args[0]]}if(command==="L"){cursor[0]=args[0] 7003cursor[1]=args[1] 7004const[x,y]=transformAbsolutePoint(matrix,args[0],args[1]) 7005args[0]=x 7006args[1]=y}if(command==="l"){cursor[0]+=args[0] 7007cursor[1]+=args[1] 7008const[x,y]=transformRelativePoint(matrix,args[0],args[1]) 7009args[0]=x 7010args[1]=y}if(command==="C"){cursor[0]=args[4] 7011cursor[1]=args[5] 7012const[x1,y1]=transformAbsolutePoint(matrix,args[0],args[1]) 7013const[x2,y2]=transformAbsolutePoint(matrix,args[2],args[3]) 7014const[x,y]=transformAbsolutePoint(matrix,args[4],args[5]) 7015args[0]=x1 7016args[1]=y1 7017args[2]=x2 7018args[3]=y2 7019args[4]=x 7020args[5]=y}if(command==="c"){cursor[0]+=args[4] 7021cursor[1]+=args[5] 7022const[x1,y1]=transformRelativePoint(matrix,args[0],args[1]) 7023const[x2,y2]=transformRelativePoint(matrix,args[2],args[3]) 7024const[x,y]=transformRelativePoint(matrix,args[4],args[5]) 7025args[0]=x1 7026args[1]=y1 7027args[2]=x2 7028args[3]=y2 7029args[4]=x 7030args[5]=y}if(command==="S"){cursor[0]=args[2] 7031cursor[1]=args[3] 7032const[x2,y2]=transformAbsolutePoint(matrix,args[0],args[1]) 7033const[x,y]=transformAbsolutePoint(matrix,args[2],args[3]) 7034args[0]=x2 7035args[1]=y2 7036args[2]=x 7037args[3]=y}if(command==="s"){cursor[0]+=args[2] 7038cursor[1]+=args[3] 7039const[x2,y2]=transformRelativePoint(matrix,args[0],args[1]) 7040const[x,y]=transformRelativePoint(matrix,args[2],args[3]) 7041args[0]=x2 7042args[1]=y2 7043args[2]=x 7044args[3]=y}if(command==="Q"){cursor[0]=args[2] 7045cursor[1]=args[3] 7046const[x1,y1]=transformAbsolutePoint(matrix,args[0],args[1]) 7047const[x,y]=transformAbsolutePoint(matrix,args[2],args[3]) 7048args[0]=x1 7049args[1]=y1 7050args[2]=x 7051args[3]=y}if(command==="q"){cursor[0]+=args[2] 7052cursor[1]+=args[3] 7053const[x1,y1]=transformRelativePoint(matrix,args[0],args[1]) 7054const[x,y]=transformRelativePoint(matrix,args[2],args[3]) 7055args[0]=x1 7056args[1]=y1 7057args[2]=x 7058args[3]=y}if(command==="T"){cursor[0]=args[0] 7059cursor[1]=args[1] 7060const[x,y]=transformAbsolutePoint(matrix,args[0],args[1]) 7061args[0]=x 7062args[1]=y}if(command==="t"){cursor[0]+=args[0] 7063cursor[1]+=args[1] 7064const[x,y]=transformRelativePoint(matrix,args[0],args[1]) 7065args[0]=x 7066args[1]=y}if(command==="A"){transformArc(cursor,args,matrix) 7067cursor[0]=args[5] 7068cursor[1]=args[6] 7069if(Math.abs(args[2])>80){const a=args[0] 7070const rotation=args[2] 7071args[0]=args[1] 7072args[1]=a 7073args[2]=rotation+(rotation>0?-90:90)}const[x,y]=transformAbsolutePoint(matrix,args[5],args[6]) 7074args[5]=x 7075args[6]=y}if(command==="a"){transformArc([0,0],args,matrix) 7076cursor[0]+=args[5] 7077cursor[1]+=args[6] 7078if(Math.abs(args[2])>80){const a=args[0] 7079const rotation=args[2] 7080args[0]=args[1] 7081args[1]=a 7082args[2]=rotation+(rotation>0?-90:90)}const[x,y]=transformRelativePoint(matrix,args[5],args[6]) 7083args[5]=x 7084args[6]=y}if(command==="z"||command==="Z"){cursor[0]=start[0] 7085cursor[1]=start[1]}pathItem.command=command 7086pathItem.args=args}} 7087const name$r="convertPathData" 7088const description$r="optimizes path data: writes in shorter form, applies transformations" 7089let roundData 7090let precision 7091let error 7092let arcThreshold 7093let arcTolerance 7094const fn$r=(root,params)=>{const{applyTransforms:_applyTransforms=true,applyTransformsStroked:applyTransformsStroked=true,makeArcs:makeArcs={threshold:2.5,tolerance:0.5},straightCurves:straightCurves=true,convertToQ:convertToQ=true,lineShorthands:lineShorthands=true,convertToZ:convertToZ=true,curveSmoothShorthands:curveSmoothShorthands=true,floatPrecision:floatPrecision=3,transformPrecision:transformPrecision=5,smartArcRounding:smartArcRounding=true,removeUseless:removeUseless=true,collapseRepeated:collapseRepeated=true,utilizeAbsolute:utilizeAbsolute=true,leadingZero:leadingZero=true,negativeExtraSpace:negativeExtraSpace=true,noSpaceAfterFlags:noSpaceAfterFlags=false,forceAbsolutePath:forceAbsolutePath=false}=params 7095const newParams={applyTransforms:_applyTransforms,applyTransformsStroked:applyTransformsStroked,makeArcs:makeArcs,straightCurves:straightCurves,convertToQ:convertToQ,lineShorthands:lineShorthands,convertToZ:convertToZ,curveSmoothShorthands:curveSmoothShorthands,floatPrecision:floatPrecision,transformPrecision:transformPrecision,smartArcRounding:smartArcRounding,removeUseless:removeUseless,collapseRepeated:collapseRepeated,utilizeAbsolute:utilizeAbsolute,leadingZero:leadingZero,negativeExtraSpace:negativeExtraSpace,noSpaceAfterFlags:noSpaceAfterFlags,forceAbsolutePath:forceAbsolutePath} 7096_applyTransforms&&visit(root,applyTransforms(root,{transformPrecision:transformPrecision,applyTransformsStroked:applyTransformsStroked})) 7097const stylesheet=collectStylesheet(root) 7098return{element:{enter:node=>{if(pathElems.has(node.name)&&node.attributes.d!=null){const computedStyle=computeStyle(stylesheet,node) 7099precision=floatPrecision 7100error=precision!==false?+Math.pow(0.1,precision).toFixed(precision):1e-2 7101roundData=precision&&precision>0&&precision<20?strongRound:round 7102if(makeArcs){arcThreshold=makeArcs.threshold 7103arcTolerance=makeArcs.tolerance}const hasMarkerMid=computedStyle["marker-mid"]!=null 7104const maybeHasStroke=computedStyle.stroke&&(computedStyle.stroke.type==="dynamic"||computedStyle.stroke.value!=="none") 7105const maybeHasLinecap=computedStyle["stroke-linecap"]&&(computedStyle["stroke-linecap"].type==="dynamic"||computedStyle["stroke-linecap"].value!=="butt") 7106const
7106maybeHasStrokeAndLinecap=maybeHasStroke&&maybeHasLinecap 7107const isSafeToUseZ=!maybeHasStroke||computedStyle["stroke-linecap"]?.type==="static"&&computedStyle["stroke-linecap"].value==="round"&&computedStyle["stroke-linejoin"]?.type==="static"&&computedStyle["stroke-linejoin"].value==="round" 7108let data=path2js(node) 7109if(data.length){const includesVertices=data.some((item=>item.command!=="m"&&item.command!=="M")) 7110convertToRelative(data) 7111data=filters(data,newParams,{isSafeToUseZ:isSafeToUseZ,maybeHasStrokeAndLinecap:maybeHasStrokeAndLinecap,hasMarkerMid:hasMarkerMid}) 7112utilizeAbsolute&&(data=convertToMixed(data,newParams)) 7113const hasMarker=node.attributes["marker-start"]!=null||node.attributes["marker-end"]!=null 7114const isMarkersOnlyPath=hasMarker&&includesVertices&&data.every((item=>item.command==="m"||item.command==="M")) 7115isMarkersOnlyPath&&data.push({command:"z",args:[]}) 7116js2path(node,data,newParams)}}}}}} 7117const convertToRelative=pathData=>{const start=[0,0] 7118const cursor=[0,0] 7119let prevCoords=[0,0] 7120for(let i=0;i<pathData.length;i+=1){const pathItem=pathData[i] 7121let{command:command,args:args}=pathItem 7122if(command==="m"){cursor[0]+=args[0] 7123cursor[1]+=args[1] 7124start[0]=cursor[0] 7125start[1]=cursor[1]}if(command==="M"){i!==0&&(command="m") 7126args[0]-=cursor[0] 7127args[1]-=cursor[1] 7128cursor[0]+=args[0] 7129cursor[1]+=args[1] 7130start[0]=cursor[0] 7131start[1]=cursor[1]}if(command==="l"){cursor[0]+=args[0] 7132cursor[1]+=args[1]}if(command==="L"){command="l" 7133args[0]-=cursor[0] 7134args[1]-=cursor[1] 7135cursor[0]+=args[0] 7136cursor[1]+=args[1]}command==="h"&&(cursor[0]+=args[0]) 7137if(command==="H"){command="h" 7138args[0]-=cursor[0] 7139cursor[0]+=args[0]}command==="v"&&(cursor[1]+=args[0]) 7140if(command==="V"){command="v" 7141args[0]-=cursor[1] 7142cursor[1]+=args[0]}if(command==="c"){cursor[0]+=args[4] 7143cursor[1]+=args[5]}if(command==="C"){command="c" 7144args[0]-=cursor[0] 7145args[1]-=cursor[1] 7146args[2]-=cursor[0] 7147args[3]-=cursor[1] 7148args[4]-=cursor[0] 7149args[5]-=cursor[1] 7150cursor[0]+=args[4] 7151cursor[1]+=args[5]}if(command==="s"){cursor[0]+=args[2] 7152cursor[1]+=args[3]}if(command==="S"){command="s" 7153args[0]-=cursor[0] 7154args[1]-=cursor[1] 7155args[2]-=cursor[0] 7156args[3]-=cursor[1] 7157cursor[0]+=args[2] 7158cursor[1]+=args[3]}if(command==="q"){cursor[0]+=args[2] 7159cursor[1]+=args[3]}if(command==="Q"){command="q" 7160args[0]-=cursor[0] 7161args[1]-=cursor[1] 7162args[2]-=cursor[0] 7163args[3]-=cursor[1] 7164cursor[0]+=args[2] 7165cursor[1]+=args[3]}if(command==="t"){cursor[0]+=args[0] 7166cursor[1]+=args[1]}if(command==="T"){command="t" 7167args[0]-=cursor[0] 7168args[1]-=cursor[1] 7169cursor[0]+=args[0] 7170cursor[1]+=args[1]}if(command==="a"){cursor[0]+=args[5] 7171cursor[1]+=args[6]}if(command==="A"){command="a" 7172args[5]-=cursor[0] 7173args[6]-=cursor[1] 7174cursor[0]+=args[5] 7175cursor[1]+=args[6]}if(command==="Z"||command==="z"){cursor[0]=start[0] 7176cursor[1]=start[1]}pathItem.command=command 7177pathItem.args=args 7178pathItem.base=prevCoords 7179pathItem.coords=[cursor[0],cursor[1]] 7180prevCoords=pathItem.coords}return pathData} 7181function filters(path,params,{isSafeToUseZ:isSafeToUseZ,maybeHasStrokeAndLinecap:maybeHasStrokeAndLinecap,hasMarkerMid:hasMarkerMid}){const stringify=data2Path.bind(null,params) 7182const relSubpoint=[0,0] 7183const pathBase=[0,0] 7184let prev={} 7185let prevQControlPoint 7186path=path.filter((function(item,index,path){const qControlPoint=prevQControlPoint 7187let command=item.command 7188let data=item.args 7189let next=path[index+1] 7190if(command!=="Z"&&command!=="z"){let sdata=data 7191let circle 7192if(command==="s"){sdata=[0,0].concat(data) 7193const pdata=prev.args 7194const n=pdata.length 7195sdata[0]=pdata[n-2]-pdata[n-4] 7196sdata[1]=pdata[n-1]-pdata[n-3]}if(params.makeArcs&&(command=="c"||command=="s")&&isConvex(sdata)&&(circle=findCircle(sdata))){const r=roundData([circle.radius])[0] 7197let angle=findArcAngle(sdata,circle) 7198const sweep=sdata[5]*sdata[0]-sdata[4]*sdata[1]>0?1:0 7199let arc={command:"a",args:[r,r,0,0,sweep,sdata[4],sdata[5]],coords:item.coords.slice(),base:item.base} 7200const output=[arc] 7201const relCenter=[circle.center[0]-sdata[4],circle.center[1]-sdata[5]]
vendor: 10,641 bytes, lines 7202-7356
7202const relCircle={center:relCenter,radius:circle.radius} 7203const arcCurves=[item] 7204let hasPrev=0 7205let suffix="" 7206let nextLonghand 7207if(prev.command=="c"&&isConvex(prev.args)&&isArcPrev(prev.args,circle)||prev.command=="a"&&prev.sdata&&isArcPrev(prev.sdata,circle)){arcCurves.unshift(prev) 7208arc.base=prev.base 7209arc.args[5]=arc.coords[0]-arc.base[0] 7210arc.args[6]=arc.coords[1]-arc.base[1] 7211const prevData=prev.command=="a"?prev.sdata:prev.args 7212const prevAngle=findArcAngle(prevData,{center:[prevData[4]+circle.center[0],prevData[5]+circle.center[1]],radius:circle.radius}) 7213angle+=prevAngle 7214angle>Math.PI&&(arc.args[3]=1) 7215hasPrev=1}for(var j=index;(next=path[++j])&&(next.command==="c"||next.command==="s");){let nextData=next.args 7216if(next.command=="s"){nextLonghand=makeLonghand({command:"s",args:next.args.slice()},path[j-1].args) 7217nextData=nextLonghand.args 7218nextLonghand.args=nextData.slice(0,2) 7219suffix=stringify([nextLonghand])}if(!isConvex(nextData)||!isArc(nextData,relCircle))break 7220angle+=findArcAngle(nextData,relCircle) 7221if(angle-2*Math.PI>1e-3)break 7222angle>Math.PI&&(arc.args[3]=1) 7223arcCurves.push(next) 7224if(!(2*Math.PI-angle>1e-3)){arc.args[5]=2*(relCircle.center[0]-nextData[4]) 7225arc.args[6]=2*(relCircle.center[1]-nextData[5]) 7226arc.coords=[arc.base[0]+arc.args[5],arc.base[1]+arc.args[6]] 7227arc={command:"a",args:[r,r,0,0,sweep,next.coords[0]-arc.coords[0],next.coords[1]-arc.coords[1]],coords:next.coords,base:arc.coords} 7228output.push(arc) 7229j++ 7230break}arc.coords=next.coords 7231arc.args[5]=arc.coords[0]-arc.base[0] 7232arc.args[6]=arc.coords[1]-arc.base[1] 7233relCenter[0]-=nextData[4] 7234relCenter[1]-=nextData[5]}if((stringify(output)+suffix).length<stringify(arcCurves).length){path[j]&&path[j].command=="s"&&makeLonghand(path[j],path[j-1].args) 7235if(hasPrev){const prevArc=output.shift() 7236roundData(prevArc.args) 7237relSubpoint[0]+=prevArc.args[5]-prev.args[prev.args.length-2] 7238relSubpoint[1]+=prevArc.args[6]-prev.args[prev.args.length-1] 7239prev.command="a" 7240prev.args=prevArc.args 7241item.base=prev.coords=prevArc.coords}arc=output.shift() 7242arcCurves.length==1?item.sdata=sdata.slice():arcCurves.length-1-hasPrev>0&&path.splice(index+1,arcCurves.length-1-hasPrev,...output) 7243if(!arc)return false 7244command="a" 7245data=arc.args 7246item.coords=arc.coords}}if(precision!==false){if(command==="m"||command==="l"||command==="t"||command==="q"||command==="s"||command==="c")for(let i=data.length;i--;)data[i]+=item.base[i%2]-relSubpoint[i%2] 7247else if(command=="h")data[0]+=item.base[0]-relSubpoint[0] 7248else if(command=="v")data[0]+=item.base[1]-relSubpoint[1] 7249else if(command=="a"){data[5]+=item.base[0]-relSubpoint[0] 7250data[6]+=item.base[1]-relSubpoint[1]}roundData(data) 7251if(command=="h")relSubpoint[0]+=data[0] 7252else if(command=="v")relSubpoint[1]+=data[0] 7253else{relSubpoint[0]+=data[data.length-2] 7254relSubpoint[1]+=data[data.length-1]}roundData(relSubpoint) 7255if(command==="M"||command==="m"){pathBase[0]=relSubpoint[0] 7256pathBase[1]=relSubpoint[1]}}const sagitta=command==="a"?calculateSagitta(data):void 0 7257if(params.smartArcRounding&&sagitta!==void 0&&precision)for(let precisionNew=precision;precisionNew>=0;precisionNew--){const radius=toFixed(data[0],precisionNew) 7258const sagittaNew=calculateSagitta([radius,radius,...data.slice(2)]) 7259if(!(Math.abs(sagitta-sagittaNew)<error))break 7260data[0]=radius 7261data[1]=radius}if(params.straightCurves)if(command==="c"&&isCurveStraightLine(data)||command==="s"&&isCurveStraightLine(sdata)){next&&next.command=="s"&&makeLonghand(next,data) 7262command="l" 7263data=data.slice(-2)}else if(command==="q"&&isCurveStraightLine(data)){next&&next.command=="t"&&makeLonghand(next,data) 7264command="l" 7265data=data.slice(-2)}else if(command==="t"&&prev.command!=="q"&&prev.command!=="t"){command="l" 7266data=data.slice(-2)}else if(command==="a"&&(data[0]===0||data[1]===0||sagitta!==void 0&&sagitta<error)){command="l" 7267data=data.slice(-2)}if(params.convertToQ&&command=="c"){const x1=0.75*(item.base[0]+data[0])-0.25*item.base[0] 7268const x2=0.75*(item.base[0]+data[2])-0.25*(item.base[0]+data[4]) 7269if(Math.abs(x1-x2)<error*2){const y1=0.75*(item.base[1]+data[1])-0.25*item.base[1] 7270const y2=0.75*(item.base[1]+data[3])-0.25*(item.base[1]+data[5]) 7271if(Math.abs(y1-y2)<error*2){const newData=data.slice() 7272newData.splice(0,4,x1+x2-item.base[0],y1+y2-item.base[1]) 7273roundData(newData) 7274const originalLength=cleanupOutData(data,params).length 7275const newLength=cleanupOutData(newData,params).length 7276if(newLength<originalLength){command="q" 7277data=newData 7278next&&next.command=="s"&&makeLonghand(next,data)}}}}if(params.lineShorthands&&command==="l")if(data[1]===0){command="h" 7279data.pop()}else if(data[0]===0){command="v" 7280data.shift()}if(params.collapseRepeated&&hasMarkerMid===false&&(command==="m"||command==="h"||command==="v")&&prev.command&&command==prev.command.toLowerCase()&&(command!="h"&&command!="v"||prev.args[0]>=0==data[0]>=0)){prev.args[0]+=data[0] 7281command!="h"&&command!="v"&&(prev.args[1]+=data[1]) 7282prev.coords=item.coords 7283path[index]=prev 7284return false}if(params.curveSmoothShorthands&&prev.command)if(command==="c"){if(prev.command==="c"&&Math.abs(data[0]- -(prev.args[2]-prev.args[4]))<error&&Math.abs(data[1]- -(prev.args[3]-prev.args[5]))<error){command="s" 7285data=data.slice(2)}else if(prev.command==="s"&&Math.abs(data[0]- -(prev.args[0]-prev.args[2]))<error&&Math.abs(data[1]- -(prev.args[1]-prev.args[3]))<error){command="s" 7286data=data.slice(2)}else if(prev.command!=="c"&&prev.command!=="s"&&Math.abs(data[0])<error&&Math.abs(data[1])<error){command="s" 7287data=data.slice(2)}}else if(command==="q")if(prev.command==="q"&&Math.abs(data[0]-(prev.args[2]-prev.args[0]))<error&&Math.abs(data[1]-(prev.args[3]-prev.args[1]))<error){command="t" 7288data=data.slice(2)}else if(prev.command==="t"){const predictedControlPoint=reflectPoint(qControlPoint,item.base) 7289const realControlPoint=[data[0]+item.base[0],data[1]+item.base[1]] 7290if(Math.abs(predictedControlPoint[0]-realControlPoint[0])<error&&Math.abs(predictedControlPoint[1]-realControlPoint[1])<error){command="t" 7291data=data.slice(2)}}if(params.removeUseless&&!maybeHasStrokeAndLinecap){if((command==="l"||command==="h"||command==="v"||command==="q"||command==="t"||command==="c"||command==="s")&&data.every((function(i){return i===0}))){path[index]=prev 7292return false}if(command==="a"&&data[5]===0&&data[6]===0){path[index]=prev 7293return false}}if(params.convertToZ&&(isSafeToUseZ||next?.command==="Z"||next?.command==="z")&&(command==="l"||command==="h"||command==="v")&&Math.abs(pathBase[0]-item.coords[0])<error&&Math.abs(pathBase[1]-item.coords[1])<error){command="z" 7294data=[]}item.command=command 7295item.args=data}else{relSubpoint[0]=pathBase[0] 7296relSubpoint[1]=pathBase[1] 7297if(prev.command==="Z"||prev.command==="z")return false}if((command==="Z"||command==="z")&¶ms.removeUseless&&isSafeToUseZ&&Math.abs(item.base[0]-item.coords[0])<error/10&&Math.abs(item.base[1]-item.coords[1])<error/10)return false 7298prevQControlPoint=command==="q"?[data[0]+item.base[0],data[1]+item.base[1]]:command==="t"?qControlPoint?reflectPoint(qControlPoint,item.base):item.coords:void 0 7299prev=item 7300return true})) 7301return path}function convertToMixed(path,params){let prev=path[0] 7302path=path.filter((function(item,index){if(index==0)return true 7303if(item.command==="Z"||item.command==="z"){prev=item 7304return true}const command=item.command 7305const data=item.args 7306const adata=data.slice() 7307const rdata=data.slice() 7308if(command==="m"||command==="l"||command==="t"||command==="q"||command==="s"||command==="c")for(let i=adata.length;i--;)adata[i]+=item.base[i%2] 7309else if(command=="h")adata[0]+=item.base[0] 7310else if(command=="v")adata[0]+=item.base[1] 7311else if(command=="a"){adata[5]+=item.base[0] 7312adata[6]+=item.base[1]}roundData(adata) 7313roundData(rdata) 7314const absoluteDataStr=cleanupOutData(adata,params) 7315const relativeDataStr=cleanupOutData(rdata,params) 7316if(params.forceAbsolutePath||absoluteDataStr.length<relativeDataStr.length&&!(params.negativeExtraSpace&&command==prev.command&&prev.command.charCodeAt(0)>96&&absoluteDataStr.length==relativeDataStr.length-1&&(data[0]<0||Math.floor(data[0])===0&&!Number.isInteger(data[0])&&prev.args[prev.args.length-1]%1))){item.command=command.toUpperCase() 7317item.args=adata}prev=item 7318return true})) 7319return path}function isConvex(data){const center=getIntersection([0,0,data[2],data[3],data[0],data[1],data[4],data[5]]) 7320return center!=null&&data[2]<center[0]==center[0]<0&&data[3]<center[1]==center[1]<0&&data[4]<center[0]==center[0]<data[0]&&data[5]<center[1]==center[1]<data[1]}function getIntersection(coords){const a1=coords[1]-coords[3] 7321const b1=coords[2]-coords[0] 7322const c1=coords[0]*coords[3]-coords[2]*coords[1] 7323const a2=coords[5]-coords[7] 7324const b2=coords[6]-coords[4] 7325const c2=coords[4]*coords[7]-coords[5]*coords[6] 7326const denom=a1*b2-a2*b1 7327if(!denom)return 7328const cross=[(b1*c2-b2*c1)/denom,(a1*c2-a2*c1)/-denom] 7329if(!isNaN(cross[0])&&!isNaN(cross[1])&&isFinite(cross[0])&&isFinite(cross[1]))return cross}function strongRound(data){const precisionNum=precision||0 7330for(let i=data.length;i-- >0;){const fixed=toFixed(data[i],precisionNum) 7331if(fixed!==data[i]){const rounded=toFixed(data[i],precisionNum-1) 7332data[i]=toFixed(Math.abs(rounded-data[i]),precisionNum+1)>=error?fixed:rounded}}return data}function round(data){for(let i=data.length;i-- >0;)data[i]=Math.round(data[i]) 7333return data}function isCurveStraightLine(data){let i=data.length-2 7334const a=-data[i+1] 7335const b=data[i] 7336const d=1/(a*a+b*b) 7337if(i<=1||!isFinite(d))return false 7338while((i-=2)>=0)if(Math.sqrt(Math.pow(a*data[i]+b*data[i+1],2)*d)>error)return false 7339return true}function calculateSagitta(data){if(data[3]===1)return 7340const[rx,ry]=data 7341if(Math.abs(rx-ry)>error)return 7342const chord=Math.hypot(data[5],data[6]) 7343if(chord>rx*2)return 7344return rx-Math.sqrt(rx**2-0.25*chord**2)}function makeLonghand(item,data){switch(item.command){case"s":item.command="c" 7345break 7346case"t":item.command="q" 7347break}item.args.unshift(data[data.length-2]-data[data.length-4],data[data.length-1]-data[data.length-3]) 7348return item}function getDistance(point1,point2){return Math.hypot(point1[0]-point2[0],point1[1]-point2[1])}function reflectPoint(controlPoint,base){return[2*base[0]-controlPoint[0],2*base[1]-controlPoint[1]]}function getCubicBezierPoint(curve,t){const sqrT=t*t 7349const cubT=sqrT*t 7350const mt=1-t 7351const sqrMt=mt*mt 7352return[3*sqrMt*t*curve[0]+3*mt*sqrT*curve[2]+cubT*curve[4],3*sqrMt*t*curve[1]+3*mt*sqrT*curve[3]+cubT*curve[5]]}function findCircle(curve){const midPoint=getCubicBezierPoint(curve,.5) 7353const m1=[midPoint[0]/2,midPoint[1]/2] 7354const m2=[(midPoint[0]+curve[4])/2,(midPoint[1]+curve[5])/2] 7355const center=getIntersection([m1[0],m1[1],m1[0]+m1[1],m1[1]-m1[0],m2[0],m2[1],m2[0]+(m2[1]-midPoint[1]),m2[1]-(m2[0]-midPoint[0])]) 7356const radius=center&&getDistance([0,0],center)
7357const tolerance=Math.min(arcThreshold*error,arcTolerance*radius/100) 7358if(center&&radius<1e15&&[1/4,3/4].every((function(point){return Math.abs(getDistance(getCubicBezierPoint(curve,point),center)-radius)<=tolerance})))return{center:center,radius:radius}}function isArc(curve,circle){const tolerance=Math.min(arcThreshold*error,arcTolerance*circle.radius/100) 7359return[0,1/4,.5,3/4,1].every((function(point){return Math.abs(getDistance(getCubicBezierPoint(curve,point),circle.center)-circle.radius)<=tolerance}))}function isArcPrev(curve,circle){return isArc(curve,{center:[circle.center[0]+curve[4],circle.center[1]+curve[5]],radius:circle.radius})}function findArcAngle(curve,relCircle){const x1=-relCircle.center[0] 7360const y1=-relCircle.center[1] 7361const x2=curve[4]-relCircle.center[0] 7362const y2=curve[5]-relCircle.center[1] 7363return Math.acos((x1*x2+y1*y2)/Math.sqrt((x1*x1+y1*y1)*(x2*x2+y2*y2)))}function data2Path(params,pathData){return pathData.reduce((function(pathString,item){let strData="" 7364item.args&&(strData=cleanupOutData(roundData(item.args.slice()),params)) 7365return pathString+item.command+strData}),"")}var convertPathData=Object.freeze({__proto__:null,description:description$r,fn:fn$r,name:name$r}) 7366const name$q="convertTransform" 7367const description$q="collapses multiple transformations and optimizes it" 7368const fn$q=(_root,params)=>{const{convertToShorts:convertToShorts=true,degPrecision:degPrecision,floatPrecision:floatPrecision=3,transformPrecision:transformPrecision=5,matrixToTransform:matrixToTransform=true,shortTranslate:shortTranslate=true,shortScale:shortScale=true,shortRotate:sh
vendor: 10,378 bytes, lines 7368-7490
7368ortRotate=true,removeUseless:removeUseless=true,collapseIntoOne:collapseIntoOne=true,leadingZero:leadingZero=true,negativeExtraSpace:negativeExtraSpace=false}=params 7369const newParams={convertToShorts:convertToShorts,degPrecision:degPrecision,floatPrecision:floatPrecision,transformPrecision:transformPrecision,matrixToTransform:matrixToTransform,shortTranslate:shortTranslate,shortScale:shortScale,shortRotate:shortRotate,removeUseless:removeUseless,collapseIntoOne:collapseIntoOne,leadingZero:leadingZero,negativeExtraSpace:negativeExtraSpace} 7370return{element:{enter:node=>{node.attributes.transform!=null&&convertTransform(node,"transform",newParams) 7371node.attributes.gradientTransform!=null&&convertTransform(node,"gradientTransform",newParams) 7372node.attributes.patternTransform!=null&&convertTransform(node,"patternTransform",newParams)}}}} 7373const convertTransform=(item,attrName,params)=>{let data=transform2js(item.attributes[attrName]) 7374params=definePrecision(data,params) 7375params.collapseIntoOne&&data.length>1&&(data=[transformsMultiply(data)]) 7376params.convertToShorts?data=convertToShorts(data,params):data.forEach((item=>roundTransform(item,params))) 7377params.removeUseless&&(data=removeUseless(data)) 7378data.length?item.attributes[attrName]=js2transform(data,params):delete item.attributes[attrName]} 7379const definePrecision=(data,{...newParams})=>{const matrixData=[] 7380for(const item of data)item.name=="matrix"&&matrixData.push(...item.data.slice(0,4)) 7381let numberOfDigits=newParams.transformPrecision 7382if(matrixData.length){newParams.transformPrecision=Math.min(newParams.transformPrecision,Math.max.apply(Math,matrixData.map(floatDigits))||newParams.transformPrecision) 7383numberOfDigits=Math.max.apply(Math,matrixData.map((n=>n.toString().replace(/\D+/g,"").length)))}newParams.degPrecision==null&&(newParams.degPrecision=Math.max(0,Math.min(newParams.floatPrecision,numberOfDigits-2))) 7384return newParams} 7385const floatDigits=n=>{const str=n.toString() 7386return str.slice(str.indexOf(".")).length-1} 7387const convertToShorts=(transforms,params)=>{for(let i=0;i<transforms.length;i++){let transform=transforms[i] 7388if(params.matrixToTransform&&transform.name==="matrix"){const decomposed=matrixToTransform(transform,params) 7389js2transform(decomposed,params).length<=js2transform([transform],params).length&&transforms.splice(i,1,...decomposed) 7390transform=transforms[i]}roundTransform(transform,params) 7391params.shortTranslate&&transform.name==="translate"&&transform.data.length===2&&!transform.data[1]&&transform.data.pop() 7392params.shortScale&&transform.name==="scale"&&transform.data.length===2&&transform.data[0]===transform.data[1]&&transform.data.pop() 7393if(params.shortRotate&&transforms[i-2]?.name==="translate"&&transforms[i-1].name==="rotate"&&transforms[i].name==="translate"&&transforms[i-2].data[0]===-transforms[i].data[0]&&transforms[i-2].data[1]===-transforms[i].data[1]){transforms.splice(i-2,3,{name:"rotate",data:[transforms[i-1].data[0],transforms[i-2].data[0],transforms[i-2].data[1]]}) 7394i-=2}}return transforms} 7395const removeUseless=transforms=>transforms.filter((transform=>{if(["translate","rotate","skewX","skewY"].indexOf(transform.name)>-1&&(transform.data.length==1||transform.name=="rotate")&&!transform.data[0]||transform.name=="translate"&&!transform.data[0]&&!transform.data[1]||transform.name=="scale"&&transform.data[0]==1&&(transform.data.length<2||transform.data[1]==1)||transform.name=="matrix"&&transform.data[0]==1&&transform.data[3]==1&&!(transform.data[1]||transform.data[2]||transform.data[4]||transform.data[5]))return false 7396return true})) 7397var convertTransform$1=Object.freeze({__proto__:null,description:description$q,fn:fn$q,name:name$q}) 7398const name$p="removeEmptyAttrs" 7399const description$p="removes empty attributes" 7400const fn$p=()=>({element:{enter:node=>{for(const[name,value]of Object.entries(node.attributes))value!==""||attrsGroups.conditionalProcessing.has(name)||delete node.attributes[name]}}}) 7401var removeEmptyAttrs=Object.freeze({__proto__:null,description:description$p,fn:fn$p,name:name$p}) 7402const name$o="removeEmptyContainers" 7403const description$o="removes empty container elements" 7404const fn$o=root=>{const stylesheet=collectStylesheet(root) 7405return{element:{exit:(node,parentNode)=>{if(node.name==="svg"||!elemsGroups.container.has(node.name)||node.children.length!==0)return 7406if(node.name==="pattern"&&Object.keys(node.attributes).length!==0)return 7407if(node.name==="mask"&&node.attributes.id!=null)return 7408if(parentNode.type==="element"&&parentNode.name==="switch")return 7409if(node.name==="g"&&(node.attributes.filter!=null||computeStyle(stylesheet,node).filter))return 7410detachNodeFromParent(node,parentNode)}}}} 7411var removeEmptyContainers=Object.freeze({__proto__:null,description:description$o,fn:fn$o,name:name$o}) 7412const name$n="mergePaths" 7413const description$n="merges multiple paths in one if possible" 7414function elementHasUrl(computedStyle,attName){const style=computedStyle[attName] 7415if(style?.type==="static")return includesUrlReference(style.value) 7416return false}const fn$n=(root,params)=>{const{force:force=false,floatPrecision:floatPrecision=3,noSpaceAfterFlags:noSpaceAfterFlags=false}=params 7417const stylesheet=collectStylesheet(root) 7418return{element:{enter:node=>{if(node.children.length<=1)return 7419const elementsToRemove=[] 7420let prevChild=node.children[0] 7421let prevPathData=null 7422const updatePreviousPath=(child,pathData)=>{js2path(child,pathData,{floatPrecision:floatPrecision,noSpaceAfterFlags:noSpaceAfterFlags}) 7423prevPathData=null} 7424for(let i=1;i<node.children.length;i++){const child=node.children[i] 7425if(prevChild.type!=="element"||prevChild.name!=="path"||prevChild.children.length!==0||prevChild.attributes.d==null){prevPathData&&prevChild.type==="element"&&updatePreviousPath(prevChild,prevPathData) 7426prevChild=child 7427continue}if(child.type!=="element"||child.name!=="path"||child.children.length!==0||child.attributes.d==null){prevPathData&&updatePreviousPath(prevChild,prevPathData) 7428prevChild=child 7429continue}const computedStyle=computeStyle(stylesheet,child) 7430if(computedStyle["marker-start"]||computedStyle["marker-mid"]||computedStyle["marker-end"]||computedStyle["clip-path"]||computedStyle["mask"]||computedStyle["mask-image"]||["fill","filter","stroke"].some((attName=>elementHasUrl(computedStyle,attName)))){prevPathData&&updatePreviousPath(prevChild,prevPathData) 7431prevChild=child 7432continue}const childAttrs=Object.keys(child.attributes) 7433if(childAttrs.length!==Object.keys(prevChild.attributes).length){prevPathData&&updatePreviousPath(prevChild,prevPathData) 7434prevChild=child 7435continue}const areAttrsEqual=childAttrs.some((attr=>attr!=="d"&&prevChild.type==="element"&&prevChild.attributes[attr]!==child.attributes[attr])) 7436if(areAttrsEqual){prevPathData&&updatePreviousPath(prevChild,prevPathData) 7437prevChild=child 7438continue}const hasPrevPath=prevPathData!=null 7439const currentPathData=path2js(child) 7440prevPathData=prevPathData??path2js(prevChild) 7441if(force||!intersects(prevPathData,currentPathData)){prevPathData.push(...currentPathData) 7442elementsToRemove.push(child) 7443continue}hasPrevPath&&updatePreviousPath(prevChild,prevPathData) 7444prevChild=child 7445prevPathData=null}prevPathData&&prevChild.type==="element"&&updatePreviousPath(prevChild,prevPathData) 7446node.children=node.children.filter((child=>!elementsToRemove.includes(child)))}}}} 7447var mergePaths=Object.freeze({__proto__:null,description:description$n,fn:fn$n,name:name$n}) 7448const name$m="removeUnusedNS" 7449const description$m="removes unused namespaces declaration" 7450const fn$m=()=>{const unusedNamespaces=new Set 7451return{element:{enter:(node,parentNode)=>{if(node.name==="svg"&&parentNode.type==="root")for(const name of Object.keys(node.attributes))if(name.startsWith("xmlns:")){const local=name.slice(6) 7452unusedNamespaces.add(local)}if(unusedNamespaces.size!==0){if(node.name.includes(":")){const[ns]=node.name.split(":") 7453unusedNamespaces.has(ns)&&unusedNamespaces.delete(ns)}for(const name of Object.keys(node.attributes))if(name.includes(":")){const[ns]=name.split(":") 7454unusedNamespaces.delete(ns)}}},exit:(node,parentNode)=>{if(node.name==="svg"&&parentNode.type==="root")for(const name of unusedNamespaces)delete node.attributes[`xmlns:${name}`]}}}} 7455var removeUnusedNS=Object.freeze({__proto__:null,description:description$m,fn:fn$m,name:name$m}) 7456const name$l="sortAttrs" 7457const description$l="Sort element attributes for better compression" 7458const fn$l=(_root,params)=>{const{order:order=["id","width","height","x","x1","x2","y","y1","y2","cx","cy","r","fill","stroke","marker","d","points"],xmlnsOrder:xmlnsOrder="front"}=params 7459const getNsPriority=name=>{if(xmlnsOrder==="front"){if(name==="xmlns")return 3 7460if(name.startsWith("xmlns:"))return 2}if(name.includes(":"))return 1 7461return 0} 7462const compareAttrs=([aName],[bName])=>{const aPriority=getNsPriority(aName) 7463const bPriority=getNsPriority(bName) 7464const priorityNs=bPriority-aPriority 7465if(priorityNs!==0)return priorityNs 7466const[aPart]=aName.split("-") 7467const[bPart]=bName.split("-") 7468if(aPart!==bPart){const aInOrderFlag=order.includes(aPart)?1:0 7469const bInOrderFlag=order.includes(bPart)?1:0 7470if(aInOrderFlag===1&&bInOrderFlag===1)return order.indexOf(aPart)-order.indexOf(bPart) 7471const priorityOrder=bInOrderFlag-aInOrderFlag 7472if(priorityOrder!==0)return priorityOrder}return aName<bName?-1:1} 7473return{element:{enter:node=>{const attrs=Object.entries(node.attributes) 7474attrs.sort(compareAttrs) 7475const sortedAttributes={} 7476for(const[name,value]of attrs)sortedAttributes[name]=value 7477node.attributes=sortedAttributes}}}} 7478var sortAttrs=Object.freeze({__proto__:null,description:description$l,fn:fn$l,name:name$l}) 7479const name$k="sortDefsChildren" 7480const description$k="Sorts children of <defs> to improve compression" 7481const fn$k=()=>({element:{enter:node=>{if(node.name==="defs"){const frequencies=new Map 7482for(const child of node.children)if(child.type==="element"){const frequency=frequencies.get(child.name) 7483frequency==null?frequencies.set(child.name,1):frequencies.set(child.name,frequency+1)}node.children.sort(((a,b)=>{if(a.type!=="element"||b.type!=="element")return 0 7484const aFrequency=frequencies.get(a.name) 7485const bFrequency=frequencies.get(b.name) 7486if(aFrequency!=null&&bFrequency!=null){const frequencyComparison=bFrequency-aFrequency 7487if(frequencyComparison!==0)return frequencyComparison}const lengthComparison=b.name.length-a.name.length 7488if(lengthComparison!==0)return lengthComparison 7489if(a.name!==b.name)return a.name>b.name?-1:1 7490return 0})
vendor: 6,470 bytes, lines 7490-7553
7490)}}}}) 7491var sortDefsChildren=Object.freeze({__proto__:null,description:description$k,fn:fn$k,name:name$k}) 7492const name$j="removeDesc" 7493const description$j="removes <desc>" 7494const standardDescs=/^(Created with|Created using)/ 7495const fn$j=(root,params)=>{const{removeAny:removeAny=false}=params 7496return{element:{enter:(node,parentNode)=>{node.name==="desc"&&(removeAny||node.children.length===0||node.children[0].type==="text"&&standardDescs.test(node.children[0].value))&&detachNodeFromParent(node,parentNode)}}}} 7497var removeDesc=Object.freeze({__proto__:null,description:description$j,fn:fn$j,name:name$j}) 7498const presetDefault=createPreset({name:"preset-default",plugins:[removeDoctype,removeXMLProcInst,removeComments,removeDeprecatedAttrs,removeMetadata,removeEditorsNSData,cleanupAttrs,mergeStyles,inlineStyles,minifyStyles,cleanupIds,removeUselessDefs,cleanupNumericValues,convertColors,removeUnknownsAndDefaults,removeNonInheritableGroupAttrs,removeUselessStrokeAndFill,cleanupEnableBackground,removeHiddenElems,removeEmptyText,convertShapeToPath,convertEllipseToCircle,moveElemsAttrsToGroup,moveGroupAttrsToElems,collapseGroups,convertPathData,convertTransform$1,removeEmptyAttrs,removeEmptyContainers,mergePaths,removeUnusedNS,sortAttrs,sortDefsChildren,removeDesc]}) 7499const name$i="addAttributesToSVGElement" 7500const description$i="adds attributes to an outer <svg> element" 7501const ENOCLS$1='Error in plugin "addAttributesToSVGElement": absent parameters.\nIt should have a list of "attributes" or one "attribute".\nConfig example:\n\nplugins: [\n {\n name: \'addAttributesToSVGElement\',\n params: {\n attribute: "mySvg"\n }\n }\n]\n\nplugins: [\n {\n name: \'addAttributesToSVGElement\',\n params: {\n attributes: ["mySvg", "size-big"]\n }\n }\n]\n\nplugins: [\n {\n name: \'addAttributesToSVGElement\',\n params: {\n attributes: [\n {\n focusable: false\n },\n {\n \'data-image\': icon\n }\n ]\n }\n }\n]\n' 7502const fn$i=(root,params)=>{if(!Array.isArray(params.attributes)&&!params.attribute){console.error(ENOCLS$1) 7503return null}const attributes=params.attributes||[params.attribute] 7504return{element:{enter:(node,parentNode)=>{if(node.name==="svg"&&parentNode.type==="root")for(const attribute of attributes){typeof attribute==="string"&&node.attributes[attribute]==null&&(node.attributes[attribute]=void 0) 7505if(typeof attribute==="object")for(const key of Object.keys(attribute))node.attributes[key]==null&&(node.attributes[key]=attribute[key])}}}}} 7506var addAttributesToSVGElement=Object.freeze({__proto__:null,description:description$i,fn:fn$i,name:name$i}) 7507const name$h="addClassesToSVGElement" 7508const description$h="adds classnames to an outer <svg> element" 7509const ENOCLS='Error in plugin "addClassesToSVGElement": absent parameters.\nIt should have a list of classes in "classNames" or one "className".\nConfig example:\n\nplugins: [\n {\n name: "addClassesToSVGElement",\n params: {\n className: "mySvg"\n }\n }\n]\n\nplugins: [\n {\n name: "addClassesToSVGElement",\n params: {\n classNames: ["mySvg", "size-big"]\n }\n }\n]\n' 7510const fn$h=(root,params,info)=>{if(!(Array.isArray(params.classNames)&¶ms.classNames.length!==0)&&!params.className){console.error(ENOCLS) 7511return null}const classNames=params.classNames||[params.className] 7512return{element:{enter:(node,parentNode)=>{if(node.name==="svg"&&parentNode.type==="root"){const classList=new Set(node.attributes.class==null?null:node.attributes.class.split(" ")) 7513for(const className of classNames)if(className!=null){const classToAdd=typeof className==="string"?className:className(node,info) 7514classList.add(classToAdd)}node.attributes.class=Array.from(classList).join(" ")}}}}} 7515var addClassesToSVGElement=Object.freeze({__proto__:null,description:description$h,fn:fn$h,name:name$h}) 7516const name$g="cleanupListOfValues" 7517const description$g="rounds list of values to the fixed precision" 7518const regNumericValues=/^([-+]?\d*\.?\d+([eE][-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/ 7519const regSeparator=/\s+,?\s*|,\s*/ 7520const absoluteLengths={cm:96/2.54,mm:96/25.4,in:96,pt:4/3,pc:16,px:1} 7521const fn$g=(_root,params)=>{const{floatPrecision:floatPrecision=3,leadingZero:leadingZero=true,defaultPx:defaultPx=true,convertToPx:convertToPx=true}=params 7522const roundValues=lists=>{const roundedList=[] 7523for(const elem of lists.split(regSeparator)){const match=elem.match(regNumericValues) 7524const matchNew=elem.match(/new/) 7525if(match){let num=Number(Number(match[1]).toFixed(floatPrecision)) 7526const matchedUnit=match[3]||"" 7527let units=matchedUnit 7528if(convertToPx&&units&&units in absoluteLengths){const pxNum=Number((absoluteLengths[units]*Number(match[1])).toFixed(floatPrecision)) 7529if(pxNum.toString().length<match[0].length){num=pxNum 7530units="px"}}let str 7531str=leadingZero?removeLeadingZero(num):num.toString() 7532defaultPx&&units==="px"&&(units="") 7533roundedList.push(str+units)}else matchNew?roundedList.push("new"):elem&&roundedList.push(elem)}return roundedList.join(" ")} 7534return{element:{enter:node=>{node.attributes.points!=null&&(node.attributes.points=roundValues(node.attributes.points)) 7535node.attributes["enable-background"]!=null&&(node.attributes["enable-background"]=roundValues(node.attributes["enable-background"])) 7536node.attributes.viewBox!=null&&(node.attributes.viewBox=roundValues(node.attributes.viewBox)) 7537node.attributes["stroke-dasharray"]!=null&&(node.attributes["stroke-dasharray"]=roundValues(node.attributes["stroke-dasharray"])) 7538node.attributes.dx!=null&&(node.attributes.dx=roundValues(node.attributes.dx)) 7539node.attributes.dy!=null&&(node.attributes.dy=roundValues(node.attributes.dy)) 7540node.attributes.x!=null&&(node.attributes.x=roundValues(node.attributes.x)) 7541node.attributes.y!=null&&(node.attributes.y=roundValues(node.attributes.y))}}}} 7542var cleanupListOfValues=Object.freeze({__proto__:null,description:description$g,fn:fn$g,name:name$g}) 7543const name$f="convertOneStopGradients" 7544const description$f="converts one-stop (single color) gradients to a plain color" 7545const fn$f=root=>{const stylesheet=collectStylesheet(root) 7546const effectedDefs=new Set 7547const allDefs=new Map 7548const gradientsToDetach=new Map 7549let xlinkHrefCount=0 7550return{element:{enter:(node,parentNode)=>{node.attributes["xlink:href"]!=null&&xlinkHrefCount++ 7551if(node.name==="defs"){allDefs.set(node,parentNode) 7552return}if(node.name!=="linearGradient"&&node.name!=="radialGradient")return 7553const stops=node.children.filter(
7553(child=>child.type==="element"&&child.name==="stop")) 7554const href=node.attributes["xlink:href"]||node.attributes["href"] 7555const effectiveNode=stops.length===0&&href!=null&&href.startsWith("#")?querySelector(root,href):node 7556if(effectiveNode==null||effectiveNode.type!=="element"){gradientsToDetach.set(node,parentNode) 7557return}const effectiveStops=effectiveNode.children.filter((child=>child.type==="element"&&child.name==="stop")) 7558if(effectiveStops.length!==1||effectiveStops[0].type!=="element")return 7559parentNode.type==="element"&&parentNode.name==="defs"&&effectedDefs.add(parentNode) 7560gradientsToDetach.set(node,parentNode) 7561let color 7562const style=computeStyle(stylesheet,effectiveStops[0])["stop-color"] 7563style!=null&&style.type==="static"&&(color=style.value) 7564const selectorVal=`url(#${node.attributes.id})` 7565const selector=[...colorsProps].map((attr=>`[${attr}="${selectorVal}"]`)).join(",") 7566const elements=querySelectorAll(root,selector) 7567for(const element of elements){if(element.type!=="element")continue 7568for(const attr of colorsProps){if(element.attributes[attr]!==selectorVal)continue 7569color!=null?element.attributes[attr]=color:delete element.attributes[attr]}}const styledElements=querySelectorAll(root,`[style*=${selectorVal}]`) 7570for(const element of styledElements){if(element.type!=="element")continue 7571element.attributes.style=element.attributes.style.replace(selectorVal,color||attrsGroupsDefaults.presentation["stop-color"])}},exit:node=>{if(node.name==="svg"){for(const[gradient,parent]of gradientsToDetach.entries()){gradient.attributes["xlink:href"]!=null&&xlinkHrefCount-- 7572detachNodeFromParent(gradient,parent)}xlinkHrefCount===0&&delete node.attributes["xmlns:xlink"] 7573for(const[defs,parent]of allDefs.entries())effectedDefs.has(defs)&&defs.children.length===0&&detachNodeFromParent(defs,parent)}}}}} 7574var convertOneStopGradients=Object.freeze({__proto__:null,description:description$f,fn:fn$f,name:name$f}) 7575const name$e="convertStyleToAttrs" 7576const description$e="converts style to attributes" 7577const g=(...args)=>"(?:"+args.join("|")+")" 7578const stylingProps=attrsGroups.presentation 7579const rEscape="\\\\(?:[0-9a-f]{1,6}\\s?|\\r\\n|.)" 7580const rAttr="\\s*("+g("[^:;\\\\]",rEscape)+"*?)\\s*" 7581const rSingleQuotes="'(?:[^'\\n\\r\\\\]|"+rEscape+")*?(?:'|$)" 7582const rQuotes='"(?:[^"\\n\\r\\\\]|'+rEscape+')*?(?:"|$)' 7583const rQuotedString=new RegExp("^"+g(rSingleQuotes,rQuotes)+"$") 7584const rParenthesis="\\("+g("[^'\"()\\\\]+",rEscape,rSingleQuotes,rQuotes)+"*?\\)" 7585const rValue="\\s*("+g("[^!'\"();\\\\]+?",rEscape,rSingleQuotes,rQuotes,rParenthesis,"[^;]*?")+"*?)" 7586const rDeclEnd="\\s*(?:;\\s*|$)" 7587const rImportant="(\\s*!important(?![-(\\w]))?" 7588const regDeclarationBlock=new RegExp(rAttr+":"+rValue+rImportant+rDeclEnd,"ig") 7589const regStripComments=new RegExp(g(rEscape,rSingleQuotes,rQuotes,"/\\*[^]*?\\*/"),"ig") 7590const fn$e=(_root,params)=>{const{keepImportant:keepImportant=false}=params 7591return{element:{enter:node=>{if(node.attributes.style!=null){let styles=[] 7592const newAttributes={} 7593const styleValue=node.attributes.style.replace(regStripComments,(match=>match[0]=="/"?"":match[0]=="\\"&&/[-g-z]/i.test(match[1])?match[1]:match)) 7594regDeclarationBlock.lastIndex=0 7595for(var rule;rule=regDeclarationBlock.exec(styleValue);)keepImportant&&rule[3]||styles.push([rule[1],rule[2]]) 7596if(styles.length){styles=styles.filter((function(style){if(style[0]){const prop=style[0].toLowerCase() 7597let val=style[1] 7598rQuotedString.test(val)&&(val=val.slice(1,-1)) 7599if(stylingProps.has(prop)){newAttributes[prop]=val 7600return false}}return true})) 7601Object.assign(node.attributes,newAttributes) 7602styles.length?node.attributes.style=styles.map((declaration=>declaration.join(":"))).join(";"):delete node.attributes.style}}}}}}
7603var convertStyleToAttrs=Object.freeze({__proto__:null,description:description$e,fn:fn$e,name:name$e}) 7604const name$d="prefixIds" 7605const description$d="prefix IDs" 7606const getBasename=path=>{const matched=/[/\\]?([^/\\]+)$/.exec(path) 7607if(matched)return matched[1] 7608return""} 7609const escapeIdentifierName=str=>str.replace(/[. ]/g,"_") 7610const unquote=string=>{if(string.startsWith('"')&&string.endsWith('"')||string.startsWith("'")&&string.endsWith("'"))return string.slice(1,-1) 7611return string} 7612const prefixId=(prefixGenerator,body)=>{const prefix=prefixGenerator(body) 7613if(body.startsWith(prefix))return body 7614return prefix+body} 7615const prefixReference=(prefixGenerator,reference)=>{if(reference.startsWith("#"))return"#"+prefixId(prefixGenerator,reference.slice(1)) 7616return null} 7617const generatePrefix=(body,node,info,prefixGenerator,delim,history)=>{if(typeof prefixGenerator==="function"){let prefix=history.get(body) 7618if(prefix!=null)return prefix 7619prefix=prefixGenerator(node,info)+delim 7620history.set(body,prefix) 7621return prefix}if(typeof prefixGenerator==="string")return prefixGenerator+delim 7622if(prefixGenerator===false)return"" 7623if(info.path!=null&&info.path.length>0)return escapeIdentifierName(getBasename(info.path))+delim 7624return"prefix"+delim} 7625const fn$d=(_root,params,info)=>{const{delim:delim="__",prefix:prefix,prefixIds:prefixIds=true,prefixClassNames:prefixClassNames=true}=params 7626const prefixMap=new Map 7627return{element:{enter:node=>{const prefixGenerator=id=>generatePrefix(id,node,info,prefix,delim,prefixMap) 7628if(node.name==="style"){if(node.children.length===0)return 7629for(const child of node.children){if(child.type!=="text"&&child.type!=="cdata")continue 7630const cssText=child.value 7631let cssAst 7632try{cssAst=parse$I(cssText,{parseValue:true,parseCustomProperty:false})}catch{return}walk$3(cssAst,(node=>{if(prefixIds&&node.type==="IdSelector"||prefixClassNames&&node.type==="ClassSelector"){node.name=prefixId(prefixGenerator,node.name) 7633return}if(node.type==="Url"&&node.value.length>0){const prefixed=prefixReference(prefixGenerator,unquote(node.value)) 7634prefixed!=null&&(node.value=prefixed)}})) 7635child.value=generate$I(cssAst)}}prefixIds&&node.attributes.id!=null&&node.attributes.id.length!==0&&(node.attributes.id=prefixId(prefixGenerator,node.attributes.id)) 7636prefixClassNames&&node.attributes.class!=null&&node.attributes.class.length!==0&&(node.attributes.class=node.attributes.class.split(/\s+/).map((name=>prefixId(prefixGenerator,name))).join(" ")) 7637for(const name of["href","xlink:href"])if(node.attributes[name]!=null&&node.attributes[name].length!==0){const prefixed=prefixReference(prefixGenerator,node.attributes[name]) 7638prefixed!=null&&(node.attributes[name]=prefixed)}for(const name of referencesProps)node.attributes[name]!=null&&node.attributes[name].length!==0&&(node.attributes[name]=node.attributes[name].replace(/\burl\((["'])?(#.+?)\1\)/gi,((match,_,url)=>{const prefixed=prefixReference(prefixGenerator,url) 7639if(prefixed==null)return match 7640return`url(${prefixed})`}))) 7641for(const name of["begin","end"])if(node.attributes[name]!=null&&node.attributes[name].length!==0){const parts=node.attributes[name].split(/\s*;\s+/).map((val=>{if(val.endsWith(".end")||val.endsWith(".start")){const[id,postfix]=val.split(".") 7642return`${prefixId(prefixGenerator,id)}.${postfix}`}return val})) 7643node.attributes[name]=parts.join("; ")}}}}} 7644var prefixIds=Object.freeze({__proto__:null,description:description$d,fn:fn$d,name:name$d}) 7645const name$c="removeAttributesBySelector" 7646const description$c="removes attributes of elements that match a css selector" 7647const fn$c=(root,params)=>{const selectors=Array.isArray(params.selectors)?params.selectors:[params] 7648for(const{selector:selector,attributes:attributes}of selectors){const nodes=querySelectorAll(root,selector) 7649for(const node of nodes)if(node.type==="element")if(Array.isArray(attributes))for(const name of attributes)delete node.attributes[name] 7650else delete node.attributes[attributes]}return{}} 7651var removeAttributesBySelector=Object.freeze({__proto__:null,description:description$c,fn:fn$c,name:name$c}) 7652const name$b="removeAttrs" 7653const description$b="removes specified attributes"
vendor: 4,467 bytes, lines 7654-7704
7654const DEFAULT_SEPARATOR=":" 7655const ENOATTRS='Warning: The plugin "removeAttrs" requires the "attrs" parameter.\nIt should have a pattern to remove, otherwise the plugin is a noop.\nConfig example:\n\nplugins: [\n {\n name: "removeAttrs",\n params: {\n attrs: "(fill|stroke)"\n }\n }\n]\n' 7656const fn$b=(root,params)=>{if(typeof params.attrs=="undefined"){console.warn(ENOATTRS) 7657return null}const elemSeparator=typeof params.elemSeparator=="string"?params.elemSeparator:DEFAULT_SEPARATOR 7658const preserveCurrentColor=typeof params.preserveCurrentColor=="boolean"&¶ms.preserveCurrentColor 7659const attrs=Array.isArray(params.attrs)?params.attrs:[params.attrs] 7660return{element:{enter:node=>{for(let pattern of attrs){pattern.includes(elemSeparator)?pattern.split(elemSeparator).length<3&&(pattern=[pattern,".*"].join(elemSeparator)):pattern=[".*",pattern,".*"].join(elemSeparator) 7661const list=pattern.split(elemSeparator).map((value=>{value==="*"&&(value=".*") 7662return new RegExp(["^",value,"$"].join(""),"i")})) 7663if(list[0].test(node.name))for(const[name,value]of Object.entries(node.attributes)){const isCurrentColor=value.toLowerCase()==="currentcolor" 7664const isFillCurrentColor=preserveCurrentColor&&name=="fill"&&isCurrentColor 7665const isStrokeCurrentColor=preserveCurrentColor&&name=="stroke"&&isCurrentColor 7666!isFillCurrentColor&&!isStrokeCurrentColor&&list[1].test(name)&&list[2].test(value)&&delete node.attributes[name]}}}}}} 7667var removeAttrs=Object.freeze({__proto__:null,description:description$b,fn:fn$b,name:name$b}) 7668const name$a="removeDimensions" 7669const description$a="removes width and height in presence of viewBox (opposite to removeViewBox)" 7670const fn$a=()=>({element:{enter:node=>{if(node.name==="svg")if(node.attributes.viewBox!=null){delete node.attributes.width 7671delete node.attributes.height}else if(node.attributes.width!=null&&node.attributes.height!=null&&Number.isNaN(Number(node.attributes.width))===false&&Number.isNaN(Number(node.attributes.height))===false){const width=Number(node.attributes.width) 7672const height=Number(node.attributes.height) 7673node.attributes.viewBox=`0 0 ${width} ${height}` 7674delete node.attributes.width 7675delete node.attributes.height}}}}) 7676var removeDimensions=Object.freeze({__proto__:null,description:description$a,fn:fn$a,name:name$a}) 7677const name$9="removeElementsByAttr" 7678const description$9="removes arbitrary elements by ID or className (disabled by default)" 7679const fn$9=(root,params)=>{const ids=params.id==null?[]:Array.isArray(params.id)?params.id:[params.id] 7680const classes=params.class==null?[]:Array.isArray(params.class)?params.class:[params.class] 7681return{element:{enter:(node,parentNode)=>{node.attributes.id!=null&&ids.length!==0&&ids.includes(node.attributes.id)&&detachNodeFromParent(node,parentNode) 7682if(node.attributes.class&&classes.length!==0){const classList=node.attributes.class.split(" ") 7683for(const item of classes)if(classList.includes(item)){detachNodeFromParent(node,parentNode) 7684break}}}}}} 7685var removeElementsByAttr=Object.freeze({__proto__:null,description:description$9,fn:fn$9,name:name$9}) 7686const name$8="removeOffCanvasPaths" 7687const description$8="removes elements that are drawn outside of the viewBox (disabled by default)" 7688const fn$8=()=>{let viewBoxData=null 7689return{element:{enter:(node,parentNode)=>{if(node.name==="svg"&&parentNode.type==="root"){let viewBox="" 7690node.attributes.viewBox!=null?viewBox=node.attributes.viewBox:node.attributes.height!=null&&node.attributes.width!=null&&(viewBox=`0 0 ${node.attributes.width} ${node.attributes.height}`) 7691viewBox=viewBox.replace(/[,+]|px/g," ").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"") 7692const m=/^(-?\d*\.?\d+) (-?\d*\.?\d+) (\d*\.?\d+) (\d*\.?\d+)$/.exec(viewBox) 7693if(m==null)return 7694const left=Number.parseFloat(m[1]) 7695const top=Number.parseFloat(m[2]) 7696const width=Number.parseFloat(m[3]) 7697const height=Number.parseFloat(m[4]) 7698viewBoxData={left:left,top:top,right:left+width,bottom:top+height,width:width,height:height}}if(node.attributes.transform!=null)return visitSkip 7699if(node.name==="path"&&node.attributes.d!=null&&viewBoxData!=null){const pathData=parsePathData(node.attributes.d) 7700let visible=false 7701for(const pathDataItem of pathData)if(pathDataItem.command==="M"){const[x,y]=pathDataItem.args 7702x>=viewBoxData.left&&x<=viewBoxData.right&&y>=viewBoxData.top&&y<=viewBoxData.bottom&&(visible=true)}if(visible)return 7703pathData.length===2&&pathData.push({command:"z",args:[]}) 7704const{left:left,top:top,width:width,height:height}=viewBoxData
7705const viewBoxPathData=[{command:"M",args:[left,top]},{command:"h",args:[width]},{command:"v",args:[height]},{command:"H",args:[left]},{command:"z",args:[]}] 7706intersects(viewBoxPathData,pathData)===false&&detachNodeFromParent(node,parentNode)}}}}} 7707var removeOffCanvasPaths=Object.freeze({__proto__:null,description:description$8,fn:fn$8,name:name$8}) 7708const name$7="removeRasterImages" 7709const description$7="removes raster images (disabled by default)" 7710const fn$7=()=>({element:{enter:(node,parentNode)=>{node.name==="image"&&node.attributes["xlink:href"]!=null&&/(\.|image\/)(jpe?g|png|gif)/.test(node.attributes["xlink:href"])&&detachNodeFromParent(node,parentNode)}}}) 7711var removeRasterImages=Object.freeze({__proto__:null,description:description$7,fn:fn$7,name:name$7}) 7712const name$6="removeScripts" 7713const description$6="removes scripts (disabled by default)" 7714const eventAttrs=[...attrsGroups.animationEvent,...attrsGroups.documentEvent,...attrsGroups.documentElementEvent,...attrsGroups.globalEvent,...attrsGroups.graphicalEvent] 7715const fn$6=()=>({element:{enter:(node,parentNode)=>{if(node.name==="script"){detachNodeFromParent(node,parentNode) 7716return}for(const attr of eventAttrs)node.attributes[attr]!=null&&delete node.attributes[attr]},exit:(node,parentNode)=>{if(node.name!=="a")return 7717for(const attr of Object.keys(node.attributes))if(attr==="href"||attr.endsWith(":href")){if(node.attributes[attr]==null||!node.attributes[attr].trimStart().startsWith("javascript:"))continue 7718const index=parentNode.children.indexOf(node) 7719const usefulChildren=node.children.filter((child=>child.type!=="text")) 7720parentNode.children.splice(index,1,...usefulChildren)}}}}) 7721var removeScripts=Object.freeze({__proto__:null,description:description$6,fn:fn$6,name:name$6}) 7722const name$5="removeStyleElement" 7723const description$5="removes <style> element (disabled by default)" 7724const fn$5=()=>({element:{enter:(node,parentNode)=>{node.name==="style"&&detachNodeFromParent(node,parentNode)}}}) 7725var removeStyleElement=Object.freeze({__proto__:null,description:description$5,fn:fn$5,name:name$5}) 7726const name$4="removeTitle" 7727const description$4="removes <title>" 7728const fn$4=()=>({element:{enter:(node,parentNode)=>{node.name==="title"&&detachNodeFromParent(node,parentNode)}}}) 7729var removeTitle=Object.freeze({__proto__:null,description:description$4,fn:fn$4,name:name$4}) 7730const name$3="removeViewBox" 7731const description$3="removes viewBox attribute when possible" 7732const viewBoxElems=new Set(["pattern","svg","symbol"]) 7733const fn$3=()=>({element:{enter:(node,parentNode)=>{if(viewBoxElems.has(node.name)&&node.attributes.viewBox!=null&&node.attributes.width!=null&&node.attributes.height!=null){if(node.name==="svg"&&parentNode.type!=="root")return 7734const nums=node.attributes.viewBox.split(/[ ,]+/g) 7735nums[0]==="0"&&nums[1]==="0"&&node.attributes.width.replace(/px$/,"")===nums[2]&&node.attributes.height.replace(/px$/,"")===nums[3]&&delete node.attributes.viewBox}}}}) 7736var removeViewBox=Object.freeze({__proto__:null,description:description$3,fn:fn$3,name:name$3}) 7737const name$2="removeXlink" 7738const description$2="remove xlink namespace and replaces attributes with the SVG 2 equivalent where applicable" 7739const XLINK_NAMESPACE="http://www.w3.org/1999/xlink" 7740const SHOW_TO_TARGET={new:"_blank",replace:"_self"} 7741const LEGACY_ELEMENTS=new Set(["cursor","filter","font-face-uri","glyphRef","tref"]) 7742const findPrefixedAttrs=(node,prefixes,attr)=>prefixes.map((prefix=>`${prefix}:${attr}`)).filter((attr=>node.attributes[attr]!=null)) 7743const fn$2=(_,params)=>{const{includeLegacy:includeLegacy}=params 7744const xlinkPrefixes=[] 7745const overriddenPrefixes=[] 7746const usedInLegacyElement=[] 7747return{element:{enter:node=>{for(const[key,value]of Object.entries(node.attributes))if(key.startsWith("xmlns:")){const prefix=key.split(":",2)[1] 7748if(value===XLINK_NAMESPACE){xlinkPrefixes.push(prefix) 7749continue}xlinkPrefixes.includes(prefix)&&overriddenPrefixes.push(prefix)}if(overriddenPrefixes.some((prefix=>xlinkPrefixes.includes(prefix))))return 7750const showAttrs=findPrefixedAttrs(node,xlinkPrefixes,"show") 7751let showHandled=node.attributes.target!=null 7752for(let i=showAttrs.length-1;i>=0;i--){const attr=showAttrs[i] 7753const value=node.attributes[attr] 7754const mapping=SHOW_TO_TARGET[value] 7755if(showHandled||mapping==null){delete node.attributes[attr] 7756continue}mapping!==elems[node.name]?.defaults?.target&&(node.attributes.target=mapping) 7757delete node.attributes[attr] 7758showHandled=true}const titleAttrs=findPrefixedAttrs(node,xlinkPrefixes,"title") 7759for(let i=titleAttrs.length-1;i>=0;i--){const attr=titleAttrs[i] 7760const value=node.attributes[attr] 7761const hasTitle=node.children.filter((child=>child.type==="element"&&child.name==="title")) 7762if(hasTitle.length>0){delete node.attributes[attr] 7763continue}const titleTag={type:"element",name:"title",attributes:{},children:[{type:"text",value:value}]} 7764Object.defineProperty(titleTag,"parentNode",{writable:true,value:node}) 7765node.children.unshift(titleTag) 7766delete node.attributes[attr]}const hrefAttrs=findPrefixedAttrs(node,xlinkPrefixes,"href") 7767if(hrefAttrs.length>0&&LEGACY_ELEMENTS.has(node.name)&&!includeLegacy){hrefAttrs.map((attr=>
vendor: 4,109 bytes, lines 7767-7818
7767attr.split(":",1)[0])).forEach((prefix=>usedInLegacyElement.push(prefix))) 7768return}for(let i=hrefAttrs.length-1;i>=0;i--){const attr=hrefAttrs[i] 7769const value=node.attributes[attr] 7770if(node.attributes.href!=null){delete node.attributes[attr] 7771continue}node.attributes.href=value 7772delete node.attributes[attr]}},exit:node=>{for(const[key,value]of Object.entries(node.attributes)){const[prefix,attr]=key.split(":",2) 7773if(xlinkPrefixes.includes(prefix)&&!overriddenPrefixes.includes(prefix)&&!usedInLegacyElement.includes(prefix)&&!includeLegacy){delete node.attributes[key] 7774continue}if(key.startsWith("xmlns:")&&!usedInLegacyElement.includes(attr)){if(value===XLINK_NAMESPACE){const index=xlinkPrefixes.indexOf(attr) 7775xlinkPrefixes.splice(index,1) 7776delete node.attributes[key] 7777continue}if(overriddenPrefixes.includes(prefix)){const index=overriddenPrefixes.indexOf(attr) 7778overriddenPrefixes.splice(index,1)}}}}}}} 7779var removeXlink=Object.freeze({__proto__:null,description:description$2,fn:fn$2,name:name$2}) 7780const name$1="removeXMLNS" 7781const description$1="removes xmlns attribute (for inline svg, disabled by default)" 7782const fn$1=()=>({element:{enter:node=>{node.name==="svg"&&delete node.attributes.xmlns}}}) 7783var removeXMLNS=Object.freeze({__proto__:null,description:description$1,fn:fn$1,name:name$1}) 7784const name="reusePaths" 7785const description="Finds <path> elements with the same d, fill, and stroke, and converts them to <use> elements referencing a single <path> def." 7786const fn=root=>{const stylesheet=collectStylesheet(root) 7787const paths=new Map 7788let svgDefs 7789const hrefs=new Set 7790return{element:{enter:(node,parentNode)=>{if(node.name==="path"&&node.attributes.d!=null){const d=node.attributes.d 7791const fill=node.attributes.fill||"" 7792const stroke=node.attributes.stroke||"" 7793const key=d+";s:"+stroke+";f:"+fill 7794let list=paths.get(key) 7795if(list==null){list=[] 7796paths.set(key,list)}list.push(node)}svgDefs==null&&node.name==="defs"&&parentNode.type==="element"&&parentNode.name==="svg"&&(svgDefs=node) 7797if(node.name==="use")for(const name of["href","xlink:href"]){const href=node.attributes[name] 7798href!=null&&href.startsWith("#")&&href.length>1&&hrefs.add(href.slice(1))}},exit:(node,parentNode)=>{if(node.name==="svg"&&parentNode.type==="root"){let defsTag=svgDefs 7799defsTag==null&&(defsTag={type:"element",name:"defs",attributes:{},children:[]}) 7800let index=0 7801for(const list of paths.values())if(list.length>1){const reusablePath={type:"element",name:"path",attributes:{},children:[]} 7802for(const attr of["fill","stroke","d"])list[0].attributes[attr]!=null&&(reusablePath.attributes[attr]=list[0].attributes[attr]) 7803const originalId=list[0].attributes.id 7804if(originalId==null||hrefs.has(originalId)||stylesheet.rules.some((rule=>rule.selector===`#${originalId}`)))reusablePath.attributes.id="reuse-"+index++ 7805else{reusablePath.attributes.id=originalId 7806delete list[0].attributes.id}defsTag.children.push(reusablePath) 7807for(const pathNode of list){delete pathNode.attributes.d 7808delete pathNode.attributes.stroke 7809delete pathNode.attributes.fill 7810if(defsTag.children.includes(pathNode)&&pathNode.children.length===0){if(Object.keys(pathNode.attributes).length===0){detachNodeFromParent(pathNode,defsTag) 7811continue}if(Object.keys(pathNode.attributes).length===1&&pathNode.attributes.id!=null){detachNodeFromParent(pathNode,defsTag) 7812const selector=`[xlink\\:href=#${pathNode.attributes.id}], [href=#${pathNode.attributes.id}]` 7813for(const child of querySelectorAll(node,selector)){if(child.type!=="element")continue 7814for(const name of["href","xlink:href"])child.attributes[name]!=null&&(child.attributes[name]="#"+reusablePath.attributes.id)}continue}}pathNode.name="use" 7815pathNode.attributes["xlink:href"]="#"+reusablePath.attributes.id}}if(defsTag.children.length!==0){node.attributes["xmlns:xlink"]==null&&(node.attributes["xmlns:xlink"]="http://www.w3.org/1999/xlink") 7816svgDefs==null&&node.children.unshift(defsTag)}}}}}} 7817var reusePaths=Object.freeze({__proto__:null,description:description,fn:fn,name:name}) 7818const builtinPlugins=Object.freeze([presetDefault,addAttributesToSVGElement,addClassesToSVGElement,cleanupAttrs,cleanupEnableBackgroun
vendor: 34,442 bytes, lines 7818-8363
7818d,cleanupIds,cleanupListOfValues,cleanupNumericValues,collapseGroups,convertColors,convertEllipseToCircle,convertOneStopGradients,convertPathData,convertShapeToPath,convertStyleToAttrs,convertTransform$1,inlineStyles,mergePaths,mergeStyles,minifyStyles,moveElemsAttrsToGroup,moveGroupAttrsToElems,prefixIds,removeAttributesBySelector,removeAttrs,removeComments,removeDeprecatedAttrs,removeDesc,removeDimensions,removeDoctype,removeEditorsNSData,removeElementsByAttr,removeEmptyAttrs,removeEmptyContainers,removeEmptyText,removeHiddenElems,removeMetadata,removeNonInheritableGroupAttrs,removeOffCanvasPaths,removeRasterImages,removeScripts,removeStyleElement,removeTitle,removeUnknownsAndDefaults,removeUnusedNS,removeUselessDefs,removeUselessStrokeAndFill,removeViewBox,removeXlink,removeXMLNS,removeXMLProcInst,reusePaths,sortAttrs,sortDefsChildren]) 7819var sax={};(function(exports){(function(sax){sax.parser=function(strict,opt){return new SAXParser(strict,opt)} 7820sax.SAXParser=SAXParser 7821sax.MAX_BUFFER_LENGTH=65536 7822var buffers=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"] 7823sax.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"] 7824function SAXParser(strict,opt){if(!(this instanceof SAXParser))return new SAXParser(strict,opt) 7825var parser=this 7826clearBuffers(parser) 7827parser.q=parser.c="" 7828parser.bufferCheckPosition=sax.MAX_BUFFER_LENGTH 7829parser.opt=opt||{} 7830parser.opt.lowercase=parser.opt.lowercase||parser.opt.lowercasetags 7831parser.looseCase=parser.opt.lowercase?"toLowerCase":"toUpperCase" 7832parser.tags=[] 7833parser.closed=parser.closedRoot=parser.sawRoot=false 7834parser.tag=parser.error=null 7835parser.strict=!!strict 7836parser.noscript=!!(strict||parser.opt.noscript) 7837parser.state=S.BEGIN 7838parser.strictEntities=parser.opt.strictEntities 7839parser.ENTITIES=parser.strictEntities?Object.create(sax.XML_ENTITIES):Object.create(sax.ENTITIES) 7840parser.attribList=[] 7841parser.opt.xmlns&&(parser.ns=Object.create(rootNS)) 7842parser.opt.unquotedAttributeValues===void 0&&(parser.opt.unquotedAttributeValues=!strict) 7843parser.trackPosition=parser.opt.position!==false 7844parser.trackPosition&&(parser.position=parser.line=parser.column=0) 7845emit(parser,"onready")}Object.create||(Object.create=function(o){function F(){}F.prototype=o 7846var newf=new F 7847return newf}) 7848Object.keys||(Object.keys=function(o){var a=[] 7849for(var i in o)o.hasOwnProperty(i)&&a.push(i) 7850return a}) 7851function checkBufferLength(parser){var maxAllowed=Math.max(sax.MAX_BUFFER_LENGTH,10) 7852var maxActual=0 7853for(var i=0,l=buffers.length;i<l;i++){var len=parser[buffers[i]].length 7854if(len>maxAllowed)switch(buffers[i]){case"textNode":closeText(parser) 7855break 7856case"cdata":emitNode(parser,"oncdata",parser.cdata) 7857parser.cdata="" 7858break 7859case"script":emitNode(parser,"onscript",parser.script) 7860parser.script="" 7861break 7862default:error(parser,"Max buffer length exceeded: "+buffers[i])}maxActual=Math.max(maxActual,len)}var m=sax.MAX_BUFFER_LENGTH-maxActual 7863parser.bufferCheckPosition=m+parser.position}function clearBuffers(parser){for(var i=0,l=buffers.length;i<l;i++)parser[buffers[i]]=""}function flushBuffers(parser){closeText(parser) 7864if(parser.cdata!==""){emitNode(parser,"oncdata",parser.cdata) 7865parser.cdata=""}if(parser.script!==""){emitNode(parser,"onscript",parser.script) 7866parser.script=""}}SAXParser.prototype={end:function(){end(this)},write:write,resume:function(){this.error=null 7867return this},close:function(){return this.write(null)},flush:function(){flushBuffers(this)}} 7868var CDATA="[CDATA[" 7869var DOCTYPE="DOCTYPE" 7870var XML_NAMESPACE="http://www.w3.org/XML/1998/namespace" 7871var XMLNS_NAMESPACE="http://www.w3.org/2000/xmlns/" 7872var rootNS={xml:XML_NAMESPACE,xmlns:XMLNS_NAMESPACE} 7873var nameStart=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ 7874var nameBody=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ 7875var entityStart=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ 7876var entityBody=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ 7877function isWhitespace(c){return c===" "||c==="\n"||c==="\r"||c==="\t"}function isQuote(c){return c==='"'||c==="'"}function isAttribEnd(c){return c===">"||isWhitespace(c)}function isMatch(regex,c){return regex.test(c)}function notMatch(regex,c){return!isMatch(regex,c)}var S=0 7878sax.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++} 7879sax.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"} 7880sax.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830} 7881Object.keys(sax.ENTITIES).forEach((function(key){var e=sax.ENTITIES[key] 7882var s=typeof e==="number"?String.fromCharCode(e):e 7883sax.ENTITIES[key]=s})) 7884for(var s in sax.STATE)sax.STATE[sax.STATE[s]]=s 7885S=sax.STATE 7886function emit(parser,event,data){parser[event]&&parser[event](data)}function emitNode(parser,nodeType,data){parser.textNode&&closeText(parser) 7887emit(parser,nodeType,data)}function closeText(parser){parser.textNode=textopts(parser.opt,parser.textNode) 7888parser.textNode&&emit(parser,"ontext",parser.textNode) 7889parser.textNode=""}function textopts(opt,text){opt.trim&&(text=text.trim()) 7890opt.normalize&&(text=text.replace(/\s+/g," ")) 7891return text}function error(parser,er){closeText(parser) 7892parser.trackPosition&&(er+="\nLine: "+parser.line+"\nColumn: "+parser.column+"\nChar: "+parser.c) 7893er=new Error(er) 7894parser.error=er 7895emit(parser,"onerror",er) 7896return parser}function end(parser){parser.sawRoot&&!parser.closedRoot&&strictFail(parser,"Unclosed root tag") 7897parser.state!==S.BEGIN&&parser.state!==S.BEGIN_WHITESPACE&&parser.state!==S.TEXT&&error(parser,"Unexpected end") 7898closeText(parser) 7899parser.c="" 7900parser.closed=true 7901emit(parser,"onend") 7902SAXParser.call(parser,parser.strict,parser.opt) 7903return parser}function strictFail(parser,message){if(typeof parser!=="object"||!(parser instanceof SAXParser))throw new Error("bad call to strictFail") 7904parser.strict&&error(parser,message)}function newTag(parser){parser.strict||(parser.tagName=parser.tagName[parser.looseCase]()) 7905var parent=parser.tags[parser.tags.length-1]||parser 7906var tag=parser.tag={name:parser.tagName,attributes:{}} 7907parser.opt.xmlns&&(tag.ns=parent.ns) 7908parser.attribList.length=0 7909emitNode(parser,"onopentagstart",tag)}function qname(name,attribute){var i=name.indexOf(":") 7910var qualName=i<0?["",name]:name.split(":") 7911var prefix=qualName[0] 7912var local=qualName[1] 7913if(attribute&&name==="xmlns"){prefix="xmlns" 7914local=""}return{prefix:prefix,local:local}}function attrib(parser){parser.strict||(parser.attribName=parser.attribName[parser.looseCase]()) 7915if(parser.attribList.indexOf(parser.attribName)!==-1||parser.tag.attributes.hasOwnProperty(parser.attribName)){parser.attribName=parser.attribValue="" 7916return}if(parser.opt.xmlns){var qn=qname(parser.attribName,true) 7917var prefix=qn.prefix 7918var local=qn.local 7919if(prefix==="xmlns")if(local==="xml"&&parser.attribValue!==XML_NAMESPACE)strictFail(parser,"xml: prefix must be bound to "+XML_NAMESPACE+"\nActual: "+parser.attribValue) 7920else if(local==="xmlns"&&parser.attribValue!==XMLNS_NAMESPACE)strictFail(parser,"xmlns: prefix must be bound to "+XMLNS_NAMESPACE+"\nActual: "+parser.attribValue) 7921else{var tag=parser.tag 7922var parent=parser.tags[parser.tags.length-1]||parser 7923tag.ns===parent.ns&&(tag.ns=Object.create(parent.ns)) 7924tag.ns[local]=parser.attribValue}parser.attribList.push([parser.attribName,parser.attribValue])}else{parser.tag.attributes[parser.attribName]=parser.attribValue 7925emitNode(parser,"onattribute",{name:parser.attribName,value:parser.attribValue})}parser.attribName=parser.attribValue=""}function openTag(parser,selfClosing){if(parser.opt.xmlns){var tag=parser.tag 7926var qn=qname(parser.tagName) 7927tag.prefix=qn.prefix 7928tag.local=qn.local 7929tag.uri=tag.ns[qn.prefix]||"" 7930if(tag.prefix&&!tag.uri){strictFail(parser,"Unbound namespace prefix: "+JSON.stringify(parser.tagName)) 7931tag.uri=qn.prefix}var parent=parser.tags[parser.tags.length-1]||parser 7932tag.ns&&parent.ns!==tag.ns&&Object.keys(tag.ns).forEach((function(p){emitNode(parser,"onopennamespace",{prefix:p,uri:tag.ns[p]})})) 7933for(var i=0,l=parser.attribList.length;i<l;i++){var nv=parser.attribList[i] 7934var name=nv[0] 7935var value=nv[1] 7936var qualName=qname(name,true) 7937var prefix=qualName.prefix 7938var local=qualName.local 7939var uri=prefix===""?"":tag.ns[prefix]||"" 7940var a={name:name,value:value,prefix:prefix,local:local,uri:uri} 7941if(prefix&&prefix!=="xmlns"&&!uri){strictFail(parser,"Unbound namespace prefix: "+JSON.stringify(prefix)) 7942a.uri=prefix}parser.tag.attributes[name]=a 7943emitNode(parser,"onattribute",a)}parser.attribList.length=0}parser.tag.isSelfClosing=!!selfClosing 7944parser.sawRoot=true 7945parser.tags.push(parser.tag) 7946emitNode(parser,"onopentag",parser.tag) 7947if(!selfClosing){parser.noscript||parser.tagName.toLowerCase()!=="script"?parser.state=S.TEXT:parser.state=S.SCRIPT 7948parser.tag=null 7949parser.tagName=""}parser.attribName=parser.attribValue="" 7950parser.attribList.length=0}function closeTag(parser){if(!parser.tagName){strictFail(parser,"Weird empty close tag.") 7951parser.textNode+="</>" 7952parser.state=S.TEXT 7953return}if(parser.script){if(parser.tagName!=="script"){parser.script+="</"+parser.tagName+">" 7954parser.tagName="" 7955parser.state=S.SCRIPT 7956return}emitNode(parser,"onscript",parser.script) 7957parser.script=""}var t=parser.tags.length 7958var tagName=parser.tagName 7959parser.strict||(tagName=tagName[parser.looseCase]()) 7960var closeTo=tagName 7961while(t--){var close=parser.tags[t] 7962if(close.name===closeTo)break 7963strictFail(parser,"Unexpected close tag")}if(t<0){strictFail(parser,"Unmatched closing tag: "+parser.tagName) 7964parser.textNode+="</"+parser.tagName+">" 7965parser.state=S.TEXT 7966return}parser.tagName=tagName 7967var s=parser.tags.length 7968while(s-- >t){var tag=parser.tag=parser.tags.pop() 7969parser.tagName=parser.tag.name 7970emitNode(parser,"onclosetag",parser.tagName) 7971var x={} 7972for(var i in tag.ns)x[i]=tag.ns[i] 7973var parent=parser.tags[parser.tags.length-1]||parser 7974parser.opt.xmlns&&tag.ns!==parent.ns&&Object.keys(tag.ns).forEach((function(p){var n=tag.ns[p] 7975emitNode(parser,"onclosenamespace",{prefix:p,uri:n})}))}t===0&&(parser.closedRoot=true) 7976parser.tagName=parser.attribValue=parser.attribName="" 7977parser.attribList.length=0 7978parser.state=S.TEXT}function parseEntity(parser){var entity=parser.entity 7979var entityLC=entity.toLowerCase() 7980var num 7981var numStr="" 7982if(parser.ENTITIES[entity])return parser.ENTITIES[entity] 7983if(parser.ENTITIES[entityLC])return parser.ENTITIES[entityLC] 7984entity=entityLC 7985if(entity.charAt(0)==="#")if(entity.charAt(1)==="x"){entity=entity.slice(2) 7986num=parseInt(entity,16) 7987numStr=num.toString(16)}else{entity=entity.slice(1) 7988num=parseInt(entity,10) 7989numStr=num.toString(10)}entity=entity.replace(/^0+/,"") 7990if(isNaN(num)||numStr.toLowerCase()!==entity){strictFail(parser,"Invalid character entity") 7991return"&"+parser.entity+";"}return String.fromCodePoint(num)}function beginWhiteSpace(parser,c){if(c==="<"){parser.state=S.OPEN_WAKA 7992parser.startTagPosition=parser.position}else if(!isWhitespace(c)){strictFail(parser,"Non-whitespace before first tag.") 7993parser.textNode=c 7994parser.state=S.TEXT}}function charAt(chunk,i){var result="" 7995i<chunk.length&&(result=chunk.charAt(i)) 7996return result}function write(chunk){var parser=this 7997if(this.error)throw this.error 7998if(parser.closed)return error(parser,"Cannot write after close. Assign an onready handler.") 7999if(chunk===null)return end(parser) 8000typeof chunk==="object"&&(chunk=chunk.toString()) 8001var i=0 8002var c="" 8003while(true){c=charAt(chunk,i++) 8004parser.c=c 8005if(!c)break 8006if(parser.trackPosition){parser.position++ 8007if(c==="\n"){parser.line++ 8008parser.column=0}else parser.column++}switch(parser.state){case S.BEGIN:parser.state=S.BEGIN_WHITESPACE 8009if(c==="\ufeff")continue 8010beginWhiteSpace(parser,c) 8011continue 8012case S.BEGIN_WHITESPACE:beginWhiteSpace(parser,c) 8013continue 8014case S.TEXT:if(parser.sawRoot&&!parser.closedRoot){var starti=i-1 8015while(c&&c!=="<"&&c!=="&"){c=charAt(chunk,i++) 8016if(c&&parser.trackPosition){parser.position++ 8017if(c==="\n"){parser.line++ 8018parser.column=0}else parser.column++}}parser.textNode+=chunk.substring(starti,i-1)}if(c!=="<"||parser.sawRoot&&parser.closedRoot&&!parser.strict){isWhitespace(c)||parser.sawRoot&&!parser.closedRoot||strictFail(parser,"Text data outside of root node.") 8019c==="&"?parser.state=S.TEXT_ENTITY:parser.textNode+=c}else{parser.state=S.OPEN_WAKA 8020parser.startTagPosition=parser.position}continue 8021case S.SCRIPT:c==="<"?parser.state=S.SCRIPT_ENDING:parser.script+=c 8022continue 8023case S.SCRIPT_ENDING:if(c==="/")parser.state=S.CLOSE_TAG 8024else{parser.script+="<"+c 8025parser.state=S.SCRIPT}continue 8026case S.OPEN_WAKA:if(c==="!"){parser.state=S.SGML_DECL 8027parser.sgmlDecl=""}else if(isWhitespace(c));else if(isMatch(nameStart,c)){parser.state=S.OPEN_TAG 8028parser.tagName=c}else if(c==="/"){parser.state=S.CLOSE_TAG 8029parser.tagName=""}else if(c==="?"){parser.state=S.PROC_INST 8030parser.procInstName=parser.procInstBody=""}else{strictFail(parser,"Unencoded <") 8031if(parser.startTagPosition+1<parser.position){var pad=parser.position-parser.startTagPosition 8032c=new Array(pad).join(" ")+c}parser.textNode+="<"+c 8033parser.state=S.TEXT}continue 8034case S.SGML_DECL:if(parser.sgmlDecl+c==="--"){parser.state=S.COMMENT 8035parser.comment="" 8036parser.sgmlDecl="" 8037continue}if(parser.doctype&&parser.doctype!==true&&parser.sgmlDecl){parser.state=S.DOCTYPE_DTD 8038parser.doctype+="<!"+parser.sgmlDecl+c 8039parser.sgmlDecl=""}else if((parser.sgmlDecl+c).toUpperCase()===CDATA){emitNode(parser,"onopencdata") 8040parser.state=S.CDATA 8041parser.sgmlDecl="" 8042parser.cdata=""}else if((parser.sgmlDecl+c).toUpperCase()===DOCTYPE){parser.state=S.DOCTYPE;(parser.doctype||parser.sawRoot)&&strictFail(parser,"Inappropriately located doctype declaration") 8043parser.doctype="" 8044parser.sgmlDecl=""}else if(c===">"){emitNode(parser,"onsgmldeclaration",parser.sgmlDecl) 8045parser.sgmlDecl="" 8046parser.state=S.TEXT}else if(isQuote(c)){parser.state=S.SGML_DECL_QUOTED 8047parser.sgmlDecl+=c}else parser.sgmlDecl+=c 8048continue 8049case S.SGML_DECL_QUOTED:if(c===parser.q){parser.state=S.SGML_DECL 8050parser.q=""}parser.sgmlDecl+=c 8051continue 8052case S.DOCTYPE:if(c===">"){parser.state=S.TEXT 8053emitNode(parser,"ondoctype",parser.doctype) 8054parser.doctype=true}else{parser.doctype+=c 8055if(c==="[")parser.state=S.DOCTYPE_DTD 8056else if(isQuote(c)){parser.state=S.DOCTYPE_QUOTED 8057parser.q=c}}continue 8058case S.DOCTYPE_QUOTED:parser.doctype+=c 8059if(c===parser.q){parser.q="" 8060parser.state=S.DOCTYPE}continue 8061case S.DOCTYPE_DTD:if(c==="]"){parser.doctype+=c 8062parser.state=S.DOCTYPE}else if(c==="<"){parser.state=S.OPEN_WAKA 8063parser.startTagPosition=parser.position}else if(isQuote(c)){parser.doctype+=c 8064parser.state=S.DOCTYPE_DTD_QUOTED 8065parser.q=c}else parser.doctype+=c 8066continue 8067case S.DOCTYPE_DTD_QUOTED:parser.doctype+=c 8068if(c===parser.q){parser.state=S.DOCTYPE_DTD 8069parser.q=""}continue 8070case S.COMMENT:c==="-"?parser.state=S.COMMENT_ENDING:parser.comment+=c 8071continue 8072case S.COMMENT_ENDING:if(c==="-"){parser.state=S.COMMENT_ENDED 8073parser.comment=textopts(parser.opt,parser.comment) 8074parser.comment&&emitNode(parser,"oncomment",parser.comment) 8075parser.comment=""}else{parser.comment+="-"+c 8076parser.state=S.COMMENT}continue 8077case S.COMMENT_ENDED:if(c!==">"){strictFail(parser,"Malformed comment") 8078parser.comment+="--"+c 8079parser.state=S.COMMENT}else parser.doctype&&parser.doctype!==true?parser.state=S.DOCTYPE_DTD:parser.state=S.TEXT 8080continue 8081case S.CDATA:c==="]"?parser.state=S.CDATA_ENDING:parser.cdata+=c 8082continue 8083case S.CDATA_ENDING:if(c==="]")parser.state=S.CDATA_ENDING_2 8084else{parser.cdata+="]"+c 8085parser.state=S.CDATA}continue 8086case S.CDATA_ENDING_2:if(c===">"){parser.cdata&&emitNode(parser,"oncdata",parser.cdata) 8087emitNode(parser,"onclosecdata") 8088parser.cdata="" 8089parser.state=S.TEXT}else if(c==="]")parser.cdata+="]" 8090else{parser.cdata+="]]"+c 8091parser.state=S.CDATA}continue 8092case S.PROC_INST:c==="?"?parser.state=S.PROC_INST_ENDING:isWhitespace(c)?parser.state=S.PROC_INST_BODY:parser.procInstName+=c 8093continue 8094case S.PROC_INST_BODY:if(!parser.procInstBody&&isWhitespace(c))continue 8095c==="?"?parser.state=S.PROC_INST_ENDING:parser.procInstBody+=c 8096continue 8097case S.PROC_INST_ENDING:if(c===">"){emitNode(parser,"onprocessinginstruction",{name:parser.procInstName,body:parser.procInstBody}) 8098parser.procInstName=parser.procInstBody="" 8099parser.state=S.TEXT}else{parser.procInstBody+="?"+c 8100parser.state=S.PROC_INST_BODY}continue 8101case S.OPEN_TAG:if(isMatch(nameBody,c))parser.tagName+=c 8102else{newTag(parser) 8103if(c===">")openTag(parser) 8104else if(c==="/")parser.state=S.OPEN_TAG_SLASH 8105else{isWhitespace(c)||strictFail(parser,"Invalid character in tag name") 8106parser.state=S.ATTRIB}}continue 8107case S.OPEN_TAG_SLASH:if(c===">"){openTag(parser,true) 8108closeTag(parser)}else{strictFail(parser,"Forward-slash in opening tag not followed by >") 8109parser.state=S.ATTRIB}continue 8110case S.ATTRIB:if(isWhitespace(c))continue 8111if(c===">")openTag(parser) 8112else if(c==="/")parser.state=S.OPEN_TAG_SLASH 8113else if(isMatch(nameStart,c)){parser.attribName=c 8114parser.attribValue="" 8115parser.state=S.ATTRIB_NAME}else strictFail(parser,"Invalid attribute name") 8116continue 8117case S.ATTRIB_NAME:if(c==="=")parser.state=S.ATTRIB_VALUE 8118else if(c===">"){strictFail(parser,"Attribute without value") 8119parser.attribValue=parser.attribName 8120attrib(parser) 8121openTag(parser)}else isWhitespace(c)?parser.state=S.ATTRIB_NAME_SAW_WHITE:isMatch(nameBody,c)?parser.attribName+=c:strictFail(parser,"Invalid attribute name") 8122continue 8123case S.ATTRIB_NAME_SAW_WHITE:if(c==="=")parser.state=S.ATTRIB_VALUE 8124else{if(isWhitespace(c))continue 8125strictFail(parser,"Attribute without value") 8126parser.tag.attributes[parser.attribName]="" 8127parser.attribValue="" 8128emitNode(parser,"onattribute",{name:parser.attribName,value:""}) 8129parser.attribName="" 8130if(c===">")openTag(parser) 8131else if(isMatch(nameStart,c)){parser.attribName=c 8132parser.state=S.ATTRIB_NAME}else{strictFail(parser,"Invalid attribute name") 8133parser.state=S.ATTRIB}}continue 8134case S.ATTRIB_VALUE:if(isWhitespace(c))continue 8135if(isQuote(c)){parser.q=c 8136parser.state=S.ATTRIB_VALUE_QUOTED}else{parser.opt.unquotedAttributeValues||error(parser,"Unquoted attribute value") 8137parser.state=S.ATTRIB_VALUE_UNQUOTED 8138parser.attribValue=c}continue 8139case S.ATTRIB_VALUE_QUOTED:if(c!==parser.q){c==="&"?parser.state=S.ATTRIB_VALUE_ENTITY_Q:parser.attribValue+=c 8140continue}attrib(parser) 8141parser.q="" 8142parser.state=S.ATTRIB_VALUE_CLOSED 8143continue 8144case S.ATTRIB_VALUE_CLOSED:if(isWhitespace(c))parser.state=S.ATTRIB 8145else if(c===">")openTag(parser) 8146else if(c==="/")parser.state=S.OPEN_TAG_SLASH 8147else if(isMatch(nameStart,c)){strictFail(parser,"No whitespace between attributes") 8148parser.attribName=c 8149parser.attribValue="" 8150parser.state=S.ATTRIB_NAME}else strictFail(parser,"Invalid attribute name") 8151continue 8152case S.ATTRIB_VALUE_UNQUOTED:if(!isAttribEnd(c)){c==="&"?parser.state=S.ATTRIB_VALUE_ENTITY_U:parser.attribValue+=c 8153continue}attrib(parser) 8154c===">"?openTag(parser):parser.state=S.ATTRIB 8155continue 8156case S.CLOSE_TAG:if(parser.tagName)if(c===">")closeTag(parser) 8157else if(isMatch(nameBody,c))parser.tagName+=c 8158else if(parser.script){parser.script+="</"+parser.tagName 8159parser.tagName="" 8160parser.state=S.SCRIPT}else{isWhitespace(c)||strictFail(parser,"Invalid tagname in closing tag") 8161parser.state=S.CLOSE_TAG_SAW_WHITE}else{if(isWhitespace(c))continue 8162if(notMatch(nameStart,c))if(parser.script){parser.script+="</"+c 8163parser.state=S.SCRIPT}else strictFail(parser,"Invalid tagname in closing tag.") 8164else parser.tagName=c}continue 8165case S.CLOSE_TAG_SAW_WHITE:if(isWhitespace(c))continue 8166c===">"?closeTag(parser):strictFail(parser,"Invalid characters in closing tag") 8167continue 8168case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var returnState 8169var buffer 8170switch(parser.state){case S.TEXT_ENTITY:returnState=S.TEXT 8171buffer="textNode" 8172break 8173case S.ATTRIB_VALUE_ENTITY_Q:returnState=S.ATTRIB_VALUE_QUOTED 8174buffer="attribValue" 8175break 8176case S.ATTRIB_VALUE_ENTITY_U:returnState=S.ATTRIB_VALUE_UNQUOTED 8177buffer="attribValue" 8178break}if(c===";"){var parsedEntity=parseEntity(parser) 8179if(parser.opt.unparsedEntities&&!Object.values(sax.XML_ENTITIES).includes(parsedEntity)){parser.entity="" 8180parser.state=returnState 8181parser.write(parsedEntity)}else{parser[buffer]+=parsedEntity 8182parser.entity="" 8183parser.state=returnState}}else if(isMatch(parser.entity.length?entityBody:entityStart,c))parser.entity+=c 8184else{strictFail(parser,"Invalid character in entity name") 8185parser[buffer]+="&"+parser.entity+c 8186parser.entity="" 8187parser.state=returnState}continue 8188default:throw new Error(parser,"Unknown state: "+parser.state)}}parser.position>=parser.bufferCheckPosition&&checkBufferLength(parser) 8189return parser}String.fromCodePoint||function(){var stringFromCharCode=String.fromCharCode 8190var floor=Math.floor 8191var fromCodePoint=function(){var MAX_SIZE=0x4000 8192var codeUnits=[] 8193var highSurrogate 8194var lowSurrogate 8195var index=-1 8196var length=arguments.length 8197if(!length)return"" 8198var result="" 8199while(++index<length){var codePoint=Number(arguments[index]) 8200if(!isFinite(codePoint)||codePoint<0||codePoint>0x10FFFF||floor(codePoint)!==codePoint)throw RangeError("Invalid code point: "+codePoint) 8201if(codePoint<=0xFFFF)codeUnits.push(codePoint) 8202else{codePoint-=0x10000 8203highSurrogate=0xD800+(codePoint>>10) 8204lowSurrogate=codePoint%0x400+0xDC00 8205codeUnits.push(highSurrogate,lowSurrogate)}if(index+1===length||codeUnits.length>MAX_SIZE){result+=stringFromCharCode.apply(null,codeUnits) 8206codeUnits.length=0}}return result} 8207Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true}):String.fromCodePoint=fromCodePoint}()})(exports)})(sax) 8208var SAX=getDefaultExportFromCjs(sax) 8209class SvgoParserError extends Error{constructor(message,line,column,source,file){super(message) 8210this.name="SvgoParserError" 8211this.message=`${file||"<input>"}:${line}:${column}: ${message}` 8212this.reason=message 8213this.line=line 8214this.column=column 8215this.source=source 8216Error.captureStackTrace&&Error.captureStackTrace(this,SvgoParserError)}toString(){const lines=this.source.split(/\r?\n/) 8217const startLine=Math.max(this.line-3,0) 8218const endLine=Math.min(this.line+2,lines.length) 8219const lineNumberWidth=String(endLine).length 8220const startColumn=Math.max(this.column-54,0) 8221const endColumn=Math.max(this.column+20,80) 8222const code=lines.slice(startLine,endLine).map(((line,index)=>{const lineSlice=line.slice(startColumn,endColumn) 8223let ellipsisPrefix="" 8224let ellipsisSuffix="" 8225startColumn!==0&&(ellipsisPrefix=startColumn>line.length-1?" ":"â¦") 8226endColumn<line.length-1&&(ellipsisSuffix="â¦") 8227const number=startLine+1+index 8228const gutter=` ${number.toString().padStart(lineNumberWidth)} | ` 8229if(number===this.line){const gutterSpacing=gutter.replace(/[^|]/g," ") 8230const lineSpacing=(ellipsisPrefix+line.slice(startColumn,this.column-1)).replace(/[^\t]/g," ") 8231const spacing=gutterSpacing+lineSpacing 8232return`>${gutter}${ellipsisPrefix}${lineSlice}${ellipsisSuffix}\n ${spacing}^`}return` ${gutter}${ellipsisPrefix}${lineSlice}${ellipsisSuffix}`})).join("\n") 8233return`${this.name}: ${this.message}\n\n${code}\n`}}const entityDeclaration=/<!ENTITY\s+(\S+)\s+(?:'([^']+)'|"([^"]+)")\s*>/g 8234const config={strict:true,trim:false,normalize:false,lowercase:true,xmlns:true,position:true,unparsedEntities:true} 8235const parseSvg=(data,from)=>{const sax=SAX.parser(config.strict,config) 8236const root={type:"root",children:[]} 8237let current=root 8238const stack=[root] 8239const pushToContent=node=>{current.children.push(node)} 8240sax.ondoctype=doctype=>{const node={type:"doctype",name:"svg",data:{doctype:doctype}} 8241pushToContent(node) 8242const subsetStart=doctype.indexOf("[") 8243if(subsetStart>=0){entityDeclaration.lastIndex=subsetStart 8244let entityMatch=entityDeclaration.exec(data) 8245while(entityMatch!=null){sax.ENTITIES[entityMatch[1]]=entityMatch[2]||entityMatch[3] 8246entityMatch=entityDeclaration.exec(data)}}} 8247sax.onprocessinginstruction=data=>{const node={type:"instruction",name:data.name,value:data.body} 8248pushToContent(node)} 8249sax.oncomment=comment=>{const node={type:"comment",value:comment.trim()} 8250pushToContent(node)} 8251sax.oncdata=cdata=>{const node={type:"cdata",value:cdata} 8252pushToContent(node)} 8253sax.onopentag=data=>{const element={type:"element",name:data.name,attributes:{},children:[]} 8254for(const[name,attr]of Object.entries(data.attributes))element.attributes[name]=attr.value 8255pushToContent(element) 8256current=element 8257stack.push(element)} 8258sax.ontext=text=>{if(current.type==="element")if(textElems.has(current.name)){const node={type:"text",value:text} 8259pushToContent(node)}else{const value=text.trim() 8260if(value!==""){const node={type:"text",value:value} 8261pushToContent(node)}}} 8262sax.onclosetag=()=>{stack.pop() 8263current=stack[stack.length-1]} 8264sax.onerror=e=>{const reason=e.message.split("\n")[0] 8265const error=new SvgoParserError(reason,sax.line+1,sax.column,data,from) 8266if(e.message.indexOf("Unexpected end")===-1)throw error} 8267sax.write(data).close() 8268return root} 8269const encodeEntity=char=>entities[char] 8270const defaults={doctypeStart:"<!DOCTYPE",doctypeEnd:">",procInstStart:"<?",procInstEnd:"?>",tagOpenStart:"<",tagOpenEnd:">",tagCloseStart:"</",tagCloseEnd:">",tagShortStart:"<",tagShortEnd:"/>",attrStart:'="',attrEnd:'"',commentStart:"\x3c!--",commentEnd:"--\x3e",cdataStart:"<![CDATA[",cdataEnd:"]]>",textStart:"",textEnd:"",indent:4,regEntities:/[&'"<>]/g,regValEntities:/[&"<>]/g,encodeEntity:encodeEntity,pretty:false,useShortTags:true,eol:"lf",finalNewline:false} 8271const entities={"&":"&","'":"'",'"':""",">":">","<":"<"} 8272const stringifySvg=(data,userOptions={})=>{const config={...defaults,...userOptions} 8273const indent=config.indent 8274let newIndent=" " 8275typeof indent==="number"&&Number.isNaN(indent)===false?newIndent=indent<0?"\t":" ".repeat(indent):typeof indent==="string"&&(newIndent=indent) 8276const state={indent:newIndent,textContext:null,indentLevel:0} 8277const eol=config.eol==="crlf"?"\r\n":"\n" 8278if(config.pretty){config.doctypeEnd+=eol 8279config.procInstEnd+=eol 8280config.commentEnd+=eol 8281config.cdataEnd+=eol 8282config.tagShortEnd+=eol 8283config.tagOpenEnd+=eol 8284config.tagCloseEnd+=eol 8285config.textEnd+=eol}let svg=stringifyNode(data,config,state) 8286config.finalNewline&&svg.length>0&&!svg.endsWith("\n")&&(svg+=eol) 8287return svg} 8288const stringifyNode=(data,config,state)=>{let svg="" 8289state.indentLevel++ 8290for(const item of data.children)switch(item.type){case"element":svg+=stringifyElement(item,config,state) 8291break 8292case"text":svg+=stringifyText(item,config,state) 8293break 8294case"doctype":svg+=stringifyDoctype(item,config) 8295break 8296case"instruction":svg+=stringifyInstruction(item,config) 8297break 8298case"comment":svg+=stringifyComment(item,config) 8299break 8300case"cdata":svg+=stringifyCdata(item,config,state)}state.indentLevel-- 8301return svg} 8302const createIndent=(config,state)=>{let indent="" 8303config.pretty&&state.textContext==null&&(indent=state.indent.repeat(state.indentLevel-1)) 8304return indent} 8305const stringifyDoctype=(node,config)=>config.doctypeStart+node.data.doctype+config.doctypeEnd 8306const stringifyInstruction=(node,config)=>config.procInstStart+node.name+" "+node.value+config.procInstEnd 8307const stringifyComment=(node,config)=>config.commentStart+node.value+config.commentEnd 8308const stringifyCdata=(node,config,state)=>createIndent(config,state)+config.cdataStart+node.value+config.cdataEnd 8309const stringifyElement=(node,config,state)=>{if(node.children.length===0){if(config.useShortTags)return createIndent(config,state)+config.tagShortStart+node.name+stringifyAttributes(node,config)+config.tagShortEnd 8310return createIndent(config,state)+config.tagShortStart+node.name+stringifyAttributes(node,config)+config.tagOpenEnd+config.tagCloseStart+node.name+config.tagCloseEnd}let tagOpenStart=config.tagOpenStart 8311let tagOpenEnd=config.tagOpenEnd 8312let tagCloseStart=config.tagCloseStart 8313let tagCloseEnd=config.tagCloseEnd 8314let openIndent=createIndent(config,state) 8315let closeIndent=createIndent(config,state) 8316if(state.textContext){tagOpenStart=defaults.tagOpenStart 8317tagOpenEnd=defaults.tagOpenEnd 8318tagCloseStart=defaults.tagCloseStart 8319tagCloseEnd=defaults.tagCloseEnd 8320openIndent=""}else if(textElems.has(node.name)){tagOpenEnd=defaults.tagOpenEnd 8321tagCloseStart=defaults.tagCloseStart 8322closeIndent="" 8323state.textContext=node}const children=stringifyNode(node,config,state) 8324state.textContext===node&&(state.textContext=null) 8325return openIndent+tagOpenStart+node.name+stringifyAttributes(node,config)+tagOpenEnd+children+closeIndent+tagCloseStart+node.name+tagCloseEnd} 8326const stringifyAttributes=(node,config)=>{let attrs="" 8327for(const[name,value]of Object.entries(node.attributes)){attrs+=" "+name 8328if(value!==void 0){const encodedValue=value.toString().replace(config.regValEntities,config.encodeEntity) 8329attrs+=config.attrStart+encodedValue+config.attrEnd}}return attrs} 8330const stringifyText=(node,config,state)=>createIndent(config,state)+config.textStart+node.value.replace(config.regEntities,config.encodeEntity)+(state.textContext?"":config.textEnd) 8331const VERSION="4.0.0" 8332const pluginsMap=new Map 8333for(const plugin of builtinPlugins)pluginsMap.set(plugin.name,plugin) 8334function getPlugin(name){if(name==="removeScriptElement"){console.warn("Warning: removeScriptElement has been renamed to removeScripts, please update your SVGO config") 8335return pluginsMap.get("removeScripts")}return pluginsMap.get(name)}const resolvePluginConfig=plugin=>{if(typeof plugin==="string"){const builtinPlugin=getPlugin(plugin) 8336if(builtinPlugin==null)throw Error(`Unknown builtin plugin "${plugin}" specified.`) 8337return{name:plugin,params:{},fn:builtinPlugin.fn}}if(typeof plugin==="object"&&plugin!=null){if(plugin.name==null)throw Error("Plugin name must be specified") 8338let fn=plugin.fn 8339if(fn==null){const builtinPlugin=getPlugin(plugin.name) 8340if(builtinPlugin==null)throw Error(`Unknown builtin plugin "${plugin.name}" specified.`) 8341fn=builtinPlugin.fn}return{name:plugin.name,params:plugin.params,fn:fn}}return null} 8342const optimize=(input,config)=>{config==null&&(config={}) 8343if(typeof config!=="object")throw Error("Config should be an object") 8344const maxPassCount=config.multipass?10:1 8345let prevResultSize=Number.POSITIVE_INFINITY 8346let output="" 8347const info={} 8348config.path!=null&&(info.path=config.path) 8349for(let i=0;i<maxPassCount;i+=1){info.multipassCount=i 8350const ast=parseSvg(input,config.path) 8351const plugins=config.plugins||["preset-default"] 8352if(!Array.isArray(plugins))throw Error("malformed config, `plugins` property must be an array.\nSee more info here: https://github.com/svg/svgo#configuration") 8353const resolvedPlugins=plugins.filter((plugin=>plugin!=null)).map(resolvePluginConfig) 8354resolvedPlugins.length<plugins.length&&console.warn("Warning: plugins list includes null or undefined elements, these will be ignored.") 8355const globalOverrides={} 8356config.floatPrecision!=null&&(globalOverrides.floatPrecision=config.floatPrecision) 8357invokePlugins(ast,info,resolvedPlugins,null,globalOverrides) 8358output=stringifySvg(ast,config.js2svg) 8359if(!(output.length<prevResultSize))break 8360input=output 8361prevResultSize=output.length}config.datauri&&(output=encodeSVGDatauri(output,config.datauri)) 8362return{data:output}} 8363export{VERSION,_collections,builtinPlugins,mapNodesToParents,optimize,querySelector,querySelectorAll}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.