import { __require as k } from "./csharp.mjs";
var l, p;
function q() {
  if (p)
    return l;
  p = 1;
  var h = k();
  l = c, c.displayName = "cshtml", c.aliases = ["razor"];
  function c(i) {
    i.register(h), function(r) {
      var d = /\/(?![/*])|\/\/.*[\r\n]|\/\*[^*]*(?:\*(?!\/)[^*]*)*\*\//.source, m = /@(?!")|"(?:[^\r\n\\"]|\\.)*"|@"(?:[^\\"]|""|\\[\s\S])*"(?!")/.source + "|" + /'(?:(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'|(?=[^\\](?!')))/.source;
      function a(o, b) {
        for (var g = 0; g < b; g++)
          o = o.replace(/<self>/g, function() {
            return "(?:" + o + ")";
          });
        return o.replace(/<self>/g, "[^\\s\\S]").replace(/<str>/g, "(?:" + m + ")").replace(/<comment>/g, "(?:" + d + ")");
      }
      var s = a(/\((?:[^()'"@/]|<str>|<comment>|<self>)*\)/.source, 2), f = a(/\[(?:[^\[\]'"@/]|<str>|<comment>|<self>)*\]/.source, 2), e = a(/\{(?:[^{}'"@/]|<str>|<comment>|<self>)*\}/.source, 2), v = a(/<(?:[^<>'"@/]|<str>|<comment>|<self>)*>/.source, 2), t = /(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?/.source, u = /(?!\d)[^\s>\/=$<%]+/.source + t + /\s*\/?>/.source, w = /\B@?/.source + "(?:" + /<([a-zA-Z][\w:]*)/.source + t + /\s*>/.source + "(?:" + (/[^<]/.source + "|" + // all tags that are not the start tag
      // eslint-disable-next-line regexp/strict
      /<\/?(?!\1\b)/.source + u + "|" + // nested start tag
      a(
        // eslint-disable-next-line regexp/strict
        /<\1/.source + t + /\s*>/.source + "(?:" + (/[^<]/.source + "|" + // all tags that are not the start tag
        // eslint-disable-next-line regexp/strict
        /<\/?(?!\1\b)/.source + u + "|<self>") + ")*" + // eslint-disable-next-line regexp/strict
        /<\/\1\s*>/.source,
        2
      )) + ")*" + // eslint-disable-next-line regexp/strict
      /<\/\1\s*>/.source + "|" + /</.source + u + ")";
      r.languages.cshtml = r.languages.extend("markup", {});
      var y = r.languages.insertBefore("csharp", "string", {
        html: {
          pattern: RegExp(w),
          greedy: !0,
          inside: r.languages.cshtml
        }
      }, {
        csharp: r.languages.extend("csharp", {})
      }), n = {
        pattern: /\S[\s\S]*/,
        alias: "language-csharp",
        inside: y
      };
      r.languages.insertBefore("cshtml", "prolog", {
        "razor-comment": {
          pattern: /@\*[\s\S]*?\*@/,
          greedy: !0,
          alias: "comment"
        },
        block: {
          pattern: RegExp(/(^|[^@])@/.source + "(?:" + [
            // @{ ... }
            e,
            // @code{ ... }
            /(?:code|functions)\s*/.source + e,
            // @for (...) { ... }
            /(?:for|foreach|lock|switch|using|while)\s*/.source + s + /\s*/.source + e,
            // @do { ... } while (...);
            /do\s*/.source + e + /\s*while\s*/.source + s + /(?:\s*;)?/.source,
            // @try { ... } catch (...) { ... } finally { ... }
            /try\s*/.source + e + /\s*catch\s*/.source + s + /\s*/.source + e + /\s*finally\s*/.source + e,
            // @if (...) {...} else if (...) {...} else {...}
            /if\s*/.source + s + /\s*/.source + e + "(?:" + /\s*else/.source + "(?:" + /\s+if\s*/.source + s + ")?" + /\s*/.source + e + ")*"
          ].join("|") + ")"),
          lookbehind: !0,
          greedy: !0,
          inside: {
            keyword: /^@\w*/,
            csharp: n
          }
        },
        directive: {
          pattern: /^([ \t]*)@(?:addTagHelper|attribute|implements|inherits|inject|layout|model|namespace|page|preservewhitespace|removeTagHelper|section|tagHelperPrefix|using)(?=\s).*/m,
          lookbehind: !0,
          greedy: !0,
          inside: {
            keyword: /^@\w+/,
            csharp: n
          }
        },
        value: {
          pattern: RegExp(/(^|[^@])@/.source + /(?:await\b\s*)?/.source + "(?:" + /\w+\b/.source + "|" + s + ")(?:" + /[?!]?\.\w+\b/.source + "|" + s + "|" + f + "|" + v + s + ")*"),
          lookbehind: !0,
          greedy: !0,
          alias: "variable",
          inside: {
            keyword: /^@/,
            csharp: n
          }
        },
        "delegate-operator": {
          pattern: /(^|[^@])@(?=<)/,
          lookbehind: !0,
          alias: "operator"
        }
      }), r.languages.razor = r.languages.cshtml;
    }(i);
  }
  return l;
}
export {
  q as __require
};
