"use strict";exports.id=920,exports.ids=[920],exports.modules={866:(e,t,n)=>{var r;n.r(t),n.d(t,{ClientCapabilities:()=>rr,CodeAction:()=>Pn,CodeActionContext:()=>In,CodeActionKind:()=>Dn,Color:()=>At,ColorInformation:()=>Wt,ColorPresentation:()=>qt,Command:()=>Ht,CompletionItem:()=>gn,CompletionItemKind:()=>dn,CompletionItemTag:()=>pn,CompletionList:()=>bn,Diagnostic:()=>Kt,DiagnosticSeverity:()=>Ut,DocumentHighlight:()=>Cn,DocumentHighlightKind:()=>xn,DocumentLink:()=>zn,DocumentSymbol:()=>Rn,DocumentUri:()=>Dt,FileType:()=>ir,FoldingRange:()=>jt,FoldingRangeKind:()=>Lt,Hover:()=>vn,InsertTextFormat:()=>hn,Location:()=>zt,MarkedString:()=>yn,MarkupContent:()=>ln,MarkupKind:()=>cn,Position:()=>Mt,Range:()=>Ot,SelectionRange:()=>Nn,SymbolInformation:()=>En,SymbolKind:()=>kn,TextDocument:()=>nr,TextDocumentEdit:()=>Qt,TextEdit:()=>Gt,VersionedTextDocumentIdentifier:()=>on,WorkspaceEdit:()=>nn,getCSSLanguageService:()=>xs,getDefaultCSSDataProvider:()=>ys,getLESSLanguageService:()=>ks,getSCSSLanguageService:()=>Cs,newCSSDataProvider:()=>vs}),function(e){e[e.Ident=0]="Ident",e[e.AtKeyword=1]="AtKeyword",e[e.String=2]="String",e[e.BadString=3]="BadString",e[e.UnquotedString=4]="UnquotedString",e[e.Hash=5]="Hash",e[e.Num=6]="Num",e[e.Percentage=7]="Percentage",e[e.Dimension=8]="Dimension",e[e.UnicodeRange=9]="UnicodeRange",e[e.CDO=10]="CDO",e[e.CDC=11]="CDC",e[e.Colon=12]="Colon",e[e.SemiColon=13]="SemiColon",e[e.CurlyL=14]="CurlyL",e[e.CurlyR=15]="CurlyR",e[e.ParenthesisL=16]="ParenthesisL",e[e.ParenthesisR=17]="ParenthesisR",e[e.BracketL=18]="BracketL",e[e.BracketR=19]="BracketR",e[e.Whitespace=20]="Whitespace",e[e.Includes=21]="Includes",e[e.Dashmatch=22]="Dashmatch",e[e.SubstringOperator=23]="SubstringOperator",e[e.PrefixOperator=24]="PrefixOperator",e[e.SuffixOperator=25]="SuffixOperator",e[e.Delim=26]="Delim",e[e.EMS=27]="EMS",e[e.EXS=28]="EXS",e[e.Length=29]="Length",e[e.Angle=30]="Angle",e[e.Time=31]="Time",e[e.Freq=32]="Freq",e[e.Exclamation=33]="Exclamation",e[e.Resolution=34]="Resolution",e[e.Comma=35]="Comma",e[e.Charset=36]="Charset",e[e.EscapedJavaScript=37]="EscapedJavaScript",e[e.BadEscapedJavaScript=38]="BadEscapedJavaScript",e[e.Comment=39]="Comment",e[e.SingleLineComment=40]="SingleLineComment",e[e.EOF=41]="EOF",e[e.ContainerQueryLength=42]="ContainerQueryLength",e[e.CustomToken=43]="CustomToken"}(r||(r={}));class i{constructor(e){this.source=e,this.len=e.length,this.position=0}substring(e,t=this.position){return this.source.substring(e,t)}eos(){return this.len<=this.position}pos(){return this.position}goBackTo(e){this.position=e}goBack(e){this.position-=e}advance(e){this.position+=e}nextChar(){return this.source.charCodeAt(this.position++)||0}peekChar(e=0){return this.source.charCodeAt(this.position+e)||0}lookbackChar(e=0){return this.source.charCodeAt(this.position-e)||0}advanceIfChar(e){return e===this.source.charCodeAt(this.position)&&(this.position++,!0)}advanceIfChars(e){if(this.position+e.length>this.source.length)return!1;let t=0;for(;t".charCodeAt(0),_="@".charCodeAt(0),E="#".charCodeAt(0),F="$".charCodeAt(0),R="\\".charCodeAt(0),D="/".charCodeAt(0),T="\n".charCodeAt(0),I="\r".charCodeAt(0),P="\f".charCodeAt(0),M='"'.charCodeAt(0),O="'".charCodeAt(0),z=" ".charCodeAt(0),N="\t".charCodeAt(0),A=";".charCodeAt(0),W=":".charCodeAt(0),q="{".charCodeAt(0),L="}".charCodeAt(0),j="[".charCodeAt(0),$="]".charCodeAt(0),U=",".charCodeAt(0),V=".".charCodeAt(0),B="!".charCodeAt(0),K="?".charCodeAt(0),H="+".charCodeAt(0),G={};G[A]=r.SemiColon,G[W]=r.Colon,G[q]=r.CurlyL,G[L]=r.CurlyR,G[$]=r.BracketR,G[j]=r.BracketL,G[S]=r.ParenthesisL,G[x]=r.ParenthesisR,G[U]=r.Comma;const J={};J.em=r.EMS,J.ex=r.EXS,J.px=r.Length,J.cm=r.Length,J.mm=r.Length,J.in=r.Length,J.pt=r.Length,J.pc=r.Length,J.deg=r.Angle,J.rad=r.Angle,J.grad=r.Angle,J.ms=r.Time,J.s=r.Time,J.hz=r.Freq,J.khz=r.Freq,J["%"]=r.Percentage,J.fr=r.Percentage,J.dpi=r.Resolution,J.dpcm=r.Resolution,J.cqw=r.ContainerQueryLength,J.cqh=r.ContainerQueryLength,J.cqi=r.ContainerQueryLength,J.cqb=r.ContainerQueryLength,J.cqmin=r.ContainerQueryLength,J.cqmax=r.ContainerQueryLength;class X{constructor(){this.stream=new i(""),this.ignoreComment=!0,this.ignoreWhitespace=!0,this.inURL=!1}setSource(e){this.stream=new i(e)}finishToken(e,t,n){return{offset:e,len:this.stream.pos()-e,type:t,text:n||this.stream.substring(e)}}substring(e,t){return this.stream.substring(e,e+t)}pos(){return this.stream.pos()}goBackTo(e){this.stream.goBackTo(e)}scanUnquotedString(){const e=this.stream.pos(),t=[];return this._unquotedString(t)?this.finishToken(e,r.UnquotedString,t.join("")):null}scan(){const e=this.trivia();if(null!==e)return e;const t=this.stream.pos();return this.stream.eos()?this.finishToken(t,r.EOF):this.scanNext(t)}tryScanUnicode(){const e=this.stream.pos();if(!this.stream.eos()&&this._unicodeRange())return this.finishToken(e,r.UnicodeRange);this.stream.goBackTo(e)}scanNext(e){if(this.stream.advanceIfChars([C,B,b,b]))return this.finishToken(e,r.CDO);if(this.stream.advanceIfChars([b,b,k]))return this.finishToken(e,r.CDC);let t=[];if(this.ident(t))return this.finishToken(e,r.Ident,t.join(""));if(this.stream.advanceIfChar(_)){if(t=["@"],this._name(t)){const n=t.join("");return"@charset"===n?this.finishToken(e,r.Charset,n):this.finishToken(e,r.AtKeyword,n)}return this.finishToken(e,r.Delim)}if(this.stream.advanceIfChar(E))return t=["#"],this._name(t)?this.finishToken(e,r.Hash,t.join("")):this.finishToken(e,r.Delim);if(this.stream.advanceIfChar(B))return this.finishToken(e,r.Exclamation);if(this._number()){const n=this.stream.pos();if(t=[this.stream.substring(e,n)],this.stream.advanceIfChar(v))return this.finishToken(e,r.Percentage);if(this.ident(t)){const i=this.stream.substring(n).toLowerCase(),o=J[i];return void 0!==o?this.finishToken(e,o,t.join("")):this.finishToken(e,r.Dimension,t.join(""))}return this.finishToken(e,r.Num)}t=[];let n=this._string(t);return null!==n?this.finishToken(e,n,t.join("")):(n=G[this.stream.peekChar()],void 0!==n?(this.stream.advance(1),this.finishToken(e,n)):this.stream.peekChar(0)===u&&this.stream.peekChar(1)===f?(this.stream.advance(2),this.finishToken(e,r.Includes)):this.stream.peekChar(0)===g&&this.stream.peekChar(1)===f?(this.stream.advance(2),this.finishToken(e,r.Dashmatch)):this.stream.peekChar(0)===w&&this.stream.peekChar(1)===f?(this.stream.advance(2),this.finishToken(e,r.SubstringOperator)):this.stream.peekChar(0)===m&&this.stream.peekChar(1)===f?(this.stream.advance(2),this.finishToken(e,r.PrefixOperator)):this.stream.peekChar(0)===F&&this.stream.peekChar(1)===f?(this.stream.advance(2),this.finishToken(e,r.SuffixOperator)):(this.stream.nextChar(),this.finishToken(e,r.Delim)))}trivia(){for(;;){const e=this.stream.pos();if(this._whitespace()){if(!this.ignoreWhitespace)return this.finishToken(e,r.Whitespace)}else{if(!this.comment())return null;if(!this.ignoreComment)return this.finishToken(e,r.Comment)}}}comment(){if(this.stream.advanceIfChars([D,w])){let e=!1,t=!1;return this.stream.advanceWhileChar((n=>t&&n===D?(e=!0,!1):(t=n===w,!0))),e&&this.stream.advance(1),!0}return!1}_number(){let e,t=0;return this.stream.peekChar()===V&&(t=1),e=this.stream.peekChar(t),e>=h&&e<=p&&(this.stream.advance(t+1),this.stream.advanceWhileChar((e=>e>=h&&e<=p||0===t&&e===V)),!0)}_newline(e){const t=this.stream.peekChar();switch(t){case I:case P:case T:return this.stream.advance(1),e.push(String.fromCharCode(t)),t===I&&this.stream.advanceIfChar(T)&&e.push("\n"),!0}return!1}_escape(e,t){let n=this.stream.peekChar();if(n===R){this.stream.advance(1),n=this.stream.peekChar();let r=0;for(;r<6&&(n>=h&&n<=p||n>=o&&n<=s||n>=c&&n<=l);)this.stream.advance(1),n=this.stream.peekChar(),r++;if(r>0){try{const t=parseInt(this.stream.substring(this.stream.pos()-r),16);t&&e.push(String.fromCharCode(t))}catch(e){}return n===z||n===N?this.stream.advance(1):this._newline([]),!0}if(n!==I&&n!==P&&n!==T)return this.stream.advance(1),e.push(String.fromCharCode(n)),!0;if(t)return this._newline(e)}return!1}_stringChar(e,t){const n=this.stream.peekChar();return 0!==n&&n!==e&&n!==R&&n!==I&&n!==P&&n!==T&&(this.stream.advance(1),t.push(String.fromCharCode(n)),!0)}_string(e){if(this.stream.peekChar()===O||this.stream.peekChar()===M){const t=this.stream.nextChar();for(e.push(String.fromCharCode(t));this._stringChar(t,e)||this._escape(e,!0););return this.stream.peekChar()===t?(this.stream.nextChar(),e.push(String.fromCharCode(t)),r.String):r.BadString}return null}_unquotedChar(e){const t=this.stream.peekChar();return 0!==t&&t!==R&&t!==O&&t!==M&&t!==S&&t!==x&&t!==z&&t!==N&&t!==T&&t!==P&&t!==I&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)}_unquotedString(e){let t=!1;for(;this._unquotedChar(e)||this._escape(e);)t=!0;return t}_whitespace(){return this.stream.advanceWhileChar((e=>e===z||e===N||e===T||e===P||e===I))>0}_name(e){let t=!1;for(;this._identChar(e)||this._escape(e);)t=!0;return t}ident(e){const t=this.stream.pos();if(this._minus(e)){if(this._minus(e)||this._identFirstChar(e)||this._escape(e)){for(;this._identChar(e)||this._escape(e););return!0}}else if(this._identFirstChar(e)||this._escape(e)){for(;this._identChar(e)||this._escape(e););return!0}return this.stream.goBackTo(t),!1}_identFirstChar(e){const t=this.stream.peekChar();return(t===y||t>=o&&t<=a||t>=c&&t<=d||t>=128&&t<=65535)&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)}_minus(e){const t=this.stream.peekChar();return t===b&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)}_identChar(e){const t=this.stream.peekChar();return(t===y||t===b||t>=o&&t<=a||t>=c&&t<=d||t>=h&&t<=p||t>=128&&t<=65535)&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)}_unicodeRange(){if(this.stream.advanceIfChar(H)){const e=e=>e>=h&&e<=p||e>=o&&e<=s||e>=c&&e<=l,t=this.stream.advanceWhileChar(e)+this.stream.advanceWhileChar((e=>e===K));if(t>=1&&t<=6){if(!this.stream.advanceIfChar(b))return!0;{const t=this.stream.advanceWhileChar(e);if(t>=1&&t<=6)return!0}}}return!1}}function Y(e,t){if(e.length0?e.lastIndexOf(t)===n:0===n&&e===t}function Z(e,t=!0){return e?e.length<140?e:e.slice(0,140)+(t?"…":""):""}function ee(e,t){let n="";for(;t>0;)1&~t||(n+=e),e+=e,t>>>=1;return n}var te,ne;function re(e,t){let n=null;return!e||te.end?null:(e.accept((e=>-1===e.offset&&-1===e.length||e.offset<=t&&e.end>=t&&(n?e.length<=n.length&&(n=e):n=e,!0))),n)}function ie(e,t){let n=re(e,t);const r=[];for(;n;)r.unshift(n),n=n.parent;return r}!function(e){e[e.Undefined=0]="Undefined",e[e.Identifier=1]="Identifier",e[e.Stylesheet=2]="Stylesheet",e[e.Ruleset=3]="Ruleset",e[e.Selector=4]="Selector",e[e.SimpleSelector=5]="SimpleSelector",e[e.SelectorInterpolation=6]="SelectorInterpolation",e[e.SelectorCombinator=7]="SelectorCombinator",e[e.SelectorCombinatorParent=8]="SelectorCombinatorParent",e[e.SelectorCombinatorSibling=9]="SelectorCombinatorSibling",e[e.SelectorCombinatorAllSiblings=10]="SelectorCombinatorAllSiblings",e[e.SelectorCombinatorShadowPiercingDescendant=11]="SelectorCombinatorShadowPiercingDescendant",e[e.Page=12]="Page",e[e.PageBoxMarginBox=13]="PageBoxMarginBox",e[e.ClassSelector=14]="ClassSelector",e[e.IdentifierSelector=15]="IdentifierSelector",e[e.ElementNameSelector=16]="ElementNameSelector",e[e.PseudoSelector=17]="PseudoSelector",e[e.AttributeSelector=18]="AttributeSelector",e[e.Declaration=19]="Declaration",e[e.Declarations=20]="Declarations",e[e.Property=21]="Property",e[e.Expression=22]="Expression",e[e.BinaryExpression=23]="BinaryExpression",e[e.Term=24]="Term",e[e.Operator=25]="Operator",e[e.Value=26]="Value",e[e.StringLiteral=27]="StringLiteral",e[e.URILiteral=28]="URILiteral",e[e.EscapedValue=29]="EscapedValue",e[e.Function=30]="Function",e[e.NumericValue=31]="NumericValue",e[e.HexColorValue=32]="HexColorValue",e[e.RatioValue=33]="RatioValue",e[e.MixinDeclaration=34]="MixinDeclaration",e[e.MixinReference=35]="MixinReference",e[e.VariableName=36]="VariableName",e[e.VariableDeclaration=37]="VariableDeclaration",e[e.Prio=38]="Prio",e[e.Interpolation=39]="Interpolation",e[e.NestedProperties=40]="NestedProperties",e[e.ExtendsReference=41]="ExtendsReference",e[e.SelectorPlaceholder=42]="SelectorPlaceholder",e[e.Debug=43]="Debug",e[e.If=44]="If",e[e.Else=45]="Else",e[e.For=46]="For",e[e.Each=47]="Each",e[e.While=48]="While",e[e.MixinContentReference=49]="MixinContentReference",e[e.MixinContentDeclaration=50]="MixinContentDeclaration",e[e.Media=51]="Media",e[e.Keyframe=52]="Keyframe",e[e.FontFace=53]="FontFace",e[e.Import=54]="Import",e[e.Namespace=55]="Namespace",e[e.Invocation=56]="Invocation",e[e.FunctionDeclaration=57]="FunctionDeclaration",e[e.ReturnStatement=58]="ReturnStatement",e[e.MediaQuery=59]="MediaQuery",e[e.MediaCondition=60]="MediaCondition",e[e.MediaFeature=61]="MediaFeature",e[e.FunctionParameter=62]="FunctionParameter",e[e.FunctionArgument=63]="FunctionArgument",e[e.KeyframeSelector=64]="KeyframeSelector",e[e.ViewPort=65]="ViewPort",e[e.Document=66]="Document",e[e.AtApplyRule=67]="AtApplyRule",e[e.CustomPropertyDeclaration=68]="CustomPropertyDeclaration",e[e.CustomPropertySet=69]="CustomPropertySet",e[e.ListEntry=70]="ListEntry",e[e.Supports=71]="Supports",e[e.SupportsCondition=72]="SupportsCondition",e[e.NamespacePrefix=73]="NamespacePrefix",e[e.GridLine=74]="GridLine",e[e.Plugin=75]="Plugin",e[e.UnknownAtRule=76]="UnknownAtRule",e[e.Use=77]="Use",e[e.ModuleConfiguration=78]="ModuleConfiguration",e[e.Forward=79]="Forward",e[e.ForwardVisibility=80]="ForwardVisibility",e[e.Module=81]="Module",e[e.UnicodeRange=82]="UnicodeRange",e[e.Layer=83]="Layer",e[e.LayerNameList=84]="LayerNameList",e[e.LayerName=85]="LayerName",e[e.PropertyAtRule=86]="PropertyAtRule",e[e.Container=87]="Container",e[e.ModuleConfig=88]="ModuleConfig"}(te||(te={})),function(e){e[e.Mixin=0]="Mixin",e[e.Rule=1]="Rule",e[e.Variable=2]="Variable",e[e.Function=3]="Function",e[e.Keyframe=4]="Keyframe",e[e.Unknown=5]="Unknown",e[e.Module=6]="Module",e[e.Forward=7]="Forward",e[e.ForwardVisibility=8]="ForwardVisibility",e[e.Property=9]="Property"}(ne||(ne={}));class oe{get end(){return this.offset+this.length}constructor(e=-1,t=-1,n){this.parent=null,this.offset=e,this.length=t,n&&(this.nodeType=n)}set type(e){this.nodeType=e}get type(){return this.nodeType||te.Undefined}getTextProvider(){let e=this;for(;e&&!e.textProvider;)e=e.parent;return e?e.textProvider:()=>"unknown"}getText(){return this.getTextProvider()(this.offset,this.length)}matches(e){return this.length===e.length&&this.getTextProvider()(this.offset,this.length)===e}startsWith(e){return this.length>=e.length&&this.getTextProvider()(this.offset,e.length)===e}endsWith(e){return this.length>=e.length&&this.getTextProvider()(this.end-e.length,e.length)===e}accept(e){if(e(this)&&this.children)for(const t of this.children)t.accept(e)}acceptVisitor(e){this.accept(e.visitNode.bind(e))}adoptChild(e,t=-1){if(e.parent&&e.parent.children){const t=e.parent.children.indexOf(e);t>=0&&e.parent.children.splice(t,1)}e.parent=this;let n=this.children;return n||(n=this.children=[]),-1!==t?n.splice(t,0,e):n.push(e),e}attachTo(e,t=-1){return e&&e.adoptChild(this,t),this}collectIssues(e){this.issues&&e.push.apply(e,this.issues)}addIssue(e){this.issues||(this.issues=[]),this.issues.push(e)}hasIssue(e){return Array.isArray(this.issues)&&this.issues.some((t=>t.getRule()===e))}isErroneous(e=!1){return!!(this.issues&&this.issues.length>0)||e&&Array.isArray(this.children)&&this.children.some((e=>e.isErroneous(!0)))}setNode(e,t,n=-1){return!!t&&(t.attachTo(this,n),this[e]=t,!0)}addChild(e){return!!e&&(this.children||(this.children=[]),e.attachTo(this),this.updateOffsetAndLength(e),!0)}updateOffsetAndLength(e){(e.offsetthis.end||-1===this.length)&&(this.length=t-this.offset)}hasChildren(){return!!this.children&&this.children.length>0}getChildren(){return this.children?this.children.slice(0):[]}getChild(e){return this.children&&e=0;n--)if(t=this.children[n],t.offset<=e)return t}return null}findChildAtOffset(e,t){const n=this.findFirstChildBeforeOffset(e);return n&&n.end>=e?t&&n.findChildAtOffset(e,!0)||n:null}encloses(e){return this.offset<=e.offset&&this.offset+this.length>=e.offset+e.length}getParent(){let e=this.parent;for(;e instanceof se;)e=e.parent;return e}findParent(e){let t=this;for(;t&&t.type!==e;)t=t.parent;return t}findAParent(...e){let t=this;for(;t&&!e.some((e=>t.type===e));)t=t.parent;return t}setData(e,t){this.options||(this.options={}),this.options[e]=t}getData(e){return this.options&&this.options.hasOwnProperty(e)?this.options[e]:null}}class se extends oe{constructor(e,t=-1){super(-1,-1),this.attachTo(e,t),this.offset=-1,this.length=-1}}class ae extends oe{constructor(e,t){super(e,t)}get type(){return te.UnicodeRange}setRangeStart(e){return this.setNode("rangeStart",e)}getRangeStart(){return this.rangeStart}setRangeEnd(e){return this.setNode("rangeEnd",e)}getRangeEnd(){return this.rangeEnd}}class ce extends oe{constructor(e,t){super(e,t),this.isCustomProperty=!1}get type(){return te.Identifier}containsInterpolation(){return this.hasChildren()}}class le extends oe{constructor(e,t){super(e,t)}get type(){return te.Stylesheet}}class de extends oe{constructor(e,t){super(e,t)}get type(){return te.Declarations}}class he extends oe{constructor(e,t){super(e,t)}getDeclarations(){return this.declarations}setDeclarations(e){return this.setNode("declarations",e)}}class pe extends he{constructor(e,t){super(e,t)}get type(){return te.Ruleset}getSelectors(){return this.selectors||(this.selectors=new se(this)),this.selectors}isNested(){return!!this.parent&&null!==this.parent.findParent(te.Declarations)}}class ue extends oe{constructor(e,t){super(e,t)}get type(){return te.Selector}}class me extends oe{constructor(e,t){super(e,t)}get type(){return te.SimpleSelector}}class fe extends oe{constructor(e,t){super(e,t)}}class ge extends he{constructor(e,t){super(e,t)}get type(){return te.CustomPropertySet}}class be extends fe{constructor(e,t){super(e,t),this.property=null}get type(){return te.Declaration}setProperty(e){return this.setNode("property",e)}getProperty(){return this.property}getFullPropertyName(){const e=this.property?this.property.getName():"unknown";if(this.parent instanceof de&&this.parent.getParent()instanceof Pe){const t=this.parent.getParent().getParent();if(t instanceof be)return t.getFullPropertyName()+e}return e}getNonPrefixedPropertyName(){const e=this.getFullPropertyName();if(e&&"-"===e.charAt(0)){const t=e.indexOf("-",1);if(-1!==t)return e.substring(t+1)}return e}setValue(e){return this.setNode("value",e)}getValue(){return this.value}setNestedProperties(e){return this.setNode("nestedProperties",e)}getNestedProperties(){return this.nestedProperties}}class ye extends be{constructor(e,t){super(e,t)}get type(){return te.CustomPropertyDeclaration}setPropertySet(e){return this.setNode("propertySet",e)}getPropertySet(){return this.propertySet}}class ve extends oe{constructor(e,t){super(e,t)}get type(){return te.Property}setIdentifier(e){return this.setNode("identifier",e)}getIdentifier(){return this.identifier}getName(){return function(e,t){const n=/[_\+]+$/.exec(e);return n&&n[0].length?e.substr(0,e.length-n[0].length):e}(this.getText())}isCustomProperty(){return!!this.identifier&&this.identifier.isCustomProperty}}class we extends oe{constructor(e,t){super(e,t)}get type(){return te.Invocation}getArguments(){return this.arguments||(this.arguments=new se(this)),this.arguments}}class Se extends we{constructor(e,t){super(e,t)}get type(){return te.Function}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}}class xe extends oe{constructor(e,t){super(e,t)}get type(){return te.FunctionParameter}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}setDefaultValue(e){return this.setNode("defaultValue",e,0)}getDefaultValue(){return this.defaultValue}}class Ce extends oe{constructor(e,t){super(e,t)}get type(){return te.FunctionArgument}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}setValue(e){return this.setNode("value",e,0)}getValue(){return this.value}}class ke extends he{constructor(e,t){super(e,t)}get type(){return te.If}setExpression(e){return this.setNode("expression",e,0)}setElseClause(e){return this.setNode("elseClause",e)}}class _e extends he{constructor(e,t){super(e,t)}get type(){return te.For}setVariable(e){return this.setNode("variable",e,0)}}class Ee extends he{constructor(e,t){super(e,t)}get type(){return te.Each}getVariables(){return this.variables||(this.variables=new se(this)),this.variables}}class Fe extends he{constructor(e,t){super(e,t)}get type(){return te.While}}class Re extends he{constructor(e,t){super(e,t)}get type(){return te.Else}}class De extends he{constructor(e,t){super(e,t)}get type(){return te.FunctionDeclaration}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}getParameters(){return this.parameters||(this.parameters=new se(this)),this.parameters}}class Te extends he{constructor(e,t){super(e,t)}get type(){return te.ViewPort}}class Ie extends he{constructor(e,t){super(e,t)}get type(){return te.FontFace}}class Pe extends he{constructor(e,t){super(e,t)}get type(){return te.NestedProperties}}class Me extends he{constructor(e,t){super(e,t)}get type(){return te.Keyframe}setKeyword(e){return this.setNode("keyword",e,0)}getKeyword(){return this.keyword}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}}class Oe extends he{constructor(e,t){super(e,t)}get type(){return te.KeyframeSelector}}class ze extends oe{constructor(e,t){super(e,t)}get type(){return te.Import}setMedialist(e){return!!e&&(e.attachTo(this),!0)}}class Ne extends oe{get type(){return te.Use}setParameters(e){return this.setNode("parameters",e)}getParameters(){return this.parameters}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}}class Ae extends oe{get type(){return te.ModuleConfiguration}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}setValue(e){return this.setNode("value",e,0)}getValue(){return this.value}}class We extends oe{get type(){return te.Forward}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}setParameters(e){return this.setNode("parameters",e)}getParameters(){return this.parameters}}class qe extends oe{get type(){return te.ForwardVisibility}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}}class Le extends oe{constructor(e,t){super(e,t)}get type(){return te.Namespace}}class je extends he{constructor(e,t){super(e,t)}get type(){return te.Media}}class $e extends he{constructor(e,t){super(e,t)}get type(){return te.Supports}}class Ue extends he{constructor(e,t){super(e,t)}get type(){return te.Layer}setNames(e){return this.setNode("names",e)}getNames(){return this.names}}class Ve extends he{constructor(e,t){super(e,t)}get type(){return te.PropertyAtRule}setName(e){return!!e&&(e.attachTo(this),this.name=e,!0)}getName(){return this.name}}class Be extends he{constructor(e,t){super(e,t)}get type(){return te.Document}}class Ke extends he{constructor(e,t){super(e,t)}get type(){return te.Container}}class He extends oe{constructor(e,t){super(e,t)}}class Ge extends oe{constructor(e,t){super(e,t)}get type(){return te.MediaQuery}}class Je extends oe{constructor(e,t){super(e,t)}get type(){return te.MediaCondition}}class Xe extends oe{constructor(e,t){super(e,t)}get type(){return te.MediaFeature}}class Ye extends oe{constructor(e,t){super(e,t)}get type(){return te.SupportsCondition}}class Qe extends he{constructor(e,t){super(e,t)}get type(){return te.Page}}class Ze extends he{constructor(e,t){super(e,t)}get type(){return te.PageBoxMarginBox}}class et extends oe{constructor(e,t){super(e,t)}get type(){return te.Expression}}class tt extends oe{constructor(e,t){super(e,t)}get type(){return te.BinaryExpression}setLeft(e){return this.setNode("left",e)}getLeft(){return this.left}setRight(e){return this.setNode("right",e)}getRight(){return this.right}setOperator(e){return this.setNode("operator",e)}getOperator(){return this.operator}}class nt extends oe{constructor(e,t){super(e,t)}get type(){return te.Term}setOperator(e){return this.setNode("operator",e)}getOperator(){return this.operator}setExpression(e){return this.setNode("expression",e)}getExpression(){return this.expression}}class rt extends oe{constructor(e,t){super(e,t)}get type(){return te.AttributeSelector}setNamespacePrefix(e){return this.setNode("namespacePrefix",e)}getNamespacePrefix(){return this.namespacePrefix}setIdentifier(e){return this.setNode("identifier",e)}getIdentifier(){return this.identifier}setOperator(e){return this.setNode("operator",e)}getOperator(){return this.operator}setValue(e){return this.setNode("value",e)}getValue(){return this.value}}class it extends oe{constructor(e,t){super(e,t)}get type(){return te.HexColorValue}}class ot extends oe{constructor(e,t){super(e,t)}get type(){return te.RatioValue}}const st=".".charCodeAt(0),at="0".charCodeAt(0),ct="9".charCodeAt(0);class lt extends oe{constructor(e,t){super(e,t)}get type(){return te.NumericValue}getValue(){const e=this.getText();let t,n=0;for(let r=0,i=e.length;r0&&(r.arguments=n),r},e.is=function(e){let t=e;return tr.defined(t)&&tr.string(t.title)&&tr.string(t.command)}}(Ht||(Ht={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){const t=e;return tr.objectLiteral(t)&&tr.string(t.newText)&&Ot.is(t.range)}}(Gt||(Gt={})),function(e){e.create=function(e,t,n){const r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){const t=e;return tr.objectLiteral(t)&&tr.string(t.label)&&(tr.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(tr.string(t.description)||void 0===t.description)}}(Jt||(Jt={})),function(e){e.is=function(e){const t=e;return tr.string(t)}}(Xt||(Xt={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){const t=e;return Gt.is(t)&&(Jt.is(t.annotationId)||Xt.is(t.annotationId))}}(Yt||(Yt={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){let t=e;return tr.defined(t)&&sn.is(t.textDocument)&&Array.isArray(t.edits)}}(Qt||(Qt={})),function(e){e.create=function(e,t,n){let r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&"create"===t.kind&&tr.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||tr.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||tr.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||Xt.is(t.annotationId))}}(Zt||(Zt={})),function(e){e.create=function(e,t,n,r){let i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){let t=e;return t&&"rename"===t.kind&&tr.string(t.oldUri)&&tr.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||tr.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||tr.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||Xt.is(t.annotationId))}}(en||(en={})),function(e){e.create=function(e,t,n){let r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&"delete"===t.kind&&tr.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||tr.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||tr.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||Xt.is(t.annotationId))}}(tn||(tn={})),function(e){e.is=function(e){let t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((e=>tr.string(e.kind)?Zt.is(e)||en.is(e)||tn.is(e):Qt.is(e))))}}(nn||(nn={})),function(e){e.create=function(e){return{uri:e}},e.is=function(e){let t=e;return tr.defined(t)&&tr.string(t.uri)}}(rn||(rn={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return tr.defined(t)&&tr.string(t.uri)&&tr.integer(t.version)}}(on||(on={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return tr.defined(t)&&tr.string(t.uri)&&(null===t.version||tr.integer(t.version))}}(sn||(sn={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){let t=e;return tr.defined(t)&&tr.string(t.uri)&&tr.string(t.languageId)&&tr.integer(t.version)&&tr.string(t.text)}}(an||(an={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){const n=t;return n===e.PlainText||n===e.Markdown}}(cn||(cn={})),function(e){e.is=function(e){const t=e;return tr.objectLiteral(e)&&cn.is(t.kind)&&tr.string(t.value)}}(ln||(ln={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(dn||(dn={})),function(e){e.PlainText=1,e.Snippet=2}(hn||(hn={})),function(e){e.Deprecated=1}(pn||(pn={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){const t=e;return t&&tr.string(t.newText)&&Ot.is(t.insert)&&Ot.is(t.replace)}}(un||(un={})),function(e){e.asIs=1,e.adjustIndentation=2}(mn||(mn={})),function(e){e.is=function(e){const t=e;return t&&(tr.string(t.detail)||void 0===t.detail)&&(tr.string(t.description)||void 0===t.description)}}(fn||(fn={})),function(e){e.create=function(e){return{label:e}}}(gn||(gn={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(bn||(bn={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){const t=e;return tr.string(t)||tr.objectLiteral(t)&&tr.string(t.language)&&tr.string(t.value)}}(yn||(yn={})),function(e){e.is=function(e){let t=e;return!!t&&tr.objectLiteral(t)&&(ln.is(t.contents)||yn.is(t.contents)||tr.typedArray(t.contents,yn.is))&&(void 0===e.range||Ot.is(e.range))}}(vn||(vn={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(wn||(wn={})),function(e){e.create=function(e,t,...n){let r={label:e};return tr.defined(t)&&(r.documentation=t),tr.defined(n)?r.parameters=n:r.parameters=[],r}}(Sn||(Sn={})),function(e){e.Text=1,e.Read=2,e.Write=3}(xn||(xn={})),function(e){e.create=function(e,t){let n={range:e};return tr.number(t)&&(n.kind=t),n}}(Cn||(Cn={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(kn||(kn={})),function(e){e.Deprecated=1}(_n||(_n={})),function(e){e.create=function(e,t,n,r,i){let o={name:e,kind:t,location:{uri:r,range:n}};return i&&(o.containerName=i),o}}(En||(En={})),function(e){e.create=function(e,t,n,r){return void 0!==r?{name:e,kind:t,location:{uri:n,range:r}}:{name:e,kind:t,location:{uri:n}}}}(Fn||(Fn={})),function(e){e.create=function(e,t,n,r,i,o){let s={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==o&&(s.children=o),s},e.is=function(e){let t=e;return t&&tr.string(t.name)&&tr.number(t.kind)&&Ot.is(t.range)&&Ot.is(t.selectionRange)&&(void 0===t.detail||tr.string(t.detail))&&(void 0===t.deprecated||tr.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(Rn||(Rn={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(Dn||(Dn={})),function(e){e.Invoked=1,e.Automatic=2}(Tn||(Tn={})),function(e){e.create=function(e,t,n){let r={diagnostics:e};return null!=t&&(r.only=t),null!=n&&(r.triggerKind=n),r},e.is=function(e){let t=e;return tr.defined(t)&&tr.typedArray(t.diagnostics,Kt.is)&&(void 0===t.only||tr.typedArray(t.only,tr.string))&&(void 0===t.triggerKind||t.triggerKind===Tn.Invoked||t.triggerKind===Tn.Automatic)}}(In||(In={})),function(e){e.create=function(e,t,n){let r={title:e},i=!0;return"string"==typeof t?(i=!1,r.kind=t):Ht.is(t)?r.command=t:r.edit=t,i&&void 0!==n&&(r.kind=n),r},e.is=function(e){let t=e;return t&&tr.string(t.title)&&(void 0===t.diagnostics||tr.typedArray(t.diagnostics,Kt.is))&&(void 0===t.kind||tr.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||Ht.is(t.command))&&(void 0===t.isPreferred||tr.boolean(t.isPreferred))&&(void 0===t.edit||nn.is(t.edit))}}(Pn||(Pn={})),function(e){e.create=function(e,t){let n={range:e};return tr.defined(t)&&(n.data=t),n},e.is=function(e){let t=e;return tr.defined(t)&&Ot.is(t.range)&&(tr.undefined(t.command)||Ht.is(t.command))}}(Mn||(Mn={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){let t=e;return tr.defined(t)&&tr.uinteger(t.tabSize)&&tr.boolean(t.insertSpaces)}}(On||(On={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){let t=e;return tr.defined(t)&&Ot.is(t.range)&&(tr.undefined(t.target)||tr.string(t.target))}}(zn||(zn={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){let n=t;return tr.objectLiteral(n)&&Ot.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(Nn||(Nn={})),function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"}(An||(An={})),function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"}(Wn||(Wn={})),function(e){e.is=function(e){const t=e;return tr.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}}(qn||(qn={})),function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){const t=e;return null!=t&&Ot.is(t.range)&&tr.string(t.text)}}(Ln||(Ln={})),function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){const t=e;return null!=t&&Ot.is(t.range)&&tr.boolean(t.caseSensitiveLookup)&&(tr.string(t.variableName)||void 0===t.variableName)}}(jn||(jn={})),function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){const t=e;return null!=t&&Ot.is(t.range)&&(tr.string(t.expression)||void 0===t.expression)}}($n||($n={})),function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){const t=e;return tr.defined(t)&&Ot.is(e.stoppedLocation)}}(Un||(Un={})),function(e){e.Type=1,e.Parameter=2,e.is=function(e){return 1===e||2===e}}(Vn||(Vn={})),function(e){e.create=function(e){return{value:e}},e.is=function(e){const t=e;return tr.objectLiteral(t)&&(void 0===t.tooltip||tr.string(t.tooltip)||ln.is(t.tooltip))&&(void 0===t.location||zt.is(t.location))&&(void 0===t.command||Ht.is(t.command))}}(Bn||(Bn={})),function(e){e.create=function(e,t,n){const r={position:e,label:t};return void 0!==n&&(r.kind=n),r},e.is=function(e){const t=e;return tr.objectLiteral(t)&&Mt.is(t.position)&&(tr.string(t.label)||tr.typedArray(t.label,Bn.is))&&(void 0===t.kind||Vn.is(t.kind))&&void 0===t.textEdits||tr.typedArray(t.textEdits,Gt.is)&&(void 0===t.tooltip||tr.string(t.tooltip)||ln.is(t.tooltip))&&(void 0===t.paddingLeft||tr.boolean(t.paddingLeft))&&(void 0===t.paddingRight||tr.boolean(t.paddingRight))}}(Kn||(Kn={})),function(e){e.createSnippet=function(e){return{kind:"snippet",value:e}}}(Hn||(Hn={})),function(e){e.create=function(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}}(Gn||(Gn={})),function(e){e.create=function(e){return{items:e}}}(Jn||(Jn={})),function(e){e.Invoked=0,e.Automatic=1}(Xn||(Xn={})),function(e){e.create=function(e,t){return{range:e,text:t}}}(Yn||(Yn={})),function(e){e.create=function(e,t){return{triggerKind:e,selectedCompletionInfo:t}}}(Qn||(Qn={})),function(e){e.is=function(e){const t=e;return tr.objectLiteral(t)&&Tt.is(t.uri)&&tr.string(t.name)}}(Zn||(Zn={})),function(e){function t(e,n){if(e.length<=1)return e;const r=e.length/2|0,i=e.slice(0,r),o=e.slice(r);t(i,n),t(o,n);let s=0,a=0,c=0;for(;s{let n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),o=r.length;for(let t=i.length-1;t>=0;t--){let n=i[t],s=e.offsetAt(n.range.start),a=e.offsetAt(n.range.end);if(!(a<=o))throw new Error("Overlapping edit");r=r.substring(0,s)+n.newText+r.substring(a,r.length),o=s}return r}}(er||(er={}));class or{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(void 0===this._lineOffsets){let e=[],t=this._content,n=!0;for(let r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return Mt.create(0,e);for(;ne?r=i:n=i+1}let i=n-1;return Mt.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1e?r=i:n=i+1}const i=n-1;return{line:i,character:(e=this.ensureBeforeEOL(e,t[i]))-t[i]}}offsetAt(e){const t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;const n=t[e.line];if(e.character<=0)return n;const r=e.line+1t&&lr(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)}static isFull(e){const t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength}}function ar(e,t){if(e.length<=1)return e;const n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);ar(r,t),ar(i,t);let o=0,s=0,a=0;for(;on.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function hr(e){const t=dr(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,r){return new sr(e,t,n,r)},e.update=function(e,t,n){if(e instanceof sr)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){const n=e.getText(),r=ar(t.map(hr),((e,t)=>{const n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n}));let i=0;const o=[];for(const t of r){const r=e.offsetAt(t.range.start);if(ri&&o.push(n.substring(i,r)),t.newText.length&&o.push(t.newText),i=e.offsetAt(t.range.end)}return o.push(n.substr(i)),o.join("")}}(nr||(nr={})),function(e){e.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[cn.Markdown,cn.PlainText]}},hover:{contentFormat:[cn.Markdown,cn.PlainText]}}}}(rr||(rr={})),function(e){e[e.Unknown=0]="Unknown",e[e.File=1]="File",e[e.Directory=2]="Directory",e[e.SymbolicLink=64]="SymbolicLink"}(ir||(ir={}));const pr={E:"Edge",FF:"Firefox",S:"Safari",C:"Chrome",IE:"IE",O:"Opera"};function ur(e){switch(e){case"experimental":return"⚠️ Property is experimental. Be cautious when using it.️\n\n";case"nonstandard":return"🚨️ Property is nonstandard. Avoid using it.\n\n";case"obsolete":return"🚨️️️ Property is obsolete. Avoid using it.\n\n";default:return""}}function mr(e,t,n){let r;if(r=t?{kind:"markdown",value:br(e,n)}:{kind:"plaintext",value:gr(e,n)},""!==r.value)return r}function fr(e){return(e=e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")).replace(//g,">")}function gr(e,t){if(!e.description||""===e.description)return"";if("string"!=typeof e.description)return e.description.value;let n="";if(!1!==t?.documentation){e.status&&(n+=ur(e.status)),n+=e.description;const t=yr(e.browsers);t&&(n+="\n("+t+")"),"syntax"in e&&(n+=`\n\nSyntax: ${e.syntax}`)}return e.references&&e.references.length>0&&!1!==t?.references&&(n.length>0&&(n+="\n\n"),n+=e.references.map((e=>`${e.name}: ${e.url}`)).join(" | ")),n}function br(e,t){if(!e.description||""===e.description)return"";let n="";if(!1!==t?.documentation){e.status&&(n+=ur(e.status)),"string"==typeof e.description?n+=fr(e.description):n+=e.description.kind===cn.Markdown?e.description.value:fr(e.description.value);const t=yr(e.browsers);t&&(n+="\n\n("+fr(t)+")"),"syntax"in e&&e.syntax&&(n+=`\n\nSyntax: ${fr(e.syntax)}`)}return e.references&&e.references.length>0&&!1!==t?.references&&(n.length>0&&(n+="\n\n"),n+=e.references.map((e=>`[${e.name}](${e.url})`)).join(" | ")),n}function yr(e=[]){return 0===e.length?null:e.map((e=>{let t="";const n=e.match(/([A-Z]+)(\d+)?/),r=n[1],i=n[2];return r in pr&&(t+=pr[r]),i&&(t+=" "+i),t})).join(", ")}const vr=/(^#([0-9A-F]{3}){1,2}$)|(^#([0-9A-F]{4}){1,2}$)/i,wr=[{label:"rgb",func:"rgb($red, $green, $blue)",insertText:"rgb(${1:red}, ${2:green}, ${3:blue})",desc:Et.t("Creates a Color from red, green, and blue values.")},{label:"rgba",func:"rgba($red, $green, $blue, $alpha)",insertText:"rgba(${1:red}, ${2:green}, ${3:blue}, ${4:alpha})",desc:Et.t("Creates a Color from red, green, blue, and alpha values.")},{label:"rgb relative",func:"rgb(from $color $red $green $blue)",insertText:"rgb(from ${1:color} ${2:r} ${3:g} ${4:b})",desc:Et.t("Creates a Color from the red, green, and blue values of another Color.")},{label:"hsl",func:"hsl($hue, $saturation, $lightness)",insertText:"hsl(${1:hue}, ${2:saturation}, ${3:lightness})",desc:Et.t("Creates a Color from hue, saturation, and lightness values.")},{label:"hsla",func:"hsla($hue, $saturation, $lightness, $alpha)",insertText:"hsla(${1:hue}, ${2:saturation}, ${3:lightness}, ${4:alpha})",desc:Et.t("Creates a Color from hue, saturation, lightness, and alpha values.")},{label:"hsl relative",func:"hsl(from $color $hue $saturation $lightness)",insertText:"hsl(from ${1:color} ${2:h} ${3:s} ${4:l})",desc:Et.t("Creates a Color from the hue, saturation, and lightness values of another Color.")},{label:"hwb",func:"hwb($hue $white $black)",insertText:"hwb(${1:hue} ${2:white} ${3:black})",desc:Et.t("Creates a Color from hue, white, and black values.")},{label:"hwb relative",func:"hwb(from $color $hue $white $black)",insertText:"hwb(from ${1:color} ${2:h} ${3:w} ${4:b})",desc:Et.t("Creates a Color from the hue, white, and black values of another Color.")},{label:"lab",func:"lab($lightness $a $b)",insertText:"lab(${1:lightness} ${2:a} ${3:b})",desc:Et.t("Creates a Color from lightness, a, and b values.")},{label:"lab relative",func:"lab(from $color $lightness $a $b)",insertText:"lab(from ${1:color} ${2:l} ${3:a} ${4:b})",desc:Et.t("Creates a Color from the lightness, a, and b values of another Color.")},{label:"oklab",func:"oklab($lightness $a $b)",insertText:"oklab(${1:lightness} ${2:a} ${3:b})",desc:Et.t("Creates a Color from lightness, a, and b values.")},{label:"oklab relative",func:"oklab(from $color $lightness $a $b)",insertText:"oklab(from ${1:color} ${2:l} ${3:a} ${4:b})",desc:Et.t("Creates a Color from the lightness, a, and b values of another Color.")},{label:"lch",func:"lch($lightness $chroma $hue)",insertText:"lch(${1:lightness} ${2:chroma} ${3:hue})",desc:Et.t("Creates a Color from lightness, chroma, and hue values.")},{label:"lch relative",func:"lch(from $color $lightness $chroma $hue)",insertText:"lch(from ${1:color} ${2:l} ${3:c} ${4:h})",desc:Et.t("Creates a Color from the lightness, chroma, and hue values of another Color.")},{label:"oklch",func:"oklch($lightness $chroma $hue)",insertText:"oklch(${1:lightness} ${2:chroma} ${3:hue})",desc:Et.t("Creates a Color from lightness, chroma, and hue values.")},{label:"oklch relative",func:"oklch(from $color $lightness $chroma $hue)",insertText:"oklch(from ${1:color} ${2:l} ${3:c} ${4:h})",desc:Et.t("Creates a Color from the lightness, chroma, and hue values of another Color.")},{label:"color",func:"color($color-space $red $green $blue)",insertText:"color(${1|srgb,srgb-linear,display-p3,a98-rgb,prophoto-rgb,rec2020,xyx,xyz-d50,xyz-d65|} ${2:red} ${3:green} ${4:blue})",desc:Et.t("Creates a Color in a specific color space from red, green, and blue values.")},{label:"color relative",func:"color(from $color $color-space $red $green $blue)",insertText:"color(from ${1:color} ${2|srgb,srgb-linear,display-p3,a98-rgb,prophoto-rgb,rec2020,xyx,xyz-d50,xyz-d65|} ${3:r} ${4:g} ${5:b})",desc:Et.t("Creates a Color in a specific color space from the red, green, and blue values of another Color.")},{label:"color-mix",func:"color-mix(in $color-space, $color $percentage, $color $percentage)",insertText:"color-mix(in ${1|srgb,srgb-linear,lab,oklab,xyz,xyz-d50,xyz-d65|}, ${3:color} ${4:percentage}, ${5:color} ${6:percentage})",desc:Et.t("Mix two colors together in a rectangular color space.")},{label:"color-mix hue",func:"color-mix(in $color-space $interpolation-method hue, $color $percentage, $color $percentage)",insertText:"color-mix(in ${1|hsl,hwb,lch,oklch|} ${2|shorter hue,longer hue,increasing hue,decreasing hue|}, ${3:color} ${4:percentage}, ${5:color} ${6:percentage})",desc:Et.t("Mix two colors together in a polar color space.")}],Sr=/^(rgb|rgba|hsl|hsla|hwb)$/i,xr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",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:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",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:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rebeccapurple:"#663399",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Cr=new RegExp(`^(${Object.keys(xr).join("|")})$`,"i"),kr={currentColor:"The value of the 'color' property. The computed value of the 'currentColor' keyword is the computed value of the 'color' property. If the 'currentColor' keyword is set on the 'color' property itself, it is treated as 'color:inherit' at parse time.",transparent:"Fully transparent. This keyword can be considered a shorthand for rgba(0,0,0,0) which is its computed value."},_r=new RegExp(`^(${Object.keys(kr).join("|")})$`,"i");function Er(e,t){const n=e.getText().match(/^([-+]?[0-9]*\.?[0-9]+)(%?)$/);if(n){n[2]&&(t=100);const e=parseFloat(n[1])/t;if(e>=0&&e<=1)return e}throw new Error}function Fr(e){const t=e.getText(),n=t.match(/^([-+]?[0-9]*\.?[0-9]+)(deg|rad|grad|turn)?$/);if(n)switch(n[2]){case"deg":return parseFloat(t)%360;case"rad":return 180*parseFloat(t)/Math.PI%360;case"grad":return.9*parseFloat(t)%360;case"turn":return 360*parseFloat(t)%360;default:if(void 0===n[2])return parseFloat(t)%360}throw new Error}function Rr(e){return vr.test(e)||Cr.test(e)||_r.test(e)}const Dr=48,Tr=57,Ir=65,Pr=97,Mr=102;function Or(e){return e=Pr&&e<=Mr?e-Pr+10:0)}function zr(e){if("#"!==e[0])return null;switch(e.length){case 4:return{red:17*Or(e.charCodeAt(1))/255,green:17*Or(e.charCodeAt(2))/255,blue:17*Or(e.charCodeAt(3))/255,alpha:1};case 5:return{red:17*Or(e.charCodeAt(1))/255,green:17*Or(e.charCodeAt(2))/255,blue:17*Or(e.charCodeAt(3))/255,alpha:17*Or(e.charCodeAt(4))/255};case 7:return{red:(16*Or(e.charCodeAt(1))+Or(e.charCodeAt(2)))/255,green:(16*Or(e.charCodeAt(3))+Or(e.charCodeAt(4)))/255,blue:(16*Or(e.charCodeAt(5))+Or(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(16*Or(e.charCodeAt(1))+Or(e.charCodeAt(2)))/255,green:(16*Or(e.charCodeAt(3))+Or(e.charCodeAt(4)))/255,blue:(16*Or(e.charCodeAt(5))+Or(e.charCodeAt(6)))/255,alpha:(16*Or(e.charCodeAt(7))+Or(e.charCodeAt(8)))/255}}return null}function Nr(e,t,n,r=1){if(0===t)return{red:n,green:n,blue:n,alpha:r};{const i=(e,t,n)=>{for(;n<0;)n+=6;for(;n>=6;)n-=6;return n<1?(t-e)*n+e:n<3?t:n<4?(t-e)*(4-n)+e:e},o=n<=.5?n*(t+1):n+t-n*t,s=2*n-o;return{red:i(s,o,2+(e/=60)),green:i(s,o,e),blue:i(s,o,e-2),alpha:r}}}function Ar(e){const t=e.red,n=e.green,r=e.blue,i=e.alpha,o=Math.max(t,n,r),s=Math.min(t,n,r);let a=0,c=0;const l=(s+o)/2,d=o-s;if(d>0){switch(c=Math.min(l<=.5?d/(2*l):d/(2-2*l),1),o){case t:a=(n-r)/d+(ne[t]))}function ei(e){return void 0!==e}class ti{constructor(e=new X){this.keyframeRegex=/^@(\-(webkit|ms|moz|o)\-)?keyframes$/i,this.scanner=e,this.token={type:r.EOF,offset:-1,len:0,text:""},this.prevToken=void 0}peekIdent(e){return r.Ident===this.token.type&&e.length===this.token.text.length&&e===this.token.text.toLowerCase()}peekKeyword(e){return r.AtKeyword===this.token.type&&e.length===this.token.text.length&&e===this.token.text.toLowerCase()}peekDelim(e){return r.Delim===this.token.type&&e===this.token.text}peek(e){return e===this.token.type}peekOne(...e){return-1!==e.indexOf(this.token.type)}peekRegExp(e,t){return e===this.token.type&&t.test(this.token.text)}hasWhitespace(){return!!this.prevToken&&this.prevToken.offset+this.prevToken.len!==this.token.offset}consumeToken(){this.prevToken=this.token,this.token=this.scanner.scan()}acceptUnicodeRange(){const e=this.scanner.tryScanUnicode();return!!e&&(this.prevToken=e,this.token=this.scanner.scan(),!0)}mark(){return{prev:this.prevToken,curr:this.token,pos:this.scanner.pos()}}restoreAtMark(e){this.prevToken=e.prev,this.token=e.curr,this.scanner.goBackTo(e.pos)}try(e){const t=this.mark();return e()||(this.restoreAtMark(t),null)}acceptOneKeyword(e){if(r.AtKeyword===this.token.type)for(const t of e)if(t.length===this.token.text.length&&t===this.token.text.toLowerCase())return this.consumeToken(),!0;return!1}accept(e){return e===this.token.type&&(this.consumeToken(),!0)}acceptIdent(e){return!!this.peekIdent(e)&&(this.consumeToken(),!0)}acceptKeyword(e){return!!this.peekKeyword(e)&&(this.consumeToken(),!0)}acceptDelim(e){return!!this.peekDelim(e)&&(this.consumeToken(),!0)}acceptRegexp(e){return!!e.test(this.token.text)&&(this.consumeToken(),!0)}_parseRegexp(e){let t=this.createNode(te.Identifier);do{}while(this.acceptRegexp(e));return this.finish(t)}acceptUnquotedString(){const e=this.scanner.pos();this.scanner.goBackTo(this.token.offset);const t=this.scanner.scanUnquotedString();return t?(this.token=t,this.consumeToken(),!0):(this.scanner.goBackTo(e),!1)}resync(e,t){for(;;){if(e&&-1!==e.indexOf(this.token.type))return this.consumeToken(),!0;if(t&&-1!==t.indexOf(this.token.type))return!0;if(this.token.type===r.EOF)return!1;this.token=this.scanner.scan()}}createNode(e){return new oe(this.token.offset,this.token.len,e)}create(e){return new e(this.token.offset,this.token.len)}finish(e,t,n,r){if(!(e instanceof se)&&(t&&this.markError(e,t,n,r),this.prevToken)){const t=this.prevToken.offset+this.prevToken.len;e.length=t>e.offset?t-e.offset:0}return e}markError(e,t,n,r){this.token!==this.lastErrorToken&&(e.addIssue(new kt(e,t,Ct.Error,void 0,this.token.offset,this.token.len)),this.lastErrorToken=this.token),(n||r)&&this.resync(n,r)}parseStylesheet(e){const t=e.version,n=e.getText();return this.internalParse(n,this._parseStylesheet,((r,i)=>{if(e.version!==t)throw new Error("Underlying model has changed, AST is no longer valid");return n.substr(r,i)}))}internalParse(e,t,n){this.scanner.setSource(e),this.token=this.scanner.scan();const r=t.bind(this)();return r&&(r.textProvider=n||((t,n)=>e.substr(t,n))),r}_parseStylesheet(){const e=this.create(le);for(;e.addChild(this._parseStylesheetStart()););let t=!1;do{let n=!1;do{n=!1;const i=this._parseStylesheetStatement();for(i&&(e.addChild(i),n=!0,t=!1,this.peek(r.EOF)||!this._needsSemicolonAfter(i)||this.accept(r.SemiColon)||this.markError(e,Rt.SemiColonExpected));this.accept(r.SemiColon)||this.accept(r.CDO)||this.accept(r.CDC);)n=!0,t=!1}while(n);if(this.peek(r.EOF))break;t||(this.peek(r.AtKeyword)?this.markError(e,Rt.UnknownAtRule):this.markError(e,Rt.RuleOrSelectorExpected),t=!0),this.consumeToken()}while(!this.peek(r.EOF));return this.finish(e)}_parseStylesheetStart(){return this._parseCharset()}_parseStylesheetStatement(e=!1){return this.peek(r.AtKeyword)?this._parseStylesheetAtStatement(e):this._parseRuleset(e)}_parseStylesheetAtStatement(e=!1){return this._parseImport()||this._parseMedia(e)||this._parsePage()||this._parseFontFace()||this._parseKeyframe()||this._parseSupports(e)||this._parseLayer(e)||this._parsePropertyAtRule()||this._parseViewPort()||this._parseNamespace()||this._parseDocument()||this._parseContainer(e)||this._parseUnknownAtRule()}_tryParseRuleset(e){const t=this.mark();if(this._parseSelector(e)){for(;this.accept(r.Comma)&&this._parseSelector(e););if(this.accept(r.CurlyL))return this.restoreAtMark(t),this._parseRuleset(e)}return this.restoreAtMark(t),null}_parseRuleset(e=!1){const t=this.create(pe),n=t.getSelectors();if(!n.addChild(this._parseSelector(e)))return null;for(;this.accept(r.Comma);)if(!n.addChild(this._parseSelector(e)))return this.finish(t,Rt.SelectorExpected);return this._parseBody(t,this._parseRuleSetDeclaration.bind(this))}_parseRuleSetDeclarationAtStatement(){return this._parseMedia(!0)||this._parseSupports(!0)||this._parseLayer(!0)||this._parseContainer(!0)||this._parseUnknownAtRule()}_parseRuleSetDeclaration(){return this.peek(r.AtKeyword)?this._parseRuleSetDeclarationAtStatement():this.peek(r.Ident)?this._tryParseRuleset(!0)||this._parseDeclaration():this._parseRuleset(!0)}_needsSemicolonAfter(e){switch(e.type){case te.Keyframe:case te.ViewPort:case te.Media:case te.Ruleset:case te.Namespace:case te.If:case te.For:case te.Each:case te.While:case te.MixinDeclaration:case te.FunctionDeclaration:case te.MixinContentDeclaration:return!1;case te.ExtendsReference:case te.MixinContentReference:case te.ReturnStatement:case te.MediaQuery:case te.Debug:case te.Import:case te.AtApplyRule:case te.CustomPropertyDeclaration:return!0;case te.VariableDeclaration:return e.needsSemicolon;case te.MixinReference:return!e.getContent();case te.Declaration:return!e.getNestedProperties()}return!1}_parseDeclarations(e){const t=this.create(de);if(!this.accept(r.CurlyL))return null;let n=e();for(;t.addChild(n)&&!this.peek(r.CurlyR);){if(this._needsSemicolonAfter(n)&&!this.accept(r.SemiColon))return this.finish(t,Rt.SemiColonExpected,[r.SemiColon,r.CurlyR]);for(n&&this.prevToken&&this.prevToken.type===r.SemiColon&&(n.semicolonPosition=this.prevToken.offset);this.accept(r.SemiColon););n=e()}return this.accept(r.CurlyR)?this.finish(t):this.finish(t,Rt.RightCurlyExpected,[r.CurlyR,r.SemiColon])}_parseBody(e,t){return e.setDeclarations(this._parseDeclarations(t))?this.finish(e):this.finish(e,Rt.LeftCurlyExpected,[r.CurlyR,r.SemiColon])}_parseSelector(e){const t=this.create(ue);let n=!1;for(e&&(n=t.addChild(this._parseCombinator()));t.addChild(this._parseSimpleSelector());)n=!0,t.addChild(this._parseCombinator());return n?this.finish(t):null}_parseDeclaration(e){const t=this._tryParseCustomPropertyDeclaration(e);if(t)return t;const n=this.create(be);return n.setProperty(this._parseProperty())?this.accept(r.Colon)?(this.prevToken&&(n.colonPosition=this.prevToken.offset),n.setValue(this._parseExpr())?(n.addChild(this._parsePrio()),this.peek(r.SemiColon)&&(n.semicolonPosition=this.token.offset),this.finish(n)):this.finish(n,Rt.PropertyValueExpected)):this.finish(n,Rt.ColonExpected,[r.Colon],e||[r.SemiColon]):null}_tryParseCustomPropertyDeclaration(e){if(!this.peekRegExp(r.Ident,/^--/))return null;const t=this.create(ye);if(!t.setProperty(this._parseProperty()))return null;if(!this.accept(r.Colon))return this.finish(t,Rt.ColonExpected,[r.Colon]);this.prevToken&&(t.colonPosition=this.prevToken.offset);const n=this.mark();if(this.peek(r.CurlyL)){const e=this.create(ge),i=this._parseDeclarations(this._parseRuleSetDeclaration.bind(this));if(e.setDeclarations(i)&&!i.isErroneous(!0)&&(e.addChild(this._parsePrio()),this.peek(r.SemiColon)))return this.finish(e),t.setPropertySet(e),t.semicolonPosition=this.token.offset,this.finish(t);this.restoreAtMark(n)}const i=this._parseExpr();return i&&!i.isErroneous(!0)&&(this._parsePrio(),this.peekOne(...e||[],r.SemiColon,r.EOF))?(t.setValue(i),this.peek(r.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)):(this.restoreAtMark(n),t.addChild(this._parseCustomPropertyValue(e)),t.addChild(this._parsePrio()),ei(t.colonPosition)&&this.token.offset===t.colonPosition+1?this.finish(t,Rt.PropertyValueExpected):this.finish(t))}_parseCustomPropertyValue(e=[r.CurlyR]){const t=this.create(oe),n=()=>-1!==e.indexOf(this.token.type);let i=0,o=0,s=0;e:for(;;){switch(this.token.type){case r.SemiColon:case r.Exclamation:if(0===i&&0===o&&0===s)break e;break;case r.CurlyL:i++;break;case r.CurlyR:if(i--,i<0){if(n()&&0===o&&0===s)break e;return this.finish(t,Rt.LeftCurlyExpected)}break;case r.ParenthesisL:o++;break;case r.ParenthesisR:if(o--,o<0){if(n()&&0===s&&0===i)break e;return this.finish(t,Rt.LeftParenthesisExpected)}break;case r.BracketL:s++;break;case r.BracketR:if(s--,s<0)return this.finish(t,Rt.LeftSquareBracketExpected);break;case r.BadString:break e;case r.EOF:let e=Rt.RightCurlyExpected;return s>0?e=Rt.RightSquareBracketExpected:o>0&&(e=Rt.RightParenthesisExpected),this.finish(t,e)}this.consumeToken()}return this.finish(t)}_tryToParseDeclaration(e){const t=this.mark();return this._parseProperty()&&this.accept(r.Colon)?(this.restoreAtMark(t),this._parseDeclaration(e)):(this.restoreAtMark(t),null)}_parseProperty(){const e=this.create(ve),t=this.mark();return(this.acceptDelim("*")||this.acceptDelim("_"))&&this.hasWhitespace()?(this.restoreAtMark(t),null):e.setIdentifier(this._parsePropertyIdentifier())?this.finish(e):null}_parsePropertyIdentifier(){return this._parseIdent()}_parseCharset(){if(!this.peek(r.Charset))return null;const e=this.create(oe);return this.consumeToken(),this.accept(r.String)?this.accept(r.SemiColon)?this.finish(e):this.finish(e,Rt.SemiColonExpected):this.finish(e,Rt.IdentifierExpected)}_parseImport(){if(!this.peekKeyword("@import"))return null;const e=this.create(ze);return this.consumeToken(),e.addChild(this._parseURILiteral())||e.addChild(this._parseStringLiteral())?this._completeParseImport(e):this.finish(e,Rt.URIOrStringExpected)}_completeParseImport(e){if(this.acceptIdent("layer")&&this.accept(r.ParenthesisL)){if(!e.addChild(this._parseLayerName()))return this.finish(e,Rt.IdentifierExpected,[r.SemiColon]);if(!this.accept(r.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[r.ParenthesisR],[])}return this.acceptIdent("supports")&&this.accept(r.ParenthesisL)&&(e.addChild(this._tryToParseDeclaration()||this._parseSupportsCondition()),!this.accept(r.ParenthesisR))?this.finish(e,Rt.RightParenthesisExpected,[r.ParenthesisR],[]):(this.peek(r.SemiColon)||this.peek(r.EOF)||e.setMedialist(this._parseMediaQueryList()),this.finish(e))}_parseNamespace(){if(!this.peekKeyword("@namespace"))return null;const e=this.create(Le);return this.consumeToken(),e.addChild(this._parseURILiteral())||(e.addChild(this._parseIdent()),e.addChild(this._parseURILiteral())||e.addChild(this._parseStringLiteral()))?this.accept(r.SemiColon)?this.finish(e):this.finish(e,Rt.SemiColonExpected):this.finish(e,Rt.URIExpected,[r.SemiColon])}_parseFontFace(){if(!this.peekKeyword("@font-face"))return null;const e=this.create(Ie);return this.consumeToken(),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseViewPort(){if(!this.peekKeyword("@-ms-viewport")&&!this.peekKeyword("@-o-viewport")&&!this.peekKeyword("@viewport"))return null;const e=this.create(Te);return this.consumeToken(),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseKeyframe(){if(!this.peekRegExp(r.AtKeyword,this.keyframeRegex))return null;const e=this.create(Me),t=this.create(oe);return this.consumeToken(),e.setKeyword(this.finish(t)),t.matches("@-ms-keyframes")&&this.markError(t,Rt.UnknownKeyword),e.setIdentifier(this._parseKeyframeIdent())?this._parseBody(e,this._parseKeyframeSelector.bind(this)):this.finish(e,Rt.IdentifierExpected,[r.CurlyR])}_parseKeyframeIdent(){return this._parseIdent([ne.Keyframe])}_parseKeyframeSelector(){const e=this.create(Oe);let t=!1;if(e.addChild(this._parseIdent())&&(t=!0),this.accept(r.Percentage)&&(t=!0),!t)return null;for(;this.accept(r.Comma);)if(t=!1,e.addChild(this._parseIdent())&&(t=!0),this.accept(r.Percentage)&&(t=!0),!t)return this.finish(e,Rt.PercentageExpected);return this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_tryParseKeyframeSelector(){const e=this.create(Oe),t=this.mark();let n=!1;if(e.addChild(this._parseIdent())&&(n=!0),this.accept(r.Percentage)&&(n=!0),!n)return null;for(;this.accept(r.Comma);)if(n=!1,e.addChild(this._parseIdent())&&(n=!0),this.accept(r.Percentage)&&(n=!0),!n)return this.restoreAtMark(t),null;return this.peek(r.CurlyL)?this._parseBody(e,this._parseRuleSetDeclaration.bind(this)):(this.restoreAtMark(t),null)}_parsePropertyAtRule(){if(!this.peekKeyword("@property"))return null;const e=this.create(Ve);return this.consumeToken(),this.peekRegExp(r.Ident,/^--/)&&e.setName(this._parseIdent([ne.Property]))?this._parseBody(e,this._parseDeclaration.bind(this)):this.finish(e,Rt.IdentifierExpected)}_parseLayer(e=!1){if(!this.peekKeyword("@layer"))return null;const t=this.create(Ue);this.consumeToken();const n=this._parseLayerNameList();return n&&t.setNames(n),n&&1!==n.getChildren().length||!this.peek(r.CurlyL)?this.accept(r.SemiColon)?this.finish(t):this.finish(t,Rt.SemiColonExpected):this._parseBody(t,this._parseLayerDeclaration.bind(this,e))}_parseLayerDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseLayerNameList(){const e=this.createNode(te.LayerNameList);if(!e.addChild(this._parseLayerName()))return null;for(;this.accept(r.Comma);)if(!e.addChild(this._parseLayerName()))return this.finish(e,Rt.IdentifierExpected);return this.finish(e)}_parseLayerName(){const e=this.createNode(te.LayerName);if(!e.addChild(this._parseIdent()))return null;for(;!this.hasWhitespace()&&this.acceptDelim(".");)if(this.hasWhitespace()||!e.addChild(this._parseIdent()))return this.finish(e,Rt.IdentifierExpected);return this.finish(e)}_parseSupports(e=!1){if(!this.peekKeyword("@supports"))return null;const t=this.create($e);return this.consumeToken(),t.addChild(this._parseSupportsCondition()),this._parseBody(t,this._parseSupportsDeclaration.bind(this,e))}_parseSupportsDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseSupportsCondition(){const e=this.create(Ye);if(this.acceptIdent("not"))e.addChild(this._parseSupportsConditionInParens());else if(e.addChild(this._parseSupportsConditionInParens()),this.peekRegExp(r.Ident,/^(and|or)$/i)){const t=this.token.text.toLowerCase();for(;this.acceptIdent(t);)e.addChild(this._parseSupportsConditionInParens())}return this.finish(e)}_parseSupportsConditionInParens(){const e=this.create(Ye);if(this.accept(r.ParenthesisL))return this.prevToken&&(e.lParent=this.prevToken.offset),e.addChild(this._tryToParseDeclaration([r.ParenthesisR]))||this._parseSupportsCondition()?this.accept(r.ParenthesisR)?(this.prevToken&&(e.rParent=this.prevToken.offset),this.finish(e)):this.finish(e,Rt.RightParenthesisExpected,[r.ParenthesisR],[]):this.finish(e,Rt.ConditionExpected);if(this.peek(r.Ident)){const t=this.mark();if(this.consumeToken(),!this.hasWhitespace()&&this.accept(r.ParenthesisL)){let t=1;for(;this.token.type!==r.EOF&&0!==t;)this.token.type===r.ParenthesisL?t++:this.token.type===r.ParenthesisR&&t--,this.consumeToken();return this.finish(e)}this.restoreAtMark(t)}return this.finish(e,Rt.LeftParenthesisExpected,[],[r.ParenthesisL])}_parseMediaDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseMedia(e=!1){if(!this.peekKeyword("@media"))return null;const t=this.create(je);return this.consumeToken(),t.addChild(this._parseMediaQueryList())?this._parseBody(t,this._parseMediaDeclaration.bind(this,e)):this.finish(t,Rt.MediaQueryExpected)}_parseMediaQueryList(){const e=this.create(He);if(!e.addChild(this._parseMediaQuery()))return this.finish(e,Rt.MediaQueryExpected);for(;this.accept(r.Comma);)if(!e.addChild(this._parseMediaQuery()))return this.finish(e,Rt.MediaQueryExpected);return this.finish(e)}_parseMediaQuery(){const e=this.create(Ge),t=this.mark();if(this.acceptIdent("not"),this.peek(r.ParenthesisL))this.restoreAtMark(t),e.addChild(this._parseMediaCondition());else{if(this.acceptIdent("only"),!e.addChild(this._parseIdent()))return null;this.acceptIdent("and")&&e.addChild(this._parseMediaCondition())}return this.finish(e)}_parseRatio(){const e=this.mark(),t=this.create(ot);return this._parseNumeric()?this.acceptDelim("/")?this._parseNumeric()?this.finish(t):this.finish(t,Rt.NumberExpected):(this.restoreAtMark(e),null):null}_parseMediaCondition(){const e=this.create(Je);this.acceptIdent("not");let t=!0;for(;t;){if(!this.accept(r.ParenthesisL))return this.finish(e,Rt.LeftParenthesisExpected,[],[r.CurlyL]);if(this.peek(r.ParenthesisL)||this.peekIdent("not")?e.addChild(this._parseMediaCondition()):e.addChild(this._parseMediaFeature()),!this.accept(r.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[],[r.CurlyL]);t=this.acceptIdent("and")||this.acceptIdent("or")}return this.finish(e)}_parseMediaFeature(){const e=[r.ParenthesisR],t=this.create(Xe);if(t.addChild(this._parseMediaFeatureName())){if(this.accept(r.Colon)){if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Rt.TermExpected,[],e)}else if(this._parseMediaFeatureRangeOperator()){if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Rt.TermExpected,[],e);if(this._parseMediaFeatureRangeOperator()&&!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Rt.TermExpected,[],e)}}else{if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Rt.IdentifierExpected,[],e);if(!this._parseMediaFeatureRangeOperator())return this.finish(t,Rt.OperatorExpected,[],e);if(!t.addChild(this._parseMediaFeatureName()))return this.finish(t,Rt.IdentifierExpected,[],e);if(this._parseMediaFeatureRangeOperator()&&!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Rt.TermExpected,[],e)}return this.finish(t)}_parseMediaFeatureRangeOperator(){return this.acceptDelim("<")||this.acceptDelim(">")?(this.hasWhitespace()||this.acceptDelim("="),!0):!!this.acceptDelim("=")}_parseMediaFeatureName(){return this._parseIdent()}_parseMediaFeatureValue(){return this._parseRatio()||this._parseTermExpression()}_parseMedium(){const e=this.create(oe);return e.addChild(this._parseIdent())?this.finish(e):null}_parsePageDeclaration(){return this._parsePageMarginBox()||this._parseRuleSetDeclaration()}_parsePage(){if(!this.peekKeyword("@page"))return null;const e=this.create(Qe);if(this.consumeToken(),e.addChild(this._parsePageSelector()))for(;this.accept(r.Comma);)if(!e.addChild(this._parsePageSelector()))return this.finish(e,Rt.IdentifierExpected);return this._parseBody(e,this._parsePageDeclaration.bind(this))}_parsePageMarginBox(){if(!this.peek(r.AtKeyword))return null;const e=this.create(Ze);return this.acceptOneKeyword(Qr)||this.markError(e,Rt.UnknownAtRule,[],[r.CurlyL]),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parsePageSelector(){if(!this.peek(r.Ident)&&!this.peek(r.Colon))return null;const e=this.create(oe);return e.addChild(this._parseIdent()),this.accept(r.Colon)&&!e.addChild(this._parseIdent())?this.finish(e,Rt.IdentifierExpected):this.finish(e)}_parseDocument(){if(!this.peekKeyword("@-moz-document"))return null;const e=this.create(Be);return this.consumeToken(),this.resync([],[r.CurlyL]),this._parseBody(e,this._parseStylesheetStatement.bind(this))}_parseContainerDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseContainer(e=!1){if(!this.peekKeyword("@container"))return null;const t=this.create(Ke);return this.consumeToken(),t.addChild(this._parseIdent()),t.addChild(this._parseContainerQuery()),this._parseBody(t,this._parseContainerDeclaration.bind(this,e))}_parseContainerQuery(){const e=this.create(oe);if(this.acceptIdent("not"))e.addChild(this._parseContainerQueryInParens());else if(e.addChild(this._parseContainerQueryInParens()),this.peekIdent("and"))for(;this.acceptIdent("and");)e.addChild(this._parseContainerQueryInParens());else if(this.peekIdent("or"))for(;this.acceptIdent("or");)e.addChild(this._parseContainerQueryInParens());return this.finish(e)}_parseContainerQueryInParens(){const e=this.create(oe);if(this.accept(r.ParenthesisL)){if(this.peekIdent("not")||this.peek(r.ParenthesisL)?e.addChild(this._parseContainerQuery()):e.addChild(this._parseMediaFeature()),!this.accept(r.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[],[r.CurlyL])}else{if(!this.acceptIdent("style"))return this.finish(e,Rt.LeftParenthesisExpected,[],[r.CurlyL]);if(this.hasWhitespace()||!this.accept(r.ParenthesisL))return this.finish(e,Rt.LeftParenthesisExpected,[],[r.CurlyL]);if(e.addChild(this._parseStyleQuery()),!this.accept(r.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[],[r.CurlyL])}return this.finish(e)}_parseStyleQuery(){const e=this.create(oe);if(this.acceptIdent("not"))e.addChild(this._parseStyleInParens());else if(this.peek(r.ParenthesisL)){if(e.addChild(this._parseStyleInParens()),this.peekIdent("and"))for(;this.acceptIdent("and");)e.addChild(this._parseStyleInParens());else if(this.peekIdent("or"))for(;this.acceptIdent("or");)e.addChild(this._parseStyleInParens())}else e.addChild(this._parseDeclaration([r.ParenthesisR]));return this.finish(e)}_parseStyleInParens(){const e=this.create(oe);return this.accept(r.ParenthesisL)?(e.addChild(this._parseStyleQuery()),this.accept(r.ParenthesisR)?this.finish(e):this.finish(e,Rt.RightParenthesisExpected,[],[r.CurlyL])):this.finish(e,Rt.LeftParenthesisExpected,[],[r.CurlyL])}_parseUnknownAtRule(){if(!this.peek(r.AtKeyword))return null;const e=this.create(yt);e.addChild(this._parseUnknownAtRuleName());let t=0,n=0,i=0,o=0;e:for(;;){switch(this.token.type){case r.SemiColon:if(0===n&&0===i&&0===o)break e;break;case r.EOF:return n>0?this.finish(e,Rt.RightCurlyExpected):o>0?this.finish(e,Rt.RightSquareBracketExpected):i>0?this.finish(e,Rt.RightParenthesisExpected):this.finish(e);case r.CurlyL:t++,n++;break;case r.CurlyR:if(n--,t>0&&0===n){if(this.consumeToken(),o>0)return this.finish(e,Rt.RightSquareBracketExpected);if(i>0)return this.finish(e,Rt.RightParenthesisExpected);break e}if(n<0){if(0===i&&0===o)break e;return this.finish(e,Rt.LeftCurlyExpected)}break;case r.ParenthesisL:i++;break;case r.ParenthesisR:if(i--,i<0)return this.finish(e,Rt.LeftParenthesisExpected);break;case r.BracketL:o++;break;case r.BracketR:if(o--,o<0)return this.finish(e,Rt.LeftSquareBracketExpected)}this.consumeToken()}return e}_parseUnknownAtRuleName(){const e=this.create(oe);return this.accept(r.AtKeyword)?this.finish(e):e}_parseOperator(){if(this.peekDelim("/")||this.peekDelim("*")||this.peekDelim("+")||this.peekDelim("-")||this.peek(r.Dashmatch)||this.peek(r.Includes)||this.peek(r.SubstringOperator)||this.peek(r.PrefixOperator)||this.peek(r.SuffixOperator)||this.peekDelim("=")){const e=this.createNode(te.Operator);return this.consumeToken(),this.finish(e)}return null}_parseUnaryOperator(){if(!this.peekDelim("+")&&!this.peekDelim("-"))return null;const e=this.create(oe);return this.consumeToken(),this.finish(e)}_parseCombinator(){if(this.peekDelim(">")){const e=this.create(oe);this.consumeToken();const t=this.mark();if(!this.hasWhitespace()&&this.acceptDelim(">")){if(!this.hasWhitespace()&&this.acceptDelim(">"))return e.type=te.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(t)}return e.type=te.SelectorCombinatorParent,this.finish(e)}if(this.peekDelim("+")){const e=this.create(oe);return this.consumeToken(),e.type=te.SelectorCombinatorSibling,this.finish(e)}if(this.peekDelim("~")){const e=this.create(oe);return this.consumeToken(),e.type=te.SelectorCombinatorAllSiblings,this.finish(e)}if(this.peekDelim("/")){const e=this.create(oe);this.consumeToken();const t=this.mark();if(!this.hasWhitespace()&&this.acceptIdent("deep")&&!this.hasWhitespace()&&this.acceptDelim("/"))return e.type=te.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(t)}return null}_parseSimpleSelector(){const e=this.create(me);let t=0;for(e.addChild(this._parseElementName()||this._parseNestingSelector())&&t++;(0===t||!this.hasWhitespace())&&e.addChild(this._parseSimpleSelectorBody());)t++;return t>0?this.finish(e):null}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(te.SelectorCombinator);return this.consumeToken(),this.finish(e)}return null}_parseSimpleSelectorBody(){return this._parsePseudo()||this._parseHash()||this._parseClass()||this._parseAttrib()}_parseSelectorIdent(){return this._parseIdent()}_parseHash(){if(!this.peek(r.Hash)&&!this.peekDelim("#"))return null;const e=this.createNode(te.IdentifierSelector);if(this.acceptDelim("#")){if(this.hasWhitespace()||!e.addChild(this._parseSelectorIdent()))return this.finish(e,Rt.IdentifierExpected)}else this.consumeToken();return this.finish(e)}_parseClass(){if(!this.peekDelim("."))return null;const e=this.createNode(te.ClassSelector);return this.consumeToken(),this.hasWhitespace()||!e.addChild(this._parseSelectorIdent())?this.finish(e,Rt.IdentifierExpected):this.finish(e)}_parseElementName(){const e=this.mark(),t=this.createNode(te.ElementNameSelector);return t.addChild(this._parseNamespacePrefix()),t.addChild(this._parseSelectorIdent())||this.acceptDelim("*")?this.finish(t):(this.restoreAtMark(e),null)}_parseNamespacePrefix(){const e=this.mark(),t=this.createNode(te.NamespacePrefix);return!t.addChild(this._parseIdent())&&this.acceptDelim("*"),this.acceptDelim("|")?this.finish(t):(this.restoreAtMark(e),null)}_parseAttrib(){if(!this.peek(r.BracketL))return null;const e=this.create(rt);return this.consumeToken(),e.setNamespacePrefix(this._parseNamespacePrefix()),e.setIdentifier(this._parseIdent())?(e.setOperator(this._parseOperator())&&(e.setValue(this._parseBinaryExpr()),this.acceptIdent("i"),this.acceptIdent("s")),this.accept(r.BracketR)?this.finish(e):this.finish(e,Rt.RightSquareBracketExpected)):this.finish(e,Rt.IdentifierExpected)}_parsePseudo(){const e=this._tryParsePseudoIdentifier();if(e){if(!this.hasWhitespace()&&this.accept(r.ParenthesisL)){const t=()=>{const e=this.create(oe);if(!e.addChild(this._parseSelector(!0)))return null;for(;this.accept(r.Comma)&&e.addChild(this._parseSelector(!0)););return this.peek(r.ParenthesisR)?this.finish(e):null};if(!e.addChild(this.try(t))&&e.addChild(this._parseBinaryExpr())&&this.acceptIdent("of")&&!e.addChild(this.try(t)))return this.finish(e,Rt.SelectorExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected)}return this.finish(e)}return null}_tryParsePseudoIdentifier(){if(!this.peek(r.Colon))return null;const e=this.mark(),t=this.createNode(te.PseudoSelector);return this.consumeToken(),this.hasWhitespace()?(this.restoreAtMark(e),null):(this.accept(r.Colon),this.hasWhitespace()||!t.addChild(this._parseIdent())?this.finish(t,Rt.IdentifierExpected):this.finish(t))}_tryParsePrio(){const e=this.mark();return this._parsePrio()||(this.restoreAtMark(e),null)}_parsePrio(){if(!this.peek(r.Exclamation))return null;const e=this.createNode(te.Prio);return this.accept(r.Exclamation)&&this.acceptIdent("important")?this.finish(e):null}_parseExpr(e=!1){const t=this.create(et);if(!t.addChild(this._parseBinaryExpr()))return null;for(;;){if(this.peek(r.Comma)){if(e)return this.finish(t);this.consumeToken()}if(!t.addChild(this._parseBinaryExpr()))break}return this.finish(t)}_parseUnicodeRange(){if(!this.peekIdent("u"))return null;const e=this.create(ae);return this.acceptUnicodeRange()?this.finish(e):null}_parseNamedLine(){if(!this.peek(r.BracketL))return null;const e=this.createNode(te.GridLine);for(this.consumeToken();e.addChild(this._parseIdent()););return this.accept(r.BracketR)?this.finish(e):this.finish(e,Rt.RightSquareBracketExpected)}_parseBinaryExpr(e,t){let n=this.create(tt);if(!n.setLeft(e||this._parseTerm()))return null;if(!n.setOperator(t||this._parseOperator()))return this.finish(n);if(!n.setRight(this._parseTerm()))return this.finish(n,Rt.TermExpected);n=this.finish(n);const r=this._parseOperator();return r&&(n=this._parseBinaryExpr(n,r)),this.finish(n)}_parseTerm(){let e=this.create(nt);return e.setOperator(this._parseUnaryOperator()),e.setExpression(this._parseTermExpression())?this.finish(e):null}_parseTermExpression(){return this._parseURILiteral()||this._parseUnicodeRange()||this._parseFunction()||this._parseIdent()||this._parseStringLiteral()||this._parseNumeric()||this._parseHexColor()||this._parseOperation()||this._parseNamedLine()}_parseOperation(){if(!this.peek(r.ParenthesisL))return null;const e=this.create(oe);return this.consumeToken(),e.addChild(this._parseExpr()),this.accept(r.ParenthesisR)?this.finish(e):this.finish(e,Rt.RightParenthesisExpected)}_parseNumeric(){if(this.peek(r.Num)||this.peek(r.Percentage)||this.peek(r.Resolution)||this.peek(r.Length)||this.peek(r.EMS)||this.peek(r.EXS)||this.peek(r.Angle)||this.peek(r.Time)||this.peek(r.Dimension)||this.peek(r.ContainerQueryLength)||this.peek(r.Freq)){const e=this.create(lt);return this.consumeToken(),this.finish(e)}return null}_parseStringLiteral(){if(!this.peek(r.String)&&!this.peek(r.BadString))return null;const e=this.createNode(te.StringLiteral);return this.consumeToken(),this.finish(e)}_parseURILiteral(){if(!this.peekRegExp(r.Ident,/^url(-prefix)?$/i))return null;const e=this.mark(),t=this.createNode(te.URILiteral);return this.accept(r.Ident),this.hasWhitespace()||!this.peek(r.ParenthesisL)?(this.restoreAtMark(e),null):(this.scanner.inURL=!0,this.consumeToken(),t.addChild(this._parseURLArgument()),this.scanner.inURL=!1,this.accept(r.ParenthesisR)?this.finish(t):this.finish(t,Rt.RightParenthesisExpected))}_parseURLArgument(){const e=this.create(oe);return this.accept(r.String)||this.accept(r.BadString)||this.acceptUnquotedString()?this.finish(e):null}_parseIdent(e){if(!this.peek(r.Ident))return null;const t=this.create(ce);return e&&(t.referenceTypes=e),t.isCustomProperty=this.peekRegExp(r.Ident,/^--/),this.consumeToken(),this.finish(t)}_parseFunction(){const e=this.mark(),t=this.create(Se);if(!t.setIdentifier(this._parseFunctionIdentifier()))return null;if(this.hasWhitespace()||!this.accept(r.ParenthesisL))return this.restoreAtMark(e),null;if(t.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)t.getArguments().addChild(this._parseFunctionArgument())||this.markError(t,Rt.ExpressionExpected);return this.accept(r.ParenthesisR)?this.finish(t):this.finish(t,Rt.RightParenthesisExpected)}_parseFunctionIdentifier(){if(!this.peek(r.Ident))return null;const e=this.create(ce);if(e.referenceTypes=[ne.Function],this.acceptIdent("progid")){if(this.accept(r.Colon))for(;this.accept(r.Ident)&&this.acceptDelim("."););return this.finish(e)}return this.consumeToken(),this.finish(e)}_parseFunctionArgument(){const e=this.create(Ce);return e.setValue(this._parseExpr(!0))?this.finish(e):null}_parseHexColor(){if(this.peekRegExp(r.Hash,/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/g)){const e=this.create(it);return this.consumeToken(),this.finish(e)}return null}}function ni(e,t){return-1!==e.indexOf(t)}function ri(...e){const t=[];for(const n of e)for(const e of n)ni(t,e)||t.push(e);return t}class ii{constructor(e,t){this.offset=e,this.length=t,this.symbols=[],this.parent=null,this.children=[]}addChild(e){this.children.push(e),e.setParent(this)}setParent(e){this.parent=e}findScope(e,t=0){return this.offset<=e&&this.offset+this.length>e+t||this.offset===e&&this.length===t?this.findInScope(e,t):null}findInScope(e,t=0){const n=e+t,r=function(e,t){let r=0,i=e.length;if(0===i)return 0;for(;rn?i=t:r=t+1}return r}(this.children);if(0===r)return this;const i=this.children[r-1];return i.offset<=e&&i.offset+i.length>=e+t?i.findInScope(e,t):this}addSymbol(e){this.symbols.push(e)}getSymbol(e,t){for(let n=0;n{Y(e.label,"_")&&Q(e.label,".scss")&&(e.textEdit?e.textEdit.newText=e.label.slice(1,-5):e.label=e.label.slice(1,-5))}));for(let e of o)n.items.push(e)}}return n}async providePathSuggestions(e,t,n,r,i){const o=mi(e),s=Y(e,"'")||Y(e,'"'),a=s?o.slice(0,t.character-(n.start.character+1)):o.slice(0,t.character-n.start.character),c=r.uri,l=function(e,t,n){let r;const i=e.lastIndexOf("/");if(-1===i)r=n;else{const e=t.slice(i+1),o=bi(n.end,-e.length),s=e.indexOf(" ");let a;a=-1!==s?bi(o,s):n.end,r=Ot.create(o,a)}return r}(a,o,s?function(e,t,n){const r=bi(e.start,1),i=bi(e.end,-1);return Ot.create(r,i)}(n):n),d=a.substring(0,a.lastIndexOf("/")+1);let h=i.resolveReference(d||".",c);if(h)try{const e=[],t=await this.readDirectory(h);for(const[n,r]of t)n.charCodeAt(0)===ui||r!==ir.Directory&&hi(h,n)===c||e.push(fi(n,r===ir.Directory,l));return e}catch(e){}return[]}}const ui=".".charCodeAt(0);function mi(e){return Y(e,"'")||Y(e,'"')?e.slice(1,-1):e}function fi(e,t,n){return t?{label:gi(e+="/"),kind:dn.Folder,textEdit:Gt.replace(n,gi(e)),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}:{label:gi(e),kind:dn.File,textEdit:Gt.replace(n,gi(e))}}function gi(e){return e.replace(/(\s|\(|\)|,|"|')/g,"\\$1")}function bi(e,t){return Mt.create(e.line,e.character+t)}const yi=hn.Snippet,vi={title:"Suggest",command:"editor.action.triggerSuggest"};var wi,Si;!function(e){e.Enums=" ",e.Normal="d",e.VendorPrefixed="x",e.Term="y",e.Variable="z"}(wi||(wi={}));class xi{constructor(e=null,t,n){this.variablePrefix=e,this.lsOptions=t,this.cssDataManager=n,this.completionParticipants=[]}configure(e){this.defaultSettings=e}getSymbolContext(){return this.symbolContext||(this.symbolContext=new ci(this.styleSheet)),this.symbolContext}setCompletionParticipants(e){this.completionParticipants=e||[]}async doComplete2(e,t,n,r,i=this.defaultSettings){if(!this.lsOptions.fileSystemProvider||!this.lsOptions.fileSystemProvider.readDirectory)return this.doComplete(e,t,n,i);const o=new pi(this.lsOptions.fileSystemProvider.readDirectory),s=this.completionParticipants;this.completionParticipants=[o].concat(s);const a=this.doComplete(e,t,n,i);try{const t=await o.computeCompletions(e,r);return{isIncomplete:a.isIncomplete||t.isIncomplete,itemDefaults:a.itemDefaults,items:t.items.concat(a.items)}}finally{this.completionParticipants=s}}doComplete(e,t,n,r){this.offset=e.offsetAt(t),this.position=t,this.currentWord=function(e,t){let n=t-1;const r=e.getText();for(;n>=0&&-1===' \t\n\r":{[()]},*>+'.indexOf(r.charAt(n));)n--;return r.substring(n+1,t)}(e,this.offset),this.defaultReplaceRange=Ot.create(Mt.create(this.position.line,this.position.character-this.currentWord.length),this.position),this.textDocument=e,this.styleSheet=n,this.documentSettings=r;try{const e={isIncomplete:!1,itemDefaults:{editRange:{start:{line:t.line,character:t.character-this.currentWord.length},end:t}},items:[]};this.nodePath=ie(this.styleSheet,this.offset);for(let t=this.nodePath.length-1;t>=0;t--){const n=this.nodePath[t];if(n instanceof ve)this.getCompletionsForDeclarationProperty(n.getParent(),e);else if(n instanceof et)n.parent instanceof ht?this.getVariableProposals(null,e):this.getCompletionsForExpression(n,e);else if(n instanceof me){const t=n.findAParent(te.ExtendsReference,te.Ruleset);if(t)if(t.type===te.ExtendsReference)this.getCompletionsForExtendsReference(t,n,e);else{const n=t;this.getCompletionsForSelector(n,n&&n.isNested(),e)}}else if(n instanceof Ce)this.getCompletionsForFunctionArgument(n,n.getParent(),e);else if(n instanceof de)this.getCompletionsForDeclarations(n,e);else if(n instanceof dt)this.getCompletionsForVariableDeclaration(n,e);else if(n instanceof pe)this.getCompletionsForRuleSet(n,e);else if(n instanceof ht)this.getCompletionsForInterpolation(n,e);else if(n instanceof De)this.getCompletionsForFunctionDeclaration(n,e);else if(n instanceof gt)this.getCompletionsForMixinReference(n,e);else if(n instanceof Se)this.getCompletionsForFunctionArgument(null,n,e);else if(n instanceof $e)this.getCompletionsForSupports(n,e);else if(n instanceof Ye)this.getCompletionsForSupportsCondition(n,e);else if(n instanceof ut)this.getCompletionsForExtendsReference(n,null,e);else if(n.type===te.URILiteral)this.getCompletionForUriLiteralValue(n,e);else if(null===n.parent)this.getCompletionForTopLevel(e);else{if(n.type!==te.StringLiteral||!this.isImportPathParent(n.parent.type))continue;this.getCompletionForImportPath(n,e)}if(e.items.length>0||this.offset>n.offset)return this.finalize(e)}return this.getCompletionsForStylesheet(e),0===e.items.length&&this.variablePrefix&&0===this.currentWord.indexOf(this.variablePrefix)&&this.getVariableProposals(null,e),this.finalize(e)}finally{this.position=null,this.currentWord=null,this.textDocument=null,this.styleSheet=null,this.symbolContext=null,this.defaultReplaceRange=null,this.nodePath=null}}isImportPathParent(e){return e===te.Import}finalize(e){return e}findInNodePath(...e){for(let t=this.nodePath.length-1;t>=0;t--){const n=this.nodePath[t];if(-1!==e.indexOf(n.type))return n}return null}getCompletionsForDeclarationProperty(e,t){return this.getPropertyProposals(e,t)}getPropertyProposals(e,t){const n=this.isTriggerPropertyValueCompletionEnabled,r=this.isCompletePropertyWithSemicolonEnabled;return this.cssDataManager.getProperties().forEach((i=>{let o,s,a=!1;e?(o=this.getCompletionRange(e.getProperty()),s=i.name,ei(e.colonPosition)||(s+=": ",a=!0)):(o=this.getCompletionRange(null),s=i.name+": ",a=!0),!e&&r&&(s+="$0;"),e&&!e.semicolonPosition&&r&&this.offset>=this.textDocument.offsetAt(o.end)&&(s+="$0;");const c={label:i.name,documentation:mr(i,this.doesSupportMarkdown()),tags:Ci(i)?[pn.Deprecated]:[],textEdit:Gt.replace(o,s),insertTextFormat:hn.Snippet,kind:dn.Property};i.restrictions||(a=!1),n&&a&&(c.command=vi);const l=(255-("number"==typeof i.relevance?Math.min(Math.max(i.relevance,0),99):50)).toString(16),d=Y(i.name,"-")?wi.VendorPrefixed:wi.Normal;c.sortText=d+"_"+l,t.items.push(c)})),this.completionParticipants.forEach((e=>{e.onCssProperty&&e.onCssProperty({propertyName:this.currentWord,range:this.defaultReplaceRange})})),t}get isTriggerPropertyValueCompletionEnabled(){return this.documentSettings?.triggerPropertyValueCompletion??!0}get isCompletePropertyWithSemicolonEnabled(){return this.documentSettings?.completePropertyWithSemicolon??!0}getCompletionsForDeclarationValue(e,t){const n=e.getFullPropertyName(),r=this.cssDataManager.getProperty(n);let i=e.getValue()||null;for(;i&&i.hasChildren();)i=i.findChildAtOffset(this.offset,!1);if(this.completionParticipants.forEach((e=>{e.onCssPropertyValue&&e.onCssPropertyValue({propertyName:n,propertyValue:this.currentWord,range:this.getCompletionRange(i)})})),r){if(r.restrictions)for(const e of r.restrictions)switch(e){case"color":this.getColorProposals(r,i,t);break;case"position":this.getPositionProposals(r,i,t);break;case"repeat":this.getRepeatStyleProposals(r,i,t);break;case"line-style":this.getLineStyleProposals(r,i,t);break;case"line-width":this.getLineWidthProposals(r,i,t);break;case"geometry-box":this.getGeometryBoxProposals(r,i,t);break;case"box":this.getBoxProposals(r,i,t);break;case"image":this.getImageProposals(r,i,t);break;case"timing-function":this.getTimingFunctionProposals(r,i,t);break;case"shape":this.getBasicShapeProposals(r,i,t)}this.getValueEnumProposals(r,i,t),this.getCSSWideKeywordProposals(r,i,t),this.getUnitProposals(r,i,t)}else{const n=function(e,t){const n=t.getFullPropertyName(),r=new ki;function i(e){return(e instanceof ce||e instanceof lt||e instanceof it)&&r.add(e.getText()),!0}return e.accept((function(e){if(e instanceof be&&e!==t&&function(e){const t=e.getFullPropertyName();return n===t}(e)){const t=e.getValue();t&&t.accept(i)}return!0})),r}(this.styleSheet,e);for(const e of n.getEntries())t.items.push({label:e,textEdit:Gt.replace(this.getCompletionRange(i),e),kind:dn.Value})}return this.getVariableProposals(i,t),this.getTermProposals(r,i,t),t}getValueEnumProposals(e,t,n){if(e.values)for(const r of e.values){let i,o=r.name;if(Q(o,")")){const e=o.lastIndexOf("(");-1!==e&&(o=o.substring(0,e+1)+"$1"+o.substring(e+1),i=yi)}let s=wi.Enums;Y(r.name,"-")&&(s+=wi.VendorPrefixed);const a={label:r.name,documentation:mr(r,this.doesSupportMarkdown()),tags:Ci(e)?[pn.Deprecated]:[],textEdit:Gt.replace(this.getCompletionRange(t),o),sortText:s,kind:dn.Value,insertTextFormat:i};n.items.push(a)}return n}getCSSWideKeywordProposals(e,t,n){for(const e in Vr)n.items.push({label:e,documentation:Vr[e],textEdit:Gt.replace(this.getCompletionRange(t),e),kind:dn.Value});for(const e in Br){const r=_i(e);n.items.push({label:e,documentation:Br[e],textEdit:Gt.replace(this.getCompletionRange(t),r),kind:dn.Function,insertTextFormat:yi,command:Y(e,"var")?vi:void 0})}return n}getCompletionsForInterpolation(e,t){return this.offset>=e.offset+2&&this.getVariableProposals(null,t),t}getVariableProposals(e,t){const n=this.getSymbolContext().findSymbolsAtOffset(this.offset,ne.Variable);for(const r of n){const n=Y(r.name,"--")?`var(${r.name})`:r.name,i={label:r.name,documentation:r.value?Z(r.value):r.value,textEdit:Gt.replace(this.getCompletionRange(e),n),kind:dn.Variable,sortText:wi.Variable};if("string"==typeof i.documentation&&Rr(i.documentation)&&(i.kind=dn.Color),r.node.type===te.FunctionParameter){const e=r.node.getParent();e.type===te.MixinDeclaration&&(i.detail=Et.t("argument from '{0}'",e.getName()))}t.items.push(i)}return t}getVariableProposalsForCSSVarFunction(e){const t=new ki;this.styleSheet.acceptVisitor(new Fi(t,this.offset));let n=this.getSymbolContext().findSymbolsAtOffset(this.offset,ne.Variable);for(const r of n){if(Y(r.name,"--")){const t={label:r.name,documentation:r.value?Z(r.value):r.value,textEdit:Gt.replace(this.getCompletionRange(null),r.name),kind:dn.Variable};"string"==typeof t.documentation&&Rr(t.documentation)&&(t.kind=dn.Color),e.items.push(t)}t.remove(r.name)}for(const n of t.getEntries())if(Y(n,"--")){const t={label:n,textEdit:Gt.replace(this.getCompletionRange(null),n),kind:dn.Variable};e.items.push(t)}return e}getUnitProposals(e,t,n){let r="0";if(this.currentWord.length>0){const e=this.currentWord.match(/^-?\d[\.\d+]*/);e&&(r=e[0],n.isIncomplete=r.length===this.currentWord.length)}else 0===this.currentWord.length&&(n.isIncomplete=!0);if(t&&t.parent&&t.parent.type===te.Term&&(t=t.getParent()),e.restrictions)for(const i of e.restrictions){const e=Jr[i];if(e)for(const i of e){const e=r+i;n.items.push({label:e,textEdit:Gt.replace(this.getCompletionRange(t),e),kind:dn.Unit})}}return n}getCompletionRange(e){if(e&&e.offset<=this.offset&&this.offset<=e.end){const t=-1!==e.end?this.textDocument.positionAt(e.end):this.position,n=this.textDocument.positionAt(e.offset);if(n.line===t.line)return Ot.create(n,t)}return this.defaultReplaceRange}getColorProposals(e,t,n){for(const e in xr)n.items.push({label:e,documentation:xr[e],textEdit:Gt.replace(this.getCompletionRange(t),e),kind:dn.Color});for(const e in kr)n.items.push({label:e,documentation:kr[e],textEdit:Gt.replace(this.getCompletionRange(t),e),kind:dn.Value});const r=new ki;this.styleSheet.acceptVisitor(new Ei(r,this.offset));for(const e of r.getEntries())n.items.push({label:e,textEdit:Gt.replace(this.getCompletionRange(t),e),kind:dn.Color});for(const e of wr)n.items.push({label:e.label,detail:e.func,documentation:e.desc,textEdit:Gt.replace(this.getCompletionRange(t),e.insertText),insertTextFormat:yi,kind:dn.Function});return n}getPositionProposals(e,t,n){for(const e in Wr)n.items.push({label:e,documentation:Wr[e],textEdit:Gt.replace(this.getCompletionRange(t),e),kind:dn.Value});return n}getRepeatStyleProposals(e,t,n){for(const e in qr)n.items.push({label:e,documentation:qr[e],textEdit:Gt.replace(this.getCompletionRange(t),e),kind:dn.Value});return n}getLineStyleProposals(e,t,n){for(const e in Lr)n.items.push({label:e,documentation:Lr[e],textEdit:Gt.replace(this.getCompletionRange(t),e),kind:dn.Value});return n}getLineWidthProposals(e,t,n){for(const e of jr)n.items.push({label:e,textEdit:Gt.replace(this.getCompletionRange(t),e),kind:dn.Value});return n}getGeometryBoxProposals(e,t,n){for(const e in Ur)n.items.push({label:e,documentation:Ur[e],textEdit:Gt.replace(this.getCompletionRange(t),e),kind:dn.Value});return n}getBoxProposals(e,t,n){for(const e in $r)n.items.push({label:e,documentation:$r[e],textEdit:Gt.replace(this.getCompletionRange(t),e),kind:dn.Value});return n}getImageProposals(e,t,n){for(const e in Kr){const r=_i(e);n.items.push({label:e,documentation:Kr[e],textEdit:Gt.replace(this.getCompletionRange(t),r),kind:dn.Function,insertTextFormat:e!==r?yi:void 0})}return n}getTimingFunctionProposals(e,t,n){for(const e in Hr){const r=_i(e);n.items.push({label:e,documentation:Hr[e],textEdit:Gt.replace(this.getCompletionRange(t),r),kind:dn.Function,insertTextFormat:e!==r?yi:void 0})}return n}getBasicShapeProposals(e,t,n){for(const e in Gr){const r=_i(e);n.items.push({label:e,documentation:Gr[e],textEdit:Gt.replace(this.getCompletionRange(t),r),kind:dn.Function,insertTextFormat:e!==r?yi:void 0})}return n}getCompletionsForStylesheet(e){const t=this.styleSheet.findFirstChildBeforeOffset(this.offset);return t?t instanceof pe?this.getCompletionsForRuleSet(t,e):t instanceof $e?this.getCompletionsForSupports(t,e):e:this.getCompletionForTopLevel(e)}getCompletionForTopLevel(e){return this.cssDataManager.getAtDirectives().forEach((t=>{e.items.push({label:t.name,textEdit:Gt.replace(this.getCompletionRange(null),t.name),documentation:mr(t,this.doesSupportMarkdown()),tags:Ci(t)?[pn.Deprecated]:[],kind:dn.Keyword})})),this.getCompletionsForSelector(null,!1,e),e}getCompletionsForRuleSet(e,t){const n=e.getDeclarations();return n&&n.endsWith("}")&&this.offset>=n.end?this.getCompletionForTopLevel(t):!n||this.offset<=n.offset?this.getCompletionsForSelector(e,e.isNested(),t):this.getCompletionsForDeclarations(e.getDeclarations(),t)}getCompletionsForSelector(e,t,n){const r=this.findInNodePath(te.PseudoSelector,te.IdentifierSelector,te.ClassSelector,te.ElementNameSelector);if(!r&&this.hasCharacterAtPosition(this.offset-this.currentWord.length-1,":")&&(this.currentWord=":"+this.currentWord,this.hasCharacterAtPosition(this.offset-this.currentWord.length-1,":")&&(this.currentWord=":"+this.currentWord),this.defaultReplaceRange=Ot.create(Mt.create(this.position.line,this.position.character-this.currentWord.length),this.position)),this.cssDataManager.getPseudoClasses().forEach((e=>{const t=_i(e.name),i={label:e.name,textEdit:Gt.replace(this.getCompletionRange(r),t),documentation:mr(e,this.doesSupportMarkdown()),tags:Ci(e)?[pn.Deprecated]:[],kind:dn.Function,insertTextFormat:e.name!==t?yi:void 0};Y(e.name,":-")&&(i.sortText=wi.VendorPrefixed),n.items.push(i)})),this.cssDataManager.getPseudoElements().forEach((e=>{const t=_i(e.name),i={label:e.name,textEdit:Gt.replace(this.getCompletionRange(r),t),documentation:mr(e,this.doesSupportMarkdown()),tags:Ci(e)?[pn.Deprecated]:[],kind:dn.Function,insertTextFormat:e.name!==t?yi:void 0};Y(e.name,"::-")&&(i.sortText=wi.VendorPrefixed),n.items.push(i)})),!t){for(const e of Xr)n.items.push({label:e,textEdit:Gt.replace(this.getCompletionRange(r),e),kind:dn.Keyword});for(const e of Yr)n.items.push({label:e,textEdit:Gt.replace(this.getCompletionRange(r),e),kind:dn.Keyword})}const i={};i[this.currentWord]=!0;const o=this.textDocument.getText();if(this.styleSheet.accept((e=>{if(e.type===te.SimpleSelector&&e.length>0){const t=o.substr(e.offset,e.length);return"."!==t.charAt(0)||i[t]||(i[t]=!0,n.items.push({label:t,textEdit:Gt.replace(this.getCompletionRange(r),t),kind:dn.Keyword})),!1}return!0})),e&&e.isNested()){const t=e.getSelectors().findFirstChildBeforeOffset(this.offset);t&&0===e.getSelectors().getChildren().indexOf(t)&&this.getPropertyProposals(null,n)}return n}getCompletionsForDeclarations(e,t){if(!e||this.offset===e.offset)return t;const n=e.findFirstChildBeforeOffset(this.offset);if(!n)return this.getCompletionsForDeclarationProperty(null,t);if(n instanceof fe){const e=n;if(!ei(e.colonPosition)||this.offset<=e.colonPosition)return this.getCompletionsForDeclarationProperty(e,t);if(ei(e.semicolonPosition)&&e.semicolonPositione.colonPosition&&this.getVariableProposals(e.getValue()||null,t),t}getCompletionsForExpression(e,t){const n=e.getParent();if(n instanceof Ce)return this.getCompletionsForFunctionArgument(n,n.getParent(),t),t;const r=e.findParent(te.Declaration);if(!r)return this.getTermProposals(void 0,null,t),t;const i=e.findChildAtOffset(this.offset,!0);return i?i instanceof lt||i instanceof ce?this.getCompletionsForDeclarationValue(r,t):t:this.getCompletionsForDeclarationValue(r,t)}getCompletionsForFunctionArgument(e,t,n){const r=t.getIdentifier();return r&&r.matches("var")&&(t.getArguments().hasChildren()&&t.getArguments().getChild(0)!==e||this.getVariableProposalsForCSSVarFunction(n)),n}getCompletionsForFunctionDeclaration(e,t){const n=e.getDeclarations();return n&&this.offset>n.offset&&this.offset{e.onCssMixinReference&&e.onCssMixinReference({mixinName:this.currentWord,range:this.getCompletionRange(r)})})),t}getTermProposals(e,t,n){const r=this.getSymbolContext().findSymbolsAtOffset(this.offset,ne.Function);for(const e of r)e.node instanceof De&&n.items.push(this.makeTermProposal(e,e.node.getParameters(),t));return n}makeTermProposal(e,t,n){e.node;const r=t.getChildren().map((e=>e instanceof xe?e.getName():e.getText())),i=e.name+"("+r.map(((e,t)=>"${"+(t+1)+":"+e+"}")).join(", ")+")";return{label:e.name,detail:e.name+"("+r.join(", ")+")",textEdit:Gt.replace(this.getCompletionRange(n),i),insertTextFormat:yi,kind:dn.Function,sortText:wi.Term}}getCompletionsForSupportsCondition(e,t){const n=e.findFirstChildBeforeOffset(this.offset);if(n){if(n instanceof be)return!ei(n.colonPosition)||this.offset<=n.colonPosition?this.getCompletionsForDeclarationProperty(n,t):this.getCompletionsForDeclarationValue(n,t);if(n instanceof Ye)return this.getCompletionsForSupportsCondition(n,t)}return ei(e.lParent)&&this.offset>e.lParent&&(!ei(e.rParent)||this.offset<=e.rParent)?this.getCompletionsForDeclarationProperty(null,t):t}getCompletionsForSupports(e,t){const n=e.getDeclarations();if(!n||this.offset<=n.offset){const n=e.findFirstChildBeforeOffset(this.offset);return n instanceof Ye?this.getCompletionsForSupportsCondition(n,t):t}return this.getCompletionForTopLevel(t)}getCompletionsForExtendsReference(e,t,n){return n}getCompletionForUriLiteralValue(e,t){let n,r,i;if(e.hasChildren()){const t=e.getChild(0);n=t.getText(),r=this.position,i=this.getCompletionRange(t)}else{n="",r=this.position;const t=this.textDocument.positionAt(e.offset+4);i=Ot.create(t,t)}return this.completionParticipants.forEach((e=>{e.onCssURILiteralValue&&e.onCssURILiteralValue({uriValue:n,position:r,range:i})})),t}getCompletionForImportPath(e,t){return this.completionParticipants.forEach((t=>{t.onCssImportPath&&t.onCssImportPath({pathValue:e.getText(),position:this.position,range:this.getCompletionRange(e)})})),t}hasCharacterAtPosition(e,t){const n=this.textDocument.getText();return e>=0&&e"),this.writeLine(t,r.join(""))}}!function(e){function t(e){const t=e.match(/^['"](.*)["']$/);return t?t[1]:e}e.ensure=function(e,n){return n+t(e)+n},e.remove=t}(Si||(Si={}));class Pi{constructor(){this.id=0,this.attr=0,this.tag=0}}function Mi(e,t){let n=new Ri;for(const r of e.getChildren())switch(r.type){case te.SelectorCombinator:if(t){const e=r.getText().split("&");if(1===e.length){n.addAttr("name",e[0]);break}n=t.cloneWithParent(),e[0]&&n.findRoot().prepend(e[0]);for(let r=1;r1){const e=t.cloneWithParent();n.addChild(e.findRoot()),n=e}n.append(e[r])}}break;case te.SelectorPlaceholder:if(r.matches("@at-root"))return n;case te.ElementNameSelector:const e=r.getText();n.addAttr("name","*"===e?"element":Oi(e));break;case te.ClassSelector:n.addAttr("class",Oi(r.getText().substring(1)));break;case te.IdentifierSelector:n.addAttr("id",Oi(r.getText().substring(1)));break;case te.MixinDeclaration:n.addAttr("class",r.getName());break;case te.PseudoSelector:n.addAttr(Oi(r.getText()),"");break;case te.AttributeSelector:const i=r,o=i.getIdentifier();if(o){const e=i.getValue(),t=i.getOperator();let r;if(e&&t)switch(Oi(t.getText())){case"|=":r=`${Si.remove(Oi(e.getText()))}-…`;break;case"^=":r=`${Si.remove(Oi(e.getText()))}…`;break;case"$=":r=`…${Si.remove(Oi(e.getText()))}`;break;case"~=":r=` … ${Si.remove(Oi(e.getText()))} … `;break;case"*=":r=`…${Si.remove(Oi(e.getText()))}…`;break;default:r=Si.remove(Oi(e.getText()))}n.addAttr(Oi(o.getText()),r)}}return n}function Oi(e){const t=new X;t.setSource(e);const n=t.scanUnquotedString();return n?n.text:e}class zi{constructor(e){this.cssDataManager=e}selectorToMarkedString(e,t){const n=function(e){if(e.matches("@at-root"))return null;const t=new Di,n=[],r=e.getParent();if(r instanceof pe){let e=r.getParent();for(;e&&!Ai(e);){if(e instanceof pe){if(e.getSelectors().matches("@at-root"))break;n.push(e)}e=e.getParent()}}const i=new Ni(t);for(let e=n.length-1;e>=0;e--){const t=n[e].getSelectors().getChild(0);t&&i.processSelector(t)}return i.processSelector(e),t}(e);if(n){const r=new Ii('"').print(n,t);return r.push(this.selectorToSpecificityMarkedString(e)),r}return[]}simpleSelectorToMarkedString(e){const t=Mi(e),n=new Ii('"').print(t);return n.push(this.selectorToSpecificityMarkedString(e)),n}isPseudoElementIdentifier(e){const t=e.match(/^::?([\w-]+)/);return!!t&&!!this.cssDataManager.getPseudoElement("::"+t[1])}selectorToSpecificityMarkedString(e){const t=e=>{const t=new Pi;let r=new Pi;for(const t of e)for(const e of t.getChildren()){const t=n(e);t.id>r.id?r=t:t.idr.attr?r=t:t.attrr.tag&&(r=t))}return t.id+=r.id,t.attr+=r.attr,t.tag+=r.tag,t},n=e=>{const r=new Pi;e:for(const i of e.getChildren()){switch(i.type){case te.IdentifierSelector:r.id++;break;case te.ClassSelector:case te.AttributeSelector:r.attr++;break;case te.ElementNameSelector:if(i.matches("*"))break;r.tag++;break;case te.PseudoSelector:const e=i.getText(),n=i.getChildren();if(this.isPseudoElementIdentifier(e)){if(e.match(/^::slotted/i)&&n.length>0){r.tag++;let e=t(n);r.id+=e.id,r.attr+=e.attr,r.tag+=e.tag;continue e}r.tag++;continue e}if(e.match(/^:where/i))continue e;if(e.match(/^:(?:not|has|is)/i)&&n.length>0){let e=t(n);r.id+=e.id,r.attr+=e.attr,r.tag+=e.tag;continue e}if(e.match(/^:(?:host|host-context)/i)&&n.length>0){r.attr++;let e=t(n);r.id+=e.id,r.attr+=e.attr,r.tag+=e.tag;continue e}if(e.match(/^:(?:nth-child|nth-last-child)/i)&&n.length>0){if(r.attr++,3===n.length&&23===n[1].type){let e=t(n[2].getChildren());r.id+=e.id,r.attr+=e.attr,r.tag+=e.tag;continue e}const e=new ti,i=n[1].getText();e.scanner.setSource(i);const o=e.scanner.scan(),s=e.scanner.scan();if("n"===o.text||"-n"===o.text&&"of"===s.text){const n=[],o=i.slice(s.offset+2).split(",");for(const t of o){const r=e.internalParse(t,e._parseSelector);r&&n.push(r)}let a=t(n);r.id+=a.id,r.attr+=a.attr,r.tag+=a.tag;continue e}continue e}r.attr++;continue e}if(i.getChildren().length>0){const e=n(i);r.id+=e.id,r.attr+=e.attr,r.tag+=e.tag}}return r},r=n(e);return`[${Et.t("Selector Specificity")}](https://developer.mozilla.org/docs/Web/CSS/Specificity): (${r.id}, ${r.attr}, ${r.tag})`}}class Ni{constructor(e){this.prev=null,this.element=e}processSelector(e){let t=null;if(!(this.element instanceof Di)&&e.getChildren().some((e=>e.hasChildren()&&e.getChild(0).type===te.SelectorCombinator))){const e=this.element.findRoot();e.parent instanceof Di&&(t=this.element,this.element=e.parent,this.element.removeChild(e),this.prev=null)}for(const n of e.getChildren()){if(n instanceof me){if(this.prev instanceof me){const e=new Ti("…");this.element.addChild(e),this.element=e}else this.prev&&(this.prev.matches("+")||this.prev.matches("~"))&&this.element.parent&&(this.element=this.element.parent);this.prev&&this.prev.matches("~")&&this.element.addChild(new Ti("⋮"));const e=Mi(n,t),r=e.findRoot();this.element.addChild(r),this.element=e}(n instanceof me||n.type===te.SelectorCombinatorParent||n.type===te.SelectorCombinatorShadowPiercingDescendant||n.type===te.SelectorCombinatorSibling||n.type===te.SelectorCombinatorAllSiblings)&&(this.prev=n)}}}function Ai(e){switch(e.type){case te.MixinDeclaration:case te.Stylesheet:return!0}return!1}class Wi{constructor(e,t){this.clientCapabilities=e,this.cssDataManager=t,this.selectorPrinting=new zi(t)}configure(e){this.defaultSettings=e}doHover(e,t,n,r=this.defaultSettings){function i(t){return Ot.create(e.positionAt(t.offset),e.positionAt(t.end))}const o=ie(n,e.offsetAt(t));let s,a=null;for(let e=0;e"string"==typeof e?e:e.value)):e.value}doesSupportMarkdown(){if(!ei(this.supportsMarkdown)){if(!ei(this.clientCapabilities))return this.supportsMarkdown=!0,this.supportsMarkdown;const e=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.hover;this.supportsMarkdown=e&&e.contentFormat&&Array.isArray(e.contentFormat)&&-1!==e.contentFormat.indexOf(cn.Markdown)}return this.supportsMarkdown}}const qi=/^\w+:\/\//,Li=/^data:/;class ji{constructor(e,t){this.fileSystemProvider=e,this.resolveModuleReferences=t}configure(e){this.defaultSettings=e}findDefinition(e,t,n){const r=new ci(n),i=re(n,e.offsetAt(t));if(!i)return null;const o=r.findSymbolFromNode(i);return o?{uri:e.uri,range:$i(o.node,e)}:null}findReferences(e,t,n){return this.findDocumentHighlights(e,t,n).map((t=>({uri:e.uri,range:t.range})))}getHighlightNode(e,t,n){let r=re(n,e.offsetAt(t));if(r&&r.type!==te.Stylesheet&&r.type!==te.Declarations&&r.type!==te.ModuleConfig)return r.type===te.Identifier&&r.parent&&r.parent.type===te.ClassSelector&&(r=r.parent),r}findDocumentHighlights(e,t,n){const r=[],i=this.getHighlightNode(e,t,n);if(!i)return r;const o=new ci(n),s=o.findSymbolFromNode(i),a=i.getText();return n.accept((t=>{if(s){if(o.matchesSymbol(t,s))return r.push({kind:Vi(t),range:$i(t,e)}),!1}else i&&i.type===t.type&&t.matches(a)&&r.push({kind:Vi(t),range:$i(t,e)});return!0})),r}isRawStringDocumentLinkNode(e){return e.type===te.Import}findDocumentLinks(e,t,n){const r=this.findUnresolvedLinks(e,t),i=[];for(let t of r){const r=t.link,o=r.target;if(!o||Li.test(o));else if(qi.test(o))i.push(r);else{const t=n.resolveReference(o,e.uri);t&&(r.target=t),i.push(r)}}return i}async findDocumentLinks2(e,t,n){const r=this.findUnresolvedLinks(e,t),i=[];for(let t of r){const r=t.link,o=r.target;if(!o||Li.test(o));else if(qi.test(o))i.push(r);else{const s=await this.resolveReference(o,e.uri,n,t.isRawLink);void 0!==s&&(r.target=s,i.push(r))}}return i}findUnresolvedLinks(e,t){const n=[],r=t=>{let r=t.getText();const i=$i(t,e);if(i.start.line===i.end.line&&i.start.character===i.end.character)return;(Y(r,"'")||Y(r,'"'))&&(r=r.slice(1,-1));const o=!!t.parent&&this.isRawStringDocumentLinkNode(t.parent);n.push({link:{target:r,range:i},isRawLink:o})};return t.accept((e=>{if(e.type===te.URILiteral){const t=e.getChild(0);return t&&r(t),!1}if(e.parent&&this.isRawStringDocumentLinkNode(e.parent)){const t=e.getText();return(Y(t,"'")||Y(t,'"'))&&r(e),!1}return!0})),n}findSymbolInformations(e,t){const n=[];return this.collectDocumentSymbols(e,t,((t,r,i)=>{const o=i instanceof oe?$i(i,e):i,s={name:t||Et.t(""),kind:r,location:zt.create(e.uri,o)};n.push(s)})),n}findDocumentSymbols(e,t){const n=[],r=[];return this.collectDocumentSymbols(e,t,((t,i,o,s,a)=>{const c=o instanceof oe?$i(o,e):o;let l=s instanceof oe?$i(s,e):s;l&&Ui(c,l)||(l=Ot.create(c.start,c.start));const d={name:t||Et.t(""),kind:i,range:c,selectionRange:l};let h=r.pop();for(;h&&!Ui(h[1],c);)h=r.pop();if(h){const e=h[0];e.children||(e.children=[]),e.children.push(d),r.push(h)}else n.push(d);a&&r.push([d,$i(a,e)])})),n}collectDocumentSymbols(e,t,n){t.accept((t=>{if(t instanceof pe){for(const r of t.getSelectors().getChildren())if(r instanceof ue){const i=Ot.create(e.positionAt(r.offset),e.positionAt(t.end));n(r.getText(),kn.Class,i,r,t.getDeclarations())}}else if(t instanceof dt)n(t.getName(),kn.Variable,t,t.getVariable(),void 0);else if(t instanceof bt)n(t.getName(),kn.Method,t,t.getIdentifier(),t.getDeclarations());else if(t instanceof De)n(t.getName(),kn.Function,t,t.getIdentifier(),t.getDeclarations());else if(t instanceof Me){const e=Et.t("@keyframes {0}",t.getName());n(e,kn.Class,t,t.getIdentifier(),t.getDeclarations())}else if(t instanceof Ie){const e=Et.t("@font-face");n(e,kn.Class,t,void 0,t.getDeclarations())}else if(t instanceof je){const e=t.getChild(0);if(e instanceof He){const r="@media "+e.getText();n(r,kn.Module,t,e,t.getDeclarations())}}return!0}))}findDocumentColors(e,t){const n=[];return t.accept((t=>{const r=function(e,t){const n=function(e){if(e.type===te.HexColorValue)return zr(e.getText());if(e.type===te.Function){const t=e,n=t.getName();let r=t.getArguments().getChildren();if(1===r.length){const e=r[0].getChildren();if(1===e.length&&e[0].type===te.Expression&&(r=e[0].getChildren(),3===r.length)){const e=r[2];if(e instanceof tt){const t=e.getLeft(),n=e.getRight(),i=e.getOperator();t&&n&&i&&i.matches("/")&&(r=[r[0],r[1],t,n])}}}if(!n||r.length<3||r.length>4)return null;try{const e=4===r.length?Er(r[3],1):1;if("rgb"===n||"rgba"===n)return{red:Er(r[0],255),green:Er(r[1],255),blue:Er(r[2],255),alpha:e};if("hsl"===n||"hsla"===n){return Nr(Fr(r[0]),Er(r[1],100),Er(r[2],100),e)}if("hwb"===n){return function(e,t,n,r=1){if(t+n>=1){const e=t/(t+n);return{red:e,green:e,blue:e,alpha:r}}const i=Nr(e,1,.5,r);let o=i.red;o*=1-t-n,o+=t;let s=i.green;s*=1-t-n,s+=t;let a=i.blue;return a*=1-t-n,a+=t,{red:o,green:s,blue:a,alpha:r}}(Fr(r[0]),Er(r[1],100),Er(r[2],100),e)}}catch(e){return null}}else if(e.type===te.Identifier){if(e.parent&&e.parent.type!==te.Term)return null;const t=e.parent;if(t&&t.parent&&t.parent.type===te.BinaryExpression){const e=t.parent;if(e.parent&&e.parent.type===te.ListEntry&&e.parent.key===e)return null}const n=e.getText().toLowerCase();if("none"===n)return null;const r=xr[n];if(r)return zr(r)}return null}(e);return n?{color:n,range:$i(e,t)}:null}(t,e);return r&&n.push(r),!0})),n}getColorPresentations(e,t,n,r){const i=[],o=Math.round(255*n.red),s=Math.round(255*n.green),a=Math.round(255*n.blue);let c;c=1===n.alpha?`rgb(${o}, ${s}, ${a})`:`rgba(${o}, ${s}, ${a}, ${n.alpha})`,i.push({label:c,textEdit:Gt.replace(r,c)}),c=1===n.alpha?`#${Bi(o)}${Bi(s)}${Bi(a)}`:`#${Bi(o)}${Bi(s)}${Bi(a)}${Bi(Math.round(255*n.alpha))}`,i.push({label:c,textEdit:Gt.replace(r,c)});const l=Ar(n);c=1===l.a?`hsl(${l.h}, ${Math.round(100*l.s)}%, ${Math.round(100*l.l)}%)`:`hsla(${l.h}, ${Math.round(100*l.s)}%, ${Math.round(100*l.l)}%, ${l.a})`,i.push({label:c,textEdit:Gt.replace(r,c)});const d=function(e){const t=Ar(e),n=Math.min(e.red,e.green,e.blue),r=1-Math.max(e.red,e.green,e.blue);return{h:t.h,w:n,b:r,a:t.a}}(n);return c=1===d.a?`hwb(${d.h} ${Math.round(100*d.w)}% ${Math.round(100*d.b)}%)`:`hwb(${d.h} ${Math.round(100*d.w)}% ${Math.round(100*d.b)}% / ${d.a})`,i.push({label:c,textEdit:Gt.replace(r,c)}),i}prepareRename(e,t,n){const r=this.getHighlightNode(e,t,n);if(r)return Ot.create(e.positionAt(r.offset),e.positionAt(r.end))}doRename(e,t,n,r){const i=this.findDocumentHighlights(e,t,r).map((e=>Gt.replace(e.range,n)));return{changes:{[e.uri]:i}}}async resolveModuleReference(e,t,n){if(Y(t,"file://")){const r=Ki(e);if(r&&"."!==r&&".."!==r){const i=n.resolveReference("/",t),o=di(t),s=await this.resolvePathToModule(r,o,i);if(s)return hi(s,e.substring(r.length+1))}}}async mapReference(e,t){return e}async resolveReference(e,t,n,r=!1,i=this.defaultSettings){if("~"===e[0]&&"/"!==e[1]&&this.fileSystemProvider)return e=e.substring(1),this.mapReference(await this.resolveModuleReference(e,t,n),r);const o=await this.mapReference(n.resolveReference(e,t),r);if(this.resolveModuleReferences){if(o&&await this.fileExists(o))return o;const i=await this.mapReference(await this.resolveModuleReference(e,t,n),r);if(i)return i}if(o&&!await this.fileExists(o)){const o=n.resolveReference("/",t);if(i&&o){if(e in i)return this.mapReference(hi(o,i[e]),r);const t=e.indexOf("/"),n=`${e.substring(0,t)}/`;if(n in i){let t=hi(o,i[n].slice(0,-1));return this.mapReference(t=hi(t,e.substring(n.length-1)),r)}}}return o}async resolvePathToModule(e,t,n){const r=hi(t,"node_modules",e,"package.json");return await this.fileExists(r)?di(r):n&&t.startsWith(n)&&t.length!==n.length?this.resolvePathToModule(e,di(t),n):void 0}async fileExists(e){if(!this.fileSystemProvider)return!1;try{const t=await this.fileSystemProvider.stat(e);return t.type!==ir.Unknown||-1!==t.size}catch(e){return!1}}async getContent(e){if(!this.fileSystemProvider||!this.fileSystemProvider.getContent)return null;try{return await this.fileSystemProvider.getContent(e)}catch(e){return null}}}function $i(e,t){return Ot.create(t.positionAt(e.offset),t.positionAt(e.end))}function Ui(e,t){const n=t.start.line,r=t.end.line,i=e.start.line,o=e.end.line;return!(no||r>o||n===i&&t.start.charactere.end.character)}function Vi(e){if(e.type===te.Selector)return xn.Write;if(e instanceof ce&&e.parent&&e.parent instanceof ve&&e.isCustomProperty)return xn.Write;if(e.parent)switch(e.parent.type){case te.FunctionDeclaration:case te.MixinDeclaration:case te.Keyframe:case te.VariableDeclaration:case te.FunctionParameter:return xn.Write}return xn.Read}function Bi(e){const t=e.toString(16);return 2!==t.length?"0"+t:t}function Ki(e){const t=e.indexOf("/");if(-1===t)return"";if("@"===e[0]){const n=e.indexOf("/",t+1);return-1===n?e:e.substring(0,n)}return e.substring(0,t)}const Hi=Ct.Warning,Gi=Ct.Error,Ji=Ct.Ignore;class Xi{constructor(e,t,n){this.id=e,this.message=t,this.defaultValue=n}}const Yi={AllVendorPrefixes:new Xi("compatibleVendorPrefixes",Et.t("When using a vendor-specific prefix make sure to also include all other vendor-specific properties"),Ji),IncludeStandardPropertyWhenUsingVendorPrefix:new Xi("vendorPrefix",Et.t("When using a vendor-specific prefix also include the standard property"),Hi),DuplicateDeclarations:new Xi("duplicateProperties",Et.t("Do not use duplicate style definitions"),Ji),EmptyRuleSet:new Xi("emptyRules",Et.t("Do not use empty rulesets"),Hi),ImportStatemement:new Xi("importStatement",Et.t("Import statements do not load in parallel"),Ji),BewareOfBoxModelSize:new Xi("boxModel",Et.t("Do not use width or height when using padding or border"),Ji),UniversalSelector:new Xi("universalSelector",Et.t("The universal selector (*) is known to be slow"),Ji),ZeroWithUnit:new Xi("zeroUnits",Et.t("No unit for zero needed"),Ji),RequiredPropertiesForFontFace:new Xi("fontFaceProperties",Et.t("@font-face rule must define 'src' and 'font-family' properties"),Hi),HexColorLength:new Xi("hexColorLength",Et.t("Hex colors must consist of three, four, six or eight hex numbers"),Gi),ArgsInColorFunction:new Xi("argumentsInColorFunction",Et.t("Invalid number of parameters"),Gi),UnknownProperty:new Xi("unknownProperties",Et.t("Unknown property."),Hi),UnknownAtRules:new Xi("unknownAtRules",Et.t("Unknown at-rule."),Hi),IEStarHack:new Xi("ieHack",Et.t("IE hacks are only necessary when supporting IE7 and older"),Ji),UnknownVendorSpecificProperty:new Xi("unknownVendorSpecificProperties",Et.t("Unknown vendor specific property."),Ji),PropertyIgnoredDueToDisplay:new Xi("propertyIgnoredDueToDisplay",Et.t("Property is ignored due to the display."),Hi),AvoidImportant:new Xi("important",Et.t("Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored."),Ji),AvoidFloat:new Xi("float",Et.t("Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes."),Ji),AvoidIdSelector:new Xi("idSelector",Et.t("Selectors should not contain IDs because these rules are too tightly coupled with the HTML."),Ji)},Qi={ValidProperties:new class{constructor(e,t,n){this.id=e,this.message=t,this.defaultValue=n}}("validProperties",Et.t("A list of properties that are not validated against the `unknownProperties` rule."),[])};class Zi{constructor(e={}){this.conf=e}getRule(e){if(this.conf.hasOwnProperty(e.id)){const t=function(e){switch(e){case"ignore":return Ct.Ignore;case"warning":return Ct.Warning;case"error":return Ct.Error}return null}(this.conf[e.id]);if(t)return t}return e.defaultValue}getSetting(e){return this.conf[e.id]}}class eo{constructor(e){this.cssDataManager=e}doCodeActions(e,t,n,r){return this.doCodeActions2(e,t,n,r).map((t=>{const n=t.edit&&t.edit.documentChanges&&t.edit.documentChanges[0];return Ht.create(t.title,"_css.applyCodeAction",e.uri,e.version,n&&n.edits)}))}doCodeActions2(e,t,n,r){const i=[];if(n.diagnostics)for(const t of n.diagnostics)this.appendFixesForMarker(e,r,t,i);return i}getFixesForUnknownProperty(e,t,n,r){const i=t.getName(),o=[];this.cssDataManager.getProperties().forEach((e=>{const t=function(e,t,n=4){let r=Math.abs(e.length-t.length);if(r>n)return 0;let i,o,s=[],a=[];for(i=0;i=i.length/2&&o.push({property:e.name,score:t})})),o.sort(((e,t)=>t.score-e.score||e.property.localeCompare(t.property)));let s=3;for(const t of o){const i=t.property,o=Et.t("Rename to '{0}'",i),a=Gt.replace(n.range,i),c=on.create(e.uri,e.version),l={documentChanges:[Qt.create(c,[a])]},d=Pn.create(o,l,Dn.QuickFix);if(d.diagnostics=[n],r.push(d),--s<=0)return}}appendFixesForMarker(e,t,n,r){if(n.code!==Yi.UnknownProperty.id)return;const i=e.offsetAt(n.range.start),o=e.offsetAt(n.range.end),s=ie(t,i);for(let t=s.length-1;t>=0;t--){const a=s[t];if(a instanceof be){const t=a.getProperty();if(t&&t.offset===i&&t.end===o)return void this.getFixesForUnknownProperty(e,t,n,r)}}}}class to{constructor(e){this.fullPropertyName=e.getFullPropertyName().toLowerCase(),this.node=e}}function no(e,t,n,r){const i=e[t];i.value=n,n&&(ni(i.properties,r)||i.properties.push(r))}function ro(e,t,n,r){"top"===t||"right"===t||"bottom"===t||"left"===t?no(e,t,n,r):function(e,t,n){no(e,"top",t,n),no(e,"right",t,n),no(e,"bottom",t,n),no(e,"left",t,n)}(e,n,r)}function io(e,t,n){switch(t.length){case 1:ro(e,void 0,t[0],n);break;case 2:ro(e,"top",t[0],n),ro(e,"bottom",t[0],n),ro(e,"right",t[1],n),ro(e,"left",t[1],n);break;case 3:ro(e,"top",t[0],n),ro(e,"right",t[1],n),ro(e,"left",t[1],n),ro(e,"bottom",t[2],n);break;case 4:ro(e,"top",t[0],n),ro(e,"right",t[1],n),ro(e,"bottom",t[2],n),ro(e,"left",t[3],n)}}function oo(e,t){for(let n of t)if(e.matches(n))return!0;return!1}function so(e,t=!0){return!(t&&oo(e,["initial","unset"])||0===parseFloat(e.getText()))}function ao(e,t=!0){return e.map((e=>so(e,t)))}function co(e,t=!0){return!(oo(e,["none","hidden"])||t&&oo(e,["initial","unset"]))}function lo(e,t=!0){return e.map((e=>co(e,t)))}function ho(e){const t=e.getChildren();if(1===t.length){const e=t[0];return so(e)&&co(e)}for(const e of t){const t=e;if(!so(t,!1)||!co(t,!1))return!1}return!0}class po{constructor(){this.data={}}add(e,t,n){let r=this.data[e];r||(r={nodes:[],names:[]},this.data[e]=r),r.names.push(t),n&&r.nodes.push(n)}}class uo{static entries(e,t,n,r,i){const o=new uo(t,n,r);return e.acceptVisitor(o),o.completeValidations(),o.getEntries(i)}constructor(e,t,n){this.cssDataManager=n,this.warnings=[],this.settings=t,this.documentText=e.getText(),this.keyframes=new po,this.validProperties={};const r=t.getSetting(Qi.ValidProperties);Array.isArray(r)&&r.forEach((e=>{if("string"==typeof e){const t=e.trim().toLowerCase();t.length&&(this.validProperties[t]=!0)}}))}isValidPropertyDeclaration(e){const t=e.fullPropertyName;return this.validProperties[t]}fetch(e,t){const n=[];for(const r of e)r.fullPropertyName===t&&n.push(r);return n}fetchWithValue(e,t,n){const r=[];for(const i of e)if(i.fullPropertyName===t){const e=i.node.getValue();e&&this.findValueInExpression(e,n)&&r.push(i)}return r}findValueInExpression(e,t){let n=!1;return e.accept((e=>(e.type===te.Identifier&&e.matches(t)&&(n=!0),!n))),n}getEntries(e=Ct.Warning|Ct.Error){return this.warnings.filter((t=>!!(t.getLevel()&e)))}addEntry(e,t,n){const r=new kt(e,t,this.settings.getRule(t),n);this.warnings.push(r)}getMissingNames(e,t){const n=e.slice(0);for(let e=0;e0){const e=this.fetch(n,"float");for(let t=0;t0){const e=this.fetch(n,"vertical-align");for(let t=0;t1)for(let n=0;ne.startsWith(i)))&&s.delete(e)}}const a=[];for(let e=0,t=uo.prefixes.length;e!(e instanceof tt&&(r+=1,1)))),r!==n&&this.addEntry(e,Yi.ArgsInColorFunction)),!0}}uo.prefixes=["-ms-","-moz-","-o-","-webkit-"];class mo{constructor(e){this.cssDataManager=e}configure(e){this.settings=e}doValidation(e,t,n=this.settings){if(n&&!1===n.validate)return[];const r=[];r.push.apply(r,_t.entries(t)),r.push.apply(r,uo.entries(t,e,new Zi(n&&n.lint),this.cssDataManager));const i=[];for(const e in Yi)i.push(Yi[e].id);return r.filter((e=>e.getLevel()!==Ct.Ignore)).map((function(t){const n=Ot.create(e.positionAt(t.getOffset()),e.positionAt(t.getOffset()+t.getLength())),r=e.languageId;return{code:t.getRule().id,source:r,message:t.getMessage(),severity:t.getLevel()===Ct.Warning?Ut.Warning:Ut.Error,range:n}}))}}const fo="/".charCodeAt(0),go="\n".charCodeAt(0),bo="\r".charCodeAt(0),yo="\f".charCodeAt(0),vo="$".charCodeAt(0),wo="#".charCodeAt(0),So="{".charCodeAt(0),xo="=".charCodeAt(0),Co="!".charCodeAt(0),ko="<".charCodeAt(0),_o=">".charCodeAt(0),Eo=".".charCodeAt(0);"@".charCodeAt(0);let Fo=r.CustomToken;const Ro=Fo++,Do=Fo++,To=(Fo++,Fo++),Io=Fo++,Po=Fo++,Mo=Fo++,Oo=Fo++;Fo++;class zo extends X{scanNext(e){if(this.stream.advanceIfChar(vo)){const t=["$"];if(this.ident(t))return this.finishToken(e,Ro,t.join(""));this.stream.goBackTo(e)}return this.stream.advanceIfChars([wo,So])?this.finishToken(e,Do):this.stream.advanceIfChars([xo,xo])?this.finishToken(e,To):this.stream.advanceIfChars([Co,xo])?this.finishToken(e,Io):this.stream.advanceIfChar(ko)?this.stream.advanceIfChar(xo)?this.finishToken(e,Mo):this.finishToken(e,r.Delim):this.stream.advanceIfChar(_o)?this.stream.advanceIfChar(xo)?this.finishToken(e,Po):this.finishToken(e,r.Delim):this.stream.advanceIfChars([Eo,Eo,Eo])?this.finishToken(e,Oo):super.scanNext(e)}comment(){return!!super.comment()||!(this.inURL||!this.stream.advanceIfChars([fo,fo]))&&(this.stream.advanceWhileChar((e=>{switch(e){case go:case bo:case yo:return!1;default:return!0}})),!0)}}class No{constructor(e,t){this.id=e,this.message=t}}const Ao={FromExpected:new No("scss-fromexpected",Et.t("'from' expected")),ThroughOrToExpected:new No("scss-throughexpected",Et.t("'through' or 'to' expected")),InExpected:new No("scss-fromexpected",Et.t("'in' expected"))};class Wo extends ti{constructor(){super(new zo)}_parseStylesheetStatement(e=!1){return this.peek(r.AtKeyword)?this._parseWarnAndDebug()||this._parseControlStatement()||this._parseMixinDeclaration()||this._parseMixinContent()||this._parseMixinReference()||this._parseFunctionDeclaration()||this._parseForward()||this._parseUse()||this._parseRuleset(e)||super._parseStylesheetAtStatement(e):this._parseRuleset(!0)||this._parseVariableDeclaration()}_parseImport(){if(!this.peekKeyword("@import"))return null;const e=this.create(ze);if(this.consumeToken(),!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))return this.finish(e,Rt.URIOrStringExpected);for(;this.accept(r.Comma);)if(!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))return this.finish(e,Rt.URIOrStringExpected);return this._completeParseImport(e)}_parseVariableDeclaration(e=[]){if(!this.peek(Ro))return null;const t=this.create(dt);if(!t.setVariable(this._parseVariable()))return null;if(!this.accept(r.Colon))return this.finish(t,Rt.ColonExpected);if(this.prevToken&&(t.colonPosition=this.prevToken.offset),!t.setValue(this._parseExpr()))return this.finish(t,Rt.VariableValueExpected,[],e);for(;this.peek(r.Exclamation);)if(t.addChild(this._tryParsePrio()));else{if(this.consumeToken(),!this.peekRegExp(r.Ident,/^(default|global)$/))return this.finish(t,Rt.UnknownKeyword);this.consumeToken()}return this.peek(r.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)}_parseMediaCondition(){return this._parseInterpolation()||super._parseMediaCondition()}_parseMediaFeatureRangeOperator(){return this.accept(Mo)||this.accept(Po)||super._parseMediaFeatureRangeOperator()}_parseMediaFeatureName(){return this._parseModuleMember()||this._parseFunction()||this._parseIdent()||this._parseVariable()}_parseKeyframeSelector(){return this._tryParseKeyframeSelector()||this._parseControlStatement(this._parseKeyframeSelector.bind(this))||this._parseWarnAndDebug()||this._parseMixinReference()||this._parseFunctionDeclaration()||this._parseVariableDeclaration()||this._parseMixinContent()}_parseVariable(){if(!this.peek(Ro))return null;const e=this.create(pt);return this.consumeToken(),e}_parseModuleMember(){const e=this.mark(),t=this.create(xt);return t.setIdentifier(this._parseIdent([ne.Module]))?this.hasWhitespace()||!this.acceptDelim(".")||this.hasWhitespace()?(this.restoreAtMark(e),null):t.addChild(this._parseVariable()||this._parseFunction())?t:this.finish(t,Rt.IdentifierOrVariableExpected):null}_parseIdent(e){if(!this.peek(r.Ident)&&!this.peek(Do)&&!this.peekDelim("-"))return null;const t=this.create(ce);t.referenceTypes=e,t.isCustomProperty=this.peekRegExp(r.Ident,/^--/);let n=!1;const i=()=>{const e=this.mark();return this.acceptDelim("-")&&(this.hasWhitespace()||this.acceptDelim("-"),this.hasWhitespace())?(this.restoreAtMark(e),null):this._parseInterpolation()};for(;(this.accept(r.Ident)||t.addChild(i())||n&&this.acceptRegexp(/^[\w-]/))&&(n=!0,!this.hasWhitespace()););return n?this.finish(t):null}_parseTermExpression(){return this._parseModuleMember()||this._parseVariable()||this._parseNestingSelector()||super._parseTermExpression()}_parseInterpolation(){if(this.peek(Do)){const e=this.create(ht);return this.consumeToken(),e.addChild(this._parseExpr())||this._parseNestingSelector()?this.accept(r.CurlyR)?this.finish(e):this.finish(e,Rt.RightCurlyExpected):this.accept(r.CurlyR)?this.finish(e):this.finish(e,Rt.ExpressionExpected)}return null}_parseOperator(){if(this.peek(To)||this.peek(Io)||this.peek(Po)||this.peek(Mo)||this.peekDelim(">")||this.peekDelim("<")||this.peekIdent("and")||this.peekIdent("or")||this.peekDelim("%")){const e=this.createNode(te.Operator);return this.consumeToken(),this.finish(e)}return super._parseOperator()}_parseUnaryOperator(){if(this.peekIdent("not")){const e=this.create(oe);return this.consumeToken(),this.finish(e)}return super._parseUnaryOperator()}_parseRuleSetDeclaration(){return this.peek(r.AtKeyword)?this._parseKeyframe()||this._parseImport()||this._parseMedia(!0)||this._parseFontFace()||this._parseWarnAndDebug()||this._parseControlStatement()||this._parseFunctionDeclaration()||this._parseExtends()||this._parseMixinReference()||this._parseMixinContent()||this._parseMixinDeclaration()||this._parseRuleset(!0)||this._parseSupports(!0)||this._parseLayer()||this._parsePropertyAtRule()||this._parseContainer(!0)||this._parseRuleSetDeclarationAtStatement():this._parseVariableDeclaration()||this._tryParseRuleset(!0)||this._parseDeclaration()}_parseDeclaration(e){const t=this._tryParseCustomPropertyDeclaration(e);if(t)return t;const n=this.create(be);if(!n.setProperty(this._parseProperty()))return null;if(!this.accept(r.Colon))return this.finish(n,Rt.ColonExpected,[r.Colon],e||[r.SemiColon]);this.prevToken&&(n.colonPosition=this.prevToken.offset);let i=!1;if(n.setValue(this._parseExpr())&&(i=!0,n.addChild(this._parsePrio())),this.peek(r.CurlyL))n.setNestedProperties(this._parseNestedProperties());else if(!i)return this.finish(n,Rt.PropertyValueExpected);return this.peek(r.SemiColon)&&(n.semicolonPosition=this.token.offset),this.finish(n)}_parseNestedProperties(){const e=this.create(Pe);return this._parseBody(e,this._parseDeclaration.bind(this))}_parseExtends(){if(this.peekKeyword("@extend")){const e=this.create(ut);if(this.consumeToken(),!e.getSelectors().addChild(this._parseSimpleSelector()))return this.finish(e,Rt.SelectorExpected);for(;this.accept(r.Comma);)e.getSelectors().addChild(this._parseSimpleSelector());return this.accept(r.Exclamation)&&!this.acceptIdent("optional")?this.finish(e,Rt.UnknownKeyword):this.finish(e)}return null}_parseSimpleSelectorBody(){return this._parseSelectorPlaceholder()||super._parseSimpleSelectorBody()}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(te.SelectorCombinator);for(this.consumeToken();!this.hasWhitespace()&&(this.acceptDelim("-")||this.accept(r.Num)||this.accept(r.Dimension)||e.addChild(this._parseIdent())||this.acceptDelim("&")););return this.finish(e)}return null}_parseSelectorPlaceholder(){if(this.peekDelim("%")){const e=this.createNode(te.SelectorPlaceholder);return this.consumeToken(),this._parseIdent(),this.finish(e)}if(this.peekKeyword("@at-root")){const e=this.createNode(te.SelectorPlaceholder);if(this.consumeToken(),this.accept(r.ParenthesisL)){if(!this.acceptIdent("with")&&!this.acceptIdent("without"))return this.finish(e,Rt.IdentifierExpected);if(!this.accept(r.Colon))return this.finish(e,Rt.ColonExpected);if(!e.addChild(this._parseIdent()))return this.finish(e,Rt.IdentifierExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[r.CurlyR])}return this.finish(e)}return null}_parseElementName(){const e=this.mark(),t=super._parseElementName();return t&&!this.hasWhitespace()&&this.peek(r.ParenthesisL)?(this.restoreAtMark(e),null):t}_tryParsePseudoIdentifier(){return this._parseInterpolation()||super._tryParsePseudoIdentifier()}_parseWarnAndDebug(){if(!this.peekKeyword("@debug")&&!this.peekKeyword("@warn")&&!this.peekKeyword("@error"))return null;const e=this.createNode(te.Debug);return this.consumeToken(),e.addChild(this._parseExpr()),this.finish(e)}_parseControlStatement(e=this._parseRuleSetDeclaration.bind(this)){return this.peek(r.AtKeyword)?this._parseIfStatement(e)||this._parseForStatement(e)||this._parseEachStatement(e)||this._parseWhileStatement(e):null}_parseIfStatement(e){return this.peekKeyword("@if")?this._internalParseIfStatement(e):null}_internalParseIfStatement(e){const t=this.create(ke);if(this.consumeToken(),!t.setExpression(this._parseExpr(!0)))return this.finish(t,Rt.ExpressionExpected);if(this._parseBody(t,e),this.acceptKeyword("@else"))if(this.peekIdent("if"))t.setElseClause(this._internalParseIfStatement(e));else if(this.peek(r.CurlyL)){const n=this.create(Re);this._parseBody(n,e),t.setElseClause(n)}return this.finish(t)}_parseForStatement(e){if(!this.peekKeyword("@for"))return null;const t=this.create(_e);return this.consumeToken(),t.setVariable(this._parseVariable())?this.acceptIdent("from")?t.addChild(this._parseBinaryExpr())?this.acceptIdent("to")||this.acceptIdent("through")?t.addChild(this._parseBinaryExpr())?this._parseBody(t,e):this.finish(t,Rt.ExpressionExpected,[r.CurlyR]):this.finish(t,Ao.ThroughOrToExpected,[r.CurlyR]):this.finish(t,Rt.ExpressionExpected,[r.CurlyR]):this.finish(t,Ao.FromExpected,[r.CurlyR]):this.finish(t,Rt.VariableNameExpected,[r.CurlyR])}_parseEachStatement(e){if(!this.peekKeyword("@each"))return null;const t=this.create(Ee);this.consumeToken();const n=t.getVariables();if(!n.addChild(this._parseVariable()))return this.finish(t,Rt.VariableNameExpected,[r.CurlyR]);for(;this.accept(r.Comma);)if(!n.addChild(this._parseVariable()))return this.finish(t,Rt.VariableNameExpected,[r.CurlyR]);return this.finish(n),this.acceptIdent("in")?t.addChild(this._parseExpr())?this._parseBody(t,e):this.finish(t,Rt.ExpressionExpected,[r.CurlyR]):this.finish(t,Ao.InExpected,[r.CurlyR])}_parseWhileStatement(e){if(!this.peekKeyword("@while"))return null;const t=this.create(Fe);return this.consumeToken(),t.addChild(this._parseBinaryExpr())?this._parseBody(t,e):this.finish(t,Rt.ExpressionExpected,[r.CurlyR])}_parseFunctionBodyDeclaration(){return this._parseVariableDeclaration()||this._parseReturnStatement()||this._parseWarnAndDebug()||this._parseControlStatement(this._parseFunctionBodyDeclaration.bind(this))}_parseFunctionDeclaration(){if(!this.peekKeyword("@function"))return null;const e=this.create(De);if(this.consumeToken(),!e.setIdentifier(this._parseIdent([ne.Function])))return this.finish(e,Rt.IdentifierExpected,[r.CurlyR]);if(!this.accept(r.ParenthesisL))return this.finish(e,Rt.LeftParenthesisExpected,[r.CurlyR]);if(e.getParameters().addChild(this._parseParameterDeclaration()))for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,Rt.VariableNameExpected);return this.accept(r.ParenthesisR)?this._parseBody(e,this._parseFunctionBodyDeclaration.bind(this)):this.finish(e,Rt.RightParenthesisExpected,[r.CurlyR])}_parseReturnStatement(){if(!this.peekKeyword("@return"))return null;const e=this.createNode(te.ReturnStatement);return this.consumeToken(),e.addChild(this._parseExpr())?this.finish(e):this.finish(e,Rt.ExpressionExpected)}_parseMixinDeclaration(){if(!this.peekKeyword("@mixin"))return null;const e=this.create(bt);if(this.consumeToken(),!e.setIdentifier(this._parseIdent([ne.Mixin])))return this.finish(e,Rt.IdentifierExpected,[r.CurlyR]);if(this.accept(r.ParenthesisL)){if(e.getParameters().addChild(this._parseParameterDeclaration()))for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,Rt.VariableNameExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[r.CurlyR])}return this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseParameterDeclaration(){const e=this.create(xe);return e.setIdentifier(this._parseVariable())?(this.accept(Oo),this.accept(r.Colon)&&!e.setDefaultValue(this._parseExpr(!0))?this.finish(e,Rt.VariableValueExpected,[],[r.Comma,r.ParenthesisR]):this.finish(e)):null}_parseMixinContent(){if(!this.peekKeyword("@content"))return null;const e=this.create(mt);if(this.consumeToken(),this.accept(r.ParenthesisL)){if(e.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.getArguments().addChild(this._parseFunctionArgument()))return this.finish(e,Rt.ExpressionExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected)}return this.finish(e)}_parseMixinReference(){if(!this.peekKeyword("@include"))return null;const e=this.create(gt);this.consumeToken();const t=this._parseIdent([ne.Mixin]);if(!e.setIdentifier(t))return this.finish(e,Rt.IdentifierExpected,[r.CurlyR]);if(!this.hasWhitespace()&&this.acceptDelim(".")&&!this.hasWhitespace()){const n=this._parseIdent([ne.Mixin]);if(!n)return this.finish(e,Rt.IdentifierExpected,[r.CurlyR]);const i=this.create(xt);t.referenceTypes=[ne.Module],i.setIdentifier(t),e.setIdentifier(n),e.addChild(i)}if(this.accept(r.ParenthesisL)){if(e.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.getArguments().addChild(this._parseFunctionArgument()))return this.finish(e,Rt.ExpressionExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected)}return(this.peekIdent("using")||this.peek(r.CurlyL))&&e.setContent(this._parseMixinContentDeclaration()),this.finish(e)}_parseMixinContentDeclaration(){const e=this.create(ft);if(this.acceptIdent("using")){if(!this.accept(r.ParenthesisL))return this.finish(e,Rt.LeftParenthesisExpected,[r.CurlyL]);if(e.getParameters().addChild(this._parseParameterDeclaration()))for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,Rt.VariableNameExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[r.CurlyL])}return this.peek(r.CurlyL)&&this._parseBody(e,this._parseMixinReferenceBodyStatement.bind(this)),this.finish(e)}_parseMixinReferenceBodyStatement(){return this._tryParseKeyframeSelector()||this._parseRuleSetDeclaration()}_parseFunctionArgument(){const e=this.create(Ce),t=this.mark(),n=this._parseVariable();if(n)if(this.accept(r.Colon))e.setIdentifier(n);else{if(this.accept(Oo))return e.setValue(n),this.finish(e);this.restoreAtMark(t)}return e.setValue(this._parseExpr(!0))?(this.accept(Oo),e.addChild(this._parsePrio()),this.finish(e)):e.setValue(this._tryParsePrio())?this.finish(e):null}_parseURLArgument(){const e=this.mark(),t=super._parseURLArgument();if(!t||!this.peek(r.ParenthesisR)){this.restoreAtMark(e);const t=this.create(oe);return t.addChild(this._parseBinaryExpr()),this.finish(t)}return t}_parseOperation(){if(!this.peek(r.ParenthesisL))return null;const e=this.create(oe);for(this.consumeToken();e.addChild(this._parseListElement());)this.accept(r.Comma);return this.accept(r.ParenthesisR)?this.finish(e):this.finish(e,Rt.RightParenthesisExpected)}_parseListElement(){const e=this.create(vt),t=this._parseBinaryExpr();if(!t)return null;if(this.accept(r.Colon)){if(e.setKey(t),!e.setValue(this._parseBinaryExpr()))return this.finish(e,Rt.ExpressionExpected)}else e.setValue(t);return this.finish(e)}_parseUse(){if(!this.peekKeyword("@use"))return null;const e=this.create(Ne);if(this.consumeToken(),!e.addChild(this._parseStringLiteral()))return this.finish(e,Rt.StringLiteralExpected);if(!this.peek(r.SemiColon)&&!this.peek(r.EOF)){if(!this.peekRegExp(r.Ident,/as|with/))return this.finish(e,Rt.UnknownKeyword);if(this.acceptIdent("as")&&!e.setIdentifier(this._parseIdent([ne.Module]))&&!this.acceptDelim("*"))return this.finish(e,Rt.IdentifierOrWildcardExpected);if(this.acceptIdent("with")&&!e.setParameters(this._parseModuleConfig()))return this.finish(e,Rt.LeftParenthesisExpected,[r.ParenthesisR])}return this.accept(r.SemiColon)||this.accept(r.EOF)?this.finish(e):this.finish(e,Rt.SemiColonExpected)}_parseModuleConfig(){const e=this.createNode(te.ModuleConfig);if(!this.accept(r.ParenthesisL))return null;if(!e.addChild(this._parseModuleConfigDeclaration()))return this.finish(e,Rt.VariableNameExpected);for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.addChild(this._parseModuleConfigDeclaration()))return this.finish(e,Rt.VariableNameExpected);return this.accept(r.ParenthesisR)?this.finish(e):this.finish(e,Rt.RightParenthesisExpected)}_parseModuleConfigDeclaration(){const e=this.create(Ae);return e.setIdentifier(this._parseVariable())?this.accept(r.Colon)&&e.setValue(this._parseExpr(!0))?!this.accept(r.Exclamation)||!this.hasWhitespace()&&this.acceptIdent("default")?this.finish(e):this.finish(e,Rt.UnknownKeyword):this.finish(e,Rt.VariableValueExpected,[],[r.Comma,r.ParenthesisR]):null}_parseForward(){if(!this.peekKeyword("@forward"))return null;const e=this.create(We);if(this.consumeToken(),!e.addChild(this._parseStringLiteral()))return this.finish(e,Rt.StringLiteralExpected);if(this.acceptIdent("as")){const t=this._parseIdent([ne.Forward]);if(!e.setIdentifier(t))return this.finish(e,Rt.IdentifierExpected);if(this.hasWhitespace()||!this.acceptDelim("*"))return this.finish(e,Rt.WildcardExpected)}if(this.acceptIdent("with")){if(!e.setParameters(this._parseModuleConfig()))return this.finish(e,Rt.LeftParenthesisExpected,[r.ParenthesisR])}else if((this.peekIdent("hide")||this.peekIdent("show"))&&!e.addChild(this._parseForwardVisibility()))return this.finish(e,Rt.IdentifierOrVariableExpected);return this.accept(r.SemiColon)||this.accept(r.EOF)?this.finish(e):this.finish(e,Rt.SemiColonExpected)}_parseForwardVisibility(){const e=this.create(qe);for(e.setIdentifier(this._parseIdent());e.addChild(this._parseVariable()||this._parseIdent());)this.accept(r.Comma);return e.getChildren().length>1?e:null}_parseSupportsCondition(){return this._parseInterpolation()||super._parseSupportsCondition()}}const qo=Et.t("Sass documentation");class Lo extends xi{constructor(e,t){super("$",e,t),jo(Lo.scssModuleLoaders),jo(Lo.scssModuleBuiltIns)}isImportPathParent(e){return e===te.Forward||e===te.Use||super.isImportPathParent(e)}getCompletionForImportPath(e,t){const n=e.getParent().type;if(n===te.Forward||n===te.Use)for(let n of Lo.scssModuleBuiltIns){const r={label:n.label,documentation:n.documentation,textEdit:Gt.replace(this.getCompletionRange(e),`'${n.label}'`),kind:dn.Module};t.items.push(r)}return super.getCompletionForImportPath(e,t)}createReplaceFunction(){let e=1;return(t,n)=>"\\"+n+": ${"+e+++":"+(Lo.variableDefaults[n]||"")+"}"}createFunctionProposals(e,t,n,r){for(const i of e){const e=i.func.replace(/\[?(\$\w+)\]?/g,this.createReplaceFunction()),o={label:i.func.substr(0,i.func.indexOf("(")),detail:i.func,documentation:i.desc,textEdit:Gt.replace(this.getCompletionRange(t),e),insertTextFormat:hn.Snippet,kind:dn.Function};n&&(o.sortText="z"),r.items.push(o)}return r}getCompletionsForSelector(e,t,n){return this.createFunctionProposals(Lo.selectorFuncs,null,!0,n),super.getCompletionsForSelector(e,t,n)}getTermProposals(e,t,n){let r=Lo.builtInFuncs;return e&&(r=r.filter((t=>!t.type||!e.restrictions||-1!==e.restrictions.indexOf(t.type)))),this.createFunctionProposals(r,t,!0,n),super.getTermProposals(e,t,n)}getColorProposals(e,t,n){return this.createFunctionProposals(Lo.colorProposals,t,!1,n),super.getColorProposals(e,t,n)}getCompletionsForDeclarationProperty(e,t){return this.getCompletionForAtDirectives(t),this.getCompletionsForSelector(null,!0,t),super.getCompletionsForDeclarationProperty(e,t)}getCompletionsForExtendsReference(e,t,n){const r=this.getSymbolContext().findSymbolsAtOffset(this.offset,ne.Rule);for(const e of r){const r={label:e.name,textEdit:Gt.replace(this.getCompletionRange(t),e.name),kind:dn.Function};n.items.push(r)}return n}getCompletionForAtDirectives(e){return e.items.push(...Lo.scssAtDirectives),e}getCompletionForTopLevel(e){return this.getCompletionForAtDirectives(e),this.getCompletionForModuleLoaders(e),super.getCompletionForTopLevel(e),e}getCompletionForModuleLoaders(e){return e.items.push(...Lo.scssModuleLoaders),e}}function jo(e){e.forEach((e=>{if(e.documentation&&e.references&&e.references.length>0){const t="string"==typeof e.documentation?{kind:"markdown",value:e.documentation}:{kind:"markdown",value:e.documentation.value};t.value+="\n\n",t.value+=e.references.map((e=>`[${e.name}](${e.url})`)).join(" | "),e.documentation=t}}))}Lo.variableDefaults={$red:"1",$green:"2",$blue:"3",$alpha:"1.0",$color:"#000000",$weight:"0.5",$hue:"0",$saturation:"0%",$lightness:"0%",$degrees:"0",$amount:"0",$string:'""',$substring:'"s"',$number:"0",$limit:"1"},Lo.colorProposals=[{func:"red($color)",desc:Et.t("Gets the red component of a color.")},{func:"green($color)",desc:Et.t("Gets the green component of a color.")},{func:"blue($color)",desc:Et.t("Gets the blue component of a color.")},{func:"mix($color, $color, [$weight])",desc:Et.t("Mixes two colors together.")},{func:"hue($color)",desc:Et.t("Gets the hue component of a color.")},{func:"saturation($color)",desc:Et.t("Gets the saturation component of a color.")},{func:"lightness($color)",desc:Et.t("Gets the lightness component of a color.")},{func:"adjust-hue($color, $degrees)",desc:Et.t("Changes the hue of a color.")},{func:"lighten($color, $amount)",desc:Et.t("Makes a color lighter.")},{func:"darken($color, $amount)",desc:Et.t("Makes a color darker.")},{func:"saturate($color, $amount)",desc:Et.t("Makes a color more saturated.")},{func:"desaturate($color, $amount)",desc:Et.t("Makes a color less saturated.")},{func:"grayscale($color)",desc:Et.t("Converts a color to grayscale.")},{func:"complement($color)",desc:Et.t("Returns the complement of a color.")},{func:"invert($color)",desc:Et.t("Returns the inverse of a color.")},{func:"alpha($color)",desc:Et.t("Gets the opacity component of a color.")},{func:"opacity($color)",desc:"Gets the alpha component (opacity) of a color."},{func:"rgba($color, $alpha)",desc:Et.t("Changes the alpha component for a color.")},{func:"opacify($color, $amount)",desc:Et.t("Makes a color more opaque.")},{func:"fade-in($color, $amount)",desc:Et.t("Makes a color more opaque.")},{func:"transparentize($color, $amount)",desc:Et.t("Makes a color more transparent.")},{func:"fade-out($color, $amount)",desc:Et.t("Makes a color more transparent.")},{func:"adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])",desc:Et.t("Increases or decreases one or more components of a color.")},{func:"scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])",desc:Et.t("Fluidly scales one or more properties of a color.")},{func:"change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])",desc:Et.t("Changes one or more properties of a color.")},{func:"ie-hex-str($color)",desc:Et.t("Converts a color into the format understood by IE filters.")}],Lo.selectorFuncs=[{func:"selector-nest($selectors…)",desc:Et.t("Nests selector beneath one another like they would be nested in the stylesheet.")},{func:"selector-append($selectors…)",desc:Et.t("Appends selectors to one another without spaces in between.")},{func:"selector-extend($selector, $extendee, $extender)",desc:Et.t("Extends $extendee with $extender within $selector.")},{func:"selector-replace($selector, $original, $replacement)",desc:Et.t("Replaces $original with $replacement within $selector.")},{func:"selector-unify($selector1, $selector2)",desc:Et.t("Unifies two selectors to produce a selector that matches elements matched by both.")},{func:"is-superselector($super, $sub)",desc:Et.t("Returns whether $super matches all the elements $sub does, and possibly more.")},{func:"simple-selectors($selector)",desc:Et.t("Returns the simple selectors that comprise a compound selector.")},{func:"selector-parse($selector)",desc:Et.t("Parses a selector into the format returned by &.")}],Lo.builtInFuncs=[{func:"unquote($string)",desc:Et.t("Removes quotes from a string.")},{func:"quote($string)",desc:Et.t("Adds quotes to a string.")},{func:"str-length($string)",desc:Et.t("Returns the number of characters in a string.")},{func:"str-insert($string, $insert, $index)",desc:Et.t("Inserts $insert into $string at $index.")},{func:"str-index($string, $substring)",desc:Et.t("Returns the index of the first occurance of $substring in $string.")},{func:"str-slice($string, $start-at, [$end-at])",desc:Et.t("Extracts a substring from $string.")},{func:"to-upper-case($string)",desc:Et.t("Converts a string to upper case.")},{func:"to-lower-case($string)",desc:Et.t("Converts a string to lower case.")},{func:"percentage($number)",desc:Et.t("Converts a unitless number to a percentage."),type:"percentage"},{func:"round($number)",desc:Et.t("Rounds a number to the nearest whole number.")},{func:"ceil($number)",desc:Et.t("Rounds a number up to the next whole number.")},{func:"floor($number)",desc:Et.t("Rounds a number down to the previous whole number.")},{func:"abs($number)",desc:Et.t("Returns the absolute value of a number.")},{func:"min($numbers)",desc:Et.t("Finds the minimum of several numbers.")},{func:"max($numbers)",desc:Et.t("Finds the maximum of several numbers.")},{func:"random([$limit])",desc:Et.t("Returns a random number.")},{func:"length($list)",desc:Et.t("Returns the length of a list.")},{func:"nth($list, $n)",desc:Et.t("Returns a specific item in a list.")},{func:"set-nth($list, $n, $value)",desc:Et.t("Replaces the nth item in a list.")},{func:"join($list1, $list2, [$separator])",desc:Et.t("Joins together two lists into one.")},{func:"append($list1, $val, [$separator])",desc:Et.t("Appends a single value onto the end of a list.")},{func:"zip($lists)",desc:Et.t("Combines several lists into a single multidimensional list.")},{func:"index($list, $value)",desc:Et.t("Returns the position of a value within a list.")},{func:"list-separator(#list)",desc:Et.t("Returns the separator of a list.")},{func:"map-get($map, $key)",desc:Et.t("Returns the value in a map associated with a given key.")},{func:"map-merge($map1, $map2)",desc:Et.t("Merges two maps together into a new map.")},{func:"map-remove($map, $keys)",desc:Et.t("Returns a new map with keys removed.")},{func:"map-keys($map)",desc:Et.t("Returns a list of all keys in a map.")},{func:"map-values($map)",desc:Et.t("Returns a list of all values in a map.")},{func:"map-has-key($map, $key)",desc:Et.t("Returns whether a map has a value associated with a given key.")},{func:"keywords($args)",desc:Et.t("Returns the keywords passed to a function that takes variable arguments.")},{func:"feature-exists($feature)",desc:Et.t("Returns whether a feature exists in the current Sass runtime.")},{func:"variable-exists($name)",desc:Et.t("Returns whether a variable with the given name exists in the current scope.")},{func:"global-variable-exists($name)",desc:Et.t("Returns whether a variable with the given name exists in the global scope.")},{func:"function-exists($name)",desc:Et.t("Returns whether a function with the given name exists.")},{func:"mixin-exists($name)",desc:Et.t("Returns whether a mixin with the given name exists.")},{func:"inspect($value)",desc:Et.t("Returns the string representation of a value as it would be represented in Sass.")},{func:"type-of($value)",desc:Et.t("Returns the type of a value.")},{func:"unit($number)",desc:Et.t("Returns the unit(s) associated with a number.")},{func:"unitless($number)",desc:Et.t("Returns whether a number has units.")},{func:"comparable($number1, $number2)",desc:Et.t("Returns whether two numbers can be added, subtracted, or compared.")},{func:"call($name, $args…)",desc:Et.t("Dynamically calls a Sass function.")}],Lo.scssAtDirectives=[{label:"@extend",documentation:Et.t("Inherits the styles of another selector."),kind:dn.Keyword},{label:"@at-root",documentation:Et.t("Causes one or more rules to be emitted at the root of the document."),kind:dn.Keyword},{label:"@debug",documentation:Et.t("Prints the value of an expression to the standard error output stream. Useful for debugging complicated Sass files."),kind:dn.Keyword},{label:"@warn",documentation:Et.t("Prints the value of an expression to the standard error output stream. Useful for libraries that need to warn users of deprecations or recovering from minor mixin usage mistakes. Warnings can be turned off with the `--quiet` command-line option or the `:quiet` Sass option."),kind:dn.Keyword},{label:"@error",documentation:Et.t("Throws the value of an expression as a fatal error with stack trace. Useful for validating arguments to mixins and functions."),kind:dn.Keyword},{label:"@if",documentation:Et.t("Includes the body if the expression does not evaluate to `false` or `null`."),insertText:"@if ${1:expr} {\n\t$0\n}",insertTextFormat:hn.Snippet,kind:dn.Keyword},{label:"@for",documentation:Et.t("For loop that repeatedly outputs a set of styles for each `$var` in the `from/through` or `from/to` clause."),insertText:"@for \\$${1:var} from ${2:start} ${3|to,through|} ${4:end} {\n\t$0\n}",insertTextFormat:hn.Snippet,kind:dn.Keyword},{label:"@each",documentation:Et.t("Each loop that sets `$var` to each item in the list or map, then outputs the styles it contains using that value of `$var`."),insertText:"@each \\$${1:var} in ${2:list} {\n\t$0\n}",insertTextFormat:hn.Snippet,kind:dn.Keyword},{label:"@while",documentation:Et.t("While loop that takes an expression and repeatedly outputs the nested styles until the statement evaluates to `false`."),insertText:"@while ${1:condition} {\n\t$0\n}",insertTextFormat:hn.Snippet,kind:dn.Keyword},{label:"@mixin",documentation:Et.t("Defines styles that can be re-used throughout the stylesheet with `@include`."),insertText:"@mixin ${1:name} {\n\t$0\n}",insertTextFormat:hn.Snippet,kind:dn.Keyword},{label:"@include",documentation:Et.t("Includes the styles defined by another mixin into the current rule."),kind:dn.Keyword},{label:"@function",documentation:Et.t("Defines complex operations that can be re-used throughout stylesheets."),kind:dn.Keyword}],Lo.scssModuleLoaders=[{label:"@use",documentation:Et.t("Loads mixins, functions, and variables from other Sass stylesheets as 'modules', and combines CSS from multiple stylesheets together."),references:[{name:qo,url:"https://sass-lang.com/documentation/at-rules/use"}],insertText:"@use $0;",insertTextFormat:hn.Snippet,kind:dn.Keyword},{label:"@forward",documentation:Et.t("Loads a Sass stylesheet and makes its mixins, functions, and variables available when this stylesheet is loaded with the @use rule."),references:[{name:qo,url:"https://sass-lang.com/documentation/at-rules/forward"}],insertText:"@forward $0;",insertTextFormat:hn.Snippet,kind:dn.Keyword}],Lo.scssModuleBuiltIns=[{label:"sass:math",documentation:Et.t("Provides functions that operate on numbers."),references:[{name:qo,url:"https://sass-lang.com/documentation/modules/math"}]},{label:"sass:string",documentation:Et.t("Makes it easy to combine, search, or split apart strings."),references:[{name:qo,url:"https://sass-lang.com/documentation/modules/string"}]},{label:"sass:color",documentation:Et.t("Generates new colors based on existing ones, making it easy to build color themes."),references:[{name:qo,url:"https://sass-lang.com/documentation/modules/color"}]},{label:"sass:list",documentation:Et.t("Lets you access and modify values in lists."),references:[{name:qo,url:"https://sass-lang.com/documentation/modules/list"}]},{label:"sass:map",documentation:Et.t("Makes it possible to look up the value associated with a key in a map, and much more."),references:[{name:qo,url:"https://sass-lang.com/documentation/modules/map"}]},{label:"sass:selector",documentation:Et.t("Provides access to Sass’s powerful selector engine."),references:[{name:qo,url:"https://sass-lang.com/documentation/modules/selector"}]},{label:"sass:meta",documentation:Et.t("Exposes the details of Sass’s inner workings."),references:[{name:qo,url:"https://sass-lang.com/documentation/modules/meta"}]}];const $o="/".charCodeAt(0),Uo="\n".charCodeAt(0),Vo="\r".charCodeAt(0),Bo="\f".charCodeAt(0),Ko="`".charCodeAt(0),Ho=".".charCodeAt(0);let Go=r.CustomToken;const Jo=Go++;class Xo extends X{scanNext(e){const t=this.escapedJavaScript();return null!==t?this.finishToken(e,t):this.stream.advanceIfChars([Ho,Ho,Ho])?this.finishToken(e,Jo):super.scanNext(e)}comment(){return!!super.comment()||!(this.inURL||!this.stream.advanceIfChars([$o,$o]))&&(this.stream.advanceWhileChar((e=>{switch(e){case Uo:case Vo:case Bo:return!1;default:return!0}})),!0)}escapedJavaScript(){return this.stream.peekChar()===Ko?(this.stream.advance(1),this.stream.advanceWhileChar((e=>e!==Ko)),this.stream.advanceIfChar(Ko)?r.EscapedJavaScript:r.BadEscapedJavaScript):null}}class Yo extends ti{constructor(){super(new Xo)}_parseStylesheetStatement(e=!1){return this.peek(r.AtKeyword)?this._parseVariableDeclaration()||this._parsePlugin()||super._parseStylesheetAtStatement(e):this._tryParseMixinDeclaration()||this._tryParseMixinReference()||this._parseFunction()||this._parseRuleset(!0)}_parseImport(){if(!this.peekKeyword("@import")&&!this.peekKeyword("@import-once"))return null;const e=this.create(ze);if(this.consumeToken(),this.accept(r.ParenthesisL)){if(!this.accept(r.Ident))return this.finish(e,Rt.IdentifierExpected,[r.SemiColon]);do{if(!this.accept(r.Comma))break}while(this.accept(r.Ident));if(!this.accept(r.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[r.SemiColon])}return e.addChild(this._parseURILiteral())||e.addChild(this._parseStringLiteral())?(this.peek(r.SemiColon)||this.peek(r.EOF)||e.setMedialist(this._parseMediaQueryList()),this._completeParseImport(e)):this.finish(e,Rt.URIOrStringExpected,[r.SemiColon])}_parsePlugin(){if(!this.peekKeyword("@plugin"))return null;const e=this.createNode(te.Plugin);return this.consumeToken(),e.addChild(this._parseStringLiteral())?this.accept(r.SemiColon)?this.finish(e):this.finish(e,Rt.SemiColonExpected):this.finish(e,Rt.StringLiteralExpected)}_parseMediaQuery(){const e=super._parseMediaQuery();if(!e){const e=this.create(Ge);return e.addChild(this._parseVariable())?this.finish(e):null}return e}_parseMediaDeclaration(e=!1){return this._tryParseRuleset(e)||this._tryToParseDeclaration()||this._tryParseMixinDeclaration()||this._tryParseMixinReference()||this._parseDetachedRuleSetMixin()||this._parseStylesheetStatement(e)}_parseMediaFeatureName(){return this._parseIdent()||this._parseVariable()}_parseVariableDeclaration(e=[]){const t=this.create(dt),n=this.mark();if(!t.setVariable(this._parseVariable(!0)))return null;if(!this.accept(r.Colon))return this.restoreAtMark(n),null;if(this.prevToken&&(t.colonPosition=this.prevToken.offset),t.setValue(this._parseDetachedRuleSet()))t.needsSemicolon=!1;else if(!t.setValue(this._parseExpr()))return this.finish(t,Rt.VariableValueExpected,[],e);return t.addChild(this._parsePrio()),this.peek(r.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)}_parseDetachedRuleSet(){let e=this.mark();if(this.peekDelim("#")||this.peekDelim(".")){if(this.consumeToken(),this.hasWhitespace()||!this.accept(r.ParenthesisL))return this.restoreAtMark(e),null;{let t=this.create(bt);if(t.getParameters().addChild(this._parseMixinParameter()))for(;(this.accept(r.Comma)||this.accept(r.SemiColon))&&!this.peek(r.ParenthesisR);)t.getParameters().addChild(this._parseMixinParameter())||this.markError(t,Rt.IdentifierExpected,[],[r.ParenthesisR]);if(!this.accept(r.ParenthesisR))return this.restoreAtMark(e),null}}if(!this.peek(r.CurlyL))return null;const t=this.create(he);return this._parseBody(t,this._parseDetachedRuleSetBody.bind(this)),this.finish(t)}_parseDetachedRuleSetBody(){return this._tryParseKeyframeSelector()||this._parseRuleSetDeclaration()}_addLookupChildren(e){if(!e.addChild(this._parseLookupValue()))return!1;let t=!1;for(;this.peek(r.BracketL)&&(t=!0),e.addChild(this._parseLookupValue());)t=!1;return!t}_parseLookupValue(){const e=this.create(oe),t=this.mark();return this.accept(r.BracketL)&&((e.addChild(this._parseVariable(!1,!0))||e.addChild(this._parsePropertyIdentifier()))&&this.accept(r.BracketR)||this.accept(r.BracketR))?e:(this.restoreAtMark(t),null)}_parseVariable(e=!1,t=!1){const n=!e&&this.peekDelim("$");if(!this.peekDelim("@")&&!n&&!this.peek(r.AtKeyword))return null;const i=this.create(pt),o=this.mark();for(;this.acceptDelim("@")||!e&&this.acceptDelim("$");)if(this.hasWhitespace())return this.restoreAtMark(o),null;return!this.accept(r.AtKeyword)&&!this.accept(r.Ident)||!t&&this.peek(r.BracketL)&&!this._addLookupChildren(i)?(this.restoreAtMark(o),null):i}_parseTermExpression(){return this._parseVariable()||this._parseEscaped()||super._parseTermExpression()||this._tryParseMixinReference(!1)}_parseEscaped(){if(this.peek(r.EscapedJavaScript)||this.peek(r.BadEscapedJavaScript)){const e=this.createNode(te.EscapedValue);return this.consumeToken(),this.finish(e)}if(this.peekDelim("~")){const e=this.createNode(te.EscapedValue);return this.consumeToken(),this.accept(r.String)||this.accept(r.EscapedJavaScript)?this.finish(e):this.finish(e,Rt.TermExpected)}return null}_parseOperator(){return this._parseGuardOperator()||super._parseOperator()}_parseGuardOperator(){if(this.peekDelim(">")){const e=this.createNode(te.Operator);return this.consumeToken(),this.acceptDelim("="),e}if(this.peekDelim("=")){const e=this.createNode(te.Operator);return this.consumeToken(),this.acceptDelim("<"),e}if(this.peekDelim("<")){const e=this.createNode(te.Operator);return this.consumeToken(),this.acceptDelim("="),e}return null}_parseRuleSetDeclaration(){return this.peek(r.AtKeyword)?this._parseKeyframe()||this._parseMedia(!0)||this._parseImport()||this._parseSupports(!0)||this._parseLayer()||this._parsePropertyAtRule()||this._parseContainer(!0)||this._parseDetachedRuleSetMixin()||this._parseVariableDeclaration()||this._parseRuleSetDeclarationAtStatement():this._tryParseMixinDeclaration()||this._tryParseRuleset(!0)||this._tryParseMixinReference()||this._parseFunction()||this._parseExtend()||this._parseDeclaration()}_parseKeyframeIdent(){return this._parseIdent([ne.Keyframe])||this._parseVariable()}_parseKeyframeSelector(){return this._parseDetachedRuleSetMixin()||super._parseKeyframeSelector()}_parseSelector(e){const t=this.create(ue);let n=!1;for(e&&(n=t.addChild(this._parseCombinator()));t.addChild(this._parseSimpleSelector());){n=!0;const e=this.mark();if(t.addChild(this._parseGuard())&&this.peek(r.CurlyL))break;this.restoreAtMark(e),t.addChild(this._parseCombinator())}return n?this.finish(t):null}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(te.SelectorCombinator);for(this.consumeToken();!this.hasWhitespace()&&(this.acceptDelim("-")||this.accept(r.Num)||this.accept(r.Dimension)||e.addChild(this._parseIdent())||this.acceptDelim("&")););return this.finish(e)}return null}_parseSelectorIdent(){if(!this.peekInterpolatedIdent())return null;const e=this.createNode(te.SelectorInterpolation);return this._acceptInterpolatedIdent(e)?this.finish(e):null}_parsePropertyIdentifier(e=!1){const t=/^[\w-]+/;if(!this.peekInterpolatedIdent()&&!this.peekRegExp(this.token.type,t))return null;const n=this.mark(),r=this.create(ce);r.isCustomProperty=this.acceptDelim("-")&&this.acceptDelim("-");let i=!1;return i=e?r.isCustomProperty?r.addChild(this._parseIdent()):r.addChild(this._parseRegexp(t)):r.isCustomProperty?this._acceptInterpolatedIdent(r):this._acceptInterpolatedIdent(r,t),i?(e||this.hasWhitespace()||(this.acceptDelim("+"),this.hasWhitespace()||this.acceptIdent("_")),this.finish(r)):(this.restoreAtMark(n),null)}peekInterpolatedIdent(){return this.peek(r.Ident)||this.peekDelim("@")||this.peekDelim("$")||this.peekDelim("-")}_acceptInterpolatedIdent(e,t){let n=!1;const i=()=>{const e=this.mark();return this.acceptDelim("-")&&(this.hasWhitespace()||this.acceptDelim("-"),this.hasWhitespace())?(this.restoreAtMark(e),null):this._parseInterpolation()},o=t?()=>this.acceptRegexp(t):()=>this.accept(r.Ident);for(;(o()||e.addChild(this._parseInterpolation()||this.try(i)))&&(n=!0,!this.hasWhitespace()););return n}_parseInterpolation(){const e=this.mark();if(this.peekDelim("@")||this.peekDelim("$")){const t=this.createNode(te.Interpolation);return this.consumeToken(),this.hasWhitespace()||!this.accept(r.CurlyL)?(this.restoreAtMark(e),null):t.addChild(this._parseIdent())?this.accept(r.CurlyR)?this.finish(t):this.finish(t,Rt.RightCurlyExpected):this.finish(t,Rt.IdentifierExpected)}return null}_tryParseMixinDeclaration(){const e=this.mark(),t=this.create(bt);if(!t.setIdentifier(this._parseMixinDeclarationIdentifier())||!this.accept(r.ParenthesisL))return this.restoreAtMark(e),null;if(t.getParameters().addChild(this._parseMixinParameter()))for(;(this.accept(r.Comma)||this.accept(r.SemiColon))&&!this.peek(r.ParenthesisR);)t.getParameters().addChild(this._parseMixinParameter())||this.markError(t,Rt.IdentifierExpected,[],[r.ParenthesisR]);return this.accept(r.ParenthesisR)?(t.setGuard(this._parseGuard()),this.peek(r.CurlyL)?this._parseBody(t,this._parseMixInBodyDeclaration.bind(this)):(this.restoreAtMark(e),null)):(this.restoreAtMark(e),null)}_parseMixInBodyDeclaration(){return this._parseFontFace()||this._parseRuleSetDeclaration()}_parseMixinDeclarationIdentifier(){let e;if(this.peekDelim("#")||this.peekDelim(".")){if(e=this.create(ce),this.consumeToken(),this.hasWhitespace()||!e.addChild(this._parseIdent()))return null}else{if(!this.peek(r.Hash))return null;e=this.create(ce),this.consumeToken()}return e.referenceTypes=[ne.Mixin],this.finish(e)}_parsePseudo(){if(!this.peek(r.Colon))return null;const e=this.mark(),t=this.create(ut);return this.consumeToken(),this.acceptIdent("extend")?this._completeExtends(t):(this.restoreAtMark(e),super._parsePseudo())}_parseExtend(){if(!this.peekDelim("&"))return null;const e=this.mark(),t=this.create(ut);return this.consumeToken(),!this.hasWhitespace()&&this.accept(r.Colon)&&this.acceptIdent("extend")?this._completeExtends(t):(this.restoreAtMark(e),null)}_completeExtends(e){if(!this.accept(r.ParenthesisL))return this.finish(e,Rt.LeftParenthesisExpected);const t=e.getSelectors();if(!t.addChild(this._parseSelector(!0)))return this.finish(e,Rt.SelectorExpected);for(;this.accept(r.Comma);)if(!t.addChild(this._parseSelector(!0)))return this.finish(e,Rt.SelectorExpected);return this.accept(r.ParenthesisR)?this.finish(e):this.finish(e,Rt.RightParenthesisExpected)}_parseDetachedRuleSetMixin(){if(!this.peek(r.AtKeyword))return null;const e=this.mark(),t=this.create(gt);return!t.addChild(this._parseVariable(!0))||!this.hasWhitespace()&&this.accept(r.ParenthesisL)?this.accept(r.ParenthesisR)?this.finish(t):this.finish(t,Rt.RightParenthesisExpected):(this.restoreAtMark(e),null)}_tryParseMixinReference(e=!0){const t=this.mark(),n=this.create(gt);let i=this._parseMixinDeclarationIdentifier();for(;i;){this.acceptDelim(">");const e=this._parseMixinDeclarationIdentifier();if(!e)break;n.getNamespaces().addChild(i),i=e}if(!n.setIdentifier(i))return this.restoreAtMark(t),null;let o=!1;if(this.accept(r.ParenthesisL)){if(o=!0,n.getArguments().addChild(this._parseMixinArgument()))for(;(this.accept(r.Comma)||this.accept(r.SemiColon))&&!this.peek(r.ParenthesisR);)if(!n.getArguments().addChild(this._parseMixinArgument()))return this.finish(n,Rt.ExpressionExpected);if(!this.accept(r.ParenthesisR))return this.finish(n,Rt.RightParenthesisExpected);i.referenceTypes=[ne.Mixin]}else i.referenceTypes=[ne.Mixin,ne.Rule];return this.peek(r.BracketL)?e||this._addLookupChildren(n):n.addChild(this._parsePrio()),o||this.peek(r.SemiColon)||this.peek(r.CurlyR)||this.peek(r.EOF)?this.finish(n):(this.restoreAtMark(t),null)}_parseMixinArgument(){const e=this.create(Ce),t=this.mark(),n=this._parseVariable();return n&&(this.accept(r.Colon)?e.setIdentifier(n):this.restoreAtMark(t)),e.setValue(this._parseDetachedRuleSet()||this._parseExpr(!0))?this.finish(e):(this.restoreAtMark(t),null)}_parseMixinParameter(){const e=this.create(xe);if(this.peekKeyword("@rest")){const t=this.create(oe);return this.consumeToken(),this.accept(Jo)?(e.setIdentifier(this.finish(t)),this.finish(e)):this.finish(e,Rt.DotExpected,[],[r.Comma,r.ParenthesisR])}if(this.peek(Jo)){const t=this.create(oe);return this.consumeToken(),e.setIdentifier(this.finish(t)),this.finish(e)}let t=!1;return e.setIdentifier(this._parseVariable())&&(this.accept(r.Colon),t=!0),e.setDefaultValue(this._parseDetachedRuleSet()||this._parseExpr(!0))||t?this.finish(e):null}_parseGuard(){if(!this.peekIdent("when"))return null;const e=this.create(wt);if(this.consumeToken(),!e.getConditions().addChild(this._parseGuardCondition()))return this.finish(e,Rt.ConditionExpected);for(;this.acceptIdent("and")||this.accept(r.Comma);)if(!e.getConditions().addChild(this._parseGuardCondition()))return this.finish(e,Rt.ConditionExpected);return this.finish(e)}_parseGuardCondition(){const e=this.create(St);return e.isNegated=this.acceptIdent("not"),this.accept(r.ParenthesisL)?(e.addChild(this._parseExpr()),this.accept(r.ParenthesisR)?this.finish(e):this.finish(e,Rt.RightParenthesisExpected)):e.isNegated?this.finish(e,Rt.LeftParenthesisExpected):null}_parseFunction(){const e=this.mark(),t=this.create(Se);if(!t.setIdentifier(this._parseFunctionIdentifier()))return null;if(this.hasWhitespace()||!this.accept(r.ParenthesisL))return this.restoreAtMark(e),null;if(t.getArguments().addChild(this._parseMixinArgument()))for(;(this.accept(r.Comma)||this.accept(r.SemiColon))&&!this.peek(r.ParenthesisR);)if(!t.getArguments().addChild(this._parseMixinArgument()))return this.finish(t,Rt.ExpressionExpected);return this.accept(r.ParenthesisR)?this.finish(t):this.finish(t,Rt.RightParenthesisExpected)}_parseFunctionIdentifier(){if(this.peekDelim("%")){const e=this.create(ce);return e.referenceTypes=[ne.Function],this.consumeToken(),this.finish(e)}return super._parseFunctionIdentifier()}_parseURLArgument(){const e=this.mark(),t=super._parseURLArgument();if(!t||!this.peek(r.ParenthesisR)){this.restoreAtMark(e);const t=this.create(oe);return t.addChild(this._parseBinaryExpr()),this.finish(t)}return t}}class Qo extends xi{constructor(e,t){super("@",e,t)}createFunctionProposals(e,t,n,r){for(const i of e){const e={label:i.name,detail:i.example,documentation:i.description,textEdit:Gt.replace(this.getCompletionRange(t),i.name+"($0)"),insertTextFormat:hn.Snippet,kind:dn.Function};n&&(e.sortText="z"),r.items.push(e)}return r}getTermProposals(e,t,n){let r=Qo.builtInProposals;return e&&(r=r.filter((t=>!t.type||!e.restrictions||-1!==e.restrictions.indexOf(t.type)))),this.createFunctionProposals(r,t,!0,n),super.getTermProposals(e,t,n)}getColorProposals(e,t,n){return this.createFunctionProposals(Qo.colorProposals,t,!1,n),super.getColorProposals(e,t,n)}getCompletionsForDeclarationProperty(e,t){return this.getCompletionsForSelector(null,!0,t),super.getCompletionsForDeclarationProperty(e,t)}}function Zo(e,t){const n=function(e){function t(t){return e.positionAt(t.offset).line}function n(t){return e.positionAt(t.offset+t.len).line}function i(e,r){const i=t(e),o=n(e);return i!==o?{startLine:i,endLine:o,kind:r}:null}const o=[],s=[],a=function(){switch(e.languageId){case"scss":return new zo;case"less":return new Xo;default:return new X}}();a.ignoreComment=!1,a.setSource(e.getText());let c=a.scan(),l=null;for(;c.type!==r.EOF;){switch(c.type){case r.CurlyL:case Do:s.push({line:t(c),type:"brace",isStart:!0});break;case r.CurlyR:if(0!==s.length){const e=es(s,"brace");if(!e)break;let t=n(c);"brace"===e.type&&(l&&n(l)!==t&&t--,e.line!==t&&o.push({startLine:e.line,endLine:t,kind:void 0}))}break;case r.Comment:{const r=e=>"#region"===e?{line:t(c),type:"comment",isStart:!0}:{line:n(c),type:"comment",isStart:!1},a=t=>{const n=t.text.match(/^\s*\/\*\s*(#region|#endregion)\b\s*(.*?)\s*\*\//);if(n)return r(n[1]);if("scss"===e.languageId||"less"===e.languageId){const e=t.text.match(/^\s*\/\/\s*(#region|#endregion)\b\s*(.*?)\s*/);if(e)return r(e[1])}return null},l=a(c);if(l)if(l.isStart)s.push(l);else{const e=es(s,"comment");if(!e)break;"comment"===e.type&&e.line!==l.line&&o.push({startLine:e.line,endLine:l.line,kind:"region"})}else{const e=i(c,"comment");e&&o.push(e)}break}}l=c,c=a.scan()}return o}(e);return function(e,t){const n=t&&t.rangeLimit||Number.MAX_VALUE,r=e.sort(((e,t)=>{let n=e.startLine-t.startLine;return 0===n&&(n=e.endLine-t.endLine),n})),i=[];let o=-1;return r.forEach((e=>{e.startLine=0;n--)if(e[n].type===t&&e[n].isStart)return e.splice(n,1)[0];return null}var ts,ns;Qo.builtInProposals=[{name:"if",example:"if(condition, trueValue [, falseValue]);",description:Et.t("returns one of two values depending on a condition.")},{name:"boolean",example:"boolean(condition);",description:Et.t('"store" a boolean test for later evaluation in a guard or if().')},{name:"length",example:"length(@list);",description:Et.t("returns the number of elements in a value list")},{name:"extract",example:"extract(@list, index);",description:Et.t("returns a value at the specified position in the list")},{name:"range",example:"range([start, ] end [, step]);",description:Et.t("generate a list spanning a range of values")},{name:"each",example:"each(@list, ruleset);",description:Et.t("bind the evaluation of a ruleset to each member of a list.")},{name:"escape",example:"escape(@string);",description:Et.t("URL encodes a string")},{name:"e",example:"e(@string);",description:Et.t("escape string content")},{name:"replace",example:"replace(@string, @pattern, @replacement[, @flags]);",description:Et.t("string replace")},{name:"unit",example:"unit(@dimension, [@unit: '']);",description:Et.t("remove or change the unit of a dimension")},{name:"color",example:"color(@string);",description:Et.t("parses a string to a color"),type:"color"},{name:"convert",example:"convert(@value, unit);",description:Et.t("converts numbers from one type into another")},{name:"data-uri",example:"data-uri([mimetype,] url);",description:Et.t("inlines a resource and falls back to `url()`"),type:"url"},{name:"abs",description:Et.t("absolute value of a number"),example:"abs(number);"},{name:"acos",description:Et.t("arccosine - inverse of cosine function"),example:"acos(number);"},{name:"asin",description:Et.t("arcsine - inverse of sine function"),example:"asin(number);"},{name:"ceil",example:"ceil(@number);",description:Et.t("rounds up to an integer")},{name:"cos",description:Et.t("cosine function"),example:"cos(number);"},{name:"floor",description:Et.t("rounds down to an integer"),example:"floor(@number);"},{name:"percentage",description:Et.t("converts to a %, e.g. 0.5 > 50%"),example:"percentage(@number);",type:"percentage"},{name:"round",description:Et.t("rounds a number to a number of places"),example:"round(number, [places: 0]);"},{name:"sqrt",description:Et.t("calculates square root of a number"),example:"sqrt(number);"},{name:"sin",description:Et.t("sine function"),example:"sin(number);"},{name:"tan",description:Et.t("tangent function"),example:"tan(number);"},{name:"atan",description:Et.t("arctangent - inverse of tangent function"),example:"atan(number);"},{name:"pi",description:Et.t("returns pi"),example:"pi();"},{name:"pow",description:Et.t("first argument raised to the power of the second argument"),example:"pow(@base, @exponent);"},{name:"mod",description:Et.t("first argument modulus second argument"),example:"mod(number, number);"},{name:"min",description:Et.t("returns the lowest of one or more values"),example:"min(@x, @y);"},{name:"max",description:Et.t("returns the lowest of one or more values"),example:"max(@x, @y);"}],Qo.colorProposals=[{name:"argb",example:"argb(@color);",description:Et.t("creates a #AARRGGBB")},{name:"hsl",example:"hsl(@hue, @saturation, @lightness);",description:Et.t("creates a color")},{name:"hsla",example:"hsla(@hue, @saturation, @lightness, @alpha);",description:Et.t("creates a color")},{name:"hsv",example:"hsv(@hue, @saturation, @value);",description:Et.t("creates a color")},{name:"hsva",example:"hsva(@hue, @saturation, @value, @alpha);",description:Et.t("creates a color")},{name:"hue",example:"hue(@color);",description:Et.t("returns the `hue` channel of `@color` in the HSL space")},{name:"saturation",example:"saturation(@color);",description:Et.t("returns the `saturation` channel of `@color` in the HSL space")},{name:"lightness",example:"lightness(@color);",description:Et.t("returns the `lightness` channel of `@color` in the HSL space")},{name:"hsvhue",example:"hsvhue(@color);",description:Et.t("returns the `hue` channel of `@color` in the HSV space")},{name:"hsvsaturation",example:"hsvsaturation(@color);",description:Et.t("returns the `saturation` channel of `@color` in the HSV space")},{name:"hsvvalue",example:"hsvvalue(@color);",description:Et.t("returns the `value` channel of `@color` in the HSV space")},{name:"red",example:"red(@color);",description:Et.t("returns the `red` channel of `@color`")},{name:"green",example:"green(@color);",description:Et.t("returns the `green` channel of `@color`")},{name:"blue",example:"blue(@color);",description:Et.t("returns the `blue` channel of `@color`")},{name:"alpha",example:"alpha(@color);",description:Et.t("returns the `alpha` channel of `@color`")},{name:"luma",example:"luma(@color);",description:Et.t("returns the `luma` value (perceptual brightness) of `@color`")},{name:"saturate",example:"saturate(@color, 10%);",description:Et.t("return `@color` 10% points more saturated")},{name:"desaturate",example:"desaturate(@color, 10%);",description:Et.t("return `@color` 10% points less saturated")},{name:"lighten",example:"lighten(@color, 10%);",description:Et.t("return `@color` 10% points lighter")},{name:"darken",example:"darken(@color, 10%);",description:Et.t("return `@color` 10% points darker")},{name:"fadein",example:"fadein(@color, 10%);",description:Et.t("return `@color` 10% points less transparent")},{name:"fadeout",example:"fadeout(@color, 10%);",description:Et.t("return `@color` 10% points more transparent")},{name:"fade",example:"fade(@color, 50%);",description:Et.t("return `@color` with 50% transparency")},{name:"spin",example:"spin(@color, 10);",description:Et.t("return `@color` with a 10 degree larger in hue")},{name:"mix",example:"mix(@color1, @color2, [@weight: 50%]);",description:Et.t("return a mix of `@color1` and `@color2`")},{name:"greyscale",example:"greyscale(@color);",description:Et.t("returns a grey, 100% desaturated color")},{name:"contrast",example:"contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]);",description:Et.t("return `@darkcolor` if `@color1 is> 43% luma` otherwise return `@lightcolor`, see notes")},{name:"multiply",example:"multiply(@color1, @color2);"},{name:"screen",example:"screen(@color1, @color2);"},{name:"overlay",example:"overlay(@color1, @color2);"},{name:"softlight",example:"softlight(@color1, @color2);"},{name:"hardlight",example:"hardlight(@color1, @color2);"},{name:"difference",example:"difference(@color1, @color2);"},{name:"exclusion",example:"exclusion(@color1, @color2);"},{name:"average",example:"average(@color1, @color2);"},{name:"negation",example:"negation(@color1, @color2);"}],ts=[,,function(e){function t(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function n(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function r(e,r){this.__indent_cache=new n(e,r),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},t.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},t.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},t.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},n.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),(n+=e*this.__indent_size)+t},n.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+this.__cache[t]},n.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},r.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline()||(this.raw||this.__add_outputline(),0))},r.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(e){for(var t=0;t1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(e,n){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(0!==i.item(0).indexOf(e)&&i.item(-1)!==n){this.__lines.splice(r+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},e.exports.Output=r},,,,function(e){function t(e,t){this.raw_options=n(e,t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function n(e,t){var n,i={};for(n in e=r(e))n!==t&&(i[n]=e[n]);if(t&&e[t])for(n in e[t])i[n]=e[t][n];return i}function r(e){var t,n={};for(t in e)n[t.replace(/-/g,"_")]=e[t];return n}t.prototype._get_array=function(e,t){var n=this.raw_options[e],r=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},t.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},t.prototype._get_characters=function(e,t){var n=this.raw_options[e],r=t||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},t.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var r=parseInt(n,10);return isNaN(r)&&(r=t),r},t.prototype._get_selection=function(e,t,n){var r=this._get_selection_list(e,t,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r[0]},t.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var r=this._get_array(e,n);if(!this._is_valid_selection(r,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r},t.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some((function(e){return-1===t.indexOf(e)}))},e.exports.Options=t,e.exports.normalizeOpts=r,e.exports.mergeOpts=n},,function(e){var t=RegExp.prototype.hasOwnProperty("sticky");function n(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position=0&&e=0&&t=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=n},,,,,function(e){function t(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}t.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},t.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=t},,function(e,t,n){var r=n(16).Beautifier,i=n(17).Options;e.exports=function(e,t){return new r(e,t).beautify()},e.exports.defaultOptions=function(){return new i}},function(e,t,n){var r=n(17).Options,i=n(2).Output,o=n(8).InputScanner,s=new(0,n(13).Directives)(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,c=/\r\n|[\r\n]/g,l=/\s/,d=/(?:\s|\n)+/g,h=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,p=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function u(e,t){this._source_text=e||"",this._options=new r(t),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}u.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},u.prototype.eatWhitespace=function(e){for(var t=l.test(this._input.peek()),n=0;l.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(0===n||n0&&this._indentLevel--},u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===t&&(t="\n",e&&a.test(e||"")&&(t=e.match(a)[0]));var n=(e=e.replace(c,"\n")).match(/^[\t ]*/)[0];this._output=new i(this._options,n),this._input=new o(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var r,u,m=0,f=!1,g=!1,b=!1,y=!1,v=!1,w=this._ch,S=!1;r=""!==this._input.read(d),u=w,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),w=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var x=this._input.read(h),C=s.get_directives(x);C&&"start"===C.ignore&&(x+=s.readIgnored(this._input)),this.print_string(x),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(p)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(r),this.print_string(this._ch);var k=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);k.match(/[ :]$/)&&(k=this.eatString(": ").replace(/\s+$/,""),this.print_string(k),this._output.space_before_token=!0),0===m&&-1!==k.indexOf(":")&&(g=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(r),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var _=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);_.match(/[ :]$/)&&(_=this.eatString(": ").replace(/\s+$/,""),this.print_string(_),this._output.space_before_token=!0),0===m&&-1!==_.indexOf(":")?(g=!0,this.indent()):_ in this.NESTED_AT_RULE?(this._nestedLevel+=1,_ in this.CONDITIONAL_GROUP_RULE&&(b=!0)):0!==m||g||(y=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(r),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)g&&(g=!1,this.outdent()),y=!1,b?(b=!1,f=this._indentLevel>=this._nestedLevel):f=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&f&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===u?this._output.space_before_token=!1:","!==u&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===u&&this._output.trim(!0),g&&(this.outdent(),g=!1),this.print_string(this._ch),f=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var E=0;E"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||g||0!==m)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(r),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),l.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var D='"'===u||"'"===u;this.preserveSingleSpace(D||r),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&S&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&l.test(this._ch)&&(this._ch=""));return this._output.get_code(t)},e.exports.Beautifier=u},function(e,t,n){var r=n(6).Options;function i(e){r.call(this,e,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var t=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||t;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i0&&ds(r,c-1);)c--;0===c||ls(r,c-1)?a=c:c=0;){const n=e.charCodeAt(t);if(n===ss)return!0;if(n===as)return!1;t--}return!1}(r,a),i=l===r.length,r=r.substring(a,l),0!==a){const r=e.offsetAt(Mt.create(t.start.line,0));o=function(e,t,n){let r=t,i=0;const o=n.tabSize||4;for(;r0){const e=n.insertSpaces?ee(" ",a*o):ee("\t",o);l=l.split("\n").join("\n"+e),0===t.start.character&&(l=e+l)}return[{range:t,newText:l}]}function os(e){return e.replace(/^\s+/,"")}const ss="{".charCodeAt(0),as="}".charCodeAt(0);function cs(e,t,n){if(e&&e.hasOwnProperty(t)){const n=e[t];if(null!==n)return n}return n}function ls(e,t){return-1!=="\r\n".indexOf(e.charAt(t))}function ds(e,t){return-1!==" \t".indexOf(e.charAt(t))}const hs={version:1.1,properties:[{name:"additive-symbols",browsers:["FF33"],atRule:"@counter-style",syntax:"[ && ]#",relevance:50,description:"@counter-style descriptor. Specifies the symbols used by the marker-construction algorithm specified by the system descriptor. Needs to be specified if the counter system is 'additive'.",restrictions:["integer","string","image","identifier"]},{name:"align-content",browsers:["E12","FF28","S9","C29","IE11","O16"],values:[{name:"center",description:"Lines are packed toward the center of the flex container."},{name:"flex-end",description:"Lines are packed toward the end of the flex container."},{name:"flex-start",description:"Lines are packed toward the start of the flex container."},{name:"space-around",description:"Lines are evenly distributed in the flex container, with half-size spaces on either end."},{name:"space-between",description:"Lines are evenly distributed in the flex container."},{name:"stretch",description:"Lines stretch to take up the remaining space."},{name:"start"},{name:"end"},{name:"normal"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"space-around"},{name:"space-between"},{name:"space-evenly"},{name:"stretch"},{name:"safe"},{name:"unsafe"}],syntax:"normal | | | ? ",relevance:66,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-content"}],description:"Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how 'justify-content' aligns individual items within the main-axis.",restrictions:["enum"]},{name:"align-items",browsers:["E12","FF20","S9","C29","IE11","O16"],values:[{name:"baseline",description:"If the flex item's inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment."},{name:"center",description:"The flex item's margin box is centered in the cross axis within the line."},{name:"flex-end",description:"The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line."},{name:"flex-start",description:"The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line."},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"normal"},{name:"start"},{name:"end"},{name:"self-start"},{name:"self-end"},{name:"first baseline"},{name:"last baseline"},{name:"stretch"},{name:"safe"},{name:"unsafe"}],syntax:"normal | stretch | | [ ? ]",relevance:87,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-items"}],description:"Aligns flex items along the cross axis of the current line of the flex container.",restrictions:["enum"]},{name:"justify-items",browsers:["E12","FF20","S9","C52","IE11","O12.1"],values:[{name:"auto"},{name:"normal"},{name:"end"},{name:"start"},{name:"flex-end",description:'"Flex items are packed toward the end of the line."'},{name:"flex-start",description:'"Flex items are packed toward the start of the line."'},{name:"self-end",description:"The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis."},{name:"self-start",description:"The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.."},{name:"center",description:"The items are packed flush to each other toward the center of the of the alignment container."},{name:"left"},{name:"right"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"safe"},{name:"unsafe"},{name:"legacy"}],syntax:"normal | stretch | | ? [ | left | right ] | legacy | legacy && [ left | right | center ]",relevance:56,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/justify-items"}],description:"Defines the default justify-self for all items of the box, giving them the default way of justifying each box along the appropriate axis",restrictions:["enum"]},{name:"justify-self",browsers:["E16","FF45","S10.1","C57","IE10","O44"],values:[{name:"auto"},{name:"normal"},{name:"end"},{name:"start"},{name:"flex-end",description:'"Flex items are packed toward the end of the line."'},{name:"flex-start",description:'"Flex items are packed toward the start of the line."'},{name:"self-end",description:"The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis."},{name:"self-start",description:"The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.."},{name:"center",description:"The items are packed flush to each other toward the center of the of the alignment container."},{name:"left"},{name:"right"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"save"},{name:"unsave"}],syntax:"auto | normal | stretch | | ? [ | left | right ]",relevance:55,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/justify-self"}],description:"Defines the way of justifying a box inside its container along the appropriate axis.",restrictions:["enum"]},{name:"align-self",browsers:["E12","FF20","S9","C29","IE10","O12.1"],values:[{name:"auto",description:"Computes to the value of 'align-items' on the element's parent, or 'stretch' if the element has no parent. On absolutely positioned elements, it computes to itself."},{name:"normal"},{name:"self-end"},{name:"self-start"},{name:"baseline",description:"If the flex item's inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment."},{name:"center",description:"The flex item's margin box is centered in the cross axis within the line."},{name:"flex-end",description:"The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line."},{name:"flex-start",description:"The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line."},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"safe"},{name:"unsafe"}],syntax:"auto | normal | stretch | | ? ",relevance:74,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-self"}],description:"Allows the default alignment along the cross axis to be overridden for individual flex items.",restrictions:["enum"]},{name:"all",browsers:["E79","FF27","S9.1","C37","O24"],values:[],syntax:"initial | inherit | unset | revert | revert-layer",relevance:54,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/all"}],description:"Shorthand that resets all properties except 'direction' and 'unicode-bidi'.",restrictions:["enum"]},{name:"alt",browsers:["S9"],values:[],relevance:50,description:"Provides alternative text for assistive technology to replace the generated content of a ::before or ::after element.",restrictions:["string","enum"]},{name:"animation",browsers:["E12","FF16","S9","C43","IE10","O30"],values:[{name:"alternate",description:"The animation cycle iterations that are odd counts are played in the normal direction, and the animation cycle iterations that are even counts are played in a reverse direction."},{name:"alternate-reverse",description:"The animation cycle iterations that are odd counts are played in the reverse direction, and the animation cycle iterations that are even counts are played in a normal direction."},{name:"backwards",description:"The beginning property value (as defined in the first @keyframes at-rule) is applied before the animation is displayed, during the period defined by 'animation-delay'."},{name:"both",description:"Both forwards and backwards fill modes are applied."},{name:"forwards",description:"The final property value (as defined in the last @keyframes at-rule) is maintained after the animation completes."},{name:"infinite",description:"Causes the animation to repeat forever."},{name:"none",description:"No animation is performed"},{name:"normal",description:"Normal playback."},{name:"reverse",description:"All iterations of the animation are played in the reverse direction from the way they were specified."}],syntax:"#",relevance:82,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/animation"}],description:"Shorthand property combines six of the animation properties into a single property.",restrictions:["time","timing-function","enum","identifier","number"]},{name:"animation-delay",browsers:["E12","FF16","S9","C43","IE10","O30"],syntax:"