import {
  a as t,
  c as l
} from "./chunk-IO47FP3U.js";

// ../node_modules/highlight.js/lib/languages/groovy.js
var N = l((b, o) => {
  function u(e) {
    return e ? typeof e == "string" ? e : e.source : null;
  }
  t(u, "source");
  function E(e) {
    return d("(?=", e, ")");
  }
  t(E, "lookahead");
  function d(...e) {
    return e.map((a) => u(a)).join("");
  }
  t(d, "concat");
  function i(e, n = {}) {
    return n.variants = e, n;
  }
  t(i, "variants");
  function g(e) {
    let n = "[A-Za-z0-9_$]+", a = i([
      e.C_LINE_COMMENT_MODE,
      e.C_BLOCK_COMMENT_MODE,
      e.COMMENT(
        "/\\*\\*",
        "\\*/",
        {
          relevance: 0,
          contains: [
            {
              // eat up @'s in emails to prevent them to be recognized as doctags
              begin: /\w+@/,
              relevance: 0
            },
            {
              className: "doctag",
              begin: "@[A-Za-z]+"
            }
          ]
        }
      )
    ]), r = {
      className: "regexp",
      begin: /~?\/[^\/\n]+\//,
      contains: [e.BACKSLASH_ESCAPE]
    }, c = i([
      e.BINARY_NUMBER_MODE,
      e.C_NUMBER_MODE
    ]), s = i(
      [
        {
          begin: /"""/,
          end: /"""/
        },
        {
          begin: /'''/,
          end: /'''/
        },
        {
          begin: "\\$/",
          end: "/\\$",
          relevance: 10
        },
        e.APOS_STRING_MODE,
        e.QUOTE_STRING_MODE
      ],
      {
        className: "string"
      }
    );
    return {
      name: "Groovy",
      keywords: {
        built_in: "this super",
        literal: "true false null",
        keyword: "byte short char int long boolean float double void def as in assert trait abstract static volatile transient public private protected synchronized final class interface enum if else for while switch case break default continue throw throws try catch finally implements extends new import package return instanceof"
      },
      contains: [
        e.SHEBANG({
          binary: "groovy",
          relevance: 10
        }),
        a,
        s,
        r,
        c,
        {
          className: "class",
          beginKeywords: "class interface trait enum",
          end: /\{/,
          illegal: ":",
          contains: [
            {
              beginKeywords: "extends implements"
            },
            e.UNDERSCORE_TITLE_MODE
          ]
        },
        {
          className: "meta",
          begin: "@[A-Za-z]+",
          relevance: 0
        },
        {
          // highlight map keys and named parameters as attrs
          className: "attr",
          begin: n + "[ 	]*:",
          relevance: 0
        },
        {
          // catch middle element of the ternary operator
          // to avoid highlight it as a label, named parameter, or map key
          begin: /\?/,
          end: /:/,
          relevance: 0,
          contains: [
            a,
            s,
            r,
            c,
            "self"
          ]
        },
        {
          // highlight labeled statements
          className: "symbol",
          begin: "^[ 	]*" + E(n + ":"),
          excludeBegin: !0,
          end: n + ":",
          relevance: 0
        }
      ],
      illegal: /#|<\//
    };
  }
  t(g, "groovy");
  o.exports = g;
});

export {
  N as a
};
