{"version":3,"file":"application-97b43a4b.js","sources":["../../app/assets/javascripts/editor/editor_loader.js","../../vendor/bundle/ruby/3.2.0/gems/mongo-ejson-0.2.7/vendor/assets/javascripts/ejson.js","../../app/assets/javascripts/ejson/ejson.js","../../app/assets/javascripts/ejson/ejson.handler.js","../../app/assets/javascripts/ejson/ejson.parser.js","../../app/assets/javascripts/editor/ace.ejson.aggregate.snippets?raw","../../app/assets/javascripts/editor/ace.ejson.aggregate.snippets.js","../../app/assets/javascripts/editor/ace.ejson.snippets?raw","../../app/assets/javascripts/editor/ace.ejson.snippets.js","../../app/assets/javascripts/editor/ace.ejson.autocomplete.js","../../app/assets/javascripts/editor/ace.ejson.highlight.js","../../app/assets/javascripts/editor/ace.ejson.mode.js","../../app/assets/javascripts/editor/ace.editor.js","../../app/assets/javascripts/editor.js","../../app/assets/javascripts/split-view.js","../../app/assets/javascripts/tabs.js","../../app/assets/javascripts/copy.js","../../node_modules/highlight.js/lib/core.js","../../app/assets/javascripts/ejson.hljs.js"],"sourcesContent":["let EditorLoader = {\n extensions: {},\n\n init: function () {\n window.addEventListener(\"load\", EditorLoader.onLoad);\n },\n\n onLoad: function () {\n console.log(\"EditorLoader.onLoad\");\n EditorLoader.entryPoint();\n },\n\n extend: (extensionName, extension) => {\n console.log(`Adding extension: ${extensionName}`);\n\n EditorLoader.extensions[extensionName] = extension;\n },\n\n loadExtensions: function () {\n Object.entries(EditorLoader.extensions).forEach((entry) => {\n console.log(`Loading extension: ${entry[0]}`);\n\n let extensionFunc = entry[1];\n\n extensionFunc();\n });\n },\n};\n\nexport { EditorLoader };\n","/**\n * This file was generated from src/ejson.peg\n * See http://canopy.jcoglan.com/ for documentation.\n */\n\n(function() {\n 'use strict';\n\n var extend = function(destination, source) {\n if (!destination || !source) return destination;\n for (var key in source) {\n if (destination[key] !== source[key])\n destination[key] = source[key];\n }\n return destination;\n };\n\n var formatError = function(input, offset, expected) {\n var lines = input.split(/\\n/g),\n lineNo = 0,\n position = 0;\n\n while (position <= offset) {\n position += lines[lineNo].length + 1;\n lineNo += 1;\n }\n var message = 'Line ' + lineNo + ': expected ' + expected.join(', ') + '\\n',\n line = lines[lineNo - 1];\n\n message += line + '\\n';\n position -= line.length + 1;\n\n while (position < offset) {\n message += ' ';\n position += 1;\n }\n return message + '^';\n };\n\n var inherit = function(subclass, parent) {\n var chain = function() {};\n chain.prototype = parent.prototype;\n subclass.prototype = new chain();\n subclass.prototype.constructor = subclass;\n };\n\n var TreeNode = function(text, offset, elements) {\n this.text = text;\n this.offset = offset;\n this.elements = elements || [];\n };\n\n TreeNode.prototype.forEach = function(block, context) {\n for (var el = this.elements, i = 0, n = el.length; i < n; i++) {\n block.call(context, el[i], i, el);\n }\n };\n\n var TreeNode1 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['value'] = elements[1];\n };\n inherit(TreeNode1, TreeNode);\n\n var TreeNode2 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['pair'] = elements[0];\n };\n inherit(TreeNode2, TreeNode);\n\n var TreeNode3 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['pair'] = elements[0];\n };\n inherit(TreeNode3, TreeNode);\n\n var TreeNode4 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['value'] = elements[0];\n };\n inherit(TreeNode4, TreeNode);\n\n var TreeNode5 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['value'] = elements[0];\n };\n inherit(TreeNode5, TreeNode);\n\n var TreeNode6 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['identifier_start'] = elements[0];\n };\n inherit(TreeNode6, TreeNode);\n\n var TreeNode7 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['unicode_escape'] = elements[1];\n };\n inherit(TreeNode7, TreeNode);\n\n var TreeNode8 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['hex_digit'] = elements[4];\n };\n inherit(TreeNode8, TreeNode);\n\n var TreeNode9 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['hex_value'] = elements[0];\n };\n inherit(TreeNode9, TreeNode);\n\n var TreeNode10 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['hex_value'] = elements[0];\n };\n inherit(TreeNode10, TreeNode);\n\n var TreeNode11 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['integer_number'] = elements[0];\n };\n inherit(TreeNode11, TreeNode);\n\n var TreeNode12 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['integer_number'] = elements[0];\n };\n inherit(TreeNode12, TreeNode);\n\n var TreeNode13 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['number'] = elements[0];\n };\n inherit(TreeNode13, TreeNode);\n\n var TreeNode14 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['number'] = elements[0];\n };\n inherit(TreeNode14, TreeNode);\n\n var TreeNode15 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['base64_value'] = elements[0];\n };\n inherit(TreeNode15, TreeNode);\n\n var TreeNode16 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['base64_value'] = elements[0];\n };\n inherit(TreeNode16, TreeNode);\n\n var TreeNode17 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['integer'] = elements[1];\n };\n inherit(TreeNode17, TreeNode);\n\n var TreeNode18 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['integer'] = elements[1];\n };\n inherit(TreeNode18, TreeNode);\n\n var TreeNode19 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['integer'] = elements[0];\n };\n inherit(TreeNode19, TreeNode);\n\n var TreeNode20 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['hex_string'] = elements[0];\n };\n inherit(TreeNode20, TreeNode);\n\n var TreeNode21 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['bin_data_type'] = elements[0];\n this['base64_string'] = elements[1];\n };\n inherit(TreeNode21, TreeNode);\n\n var TreeNode22 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['integer_number'] = elements[1];\n };\n inherit(TreeNode22, TreeNode);\n\n var TreeNode23 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['number_long_value'] = elements[0];\n };\n inherit(TreeNode23, TreeNode);\n\n var TreeNode24 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['number_decimal_value'] = elements[0];\n };\n inherit(TreeNode24, TreeNode);\n\n var TreeNode25 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['date_value'] = elements[0];\n };\n inherit(TreeNode25, TreeNode);\n\n var TreeNode26 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['string'] = elements[1];\n };\n inherit(TreeNode26, TreeNode);\n\n var TreeNode27 = function(text, offset, elements) {\n TreeNode.apply(this, arguments);\n this['comma'] = elements[0];\n };\n inherit(TreeNode27, TreeNode);\n\n var FAILURE = {};\n\n var Grammar = {\n _read_root: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._root = this._cache._root || {};\n var cached = this._cache._root[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read___();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n var index2 = this._offset;\n address2 = this._read_object();\n if (address2 === FAILURE) {\n this._offset = index2;\n address2 = this._read_array();\n if (address2 === FAILURE) {\n this._offset = index2;\n }\n }\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n address3 = this._read___();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_root(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._root[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_object: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._object = this._cache._object || {};\n var cached = this._cache._object[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_non_empty_object();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_empty_object();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._object[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_pair: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._pair = this._cache._pair || {};\n var cached = this._cache._pair[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n address1 = this._read___();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n var index2 = this._offset;\n address2 = this._read_string();\n if (address2 === FAILURE) {\n this._offset = index2;\n address2 = this._read_identifier();\n if (address2 === FAILURE) {\n this._offset = index2;\n }\n }\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n address3 = this._read_assignment();\n if (address3 !== FAILURE) {\n var address4 = FAILURE;\n address4 = this._read_value();\n if (address4 !== FAILURE) {\n elements0[1] = address4;\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_pair(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._pair[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_non_empty_object: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._non_empty_object = this._cache._non_empty_object || {};\n var cached = this._cache._non_empty_object[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n address1 = this._read_object_open();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_pair();\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n var remaining0 = 0, index2 = this._offset, elements1 = [], address4 = true;\n while (address4 !== FAILURE) {\n var index3 = this._offset, elements2 = new Array(1);\n var address5 = FAILURE;\n address5 = this._read_delimiter();\n if (address5 !== FAILURE) {\n var address6 = FAILURE;\n address6 = this._read_pair();\n if (address6 !== FAILURE) {\n elements2[0] = address6;\n } else {\n elements2 = null;\n this._offset = index3;\n }\n } else {\n elements2 = null;\n this._offset = index3;\n }\n if (elements2 === null) {\n address4 = FAILURE;\n } else {\n address4 = new TreeNode3(this._input.substring(index3, this._offset), index3, elements2);\n this._offset = this._offset;\n }\n if (address4 !== FAILURE) {\n elements1.push(address4);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address3 = new TreeNode(this._input.substring(index2, this._offset), index2, elements1);\n this._offset = this._offset;\n } else {\n address3 = FAILURE;\n }\n if (address3 !== FAILURE) {\n elements0[1] = address3;\n var address7 = FAILURE;\n address7 = this._read_object_close();\n if (address7 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_object(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._non_empty_object[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_empty_object: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._empty_object = this._cache._empty_object || {};\n var cached = this._cache._empty_object[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = [];\n var address1 = FAILURE;\n address1 = this._read_object_open();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_object_close();\n if (address2 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_empty_object(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._empty_object[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_array: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._array = this._cache._array || {};\n var cached = this._cache._array[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_non_empty_array();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_empty_array();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._array[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_non_empty_array: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._non_empty_array = this._cache._non_empty_array || {};\n var cached = this._cache._non_empty_array[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n address1 = this._read_array_open();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_value();\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n var remaining0 = 0, index2 = this._offset, elements1 = [], address4 = true;\n while (address4 !== FAILURE) {\n var index3 = this._offset, elements2 = new Array(1);\n var address5 = FAILURE;\n address5 = this._read_delimiter();\n if (address5 !== FAILURE) {\n var address6 = FAILURE;\n address6 = this._read_value();\n if (address6 !== FAILURE) {\n elements2[0] = address6;\n } else {\n elements2 = null;\n this._offset = index3;\n }\n } else {\n elements2 = null;\n this._offset = index3;\n }\n if (elements2 === null) {\n address4 = FAILURE;\n } else {\n address4 = new TreeNode5(this._input.substring(index3, this._offset), index3, elements2);\n this._offset = this._offset;\n }\n if (address4 !== FAILURE) {\n elements1.push(address4);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address3 = new TreeNode(this._input.substring(index2, this._offset), index2, elements1);\n this._offset = this._offset;\n } else {\n address3 = FAILURE;\n }\n if (address3 !== FAILURE) {\n elements0[1] = address3;\n var address7 = FAILURE;\n address7 = this._read_array_close();\n if (address7 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_array(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._non_empty_array[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_empty_array: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._empty_array = this._cache._empty_array || {};\n var cached = this._cache._empty_array[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = [];\n var address1 = FAILURE;\n address1 = this._read_array_open();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_array_close();\n if (address2 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_empty_array(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._empty_array[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_value: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._value = this._cache._value || {};\n var cached = this._cache._value[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_json_values();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_mongo_literals();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_mongo_types();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n }\n this._cache._value[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_json_values: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._json_values = this._cache._json_values || {};\n var cached = this._cache._json_values[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_object();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_array();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_number();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_string();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_boolean();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_null();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n }\n }\n }\n }\n this._cache._json_values[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_mongo_literals: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._mongo_literals = this._cache._mongo_literals || {};\n var cached = this._cache._mongo_literals[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_min_key();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_max_key();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_undefined();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_regexp_string();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n }\n }\n this._cache._mongo_literals[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_mongo_types: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._mongo_types = this._cache._mongo_types || {};\n var cached = this._cache._mongo_types[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_object_id();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_bin_data();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_timestamp();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_number_long();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_number_decimal();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_date();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_db_ref_type();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n }\n }\n }\n }\n }\n this._cache._mongo_types[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_boolean: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._boolean = this._cache._boolean || {};\n var cached = this._cache._boolean[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_true();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_false();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._boolean[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_true: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._true = this._cache._true || {};\n var cached = this._cache._true[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 4);\n }\n if (chunk0 === 'true') {\n address0 = this._actions.make_true(this._input, this._offset, this._offset + 4);\n this._offset = this._offset + 4;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"true\"');\n }\n }\n this._cache._true[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_false: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._false = this._cache._false || {};\n var cached = this._cache._false[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 5);\n }\n if (chunk0 === 'false') {\n address0 = this._actions.make_false(this._input, this._offset, this._offset + 5);\n this._offset = this._offset + 5;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"false\"');\n }\n }\n this._cache._false[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_null: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._null = this._cache._null || {};\n var cached = this._cache._null[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 4);\n }\n if (chunk0 === 'null') {\n address0 = this._actions.make_null(this._input, this._offset, this._offset + 4);\n this._offset = this._offset + 4;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"null\"');\n }\n }\n this._cache._null[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_string: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._string = this._cache._string || {};\n var cached = this._cache._string[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_double_quote_string();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_single_quote_string();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._string[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_identifier: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._identifier = this._cache._identifier || {};\n var cached = this._cache._identifier[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n address1 = this._read_identifier_start();\n if (address1 !== FAILURE) {\n elements0[0] = address1;\n var address2 = FAILURE;\n var remaining0 = 1, index2 = this._offset, elements1 = [], address3 = true;\n while (address3 !== FAILURE) {\n address3 = this._read_identifier_part();\n if (address3 !== FAILURE) {\n elements1.push(address3);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address2 = new TreeNode(this._input.substring(index2, this._offset), index2, elements1);\n this._offset = this._offset;\n } else {\n address2 = FAILURE;\n }\n if (address2 !== FAILURE) {\n elements0[1] = address2;\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_identifier(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._identifier[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_identifier_start: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._identifier_start = this._cache._identifier_start || {};\n var cached = this._cache._identifier_start[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_unicode_letter();\n if (address0 === FAILURE) {\n this._offset = index1;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '$') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"$\"');\n }\n }\n if (address0 === FAILURE) {\n this._offset = index1;\n var chunk1 = null;\n if (this._offset < this._inputSize) {\n chunk1 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk1 === '_') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"_\"');\n }\n }\n if (address0 === FAILURE) {\n this._offset = index1;\n var index2 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n var chunk2 = null;\n if (this._offset < this._inputSize) {\n chunk2 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk2 === '\\\\') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"\\\\\\\\\"');\n }\n }\n if (address1 !== FAILURE) {\n elements0[0] = address1;\n var address2 = FAILURE;\n address2 = this._read_unicode_escape();\n if (address2 !== FAILURE) {\n elements0[1] = address2;\n } else {\n elements0 = null;\n this._offset = index2;\n }\n } else {\n elements0 = null;\n this._offset = index2;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode7(this._input.substring(index2, this._offset), index2, elements0);\n this._offset = this._offset;\n }\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n }\n }\n this._cache._identifier_start[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_identifier_part: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._identifier_part = this._cache._identifier_part || {};\n var cached = this._cache._identifier_part[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_unicode_letter();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_unicode_digit();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_unicode_conn_punct();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n }\n this._cache._identifier_part[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_unicode_combining: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._unicode_combining = this._cache._unicode_combining || {};\n var cached = this._cache._unicode_combining[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_unicode_non_spacing();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_unicode_comb_spacing();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._unicode_combining[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_unicode_escape: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._unicode_escape = this._cache._unicode_escape || {};\n var cached = this._cache._unicode_escape[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(5);\n var address1 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === 'u') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"u\"');\n }\n }\n if (address1 !== FAILURE) {\n elements0[0] = address1;\n var address2 = FAILURE;\n address2 = this._read_hex_digit();\n if (address2 !== FAILURE) {\n elements0[1] = address2;\n var address3 = FAILURE;\n address3 = this._read_hex_digit();\n if (address3 !== FAILURE) {\n elements0[2] = address3;\n var address4 = FAILURE;\n address4 = this._read_hex_digit();\n if (address4 !== FAILURE) {\n elements0[3] = address4;\n var address5 = FAILURE;\n address5 = this._read_hex_digit();\n if (address5 !== FAILURE) {\n elements0[4] = address5;\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode8(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._unicode_escape[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_unicode_letter: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._unicode_letter = this._cache._unicode_letter || {};\n var cached = this._cache._unicode_letter[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 !== null && /^[a-zA-Z\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]/.test(chunk0)) {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[a-zA-Z\\\\u00A0-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]');\n }\n }\n this._cache._unicode_letter[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_unicode_digit: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._unicode_digit = this._cache._unicode_digit || {};\n var cached = this._cache._unicode_digit[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 !== null && /^[0-9]/.test(chunk0)) {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[0-9]');\n }\n }\n this._cache._unicode_digit[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_unicode_conn_punct: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._unicode_conn_punct = this._cache._unicode_conn_punct || {};\n var cached = this._cache._unicode_conn_punct[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 !== null && /^[_\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]/.test(chunk0)) {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[_\\\\u203F\\\\u2040\\\\u2054\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFF3F]');\n }\n }\n this._cache._unicode_conn_punct[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_double_quote_string: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._double_quote_string = this._cache._double_quote_string || {};\n var cached = this._cache._double_quote_string[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read_double_quote();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n var remaining0 = 0, index2 = this._offset, elements1 = [], address3 = true;\n while (address3 !== FAILURE) {\n var index3 = this._offset;\n var index4 = this._offset, elements2 = new Array(2);\n var address4 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '\\\\') {\n address4 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address4 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"\\\\\\\\\"');\n }\n }\n if (address4 !== FAILURE) {\n elements2[0] = address4;\n var address5 = FAILURE;\n var chunk1 = null;\n if (this._offset < this._inputSize) {\n chunk1 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk1 !== null && /^[^\\b\\t\\n\\v\\f\\r]/.test(chunk1)) {\n address5 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address5 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[^\\\\b\\\\t\\\\n\\\\v\\\\f\\\\r]');\n }\n }\n if (address5 !== FAILURE) {\n elements2[1] = address5;\n } else {\n elements2 = null;\n this._offset = index4;\n }\n } else {\n elements2 = null;\n this._offset = index4;\n }\n if (elements2 === null) {\n address3 = FAILURE;\n } else {\n address3 = new TreeNode(this._input.substring(index4, this._offset), index4, elements2);\n this._offset = this._offset;\n }\n if (address3 === FAILURE) {\n this._offset = index3;\n var chunk2 = null;\n if (this._offset < this._inputSize) {\n chunk2 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk2 !== null && /^[^\"\\b\\t\\n\\v\\f\\r]/.test(chunk2)) {\n address3 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address3 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[^\"\\\\b\\\\t\\\\n\\\\v\\\\f\\\\r]');\n }\n }\n if (address3 === FAILURE) {\n this._offset = index3;\n }\n }\n if (address3 !== FAILURE) {\n elements1.push(address3);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address2 = new TreeNode(this._input.substring(index2, this._offset), index2, elements1);\n this._offset = this._offset;\n } else {\n address2 = FAILURE;\n }\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address6 = FAILURE;\n address6 = this._read_double_quote();\n if (address6 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_string(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._double_quote_string[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_single_quote_string: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._single_quote_string = this._cache._single_quote_string || {};\n var cached = this._cache._single_quote_string[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read_single_quote();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n var remaining0 = 0, index2 = this._offset, elements1 = [], address3 = true;\n while (address3 !== FAILURE) {\n var index3 = this._offset;\n var index4 = this._offset, elements2 = new Array(2);\n var address4 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '\\\\') {\n address4 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address4 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"\\\\\\\\\"');\n }\n }\n if (address4 !== FAILURE) {\n elements2[0] = address4;\n var address5 = FAILURE;\n var chunk1 = null;\n if (this._offset < this._inputSize) {\n chunk1 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk1 !== null && /^[^\\b\\t\\n\\v\\f\\r]/.test(chunk1)) {\n address5 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address5 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[^\\\\b\\\\t\\\\n\\\\v\\\\f\\\\r]');\n }\n }\n if (address5 !== FAILURE) {\n elements2[1] = address5;\n } else {\n elements2 = null;\n this._offset = index4;\n }\n } else {\n elements2 = null;\n this._offset = index4;\n }\n if (elements2 === null) {\n address3 = FAILURE;\n } else {\n address3 = new TreeNode(this._input.substring(index4, this._offset), index4, elements2);\n this._offset = this._offset;\n }\n if (address3 === FAILURE) {\n this._offset = index3;\n var chunk2 = null;\n if (this._offset < this._inputSize) {\n chunk2 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk2 !== null && /^[^'\\b\\t\\n\\v\\f\\r]/.test(chunk2)) {\n address3 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address3 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[^\\'\\\\b\\\\t\\\\n\\\\v\\\\f\\\\r]');\n }\n }\n if (address3 === FAILURE) {\n this._offset = index3;\n }\n }\n if (address3 !== FAILURE) {\n elements1.push(address3);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address2 = new TreeNode(this._input.substring(index2, this._offset), index2, elements1);\n this._offset = this._offset;\n } else {\n address2 = FAILURE;\n }\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address6 = FAILURE;\n address6 = this._read_single_quote();\n if (address6 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_string(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._single_quote_string[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_hex_string: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._hex_string = this._cache._hex_string || {};\n var cached = this._cache._hex_string[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_hex_single_quote();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_hex_double_quote();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._hex_string[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_hex_value: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._hex_value = this._cache._hex_value || {};\n var cached = this._cache._hex_value[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var remaining0 = 1, index1 = this._offset, elements0 = [], address1 = true;\n while (address1 !== FAILURE) {\n address1 = this._read_hex_digit();\n if (address1 !== FAILURE) {\n elements0.push(address1);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n } else {\n address0 = FAILURE;\n }\n this._cache._hex_value[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_hex_single_quote: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._hex_single_quote = this._cache._hex_single_quote || {};\n var cached = this._cache._hex_single_quote[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read_single_quote();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_hex_value();\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n address3 = this._read_single_quote();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_string(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._hex_single_quote[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_hex_double_quote: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._hex_double_quote = this._cache._hex_double_quote || {};\n var cached = this._cache._hex_double_quote[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read_double_quote();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_hex_value();\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n address3 = this._read_double_quote();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_string(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._hex_double_quote[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_integer_string: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._integer_string = this._cache._integer_string || {};\n var cached = this._cache._integer_string[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_integer_string_single();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_integer_string_double();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._integer_string[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_integer_string_single: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._integer_string_single = this._cache._integer_string_single || {};\n var cached = this._cache._integer_string_single[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read_single_quote();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_integer_number();\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n address3 = this._read_single_quote();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_numeric_string(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._integer_string_single[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_integer_string_double: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._integer_string_double = this._cache._integer_string_double || {};\n var cached = this._cache._integer_string_double[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read_double_quote();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_integer_number();\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n address3 = this._read_double_quote();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_numeric_string(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._integer_string_double[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_number_string: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._number_string = this._cache._number_string || {};\n var cached = this._cache._number_string[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_number_string_single();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_number_string_double();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._number_string[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_number_string_single: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._number_string_single = this._cache._number_string_single || {};\n var cached = this._cache._number_string_single[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read_single_quote();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_number();\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n address3 = this._read_single_quote();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_numeric_string(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._number_string_single[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_number_string_double: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._number_string_double = this._cache._number_string_double || {};\n var cached = this._cache._number_string_double[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read_double_quote();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_number();\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n address3 = this._read_double_quote();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_numeric_string(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._number_string_double[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_regexp_string: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._regexp_string = this._cache._regexp_string || {};\n var cached = this._cache._regexp_string[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n address1 = this._read_slash();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n var remaining0 = 0, index2 = this._offset, elements1 = [], address3 = true;\n while (address3 !== FAILURE) {\n var index3 = this._offset;\n var index4 = this._offset, elements2 = new Array(2);\n var address4 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '\\\\') {\n address4 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address4 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"\\\\\\\\\"');\n }\n }\n if (address4 !== FAILURE) {\n elements2[0] = address4;\n var address5 = FAILURE;\n if (this._offset < this._inputSize) {\n address5 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address5 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('');\n }\n }\n if (address5 !== FAILURE) {\n elements2[1] = address5;\n } else {\n elements2 = null;\n this._offset = index4;\n }\n } else {\n elements2 = null;\n this._offset = index4;\n }\n if (elements2 === null) {\n address3 = FAILURE;\n } else {\n address3 = new TreeNode(this._input.substring(index4, this._offset), index4, elements2);\n this._offset = this._offset;\n }\n if (address3 === FAILURE) {\n this._offset = index3;\n var chunk1 = null;\n if (this._offset < this._inputSize) {\n chunk1 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk1 !== null && /^[^\\/]/.test(chunk1)) {\n address3 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address3 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[^\\\\/]');\n }\n }\n if (address3 === FAILURE) {\n this._offset = index3;\n }\n }\n if (address3 !== FAILURE) {\n elements1.push(address3);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address2 = new TreeNode(this._input.substring(index2, this._offset), index2, elements1);\n this._offset = this._offset;\n } else {\n address2 = FAILURE;\n }\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address6 = FAILURE;\n address6 = this._read_slash();\n if (address6 !== FAILURE) {\n var address7 = FAILURE;\n var index5 = this._offset;\n address7 = this._read_regexp_options();\n if (address7 === FAILURE) {\n address7 = new TreeNode(this._input.substring(index5, index5), index5);\n this._offset = index5;\n }\n if (address7 !== FAILURE) {\n elements0[1] = address7;\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_regexp(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._regexp_string[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_regexp_options: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._regexp_options = this._cache._regexp_options || {};\n var cached = this._cache._regexp_options[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var remaining0 = 1, index1 = this._offset, elements0 = [], address1 = true;\n while (address1 !== FAILURE) {\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 !== null && /^[gims]/.test(chunk0)) {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[gims]');\n }\n }\n if (address1 !== FAILURE) {\n elements0.push(address1);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n } else {\n address0 = FAILURE;\n }\n this._cache._regexp_options[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_base64_string: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._base64_string = this._cache._base64_string || {};\n var cached = this._cache._base64_string[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_base64_single_quote();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_base64_dobule_quote();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._base64_string[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_base64_value: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._base64_value = this._cache._base64_value || {};\n var cached = this._cache._base64_value[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n var remaining0 = 1, index2 = this._offset, elements1 = [], address2 = true;\n while (address2 !== FAILURE) {\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 !== null && /^[a-zA-Z0-9+\\/]/.test(chunk0)) {\n address2 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address2 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[a-zA-Z0-9+\\\\/]');\n }\n }\n if (address2 !== FAILURE) {\n elements1.push(address2);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address1 = new TreeNode(this._input.substring(index2, this._offset), index2, elements1);\n this._offset = this._offset;\n } else {\n address1 = FAILURE;\n }\n if (address1 !== FAILURE) {\n elements0[0] = address1;\n var address3 = FAILURE;\n var index3 = this._offset;\n var index4 = this._offset;\n var chunk1 = null;\n if (this._offset < this._inputSize) {\n chunk1 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk1 === '=') {\n address3 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address3 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"=\"');\n }\n }\n if (address3 === FAILURE) {\n this._offset = index4;\n var chunk2 = null;\n if (this._offset < this._inputSize) {\n chunk2 = this._input.substring(this._offset, this._offset + 2);\n }\n if (chunk2 === '==') {\n address3 = new TreeNode(this._input.substring(this._offset, this._offset + 2), this._offset);\n this._offset = this._offset + 2;\n } else {\n address3 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"==\"');\n }\n }\n if (address3 === FAILURE) {\n this._offset = index4;\n }\n }\n if (address3 === FAILURE) {\n address3 = new TreeNode(this._input.substring(index3, index3), index3);\n this._offset = index3;\n }\n if (address3 !== FAILURE) {\n elements0[1] = address3;\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._base64_value[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_base64_single_quote: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._base64_single_quote = this._cache._base64_single_quote || {};\n var cached = this._cache._base64_single_quote[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read_single_quote();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_base64_value();\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n address3 = this._read_single_quote();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_string(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._base64_single_quote[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_base64_dobule_quote: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._base64_dobule_quote = this._cache._base64_dobule_quote || {};\n var cached = this._cache._base64_dobule_quote[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read_double_quote();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_base64_value();\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n address3 = this._read_double_quote();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_string(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._base64_dobule_quote[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_number: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._number = this._cache._number || {};\n var cached = this._cache._number[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(4);\n var address1 = FAILURE;\n var index2 = this._offset;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '-') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"-\"');\n }\n }\n if (address1 === FAILURE) {\n address1 = new TreeNode(this._input.substring(index2, index2), index2);\n this._offset = index2;\n }\n if (address1 !== FAILURE) {\n elements0[0] = address1;\n var address2 = FAILURE;\n address2 = this._read_integer();\n if (address2 !== FAILURE) {\n elements0[1] = address2;\n var address3 = FAILURE;\n var index3 = this._offset;\n address3 = this._read_fraction();\n if (address3 === FAILURE) {\n address3 = new TreeNode(this._input.substring(index3, index3), index3);\n this._offset = index3;\n }\n if (address3 !== FAILURE) {\n elements0[2] = address3;\n var address4 = FAILURE;\n var index4 = this._offset;\n address4 = this._read_exponent();\n if (address4 === FAILURE) {\n address4 = new TreeNode(this._input.substring(index4, index4), index4);\n this._offset = index4;\n }\n if (address4 !== FAILURE) {\n elements0[3] = address4;\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_number(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._number[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_number_as_string: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._number_as_string = this._cache._number_as_string || {};\n var cached = this._cache._number_as_string[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(4);\n var address1 = FAILURE;\n var index2 = this._offset;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '-') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"-\"');\n }\n }\n if (address1 === FAILURE) {\n address1 = new TreeNode(this._input.substring(index2, index2), index2);\n this._offset = index2;\n }\n if (address1 !== FAILURE) {\n elements0[0] = address1;\n var address2 = FAILURE;\n address2 = this._read_integer();\n if (address2 !== FAILURE) {\n elements0[1] = address2;\n var address3 = FAILURE;\n var index3 = this._offset;\n address3 = this._read_fraction();\n if (address3 === FAILURE) {\n address3 = new TreeNode(this._input.substring(index3, index3), index3);\n this._offset = index3;\n }\n if (address3 !== FAILURE) {\n elements0[2] = address3;\n var address4 = FAILURE;\n var index4 = this._offset;\n address4 = this._read_exponent();\n if (address4 === FAILURE) {\n address4 = new TreeNode(this._input.substring(index4, index4), index4);\n this._offset = index4;\n }\n if (address4 !== FAILURE) {\n elements0[3] = address4;\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_number_as_string(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._number_as_string[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_integer: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._integer = this._cache._integer || {};\n var cached = this._cache._integer[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '0') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"0\"');\n }\n }\n if (address0 === FAILURE) {\n this._offset = index1;\n var index2 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n var chunk1 = null;\n if (this._offset < this._inputSize) {\n chunk1 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk1 !== null && /^[1-9]/.test(chunk1)) {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[1-9]');\n }\n }\n if (address1 !== FAILURE) {\n elements0[0] = address1;\n var address2 = FAILURE;\n var remaining0 = 0, index3 = this._offset, elements1 = [], address3 = true;\n while (address3 !== FAILURE) {\n var chunk2 = null;\n if (this._offset < this._inputSize) {\n chunk2 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk2 !== null && /^[0-9]/.test(chunk2)) {\n address3 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address3 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[0-9]');\n }\n }\n if (address3 !== FAILURE) {\n elements1.push(address3);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address2 = new TreeNode(this._input.substring(index3, this._offset), index3, elements1);\n this._offset = this._offset;\n } else {\n address2 = FAILURE;\n }\n if (address2 !== FAILURE) {\n elements0[1] = address2;\n } else {\n elements0 = null;\n this._offset = index2;\n }\n } else {\n elements0 = null;\n this._offset = index2;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index2, this._offset), index2, elements0);\n this._offset = this._offset;\n }\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._integer[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_fraction: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._fraction = this._cache._fraction || {};\n var cached = this._cache._fraction[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '.') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\".\"');\n }\n }\n if (address1 !== FAILURE) {\n elements0[0] = address1;\n var address2 = FAILURE;\n var remaining0 = 1, index2 = this._offset, elements1 = [], address3 = true;\n while (address3 !== FAILURE) {\n var chunk1 = null;\n if (this._offset < this._inputSize) {\n chunk1 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk1 !== null && /^[0-9]/.test(chunk1)) {\n address3 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address3 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[0-9]');\n }\n }\n if (address3 !== FAILURE) {\n elements1.push(address3);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address2 = new TreeNode(this._input.substring(index2, this._offset), index2, elements1);\n this._offset = this._offset;\n } else {\n address2 = FAILURE;\n }\n if (address2 !== FAILURE) {\n elements0[1] = address2;\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._fraction[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_exponent: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._exponent = this._cache._exponent || {};\n var cached = this._cache._exponent[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(3);\n var address1 = FAILURE;\n var index2 = this._offset;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === 'e') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"e\"');\n }\n }\n if (address1 === FAILURE) {\n this._offset = index2;\n var chunk1 = null;\n if (this._offset < this._inputSize) {\n chunk1 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk1 === 'E') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"E\"');\n }\n }\n if (address1 === FAILURE) {\n this._offset = index2;\n }\n }\n if (address1 !== FAILURE) {\n elements0[0] = address1;\n var address2 = FAILURE;\n var index3 = this._offset;\n var chunk2 = null;\n if (this._offset < this._inputSize) {\n chunk2 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk2 === '+') {\n address2 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address2 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"+\"');\n }\n }\n if (address2 === FAILURE) {\n this._offset = index3;\n var chunk3 = null;\n if (this._offset < this._inputSize) {\n chunk3 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk3 === '-') {\n address2 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address2 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"-\"');\n }\n }\n if (address2 === FAILURE) {\n this._offset = index3;\n var chunk4 = null;\n if (this._offset < this._inputSize) {\n chunk4 = this._input.substring(this._offset, this._offset + 0);\n }\n if (chunk4 === '') {\n address2 = new TreeNode(this._input.substring(this._offset, this._offset + 0), this._offset);\n this._offset = this._offset + 0;\n } else {\n address2 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"\"');\n }\n }\n if (address2 === FAILURE) {\n this._offset = index3;\n }\n }\n }\n if (address2 !== FAILURE) {\n elements0[1] = address2;\n var address3 = FAILURE;\n var remaining0 = 1, index4 = this._offset, elements1 = [], address4 = true;\n while (address4 !== FAILURE) {\n var chunk5 = null;\n if (this._offset < this._inputSize) {\n chunk5 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk5 !== null && /^[0-9]/.test(chunk5)) {\n address4 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address4 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[0-9]');\n }\n }\n if (address4 !== FAILURE) {\n elements1.push(address4);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address3 = new TreeNode(this._input.substring(index4, this._offset), index4, elements1);\n this._offset = this._offset;\n } else {\n address3 = FAILURE;\n }\n if (address3 !== FAILURE) {\n elements0[2] = address3;\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._exponent[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_integer_number: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._integer_number = this._cache._integer_number || {};\n var cached = this._cache._integer_number[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read_integer();\n if (address1 !== FAILURE) {\n elements0[0] = address1;\n var address2 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 0);\n }\n if (chunk0 === '') {\n address2 = new TreeNode(this._input.substring(this._offset, this._offset + 0), this._offset);\n this._offset = this._offset + 0;\n } else {\n address2 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"\"');\n }\n }\n if (address2 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_number(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._integer_number[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_min_key: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._min_key = this._cache._min_key || {};\n var cached = this._cache._min_key[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 6);\n }\n if (chunk0 === 'MinKey') {\n address0 = this._actions.make_min_key(this._input, this._offset, this._offset + 6);\n this._offset = this._offset + 6;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"MinKey\"');\n }\n }\n this._cache._min_key[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_max_key: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._max_key = this._cache._max_key || {};\n var cached = this._cache._max_key[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 6);\n }\n if (chunk0 === 'MaxKey') {\n address0 = this._actions.make_max_key(this._input, this._offset, this._offset + 6);\n this._offset = this._offset + 6;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"MaxKey\"');\n }\n }\n this._cache._max_key[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_undefined: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._undefined = this._cache._undefined || {};\n var cached = this._cache._undefined[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 9);\n }\n if (chunk0 === 'undefined') {\n address0 = this._actions.make_undefined(this._input, this._offset, this._offset + 9);\n this._offset = this._offset + 9;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"undefined\"');\n }\n }\n this._cache._undefined[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_object_id: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._object_id = this._cache._object_id || {};\n var cached = this._cache._object_id[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 8);\n }\n if (chunk0 === 'ObjectId') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 8), this._offset);\n this._offset = this._offset + 8;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"ObjectId\"');\n }\n }\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_type_open();\n if (address2 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read_hex_string();\n if (address3 !== FAILURE) {\n elements0[0] = address3;\n var address4 = FAILURE;\n address4 = this._read_type_close();\n if (address4 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_object_id(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._object_id[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_bin_data_type: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._bin_data_type = this._cache._bin_data_type || {};\n var cached = this._cache._bin_data_type[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_string();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_integer_number();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._bin_data_type[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_bin_data: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._bin_data = this._cache._bin_data || {};\n var cached = this._cache._bin_data[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 7);\n }\n if (chunk0 === 'BinData') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 7), this._offset);\n this._offset = this._offset + 7;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"BinData\"');\n }\n }\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_type_open();\n if (address2 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read_bin_data_type();\n if (address3 !== FAILURE) {\n elements0[0] = address3;\n var address4 = FAILURE;\n address4 = this._read_delimiter();\n if (address4 !== FAILURE) {\n var address5 = FAILURE;\n address5 = this._read_base64_string();\n if (address5 !== FAILURE) {\n elements0[1] = address5;\n var address6 = FAILURE;\n address6 = this._read_type_close();\n if (address6 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_bin_data(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._bin_data[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_timestamp: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._timestamp = this._cache._timestamp || {};\n var cached = this._cache._timestamp[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 9);\n }\n if (chunk0 === 'Timestamp') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 9), this._offset);\n this._offset = this._offset + 9;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"Timestamp\"');\n }\n }\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_type_open();\n if (address2 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read_integer_number();\n if (address3 !== FAILURE) {\n elements0[0] = address3;\n var address4 = FAILURE;\n address4 = this._read_delimiter();\n if (address4 !== FAILURE) {\n var address5 = FAILURE;\n address5 = this._read_integer_number();\n if (address5 !== FAILURE) {\n elements0[1] = address5;\n var address6 = FAILURE;\n address6 = this._read_type_close();\n if (address6 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_timestamp(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._timestamp[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_number_long_value: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._number_long_value = this._cache._number_long_value || {};\n var cached = this._cache._number_long_value[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_integer_number();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_integer_string();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._number_long_value[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_number_long: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._number_long = this._cache._number_long || {};\n var cached = this._cache._number_long[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 10);\n }\n if (chunk0 === 'NumberLong') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 10), this._offset);\n this._offset = this._offset + 10;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"NumberLong\"');\n }\n }\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_type_open();\n if (address2 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read_number_long_value();\n if (address3 !== FAILURE) {\n elements0[0] = address3;\n var address4 = FAILURE;\n address4 = this._read_type_close();\n if (address4 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_number_long(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._number_long[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_number_decimal_value: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._number_decimal_value = this._cache._number_decimal_value || {};\n var cached = this._cache._number_decimal_value[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_number_as_string();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_number_string();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._number_decimal_value[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_number_decimal: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._number_decimal = this._cache._number_decimal || {};\n var cached = this._cache._number_decimal[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 13);\n }\n if (chunk0 === 'NumberDecimal') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 13), this._offset);\n this._offset = this._offset + 13;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"NumberDecimal\"');\n }\n }\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_type_open();\n if (address2 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read_number_decimal_value();\n if (address3 !== FAILURE) {\n elements0[0] = address3;\n var address4 = FAILURE;\n address4 = this._read_type_close();\n if (address4 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_number_decimal(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._number_decimal[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_date_type: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._date_type = this._cache._date_type || {};\n var cached = this._cache._date_type[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n var index2 = this._offset, elements0 = new Array(3);\n var address1 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 3);\n }\n if (chunk0 === 'new') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 3), this._offset);\n this._offset = this._offset + 3;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"new\"');\n }\n }\n if (address1 !== FAILURE) {\n elements0[0] = address1;\n var address2 = FAILURE;\n var remaining0 = 1, index3 = this._offset, elements1 = [], address3 = true;\n while (address3 !== FAILURE) {\n address3 = this._read_space();\n if (address3 !== FAILURE) {\n elements1.push(address3);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address2 = new TreeNode(this._input.substring(index3, this._offset), index3, elements1);\n this._offset = this._offset;\n } else {\n address2 = FAILURE;\n }\n if (address2 !== FAILURE) {\n elements0[1] = address2;\n var address4 = FAILURE;\n var chunk1 = null;\n if (this._offset < this._inputSize) {\n chunk1 = this._input.substring(this._offset, this._offset + 4);\n }\n if (chunk1 === 'Date') {\n address4 = new TreeNode(this._input.substring(this._offset, this._offset + 4), this._offset);\n this._offset = this._offset + 4;\n } else {\n address4 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"Date\"');\n }\n }\n if (address4 !== FAILURE) {\n elements0[2] = address4;\n } else {\n elements0 = null;\n this._offset = index2;\n }\n } else {\n elements0 = null;\n this._offset = index2;\n }\n } else {\n elements0 = null;\n this._offset = index2;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index2, this._offset), index2, elements0);\n this._offset = this._offset;\n }\n if (address0 === FAILURE) {\n this._offset = index1;\n var chunk2 = null;\n if (this._offset < this._inputSize) {\n chunk2 = this._input.substring(this._offset, this._offset + 7);\n }\n if (chunk2 === 'ISODate') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 7), this._offset);\n this._offset = this._offset + 7;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"ISODate\"');\n }\n }\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._date_type[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_date_value: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._date_value = this._cache._date_value || {};\n var cached = this._cache._date_value[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset;\n address0 = this._read_integer_number();\n if (address0 === FAILURE) {\n this._offset = index1;\n address0 = this._read_string();\n if (address0 === FAILURE) {\n this._offset = index1;\n }\n }\n this._cache._date_value[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_date: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._date = this._cache._date || {};\n var cached = this._cache._date[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read_date_type();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_type_open();\n if (address2 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read_date_value();\n if (address3 !== FAILURE) {\n elements0[0] = address3;\n var address4 = FAILURE;\n address4 = this._read_type_close();\n if (address4 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_date(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._date[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_db_ref_type: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._db_ref_type = this._cache._db_ref_type || {};\n var cached = this._cache._db_ref_type[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 5);\n }\n if (chunk0 === 'DBRef') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 5), this._offset);\n this._offset = this._offset + 5;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"DBRef\"');\n }\n }\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_type_open();\n if (address2 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read_string();\n if (address3 !== FAILURE) {\n elements0[0] = address3;\n var address4 = FAILURE;\n address4 = this._read_delimiter();\n if (address4 !== FAILURE) {\n var address5 = FAILURE;\n address5 = this._read_string();\n if (address5 !== FAILURE) {\n elements0[1] = address5;\n var address6 = FAILURE;\n address6 = this._read_type_close();\n if (address6 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = this._actions.make_db_ref(this._input, index1, this._offset, elements0);\n this._offset = this._offset;\n }\n this._cache._db_ref_type[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_single_quote: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._single_quote = this._cache._single_quote || {};\n var cached = this._cache._single_quote[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '\\'') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"\\'\"');\n }\n }\n this._cache._single_quote[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_double_quote: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._double_quote = this._cache._double_quote || {};\n var cached = this._cache._double_quote[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '\"') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\\'\"\\'');\n }\n }\n this._cache._double_quote[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_left_paren: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._left_paren = this._cache._left_paren || {};\n var cached = this._cache._left_paren[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '(') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\\'(\\'');\n }\n }\n this._cache._left_paren[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_right_paren: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._right_paren = this._cache._right_paren || {};\n var cached = this._cache._right_paren[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === ')') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\\')\\'');\n }\n }\n this._cache._right_paren[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_left_brace: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._left_brace = this._cache._left_brace || {};\n var cached = this._cache._left_brace[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '{') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\\'{\\'');\n }\n }\n this._cache._left_brace[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_right_brace: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._right_brace = this._cache._right_brace || {};\n var cached = this._cache._right_brace[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '}') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\\'}\\'');\n }\n }\n this._cache._right_brace[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_left_bracket: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._left_bracket = this._cache._left_bracket || {};\n var cached = this._cache._left_bracket[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '[') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\\'[\\'');\n }\n }\n this._cache._left_bracket[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_right_bracket: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._right_bracket = this._cache._right_bracket || {};\n var cached = this._cache._right_bracket[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === ']') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\\']\\'');\n }\n }\n this._cache._right_bracket[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_comma: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._comma = this._cache._comma || {};\n var cached = this._cache._comma[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === ',') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\\',\\'');\n }\n }\n this._cache._comma[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_colon: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._colon = this._cache._colon || {};\n var cached = this._cache._colon[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === ':') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\\':\\'');\n }\n }\n this._cache._colon[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_slash: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._slash = this._cache._slash || {};\n var cached = this._cache._slash[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 === '/') {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\\'/\\'');\n }\n }\n this._cache._slash[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_space: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._space = this._cache._space || {};\n var cached = this._cache._space[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 !== null && /^[\\s]/.test(chunk0)) {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[\\\\s]');\n }\n }\n this._cache._space[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_new_line: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._new_line = this._cache._new_line || {};\n var cached = this._cache._new_line[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 !== null && /^[\\n]/.test(chunk0)) {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[\\\\n]');\n }\n }\n this._cache._new_line[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_hex_digit: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._hex_digit = this._cache._hex_digit || {};\n var cached = this._cache._hex_digit[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk0 !== null && /^[a-fA-F0-9]/.test(chunk0)) {\n address0 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address0 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[a-fA-F0-9]');\n }\n }\n this._cache._hex_digit[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_comment: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._comment = this._cache._comment || {};\n var cached = this._cache._comment[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(2);\n var address1 = FAILURE;\n var chunk0 = null;\n if (this._offset < this._inputSize) {\n chunk0 = this._input.substring(this._offset, this._offset + 2);\n }\n if (chunk0 === '//') {\n address1 = new TreeNode(this._input.substring(this._offset, this._offset + 2), this._offset);\n this._offset = this._offset + 2;\n } else {\n address1 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('\"//\"');\n }\n }\n if (address1 !== FAILURE) {\n elements0[0] = address1;\n var address2 = FAILURE;\n var remaining0 = 0, index2 = this._offset, elements1 = [], address3 = true;\n while (address3 !== FAILURE) {\n var chunk1 = null;\n if (this._offset < this._inputSize) {\n chunk1 = this._input.substring(this._offset, this._offset + 1);\n }\n if (chunk1 !== null && /^[^\\n]/.test(chunk1)) {\n address3 = new TreeNode(this._input.substring(this._offset, this._offset + 1), this._offset);\n this._offset = this._offset + 1;\n } else {\n address3 = FAILURE;\n if (this._offset > this._failure) {\n this._failure = this._offset;\n this._expected = [];\n }\n if (this._offset === this._failure) {\n this._expected.push('[^\\\\n]');\n }\n }\n if (address3 !== FAILURE) {\n elements1.push(address3);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address2 = new TreeNode(this._input.substring(index2, this._offset), index2, elements1);\n this._offset = this._offset;\n } else {\n address2 = FAILURE;\n }\n if (address2 !== FAILURE) {\n elements0[1] = address2;\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._comment[index0] = [address0, this._offset];\n return address0;\n },\n\n _read___: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache.___ = this._cache.___ || {};\n var cached = this._cache.___[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var remaining0 = 0, index1 = this._offset, elements0 = [], address1 = true;\n while (address1 !== FAILURE) {\n var index2 = this._offset;\n address1 = this._read_space();\n if (address1 === FAILURE) {\n this._offset = index2;\n address1 = this._read_new_line();\n if (address1 === FAILURE) {\n this._offset = index2;\n address1 = this._read_comment();\n if (address1 === FAILURE) {\n this._offset = index2;\n }\n }\n }\n if (address1 !== FAILURE) {\n elements0.push(address1);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n } else {\n address0 = FAILURE;\n }\n this._cache.___[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_delimiter: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._delimiter = this._cache._delimiter || {};\n var cached = this._cache._delimiter[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = new Array(1);\n var address1 = FAILURE;\n address1 = this._read___();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_comma();\n if (address2 !== FAILURE) {\n elements0[0] = address2;\n var address3 = FAILURE;\n address3 = this._read___();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode27(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._delimiter[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_assignment: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._assignment = this._cache._assignment || {};\n var cached = this._cache._assignment[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = [];\n var address1 = FAILURE;\n address1 = this._read___();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_colon();\n if (address2 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read___();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._assignment[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_object_open: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._object_open = this._cache._object_open || {};\n var cached = this._cache._object_open[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = [];\n var address1 = FAILURE;\n address1 = this._read___();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_left_brace();\n if (address2 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read___();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._object_open[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_object_close: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._object_close = this._cache._object_close || {};\n var cached = this._cache._object_close[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = [];\n var address1 = FAILURE;\n address1 = this._read___();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_right_brace();\n if (address2 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read___();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._object_close[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_array_open: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._array_open = this._cache._array_open || {};\n var cached = this._cache._array_open[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = [];\n var address1 = FAILURE;\n address1 = this._read___();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_left_bracket();\n if (address2 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read___();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._array_open[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_array_close: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._array_close = this._cache._array_close || {};\n var cached = this._cache._array_close[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = [];\n var address1 = FAILURE;\n address1 = this._read___();\n if (address1 !== FAILURE) {\n var address2 = FAILURE;\n address2 = this._read_right_bracket();\n if (address2 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read___();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._array_close[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_type_open: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._type_open = this._cache._type_open || {};\n var cached = this._cache._type_open[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = [];\n var address1 = FAILURE;\n var remaining0 = 0, index2 = this._offset, elements1 = [], address2 = true;\n while (address2 !== FAILURE) {\n address2 = this._read_space();\n if (address2 !== FAILURE) {\n elements1.push(address2);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address1 = new TreeNode(this._input.substring(index2, this._offset), index2, elements1);\n this._offset = this._offset;\n } else {\n address1 = FAILURE;\n }\n if (address1 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read_left_paren();\n if (address3 !== FAILURE) {\n var address4 = FAILURE;\n var remaining1 = 0, index3 = this._offset, elements2 = [], address5 = true;\n while (address5 !== FAILURE) {\n address5 = this._read_space();\n if (address5 !== FAILURE) {\n elements2.push(address5);\n --remaining1;\n }\n }\n if (remaining1 <= 0) {\n address4 = new TreeNode(this._input.substring(index3, this._offset), index3, elements2);\n this._offset = this._offset;\n } else {\n address4 = FAILURE;\n }\n if (address4 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._type_open[index0] = [address0, this._offset];\n return address0;\n },\n\n _read_type_close: function() {\n var address0 = FAILURE, index0 = this._offset;\n this._cache._type_close = this._cache._type_close || {};\n var cached = this._cache._type_close[index0];\n if (cached) {\n this._offset = cached[1];\n return cached[0];\n }\n var index1 = this._offset, elements0 = [];\n var address1 = FAILURE;\n var remaining0 = 0, index2 = this._offset, elements1 = [], address2 = true;\n while (address2 !== FAILURE) {\n address2 = this._read_space();\n if (address2 !== FAILURE) {\n elements1.push(address2);\n --remaining0;\n }\n }\n if (remaining0 <= 0) {\n address1 = new TreeNode(this._input.substring(index2, this._offset), index2, elements1);\n this._offset = this._offset;\n } else {\n address1 = FAILURE;\n }\n if (address1 !== FAILURE) {\n var address3 = FAILURE;\n address3 = this._read_right_paren();\n if (address3 !== FAILURE) {\n } else {\n elements0 = null;\n this._offset = index1;\n }\n } else {\n elements0 = null;\n this._offset = index1;\n }\n if (elements0 === null) {\n address0 = FAILURE;\n } else {\n address0 = new TreeNode(this._input.substring(index1, this._offset), index1, elements0);\n this._offset = this._offset;\n }\n this._cache._type_close[index0] = [address0, this._offset];\n return address0;\n }\n };\n\n var Parser = function(input, actions, types) {\n this._input = input;\n this._inputSize = input.length;\n this._actions = actions;\n this._types = types;\n this._offset = 0;\n this._cache = {};\n this._failure = 0;\n this._expected = [];\n };\n\n Parser.prototype.parse = function() {\n var tree = this._read_root();\n if (tree !== FAILURE && this._offset === this._inputSize) {\n return tree;\n }\n if (this._expected.length === 0) {\n this._failure = this._offset;\n this._expected.push('');\n }\n this.constructor.lastError = {offset: this._offset, expected: this._expected};\n throw new SyntaxError(formatError(this._input, this._failure, this._expected));\n };\n\n var parse = function(input, options) {\n options = options || {};\n var parser = new Parser(input, options.actions, options.types);\n return parser.parse();\n };\n extend(Parser.prototype, Grammar);\n\n var exported = {Grammar: Grammar, Parser: Parser, parse: parse};\n\n if (typeof require === 'function' && typeof exports === 'object') {\n extend(exports, exported);\n } else {\n var namespace = typeof this !== 'undefined' ? this : window;\n namespace.ExtendedJSON = exported;\n }\n})();\n","// This is needed because `ejson` is still using canpoy that produce parser\n// that is not using ESM and needs require. Dunno why this is work, just kinda\n// brut-forced with debugger.\nimport \"@ejson/ejson.js\";\nlet ExtendedJSON = typeof exports === \"object\" ? exports : window.ExtendedJSON;\n\nexport default ExtendedJSON;\n","\"use strict\";\n\nlet ExtendedJSONHandler = {\n make_root: function (input, start, end, elements) {\n return elements[0];\n },\n\n make_object: function (input, start, end, elements) {\n let firstPair = elements[0];\n let otherPairs = elements[1];\n let object = {};\n\n object[firstPair.key] = firstPair.value;\n\n otherPairs.forEach(function (element) {\n let pair = element.pair;\n object[pair.key] = pair.value;\n });\n\n return object;\n },\n\n make_pair: function (input, start, end, elements) {\n return { key: elements[0], value: elements[1] };\n },\n\n make_empty_object: function (input, start, end, elements) {\n return {};\n },\n\n make_string: function (input, start, end, elements) {\n let text = elements[0].text;\n return `${text}`;\n },\n\n make_identifier: function (input, start, end, elements) {\n let name = input.slice(start, end);\n\n return name;\n },\n\n make_array: function (input, start, end, elements) {\n let list = [elements[0]];\n\n elements[1].forEach(function (element) {\n list.push(element.value);\n });\n\n return list;\n },\n\n make_empty_array: function (input, start, end, elements) {\n return [];\n },\n\n make_number: function (input, start, end, elements) {\n let number = input.slice(start, end);\n\n return Number(number);\n },\n\n make_numeric_string: function (input, start, end, elements) {\n return elements[0];\n },\n\n make_number_as_string: function (input, start, end, elements) {\n let number = input.slice(start, end);\n\n return number;\n },\n\n make_null: function (input, start, end) {\n return null;\n },\n\n make_true: function (input, start, end) {\n return true;\n },\n\n make_false: function (input, start, end) {\n return false;\n },\n\n make_object_id: function (input, start, end, elements) {\n return { $oid: elements[0] };\n },\n\n make_bin_data: function (input, start, end, elements) {\n return { $binary: elements[1], $type: `${elements[0]}` };\n },\n\n make_timestamp: function (input, start, end, elements) {\n return { $timestamp: { t: elements[0], i: elements[1] } };\n },\n\n make_number_long: function (input, start, end, elements) {\n return { $numberLong: `${elements[0]}` };\n },\n\n make_number_decimal: function (input, start, end, elements) {\n return { $numberDecimal: `${elements[0]}` };\n },\n\n make_date: function (input, start, end, elements) {\n return { $date: `${elements[0]}` };\n },\n\n make_regexp: function (input, start, end, elements) {\n return { $regex: `${elements[0].text}`, $options: elements[1].text };\n },\n\n make_db_ref: function (input, start, end, elements) {\n return { $ref: `${elements[0]}`, $id: `${elements[1]}` };\n },\n\n make_min_key: function (input, start, end) {\n return { $minKey: 1 };\n },\n\n make_max_key: function (input, start, end) {\n return { $maxKey: 1 };\n },\n\n make_undefined: function (input, start, end) {\n return { $undefined: true };\n },\n};\n\nexport default ExtendedJSONHandler;\n","\"use strict\";\n\nimport ExtendedJSON from \"./ejson.js\";\nimport ExtendedJSONHandler from \"./ejson.handler\";\n\nlet formatExpectation = function (expected) {\n var message = \"Expected: \" + expected.join(\", \") + \"\\n\";\n\n return message;\n};\n\nExtendedJSON.Parser.prototype.validate = function () {\n var tree = this._read_root();\n\n if (\n tree !== ExtendedJSON.Parser.FAILURE &&\n this._offset === this._inputSize\n ) {\n return true;\n }\n\n if (this._expected.length === 0) {\n this._failure = this._offset;\n this._expected.push(\"\");\n }\n\n let errorMessage = formatExpectation(this._expected);\n\n return {\n error: errorMessage,\n offset: this._failure,\n };\n};\n\nExtendedJSON.validate = function (input, options) {\n options = options || { actions: ExtendedJSONHandler };\n var parser = new ExtendedJSON.Parser(input, options.actions, options.types);\n return parser.validate();\n};\n","export default \"# It doesn't play well with cache, so please, type something\\n# in ace.ejson.aggregate.snippets.js.erb to bust cache\\n# And MIND THE TABS\\n\\n## Aggregation Pipeline stages\\nsnippet $addFields\\n\\t{\\n\\t \\\"\\\\$addFields\\\": {\\n\\t \\\"${1:newField}\\\": \\\"${2:expression}\\\"\\n\\t }\\n\\t},\\n\\nsnippet $bucket\\n\\t{\\n\\t \\\"\\\\$bucket\\\": {\\n\\t \\\"groupBy\\\": \\\"${1:expression}\\\",\\n\\t \\\"boundaries\\\": [ ${2:0,200,500} ],\\n\\t \\\"default\\\": \\\"${3:literal}\\\",\\n\\t \\\"output\\\": {\\n\\t \\\"${4:outputName}\\\": { ${5:\\\"accumulator\\\"}: ${6:\\\"expression\\\"} }}\\n\\t }\\n\\t }\\n\\t},\\n\\nsnippet $bucketAuto\\n\\t{\\n\\t \\\"\\\\$bucketAuto\\\": {\\n\\t \\\"groupBy\\\": \\\"${1:expression}\\\",\\n\\t \\\"buckets\\\": ${2:5},\\n\\t \\\"output\\\": {\\n\\t \\\"${3:outputName}\\\": { ${4:\\\"accumulator\\\"}: ${5:\\\"expression\\\"} }}\\n\\t }\\n\\t \\\"granularity\\\": \\\"${6:string}\\\",\\n\\t }\\n\\t},\\n\\nsnippet $count\\n\\t{ \\\"\\\\$count\\\": \\\"${1:name}\\\" },\\n\\nsnippet $facet\\n\\t{\\n\\t \\\"\\\\$facet\\\": {\\n\\t \\\"${1:outputFieldName}\\\": [\\n\\t ${2:// Sub Pipline}\\n\\t ],\\n\\t }\\n\\t},\\n\\nsnippet $geoNear\\n\\t{\\n\\t \\\"\\\\$geoNear\\\": {\\n\\t \\\"near\\\": { {${1:\\\"type\\\": \\\"Point\\\", \\\"coordinates\\\": [ ${2:lat}, ${3:long} ] }},\\n\\t \\\"distanceField\\\": \\\"${4:fieldName}\\\",\\n\\t \\\"spherical\\\": ${5: true}\\n\\t }\\n\\t},\\n\\nsnippet $graphLookup\\n\\t{\\n\\t \\\"\\\\$graphLookup\\\": {\\n\\t \\\"from\\\": \\\"${1:collection}\\\",\\n\\t \\\"startWith\\\": \\\"$${2:expression}\\\",\\n\\t \\\"connectFromField\\\": \\\"${3:fromName}\\\",\\n\\t \\\"connectToField\\\": \\\"${4:toName}\\\",\\n\\t \\\"as\\\": \\\"${5:newFieldName}\\\",\\n\\t \\\"maxDepth\\\": ${6:10},\\n\\t \\\"depthField\\\": \\\"${7:depthFieldName}\\\",\\n\\t \\\"restrictSearchWithMatch\\\": ${8:{ \\\"field\\\": \\\"value\\\" \\\\}}\\n\\t }\\n\\t},\\n\\nsnippet $group\\n\\t{\\n\\t \\\"\\\\$group\\\": {\\n\\t \\\"_id\\\": \\\"${1:expression}\\\",\\n\\t \\\"${2:name}\\\": { \\\"${4:}\\\": ${5}}\\n\\t }\\n\\t},\\n\\nsnippet $limit\\n\\t{ \\\"\\\\$limit\\\": ${1:10} },\\n\\nsnippet $lookup\\n\\t{\\n\\t \\\"\\\\$lookup\\\": {\\n\\t \\\"from\\\": \\\"${1:fromCollection}\\\",\\n\\t \\\"localField\\\": \\\"${2:localName}\\\",\\n\\t \\\"foreignField\\\": \\\"${3:fieldInFromCollection}\\\",\\n\\t \\\"as\\\": \\\"${4:joinedFieldName}\\\"\\n\\t }\\n\\t},\\n\\nsnippet $match\\n\\t{\\n\\t \\\"\\\\$match\\\": {\\n\\t \\\"${1:attribute}\\\": \\\"${2:value}\\\"\\n\\t }\\n\\t},\\n\\nsnippet $project\\n\\t{\\n\\t \\\"\\\\$project\\\": {\\n\\t ${1:\\\"_id\\\": 0,\\n\\t }\\\"${2:attribute}\\\": ${3:1}\\n\\t }\\n\\t},\\n\\nsnippet $redact\\n\\t{\\n\\t \\\"\\\\$redact\\\": {\\n\\t \\\"\\\\$cond\\\": {\\n\\t \\\"if\\\": { $1 },\\n\\t \\\"then\\\": \\\"\\\\$\\\\$PRUNE\\\",\\n\\t \\\"else\\\": \\\"\\\\$\\\\$DESCEND\\\"\\n\\t }\\n\\t }\\n\\t},\\n\\nsnippet $replaceRoot\\n\\t{\\n\\t \\\"\\\\$replaceRoot\\\": { newRoot: \\\"${1:replacementDocument}\\\" }\\n\\t},\\n\\nsnippet $sample\\n\\t{ \\\"\\\\$sample\\\": { \\\"size\\\": ${1:2} } },\\n\\nsnippet $skip\\n\\t{ \\\"\\\\$skip\\\": ${1:5} },\\n\\nsnippet $sort\\n\\t{\\n\\t \\\"\\\\$sort\\\": { \\\"${1:field}\\\": ${2:-}1 }\\n\\t},\\n\\nsnippet $sortByCount\\n\\t{\\n\\t \\\"\\\\$sortByCount\\\": \\\"\\\\$${1:field}\\\"\\n\\t},\\n\\nsnippet $unwind\\n\\t{\\n\\t \\\"\\\\$unwind\\\": {\\n\\t \\\"path\\\": \\\"$$1\\\"${2:,\\n\\t \\\"includeArrayIndex\\\": \\\"\\\"}${3:,\\n\\t \\\"preserveNullAndEmptyArrays\\\": true}\\n\\t }\\n\\t},\\n\\n## Aggregation Pipline Operators\\n# Arithmetic Expression Operators\\nsnippet $abs\\n\\t{ \\\"\\\\$abs\\\": ${1:number} }\\nsnippet $add\\n\\t{ \\\"\\\\$add\\\": [ ${1:expression1}, ${2:expression2}, ... ] }\\nsnippet $ceil\\n\\t{ \\\"\\\\$ceil\\\": ${1:number} }\\nsnippet $divide\\n\\t{ \\\"\\\\$divide\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $exp\\n\\t{ \\\"\\\\$exp\\\": ${1:exponent} }\\nsnippet $floor\\n\\t{ \\\"\\\\$floor\\\": ${1:number} }\\nsnippet $ln\\n\\t{ \\\"\\\\$ln\\\": ${1:number} }\\nsnippet $log\\n\\t{ \\\"\\\\$log\\\": [ ${1:number}, ${1:base} ] }\\nsnippet $log10\\n\\t{ \\\"\\\\$log10\\\": ${1:number} }\\nsnippet $mod\\n\\t{ \\\"\\\\$mod\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $multiply\\n\\t{ \\\"\\\\$multiply\\\": [ ${1:expression1}, ${2:expression2}, ... ] }\\nsnippet $pow\\n\\t{ \\\"\\\\$pow\\\": [ ${1:number}, ${1:exponent} ] }\\nsnippet $sqrt\\n\\t{ \\\"\\\\$sqrt\\\": ${1:number} }\\nsnippet $subtract\\n\\t{ \\\"\\\\$subtract\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $trunc\\n\\t{ \\\"\\\\$trunc\\\": ${1:number} }\\n\\n# Array Expression Operators\\nsnippet $arrayElemAt\\n\\t{ \\\"\\\\$arrayElemAt\\\": [ ${1:array}, ${1:idx} ] }\\nsnippet $arrayToObject\\n\\t{ \\\"\\\\$arrayToObject\\\": ${1:expression} }\\nsnippet $concatArrays\\n\\t{ \\\"\\\\$concatArrays\\\": [ ${1:array1}, ${1:array2}, ... ] }\\nsnippet $filter\\n\\t{ \\\"\\\\$filter\\\": { input: ${1:array}, as: ${1:string}, cond: ${1:expression} } }\\nsnippet $in\\n\\t{ \\\"\\\\$in\\\": [ ${1:expression}, ${1:array expression} ] }\\nsnippet $indexOfArray\\n\\t{ \\\"\\\\$indexOfArray\\\": [ ${1:array expression}, ${1:search expression}, ${1:start}, ${1:end} ] }\\nsnippet $isArray\\n\\t{ \\\"\\\\$isArray\\\": [ ${1:expression} ] }\\nsnippet $map\\n\\t{ \\\"\\\\$map\\\": { input: ${1:expression}, as: ${1:string}, in: ${3:expression} } }\\nsnippet $objectToArray\\n\\t{ \\\"\\\\$objectToArray\\\": ${1:object} }\\nsnippet $range\\n\\t{ \\\"\\\\$range\\\": [ ${1:start}, ${1:end}, ${1:non-zero step} ] }\\nsnippet $reverseArray\\n\\t{ \\\"\\\\$reverseArray\\\": ${1:array expression} }\\nsnippet $size\\n\\t{ \\\"\\\\$size\\\": ${1:expression} }\\nsnippet $slice\\n\\t{ \\\"\\\\$slice\\\": [ ${1:array}, ${1:n} ] }\\n\\nsnippet $reduce\\n\\t{\\n\\t \\\"\\\\$reduce\\\": {\\n\\t \\\"input\\\": ${1:array},\\n\\t \\\"initialValue\\\": ${1:expression},\\n\\t \\\"in\\\": ${1:expression}\\n\\t }\\n\\t}\\n\\nsnippet $zip\\n\\t{\\n\\t \\\"\\\\$zip\\\": {\\n\\t \\\"inputs\\\": [ ${1:array expression1} ],\\n\\t \\\"useLongestLength\\\": ${1:boolean},\\n\\t \\\"defaults\\\": ${1:array expression}\\n\\t }\\n\\t}\\n\\n# Boolean Expression Operators\\n# Match Query Operators\\nsnippet $and\\n\\t{ \\\"\\\\$and\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $not\\n\\t{ \\\"\\\\$not\\\": [ ${1:expressio1} ] }\\nsnippet $or\\n\\t{ \\\"\\\\$or\\\": [ ${1:expression1}, ${2:expression2}] }\\n\\n# Comparison Expression Operators\\n# Match Query Operators\\nsnippet $cmp\\n\\t{ \\\"\\\\$cmp\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $eq\\n\\t{ \\\"\\\\$eq\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $gt\\n\\t{ \\\"\\\\$gt\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $gte\\n\\t{ \\\"\\\\$gte\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $lt\\n\\t{ \\\"\\\\$lt\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $lte\\n\\t{ \\\"\\\\$lte\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $ne\\n\\t{ \\\"\\\\$ne\\\": [ ${1:expression1}, ${2:expression2} ] }\\n\\n# Conditional Expression Operators\\nsnippet $cond\\n\\t{ \\\"\\\\$cond\\\": { \\\"if\\\": ${1:boolean-expression}, \\\"then\\\": ${2:true-case}, \\\"else\\\": ${3:false-case-} } }\\nsnippet $ifNull\\n\\t{ \\\"\\\\$ifNull\\\": [ ${1:expression}, ${2:replacement-expression-if-null} ] }\\n\\nsnippet $switch\\n\\t\\\"\\\\$switch\\\": {\\n\\t \\\"branches\\\": [\\n\\t { \\\"case\\\": ${1:expression}, then: ${2:expression} },\\n\\t { \\\"case\\\": ${3:expression}, then: ${4:expression} }\\n\\t ],\\n\\t \\\"default\\\": ${4:expression}\\n\\t}\\n\\n# Date Expression Operators\\nsnippet $dateFromParts\\n\\t{\\n\\t \\\"\\\\$dateFromParts\\\" : {\\n\\t 'year': ${1:year}, 'month': ${2:month}, 'day': ${3:day},\\n\\t 'hour': ${4:hour}, 'minute': ${5:minute}, 'second': ${6:second},\\n\\t 'milliseconds': ${7:ms}, 'timezone': ${8:tzExpression}\\n\\t }\\n\\t}\\n\\nsnippet $dateFromString\\n\\t{\\n\\t \\\"\\\\$dateFromString\\\": {\\n\\t \\\"dateString\\\": ${1:dateStringExpression},\\n\\t \\\"format\\\": ${2:formatStringExpression},\\n\\t \\\"timezone\\\": ${3:tzExpression},\\n\\t \\\"onError\\\": ${4:onErrorExpression},\\n\\t \\\"onNull\\\": ${5:onNullExpression}\\n\\t }\\n\\t}\\n\\nsnippet $dateToParts\\n\\t{\\n\\t \\\"\\\\$dateToParts\\\": {\\n\\t \\\"date\\\": ${1:dateExpression},\\n\\t \\\"timezone\\\": ${2:timezone},\\n\\t \\\"iso8601\\\": ${3:boolean}\\n\\t }\\n\\t}\\n\\nsnippet $dateToString\\n\\t{\\n\\t \\\"\\\\$dateToString\\\": {\\n\\t \\\"date\\\": ${1:dateExpression},\\n\\t \\\"format\\\": ${2:formatString},\\n\\t \\\"timezone\\\": ${3:tzExpression},\\n\\t \\\"onNull\\\": ${4:expression}\\n\\t }\\n\\t}\\n\\nsnippet $dayOfMonth\\n\\t{ \\\"\\\\$dayOfMonth\\\": ${1:dateExpression} }\\nsnippet $dayOfWeek\\n\\t{ \\\"\\\\$dayOfWeek\\\": ${1:dateExpression} }\\nsnippet $dayOfYear\\n\\t{ \\\"\\\\$dayOfYear\\\": ${1:dateExpression} }\\nsnippet $hour\\n\\t{ \\\"\\\\$hour\\\": ${1:dateExpression} }\\nsnippet $isoDayOfWeek\\n\\t{ \\\"\\\\$isoDayOfWeek\\\": ${1:dateExpression} }\\nsnippet $isoWeek\\n\\t{ \\\"\\\\$isoWeek\\\": ${1:dateExpression} }\\nsnippet $isoWeekYear\\n\\t{ \\\"\\\\$isoWeekYear\\\": ${1:dateExpression} }\\nsnippet $millisecond\\n\\t{ \\\"\\\\$millisecond\\\": ${1:dateExpression} }\\nsnippet $minute\\n\\t{ \\\"\\\\$minute\\\": ${1:dateExpression} }\\nsnippet $month\\n\\t{ \\\"\\\\$month\\\": ${1:dateExpression} }\\nsnippet $second\\n\\t{ \\\"\\\\$second\\\": ${1:dateExpression} }\\nsnippet $week\\n\\t{ \\\"\\\\$week\\\": ${1:dateExpression} }\\nsnippet $year\\n\\t{ \\\"\\\\$year\\\": ${1:dateExpression} }\\n\\n# Literal Expression Operator\\nsnippet $mergeObjects\\n\\t{ \\\"\\\\$literal\\\": ${1:value} }\\n\\n# Object Expression Operators\\nsnippet $literal\\n\\t{ \\\"\\\\$mergeObjects\\\": ${1:document} }\\n\\n# Set Expression Operators\\nsnippet $allElementsTrue\\n\\t{ \\\"\\\\$allElementsTrue\\\": [ ${1:expression} ] }\\nsnippet $anyElementTrue\\n\\t{ \\\"\\\\$anyElementTrue\\\": [ ${1:expression} ] }\\nsnippet $setDifference\\n\\t{ \\\"\\\\$setDifference\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $setEquals\\n\\t{ \\\"\\\\$setEquals\\\": [ ${1:expression1}, ${2:expression2}] }\\nsnippet $setIntersection\\n\\t{ \\\"\\\\$setIntersection\\\": [ ${1:array1}, ${2:array2} ] }\\nsnippet $setIsSubset\\n\\t{ \\\"\\\\$setIsSubset\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $setUnion\\n\\t{ \\\"\\\\$setUnion\\\": [ ${1:expression1}, ${2:expression2} ] }\\n\\n# String Expression Operators\\nsnippet $concat\\n\\t{ \\\"\\\\$concat\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $indexOfBytes\\n\\t{ \\\"\\\\$indexOfBytes\\\": [ ${1:string expression}, ${2:substring expression}, ${3:start}, ${4:end} ] }\\nsnippet $indexOfCP\\n\\t{ \\\"\\\\$indexOfCP\\\": [ ${1:string expression}, ${2:substring expression}, ${3:start}, ${4:end} ] }\\nsnippet $ltrim\\n\\t{ \\\"\\\\$ltrim\\\": { input: ${1:string}, chars: ${2:string} } }\\nsnippet $rtrim\\n\\t{ \\\"\\\\$rtrim\\\": { input: ${1:string}, chars: ${2:string} } }\\nsnippet $split\\n\\t{ \\\"\\\\$split\\\": [ ${1:string expression}, ${2:delimiter} ] }\\nsnippet $strLenBytes\\n\\t{ \\\"\\\\$strLenBytes\\\": ${1:string expression} }\\nsnippet $strLenCP\\n\\t{ \\\"\\\\$strLenCP\\\": ${1:string expression} }\\nsnippet $strcasecmp\\n\\t{ \\\"\\\\$strcasecmp\\\": [ ${1:expression1}, ${2:expression2} ] }\\nsnippet $substr\\n\\t{ \\\"\\\\$substr\\\": [ ${1:string}, ${2:start}, ${3:length} ] }\\nsnippet $substrBytes\\n\\t{ \\\"\\\\$substrBytes\\\": [ ${1:string expression}, ${2:byte index}, ${3:byte count} ] }\\nsnippet $substrCP\\n\\t{ \\\"\\\\$substrCP\\\": [ ${1:string expression}, ${2:code point index}, ${3:code point count} ] }\\nsnippet $toLower\\n\\t{ \\\"\\\\$toLower\\\": ${1:expression} }\\n\\nsnippet $trim\\n\\t{ \\\"\\\\$trim\\\": { \\\"input\\\": ${1:string}, \\\"chars\\\": ${2:string} } }\\nsnippet $toUpper\\n\\t{ \\\"\\\\$toUpper\\\": ${1:expression} }\\n\\n# Text Expression Operator\\nsnippet $meta\\n\\t{ \\\"\\\\$meta\\\": ${1:metaDataKeyword} }\\n\\n# Type Expression Operators\\nsnippet $toBool\\n\\t{ \\\"\\\\$toBool\\\": ${1:expression} }\\nsnippet $toDate\\n\\t{ \\\"\\\\$toDate\\\": ${1:expression}}\\nsnippet $toDecimal\\n\\t{ \\\"\\\\$toDecimal\\\": ${1:expression} }\\nsnippet $toDouble\\n\\t{ \\\"\\\\$toDouble\\\": ${1:expression} }\\nsnippet $toInt\\n\\t{ \\\"\\\\$toInt\\\": ${1:expression} }\\nsnippet $toLong\\n\\t{ \\\"\\\\$toLong\\\": ${1:expression} }\\nsnippet $toObjectId\\n\\t{ \\\"\\\\$toObjectId\\\": ${1:expression} }\\nsnippet $toString\\n\\t{ \\\"\\\\$toString\\\": ${1:expression} }\\nsnippet $type\\n\\t{ \\\"\\\\$type\\\": ${1:expression} }\\n\\nsnippet $convert\\n\\t{\\n\\t \\\"\\\\$convert\\\":\\n\\t {\\n\\t \\\"input\\\": ${1:expression},\\n\\t \\\"to\\\": ${2:type expression},\\n\\t \\\"onError\\\": ${3:expression}, // Optional.\\n\\t \\\"onNull\\\": ${4:expression} // Optional.\\n\\t }\\n\\t}\\n\"","\"use strict\";\nimport { EditorLoader } from \"./editor_loader\";\n\nimport snippet from \"./ace.ejson.aggregate.snippets?raw\";\n\nEditorLoader.extend(\"snippet.aggregate\", function () {\n define(\"ace/snippets/ejson.aggregate\", function (require, exports, module) {\n \"use strict\";\n\n exports.snippetText = snippet;\n exports.scope = \"ejson\";\n });\n});\n","export default \"# It doesn't play well with cache, so please, type something\\n# in ace.ejson.snuppets.js.erb to bust cache\\n# And MIND THE TABS\\n\\n## Query operators\\n# Comparison Query Operators\\nsnippet $eq\\n\\t{ \\\"\\\\$eq\\\": ${1:value} }\\nsnippet $ne\\n\\t{ \\\"\\\\$ne\\\": ${1:value} }\\n\\nsnippet $gt\\n\\t{ \\\"\\\\$gt\\\": ${1:value} }\\nsnippet $gte\\n\\t{ \\\"\\\\$gte\\\": ${1:value} }\\nsnippet $lt\\n\\t{ \\\"\\\\$lt\\\": ${1:value} }\\nsnippet $lte\\n\\t{ \\\"\\\\$lte\\\": ${1:value} }\\n\\nsnippet $in\\n\\t{ \\\"\\\\$in\\\": [${1:value}${2:,}] }\\nsnippet $nin\\n\\t{ \\\"\\\\$nin\\\": [${1:value}${2:,}] }\\n\\n# Logical Query Operators\\nsnippet $and\\n\\t{ \\\"\\\\$and\\\": [${1:expr}${2:,}] }\\nsnippet $or\\n\\t{ \\\"\\\\$or\\\": [${1:exp}${2:,}] }\\nsnippet $nor\\n\\t{ \\\"\\\\$nor\\\": [${1:exp}${2:,}] }\\nsnippet $not\\n\\t{ \\\"\\\\$not\\\": ${1:expr} }\\n\\n# Element Query Operators\\nsnippet $exists\\n\\t{ \\\"\\\\$exists\\\": ${1:true} }\\nsnippet $type\\n\\t{ \\\"\\\\$type\\\": \\\"${1:BSON Type}\\\" }\\n\\n# Evaluation Query Operators\\nsnippet $expr\\n\\t{ \\\"\\\\$expr\\\": ${1:expr} }\\nsnippet $jsonSchema\\n\\t{ \\\"\\\\$jsonSchema\\\": ${1:schema} }\\nsnippet $mod\\n\\t{ \\\"\\\\$mod\\\": [ ${1:divisor}, ${1:reminder} ] }\\nsnippet $regex\\n\\t{ \\\"\\\\$regex\\\": /${1:pattern/${2:options} }\\nsnippet $text\\n\\t{\\n\\t \\\"\\\\$text\\\": {\\n\\t \\\"\\\\$search\\\": \\\"${1:term}\\\",\\n\\t \\\"\\\\$language\\\": \\\"${2:term}\\\",\\n\\t \\\"\\\\$caseSensitive\\\": \\\"${3:true}\\\",\\n\\t \\\"\\\\$diacriticSensitive\\\": \\\"${4:true}\\\"\\n\\t }\\n\\t}\\nsnippet $where\\n\\t{\\n\\t \\\"\\\\$where\\\": function() {\\n\\t ${1:js code}\\n\\t }\\n\\t}\\n\\n# Geospatial Query Operators\\n# Query Selectors\\nsnippet $geoIntersects\\n\\t{\\n\\t \\\"\\\\$geoIntersects\\\": {\\n\\t \\\"\\\\$geometry\\\": {\\n\\t \\\"type\\\": \\\"${1:term}\\\" ,\\n\\t \\\"coordinates\\\": [ ${2:coordinates} ]\\n\\t }\\n\\t }\\n\\t}\\n\\nsnippet $geoWithin\\n\\t{\\n\\t \\\"\\\\$geoWithin\\\": {\\n\\t \\\"\\\\$geometry\\\": {\\n\\t \\\"type\\\": \\\"${1:Polygon}\\\" ,\\n\\t \\\"coordinates\\\": [ ${2:coordinates} ]\\n\\t }\\n\\t }\\n\\t}\\n\\nsnippet $near\\n\\t{\\n\\t \\\"\\\\$near\\\": {\\n\\t \\\"\\\\$geometry\\\": {\\n\\t \\\"type\\\": \\\"Point\\\" ,\\n\\t \\\"coordinates\\\": [ ${1:longitude} , ${2:latitude} ]\\n\\t },\\n\\t \\\"\\\\$maxDistance\\\": ${3:distance in meters},\\n\\t \\\"\\\\$minDistance\\\": ${4:distance in meters}\\n\\t }\\n\\t}\\n\\nsnippet $nearSphere\\n\\t{\\n\\t \\\"\\\\$nearSphere\\\": {\\n\\t \\\"\\\\$geometry\\\": {\\n\\t \\\"type\\\": \\\"Point\\\" ,\\n\\t \\\"coordinates\\\": [ ${1:longitude} , ${2:latitude} ]\\n\\t },\\n\\t \\\"\\\\$maxDistance\\\": ${3:distance in meters},\\n\\t \\\"\\\\$minDistance\\\": ${4:distance in meters}\\n\\t }\\n\\t}\\n\\n# Geometry Specifiers\\nsnippet $box\\n\\t\\\"\\\\$box\\\": [ [ ${1:bottom left} ], [ ${2:upper right} ] ],\\nsnippet $center\\n\\t\\\"\\\\$center\\\": [ [ ${1:x}, ${2:y} ] , ${3:radius} ],\\nsnippet $centerSphere\\n\\t\\\"\\\\$centerSphere\\\": [ [ ${1:x}, ${2:y} ] , ${3:radius} ],\\nsnippet $geometry\\n\\t\\\"\\\\$geometry\\\": {\\n\\t \\\"type\\\": \\\"Point\\\" ,\\n\\t \\\"coordinates\\\": [ ${1:longitude} , ${2:latitude} ]\\n\\t},\\nsnippet $polygon\\n\\t\\\"\\\\$polygon\\\": [ [ ${1:x}, ${2:y} ]${3:, [ ${4:x}, ${5:y} ]} ],\\n\\n\\n# Array Query Operators\\nsnippet $all\\n\\t{ \\\"\\\\$all\\\": [ ${1:value1}${2:, value2} ] }\\nsnippet $elemMatch\\n\\t{ \\\"\\\\$elemMatch\\\": { ${1:query}, ${2:, query2} } }\\nsnippet $size\\n\\t{ \\\"\\\\$size\\\": ${1:array size} }\\n\\n# Bitwise Query Operators\\nsnippet $bitsAllClear\\n\\t{ \\\"\\\\$bitsAllClear\\\": ${1:bitmask} }\\nsnippet $bitsAllSet\\n\\t{ \\\"\\\\$bitsAllSet\\\": ${1:bitmask} }\\nsnippet $bitsAnyClear\\n\\t{ \\\"\\\\$bitsAnyClear\\\": ${1:bitmask} }\\nsnippet $bitsAnySet\\n\\t{ \\\"\\\\$bitsAnySet\\\": ${1:bitmask} }\\n\\n# Comment\\nsnippet $comment\\n\\t\\\"\\\\$comment\\\": \\\"${1:text to attach to query}\\\"\\n\\n\\n## Update operators\\n# Field Update Operators\\nsnippet $currentDate\\n\\t{ \\\"\\\\$currentDate\\\": { \\\"${1:field}\\\": \\\"${2:type}\\\" } }\\nsnippet $inc\\n\\t{ \\\"\\\\$inc\\\": { \\\"${1:field}\\\": ${2:amount} } }\\nsnippet $min\\n\\t{ \\\"\\\\$min\\\": { \\\"${1:field}\\\": ${2:value} } }\\nsnippet $max\\n\\t{ \\\"\\\\$max\\\": { \\\"${1:field}\\\": ${2:value} } }\\nsnippet $mul\\n\\t{ \\\"\\\\$mul\\\": { \\\"${1:field}\\\": ${2:value} } }\\nsnippet $rename\\n\\t{ \\\"\\\\$rename\\\": { \\\"${1:field}\\\": \\\"${2:new name}\\\" } }\\nsnippet $set\\n\\t{ \\\"\\\\$set\\\": { \\\"${1:field}\\\": ${2:value} } }\\nsnippet $setOnInsert\\n\\t{ \\\"\\\\$setOnInsert\\\": { \\\"${1:field}\\\": ${2:value} } },\\nsnippet $unset\\n\\t{ \\\"\\\\$unset\\\": { \\\"${1:field}\\\": \\\"\\\" } }\\n\\n# Array Update Operators\\nsnippet $addToSet\\n\\t{ \\\"\\\\$addToSet\\\": { \\\"${1:field}\\\": ${2:value} } }\\nsnippet $pop\\n\\t{ \\\"\\\\$pop\\\": { \\\"${1:field}\\\": ${2:-1} } }\\nsnippet $pull\\n\\t{ \\\"\\\\$pull\\\": { \\\"${1:field}\\\": ${2:value/condition} } }\\nsnippet $push\\n\\t{ \\\"\\\\$push\\\": { \\\"${1:field}\\\": ${2:value} } }\\nsnippet $pullAll\\n\\t{ \\\"\\\\$pullAll\\\": { \\\"${1:field}\\\": [ ${2:value}${3:, ${4:value}} ] } }\\n\\n# Array Update Operator Modifiers\\nsnippet $each\\n\\t{ \\\"\\\\$each\\\": [ ${1:value}${2:, ${3:value}} ] }\\nsnippet $position\\n\\t\\\"\\\\$position\\\": ${1:num}\\nsnippet $slice\\n\\t\\\"\\\\$slice\\\": ${1:num}\\nsnippet $sort\\n\\t\\\"\\\\$sort\\\": ${1:sort specification}\\n\\n# Bitwise Update Operator\\nsnippet $bit\\n\\t{ \\\"\\\\$bit\\\": { \\\"${1:field}\\\": { \\\"${2:and|or|xor}\\\": ${3:int} } } }\\n\"","\"use strict\";\n\nimport { EditorLoader } from \"./editor_loader\";\n\nimport snippet from \"./ace.ejson.snippets?raw\";\n\nEditorLoader.extend(\"snippet\", function () {\n define(\"ace/snippets/ejson\", function (require, exports, module) {\n \"use strict\";\n\n exports.snippetText = snippet;\n exports.scope = \"ejson\";\n });\n});\n","\"use strict\";\n\nimport { EditorLoader } from \"./editor_loader\";\n\nEditorLoader.extend(\"ejson_autocompleter\", function () {\n define(\n \"ace/autocomplete/ejson_completer\",\n function (require, exports, module) {\n \"use strict\";\n\n var Range = require(\"../range\").Range;\n\n var splitRegex = /[^a-zA-Z_0-9\\$\\-\\u00C0-\\u1FFF\\u2C00-\\uD7FF\\w]+/;\n\n function getWordIndex(doc, pos) {\n var textBefore = doc.getTextRange(\n Range.fromPoints({ row: 0, column: 0 }, pos)\n );\n return textBefore.split(splitRegex).length - 1;\n }\n\n /**\n * Does a distance analysis of the word `prefix` at position `pos` in `doc`.\n * @return Map\n */\n function wordDistance(doc, pos) {\n var prefixPos = getWordIndex(doc, pos);\n var words = doc.getValue().split(splitRegex);\n var wordScores = Object.create(null);\n\n var currentWord = words[prefixPos];\n\n words.forEach(function (word, idx) {\n if (!word || word === currentWord) return;\n // Skip if starts with $\n if (word.startsWith(\"$\")) return;\n\n var distance = Math.abs(prefixPos - idx);\n var score = words.length - distance;\n if (wordScores[word]) {\n wordScores[word] = Math.max(score, wordScores[word]);\n } else {\n wordScores[word] = score;\n }\n });\n return wordScores;\n }\n\n exports.getCompletions = function (\n editor,\n session,\n pos,\n prefix,\n callback\n ) {\n var wordScore = wordDistance(session, pos, prefix);\n var wordList = Object.keys(wordScore);\n callback(\n null,\n wordList.map(function (word) {\n return {\n caption: word,\n value: word,\n score: wordScore[word],\n meta: \"local\",\n };\n })\n );\n };\n }\n );\n});\n","\"use strict\";\n\nimport { EditorLoader } from \"./editor_loader\";\n\nEditorLoader.extend(\"highligh_rules\", function () {\n define(\"ace/mode/ejson_highlight_rules\", function (require, exports, module) {\n \"use strict\";\n\n var oop = require(\"ace/lib/oop\");\n var TextHighlightRules =\n require(\"ace/mode/text_highlight_rules\").TextHighlightRules;\n var identifierRe = \"[a-zA-Z\\\\$_\\u00a1-\\uffff][a-zA-Z\\\\d\\\\$_\\u00a1-\\uffff]*\";\n\n var EJsonHighlightRules = function (options) {\n // regexp must not have capturing parentheses. Use (?:) instead.\n // regexps are ordered -> the first match is used\n this.$rules = {\n start: [\n {\n token: \"keyword\",\n regex:\n \"BinData|new\\\\s+Date|ISODate|Timestamp|ObjectId|DBRef|MinKey|MaxKey|NumberLong|NumberDecimal|undefined\",\n },\n {\n token: \"meta\", // $keyword single line\n regex: '[\"]\\\\$(?:(?:\\\\\\\\.)|(?:[^\"\\\\\\\\]))*?[\"]\\\\s*(?=:)',\n },\n {\n token: \"meta\", // $keyword single line without quotes\n regex: '\\\\$(?:(?:\\\\\\\\.)|(?:[^\"\\\\\\\\]))*?\\\\s*(?=:)',\n },\n {\n token: \"variable\", // single line\n regex: '[\"](?!$)(?:(?:\\\\\\\\.)|(?:[^\"\\\\\\\\]))*?[\"]\\\\s*(?=:)',\n },\n {\n token: \"string\", // single line\n regex: '\"',\n next: \"string\",\n },\n {\n token: \"constant.numeric\", // hex\n regex: \"0[xX][0-9a-fA-F]+\\\\b\",\n },\n {\n token: \"constant.numeric\", // float\n regex: \"[+-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?\\\\b\",\n },\n {\n token: \"constant.language.boolean\",\n regex: \"(?:true|false)\\\\b\",\n },\n {\n token: \"string\", // single quoted strings are not allowed\n regex: \"['](?:(?:\\\\\\\\.)|(?:[^'\\\\\\\\]))*?[']\",\n },\n {\n token: \"comment\", // comments are not allowed\n regex: \"\\\\/\\\\/.*$\",\n },\n {\n token: \"comment.start\", // comments are not allowed\n regex: \"\\\\/\\\\*\",\n next: \"comment\",\n },\n {\n token: \"paren.lparen\",\n regex: \"[[({]\",\n },\n {\n token: \"paren.rparen\",\n regex: \"[\\\\])}]\",\n },\n {\n token: \"text\",\n regex: \"\\\\s+\",\n },\n ],\n string: [\n {\n token: \"constant.language.escape\",\n regex: /\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[\"\\\\\\/bfnrt])/,\n },\n {\n token: \"string\",\n regex: '\"|$',\n next: \"start\",\n },\n {\n defaultToken: \"string\",\n },\n ],\n comment: [\n {\n token: \"comment.end\", // comments are not allowed\n regex: \"\\\\*\\\\/\",\n next: \"start\",\n },\n {\n defaultToken: \"comment\",\n },\n ],\n };\n };\n\n oop.inherits(EJsonHighlightRules, TextHighlightRules);\n exports.EJsonHighlightRules = EJsonHighlightRules;\n });\n});\n","\"use strict\";\n\nimport { EditorLoader } from \"./editor_loader\";\n\nEditorLoader.extend(\"mode\", function () {\n define(\"ace/mode/ejson\", [], function (require, exports, module) {\n \"use strict\";\n\n var oop = require(\"ace/lib/oop\");\n var JsonMode = require(\"ace/mode/json\").Mode;\n var HighlightRules =\n require(\"ace/mode/ejson_highlight_rules\").EJsonHighlightRules;\n var MatchingBraceOutdent =\n require(\"ace/mode/matching_brace_outdent\").MatchingBraceOutdent;\n var CstyleBehaviour = require(\"ace/mode/behaviour/cstyle\").CstyleBehaviour;\n var CStyleFoldMode = require(\"ace/mode/folding/cstyle\").FoldMode;\n\n var Mode = function () {\n this.HighlightRules = HighlightRules;\n this.$outdent = new MatchingBraceOutdent();\n this.$behaviour = new CstyleBehaviour();\n this.foldingRules = new CStyleFoldMode();\n };\n oop.inherits(Mode, JsonMode);\n\n exports.Mode = Mode;\n });\n});\n","\"use strict\";\nimport { EditorLoader } from \"./editor_loader\";\nimport \"./ace.ejson.aggregate.snippets.js\";\nimport \"./ace.ejson.snippets.js\";\n\nimport \"./ace.ejson.autocomplete\";\nimport \"./ace.ejson.highlight\";\nimport \"./ace.ejson.mode\";\n\nimport ExtendedJSON from \"../ejson/ejson.js\";\n\nEditorLoader.entryPoint = function () {\n let submitState = {\n \"query-editor\": false,\n \"data-editor\": false,\n };\n\n // Disable or enable submit depending on validation state\n document.addEventListener(\"ejson\", function (event) {\n let result = event.detail;\n let submit = document.querySelector(\"input[type='submit']\");\n\n submitState[result.selector] = result.success;\n let states = Object.values(submitState);\n\n if (states.includes(false)) {\n submit.disabled = true;\n } else {\n submit.disabled = false;\n }\n });\n\n // Add validation errors as annotations\n document.addEventListener(\"ejson\", function (event) {\n var errors = [];\n var result = event.detail;\n\n if (result.success != true) {\n var pos = result.session.doc.indexToPosition(result.offset);\n\n errors.push({\n row: pos.row,\n column: pos.column,\n text: result.error,\n type: \"error\",\n });\n }\n\n result.session.setAnnotations(errors);\n });\n\n function debounce(fn, delay) {\n var timer = null;\n return function () {\n var context = this,\n args = arguments;\n clearTimeout(timer);\n timer = setTimeout(function () {\n fn.apply(context, args);\n }, delay);\n };\n }\n\n function validateEJSON(currentSession, selector) {\n let value = currentSession.getValue();\n\n if (value === \"\") {\n value = \" \";\n }\n\n var result = ExtendedJSON.validate(value);\n\n var eventDetail = {\n session: currentSession,\n selector: selector,\n };\n\n if (result == true) {\n eventDetail.success = true;\n } else {\n eventDetail.success = false;\n eventDetail.error = result.error;\n eventDetail.offset = result.offset;\n }\n\n var event = new CustomEvent(\"ejson\", {\n bubbles: true,\n detail: eventDetail,\n });\n\n document.dispatchEvent(event);\n }\n\n function findAndEnableSnippets(targetEditor) {\n let element = document.querySelector(\"[data-editor-snippets]\");\n if (!element) {\n return;\n }\n\n let snippetNames = (element.dataset.editorSnippets || \"\").split(\",\");\n snippetNames.forEach(function (snippetName) {\n enableSnippet(targetEditor, snippetName);\n });\n }\n\n function enableSnippet(targetEditor, snippetName) {\n ace.config.loadModule(\"ace/snippets\", function (module) {\n var snippetManager = module.snippetManager;\n var aggregateSnippets = ace.require(`ace/snippets/ejson.${snippetName}`);\n\n var id = targetEditor.session.$mode.$id || \"\";\n var m = snippetManager.files[id];\n\n m.scope = aggregateSnippets.scope;\n m.snippetText = aggregateSnippets.snippetText;\n m.snippet = snippetManager.parseSnippetFile(m.snippetText, m.scope);\n\n snippetManager.register(m.snippet, m.scope);\n });\n }\n\n EditorLoader.loadExtensions();\n\n let languageTools = ace.require(\"ace/ext/language_tools\");\n let ejsonCompleter = ace.require(\"ace/autocomplete/ejson_completer\");\n ace.require(\"ace/mode/json\");\n\n languageTools.setCompleters([\n languageTools.snippetCompleter,\n ejsonCompleter,\n languageTools.keyWordCompleter,\n ]);\n\n let options = {\n enableBasicAutocompletion: true,\n enableSnippets: true,\n enableLiveAutocompletion: true,\n minLines: 10,\n theme: \"ace/theme/xcode\",\n mode: \"ace/mode/ejson\",\n fontSize: \"14px\",\n fontFamily: \"monospace\",\n useWorker: false,\n tabSize: 2,\n useSoftTabs: true,\n };\n\n var editorUnloaded = false;\n\n function ignoreExitOnSubmit() {\n let form = document.querySelector(\"form\");\n\n if (!form) {\n return;\n }\n\n form.addEventListener(\"submit\", function (event) {\n editorUnloaded = true;\n });\n }\n\n function editorsChanged(editors) {\n var changed = false;\n\n editors.forEach(function (editor) {\n let undo = editor.session.getUndoManager();\n\n if (undo.hasUndo()) {\n changed = true;\n }\n });\n\n return changed;\n }\n\n function bindEditorsToExitEvent(...editors) {\n // Works in Chrome & Safari on desktop\n window.addEventListener(\"beforeunload\", function (event) {\n if (editorUnloaded) return;\n\n if (editorsChanged(editors)) {\n editorUnloaded = true;\n event.preventDefault();\n event.returnValue =\n \"You have unsaved changes. Do you really want to leave?\";\n }\n });\n }\n\n function bindEditorToTextArea(editor, selector) {\n let textarea = document.querySelector(`[data-editor=\"${selector}\"]`);\n let placeholder = `[data-placeholder=\"${selector}\"]`;\n\n if (!textarea) {\n return;\n }\n\n textarea.style.display = \"none\";\n\n if (!textarea.value) {\n textarea.value = document.querySelector(placeholder).textContent;\n }\n\n let currentSession = editor.getSession();\n\n currentSession.setValue(textarea.value);\n validateEJSON(currentSession, selector);\n\n currentSession.on(\"change\", function () {\n textarea.value = editor.getSession().getValue();\n });\n\n currentSession.on(\n \"change\",\n debounce(function () {\n validateEJSON(currentSession, selector);\n }, 200)\n );\n }\n\n let editorForm = document.querySelector(\"form\");\n let queryEditor = ace.edit(\"query-editor\", options);\n let dataEditor = ace.edit(\"data-editor\", options);\n\n bindEditorToTextArea(queryEditor, \"query-editor\");\n bindEditorToTextArea(dataEditor, \"data-editor\");\n\n window.addEventListener(\"verticalResize\", function (event) {\n console.log(\"Resized vertical!\");\n dataEditor.resize();\n });\n\n window.addEventListener(\"horizontalResize\", function (event) {\n console.log(\"Resized horizontal!\");\n queryEditor.resize();\n });\n\n let saveCommand = {\n name: \"Save\",\n bindKey: {\n win: \"Ctrl-Enter\",\n mac: \"Command-Enter\",\n },\n exec: function () {\n // Because `submit()` does not emit `onSubmit` event\n editorUnloaded = true;\n editorForm.submit();\n },\n };\n\n queryEditor.commands.addCommand(saveCommand);\n dataEditor.commands.addCommand(saveCommand);\n findAndEnableSnippets(queryEditor);\n\n bindEditorsToExitEvent(queryEditor, dataEditor);\n ignoreExitOnSubmit();\n};\n","import { EditorLoader } from \"./editor/editor_loader.js\";\n\nimport \"./ejson/ejson.parser.js\";\nimport \"./editor/ace.editor.js\";\n\n(function () {\n EditorLoader.init();\n}).call(this);\n","window.addEventListener('load', function () {\n 'use strict'\n\n Split(['#panel-query', '#panel-data'], {\n sizes: [70, 30],\n gutterSize: 5,\n cursor: 'pointer',\n direction: 'vertical',\n elementStyle: function (dimension, size, gutterSize) {\n return {\n height: 'calc(' + size + '% - ' + gutterSize + 'px - 30px)'\n }\n },\n onDragEnd: function (sizes) {\n var event = new Event('verticalResize')\n window.dispatchEvent(event)\n }\n })\n\n Split(['#panel-input', '#panel-output'], {\n sizes: [50, 50],\n gutterSize: 5,\n cursor: 'row-resize',\n onDragEnd: function (sizes) {\n var event = new Event('horizontalResize')\n window.dispatchEvent(event)\n }\n })\n})\n","/*\n * Source:\n * https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-2/tabs.html\n *\n * This content is licensed according to the W3C Software License at\n * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\n */\n(function () {\n var tablist = document.querySelectorAll('[role=\"tablist\"]')[0];\n var tabs;\n var panels;\n\n generateArrays();\n\n function generateArrays() {\n tabs = document.querySelectorAll('[role=\"tab\"]');\n panels = document.querySelectorAll('[role=\"tabpanel\"]');\n }\n\n // For easy reference\n var keys = {\n end: 35,\n home: 36,\n left: 37,\n up: 38,\n right: 39,\n down: 40,\n delete: 46,\n enter: 13,\n space: 32,\n };\n\n // Add or substract depenign on key pressed\n var direction = {\n 37: -1,\n 38: -1,\n 39: 1,\n 40: 1,\n };\n\n // Bind listeners\n for (let i = 0; i < tabs.length; ++i) {\n addListeners(i);\n }\n\n function addListeners(index) {\n tabs[index].addEventListener(\"click\", clickEventListener);\n tabs[index].addEventListener(\"keydown\", keydownEventListener);\n tabs[index].addEventListener(\"keyup\", keyupEventListener);\n\n // Build an array with all tabs (