var tagKeywords_ = /* @__PURE__ */ "a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.bgsound.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.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.marquee.menu.menuitem.meta.meter.nav.nobr.noframes.noscript.object.ol.optgroup.option.output.p.param.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.track.u.ul.var.video".split("."), documentTypes_ = [
  "domain",
  "regexp",
  "url-prefix",
  "url"
], mediaTypes_ = [
  "all",
  "aural",
  "braille",
  "handheld",
  "print",
  "projection",
  "screen",
  "tty",
  "tv",
  "embossed"
], mediaFeatures_ = /* @__PURE__ */ "width.min-width.max-width.height.min-height.max-height.device-width.min-device-width.max-device-width.device-height.min-device-height.max-device-height.aspect-ratio.min-aspect-ratio.max-aspect-ratio.device-aspect-ratio.min-device-aspect-ratio.max-device-aspect-ratio.color.min-color.max-color.color-index.min-color-index.max-color-index.monochrome.min-monochrome.max-monochrome.resolution.min-resolution.max-resolution.scan.grid.dynamic-range.video-dynamic-range".split("."), propertyKeywords_ = /* @__PURE__ */ "align-content.align-items.align-self.alignment-adjust.alignment-baseline.anchor-point.animation.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-timing-function.appearance.azimuth.backface-visibility.background.background-attachment.background-clip.background-color.background-image.background-origin.background-position.background-repeat.background-size.baseline-shift.binding.bleed.bookmark-label.bookmark-level.bookmark-state.bookmark-target.border.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-decoration-break.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.clear.clip.color.color-profile.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.content.counter-increment.counter-reset.crop.cue.cue-after.cue-before.cursor.direction.display.dominant-baseline.drop-initial-after-adjust.drop-initial-after-align.drop-initial-before-adjust.drop-initial-before-align.drop-initial-size.drop-initial-value.elevation.empty-cells.fit.fit-position.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.float-offset.flow-from.flow-into.font.font-feature-settings.font-family.font-kerning.font-language-override.font-size.font-size-adjust.font-stretch.font-style.font-synthesis.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-ligatures.font-variant-numeric.font-variant-position.font-weight.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-position.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphens.icon.image-orientation.image-rendering.image-resolution.inline-box-align.justify-content.left.letter-spacing.line-break.line-height.line-stacking.line-stacking-ruby.line-stacking-shift.line-stacking-strategy.list-style.list-style-image.list-style-position.list-style-type.margin.margin-bottom.margin-left.margin-right.margin-top.marker-offset.marks.marquee-direction.marquee-loop.marquee-play-count.marquee-speed.marquee-style.max-height.max-width.min-height.min-width.move-to.nav-down.nav-index.nav-left.nav-right.nav-up.object-fit.object-position.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-style.overflow-wrap.overflow-x.overflow-y.padding.padding-bottom.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.page-policy.pause.pause-after.pause-before.perspective.perspective-origin.pitch.pitch-range.play-during.position.presentation-level.punctuation-trim.quotes.region-break-after.region-break-before.region-break-inside.region-fragment.rendering-intent.resize.rest.rest-after.rest-before.richness.right.rotation.rotation-point.ruby-align.ruby-overhang.ruby-position.ruby-span.shape-image-threshold.shape-inside.shape-margin.shape-outside.size.speak.speak-as.speak-header.speak-numeral.speak-punctuation.speech-rate.stress.string-set.tab-size.table-layout.target.target-name.target-new.target-position.text-align.text-align-last.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-style.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-height.text-indent.text-justify.text-outline.text-overflow.text-shadow.text-size-adjust.text-space-collapse.text-transform.text-underline-position.text-wrap.top.transform.transform-origin.transform-style.transition.transition-delay.transition-duration.transition-property.transition-timing-function.unicode-bidi.vertical-align.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.volume.white-space.widows.width.will-change.word-break.word-spacing.word-wrap.z-index.clip-path.clip-rule.mask.enable-background.filter.flood-color.flood-opacity.lighting-color.stop-color.stop-opacity.pointer-events.color-interpolation.color-interpolation-filters.color-rendering.fill.fill-opacity.fill-rule.image-rendering.marker.marker-end.marker-mid.marker-start.shape-rendering.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.text-rendering.baseline-shift.dominant-baseline.glyph-orientation-horizontal.glyph-orientation-vertical.text-anchor.writing-mode.font-smoothing.osx-font-smoothing".split("."), nonStandardPropertyKeywords_ = [
  "scrollbar-arrow-color",
  "scrollbar-base-color",
  "scrollbar-dark-shadow-color",
  "scrollbar-face-color",
  "scrollbar-highlight-color",
  "scrollbar-shadow-color",
  "scrollbar-3d-light-color",
  "scrollbar-track-color",
  "shape-inside",
  "searchfield-cancel-button",
  "searchfield-decoration",
  "searchfield-results-button",
  "searchfield-results-decoration",
  "zoom"
], fontProperties_ = [
  "font-family",
  "src",
  "unicode-range",
  "font-variant",
  "font-feature-settings",
  "font-stretch",
  "font-weight",
  "font-style"
], colorKeywords_ = /* @__PURE__ */ "aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen".split("."), valueKeywords_ = /* @__PURE__ */ "above.absolute.activeborder.additive.activecaption.afar.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.amharic.amharic-abegede.antialiased.appworkspace.arabic-indic.armenian.asterisks.attr.auto.avoid.avoid-column.avoid-page.avoid-region.background.backwards.baseline.below.bidi-override.binary.bengali.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.buttonface.buttonhighlight.buttonshadow.buttontext.calc.cambodian.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.cjk-earthly-branch.cjk-heavenly-stem.cjk-ideographic.clear.clip.close-quote.col-resize.collapse.column.compact.condensed.conic-gradient.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.dashed.decimal.decimal-leading-zero.default.default-button.destination-atop.destination-in.destination-out.destination-over.devanagari.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic.ethiopic-abegede.ethiopic-abegede-am-et.ethiopic-abegede-gez.ethiopic-abegede-ti-er.ethiopic-abegede-ti-et.ethiopic-halehame-aa-er.ethiopic-halehame-aa-et.ethiopic-halehame-am-et.ethiopic-halehame-gez.ethiopic-halehame-om-et.ethiopic-halehame-sid-et.ethiopic-halehame-so-et.ethiopic-halehame-ti-er.ethiopic-halehame-ti-et.ethiopic-halehame-tig.ethiopic-numeric.ew-resize.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fixed.flat.flex.footnotes.forwards.from.geometricPrecision.georgian.graytext.groove.gujarati.gurmukhi.hand.hangul.hangul-consonant.hebrew.help.hidden.hide.high.higher.highlight.highlighttext.hiragana.hiragana-iroha.horizontal.hsl.hsla.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-table.inset.inside.intrinsic.invert.italic.japanese-formal.japanese-informal.justify.kannada.katakana.katakana-iroha.keep-all.khmer.korean-hangul-formal.korean-hanja-formal.korean-hanja-informal.landscape.lao.large.larger.left.level.lighter.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-alpha.lower-armenian.lower-greek.lower-hexadecimal.lower-latin.lower-norwegian.lower-roman.lowercase.ltr.malayalam.match.matrix.matrix3d.media-play-button.media-slider.media-sliderthumb.media-volume-slider.media-volume-sliderthumb.medium.menu.menulist.menulist-button.menutext.message-box.middle.min-intrinsic.mix.mongolian.monospace.move.multiple.myanmar.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.octal.open-quote.optimizeLegibility.optimizeSpeed.oriya.oromo.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.persian.perspective.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeating-conic-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row-resize.rtl.run-in.running.s-resize.sans-serif.scale.scale3d.scaleX.scaleY.scaleZ.scroll.scrollbar.scroll-position.se-resize.searchfield.searchfield-cancel-button.searchfield-decoration.searchfield-results-button.searchfield-results-decoration.semi-condensed.semi-expanded.separate.serif.show.sidama.simp-chinese-formal.simp-chinese-informal.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.solid.somali.source-atop.source-in.source-out.source-over.space.spell-out.square.square-button.standard.start.static.status-bar.stretch.stroke.sub.subpixel-antialiased.super.sw-resize.symbolic.symbols.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.tamil.telugu.text.text-bottom.text-top.textarea.textfield.thai.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.tibetan.tigre.tigrinya-er.tigrinya-er-abegede.tigrinya-et.tigrinya-et-abegede.to.top.trad-chinese-formal.trad-chinese-informal.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.up.upper-alpha.upper-armenian.upper-greek.upper-hexadecimal.upper-latin.upper-norwegian.upper-roman.uppercase.urdu.url.var.vertical.vertical-text.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.x-large.x-small.xor.xx-large.xx-small.bicubic.optimizespeed.grayscale.row.row-reverse.wrap.wrap-reverse.column-reverse.flex-start.flex-end.space-between.space-around.unset".split("."), wordOperatorKeywords_ = [
  "in",
  "and",
  "or",
  "not",
  "is not",
  "is a",
  "is",
  "isnt",
  "defined",
  "if unless"
], blockKeywords_ = [
  "for",
  "if",
  "else",
  "unless",
  "from",
  "to"
], commonAtoms_ = [
  "null",
  "true",
  "false",
  "href",
  "title",
  "type",
  "not-allowed",
  "readonly",
  "disabled"
], hintWords = tagKeywords_.concat(documentTypes_, mediaTypes_, mediaFeatures_, propertyKeywords_, nonStandardPropertyKeywords_, colorKeywords_, valueKeywords_, fontProperties_, wordOperatorKeywords_, blockKeywords_, commonAtoms_, [
  "@font-face",
  "@keyframes",
  "@media",
  "@viewport",
  "@page",
  "@host",
  "@supports",
  "@block",
  "@css"
]);
function wordRegexp(g) {
  return g = g.sort(function(g2, G) {
    return G > g2;
  }), /* @__PURE__ */ RegExp("^((" + g.join(")|(") + "))\\b");
}
function keySet(g) {
  for (var G = {}, K = 0; K < g.length; ++K) G[g[K]] = true;
  return G;
}
function escapeRegExp(g) {
  return g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
}
var tagKeywords = keySet(tagKeywords_), tagVariablesRegexp = /^(a|b|i|s|col|em)$/i, propertyKeywords = keySet(propertyKeywords_), nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_), valueKeywords = keySet(valueKeywords_), colorKeywords = keySet(colorKeywords_), documentTypes = keySet(documentTypes_), documentTypesRegexp = wordRegexp(documentTypes_), mediaFeatures = keySet(mediaFeatures_), mediaTypes = keySet(mediaTypes_), fontProperties = keySet(fontProperties_), operatorsRegexp = /^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/, wordOperatorKeywordsRegexp = wordRegexp(wordOperatorKeywords_), blockKeywords = keySet(blockKeywords_), vendorPrefixesRegexp = /* @__PURE__ */ new RegExp(/^\-(moz|ms|o|webkit)-/i), commonAtoms = keySet(commonAtoms_), firstWordMatch = "", states = {}, ch, style, type, override;
function tokenBase(g, G) {
  if (firstWordMatch = g.string.match(/(^[\w-]+\s*=\s*$)|(^\s*[\w-]+\s*=\s*[\w-])|(^\s*(\.|#|@|\$|\&|\[|\d|\+|::?|\{|\>|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/), G.context.line.firstWord = firstWordMatch ? firstWordMatch[0].replace(/^\s*/, "") : "", G.context.line.indent = g.indentation(), ch = g.peek(), g.match("//")) return g.skipToEnd(), ["comment", "comment"];
  if (g.match("/*")) return G.tokenize = tokenCComment, tokenCComment(g, G);
  if (ch == '"' || ch == "'") return g.next(), G.tokenize = tokenString(ch), G.tokenize(g, G);
  if (ch == "@") return g.next(), g.eatWhile(/[\w\\-]/), ["def", g.current()];
  if (ch == "#") {
    if (g.next(), g.match(/^[0-9a-f]{3}([0-9a-f]([0-9a-f]{2}){0,2})?\b(?!-)/i)) return ["atom", "atom"];
    if (g.match(/^[a-z][\w-]*/i)) return ["builtin", "hash"];
  }
  return g.match(vendorPrefixesRegexp) ? ["meta", "vendor-prefixes"] : g.match(/^-?[0-9]?\.?[0-9]/) ? (g.eatWhile(/[a-z%]/i), ["number", "unit"]) : ch == "!" ? (g.next(), [g.match(/^(important|optional)/i) ? "keyword" : "operator", "important"]) : ch == "." && g.match(/^\.[a-z][\w-]*/i) ? ["qualifier", "qualifier"] : g.match(documentTypesRegexp) ? (g.peek() == "(" && (G.tokenize = tokenParenthesized), ["property", "word"]) : g.match(/^[a-z][\w-]*\(/i) ? (g.backUp(1), ["keyword", "mixin"]) : g.match(/^(\+|-)[a-z][\w-]*\(/i) ? (g.backUp(1), ["keyword", "block-mixin"]) : g.string.match(/^\s*&/) && g.match(/^[-_]+[a-z][\w-]*/) ? ["qualifier", "qualifier"] : g.match(/^(\/|&)(-|_|:|\.|#|[a-z])/) ? (g.backUp(1), ["variableName.special", "reference"]) : g.match(/^&{1}\s*$/) ? ["variableName.special", "reference"] : g.match(wordOperatorKeywordsRegexp) ? ["operator", "operator"] : g.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i) ? g.match(/^(\.|\[)[\w-\'\"\]]+/i, false) && !wordIsTag(g.current()) ? (g.match("."), ["variable", "variable-name"]) : ["variable", "word"] : g.match(operatorsRegexp) ? ["operator", g.current()] : /[:;,{}\[\]\(\)]/.test(ch) ? (g.next(), [null, ch]) : (g.next(), [null, null]);
}
function tokenCComment(g, G) {
  for (var K = false, q; (q = g.next()) != null; ) {
    if (K && q == "/") {
      G.tokenize = null;
      break;
    }
    K = q == "*";
  }
  return ["comment", "comment"];
}
function tokenString(g) {
  return function(G, K) {
    for (var q = false, J; (J = G.next()) != null; ) {
      if (J == g && !q) {
        g == ")" && G.backUp(1);
        break;
      }
      q = !q && J == "\\";
    }
    return (J == g || !q && g != ")") && (K.tokenize = null), ["string", "string"];
  };
}
function tokenParenthesized(g, G) {
  return g.next(), g.match(/\s*[\"\')]/, false) ? G.tokenize = null : G.tokenize = tokenString(")"), [null, "("];
}
function Context(g, G, K, q) {
  this.type = g, this.indent = G, this.prev = K, this.line = q || {
    firstWord: "",
    indent: 0
  };
}
function pushContext(g, G, K, q) {
  return q = q >= 0 ? q : G.indentUnit, g.context = new Context(K, G.indentation() + q, g.context), K;
}
function popContext(g, G, K) {
  var q = g.context.indent - G.indentUnit;
  return K || (K = false), g.context = g.context.prev, K && (g.context.indent = q), g.context.type;
}
function pass(g, G, K) {
  return states[K.context.type](g, G, K);
}
function popAndPass(g, G, K, q) {
  for (var J = q || 1; J > 0; J--) K.context = K.context.prev;
  return pass(g, G, K);
}
function wordIsTag(g) {
  return g.toLowerCase() in tagKeywords;
}
function wordIsProperty(g) {
  return g = g.toLowerCase(), g in propertyKeywords || g in fontProperties;
}
function wordIsBlock(g) {
  return g.toLowerCase() in blockKeywords;
}
function wordIsVendorPrefix(g) {
  return g.toLowerCase().match(vendorPrefixesRegexp);
}
function wordAsValue(g) {
  var G = g.toLowerCase(), K = "variable";
  return wordIsTag(g) ? K = "tag" : wordIsBlock(g) ? K = "block-keyword" : wordIsProperty(g) ? K = "property" : G in valueKeywords || G in commonAtoms ? K = "atom" : G == "return" || G in colorKeywords ? K = "keyword" : g.match(/^[A-Z]/) && (K = "string"), K;
}
function typeIsBlock(g, G) {
  return endOfLine(G) && (g == "{" || g == "]" || g == "hash" || g == "qualifier") || g == "block-mixin";
}
function typeIsInterpolation(g, G) {
  return g == "{" && G.match(/^\s*\$?[\w-]+/i, false);
}
function typeIsPseudo(g, G) {
  return g == ":" && G.match(/^[a-z-]+/, false);
}
function startOfLine(g) {
  return g.sol() || g.string.match(/* @__PURE__ */ RegExp("^\\s*" + escapeRegExp(g.current())));
}
function endOfLine(g) {
  return g.eol() || g.match(/^\s*$/, false);
}
function firstWordOfLine(g) {
  var G = /^\s*[-_]*[a-z0-9]+[\w-]*/i, K = typeof g == "string" ? g.match(G) : g.string.match(G);
  return K ? K[0].replace(/^\s*/, "") : "";
}
states.block = function(g, G, K) {
  if (g == "comment" && startOfLine(G) || g == "," && endOfLine(G) || g == "mixin") return pushContext(K, G, "block", 0);
  if (typeIsInterpolation(g, G)) return pushContext(K, G, "interpolation");
  if (endOfLine(G) && g == "]" && !/^\s*(\.|#|:|\[|\*|&)/.test(G.string) && !wordIsTag(firstWordOfLine(G))) return pushContext(K, G, "block", 0);
  if (typeIsBlock(g, G)) return pushContext(K, G, "block");
  if (g == "}" && endOfLine(G)) return pushContext(K, G, "block", 0);
  if (g == "variable-name") return G.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/) || wordIsBlock(firstWordOfLine(G)) ? pushContext(K, G, "variableName") : pushContext(K, G, "variableName", 0);
  if (g == "=") return !endOfLine(G) && !wordIsBlock(firstWordOfLine(G)) ? pushContext(K, G, "block", 0) : pushContext(K, G, "block");
  if (g == "*" && (endOfLine(G) || G.match(/\s*(,|\.|#|\[|:|{)/, false))) return override = "tag", pushContext(K, G, "block");
  if (typeIsPseudo(g, G)) return pushContext(K, G, "pseudo");
  if (/@(font-face|media|supports|(-moz-)?document)/.test(g)) return pushContext(K, G, endOfLine(G) ? "block" : "atBlock");
  if (/@(-(moz|ms|o|webkit)-)?keyframes$/.test(g)) return pushContext(K, G, "keyframes");
  if (/@extends?/.test(g)) return pushContext(K, G, "extend", 0);
  if (g && g.charAt(0) == "@") return G.indentation() > 0 && wordIsProperty(G.current().slice(1)) ? (override = "variable", "block") : /(@import|@require|@charset)/.test(g) ? pushContext(K, G, "block", 0) : pushContext(K, G, "block");
  if (g == "reference" && endOfLine(G)) return pushContext(K, G, "block");
  if (g == "(") return pushContext(K, G, "parens");
  if (g == "vendor-prefixes") return pushContext(K, G, "vendorPrefixes");
  if (g == "word") {
    var q = G.current();
    if (override = wordAsValue(q), override == "property") return startOfLine(G) ? pushContext(K, G, "block", 0) : (override = "atom", "block");
    if (override == "tag") {
      if (/embed|menu|pre|progress|sub|table/.test(q) && wordIsProperty(firstWordOfLine(G)) || G.string.match(/* @__PURE__ */ RegExp("\\[\\s*" + q + "|" + q + "\\s*\\]"))) return override = "atom", "block";
      if (tagVariablesRegexp.test(q) && (startOfLine(G) && G.string.match(/=/) || !startOfLine(G) && !G.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/) && !wordIsTag(firstWordOfLine(G)))) return override = "variable", wordIsBlock(firstWordOfLine(G)) ? "block" : pushContext(K, G, "block", 0);
      if (endOfLine(G)) return pushContext(K, G, "block");
    }
    if (override == "block-keyword") return override = "keyword", G.current(/(if|unless)/) && !startOfLine(G) ? "block" : pushContext(K, G, "block");
    if (q == "return") return pushContext(K, G, "block", 0);
    if (override == "variable" && G.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)) return pushContext(K, G, "block");
  }
  return K.context.type;
}, states.parens = function(g, G, K) {
  if (g == "(") return pushContext(K, G, "parens");
  if (g == ")") return K.context.prev.type == "parens" ? popContext(K, G) : G.string.match(/^[a-z][\w-]*\(/i) && endOfLine(G) || wordIsBlock(firstWordOfLine(G)) || /(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(firstWordOfLine(G)) || !G.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/) && wordIsTag(firstWordOfLine(G)) ? pushContext(K, G, "block") : G.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/) || G.string.match(/^\s*(\(|\)|[0-9])/) || G.string.match(/^\s+[a-z][\w-]*\(/i) || G.string.match(/^\s+[\$-]?[a-z]/i) ? pushContext(K, G, "block", 0) : endOfLine(G) ? pushContext(K, G, "block") : pushContext(K, G, "block", 0);
  if (g && g.charAt(0) == "@" && wordIsProperty(G.current().slice(1)) && (override = "variable"), g == "word") {
    var q = G.current();
    override = wordAsValue(q), override == "tag" && tagVariablesRegexp.test(q) && (override = "variable"), (override == "property" || q == "to") && (override = "atom");
  }
  return g == "variable-name" ? pushContext(K, G, "variableName") : typeIsPseudo(g, G) ? pushContext(K, G, "pseudo") : K.context.type;
}, states.vendorPrefixes = function(g, G, K) {
  return g == "word" ? (override = "property", pushContext(K, G, "block", 0)) : popContext(K, G);
}, states.pseudo = function(g, G, K) {
  return wordIsProperty(firstWordOfLine(G.string)) ? popAndPass(g, G, K) : (G.match(/^[a-z-]+/), override = "variableName.special", endOfLine(G) ? pushContext(K, G, "block") : popContext(K, G));
}, states.atBlock = function(g, G, K) {
  if (g == "(") return pushContext(K, G, "atBlock_parens");
  if (typeIsBlock(g, G)) return pushContext(K, G, "block");
  if (typeIsInterpolation(g, G)) return pushContext(K, G, "interpolation");
  if (g == "word") {
    var q = G.current().toLowerCase();
    if (override = /^(only|not|and|or)$/.test(q) ? "keyword" : documentTypes.hasOwnProperty(q) ? "tag" : mediaTypes.hasOwnProperty(q) ? "attribute" : mediaFeatures.hasOwnProperty(q) ? "property" : nonStandardPropertyKeywords.hasOwnProperty(q) ? "string.special" : wordAsValue(G.current()), override == "tag" && endOfLine(G)) return pushContext(K, G, "block");
  }
  return g == "operator" && /^(not|and|or)$/.test(G.current()) && (override = "keyword"), K.context.type;
}, states.atBlock_parens = function(g, G, K) {
  if (g == "{" || g == "}") return K.context.type;
  if (g == ")") return endOfLine(G) ? pushContext(K, G, "block") : pushContext(K, G, "atBlock");
  if (g == "word") {
    var q = G.current().toLowerCase();
    return override = wordAsValue(q), /^(max|min)/.test(q) && (override = "property"), override == "tag" && (override = tagVariablesRegexp.test(q) ? "variable" : "atom"), K.context.type;
  }
  return states.atBlock(g, G, K);
}, states.keyframes = function(g, G, K) {
  return G.indentation() == "0" && (g == "}" && startOfLine(G) || g == "]" || g == "hash" || g == "qualifier" || wordIsTag(G.current())) ? popAndPass(g, G, K) : g == "{" ? pushContext(K, G, "keyframes") : g == "}" ? startOfLine(G) ? popContext(K, G, true) : pushContext(K, G, "keyframes") : g == "unit" && /^[0-9]+\%$/.test(G.current()) ? pushContext(K, G, "keyframes") : g == "word" && (override = wordAsValue(G.current()), override == "block-keyword") ? (override = "keyword", pushContext(K, G, "keyframes")) : /@(font-face|media|supports|(-moz-)?document)/.test(g) ? pushContext(K, G, endOfLine(G) ? "block" : "atBlock") : g == "mixin" ? pushContext(K, G, "block", 0) : K.context.type;
}, states.interpolation = function(g, G, K) {
  return g == "{" && popContext(K, G) && pushContext(K, G, "block"), g == "}" ? G.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i) || G.string.match(/^\s*[a-z]/i) && wordIsTag(firstWordOfLine(G)) ? pushContext(K, G, "block") : !G.string.match(/^(\{|\s*\&)/) || G.match(/\s*[\w-]/, false) ? pushContext(K, G, "block", 0) : pushContext(K, G, "block") : g == "variable-name" ? pushContext(K, G, "variableName", 0) : (g == "word" && (override = wordAsValue(G.current()), override == "tag" && (override = "atom")), K.context.type);
}, states.extend = function(g, G, K) {
  return g == "[" || g == "=" ? "extend" : g == "]" ? popContext(K, G) : g == "word" ? (override = wordAsValue(G.current()), "extend") : popContext(K, G);
}, states.variableName = function(g, G, K) {
  return g == "string" || g == "[" || g == "]" || G.current().match(/^(\.|\$)/) ? (G.current().match(/^\.[\w-]+/i) && (override = "variable"), "variableName") : popAndPass(g, G, K);
};
const stylus = {
  name: "stylus",
  startState: function() {
    return {
      tokenize: null,
      state: "block",
      context: new Context("block", 0, null)
    };
  },
  token: function(g, G) {
    return !G.tokenize && g.eatSpace() ? null : (style = (G.tokenize || tokenBase)(g, G), style && typeof style == "object" && (type = style[1], style = style[0]), override = style, G.state = states[G.state](type, g, G), override);
  },
  indent: function(g, G, K) {
    var q = g.context, J = G && G.charAt(0), Y = q.indent, X = firstWordOfLine(G), Z = q.line.indent, Q = g.context.prev ? g.context.prev.line.firstWord : "", $ = g.context.prev ? g.context.prev.line.indent : Z;
    return q.prev && (J == "}" && (q.type == "block" || q.type == "atBlock" || q.type == "keyframes") || J == ")" && (q.type == "parens" || q.type == "atBlock_parens") || J == "{" && q.type == "at") ? Y = q.indent - K.unit : /(\})/.test(J) || (/@|\$|\d/.test(J) || /^\{/.test(G) || /^\s*\/(\/|\*)/.test(G) || /^\s*\/\*/.test(Q) || /^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(G) || /^(\+|-)?[a-z][\w-]*\(/i.test(G) || /^return/.test(G) || wordIsBlock(X) ? Y = Z : /(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(J) || wordIsTag(X) ? Y = /\,\s*$/.test(Q) ? $ : /(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(Q) || wordIsTag(Q) ? Z <= $ ? $ : $ + K.unit : Z : !/,\s*$/.test(G) && (wordIsVendorPrefix(X) || wordIsProperty(X)) && (Y = wordIsBlock(Q) ? Z <= $ ? $ : $ + K.unit : /^\{/.test(Q) ? Z <= $ ? Z : $ + K.unit : wordIsVendorPrefix(Q) || wordIsProperty(Q) ? Z >= $ ? $ : Z : /^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(Q) || /=\s*$/.test(Q) || wordIsTag(Q) || /^\$[\w-\.\[\]\'\"]/.test(Q) ? $ + K.unit : Z)), Y;
  },
  languageData: {
    indentOnInput: /^\s*\}$/,
    commentTokens: {
      line: "//",
      block: {
        open: "/*",
        close: "*/"
      }
    },
    autocomplete: hintWords
  }
};
export {
  stylus as t
};
