import { C as d } from "./codemirror.es-CVgHrv2u.js";
import { o as onlineParser, p, l as list, a as opt, t } from "./GraphQLPlaygroundPage-BNtxA91h.js";
import { r } from "./mode-indent.es-CX18p_8d.js";
import "./codemirror.es2-DH2syXui.js";
import "./index-Cr4zbAtA.js";
import "./createCell-D7cbP3PP.js";
var o = Object.defineProperty;
var i = (r2, t2) => o(r2, "name", { value: t2, configurable: true });
d.defineMode("graphql-variables", (r$1) => {
  const t2 = onlineParser({
    eatWhitespace: (u) => u.eatSpace(),
    lexRules: V,
    parseRules: m,
    editorConfig: { tabSize: r$1.tabSize }
  });
  return {
    config: r$1,
    startState: t2.startState,
    token: t2.token,
    indent: r,
    electricInput: /^\s*[}\]]/,
    fold: "brace",
    closeBrackets: {
      pairs: '[]{}""',
      explode: "[]{}"
    }
  };
});
const V = {
  Punctuation: /^\[|]|\{|\}|:|,/,
  Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,
  String: /^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,
  Keyword: /^true|false|null/
}, m = {
  Document: [p("{"), list("Variable", opt(p(","))), p("}")],
  Variable: [s("variable"), p(":"), "Value"],
  Value(r2) {
    switch (r2.kind) {
      case "Number":
        return "NumberValue";
      case "String":
        return "StringValue";
      case "Punctuation":
        switch (r2.value) {
          case "[":
            return "ListValue";
          case "{":
            return "ObjectValue";
        }
        return null;
      case "Keyword":
        switch (r2.value) {
          case "true":
          case "false":
            return "BooleanValue";
          case "null":
            return "NullValue";
        }
        return null;
    }
  },
  NumberValue: [t("Number", "number")],
  StringValue: [t("String", "string")],
  BooleanValue: [t("Keyword", "builtin")],
  NullValue: [t("Keyword", "keyword")],
  ListValue: [p("["), list("Value", opt(p(","))), p("]")],
  ObjectValue: [p("{"), list("ObjectField", opt(p(","))), p("}")],
  ObjectField: [s("attribute"), p(":"), "Value"]
};
function s(r2) {
  return {
    style: r2,
    match: (t2) => t2.kind === "String",
    update(t2, u) {
      t2.name = u.value.slice(1, -1);
    }
  };
}
i(s, "namedKey");
