@vtj/designer 0.13.8 → 0.13.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "./index-7sBq4Xed.js";
2
+ export {
3
+ f as default
4
+ };
@@ -34,7 +34,7 @@ Syntax: \${e.syntax}\`)}return e.references&&e.references.length>0&&t?.reference
34
34
 
35
35
  Syntax: \${br(e.syntax)}\`)}return e.references&&e.references.length>0&&t?.references!==!1&&(n.length>0&&(n+=\`
36
36
 
37
- \`),n+=e.references.map(r=>\`[\${r.name}](\${r.url})\`).join(" | ")),n}function wc(e=[]){return e.length===0?null:e.map(t=>{let n="";const r=t.match(/([A-Z]+)(\\d+)?/),i=r[1],s=r[2];return i in bc&&(n+=bc[i]),s&&(n+=" "+s),n}).join(", ")}var rm=/(^#([0-9A-F]{3}){1,2}$)|(^#([0-9A-F]{4}){1,2}$)/i,im=[{label:"rgb",func:"rgb($red, $green, $blue)",insertText:"rgb(\${1:red}, \${2:green}, \${3:blue})",desc:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("Mix two colors together in a polar color space.")}],sm=/^(rgb|rgba|hsl|hsla|hwb)$/i,vr={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"},am=new RegExp(\`^(\${Object.keys(vr).join("|")})$\`,"i"),rs={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."},om=new RegExp(\`^(\${Object.keys(rs).join("|")})$\`,"i");function vt(e,t){const r=e.getText().match(/^([-+]?[0-9]*\\.?[0-9]+)(%?)$/);if(r){r[2]&&(t=100);const i=parseFloat(r[1])/t;if(i>=0&&i<=1)return i}throw new Error}function yc(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 parseFloat(t)*180/Math.PI%360;case"grad":return parseFloat(t)*.9%360;case"turn":return parseFloat(t)*360%360;default:if(typeof n[2]>"u")return parseFloat(t)%360}throw new Error}function lm(e){const t=e.getName();return t?sm.test(t):!1}function xc(e){return rm.test(e)||am.test(e)||om.test(e)}var Sc=48,cm=57,hm=65,wr=97,dm=102;function de(e){return e<Sc?0:e<=cm?e-Sc:(e<wr&&(e+=wr-hm),e>=wr&&e<=dm?e-wr+10:0)}function Cc(e){if(e[0]!=="#")return null;switch(e.length){case 4:return{red:de(e.charCodeAt(1))*17/255,green:de(e.charCodeAt(2))*17/255,blue:de(e.charCodeAt(3))*17/255,alpha:1};case 5:return{red:de(e.charCodeAt(1))*17/255,green:de(e.charCodeAt(2))*17/255,blue:de(e.charCodeAt(3))*17/255,alpha:de(e.charCodeAt(4))*17/255};case 7:return{red:(de(e.charCodeAt(1))*16+de(e.charCodeAt(2)))/255,green:(de(e.charCodeAt(3))*16+de(e.charCodeAt(4)))/255,blue:(de(e.charCodeAt(5))*16+de(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(de(e.charCodeAt(1))*16+de(e.charCodeAt(2)))/255,green:(de(e.charCodeAt(3))*16+de(e.charCodeAt(4)))/255,blue:(de(e.charCodeAt(5))*16+de(e.charCodeAt(6)))/255,alpha:(de(e.charCodeAt(7))*16+de(e.charCodeAt(8)))/255}}return null}function kc(e,t,n,r=1){if(e=e/60,t===0)return{red:n,green:n,blue:n,alpha:r};{const i=(l,o,c)=>{for(;c<0;)c+=6;for(;c>=6;)c-=6;return c<1?(o-l)*c+l:c<3?o:c<4?(o-l)*(4-c)+l:l},s=n<=.5?n*(t+1):n+t-n*t,a=n*2-s;return{red:i(a,s,e+2),green:i(a,s,e),blue:i(a,s,e-2),alpha:r}}}function _c(e){const t=e.red,n=e.green,r=e.blue,i=e.alpha,s=Math.max(t,n,r),a=Math.min(t,n,r);let l=0,o=0;const c=(a+s)/2,d=s-a;if(d>0){switch(o=Math.min(c<=.5?d/(2*c):d/(2-2*c),1),s){case t:l=(n-r)/d+(n<r?6:0);break;case n:l=(r-t)/d+2;break;case r:l=(t-n)/d+4;break}l*=60,l=Math.round(l)}return{h:l,s:o,l:c,a:i}}function um(e,t,n,r=1){if(t+n>=1){const o=t/(t+n);return{red:o,green:o,blue:o,alpha:r}}const i=kc(e,1,.5,r);let s=i.red;s*=1-t-n,s+=t;let a=i.green;a*=1-t-n,a+=t;let l=i.blue;return l*=1-t-n,l+=t,{red:s,green:a,blue:l,alpha:r}}function pm(e){const t=_c(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}}function mm(e){if(e.type===b.HexColorValue){const t=e.getText();return Cc(t)}else if(e.type===b.Function){const t=e,n=t.getName();let r=t.getArguments().getChildren();if(r.length===1){const i=r[0].getChildren();if(i.length===1&&i[0].type===b.Expression&&(r=i[0].getChildren(),r.length===3)){const s=r[2];if(s instanceof Pi){const a=s.getLeft(),l=s.getRight(),o=s.getOperator();a&&l&&o&&o.matches("/")&&(r=[r[0],r[1],a,l])}}}if(!n||r.length<3||r.length>4)return null;try{const i=r.length===4?vt(r[3],1):1;if(n==="rgb"||n==="rgba")return{red:vt(r[0],255),green:vt(r[1],255),blue:vt(r[2],255),alpha:i};if(n==="hsl"||n==="hsla"){const s=yc(r[0]),a=vt(r[1],100),l=vt(r[2],100);return kc(s,a,l,i)}else if(n==="hwb"){const s=yc(r[0]),a=vt(r[1],100),l=vt(r[2],100);return um(s,a,l,i)}}catch{return null}}else if(e.type===b.Identifier){if(e.parent&&e.parent.type!==b.Term)return null;const t=e.parent;if(t&&t.parent&&t.parent.type===b.BinaryExpression){const i=t.parent;if(i.parent&&i.parent.type===b.ListEntry&&i.parent.key===i)return null}const n=e.getText().toLowerCase();if(n==="none")return null;const r=vr[n];if(r)return Cc(r)}return null}var Ec={bottom:"Computes to ‘100%’ for the vertical position if one or two values are given, otherwise specifies the bottom edge as the origin for the next offset.",center:"Computes to ‘50%’ (‘left 50%’) for the horizontal position if the horizontal position is not otherwise specified, or ‘50%’ (‘top 50%’) for the vertical position if it is.",left:"Computes to ‘0%’ for the horizontal position if one or two values are given, otherwise specifies the left edge as the origin for the next offset.",right:"Computes to ‘100%’ for the horizontal position if one or two values are given, otherwise specifies the right edge as the origin for the next offset.",top:"Computes to ‘0%’ for the vertical position if one or two values are given, otherwise specifies the top edge as the origin for the next offset."},Fc={"no-repeat":"Placed once and not repeated in this direction.",repeat:"Repeated in this direction as often as needed to cover the background painting area.","repeat-x":"Computes to ‘repeat no-repeat’.","repeat-y":"Computes to ‘no-repeat repeat’.",round:"Repeated as often as will fit within the background positioning area. If it doesn’t fit a whole number of times, it is rescaled so that it does.",space:"Repeated as often as will fit within the background positioning area without being clipped and then the images are spaced out to fill the area."},Rc={dashed:"A series of square-ended dashes.",dotted:"A series of round dots.",double:"Two parallel solid lines with some space between them.",groove:"Looks as if it were carved in the canvas.",hidden:"Same as ‘none’, but has different behavior in the border conflict resolution rules for border-collapsed tables.",inset:"Looks as if the content on the inside of the border is sunken into the canvas.",none:"No border. Color and width are ignored.",outset:"Looks as if the content on the inside of the border is coming out of the canvas.",ridge:"Looks as if it were coming out of the canvas.",solid:"A single line segment."},fm=["medium","thick","thin"],Nc={"border-box":"The background is painted within (clipped to) the border box.","content-box":"The background is painted within (clipped to) the content box.","padding-box":"The background is painted within (clipped to) the padding box."},Dc={"margin-box":"Uses the margin box as reference box.","fill-box":"Uses the object bounding box as reference box.","stroke-box":"Uses the stroke bounding box as reference box.","view-box":"Uses the nearest SVG viewport as reference box."},Ic={initial:"Represents the value specified as the property’s initial value.",inherit:"Represents the computed value of the property on the element’s parent.",unset:"Acts as either \`inherit\` or \`initial\`, depending on whether the property is inherited or not."},Mc={"var()":"Evaluates the value of a custom variable.","calc()":"Evaluates an mathematical expression. The following operators can be used: + - * /."},Ac={"url()":"Reference an image file by URL","image()":"Provide image fallbacks and annotations.","-webkit-image-set()":"Provide multiple resolutions. Remember to use unprefixed image-set() in addition.","image-set()":"Provide multiple resolutions of an image and const the UA decide which is most appropriate in a given situation.","-moz-element()":"Use an element in the document as an image. Remember to use unprefixed element() in addition.","element()":"Use an element in the document as an image.","cross-fade()":"Indicates the two images to be combined and how far along in the transition the combination is.","-webkit-gradient()":"Deprecated. Use modern linear-gradient() or radial-gradient() instead.","-webkit-linear-gradient()":"Linear gradient. Remember to use unprefixed version in addition.","-moz-linear-gradient()":"Linear gradient. Remember to use unprefixed version in addition.","-o-linear-gradient()":"Linear gradient. Remember to use unprefixed version in addition.","linear-gradient()":"A linear gradient is created by specifying a straight gradient line, and then several colors placed along that line.","-webkit-repeating-linear-gradient()":"Repeating Linear gradient. Remember to use unprefixed version in addition.","-moz-repeating-linear-gradient()":"Repeating Linear gradient. Remember to use unprefixed version in addition.","-o-repeating-linear-gradient()":"Repeating Linear gradient. Remember to use unprefixed version in addition.","repeating-linear-gradient()":"Same as linear-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop’s position and the first specified color-stop’s position.","-webkit-radial-gradient()":"Radial gradient. Remember to use unprefixed version in addition.","-moz-radial-gradient()":"Radial gradient. Remember to use unprefixed version in addition.","radial-gradient()":"Colors emerge from a single point and smoothly spread outward in a circular or elliptical shape.","-webkit-repeating-radial-gradient()":"Repeating radial gradient. Remember to use unprefixed version in addition.","-moz-repeating-radial-gradient()":"Repeating radial gradient. Remember to use unprefixed version in addition.","repeating-radial-gradient()":"Same as radial-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop’s position and the first specified color-stop’s position."},Lc={ease:"Equivalent to cubic-bezier(0.25, 0.1, 0.25, 1.0).","ease-in":"Equivalent to cubic-bezier(0.42, 0, 1.0, 1.0).","ease-in-out":"Equivalent to cubic-bezier(0.42, 0, 0.58, 1.0).","ease-out":"Equivalent to cubic-bezier(0, 0, 0.58, 1.0).",linear:"Equivalent to cubic-bezier(0.0, 0.0, 1.0, 1.0).","step-end":"Equivalent to steps(1, end).","step-start":"Equivalent to steps(1, start).","steps()":"The first parameter specifies the number of intervals in the function. The second parameter, which is optional, is either the value “start” or “end”.","cubic-bezier()":"Specifies a cubic-bezier curve. The four values specify points P1 and P2 of the curve as (x1, y1, x2, y2).","cubic-bezier(0.6, -0.28, 0.735, 0.045)":"Ease-in Back. Overshoots.","cubic-bezier(0.68, -0.55, 0.265, 1.55)":"Ease-in-out Back. Overshoots.","cubic-bezier(0.175, 0.885, 0.32, 1.275)":"Ease-out Back. Overshoots.","cubic-bezier(0.6, 0.04, 0.98, 0.335)":"Ease-in Circular. Based on half circle.","cubic-bezier(0.785, 0.135, 0.15, 0.86)":"Ease-in-out Circular. Based on half circle.","cubic-bezier(0.075, 0.82, 0.165, 1)":"Ease-out Circular. Based on half circle.","cubic-bezier(0.55, 0.055, 0.675, 0.19)":"Ease-in Cubic. Based on power of three.","cubic-bezier(0.645, 0.045, 0.355, 1)":"Ease-in-out Cubic. Based on power of three.","cubic-bezier(0.215, 0.610, 0.355, 1)":"Ease-out Cubic. Based on power of three.","cubic-bezier(0.95, 0.05, 0.795, 0.035)":"Ease-in Exponential. Based on two to the power ten.","cubic-bezier(1, 0, 0, 1)":"Ease-in-out Exponential. Based on two to the power ten.","cubic-bezier(0.19, 1, 0.22, 1)":"Ease-out Exponential. Based on two to the power ten.","cubic-bezier(0.47, 0, 0.745, 0.715)":"Ease-in Sine.","cubic-bezier(0.445, 0.05, 0.55, 0.95)":"Ease-in-out Sine.","cubic-bezier(0.39, 0.575, 0.565, 1)":"Ease-out Sine.","cubic-bezier(0.55, 0.085, 0.68, 0.53)":"Ease-in Quadratic. Based on power of two.","cubic-bezier(0.455, 0.03, 0.515, 0.955)":"Ease-in-out Quadratic. Based on power of two.","cubic-bezier(0.25, 0.46, 0.45, 0.94)":"Ease-out Quadratic. Based on power of two.","cubic-bezier(0.895, 0.03, 0.685, 0.22)":"Ease-in Quartic. Based on power of four.","cubic-bezier(0.77, 0, 0.175, 1)":"Ease-in-out Quartic. Based on power of four.","cubic-bezier(0.165, 0.84, 0.44, 1)":"Ease-out Quartic. Based on power of four.","cubic-bezier(0.755, 0.05, 0.855, 0.06)":"Ease-in Quintic. Based on power of five.","cubic-bezier(0.86, 0, 0.07, 1)":"Ease-in-out Quintic. Based on power of five.","cubic-bezier(0.23, 1, 0.320, 1)":"Ease-out Quintic. Based on power of five."},zc={"circle()":"Defines a circle.","ellipse()":"Defines an ellipse.","inset()":"Defines an inset rectangle.","polygon()":"Defines a polygon."},Pc={length:["cap","ch","cm","cqb","cqh","cqi","cqmax","cqmin","cqw","dvb","dvh","dvi","dvw","em","ex","ic","in","lh","lvb","lvh","lvi","lvw","mm","pc","pt","px","q","rcap","rch","rem","rex","ric","rlh","svb","svh","svi","svw","vb","vh","vi","vmax","vmin","vw"],angle:["deg","rad","grad","turn"],time:["ms","s"],frequency:["Hz","kHz"],resolution:["dpi","dpcm","dppx"],percentage:["%","fr"]},gm=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","const","video","wbr"],bm=["circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","hatch","hatchpath","image","line","linearGradient","marker","mask","mesh","meshpatch","meshrow","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","solidcolor","stop","svg","switch","symbol","text","textPath","tspan","use","view"],vm=["@bottom-center","@bottom-left","@bottom-left-corner","@bottom-right","@bottom-right-corner","@left-bottom","@left-middle","@left-top","@right-bottom","@right-middle","@right-top","@top-center","@top-left","@top-left-corner","@top-right","@top-right-corner"];function yr(e){return Object.keys(e).map(t=>e[t])}function Le(e){return typeof e<"u"}var xr=class{constructor(e=new xn){this.keyframeRegex=/^@(\\-(webkit|ms|moz|o)\\-)?keyframes$/i,this.scanner=e,this.token={type:p.EOF,offset:-1,len:0,text:""},this.prevToken=void 0}peekIdent(e){return p.Ident===this.token.type&&e.length===this.token.text.length&&e===this.token.text.toLowerCase()}peekKeyword(e){return p.AtKeyword===this.token.type&&e.length===this.token.text.length&&e===this.token.text.toLowerCase()}peekDelim(e){return p.Delim===this.token.type&&e===this.token.text}peek(e){return e===this.token.type}peekOne(...e){return e.indexOf(this.token.type)!==-1}peekRegExp(e,t){return e!==this.token.type?!1: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):!1}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(),n=e();return n||(this.restoreAtMark(t),null)}acceptOneKeyword(e){if(p.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):!1}acceptIdent(e){return this.peekIdent(e)?(this.consumeToken(),!0):!1}acceptKeyword(e){return this.peekKeyword(e)?(this.consumeToken(),!0):!1}acceptDelim(e){return this.peekDelim(e)?(this.consumeToken(),!0):!1}acceptRegexp(e){return e.test(this.token.text)?(this.consumeToken(),!0):!1}_parseRegexp(e){let t=this.createNode(b.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&&e.indexOf(this.token.type)!==-1)return this.consumeToken(),!0;if(t&&t.indexOf(this.token.type)!==-1)return!0;if(this.token.type===p.EOF)return!1;this.token=this.scanner.scan()}}createNode(e){return new O(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 ye)&&(t&&this.markError(e,t,n,r),this.prevToken)){const i=this.prevToken.offset+this.prevToken.len;e.length=i>e.offset?i-e.offset:0}return e}markError(e,t,n,r){this.token!==this.lastErrorToken&&(e.addIssue(new xl(e,t,Re.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(),r=(i,s)=>{if(e.version!==t)throw new Error("Underlying model has changed, AST is no longer valid");return n.substr(i,s)};return this.internalParse(n,this._parseStylesheet,r)}internalParse(e,t,n){this.scanner.setSource(e),this.token=this.scanner.scan();const r=t.bind(this)();return r&&(n?r.textProvider=n:r.textProvider=(i,s)=>e.substr(i,s)),r}_parseStylesheet(){const e=this.create(gp);for(;e.addChild(this._parseStylesheetStart()););let t=!1;do{let n=!1;do{n=!1;const r=this._parseStylesheetStatement();for(r&&(e.addChild(r),n=!0,t=!1,!this.peek(p.EOF)&&this._needsSemicolonAfter(r)&&!this.accept(p.SemiColon)&&this.markError(e,y.SemiColonExpected));this.accept(p.SemiColon)||this.accept(p.CDO)||this.accept(p.CDC);)n=!0,t=!1}while(n);if(this.peek(p.EOF))break;t||(this.peek(p.AtKeyword)?this.markError(e,y.UnknownAtRule):this.markError(e,y.RuleOrSelectorExpected),t=!0),this.consumeToken()}while(!this.peek(p.EOF));return this.finish(e)}_parseStylesheetStart(){return this._parseCharset()}_parseStylesheetStatement(e=!1){return this.peek(p.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(p.Comma)&&this._parseSelector(e););if(this.accept(p.CurlyL))return this.restoreAtMark(t),this._parseRuleset(e)}return this.restoreAtMark(t),null}_parseRuleset(e=!1){const t=this.create(Et),n=t.getSelectors();if(!n.addChild(this._parseSelector(e)))return null;for(;this.accept(p.Comma);)if(!n.addChild(this._parseSelector(e)))return this.finish(t,y.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(p.AtKeyword)?this._parseRuleSetDeclarationAtStatement():this.peek(p.Ident)?this._tryParseRuleset(!0)||this._parseDeclaration():this._parseRuleset(!0)}_needsSemicolonAfter(e){switch(e.type){case b.Keyframe:case b.ViewPort:case b.Media:case b.Ruleset:case b.Namespace:case b.If:case b.For:case b.Each:case b.While:case b.MixinDeclaration:case b.FunctionDeclaration:case b.MixinContentDeclaration:return!1;case b.ExtendsReference:case b.MixinContentReference:case b.ReturnStatement:case b.MediaQuery:case b.Debug:case b.Import:case b.AtApplyRule:case b.CustomPropertyDeclaration:return!0;case b.VariableDeclaration:return e.needsSemicolon;case b.MixinReference:return!e.getContent();case b.Declaration:return!e.getNestedProperties()}return!1}_parseDeclarations(e){const t=this.create(Di);if(!this.accept(p.CurlyL))return null;let n=e();for(;t.addChild(n)&&!this.peek(p.CurlyR);){if(this._needsSemicolonAfter(n)&&!this.accept(p.SemiColon))return this.finish(t,y.SemiColonExpected,[p.SemiColon,p.CurlyR]);for(n&&this.prevToken&&this.prevToken.type===p.SemiColon&&(n.semicolonPosition=this.prevToken.offset);this.accept(p.SemiColon););n=e()}return this.accept(p.CurlyR)?this.finish(t):this.finish(t,y.RightCurlyExpected,[p.CurlyR,p.SemiColon])}_parseBody(e,t){return e.setDeclarations(this._parseDeclarations(t))?this.finish(e):this.finish(e,y.LeftCurlyExpected,[p.CurlyR,p.SemiColon])}_parseSelector(e){const t=this.create(Sn);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(qe);return n.setProperty(this._parseProperty())?this.accept(p.Colon)?(this.prevToken&&(n.colonPosition=this.prevToken.offset),n.setValue(this._parseExpr())?(n.addChild(this._parsePrio()),this.peek(p.SemiColon)&&(n.semicolonPosition=this.token.offset),this.finish(n)):this.finish(n,y.PropertyValueExpected)):this.finish(n,y.ColonExpected,[p.Colon],e||[p.SemiColon]):null}_tryParseCustomPropertyDeclaration(e){if(!this.peekRegExp(p.Ident,/^--/))return null;const t=this.create(vp);if(!t.setProperty(this._parseProperty()))return null;if(!this.accept(p.Colon))return this.finish(t,y.ColonExpected,[p.Colon]);this.prevToken&&(t.colonPosition=this.prevToken.offset);const n=this.mark();if(this.peek(p.CurlyL)){const i=this.create(bp),s=this._parseDeclarations(this._parseRuleSetDeclaration.bind(this));if(i.setDeclarations(s)&&!s.isErroneous(!0)&&(i.addChild(this._parsePrio()),this.peek(p.SemiColon)))return this.finish(i),t.setPropertySet(i),t.semicolonPosition=this.token.offset,this.finish(t);this.restoreAtMark(n)}const r=this._parseExpr();return r&&!r.isErroneous(!0)&&(this._parsePrio(),this.peekOne(...e||[],p.SemiColon,p.EOF))?(t.setValue(r),this.peek(p.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)):(this.restoreAtMark(n),t.addChild(this._parseCustomPropertyValue(e)),t.addChild(this._parsePrio()),Le(t.colonPosition)&&this.token.offset===t.colonPosition+1?this.finish(t,y.PropertyValueExpected):this.finish(t))}_parseCustomPropertyValue(e=[p.CurlyR]){const t=this.create(O),n=()=>i===0&&s===0&&a===0,r=()=>e.indexOf(this.token.type)!==-1;let i=0,s=0,a=0;e:for(;;){switch(this.token.type){case p.SemiColon:if(n())break e;break;case p.Exclamation:if(n())break e;break;case p.CurlyL:i++;break;case p.CurlyR:if(i--,i<0){if(r()&&s===0&&a===0)break e;return this.finish(t,y.LeftCurlyExpected)}break;case p.ParenthesisL:s++;break;case p.ParenthesisR:if(s--,s<0){if(r()&&a===0&&i===0)break e;return this.finish(t,y.LeftParenthesisExpected)}break;case p.BracketL:a++;break;case p.BracketR:if(a--,a<0)return this.finish(t,y.LeftSquareBracketExpected);break;case p.BadString:break e;case p.EOF:let l=y.RightCurlyExpected;return a>0?l=y.RightSquareBracketExpected:s>0&&(l=y.RightParenthesisExpected),this.finish(t,l)}this.consumeToken()}return this.finish(t)}_tryToParseDeclaration(e){const t=this.mark();return this._parseProperty()&&this.accept(p.Colon)?(this.restoreAtMark(t),this._parseDeclaration(e)):(this.restoreAtMark(t),null)}_parseProperty(){const e=this.create(Mi),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(p.Charset))return null;const e=this.create(O);return this.consumeToken(),this.accept(p.String)?this.accept(p.SemiColon)?this.finish(e):this.finish(e,y.SemiColonExpected):this.finish(e,y.IdentifierExpected)}_parseImport(){if(!this.peekKeyword("@import"))return null;const e=this.create(Ai);return this.consumeToken(),!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral())?this.finish(e,y.URIOrStringExpected):this._completeParseImport(e)}_completeParseImport(e){if(this.acceptIdent("layer")&&this.accept(p.ParenthesisL)){if(!e.addChild(this._parseLayerName()))return this.finish(e,y.IdentifierExpected,[p.SemiColon]);if(!this.accept(p.ParenthesisR))return this.finish(e,y.RightParenthesisExpected,[p.ParenthesisR],[])}return this.acceptIdent("supports")&&this.accept(p.ParenthesisL)&&(e.addChild(this._tryToParseDeclaration()||this._parseSupportsCondition()),!this.accept(p.ParenthesisR))?this.finish(e,y.RightParenthesisExpected,[p.ParenthesisR],[]):(!this.peek(p.SemiColon)&&!this.peek(p.EOF)&&e.setMedialist(this._parseMediaQueryList()),this.finish(e))}_parseNamespace(){if(!this.peekKeyword("@namespace"))return null;const e=this.create(Dp);return this.consumeToken(),!e.addChild(this._parseURILiteral())&&(e.addChild(this._parseIdent()),!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))?this.finish(e,y.URIExpected,[p.SemiColon]):this.accept(p.SemiColon)?this.finish(e):this.finish(e,y.SemiColonExpected)}_parseFontFace(){if(!this.peekKeyword("@font-face"))return null;const e=this.create(ul);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(_p);return this.consumeToken(),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseKeyframe(){if(!this.peekRegExp(p.AtKeyword,this.keyframeRegex))return null;const e=this.create(ml),t=this.create(O);return this.consumeToken(),e.setKeyword(this.finish(t)),t.matches("@-ms-keyframes")&&this.markError(t,y.UnknownKeyword),e.setIdentifier(this._parseKeyframeIdent())?this._parseBody(e,this._parseKeyframeSelector.bind(this)):this.finish(e,y.IdentifierExpected,[p.CurlyR])}_parseKeyframeIdent(){return this._parseIdent([J.Keyframe])}_parseKeyframeSelector(){const e=this.create(fl);let t=!1;if(e.addChild(this._parseIdent())&&(t=!0),this.accept(p.Percentage)&&(t=!0),!t)return null;for(;this.accept(p.Comma);)if(t=!1,e.addChild(this._parseIdent())&&(t=!0),this.accept(p.Percentage)&&(t=!0),!t)return this.finish(e,y.PercentageExpected);return this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_tryParseKeyframeSelector(){const e=this.create(fl),t=this.mark();let n=!1;if(e.addChild(this._parseIdent())&&(n=!0),this.accept(p.Percentage)&&(n=!0),!n)return null;for(;this.accept(p.Comma);)if(n=!1,e.addChild(this._parseIdent())&&(n=!0),this.accept(p.Percentage)&&(n=!0),!n)return this.restoreAtMark(t),null;return this.peek(p.CurlyL)?this._parseBody(e,this._parseRuleSetDeclaration.bind(this)):(this.restoreAtMark(t),null)}_parsePropertyAtRule(){if(!this.peekKeyword("@property"))return null;const e=this.create(Mp);return this.consumeToken(),!this.peekRegExp(p.Ident,/^--/)||!e.setName(this._parseIdent([J.Property]))?this.finish(e,y.IdentifierExpected):this._parseBody(e,this._parseDeclaration.bind(this))}_parseLayer(e=!1){if(!this.peekKeyword("@layer"))return null;const t=this.create(Ip);this.consumeToken();const n=this._parseLayerNameList();return n&&t.setNames(n),(!n||n.getChildren().length===1)&&this.peek(p.CurlyL)?this._parseBody(t,this._parseLayerDeclaration.bind(this,e)):this.accept(p.SemiColon)?this.finish(t):this.finish(t,y.SemiColonExpected)}_parseLayerDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseLayerNameList(){const e=this.createNode(b.LayerNameList);if(!e.addChild(this._parseLayerName()))return null;for(;this.accept(p.Comma);)if(!e.addChild(this._parseLayerName()))return this.finish(e,y.IdentifierExpected);return this.finish(e)}_parseLayerName(){const e=this.createNode(b.LayerName);if(!e.addChild(this._parseIdent()))return null;for(;!this.hasWhitespace()&&this.acceptDelim(".");)if(this.hasWhitespace()||!e.addChild(this._parseIdent()))return this.finish(e,y.IdentifierExpected);return this.finish(e)}_parseSupports(e=!1){if(!this.peekKeyword("@supports"))return null;const t=this.create(zi);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(kn);if(this.acceptIdent("not"))e.addChild(this._parseSupportsConditionInParens());else if(e.addChild(this._parseSupportsConditionInParens()),this.peekRegExp(p.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(kn);if(this.accept(p.ParenthesisL))return this.prevToken&&(e.lParent=this.prevToken.offset),!e.addChild(this._tryToParseDeclaration([p.ParenthesisR]))&&!this._parseSupportsCondition()?this.finish(e,y.ConditionExpected):this.accept(p.ParenthesisR)?(this.prevToken&&(e.rParent=this.prevToken.offset),this.finish(e)):this.finish(e,y.RightParenthesisExpected,[p.ParenthesisR],[]);if(this.peek(p.Ident)){const t=this.mark();if(this.consumeToken(),!this.hasWhitespace()&&this.accept(p.ParenthesisL)){let n=1;for(;this.token.type!==p.EOF&&n!==0;)this.token.type===p.ParenthesisL?n++:this.token.type===p.ParenthesisR&&n--,this.consumeToken();return this.finish(e)}else this.restoreAtMark(t)}return this.finish(e,y.LeftParenthesisExpected,[],[p.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(Li);return this.consumeToken(),t.addChild(this._parseMediaQueryList())?this._parseBody(t,this._parseMediaDeclaration.bind(this,e)):this.finish(t,y.MediaQueryExpected)}_parseMediaQueryList(){const e=this.create(gl);if(!e.addChild(this._parseMediaQuery()))return this.finish(e,y.MediaQueryExpected);for(;this.accept(p.Comma);)if(!e.addChild(this._parseMediaQuery()))return this.finish(e,y.MediaQueryExpected);return this.finish(e)}_parseMediaQuery(){const e=this.create(bl),t=this.mark();if(this.acceptIdent("not"),this.peek(p.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(Vp);return this._parseNumeric()?this.acceptDelim("/")?this._parseNumeric()?this.finish(t):this.finish(t,y.NumberExpected):(this.restoreAtMark(e),null):null}_parseMediaCondition(){const e=this.create(zp);this.acceptIdent("not");let t=!0;for(;t;){if(!this.accept(p.ParenthesisL))return this.finish(e,y.LeftParenthesisExpected,[],[p.CurlyL]);if(this.peek(p.ParenthesisL)||this.peekIdent("not")?e.addChild(this._parseMediaCondition()):e.addChild(this._parseMediaFeature()),!this.accept(p.ParenthesisR))return this.finish(e,y.RightParenthesisExpected,[],[p.CurlyL]);t=this.acceptIdent("and")||this.acceptIdent("or")}return this.finish(e)}_parseMediaFeature(){const e=[p.ParenthesisR],t=this.create(Pp);if(t.addChild(this._parseMediaFeatureName())){if(this.accept(p.Colon)){if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,y.TermExpected,[],e)}else if(this._parseMediaFeatureRangeOperator()){if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,y.TermExpected,[],e);if(this._parseMediaFeatureRangeOperator()&&!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,y.TermExpected,[],e)}}else if(t.addChild(this._parseMediaFeatureValue())){if(!this._parseMediaFeatureRangeOperator())return this.finish(t,y.OperatorExpected,[],e);if(!t.addChild(this._parseMediaFeatureName()))return this.finish(t,y.IdentifierExpected,[],e);if(this._parseMediaFeatureRangeOperator()&&!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,y.TermExpected,[],e)}else return this.finish(t,y.IdentifierExpected,[],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(O);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(Tp);if(this.consumeToken(),e.addChild(this._parsePageSelector())){for(;this.accept(p.Comma);)if(!e.addChild(this._parsePageSelector()))return this.finish(e,y.IdentifierExpected)}return this._parseBody(e,this._parsePageDeclaration.bind(this))}_parsePageMarginBox(){if(!this.peek(p.AtKeyword))return null;const e=this.create(Op);return this.acceptOneKeyword(vm)||this.markError(e,y.UnknownAtRule,[],[p.CurlyL]),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parsePageSelector(){if(!this.peek(p.Ident)&&!this.peek(p.Colon))return null;const e=this.create(O);return e.addChild(this._parseIdent()),this.accept(p.Colon)&&!e.addChild(this._parseIdent())?this.finish(e,y.IdentifierExpected):this.finish(e)}_parseDocument(){if(!this.peekKeyword("@-moz-document"))return null;const e=this.create(Ap);return this.consumeToken(),this.resync([],[p.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(Lp);return this.consumeToken(),t.addChild(this._parseIdent()),t.addChild(this._parseContainerQuery()),this._parseBody(t,this._parseContainerDeclaration.bind(this,e))}_parseContainerQuery(){const e=this.create(O);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(O);if(this.accept(p.ParenthesisL)){if(this.peekIdent("not")||this.peek(p.ParenthesisL)?e.addChild(this._parseContainerQuery()):e.addChild(this._parseMediaFeature()),!this.accept(p.ParenthesisR))return this.finish(e,y.RightParenthesisExpected,[],[p.CurlyL])}else if(this.acceptIdent("style")){if(this.hasWhitespace()||!this.accept(p.ParenthesisL))return this.finish(e,y.LeftParenthesisExpected,[],[p.CurlyL]);if(e.addChild(this._parseStyleQuery()),!this.accept(p.ParenthesisR))return this.finish(e,y.RightParenthesisExpected,[],[p.CurlyL])}else return this.finish(e,y.LeftParenthesisExpected,[],[p.CurlyL]);return this.finish(e)}_parseStyleQuery(){const e=this.create(O);if(this.acceptIdent("not"))e.addChild(this._parseStyleInParens());else if(this.peek(p.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([p.ParenthesisR]));return this.finish(e)}_parseStyleInParens(){const e=this.create(O);if(this.accept(p.ParenthesisL)){if(e.addChild(this._parseStyleQuery()),!this.accept(p.ParenthesisR))return this.finish(e,y.RightParenthesisExpected,[],[p.CurlyL])}else return this.finish(e,y.LeftParenthesisExpected,[],[p.CurlyL]);return this.finish(e)}_parseUnknownAtRule(){if(!this.peek(p.AtKeyword))return null;const e=this.create(wl);e.addChild(this._parseUnknownAtRuleName());const t=()=>r===0&&i===0&&s===0;let n=0,r=0,i=0,s=0;e:for(;;){switch(this.token.type){case p.SemiColon:if(t())break e;break;case p.EOF:return r>0?this.finish(e,y.RightCurlyExpected):s>0?this.finish(e,y.RightSquareBracketExpected):i>0?this.finish(e,y.RightParenthesisExpected):this.finish(e);case p.CurlyL:n++,r++;break;case p.CurlyR:if(r--,n>0&&r===0){if(this.consumeToken(),s>0)return this.finish(e,y.RightSquareBracketExpected);if(i>0)return this.finish(e,y.RightParenthesisExpected);break e}if(r<0){if(i===0&&s===0)break e;return this.finish(e,y.LeftCurlyExpected)}break;case p.ParenthesisL:i++;break;case p.ParenthesisR:if(i--,i<0)return this.finish(e,y.LeftParenthesisExpected);break;case p.BracketL:s++;break;case p.BracketR:if(s--,s<0)return this.finish(e,y.LeftSquareBracketExpected);break}this.consumeToken()}return e}_parseUnknownAtRuleName(){const e=this.create(O);return this.accept(p.AtKeyword)?this.finish(e):e}_parseOperator(){if(this.peekDelim("/")||this.peekDelim("*")||this.peekDelim("+")||this.peekDelim("-")||this.peek(p.Dashmatch)||this.peek(p.Includes)||this.peek(p.SubstringOperator)||this.peek(p.PrefixOperator)||this.peek(p.SuffixOperator)||this.peekDelim("=")){const e=this.createNode(b.Operator);return this.consumeToken(),this.finish(e)}else return null}_parseUnaryOperator(){if(!this.peekDelim("+")&&!this.peekDelim("-"))return null;const e=this.create(O);return this.consumeToken(),this.finish(e)}_parseCombinator(){if(this.peekDelim(">")){const e=this.create(O);this.consumeToken();const t=this.mark();if(!this.hasWhitespace()&&this.acceptDelim(">")){if(!this.hasWhitespace()&&this.acceptDelim(">"))return e.type=b.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(t)}return e.type=b.SelectorCombinatorParent,this.finish(e)}else if(this.peekDelim("+")){const e=this.create(O);return this.consumeToken(),e.type=b.SelectorCombinatorSibling,this.finish(e)}else if(this.peekDelim("~")){const e=this.create(O);return this.consumeToken(),e.type=b.SelectorCombinatorAllSiblings,this.finish(e)}else if(this.peekDelim("/")){const e=this.create(O);this.consumeToken();const t=this.mark();if(!this.hasWhitespace()&&this.acceptIdent("deep")&&!this.hasWhitespace()&&this.acceptDelim("/"))return e.type=b.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(t)}return null}_parseSimpleSelector(){const e=this.create(Jt);let t=0;for(e.addChild(this._parseElementName()||this._parseNestingSelector())&&t++;(t===0||!this.hasWhitespace())&&e.addChild(this._parseSimpleSelectorBody());)t++;return t>0?this.finish(e):null}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(b.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(p.Hash)&&!this.peekDelim("#"))return null;const e=this.createNode(b.IdentifierSelector);if(this.acceptDelim("#")){if(this.hasWhitespace()||!e.addChild(this._parseSelectorIdent()))return this.finish(e,y.IdentifierExpected)}else this.consumeToken();return this.finish(e)}_parseClass(){if(!this.peekDelim("."))return null;const e=this.createNode(b.ClassSelector);return this.consumeToken(),this.hasWhitespace()||!e.addChild(this._parseSelectorIdent())?this.finish(e,y.IdentifierExpected):this.finish(e)}_parseElementName(){const e=this.mark(),t=this.createNode(b.ElementNameSelector);return t.addChild(this._parseNamespacePrefix()),!t.addChild(this._parseSelectorIdent())&&!this.acceptDelim("*")?(this.restoreAtMark(e),null):this.finish(t)}_parseNamespacePrefix(){const e=this.mark(),t=this.createNode(b.NamespacePrefix);return!t.addChild(this._parseIdent())&&this.acceptDelim("*"),this.acceptDelim("|")?this.finish(t):(this.restoreAtMark(e),null)}_parseAttrib(){if(!this.peek(p.BracketL))return null;const e=this.create(Up);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(p.BracketR)?this.finish(e):this.finish(e,y.RightSquareBracketExpected)):this.finish(e,y.IdentifierExpected)}_parsePseudo(){const e=this._tryParsePseudoIdentifier();if(e){if(!this.hasWhitespace()&&this.accept(p.ParenthesisL)){const t=()=>{const r=this.create(O);if(!r.addChild(this._parseSelector(!0)))return null;for(;this.accept(p.Comma)&&r.addChild(this._parseSelector(!0)););return this.peek(p.ParenthesisR)?this.finish(r):null};if(!e.addChild(this.try(t))&&e.addChild(this._parseBinaryExpr())&&this.acceptIdent("of")&&!e.addChild(this.try(t)))return this.finish(e,y.SelectorExpected);if(!this.accept(p.ParenthesisR))return this.finish(e,y.RightParenthesisExpected)}return this.finish(e)}return null}_tryParsePseudoIdentifier(){if(!this.peek(p.Colon))return null;const e=this.mark(),t=this.createNode(b.PseudoSelector);return this.consumeToken(),this.hasWhitespace()?(this.restoreAtMark(e),null):(this.accept(p.Colon),this.hasWhitespace()||!t.addChild(this._parseIdent())?this.finish(t,y.IdentifierExpected):this.finish(t))}_tryParsePrio(){const e=this.mark(),t=this._parsePrio();return t||(this.restoreAtMark(e),null)}_parsePrio(){if(!this.peek(p.Exclamation))return null;const e=this.createNode(b.Prio);return this.accept(p.Exclamation)&&this.acceptIdent("important")?this.finish(e):null}_parseExpr(e=!1){const t=this.create(vl);if(!t.addChild(this._parseBinaryExpr()))return null;for(;;){if(this.peek(p.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(fp);return this.acceptUnicodeRange()?this.finish(e):null}_parseNamedLine(){if(!this.peek(p.BracketL))return null;const e=this.createNode(b.GridLine);for(this.consumeToken();e.addChild(this._parseIdent()););return this.accept(p.BracketR)?this.finish(e):this.finish(e,y.RightSquareBracketExpected)}_parseBinaryExpr(e,t){let n=this.create(Pi);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,y.TermExpected);n=this.finish(n);const r=this._parseOperator();return r&&(n=this._parseBinaryExpr(n,r)),this.finish(n)}_parseTerm(){let e=this.create(Wp);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(p.ParenthesisL))return null;const e=this.create(O);return this.consumeToken(),e.addChild(this._parseExpr()),this.accept(p.ParenthesisR)?this.finish(e):this.finish(e,y.RightParenthesisExpected)}_parseNumeric(){if(this.peek(p.Num)||this.peek(p.Percentage)||this.peek(p.Resolution)||this.peek(p.Length)||this.peek(p.EMS)||this.peek(p.EXS)||this.peek(p.Angle)||this.peek(p.Time)||this.peek(p.Dimension)||this.peek(p.ContainerQueryLength)||this.peek(p.Freq)){const e=this.create(Oi);return this.consumeToken(),this.finish(e)}return null}_parseStringLiteral(){if(!this.peek(p.String)&&!this.peek(p.BadString))return null;const e=this.createNode(b.StringLiteral);return this.consumeToken(),this.finish(e)}_parseURILiteral(){if(!this.peekRegExp(p.Ident,/^url(-prefix)?$/i))return null;const e=this.mark(),t=this.createNode(b.URILiteral);return this.accept(p.Ident),this.hasWhitespace()||!this.peek(p.ParenthesisL)?(this.restoreAtMark(e),null):(this.scanner.inURL=!0,this.consumeToken(),t.addChild(this._parseURLArgument()),this.scanner.inURL=!1,this.accept(p.ParenthesisR)?this.finish(t):this.finish(t,y.RightParenthesisExpected))}_parseURLArgument(){const e=this.create(O);return!this.accept(p.String)&&!this.accept(p.BadString)&&!this.acceptUnquotedString()?null:this.finish(e)}_parseIdent(e){if(!this.peek(p.Ident))return null;const t=this.create(Ae);return e&&(t.referenceTypes=e),t.isCustomProperty=this.peekRegExp(p.Ident,/^--/),this.consumeToken(),this.finish(t)}_parseFunction(){const e=this.mark(),t=this.create(Cn);if(!t.setIdentifier(this._parseFunctionIdentifier()))return null;if(this.hasWhitespace()||!this.accept(p.ParenthesisL))return this.restoreAtMark(e),null;if(t.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(p.Comma)&&!this.peek(p.ParenthesisR);)t.getArguments().addChild(this._parseFunctionArgument())||this.markError(t,y.ExpressionExpected);return this.accept(p.ParenthesisR)?this.finish(t):this.finish(t,y.RightParenthesisExpected)}_parseFunctionIdentifier(){if(!this.peek(p.Ident))return null;const e=this.create(Ae);if(e.referenceTypes=[J.Function],this.acceptIdent("progid")){if(this.accept(p.Colon))for(;this.accept(p.Ident)&&this.acceptDelim("."););return this.finish(e)}return this.consumeToken(),this.finish(e)}_parseFunctionArgument(){const e=this.create(Xt);return e.setValue(this._parseExpr(!0))?this.finish(e):null}_parseHexColor(){if(this.peekRegExp(p.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(Ti);return this.consumeToken(),this.finish(e)}else return null}};function wm(e,t){let n=0,r=e.length;if(r===0)return 0;for(;n<r;){let i=Math.floor((n+r)/2);t(e[i])?r=i:n=i+1}return n}function Tc(e,t){return e.indexOf(t)!==-1}function Sr(...e){const t=[];for(const n of e)for(const r of n)Tc(t,r)||t.push(r);return t}var Oc=class{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=wm(this.children,s=>s.offset>n);if(r===0)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<this.symbols.length;n++){const r=this.symbols[n];if(r.name===e&&r.type===t)return r}return null}getSymbols(){return this.symbols}},ym=class extends Oc{constructor(){super(0,Number.MAX_VALUE)}},Cr=class{constructor(e,t,n,r){this.name=e,this.value=t,this.node=n,this.type=r}},xm=class{constructor(e){this.scope=e}addSymbol(e,t,n,r){if(e.offset!==-1){const i=this.scope.findScope(e.offset,e.length);i&&i.addSymbol(new Cr(t,n,e,r))}}addScope(e){if(e.offset!==-1){const t=this.scope.findScope(e.offset,e.length);if(t&&(t.offset!==e.offset||t.length!==e.length)){const n=new Oc(e.offset,e.length);return t.addChild(n),n}return t}return null}addSymbolToChildScope(e,t,n,r,i){if(e&&e.offset!==-1){const s=this.addScope(e);s&&s.addSymbol(new Cr(n,r,t,i))}}visitNode(e){switch(e.type){case b.Keyframe:return this.addSymbol(e,e.getName(),void 0,J.Keyframe),!0;case b.CustomPropertyDeclaration:return this.visitCustomPropertyDeclarationNode(e);case b.VariableDeclaration:return this.visitVariableDeclarationNode(e);case b.Ruleset:return this.visitRuleSet(e);case b.MixinDeclaration:return this.addSymbol(e,e.getName(),void 0,J.Mixin),!0;case b.FunctionDeclaration:return this.addSymbol(e,e.getName(),void 0,J.Function),!0;case b.FunctionParameter:return this.visitFunctionParameterNode(e);case b.Declarations:return this.addScope(e),!0;case b.For:const t=e,n=t.getDeclarations();return n&&t.variable&&this.addSymbolToChildScope(n,t.variable,t.variable.getName(),void 0,J.Variable),!0;case b.Each:{const r=e,i=r.getDeclarations();if(i){const s=r.getVariables().getChildren();for(const a of s)this.addSymbolToChildScope(i,a,a.getName(),void 0,J.Variable)}return!0}}return!0}visitRuleSet(e){const t=this.scope.findScope(e.offset,e.length);if(t)for(const n of e.getSelectors().getChildren())n instanceof Sn&&n.getChildren().length===1&&t.addSymbol(new Cr(n.getChild(0).getText(),void 0,n,J.Rule));return!0}visitVariableDeclarationNode(e){const t=e.getValue()?e.getValue().getText():void 0;return this.addSymbol(e,e.getName(),t,J.Variable),!0}visitFunctionParameterNode(e){const t=e.getParent().getDeclarations();if(t){const n=e.getDefaultValue(),r=n?n.getText():void 0;this.addSymbolToChildScope(t,e,e.getName(),r,J.Variable)}return!0}visitCustomPropertyDeclarationNode(e){const t=e.getValue()?e.getValue().getText():"";return this.addCSSVariable(e.getProperty(),e.getProperty().getName(),t,J.Variable),!0}addCSSVariable(e,t,n,r){e.offset!==-1&&this.scope.addSymbol(new Cr(t,n,e,r))}},is=class{constructor(e){this.global=new ym,e.acceptVisitor(new xm(this.global))}findSymbolsAtOffset(e,t){let n=this.global.findScope(e,0);const r=[],i={};for(;n;){const s=n.getSymbols();for(let a=0;a<s.length;a++){const l=s[a];l.type===t&&!i[l.name]&&(r.push(l),i[l.name]=!0)}n=n.parent}return r}internalFindSymbol(e,t){let n=e;if(e.parent instanceof ar&&e.parent.getParent()instanceof se&&(n=e.parent.getParent().getDeclarations()),e.parent instanceof Xt&&e.parent.getParent()instanceof Cn){const s=e.parent.getParent().getIdentifier();if(s){const a=this.internalFindSymbol(s,[J.Function]);a&&(n=a.node.getDeclarations())}}if(!n)return null;const r=e.getText();let i=this.global.findScope(n.offset,n.length);for(;i;){for(let s=0;s<t.length;s++){const a=t[s],l=i.getSymbol(r,a);if(l)return l}i=i.parent}return null}evaluateReferenceTypes(e){if(e instanceof Ae){const n=e.referenceTypes;if(n)return n;{if(e.isCustomProperty)return[J.Variable];const r=mp(e);if(r){const i=r.getNonPrefixedPropertyName();if((i==="animation"||i==="animation-name")&&r.getValue()&&r.getValue().offset===e.offset)return[J.Keyframe]}}}else if(e instanceof Ui)return[J.Variable];return e.findAParent(b.Selector,b.ExtendsReference)?[J.Rule]:null}findSymbolFromNode(e){if(!e)return null;for(;e.type===b.Interpolation;)e=e.getParent();const t=this.evaluateReferenceTypes(e);return t?this.internalFindSymbol(e,t):null}matchesSymbol(e,t){if(!e)return!1;for(;e.type===b.Interpolation;)e=e.getParent();if(!e.matches(t.name))return!1;const n=this.evaluateReferenceTypes(e);return!n||n.indexOf(t.type)===-1?!1:this.internalFindSymbol(e,n)===t}findSymbol(e,t,n){let r=this.global.findScope(n);for(;r;){const i=r.getSymbol(e,t);if(i)return i;r=r.parent}return null}},Wc;(()=>{var e={470:i=>{function s(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function a(o,c){for(var d,u="",f=0,m=-1,v=0,w=0;w<=o.length;++w){if(w<o.length)d=o.charCodeAt(w);else{if(d===47)break;d=47}if(d===47){if(!(m===w-1||v===1))if(m!==w-1&&v===2){if(u.length<2||f!==2||u.charCodeAt(u.length-1)!==46||u.charCodeAt(u.length-2)!==46){if(u.length>2){var _=u.lastIndexOf("/");if(_!==u.length-1){_===-1?(u="",f=0):f=(u=u.slice(0,_)).length-1-u.lastIndexOf("/"),m=w,v=0;continue}}else if(u.length===2||u.length===1){u="",f=0,m=w,v=0;continue}}c&&(u.length>0?u+="/..":u="..",f=2)}else u.length>0?u+="/"+o.slice(m+1,w):u=o.slice(m+1,w),f=w-m-1;m=w,v=0}else d===46&&v!==-1?++v:v=-1}return u}var l={resolve:function(){for(var o,c="",d=!1,u=arguments.length-1;u>=-1&&!d;u--){var f;u>=0?f=arguments[u]:(o===void 0&&(o=process.cwd()),f=o),s(f),f.length!==0&&(c=f+"/"+c,d=f.charCodeAt(0)===47)}return c=a(c,!d),d?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(o){if(s(o),o.length===0)return".";var c=o.charCodeAt(0)===47,d=o.charCodeAt(o.length-1)===47;return(o=a(o,!c)).length!==0||c||(o="."),o.length>0&&d&&(o+="/"),c?"/"+o:o},isAbsolute:function(o){return s(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,c=0;c<arguments.length;++c){var d=arguments[c];s(d),d.length>0&&(o===void 0?o=d:o+="/"+d)}return o===void 0?".":l.normalize(o)},relative:function(o,c){if(s(o),s(c),o===c||(o=l.resolve(o))===(c=l.resolve(c)))return"";for(var d=1;d<o.length&&o.charCodeAt(d)===47;++d);for(var u=o.length,f=u-d,m=1;m<c.length&&c.charCodeAt(m)===47;++m);for(var v=c.length-m,w=f<v?f:v,_=-1,R=0;R<=w;++R){if(R===w){if(v>w){if(c.charCodeAt(m+R)===47)return c.slice(m+R+1);if(R===0)return c.slice(m+R)}else f>w&&(o.charCodeAt(d+R)===47?_=R:R===0&&(_=0));break}var I=o.charCodeAt(d+R);if(I!==c.charCodeAt(m+R))break;I===47&&(_=R)}var N="";for(R=d+_+1;R<=u;++R)R!==u&&o.charCodeAt(R)!==47||(N.length===0?N+="..":N+="/..");return N.length>0?N+c.slice(m+_):(m+=_,c.charCodeAt(m)===47&&++m,c.slice(m))},_makeLong:function(o){return o},dirname:function(o){if(s(o),o.length===0)return".";for(var c=o.charCodeAt(0),d=c===47,u=-1,f=!0,m=o.length-1;m>=1;--m)if((c=o.charCodeAt(m))===47){if(!f){u=m;break}}else f=!1;return u===-1?d?"/":".":d&&u===1?"//":o.slice(0,u)},basename:function(o,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(o);var d,u=0,f=-1,m=!0;if(c!==void 0&&c.length>0&&c.length<=o.length){if(c.length===o.length&&c===o)return"";var v=c.length-1,w=-1;for(d=o.length-1;d>=0;--d){var _=o.charCodeAt(d);if(_===47){if(!m){u=d+1;break}}else w===-1&&(m=!1,w=d+1),v>=0&&(_===c.charCodeAt(v)?--v==-1&&(f=d):(v=-1,f=w))}return u===f?f=w:f===-1&&(f=o.length),o.slice(u,f)}for(d=o.length-1;d>=0;--d)if(o.charCodeAt(d)===47){if(!m){u=d+1;break}}else f===-1&&(m=!1,f=d+1);return f===-1?"":o.slice(u,f)},extname:function(o){s(o);for(var c=-1,d=0,u=-1,f=!0,m=0,v=o.length-1;v>=0;--v){var w=o.charCodeAt(v);if(w!==47)u===-1&&(f=!1,u=v+1),w===46?c===-1?c=v:m!==1&&(m=1):c!==-1&&(m=-1);else if(!f){d=v+1;break}}return c===-1||u===-1||m===0||m===1&&c===u-1&&c===d+1?"":o.slice(c,u)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return function(c,d){var u=d.dir||d.root,f=d.base||(d.name||"")+(d.ext||"");return u?u===d.root?u+f:u+"/"+f:f}(0,o)},parse:function(o){s(o);var c={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return c;var d,u=o.charCodeAt(0),f=u===47;f?(c.root="/",d=1):d=0;for(var m=-1,v=0,w=-1,_=!0,R=o.length-1,I=0;R>=d;--R)if((u=o.charCodeAt(R))!==47)w===-1&&(_=!1,w=R+1),u===46?m===-1?m=R:I!==1&&(I=1):m!==-1&&(I=-1);else if(!_){v=R+1;break}return m===-1||w===-1||I===0||I===1&&m===w-1&&m===v+1?w!==-1&&(c.base=c.name=v===0&&f?o.slice(1,w):o.slice(v,w)):(v===0&&f?(c.name=o.slice(1,m),c.base=o.slice(1,w)):(c.name=o.slice(v,m),c.base=o.slice(v,w)),c.ext=o.slice(m,w)),v>0?c.dir=o.slice(0,v-1):f&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};l.posix=l,i.exports=l}},t={};function n(i){var s=t[i];if(s!==void 0)return s.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.d=(i,s)=>{for(var a in s)n.o(s,a)&&!n.o(i,a)&&Object.defineProperty(i,a,{enumerable:!0,get:s[a]})},n.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),n.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var r={};(()=>{let i;n.r(r),n.d(r,{URI:()=>f,Utils:()=>ee}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\\w[\\w\\d+.-]*$/,a=/^\\//,l=/^\\/\\//;function o(M,k){if(!M.scheme&&k)throw new Error(\`[UriError]: Scheme is missing: {scheme: "", authority: "\${M.authority}", path: "\${M.path}", query: "\${M.query}", fragment: "\${M.fragment}"}\`);if(M.scheme&&!s.test(M.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(M.path){if(M.authority){if(!a.test(M.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(M.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const c="",d="/",u=/^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;class f{constructor(k,C,S,z,D,L=!1){Ct(this,"scheme");Ct(this,"authority");Ct(this,"path");Ct(this,"query");Ct(this,"fragment");typeof k=="object"?(this.scheme=k.scheme||c,this.authority=k.authority||c,this.path=k.path||c,this.query=k.query||c,this.fragment=k.fragment||c):(this.scheme=function(U,B){return U||B?U:"file"}(k,L),this.authority=C||c,this.path=function(U,B){switch(U){case"https":case"http":case"file":B?B[0]!==d&&(B=d+B):B=d}return B}(this.scheme,S||c),this.query=z||c,this.fragment=D||c,o(this,L))}static isUri(k){return k instanceof f||!!k&&typeof k.authority=="string"&&typeof k.fragment=="string"&&typeof k.path=="string"&&typeof k.query=="string"&&typeof k.scheme=="string"&&typeof k.fsPath=="string"&&typeof k.with=="function"&&typeof k.toString=="function"}get fsPath(){return I(this)}with(k){if(!k)return this;let{scheme:C,authority:S,path:z,query:D,fragment:L}=k;return C===void 0?C=this.scheme:C===null&&(C=c),S===void 0?S=this.authority:S===null&&(S=c),z===void 0?z=this.path:z===null&&(z=c),D===void 0?D=this.query:D===null&&(D=c),L===void 0?L=this.fragment:L===null&&(L=c),C===this.scheme&&S===this.authority&&z===this.path&&D===this.query&&L===this.fragment?this:new v(C,S,z,D,L)}static parse(k,C=!1){const S=u.exec(k);return S?new v(S[2]||c,A(S[4]||c),A(S[5]||c),A(S[7]||c),A(S[9]||c),C):new v(c,c,c,c,c)}static file(k){let C=c;if(i&&(k=k.replace(/\\\\/g,d)),k[0]===d&&k[1]===d){const S=k.indexOf(d,2);S===-1?(C=k.substring(2),k=d):(C=k.substring(2,S),k=k.substring(S)||d)}return new v("file",C,k,c,c)}static from(k){const C=new v(k.scheme,k.authority,k.path,k.query,k.fragment);return o(C,!0),C}toString(k=!1){return N(this,k)}toJSON(){return this}static revive(k){if(k){if(k instanceof f)return k;{const C=new v(k);return C._formatted=k.external,C._fsPath=k._sep===m?k.fsPath:null,C}}return k}}const m=i?1:void 0;class v extends f{constructor(){super(...arguments);Ct(this,"_formatted",null);Ct(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=I(this)),this._fsPath}toString(C=!1){return C?N(this,!0):(this._formatted||(this._formatted=N(this,!1)),this._formatted)}toJSON(){const C={$mid:1};return this._fsPath&&(C.fsPath=this._fsPath,C._sep=m),this._formatted&&(C.external=this._formatted),this.path&&(C.path=this.path),this.scheme&&(C.scheme=this.scheme),this.authority&&(C.authority=this.authority),this.query&&(C.query=this.query),this.fragment&&(C.fragment=this.fragment),C}}const w={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function _(M,k,C){let S,z=-1;for(let D=0;D<M.length;D++){const L=M.charCodeAt(D);if(L>=97&&L<=122||L>=65&&L<=90||L>=48&&L<=57||L===45||L===46||L===95||L===126||k&&L===47||C&&L===91||C&&L===93||C&&L===58)z!==-1&&(S+=encodeURIComponent(M.substring(z,D)),z=-1),S!==void 0&&(S+=M.charAt(D));else{S===void 0&&(S=M.substr(0,D));const U=w[L];U!==void 0?(z!==-1&&(S+=encodeURIComponent(M.substring(z,D)),z=-1),S+=U):z===-1&&(z=D)}}return z!==-1&&(S+=encodeURIComponent(M.substring(z))),S!==void 0?S:M}function R(M){let k;for(let C=0;C<M.length;C++){const S=M.charCodeAt(C);S===35||S===63?(k===void 0&&(k=M.substr(0,C)),k+=w[S]):k!==void 0&&(k+=M[C])}return k!==void 0?k:M}function I(M,k){let C;return C=M.authority&&M.path.length>1&&M.scheme==="file"?\`//\${M.authority}\${M.path}\`:M.path.charCodeAt(0)===47&&(M.path.charCodeAt(1)>=65&&M.path.charCodeAt(1)<=90||M.path.charCodeAt(1)>=97&&M.path.charCodeAt(1)<=122)&&M.path.charCodeAt(2)===58?M.path[1].toLowerCase()+M.path.substr(2):M.path,i&&(C=C.replace(/\\//g,"\\\\")),C}function N(M,k){const C=k?R:_;let S="",{scheme:z,authority:D,path:L,query:U,fragment:B}=M;if(z&&(S+=z,S+=":"),(D||z==="file")&&(S+=d,S+=d),D){let q=D.indexOf("@");if(q!==-1){const ae=D.substr(0,q);D=D.substr(q+1),q=ae.lastIndexOf(":"),q===-1?S+=C(ae,!1,!1):(S+=C(ae.substr(0,q),!1,!1),S+=":",S+=C(ae.substr(q+1),!1,!0)),S+="@"}D=D.toLowerCase(),q=D.lastIndexOf(":"),q===-1?S+=C(D,!1,!0):(S+=C(D.substr(0,q),!1,!0),S+=D.substr(q))}if(L){if(L.length>=3&&L.charCodeAt(0)===47&&L.charCodeAt(2)===58){const q=L.charCodeAt(1);q>=65&&q<=90&&(L=\`/\${String.fromCharCode(q+32)}:\${L.substr(3)}\`)}else if(L.length>=2&&L.charCodeAt(1)===58){const q=L.charCodeAt(0);q>=65&&q<=90&&(L=\`\${String.fromCharCode(q+32)}:\${L.substr(2)}\`)}S+=C(L,!0,!1)}return U&&(S+="?",S+=C(U,!1,!1)),B&&(S+="#",S+=k?B:_(B,!1,!1)),S}function E(M){try{return decodeURIComponent(M)}catch{return M.length>3?M.substr(0,3)+E(M.substr(3)):M}}const F=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function A(M){return M.match(F)?M.replace(F,k=>E(k)):M}var T=n(470);const P=T.posix||T,j="/";var ee;(function(M){M.joinPath=function(k,...C){return k.with({path:P.join(k.path,...C)})},M.resolvePath=function(k,...C){let S=k.path,z=!1;S[0]!==j&&(S=j+S,z=!0);let D=P.resolve(S,...C);return z&&D[0]===j&&!k.authority&&(D=D.substring(1)),k.with({path:D})},M.dirname=function(k){if(k.path.length===0||k.path===j)return k;let C=P.dirname(k.path);return C.length===1&&C.charCodeAt(0)===46&&(C=""),k.with({path:C})},M.basename=function(k){return P.basename(k.path)},M.extname=function(k){return P.extname(k.path)}})(ee||(ee={}))})(),Wc=r})();var{URI:ss,Utils:wt}=Wc;function as(e){return wt.dirname(ss.parse(e)).toString(!0)}function Kt(e,...t){return wt.joinPath(ss.parse(e),...t).toString(!0)}var Sm=class{constructor(e){this.readDirectory=e,this.literalCompletions=[],this.importCompletions=[]}onCssURILiteralValue(e){this.literalCompletions.push(e)}onCssImportPath(e){this.importCompletions.push(e)}async computeCompletions(e,t){const n={items:[],isIncomplete:!1};for(const r of this.literalCompletions){const i=r.uriValue,s=os(i);if(s==="."||s==="..")n.isIncomplete=!0;else{const a=await this.providePathSuggestions(i,r.position,r.range,e,t);for(let l of a)n.items.push(l)}}for(const r of this.importCompletions){const i=r.pathValue,s=os(i);if(s==="."||s==="..")n.isIncomplete=!0;else{let a=await this.providePathSuggestions(i,r.position,r.range,e,t);e.languageId==="scss"&&a.forEach(l=>{pe(l.label,"_")&&cl(l.label,".scss")&&(l.textEdit?l.textEdit.newText=l.label.slice(1,-5):l.label=l.label.slice(1,-5))});for(let l of a)n.items.push(l)}}return n}async providePathSuggestions(e,t,n,r,i){const s=os(e),a=pe(e,"'")||pe(e,'"'),l=a?s.slice(0,t.character-(n.start.character+1)):s.slice(0,t.character-n.start.character),o=r.uri,c=a?Em(n,1,-1):n,d=km(l,s,c),u=l.substring(0,l.lastIndexOf("/")+1);let f=i.resolveReference(u||".",o);if(f)try{const m=[],v=await this.readDirectory(f);for(const[w,_]of v)w.charCodeAt(0)!==Cm&&(_===Nn.Directory||Kt(f,w)!==o)&&m.push(_m(w,_===Nn.Directory,d));return m}catch{}return[]}},Cm=46;function os(e){return pe(e,"'")||pe(e,'"')?e.slice(1,-1):e}function km(e,t,n){let r;const i=e.lastIndexOf("/");if(i===-1)r=n;else{const s=t.slice(i+1),a=_r(n.end,-s.length),l=s.indexOf(" ");let o;l!==-1?o=_r(a,l):o=n.end,r=X.create(a,o)}return r}function _m(e,t,n){return t?(e=e+"/",{label:kr(e),kind:V.Folder,textEdit:$.replace(n,kr(e)),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}):{label:kr(e),kind:V.File,textEdit:$.replace(n,kr(e))}}function kr(e){return e.replace(/(\\s|\\(|\\)|,|"|')/g,"\\\\$1")}function _r(e,t){return xe.create(e.line,e.character+t)}function Em(e,t,n){const r=_r(e.start,t),i=_r(e.end,n);return X.create(r,i)}var rt=Ne.Snippet,Uc={title:"Suggest",command:"editor.action.triggerSuggest"},He;(function(e){e.Enums=" ",e.Normal="d",e.VendorPrefixed="x",e.Term="y",e.Variable="z"})(He||(He={}));var ls=class{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 is(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 s=new Sm(this.lsOptions.fileSystemProvider.readDirectory),a=this.completionParticipants;this.completionParticipants=[s].concat(a);const l=this.doComplete(e,t,n,i);try{const o=await s.computeCompletions(e,r);return{isIncomplete:l.isIncomplete||o.isIncomplete,itemDefaults:l.itemDefaults,items:o.items.concat(l.items)}}finally{this.completionParticipants=a}}doComplete(e,t,n,r){this.offset=e.offsetAt(t),this.position=t,this.currentWord=Dm(e,this.offset),this.defaultReplaceRange=X.create(xe.create(this.position.line,this.position.character-this.currentWord.length),this.position),this.textDocument=e,this.styleSheet=n,this.documentSettings=r;try{const i={isIncomplete:!1,itemDefaults:{editRange:{start:{line:t.line,character:t.character-this.currentWord.length},end:t}},items:[]};this.nodePath=Ni(this.styleSheet,this.offset);for(let s=this.nodePath.length-1;s>=0;s--){const a=this.nodePath[s];if(a instanceof Mi)this.getCompletionsForDeclarationProperty(a.getParent(),i);else if(a instanceof vl)a.parent instanceof Wi?this.getVariableProposals(null,i):this.getCompletionsForExpression(a,i);else if(a instanceof Jt){const l=a.findAParent(b.ExtendsReference,b.Ruleset);if(l)if(l.type===b.ExtendsReference)this.getCompletionsForExtendsReference(l,a,i);else{const o=l;this.getCompletionsForSelector(o,o&&o.isNested(),i)}}else if(a instanceof Xt)this.getCompletionsForFunctionArgument(a,a.getParent(),i);else if(a instanceof Di)this.getCompletionsForDeclarations(a,i);else if(a instanceof lr)this.getCompletionsForVariableDeclaration(a,i);else if(a instanceof Et)this.getCompletionsForRuleSet(a,i);else if(a instanceof Wi)this.getCompletionsForInterpolation(a,i);else if(a instanceof or)this.getCompletionsForFunctionDeclaration(a,i);else if(a instanceof cr)this.getCompletionsForMixinReference(a,i);else if(a instanceof Cn)this.getCompletionsForFunctionArgument(null,a,i);else if(a instanceof zi)this.getCompletionsForSupports(a,i);else if(a instanceof kn)this.getCompletionsForSupportsCondition(a,i);else if(a instanceof _n)this.getCompletionsForExtendsReference(a,null,i);else if(a.type===b.URILiteral)this.getCompletionForUriLiteralValue(a,i);else if(a.parent===null)this.getCompletionForTopLevel(i);else if(a.type===b.StringLiteral&&this.isImportPathParent(a.parent.type))this.getCompletionForImportPath(a,i);else continue;if(i.items.length>0||this.offset>a.offset)return this.finalize(i)}return this.getCompletionsForStylesheet(i),i.items.length===0&&this.variablePrefix&&this.currentWord.indexOf(this.variablePrefix)===0&&this.getVariableProposals(null,i),this.finalize(i)}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===b.Import}finalize(e){return e}findInNodePath(...e){for(let t=this.nodePath.length-1;t>=0;t--){const n=this.nodePath[t];if(e.indexOf(n.type)!==-1)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(s=>{let a,l,o=!1;e?(a=this.getCompletionRange(e.getProperty()),l=s.name,Le(e.colonPosition)||(l+=": ",o=!0)):(a=this.getCompletionRange(null),l=s.name+": ",o=!0),!e&&r&&(l+="$0;"),e&&!e.semicolonPosition&&r&&this.offset>=this.textDocument.offsetAt(a.end)&&(l+="$0;");const c={label:s.name,documentation:bt(s,this.doesSupportMarkdown()),tags:Dn(s)?[Rt.Deprecated]:[],textEdit:$.replace(a,l),insertTextFormat:Ne.Snippet,kind:V.Property};s.restrictions||(o=!1),n&&o&&(c.command=Uc);const u=(255-(typeof s.relevance=="number"?Math.min(Math.max(s.relevance,0),99):50)).toString(16),f=pe(s.name,"-")?He.VendorPrefixed:He.Normal;c.sortText=f+"_"+u,t.items.push(c)}),this.completionParticipants.forEach(s=>{s.onCssProperty&&s.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(s=>{s.onCssPropertyValue&&s.onCssPropertyValue({propertyName:n,propertyValue:this.currentWord,range:this.getCompletionRange(i)})}),r){if(r.restrictions)for(const s of r.restrictions)switch(s){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);break}this.getValueEnumProposals(r,i,t),this.getCSSWideKeywordProposals(r,i,t),this.getUnitProposals(r,i,t)}else{const s=Fm(this.styleSheet,e);for(const a of s.getEntries())t.items.push({label:a,textEdit:$.replace(this.getCompletionRange(i),a),kind:V.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=r.name,s;if(cl(i,")")){const o=i.lastIndexOf("(");o!==-1&&(i=i.substring(0,o+1)+"$1"+i.substring(o+1),s=rt)}let a=He.Enums;pe(r.name,"-")&&(a+=He.VendorPrefixed);const l={label:r.name,documentation:bt(r,this.doesSupportMarkdown()),tags:Dn(e)?[Rt.Deprecated]:[],textEdit:$.replace(this.getCompletionRange(t),i),sortText:a,kind:V.Value,insertTextFormat:s};n.items.push(l)}return n}getCSSWideKeywordProposals(e,t,n){for(const r in Ic)n.items.push({label:r,documentation:Ic[r],textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});for(const r in Mc){const i=Zt(r);n.items.push({label:r,documentation:Mc[r],textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Function,insertTextFormat:rt,command:pe(r,"var")?Uc: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,J.Variable);for(const r of n){const i=pe(r.name,"--")?\`var(\${r.name})\`:r.name,s={label:r.name,documentation:r.value?hl(r.value):r.value,textEdit:$.replace(this.getCompletionRange(e),i),kind:V.Variable,sortText:He.Variable};if(typeof s.documentation=="string"&&xc(s.documentation)&&(s.kind=V.Color),r.node.type===b.FunctionParameter){const a=r.node.getParent();a.type===b.MixinDeclaration&&(s.detail=g("argument from '{0}'",a.getName()))}t.items.push(s)}return t}getVariableProposalsForCSSVarFunction(e){const t=new cs;this.styleSheet.acceptVisitor(new Nm(t,this.offset));let n=this.getSymbolContext().findSymbolsAtOffset(this.offset,J.Variable);for(const r of n){if(pe(r.name,"--")){const i={label:r.name,documentation:r.value?hl(r.value):r.value,textEdit:$.replace(this.getCompletionRange(null),r.name),kind:V.Variable};typeof i.documentation=="string"&&xc(i.documentation)&&(i.kind=V.Color),e.items.push(i)}t.remove(r.name)}for(const r of t.getEntries())if(pe(r,"--")){const i={label:r,textEdit:$.replace(this.getCompletionRange(null),r),kind:V.Variable};e.items.push(i)}return e}getUnitProposals(e,t,n){let r="0";if(this.currentWord.length>0){const i=this.currentWord.match(/^-?\\d[\\.\\d+]*/);i&&(r=i[0],n.isIncomplete=r.length===this.currentWord.length)}else this.currentWord.length===0&&(n.isIncomplete=!0);if(t&&t.parent&&t.parent.type===b.Term&&(t=t.getParent()),e.restrictions)for(const i of e.restrictions){const s=Pc[i];if(s)for(const a of s){const l=r+a;n.items.push({label:l,textEdit:$.replace(this.getCompletionRange(t),l),kind:V.Unit})}}return n}getCompletionRange(e){if(e&&e.offset<=this.offset&&this.offset<=e.end){const t=e.end!==-1?this.textDocument.positionAt(e.end):this.position,n=this.textDocument.positionAt(e.offset);if(n.line===t.line)return X.create(n,t)}return this.defaultReplaceRange}getColorProposals(e,t,n){for(const i in vr)n.items.push({label:i,documentation:vr[i],textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Color});for(const i in rs)n.items.push({label:i,documentation:rs[i],textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Value});const r=new cs;this.styleSheet.acceptVisitor(new Rm(r,this.offset));for(const i of r.getEntries())n.items.push({label:i,textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Color});for(const i of im)n.items.push({label:i.label,detail:i.func,documentation:i.desc,textEdit:$.replace(this.getCompletionRange(t),i.insertText),insertTextFormat:rt,kind:V.Function});return n}getPositionProposals(e,t,n){for(const r in Ec)n.items.push({label:r,documentation:Ec[r],textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});return n}getRepeatStyleProposals(e,t,n){for(const r in Fc)n.items.push({label:r,documentation:Fc[r],textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});return n}getLineStyleProposals(e,t,n){for(const r in Rc)n.items.push({label:r,documentation:Rc[r],textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});return n}getLineWidthProposals(e,t,n){for(const r of fm)n.items.push({label:r,textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});return n}getGeometryBoxProposals(e,t,n){for(const r in Dc)n.items.push({label:r,documentation:Dc[r],textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});return n}getBoxProposals(e,t,n){for(const r in Nc)n.items.push({label:r,documentation:Nc[r],textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});return n}getImageProposals(e,t,n){for(const r in Ac){const i=Zt(r);n.items.push({label:r,documentation:Ac[r],textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Function,insertTextFormat:r!==i?rt:void 0})}return n}getTimingFunctionProposals(e,t,n){for(const r in Lc){const i=Zt(r);n.items.push({label:r,documentation:Lc[r],textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Function,insertTextFormat:r!==i?rt:void 0})}return n}getBasicShapeProposals(e,t,n){for(const r in zc){const i=Zt(r);n.items.push({label:r,documentation:zc[r],textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Function,insertTextFormat:r!==i?rt:void 0})}return n}getCompletionsForStylesheet(e){const t=this.styleSheet.findFirstChildBeforeOffset(this.offset);return t?t instanceof Et?this.getCompletionsForRuleSet(t,e):t instanceof zi?this.getCompletionsForSupports(t,e):e:this.getCompletionForTopLevel(e)}getCompletionForTopLevel(e){return this.cssDataManager.getAtDirectives().forEach(t=>{e.items.push({label:t.name,textEdit:$.replace(this.getCompletionRange(null),t.name),documentation:bt(t,this.doesSupportMarkdown()),tags:Dn(t)?[Rt.Deprecated]:[],kind:V.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(b.PseudoSelector,b.IdentifierSelector,b.ClassSelector,b.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=X.create(xe.create(this.position.line,this.position.character-this.currentWord.length),this.position)),this.cssDataManager.getPseudoClasses().forEach(o=>{const c=Zt(o.name),d={label:o.name,textEdit:$.replace(this.getCompletionRange(r),c),documentation:bt(o,this.doesSupportMarkdown()),tags:Dn(o)?[Rt.Deprecated]:[],kind:V.Function,insertTextFormat:o.name!==c?rt:void 0};pe(o.name,":-")&&(d.sortText=He.VendorPrefixed),n.items.push(d)}),this.cssDataManager.getPseudoElements().forEach(o=>{const c=Zt(o.name),d={label:o.name,textEdit:$.replace(this.getCompletionRange(r),c),documentation:bt(o,this.doesSupportMarkdown()),tags:Dn(o)?[Rt.Deprecated]:[],kind:V.Function,insertTextFormat:o.name!==c?rt:void 0};pe(o.name,"::-")&&(d.sortText=He.VendorPrefixed),n.items.push(d)}),!t){for(const o of gm)n.items.push({label:o,textEdit:$.replace(this.getCompletionRange(r),o),kind:V.Keyword});for(const o of bm)n.items.push({label:o,textEdit:$.replace(this.getCompletionRange(r),o),kind:V.Keyword})}const a={};a[this.currentWord]=!0;const l=this.textDocument.getText();if(this.styleSheet.accept(o=>{if(o.type===b.SimpleSelector&&o.length>0){const c=l.substr(o.offset,o.length);return c.charAt(0)==="."&&!a[c]&&(a[c]=!0,n.items.push({label:c,textEdit:$.replace(this.getCompletionRange(r),c),kind:V.Keyword})),!1}return!0}),e&&e.isNested()){const o=e.getSelectors().findFirstChildBeforeOffset(this.offset);o&&e.getSelectors().getChildren().indexOf(o)===0&&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 Ii){const r=n;if(!Le(r.colonPosition)||this.offset<=r.colonPosition)return this.getCompletionsForDeclarationProperty(r,t);if(Le(r.semicolonPosition)&&r.semicolonPosition<this.offset)return this.offset===r.semicolonPosition+1?t:this.getCompletionsForDeclarationProperty(null,t);if(r instanceof qe)return this.getCompletionsForDeclarationValue(r,t)}else n instanceof _n?this.getCompletionsForExtendsReference(n,null,t):this.currentWord&&this.currentWord[0]==="@"?this.getCompletionsForDeclarationProperty(null,t):n instanceof Et&&this.getCompletionsForDeclarationProperty(null,t);return t}getCompletionsForVariableDeclaration(e,t){return this.offset&&Le(e.colonPosition)&&this.offset>e.colonPosition&&this.getVariableProposals(e.getValue()||null,t),t}getCompletionsForExpression(e,t){const n=e.getParent();if(n instanceof Xt)return this.getCompletionsForFunctionArgument(n,n.getParent(),t),t;const r=e.findParent(b.Declaration);if(!r)return this.getTermProposals(void 0,null,t),t;const i=e.findChildAtOffset(this.offset,!0);return i?i instanceof Oi||i instanceof Ae?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<n.end&&this.getTermProposals(void 0,null,t),t}getCompletionsForMixinReference(e,t){const n=this.getSymbolContext().findSymbolsAtOffset(this.offset,J.Mixin);for(const i of n)i.node instanceof En&&t.items.push(this.makeTermProposal(i,i.node.getParameters(),null));const r=e.getIdentifier()||null;return this.completionParticipants.forEach(i=>{i.onCssMixinReference&&i.onCssMixinReference({mixinName:this.currentWord,range:this.getCompletionRange(r)})}),t}getTermProposals(e,t,n){const r=this.getSymbolContext().findSymbolsAtOffset(this.offset,J.Function);for(const i of r)i.node instanceof or&&n.items.push(this.makeTermProposal(i,i.node.getParameters(),t));return n}makeTermProposal(e,t,n){e.node;const r=t.getChildren().map(s=>s instanceof ar?s.getName():s.getText()),i=e.name+"("+r.map((s,a)=>"\${"+(a+1)+":"+s+"}").join(", ")+")";return{label:e.name,detail:e.name+"("+r.join(", ")+")",textEdit:$.replace(this.getCompletionRange(n),i),insertTextFormat:rt,kind:V.Function,sortText:He.Term}}getCompletionsForSupportsCondition(e,t){const n=e.findFirstChildBeforeOffset(this.offset);if(n){if(n instanceof qe)return!Le(n.colonPosition)||this.offset<=n.colonPosition?this.getCompletionsForDeclarationProperty(n,t):this.getCompletionsForDeclarationValue(n,t);if(n instanceof kn)return this.getCompletionsForSupportsCondition(n,t)}return Le(e.lParent)&&this.offset>e.lParent&&(!Le(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 i=e.findFirstChildBeforeOffset(this.offset);return i instanceof kn?this.getCompletionsForSupportsCondition(i,t):t}return this.getCompletionForTopLevel(t)}getCompletionsForExtendsReference(e,t,n){return n}getCompletionForUriLiteralValue(e,t){let n,r,i;if(e.hasChildren()){const s=e.getChild(0);n=s.getText(),r=this.position,i=this.getCompletionRange(s)}else{n="",r=this.position;const s=this.textDocument.positionAt(e.offset+4);i=X.create(s,s)}return this.completionParticipants.forEach(s=>{s.onCssURILiteralValue&&s.onCssURILiteralValue({uriValue:n,position:r,range:i})}),t}getCompletionForImportPath(e,t){return this.completionParticipants.forEach(n=>{n.onCssImportPath&&n.onCssImportPath({pathValue:e.getText(),position:this.position,range:this.getCompletionRange(e)})}),t}hasCharacterAtPosition(e,t){const n=this.textDocument.getText();return e>=0&&e<n.length&&n.charAt(e)===t}doesSupportMarkdown(){if(!Le(this.supportsMarkdown)){if(!Le(this.lsOptions.clientCapabilities))return this.supportsMarkdown=!0,this.supportsMarkdown;const e=this.lsOptions.clientCapabilities.textDocument?.completion?.completionItem?.documentationFormat;this.supportsMarkdown=Array.isArray(e)&&e.indexOf(je.Markdown)!==-1}return this.supportsMarkdown}};function Dn(e){return!!(e.status&&(e.status==="nonstandard"||e.status==="obsolete"))}var cs=class{constructor(){this.entries={}}add(e){this.entries[e]=!0}remove(e){delete this.entries[e]}getEntries(){return Object.keys(this.entries)}};function Zt(e){return e.replace(/\\(\\)$/,"($1)")}function Fm(e,t){const n=t.getFullPropertyName(),r=new cs;function i(l){return(l instanceof Ae||l instanceof Oi||l instanceof Ti)&&r.add(l.getText()),!0}function s(l){const o=l.getFullPropertyName();return n===o}function a(l){if(l instanceof qe&&l!==t&&s(l)){const o=l.getValue();o&&o.accept(i)}return!0}return e.accept(a),r}var Rm=class{constructor(e,t){this.entries=e,this.currentOffset=t}visitNode(e){return(e instanceof Ti||e instanceof Cn&&lm(e))&&(this.currentOffset<e.offset||e.end<this.currentOffset)&&this.entries.add(e.getText()),!0}},Nm=class{constructor(e,t){this.entries=e,this.currentOffset=t}visitNode(e){return e instanceof Ae&&e.isCustomProperty&&(this.currentOffset<e.offset||e.end<this.currentOffset)&&this.entries.add(e.getText()),!0}};function Dm(e,t){let n=t-1;const r=e.getText();for(;n>=0&&\`
37
+ \`),n+=e.references.map(r=>\`[\${r.name}](\${r.url})\`).join(" | ")),n}function wc(e=[]){return e.length===0?null:e.map(t=>{let n="";const r=t.match(/([A-Z]+)(\\d+)?/),i=r[1],s=r[2];return i in bc&&(n+=bc[i]),s&&(n+=" "+s),n}).join(", ")}var rm=/(^#([0-9A-F]{3}){1,2}$)|(^#([0-9A-F]{4}){1,2}$)/i,im=[{label:"rgb",func:"rgb($red, $green, $blue)",insertText:"rgb(\${1:red}, \${2:green}, \${3:blue})",desc:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("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:g("Mix two colors together in a polar color space.")}],sm=/^(rgb|rgba|hsl|hsla|hwb)$/i,vr={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"},am=new RegExp(\`^(\${Object.keys(vr).join("|")})$\`,"i"),rs={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."},om=new RegExp(\`^(\${Object.keys(rs).join("|")})$\`,"i");function vt(e,t){const r=e.getText().match(/^([-+]?[0-9]*\\.?[0-9]+)(%?)$/);if(r){r[2]&&(t=100);const i=parseFloat(r[1])/t;if(i>=0&&i<=1)return i}throw new Error}function yc(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 parseFloat(t)*180/Math.PI%360;case"grad":return parseFloat(t)*.9%360;case"turn":return parseFloat(t)*360%360;default:if(typeof n[2]>"u")return parseFloat(t)%360}throw new Error}function lm(e){const t=e.getName();return t?sm.test(t):!1}function xc(e){return rm.test(e)||am.test(e)||om.test(e)}var Sc=48,cm=57,hm=65,wr=97,dm=102;function de(e){return e<Sc?0:e<=cm?e-Sc:(e<wr&&(e+=wr-hm),e>=wr&&e<=dm?e-wr+10:0)}function Cc(e){if(e[0]!=="#")return null;switch(e.length){case 4:return{red:de(e.charCodeAt(1))*17/255,green:de(e.charCodeAt(2))*17/255,blue:de(e.charCodeAt(3))*17/255,alpha:1};case 5:return{red:de(e.charCodeAt(1))*17/255,green:de(e.charCodeAt(2))*17/255,blue:de(e.charCodeAt(3))*17/255,alpha:de(e.charCodeAt(4))*17/255};case 7:return{red:(de(e.charCodeAt(1))*16+de(e.charCodeAt(2)))/255,green:(de(e.charCodeAt(3))*16+de(e.charCodeAt(4)))/255,blue:(de(e.charCodeAt(5))*16+de(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(de(e.charCodeAt(1))*16+de(e.charCodeAt(2)))/255,green:(de(e.charCodeAt(3))*16+de(e.charCodeAt(4)))/255,blue:(de(e.charCodeAt(5))*16+de(e.charCodeAt(6)))/255,alpha:(de(e.charCodeAt(7))*16+de(e.charCodeAt(8)))/255}}return null}function kc(e,t,n,r=1){if(e=e/60,t===0)return{red:n,green:n,blue:n,alpha:r};{const i=(l,o,c)=>{for(;c<0;)c+=6;for(;c>=6;)c-=6;return c<1?(o-l)*c+l:c<3?o:c<4?(o-l)*(4-c)+l:l},s=n<=.5?n*(t+1):n+t-n*t,a=n*2-s;return{red:i(a,s,e+2),green:i(a,s,e),blue:i(a,s,e-2),alpha:r}}}function _c(e){const t=e.red,n=e.green,r=e.blue,i=e.alpha,s=Math.max(t,n,r),a=Math.min(t,n,r);let l=0,o=0;const c=(a+s)/2,d=s-a;if(d>0){switch(o=Math.min(c<=.5?d/(2*c):d/(2-2*c),1),s){case t:l=(n-r)/d+(n<r?6:0);break;case n:l=(r-t)/d+2;break;case r:l=(t-n)/d+4;break}l*=60,l=Math.round(l)}return{h:l,s:o,l:c,a:i}}function um(e,t,n,r=1){if(t+n>=1){const o=t/(t+n);return{red:o,green:o,blue:o,alpha:r}}const i=kc(e,1,.5,r);let s=i.red;s*=1-t-n,s+=t;let a=i.green;a*=1-t-n,a+=t;let l=i.blue;return l*=1-t-n,l+=t,{red:s,green:a,blue:l,alpha:r}}function pm(e){const t=_c(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}}function mm(e){if(e.type===b.HexColorValue){const t=e.getText();return Cc(t)}else if(e.type===b.Function){const t=e,n=t.getName();let r=t.getArguments().getChildren();if(r.length===1){const i=r[0].getChildren();if(i.length===1&&i[0].type===b.Expression&&(r=i[0].getChildren(),r.length===3)){const s=r[2];if(s instanceof Pi){const a=s.getLeft(),l=s.getRight(),o=s.getOperator();a&&l&&o&&o.matches("/")&&(r=[r[0],r[1],a,l])}}}if(!n||r.length<3||r.length>4)return null;try{const i=r.length===4?vt(r[3],1):1;if(n==="rgb"||n==="rgba")return{red:vt(r[0],255),green:vt(r[1],255),blue:vt(r[2],255),alpha:i};if(n==="hsl"||n==="hsla"){const s=yc(r[0]),a=vt(r[1],100),l=vt(r[2],100);return kc(s,a,l,i)}else if(n==="hwb"){const s=yc(r[0]),a=vt(r[1],100),l=vt(r[2],100);return um(s,a,l,i)}}catch{return null}}else if(e.type===b.Identifier){if(e.parent&&e.parent.type!==b.Term)return null;const t=e.parent;if(t&&t.parent&&t.parent.type===b.BinaryExpression){const i=t.parent;if(i.parent&&i.parent.type===b.ListEntry&&i.parent.key===i)return null}const n=e.getText().toLowerCase();if(n==="none")return null;const r=vr[n];if(r)return Cc(r)}return null}var Ec={bottom:"Computes to ‘100%’ for the vertical position if one or two values are given, otherwise specifies the bottom edge as the origin for the next offset.",center:"Computes to ‘50%’ (‘left 50%’) for the horizontal position if the horizontal position is not otherwise specified, or ‘50%’ (‘top 50%’) for the vertical position if it is.",left:"Computes to ‘0%’ for the horizontal position if one or two values are given, otherwise specifies the left edge as the origin for the next offset.",right:"Computes to ‘100%’ for the horizontal position if one or two values are given, otherwise specifies the right edge as the origin for the next offset.",top:"Computes to ‘0%’ for the vertical position if one or two values are given, otherwise specifies the top edge as the origin for the next offset."},Fc={"no-repeat":"Placed once and not repeated in this direction.",repeat:"Repeated in this direction as often as needed to cover the background painting area.","repeat-x":"Computes to ‘repeat no-repeat’.","repeat-y":"Computes to ‘no-repeat repeat’.",round:"Repeated as often as will fit within the background positioning area. If it doesn’t fit a whole number of times, it is rescaled so that it does.",space:"Repeated as often as will fit within the background positioning area without being clipped and then the images are spaced out to fill the area."},Rc={dashed:"A series of square-ended dashes.",dotted:"A series of round dots.",double:"Two parallel solid lines with some space between them.",groove:"Looks as if it were carved in the canvas.",hidden:"Same as ‘none’, but has different behavior in the border conflict resolution rules for border-collapsed tables.",inset:"Looks as if the content on the inside of the border is sunken into the canvas.",none:"No border. Color and width are ignored.",outset:"Looks as if the content on the inside of the border is coming out of the canvas.",ridge:"Looks as if it were coming out of the canvas.",solid:"A single line segment."},fm=["medium","thick","thin"],Nc={"border-box":"The background is painted within (clipped to) the border box.","content-box":"The background is painted within (clipped to) the content box.","padding-box":"The background is painted within (clipped to) the padding box."},Dc={"margin-box":"Uses the margin box as reference box.","fill-box":"Uses the object bounding box as reference box.","stroke-box":"Uses the stroke bounding box as reference box.","view-box":"Uses the nearest SVG viewport as reference box."},Ic={initial:"Represents the value specified as the property’s initial value.",inherit:"Represents the computed value of the property on the element’s parent.",unset:"Acts as either \`inherit\` or \`initial\`, depending on whether the property is inherited or not."},Mc={"var()":"Evaluates the value of a custom variable.","calc()":"Evaluates an mathematical expression. The following operators can be used: + - * /."},Ac={"url()":"Reference an image file by URL","image()":"Provide image fallbacks and annotations.","-webkit-image-set()":"Provide multiple resolutions. Remember to use unprefixed image-set() in addition.","image-set()":"Provide multiple resolutions of an image and const the UA decide which is most appropriate in a given situation.","-moz-element()":"Use an element in the document as an image. Remember to use unprefixed element() in addition.","element()":"Use an element in the document as an image.","cross-fade()":"Indicates the two images to be combined and how far along in the transition the combination is.","-webkit-gradient()":"Deprecated. Use modern linear-gradient() or radial-gradient() instead.","-webkit-linear-gradient()":"Linear gradient. Remember to use unprefixed version in addition.","-moz-linear-gradient()":"Linear gradient. Remember to use unprefixed version in addition.","-o-linear-gradient()":"Linear gradient. Remember to use unprefixed version in addition.","linear-gradient()":"A linear gradient is created by specifying a straight gradient line, and then several colors placed along that line.","-webkit-repeating-linear-gradient()":"Repeating Linear gradient. Remember to use unprefixed version in addition.","-moz-repeating-linear-gradient()":"Repeating Linear gradient. Remember to use unprefixed version in addition.","-o-repeating-linear-gradient()":"Repeating Linear gradient. Remember to use unprefixed version in addition.","repeating-linear-gradient()":"Same as linear-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop’s position and the first specified color-stop’s position.","-webkit-radial-gradient()":"Radial gradient. Remember to use unprefixed version in addition.","-moz-radial-gradient()":"Radial gradient. Remember to use unprefixed version in addition.","radial-gradient()":"Colors emerge from a single point and smoothly spread outward in a circular or elliptical shape.","-webkit-repeating-radial-gradient()":"Repeating radial gradient. Remember to use unprefixed version in addition.","-moz-repeating-radial-gradient()":"Repeating radial gradient. Remember to use unprefixed version in addition.","repeating-radial-gradient()":"Same as radial-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop’s position and the first specified color-stop’s position."},Lc={ease:"Equivalent to cubic-bezier(0.25, 0.1, 0.25, 1.0).","ease-in":"Equivalent to cubic-bezier(0.42, 0, 1.0, 1.0).","ease-in-out":"Equivalent to cubic-bezier(0.42, 0, 0.58, 1.0).","ease-out":"Equivalent to cubic-bezier(0, 0, 0.58, 1.0).",linear:"Equivalent to cubic-bezier(0.0, 0.0, 1.0, 1.0).","step-end":"Equivalent to steps(1, end).","step-start":"Equivalent to steps(1, start).","steps()":"The first parameter specifies the number of intervals in the function. The second parameter, which is optional, is either the value “start” or “end”.","cubic-bezier()":"Specifies a cubic-bezier curve. The four values specify points P1 and P2 of the curve as (x1, y1, x2, y2).","cubic-bezier(0.6, -0.28, 0.735, 0.045)":"Ease-in Back. Overshoots.","cubic-bezier(0.68, -0.55, 0.265, 1.55)":"Ease-in-out Back. Overshoots.","cubic-bezier(0.175, 0.885, 0.32, 1.275)":"Ease-out Back. Overshoots.","cubic-bezier(0.6, 0.04, 0.98, 0.335)":"Ease-in Circular. Based on half circle.","cubic-bezier(0.785, 0.135, 0.15, 0.86)":"Ease-in-out Circular. Based on half circle.","cubic-bezier(0.075, 0.82, 0.165, 1)":"Ease-out Circular. Based on half circle.","cubic-bezier(0.55, 0.055, 0.675, 0.19)":"Ease-in Cubic. Based on power of three.","cubic-bezier(0.645, 0.045, 0.355, 1)":"Ease-in-out Cubic. Based on power of three.","cubic-bezier(0.215, 0.610, 0.355, 1)":"Ease-out Cubic. Based on power of three.","cubic-bezier(0.95, 0.05, 0.795, 0.035)":"Ease-in Exponential. Based on two to the power ten.","cubic-bezier(1, 0, 0, 1)":"Ease-in-out Exponential. Based on two to the power ten.","cubic-bezier(0.19, 1, 0.22, 1)":"Ease-out Exponential. Based on two to the power ten.","cubic-bezier(0.47, 0, 0.745, 0.715)":"Ease-in Sine.","cubic-bezier(0.445, 0.05, 0.55, 0.95)":"Ease-in-out Sine.","cubic-bezier(0.39, 0.575, 0.565, 1)":"Ease-out Sine.","cubic-bezier(0.55, 0.085, 0.68, 0.53)":"Ease-in Quadratic. Based on power of two.","cubic-bezier(0.455, 0.03, 0.515, 0.955)":"Ease-in-out Quadratic. Based on power of two.","cubic-bezier(0.25, 0.46, 0.45, 0.94)":"Ease-out Quadratic. Based on power of two.","cubic-bezier(0.895, 0.03, 0.685, 0.22)":"Ease-in Quartic. Based on power of four.","cubic-bezier(0.77, 0, 0.175, 1)":"Ease-in-out Quartic. Based on power of four.","cubic-bezier(0.165, 0.84, 0.44, 1)":"Ease-out Quartic. Based on power of four.","cubic-bezier(0.755, 0.05, 0.855, 0.06)":"Ease-in Quintic. Based on power of five.","cubic-bezier(0.86, 0, 0.07, 1)":"Ease-in-out Quintic. Based on power of five.","cubic-bezier(0.23, 1, 0.320, 1)":"Ease-out Quintic. Based on power of five."},zc={"circle()":"Defines a circle.","ellipse()":"Defines an ellipse.","inset()":"Defines an inset rectangle.","polygon()":"Defines a polygon."},Pc={length:["cap","ch","cm","cqb","cqh","cqi","cqmax","cqmin","cqw","dvb","dvh","dvi","dvw","em","ex","ic","in","lh","lvb","lvh","lvi","lvw","mm","pc","pt","px","q","rcap","rch","rem","rex","ric","rlh","svb","svh","svi","svw","vb","vh","vi","vmax","vmin","vw"],angle:["deg","rad","grad","turn"],time:["ms","s"],frequency:["Hz","kHz"],resolution:["dpi","dpcm","dppx"],percentage:["%","fr"]},gm=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","const","video","wbr"],bm=["circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","hatch","hatchpath","image","line","linearGradient","marker","mask","mesh","meshpatch","meshrow","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","solidcolor","stop","svg","switch","symbol","text","textPath","tspan","use","view"],vm=["@bottom-center","@bottom-left","@bottom-left-corner","@bottom-right","@bottom-right-corner","@left-bottom","@left-middle","@left-top","@right-bottom","@right-middle","@right-top","@top-center","@top-left","@top-left-corner","@top-right","@top-right-corner"];function yr(e){return Object.keys(e).map(t=>e[t])}function Le(e){return typeof e<"u"}var xr=class{constructor(e=new xn){this.keyframeRegex=/^@(\\-(webkit|ms|moz|o)\\-)?keyframes$/i,this.scanner=e,this.token={type:p.EOF,offset:-1,len:0,text:""},this.prevToken=void 0}peekIdent(e){return p.Ident===this.token.type&&e.length===this.token.text.length&&e===this.token.text.toLowerCase()}peekKeyword(e){return p.AtKeyword===this.token.type&&e.length===this.token.text.length&&e===this.token.text.toLowerCase()}peekDelim(e){return p.Delim===this.token.type&&e===this.token.text}peek(e){return e===this.token.type}peekOne(...e){return e.indexOf(this.token.type)!==-1}peekRegExp(e,t){return e!==this.token.type?!1: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):!1}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(),n=e();return n||(this.restoreAtMark(t),null)}acceptOneKeyword(e){if(p.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):!1}acceptIdent(e){return this.peekIdent(e)?(this.consumeToken(),!0):!1}acceptKeyword(e){return this.peekKeyword(e)?(this.consumeToken(),!0):!1}acceptDelim(e){return this.peekDelim(e)?(this.consumeToken(),!0):!1}acceptRegexp(e){return e.test(this.token.text)?(this.consumeToken(),!0):!1}_parseRegexp(e){let t=this.createNode(b.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&&e.indexOf(this.token.type)!==-1)return this.consumeToken(),!0;if(t&&t.indexOf(this.token.type)!==-1)return!0;if(this.token.type===p.EOF)return!1;this.token=this.scanner.scan()}}createNode(e){return new O(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 ye)&&(t&&this.markError(e,t,n,r),this.prevToken)){const i=this.prevToken.offset+this.prevToken.len;e.length=i>e.offset?i-e.offset:0}return e}markError(e,t,n,r){this.token!==this.lastErrorToken&&(e.addIssue(new xl(e,t,Re.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(),r=(i,s)=>{if(e.version!==t)throw new Error("Underlying model has changed, AST is no longer valid");return n.substr(i,s)};return this.internalParse(n,this._parseStylesheet,r)}internalParse(e,t,n){this.scanner.setSource(e),this.token=this.scanner.scan();const r=t.bind(this)();return r&&(n?r.textProvider=n:r.textProvider=(i,s)=>e.substr(i,s)),r}_parseStylesheet(){const e=this.create(gp);for(;e.addChild(this._parseStylesheetStart()););let t=!1;do{let n=!1;do{n=!1;const r=this._parseStylesheetStatement();for(r&&(e.addChild(r),n=!0,t=!1,!this.peek(p.EOF)&&this._needsSemicolonAfter(r)&&!this.accept(p.SemiColon)&&this.markError(e,y.SemiColonExpected));this.accept(p.SemiColon)||this.accept(p.CDO)||this.accept(p.CDC);)n=!0,t=!1}while(n);if(this.peek(p.EOF))break;t||(this.peek(p.AtKeyword)?this.markError(e,y.UnknownAtRule):this.markError(e,y.RuleOrSelectorExpected),t=!0),this.consumeToken()}while(!this.peek(p.EOF));return this.finish(e)}_parseStylesheetStart(){return this._parseCharset()}_parseStylesheetStatement(e=!1){return this.peek(p.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(p.Comma)&&this._parseSelector(e););if(this.accept(p.CurlyL))return this.restoreAtMark(t),this._parseRuleset(e)}return this.restoreAtMark(t),null}_parseRuleset(e=!1){const t=this.create(Et),n=t.getSelectors();if(!n.addChild(this._parseSelector(e)))return null;for(;this.accept(p.Comma);)if(!n.addChild(this._parseSelector(e)))return this.finish(t,y.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(p.AtKeyword)?this._parseRuleSetDeclarationAtStatement():this.peek(p.Ident)?this._tryParseRuleset(!0)||this._parseDeclaration():this._parseRuleset(!0)}_needsSemicolonAfter(e){switch(e.type){case b.Keyframe:case b.ViewPort:case b.Media:case b.Ruleset:case b.Namespace:case b.If:case b.For:case b.Each:case b.While:case b.MixinDeclaration:case b.FunctionDeclaration:case b.MixinContentDeclaration:return!1;case b.ExtendsReference:case b.MixinContentReference:case b.ReturnStatement:case b.MediaQuery:case b.Debug:case b.Import:case b.AtApplyRule:case b.CustomPropertyDeclaration:return!0;case b.VariableDeclaration:return e.needsSemicolon;case b.MixinReference:return!e.getContent();case b.Declaration:return!e.getNestedProperties()}return!1}_parseDeclarations(e){const t=this.create(Di);if(!this.accept(p.CurlyL))return null;let n=e();for(;t.addChild(n)&&!this.peek(p.CurlyR);){if(this._needsSemicolonAfter(n)&&!this.accept(p.SemiColon))return this.finish(t,y.SemiColonExpected,[p.SemiColon,p.CurlyR]);for(n&&this.prevToken&&this.prevToken.type===p.SemiColon&&(n.semicolonPosition=this.prevToken.offset);this.accept(p.SemiColon););n=e()}return this.accept(p.CurlyR)?this.finish(t):this.finish(t,y.RightCurlyExpected,[p.CurlyR,p.SemiColon])}_parseBody(e,t){return e.setDeclarations(this._parseDeclarations(t))?this.finish(e):this.finish(e,y.LeftCurlyExpected,[p.CurlyR,p.SemiColon])}_parseSelector(e){const t=this.create(Sn);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(qe);return n.setProperty(this._parseProperty())?this.accept(p.Colon)?(this.prevToken&&(n.colonPosition=this.prevToken.offset),n.setValue(this._parseExpr())?(n.addChild(this._parsePrio()),this.peek(p.SemiColon)&&(n.semicolonPosition=this.token.offset),this.finish(n)):this.finish(n,y.PropertyValueExpected)):this.finish(n,y.ColonExpected,[p.Colon],e||[p.SemiColon]):null}_tryParseCustomPropertyDeclaration(e){if(!this.peekRegExp(p.Ident,/^--/))return null;const t=this.create(vp);if(!t.setProperty(this._parseProperty()))return null;if(!this.accept(p.Colon))return this.finish(t,y.ColonExpected,[p.Colon]);this.prevToken&&(t.colonPosition=this.prevToken.offset);const n=this.mark();if(this.peek(p.CurlyL)){const i=this.create(bp),s=this._parseDeclarations(this._parseRuleSetDeclaration.bind(this));if(i.setDeclarations(s)&&!s.isErroneous(!0)&&(i.addChild(this._parsePrio()),this.peek(p.SemiColon)))return this.finish(i),t.setPropertySet(i),t.semicolonPosition=this.token.offset,this.finish(t);this.restoreAtMark(n)}const r=this._parseExpr();return r&&!r.isErroneous(!0)&&(this._parsePrio(),this.peekOne(...e||[],p.SemiColon,p.EOF))?(t.setValue(r),this.peek(p.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)):(this.restoreAtMark(n),t.addChild(this._parseCustomPropertyValue(e)),t.addChild(this._parsePrio()),Le(t.colonPosition)&&this.token.offset===t.colonPosition+1?this.finish(t,y.PropertyValueExpected):this.finish(t))}_parseCustomPropertyValue(e=[p.CurlyR]){const t=this.create(O),n=()=>i===0&&s===0&&a===0,r=()=>e.indexOf(this.token.type)!==-1;let i=0,s=0,a=0;e:for(;;){switch(this.token.type){case p.SemiColon:if(n())break e;break;case p.Exclamation:if(n())break e;break;case p.CurlyL:i++;break;case p.CurlyR:if(i--,i<0){if(r()&&s===0&&a===0)break e;return this.finish(t,y.LeftCurlyExpected)}break;case p.ParenthesisL:s++;break;case p.ParenthesisR:if(s--,s<0){if(r()&&a===0&&i===0)break e;return this.finish(t,y.LeftParenthesisExpected)}break;case p.BracketL:a++;break;case p.BracketR:if(a--,a<0)return this.finish(t,y.LeftSquareBracketExpected);break;case p.BadString:break e;case p.EOF:let l=y.RightCurlyExpected;return a>0?l=y.RightSquareBracketExpected:s>0&&(l=y.RightParenthesisExpected),this.finish(t,l)}this.consumeToken()}return this.finish(t)}_tryToParseDeclaration(e){const t=this.mark();return this._parseProperty()&&this.accept(p.Colon)?(this.restoreAtMark(t),this._parseDeclaration(e)):(this.restoreAtMark(t),null)}_parseProperty(){const e=this.create(Mi),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(p.Charset))return null;const e=this.create(O);return this.consumeToken(),this.accept(p.String)?this.accept(p.SemiColon)?this.finish(e):this.finish(e,y.SemiColonExpected):this.finish(e,y.IdentifierExpected)}_parseImport(){if(!this.peekKeyword("@import"))return null;const e=this.create(Ai);return this.consumeToken(),!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral())?this.finish(e,y.URIOrStringExpected):this._completeParseImport(e)}_completeParseImport(e){if(this.acceptIdent("layer")&&this.accept(p.ParenthesisL)){if(!e.addChild(this._parseLayerName()))return this.finish(e,y.IdentifierExpected,[p.SemiColon]);if(!this.accept(p.ParenthesisR))return this.finish(e,y.RightParenthesisExpected,[p.ParenthesisR],[])}return this.acceptIdent("supports")&&this.accept(p.ParenthesisL)&&(e.addChild(this._tryToParseDeclaration()||this._parseSupportsCondition()),!this.accept(p.ParenthesisR))?this.finish(e,y.RightParenthesisExpected,[p.ParenthesisR],[]):(!this.peek(p.SemiColon)&&!this.peek(p.EOF)&&e.setMedialist(this._parseMediaQueryList()),this.finish(e))}_parseNamespace(){if(!this.peekKeyword("@namespace"))return null;const e=this.create(Dp);return this.consumeToken(),!e.addChild(this._parseURILiteral())&&(e.addChild(this._parseIdent()),!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))?this.finish(e,y.URIExpected,[p.SemiColon]):this.accept(p.SemiColon)?this.finish(e):this.finish(e,y.SemiColonExpected)}_parseFontFace(){if(!this.peekKeyword("@font-face"))return null;const e=this.create(ul);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(_p);return this.consumeToken(),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseKeyframe(){if(!this.peekRegExp(p.AtKeyword,this.keyframeRegex))return null;const e=this.create(ml),t=this.create(O);return this.consumeToken(),e.setKeyword(this.finish(t)),t.matches("@-ms-keyframes")&&this.markError(t,y.UnknownKeyword),e.setIdentifier(this._parseKeyframeIdent())?this._parseBody(e,this._parseKeyframeSelector.bind(this)):this.finish(e,y.IdentifierExpected,[p.CurlyR])}_parseKeyframeIdent(){return this._parseIdent([J.Keyframe])}_parseKeyframeSelector(){const e=this.create(fl);let t=!1;if(e.addChild(this._parseIdent())&&(t=!0),this.accept(p.Percentage)&&(t=!0),!t)return null;for(;this.accept(p.Comma);)if(t=!1,e.addChild(this._parseIdent())&&(t=!0),this.accept(p.Percentage)&&(t=!0),!t)return this.finish(e,y.PercentageExpected);return this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_tryParseKeyframeSelector(){const e=this.create(fl),t=this.mark();let n=!1;if(e.addChild(this._parseIdent())&&(n=!0),this.accept(p.Percentage)&&(n=!0),!n)return null;for(;this.accept(p.Comma);)if(n=!1,e.addChild(this._parseIdent())&&(n=!0),this.accept(p.Percentage)&&(n=!0),!n)return this.restoreAtMark(t),null;return this.peek(p.CurlyL)?this._parseBody(e,this._parseRuleSetDeclaration.bind(this)):(this.restoreAtMark(t),null)}_parsePropertyAtRule(){if(!this.peekKeyword("@property"))return null;const e=this.create(Mp);return this.consumeToken(),!this.peekRegExp(p.Ident,/^--/)||!e.setName(this._parseIdent([J.Property]))?this.finish(e,y.IdentifierExpected):this._parseBody(e,this._parseDeclaration.bind(this))}_parseLayer(e=!1){if(!this.peekKeyword("@layer"))return null;const t=this.create(Ip);this.consumeToken();const n=this._parseLayerNameList();return n&&t.setNames(n),(!n||n.getChildren().length===1)&&this.peek(p.CurlyL)?this._parseBody(t,this._parseLayerDeclaration.bind(this,e)):this.accept(p.SemiColon)?this.finish(t):this.finish(t,y.SemiColonExpected)}_parseLayerDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseLayerNameList(){const e=this.createNode(b.LayerNameList);if(!e.addChild(this._parseLayerName()))return null;for(;this.accept(p.Comma);)if(!e.addChild(this._parseLayerName()))return this.finish(e,y.IdentifierExpected);return this.finish(e)}_parseLayerName(){const e=this.createNode(b.LayerName);if(!e.addChild(this._parseIdent()))return null;for(;!this.hasWhitespace()&&this.acceptDelim(".");)if(this.hasWhitespace()||!e.addChild(this._parseIdent()))return this.finish(e,y.IdentifierExpected);return this.finish(e)}_parseSupports(e=!1){if(!this.peekKeyword("@supports"))return null;const t=this.create(zi);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(kn);if(this.acceptIdent("not"))e.addChild(this._parseSupportsConditionInParens());else if(e.addChild(this._parseSupportsConditionInParens()),this.peekRegExp(p.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(kn);if(this.accept(p.ParenthesisL))return this.prevToken&&(e.lParent=this.prevToken.offset),!e.addChild(this._tryToParseDeclaration([p.ParenthesisR]))&&!this._parseSupportsCondition()?this.finish(e,y.ConditionExpected):this.accept(p.ParenthesisR)?(this.prevToken&&(e.rParent=this.prevToken.offset),this.finish(e)):this.finish(e,y.RightParenthesisExpected,[p.ParenthesisR],[]);if(this.peek(p.Ident)){const t=this.mark();if(this.consumeToken(),!this.hasWhitespace()&&this.accept(p.ParenthesisL)){let n=1;for(;this.token.type!==p.EOF&&n!==0;)this.token.type===p.ParenthesisL?n++:this.token.type===p.ParenthesisR&&n--,this.consumeToken();return this.finish(e)}else this.restoreAtMark(t)}return this.finish(e,y.LeftParenthesisExpected,[],[p.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(Li);return this.consumeToken(),t.addChild(this._parseMediaQueryList())?this._parseBody(t,this._parseMediaDeclaration.bind(this,e)):this.finish(t,y.MediaQueryExpected)}_parseMediaQueryList(){const e=this.create(gl);if(!e.addChild(this._parseMediaQuery()))return this.finish(e,y.MediaQueryExpected);for(;this.accept(p.Comma);)if(!e.addChild(this._parseMediaQuery()))return this.finish(e,y.MediaQueryExpected);return this.finish(e)}_parseMediaQuery(){const e=this.create(bl),t=this.mark();if(this.acceptIdent("not"),this.peek(p.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(Vp);return this._parseNumeric()?this.acceptDelim("/")?this._parseNumeric()?this.finish(t):this.finish(t,y.NumberExpected):(this.restoreAtMark(e),null):null}_parseMediaCondition(){const e=this.create(zp);this.acceptIdent("not");let t=!0;for(;t;){if(!this.accept(p.ParenthesisL))return this.finish(e,y.LeftParenthesisExpected,[],[p.CurlyL]);if(this.peek(p.ParenthesisL)||this.peekIdent("not")?e.addChild(this._parseMediaCondition()):e.addChild(this._parseMediaFeature()),!this.accept(p.ParenthesisR))return this.finish(e,y.RightParenthesisExpected,[],[p.CurlyL]);t=this.acceptIdent("and")||this.acceptIdent("or")}return this.finish(e)}_parseMediaFeature(){const e=[p.ParenthesisR],t=this.create(Pp);if(t.addChild(this._parseMediaFeatureName())){if(this.accept(p.Colon)){if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,y.TermExpected,[],e)}else if(this._parseMediaFeatureRangeOperator()){if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,y.TermExpected,[],e);if(this._parseMediaFeatureRangeOperator()&&!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,y.TermExpected,[],e)}}else if(t.addChild(this._parseMediaFeatureValue())){if(!this._parseMediaFeatureRangeOperator())return this.finish(t,y.OperatorExpected,[],e);if(!t.addChild(this._parseMediaFeatureName()))return this.finish(t,y.IdentifierExpected,[],e);if(this._parseMediaFeatureRangeOperator()&&!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,y.TermExpected,[],e)}else return this.finish(t,y.IdentifierExpected,[],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(O);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(Tp);if(this.consumeToken(),e.addChild(this._parsePageSelector())){for(;this.accept(p.Comma);)if(!e.addChild(this._parsePageSelector()))return this.finish(e,y.IdentifierExpected)}return this._parseBody(e,this._parsePageDeclaration.bind(this))}_parsePageMarginBox(){if(!this.peek(p.AtKeyword))return null;const e=this.create(Op);return this.acceptOneKeyword(vm)||this.markError(e,y.UnknownAtRule,[],[p.CurlyL]),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parsePageSelector(){if(!this.peek(p.Ident)&&!this.peek(p.Colon))return null;const e=this.create(O);return e.addChild(this._parseIdent()),this.accept(p.Colon)&&!e.addChild(this._parseIdent())?this.finish(e,y.IdentifierExpected):this.finish(e)}_parseDocument(){if(!this.peekKeyword("@-moz-document"))return null;const e=this.create(Ap);return this.consumeToken(),this.resync([],[p.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(Lp);return this.consumeToken(),t.addChild(this._parseIdent()),t.addChild(this._parseContainerQuery()),this._parseBody(t,this._parseContainerDeclaration.bind(this,e))}_parseContainerQuery(){const e=this.create(O);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(O);if(this.accept(p.ParenthesisL)){if(this.peekIdent("not")||this.peek(p.ParenthesisL)?e.addChild(this._parseContainerQuery()):e.addChild(this._parseMediaFeature()),!this.accept(p.ParenthesisR))return this.finish(e,y.RightParenthesisExpected,[],[p.CurlyL])}else if(this.acceptIdent("style")){if(this.hasWhitespace()||!this.accept(p.ParenthesisL))return this.finish(e,y.LeftParenthesisExpected,[],[p.CurlyL]);if(e.addChild(this._parseStyleQuery()),!this.accept(p.ParenthesisR))return this.finish(e,y.RightParenthesisExpected,[],[p.CurlyL])}else return this.finish(e,y.LeftParenthesisExpected,[],[p.CurlyL]);return this.finish(e)}_parseStyleQuery(){const e=this.create(O);if(this.acceptIdent("not"))e.addChild(this._parseStyleInParens());else if(this.peek(p.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([p.ParenthesisR]));return this.finish(e)}_parseStyleInParens(){const e=this.create(O);if(this.accept(p.ParenthesisL)){if(e.addChild(this._parseStyleQuery()),!this.accept(p.ParenthesisR))return this.finish(e,y.RightParenthesisExpected,[],[p.CurlyL])}else return this.finish(e,y.LeftParenthesisExpected,[],[p.CurlyL]);return this.finish(e)}_parseUnknownAtRule(){if(!this.peek(p.AtKeyword))return null;const e=this.create(wl);e.addChild(this._parseUnknownAtRuleName());const t=()=>r===0&&i===0&&s===0;let n=0,r=0,i=0,s=0;e:for(;;){switch(this.token.type){case p.SemiColon:if(t())break e;break;case p.EOF:return r>0?this.finish(e,y.RightCurlyExpected):s>0?this.finish(e,y.RightSquareBracketExpected):i>0?this.finish(e,y.RightParenthesisExpected):this.finish(e);case p.CurlyL:n++,r++;break;case p.CurlyR:if(r--,n>0&&r===0){if(this.consumeToken(),s>0)return this.finish(e,y.RightSquareBracketExpected);if(i>0)return this.finish(e,y.RightParenthesisExpected);break e}if(r<0){if(i===0&&s===0)break e;return this.finish(e,y.LeftCurlyExpected)}break;case p.ParenthesisL:i++;break;case p.ParenthesisR:if(i--,i<0)return this.finish(e,y.LeftParenthesisExpected);break;case p.BracketL:s++;break;case p.BracketR:if(s--,s<0)return this.finish(e,y.LeftSquareBracketExpected);break}this.consumeToken()}return e}_parseUnknownAtRuleName(){const e=this.create(O);return this.accept(p.AtKeyword)?this.finish(e):e}_parseOperator(){if(this.peekDelim("/")||this.peekDelim("*")||this.peekDelim("+")||this.peekDelim("-")||this.peek(p.Dashmatch)||this.peek(p.Includes)||this.peek(p.SubstringOperator)||this.peek(p.PrefixOperator)||this.peek(p.SuffixOperator)||this.peekDelim("=")){const e=this.createNode(b.Operator);return this.consumeToken(),this.finish(e)}else return null}_parseUnaryOperator(){if(!this.peekDelim("+")&&!this.peekDelim("-"))return null;const e=this.create(O);return this.consumeToken(),this.finish(e)}_parseCombinator(){if(this.peekDelim(">")){const e=this.create(O);this.consumeToken();const t=this.mark();if(!this.hasWhitespace()&&this.acceptDelim(">")){if(!this.hasWhitespace()&&this.acceptDelim(">"))return e.type=b.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(t)}return e.type=b.SelectorCombinatorParent,this.finish(e)}else if(this.peekDelim("+")){const e=this.create(O);return this.consumeToken(),e.type=b.SelectorCombinatorSibling,this.finish(e)}else if(this.peekDelim("~")){const e=this.create(O);return this.consumeToken(),e.type=b.SelectorCombinatorAllSiblings,this.finish(e)}else if(this.peekDelim("/")){const e=this.create(O);this.consumeToken();const t=this.mark();if(!this.hasWhitespace()&&this.acceptIdent("deep")&&!this.hasWhitespace()&&this.acceptDelim("/"))return e.type=b.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(t)}return null}_parseSimpleSelector(){const e=this.create(Jt);let t=0;for(e.addChild(this._parseElementName()||this._parseNestingSelector())&&t++;(t===0||!this.hasWhitespace())&&e.addChild(this._parseSimpleSelectorBody());)t++;return t>0?this.finish(e):null}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(b.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(p.Hash)&&!this.peekDelim("#"))return null;const e=this.createNode(b.IdentifierSelector);if(this.acceptDelim("#")){if(this.hasWhitespace()||!e.addChild(this._parseSelectorIdent()))return this.finish(e,y.IdentifierExpected)}else this.consumeToken();return this.finish(e)}_parseClass(){if(!this.peekDelim("."))return null;const e=this.createNode(b.ClassSelector);return this.consumeToken(),this.hasWhitespace()||!e.addChild(this._parseSelectorIdent())?this.finish(e,y.IdentifierExpected):this.finish(e)}_parseElementName(){const e=this.mark(),t=this.createNode(b.ElementNameSelector);return t.addChild(this._parseNamespacePrefix()),!t.addChild(this._parseSelectorIdent())&&!this.acceptDelim("*")?(this.restoreAtMark(e),null):this.finish(t)}_parseNamespacePrefix(){const e=this.mark(),t=this.createNode(b.NamespacePrefix);return!t.addChild(this._parseIdent())&&this.acceptDelim("*"),this.acceptDelim("|")?this.finish(t):(this.restoreAtMark(e),null)}_parseAttrib(){if(!this.peek(p.BracketL))return null;const e=this.create(Up);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(p.BracketR)?this.finish(e):this.finish(e,y.RightSquareBracketExpected)):this.finish(e,y.IdentifierExpected)}_parsePseudo(){const e=this._tryParsePseudoIdentifier();if(e){if(!this.hasWhitespace()&&this.accept(p.ParenthesisL)){const t=()=>{const r=this.create(O);if(!r.addChild(this._parseSelector(!0)))return null;for(;this.accept(p.Comma)&&r.addChild(this._parseSelector(!0)););return this.peek(p.ParenthesisR)?this.finish(r):null};if(!e.addChild(this.try(t))&&e.addChild(this._parseBinaryExpr())&&this.acceptIdent("of")&&!e.addChild(this.try(t)))return this.finish(e,y.SelectorExpected);if(!this.accept(p.ParenthesisR))return this.finish(e,y.RightParenthesisExpected)}return this.finish(e)}return null}_tryParsePseudoIdentifier(){if(!this.peek(p.Colon))return null;const e=this.mark(),t=this.createNode(b.PseudoSelector);return this.consumeToken(),this.hasWhitespace()?(this.restoreAtMark(e),null):(this.accept(p.Colon),this.hasWhitespace()||!t.addChild(this._parseIdent())?this.finish(t,y.IdentifierExpected):this.finish(t))}_tryParsePrio(){const e=this.mark(),t=this._parsePrio();return t||(this.restoreAtMark(e),null)}_parsePrio(){if(!this.peek(p.Exclamation))return null;const e=this.createNode(b.Prio);return this.accept(p.Exclamation)&&this.acceptIdent("important")?this.finish(e):null}_parseExpr(e=!1){const t=this.create(vl);if(!t.addChild(this._parseBinaryExpr()))return null;for(;;){if(this.peek(p.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(fp);return this.acceptUnicodeRange()?this.finish(e):null}_parseNamedLine(){if(!this.peek(p.BracketL))return null;const e=this.createNode(b.GridLine);for(this.consumeToken();e.addChild(this._parseIdent()););return this.accept(p.BracketR)?this.finish(e):this.finish(e,y.RightSquareBracketExpected)}_parseBinaryExpr(e,t){let n=this.create(Pi);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,y.TermExpected);n=this.finish(n);const r=this._parseOperator();return r&&(n=this._parseBinaryExpr(n,r)),this.finish(n)}_parseTerm(){let e=this.create(Wp);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(p.ParenthesisL))return null;const e=this.create(O);return this.consumeToken(),e.addChild(this._parseExpr()),this.accept(p.ParenthesisR)?this.finish(e):this.finish(e,y.RightParenthesisExpected)}_parseNumeric(){if(this.peek(p.Num)||this.peek(p.Percentage)||this.peek(p.Resolution)||this.peek(p.Length)||this.peek(p.EMS)||this.peek(p.EXS)||this.peek(p.Angle)||this.peek(p.Time)||this.peek(p.Dimension)||this.peek(p.ContainerQueryLength)||this.peek(p.Freq)){const e=this.create(Oi);return this.consumeToken(),this.finish(e)}return null}_parseStringLiteral(){if(!this.peek(p.String)&&!this.peek(p.BadString))return null;const e=this.createNode(b.StringLiteral);return this.consumeToken(),this.finish(e)}_parseURILiteral(){if(!this.peekRegExp(p.Ident,/^url(-prefix)?$/i))return null;const e=this.mark(),t=this.createNode(b.URILiteral);return this.accept(p.Ident),this.hasWhitespace()||!this.peek(p.ParenthesisL)?(this.restoreAtMark(e),null):(this.scanner.inURL=!0,this.consumeToken(),t.addChild(this._parseURLArgument()),this.scanner.inURL=!1,this.accept(p.ParenthesisR)?this.finish(t):this.finish(t,y.RightParenthesisExpected))}_parseURLArgument(){const e=this.create(O);return!this.accept(p.String)&&!this.accept(p.BadString)&&!this.acceptUnquotedString()?null:this.finish(e)}_parseIdent(e){if(!this.peek(p.Ident))return null;const t=this.create(Ae);return e&&(t.referenceTypes=e),t.isCustomProperty=this.peekRegExp(p.Ident,/^--/),this.consumeToken(),this.finish(t)}_parseFunction(){const e=this.mark(),t=this.create(Cn);if(!t.setIdentifier(this._parseFunctionIdentifier()))return null;if(this.hasWhitespace()||!this.accept(p.ParenthesisL))return this.restoreAtMark(e),null;if(t.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(p.Comma)&&!this.peek(p.ParenthesisR);)t.getArguments().addChild(this._parseFunctionArgument())||this.markError(t,y.ExpressionExpected);return this.accept(p.ParenthesisR)?this.finish(t):this.finish(t,y.RightParenthesisExpected)}_parseFunctionIdentifier(){if(!this.peek(p.Ident))return null;const e=this.create(Ae);if(e.referenceTypes=[J.Function],this.acceptIdent("progid")){if(this.accept(p.Colon))for(;this.accept(p.Ident)&&this.acceptDelim("."););return this.finish(e)}return this.consumeToken(),this.finish(e)}_parseFunctionArgument(){const e=this.create(Xt);return e.setValue(this._parseExpr(!0))?this.finish(e):null}_parseHexColor(){if(this.peekRegExp(p.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(Ti);return this.consumeToken(),this.finish(e)}else return null}};function wm(e,t){let n=0,r=e.length;if(r===0)return 0;for(;n<r;){let i=Math.floor((n+r)/2);t(e[i])?r=i:n=i+1}return n}function Tc(e,t){return e.indexOf(t)!==-1}function Sr(...e){const t=[];for(const n of e)for(const r of n)Tc(t,r)||t.push(r);return t}var Oc=class{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=wm(this.children,s=>s.offset>n);if(r===0)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<this.symbols.length;n++){const r=this.symbols[n];if(r.name===e&&r.type===t)return r}return null}getSymbols(){return this.symbols}},ym=class extends Oc{constructor(){super(0,Number.MAX_VALUE)}},Cr=class{constructor(e,t,n,r){this.name=e,this.value=t,this.node=n,this.type=r}},xm=class{constructor(e){this.scope=e}addSymbol(e,t,n,r){if(e.offset!==-1){const i=this.scope.findScope(e.offset,e.length);i&&i.addSymbol(new Cr(t,n,e,r))}}addScope(e){if(e.offset!==-1){const t=this.scope.findScope(e.offset,e.length);if(t&&(t.offset!==e.offset||t.length!==e.length)){const n=new Oc(e.offset,e.length);return t.addChild(n),n}return t}return null}addSymbolToChildScope(e,t,n,r,i){if(e&&e.offset!==-1){const s=this.addScope(e);s&&s.addSymbol(new Cr(n,r,t,i))}}visitNode(e){switch(e.type){case b.Keyframe:return this.addSymbol(e,e.getName(),void 0,J.Keyframe),!0;case b.CustomPropertyDeclaration:return this.visitCustomPropertyDeclarationNode(e);case b.VariableDeclaration:return this.visitVariableDeclarationNode(e);case b.Ruleset:return this.visitRuleSet(e);case b.MixinDeclaration:return this.addSymbol(e,e.getName(),void 0,J.Mixin),!0;case b.FunctionDeclaration:return this.addSymbol(e,e.getName(),void 0,J.Function),!0;case b.FunctionParameter:return this.visitFunctionParameterNode(e);case b.Declarations:return this.addScope(e),!0;case b.For:const t=e,n=t.getDeclarations();return n&&t.variable&&this.addSymbolToChildScope(n,t.variable,t.variable.getName(),void 0,J.Variable),!0;case b.Each:{const r=e,i=r.getDeclarations();if(i){const s=r.getVariables().getChildren();for(const a of s)this.addSymbolToChildScope(i,a,a.getName(),void 0,J.Variable)}return!0}}return!0}visitRuleSet(e){const t=this.scope.findScope(e.offset,e.length);if(t)for(const n of e.getSelectors().getChildren())n instanceof Sn&&n.getChildren().length===1&&t.addSymbol(new Cr(n.getChild(0).getText(),void 0,n,J.Rule));return!0}visitVariableDeclarationNode(e){const t=e.getValue()?e.getValue().getText():void 0;return this.addSymbol(e,e.getName(),t,J.Variable),!0}visitFunctionParameterNode(e){const t=e.getParent().getDeclarations();if(t){const n=e.getDefaultValue(),r=n?n.getText():void 0;this.addSymbolToChildScope(t,e,e.getName(),r,J.Variable)}return!0}visitCustomPropertyDeclarationNode(e){const t=e.getValue()?e.getValue().getText():"";return this.addCSSVariable(e.getProperty(),e.getProperty().getName(),t,J.Variable),!0}addCSSVariable(e,t,n,r){e.offset!==-1&&this.scope.addSymbol(new Cr(t,n,e,r))}},is=class{constructor(e){this.global=new ym,e.acceptVisitor(new xm(this.global))}findSymbolsAtOffset(e,t){let n=this.global.findScope(e,0);const r=[],i={};for(;n;){const s=n.getSymbols();for(let a=0;a<s.length;a++){const l=s[a];l.type===t&&!i[l.name]&&(r.push(l),i[l.name]=!0)}n=n.parent}return r}internalFindSymbol(e,t){let n=e;if(e.parent instanceof ar&&e.parent.getParent()instanceof se&&(n=e.parent.getParent().getDeclarations()),e.parent instanceof Xt&&e.parent.getParent()instanceof Cn){const s=e.parent.getParent().getIdentifier();if(s){const a=this.internalFindSymbol(s,[J.Function]);a&&(n=a.node.getDeclarations())}}if(!n)return null;const r=e.getText();let i=this.global.findScope(n.offset,n.length);for(;i;){for(let s=0;s<t.length;s++){const a=t[s],l=i.getSymbol(r,a);if(l)return l}i=i.parent}return null}evaluateReferenceTypes(e){if(e instanceof Ae){const n=e.referenceTypes;if(n)return n;{if(e.isCustomProperty)return[J.Variable];const r=mp(e);if(r){const i=r.getNonPrefixedPropertyName();if((i==="animation"||i==="animation-name")&&r.getValue()&&r.getValue().offset===e.offset)return[J.Keyframe]}}}else if(e instanceof Ui)return[J.Variable];return e.findAParent(b.Selector,b.ExtendsReference)?[J.Rule]:null}findSymbolFromNode(e){if(!e)return null;for(;e.type===b.Interpolation;)e=e.getParent();const t=this.evaluateReferenceTypes(e);return t?this.internalFindSymbol(e,t):null}matchesSymbol(e,t){if(!e)return!1;for(;e.type===b.Interpolation;)e=e.getParent();if(!e.matches(t.name))return!1;const n=this.evaluateReferenceTypes(e);return!n||n.indexOf(t.type)===-1?!1:this.internalFindSymbol(e,n)===t}findSymbol(e,t,n){let r=this.global.findScope(n);for(;r;){const i=r.getSymbol(e,t);if(i)return i;r=r.parent}return null}},Wc;(()=>{var e={470:i=>{function s(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function a(o,c){for(var d,u="",f=0,m=-1,v=0,w=0;w<=o.length;++w){if(w<o.length)d=o.charCodeAt(w);else{if(d===47)break;d=47}if(d===47){if(!(m===w-1||v===1))if(m!==w-1&&v===2){if(u.length<2||f!==2||u.charCodeAt(u.length-1)!==46||u.charCodeAt(u.length-2)!==46){if(u.length>2){var _=u.lastIndexOf("/");if(_!==u.length-1){_===-1?(u="",f=0):f=(u=u.slice(0,_)).length-1-u.lastIndexOf("/"),m=w,v=0;continue}}else if(u.length===2||u.length===1){u="",f=0,m=w,v=0;continue}}c&&(u.length>0?u+="/..":u="..",f=2)}else u.length>0?u+="/"+o.slice(m+1,w):u=o.slice(m+1,w),f=w-m-1;m=w,v=0}else d===46&&v!==-1?++v:v=-1}return u}var l={resolve:function(){for(var o,c="",d=!1,u=arguments.length-1;u>=-1&&!d;u--){var f;u>=0?f=arguments[u]:(o===void 0&&(o=process.cwd()),f=o),s(f),f.length!==0&&(c=f+"/"+c,d=f.charCodeAt(0)===47)}return c=a(c,!d),d?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(o){if(s(o),o.length===0)return".";var c=o.charCodeAt(0)===47,d=o.charCodeAt(o.length-1)===47;return(o=a(o,!c)).length!==0||c||(o="."),o.length>0&&d&&(o+="/"),c?"/"+o:o},isAbsolute:function(o){return s(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,c=0;c<arguments.length;++c){var d=arguments[c];s(d),d.length>0&&(o===void 0?o=d:o+="/"+d)}return o===void 0?".":l.normalize(o)},relative:function(o,c){if(s(o),s(c),o===c||(o=l.resolve(o))===(c=l.resolve(c)))return"";for(var d=1;d<o.length&&o.charCodeAt(d)===47;++d);for(var u=o.length,f=u-d,m=1;m<c.length&&c.charCodeAt(m)===47;++m);for(var v=c.length-m,w=f<v?f:v,_=-1,R=0;R<=w;++R){if(R===w){if(v>w){if(c.charCodeAt(m+R)===47)return c.slice(m+R+1);if(R===0)return c.slice(m+R)}else f>w&&(o.charCodeAt(d+R)===47?_=R:R===0&&(_=0));break}var I=o.charCodeAt(d+R);if(I!==c.charCodeAt(m+R))break;I===47&&(_=R)}var N="";for(R=d+_+1;R<=u;++R)R!==u&&o.charCodeAt(R)!==47||(N.length===0?N+="..":N+="/..");return N.length>0?N+c.slice(m+_):(m+=_,c.charCodeAt(m)===47&&++m,c.slice(m))},_makeLong:function(o){return o},dirname:function(o){if(s(o),o.length===0)return".";for(var c=o.charCodeAt(0),d=c===47,u=-1,f=!0,m=o.length-1;m>=1;--m)if((c=o.charCodeAt(m))===47){if(!f){u=m;break}}else f=!1;return u===-1?d?"/":".":d&&u===1?"//":o.slice(0,u)},basename:function(o,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(o);var d,u=0,f=-1,m=!0;if(c!==void 0&&c.length>0&&c.length<=o.length){if(c.length===o.length&&c===o)return"";var v=c.length-1,w=-1;for(d=o.length-1;d>=0;--d){var _=o.charCodeAt(d);if(_===47){if(!m){u=d+1;break}}else w===-1&&(m=!1,w=d+1),v>=0&&(_===c.charCodeAt(v)?--v==-1&&(f=d):(v=-1,f=w))}return u===f?f=w:f===-1&&(f=o.length),o.slice(u,f)}for(d=o.length-1;d>=0;--d)if(o.charCodeAt(d)===47){if(!m){u=d+1;break}}else f===-1&&(m=!1,f=d+1);return f===-1?"":o.slice(u,f)},extname:function(o){s(o);for(var c=-1,d=0,u=-1,f=!0,m=0,v=o.length-1;v>=0;--v){var w=o.charCodeAt(v);if(w!==47)u===-1&&(f=!1,u=v+1),w===46?c===-1?c=v:m!==1&&(m=1):c!==-1&&(m=-1);else if(!f){d=v+1;break}}return c===-1||u===-1||m===0||m===1&&c===u-1&&c===d+1?"":o.slice(c,u)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return(function(c,d){var u=d.dir||d.root,f=d.base||(d.name||"")+(d.ext||"");return u?u===d.root?u+f:u+"/"+f:f})(0,o)},parse:function(o){s(o);var c={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return c;var d,u=o.charCodeAt(0),f=u===47;f?(c.root="/",d=1):d=0;for(var m=-1,v=0,w=-1,_=!0,R=o.length-1,I=0;R>=d;--R)if((u=o.charCodeAt(R))!==47)w===-1&&(_=!1,w=R+1),u===46?m===-1?m=R:I!==1&&(I=1):m!==-1&&(I=-1);else if(!_){v=R+1;break}return m===-1||w===-1||I===0||I===1&&m===w-1&&m===v+1?w!==-1&&(c.base=c.name=v===0&&f?o.slice(1,w):o.slice(v,w)):(v===0&&f?(c.name=o.slice(1,m),c.base=o.slice(1,w)):(c.name=o.slice(v,m),c.base=o.slice(v,w)),c.ext=o.slice(m,w)),v>0?c.dir=o.slice(0,v-1):f&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};l.posix=l,i.exports=l}},t={};function n(i){var s=t[i];if(s!==void 0)return s.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.d=(i,s)=>{for(var a in s)n.o(s,a)&&!n.o(i,a)&&Object.defineProperty(i,a,{enumerable:!0,get:s[a]})},n.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),n.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var r={};(()=>{let i;n.r(r),n.d(r,{URI:()=>f,Utils:()=>ee}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\\w[\\w\\d+.-]*$/,a=/^\\//,l=/^\\/\\//;function o(M,k){if(!M.scheme&&k)throw new Error(\`[UriError]: Scheme is missing: {scheme: "", authority: "\${M.authority}", path: "\${M.path}", query: "\${M.query}", fragment: "\${M.fragment}"}\`);if(M.scheme&&!s.test(M.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(M.path){if(M.authority){if(!a.test(M.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(M.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const c="",d="/",u=/^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;class f{constructor(k,C,S,z,D,L=!1){Ct(this,"scheme");Ct(this,"authority");Ct(this,"path");Ct(this,"query");Ct(this,"fragment");typeof k=="object"?(this.scheme=k.scheme||c,this.authority=k.authority||c,this.path=k.path||c,this.query=k.query||c,this.fragment=k.fragment||c):(this.scheme=(function(U,B){return U||B?U:"file"})(k,L),this.authority=C||c,this.path=(function(U,B){switch(U){case"https":case"http":case"file":B?B[0]!==d&&(B=d+B):B=d}return B})(this.scheme,S||c),this.query=z||c,this.fragment=D||c,o(this,L))}static isUri(k){return k instanceof f||!!k&&typeof k.authority=="string"&&typeof k.fragment=="string"&&typeof k.path=="string"&&typeof k.query=="string"&&typeof k.scheme=="string"&&typeof k.fsPath=="string"&&typeof k.with=="function"&&typeof k.toString=="function"}get fsPath(){return I(this)}with(k){if(!k)return this;let{scheme:C,authority:S,path:z,query:D,fragment:L}=k;return C===void 0?C=this.scheme:C===null&&(C=c),S===void 0?S=this.authority:S===null&&(S=c),z===void 0?z=this.path:z===null&&(z=c),D===void 0?D=this.query:D===null&&(D=c),L===void 0?L=this.fragment:L===null&&(L=c),C===this.scheme&&S===this.authority&&z===this.path&&D===this.query&&L===this.fragment?this:new v(C,S,z,D,L)}static parse(k,C=!1){const S=u.exec(k);return S?new v(S[2]||c,A(S[4]||c),A(S[5]||c),A(S[7]||c),A(S[9]||c),C):new v(c,c,c,c,c)}static file(k){let C=c;if(i&&(k=k.replace(/\\\\/g,d)),k[0]===d&&k[1]===d){const S=k.indexOf(d,2);S===-1?(C=k.substring(2),k=d):(C=k.substring(2,S),k=k.substring(S)||d)}return new v("file",C,k,c,c)}static from(k){const C=new v(k.scheme,k.authority,k.path,k.query,k.fragment);return o(C,!0),C}toString(k=!1){return N(this,k)}toJSON(){return this}static revive(k){if(k){if(k instanceof f)return k;{const C=new v(k);return C._formatted=k.external,C._fsPath=k._sep===m?k.fsPath:null,C}}return k}}const m=i?1:void 0;class v extends f{constructor(){super(...arguments);Ct(this,"_formatted",null);Ct(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=I(this)),this._fsPath}toString(C=!1){return C?N(this,!0):(this._formatted||(this._formatted=N(this,!1)),this._formatted)}toJSON(){const C={$mid:1};return this._fsPath&&(C.fsPath=this._fsPath,C._sep=m),this._formatted&&(C.external=this._formatted),this.path&&(C.path=this.path),this.scheme&&(C.scheme=this.scheme),this.authority&&(C.authority=this.authority),this.query&&(C.query=this.query),this.fragment&&(C.fragment=this.fragment),C}}const w={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function _(M,k,C){let S,z=-1;for(let D=0;D<M.length;D++){const L=M.charCodeAt(D);if(L>=97&&L<=122||L>=65&&L<=90||L>=48&&L<=57||L===45||L===46||L===95||L===126||k&&L===47||C&&L===91||C&&L===93||C&&L===58)z!==-1&&(S+=encodeURIComponent(M.substring(z,D)),z=-1),S!==void 0&&(S+=M.charAt(D));else{S===void 0&&(S=M.substr(0,D));const U=w[L];U!==void 0?(z!==-1&&(S+=encodeURIComponent(M.substring(z,D)),z=-1),S+=U):z===-1&&(z=D)}}return z!==-1&&(S+=encodeURIComponent(M.substring(z))),S!==void 0?S:M}function R(M){let k;for(let C=0;C<M.length;C++){const S=M.charCodeAt(C);S===35||S===63?(k===void 0&&(k=M.substr(0,C)),k+=w[S]):k!==void 0&&(k+=M[C])}return k!==void 0?k:M}function I(M,k){let C;return C=M.authority&&M.path.length>1&&M.scheme==="file"?\`//\${M.authority}\${M.path}\`:M.path.charCodeAt(0)===47&&(M.path.charCodeAt(1)>=65&&M.path.charCodeAt(1)<=90||M.path.charCodeAt(1)>=97&&M.path.charCodeAt(1)<=122)&&M.path.charCodeAt(2)===58?M.path[1].toLowerCase()+M.path.substr(2):M.path,i&&(C=C.replace(/\\//g,"\\\\")),C}function N(M,k){const C=k?R:_;let S="",{scheme:z,authority:D,path:L,query:U,fragment:B}=M;if(z&&(S+=z,S+=":"),(D||z==="file")&&(S+=d,S+=d),D){let q=D.indexOf("@");if(q!==-1){const ae=D.substr(0,q);D=D.substr(q+1),q=ae.lastIndexOf(":"),q===-1?S+=C(ae,!1,!1):(S+=C(ae.substr(0,q),!1,!1),S+=":",S+=C(ae.substr(q+1),!1,!0)),S+="@"}D=D.toLowerCase(),q=D.lastIndexOf(":"),q===-1?S+=C(D,!1,!0):(S+=C(D.substr(0,q),!1,!0),S+=D.substr(q))}if(L){if(L.length>=3&&L.charCodeAt(0)===47&&L.charCodeAt(2)===58){const q=L.charCodeAt(1);q>=65&&q<=90&&(L=\`/\${String.fromCharCode(q+32)}:\${L.substr(3)}\`)}else if(L.length>=2&&L.charCodeAt(1)===58){const q=L.charCodeAt(0);q>=65&&q<=90&&(L=\`\${String.fromCharCode(q+32)}:\${L.substr(2)}\`)}S+=C(L,!0,!1)}return U&&(S+="?",S+=C(U,!1,!1)),B&&(S+="#",S+=k?B:_(B,!1,!1)),S}function E(M){try{return decodeURIComponent(M)}catch{return M.length>3?M.substr(0,3)+E(M.substr(3)):M}}const F=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function A(M){return M.match(F)?M.replace(F,k=>E(k)):M}var T=n(470);const P=T.posix||T,j="/";var ee;(function(M){M.joinPath=function(k,...C){return k.with({path:P.join(k.path,...C)})},M.resolvePath=function(k,...C){let S=k.path,z=!1;S[0]!==j&&(S=j+S,z=!0);let D=P.resolve(S,...C);return z&&D[0]===j&&!k.authority&&(D=D.substring(1)),k.with({path:D})},M.dirname=function(k){if(k.path.length===0||k.path===j)return k;let C=P.dirname(k.path);return C.length===1&&C.charCodeAt(0)===46&&(C=""),k.with({path:C})},M.basename=function(k){return P.basename(k.path)},M.extname=function(k){return P.extname(k.path)}})(ee||(ee={}))})(),Wc=r})();var{URI:ss,Utils:wt}=Wc;function as(e){return wt.dirname(ss.parse(e)).toString(!0)}function Kt(e,...t){return wt.joinPath(ss.parse(e),...t).toString(!0)}var Sm=class{constructor(e){this.readDirectory=e,this.literalCompletions=[],this.importCompletions=[]}onCssURILiteralValue(e){this.literalCompletions.push(e)}onCssImportPath(e){this.importCompletions.push(e)}async computeCompletions(e,t){const n={items:[],isIncomplete:!1};for(const r of this.literalCompletions){const i=r.uriValue,s=os(i);if(s==="."||s==="..")n.isIncomplete=!0;else{const a=await this.providePathSuggestions(i,r.position,r.range,e,t);for(let l of a)n.items.push(l)}}for(const r of this.importCompletions){const i=r.pathValue,s=os(i);if(s==="."||s==="..")n.isIncomplete=!0;else{let a=await this.providePathSuggestions(i,r.position,r.range,e,t);e.languageId==="scss"&&a.forEach(l=>{pe(l.label,"_")&&cl(l.label,".scss")&&(l.textEdit?l.textEdit.newText=l.label.slice(1,-5):l.label=l.label.slice(1,-5))});for(let l of a)n.items.push(l)}}return n}async providePathSuggestions(e,t,n,r,i){const s=os(e),a=pe(e,"'")||pe(e,'"'),l=a?s.slice(0,t.character-(n.start.character+1)):s.slice(0,t.character-n.start.character),o=r.uri,c=a?Em(n,1,-1):n,d=km(l,s,c),u=l.substring(0,l.lastIndexOf("/")+1);let f=i.resolveReference(u||".",o);if(f)try{const m=[],v=await this.readDirectory(f);for(const[w,_]of v)w.charCodeAt(0)!==Cm&&(_===Nn.Directory||Kt(f,w)!==o)&&m.push(_m(w,_===Nn.Directory,d));return m}catch{}return[]}},Cm=46;function os(e){return pe(e,"'")||pe(e,'"')?e.slice(1,-1):e}function km(e,t,n){let r;const i=e.lastIndexOf("/");if(i===-1)r=n;else{const s=t.slice(i+1),a=_r(n.end,-s.length),l=s.indexOf(" ");let o;l!==-1?o=_r(a,l):o=n.end,r=X.create(a,o)}return r}function _m(e,t,n){return t?(e=e+"/",{label:kr(e),kind:V.Folder,textEdit:$.replace(n,kr(e)),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}):{label:kr(e),kind:V.File,textEdit:$.replace(n,kr(e))}}function kr(e){return e.replace(/(\\s|\\(|\\)|,|"|')/g,"\\\\$1")}function _r(e,t){return xe.create(e.line,e.character+t)}function Em(e,t,n){const r=_r(e.start,t),i=_r(e.end,n);return X.create(r,i)}var rt=Ne.Snippet,Uc={title:"Suggest",command:"editor.action.triggerSuggest"},He;(function(e){e.Enums=" ",e.Normal="d",e.VendorPrefixed="x",e.Term="y",e.Variable="z"})(He||(He={}));var ls=class{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 is(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 s=new Sm(this.lsOptions.fileSystemProvider.readDirectory),a=this.completionParticipants;this.completionParticipants=[s].concat(a);const l=this.doComplete(e,t,n,i);try{const o=await s.computeCompletions(e,r);return{isIncomplete:l.isIncomplete||o.isIncomplete,itemDefaults:l.itemDefaults,items:o.items.concat(l.items)}}finally{this.completionParticipants=a}}doComplete(e,t,n,r){this.offset=e.offsetAt(t),this.position=t,this.currentWord=Dm(e,this.offset),this.defaultReplaceRange=X.create(xe.create(this.position.line,this.position.character-this.currentWord.length),this.position),this.textDocument=e,this.styleSheet=n,this.documentSettings=r;try{const i={isIncomplete:!1,itemDefaults:{editRange:{start:{line:t.line,character:t.character-this.currentWord.length},end:t}},items:[]};this.nodePath=Ni(this.styleSheet,this.offset);for(let s=this.nodePath.length-1;s>=0;s--){const a=this.nodePath[s];if(a instanceof Mi)this.getCompletionsForDeclarationProperty(a.getParent(),i);else if(a instanceof vl)a.parent instanceof Wi?this.getVariableProposals(null,i):this.getCompletionsForExpression(a,i);else if(a instanceof Jt){const l=a.findAParent(b.ExtendsReference,b.Ruleset);if(l)if(l.type===b.ExtendsReference)this.getCompletionsForExtendsReference(l,a,i);else{const o=l;this.getCompletionsForSelector(o,o&&o.isNested(),i)}}else if(a instanceof Xt)this.getCompletionsForFunctionArgument(a,a.getParent(),i);else if(a instanceof Di)this.getCompletionsForDeclarations(a,i);else if(a instanceof lr)this.getCompletionsForVariableDeclaration(a,i);else if(a instanceof Et)this.getCompletionsForRuleSet(a,i);else if(a instanceof Wi)this.getCompletionsForInterpolation(a,i);else if(a instanceof or)this.getCompletionsForFunctionDeclaration(a,i);else if(a instanceof cr)this.getCompletionsForMixinReference(a,i);else if(a instanceof Cn)this.getCompletionsForFunctionArgument(null,a,i);else if(a instanceof zi)this.getCompletionsForSupports(a,i);else if(a instanceof kn)this.getCompletionsForSupportsCondition(a,i);else if(a instanceof _n)this.getCompletionsForExtendsReference(a,null,i);else if(a.type===b.URILiteral)this.getCompletionForUriLiteralValue(a,i);else if(a.parent===null)this.getCompletionForTopLevel(i);else if(a.type===b.StringLiteral&&this.isImportPathParent(a.parent.type))this.getCompletionForImportPath(a,i);else continue;if(i.items.length>0||this.offset>a.offset)return this.finalize(i)}return this.getCompletionsForStylesheet(i),i.items.length===0&&this.variablePrefix&&this.currentWord.indexOf(this.variablePrefix)===0&&this.getVariableProposals(null,i),this.finalize(i)}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===b.Import}finalize(e){return e}findInNodePath(...e){for(let t=this.nodePath.length-1;t>=0;t--){const n=this.nodePath[t];if(e.indexOf(n.type)!==-1)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(s=>{let a,l,o=!1;e?(a=this.getCompletionRange(e.getProperty()),l=s.name,Le(e.colonPosition)||(l+=": ",o=!0)):(a=this.getCompletionRange(null),l=s.name+": ",o=!0),!e&&r&&(l+="$0;"),e&&!e.semicolonPosition&&r&&this.offset>=this.textDocument.offsetAt(a.end)&&(l+="$0;");const c={label:s.name,documentation:bt(s,this.doesSupportMarkdown()),tags:Dn(s)?[Rt.Deprecated]:[],textEdit:$.replace(a,l),insertTextFormat:Ne.Snippet,kind:V.Property};s.restrictions||(o=!1),n&&o&&(c.command=Uc);const u=(255-(typeof s.relevance=="number"?Math.min(Math.max(s.relevance,0),99):50)).toString(16),f=pe(s.name,"-")?He.VendorPrefixed:He.Normal;c.sortText=f+"_"+u,t.items.push(c)}),this.completionParticipants.forEach(s=>{s.onCssProperty&&s.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(s=>{s.onCssPropertyValue&&s.onCssPropertyValue({propertyName:n,propertyValue:this.currentWord,range:this.getCompletionRange(i)})}),r){if(r.restrictions)for(const s of r.restrictions)switch(s){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);break}this.getValueEnumProposals(r,i,t),this.getCSSWideKeywordProposals(r,i,t),this.getUnitProposals(r,i,t)}else{const s=Fm(this.styleSheet,e);for(const a of s.getEntries())t.items.push({label:a,textEdit:$.replace(this.getCompletionRange(i),a),kind:V.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=r.name,s;if(cl(i,")")){const o=i.lastIndexOf("(");o!==-1&&(i=i.substring(0,o+1)+"$1"+i.substring(o+1),s=rt)}let a=He.Enums;pe(r.name,"-")&&(a+=He.VendorPrefixed);const l={label:r.name,documentation:bt(r,this.doesSupportMarkdown()),tags:Dn(e)?[Rt.Deprecated]:[],textEdit:$.replace(this.getCompletionRange(t),i),sortText:a,kind:V.Value,insertTextFormat:s};n.items.push(l)}return n}getCSSWideKeywordProposals(e,t,n){for(const r in Ic)n.items.push({label:r,documentation:Ic[r],textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});for(const r in Mc){const i=Zt(r);n.items.push({label:r,documentation:Mc[r],textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Function,insertTextFormat:rt,command:pe(r,"var")?Uc: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,J.Variable);for(const r of n){const i=pe(r.name,"--")?\`var(\${r.name})\`:r.name,s={label:r.name,documentation:r.value?hl(r.value):r.value,textEdit:$.replace(this.getCompletionRange(e),i),kind:V.Variable,sortText:He.Variable};if(typeof s.documentation=="string"&&xc(s.documentation)&&(s.kind=V.Color),r.node.type===b.FunctionParameter){const a=r.node.getParent();a.type===b.MixinDeclaration&&(s.detail=g("argument from '{0}'",a.getName()))}t.items.push(s)}return t}getVariableProposalsForCSSVarFunction(e){const t=new cs;this.styleSheet.acceptVisitor(new Nm(t,this.offset));let n=this.getSymbolContext().findSymbolsAtOffset(this.offset,J.Variable);for(const r of n){if(pe(r.name,"--")){const i={label:r.name,documentation:r.value?hl(r.value):r.value,textEdit:$.replace(this.getCompletionRange(null),r.name),kind:V.Variable};typeof i.documentation=="string"&&xc(i.documentation)&&(i.kind=V.Color),e.items.push(i)}t.remove(r.name)}for(const r of t.getEntries())if(pe(r,"--")){const i={label:r,textEdit:$.replace(this.getCompletionRange(null),r),kind:V.Variable};e.items.push(i)}return e}getUnitProposals(e,t,n){let r="0";if(this.currentWord.length>0){const i=this.currentWord.match(/^-?\\d[\\.\\d+]*/);i&&(r=i[0],n.isIncomplete=r.length===this.currentWord.length)}else this.currentWord.length===0&&(n.isIncomplete=!0);if(t&&t.parent&&t.parent.type===b.Term&&(t=t.getParent()),e.restrictions)for(const i of e.restrictions){const s=Pc[i];if(s)for(const a of s){const l=r+a;n.items.push({label:l,textEdit:$.replace(this.getCompletionRange(t),l),kind:V.Unit})}}return n}getCompletionRange(e){if(e&&e.offset<=this.offset&&this.offset<=e.end){const t=e.end!==-1?this.textDocument.positionAt(e.end):this.position,n=this.textDocument.positionAt(e.offset);if(n.line===t.line)return X.create(n,t)}return this.defaultReplaceRange}getColorProposals(e,t,n){for(const i in vr)n.items.push({label:i,documentation:vr[i],textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Color});for(const i in rs)n.items.push({label:i,documentation:rs[i],textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Value});const r=new cs;this.styleSheet.acceptVisitor(new Rm(r,this.offset));for(const i of r.getEntries())n.items.push({label:i,textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Color});for(const i of im)n.items.push({label:i.label,detail:i.func,documentation:i.desc,textEdit:$.replace(this.getCompletionRange(t),i.insertText),insertTextFormat:rt,kind:V.Function});return n}getPositionProposals(e,t,n){for(const r in Ec)n.items.push({label:r,documentation:Ec[r],textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});return n}getRepeatStyleProposals(e,t,n){for(const r in Fc)n.items.push({label:r,documentation:Fc[r],textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});return n}getLineStyleProposals(e,t,n){for(const r in Rc)n.items.push({label:r,documentation:Rc[r],textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});return n}getLineWidthProposals(e,t,n){for(const r of fm)n.items.push({label:r,textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});return n}getGeometryBoxProposals(e,t,n){for(const r in Dc)n.items.push({label:r,documentation:Dc[r],textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});return n}getBoxProposals(e,t,n){for(const r in Nc)n.items.push({label:r,documentation:Nc[r],textEdit:$.replace(this.getCompletionRange(t),r),kind:V.Value});return n}getImageProposals(e,t,n){for(const r in Ac){const i=Zt(r);n.items.push({label:r,documentation:Ac[r],textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Function,insertTextFormat:r!==i?rt:void 0})}return n}getTimingFunctionProposals(e,t,n){for(const r in Lc){const i=Zt(r);n.items.push({label:r,documentation:Lc[r],textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Function,insertTextFormat:r!==i?rt:void 0})}return n}getBasicShapeProposals(e,t,n){for(const r in zc){const i=Zt(r);n.items.push({label:r,documentation:zc[r],textEdit:$.replace(this.getCompletionRange(t),i),kind:V.Function,insertTextFormat:r!==i?rt:void 0})}return n}getCompletionsForStylesheet(e){const t=this.styleSheet.findFirstChildBeforeOffset(this.offset);return t?t instanceof Et?this.getCompletionsForRuleSet(t,e):t instanceof zi?this.getCompletionsForSupports(t,e):e:this.getCompletionForTopLevel(e)}getCompletionForTopLevel(e){return this.cssDataManager.getAtDirectives().forEach(t=>{e.items.push({label:t.name,textEdit:$.replace(this.getCompletionRange(null),t.name),documentation:bt(t,this.doesSupportMarkdown()),tags:Dn(t)?[Rt.Deprecated]:[],kind:V.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(b.PseudoSelector,b.IdentifierSelector,b.ClassSelector,b.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=X.create(xe.create(this.position.line,this.position.character-this.currentWord.length),this.position)),this.cssDataManager.getPseudoClasses().forEach(o=>{const c=Zt(o.name),d={label:o.name,textEdit:$.replace(this.getCompletionRange(r),c),documentation:bt(o,this.doesSupportMarkdown()),tags:Dn(o)?[Rt.Deprecated]:[],kind:V.Function,insertTextFormat:o.name!==c?rt:void 0};pe(o.name,":-")&&(d.sortText=He.VendorPrefixed),n.items.push(d)}),this.cssDataManager.getPseudoElements().forEach(o=>{const c=Zt(o.name),d={label:o.name,textEdit:$.replace(this.getCompletionRange(r),c),documentation:bt(o,this.doesSupportMarkdown()),tags:Dn(o)?[Rt.Deprecated]:[],kind:V.Function,insertTextFormat:o.name!==c?rt:void 0};pe(o.name,"::-")&&(d.sortText=He.VendorPrefixed),n.items.push(d)}),!t){for(const o of gm)n.items.push({label:o,textEdit:$.replace(this.getCompletionRange(r),o),kind:V.Keyword});for(const o of bm)n.items.push({label:o,textEdit:$.replace(this.getCompletionRange(r),o),kind:V.Keyword})}const a={};a[this.currentWord]=!0;const l=this.textDocument.getText();if(this.styleSheet.accept(o=>{if(o.type===b.SimpleSelector&&o.length>0){const c=l.substr(o.offset,o.length);return c.charAt(0)==="."&&!a[c]&&(a[c]=!0,n.items.push({label:c,textEdit:$.replace(this.getCompletionRange(r),c),kind:V.Keyword})),!1}return!0}),e&&e.isNested()){const o=e.getSelectors().findFirstChildBeforeOffset(this.offset);o&&e.getSelectors().getChildren().indexOf(o)===0&&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 Ii){const r=n;if(!Le(r.colonPosition)||this.offset<=r.colonPosition)return this.getCompletionsForDeclarationProperty(r,t);if(Le(r.semicolonPosition)&&r.semicolonPosition<this.offset)return this.offset===r.semicolonPosition+1?t:this.getCompletionsForDeclarationProperty(null,t);if(r instanceof qe)return this.getCompletionsForDeclarationValue(r,t)}else n instanceof _n?this.getCompletionsForExtendsReference(n,null,t):this.currentWord&&this.currentWord[0]==="@"?this.getCompletionsForDeclarationProperty(null,t):n instanceof Et&&this.getCompletionsForDeclarationProperty(null,t);return t}getCompletionsForVariableDeclaration(e,t){return this.offset&&Le(e.colonPosition)&&this.offset>e.colonPosition&&this.getVariableProposals(e.getValue()||null,t),t}getCompletionsForExpression(e,t){const n=e.getParent();if(n instanceof Xt)return this.getCompletionsForFunctionArgument(n,n.getParent(),t),t;const r=e.findParent(b.Declaration);if(!r)return this.getTermProposals(void 0,null,t),t;const i=e.findChildAtOffset(this.offset,!0);return i?i instanceof Oi||i instanceof Ae?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<n.end&&this.getTermProposals(void 0,null,t),t}getCompletionsForMixinReference(e,t){const n=this.getSymbolContext().findSymbolsAtOffset(this.offset,J.Mixin);for(const i of n)i.node instanceof En&&t.items.push(this.makeTermProposal(i,i.node.getParameters(),null));const r=e.getIdentifier()||null;return this.completionParticipants.forEach(i=>{i.onCssMixinReference&&i.onCssMixinReference({mixinName:this.currentWord,range:this.getCompletionRange(r)})}),t}getTermProposals(e,t,n){const r=this.getSymbolContext().findSymbolsAtOffset(this.offset,J.Function);for(const i of r)i.node instanceof or&&n.items.push(this.makeTermProposal(i,i.node.getParameters(),t));return n}makeTermProposal(e,t,n){e.node;const r=t.getChildren().map(s=>s instanceof ar?s.getName():s.getText()),i=e.name+"("+r.map((s,a)=>"\${"+(a+1)+":"+s+"}").join(", ")+")";return{label:e.name,detail:e.name+"("+r.join(", ")+")",textEdit:$.replace(this.getCompletionRange(n),i),insertTextFormat:rt,kind:V.Function,sortText:He.Term}}getCompletionsForSupportsCondition(e,t){const n=e.findFirstChildBeforeOffset(this.offset);if(n){if(n instanceof qe)return!Le(n.colonPosition)||this.offset<=n.colonPosition?this.getCompletionsForDeclarationProperty(n,t):this.getCompletionsForDeclarationValue(n,t);if(n instanceof kn)return this.getCompletionsForSupportsCondition(n,t)}return Le(e.lParent)&&this.offset>e.lParent&&(!Le(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 i=e.findFirstChildBeforeOffset(this.offset);return i instanceof kn?this.getCompletionsForSupportsCondition(i,t):t}return this.getCompletionForTopLevel(t)}getCompletionsForExtendsReference(e,t,n){return n}getCompletionForUriLiteralValue(e,t){let n,r,i;if(e.hasChildren()){const s=e.getChild(0);n=s.getText(),r=this.position,i=this.getCompletionRange(s)}else{n="",r=this.position;const s=this.textDocument.positionAt(e.offset+4);i=X.create(s,s)}return this.completionParticipants.forEach(s=>{s.onCssURILiteralValue&&s.onCssURILiteralValue({uriValue:n,position:r,range:i})}),t}getCompletionForImportPath(e,t){return this.completionParticipants.forEach(n=>{n.onCssImportPath&&n.onCssImportPath({pathValue:e.getText(),position:this.position,range:this.getCompletionRange(e)})}),t}hasCharacterAtPosition(e,t){const n=this.textDocument.getText();return e>=0&&e<n.length&&n.charAt(e)===t}doesSupportMarkdown(){if(!Le(this.supportsMarkdown)){if(!Le(this.lsOptions.clientCapabilities))return this.supportsMarkdown=!0,this.supportsMarkdown;const e=this.lsOptions.clientCapabilities.textDocument?.completion?.completionItem?.documentationFormat;this.supportsMarkdown=Array.isArray(e)&&e.indexOf(je.Markdown)!==-1}return this.supportsMarkdown}};function Dn(e){return!!(e.status&&(e.status==="nonstandard"||e.status==="obsolete"))}var cs=class{constructor(){this.entries={}}add(e){this.entries[e]=!0}remove(e){delete this.entries[e]}getEntries(){return Object.keys(this.entries)}};function Zt(e){return e.replace(/\\(\\)$/,"($1)")}function Fm(e,t){const n=t.getFullPropertyName(),r=new cs;function i(l){return(l instanceof Ae||l instanceof Oi||l instanceof Ti)&&r.add(l.getText()),!0}function s(l){const o=l.getFullPropertyName();return n===o}function a(l){if(l instanceof qe&&l!==t&&s(l)){const o=l.getValue();o&&o.accept(i)}return!0}return e.accept(a),r}var Rm=class{constructor(e,t){this.entries=e,this.currentOffset=t}visitNode(e){return(e instanceof Ti||e instanceof Cn&&lm(e))&&(this.currentOffset<e.offset||e.end<this.currentOffset)&&this.entries.add(e.getText()),!0}},Nm=class{constructor(e,t){this.entries=e,this.currentOffset=t}visitNode(e){return e instanceof Ae&&e.isCustomProperty&&(this.currentOffset<e.offset||e.end<this.currentOffset)&&this.entries.add(e.getText()),!0}};function Dm(e,t){let n=t-1;const r=e.getText();for(;n>=0&&\`
38
38
  \\r":{[()]},*>+\`.indexOf(r.charAt(n))===-1;)n--;return r.substring(n+1,t)}var hs=class zs{constructor(){this.parent=null,this.children=null,this.attributes=null}findAttribute(t){if(this.attributes){for(const n of this.attributes)if(n.name===t)return n.value}return null}addChild(t){t instanceof zs&&(t.parent=this),this.children||(this.children=[]),this.children.push(t)}append(t){if(this.attributes){const n=this.attributes[this.attributes.length-1];n.value=n.value+t}}prepend(t){if(this.attributes){const n=this.attributes[0];n.value=t+n.value}}findRoot(){let t=this;for(;t.parent&&!(t.parent instanceof en);)t=t.parent;return t}removeChild(t){if(this.children){const n=this.children.indexOf(t);if(n!==-1)return this.children.splice(n,1),!0}return!1}addAttr(t,n){this.attributes||(this.attributes=[]);for(const r of this.attributes)if(r.name===t){r.value+=" "+n;return}this.attributes.push({name:t,value:n})}clone(t=!0){const n=new zs;if(this.attributes){n.attributes=[];for(const r of this.attributes)n.addAttr(r.name,r.value)}if(t&&this.children){n.children=[];for(let r=0;r<this.children.length;r++)n.addChild(this.children[r].clone())}return n}cloneWithParent(){const t=this.clone(!1);return this.parent&&!(this.parent instanceof en)&&this.parent.cloneWithParent().addChild(t),t}},en=class extends hs{},ds=class extends hs{constructor(e){super(),this.addAttr("name",e)}},Vc=class{constructor(e){this.quote=e,this.result=[]}print(e,t){this.result=[],e instanceof en?e.children&&this.doPrint(e.children,0):this.doPrint([e],0);let n;return t?n=\`\${t.text}
39
39
  … \`+this.result.join(\`
40
40
  \`):n=this.result.join(\`