\n * @version 8.4.1\n * @date 2020-01-25\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n if (typeof exports === 'object' && typeof module === 'object') module.exports = factory();else if (typeof define === 'function' && define.amd) define([], factory);else if (typeof exports === 'object') exports[\"JSONEditor\"] = factory();else root[\"JSONEditor\"] = factory();\n})(window, function () {\n return (\n /******/\n function (modules) {\n // webpackBootstrap\n\n /******/\n // The module cache\n\n /******/\n var installedModules = {};\n /******/\n\n /******/\n // The require function\n\n /******/\n\n function __webpack_require__(moduleId) {\n /******/\n\n /******/\n // Check if module is in cache\n\n /******/\n if (installedModules[moduleId]) {\n /******/\n return installedModules[moduleId].exports;\n /******/\n }\n /******/\n // Create a new module (and put it into the cache)\n\n /******/\n\n\n var module = installedModules[moduleId] = {\n /******/\n i: moduleId,\n\n /******/\n l: false,\n\n /******/\n exports: {}\n /******/\n\n };\n /******/\n\n /******/\n // Execute the module function\n\n /******/\n\n modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n /******/\n\n /******/\n // Flag the module as loaded\n\n /******/\n\n module.l = true;\n /******/\n\n /******/\n // Return the exports of the module\n\n /******/\n\n return module.exports;\n /******/\n }\n /******/\n\n /******/\n\n /******/\n // expose the modules object (__webpack_modules__)\n\n /******/\n\n\n __webpack_require__.m = modules;\n /******/\n\n /******/\n // expose the module cache\n\n /******/\n\n __webpack_require__.c = installedModules;\n /******/\n\n /******/\n // define getter function for harmony exports\n\n /******/\n\n __webpack_require__.d = function (exports, name, getter) {\n /******/\n if (!__webpack_require__.o(exports, name)) {\n /******/\n Object.defineProperty(exports, name, {\n enumerable: true,\n get: getter\n });\n /******/\n }\n /******/\n\n };\n /******/\n\n /******/\n // define __esModule on exports\n\n /******/\n\n\n __webpack_require__.r = function (exports) {\n /******/\n if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n /******/\n Object.defineProperty(exports, Symbol.toStringTag, {\n value: 'Module'\n });\n /******/\n }\n /******/\n\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n /******/\n };\n /******/\n\n /******/\n // create a fake namespace object\n\n /******/\n // mode & 1: value is a module id, require it\n\n /******/\n // mode & 2: merge all properties of value into the ns\n\n /******/\n // mode & 4: return value when already ns object\n\n /******/\n // mode & 8|1: behave like require\n\n /******/\n\n\n __webpack_require__.t = function (value, mode) {\n /******/\n if (mode & 1) value = __webpack_require__(value);\n /******/\n\n if (mode & 8) return value;\n /******/\n\n if (mode & 4 && typeof value === 'object' && value && value.__esModule) return value;\n /******/\n\n var ns = Object.create(null);\n /******/\n\n __webpack_require__.r(ns);\n /******/\n\n\n Object.defineProperty(ns, 'default', {\n enumerable: true,\n value: value\n });\n /******/\n\n if (mode & 2 && typeof value != 'string') for (var key in value) {\n __webpack_require__.d(ns, key, function (key) {\n return value[key];\n }.bind(null, key));\n }\n /******/\n\n return ns;\n /******/\n };\n /******/\n\n /******/\n // getDefaultExport function for compatibility with non-harmony modules\n\n /******/\n\n\n __webpack_require__.n = function (module) {\n /******/\n var getter = module && module.__esModule ?\n /******/\n function getDefault() {\n return module['default'];\n } :\n /******/\n function getModuleExports() {\n return module;\n };\n /******/\n\n __webpack_require__.d(getter, 'a', getter);\n /******/\n\n\n return getter;\n /******/\n };\n /******/\n\n /******/\n // Object.prototype.hasOwnProperty.call\n\n /******/\n\n\n __webpack_require__.o = function (object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n };\n /******/\n\n /******/\n // __webpack_public_path__\n\n /******/\n\n\n __webpack_require__.p = \"\";\n /******/\n\n /******/\n\n /******/\n // Load entry module and return exports\n\n /******/\n\n return __webpack_require__(__webpack_require__.s = 21);\n /******/\n }(\n /************************************************************************/\n\n /******/\n [\n /* 0 */\n\n /***/\n function (module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n __webpack_require__.r(__webpack_exports__);\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"parse\", function () {\n return parse;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"repair\", function () {\n return repair;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"escapeUnicodeChars\", function () {\n return escapeUnicodeChars;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"validate\", function () {\n return validate;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"extend\", function () {\n return extend;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"clear\", function () {\n return clear;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getType\", function () {\n return getType;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"isUrl\", function () {\n return isUrl;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"isArray\", function () {\n return isArray;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getAbsoluteLeft\", function () {\n return getAbsoluteLeft;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getAbsoluteTop\", function () {\n return getAbsoluteTop;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"addClassName\", function () {\n return addClassName;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"removeAllClassNames\", function () {\n return removeAllClassNames;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"removeClassName\", function () {\n return removeClassName;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"stripFormatting\", function () {\n return stripFormatting;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"setEndOfContentEditable\", function () {\n return setEndOfContentEditable;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"selectContentEditable\", function () {\n return selectContentEditable;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getSelection\", function () {\n return getSelection;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"setSelection\", function () {\n return setSelection;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getSelectionOffset\", function () {\n return getSelectionOffset;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"setSelectionOffset\", function () {\n return setSelectionOffset;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getInnerText\", function () {\n return getInnerText;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"hasParentNode\", function () {\n return hasParentNode;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getInternetExplorerVersion\", function () {\n return getInternetExplorerVersion;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"isFirefox\", function () {\n return isFirefox;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"addEventListener\", function () {\n return addEventListener;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"removeEventListener\", function () {\n return removeEventListener;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"isChildOf\", function () {\n return isChildOf;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"parsePath\", function () {\n return parsePath;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"stringifyPath\", function () {\n return stringifyPath;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"improveSchemaError\", function () {\n return improveSchemaError;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"isPromise\", function () {\n return isPromise;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"isValidValidationError\", function () {\n return isValidValidationError;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"insideRect\", function () {\n return insideRect;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"debounce\", function () {\n return debounce;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"textDiff\", function () {\n return textDiff;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getInputSelection\", function () {\n return getInputSelection;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getIndexForPosition\", function () {\n return getIndexForPosition;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getPositionForPath\", function () {\n return getPositionForPath;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"compileJSONPointer\", function () {\n return compileJSONPointer;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getColorCSS\", function () {\n return getColorCSS;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"isValidColor\", function () {\n return isValidColor;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"makeFieldTooltip\", function () {\n return makeFieldTooltip;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"get\", function () {\n return get;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"findUniqueName\", function () {\n return findUniqueName;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"getChildPaths\", function () {\n return getChildPaths;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"sort\", function () {\n return sort;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"sortObjectKeys\", function () {\n return sortObjectKeys;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"parseString\", function () {\n return parseString;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"isTimestamp\", function () {\n return isTimestamp;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"formatSize\", function () {\n return formatSize;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"limitCharacters\", function () {\n return limitCharacters;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"isObject\", function () {\n return isObject;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"contains\", function () {\n return contains;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"isValidationErrorChanged\", function () {\n return isValidationErrorChanged;\n });\n /* harmony import */\n\n\n var _polyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);\n /* harmony import */\n\n\n var _polyfills__WEBPACK_IMPORTED_MODULE_0___default =\n /*#__PURE__*/\n __webpack_require__.n(_polyfills__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var javascript_natural_sort__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);\n /* harmony import */\n\n\n var javascript_natural_sort__WEBPACK_IMPORTED_MODULE_1___default =\n /*#__PURE__*/\n __webpack_require__.n(javascript_natural_sort__WEBPACK_IMPORTED_MODULE_1__);\n /* harmony import */\n\n\n var _assets_jsonlint_jsonlint__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17);\n /* harmony import */\n\n\n var _assets_jsonlint_jsonlint__WEBPACK_IMPORTED_MODULE_2___default =\n /*#__PURE__*/\n __webpack_require__.n(_assets_jsonlint_jsonlint__WEBPACK_IMPORTED_MODULE_2__);\n /* harmony import */\n\n\n var json_source_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19);\n /* harmony import */\n\n\n var json_source_map__WEBPACK_IMPORTED_MODULE_3___default =\n /*#__PURE__*/\n __webpack_require__.n(json_source_map__WEBPACK_IMPORTED_MODULE_3__);\n /* harmony import */\n\n\n var _i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1);\n\n function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n var MAX_ITEMS_FIELDS_COLLECTION = 10000;\n var YEAR_2000 = 946684800000;\n /**\n * Parse JSON using the parser built-in in the browser.\n * On exception, the jsonString is validated and a detailed error is thrown.\n * @param {String} jsonString\n * @return {JSON} json\n */\n\n function parse(jsonString) {\n try {\n return JSON.parse(jsonString);\n } catch (err) {\n // try to throw a more detailed error message using validate\n validate(jsonString); // rethrow the original error\n\n throw err;\n }\n }\n /**\n * Repair a JSON-like string containing. For example changes JavaScript\n * notation into JSON notation.\n * This function for example changes a string like \"{a: 2, 'b': {c: 'd'}\"\n * into '{\"a\": 2, \"b\": {\"c\": \"d\"}'\n * @param {string} jsString\n * @returns {string} json\n */\n\n\n function repair(jsString) {\n // TODO: refactor this function, it's too large and complicated now\n // escape all single and double quotes inside strings\n var chars = [];\n var i = 0; // If JSON starts with a function (characters/digits/\"_-\"), remove this function.\n // This is useful for \"stripping\" JSONP objects to become JSON\n // For example: /* some comment */ function_12321321 ( [{\"a\":\"b\"}] ); => [{\"a\":\"b\"}]\n\n var match = jsString.match(/^\\s*(\\/\\*(.|[\\r\\n])*?\\*\\/)?\\s*[\\da-zA-Z_$]+\\s*\\(([\\s\\S]*)\\)\\s*;?\\s*$/);\n\n if (match) {\n jsString = match[3];\n }\n\n var controlChars = {\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t'\n };\n var quote = '\\'';\n var quoteDbl = '\"';\n var quoteLeft = \"\\u2018\";\n var quoteRight = \"\\u2019\";\n var quoteDblLeft = \"\\u201C\";\n var quoteDblRight = \"\\u201D\";\n var graveAccent = \"`\";\n var acuteAccent = \"\\xB4\"; // helper functions to get the current/prev/next character\n\n function curr() {\n return jsString.charAt(i);\n }\n\n function next() {\n return jsString.charAt(i + 1);\n }\n\n function prev() {\n return jsString.charAt(i - 1);\n }\n\n function isWhiteSpace(c) {\n return c === ' ' || c === '\\n' || c === '\\r' || c === '\\t';\n } // get the last parsed non-whitespace character\n\n\n function lastNonWhitespace() {\n var p = chars.length - 1;\n\n while (p >= 0) {\n var pp = chars[p];\n\n if (!isWhiteSpace(pp)) {\n return pp;\n }\n\n p--;\n }\n\n return '';\n } // get at the first next non-white space character\n\n\n function nextNonWhiteSpace() {\n var iNext = i + 1;\n\n while (iNext < jsString.length && isWhiteSpace(jsString[iNext])) {\n iNext++;\n }\n\n return jsString[iNext];\n } // skip a block comment '/* ... */'\n\n\n function skipBlockComment() {\n i += 2;\n\n while (i < jsString.length && (curr() !== '*' || next() !== '/')) {\n i++;\n }\n\n i += 2;\n } // skip a comment '// ...'\n\n\n function skipComment() {\n i += 2;\n\n while (i < jsString.length && curr() !== '\\n') {\n i++;\n }\n }\n /**\n * parse single or double quoted string. Returns the parsed string\n * @param {string} endQuote\n * @return {string}\n */\n\n\n function parseString(endQuote) {\n var string = '';\n string += '\"';\n i++;\n var c = curr();\n\n while (i < jsString.length && c !== endQuote) {\n if (c === '\"' && prev() !== '\\\\') {\n // unescaped double quote, escape it\n string += '\\\\\"';\n } else if (c in controlChars) {\n // replace unescaped control characters with escaped ones\n string += controlChars[c];\n } else if (c === '\\\\') {\n // remove the escape character when followed by a single quote ', not needed\n i++;\n c = curr();\n\n if (c !== '\\'') {\n string += '\\\\';\n }\n\n string += c;\n } else {\n // regular character\n string += c;\n }\n\n i++;\n c = curr();\n }\n\n if (c === endQuote) {\n string += '\"';\n i++;\n }\n\n return string;\n } // parse an unquoted key\n\n\n function parseKey() {\n var specialValues = ['null', 'true', 'false'];\n var key = '';\n var c = curr();\n var regexp = /[a-zA-Z_$\\d]/; // letter, number, underscore, dollar character\n\n while (regexp.test(c)) {\n key += c;\n i++;\n c = curr();\n }\n\n if (specialValues.indexOf(key) === -1) {\n return '\"' + key + '\"';\n } else {\n return key;\n }\n }\n\n function parseMongoDataType() {\n var c = curr();\n var value;\n var dataType = '';\n\n while (/[a-zA-Z_$]/.test(c)) {\n dataType += c;\n i++;\n c = curr();\n }\n\n if (dataType.length > 0 && c === '(') {\n // This is an MongoDB data type like {\"_id\": ObjectId(\"123\")}\n i++;\n c = curr();\n\n if (c === '\"') {\n // a data type containing a string, like ISODate(\"2012-12-19T06:01:17.171Z\")\n value = parseString(c);\n c = curr();\n } else {\n // a data type containing a value, like 'NumberLong(2)'\n value = '';\n\n while (c !== ')' && c !== '') {\n value += c;\n i++;\n c = curr();\n }\n }\n\n if (c === ')') {\n // skip the closing bracket at the end\n i++; // return the value (strip the data type object)\n\n return value;\n } else {\n // huh? that's unexpected. don't touch it\n return dataType + '(' + value + c;\n }\n } else {\n // hm, no Mongo data type after all\n return dataType;\n }\n }\n\n function isSpecialWhiteSpace(c) {\n return c === \"\\xA0\" || c >= \"\\u2000\" && c <= \"\\u200A\" || c === \"\\u202F\" || c === \"\\u205F\" || c === \"\\u3000\";\n }\n\n while (i < jsString.length) {\n var c = curr();\n\n if (c === '/' && next() === '*') {\n skipBlockComment();\n } else if (c === '/' && next() === '/') {\n skipComment();\n } else if (isSpecialWhiteSpace(c)) {\n // special white spaces (like non breaking space)\n chars.push(' ');\n i++;\n } else if (c === quote) {\n chars.push(parseString(c));\n } else if (c === quoteDbl) {\n chars.push(parseString(quoteDbl));\n } else if (c === graveAccent) {\n chars.push(parseString(acuteAccent));\n } else if (c === quoteLeft) {\n chars.push(parseString(quoteRight));\n } else if (c === quoteDblLeft) {\n chars.push(parseString(quoteDblRight));\n } else if (c === ',' && [']', '}'].indexOf(nextNonWhiteSpace()) !== -1) {\n // skip trailing commas\n i++;\n } else if (/[a-zA-Z_$]/.test(c) && ['{', ','].indexOf(lastNonWhitespace()) !== -1) {\n // an unquoted object key (like a in '{a:2}')\n chars.push(parseKey());\n } else {\n if (/[a-zA-Z_$]/.test(c)) {\n chars.push(parseMongoDataType());\n } else {\n chars.push(c);\n i++;\n }\n }\n }\n\n return chars.join('');\n }\n /**\n * Escape unicode characters.\n * For example input '\\u2661' (length 1) will output '\\\\u2661' (length 5).\n * @param {string} text\n * @return {string}\n */\n\n\n function escapeUnicodeChars( // see https://www.wikiwand.com/en/UTF-16\n text) {\n return (// note: we leave surrogate pairs as two individual chars,\n // as JSON doesn't interpret them as a single unicode char.\n text.replace(/[\\u007F-\\uFFFF]/g, function (c) {\n return \"\\\\u\" + ('0000' + c.charCodeAt(0).toString(16)).slice(-4);\n })\n );\n }\n /**\n * Validate a string containing a JSON object\n * This method uses JSONLint to validate the String. If JSONLint is not\n * available, the built-in JSON parser of the browser is used.\n * @param {String} jsonString String with an (invalid) JSON object\n * @throws Error\n */\n\n\n function validate(jsonString) {\n if (typeof _assets_jsonlint_jsonlint__WEBPACK_IMPORTED_MODULE_2___default.a !== 'undefined') {\n _assets_jsonlint_jsonlint__WEBPACK_IMPORTED_MODULE_2___default.a.parse(jsonString);\n } else {\n JSON.parse(jsonString);\n }\n }\n /**\n * Extend object a with the properties of object b\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n */\n\n\n function extend(a, b) {\n for (var prop in b) {\n if (hasOwnProperty(b, prop)) {\n a[prop] = b[prop];\n }\n }\n\n return a;\n }\n /**\n * Remove all properties from object a\n * @param {Object} a\n * @return {Object} a\n */\n\n\n function clear(a) {\n for (var prop in a) {\n if (hasOwnProperty(a, prop)) {\n delete a[prop];\n }\n }\n\n return a;\n }\n /**\n * Get the type of an object\n * @param {*} object\n * @return {String} type\n */\n\n\n function getType(object) {\n if (object === null) {\n return 'null';\n }\n\n if (object === undefined) {\n return 'undefined';\n }\n\n if (object instanceof Number || typeof object === 'number') {\n return 'number';\n }\n\n if (object instanceof String || typeof object === 'string') {\n return 'string';\n }\n\n if (object instanceof Boolean || typeof object === 'boolean') {\n return 'boolean';\n }\n\n if (object instanceof RegExp) {\n return 'regexp';\n }\n\n if (isArray(object)) {\n return 'array';\n }\n\n return 'object';\n }\n /**\n * Test whether a text contains a url (matches when a string starts\n * with 'http://*' or 'https://*' and has no whitespace characters)\n * @param {String} text\n */\n\n\n var isUrlRegex = /^https?:\\/\\/\\S+$/;\n\n function isUrl(text) {\n return (typeof text === 'string' || text instanceof String) && isUrlRegex.test(text);\n }\n /**\n * Tes whether given object is an Array\n * @param {*} obj\n * @returns {boolean} returns true when obj is an array\n */\n\n\n function isArray(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n }\n /**\n * Retrieve the absolute left value of a DOM element\n * @param {Element} elem A dom element, for example a div\n * @return {Number} left The absolute left position of this element\n * in the browser page.\n */\n\n\n function getAbsoluteLeft(elem) {\n var rect = elem.getBoundingClientRect();\n return rect.left + window.pageXOffset || document.scrollLeft || 0;\n }\n /**\n * Retrieve the absolute top value of a DOM element\n * @param {Element} elem A dom element, for example a div\n * @return {Number} top The absolute top position of this element\n * in the browser page.\n */\n\n\n function getAbsoluteTop(elem) {\n var rect = elem.getBoundingClientRect();\n return rect.top + window.pageYOffset || document.scrollTop || 0;\n }\n /**\n * add a className to the given elements style\n * @param {Element} elem\n * @param {String} className\n */\n\n\n function addClassName(elem, className) {\n var classes = elem.className.split(' ');\n\n if (classes.indexOf(className) === -1) {\n classes.push(className); // add the class to the array\n\n elem.className = classes.join(' ');\n }\n }\n /**\n * remove all classes from the given elements style\n * @param {Element} elem\n */\n\n\n function removeAllClassNames(elem) {\n elem.className = '';\n }\n /**\n * add a className to the given elements style\n * @param {Element} elem\n * @param {String} className\n */\n\n\n function removeClassName(elem, className) {\n var classes = elem.className.split(' ');\n var index = classes.indexOf(className);\n\n if (index !== -1) {\n classes.splice(index, 1); // remove the class from the array\n\n elem.className = classes.join(' ');\n }\n }\n /**\n * Strip the formatting from the contents of a div\n * the formatting from the div itself is not stripped, only from its childs.\n * @param {Element} divElement\n */\n\n\n function stripFormatting(divElement) {\n var childs = divElement.childNodes;\n\n for (var i = 0, iMax = childs.length; i < iMax; i++) {\n var child = childs[i]; // remove the style\n\n if (child.style) {\n // TODO: test if child.attributes does contain style\n child.removeAttribute('style');\n } // remove all attributes\n\n\n var attributes = child.attributes;\n\n if (attributes) {\n for (var j = attributes.length - 1; j >= 0; j--) {\n var attribute = attributes[j];\n\n if (attribute.specified === true) {\n child.removeAttribute(attribute.name);\n }\n }\n } // recursively strip childs\n\n\n stripFormatting(child);\n }\n }\n /**\n * Set focus to the end of an editable div\n * code from Nico Burns\n * http://stackoverflow.com/users/140293/nico-burns\n * http://stackoverflow.com/questions/1125292/how-to-move-cursor-to-end-of-contenteditable-entity\n * @param {Element} contentEditableElement A content editable div\n */\n\n\n function setEndOfContentEditable(contentEditableElement) {\n var range, selection;\n\n if (document.createRange) {\n range = document.createRange(); // Create a range (a range is a like the selection but invisible)\n\n range.selectNodeContents(contentEditableElement); // Select the entire contents of the element with the range\n\n range.collapse(false); // collapse the range to the end point. false means collapse to end rather than the start\n\n selection = window.getSelection(); // get the selection object (allows you to change selection)\n\n selection.removeAllRanges(); // remove any selections already made\n\n selection.addRange(range); // make the range you have just created the visible selection\n }\n }\n /**\n * Select all text of a content editable div.\n * http://stackoverflow.com/a/3806004/1262753\n * @param {Element} contentEditableElement A content editable div\n */\n\n\n function selectContentEditable(contentEditableElement) {\n if (!contentEditableElement || contentEditableElement.nodeName !== 'DIV') {\n return;\n }\n\n var sel, range;\n\n if (window.getSelection && document.createRange) {\n range = document.createRange();\n range.selectNodeContents(contentEditableElement);\n sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }\n /**\n * Get text selection\n * http://stackoverflow.com/questions/4687808/contenteditable-selected-text-save-and-restore\n * @return {Range | TextRange | null} range\n */\n\n\n function getSelection() {\n if (window.getSelection) {\n var sel = window.getSelection();\n\n if (sel.getRangeAt && sel.rangeCount) {\n return sel.getRangeAt(0);\n }\n }\n\n return null;\n }\n /**\n * Set text selection\n * http://stackoverflow.com/questions/4687808/contenteditable-selected-text-save-and-restore\n * @param {Range | TextRange | null} range\n */\n\n\n function setSelection(range) {\n if (range) {\n if (window.getSelection) {\n var sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }\n }\n /**\n * Get selected text range\n * @return {Object} params object containing parameters:\n * {Number} startOffset\n * {Number} endOffset\n * {Element} container HTML element holding the\n * selected text element\n * Returns null if no text selection is found\n */\n\n\n function getSelectionOffset() {\n var range = getSelection();\n\n if (range && 'startOffset' in range && 'endOffset' in range && range.startContainer && range.startContainer === range.endContainer) {\n return {\n startOffset: range.startOffset,\n endOffset: range.endOffset,\n container: range.startContainer.parentNode\n };\n }\n\n return null;\n }\n /**\n * Set selected text range in given element\n * @param {Object} params An object containing:\n * {Element} container\n * {Number} startOffset\n * {Number} endOffset\n */\n\n\n function setSelectionOffset(params) {\n if (document.createRange && window.getSelection) {\n var selection = window.getSelection();\n\n if (selection) {\n var range = document.createRange();\n\n if (!params.container.firstChild) {\n params.container.appendChild(document.createTextNode(''));\n } // TODO: do not suppose that the first child of the container is a textnode,\n // but recursively find the textnodes\n\n\n range.setStart(params.container.firstChild, params.startOffset);\n range.setEnd(params.container.firstChild, params.endOffset);\n setSelection(range);\n }\n }\n }\n /**\n * Get the inner text of an HTML element (for example a div element)\n * @param {Element} element\n * @param {Object} [buffer]\n * @return {String} innerText\n */\n\n\n function getInnerText(element, buffer) {\n var first = buffer === undefined;\n\n if (first) {\n buffer = {\n text: '',\n flush: function flush() {\n var text = this.text;\n this.text = '';\n return text;\n },\n set: function set(text) {\n this.text = text;\n }\n };\n } // text node\n\n\n if (element.nodeValue) {\n return buffer.flush() + element.nodeValue;\n } // divs or other HTML elements\n\n\n if (element.hasChildNodes()) {\n var childNodes = element.childNodes;\n var innerText = '';\n\n for (var i = 0, iMax = childNodes.length; i < iMax; i++) {\n var child = childNodes[i];\n\n if (child.nodeName === 'DIV' || child.nodeName === 'P') {\n var prevChild = childNodes[i - 1];\n var prevName = prevChild ? prevChild.nodeName : undefined;\n\n if (prevName && prevName !== 'DIV' && prevName !== 'P' && prevName !== 'BR') {\n innerText += '\\n';\n buffer.flush();\n }\n\n innerText += getInnerText(child, buffer);\n buffer.set('\\n');\n } else if (child.nodeName === 'BR') {\n innerText += buffer.flush();\n buffer.set('\\n');\n } else {\n innerText += getInnerText(child, buffer);\n }\n }\n\n return innerText;\n } else {\n if (element.nodeName === 'P' && getInternetExplorerVersion() !== -1) {\n // On Internet Explorer, a with hasChildNodes()==false is\n // rendered with a new line. Note that a
with\n // hasChildNodes()==true is rendered without a new line\n // Other browsers always ensure there is a inside the
,\n // and if not, the
does not render a new line\n return buffer.flush();\n }\n } // br or unknown\n\n\n return '';\n }\n /**\n * Test whether an element has the provided parent node somewhere up the node tree.\n * @param {Element} elem\n * @param {Element} parent\n * @return {boolean}\n */\n\n\n function hasParentNode(elem, parent) {\n var e = elem ? elem.parentNode : undefined;\n\n while (e) {\n if (e === parent) {\n return true;\n }\n\n e = e.parentNode;\n }\n\n return false;\n }\n /**\n * Returns the version of Internet Explorer or a -1\n * (indicating the use of another browser).\n * Source: http://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx\n * @return {Number} Internet Explorer version, or -1 in case of an other browser\n */\n\n\n function getInternetExplorerVersion() {\n if (_ieVersion === -1) {\n var rv = -1; // Return value assumes failure.\n\n if (typeof navigator !== 'undefined' && navigator.appName === 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent;\n var re = new RegExp('MSIE ([0-9]+[.0-9]+)');\n\n if (re.exec(ua) != null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n _ieVersion = rv;\n }\n\n return _ieVersion;\n }\n /**\n * Test whether the current browser is Firefox\n * @returns {boolean} isFirefox\n */\n\n\n function isFirefox() {\n return typeof navigator !== 'undefined' && navigator.userAgent.indexOf('Firefox') !== -1;\n }\n /**\n * cached internet explorer version\n * @type {Number}\n * @private\n */\n\n\n var _ieVersion = -1;\n /**\n * Add and event listener. Works for all browsers\n * @param {Element} element An html element\n * @param {string} action The action, for example \"click\",\n * without the prefix \"on\"\n * @param {function} listener The callback function to be executed\n * @param {boolean} [useCapture] false by default\n * @return {function} the created event listener\n */\n\n\n function addEventListener(element, action, listener, useCapture) {\n if (element.addEventListener) {\n if (useCapture === undefined) {\n useCapture = false;\n }\n\n if (action === 'mousewheel' && isFirefox()) {\n action = 'DOMMouseScroll'; // For Firefox\n }\n\n element.addEventListener(action, listener, useCapture);\n return listener;\n } else if (element.attachEvent) {\n // Old IE browsers\n var f = function f() {\n return listener.call(element, window.event);\n };\n\n element.attachEvent('on' + action, f);\n return f;\n }\n }\n /**\n * Remove an event listener from an element\n * @param {Element} element An html dom element\n * @param {string} action The name of the event, for example \"mousedown\"\n * @param {function} listener The listener function\n * @param {boolean} [useCapture] false by default\n */\n\n\n function removeEventListener(element, action, listener, useCapture) {\n if (element.removeEventListener) {\n if (useCapture === undefined) {\n useCapture = false;\n }\n\n if (action === 'mousewheel' && isFirefox()) {\n action = 'DOMMouseScroll'; // For Firefox\n }\n\n element.removeEventListener(action, listener, useCapture);\n } else if (element.detachEvent) {\n // Old IE browsers\n element.detachEvent('on' + action, listener);\n }\n }\n /**\n * Test if an element is a child of a parent element.\n * @param {Element} elem\n * @param {Element} parent\n * @return {boolean} returns true if elem is a child of the parent\n */\n\n\n function isChildOf(elem, parent) {\n var e = elem.parentNode;\n\n while (e) {\n if (e === parent) {\n return true;\n }\n\n e = e.parentNode;\n }\n\n return false;\n }\n /**\n * Parse a JSON path like '.items[3].name' into an array\n * @param {string} jsonPath\n * @return {Array}\n */\n\n\n function parsePath(jsonPath) {\n var path = [];\n var i = 0;\n\n function parseProperty() {\n var prop = '';\n\n while (jsonPath[i] !== undefined && /[\\w$]/.test(jsonPath[i])) {\n prop += jsonPath[i];\n i++;\n }\n\n if (prop === '') {\n throw new Error('Invalid JSON path: property name expected at index ' + i);\n }\n\n return prop;\n }\n\n function parseIndex(end) {\n var name = '';\n\n while (jsonPath[i] !== undefined && jsonPath[i] !== end) {\n name += jsonPath[i];\n i++;\n }\n\n if (jsonPath[i] !== end) {\n throw new Error('Invalid JSON path: unexpected end, character ' + end + ' expected');\n }\n\n return name;\n }\n\n while (jsonPath[i] !== undefined) {\n if (jsonPath[i] === '.') {\n i++;\n path.push(parseProperty());\n } else if (jsonPath[i] === '[') {\n i++;\n\n if (jsonPath[i] === '\\'' || jsonPath[i] === '\"') {\n var end = jsonPath[i];\n i++;\n path.push(parseIndex(end));\n\n if (jsonPath[i] !== end) {\n throw new Error('Invalid JSON path: closing quote \\' expected at index ' + i);\n }\n\n i++;\n } else {\n var index = parseIndex(']').trim();\n\n if (index.length === 0) {\n throw new Error('Invalid JSON path: array value expected at index ' + i);\n } // Coerce numeric indices to numbers, but ignore star\n\n\n index = index === '*' ? index : JSON.parse(index);\n path.push(index);\n }\n\n if (jsonPath[i] !== ']') {\n throw new Error('Invalid JSON path: closing bracket ] expected at index ' + i);\n }\n\n i++;\n } else {\n throw new Error('Invalid JSON path: unexpected character \"' + jsonPath[i] + '\" at index ' + i);\n }\n }\n\n return path;\n }\n /**\n * Stringify an array with a path in a JSON path like '.items[3].name'\n * @param {Array.} path\n * @returns {string}\n */\n\n\n function stringifyPath(path) {\n return path.map(function (p) {\n if (typeof p === 'number') {\n return '[' + p + ']';\n } else if (typeof p === 'string' && p.match(/^[A-Za-z0-9_$]+$/)) {\n return '.' + p;\n } else {\n return '[\"' + p + '\"]';\n }\n }).join('');\n }\n /**\n * Improve the error message of a JSON schema error\n * @param {Object} error\n * @return {Object} The error\n */\n\n\n function improveSchemaError(error) {\n if (error.keyword === 'enum' && Array.isArray(error.schema)) {\n var enums = error.schema;\n\n if (enums) {\n enums = enums.map(function (value) {\n return JSON.stringify(value);\n });\n\n if (enums.length > 5) {\n var more = ['(' + (enums.length - 5) + ' more...)'];\n enums = enums.slice(0, 5);\n enums.push(more);\n }\n\n error.message = 'should be equal to one of: ' + enums.join(', ');\n }\n }\n\n if (error.keyword === 'additionalProperties') {\n error.message = 'should NOT have additional property: ' + error.params.additionalProperty;\n }\n\n return error;\n }\n /**\n * Test whether something is a Promise\n * @param {*} object\n * @returns {boolean} Returns true when object is a promise, false otherwise\n */\n\n\n function isPromise(object) {\n return object && typeof object.then === 'function' && typeof object[\"catch\"] === 'function';\n }\n /**\n * Test whether a custom validation error has the correct structure\n * @param {*} validationError The error to be checked.\n * @returns {boolean} Returns true if the structure is ok, false otherwise\n */\n\n\n function isValidValidationError(validationError) {\n return _typeof(validationError) === 'object' && Array.isArray(validationError.path) && typeof validationError.message === 'string';\n }\n /**\n * Test whether the child rect fits completely inside the parent rect.\n * @param {ClientRect} parent\n * @param {ClientRect} child\n * @param {number} margin\n */\n\n\n function insideRect(parent, child, margin) {\n var _margin = margin !== undefined ? margin : 0;\n\n return child.left - _margin >= parent.left && child.right + _margin <= parent.right && child.top - _margin >= parent.top && child.bottom + _margin <= parent.bottom;\n }\n /**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds.\n *\n * Source: https://davidwalsh.name/javascript-debounce-function\n *\n * @param {function} func\n * @param {number} wait Number in milliseconds\n * @param {boolean} [immediate=false] If `immediate` is passed, trigger the\n * function on the leading edge, instead\n * of the trailing.\n * @return {function} Return the debounced function\n */\n\n\n function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this;\n var args = arguments;\n\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }\n /**\n * Determines the difference between two texts.\n * Can only detect one removed or inserted block of characters.\n * @param {string} oldText\n * @param {string} newText\n * @return {{start: number, end: number}} Returns the start and end\n * of the changed part in newText.\n */\n\n\n function textDiff(oldText, newText) {\n var len = newText.length;\n var start = 0;\n var oldEnd = oldText.length;\n var newEnd = newText.length;\n\n while (newText.charAt(start) === oldText.charAt(start) && start < len) {\n start++;\n }\n\n while (newText.charAt(newEnd - 1) === oldText.charAt(oldEnd - 1) && newEnd > start && oldEnd > 0) {\n newEnd--;\n oldEnd--;\n }\n\n return {\n start: start,\n end: newEnd\n };\n }\n /**\n * Return an object with the selection range or cursor position (if both have the same value)\n * Support also old browsers (IE8-)\n * Source: http://ourcodeworld.com/articles/read/282/how-to-get-the-current-cursor-position-and-selection-within-a-text-input-or-textarea-in-javascript\n * @param {DOMElement} el A dom element of a textarea or input text.\n * @return {Object} reference Object with 2 properties (start and end) with the identifier of the location of the cursor and selected text.\n **/\n\n\n function getInputSelection(el) {\n var startIndex = 0;\n var endIndex = 0;\n var normalizedValue;\n var range;\n var textInputRange;\n var len;\n var endRange;\n\n if (typeof el.selectionStart === 'number' && typeof el.selectionEnd === 'number') {\n startIndex = el.selectionStart;\n endIndex = el.selectionEnd;\n } else {\n range = document.selection.createRange();\n\n if (range && range.parentElement() === el) {\n len = el.value.length;\n normalizedValue = el.value.replace(/\\r\\n/g, '\\n'); // Create a working TextRange that lives only in the input\n\n textInputRange = el.createTextRange();\n textInputRange.moveToBookmark(range.getBookmark()); // Check if the startIndex and endIndex of the selection are at the very end\n // of the input, since moveStart/moveEnd doesn't return what we want\n // in those cases\n\n endRange = el.createTextRange();\n endRange.collapse(false);\n\n if (textInputRange.compareEndPoints('StartToEnd', endRange) > -1) {\n startIndex = endIndex = len;\n } else {\n startIndex = -textInputRange.moveStart('character', -len);\n startIndex += normalizedValue.slice(0, startIndex).split('\\n').length - 1;\n\n if (textInputRange.compareEndPoints('EndToEnd', endRange) > -1) {\n endIndex = len;\n } else {\n endIndex = -textInputRange.moveEnd('character', -len);\n endIndex += normalizedValue.slice(0, endIndex).split('\\n').length - 1;\n }\n }\n }\n }\n\n return {\n startIndex: startIndex,\n endIndex: endIndex,\n start: _positionForIndex(startIndex),\n end: _positionForIndex(endIndex)\n };\n /**\n * Returns textarea row and column position for certain index\n * @param {Number} index text index\n * @returns {{row: Number, column: Number}}\n */\n\n function _positionForIndex(index) {\n var textTillIndex = el.value.substring(0, index);\n var row = (textTillIndex.match(/\\n/g) || []).length + 1;\n var col = textTillIndex.length - textTillIndex.lastIndexOf('\\n');\n return {\n row: row,\n column: col\n };\n }\n }\n /**\n * Returns the index for certaion position in text element\n * @param {DOMElement} el A dom element of a textarea or input text.\n * @param {Number} row row value, > 0, if exceeds rows number - last row will be returned\n * @param {Number} column column value, > 0, if exceeds column length - end of column will be returned\n * @returns {Number} index of position in text, -1 if not found\n */\n\n\n function getIndexForPosition(el, row, column) {\n var text = el.value || '';\n\n if (row > 0 && column > 0) {\n var rows = text.split('\\n', row);\n row = Math.min(rows.length, row);\n column = Math.min(rows[row - 1].length, column - 1);\n var columnCount = row === 1 ? column : column + 1; // count new line on multiple rows\n\n return rows.slice(0, row - 1).join('\\n').length + columnCount;\n }\n\n return -1;\n }\n /**\n * Returns location of json paths in certain json string\n * @param {String} text json string\n * @param {Array} paths array of json paths\n * @returns {Array<{path: String, line: Number, row: Number}>}\n */\n\n\n function getPositionForPath(text, paths) {\n var result = [];\n var jsmap;\n\n if (!paths || !paths.length) {\n return result;\n }\n\n try {\n jsmap = json_source_map__WEBPACK_IMPORTED_MODULE_3___default.a.parse(text);\n } catch (err) {\n return result;\n }\n\n paths.forEach(function (path) {\n var pathArr = parsePath(path);\n var pointerName = compileJSONPointer(pathArr);\n var pointer = jsmap.pointers[pointerName];\n\n if (pointer) {\n result.push({\n path: path,\n line: pointer.key ? pointer.key.line : pointer.value ? pointer.value.line : 0,\n column: pointer.key ? pointer.key.column : pointer.value ? pointer.value.column : 0\n });\n }\n });\n return result;\n }\n /**\n * Compile a JSON Pointer\n * WARNING: this is an incomplete implementation\n * @param {Array.} path\n * @return {string}\n */\n\n\n function compileJSONPointer(path) {\n return path.map(function (p) {\n return '/' + String(p).replace(/~/g, '~0').replace(/\\//g, '~1');\n }).join('');\n }\n /**\n * Get the applied color given a color name or code\n * Source: https://stackoverflow.com/questions/6386090/validating-css-color-names/33184805\n * @param {string} color\n * @returns {string | null} returns the color if the input is a valid\n * color, and returns null otherwise. Example output:\n * 'rgba(255,0,0,0.7)' or 'rgb(255,0,0)'\n */\n\n\n function getColorCSS(color) {\n var ele = document.createElement('div');\n ele.style.color = color;\n return ele.style.color.split(/\\s+/).join('').toLowerCase() || null;\n }\n /**\n * Test if a string contains a valid color name or code.\n * @param {string} color\n * @returns {boolean} returns true if a valid color, false otherwise\n */\n\n\n function isValidColor(color) {\n return !!getColorCSS(color);\n }\n /**\n * Make a tooltip for a field based on the field's schema.\n * @param {object} schema JSON schema\n * @param {string} [locale] Locale code (for example, zh-CN)\n * @returns {string} Field tooltip, may be empty string if all relevant schema properties are missing\n */\n\n\n function makeFieldTooltip(schema, locale) {\n if (!schema) {\n return '';\n }\n\n var tooltip = '';\n\n if (schema.title) {\n tooltip += schema.title;\n }\n\n if (schema.description) {\n if (tooltip.length > 0) {\n tooltip += '\\n';\n }\n\n tooltip += schema.description;\n }\n\n if (schema[\"default\"]) {\n if (tooltip.length > 0) {\n tooltip += '\\n\\n';\n }\n\n tooltip += Object(_i18n__WEBPACK_IMPORTED_MODULE_4__[\n /* translate */\n \"c\"])('default', undefined, locale) + '\\n';\n tooltip += JSON.stringify(schema[\"default\"], null, 2);\n }\n\n if (Array.isArray(schema.examples) && schema.examples.length > 0) {\n if (tooltip.length > 0) {\n tooltip += '\\n\\n';\n }\n\n tooltip += Object(_i18n__WEBPACK_IMPORTED_MODULE_4__[\n /* translate */\n \"c\"])('examples', undefined, locale) + '\\n';\n schema.examples.forEach(function (example, index) {\n tooltip += JSON.stringify(example, null, 2);\n\n if (index !== schema.examples.length - 1) {\n tooltip += '\\n';\n }\n });\n }\n\n return tooltip;\n }\n /**\n * Get a nested property from an object.\n * Returns undefined when the property does not exist.\n * @param {Object} object\n * @param {string[]} path\n * @return {*}\n */\n\n\n function get(object, path) {\n var value = object;\n\n for (var i = 0; i < path.length && value !== undefined && value !== null; i++) {\n value = value[path[i]];\n }\n\n return value;\n }\n /**\n * Find a unique name. Suffix the name with ' (copy)', '(copy 2)', etc\n * until a unique name is found\n * @param {string} name\n * @param {Array} existingPropNames Array with existing prop names\n */\n\n\n function findUniqueName(name, existingPropNames) {\n var strippedName = name.replace(/ \\(copy( \\d+)?\\)$/, '');\n var validName = strippedName;\n var i = 1;\n\n while (existingPropNames.indexOf(validName) !== -1) {\n var copy = 'copy' + (i > 1 ? ' ' + i : '');\n validName = strippedName + ' (' + copy + ')';\n i++;\n }\n\n return validName;\n }\n /**\n * Get the child paths of an array\n * @param {JSON} json\n * @param {boolean} [includeObjects=false] If true, object and array paths are returned as well\n * @return {string[]}\n */\n\n\n function getChildPaths(json, includeObjects) {\n var pathsMap = {};\n\n function getObjectChildPaths(json, pathsMap, rootPath, includeObjects) {\n var isValue = !Array.isArray(json) && !isObject(json);\n\n if (isValue || includeObjects) {\n pathsMap[rootPath || ''] = true;\n }\n\n if (isObject(json)) {\n Object.keys(json).forEach(function (field) {\n getObjectChildPaths(json[field], pathsMap, rootPath + '.' + field, includeObjects);\n });\n }\n }\n\n if (Array.isArray(json)) {\n var max = Math.min(json.length, MAX_ITEMS_FIELDS_COLLECTION);\n\n for (var i = 0; i < max; i++) {\n var item = json[i];\n getObjectChildPaths(item, pathsMap, '', includeObjects);\n }\n } else {\n pathsMap[''] = true;\n }\n\n return Object.keys(pathsMap).sort();\n }\n /**\n * Sort object keys using natural sort\n * @param {Array} array\n * @param {String} [path] JSON pointer\n * @param {'asc' | 'desc'} [direction]\n */\n\n\n function sort(array, path, direction) {\n var parsedPath = path && path !== '.' ? parsePath(path) : [];\n var sign = direction === 'desc' ? -1 : 1;\n var sortedArray = array.slice();\n sortedArray.sort(function (a, b) {\n var aValue = get(a, parsedPath);\n var bValue = get(b, parsedPath);\n return sign * (aValue > bValue ? 1 : aValue < bValue ? -1 : 0);\n });\n return sortedArray;\n }\n /**\n * Sort object keys using natural sort\n * @param {Object} object\n * @param {'asc' | 'desc'} [direction]\n */\n\n\n function sortObjectKeys(object, direction) {\n var sign = direction === 'desc' ? -1 : 1;\n var sortedFields = Object.keys(object).sort(function (a, b) {\n return sign * javascript_natural_sort__WEBPACK_IMPORTED_MODULE_1___default()(a, b);\n });\n var sortedObject = {};\n sortedFields.forEach(function (field) {\n sortedObject[field] = object[field];\n });\n return sortedObject;\n }\n /**\n * Cast contents of a string to the correct type.\n * This can be a string, a number, a boolean, etc\n * @param {String} str\n * @return {*} castedStr\n * @private\n */\n\n\n function parseString(str) {\n if (str === '') {\n return '';\n }\n\n var lower = str.toLowerCase();\n\n if (lower === 'null') {\n return null;\n }\n\n if (lower === 'true') {\n return true;\n }\n\n if (lower === 'false') {\n return false;\n }\n\n var num = Number(str); // will nicely fail with '123ab'\n\n var numFloat = parseFloat(str); // will nicely fail with ' '\n\n if (!isNaN(num) && !isNaN(numFloat)) {\n return num;\n }\n\n return str;\n }\n /**\n * Test whether some field contains a timestamp in milliseconds after the year 2000.\n * @param {string} field\n * @param {number} value\n * @return {boolean}\n */\n\n\n function isTimestamp(field, value) {\n return typeof value === 'number' && value > YEAR_2000 && isFinite(value) && Math.floor(value) === value && !isNaN(new Date(value).valueOf());\n }\n /**\n * Return a human readable document size\n * For example formatSize(7570718) outputs '7.6 MB'\n * @param {number} size\n * @return {string} Returns a human readable size\n */\n\n\n function formatSize(size) {\n if (size < 900) {\n return size.toFixed() + ' B';\n }\n\n var KB = size / 1000;\n\n if (KB < 900) {\n return KB.toFixed(1) + ' KB';\n }\n\n var MB = KB / 1000;\n\n if (MB < 900) {\n return MB.toFixed(1) + ' MB';\n }\n\n var GB = MB / 1000;\n\n if (GB < 900) {\n return GB.toFixed(1) + ' GB';\n }\n\n var TB = GB / 1000;\n return TB.toFixed(1) + ' TB';\n }\n /**\n * Limit text to a maximum number of characters\n * @param {string} text\n * @param {number} maxCharacterCount\n * @return {string} Returns the limited text,\n * ending with '...' if the max was exceeded\n */\n\n\n function limitCharacters(text, maxCharacterCount) {\n if (text.length <= maxCharacterCount) {\n return text;\n }\n\n return text.slice(0, maxCharacterCount) + '...';\n }\n /**\n * Test whether a value is an Object\n * @param {*} value\n * @return {boolean}\n */\n\n\n function isObject(value) {\n return _typeof(value) === 'object' && value !== null && !Array.isArray(value);\n }\n /**\n * Helper function to test whether an array contains an item\n * @param {Array} array\n * @param {*} item\n * @return {boolean} Returns true if `item` is in `array`, returns false otherwise.\n */\n\n\n function contains(array, item) {\n return array.indexOf(item) !== -1;\n }\n /**\n * Checkes if validation has changed from the previous execution\n * @param {Array} currErr current validation errors\n * @param {Array} prevErr previous validation errors\n */\n\n\n function isValidationErrorChanged(currErr, prevErr) {\n if (!prevErr && !currErr) {\n return false;\n }\n\n if (prevErr && !currErr || !prevErr && currErr) {\n return true;\n }\n\n if (prevErr.length !== currErr.length) {\n return true;\n }\n\n var _loop = function _loop(i) {\n var pErr = void 0;\n\n if (currErr[i].type === 'error') {\n pErr = prevErr.find(function (p) {\n return p.line === currErr[i].line;\n });\n } else {\n pErr = prevErr.find(function (p) {\n return p.dataPath === currErr[i].dataPath && p.schemaPath === currErr[i].schemaPath;\n });\n }\n\n if (!pErr) {\n return {\n v: true\n };\n }\n };\n\n for (var i = 0; i < currErr.length; ++i) {\n var _ret = _loop(i);\n\n if (_typeof(_ret) === \"object\") return _ret.v;\n }\n\n return false;\n }\n\n function hasOwnProperty(object, key) {\n return Object.prototype.hasOwnProperty.call(object, key);\n }\n /***/\n\n },\n /* 1 */\n\n /***/\n function (module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n /* harmony export (binding) */\n\n __webpack_require__.d(__webpack_exports__, \"a\", function () {\n return setLanguage;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"b\", function () {\n return setLanguages;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"c\", function () {\n return translate;\n });\n /* harmony import */\n\n\n var _polyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);\n /* harmony import */\n\n\n var _polyfills__WEBPACK_IMPORTED_MODULE_0___default =\n /*#__PURE__*/\n __webpack_require__.n(_polyfills__WEBPACK_IMPORTED_MODULE_0__);\n /* eslint-disable no-template-curly-in-string */\n\n\n var _locales = ['en', 'pt-BR', 'zh-CN', 'tr', 'ja', 'fr-FR'];\n var _defs = {\n en: {\n array: 'Array',\n auto: 'Auto',\n appendText: 'Append',\n appendTitle: 'Append a new field with type \\'auto\\' after this field (Ctrl+Shift+Ins)',\n appendSubmenuTitle: 'Select the type of the field to be appended',\n appendTitleAuto: 'Append a new field with type \\'auto\\' (Ctrl+Shift+Ins)',\n ascending: 'Ascending',\n ascendingTitle: 'Sort the childs of this ${type} in ascending order',\n actionsMenu: 'Click to open the actions menu (Ctrl+M)',\n cannotParseFieldError: 'Cannot parse field into JSON',\n cannotParseValueError: 'Cannot parse value into JSON',\n collapseAll: 'Collapse all fields',\n compactTitle: 'Compact JSON data, remove all whitespaces (Ctrl+Shift+\\\\)',\n descending: 'Descending',\n descendingTitle: 'Sort the childs of this ${type} in descending order',\n drag: 'Drag to move this field (Alt+Shift+Arrows)',\n duplicateKey: 'duplicate key',\n duplicateText: 'Duplicate',\n duplicateTitle: 'Duplicate selected fields (Ctrl+D)',\n duplicateField: 'Duplicate this field (Ctrl+D)',\n duplicateFieldError: 'Duplicate field name',\n empty: 'empty',\n expandAll: 'Expand all fields',\n expandTitle: 'Click to expand/collapse this field (Ctrl+E). \\n' + 'Ctrl+Click to expand/collapse including all childs.',\n formatTitle: 'Format JSON data, with proper indentation and line feeds (Ctrl+\\\\)',\n insert: 'Insert',\n insertTitle: 'Insert a new field with type \\'auto\\' before this field (Ctrl+Ins)',\n insertSub: 'Select the type of the field to be inserted',\n object: 'Object',\n ok: 'Ok',\n redo: 'Redo (Ctrl+Shift+Z)',\n removeText: 'Remove',\n removeTitle: 'Remove selected fields (Ctrl+Del)',\n removeField: 'Remove this field (Ctrl+Del)',\n repairTitle: 'Repair JSON: fix quotes and escape characters, remove comments and JSONP notation, turn JavaScript objects into JSON.',\n searchTitle: 'Search fields and values',\n searchNextResultTitle: 'Next result (Enter)',\n searchPreviousResultTitle: 'Previous result (Shift + Enter)',\n selectNode: 'Select a node...',\n showAll: 'show all',\n showMore: 'show more',\n showMoreStatus: 'displaying ${visibleChilds} of ${totalChilds} items.',\n sort: 'Sort',\n sortTitle: 'Sort the childs of this ${type}',\n sortTitleShort: 'Sort contents',\n sortFieldLabel: 'Field:',\n sortDirectionLabel: 'Direction:',\n sortFieldTitle: 'Select the nested field by which to sort the array or object',\n sortAscending: 'Ascending',\n sortAscendingTitle: 'Sort the selected field in ascending order',\n sortDescending: 'Descending',\n sortDescendingTitle: 'Sort the selected field in descending order',\n string: 'String',\n transform: 'Transform',\n transformTitle: 'Filter, sort, or transform the childs of this ${type}',\n transformTitleShort: 'Filter, sort, or transform contents',\n extract: 'Extract',\n extractTitle: 'Extract this ${type}',\n transformQueryTitle: 'Enter a JMESPath query',\n transformWizardLabel: 'Wizard',\n transformWizardFilter: 'Filter',\n transformWizardSortBy: 'Sort by',\n transformWizardSelectFields: 'Select fields',\n transformQueryLabel: 'Query',\n transformPreviewLabel: 'Preview',\n type: 'Type',\n typeTitle: 'Change the type of this field',\n openUrl: 'Ctrl+Click or Ctrl+Enter to open url in new window',\n undo: 'Undo last action (Ctrl+Z)',\n validationCannotMove: 'Cannot move a field into a child of itself',\n autoType: 'Field type \"auto\". ' + 'The field type is automatically determined from the value ' + 'and can be a string, number, boolean, or null.',\n objectType: 'Field type \"object\". ' + 'An object contains an unordered set of key/value pairs.',\n arrayType: 'Field type \"array\". ' + 'An array contains an ordered collection of values.',\n stringType: 'Field type \"string\". ' + 'Field type is not determined from the value, ' + 'but always returned as string.',\n modeEditorTitle: 'Switch Editor Mode',\n modeCodeText: 'Code',\n modeCodeTitle: 'Switch to code highlighter',\n modeFormText: 'Form',\n modeFormTitle: 'Switch to form editor',\n modeTextText: 'Text',\n modeTextTitle: 'Switch to plain text editor',\n modeTreeText: 'Tree',\n modeTreeTitle: 'Switch to tree editor',\n modeViewText: 'View',\n modeViewTitle: 'Switch to tree view',\n modePreviewText: 'Preview',\n modePreviewTitle: 'Switch to preview mode',\n examples: 'Examples',\n \"default\": 'Default'\n },\n 'zh-CN': {\n array: '数组',\n auto: '自动',\n appendText: '追加',\n appendTitle: '在此字段后追加一个类型为“auto”的新字段 (Ctrl+Shift+Ins)',\n appendSubmenuTitle: '选择要追加的字段类型',\n appendTitleAuto: '追加类型为“auto”的新字段 (Ctrl+Shift+Ins)',\n ascending: '升序',\n ascendingTitle: '升序排列${type}的子节点',\n actionsMenu: '点击打开动作菜单(Ctrl+M)',\n cannotParseFieldError: '无法将字段解析为JSON',\n cannotParseValueError: '无法将值解析为JSON',\n collapseAll: '缩进所有字段',\n compactTitle: '压缩JSON数据,删除所有空格 (Ctrl+Shift+\\\\)',\n descending: '降序',\n descendingTitle: '降序排列${type}的子节点',\n drag: '拖拽移动该节点(Alt+Shift+Arrows)',\n duplicateKey: '重复键',\n duplicateText: '复制',\n duplicateTitle: '复制选中字段(Ctrl+D)',\n duplicateField: '复制该字段(Ctrl+D)',\n duplicateFieldError: '重复的字段名称',\n empty: '清空',\n expandAll: '展开所有字段',\n expandTitle: '点击 展开/收缩 该字段(Ctrl+E). \\n' + 'Ctrl+Click 展开/收缩 包含所有子节点.',\n formatTitle: '使用适当的缩进和换行符格式化JSON数据 (Ctrl+\\\\)',\n insert: '插入',\n insertTitle: '在此字段前插入类型为“auto”的新字段 (Ctrl+Ins)',\n insertSub: '选择要插入的字段类型',\n object: '对象',\n ok: 'Ok',\n redo: '重做 (Ctrl+Shift+Z)',\n removeText: '移除',\n removeTitle: '移除选中字段 (Ctrl+Del)',\n removeField: '移除该字段 (Ctrl+Del)',\n repairTitle: '修复JSON:修复引号和转义符,删除注释和JSONP表示法,将JavaScript对象转换为JSON。',\n selectNode: '选择一个节点...',\n showAll: '展示全部',\n showMore: '展示更多',\n showMoreStatus: '显示${totalChilds}的${visibleChilds}项目.',\n sort: '排序',\n sortTitle: '排序${type}的子节点',\n sortTitleShort: '内容排序',\n sortFieldLabel: '字段:',\n sortDirectionLabel: '方向:',\n sortFieldTitle: '选择用于对数组或对象排序的嵌套字段',\n sortAscending: '升序排序',\n sortAscendingTitle: '按照该字段升序排序',\n sortDescending: '降序排序',\n sortDescendingTitle: '按照该字段降序排序',\n string: '字符串',\n transform: '变换',\n transformTitle: '筛选,排序,或者转换${type}的子节点',\n transformTitleShort: '筛选,排序,或者转换内容',\n extract: '提取',\n extractTitle: '提取这个 ${type}',\n transformQueryTitle: '输入JMESPath查询',\n transformWizardLabel: '向导',\n transformWizardFilter: '筛选',\n transformWizardSortBy: '排序',\n transformWizardSelectFields: '选择字段',\n transformQueryLabel: '查询',\n transformPreviewLabel: '预览',\n type: '类型',\n typeTitle: '更改字段类型',\n openUrl: 'Ctrl+Click 或者 Ctrl+Enter 在新窗口打开链接',\n undo: '撤销上次动作 (Ctrl+Z)',\n validationCannotMove: '无法将字段移入其子节点',\n autoType: '字段类型 \"auto\". ' + '字段类型由值自动确定 ' + '可以为 string,number,boolean,或者 null.',\n objectType: '字段类型 \"object\". ' + '对象包含一组无序的键/值对.',\n arrayType: '字段类型 \"array\". ' + '数组包含值的有序集合.',\n stringType: '字段类型 \"string\". ' + '字段类型由值自动确定,' + '但始终作为字符串返回.',\n modeCodeText: '代码',\n modeCodeTitle: '切换至代码高亮',\n modeFormText: '表单',\n modeFormTitle: '切换至表单编辑',\n modeTextText: '文本',\n modeTextTitle: '切换至文本编辑',\n modeTreeText: '树',\n modeTreeTitle: '切换至树编辑',\n modeViewText: '视图',\n modeViewTitle: '切换至树视图',\n modePreviewText: '预览',\n modePreviewTitle: '切换至预览模式',\n examples: '例子',\n \"default\": '缺省'\n },\n 'pt-BR': {\n array: 'Lista',\n auto: 'Automatico',\n appendText: 'Adicionar',\n appendTitle: 'Adicionar novo campo com tipo \\'auto\\' depois deste campo (Ctrl+Shift+Ins)',\n appendSubmenuTitle: 'Selecione o tipo do campo a ser adicionado',\n appendTitleAuto: 'Adicionar novo campo com tipo \\'auto\\' (Ctrl+Shift+Ins)',\n ascending: 'Ascendente',\n ascendingTitle: 'Organizar filhor do tipo ${type} em crescente',\n actionsMenu: 'Clique para abrir o menu de ações (Ctrl+M)',\n cannotParseFieldError: 'Não é possível analisar o campo no JSON',\n cannotParseValueError: 'Não é possível analisar o valor em JSON',\n collapseAll: 'Fechar todos campos',\n compactTitle: 'Dados JSON compactos, remova todos os espaços em branco (Ctrl+Shift+\\\\)',\n descending: 'Descendente',\n descendingTitle: 'Organizar o filhos do tipo ${type} em decrescente',\n duplicateKey: 'chave duplicada',\n drag: 'Arraste para mover este campo (Alt+Shift+Arrows)',\n duplicateText: 'Duplicar',\n duplicateTitle: 'Duplicar campos selecionados (Ctrl+D)',\n duplicateField: 'Duplicar este campo (Ctrl+D)',\n duplicateFieldError: 'Nome do campo duplicado',\n empty: 'vazio',\n expandAll: 'Expandir todos campos',\n expandTitle: 'Clique para expandir/encolher este campo (Ctrl+E). \\n' + 'Ctrl+Click para expandir/encolher incluindo todos os filhos.',\n formatTitle: 'Formate dados JSON, com recuo e feeds de linha adequados (Ctrl+\\\\)',\n insert: 'Inserir',\n insertTitle: 'Inserir um novo campo do tipo \\'auto\\' antes deste campo (Ctrl+Ins)',\n insertSub: 'Selecionar o tipo de campo a ser inserido',\n object: 'Objeto',\n ok: 'Ok',\n redo: 'Refazer (Ctrl+Shift+Z)',\n removeText: 'Remover',\n removeTitle: 'Remover campos selecionados (Ctrl+Del)',\n removeField: 'Remover este campo (Ctrl+Del)',\n repairTitle: 'Repare JSON: corrija aspas e caracteres de escape, remova comentários e notação JSONP, transforme objetos JavaScript em JSON.',\n selectNode: 'Selecione um nódulo...',\n showAll: 'mostrar todos',\n showMore: 'mostrar mais',\n showMoreStatus: 'exibindo ${visibleChilds} de ${totalChilds} itens.',\n sort: 'Organizar',\n sortTitle: 'Organizar os filhos deste ${type}',\n sortTitleShort: 'Organizar os filhos',\n sortFieldLabel: 'Campo:',\n sortDirectionLabel: 'Direção:',\n sortFieldTitle: 'Selecione um campo filho pelo qual ordenar o array ou objeto',\n sortAscending: 'Ascendente',\n sortAscendingTitle: 'Ordenar o campo selecionado por ordem ascendente',\n sortDescending: 'Descendente',\n sortDescendingTitle: 'Ordenar o campo selecionado por ordem descendente',\n string: 'Texto',\n transform: 'Transformar',\n transformTitle: 'Filtrar, ordenar ou transformar os filhos deste ${type}',\n transformTitleShort: 'Filtrar, ordenar ou transformar conteúdos',\n transformQueryTitle: 'Insira uma expressão JMESPath',\n transformWizardLabel: 'Assistente',\n transformWizardFilter: 'Filtro',\n transformWizardSortBy: 'Ordenar por',\n transformWizardSelectFields: 'Selecionar campos',\n transformQueryLabel: 'Expressão',\n transformPreviewLabel: 'Visualizar',\n type: 'Tipo',\n typeTitle: 'Mudar o tipo deste campo',\n openUrl: 'Ctrl+Click ou Ctrl+Enter para abrir link em nova janela',\n undo: 'Desfazer último ação (Ctrl+Z)',\n validationCannotMove: 'Não pode mover um campo como filho dele mesmo',\n autoType: 'Campo do tipo \"auto\". ' + 'O tipo do campo é determinao automaticamente a partir do seu valor ' + 'e pode ser texto, número, verdade/falso ou nulo.',\n objectType: 'Campo do tipo \"objeto\". ' + 'Um objeto contém uma lista de pares com chave e valor.',\n arrayType: 'Campo do tipo \"lista\". ' + 'Uma lista contem uma coleção de valores ordenados.',\n stringType: 'Campo do tipo \"string\". ' + 'Campo do tipo nao é determinado através do seu valor, ' + 'mas sempre retornara um texto.',\n examples: 'Exemplos',\n \"default\": 'Revelia'\n },\n tr: {\n array: 'Dizin',\n auto: 'Otomatik',\n appendText: 'Ekle',\n appendTitle: 'Bu alanın altına \\'otomatik\\' tipinde yeni bir alan ekle (Ctrl+Shift+Ins)',\n appendSubmenuTitle: 'Eklenecek alanın tipini seç',\n appendTitleAuto: '\\'Otomatik\\' tipinde yeni bir alan ekle (Ctrl+Shift+Ins)',\n ascending: 'Artan',\n ascendingTitle: '${type}\\'ın alt tiplerini artan düzende sırala',\n actionsMenu: 'Aksiyon menüsünü açmak için tıklayın (Ctrl+M)',\n collapseAll: 'Tüm alanları kapat',\n descending: 'Azalan',\n descendingTitle: '${type}\\'ın alt tiplerini azalan düzende sırala',\n drag: 'Bu alanı taşımak için sürükleyin (Alt+Shift+Arrows)',\n duplicateKey: 'Var olan anahtar',\n duplicateText: 'Aşağıya kopyala',\n duplicateTitle: 'Seçili alanlardan bir daha oluştur (Ctrl+D)',\n duplicateField: 'Bu alandan bir daha oluştur (Ctrl+D)',\n duplicateFieldError: 'Duplicate field name',\n cannotParseFieldError: 'Alan JSON\\'a ayrıştırılamıyor',\n cannotParseValueError: 'JSON\\'a değer ayrıştırılamıyor',\n empty: 'boş',\n expandAll: 'Tüm alanları aç',\n expandTitle: 'Bu alanı açmak/kapatmak için tıkla (Ctrl+E). \\n' + 'Alt alanlarda dahil tüm alanları açmak için Ctrl+Click ',\n insert: 'Ekle',\n insertTitle: 'Bu alanın üstüne \\'otomatik\\' tipinde yeni bir alan ekle (Ctrl+Ins)',\n insertSub: 'Araya eklenecek alanın tipini seç',\n object: 'Nesne',\n ok: 'Tamam',\n redo: 'Yeniden yap (Ctrl+Shift+Z)',\n removeText: 'Kaldır',\n removeTitle: 'Seçilen alanları kaldır (Ctrl+Del)',\n removeField: 'Bu alanı kaldır (Ctrl+Del)',\n selectNode: 'Bir nesne seç...',\n showAll: 'tümünü göster',\n showMore: 'daha fazla göster',\n showMoreStatus: '${totalChilds} alanın ${visibleChilds} alt alanları gösteriliyor',\n sort: 'Sırala',\n sortTitle: '${type}\\'ın alt alanlarını sırala',\n sortTitleShort: 'İçerikleri sırala',\n sortFieldLabel: 'Alan:',\n sortDirectionLabel: 'Yön:',\n sortFieldTitle: 'Diziyi veya nesneyi sıralamak için iç içe geçmiş alanı seçin',\n sortAscending: 'Artan',\n sortAscendingTitle: 'Seçili alanı artan düzende sırala',\n sortDescending: 'Azalan',\n sortDescendingTitle: 'Seçili alanı azalan düzende sırala',\n string: 'Karakter Dizisi',\n transform: 'Dönüştür',\n transformTitle: '${type}\\'ın alt alanlarını filtrele, sırala veya dönüştür',\n transformTitleShort: 'İçerikleri filterele, sırala veya dönüştür',\n transformQueryTitle: 'JMESPath sorgusu gir',\n transformWizardLabel: 'Sihirbaz',\n transformWizardFilter: 'Filtre',\n transformWizardSortBy: 'Sırala',\n transformWizardSelectFields: 'Alanları seç',\n transformQueryLabel: 'Sorgu',\n transformPreviewLabel: 'Önizleme',\n type: 'Tip',\n typeTitle: 'Bu alanın tipini değiştir',\n openUrl: 'URL\\'i yeni bir pencerede açmak için Ctrl+Click veya Ctrl+Enter',\n undo: 'Son değişikliği geri al (Ctrl+Z)',\n validationCannotMove: 'Alt alan olarak taşınamıyor',\n autoType: 'Alan tipi \"otomatik\". ' + 'Alan türü otomatik olarak değerden belirlenir' + 've bir dize, sayı, boolean veya null olabilir.',\n objectType: 'Alan tipi \"nesne\". ' + 'Bir nesne, sıralanmamış bir anahtar / değer çifti kümesi içerir.',\n arrayType: 'Alan tipi \"dizi\". ' + 'Bir dizi, düzenli değerler koleksiyonu içerir.',\n stringType: 'Alan tipi \"karakter dizisi\". ' + 'Alan türü değerden belirlenmez,' + 'ancak her zaman karakter dizisi olarak döndürülür.',\n modeCodeText: 'Kod',\n modeCodeTitle: 'Kod vurgulayıcıya geç',\n modeFormText: 'Form',\n modeFormTitle: 'Form düzenleyiciye geç',\n modeTextText: 'Metin',\n modeTextTitle: 'Düz metin düzenleyiciye geç',\n modeTreeText: 'Ağaç',\n modeTreeTitle: 'Ağaç düzenleyiciye geç',\n modeViewText: 'Görünüm',\n modeViewTitle: 'Ağaç görünümüne geç',\n examples: 'Örnekler',\n \"default\": 'Varsayılan'\n },\n ja: {\n array: '配列',\n auto: 'オート',\n appendText: '追加',\n appendTitle: '次のフィールドに\"オート\"のフィールドを追加 (Ctrl+Shift+Ins)',\n appendSubmenuTitle: '追加するフィールドの型を選択してください',\n appendTitleAuto: '\"オート\"のフィールドを追加 (Ctrl+Shift+Ins)',\n ascending: '昇順',\n ascendingTitle: '${type}の子要素を昇順に並べ替え',\n actionsMenu: 'クリックしてアクションメニューを開く (Ctrl+M)',\n collapseAll: 'すべてを折りたたむ',\n descending: '降順',\n descendingTitle: '${type}の子要素を降順に並べ替え',\n drag: 'ドラッグして選択中のフィールドを移動 (Alt+Shift+Arrows)',\n duplicateKey: '複製キー',\n duplicateText: '複製',\n duplicateTitle: '選択中のフィールドを複製 (Ctrl+D)',\n duplicateField: '選択中のフィールドを複製 (Ctrl+D)',\n duplicateFieldError: 'フィールド名が重複しています',\n cannotParseFieldError: 'JSONのフィールドを解析できません',\n cannotParseValueError: 'JSONの値を解析できません',\n empty: '空',\n expandAll: 'すべてを展開',\n expandTitle: 'クリックしてフィールドを展開/折りたたむ (Ctrl+E). \\n' + 'Ctrl+Click ですべての子要素を展開/折りたたむ',\n insert: '挿入',\n insertTitle: '選択中のフィールドの前に新しいフィールドを挿入 (Ctrl+Ins)',\n insertSub: '挿入するフィールドの型を選択',\n object: 'オブジェクト',\n ok: '実行',\n redo: 'やり直す (Ctrl+Shift+Z)',\n removeText: '削除',\n removeTitle: '選択中のフィールドを削除 (Ctrl+Del)',\n removeField: '選択中のフィールドを削除 (Ctrl+Del)',\n selectNode: 'ノードを選択...',\n showAll: 'すべてを表示',\n showMore: 'もっと見る',\n showMoreStatus: '${totalChilds}個のアイテムのうち ${visibleChilds}個を表示しています。',\n sort: '並べ替え',\n sortTitle: '${type}の子要素を並べ替え',\n sortTitleShort: '並べ替え',\n sortFieldLabel: 'フィールド:',\n sortDirectionLabel: '順序:',\n sortFieldTitle: '配列またはオブジェクトを並び替えるためのフィールドを選択',\n sortAscending: '昇順',\n sortAscendingTitle: '選択中のフィールドを昇順に並び替え',\n sortDescending: '降順',\n sortDescendingTitle: '選択中のフィールドを降順に並び替え',\n string: '文字列',\n transform: '変換',\n transformTitle: '${type}の子要素をフィルター・並び替え・変換する',\n transformTitleShort: '内容をフィルター・並び替え・変換する',\n extract: '抽出',\n extractTitle: '${type}を抽出',\n transformQueryTitle: 'JMESPathクエリを入力',\n transformWizardLabel: 'ウィザード',\n transformWizardFilter: 'フィルター',\n transformWizardSortBy: '並び替え',\n transformWizardSelectFields: 'フィールドを選択',\n transformQueryLabel: 'クエリ',\n transformPreviewLabel: 'プレビュー',\n type: '型',\n typeTitle: '選択中のフィールドの型を変更',\n openUrl: 'Ctrl+Click または Ctrl+Enter で 新規ウィンドウでURLを開く',\n undo: '元に戻す (Ctrl+Z)',\n validationCannotMove: '子要素に移動できません ',\n autoType: 'オート: ' + 'フィールドの型は値から自動的に決定されます。 ' + '(文字列・数値・ブール・null)',\n objectType: 'オブジェクト: ' + 'オブジェクトは順序が決まっていないキーと値のペア組み合わせです。',\n arrayType: '配列: ' + '配列は順序が決まっている値の集合体です。',\n stringType: '文字列: ' + 'フィールド型は値から決定されませんが、' + '常に文字列として返されます。',\n modeCodeText: 'コードモード',\n modeCodeTitle: 'ハイライトモードに切り替え',\n modeFormText: 'フォームモード',\n modeFormTitle: 'フォームモードに切り替え',\n modeTextText: 'テキストモード',\n modeTextTitle: 'テキストモードに切り替え',\n modeTreeText: 'ツリーモード',\n modeTreeTitle: 'ツリーモードに切り替え',\n modeViewText: 'ビューモード',\n modeViewTitle: 'ビューモードに切り替え',\n modePreviewText: 'プレビュー',\n modePreviewTitle: 'プレビューに切り替え',\n examples: '例',\n \"default\": 'デフォルト'\n },\n 'fr-FR': {\n array: 'Liste',\n auto: 'Auto',\n appendText: 'Ajouter',\n appendTitle: 'Ajouter un champ de type \\'auto\\' après ce champ (Ctrl+Shift+Ins)',\n appendSubmenuTitle: 'Sélectionner le type du champ à ajouter',\n appendTitleAuto: 'Ajouter un champ de type \\'auto\\' (Ctrl+Shift+Ins)',\n ascending: 'Ascendant',\n ascendingTitle: 'Trier les enfants de ce ${type} par ordre ascendant',\n actionsMenu: 'Ouvrir le menu des actions (Ctrl+M)',\n collapseAll: 'Regrouper',\n descending: 'Descendant',\n descendingTitle: 'Trier les enfants de ce ${type} par ordre descendant',\n drag: 'Déplacer (Alt+Shift+Arrows)',\n duplicateKey: 'Dupliquer la clé',\n duplicateText: 'Dupliquer',\n duplicateTitle: 'Dupliquer les champs sélectionnés (Ctrl+D)',\n duplicateField: 'Dupliquer ce champ (Ctrl+D)',\n duplicateFieldError: 'Dupliquer le nom de champ',\n cannotParseFieldError: 'Champ impossible à parser en JSON',\n cannotParseValueError: 'Valeur impossible à parser en JSON',\n empty: 'vide',\n expandAll: 'Étendre',\n expandTitle: 'Étendre/regrouper ce champ (Ctrl+E). \\n' + 'Ctrl+Click pour étendre/regrouper avec tous les champs.',\n insert: 'Insérer',\n insertTitle: 'Insérer un champ de type \\'auto\\' avant ce champ (Ctrl+Ins)',\n insertSub: 'Sélectionner le type de champ à insérer',\n object: 'Objet',\n ok: 'Ok',\n redo: 'Rejouer (Ctrl+Shift+Z)',\n removeText: 'Supprimer',\n removeTitle: 'Supprimer les champs sélectionnés (Ctrl+Del)',\n removeField: 'Supprimer ce champ (Ctrl+Del)',\n searchTitle: 'Rechercher champs et valeurs',\n searchNextResultTitle: 'Résultat suivant (Enter)',\n searchPreviousResultTitle: 'Résultat précédent (Shift + Enter)',\n selectNode: 'Sélectionner un nœud...',\n showAll: 'voir tout',\n showMore: 'voir plus',\n showMoreStatus: '${visibleChilds} éléments affichés de ${totalChilds}.',\n sort: 'Trier',\n sortTitle: 'Trier les champs de ce ${type}',\n sortTitleShort: 'Trier',\n sortFieldLabel: 'Champ:',\n sortDirectionLabel: 'Direction:',\n sortFieldTitle: 'Sélectionner les champs permettant de trier les listes et objet',\n sortAscending: 'Ascendant',\n sortAscendingTitle: 'Trier les champs sélectionnés par ordre ascendant',\n sortDescending: 'Descendant',\n sortDescendingTitle: 'Trier les champs sélectionnés par ordre descendant',\n string: 'Chaîne',\n transform: 'Transformer',\n transformTitle: 'Filtrer, trier, or transformer les enfants de ce ${type}',\n transformTitleShort: 'Filtrer, trier ou transformer le contenu',\n extract: 'Extraire',\n extractTitle: 'Extraire ce ${type}',\n transformQueryTitle: 'Saisir une requête JMESPath',\n transformWizardLabel: 'Assistant',\n transformWizardFilter: 'Filtrer',\n transformWizardSortBy: 'Trier par',\n transformWizardSelectFields: 'Sélectionner les champs',\n transformQueryLabel: 'Requête',\n transformPreviewLabel: 'Prévisualisation',\n type: 'Type',\n typeTitle: 'Changer le type de ce champ',\n openUrl: 'Ctrl+Click ou Ctrl+Enter pour ouvrir l\\'url dans une autre fenêtre',\n undo: 'Annuler la dernière action (Ctrl+Z)',\n validationCannotMove: 'Cannot move a field into a child of itself',\n autoType: 'Champe de type \"auto\". ' + 'Ce type de champ est automatiquement déterminé en fonction de la valeur ' + 'et peut être de type \"chaîne\", \"nombre\", \"booléen\" ou null.',\n objectType: 'Champ de type \"objet\". ' + 'Un objet contient un ensemble non ordonné de paires clé/valeur.',\n arrayType: 'Champ de type \"liste\". ' + 'Une liste contient une collection ordonnée de valeurs.',\n stringType: 'Champ de type \"chaîne\". ' + 'Ce type de champ n\\'est pas déterminé en fonction de la valeur, ' + 'mais retourne systématiquement une chaîne de caractères.',\n modeEditorTitle: 'Changer mode d\\'édition',\n modeCodeText: 'Code',\n modeCodeTitle: 'Activer surlignage code',\n modeFormText: 'Formulaire',\n modeFormTitle: 'Activer formulaire',\n modeTextText: 'Texte',\n modeTextTitle: 'Activer éditeur texte',\n modeTreeText: 'Arbre',\n modeTreeTitle: 'Activer éditeur arbre',\n modeViewText: 'Lecture seule',\n modeViewTitle: 'Activer vue arbre',\n modePreviewText: 'Prévisualisation',\n modePreviewTitle: 'Activer mode prévisualiser',\n examples: 'Exemples',\n \"default\": 'Défaut'\n }\n };\n var _defaultLang = 'en';\n var userLang = typeof navigator !== 'undefined' ? navigator.language || navigator.userLanguage : undefined;\n\n var _lang = _locales.find(function (l) {\n return l === userLang;\n }) || _defaultLang;\n\n function setLanguage(lang) {\n if (!lang) {\n return;\n }\n\n var langFound = _locales.find(function (l) {\n return l === lang;\n });\n\n if (langFound) {\n _lang = langFound;\n } else {\n console.error('Language not found');\n }\n }\n\n function setLanguages(languages) {\n if (!languages) {\n return;\n }\n\n var _loop = function _loop(language) {\n var langFound = _locales.find(function (l) {\n return l === language;\n });\n\n if (!langFound) {\n _locales.push(language);\n }\n\n _defs[language] = Object.assign({}, _defs[_defaultLang], _defs[language], languages[language]);\n };\n\n for (var language in languages) {\n _loop(language);\n }\n }\n\n function translate(key, data, lang) {\n if (!lang) {\n lang = _lang;\n }\n\n var text = _defs[lang][key] || _defs[_defaultLang][key] || key;\n\n if (data) {\n for (var dataKey in data) {\n text = text.replace('${' + dataKey + '}', data[dataKey]);\n }\n }\n\n return text;\n }\n /***/\n\n },\n /* 2 */\n\n /***/\n function (module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n /* harmony export (binding) */\n\n __webpack_require__.d(__webpack_exports__, \"a\", function () {\n return DEFAULT_MODAL_ANCHOR;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"d\", function () {\n return SIZE_LARGE;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"b\", function () {\n return MAX_PREVIEW_CHARACTERS;\n });\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"c\", function () {\n return PREVIEW_HISTORY_LIMIT;\n });\n\n var DEFAULT_MODAL_ANCHOR = document.body;\n var SIZE_LARGE = 10 * 1024 * 1024; // 10 MB\n\n var MAX_PREVIEW_CHARACTERS = 20000;\n var PREVIEW_HISTORY_LIMIT = 2 * 1024 * 1024 * 1024; // 2 GB\n\n /***/\n },\n /* 3 */\n\n /***/\n function (module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n /* harmony export (binding) */\n\n __webpack_require__.d(__webpack_exports__, \"a\", function () {\n return ContextMenu;\n });\n /* harmony import */\n\n\n var _createAbsoluteAnchor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);\n /* harmony import */\n\n\n var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);\n /* harmony import */\n\n\n var _i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n /**\n * A context menu\n * @param {Object[]} items Array containing the menu structure\n * TODO: describe structure\n * @param {Object} [options] Object with options. Available options:\n * {function} close Callback called when the\n * context menu is being closed.\n * @constructor\n */\n\n\n var ContextMenu =\n /*#__PURE__*/\n function () {\n function ContextMenu(items, options) {\n _classCallCheck(this, ContextMenu);\n\n this.dom = {};\n var me = this;\n var dom = this.dom;\n this.anchor = undefined;\n this.items = items;\n this.eventListeners = {};\n this.selection = undefined; // holds the selection before the menu was opened\n\n this.onClose = options ? options.close : undefined; // create root element\n\n var root = document.createElement('div');\n root.className = 'jsoneditor-contextmenu-root';\n dom.root = root; // create a container element\n\n var menu = document.createElement('div');\n menu.className = 'jsoneditor-contextmenu';\n dom.menu = menu;\n root.appendChild(menu); // create a list to hold the menu items\n\n var list = document.createElement('ul');\n list.className = 'jsoneditor-menu';\n menu.appendChild(list);\n dom.list = list;\n dom.items = []; // list with all buttons\n // create a (non-visible) button to set the focus to the menu\n\n var focusButton = document.createElement('button');\n focusButton.type = 'button';\n dom.focusButton = focusButton;\n var li = document.createElement('li');\n li.style.overflow = 'hidden';\n li.style.height = '0';\n li.appendChild(focusButton);\n list.appendChild(li);\n\n function createMenuItems(list, domItems, items) {\n items.forEach(function (item) {\n if (item.type === 'separator') {\n // create a separator\n var separator = document.createElement('div');\n separator.className = 'jsoneditor-separator';\n\n var _li = document.createElement('li');\n\n _li.appendChild(separator);\n\n list.appendChild(_li);\n } else {\n var domItem = {}; // create a menu item\n\n var _li2 = document.createElement('li');\n\n list.appendChild(_li2); // create a button in the menu item\n\n var button = document.createElement('button');\n button.type = 'button';\n button.className = item.className;\n domItem.button = button;\n\n if (item.title) {\n button.title = item.title;\n }\n\n if (item.click) {\n button.onclick = function (event) {\n event.preventDefault();\n me.hide();\n item.click();\n };\n }\n\n _li2.appendChild(button); // create the contents of the button\n\n\n if (item.submenu) {\n // add the icon to the button\n var divIcon = document.createElement('div');\n divIcon.className = 'jsoneditor-icon';\n button.appendChild(divIcon);\n var divText = document.createElement('div');\n divText.className = 'jsoneditor-text' + (item.click ? '' : ' jsoneditor-right-margin');\n divText.appendChild(document.createTextNode(item.text));\n button.appendChild(divText);\n var buttonSubmenu;\n\n if (item.click) {\n // submenu and a button with a click handler\n button.className += ' jsoneditor-default';\n var buttonExpand = document.createElement('button');\n buttonExpand.type = 'button';\n domItem.buttonExpand = buttonExpand;\n buttonExpand.className = 'jsoneditor-expand';\n buttonExpand.innerHTML = '
';\n\n _li2.appendChild(buttonExpand);\n\n if (item.submenuTitle) {\n buttonExpand.title = item.submenuTitle;\n }\n\n buttonSubmenu = buttonExpand;\n } else {\n // submenu and a button without a click handler\n var divExpand = document.createElement('div');\n divExpand.className = 'jsoneditor-expand';\n button.appendChild(divExpand);\n buttonSubmenu = button;\n } // attach a handler to expand/collapse the submenu\n\n\n buttonSubmenu.onclick = function (event) {\n event.preventDefault();\n\n me._onExpandItem(domItem);\n\n buttonSubmenu.focus();\n }; // create the submenu\n\n\n var domSubItems = [];\n domItem.subItems = domSubItems;\n var ul = document.createElement('ul');\n domItem.ul = ul;\n ul.className = 'jsoneditor-menu';\n ul.style.height = '0';\n\n _li2.appendChild(ul);\n\n createMenuItems(ul, domSubItems, item.submenu);\n } else {\n // no submenu, just a button with clickhandler\n button.innerHTML = '
' + '' + Object(_i18n__WEBPACK_IMPORTED_MODULE_2__[\n /* translate */\n \"c\"])(item.text) + '
';\n }\n\n domItems.push(domItem);\n }\n });\n }\n\n createMenuItems(list, this.dom.items, items); // TODO: when the editor is small, show the submenu on the right instead of inline?\n // calculate the max height of the menu with one submenu expanded\n\n this.maxHeight = 0; // height in pixels\n\n items.forEach(function (item) {\n var height = (items.length + (item.submenu ? item.submenu.length : 0)) * 24;\n me.maxHeight = Math.max(me.maxHeight, height);\n });\n }\n /**\n * Get the currently visible buttons\n * @return {Array.} buttons\n * @private\n */\n\n\n _createClass(ContextMenu, [{\n key: \"_getVisibleButtons\",\n value: function _getVisibleButtons() {\n var buttons = [];\n var me = this;\n this.dom.items.forEach(function (item) {\n buttons.push(item.button);\n\n if (item.buttonExpand) {\n buttons.push(item.buttonExpand);\n }\n\n if (item.subItems && item === me.expandedItem) {\n item.subItems.forEach(function (subItem) {\n buttons.push(subItem.button);\n\n if (subItem.buttonExpand) {\n buttons.push(subItem.buttonExpand);\n } // TODO: change to fully recursive method\n\n });\n }\n });\n return buttons;\n }\n /**\n * Attach the menu to an anchor\n * @param {HTMLElement} anchor Anchor where the menu will be attached as sibling.\n * @param {HTMLElement} frame The root of the JSONEditor window\n * @param {Boolean=} ignoreParent ignore anchor parent in regard to the calculation of the position, needed when the parent position is absolute\n */\n\n }, {\n key: \"show\",\n value: function show(anchor, frame, ignoreParent) {\n this.hide(); // determine whether to display the menu below or above the anchor\n\n var showBelow = true;\n var parent = anchor.parentNode;\n var anchorRect = anchor.getBoundingClientRect();\n var parentRect = parent.getBoundingClientRect();\n var frameRect = frame.getBoundingClientRect();\n var me = this;\n this.dom.absoluteAnchor = Object(_createAbsoluteAnchor__WEBPACK_IMPORTED_MODULE_0__[\n /* createAbsoluteAnchor */\n \"a\"])(anchor, frame, function () {\n me.hide();\n });\n\n if (anchorRect.bottom + this.maxHeight < frameRect.bottom) {// fits below -> show below\n } else if (anchorRect.top - this.maxHeight > frameRect.top) {\n // fits above -> show above\n showBelow = false;\n } else {// doesn't fit above nor below -> show below\n }\n\n var topGap = ignoreParent ? 0 : anchorRect.top - parentRect.top; // position the menu\n\n if (showBelow) {\n // display the menu below the anchor\n var anchorHeight = anchor.offsetHeight;\n this.dom.menu.style.left = '0';\n this.dom.menu.style.top = topGap + anchorHeight + 'px';\n this.dom.menu.style.bottom = '';\n } else {\n // display the menu above the anchor\n this.dom.menu.style.left = '0';\n this.dom.menu.style.top = '';\n this.dom.menu.style.bottom = '0px';\n } // attach the menu to the temporary, absolute anchor\n // parent.insertBefore(this.dom.root, anchor);\n\n\n this.dom.absoluteAnchor.appendChild(this.dom.root); // move focus to the first button in the context menu\n\n this.selection = Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getSelection\"])();\n this.anchor = anchor;\n setTimeout(function () {\n me.dom.focusButton.focus();\n }, 0);\n\n if (ContextMenu.visibleMenu) {\n ContextMenu.visibleMenu.hide();\n }\n\n ContextMenu.visibleMenu = this;\n }\n /**\n * Hide the context menu if visible\n */\n\n }, {\n key: \"hide\",\n value: function hide() {\n // remove temporary absolutely positioned anchor\n if (this.dom.absoluteAnchor) {\n this.dom.absoluteAnchor.destroy();\n delete this.dom.absoluteAnchor;\n } // remove the menu from the DOM\n\n\n if (this.dom.root.parentNode) {\n this.dom.root.parentNode.removeChild(this.dom.root);\n\n if (this.onClose) {\n this.onClose();\n }\n }\n\n if (ContextMenu.visibleMenu === this) {\n ContextMenu.visibleMenu = undefined;\n }\n }\n /**\n * Expand a submenu\n * Any currently expanded submenu will be hided.\n * @param {Object} domItem\n * @private\n */\n\n }, {\n key: \"_onExpandItem\",\n value: function _onExpandItem(domItem) {\n var me = this;\n var alreadyVisible = domItem === this.expandedItem; // hide the currently visible submenu\n\n var expandedItem = this.expandedItem;\n\n if (expandedItem) {\n // var ul = expandedItem.ul;\n expandedItem.ul.style.height = '0';\n expandedItem.ul.style.padding = '';\n setTimeout(function () {\n if (me.expandedItem !== expandedItem) {\n expandedItem.ul.style.display = '';\n Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"removeClassName\"])(expandedItem.ul.parentNode, 'jsoneditor-selected');\n }\n }, 300); // timeout duration must match the css transition duration\n\n this.expandedItem = undefined;\n }\n\n if (!alreadyVisible) {\n var ul = domItem.ul;\n ul.style.display = 'block'; // eslint-disable-next-line no-unused-expressions\n\n ul.clientHeight; // force a reflow in Firefox\n\n setTimeout(function () {\n if (me.expandedItem === domItem) {\n var childsHeight = 0;\n\n for (var i = 0; i < ul.childNodes.length; i++) {\n childsHeight += ul.childNodes[i].clientHeight;\n }\n\n ul.style.height = childsHeight + 'px';\n ul.style.padding = '5px 10px';\n }\n }, 0);\n Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"addClassName\"])(ul.parentNode, 'jsoneditor-selected');\n this.expandedItem = domItem;\n }\n }\n /**\n * Handle onkeydown event\n * @param {Event} event\n * @private\n */\n\n }, {\n key: \"_onKeyDown\",\n value: function _onKeyDown(event) {\n var target = event.target;\n var keynum = event.which;\n var handled = false;\n var buttons, targetIndex, prevButton, nextButton;\n\n if (keynum === 27) {\n // ESC\n // hide the menu on ESC key\n // restore previous selection and focus\n if (this.selection) {\n Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"setSelection\"])(this.selection);\n }\n\n if (this.anchor) {\n this.anchor.focus();\n }\n\n this.hide();\n handled = true;\n } else if (keynum === 9) {\n // Tab\n if (!event.shiftKey) {\n // Tab\n buttons = this._getVisibleButtons();\n targetIndex = buttons.indexOf(target);\n\n if (targetIndex === buttons.length - 1) {\n // move to first button\n buttons[0].focus();\n handled = true;\n }\n } else {\n // Shift+Tab\n buttons = this._getVisibleButtons();\n targetIndex = buttons.indexOf(target);\n\n if (targetIndex === 0) {\n // move to last button\n buttons[buttons.length - 1].focus();\n handled = true;\n }\n }\n } else if (keynum === 37) {\n // Arrow Left\n if (target.className === 'jsoneditor-expand') {\n buttons = this._getVisibleButtons();\n targetIndex = buttons.indexOf(target);\n prevButton = buttons[targetIndex - 1];\n\n if (prevButton) {\n prevButton.focus();\n }\n }\n\n handled = true;\n } else if (keynum === 38) {\n // Arrow Up\n buttons = this._getVisibleButtons();\n targetIndex = buttons.indexOf(target);\n prevButton = buttons[targetIndex - 1];\n\n if (prevButton && prevButton.className === 'jsoneditor-expand') {\n // skip expand button\n prevButton = buttons[targetIndex - 2];\n }\n\n if (!prevButton) {\n // move to last button\n prevButton = buttons[buttons.length - 1];\n }\n\n if (prevButton) {\n prevButton.focus();\n }\n\n handled = true;\n } else if (keynum === 39) {\n // Arrow Right\n buttons = this._getVisibleButtons();\n targetIndex = buttons.indexOf(target);\n nextButton = buttons[targetIndex + 1];\n\n if (nextButton && nextButton.className === 'jsoneditor-expand') {\n nextButton.focus();\n }\n\n handled = true;\n } else if (keynum === 40) {\n // Arrow Down\n buttons = this._getVisibleButtons();\n targetIndex = buttons.indexOf(target);\n nextButton = buttons[targetIndex + 1];\n\n if (nextButton && nextButton.className === 'jsoneditor-expand') {\n // skip expand button\n nextButton = buttons[targetIndex + 2];\n }\n\n if (!nextButton) {\n // move to first button\n nextButton = buttons[0];\n }\n\n if (nextButton) {\n nextButton.focus();\n handled = true;\n }\n\n handled = true;\n } // TODO: arrow left and right\n\n\n if (handled) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n }]);\n\n return ContextMenu;\n }(); // currently displayed context menu, a singleton. We may only have one visible context menu\n\n\n ContextMenu.visibleMenu = undefined;\n /* unused harmony default export */\n\n var _unused_webpack_default_export = ContextMenu;\n /***/\n },\n /* 4 */\n\n /***/\n function (module, exports, __webpack_require__) {\n (function (exports) {\n \"use strict\";\n\n function isArray(obj) {\n if (obj !== null) {\n return Object.prototype.toString.call(obj) === \"[object Array]\";\n } else {\n return false;\n }\n }\n\n function isObject(obj) {\n if (obj !== null) {\n return Object.prototype.toString.call(obj) === \"[object Object]\";\n } else {\n return false;\n }\n }\n\n function strictDeepEqual(first, second) {\n // Check the scalar case first.\n if (first === second) {\n return true;\n } // Check if they are the same type.\n\n\n var firstType = Object.prototype.toString.call(first);\n\n if (firstType !== Object.prototype.toString.call(second)) {\n return false;\n } // We know that first and second have the same type so we can just check the\n // first type from now on.\n\n\n if (isArray(first) === true) {\n // Short circuit if they're not the same length;\n if (first.length !== second.length) {\n return false;\n }\n\n for (var i = 0; i < first.length; i++) {\n if (strictDeepEqual(first[i], second[i]) === false) {\n return false;\n }\n }\n\n return true;\n }\n\n if (isObject(first) === true) {\n // An object is equal if it has the same key/value pairs.\n var keysSeen = {};\n\n for (var key in first) {\n if (hasOwnProperty.call(first, key)) {\n if (strictDeepEqual(first[key], second[key]) === false) {\n return false;\n }\n\n keysSeen[key] = true;\n }\n } // Now check that there aren't any keys in second that weren't\n // in first.\n\n\n for (var key2 in second) {\n if (hasOwnProperty.call(second, key2)) {\n if (keysSeen[key2] !== true) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n return false;\n }\n\n function isFalse(obj) {\n // From the spec:\n // A false value corresponds to the following values:\n // Empty list\n // Empty object\n // Empty string\n // False boolean\n // null value\n // First check the scalar values.\n if (obj === \"\" || obj === false || obj === null) {\n return true;\n } else if (isArray(obj) && obj.length === 0) {\n // Check for an empty array.\n return true;\n } else if (isObject(obj)) {\n // Check for an empty object.\n for (var key in obj) {\n // If there are any keys, then\n // the object is not empty so the object\n // is not false.\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n\n return true;\n } else {\n return false;\n }\n }\n\n function objValues(obj) {\n var keys = Object.keys(obj);\n var values = [];\n\n for (var i = 0; i < keys.length; i++) {\n values.push(obj[keys[i]]);\n }\n\n return values;\n }\n\n function merge(a, b) {\n var merged = {};\n\n for (var key in a) {\n merged[key] = a[key];\n }\n\n for (var key2 in b) {\n merged[key2] = b[key2];\n }\n\n return merged;\n }\n\n var trimLeft;\n\n if (typeof String.prototype.trimLeft === \"function\") {\n trimLeft = function trimLeft(str) {\n return str.trimLeft();\n };\n } else {\n trimLeft = function trimLeft(str) {\n return str.match(/^\\s*(.*)/)[1];\n };\n } // Type constants used to define functions.\n\n\n var TYPE_NUMBER = 0;\n var TYPE_ANY = 1;\n var TYPE_STRING = 2;\n var TYPE_ARRAY = 3;\n var TYPE_OBJECT = 4;\n var TYPE_BOOLEAN = 5;\n var TYPE_EXPREF = 6;\n var TYPE_NULL = 7;\n var TYPE_ARRAY_NUMBER = 8;\n var TYPE_ARRAY_STRING = 9;\n var TOK_EOF = \"EOF\";\n var TOK_UNQUOTEDIDENTIFIER = \"UnquotedIdentifier\";\n var TOK_QUOTEDIDENTIFIER = \"QuotedIdentifier\";\n var TOK_RBRACKET = \"Rbracket\";\n var TOK_RPAREN = \"Rparen\";\n var TOK_COMMA = \"Comma\";\n var TOK_COLON = \"Colon\";\n var TOK_RBRACE = \"Rbrace\";\n var TOK_NUMBER = \"Number\";\n var TOK_CURRENT = \"Current\";\n var TOK_EXPREF = \"Expref\";\n var TOK_PIPE = \"Pipe\";\n var TOK_OR = \"Or\";\n var TOK_AND = \"And\";\n var TOK_EQ = \"EQ\";\n var TOK_GT = \"GT\";\n var TOK_LT = \"LT\";\n var TOK_GTE = \"GTE\";\n var TOK_LTE = \"LTE\";\n var TOK_NE = \"NE\";\n var TOK_FLATTEN = \"Flatten\";\n var TOK_STAR = \"Star\";\n var TOK_FILTER = \"Filter\";\n var TOK_DOT = \"Dot\";\n var TOK_NOT = \"Not\";\n var TOK_LBRACE = \"Lbrace\";\n var TOK_LBRACKET = \"Lbracket\";\n var TOK_LPAREN = \"Lparen\";\n var TOK_LITERAL = \"Literal\"; // The \"&\", \"[\", \"<\", \">\" tokens\n // are not in basicToken because\n // there are two token variants\n // (\"&&\", \"[?\", \"<=\", \">=\"). This is specially handled\n // below.\n\n var basicTokens = {\n \".\": TOK_DOT,\n \"*\": TOK_STAR,\n \",\": TOK_COMMA,\n \":\": TOK_COLON,\n \"{\": TOK_LBRACE,\n \"}\": TOK_RBRACE,\n \"]\": TOK_RBRACKET,\n \"(\": TOK_LPAREN,\n \")\": TOK_RPAREN,\n \"@\": TOK_CURRENT\n };\n var operatorStartToken = {\n \"<\": true,\n \">\": true,\n \"=\": true,\n \"!\": true\n };\n var skipChars = {\n \" \": true,\n \"\\t\": true,\n \"\\n\": true\n };\n\n function isAlpha(ch) {\n return ch >= \"a\" && ch <= \"z\" || ch >= \"A\" && ch <= \"Z\" || ch === \"_\";\n }\n\n function isNum(ch) {\n return ch >= \"0\" && ch <= \"9\" || ch === \"-\";\n }\n\n function isAlphaNum(ch) {\n return ch >= \"a\" && ch <= \"z\" || ch >= \"A\" && ch <= \"Z\" || ch >= \"0\" && ch <= \"9\" || ch === \"_\";\n }\n\n function Lexer() {}\n\n Lexer.prototype = {\n tokenize: function tokenize(stream) {\n var tokens = [];\n this._current = 0;\n var start;\n var identifier;\n var token;\n\n while (this._current < stream.length) {\n if (isAlpha(stream[this._current])) {\n start = this._current;\n identifier = this._consumeUnquotedIdentifier(stream);\n tokens.push({\n type: TOK_UNQUOTEDIDENTIFIER,\n value: identifier,\n start: start\n });\n } else if (basicTokens[stream[this._current]] !== undefined) {\n tokens.push({\n type: basicTokens[stream[this._current]],\n value: stream[this._current],\n start: this._current\n });\n this._current++;\n } else if (isNum(stream[this._current])) {\n token = this._consumeNumber(stream);\n tokens.push(token);\n } else if (stream[this._current] === \"[\") {\n // No need to increment this._current. This happens\n // in _consumeLBracket\n token = this._consumeLBracket(stream);\n tokens.push(token);\n } else if (stream[this._current] === \"\\\"\") {\n start = this._current;\n identifier = this._consumeQuotedIdentifier(stream);\n tokens.push({\n type: TOK_QUOTEDIDENTIFIER,\n value: identifier,\n start: start\n });\n } else if (stream[this._current] === \"'\") {\n start = this._current;\n identifier = this._consumeRawStringLiteral(stream);\n tokens.push({\n type: TOK_LITERAL,\n value: identifier,\n start: start\n });\n } else if (stream[this._current] === \"`\") {\n start = this._current;\n\n var literal = this._consumeLiteral(stream);\n\n tokens.push({\n type: TOK_LITERAL,\n value: literal,\n start: start\n });\n } else if (operatorStartToken[stream[this._current]] !== undefined) {\n tokens.push(this._consumeOperator(stream));\n } else if (skipChars[stream[this._current]] !== undefined) {\n // Ignore whitespace.\n this._current++;\n } else if (stream[this._current] === \"&\") {\n start = this._current;\n this._current++;\n\n if (stream[this._current] === \"&\") {\n this._current++;\n tokens.push({\n type: TOK_AND,\n value: \"&&\",\n start: start\n });\n } else {\n tokens.push({\n type: TOK_EXPREF,\n value: \"&\",\n start: start\n });\n }\n } else if (stream[this._current] === \"|\") {\n start = this._current;\n this._current++;\n\n if (stream[this._current] === \"|\") {\n this._current++;\n tokens.push({\n type: TOK_OR,\n value: \"||\",\n start: start\n });\n } else {\n tokens.push({\n type: TOK_PIPE,\n value: \"|\",\n start: start\n });\n }\n } else {\n var error = new Error(\"Unknown character:\" + stream[this._current]);\n error.name = \"LexerError\";\n throw error;\n }\n }\n\n return tokens;\n },\n _consumeUnquotedIdentifier: function _consumeUnquotedIdentifier(stream) {\n var start = this._current;\n this._current++;\n\n while (this._current < stream.length && isAlphaNum(stream[this._current])) {\n this._current++;\n }\n\n return stream.slice(start, this._current);\n },\n _consumeQuotedIdentifier: function _consumeQuotedIdentifier(stream) {\n var start = this._current;\n this._current++;\n var maxLength = stream.length;\n\n while (stream[this._current] !== \"\\\"\" && this._current < maxLength) {\n // You can escape a double quote and you can escape an escape.\n var current = this._current;\n\n if (stream[current] === \"\\\\\" && (stream[current + 1] === \"\\\\\" || stream[current + 1] === \"\\\"\")) {\n current += 2;\n } else {\n current++;\n }\n\n this._current = current;\n }\n\n this._current++;\n return JSON.parse(stream.slice(start, this._current));\n },\n _consumeRawStringLiteral: function _consumeRawStringLiteral(stream) {\n var start = this._current;\n this._current++;\n var maxLength = stream.length;\n\n while (stream[this._current] !== \"'\" && this._current < maxLength) {\n // You can escape a single quote and you can escape an escape.\n var current = this._current;\n\n if (stream[current] === \"\\\\\" && (stream[current + 1] === \"\\\\\" || stream[current + 1] === \"'\")) {\n current += 2;\n } else {\n current++;\n }\n\n this._current = current;\n }\n\n this._current++;\n var literal = stream.slice(start + 1, this._current - 1);\n return literal.replace(\"\\\\'\", \"'\");\n },\n _consumeNumber: function _consumeNumber(stream) {\n var start = this._current;\n this._current++;\n var maxLength = stream.length;\n\n while (isNum(stream[this._current]) && this._current < maxLength) {\n this._current++;\n }\n\n var value = parseInt(stream.slice(start, this._current));\n return {\n type: TOK_NUMBER,\n value: value,\n start: start\n };\n },\n _consumeLBracket: function _consumeLBracket(stream) {\n var start = this._current;\n this._current++;\n\n if (stream[this._current] === \"?\") {\n this._current++;\n return {\n type: TOK_FILTER,\n value: \"[?\",\n start: start\n };\n } else if (stream[this._current] === \"]\") {\n this._current++;\n return {\n type: TOK_FLATTEN,\n value: \"[]\",\n start: start\n };\n } else {\n return {\n type: TOK_LBRACKET,\n value: \"[\",\n start: start\n };\n }\n },\n _consumeOperator: function _consumeOperator(stream) {\n var start = this._current;\n var startingChar = stream[start];\n this._current++;\n\n if (startingChar === \"!\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {\n type: TOK_NE,\n value: \"!=\",\n start: start\n };\n } else {\n return {\n type: TOK_NOT,\n value: \"!\",\n start: start\n };\n }\n } else if (startingChar === \"<\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {\n type: TOK_LTE,\n value: \"<=\",\n start: start\n };\n } else {\n return {\n type: TOK_LT,\n value: \"<\",\n start: start\n };\n }\n } else if (startingChar === \">\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {\n type: TOK_GTE,\n value: \">=\",\n start: start\n };\n } else {\n return {\n type: TOK_GT,\n value: \">\",\n start: start\n };\n }\n } else if (startingChar === \"=\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {\n type: TOK_EQ,\n value: \"==\",\n start: start\n };\n }\n }\n },\n _consumeLiteral: function _consumeLiteral(stream) {\n this._current++;\n var start = this._current;\n var maxLength = stream.length;\n var literal;\n\n while (stream[this._current] !== \"`\" && this._current < maxLength) {\n // You can escape a literal char or you can escape the escape.\n var current = this._current;\n\n if (stream[current] === \"\\\\\" && (stream[current + 1] === \"\\\\\" || stream[current + 1] === \"`\")) {\n current += 2;\n } else {\n current++;\n }\n\n this._current = current;\n }\n\n var literalString = trimLeft(stream.slice(start, this._current));\n literalString = literalString.replace(\"\\\\`\", \"`\");\n\n if (this._looksLikeJSON(literalString)) {\n literal = JSON.parse(literalString);\n } else {\n // Try to JSON parse it as \"\"\n literal = JSON.parse(\"\\\"\" + literalString + \"\\\"\");\n } // +1 gets us to the ending \"`\", +1 to move on to the next char.\n\n\n this._current++;\n return literal;\n },\n _looksLikeJSON: function _looksLikeJSON(literalString) {\n var startingChars = \"[{\\\"\";\n var jsonLiterals = [\"true\", \"false\", \"null\"];\n var numberLooking = \"-0123456789\";\n\n if (literalString === \"\") {\n return false;\n } else if (startingChars.indexOf(literalString[0]) >= 0) {\n return true;\n } else if (jsonLiterals.indexOf(literalString) >= 0) {\n return true;\n } else if (numberLooking.indexOf(literalString[0]) >= 0) {\n try {\n JSON.parse(literalString);\n return true;\n } catch (ex) {\n return false;\n }\n } else {\n return false;\n }\n }\n };\n var bindingPower = {};\n bindingPower[TOK_EOF] = 0;\n bindingPower[TOK_UNQUOTEDIDENTIFIER] = 0;\n bindingPower[TOK_QUOTEDIDENTIFIER] = 0;\n bindingPower[TOK_RBRACKET] = 0;\n bindingPower[TOK_RPAREN] = 0;\n bindingPower[TOK_COMMA] = 0;\n bindingPower[TOK_RBRACE] = 0;\n bindingPower[TOK_NUMBER] = 0;\n bindingPower[TOK_CURRENT] = 0;\n bindingPower[TOK_EXPREF] = 0;\n bindingPower[TOK_PIPE] = 1;\n bindingPower[TOK_OR] = 2;\n bindingPower[TOK_AND] = 3;\n bindingPower[TOK_EQ] = 5;\n bindingPower[TOK_GT] = 5;\n bindingPower[TOK_LT] = 5;\n bindingPower[TOK_GTE] = 5;\n bindingPower[TOK_LTE] = 5;\n bindingPower[TOK_NE] = 5;\n bindingPower[TOK_FLATTEN] = 9;\n bindingPower[TOK_STAR] = 20;\n bindingPower[TOK_FILTER] = 21;\n bindingPower[TOK_DOT] = 40;\n bindingPower[TOK_NOT] = 45;\n bindingPower[TOK_LBRACE] = 50;\n bindingPower[TOK_LBRACKET] = 55;\n bindingPower[TOK_LPAREN] = 60;\n\n function Parser() {}\n\n Parser.prototype = {\n parse: function parse(expression) {\n this._loadTokens(expression);\n\n this.index = 0;\n var ast = this.expression(0);\n\n if (this._lookahead(0) !== TOK_EOF) {\n var t = this._lookaheadToken(0);\n\n var error = new Error(\"Unexpected token type: \" + t.type + \", value: \" + t.value);\n error.name = \"ParserError\";\n throw error;\n }\n\n return ast;\n },\n _loadTokens: function _loadTokens(expression) {\n var lexer = new Lexer();\n var tokens = lexer.tokenize(expression);\n tokens.push({\n type: TOK_EOF,\n value: \"\",\n start: expression.length\n });\n this.tokens = tokens;\n },\n expression: function expression(rbp) {\n var leftToken = this._lookaheadToken(0);\n\n this._advance();\n\n var left = this.nud(leftToken);\n\n var currentToken = this._lookahead(0);\n\n while (rbp < bindingPower[currentToken]) {\n this._advance();\n\n left = this.led(currentToken, left);\n currentToken = this._lookahead(0);\n }\n\n return left;\n },\n _lookahead: function _lookahead(number) {\n return this.tokens[this.index + number].type;\n },\n _lookaheadToken: function _lookaheadToken(number) {\n return this.tokens[this.index + number];\n },\n _advance: function _advance() {\n this.index++;\n },\n nud: function nud(token) {\n var left;\n var right;\n var expression;\n\n switch (token.type) {\n case TOK_LITERAL:\n return {\n type: \"Literal\",\n value: token.value\n };\n\n case TOK_UNQUOTEDIDENTIFIER:\n return {\n type: \"Field\",\n name: token.value\n };\n\n case TOK_QUOTEDIDENTIFIER:\n var node = {\n type: \"Field\",\n name: token.value\n };\n\n if (this._lookahead(0) === TOK_LPAREN) {\n throw new Error(\"Quoted identifier not allowed for function names.\");\n } else {\n return node;\n }\n\n break;\n\n case TOK_NOT:\n right = this.expression(bindingPower.Not);\n return {\n type: \"NotExpression\",\n children: [right]\n };\n\n case TOK_STAR:\n left = {\n type: \"Identity\"\n };\n right = null;\n\n if (this._lookahead(0) === TOK_RBRACKET) {\n // This can happen in a multiselect,\n // [a, b, *]\n right = {\n type: \"Identity\"\n };\n } else {\n right = this._parseProjectionRHS(bindingPower.Star);\n }\n\n return {\n type: \"ValueProjection\",\n children: [left, right]\n };\n\n case TOK_FILTER:\n return this.led(token.type, {\n type: \"Identity\"\n });\n\n case TOK_LBRACE:\n return this._parseMultiselectHash();\n\n case TOK_FLATTEN:\n left = {\n type: TOK_FLATTEN,\n children: [{\n type: \"Identity\"\n }]\n };\n right = this._parseProjectionRHS(bindingPower.Flatten);\n return {\n type: \"Projection\",\n children: [left, right]\n };\n\n case TOK_LBRACKET:\n if (this._lookahead(0) === TOK_NUMBER || this._lookahead(0) === TOK_COLON) {\n right = this._parseIndexExpression();\n return this._projectIfSlice({\n type: \"Identity\"\n }, right);\n } else if (this._lookahead(0) === TOK_STAR && this._lookahead(1) === TOK_RBRACKET) {\n this._advance();\n\n this._advance();\n\n right = this._parseProjectionRHS(bindingPower.Star);\n return {\n type: \"Projection\",\n children: [{\n type: \"Identity\"\n }, right]\n };\n } else {\n return this._parseMultiselectList();\n }\n\n break;\n\n case TOK_CURRENT:\n return {\n type: TOK_CURRENT\n };\n\n case TOK_EXPREF:\n expression = this.expression(bindingPower.Expref);\n return {\n type: \"ExpressionReference\",\n children: [expression]\n };\n\n case TOK_LPAREN:\n var args = [];\n\n while (this._lookahead(0) !== TOK_RPAREN) {\n if (this._lookahead(0) === TOK_CURRENT) {\n expression = {\n type: TOK_CURRENT\n };\n\n this._advance();\n } else {\n expression = this.expression(0);\n }\n\n args.push(expression);\n }\n\n this._match(TOK_RPAREN);\n\n return args[0];\n\n default:\n this._errorToken(token);\n\n }\n },\n led: function led(tokenName, left) {\n var right;\n\n switch (tokenName) {\n case TOK_DOT:\n var rbp = bindingPower.Dot;\n\n if (this._lookahead(0) !== TOK_STAR) {\n right = this._parseDotRHS(rbp);\n return {\n type: \"Subexpression\",\n children: [left, right]\n };\n } else {\n // Creating a projection.\n this._advance();\n\n right = this._parseProjectionRHS(rbp);\n return {\n type: \"ValueProjection\",\n children: [left, right]\n };\n }\n\n break;\n\n case TOK_PIPE:\n right = this.expression(bindingPower.Pipe);\n return {\n type: TOK_PIPE,\n children: [left, right]\n };\n\n case TOK_OR:\n right = this.expression(bindingPower.Or);\n return {\n type: \"OrExpression\",\n children: [left, right]\n };\n\n case TOK_AND:\n right = this.expression(bindingPower.And);\n return {\n type: \"AndExpression\",\n children: [left, right]\n };\n\n case TOK_LPAREN:\n var name = left.name;\n var args = [];\n var expression, node;\n\n while (this._lookahead(0) !== TOK_RPAREN) {\n if (this._lookahead(0) === TOK_CURRENT) {\n expression = {\n type: TOK_CURRENT\n };\n\n this._advance();\n } else {\n expression = this.expression(0);\n }\n\n if (this._lookahead(0) === TOK_COMMA) {\n this._match(TOK_COMMA);\n }\n\n args.push(expression);\n }\n\n this._match(TOK_RPAREN);\n\n node = {\n type: \"Function\",\n name: name,\n children: args\n };\n return node;\n\n case TOK_FILTER:\n var condition = this.expression(0);\n\n this._match(TOK_RBRACKET);\n\n if (this._lookahead(0) === TOK_FLATTEN) {\n right = {\n type: \"Identity\"\n };\n } else {\n right = this._parseProjectionRHS(bindingPower.Filter);\n }\n\n return {\n type: \"FilterProjection\",\n children: [left, right, condition]\n };\n\n case TOK_FLATTEN:\n var leftNode = {\n type: TOK_FLATTEN,\n children: [left]\n };\n\n var rightNode = this._parseProjectionRHS(bindingPower.Flatten);\n\n return {\n type: \"Projection\",\n children: [leftNode, rightNode]\n };\n\n case TOK_EQ:\n case TOK_NE:\n case TOK_GT:\n case TOK_GTE:\n case TOK_LT:\n case TOK_LTE:\n return this._parseComparator(left, tokenName);\n\n case TOK_LBRACKET:\n var token = this._lookaheadToken(0);\n\n if (token.type === TOK_NUMBER || token.type === TOK_COLON) {\n right = this._parseIndexExpression();\n return this._projectIfSlice(left, right);\n } else {\n this._match(TOK_STAR);\n\n this._match(TOK_RBRACKET);\n\n right = this._parseProjectionRHS(bindingPower.Star);\n return {\n type: \"Projection\",\n children: [left, right]\n };\n }\n\n break;\n\n default:\n this._errorToken(this._lookaheadToken(0));\n\n }\n },\n _match: function _match(tokenType) {\n if (this._lookahead(0) === tokenType) {\n this._advance();\n } else {\n var t = this._lookaheadToken(0);\n\n var error = new Error(\"Expected \" + tokenType + \", got: \" + t.type);\n error.name = \"ParserError\";\n throw error;\n }\n },\n _errorToken: function _errorToken(token) {\n var error = new Error(\"Invalid token (\" + token.type + \"): \\\"\" + token.value + \"\\\"\");\n error.name = \"ParserError\";\n throw error;\n },\n _parseIndexExpression: function _parseIndexExpression() {\n if (this._lookahead(0) === TOK_COLON || this._lookahead(1) === TOK_COLON) {\n return this._parseSliceExpression();\n } else {\n var node = {\n type: \"Index\",\n value: this._lookaheadToken(0).value\n };\n\n this._advance();\n\n this._match(TOK_RBRACKET);\n\n return node;\n }\n },\n _projectIfSlice: function _projectIfSlice(left, right) {\n var indexExpr = {\n type: \"IndexExpression\",\n children: [left, right]\n };\n\n if (right.type === \"Slice\") {\n return {\n type: \"Projection\",\n children: [indexExpr, this._parseProjectionRHS(bindingPower.Star)]\n };\n } else {\n return indexExpr;\n }\n },\n _parseSliceExpression: function _parseSliceExpression() {\n // [start:end:step] where each part is optional, as well as the last\n // colon.\n var parts = [null, null, null];\n var index = 0;\n\n var currentToken = this._lookahead(0);\n\n while (currentToken !== TOK_RBRACKET && index < 3) {\n if (currentToken === TOK_COLON) {\n index++;\n\n this._advance();\n } else if (currentToken === TOK_NUMBER) {\n parts[index] = this._lookaheadToken(0).value;\n\n this._advance();\n } else {\n var t = this._lookahead(0);\n\n var error = new Error(\"Syntax error, unexpected token: \" + t.value + \"(\" + t.type + \")\");\n error.name = \"Parsererror\";\n throw error;\n }\n\n currentToken = this._lookahead(0);\n }\n\n this._match(TOK_RBRACKET);\n\n return {\n type: \"Slice\",\n children: parts\n };\n },\n _parseComparator: function _parseComparator(left, comparator) {\n var right = this.expression(bindingPower[comparator]);\n return {\n type: \"Comparator\",\n name: comparator,\n children: [left, right]\n };\n },\n _parseDotRHS: function _parseDotRHS(rbp) {\n var lookahead = this._lookahead(0);\n\n var exprTokens = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER, TOK_STAR];\n\n if (exprTokens.indexOf(lookahead) >= 0) {\n return this.expression(rbp);\n } else if (lookahead === TOK_LBRACKET) {\n this._match(TOK_LBRACKET);\n\n return this._parseMultiselectList();\n } else if (lookahead === TOK_LBRACE) {\n this._match(TOK_LBRACE);\n\n return this._parseMultiselectHash();\n }\n },\n _parseProjectionRHS: function _parseProjectionRHS(rbp) {\n var right;\n\n if (bindingPower[this._lookahead(0)] < 10) {\n right = {\n type: \"Identity\"\n };\n } else if (this._lookahead(0) === TOK_LBRACKET) {\n right = this.expression(rbp);\n } else if (this._lookahead(0) === TOK_FILTER) {\n right = this.expression(rbp);\n } else if (this._lookahead(0) === TOK_DOT) {\n this._match(TOK_DOT);\n\n right = this._parseDotRHS(rbp);\n } else {\n var t = this._lookaheadToken(0);\n\n var error = new Error(\"Sytanx error, unexpected token: \" + t.value + \"(\" + t.type + \")\");\n error.name = \"ParserError\";\n throw error;\n }\n\n return right;\n },\n _parseMultiselectList: function _parseMultiselectList() {\n var expressions = [];\n\n while (this._lookahead(0) !== TOK_RBRACKET) {\n var expression = this.expression(0);\n expressions.push(expression);\n\n if (this._lookahead(0) === TOK_COMMA) {\n this._match(TOK_COMMA);\n\n if (this._lookahead(0) === TOK_RBRACKET) {\n throw new Error(\"Unexpected token Rbracket\");\n }\n }\n }\n\n this._match(TOK_RBRACKET);\n\n return {\n type: \"MultiSelectList\",\n children: expressions\n };\n },\n _parseMultiselectHash: function _parseMultiselectHash() {\n var pairs = [];\n var identifierTypes = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER];\n var keyToken, keyName, value, node;\n\n for (;;) {\n keyToken = this._lookaheadToken(0);\n\n if (identifierTypes.indexOf(keyToken.type) < 0) {\n throw new Error(\"Expecting an identifier token, got: \" + keyToken.type);\n }\n\n keyName = keyToken.value;\n\n this._advance();\n\n this._match(TOK_COLON);\n\n value = this.expression(0);\n node = {\n type: \"KeyValuePair\",\n name: keyName,\n value: value\n };\n pairs.push(node);\n\n if (this._lookahead(0) === TOK_COMMA) {\n this._match(TOK_COMMA);\n } else if (this._lookahead(0) === TOK_RBRACE) {\n this._match(TOK_RBRACE);\n\n break;\n }\n }\n\n return {\n type: \"MultiSelectHash\",\n children: pairs\n };\n }\n };\n\n function TreeInterpreter(runtime) {\n this.runtime = runtime;\n }\n\n TreeInterpreter.prototype = {\n search: function search(node, value) {\n return this.visit(node, value);\n },\n visit: function visit(node, value) {\n var matched, current, result, first, second, field, left, right, collected, i;\n\n switch (node.type) {\n case \"Field\":\n if (value === null) {\n return null;\n } else if (isObject(value)) {\n field = value[node.name];\n\n if (field === undefined) {\n return null;\n } else {\n return field;\n }\n } else {\n return null;\n }\n\n break;\n\n case \"Subexpression\":\n result = this.visit(node.children[0], value);\n\n for (i = 1; i < node.children.length; i++) {\n result = this.visit(node.children[1], result);\n\n if (result === null) {\n return null;\n }\n }\n\n return result;\n\n case \"IndexExpression\":\n left = this.visit(node.children[0], value);\n right = this.visit(node.children[1], left);\n return right;\n\n case \"Index\":\n if (!isArray(value)) {\n return null;\n }\n\n var index = node.value;\n\n if (index < 0) {\n index = value.length + index;\n }\n\n result = value[index];\n\n if (result === undefined) {\n result = null;\n }\n\n return result;\n\n case \"Slice\":\n if (!isArray(value)) {\n return null;\n }\n\n var sliceParams = node.children.slice(0);\n var computed = this.computeSliceParams(value.length, sliceParams);\n var start = computed[0];\n var stop = computed[1];\n var step = computed[2];\n result = [];\n\n if (step > 0) {\n for (i = start; i < stop; i += step) {\n result.push(value[i]);\n }\n } else {\n for (i = start; i > stop; i += step) {\n result.push(value[i]);\n }\n }\n\n return result;\n\n case \"Projection\":\n // Evaluate left child.\n var base = this.visit(node.children[0], value);\n\n if (!isArray(base)) {\n return null;\n }\n\n collected = [];\n\n for (i = 0; i < base.length; i++) {\n current = this.visit(node.children[1], base[i]);\n\n if (current !== null) {\n collected.push(current);\n }\n }\n\n return collected;\n\n case \"ValueProjection\":\n // Evaluate left child.\n base = this.visit(node.children[0], value);\n\n if (!isObject(base)) {\n return null;\n }\n\n collected = [];\n var values = objValues(base);\n\n for (i = 0; i < values.length; i++) {\n current = this.visit(node.children[1], values[i]);\n\n if (current !== null) {\n collected.push(current);\n }\n }\n\n return collected;\n\n case \"FilterProjection\":\n base = this.visit(node.children[0], value);\n\n if (!isArray(base)) {\n return null;\n }\n\n var filtered = [];\n var finalResults = [];\n\n for (i = 0; i < base.length; i++) {\n matched = this.visit(node.children[2], base[i]);\n\n if (!isFalse(matched)) {\n filtered.push(base[i]);\n }\n }\n\n for (var j = 0; j < filtered.length; j++) {\n current = this.visit(node.children[1], filtered[j]);\n\n if (current !== null) {\n finalResults.push(current);\n }\n }\n\n return finalResults;\n\n case \"Comparator\":\n first = this.visit(node.children[0], value);\n second = this.visit(node.children[1], value);\n\n switch (node.name) {\n case TOK_EQ:\n result = strictDeepEqual(first, second);\n break;\n\n case TOK_NE:\n result = !strictDeepEqual(first, second);\n break;\n\n case TOK_GT:\n result = first > second;\n break;\n\n case TOK_GTE:\n result = first >= second;\n break;\n\n case TOK_LT:\n result = first < second;\n break;\n\n case TOK_LTE:\n result = first <= second;\n break;\n\n default:\n throw new Error(\"Unknown comparator: \" + node.name);\n }\n\n return result;\n\n case TOK_FLATTEN:\n var original = this.visit(node.children[0], value);\n\n if (!isArray(original)) {\n return null;\n }\n\n var merged = [];\n\n for (i = 0; i < original.length; i++) {\n current = original[i];\n\n if (isArray(current)) {\n merged.push.apply(merged, current);\n } else {\n merged.push(current);\n }\n }\n\n return merged;\n\n case \"Identity\":\n return value;\n\n case \"MultiSelectList\":\n if (value === null) {\n return null;\n }\n\n collected = [];\n\n for (i = 0; i < node.children.length; i++) {\n collected.push(this.visit(node.children[i], value));\n }\n\n return collected;\n\n case \"MultiSelectHash\":\n if (value === null) {\n return null;\n }\n\n collected = {};\n var child;\n\n for (i = 0; i < node.children.length; i++) {\n child = node.children[i];\n collected[child.name] = this.visit(child.value, value);\n }\n\n return collected;\n\n case \"OrExpression\":\n matched = this.visit(node.children[0], value);\n\n if (isFalse(matched)) {\n matched = this.visit(node.children[1], value);\n }\n\n return matched;\n\n case \"AndExpression\":\n first = this.visit(node.children[0], value);\n\n if (isFalse(first) === true) {\n return first;\n }\n\n return this.visit(node.children[1], value);\n\n case \"NotExpression\":\n first = this.visit(node.children[0], value);\n return isFalse(first);\n\n case \"Literal\":\n return node.value;\n\n case TOK_PIPE:\n left = this.visit(node.children[0], value);\n return this.visit(node.children[1], left);\n\n case TOK_CURRENT:\n return value;\n\n case \"Function\":\n var resolvedArgs = [];\n\n for (i = 0; i < node.children.length; i++) {\n resolvedArgs.push(this.visit(node.children[i], value));\n }\n\n return this.runtime.callFunction(node.name, resolvedArgs);\n\n case \"ExpressionReference\":\n var refNode = node.children[0]; // Tag the node with a specific attribute so the type\n // checker verify the type.\n\n refNode.jmespathType = TOK_EXPREF;\n return refNode;\n\n default:\n throw new Error(\"Unknown node type: \" + node.type);\n }\n },\n computeSliceParams: function computeSliceParams(arrayLength, sliceParams) {\n var start = sliceParams[0];\n var stop = sliceParams[1];\n var step = sliceParams[2];\n var computed = [null, null, null];\n\n if (step === null) {\n step = 1;\n } else if (step === 0) {\n var error = new Error(\"Invalid slice, step cannot be 0\");\n error.name = \"RuntimeError\";\n throw error;\n }\n\n var stepValueNegative = step < 0 ? true : false;\n\n if (start === null) {\n start = stepValueNegative ? arrayLength - 1 : 0;\n } else {\n start = this.capSliceRange(arrayLength, start, step);\n }\n\n if (stop === null) {\n stop = stepValueNegative ? -1 : arrayLength;\n } else {\n stop = this.capSliceRange(arrayLength, stop, step);\n }\n\n computed[0] = start;\n computed[1] = stop;\n computed[2] = step;\n return computed;\n },\n capSliceRange: function capSliceRange(arrayLength, actualValue, step) {\n if (actualValue < 0) {\n actualValue += arrayLength;\n\n if (actualValue < 0) {\n actualValue = step < 0 ? -1 : 0;\n }\n } else if (actualValue >= arrayLength) {\n actualValue = step < 0 ? arrayLength - 1 : arrayLength;\n }\n\n return actualValue;\n }\n };\n\n function Runtime(interpreter) {\n this._interpreter = interpreter;\n this.functionTable = {\n // name: [function, ]\n // The can be:\n //\n // {\n // args: [[type1, type2], [type1, type2]],\n // variadic: true|false\n // }\n //\n // Each arg in the arg list is a list of valid types\n // (if the function is overloaded and supports multiple\n // types. If the type is \"any\" then no type checking\n // occurs on the argument. Variadic is optional\n // and if not provided is assumed to be false.\n abs: {\n _func: this._functionAbs,\n _signature: [{\n types: [TYPE_NUMBER]\n }]\n },\n avg: {\n _func: this._functionAvg,\n _signature: [{\n types: [TYPE_ARRAY_NUMBER]\n }]\n },\n ceil: {\n _func: this._functionCeil,\n _signature: [{\n types: [TYPE_NUMBER]\n }]\n },\n contains: {\n _func: this._functionContains,\n _signature: [{\n types: [TYPE_STRING, TYPE_ARRAY]\n }, {\n types: [TYPE_ANY]\n }]\n },\n \"ends_with\": {\n _func: this._functionEndsWith,\n _signature: [{\n types: [TYPE_STRING]\n }, {\n types: [TYPE_STRING]\n }]\n },\n floor: {\n _func: this._functionFloor,\n _signature: [{\n types: [TYPE_NUMBER]\n }]\n },\n length: {\n _func: this._functionLength,\n _signature: [{\n types: [TYPE_STRING, TYPE_ARRAY, TYPE_OBJECT]\n }]\n },\n map: {\n _func: this._functionMap,\n _signature: [{\n types: [TYPE_EXPREF]\n }, {\n types: [TYPE_ARRAY]\n }]\n },\n max: {\n _func: this._functionMax,\n _signature: [{\n types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]\n }]\n },\n \"merge\": {\n _func: this._functionMerge,\n _signature: [{\n types: [TYPE_OBJECT],\n variadic: true\n }]\n },\n \"max_by\": {\n _func: this._functionMaxBy,\n _signature: [{\n types: [TYPE_ARRAY]\n }, {\n types: [TYPE_EXPREF]\n }]\n },\n sum: {\n _func: this._functionSum,\n _signature: [{\n types: [TYPE_ARRAY_NUMBER]\n }]\n },\n \"starts_with\": {\n _func: this._functionStartsWith,\n _signature: [{\n types: [TYPE_STRING]\n }, {\n types: [TYPE_STRING]\n }]\n },\n min: {\n _func: this._functionMin,\n _signature: [{\n types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]\n }]\n },\n \"min_by\": {\n _func: this._functionMinBy,\n _signature: [{\n types: [TYPE_ARRAY]\n }, {\n types: [TYPE_EXPREF]\n }]\n },\n type: {\n _func: this._functionType,\n _signature: [{\n types: [TYPE_ANY]\n }]\n },\n keys: {\n _func: this._functionKeys,\n _signature: [{\n types: [TYPE_OBJECT]\n }]\n },\n values: {\n _func: this._functionValues,\n _signature: [{\n types: [TYPE_OBJECT]\n }]\n },\n sort: {\n _func: this._functionSort,\n _signature: [{\n types: [TYPE_ARRAY_STRING, TYPE_ARRAY_NUMBER]\n }]\n },\n \"sort_by\": {\n _func: this._functionSortBy,\n _signature: [{\n types: [TYPE_ARRAY]\n }, {\n types: [TYPE_EXPREF]\n }]\n },\n join: {\n _func: this._functionJoin,\n _signature: [{\n types: [TYPE_STRING]\n }, {\n types: [TYPE_ARRAY_STRING]\n }]\n },\n reverse: {\n _func: this._functionReverse,\n _signature: [{\n types: [TYPE_STRING, TYPE_ARRAY]\n }]\n },\n \"to_array\": {\n _func: this._functionToArray,\n _signature: [{\n types: [TYPE_ANY]\n }]\n },\n \"to_string\": {\n _func: this._functionToString,\n _signature: [{\n types: [TYPE_ANY]\n }]\n },\n \"to_number\": {\n _func: this._functionToNumber,\n _signature: [{\n types: [TYPE_ANY]\n }]\n },\n \"not_null\": {\n _func: this._functionNotNull,\n _signature: [{\n types: [TYPE_ANY],\n variadic: true\n }]\n }\n };\n }\n\n Runtime.prototype = {\n callFunction: function callFunction(name, resolvedArgs) {\n var functionEntry = this.functionTable[name];\n\n if (functionEntry === undefined) {\n throw new Error(\"Unknown function: \" + name + \"()\");\n }\n\n this._validateArgs(name, resolvedArgs, functionEntry._signature);\n\n return functionEntry._func.call(this, resolvedArgs);\n },\n _validateArgs: function _validateArgs(name, args, signature) {\n // Validating the args requires validating\n // the correct arity and the correct type of each arg.\n // If the last argument is declared as variadic, then we need\n // a minimum number of args to be required. Otherwise it has to\n // be an exact amount.\n var pluralized;\n\n if (signature[signature.length - 1].variadic) {\n if (args.length < signature.length) {\n pluralized = signature.length === 1 ? \" argument\" : \" arguments\";\n throw new Error(\"ArgumentError: \" + name + \"() \" + \"takes at least\" + signature.length + pluralized + \" but received \" + args.length);\n }\n } else if (args.length !== signature.length) {\n pluralized = signature.length === 1 ? \" argument\" : \" arguments\";\n throw new Error(\"ArgumentError: \" + name + \"() \" + \"takes \" + signature.length + pluralized + \" but received \" + args.length);\n }\n\n var currentSpec;\n var actualType;\n var typeMatched;\n\n for (var i = 0; i < signature.length; i++) {\n typeMatched = false;\n currentSpec = signature[i].types;\n actualType = this._getTypeName(args[i]);\n\n for (var j = 0; j < currentSpec.length; j++) {\n if (this._typeMatches(actualType, currentSpec[j], args[i])) {\n typeMatched = true;\n break;\n }\n }\n\n if (!typeMatched) {\n throw new Error(\"TypeError: \" + name + \"() \" + \"expected argument \" + (i + 1) + \" to be type \" + currentSpec + \" but received type \" + actualType + \" instead.\");\n }\n }\n },\n _typeMatches: function _typeMatches(actual, expected, argValue) {\n if (expected === TYPE_ANY) {\n return true;\n }\n\n if (expected === TYPE_ARRAY_STRING || expected === TYPE_ARRAY_NUMBER || expected === TYPE_ARRAY) {\n // The expected type can either just be array,\n // or it can require a specific subtype (array of numbers).\n //\n // The simplest case is if \"array\" with no subtype is specified.\n if (expected === TYPE_ARRAY) {\n return actual === TYPE_ARRAY;\n } else if (actual === TYPE_ARRAY) {\n // Otherwise we need to check subtypes.\n // I think this has potential to be improved.\n var subtype;\n\n if (expected === TYPE_ARRAY_NUMBER) {\n subtype = TYPE_NUMBER;\n } else if (expected === TYPE_ARRAY_STRING) {\n subtype = TYPE_STRING;\n }\n\n for (var i = 0; i < argValue.length; i++) {\n if (!this._typeMatches(this._getTypeName(argValue[i]), subtype, argValue[i])) {\n return false;\n }\n }\n\n return true;\n }\n } else {\n return actual === expected;\n }\n },\n _getTypeName: function _getTypeName(obj) {\n switch (Object.prototype.toString.call(obj)) {\n case \"[object String]\":\n return TYPE_STRING;\n\n case \"[object Number]\":\n return TYPE_NUMBER;\n\n case \"[object Array]\":\n return TYPE_ARRAY;\n\n case \"[object Boolean]\":\n return TYPE_BOOLEAN;\n\n case \"[object Null]\":\n return TYPE_NULL;\n\n case \"[object Object]\":\n // Check if it's an expref. If it has, it's been\n // tagged with a jmespathType attr of 'Expref';\n if (obj.jmespathType === TOK_EXPREF) {\n return TYPE_EXPREF;\n } else {\n return TYPE_OBJECT;\n }\n\n }\n },\n _functionStartsWith: function _functionStartsWith(resolvedArgs) {\n return resolvedArgs[0].lastIndexOf(resolvedArgs[1]) === 0;\n },\n _functionEndsWith: function _functionEndsWith(resolvedArgs) {\n var searchStr = resolvedArgs[0];\n var suffix = resolvedArgs[1];\n return searchStr.indexOf(suffix, searchStr.length - suffix.length) !== -1;\n },\n _functionReverse: function _functionReverse(resolvedArgs) {\n var typeName = this._getTypeName(resolvedArgs[0]);\n\n if (typeName === TYPE_STRING) {\n var originalStr = resolvedArgs[0];\n var reversedStr = \"\";\n\n for (var i = originalStr.length - 1; i >= 0; i--) {\n reversedStr += originalStr[i];\n }\n\n return reversedStr;\n } else {\n var reversedArray = resolvedArgs[0].slice(0);\n reversedArray.reverse();\n return reversedArray;\n }\n },\n _functionAbs: function _functionAbs(resolvedArgs) {\n return Math.abs(resolvedArgs[0]);\n },\n _functionCeil: function _functionCeil(resolvedArgs) {\n return Math.ceil(resolvedArgs[0]);\n },\n _functionAvg: function _functionAvg(resolvedArgs) {\n var sum = 0;\n var inputArray = resolvedArgs[0];\n\n for (var i = 0; i < inputArray.length; i++) {\n sum += inputArray[i];\n }\n\n return sum / inputArray.length;\n },\n _functionContains: function _functionContains(resolvedArgs) {\n return resolvedArgs[0].indexOf(resolvedArgs[1]) >= 0;\n },\n _functionFloor: function _functionFloor(resolvedArgs) {\n return Math.floor(resolvedArgs[0]);\n },\n _functionLength: function _functionLength(resolvedArgs) {\n if (!isObject(resolvedArgs[0])) {\n return resolvedArgs[0].length;\n } else {\n // As far as I can tell, there's no way to get the length\n // of an object without O(n) iteration through the object.\n return Object.keys(resolvedArgs[0]).length;\n }\n },\n _functionMap: function _functionMap(resolvedArgs) {\n var mapped = [];\n var interpreter = this._interpreter;\n var exprefNode = resolvedArgs[0];\n var elements = resolvedArgs[1];\n\n for (var i = 0; i < elements.length; i++) {\n mapped.push(interpreter.visit(exprefNode, elements[i]));\n }\n\n return mapped;\n },\n _functionMerge: function _functionMerge(resolvedArgs) {\n var merged = {};\n\n for (var i = 0; i < resolvedArgs.length; i++) {\n var current = resolvedArgs[i];\n\n for (var key in current) {\n merged[key] = current[key];\n }\n }\n\n return merged;\n },\n _functionMax: function _functionMax(resolvedArgs) {\n if (resolvedArgs[0].length > 0) {\n var typeName = this._getTypeName(resolvedArgs[0][0]);\n\n if (typeName === TYPE_NUMBER) {\n return Math.max.apply(Math, resolvedArgs[0]);\n } else {\n var elements = resolvedArgs[0];\n var maxElement = elements[0];\n\n for (var i = 1; i < elements.length; i++) {\n if (maxElement.localeCompare(elements[i]) < 0) {\n maxElement = elements[i];\n }\n }\n\n return maxElement;\n }\n } else {\n return null;\n }\n },\n _functionMin: function _functionMin(resolvedArgs) {\n if (resolvedArgs[0].length > 0) {\n var typeName = this._getTypeName(resolvedArgs[0][0]);\n\n if (typeName === TYPE_NUMBER) {\n return Math.min.apply(Math, resolvedArgs[0]);\n } else {\n var elements = resolvedArgs[0];\n var minElement = elements[0];\n\n for (var i = 1; i < elements.length; i++) {\n if (elements[i].localeCompare(minElement) < 0) {\n minElement = elements[i];\n }\n }\n\n return minElement;\n }\n } else {\n return null;\n }\n },\n _functionSum: function _functionSum(resolvedArgs) {\n var sum = 0;\n var listToSum = resolvedArgs[0];\n\n for (var i = 0; i < listToSum.length; i++) {\n sum += listToSum[i];\n }\n\n return sum;\n },\n _functionType: function _functionType(resolvedArgs) {\n switch (this._getTypeName(resolvedArgs[0])) {\n case TYPE_NUMBER:\n return \"number\";\n\n case TYPE_STRING:\n return \"string\";\n\n case TYPE_ARRAY:\n return \"array\";\n\n case TYPE_OBJECT:\n return \"object\";\n\n case TYPE_BOOLEAN:\n return \"boolean\";\n\n case TYPE_EXPREF:\n return \"expref\";\n\n case TYPE_NULL:\n return \"null\";\n }\n },\n _functionKeys: function _functionKeys(resolvedArgs) {\n return Object.keys(resolvedArgs[0]);\n },\n _functionValues: function _functionValues(resolvedArgs) {\n var obj = resolvedArgs[0];\n var keys = Object.keys(obj);\n var values = [];\n\n for (var i = 0; i < keys.length; i++) {\n values.push(obj[keys[i]]);\n }\n\n return values;\n },\n _functionJoin: function _functionJoin(resolvedArgs) {\n var joinChar = resolvedArgs[0];\n var listJoin = resolvedArgs[1];\n return listJoin.join(joinChar);\n },\n _functionToArray: function _functionToArray(resolvedArgs) {\n if (this._getTypeName(resolvedArgs[0]) === TYPE_ARRAY) {\n return resolvedArgs[0];\n } else {\n return [resolvedArgs[0]];\n }\n },\n _functionToString: function _functionToString(resolvedArgs) {\n if (this._getTypeName(resolvedArgs[0]) === TYPE_STRING) {\n return resolvedArgs[0];\n } else {\n return JSON.stringify(resolvedArgs[0]);\n }\n },\n _functionToNumber: function _functionToNumber(resolvedArgs) {\n var typeName = this._getTypeName(resolvedArgs[0]);\n\n var convertedValue;\n\n if (typeName === TYPE_NUMBER) {\n return resolvedArgs[0];\n } else if (typeName === TYPE_STRING) {\n convertedValue = +resolvedArgs[0];\n\n if (!isNaN(convertedValue)) {\n return convertedValue;\n }\n }\n\n return null;\n },\n _functionNotNull: function _functionNotNull(resolvedArgs) {\n for (var i = 0; i < resolvedArgs.length; i++) {\n if (this._getTypeName(resolvedArgs[i]) !== TYPE_NULL) {\n return resolvedArgs[i];\n }\n }\n\n return null;\n },\n _functionSort: function _functionSort(resolvedArgs) {\n var sortedArray = resolvedArgs[0].slice(0);\n sortedArray.sort();\n return sortedArray;\n },\n _functionSortBy: function _functionSortBy(resolvedArgs) {\n var sortedArray = resolvedArgs[0].slice(0);\n\n if (sortedArray.length === 0) {\n return sortedArray;\n }\n\n var interpreter = this._interpreter;\n var exprefNode = resolvedArgs[1];\n\n var requiredType = this._getTypeName(interpreter.visit(exprefNode, sortedArray[0]));\n\n if ([TYPE_NUMBER, TYPE_STRING].indexOf(requiredType) < 0) {\n throw new Error(\"TypeError\");\n }\n\n var that = this; // In order to get a stable sort out of an unstable\n // sort algorithm, we decorate/sort/undecorate (DSU)\n // by creating a new list of [index, element] pairs.\n // In the cmp function, if the evaluated elements are\n // equal, then the index will be used as the tiebreaker.\n // After the decorated list has been sorted, it will be\n // undecorated to extract the original elements.\n\n var decorated = [];\n\n for (var i = 0; i < sortedArray.length; i++) {\n decorated.push([i, sortedArray[i]]);\n }\n\n decorated.sort(function (a, b) {\n var exprA = interpreter.visit(exprefNode, a[1]);\n var exprB = interpreter.visit(exprefNode, b[1]);\n\n if (that._getTypeName(exprA) !== requiredType) {\n throw new Error(\"TypeError: expected \" + requiredType + \", received \" + that._getTypeName(exprA));\n } else if (that._getTypeName(exprB) !== requiredType) {\n throw new Error(\"TypeError: expected \" + requiredType + \", received \" + that._getTypeName(exprB));\n }\n\n if (exprA > exprB) {\n return 1;\n } else if (exprA < exprB) {\n return -1;\n } else {\n // If they're equal compare the items by their\n // order to maintain relative order of equal keys\n // (i.e. to get a stable sort).\n return a[0] - b[0];\n }\n }); // Undecorate: extract out the original list elements.\n\n for (var j = 0; j < decorated.length; j++) {\n sortedArray[j] = decorated[j][1];\n }\n\n return sortedArray;\n },\n _functionMaxBy: function _functionMaxBy(resolvedArgs) {\n var exprefNode = resolvedArgs[1];\n var resolvedArray = resolvedArgs[0];\n var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]);\n var maxNumber = -Infinity;\n var maxRecord;\n var current;\n\n for (var i = 0; i < resolvedArray.length; i++) {\n current = keyFunction(resolvedArray[i]);\n\n if (current > maxNumber) {\n maxNumber = current;\n maxRecord = resolvedArray[i];\n }\n }\n\n return maxRecord;\n },\n _functionMinBy: function _functionMinBy(resolvedArgs) {\n var exprefNode = resolvedArgs[1];\n var resolvedArray = resolvedArgs[0];\n var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]);\n var minNumber = Infinity;\n var minRecord;\n var current;\n\n for (var i = 0; i < resolvedArray.length; i++) {\n current = keyFunction(resolvedArray[i]);\n\n if (current < minNumber) {\n minNumber = current;\n minRecord = resolvedArray[i];\n }\n }\n\n return minRecord;\n },\n createKeyFunction: function createKeyFunction(exprefNode, allowedTypes) {\n var that = this;\n var interpreter = this._interpreter;\n\n var keyFunc = function keyFunc(x) {\n var current = interpreter.visit(exprefNode, x);\n\n if (allowedTypes.indexOf(that._getTypeName(current)) < 0) {\n var msg = \"TypeError: expected one of \" + allowedTypes + \", received \" + that._getTypeName(current);\n\n throw new Error(msg);\n }\n\n return current;\n };\n\n return keyFunc;\n }\n };\n\n function compile(stream) {\n var parser = new Parser();\n var ast = parser.parse(stream);\n return ast;\n }\n\n function tokenize(stream) {\n var lexer = new Lexer();\n return lexer.tokenize(stream);\n }\n\n function search(data, expression) {\n var parser = new Parser(); // This needs to be improved. Both the interpreter and runtime depend on\n // each other. The runtime needs the interpreter to support exprefs.\n // There's likely a clean way to avoid the cyclic dependency.\n\n var runtime = new Runtime();\n var interpreter = new TreeInterpreter(runtime);\n runtime._interpreter = interpreter;\n var node = parser.parse(expression);\n return interpreter.search(node, data);\n }\n\n exports.tokenize = tokenize;\n exports.compile = compile;\n exports.search = search;\n exports.strictDeepEqual = strictDeepEqual;\n })(false ? undefined : exports);\n /***/\n\n },\n /* 5 */\n\n /***/\n function (module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n /* harmony export (binding) */\n\n __webpack_require__.d(__webpack_exports__, \"a\", function () {\n return showSortModal;\n });\n /* harmony import */\n\n\n var picomodal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13);\n /* harmony import */\n\n\n var picomodal__WEBPACK_IMPORTED_MODULE_0___default =\n /*#__PURE__*/\n __webpack_require__.n(picomodal__WEBPACK_IMPORTED_MODULE_0__);\n /* harmony import */\n\n\n var _i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);\n /* harmony import */\n\n\n var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);\n /**\n * Show advanced sorting modal\n * @param {HTMLElement} container The container where to center\n * the modal and create an overlay\n * @param {JSON} json The JSON data to be sorted.\n * @param {function} onSort Callback function, invoked with\n * an object containing the selected\n * path and direction\n * @param {Object} options\n * Available options:\n * - {string} path The selected path\n * - {'asc' | 'desc'} direction The selected direction\n */\n\n\n function showSortModal(container, json, onSort, options) {\n var paths = Array.isArray(json) ? Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getChildPaths\"])(json) : [''];\n var selectedPath = options && options.path && Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"contains\"])(paths, options.path) ? options.path : paths[0];\n var selectedDirection = options && options.direction || 'asc';\n var content = '';\n picomodal__WEBPACK_IMPORTED_MODULE_0___default()({\n parent: container,\n content: content,\n overlayClass: 'jsoneditor-modal-overlay',\n overlayStyles: {\n backgroundColor: 'rgb(1,1,1)',\n opacity: 0.3\n },\n modalClass: 'jsoneditor-modal jsoneditor-modal-sort'\n }).afterCreate(function (modal) {\n var form = modal.modalElem().querySelector('form');\n var ok = modal.modalElem().querySelector('#ok');\n var field = modal.modalElem().querySelector('#field');\n var direction = modal.modalElem().querySelector('#direction');\n\n function preprocessPath(path) {\n return path === '' ? '@' : path[0] === '.' ? path.slice(1) : path;\n }\n\n paths.forEach(function (path) {\n var option = document.createElement('option');\n option.text = preprocessPath(path);\n option.value = path;\n field.appendChild(option);\n });\n\n function setDirection(value) {\n direction.value = value;\n direction.className = 'jsoneditor-button-group jsoneditor-button-group-value-' + direction.value;\n }\n\n field.value = selectedPath || paths[0];\n setDirection(selectedDirection || 'asc');\n\n direction.onclick = function (event) {\n setDirection(event.target.getAttribute('data-value'));\n };\n\n ok.onclick = function (event) {\n event.preventDefault();\n event.stopPropagation();\n modal.close();\n onSort({\n path: field.value,\n direction: direction.value\n });\n };\n\n if (form) {\n // form is not available when JSONEditor is created inside a form\n form.onsubmit = ok.onclick;\n }\n }).afterClose(function (modal) {\n modal.destroy();\n }).show();\n }\n /***/\n\n },\n /* 6 */\n\n /***/\n function (module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n /* harmony export (binding) */\n\n __webpack_require__.d(__webpack_exports__, \"a\", function () {\n return ModeSwitcher;\n });\n /* harmony import */\n\n\n var _ContextMenu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);\n /* harmony import */\n\n\n var _i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n /**\n * Create a select box to be used in the editor menu's, which allows to switch mode\n * @param {HTMLElement} container\n * @param {String[]} modes Available modes: 'code', 'form', 'text', 'tree', 'view', 'preview'\n * @param {String} current Available modes: 'code', 'form', 'text', 'tree', 'view', 'preview'\n * @param {function(mode: string)} onSwitch Callback invoked on switch\n * @constructor\n */\n\n\n var ModeSwitcher =\n /*#__PURE__*/\n function () {\n function ModeSwitcher(container, modes, current, onSwitch) {\n _classCallCheck(this, ModeSwitcher); // available modes\n\n\n var availableModes = {\n code: {\n text: Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modeCodeText'),\n title: Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modeCodeTitle'),\n click: function click() {\n onSwitch('code');\n }\n },\n form: {\n text: Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modeFormText'),\n title: Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modeFormTitle'),\n click: function click() {\n onSwitch('form');\n }\n },\n text: {\n text: Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modeTextText'),\n title: Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modeTextTitle'),\n click: function click() {\n onSwitch('text');\n }\n },\n tree: {\n text: Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modeTreeText'),\n title: Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modeTreeTitle'),\n click: function click() {\n onSwitch('tree');\n }\n },\n view: {\n text: Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modeViewText'),\n title: Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modeViewTitle'),\n click: function click() {\n onSwitch('view');\n }\n },\n preview: {\n text: Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modePreviewText'),\n title: Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modePreviewTitle'),\n click: function click() {\n onSwitch('preview');\n }\n }\n }; // list the selected modes\n\n var items = [];\n\n for (var i = 0; i < modes.length; i++) {\n var mode = modes[i];\n var item = availableModes[mode];\n\n if (!item) {\n throw new Error('Unknown mode \"' + mode + '\"');\n }\n\n item.className = 'jsoneditor-type-modes' + (current === mode ? ' jsoneditor-selected' : '');\n items.push(item);\n } // retrieve the title of current mode\n\n\n var currentMode = availableModes[current];\n\n if (!currentMode) {\n throw new Error('Unknown mode \"' + current + '\"');\n }\n\n var currentTitle = currentMode.text; // create the html element\n\n var box = document.createElement('button');\n box.type = 'button';\n box.className = 'jsoneditor-modes jsoneditor-separator';\n box.innerHTML = currentTitle + ' ▾';\n box.title = Object(_i18n__WEBPACK_IMPORTED_MODULE_1__[\n /* translate */\n \"c\"])('modeEditorTitle');\n\n box.onclick = function () {\n var menu = new _ContextMenu__WEBPACK_IMPORTED_MODULE_0__[\n /* ContextMenu */\n \"a\"](items);\n menu.show(box, container);\n };\n\n var frame = document.createElement('div');\n frame.className = 'jsoneditor-modes';\n frame.style.position = 'relative';\n frame.appendChild(box);\n container.appendChild(frame);\n this.dom = {\n container: container,\n box: box,\n frame: frame\n };\n }\n /**\n * Set focus to switcher\n */\n\n\n _createClass(ModeSwitcher, [{\n key: \"focus\",\n value: function focus() {\n this.dom.box.focus();\n }\n /**\n * Destroy the ModeSwitcher, remove from DOM\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n if (this.dom && this.dom.frame && this.dom.frame.parentNode) {\n this.dom.frame.parentNode.removeChild(this.dom.frame);\n }\n\n this.dom = null;\n }\n }]);\n\n return ModeSwitcher;\n }();\n /***/\n\n },\n /* 7 */\n\n /***/\n function (module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n /* harmony export (binding) */\n\n __webpack_require__.d(__webpack_exports__, \"a\", function () {\n return FocusTracker;\n });\n /**\n * @constructor FocusTracker\n * A custom focus tracker for a DOM element with complex internal DOM structure\n * @param {[Object]} config A set of configurations for the FocusTracker\n * {DOM Object} target * The DOM object to track (required)\n * {Function} onFocus onFocus callback\n * {Function} onBlur onBlur callback\n *\n * @return\n */\n\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n var FocusTracker =\n /*#__PURE__*/\n function () {\n function FocusTracker(config) {\n _classCallCheck(this, FocusTracker);\n\n this.target = config.target || null;\n\n if (!this.target) {\n throw new Error('FocusTracker constructor called without a \"target\" to track.');\n }\n\n this.onFocus = typeof config.onFocus === 'function' ? config.onFocus : null;\n this.onBlur = typeof config.onBlur === 'function' ? config.onBlur : null;\n this._onClick = this._onEvent.bind(this);\n\n this._onKeyUp = function (event) {\n if (event.which === 9 || event.keyCode === 9) {\n this._onEvent(event);\n }\n }.bind(this);\n\n this.focusFlag = false;\n this.firstEventFlag = true;\n /*\n Adds required (click and keyup) event listeners to the 'document' object\n to track the focus of the given 'target'\n */\n\n if (this.onFocus || this.onBlur) {\n document.addEventListener('click', this._onClick);\n document.addEventListener('keyup', this._onKeyUp);\n }\n }\n /**\n * Removes the event listeners on the 'document' object\n * that were added to track the focus of the given 'target'\n */\n\n\n _createClass(FocusTracker, [{\n key: \"destroy\",\n value: function destroy() {\n document.removeEventListener('click', this._onClick);\n document.removeEventListener('keyup', this._onKeyUp);\n\n this._onEvent({\n target: document.body\n }); // calling _onEvent with body element in the hope that the FocusTracker is added to an element inside the body tag\n\n }\n /**\n * Tracks the focus of the target and calls the onFocus and onBlur\n * event callbacks if available.\n * @param {Event} [event] The 'click' or 'keyup' event object,\n * from the respective events set on\n * document object\n * @private\n */\n\n }, {\n key: \"_onEvent\",\n value: function _onEvent(event) {\n var target = event.target;\n var focusFlag;\n\n if (target === this.target) {\n focusFlag = true;\n } else if (this.target.contains(target) || this.target.contains(document.activeElement)) {\n focusFlag = true;\n } else {\n focusFlag = false;\n }\n\n if (focusFlag) {\n if (!this.focusFlag) {\n // trigger the onFocus callback\n if (this.onFocus) {\n this.onFocus({\n type: 'focus',\n target: this.target\n });\n }\n\n this.focusFlag = true;\n }\n } else {\n if (this.focusFlag || this.firstEventFlag) {\n // trigger the onBlur callback\n if (this.onBlur) {\n this.onBlur({\n type: 'blur',\n target: this.target\n });\n }\n\n this.focusFlag = false;\n /*\n When switching from one mode to another in the editor, the FocusTracker gets recreated.\n At that time, this.focusFlag will be init to 'false' and will fail the above if condition, when blur occurs\n this.firstEventFlag is added to overcome that issue\n */\n\n if (this.firstEventFlag) {\n this.firstEventFlag = false;\n }\n }\n }\n }\n }]);\n\n return FocusTracker;\n }();\n /***/\n\n },\n /* 8 */\n\n /***/\n function (module, __webpack_exports__, __webpack_require__) {\n \"use strict\"; // EXTERNAL MODULE: ./node_modules/jmespath/jmespath.js\n\n var jmespath = __webpack_require__(4);\n\n var jmespath_default =\n /*#__PURE__*/\n __webpack_require__.n(jmespath); // EXTERNAL MODULE: ./node_modules/picomodal/src/picoModal.js\n\n\n var picoModal = __webpack_require__(13);\n\n var picoModal_default =\n /*#__PURE__*/\n __webpack_require__.n(picoModal); // EXTERNAL MODULE: ./src/js/assets/selectr/selectr.js\n\n\n var selectr = __webpack_require__(9);\n\n var selectr_default =\n /*#__PURE__*/\n __webpack_require__.n(selectr); // EXTERNAL MODULE: ./src/js/i18n.js\n\n\n var i18n = __webpack_require__(1); // CONCATENATED MODULE: ./src/js/jsonUtils.js\n\n /**\n * Convert part of a JSON object to a JSON string.\n * Use case is to stringify a small part of a large JSON object so you can see\n * a preview.\n *\n * @param {*} value\n * The value to convert to a JSON string.\n *\n * @param {number | string | null} [space]\n * A String or Number object that's used to insert white space into the output\n * JSON string for readability purposes. If this is a Number, it indicates the\n * number of space characters to use as white space; this number is capped at 10\n * if it's larger than that. Values less than 1 indicate that no space should be\n * used. If this is a String, the string (or the first 10 characters of the string,\n * if it's longer than that) is used as white space. If this parameter is not\n * provided (or is null), no white space is used.\n *\n * @param {number} [limit] Maximum size of the string output.\n *\n * @returns {string | undefined} Returns the string representation of the JSON object.\n */\n\n\n function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function stringifyPartial(value, space, limit) {\n var _space; // undefined by default\n\n\n if (typeof space === 'number') {\n if (space > 10) {\n _space = repeat(' ', 10);\n } else if (space >= 1) {\n _space = repeat(' ', space);\n } // else ignore\n\n } else if (typeof space === 'string' && space !== '') {\n _space = space;\n }\n\n var output = stringifyValue(value, _space, '', limit);\n return output.length > limit ? slice(output, limit) + '...' : output;\n }\n /**\n * Stringify a value\n * @param {*} value\n * @param {string} space\n * @param {string} indent\n * @param {number} limit\n * @return {string | undefined}\n */\n\n\n function stringifyValue(value, space, indent, limit) {\n // boolean, null, number, string, or date\n if (typeof value === 'boolean' || value instanceof Boolean || value === null || typeof value === 'number' || value instanceof Number || typeof value === 'string' || value instanceof String || value instanceof Date) {\n return JSON.stringify(value);\n } // array\n\n\n if (Array.isArray(value)) {\n return stringifyArray(value, space, indent, limit);\n } // object (test lastly!)\n\n\n if (value && _typeof(value) === 'object') {\n return stringifyObject(value, space, indent, limit);\n }\n\n return undefined;\n }\n /**\n * Stringify an array\n * @param {Array} array\n * @param {string} space\n * @param {string} indent\n * @param {number} limit\n * @return {string}\n */\n\n\n function stringifyArray(array, space, indent, limit) {\n var childIndent = space ? indent + space : undefined;\n var str = space ? '[\\n' : '[';\n\n for (var i = 0; i < array.length; i++) {\n var item = array[i];\n\n if (space) {\n str += childIndent;\n }\n\n if (typeof item !== 'undefined' && typeof item !== 'function') {\n str += stringifyValue(item, space, childIndent, limit);\n } else {\n str += 'null';\n }\n\n if (i < array.length - 1) {\n str += space ? ',\\n' : ',';\n } // stop as soon as we're exceeding the limit\n\n\n if (str.length > limit) {\n return str + '...';\n }\n }\n\n str += space ? '\\n' + indent + ']' : ']';\n return str;\n }\n /**\n * Stringify an object\n * @param {Object} object\n * @param {string} space\n * @param {string} indent\n * @param {number} limit\n * @return {string}\n */\n\n\n function stringifyObject(object, space, indent, limit) {\n var childIndent = space ? indent + space : undefined;\n var first = true;\n var str = space ? '{\\n' : '{';\n\n if (typeof object.toJSON === 'function') {\n return stringifyValue(object.toJSON(), space, indent, limit);\n }\n\n for (var key in object) {\n if (jsonUtils_hasOwnProperty(object, key)) {\n var value = object[key];\n\n if (first) {\n first = false;\n } else {\n str += space ? ',\\n' : ',';\n }\n\n str += space ? childIndent + '\"' + key + '\": ' : '\"' + key + '\":';\n str += stringifyValue(value, space, childIndent, limit); // stop as soon as we're exceeding the limit\n\n if (str.length > limit) {\n return str + '...';\n }\n }\n }\n\n str += space ? '\\n' + indent + '}' : '}';\n return str;\n }\n /**\n * Repeat a string a number of times.\n * Simple linear solution, we only need up to 10 iterations in practice\n * @param {string} text\n * @param {number} times\n * @return {string}\n */\n\n\n function repeat(text, times) {\n var res = '';\n\n while (times-- > 0) {\n res += text;\n }\n\n return res;\n }\n /**\n * Limit the length of text\n * @param {string} text\n * @param {number} [limit]\n * @return {string}\n */\n\n\n function slice(text, limit) {\n return typeof limit === 'number' ? text.slice(0, limit) : text;\n }\n /**\n * Test whether some text contains a JSON array, i.e. the first\n * non-white space character is a [\n * @param {string} jsonText\n * @return {boolean}\n */\n\n\n function containsArray(jsonText) {\n return /^\\s*\\[/.test(jsonText);\n }\n\n function jsonUtils_hasOwnProperty(object, key) {\n return Object.prototype.hasOwnProperty.call(object, key);\n } // EXTERNAL MODULE: ./src/js/util.js\n\n\n var util = __webpack_require__(0); // EXTERNAL MODULE: ./src/js/constants.js\n\n\n var constants = __webpack_require__(2); // CONCATENATED MODULE: ./src/js/showTransformModal.js\n\n /* harmony export (binding) */\n\n\n __webpack_require__.d(__webpack_exports__, \"a\", function () {\n return showTransformModal;\n });\n /**\n * Show advanced filter and transform modal using JMESPath\n * @param {HTMLElement} container The container where to center\n * the modal and create an overlay\n * @param {JSON} json The json data to be transformed\n * @param {function} onTransform Callback invoked with the created\n * query as callback\n */\n\n\n function showTransformModal(container, json, onTransform) {\n var value = json;\n var content = '' + '' + '' + 'Enter a JMESPath query to filter, sort, or transform the JSON data. ' + 'To learn JMESPath, go to the interactive tutorial .' + '
' + '' + Object(i18n[\"c\"\n /* translate */\n ])('transformWizardLabel') + '
' + '' + '
' + ' ' + ' ' + ' ' + Object(i18n[\"c\"\n /* translate */\n ])('transformWizardFilter') + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + ' ' + ' ' + ' == ' + ' != ' + ' < ' + ' <= ' + ' \">> ' + ' =\">>= ' + ' ' + '
' + ' ' + ' ' + '
' + ' ' + ' ' + ' ' + ' ' + Object(i18n[\"c\"\n /* translate */\n ])('transformWizardSortBy') + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + ' ' + ' ' + ' Ascending ' + ' Descending ' + ' ' + '
' + ' ' + ' ' + ' ' + ' ' + Object(i18n[\"c\"\n /* translate */\n ])('transformWizardSelectFields') + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + '
' + '' + Object(i18n[\"c\"\n /* translate */\n ])('transformQueryLabel') + '
' + '' + ' ' + '
' + '' + Object(i18n[\"c\"\n /* translate */\n ])('transformPreviewLabel') + '
' + '' + ' ' + '
' + '' + ' ' + '
' + '