From 62a899ff9e8436e9e869746beb306f56d61a8639 Mon Sep 17 00:00:00 2001 From: Zachary Huff Date: Sun, 20 Oct 2024 05:38:49 -0400 Subject: [PATCH] Update dist --- www/dist-dev/static/app.js | 164 ++------------ www/dist-dev/static/global.css | 5 + www/dist/index.html | 2 +- www/dist/static/app.4fc09b.js | 356 ------------------------------ www/dist/static/app.4fc09b.js.map | 1 - www/dist/static/app.dc9415.js | 348 +++++++++++++++++++++++++++++ www/dist/static/app.dc9415.js.map | 1 + www/dist/static/global.css | 5 + 8 files changed, 380 insertions(+), 502 deletions(-) delete mode 100644 www/dist/static/app.4fc09b.js delete mode 100644 www/dist/static/app.4fc09b.js.map create mode 100644 www/dist/static/app.dc9415.js create mode 100644 www/dist/static/app.dc9415.js.map diff --git a/www/dist-dev/static/app.js b/www/dist-dev/static/app.js index 44bc0358..4d224578 100644 --- a/www/dist-dev/static/app.js +++ b/www/dist-dev/static/app.js @@ -3042,7 +3042,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addChangeListener: () => (/* binding */ addChangeListener),\n/* harmony export */ chartColor1: () => (/* binding */ chartColor1),\n/* harmony export */ chartColor2: () => (/* binding */ chartColor2),\n/* harmony export */ chartColor3: () => (/* binding */ chartColor3),\n/* harmony export */ dark: () => (/* binding */ dark),\n/* harmony export */ editorThemeNames: () => (/* binding */ editorThemeNames),\n/* harmony export */ getEditorTheme: () => (/* binding */ getEditorTheme),\n/* harmony export */ light: () => (/* binding */ light),\n/* harmony export */ monospaceFont: () => (/* binding */ monospaceFont),\n/* harmony export */ monospaceSize: () => (/* binding */ monospaceSize),\n/* harmony export */ removeChangeListener: () => (/* binding */ removeChangeListener),\n/* harmony export */ save: () => (/* binding */ save),\n/* harmony export */ setEditorTheme: () => (/* binding */ setEditorTheme),\n/* harmony export */ theme: () => (/* binding */ theme),\n/* harmony export */ themeVer: () => (/* binding */ themeVer),\n/* harmony export */ themeVer3: () => (/* binding */ themeVer3),\n/* harmony export */ themeVer5: () => (/* binding */ themeVer5),\n/* harmony export */ toggle: () => (/* binding */ toggle)\n/* harmony export */ });\n/* harmony import */ var superagent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! superagent */ \"./node_modules/superagent/lib/client.js\");\n/* harmony import */ var superagent__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(superagent__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Alert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Alert */ \"./app/Alert.js\");\n/* harmony import */ var _Csrf__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Csrf */ \"./app/Csrf.js\");\n/* harmony import */ var _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/MiscUtils */ \"./app/utils/MiscUtils.js\");\n/* harmony import */ var _EditorThemes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./EditorThemes */ \"./app/EditorThemes.js\");\n/* harmony import */ var _monaco_editor_loader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @monaco-editor/loader */ \"./node_modules/@monaco-editor/loader/lib/es/index.js\");\n\n\n\n\n\n\nlet callbacks = new Set();\nlet theme = 'dark';\nlet themeVer = 3;\nlet editorThemeName = '';\nconst monospaceSize = \"12px\";\nconst monospaceFont = \"Consolas, Menlo, 'Roboto Mono', 'DejaVu Sans Mono'\";\nfunction save() {\n return new Promise((resolve, reject) => {\n superagent__WEBPACK_IMPORTED_MODULE_0__.put('/theme')\n .send({\n theme: theme,\n editor_theme: editorThemeName,\n })\n .set('Accept', 'application/json')\n .set('Csrf-Token', _Csrf__WEBPACK_IMPORTED_MODULE_2__.token)\n .end((err, res) => {\n if (res && res.status === 401) {\n window.location.href = '/login';\n resolve();\n return;\n }\n if (err) {\n _Alert__WEBPACK_IMPORTED_MODULE_1__.errorRes(res, 'Failed to save theme');\n reject(err);\n return;\n }\n resolve();\n });\n });\n}\nfunction themeVer3() {\n const blueprintTheme3 = document.getElementById(\"blueprint3-theme\");\n const blueprintTheme5 = document.getElementById(\"blueprint5-theme\");\n blueprintTheme3.disabled = false;\n blueprintTheme5.disabled = true;\n themeVer = 3;\n}\nfunction themeVer5() {\n const blueprintTheme3 = document.getElementById(\"blueprint3-theme\");\n const blueprintTheme5 = document.getElementById(\"blueprint5-theme\");\n blueprintTheme3.disabled = true;\n blueprintTheme5.disabled = false;\n themeVer = 5;\n}\nfunction light() {\n theme = 'light';\n document.body.className = '';\n callbacks.forEach((callback) => {\n callback();\n });\n}\nfunction dark() {\n theme = 'dark';\n document.body.className = 'bp5-dark';\n callbacks.forEach((callback) => {\n callback();\n });\n}\nfunction toggle() {\n if (theme === \"dark\" && themeVer === 3) {\n light();\n }\n else if (theme === \"light\" && themeVer === 3) {\n dark();\n themeVer5();\n }\n else if (theme === \"dark\" && themeVer === 5) {\n light();\n }\n else if (theme === \"light\" && themeVer === 5) {\n dark();\n themeVer3();\n }\n}\nfunction getEditorTheme() {\n if (!editorThemeName) {\n if (theme === \"light\") {\n return \"github-light\";\n }\n else {\n return \"github-dark\";\n }\n }\n return editorThemeName;\n}\nfunction setEditorTheme(name) {\n editorThemeName = name;\n callbacks.forEach((callback) => {\n callback();\n });\n}\nfunction chartColor1() {\n if (theme === \"light\") {\n return 'rgba(0, 0, 0, 0.9)';\n }\n else {\n return 'rgba(255, 255, 255, 1)';\n }\n}\nfunction chartColor2() {\n if (theme === \"light\") {\n return 'rgba(0, 0, 0, 0.2)';\n }\n else {\n return 'rgba(255, 255, 255, 0.2)';\n }\n}\nfunction chartColor3() {\n if (theme === \"light\") {\n return '#6f6f6f';\n }\n else {\n return '#e5e5e5';\n }\n}\nfunction addChangeListener(callback) {\n callbacks.add(callback);\n}\nfunction removeChangeListener(callback) {\n callbacks.delete(callback);\n}\nlet editorThemeNames = {};\n_monaco_editor_loader__WEBPACK_IMPORTED_MODULE_5__[\"default\"].config({\n paths: {\n vs: \"./static/vs\",\n },\n});\n_monaco_editor_loader__WEBPACK_IMPORTED_MODULE_5__[\"default\"].init().then((monaco) => {\n for (let themeName in _EditorThemes__WEBPACK_IMPORTED_MODULE_4__.editorThemes) {\n let editorTheme = _EditorThemes__WEBPACK_IMPORTED_MODULE_4__.editorThemes[themeName];\n monaco.editor.defineTheme(themeName, editorTheme);\n let formattedThemeName = _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.titleCase(themeName.replace(\"-\", \" \"));\n editorThemeNames[themeName] = formattedThemeName;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvVGhlbWUuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUN5QztBQUNSO0FBQ0Y7QUFDZ0I7QUFDQTtBQUVMO0FBTTFDLElBQUksU0FBUyxHQUFrQixJQUFJLEdBQUcsRUFBWSxDQUFDO0FBQzVDLElBQUksS0FBSyxHQUFHLE1BQU0sQ0FBQztBQUNuQixJQUFJLFFBQVEsR0FBRyxDQUFDLENBQUM7QUFDeEIsSUFBSSxlQUFlLEdBQUcsRUFBRSxDQUFDO0FBQ2xCLE1BQU0sYUFBYSxHQUFHLE1BQU07QUFDNUIsTUFBTSxhQUFhLEdBQUcsb0RBQW9EO0FBRTFFLFNBQVMsSUFBSTtJQUNuQixPQUFPLElBQUksT0FBTyxDQUFPLENBQUMsT0FBTyxFQUFFLE1BQU0sRUFBUSxFQUFFO1FBQ2xELDJDQUNLLENBQUMsUUFBUSxDQUFDO2FBQ2IsSUFBSSxDQUFDO1lBQ0wsS0FBSyxFQUFFLEtBQUs7WUFDUixZQUFZLEVBQUUsZUFBZTtT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G4gICAgbW9uYWNvLmVkaXRvci5kZWZpbmVUaGVtZSh0aGVtZU5hbWUsIGVkaXRvclRoZW1lKVxuXG4gICAgbGV0IGZvcm1hdHRlZFRoZW1lTmFtZSA9IE1pc2NVdGlscy50aXRsZUNhc2UodGhlbWVOYW1lLnJlcGxhY2UoXCItXCIsIFwiIFwiKSlcbiAgICBlZGl0b3JUaGVtZU5hbWVzW3RoZW1lTmFtZV0gPSBmb3JtYXR0ZWRUaGVtZU5hbWVcbiAgfVxufSlcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./app/Theme.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addChangeListener: () => (/* binding */ addChangeListener),\n/* harmony export */ chartColor1: () => (/* binding */ chartColor1),\n/* harmony export */ chartColor2: () => (/* binding */ chartColor2),\n/* harmony export */ chartColor3: () => (/* binding */ chartColor3),\n/* harmony export */ dark: () => (/* binding */ dark),\n/* harmony export */ editorThemeNames: () => (/* binding */ editorThemeNames),\n/* harmony export */ getEditorTheme: () => (/* binding */ getEditorTheme),\n/* harmony export */ light: () => (/* binding */ light),\n/* harmony export */ monospaceFont: () => (/* binding */ monospaceFont),\n/* harmony export */ monospaceSize: () => (/* binding */ monospaceSize),\n/* harmony export */ monospaceWeight: () => (/* binding */ monospaceWeight),\n/* harmony export */ removeChangeListener: () => (/* binding */ removeChangeListener),\n/* harmony export */ save: () => (/* binding */ save),\n/* harmony export */ setEditorTheme: () => (/* binding */ setEditorTheme),\n/* harmony export */ theme: () => (/* binding */ theme),\n/* harmony export */ themeVer: () => (/* binding */ themeVer),\n/* harmony export */ themeVer3: () => (/* binding */ themeVer3),\n/* harmony export */ themeVer5: () => (/* binding */ themeVer5),\n/* harmony export */ toggle: () => (/* binding */ toggle)\n/* harmony export */ });\n/* harmony import */ var superagent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! superagent */ \"./node_modules/superagent/lib/client.js\");\n/* harmony import */ var superagent__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(superagent__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Alert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Alert */ \"./app/Alert.js\");\n/* harmony import */ var _Csrf__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Csrf */ \"./app/Csrf.js\");\n/* harmony import */ var _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/MiscUtils */ \"./app/utils/MiscUtils.js\");\n/* harmony import */ var _EditorThemes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./EditorThemes */ \"./app/EditorThemes.js\");\n/* harmony import */ var _monaco_editor_loader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @monaco-editor/loader */ \"./node_modules/@monaco-editor/loader/lib/es/index.js\");\n\n\n\n\n\n\nlet callbacks = new Set();\nlet theme = 'dark';\nlet themeVer = 3;\nlet editorThemeName = '';\nconst monospaceSize = \"12px\";\nconst monospaceFont = \"Consolas, Menlo, 'Roboto Mono', 'DejaVu Sans Mono'\";\nconst monospaceWeight = \"500\";\nfunction save() {\n return new Promise((resolve, reject) => {\n superagent__WEBPACK_IMPORTED_MODULE_0__.put('/theme')\n .send({\n theme: theme + `-${themeVer}`,\n editor_theme: editorThemeName,\n })\n .set('Accept', 'application/json')\n .set('Csrf-Token', _Csrf__WEBPACK_IMPORTED_MODULE_2__.token)\n .end((err, res) => {\n if (res && res.status === 401) {\n window.location.href = '/login';\n resolve();\n return;\n }\n if (err) {\n _Alert__WEBPACK_IMPORTED_MODULE_1__.errorRes(res, 'Failed to save theme');\n reject(err);\n return;\n }\n resolve();\n });\n });\n}\nfunction themeVer3() {\n const blueprintTheme3 = document.getElementById(\"blueprint3-theme\");\n const blueprintTheme5 = document.getElementById(\"blueprint5-theme\");\n blueprintTheme3.disabled = false;\n blueprintTheme5.disabled = true;\n themeVer = 3;\n}\nfunction themeVer5() {\n const blueprintTheme3 = document.getElementById(\"blueprint3-theme\");\n const blueprintTheme5 = document.getElementById(\"blueprint5-theme\");\n blueprintTheme3.disabled = true;\n blueprintTheme5.disabled = false;\n themeVer = 5;\n}\nfunction light() {\n theme = 'light';\n document.body.className = '';\n callbacks.forEach((callback) => {\n callback();\n });\n}\nfunction dark() {\n theme = 'dark';\n document.body.className = 'bp5-dark';\n callbacks.forEach((callback) => {\n callback();\n });\n}\nfunction toggle() {\n if (theme === \"dark\" && themeVer === 3) {\n light();\n }\n else if (theme === \"light\" && themeVer === 3) {\n dark();\n themeVer5();\n }\n else if (theme === \"dark\" && themeVer === 5) {\n light();\n }\n else if (theme === \"light\" && themeVer === 5) {\n dark();\n themeVer3();\n }\n}\nfunction getEditorTheme() {\n if (!editorThemeName) {\n if (theme === \"light\") {\n return \"github-light\";\n }\n else {\n return \"github-dark\";\n }\n }\n return editorThemeName;\n}\nfunction setEditorTheme(name) {\n editorThemeName = name;\n callbacks.forEach((callback) => {\n callback();\n });\n}\nfunction chartColor1() {\n if (theme === \"light\") {\n return 'rgba(0, 0, 0, 0.9)';\n }\n else {\n return 'rgba(255, 255, 255, 1)';\n }\n}\nfunction chartColor2() {\n if (theme === \"light\") {\n return 'rgba(0, 0, 0, 0.2)';\n }\n else {\n return 'rgba(255, 255, 255, 0.2)';\n }\n}\nfunction chartColor3() {\n if (theme === \"light\") {\n return '#6f6f6f';\n }\n else {\n return '#e5e5e5';\n }\n}\nfunction addChangeListener(callback) {\n callbacks.add(callback);\n}\nfunction removeChangeListener(callback) {\n callbacks.delete(callback);\n}\nlet editorThemeNames = {};\n_monaco_editor_loader__WEBPACK_IMPORTED_MODULE_5__[\"default\"].config({\n paths: {\n vs: \"./static/vs\",\n },\n});\n_monaco_editor_loader__WEBPACK_IMPORTED_MODULE_5__[\"default\"].init().then((monaco) => {\n for (let themeName in _EditorThemes__WEBPACK_IMPORTED_MODULE_4__.editorThemes) {\n let editorTheme = _EditorThemes__WEBPACK_IMPORTED_MODULE_4__.editorThemes[themeName];\n monaco.editor.defineTheme(themeName, editorTheme);\n let formattedThemeName = _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.titleCase(themeName.replace(\"-\", \" \"));\n editorThemeNames[themeName] = formattedThemeName;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvVGhlbWUuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFDeUM7QUFDUjtBQUNGO0FBQ2dCO0FBQ0E7QUFFTDtBQU0xQyxJQUFJLFNBQVMsR0FBa0IsSUFBSSxHQUFHLEVBQVksQ0FBQztBQUM1QyxJQUFJLEtBQUssR0FBRyxNQUFNLENBQUM7QUFDbkIsSUFBSSxRQUFRLEdBQUcsQ0FBQyxDQUFDO0FBQ3hCLElBQUksZUFBZSxHQUFHLEVBQUUsQ0FBQztBQUNsQixNQUFNLGFBQWEsR0FBRyxNQUFNO0FBQzVCLE1BQU0sYUFBYSxHQUFHLG9EQUFvRDtBQUMxRSxNQUFNLGVBQWUsR0FBRyxLQUFLO0FBRTdCLFNBQVMsSUFBSTtJQUNuQixPQUFPLElBQUksT0FBTyxDQUFPLENBQUMsT0FBTyxFQUFFLE1BQU0sRUFBUSxFQUFFO1FBQ2xELDJDQUNLLENBQUMsUUFBUSxDQUFDO2FBQ2IsSUFBSSxDQUFDO1lBQ0wsS0FBSyxFQUFFLEtBQUssR0FBRyxJQUFJLFFBQVEsRUFBRTtZQUN2QixZQUFZLEVBQUUsZUFBZTtTQUNuQyxDQUFDO2FBQ0QsR0FBRyxDQUFDLFFBQVEsRUFBRSxrQkFBa0IsQ0FBQzthQUNqQyxHQUFHLENBQUMsWUFBWSxFQUFFLHdDQUFVLENBQUM7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CBlZGl0b3JUaGVtZSlcblxuICAgIGxldCBmb3JtYXR0ZWRUaGVtZU5hbWUgPSBNaXNjVXRpbHMudGl0bGVDYXNlKHRoZW1lTmFtZS5yZXBsYWNlKFwiLVwiLCBcIiBcIikpXG4gICAgZWRpdG9yVGhlbWVOYW1lc1t0aGVtZU5hbWVdID0gZm9ybWF0dGVkVGhlbWVOYW1lXG4gIH1cbn0pXG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./app/Theme.js\n"); /***/ }), @@ -3350,7 +3350,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AuthorityDeploy)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _blueprintjs_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @blueprintjs/core */ \"./node_modules/@blueprintjs/core/lib/esm/components/dialog/dialog.js\");\n/* harmony import */ var _Help__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Help */ \"./app/components/Help.js\");\n/* harmony import */ var _PageInput__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PageInput */ \"./app/components/PageInput.js\");\n/* harmony import */ var _PageInputButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PageInputButton */ \"./app/components/PageInputButton.js\");\n/* harmony import */ var _PageSwitch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PageSwitch */ \"./app/components/PageSwitch.js\");\n/* harmony import */ var _PageSelect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PageSelect */ \"./app/components/PageSelect.js\");\n/* harmony import */ var _Theme__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Theme */ \"./app/Theme.js\");\n\n\n\n\n\n\n\n\nconst css = {\n box: {\n marginBottom: '15px',\n },\n button: {},\n item: {\n margin: '9px 5px 0 5px',\n height: '20px',\n },\n callout: {\n marginBottom: '15px',\n },\n popover: {\n width: '230px',\n },\n popoverTarget: {\n top: '9px',\n left: '18px',\n },\n dialog: {\n maxWidth: '480px',\n margin: '30px 20px',\n },\n textarea: {\n width: '100%',\n resize: 'none',\n fontSize: _Theme__WEBPACK_IMPORTED_MODULE_6__.monospaceSize,\n fontFamily: _Theme__WEBPACK_IMPORTED_MODULE_6__.monospaceFont,\n },\n};\nclass AuthorityDeploy extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props, context) {\n super(props, context);\n this.onAddRole = () => {\n let roles = [\n ...this.state.roles,\n ];\n if (!this.state.addRole) {\n return;\n }\n if (roles.indexOf(this.state.addRole) === -1) {\n roles.push(this.state.addRole);\n }\n roles.sort();\n this.setState({\n ...this.state,\n addRole: '',\n roles: roles,\n });\n };\n this.state = {\n popover: false,\n route53: false,\n awsAccessKey: '',\n awsSecretKey: '',\n hostCertificate: null,\n hostname: '',\n server: null,\n addRole: '',\n roles: [],\n };\n }\n onRemoveRole(role) {\n let roles = [\n ...this.state.roles,\n ];\n let i = roles.indexOf(role);\n if (i === -1) {\n return;\n }\n roles.splice(i, 1);\n this.setState({\n ...this.state,\n addRole: '',\n roles: roles,\n });\n }\n render() {\n let popoverElem;\n if (this.state.popover) {\n let content = '';\n let callout = 'Use the startup script below to provision a ' +\n 'Pritunl Zero host.';\n let errorMsg = '';\n let errorMsgElem;\n let hostCertificate = this.state.hostCertificate;\n let hostCertificateDisabled = false;\n if (hostCertificate === null) {\n hostCertificate = this.props.authority.host_certificates;\n }\n let servers = new Set();\n let serverDefault = null;\n let serversElm = [];\n if (this.props.nodes) {\n for (let node of this.props.nodes) {\n if (node.user_domain) {\n servers.add(node.user_domain);\n }\n }\n }\n if (!this.props.authority.host_tokens.length || servers.size === 0) {\n hostCertificate = false;\n hostCertificateDisabled = true;\n }\n servers.forEach((server) => {\n if (!serverDefault) {\n serverDefault = server;\n }\n serversElm.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: server }, server));\n });\n if (servers.size === 1) {\n serversElm = [];\n }\n let bastionUsername = '';\n let bastionHostname = '';\n if (this.props.proxy) {\n let bastionSplit = this.props.authority.host_proxy.split('@');\n if (bastionSplit.length === 2) {\n bastionUsername = this.props.authority.host_proxy.split('@')[0];\n if (bastionSplit[1].indexOf(this.props.authority.host_domain) !== -1) {\n bastionHostname = bastionSplit[1].replace('.' + this.props.authority.host_domain, '');\n }\n }\n if (!bastionUsername) {\n errorMsg = 'Bastion host is missing username.';\n }\n else if (!bastionHostname) {\n errorMsg = 'Bastion hostname is not a subdomain of host domain.';\n }\n }\n let epel = '';\n let boto = '';\n let route53 = '';\n if (this.state.route53 && hostCertificate) {\n epel = '\\nsudo yum -y install epel-release || ' +\n 'sudo rpm -Uvh https://dl.fedoraproject.org/' +\n 'pub/epel/epel-release-latest-7.noarch.rpm';\n boto = ' python2-boto3 python27-boto3';\n if (this.state.awsAccessKey) {\n route53 += '\\nsudo pritunl-ssh-host config aws-access-key ' +\n this.state.awsAccessKey;\n }\n if (this.state.awsSecretKey) {\n route53 += '\\nsudo pritunl-ssh-host config aws-secret-key ' +\n this.state.awsSecretKey;\n }\n route53 += '\\nsudo pritunl-ssh-host config route-53-zone ' +\n this.props.authority.host_domain;\n }\n let roles = [];\n for (let role of this.state.roles) {\n roles.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-tag bp5-tag-removable bp5-intent-primary\", style: css.item, key: role },\n role,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-tag-remove\", onMouseUp: () => {\n this.onRemoveRole(role);\n } })));\n }\n if (this.props.proxy) {\n callout = 'Open port 9748 and use the startup script below to ' +\n 'provision a Pritunl Zero host. Provisioning may take several ' +\n 'minutes if the servers DNS record was created recently.';\n content = `#!/bin/bash\nsudo sed -i '/^TrustedUserCAKeys/d' /etc/ssh/sshd_config\nsudo sed -i '/^AuthorizedPrincipalsFile/d' /etc/ssh/sshd_config\nsudo tee -a /etc/ssh/sshd_config << EOF\n\nMatch User ${bastionUsername}\n\tAllowAgentForwarding no\n\tAllowTcpForwarding yes\n\tPermitOpen *:22\n\tGatewayPorts no\n\tX11Forwarding no\n\tPermitTunnel no\n\tForceCommand echo 'Pritunl Zero Bastion Host'\n\tTrustedUserCAKeys /etc/ssh/trusted\n\tAuthorizedPrincipalsFile /etc/ssh/principals\nMatch all\nEOF\nsudo tee /etc/ssh/principals << EOF\nbastion\nEOF\nsudo tee /etc/ssh/trusted << EOF\n${this.props.authority.public_key}\nEOF\n\nsudo tee -a /etc/yum.repos.d/pritunl.repo << EOF\n[pritunl]\nname=Pritunl Repository\nbaseurl=https://repo.pritunl.com/stable/yum/centos/7/\ngpgcheck=1\nenabled=1\nEOF\n\ngpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A\ngpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A > key.tmp\nsudo rpm --import key.tmp\nrm -f key.tmp${epel}\nsudo yum -y install pritunl-ssh-host${boto}\n${route53}\nsudo pritunl-ssh-host config add-token ${this.props.authority.host_tokens.length ?\n this.props.authority.host_tokens[0] : 'HOST_TOKEN_UNAVAILABLE'}\nsudo pritunl-ssh-host config hostname ${bastionHostname}\nsudo pritunl-ssh-host config server ${this.state.server || serverDefault}\nsudo useradd ${bastionUsername} || true\n\nsudo systemctl restart sshd || true\nsudo service sshd restart || true`;\n }\n else if (hostCertificate) {\n callout = 'Open port 9748 and use the startup script below to ' +\n 'provision a Pritunl Zero host. Provisioning may take several ' +\n 'minutes if the servers DNS record was created recently.';\n content = `#!/bin/bash\nsudo sed -i '/^TrustedUserCAKeys/d' /etc/ssh/sshd_config\nsudo sed -i '/^AuthorizedPrincipalsFile/d' /etc/ssh/sshd_config\nsudo tee -a /etc/ssh/sshd_config << EOF\n\nTrustedUserCAKeys /etc/ssh/trusted\nAuthorizedPrincipalsFile /etc/ssh/principals\nEOF\nsudo tee /etc/ssh/principals << EOF\nemergency\n${this.state.roles.length ? this.state.roles.join('\\n') + '\\n' : ''}EOF\nsudo tee /etc/ssh/trusted << EOF\n${this.props.authority.public_key}\nEOF\n\nsudo tee -a /etc/yum.repos.d/pritunl.repo << EOF\n[pritunl]\nname=Pritunl Repository\nbaseurl=https://repo.pritunl.com/stable/yum/centos/7/\ngpgcheck=1\nenabled=1\nEOF\n\ngpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A\ngpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A > key.tmp\nsudo rpm --import key.tmp\nrm -f key.tmp${epel}\nsudo yum -y install pritunl-ssh-host${boto}\n${route53}\nsudo pritunl-ssh-host config add-token ${this.props.authority.host_tokens.length ?\n this.props.authority.host_tokens[0] : 'HOST_TOKEN_UNAVAILABLE'}\nsudo pritunl-ssh-host config hostname ${this.state.hostname}\nsudo pritunl-ssh-host config server ${this.state.server || serverDefault}\n\nsudo systemctl restart sshd || true\nsudo service sshd restart || true`;\n }\n else {\n content = `#!/bin/bash\nsudo sed -i '/^TrustedUserCAKeys/d' /etc/ssh/sshd_config\nsudo sed -i '/^AuthorizedPrincipalsFile/d' /etc/ssh/sshd_config\nsudo tee -a /etc/ssh/sshd_config << EOF\n\nTrustedUserCAKeys /etc/ssh/trusted\nAuthorizedPrincipalsFile /etc/ssh/principals\nEOF\nsudo tee /etc/ssh/principals << EOF\nemergency\n${this.state.roles.length ? this.state.roles.join('\\n') + '\\n' : ''}EOF\nsudo tee /etc/ssh/trusted << EOF\n${this.props.authority.public_key}\nEOF\n\nsudo systemctl restart sshd || true\nsudo service sshd restart || true`;\n }\n if (errorMsg) {\n errorMsgElem = react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-dialog-body\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-callout bp5-intent-danger bp5-icon-ban-circle\", style: css.callout }, errorMsg));\n }\n let title = '';\n if (this.props.proxy) {\n title = 'Generate Bastion Deploy Script';\n }\n else {\n title = 'Generate Deploy Script';\n }\n popoverElem = react__WEBPACK_IMPORTED_MODULE_0__.createElement(_blueprintjs_core__WEBPACK_IMPORTED_MODULE_7__.Dialog, { title: title, style: css.dialog, isOpen: this.state.popover, usePortal: true, portalContainer: document.body, onClose: () => {\n this.setState({\n ...this.state,\n popover: false,\n });\n } },\n errorMsgElem,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-dialog-body\", hidden: !!errorMsgElem },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-callout bp5-intent-primary bp5-icon-info-sign\", style: css.callout }, callout),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageSwitch__WEBPACK_IMPORTED_MODULE_4__[\"default\"], { label: \"Host certificate\", hidden: !this.props.authority.host_certificates ||\n this.props.proxy, disabled: hostCertificateDisabled, help: \"Provision a host certificate to this server, requires installing Pritunl Zero host client. Authority must have at least one host token and at least one node must have a user domain.\", checked: hostCertificate, onToggle: () => {\n this.setState({\n ...this.state,\n hostCertificate: !hostCertificate,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageSelect__WEBPACK_IMPORTED_MODULE_5__[\"default\"], { hidden: !hostCertificate || serversElm.length === 0 ||\n this.props.proxy, label: \"Pritunl Zero Server\", help: \"The Pritunl Zero server hostname that the client will authenticate from.\", value: this.state.server || serverDefault, onChange: (val) => {\n this.setState({\n ...this.state,\n server: val,\n });\n } }, serversElm),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_2__[\"default\"], { label: \"Server Hostname\", hidden: !hostCertificate || this.props.proxy, help: \"Hostname portion of the server domain. The Pritunl Zero server must be able to resolve the server using this hostname to provision the host certificate. The hostname will be combined with the authority domain to form the servers domain.\", type: \"text\", placeholder: \"Server hostname\", value: this.state.hostname, onChange: (val) => {\n this.setState({\n ...this.state,\n hostname: val,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageSwitch__WEBPACK_IMPORTED_MODULE_4__[\"default\"], { label: \"Auto Route53 configuration\", hidden: !hostCertificate, help: \"Automatically update a Route53 record for this servers hostname. The authority domain must be hosted in Route53.\", checked: this.state.route53, onToggle: () => {\n this.setState({\n ...this.state,\n route53: !this.state.route53,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_2__[\"default\"], { label: \"AWS Access Key\", hidden: !hostCertificate || !this.state.route53, help: \"AWS access key for auto Route53 configuration. Leave blank if the instance is configured with an instance role.\", type: \"text\", placeholder: \"Leave blank to use instance role\", value: this.state.awsAccessKey, onChange: (val) => {\n this.setState({\n ...this.state,\n awsAccessKey: val,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_2__[\"default\"], { label: \"AWS Secret Key\", hidden: !hostCertificate || !this.state.route53, help: \"AWS secret key for auto Route53 configuration. Leave blank if the instance is configured with an instance role.\", type: \"text\", placeholder: \"Leave blank to use instance role\", value: this.state.awsSecretKey, onChange: (val) => {\n this.setState({\n ...this.state,\n awsSecretKey: val,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"label\", { className: \"bp5-label\", hidden: this.props.proxy },\n \"Roles\",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_Help__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { title: \"Roles\", content: \"Roles associated with this server. The user must have at least one matching role to access this server.\" }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, roles)),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInputButton__WEBPACK_IMPORTED_MODULE_3__[\"default\"], { buttonClass: \"bp5-intent-success bp5-icon-add\", hidden: this.props.proxy, label: \"Add\", type: \"text\", placeholder: \"Add role\", value: this.state.addRole, onChange: (val) => {\n this.setState({\n ...this.state,\n addRole: val,\n });\n }, onSubmit: this.onAddRole }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"textarea\", { className: \"bp5-input\", style: css.textarea, readOnly: true, autoCapitalize: \"off\", spellCheck: false, rows: 18, value: content, onClick: (evt) => {\n evt.currentTarget.select();\n } })),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-dialog-footer\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-dialog-footer-actions\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button\", type: \"button\", onClick: () => {\n this.setState({\n ...this.state,\n popover: !this.state.popover,\n });\n } }, \"Close\"))));\n }\n let buttonLabel = '';\n if (this.props.proxy) {\n buttonLabel = 'Generate Bastion Deploy Script';\n }\n else {\n buttonLabel = 'Generate Deploy Script';\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { hidden: this.props.hidden, style: css.box },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-icon-cloud-upload bp5-intent-primary\", style: css.button, type: \"button\", disabled: this.props.disabled ||\n (this.props.proxy && (!this.props.authority.host_proxy ||\n !this.props.authority.host_certificates)), onClick: () => {\n this.setState({\n ...this.state,\n popover: !this.state.popover,\n });\n } }, buttonLabel),\n popoverElem);\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaW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cdH0gZWxzZSB7XG5cdFx0XHRidXR0b25MYWJlbCA9ICdHZW5lcmF0ZSBEZXBsb3kgU2NyaXB0Jztcblx0XHR9XG5cblx0XHRyZXR1cm4gPGRpdiBoaWRkZW49e3RoaXMucHJvcHMuaGlkZGVufSBzdHlsZT17Y3NzLmJveH0+XG5cdFx0XHQ8YnV0dG9uXG5cdFx0XHRcdGNsYXNzTmFtZT1cImJwNS1idXR0b24gYnA1LWljb24tY2xvdWQtdXBsb2FkIGJwNS1pbnRlbnQtcHJpbWFyeVwiXG5cdFx0XHRcdHN0eWxlPXtjc3MuYnV0dG9ufVxuXHRcdFx0XHR0eXBlPVwiYnV0dG9uXCJcblx0XHRcdFx0ZGlzYWJsZWQ9e3RoaXMucHJvcHMuZGlzYWJsZWQgfHxcblx0XHRcdFx0XHQodGhpcy5wcm9wcy5wcm94eSAmJiAoIXRoaXMucHJvcHMuYXV0aG9yaXR5Lmhvc3RfcHJveHkgfHxcblx0XHRcdFx0XHQhdGhpcy5wcm9wcy5hdXRob3JpdHkuaG9zdF9jZXJ0aWZpY2F0ZXMpKX1cblx0XHRcdFx0b25DbGljaz17KCk6IHZvaWQgPT4ge1xuXHRcdFx0XHRcdHRoaXMuc2V0U3RhdGUoe1xuXHRcdFx0XHRcdFx0Li4udGhpcy5zdGF0ZSxcblx0XHRcdFx0XHRcdHBvcG92ZXI6ICF0aGlzLnN0YXRlLnBvcG92ZXIsXG5cdFx0XHRcdFx0fSk7XG5cdFx0XHRcdH19XG5cdFx0XHQ+XG5cdFx0XHRcdHtidXR0b25MYWJlbH1cblx0XHRcdDwvYnV0dG9uPlxuXHRcdFx0e3BvcG92ZXJFbGVtfVxuXHRcdDwvZGl2Pjtcblx0fVxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./app/components/AuthorityDeploy.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AuthorityDeploy)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _blueprintjs_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @blueprintjs/core */ \"./node_modules/@blueprintjs/core/lib/esm/components/dialog/dialog.js\");\n/* harmony import */ var _Help__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Help */ \"./app/components/Help.js\");\n/* harmony import */ var _PageInput__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PageInput */ \"./app/components/PageInput.js\");\n/* harmony import */ var _PageInputButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PageInputButton */ \"./app/components/PageInputButton.js\");\n/* harmony import */ var _PageSwitch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PageSwitch */ \"./app/components/PageSwitch.js\");\n/* harmony import */ var _PageSelect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PageSelect */ \"./app/components/PageSelect.js\");\n/* harmony import */ var _Theme__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Theme */ \"./app/Theme.js\");\n\n\n\n\n\n\n\n\nconst css = {\n box: {\n marginBottom: '15px',\n },\n button: {},\n item: {\n margin: '9px 5px 0 5px',\n height: '20px',\n },\n callout: {\n marginBottom: '15px',\n },\n popover: {\n width: '230px',\n },\n popoverTarget: {\n top: '9px',\n left: '18px',\n },\n dialog: {\n maxWidth: '480px',\n margin: '30px 20px',\n },\n textarea: {\n width: '100%',\n resize: 'none',\n fontSize: _Theme__WEBPACK_IMPORTED_MODULE_6__.monospaceSize,\n fontFamily: _Theme__WEBPACK_IMPORTED_MODULE_6__.monospaceFont,\n fontWeight: _Theme__WEBPACK_IMPORTED_MODULE_6__.monospaceWeight,\n },\n};\nclass AuthorityDeploy extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props, context) {\n super(props, context);\n this.onAddRole = () => {\n let roles = [\n ...this.state.roles,\n ];\n if (!this.state.addRole) {\n return;\n }\n if (roles.indexOf(this.state.addRole) === -1) {\n roles.push(this.state.addRole);\n }\n roles.sort();\n this.setState({\n ...this.state,\n addRole: '',\n roles: roles,\n });\n };\n this.state = {\n popover: false,\n route53: false,\n awsAccessKey: '',\n awsSecretKey: '',\n hostCertificate: null,\n hostname: '',\n server: null,\n addRole: '',\n roles: [],\n };\n }\n onRemoveRole(role) {\n let roles = [\n ...this.state.roles,\n ];\n let i = roles.indexOf(role);\n if (i === -1) {\n return;\n }\n roles.splice(i, 1);\n this.setState({\n ...this.state,\n addRole: '',\n roles: roles,\n });\n }\n render() {\n let popoverElem;\n if (this.state.popover) {\n let content = '';\n let callout = 'Use the startup script below to provision a ' +\n 'Pritunl Zero host.';\n let errorMsg = '';\n let errorMsgElem;\n let hostCertificate = this.state.hostCertificate;\n let hostCertificateDisabled = false;\n if (hostCertificate === null) {\n hostCertificate = this.props.authority.host_certificates;\n }\n let servers = new Set();\n let serverDefault = null;\n let serversElm = [];\n if (this.props.nodes) {\n for (let node of this.props.nodes) {\n if (node.user_domain) {\n servers.add(node.user_domain);\n }\n }\n }\n if (!this.props.authority.host_tokens.length || servers.size === 0) {\n hostCertificate = false;\n hostCertificateDisabled = true;\n }\n servers.forEach((server) => {\n if (!serverDefault) {\n serverDefault = server;\n }\n serversElm.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: server }, server));\n });\n if (servers.size === 1) {\n serversElm = [];\n }\n let bastionUsername = '';\n let bastionHostname = '';\n if (this.props.proxy) {\n let bastionSplit = this.props.authority.host_proxy.split('@');\n if (bastionSplit.length === 2) {\n bastionUsername = this.props.authority.host_proxy.split('@')[0];\n if (bastionSplit[1].indexOf(this.props.authority.host_domain) !== -1) {\n bastionHostname = bastionSplit[1].replace('.' + this.props.authority.host_domain, '');\n }\n }\n if (!bastionUsername) {\n errorMsg = 'Bastion host is missing username.';\n }\n else if (!bastionHostname) {\n errorMsg = 'Bastion hostname is not a subdomain of host domain.';\n }\n }\n let epel = '';\n let boto = '';\n let route53 = '';\n if (this.state.route53 && hostCertificate) {\n epel = '\\nsudo yum -y install epel-release || ' +\n 'sudo rpm -Uvh https://dl.fedoraproject.org/' +\n 'pub/epel/epel-release-latest-7.noarch.rpm';\n boto = ' python2-boto3 python27-boto3';\n if (this.state.awsAccessKey) {\n route53 += '\\nsudo pritunl-ssh-host config aws-access-key ' +\n this.state.awsAccessKey;\n }\n if (this.state.awsSecretKey) {\n route53 += '\\nsudo pritunl-ssh-host config aws-secret-key ' +\n this.state.awsSecretKey;\n }\n route53 += '\\nsudo pritunl-ssh-host config route-53-zone ' +\n this.props.authority.host_domain;\n }\n let roles = [];\n for (let role of this.state.roles) {\n roles.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-tag bp5-tag-removable bp5-intent-primary\", style: css.item, key: role },\n role,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-tag-remove\", onMouseUp: () => {\n this.onRemoveRole(role);\n } })));\n }\n if (this.props.proxy) {\n callout = 'Open port 9748 and use the startup script below to ' +\n 'provision a Pritunl Zero host. Provisioning may take several ' +\n 'minutes if the servers DNS record was created recently.';\n content = `#!/bin/bash\nsudo sed -i '/^TrustedUserCAKeys/d' /etc/ssh/sshd_config\nsudo sed -i '/^AuthorizedPrincipalsFile/d' /etc/ssh/sshd_config\nsudo tee -a /etc/ssh/sshd_config << EOF\n\nMatch User ${bastionUsername}\n\tAllowAgentForwarding no\n\tAllowTcpForwarding yes\n\tPermitOpen *:22\n\tGatewayPorts no\n\tX11Forwarding no\n\tPermitTunnel no\n\tForceCommand echo 'Pritunl Zero Bastion Host'\n\tTrustedUserCAKeys /etc/ssh/trusted\n\tAuthorizedPrincipalsFile /etc/ssh/principals\nMatch all\nEOF\nsudo tee /etc/ssh/principals << EOF\nbastion\nEOF\nsudo tee /etc/ssh/trusted << EOF\n${this.props.authority.public_key}\nEOF\n\nsudo tee -a /etc/yum.repos.d/pritunl.repo << EOF\n[pritunl]\nname=Pritunl Repository\nbaseurl=https://repo.pritunl.com/stable/yum/centos/7/\ngpgcheck=1\nenabled=1\nEOF\n\ngpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A\ngpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A > key.tmp\nsudo rpm --import key.tmp\nrm -f key.tmp${epel}\nsudo yum -y install pritunl-ssh-host${boto}\n${route53}\nsudo pritunl-ssh-host config add-token ${this.props.authority.host_tokens.length ?\n this.props.authority.host_tokens[0] : 'HOST_TOKEN_UNAVAILABLE'}\nsudo pritunl-ssh-host config hostname ${bastionHostname}\nsudo pritunl-ssh-host config server ${this.state.server || serverDefault}\nsudo useradd ${bastionUsername} || true\n\nsudo systemctl restart sshd || true\nsudo service sshd restart || true`;\n }\n else if (hostCertificate) {\n callout = 'Open port 9748 and use the startup script below to ' +\n 'provision a Pritunl Zero host. Provisioning may take several ' +\n 'minutes if the servers DNS record was created recently.';\n content = `#!/bin/bash\nsudo sed -i '/^TrustedUserCAKeys/d' /etc/ssh/sshd_config\nsudo sed -i '/^AuthorizedPrincipalsFile/d' /etc/ssh/sshd_config\nsudo tee -a /etc/ssh/sshd_config << EOF\n\nTrustedUserCAKeys /etc/ssh/trusted\nAuthorizedPrincipalsFile /etc/ssh/principals\nEOF\nsudo tee /etc/ssh/principals << EOF\nemergency\n${this.state.roles.length ? this.state.roles.join('\\n') + '\\n' : ''}EOF\nsudo tee /etc/ssh/trusted << EOF\n${this.props.authority.public_key}\nEOF\n\nsudo tee -a /etc/yum.repos.d/pritunl.repo << EOF\n[pritunl]\nname=Pritunl Repository\nbaseurl=https://repo.pritunl.com/stable/yum/centos/7/\ngpgcheck=1\nenabled=1\nEOF\n\ngpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A\ngpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A > key.tmp\nsudo rpm --import key.tmp\nrm -f key.tmp${epel}\nsudo yum -y install pritunl-ssh-host${boto}\n${route53}\nsudo pritunl-ssh-host config add-token ${this.props.authority.host_tokens.length ?\n this.props.authority.host_tokens[0] : 'HOST_TOKEN_UNAVAILABLE'}\nsudo pritunl-ssh-host config hostname ${this.state.hostname}\nsudo pritunl-ssh-host config server ${this.state.server || serverDefault}\n\nsudo systemctl restart sshd || true\nsudo service sshd restart || true`;\n }\n else {\n content = `#!/bin/bash\nsudo sed -i '/^TrustedUserCAKeys/d' /etc/ssh/sshd_config\nsudo sed -i '/^AuthorizedPrincipalsFile/d' /etc/ssh/sshd_config\nsudo tee -a /etc/ssh/sshd_config << EOF\n\nTrustedUserCAKeys /etc/ssh/trusted\nAuthorizedPrincipalsFile /etc/ssh/principals\nEOF\nsudo tee /etc/ssh/principals << EOF\nemergency\n${this.state.roles.length ? this.state.roles.join('\\n') + '\\n' : ''}EOF\nsudo tee /etc/ssh/trusted << EOF\n${this.props.authority.public_key}\nEOF\n\nsudo systemctl restart sshd || true\nsudo service sshd restart || true`;\n }\n if (errorMsg) {\n errorMsgElem = react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-dialog-body\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-callout bp5-intent-danger bp5-icon-ban-circle\", style: css.callout }, errorMsg));\n }\n let title = '';\n if (this.props.proxy) {\n title = 'Generate Bastion Deploy Script';\n }\n else {\n title = 'Generate Deploy Script';\n }\n popoverElem = react__WEBPACK_IMPORTED_MODULE_0__.createElement(_blueprintjs_core__WEBPACK_IMPORTED_MODULE_7__.Dialog, { title: title, style: css.dialog, isOpen: this.state.popover, usePortal: true, portalContainer: document.body, onClose: () => {\n this.setState({\n ...this.state,\n popover: false,\n });\n } },\n errorMsgElem,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-dialog-body\", hidden: !!errorMsgElem },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-callout bp5-intent-primary bp5-icon-info-sign\", style: css.callout }, callout),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageSwitch__WEBPACK_IMPORTED_MODULE_4__[\"default\"], { label: \"Host certificate\", hidden: !this.props.authority.host_certificates ||\n this.props.proxy, disabled: hostCertificateDisabled, help: \"Provision a host certificate to this server, requires installing Pritunl Zero host client. Authority must have at least one host token and at least one node must have a user domain.\", checked: hostCertificate, onToggle: () => {\n this.setState({\n ...this.state,\n hostCertificate: !hostCertificate,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageSelect__WEBPACK_IMPORTED_MODULE_5__[\"default\"], { hidden: !hostCertificate || serversElm.length === 0 ||\n this.props.proxy, label: \"Pritunl Zero Server\", help: \"The Pritunl Zero server hostname that the client will authenticate from.\", value: this.state.server || serverDefault, onChange: (val) => {\n this.setState({\n ...this.state,\n server: val,\n });\n } }, serversElm),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_2__[\"default\"], { label: \"Server Hostname\", hidden: !hostCertificate || this.props.proxy, help: \"Hostname portion of the server domain. The Pritunl Zero server must be able to resolve the server using this hostname to provision the host certificate. The hostname will be combined with the authority domain to form the servers domain.\", type: \"text\", placeholder: \"Server hostname\", value: this.state.hostname, onChange: (val) => {\n this.setState({\n ...this.state,\n hostname: val,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageSwitch__WEBPACK_IMPORTED_MODULE_4__[\"default\"], { label: \"Auto Route53 configuration\", hidden: !hostCertificate, help: \"Automatically update a Route53 record for this servers hostname. The authority domain must be hosted in Route53.\", checked: this.state.route53, onToggle: () => {\n this.setState({\n ...this.state,\n route53: !this.state.route53,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_2__[\"default\"], { label: \"AWS Access Key\", hidden: !hostCertificate || !this.state.route53, help: \"AWS access key for auto Route53 configuration. Leave blank if the instance is configured with an instance role.\", type: \"text\", placeholder: \"Leave blank to use instance role\", value: this.state.awsAccessKey, onChange: (val) => {\n this.setState({\n ...this.state,\n awsAccessKey: val,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_2__[\"default\"], { label: \"AWS Secret Key\", hidden: !hostCertificate || !this.state.route53, help: \"AWS secret key for auto Route53 configuration. Leave blank if the instance is configured with an instance role.\", type: \"text\", placeholder: \"Leave blank to use instance role\", value: this.state.awsSecretKey, onChange: (val) => {\n this.setState({\n ...this.state,\n awsSecretKey: val,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"label\", { className: \"bp5-label\", hidden: this.props.proxy },\n \"Roles\",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_Help__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { title: \"Roles\", content: \"Roles associated with this server. The user must have at least one matching role to access this server.\" }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, roles)),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInputButton__WEBPACK_IMPORTED_MODULE_3__[\"default\"], { buttonClass: \"bp5-intent-success bp5-icon-add\", hidden: this.props.proxy, label: \"Add\", type: \"text\", placeholder: \"Add role\", value: this.state.addRole, onChange: (val) => {\n this.setState({\n ...this.state,\n addRole: val,\n });\n }, onSubmit: this.onAddRole }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"textarea\", { className: \"bp5-input\", style: css.textarea, readOnly: true, autoCapitalize: \"off\", spellCheck: false, rows: 18, value: content, onClick: (evt) => {\n evt.currentTarget.select();\n } })),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-dialog-footer\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-dialog-footer-actions\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button\", type: \"button\", onClick: () => {\n this.setState({\n ...this.state,\n popover: !this.state.popover,\n });\n } }, \"Close\"))));\n }\n let buttonLabel = '';\n if (this.props.proxy) {\n buttonLabel = 'Generate Bastion Deploy Script';\n }\n else {\n buttonLabel = 'Generate Deploy Script';\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { hidden: this.props.hidden, style: css.box },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-icon-cloud-upload bp5-intent-primary\", style: css.button, type: \"button\", disabled: this.props.disabled ||\n (this.props.proxy && (!this.props.authority.host_proxy ||\n !this.props.authority.host_certificates)), onClick: () => {\n this.setState({\n ...this.state,\n popover: !this.state.popover,\n });\n } }, buttonLabel),\n popoverElem);\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvY29tcG9uZW50cy9BdXRob3JpdHlEZXBsb3kuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztBQUMrQjtBQUNnQjtBQUVyQjtBQUNVO0FBQ1k7QUFDVjtBQUNBO0FBRUo7QUFzQmxDLE1BQU0sR0FBRyxHQUFHO0lBQ1gsR0FBRyxFQUFFO1FBQ0osWUFBWSxFQUFFLE1BQU07S0FDRztJQUN4QixNQUFNLEVBQUUsRUFDZ0I7SUFDeEIsSUFBSSxFQUFFO1FBQ0wsTUFBTSxFQUFFLGVBQWU7UUFDdkIsTUFBTSxFQUFFLE1BQU07S0FDUztJQUN4QixPQUFPLEVBQUU7UUFDUixZQUFZLEVBQUUsTUFBTTtLQUNHO0lBQ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RlbnQtcHJpbWFyeVwiXG5cdFx0XHRcdHN0eWxlPXtjc3MuYnV0dG9ufVxuXHRcdFx0XHR0eXBlPVwiYnV0dG9uXCJcblx0XHRcdFx0ZGlzYWJsZWQ9e3RoaXMucHJvcHMuZGlzYWJsZWQgfHxcblx0XHRcdFx0XHQodGhpcy5wcm9wcy5wcm94eSAmJiAoIXRoaXMucHJvcHMuYXV0aG9yaXR5Lmhvc3RfcHJveHkgfHxcblx0XHRcdFx0XHQhdGhpcy5wcm9wcy5hdXRob3JpdHkuaG9zdF9jZXJ0aWZpY2F0ZXMpKX1cblx0XHRcdFx0b25DbGljaz17KCk6IHZvaWQgPT4ge1xuXHRcdFx0XHRcdHRoaXMuc2V0U3RhdGUoe1xuXHRcdFx0XHRcdFx0Li4udGhpcy5zdGF0ZSxcblx0XHRcdFx0XHRcdHBvcG92ZXI6ICF0aGlzLnN0YXRlLnBvcG92ZXIsXG5cdFx0XHRcdFx0fSk7XG5cdFx0XHRcdH19XG5cdFx0XHQ+XG5cdFx0XHRcdHtidXR0b25MYWJlbH1cblx0XHRcdDwvYnV0dG9uPlxuXHRcdFx0e3BvcG92ZXJFbGVtfVxuXHRcdDwvZGl2Pjtcblx0fVxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./app/components/AuthorityDeploy.js\n"); /***/ }), @@ -3548,7 +3548,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EndpointKmsg)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Theme__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Theme */ \"./app/Theme.js\");\n/* harmony import */ var _actions_EndpointActions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/EndpointActions */ \"./app/actions/EndpointActions.js\");\n/* harmony import */ var _actions_CheckActions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../actions/CheckActions */ \"./app/actions/CheckActions.js\");\n/* harmony import */ var react_ace__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-ace */ \"./node_modules/react-ace/lib/index.js\");\n/* harmony import */ var ace_builds_src_noconflict_mode_text__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ace-builds/src-noconflict/mode-text */ \"./node_modules/ace-builds/src-noconflict/mode-text.js\");\n/* harmony import */ var ace_builds_src_noconflict_mode_text__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(ace_builds_src_noconflict_mode_text__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var ace_builds_src_noconflict_theme_dracula__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ace-builds/src-noconflict/theme-dracula */ \"./node_modules/ace-builds/src-noconflict/theme-dracula.js\");\n/* harmony import */ var ace_builds_src_noconflict_theme_dracula__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(ace_builds_src_noconflict_theme_dracula__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var ace_builds_src_noconflict_theme_eclipse__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ace-builds/src-noconflict/theme-eclipse */ \"./node_modules/ace-builds/src-noconflict/theme-eclipse.js\");\n/* harmony import */ var ace_builds_src_noconflict_theme_eclipse__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(ace_builds_src_noconflict_theme_eclipse__WEBPACK_IMPORTED_MODULE_7__);\n\n\n\n\n\n\n\n\nconst css = {\n header: {\n fontSize: '20px',\n marginTop: '-10px',\n paddingBottom: '2px',\n marginBottom: '10px',\n borderBottomStyle: 'solid',\n },\n heading: {\n margin: '19px 0 0 0',\n },\n button: {\n margin: '8px 0 0 8px',\n },\n buttons: {\n marginTop: '8px',\n },\n group: {\n flex: 1,\n minWidth: '250px',\n margin: '0 10px',\n },\n editorGroup: {\n marginBottom: '15px',\n },\n};\nclass EndpointKmsg extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props, context) {\n super(props, context);\n this.onChange = () => {\n this.setState({\n ...this.state,\n });\n };\n this.state = {\n data: '',\n loading: false,\n cancelable: false,\n };\n }\n componentDidMount() {\n _Theme__WEBPACK_IMPORTED_MODULE_1__.addChangeListener(this.onChange);\n }\n componentWillUnmount() {\n _Theme__WEBPACK_IMPORTED_MODULE_1__.removeChangeListener(this.onChange);\n }\n setLoading() {\n this.setState({\n ...this.state,\n loading: true,\n cancelable: true,\n });\n }\n setLoaded() {\n this.setState({\n ...this.state,\n loading: false,\n cancelable: false,\n });\n }\n update() {\n let loading = true;\n this.setLoading();\n let logResp;\n if (this.props.endpoint) {\n logResp = _actions_EndpointActions__WEBPACK_IMPORTED_MODULE_2__.log(this.props.endpoint, 'kmsg');\n }\n else {\n logResp = _actions_CheckActions__WEBPACK_IMPORTED_MODULE_3__.log(this.props.check, 'check');\n }\n logResp.then((data) => {\n if (loading) {\n loading = false;\n this.setLoaded();\n }\n this.setState({\n ...this.state,\n data: data.join(''),\n });\n setTimeout(() => {\n if (this.editor) {\n this.editor.scrollToLine(Number.POSITIVE_INFINITY, false, true, null);\n }\n }, 100);\n setTimeout(() => {\n if (this.editor) {\n this.editor.scrollToLine(Number.POSITIVE_INFINITY, false, true, null);\n }\n }, 200);\n setTimeout(() => {\n if (this.editor) {\n this.editor.scrollToLine(Number.POSITIVE_INFINITY, false, true, null);\n }\n }, 300);\n setTimeout(() => {\n if (this.editor) {\n this.editor.scrollToLine(Number.POSITIVE_INFINITY, false, true, null);\n }\n }, 400);\n }).catch(() => {\n if (loading) {\n loading = false;\n this.setLoaded();\n }\n });\n }\n render() {\n if (this.props.disabled) {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null);\n }\n if (!this.loaded) {\n this.loaded = true;\n setTimeout(() => {\n this.update();\n });\n }\n let title = \"\";\n if (this.props.endpoint) {\n title = \"Dmesg\";\n }\n else {\n title = \"Error Log\";\n }\n let refreshDisabled = false;\n let refreshLabel = '';\n let refreshClass = 'bp5-button';\n if (Object.entries(this.state.cancelable).length) {\n refreshLabel = 'Cancel';\n refreshClass += ' bp5-intent-warning bp5-icon-delete';\n }\n else {\n if (Object.entries(this.state.loading).length) {\n refreshDisabled = true;\n }\n refreshLabel = 'Refresh';\n refreshClass += ' bp5-intent-success bp5-icon-refresh';\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal wrap bp5-border\", style: css.header },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h3\", { style: css.heading }, title),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { style: css.buttons },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: refreshClass, style: css.button, disabled: refreshDisabled, type: \"button\", onClick: () => {\n if (Object.entries(this.state.cancelable).length) {\n if (this.props.endpoint) {\n _actions_EndpointActions__WEBPACK_IMPORTED_MODULE_2__.dataCancel();\n }\n else {\n _actions_CheckActions__WEBPACK_IMPORTED_MODULE_3__.dataCancel();\n }\n }\n else {\n this.update();\n }\n } }, refreshLabel))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal wrap\", style: css.editorGroup },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_ace__WEBPACK_IMPORTED_MODULE_4__[\"default\"], { name: this.props.endpoint + \"-dmesg\", theme: _Theme__WEBPACK_IMPORTED_MODULE_1__.getEditorTheme(), height: \"400px\", width: \"100%\", mode: \"text\", fontSize: \"12px\", wrapEnabled: true, showPrintMargin: false, showGutter: true, readOnly: true, value: this.state.data, editorProps: {\n $blockScrolling: true,\n }, setOptions: {\n showFoldWidgets: false,\n }, onLoad: (editor) => {\n this.editor = editor;\n this.editor.scrollToLine(Number.POSITIVE_INFINITY, false, false, null);\n }, onChange: () => {\n if (this.editor) {\n this.editor.scrollToLine(Number.POSITIVE_INFINITY, false, true, null);\n }\n } })));\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvY29tcG9uZW50cy9FbmRwb2ludEttc2cuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUMrQjtBQUNHO0FBRTRCO0FBQ047QUFFdEI7QUFFVztBQUNJO0FBQ0E7QUFjakQsTUFBTSxHQUFHLEdBQUc7SUFDWCxNQUFNLEVBQUU7UUFDUCxRQUFRLEVBQUUsTUFBTTtRQUNoQixTQUFTLEVBQUUsT0FBTztRQUNsQixhQUFhLEVBQUUsS0FBSztRQUNwQixZQUFZLEVBQUUsTUFBTTtRQUNwQixpQkFBaUIsRUFBRSxPQUFPO0tBQ0g7SUFDeEIsT0FBTyxFQUFFO1FBQ1IsTUFBTSxFQUFFLFlBQVk7S0FDRztJQUN4QixNQUFNLEVBQUU7UUFDUCxNQUFNLEVBQUUsYUFBYTtLQUNFO0lBQ3hCLE9BQU8sRUFBRTtRQUNSLFNBQVMsRUFBRSxLQUFLO0tBQ087SUFDeEIsS0FBSyxFQUFFO1FBQ04sSUFBSSxFQUFFLENBQUM7UUFDUCxRQUFRLEVBQUUsT0FBTztRQUNqQixNQUFNLEVBQUUsUUFBUTtLQUNPO0lBQ3hCLFdBQVcsRUFBRTtRQUNa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HRcdCRibG9ja1Njcm9sbGluZzogdHJ1ZSxcblx0XHRcdFx0XHR9fVxuXHRcdFx0XHRcdHNldE9wdGlvbnM9e3tcblx0XHRcdFx0XHRcdHNob3dGb2xkV2lkZ2V0czogZmFsc2UsXG5cdFx0XHRcdFx0fX1cblx0XHRcdFx0XHRvbkxvYWQ9eyhlZGl0b3I6IEFjZS5FZGl0b3IpOiB2b2lkID0+IHtcblx0XHRcdFx0XHRcdHRoaXMuZWRpdG9yID0gZWRpdG9yO1xuXHRcdFx0XHRcdFx0dGhpcy5lZGl0b3Iuc2Nyb2xsVG9MaW5lKE51bWJlci5QT1NJVElWRV9JTkZJTklUWSxcblx0XHRcdFx0XHRcdFx0ZmFsc2UsIGZhbHNlLCBudWxsKTtcblx0XHRcdFx0XHR9fVxuXHRcdFx0XHRcdG9uQ2hhbmdlPXsoKTogdm9pZCA9PiB7XG5cdFx0XHRcdFx0XHRpZiAodGhpcy5lZGl0b3IpIHtcblx0XHRcdFx0XHRcdFx0dGhpcy5lZGl0b3Iuc2Nyb2xsVG9MaW5lKE51bWJlci5QT1NJVElWRV9JTkZJTklUWSxcblx0XHRcdFx0XHRcdFx0XHRmYWxzZSwgdHJ1ZSwgbnVsbCk7XG5cdFx0XHRcdFx0XHR9XG5cdFx0XHRcdFx0fX1cblx0XHRcdFx0Lz5cblx0XHRcdDwvZGl2PlxuXHRcdDwvZGl2Pjtcblx0fVxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./app/components/EndpointKmsg.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EndpointKmsg)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Theme__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Theme */ \"./app/Theme.js\");\n/* harmony import */ var _actions_EndpointActions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../actions/EndpointActions */ \"./app/actions/EndpointActions.js\");\n/* harmony import */ var _actions_CheckActions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../actions/CheckActions */ \"./app/actions/CheckActions.js\");\n/* harmony import */ var _monaco_editor_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @monaco-editor/react */ \"./node_modules/@monaco-editor/react/dist/index.mjs\");\n\n\n\n\n\nconst css = {\n header: {\n fontSize: '20px',\n marginTop: '-10px',\n paddingBottom: '2px',\n marginBottom: '10px',\n borderBottomStyle: 'solid',\n },\n heading: {\n margin: '19px 0 0 0',\n },\n button: {\n margin: '8px 0 0 8px',\n },\n buttons: {\n marginTop: '8px',\n },\n group: {\n flex: 1,\n minWidth: '250px',\n margin: '0 10px',\n },\n editorGroup: {\n marginBottom: '15px',\n },\n};\nclass EndpointKmsg extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props, context) {\n super(props, context);\n this.onChange = () => {\n this.setState({\n ...this.state,\n });\n };\n this.state = {\n data: '',\n loading: false,\n cancelable: false,\n };\n }\n componentDidMount() {\n _Theme__WEBPACK_IMPORTED_MODULE_1__.addChangeListener(this.onChange);\n }\n componentWillUnmount() {\n _Theme__WEBPACK_IMPORTED_MODULE_1__.removeChangeListener(this.onChange);\n }\n setLoading() {\n this.setState({\n ...this.state,\n loading: true,\n cancelable: true,\n });\n }\n setLoaded() {\n this.setState({\n ...this.state,\n loading: false,\n cancelable: false,\n });\n }\n update() {\n let loading = true;\n this.setLoading();\n let logResp;\n if (this.props.endpoint) {\n logResp = _actions_EndpointActions__WEBPACK_IMPORTED_MODULE_2__.log(this.props.endpoint, 'kmsg');\n }\n else {\n logResp = _actions_CheckActions__WEBPACK_IMPORTED_MODULE_3__.log(this.props.check, 'check');\n }\n logResp.then((data) => {\n if (loading) {\n loading = false;\n this.setLoaded();\n }\n this.setState({\n ...this.state,\n data: data.join(''),\n });\n const model = this.editor.getModel();\n if (model) {\n model.setValue(data.join(''));\n const lineCount = model.getLineCount();\n this.editor.revealLine(lineCount);\n this.editor.setPosition({\n lineNumber: lineCount,\n column: model.getLineMaxColumn(lineCount),\n });\n }\n }).catch(() => {\n if (loading) {\n loading = false;\n this.setLoaded();\n }\n });\n }\n render() {\n if (this.props.disabled) {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null);\n }\n if (!this.loaded) {\n this.loaded = true;\n setTimeout(() => {\n this.update();\n });\n }\n let title = \"\";\n if (this.props.endpoint) {\n title = \"Dmesg\";\n }\n else {\n title = \"Error Log\";\n }\n let refreshDisabled = false;\n let refreshLabel = '';\n let refreshClass = 'bp5-button';\n if (Object.entries(this.state.cancelable).length) {\n refreshLabel = 'Cancel';\n refreshClass += ' bp5-intent-warning bp5-icon-delete';\n }\n else {\n if (Object.entries(this.state.loading).length) {\n refreshDisabled = true;\n }\n refreshLabel = 'Refresh';\n refreshClass += ' bp5-intent-success bp5-icon-refresh';\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal wrap bp5-border\", style: css.header },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h3\", { style: css.heading }, title),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { style: css.buttons },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: refreshClass, style: css.button, disabled: refreshDisabled, type: \"button\", onClick: () => {\n if (Object.entries(this.state.cancelable).length) {\n if (this.props.endpoint) {\n _actions_EndpointActions__WEBPACK_IMPORTED_MODULE_2__.dataCancel();\n }\n else {\n _actions_CheckActions__WEBPACK_IMPORTED_MODULE_3__.dataCancel();\n }\n }\n else {\n this.update();\n }\n } }, refreshLabel))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal wrap\", style: css.editorGroup },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_monaco_editor_react__WEBPACK_IMPORTED_MODULE_4__.Editor, { height: \"400px\", width: \"100%\", defaultLanguage: \"markdown\", theme: _Theme__WEBPACK_IMPORTED_MODULE_1__.getEditorTheme(), defaultValue: this.state.data, onMount: (editor, monaco) => {\n this.monaco = monaco;\n this.editor = editor;\n }, options: {\n folding: false,\n fontSize: 12,\n fontFamily: _Theme__WEBPACK_IMPORTED_MODULE_1__.monospaceFont,\n fontWeight: _Theme__WEBPACK_IMPORTED_MODULE_1__.monospaceWeight,\n tabSize: 4,\n detectIndentation: false,\n scrollBeyondLastLine: false,\n readOnly: true,\n minimap: {\n enabled: false,\n },\n wordWrap: \"on\",\n automaticLayout: true,\n } })));\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvY29tcG9uZW50cy9FbmRwb2ludEttc2cuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUMrQjtBQUNHO0FBRTRCO0FBQ047QUFDSjtBQWVwRCxNQUFNLEdBQUcsR0FBRztJQUNYLE1BQU0sRUFBRTtRQUNQLFFBQVEsRUFBRSxNQUFNO1FBQ2hCLFNBQVMsRUFBRSxPQUFPO1FBQ2xCLGFBQWEsRUFBRSxLQUFLO1FBQ3BCLFlBQVksRUFBRSxNQUFNO1FBQ3BCLGlCQUFpQixFQUFFLE9BQU87S0FDSDtJQUN4QixPQUFPLEVBQUU7UUFDUixNQUFNLEVBQUUsWUFBWTtLQUNHO0lBQ3hCLE1BQU0sRUFBRTtRQUNQLE1BQU0sRUFBRSxhQUFhO0tBQ0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1lLm1vbm9zcGFjZVdlaWdodCxcblx0XHRcdFx0XHRcdHRhYlNpemU6IDQsXG5cdFx0XHRcdFx0XHRkZXRlY3RJbmRlbnRhdGlvbjogZmFsc2UsXG5cdFx0XHRcdFx0XHRzY3JvbGxCZXlvbmRMYXN0TGluZTogZmFsc2UsXG5cdFx0XHRcdFx0XHRyZWFkT25seTogdHJ1ZSxcblx0XHRcdFx0XHRcdG1pbmltYXA6IHtcblx0XHRcdFx0XHRcdFx0ZW5hYmxlZDogZmFsc2UsXG5cdFx0XHRcdFx0XHR9LFxuXHRcdFx0XHRcdFx0d29yZFdyYXA6IFwib25cIixcblx0XHRcdFx0XHRcdGF1dG9tYXRpY0xheW91dDogdHJ1ZSxcblx0XHRcdFx0XHR9fVxuXHRcdFx0XHQvPlxuXHRcdFx0PC9kaXY+XG5cdFx0PC9kaXY+O1xuXHR9XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./app/components/EndpointKmsg.js\n"); /***/ }), @@ -3614,7 +3614,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Log)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _blueprintjs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @blueprintjs/core */ \"./node_modules/@blueprintjs/core/lib/esm/components/dialog/dialog.js\");\n/* harmony import */ var _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/MiscUtils */ \"./app/utils/MiscUtils.js\");\n/* harmony import */ var _Theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Theme */ \"./app/Theme.js\");\n\n\n\n\nconst css = {\n card: {\n display: 'table-row',\n width: '100%',\n padding: 0,\n boxShadow: 'none',\n },\n timestamp: {\n verticalAlign: 'top',\n display: 'table-cell',\n padding: '6px',\n },\n level: {\n verticalAlign: 'top',\n display: 'table-cell',\n padding: '6px',\n },\n message: {\n verticalAlign: 'top',\n display: 'table-cell',\n padding: '6px',\n },\n fields: {\n verticalAlign: 'top',\n display: 'table-cell',\n padding: '6px',\n },\n buttons: {\n verticalAlign: 'top',\n display: 'table-cell',\n padding: '0',\n width: '30px',\n },\n key: {\n fontWeight: 'bold',\n },\n value: {},\n dialog: {\n height: '500px',\n width: '90%',\n maxWidth: '700px',\n },\n dialogBody: {\n height: '100%',\n },\n textarea: {\n resize: 'none',\n fontSize: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceSize,\n fontFamily: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceFont,\n marginBottom: 0,\n },\n};\nclass Log extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props, context) {\n super(props, context);\n this.state = {\n stack: false,\n };\n }\n render() {\n let log = this.props.log;\n let className = 'bp5-cell ';\n switch (log.level) {\n case 'debug':\n className += 'bp5-text-intent-success';\n break;\n case 'info':\n className += 'bp5-text-intent-primary';\n break;\n case 'warning':\n className += 'bp5-text-intent-warning';\n break;\n case 'error':\n className += 'bp5-text-intent-danger';\n break;\n case 'fatal':\n className += 'bp5-text-intent-danger';\n break;\n case 'panic':\n className += 'bp5-text-intent-danger';\n break;\n }\n let fields = [];\n for (let key in log.fields) {\n if (!log.fields.hasOwnProperty(key)) {\n continue;\n }\n let val = log.fields[key];\n fields.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: key },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", { style: css.key },\n key,\n \": \"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", { style: css.value }, JSON.stringify(val))));\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-card bp5-row\", style: css.card },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: className, style: css.timestamp }, _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_1__.formatDateShortTime(log.timestamp) || 'Unknown'),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: className, style: css.level }, log.level),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: className, style: css.message }, log.message),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-cell\", style: css.fields }, fields),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-cell\", style: css.buttons },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-minimal bp5-icon-document-open\", hidden: !log.stack, onClick: () => {\n this.setState({\n ...this.state,\n stack: true,\n });\n } })),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_blueprintjs_core__WEBPACK_IMPORTED_MODULE_3__.Dialog, { title: \"Stack Trace\", style: css.dialog, isOpen: this.state.stack, usePortal: true, portalContainer: document.body, onClose: () => {\n this.setState({\n ...this.state,\n stack: false,\n });\n } },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"textarea\", { className: \"bp5-dialog-body bp5-input\", style: css.textarea, autoCapitalize: \"off\", spellCheck: false, readOnly: true, value: log.stack || '' })));\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvY29tcG9uZW50cy9Mb2cuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQytCO0FBQ2dCO0FBQ0M7QUFFZDtBQVVsQyxNQUFNLEdBQUcsR0FBRztJ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HR9KTtcblx0XHRcdFx0fX1cblx0XHRcdD5cblx0XHRcdFx0PHRleHRhcmVhXG5cdFx0XHRcdFx0Y2xhc3NOYW1lPVwiYnA1LWRpYWxvZy1ib2R5IGJwNS1pbnB1dFwiXG5cdFx0XHRcdFx0c3R5bGU9e2Nzcy50ZXh0YXJlYX1cblx0XHRcdFx0XHRhdXRvQ2FwaXRhbGl6ZT1cIm9mZlwiXG5cdFx0XHRcdFx0c3BlbGxDaGVjaz17ZmFsc2V9XG5cdFx0XHRcdFx0cmVhZE9ubHk9e3RydWV9XG5cdFx0XHRcdFx0dmFsdWU9e2xvZy5zdGFjayB8fCAnJ31cblx0XHRcdFx0Lz5cblx0XHRcdDwvQmx1ZXByaW50LkRpYWxvZz5cblx0XHQ8L2Rpdj47XG5cdH1cbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./app/components/Log.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Log)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _blueprintjs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @blueprintjs/core */ \"./node_modules/@blueprintjs/core/lib/esm/components/dialog/dialog.js\");\n/* harmony import */ var _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/MiscUtils */ \"./app/utils/MiscUtils.js\");\n/* harmony import */ var _Theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Theme */ \"./app/Theme.js\");\n\n\n\n\nconst css = {\n card: {\n display: 'table-row',\n width: '100%',\n padding: 0,\n boxShadow: 'none',\n },\n timestamp: {\n verticalAlign: 'top',\n display: 'table-cell',\n padding: '6px',\n },\n level: {\n verticalAlign: 'top',\n display: 'table-cell',\n padding: '6px',\n },\n message: {\n verticalAlign: 'top',\n display: 'table-cell',\n padding: '6px',\n },\n fields: {\n verticalAlign: 'top',\n display: 'table-cell',\n padding: '6px',\n },\n buttons: {\n verticalAlign: 'top',\n display: 'table-cell',\n padding: '0',\n width: '30px',\n },\n key: {\n fontWeight: 'bold',\n },\n value: {},\n dialog: {\n height: '500px',\n width: '90%',\n maxWidth: '700px',\n },\n dialogBody: {\n height: '100%',\n },\n textarea: {\n resize: 'none',\n fontSize: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceSize,\n fontFamily: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceFont,\n fontWeight: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceWeight,\n marginBottom: 0,\n },\n};\nclass Log extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props, context) {\n super(props, context);\n this.state = {\n stack: false,\n };\n }\n render() {\n let log = this.props.log;\n let className = 'bp5-cell ';\n switch (log.level) {\n case 'debug':\n className += 'bp5-text-intent-success';\n break;\n case 'info':\n className += 'bp5-text-intent-primary';\n break;\n case 'warning':\n className += 'bp5-text-intent-warning';\n break;\n case 'error':\n className += 'bp5-text-intent-danger';\n break;\n case 'fatal':\n className += 'bp5-text-intent-danger';\n break;\n case 'panic':\n className += 'bp5-text-intent-danger';\n break;\n }\n let fields = [];\n for (let key in log.fields) {\n if (!log.fields.hasOwnProperty(key)) {\n continue;\n }\n let val = log.fields[key];\n fields.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: key },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", { style: css.key },\n key,\n \": \"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"span\", { style: css.value }, JSON.stringify(val))));\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-card bp5-row\", style: css.card },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: className, style: css.timestamp }, _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_1__.formatDateShortTime(log.timestamp) || 'Unknown'),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: className, style: css.level }, log.level),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: className, style: css.message }, log.message),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-cell\", style: css.fields }, fields),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-cell\", style: css.buttons },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-minimal bp5-icon-document-open\", hidden: !log.stack, onClick: () => {\n this.setState({\n ...this.state,\n stack: true,\n });\n } })),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_blueprintjs_core__WEBPACK_IMPORTED_MODULE_3__.Dialog, { title: \"Stack Trace\", style: css.dialog, isOpen: this.state.stack, usePortal: true, portalContainer: document.body, onClose: () => {\n this.setState({\n ...this.state,\n stack: false,\n });\n } },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"textarea\", { className: \"bp5-dialog-body bp5-input\", style: css.textarea, autoCapitalize: \"off\", spellCheck: false, readOnly: true, value: log.stack || '' })));\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvY29tcG9uZW50cy9Mb2cuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQytCO0FBQ2dCO0FBQ0M7QUFFZDtBQVVsQyxNQUFNLEdBQUcsR0FBRztJQUNYLElBQUksRUFBRTtRQUNMLE9BQU8sRUFBRSxXQUFXO1FBQ3BCLEtBQUssRUFBRSxNQUFNO1FBQ2IsT0FBTyxFQUFFLENBQUM7UUF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dD5cblx0XHRcdFx0PHRleHRhcmVhXG5cdFx0XHRcdFx0Y2xhc3NOYW1lPVwiYnA1LWRpYWxvZy1ib2R5IGJwNS1pbnB1dFwiXG5cdFx0XHRcdFx0c3R5bGU9e2Nzcy50ZXh0YXJlYX1cblx0XHRcdFx0XHRhdXRvQ2FwaXRhbGl6ZT1cIm9mZlwiXG5cdFx0XHRcdFx0c3BlbGxDaGVjaz17ZmFsc2V9XG5cdFx0XHRcdFx0cmVhZE9ubHk9e3RydWV9XG5cdFx0XHRcdFx0dmFsdWU9e2xvZy5zdGFjayB8fCAnJ31cblx0XHRcdFx0Lz5cblx0XHRcdDwvQmx1ZXByaW50LkRpYWxvZz5cblx0XHQ8L2Rpdj47XG5cdH1cbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./app/components/Log.js\n"); /***/ }), @@ -3856,7 +3856,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PageTextArea)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Help__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Help */ \"./app/components/Help.js\");\n/* harmony import */ var _Theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Theme */ \"./app/Theme.js\");\n\n\n\nconst css = {\n label: {\n width: '100%',\n maxWidth: '280px',\n },\n textarea: {\n width: '100%',\n resize: 'none',\n fontSize: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceSize,\n fontFamily: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceFont,\n },\n};\nclass PageTextArea extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n render() {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"label\", { className: \"bp5-label\", style: css.label, hidden: this.props.hidden },\n this.props.label,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_Help__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { title: this.props.label, content: this.props.help }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"textarea\", { className: \"bp5-input\", style: css.textarea, disabled: this.props.disabled, readOnly: this.props.readOnly, autoCapitalize: \"off\", spellCheck: false, placeholder: this.props.placeholder, rows: this.props.rows, value: this.props.value || '', onChange: (evt) => {\n this.props.onChange(evt.target.value);\n } }));\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvY29tcG9uZW50cy9QYWdlVGV4dEFyZWEuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFDK0I7QUFDTDtBQUNPO0FBY2pDLE1BQU0sR0FBRyxHQUFHO0lBQ1gsS0FBSyxFQUFFO1FBQ04sS0FBSyxFQUFFLE1BQU07UUFDYixRQUFRLEVBQUUsT0FBTztLQUNNO0lBQ3hCLFFBQVEsRUFBRTtRQUNULEtBQUssRUFBRSxNQUFNO1FBQ2IsTUFBTSxFQUFFLE1BQU07UUFDZCxRQUFRLEVBQUUsaURBQW1CO1FBQzdCLFVBQVUsRUFBRSxpREFBbUI7S0FDUjtDQUN4QixDQUFDO0FBRWEsTUFBTSxZQUFhLFNBQVEsNENBQTBCO0lBQ25FLE1BQU07UUFDTCxPQUFPLDREQUNOLFNBQVMsRUFBQyxXQUFXLEVBQ3JCLEtBQUssRUFBRSxHQUFHLENBQUMsS0FBSyxFQUNoQixNQUFNLEVBQUUsSUFBSSxDQUFD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xwXG5cdFx0XHRcdHRpdGxlPXt0aGlzLnByb3BzLmxhYmVsfVxuXHRcdFx0XHRjb250ZW50PXt0aGlzLnByb3BzLmhlbHB9XG5cdFx0XHQvPlxuXHRcdFx0PHRleHRhcmVhXG5cdFx0XHRcdGNsYXNzTmFtZT1cImJwNS1pbnB1dFwiXG5cdFx0XHRcdHN0eWxlPXtjc3MudGV4dGFyZWF9XG5cdFx0XHRcdGRpc2FibGVkPXt0aGlzLnByb3BzLmRpc2FibGVkfVxuXHRcdFx0XHRyZWFkT25seT17dGhpcy5wcm9wcy5yZWFkT25seX1cblx0XHRcdFx0YXV0b0NhcGl0YWxpemU9XCJvZmZcIlxuXHRcdFx0XHRzcGVsbENoZWNrPXtmYWxzZX1cblx0XHRcdFx0cGxhY2Vob2xkZXI9e3RoaXMucHJvcHMucGxhY2Vob2xkZXJ9XG5cdFx0XHRcdHJvd3M9e3RoaXMucHJvcHMucm93c31cblx0XHRcdFx0dmFsdWU9e3RoaXMucHJvcHMudmFsdWUgfHwgJyd9XG5cdFx0XHRcdG9uQ2hhbmdlPXsoZXZ0KTogdm9pZCA9PiB7XG5cdFx0XHRcdFx0dGhpcy5wcm9wcy5vbkNoYW5nZShldnQudGFyZ2V0LnZhbHVlKTtcblx0XHRcdFx0fX1cblx0XHRcdC8+XG5cdFx0PC9sYWJlbD47XG5cdH1cbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./app/components/PageTextArea.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PageTextArea)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Help__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Help */ \"./app/components/Help.js\");\n/* harmony import */ var _Theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Theme */ \"./app/Theme.js\");\n\n\n\nconst css = {\n label: {\n width: '100%',\n maxWidth: '280px',\n },\n textarea: {\n width: '100%',\n resize: 'none',\n fontSize: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceSize,\n fontFamily: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceFont,\n fontWeight: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceWeight,\n },\n};\nclass PageTextArea extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n render() {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"label\", { className: \"bp5-label\", style: css.label, hidden: this.props.hidden },\n this.props.label,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_Help__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { title: this.props.label, content: this.props.help }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"textarea\", { className: \"bp5-input\", style: css.textarea, disabled: this.props.disabled, readOnly: this.props.readOnly, autoCapitalize: \"off\", spellCheck: false, placeholder: this.props.placeholder, rows: this.props.rows, value: this.props.value || '', onChange: (evt) => {\n this.props.onChange(evt.target.value);\n } }));\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvY29tcG9uZW50cy9QYWdlVGV4dEFyZWEuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFDK0I7QUFDTDtBQUNPO0FBY2pDLE1BQU0sR0FBRyxHQUFHO0lBQ1gsS0FBSyxFQUFFO1FBQ04sS0FBSyxFQUFFLE1BQU07UUFDYixRQUFRLEVBQUUsT0FBTztLQUNNO0lBQ3hCLFFBQVEsRUFBRTtRQUNULEtBQUssRUFBRSxNQUFNO1FB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RcdC8+XG5cdFx0PC9sYWJlbD47XG5cdH1cbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./app/components/PageTextArea.js\n"); /***/ }), @@ -3867,7 +3867,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PageTextAreaTab)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Help__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Help */ \"./app/components/Help.js\");\n/* harmony import */ var _Theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Theme */ \"./app/Theme.js\");\n\n\n\nconst css = {\n label: {\n width: '100%',\n maxWidth: '280px',\n },\n textarea: {\n width: '100%',\n resize: 'none',\n fontSize: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceSize,\n fontFamily: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceFont,\n },\n tab: {\n fontSize: '12px',\n lineHeight: '24px',\n userSelect: 'none',\n },\n};\nclass PageTextAreaTab extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props, context) {\n super(props, context);\n this.state = {\n activeIndex: 0,\n };\n }\n render() {\n let activeIndex = this.state.activeIndex || 0;\n let tabs = [];\n for (let i = 0; i < (this.props.tabs || []).length; i++) {\n let tab = this.props.tabs[i];\n let index = i;\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"li\", { key: i, className: \"bp5-tab\", style: css.tab, role: \"tab\", \"aria-selected\": i == activeIndex, onClick: () => {\n this.setState({\n ...this.state,\n activeIndex: index,\n });\n } }, tab));\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"label\", { className: \"bp5-label\", style: css.label, hidden: this.props.hidden },\n this.props.label,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_Help__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { title: this.props.label, content: this.props.help }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-tabs\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"ul\", { className: \"bp5-tab-list .modifier\", role: \"tablist\" }, tabs)),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"textarea\", { className: \"bp5-input\", style: css.textarea, disabled: this.props.disabled, readOnly: this.props.readOnly, autoCapitalize: \"off\", spellCheck: false, placeholder: this.props.placeholder, rows: this.props.rows, value: this.props.values[activeIndex] || '', onChange: (evt) => {\n this.props.onChange(this.props.tabs[this.state.activeIndex], evt.target.value);\n } }));\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvY29tcG9uZW50cy9QYWdlVGV4dEFyZWFUYWIuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFDK0I7QUFDTDtBQUNRO0FBbUJsQyxNQUFNLEdBQUcsR0FBRztJQUNYLEtBQUssRUFBRTtRQUNOLEtBQUssRUFBRSxNQUFNO1FBQ2IsUUFBUSxFQUFFLE9BQU87S0FDTTtJQUN4QixRQUFRLEVBQUU7UUFDVCxLQUFLLEVBQUUsTUFBTTtRQUNiLE1BQU0sRUFBRSxNQUFNO1FBQ2QsUUFBUSxFQUFFLGlEQUFtQjtRQUM3QixVQUFVLEVBQUUsaURBQW1CO0tBQ1I7SUFDeEIsR0FBRyxFQUFFO1FBQ0osUUFBUSxFQUFFLE1BQU07UUFDaEIsV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lZH1cblx0XHRcdFx0cmVhZE9ubHk9e3RoaXMucHJvcHMucmVhZE9ubHl9XG5cdFx0XHRcdGF1dG9DYXBpdGFsaXplPVwib2ZmXCJcblx0XHRcdFx0c3BlbGxDaGVjaz17ZmFsc2V9XG5cdFx0XHRcdHBsYWNlaG9sZGVyPXt0aGlzLnByb3BzLnBsYWNlaG9sZGVyfVxuXHRcdFx0XHRyb3dzPXt0aGlzLnByb3BzLnJvd3N9XG5cdFx0XHRcdHZhbHVlPXt0aGlzLnByb3BzLnZhbHVlc1thY3RpdmVJbmRleF0gfHwgJyd9XG5cdFx0XHRcdG9uQ2hhbmdlPXsoZXZ0KTogdm9pZCA9PiB7XG5cdFx0XHRcdFx0dGhpcy5wcm9wcy5vbkNoYW5nZShcblx0XHRcdFx0XHRcdHRoaXMucHJvcHMudGFic1t0aGlzLnN0YXRlLmFjdGl2ZUluZGV4XSxcblx0XHRcdFx0XHRcdGV2dC50YXJnZXQudmFsdWUsXG5cdFx0XHRcdFx0KTtcblx0XHRcdFx0fX1cblx0XHRcdC8+XG5cdFx0PC9sYWJlbD47XG5cdH1cbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./app/components/PageTextAreaTab.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PageTextAreaTab)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Help__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Help */ \"./app/components/Help.js\");\n/* harmony import */ var _Theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Theme */ \"./app/Theme.js\");\n\n\n\nconst css = {\n label: {\n width: '100%',\n maxWidth: '280px',\n },\n textarea: {\n width: '100%',\n resize: 'none',\n fontSize: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceSize,\n fontFamily: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceFont,\n fontWeight: _Theme__WEBPACK_IMPORTED_MODULE_2__.monospaceWeight,\n },\n tab: {\n fontSize: '12px',\n lineHeight: '24px',\n userSelect: 'none',\n },\n};\nclass PageTextAreaTab extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props, context) {\n super(props, context);\n this.state = {\n activeIndex: 0,\n };\n }\n render() {\n let activeIndex = this.state.activeIndex || 0;\n let tabs = [];\n for (let i = 0; i < (this.props.tabs || []).length; i++) {\n let tab = this.props.tabs[i];\n let index = i;\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"li\", { key: i, className: \"bp5-tab\", style: css.tab, role: \"tab\", \"aria-selected\": i == activeIndex, onClick: () => {\n this.setState({\n ...this.state,\n activeIndex: index,\n });\n } }, tab));\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"label\", { className: \"bp5-label\", style: css.label, hidden: this.props.hidden },\n this.props.label,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_Help__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { title: this.props.label, content: this.props.help }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-tabs\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"ul\", { className: \"bp5-tab-list .modifier\", role: \"tablist\" }, tabs)),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"textarea\", { className: \"bp5-input\", style: css.textarea, disabled: this.props.disabled, readOnly: this.props.readOnly, autoCapitalize: \"off\", spellCheck: false, placeholder: this.props.placeholder, rows: this.props.rows, value: this.props.values[activeIndex] || '', onChange: (evt) => {\n this.props.onChange(this.props.tabs[this.state.activeIndex], evt.target.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xcblx0XHRcdFx0XHRcdGV2dC50YXJnZXQudmFsdWUsXG5cdFx0XHRcdFx0KTtcblx0XHRcdFx0fX1cblx0XHRcdC8+XG5cdFx0PC9sYWJlbD47XG5cdH1cbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./app/components/PageTextAreaTab.js\n"); /***/ }), @@ -4098,7 +4098,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ SettingsProvider)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _PageInput__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PageInput */ \"./app/components/PageInput.js\");\n/* harmony import */ var _PageInputButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PageInputButton */ \"./app/components/PageInputButton.js\");\n/* harmony import */ var _PageTextArea__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PageTextArea */ \"./app/components/PageTextArea.js\");\n/* harmony import */ var _PageSwitch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PageSwitch */ \"./app/components/PageSwitch.js\");\n/* harmony import */ var _PageInfo__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PageInfo */ \"./app/components/PageInfo.js\");\n/* harmony import */ var _PageSelect__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PageSelect */ \"./app/components/PageSelect.js\");\n/* harmony import */ var _Help__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Help */ \"./app/components/Help.js\");\n\n\n\n\n\n\n\n\nconst css = {\n label: {\n fontSize: '16px',\n margin: '0 0 7px 0',\n },\n card: {\n marginBottom: '5px',\n },\n role: {\n margin: '9px 5px 0 5px',\n height: '20px',\n },\n};\nclass SettingsProvider extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props, context) {\n super(props, context);\n this.state = {\n addRole: '',\n };\n }\n clone() {\n return {\n ...this.props.provider,\n };\n }\n azure() {\n let provider = this.props.provider;\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Directory ID\", help: \"Azure active directory ID\", type: \"text\", placeholder: \"Azure directory ID\", value: provider.tenant, onChange: (val) => {\n let state = this.clone();\n state.tenant = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Application ID\", help: \"Azure application ID\", type: \"text\", placeholder: \"Azure application ID\", value: provider.client_id, onChange: (val) => {\n let state = this.clone();\n state.client_id = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Application Secret\", help: \"Azure application secret\", type: \"text\", placeholder: \"Azure application secret\", value: provider.client_secret, onChange: (val) => {\n let state = this.clone();\n state.client_secret = val;\n this.props.onChange(state);\n } }));\n }\n authzero() {\n let provider = this.props.provider;\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Auth0 Sub-Domain\", help: \"Subdomain of Auth0 application. Enter subdomain portion only such as 'pritunl' for pritunl.auth0.com\", type: \"text\", placeholder: \"Auth0 sub-domain\", value: provider.domain, onChange: (val) => {\n let state = this.clone();\n state.domain = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Client ID\", help: \"Auth0 application client ID\", type: \"text\", placeholder: \"Auth0 client ID\", value: provider.client_id, onChange: (val) => {\n let state = this.clone();\n state.client_id = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Client Secret\", help: \"Auth0 application client secret\", type: \"text\", placeholder: \"Auth0 client secret\", value: provider.client_secret, onChange: (val) => {\n let state = this.clone();\n state.client_secret = val;\n this.props.onChange(state);\n } }));\n }\n google() {\n let provider = this.props.provider;\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Domain\", help: \"Domain segment of email address to match\", type: \"text\", placeholder: \"Google domain to match\", value: provider.domain, onChange: (val) => {\n let state = this.clone();\n state.domain = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Google Admin Email\", help: \"Optional, the email address of an administrator user in the Google G Suite to delegate API access to. This user will be used to get the groups of Google users. Only needed when providing the Google JSON private key.\", type: \"text\", placeholder: \"Google admin email\", value: provider.google_email, onChange: (val) => {\n let state = this.clone();\n state.google_email = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageTextArea__WEBPACK_IMPORTED_MODULE_3__[\"default\"], { label: \"Google JSON Private Key\", help: \"Optional, private key for service account in JSON format. This will copy the Google users groups to Pritunl Zero. Also requires Google admin email.\", placeholder: \"Google JSON private key\", rows: 6, value: provider.google_key, onChange: (val) => {\n let state = this.clone();\n state.google_key = val;\n this.props.onChange(state);\n } }));\n }\n onelogin() {\n let provider = this.props.provider;\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Issuer URL\", help: \"Single sign-on URL found in OneLogin app settings\", type: \"text\", placeholder: \"OneLogin issuer URL\", value: provider.issuer_url, onChange: (val) => {\n let state = this.clone();\n state.issuer_url = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"SAML 2.0 Endpoint (HTTP)\", help: \"SAML 2.0 endpoint found in OneLogin app settings\", type: \"text\", placeholder: \"OneLogin SAML endpoint\", value: provider.saml_url, onChange: (val) => {\n let state = this.clone();\n state.saml_url = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageTextArea__WEBPACK_IMPORTED_MODULE_3__[\"default\"], { label: \"X.509 Certificate\", help: \"X.509 certificate found in OneLogin app settings\", placeholder: \"OneLogin X.509 certificate\", rows: 6, value: provider.saml_cert, onChange: (val) => {\n let state = this.clone();\n state.saml_cert = val;\n this.props.onChange(state);\n } }));\n }\n okta() {\n let provider = this.props.provider;\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Identity Provider Single Sign-On URL\", help: \"Single sign-on URL found in Okta app settings\", type: \"text\", placeholder: \"Okta single sign-on URL\", value: provider.saml_url, onChange: (val) => {\n let state = this.clone();\n state.saml_url = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Identity Provider Issuer URL\", help: \"Issuer URL found in Okta app settings\", type: \"text\", placeholder: \"Okta issuer URL\", value: provider.issuer_url, onChange: (val) => {\n let state = this.clone();\n state.issuer_url = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageTextArea__WEBPACK_IMPORTED_MODULE_3__[\"default\"], { label: \"X.509 Certificate\", help: \"X.509 certificate found in Okta app settings\", placeholder: \"Okta X.509 certificate\", rows: 6, value: provider.saml_cert, onChange: (val) => {\n let state = this.clone();\n state.saml_cert = val;\n this.props.onChange(state);\n } }));\n }\n jumpcloud() {\n let provider = this.props.provider;\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Identity Provider Single Sign-On URL\", help: \"Single sign-on URL found in JumpCloud app settings\", type: \"text\", placeholder: \"JumpCloud single sign-on URL\", value: provider.saml_url, onChange: (val) => {\n let state = this.clone();\n state.saml_url = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Identity Provider Issuer URL\", help: \"Issuer URL found in JumpCloud app settings\", type: \"text\", placeholder: \"JumpCloud issuer URL\", value: provider.issuer_url, onChange: (val) => {\n let state = this.clone();\n state.issuer_url = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageTextArea__WEBPACK_IMPORTED_MODULE_3__[\"default\"], { label: \"X.509 Certificate\", help: \"X.509 certificate found in JumpCloud app settings\", placeholder: \"JumpCloud X.509 certificate\", rows: 6, value: provider.saml_cert, onChange: (val) => {\n let state = this.clone();\n state.saml_cert = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"JumpCloud App ID\", help: \"Optional, ID of JumpCloud Pritunl app. This can be found in the URL of the app settings page. Required to verify user is attached to JumpCloud application\", type: \"text\", placeholder: \"JumpCloud app ID\", value: provider.jumpcloud_app_id, onChange: (val) => {\n let state = this.clone();\n state.jumpcloud_app_id = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"JumpCloud API Key\", help: \"JumpCloud API key for user account status verfication\", type: \"text\", placeholder: \"JumpCloud client secret\", value: provider.jumpcloud_secret, onChange: (val) => {\n let state = this.clone();\n state.jumpcloud_secret = val;\n this.props.onChange(state);\n } }));\n }\n render() {\n let provider = this.props.provider;\n let label = '';\n let options;\n switch (provider.type) {\n case 'azure':\n label = 'Azure';\n options = this.azure();\n break;\n case 'authzero':\n label = 'Auth0';\n options = this.authzero();\n break;\n case 'google':\n label = 'Google';\n options = this.google();\n break;\n case 'onelogin':\n label = 'OneLogin';\n options = this.onelogin();\n break;\n case 'okta':\n label = 'Okta';\n options = this.okta();\n break;\n case 'jumpcloud':\n label = 'JumpCloud';\n options = this.jumpcloud();\n break;\n }\n let roles = [];\n for (let role of provider.default_roles) {\n roles.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-tag bp5-tag-removable bp5-intent-primary\", style: css.role, key: role },\n role,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-tag-remove\", onMouseUp: () => {\n let rls = [\n ...this.props.provider.default_roles,\n ];\n let i = rls.indexOf(role);\n if (i === -1) {\n return;\n }\n rls.splice(i, 1);\n let state = this.clone();\n state.default_roles = rls;\n this.props.onChange(state);\n } })));\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-card\", style: css.card },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h6\", { style: css.label }, label),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInfo__WEBPACK_IMPORTED_MODULE_5__[\"default\"], { fields: [\n {\n label: 'ID',\n value: provider.id || 'None',\n },\n ] }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Label\", help: \"Provider label that will be shown to users on the login page\", type: \"text\", placeholder: \"Provider label\", value: provider.label, onChange: (val) => {\n let state = this.clone();\n state.label = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"label\", { className: \"bp5-label\", hidden: !provider.auto_create },\n \"Default Roles\",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_Help__WEBPACK_IMPORTED_MODULE_7__[\"default\"], { title: \"Default Roles\", content: \"When the user has authenticated for the first time these roles will be given to the user. These roles may also be used to update the users roles depending on the role management option.\" }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, roles)),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInputButton__WEBPACK_IMPORTED_MODULE_2__[\"default\"], { buttonClass: \"bp5-intent-success bp5-icon-add\", label: \"Add\", type: \"text\", placeholder: \"Add default role\", hidden: !provider.auto_create, value: this.state.addRole, onChange: (val) => {\n this.setState({\n ...this.state,\n addRole: val,\n });\n }, onSubmit: () => {\n let rls = [\n ...this.props.provider.default_roles,\n ];\n if (!this.state.addRole) {\n return;\n }\n if (rls.indexOf(this.state.addRole) === -1) {\n rls.push(this.state.addRole);\n }\n rls.sort();\n let state = this.clone();\n state.default_roles = rls;\n this.props.onChange(state);\n this.setState({\n ...this.state,\n addRole: '',\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageSwitch__WEBPACK_IMPORTED_MODULE_4__[\"default\"], { label: \"Create user on authentication\", help: \"Create the user on first authentication. If this is disabled all users must be manually created before they are able to authenticate.\", checked: provider.auto_create, onToggle: () => {\n let state = this.clone();\n state.auto_create = !state.auto_create;\n if (!state.auto_create &&\n state.role_management === 'set_on_insert') {\n state.role_management = 'merge';\n }\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageSelect__WEBPACK_IMPORTED_MODULE_6__[\"default\"], { label: \"Role Management\", help: \"When the user authenticates for the first time a user will be created and the users roles will be set to the roles configured above. This is referenced as set on insert. It may be desired to update the roles on subsequent authentications. For this the merge mode can be used which will take the users current roles and merge them with the roles configured above using all the roles from both sets. Overwrite mode will replace the users roles on every authentication with the roles configured above. It is important to consider that if a users roles are modified those modifications will be lost when the overwrite mode is used.\", value: provider.role_management, onChange: (val) => {\n let state = this.clone();\n state.role_management = val;\n this.props.onChange(state);\n } },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: \"set_on_insert\", hidden: !provider.auto_create }, \"Set on insert\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: \"merge\" }, \"Merge\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: \"overwrite\" }, \"Overwrite\")),\n options,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-intent-danger\", onClick: () => {\n this.props.onRemove();\n } }, \"Remove\"));\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvY29tcG9uZW50cy9TZXR0aW5nc1Byb3ZpZGVyLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7QUFDK0I7QUFFSztBQUNZO0FBQ047QUFDSjtBQUNKO0FBQ0k7QUFDWjtBQVkxQixNQUFNLEdBQUcsR0FBRztJQUNYLEtBQUssRUFBRTtRQUNOLFFBQVEsRUFBRSxNQUFNO1FBQ2hCLE1BQU0sRUFBRSxXQUFXO0tBQ0k7SUFDeEIsSUFBSSxFQUFFO1FBQ0wsWUFBWSxFQUFFLEtBQUs7S0FDSTtJQUN4QixJQUFJLEVBQUU7UUFDTCxNQUFNLEVBQUUsZUFBZTtRQUN2QixNQUFNLEV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HRcdFx0PlxuXHRcdFx0XHQ8b3B0aW9uXG5cdFx0XHRcdFx0dmFsdWU9XCJzZXRfb25faW5zZXJ0XCJcblx0XHRcdFx0XHRoaWRkZW49eyFwcm92aWRlci5hdXRvX2NyZWF0ZX1cblx0XHRcdFx0PlNldCBvbiBpbnNlcnQ8L29wdGlvbj5cblx0XHRcdFx0PG9wdGlvbiB2YWx1ZT1cIm1lcmdlXCI+TWVyZ2U8L29wdGlvbj5cblx0XHRcdFx0PG9wdGlvbiB2YWx1ZT1cIm92ZXJ3cml0ZVwiPk92ZXJ3cml0ZTwvb3B0aW9uPlxuXHRcdFx0PC9QYWdlU2VsZWN0PlxuXHRcdFx0e29wdGlvbnN9XG5cdFx0XHQ8YnV0dG9uXG5cdFx0XHRcdGNsYXNzTmFtZT1cImJwNS1idXR0b24gYnA1LWludGVudC1kYW5nZXJcIlxuXHRcdFx0XHRvbkNsaWNrPXsoKTogdm9pZCA9PiB7XG5cdFx0XHRcdFx0dGhpcy5wcm9wcy5vblJlbW92ZSgpO1xuXHRcdFx0XHR9fVxuXHRcdFx0PlJlbW92ZTwvYnV0dG9uPlxuXHRcdDwvZGl2Pjtcblx0fVxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./app/components/SettingsProvider.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ SettingsProvider)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _PageInput__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PageInput */ \"./app/components/PageInput.js\");\n/* harmony import */ var _PageInputButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PageInputButton */ \"./app/components/PageInputButton.js\");\n/* harmony import */ var _PageTextArea__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PageTextArea */ \"./app/components/PageTextArea.js\");\n/* harmony import */ var _PageSwitch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PageSwitch */ \"./app/components/PageSwitch.js\");\n/* harmony import */ var _PageInfo__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PageInfo */ \"./app/components/PageInfo.js\");\n/* harmony import */ var _PageSelect__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PageSelect */ \"./app/components/PageSelect.js\");\n/* harmony import */ var _Help__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Help */ \"./app/components/Help.js\");\n\n\n\n\n\n\n\n\nconst css = {\n label: {\n fontSize: '16px',\n margin: '0 0 7px 0',\n },\n card: {\n marginBottom: '5px',\n },\n role: {\n margin: '9px 5px 0 5px',\n height: '20px',\n },\n};\nclass SettingsProvider extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props, context) {\n super(props, context);\n this.state = {\n addRole: '',\n };\n }\n clone() {\n return {\n ...this.props.provider,\n };\n }\n azure() {\n let provider = this.props.provider;\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageSelect__WEBPACK_IMPORTED_MODULE_6__[\"default\"], { label: \"Region\", help: \"Azure active directory region\", value: provider.region, onChange: (val) => {\n let state = this.clone();\n state.region = val;\n this.props.onChange(state);\n } },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: \"global2\" }, \"Global (OAuth v2)\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: \"us-gov2\" }, \"US Goverment (OAuth v2)\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: \"china2\" }, \"China (OAuth v2)\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: \"global\" }, \"Global (OAuth v1)\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: \"us-gov\" }, \"US Goverment (OAuth v1)\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: \"china\" }, \"China (OAuth v1)\")),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Directory ID\", help: \"Azure active directory ID\", type: \"text\", placeholder: \"Azure directory ID\", value: provider.tenant, onChange: (val) => {\n let state = this.clone();\n state.tenant = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Application ID\", help: \"Azure application ID\", type: \"text\", placeholder: \"Azure application ID\", value: provider.client_id, onChange: (val) => {\n let state = this.clone();\n state.client_id = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Application Secret\", help: \"Azure application secret\", type: \"text\", placeholder: \"Azure application secret\", value: provider.client_secret, onChange: (val) => {\n let state = this.clone();\n state.client_secret = val;\n this.props.onChange(state);\n } }));\n }\n authzero() {\n let provider = this.props.provider;\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Auth0 Sub-Domain\", help: \"Subdomain of Auth0 application. Enter subdomain portion only such as 'pritunl' for pritunl.auth0.com\", type: \"text\", placeholder: \"Auth0 sub-domain\", value: provider.domain, onChange: (val) => {\n let state = this.clone();\n state.domain = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Client ID\", help: \"Auth0 application client ID\", type: \"text\", placeholder: \"Auth0 client ID\", value: provider.client_id, onChange: (val) => {\n let state = this.clone();\n state.client_id = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Client Secret\", help: \"Auth0 application client secret\", type: \"text\", placeholder: \"Auth0 client secret\", value: provider.client_secret, onChange: (val) => {\n let state = this.clone();\n state.client_secret = val;\n this.props.onChange(state);\n } }));\n }\n google() {\n let provider = this.props.provider;\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Domain\", help: \"Domain segment of email address to match\", type: \"text\", placeholder: \"Google domain to match\", value: provider.domain, onChange: (val) => {\n let state = this.clone();\n state.domain = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Google Admin Email\", help: \"Optional, the email address of an administrator user in the Google G Suite to delegate API access to. This user will be used to get the groups of Google users. Only needed when providing the Google JSON private key.\", type: \"text\", placeholder: \"Google admin email\", value: provider.google_email, onChange: (val) => {\n let state = this.clone();\n state.google_email = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageTextArea__WEBPACK_IMPORTED_MODULE_3__[\"default\"], { label: \"Google JSON Private Key\", help: \"Optional, private key for service account in JSON format. This will copy the Google users groups to Pritunl Zero. Also requires Google admin email.\", placeholder: \"Google JSON private key\", rows: 6, value: provider.google_key, onChange: (val) => {\n let state = this.clone();\n state.google_key = val;\n this.props.onChange(state);\n } }));\n }\n onelogin() {\n let provider = this.props.provider;\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Issuer URL\", help: \"Single sign-on URL found in OneLogin app settings\", type: \"text\", placeholder: \"OneLogin issuer URL\", value: provider.issuer_url, onChange: (val) => {\n let state = this.clone();\n state.issuer_url = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"SAML 2.0 Endpoint (HTTP)\", help: \"SAML 2.0 endpoint found in OneLogin app settings\", type: \"text\", placeholder: \"OneLogin SAML endpoint\", value: provider.saml_url, onChange: (val) => {\n let state = this.clone();\n state.saml_url = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageTextArea__WEBPACK_IMPORTED_MODULE_3__[\"default\"], { label: \"X.509 Certificate\", help: \"X.509 certificate found in OneLogin app settings\", placeholder: \"OneLogin X.509 certificate\", rows: 6, value: provider.saml_cert, onChange: (val) => {\n let state = this.clone();\n state.saml_cert = val;\n this.props.onChange(state);\n } }));\n }\n okta() {\n let provider = this.props.provider;\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Identity Provider Single Sign-On URL\", help: \"Single sign-on URL found in Okta app settings\", type: \"text\", placeholder: \"Okta single sign-on URL\", value: provider.saml_url, onChange: (val) => {\n let state = this.clone();\n state.saml_url = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Identity Provider Issuer URL\", help: \"Issuer URL found in Okta app settings\", type: \"text\", placeholder: \"Okta issuer URL\", value: provider.issuer_url, onChange: (val) => {\n let state = this.clone();\n state.issuer_url = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageTextArea__WEBPACK_IMPORTED_MODULE_3__[\"default\"], { label: \"X.509 Certificate\", help: \"X.509 certificate found in Okta app settings\", placeholder: \"Okta X.509 certificate\", rows: 6, value: provider.saml_cert, onChange: (val) => {\n let state = this.clone();\n state.saml_cert = val;\n this.props.onChange(state);\n } }));\n }\n jumpcloud() {\n let provider = this.props.provider;\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Identity Provider Single Sign-On URL\", help: \"Single sign-on URL found in JumpCloud app settings\", type: \"text\", placeholder: \"JumpCloud single sign-on URL\", value: provider.saml_url, onChange: (val) => {\n let state = this.clone();\n state.saml_url = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Identity Provider Issuer URL\", help: \"Issuer URL found in JumpCloud app settings\", type: \"text\", placeholder: \"JumpCloud issuer URL\", value: provider.issuer_url, onChange: (val) => {\n let state = this.clone();\n state.issuer_url = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageTextArea__WEBPACK_IMPORTED_MODULE_3__[\"default\"], { label: \"X.509 Certificate\", help: \"X.509 certificate found in JumpCloud app settings\", placeholder: \"JumpCloud X.509 certificate\", rows: 6, value: provider.saml_cert, onChange: (val) => {\n let state = this.clone();\n state.saml_cert = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"JumpCloud App ID\", help: \"Optional, ID of JumpCloud Pritunl app. This can be found in the URL of the app settings page. Required to verify user is attached to JumpCloud application\", type: \"text\", placeholder: \"JumpCloud app ID\", value: provider.jumpcloud_app_id, onChange: (val) => {\n let state = this.clone();\n state.jumpcloud_app_id = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"JumpCloud API Key\", help: \"JumpCloud API key for user account status verfication\", type: \"text\", placeholder: \"JumpCloud client secret\", value: provider.jumpcloud_secret, onChange: (val) => {\n let state = this.clone();\n state.jumpcloud_secret = val;\n this.props.onChange(state);\n } }));\n }\n render() {\n let provider = this.props.provider;\n let label = '';\n let options;\n switch (provider.type) {\n case 'azure':\n label = 'Azure';\n options = this.azure();\n break;\n case 'authzero':\n label = 'Auth0';\n options = this.authzero();\n break;\n case 'google':\n label = 'Google';\n options = this.google();\n break;\n case 'onelogin':\n label = 'OneLogin';\n options = this.onelogin();\n break;\n case 'okta':\n label = 'Okta';\n options = this.okta();\n break;\n case 'jumpcloud':\n label = 'JumpCloud';\n options = this.jumpcloud();\n break;\n }\n let roles = [];\n for (let role of provider.default_roles) {\n roles.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-tag bp5-tag-removable bp5-intent-primary\", style: css.role, key: role },\n role,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-tag-remove\", onMouseUp: () => {\n let rls = [\n ...this.props.provider.default_roles,\n ];\n let i = rls.indexOf(role);\n if (i === -1) {\n return;\n }\n rls.splice(i, 1);\n let state = this.clone();\n state.default_roles = rls;\n this.props.onChange(state);\n } })));\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-card\", style: css.card },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"h6\", { style: css.label }, label),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInfo__WEBPACK_IMPORTED_MODULE_5__[\"default\"], { fields: [\n {\n label: 'ID',\n value: provider.id || 'None',\n },\n ] }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInput__WEBPACK_IMPORTED_MODULE_1__[\"default\"], { label: \"Label\", help: \"Provider label that will be shown to users on the login page\", type: \"text\", placeholder: \"Provider label\", value: provider.label, onChange: (val) => {\n let state = this.clone();\n state.label = val;\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"label\", { className: \"bp5-label\", hidden: !provider.auto_create },\n \"Default Roles\",\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_Help__WEBPACK_IMPORTED_MODULE_7__[\"default\"], { title: \"Default Roles\", content: \"When the user has authenticated for the first time these roles will be given to the user. These roles may also be used to update the users roles depending on the role management option.\" }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, roles)),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageInputButton__WEBPACK_IMPORTED_MODULE_2__[\"default\"], { buttonClass: \"bp5-intent-success bp5-icon-add\", label: \"Add\", type: \"text\", placeholder: \"Add default role\", hidden: !provider.auto_create, value: this.state.addRole, onChange: (val) => {\n this.setState({\n ...this.state,\n addRole: val,\n });\n }, onSubmit: () => {\n let rls = [\n ...this.props.provider.default_roles,\n ];\n if (!this.state.addRole) {\n return;\n }\n if (rls.indexOf(this.state.addRole) === -1) {\n rls.push(this.state.addRole);\n }\n rls.sort();\n let state = this.clone();\n state.default_roles = rls;\n this.props.onChange(state);\n this.setState({\n ...this.state,\n addRole: '',\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageSwitch__WEBPACK_IMPORTED_MODULE_4__[\"default\"], { label: \"Create user on authentication\", help: \"Create the user on first authentication. If this is disabled all users must be manually created before they are able to authenticate.\", checked: provider.auto_create, onToggle: () => {\n let state = this.clone();\n state.auto_create = !state.auto_create;\n if (!state.auto_create &&\n state.role_management === 'set_on_insert') {\n state.role_management = 'merge';\n }\n this.props.onChange(state);\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_PageSelect__WEBPACK_IMPORTED_MODULE_6__[\"default\"], { label: \"Role Management\", help: \"When the user authenticates for the first time a user will be created and the users roles will be set to the roles configured above. This is referenced as set on insert. It may be desired to update the roles on subsequent authentications. For this the merge mode can be used which will take the users current roles and merge them with the roles configured above using all the roles from both sets. Overwrite mode will replace the users roles on every authentication with the roles configured above. It is important to consider that if a users roles are modified those modifications will be lost when the overwrite mode is used.\", value: provider.role_management, onChange: (val) => {\n let state = this.clone();\n state.role_management = val;\n this.props.onChange(state);\n } },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: \"set_on_insert\", hidden: !provider.auto_create }, \"Set on insert\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: \"merge\" }, \"Merge\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"option\", { value: \"overwrite\" }, \"Overwrite\")),\n options,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-intent-danger\", onClick: () => {\n this.props.onRemove();\n } }, \"Remove\"));\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvY29tcG9uZW50cy9TZXR0aW5nc1Byb3ZpZGVyLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7QUFDK0I7QUFFSztBQUNZO0FBQ047QUFDSjtBQUNKO0FBQ0k7QUFDWjtBQVkxQixNQUFNLEdBQUcsR0FBRztJQUNYLEtBQUssRUFBRTtRQUNOLFFBQVEsRUFBRSxNQUFNO1FBQ2hCLE1BQU0sRUFBRSxXQUFXO0tBQ0k7SUFDeEIsSUFBSSxFQUFFO1FBQ0wsWUFBWSxFQUFFLEtBQUs7S0FDSTtJQUN4QixJQUFJLEVBQUU7UUFDTCxNQUFNLEVBQUUsZUFBZTtRQUN2QixNQUFNLEVBQUUsTUFBTTtLQUNTO0NBQ3hCLENBQUM7QUFFYSxNQUFNLGdCQUFpQixTQUFRLDRDQUE2QjtJQUMxRSxZQUFZLEtBQVUsRUFBRSxPQUFZO1FBQ25DLEtBQUssQ0FBQ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 -4153,7 +4153,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Subscription)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _actions_SubscriptionActions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../actions/SubscriptionActions */ \"./app/actions/SubscriptionActions.js\");\n/* harmony import */ var _stores_SubscriptionStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../stores/SubscriptionStore */ \"./app/stores/SubscriptionStore.js\");\n/* harmony import */ var _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/MiscUtils */ \"./app/utils/MiscUtils.js\");\n/* harmony import */ var _ConfirmButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ConfirmButton */ \"./app/components/ConfirmButton.js\");\n/* harmony import */ var _Theme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Theme */ \"./app/Theme.js\");\n\n\n\n\n\n\nconst css = {\n card: {\n padding: '10px',\n minWidth: '310px',\n maxWidth: '350px',\n width: 'calc(100% - 20px)',\n margin: '30px auto',\n },\n card2: {\n padding: '5px',\n minWidth: '310px',\n maxWidth: '380px',\n width: 'calc(100% - 20px)',\n margin: '30px auto',\n },\n status: {\n width: '180px',\n margin: '20px auto',\n fontSize: '16px',\n },\n item: {\n margin: '2px 0',\n },\n message: {\n margin: '0 0 10px 0',\n },\n license: {\n width: '100%',\n height: '130px',\n margin: '0 0 10px 0',\n resize: 'none',\n fontSize: _Theme__WEBPACK_IMPORTED_MODULE_5__.monospaceSize,\n fontFamily: _Theme__WEBPACK_IMPORTED_MODULE_5__.monospaceFont,\n },\n button: {\n width: '150px',\n margin: '5px',\n },\n button2: {\n width: '160px',\n margin: '5px',\n },\n button3: {\n width: '195px',\n margin: '5px',\n },\n buttons: {\n margin: '0 auto',\n },\n};\nclass Subscription extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props, context) {\n super(props, context);\n this.onChange = () => {\n this.setState({\n ...this.state,\n subscription: _stores_SubscriptionStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].subscription,\n });\n };\n this.state = {\n subscription: _stores_SubscriptionStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].subscription,\n update: false,\n message: '',\n license: '',\n disabled: false,\n };\n }\n componentDidMount() {\n _stores_SubscriptionStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].addChangeListener(this.onChange);\n if (!this.state.subscription.active) {\n _actions_SubscriptionActions__WEBPACK_IMPORTED_MODULE_1__.sync(true);\n }\n }\n componentWillUnmount() {\n _stores_SubscriptionStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].removeChangeListener(this.onChange);\n }\n update() {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-card bp5-elevation-2\", style: css.card },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-callout bp5-intent-success\", style: css.message, hidden: !this.state.message }, this.state.message),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"textarea\", { className: \"bp5-input\", style: css.license, disabled: this.state.disabled, placeholder: \"New License Key\", value: this.state.license, onChange: (evt) => {\n this.setState({\n ...this.state,\n license: evt.target.value,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal center-justified\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-intent-danger bp5-icon-cross\", style: css.button, disabled: this.state.disabled, onClick: () => {\n this.setState({\n ...this.state,\n update: false,\n license: '',\n });\n } }, \"Cancel\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-intent-primary bp5-icon-endorsed\", style: css.button, disabled: this.state.disabled, onClick: () => {\n this.setState({\n ...this.state,\n disabled: true,\n });\n _actions_SubscriptionActions__WEBPACK_IMPORTED_MODULE_1__.activate(this.state.license).then(() => {\n this.setState({\n ...this.state,\n disabled: false,\n update: false,\n license: '',\n });\n }).catch(() => {\n this.setState({\n ...this.state,\n disabled: false,\n });\n });\n } }, \"Update License\"))));\n }\n activate() {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-card bp5-elevation-2\", style: css.card },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-callout bp5-intent-success\", style: css.message, hidden: !this.state.message }, this.state.message),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"textarea\", { className: \"bp5-input\", style: css.license, disabled: this.state.disabled, placeholder: \"License Key\", value: this.state.license, onChange: (evt) => {\n this.setState({\n ...this.state,\n license: evt.target.value,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal center-justified\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-intent-primary bp5-icon-endorsed\", style: css.button, disabled: this.state.disabled, onClick: () => {\n this.setState({\n ...this.state,\n disabled: true,\n });\n _actions_SubscriptionActions__WEBPACK_IMPORTED_MODULE_1__.activate(this.state.license).then(() => {\n this.setState({\n ...this.state,\n disabled: false,\n });\n }).catch(() => {\n this.setState({\n ...this.state,\n disabled: false,\n });\n });\n } }, \"Activate License\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { className: \"bp5-button bp5-intent-success bp5-icon-credit-card\", style: css.button2, target: \"_blank\", href: \"https://app.pritunl.com/checkout/zero\" }, \"Create Account\"))));\n }\n reactivate() {\n let sub = this.state.subscription;\n let canceling = sub.cancel_at_period_end || sub.status === 'canceled';\n let status = sub.cancel_at_period_end ? 'canceled' : sub.status;\n let periodEnd = _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.formatDateShort(sub.period_end);\n let trialEnd = _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.formatDateShort(sub.trial_end);\n let balance;\n let balanceLabel;\n if (sub.balance < 0) {\n balance = _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.formatAmount(sub.balance * -1);\n balanceLabel = 'Credit';\n }\n else {\n balance = _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.formatAmount(sub.balance);\n balanceLabel = 'Balance';\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-card bp5-elevation-2\", style: css.card2 },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-callout bp5-intent-success\", style: css.message, hidden: !this.state.message }, this.state.message),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout vertical\", style: css.status },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" }, \"Status:\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.capitalize(status))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\", style: css.item },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" }, \"Plan:\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.capitalize(sub.plan))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\", style: css.item },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" }, \"Amount:\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.formatAmount(sub.amount))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\", style: css.item },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" }, \"Quantity:\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, sub.quantity)),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\", style: css.item, hidden: !sub.balance },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" },\n balanceLabel,\n \":\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, balance)),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\", style: css.item, hidden: periodEnd === '' },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" },\n canceling ? 'Ends' : 'Renew',\n \":\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, periodEnd)),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\", style: css.item, hidden: trialEnd === '' },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" }, \"Trial Ends:\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, trialEnd))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal center-justified\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { className: \"bp5-button bp5-intent-success bp5-icon-cog\", style: css.button2, target: \"_blank\", href: \"https://app.pritunl.com/subscription/\" +\n this.state.subscription.url_key }, \"Manage Account\")),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal center-justified\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_ConfirmButton__WEBPACK_IMPORTED_MODULE_4__[\"default\"], { className: \"bp5-intent-danger bp5-icon-delete\", progressClassName: \"bp5-intent-danger\", style: css.button2, disabled: this.state.disabled, safe: true, label: \"Remove License\", onConfirm: () => {\n this.setState({\n ...this.state,\n disabled: true,\n });\n _actions_SubscriptionActions__WEBPACK_IMPORTED_MODULE_1__.activate('').then(() => {\n this.setState({\n ...this.state,\n disabled: false,\n });\n }).catch(() => {\n this.setState({\n ...this.state,\n disabled: false,\n });\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-intent-primary bp5-icon-endorsed\", style: css.button2, disabled: this.state.disabled, onClick: () => {\n this.setState({\n ...this.state,\n update: true,\n });\n } }, \"Update License\"))));\n }\n render() {\n if (this.state.update) {\n return this.update();\n }\n else if (this.state.subscription.status) {\n return this.reactivate();\n }\n else {\n return this.activate();\n }\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvY29tcG9uZW50cy9TdWJzY3JpcHRpb24uanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFDK0I7QUFDdUM7QUFFVjtBQUVaO0FBQ0o7QUFDVjtBQVVsQyxNQUFNLEdBQUcsR0FBRztJQUNYLElBQUksRUFBRTtRQUNMLE9BQU8sRUFBRSxNQUFNO1FBQ2YsUUFBUSxFQUFFLE9BQU87UUFDakIsUUFBUSxFQUFFLE9BQU87UUFDakIsS0FBSyxFQUFFLG1CQUFtQjtRQUMxQixNQUFNLEVBQUUsV0FBVztLQUNJO0lBQ3hCLEtBQUssRUFBRTtRQ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Fx0XHRcdFx0XHRvbkNsaWNrPXsoKTogdm9pZCA9PiB7XG5cdFx0XHRcdFx0XHRcdHRoaXMuc2V0U3RhdGUoe1xuXHRcdFx0XHRcdFx0XHRcdC4uLnRoaXMuc3RhdGUsXG5cdFx0XHRcdFx0XHRcdFx0dXBkYXRlOiB0cnVlLFxuXHRcdFx0XHRcdFx0XHR9KTtcblx0XHRcdFx0XHRcdH19XG5cdFx0XHRcdFx0PlVwZGF0ZSBMaWNlbnNlPC9idXR0b24+XG5cdFx0XHRcdDwvZGl2PlxuXHRcdFx0PC9kaXY+XG5cdFx0PC9kaXY+O1xuXHR9XG5cblx0cmVuZGVyKCk6IEpTWC5FbGVtZW50IHtcblx0XHRpZiAodGhpcy5zdGF0ZS51cGRhdGUpIHtcblx0XHRcdHJldHVybiB0aGlzLnVwZGF0ZSgpO1xuXHRcdH0gZWxzZSBpZiAodGhpcy5zdGF0ZS5zdWJzY3JpcHRpb24uc3RhdHVzKSB7XG5cdFx0XHRyZXR1cm4gdGhpcy5yZWFjdGl2YXRlKCk7XG5cdFx0fSBlbHNlIHtcblx0XHRcdHJldHVybiB0aGlzLmFjdGl2YXRlKCk7XG5cdFx0fVxuXHR9XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./app/components/Subscription.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Subscription)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _actions_SubscriptionActions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../actions/SubscriptionActions */ \"./app/actions/SubscriptionActions.js\");\n/* harmony import */ var _stores_SubscriptionStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../stores/SubscriptionStore */ \"./app/stores/SubscriptionStore.js\");\n/* harmony import */ var _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/MiscUtils */ \"./app/utils/MiscUtils.js\");\n/* harmony import */ var _ConfirmButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ConfirmButton */ \"./app/components/ConfirmButton.js\");\n/* harmony import */ var _Theme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Theme */ \"./app/Theme.js\");\n\n\n\n\n\n\nconst css = {\n card: {\n padding: '10px',\n minWidth: '310px',\n maxWidth: '350px',\n width: 'calc(100% - 20px)',\n margin: '30px auto',\n },\n card2: {\n padding: '5px',\n minWidth: '310px',\n maxWidth: '380px',\n width: 'calc(100% - 20px)',\n margin: '30px auto',\n },\n status: {\n width: '180px',\n margin: '20px auto',\n fontSize: '16px',\n },\n item: {\n margin: '2px 0',\n },\n message: {\n margin: '0 0 10px 0',\n },\n license: {\n width: '100%',\n height: '130px',\n margin: '0 0 10px 0',\n resize: 'none',\n fontSize: _Theme__WEBPACK_IMPORTED_MODULE_5__.monospaceSize,\n fontFamily: _Theme__WEBPACK_IMPORTED_MODULE_5__.monospaceFont,\n fontWeight: _Theme__WEBPACK_IMPORTED_MODULE_5__.monospaceWeight,\n },\n button: {\n width: '150px',\n margin: '5px',\n },\n button2: {\n width: '160px',\n margin: '5px',\n },\n button3: {\n width: '195px',\n margin: '5px',\n },\n buttons: {\n margin: '0 auto',\n },\n};\nclass Subscription extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor(props, context) {\n super(props, context);\n this.onChange = () => {\n this.setState({\n ...this.state,\n subscription: _stores_SubscriptionStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].subscription,\n });\n };\n this.state = {\n subscription: _stores_SubscriptionStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].subscription,\n update: false,\n message: '',\n license: '',\n disabled: false,\n };\n }\n componentDidMount() {\n _stores_SubscriptionStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].addChangeListener(this.onChange);\n if (!this.state.subscription.active) {\n _actions_SubscriptionActions__WEBPACK_IMPORTED_MODULE_1__.sync(true);\n }\n }\n componentWillUnmount() {\n _stores_SubscriptionStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].removeChangeListener(this.onChange);\n }\n update() {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-card bp5-elevation-2\", style: css.card },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-callout bp5-intent-success\", style: css.message, hidden: !this.state.message }, this.state.message),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"textarea\", { className: \"bp5-input\", style: css.license, disabled: this.state.disabled, placeholder: \"New License Key\", value: this.state.license, onChange: (evt) => {\n this.setState({\n ...this.state,\n license: evt.target.value,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal center-justified\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-intent-danger bp5-icon-cross\", style: css.button, disabled: this.state.disabled, onClick: () => {\n this.setState({\n ...this.state,\n update: false,\n license: '',\n });\n } }, \"Cancel\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-intent-primary bp5-icon-endorsed\", style: css.button, disabled: this.state.disabled, onClick: () => {\n this.setState({\n ...this.state,\n disabled: true,\n });\n _actions_SubscriptionActions__WEBPACK_IMPORTED_MODULE_1__.activate(this.state.license).then(() => {\n this.setState({\n ...this.state,\n disabled: false,\n update: false,\n license: '',\n });\n }).catch(() => {\n this.setState({\n ...this.state,\n disabled: false,\n });\n });\n } }, \"Update License\"))));\n }\n activate() {\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-card bp5-elevation-2\", style: css.card },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-callout bp5-intent-success\", style: css.message, hidden: !this.state.message }, this.state.message),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"textarea\", { className: \"bp5-input\", style: css.license, disabled: this.state.disabled, placeholder: \"License Key\", value: this.state.license, onChange: (evt) => {\n this.setState({\n ...this.state,\n license: evt.target.value,\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal center-justified\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-intent-primary bp5-icon-endorsed\", style: css.button, disabled: this.state.disabled, onClick: () => {\n this.setState({\n ...this.state,\n disabled: true,\n });\n _actions_SubscriptionActions__WEBPACK_IMPORTED_MODULE_1__.activate(this.state.license).then(() => {\n this.setState({\n ...this.state,\n disabled: false,\n });\n }).catch(() => {\n this.setState({\n ...this.state,\n disabled: false,\n });\n });\n } }, \"Activate License\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { className: \"bp5-button bp5-intent-success bp5-icon-credit-card\", style: css.button2, target: \"_blank\", href: \"https://app.pritunl.com/checkout/zero\" }, \"Create Account\"))));\n }\n reactivate() {\n let sub = this.state.subscription;\n let canceling = sub.cancel_at_period_end || sub.status === 'canceled';\n let status = sub.cancel_at_period_end ? 'canceled' : sub.status;\n let periodEnd = _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.formatDateShort(sub.period_end);\n let trialEnd = _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.formatDateShort(sub.trial_end);\n let balance;\n let balanceLabel;\n if (sub.balance < 0) {\n balance = _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.formatAmount(sub.balance * -1);\n balanceLabel = 'Credit';\n }\n else {\n balance = _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.formatAmount(sub.balance);\n balanceLabel = 'Balance';\n }\n return react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-card bp5-elevation-2\", style: css.card2 },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"bp5-callout bp5-intent-success\", style: css.message, hidden: !this.state.message }, this.state.message),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout vertical\", style: css.status },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" }, \"Status:\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.capitalize(status))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\", style: css.item },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" }, \"Plan:\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.capitalize(sub.plan))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\", style: css.item },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" }, \"Amount:\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, _utils_MiscUtils__WEBPACK_IMPORTED_MODULE_3__.formatAmount(sub.amount))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\", style: css.item },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" }, \"Quantity:\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, sub.quantity)),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\", style: css.item, hidden: !sub.balance },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" },\n balanceLabel,\n \":\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, balance)),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\", style: css.item, hidden: periodEnd === '' },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" },\n canceling ? 'Ends' : 'Renew',\n \":\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, periodEnd)),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal\", style: css.item, hidden: trialEnd === '' },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"flex\" }, \"Trial Ends:\"),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, trialEnd))),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal center-justified\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"a\", { className: \"bp5-button bp5-intent-success bp5-icon-cog\", style: css.button2, target: \"_blank\", href: \"https://app.pritunl.com/subscription/\" +\n this.state.subscription.url_key }, \"Manage Account\")),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: \"layout horizontal center-justified\" },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_ConfirmButton__WEBPACK_IMPORTED_MODULE_4__[\"default\"], { className: \"bp5-intent-danger bp5-icon-delete\", progressClassName: \"bp5-intent-danger\", style: css.button2, disabled: this.state.disabled, safe: true, label: \"Remove License\", onConfirm: () => {\n this.setState({\n ...this.state,\n disabled: true,\n });\n _actions_SubscriptionActions__WEBPACK_IMPORTED_MODULE_1__.activate('').then(() => {\n this.setState({\n ...this.state,\n disabled: false,\n });\n }).catch(() => {\n this.setState({\n ...this.state,\n disabled: false,\n });\n });\n } }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { className: \"bp5-button bp5-intent-primary bp5-icon-endorsed\", style: css.button2, disabled: this.state.disabled, onClick: () => {\n this.setState({\n ...this.state,\n update: true,\n });\n } }, \"Update License\"))));\n }\n render() {\n if (this.state.update) {\n return this.update();\n }\n else if (this.state.subscription.status) {\n return this.reactivate();\n }\n else {\n return this.activate();\n }\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvY29tcG9uZW50cy9TdWJzY3JpcHRpb24uanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFDK0I7QUFDdUM7QUFFVjtBQUVaO0FBQ0o7QUFDVjtBQVVsQyxNQUFNLEdBQUcsR0FBRztJQUNYLElBQUksRUFBRTtRQUNMLE9BQU8sRUFBRSxNQUFNO1FBQ2YsUUFBUSxFQUFFLE9BQU87UUFDakIsUUFBUSxFQUFFLE9BQU87UUFDakIsS0FBSyxFQUFFLG1CQUFtQjtRQUMxQixNQUFNLEVBQUUsV0FBVztLQUNJO0lBQ3hCLEtBQUssRUFBRTtRQUNOLE9BQU8sRUFBRSxLQUFLO1FBQ2QsUUFBUSxFQUFFLE9BQU87UUFDakIsUUFBUSxFQUFFLE9BQU87UUFDakIsS0FBSyxFQUFFLG1CQUFtQjtRQUMxQixNQUFNLEVBQUUsV0FBVztLQUNJO0lBQ3hCLE1BQU0sRUFBRTtRQUNQLEtBQUssRUFBRSxPQUFPO1FBQ2QsTUFBTSxFQUFFLFdBQVc7UUFDbkIsUUFBUSxFQUFFLE1BQU07S0FDTztJQUN4QixJQUFJLEVBQUU7UUFDTCxNQUFNLEVBQUUsT0FBTztLQUNRO0lBQ3hCLE9BQU8sRUFBRTtRQUNSLE1BQU0sRUFBRSxZQUFZO0tBQ0c7SUFDeEIsT0FBTyxFQUFFO1FB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dFx0PC9kaXY+O1xuXHR9XG5cblx0cmVuZGVyKCk6IEpTWC5FbGVtZW50IHtcblx0XHRpZiAodGhpcy5zdGF0ZS51cGRhdGUpIHtcblx0XHRcdHJldHVybiB0aGlzLnVwZGF0ZSgpO1xuXHRcdH0gZWxzZSBpZiAodGhpcy5zdGF0ZS5zdWJzY3JpcHRpb24uc3RhdHVzKSB7XG5cdFx0XHRyZXR1cm4gdGhpcy5yZWFjdGl2YXRlKCk7XG5cdFx0fSBlbHNlIHtcblx0XHRcdHJldHVybiB0aGlzLmFjdGl2YXRlKCk7XG5cdFx0fVxuXHR9XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./app/components/Subscription.js\n"); /***/ }), @@ -4659,7 +4659,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CHANGE: () => (/* binding */ CHANGE),\n/* harmony export */ SYNC: () => (/* binding */ SYNC)\n/* harmony export */ });\nconst SYNC = 'settings.sync';\nconst CHANGE = 'settings.change';\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvdHlwZXMvU2V0dGluZ3NUeXBlcy5qcyIsIm1hcHBpbmdzIjoiOzs7OztBQUNPLE1BQU0sSUFBSSxHQUFHLGVBQWUsQ0FBQztBQUM3QixNQUFNLE1BQU0sR0FBRyxpQkFBaUIsQ0FBQyIsInNvdXJjZXMiOlsid2VicGFjazovL3ByaXR1bmwtemVyby8uL2FwcC90eXBlcy9TZXR0aW5nc1R5cGVzLnRzPzc5MDAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4uL1JlZmVyZW5jZXM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uXHRlbGFzdGljX3VzZXJuYW1lOiBzdHJpbmc7XG5cdGVsYXN0aWNfcGFzc3dvcmQ6IHN0cmluZztcblx0ZWxhc3RpY19wcm94eV9yZXF1ZXN0czogYm9vbGVhbjtcbn1cblxuZXhwb3J0IHR5cGUgU2V0dGluZ3NSbyA9IFJlYWRvbmx5PFNldHRpbmdzPjtcblxuZXhwb3J0IGludGVyZmFjZSBTZXR0aW5nc0Rpc3BhdGNoIHtcblx0dHlwZTogc3RyaW5nO1xuXHRkYXRhPzogU2V0dGluZ3M7XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./app/types/SettingsTypes.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CHANGE: () => (/* binding */ CHANGE),\n/* harmony export */ SYNC: () => (/* binding */ SYNC)\n/* harmony export */ });\nconst SYNC = 'settings.sync';\nconst CHANGE = 'settings.change';\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hcHAvdHlwZXMvU2V0dGluZ3NUeXBlcy5qcyIsIm1hcHBpbmdzIjoiOzs7OztBQUNPLE1BQU0sSUFBSSxHQUFHLGVBQWUsQ0FBQztBQUM3QixNQUFNLE1BQU0sR0FBRyxpQkFBaUIsQ0FBQyIsInNvdXJjZXMiOlsid2VicGFjazovL3ByaXR1bmwtemVyby8uL2FwcC90eXBlcy9TZXR0aW5nc1R5cGVzLnRzPzc5MDAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4uL1JlZmVyZW5jZXMuZC50c1wiLz5cbmV4cG9ydCBjb25zdCBTWU5DID0gJ3NldHRpbmdzLnN5bmMnO1xuZXhwb3J0IGNvbnN0IENIQU5HRSA9ICdzZXR0aW5ncy5jaGFuZ2UnO1xuXG5leHBvcnQgaW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9ubHk8U2V0dGluZ3M+O1xuXG5leHBvcnQgaW50ZXJmYWNlIFNldHRpbmdzRGlzcGF0Y2gge1xuXHR0eXBlOiBzdHJpbmc7XG5cdGRhdGE/OiBTZXR0aW5ncztcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./app/types/SettingsTypes.js\n"); /***/ }), @@ -6379,56 +6379,6 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ }), -/***/ "./node_modules/ace-builds/src-noconflict/ace.js": -/*!*******************************************************!*\ - !*** ./node_modules/ace-builds/src-noconflict/ace.js ***! - \*******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("/* module decorator */ module = __webpack_require__.nmd(module);\n/* ***** BEGIN LICENSE BLOCK *****\n * Distributed under the BSD license:\n *\n * Copyright (c) 2010, Ajax.org B.V.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * * Neither the name of Ajax.org B.V. nor the\n * names of its contributors may be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * ***** END LICENSE BLOCK ***** */\n\n/**\n * Define a module along with a payload\n * @param module a name for the payload\n * @param payload a function to call with (require, exports, module) params\n */\n\n(function() {\n\nvar ACE_NAMESPACE = \"ace\";\n\nvar global = (function() { return this; })();\nif (!global && typeof window != \"undefined\") global = window; // strict mode\n\n\nif (!ACE_NAMESPACE && typeof requirejs !== \"undefined\")\n return;\n\n\nvar define = function(module, deps, payload) {\n if (typeof module !== \"string\") {\n if (define.original)\n define.original.apply(this, arguments);\n else {\n console.error(\"dropping module because define wasn\\'t a string.\");\n console.trace();\n }\n return;\n }\n if (arguments.length == 2)\n payload = deps;\n if (!define.modules[module]) {\n define.payloads[module] = payload;\n define.modules[module] = null;\n }\n};\n\ndefine.modules = {};\ndefine.payloads = {};\n\n/**\n * Get at functionality define()ed using the function above\n */\nvar _require = function(parentId, module, callback) {\n if (typeof module === \"string\") {\n var payload = lookup(parentId, module);\n if (payload != undefined) {\n callback && callback();\n return payload;\n }\n } else if (Object.prototype.toString.call(module) === \"[object Array]\") {\n var params = [];\n for (var i = 0, l = module.length; i < l; ++i) {\n var dep = lookup(parentId, module[i]);\n if (dep == undefined && require.original)\n return;\n params.push(dep);\n }\n return callback && callback.apply(null, params) || true;\n }\n};\n\nvar require = function(module, callback) {\n var packagedModule = _require(\"\", module, callback);\n if (packagedModule == undefined && require.original)\n return require.original.apply(this, arguments);\n return packagedModule;\n};\n\nvar normalizeModule = function(parentId, moduleName) {\n // normalize plugin requires\n if (moduleName.indexOf(\"!\") !== -1) {\n var chunks = moduleName.split(\"!\");\n return normalizeModule(parentId, chunks[0]) + \"!\" + normalizeModule(parentId, chunks[1]);\n }\n // normalize relative requires\n if (moduleName.charAt(0) == \".\") {\n var base = parentId.split(\"/\").slice(0, -1).join(\"/\");\n moduleName = base + \"/\" + moduleName;\n\n while(moduleName.indexOf(\".\") !== -1 && previous != moduleName) {\n var previous = moduleName;\n moduleName = moduleName.replace(/\\/\\.\\//, \"/\").replace(/[^\\/]+\\/\\.\\.\\//, \"\");\n }\n }\n return moduleName;\n};\n\n/**\n * Internal function to lookup moduleNames and resolve them by calling the\n * definition function if needed.\n */\nvar lookup = function(parentId, moduleName) {\n moduleName = normalizeModule(parentId, moduleName);\n\n var module = define.modules[moduleName];\n if (!module) {\n module = define.payloads[moduleName];\n if (typeof module === 'function') {\n var exports = {};\n var mod = {\n id: moduleName,\n uri: '',\n exports: exports,\n packaged: true\n };\n\n var req = function(module, callback) {\n return _require(moduleName, module, callback);\n };\n\n var returnValue = module(req, exports, mod);\n exports = returnValue || mod.exports;\n define.modules[moduleName] = exports;\n delete define.payloads[moduleName];\n }\n module = define.modules[moduleName] = exports || module;\n }\n return module;\n};\n\nfunction exportAce(ns) {\n var root = global;\n if (ns) {\n if (!global[ns])\n global[ns] = {};\n root = global[ns];\n }\n\n if (!root.define || !root.define.packaged) {\n define.original = root.define;\n root.define = define;\n root.define.packaged = true;\n }\n\n if (!root.require || !root.require.packaged) {\n require.original = root.require;\n root.require = require;\n root.require.packaged = true;\n }\n}\n\nexportAce(ACE_NAMESPACE);\n\n})();\n\nace.define(\"ace/lib/es6-shim\",[\"require\",\"exports\",\"module\"], function(require, exports, module){function defineProp(obj, name, val) {\n Object.defineProperty(obj, name, {\n value: val,\n enumerable: false,\n writable: true,\n configurable: true\n });\n}\nif (!String.prototype.startsWith) {\n defineProp(String.prototype, \"startsWith\", function (searchString, position) {\n position = position || 0;\n return this.lastIndexOf(searchString, position) === position;\n });\n}\nif (!String.prototype.endsWith) {\n defineProp(String.prototype, \"endsWith\", function (searchString, position) {\n var subjectString = this;\n if (position === undefined || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n });\n}\nif (!String.prototype.repeat) {\n defineProp(String.prototype, \"repeat\", function (count) {\n var result = \"\";\n var string = this;\n while (count > 0) {\n if (count & 1)\n result += string;\n if ((count >>= 1))\n string += string;\n }\n return result;\n });\n}\nif (!String.prototype.includes) {\n defineProp(String.prototype, \"includes\", function (str, position) {\n return this.indexOf(str, position) != -1;\n });\n}\nif (!Object.assign) {\n Object.assign = function (target) {\n if (target === undefined || target === null) {\n throw new TypeError(\"Cannot convert undefined or null to object\");\n }\n var output = Object(target);\n for (var index = 1; index < arguments.length; index++) {\n var source = arguments[index];\n if (source !== undefined && source !== null) {\n Object.keys(source).forEach(function (key) {\n output[key] = source[key];\n });\n }\n }\n return output;\n };\n}\nif (!Object.values) {\n Object.values = function (o) {\n return Object.keys(o).map(function (k) {\n return o[k];\n });\n };\n}\nif (!Array.prototype.find) {\n defineProp(Array.prototype, \"find\", function (predicate) {\n var len = this.length;\n var thisArg = arguments[1];\n for (var k = 0; k < len; k++) {\n var kValue = this[k];\n if (predicate.call(thisArg, kValue, k, this)) {\n return kValue;\n }\n }\n });\n}\nif (!Array.prototype.findIndex) {\n defineProp(Array.prototype, \"findIndex\", function (predicate) {\n var len = this.length;\n var thisArg = arguments[1];\n for (var k = 0; k < len; k++) {\n var kValue = this[k];\n if (predicate.call(thisArg, kValue, k, this)) {\n return k;\n }\n }\n });\n}\nif (!Array.prototype.includes) {\n defineProp(Array.prototype, \"includes\", function (item, position) {\n return this.indexOf(item, position) != -1;\n });\n}\nif (!Array.prototype.fill) {\n defineProp(Array.prototype, \"fill\", function (value) {\n var O = this;\n var len = O.length >>> 0;\n var start = arguments[1];\n var relativeStart = start >> 0;\n var k = relativeStart < 0\n ? Math.max(len + relativeStart, 0)\n : Math.min(relativeStart, len);\n var end = arguments[2];\n var relativeEnd = end === undefined ? len : end >> 0;\n var final = relativeEnd < 0\n ? Math.max(len + relativeEnd, 0)\n : Math.min(relativeEnd, len);\n while (k < final) {\n O[k] = value;\n k++;\n }\n return O;\n });\n}\nif (!Array.of) {\n defineProp(Array, \"of\", function () {\n return Array.prototype.slice.call(arguments);\n });\n}\n\n});\n\nace.define(\"ace/lib/fixoldbrowsers\",[\"require\",\"exports\",\"module\",\"ace/lib/es6-shim\"], function(require, exports, module){// vim:set ts=4 sts=4 sw=4 st:\n\"use strict\";\nrequire(\"./es6-shim\");\n\n});\n\nace.define(\"ace/lib/deep_copy\",[\"require\",\"exports\",\"module\"], function(require, exports, module){exports.deepCopy = function deepCopy(obj) {\n if (typeof obj !== \"object\" || !obj)\n return obj;\n var copy;\n if (Array.isArray(obj)) {\n copy = [];\n for (var key = 0; key < obj.length; key++) {\n copy[key] = deepCopy(obj[key]);\n }\n return copy;\n }\n if (Object.prototype.toString.call(obj) !== \"[object Object]\")\n return obj;\n copy = {};\n for (var key in obj)\n copy[key] = deepCopy(obj[key]);\n return copy;\n};\n\n});\n\nace.define(\"ace/lib/lang\",[\"require\",\"exports\",\"module\",\"ace/lib/deep_copy\"], function(require, exports, module){\"use strict\";\nexports.last = function (a) {\n return a[a.length - 1];\n};\nexports.stringReverse = function (string) {\n return string.split(\"\").reverse().join(\"\");\n};\nexports.stringRepeat = function (string, count) {\n var result = '';\n while (count > 0) {\n if (count & 1)\n result += string;\n if (count >>= 1)\n string += string;\n }\n return result;\n};\nvar trimBeginRegexp = /^\\s\\s*/;\nvar trimEndRegexp = /\\s\\s*$/;\nexports.stringTrimLeft = function (string) {\n return string.replace(trimBeginRegexp, '');\n};\nexports.stringTrimRight = function (string) {\n return string.replace(trimEndRegexp, '');\n};\nexports.copyObject = function (obj) {\n var copy = {};\n for (var key in obj) {\n copy[key] = obj[key];\n }\n return copy;\n};\nexports.copyArray = function (array) {\n var copy = [];\n for (var i = 0, l = array.length; i < l; i++) {\n if (array[i] && typeof array[i] == \"object\")\n copy[i] = this.copyObject(array[i]);\n else\n copy[i] = array[i];\n }\n return copy;\n};\nexports.deepCopy = require(\"./deep_copy\").deepCopy;\nexports.arrayToMap = function (arr) {\n var map = {};\n for (var i = 0; i < arr.length; i++) {\n map[arr[i]] = 1;\n }\n return map;\n};\nexports.createMap = function (props) {\n var map = Object.create(null);\n for (var i in props) {\n map[i] = props[i];\n }\n return map;\n};\nexports.arrayRemove = function (array, value) {\n for (var i = 0; i <= array.length; i++) {\n if (value === array[i]) {\n array.splice(i, 1);\n }\n }\n};\nexports.escapeRegExp = function (str) {\n return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g, '\\\\$1');\n};\nexports.escapeHTML = function (str) {\n return (\"\" + str).replace(/&/g, \"&\").replace(/\"/g, \""\").replace(/'/g, \"'\").replace(/ 0xffff ? 2 : 1;\n};\n\n});\n\nace.define(\"ace/lib/useragent\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nexports.OS = {\n LINUX: \"LINUX\",\n MAC: \"MAC\",\n WINDOWS: \"WINDOWS\"\n};\nexports.getOS = function () {\n if (exports.isMac) {\n return exports.OS.MAC;\n }\n else if (exports.isLinux) {\n return exports.OS.LINUX;\n }\n else {\n return exports.OS.WINDOWS;\n }\n};\nvar _navigator = typeof navigator == \"object\" ? navigator : {};\nvar os = (/mac|win|linux/i.exec(_navigator.platform) || [\"other\"])[0].toLowerCase();\nvar ua = _navigator.userAgent || \"\";\nvar appName = _navigator.appName || \"\";\nexports.isWin = (os == \"win\");\nexports.isMac = (os == \"mac\");\nexports.isLinux = (os == \"linux\");\nexports.isIE =\n (appName == \"Microsoft Internet Explorer\" || appName.indexOf(\"MSAppHost\") >= 0)\n ? parseFloat((ua.match(/(?:MSIE |Trident\\/[0-9]+[\\.0-9]+;.*rv:)([0-9]+[\\.0-9]+)/) || [])[1])\n : parseFloat((ua.match(/(?:Trident\\/[0-9]+[\\.0-9]+;.*rv:)([0-9]+[\\.0-9]+)/) || [])[1]); // for ie\nexports.isOldIE = exports.isIE && exports.isIE < 9;\nexports.isGecko = exports.isMozilla = ua.match(/ Gecko\\/\\d+/);\nexports.isOpera = typeof opera == \"object\" && Object.prototype.toString.call(window[\"opera\"]) == \"[object Opera]\";\nexports.isWebKit = parseFloat(ua.split(\"WebKit/\")[1]) || undefined;\nexports.isChrome = parseFloat(ua.split(\" Chrome/\")[1]) || undefined;\nexports.isSafari = parseFloat(ua.split(\" Safari/\")[1]) && !exports.isChrome || undefined;\nexports.isEdge = parseFloat(ua.split(\" Edge/\")[1]) || undefined;\nexports.isAIR = ua.indexOf(\"AdobeAIR\") >= 0;\nexports.isAndroid = ua.indexOf(\"Android\") >= 0;\nexports.isChromeOS = ua.indexOf(\" CrOS \") >= 0;\nexports.isIOS = /iPad|iPhone|iPod/.test(ua) && !window[\"MSStream\"];\nif (exports.isIOS)\n exports.isMac = true;\nexports.isMobile = exports.isIOS || exports.isAndroid;\n\n});\n\nace.define(\"ace/lib/dom\",[\"require\",\"exports\",\"module\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar useragent = require(\"./useragent\");\nvar XHTML_NS = \"http://www.w3.org/1999/xhtml\";\nexports.buildDom = function buildDom(arr, parent, refs) {\n if (typeof arr == \"string\" && arr) {\n var txt = document.createTextNode(arr);\n if (parent)\n parent.appendChild(txt);\n return txt;\n }\n if (!Array.isArray(arr)) {\n if (arr && arr.appendChild && parent)\n parent.appendChild(arr);\n return arr;\n }\n if (typeof arr[0] != \"string\" || !arr[0]) {\n var els = [];\n for (var i = 0; i < arr.length; i++) {\n var ch = buildDom(arr[i], parent, refs);\n ch && els.push(ch);\n }\n return els;\n }\n var el = document.createElement(arr[0]);\n var options = arr[1];\n var childIndex = 1;\n if (options && typeof options == \"object\" && !Array.isArray(options))\n childIndex = 2;\n for (var i = childIndex; i < arr.length; i++)\n buildDom(arr[i], el, refs);\n if (childIndex == 2) {\n Object.keys(options).forEach(function (n) {\n var val = options[n];\n if (n === \"class\") {\n el.className = Array.isArray(val) ? val.join(\" \") : val;\n }\n else if (typeof val == \"function\" || n == \"value\" || n[0] == \"$\") {\n el[n] = val;\n }\n else if (n === \"ref\") {\n if (refs)\n refs[val] = el;\n }\n else if (n === \"style\") {\n if (typeof val == \"string\")\n el.style.cssText = val;\n }\n else if (val != null) {\n el.setAttribute(n, val);\n }\n });\n }\n if (parent)\n parent.appendChild(el);\n return el;\n};\nexports.getDocumentHead = function (doc) {\n if (!doc)\n doc = document;\n return doc.head || doc.getElementsByTagName(\"head\")[0] || doc.documentElement;\n};\nexports.createElement = function (tag, ns) {\n return document.createElementNS ?\n document.createElementNS(ns || XHTML_NS, tag) :\n document.createElement(tag);\n};\nexports.removeChildren = function (element) {\n element.innerHTML = \"\";\n};\nexports.createTextNode = function (textContent, element) {\n var doc = element ? element.ownerDocument : document;\n return doc.createTextNode(textContent);\n};\nexports.createFragment = function (element) {\n var doc = element ? element.ownerDocument : document;\n return doc.createDocumentFragment();\n};\nexports.hasCssClass = function (el, name) {\n var classes = (el.className + \"\").split(/\\s+/g);\n return classes.indexOf(name) !== -1;\n};\nexports.addCssClass = function (el, name) {\n if (!exports.hasCssClass(el, name)) {\n el.className += \" \" + name;\n }\n};\nexports.removeCssClass = function (el, name) {\n var classes = el.className.split(/\\s+/g);\n while (true) {\n var index = classes.indexOf(name);\n if (index == -1) {\n break;\n }\n classes.splice(index, 1);\n }\n el.className = classes.join(\" \");\n};\nexports.toggleCssClass = function (el, name) {\n var classes = el.className.split(/\\s+/g), add = true;\n while (true) {\n var index = classes.indexOf(name);\n if (index == -1) {\n break;\n }\n add = false;\n classes.splice(index, 1);\n }\n if (add)\n classes.push(name);\n el.className = classes.join(\" \");\n return add;\n};\nexports.setCssClass = function (node, className, include) {\n if (include) {\n exports.addCssClass(node, className);\n }\n else {\n exports.removeCssClass(node, className);\n }\n};\nexports.hasCssString = function (id, doc) {\n var index = 0, sheets;\n doc = doc || document;\n if ((sheets = doc.querySelectorAll(\"style\"))) {\n while (index < sheets.length) {\n if (sheets[index++].id === id) {\n return true;\n }\n }\n }\n};\nexports.removeElementById = function (id, doc) {\n doc = doc || document;\n if (doc.getElementById(id)) {\n doc.getElementById(id).remove();\n }\n};\nvar strictCSP;\nvar cssCache = [];\nexports.useStrictCSP = function (value) {\n strictCSP = value;\n if (value == false)\n insertPendingStyles();\n else if (!cssCache)\n cssCache = [];\n};\nfunction insertPendingStyles() {\n var cache = cssCache;\n cssCache = null;\n cache && cache.forEach(function (item) {\n importCssString(item[0], item[1]);\n });\n}\nfunction importCssString(cssText, id, target) {\n if (typeof document == \"undefined\")\n return;\n if (cssCache) {\n if (target) {\n insertPendingStyles();\n }\n else if (target === false) {\n return cssCache.push([cssText, id]);\n }\n }\n if (strictCSP)\n return;\n var container = target;\n if (!target || !target.getRootNode) {\n container = document;\n }\n else {\n container = target.getRootNode();\n if (!container || container == target)\n container = document;\n }\n var doc = container.ownerDocument || container;\n if (id && exports.hasCssString(id, container))\n return null;\n if (id)\n cssText += \"\\n/*# sourceURL=ace/css/\" + id + \" */\";\n var style = exports.createElement(\"style\");\n style.appendChild(doc.createTextNode(cssText));\n if (id)\n style.id = id;\n if (container == doc)\n container = exports.getDocumentHead(doc);\n container.insertBefore(style, container.firstChild);\n}\nexports.importCssString = importCssString;\nexports.importCssStylsheet = function (uri, doc) {\n exports.buildDom([\"link\", { rel: \"stylesheet\", href: uri }], exports.getDocumentHead(doc));\n};\nexports.scrollbarWidth = function (doc) {\n var inner = exports.createElement(\"ace_inner\");\n inner.style.width = \"100%\";\n inner.style.minWidth = \"0px\";\n inner.style.height = \"200px\";\n inner.style.display = \"block\";\n var outer = exports.createElement(\"ace_outer\");\n var style = outer.style;\n style.position = \"absolute\";\n style.left = \"-10000px\";\n style.overflow = \"hidden\";\n style.width = \"200px\";\n style.minWidth = \"0px\";\n style.height = \"150px\";\n style.display = \"block\";\n outer.appendChild(inner);\n var body = (doc && doc.documentElement) || (document && document.documentElement);\n if (!body)\n return 0;\n body.appendChild(outer);\n var noScrollbar = inner.offsetWidth;\n style.overflow = \"scroll\";\n var withScrollbar = inner.offsetWidth;\n if (noScrollbar === withScrollbar) {\n withScrollbar = outer.clientWidth;\n }\n body.removeChild(outer);\n return noScrollbar - withScrollbar;\n};\nexports.computedStyle = function (element, style) {\n return window.getComputedStyle(element, \"\") || {};\n};\nexports.setStyle = function (styles, property, value) {\n if (styles[property] !== value) {\n styles[property] = value;\n }\n};\nexports.HAS_CSS_ANIMATION = false;\nexports.HAS_CSS_TRANSFORMS = false;\nexports.HI_DPI = useragent.isWin\n ? typeof window !== \"undefined\" && window.devicePixelRatio >= 1.5\n : true;\nif (useragent.isChromeOS)\n exports.HI_DPI = false;\nif (typeof document !== \"undefined\") {\n var div = document.createElement(\"div\");\n if (exports.HI_DPI && div.style.transform !== undefined)\n exports.HAS_CSS_TRANSFORMS = true;\n if (!useragent.isEdge && typeof div.style.animationName !== \"undefined\")\n exports.HAS_CSS_ANIMATION = true;\n div = null;\n}\nif (exports.HAS_CSS_TRANSFORMS) {\n exports.translate = function (element, tx, ty) {\n element.style.transform = \"translate(\" + Math.round(tx) + \"px, \" + Math.round(ty) + \"px)\";\n };\n}\nelse {\n exports.translate = function (element, tx, ty) {\n element.style.top = Math.round(ty) + \"px\";\n element.style.left = Math.round(tx) + \"px\";\n };\n}\n\n});\n\nace.define(\"ace/lib/net\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){/*\n * based on code from:\n *\n * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\"use strict\";\nvar dom = require(\"./dom\");\nexports.get = function (url, callback) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n callback(xhr.responseText);\n }\n };\n xhr.send(null);\n};\nexports.loadScript = function (path, callback) {\n var head = dom.getDocumentHead();\n var s = document.createElement('script');\n s.src = path;\n head.appendChild(s);\n s.onload = s.onreadystatechange = function (_, isAbort) {\n if (isAbort || !s.readyState || s.readyState == \"loaded\" || s.readyState == \"complete\") {\n s = s.onload = s.onreadystatechange = null;\n if (!isAbort)\n callback();\n }\n };\n};\nexports.qualifyURL = function (url) {\n var a = document.createElement('a');\n a.href = url;\n return a.href;\n};\n\n});\n\nace.define(\"ace/lib/oop\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nexports.inherits = function (ctor, superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n};\nexports.mixin = function (obj, mixin) {\n for (var key in mixin) {\n obj[key] = mixin[key];\n }\n return obj;\n};\nexports.implement = function (proto, mixin) {\n exports.mixin(proto, mixin);\n};\n\n});\n\nace.define(\"ace/lib/event_emitter\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar EventEmitter = {};\nvar stopPropagation = function () { this.propagationStopped = true; };\nvar preventDefault = function () { this.defaultPrevented = true; };\nEventEmitter._emit =\n EventEmitter._dispatchEvent = function (eventName, e) {\n this._eventRegistry || (this._eventRegistry = {});\n this._defaultHandlers || (this._defaultHandlers = {});\n var listeners = this._eventRegistry[eventName] || [];\n var defaultHandler = this._defaultHandlers[eventName];\n if (!listeners.length && !defaultHandler)\n return;\n if (typeof e != \"object\" || !e)\n e = {};\n if (!e.type)\n e.type = eventName;\n if (!e.stopPropagation)\n e.stopPropagation = stopPropagation;\n if (!e.preventDefault)\n e.preventDefault = preventDefault;\n listeners = listeners.slice();\n for (var i = 0; i < listeners.length; i++) {\n listeners[i](e, this);\n if (e.propagationStopped)\n break;\n }\n if (defaultHandler && !e.defaultPrevented)\n return defaultHandler(e, this);\n };\nEventEmitter._signal = function (eventName, e) {\n var listeners = (this._eventRegistry || {})[eventName];\n if (!listeners)\n return;\n listeners = listeners.slice();\n for (var i = 0; i < listeners.length; i++)\n listeners[i](e, this);\n};\nEventEmitter.once = function (eventName, callback) {\n var _self = this;\n this.on(eventName, function newCallback() {\n _self.off(eventName, newCallback);\n callback.apply(null, arguments);\n });\n if (!callback) {\n return new Promise(function (resolve) {\n callback = resolve;\n });\n }\n};\nEventEmitter.setDefaultHandler = function (eventName, callback) {\n var handlers = this._defaultHandlers;\n if (!handlers)\n handlers = this._defaultHandlers = { _disabled_: {} };\n if (handlers[eventName]) {\n var old = handlers[eventName];\n var disabled = handlers._disabled_[eventName];\n if (!disabled)\n handlers._disabled_[eventName] = disabled = [];\n disabled.push(old);\n var i = disabled.indexOf(callback);\n if (i != -1)\n disabled.splice(i, 1);\n }\n handlers[eventName] = callback;\n};\nEventEmitter.removeDefaultHandler = function (eventName, callback) {\n var handlers = this._defaultHandlers;\n if (!handlers)\n return;\n var disabled = handlers._disabled_[eventName];\n if (handlers[eventName] == callback) {\n if (disabled)\n this.setDefaultHandler(eventName, disabled.pop());\n }\n else if (disabled) {\n var i = disabled.indexOf(callback);\n if (i != -1)\n disabled.splice(i, 1);\n }\n};\nEventEmitter.on =\n EventEmitter.addEventListener = function (eventName, callback, capturing) {\n this._eventRegistry = this._eventRegistry || {};\n var listeners = this._eventRegistry[eventName];\n if (!listeners)\n listeners = this._eventRegistry[eventName] = [];\n if (listeners.indexOf(callback) == -1)\n listeners[capturing ? \"unshift\" : \"push\"](callback);\n return callback;\n };\nEventEmitter.off =\n EventEmitter.removeListener =\n EventEmitter.removeEventListener = function (eventName, callback) {\n this._eventRegistry = this._eventRegistry || {};\n var listeners = this._eventRegistry[eventName];\n if (!listeners)\n return;\n var index = listeners.indexOf(callback);\n if (index !== -1)\n listeners.splice(index, 1);\n };\nEventEmitter.removeAllListeners = function (eventName) {\n if (!eventName)\n this._eventRegistry = this._defaultHandlers = undefined;\n if (this._eventRegistry)\n this._eventRegistry[eventName] = undefined;\n if (this._defaultHandlers)\n this._defaultHandlers[eventName] = undefined;\n};\nexports.EventEmitter = EventEmitter;\n\n});\n\nace.define(\"ace/lib/report_error\",[\"require\",\"exports\",\"module\"], function(require, exports, module){exports.reportError = function reportError(msg, data) {\n var e = new Error(msg);\n e[\"data\"] = data;\n if (typeof console == \"object\" && console.error)\n console.error(e);\n setTimeout(function () { throw e; });\n};\n\n});\n\nace.define(\"ace/lib/default_english_messages\",[\"require\",\"exports\",\"module\"], function(require, exports, module){var defaultEnglishMessages = {\n \"autocomplete.popup.aria-roledescription\": \"Autocomplete suggestions\",\n \"autocomplete.popup.aria-label\": \"Autocomplete suggestions\",\n \"autocomplete.popup.item.aria-roledescription\": \"item\",\n \"autocomplete.loading\": \"Loading...\",\n \"editor.scroller.aria-roledescription\": \"editor\",\n \"editor.scroller.aria-label\": \"Editor content, press Enter to start editing, press Escape to exit\",\n \"editor.gutter.aria-roledescription\": \"editor\",\n \"editor.gutter.aria-label\": \"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit\",\n \"error-marker.good-state\": \"Looks good!\",\n \"prompt.recently-used\": \"Recently used\",\n \"prompt.other-commands\": \"Other commands\",\n \"prompt.no-matching-commands\": \"No matching commands\",\n \"search-box.find.placeholder\": \"Search for\",\n \"search-box.find-all.text\": \"All\",\n \"search-box.replace.placeholder\": \"Replace with\",\n \"search-box.replace-next.text\": \"Replace\",\n \"search-box.replace-all.text\": \"All\",\n \"search-box.toggle-replace.title\": \"Toggle Replace mode\",\n \"search-box.toggle-regexp.title\": \"RegExp Search\",\n \"search-box.toggle-case.title\": \"CaseSensitive Search\",\n \"search-box.toggle-whole-word.title\": \"Whole Word Search\",\n \"search-box.toggle-in-selection.title\": \"Search In Selection\",\n \"search-box.search-counter\": \"$0 of $1\",\n \"text-input.aria-roledescription\": \"editor\",\n \"text-input.aria-label\": \"Cursor at row $0\",\n \"gutter.code-folding.range.aria-label\": \"Toggle code folding, rows $0 through $1\",\n \"gutter.code-folding.closed.aria-label\": \"Toggle code folding, rows $0 through $1\",\n \"gutter.code-folding.open.aria-label\": \"Toggle code folding, row $0\",\n \"gutter.code-folding.closed.title\": \"Unfold code\",\n \"gutter.code-folding.open.title\": \"Fold code\",\n \"gutter.annotation.aria-label.error\": \"Error, read annotations row $0\",\n \"gutter.annotation.aria-label.warning\": \"Warning, read annotations row $0\",\n \"gutter.annotation.aria-label.info\": \"Info, read annotations row $0\",\n \"inline-fold.closed.title\": \"Unfold code\",\n \"gutter-tooltip.aria-label.error.singular\": \"error\",\n \"gutter-tooltip.aria-label.error.plural\": \"errors\",\n \"gutter-tooltip.aria-label.warning.singular\": \"warning\",\n \"gutter-tooltip.aria-label.warning.plural\": \"warnings\",\n \"gutter-tooltip.aria-label.info.singular\": \"information message\",\n \"gutter-tooltip.aria-label.info.plural\": \"information messages\"\n};\nexports.defaultEnglishMessages = defaultEnglishMessages;\n\n});\n\nace.define(\"ace/lib/app_config\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\",\"ace/lib/report_error\",\"ace/lib/default_english_messages\"], function(require, exports, module){\"no use strict\";\nvar oop = require(\"./oop\");\nvar EventEmitter = require(\"./event_emitter\").EventEmitter;\nvar reportError = require(\"./report_error\").reportError;\nvar defaultEnglishMessages = require(\"./default_english_messages\").defaultEnglishMessages;\nvar optionsProvider = {\n setOptions: function (optList) {\n Object.keys(optList).forEach(function (key) {\n this.setOption(key, optList[key]);\n }, this);\n },\n getOptions: function (optionNames) {\n var result = {};\n if (!optionNames) {\n var options = this.$options;\n optionNames = Object.keys(options).filter(function (key) {\n return !options[key].hidden;\n });\n }\n else if (!Array.isArray(optionNames)) {\n result = optionNames;\n optionNames = Object.keys(result);\n }\n optionNames.forEach(function (key) {\n result[key] = this.getOption(key);\n }, this);\n return result;\n },\n setOption: function (name, value) {\n if (this[\"$\" + name] === value)\n return;\n var opt = this.$options[name];\n if (!opt) {\n return warn('misspelled option \"' + name + '\"');\n }\n if (opt.forwardTo)\n return this[opt.forwardTo] && this[opt.forwardTo].setOption(name, value);\n if (!opt.handlesSet)\n this[\"$\" + name] = value;\n if (opt && opt.set)\n opt.set.call(this, value);\n },\n getOption: function (name) {\n var opt = this.$options[name];\n if (!opt) {\n return warn('misspelled option \"' + name + '\"');\n }\n if (opt.forwardTo)\n return this[opt.forwardTo] && this[opt.forwardTo].getOption(name);\n return opt && opt.get ? opt.get.call(this) : this[\"$\" + name];\n }\n};\nfunction warn(message) {\n if (typeof console != \"undefined\" && console.warn)\n console.warn.apply(console, arguments);\n}\nvar messages;\nvar AppConfig = /** @class */ (function () {\n function AppConfig() {\n this.$defaultOptions = {};\n messages = defaultEnglishMessages;\n }\n AppConfig.prototype.defineOptions = function (obj, path, options) {\n if (!obj.$options)\n this.$defaultOptions[path] = obj.$options = {};\n Object.keys(options).forEach(function (key) {\n var opt = options[key];\n if (typeof opt == \"string\")\n opt = { forwardTo: opt };\n opt.name || (opt.name = key);\n obj.$options[opt.name] = opt;\n if (\"initialValue\" in opt)\n obj[\"$\" + opt.name] = opt.initialValue;\n });\n oop.implement(obj, optionsProvider);\n return this;\n };\n AppConfig.prototype.resetOptions = function (obj) {\n Object.keys(obj.$options).forEach(function (key) {\n var opt = obj.$options[key];\n if (\"value\" in opt)\n obj.setOption(key, opt.value);\n });\n };\n AppConfig.prototype.setDefaultValue = function (path, name, value) {\n if (!path) {\n for (path in this.$defaultOptions)\n if (this.$defaultOptions[path][name])\n break;\n if (!this.$defaultOptions[path][name])\n return false;\n }\n var opts = this.$defaultOptions[path] || (this.$defaultOptions[path] = {});\n if (opts[name]) {\n if (opts.forwardTo)\n this.setDefaultValue(opts.forwardTo, name, value);\n else\n opts[name].value = value;\n }\n };\n AppConfig.prototype.setDefaultValues = function (path, optionHash) {\n Object.keys(optionHash).forEach(function (key) {\n this.setDefaultValue(path, key, optionHash[key]);\n }, this);\n };\n AppConfig.prototype.setMessages = function (value) {\n messages = value;\n };\n AppConfig.prototype.nls = function (key, defaultString, params) {\n if (!messages[key]) {\n warn(\"No message found for the key '\" + key + \"' in the provided messages, trying to find a translation for the default string '\" + defaultString + \"'.\");\n if (!messages[defaultString]) {\n warn(\"No message found for the default string '\" + defaultString + \"' in the provided messages. Falling back to the default English message.\");\n }\n }\n var translated = messages[key] || messages[defaultString] || defaultString;\n if (params) {\n translated = translated.replace(/\\$(\\$|[\\d]+)/g, function (_, name) {\n if (name == \"$\")\n return \"$\";\n return params[name];\n });\n }\n return translated;\n };\n return AppConfig;\n}());\nAppConfig.prototype.warn = warn;\nAppConfig.prototype.reportError = reportError;\noop.implement(AppConfig.prototype, EventEmitter);\nexports.AppConfig = AppConfig;\n\n});\n\nace.define(\"ace/theme/textmate-css\",[\"require\",\"exports\",\"module\"], function(require, exports, module){module.exports = \".ace-tm .ace_gutter {\\n background: #f0f0f0;\\n color: #333;\\n}\\n\\n.ace-tm .ace_print-margin {\\n width: 1px;\\n background: #e8e8e8;\\n}\\n\\n.ace-tm .ace_fold {\\n background-color: #6B72E6;\\n}\\n\\n.ace-tm {\\n background-color: #FFFFFF;\\n color: black;\\n}\\n\\n.ace-tm .ace_cursor {\\n color: black;\\n}\\n \\n.ace-tm .ace_invisible {\\n color: rgb(191, 191, 191);\\n}\\n\\n.ace-tm .ace_storage,\\n.ace-tm .ace_keyword {\\n color: blue;\\n}\\n\\n.ace-tm .ace_constant {\\n color: rgb(197, 6, 11);\\n}\\n\\n.ace-tm .ace_constant.ace_buildin {\\n color: rgb(88, 72, 246);\\n}\\n\\n.ace-tm .ace_constant.ace_language {\\n color: rgb(88, 92, 246);\\n}\\n\\n.ace-tm .ace_constant.ace_library {\\n color: rgb(6, 150, 14);\\n}\\n\\n.ace-tm .ace_invalid {\\n background-color: rgba(255, 0, 0, 0.1);\\n color: red;\\n}\\n\\n.ace-tm .ace_support.ace_function {\\n color: rgb(60, 76, 114);\\n}\\n\\n.ace-tm .ace_support.ace_constant {\\n color: rgb(6, 150, 14);\\n}\\n\\n.ace-tm .ace_support.ace_type,\\n.ace-tm .ace_support.ace_class {\\n color: rgb(109, 121, 222);\\n}\\n\\n.ace-tm .ace_keyword.ace_operator {\\n color: rgb(104, 118, 135);\\n}\\n\\n.ace-tm .ace_string {\\n color: rgb(3, 106, 7);\\n}\\n\\n.ace-tm .ace_comment {\\n color: rgb(76, 136, 107);\\n}\\n\\n.ace-tm .ace_comment.ace_doc {\\n color: rgb(0, 102, 255);\\n}\\n\\n.ace-tm .ace_comment.ace_doc.ace_tag {\\n color: rgb(128, 159, 191);\\n}\\n\\n.ace-tm .ace_constant.ace_numeric {\\n color: rgb(0, 0, 205);\\n}\\n\\n.ace-tm .ace_variable {\\n color: rgb(49, 132, 149);\\n}\\n\\n.ace-tm .ace_xml-pe {\\n color: rgb(104, 104, 91);\\n}\\n\\n.ace-tm .ace_entity.ace_name.ace_function {\\n color: #0000A2;\\n}\\n\\n\\n.ace-tm .ace_heading {\\n color: rgb(12, 7, 255);\\n}\\n\\n.ace-tm .ace_list {\\n color:rgb(185, 6, 144);\\n}\\n\\n.ace-tm .ace_meta.ace_tag {\\n color:rgb(0, 22, 142);\\n}\\n\\n.ace-tm .ace_string.ace_regex {\\n color: rgb(255, 0, 0)\\n}\\n\\n.ace-tm .ace_marker-layer .ace_selection {\\n background: rgb(181, 213, 255);\\n}\\n.ace-tm.ace_multiselect .ace_selection.ace_start {\\n box-shadow: 0 0 3px 0px white;\\n}\\n.ace-tm .ace_marker-layer .ace_step {\\n background: rgb(252, 255, 0);\\n}\\n\\n.ace-tm .ace_marker-layer .ace_stack {\\n background: rgb(164, 229, 101);\\n}\\n\\n.ace-tm .ace_marker-layer .ace_bracket {\\n margin: -1px 0 0 -1px;\\n border: 1px solid rgb(192, 192, 192);\\n}\\n\\n.ace-tm .ace_marker-layer .ace_active-line {\\n background: rgba(0, 0, 0, 0.07);\\n}\\n\\n.ace-tm .ace_gutter-active-line {\\n background-color : #dcdcdc;\\n}\\n\\n.ace-tm .ace_marker-layer .ace_selected-word {\\n background: rgb(250, 250, 255);\\n border: 1px solid rgb(200, 200, 250);\\n}\\n\\n.ace-tm .ace_indent-guide {\\n background: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\\\") right repeat-y;\\n}\\n\\n.ace-tm .ace_indent-guide-active {\\n background: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC\\\") right repeat-y;\\n}\\n\";\n\n});\n\nace.define(\"ace/theme/textmate\",[\"require\",\"exports\",\"module\",\"ace/theme/textmate-css\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nexports.isDark = false;\nexports.cssClass = \"ace-tm\";\nexports.cssText = require(\"./textmate-css\");\nexports.$id = \"ace/theme/textmate\";\nvar dom = require(\"../lib/dom\");\ndom.importCssString(exports.cssText, exports.cssClass, false);\n\n});\n\nace.define(\"ace/config\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\",\"ace/lib/net\",\"ace/lib/dom\",\"ace/lib/app_config\",\"ace/theme/textmate\"], function(require, exports, module){\"no use strict\";\nvar lang = require(\"./lib/lang\");\nvar net = require(\"./lib/net\");\nvar dom = require(\"./lib/dom\");\nvar AppConfig = require(\"./lib/app_config\").AppConfig;\nmodule.exports = exports = new AppConfig();\nvar options = {\n packaged: false,\n workerPath: null,\n modePath: null,\n themePath: null,\n basePath: \"\",\n suffix: \".js\",\n $moduleUrls: {},\n loadWorkerFromBlob: true,\n sharedPopups: false,\n useStrictCSP: null\n};\nexports.get = function (key) {\n if (!options.hasOwnProperty(key))\n throw new Error(\"Unknown config key: \" + key);\n return options[key];\n};\nexports.set = function (key, value) {\n if (options.hasOwnProperty(key))\n options[key] = value;\n else if (this.setDefaultValue(\"\", key, value) == false)\n throw new Error(\"Unknown config key: \" + key);\n if (key == \"useStrictCSP\")\n dom.useStrictCSP(value);\n};\nexports.all = function () {\n return lang.copyObject(options);\n};\nexports.$modes = {};\nexports.moduleUrl = function (name, component) {\n if (options.$moduleUrls[name])\n return options.$moduleUrls[name];\n var parts = name.split(\"/\");\n component = component || parts[parts.length - 2] || \"\";\n var sep = component == \"snippets\" ? \"/\" : \"-\";\n var base = parts[parts.length - 1];\n if (component == \"worker\" && sep == \"-\") {\n var re = new RegExp(\"^\" + component + \"[\\\\-_]|[\\\\-_]\" + component + \"$\", \"g\");\n base = base.replace(re, \"\");\n }\n if ((!base || base == component) && parts.length > 1)\n base = parts[parts.length - 2];\n var path = options[component + \"Path\"];\n if (path == null) {\n path = options.basePath;\n }\n else if (sep == \"/\") {\n component = sep = \"\";\n }\n if (path && path.slice(-1) != \"/\")\n path += \"/\";\n return path + component + sep + base + this.get(\"suffix\");\n};\nexports.setModuleUrl = function (name, subst) {\n return options.$moduleUrls[name] = subst;\n};\nvar loader = function (moduleName, cb) {\n if (moduleName === \"ace/theme/textmate\" || moduleName === \"./theme/textmate\")\n return cb(null, require(\"./theme/textmate\"));\n if (customLoader)\n return customLoader(moduleName, cb);\n console.error(\"loader is not configured\");\n};\nvar customLoader;\nexports.setLoader = function (cb) {\n customLoader = cb;\n};\nexports.dynamicModules = Object.create(null);\nexports.$loading = {};\nexports.$loaded = {};\nexports.loadModule = function (moduleId, onLoad) {\n var loadedModule;\n if (Array.isArray(moduleId)) {\n var moduleType = moduleId[0];\n var moduleName = moduleId[1];\n }\n else if (typeof moduleId == \"string\") {\n var moduleName = moduleId;\n }\n var load = function (module) {\n if (module && !exports.$loading[moduleName])\n return onLoad && onLoad(module);\n if (!exports.$loading[moduleName])\n exports.$loading[moduleName] = [];\n exports.$loading[moduleName].push(onLoad);\n if (exports.$loading[moduleName].length > 1)\n return;\n var afterLoad = function () {\n loader(moduleName, function (err, module) {\n if (module)\n exports.$loaded[moduleName] = module;\n exports._emit(\"load.module\", { name: moduleName, module: module });\n var listeners = exports.$loading[moduleName];\n exports.$loading[moduleName] = null;\n listeners.forEach(function (onLoad) {\n onLoad && onLoad(module);\n });\n });\n };\n if (!exports.get(\"packaged\"))\n return afterLoad();\n net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad);\n reportErrorIfPathIsNotConfigured();\n };\n if (exports.dynamicModules[moduleName]) {\n exports.dynamicModules[moduleName]().then(function (module) {\n if (module.default) {\n load(module.default);\n }\n else {\n load(module);\n }\n });\n }\n else {\n try {\n loadedModule = this.$require(moduleName);\n }\n catch (e) { }\n load(loadedModule || exports.$loaded[moduleName]);\n }\n};\nexports.$require = function (moduleName) {\n if (typeof module[\"require\"] == \"function\") {\n var req = \"require\";\n return module[req](moduleName);\n }\n};\nexports.setModuleLoader = function (moduleName, onLoad) {\n exports.dynamicModules[moduleName] = onLoad;\n};\nvar reportErrorIfPathIsNotConfigured = function () {\n if (!options.basePath && !options.workerPath\n && !options.modePath && !options.themePath\n && !Object.keys(options.$moduleUrls).length) {\n console.error(\"Unable to infer path to ace from script src,\", \"use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes\", \"or with webpack use ace/webpack-resolver\");\n reportErrorIfPathIsNotConfigured = function () { };\n }\n};\nexports.version = \"1.33.2\";\n\n});\n\nace.define(\"ace/loader_build\",[\"require\",\"exports\",\"module\",\"ace/lib/fixoldbrowsers\",\"ace/config\"], function(require, exports, module) {\n\"use strict\";\n\nrequire(\"./lib/fixoldbrowsers\");\nvar config = require(\"./config\");\nconfig.setLoader(function(moduleName, cb) {\n require([moduleName], function(module) {\n cb(null, module);\n });\n});\n\nvar global = (function() {\n return this || typeof window != \"undefined\" && window;\n})();\n\nmodule.exports = function(ace) {\n config.init = init;\n config.$require = require;\n ace.require = require;\n\n if (true)\n ace.define = __webpack_require__.amdD;\n};\ninit(true);function init(packaged) {\n\n if (!global || !global.document)\n return;\n \n config.set(\"packaged\", packaged || require.packaged || module.packaged || (global.define && __webpack_require__.amdD.packaged));\n\n var scriptOptions = {};\n var scriptUrl = \"\";\n var currentScript = (document.currentScript || document._currentScript ); // native or polyfill\n var currentDocument = currentScript && currentScript.ownerDocument || document;\n \n if (currentScript && currentScript.src) {\n scriptUrl = currentScript.src.split(/[?#]/)[0].split(\"/\").slice(0, -1).join(\"/\") || \"\";\n }\n \n var scripts = currentDocument.getElementsByTagName(\"script\");\n for (var i=0; i [\" + this.end.row + \"/\" + this.end.column + \"]\");\n };\n Range.prototype.contains = function (row, column) {\n return this.compare(row, column) == 0;\n };\n Range.prototype.compareRange = function (range) {\n var cmp, end = range.end, start = range.start;\n cmp = this.compare(end.row, end.column);\n if (cmp == 1) {\n cmp = this.compare(start.row, start.column);\n if (cmp == 1) {\n return 2;\n }\n else if (cmp == 0) {\n return 1;\n }\n else {\n return 0;\n }\n }\n else if (cmp == -1) {\n return -2;\n }\n else {\n cmp = this.compare(start.row, start.column);\n if (cmp == -1) {\n return -1;\n }\n else if (cmp == 1) {\n return 42;\n }\n else {\n return 0;\n }\n }\n };\n Range.prototype.comparePoint = function (p) {\n return this.compare(p.row, p.column);\n };\n Range.prototype.containsRange = function (range) {\n return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;\n };\n Range.prototype.intersects = function (range) {\n var cmp = this.compareRange(range);\n return (cmp == -1 || cmp == 0 || cmp == 1);\n };\n Range.prototype.isEnd = function (row, column) {\n return this.end.row == row && this.end.column == column;\n };\n Range.prototype.isStart = function (row, column) {\n return this.start.row == row && this.start.column == column;\n };\n Range.prototype.setStart = function (row, column) {\n if (typeof row == \"object\") {\n this.start.column = row.column;\n this.start.row = row.row;\n }\n else {\n this.start.row = row;\n this.start.column = column;\n }\n };\n Range.prototype.setEnd = function (row, column) {\n if (typeof row == \"object\") {\n this.end.column = row.column;\n this.end.row = row.row;\n }\n else {\n this.end.row = row;\n this.end.column = column;\n }\n };\n Range.prototype.inside = function (row, column) {\n if (this.compare(row, column) == 0) {\n if (this.isEnd(row, column) || this.isStart(row, column)) {\n return false;\n }\n else {\n return true;\n }\n }\n return false;\n };\n Range.prototype.insideStart = function (row, column) {\n if (this.compare(row, column) == 0) {\n if (this.isEnd(row, column)) {\n return false;\n }\n else {\n return true;\n }\n }\n return false;\n };\n Range.prototype.insideEnd = function (row, column) {\n if (this.compare(row, column) == 0) {\n if (this.isStart(row, column)) {\n return false;\n }\n else {\n return true;\n }\n }\n return false;\n };\n Range.prototype.compare = function (row, column) {\n if (!this.isMultiLine()) {\n if (row === this.start.row) {\n return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);\n }\n }\n if (row < this.start.row)\n return -1;\n if (row > this.end.row)\n return 1;\n if (this.start.row === row)\n return column >= this.start.column ? 0 : -1;\n if (this.end.row === row)\n return column <= this.end.column ? 0 : 1;\n return 0;\n };\n Range.prototype.compareStart = function (row, column) {\n if (this.start.row == row && this.start.column == column) {\n return -1;\n }\n else {\n return this.compare(row, column);\n }\n };\n Range.prototype.compareEnd = function (row, column) {\n if (this.end.row == row && this.end.column == column) {\n return 1;\n }\n else {\n return this.compare(row, column);\n }\n };\n Range.prototype.compareInside = function (row, column) {\n if (this.end.row == row && this.end.column == column) {\n return 1;\n }\n else if (this.start.row == row && this.start.column == column) {\n return -1;\n }\n else {\n return this.compare(row, column);\n }\n };\n Range.prototype.clipRows = function (firstRow, lastRow) {\n if (this.end.row > lastRow)\n var end = { row: lastRow + 1, column: 0 };\n else if (this.end.row < firstRow)\n var end = { row: firstRow, column: 0 };\n if (this.start.row > lastRow)\n var start = { row: lastRow + 1, column: 0 };\n else if (this.start.row < firstRow)\n var start = { row: firstRow, column: 0 };\n return Range.fromPoints(start || this.start, end || this.end);\n };\n Range.prototype.extend = function (row, column) {\n var cmp = this.compare(row, column);\n if (cmp == 0)\n return this;\n else if (cmp == -1)\n var start = { row: row, column: column };\n else\n var end = { row: row, column: column };\n return Range.fromPoints(start || this.start, end || this.end);\n };\n Range.prototype.isEmpty = function () {\n return (this.start.row === this.end.row && this.start.column === this.end.column);\n };\n Range.prototype.isMultiLine = function () {\n return (this.start.row !== this.end.row);\n };\n Range.prototype.clone = function () {\n return Range.fromPoints(this.start, this.end);\n };\n Range.prototype.collapseRows = function () {\n if (this.end.column == 0)\n return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0);\n else\n return new Range(this.start.row, 0, this.end.row, 0);\n };\n Range.prototype.toScreenRange = function (session) {\n var screenPosStart = session.documentToScreenPosition(this.start);\n var screenPosEnd = session.documentToScreenPosition(this.end);\n return new Range(screenPosStart.row, screenPosStart.column, screenPosEnd.row, screenPosEnd.column);\n };\n Range.prototype.moveBy = function (row, column) {\n this.start.row += row;\n this.start.column += column;\n this.end.row += row;\n this.end.column += column;\n };\n return Range;\n}());\nRange.fromPoints = function (start, end) {\n return new Range(start.row, start.column, end.row, end.column);\n};\nRange.comparePoints = function (p1, p2) {\n return p1.row - p2.row || p1.column - p2.column;\n};\nexports.Range = Range;\n\n});\n\nace.define(\"ace/lib/keys\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./oop\");\nvar Keys = {\n MODIFIER_KEYS: {\n 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta',\n 91: 'MetaLeft', 92: 'MetaRight', 93: 'ContextMenu'\n },\n KEY_MODS: {\n \"ctrl\": 1, \"alt\": 2, \"option\": 2, \"shift\": 4,\n \"super\": 8, \"meta\": 8, \"command\": 8, \"cmd\": 8,\n \"control\": 1\n },\n FUNCTION_KEYS: {\n 8: \"Backspace\",\n 9: \"Tab\",\n 13: \"Return\",\n 19: \"Pause\",\n 27: \"Esc\",\n 32: \"Space\",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"Left\",\n 38: \"Up\",\n 39: \"Right\",\n 40: \"Down\",\n 44: \"Print\",\n 45: \"Insert\",\n 46: \"Delete\",\n '-13': \"NumpadEnter\",\n 144: \"Numlock\",\n 145: \"Scrolllock\"\n },\n PRINTABLE_KEYS: {\n 32: ' ', 59: ';', 61: '=', 107: '+', 109: '-', 110: '.',\n 186: ';', 187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`',\n 219: '[', 220: '\\\\', 221: ']', 222: \"'\", 111: '/', 106: '*'\n }\n};\nvar codeToKeyCode = {\n Command: 224,\n Backspace: 8,\n Tab: 9,\n Return: 13,\n Enter: 13,\n Pause: 19,\n Escape: 27,\n PageUp: 33,\n PageDown: 34,\n End: 35,\n Home: 36,\n Insert: 45,\n Delete: 46,\n ArrowLeft: 37,\n ArrowUp: 38,\n ArrowRight: 39,\n ArrowDown: 40,\n Backquote: 192,\n Minus: 189,\n Equal: 187,\n BracketLeft: 219,\n Backslash: 220,\n BracketRight: 221,\n Semicolon: 186,\n Quote: 222,\n Comma: 188,\n Period: 190,\n Slash: 191,\n Space: 32,\n NumpadAdd: 107,\n NumpadDecimal: 110,\n NumpadSubtract: 109,\n NumpadDivide: 111,\n NumpadMultiply: 106\n};\nfor (var i = 0; i < 10; i++) {\n codeToKeyCode[\"Digit\" + i] = 48 + i;\n codeToKeyCode[\"Numpad\" + i] = 96 + i;\n Keys.PRINTABLE_KEYS[48 + i] = \"\" + i;\n Keys.FUNCTION_KEYS[96 + i] = \"Numpad\" + i;\n}\nfor (var i = 65; i < 91; i++) {\n var chr = String.fromCharCode(i + 32);\n codeToKeyCode[\"Key\" + chr.toUpperCase()] = i;\n Keys.PRINTABLE_KEYS[i] = chr;\n}\nfor (var i = 1; i < 13; i++) {\n codeToKeyCode[\"F\" + i] = 111 + i;\n Keys.FUNCTION_KEYS[111 + i] = \"F\" + i;\n}\nvar modifiers = {\n Shift: 16,\n Control: 17,\n Alt: 18,\n Meta: 224\n};\nfor (var mod in modifiers) {\n codeToKeyCode[mod] = codeToKeyCode[mod + \"Left\"]\n = codeToKeyCode[mod + \"Right\"] = modifiers[mod];\n}\nexports.$codeToKeyCode = codeToKeyCode;\nKeys.PRINTABLE_KEYS[173] = '-';\nfor (var j in Keys.FUNCTION_KEYS) {\n var name = Keys.FUNCTION_KEYS[j].toLowerCase();\n Keys[name] = parseInt(j, 10);\n}\nfor (var j in Keys.PRINTABLE_KEYS) {\n var name = Keys.PRINTABLE_KEYS[j].toLowerCase();\n Keys[name] = parseInt(j, 10);\n}\noop.mixin(Keys, Keys.MODIFIER_KEYS);\noop.mixin(Keys, Keys.PRINTABLE_KEYS);\noop.mixin(Keys, Keys.FUNCTION_KEYS);\nKeys.enter = Keys[\"return\"];\nKeys.escape = Keys.esc;\nKeys.del = Keys[\"delete\"];\n(function () {\n var mods = [\"cmd\", \"ctrl\", \"alt\", \"shift\"];\n for (var i = Math.pow(2, mods.length); i--;) {\n Keys.KEY_MODS[i] = mods.filter(function (x) {\n return i & Keys.KEY_MODS[x];\n }).join(\"-\") + \"-\";\n }\n})();\nKeys.KEY_MODS[0] = \"\";\nKeys.KEY_MODS[-1] = \"input-\";\noop.mixin(exports, Keys);\nexports.default = exports;\nexports.keyCodeToString = function (keyCode) {\n var keyString = Keys[keyCode];\n if (typeof keyString != \"string\")\n keyString = String.fromCharCode(keyCode);\n return keyString.toLowerCase();\n};\n\n});\n\nace.define(\"ace/lib/event\",[\"require\",\"exports\",\"module\",\"ace/lib/keys\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\"; var keys = require(\"./keys\");\nvar useragent = require(\"./useragent\");\nvar pressedKeys = null;\nvar ts = 0;\nvar activeListenerOptions;\nfunction detectListenerOptionsSupport() {\n activeListenerOptions = false;\n try {\n document.createComment(\"\").addEventListener(\"test\", function () { }, {\n get passive() {\n activeListenerOptions = { passive: false };\n return true;\n }\n });\n }\n catch (e) { }\n}\nfunction getListenerOptions() {\n if (activeListenerOptions == undefined)\n detectListenerOptionsSupport();\n return activeListenerOptions;\n}\nfunction EventListener(elem, type, callback) {\n this.elem = elem;\n this.type = type;\n this.callback = callback;\n}\nEventListener.prototype.destroy = function () {\n removeListener(this.elem, this.type, this.callback);\n this.elem = this.type = this.callback = undefined;\n};\nvar addListener = exports.addListener = function (elem, type, callback, /**@type{any?}*/ destroyer) {\n elem.addEventListener(type, callback, getListenerOptions());\n if (destroyer)\n destroyer.$toDestroy.push(new EventListener(elem, type, callback));\n};\nvar removeListener = exports.removeListener = function (elem, type, callback) {\n elem.removeEventListener(type, callback, getListenerOptions());\n};\nexports.stopEvent = function (e) {\n exports.stopPropagation(e);\n exports.preventDefault(e);\n return false;\n};\nexports.stopPropagation = function (e) {\n if (e.stopPropagation)\n e.stopPropagation();\n};\nexports.preventDefault = function (e) {\n if (e.preventDefault)\n e.preventDefault();\n};\nexports.getButton = function (e) {\n if (e.type == \"dblclick\")\n return 0;\n if (e.type == \"contextmenu\" || (useragent.isMac && (e.ctrlKey && !e.altKey && !e.shiftKey)))\n return 2;\n return e.button;\n};\nexports.capture = function (el, eventHandler, releaseCaptureHandler) {\n var ownerDocument = el && el.ownerDocument || document;\n function onMouseUp(e) {\n eventHandler && eventHandler(e);\n releaseCaptureHandler && releaseCaptureHandler(e);\n removeListener(ownerDocument, \"mousemove\", eventHandler);\n removeListener(ownerDocument, \"mouseup\", onMouseUp);\n removeListener(ownerDocument, \"dragstart\", onMouseUp);\n }\n addListener(ownerDocument, \"mousemove\", eventHandler);\n addListener(ownerDocument, \"mouseup\", onMouseUp);\n addListener(ownerDocument, \"dragstart\", onMouseUp);\n return onMouseUp;\n};\nexports.addMouseWheelListener = function (el, callback, destroyer) {\n addListener(el, \"wheel\", function (e) {\n var factor = 0.15;\n var deltaX = e.deltaX || 0;\n var deltaY = e.deltaY || 0;\n switch (e.deltaMode) {\n case e.DOM_DELTA_PIXEL:\n e.wheelX = deltaX * factor;\n e.wheelY = deltaY * factor;\n break;\n case e.DOM_DELTA_LINE:\n var linePixels = 15;\n e.wheelX = deltaX * linePixels;\n e.wheelY = deltaY * linePixels;\n break;\n case e.DOM_DELTA_PAGE:\n var pagePixels = 150;\n e.wheelX = deltaX * pagePixels;\n e.wheelY = deltaY * pagePixels;\n break;\n }\n callback(e);\n }, destroyer);\n};\nexports.addMultiMouseDownListener = function (elements, timeouts, eventHandler, callbackName, destroyer) {\n var clicks = 0;\n var startX, startY, timer;\n var eventNames = {\n 2: \"dblclick\",\n 3: \"tripleclick\",\n 4: \"quadclick\"\n };\n function onMousedown(e) {\n if (exports.getButton(e) !== 0) {\n clicks = 0;\n }\n else if (e.detail > 1) {\n clicks++;\n if (clicks > 4)\n clicks = 1;\n }\n else {\n clicks = 1;\n }\n if (useragent.isIE) {\n var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5;\n if (!timer || isNewClick)\n clicks = 1;\n if (timer)\n clearTimeout(timer);\n timer = setTimeout(function () { timer = null; }, timeouts[clicks - 1] || 600);\n if (clicks == 1) {\n startX = e.clientX;\n startY = e.clientY;\n }\n }\n e._clicks = clicks;\n eventHandler[callbackName](\"mousedown\", e);\n if (clicks > 4)\n clicks = 0;\n else if (clicks > 1)\n return eventHandler[callbackName](eventNames[clicks], e);\n }\n if (!Array.isArray(elements))\n elements = [elements];\n elements.forEach(function (el) {\n addListener(el, \"mousedown\", onMousedown, destroyer);\n });\n};\nfunction getModifierHash(e) {\n return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);\n}\nexports.getModifierString = function (e) {\n return keys.KEY_MODS[getModifierHash(e)];\n};\nfunction normalizeCommandKeys(callback, e, keyCode) {\n var hashId = getModifierHash(e);\n if (!keyCode && e.code) {\n keyCode = keys.$codeToKeyCode[e.code] || keyCode;\n }\n if (!useragent.isMac && pressedKeys) {\n if (e.getModifierState && (e.getModifierState(\"OS\") || e.getModifierState(\"Win\")))\n hashId |= 8;\n if (pressedKeys.altGr) {\n if ((3 & hashId) != 3)\n pressedKeys.altGr = 0;\n else\n return;\n }\n if (keyCode === 18 || keyCode === 17) {\n var location = e.location;\n if (keyCode === 17 && location === 1) {\n if (pressedKeys[keyCode] == 1)\n ts = e.timeStamp;\n }\n else if (keyCode === 18 && hashId === 3 && location === 2) {\n var dt = e.timeStamp - ts;\n if (dt < 50)\n pressedKeys.altGr = true;\n }\n }\n }\n if (keyCode in keys.MODIFIER_KEYS) {\n keyCode = -1;\n }\n if (!hashId && keyCode === 13) {\n if (e.location === 3) {\n callback(e, hashId, -keyCode);\n if (e.defaultPrevented)\n return;\n }\n }\n if (useragent.isChromeOS && hashId & 8) {\n callback(e, hashId, keyCode);\n if (e.defaultPrevented)\n return;\n else\n hashId &= ~8;\n }\n if (!hashId && !(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) {\n return false;\n }\n return callback(e, hashId, keyCode);\n}\nexports.addCommandKeyListener = function (el, callback, destroyer) {\n var lastDefaultPrevented = null;\n addListener(el, \"keydown\", function (e) {\n pressedKeys[e.keyCode] = (pressedKeys[e.keyCode] || 0) + 1;\n var result = normalizeCommandKeys(callback, e, e.keyCode);\n lastDefaultPrevented = e.defaultPrevented;\n return result;\n }, destroyer);\n addListener(el, \"keypress\", function (e) {\n if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) {\n exports.stopEvent(e);\n lastDefaultPrevented = null;\n }\n }, destroyer);\n addListener(el, \"keyup\", function (e) {\n pressedKeys[e.keyCode] = null;\n }, destroyer);\n if (!pressedKeys) {\n resetPressedKeys();\n addListener(window, \"focus\", resetPressedKeys);\n }\n};\nfunction resetPressedKeys() {\n pressedKeys = Object.create(null);\n}\nif (typeof window == \"object\" && window.postMessage && !useragent.isOldIE) {\n var postMessageId = 1;\n exports.nextTick = function (callback, win) {\n win = win || window;\n var messageName = \"zero-timeout-message-\" + (postMessageId++);\n var listener = function (e) {\n if (e.data == messageName) {\n exports.stopPropagation(e);\n removeListener(win, \"message\", listener);\n callback();\n }\n };\n addListener(win, \"message\", listener);\n win.postMessage(messageName, \"*\");\n };\n}\nexports.$idleBlocked = false;\nexports.onIdle = function (cb, timeout) {\n return setTimeout(function handler() {\n if (!exports.$idleBlocked) {\n cb();\n }\n else {\n setTimeout(handler, 100);\n }\n }, timeout);\n};\nexports.$idleBlockId = null;\nexports.blockIdle = function (delay) {\n if (exports.$idleBlockId)\n clearTimeout(exports.$idleBlockId);\n exports.$idleBlocked = true;\n exports.$idleBlockId = setTimeout(function () {\n exports.$idleBlocked = false;\n }, delay || 100);\n};\nexports.nextFrame = typeof window == \"object\" && (window.requestAnimationFrame\n || window[\"mozRequestAnimationFrame\"]\n || window[\"webkitRequestAnimationFrame\"]\n || window[\"msRequestAnimationFrame\"]\n || window[\"oRequestAnimationFrame\"]);\nif (exports.nextFrame)\n exports.nextFrame = exports.nextFrame.bind(window);\nelse\n exports.nextFrame = function (callback) {\n setTimeout(callback, 17);\n };\n\n});\n\nace.define(\"ace/clipboard\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar $cancelT;\nmodule.exports = {\n lineMode: false,\n pasteCancelled: function () {\n if ($cancelT && $cancelT > Date.now() - 50)\n return true;\n return $cancelT = false;\n },\n cancel: function () {\n $cancelT = Date.now();\n }\n};\n\n});\n\nace.define(\"ace/keyboard/textinput\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/config\",\"ace/lib/useragent\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/clipboard\",\"ace/lib/keys\"], function(require, exports, module){\"use strict\";\nvar event = require(\"../lib/event\");\nvar nls = require(\"../config\").nls;\nvar useragent = require(\"../lib/useragent\");\nvar dom = require(\"../lib/dom\");\nvar lang = require(\"../lib/lang\");\nvar clipboard = require(\"../clipboard\");\nvar BROKEN_SETDATA = useragent.isChrome < 18;\nvar USE_IE_MIME_TYPE = useragent.isIE;\nvar HAS_FOCUS_ARGS = useragent.isChrome > 63;\nvar MAX_LINE_LENGTH = 400;\nvar KEYS = require(\"../lib/keys\");\nvar MODS = KEYS.KEY_MODS;\nvar isIOS = useragent.isIOS;\nvar valueResetRegex = isIOS ? /\\s/ : /\\n/;\nvar isMobile = useragent.isMobile;\nvar TextInput;\nTextInput = function (parentNode, host) {\n var text = dom.createElement(\"textarea\");\n text.className = \"ace_text-input\";\n text.setAttribute(\"wrap\", \"off\");\n text.setAttribute(\"autocorrect\", \"off\");\n text.setAttribute(\"autocapitalize\", \"off\");\n text.setAttribute(\"spellcheck\", \"false\");\n text.style.opacity = \"0\";\n parentNode.insertBefore(text, parentNode.firstChild);\n var copied = false;\n var pasted = false;\n var inComposition = false;\n var sendingText = false;\n var tempStyle = '';\n if (!isMobile)\n text.style.fontSize = \"1px\";\n var commandMode = false;\n var ignoreFocusEvents = false;\n var lastValue = \"\";\n var lastSelectionStart = 0;\n var lastSelectionEnd = 0;\n var lastRestoreEnd = 0;\n var rowStart = Number.MAX_SAFE_INTEGER;\n var rowEnd = Number.MIN_SAFE_INTEGER;\n var numberOfExtraLines = 0;\n try {\n var isFocused = document.activeElement === text;\n }\n catch (e) { }\n this.setNumberOfExtraLines = function (number) {\n rowStart = Number.MAX_SAFE_INTEGER;\n rowEnd = Number.MIN_SAFE_INTEGER;\n if (number < 0) {\n numberOfExtraLines = 0;\n return;\n }\n numberOfExtraLines = number;\n };\n this.setAriaOptions = function (options) {\n if (options.activeDescendant) {\n text.setAttribute(\"aria-haspopup\", \"true\");\n text.setAttribute(\"aria-autocomplete\", options.inline ? \"both\" : \"list\");\n text.setAttribute(\"aria-activedescendant\", options.activeDescendant);\n }\n else {\n text.setAttribute(\"aria-haspopup\", \"false\");\n text.setAttribute(\"aria-autocomplete\", \"both\");\n text.removeAttribute(\"aria-activedescendant\");\n }\n if (options.role) {\n text.setAttribute(\"role\", options.role);\n }\n if (options.setLabel) {\n text.setAttribute(\"aria-roledescription\", nls(\"text-input.aria-roledescription\", \"editor\"));\n if (host.session) {\n var row = host.session.selection.cursor.row;\n text.setAttribute(\"aria-label\", nls(\"text-input.aria-label\", \"Cursor at row $0\", [row + 1]));\n }\n }\n };\n this.setAriaOptions({ role: \"textbox\" });\n event.addListener(text, \"blur\", function (e) {\n if (ignoreFocusEvents)\n return;\n host.onBlur(e);\n isFocused = false;\n }, host);\n event.addListener(text, \"focus\", function (e) {\n if (ignoreFocusEvents)\n return;\n isFocused = true;\n if (useragent.isEdge) {\n try {\n if (!document.hasFocus())\n return;\n }\n catch (e) { }\n }\n host.onFocus(e);\n if (useragent.isEdge)\n setTimeout(resetSelection);\n else\n resetSelection();\n }, host);\n this.$focusScroll = false;\n this.focus = function () {\n this.setAriaOptions({\n setLabel: host.renderer.enableKeyboardAccessibility\n });\n if (tempStyle || HAS_FOCUS_ARGS || this.$focusScroll == \"browser\")\n return text.focus({ preventScroll: true });\n var top = text.style.top;\n text.style.position = \"fixed\";\n text.style.top = \"0px\";\n try {\n var isTransformed = text.getBoundingClientRect().top != 0;\n }\n catch (e) {\n return;\n }\n var ancestors = [];\n if (isTransformed) {\n var t = text.parentElement;\n while (t && t.nodeType == 1) {\n ancestors.push(t);\n t.setAttribute(\"ace_nocontext\", \"true\");\n if (!t.parentElement && t.getRootNode)\n t = t.getRootNode()[\"host\"];\n else\n t = t.parentElement;\n }\n }\n text.focus({ preventScroll: true });\n if (isTransformed) {\n ancestors.forEach(function (p) {\n p.removeAttribute(\"ace_nocontext\");\n });\n }\n setTimeout(function () {\n text.style.position = \"\";\n if (text.style.top == \"0px\")\n text.style.top = top;\n }, 0);\n };\n this.blur = function () {\n text.blur();\n };\n this.isFocused = function () {\n return isFocused;\n };\n host.on(\"beforeEndOperation\", function () {\n var curOp = host.curOp;\n var commandName = curOp && curOp.command && curOp.command.name;\n if (commandName == \"insertstring\")\n return;\n var isUserAction = commandName && (curOp.docChanged || curOp.selectionChanged);\n if (inComposition && isUserAction) {\n lastValue = text.value = \"\";\n onCompositionEnd();\n }\n resetSelection();\n });\n var positionToSelection = function (row, column) {\n var selection = column;\n for (var i = 1; i <= row - rowStart && i < 2 * numberOfExtraLines + 1; i++) {\n selection += host.session.getLine(row - i).length + 1;\n }\n return selection;\n };\n var resetSelection = isIOS\n ? function (value) {\n if (!isFocused || (copied && !value) || sendingText)\n return;\n if (!value)\n value = \"\";\n var newValue = \"\\n ab\" + value + \"cde fg\\n\";\n if (newValue != text.value)\n text.value = lastValue = newValue;\n var selectionStart = 4;\n var selectionEnd = 4 + (value.length || (host.selection.isEmpty() ? 0 : 1));\n if (lastSelectionStart != selectionStart || lastSelectionEnd != selectionEnd) {\n text.setSelectionRange(selectionStart, selectionEnd);\n }\n lastSelectionStart = selectionStart;\n lastSelectionEnd = selectionEnd;\n }\n : function () {\n if (inComposition || sendingText)\n return;\n if (!isFocused && !afterContextMenu)\n return;\n inComposition = true;\n var selectionStart = 0;\n var selectionEnd = 0;\n var line = \"\";\n if (host.session) {\n var selection = host.selection;\n var range = selection.getRange();\n var row = selection.cursor.row;\n if (row === rowEnd + 1) {\n rowStart = rowEnd + 1;\n rowEnd = rowStart + 2 * numberOfExtraLines;\n }\n else if (row === rowStart - 1) {\n rowEnd = rowStart - 1;\n rowStart = rowEnd - 2 * numberOfExtraLines;\n }\n else if (row < rowStart - 1 || row > rowEnd + 1) {\n rowStart = row > numberOfExtraLines ? row - numberOfExtraLines : 0;\n rowEnd = row > numberOfExtraLines ? row + numberOfExtraLines : 2 * numberOfExtraLines;\n }\n var lines = [];\n for (var i = rowStart; i <= rowEnd; i++) {\n lines.push(host.session.getLine(i));\n }\n line = lines.join('\\n');\n selectionStart = positionToSelection(range.start.row, range.start.column);\n selectionEnd = positionToSelection(range.end.row, range.end.column);\n if (range.start.row < rowStart) {\n var prevLine = host.session.getLine(rowStart - 1);\n selectionStart = range.start.row < rowStart - 1 ? 0 : selectionStart;\n selectionEnd += prevLine.length + 1;\n line = prevLine + \"\\n\" + line;\n }\n else if (range.end.row > rowEnd) {\n var nextLine = host.session.getLine(rowEnd + 1);\n selectionEnd = range.end.row > rowEnd + 1 ? nextLine.length : range.end.column;\n selectionEnd += line.length + 1;\n line = line + \"\\n\" + nextLine;\n }\n else if (isMobile && row > 0) {\n line = \"\\n\" + line;\n selectionEnd += 1;\n selectionStart += 1;\n }\n if (line.length > MAX_LINE_LENGTH) {\n if (selectionStart < MAX_LINE_LENGTH && selectionEnd < MAX_LINE_LENGTH) {\n line = line.slice(0, MAX_LINE_LENGTH);\n }\n else {\n line = \"\\n\";\n if (selectionStart == selectionEnd) {\n selectionStart = selectionEnd = 0;\n }\n else {\n selectionStart = 0;\n selectionEnd = 1;\n }\n }\n }\n var newValue = line + \"\\n\\n\";\n if (newValue != lastValue) {\n text.value = lastValue = newValue;\n lastSelectionStart = lastSelectionEnd = newValue.length;\n }\n }\n if (afterContextMenu) {\n lastSelectionStart = text.selectionStart;\n lastSelectionEnd = text.selectionEnd;\n }\n if (lastSelectionEnd != selectionEnd\n || lastSelectionStart != selectionStart\n || text.selectionEnd != lastSelectionEnd // on ie edge selectionEnd changes silently after the initialization\n ) {\n try {\n text.setSelectionRange(selectionStart, selectionEnd);\n lastSelectionStart = selectionStart;\n lastSelectionEnd = selectionEnd;\n }\n catch (e) { }\n }\n inComposition = false;\n };\n this.resetSelection = resetSelection;\n if (isFocused)\n host.onFocus();\n var isAllSelected = function (text) {\n return text.selectionStart === 0 && text.selectionEnd >= lastValue.length\n && text.value === lastValue && lastValue\n && text.selectionEnd !== lastSelectionEnd;\n };\n var onSelect = function (e) {\n if (inComposition)\n return;\n if (copied) {\n copied = false;\n }\n else if (isAllSelected(text)) {\n host.selectAll();\n resetSelection();\n }\n else if (isMobile && text.selectionStart != lastSelectionStart) {\n resetSelection();\n }\n };\n var inputHandler = null;\n this.setInputHandler = function (cb) { inputHandler = cb; };\n this.getInputHandler = function () { return inputHandler; };\n var afterContextMenu = false;\n var sendText = function (value, fromInput) {\n if (afterContextMenu)\n afterContextMenu = false;\n if (pasted) {\n resetSelection();\n if (value)\n host.onPaste(value);\n pasted = false;\n return \"\";\n }\n else {\n var selectionStart = text.selectionStart;\n var selectionEnd = text.selectionEnd;\n var extendLeft = lastSelectionStart;\n var extendRight = lastValue.length - lastSelectionEnd;\n var inserted = value;\n var restoreStart = value.length - selectionStart;\n var restoreEnd = value.length - selectionEnd;\n var i = 0;\n while (extendLeft > 0 && lastValue[i] == value[i]) {\n i++;\n extendLeft--;\n }\n inserted = inserted.slice(i);\n i = 1;\n while (extendRight > 0 && lastValue.length - i > lastSelectionStart - 1 && lastValue[lastValue.length - i] == value[value.length - i]) {\n i++;\n extendRight--;\n }\n restoreStart -= i - 1;\n restoreEnd -= i - 1;\n var endIndex = inserted.length - i + 1;\n if (endIndex < 0) {\n extendLeft = -endIndex;\n endIndex = 0;\n }\n inserted = inserted.slice(0, endIndex);\n if (!fromInput && !inserted && !restoreStart && !extendLeft && !extendRight && !restoreEnd)\n return \"\";\n sendingText = true;\n var shouldReset = false;\n if (useragent.isAndroid && inserted == \". \") {\n inserted = \" \";\n shouldReset = true;\n }\n if (inserted && !extendLeft && !extendRight && !restoreStart && !restoreEnd || commandMode) {\n host.onTextInput(inserted);\n }\n else {\n host.onTextInput(inserted, {\n extendLeft: extendLeft,\n extendRight: extendRight,\n restoreStart: restoreStart,\n restoreEnd: restoreEnd\n });\n }\n sendingText = false;\n lastValue = value;\n lastSelectionStart = selectionStart;\n lastSelectionEnd = selectionEnd;\n lastRestoreEnd = restoreEnd;\n return shouldReset ? \"\\n\" : inserted;\n }\n };\n var onInput = function (e) {\n if (inComposition)\n return onCompositionUpdate();\n if (e && e.inputType) {\n if (e.inputType == \"historyUndo\")\n return host.execCommand(\"undo\");\n if (e.inputType == \"historyRedo\")\n return host.execCommand(\"redo\");\n }\n var data = text.value;\n var inserted = sendText(data, true);\n if (data.length > MAX_LINE_LENGTH + 100\n || valueResetRegex.test(inserted)\n || isMobile && lastSelectionStart < 1 && lastSelectionStart == lastSelectionEnd) {\n resetSelection();\n }\n };\n var handleClipboardData = function (e, data, forceIEMime) {\n var clipboardData = e.clipboardData || window[\"clipboardData\"];\n if (!clipboardData || BROKEN_SETDATA)\n return;\n var mime = USE_IE_MIME_TYPE || forceIEMime ? \"Text\" : \"text/plain\";\n try {\n if (data) {\n return clipboardData.setData(mime, data) !== false;\n }\n else {\n return clipboardData.getData(mime);\n }\n }\n catch (e) {\n if (!forceIEMime)\n return handleClipboardData(e, data, true);\n }\n };\n var doCopy = function (e, isCut) {\n var data = host.getCopyText();\n if (!data)\n return event.preventDefault(e);\n if (handleClipboardData(e, data)) {\n if (isIOS) {\n resetSelection(data);\n copied = data;\n setTimeout(function () {\n copied = false;\n }, 10);\n }\n isCut ? host.onCut() : host.onCopy();\n event.preventDefault(e);\n }\n else {\n copied = true;\n text.value = data;\n text.select();\n setTimeout(function () {\n copied = false;\n resetSelection();\n isCut ? host.onCut() : host.onCopy();\n });\n }\n };\n var onCut = function (e) {\n doCopy(e, true);\n };\n var onCopy = function (e) {\n doCopy(e, false);\n };\n var onPaste = function (e) {\n var data = handleClipboardData(e);\n if (clipboard.pasteCancelled())\n return;\n if (typeof data == \"string\") {\n if (data)\n host.onPaste(data, e);\n if (useragent.isIE)\n setTimeout(resetSelection);\n event.preventDefault(e);\n }\n else {\n text.value = \"\";\n pasted = true;\n }\n };\n event.addCommandKeyListener(text, function (e, hashId, keyCode) {\n if (inComposition)\n return;\n return host.onCommandKey(e, hashId, keyCode);\n }, host);\n event.addListener(text, \"select\", onSelect, host);\n event.addListener(text, \"input\", onInput, host);\n event.addListener(text, \"cut\", onCut, host);\n event.addListener(text, \"copy\", onCopy, host);\n event.addListener(text, \"paste\", onPaste, host);\n if (!('oncut' in text) || !('oncopy' in text) || !('onpaste' in text)) {\n event.addListener(parentNode, \"keydown\", function (e) {\n if ((useragent.isMac && !e.metaKey) || !e.ctrlKey)\n return;\n switch (e.keyCode) {\n case 67:\n onCopy(e);\n break;\n case 86:\n onPaste(e);\n break;\n case 88:\n onCut(e);\n break;\n }\n }, host);\n }\n var onCompositionStart = function (e) {\n if (inComposition || !host.onCompositionStart || host.$readOnly)\n return;\n inComposition = {};\n if (commandMode)\n return;\n if (e.data)\n inComposition.useTextareaForIME = false;\n setTimeout(onCompositionUpdate, 0);\n host._signal(\"compositionStart\");\n host.on(\"mousedown\", cancelComposition);\n var range = host.getSelectionRange();\n range.end.row = range.start.row;\n range.end.column = range.start.column;\n inComposition.markerRange = range;\n inComposition.selectionStart = lastSelectionStart;\n host.onCompositionStart(inComposition);\n if (inComposition.useTextareaForIME) {\n lastValue = text.value = \"\";\n lastSelectionStart = 0;\n lastSelectionEnd = 0;\n }\n else {\n if (text.msGetInputContext)\n inComposition.context = text.msGetInputContext();\n if (text.getInputContext)\n inComposition.context = text.getInputContext();\n }\n };\n var onCompositionUpdate = function () {\n if (!inComposition || !host.onCompositionUpdate || host.$readOnly)\n return;\n if (commandMode)\n return cancelComposition();\n if (inComposition.useTextareaForIME) {\n host.onCompositionUpdate(text.value);\n }\n else {\n var data = text.value;\n sendText(data);\n if (inComposition.markerRange) {\n if (inComposition.context) {\n inComposition.markerRange.start.column = inComposition.selectionStart\n = inComposition.context.compositionStartOffset;\n }\n inComposition.markerRange.end.column = inComposition.markerRange.start.column\n + lastSelectionEnd - inComposition.selectionStart + lastRestoreEnd;\n }\n }\n };\n var onCompositionEnd = function (e) {\n if (!host.onCompositionEnd || host.$readOnly)\n return;\n inComposition = false;\n host.onCompositionEnd();\n host.off(\"mousedown\", cancelComposition);\n if (e)\n onInput();\n };\n function cancelComposition() {\n ignoreFocusEvents = true;\n text.blur();\n text.focus();\n ignoreFocusEvents = false;\n }\n var syncComposition = lang.delayedCall(onCompositionUpdate, 50).schedule.bind(null, null);\n function onKeyup(e) {\n if (e.keyCode == 27 && text.value.length < text.selectionStart) {\n if (!inComposition)\n lastValue = text.value;\n lastSelectionStart = lastSelectionEnd = -1;\n resetSelection();\n }\n syncComposition();\n }\n event.addListener(text, \"compositionstart\", onCompositionStart, host);\n event.addListener(text, \"compositionupdate\", onCompositionUpdate, host);\n event.addListener(text, \"keyup\", onKeyup, host);\n event.addListener(text, \"keydown\", syncComposition, host);\n event.addListener(text, \"compositionend\", onCompositionEnd, host);\n this.getElement = function () {\n return text;\n };\n this.setCommandMode = function (value) {\n commandMode = value;\n text.readOnly = false;\n };\n this.setReadOnly = function (readOnly) {\n if (!commandMode)\n text.readOnly = readOnly;\n };\n this.setCopyWithEmptySelection = function (value) {\n };\n this.onContextMenu = function (e) {\n afterContextMenu = true;\n resetSelection();\n host._emit(\"nativecontextmenu\", { target: host, domEvent: e });\n this.moveToMouse(e, true);\n };\n this.moveToMouse = function (e, bringToFront) {\n if (!tempStyle)\n tempStyle = text.style.cssText;\n text.style.cssText = (bringToFront ? \"z-index:100000;\" : \"\")\n + (useragent.isIE ? \"opacity:0.1;\" : \"\")\n + \"text-indent: -\" + (lastSelectionStart + lastSelectionEnd) * host.renderer.characterWidth * 0.5 + \"px;\";\n var rect = host.container.getBoundingClientRect();\n var style = dom.computedStyle(host.container);\n var top = rect.top + (parseInt(style.borderTopWidth) || 0);\n var left = rect.left + (parseInt(rect.borderLeftWidth) || 0);\n var maxTop = rect.bottom - top - text.clientHeight - 2;\n var move = function (e) {\n dom.translate(text, e.clientX - left - 2, Math.min(e.clientY - top - 2, maxTop));\n };\n move(e);\n if (e.type != \"mousedown\")\n return;\n host.renderer.$isMousePressed = true;\n clearTimeout(closeTimeout);\n if (useragent.isWin)\n event.capture(host.container, move, onContextMenuClose);\n };\n this.onContextMenuClose = onContextMenuClose;\n var closeTimeout;\n function onContextMenuClose() {\n clearTimeout(closeTimeout);\n closeTimeout = setTimeout(function () {\n if (tempStyle) {\n text.style.cssText = tempStyle;\n tempStyle = '';\n }\n host.renderer.$isMousePressed = false;\n if (host.renderer.$keepTextAreaAtCursor)\n host.renderer.$moveTextAreaToCursor();\n }, 0);\n }\n var onContextMenu = function (e) {\n host.textInput.onContextMenu(e);\n onContextMenuClose();\n };\n event.addListener(text, \"mouseup\", onContextMenu, host);\n event.addListener(text, \"mousedown\", function (e) {\n e.preventDefault();\n onContextMenuClose();\n }, host);\n event.addListener(host.renderer.scroller, \"contextmenu\", onContextMenu, host);\n event.addListener(text, \"contextmenu\", onContextMenu, host);\n if (isIOS)\n addIosSelectionHandler(parentNode, host, text);\n function addIosSelectionHandler(parentNode, host, text) {\n var typingResetTimeout = null;\n var typing = false;\n text.addEventListener(\"keydown\", function (e) {\n if (typingResetTimeout)\n clearTimeout(typingResetTimeout);\n typing = true;\n }, true);\n text.addEventListener(\"keyup\", function (e) {\n typingResetTimeout = setTimeout(function () {\n typing = false;\n }, 100);\n }, true);\n var detectArrowKeys = function (e) {\n if (document.activeElement !== text)\n return;\n if (typing || inComposition || host.$mouseHandler.isMousePressed)\n return;\n if (copied) {\n return;\n }\n var selectionStart = text.selectionStart;\n var selectionEnd = text.selectionEnd;\n var key = null;\n var modifier = 0;\n if (selectionStart == 0) {\n key = KEYS.up;\n }\n else if (selectionStart == 1) {\n key = KEYS.home;\n }\n else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd] == \"\\n\") {\n key = KEYS.end;\n }\n else if (selectionStart < lastSelectionStart && lastValue[selectionStart - 1] == \" \") {\n key = KEYS.left;\n modifier = MODS.option;\n }\n else if (selectionStart < lastSelectionStart\n || (selectionStart == lastSelectionStart\n && lastSelectionEnd != lastSelectionStart\n && selectionStart == selectionEnd)) {\n key = KEYS.left;\n }\n else if (selectionEnd > lastSelectionEnd && lastValue.slice(0, selectionEnd).split(\"\\n\").length > 2) {\n key = KEYS.down;\n }\n else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd - 1] == \" \") {\n key = KEYS.right;\n modifier = MODS.option;\n }\n else if (selectionEnd > lastSelectionEnd\n || (selectionEnd == lastSelectionEnd\n && lastSelectionEnd != lastSelectionStart\n && selectionStart == selectionEnd)) {\n key = KEYS.right;\n }\n if (selectionStart !== selectionEnd)\n modifier |= MODS.shift;\n if (key) {\n var result = host.onCommandKey({}, modifier, key);\n if (!result && host.commands) {\n key = KEYS.keyCodeToString(key);\n var command = host.commands.findKeyCommand(modifier, key);\n if (command)\n host.execCommand(command);\n }\n lastSelectionStart = selectionStart;\n lastSelectionEnd = selectionEnd;\n resetSelection(\"\");\n }\n };\n document.addEventListener(\"selectionchange\", detectArrowKeys);\n host.on(\"destroy\", function () {\n document.removeEventListener(\"selectionchange\", detectArrowKeys);\n });\n }\n this.destroy = function () {\n if (text.parentElement)\n text.parentElement.removeChild(text);\n };\n};\nexports.TextInput = TextInput;\nexports.$setUserAgentForTests = function (_isMobile, _isIOS) {\n isMobile = _isMobile;\n isIOS = _isIOS;\n};\n\n});\n\nace.define(\"ace/mouse/default_handlers\",[\"require\",\"exports\",\"module\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar useragent = require(\"../lib/useragent\");\nvar DRAG_OFFSET = 0; // pixels\nvar SCROLL_COOLDOWN_T = 550; // milliseconds\nvar DefaultHandlers = /** @class */ (function () {\n function DefaultHandlers(mouseHandler) {\n mouseHandler.$clickSelection = null;\n var editor = mouseHandler.editor;\n editor.setDefaultHandler(\"mousedown\", this.onMouseDown.bind(mouseHandler));\n editor.setDefaultHandler(\"dblclick\", this.onDoubleClick.bind(mouseHandler));\n editor.setDefaultHandler(\"tripleclick\", this.onTripleClick.bind(mouseHandler));\n editor.setDefaultHandler(\"quadclick\", this.onQuadClick.bind(mouseHandler));\n editor.setDefaultHandler(\"mousewheel\", this.onMouseWheel.bind(mouseHandler));\n var exports = [\"select\", \"startSelect\", \"selectEnd\", \"selectAllEnd\", \"selectByWordsEnd\",\n \"selectByLinesEnd\", \"dragWait\", \"dragWaitEnd\", \"focusWait\"];\n exports.forEach(function (x) {\n mouseHandler[x] = this[x];\n }, this);\n mouseHandler[\"selectByLines\"] = this.extendSelectionBy.bind(mouseHandler, \"getLineRange\");\n mouseHandler[\"selectByWords\"] = this.extendSelectionBy.bind(mouseHandler, \"getWordRange\");\n }\n DefaultHandlers.prototype.onMouseDown = function (ev) {\n var inSelection = ev.inSelection();\n var pos = ev.getDocumentPosition();\n this.mousedownEvent = ev;\n var editor = this.editor;\n var button = ev.getButton();\n if (button !== 0) {\n var selectionRange = editor.getSelectionRange();\n var selectionEmpty = selectionRange.isEmpty();\n if (selectionEmpty || button == 1)\n editor.selection.moveToPosition(pos);\n if (button == 2) {\n editor.textInput.onContextMenu(ev.domEvent);\n if (!useragent.isMozilla)\n ev.preventDefault();\n }\n return;\n }\n this.mousedownEvent.time = Date.now();\n if (inSelection && !editor.isFocused()) {\n editor.focus();\n if (this.$focusTimeout && !this.$clickSelection && !editor.inMultiSelectMode) {\n this.setState(\"focusWait\");\n this.captureMouse(ev);\n return;\n }\n }\n this.captureMouse(ev);\n this.startSelect(pos, ev.domEvent._clicks > 1);\n return ev.preventDefault();\n };\n DefaultHandlers.prototype.startSelect = function (pos, waitForClickSelection) {\n pos = pos || this.editor.renderer.screenToTextCoordinates(this.x, this.y);\n var editor = this.editor;\n if (!this.mousedownEvent)\n return;\n if (this.mousedownEvent.getShiftKey())\n editor.selection.selectToPosition(pos);\n else if (!waitForClickSelection)\n editor.selection.moveToPosition(pos);\n if (!waitForClickSelection)\n this.select();\n editor.setStyle(\"ace_selecting\");\n this.setState(\"select\");\n };\n DefaultHandlers.prototype.select = function () {\n var anchor, editor = this.editor;\n var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y);\n if (this.$clickSelection) {\n var cmp = this.$clickSelection.comparePoint(cursor);\n if (cmp == -1) {\n anchor = this.$clickSelection.end;\n }\n else if (cmp == 1) {\n anchor = this.$clickSelection.start;\n }\n else {\n var orientedRange = calcRangeOrientation(this.$clickSelection, cursor);\n cursor = orientedRange.cursor;\n anchor = orientedRange.anchor;\n }\n editor.selection.setSelectionAnchor(anchor.row, anchor.column);\n }\n editor.selection.selectToPosition(cursor);\n editor.renderer.scrollCursorIntoView();\n };\n DefaultHandlers.prototype.extendSelectionBy = function (unitName) {\n var anchor, editor = this.editor;\n var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y);\n var range = editor.selection[unitName](cursor.row, cursor.column);\n if (this.$clickSelection) {\n var cmpStart = this.$clickSelection.comparePoint(range.start);\n var cmpEnd = this.$clickSelection.comparePoint(range.end);\n if (cmpStart == -1 && cmpEnd <= 0) {\n anchor = this.$clickSelection.end;\n if (range.end.row != cursor.row || range.end.column != cursor.column)\n cursor = range.start;\n }\n else if (cmpEnd == 1 && cmpStart >= 0) {\n anchor = this.$clickSelection.start;\n if (range.start.row != cursor.row || range.start.column != cursor.column)\n cursor = range.end;\n }\n else if (cmpStart == -1 && cmpEnd == 1) {\n cursor = range.end;\n anchor = range.start;\n }\n else {\n var orientedRange = calcRangeOrientation(this.$clickSelection, cursor);\n cursor = orientedRange.cursor;\n anchor = orientedRange.anchor;\n }\n editor.selection.setSelectionAnchor(anchor.row, anchor.column);\n }\n editor.selection.selectToPosition(cursor);\n editor.renderer.scrollCursorIntoView();\n };\n DefaultHandlers.prototype.selectByLinesEnd = function () {\n this.$clickSelection = null;\n this.editor.unsetStyle(\"ace_selecting\");\n };\n DefaultHandlers.prototype.focusWait = function () {\n var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);\n var time = Date.now();\n if (distance > DRAG_OFFSET || time - this.mousedownEvent.time > this.$focusTimeout)\n this.startSelect(this.mousedownEvent.getDocumentPosition());\n };\n DefaultHandlers.prototype.onDoubleClick = function (ev) {\n var pos = ev.getDocumentPosition();\n var editor = this.editor;\n var session = editor.session;\n var range = session.getBracketRange(pos);\n if (range) {\n if (range.isEmpty()) {\n range.start.column--;\n range.end.column++;\n }\n this.setState(\"select\");\n }\n else {\n range = editor.selection.getWordRange(pos.row, pos.column);\n this.setState(\"selectByWords\");\n }\n this.$clickSelection = range;\n this.select();\n };\n DefaultHandlers.prototype.onTripleClick = function (ev) {\n var pos = ev.getDocumentPosition();\n var editor = this.editor;\n this.setState(\"selectByLines\");\n var range = editor.getSelectionRange();\n if (range.isMultiLine() && range.contains(pos.row, pos.column)) {\n this.$clickSelection = editor.selection.getLineRange(range.start.row);\n this.$clickSelection.end = editor.selection.getLineRange(range.end.row).end;\n }\n else {\n this.$clickSelection = editor.selection.getLineRange(pos.row);\n }\n this.select();\n };\n DefaultHandlers.prototype.onQuadClick = function (ev) {\n var editor = this.editor;\n editor.selectAll();\n this.$clickSelection = editor.getSelectionRange();\n this.setState(\"selectAll\");\n };\n DefaultHandlers.prototype.onMouseWheel = function (ev) {\n if (ev.getAccelKey())\n return;\n if (ev.getShiftKey() && ev.wheelY && !ev.wheelX) {\n ev.wheelX = ev.wheelY;\n ev.wheelY = 0;\n }\n var editor = this.editor;\n if (!this.$lastScroll)\n this.$lastScroll = { t: 0, vx: 0, vy: 0, allowed: 0 };\n var prevScroll = this.$lastScroll;\n var t = ev.domEvent.timeStamp;\n var dt = t - prevScroll.t;\n var vx = dt ? ev.wheelX / dt : prevScroll.vx;\n var vy = dt ? ev.wheelY / dt : prevScroll.vy;\n if (dt < SCROLL_COOLDOWN_T) {\n vx = (vx + prevScroll.vx) / 2;\n vy = (vy + prevScroll.vy) / 2;\n }\n var direction = Math.abs(vx / vy);\n var canScroll = false;\n if (direction >= 1 && editor.renderer.isScrollableBy(ev.wheelX * ev.speed, 0))\n canScroll = true;\n if (direction <= 1 && editor.renderer.isScrollableBy(0, ev.wheelY * ev.speed))\n canScroll = true;\n if (canScroll) {\n prevScroll.allowed = t;\n }\n else if (t - prevScroll.allowed < SCROLL_COOLDOWN_T) {\n var isSlower = Math.abs(vx) <= 1.5 * Math.abs(prevScroll.vx)\n && Math.abs(vy) <= 1.5 * Math.abs(prevScroll.vy);\n if (isSlower) {\n canScroll = true;\n prevScroll.allowed = t;\n }\n else {\n prevScroll.allowed = 0;\n }\n }\n prevScroll.t = t;\n prevScroll.vx = vx;\n prevScroll.vy = vy;\n if (canScroll) {\n editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed);\n return ev.stop();\n }\n };\n return DefaultHandlers;\n}());\nDefaultHandlers.prototype.selectEnd = DefaultHandlers.prototype.selectByLinesEnd;\nDefaultHandlers.prototype.selectAllEnd = DefaultHandlers.prototype.selectByLinesEnd;\nDefaultHandlers.prototype.selectByWordsEnd = DefaultHandlers.prototype.selectByLinesEnd;\nexports.DefaultHandlers = DefaultHandlers;\nfunction calcDistance(ax, ay, bx, by) {\n return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2));\n}\nfunction calcRangeOrientation(range, cursor) {\n if (range.start.row == range.end.row)\n var cmp = 2 * cursor.column - range.start.column - range.end.column;\n else if (range.start.row == range.end.row - 1 && !range.start.column && !range.end.column)\n var cmp = cursor.column - 4;\n else\n var cmp = 2 * cursor.row - range.start.row - range.end.row;\n if (cmp < 0)\n return { cursor: range.start, anchor: range.end };\n else\n return { cursor: range.end, anchor: range.start };\n}\n\n});\n\nace.define(\"ace/lib/scroll\",[\"require\",\"exports\",\"module\"], function(require, exports, module){exports.preventParentScroll = function preventParentScroll(event) {\n event.stopPropagation();\n var target = event.currentTarget;\n var contentOverflows = target.scrollHeight > target.clientHeight;\n if (!contentOverflows) {\n event.preventDefault();\n }\n};\n\n});\n\nace.define(\"ace/tooltip\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/range\",\"ace/lib/scroll\"], function(require, exports, module){\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar dom = require(\"./lib/dom\");\nvar event = require(\"./lib/event\");\nvar Range = require(\"./range\").Range;\nvar preventParentScroll = require(\"./lib/scroll\").preventParentScroll;\nvar CLASSNAME = \"ace_tooltip\";\nvar Tooltip = /** @class */ (function () {\n function Tooltip(parentNode) {\n this.isOpen = false;\n this.$element = null;\n this.$parentNode = parentNode;\n }\n Tooltip.prototype.$init = function () {\n this.$element = dom.createElement(\"div\");\n this.$element.className = CLASSNAME;\n this.$element.style.display = \"none\";\n this.$parentNode.appendChild(this.$element);\n return this.$element;\n };\n Tooltip.prototype.getElement = function () {\n return this.$element || this.$init();\n };\n Tooltip.prototype.setText = function (text) {\n this.getElement().textContent = text;\n };\n Tooltip.prototype.setHtml = function (html) {\n this.getElement().innerHTML = html;\n };\n Tooltip.prototype.setPosition = function (x, y) {\n this.getElement().style.left = x + \"px\";\n this.getElement().style.top = y + \"px\";\n };\n Tooltip.prototype.setClassName = function (className) {\n dom.addCssClass(this.getElement(), className);\n };\n Tooltip.prototype.setTheme = function (theme) {\n this.$element.className = CLASSNAME + \" \" +\n (theme.isDark ? \"ace_dark \" : \"\") + (theme.cssClass || \"\");\n };\n Tooltip.prototype.show = function (text, x, y) {\n if (text != null)\n this.setText(text);\n if (x != null && y != null)\n this.setPosition(x, y);\n if (!this.isOpen) {\n this.getElement().style.display = \"block\";\n this.isOpen = true;\n }\n };\n Tooltip.prototype.hide = function (e) {\n if (this.isOpen) {\n this.getElement().style.display = \"none\";\n this.getElement().className = CLASSNAME;\n this.isOpen = false;\n }\n };\n Tooltip.prototype.getHeight = function () {\n return this.getElement().offsetHeight;\n };\n Tooltip.prototype.getWidth = function () {\n return this.getElement().offsetWidth;\n };\n Tooltip.prototype.destroy = function () {\n this.isOpen = false;\n if (this.$element && this.$element.parentNode) {\n this.$element.parentNode.removeChild(this.$element);\n }\n };\n return Tooltip;\n}());\nvar PopupManager = /** @class */ (function () {\n function PopupManager() {\n this.popups = [];\n }\n PopupManager.prototype.addPopup = function (popup) {\n this.popups.push(popup);\n this.updatePopups();\n };\n PopupManager.prototype.removePopup = function (popup) {\n var index = this.popups.indexOf(popup);\n if (index !== -1) {\n this.popups.splice(index, 1);\n this.updatePopups();\n }\n };\n PopupManager.prototype.updatePopups = function () {\n var e_1, _a, e_2, _b;\n this.popups.sort(function (a, b) { return b.priority - a.priority; });\n var visiblepopups = [];\n try {\n for (var _c = __values(this.popups), _d = _c.next(); !_d.done; _d = _c.next()) {\n var popup = _d.value;\n var shouldDisplay = true;\n try {\n for (var visiblepopups_1 = (e_2 = void 0, __values(visiblepopups)), visiblepopups_1_1 = visiblepopups_1.next(); !visiblepopups_1_1.done; visiblepopups_1_1 = visiblepopups_1.next()) {\n var visiblePopup = visiblepopups_1_1.value;\n if (this.doPopupsOverlap(visiblePopup, popup)) {\n shouldDisplay = false;\n break;\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (visiblepopups_1_1 && !visiblepopups_1_1.done && (_b = visiblepopups_1.return)) _b.call(visiblepopups_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (shouldDisplay) {\n visiblepopups.push(popup);\n }\n else {\n popup.hide();\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n PopupManager.prototype.doPopupsOverlap = function (popupA, popupB) {\n var rectA = popupA.getElement().getBoundingClientRect();\n var rectB = popupB.getElement().getBoundingClientRect();\n return (rectA.left < rectB.right && rectA.right > rectB.left && rectA.top < rectB.bottom && rectA.bottom\n > rectB.top);\n };\n return PopupManager;\n}());\nvar popupManager = new PopupManager();\nexports.popupManager = popupManager;\nexports.Tooltip = Tooltip;\nvar HoverTooltip = /** @class */ (function (_super) {\n __extends(HoverTooltip, _super);\n function HoverTooltip(parentNode) {\n if (parentNode === void 0) { parentNode = document.body; }\n var _this = _super.call(this, parentNode) || this;\n _this.timeout = undefined;\n _this.lastT = 0;\n _this.idleTime = 350;\n _this.lastEvent = undefined;\n _this.onMouseOut = _this.onMouseOut.bind(_this);\n _this.onMouseMove = _this.onMouseMove.bind(_this);\n _this.waitForHover = _this.waitForHover.bind(_this);\n _this.hide = _this.hide.bind(_this);\n var el = _this.getElement();\n el.style.whiteSpace = \"pre-wrap\";\n el.style.pointerEvents = \"auto\";\n el.addEventListener(\"mouseout\", _this.onMouseOut);\n el.tabIndex = -1;\n el.addEventListener(\"blur\", function () {\n if (!el.contains(document.activeElement))\n this.hide();\n }.bind(_this));\n el.addEventListener(\"wheel\", preventParentScroll);\n return _this;\n }\n HoverTooltip.prototype.addToEditor = function (editor) {\n editor.on(\"mousemove\", this.onMouseMove);\n editor.on(\"mousedown\", this.hide);\n editor.renderer.getMouseEventTarget().addEventListener(\"mouseout\", this.onMouseOut, true);\n };\n HoverTooltip.prototype.removeFromEditor = function (editor) {\n editor.off(\"mousemove\", this.onMouseMove);\n editor.off(\"mousedown\", this.hide);\n editor.renderer.getMouseEventTarget().removeEventListener(\"mouseout\", this.onMouseOut, true);\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n };\n HoverTooltip.prototype.onMouseMove = function (e, editor) {\n this.lastEvent = e;\n this.lastT = Date.now();\n var isMousePressed = editor.$mouseHandler.isMousePressed;\n if (this.isOpen) {\n var pos = this.lastEvent && this.lastEvent.getDocumentPosition();\n if (!this.range\n || !this.range.contains(pos.row, pos.column)\n || isMousePressed\n || this.isOutsideOfText(this.lastEvent)) {\n this.hide();\n }\n }\n if (this.timeout || isMousePressed)\n return;\n this.lastEvent = e;\n this.timeout = setTimeout(this.waitForHover, this.idleTime);\n };\n HoverTooltip.prototype.waitForHover = function () {\n if (this.timeout)\n clearTimeout(this.timeout);\n var dt = Date.now() - this.lastT;\n if (this.idleTime - dt > 10) {\n this.timeout = setTimeout(this.waitForHover, this.idleTime - dt);\n return;\n }\n this.timeout = null;\n if (this.lastEvent && !this.isOutsideOfText(this.lastEvent)) {\n this.$gatherData(this.lastEvent, this.lastEvent.editor);\n }\n };\n HoverTooltip.prototype.isOutsideOfText = function (e) {\n var editor = e.editor;\n var docPos = e.getDocumentPosition();\n var line = editor.session.getLine(docPos.row);\n if (docPos.column == line.length) {\n var screenPos = editor.renderer.pixelToScreenCoordinates(e.clientX, e.clientY);\n var clippedPos = editor.session.documentToScreenPosition(docPos.row, docPos.column);\n if (clippedPos.column != screenPos.column\n || clippedPos.row != screenPos.row) {\n return true;\n }\n }\n return false;\n };\n HoverTooltip.prototype.setDataProvider = function (value) {\n this.$gatherData = value;\n };\n HoverTooltip.prototype.showForRange = function (editor, range, domNode, startingEvent) {\n var MARGIN = 10;\n if (startingEvent && startingEvent != this.lastEvent)\n return;\n if (this.isOpen && document.activeElement == this.getElement())\n return;\n var renderer = editor.renderer;\n if (!this.isOpen) {\n popupManager.addPopup(this);\n this.$registerCloseEvents();\n this.setTheme(renderer.theme);\n }\n this.isOpen = true;\n this.addMarker(range, editor.session);\n this.range = Range.fromPoints(range.start, range.end);\n var position = renderer.textToScreenCoordinates(range.start.row, range.start.column);\n var rect = renderer.scroller.getBoundingClientRect();\n if (position.pageX < rect.left)\n position.pageX = rect.left;\n var element = this.getElement();\n element.innerHTML = \"\";\n element.appendChild(domNode);\n element.style.maxHeight = \"\";\n element.style.display = \"block\";\n var labelHeight = element.clientHeight;\n var labelWidth = element.clientWidth;\n var spaceBelow = window.innerHeight - position.pageY - renderer.lineHeight;\n var isAbove = true;\n if (position.pageY - labelHeight < 0 && position.pageY < spaceBelow) {\n isAbove = false;\n }\n element.style.maxHeight = (isAbove ? position.pageY : spaceBelow) - MARGIN + \"px\";\n element.style.top = isAbove ? \"\" : position.pageY + renderer.lineHeight + \"px\";\n element.style.bottom = isAbove ? window.innerHeight - position.pageY + \"px\" : \"\";\n element.style.left = Math.min(position.pageX, window.innerWidth - labelWidth - MARGIN) + \"px\";\n };\n HoverTooltip.prototype.addMarker = function (range, session) {\n if (this.marker) {\n this.$markerSession.removeMarker(this.marker);\n }\n this.$markerSession = session;\n this.marker = session && session.addMarker(range, \"ace_highlight-marker\", \"text\");\n };\n HoverTooltip.prototype.hide = function (e) {\n if (!e && document.activeElement == this.getElement())\n return;\n if (e && e.target && (e.type != \"keydown\" || e.ctrlKey || e.metaKey) && this.$element.contains(e.target))\n return;\n this.lastEvent = null;\n if (this.timeout)\n clearTimeout(this.timeout);\n this.timeout = null;\n this.addMarker(null);\n if (this.isOpen) {\n this.$removeCloseEvents();\n this.getElement().style.display = \"none\";\n this.isOpen = false;\n popupManager.removePopup(this);\n }\n };\n HoverTooltip.prototype.$registerCloseEvents = function () {\n window.addEventListener(\"keydown\", this.hide, true);\n window.addEventListener(\"wheel\", this.hide, true);\n window.addEventListener(\"mousedown\", this.hide, true);\n };\n HoverTooltip.prototype.$removeCloseEvents = function () {\n window.removeEventListener(\"keydown\", this.hide, true);\n window.removeEventListener(\"wheel\", this.hide, true);\n window.removeEventListener(\"mousedown\", this.hide, true);\n };\n HoverTooltip.prototype.onMouseOut = function (e) {\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.lastEvent = null;\n if (!this.isOpen)\n return;\n if (!e.relatedTarget || this.getElement().contains(e.relatedTarget))\n return;\n if (e && e.currentTarget.contains(e.relatedTarget))\n return;\n if (!e.relatedTarget.classList.contains(\"ace_content\"))\n this.hide();\n };\n return HoverTooltip;\n}(Tooltip));\nexports.HoverTooltip = HoverTooltip;\n\n});\n\nace.define(\"ace/mouse/default_gutter_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/tooltip\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar dom = require(\"../lib/dom\");\nvar event = require(\"../lib/event\");\nvar Tooltip = require(\"../tooltip\").Tooltip;\nvar nls = require(\"../config\").nls;\nfunction GutterHandler(mouseHandler) {\n var editor = mouseHandler.editor;\n var gutter = editor.renderer.$gutterLayer;\n var tooltip = new GutterTooltip(editor);\n mouseHandler.editor.setDefaultHandler(\"guttermousedown\", function (e) {\n if (!editor.isFocused() || e.getButton() != 0)\n return;\n var gutterRegion = gutter.getRegion(e);\n if (gutterRegion == \"foldWidgets\")\n return;\n var row = e.getDocumentPosition().row;\n var selection = editor.session.selection;\n if (e.getShiftKey())\n selection.selectTo(row, 0);\n else {\n if (e.domEvent.detail == 2) {\n editor.selectAll();\n return e.preventDefault();\n }\n mouseHandler.$clickSelection = editor.selection.getLineRange(row);\n }\n mouseHandler.setState(\"selectByLines\");\n mouseHandler.captureMouse(e);\n return e.preventDefault();\n });\n var tooltipTimeout, mouseEvent;\n function showTooltip() {\n var row = mouseEvent.getDocumentPosition().row;\n var maxRow = editor.session.getLength();\n if (row == maxRow) {\n var screenRow = editor.renderer.pixelToScreenCoordinates(0, mouseEvent.y).row;\n var pos = mouseEvent.$pos;\n if (screenRow > editor.session.documentToScreenRow(pos.row, pos.column))\n return hideTooltip();\n }\n tooltip.showTooltip(row);\n if (!tooltip.isOpen)\n return;\n editor.on(\"mousewheel\", hideTooltip);\n if (mouseHandler.$tooltipFollowsMouse) {\n moveTooltip(mouseEvent);\n }\n else {\n var gutterRow = mouseEvent.getGutterRow();\n var gutterCell = gutter.$lines.get(gutterRow);\n if (gutterCell) {\n var gutterElement = gutterCell.element.querySelector(\".ace_gutter_annotation\");\n var rect = gutterElement.getBoundingClientRect();\n var style = tooltip.getElement().style;\n style.left = rect.right + \"px\";\n style.top = rect.bottom + \"px\";\n }\n else {\n moveTooltip(mouseEvent);\n }\n }\n }\n function hideTooltip() {\n if (tooltipTimeout)\n tooltipTimeout = clearTimeout(tooltipTimeout);\n if (tooltip.isOpen) {\n tooltip.hideTooltip();\n editor.off(\"mousewheel\", hideTooltip);\n }\n }\n function moveTooltip(e) {\n tooltip.setPosition(e.x, e.y);\n }\n mouseHandler.editor.setDefaultHandler(\"guttermousemove\", function (e) {\n var target = e.domEvent.target || e.domEvent.srcElement;\n if (dom.hasCssClass(target, \"ace_fold-widget\"))\n return hideTooltip();\n if (tooltip.isOpen && mouseHandler.$tooltipFollowsMouse)\n moveTooltip(e);\n mouseEvent = e;\n if (tooltipTimeout)\n return;\n tooltipTimeout = setTimeout(function () {\n tooltipTimeout = null;\n if (mouseEvent && !mouseHandler.isMousePressed)\n showTooltip();\n else\n hideTooltip();\n }, 50);\n });\n event.addListener(editor.renderer.$gutter, \"mouseout\", function (e) {\n mouseEvent = null;\n if (!tooltip.isOpen || tooltipTimeout)\n return;\n tooltipTimeout = setTimeout(function () {\n tooltipTimeout = null;\n hideTooltip();\n }, 50);\n }, editor);\n editor.on(\"changeSession\", hideTooltip);\n editor.on(\"input\", hideTooltip);\n}\nexports.GutterHandler = GutterHandler;\nvar GutterTooltip = /** @class */ (function (_super) {\n __extends(GutterTooltip, _super);\n function GutterTooltip(editor) {\n var _this = _super.call(this, editor.container) || this;\n _this.editor = editor;\n return _this;\n }\n GutterTooltip.prototype.setPosition = function (x, y) {\n var windowWidth = window.innerWidth || document.documentElement.clientWidth;\n var windowHeight = window.innerHeight || document.documentElement.clientHeight;\n var width = this.getWidth();\n var height = this.getHeight();\n x += 15;\n y += 15;\n if (x + width > windowWidth) {\n x -= (x + width) - windowWidth;\n }\n if (y + height > windowHeight) {\n y -= 20 + height;\n }\n Tooltip.prototype.setPosition.call(this, x, y);\n };\n Object.defineProperty(GutterTooltip, \"annotationLabels\", {\n get: function () {\n return {\n error: {\n singular: nls(\"gutter-tooltip.aria-label.error.singular\", \"error\"),\n plural: nls(\"gutter-tooltip.aria-label.error.plural\", \"errors\")\n },\n warning: {\n singular: nls(\"gutter-tooltip.aria-label.warning.singular\", \"warning\"),\n plural: nls(\"gutter-tooltip.aria-label.warning.plural\", \"warnings\")\n },\n info: {\n singular: nls(\"gutter-tooltip.aria-label.info.singular\", \"information message\"),\n plural: nls(\"gutter-tooltip.aria-label.info.plural\", \"information messages\")\n }\n };\n },\n enumerable: false,\n configurable: true\n });\n GutterTooltip.prototype.showTooltip = function (row) {\n var gutter = this.editor.renderer.$gutterLayer;\n var annotationsInRow = gutter.$annotations[row];\n var annotation;\n if (annotationsInRow)\n annotation = { text: Array.from(annotationsInRow.text), type: Array.from(annotationsInRow.type) };\n else\n annotation = { text: [], type: [] };\n var fold = gutter.session.getFoldLine(row);\n if (fold && gutter.$showFoldedAnnotations) {\n var annotationsInFold = { error: [], warning: [], info: [] };\n var mostSevereAnnotationInFoldType;\n for (var i = row + 1; i <= fold.end.row; i++) {\n if (!gutter.$annotations[i])\n continue;\n for (var j = 0; j < gutter.$annotations[i].text.length; j++) {\n var annotationType = gutter.$annotations[i].type[j];\n annotationsInFold[annotationType].push(gutter.$annotations[i].text[j]);\n if (annotationType === \"error\") {\n mostSevereAnnotationInFoldType = \"error_fold\";\n continue;\n }\n if (annotationType === \"warning\") {\n mostSevereAnnotationInFoldType = \"warning_fold\";\n continue;\n }\n }\n }\n if (mostSevereAnnotationInFoldType === \"error_fold\" || mostSevereAnnotationInFoldType === \"warning_fold\") {\n var summaryFoldedAnnotations = \"\".concat(GutterTooltip.annotationsToSummaryString(annotationsInFold), \" in folded code.\");\n annotation.text.push(summaryFoldedAnnotations);\n annotation.type.push(mostSevereAnnotationInFoldType);\n }\n }\n if (annotation.text.length === 0)\n return this.hide();\n var annotationMessages = { error: [], warning: [], info: [] };\n var iconClassName = gutter.$useSvgGutterIcons ? \"ace_icon_svg\" : \"ace_icon\";\n for (var i = 0; i < annotation.text.length; i++) {\n var line = \" \").concat(annotation.text[i]);\n annotationMessages[annotation.type[i].replace(\"_fold\", \"\")].push(line);\n }\n var tooltipContent = [].concat(annotationMessages.error, annotationMessages.warning, annotationMessages.info).join(\"
\");\n this.setHtml(tooltipContent);\n this.$element.setAttribute(\"aria-live\", \"polite\");\n if (!this.isOpen) {\n this.setTheme(this.editor.renderer.theme);\n this.setClassName(\"ace_gutter-tooltip\");\n }\n this.show();\n this.editor._signal(\"showGutterTooltip\", this);\n };\n GutterTooltip.prototype.hideTooltip = function () {\n this.$element.removeAttribute(\"aria-live\");\n this.hide();\n this.editor._signal(\"hideGutterTooltip\", this);\n };\n GutterTooltip.annotationsToSummaryString = function (annotations) {\n var e_1, _a;\n var summary = [];\n var annotationTypes = ['error', 'warning', 'info'];\n try {\n for (var annotationTypes_1 = __values(annotationTypes), annotationTypes_1_1 = annotationTypes_1.next(); !annotationTypes_1_1.done; annotationTypes_1_1 = annotationTypes_1.next()) {\n var annotationType = annotationTypes_1_1.value;\n if (!annotations[annotationType].length)\n continue;\n var label = annotations[annotationType].length === 1 ? GutterTooltip.annotationLabels[annotationType].singular : GutterTooltip.annotationLabels[annotationType].plural;\n summary.push(\"\".concat(annotations[annotationType].length, \" \").concat(label));\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (annotationTypes_1_1 && !annotationTypes_1_1.done && (_a = annotationTypes_1.return)) _a.call(annotationTypes_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return summary.join(\", \");\n };\n return GutterTooltip;\n}(Tooltip));\nexports.GutterTooltip = GutterTooltip;\n\n});\n\nace.define(\"ace/mouse/mouse_event\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar MouseEvent = /** @class */ (function () {\n function MouseEvent(domEvent, editor) { this.speed; this.wheelX; this.wheelY;\n this.domEvent = domEvent;\n this.editor = editor;\n this.x = this.clientX = domEvent.clientX;\n this.y = this.clientY = domEvent.clientY;\n this.$pos = null;\n this.$inSelection = null;\n this.propagationStopped = false;\n this.defaultPrevented = false;\n }\n MouseEvent.prototype.stopPropagation = function () {\n event.stopPropagation(this.domEvent);\n this.propagationStopped = true;\n };\n MouseEvent.prototype.preventDefault = function () {\n event.preventDefault(this.domEvent);\n this.defaultPrevented = true;\n };\n MouseEvent.prototype.stop = function () {\n this.stopPropagation();\n this.preventDefault();\n };\n MouseEvent.prototype.getDocumentPosition = function () {\n if (this.$pos)\n return this.$pos;\n this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY);\n return this.$pos;\n };\n MouseEvent.prototype.getGutterRow = function () {\n var documentRow = this.getDocumentPosition().row;\n var screenRow = this.editor.session.documentToScreenRow(documentRow, 0);\n var screenTopRow = this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row, 0);\n return screenRow - screenTopRow;\n };\n MouseEvent.prototype.inSelection = function () {\n if (this.$inSelection !== null)\n return this.$inSelection;\n var editor = this.editor;\n var selectionRange = editor.getSelectionRange();\n if (selectionRange.isEmpty())\n this.$inSelection = false;\n else {\n var pos = this.getDocumentPosition();\n this.$inSelection = selectionRange.contains(pos.row, pos.column);\n }\n return this.$inSelection;\n };\n MouseEvent.prototype.getButton = function () {\n return event.getButton(this.domEvent);\n };\n MouseEvent.prototype.getShiftKey = function () {\n return this.domEvent.shiftKey;\n };\n MouseEvent.prototype.getAccelKey = function () {\n return useragent.isMac ? this.domEvent.metaKey : this.domEvent.ctrlKey;\n };\n return MouseEvent;\n}());\nexports.MouseEvent = MouseEvent;\n\n});\n\nace.define(\"ace/mouse/dragdrop_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar AUTOSCROLL_DELAY = 200;\nvar SCROLL_CURSOR_DELAY = 200;\nvar SCROLL_CURSOR_HYSTERESIS = 5;\nfunction DragdropHandler(mouseHandler) {\n var editor = mouseHandler.editor;\n var dragImage = dom.createElement(\"div\");\n dragImage.style.cssText = \"top:-100px;position:absolute;z-index:2147483647;opacity:0.5\";\n dragImage.textContent = \"\\xa0\";\n var exports = [\"dragWait\", \"dragWaitEnd\", \"startDrag\", \"dragReadyEnd\", \"onMouseDrag\"];\n exports.forEach(function (x) {\n mouseHandler[x] = this[x];\n }, this);\n editor.on(\"mousedown\", this.onMouseDown.bind(mouseHandler));\n var mouseTarget = editor.container;\n var dragSelectionMarker, x, y;\n var timerId, range;\n var dragCursor, counter = 0;\n var dragOperation;\n var isInternal;\n var autoScrollStartTime;\n var cursorMovedTime;\n var cursorPointOnCaretMoved;\n this.onDragStart = function (e) {\n if (this.cancelDrag || !mouseTarget.draggable) {\n var self = this;\n setTimeout(function () {\n self.startSelect();\n self.captureMouse(e);\n }, 0);\n return e.preventDefault();\n }\n range = editor.getSelectionRange();\n var dataTransfer = e.dataTransfer;\n dataTransfer.effectAllowed = editor.getReadOnly() ? \"copy\" : \"copyMove\";\n editor.container.appendChild(dragImage);\n dataTransfer.setDragImage && dataTransfer.setDragImage(dragImage, 0, 0);\n setTimeout(function () {\n editor.container.removeChild(dragImage);\n });\n dataTransfer.clearData();\n dataTransfer.setData(\"Text\", editor.session.getTextRange());\n isInternal = true;\n this.setState(\"drag\");\n };\n this.onDragEnd = function (e) {\n mouseTarget.draggable = false;\n isInternal = false;\n this.setState(null);\n if (!editor.getReadOnly()) {\n var dropEffect = e.dataTransfer.dropEffect;\n if (!dragOperation && dropEffect == \"move\")\n editor.session.remove(editor.getSelectionRange());\n editor.$resetCursorStyle();\n }\n this.editor.unsetStyle(\"ace_dragging\");\n this.editor.renderer.setCursorStyle(\"\");\n };\n this.onDragEnter = function (e) {\n if (editor.getReadOnly() || !canAccept(e.dataTransfer))\n return;\n x = e.clientX;\n y = e.clientY;\n if (!dragSelectionMarker)\n addDragMarker();\n counter++;\n e.dataTransfer.dropEffect = dragOperation = getDropEffect(e);\n return event.preventDefault(e);\n };\n this.onDragOver = function (e) {\n if (editor.getReadOnly() || !canAccept(e.dataTransfer))\n return;\n x = e.clientX;\n y = e.clientY;\n if (!dragSelectionMarker) {\n addDragMarker();\n counter++;\n }\n if (onMouseMoveTimer !== null)\n onMouseMoveTimer = null;\n e.dataTransfer.dropEffect = dragOperation = getDropEffect(e);\n return event.preventDefault(e);\n };\n this.onDragLeave = function (e) {\n counter--;\n if (counter <= 0 && dragSelectionMarker) {\n clearDragMarker();\n dragOperation = null;\n return event.preventDefault(e);\n }\n };\n this.onDrop = function (e) {\n if (!dragCursor)\n return;\n var dataTransfer = e.dataTransfer;\n if (isInternal) {\n switch (dragOperation) {\n case \"move\":\n if (range.contains(dragCursor.row, dragCursor.column)) {\n range = {\n start: dragCursor,\n end: dragCursor\n };\n }\n else {\n range = editor.moveText(range, dragCursor);\n }\n break;\n case \"copy\":\n range = editor.moveText(range, dragCursor, true);\n break;\n }\n }\n else {\n var dropData = dataTransfer.getData('Text');\n range = {\n start: dragCursor,\n end: editor.session.insert(dragCursor, dropData)\n };\n editor.focus();\n dragOperation = null;\n }\n clearDragMarker();\n return event.preventDefault(e);\n };\n event.addListener(mouseTarget, \"dragstart\", this.onDragStart.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"dragend\", this.onDragEnd.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"dragenter\", this.onDragEnter.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"dragover\", this.onDragOver.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"dragleave\", this.onDragLeave.bind(mouseHandler), editor);\n event.addListener(mouseTarget, \"drop\", this.onDrop.bind(mouseHandler), editor);\n function scrollCursorIntoView(cursor, prevCursor) {\n var now = Date.now();\n var vMovement = !prevCursor || cursor.row != prevCursor.row;\n var hMovement = !prevCursor || cursor.column != prevCursor.column;\n if (!cursorMovedTime || vMovement || hMovement) {\n editor.moveCursorToPosition(cursor);\n cursorMovedTime = now;\n cursorPointOnCaretMoved = { x: x, y: y };\n }\n else {\n var distance = calcDistance(cursorPointOnCaretMoved.x, cursorPointOnCaretMoved.y, x, y);\n if (distance > SCROLL_CURSOR_HYSTERESIS) {\n cursorMovedTime = null;\n }\n else if (now - cursorMovedTime >= SCROLL_CURSOR_DELAY) {\n editor.renderer.scrollCursorIntoView();\n cursorMovedTime = null;\n }\n }\n }\n function autoScroll(cursor, prevCursor) {\n var now = Date.now();\n var lineHeight = editor.renderer.layerConfig.lineHeight;\n var characterWidth = editor.renderer.layerConfig.characterWidth;\n var editorRect = editor.renderer.scroller.getBoundingClientRect();\n var offsets = {\n x: {\n left: x - editorRect.left,\n right: editorRect.right - x\n },\n y: {\n top: y - editorRect.top,\n bottom: editorRect.bottom - y\n }\n };\n var nearestXOffset = Math.min(offsets.x.left, offsets.x.right);\n var nearestYOffset = Math.min(offsets.y.top, offsets.y.bottom);\n var scrollCursor = { row: cursor.row, column: cursor.column };\n if (nearestXOffset / characterWidth <= 2) {\n scrollCursor.column += (offsets.x.left < offsets.x.right ? -3 : +2);\n }\n if (nearestYOffset / lineHeight <= 1) {\n scrollCursor.row += (offsets.y.top < offsets.y.bottom ? -1 : +1);\n }\n var vScroll = cursor.row != scrollCursor.row;\n var hScroll = cursor.column != scrollCursor.column;\n var vMovement = !prevCursor || cursor.row != prevCursor.row;\n if (vScroll || (hScroll && !vMovement)) {\n if (!autoScrollStartTime)\n autoScrollStartTime = now;\n else if (now - autoScrollStartTime >= AUTOSCROLL_DELAY)\n editor.renderer.scrollCursorIntoView(scrollCursor);\n }\n else {\n autoScrollStartTime = null;\n }\n }\n function onDragInterval() {\n var prevCursor = dragCursor;\n dragCursor = editor.renderer.screenToTextCoordinates(x, y);\n scrollCursorIntoView(dragCursor, prevCursor);\n autoScroll(dragCursor, prevCursor);\n }\n function addDragMarker() {\n range = editor.selection.toOrientedRange();\n dragSelectionMarker = editor.session.addMarker(range, \"ace_selection\", editor.getSelectionStyle());\n editor.clearSelection();\n if (editor.isFocused())\n editor.renderer.$cursorLayer.setBlinking(false);\n clearInterval(timerId);\n onDragInterval();\n timerId = setInterval(onDragInterval, 20);\n counter = 0;\n event.addListener(document, \"mousemove\", onMouseMove);\n }\n function clearDragMarker() {\n clearInterval(timerId);\n editor.session.removeMarker(dragSelectionMarker);\n dragSelectionMarker = null;\n editor.selection.fromOrientedRange(range);\n if (editor.isFocused() && !isInternal)\n editor.$resetCursorStyle();\n range = null;\n dragCursor = null;\n counter = 0;\n autoScrollStartTime = null;\n cursorMovedTime = null;\n event.removeListener(document, \"mousemove\", onMouseMove);\n }\n var onMouseMoveTimer = null;\n function onMouseMove() {\n if (onMouseMoveTimer == null) {\n onMouseMoveTimer = setTimeout(function () {\n if (onMouseMoveTimer != null && dragSelectionMarker)\n clearDragMarker();\n }, 20);\n }\n }\n function canAccept(dataTransfer) {\n var types = dataTransfer.types;\n return !types || Array.prototype.some.call(types, function (type) {\n return type == 'text/plain' || type == 'Text';\n });\n }\n function getDropEffect(e) {\n var copyAllowed = ['copy', 'copymove', 'all', 'uninitialized'];\n var moveAllowed = ['move', 'copymove', 'linkmove', 'all', 'uninitialized'];\n var copyModifierState = useragent.isMac ? e.altKey : e.ctrlKey;\n var effectAllowed = \"uninitialized\";\n try {\n effectAllowed = e.dataTransfer.effectAllowed.toLowerCase();\n }\n catch (e) { }\n var dropEffect = \"none\";\n if (copyModifierState && copyAllowed.indexOf(effectAllowed) >= 0)\n dropEffect = \"copy\";\n else if (moveAllowed.indexOf(effectAllowed) >= 0)\n dropEffect = \"move\";\n else if (copyAllowed.indexOf(effectAllowed) >= 0)\n dropEffect = \"copy\";\n return dropEffect;\n }\n}\n(function () {\n this.dragWait = function () {\n var interval = Date.now() - this.mousedownEvent.time;\n if (interval > this.editor.getDragDelay())\n this.startDrag();\n };\n this.dragWaitEnd = function () {\n var target = this.editor.container;\n target.draggable = false;\n this.startSelect(this.mousedownEvent.getDocumentPosition());\n this.selectEnd();\n };\n this.dragReadyEnd = function (e) {\n this.editor.$resetCursorStyle();\n this.editor.unsetStyle(\"ace_dragging\");\n this.editor.renderer.setCursorStyle(\"\");\n this.dragWaitEnd();\n };\n this.startDrag = function () {\n this.cancelDrag = false;\n var editor = this.editor;\n var target = editor.container;\n target.draggable = true;\n editor.renderer.$cursorLayer.setBlinking(false);\n editor.setStyle(\"ace_dragging\");\n var cursorStyle = useragent.isWin ? \"default\" : \"move\";\n editor.renderer.setCursorStyle(cursorStyle);\n this.setState(\"dragReady\");\n };\n this.onMouseDrag = function (e) {\n var target = this.editor.container;\n if (useragent.isIE && this.state == \"dragReady\") {\n var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);\n if (distance > 3)\n target.dragDrop();\n }\n if (this.state === \"dragWait\") {\n var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);\n if (distance > 0) {\n target.draggable = false;\n this.startSelect(this.mousedownEvent.getDocumentPosition());\n }\n }\n };\n this.onMouseDown = function (e) {\n if (!this.$dragEnabled)\n return;\n this.mousedownEvent = e;\n var editor = this.editor;\n var inSelection = e.inSelection();\n var button = e.getButton();\n var clickCount = e.domEvent.detail || 1;\n if (clickCount === 1 && button === 0 && inSelection) {\n if (e.editor.inMultiSelectMode && (e.getAccelKey() || e.getShiftKey()))\n return;\n this.mousedownEvent.time = Date.now();\n var eventTarget = e.domEvent.target || e.domEvent.srcElement;\n if (\"unselectable\" in eventTarget)\n eventTarget.unselectable = \"on\";\n if (editor.getDragDelay()) {\n if (useragent.isWebKit) {\n this.cancelDrag = true;\n var mouseTarget = editor.container;\n mouseTarget.draggable = true;\n }\n this.setState(\"dragWait\");\n }\n else {\n this.startDrag();\n }\n this.captureMouse(e, this.onMouseDrag.bind(this));\n e.defaultPrevented = true;\n }\n };\n}).call(DragdropHandler.prototype);\nfunction calcDistance(ax, ay, bx, by) {\n return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2));\n}\nexports.DragdropHandler = DragdropHandler;\n\n});\n\nace.define(\"ace/mouse/touch_handler\",[\"require\",\"exports\",\"module\",\"ace/mouse/mouse_event\",\"ace/lib/event\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar MouseEvent = require(\"./mouse_event\").MouseEvent;\nvar event = require(\"../lib/event\");\nvar dom = require(\"../lib/dom\");\nexports.addTouchListeners = function (el, editor) {\n var mode = \"scroll\";\n var startX;\n var startY;\n var touchStartT;\n var lastT;\n var longTouchTimer;\n var animationTimer;\n var animationSteps = 0;\n var pos;\n var clickCount = 0;\n var vX = 0;\n var vY = 0;\n var pressed;\n var contextMenu;\n function createContextMenu() {\n var clipboard = window.navigator && window.navigator.clipboard;\n var isOpen = false;\n var updateMenu = function () {\n var selected = editor.getCopyText();\n var hasUndo = editor.session.getUndoManager().hasUndo();\n contextMenu.replaceChild(dom.buildDom(isOpen ? [\"span\",\n !selected && [\"span\", { class: \"ace_mobile-button\", action: \"selectall\" }, \"Select All\"],\n selected && [\"span\", { class: \"ace_mobile-button\", action: \"copy\" }, \"Copy\"],\n selected && [\"span\", { class: \"ace_mobile-button\", action: \"cut\" }, \"Cut\"],\n clipboard && [\"span\", { class: \"ace_mobile-button\", action: \"paste\" }, \"Paste\"],\n hasUndo && [\"span\", { class: \"ace_mobile-button\", action: \"undo\" }, \"Undo\"],\n [\"span\", { class: \"ace_mobile-button\", action: \"find\" }, \"Find\"],\n [\"span\", { class: \"ace_mobile-button\", action: \"openCommandPalette\" }, \"Palette\"]\n ] : [\"span\"]), contextMenu.firstChild);\n };\n var handleClick = function (e) {\n var action = e.target.getAttribute(\"action\");\n if (action == \"more\" || !isOpen) {\n isOpen = !isOpen;\n return updateMenu();\n }\n if (action == \"paste\") {\n clipboard.readText().then(function (text) {\n editor.execCommand(action, text);\n });\n }\n else if (action) {\n if (action == \"cut\" || action == \"copy\") {\n if (clipboard)\n clipboard.writeText(editor.getCopyText());\n else\n document.execCommand(\"copy\");\n }\n editor.execCommand(action);\n }\n contextMenu.firstChild.style.display = \"none\";\n isOpen = false;\n if (action != \"openCommandPalette\")\n editor.focus();\n };\n contextMenu = dom.buildDom([\"div\",\n {\n class: \"ace_mobile-menu\",\n ontouchstart: function (e) {\n mode = \"menu\";\n e.stopPropagation();\n e.preventDefault();\n editor.textInput.focus();\n },\n ontouchend: function (e) {\n e.stopPropagation();\n e.preventDefault();\n handleClick(e);\n },\n onclick: handleClick\n },\n [\"span\"],\n [\"span\", { class: \"ace_mobile-button\", action: \"more\" }, \"...\"]\n ], editor.container);\n }\n function showContextMenu() {\n if (!contextMenu)\n createContextMenu();\n var cursor = editor.selection.cursor;\n var pagePos = editor.renderer.textToScreenCoordinates(cursor.row, cursor.column);\n var leftOffset = editor.renderer.textToScreenCoordinates(0, 0).pageX;\n var scrollLeft = editor.renderer.scrollLeft;\n var rect = editor.container.getBoundingClientRect();\n contextMenu.style.top = pagePos.pageY - rect.top - 3 + \"px\";\n if (pagePos.pageX - rect.left < rect.width - 70) {\n contextMenu.style.left = \"\";\n contextMenu.style.right = \"10px\";\n }\n else {\n contextMenu.style.right = \"\";\n contextMenu.style.left = leftOffset + scrollLeft - rect.left + \"px\";\n }\n contextMenu.style.display = \"\";\n contextMenu.firstChild.style.display = \"none\";\n editor.on(\"input\", hideContextMenu);\n }\n function hideContextMenu(e) {\n if (contextMenu)\n contextMenu.style.display = \"none\";\n editor.off(\"input\", hideContextMenu);\n }\n function handleLongTap() {\n longTouchTimer = null;\n clearTimeout(longTouchTimer);\n var range = editor.selection.getRange();\n var inSelection = range.contains(pos.row, pos.column);\n if (range.isEmpty() || !inSelection) {\n editor.selection.moveToPosition(pos);\n editor.selection.selectWord();\n }\n mode = \"wait\";\n showContextMenu();\n }\n function switchToSelectionMode() {\n longTouchTimer = null;\n clearTimeout(longTouchTimer);\n editor.selection.moveToPosition(pos);\n var range = clickCount >= 2\n ? editor.selection.getLineRange(pos.row)\n : editor.session.getBracketRange(pos);\n if (range && !range.isEmpty()) {\n editor.selection.setRange(range);\n }\n else {\n editor.selection.selectWord();\n }\n mode = \"wait\";\n }\n event.addListener(el, \"contextmenu\", function (e) {\n if (!pressed)\n return;\n var textarea = editor.textInput.getElement();\n textarea.focus();\n }, editor);\n event.addListener(el, \"touchstart\", function (e) {\n var touches = e.touches;\n if (longTouchTimer || touches.length > 1) {\n clearTimeout(longTouchTimer);\n longTouchTimer = null;\n touchStartT = -1;\n mode = \"zoom\";\n return;\n }\n pressed = editor.$mouseHandler.isMousePressed = true;\n var h = editor.renderer.layerConfig.lineHeight;\n var w = editor.renderer.layerConfig.lineHeight;\n var t = e.timeStamp;\n lastT = t;\n var touchObj = touches[0];\n var x = touchObj.clientX;\n var y = touchObj.clientY;\n if (Math.abs(startX - x) + Math.abs(startY - y) > h)\n touchStartT = -1;\n startX = e.clientX = x;\n startY = e.clientY = y;\n vX = vY = 0;\n var ev = new MouseEvent(e, editor);\n pos = ev.getDocumentPosition();\n if (t - touchStartT < 500 && touches.length == 1 && !animationSteps) {\n clickCount++;\n e.preventDefault();\n e.button = 0;\n switchToSelectionMode();\n }\n else {\n clickCount = 0;\n var cursor = editor.selection.cursor;\n var anchor = editor.selection.isEmpty() ? cursor : editor.selection.anchor;\n var cursorPos = editor.renderer.$cursorLayer.getPixelPosition(cursor, true);\n var anchorPos = editor.renderer.$cursorLayer.getPixelPosition(anchor, true);\n var rect = editor.renderer.scroller.getBoundingClientRect();\n var offsetTop = editor.renderer.layerConfig.offset;\n var offsetLeft = editor.renderer.scrollLeft;\n var weightedDistance = function (x, y) {\n x = x / w;\n y = y / h - 0.75;\n return x * x + y * y;\n };\n if (e.clientX < rect.left) {\n mode = \"zoom\";\n return;\n }\n var diff1 = weightedDistance(e.clientX - rect.left - cursorPos.left + offsetLeft, e.clientY - rect.top - cursorPos.top + offsetTop);\n var diff2 = weightedDistance(e.clientX - rect.left - anchorPos.left + offsetLeft, e.clientY - rect.top - anchorPos.top + offsetTop);\n if (diff1 < 3.5 && diff2 < 3.5)\n mode = diff1 > diff2 ? \"cursor\" : \"anchor\";\n if (diff2 < 3.5)\n mode = \"anchor\";\n else if (diff1 < 3.5)\n mode = \"cursor\";\n else\n mode = \"scroll\";\n longTouchTimer = setTimeout(handleLongTap, 450);\n }\n touchStartT = t;\n }, editor);\n event.addListener(el, \"touchend\", function (e) {\n pressed = editor.$mouseHandler.isMousePressed = false;\n if (animationTimer)\n clearInterval(animationTimer);\n if (mode == \"zoom\") {\n mode = \"\";\n animationSteps = 0;\n }\n else if (longTouchTimer) {\n editor.selection.moveToPosition(pos);\n animationSteps = 0;\n showContextMenu();\n }\n else if (mode == \"scroll\") {\n animate();\n hideContextMenu();\n }\n else {\n showContextMenu();\n }\n clearTimeout(longTouchTimer);\n longTouchTimer = null;\n }, editor);\n event.addListener(el, \"touchmove\", function (e) {\n if (longTouchTimer) {\n clearTimeout(longTouchTimer);\n longTouchTimer = null;\n }\n var touches = e.touches;\n if (touches.length > 1 || mode == \"zoom\")\n return;\n var touchObj = touches[0];\n var wheelX = startX - touchObj.clientX;\n var wheelY = startY - touchObj.clientY;\n if (mode == \"wait\") {\n if (wheelX * wheelX + wheelY * wheelY > 4)\n mode = \"cursor\";\n else\n return e.preventDefault();\n }\n startX = touchObj.clientX;\n startY = touchObj.clientY;\n e.clientX = touchObj.clientX;\n e.clientY = touchObj.clientY;\n var t = e.timeStamp;\n var dt = t - lastT;\n lastT = t;\n if (mode == \"scroll\") {\n var mouseEvent = new MouseEvent(e, editor);\n mouseEvent.speed = 1;\n mouseEvent.wheelX = wheelX;\n mouseEvent.wheelY = wheelY;\n if (10 * Math.abs(wheelX) < Math.abs(wheelY))\n wheelX = 0;\n if (10 * Math.abs(wheelY) < Math.abs(wheelX))\n wheelY = 0;\n if (dt != 0) {\n vX = wheelX / dt;\n vY = wheelY / dt;\n }\n editor._emit(\"mousewheel\", mouseEvent);\n if (!mouseEvent.propagationStopped) {\n vX = vY = 0;\n }\n }\n else {\n var ev = new MouseEvent(e, editor);\n var pos = ev.getDocumentPosition();\n if (mode == \"cursor\")\n editor.selection.moveCursorToPosition(pos);\n else if (mode == \"anchor\")\n editor.selection.setSelectionAnchor(pos.row, pos.column);\n editor.renderer.scrollCursorIntoView(pos);\n e.preventDefault();\n }\n }, editor);\n function animate() {\n animationSteps += 60;\n animationTimer = setInterval(function () {\n if (animationSteps-- <= 0) {\n clearInterval(animationTimer);\n animationTimer = null;\n }\n if (Math.abs(vX) < 0.01)\n vX = 0;\n if (Math.abs(vY) < 0.01)\n vY = 0;\n if (animationSteps < 20)\n vX = 0.9 * vX;\n if (animationSteps < 20)\n vY = 0.9 * vY;\n var oldScrollTop = editor.session.getScrollTop();\n editor.renderer.scrollBy(10 * vX, 10 * vY);\n if (oldScrollTop == editor.session.getScrollTop())\n animationSteps = 0;\n }, 10);\n }\n};\n\n});\n\nace.define(\"ace/mouse/mouse_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/lib/useragent\",\"ace/mouse/default_handlers\",\"ace/mouse/default_gutter_handler\",\"ace/mouse/mouse_event\",\"ace/mouse/dragdrop_handler\",\"ace/mouse/touch_handler\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar DefaultHandlers = require(\"./default_handlers\").DefaultHandlers;\nvar DefaultGutterHandler = require(\"./default_gutter_handler\").GutterHandler;\nvar MouseEvent = require(\"./mouse_event\").MouseEvent;\nvar DragdropHandler = require(\"./dragdrop_handler\").DragdropHandler;\nvar addTouchListeners = require(\"./touch_handler\").addTouchListeners;\nvar config = require(\"../config\");\nvar MouseHandler = /** @class */ (function () {\n function MouseHandler(editor) { this.$dragDelay; this.$dragEnabled; this.$mouseMoved; this.mouseEvent; this.$focusTimeout;\n var _self = this;\n this.editor = editor;\n new DefaultHandlers(this);\n new DefaultGutterHandler(this);\n new DragdropHandler(this);\n var focusEditor = function (e) {\n var windowBlurred = !document.hasFocus || !document.hasFocus()\n || !editor.isFocused() && document.activeElement == (editor.textInput && editor.textInput.getElement());\n if (windowBlurred)\n window.focus();\n editor.focus();\n setTimeout(function () {\n if (!editor.isFocused())\n editor.focus();\n });\n };\n var mouseTarget = editor.renderer.getMouseEventTarget();\n event.addListener(mouseTarget, \"click\", this.onMouseEvent.bind(this, \"click\"), editor);\n event.addListener(mouseTarget, \"mousemove\", this.onMouseMove.bind(this, \"mousemove\"), editor);\n event.addMultiMouseDownListener([\n mouseTarget,\n editor.renderer.scrollBarV && editor.renderer.scrollBarV.inner,\n editor.renderer.scrollBarH && editor.renderer.scrollBarH.inner,\n editor.textInput && editor.textInput.getElement()\n ].filter(Boolean), [400, 300, 250], this, \"onMouseEvent\", editor);\n event.addMouseWheelListener(editor.container, this.onMouseWheel.bind(this, \"mousewheel\"), editor);\n addTouchListeners(editor.container, editor);\n var gutterEl = editor.renderer.$gutter;\n event.addListener(gutterEl, \"mousedown\", this.onMouseEvent.bind(this, \"guttermousedown\"), editor);\n event.addListener(gutterEl, \"click\", this.onMouseEvent.bind(this, \"gutterclick\"), editor);\n event.addListener(gutterEl, \"dblclick\", this.onMouseEvent.bind(this, \"gutterdblclick\"), editor);\n event.addListener(gutterEl, \"mousemove\", this.onMouseEvent.bind(this, \"guttermousemove\"), editor);\n event.addListener(mouseTarget, \"mousedown\", focusEditor, editor);\n event.addListener(gutterEl, \"mousedown\", focusEditor, editor);\n if (useragent.isIE && editor.renderer.scrollBarV) {\n event.addListener(editor.renderer.scrollBarV.element, \"mousedown\", focusEditor, editor);\n event.addListener(editor.renderer.scrollBarH.element, \"mousedown\", focusEditor, editor);\n }\n editor.on(\"mousemove\", function (e) {\n if (_self.state || _self.$dragDelay || !_self.$dragEnabled)\n return;\n var character = editor.renderer.screenToTextCoordinates(e.x, e.y);\n var range = editor.session.selection.getRange();\n var renderer = editor.renderer;\n if (!range.isEmpty() && range.insideStart(character.row, character.column)) {\n renderer.setCursorStyle(\"default\");\n }\n else {\n renderer.setCursorStyle(\"\");\n }\n }, //@ts-expect-error TODO: seems mistyping - should be boolean\n editor);\n }\n MouseHandler.prototype.onMouseEvent = function (name, e) {\n if (!this.editor.session)\n return;\n this.editor._emit(name, new MouseEvent(e, this.editor));\n };\n MouseHandler.prototype.onMouseMove = function (name, e) {\n var listeners = this.editor._eventRegistry && this.editor._eventRegistry.mousemove;\n if (!listeners || !listeners.length)\n return;\n this.editor._emit(name, new MouseEvent(e, this.editor));\n };\n MouseHandler.prototype.onMouseWheel = function (name, e) {\n var mouseEvent = new MouseEvent(e, this.editor);\n mouseEvent.speed = this.$scrollSpeed * 2;\n mouseEvent.wheelX = e.wheelX;\n mouseEvent.wheelY = e.wheelY;\n this.editor._emit(name, mouseEvent);\n };\n MouseHandler.prototype.setState = function (state) {\n this.state = state;\n };\n MouseHandler.prototype.captureMouse = function (ev, mouseMoveHandler) {\n this.x = ev.x;\n this.y = ev.y;\n this.isMousePressed = true;\n var editor = this.editor;\n var renderer = this.editor.renderer;\n renderer.$isMousePressed = true;\n var self = this;\n var onMouseMove = function (e) {\n if (!e)\n return;\n if (useragent.isWebKit && !e.which && self.releaseMouse)\n return self.releaseMouse();\n self.x = e.clientX;\n self.y = e.clientY;\n mouseMoveHandler && mouseMoveHandler(e);\n self.mouseEvent = new MouseEvent(e, self.editor);\n self.$mouseMoved = true;\n };\n var onCaptureEnd = function (e) {\n editor.off(\"beforeEndOperation\", onOperationEnd);\n clearInterval(timerId);\n if (editor.session)\n onCaptureInterval();\n self[self.state + \"End\"] && self[self.state + \"End\"](e);\n self.state = \"\";\n self.isMousePressed = renderer.$isMousePressed = false;\n if (renderer.$keepTextAreaAtCursor)\n renderer.$moveTextAreaToCursor();\n self.$onCaptureMouseMove = self.releaseMouse = null;\n e && self.onMouseEvent(\"mouseup\", e);\n editor.endOperation();\n };\n var onCaptureInterval = function () {\n self[self.state] && self[self.state]();\n self.$mouseMoved = false;\n };\n if (useragent.isOldIE && ev.domEvent.type == \"dblclick\") {\n return setTimeout(function () { onCaptureEnd(ev); });\n }\n var onOperationEnd = function (e) {\n if (!self.releaseMouse)\n return;\n if (editor.curOp.command.name && editor.curOp.selectionChanged) {\n self[self.state + \"End\"] && self[self.state + \"End\"]();\n self.state = \"\";\n self.releaseMouse();\n }\n };\n editor.on(\"beforeEndOperation\", onOperationEnd);\n editor.startOperation({ command: { name: \"mouse\" } });\n self.$onCaptureMouseMove = onMouseMove;\n self.releaseMouse = event.capture(this.editor.container, onMouseMove, onCaptureEnd);\n var timerId = setInterval(onCaptureInterval, 20);\n };\n MouseHandler.prototype.cancelContextMenu = function () {\n var stop = function (e) {\n if (e && e.domEvent && e.domEvent.type != \"contextmenu\")\n return;\n this.editor.off(\"nativecontextmenu\", stop);\n if (e && e.domEvent)\n event.stopEvent(e.domEvent);\n }.bind(this);\n setTimeout(stop, 10);\n this.editor.on(\"nativecontextmenu\", stop);\n };\n MouseHandler.prototype.destroy = function () {\n if (this.releaseMouse)\n this.releaseMouse();\n };\n return MouseHandler;\n}());\nMouseHandler.prototype.releaseMouse = null;\nconfig.defineOptions(MouseHandler.prototype, \"mouseHandler\", {\n scrollSpeed: { initialValue: 2 },\n dragDelay: { initialValue: (useragent.isMac ? 150 : 0) },\n dragEnabled: { initialValue: true },\n focusTimeout: { initialValue: 0 },\n tooltipFollowsMouse: { initialValue: true }\n});\nexports.MouseHandler = MouseHandler;\n\n});\n\nace.define(\"ace/mouse/fold_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar FoldHandler = /** @class */ (function () {\n function FoldHandler(editor) {\n editor.on(\"click\", function (e) {\n var position = e.getDocumentPosition();\n var session = editor.session;\n var fold = session.getFoldAt(position.row, position.column, 1);\n if (fold) {\n if (e.getAccelKey())\n session.removeFold(fold);\n else\n session.expandFold(fold);\n e.stop();\n }\n var target = e.domEvent && e.domEvent.target;\n if (target && dom.hasCssClass(target, \"ace_inline_button\")) {\n if (dom.hasCssClass(target, \"ace_toggle_wrap\")) {\n session.setOption(\"wrap\", !session.getUseWrapMode());\n editor.renderer.scrollCursorIntoView();\n }\n }\n });\n editor.on(\"gutterclick\", function (e) {\n var gutterRegion = editor.renderer.$gutterLayer.getRegion(e);\n if (gutterRegion == \"foldWidgets\") {\n var row = e.getDocumentPosition().row;\n var session = editor.session;\n if (session.foldWidgets && session.foldWidgets[row])\n editor.session.onFoldWidgetClick(row, e);\n if (!editor.isFocused())\n editor.focus();\n e.stop();\n }\n });\n editor.on(\"gutterdblclick\", function (e) {\n var gutterRegion = editor.renderer.$gutterLayer.getRegion(e);\n if (gutterRegion == \"foldWidgets\") {\n var row = e.getDocumentPosition().row;\n var session = editor.session;\n var data = session.getParentFoldRangeData(row, true);\n var range = data.range || data.firstRange;\n if (range) {\n row = range.start.row;\n var fold = session.getFoldAt(row, session.getLine(row).length, 1);\n if (fold) {\n session.removeFold(fold);\n }\n else {\n session.addFold(\"...\", range);\n editor.renderer.scrollCursorIntoView({ row: range.start.row, column: 0 });\n }\n }\n e.stop();\n }\n });\n }\n return FoldHandler;\n}());\nexports.FoldHandler = FoldHandler;\n\n});\n\nace.define(\"ace/keyboard/keybinding\",[\"require\",\"exports\",\"module\",\"ace/lib/keys\",\"ace/lib/event\"], function(require, exports, module){\"use strict\";\nvar keyUtil = require(\"../lib/keys\");\nvar event = require(\"../lib/event\");\nvar KeyBinding = /** @class */ (function () {\n function KeyBinding(editor) {\n this.$editor = editor;\n this.$data = { editor: editor };\n this.$handlers = [];\n this.setDefaultHandler(editor.commands);\n }\n KeyBinding.prototype.setDefaultHandler = function (kb) {\n this.removeKeyboardHandler(this.$defaultHandler);\n this.$defaultHandler = kb;\n this.addKeyboardHandler(kb, 0);\n };\n KeyBinding.prototype.setKeyboardHandler = function (kb) {\n var h = this.$handlers;\n if (h[h.length - 1] == kb)\n return;\n while (h[h.length - 1] && h[h.length - 1] != this.$defaultHandler)\n this.removeKeyboardHandler(h[h.length - 1]);\n this.addKeyboardHandler(kb, 1);\n };\n KeyBinding.prototype.addKeyboardHandler = function (kb, pos) {\n if (!kb)\n return;\n if (typeof kb == \"function\" && !kb.handleKeyboard)\n kb.handleKeyboard = kb;\n var i = this.$handlers.indexOf(kb);\n if (i != -1)\n this.$handlers.splice(i, 1);\n if (pos == undefined)\n this.$handlers.push(kb);\n else\n this.$handlers.splice(pos, 0, kb);\n if (i == -1 && kb.attach)\n kb.attach(this.$editor);\n };\n KeyBinding.prototype.removeKeyboardHandler = function (kb) {\n var i = this.$handlers.indexOf(kb);\n if (i == -1)\n return false;\n this.$handlers.splice(i, 1);\n kb.detach && kb.detach(this.$editor);\n return true;\n };\n KeyBinding.prototype.getKeyboardHandler = function () {\n return this.$handlers[this.$handlers.length - 1];\n };\n KeyBinding.prototype.getStatusText = function () {\n var data = this.$data;\n var editor = data.editor;\n return this.$handlers.map(function (h) {\n return h.getStatusText && h.getStatusText(editor, data) || \"\";\n }).filter(Boolean).join(\" \");\n };\n KeyBinding.prototype.$callKeyboardHandlers = function (hashId, keyString, keyCode, e) {\n var toExecute;\n var success = false;\n var commands = this.$editor.commands;\n for (var i = this.$handlers.length; i--;) {\n toExecute = this.$handlers[i].handleKeyboard(\n this.$data, hashId, keyString, keyCode, e);\n if (!toExecute || !toExecute.command)\n continue;\n if (toExecute.command == \"null\") {\n success = true;\n }\n else {\n success = commands.exec(toExecute.command, this.$editor, toExecute.args, e);\n }\n if (success && e && hashId != -1 &&\n toExecute[\"passEvent\"] != true && toExecute.command[\"passEvent\"] != true) {\n event.stopEvent(e);\n }\n if (success)\n break;\n }\n if (!success && hashId == -1) {\n toExecute = { command: \"insertstring\" };\n success = commands.exec(\"insertstring\", this.$editor, keyString);\n }\n if (success && this.$editor._signal)\n this.$editor._signal(\"keyboardActivity\", toExecute);\n return success;\n };\n KeyBinding.prototype.onCommandKey = function (e, hashId, keyCode) {\n var keyString = keyUtil.keyCodeToString(keyCode);\n return this.$callKeyboardHandlers(hashId, keyString, keyCode, e);\n };\n KeyBinding.prototype.onTextInput = function (text) {\n return this.$callKeyboardHandlers(-1, text);\n };\n return KeyBinding;\n}());\nexports.KeyBinding = KeyBinding;\n\n});\n\nace.define(\"ace/lib/bidiutil\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar ArabicAlefBetIntervalsBegine = ['\\u0621', '\\u0641'];\nvar ArabicAlefBetIntervalsEnd = ['\\u063A', '\\u064a'];\nvar dir = 0, hiLevel = 0;\nvar lastArabic = false, hasUBAT_AL = false, hasUBAT_B = false, hasUBAT_S = false, hasBlockSep = false, hasSegSep = false;\nvar impTab_LTR = [ [0, 3, 0, 1, 0, 0, 0], [0, 3, 0, 1, 2, 2, 0], [0, 3, 0, 0x11, 2, 0, 1], [0, 3, 5, 5, 4, 1, 0], [0, 3, 0x15, 0x15, 4, 0, 1], [0, 3, 5, 5, 4, 2, 0]\n];\nvar impTab_RTL = [ [2, 0, 1, 1, 0, 1, 0], [2, 0, 1, 1, 0, 2, 0], [2, 0, 2, 1, 3, 2, 0], [2, 0, 2, 0x21, 3, 1, 1]\n];\nvar LTR = 0, RTL = 1;\nvar L = 0;\nvar R = 1;\nvar EN = 2;\nvar AN = 3;\nvar ON = 4;\nvar B = 5;\nvar S = 6;\nvar AL = 7;\nvar WS = 8;\nvar CS = 9;\nvar ES = 10;\nvar ET = 11;\nvar NSM = 12;\nvar LRE = 13;\nvar RLE = 14;\nvar PDF = 15;\nvar LRO = 16;\nvar RLO = 17;\nvar BN = 18;\nvar UnicodeTBL00 = [\n BN, BN, BN, BN, BN, BN, BN, BN, BN, S, B, S, WS, B, BN, BN,\n BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, B, B, B, S,\n WS, ON, ON, ET, ET, ET, ON, ON, ON, ON, ON, ES, CS, ES, CS, CS,\n EN, EN, EN, EN, EN, EN, EN, EN, EN, EN, CS, ON, ON, ON, ON, ON,\n ON, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L,\n L, L, L, L, L, L, L, L, L, L, L, ON, ON, ON, ON, ON,\n ON, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L,\n L, L, L, L, L, L, L, L, L, L, L, ON, ON, ON, ON, BN,\n BN, BN, BN, BN, BN, B, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN,\n BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN,\n CS, ON, ET, ET, ET, ET, ON, ON, ON, ON, L, ON, ON, BN, ON, ON,\n ET, ET, EN, EN, ON, L, ON, ON, ON, EN, L, ON, ON, ON, ON, ON\n];\nvar UnicodeTBL20 = [\n WS, WS, WS, WS, WS, WS, WS, WS, WS, WS, WS, BN, BN, BN, L, R,\n ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON,\n ON, ON, ON, ON, ON, ON, ON, ON, WS, B, LRE, RLE, PDF, LRO, RLO, CS,\n ET, ET, ET, ET, ET, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON,\n ON, ON, ON, ON, CS, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON,\n ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, WS\n];\nfunction _computeLevels(chars, levels, len, charTypes) {\n var impTab = dir ? impTab_RTL : impTab_LTR, prevState = null, newClass = null, newLevel = null, newState = 0, action = null, cond = null, condPos = -1, i = null, ix = null, classes = [];\n if (!charTypes) {\n for (i = 0, charTypes = []; i < len; i++) {\n charTypes[i] = _getCharacterType(chars[i]);\n }\n }\n hiLevel = dir;\n lastArabic = false;\n hasUBAT_AL = false;\n hasUBAT_B = false;\n hasUBAT_S = false;\n for (ix = 0; ix < len; ix++) {\n prevState = newState;\n classes[ix] = newClass = _getCharClass(chars, charTypes, classes, ix);\n newState = impTab[prevState][newClass];\n action = newState & 0xF0;\n newState &= 0x0F;\n levels[ix] = newLevel = impTab[newState][5];\n if (action > 0) {\n if (action == 0x10) {\n for (i = condPos; i < ix; i++) {\n levels[i] = 1;\n }\n condPos = -1;\n }\n else {\n condPos = -1;\n }\n }\n cond = impTab[newState][6];\n if (cond) {\n if (condPos == -1) {\n condPos = ix;\n }\n }\n else {\n if (condPos > -1) {\n for (i = condPos; i < ix; i++) {\n levels[i] = newLevel;\n }\n condPos = -1;\n }\n }\n if (charTypes[ix] == B) {\n levels[ix] = 0;\n }\n hiLevel |= newLevel;\n }\n if (hasUBAT_S) {\n for (i = 0; i < len; i++) {\n if (charTypes[i] == S) {\n levels[i] = dir;\n for (var j = i - 1; j >= 0; j--) {\n if (charTypes[j] == WS) {\n levels[j] = dir;\n }\n else {\n break;\n }\n }\n }\n }\n }\n}\nfunction _invertLevel(lev, levels, _array) {\n if (hiLevel < lev) {\n return;\n }\n if (lev == 1 && dir == RTL && !hasUBAT_B) {\n _array.reverse();\n return;\n }\n var len = _array.length, start = 0, end, lo, hi, tmp;\n while (start < len) {\n if (levels[start] >= lev) {\n end = start + 1;\n while (end < len && levels[end] >= lev) {\n end++;\n }\n for (lo = start, hi = end - 1; lo < hi; lo++, hi--) {\n tmp = _array[lo];\n _array[lo] = _array[hi];\n _array[hi] = tmp;\n }\n start = end;\n }\n start++;\n }\n}\nfunction _getCharClass(chars, types, classes, ix) {\n var cType = types[ix], wType, nType, len, i;\n switch (cType) {\n case L:\n case R:\n lastArabic = false;\n case ON:\n case AN:\n return cType;\n case EN:\n return lastArabic ? AN : EN;\n case AL:\n lastArabic = true;\n hasUBAT_AL = true;\n return R;\n case WS:\n return ON;\n case CS:\n if (ix < 1 || (ix + 1) >= types.length ||\n ((wType = classes[ix - 1]) != EN && wType != AN) ||\n ((nType = types[ix + 1]) != EN && nType != AN)) {\n return ON;\n }\n if (lastArabic) {\n nType = AN;\n }\n return nType == wType ? nType : ON;\n case ES:\n wType = ix > 0 ? classes[ix - 1] : B;\n if (wType == EN && (ix + 1) < types.length && types[ix + 1] == EN) {\n return EN;\n }\n return ON;\n case ET:\n if (ix > 0 && classes[ix - 1] == EN) {\n return EN;\n }\n if (lastArabic) {\n return ON;\n }\n i = ix + 1;\n len = types.length;\n while (i < len && types[i] == ET) {\n i++;\n }\n if (i < len && types[i] == EN) {\n return EN;\n }\n return ON;\n case NSM:\n len = types.length;\n i = ix + 1;\n while (i < len && types[i] == NSM) {\n i++;\n }\n if (i < len) {\n var c = chars[ix], rtlCandidate = (c >= 0x0591 && c <= 0x08FF) || c == 0xFB1E;\n wType = types[i];\n if (rtlCandidate && (wType == R || wType == AL)) {\n return R;\n }\n }\n if (ix < 1 || (wType = types[ix - 1]) == B) {\n return ON;\n }\n return classes[ix - 1];\n case B:\n lastArabic = false;\n hasUBAT_B = true;\n return dir;\n case S:\n hasUBAT_S = true;\n return ON;\n case LRE:\n case RLE:\n case LRO:\n case RLO:\n case PDF:\n lastArabic = false;\n case BN:\n return ON;\n }\n}\nfunction _getCharacterType(ch) {\n var uc = ch.charCodeAt(0), hi = uc >> 8;\n if (hi == 0) {\n return ((uc > 0x00BF) ? L : UnicodeTBL00[uc]);\n }\n else if (hi == 5) {\n return (/[\\u0591-\\u05f4]/.test(ch) ? R : L);\n }\n else if (hi == 6) {\n if (/[\\u0610-\\u061a\\u064b-\\u065f\\u06d6-\\u06e4\\u06e7-\\u06ed]/.test(ch))\n return NSM;\n else if (/[\\u0660-\\u0669\\u066b-\\u066c]/.test(ch))\n return AN;\n else if (uc == 0x066A)\n return ET;\n else if (/[\\u06f0-\\u06f9]/.test(ch))\n return EN;\n else\n return AL;\n }\n else if (hi == 0x20 && uc <= 0x205F) {\n return UnicodeTBL20[uc & 0xFF];\n }\n else if (hi == 0xFE) {\n return (uc >= 0xFE70 ? AL : ON);\n }\n return ON;\n}\nfunction _isArabicDiacritics(ch) {\n return (ch >= '\\u064b' && ch <= '\\u0655');\n}\nexports.L = L;\nexports.R = R;\nexports.EN = EN;\nexports.ON_R = 3;\nexports.AN = 4;\nexports.R_H = 5;\nexports.B = 6;\nexports.RLE = 7;\nexports.DOT = \"\\xB7\";\nexports.doBidiReorder = function (text, textCharTypes, isRtl) {\n if (text.length < 2)\n return {};\n var chars = text.split(\"\"), logicalFromVisual = new Array(chars.length), bidiLevels = new Array(chars.length), levels = [];\n dir = isRtl ? RTL : LTR;\n _computeLevels(chars, levels, chars.length, textCharTypes);\n for (var i = 0; i < logicalFromVisual.length; logicalFromVisual[i] = i, i++)\n ;\n _invertLevel(2, levels, logicalFromVisual);\n _invertLevel(1, levels, logicalFromVisual);\n for (var i = 0; i < logicalFromVisual.length - 1; i++) { //fix levels to reflect character width\n if (textCharTypes[i] === AN) {\n levels[i] = exports.AN;\n }\n else if (levels[i] === R && ((textCharTypes[i] > AL && textCharTypes[i] < LRE)\n || textCharTypes[i] === ON || textCharTypes[i] === BN)) {\n levels[i] = exports.ON_R;\n }\n else if ((i > 0 && chars[i - 1] === '\\u0644') && /\\u0622|\\u0623|\\u0625|\\u0627/.test(chars[i])) {\n levels[i - 1] = levels[i] = exports.R_H;\n i++;\n }\n }\n if (chars[chars.length - 1] === exports.DOT)\n levels[chars.length - 1] = exports.B;\n if (chars[0] === '\\u202B')\n levels[0] = exports.RLE;\n for (var i = 0; i < logicalFromVisual.length; i++) {\n bidiLevels[i] = levels[logicalFromVisual[i]];\n }\n return { 'logicalFromVisual': logicalFromVisual, 'bidiLevels': bidiLevels };\n};\nexports.hasBidiCharacters = function (text, textCharTypes) {\n var ret = false;\n for (var i = 0; i < text.length; i++) {\n textCharTypes[i] = _getCharacterType(text.charAt(i));\n if (!ret && (textCharTypes[i] == R || textCharTypes[i] == AL || textCharTypes[i] == AN))\n ret = true;\n }\n return ret;\n};\nexports.getVisualFromLogicalIdx = function (logIdx, rowMap) {\n for (var i = 0; i < rowMap.logicalFromVisual.length; i++) {\n if (rowMap.logicalFromVisual[i] == logIdx)\n return i;\n }\n return 0;\n};\n\n});\n\nace.define(\"ace/bidihandler\",[\"require\",\"exports\",\"module\",\"ace/lib/bidiutil\",\"ace/lib/lang\"], function(require, exports, module){\"use strict\";\nvar bidiUtil = require(\"./lib/bidiutil\");\nvar lang = require(\"./lib/lang\");\nvar bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac\\u202B]/;\nvar BidiHandler = /** @class */ (function () {\n function BidiHandler(session) {\n this.session = session;\n this.bidiMap = {};\n this.currentRow = null;\n this.bidiUtil = bidiUtil;\n this.charWidths = [];\n this.EOL = \"\\xAC\";\n this.showInvisibles = true;\n this.isRtlDir = false;\n this.$isRtl = false;\n this.line = \"\";\n this.wrapIndent = 0;\n this.EOF = \"\\xB6\";\n this.RLE = \"\\u202B\";\n this.contentWidth = 0;\n this.fontMetrics = null;\n this.rtlLineOffset = 0;\n this.wrapOffset = 0;\n this.isMoveLeftOperation = false;\n this.seenBidi = bidiRE.test(session.getValue());\n }\n BidiHandler.prototype.isBidiRow = function (screenRow, docRow, splitIndex) {\n if (!this.seenBidi)\n return false;\n if (screenRow !== this.currentRow) {\n this.currentRow = screenRow;\n this.updateRowLine(docRow, splitIndex);\n this.updateBidiMap();\n }\n return this.bidiMap.bidiLevels;\n };\n BidiHandler.prototype.onChange = function (delta) {\n if (!this.seenBidi) {\n if (delta.action == \"insert\" && bidiRE.test(delta.lines.join(\"\\n\"))) {\n this.seenBidi = true;\n this.currentRow = null;\n }\n }\n else {\n this.currentRow = null;\n }\n };\n BidiHandler.prototype.getDocumentRow = function () {\n var docRow = 0;\n var rowCache = this.session.$screenRowCache;\n if (rowCache.length) {\n var index = this.session.$getRowCacheIndex(rowCache, this.currentRow);\n if (index >= 0)\n docRow = this.session.$docRowCache[index];\n }\n return docRow;\n };\n BidiHandler.prototype.getSplitIndex = function () {\n var splitIndex = 0;\n var rowCache = this.session.$screenRowCache;\n if (rowCache.length) {\n var currentIndex, prevIndex = this.session.$getRowCacheIndex(rowCache, this.currentRow);\n while (this.currentRow - splitIndex > 0) {\n currentIndex = this.session.$getRowCacheIndex(rowCache, this.currentRow - splitIndex - 1);\n if (currentIndex !== prevIndex)\n break;\n prevIndex = currentIndex;\n splitIndex++;\n }\n }\n else {\n splitIndex = this.currentRow;\n }\n return splitIndex;\n };\n BidiHandler.prototype.updateRowLine = function (docRow, splitIndex) {\n if (docRow === undefined)\n docRow = this.getDocumentRow();\n var isLastRow = (docRow === this.session.getLength() - 1), endOfLine = isLastRow ? this.EOF : this.EOL;\n this.wrapIndent = 0;\n this.line = this.session.getLine(docRow);\n this.isRtlDir = this.$isRtl || this.line.charAt(0) === this.RLE;\n if (this.session.$useWrapMode) {\n var splits = this.session.$wrapData[docRow];\n if (splits) {\n if (splitIndex === undefined)\n splitIndex = this.getSplitIndex();\n if (splitIndex > 0 && splits.length) {\n this.wrapIndent = splits.indent;\n this.wrapOffset = this.wrapIndent * this.charWidths[bidiUtil.L];\n this.line = (splitIndex < splits.length) ?\n this.line.substring(splits[splitIndex - 1], splits[splitIndex]) :\n this.line.substring(splits[splits.length - 1]);\n }\n else {\n this.line = this.line.substring(0, splits[splitIndex]);\n }\n if (splitIndex == splits.length) {\n this.line += (this.showInvisibles) ? endOfLine : bidiUtil.DOT;\n }\n }\n }\n else {\n this.line += this.showInvisibles ? endOfLine : bidiUtil.DOT;\n }\n var session = this.session, shift = 0, size;\n this.line = this.line.replace(/\\t|[\\u1100-\\u2029, \\u202F-\\uFFE6]/g, function (ch, i) {\n if (ch === '\\t' || session.isFullWidth(ch.charCodeAt(0))) {\n size = (ch === '\\t') ? session.getScreenTabSize(i + shift) : 2;\n shift += size - 1;\n return lang.stringRepeat(bidiUtil.DOT, size);\n }\n return ch;\n });\n if (this.isRtlDir) {\n this.fontMetrics.$main.textContent = (this.line.charAt(this.line.length - 1) == bidiUtil.DOT) ? this.line.substr(0, this.line.length - 1) : this.line;\n this.rtlLineOffset = this.contentWidth - this.fontMetrics.$main.getBoundingClientRect().width;\n }\n };\n BidiHandler.prototype.updateBidiMap = function () {\n var textCharTypes = [];\n if (bidiUtil.hasBidiCharacters(this.line, textCharTypes) || this.isRtlDir) {\n this.bidiMap = bidiUtil.doBidiReorder(this.line, textCharTypes, this.isRtlDir);\n }\n else {\n this.bidiMap = {};\n }\n };\n BidiHandler.prototype.markAsDirty = function () {\n this.currentRow = null;\n };\n BidiHandler.prototype.updateCharacterWidths = function (fontMetrics) {\n if (this.characterWidth === fontMetrics.$characterSize.width)\n return;\n this.fontMetrics = fontMetrics;\n var characterWidth = this.characterWidth = fontMetrics.$characterSize.width;\n var bidiCharWidth = fontMetrics.$measureCharWidth(\"\\u05d4\");\n this.charWidths[bidiUtil.L] = this.charWidths[bidiUtil.EN] = this.charWidths[bidiUtil.ON_R] = characterWidth;\n this.charWidths[bidiUtil.R] = this.charWidths[bidiUtil.AN] = bidiCharWidth;\n this.charWidths[bidiUtil.R_H] = bidiCharWidth * 0.45;\n this.charWidths[bidiUtil.B] = this.charWidths[bidiUtil.RLE] = 0;\n this.currentRow = null;\n };\n BidiHandler.prototype.setShowInvisibles = function (showInvisibles) {\n this.showInvisibles = showInvisibles;\n this.currentRow = null;\n };\n BidiHandler.prototype.setEolChar = function (eolChar) {\n this.EOL = eolChar;\n };\n BidiHandler.prototype.setContentWidth = function (width) {\n this.contentWidth = width;\n };\n BidiHandler.prototype.isRtlLine = function (row) {\n if (this.$isRtl)\n return true;\n if (row != undefined)\n return (this.session.getLine(row).charAt(0) == this.RLE);\n else\n return this.isRtlDir;\n };\n BidiHandler.prototype.setRtlDirection = function (editor, isRtlDir) {\n var cursor = editor.getCursorPosition();\n for (var row = editor.selection.getSelectionAnchor().row; row <= cursor.row; row++) {\n if (!isRtlDir && editor.session.getLine(row).charAt(0) === editor.session.$bidiHandler.RLE)\n editor.session.doc.removeInLine(row, 0, 1);\n else if (isRtlDir && editor.session.getLine(row).charAt(0) !== editor.session.$bidiHandler.RLE)\n editor.session.doc.insert({ column: 0, row: row }, editor.session.$bidiHandler.RLE);\n }\n };\n BidiHandler.prototype.getPosLeft = function (col) {\n col -= this.wrapIndent;\n var leftBoundary = (this.line.charAt(0) === this.RLE) ? 1 : 0;\n var logicalIdx = (col > leftBoundary) ? (this.session.getOverwrite() ? col : col - 1) : leftBoundary;\n var visualIdx = bidiUtil.getVisualFromLogicalIdx(logicalIdx, this.bidiMap), levels = this.bidiMap.bidiLevels, left = 0;\n if (!this.session.getOverwrite() && col <= leftBoundary && levels[visualIdx] % 2 !== 0)\n visualIdx++;\n for (var i = 0; i < visualIdx; i++) {\n left += this.charWidths[levels[i]];\n }\n if (!this.session.getOverwrite() && (col > leftBoundary) && (levels[visualIdx] % 2 === 0))\n left += this.charWidths[levels[visualIdx]];\n if (this.wrapIndent)\n left += this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset;\n if (this.isRtlDir)\n left += this.rtlLineOffset;\n return left;\n };\n BidiHandler.prototype.getSelections = function (startCol, endCol) {\n var map = this.bidiMap, levels = map.bidiLevels, level, selections = [], offset = 0, selColMin = Math.min(startCol, endCol) - this.wrapIndent, selColMax = Math.max(startCol, endCol) - this.wrapIndent, isSelected = false, isSelectedPrev = false, selectionStart = 0;\n if (this.wrapIndent)\n offset += this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset;\n for (var logIdx, visIdx = 0; visIdx < levels.length; visIdx++) {\n logIdx = map.logicalFromVisual[visIdx];\n level = levels[visIdx];\n isSelected = (logIdx >= selColMin) && (logIdx < selColMax);\n if (isSelected && !isSelectedPrev) {\n selectionStart = offset;\n }\n else if (!isSelected && isSelectedPrev) {\n selections.push({ left: selectionStart, width: offset - selectionStart });\n }\n offset += this.charWidths[level];\n isSelectedPrev = isSelected;\n }\n if (isSelected && (visIdx === levels.length)) {\n selections.push({ left: selectionStart, width: offset - selectionStart });\n }\n if (this.isRtlDir) {\n for (var i = 0; i < selections.length; i++) {\n selections[i].left += this.rtlLineOffset;\n }\n }\n return selections;\n };\n BidiHandler.prototype.offsetToCol = function (posX) {\n if (this.isRtlDir)\n posX -= this.rtlLineOffset;\n var logicalIdx = 0, posX = Math.max(posX, 0), offset = 0, visualIdx = 0, levels = this.bidiMap.bidiLevels, charWidth = this.charWidths[levels[visualIdx]];\n if (this.wrapIndent)\n posX -= this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset;\n while (posX > offset + charWidth / 2) {\n offset += charWidth;\n if (visualIdx === levels.length - 1) {\n charWidth = 0;\n break;\n }\n charWidth = this.charWidths[levels[++visualIdx]];\n }\n if (visualIdx > 0 && (levels[visualIdx - 1] % 2 !== 0) && (levels[visualIdx] % 2 === 0)) {\n if (posX < offset)\n visualIdx--;\n logicalIdx = this.bidiMap.logicalFromVisual[visualIdx];\n }\n else if (visualIdx > 0 && (levels[visualIdx - 1] % 2 === 0) && (levels[visualIdx] % 2 !== 0)) {\n logicalIdx = 1 + ((posX > offset) ? this.bidiMap.logicalFromVisual[visualIdx]\n : this.bidiMap.logicalFromVisual[visualIdx - 1]);\n }\n else if ((this.isRtlDir && visualIdx === levels.length - 1 && charWidth === 0 && (levels[visualIdx - 1] % 2 === 0))\n || (!this.isRtlDir && visualIdx === 0 && (levels[visualIdx] % 2 !== 0))) {\n logicalIdx = 1 + this.bidiMap.logicalFromVisual[visualIdx];\n }\n else {\n if (visualIdx > 0 && (levels[visualIdx - 1] % 2 !== 0) && charWidth !== 0)\n visualIdx--;\n logicalIdx = this.bidiMap.logicalFromVisual[visualIdx];\n }\n if (logicalIdx === 0 && this.isRtlDir)\n logicalIdx++;\n return (logicalIdx + this.wrapIndent);\n };\n return BidiHandler;\n}());\nexports.BidiHandler = BidiHandler;\n\n});\n\nace.define(\"ace/selection\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/lib/event_emitter\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar lang = require(\"./lib/lang\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Range = require(\"./range\").Range;\nvar Selection = /** @class */ (function () {\n function Selection(session) {\n this.session = session;\n this.doc = session.getDocument();\n this.clearSelection();\n this.cursor = this.lead = this.doc.createAnchor(0, 0);\n this.anchor = this.doc.createAnchor(0, 0);\n this.$silent = false;\n var self = this;\n this.cursor.on(\"change\", function (e) {\n self.$cursorChanged = true;\n if (!self.$silent)\n self._emit(\"changeCursor\");\n if (!self.$isEmpty && !self.$silent)\n self._emit(\"changeSelection\");\n if (!self.$keepDesiredColumnOnChange && e.old.column != e.value.column)\n self.$desiredColumn = null;\n });\n this.anchor.on(\"change\", function () {\n self.$anchorChanged = true;\n if (!self.$isEmpty && !self.$silent)\n self._emit(\"changeSelection\");\n });\n }\n Selection.prototype.isEmpty = function () {\n return this.$isEmpty || (this.anchor.row == this.lead.row &&\n this.anchor.column == this.lead.column);\n };\n Selection.prototype.isMultiLine = function () {\n return !this.$isEmpty && this.anchor.row != this.cursor.row;\n };\n Selection.prototype.getCursor = function () {\n return this.lead.getPosition();\n };\n Selection.prototype.setAnchor = function (row, column) {\n this.$isEmpty = false;\n this.anchor.setPosition(row, column);\n };\n Selection.prototype.getAnchor = function () {\n if (this.$isEmpty)\n return this.getSelectionLead();\n return this.anchor.getPosition();\n };\n Selection.prototype.getSelectionLead = function () {\n return this.lead.getPosition();\n };\n Selection.prototype.isBackwards = function () {\n var anchor = this.anchor;\n var lead = this.lead;\n return (anchor.row > lead.row || (anchor.row == lead.row && anchor.column > lead.column));\n };\n Selection.prototype.getRange = function () {\n var anchor = this.anchor;\n var lead = this.lead;\n if (this.$isEmpty)\n return Range.fromPoints(lead, lead);\n return this.isBackwards()\n ? Range.fromPoints(lead, anchor)\n : Range.fromPoints(anchor, lead);\n };\n Selection.prototype.clearSelection = function () {\n if (!this.$isEmpty) {\n this.$isEmpty = true;\n this._emit(\"changeSelection\");\n }\n };\n Selection.prototype.selectAll = function () {\n this.$setSelection(0, 0, Number.MAX_VALUE, Number.MAX_VALUE);\n };\n Selection.prototype.setRange = function (range, reverse) {\n var start = reverse ? range.end : range.start;\n var end = reverse ? range.start : range.end;\n this.$setSelection(start.row, start.column, end.row, end.column);\n };\n Selection.prototype.$setSelection = function (anchorRow, anchorColumn, cursorRow, cursorColumn) {\n if (this.$silent)\n return;\n var wasEmpty = this.$isEmpty;\n var wasMultiselect = this.inMultiSelectMode;\n this.$silent = true;\n this.$cursorChanged = this.$anchorChanged = false;\n this.anchor.setPosition(anchorRow, anchorColumn);\n this.cursor.setPosition(cursorRow, cursorColumn);\n this.$isEmpty = !Range.comparePoints(this.anchor, this.cursor);\n this.$silent = false;\n if (this.$cursorChanged)\n this._emit(\"changeCursor\");\n if (this.$cursorChanged || this.$anchorChanged || wasEmpty != this.$isEmpty || wasMultiselect)\n this._emit(\"changeSelection\");\n };\n Selection.prototype.$moveSelection = function (mover) {\n var lead = this.lead;\n if (this.$isEmpty)\n this.setSelectionAnchor(lead.row, lead.column);\n mover.call(this);\n };\n Selection.prototype.selectTo = function (row, column) {\n this.$moveSelection(function () {\n this.moveCursorTo(row, column);\n });\n };\n Selection.prototype.selectToPosition = function (pos) {\n this.$moveSelection(function () {\n this.moveCursorToPosition(pos);\n });\n };\n Selection.prototype.moveTo = function (row, column) {\n this.clearSelection();\n this.moveCursorTo(row, column);\n };\n Selection.prototype.moveToPosition = function (pos) {\n this.clearSelection();\n this.moveCursorToPosition(pos);\n };\n Selection.prototype.selectUp = function () {\n this.$moveSelection(this.moveCursorUp);\n };\n Selection.prototype.selectDown = function () {\n this.$moveSelection(this.moveCursorDown);\n };\n Selection.prototype.selectRight = function () {\n this.$moveSelection(this.moveCursorRight);\n };\n Selection.prototype.selectLeft = function () {\n this.$moveSelection(this.moveCursorLeft);\n };\n Selection.prototype.selectLineStart = function () {\n this.$moveSelection(this.moveCursorLineStart);\n };\n Selection.prototype.selectLineEnd = function () {\n this.$moveSelection(this.moveCursorLineEnd);\n };\n Selection.prototype.selectFileEnd = function () {\n this.$moveSelection(this.moveCursorFileEnd);\n };\n Selection.prototype.selectFileStart = function () {\n this.$moveSelection(this.moveCursorFileStart);\n };\n Selection.prototype.selectWordRight = function () {\n this.$moveSelection(this.moveCursorWordRight);\n };\n Selection.prototype.selectWordLeft = function () {\n this.$moveSelection(this.moveCursorWordLeft);\n };\n Selection.prototype.getWordRange = function (row, column) {\n if (typeof column == \"undefined\") {\n var cursor = row || this.lead;\n row = cursor.row;\n column = cursor.column;\n }\n return this.session.getWordRange(row, column);\n };\n Selection.prototype.selectWord = function () {\n this.setSelectionRange(this.getWordRange());\n };\n Selection.prototype.selectAWord = function () {\n var cursor = this.getCursor();\n var range = this.session.getAWordRange(cursor.row, cursor.column);\n this.setSelectionRange(range);\n };\n Selection.prototype.getLineRange = function (row, excludeLastChar) {\n var rowStart = typeof row == \"number\" ? row : this.lead.row;\n var rowEnd;\n var foldLine = this.session.getFoldLine(rowStart);\n if (foldLine) {\n rowStart = foldLine.start.row;\n rowEnd = foldLine.end.row;\n }\n else {\n rowEnd = rowStart;\n }\n if (excludeLastChar === true)\n return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length);\n else\n return new Range(rowStart, 0, rowEnd + 1, 0);\n };\n Selection.prototype.selectLine = function () {\n this.setSelectionRange(this.getLineRange());\n };\n Selection.prototype.moveCursorUp = function () {\n this.moveCursorBy(-1, 0);\n };\n Selection.prototype.moveCursorDown = function () {\n this.moveCursorBy(1, 0);\n };\n Selection.prototype.wouldMoveIntoSoftTab = function (cursor, tabSize, direction) {\n var start = cursor.column;\n var end = cursor.column + tabSize;\n if (direction < 0) {\n start = cursor.column - tabSize;\n end = cursor.column;\n }\n return this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(start, end).split(\" \").length - 1 == tabSize;\n };\n Selection.prototype.moveCursorLeft = function () {\n var cursor = this.lead.getPosition(), fold;\n if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) {\n this.moveCursorTo(fold.start.row, fold.start.column);\n }\n else if (cursor.column === 0) {\n if (cursor.row > 0) {\n this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length);\n }\n }\n else {\n var tabSize = this.session.getTabSize();\n if (this.wouldMoveIntoSoftTab(cursor, tabSize, -1) && !this.session.getNavigateWithinSoftTabs()) {\n this.moveCursorBy(0, -tabSize);\n }\n else {\n this.moveCursorBy(0, -1);\n }\n }\n };\n Selection.prototype.moveCursorRight = function () {\n var cursor = this.lead.getPosition(), fold;\n if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) {\n this.moveCursorTo(fold.end.row, fold.end.column);\n }\n else if (this.lead.column == this.doc.getLine(this.lead.row).length) {\n if (this.lead.row < this.doc.getLength() - 1) {\n this.moveCursorTo(this.lead.row + 1, 0);\n }\n }\n else {\n var tabSize = this.session.getTabSize();\n var cursor = this.lead;\n if (this.wouldMoveIntoSoftTab(cursor, tabSize, 1) && !this.session.getNavigateWithinSoftTabs()) {\n this.moveCursorBy(0, tabSize);\n }\n else {\n this.moveCursorBy(0, 1);\n }\n }\n };\n Selection.prototype.moveCursorLineStart = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var screenRow = this.session.documentToScreenRow(row, column);\n var firstColumnPosition = this.session.screenToDocumentPosition(screenRow, 0);\n var beforeCursor = this.session.getDisplayLine(row, null, firstColumnPosition.row, firstColumnPosition.column);\n var leadingSpace = beforeCursor.match(/^\\s*/);\n if (leadingSpace[0].length != column && !this.session.$useEmacsStyleLineStart)\n firstColumnPosition.column += leadingSpace[0].length;\n this.moveCursorToPosition(firstColumnPosition);\n };\n Selection.prototype.moveCursorLineEnd = function () {\n var lead = this.lead;\n var lineEnd = this.session.getDocumentLastRowColumnPosition(lead.row, lead.column);\n if (this.lead.column == lineEnd.column) {\n var line = this.session.getLine(lineEnd.row);\n if (lineEnd.column == line.length) {\n var textEnd = line.search(/\\s+$/);\n if (textEnd > 0)\n lineEnd.column = textEnd;\n }\n }\n this.moveCursorTo(lineEnd.row, lineEnd.column);\n };\n Selection.prototype.moveCursorFileEnd = function () {\n var row = this.doc.getLength() - 1;\n var column = this.doc.getLine(row).length;\n this.moveCursorTo(row, column);\n };\n Selection.prototype.moveCursorFileStart = function () {\n this.moveCursorTo(0, 0);\n };\n Selection.prototype.moveCursorLongWordRight = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var line = this.doc.getLine(row);\n var rightOfCursor = line.substring(column);\n this.session.nonTokenRe.lastIndex = 0;\n this.session.tokenRe.lastIndex = 0;\n var fold = this.session.getFoldAt(row, column, 1);\n if (fold) {\n this.moveCursorTo(fold.end.row, fold.end.column);\n return;\n }\n if (this.session.nonTokenRe.exec(rightOfCursor)) {\n column += this.session.nonTokenRe.lastIndex;\n this.session.nonTokenRe.lastIndex = 0;\n rightOfCursor = line.substring(column);\n }\n if (column >= line.length) {\n this.moveCursorTo(row, line.length);\n this.moveCursorRight();\n if (row < this.doc.getLength() - 1)\n this.moveCursorWordRight();\n return;\n }\n if (this.session.tokenRe.exec(rightOfCursor)) {\n column += this.session.tokenRe.lastIndex;\n this.session.tokenRe.lastIndex = 0;\n }\n this.moveCursorTo(row, column);\n };\n Selection.prototype.moveCursorLongWordLeft = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var fold;\n if (fold = this.session.getFoldAt(row, column, -1)) {\n this.moveCursorTo(fold.start.row, fold.start.column);\n return;\n }\n var str = this.session.getFoldStringAt(row, column, -1);\n if (str == null) {\n str = this.doc.getLine(row).substring(0, column);\n }\n var leftOfCursor = lang.stringReverse(str);\n this.session.nonTokenRe.lastIndex = 0;\n this.session.tokenRe.lastIndex = 0;\n if (this.session.nonTokenRe.exec(leftOfCursor)) {\n column -= this.session.nonTokenRe.lastIndex;\n leftOfCursor = leftOfCursor.slice(this.session.nonTokenRe.lastIndex);\n this.session.nonTokenRe.lastIndex = 0;\n }\n if (column <= 0) {\n this.moveCursorTo(row, 0);\n this.moveCursorLeft();\n if (row > 0)\n this.moveCursorWordLeft();\n return;\n }\n if (this.session.tokenRe.exec(leftOfCursor)) {\n column -= this.session.tokenRe.lastIndex;\n this.session.tokenRe.lastIndex = 0;\n }\n this.moveCursorTo(row, column);\n };\n Selection.prototype.$shortWordEndIndex = function (rightOfCursor) {\n var index = 0, ch;\n var whitespaceRe = /\\s/;\n var tokenRe = this.session.tokenRe;\n tokenRe.lastIndex = 0;\n if (this.session.tokenRe.exec(rightOfCursor)) {\n index = this.session.tokenRe.lastIndex;\n }\n else {\n while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch))\n index++;\n if (index < 1) {\n tokenRe.lastIndex = 0;\n while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) {\n tokenRe.lastIndex = 0;\n index++;\n if (whitespaceRe.test(ch)) {\n if (index > 2) {\n index--;\n break;\n }\n else {\n while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch))\n index++;\n if (index > 2)\n break;\n }\n }\n }\n }\n }\n tokenRe.lastIndex = 0;\n return index;\n };\n Selection.prototype.moveCursorShortWordRight = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var line = this.doc.getLine(row);\n var rightOfCursor = line.substring(column);\n var fold = this.session.getFoldAt(row, column, 1);\n if (fold)\n return this.moveCursorTo(fold.end.row, fold.end.column);\n if (column == line.length) {\n var l = this.doc.getLength();\n do {\n row++;\n rightOfCursor = this.doc.getLine(row);\n } while (row < l && /^\\s*$/.test(rightOfCursor));\n if (!/^\\s+/.test(rightOfCursor))\n rightOfCursor = \"\";\n column = 0;\n }\n var index = this.$shortWordEndIndex(rightOfCursor);\n this.moveCursorTo(row, column + index);\n };\n Selection.prototype.moveCursorShortWordLeft = function () {\n var row = this.lead.row;\n var column = this.lead.column;\n var fold;\n if (fold = this.session.getFoldAt(row, column, -1))\n return this.moveCursorTo(fold.start.row, fold.start.column);\n var line = this.session.getLine(row).substring(0, column);\n if (column === 0) {\n do {\n row--;\n line = this.doc.getLine(row);\n } while (row > 0 && /^\\s*$/.test(line));\n column = line.length;\n if (!/\\s+$/.test(line))\n line = \"\";\n }\n var leftOfCursor = lang.stringReverse(line);\n var index = this.$shortWordEndIndex(leftOfCursor);\n return this.moveCursorTo(row, column - index);\n };\n Selection.prototype.moveCursorWordRight = function () {\n if (this.session.$selectLongWords)\n this.moveCursorLongWordRight();\n else\n this.moveCursorShortWordRight();\n };\n Selection.prototype.moveCursorWordLeft = function () {\n if (this.session.$selectLongWords)\n this.moveCursorLongWordLeft();\n else\n this.moveCursorShortWordLeft();\n };\n Selection.prototype.moveCursorBy = function (rows, chars) {\n var screenPos = this.session.documentToScreenPosition(this.lead.row, this.lead.column);\n var offsetX;\n if (chars === 0) {\n if (rows !== 0) {\n if (this.session.$bidiHandler.isBidiRow(screenPos.row, this.lead.row)) {\n offsetX = this.session.$bidiHandler.getPosLeft(screenPos.column);\n screenPos.column = Math.round(offsetX / this.session.$bidiHandler.charWidths[0]);\n }\n else {\n offsetX = screenPos.column * this.session.$bidiHandler.charWidths[0];\n }\n }\n if (this.$desiredColumn)\n screenPos.column = this.$desiredColumn;\n else\n this.$desiredColumn = screenPos.column;\n }\n if (rows != 0 && this.session.lineWidgets && this.session.lineWidgets[this.lead.row]) {\n var widget = this.session.lineWidgets[this.lead.row];\n if (rows < 0)\n rows -= widget.rowsAbove || 0;\n else if (rows > 0)\n rows += widget.rowCount - (widget.rowsAbove || 0);\n }\n var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenPos.column, offsetX);\n if (rows !== 0 && chars === 0 && docPos.row === this.lead.row && docPos.column === this.lead.column) {\n }\n this.moveCursorTo(docPos.row, docPos.column + chars, chars === 0);\n };\n Selection.prototype.moveCursorToPosition = function (position) {\n this.moveCursorTo(position.row, position.column);\n };\n Selection.prototype.moveCursorTo = function (row, column, keepDesiredColumn) {\n var fold = this.session.getFoldAt(row, column, 1);\n if (fold) {\n row = fold.start.row;\n column = fold.start.column;\n }\n this.$keepDesiredColumnOnChange = true;\n var line = this.session.getLine(row);\n if (/[\\uDC00-\\uDFFF]/.test(line.charAt(column)) && line.charAt(column - 1)) {\n if (this.lead.row == row && this.lead.column == column + 1)\n column = column - 1;\n else\n column = column + 1;\n }\n this.lead.setPosition(row, column);\n this.$keepDesiredColumnOnChange = false;\n if (!keepDesiredColumn)\n this.$desiredColumn = null;\n };\n Selection.prototype.moveCursorToScreen = function (row, column, keepDesiredColumn) {\n var pos = this.session.screenToDocumentPosition(row, column);\n this.moveCursorTo(pos.row, pos.column, keepDesiredColumn);\n };\n Selection.prototype.detach = function () {\n this.lead.detach();\n this.anchor.detach();\n };\n Selection.prototype.fromOrientedRange = function (range) {\n this.setSelectionRange(range, range.cursor == range.start);\n this.$desiredColumn = range.desiredColumn || this.$desiredColumn;\n };\n Selection.prototype.toOrientedRange = function (range) {\n var r = this.getRange();\n if (range) {\n range.start.column = r.start.column;\n range.start.row = r.start.row;\n range.end.column = r.end.column;\n range.end.row = r.end.row;\n }\n else {\n range = r;\n }\n range.cursor = this.isBackwards() ? range.start : range.end;\n range.desiredColumn = this.$desiredColumn;\n return range;\n };\n Selection.prototype.getRangeOfMovements = function (func) {\n var start = this.getCursor();\n try {\n func(this);\n var end = this.getCursor();\n return Range.fromPoints(start, end);\n }\n catch (e) {\n return Range.fromPoints(start, start);\n }\n finally {\n this.moveCursorToPosition(start);\n }\n };\n Selection.prototype.toJSON = function () {\n if (this.rangeCount) { var data = this.ranges.map(function (r) {\n var r1 = r.clone();\n r1.isBackwards = r.cursor == r.start;\n return r1;\n });\n }\n else { var data = this.getRange();\n data.isBackwards = this.isBackwards();\n }\n return data;\n };\n Selection.prototype.fromJSON = function (data) {\n if (data.start == undefined) {\n if (this.rangeList && data.length > 1) {\n this.toSingleRange(data[0]);\n for (var i = data.length; i--;) {\n var r = Range.fromPoints(data[i].start, data[i].end);\n if (data[i].isBackwards)\n r.cursor = r.start;\n this.addRange(r, true);\n }\n return;\n }\n else {\n data = data[0];\n }\n }\n if (this.rangeList)\n this.toSingleRange(data);\n this.setSelectionRange(data, data.isBackwards);\n };\n Selection.prototype.isEqual = function (data) {\n if ((data.length || this.rangeCount) && data.length != this.rangeCount)\n return false;\n if (!data.length || !this.ranges)\n return this.getRange().isEqual(data);\n for (var i = this.ranges.length; i--;) {\n if (!this.ranges[i].isEqual(data[i]))\n return false;\n }\n return true;\n };\n return Selection;\n}());\nSelection.prototype.setSelectionAnchor = Selection.prototype.setAnchor;\nSelection.prototype.getSelectionAnchor = Selection.prototype.getAnchor;\nSelection.prototype.setSelectionRange = Selection.prototype.setRange;\noop.implement(Selection.prototype, EventEmitter);\nexports.Selection = Selection;\n\n});\n\nace.define(\"ace/tokenizer\",[\"require\",\"exports\",\"module\",\"ace/lib/report_error\"], function(require, exports, module){\"use strict\";\nvar reportError = require(\"./lib/report_error\").reportError;\nvar MAX_TOKEN_COUNT = 2000;\nvar Tokenizer = /** @class */ (function () {\n function Tokenizer(rules) {\n this.splitRegex;\n this.states = rules;\n this.regExps = {};\n this.matchMappings = {};\n for (var key in this.states) {\n var state = this.states[key];\n var ruleRegExps = [];\n var matchTotal = 0;\n var mapping = this.matchMappings[key] = { defaultToken: \"text\" };\n var flag = \"g\";\n var splitterRurles = [];\n for (var i = 0; i < state.length; i++) {\n var rule = state[i];\n if (rule.defaultToken)\n mapping.defaultToken = rule.defaultToken;\n if (rule.caseInsensitive && flag.indexOf(\"i\") === -1)\n flag += \"i\";\n if (rule.unicode && flag.indexOf(\"u\") === -1)\n flag += \"u\";\n if (rule.regex == null)\n continue;\n if (rule.regex instanceof RegExp)\n rule.regex = rule.regex.toString().slice(1, -1);\n var adjustedregex = rule.regex;\n var matchcount = new RegExp(\"(?:(\" + adjustedregex + \")|(.))\").exec(\"a\").length - 2;\n if (Array.isArray(rule.token)) {\n if (rule.token.length == 1 || matchcount == 1) {\n rule.token = rule.token[0];\n }\n else if (matchcount - 1 != rule.token.length) {\n this.reportError(\"number of classes and regexp groups doesn't match\", {\n rule: rule,\n groupCount: matchcount - 1\n });\n rule.token = rule.token[0];\n }\n else {\n rule.tokenArray = rule.token;\n rule.token = null;\n rule.onMatch = this.$arrayTokens;\n }\n }\n else if (typeof rule.token == \"function\" && !rule.onMatch) {\n if (matchcount > 1)\n rule.onMatch = this.$applyToken;\n else\n rule.onMatch = rule.token;\n }\n if (matchcount > 1) {\n if (/\\\\\\d/.test(rule.regex)) {\n adjustedregex = rule.regex.replace(/\\\\([0-9]+)/g, function (match, digit) {\n return \"\\\\\" + (parseInt(digit, 10) + matchTotal + 1);\n });\n }\n else {\n matchcount = 1;\n adjustedregex = this.removeCapturingGroups(rule.regex);\n }\n if (!rule.splitRegex && typeof rule.token != \"string\")\n splitterRurles.push(rule); // flag will be known only at the very end\n }\n mapping[matchTotal] = i;\n matchTotal += matchcount;\n ruleRegExps.push(adjustedregex);\n if (!rule.onMatch)\n rule.onMatch = null;\n }\n if (!ruleRegExps.length) {\n mapping[0] = 0;\n ruleRegExps.push(\"$\");\n }\n splitterRurles.forEach(function (rule) {\n rule.splitRegex = this.createSplitterRegexp(rule.regex, flag);\n }, this);\n this.regExps[key] = new RegExp(\"(\" + ruleRegExps.join(\")|(\") + \")|($)\", flag);\n }\n }\n Tokenizer.prototype.$setMaxTokenCount = function (m) {\n MAX_TOKEN_COUNT = m | 0;\n };\n Tokenizer.prototype.$applyToken = function (str) {\n var values = this.splitRegex.exec(str).slice(1);\n var types = this.token.apply(this, values);\n if (typeof types === \"string\")\n return [{ type: types, value: str }];\n var tokens = [];\n for (var i = 0, l = types.length; i < l; i++) {\n if (values[i])\n tokens[tokens.length] = {\n type: types[i],\n value: values[i]\n };\n }\n return tokens;\n };\n Tokenizer.prototype.$arrayTokens = function (str) {\n if (!str)\n return [];\n var values = this.splitRegex.exec(str);\n if (!values)\n return \"text\";\n var tokens = [];\n var types = this.tokenArray;\n for (var i = 0, l = types.length; i < l; i++) {\n if (values[i + 1])\n tokens[tokens.length] = {\n type: types[i],\n value: values[i + 1]\n };\n }\n return tokens;\n };\n Tokenizer.prototype.removeCapturingGroups = function (src) {\n var r = src.replace(/\\\\.|\\[(?:\\\\.|[^\\\\\\]])*|\\(\\?[:=!<]|(\\()/g, function (x, y) { return y ? \"(?:\" : x; });\n return r;\n };\n Tokenizer.prototype.createSplitterRegexp = function (src, flag) {\n if (src.indexOf(\"(?=\") != -1) {\n var stack = 0;\n var inChClass = false;\n var lastCapture = {};\n src.replace(/(\\\\.)|(\\((?:\\?[=!])?)|(\\))|([\\[\\]])/g, function (m, esc, parenOpen, parenClose, square, index) {\n if (inChClass) {\n inChClass = square != \"]\";\n }\n else if (square) {\n inChClass = true;\n }\n else if (parenClose) {\n if (stack == lastCapture.stack) {\n lastCapture.end = index + 1;\n lastCapture.stack = -1;\n }\n stack--;\n }\n else if (parenOpen) {\n stack++;\n if (parenOpen.length != 1) {\n lastCapture.stack = stack;\n lastCapture.start = index;\n }\n }\n return m;\n });\n if (lastCapture.end != null && /^\\)*$/.test(src.substr(lastCapture.end)))\n src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end);\n }\n if (src.charAt(0) != \"^\")\n src = \"^\" + src;\n if (src.charAt(src.length - 1) != \"$\")\n src += \"$\";\n return new RegExp(src, (flag || \"\").replace(\"g\", \"\"));\n };\n Tokenizer.prototype.getLineTokens = function (line, startState) {\n if (startState && typeof startState != \"string\") {\n var stack = startState.slice(0);\n startState = stack[0];\n if (startState === \"#tmp\") {\n stack.shift();\n startState = stack.shift();\n }\n }\n else\n var stack = [];\n var currentState = /**@type{string}*/ (startState) || \"start\";\n var state = this.states[currentState];\n if (!state) {\n currentState = \"start\";\n state = this.states[currentState];\n }\n var mapping = this.matchMappings[currentState];\n var re = this.regExps[currentState];\n re.lastIndex = 0;\n var match, tokens = [];\n var lastIndex = 0;\n var matchAttempts = 0;\n var token = { type: null, value: \"\" };\n while (match = re.exec(line)) {\n var type = mapping.defaultToken;\n var rule = null;\n var value = match[0];\n var index = re.lastIndex;\n if (index - value.length > lastIndex) {\n var skipped = line.substring(lastIndex, index - value.length);\n if (token.type == type) {\n token.value += skipped;\n }\n else {\n if (token.type)\n tokens.push(token);\n token = { type: type, value: skipped };\n }\n }\n for (var i = 0; i < match.length - 2; i++) {\n if (match[i + 1] === undefined)\n continue;\n rule = state[mapping[i]];\n if (rule.onMatch)\n type = rule.onMatch(value, currentState, stack, line);\n else\n type = rule.token;\n if (rule.next) {\n if (typeof rule.next == \"string\") {\n currentState = rule.next;\n }\n else {\n currentState = rule.next(currentState, stack);\n }\n state = this.states[currentState];\n if (!state) {\n this.reportError(\"state doesn't exist\", currentState);\n currentState = \"start\";\n state = this.states[currentState];\n }\n mapping = this.matchMappings[currentState];\n lastIndex = index;\n re = this.regExps[currentState];\n re.lastIndex = index;\n }\n if (rule.consumeLineEnd)\n lastIndex = index;\n break;\n }\n if (value) {\n if (typeof type === \"string\") {\n if ((!rule || rule.merge !== false) && token.type === type) {\n token.value += value;\n }\n else {\n if (token.type)\n tokens.push(token);\n token = { type: type, value: value };\n }\n }\n else if (type) {\n if (token.type)\n tokens.push(token);\n token = { type: null, value: \"\" };\n for (var i = 0; i < type.length; i++)\n tokens.push(type[i]);\n }\n }\n if (lastIndex == line.length)\n break;\n lastIndex = index;\n if (matchAttempts++ > MAX_TOKEN_COUNT) {\n if (matchAttempts > 2 * line.length) {\n this.reportError(\"infinite loop with in ace tokenizer\", {\n startState: startState,\n line: line\n });\n }\n while (lastIndex < line.length) {\n if (token.type)\n tokens.push(token);\n token = {\n value: line.substring(lastIndex, lastIndex += 500),\n type: \"overflow\"\n };\n }\n currentState = \"start\";\n stack = [];\n break;\n }\n }\n if (token.type)\n tokens.push(token);\n if (stack.length > 1) {\n if (stack[0] !== currentState)\n stack.unshift(\"#tmp\", currentState);\n }\n return {\n tokens: tokens,\n state: stack.length ? stack : currentState\n };\n };\n return Tokenizer;\n}());\nTokenizer.prototype.reportError = reportError;\nexports.Tokenizer = Tokenizer;\n\n});\n\nace.define(\"ace/mode/text_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/deep_copy\"], function(require, exports, module){\"use strict\";\nvar deepCopy = require(\"../lib/deep_copy\").deepCopy;\nvar TextHighlightRules;\nTextHighlightRules = function () {\n this.$rules = {\n \"start\": [{\n token: \"empty_line\",\n regex: '^$'\n }, {\n defaultToken: \"text\"\n }]\n };\n};\n(function () {\n this.addRules = function (rules, prefix) {\n if (!prefix) {\n for (var key in rules)\n this.$rules[key] = rules[key];\n return;\n }\n for (var key in rules) {\n var state = rules[key];\n for (var i = 0; i < state.length; i++) {\n var rule = state[i];\n if (rule.next || rule.onMatch) {\n if (typeof rule.next == \"string\") {\n if (rule.next.indexOf(prefix) !== 0)\n rule.next = prefix + rule.next;\n }\n if (rule.nextState && rule.nextState.indexOf(prefix) !== 0)\n rule.nextState = prefix + rule.nextState;\n }\n }\n this.$rules[prefix + key] = state;\n }\n };\n this.getRules = function () {\n return this.$rules;\n };\n this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) {\n var embedRules = typeof HighlightRules == \"function\"\n ? new HighlightRules().getRules()\n : HighlightRules;\n if (states) {\n for (var i = 0; i < states.length; i++)\n states[i] = prefix + states[i];\n }\n else {\n states = [];\n for (var key in embedRules)\n states.push(prefix + key);\n }\n this.addRules(embedRules, prefix);\n if (escapeRules) {\n var addRules = Array.prototype[append ? \"push\" : \"unshift\"];\n for (var i = 0; i < states.length; i++)\n addRules.apply(this.$rules[states[i]], deepCopy(escapeRules));\n }\n if (!this.$embeds)\n this.$embeds = [];\n this.$embeds.push(prefix);\n };\n this.getEmbeds = function () {\n return this.$embeds;\n };\n var pushState = function (currentState, stack) {\n if (currentState != \"start\" || stack.length)\n stack.unshift(this.nextState, currentState);\n return this.nextState;\n };\n var popState = function (currentState, stack) {\n stack.shift();\n return stack.shift() || \"start\";\n };\n this.normalizeRules = function () {\n var id = 0;\n var rules = this.$rules;\n function processState(key) {\n var state = rules[key];\n state[\"processed\"] = true;\n for (var i = 0; i < state.length; i++) {\n var rule = state[i];\n var toInsert = null;\n if (Array.isArray(rule)) {\n toInsert = rule;\n rule = {};\n }\n if (!rule.regex && rule.start) {\n rule.regex = rule.start;\n if (!rule.next)\n rule.next = [];\n rule.next.push({\n defaultToken: rule.token\n }, {\n token: rule.token + \".end\",\n regex: rule.end || rule.start,\n next: \"pop\"\n });\n rule.token = rule.token + \".start\";\n rule.push = true;\n }\n var next = rule.next || rule.push;\n if (next && Array.isArray(next)) {\n var stateName = rule.stateName;\n if (!stateName) {\n stateName = rule.token;\n if (typeof stateName != \"string\")\n stateName = stateName[0] || \"\";\n if (rules[stateName])\n stateName += id++;\n }\n rules[stateName] = next;\n rule.next = stateName;\n processState(stateName);\n }\n else if (next == \"pop\") {\n rule.next = popState;\n }\n if (rule.push) {\n rule.nextState = rule.next || rule.push;\n rule.next = pushState;\n delete rule.push;\n }\n if (rule.rules) {\n for (var r in rule.rules) {\n if (rules[r]) {\n if (rules[r].push)\n rules[r].push.apply(rules[r], rule.rules[r]);\n }\n else {\n rules[r] = rule.rules[r];\n }\n }\n }\n var includeName = typeof rule == \"string\" ? rule : rule.include;\n if (includeName) {\n if (includeName === \"$self\")\n includeName = \"start\";\n if (Array.isArray(includeName))\n toInsert = includeName.map(function (x) { return rules[x]; });\n else\n toInsert = rules[includeName];\n }\n if (toInsert) {\n var args = [i, 1].concat(toInsert);\n if (rule.noEscape)\n args = args.filter(function (x) { return !x.next; });\n state.splice.apply(state, args);\n i--;\n }\n if (rule.keywordMap) {\n rule.token = this.createKeywordMapper(rule.keywordMap, rule.defaultToken || \"text\", rule.caseInsensitive);\n delete rule.defaultToken;\n }\n }\n }\n Object.keys(rules).forEach(processState, this);\n };\n this.createKeywordMapper = function (map, defaultToken, ignoreCase, splitChar) {\n var keywords = Object.create(null);\n this.$keywordList = [];\n Object.keys(map).forEach(function (className) {\n var a = map[className];\n var list = a.split(splitChar || \"|\");\n for (var i = list.length; i--;) {\n var word = list[i];\n this.$keywordList.push(word);\n if (ignoreCase)\n word = word.toLowerCase();\n keywords[word] = className;\n }\n }, this);\n map = null;\n return ignoreCase\n ? function (value) { return keywords[value.toLowerCase()] || defaultToken; }\n : function (value) { return keywords[value] || defaultToken; };\n };\n this.getKeywords = function () {\n return this.$keywords;\n };\n}).call(TextHighlightRules.prototype);\nexports.TextHighlightRules = TextHighlightRules;\n\n});\n\nace.define(\"ace/mode/behaviour\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar Behaviour;\nBehaviour = function () {\n this.$behaviours = {};\n};\n(function () {\n this.add = function (name, action, callback) {\n switch (undefined) {\n case this.$behaviours:\n this.$behaviours = {};\n case this.$behaviours[name]:\n this.$behaviours[name] = {};\n }\n this.$behaviours[name][action] = callback;\n };\n this.addBehaviours = function (behaviours) {\n for (var key in behaviours) {\n for (var action in behaviours[key]) {\n this.add(key, action, behaviours[key][action]);\n }\n }\n };\n this.remove = function (name) {\n if (this.$behaviours && this.$behaviours[name]) {\n delete this.$behaviours[name];\n }\n };\n this.inherit = function (mode, filter) {\n if (typeof mode === \"function\") {\n var behaviours = new mode().getBehaviours(filter);\n }\n else {\n var behaviours = mode.getBehaviours(filter);\n }\n this.addBehaviours(behaviours);\n };\n this.getBehaviours = function (filter) {\n if (!filter) {\n return this.$behaviours;\n }\n else {\n var ret = {};\n for (var i = 0; i < filter.length; i++) {\n if (this.$behaviours[filter[i]]) {\n ret[filter[i]] = this.$behaviours[filter[i]];\n }\n }\n return ret;\n }\n };\n}).call(Behaviour.prototype);\nexports.Behaviour = Behaviour;\n\n});\n\nace.define(\"ace/token_iterator\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"./range\").Range;\nvar TokenIterator = /** @class */ (function () {\n function TokenIterator(session, initialRow, initialColumn) {\n this.$session = session;\n this.$row = initialRow;\n this.$rowTokens = session.getTokens(initialRow);\n var token = session.getTokenAt(initialRow, initialColumn);\n this.$tokenIndex = token ? token.index : -1;\n }\n TokenIterator.prototype.stepBackward = function () {\n this.$tokenIndex -= 1;\n while (this.$tokenIndex < 0) {\n this.$row -= 1;\n if (this.$row < 0) {\n this.$row = 0;\n return null;\n }\n this.$rowTokens = this.$session.getTokens(this.$row);\n this.$tokenIndex = this.$rowTokens.length - 1;\n }\n return this.$rowTokens[this.$tokenIndex];\n };\n TokenIterator.prototype.stepForward = function () {\n this.$tokenIndex += 1;\n var rowCount;\n while (this.$tokenIndex >= this.$rowTokens.length) {\n this.$row += 1;\n if (!rowCount)\n rowCount = this.$session.getLength();\n if (this.$row >= rowCount) {\n this.$row = rowCount - 1;\n return null;\n }\n this.$rowTokens = this.$session.getTokens(this.$row);\n this.$tokenIndex = 0;\n }\n return this.$rowTokens[this.$tokenIndex];\n };\n TokenIterator.prototype.getCurrentToken = function () {\n return this.$rowTokens[this.$tokenIndex];\n };\n TokenIterator.prototype.getCurrentTokenRow = function () {\n return this.$row;\n };\n TokenIterator.prototype.getCurrentTokenColumn = function () {\n var rowTokens = this.$rowTokens;\n var tokenIndex = this.$tokenIndex;\n var column = rowTokens[tokenIndex].start;\n if (column !== undefined)\n return column;\n column = 0;\n while (tokenIndex > 0) {\n tokenIndex -= 1;\n column += rowTokens[tokenIndex].value.length;\n }\n return column;\n };\n TokenIterator.prototype.getCurrentTokenPosition = function () {\n return { row: this.$row, column: this.getCurrentTokenColumn() };\n };\n TokenIterator.prototype.getCurrentTokenRange = function () {\n var token = this.$rowTokens[this.$tokenIndex];\n var column = this.getCurrentTokenColumn();\n return new Range(this.$row, column, this.$row, column + token.value.length);\n };\n return TokenIterator;\n}());\nexports.TokenIterator = TokenIterator;\n\n});\n\nace.define(\"ace/mode/behaviour/cstyle\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/behaviour\",\"ace/token_iterator\",\"ace/lib/lang\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../../lib/oop\");\nvar Behaviour = require(\"../behaviour\").Behaviour;\nvar TokenIterator = require(\"../../token_iterator\").TokenIterator;\nvar lang = require(\"../../lib/lang\");\nvar SAFE_INSERT_IN_TOKENS = [\"text\", \"paren.rparen\", \"rparen\", \"paren\", \"punctuation.operator\"];\nvar SAFE_INSERT_BEFORE_TOKENS = [\"text\", \"paren.rparen\", \"rparen\", \"paren\", \"punctuation.operator\", \"comment\"];\nvar context;\nvar contextCache = {};\nvar defaultQuotes = { '\"': '\"', \"'\": \"'\" };\nvar initContext = function (editor) {\n var id = -1;\n if (editor.multiSelect) {\n id = editor.selection.index;\n if (contextCache.rangeCount != editor.multiSelect.rangeCount)\n contextCache = { rangeCount: editor.multiSelect.rangeCount };\n }\n if (contextCache[id])\n return context = contextCache[id];\n context = contextCache[id] = {\n autoInsertedBrackets: 0,\n autoInsertedRow: -1,\n autoInsertedLineEnd: \"\",\n maybeInsertedBrackets: 0,\n maybeInsertedRow: -1,\n maybeInsertedLineStart: \"\",\n maybeInsertedLineEnd: \"\"\n };\n};\nvar getWrapped = function (selection, selected, opening, closing) {\n var rowDiff = selection.end.row - selection.start.row;\n return {\n text: opening + selected + closing,\n selection: [\n 0,\n selection.start.column + 1,\n rowDiff,\n selection.end.column + (rowDiff ? 0 : 1)\n ]\n };\n};\nvar CstyleBehaviour;\nCstyleBehaviour = function (options) {\n options = options || {};\n this.add(\"braces\", \"insertion\", function (state, action, editor, session, text) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n if (text == '{') {\n initContext(editor);\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n var token = session.getTokenAt(cursor.row, cursor.column);\n if (selected !== \"\" && selected !== \"{\" && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, '{', '}');\n }\n else if (token && /(?:string)\\.quasi|\\.xml/.test(token.type)) {\n var excludeTokens = [\n /tag\\-(?:open|name)/, /attribute\\-name/\n ];\n if (excludeTokens.some(function (el) { return el.test(token.type); }) || /(string)\\.quasi/.test(token.type)\n && token.value[cursor.column - token.start - 1] !== '$')\n return;\n CstyleBehaviour.recordAutoInsert(editor, session, \"}\");\n return {\n text: '{}',\n selection: [1, 1]\n };\n }\n else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n if (/[\\]\\}\\)]/.test(line[cursor.column]) || editor.inMultiSelectMode || options.braces) {\n CstyleBehaviour.recordAutoInsert(editor, session, \"}\");\n return {\n text: '{}',\n selection: [1, 1]\n };\n }\n else {\n CstyleBehaviour.recordMaybeInsert(editor, session, \"{\");\n return {\n text: '{',\n selection: [1, 1]\n };\n }\n }\n }\n else if (text == '}') {\n initContext(editor);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == '}') {\n var matching = session.$findOpeningBracket('}', { column: cursor.column + 1, row: cursor.row });\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n CstyleBehaviour.popAutoInsertedClosing();\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n else if (text == \"\\n\" || text == \"\\r\\n\") {\n initContext(editor);\n var closing = \"\";\n if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {\n closing = lang.stringRepeat(\"}\", context.maybeInsertedBrackets);\n CstyleBehaviour.clearMaybeInsertedClosing();\n }\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar === '}') {\n var openBracePos = session.findMatchingBracket({ row: cursor.row, column: cursor.column + 1 }, '}');\n if (!openBracePos)\n return null;\n var next_indent = this.$getIndent(session.getLine(openBracePos.row));\n }\n else if (closing) {\n var next_indent = this.$getIndent(line);\n }\n else {\n CstyleBehaviour.clearMaybeInsertedClosing();\n return;\n }\n var indent = next_indent + session.getTabString();\n return {\n text: '\\n' + indent + '\\n' + next_indent + closing,\n selection: [1, indent.length, 1, indent.length]\n };\n }\n else {\n CstyleBehaviour.clearMaybeInsertedClosing();\n }\n });\n this.add(\"braces\", \"deletion\", function (state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '{') {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.end.column, range.end.column + 1);\n if (rightChar == '}') {\n range.end.column++;\n return range;\n }\n else {\n context.maybeInsertedBrackets--;\n }\n }\n });\n this.add(\"parens\", \"insertion\", function (state, action, editor, session, text) {\n if (text == '(') {\n initContext(editor);\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, '(', ')');\n }\n else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n CstyleBehaviour.recordAutoInsert(editor, session, \")\");\n return {\n text: '()',\n selection: [1, 1]\n };\n }\n }\n else if (text == ')') {\n initContext(editor);\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == ')') {\n var matching = session.$findOpeningBracket(')', { column: cursor.column + 1, row: cursor.row });\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n CstyleBehaviour.popAutoInsertedClosing();\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n });\n this.add(\"parens\", \"deletion\", function (state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '(') {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == ')') {\n range.end.column++;\n return range;\n }\n }\n });\n this.add(\"brackets\", \"insertion\", function (state, action, editor, session, text) {\n if (text == '[') {\n initContext(editor);\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, '[', ']');\n }\n else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n CstyleBehaviour.recordAutoInsert(editor, session, \"]\");\n return {\n text: '[]',\n selection: [1, 1]\n };\n }\n }\n else if (text == ']') {\n initContext(editor);\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == ']') {\n var matching = session.$findOpeningBracket(']', { column: cursor.column + 1, row: cursor.row });\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n CstyleBehaviour.popAutoInsertedClosing();\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n });\n this.add(\"brackets\", \"deletion\", function (state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '[') {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == ']') {\n range.end.column++;\n return range;\n }\n }\n });\n this.add(\"string_dquotes\", \"insertion\", function (state, action, editor, session, text) {\n var quotes = session.$mode.$quotes || defaultQuotes;\n if (text.length == 1 && quotes[text]) {\n if (this.lineCommentStart && this.lineCommentStart.indexOf(text) != -1)\n return;\n initContext(editor);\n var quote = text;\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && (selected.length != 1 || !quotes[selected]) && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, quote, quote);\n }\n else if (!selected) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var leftChar = line.substring(cursor.column - 1, cursor.column);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n var token = session.getTokenAt(cursor.row, cursor.column);\n var rightToken = session.getTokenAt(cursor.row, cursor.column + 1);\n if (leftChar == \"\\\\\" && token && /escape/.test(token.type))\n return null;\n var stringBefore = token && /string|escape/.test(token.type);\n var stringAfter = !rightToken || /string|escape/.test(rightToken.type);\n var pair;\n if (rightChar == quote) {\n pair = stringBefore !== stringAfter;\n if (pair && /string\\.end/.test(rightToken.type))\n pair = false;\n }\n else {\n if (stringBefore && !stringAfter)\n return null; // wrap string with different quote\n if (stringBefore && stringAfter)\n return null; // do not pair quotes inside strings\n var wordRe = session.$mode.tokenRe;\n wordRe.lastIndex = 0;\n var isWordBefore = wordRe.test(leftChar);\n wordRe.lastIndex = 0;\n var isWordAfter = wordRe.test(rightChar);\n var pairQuotesAfter = session.$mode.$pairQuotesAfter;\n var shouldPairQuotes = pairQuotesAfter && pairQuotesAfter[quote] && pairQuotesAfter[quote].test(leftChar);\n if ((!shouldPairQuotes && isWordBefore) || isWordAfter)\n return null; // before or after alphanumeric\n if (rightChar && !/[\\s;,.})\\]\\\\]/.test(rightChar))\n return null; // there is rightChar and it isn't closing\n var charBefore = line[cursor.column - 2];\n if (leftChar == quote && (charBefore == quote || wordRe.test(charBefore)))\n return null;\n pair = true;\n }\n return {\n text: pair ? quote + quote : \"\",\n selection: [1, 1]\n };\n }\n }\n });\n this.add(\"string_dquotes\", \"deletion\", function (state, action, editor, session, range) {\n var quotes = session.$mode.$quotes || defaultQuotes;\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && quotes.hasOwnProperty(selected)) {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == selected) {\n range.end.column++;\n return range;\n }\n }\n });\n if (options.closeDocComment !== false) {\n this.add(\"doc comment end\", \"insertion\", function (state, action, editor, session, text) {\n if (state === \"doc-start\" && (text === \"\\n\" || text === \"\\r\\n\") && editor.selection.isEmpty()) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var nextLine = session.doc.getLine(cursor.row + 1);\n var indent = this.$getIndent(line);\n if (/\\s*\\*/.test(nextLine)) {\n if (/^\\s*\\*/.test(line)) {\n return {\n text: text + indent + \"* \",\n selection: [1, 3 + indent.length, 1, 3 + indent.length]\n };\n }\n else {\n return {\n text: text + indent + \" * \",\n selection: [1, 3 + indent.length, 1, 3 + indent.length]\n };\n }\n }\n if (/\\/\\*\\*/.test(line.substring(0, cursor.column))) {\n return {\n text: text + indent + \" * \" + text + \" \" + indent + \"*/\",\n selection: [1, 4 + indent.length, 1, 4 + indent.length]\n };\n }\n }\n });\n }\n};\nCstyleBehaviour.isSaneInsertion = function (editor, session) {\n var cursor = editor.getCursorPosition();\n var iterator = new TokenIterator(session, cursor.row, cursor.column);\n if (!this.$matchTokenType(iterator.getCurrentToken() || \"text\", SAFE_INSERT_IN_TOKENS)) {\n if (/[)}\\]]/.test(editor.session.getLine(cursor.row)[cursor.column]))\n return true;\n var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);\n if (!this.$matchTokenType(iterator2.getCurrentToken() || \"text\", SAFE_INSERT_IN_TOKENS))\n return false;\n }\n iterator.stepForward();\n return iterator.getCurrentTokenRow() !== cursor.row ||\n this.$matchTokenType(iterator.getCurrentToken() || \"text\", SAFE_INSERT_BEFORE_TOKENS);\n};\nCstyleBehaviour[\"$matchTokenType\"] = function (token, types) {\n return types.indexOf(token.type || token) > -1;\n};\nCstyleBehaviour[\"recordAutoInsert\"] = function (editor, session, bracket) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n if (!this[\"isAutoInsertedClosing\"](cursor, line, context.autoInsertedLineEnd[0]))\n context.autoInsertedBrackets = 0;\n context.autoInsertedRow = cursor.row;\n context.autoInsertedLineEnd = bracket + line.substr(cursor.column);\n context.autoInsertedBrackets++;\n};\nCstyleBehaviour[\"recordMaybeInsert\"] = function (editor, session, bracket) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n if (!this[\"isMaybeInsertedClosing\"](cursor, line))\n context.maybeInsertedBrackets = 0;\n context.maybeInsertedRow = cursor.row;\n context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;\n context.maybeInsertedLineEnd = line.substr(cursor.column);\n context.maybeInsertedBrackets++;\n};\nCstyleBehaviour[\"isAutoInsertedClosing\"] = function (cursor, line, bracket) {\n return context.autoInsertedBrackets > 0 &&\n cursor.row === context.autoInsertedRow &&\n bracket === context.autoInsertedLineEnd[0] &&\n line.substr(cursor.column) === context.autoInsertedLineEnd;\n};\nCstyleBehaviour[\"isMaybeInsertedClosing\"] = function (cursor, line) {\n return context.maybeInsertedBrackets > 0 &&\n cursor.row === context.maybeInsertedRow &&\n line.substr(cursor.column) === context.maybeInsertedLineEnd &&\n line.substr(0, cursor.column) == context.maybeInsertedLineStart;\n};\nCstyleBehaviour[\"popAutoInsertedClosing\"] = function () {\n context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);\n context.autoInsertedBrackets--;\n};\nCstyleBehaviour[\"clearMaybeInsertedClosing\"] = function () {\n if (context) {\n context.maybeInsertedBrackets = 0;\n context.maybeInsertedRow = -1;\n }\n};\noop.inherits(CstyleBehaviour, Behaviour);\nexports.CstyleBehaviour = CstyleBehaviour;\n\n});\n\nace.define(\"ace/unicode\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nvar wordChars = [48, 9, 8, 25, 5, 0, 2, 25, 48, 0, 11, 0, 5, 0, 6, 22, 2, 30, 2, 457, 5, 11, 15, 4, 8, 0, 2, 0, 18, 116, 2, 1, 3, 3, 9, 0, 2, 2, 2, 0, 2, 19, 2, 82, 2, 138, 2, 4, 3, 155, 12, 37, 3, 0, 8, 38, 10, 44, 2, 0, 2, 1, 2, 1, 2, 0, 9, 26, 6, 2, 30, 10, 7, 61, 2, 9, 5, 101, 2, 7, 3, 9, 2, 18, 3, 0, 17, 58, 3, 100, 15, 53, 5, 0, 6, 45, 211, 57, 3, 18, 2, 5, 3, 11, 3, 9, 2, 1, 7, 6, 2, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 0, 4, 3, 3, 8, 3, 1, 3, 3, 9, 0, 5, 1, 2, 4, 3, 11, 16, 2, 2, 5, 5, 1, 3, 21, 2, 6, 2, 1, 2, 1, 2, 1, 3, 0, 2, 4, 5, 1, 3, 2, 4, 0, 8, 3, 2, 0, 8, 15, 12, 2, 2, 8, 2, 2, 2, 21, 2, 6, 2, 1, 2, 4, 3, 9, 2, 2, 2, 2, 3, 0, 16, 3, 3, 9, 18, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 3, 8, 3, 1, 3, 2, 9, 1, 5, 1, 2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 14, 230, 23, 280, 3, 5, 3, 37, 3, 5, 3, 7, 2, 0, 2, 0, 2, 0, 2, 30, 3, 52, 2, 6, 2, 0, 4, 2, 2, 6, 4, 3, 3, 5, 5, 12, 6, 2, 2, 6, 67, 1, 20, 0, 29, 0, 14, 0, 17, 4, 60, 12, 5, 0, 4, 11, 18, 0, 5, 0, 3, 9, 2, 0, 4, 4, 7, 0, 2, 0, 2, 0, 2, 3, 2, 10, 3, 3, 6, 4, 5, 0, 53, 1, 2684, 46, 2, 46, 2, 132, 7, 6, 15, 37, 11, 53, 10, 0, 17, 22, 10, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 31, 48, 0, 470, 1, 36, 5, 2, 4, 6, 1, 5, 85, 3, 1, 3, 2, 2, 89, 2, 3, 6, 40, 4, 93, 18, 23, 57, 15, 513, 6581, 75, 20939, 53, 1164, 68, 45, 3, 268, 4, 27, 21, 31, 3, 13, 13, 1, 2, 24, 9, 69, 11, 1, 38, 8, 3, 102, 3, 1, 111, 44, 25, 51, 13, 68, 12, 9, 7, 23, 4, 0, 5, 45, 3, 35, 13, 28, 4, 64, 15, 10, 39, 54, 10, 13, 3, 9, 7, 22, 4, 1, 5, 66, 25, 2, 227, 42, 2, 1, 3, 9, 7, 11171, 13, 22, 5, 48, 8453, 301, 3, 61, 3, 105, 39, 6, 13, 4, 6, 11, 2, 12, 2, 4, 2, 0, 2, 1, 2, 1, 2, 107, 34, 362, 19, 63, 3, 53, 41, 11, 5, 15, 17, 6, 13, 1, 25, 2, 33, 4, 2, 134, 20, 9, 8, 25, 5, 0, 2, 25, 12, 88, 4, 5, 3, 5, 3, 5, 3, 2];\nvar code = 0;\nvar str = [];\nfor (var i = 0; i < wordChars.length; i += 2) {\n str.push(code += wordChars[i]);\n if (wordChars[i + 1])\n str.push(45, code += wordChars[i + 1]);\n}\nexports.wordChars = String.fromCharCode.apply(null, str);\n\n});\n\nace.define(\"ace/mode/text\",[\"require\",\"exports\",\"module\",\"ace/config\",\"ace/tokenizer\",\"ace/mode/text_highlight_rules\",\"ace/mode/behaviour/cstyle\",\"ace/unicode\",\"ace/lib/lang\",\"ace/token_iterator\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar config = require(\"../config\");\nvar Tokenizer = require(\"../tokenizer\").Tokenizer;\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\nvar CstyleBehaviour = require(\"./behaviour/cstyle\").CstyleBehaviour;\nvar unicode = require(\"../unicode\");\nvar lang = require(\"../lib/lang\");\nvar TokenIterator = require(\"../token_iterator\").TokenIterator;\nvar Range = require(\"../range\").Range;\nvar Mode;\nMode = function () {\n this.HighlightRules = TextHighlightRules;\n};\n(function () {\n this.$defaultBehaviour = new CstyleBehaviour();\n this.tokenRe = new RegExp(\"^[\" + unicode.wordChars + \"\\\\$_]+\", \"g\");\n this.nonTokenRe = new RegExp(\"^(?:[^\" + unicode.wordChars + \"\\\\$_]|\\\\s])+\", \"g\");\n this.getTokenizer = function () {\n if (!this.$tokenizer) {\n this.$highlightRules = this.$highlightRules || new this.HighlightRules(this.$highlightRuleConfig);\n this.$tokenizer = new Tokenizer(this.$highlightRules.getRules());\n }\n return this.$tokenizer;\n };\n this.lineCommentStart = \"\";\n this.blockComment = \"\";\n this.toggleCommentLines = function (state, session, startRow, endRow) {\n var doc = session.doc;\n var ignoreBlankLines = true;\n var shouldRemove = true;\n var minIndent = Infinity;\n var tabSize = session.getTabSize();\n var insertAtTabStop = false;\n if (!this.lineCommentStart) {\n if (!this.blockComment)\n return false;\n var lineCommentStart = this.blockComment.start;\n var lineCommentEnd = this.blockComment.end;\n var regexpStart = new RegExp(\"^(\\\\s*)(?:\" + lang.escapeRegExp(lineCommentStart) + \")\");\n var regexpEnd = new RegExp(\"(?:\" + lang.escapeRegExp(lineCommentEnd) + \")\\\\s*$\");\n var comment = function (line, i) {\n if (testRemove(line, i))\n return;\n if (!ignoreBlankLines || /\\S/.test(line)) {\n doc.insertInLine({ row: i, column: line.length }, lineCommentEnd);\n doc.insertInLine({ row: i, column: minIndent }, lineCommentStart);\n }\n };\n var uncomment = function (line, i) {\n var m;\n if (m = line.match(regexpEnd))\n doc.removeInLine(i, line.length - m[0].length, line.length);\n if (m = line.match(regexpStart))\n doc.removeInLine(i, m[1].length, m[0].length);\n };\n var testRemove = function (line, row) {\n if (regexpStart.test(line))\n return true;\n var tokens = session.getTokens(row);\n for (var i = 0; i < tokens.length; i++) {\n if (tokens[i].type === \"comment\")\n return true;\n }\n };\n }\n else {\n if (Array.isArray(this.lineCommentStart)) {\n var regexpStart = this.lineCommentStart.map(lang.escapeRegExp).join(\"|\");\n var lineCommentStart = this.lineCommentStart[0];\n }\n else {\n var regexpStart = lang.escapeRegExp(this.lineCommentStart);\n var lineCommentStart = this.lineCommentStart;\n }\n regexpStart = new RegExp(\"^(\\\\s*)(?:\" + regexpStart + \") ?\");\n insertAtTabStop = session.getUseSoftTabs();\n var uncomment = function (line, i) {\n var m = line.match(regexpStart);\n if (!m)\n return;\n var start = m[1].length, end = m[0].length;\n if (!shouldInsertSpace(line, start, end) && m[0][end - 1] == \" \")\n end--;\n doc.removeInLine(i, start, end);\n };\n var commentWithSpace = lineCommentStart + \" \";\n var comment = function (line, i) {\n if (!ignoreBlankLines || /\\S/.test(line)) {\n if (shouldInsertSpace(line, minIndent, minIndent))\n doc.insertInLine({ row: i, column: minIndent }, commentWithSpace);\n else\n doc.insertInLine({ row: i, column: minIndent }, lineCommentStart);\n }\n };\n var testRemove = function (line, i) {\n return regexpStart.test(line);\n };\n var shouldInsertSpace = function (line, before, after) {\n var spaces = 0;\n while (before-- && line.charAt(before) == \" \")\n spaces++;\n if (spaces % tabSize != 0)\n return false;\n var spaces = 0;\n while (line.charAt(after++) == \" \")\n spaces++;\n if (tabSize > 2)\n return spaces % tabSize != tabSize - 1;\n else\n return spaces % tabSize == 0;\n };\n }\n function iter(fun) {\n for (var i = startRow; i <= endRow; i++)\n fun(doc.getLine(i), i);\n }\n var minEmptyLength = Infinity;\n iter(function (line, i) {\n var indent = line.search(/\\S/);\n if (indent !== -1) {\n if (indent < minIndent)\n minIndent = indent;\n if (shouldRemove && !testRemove(line, i))\n shouldRemove = false;\n }\n else if (minEmptyLength > line.length) {\n minEmptyLength = line.length;\n }\n });\n if (minIndent == Infinity) {\n minIndent = minEmptyLength;\n ignoreBlankLines = false;\n shouldRemove = false;\n }\n if (insertAtTabStop && minIndent % tabSize != 0)\n minIndent = Math.floor(minIndent / tabSize) * tabSize;\n iter(shouldRemove ? uncomment : comment);\n };\n this.toggleBlockComment = function (state, session, range, cursor) {\n var comment = this.blockComment;\n if (!comment)\n return;\n if (!comment.start && comment[0])\n comment = comment[0];\n var iterator = new TokenIterator(session, cursor.row, cursor.column);\n var token = iterator.getCurrentToken();\n var sel = session.selection;\n var initialRange = session.selection.toOrientedRange();\n var startRow, colDiff;\n if (token && /comment/.test(token.type)) {\n var startRange, endRange;\n while (token && /comment/.test(token.type)) {\n var i = token.value.indexOf(comment.start);\n if (i != -1) {\n var row = iterator.getCurrentTokenRow();\n var column = iterator.getCurrentTokenColumn() + i;\n startRange = new Range(row, column, row, column + comment.start.length);\n break;\n }\n token = iterator.stepBackward();\n }\n var iterator = new TokenIterator(session, cursor.row, cursor.column);\n var token = iterator.getCurrentToken();\n while (token && /comment/.test(token.type)) {\n var i = token.value.indexOf(comment.end);\n if (i != -1) {\n var row = iterator.getCurrentTokenRow();\n var column = iterator.getCurrentTokenColumn() + i;\n endRange = new Range(row, column, row, column + comment.end.length);\n break;\n }\n token = iterator.stepForward();\n }\n if (endRange)\n session.remove(endRange);\n if (startRange) {\n session.remove(startRange);\n startRow = startRange.start.row;\n colDiff = -comment.start.length;\n }\n }\n else {\n colDiff = comment.start.length;\n startRow = range.start.row;\n session.insert(range.end, comment.end);\n session.insert(range.start, comment.start);\n }\n if (initialRange.start.row == startRow)\n initialRange.start.column += colDiff;\n if (initialRange.end.row == startRow)\n initialRange.end.column += colDiff;\n session.selection.fromOrientedRange(initialRange);\n };\n this.getNextLineIndent = function (state, line, tab) {\n return this.$getIndent(line);\n };\n this.checkOutdent = function (state, line, input) {\n return false;\n };\n this.autoOutdent = function (state, doc, row) {\n };\n this.$getIndent = function (line) {\n return line.match(/^\\s*/)[0];\n };\n this.createWorker = function (session) {\n return null;\n };\n this.createModeDelegates = function (mapping) {\n this.$embeds = [];\n this.$modes = {};\n for (var i in mapping) {\n if (mapping[i]) {\n var Mode = mapping[i];\n var id = Mode.prototype.$id;\n var mode = config.$modes[id];\n if (!mode)\n config.$modes[id] = mode = new Mode();\n if (!config.$modes[i])\n config.$modes[i] = mode;\n this.$embeds.push(i);\n this.$modes[i] = mode;\n }\n }\n var delegations = [\"toggleBlockComment\", \"toggleCommentLines\", \"getNextLineIndent\",\n \"checkOutdent\", \"autoOutdent\", \"transformAction\", \"getCompletions\"];\n var _loop_1 = function (i) {\n (function (scope) {\n var functionName = delegations[i];\n var defaultHandler = scope[functionName];\n scope[delegations[i]] =\n function () {\n return this.$delegator(functionName, arguments, defaultHandler);\n };\n }(this_1));\n };\n var this_1 = this;\n for (var i = 0; i < delegations.length; i++) {\n _loop_1(i);\n }\n };\n this.$delegator = function (method, args, defaultHandler) {\n var state = args[0] || \"start\";\n if (typeof state != \"string\") {\n if (Array.isArray(state[2])) {\n var language = state[2][state[2].length - 1];\n var mode = this.$modes[language];\n if (mode)\n return mode[method].apply(mode, [state[1]].concat([].slice.call(args, 1)));\n }\n state = state[0] || \"start\";\n }\n for (var i = 0; i < this.$embeds.length; i++) {\n if (!this.$modes[this.$embeds[i]])\n continue;\n var split = state.split(this.$embeds[i]);\n if (!split[0] && split[1]) {\n args[0] = split[1];\n var mode = this.$modes[this.$embeds[i]];\n return mode[method].apply(mode, args);\n }\n }\n var ret = defaultHandler.apply(this, args);\n return defaultHandler ? ret : undefined;\n };\n this.transformAction = function (state, action, editor, session, param) {\n if (this.$behaviour) {\n var behaviours = this.$behaviour.getBehaviours();\n for (var key in behaviours) {\n if (behaviours[key][action]) {\n var ret = behaviours[key][action].apply(this, arguments);\n if (ret) {\n return ret;\n }\n }\n }\n }\n };\n this.getKeywords = function (append) {\n if (!this.completionKeywords) {\n var rules = this.$tokenizer[\"rules\"];\n var completionKeywords = [];\n for (var rule in rules) {\n var ruleItr = rules[rule];\n for (var r = 0, l = ruleItr.length; r < l; r++) {\n if (typeof ruleItr[r].token === \"string\") {\n if (/keyword|support|storage/.test(ruleItr[r].token))\n completionKeywords.push(ruleItr[r].regex);\n }\n else if (typeof ruleItr[r].token === \"object\") {\n for (var a = 0, aLength = ruleItr[r].token.length; a < aLength; a++) {\n if (/keyword|support|storage/.test(ruleItr[r].token[a])) {\n var rule = ruleItr[r].regex.match(/\\(.+?\\)/g)[a];\n completionKeywords.push(rule.substr(1, rule.length - 2));\n }\n }\n }\n }\n }\n this.completionKeywords = completionKeywords;\n }\n if (!append)\n return this.$keywordList;\n return completionKeywords.concat(this.$keywordList || []);\n };\n this.$createKeywordList = function () {\n if (!this.$highlightRules)\n this.getTokenizer();\n return this.$keywordList = this.$highlightRules.$keywordList || [];\n };\n this.getCompletions = function (state, session, pos, prefix) {\n var keywords = this.$keywordList || this.$createKeywordList();\n return keywords.map(function (word) {\n return {\n name: word,\n value: word,\n score: 0,\n meta: \"keyword\"\n };\n });\n };\n this.$id = \"ace/mode/text\";\n}).call(Mode.prototype);\nexports.Mode = Mode;\n\n});\n\nace.define(\"ace/apply_delta\",[\"require\",\"exports\",\"module\"], function(require, exports, module){\"use strict\";\nfunction throwDeltaError(delta, errorText) {\n console.log(\"Invalid Delta:\", delta);\n throw \"Invalid Delta: \" + errorText;\n}\nfunction positionInDocument(docLines, position) {\n return position.row >= 0 && position.row < docLines.length &&\n position.column >= 0 && position.column <= docLines[position.row].length;\n}\nfunction validateDelta(docLines, delta) {\n if (delta.action != \"insert\" && delta.action != \"remove\")\n throwDeltaError(delta, \"delta.action must be 'insert' or 'remove'\");\n if (!(delta.lines instanceof Array))\n throwDeltaError(delta, \"delta.lines must be an Array\");\n if (!delta.start || !delta.end)\n throwDeltaError(delta, \"delta.start/end must be an present\");\n var start = delta.start;\n if (!positionInDocument(docLines, delta.start))\n throwDeltaError(delta, \"delta.start must be contained in document\");\n var end = delta.end;\n if (delta.action == \"remove\" && !positionInDocument(docLines, end))\n throwDeltaError(delta, \"delta.end must contained in document for 'remove' actions\");\n var numRangeRows = end.row - start.row;\n var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0));\n if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars)\n throwDeltaError(delta, \"delta.range must match delta lines\");\n}\nexports.applyDelta = function (docLines, delta, doNotValidate) {\n var row = delta.start.row;\n var startColumn = delta.start.column;\n var line = docLines[row] || \"\";\n switch (delta.action) {\n case \"insert\":\n var lines = delta.lines;\n if (lines.length === 1) {\n docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);\n }\n else {\n var args = [row, 1].concat(delta.lines);\n docLines.splice.apply(docLines, args);\n docLines[row] = line.substring(0, startColumn) + docLines[row];\n docLines[row + delta.lines.length - 1] += line.substring(startColumn);\n }\n break;\n case \"remove\":\n var endColumn = delta.end.column;\n var endRow = delta.end.row;\n if (row === endRow) {\n docLines[row] = line.substring(0, startColumn) + line.substring(endColumn);\n }\n else {\n docLines.splice(row, endRow - row + 1, line.substring(0, startColumn) + docLines[endRow].substring(endColumn));\n }\n break;\n }\n};\n\n});\n\nace.define(\"ace/anchor\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Anchor = /** @class */ (function () {\n function Anchor(doc, row, column) {\n this.$onChange = this.onChange.bind(this);\n this.attach(doc);\n if (typeof row != \"number\")\n this.setPosition(row.row, row.column);\n else\n this.setPosition(row, column);\n }\n Anchor.prototype.getPosition = function () {\n return this.$clipPositionToDocument(this.row, this.column);\n };\n Anchor.prototype.getDocument = function () {\n return this.document;\n };\n Anchor.prototype.onChange = function (delta) {\n if (delta.start.row == delta.end.row && delta.start.row != this.row)\n return;\n if (delta.start.row > this.row)\n return;\n var point = $getTransformedPoint(delta, { row: this.row, column: this.column }, this.$insertRight);\n this.setPosition(point.row, point.column, true);\n };\n Anchor.prototype.setPosition = function (row, column, noClip) {\n var pos;\n if (noClip) {\n pos = {\n row: row,\n column: column\n };\n }\n else {\n pos = this.$clipPositionToDocument(row, column);\n }\n if (this.row == pos.row && this.column == pos.column)\n return;\n var old = {\n row: this.row,\n column: this.column\n };\n this.row = pos.row;\n this.column = pos.column;\n this._signal(\"change\", {\n old: old,\n value: pos\n });\n };\n Anchor.prototype.detach = function () {\n this.document.off(\"change\", this.$onChange);\n };\n Anchor.prototype.attach = function (doc) {\n this.document = doc || this.document;\n this.document.on(\"change\", this.$onChange);\n };\n Anchor.prototype.$clipPositionToDocument = function (row, column) {\n var pos = {};\n if (row >= this.document.getLength()) {\n pos.row = Math.max(0, this.document.getLength() - 1);\n pos.column = this.document.getLine(pos.row).length;\n }\n else if (row < 0) {\n pos.row = 0;\n pos.column = 0;\n }\n else {\n pos.row = row;\n pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));\n }\n if (column < 0)\n pos.column = 0;\n return pos;\n };\n return Anchor;\n}());\nAnchor.prototype.$insertRight = false;\noop.implement(Anchor.prototype, EventEmitter);\nfunction $pointsInOrder(point1, point2, equalPointsInOrder) {\n var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;\n return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter);\n}\nfunction $getTransformedPoint(delta, point, moveIfEqual) {\n var deltaIsInsert = delta.action == \"insert\";\n var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);\n var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);\n var deltaStart = delta.start;\n var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range.\n if ($pointsInOrder(point, deltaStart, moveIfEqual)) {\n return {\n row: point.row,\n column: point.column\n };\n }\n if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {\n return {\n row: point.row + deltaRowShift,\n column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)\n };\n }\n return {\n row: deltaStart.row,\n column: deltaStart.column\n };\n}\nexports.Anchor = Anchor;\n\n});\n\nace.define(\"ace/document\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/apply_delta\",\"ace/lib/event_emitter\",\"ace/range\",\"ace/anchor\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar applyDelta = require(\"./apply_delta\").applyDelta;\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Range = require(\"./range\").Range;\nvar Anchor = require(\"./anchor\").Anchor;\nvar Document = /** @class */ (function () {\n function Document(textOrLines) {\n this.$lines = [\"\"];\n if (textOrLines.length === 0) {\n this.$lines = [\"\"];\n }\n else if (Array.isArray(textOrLines)) {\n this.insertMergedLines({ row: 0, column: 0 }, textOrLines);\n }\n else {\n this.insert({ row: 0, column: 0 }, textOrLines);\n }\n }\n Document.prototype.setValue = function (text) {\n var len = this.getLength() - 1;\n this.remove(new Range(0, 0, len, this.getLine(len).length));\n this.insert({ row: 0, column: 0 }, text || \"\");\n };\n Document.prototype.getValue = function () {\n return this.getAllLines().join(this.getNewLineCharacter());\n };\n Document.prototype.createAnchor = function (row, column) {\n return new Anchor(this, row, column);\n };\n Document.prototype.$detectNewLine = function (text) {\n var match = text.match(/^.*?(\\r\\n|\\r|\\n)/m);\n this.$autoNewLine = match ? match[1] : \"\\n\";\n this._signal(\"changeNewLineMode\");\n };\n Document.prototype.getNewLineCharacter = function () {\n switch (this.$newLineMode) {\n case \"windows\":\n return \"\\r\\n\";\n case \"unix\":\n return \"\\n\";\n default:\n return this.$autoNewLine || \"\\n\";\n }\n };\n Document.prototype.setNewLineMode = function (newLineMode) {\n if (this.$newLineMode === newLineMode)\n return;\n this.$newLineMode = newLineMode;\n this._signal(\"changeNewLineMode\");\n };\n Document.prototype.getNewLineMode = function () {\n return this.$newLineMode;\n };\n Document.prototype.isNewLine = function (text) {\n return (text == \"\\r\\n\" || text == \"\\r\" || text == \"\\n\");\n };\n Document.prototype.getLine = function (row) {\n return this.$lines[row] || \"\";\n };\n Document.prototype.getLines = function (firstRow, lastRow) {\n return this.$lines.slice(firstRow, lastRow + 1);\n };\n Document.prototype.getAllLines = function () {\n return this.getLines(0, this.getLength());\n };\n Document.prototype.getLength = function () {\n return this.$lines.length;\n };\n Document.prototype.getTextRange = function (range) {\n return this.getLinesForRange(range).join(this.getNewLineCharacter());\n };\n Document.prototype.getLinesForRange = function (range) {\n var lines;\n if (range.start.row === range.end.row) {\n lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];\n }\n else {\n lines = this.getLines(range.start.row, range.end.row);\n lines[0] = (lines[0] || \"\").substring(range.start.column);\n var l = lines.length - 1;\n if (range.end.row - range.start.row == l)\n lines[l] = lines[l].substring(0, range.end.column);\n }\n return lines;\n };\n Document.prototype.insertLines = function (row, lines) {\n console.warn(\"Use of document.insertLines is deprecated. Use the insertFullLines method instead.\");\n return this.insertFullLines(row, lines);\n };\n Document.prototype.removeLines = function (firstRow, lastRow) {\n console.warn(\"Use of document.removeLines is deprecated. Use the removeFullLines method instead.\");\n return this.removeFullLines(firstRow, lastRow);\n };\n Document.prototype.insertNewLine = function (position) {\n console.warn(\"Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.\");\n return this.insertMergedLines(position, [\"\", \"\"]);\n };\n Document.prototype.insert = function (position, text) {\n if (this.getLength() <= 1)\n this.$detectNewLine(text);\n return this.insertMergedLines(position, this.$split(text));\n };\n Document.prototype.insertInLine = function (position, text) {\n var start = this.clippedPos(position.row, position.column);\n var end = this.pos(position.row, position.column + text.length);\n this.applyDelta({\n start: start,\n end: end,\n action: \"insert\",\n lines: [text]\n }, true);\n return this.clonePos(end);\n };\n Document.prototype.clippedPos = function (row, column) {\n var length = this.getLength();\n if (row === undefined) {\n row = length;\n }\n else if (row < 0) {\n row = 0;\n }\n else if (row >= length) {\n row = length - 1;\n column = undefined;\n }\n var line = this.getLine(row);\n if (column == undefined)\n column = line.length;\n column = Math.min(Math.max(column, 0), line.length);\n return { row: row, column: column };\n };\n Document.prototype.clonePos = function (pos) {\n return { row: pos.row, column: pos.column };\n };\n Document.prototype.pos = function (row, column) {\n return { row: row, column: column };\n };\n Document.prototype.$clipPosition = function (position) {\n var length = this.getLength();\n if (position.row >= length) {\n position.row = Math.max(0, length - 1);\n position.column = this.getLine(length - 1).length;\n }\n else {\n position.row = Math.max(0, position.row);\n position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length);\n }\n return position;\n };\n Document.prototype.insertFullLines = function (row, lines) {\n row = Math.min(Math.max(row, 0), this.getLength());\n var column = 0;\n if (row < this.getLength()) {\n lines = lines.concat([\"\"]);\n column = 0;\n }\n else {\n lines = [\"\"].concat(lines);\n row--;\n column = this.$lines[row].length;\n }\n this.insertMergedLines({ row: row, column: column }, lines);\n };\n Document.prototype.insertMergedLines = function (position, lines) {\n var start = this.clippedPos(position.row, position.column);\n var end = {\n row: start.row + lines.length - 1,\n column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length\n };\n this.applyDelta({\n start: start,\n end: end,\n action: \"insert\",\n lines: lines\n });\n return this.clonePos(end);\n };\n Document.prototype.remove = function (range) {\n var start = this.clippedPos(range.start.row, range.start.column);\n var end = this.clippedPos(range.end.row, range.end.column);\n this.applyDelta({\n start: start,\n end: end,\n action: \"remove\",\n lines: this.getLinesForRange({ start: start, end: end })\n });\n return this.clonePos(start);\n };\n Document.prototype.removeInLine = function (row, startColumn, endColumn) {\n var start = this.clippedPos(row, startColumn);\n var end = this.clippedPos(row, endColumn);\n this.applyDelta({\n start: start,\n end: end,\n action: \"remove\",\n lines: this.getLinesForRange({ start: start, end: end })\n }, true);\n return this.clonePos(start);\n };\n Document.prototype.removeFullLines = function (firstRow, lastRow) {\n firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1);\n lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1);\n var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0;\n var deleteLastNewLine = lastRow < this.getLength() - 1;\n var startRow = (deleteFirstNewLine ? firstRow - 1 : firstRow);\n var startCol = (deleteFirstNewLine ? this.getLine(startRow).length : 0);\n var endRow = (deleteLastNewLine ? lastRow + 1 : lastRow);\n var endCol = (deleteLastNewLine ? 0 : this.getLine(endRow).length);\n var range = new Range(startRow, startCol, endRow, endCol);\n var deletedLines = this.$lines.slice(firstRow, lastRow + 1);\n this.applyDelta({\n start: range.start,\n end: range.end,\n action: \"remove\",\n lines: this.getLinesForRange(range)\n });\n return deletedLines;\n };\n Document.prototype.removeNewLine = function (row) {\n if (row < this.getLength() - 1 && row >= 0) {\n this.applyDelta({\n start: this.pos(row, this.getLine(row).length),\n end: this.pos(row + 1, 0),\n action: \"remove\",\n lines: [\"\", \"\"]\n });\n }\n };\n Document.prototype.replace = function (range, text) {\n if (!(range instanceof Range))\n range = Range.fromPoints(range.start, range.end);\n if (text.length === 0 && range.isEmpty())\n return range.start;\n if (text == this.getTextRange(range))\n return range.end;\n this.remove(range);\n var end;\n if (text) {\n end = this.insert(range.start, text);\n }\n else {\n end = range.start;\n }\n return end;\n };\n Document.prototype.applyDeltas = function (deltas) {\n for (var i = 0; i < deltas.length; i++) {\n this.applyDelta(deltas[i]);\n }\n };\n Document.prototype.revertDeltas = function (deltas) {\n for (var i = deltas.length - 1; i >= 0; i--) {\n this.revertDelta(deltas[i]);\n }\n };\n Document.prototype.applyDelta = function (delta, doNotValidate) {\n var isInsert = delta.action == \"insert\";\n if (isInsert ? delta.lines.length <= 1 && !delta.lines[0]\n : !Range.comparePoints(delta.start, delta.end)) {\n return;\n }\n if (isInsert && delta.lines.length > 20000) {\n this.$splitAndapplyLargeDelta(delta, 20000);\n }\n else {\n applyDelta(this.$lines, delta, doNotValidate);\n this._signal(\"change\", delta);\n }\n };\n Document.prototype.$safeApplyDelta = function (delta) {\n var docLength = this.$lines.length;\n if (delta.action == \"remove\" && delta.start.row < docLength && delta.end.row < docLength\n || delta.action == \"insert\" && delta.start.row <= docLength) {\n this.applyDelta(delta);\n }\n };\n Document.prototype.$splitAndapplyLargeDelta = function (delta, MAX) {\n var lines = delta.lines;\n var l = lines.length - MAX + 1;\n var row = delta.start.row;\n var column = delta.start.column;\n for (var from = 0, to = 0; from < l; from = to) {\n to += MAX - 1;\n var chunk = lines.slice(from, to);\n chunk.push(\"\");\n this.applyDelta({\n start: this.pos(row + from, column),\n end: this.pos(row + to, column = 0),\n action: delta.action,\n lines: chunk\n }, true);\n }\n delta.lines = lines.slice(from);\n delta.start.row = row + from;\n delta.start.column = column;\n this.applyDelta(delta, true);\n };\n Document.prototype.revertDelta = function (delta) {\n this.$safeApplyDelta({\n start: this.clonePos(delta.start),\n end: this.clonePos(delta.end),\n action: (delta.action == \"insert\" ? \"remove\" : \"insert\"),\n lines: delta.lines.slice()\n });\n };\n Document.prototype.indexToPosition = function (index, startRow) {\n var lines = this.$lines || this.getAllLines();\n var newlineLength = this.getNewLineCharacter().length;\n for (var i = startRow || 0, l = lines.length; i < l; i++) {\n index -= lines[i].length + newlineLength;\n if (index < 0)\n return { row: i, column: index + lines[i].length + newlineLength };\n }\n return { row: l - 1, column: index + lines[l - 1].length + newlineLength };\n };\n Document.prototype.positionToIndex = function (pos, startRow) {\n var lines = this.$lines || this.getAllLines();\n var newlineLength = this.getNewLineCharacter().length;\n var index = 0;\n var row = Math.min(pos.row, lines.length);\n for (var i = startRow || 0; i < row; ++i)\n index += lines[i].length + newlineLength;\n return index + pos.column;\n };\n Document.prototype.$split = function (text) {\n return text.split(/\\r\\n|\\r|\\n/);\n };\n return Document;\n}());\nDocument.prototype.$autoNewLine = \"\";\nDocument.prototype.$newLineMode = \"auto\";\noop.implement(Document.prototype, EventEmitter);\nexports.Document = Document;\n\n});\n\nace.define(\"ace/background_tokenizer\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar BackgroundTokenizer = /** @class */ (function () {\n function BackgroundTokenizer(tokenizer, session) {\n this.running = false;\n this.lines = [];\n this.states = [];\n this.currentLine = 0;\n this.tokenizer = tokenizer;\n var self = this;\n this.$worker = function () {\n if (!self.running) {\n return;\n }\n var workerStart = new Date();\n var currentLine = self.currentLine;\n var endLine = -1;\n var doc = self.doc;\n var startLine = currentLine;\n while (self.lines[currentLine])\n currentLine++;\n var len = doc.getLength();\n var processedLines = 0;\n self.running = false;\n while (currentLine < len) {\n self.$tokenizeRow(currentLine);\n endLine = currentLine;\n do {\n currentLine++;\n } while (self.lines[currentLine]);\n processedLines++;\n if ((processedLines % 5 === 0) && (new Date() - workerStart) > 20) {\n self.running = setTimeout(self.$worker, 20);\n break;\n }\n }\n self.currentLine = currentLine;\n if (endLine == -1)\n endLine = currentLine;\n if (startLine <= endLine)\n self.fireUpdateEvent(startLine, endLine);\n };\n }\n BackgroundTokenizer.prototype.setTokenizer = function (tokenizer) {\n this.tokenizer = tokenizer;\n this.lines = [];\n this.states = [];\n this.start(0);\n };\n BackgroundTokenizer.prototype.setDocument = function (doc) {\n this.doc = doc;\n this.lines = [];\n this.states = [];\n this.stop();\n };\n BackgroundTokenizer.prototype.fireUpdateEvent = function (firstRow, lastRow) {\n var data = {\n first: firstRow,\n last: lastRow\n };\n this._signal(\"update\", { data: data });\n };\n BackgroundTokenizer.prototype.start = function (startRow) {\n this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength());\n this.lines.splice(this.currentLine, this.lines.length);\n this.states.splice(this.currentLine, this.states.length);\n this.stop();\n this.running = setTimeout(this.$worker, 700);\n };\n BackgroundTokenizer.prototype.scheduleStart = function () {\n if (!this.running)\n this.running = setTimeout(this.$worker, 700);\n };\n BackgroundTokenizer.prototype.$updateOnChange = function (delta) {\n var startRow = delta.start.row;\n var len = delta.end.row - startRow;\n if (len === 0) {\n this.lines[startRow] = null;\n }\n else if (delta.action == \"remove\") {\n this.lines.splice(startRow, len + 1, null);\n this.states.splice(startRow, len + 1, null);\n }\n else {\n var args = Array(len + 1);\n args.unshift(startRow, 1);\n this.lines.splice.apply(this.lines, args);\n this.states.splice.apply(this.states, args);\n }\n this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength());\n this.stop();\n };\n BackgroundTokenizer.prototype.stop = function () {\n if (this.running)\n clearTimeout(this.running);\n this.running = false;\n };\n BackgroundTokenizer.prototype.getTokens = function (row) {\n return this.lines[row] || this.$tokenizeRow(row);\n };\n BackgroundTokenizer.prototype.getState = function (row) {\n if (this.currentLine == row)\n this.$tokenizeRow(row);\n return this.states[row] || \"start\";\n };\n BackgroundTokenizer.prototype.$tokenizeRow = function (row) {\n var line = this.doc.getLine(row);\n var state = this.states[row - 1];\n var data = this.tokenizer.getLineTokens(line, state, row);\n if (this.states[row] + \"\" !== data.state + \"\") {\n this.states[row] = data.state;\n this.lines[row + 1] = null;\n if (this.currentLine > row + 1)\n this.currentLine = row + 1;\n }\n else if (this.currentLine == row) {\n this.currentLine = row + 1;\n }\n return this.lines[row] = data.tokens;\n };\n BackgroundTokenizer.prototype.cleanup = function () {\n this.running = false;\n this.lines = [];\n this.states = [];\n this.currentLine = 0;\n this.removeAllListeners();\n };\n return BackgroundTokenizer;\n}());\noop.implement(BackgroundTokenizer.prototype, EventEmitter);\nexports.BackgroundTokenizer = BackgroundTokenizer;\n\n});\n\nace.define(\"ace/search_highlight\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar lang = require(\"./lib/lang\");\nvar Range = require(\"./range\").Range;\nvar SearchHighlight = /** @class */ (function () {\n function SearchHighlight(regExp, clazz, type) {\n if (type === void 0) { type = \"text\"; }\n this.setRegexp(regExp);\n this.clazz = clazz;\n this.type = type;\n }\n SearchHighlight.prototype.setRegexp = function (regExp) {\n if (this.regExp + \"\" == regExp + \"\")\n return;\n this.regExp = regExp;\n this.cache = [];\n };\n SearchHighlight.prototype.update = function (html, markerLayer, session, config) {\n if (!this.regExp)\n return;\n var start = config.firstRow, end = config.lastRow;\n var renderedMarkerRanges = {};\n for (var i = start; i <= end; i++) {\n var ranges = this.cache[i];\n if (ranges == null) {\n ranges = lang.getMatchOffsets(session.getLine(i), this.regExp);\n if (ranges.length > this.MAX_RANGES)\n ranges = ranges.slice(0, this.MAX_RANGES);\n ranges = ranges.map(function (match) {\n return new Range(i, match.offset, i, match.offset + match.length);\n });\n this.cache[i] = ranges.length ? ranges : \"\";\n }\n for (var j = ranges.length; j--;) {\n var rangeToAddMarkerTo = ranges[j].toScreenRange(session);\n var rangeAsString = rangeToAddMarkerTo.toString();\n if (renderedMarkerRanges[rangeAsString])\n continue;\n renderedMarkerRanges[rangeAsString] = true;\n markerLayer.drawSingleLineMarker(html, rangeToAddMarkerTo, this.clazz, config);\n }\n }\n };\n return SearchHighlight;\n}());\nSearchHighlight.prototype.MAX_RANGES = 500;\nexports.SearchHighlight = SearchHighlight;\n\n});\n\nace.define(\"ace/undomanager\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar UndoManager = /** @class */ (function () {\n function UndoManager() {\n this.$keepRedoStack;\n this.$maxRev = 0;\n this.$fromUndo = false;\n this.$undoDepth = Infinity;\n this.reset();\n }\n UndoManager.prototype.addSession = function (session) {\n this.$session = session;\n };\n UndoManager.prototype.add = function (delta, allowMerge, session) {\n if (this.$fromUndo)\n return;\n if (delta == this.$lastDelta)\n return;\n if (!this.$keepRedoStack)\n this.$redoStack.length = 0;\n if (allowMerge === false || !this.lastDeltas) {\n this.lastDeltas = [];\n var undoStackLength = this.$undoStack.length;\n if (undoStackLength > this.$undoDepth - 1) {\n this.$undoStack.splice(0, undoStackLength - this.$undoDepth + 1);\n }\n this.$undoStack.push(this.lastDeltas);\n delta.id = this.$rev = ++this.$maxRev;\n }\n if (delta.action == \"remove\" || delta.action == \"insert\")\n this.$lastDelta = delta;\n this.lastDeltas.push(delta);\n };\n UndoManager.prototype.addSelection = function (selection, rev) {\n this.selections.push({\n value: selection,\n rev: rev || this.$rev\n });\n };\n UndoManager.prototype.startNewGroup = function () {\n this.lastDeltas = null;\n return this.$rev;\n };\n UndoManager.prototype.markIgnored = function (from, to) {\n if (to == null)\n to = this.$rev + 1;\n var stack = this.$undoStack;\n for (var i = stack.length; i--;) {\n var delta = stack[i][0];\n if (delta.id <= from)\n break;\n if (delta.id < to)\n delta.ignore = true;\n }\n this.lastDeltas = null;\n };\n UndoManager.prototype.getSelection = function (rev, after) {\n var stack = this.selections;\n for (var i = stack.length; i--;) {\n var selection = stack[i];\n if (selection.rev < rev) {\n if (after)\n selection = stack[i + 1];\n return selection;\n }\n }\n };\n UndoManager.prototype.getRevision = function () {\n return this.$rev;\n };\n UndoManager.prototype.getDeltas = function (from, to) {\n if (to == null)\n to = this.$rev + 1;\n var stack = this.$undoStack;\n var end = null, start = 0;\n for (var i = stack.length; i--;) {\n var delta = stack[i][0];\n if (delta.id < to && !end)\n end = i + 1;\n if (delta.id <= from) {\n start = i + 1;\n break;\n }\n }\n return stack.slice(start, end);\n };\n UndoManager.prototype.getChangedRanges = function (from, to) {\n if (to == null)\n to = this.$rev + 1;\n };\n UndoManager.prototype.getChangedLines = function (from, to) {\n if (to == null)\n to = this.$rev + 1;\n };\n UndoManager.prototype.undo = function (session, dontSelect) {\n this.lastDeltas = null;\n var stack = this.$undoStack;\n if (!rearrangeUndoStack(stack, stack.length))\n return;\n if (!session)\n session = this.$session;\n if (this.$redoStackBaseRev !== this.$rev && this.$redoStack.length)\n this.$redoStack = [];\n this.$fromUndo = true;\n var deltaSet = stack.pop();\n var undoSelectionRange = null;\n if (deltaSet) {\n undoSelectionRange = session.undoChanges(deltaSet, dontSelect);\n this.$redoStack.push(deltaSet);\n this.$syncRev();\n }\n this.$fromUndo = false;\n return undoSelectionRange;\n };\n UndoManager.prototype.redo = function (session, dontSelect) {\n this.lastDeltas = null;\n if (!session)\n session = this.$session;\n this.$fromUndo = true;\n if (this.$redoStackBaseRev != this.$rev) {\n var diff = this.getDeltas(this.$redoStackBaseRev, this.$rev + 1);\n rebaseRedoStack(this.$redoStack, diff);\n this.$redoStackBaseRev = this.$rev;\n this.$redoStack.forEach(function (x) {\n x[0].id = ++this.$maxRev;\n }, this);\n }\n var deltaSet = this.$redoStack.pop();\n var redoSelectionRange = null;\n if (deltaSet) {\n redoSelectionRange = session.redoChanges(deltaSet, dontSelect);\n this.$undoStack.push(deltaSet);\n this.$syncRev();\n }\n this.$fromUndo = false;\n return redoSelectionRange;\n };\n UndoManager.prototype.$syncRev = function () {\n var stack = this.$undoStack;\n var nextDelta = stack[stack.length - 1];\n var id = nextDelta && nextDelta[0].id || 0;\n this.$redoStackBaseRev = id;\n this.$rev = id;\n };\n UndoManager.prototype.reset = function () {\n this.lastDeltas = null;\n this.$lastDelta = null;\n this.$undoStack = [];\n this.$redoStack = [];\n this.$rev = 0;\n this.mark = 0;\n this.$redoStackBaseRev = this.$rev;\n this.selections = [];\n };\n UndoManager.prototype.canUndo = function () {\n return this.$undoStack.length > 0;\n };\n UndoManager.prototype.canRedo = function () {\n return this.$redoStack.length > 0;\n };\n UndoManager.prototype.bookmark = function (rev) {\n if (rev == undefined)\n rev = this.$rev;\n this.mark = rev;\n };\n UndoManager.prototype.isAtBookmark = function () {\n return this.$rev === this.mark;\n };\n UndoManager.prototype.toJSON = function () {\n return {\n $redoStack: this.$redoStack,\n $undoStack: this.$undoStack\n };\n };\n UndoManager.prototype.fromJSON = function (json) {\n this.reset();\n this.$undoStack = json.$undoStack;\n this.$redoStack = json.$redoStack;\n };\n UndoManager.prototype.$prettyPrint = function (delta) {\n if (delta)\n return stringifyDelta(delta);\n return stringifyDelta(this.$undoStack) + \"\\n---\\n\" + stringifyDelta(this.$redoStack);\n };\n return UndoManager;\n}());\nUndoManager.prototype.hasUndo = UndoManager.prototype.canUndo;\nUndoManager.prototype.hasRedo = UndoManager.prototype.canRedo;\nUndoManager.prototype.isClean = UndoManager.prototype.isAtBookmark;\nUndoManager.prototype.markClean = UndoManager.prototype.bookmark;\nfunction rearrangeUndoStack(stack, pos) {\n for (var i = pos; i--;) {\n var deltaSet = stack[i];\n if (deltaSet && !deltaSet[0].ignore) {\n while (i < pos - 1) {\n var swapped = swapGroups(stack[i], stack[i + 1]);\n stack[i] = swapped[0];\n stack[i + 1] = swapped[1];\n i++;\n }\n return true;\n }\n }\n}\nvar Range = require(\"./range\").Range;\nvar cmp = Range.comparePoints;\nvar comparePoints = Range.comparePoints;\nfunction $updateMarkers(delta) {\n var isInsert = delta.action == \"insert\";\n var start = delta.start;\n var end = delta.end;\n var rowShift = (end.row - start.row) * (isInsert ? 1 : -1);\n var colShift = (end.column - start.column) * (isInsert ? 1 : -1);\n if (isInsert)\n end = start;\n for (var i in this.marks) {\n var point = this.marks[i];\n var cmp = comparePoints(point, start);\n if (cmp < 0) {\n continue; // delta starts after the range\n }\n if (cmp === 0) {\n if (isInsert) {\n if (point.bias == 1) {\n cmp = 1;\n }\n else {\n point.bias == -1;\n continue;\n }\n }\n }\n var cmp2 = isInsert ? cmp : comparePoints(point, end);\n if (cmp2 > 0) {\n point.row += rowShift;\n point.column += point.row == end.row ? colShift : 0;\n continue;\n }\n if (!isInsert && cmp2 <= 0) {\n point.row = start.row;\n point.column = start.column;\n if (cmp2 === 0)\n point.bias = 1;\n }\n }\n}\nfunction clonePos(pos) {\n return { row: pos.row, column: pos.column };\n}\nfunction cloneDelta(d) {\n return {\n start: clonePos(d.start),\n end: clonePos(d.end),\n action: d.action,\n lines: d.lines.slice()\n };\n}\nfunction stringifyDelta(d) {\n d = d || this;\n if (Array.isArray(d)) {\n return d.map(stringifyDelta).join(\"\\n\");\n }\n var type = \"\";\n if (d.action) {\n type = d.action == \"insert\" ? \"+\" : \"-\";\n type += \"[\" + d.lines + \"]\";\n }\n else if (d.value) {\n if (Array.isArray(d.value)) {\n type = d.value.map(stringifyRange).join(\"\\n\");\n }\n else {\n type = stringifyRange(d.value);\n }\n }\n if (d.start) {\n type += stringifyRange(d);\n }\n if (d.id || d.rev) {\n type += \"\\t(\" + (d.id || d.rev) + \")\";\n }\n return type;\n}\nfunction stringifyRange(r) {\n return r.start.row + \":\" + r.start.column\n + \"=>\" + r.end.row + \":\" + r.end.column;\n}\nfunction swap(d1, d2) {\n var i1 = d1.action == \"insert\";\n var i2 = d2.action == \"insert\";\n if (i1 && i2) {\n if (cmp(d2.start, d1.end) >= 0) {\n shift(d2, d1, -1);\n }\n else if (cmp(d2.start, d1.start) <= 0) {\n shift(d1, d2, +1);\n }\n else {\n return null;\n }\n }\n else if (i1 && !i2) {\n if (cmp(d2.start, d1.end) >= 0) {\n shift(d2, d1, -1);\n }\n else if (cmp(d2.end, d1.start) <= 0) {\n shift(d1, d2, -1);\n }\n else {\n return null;\n }\n }\n else if (!i1 && i2) {\n if (cmp(d2.start, d1.start) >= 0) {\n shift(d2, d1, +1);\n }\n else if (cmp(d2.start, d1.start) <= 0) {\n shift(d1, d2, +1);\n }\n else {\n return null;\n }\n }\n else if (!i1 && !i2) {\n if (cmp(d2.start, d1.start) >= 0) {\n shift(d2, d1, +1);\n }\n else if (cmp(d2.end, d1.start) <= 0) {\n shift(d1, d2, -1);\n }\n else {\n return null;\n }\n }\n return [d2, d1];\n}\nfunction swapGroups(ds1, ds2) {\n for (var i = ds1.length; i--;) {\n for (var j = 0; j < ds2.length; j++) {\n if (!swap(ds1[i], ds2[j])) {\n while (i < ds1.length) {\n while (j--) {\n swap(ds2[j], ds1[i]);\n }\n j = ds2.length;\n i++;\n }\n return [ds1, ds2];\n }\n }\n }\n ds1.selectionBefore = ds2.selectionBefore =\n ds1.selectionAfter = ds2.selectionAfter = null;\n return [ds2, ds1];\n}\nfunction xform(d1, c1) {\n var i1 = d1.action == \"insert\";\n var i2 = c1.action == \"insert\";\n if (i1 && i2) {\n if (cmp(d1.start, c1.start) < 0) {\n shift(c1, d1, 1);\n }\n else {\n shift(d1, c1, 1);\n }\n }\n else if (i1 && !i2) {\n if (cmp(d1.start, c1.end) >= 0) {\n shift(d1, c1, -1);\n }\n else if (cmp(d1.start, c1.start) <= 0) {\n shift(c1, d1, +1);\n }\n else {\n shift(d1, Range.fromPoints(c1.start, d1.start), -1);\n shift(c1, d1, +1);\n }\n }\n else if (!i1 && i2) {\n if (cmp(c1.start, d1.end) >= 0) {\n shift(c1, d1, -1);\n }\n else if (cmp(c1.start, d1.start) <= 0) {\n shift(d1, c1, +1);\n }\n else {\n shift(c1, Range.fromPoints(d1.start, c1.start), -1);\n shift(d1, c1, +1);\n }\n }\n else if (!i1 && !i2) {\n if (cmp(c1.start, d1.end) >= 0) {\n shift(c1, d1, -1);\n }\n else if (cmp(c1.end, d1.start) <= 0) {\n shift(d1, c1, -1);\n }\n else {\n var before, after;\n if (cmp(d1.start, c1.start) < 0) {\n before = d1;\n d1 = splitDelta(d1, c1.start);\n }\n if (cmp(d1.end, c1.end) > 0) {\n after = splitDelta(d1, c1.end);\n }\n shiftPos(c1.end, d1.start, d1.end, -1);\n if (after && !before) {\n d1.lines = after.lines;\n d1.start = after.start;\n d1.end = after.end;\n after = d1;\n }\n return [c1, before, after].filter(Boolean);\n }\n }\n return [c1, d1];\n}\nfunction shift(d1, d2, dir) {\n shiftPos(d1.start, d2.start, d2.end, dir);\n shiftPos(d1.end, d2.start, d2.end, dir);\n}\nfunction shiftPos(pos, start, end, dir) {\n if (pos.row == (dir == 1 ? start : end).row) {\n pos.column += dir * (end.column - start.column);\n }\n pos.row += dir * (end.row - start.row);\n}\nfunction splitDelta(c, pos) {\n var lines = c.lines;\n var end = c.end;\n c.end = clonePos(pos);\n var rowsBefore = c.end.row - c.start.row;\n var otherLines = lines.splice(rowsBefore, lines.length);\n var col = rowsBefore ? pos.column : pos.column - c.start.column;\n lines.push(otherLines[0].substring(0, col));\n otherLines[0] = otherLines[0].substr(col);\n var rest = {\n start: clonePos(pos),\n end: end,\n lines: otherLines,\n action: c.action\n };\n return rest;\n}\nfunction moveDeltasByOne(redoStack, d) {\n d = cloneDelta(d);\n for (var j = redoStack.length; j--;) {\n var deltaSet = redoStack[j];\n for (var i = 0; i < deltaSet.length; i++) {\n var x = deltaSet[i];\n var xformed = xform(x, d);\n d = xformed[0];\n if (xformed.length != 2) {\n if (xformed[2]) {\n deltaSet.splice(i + 1, 1, xformed[1], xformed[2]);\n i++;\n }\n else if (!xformed[1]) {\n deltaSet.splice(i, 1);\n i--;\n }\n }\n }\n if (!deltaSet.length) {\n redoStack.splice(j, 1);\n }\n }\n return redoStack;\n}\nfunction rebaseRedoStack(redoStack, deltaSets) {\n for (var i = 0; i < deltaSets.length; i++) {\n var deltas = deltaSets[i];\n for (var j = 0; j < deltas.length; j++) {\n moveDeltasByOne(redoStack, deltas[j]);\n }\n }\n}\nexports.UndoManager = UndoManager;\n\n});\n\nace.define(\"ace/edit_session/fold_line\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../range\").Range;\nvar FoldLine = /** @class */ (function () {\n function FoldLine(foldData, folds) {\n this.foldData = foldData;\n if (Array.isArray(folds)) {\n this.folds = folds;\n }\n else {\n folds = this.folds = [folds];\n }\n var last = folds[folds.length - 1];\n this.range = new Range(folds[0].start.row, folds[0].start.column, last.end.row, last.end.column);\n this.start = this.range.start;\n this.end = this.range.end;\n this.folds.forEach(function (fold) {\n fold.setFoldLine(this);\n }, this);\n }\n FoldLine.prototype.shiftRow = function (shift) {\n this.start.row += shift;\n this.end.row += shift;\n this.folds.forEach(function (fold) {\n fold.start.row += shift;\n fold.end.row += shift;\n });\n };\n FoldLine.prototype.addFold = function (fold) {\n if (fold.sameRow) {\n if (fold.start.row < this.startRow || fold.endRow > this.endRow) {\n throw new Error(\"Can't add a fold to this FoldLine as it has no connection\");\n }\n this.folds.push(fold);\n this.folds.sort(function (a, b) {\n return -a.range.compareEnd(b.start.row, b.start.column);\n });\n if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) {\n this.end.row = fold.end.row;\n this.end.column = fold.end.column;\n }\n else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) {\n this.start.row = fold.start.row;\n this.start.column = fold.start.column;\n }\n }\n else if (fold.start.row == this.end.row) {\n this.folds.push(fold);\n this.end.row = fold.end.row;\n this.end.column = fold.end.column;\n }\n else if (fold.end.row == this.start.row) {\n this.folds.unshift(fold);\n this.start.row = fold.start.row;\n this.start.column = fold.start.column;\n }\n else {\n throw new Error(\"Trying to add fold to FoldRow that doesn't have a matching row\");\n }\n fold.foldLine = this;\n };\n FoldLine.prototype.containsRow = function (row) {\n return row >= this.start.row && row <= this.end.row;\n };\n FoldLine.prototype.walk = function (callback, endRow, endColumn) {\n var lastEnd = 0, folds = this.folds, fold, cmp, stop, isNewRow = true;\n if (endRow == null) {\n endRow = this.end.row;\n endColumn = this.end.column;\n }\n for (var i = 0; i < folds.length; i++) {\n fold = folds[i];\n cmp = fold.range.compareStart(endRow, endColumn);\n if (cmp == -1) {\n callback(null, endRow, endColumn, lastEnd, isNewRow);\n return;\n }\n stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow);\n stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd);\n if (stop || cmp === 0) {\n return;\n }\n isNewRow = !fold.sameRow;\n lastEnd = fold.end.column;\n }\n callback(null, endRow, endColumn, lastEnd, isNewRow);\n };\n FoldLine.prototype.getNextFoldTo = function (row, column) {\n var fold, cmp;\n for (var i = 0; i < this.folds.length; i++) {\n fold = this.folds[i];\n cmp = fold.range.compareEnd(row, column);\n if (cmp == -1) {\n return {\n fold: fold,\n kind: \"after\"\n };\n }\n else if (cmp === 0) {\n return {\n fold: fold,\n kind: \"inside\"\n };\n }\n }\n return null;\n };\n FoldLine.prototype.addRemoveChars = function (row, column, len) {\n var ret = this.getNextFoldTo(row, column), fold, folds;\n if (ret) {\n fold = ret.fold;\n if (ret.kind == \"inside\"\n && fold.start.column != column\n && fold.start.row != row) {\n window.console && window.console.log(row, column, fold);\n }\n else if (fold.start.row == row) {\n folds = this.folds;\n var i = folds.indexOf(fold);\n if (i === 0) {\n this.start.column += len;\n }\n for (i; i < folds.length; i++) {\n fold = folds[i];\n fold.start.column += len;\n if (!fold.sameRow) {\n return;\n }\n fold.end.column += len;\n }\n this.end.column += len;\n }\n }\n };\n FoldLine.prototype.split = function (row, column) {\n var pos = this.getNextFoldTo(row, column);\n if (!pos || pos.kind == \"inside\")\n return null;\n var fold = pos.fold;\n var folds = this.folds;\n var foldData = this.foldData;\n var i = folds.indexOf(fold);\n var foldBefore = folds[i - 1];\n this.end.row = foldBefore.end.row;\n this.end.column = foldBefore.end.column;\n folds = folds.splice(i, folds.length - i);\n var newFoldLine = new FoldLine(foldData, folds);\n foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine);\n return newFoldLine;\n };\n FoldLine.prototype.merge = function (foldLineNext) {\n var folds = foldLineNext.folds;\n for (var i = 0; i < folds.length; i++) {\n this.addFold(folds[i]);\n }\n var foldData = this.foldData;\n foldData.splice(foldData.indexOf(foldLineNext), 1);\n };\n FoldLine.prototype.toString = function () {\n var ret = [this.range.toString() + \": [\"];\n this.folds.forEach(function (fold) {\n ret.push(\" \" + fold.toString());\n });\n ret.push(\"]\");\n return ret.join(\"\\n\");\n };\n FoldLine.prototype.idxToPosition = function (idx) {\n var lastFoldEndColumn = 0;\n for (var i = 0; i < this.folds.length; i++) {\n var fold = this.folds[i];\n idx -= fold.start.column - lastFoldEndColumn;\n if (idx < 0) {\n return {\n row: fold.start.row,\n column: fold.start.column + idx\n };\n }\n idx -= fold.placeholder.length;\n if (idx < 0) {\n return fold.start;\n }\n lastFoldEndColumn = fold.end.column;\n }\n return {\n row: this.end.row,\n column: this.end.column + idx\n };\n };\n return FoldLine;\n}());\nexports.FoldLine = FoldLine;\n\n});\n\nace.define(\"ace/range_list\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"./range\").Range;\nvar comparePoints = Range.comparePoints;\nvar RangeList = /** @class */ (function () {\n function RangeList() {\n this.ranges = [];\n this.$bias = 1;\n }\n RangeList.prototype.pointIndex = function (pos, excludeEdges, startIndex) {\n var list = this.ranges;\n for (var i = startIndex || 0; i < list.length; i++) {\n var range = list[i];\n var cmpEnd = comparePoints(pos, range.end);\n if (cmpEnd > 0)\n continue;\n var cmpStart = comparePoints(pos, range.start);\n if (cmpEnd === 0)\n return excludeEdges && cmpStart !== 0 ? -i - 2 : i;\n if (cmpStart > 0 || (cmpStart === 0 && !excludeEdges))\n return i;\n return -i - 1;\n }\n return -i - 1;\n };\n RangeList.prototype.add = function (range) {\n var excludeEdges = !range.isEmpty();\n var startIndex = this.pointIndex(range.start, excludeEdges);\n if (startIndex < 0)\n startIndex = -startIndex - 1;\n var endIndex = this.pointIndex(range.end, excludeEdges, startIndex);\n if (endIndex < 0)\n endIndex = -endIndex - 1;\n else\n endIndex++;\n return this.ranges.splice(startIndex, endIndex - startIndex, range);\n };\n RangeList.prototype.addList = function (list) {\n var removed = [];\n for (var i = list.length; i--;) {\n removed.push.apply(removed, this.add(list[i]));\n }\n return removed;\n };\n RangeList.prototype.substractPoint = function (pos) {\n var i = this.pointIndex(pos);\n if (i >= 0)\n return this.ranges.splice(i, 1);\n };\n RangeList.prototype.merge = function () {\n var removed = [];\n var list = this.ranges;\n list = list.sort(function (a, b) {\n return comparePoints(a.start, b.start);\n });\n var next = list[0], range;\n for (var i = 1; i < list.length; i++) {\n range = next;\n next = list[i];\n var cmp = comparePoints(range.end, next.start);\n if (cmp < 0)\n continue;\n if (cmp == 0 && !range.isEmpty() && !next.isEmpty())\n continue;\n if (comparePoints(range.end, next.end) < 0) {\n range.end.row = next.end.row;\n range.end.column = next.end.column;\n }\n list.splice(i, 1);\n removed.push(next);\n next = range;\n i--;\n }\n this.ranges = list;\n return removed;\n };\n RangeList.prototype.contains = function (row, column) {\n return this.pointIndex({ row: row, column: column }) >= 0;\n };\n RangeList.prototype.containsPoint = function (pos) {\n return this.pointIndex(pos) >= 0;\n };\n RangeList.prototype.rangeAtPoint = function (pos) {\n var i = this.pointIndex(pos);\n if (i >= 0)\n return this.ranges[i];\n };\n RangeList.prototype.clipRows = function (startRow, endRow) {\n var list = this.ranges;\n if (list[0].start.row > endRow || list[list.length - 1].start.row < startRow)\n return [];\n var startIndex = this.pointIndex({ row: startRow, column: 0 });\n if (startIndex < 0)\n startIndex = -startIndex - 1;\n var endIndex = this.pointIndex({ row: endRow, column: 0 }, startIndex);\n if (endIndex < 0)\n endIndex = -endIndex - 1;\n var clipped = [];\n for (var i = startIndex; i < endIndex; i++) {\n clipped.push(list[i]);\n }\n return clipped;\n };\n RangeList.prototype.removeAll = function () {\n return this.ranges.splice(0, this.ranges.length);\n };\n RangeList.prototype.attach = function (session) {\n if (this.session)\n this.detach();\n this.session = session;\n this.onChange = this.$onChange.bind(this);\n this.session.on('change', this.onChange);\n };\n RangeList.prototype.detach = function () {\n if (!this.session)\n return;\n this.session.removeListener('change', this.onChange);\n this.session = null;\n };\n RangeList.prototype.$onChange = function (delta) {\n var start = delta.start;\n var end = delta.end;\n var startRow = start.row;\n var endRow = end.row;\n var ranges = this.ranges;\n for (var i = 0, n = ranges.length; i < n; i++) {\n var r = ranges[i];\n if (r.end.row >= startRow)\n break;\n }\n if (delta.action == \"insert\") {\n var lineDif = endRow - startRow;\n var colDiff = -start.column + end.column;\n for (; i < n; i++) {\n var r = ranges[i];\n if (r.start.row > startRow)\n break;\n if (r.start.row == startRow && r.start.column >= start.column) {\n if (r.start.column == start.column && this.$bias <= 0) {\n }\n else {\n r.start.column += colDiff;\n r.start.row += lineDif;\n }\n }\n if (r.end.row == startRow && r.end.column >= start.column) {\n if (r.end.column == start.column && this.$bias < 0) {\n continue;\n }\n if (r.end.column == start.column && colDiff > 0 && i < n - 1) {\n if (r.end.column > r.start.column && r.end.column == ranges[i + 1].start.column)\n r.end.column -= colDiff;\n }\n r.end.column += colDiff;\n r.end.row += lineDif;\n }\n }\n }\n else {\n var lineDif = startRow - endRow;\n var colDiff = start.column - end.column;\n for (; i < n; i++) {\n var r = ranges[i];\n if (r.start.row > endRow)\n break;\n if (r.end.row < endRow\n && (startRow < r.end.row\n || startRow == r.end.row && start.column < r.end.column)) {\n r.end.row = startRow;\n r.end.column = start.column;\n }\n else if (r.end.row == endRow) {\n if (r.end.column <= end.column) {\n if (lineDif || r.end.column > start.column) {\n r.end.column = start.column;\n r.end.row = start.row;\n }\n }\n else {\n r.end.column += colDiff;\n r.end.row += lineDif;\n }\n }\n else if (r.end.row > endRow) {\n r.end.row += lineDif;\n }\n if (r.start.row < endRow\n && (startRow < r.start.row\n || startRow == r.start.row && start.column < r.start.column)) {\n r.start.row = startRow;\n r.start.column = start.column;\n }\n else if (r.start.row == endRow) {\n if (r.start.column <= end.column) {\n if (lineDif || r.start.column > start.column) {\n r.start.column = start.column;\n r.start.row = start.row;\n }\n }\n else {\n r.start.column += colDiff;\n r.start.row += lineDif;\n }\n }\n else if (r.start.row > endRow) {\n r.start.row += lineDif;\n }\n }\n }\n if (lineDif != 0 && i < n) {\n for (; i < n; i++) {\n var r = ranges[i];\n r.start.row += lineDif;\n r.end.row += lineDif;\n }\n }\n };\n return RangeList;\n}());\nRangeList.prototype.comparePoints = comparePoints;\nexports.RangeList = RangeList;\n\n});\n\nace.define(\"ace/edit_session/fold\",[\"require\",\"exports\",\"module\",\"ace/range_list\"], function(require, exports, module){\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar RangeList = require(\"../range_list\").RangeList;\nvar Fold = /** @class */ (function (_super) {\n __extends(Fold, _super);\n function Fold(range, placeholder) {\n var _this = _super.call(this) || this;\n _this.foldLine = null;\n _this.placeholder = placeholder;\n _this.range = range;\n _this.start = range.start;\n _this.end = range.end;\n _this.sameRow = range.start.row == range.end.row;\n _this.subFolds = _this.ranges = [];\n return _this;\n }\n Fold.prototype.toString = function () {\n return '\"' + this.placeholder + '\" ' + this.range.toString();\n };\n Fold.prototype.setFoldLine = function (foldLine) {\n this.foldLine = foldLine;\n this.subFolds.forEach(function (fold) {\n fold.setFoldLine(foldLine);\n });\n };\n Fold.prototype.clone = function () {\n var range = this.range.clone();\n var fold = new Fold(range, this.placeholder);\n this.subFolds.forEach(function (subFold) {\n fold.subFolds.push(subFold.clone());\n });\n fold.collapseChildren = this.collapseChildren;\n return fold;\n };\n Fold.prototype.addSubFold = function (fold) {\n if (this.range.isEqual(fold))\n return;\n consumeRange(fold, this.start);\n var row = fold.start.row, column = fold.start.column;\n for (var i = 0, cmp = -1; i < this.subFolds.length; i++) {\n cmp = this.subFolds[i].range.compare(row, column);\n if (cmp != 1)\n break;\n }\n var afterStart = this.subFolds[i];\n var firstConsumed = 0;\n if (cmp == 0) {\n if (afterStart.range.containsRange(fold))\n return afterStart.addSubFold(fold);\n else\n firstConsumed = 1;\n }\n var row = fold.range.end.row, column = fold.range.end.column;\n for (var j = i, cmp = -1; j < this.subFolds.length; j++) {\n cmp = this.subFolds[j].range.compare(row, column);\n if (cmp != 1)\n break;\n }\n if (cmp == 0)\n j++;\n var consumedFolds = this.subFolds.splice(i, j - i, fold);\n var last = cmp == 0 ? consumedFolds.length - 1 : consumedFolds.length;\n for (var k = firstConsumed; k < last; k++) {\n fold.addSubFold(consumedFolds[k]);\n }\n fold.setFoldLine(this.foldLine);\n return fold;\n };\n Fold.prototype.restoreRange = function (range) {\n return restoreRange(range, this.start);\n };\n return Fold;\n}(RangeList));\nfunction consumePoint(point, anchor) {\n point.row -= anchor.row;\n if (point.row == 0)\n point.column -= anchor.column;\n}\nfunction consumeRange(range, anchor) {\n consumePoint(range.start, anchor);\n consumePoint(range.end, anchor);\n}\nfunction restorePoint(point, anchor) {\n if (point.row == 0)\n point.column += anchor.column;\n point.row += anchor.row;\n}\nfunction restoreRange(range, anchor) {\n restorePoint(range.start, anchor);\n restorePoint(range.end, anchor);\n}\nexports.Fold = Fold;\n\n});\n\nace.define(\"ace/edit_session/folding\",[\"require\",\"exports\",\"module\",\"ace/range\",\"ace/edit_session/fold_line\",\"ace/edit_session/fold\",\"ace/token_iterator\",\"ace/mouse/mouse_event\"], function(require, exports, module){// @ts-nocheck\n\"use strict\";\nvar Range = require(\"../range\").Range;\nvar FoldLine = require(\"./fold_line\").FoldLine;\nvar Fold = require(\"./fold\").Fold;\nvar TokenIterator = require(\"../token_iterator\").TokenIterator;\nvar MouseEvent = require(\"../mouse/mouse_event\").MouseEvent;\nfunction Folding() {\n this.getFoldAt = function (row, column, side) {\n var foldLine = this.getFoldLine(row);\n if (!foldLine)\n return null;\n var folds = foldLine.folds;\n for (var i = 0; i < folds.length; i++) {\n var range = folds[i].range;\n if (range.contains(row, column)) {\n if (side == 1 && range.isEnd(row, column) && !range.isEmpty()) {\n continue;\n }\n else if (side == -1 && range.isStart(row, column) && !range.isEmpty()) {\n continue;\n }\n return folds[i];\n }\n }\n };\n this.getFoldsInRange = function (range) {\n var start = range.start;\n var end = range.end;\n var foldLines = this.$foldData;\n var foundFolds = [];\n start.column += 1;\n end.column -= 1;\n for (var i = 0; i < foldLines.length; i++) {\n var cmp = foldLines[i].range.compareRange(range);\n if (cmp == 2) {\n continue;\n }\n else if (cmp == -2) {\n break;\n }\n var folds = foldLines[i].folds;\n for (var j = 0; j < folds.length; j++) {\n var fold = folds[j];\n cmp = fold.range.compareRange(range);\n if (cmp == -2) {\n break;\n }\n else if (cmp == 2) {\n continue;\n }\n else \n if (cmp == 42) {\n break;\n }\n foundFolds.push(fold);\n }\n }\n start.column -= 1;\n end.column += 1;\n return foundFolds;\n };\n this.getFoldsInRangeList = function (ranges) {\n if (Array.isArray(ranges)) {\n var folds = [];\n ranges.forEach(function (range) {\n folds = folds.concat(this.getFoldsInRange(range));\n }, this);\n }\n else {\n var folds = this.getFoldsInRange(ranges);\n }\n return folds;\n };\n this.getAllFolds = function () {\n var folds = [];\n var foldLines = this.$foldData;\n for (var i = 0; i < foldLines.length; i++)\n for (var j = 0; j < foldLines[i].folds.length; j++)\n folds.push(foldLines[i].folds[j]);\n return folds;\n };\n this.getFoldStringAt = function (row, column, trim, foldLine) {\n foldLine = foldLine || this.getFoldLine(row);\n if (!foldLine)\n return null;\n var lastFold = {\n end: { column: 0 }\n };\n var str, fold;\n for (var i = 0; i < foldLine.folds.length; i++) {\n fold = foldLine.folds[i];\n var cmp = fold.range.compareEnd(row, column);\n if (cmp == -1) {\n str = this\n .getLine(fold.start.row)\n .substring(lastFold.end.column, fold.start.column);\n break;\n }\n else if (cmp === 0) {\n return null;\n }\n lastFold = fold;\n }\n if (!str)\n str = this.getLine(fold.start.row).substring(lastFold.end.column);\n if (trim == -1)\n return str.substring(0, column - lastFold.end.column);\n else if (trim == 1)\n return str.substring(column - lastFold.end.column);\n else\n return str;\n };\n this.getFoldLine = function (docRow, startFoldLine) {\n var foldData = this.$foldData;\n var i = 0;\n if (startFoldLine)\n i = foldData.indexOf(startFoldLine);\n if (i == -1)\n i = 0;\n for (i; i < foldData.length; i++) {\n var foldLine = foldData[i];\n if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) {\n return foldLine;\n }\n else if (foldLine.end.row > docRow) {\n return null;\n }\n }\n return null;\n };\n this.getNextFoldLine = function (docRow, startFoldLine) {\n var foldData = this.$foldData;\n var i = 0;\n if (startFoldLine)\n i = foldData.indexOf(startFoldLine);\n if (i == -1)\n i = 0;\n for (i; i < foldData.length; i++) {\n var foldLine = foldData[i];\n if (foldLine.end.row >= docRow) {\n return foldLine;\n }\n }\n return null;\n };\n this.getFoldedRowCount = function (first, last) {\n var foldData = this.$foldData, rowCount = last - first + 1;\n for (var i = 0; i < foldData.length; i++) {\n var foldLine = foldData[i], end = foldLine.end.row, start = foldLine.start.row;\n if (end >= last) {\n if (start < last) {\n if (start >= first)\n rowCount -= last - start;\n else\n rowCount = 0; // in one fold\n }\n break;\n }\n else if (end >= first) {\n if (start >= first) // fold inside range\n rowCount -= end - start;\n else\n rowCount -= end - first + 1;\n }\n }\n return rowCount;\n };\n this.$addFoldLine = function (foldLine) {\n this.$foldData.push(foldLine);\n this.$foldData.sort(function (a, b) {\n return a.start.row - b.start.row;\n });\n return foldLine;\n };\n this.addFold = function (placeholder, range) {\n var foldData = this.$foldData;\n var added = false;\n var fold;\n if (placeholder instanceof Fold)\n fold = placeholder;\n else {\n fold = new Fold(range, placeholder);\n fold.collapseChildren = range.collapseChildren;\n }\n this.$clipRangeToDocument(fold.range);\n var startRow = fold.start.row;\n var startColumn = fold.start.column;\n var endRow = fold.end.row;\n var endColumn = fold.end.column;\n var startFold = this.getFoldAt(startRow, startColumn, 1);\n var endFold = this.getFoldAt(endRow, endColumn, -1);\n if (startFold && endFold == startFold)\n return startFold.addSubFold(fold);\n if (startFold && !startFold.range.isStart(startRow, startColumn))\n this.removeFold(startFold);\n if (endFold && !endFold.range.isEnd(endRow, endColumn))\n this.removeFold(endFold);\n var folds = this.getFoldsInRange(fold.range);\n if (folds.length > 0) {\n this.removeFolds(folds);\n if (!fold.collapseChildren) {\n folds.forEach(function (subFold) {\n fold.addSubFold(subFold);\n });\n }\n }\n for (var i = 0; i < foldData.length; i++) {\n var foldLine = foldData[i];\n if (endRow == foldLine.start.row) {\n foldLine.addFold(fold);\n added = true;\n break;\n }\n else if (startRow == foldLine.end.row) {\n foldLine.addFold(fold);\n added = true;\n if (!fold.sameRow) {\n var foldLineNext = foldData[i + 1];\n if (foldLineNext && foldLineNext.start.row == endRow) {\n foldLine.merge(foldLineNext);\n break;\n }\n }\n break;\n }\n else if (endRow <= foldLine.start.row) {\n break;\n }\n }\n if (!added)\n foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold));\n if (this.$useWrapMode)\n this.$updateWrapData(foldLine.start.row, foldLine.start.row);\n else\n this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row);\n this.$modified = true;\n this._signal(\"changeFold\", { data: fold, action: \"add\" });\n return fold;\n };\n this.addFolds = function (folds) {\n folds.forEach(function (fold) {\n this.addFold(fold);\n }, this);\n };\n this.removeFold = function (fold) {\n var foldLine = fold.foldLine;\n var startRow = foldLine.start.row;\n var endRow = foldLine.end.row;\n var foldLines = this.$foldData;\n var folds = foldLine.folds;\n if (folds.length == 1) {\n foldLines.splice(foldLines.indexOf(foldLine), 1);\n }\n else \n if (foldLine.range.isEnd(fold.end.row, fold.end.column)) {\n folds.pop();\n foldLine.end.row = folds[folds.length - 1].end.row;\n foldLine.end.column = folds[folds.length - 1].end.column;\n }\n else \n if (foldLine.range.isStart(fold.start.row, fold.start.column)) {\n folds.shift();\n foldLine.start.row = folds[0].start.row;\n foldLine.start.column = folds[0].start.column;\n }\n else \n if (fold.sameRow) {\n folds.splice(folds.indexOf(fold), 1);\n }\n else \n {\n var newFoldLine = foldLine.split(fold.start.row, fold.start.column);\n folds = newFoldLine.folds;\n folds.shift();\n newFoldLine.start.row = folds[0].start.row;\n newFoldLine.start.column = folds[0].start.column;\n }\n if (!this.$updating) {\n if (this.$useWrapMode)\n this.$updateWrapData(startRow, endRow);\n else\n this.$updateRowLengthCache(startRow, endRow);\n }\n this.$modified = true;\n this._signal(\"changeFold\", { data: fold, action: \"remove\" });\n };\n this.removeFolds = function (folds) {\n var cloneFolds = [];\n for (var i = 0; i < folds.length; i++) {\n cloneFolds.push(folds[i]);\n }\n cloneFolds.forEach(function (fold) {\n this.removeFold(fold);\n }, this);\n this.$modified = true;\n };\n this.expandFold = function (fold) {\n this.removeFold(fold);\n fold.subFolds.forEach(function (subFold) {\n fold.restoreRange(subFold);\n this.addFold(subFold);\n }, this);\n if (fold.collapseChildren > 0) {\n this.foldAll(fold.start.row + 1, fold.end.row, fold.collapseChildren - 1);\n }\n fold.subFolds = [];\n };\n this.expandFolds = function (folds) {\n folds.forEach(function (fold) {\n this.expandFold(fold);\n }, this);\n };\n this.unfold = function (location, expandInner) {\n var range, folds;\n if (location == null) {\n range = new Range(0, 0, this.getLength(), 0);\n if (expandInner == null)\n expandInner = true;\n }\n else if (typeof location == \"number\") {\n range = new Range(location, 0, location, this.getLine(location).length);\n }\n else if (\"row\" in location) {\n range = Range.fromPoints(location, location);\n }\n else if (Array.isArray(location)) {\n folds = [];\n location.forEach(function (range) {\n folds = folds.concat(this.unfold(range));\n }, this);\n return folds;\n }\n else {\n range = location;\n }\n folds = this.getFoldsInRangeList(range);\n var outermostFolds = folds;\n while (folds.length == 1\n && Range.comparePoints(folds[0].start, range.start) < 0\n && Range.comparePoints(folds[0].end, range.end) > 0) {\n this.expandFolds(folds);\n folds = this.getFoldsInRangeList(range);\n }\n if (expandInner != false) {\n this.removeFolds(folds);\n }\n else {\n this.expandFolds(folds);\n }\n if (outermostFolds.length)\n return outermostFolds;\n };\n this.isRowFolded = function (docRow, startFoldRow) {\n return !!this.getFoldLine(docRow, startFoldRow);\n };\n this.getRowFoldEnd = function (docRow, startFoldRow) {\n var foldLine = this.getFoldLine(docRow, startFoldRow);\n return foldLine ? foldLine.end.row : docRow;\n };\n this.getRowFoldStart = function (docRow, startFoldRow) {\n var foldLine = this.getFoldLine(docRow, startFoldRow);\n return foldLine ? foldLine.start.row : docRow;\n };\n this.getFoldDisplayLine = function (foldLine, endRow, endColumn, startRow, startColumn) {\n if (startRow == null)\n startRow = foldLine.start.row;\n if (startColumn == null)\n startColumn = 0;\n if (endRow == null)\n endRow = foldLine.end.row;\n if (endColumn == null)\n endColumn = this.getLine(endRow).length;\n var doc = this.doc;\n var textLine = \"\";\n foldLine.walk(function (placeholder, row, column, lastColumn) {\n if (row < startRow)\n return;\n if (row == startRow) {\n if (column < startColumn)\n return;\n lastColumn = Math.max(startColumn, lastColumn);\n }\n if (placeholder != null) {\n textLine += placeholder;\n }\n else {\n textLine += doc.getLine(row).substring(lastColumn, column);\n }\n }, endRow, endColumn);\n return textLine;\n };\n this.getDisplayLine = function (row, endColumn, startRow, startColumn) {\n var foldLine = this.getFoldLine(row);\n if (!foldLine) {\n var line;\n line = this.doc.getLine(row);\n return line.substring(startColumn || 0, endColumn || line.length);\n }\n else {\n return this.getFoldDisplayLine(foldLine, row, endColumn, startRow, startColumn);\n }\n };\n this.$cloneFoldData = function () {\n var fd = [];\n fd = this.$foldData.map(function (foldLine) {\n var folds = foldLine.folds.map(function (fold) {\n return fold.clone();\n });\n return new FoldLine(fd, folds);\n });\n return fd;\n };\n this.toggleFold = function (tryToUnfold) {\n var selection = this.selection;\n var range = selection.getRange();\n var fold;\n var bracketPos;\n if (range.isEmpty()) {\n var cursor = range.start;\n fold = this.getFoldAt(cursor.row, cursor.column);\n if (fold) {\n this.expandFold(fold);\n return;\n }\n else if (bracketPos = this.findMatchingBracket(cursor)) {\n if (range.comparePoint(bracketPos) == 1) {\n range.end = bracketPos;\n }\n else {\n range.start = bracketPos;\n range.start.column++;\n range.end.column--;\n }\n }\n else if (bracketPos = this.findMatchingBracket({ row: cursor.row, column: cursor.column + 1 })) {\n if (range.comparePoint(bracketPos) == 1)\n range.end = bracketPos;\n else\n range.start = bracketPos;\n range.start.column++;\n }\n else {\n range = this.getCommentFoldRange(cursor.row, cursor.column) || range;\n }\n }\n else {\n var folds = this.getFoldsInRange(range);\n if (tryToUnfold && folds.length) {\n this.expandFolds(folds);\n return;\n }\n else if (folds.length == 1) {\n fold = folds[0];\n }\n }\n if (!fold)\n fold = this.getFoldAt(range.start.row, range.start.column);\n if (fold && fold.range.toString() == range.toString()) {\n this.expandFold(fold);\n return;\n }\n var placeholder = \"...\";\n if (!range.isMultiLine()) {\n placeholder = this.getTextRange(range);\n if (placeholder.length < 4)\n return;\n placeholder = placeholder.trim().substring(0, 2) + \"..\";\n }\n this.addFold(placeholder, range);\n };\n this.getCommentFoldRange = function (row, column, dir) {\n var iterator = new TokenIterator(this, row, column);\n var token = iterator.getCurrentToken();\n var type = token && token.type;\n if (token && /^comment|string/.test(type)) {\n type = type.match(/comment|string/)[0];\n if (type == \"comment\")\n type += \"|doc-start|\\\\.doc\";\n var re = new RegExp(type);\n var range = new Range();\n if (dir != 1) {\n do {\n token = iterator.stepBackward();\n } while (token && re.test(token.type) && !/^comment.end/.test(token.type));\n token = iterator.stepForward();\n }\n range.start.row = iterator.getCurrentTokenRow();\n range.start.column = iterator.getCurrentTokenColumn() + (/^comment.start/.test(token.type) ? token.value.length : 2);\n iterator = new TokenIterator(this, row, column);\n if (dir != -1) {\n var lastRow = -1;\n do {\n token = iterator.stepForward();\n if (lastRow == -1) {\n var state = this.getState(iterator.$row);\n if (!re.test(state))\n lastRow = iterator.$row;\n }\n else if (iterator.$row > lastRow) {\n break;\n }\n } while (token && re.test(token.type) && !/^comment.start/.test(token.type));\n token = iterator.stepBackward();\n }\n else\n token = iterator.getCurrentToken();\n range.end.row = iterator.getCurrentTokenRow();\n range.end.column = iterator.getCurrentTokenColumn();\n if (!/^comment.end/.test(token.type)) {\n range.end.column += token.value.length - 2;\n }\n return range;\n }\n };\n this.foldAll = function (startRow, endRow, depth, test) {\n if (depth == undefined)\n depth = 100000; // JSON.stringify doesn't hanle Infinity\n var foldWidgets = this.foldWidgets;\n if (!foldWidgets)\n return; // mode doesn't support folding\n endRow = endRow || this.getLength();\n startRow = startRow || 0;\n for (var row = startRow; row < endRow; row++) {\n if (foldWidgets[row] == null)\n foldWidgets[row] = this.getFoldWidget(row);\n if (foldWidgets[row] != \"start\")\n continue;\n if (test && !test(row))\n continue;\n var range = this.getFoldWidgetRange(row);\n if (range && range.isMultiLine()\n && range.end.row <= endRow\n && range.start.row >= startRow) {\n row = range.end.row;\n range.collapseChildren = depth;\n this.addFold(\"...\", range);\n }\n }\n };\n this.foldToLevel = function (level) {\n this.foldAll();\n while (level-- > 0)\n this.unfold(null, false);\n };\n this.foldAllComments = function () {\n var session = this;\n this.foldAll(null, null, null, function (row) {\n var tokens = session.getTokens(row);\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n if (token.type == \"text\" && /^\\s+$/.test(token.value))\n continue;\n if (/comment/.test(token.type))\n return true;\n return false;\n }\n });\n };\n this.$foldStyles = {\n \"manual\": 1,\n \"markbegin\": 1,\n \"markbeginend\": 1\n };\n this.$foldStyle = \"markbegin\";\n this.setFoldStyle = function (style) {\n if (!this.$foldStyles[style])\n throw new Error(\"invalid fold style: \" + style + \"[\" + Object.keys(this.$foldStyles).join(\", \") + \"]\");\n if (this.$foldStyle == style)\n return;\n this.$foldStyle = style;\n if (style == \"manual\")\n this.unfold();\n var mode = this.$foldMode;\n this.$setFolding(null);\n this.$setFolding(mode);\n };\n this.$setFolding = function (foldMode) {\n if (this.$foldMode == foldMode)\n return;\n this.$foldMode = foldMode;\n this.off('change', this.$updateFoldWidgets);\n this.off('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets);\n this._signal(\"changeAnnotation\");\n if (!foldMode || this.$foldStyle == \"manual\") {\n this.foldWidgets = null;\n return;\n }\n this.foldWidgets = [];\n this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle);\n this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle);\n this.$updateFoldWidgets = this.updateFoldWidgets.bind(this);\n this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this);\n this.on('change', this.$updateFoldWidgets);\n this.on('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets);\n };\n this.getParentFoldRangeData = function (row, ignoreCurrent) {\n var fw = this.foldWidgets;\n if (!fw || (ignoreCurrent && fw[row]))\n return {};\n var i = row - 1, firstRange;\n while (i >= 0) {\n var c = fw[i];\n if (c == null)\n c = fw[i] = this.getFoldWidget(i);\n if (c == \"start\") {\n var range = this.getFoldWidgetRange(i);\n if (!firstRange)\n firstRange = range;\n if (range && range.end.row >= row)\n break;\n }\n i--;\n }\n return {\n range: i !== -1 && range,\n firstRange: firstRange\n };\n };\n this.onFoldWidgetClick = function (row, e) {\n if (e instanceof MouseEvent)\n e = e.domEvent;\n var options = {\n children: e.shiftKey,\n all: e.ctrlKey || e.metaKey,\n siblings: e.altKey\n };\n var range = this.$toggleFoldWidget(row, options);\n if (!range) {\n var el = (e.target || e.srcElement);\n if (el && /ace_fold-widget/.test(el.className))\n el.className += \" ace_invalid\";\n }\n };\n this.$toggleFoldWidget = function (row, options) {\n if (!this.getFoldWidget)\n return;\n var type = this.getFoldWidget(row);\n var line = this.getLine(row);\n var dir = type === \"end\" ? -1 : 1;\n var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir);\n if (fold) {\n if (options.children || options.all)\n this.removeFold(fold);\n else\n this.expandFold(fold);\n return fold;\n }\n var range = this.getFoldWidgetRange(row, true);\n if (range && !range.isMultiLine()) {\n fold = this.getFoldAt(range.start.row, range.start.column, 1);\n if (fold && range.isEqual(fold.range)) {\n this.removeFold(fold);\n return fold;\n }\n }\n if (options.siblings) {\n var data = this.getParentFoldRangeData(row);\n if (data.range) {\n var startRow = data.range.start.row + 1;\n var endRow = data.range.end.row;\n }\n this.foldAll(startRow, endRow, options.all ? 10000 : 0);\n }\n else if (options.children) {\n endRow = range ? range.end.row : this.getLength();\n this.foldAll(row + 1, endRow, options.all ? 10000 : 0);\n }\n else if (range) {\n if (options.all)\n range.collapseChildren = 10000;\n this.addFold(\"...\", range);\n }\n return range;\n };\n this.toggleFoldWidget = function (toggleParent) {\n var row = this.selection.getCursor().row;\n row = this.getRowFoldStart(row);\n var range = this.$toggleFoldWidget(row, {});\n if (range)\n return;\n var data = this.getParentFoldRangeData(row, true);\n range = data.range || data.firstRange;\n if (range) {\n row = range.start.row;\n var fold = this.getFoldAt(row, this.getLine(row).length, 1);\n if (fold) {\n this.removeFold(fold);\n }\n else {\n this.addFold(\"...\", range);\n }\n }\n };\n this.updateFoldWidgets = function (delta) {\n var firstRow = delta.start.row;\n var len = delta.end.row - firstRow;\n if (len === 0) {\n this.foldWidgets[firstRow] = null;\n }\n else if (delta.action == 'remove') {\n this.foldWidgets.splice(firstRow, len + 1, null);\n }\n else {\n var args = Array(len + 1);\n args.unshift(firstRow, 1);\n this.foldWidgets.splice.apply(this.foldWidgets, args);\n }\n };\n this.tokenizerUpdateFoldWidgets = function (e) {\n var rows = e.data;\n if (rows.first != rows.last) {\n if (this.foldWidgets.length > rows.first)\n this.foldWidgets.splice(rows.first, this.foldWidgets.length);\n }\n };\n}\nexports.Folding = Folding;\n\n});\n\nace.define(\"ace/edit_session/bracket_match\",[\"require\",\"exports\",\"module\",\"ace/token_iterator\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar TokenIterator = require(\"../token_iterator\").TokenIterator;\nvar Range = require(\"../range\").Range;\nfunction BracketMatch() {\n this.findMatchingBracket = function (position, chr) {\n if (position.column == 0)\n return null;\n var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column - 1);\n if (charBeforeCursor == \"\")\n return null;\n var match = charBeforeCursor.match(/([\\(\\[\\{])|([\\)\\]\\}])/);\n if (!match)\n return null;\n if (match[1])\n return this.$findClosingBracket(match[1], position);\n else\n return this.$findOpeningBracket(match[2], position);\n };\n this.getBracketRange = function (pos) {\n var line = this.getLine(pos.row);\n var before = true, range;\n var chr = line.charAt(pos.column - 1);\n var match = chr && chr.match(/([\\(\\[\\{])|([\\)\\]\\}])/);\n if (!match) {\n chr = line.charAt(pos.column);\n pos = { row: pos.row, column: pos.column + 1 };\n match = chr && chr.match(/([\\(\\[\\{])|([\\)\\]\\}])/);\n before = false;\n }\n if (!match)\n return null;\n if (match[1]) {\n var bracketPos = this.$findClosingBracket(match[1], pos);\n if (!bracketPos)\n return null;\n range = Range.fromPoints(pos, bracketPos);\n if (!before) {\n range.end.column++;\n range.start.column--;\n }\n range.cursor = range.end;\n }\n else {\n var bracketPos = this.$findOpeningBracket(match[2], pos);\n if (!bracketPos)\n return null;\n range = Range.fromPoints(bracketPos, pos);\n if (!before) {\n range.start.column++;\n range.end.column--;\n }\n range.cursor = range.start;\n }\n return range;\n };\n this.getMatchingBracketRanges = function (pos, isBackwards) {\n var line = this.getLine(pos.row);\n var bracketsRegExp = /([\\(\\[\\{])|([\\)\\]\\}])/;\n var chr = !isBackwards && line.charAt(pos.column - 1);\n var match = chr && chr.match(bracketsRegExp);\n if (!match) {\n chr = (isBackwards === undefined || isBackwards) && line.charAt(pos.column);\n pos = {\n row: pos.row,\n column: pos.column + 1\n };\n match = chr && chr.match(bracketsRegExp);\n }\n if (!match)\n return null;\n var startRange = new Range(pos.row, pos.column - 1, pos.row, pos.column);\n var bracketPos = match[1] ? this.$findClosingBracket(match[1], pos)\n : this.$findOpeningBracket(match[2], pos);\n if (!bracketPos)\n return [startRange];\n var endRange = new Range(bracketPos.row, bracketPos.column, bracketPos.row, bracketPos.column + 1);\n return [startRange, endRange];\n };\n this.$brackets = {\n \")\": \"(\",\n \"(\": \")\",\n \"]\": \"[\",\n \"[\": \"]\",\n \"{\": \"}\",\n \"}\": \"{\",\n \"<\": \">\",\n \">\": \"<\"\n };\n this.$findOpeningBracket = function (bracket, position, typeRe) {\n var openBracket = this.$brackets[bracket];\n var depth = 1;\n var iterator = new TokenIterator(this, position.row, position.column);\n var token = iterator.getCurrentToken();\n if (!token)\n token = iterator.stepForward();\n if (!token)\n return;\n if (!typeRe) {\n typeRe = new RegExp(\"(\\\\.?\" +\n token.type.replace(\".\", \"\\\\.\").replace(\"rparen\", \".paren\")\n .replace(/\\b(?:end)\\b/, \"(?:start|begin|end)\")\n .replace(/-close\\b/, \"-(close|open)\")\n + \")+\");\n }\n var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2;\n var value = token.value;\n while (true) {\n while (valueIndex >= 0) {\n var chr = value.charAt(valueIndex);\n if (chr == openBracket) {\n depth -= 1;\n if (depth == 0) {\n return { row: iterator.getCurrentTokenRow(),\n column: valueIndex + iterator.getCurrentTokenColumn() };\n }\n }\n else if (chr == bracket) {\n depth += 1;\n }\n valueIndex -= 1;\n }\n do {\n token = iterator.stepBackward();\n } while (token && !typeRe.test(token.type));\n if (token == null)\n break;\n value = token.value;\n valueIndex = value.length - 1;\n }\n return null;\n };\n this.$findClosingBracket = function (bracket, position, typeRe) {\n var closingBracket = this.$brackets[bracket];\n var depth = 1;\n var iterator = new TokenIterator(this, position.row, position.column);\n var token = iterator.getCurrentToken();\n if (!token)\n token = iterator.stepForward();\n if (!token)\n return;\n if (!typeRe) {\n typeRe = new RegExp(\"(\\\\.?\" +\n token.type.replace(\".\", \"\\\\.\").replace(\"lparen\", \".paren\")\n .replace(/\\b(?:start|begin)\\b/, \"(?:start|begin|end)\")\n .replace(/-open\\b/, \"-(close|open)\")\n + \")+\");\n }\n var valueIndex = position.column - iterator.getCurrentTokenColumn();\n while (true) {\n var value = token.value;\n var valueLength = value.length;\n while (valueIndex < valueLength) {\n var chr = value.charAt(valueIndex);\n if (chr == closingBracket) {\n depth -= 1;\n if (depth == 0) {\n return { row: iterator.getCurrentTokenRow(),\n column: valueIndex + iterator.getCurrentTokenColumn() };\n }\n }\n else if (chr == bracket) {\n depth += 1;\n }\n valueIndex += 1;\n }\n do {\n token = iterator.stepForward();\n } while (token && !typeRe.test(token.type));\n if (token == null)\n break;\n valueIndex = 0;\n }\n return null;\n };\n this.getMatchingTags = function (pos) {\n var iterator = new TokenIterator(this, pos.row, pos.column);\n var token = this.$findTagName(iterator);\n if (!token)\n return;\n var prevToken = iterator.stepBackward();\n if (prevToken.value === '<') {\n return this.$findClosingTag(iterator, token);\n }\n else {\n return this.$findOpeningTag(iterator, token);\n }\n };\n this.$findTagName = function (iterator) {\n var token = iterator.getCurrentToken();\n var found = false;\n var backward = false;\n if (token && token.type.indexOf('tag-name') === -1) {\n do {\n if (backward)\n token = iterator.stepBackward();\n else\n token = iterator.stepForward();\n if (token) {\n if (token.value === \"/>\") {\n backward = true;\n }\n else if (token.type.indexOf('tag-name') !== -1) {\n found = true;\n }\n }\n } while (token && !found);\n }\n return token;\n };\n this.$findClosingTag = function (iterator, token) {\n var prevToken;\n var currentTag = token.value;\n var tag = token.value;\n var depth = 0;\n var openTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1);\n token = iterator.stepForward();\n var openTagName = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);\n var foundOpenTagEnd = false;\n do {\n prevToken = token;\n if (prevToken.type.indexOf('tag-close') !== -1 && !foundOpenTagEnd) {\n var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for `>`\n foundOpenTagEnd = true;\n }\n token = iterator.stepForward();\n if (token) {\n if (token.value === '>' && !foundOpenTagEnd) {\n var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for `>`\n foundOpenTagEnd = true;\n }\n if (token.type.indexOf('tag-name') !== -1) {\n currentTag = token.value;\n if (tag === currentTag) {\n if (prevToken.value === '<') {\n depth++;\n }\n else if (prevToken.value === '') {\n var closeTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >\n }\n else {\n return;\n }\n }\n }\n }\n }\n else if (tag === currentTag && token.value === '/>') { // self-closing tag\n depth--;\n if (depth < 0) { //found self-closing tag end\n var closeTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 2);\n var closeTagName = closeTagStart;\n var closeTagEnd = closeTagName;\n var openTagEnd = new Range(openTagName.end.row, openTagName.end.column, openTagName.end.row, openTagName.end.column + 1);\n }\n }\n }\n } while (token && depth >= 0);\n if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) {\n return {\n openTag: new Range(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column),\n closeTag: new Range(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column),\n openTagName: openTagName,\n closeTagName: closeTagName\n };\n }\n };\n this.$findOpeningTag = function (iterator, token) {\n var prevToken = iterator.getCurrentToken();\n var tag = token.value;\n var depth = 0;\n var startRow = iterator.getCurrentTokenRow();\n var startColumn = iterator.getCurrentTokenColumn();\n var endColumn = startColumn + 2;\n var closeTagStart = new Range(startRow, startColumn, startRow, endColumn); //Range for \")\n return;\n var closeTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >\n iterator.stepBackward();\n iterator.stepBackward();\n do {\n token = prevToken;\n startRow = iterator.getCurrentTokenRow();\n startColumn = iterator.getCurrentTokenColumn();\n endColumn = startColumn + token.value.length;\n prevToken = iterator.stepBackward();\n if (token) {\n if (token.type.indexOf('tag-name') !== -1) {\n if (tag === token.value) {\n if (prevToken.value === '<') {\n depth++;\n if (depth > 0) { //found opening tag\n var openTagName = new Range(startRow, startColumn, startRow, endColumn);\n var openTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for <\n do {\n token = iterator.stepForward();\n } while (token && token.value !== '>');\n var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >\n }\n }\n else if (prevToken.value === '') { // self-closing tag\n var stepCount = 0;\n var tmpToken = prevToken;\n while (tmpToken) {\n if (tmpToken.type.indexOf('tag-name') !== -1 && tmpToken.value === tag) {\n depth--;\n break;\n }\n else if (tmpToken.value === '<') {\n break;\n }\n tmpToken = iterator.stepBackward();\n stepCount++;\n }\n for (var i = 0; i < stepCount; i++) {\n iterator.stepForward();\n }\n }\n }\n } while (prevToken && depth <= 0);\n if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) {\n return {\n openTag: new Range(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column),\n closeTag: new Range(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column),\n openTagName: openTagName,\n closeTagName: closeTagName\n };\n }\n };\n}\nexports.BracketMatch = BracketMatch;\n\n});\n\nace.define(\"ace/edit_session\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/bidihandler\",\"ace/config\",\"ace/lib/event_emitter\",\"ace/selection\",\"ace/mode/text\",\"ace/range\",\"ace/document\",\"ace/background_tokenizer\",\"ace/search_highlight\",\"ace/undomanager\",\"ace/edit_session/folding\",\"ace/edit_session/bracket_match\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar lang = require(\"./lib/lang\");\nvar BidiHandler = require(\"./bidihandler\").BidiHandler;\nvar config = require(\"./config\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Selection = require(\"./selection\").Selection;\nvar TextMode = require(\"./mode/text\").Mode;\nvar Range = require(\"./range\").Range;\nvar Document = require(\"./document\").Document;\nvar BackgroundTokenizer = require(\"./background_tokenizer\").BackgroundTokenizer;\nvar SearchHighlight = require(\"./search_highlight\").SearchHighlight;\nvar UndoManager = require(\"./undomanager\").UndoManager;\nvar EditSession = /** @class */ (function () {\n function EditSession(text, mode) { this.doc;\n this.$breakpoints = [];\n this.$decorations = [];\n this.$frontMarkers = {};\n this.$backMarkers = {};\n this.$markerId = 1;\n this.$undoSelect = true;\n this.$foldData = [];\n this.id = \"session\" + (++EditSession.$uid);\n this.$foldData.toString = function () {\n return this.join(\"\\n\");\n };\n this.bgTokenizer = new BackgroundTokenizer((new TextMode()).getTokenizer(), this);\n var _self = this;\n this.bgTokenizer.on(\"update\", function (e) {\n _self._signal(\"tokenizerUpdate\", e);\n });\n this.on(\"changeFold\", this.onChangeFold.bind(this));\n this.$onChange = this.onChange.bind(this);\n if (typeof text != \"object\" || !text.getLine)\n text = new Document(/**@type{string}*/ (text));\n this.setDocument(text);\n this.selection = new Selection(this);\n this.$bidiHandler = new BidiHandler(this);\n config.resetOptions(this);\n this.setMode(mode);\n config._signal(\"session\", this);\n this.destroyed = false;\n }\n EditSession.prototype.setDocument = function (doc) {\n if (this.doc)\n this.doc.off(\"change\", this.$onChange);\n this.doc = doc;\n doc.on(\"change\", this.$onChange, true);\n this.bgTokenizer.setDocument(this.getDocument());\n this.resetCaches();\n };\n EditSession.prototype.getDocument = function () {\n return this.doc;\n };\n EditSession.prototype.$resetRowCache = function (docRow) {\n if (!docRow) {\n this.$docRowCache = [];\n this.$screenRowCache = [];\n return;\n }\n var l = this.$docRowCache.length;\n var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1;\n if (l > i) {\n this.$docRowCache.splice(i, l);\n this.$screenRowCache.splice(i, l);\n }\n };\n EditSession.prototype.$getRowCacheIndex = function (cacheArray, val) {\n var low = 0;\n var hi = cacheArray.length - 1;\n while (low <= hi) {\n var mid = (low + hi) >> 1;\n var c = cacheArray[mid];\n if (val > c)\n low = mid + 1;\n else if (val < c)\n hi = mid - 1;\n else\n return mid;\n }\n return low - 1;\n };\n EditSession.prototype.resetCaches = function () {\n this.$modified = true;\n this.$wrapData = [];\n this.$rowLengthCache = [];\n this.$resetRowCache(0);\n if (!this.destroyed)\n this.bgTokenizer.start(0);\n };\n EditSession.prototype.onChangeFold = function (e) {\n var fold = e.data;\n this.$resetRowCache(fold.start.row);\n };\n EditSession.prototype.onChange = function (delta) {\n this.$modified = true;\n this.$bidiHandler.onChange(delta);\n this.$resetRowCache(delta.start.row);\n var removedFolds = this.$updateInternalDataOnChange(delta);\n if (!this.$fromUndo && this.$undoManager) {\n if (removedFolds && removedFolds.length) {\n this.$undoManager.add({\n action: \"removeFolds\",\n folds: removedFolds\n }, this.mergeUndoDeltas);\n this.mergeUndoDeltas = true;\n }\n this.$undoManager.add(delta, this.mergeUndoDeltas);\n this.mergeUndoDeltas = true;\n this.$informUndoManager.schedule();\n }\n this.bgTokenizer.$updateOnChange(delta);\n this._signal(\"change\", delta);\n };\n EditSession.prototype.setValue = function (text) {\n this.doc.setValue(text);\n this.selection.moveTo(0, 0);\n this.$resetRowCache(0);\n this.setUndoManager(this.$undoManager);\n this.getUndoManager().reset();\n };\n EditSession.fromJSON = function (session) {\n if (typeof session == \"string\")\n session = JSON.parse(session);\n var undoManager = new UndoManager();\n undoManager.$undoStack = session.history.undo;\n undoManager.$redoStack = session.history.redo;\n undoManager.mark = session.history.mark;\n undoManager.$rev = session.history.rev;\n var editSession = new EditSession(session.value);\n session.folds.forEach(function (fold) {\n editSession.addFold(\"...\", Range.fromPoints(fold.start, fold.end));\n });\n editSession.setAnnotations(session.annotations);\n editSession.setBreakpoints(session.breakpoints);\n editSession.setMode(session.mode);\n editSession.setScrollLeft(session.scrollLeft);\n editSession.setScrollTop(session.scrollTop);\n editSession.setUndoManager(undoManager);\n editSession.selection.fromJSON(session.selection);\n return editSession;\n };\n EditSession.prototype.toJSON = function () {\n return {\n annotations: this.$annotations,\n breakpoints: this.$breakpoints,\n folds: this.getAllFolds().map(function (fold) {\n return fold.range;\n }),\n history: this.getUndoManager(),\n mode: this.$mode.$id,\n scrollLeft: this.$scrollLeft,\n scrollTop: this.$scrollTop,\n selection: this.selection.toJSON(),\n value: this.doc.getValue()\n };\n };\n EditSession.prototype.toString = function () {\n return this.doc.getValue();\n };\n EditSession.prototype.getSelection = function () {\n return this.selection;\n };\n EditSession.prototype.getState = function (row) {\n return this.bgTokenizer.getState(row);\n };\n EditSession.prototype.getTokens = function (row) {\n return this.bgTokenizer.getTokens(row);\n };\n EditSession.prototype.getTokenAt = function (row, column) {\n var tokens = this.bgTokenizer.getTokens(row);\n var token, c = 0;\n if (column == null) {\n var i = tokens.length - 1;\n c = this.getLine(row).length;\n }\n else {\n for (var i = 0; i < tokens.length; i++) {\n c += tokens[i].value.length;\n if (c >= column)\n break;\n }\n }\n token = tokens[i];\n if (!token)\n return null;\n token.index = i;\n token.start = c - token.value.length;\n return token;\n };\n EditSession.prototype.setUndoManager = function (undoManager) {\n this.$undoManager = undoManager;\n if (this.$informUndoManager)\n this.$informUndoManager.cancel();\n if (undoManager) {\n var self = this;\n undoManager.addSession(this);\n this.$syncInformUndoManager = function () {\n self.$informUndoManager.cancel();\n self.mergeUndoDeltas = false;\n };\n this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager);\n }\n else {\n this.$syncInformUndoManager = function () { };\n }\n };\n EditSession.prototype.markUndoGroup = function () {\n if (this.$syncInformUndoManager)\n this.$syncInformUndoManager();\n };\n EditSession.prototype.getUndoManager = function () {\n return this.$undoManager || this.$defaultUndoManager;\n };\n EditSession.prototype.getTabString = function () {\n if (this.getUseSoftTabs()) {\n return lang.stringRepeat(\" \", this.getTabSize());\n }\n else {\n return \"\\t\";\n }\n };\n EditSession.prototype.setUseSoftTabs = function (val) {\n this.setOption(\"useSoftTabs\", val);\n };\n EditSession.prototype.getUseSoftTabs = function () {\n return this.$useSoftTabs && !this.$mode.$indentWithTabs;\n };\n EditSession.prototype.setTabSize = function (tabSize) {\n this.setOption(\"tabSize\", tabSize);\n };\n EditSession.prototype.getTabSize = function () {\n return this.$tabSize;\n };\n EditSession.prototype.isTabStop = function (position) {\n return this.$useSoftTabs && (position.column % this.$tabSize === 0);\n };\n EditSession.prototype.setNavigateWithinSoftTabs = function (navigateWithinSoftTabs) {\n this.setOption(\"navigateWithinSoftTabs\", navigateWithinSoftTabs);\n };\n EditSession.prototype.getNavigateWithinSoftTabs = function () {\n return this.$navigateWithinSoftTabs;\n };\n EditSession.prototype.setOverwrite = function (overwrite) {\n this.setOption(\"overwrite\", overwrite);\n };\n EditSession.prototype.getOverwrite = function () {\n return this.$overwrite;\n };\n EditSession.prototype.toggleOverwrite = function () {\n this.setOverwrite(!this.$overwrite);\n };\n EditSession.prototype.addGutterDecoration = function (row, className) {\n if (!this.$decorations[row])\n this.$decorations[row] = \"\";\n this.$decorations[row] += \" \" + className;\n this._signal(\"changeBreakpoint\", {});\n };\n EditSession.prototype.removeGutterDecoration = function (row, className) {\n this.$decorations[row] = (this.$decorations[row] || \"\").replace(\" \" + className, \"\");\n this._signal(\"changeBreakpoint\", {});\n };\n EditSession.prototype.getBreakpoints = function () {\n return this.$breakpoints;\n };\n EditSession.prototype.setBreakpoints = function (rows) {\n this.$breakpoints = [];\n for (var i = 0; i < rows.length; i++) {\n this.$breakpoints[rows[i]] = \"ace_breakpoint\";\n }\n this._signal(\"changeBreakpoint\", {});\n };\n EditSession.prototype.clearBreakpoints = function () {\n this.$breakpoints = [];\n this._signal(\"changeBreakpoint\", {});\n };\n EditSession.prototype.setBreakpoint = function (row, className) {\n if (className === undefined)\n className = \"ace_breakpoint\";\n if (className)\n this.$breakpoints[row] = className;\n else\n delete this.$breakpoints[row];\n this._signal(\"changeBreakpoint\", {});\n };\n EditSession.prototype.clearBreakpoint = function (row) {\n delete this.$breakpoints[row];\n this._signal(\"changeBreakpoint\", {});\n };\n EditSession.prototype.addMarker = function (range, clazz, type, inFront) {\n var id = this.$markerId++;\n var marker = {\n range: range,\n type: type || \"line\",\n renderer: typeof type == \"function\" ? type : null,\n clazz: clazz,\n inFront: !!inFront,\n id: id\n };\n if (inFront) {\n this.$frontMarkers[id] = marker;\n this._signal(\"changeFrontMarker\");\n }\n else {\n this.$backMarkers[id] = marker;\n this._signal(\"changeBackMarker\");\n }\n return id;\n };\n EditSession.prototype.addDynamicMarker = function (marker, inFront) {\n if (!marker.update)\n return;\n var id = this.$markerId++;\n marker.id = id;\n marker.inFront = !!inFront;\n if (inFront) {\n this.$frontMarkers[id] = marker;\n this._signal(\"changeFrontMarker\");\n }\n else {\n this.$backMarkers[id] = marker;\n this._signal(\"changeBackMarker\");\n }\n return marker;\n };\n EditSession.prototype.removeMarker = function (markerId) {\n var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId];\n if (!marker)\n return;\n var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers;\n delete (markers[markerId]);\n this._signal(marker.inFront ? \"changeFrontMarker\" : \"changeBackMarker\");\n };\n EditSession.prototype.getMarkers = function (inFront) {\n return inFront ? this.$frontMarkers : this.$backMarkers;\n };\n EditSession.prototype.highlight = function (re) {\n if (!this.$searchHighlight) {\n var highlight = new SearchHighlight(null, \"ace_selected-word\", \"text\");\n this.$searchHighlight = this.addDynamicMarker(highlight);\n }\n this.$searchHighlight.setRegexp(re);\n };\n EditSession.prototype.highlightLines = function (startRow, endRow, clazz, inFront) {\n if (typeof endRow != \"number\") {\n clazz = endRow;\n endRow = startRow;\n }\n if (!clazz)\n clazz = \"ace_step\";\n var range = new Range(startRow, 0, endRow, Infinity);\n range.id = this.addMarker(range, clazz, \"fullLine\", inFront);\n return range;\n };\n EditSession.prototype.setAnnotations = function (annotations) {\n this.$annotations = annotations;\n this._signal(\"changeAnnotation\", {});\n };\n EditSession.prototype.getAnnotations = function () {\n return this.$annotations || [];\n };\n EditSession.prototype.clearAnnotations = function () {\n this.setAnnotations([]);\n };\n EditSession.prototype.$detectNewLine = function (text) {\n var match = text.match(/^.*?(\\r?\\n)/m);\n if (match) {\n this.$autoNewLine = match[1];\n }\n else {\n this.$autoNewLine = \"\\n\";\n }\n };\n EditSession.prototype.getWordRange = function (row, column) {\n var line = this.getLine(row);\n var inToken = false;\n if (column > 0)\n inToken = !!line.charAt(column - 1).match(this.tokenRe);\n if (!inToken)\n inToken = !!line.charAt(column).match(this.tokenRe);\n if (inToken)\n var re = this.tokenRe;\n else if (/^\\s+$/.test(line.slice(column - 1, column + 1)))\n var re = /\\s/;\n else\n var re = this.nonTokenRe;\n var start = column;\n if (start > 0) {\n do {\n start--;\n } while (start >= 0 && line.charAt(start).match(re));\n start++;\n }\n var end = column;\n while (end < line.length && line.charAt(end).match(re)) {\n end++;\n }\n return new Range(row, start, row, end);\n };\n EditSession.prototype.getAWordRange = function (row, column) {\n var wordRange = this.getWordRange(row, column);\n var line = this.getLine(wordRange.end.row);\n while (line.charAt(wordRange.end.column).match(/[ \\t]/)) {\n wordRange.end.column += 1;\n }\n return wordRange;\n };\n EditSession.prototype.setNewLineMode = function (newLineMode) {\n this.doc.setNewLineMode(newLineMode);\n };\n EditSession.prototype.getNewLineMode = function () {\n return this.doc.getNewLineMode();\n };\n EditSession.prototype.setUseWorker = function (useWorker) { this.setOption(\"useWorker\", useWorker); };\n EditSession.prototype.getUseWorker = function () { return this.$useWorker; };\n EditSession.prototype.onReloadTokenizer = function (e) {\n var rows = e.data;\n this.bgTokenizer.start(rows.first);\n this._signal(\"tokenizerUpdate\", e);\n };\n EditSession.prototype.setMode = function (mode, cb) {\n if (mode && typeof mode === \"object\") {\n if (mode.getTokenizer)\n return this.$onChangeMode(mode);\n var options = mode;\n var path = options.path;\n }\n else {\n path = /**@type{string}*/ (mode) || \"ace/mode/text\";\n }\n if (!this.$modes[\"ace/mode/text\"])\n this.$modes[\"ace/mode/text\"] = new TextMode();\n if (this.$modes[path] && !options) {\n this.$onChangeMode(this.$modes[path]);\n cb && cb();\n return;\n }\n this.$modeId = path;\n config.loadModule([\"mode\", path], function (m) {\n if (this.$modeId !== path)\n return cb && cb();\n if (this.$modes[path] && !options) {\n this.$onChangeMode(this.$modes[path]);\n }\n else if (m && m.Mode) {\n m = new m.Mode(options);\n if (!options) {\n this.$modes[path] = m;\n m.$id = path;\n }\n this.$onChangeMode(m);\n }\n cb && cb();\n }.bind(this));\n if (!this.$mode)\n this.$onChangeMode(this.$modes[\"ace/mode/text\"], true);\n };\n EditSession.prototype.$onChangeMode = function (mode, $isPlaceholder) {\n if (!$isPlaceholder)\n this.$modeId = mode.$id;\n if (this.$mode === mode)\n return;\n var oldMode = this.$mode;\n this.$mode = mode;\n this.$stopWorker();\n if (this.$useWorker)\n this.$startWorker();\n var tokenizer = mode.getTokenizer();\n if (tokenizer.on !== undefined) {\n var onReloadTokenizer = this.onReloadTokenizer.bind(this);\n tokenizer.on(\"update\", onReloadTokenizer);\n }\n this.bgTokenizer.setTokenizer(tokenizer);\n this.bgTokenizer.setDocument(this.getDocument());\n this.tokenRe = mode.tokenRe;\n this.nonTokenRe = mode.nonTokenRe;\n if (!$isPlaceholder) {\n if (mode.attachToSession)\n mode.attachToSession(this);\n this.$options.wrapMethod.set.call(this, this.$wrapMethod);\n this.$setFolding(mode.foldingRules);\n this.bgTokenizer.start(0);\n this._emit(\"changeMode\", { oldMode: oldMode, mode: mode });\n }\n };\n EditSession.prototype.$stopWorker = function () {\n if (this.$worker) {\n this.$worker.terminate();\n this.$worker = null;\n }\n };\n EditSession.prototype.$startWorker = function () {\n try {\n this.$worker = this.$mode.createWorker(this);\n }\n catch (e) {\n config.warn(\"Could not load worker\", e);\n this.$worker = null;\n }\n };\n EditSession.prototype.getMode = function () {\n return this.$mode;\n };\n EditSession.prototype.setScrollTop = function (scrollTop) {\n if (this.$scrollTop === scrollTop || isNaN(scrollTop))\n return;\n this.$scrollTop = scrollTop;\n this._signal(\"changeScrollTop\", scrollTop);\n };\n EditSession.prototype.getScrollTop = function () {\n return this.$scrollTop;\n };\n EditSession.prototype.setScrollLeft = function (scrollLeft) {\n if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft))\n return;\n this.$scrollLeft = scrollLeft;\n this._signal(\"changeScrollLeft\", scrollLeft);\n };\n EditSession.prototype.getScrollLeft = function () {\n return this.$scrollLeft;\n };\n EditSession.prototype.getScreenWidth = function () {\n this.$computeWidth();\n if (this.lineWidgets)\n return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth);\n return this.screenWidth;\n };\n EditSession.prototype.getLineWidgetMaxWidth = function () {\n if (this.lineWidgetsWidth != null)\n return this.lineWidgetsWidth;\n var width = 0;\n this.lineWidgets.forEach(function (w) {\n if (w && w.screenWidth > width)\n width = w.screenWidth;\n });\n return this.lineWidgetWidth = width;\n };\n EditSession.prototype.$computeWidth = function (force) {\n if (this.$modified || force) {\n this.$modified = false;\n if (this.$useWrapMode)\n return this.screenWidth = this.$wrapLimit;\n var lines = this.doc.getAllLines();\n var cache = this.$rowLengthCache;\n var longestScreenLine = 0;\n var foldIndex = 0;\n var foldLine = this.$foldData[foldIndex];\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n var len = lines.length;\n for (var i = 0; i < len; i++) {\n if (i > foldStart) {\n i = foldLine.end.row + 1;\n if (i >= len)\n break;\n foldLine = this.$foldData[foldIndex++];\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n if (cache[i] == null)\n cache[i] = this.$getStringScreenWidth(lines[i])[0];\n if (cache[i] > longestScreenLine)\n longestScreenLine = cache[i];\n }\n this.screenWidth = longestScreenLine;\n }\n };\n EditSession.prototype.getLine = function (row) {\n return this.doc.getLine(row);\n };\n EditSession.prototype.getLines = function (firstRow, lastRow) {\n return this.doc.getLines(firstRow, lastRow);\n };\n EditSession.prototype.getLength = function () {\n return this.doc.getLength();\n };\n EditSession.prototype.getTextRange = function (range) {\n return this.doc.getTextRange(range || this.selection.getRange());\n };\n EditSession.prototype.insert = function (position, text) {\n return this.doc.insert(position, text);\n };\n EditSession.prototype.remove = function (range) {\n return this.doc.remove(range);\n };\n EditSession.prototype.removeFullLines = function (firstRow, lastRow) {\n return this.doc.removeFullLines(firstRow, lastRow);\n };\n EditSession.prototype.undoChanges = function (deltas, dontSelect) {\n if (!deltas.length)\n return;\n this.$fromUndo = true;\n for (var i = deltas.length - 1; i != -1; i--) {\n var delta = deltas[i];\n if (delta.action == \"insert\" || delta.action == \"remove\") {\n this.doc.revertDelta(delta);\n }\n else if (delta.folds) {\n this.addFolds(delta.folds);\n }\n }\n if (!dontSelect && this.$undoSelect) {\n if (deltas.selectionBefore)\n this.selection.fromJSON(deltas.selectionBefore);\n else\n this.selection.setRange(this.$getUndoSelection(deltas, true));\n }\n this.$fromUndo = false;\n };\n EditSession.prototype.redoChanges = function (deltas, dontSelect) {\n if (!deltas.length)\n return;\n this.$fromUndo = true;\n for (var i = 0; i < deltas.length; i++) {\n var delta = deltas[i];\n if (delta.action == \"insert\" || delta.action == \"remove\") {\n this.doc.$safeApplyDelta(delta);\n }\n }\n if (!dontSelect && this.$undoSelect) {\n if (deltas.selectionAfter)\n this.selection.fromJSON(deltas.selectionAfter);\n else\n this.selection.setRange(this.$getUndoSelection(deltas, false));\n }\n this.$fromUndo = false;\n };\n EditSession.prototype.setUndoSelect = function (enable) {\n this.$undoSelect = enable;\n };\n EditSession.prototype.$getUndoSelection = function (deltas, isUndo) {\n function isInsert(delta) {\n return isUndo ? delta.action !== \"insert\" : delta.action === \"insert\";\n }\n var range, point;\n for (var i = 0; i < deltas.length; i++) {\n var delta = deltas[i];\n if (!delta.start)\n continue; // skip folds\n if (!range) {\n if (isInsert(delta)) {\n range = Range.fromPoints(delta.start, delta.end);\n }\n else {\n range = Range.fromPoints(delta.start, delta.start);\n }\n continue;\n }\n if (isInsert(delta)) {\n point = delta.start;\n if (range.compare(point.row, point.column) == -1) {\n range.setStart(point);\n }\n point = delta.end;\n if (range.compare(point.row, point.column) == 1) {\n range.setEnd(point);\n }\n }\n else {\n point = delta.start;\n if (range.compare(point.row, point.column) == -1) {\n range = Range.fromPoints(delta.start, delta.start);\n }\n }\n }\n return range;\n };\n EditSession.prototype.replace = function (range, text) {\n return this.doc.replace(range, text);\n };\n EditSession.prototype.moveText = function (fromRange, toPosition, copy) {\n var text = this.getTextRange(fromRange);\n var folds = this.getFoldsInRange(fromRange);\n var toRange = Range.fromPoints(toPosition, toPosition);\n if (!copy) {\n this.remove(fromRange);\n var rowDiff = fromRange.start.row - fromRange.end.row;\n var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column;\n if (collDiff) {\n if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column)\n toRange.start.column += collDiff;\n if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column)\n toRange.end.column += collDiff;\n }\n if (rowDiff && toRange.start.row >= fromRange.end.row) {\n toRange.start.row += rowDiff;\n toRange.end.row += rowDiff;\n }\n }\n toRange.end = this.insert(toRange.start, text);\n if (folds.length) {\n var oldStart = fromRange.start;\n var newStart = toRange.start;\n var rowDiff = newStart.row - oldStart.row;\n var collDiff = newStart.column - oldStart.column;\n this.addFolds(folds.map(function (x) {\n x = x.clone();\n if (x.start.row == oldStart.row)\n x.start.column += collDiff;\n if (x.end.row == oldStart.row)\n x.end.column += collDiff;\n x.start.row += rowDiff;\n x.end.row += rowDiff;\n return x;\n }));\n }\n return toRange;\n };\n EditSession.prototype.indentRows = function (startRow, endRow, indentString) {\n indentString = indentString.replace(/\\t/g, this.getTabString());\n for (var row = startRow; row <= endRow; row++)\n this.doc.insertInLine({ row: row, column: 0 }, indentString);\n };\n EditSession.prototype.outdentRows = function (range) {\n var rowRange = range.collapseRows();\n var deleteRange = new Range(0, 0, 0, 0);\n var size = this.getTabSize();\n for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) {\n var line = this.getLine(i);\n deleteRange.start.row = i;\n deleteRange.end.row = i;\n for (var j = 0; j < size; ++j)\n if (line.charAt(j) != ' ')\n break;\n if (j < size && line.charAt(j) == '\\t') {\n deleteRange.start.column = j;\n deleteRange.end.column = j + 1;\n }\n else {\n deleteRange.start.column = 0;\n deleteRange.end.column = j;\n }\n this.remove(deleteRange);\n }\n };\n EditSession.prototype.$moveLines = function (firstRow, lastRow, dir) {\n firstRow = this.getRowFoldStart(firstRow);\n lastRow = this.getRowFoldEnd(lastRow);\n if (dir < 0) {\n var row = this.getRowFoldStart(firstRow + dir);\n if (row < 0)\n return 0;\n var diff = row - firstRow;\n }\n else if (dir > 0) {\n var row = this.getRowFoldEnd(lastRow + dir);\n if (row > this.doc.getLength() - 1)\n return 0;\n var diff = row - lastRow;\n }\n else {\n firstRow = this.$clipRowToDocument(firstRow);\n lastRow = this.$clipRowToDocument(lastRow);\n var diff = lastRow - firstRow + 1;\n }\n var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE);\n var folds = this.getFoldsInRange(range).map(function (x) {\n x = x.clone();\n x.start.row += diff;\n x.end.row += diff;\n return x;\n });\n var lines = dir == 0\n ? this.doc.getLines(firstRow, lastRow)\n : this.doc.removeFullLines(firstRow, lastRow);\n this.doc.insertFullLines(firstRow + diff, lines);\n folds.length && this.addFolds(folds);\n return diff;\n };\n EditSession.prototype.moveLinesUp = function (firstRow, lastRow) {\n return this.$moveLines(firstRow, lastRow, -1);\n };\n EditSession.prototype.moveLinesDown = function (firstRow, lastRow) {\n return this.$moveLines(firstRow, lastRow, 1);\n };\n EditSession.prototype.duplicateLines = function (firstRow, lastRow) {\n return this.$moveLines(firstRow, lastRow, 0);\n };\n EditSession.prototype.$clipRowToDocument = function (row) {\n return Math.max(0, Math.min(row, this.doc.getLength() - 1));\n };\n EditSession.prototype.$clipColumnToRow = function (row, column) {\n if (column < 0)\n return 0;\n return Math.min(this.doc.getLine(row).length, column);\n };\n EditSession.prototype.$clipPositionToDocument = function (row, column) {\n column = Math.max(0, column);\n if (row < 0) {\n row = 0;\n column = 0;\n }\n else {\n var len = this.doc.getLength();\n if (row >= len) {\n row = len - 1;\n column = this.doc.getLine(len - 1).length;\n }\n else {\n column = Math.min(this.doc.getLine(row).length, column);\n }\n }\n return {\n row: row,\n column: column\n };\n };\n EditSession.prototype.$clipRangeToDocument = function (range) {\n if (range.start.row < 0) {\n range.start.row = 0;\n range.start.column = 0;\n }\n else {\n range.start.column = this.$clipColumnToRow(range.start.row, range.start.column);\n }\n var len = this.doc.getLength() - 1;\n if (range.end.row > len) {\n range.end.row = len;\n range.end.column = this.doc.getLine(len).length;\n }\n else {\n range.end.column = this.$clipColumnToRow(range.end.row, range.end.column);\n }\n return range;\n };\n EditSession.prototype.setUseWrapMode = function (useWrapMode) {\n if (useWrapMode != this.$useWrapMode) {\n this.$useWrapMode = useWrapMode;\n this.$modified = true;\n this.$resetRowCache(0);\n if (useWrapMode) {\n var len = this.getLength();\n this.$wrapData = Array(len);\n this.$updateWrapData(0, len - 1);\n }\n this._signal(\"changeWrapMode\");\n }\n };\n EditSession.prototype.getUseWrapMode = function () {\n return this.$useWrapMode;\n };\n EditSession.prototype.setWrapLimitRange = function (min, max) {\n if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) {\n this.$wrapLimitRange = { min: min, max: max };\n this.$modified = true;\n this.$bidiHandler.markAsDirty();\n if (this.$useWrapMode)\n this._signal(\"changeWrapMode\");\n }\n };\n EditSession.prototype.adjustWrapLimit = function (desiredLimit, $printMargin) {\n var limits = this.$wrapLimitRange;\n if (limits.max < 0)\n limits = { min: $printMargin, max: $printMargin };\n var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max);\n if (wrapLimit != this.$wrapLimit && wrapLimit > 1) {\n this.$wrapLimit = wrapLimit;\n this.$modified = true;\n if (this.$useWrapMode) {\n this.$updateWrapData(0, this.getLength() - 1);\n this.$resetRowCache(0);\n this._signal(\"changeWrapLimit\");\n }\n return true;\n }\n return false;\n };\n EditSession.prototype.$constrainWrapLimit = function (wrapLimit, min, max) {\n if (min)\n wrapLimit = Math.max(min, wrapLimit);\n if (max)\n wrapLimit = Math.min(max, wrapLimit);\n return wrapLimit;\n };\n EditSession.prototype.getWrapLimit = function () {\n return this.$wrapLimit;\n };\n EditSession.prototype.setWrapLimit = function (limit) {\n this.setWrapLimitRange(limit, limit);\n };\n EditSession.prototype.getWrapLimitRange = function () {\n return {\n min: this.$wrapLimitRange.min,\n max: this.$wrapLimitRange.max\n };\n };\n EditSession.prototype.$updateInternalDataOnChange = function (delta) {\n var useWrapMode = this.$useWrapMode;\n var action = delta.action;\n var start = delta.start;\n var end = delta.end;\n var firstRow = start.row;\n var lastRow = end.row;\n var len = lastRow - firstRow;\n var removedFolds = null;\n this.$updating = true;\n if (len != 0) {\n if (action === \"remove\") {\n this[useWrapMode ? \"$wrapData\" : \"$rowLengthCache\"].splice(firstRow, len);\n var foldLines = this.$foldData;\n removedFolds = this.getFoldsInRange(delta);\n this.removeFolds(removedFolds);\n var foldLine = this.getFoldLine(end.row);\n var idx = 0;\n if (foldLine) {\n foldLine.addRemoveChars(end.row, end.column, start.column - end.column);\n foldLine.shiftRow(-len);\n var foldLineBefore = this.getFoldLine(firstRow);\n if (foldLineBefore && foldLineBefore !== foldLine) {\n foldLineBefore.merge(foldLine);\n foldLine = foldLineBefore;\n }\n idx = foldLines.indexOf(foldLine) + 1;\n }\n for (idx; idx < foldLines.length; idx++) {\n var foldLine = foldLines[idx];\n if (foldLine.start.row >= end.row) {\n foldLine.shiftRow(-len);\n }\n }\n lastRow = firstRow;\n }\n else {\n var args = Array(len);\n args.unshift(firstRow, 0);\n var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache;\n arr.splice.apply(arr, args);\n var foldLines = this.$foldData;\n var foldLine = this.getFoldLine(firstRow);\n var idx = 0;\n if (foldLine) {\n var cmp = foldLine.range.compareInside(start.row, start.column);\n if (cmp == 0) {\n foldLine = foldLine.split(start.row, start.column);\n if (foldLine) {\n foldLine.shiftRow(len);\n foldLine.addRemoveChars(lastRow, 0, end.column - start.column);\n }\n }\n else \n if (cmp == -1) {\n foldLine.addRemoveChars(firstRow, 0, end.column - start.column);\n foldLine.shiftRow(len);\n }\n idx = foldLines.indexOf(foldLine) + 1;\n }\n for (idx; idx < foldLines.length; idx++) {\n var foldLine = foldLines[idx];\n if (foldLine.start.row >= firstRow) {\n foldLine.shiftRow(len);\n }\n }\n }\n }\n else {\n len = Math.abs(delta.start.column - delta.end.column);\n if (action === \"remove\") {\n removedFolds = this.getFoldsInRange(delta);\n this.removeFolds(removedFolds);\n len = -len;\n }\n var foldLine = this.getFoldLine(firstRow);\n if (foldLine) {\n foldLine.addRemoveChars(firstRow, start.column, len);\n }\n }\n if (useWrapMode && this.$wrapData.length != this.doc.getLength()) {\n console.error(\"doc.getLength() and $wrapData.length have to be the same!\");\n }\n this.$updating = false;\n if (useWrapMode)\n this.$updateWrapData(firstRow, lastRow);\n else\n this.$updateRowLengthCache(firstRow, lastRow);\n return removedFolds;\n };\n EditSession.prototype.$updateRowLengthCache = function (firstRow, lastRow) {\n this.$rowLengthCache[firstRow] = null;\n this.$rowLengthCache[lastRow] = null;\n };\n EditSession.prototype.$updateWrapData = function (firstRow, lastRow) {\n var lines = this.doc.getAllLines();\n var tabSize = this.getTabSize();\n var wrapData = this.$wrapData;\n var wrapLimit = this.$wrapLimit;\n var tokens;\n var foldLine;\n var row = firstRow;\n lastRow = Math.min(lastRow, lines.length - 1);\n while (row <= lastRow) {\n foldLine = this.getFoldLine(row, foldLine);\n if (!foldLine) {\n tokens = this.$getDisplayTokens(lines[row]);\n wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);\n row++;\n }\n else {\n tokens = [];\n foldLine.walk(function (placeholder, row, column, lastColumn) {\n var walkTokens;\n if (placeholder != null) {\n walkTokens = this.$getDisplayTokens(placeholder, tokens.length);\n walkTokens[0] = PLACEHOLDER_START;\n for (var i = 1; i < walkTokens.length; i++) {\n walkTokens[i] = PLACEHOLDER_BODY;\n }\n }\n else {\n walkTokens = this.$getDisplayTokens(lines[row].substring(lastColumn, column), tokens.length);\n }\n tokens = tokens.concat(walkTokens);\n }.bind(this), foldLine.end.row, lines[foldLine.end.row].length + 1);\n wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);\n row = foldLine.end.row + 1;\n }\n }\n };\n EditSession.prototype.$computeWrapSplits = function (tokens, wrapLimit, tabSize) {\n if (tokens.length == 0) {\n return [];\n }\n var splits = [];\n var displayLength = tokens.length;\n var lastSplit = 0, lastDocSplit = 0;\n var isCode = this.$wrapAsCode;\n var indentedSoftWrap = this.$indentedSoftWrap;\n var maxIndent = wrapLimit <= Math.max(2 * tabSize, 8)\n || indentedSoftWrap === false ? 0 : Math.floor(wrapLimit / 2);\n function getWrapIndent() {\n var indentation = 0;\n if (maxIndent === 0)\n return indentation;\n if (indentedSoftWrap) {\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n if (token == SPACE)\n indentation += 1;\n else if (token == TAB)\n indentation += tabSize;\n else if (token == TAB_SPACE)\n continue;\n else\n break;\n }\n }\n if (isCode && indentedSoftWrap !== false)\n indentation += tabSize;\n return Math.min(indentation, maxIndent);\n }\n function addSplit(screenPos) {\n var len = screenPos - lastSplit;\n for (var i = lastSplit; i < screenPos; i++) {\n var ch = tokens[i];\n if (ch === 12 || ch === 2)\n len -= 1;\n }\n if (!splits.length) {\n indent = getWrapIndent();\n splits.indent = indent;\n }\n lastDocSplit += len;\n splits.push(lastDocSplit);\n lastSplit = screenPos;\n }\n var indent = 0;\n while (displayLength - lastSplit > wrapLimit - indent) {\n var split = lastSplit + wrapLimit - indent;\n if (tokens[split - 1] >= SPACE && tokens[split] >= SPACE) {\n addSplit(split);\n continue;\n }\n if (tokens[split] == PLACEHOLDER_START || tokens[split] == PLACEHOLDER_BODY) {\n for (split; split != lastSplit - 1; split--) {\n if (tokens[split] == PLACEHOLDER_START) {\n break;\n }\n }\n if (split > lastSplit) {\n addSplit(split);\n continue;\n }\n split = lastSplit + wrapLimit;\n for (split; split < tokens.length; split++) {\n if (tokens[split] != PLACEHOLDER_BODY) {\n break;\n }\n }\n if (split == tokens.length) {\n break; // Breaks the while-loop.\n }\n addSplit(split);\n continue;\n }\n var minSplit = Math.max(split - (wrapLimit - (wrapLimit >> 2)), lastSplit - 1);\n while (split > minSplit && tokens[split] < PLACEHOLDER_START) {\n split--;\n }\n if (isCode) {\n while (split > minSplit && tokens[split] < PLACEHOLDER_START) {\n split--;\n }\n while (split > minSplit && tokens[split] == PUNCTUATION) {\n split--;\n }\n }\n else {\n while (split > minSplit && tokens[split] < SPACE) {\n split--;\n }\n }\n if (split > minSplit) {\n addSplit(++split);\n continue;\n }\n split = lastSplit + wrapLimit;\n if (tokens[split] == CHAR_EXT)\n split--;\n addSplit(split - indent);\n }\n return splits;\n };\n EditSession.prototype.$getDisplayTokens = function (str, offset) {\n var arr = [];\n var tabSize;\n offset = offset || 0;\n for (var i = 0; i < str.length; i++) {\n var c = str.charCodeAt(i);\n if (c == 9) {\n tabSize = this.getScreenTabSize(arr.length + offset);\n arr.push(TAB);\n for (var n = 1; n < tabSize; n++) {\n arr.push(TAB_SPACE);\n }\n }\n else if (c == 32) {\n arr.push(SPACE);\n }\n else if ((c > 39 && c < 48) || (c > 57 && c < 64)) {\n arr.push(PUNCTUATION);\n }\n else if (c >= 0x1100 && isFullWidth(c)) {\n arr.push(CHAR, CHAR_EXT);\n }\n else {\n arr.push(CHAR);\n }\n }\n return arr;\n };\n EditSession.prototype.$getStringScreenWidth = function (str, maxScreenColumn, screenColumn) {\n if (maxScreenColumn == 0)\n return [0, 0];\n if (maxScreenColumn == null)\n maxScreenColumn = Infinity;\n screenColumn = screenColumn || 0;\n var c, column;\n for (column = 0; column < str.length; column++) {\n c = str.charCodeAt(column);\n if (c == 9) {\n screenColumn += this.getScreenTabSize(screenColumn);\n }\n else if (c >= 0x1100 && isFullWidth(c)) {\n screenColumn += 2;\n }\n else {\n screenColumn += 1;\n }\n if (screenColumn > maxScreenColumn) {\n break;\n }\n }\n return [screenColumn, column];\n };\n EditSession.prototype.getRowLength = function (row) {\n var h = 1;\n if (this.lineWidgets)\n h += this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;\n if (!this.$useWrapMode || !this.$wrapData[row])\n return h;\n else\n return this.$wrapData[row].length + h;\n };\n EditSession.prototype.getRowLineCount = function (row) {\n if (!this.$useWrapMode || !this.$wrapData[row]) {\n return 1;\n }\n else {\n return this.$wrapData[row].length + 1;\n }\n };\n EditSession.prototype.getRowWrapIndent = function (screenRow) {\n if (this.$useWrapMode) {\n var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);\n var splits = this.$wrapData[pos.row];\n return splits.length && splits[0] < pos.column ? splits.indent : 0;\n }\n else {\n return 0;\n }\n };\n EditSession.prototype.getScreenLastRowColumn = function (screenRow) {\n var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);\n return this.documentToScreenColumn(pos.row, pos.column);\n };\n EditSession.prototype.getDocumentLastRowColumn = function (docRow, docColumn) {\n var screenRow = this.documentToScreenRow(docRow, docColumn);\n return this.getScreenLastRowColumn(screenRow);\n };\n EditSession.prototype.getDocumentLastRowColumnPosition = function (docRow, docColumn) {\n var screenRow = this.documentToScreenRow(docRow, docColumn);\n return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10);\n };\n EditSession.prototype.getRowSplitData = function (row) {\n if (!this.$useWrapMode) {\n return undefined;\n }\n else {\n return this.$wrapData[row];\n }\n };\n EditSession.prototype.getScreenTabSize = function (screenColumn) {\n return this.$tabSize - (screenColumn % this.$tabSize | 0);\n };\n EditSession.prototype.screenToDocumentRow = function (screenRow, screenColumn) {\n return this.screenToDocumentPosition(screenRow, screenColumn).row;\n };\n EditSession.prototype.screenToDocumentColumn = function (screenRow, screenColumn) {\n return this.screenToDocumentPosition(screenRow, screenColumn).column;\n };\n EditSession.prototype.screenToDocumentPosition = function (screenRow, screenColumn, offsetX) {\n if (screenRow < 0)\n return { row: 0, column: 0 };\n var line;\n var docRow = 0;\n var docColumn = 0;\n var column;\n var row = 0;\n var rowLength = 0;\n var rowCache = this.$screenRowCache;\n var i = this.$getRowCacheIndex(rowCache, screenRow);\n var l = rowCache.length;\n if (l && i >= 0) {\n var row = rowCache[i];\n var docRow = this.$docRowCache[i];\n var doCache = screenRow > rowCache[l - 1];\n }\n else {\n var doCache = !l;\n }\n var maxRow = this.getLength() - 1;\n var foldLine = this.getNextFoldLine(docRow);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (row <= screenRow) {\n rowLength = this.getRowLength(docRow);\n if (row + rowLength > screenRow || docRow >= maxRow) {\n break;\n }\n else {\n row += rowLength;\n docRow++;\n if (docRow > foldStart) {\n docRow = foldLine.end.row + 1;\n foldLine = this.getNextFoldLine(docRow, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n }\n if (doCache) {\n this.$docRowCache.push(docRow);\n this.$screenRowCache.push(row);\n }\n }\n if (foldLine && foldLine.start.row <= docRow) {\n line = this.getFoldDisplayLine(foldLine);\n docRow = foldLine.start.row;\n }\n else if (row + rowLength <= screenRow || docRow > maxRow) {\n return {\n row: maxRow,\n column: this.getLine(maxRow).length\n };\n }\n else {\n line = this.getLine(docRow);\n foldLine = null;\n }\n var wrapIndent = 0, splitIndex = Math.floor(screenRow - row);\n if (this.$useWrapMode) {\n var splits = this.$wrapData[docRow];\n if (splits) {\n column = splits[splitIndex];\n if (splitIndex > 0 && splits.length) {\n wrapIndent = splits.indent;\n docColumn = splits[splitIndex - 1] || splits[splits.length - 1];\n line = line.substring(docColumn);\n }\n }\n }\n if (offsetX !== undefined && this.$bidiHandler.isBidiRow(row + splitIndex, docRow, splitIndex))\n screenColumn = this.$bidiHandler.offsetToCol(offsetX);\n docColumn += this.$getStringScreenWidth(line, screenColumn - wrapIndent)[1];\n if (this.$useWrapMode && docColumn >= column)\n docColumn = column - 1;\n if (foldLine)\n return foldLine.idxToPosition(docColumn);\n return { row: docRow, column: docColumn };\n };\n EditSession.prototype.documentToScreenPosition = function (docRow, docColumn) {\n if (typeof docColumn === \"undefined\")\n var pos = this.$clipPositionToDocument(/**@type{Point}*/ (docRow).row, /**@type{Point}*/ (docRow).column);\n else\n pos = this.$clipPositionToDocument(/**@type{number}*/ (docRow), docColumn);\n docRow = pos.row;\n docColumn = pos.column;\n var screenRow = 0;\n var foldStartRow = null;\n var fold = null;\n fold = this.getFoldAt(docRow, docColumn, 1);\n if (fold) {\n docRow = fold.start.row;\n docColumn = fold.start.column;\n }\n var rowEnd, row = 0;\n var rowCache = this.$docRowCache;\n var i = this.$getRowCacheIndex(rowCache, docRow);\n var l = rowCache.length;\n if (l && i >= 0) {\n var row = rowCache[i];\n var screenRow = this.$screenRowCache[i];\n var doCache = docRow > rowCache[l - 1];\n }\n else {\n var doCache = !l;\n }\n var foldLine = this.getNextFoldLine(row);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (row < docRow) {\n if (row >= foldStart) {\n rowEnd = foldLine.end.row + 1;\n if (rowEnd > docRow)\n break;\n foldLine = this.getNextFoldLine(rowEnd, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n else {\n rowEnd = row + 1;\n }\n screenRow += this.getRowLength(row);\n row = rowEnd;\n if (doCache) {\n this.$docRowCache.push(row);\n this.$screenRowCache.push(screenRow);\n }\n }\n var textLine = \"\";\n if (foldLine && row >= foldStart) {\n textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn);\n foldStartRow = foldLine.start.row;\n }\n else {\n textLine = this.getLine(docRow).substring(0, docColumn);\n foldStartRow = docRow;\n }\n var wrapIndent = 0;\n if (this.$useWrapMode) {\n var wrapRow = this.$wrapData[foldStartRow];\n if (wrapRow) {\n var screenRowOffset = 0;\n while (textLine.length >= wrapRow[screenRowOffset]) {\n screenRow++;\n screenRowOffset++;\n }\n textLine = textLine.substring(wrapRow[screenRowOffset - 1] || 0, textLine.length);\n wrapIndent = screenRowOffset > 0 ? wrapRow.indent : 0;\n }\n }\n if (this.lineWidgets && this.lineWidgets[row] && this.lineWidgets[row].rowsAbove)\n screenRow += this.lineWidgets[row].rowsAbove;\n return {\n row: screenRow,\n column: wrapIndent + this.$getStringScreenWidth(textLine)[0]\n };\n };\n EditSession.prototype.documentToScreenColumn = function (row, docColumn) {\n return this.documentToScreenPosition(row, docColumn).column;\n };\n EditSession.prototype.documentToScreenRow = function (docRow, docColumn) {\n return this.documentToScreenPosition(docRow, docColumn).row;\n };\n EditSession.prototype.getScreenLength = function () {\n var screenRows = 0;\n var fold = null;\n if (!this.$useWrapMode) {\n screenRows = this.getLength();\n var foldData = this.$foldData;\n for (var i = 0; i < foldData.length; i++) {\n fold = foldData[i];\n screenRows -= fold.end.row - fold.start.row;\n }\n }\n else {\n var lastRow = this.$wrapData.length;\n var row = 0, i = 0;\n var fold = this.$foldData[i++];\n var foldStart = fold ? fold.start.row : Infinity;\n while (row < lastRow) {\n var splits = this.$wrapData[row];\n screenRows += splits ? splits.length + 1 : 1;\n row++;\n if (row > foldStart) {\n row = fold.end.row + 1;\n fold = this.$foldData[i++];\n foldStart = fold ? fold.start.row : Infinity;\n }\n }\n }\n if (this.lineWidgets)\n screenRows += this.$getWidgetScreenLength();\n return screenRows;\n };\n EditSession.prototype.$setFontMetrics = function (fm) {\n if (!this.$enableVarChar)\n return;\n this.$getStringScreenWidth = function (str, maxScreenColumn, screenColumn) {\n if (maxScreenColumn === 0)\n return [0, 0];\n if (!maxScreenColumn)\n maxScreenColumn = Infinity;\n screenColumn = screenColumn || 0;\n var c, column;\n for (column = 0; column < str.length; column++) {\n c = str.charAt(column);\n if (c === \"\\t\") {\n screenColumn += this.getScreenTabSize(screenColumn);\n }\n else {\n screenColumn += fm.getCharacterWidth(c);\n }\n if (screenColumn > maxScreenColumn) {\n break;\n }\n }\n return [screenColumn, column];\n };\n };\n EditSession.prototype.getPrecedingCharacter = function () {\n var pos = this.selection.getCursor();\n if (pos.column === 0) {\n return pos.row === 0 ? \"\" : this.doc.getNewLineCharacter();\n }\n var currentLine = this.getLine(pos.row);\n return currentLine[pos.column - 1];\n };\n EditSession.prototype.destroy = function () {\n if (!this.destroyed) {\n this.bgTokenizer.setDocument(null);\n this.bgTokenizer.cleanup();\n this.destroyed = true;\n }\n this.$stopWorker();\n this.removeAllListeners();\n if (this.doc) {\n this.doc.off(\"change\", this.$onChange);\n }\n this.selection.detach();\n };\n return EditSession;\n}());\nEditSession.$uid = 0;\nEditSession.prototype.$modes = config.$modes;\nEditSession.prototype.getValue = EditSession.prototype.toString;\nEditSession.prototype.$defaultUndoManager = {\n undo: function () { },\n redo: function () { },\n hasUndo: function () { },\n hasRedo: function () { },\n reset: function () { },\n add: function () { },\n addSelection: function () { },\n startNewGroup: function () { },\n addSession: function () { }\n};\nEditSession.prototype.$overwrite = false;\nEditSession.prototype.$mode = null;\nEditSession.prototype.$modeId = null;\nEditSession.prototype.$scrollTop = 0;\nEditSession.prototype.$scrollLeft = 0;\nEditSession.prototype.$wrapLimit = 80;\nEditSession.prototype.$useWrapMode = false;\nEditSession.prototype.$wrapLimitRange = {\n min: null,\n max: null\n};\nEditSession.prototype.lineWidgets = null;\nEditSession.prototype.isFullWidth = isFullWidth;\noop.implement(EditSession.prototype, EventEmitter);\nvar CHAR = 1, CHAR_EXT = 2, PLACEHOLDER_START = 3, PLACEHOLDER_BODY = 4, PUNCTUATION = 9, SPACE = 10, TAB = 11, TAB_SPACE = 12;\nfunction isFullWidth(c) {\n if (c < 0x1100)\n return false;\n return c >= 0x1100 && c <= 0x115F ||\n c >= 0x11A3 && c <= 0x11A7 ||\n c >= 0x11FA && c <= 0x11FF ||\n c >= 0x2329 && c <= 0x232A ||\n c >= 0x2E80 && c <= 0x2E99 ||\n c >= 0x2E9B && c <= 0x2EF3 ||\n c >= 0x2F00 && c <= 0x2FD5 ||\n c >= 0x2FF0 && c <= 0x2FFB ||\n c >= 0x3000 && c <= 0x303E ||\n c >= 0x3041 && c <= 0x3096 ||\n c >= 0x3099 && c <= 0x30FF ||\n c >= 0x3105 && c <= 0x312D ||\n c >= 0x3131 && c <= 0x318E ||\n c >= 0x3190 && c <= 0x31BA ||\n c >= 0x31C0 && c <= 0x31E3 ||\n c >= 0x31F0 && c <= 0x321E ||\n c >= 0x3220 && c <= 0x3247 ||\n c >= 0x3250 && c <= 0x32FE ||\n c >= 0x3300 && c <= 0x4DBF ||\n c >= 0x4E00 && c <= 0xA48C ||\n c >= 0xA490 && c <= 0xA4C6 ||\n c >= 0xA960 && c <= 0xA97C ||\n c >= 0xAC00 && c <= 0xD7A3 ||\n c >= 0xD7B0 && c <= 0xD7C6 ||\n c >= 0xD7CB && c <= 0xD7FB ||\n c >= 0xF900 && c <= 0xFAFF ||\n c >= 0xFE10 && c <= 0xFE19 ||\n c >= 0xFE30 && c <= 0xFE52 ||\n c >= 0xFE54 && c <= 0xFE66 ||\n c >= 0xFE68 && c <= 0xFE6B ||\n c >= 0xFF01 && c <= 0xFF60 ||\n c >= 0xFFE0 && c <= 0xFFE6;\n}\nrequire(\"./edit_session/folding\").Folding.call(EditSession.prototype);\nrequire(\"./edit_session/bracket_match\").BracketMatch.call(EditSession.prototype);\nconfig.defineOptions(EditSession.prototype, \"session\", {\n wrap: {\n set: function (value) {\n if (!value || value == \"off\")\n value = false;\n else if (value == \"free\")\n value = true;\n else if (value == \"printMargin\")\n value = -1;\n else if (typeof value == \"string\")\n value = parseInt(value, 10) || false;\n if (this.$wrap == value)\n return;\n this.$wrap = value;\n if (!value) {\n this.setUseWrapMode(false);\n }\n else {\n var col = typeof value == \"number\" ? value : null;\n this.setWrapLimitRange(col, col);\n this.setUseWrapMode(true);\n }\n },\n get: function () {\n if (this.getUseWrapMode()) {\n if (this.$wrap == -1)\n return \"printMargin\";\n if (!this.getWrapLimitRange().min)\n return \"free\";\n return this.$wrap;\n }\n return \"off\";\n },\n handlesSet: true\n },\n wrapMethod: {\n set: function (val) {\n val = val == \"auto\"\n ? this.$mode.type != \"text\"\n : val != \"text\";\n if (val != this.$wrapAsCode) {\n this.$wrapAsCode = val;\n if (this.$useWrapMode) {\n this.$useWrapMode = false;\n this.setUseWrapMode(true);\n }\n }\n },\n initialValue: \"auto\"\n },\n indentedSoftWrap: {\n set: function () {\n if (this.$useWrapMode) {\n this.$useWrapMode = false;\n this.setUseWrapMode(true);\n }\n },\n initialValue: true\n },\n firstLineNumber: {\n set: function () { this._signal(\"changeBreakpoint\"); },\n initialValue: 1\n },\n useWorker: {\n set: function (useWorker) {\n this.$useWorker = useWorker;\n this.$stopWorker();\n if (useWorker)\n this.$startWorker();\n },\n initialValue: true\n },\n useSoftTabs: { initialValue: true },\n tabSize: {\n set: function (tabSize) {\n tabSize = parseInt(tabSize);\n if (tabSize > 0 && this.$tabSize !== tabSize) {\n this.$modified = true;\n this.$rowLengthCache = [];\n this.$tabSize = tabSize;\n this._signal(\"changeTabSize\");\n }\n },\n initialValue: 4,\n handlesSet: true\n },\n navigateWithinSoftTabs: { initialValue: false },\n foldStyle: {\n set: function (val) { this.setFoldStyle(val); },\n handlesSet: true\n },\n overwrite: {\n set: function (val) { this._signal(\"changeOverwrite\"); },\n initialValue: false\n },\n newLineMode: {\n set: function (val) { this.doc.setNewLineMode(val); },\n get: function () { return this.doc.getNewLineMode(); },\n handlesSet: true\n },\n mode: {\n set: function (val) { this.setMode(val); },\n get: function () { return this.$modeId; },\n handlesSet: true\n }\n});\nexports.EditSession = EditSession;\n\n});\n\nace.define(\"ace/search\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\",\"ace/lib/oop\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar lang = require(\"./lib/lang\");\nvar oop = require(\"./lib/oop\");\nvar Range = require(\"./range\").Range;\nvar Search = /** @class */ (function () {\n function Search() {\n this.$options = {};\n }\n Search.prototype.set = function (options) {\n oop.mixin(this.$options, options);\n return this;\n };\n Search.prototype.getOptions = function () {\n return lang.copyObject(this.$options);\n };\n Search.prototype.setOptions = function (options) {\n this.$options = options;\n };\n Search.prototype.find = function (session) {\n var options = this.$options;\n var iterator = this.$matchIterator(session, options);\n if (!iterator)\n return false;\n var firstRange = null;\n iterator.forEach(function (sr, sc, er, ec) {\n firstRange = new Range(sr, sc, er, ec);\n if (sc == ec && options.start && /**@type{Range}*/ (options.start).start\n && options.skipCurrent != false && firstRange.isEqual(/**@type{Range}*/ (options.start))) {\n firstRange = null;\n return false;\n }\n return true;\n });\n return firstRange;\n };\n Search.prototype.findAll = function (session) {\n var options = this.$options;\n if (!options.needle)\n return [];\n this.$assembleRegExp(options);\n var range = options.range;\n var lines = range\n ? session.getLines(range.start.row, range.end.row)\n : session.doc.getAllLines();\n var ranges = [];\n var re = options.re;\n if (options.$isMultiLine) {\n var len = re.length;\n var maxRow = lines.length - len;\n var prevRange;\n outer: for (var row = re.offset || 0; row <= maxRow; row++) {\n for (var j = 0; j < len; j++)\n if (lines[row + j].search(re[j]) == -1)\n continue outer;\n var startLine = lines[row];\n var line = lines[row + len - 1];\n var startIndex = startLine.length - startLine.match(re[0])[0].length;\n var endIndex = line.match(re[len - 1])[0].length;\n if (prevRange && prevRange.end.row === row &&\n prevRange.end.column > startIndex) {\n continue;\n }\n ranges.push(prevRange = new Range(row, startIndex, row + len - 1, endIndex));\n if (len > 2)\n row = row + len - 2;\n }\n }\n else {\n for (var i = 0; i < lines.length; i++) {\n var matches = lang.getMatchOffsets(lines[i], re);\n for (var j = 0; j < matches.length; j++) {\n var match = matches[j];\n ranges.push(new Range(i, match.offset, i, match.offset + match.length));\n }\n }\n }\n if (range) {\n var startColumn = range.start.column;\n var endColumn = range.end.column;\n var i = 0, j = ranges.length - 1;\n while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == 0)\n i++;\n var endRow = range.end.row - range.start.row;\n while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == endRow)\n j--;\n ranges = ranges.slice(i, j + 1);\n for (i = 0, j = ranges.length; i < j; i++) {\n ranges[i].start.row += range.start.row;\n ranges[i].end.row += range.start.row;\n }\n }\n return ranges;\n };\n Search.prototype.replace = function (input, replacement) {\n var options = this.$options;\n var re = this.$assembleRegExp(options);\n if (options.$isMultiLine)\n return replacement;\n if (!re)\n return;\n var match = re.exec(input);\n if (!match || match[0].length != input.length)\n return null;\n if (!options.regExp) {\n replacement = replacement.replace(/\\$/g, \"$$$$\");\n }\n replacement = input.replace(re, replacement);\n if (options.preserveCase) {\n replacement = replacement.split(\"\");\n for (var i = Math.min(input.length, input.length); i--;) {\n var ch = input[i];\n if (ch && ch.toLowerCase() != ch)\n replacement[i] = replacement[i].toUpperCase();\n else\n replacement[i] = replacement[i].toLowerCase();\n }\n replacement = replacement.join(\"\");\n }\n return replacement;\n };\n Search.prototype.$assembleRegExp = function (options, $disableFakeMultiline) {\n if (options.needle instanceof RegExp)\n return options.re = options.needle;\n var needle = options.needle;\n if (!options.needle)\n return options.re = false;\n if (!options.regExp)\n needle = lang.escapeRegExp(needle);\n var modifier = options.caseSensitive ? \"gm\" : \"gmi\";\n try {\n new RegExp(needle, \"u\");\n options.$supportsUnicodeFlag = true;\n modifier += \"u\";\n }\n catch (e) {\n options.$supportsUnicodeFlag = false; //left for backward compatibility with previous versions for cases like /ab\\{2}/gu\n }\n if (options.wholeWord)\n needle = addWordBoundary(needle, options);\n options.$isMultiLine = !$disableFakeMultiline && /[\\n\\r]/.test(needle);\n if (options.$isMultiLine)\n return options.re = this.$assembleMultilineRegExp(needle, modifier);\n try {\n var re = new RegExp(needle, modifier);\n }\n catch (e) {\n re = false;\n }\n return options.re = re;\n };\n Search.prototype.$assembleMultilineRegExp = function (needle, modifier) {\n var parts = needle.replace(/\\r\\n|\\r|\\n/g, \"$\\n^\").split(\"\\n\");\n var re = [];\n for (var i = 0; i < parts.length; i++)\n try {\n re.push(new RegExp(parts[i], modifier));\n }\n catch (e) {\n return false;\n }\n return re;\n };\n Search.prototype.$matchIterator = function (session, options) {\n var re = this.$assembleRegExp(options);\n if (!re)\n return false;\n var backwards = options.backwards == true;\n var skipCurrent = options.skipCurrent != false;\n var supportsUnicodeFlag = re.unicode;\n var range = options.range;\n var start = options.start;\n if (!start)\n start = range ? range[backwards ? \"end\" : \"start\"] : session.selection.getRange();\n if (start.start)\n start = start[skipCurrent != backwards ? \"end\" : \"start\"];\n var firstRow = range ? range.start.row : 0;\n var lastRow = range ? range.end.row : session.getLength() - 1;\n if (backwards) {\n var forEach = function (callback) {\n var row = start.row;\n if (forEachInLine(row, start.column, callback))\n return;\n for (row--; row >= firstRow; row--)\n if (forEachInLine(row, Number.MAX_VALUE, callback))\n return;\n if (options.wrap == false)\n return;\n for (row = lastRow, firstRow = start.row; row >= firstRow; row--)\n if (forEachInLine(row, Number.MAX_VALUE, callback))\n return;\n };\n }\n else {\n var forEach = function (callback) {\n var row = start.row;\n if (forEachInLine(row, start.column, callback))\n return;\n for (row = row + 1; row <= lastRow; row++)\n if (forEachInLine(row, 0, callback))\n return;\n if (options.wrap == false)\n return;\n for (row = firstRow, lastRow = start.row; row <= lastRow; row++)\n if (forEachInLine(row, 0, callback))\n return;\n };\n }\n if (options.$isMultiLine) {\n var len = re.length;\n var forEachInLine = function (row, offset, callback) {\n var startRow = backwards ? row - len + 1 : row;\n if (startRow < 0 || startRow + len > session.getLength())\n return;\n var line = session.getLine(startRow);\n var startIndex = line.search(re[0]);\n if (!backwards && startIndex < offset || startIndex === -1)\n return;\n for (var i = 1; i < len; i++) {\n line = session.getLine(startRow + i);\n if (line.search(re[i]) == -1)\n return;\n }\n var endIndex = line.match(re[len - 1])[0].length;\n if (backwards && endIndex > offset)\n return;\n if (callback(startRow, startIndex, startRow + len - 1, endIndex))\n return true;\n };\n }\n else if (backwards) {\n var forEachInLine = function (row, endIndex, callback) {\n var line = session.getLine(row);\n var matches = [];\n var m, last = 0;\n re.lastIndex = 0;\n while ((m = re.exec(line))) {\n var length = m[0].length;\n last = m.index;\n if (!length) {\n if (last >= line.length)\n break;\n re.lastIndex = last += lang.skipEmptyMatch(line, last, supportsUnicodeFlag);\n }\n if (m.index + length > endIndex)\n break;\n matches.push(m.index, length);\n }\n for (var i = matches.length - 1; i >= 0; i -= 2) {\n var column = matches[i - 1];\n var length = matches[i];\n if (callback(row, column, row, column + length))\n return true;\n }\n };\n }\n else {\n var forEachInLine = function (row, startIndex, callback) {\n var line = session.getLine(row);\n var last;\n var m;\n re.lastIndex = startIndex;\n while ((m = re.exec(line))) {\n var length = m[0].length;\n last = m.index;\n if (callback(row, last, row, last + length))\n return true;\n if (!length) {\n re.lastIndex = last += lang.skipEmptyMatch(line, last, supportsUnicodeFlag);\n if (last >= line.length)\n return false;\n }\n }\n };\n }\n return { forEach: forEach };\n };\n return Search;\n}());\nfunction addWordBoundary(needle, options) {\n var supportsLookbehind = lang.supportsLookbehind();\n function wordBoundary(c, firstChar) {\n if (firstChar === void 0) { firstChar = true; }\n var wordRegExp = supportsLookbehind && options.$supportsUnicodeFlag ? new RegExp(\"[\\\\p{L}\\\\p{N}_]\", \"u\") : new RegExp(\"\\\\w\");\n if (wordRegExp.test(c) || options.regExp) {\n if (supportsLookbehind && options.$supportsUnicodeFlag) {\n if (firstChar)\n return \"(?<=^|[^\\\\p{L}\\\\p{N}_])\";\n return \"(?=[^\\\\p{L}\\\\p{N}_]|$)\";\n }\n return \"\\\\b\";\n }\n return \"\";\n }\n var needleArray = Array.from(needle);\n var firstChar = needleArray[0];\n var lastChar = needleArray[needleArray.length - 1];\n return wordBoundary(firstChar) + needle + wordBoundary(lastChar, false);\n}\nexports.Search = Search;\n\n});\n\nace.define(\"ace/keyboard/hash_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/keys\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})(); var keyUtil = require(\"../lib/keys\");\nvar useragent = require(\"../lib/useragent\");\nvar KEY_MODS = keyUtil.KEY_MODS;\nvar MultiHashHandler = /** @class */ (function () {\n function MultiHashHandler(config, platform) {\n this.$init(config, platform, false);\n }\n MultiHashHandler.prototype.$init = function (config, platform, $singleCommand) {\n this.platform = platform || (useragent.isMac ? \"mac\" : \"win\");\n this.commands = {};\n this.commandKeyBinding = {};\n this.addCommands(config);\n this.$singleCommand = $singleCommand;\n };\n MultiHashHandler.prototype.addCommand = function (command) {\n if (this.commands[command.name])\n this.removeCommand(command);\n this.commands[command.name] = command;\n if (command.bindKey)\n this._buildKeyHash(command);\n };\n MultiHashHandler.prototype.removeCommand = function (command, keepCommand) {\n var name = command && (typeof command === 'string' ? command : command.name);\n command = this.commands[name];\n if (!keepCommand)\n delete this.commands[name];\n var ckb = this.commandKeyBinding;\n for (var keyId in ckb) {\n var cmdGroup = ckb[keyId];\n if (cmdGroup == command) {\n delete ckb[keyId];\n }\n else if (Array.isArray(cmdGroup)) {\n var i = cmdGroup.indexOf(command);\n if (i != -1) {\n cmdGroup.splice(i, 1);\n if (cmdGroup.length == 1)\n ckb[keyId] = cmdGroup[0];\n }\n }\n }\n };\n MultiHashHandler.prototype.bindKey = function (key, command, position) {\n if (typeof key == \"object\" && key) {\n if (position == undefined)\n position = key.position;\n key = key[this.platform];\n }\n if (!key)\n return;\n if (typeof command == \"function\")\n return this.addCommand({ exec: command, bindKey: key, name: command.name || /**@type{string}*/ (key) }); (key).split(\"|\").forEach(function (keyPart) {\n var chain = \"\";\n if (keyPart.indexOf(\" \") != -1) {\n var parts = keyPart.split(/\\s+/);\n keyPart = parts.pop();\n parts.forEach(function (keyPart) {\n var binding = this.parseKeys(keyPart);\n var id = KEY_MODS[binding.hashId] + binding.key;\n chain += (chain ? \" \" : \"\") + id;\n this._addCommandToBinding(chain, \"chainKeys\");\n }, this);\n chain += \" \";\n }\n var binding = this.parseKeys(keyPart);\n var id = KEY_MODS[binding.hashId] + binding.key;\n this._addCommandToBinding(chain + id, command, position);\n }, this);\n };\n MultiHashHandler.prototype._addCommandToBinding = function (keyId, command, position) {\n var ckb = this.commandKeyBinding, i;\n if (!command) {\n delete ckb[keyId];\n }\n else if (!ckb[keyId] || this.$singleCommand) {\n ckb[keyId] = command;\n }\n else {\n if (!Array.isArray(ckb[keyId])) {\n ckb[keyId] = [ckb[keyId]];\n }\n else if ((i = ckb[keyId].indexOf(command)) != -1) {\n ckb[keyId].splice(i, 1);\n }\n if (typeof position != \"number\") {\n position = getPosition(command);\n }\n var commands = ckb[keyId];\n for (i = 0; i < commands.length; i++) {\n var other = commands[i];\n var otherPos = getPosition(other);\n if (otherPos > position)\n break;\n }\n commands.splice(i, 0, command);\n }\n };\n MultiHashHandler.prototype.addCommands = function (commands) {\n commands && Object.keys(commands).forEach(function (name) {\n var command = commands[name];\n if (!command)\n return;\n if (typeof command === \"string\")\n return this.bindKey(command, name);\n if (typeof command === \"function\")\n command = { exec: command };\n if (typeof command !== \"object\")\n return;\n if (!command.name)\n command.name = name;\n this.addCommand(command);\n }, this);\n };\n MultiHashHandler.prototype.removeCommands = function (commands) {\n Object.keys(commands).forEach(function (name) {\n this.removeCommand(commands[name]);\n }, this);\n };\n MultiHashHandler.prototype.bindKeys = function (keyList) {\n Object.keys(keyList).forEach(function (key) {\n this.bindKey(key, keyList[key]);\n }, this);\n };\n MultiHashHandler.prototype._buildKeyHash = function (command) {\n this.bindKey(command.bindKey, command);\n };\n MultiHashHandler.prototype.parseKeys = function (keys) {\n var parts = keys.toLowerCase().split(/[\\-\\+]([\\-\\+])?/).filter(function (x) { return x; });\n var key = parts.pop();\n var keyCode = keyUtil[key];\n if (keyUtil.FUNCTION_KEYS[keyCode])\n key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase();\n else if (!parts.length)\n return { key: key, hashId: -1 };\n else if (parts.length == 1 && parts[0] == \"shift\")\n return { key: key.toUpperCase(), hashId: -1 };\n var hashId = 0;\n for (var i = parts.length; i--;) {\n var modifier = keyUtil.KEY_MODS[parts[i]];\n if (modifier == null) {\n if (typeof console != \"undefined\")\n console.error(\"invalid modifier \" + parts[i] + \" in \" + keys);\n return false;\n }\n hashId |= modifier;\n }\n return { key: key, hashId: hashId };\n };\n MultiHashHandler.prototype.findKeyCommand = function (hashId, keyString) {\n var key = KEY_MODS[hashId] + keyString;\n return this.commandKeyBinding[key];\n };\n MultiHashHandler.prototype.handleKeyboard = function (data, hashId, keyString, keyCode) {\n if (keyCode < 0)\n return;\n var key = KEY_MODS[hashId] + keyString;\n var command = this.commandKeyBinding[key];\n if (data.$keyChain) {\n data.$keyChain += \" \" + key;\n command = this.commandKeyBinding[data.$keyChain] || command;\n }\n if (command) {\n if (command == \"chainKeys\" || command[command.length - 1] == \"chainKeys\") {\n data.$keyChain = data.$keyChain || key;\n return { command: \"null\" };\n }\n }\n if (data.$keyChain) {\n if ((!hashId || hashId == 4) && keyString.length == 1)\n data.$keyChain = data.$keyChain.slice(0, -key.length - 1); // wait for input\n else if (hashId == -1 || keyCode > 0)\n data.$keyChain = \"\"; // reset keyChain\n }\n return { command: command };\n };\n MultiHashHandler.prototype.getStatusText = function (editor, data) {\n return data.$keyChain || \"\";\n };\n return MultiHashHandler;\n}());\nfunction getPosition(command) {\n return typeof command == \"object\" && command.bindKey\n && command.bindKey.position\n || (command.isDefault ? -100 : 0);\n}\nvar HashHandler = /** @class */ (function (_super) {\n __extends(HashHandler, _super);\n function HashHandler(config, platform) {\n var _this = _super.call(this, config, platform) || this;\n _this.$singleCommand = true;\n return _this;\n }\n return HashHandler;\n}(MultiHashHandler));\nHashHandler.call = function (thisArg, config, platform) {\n MultiHashHandler.prototype.$init.call(thisArg, config, platform, true);\n};\nMultiHashHandler.call = function (thisArg, config, platform) {\n MultiHashHandler.prototype.$init.call(thisArg, config, platform, false);\n};\nexports.HashHandler = HashHandler;\nexports.MultiHashHandler = MultiHashHandler;\n\n});\n\nace.define(\"ace/commands/command_manager\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/keyboard/hash_handler\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar oop = require(\"../lib/oop\");\nvar MultiHashHandler = require(\"../keyboard/hash_handler\").MultiHashHandler;\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar CommandManager = /** @class */ (function (_super) {\n __extends(CommandManager, _super);\n function CommandManager(platform, commands) {\n var _this = _super.call(this, commands, platform) || this;\n _this.byName = _this.commands;\n _this.setDefaultHandler(\"exec\", function (e) {\n if (!e.args) {\n return e.command.exec(e.editor, {}, e.event, true);\n }\n return e.command.exec(e.editor, e.args, e.event, false);\n });\n return _this;\n }\n CommandManager.prototype.exec = function (command, editor, args) {\n if (Array.isArray(command)) {\n for (var i = command.length; i--;) {\n if (this.exec(command[i], editor, args))\n return true;\n }\n return false;\n }\n if (typeof command === \"string\")\n command = this.commands[command];\n if (!command)\n return false;\n if (editor && editor.$readOnly && !command.readOnly)\n return false;\n if (this.$checkCommandState != false && command.isAvailable && !command.isAvailable(editor))\n return false;\n var e = { editor: editor, command: command, args: args };\n e.returnValue = this._emit(\"exec\", e);\n this._signal(\"afterExec\", e);\n return e.returnValue === false ? false : true;\n };\n CommandManager.prototype.toggleRecording = function (editor) {\n if (this.$inReplay)\n return;\n editor && editor._emit(\"changeStatus\");\n if (this.recording) {\n this.macro.pop();\n this.off(\"exec\", this.$addCommandToMacro);\n if (!this.macro.length)\n this.macro = this.oldMacro;\n return this.recording = false;\n }\n if (!this.$addCommandToMacro) {\n this.$addCommandToMacro = function (e) {\n this.macro.push([e.command, e.args]);\n }.bind(this);\n }\n this.oldMacro = this.macro;\n this.macro = [];\n this.on(\"exec\", this.$addCommandToMacro);\n return this.recording = true;\n };\n CommandManager.prototype.replay = function (editor) {\n if (this.$inReplay || !this.macro)\n return;\n if (this.recording)\n return this.toggleRecording(editor);\n try {\n this.$inReplay = true;\n this.macro.forEach(function (x) {\n if (typeof x == \"string\")\n this.exec(x, editor);\n else\n this.exec(x[0], editor, x[1]);\n }, this);\n }\n finally {\n this.$inReplay = false;\n }\n };\n CommandManager.prototype.trimMacro = function (m) {\n return m.map(function (x) {\n if (typeof x[0] != \"string\")\n x[0] = x[0].name;\n if (!x[1])\n x = x[0];\n return x;\n });\n };\n return CommandManager;\n}(MultiHashHandler));\noop.implement(CommandManager.prototype, EventEmitter);\nexports.CommandManager = CommandManager;\n\n});\n\nace.define(\"ace/commands/default_commands\",[\"require\",\"exports\",\"module\",\"ace/lib/lang\",\"ace/config\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar lang = require(\"../lib/lang\");\nvar config = require(\"../config\");\nvar Range = require(\"../range\").Range;\nfunction bindKey(win, mac) {\n return { win: win, mac: mac };\n}\nexports.commands = [{\n name: \"showSettingsMenu\",\n description: \"Show settings menu\",\n bindKey: bindKey(\"Ctrl-,\", \"Command-,\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/settings_menu\", function (module) {\n module.init(editor);\n editor.showSettingsMenu();\n });\n },\n readOnly: true\n }, {\n name: \"goToNextError\",\n description: \"Go to next error\",\n bindKey: bindKey(\"Alt-E\", \"F4\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/error_marker\", function (module) {\n module.showErrorMarker(editor, 1);\n });\n },\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"goToPreviousError\",\n description: \"Go to previous error\",\n bindKey: bindKey(\"Alt-Shift-E\", \"Shift-F4\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/error_marker\", function (module) {\n module.showErrorMarker(editor, -1);\n });\n },\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"selectall\",\n description: \"Select all\",\n bindKey: bindKey(\"Ctrl-A\", \"Command-A\"),\n exec: function (editor) { editor.selectAll(); },\n readOnly: true\n }, {\n name: \"centerselection\",\n description: \"Center selection\",\n bindKey: bindKey(null, \"Ctrl-L\"),\n exec: function (editor) { editor.centerSelection(); },\n readOnly: true\n }, {\n name: \"gotoline\",\n description: \"Go to line...\",\n bindKey: bindKey(\"Ctrl-L\", \"Command-L\"),\n exec: function (editor, line) {\n if (typeof line === \"number\" && !isNaN(line))\n editor.gotoLine(line);\n editor.prompt({ $type: \"gotoLine\" });\n },\n readOnly: true\n }, {\n name: \"fold\",\n bindKey: bindKey(\"Alt-L|Ctrl-F1\", \"Command-Alt-L|Command-F1\"),\n exec: function (editor) { editor.session.toggleFold(false); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"unfold\",\n bindKey: bindKey(\"Alt-Shift-L|Ctrl-Shift-F1\", \"Command-Alt-Shift-L|Command-Shift-F1\"),\n exec: function (editor) { editor.session.toggleFold(true); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"toggleFoldWidget\",\n description: \"Toggle fold widget\",\n bindKey: bindKey(\"F2\", \"F2\"),\n exec: function (editor) { editor.session.toggleFoldWidget(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"toggleParentFoldWidget\",\n description: \"Toggle parent fold widget\",\n bindKey: bindKey(\"Alt-F2\", \"Alt-F2\"),\n exec: function (editor) { editor.session.toggleFoldWidget(true); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"foldall\",\n description: \"Fold all\",\n bindKey: bindKey(null, \"Ctrl-Command-Option-0\"),\n exec: function (editor) { editor.session.foldAll(); },\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"foldAllComments\",\n description: \"Fold all comments\",\n bindKey: bindKey(null, \"Ctrl-Command-Option-0\"),\n exec: function (editor) { editor.session.foldAllComments(); },\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"foldOther\",\n description: \"Fold other\",\n bindKey: bindKey(\"Alt-0\", \"Command-Option-0\"),\n exec: function (editor) {\n editor.session.foldAll();\n editor.session.unfold(editor.selection.getAllRanges());\n },\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"unfoldall\",\n description: \"Unfold all\",\n bindKey: bindKey(\"Alt-Shift-0\", \"Command-Option-Shift-0\"),\n exec: function (editor) { editor.session.unfold(); },\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"findnext\",\n description: \"Find next\",\n bindKey: bindKey(\"Ctrl-K\", \"Command-G\"),\n exec: function (editor) { editor.findNext(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"findprevious\",\n description: \"Find previous\",\n bindKey: bindKey(\"Ctrl-Shift-K\", \"Command-Shift-G\"),\n exec: function (editor) { editor.findPrevious(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"center\",\n readOnly: true\n }, {\n name: \"selectOrFindNext\",\n description: \"Select or find next\",\n bindKey: bindKey(\"Alt-K\", \"Ctrl-G\"),\n exec: function (editor) {\n if (editor.selection.isEmpty())\n editor.selection.selectWord();\n else\n editor.findNext();\n },\n readOnly: true\n }, {\n name: \"selectOrFindPrevious\",\n description: \"Select or find previous\",\n bindKey: bindKey(\"Alt-Shift-K\", \"Ctrl-Shift-G\"),\n exec: function (editor) {\n if (editor.selection.isEmpty())\n editor.selection.selectWord();\n else\n editor.findPrevious();\n },\n readOnly: true\n }, {\n name: \"find\",\n description: \"Find\",\n bindKey: bindKey(\"Ctrl-F\", \"Command-F\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/searchbox\", function (e) { e.Search(editor); });\n },\n readOnly: true\n }, {\n name: \"overwrite\",\n description: \"Overwrite\",\n bindKey: \"Insert\",\n exec: function (editor) { editor.toggleOverwrite(); },\n readOnly: true\n }, {\n name: \"selecttostart\",\n description: \"Select to start\",\n bindKey: bindKey(\"Ctrl-Shift-Home\", \"Command-Shift-Home|Command-Shift-Up\"),\n exec: function (editor) { editor.getSelection().selectFileStart(); },\n multiSelectAction: \"forEach\",\n readOnly: true,\n scrollIntoView: \"animate\",\n aceCommandGroup: \"fileJump\"\n }, {\n name: \"gotostart\",\n description: \"Go to start\",\n bindKey: bindKey(\"Ctrl-Home\", \"Command-Home|Command-Up\"),\n exec: function (editor) { editor.navigateFileStart(); },\n multiSelectAction: \"forEach\",\n readOnly: true,\n scrollIntoView: \"animate\",\n aceCommandGroup: \"fileJump\"\n }, {\n name: \"selectup\",\n description: \"Select up\",\n bindKey: bindKey(\"Shift-Up\", \"Shift-Up|Ctrl-Shift-P\"),\n exec: function (editor) { editor.getSelection().selectUp(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"golineup\",\n description: \"Go line up\",\n bindKey: bindKey(\"Up\", \"Up|Ctrl-P\"),\n exec: function (editor, args) { editor.navigateUp(args.times); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selecttoend\",\n description: \"Select to end\",\n bindKey: bindKey(\"Ctrl-Shift-End\", \"Command-Shift-End|Command-Shift-Down\"),\n exec: function (editor) { editor.getSelection().selectFileEnd(); },\n multiSelectAction: \"forEach\",\n readOnly: true,\n scrollIntoView: \"animate\",\n aceCommandGroup: \"fileJump\"\n }, {\n name: \"gotoend\",\n description: \"Go to end\",\n bindKey: bindKey(\"Ctrl-End\", \"Command-End|Command-Down\"),\n exec: function (editor) { editor.navigateFileEnd(); },\n multiSelectAction: \"forEach\",\n readOnly: true,\n scrollIntoView: \"animate\",\n aceCommandGroup: \"fileJump\"\n }, {\n name: \"selectdown\",\n description: \"Select down\",\n bindKey: bindKey(\"Shift-Down\", \"Shift-Down|Ctrl-Shift-N\"),\n exec: function (editor) { editor.getSelection().selectDown(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"golinedown\",\n description: \"Go line down\",\n bindKey: bindKey(\"Down\", \"Down|Ctrl-N\"),\n exec: function (editor, args) { editor.navigateDown(args.times); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectwordleft\",\n description: \"Select word left\",\n bindKey: bindKey(\"Ctrl-Shift-Left\", \"Option-Shift-Left\"),\n exec: function (editor) { editor.getSelection().selectWordLeft(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotowordleft\",\n description: \"Go to word left\",\n bindKey: bindKey(\"Ctrl-Left\", \"Option-Left\"),\n exec: function (editor) { editor.navigateWordLeft(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selecttolinestart\",\n description: \"Select to line start\",\n bindKey: bindKey(\"Alt-Shift-Left\", \"Command-Shift-Left|Ctrl-Shift-A\"),\n exec: function (editor) { editor.getSelection().selectLineStart(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotolinestart\",\n description: \"Go to line start\",\n bindKey: bindKey(\"Alt-Left|Home\", \"Command-Left|Home|Ctrl-A\"),\n exec: function (editor) { editor.navigateLineStart(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectleft\",\n description: \"Select left\",\n bindKey: bindKey(\"Shift-Left\", \"Shift-Left|Ctrl-Shift-B\"),\n exec: function (editor) { editor.getSelection().selectLeft(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotoleft\",\n description: \"Go to left\",\n bindKey: bindKey(\"Left\", \"Left|Ctrl-B\"),\n exec: function (editor, args) { editor.navigateLeft(args.times); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectwordright\",\n description: \"Select word right\",\n bindKey: bindKey(\"Ctrl-Shift-Right\", \"Option-Shift-Right\"),\n exec: function (editor) { editor.getSelection().selectWordRight(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotowordright\",\n description: \"Go to word right\",\n bindKey: bindKey(\"Ctrl-Right\", \"Option-Right\"),\n exec: function (editor) { editor.navigateWordRight(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selecttolineend\",\n description: \"Select to line end\",\n bindKey: bindKey(\"Alt-Shift-Right\", \"Command-Shift-Right|Shift-End|Ctrl-Shift-E\"),\n exec: function (editor) { editor.getSelection().selectLineEnd(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotolineend\",\n description: \"Go to line end\",\n bindKey: bindKey(\"Alt-Right|End\", \"Command-Right|End|Ctrl-E\"),\n exec: function (editor) { editor.navigateLineEnd(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectright\",\n description: \"Select right\",\n bindKey: bindKey(\"Shift-Right\", \"Shift-Right\"),\n exec: function (editor) { editor.getSelection().selectRight(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"gotoright\",\n description: \"Go to right\",\n bindKey: bindKey(\"Right\", \"Right|Ctrl-F\"),\n exec: function (editor, args) { editor.navigateRight(args.times); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectpagedown\",\n description: \"Select page down\",\n bindKey: \"Shift-PageDown\",\n exec: function (editor) { editor.selectPageDown(); },\n readOnly: true\n }, {\n name: \"pagedown\",\n description: \"Page down\",\n bindKey: bindKey(null, \"Option-PageDown\"),\n exec: function (editor) { editor.scrollPageDown(); },\n readOnly: true\n }, {\n name: \"gotopagedown\",\n description: \"Go to page down\",\n bindKey: bindKey(\"PageDown\", \"PageDown|Ctrl-V\"),\n exec: function (editor) { editor.gotoPageDown(); },\n readOnly: true\n }, {\n name: \"selectpageup\",\n description: \"Select page up\",\n bindKey: \"Shift-PageUp\",\n exec: function (editor) { editor.selectPageUp(); },\n readOnly: true\n }, {\n name: \"pageup\",\n description: \"Page up\",\n bindKey: bindKey(null, \"Option-PageUp\"),\n exec: function (editor) { editor.scrollPageUp(); },\n readOnly: true\n }, {\n name: \"gotopageup\",\n description: \"Go to page up\",\n bindKey: \"PageUp\",\n exec: function (editor) { editor.gotoPageUp(); },\n readOnly: true\n }, {\n name: \"scrollup\",\n description: \"Scroll up\",\n bindKey: bindKey(\"Ctrl-Up\", null),\n exec: function (e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); },\n readOnly: true\n }, {\n name: \"scrolldown\",\n description: \"Scroll down\",\n bindKey: bindKey(\"Ctrl-Down\", null),\n exec: function (e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); },\n readOnly: true\n }, {\n name: \"selectlinestart\",\n description: \"Select line start\",\n bindKey: \"Shift-Home\",\n exec: function (editor) { editor.getSelection().selectLineStart(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectlineend\",\n description: \"Select line end\",\n bindKey: \"Shift-End\",\n exec: function (editor) { editor.getSelection().selectLineEnd(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"togglerecording\",\n description: \"Toggle recording\",\n bindKey: bindKey(\"Ctrl-Alt-E\", \"Command-Option-E\"),\n exec: function (editor) { editor.commands.toggleRecording(editor); },\n readOnly: true\n }, {\n name: \"replaymacro\",\n description: \"Replay macro\",\n bindKey: bindKey(\"Ctrl-Shift-E\", \"Command-Shift-E\"),\n exec: function (editor) { editor.commands.replay(editor); },\n readOnly: true\n }, {\n name: \"jumptomatching\",\n description: \"Jump to matching\",\n bindKey: bindKey(\"Ctrl-\\\\|Ctrl-P\", \"Command-\\\\\"),\n exec: function (editor) { editor.jumpToMatching(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"selecttomatching\",\n description: \"Select to matching\",\n bindKey: bindKey(\"Ctrl-Shift-\\\\|Ctrl-Shift-P\", \"Command-Shift-\\\\\"),\n exec: function (editor) { editor.jumpToMatching(true); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"expandToMatching\",\n description: \"Expand to matching\",\n bindKey: bindKey(\"Ctrl-Shift-M\", \"Ctrl-Shift-M\"),\n exec: function (editor) { editor.jumpToMatching(true, true); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"animate\",\n readOnly: true\n }, {\n name: \"passKeysToBrowser\",\n description: \"Pass keys to browser\",\n bindKey: bindKey(null, null),\n exec: function () { },\n passEvent: true,\n readOnly: true\n }, {\n name: \"copy\",\n description: \"Copy\",\n exec: function (editor) {\n },\n readOnly: true\n },\n {\n name: \"cut\",\n description: \"Cut\",\n exec: function (editor) {\n var cutLine = editor.$copyWithEmptySelection && editor.selection.isEmpty();\n var range = cutLine ? editor.selection.getLineRange() : editor.selection.getRange();\n editor._emit(\"cut\", range);\n if (!range.isEmpty())\n editor.session.remove(range);\n editor.clearSelection();\n },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEach\"\n }, {\n name: \"paste\",\n description: \"Paste\",\n exec: function (editor, args) {\n editor.$handlePaste(args);\n },\n scrollIntoView: \"cursor\"\n }, {\n name: \"removeline\",\n description: \"Remove line\",\n bindKey: bindKey(\"Ctrl-D\", \"Command-D\"),\n exec: function (editor) { editor.removeLines(); },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEachLine\"\n }, {\n name: \"duplicateSelection\",\n description: \"Duplicate selection\",\n bindKey: bindKey(\"Ctrl-Shift-D\", \"Command-Shift-D\"),\n exec: function (editor) { editor.duplicateSelection(); },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEach\"\n }, {\n name: \"sortlines\",\n description: \"Sort lines\",\n bindKey: bindKey(\"Ctrl-Alt-S\", \"Command-Alt-S\"),\n exec: function (editor) { editor.sortLines(); },\n scrollIntoView: \"selection\",\n multiSelectAction: \"forEachLine\"\n }, {\n name: \"togglecomment\",\n description: \"Toggle comment\",\n bindKey: bindKey(\"Ctrl-/\", \"Command-/\"),\n exec: function (editor) { editor.toggleCommentLines(); },\n multiSelectAction: \"forEachLine\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"toggleBlockComment\",\n description: \"Toggle block comment\",\n bindKey: bindKey(\"Ctrl-Shift-/\", \"Command-Shift-/\"),\n exec: function (editor) { editor.toggleBlockComment(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"modifyNumberUp\",\n description: \"Modify number up\",\n bindKey: bindKey(\"Ctrl-Shift-Up\", \"Alt-Shift-Up\"),\n exec: function (editor) { editor.modifyNumber(1); },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEach\"\n }, {\n name: \"modifyNumberDown\",\n description: \"Modify number down\",\n bindKey: bindKey(\"Ctrl-Shift-Down\", \"Alt-Shift-Down\"),\n exec: function (editor) { editor.modifyNumber(-1); },\n scrollIntoView: \"cursor\",\n multiSelectAction: \"forEach\"\n }, {\n name: \"replace\",\n description: \"Replace\",\n bindKey: bindKey(\"Ctrl-H\", \"Command-Option-F\"),\n exec: function (editor) {\n config.loadModule(\"ace/ext/searchbox\", function (e) { e.Search(editor, true); });\n }\n }, {\n name: \"undo\",\n description: \"Undo\",\n bindKey: bindKey(\"Ctrl-Z\", \"Command-Z\"),\n exec: function (editor) { editor.undo(); }\n }, {\n name: \"redo\",\n description: \"Redo\",\n bindKey: bindKey(\"Ctrl-Shift-Z|Ctrl-Y\", \"Command-Shift-Z|Command-Y\"),\n exec: function (editor) { editor.redo(); }\n }, {\n name: \"copylinesup\",\n description: \"Copy lines up\",\n bindKey: bindKey(\"Alt-Shift-Up\", \"Command-Option-Up\"),\n exec: function (editor) { editor.copyLinesUp(); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"movelinesup\",\n description: \"Move lines up\",\n bindKey: bindKey(\"Alt-Up\", \"Option-Up\"),\n exec: function (editor) { editor.moveLinesUp(); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"copylinesdown\",\n description: \"Copy lines down\",\n bindKey: bindKey(\"Alt-Shift-Down\", \"Command-Option-Down\"),\n exec: function (editor) { editor.copyLinesDown(); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"movelinesdown\",\n description: \"Move lines down\",\n bindKey: bindKey(\"Alt-Down\", \"Option-Down\"),\n exec: function (editor) { editor.moveLinesDown(); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"del\",\n description: \"Delete\",\n bindKey: bindKey(\"Delete\", \"Delete|Ctrl-D|Shift-Delete\"),\n exec: function (editor) { editor.remove(\"right\"); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"backspace\",\n description: \"Backspace\",\n bindKey: bindKey(\"Shift-Backspace|Backspace\", \"Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H\"),\n exec: function (editor) { editor.remove(\"left\"); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"cut_or_delete\",\n description: \"Cut or delete\",\n bindKey: bindKey(\"Shift-Delete\", null),\n exec: function (editor) {\n if (editor.selection.isEmpty()) {\n editor.remove(\"left\");\n }\n else {\n return false;\n }\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removetolinestart\",\n description: \"Remove to line start\",\n bindKey: bindKey(\"Alt-Backspace\", \"Command-Backspace\"),\n exec: function (editor) { editor.removeToLineStart(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removetolineend\",\n description: \"Remove to line end\",\n bindKey: bindKey(\"Alt-Delete\", \"Ctrl-K|Command-Delete\"),\n exec: function (editor) { editor.removeToLineEnd(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removetolinestarthard\",\n description: \"Remove to line start hard\",\n bindKey: bindKey(\"Ctrl-Shift-Backspace\", null),\n exec: function (editor) {\n var range = editor.selection.getRange();\n range.start.column = 0;\n editor.session.remove(range);\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removetolineendhard\",\n description: \"Remove to line end hard\",\n bindKey: bindKey(\"Ctrl-Shift-Delete\", null),\n exec: function (editor) {\n var range = editor.selection.getRange();\n range.end.column = Number.MAX_VALUE;\n editor.session.remove(range);\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removewordleft\",\n description: \"Remove word left\",\n bindKey: bindKey(\"Ctrl-Backspace\", \"Alt-Backspace|Ctrl-Alt-Backspace\"),\n exec: function (editor) { editor.removeWordLeft(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"removewordright\",\n description: \"Remove word right\",\n bindKey: bindKey(\"Ctrl-Delete\", \"Alt-Delete\"),\n exec: function (editor) { editor.removeWordRight(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"outdent\",\n description: \"Outdent\",\n bindKey: bindKey(\"Shift-Tab\", \"Shift-Tab\"),\n exec: function (editor) { editor.blockOutdent(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"indent\",\n description: \"Indent\",\n bindKey: bindKey(\"Tab\", \"Tab\"),\n exec: function (editor) { editor.indent(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"blockoutdent\",\n description: \"Block outdent\",\n bindKey: bindKey(\"Ctrl-[\", \"Ctrl-[\"),\n exec: function (editor) { editor.blockOutdent(); },\n multiSelectAction: \"forEachLine\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"blockindent\",\n description: \"Block indent\",\n bindKey: bindKey(\"Ctrl-]\", \"Ctrl-]\"),\n exec: function (editor) { editor.blockIndent(); },\n multiSelectAction: \"forEachLine\",\n scrollIntoView: \"selectionPart\"\n }, {\n name: \"insertstring\",\n description: \"Insert string\",\n exec: function (editor, str) { editor.insert(str); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"inserttext\",\n description: \"Insert text\",\n exec: function (editor, args) {\n editor.insert(lang.stringRepeat(args.text || \"\", args.times || 1));\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"splitline\",\n description: \"Split line\",\n bindKey: bindKey(null, \"Ctrl-O\"),\n exec: function (editor) { editor.splitLine(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"transposeletters\",\n description: \"Transpose letters\",\n bindKey: bindKey(\"Alt-Shift-X\", \"Ctrl-T\"),\n exec: function (editor) { editor.transposeLetters(); },\n multiSelectAction: function (editor) { editor.transposeSelections(1); },\n scrollIntoView: \"cursor\"\n }, {\n name: \"touppercase\",\n description: \"To uppercase\",\n bindKey: bindKey(\"Ctrl-U\", \"Ctrl-U\"),\n exec: function (editor) { editor.toUpperCase(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"tolowercase\",\n description: \"To lowercase\",\n bindKey: bindKey(\"Ctrl-Shift-U\", \"Ctrl-Shift-U\"),\n exec: function (editor) { editor.toLowerCase(); },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"autoindent\",\n description: \"Auto Indent\",\n bindKey: bindKey(null, null),\n exec: function (editor) { editor.autoIndent(); },\n scrollIntoView: \"animate\"\n }, {\n name: \"expandtoline\",\n description: \"Expand to line\",\n bindKey: bindKey(\"Ctrl-Shift-L\", \"Command-Shift-L\"),\n exec: function (editor) {\n var range = editor.selection.getRange();\n range.start.column = range.end.column = 0;\n range.end.row++;\n editor.selection.setRange(range, false);\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"openlink\",\n bindKey: bindKey(\"Ctrl+F3\", \"F3\"),\n exec: function (editor) { editor.openLink(); }\n }, {\n name: \"joinlines\",\n description: \"Join lines\",\n bindKey: bindKey(null, null),\n exec: function (editor) {\n var isBackwards = editor.selection.isBackwards();\n var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor();\n var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead();\n var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length;\n var selectedText = editor.session.doc.getTextRange(editor.selection.getRange());\n var selectedCount = selectedText.replace(/\\n\\s*/, \" \").length;\n var insertLine = editor.session.doc.getLine(selectionStart.row);\n for (var i = selectionStart.row + 1; i <= selectionEnd.row + 1; i++) {\n var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i)));\n if (curLine.length !== 0) {\n curLine = \" \" + curLine;\n }\n insertLine += curLine;\n }\n if (selectionEnd.row + 1 < (editor.session.doc.getLength() - 1)) {\n insertLine += editor.session.doc.getNewLineCharacter();\n }\n editor.clearSelection();\n editor.session.doc.replace(new Range(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine);\n if (selectedCount > 0) {\n editor.selection.moveCursorTo(selectionStart.row, selectionStart.column);\n editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount);\n }\n else {\n firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? (firstLineEndCol + 1) : firstLineEndCol;\n editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol);\n }\n },\n multiSelectAction: \"forEach\",\n readOnly: true\n }, {\n name: \"invertSelection\",\n description: \"Invert selection\",\n bindKey: bindKey(null, null),\n exec: function (editor) {\n var endRow = editor.session.doc.getLength() - 1;\n var endCol = editor.session.doc.getLine(endRow).length;\n var ranges = editor.selection.rangeList.ranges;\n var newRanges = [];\n if (ranges.length < 1) {\n ranges = [editor.selection.getRange()];\n }\n for (var i = 0; i < ranges.length; i++) {\n if (i == (ranges.length - 1)) {\n if (!(ranges[i].end.row === endRow && ranges[i].end.column === endCol)) {\n newRanges.push(new Range(ranges[i].end.row, ranges[i].end.column, endRow, endCol));\n }\n }\n if (i === 0) {\n if (!(ranges[i].start.row === 0 && ranges[i].start.column === 0)) {\n newRanges.push(new Range(0, 0, ranges[i].start.row, ranges[i].start.column));\n }\n }\n else {\n newRanges.push(new Range(ranges[i - 1].end.row, ranges[i - 1].end.column, ranges[i].start.row, ranges[i].start.column));\n }\n }\n editor.exitMultiSelectMode();\n editor.clearSelection();\n for (var i = 0; i < newRanges.length; i++) {\n editor.selection.addRange(newRanges[i], false);\n }\n },\n readOnly: true,\n scrollIntoView: \"none\"\n }, {\n name: \"addLineAfter\",\n description: \"Add new line after the current line\",\n exec: function (editor) {\n editor.selection.clearSelection();\n editor.navigateLineEnd();\n editor.insert(\"\\n\");\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"addLineBefore\",\n description: \"Add new line before the current line\",\n exec: function (editor) {\n editor.selection.clearSelection();\n var cursor = editor.getCursorPosition();\n editor.selection.moveTo(cursor.row - 1, Number.MAX_VALUE);\n editor.insert(\"\\n\");\n if (cursor.row === 0)\n editor.navigateUp();\n },\n multiSelectAction: \"forEach\",\n scrollIntoView: \"cursor\"\n }, {\n name: \"openCommandPallete\",\n exec: function (editor) {\n console.warn(\"This is an obsolete command. Please use `openCommandPalette` instead.\");\n editor.prompt({ $type: \"commands\" });\n },\n readOnly: true\n }, {\n name: \"openCommandPalette\",\n description: \"Open command palette\",\n bindKey: bindKey(\"F1\", \"F1\"),\n exec: function (editor) {\n editor.prompt({ $type: \"commands\" });\n },\n readOnly: true\n }, {\n name: \"modeSelect\",\n description: \"Change language mode...\",\n bindKey: bindKey(null, null),\n exec: function (editor) {\n editor.prompt({ $type: \"modes\" });\n },\n readOnly: true\n }];\nfor (var i = 1; i < 9; i++) {\n exports.commands.push({\n name: \"foldToLevel\" + i,\n description: \"Fold To Level \" + i,\n level: i,\n exec: function (editor) { editor.session.foldToLevel(this.level); },\n scrollIntoView: \"center\",\n readOnly: true\n });\n}\n\n});\n\nace.define(\"ace/line_widgets\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"./lib/dom\");\nvar LineWidgets = /** @class */ (function () {\n function LineWidgets(session) {\n this.session = session;\n this.session.widgetManager = this;\n this.session.getRowLength = this.getRowLength;\n this.session.$getWidgetScreenLength = this.$getWidgetScreenLength;\n this.updateOnChange = this.updateOnChange.bind(this);\n this.renderWidgets = this.renderWidgets.bind(this);\n this.measureWidgets = this.measureWidgets.bind(this);\n this.session._changedWidgets = [];\n this.$onChangeEditor = this.$onChangeEditor.bind(this);\n this.session.on(\"change\", this.updateOnChange);\n this.session.on(\"changeFold\", this.updateOnFold);\n this.session.on(\"changeEditor\", this.$onChangeEditor);\n }\n LineWidgets.prototype.getRowLength = function (row) {\n var h;\n if (this.lineWidgets)\n h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;\n else\n h = 0;\n if (!this[\"$useWrapMode\"] || !this[\"$wrapData\"][row]) {\n return 1 + h;\n }\n else {\n return this[\"$wrapData\"][row].length + 1 + h;\n }\n };\n LineWidgets.prototype.$getWidgetScreenLength = function () {\n var screenRows = 0;\n this.lineWidgets.forEach(function (w) {\n if (w && w.rowCount && !w.hidden)\n screenRows += w.rowCount;\n });\n return screenRows;\n };\n LineWidgets.prototype.$onChangeEditor = function (e) {\n this.attach(e.editor);\n };\n LineWidgets.prototype.attach = function (editor) {\n if (editor && editor.widgetManager && editor.widgetManager != this)\n editor.widgetManager.detach();\n if (this.editor == editor)\n return;\n this.detach();\n this.editor = editor;\n if (editor) {\n editor.widgetManager = this;\n editor.renderer.on(\"beforeRender\", this.measureWidgets);\n editor.renderer.on(\"afterRender\", this.renderWidgets);\n }\n };\n LineWidgets.prototype.detach = function (e) {\n var editor = this.editor;\n if (!editor)\n return;\n this.editor = null;\n editor.widgetManager = null;\n editor.renderer.off(\"beforeRender\", this.measureWidgets);\n editor.renderer.off(\"afterRender\", this.renderWidgets);\n var lineWidgets = this.session.lineWidgets;\n lineWidgets && lineWidgets.forEach(function (w) {\n if (w && w.el && w.el.parentNode) {\n w._inDocument = false;\n w.el.parentNode.removeChild(w.el);\n }\n });\n };\n LineWidgets.prototype.updateOnFold = function (e, session) {\n var lineWidgets = session.lineWidgets;\n if (!lineWidgets || !e.action)\n return;\n var fold = e.data;\n var start = fold.start.row;\n var end = fold.end.row;\n var hide = e.action == \"add\";\n for (var i = start + 1; i < end; i++) {\n if (lineWidgets[i])\n lineWidgets[i].hidden = hide;\n }\n if (lineWidgets[end]) {\n if (hide) {\n if (!lineWidgets[start])\n lineWidgets[start] = lineWidgets[end];\n else\n lineWidgets[end].hidden = hide;\n }\n else {\n if (lineWidgets[start] == lineWidgets[end])\n lineWidgets[start] = undefined;\n lineWidgets[end].hidden = hide;\n }\n }\n };\n LineWidgets.prototype.updateOnChange = function (delta) {\n var lineWidgets = this.session.lineWidgets;\n if (!lineWidgets)\n return;\n var startRow = delta.start.row;\n var len = delta.end.row - startRow;\n if (len === 0) {\n }\n else if (delta.action == \"remove\") {\n var removed = lineWidgets.splice(startRow + 1, len);\n if (!lineWidgets[startRow] && removed[removed.length - 1]) {\n lineWidgets[startRow] = removed.pop();\n }\n removed.forEach(function (w) {\n w && this.removeLineWidget(w);\n }, this);\n this.$updateRows();\n }\n else {\n var args = new Array(len);\n if (lineWidgets[startRow] && lineWidgets[startRow].column != null) {\n if (delta.start.column > lineWidgets[startRow].column)\n startRow++;\n }\n args.unshift(startRow, 0);\n lineWidgets.splice.apply(lineWidgets, args);\n this.$updateRows();\n }\n };\n LineWidgets.prototype.$updateRows = function () {\n var lineWidgets = this.session.lineWidgets;\n if (!lineWidgets)\n return;\n var noWidgets = true;\n lineWidgets.forEach(function (w, i) {\n if (w) {\n noWidgets = false;\n w.row = i;\n while (w.$oldWidget) {\n w.$oldWidget.row = i;\n w = w.$oldWidget;\n }\n }\n });\n if (noWidgets)\n this.session.lineWidgets = null;\n };\n LineWidgets.prototype.$registerLineWidget = function (w) {\n if (!this.session.lineWidgets)\n this.session.lineWidgets = new Array(this.session.getLength());\n var old = this.session.lineWidgets[w.row];\n if (old) {\n w.$oldWidget = old;\n if (old.el && old.el.parentNode) {\n old.el.parentNode.removeChild(old.el);\n old._inDocument = false;\n }\n }\n this.session.lineWidgets[w.row] = w;\n return w;\n };\n LineWidgets.prototype.addLineWidget = function (w) {\n this.$registerLineWidget(w);\n w.session = this.session;\n if (!this.editor)\n return w;\n var renderer = this.editor.renderer;\n if (w.html && !w.el) {\n w.el = dom.createElement(\"div\");\n w.el.innerHTML = w.html;\n }\n if (w.text && !w.el) {\n w.el = dom.createElement(\"div\");\n w.el.textContent = w.text;\n }\n if (w.el) {\n dom.addCssClass(w.el, \"ace_lineWidgetContainer\");\n if (w.className) {\n dom.addCssClass(w.el, w.className);\n }\n w.el.style.position = \"absolute\";\n w.el.style.zIndex = \"5\";\n renderer.container.appendChild(w.el);\n w._inDocument = true;\n if (!w.coverGutter) {\n w.el.style.zIndex = \"3\";\n }\n if (w.pixelHeight == null) {\n w.pixelHeight = w.el.offsetHeight;\n }\n }\n if (w.rowCount == null) {\n w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight;\n }\n var fold = this.session.getFoldAt(w.row, 0);\n w.$fold = fold;\n if (fold) {\n var lineWidgets = this.session.lineWidgets;\n if (w.row == fold.end.row && !lineWidgets[fold.start.row])\n lineWidgets[fold.start.row] = w;\n else\n w.hidden = true;\n }\n this.session._emit(\"changeFold\", { data: { start: { row: w.row } } });\n this.$updateRows();\n this.renderWidgets(null, renderer);\n this.onWidgetChanged(w);\n return w;\n };\n LineWidgets.prototype.removeLineWidget = function (w) {\n w._inDocument = false;\n w.session = null;\n if (w.el && w.el.parentNode)\n w.el.parentNode.removeChild(w.el);\n if (w.editor && w.editor.destroy)\n try {\n w.editor.destroy();\n }\n catch (e) { }\n if (this.session.lineWidgets) {\n var w1 = this.session.lineWidgets[w.row];\n if (w1 == w) {\n this.session.lineWidgets[w.row] = w.$oldWidget;\n if (w.$oldWidget)\n this.onWidgetChanged(w.$oldWidget);\n }\n else {\n while (w1) {\n if (w1.$oldWidget == w) {\n w1.$oldWidget = w.$oldWidget;\n break;\n }\n w1 = w1.$oldWidget;\n }\n }\n }\n this.session._emit(\"changeFold\", { data: { start: { row: w.row } } });\n this.$updateRows();\n };\n LineWidgets.prototype.getWidgetsAtRow = function (row) {\n var lineWidgets = this.session.lineWidgets;\n var w = lineWidgets && lineWidgets[row];\n var list = [];\n while (w) {\n list.push(w);\n w = w.$oldWidget;\n }\n return list;\n };\n LineWidgets.prototype.onWidgetChanged = function (w) {\n this.session._changedWidgets.push(w);\n this.editor && this.editor.renderer.updateFull();\n };\n LineWidgets.prototype.measureWidgets = function (e, renderer) {\n var changedWidgets = this.session._changedWidgets;\n var config = renderer.layerConfig;\n if (!changedWidgets || !changedWidgets.length)\n return;\n var min = Infinity;\n for (var i = 0; i < changedWidgets.length; i++) {\n var w = changedWidgets[i];\n if (!w || !w.el)\n continue;\n if (w.session != this.session)\n continue;\n if (!w._inDocument) {\n if (this.session.lineWidgets[w.row] != w)\n continue;\n w._inDocument = true;\n renderer.container.appendChild(w.el);\n }\n w.h = w.el.offsetHeight;\n if (!w.fixedWidth) {\n w.w = w.el.offsetWidth;\n w.screenWidth = Math.ceil(w.w / config.characterWidth);\n }\n var rowCount = w.h / config.lineHeight;\n if (w.coverLine) {\n rowCount -= this.session.getRowLineCount(w.row);\n if (rowCount < 0)\n rowCount = 0;\n }\n if (w.rowCount != rowCount) {\n w.rowCount = rowCount;\n if (w.row < min)\n min = w.row;\n }\n }\n if (min != Infinity) {\n this.session._emit(\"changeFold\", { data: { start: { row: min } } });\n this.session.lineWidgetWidth = null;\n }\n this.session._changedWidgets = [];\n };\n LineWidgets.prototype.renderWidgets = function (e, renderer) {\n var config = renderer.layerConfig;\n var lineWidgets = this.session.lineWidgets;\n if (!lineWidgets)\n return;\n var first = Math.min(this.firstRow, config.firstRow);\n var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length);\n while (first > 0 && !lineWidgets[first])\n first--;\n this.firstRow = config.firstRow;\n this.lastRow = config.lastRow;\n renderer.$cursorLayer.config = config;\n for (var i = first; i <= last; i++) {\n var w = lineWidgets[i];\n if (!w || !w.el)\n continue;\n if (w.hidden) {\n w.el.style.top = -100 - (w.pixelHeight || 0) + \"px\";\n continue;\n }\n if (!w._inDocument) {\n w._inDocument = true;\n renderer.container.appendChild(w.el);\n }\n var top = renderer.$cursorLayer.getPixelPosition({ row: i, column: 0 }, true).top;\n if (!w.coverLine)\n top += config.lineHeight * this.session.getRowLineCount(w.row);\n w.el.style.top = top - config.offset + \"px\";\n var left = w.coverGutter ? 0 : renderer.gutterWidth;\n if (!w.fixedWidth)\n left -= renderer.scrollLeft;\n w.el.style.left = left + \"px\";\n if (w.fullWidth && w.screenWidth) {\n w.el.style.minWidth = config.width + 2 * config.padding + \"px\";\n }\n if (w.fixedWidth) {\n w.el.style.right = renderer.scrollBar.getWidth() + \"px\";\n }\n else {\n w.el.style.right = \"\";\n }\n }\n };\n return LineWidgets;\n}());\nexports.LineWidgets = LineWidgets;\n\n});\n\nace.define(\"ace/keyboard/gutter_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/keys\",\"ace/mouse/default_gutter_handler\"], function(require, exports, module){\"use strict\";\nvar keys = require('../lib/keys');\nvar GutterTooltip = require(\"../mouse/default_gutter_handler\").GutterTooltip;\nvar GutterKeyboardHandler = /** @class */ (function () {\n function GutterKeyboardHandler(editor) {\n this.editor = editor;\n this.gutterLayer = editor.renderer.$gutterLayer;\n this.element = editor.renderer.$gutter;\n this.lines = editor.renderer.$gutterLayer.$lines;\n this.activeRowIndex = null;\n this.activeLane = null;\n this.annotationTooltip = new GutterTooltip(this.editor);\n }\n GutterKeyboardHandler.prototype.addListener = function () {\n this.element.addEventListener(\"keydown\", this.$onGutterKeyDown.bind(this));\n this.element.addEventListener(\"focusout\", this.$blurGutter.bind(this));\n this.editor.on(\"mousewheel\", this.$blurGutter.bind(this));\n };\n GutterKeyboardHandler.prototype.removeListener = function () {\n this.element.removeEventListener(\"keydown\", this.$onGutterKeyDown.bind(this));\n this.element.removeEventListener(\"focusout\", this.$blurGutter.bind(this));\n this.editor.off(\"mousewheel\", this.$blurGutter.bind(this));\n };\n GutterKeyboardHandler.prototype.$onGutterKeyDown = function (e) {\n if (this.annotationTooltip.isOpen) {\n e.preventDefault();\n if (e.keyCode === keys[\"escape\"])\n this.annotationTooltip.hideTooltip();\n return;\n }\n if (e.target === this.element) {\n if (e.keyCode != keys[\"enter\"]) {\n return;\n }\n e.preventDefault();\n var row = this.editor.getCursorPosition().row;\n if (!this.editor.isRowVisible(row))\n this.editor.scrollToLine(row, true, true);\n setTimeout(\n function () {\n var index = this.$rowToRowIndex(this.gutterLayer.$cursorCell.row);\n var nearestFoldIndex = this.$findNearestFoldWidget(index);\n var nearestAnnotationIndex = this.$findNearestAnnotation(index);\n if (nearestFoldIndex === null && nearestAnnotationIndex === null)\n return;\n if (nearestFoldIndex === null && nearestAnnotationIndex !== null) {\n this.activeRowIndex = nearestAnnotationIndex;\n this.activeLane = \"annotation\";\n this.$focusAnnotation(this.activeRowIndex);\n return;\n }\n if (nearestFoldIndex !== null && nearestAnnotationIndex === null) {\n this.activeRowIndex = nearestFoldIndex;\n this.activeLane = \"fold\";\n this.$focusFoldWidget(this.activeRowIndex);\n return;\n }\n if (Math.abs(nearestAnnotationIndex - index) < Math.abs(nearestFoldIndex - index)) {\n this.activeRowIndex = nearestAnnotationIndex;\n this.activeLane = \"annotation\";\n this.$focusAnnotation(this.activeRowIndex);\n return;\n }\n else {\n this.activeRowIndex = nearestFoldIndex;\n this.activeLane = \"fold\";\n this.$focusFoldWidget(this.activeRowIndex);\n return;\n }\n }.bind(this), 10);\n return;\n }\n this.$handleGutterKeyboardInteraction(e);\n setTimeout(function () {\n this.editor._signal(\"gutterkeydown\", new GutterKeyboardEvent(e, this));\n }.bind(this), 10);\n };\n GutterKeyboardHandler.prototype.$handleGutterKeyboardInteraction = function (e) {\n if (e.keyCode === keys[\"tab\"]) {\n e.preventDefault();\n return;\n }\n if (e.keyCode === keys[\"escape\"]) {\n e.preventDefault();\n this.$blurGutter();\n this.element.focus();\n this.lane = null;\n return;\n }\n if (e.keyCode === keys[\"up\"]) {\n e.preventDefault();\n switch (this.activeLane) {\n case \"fold\":\n this.$moveFoldWidgetUp();\n break;\n case \"annotation\":\n this.$moveAnnotationUp();\n break;\n }\n return;\n }\n if (e.keyCode === keys[\"down\"]) {\n e.preventDefault();\n switch (this.activeLane) {\n case \"fold\":\n this.$moveFoldWidgetDown();\n break;\n case \"annotation\":\n this.$moveAnnotationDown();\n break;\n }\n return;\n }\n if (e.keyCode === keys[\"left\"]) {\n e.preventDefault();\n this.$switchLane(\"annotation\");\n return;\n }\n if (e.keyCode === keys[\"right\"]) {\n e.preventDefault();\n this.$switchLane(\"fold\");\n return;\n }\n if (e.keyCode === keys[\"enter\"] || e.keyCode === keys[\"space\"]) {\n e.preventDefault();\n switch (this.activeLane) {\n case \"fold\":\n if (this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)] === 'start') {\n var rowFoldingWidget = this.$rowIndexToRow(this.activeRowIndex);\n this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex), e);\n setTimeout(\n function () {\n if (this.$rowIndexToRow(this.activeRowIndex) !== rowFoldingWidget) {\n this.$blurFoldWidget(this.activeRowIndex);\n this.activeRowIndex = this.$rowToRowIndex(rowFoldingWidget);\n this.$focusFoldWidget(this.activeRowIndex);\n }\n }.bind(this), 10);\n break;\n }\n else if (this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)] === 'end') {\n break;\n }\n return;\n case \"annotation\":\n var gutterElement = this.lines.cells[this.activeRowIndex].element.childNodes[2];\n var rect = gutterElement.getBoundingClientRect();\n var style = this.annotationTooltip.getElement().style;\n style.left = rect.right + \"px\";\n style.top = rect.bottom + \"px\";\n this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));\n break;\n }\n return;\n }\n };\n GutterKeyboardHandler.prototype.$blurGutter = function () {\n if (this.activeRowIndex !== null) {\n switch (this.activeLane) {\n case \"fold\":\n this.$blurFoldWidget(this.activeRowIndex);\n break;\n case \"annotation\":\n this.$blurAnnotation(this.activeRowIndex);\n break;\n }\n }\n if (this.annotationTooltip.isOpen)\n this.annotationTooltip.hideTooltip();\n return;\n };\n GutterKeyboardHandler.prototype.$isFoldWidgetVisible = function (index) {\n var isRowFullyVisible = this.editor.isRowFullyVisible(this.$rowIndexToRow(index));\n var isIconVisible = this.$getFoldWidget(index).style.display !== \"none\";\n return isRowFullyVisible && isIconVisible;\n };\n GutterKeyboardHandler.prototype.$isAnnotationVisible = function (index) {\n var isRowFullyVisible = this.editor.isRowFullyVisible(this.$rowIndexToRow(index));\n var isIconVisible = this.$getAnnotation(index).style.display !== \"none\";\n return isRowFullyVisible && isIconVisible;\n };\n GutterKeyboardHandler.prototype.$getFoldWidget = function (index) {\n var cell = this.lines.get(index);\n var element = cell.element;\n return element.childNodes[1];\n };\n GutterKeyboardHandler.prototype.$getAnnotation = function (index) {\n var cell = this.lines.get(index);\n var element = cell.element;\n return element.childNodes[2];\n };\n GutterKeyboardHandler.prototype.$findNearestFoldWidget = function (index) {\n if (this.$isFoldWidgetVisible(index))\n return index;\n var i = 0;\n while (index - i > 0 || index + i < this.lines.getLength() - 1) {\n i++;\n if (index - i >= 0 && this.$isFoldWidgetVisible(index - i))\n return index - i;\n if (index + i <= this.lines.getLength() - 1 && this.$isFoldWidgetVisible(index + i))\n return index + i;\n }\n return null;\n };\n GutterKeyboardHandler.prototype.$findNearestAnnotation = function (index) {\n if (this.$isAnnotationVisible(index))\n return index;\n var i = 0;\n while (index - i > 0 || index + i < this.lines.getLength() - 1) {\n i++;\n if (index - i >= 0 && this.$isAnnotationVisible(index - i))\n return index - i;\n if (index + i <= this.lines.getLength() - 1 && this.$isAnnotationVisible(index + i))\n return index + i;\n }\n return null;\n };\n GutterKeyboardHandler.prototype.$focusFoldWidget = function (index) {\n if (index == null)\n return;\n var foldWidget = this.$getFoldWidget(index);\n foldWidget.classList.add(this.editor.renderer.keyboardFocusClassName);\n foldWidget.focus();\n };\n GutterKeyboardHandler.prototype.$focusAnnotation = function (index) {\n if (index == null)\n return;\n var annotation = this.$getAnnotation(index);\n annotation.classList.add(this.editor.renderer.keyboardFocusClassName);\n annotation.focus();\n };\n GutterKeyboardHandler.prototype.$blurFoldWidget = function (index) {\n var foldWidget = this.$getFoldWidget(index);\n foldWidget.classList.remove(this.editor.renderer.keyboardFocusClassName);\n foldWidget.blur();\n };\n GutterKeyboardHandler.prototype.$blurAnnotation = function (index) {\n var annotation = this.$getAnnotation(index);\n annotation.classList.remove(this.editor.renderer.keyboardFocusClassName);\n annotation.blur();\n };\n GutterKeyboardHandler.prototype.$moveFoldWidgetUp = function () {\n var index = this.activeRowIndex;\n while (index > 0) {\n index--;\n if (this.$isFoldWidgetVisible(index)) {\n this.$blurFoldWidget(this.activeRowIndex);\n this.activeRowIndex = index;\n this.$focusFoldWidget(this.activeRowIndex);\n return;\n }\n }\n return;\n };\n GutterKeyboardHandler.prototype.$moveFoldWidgetDown = function () {\n var index = this.activeRowIndex;\n while (index < this.lines.getLength() - 1) {\n index++;\n if (this.$isFoldWidgetVisible(index)) {\n this.$blurFoldWidget(this.activeRowIndex);\n this.activeRowIndex = index;\n this.$focusFoldWidget(this.activeRowIndex);\n return;\n }\n }\n return;\n };\n GutterKeyboardHandler.prototype.$moveAnnotationUp = function () {\n var index = this.activeRowIndex;\n while (index > 0) {\n index--;\n if (this.$isAnnotationVisible(index)) {\n this.$blurAnnotation(this.activeRowIndex);\n this.activeRowIndex = index;\n this.$focusAnnotation(this.activeRowIndex);\n return;\n }\n }\n return;\n };\n GutterKeyboardHandler.prototype.$moveAnnotationDown = function () {\n var index = this.activeRowIndex;\n while (index < this.lines.getLength() - 1) {\n index++;\n if (this.$isAnnotationVisible(index)) {\n this.$blurAnnotation(this.activeRowIndex);\n this.activeRowIndex = index;\n this.$focusAnnotation(this.activeRowIndex);\n return;\n }\n }\n return;\n };\n GutterKeyboardHandler.prototype.$switchLane = function (desinationLane) {\n switch (desinationLane) {\n case \"annotation\":\n if (this.activeLane === \"annotation\") {\n break;\n }\n var annotationIndex = this.$findNearestAnnotation(this.activeRowIndex);\n if (annotationIndex == null) {\n break;\n }\n this.activeLane = \"annotation\";\n this.$blurFoldWidget(this.activeRowIndex);\n this.activeRowIndex = annotationIndex;\n this.$focusAnnotation(this.activeRowIndex);\n break;\n case \"fold\":\n if (this.activeLane === \"fold\") {\n break;\n }\n var foldWidgetIndex = this.$findNearestFoldWidget(this.activeRowIndex);\n if (foldWidgetIndex == null) {\n break;\n }\n this.activeLane = \"fold\";\n this.$blurAnnotation(this.activeRowIndex);\n this.activeRowIndex = foldWidgetIndex;\n this.$focusFoldWidget(this.activeRowIndex);\n break;\n }\n return;\n };\n GutterKeyboardHandler.prototype.$rowIndexToRow = function (index) {\n var cell = this.lines.get(index);\n if (cell)\n return cell.row;\n return null;\n };\n GutterKeyboardHandler.prototype.$rowToRowIndex = function (row) {\n for (var i = 0; i < this.lines.getLength(); i++) {\n var cell = this.lines.get(i);\n if (cell.row == row)\n return i;\n }\n return null;\n };\n return GutterKeyboardHandler;\n}());\nexports.GutterKeyboardHandler = GutterKeyboardHandler;\nvar GutterKeyboardEvent = /** @class */ (function () {\n function GutterKeyboardEvent(domEvent, gutterKeyboardHandler) {\n this.gutterKeyboardHandler = gutterKeyboardHandler;\n this.domEvent = domEvent;\n }\n GutterKeyboardEvent.prototype.getKey = function () {\n return keys.keyCodeToString(this.domEvent.keyCode);\n };\n GutterKeyboardEvent.prototype.getRow = function () {\n return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex);\n };\n GutterKeyboardEvent.prototype.isInAnnotationLane = function () {\n return this.gutterKeyboardHandler.activeLane === \"annotation\";\n };\n GutterKeyboardEvent.prototype.isInFoldLane = function () {\n return this.gutterKeyboardHandler.activeLane === \"fold\";\n };\n return GutterKeyboardEvent;\n}());\nexports.GutterKeyboardEvent = GutterKeyboardEvent;\n\n});\n\nace.define(\"ace/editor\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/lib/useragent\",\"ace/keyboard/textinput\",\"ace/mouse/mouse_handler\",\"ace/mouse/fold_handler\",\"ace/keyboard/keybinding\",\"ace/edit_session\",\"ace/search\",\"ace/range\",\"ace/lib/event_emitter\",\"ace/commands/command_manager\",\"ace/commands/default_commands\",\"ace/config\",\"ace/token_iterator\",\"ace/line_widgets\",\"ace/keyboard/gutter_handler\",\"ace/config\",\"ace/clipboard\",\"ace/lib/keys\"], function(require, exports, module){\"use strict\";\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar lang = require(\"./lib/lang\");\nvar useragent = require(\"./lib/useragent\");\nvar TextInput = require(\"./keyboard/textinput\").TextInput;\nvar MouseHandler = require(\"./mouse/mouse_handler\").MouseHandler;\nvar FoldHandler = require(\"./mouse/fold_handler\").FoldHandler;\nvar KeyBinding = require(\"./keyboard/keybinding\").KeyBinding;\nvar EditSession = require(\"./edit_session\").EditSession;\nvar Search = require(\"./search\").Search;\nvar Range = require(\"./range\").Range;\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar CommandManager = require(\"./commands/command_manager\").CommandManager;\nvar defaultCommands = require(\"./commands/default_commands\").commands;\nvar config = require(\"./config\");\nvar TokenIterator = require(\"./token_iterator\").TokenIterator;\nvar LineWidgets = require(\"./line_widgets\").LineWidgets;\nvar GutterKeyboardHandler = require(\"./keyboard/gutter_handler\").GutterKeyboardHandler;\nvar nls = require(\"./config\").nls;\nvar clipboard = require(\"./clipboard\");\nvar keys = require('./lib/keys');\nvar Editor = /** @class */ (function () {\n function Editor(renderer, session, options) { this.session;\n this.$toDestroy = [];\n var container = renderer.getContainerElement();\n this.container = container;\n this.renderer = renderer;\n this.id = \"editor\" + (++Editor.$uid);\n this.commands = new CommandManager(useragent.isMac ? \"mac\" : \"win\", defaultCommands);\n if (typeof document == \"object\") {\n this.textInput = new TextInput(renderer.getTextAreaContainer(), this);\n this.renderer.textarea = this.textInput.getElement();\n this.$mouseHandler = new MouseHandler(this);\n new FoldHandler(this);\n }\n this.keyBinding = new KeyBinding(this);\n this.$search = new Search().set({\n wrap: true\n });\n this.$historyTracker = this.$historyTracker.bind(this);\n this.commands.on(\"exec\", this.$historyTracker);\n this.$initOperationListeners();\n this._$emitInputEvent = lang.delayedCall(function () {\n this._signal(\"input\", {});\n if (this.session && !this.session.destroyed)\n this.session.bgTokenizer.scheduleStart();\n }.bind(this));\n this.on(\"change\", function (_, _self) {\n _self._$emitInputEvent.schedule(31);\n });\n this.setSession(session || options && options.session || new EditSession(\"\"));\n config.resetOptions(this);\n if (options)\n this.setOptions(options);\n config._signal(\"editor\", this);\n }\n Editor.prototype.$initOperationListeners = function () {\n this.commands.on(\"exec\", this.startOperation.bind(this), true);\n this.commands.on(\"afterExec\", this.endOperation.bind(this), true);\n this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this, true));\n this.on(\"change\", function () {\n if (!this.curOp) {\n this.startOperation();\n this.curOp.selectionBefore = this.$lastSel;\n }\n this.curOp.docChanged = true;\n }.bind(this), true);\n this.on(\"changeSelection\", function () {\n if (!this.curOp) {\n this.startOperation();\n this.curOp.selectionBefore = this.$lastSel;\n }\n this.curOp.selectionChanged = true;\n }.bind(this), true);\n };\n Editor.prototype.startOperation = function (commandEvent) {\n if (this.curOp) {\n if (!commandEvent || this.curOp.command)\n return;\n this.prevOp = this.curOp;\n }\n if (!commandEvent) {\n this.previousCommand = null;\n commandEvent = {};\n }\n this.$opResetTimer.schedule();\n this.curOp = this.session.curOp = {\n command: commandEvent.command || {},\n args: commandEvent.args,\n scrollTop: this.renderer.scrollTop\n };\n this.curOp.selectionBefore = this.selection.toJSON();\n };\n Editor.prototype.endOperation = function (e) {\n if (this.curOp && this.session) {\n if (e && e.returnValue === false || !this.session)\n return (this.curOp = null);\n if (e == true && this.curOp.command && this.curOp.command.name == \"mouse\")\n return;\n this._signal(\"beforeEndOperation\");\n if (!this.curOp)\n return;\n var command = this.curOp.command;\n var scrollIntoView = command && command.scrollIntoView;\n if (scrollIntoView) {\n switch (scrollIntoView) {\n case \"center-animate\":\n scrollIntoView = \"animate\";\n case \"center\":\n this.renderer.scrollCursorIntoView(null, 0.5);\n break;\n case \"animate\":\n case \"cursor\":\n this.renderer.scrollCursorIntoView();\n break;\n case \"selectionPart\":\n var range = this.selection.getRange();\n var config = this.renderer.layerConfig;\n if (range.start.row >= config.lastRow || range.end.row <= config.firstRow) {\n this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead);\n }\n break;\n default:\n break;\n }\n if (scrollIntoView == \"animate\")\n this.renderer.animateScrolling(this.curOp.scrollTop);\n }\n var sel = this.selection.toJSON();\n this.curOp.selectionAfter = sel;\n this.$lastSel = this.selection.toJSON();\n this.session.getUndoManager().addSelection(sel);\n this.prevOp = this.curOp;\n this.curOp = null;\n }\n };\n Editor.prototype.$historyTracker = function (e) {\n if (!this.$mergeUndoDeltas)\n return;\n var prev = this.prevOp;\n var mergeableCommands = this.$mergeableCommands;\n var shouldMerge = prev.command && (e.command.name == prev.command.name);\n if (e.command.name == \"insertstring\") {\n var text = e.args;\n if (this.mergeNextCommand === undefined)\n this.mergeNextCommand = true;\n shouldMerge = shouldMerge\n && this.mergeNextCommand // previous command allows to coalesce with\n && (!/\\s/.test(text) || /\\s/.test(prev.args)); // previous insertion was of same type\n this.mergeNextCommand = true;\n }\n else {\n shouldMerge = shouldMerge\n && mergeableCommands.indexOf(e.command.name) !== -1; // the command is mergeable\n }\n if (this.$mergeUndoDeltas != \"always\"\n && Date.now() - this.sequenceStartTime > 2000) {\n shouldMerge = false; // the sequence is too long\n }\n if (shouldMerge)\n this.session.mergeUndoDeltas = true;\n else if (mergeableCommands.indexOf(e.command.name) !== -1)\n this.sequenceStartTime = Date.now();\n };\n Editor.prototype.setKeyboardHandler = function (keyboardHandler, cb) {\n if (keyboardHandler && typeof keyboardHandler === \"string\" && keyboardHandler != \"ace\") {\n this.$keybindingId = keyboardHandler;\n var _self = this;\n config.loadModule([\"keybinding\", keyboardHandler], function (module) {\n if (_self.$keybindingId == keyboardHandler)\n _self.keyBinding.setKeyboardHandler(module && module.handler);\n cb && cb();\n });\n }\n else {\n this.$keybindingId = null;\n this.keyBinding.setKeyboardHandler(keyboardHandler);\n cb && cb();\n }\n };\n Editor.prototype.getKeyboardHandler = function () {\n return this.keyBinding.getKeyboardHandler();\n };\n Editor.prototype.setSession = function (session) {\n if (this.session == session)\n return;\n if (this.curOp)\n this.endOperation();\n this.curOp = {};\n var oldSession = this.session;\n if (oldSession) {\n this.session.off(\"change\", this.$onDocumentChange);\n this.session.off(\"changeMode\", this.$onChangeMode);\n this.session.off(\"tokenizerUpdate\", this.$onTokenizerUpdate);\n this.session.off(\"changeTabSize\", this.$onChangeTabSize);\n this.session.off(\"changeWrapLimit\", this.$onChangeWrapLimit);\n this.session.off(\"changeWrapMode\", this.$onChangeWrapMode);\n this.session.off(\"changeFold\", this.$onChangeFold);\n this.session.off(\"changeFrontMarker\", this.$onChangeFrontMarker);\n this.session.off(\"changeBackMarker\", this.$onChangeBackMarker);\n this.session.off(\"changeBreakpoint\", this.$onChangeBreakpoint);\n this.session.off(\"changeAnnotation\", this.$onChangeAnnotation);\n this.session.off(\"changeOverwrite\", this.$onCursorChange);\n this.session.off(\"changeScrollTop\", this.$onScrollTopChange);\n this.session.off(\"changeScrollLeft\", this.$onScrollLeftChange);\n var selection = this.session.getSelection();\n selection.off(\"changeCursor\", this.$onCursorChange);\n selection.off(\"changeSelection\", this.$onSelectionChange);\n }\n this.session = session;\n if (session) {\n this.$onDocumentChange = this.onDocumentChange.bind(this);\n session.on(\"change\", this.$onDocumentChange);\n this.renderer.setSession(session);\n this.$onChangeMode = this.onChangeMode.bind(this);\n session.on(\"changeMode\", this.$onChangeMode);\n this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this);\n session.on(\"tokenizerUpdate\", this.$onTokenizerUpdate);\n this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer);\n session.on(\"changeTabSize\", this.$onChangeTabSize);\n this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this);\n session.on(\"changeWrapLimit\", this.$onChangeWrapLimit);\n this.$onChangeWrapMode = this.onChangeWrapMode.bind(this);\n session.on(\"changeWrapMode\", this.$onChangeWrapMode);\n this.$onChangeFold = this.onChangeFold.bind(this);\n session.on(\"changeFold\", this.$onChangeFold);\n this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this);\n this.session.on(\"changeFrontMarker\", this.$onChangeFrontMarker);\n this.$onChangeBackMarker = this.onChangeBackMarker.bind(this);\n this.session.on(\"changeBackMarker\", this.$onChangeBackMarker);\n this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this);\n this.session.on(\"changeBreakpoint\", this.$onChangeBreakpoint);\n this.$onChangeAnnotation = this.onChangeAnnotation.bind(this);\n this.session.on(\"changeAnnotation\", this.$onChangeAnnotation);\n this.$onCursorChange = this.onCursorChange.bind(this);\n this.session.on(\"changeOverwrite\", this.$onCursorChange);\n this.$onScrollTopChange = this.onScrollTopChange.bind(this);\n this.session.on(\"changeScrollTop\", this.$onScrollTopChange);\n this.$onScrollLeftChange = this.onScrollLeftChange.bind(this);\n this.session.on(\"changeScrollLeft\", this.$onScrollLeftChange);\n this.selection = session.getSelection();\n this.selection.on(\"changeCursor\", this.$onCursorChange);\n this.$onSelectionChange = this.onSelectionChange.bind(this);\n this.selection.on(\"changeSelection\", this.$onSelectionChange);\n this.onChangeMode();\n this.onCursorChange();\n this.onScrollTopChange();\n this.onScrollLeftChange();\n this.onSelectionChange();\n this.onChangeFrontMarker();\n this.onChangeBackMarker();\n this.onChangeBreakpoint();\n this.onChangeAnnotation();\n this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();\n this.renderer.updateFull();\n }\n else {\n this.selection = null;\n this.renderer.setSession(session);\n }\n this._signal(\"changeSession\", {\n session: session,\n oldSession: oldSession\n });\n this.curOp = null;\n oldSession && oldSession._signal(\"changeEditor\", { oldEditor: this });\n session && session._signal(\"changeEditor\", { editor: this });\n if (session && !session.destroyed)\n session.bgTokenizer.scheduleStart();\n };\n Editor.prototype.getSession = function () {\n return this.session;\n };\n Editor.prototype.setValue = function (val, cursorPos) {\n this.session.doc.setValue(val);\n if (!cursorPos)\n this.selectAll();\n else if (cursorPos == 1)\n this.navigateFileEnd();\n else if (cursorPos == -1)\n this.navigateFileStart();\n return val;\n };\n Editor.prototype.getValue = function () {\n return this.session.getValue();\n };\n Editor.prototype.getSelection = function () {\n return this.selection;\n };\n Editor.prototype.resize = function (force) {\n this.renderer.onResize(force);\n };\n Editor.prototype.setTheme = function (theme, cb) {\n this.renderer.setTheme(theme, cb);\n };\n Editor.prototype.getTheme = function () {\n return this.renderer.getTheme();\n };\n Editor.prototype.setStyle = function (style) {\n this.renderer.setStyle(style);\n };\n Editor.prototype.unsetStyle = function (style) {\n this.renderer.unsetStyle(style);\n };\n Editor.prototype.getFontSize = function () {\n return this.getOption(\"fontSize\") ||\n dom.computedStyle(this.container).fontSize;\n };\n Editor.prototype.setFontSize = function (size) {\n this.setOption(\"fontSize\", size);\n };\n Editor.prototype.$highlightBrackets = function () {\n if (this.$highlightPending) {\n return;\n }\n var self = this;\n this.$highlightPending = true;\n setTimeout(function () {\n self.$highlightPending = false;\n var session = self.session;\n if (!session || session.destroyed)\n return;\n if (session.$bracketHighlight) {\n session.$bracketHighlight.markerIds.forEach(function (id) {\n session.removeMarker(id);\n });\n session.$bracketHighlight = null;\n }\n var pos = self.getCursorPosition();\n var handler = self.getKeyboardHandler();\n var isBackwards = handler && handler.$getDirectionForHighlight && handler.$getDirectionForHighlight(self);\n var ranges = session.getMatchingBracketRanges(pos, isBackwards);\n if (!ranges) {\n var iterator = new TokenIterator(session, pos.row, pos.column);\n var token = iterator.getCurrentToken();\n if (token && /\\b(?:tag-open|tag-name)/.test(token.type)) {\n var tagNamesRanges = session.getMatchingTags(pos);\n if (tagNamesRanges) {\n ranges = [\n tagNamesRanges.openTagName.isEmpty() ? tagNamesRanges.openTag : tagNamesRanges.openTagName,\n tagNamesRanges.closeTagName.isEmpty() ? tagNamesRanges.closeTag : tagNamesRanges.closeTagName\n ];\n }\n }\n }\n if (!ranges && session.$mode.getMatching)\n ranges = session.$mode.getMatching(self.session);\n if (!ranges) {\n if (self.getHighlightIndentGuides())\n self.renderer.$textLayer.$highlightIndentGuide();\n return;\n }\n var markerType = \"ace_bracket\";\n if (!Array.isArray(ranges)) {\n ranges = [ranges];\n }\n else if (ranges.length == 1) {\n markerType = \"ace_error_bracket\";\n }\n if (ranges.length == 2) {\n if (Range.comparePoints(ranges[0].end, ranges[1].start) == 0)\n ranges = [Range.fromPoints(ranges[0].start, ranges[1].end)];\n else if (Range.comparePoints(ranges[0].start, ranges[1].end) == 0)\n ranges = [Range.fromPoints(ranges[1].start, ranges[0].end)];\n }\n session.$bracketHighlight = {\n ranges: ranges,\n markerIds: ranges.map(function (range) {\n return session.addMarker(range, markerType, \"text\");\n })\n };\n if (self.getHighlightIndentGuides())\n self.renderer.$textLayer.$highlightIndentGuide();\n }, 50);\n };\n Editor.prototype.focus = function () {\n this.textInput.focus();\n };\n Editor.prototype.isFocused = function () {\n return this.textInput.isFocused();\n };\n Editor.prototype.blur = function () {\n this.textInput.blur();\n };\n Editor.prototype.onFocus = function (e) {\n if (this.$isFocused)\n return;\n this.$isFocused = true;\n this.renderer.showCursor();\n this.renderer.visualizeFocus();\n this._emit(\"focus\", e);\n };\n Editor.prototype.onBlur = function (e) {\n if (!this.$isFocused)\n return;\n this.$isFocused = false;\n this.renderer.hideCursor();\n this.renderer.visualizeBlur();\n this._emit(\"blur\", e);\n };\n Editor.prototype.$cursorChange = function () {\n this.renderer.updateCursor();\n this.$highlightBrackets();\n this.$updateHighlightActiveLine();\n };\n Editor.prototype.onDocumentChange = function (delta) {\n var wrap = this.session.$useWrapMode;\n var lastRow = (delta.start.row == delta.end.row ? delta.end.row : Infinity);\n this.renderer.updateLines(delta.start.row, lastRow, wrap);\n this._signal(\"change\", delta);\n this.$cursorChange();\n };\n Editor.prototype.onTokenizerUpdate = function (e) {\n var rows = e.data;\n this.renderer.updateLines(rows.first, rows.last);\n };\n Editor.prototype.onScrollTopChange = function () {\n this.renderer.scrollToY(this.session.getScrollTop());\n };\n Editor.prototype.onScrollLeftChange = function () {\n this.renderer.scrollToX(this.session.getScrollLeft());\n };\n Editor.prototype.onCursorChange = function () {\n this.$cursorChange();\n this._signal(\"changeSelection\");\n };\n Editor.prototype.$updateHighlightActiveLine = function () {\n var session = this.getSession();\n var highlight;\n if (this.$highlightActiveLine) {\n if (this.$selectionStyle != \"line\" || !this.selection.isMultiLine())\n highlight = this.getCursorPosition();\n if (this.renderer.theme && this.renderer.theme.$selectionColorConflict && !this.selection.isEmpty())\n highlight = false;\n if (this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1))\n highlight = false;\n }\n if (session.$highlightLineMarker && !highlight) {\n session.removeMarker(session.$highlightLineMarker.id);\n session.$highlightLineMarker = null;\n }\n else if (!session.$highlightLineMarker && highlight) {\n var range = new Range(highlight.row, highlight.column, highlight.row, Infinity);\n range.id = session.addMarker(range, \"ace_active-line\", \"screenLine\");\n session.$highlightLineMarker = range;\n }\n else if (highlight) {\n session.$highlightLineMarker.start.row = highlight.row;\n session.$highlightLineMarker.end.row = highlight.row;\n session.$highlightLineMarker.start.column = highlight.column;\n session._signal(\"changeBackMarker\");\n }\n };\n Editor.prototype.onSelectionChange = function (e) {\n var session = this.session;\n if (session.$selectionMarker) {\n session.removeMarker(session.$selectionMarker);\n }\n session.$selectionMarker = null;\n if (!this.selection.isEmpty()) {\n var range = this.selection.getRange();\n var style = this.getSelectionStyle();\n session.$selectionMarker = session.addMarker(range, \"ace_selection\", style);\n }\n else {\n this.$updateHighlightActiveLine();\n }\n var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp();\n this.session.highlight(re);\n this._signal(\"changeSelection\");\n };\n Editor.prototype.$getSelectionHighLightRegexp = function () {\n var session = this.session;\n var selection = this.getSelectionRange();\n if (selection.isEmpty() || selection.isMultiLine())\n return;\n var startColumn = selection.start.column;\n var endColumn = selection.end.column;\n var line = session.getLine(selection.start.row);\n var needle = line.substring(startColumn, endColumn);\n if (needle.length > 5000 || !/[\\w\\d]/.test(needle))\n return;\n var re = this.$search.$assembleRegExp({\n wholeWord: true,\n caseSensitive: true,\n needle: needle\n });\n var wordWithBoundary = line.substring(startColumn - 1, endColumn + 1);\n if (!re.test(wordWithBoundary))\n return;\n return re;\n };\n Editor.prototype.onChangeFrontMarker = function () {\n this.renderer.updateFrontMarkers();\n };\n Editor.prototype.onChangeBackMarker = function () {\n this.renderer.updateBackMarkers();\n };\n Editor.prototype.onChangeBreakpoint = function () {\n this.renderer.updateBreakpoints();\n };\n Editor.prototype.onChangeAnnotation = function () {\n this.renderer.setAnnotations(this.session.getAnnotations());\n };\n Editor.prototype.onChangeMode = function (e) {\n this.renderer.updateText();\n this._emit(\"changeMode\", e);\n };\n Editor.prototype.onChangeWrapLimit = function () {\n this.renderer.updateFull();\n };\n Editor.prototype.onChangeWrapMode = function () {\n this.renderer.onResize(true);\n };\n Editor.prototype.onChangeFold = function () {\n this.$updateHighlightActiveLine();\n this.renderer.updateFull();\n };\n Editor.prototype.getSelectedText = function () {\n return this.session.getTextRange(this.getSelectionRange());\n };\n Editor.prototype.getCopyText = function () {\n var text = this.getSelectedText();\n var nl = this.session.doc.getNewLineCharacter();\n var copyLine = false;\n if (!text && this.$copyWithEmptySelection) {\n copyLine = true;\n var ranges = this.selection.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (i && ranges[i - 1].start.row == range.start.row)\n continue;\n text += this.session.getLine(range.start.row) + nl;\n }\n }\n var e = { text: text };\n this._signal(\"copy\", e);\n clipboard.lineMode = copyLine ? e.text : false;\n return e.text;\n };\n Editor.prototype.onCopy = function () {\n this.commands.exec(\"copy\", this);\n };\n Editor.prototype.onCut = function () {\n this.commands.exec(\"cut\", this);\n };\n Editor.prototype.onPaste = function (text, event) {\n var e = { text: text, event: event };\n this.commands.exec(\"paste\", this, e);\n };\n Editor.prototype.$handlePaste = function (e) {\n if (typeof e == \"string\")\n e = { text: e };\n this._signal(\"paste\", e);\n var text = e.text;\n var lineMode = text === clipboard.lineMode;\n var session = this.session;\n if (!this.inMultiSelectMode || this.inVirtualSelectionMode) {\n if (lineMode)\n session.insert({ row: this.selection.lead.row, column: 0 }, text);\n else\n this.insert(text);\n }\n else if (lineMode) {\n this.selection.rangeList.ranges.forEach(function (range) {\n session.insert({ row: range.start.row, column: 0 }, text);\n });\n }\n else {\n var lines = text.split(/\\r\\n|\\r|\\n/);\n var ranges = this.selection.rangeList.ranges;\n var isFullLine = lines.length == 2 && (!lines[0] || !lines[1]);\n if (lines.length != ranges.length || isFullLine)\n return this.commands.exec(\"insertstring\", this, text);\n for (var i = ranges.length; i--;) {\n var range = ranges[i];\n if (!range.isEmpty())\n session.remove(range);\n session.insert(range.start, lines[i]);\n }\n }\n };\n Editor.prototype.execCommand = function (command, args) {\n return this.commands.exec(command, this, args);\n };\n Editor.prototype.insert = function (text, pasted) {\n var session = this.session;\n var mode = session.getMode();\n var cursor = this.getCursorPosition();\n if (this.getBehavioursEnabled() && !pasted) {\n var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text);\n if (transform) {\n if (text !== transform.text) {\n if (!this.inVirtualSelectionMode) {\n this.session.mergeUndoDeltas = false;\n this.mergeNextCommand = false;\n }\n }\n text = transform.text;\n }\n }\n if (text == \"\\t\")\n text = this.session.getTabString();\n if (!this.selection.isEmpty()) {\n var range = this.getSelectionRange();\n cursor = this.session.remove(range);\n this.clearSelection();\n }\n else if (this.session.getOverwrite() && text.indexOf(\"\\n\") == -1) {\n var range = Range.fromPoints(cursor, cursor);\n range.end.column += text.length;\n this.session.remove(range);\n }\n if (text == \"\\n\" || text == \"\\r\\n\") {\n var line = session.getLine(cursor.row);\n if (cursor.column > line.search(/\\S|$/)) {\n var d = line.substr(cursor.column).search(/\\S|$/);\n session.doc.removeInLine(cursor.row, cursor.column, cursor.column + d);\n }\n }\n this.clearSelection();\n var start = cursor.column;\n var lineState = session.getState(cursor.row);\n var line = session.getLine(cursor.row);\n var shouldOutdent = mode.checkOutdent(lineState, line, text);\n session.insert(cursor, text);\n if (transform && transform.selection) {\n if (transform.selection.length == 2) { // Transform relative to the current column\n this.selection.setSelectionRange(new Range(cursor.row, start + transform.selection[0], cursor.row, start + transform.selection[1]));\n }\n else { // Transform relative to the current row.\n this.selection.setSelectionRange(new Range(cursor.row + transform.selection[0], transform.selection[1], cursor.row + transform.selection[2], transform.selection[3]));\n }\n }\n if (this.$enableAutoIndent) {\n if (session.getDocument().isNewLine(text)) {\n var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString());\n session.insert({ row: cursor.row + 1, column: 0 }, lineIndent);\n }\n if (shouldOutdent)\n mode.autoOutdent(lineState, session, cursor.row);\n }\n };\n Editor.prototype.autoIndent = function () {\n var session = this.session;\n var mode = session.getMode();\n var ranges = this.selection.isEmpty()\n ? [new Range(0, 0, session.doc.getLength() - 1, 0)]\n : this.selection.getAllRanges();\n var prevLineState = \"\";\n var prevLine = \"\";\n var lineIndent = \"\";\n var tab = session.getTabString();\n for (var i = 0; i < ranges.length; i++) {\n var startRow = ranges[i].start.row;\n var endRow = ranges[i].end.row;\n for (var row = startRow; row <= endRow; row++) {\n if (row > 0) {\n prevLineState = session.getState(row - 1);\n prevLine = session.getLine(row - 1);\n lineIndent = mode.getNextLineIndent(prevLineState, prevLine, tab);\n }\n var line = session.getLine(row);\n var currIndent = mode.$getIndent(line);\n if (lineIndent !== currIndent) {\n if (currIndent.length > 0) {\n var range = new Range(row, 0, row, currIndent.length);\n session.remove(range);\n }\n if (lineIndent.length > 0) {\n session.insert({ row: row, column: 0 }, lineIndent);\n }\n }\n mode.autoOutdent(prevLineState, session, row);\n }\n }\n };\n Editor.prototype.onTextInput = function (text, composition) {\n if (!composition)\n return this.keyBinding.onTextInput(text);\n this.startOperation({ command: { name: \"insertstring\" } });\n var applyComposition = this.applyComposition.bind(this, text, composition);\n if (this.selection.rangeCount)\n this.forEachSelection(applyComposition);\n else\n applyComposition();\n this.endOperation();\n };\n Editor.prototype.applyComposition = function (text, composition) {\n if (composition.extendLeft || composition.extendRight) {\n var r = this.selection.getRange();\n r.start.column -= composition.extendLeft;\n r.end.column += composition.extendRight;\n if (r.start.column < 0) {\n r.start.row--;\n r.start.column += this.session.getLine(r.start.row).length + 1;\n }\n this.selection.setRange(r);\n if (!text && !r.isEmpty())\n this.remove();\n }\n if (text || !this.selection.isEmpty())\n this.insert(text, true);\n if (composition.restoreStart || composition.restoreEnd) {\n var r = this.selection.getRange();\n r.start.column -= composition.restoreStart;\n r.end.column -= composition.restoreEnd;\n this.selection.setRange(r);\n }\n };\n Editor.prototype.onCommandKey = function (e, hashId, keyCode) {\n return this.keyBinding.onCommandKey(e, hashId, keyCode);\n };\n Editor.prototype.setOverwrite = function (overwrite) {\n this.session.setOverwrite(overwrite);\n };\n Editor.prototype.getOverwrite = function () {\n return this.session.getOverwrite();\n };\n Editor.prototype.toggleOverwrite = function () {\n this.session.toggleOverwrite();\n };\n Editor.prototype.setScrollSpeed = function (speed) {\n this.setOption(\"scrollSpeed\", speed);\n };\n Editor.prototype.getScrollSpeed = function () {\n return this.getOption(\"scrollSpeed\");\n };\n Editor.prototype.setDragDelay = function (dragDelay) {\n this.setOption(\"dragDelay\", dragDelay);\n };\n Editor.prototype.getDragDelay = function () {\n return this.getOption(\"dragDelay\");\n };\n Editor.prototype.setSelectionStyle = function (val) {\n this.setOption(\"selectionStyle\", val);\n };\n Editor.prototype.getSelectionStyle = function () {\n return this.getOption(\"selectionStyle\");\n };\n Editor.prototype.setHighlightActiveLine = function (shouldHighlight) {\n this.setOption(\"highlightActiveLine\", shouldHighlight);\n };\n Editor.prototype.getHighlightActiveLine = function () {\n return this.getOption(\"highlightActiveLine\");\n };\n Editor.prototype.setHighlightGutterLine = function (shouldHighlight) {\n this.setOption(\"highlightGutterLine\", shouldHighlight);\n };\n Editor.prototype.getHighlightGutterLine = function () {\n return this.getOption(\"highlightGutterLine\");\n };\n Editor.prototype.setHighlightSelectedWord = function (shouldHighlight) {\n this.setOption(\"highlightSelectedWord\", shouldHighlight);\n };\n Editor.prototype.getHighlightSelectedWord = function () {\n return this.$highlightSelectedWord;\n };\n Editor.prototype.setAnimatedScroll = function (shouldAnimate) {\n this.renderer.setAnimatedScroll(shouldAnimate);\n };\n Editor.prototype.getAnimatedScroll = function () {\n return this.renderer.getAnimatedScroll();\n };\n Editor.prototype.setShowInvisibles = function (showInvisibles) {\n this.renderer.setShowInvisibles(showInvisibles);\n };\n Editor.prototype.getShowInvisibles = function () {\n return this.renderer.getShowInvisibles();\n };\n Editor.prototype.setDisplayIndentGuides = function (display) {\n this.renderer.setDisplayIndentGuides(display);\n };\n Editor.prototype.getDisplayIndentGuides = function () {\n return this.renderer.getDisplayIndentGuides();\n };\n Editor.prototype.setHighlightIndentGuides = function (highlight) {\n this.renderer.setHighlightIndentGuides(highlight);\n };\n Editor.prototype.getHighlightIndentGuides = function () {\n return this.renderer.getHighlightIndentGuides();\n };\n Editor.prototype.setShowPrintMargin = function (showPrintMargin) {\n this.renderer.setShowPrintMargin(showPrintMargin);\n };\n Editor.prototype.getShowPrintMargin = function () {\n return this.renderer.getShowPrintMargin();\n };\n Editor.prototype.setPrintMarginColumn = function (showPrintMargin) {\n this.renderer.setPrintMarginColumn(showPrintMargin);\n };\n Editor.prototype.getPrintMarginColumn = function () {\n return this.renderer.getPrintMarginColumn();\n };\n Editor.prototype.setReadOnly = function (readOnly) {\n this.setOption(\"readOnly\", readOnly);\n };\n Editor.prototype.getReadOnly = function () {\n return this.getOption(\"readOnly\");\n };\n Editor.prototype.setBehavioursEnabled = function (enabled) {\n this.setOption(\"behavioursEnabled\", enabled);\n };\n Editor.prototype.getBehavioursEnabled = function () {\n return this.getOption(\"behavioursEnabled\");\n };\n Editor.prototype.setWrapBehavioursEnabled = function (enabled) {\n this.setOption(\"wrapBehavioursEnabled\", enabled);\n };\n Editor.prototype.getWrapBehavioursEnabled = function () {\n return this.getOption(\"wrapBehavioursEnabled\");\n };\n Editor.prototype.setShowFoldWidgets = function (show) {\n this.setOption(\"showFoldWidgets\", show);\n };\n Editor.prototype.getShowFoldWidgets = function () {\n return this.getOption(\"showFoldWidgets\");\n };\n Editor.prototype.setFadeFoldWidgets = function (fade) {\n this.setOption(\"fadeFoldWidgets\", fade);\n };\n Editor.prototype.getFadeFoldWidgets = function () {\n return this.getOption(\"fadeFoldWidgets\");\n };\n Editor.prototype.remove = function (dir) {\n if (this.selection.isEmpty()) {\n if (dir == \"left\")\n this.selection.selectLeft();\n else\n this.selection.selectRight();\n }\n var range = this.getSelectionRange();\n if (this.getBehavioursEnabled()) {\n var session = this.session;\n var state = session.getState(range.start.row);\n var new_range = session.getMode().transformAction(state, 'deletion', this, session, range);\n if (range.end.column === 0) {\n var text = session.getTextRange(range);\n if (text[text.length - 1] == \"\\n\") {\n var line = session.getLine(range.end.row);\n if (/^\\s+$/.test(line)) {\n range.end.column = line.length;\n }\n }\n }\n if (new_range)\n range = new_range;\n }\n this.session.remove(range);\n this.clearSelection();\n };\n Editor.prototype.removeWordRight = function () {\n if (this.selection.isEmpty())\n this.selection.selectWordRight();\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n };\n Editor.prototype.removeWordLeft = function () {\n if (this.selection.isEmpty())\n this.selection.selectWordLeft();\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n };\n Editor.prototype.removeToLineStart = function () {\n if (this.selection.isEmpty())\n this.selection.selectLineStart();\n if (this.selection.isEmpty())\n this.selection.selectLeft();\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n };\n Editor.prototype.removeToLineEnd = function () {\n if (this.selection.isEmpty())\n this.selection.selectLineEnd();\n var range = this.getSelectionRange();\n if (range.start.column == range.end.column && range.start.row == range.end.row) {\n range.end.column = 0;\n range.end.row++;\n }\n this.session.remove(range);\n this.clearSelection();\n };\n Editor.prototype.splitLine = function () {\n if (!this.selection.isEmpty()) {\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n }\n var cursor = this.getCursorPosition();\n this.insert(\"\\n\");\n this.moveCursorToPosition(cursor);\n };\n Editor.prototype.setGhostText = function (text, position) {\n if (!this.session.widgetManager) {\n this.session.widgetManager = new LineWidgets(this.session);\n this.session.widgetManager.attach(this);\n }\n this.renderer.setGhostText(text, position);\n };\n Editor.prototype.removeGhostText = function () {\n if (!this.session.widgetManager)\n return;\n this.renderer.removeGhostText();\n };\n Editor.prototype.transposeLetters = function () {\n if (!this.selection.isEmpty()) {\n return;\n }\n var cursor = this.getCursorPosition();\n var column = cursor.column;\n if (column === 0)\n return;\n var line = this.session.getLine(cursor.row);\n var swap, range;\n if (column < line.length) {\n swap = line.charAt(column) + line.charAt(column - 1);\n range = new Range(cursor.row, column - 1, cursor.row, column + 1);\n }\n else {\n swap = line.charAt(column - 1) + line.charAt(column - 2);\n range = new Range(cursor.row, column - 2, cursor.row, column);\n }\n this.session.replace(range, swap);\n this.session.selection.moveToPosition(range.end);\n };\n Editor.prototype.toLowerCase = function () {\n var originalRange = this.getSelectionRange();\n if (this.selection.isEmpty()) {\n this.selection.selectWord();\n }\n var range = this.getSelectionRange();\n var text = this.session.getTextRange(range);\n this.session.replace(range, text.toLowerCase());\n this.selection.setSelectionRange(originalRange);\n };\n Editor.prototype.toUpperCase = function () {\n var originalRange = this.getSelectionRange();\n if (this.selection.isEmpty()) {\n this.selection.selectWord();\n }\n var range = this.getSelectionRange();\n var text = this.session.getTextRange(range);\n this.session.replace(range, text.toUpperCase());\n this.selection.setSelectionRange(originalRange);\n };\n Editor.prototype.indent = function () {\n var session = this.session;\n var range = this.getSelectionRange();\n if (range.start.row < range.end.row) {\n var rows = this.$getSelectedRows();\n session.indentRows(rows.first, rows.last, \"\\t\");\n return;\n }\n else if (range.start.column < range.end.column) {\n var text = session.getTextRange(range);\n if (!/^\\s+$/.test(text)) {\n var rows = this.$getSelectedRows();\n session.indentRows(rows.first, rows.last, \"\\t\");\n return;\n }\n }\n var line = session.getLine(range.start.row);\n var position = range.start;\n var size = session.getTabSize();\n var column = session.documentToScreenColumn(position.row, position.column);\n if (this.session.getUseSoftTabs()) {\n var count = (size - column % size);\n var indentString = lang.stringRepeat(\" \", count);\n }\n else {\n var count = column % size;\n while (line[range.start.column - 1] == \" \" && count) {\n range.start.column--;\n count--;\n }\n this.selection.setSelectionRange(range);\n indentString = \"\\t\";\n }\n return this.insert(indentString);\n };\n Editor.prototype.blockIndent = function () {\n var rows = this.$getSelectedRows();\n this.session.indentRows(rows.first, rows.last, \"\\t\");\n };\n Editor.prototype.blockOutdent = function () {\n var selection = this.session.getSelection();\n this.session.outdentRows(selection.getRange());\n };\n Editor.prototype.sortLines = function () {\n var rows = this.$getSelectedRows();\n var session = this.session;\n var lines = [];\n for (var i = rows.first; i <= rows.last; i++)\n lines.push(session.getLine(i));\n lines.sort(function (a, b) {\n if (a.toLowerCase() < b.toLowerCase())\n return -1;\n if (a.toLowerCase() > b.toLowerCase())\n return 1;\n return 0;\n });\n var deleteRange = new Range(0, 0, 0, 0);\n for (var i = rows.first; i <= rows.last; i++) {\n var line = session.getLine(i);\n deleteRange.start.row = i;\n deleteRange.end.row = i;\n deleteRange.end.column = line.length;\n session.replace(deleteRange, lines[i - rows.first]);\n }\n };\n Editor.prototype.toggleCommentLines = function () {\n var state = this.session.getState(this.getCursorPosition().row);\n var rows = this.$getSelectedRows();\n this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last);\n };\n Editor.prototype.toggleBlockComment = function () {\n var cursor = this.getCursorPosition();\n var state = this.session.getState(cursor.row);\n var range = this.getSelectionRange();\n this.session.getMode().toggleBlockComment(state, this.session, range, cursor);\n };\n Editor.prototype.getNumberAt = function (row, column) {\n var _numberRx = /[\\-]?[0-9]+(?:\\.[0-9]+)?/g;\n _numberRx.lastIndex = 0;\n var s = this.session.getLine(row);\n while (_numberRx.lastIndex < column) {\n var m = _numberRx.exec(s);\n if (m.index <= column && m.index + m[0].length >= column) {\n var number = {\n value: m[0],\n start: m.index,\n end: m.index + m[0].length\n };\n return number;\n }\n }\n return null;\n };\n Editor.prototype.modifyNumber = function (amount) {\n var row = this.selection.getCursor().row;\n var column = this.selection.getCursor().column;\n var charRange = new Range(row, column - 1, row, column);\n var c = this.session.getTextRange(charRange);\n if (!isNaN(parseFloat(c)) && isFinite(c)) {\n var nr = this.getNumberAt(row, column);\n if (nr) {\n var fp = nr.value.indexOf(\".\") >= 0 ? nr.start + nr.value.indexOf(\".\") + 1 : nr.end;\n var decimals = nr.start + nr.value.length - fp;\n var t = parseFloat(nr.value);\n t *= Math.pow(10, decimals);\n if (fp !== nr.end && column < fp) {\n amount *= Math.pow(10, nr.end - column - 1);\n }\n else {\n amount *= Math.pow(10, nr.end - column);\n }\n t += amount;\n t /= Math.pow(10, decimals);\n var nnr = t.toFixed(decimals);\n var replaceRange = new Range(row, nr.start, row, nr.end);\n this.session.replace(replaceRange, nnr);\n this.moveCursorTo(row, Math.max(nr.start + 1, column + nnr.length - nr.value.length));\n }\n }\n else {\n this.toggleWord();\n }\n };\n Editor.prototype.toggleWord = function () {\n var row = this.selection.getCursor().row;\n var column = this.selection.getCursor().column;\n this.selection.selectWord();\n var currentState = this.getSelectedText();\n var currWordStart = this.selection.getWordRange().start.column;\n var wordParts = currentState.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g, '$1 ').split(/\\s/);\n var delta = column - currWordStart - 1;\n if (delta < 0)\n delta = 0;\n var curLength = 0, itLength = 0;\n var that = this;\n if (currentState.match(/[A-Za-z0-9_]+/)) {\n wordParts.forEach(function (item, i) {\n itLength = curLength + item.length;\n if (delta >= curLength && delta <= itLength) {\n currentState = item;\n that.selection.clearSelection();\n that.moveCursorTo(row, curLength + currWordStart);\n that.selection.selectTo(row, itLength + currWordStart);\n }\n curLength = itLength;\n });\n }\n var wordPairs = this.$toggleWordPairs;\n var reg;\n for (var i = 0; i < wordPairs.length; i++) {\n var item = wordPairs[i];\n for (var j = 0; j <= 1; j++) {\n var negate = +!j;\n var firstCondition = currentState.match(new RegExp('^\\\\s?_?(' + lang.escapeRegExp(item[j]) + ')\\\\s?$', 'i'));\n if (firstCondition) {\n var secondCondition = currentState.match(new RegExp('([_]|^|\\\\s)(' + lang.escapeRegExp(firstCondition[1]) + ')($|\\\\s)', 'g'));\n if (secondCondition) {\n reg = currentState.replace(new RegExp(lang.escapeRegExp(item[j]), 'i'), function (result) {\n var res = item[negate];\n if (result.toUpperCase() == result) {\n res = res.toUpperCase();\n }\n else if (result.charAt(0).toUpperCase() == result.charAt(0)) {\n res = res.substr(0, 0) + item[negate].charAt(0).toUpperCase() + res.substr(1);\n }\n return res;\n });\n this.insert(reg);\n reg = \"\";\n }\n }\n }\n }\n };\n Editor.prototype.findLinkAt = function (row, column) {\n var e_1, _a;\n var line = this.session.getLine(row);\n var wordParts = line.split(/((?:https?|ftp):\\/\\/[\\S]+)/);\n var columnPosition = column;\n if (columnPosition < 0)\n columnPosition = 0;\n var previousPosition = 0, currentPosition = 0, match;\n try {\n for (var wordParts_1 = __values(wordParts), wordParts_1_1 = wordParts_1.next(); !wordParts_1_1.done; wordParts_1_1 = wordParts_1.next()) {\n var item = wordParts_1_1.value;\n currentPosition = previousPosition + item.length;\n if (columnPosition >= previousPosition && columnPosition <= currentPosition) {\n if (item.match(/((?:https?|ftp):\\/\\/[\\S]+)/)) {\n match = item.replace(/[\\s:.,'\";}\\]]+$/, \"\");\n break;\n }\n }\n previousPosition = currentPosition;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (wordParts_1_1 && !wordParts_1_1.done && (_a = wordParts_1.return)) _a.call(wordParts_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return match;\n };\n Editor.prototype.openLink = function () {\n var cursor = this.selection.getCursor();\n var url = this.findLinkAt(cursor.row, cursor.column);\n if (url)\n window.open(url, '_blank');\n return url != null;\n };\n Editor.prototype.removeLines = function () {\n var rows = this.$getSelectedRows();\n this.session.removeFullLines(rows.first, rows.last);\n this.clearSelection();\n };\n Editor.prototype.duplicateSelection = function () {\n var sel = this.selection;\n var doc = this.session;\n var range = sel.getRange();\n var reverse = sel.isBackwards();\n if (range.isEmpty()) {\n var row = range.start.row;\n doc.duplicateLines(row, row);\n }\n else {\n var point = reverse ? range.start : range.end;\n var endPoint = doc.insert(point, doc.getTextRange(range));\n range.start = point;\n range.end = endPoint;\n sel.setSelectionRange(range, reverse);\n }\n };\n Editor.prototype.moveLinesDown = function () {\n this.$moveLines(1, false);\n };\n Editor.prototype.moveLinesUp = function () {\n this.$moveLines(-1, false);\n };\n Editor.prototype.moveText = function (range, toPosition, copy) {\n return this.session.moveText(range, toPosition, copy);\n };\n Editor.prototype.copyLinesUp = function () {\n this.$moveLines(-1, true);\n };\n Editor.prototype.copyLinesDown = function () {\n this.$moveLines(1, true);\n };\n Editor.prototype.$moveLines = function (dir, copy) {\n var rows, moved;\n var selection = this.selection;\n if (!selection.inMultiSelectMode || this.inVirtualSelectionMode) {\n var range = selection.toOrientedRange();\n rows = this.$getSelectedRows(range);\n moved = this.session.$moveLines(rows.first, rows.last, copy ? 0 : dir);\n if (copy && dir == -1)\n moved = 0;\n range.moveBy(moved, 0);\n selection.fromOrientedRange(range);\n }\n else {\n var ranges = selection.rangeList.ranges;\n selection.rangeList.detach(this.session);\n this.inVirtualSelectionMode = true;\n var diff = 0;\n var totalDiff = 0;\n var l = ranges.length;\n for (var i = 0; i < l; i++) {\n var rangeIndex = i;\n ranges[i].moveBy(diff, 0);\n rows = this.$getSelectedRows(ranges[i]);\n var first = rows.first;\n var last = rows.last;\n while (++i < l) {\n if (totalDiff)\n ranges[i].moveBy(totalDiff, 0);\n var subRows = this.$getSelectedRows(ranges[i]);\n if (copy && subRows.first != last)\n break;\n else if (!copy && subRows.first > last + 1)\n break;\n last = subRows.last;\n }\n i--;\n diff = this.session.$moveLines(first, last, copy ? 0 : dir);\n if (copy && dir == -1)\n rangeIndex = i + 1;\n while (rangeIndex <= i) {\n ranges[rangeIndex].moveBy(diff, 0);\n rangeIndex++;\n }\n if (!copy)\n diff = 0;\n totalDiff += diff;\n }\n selection.fromOrientedRange(selection.ranges[0]);\n selection.rangeList.attach(this.session);\n this.inVirtualSelectionMode = false;\n }\n };\n Editor.prototype.$getSelectedRows = function (range) {\n range = (range || this.getSelectionRange()).collapseRows();\n return {\n first: this.session.getRowFoldStart(range.start.row),\n last: this.session.getRowFoldEnd(range.end.row)\n };\n };\n Editor.prototype.onCompositionStart = function (compositionState) {\n this.renderer.showComposition(compositionState);\n };\n Editor.prototype.onCompositionUpdate = function (text) {\n this.renderer.setCompositionText(text);\n };\n Editor.prototype.onCompositionEnd = function () {\n this.renderer.hideComposition();\n };\n Editor.prototype.getFirstVisibleRow = function () {\n return this.renderer.getFirstVisibleRow();\n };\n Editor.prototype.getLastVisibleRow = function () {\n return this.renderer.getLastVisibleRow();\n };\n Editor.prototype.isRowVisible = function (row) {\n return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow());\n };\n Editor.prototype.isRowFullyVisible = function (row) {\n return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow());\n };\n Editor.prototype.$getVisibleRowCount = function () {\n return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;\n };\n Editor.prototype.$moveByPage = function (dir, select) {\n var renderer = this.renderer;\n var config = this.renderer.layerConfig;\n var rows = dir * Math.floor(config.height / config.lineHeight);\n if (select === true) {\n this.selection.$moveSelection(function () {\n this.moveCursorBy(rows, 0);\n });\n }\n else if (select === false) {\n this.selection.moveCursorBy(rows, 0);\n this.selection.clearSelection();\n }\n var scrollTop = renderer.scrollTop;\n renderer.scrollBy(0, rows * config.lineHeight);\n if (select != null)\n renderer.scrollCursorIntoView(null, 0.5);\n renderer.animateScrolling(scrollTop);\n };\n Editor.prototype.selectPageDown = function () {\n this.$moveByPage(1, true);\n };\n Editor.prototype.selectPageUp = function () {\n this.$moveByPage(-1, true);\n };\n Editor.prototype.gotoPageDown = function () {\n this.$moveByPage(1, false);\n };\n Editor.prototype.gotoPageUp = function () {\n this.$moveByPage(-1, false);\n };\n Editor.prototype.scrollPageDown = function () {\n this.$moveByPage(1);\n };\n Editor.prototype.scrollPageUp = function () {\n this.$moveByPage(-1);\n };\n Editor.prototype.scrollToRow = function (row) {\n this.renderer.scrollToRow(row);\n };\n Editor.prototype.scrollToLine = function (line, center, animate, callback) {\n this.renderer.scrollToLine(line, center, animate, callback);\n };\n Editor.prototype.centerSelection = function () {\n var range = this.getSelectionRange();\n var pos = {\n row: Math.floor(range.start.row + (range.end.row - range.start.row) / 2),\n column: Math.floor(range.start.column + (range.end.column - range.start.column) / 2)\n };\n this.renderer.alignCursor(pos, 0.5);\n };\n Editor.prototype.getCursorPosition = function () {\n return this.selection.getCursor();\n };\n Editor.prototype.getCursorPositionScreen = function () {\n return this.session.documentToScreenPosition(this.getCursorPosition());\n };\n Editor.prototype.getSelectionRange = function () {\n return this.selection.getRange();\n };\n Editor.prototype.selectAll = function () {\n this.selection.selectAll();\n };\n Editor.prototype.clearSelection = function () {\n this.selection.clearSelection();\n };\n Editor.prototype.moveCursorTo = function (row, column) {\n this.selection.moveCursorTo(row, column);\n };\n Editor.prototype.moveCursorToPosition = function (pos) {\n this.selection.moveCursorToPosition(pos);\n };\n Editor.prototype.jumpToMatching = function (select, expand) {\n var cursor = this.getCursorPosition();\n var iterator = new TokenIterator(this.session, cursor.row, cursor.column);\n var prevToken = iterator.getCurrentToken();\n var tokenCount = 0;\n if (prevToken && prevToken.type.indexOf('tag-name') !== -1) {\n prevToken = iterator.stepBackward();\n }\n var token = prevToken || iterator.stepForward();\n if (!token)\n return;\n var matchType;\n var found = false;\n var depth = {};\n var i = cursor.column - token.start;\n var bracketType;\n var brackets = {\n \")\": \"(\",\n \"(\": \"(\",\n \"]\": \"[\",\n \"[\": \"[\",\n \"{\": \"{\",\n \"}\": \"{\"\n };\n do {\n if (token.value.match(/[{}()\\[\\]]/g)) {\n for (; i < token.value.length && !found; i++) {\n if (!brackets[token.value[i]]) {\n continue;\n }\n bracketType = brackets[token.value[i]] + '.' + token.type.replace(\"rparen\", \"lparen\");\n if (isNaN(depth[bracketType])) {\n depth[bracketType] = 0;\n }\n switch (token.value[i]) {\n case '(':\n case '[':\n case '{':\n depth[bracketType]++;\n break;\n case ')':\n case ']':\n case '}':\n depth[bracketType]--;\n if (depth[bracketType] === -1) {\n matchType = 'bracket';\n found = true;\n }\n break;\n }\n }\n }\n else if (token.type.indexOf('tag-name') !== -1) {\n if (isNaN(depth[token.value])) {\n depth[token.value] = 0;\n }\n if (prevToken.value === '<' && tokenCount > 1) {\n depth[token.value]++;\n }\n else if (prevToken.value === '= 0; --i) {\n if (this.$tryReplace(ranges[i], replacement)) {\n replaced++;\n }\n }\n this.selection.setSelectionRange(selection);\n return replaced;\n };\n Editor.prototype.$tryReplace = function (range, replacement) {\n var input = this.session.getTextRange(range);\n replacement = this.$search.replace(input, replacement);\n if (replacement !== null) {\n range.end = this.session.replace(range, replacement);\n return range;\n }\n else {\n return null;\n }\n };\n Editor.prototype.getLastSearchOptions = function () {\n return this.$search.getOptions();\n };\n Editor.prototype.find = function (needle, options, animate) {\n if (!options)\n options = {};\n if (typeof needle == \"string\" || needle instanceof RegExp)\n options.needle = needle;\n else if (typeof needle == \"object\")\n oop.mixin(options, needle);\n var range = this.selection.getRange();\n if (options.needle == null) {\n needle = this.session.getTextRange(range)\n || this.$search.$options.needle;\n if (!needle) {\n range = this.session.getWordRange(range.start.row, range.start.column);\n needle = this.session.getTextRange(range);\n }\n this.$search.set({ needle: needle });\n }\n this.$search.set(options);\n if (!options.start)\n this.$search.set({ start: range });\n var newRange = this.$search.find(this.session);\n if (options.preventScroll)\n return newRange;\n if (newRange) {\n this.revealRange(newRange, animate);\n return newRange;\n }\n if (options.backwards)\n range.start = range.end;\n else\n range.end = range.start;\n this.selection.setRange(range);\n };\n Editor.prototype.findNext = function (options, animate) {\n this.find({ skipCurrent: true, backwards: false }, options, animate);\n };\n Editor.prototype.findPrevious = function (options, animate) {\n this.find(options, { skipCurrent: true, backwards: true }, animate);\n };\n Editor.prototype.revealRange = function (range, animate) {\n this.session.unfold(range);\n this.selection.setSelectionRange(range);\n var scrollTop = this.renderer.scrollTop;\n this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5);\n if (animate !== false)\n this.renderer.animateScrolling(scrollTop);\n };\n Editor.prototype.undo = function () {\n this.session.getUndoManager().undo(this.session);\n this.renderer.scrollCursorIntoView(null, 0.5);\n };\n Editor.prototype.redo = function () {\n this.session.getUndoManager().redo(this.session);\n this.renderer.scrollCursorIntoView(null, 0.5);\n };\n Editor.prototype.destroy = function () {\n if (this.$toDestroy) {\n this.$toDestroy.forEach(function (el) {\n el.destroy();\n });\n this.$toDestroy = null;\n }\n if (this.$mouseHandler)\n this.$mouseHandler.destroy();\n this.renderer.destroy();\n this._signal(\"destroy\", this);\n if (this.session)\n this.session.destroy();\n if (this._$emitInputEvent)\n this._$emitInputEvent.cancel();\n this.removeAllListeners();\n };\n Editor.prototype.setAutoScrollEditorIntoView = function (enable) {\n if (!enable)\n return;\n var rect;\n var self = this;\n var shouldScroll = false;\n if (!this.$scrollAnchor)\n this.$scrollAnchor = document.createElement(\"div\");\n var scrollAnchor = this.$scrollAnchor;\n scrollAnchor.style.cssText = \"position:absolute\";\n this.container.insertBefore(scrollAnchor, this.container.firstChild);\n var onChangeSelection = this.on(\"changeSelection\", function () {\n shouldScroll = true;\n });\n var onBeforeRender = this.renderer.on(\"beforeRender\", function () {\n if (shouldScroll)\n rect = self.renderer.container.getBoundingClientRect();\n });\n var onAfterRender = this.renderer.on(\"afterRender\", function () {\n if (shouldScroll && rect && (self.isFocused()\n || self.searchBox && self.searchBox.isFocused())) {\n var renderer = self.renderer;\n var pos = renderer.$cursorLayer.$pixelPos;\n var config = renderer.layerConfig;\n var top = pos.top - config.offset;\n if (pos.top >= 0 && top + rect.top < 0) {\n shouldScroll = true;\n }\n else if (pos.top < config.height &&\n pos.top + rect.top + config.lineHeight > window.innerHeight) {\n shouldScroll = false;\n }\n else {\n shouldScroll = null;\n }\n if (shouldScroll != null) {\n scrollAnchor.style.top = top + \"px\";\n scrollAnchor.style.left = pos.left + \"px\";\n scrollAnchor.style.height = config.lineHeight + \"px\";\n scrollAnchor.scrollIntoView(shouldScroll);\n }\n shouldScroll = rect = null;\n }\n });\n this.setAutoScrollEditorIntoView = function (enable) {\n if (enable)\n return;\n delete this.setAutoScrollEditorIntoView;\n this.off(\"changeSelection\", onChangeSelection);\n this.renderer.off(\"afterRender\", onAfterRender);\n this.renderer.off(\"beforeRender\", onBeforeRender);\n };\n };\n Editor.prototype.$resetCursorStyle = function () {\n var style = this.$cursorStyle || \"ace\";\n var cursorLayer = this.renderer.$cursorLayer;\n if (!cursorLayer)\n return;\n cursorLayer.setSmoothBlinking(/smooth/.test(style));\n cursorLayer.isBlinking = !this.$readOnly && style != \"wide\";\n dom.setCssClass(cursorLayer.element, \"ace_slim-cursors\", /slim/.test(style));\n };\n Editor.prototype.prompt = function (message, options, callback) {\n var editor = this;\n config.loadModule(\"ace/ext/prompt\", function (module) {\n module.prompt(editor, message, options, callback);\n });\n };\n return Editor;\n}());\nEditor.$uid = 0;\nEditor.prototype.curOp = null;\nEditor.prototype.prevOp = {};\nEditor.prototype.$mergeableCommands = [\"backspace\", \"del\", \"insertstring\"];\nEditor.prototype.$toggleWordPairs = [\n [\"first\", \"last\"],\n [\"true\", \"false\"],\n [\"yes\", \"no\"],\n [\"width\", \"height\"],\n [\"top\", \"bottom\"],\n [\"right\", \"left\"],\n [\"on\", \"off\"],\n [\"x\", \"y\"],\n [\"get\", \"set\"],\n [\"max\", \"min\"],\n [\"horizontal\", \"vertical\"],\n [\"show\", \"hide\"],\n [\"add\", \"remove\"],\n [\"up\", \"down\"],\n [\"before\", \"after\"],\n [\"even\", \"odd\"],\n [\"in\", \"out\"],\n [\"inside\", \"outside\"],\n [\"next\", \"previous\"],\n [\"increase\", \"decrease\"],\n [\"attach\", \"detach\"],\n [\"&&\", \"||\"],\n [\"==\", \"!=\"]\n];\noop.implement(Editor.prototype, EventEmitter);\nconfig.defineOptions(Editor.prototype, \"editor\", {\n selectionStyle: {\n set: function (style) {\n this.onSelectionChange();\n this._signal(\"changeSelectionStyle\", { data: style });\n },\n initialValue: \"line\"\n },\n highlightActiveLine: {\n set: function () { this.$updateHighlightActiveLine(); },\n initialValue: true\n },\n highlightSelectedWord: {\n set: function (shouldHighlight) { this.$onSelectionChange(); },\n initialValue: true\n },\n readOnly: {\n set: function (readOnly) {\n this.textInput.setReadOnly(readOnly);\n this.$resetCursorStyle();\n },\n initialValue: false\n },\n copyWithEmptySelection: {\n set: function (value) {\n this.textInput.setCopyWithEmptySelection(value);\n },\n initialValue: false\n },\n cursorStyle: {\n set: function (val) { this.$resetCursorStyle(); },\n values: [\"ace\", \"slim\", \"smooth\", \"wide\"],\n initialValue: \"ace\"\n },\n mergeUndoDeltas: {\n values: [false, true, \"always\"],\n initialValue: true\n },\n behavioursEnabled: { initialValue: true },\n wrapBehavioursEnabled: { initialValue: true },\n enableAutoIndent: { initialValue: true },\n autoScrollEditorIntoView: {\n set: function (val) { this.setAutoScrollEditorIntoView(val); }\n },\n keyboardHandler: {\n set: function (val) { this.setKeyboardHandler(val); },\n get: function () { return this.$keybindingId; },\n handlesSet: true\n },\n value: {\n set: function (val) { this.session.setValue(val); },\n get: function () { return this.getValue(); },\n handlesSet: true,\n hidden: true\n },\n session: {\n set: function (val) { this.setSession(val); },\n get: function () { return this.session; },\n handlesSet: true,\n hidden: true\n },\n showLineNumbers: {\n set: function (show) {\n this.renderer.$gutterLayer.setShowLineNumbers(show);\n this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER);\n if (show && this.$relativeLineNumbers)\n relativeNumberRenderer.attach(this);\n else\n relativeNumberRenderer.detach(this);\n },\n initialValue: true\n },\n relativeLineNumbers: {\n set: function (value) {\n if (this.$showLineNumbers && value)\n relativeNumberRenderer.attach(this);\n else\n relativeNumberRenderer.detach(this);\n }\n },\n placeholder: {\n set: function (message) {\n if (!this.$updatePlaceholder) {\n this.$updatePlaceholder = function () {\n var hasValue = this.session && (this.renderer.$composition ||\n this.session.getLength() > 1 || this.session.getLine(0).length > 0);\n if (hasValue && this.renderer.placeholderNode) {\n this.renderer.off(\"afterRender\", this.$updatePlaceholder);\n dom.removeCssClass(this.container, \"ace_hasPlaceholder\");\n this.renderer.placeholderNode.remove();\n this.renderer.placeholderNode = null;\n }\n else if (!hasValue && !this.renderer.placeholderNode) {\n this.renderer.on(\"afterRender\", this.$updatePlaceholder);\n dom.addCssClass(this.container, \"ace_hasPlaceholder\");\n var el = dom.createElement(\"div\");\n el.className = \"ace_placeholder\";\n el.textContent = this.$placeholder || \"\";\n this.renderer.placeholderNode = el;\n this.renderer.content.appendChild(this.renderer.placeholderNode);\n }\n else if (!hasValue && this.renderer.placeholderNode) {\n this.renderer.placeholderNode.textContent = this.$placeholder || \"\";\n }\n }.bind(this);\n this.on(\"input\", this.$updatePlaceholder);\n }\n this.$updatePlaceholder();\n }\n },\n enableKeyboardAccessibility: {\n set: function (value) {\n var blurCommand = {\n name: \"blurTextInput\",\n description: \"Set focus to the editor content div to allow tabbing through the page\",\n bindKey: \"Esc\",\n exec: function (editor) {\n editor.blur();\n editor.renderer.scroller.focus();\n },\n readOnly: true\n };\n var focusOnEnterKeyup = function (e) {\n if (e.target == this.renderer.scroller && e.keyCode === keys['enter']) {\n e.preventDefault();\n var row = this.getCursorPosition().row;\n if (!this.isRowVisible(row))\n this.scrollToLine(row, true, true);\n this.focus();\n }\n };\n var gutterKeyboardHandler;\n if (value) {\n this.renderer.enableKeyboardAccessibility = true;\n this.renderer.keyboardFocusClassName = \"ace_keyboard-focus\";\n this.textInput.getElement().setAttribute(\"tabindex\", -1);\n this.textInput.setNumberOfExtraLines(useragent.isWin ? 3 : 0);\n this.renderer.scroller.setAttribute(\"tabindex\", 0);\n this.renderer.scroller.setAttribute(\"role\", \"group\");\n this.renderer.scroller.setAttribute(\"aria-roledescription\", nls(\"editor.scroller.aria-roledescription\", \"editor\"));\n this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName);\n this.renderer.scroller.setAttribute(\"aria-label\", nls(\"editor.scroller.aria-label\", \"Editor content, press Enter to start editing, press Escape to exit\"));\n this.renderer.scroller.addEventListener(\"keyup\", focusOnEnterKeyup.bind(this));\n this.commands.addCommand(blurCommand);\n this.renderer.$gutter.setAttribute(\"tabindex\", 0);\n this.renderer.$gutter.setAttribute(\"aria-hidden\", false);\n this.renderer.$gutter.setAttribute(\"role\", \"group\");\n this.renderer.$gutter.setAttribute(\"aria-roledescription\", nls(\"editor.gutter.aria-roledescription\", \"editor\"));\n this.renderer.$gutter.setAttribute(\"aria-label\", nls(\"editor.gutter.aria-label\", \"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit\"));\n this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName);\n this.renderer.content.setAttribute(\"aria-hidden\", true);\n if (!gutterKeyboardHandler)\n gutterKeyboardHandler = new GutterKeyboardHandler(this);\n gutterKeyboardHandler.addListener();\n }\n else {\n this.renderer.enableKeyboardAccessibility = false;\n this.textInput.getElement().setAttribute(\"tabindex\", 0);\n this.textInput.setNumberOfExtraLines(0);\n this.renderer.scroller.setAttribute(\"tabindex\", -1);\n this.renderer.scroller.removeAttribute(\"role\");\n this.renderer.scroller.removeAttribute(\"aria-roledescription\");\n this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName);\n this.renderer.scroller.removeAttribute(\"aria-label\");\n this.renderer.scroller.removeEventListener(\"keyup\", focusOnEnterKeyup.bind(this));\n this.commands.removeCommand(blurCommand);\n this.renderer.content.removeAttribute(\"aria-hidden\");\n this.renderer.$gutter.setAttribute(\"tabindex\", -1);\n this.renderer.$gutter.setAttribute(\"aria-hidden\", true);\n this.renderer.$gutter.removeAttribute(\"role\");\n this.renderer.$gutter.removeAttribute(\"aria-roledescription\");\n this.renderer.$gutter.removeAttribute(\"aria-label\");\n this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName);\n if (gutterKeyboardHandler)\n gutterKeyboardHandler.removeListener();\n }\n },\n initialValue: false\n },\n customScrollbar: \"renderer\",\n hScrollBarAlwaysVisible: \"renderer\",\n vScrollBarAlwaysVisible: \"renderer\",\n highlightGutterLine: \"renderer\",\n animatedScroll: \"renderer\",\n showInvisibles: \"renderer\",\n showPrintMargin: \"renderer\",\n printMarginColumn: \"renderer\",\n printMargin: \"renderer\",\n fadeFoldWidgets: \"renderer\",\n showFoldWidgets: \"renderer\",\n displayIndentGuides: \"renderer\",\n highlightIndentGuides: \"renderer\",\n showGutter: \"renderer\",\n fontSize: \"renderer\",\n fontFamily: \"renderer\",\n maxLines: \"renderer\",\n minLines: \"renderer\",\n scrollPastEnd: \"renderer\",\n fixedWidthGutter: \"renderer\",\n theme: \"renderer\",\n hasCssTransforms: \"renderer\",\n maxPixelHeight: \"renderer\",\n useTextareaForIME: \"renderer\",\n useResizeObserver: \"renderer\",\n useSvgGutterIcons: \"renderer\",\n showFoldedAnnotations: \"renderer\",\n scrollSpeed: \"$mouseHandler\",\n dragDelay: \"$mouseHandler\",\n dragEnabled: \"$mouseHandler\",\n focusTimeout: \"$mouseHandler\",\n tooltipFollowsMouse: \"$mouseHandler\",\n firstLineNumber: \"session\",\n overwrite: \"session\",\n newLineMode: \"session\",\n useWorker: \"session\",\n useSoftTabs: \"session\",\n navigateWithinSoftTabs: \"session\",\n tabSize: \"session\",\n wrap: \"session\",\n indentedSoftWrap: \"session\",\n foldStyle: \"session\",\n mode: \"session\"\n});\nvar relativeNumberRenderer = {\n getText: function (/**@type{EditSession}*/ session, /**@type{number}*/ row) {\n return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9 ? \"\\xb7\" : \"\"))) + \"\";\n },\n getWidth: function (session, /**@type{number}*/ lastLineNumber, config) {\n return Math.max(lastLineNumber.toString().length, (config.lastRow + 1).toString().length, 2) * config.characterWidth;\n },\n update: function (e, /**@type{Editor}*/ editor) {\n editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER);\n },\n attach: function (/**@type{Editor}*/ editor) {\n editor.renderer.$gutterLayer.$renderer = this;\n editor.on(\"changeSelection\", this.update);\n this.update(null, editor);\n },\n detach: function (/**@type{Editor}*/ editor) {\n if (editor.renderer.$gutterLayer.$renderer == this)\n editor.renderer.$gutterLayer.$renderer = null;\n editor.off(\"changeSelection\", this.update);\n this.update(null, editor);\n }\n};\nexports.Editor = Editor;\n\n});\n\nace.define(\"ace/layer/lines\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar Lines = /** @class */ (function () {\n function Lines(element, canvasHeight) {\n this.element = element;\n this.canvasHeight = canvasHeight || 500000;\n this.element.style.height = (this.canvasHeight * 2) + \"px\";\n this.cells = [];\n this.cellCache = [];\n this.$offsetCoefficient = 0;\n }\n Lines.prototype.moveContainer = function (config) {\n dom.translate(this.element, 0, -((config.firstRowScreen * config.lineHeight) % this.canvasHeight) - config.offset * this.$offsetCoefficient);\n };\n Lines.prototype.pageChanged = function (oldConfig, newConfig) {\n return (Math.floor((oldConfig.firstRowScreen * oldConfig.lineHeight) / this.canvasHeight) !==\n Math.floor((newConfig.firstRowScreen * newConfig.lineHeight) / this.canvasHeight));\n };\n Lines.prototype.computeLineTop = function (row, config, session) {\n var screenTop = config.firstRowScreen * config.lineHeight;\n var screenPage = Math.floor(screenTop / this.canvasHeight);\n var lineTop = session.documentToScreenRow(row, 0) * config.lineHeight;\n return lineTop - (screenPage * this.canvasHeight);\n };\n Lines.prototype.computeLineHeight = function (row, config, session) {\n return config.lineHeight * session.getRowLineCount(row);\n };\n Lines.prototype.getLength = function () {\n return this.cells.length;\n };\n Lines.prototype.get = function (index) {\n return this.cells[index];\n };\n Lines.prototype.shift = function () {\n this.$cacheCell(this.cells.shift());\n };\n Lines.prototype.pop = function () {\n this.$cacheCell(this.cells.pop());\n };\n Lines.prototype.push = function (cell) {\n if (Array.isArray(cell)) {\n this.cells.push.apply(this.cells, cell);\n var fragment = dom.createFragment(this.element);\n for (var i = 0; i < cell.length; i++) {\n fragment.appendChild(cell[i].element);\n }\n this.element.appendChild(fragment);\n }\n else {\n this.cells.push(cell);\n this.element.appendChild(cell.element);\n }\n };\n Lines.prototype.unshift = function (cell) {\n if (Array.isArray(cell)) {\n this.cells.unshift.apply(this.cells, cell);\n var fragment = dom.createFragment(this.element);\n for (var i = 0; i < cell.length; i++) {\n fragment.appendChild(cell[i].element);\n }\n if (this.element.firstChild)\n this.element.insertBefore(fragment, this.element.firstChild);\n else\n this.element.appendChild(fragment);\n }\n else {\n this.cells.unshift(cell);\n this.element.insertAdjacentElement(\"afterbegin\", cell.element);\n }\n };\n Lines.prototype.last = function () {\n if (this.cells.length)\n return this.cells[this.cells.length - 1];\n else\n return null;\n };\n Lines.prototype.$cacheCell = function (cell) {\n if (!cell)\n return;\n cell.element.remove();\n this.cellCache.push(cell);\n };\n Lines.prototype.createCell = function (row, config, session, initElement) {\n var cell = this.cellCache.pop();\n if (!cell) {\n var element = dom.createElement(\"div\");\n if (initElement)\n initElement(element);\n this.element.appendChild(element);\n cell = {\n element: element,\n text: \"\",\n row: row\n };\n }\n cell.row = row;\n return cell;\n };\n return Lines;\n}());\nexports.Lines = Lines;\n\n});\n\nace.define(\"ace/layer/gutter\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/lib/event_emitter\",\"ace/layer/lines\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar oop = require(\"../lib/oop\");\nvar lang = require(\"../lib/lang\");\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar Lines = require(\"./lines\").Lines;\nvar nls = require(\"../config\").nls;\nvar Gutter = /** @class */ (function () {\n function Gutter(parentEl) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_gutter-layer\";\n parentEl.appendChild(this.element);\n this.setShowFoldWidgets(this.$showFoldWidgets);\n this.gutterWidth = 0;\n this.$annotations = [];\n this.$updateAnnotations = this.$updateAnnotations.bind(this);\n this.$lines = new Lines(this.element);\n this.$lines.$offsetCoefficient = 1;\n }\n Gutter.prototype.setSession = function (session) {\n if (this.session)\n this.session.off(\"change\", this.$updateAnnotations);\n this.session = session;\n if (session)\n session.on(\"change\", this.$updateAnnotations);\n };\n Gutter.prototype.addGutterDecoration = function (row, className) {\n if (window.console)\n console.warn && console.warn(\"deprecated use session.addGutterDecoration\");\n this.session.addGutterDecoration(row, className);\n };\n Gutter.prototype.removeGutterDecoration = function (row, className) {\n if (window.console)\n console.warn && console.warn(\"deprecated use session.removeGutterDecoration\");\n this.session.removeGutterDecoration(row, className);\n };\n Gutter.prototype.setAnnotations = function (annotations) {\n this.$annotations = [];\n for (var i = 0; i < annotations.length; i++) {\n var annotation = annotations[i];\n var row = annotation.row;\n var rowInfo = this.$annotations[row];\n if (!rowInfo)\n rowInfo = this.$annotations[row] = { text: [], type: [] };\n var annoText = annotation.text;\n var annoType = annotation.type;\n annoText = annoText ? lang.escapeHTML(annoText) : annotation.html || \"\";\n if (rowInfo.text.indexOf(annoText) === -1) {\n rowInfo.text.push(annoText);\n rowInfo.type.push(annoType);\n }\n var className = annotation.className;\n if (className)\n rowInfo.className = className;\n else if (annoType == \"error\")\n rowInfo.className = \" ace_error\";\n else if (annoType == \"warning\" && rowInfo.className != \" ace_error\")\n rowInfo.className = \" ace_warning\";\n else if (annoType == \"info\" && (!rowInfo.className))\n rowInfo.className = \" ace_info\";\n }\n };\n Gutter.prototype.$updateAnnotations = function (delta) {\n if (!this.$annotations.length)\n return;\n var firstRow = delta.start.row;\n var len = delta.end.row - firstRow;\n if (len === 0) {\n }\n else if (delta.action == 'remove') {\n this.$annotations.splice(firstRow, len + 1, null);\n }\n else {\n var args = new Array(len + 1);\n args.unshift(firstRow, 1);\n this.$annotations.splice.apply(this.$annotations, args);\n }\n };\n Gutter.prototype.update = function (config) {\n this.config = config;\n var session = this.session;\n var firstRow = config.firstRow;\n var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar\n session.getLength() - 1);\n this.oldLastRow = lastRow;\n this.config = config;\n this.$lines.moveContainer(config);\n this.$updateCursorRow();\n var fold = session.getNextFoldLine(firstRow);\n var foldStart = fold ? fold.start.row : Infinity;\n var cell = null;\n var index = -1;\n var row = firstRow;\n while (true) {\n if (row > foldStart) {\n row = fold.end.row + 1;\n fold = session.getNextFoldLine(row, fold);\n foldStart = fold ? fold.start.row : Infinity;\n }\n if (row > lastRow) {\n while (this.$lines.getLength() > index + 1)\n this.$lines.pop();\n break;\n }\n cell = this.$lines.get(++index);\n if (cell) {\n cell.row = row;\n }\n else {\n cell = this.$lines.createCell(row, config, this.session, onCreateCell);\n this.$lines.push(cell);\n }\n this.$renderCell(cell, config, fold, row);\n row++;\n }\n this._signal(\"afterRender\");\n this.$updateGutterWidth(config);\n };\n Gutter.prototype.$updateGutterWidth = function (config) {\n var session = this.session;\n var gutterRenderer = session.gutterRenderer || this.$renderer;\n var firstLineNumber = session.$firstLineNumber;\n var lastLineText = this.$lines.last() ? this.$lines.last().text : \"\";\n if (this.$fixedWidth || session.$useWrapMode)\n lastLineText = session.getLength() + firstLineNumber - 1;\n var gutterWidth = gutterRenderer\n ? gutterRenderer.getWidth(session, lastLineText, config)\n : lastLineText.toString().length * config.characterWidth;\n var padding = this.$padding || this.$computePadding();\n gutterWidth += padding.left + padding.right;\n if (gutterWidth !== this.gutterWidth && !isNaN(gutterWidth)) {\n this.gutterWidth = gutterWidth; (this.element.parentNode).style.width =\n this.element.style.width = Math.ceil(this.gutterWidth) + \"px\";\n this._signal(\"changeGutterWidth\", gutterWidth);\n }\n };\n Gutter.prototype.$updateCursorRow = function () {\n if (!this.$highlightGutterLine)\n return;\n var position = this.session.selection.getCursor();\n if (this.$cursorRow === position.row)\n return;\n this.$cursorRow = position.row;\n };\n Gutter.prototype.updateLineHighlight = function () {\n if (!this.$highlightGutterLine)\n return;\n var row = this.session.selection.cursor.row;\n this.$cursorRow = row;\n if (this.$cursorCell && this.$cursorCell.row == row)\n return;\n if (this.$cursorCell)\n this.$cursorCell.element.className = this.$cursorCell.element.className.replace(\"ace_gutter-active-line \", \"\");\n var cells = this.$lines.cells;\n this.$cursorCell = null;\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n if (cell.row >= this.$cursorRow) {\n if (cell.row > this.$cursorRow) {\n var fold = this.session.getFoldLine(this.$cursorRow);\n if (i > 0 && fold && fold.start.row == cells[i - 1].row)\n cell = cells[i - 1];\n else\n break;\n }\n cell.element.className = \"ace_gutter-active-line \" + cell.element.className;\n this.$cursorCell = cell;\n break;\n }\n }\n };\n Gutter.prototype.scrollLines = function (config) {\n var oldConfig = this.config;\n this.config = config;\n this.$updateCursorRow();\n if (this.$lines.pageChanged(oldConfig, config))\n return this.update(config);\n this.$lines.moveContainer(config);\n var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar\n this.session.getLength() - 1);\n var oldLastRow = this.oldLastRow;\n this.oldLastRow = lastRow;\n if (!oldConfig || oldLastRow < config.firstRow)\n return this.update(config);\n if (lastRow < oldConfig.firstRow)\n return this.update(config);\n if (oldConfig.firstRow < config.firstRow)\n for (var row = this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row > 0; row--)\n this.$lines.shift();\n if (oldLastRow > lastRow)\n for (var row = this.session.getFoldedRowCount(lastRow + 1, oldLastRow); row > 0; row--)\n this.$lines.pop();\n if (config.firstRow < oldConfig.firstRow) {\n this.$lines.unshift(this.$renderLines(config, config.firstRow, oldConfig.firstRow - 1));\n }\n if (lastRow > oldLastRow) {\n this.$lines.push(this.$renderLines(config, oldLastRow + 1, lastRow));\n }\n this.updateLineHighlight();\n this._signal(\"afterRender\");\n this.$updateGutterWidth(config);\n };\n Gutter.prototype.$renderLines = function (config, firstRow, lastRow) {\n var fragment = [];\n var row = firstRow;\n var foldLine = this.session.getNextFoldLine(row);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (true) {\n if (row > foldStart) {\n row = foldLine.end.row + 1;\n foldLine = this.session.getNextFoldLine(row, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n if (row > lastRow)\n break;\n var cell = this.$lines.createCell(row, config, this.session, onCreateCell);\n this.$renderCell(cell, config, foldLine, row);\n fragment.push(cell);\n row++;\n }\n return fragment;\n };\n Gutter.prototype.$renderCell = function (cell, config, fold, row) {\n var element = cell.element;\n var session = this.session;\n var textNode = element.childNodes[0];\n var foldWidget = element.childNodes[1];\n var annotationNode = element.childNodes[2];\n var annotationIconNode = annotationNode.firstChild;\n var firstLineNumber = session.$firstLineNumber;\n var breakpoints = session.$breakpoints;\n var decorations = session.$decorations;\n var gutterRenderer = session.gutterRenderer || this.$renderer;\n var foldWidgets = this.$showFoldWidgets && session.foldWidgets;\n var foldStart = fold ? fold.start.row : Number.MAX_VALUE;\n var lineHeight = config.lineHeight + \"px\";\n var className = this.$useSvgGutterIcons ? \"ace_gutter-cell_svg-icons \" : \"ace_gutter-cell \";\n var iconClassName = this.$useSvgGutterIcons ? \"ace_icon_svg\" : \"ace_icon\";\n var rowText = (gutterRenderer\n ? gutterRenderer.getText(session, row)\n : row + firstLineNumber).toString();\n if (this.$highlightGutterLine) {\n if (row == this.$cursorRow || (fold && row < this.$cursorRow && row >= foldStart && this.$cursorRow <= fold.end.row)) {\n className += \"ace_gutter-active-line \";\n if (this.$cursorCell != cell) {\n if (this.$cursorCell)\n this.$cursorCell.element.className = this.$cursorCell.element.className.replace(\"ace_gutter-active-line \", \"\");\n this.$cursorCell = cell;\n }\n }\n }\n if (breakpoints[row])\n className += breakpoints[row];\n if (decorations[row])\n className += decorations[row];\n if (this.$annotations[row] && row !== foldStart)\n className += this.$annotations[row].className;\n if (foldWidgets) {\n var c = foldWidgets[row];\n if (c == null)\n c = foldWidgets[row] = session.getFoldWidget(row);\n }\n if (c) {\n var foldClass = \"ace_fold-widget ace_\" + c;\n var isClosedFold = c == \"start\" && row == foldStart && row < fold.end.row;\n if (isClosedFold) {\n foldClass += \" ace_closed\";\n var foldAnnotationClass = '';\n var annotationInFold = false;\n for (var i = row + 1; i <= fold.end.row; i++) {\n if (!this.$annotations[i])\n continue;\n if (this.$annotations[i].className === \" ace_error\") {\n annotationInFold = true;\n foldAnnotationClass = \" ace_error_fold\";\n break;\n }\n if (this.$annotations[i].className === \" ace_warning\") {\n annotationInFold = true;\n foldAnnotationClass = \" ace_warning_fold\";\n continue;\n }\n }\n className += foldAnnotationClass;\n }\n else\n foldClass += \" ace_open\";\n if (foldWidget.className != foldClass)\n foldWidget.className = foldClass;\n dom.setStyle(foldWidget.style, \"height\", lineHeight);\n dom.setStyle(foldWidget.style, \"display\", \"inline-block\");\n foldWidget.setAttribute(\"role\", \"button\");\n foldWidget.setAttribute(\"tabindex\", \"-1\");\n var foldRange = session.getFoldWidgetRange(row);\n if (foldRange)\n foldWidget.setAttribute(\"aria-label\", nls(\"gutter.code-folding.range.aria-label\", \"Toggle code folding, rows $0 through $1\", [foldRange.start.row + 1, foldRange.end.row + 1]));\n else {\n if (fold)\n foldWidget.setAttribute(\"aria-label\", nls(\"gutter.code-folding.closed.aria-label\", \"Toggle code folding, rows $0 through $1\", [fold.start.row + 1, fold.end.row + 1]));\n else\n foldWidget.setAttribute(\"aria-label\", nls(\"gutter.code-folding.open.aria-label\", \"Toggle code folding, row $0\", [row + 1]));\n }\n if (isClosedFold) {\n foldWidget.setAttribute(\"aria-expanded\", \"false\");\n foldWidget.setAttribute(\"title\", nls(\"gutter.code-folding.closed.title\", \"Unfold code\"));\n }\n else {\n foldWidget.setAttribute(\"aria-expanded\", \"true\");\n foldWidget.setAttribute(\"title\", nls(\"gutter.code-folding.open.title\", \"Fold code\"));\n }\n }\n else {\n if (foldWidget) {\n dom.setStyle(foldWidget.style, \"display\", \"none\");\n foldWidget.setAttribute(\"tabindex\", \"0\");\n foldWidget.removeAttribute(\"role\");\n foldWidget.removeAttribute(\"aria-label\");\n }\n }\n if (annotationInFold && this.$showFoldedAnnotations) {\n annotationNode.className = \"ace_gutter_annotation\";\n annotationIconNode.className = iconClassName;\n annotationIconNode.className += foldAnnotationClass;\n dom.setStyle(annotationIconNode.style, \"height\", lineHeight);\n dom.setStyle(annotationNode.style, \"display\", \"block\");\n dom.setStyle(annotationNode.style, \"height\", lineHeight);\n var ariaLabel;\n switch (foldAnnotationClass) {\n case \" ace_error_fold\":\n ariaLabel = nls(\"gutter.annotation.aria-label.error\", \"Read annotations row $0\", [rowText]);\n break;\n case \" ace_warning_fold\":\n ariaLabel = nls(\"gutter.annotation.aria-label.warning\", \"Read annotations row $0\", [rowText]);\n break;\n }\n annotationNode.setAttribute(\"aria-label\", ariaLabel);\n annotationNode.setAttribute(\"tabindex\", \"-1\");\n annotationNode.setAttribute(\"role\", \"button\");\n }\n else if (this.$annotations[row]) {\n annotationNode.className = \"ace_gutter_annotation\";\n annotationIconNode.className = iconClassName;\n if (this.$useSvgGutterIcons)\n annotationIconNode.className += this.$annotations[row].className;\n else\n element.classList.add(this.$annotations[row].className.replace(\" \", \"\"));\n dom.setStyle(annotationIconNode.style, \"height\", lineHeight);\n dom.setStyle(annotationNode.style, \"display\", \"block\");\n dom.setStyle(annotationNode.style, \"height\", lineHeight);\n var ariaLabel;\n switch (this.$annotations[row].className) {\n case \" ace_error\":\n ariaLabel = nls(\"gutter.annotation.aria-label.error\", \"Read annotations row $0\", [rowText]);\n break;\n case \" ace_warning\":\n ariaLabel = nls(\"gutter.annotation.aria-label.warning\", \"Read annotations row $0\", [rowText]);\n break;\n case \" ace_info\":\n ariaLabel = nls(\"gutter.annotation.aria-label.info\", \"Read annotations row $0\", [rowText]);\n break;\n }\n annotationNode.setAttribute(\"aria-label\", ariaLabel);\n annotationNode.setAttribute(\"tabindex\", \"-1\");\n annotationNode.setAttribute(\"role\", \"button\");\n }\n else {\n dom.setStyle(annotationNode.style, \"display\", \"none\");\n annotationNode.removeAttribute(\"aria-label\");\n annotationNode.removeAttribute(\"role\");\n annotationNode.setAttribute(\"tabindex\", \"0\");\n }\n if (rowText !== textNode.data) {\n textNode.data = rowText;\n }\n if (element.className != className)\n element.className = className;\n dom.setStyle(cell.element.style, \"height\", this.$lines.computeLineHeight(row, config, session) + \"px\");\n dom.setStyle(cell.element.style, \"top\", this.$lines.computeLineTop(row, config, session) + \"px\");\n cell.text = rowText;\n if (annotationNode.style.display === \"none\" && foldWidget.style.display === \"none\")\n cell.element.setAttribute(\"aria-hidden\", true);\n else\n cell.element.setAttribute(\"aria-hidden\", false);\n return cell;\n };\n Gutter.prototype.setHighlightGutterLine = function (highlightGutterLine) {\n this.$highlightGutterLine = highlightGutterLine;\n };\n Gutter.prototype.setShowLineNumbers = function (show) {\n this.$renderer = !show && {\n getWidth: function () { return 0; },\n getText: function () { return \"\"; }\n };\n };\n Gutter.prototype.getShowLineNumbers = function () {\n return this.$showLineNumbers;\n };\n Gutter.prototype.setShowFoldWidgets = function (show) {\n if (show)\n dom.addCssClass(this.element, \"ace_folding-enabled\");\n else\n dom.removeCssClass(this.element, \"ace_folding-enabled\");\n this.$showFoldWidgets = show;\n this.$padding = null;\n };\n Gutter.prototype.getShowFoldWidgets = function () {\n return this.$showFoldWidgets;\n };\n Gutter.prototype.$computePadding = function () {\n if (!this.element.firstChild)\n return { left: 0, right: 0 };\n var style = dom.computedStyle(/**@type{Element}*/ (this.element.firstChild));\n this.$padding = {};\n this.$padding.left = (parseInt(style.borderLeftWidth) || 0)\n + (parseInt(style.paddingLeft) || 0) + 1;\n this.$padding.right = (parseInt(style.borderRightWidth) || 0)\n + (parseInt(style.paddingRight) || 0);\n return this.$padding;\n };\n Gutter.prototype.getRegion = function (point) {\n var padding = this.$padding || this.$computePadding();\n var rect = this.element.getBoundingClientRect();\n if (point.x < padding.left + rect.left)\n return \"markers\";\n if (this.$showFoldWidgets && point.x > rect.right - padding.right)\n return \"foldWidgets\";\n };\n return Gutter;\n}());\nGutter.prototype.$fixedWidth = false;\nGutter.prototype.$highlightGutterLine = true;\nGutter.prototype.$renderer = \"\";\nGutter.prototype.$showLineNumbers = true;\nGutter.prototype.$showFoldWidgets = true;\noop.implement(Gutter.prototype, EventEmitter);\nfunction onCreateCell(element) {\n var textNode = document.createTextNode('');\n element.appendChild(textNode);\n var foldWidget = dom.createElement(\"span\");\n element.appendChild(foldWidget);\n var annotationNode = dom.createElement(\"span\");\n element.appendChild(annotationNode);\n var annotationIconNode = dom.createElement(\"span\");\n annotationNode.appendChild(annotationIconNode);\n return element;\n}\nexports.Gutter = Gutter;\n\n});\n\nace.define(\"ace/layer/marker\",[\"require\",\"exports\",\"module\",\"ace/range\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../range\").Range;\nvar dom = require(\"../lib/dom\");\nvar Marker = /** @class */ (function () {\n function Marker(parentEl) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_marker-layer\";\n parentEl.appendChild(this.element);\n }\n Marker.prototype.setPadding = function (padding) {\n this.$padding = padding;\n };\n Marker.prototype.setSession = function (session) {\n this.session = session;\n };\n Marker.prototype.setMarkers = function (markers) {\n this.markers = markers;\n };\n Marker.prototype.elt = function (className, css) {\n var x = this.i != -1 && this.element.childNodes[this.i];\n if (!x) {\n x = document.createElement(\"div\");\n this.element.appendChild(x);\n this.i = -1;\n }\n else {\n this.i++;\n }\n x.style.cssText = css;\n x.className = className;\n };\n Marker.prototype.update = function (config) {\n if (!config)\n return;\n this.config = config;\n this.i = 0;\n var html;\n for (var key in this.markers) {\n var marker = this.markers[key];\n if (!marker.range) {\n marker.update(html, this, this.session, config);\n continue;\n }\n var range = marker.range.clipRows(config.firstRow, config.lastRow);\n if (range.isEmpty())\n continue;\n range = range.toScreenRange(this.session);\n if (marker.renderer) {\n var top = this.$getTop(range.start.row, config);\n var left = this.$padding + range.start.column * config.characterWidth;\n marker.renderer(html, range, left, top, config);\n }\n else if (marker.type == \"fullLine\") {\n this.drawFullLineMarker(html, range, marker.clazz, config);\n }\n else if (marker.type == \"screenLine\") {\n this.drawScreenLineMarker(html, range, marker.clazz, config);\n }\n else if (range.isMultiLine()) {\n if (marker.type == \"text\")\n this.drawTextMarker(html, range, marker.clazz, config);\n else\n this.drawMultiLineMarker(html, range, marker.clazz, config);\n }\n else {\n this.drawSingleLineMarker(html, range, marker.clazz + \" ace_start\" + \" ace_br15\", config);\n }\n }\n if (this.i != -1) {\n while (this.i < this.element.childElementCount)\n this.element.removeChild(this.element.lastChild);\n }\n };\n Marker.prototype.$getTop = function (row, layerConfig) {\n return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight;\n };\n Marker.prototype.drawTextMarker = function (stringBuilder, range, clazz, layerConfig, extraStyle) {\n var session = this.session;\n var start = range.start.row;\n var end = range.end.row;\n var row = start;\n var prev = 0;\n var curr = 0;\n var next = session.getScreenLastRowColumn(row);\n var lineRange = new Range(row, range.start.column, row, curr);\n for (; row <= end; row++) {\n lineRange.start.row = lineRange.end.row = row;\n lineRange.start.column = row == start ? range.start.column : session.getRowWrapIndent(row);\n lineRange.end.column = next;\n prev = curr;\n curr = next;\n next = row + 1 < end ? session.getScreenLastRowColumn(row + 1) : row == end ? 0 : range.end.column;\n this.drawSingleLineMarker(stringBuilder, lineRange, clazz + (row == start ? \" ace_start\" : \"\") + \" ace_br\"\n + getBorderClass(row == start || row == start + 1 && range.start.column, prev < curr, curr > next, row == end), layerConfig, row == end ? 0 : 1, extraStyle);\n }\n };\n Marker.prototype.drawMultiLineMarker = function (stringBuilder, range, clazz, config, extraStyle) {\n var padding = this.$padding;\n var height = config.lineHeight;\n var top = this.$getTop(range.start.row, config);\n var left = padding + range.start.column * config.characterWidth;\n extraStyle = extraStyle || \"\";\n if (this.session.$bidiHandler.isBidiRow(range.start.row)) {\n var range1 = range.clone();\n range1.end.row = range1.start.row;\n range1.end.column = this.session.getLine(range1.start.row).length;\n this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + \" ace_br1 ace_start\", config, null, extraStyle);\n }\n else {\n this.elt(clazz + \" ace_br1 ace_start\", \"height:\" + height + \"px;\" + \"right:0;\" + \"top:\" + top + \"px;left:\" + left + \"px;\" + (extraStyle || \"\"));\n }\n if (this.session.$bidiHandler.isBidiRow(range.end.row)) {\n var range1 = range.clone();\n range1.start.row = range1.end.row;\n range1.start.column = 0;\n this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + \" ace_br12\", config, null, extraStyle);\n }\n else {\n top = this.$getTop(range.end.row, config);\n var width = range.end.column * config.characterWidth;\n this.elt(clazz + \" ace_br12\", \"height:\" + height + \"px;\" +\n \"width:\" + width + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:\" + padding + \"px;\" + (extraStyle || \"\"));\n }\n height = (range.end.row - range.start.row - 1) * config.lineHeight;\n if (height <= 0)\n return;\n top = this.$getTop(range.start.row + 1, config);\n var radiusClass = (range.start.column ? 1 : 0) | (range.end.column ? 0 : 8);\n this.elt(clazz + (radiusClass ? \" ace_br\" + radiusClass : \"\"), \"height:\" + height + \"px;\" +\n \"right:0;\" +\n \"top:\" + top + \"px;\" +\n \"left:\" + padding + \"px;\" + (extraStyle || \"\"));\n };\n Marker.prototype.drawSingleLineMarker = function (stringBuilder, range, clazz, config, extraLength, extraStyle) {\n if (this.session.$bidiHandler.isBidiRow(range.start.row))\n return this.drawBidiSingleLineMarker(stringBuilder, range, clazz, config, extraLength, extraStyle);\n var height = config.lineHeight;\n var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth;\n var top = this.$getTop(range.start.row, config);\n var left = this.$padding + range.start.column * config.characterWidth;\n this.elt(clazz, \"height:\" + height + \"px;\" +\n \"width:\" + width + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:\" + left + \"px;\" + (extraStyle || \"\"));\n };\n Marker.prototype.drawBidiSingleLineMarker = function (stringBuilder, range, clazz, config, extraLength, extraStyle) {\n var height = config.lineHeight, top = this.$getTop(range.start.row, config), padding = this.$padding;\n var selections = this.session.$bidiHandler.getSelections(range.start.column, range.end.column);\n selections.forEach(function (selection) {\n this.elt(clazz, \"height:\" + height + \"px;\" +\n \"width:\" + (selection.width + (extraLength || 0)) + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:\" + (padding + selection.left) + \"px;\" + (extraStyle || \"\"));\n }, this);\n };\n Marker.prototype.drawFullLineMarker = function (stringBuilder, range, clazz, config, extraStyle) {\n var top = this.$getTop(range.start.row, config);\n var height = config.lineHeight;\n if (range.start.row != range.end.row)\n height += this.$getTop(range.end.row, config) - top;\n this.elt(clazz, \"height:\" + height + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:0;right:0;\" + (extraStyle || \"\"));\n };\n Marker.prototype.drawScreenLineMarker = function (stringBuilder, range, clazz, config, extraStyle) {\n var top = this.$getTop(range.start.row, config);\n var height = config.lineHeight;\n this.elt(clazz, \"height:\" + height + \"px;\" +\n \"top:\" + top + \"px;\" +\n \"left:0;right:0;\" + (extraStyle || \"\"));\n };\n return Marker;\n}());\nMarker.prototype.$padding = 0;\nfunction getBorderClass(tl, tr, br, bl) {\n return (tl ? 1 : 0) | (tr ? 2 : 0) | (br ? 4 : 0) | (bl ? 8 : 0);\n}\nexports.Marker = Marker;\n\n});\n\nace.define(\"ace/layer/text_util\",[\"require\",\"exports\",\"module\"], function(require, exports, module){// Tokens for which Ace just uses a simple TextNode and does not add any special className.\nvar textTokens = new Set([\"text\", \"rparen\", \"lparen\"]);\nexports.isTextToken = function (tokenType) {\n return textTokens.has(tokenType);\n};\n\n});\n\nace.define(\"ace/layer/text\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/layer/lines\",\"ace/lib/event_emitter\",\"ace/config\",\"ace/layer/text_util\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../lib/oop\");\nvar dom = require(\"../lib/dom\");\nvar lang = require(\"../lib/lang\");\nvar Lines = require(\"./lines\").Lines;\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar nls = require(\"../config\").nls;\nvar isTextToken = require(\"./text_util\").isTextToken;\nvar Text = /** @class */ (function () {\n function Text(parentEl) {\n this.dom = dom;\n this.element = this.dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_text-layer\";\n parentEl.appendChild(this.element);\n this.$updateEolChar = this.$updateEolChar.bind(this);\n this.$lines = new Lines(this.element);\n }\n Text.prototype.$updateEolChar = function () {\n var doc = this.session.doc;\n var unixMode = doc.getNewLineCharacter() == \"\\n\" && doc.getNewLineMode() != \"windows\";\n var EOL_CHAR = unixMode ? this.EOL_CHAR_LF : this.EOL_CHAR_CRLF;\n if (this.EOL_CHAR != EOL_CHAR) {\n this.EOL_CHAR = EOL_CHAR;\n return true;\n }\n };\n Text.prototype.setPadding = function (padding) {\n this.$padding = padding;\n this.element.style.margin = \"0 \" + padding + \"px\";\n };\n Text.prototype.getLineHeight = function () {\n return this.$fontMetrics.$characterSize.height || 0;\n };\n Text.prototype.getCharacterWidth = function () {\n return this.$fontMetrics.$characterSize.width || 0;\n };\n Text.prototype.$setFontMetrics = function (measure) {\n this.$fontMetrics = measure;\n this.$fontMetrics.on(\"changeCharacterSize\", \n function (e) {\n this._signal(\"changeCharacterSize\", e);\n }.bind(this));\n this.$pollSizeChanges();\n };\n Text.prototype.checkForSizeChanges = function () {\n this.$fontMetrics.checkForSizeChanges();\n };\n Text.prototype.$pollSizeChanges = function () {\n return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges();\n };\n Text.prototype.setSession = function (session) {\n this.session = session;\n if (session)\n this.$computeTabString();\n };\n Text.prototype.setShowInvisibles = function (showInvisibles) {\n if (this.showInvisibles == showInvisibles)\n return false;\n this.showInvisibles = showInvisibles;\n if (typeof showInvisibles == \"string\") {\n this.showSpaces = /tab/i.test(showInvisibles);\n this.showTabs = /space/i.test(showInvisibles);\n this.showEOL = /eol/i.test(showInvisibles);\n }\n else {\n this.showSpaces = this.showTabs = this.showEOL = showInvisibles;\n }\n this.$computeTabString();\n return true;\n };\n Text.prototype.setDisplayIndentGuides = function (display) {\n if (this.displayIndentGuides == display)\n return false;\n this.displayIndentGuides = display;\n this.$computeTabString();\n return true;\n };\n Text.prototype.setHighlightIndentGuides = function (highlight) {\n if (this.$highlightIndentGuides === highlight)\n return false;\n this.$highlightIndentGuides = highlight;\n return highlight;\n };\n Text.prototype.$computeTabString = function () {\n var tabSize = this.session.getTabSize();\n this.tabSize = tabSize; var tabStr = this.$tabStrings = [0];\n for (var i = 1; i < tabSize + 1; i++) {\n if (this.showTabs) {\n var span = this.dom.createElement(\"span\");\n span.className = \"ace_invisible ace_invisible_tab\";\n span.textContent = lang.stringRepeat(this.TAB_CHAR, i);\n tabStr.push(span);\n }\n else {\n tabStr.push(this.dom.createTextNode(lang.stringRepeat(\" \", i), this.element));\n }\n }\n if (this.displayIndentGuides) {\n this.$indentGuideRe = /\\s\\S| \\t|\\t |\\s$/;\n var className = \"ace_indent-guide\";\n var spaceClass = this.showSpaces ? \" ace_invisible ace_invisible_space\" : \"\";\n var spaceContent = this.showSpaces\n ? lang.stringRepeat(this.SPACE_CHAR, this.tabSize)\n : lang.stringRepeat(\" \", this.tabSize);\n var tabClass = this.showTabs ? \" ace_invisible ace_invisible_tab\" : \"\";\n var tabContent = this.showTabs\n ? lang.stringRepeat(this.TAB_CHAR, this.tabSize)\n : spaceContent;\n var span = this.dom.createElement(\"span\");\n span.className = className + spaceClass;\n span.textContent = spaceContent;\n this.$tabStrings[\" \"] = span;\n var span = this.dom.createElement(\"span\");\n span.className = className + tabClass;\n span.textContent = tabContent;\n this.$tabStrings[\"\\t\"] = span;\n }\n };\n Text.prototype.updateLines = function (config, firstRow, lastRow) {\n if (this.config.lastRow != config.lastRow ||\n this.config.firstRow != config.firstRow) {\n return this.update(config);\n }\n this.config = config;\n var first = Math.max(firstRow, config.firstRow);\n var last = Math.min(lastRow, config.lastRow);\n var lineElements = this.element.childNodes;\n var lineElementsIdx = 0;\n for (var row = config.firstRow; row < first; row++) {\n var foldLine = this.session.getFoldLine(row);\n if (foldLine) {\n if (foldLine.containsRow(first)) {\n first = foldLine.start.row;\n break;\n }\n else {\n row = foldLine.end.row;\n }\n }\n lineElementsIdx++;\n }\n var heightChanged = false;\n var row = first;\n var foldLine = this.session.getNextFoldLine(row);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (true) {\n if (row > foldStart) {\n row = foldLine.end.row + 1;\n foldLine = this.session.getNextFoldLine(row, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n if (row > last)\n break; var lineElement = lineElements[lineElementsIdx++];\n if (lineElement) {\n this.dom.removeChildren(lineElement);\n this.$renderLine(lineElement, row, row == foldStart ? foldLine : false);\n if (heightChanged)\n lineElement.style.top = this.$lines.computeLineTop(row, config, this.session) + \"px\";\n var height = (config.lineHeight * this.session.getRowLength(row)) + \"px\";\n if (lineElement.style.height != height) {\n heightChanged = true;\n lineElement.style.height = height;\n }\n }\n row++;\n }\n if (heightChanged) {\n while (lineElementsIdx < this.$lines.cells.length) {\n var cell = this.$lines.cells[lineElementsIdx++];\n cell.element.style.top = this.$lines.computeLineTop(cell.row, config, this.session) + \"px\";\n }\n }\n };\n Text.prototype.scrollLines = function (config) {\n var oldConfig = this.config;\n this.config = config;\n if (this.$lines.pageChanged(oldConfig, config))\n return this.update(config);\n this.$lines.moveContainer(config);\n var lastRow = config.lastRow;\n var oldLastRow = oldConfig ? oldConfig.lastRow : -1;\n if (!oldConfig || oldLastRow < config.firstRow)\n return this.update(config);\n if (lastRow < oldConfig.firstRow)\n return this.update(config);\n if (!oldConfig || oldConfig.lastRow < config.firstRow)\n return this.update(config);\n if (config.lastRow < oldConfig.firstRow)\n return this.update(config);\n if (oldConfig.firstRow < config.firstRow)\n for (var row = this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row > 0; row--)\n this.$lines.shift();\n if (oldConfig.lastRow > config.lastRow)\n for (var row = this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row > 0; row--)\n this.$lines.pop();\n if (config.firstRow < oldConfig.firstRow) {\n this.$lines.unshift(this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1));\n }\n if (config.lastRow > oldConfig.lastRow) {\n this.$lines.push(this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow));\n }\n this.$highlightIndentGuide();\n };\n Text.prototype.$renderLinesFragment = function (config, firstRow, lastRow) {\n var fragment = [];\n var row = firstRow;\n var foldLine = this.session.getNextFoldLine(row);\n var foldStart = foldLine ? foldLine.start.row : Infinity;\n while (true) {\n if (row > foldStart) {\n row = foldLine.end.row + 1;\n foldLine = this.session.getNextFoldLine(row, foldLine);\n foldStart = foldLine ? foldLine.start.row : Infinity;\n }\n if (row > lastRow)\n break;\n var line = this.$lines.createCell(row, config, this.session);\n var lineEl = line.element;\n this.dom.removeChildren(lineEl);\n dom.setStyle(lineEl.style, \"height\", this.$lines.computeLineHeight(row, config, this.session) + \"px\");\n dom.setStyle(lineEl.style, \"top\", this.$lines.computeLineTop(row, config, this.session) + \"px\");\n this.$renderLine(lineEl, row, row == foldStart ? foldLine : false);\n if (this.$useLineGroups()) {\n lineEl.className = \"ace_line_group\";\n }\n else {\n lineEl.className = \"ace_line\";\n }\n fragment.push(line);\n row++;\n }\n return fragment;\n };\n Text.prototype.update = function (config) {\n this.$lines.moveContainer(config);\n this.config = config;\n var firstRow = config.firstRow;\n var lastRow = config.lastRow;\n var lines = this.$lines;\n while (lines.getLength())\n lines.pop();\n lines.push(this.$renderLinesFragment(config, firstRow, lastRow));\n };\n Text.prototype.$renderToken = function (parent, screenColumn, token, value) {\n var self = this;\n var re = /(\\t)|( +)|([\\x00-\\x1f\\x80-\\xa0\\xad\\u1680\\u180E\\u2000-\\u200f\\u2028\\u2029\\u202F\\u205F\\uFEFF\\uFFF9-\\uFFFC\\u2066\\u2067\\u2068\\u202A\\u202B\\u202D\\u202E\\u202C\\u2069]+)|(\\u3000)|([\\u1100-\\u115F\\u11A3-\\u11A7\\u11FA-\\u11FF\\u2329-\\u232A\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFB\\u3001-\\u303E\\u3041-\\u3096\\u3099-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u3190-\\u31BA\\u31C0-\\u31E3\\u31F0-\\u321E\\u3220-\\u3247\\u3250-\\u32FE\\u3300-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uA960-\\uA97C\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFAFF\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE66\\uFE68-\\uFE6B\\uFF01-\\uFF60\\uFFE0-\\uFFE6]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])/g;\n var valueFragment = this.dom.createFragment(this.element);\n var m;\n var i = 0;\n while (m = re.exec(value)) {\n var tab = m[1];\n var simpleSpace = m[2];\n var controlCharacter = m[3];\n var cjkSpace = m[4];\n var cjk = m[5];\n if (!self.showSpaces && simpleSpace)\n continue;\n var before = i != m.index ? value.slice(i, m.index) : \"\";\n i = m.index + m[0].length;\n if (before) {\n valueFragment.appendChild(this.dom.createTextNode(before, this.element));\n }\n if (tab) {\n var tabSize = self.session.getScreenTabSize(screenColumn + m.index);\n valueFragment.appendChild(self.$tabStrings[tabSize].cloneNode(true));\n screenColumn += tabSize - 1;\n }\n else if (simpleSpace) {\n if (self.showSpaces) {\n var span = this.dom.createElement(\"span\");\n span.className = \"ace_invisible ace_invisible_space\";\n span.textContent = lang.stringRepeat(self.SPACE_CHAR, simpleSpace.length);\n valueFragment.appendChild(span);\n }\n else {\n valueFragment.appendChild(this.dom.createTextNode(simpleSpace, this.element));\n }\n }\n else if (controlCharacter) {\n var span = this.dom.createElement(\"span\");\n span.className = \"ace_invisible ace_invisible_space ace_invalid\";\n span.textContent = lang.stringRepeat(self.SPACE_CHAR, controlCharacter.length);\n valueFragment.appendChild(span);\n }\n else if (cjkSpace) {\n screenColumn += 1;\n var span = this.dom.createElement(\"span\");\n span.style.width = (self.config.characterWidth * 2) + \"px\";\n span.className = self.showSpaces ? \"ace_cjk ace_invisible ace_invisible_space\" : \"ace_cjk\";\n span.textContent = self.showSpaces ? self.SPACE_CHAR : cjkSpace;\n valueFragment.appendChild(span);\n }\n else if (cjk) {\n screenColumn += 1;\n var span = this.dom.createElement(\"span\");\n span.style.width = (self.config.characterWidth * 2) + \"px\";\n span.className = \"ace_cjk\";\n span.textContent = cjk;\n valueFragment.appendChild(span);\n }\n }\n valueFragment.appendChild(this.dom.createTextNode(i ? value.slice(i) : value, this.element));\n if (!isTextToken(token.type)) {\n var classes = \"ace_\" + token.type.replace(/\\./g, \" ace_\");\n var span = this.dom.createElement(\"span\");\n if (token.type == \"fold\") {\n span.style.width = (token.value.length * this.config.characterWidth) + \"px\";\n span.setAttribute(\"title\", nls(\"inline-fold.closed.title\", \"Unfold code\"));\n }\n span.className = classes;\n span.appendChild(valueFragment);\n parent.appendChild(span);\n }\n else {\n parent.appendChild(valueFragment);\n }\n return screenColumn + value.length;\n };\n Text.prototype.renderIndentGuide = function (parent, value, max) {\n var cols = value.search(this.$indentGuideRe);\n if (cols <= 0 || cols >= max)\n return value;\n if (value[0] == \" \") {\n cols -= cols % this.tabSize;\n var count = cols / this.tabSize;\n for (var i = 0; i < count; i++) {\n parent.appendChild(this.$tabStrings[\" \"].cloneNode(true));\n }\n this.$highlightIndentGuide();\n return value.substr(cols);\n }\n else if (value[0] == \"\\t\") {\n for (var i = 0; i < cols; i++) {\n parent.appendChild(this.$tabStrings[\"\\t\"].cloneNode(true));\n }\n this.$highlightIndentGuide();\n return value.substr(cols);\n }\n this.$highlightIndentGuide();\n return value;\n };\n Text.prototype.$highlightIndentGuide = function () {\n if (!this.$highlightIndentGuides || !this.displayIndentGuides)\n return;\n this.$highlightIndentGuideMarker = {\n indentLevel: undefined,\n start: undefined,\n end: undefined,\n dir: undefined\n };\n var lines = this.session.doc.$lines;\n if (!lines)\n return;\n var cursor = this.session.selection.getCursor();\n var initialIndent = /^\\s*/.exec(this.session.doc.getLine(cursor.row))[0].length;\n var elementIndentLevel = Math.floor(initialIndent / this.tabSize);\n this.$highlightIndentGuideMarker = {\n indentLevel: elementIndentLevel,\n start: cursor.row\n };\n var bracketHighlight = this.session.$bracketHighlight;\n if (bracketHighlight) {\n var ranges = this.session.$bracketHighlight.ranges;\n for (var i = 0; i < ranges.length; i++) {\n if (cursor.row !== ranges[i].start.row) {\n this.$highlightIndentGuideMarker.end = ranges[i].start.row;\n if (cursor.row > ranges[i].start.row) {\n this.$highlightIndentGuideMarker.dir = -1;\n }\n else {\n this.$highlightIndentGuideMarker.dir = 1;\n }\n break;\n }\n }\n }\n if (!this.$highlightIndentGuideMarker.end) {\n if (lines[cursor.row] !== '' && cursor.column === lines[cursor.row].length) {\n this.$highlightIndentGuideMarker.dir = 1;\n for (var i = cursor.row + 1; i < lines.length; i++) {\n var line = lines[i];\n var currentIndent = /^\\s*/.exec(line)[0].length;\n if (line !== '') {\n this.$highlightIndentGuideMarker.end = i;\n if (currentIndent <= initialIndent)\n break;\n }\n }\n }\n }\n this.$renderHighlightIndentGuide();\n };\n Text.prototype.$clearActiveIndentGuide = function () {\n var cells = this.$lines.cells;\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n var childNodes = cell.element.childNodes;\n if (childNodes.length > 0) {\n for (var j = 0; j < childNodes.length; j++) {\n if (childNodes[j].classList && childNodes[j].classList.contains(\"ace_indent-guide-active\")) {\n childNodes[j].classList.remove(\"ace_indent-guide-active\");\n break;\n }\n }\n }\n }\n };\n Text.prototype.$setIndentGuideActive = function (cell, indentLevel) {\n var line = this.session.doc.getLine(cell.row);\n if (line !== \"\") {\n var childNodes = cell.element.childNodes;\n if (childNodes) {\n var node = childNodes[indentLevel - 1];\n if (node && node.classList && node.classList.contains(\"ace_indent-guide\"))\n node.classList.add(\"ace_indent-guide-active\");\n }\n }\n };\n Text.prototype.$renderHighlightIndentGuide = function () {\n if (!this.$lines)\n return;\n var cells = this.$lines.cells;\n this.$clearActiveIndentGuide();\n var indentLevel = this.$highlightIndentGuideMarker.indentLevel;\n if (indentLevel !== 0) {\n if (this.$highlightIndentGuideMarker.dir === 1) {\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n if (this.$highlightIndentGuideMarker.end && cell.row >= this.$highlightIndentGuideMarker.start\n + 1) {\n if (cell.row >= this.$highlightIndentGuideMarker.end)\n break;\n this.$setIndentGuideActive(cell, indentLevel);\n }\n }\n }\n else {\n for (var i = cells.length - 1; i >= 0; i--) {\n var cell = cells[i];\n if (this.$highlightIndentGuideMarker.end && cell.row < this.$highlightIndentGuideMarker.start) {\n if (cell.row <= this.$highlightIndentGuideMarker.end)\n break;\n this.$setIndentGuideActive(cell, indentLevel);\n }\n }\n }\n }\n };\n Text.prototype.$createLineElement = function (parent) {\n var lineEl = this.dom.createElement(\"div\");\n lineEl.className = \"ace_line\";\n lineEl.style.height = this.config.lineHeight + \"px\";\n return lineEl;\n };\n Text.prototype.$renderWrappedLine = function (parent, tokens, splits) {\n var chars = 0;\n var split = 0;\n var splitChars = splits[0];\n var screenColumn = 0;\n var lineEl = this.$createLineElement();\n parent.appendChild(lineEl);\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n var value = token.value;\n if (i == 0 && this.displayIndentGuides) {\n chars = value.length;\n value = this.renderIndentGuide(lineEl, value, splitChars);\n if (!value)\n continue;\n chars -= value.length;\n }\n if (chars + value.length < splitChars) {\n screenColumn = this.$renderToken(lineEl, screenColumn, token, value);\n chars += value.length;\n }\n else {\n while (chars + value.length >= splitChars) {\n screenColumn = this.$renderToken(lineEl, screenColumn, token, value.substring(0, splitChars - chars));\n value = value.substring(splitChars - chars);\n chars = splitChars;\n lineEl = this.$createLineElement();\n parent.appendChild(lineEl);\n lineEl.appendChild(this.dom.createTextNode(lang.stringRepeat(\"\\xa0\", splits.indent), this.element));\n split++;\n screenColumn = 0;\n splitChars = splits[split] || Number.MAX_VALUE;\n }\n if (value.length != 0) {\n chars += value.length;\n screenColumn = this.$renderToken(lineEl, screenColumn, token, value);\n }\n }\n }\n if (splits[splits.length - 1] > this.MAX_LINE_LENGTH)\n this.$renderOverflowMessage(lineEl, screenColumn, null, \"\", true);\n };\n Text.prototype.$renderSimpleLine = function (parent, tokens) {\n var screenColumn = 0;\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n var value = token.value;\n if (i == 0 && this.displayIndentGuides) {\n value = this.renderIndentGuide(parent, value);\n if (!value)\n continue;\n }\n if (screenColumn + value.length > this.MAX_LINE_LENGTH)\n return this.$renderOverflowMessage(parent, screenColumn, token, value);\n screenColumn = this.$renderToken(parent, screenColumn, token, value);\n }\n };\n Text.prototype.$renderOverflowMessage = function (parent, screenColumn, token, value, hide) {\n token && this.$renderToken(parent, screenColumn, token, value.slice(0, this.MAX_LINE_LENGTH - screenColumn));\n var overflowEl = this.dom.createElement(\"span\");\n overflowEl.className = \"ace_inline_button ace_keyword ace_toggle_wrap\";\n overflowEl.textContent = hide ? \"\" : \"\";\n parent.appendChild(overflowEl);\n };\n Text.prototype.$renderLine = function (parent, row, foldLine) {\n if (!foldLine && foldLine != false)\n foldLine = this.session.getFoldLine(row);\n if (foldLine)\n var tokens = this.$getFoldLineTokens(row, foldLine);\n else\n var tokens = this.session.getTokens(row);\n var lastLineEl = parent;\n if (tokens.length) {\n var splits = this.session.getRowSplitData(row);\n if (splits && splits.length) {\n this.$renderWrappedLine(parent, tokens, splits);\n var lastLineEl = parent.lastChild;\n }\n else {\n var lastLineEl = parent;\n if (this.$useLineGroups()) {\n lastLineEl = this.$createLineElement();\n parent.appendChild(lastLineEl);\n }\n this.$renderSimpleLine(lastLineEl, tokens);\n }\n }\n else if (this.$useLineGroups()) {\n lastLineEl = this.$createLineElement();\n parent.appendChild(lastLineEl);\n }\n if (this.showEOL && lastLineEl) {\n if (foldLine)\n row = foldLine.end.row;\n var invisibleEl = this.dom.createElement(\"span\");\n invisibleEl.className = \"ace_invisible ace_invisible_eol\";\n invisibleEl.textContent = row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR;\n lastLineEl.appendChild(invisibleEl);\n }\n };\n Text.prototype.$getFoldLineTokens = function (row, foldLine) {\n var session = this.session;\n var renderTokens = [];\n function addTokens(tokens, from, to) {\n var idx = 0, col = 0;\n while ((col + tokens[idx].value.length) < from) {\n col += tokens[idx].value.length;\n idx++;\n if (idx == tokens.length)\n return;\n }\n if (col != from) {\n var value = tokens[idx].value.substring(from - col);\n if (value.length > (to - from))\n value = value.substring(0, to - from);\n renderTokens.push({\n type: tokens[idx].type,\n value: value\n });\n col = from + value.length;\n idx += 1;\n }\n while (col < to && idx < tokens.length) {\n var value = tokens[idx].value;\n if (value.length + col > to) {\n renderTokens.push({\n type: tokens[idx].type,\n value: value.substring(0, to - col)\n });\n }\n else\n renderTokens.push(tokens[idx]);\n col += value.length;\n idx += 1;\n }\n }\n var tokens = session.getTokens(row);\n foldLine.walk(function (placeholder, row, column, lastColumn, isNewRow) {\n if (placeholder != null) {\n renderTokens.push({\n type: \"fold\",\n value: placeholder\n });\n }\n else {\n if (isNewRow)\n tokens = session.getTokens(row);\n if (tokens.length)\n addTokens(tokens, lastColumn, column);\n }\n }, foldLine.end.row, this.session.getLine(foldLine.end.row).length);\n return renderTokens;\n };\n Text.prototype.$useLineGroups = function () {\n return this.session.getUseWrapMode();\n };\n return Text;\n}());\nText.prototype.EOF_CHAR = \"\\xB6\";\nText.prototype.EOL_CHAR_LF = \"\\xAC\";\nText.prototype.EOL_CHAR_CRLF = \"\\xa4\";\nText.prototype.EOL_CHAR = Text.prototype.EOL_CHAR_LF;\nText.prototype.TAB_CHAR = \"\\u2014\"; //\"\\u21E5\";\nText.prototype.SPACE_CHAR = \"\\xB7\";\nText.prototype.$padding = 0;\nText.prototype.MAX_LINE_LENGTH = 10000;\nText.prototype.showInvisibles = false;\nText.prototype.showSpaces = false;\nText.prototype.showTabs = false;\nText.prototype.showEOL = false;\nText.prototype.displayIndentGuides = true;\nText.prototype.$highlightIndentGuides = true;\nText.prototype.$tabStrings = [];\nText.prototype.destroy = {};\nText.prototype.onChangeTabSize = Text.prototype.$computeTabString;\noop.implement(Text.prototype, EventEmitter);\nexports.Text = Text;\n\n});\n\nace.define(\"ace/layer/cursor\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar Cursor = /** @class */ (function () {\n function Cursor(parentEl) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_cursor-layer\";\n parentEl.appendChild(this.element);\n this.isVisible = false;\n this.isBlinking = true;\n this.blinkInterval = 1000;\n this.smoothBlinking = false;\n this.cursors = [];\n this.cursor = this.addCursor();\n dom.addCssClass(this.element, \"ace_hidden-cursors\");\n this.$updateCursors = this.$updateOpacity.bind(this);\n }\n Cursor.prototype.$updateOpacity = function (val) {\n var cursors = this.cursors;\n for (var i = cursors.length; i--;)\n dom.setStyle(cursors[i].style, \"opacity\", val ? \"\" : \"0\");\n };\n Cursor.prototype.$startCssAnimation = function () {\n var cursors = this.cursors;\n for (var i = cursors.length; i--;)\n cursors[i].style.animationDuration = this.blinkInterval + \"ms\";\n this.$isAnimating = true;\n setTimeout(function () {\n if (this.$isAnimating) {\n dom.addCssClass(this.element, \"ace_animate-blinking\");\n }\n }.bind(this));\n };\n Cursor.prototype.$stopCssAnimation = function () {\n this.$isAnimating = false;\n dom.removeCssClass(this.element, \"ace_animate-blinking\");\n };\n Cursor.prototype.setPadding = function (padding) {\n this.$padding = padding;\n };\n Cursor.prototype.setSession = function (session) {\n this.session = session;\n };\n Cursor.prototype.setBlinking = function (blinking) {\n if (blinking != this.isBlinking) {\n this.isBlinking = blinking;\n this.restartTimer();\n }\n };\n Cursor.prototype.setBlinkInterval = function (blinkInterval) {\n if (blinkInterval != this.blinkInterval) {\n this.blinkInterval = blinkInterval;\n this.restartTimer();\n }\n };\n Cursor.prototype.setSmoothBlinking = function (smoothBlinking) {\n if (smoothBlinking != this.smoothBlinking) {\n this.smoothBlinking = smoothBlinking;\n dom.setCssClass(this.element, \"ace_smooth-blinking\", smoothBlinking);\n this.$updateCursors(true);\n this.restartTimer();\n }\n };\n Cursor.prototype.addCursor = function () {\n var el = dom.createElement(\"div\");\n el.className = \"ace_cursor\";\n this.element.appendChild(el);\n this.cursors.push(el);\n return el;\n };\n Cursor.prototype.removeCursor = function () {\n if (this.cursors.length > 1) {\n var el = this.cursors.pop();\n el.parentNode.removeChild(el);\n return el;\n }\n };\n Cursor.prototype.hideCursor = function () {\n this.isVisible = false;\n dom.addCssClass(this.element, \"ace_hidden-cursors\");\n this.restartTimer();\n };\n Cursor.prototype.showCursor = function () {\n this.isVisible = true;\n dom.removeCssClass(this.element, \"ace_hidden-cursors\");\n this.restartTimer();\n };\n Cursor.prototype.restartTimer = function () {\n var update = this.$updateCursors;\n clearInterval(this.intervalId);\n clearTimeout(this.timeoutId);\n this.$stopCssAnimation();\n if (this.smoothBlinking) {\n this.$isSmoothBlinking = false;\n dom.removeCssClass(this.element, \"ace_smooth-blinking\");\n }\n update(true);\n if (!this.isBlinking || !this.blinkInterval || !this.isVisible) {\n this.$stopCssAnimation();\n return;\n }\n if (this.smoothBlinking) {\n this.$isSmoothBlinking = true;\n setTimeout(function () {\n if (this.$isSmoothBlinking) {\n dom.addCssClass(this.element, \"ace_smooth-blinking\");\n }\n }.bind(this));\n }\n if (dom.HAS_CSS_ANIMATION) {\n this.$startCssAnimation();\n }\n else {\n var blink = /**@this{Cursor}*/ function () {\n this.timeoutId = setTimeout(function () {\n update(false);\n }, 0.6 * this.blinkInterval);\n }.bind(this);\n this.intervalId = setInterval(function () {\n update(true);\n blink();\n }, this.blinkInterval);\n blink();\n }\n };\n Cursor.prototype.getPixelPosition = function (position, onScreen) {\n if (!this.config || !this.session)\n return { left: 0, top: 0 };\n if (!position)\n position = this.session.selection.getCursor();\n var pos = this.session.documentToScreenPosition(position);\n var cursorLeft = this.$padding + (this.session.$bidiHandler.isBidiRow(pos.row, position.row)\n ? this.session.$bidiHandler.getPosLeft(pos.column)\n : pos.column * this.config.characterWidth);\n var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) *\n this.config.lineHeight;\n return { left: cursorLeft, top: cursorTop };\n };\n Cursor.prototype.isCursorInView = function (pixelPos, config) {\n return pixelPos.top >= 0 && pixelPos.top < config.maxHeight;\n };\n Cursor.prototype.update = function (config) {\n this.config = config;\n var selections = this.session.$selectionMarkers;\n var i = 0, cursorIndex = 0;\n if (selections === undefined || selections.length === 0) {\n selections = [{ cursor: null }];\n }\n for (var i = 0, n = selections.length; i < n; i++) {\n var pixelPos = this.getPixelPosition(selections[i].cursor, true);\n if ((pixelPos.top > config.height + config.offset ||\n pixelPos.top < 0) && i > 1) {\n continue;\n }\n var element = this.cursors[cursorIndex++] || this.addCursor();\n var style = element.style;\n if (!this.drawCursor) {\n if (!this.isCursorInView(pixelPos, config)) {\n dom.setStyle(style, \"display\", \"none\");\n }\n else {\n dom.setStyle(style, \"display\", \"block\");\n dom.translate(element, pixelPos.left, pixelPos.top);\n dom.setStyle(style, \"width\", Math.round(config.characterWidth) + \"px\");\n dom.setStyle(style, \"height\", config.lineHeight + \"px\");\n }\n }\n else {\n this.drawCursor(element, pixelPos, config, selections[i], this.session);\n }\n }\n while (this.cursors.length > cursorIndex)\n this.removeCursor();\n var overwrite = this.session.getOverwrite();\n this.$setOverwrite(overwrite);\n this.$pixelPos = pixelPos;\n this.restartTimer();\n };\n Cursor.prototype.$setOverwrite = function (overwrite) {\n if (overwrite != this.overwrite) {\n this.overwrite = overwrite;\n if (overwrite)\n dom.addCssClass(this.element, \"ace_overwrite-cursors\");\n else\n dom.removeCssClass(this.element, \"ace_overwrite-cursors\");\n }\n };\n Cursor.prototype.destroy = function () {\n clearInterval(this.intervalId);\n clearTimeout(this.timeoutId);\n };\n return Cursor;\n}());\nCursor.prototype.$padding = 0;\nCursor.prototype.drawCursor = null;\nexports.Cursor = Cursor;\n\n});\n\nace.define(\"ace/scrollbar\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar event = require(\"./lib/event\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar MAX_SCROLL_H = 0x8000;\nvar Scrollbar = /** @class */ (function () {\n function Scrollbar(parent, classSuffix) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_scrollbar ace_scrollbar\" + classSuffix;\n this.inner = dom.createElement(\"div\");\n this.inner.className = \"ace_scrollbar-inner\";\n this.inner.textContent = \"\\xa0\";\n this.element.appendChild(this.inner);\n parent.appendChild(this.element);\n this.setVisible(false);\n this.skipEvent = false;\n event.addListener(this.element, \"scroll\", this.onScroll.bind(this));\n event.addListener(this.element, \"mousedown\", event.preventDefault);\n }\n Scrollbar.prototype.setVisible = function (isVisible) {\n this.element.style.display = isVisible ? \"\" : \"none\";\n this.isVisible = isVisible;\n this.coeff = 1;\n };\n return Scrollbar;\n}());\noop.implement(Scrollbar.prototype, EventEmitter);\nvar VScrollBar = /** @class */ (function (_super) {\n __extends(VScrollBar, _super);\n function VScrollBar(parent, renderer) {\n var _this = _super.call(this, parent, '-v') || this;\n _this.scrollTop = 0;\n _this.scrollHeight = 0;\n renderer.$scrollbarWidth =\n _this.width = dom.scrollbarWidth(parent.ownerDocument);\n _this.inner.style.width =\n _this.element.style.width = (_this.width || 15) + 5 + \"px\";\n _this.$minWidth = 0;\n return _this;\n }\n VScrollBar.prototype.onScroll = function () {\n if (!this.skipEvent) {\n this.scrollTop = this.element.scrollTop;\n if (this.coeff != 1) {\n var h = this.element.clientHeight / this.scrollHeight;\n this.scrollTop = this.scrollTop * (1 - h) / (this.coeff - h);\n }\n this._emit(\"scroll\", { data: this.scrollTop });\n }\n this.skipEvent = false;\n };\n VScrollBar.prototype.getWidth = function () {\n return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);\n };\n VScrollBar.prototype.setHeight = function (height) {\n this.element.style.height = height + \"px\";\n };\n VScrollBar.prototype.setScrollHeight = function (height) {\n this.scrollHeight = height;\n if (height > MAX_SCROLL_H) {\n this.coeff = MAX_SCROLL_H / height;\n height = MAX_SCROLL_H;\n }\n else if (this.coeff != 1) {\n this.coeff = 1;\n }\n this.inner.style.height = height + \"px\";\n };\n VScrollBar.prototype.setScrollTop = function (scrollTop) {\n if (this.scrollTop != scrollTop) {\n this.skipEvent = true;\n this.scrollTop = scrollTop;\n this.element.scrollTop = scrollTop * this.coeff;\n }\n };\n return VScrollBar;\n}(Scrollbar));\nVScrollBar.prototype.setInnerHeight = VScrollBar.prototype.setScrollHeight;\nvar HScrollBar = /** @class */ (function (_super) {\n __extends(HScrollBar, _super);\n function HScrollBar(parent, renderer) {\n var _this = _super.call(this, parent, '-h') || this;\n _this.scrollLeft = 0;\n _this.height = renderer.$scrollbarWidth;\n _this.inner.style.height =\n _this.element.style.height = (_this.height || 15) + 5 + \"px\";\n return _this;\n }\n HScrollBar.prototype.onScroll = function () {\n if (!this.skipEvent) {\n this.scrollLeft = this.element.scrollLeft;\n this._emit(\"scroll\", { data: this.scrollLeft });\n }\n this.skipEvent = false;\n };\n HScrollBar.prototype.getHeight = function () {\n return this.isVisible ? this.height : 0;\n };\n HScrollBar.prototype.setWidth = function (width) {\n this.element.style.width = width + \"px\";\n };\n HScrollBar.prototype.setInnerWidth = function (width) {\n this.inner.style.width = width + \"px\";\n };\n HScrollBar.prototype.setScrollWidth = function (width) {\n this.inner.style.width = width + \"px\";\n };\n HScrollBar.prototype.setScrollLeft = function (scrollLeft) {\n if (this.scrollLeft != scrollLeft) {\n this.skipEvent = true;\n this.scrollLeft = this.element.scrollLeft = scrollLeft;\n }\n };\n return HScrollBar;\n}(Scrollbar));\nexports.ScrollBar = VScrollBar; // backward compatibility\nexports.ScrollBarV = VScrollBar; // backward compatibility\nexports.ScrollBarH = HScrollBar; // backward compatibility\nexports.VScrollBar = VScrollBar;\nexports.HScrollBar = HScrollBar;\n\n});\n\nace.define(\"ace/scrollbar_custom\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar event = require(\"./lib/event\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\ndom.importCssString(\".ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\\n position: absolute;\\n background: rgba(128, 128, 128, 0.6);\\n -moz-box-sizing: border-box;\\n box-sizing: border-box;\\n border: 1px solid #bbb;\\n border-radius: 2px;\\n z-index: 8;\\n}\\n.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\\n position: absolute;\\n z-index: 6;\\n background: none;\\n overflow: hidden!important;\\n}\\n.ace_editor>.ace_sb-v {\\n z-index: 6;\\n right: 0;\\n top: 0;\\n width: 12px;\\n}\\n.ace_editor>.ace_sb-v div {\\n z-index: 8;\\n right: 0;\\n width: 100%;\\n}\\n.ace_editor>.ace_sb-h {\\n bottom: 0;\\n left: 0;\\n height: 12px;\\n}\\n.ace_editor>.ace_sb-h div {\\n bottom: 0;\\n height: 100%;\\n}\\n.ace_editor>.ace_sb_grabbed {\\n z-index: 8;\\n background: #000;\\n}\", \"ace_scrollbar.css\", false);\nvar ScrollBar = /** @class */ (function () {\n function ScrollBar(parent, classSuffix) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_sb\" + classSuffix;\n this.inner = dom.createElement(\"div\");\n this.inner.className = \"\";\n this.element.appendChild(this.inner);\n this.VScrollWidth = 12;\n this.HScrollHeight = 12;\n parent.appendChild(this.element);\n this.setVisible(false);\n this.skipEvent = false;\n event.addMultiMouseDownListener(this.element, [500, 300, 300], this, \"onMouseDown\");\n }\n ScrollBar.prototype.setVisible = function (isVisible) {\n this.element.style.display = isVisible ? \"\" : \"none\";\n this.isVisible = isVisible;\n this.coeff = 1;\n };\n return ScrollBar;\n}());\noop.implement(ScrollBar.prototype, EventEmitter);\nvar VScrollBar = /** @class */ (function (_super) {\n __extends(VScrollBar, _super);\n function VScrollBar(parent, renderer) {\n var _this = _super.call(this, parent, '-v') || this;\n _this.scrollTop = 0;\n _this.scrollHeight = 0;\n _this.parent = parent;\n _this.width = _this.VScrollWidth;\n _this.renderer = renderer;\n _this.inner.style.width = _this.element.style.width = (_this.width || 15) + \"px\";\n _this.$minWidth = 0;\n return _this;\n }\n VScrollBar.prototype.onMouseDown = function (eType, e) {\n if (eType !== \"mousedown\")\n return;\n if (event.getButton(e) !== 0 || e.detail === 2) {\n return;\n }\n if (e.target === this.inner) {\n var self = this;\n var mousePageY = e.clientY;\n var onMouseMove = function (e) {\n mousePageY = e.clientY;\n };\n var onMouseUp = function () {\n clearInterval(timerId);\n };\n var startY = e.clientY;\n var startTop = this.thumbTop;\n var onScrollInterval = function () {\n if (mousePageY === undefined)\n return;\n var scrollTop = self.scrollTopFromThumbTop(startTop + mousePageY - startY);\n if (scrollTop === self.scrollTop)\n return;\n self._emit(\"scroll\", { data: scrollTop });\n };\n event.capture(this.inner, onMouseMove, onMouseUp);\n var timerId = setInterval(onScrollInterval, 20);\n return event.preventDefault(e);\n }\n var top = e.clientY - this.element.getBoundingClientRect().top - this.thumbHeight / 2;\n this._emit(\"scroll\", { data: this.scrollTopFromThumbTop(top) });\n return event.preventDefault(e);\n };\n VScrollBar.prototype.getHeight = function () {\n return this.height;\n };\n VScrollBar.prototype.scrollTopFromThumbTop = function (thumbTop) {\n var scrollTop = thumbTop * (this.pageHeight - this.viewHeight) / (this.slideHeight - this.thumbHeight);\n scrollTop = scrollTop >> 0;\n if (scrollTop < 0) {\n scrollTop = 0;\n }\n else if (scrollTop > this.pageHeight - this.viewHeight) {\n scrollTop = this.pageHeight - this.viewHeight;\n }\n return scrollTop;\n };\n VScrollBar.prototype.getWidth = function () {\n return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);\n };\n VScrollBar.prototype.setHeight = function (height) {\n this.height = Math.max(0, height);\n this.slideHeight = this.height;\n this.viewHeight = this.height;\n this.setScrollHeight(this.pageHeight, true);\n };\n VScrollBar.prototype.setScrollHeight = function (height, force) {\n if (this.pageHeight === height && !force)\n return;\n this.pageHeight = height;\n this.thumbHeight = this.slideHeight * this.viewHeight / this.pageHeight;\n if (this.thumbHeight > this.slideHeight)\n this.thumbHeight = this.slideHeight;\n if (this.thumbHeight < 15)\n this.thumbHeight = 15;\n this.inner.style.height = this.thumbHeight + \"px\";\n if (this.scrollTop > (this.pageHeight - this.viewHeight)) {\n this.scrollTop = (this.pageHeight - this.viewHeight);\n if (this.scrollTop < 0)\n this.scrollTop = 0;\n this._emit(\"scroll\", { data: this.scrollTop });\n }\n };\n VScrollBar.prototype.setScrollTop = function (scrollTop) {\n this.scrollTop = scrollTop;\n if (scrollTop < 0)\n scrollTop = 0;\n this.thumbTop = scrollTop * (this.slideHeight - this.thumbHeight) / (this.pageHeight - this.viewHeight);\n this.inner.style.top = this.thumbTop + \"px\";\n };\n return VScrollBar;\n}(ScrollBar));\nVScrollBar.prototype.setInnerHeight = VScrollBar.prototype.setScrollHeight;\nvar HScrollBar = /** @class */ (function (_super) {\n __extends(HScrollBar, _super);\n function HScrollBar(parent, renderer) {\n var _this = _super.call(this, parent, '-h') || this;\n _this.scrollLeft = 0;\n _this.scrollWidth = 0;\n _this.height = _this.HScrollHeight;\n _this.inner.style.height = _this.element.style.height = (_this.height || 12) + \"px\";\n _this.renderer = renderer;\n return _this;\n }\n HScrollBar.prototype.onMouseDown = function (eType, e) {\n if (eType !== \"mousedown\")\n return;\n if (event.getButton(e) !== 0 || e.detail === 2) {\n return;\n }\n if (e.target === this.inner) {\n var self = this;\n var mousePageX = e.clientX;\n var onMouseMove = function (e) {\n mousePageX = e.clientX;\n };\n var onMouseUp = function () {\n clearInterval(timerId);\n };\n var startX = e.clientX;\n var startLeft = this.thumbLeft;\n var onScrollInterval = function () {\n if (mousePageX === undefined)\n return;\n var scrollLeft = self.scrollLeftFromThumbLeft(startLeft + mousePageX - startX);\n if (scrollLeft === self.scrollLeft)\n return;\n self._emit(\"scroll\", { data: scrollLeft });\n };\n event.capture(this.inner, onMouseMove, onMouseUp);\n var timerId = setInterval(onScrollInterval, 20);\n return event.preventDefault(e);\n }\n var left = e.clientX - this.element.getBoundingClientRect().left - this.thumbWidth / 2;\n this._emit(\"scroll\", { data: this.scrollLeftFromThumbLeft(left) });\n return event.preventDefault(e);\n };\n HScrollBar.prototype.getHeight = function () {\n return this.isVisible ? this.height : 0;\n };\n HScrollBar.prototype.scrollLeftFromThumbLeft = function (thumbLeft) {\n var scrollLeft = thumbLeft * (this.pageWidth - this.viewWidth) / (this.slideWidth - this.thumbWidth);\n scrollLeft = scrollLeft >> 0;\n if (scrollLeft < 0) {\n scrollLeft = 0;\n }\n else if (scrollLeft > this.pageWidth - this.viewWidth) {\n scrollLeft = this.pageWidth - this.viewWidth;\n }\n return scrollLeft;\n };\n HScrollBar.prototype.setWidth = function (width) {\n this.width = Math.max(0, width);\n this.element.style.width = this.width + \"px\";\n this.slideWidth = this.width;\n this.viewWidth = this.width;\n this.setScrollWidth(this.pageWidth, true);\n };\n HScrollBar.prototype.setScrollWidth = function (width, force) {\n if (this.pageWidth === width && !force)\n return;\n this.pageWidth = width;\n this.thumbWidth = this.slideWidth * this.viewWidth / this.pageWidth;\n if (this.thumbWidth > this.slideWidth)\n this.thumbWidth = this.slideWidth;\n if (this.thumbWidth < 15)\n this.thumbWidth = 15;\n this.inner.style.width = this.thumbWidth + \"px\";\n if (this.scrollLeft > (this.pageWidth - this.viewWidth)) {\n this.scrollLeft = (this.pageWidth - this.viewWidth);\n if (this.scrollLeft < 0)\n this.scrollLeft = 0;\n this._emit(\"scroll\", { data: this.scrollLeft });\n }\n };\n HScrollBar.prototype.setScrollLeft = function (scrollLeft) {\n this.scrollLeft = scrollLeft;\n if (scrollLeft < 0)\n scrollLeft = 0;\n this.thumbLeft = scrollLeft * (this.slideWidth - this.thumbWidth) / (this.pageWidth - this.viewWidth);\n this.inner.style.left = (this.thumbLeft) + \"px\";\n };\n return HScrollBar;\n}(ScrollBar));\nHScrollBar.prototype.setInnerWidth = HScrollBar.prototype.setScrollWidth;\nexports.ScrollBar = VScrollBar; // backward compatibility\nexports.ScrollBarV = VScrollBar; // backward compatibility\nexports.ScrollBarH = HScrollBar; // backward compatibility\nexports.VScrollBar = VScrollBar;\nexports.HScrollBar = HScrollBar;\n\n});\n\nace.define(\"ace/renderloop\",[\"require\",\"exports\",\"module\",\"ace/lib/event\"], function(require, exports, module){\"use strict\";\nvar event = require(\"./lib/event\");\nvar RenderLoop = /** @class */ (function () {\n function RenderLoop(onRender, win) {\n this.onRender = onRender;\n this.pending = false;\n this.changes = 0;\n this.$recursionLimit = 2;\n this.window = win || window;\n var _self = this;\n this._flush = function (ts) {\n _self.pending = false;\n var changes = _self.changes;\n if (changes) {\n event.blockIdle(100);\n _self.changes = 0;\n _self.onRender(changes);\n }\n if (_self.changes) {\n if (_self.$recursionLimit-- < 0)\n return;\n _self.schedule();\n }\n else {\n _self.$recursionLimit = 2;\n }\n };\n }\n RenderLoop.prototype.schedule = function (change) {\n this.changes = this.changes | change;\n if (this.changes && !this.pending) {\n event.nextFrame(this._flush);\n this.pending = true;\n }\n };\n RenderLoop.prototype.clear = function (change) {\n var changes = this.changes;\n this.changes = 0;\n return changes;\n };\n return RenderLoop;\n}());\nexports.RenderLoop = RenderLoop;\n\n});\n\nace.define(\"ace/layer/font_metrics\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/lib/event\",\"ace/lib/useragent\",\"ace/lib/event_emitter\"], function(require, exports, module){var oop = require(\"../lib/oop\");\nvar dom = require(\"../lib/dom\");\nvar lang = require(\"../lib/lang\");\nvar event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar CHAR_COUNT = 512;\nvar USE_OBSERVER = typeof ResizeObserver == \"function\";\nvar L = 200;\nvar FontMetrics = /** @class */ (function () {\n function FontMetrics(parentEl) {\n this.el = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(this.el.style, true);\n this.$main = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(this.$main.style);\n this.$measureNode = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(this.$measureNode.style);\n this.el.appendChild(this.$main);\n this.el.appendChild(this.$measureNode);\n parentEl.appendChild(this.el);\n this.$measureNode.textContent = lang.stringRepeat(\"X\", CHAR_COUNT);\n this.$characterSize = { width: 0, height: 0 };\n if (USE_OBSERVER)\n this.$addObserver();\n else\n this.checkForSizeChanges();\n }\n FontMetrics.prototype.$setMeasureNodeStyles = function (style, isRoot) {\n style.width = style.height = \"auto\";\n style.left = style.top = \"0px\";\n style.visibility = \"hidden\";\n style.position = \"absolute\";\n style.whiteSpace = \"pre\";\n if (useragent.isIE < 8) {\n style[\"font-family\"] = \"inherit\";\n }\n else {\n style.font = \"inherit\";\n }\n style.overflow = isRoot ? \"hidden\" : \"visible\";\n };\n FontMetrics.prototype.checkForSizeChanges = function (size) {\n if (size === undefined)\n size = this.$measureSizes();\n if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) {\n this.$measureNode.style.fontWeight = \"bold\";\n var boldSize = this.$measureSizes();\n this.$measureNode.style.fontWeight = \"\";\n this.$characterSize = size;\n this.charSizes = Object.create(null);\n this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height;\n this._emit(\"changeCharacterSize\", { data: size });\n }\n };\n FontMetrics.prototype.$addObserver = function () {\n var self = this;\n this.$observer = new window.ResizeObserver(function (e) {\n self.checkForSizeChanges();\n });\n this.$observer.observe(this.$measureNode);\n };\n FontMetrics.prototype.$pollSizeChanges = function () {\n if (this.$pollSizeChangesTimer || this.$observer)\n return this.$pollSizeChangesTimer;\n var self = this;\n return this.$pollSizeChangesTimer = event.onIdle(function cb() {\n self.checkForSizeChanges();\n event.onIdle(cb, 500);\n }, 500);\n };\n FontMetrics.prototype.setPolling = function (val) {\n if (val) {\n this.$pollSizeChanges();\n }\n else if (this.$pollSizeChangesTimer) {\n clearInterval(this.$pollSizeChangesTimer);\n this.$pollSizeChangesTimer = 0;\n }\n };\n FontMetrics.prototype.$measureSizes = function (node) {\n var size = {\n height: (node || this.$measureNode).clientHeight,\n width: (node || this.$measureNode).clientWidth / CHAR_COUNT\n };\n if (size.width === 0 || size.height === 0)\n return null;\n return size;\n };\n FontMetrics.prototype.$measureCharWidth = function (ch) {\n this.$main.textContent = lang.stringRepeat(ch, CHAR_COUNT);\n var rect = this.$main.getBoundingClientRect();\n return rect.width / CHAR_COUNT;\n };\n FontMetrics.prototype.getCharacterWidth = function (ch) {\n var w = this.charSizes[ch];\n if (w === undefined) {\n w = this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width;\n }\n return w;\n };\n FontMetrics.prototype.destroy = function () {\n clearInterval(this.$pollSizeChangesTimer);\n if (this.$observer)\n this.$observer.disconnect();\n if (this.el && this.el.parentNode)\n this.el.parentNode.removeChild(this.el);\n };\n FontMetrics.prototype.$getZoom = function (element) {\n if (!element || !element.parentElement)\n return 1;\n return (window.getComputedStyle(element)[\"zoom\"] || 1) * this.$getZoom(element.parentElement);\n };\n FontMetrics.prototype.$initTransformMeasureNodes = function () {\n var t = function (t, l) {\n return [\"div\", {\n style: \"position: absolute;top:\" + t + \"px;left:\" + l + \"px;\"\n }];\n };\n this.els = dom.buildDom([t(0, 0), t(L, 0), t(0, L), t(L, L)], this.el);\n };\n FontMetrics.prototype.transformCoordinates = function (clientPos, elPos) {\n if (clientPos) {\n var zoom = this.$getZoom(this.el);\n clientPos = mul(1 / zoom, clientPos);\n }\n function solve(l1, l2, r) {\n var det = l1[1] * l2[0] - l1[0] * l2[1];\n return [\n (-l2[1] * r[0] + l2[0] * r[1]) / det,\n (+l1[1] * r[0] - l1[0] * r[1]) / det\n ];\n }\n function sub(a, b) { return [a[0] - b[0], a[1] - b[1]]; }\n function add(a, b) { return [a[0] + b[0], a[1] + b[1]]; }\n function mul(a, b) { return [a * b[0], a * b[1]]; }\n if (!this.els)\n this.$initTransformMeasureNodes();\n function p(el) {\n var r = el.getBoundingClientRect();\n return [r.left, r.top];\n }\n var a = p(this.els[0]);\n var b = p(this.els[1]);\n var c = p(this.els[2]);\n var d = p(this.els[3]);\n var h = solve(sub(d, b), sub(d, c), sub(add(b, c), add(d, a)));\n var m1 = mul(1 + h[0], sub(b, a));\n var m2 = mul(1 + h[1], sub(c, a));\n if (elPos) {\n var x = elPos;\n var k = h[0] * x[0] / L + h[1] * x[1] / L + 1;\n var ut = add(mul(x[0], m1), mul(x[1], m2));\n return add(mul(1 / k / L, ut), a);\n }\n var u = sub(clientPos, a);\n var f = solve(sub(m1, mul(h[0], u)), sub(m2, mul(h[1], u)), u);\n return mul(L, f);\n };\n return FontMetrics;\n}());\nFontMetrics.prototype.$characterSize = { width: 0, height: 0 };\noop.implement(FontMetrics.prototype, EventEmitter);\nexports.FontMetrics = FontMetrics;\n\n});\n\nace.define(\"ace/css/editor-css\",[\"require\",\"exports\",\"module\"], function(require, exports, module){/*\nstyles = []\nfor (var i = 1; i < 16; i++) {\n styles.push(\".ace_br\" + i + \"{\" + (\n [\"top-left\", \"top-right\", \"bottom-right\", \"bottom-left\"]\n ).map(function(x, j) {\n return i & (1< .ace_line, .ace_text-layer > .ace_line_group {\\n contain: style size layout;\\n position: absolute;\\n top: 0;\\n left: 0;\\n right: 0;\\n}\\n\\n.ace_hidpi .ace_text-layer,\\n.ace_hidpi .ace_gutter-layer,\\n.ace_hidpi .ace_content,\\n.ace_hidpi .ace_gutter {\\n contain: strict;\\n}\\n.ace_hidpi .ace_text-layer > .ace_line, \\n.ace_hidpi .ace_text-layer > .ace_line_group {\\n contain: strict;\\n}\\n\\n.ace_cjk {\\n display: inline-block;\\n text-align: center;\\n}\\n\\n.ace_cursor-layer {\\n z-index: 4;\\n}\\n\\n.ace_cursor {\\n z-index: 4;\\n position: absolute;\\n box-sizing: border-box;\\n border-left: 2px solid;\\n /* workaround for smooth cursor repaintng whole screen in chrome */\\n transform: translatez(0);\\n}\\n\\n.ace_multiselect .ace_cursor {\\n border-left-width: 1px;\\n}\\n\\n.ace_slim-cursors .ace_cursor {\\n border-left-width: 1px;\\n}\\n\\n.ace_overwrite-cursors .ace_cursor {\\n border-left-width: 0;\\n border-bottom: 1px solid;\\n}\\n\\n.ace_hidden-cursors .ace_cursor {\\n opacity: 0.2;\\n}\\n\\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\\n opacity: 0;\\n}\\n\\n.ace_smooth-blinking .ace_cursor {\\n transition: opacity 0.18s;\\n}\\n\\n.ace_animate-blinking .ace_cursor {\\n animation-duration: 1000ms;\\n animation-timing-function: step-end;\\n animation-name: blink-ace-animate;\\n animation-iteration-count: infinite;\\n}\\n\\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\\n animation-duration: 1000ms;\\n animation-timing-function: ease-in-out;\\n animation-name: blink-ace-animate-smooth;\\n}\\n \\n@keyframes blink-ace-animate {\\n from, to { opacity: 1; }\\n 60% { opacity: 0; }\\n}\\n\\n@keyframes blink-ace-animate-smooth {\\n from, to { opacity: 1; }\\n 45% { opacity: 1; }\\n 60% { opacity: 0; }\\n 85% { opacity: 0; }\\n}\\n\\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\\n position: absolute;\\n z-index: 3;\\n}\\n\\n.ace_marker-layer .ace_selection {\\n position: absolute;\\n z-index: 5;\\n}\\n\\n.ace_marker-layer .ace_bracket {\\n position: absolute;\\n z-index: 6;\\n}\\n\\n.ace_marker-layer .ace_error_bracket {\\n position: absolute;\\n border-bottom: 1px solid #DE5555;\\n border-radius: 0;\\n}\\n\\n.ace_marker-layer .ace_active-line {\\n position: absolute;\\n z-index: 2;\\n}\\n\\n.ace_marker-layer .ace_selected-word {\\n position: absolute;\\n z-index: 4;\\n box-sizing: border-box;\\n}\\n\\n.ace_line .ace_fold {\\n box-sizing: border-box;\\n\\n display: inline-block;\\n height: 11px;\\n margin-top: -2px;\\n vertical-align: middle;\\n\\n background-image:\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\\\"),\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\\\");\\n background-repeat: no-repeat, repeat-x;\\n background-position: center center, top left;\\n color: transparent;\\n\\n border: 1px solid black;\\n border-radius: 2px;\\n\\n cursor: pointer;\\n pointer-events: auto;\\n}\\n\\n.ace_dark .ace_fold {\\n}\\n\\n.ace_fold:hover{\\n background-image:\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\\\"),\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\\\");\\n}\\n\\n.ace_tooltip {\\n background-color: #f5f5f5;\\n border: 1px solid gray;\\n border-radius: 1px;\\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\\n color: black;\\n max-width: 100%;\\n padding: 3px 4px;\\n position: fixed;\\n z-index: 999999;\\n box-sizing: border-box;\\n cursor: default;\\n white-space: pre-wrap;\\n word-wrap: break-word;\\n line-height: normal;\\n font-style: normal;\\n font-weight: normal;\\n letter-spacing: normal;\\n pointer-events: none;\\n overflow: auto;\\n max-width: min(60em, 66vw);\\n overscroll-behavior: contain;\\n}\\n.ace_tooltip pre {\\n white-space: pre-wrap;\\n}\\n\\n.ace_tooltip.ace_dark {\\n background-color: #636363;\\n color: #fff;\\n}\\n\\n.ace_tooltip:focus {\\n outline: 1px solid #5E9ED6;\\n}\\n\\n.ace_icon {\\n display: inline-block;\\n width: 18px;\\n vertical-align: top;\\n}\\n\\n.ace_icon_svg {\\n display: inline-block;\\n width: 12px;\\n vertical-align: top;\\n -webkit-mask-repeat: no-repeat;\\n -webkit-mask-size: 12px;\\n -webkit-mask-position: center;\\n}\\n\\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\\n padding-right: 13px;\\n}\\n\\n.ace_fold-widget {\\n box-sizing: border-box;\\n\\n margin: 0 -12px 0 1px;\\n display: none;\\n width: 11px;\\n vertical-align: top;\\n\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\\\");\\n background-repeat: no-repeat;\\n background-position: center;\\n\\n border-radius: 3px;\\n \\n border: 1px solid transparent;\\n cursor: pointer;\\n}\\n\\n.ace_folding-enabled .ace_fold-widget {\\n display: inline-block; \\n}\\n\\n.ace_fold-widget.ace_end {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\\\");\\n}\\n\\n.ace_fold-widget.ace_closed {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\\\");\\n}\\n\\n.ace_fold-widget:hover {\\n border: 1px solid rgba(0, 0, 0, 0.3);\\n background-color: rgba(255, 255, 255, 0.2);\\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\\n}\\n\\n.ace_fold-widget:active {\\n border: 1px solid rgba(0, 0, 0, 0.4);\\n background-color: rgba(0, 0, 0, 0.05);\\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\\n}\\n/**\\n * Dark version for fold widgets\\n */\\n.ace_dark .ace_fold-widget {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\\\");\\n}\\n.ace_dark .ace_fold-widget.ace_end {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\\\");\\n}\\n.ace_dark .ace_fold-widget.ace_closed {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\\\");\\n}\\n.ace_dark .ace_fold-widget:hover {\\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\\n background-color: rgba(255, 255, 255, 0.1);\\n}\\n.ace_dark .ace_fold-widget:active {\\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\\n}\\n\\n.ace_inline_button {\\n border: 1px solid lightgray;\\n display: inline-block;\\n margin: -1px 8px;\\n padding: 0 5px;\\n pointer-events: auto;\\n cursor: pointer;\\n}\\n.ace_inline_button:hover {\\n border-color: gray;\\n background: rgba(200,200,200,0.2);\\n display: inline-block;\\n pointer-events: auto;\\n}\\n\\n.ace_fold-widget.ace_invalid {\\n background-color: #FFB4B4;\\n border-color: #DE5555;\\n}\\n\\n.ace_fade-fold-widgets .ace_fold-widget {\\n transition: opacity 0.4s ease 0.05s;\\n opacity: 0;\\n}\\n\\n.ace_fade-fold-widgets:hover .ace_fold-widget {\\n transition: opacity 0.05s ease 0.05s;\\n opacity:1;\\n}\\n\\n.ace_underline {\\n text-decoration: underline;\\n}\\n\\n.ace_bold {\\n font-weight: bold;\\n}\\n\\n.ace_nobold .ace_bold {\\n font-weight: normal;\\n}\\n\\n.ace_italic {\\n font-style: italic;\\n}\\n\\n\\n.ace_error-marker {\\n background-color: rgba(255, 0, 0,0.2);\\n position: absolute;\\n z-index: 9;\\n}\\n\\n.ace_highlight-marker {\\n background-color: rgba(255, 255, 0,0.2);\\n position: absolute;\\n z-index: 8;\\n}\\n\\n.ace_mobile-menu {\\n position: absolute;\\n line-height: 1.5;\\n border-radius: 4px;\\n -ms-user-select: none;\\n -moz-user-select: none;\\n -webkit-user-select: none;\\n user-select: none;\\n background: white;\\n box-shadow: 1px 3px 2px grey;\\n border: 1px solid #dcdcdc;\\n color: black;\\n}\\n.ace_dark > .ace_mobile-menu {\\n background: #333;\\n color: #ccc;\\n box-shadow: 1px 3px 2px grey;\\n border: 1px solid #444;\\n\\n}\\n.ace_mobile-button {\\n padding: 2px;\\n cursor: pointer;\\n overflow: hidden;\\n}\\n.ace_mobile-button:hover {\\n background-color: #eee;\\n opacity:1;\\n}\\n.ace_mobile-button:active {\\n background-color: #ddd;\\n}\\n\\n.ace_placeholder {\\n font-family: arial;\\n transform: scale(0.9);\\n transform-origin: left;\\n white-space: pre;\\n opacity: 0.7;\\n margin: 0 10px;\\n}\\n\\n.ace_ghost_text {\\n opacity: 0.5;\\n font-style: italic;\\n}\\n\\n.ace_ghost_text > div {\\n white-space: pre;\\n}\\n\\n.ghost_text_line_wrapped::after {\\n content: \\\"\\u21A9\\\";\\n position: absolute;\\n}\\n\\n.ace_lineWidgetContainer.ace_ghost_text {\\n margin: 0px 4px\\n}\\n\\n.ace_screenreader-only {\\n position:absolute;\\n left:-10000px;\\n top:auto;\\n width:1px;\\n height:1px;\\n overflow:hidden;\\n}\";\n\n});\n\nace.define(\"ace/layer/decorators\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/lib/oop\",\"ace/lib/event_emitter\"], function(require, exports, module){\"use strict\";\nvar dom = require(\"../lib/dom\");\nvar oop = require(\"../lib/oop\");\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar Decorator = /** @class */ (function () {\n function Decorator(parent, renderer) {\n this.canvas = dom.createElement(\"canvas\");\n this.renderer = renderer;\n this.pixelRatio = 1;\n this.maxHeight = renderer.layerConfig.maxHeight;\n this.lineHeight = renderer.layerConfig.lineHeight;\n this.canvasHeight = parent.parent.scrollHeight;\n this.heightRatio = this.canvasHeight / this.maxHeight;\n this.canvasWidth = parent.width;\n this.minDecorationHeight = (2 * this.pixelRatio) | 0;\n this.halfMinDecorationHeight = (this.minDecorationHeight / 2) | 0;\n this.canvas.width = this.canvasWidth;\n this.canvas.height = this.canvasHeight;\n this.canvas.style.top = 0 + \"px\";\n this.canvas.style.right = 0 + \"px\";\n this.canvas.style.zIndex = 7 + \"px\";\n this.canvas.style.position = \"absolute\";\n this.colors = {};\n this.colors.dark = {\n \"error\": \"rgba(255, 18, 18, 1)\",\n \"warning\": \"rgba(18, 136, 18, 1)\",\n \"info\": \"rgba(18, 18, 136, 1)\"\n };\n this.colors.light = {\n \"error\": \"rgb(255,51,51)\",\n \"warning\": \"rgb(32,133,72)\",\n \"info\": \"rgb(35,68,138)\"\n };\n parent.element.appendChild(this.canvas);\n }\n Decorator.prototype.$updateDecorators = function (config) {\n var colors = (this.renderer.theme.isDark === true) ? this.colors.dark : this.colors.light;\n if (config) {\n this.maxHeight = config.maxHeight;\n this.lineHeight = config.lineHeight;\n this.canvasHeight = config.height;\n var allLineHeight = (config.lastRow + 1) * this.lineHeight;\n if (allLineHeight < this.canvasHeight) {\n this.heightRatio = 1;\n }\n else {\n this.heightRatio = this.canvasHeight / this.maxHeight;\n }\n }\n var ctx = this.canvas.getContext(\"2d\");\n function compare(a, b) {\n if (a.priority < b.priority)\n return -1;\n if (a.priority > b.priority)\n return 1;\n return 0;\n }\n var annotations = this.renderer.session.$annotations;\n ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n if (annotations) {\n var priorities = {\n \"info\": 1,\n \"warning\": 2,\n \"error\": 3\n };\n annotations.forEach(function (item) {\n item.priority = priorities[item.type] || null;\n });\n annotations = annotations.sort(compare);\n var foldData = this.renderer.session.$foldData;\n for (var i = 0; i < annotations.length; i++) {\n var row = annotations[i].row;\n var compensateFold = this.compensateFoldRows(row, foldData);\n var currentY = Math.round((row - compensateFold) * this.lineHeight * this.heightRatio);\n var y1 = Math.round(((row - compensateFold) * this.lineHeight * this.heightRatio));\n var y2 = Math.round((((row - compensateFold) * this.lineHeight + this.lineHeight) * this.heightRatio));\n var height = y2 - y1;\n if (height < this.minDecorationHeight) {\n var yCenter = ((y1 + y2) / 2) | 0;\n if (yCenter < this.halfMinDecorationHeight) {\n yCenter = this.halfMinDecorationHeight;\n }\n else if (yCenter + this.halfMinDecorationHeight > this.canvasHeight) {\n yCenter = this.canvasHeight - this.halfMinDecorationHeight;\n }\n y1 = Math.round(yCenter - this.halfMinDecorationHeight);\n y2 = Math.round(yCenter + this.halfMinDecorationHeight);\n }\n ctx.fillStyle = colors[annotations[i].type] || null;\n ctx.fillRect(0, currentY, this.canvasWidth, y2 - y1);\n }\n }\n var cursor = this.renderer.session.selection.getCursor();\n if (cursor) {\n var compensateFold = this.compensateFoldRows(cursor.row, foldData);\n var currentY = Math.round((cursor.row - compensateFold) * this.lineHeight * this.heightRatio);\n ctx.fillStyle = \"rgba(0, 0, 0, 0.5)\";\n ctx.fillRect(0, currentY, this.canvasWidth, 2);\n }\n };\n Decorator.prototype.compensateFoldRows = function (row, foldData) {\n var compensateFold = 0;\n if (foldData && foldData.length > 0) {\n for (var j = 0; j < foldData.length; j++) {\n if (row > foldData[j].start.row && row < foldData[j].end.row) {\n compensateFold += row - foldData[j].start.row;\n }\n else if (row >= foldData[j].end.row) {\n compensateFold += foldData[j].end.row - foldData[j].start.row;\n }\n }\n }\n return compensateFold;\n };\n return Decorator;\n}());\noop.implement(Decorator.prototype, EventEmitter);\nexports.Decorator = Decorator;\n\n});\n\nace.define(\"ace/virtual_renderer\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/config\",\"ace/layer/gutter\",\"ace/layer/marker\",\"ace/layer/text\",\"ace/layer/cursor\",\"ace/scrollbar\",\"ace/scrollbar\",\"ace/scrollbar_custom\",\"ace/scrollbar_custom\",\"ace/renderloop\",\"ace/layer/font_metrics\",\"ace/lib/event_emitter\",\"ace/css/editor-css\",\"ace/layer/decorators\",\"ace/lib/useragent\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar dom = require(\"./lib/dom\");\nvar lang = require(\"./lib/lang\");\nvar config = require(\"./config\");\nvar GutterLayer = require(\"./layer/gutter\").Gutter;\nvar MarkerLayer = require(\"./layer/marker\").Marker;\nvar TextLayer = require(\"./layer/text\").Text;\nvar CursorLayer = require(\"./layer/cursor\").Cursor;\nvar HScrollBar = require(\"./scrollbar\").HScrollBar;\nvar VScrollBar = require(\"./scrollbar\").VScrollBar;\nvar HScrollBarCustom = require(\"./scrollbar_custom\").HScrollBar;\nvar VScrollBarCustom = require(\"./scrollbar_custom\").VScrollBar;\nvar RenderLoop = require(\"./renderloop\").RenderLoop;\nvar FontMetrics = require(\"./layer/font_metrics\").FontMetrics;\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar editorCss = require(\"./css/editor-css\");\nvar Decorator = require(\"./layer/decorators\").Decorator;\nvar useragent = require(\"./lib/useragent\");\ndom.importCssString(editorCss, \"ace_editor.css\", false);\nvar VirtualRenderer = /** @class */ (function () {\n function VirtualRenderer(container, theme) {\n var _self = this;\n this.container = container || dom.createElement(\"div\");\n dom.addCssClass(this.container, \"ace_editor\");\n if (dom.HI_DPI)\n dom.addCssClass(this.container, \"ace_hidpi\");\n this.setTheme(theme);\n if (config.get(\"useStrictCSP\") == null)\n config.set(\"useStrictCSP\", false);\n this.$gutter = dom.createElement(\"div\");\n this.$gutter.className = \"ace_gutter\";\n this.container.appendChild(this.$gutter);\n this.$gutter.setAttribute(\"aria-hidden\", \"true\");\n this.scroller = dom.createElement(\"div\");\n this.scroller.className = \"ace_scroller\";\n this.container.appendChild(this.scroller);\n this.content = dom.createElement(\"div\");\n this.content.className = \"ace_content\";\n this.scroller.appendChild(this.content);\n this.$gutterLayer = new GutterLayer(this.$gutter);\n this.$gutterLayer.on(\"changeGutterWidth\", this.onGutterResize.bind(this));\n this.$markerBack = new MarkerLayer(this.content);\n var textLayer = this.$textLayer = new TextLayer(this.content);\n this.canvas = textLayer.element;\n this.$markerFront = new MarkerLayer(this.content);\n this.$cursorLayer = new CursorLayer(this.content);\n this.$horizScroll = false;\n this.$vScroll = false;\n this.scrollBar =\n this.scrollBarV = new VScrollBar(this.container, this);\n this.scrollBarH = new HScrollBar(this.container, this);\n this.scrollBarV.on(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollTop(e.data - _self.scrollMargin.top);\n });\n this.scrollBarH.on(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollLeft(e.data - _self.scrollMargin.left);\n });\n this.scrollTop = 0;\n this.scrollLeft = 0;\n this.cursorPos = {\n row: 0,\n column: 0\n };\n this.$fontMetrics = new FontMetrics(this.container);\n this.$textLayer.$setFontMetrics(this.$fontMetrics);\n this.$textLayer.on(\"changeCharacterSize\", function (e) {\n _self.updateCharacterSize();\n _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height);\n _self._signal(\"changeCharacterSize\", e);\n });\n this.$size = {\n width: 0,\n height: 0,\n scrollerHeight: 0,\n scrollerWidth: 0,\n $dirty: true\n };\n this.layerConfig = {\n width: 1,\n padding: 0,\n firstRow: 0,\n firstRowScreen: 0,\n lastRow: 0,\n lineHeight: 0,\n characterWidth: 0,\n minHeight: 1,\n maxHeight: 1,\n offset: 0,\n height: 1,\n gutterOffset: 1\n };\n this.scrollMargin = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n v: 0,\n h: 0\n };\n this.margin = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n v: 0,\n h: 0\n };\n this.$keepTextAreaAtCursor = !useragent.isIOS;\n this.$loop = new RenderLoop(this.$renderChanges.bind(this), this.container.ownerDocument.defaultView);\n this.$loop.schedule(this.CHANGE_FULL);\n this.updateCharacterSize();\n this.setPadding(4);\n this.$addResizeObserver();\n config.resetOptions(this);\n config._signal(\"renderer\", this);\n }\n VirtualRenderer.prototype.updateCharacterSize = function () {\n if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) {\n this.$allowBoldFonts = this.$textLayer.allowBoldFonts;\n this.setStyle(\"ace_nobold\", !this.$allowBoldFonts);\n }\n this.layerConfig.characterWidth =\n this.characterWidth = this.$textLayer.getCharacterWidth();\n this.layerConfig.lineHeight =\n this.lineHeight = this.$textLayer.getLineHeight();\n this.$updatePrintMargin();\n dom.setStyle(this.scroller.style, \"line-height\", this.lineHeight + \"px\");\n };\n VirtualRenderer.prototype.setSession = function (session) {\n if (this.session)\n this.session.doc.off(\"changeNewLineMode\", this.onChangeNewLineMode);\n this.session = session;\n if (session && this.scrollMargin.top && session.getScrollTop() <= 0)\n session.setScrollTop(-this.scrollMargin.top);\n this.$cursorLayer.setSession(session);\n this.$markerBack.setSession(session);\n this.$markerFront.setSession(session);\n this.$gutterLayer.setSession(session);\n this.$textLayer.setSession(session);\n if (!session)\n return;\n this.$loop.schedule(this.CHANGE_FULL);\n this.session.$setFontMetrics(this.$fontMetrics);\n this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null;\n this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this);\n this.onChangeNewLineMode();\n this.session.doc.on(\"changeNewLineMode\", this.onChangeNewLineMode);\n };\n VirtualRenderer.prototype.updateLines = function (firstRow, lastRow, force) {\n if (lastRow === undefined)\n lastRow = Infinity;\n if (!this.$changedLines) {\n this.$changedLines = {\n firstRow: firstRow,\n lastRow: lastRow\n };\n }\n else {\n if (this.$changedLines.firstRow > firstRow)\n this.$changedLines.firstRow = firstRow;\n if (this.$changedLines.lastRow < lastRow)\n this.$changedLines.lastRow = lastRow;\n }\n if (this.$changedLines.lastRow < this.layerConfig.firstRow) {\n if (force)\n this.$changedLines.lastRow = this.layerConfig.lastRow;\n else\n return;\n }\n if (this.$changedLines.firstRow > this.layerConfig.lastRow)\n return;\n this.$loop.schedule(this.CHANGE_LINES);\n };\n VirtualRenderer.prototype.onChangeNewLineMode = function () {\n this.$loop.schedule(this.CHANGE_TEXT);\n this.$textLayer.$updateEolChar();\n this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR);\n };\n VirtualRenderer.prototype.onChangeTabSize = function () {\n this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER);\n this.$textLayer.onChangeTabSize();\n };\n VirtualRenderer.prototype.updateText = function () {\n this.$loop.schedule(this.CHANGE_TEXT);\n };\n VirtualRenderer.prototype.updateFull = function (force) {\n if (force)\n this.$renderChanges(this.CHANGE_FULL, true);\n else\n this.$loop.schedule(this.CHANGE_FULL);\n };\n VirtualRenderer.prototype.updateFontSize = function () {\n this.$textLayer.checkForSizeChanges();\n };\n VirtualRenderer.prototype.$updateSizeAsync = function () {\n if (this.$loop.pending)\n this.$size.$dirty = true;\n else\n this.onResize();\n };\n VirtualRenderer.prototype.onResize = function (force, gutterWidth, width, height) {\n if (this.resizing > 2)\n return;\n else if (this.resizing > 0)\n this.resizing++;\n else\n this.resizing = force ? 1 : 0;\n var el = this.container;\n if (!height)\n height = el.clientHeight || el.scrollHeight;\n if (!width)\n width = el.clientWidth || el.scrollWidth;\n var changes = this.$updateCachedSize(force, gutterWidth, width, height);\n if (this.$resizeTimer)\n this.$resizeTimer.cancel();\n if (!this.$size.scrollerHeight || (!width && !height))\n return this.resizing = 0;\n if (force)\n this.$gutterLayer.$padding = null;\n if (force)\n this.$renderChanges(changes | this.$changes, true);\n else\n this.$loop.schedule(changes | this.$changes);\n if (this.resizing)\n this.resizing = 0;\n this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null;\n if (this.$customScrollbar) {\n this.$updateCustomScrollbar(true);\n }\n };\n VirtualRenderer.prototype.$updateCachedSize = function (force, gutterWidth, width, height) {\n height -= (this.$extraHeight || 0);\n var changes = 0;\n var size = this.$size;\n var oldSize = {\n width: size.width,\n height: size.height,\n scrollerHeight: size.scrollerHeight,\n scrollerWidth: size.scrollerWidth\n };\n if (height && (force || size.height != height)) {\n size.height = height;\n changes |= this.CHANGE_SIZE;\n size.scrollerHeight = size.height;\n if (this.$horizScroll)\n size.scrollerHeight -= this.scrollBarH.getHeight();\n this.scrollBarV.setHeight(size.scrollerHeight);\n this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + \"px\";\n changes = changes | this.CHANGE_SCROLL;\n }\n if (width && (force || size.width != width)) {\n changes |= this.CHANGE_SIZE;\n size.width = width;\n if (gutterWidth == null)\n gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0;\n this.gutterWidth = gutterWidth;\n dom.setStyle(this.scrollBarH.element.style, \"left\", gutterWidth + \"px\");\n dom.setStyle(this.scroller.style, \"left\", gutterWidth + this.margin.left + \"px\");\n size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth() - this.margin.h);\n dom.setStyle(this.$gutter.style, \"left\", this.margin.left + \"px\");\n var right = this.scrollBarV.getWidth() + \"px\";\n dom.setStyle(this.scrollBarH.element.style, \"right\", right);\n dom.setStyle(this.scroller.style, \"right\", right);\n dom.setStyle(this.scroller.style, \"bottom\", this.scrollBarH.getHeight());\n this.scrollBarH.setWidth(size.scrollerWidth);\n if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force) {\n changes |= this.CHANGE_FULL;\n }\n }\n size.$dirty = !width || !height;\n if (changes)\n this._signal(\"resize\", oldSize);\n return changes;\n };\n VirtualRenderer.prototype.onGutterResize = function (width) {\n var gutterWidth = this.$showGutter ? width : 0;\n if (gutterWidth != this.gutterWidth)\n this.$changes |= this.$updateCachedSize(true, gutterWidth, this.$size.width, this.$size.height);\n if (this.session.getUseWrapMode() && this.adjustWrapLimit()) {\n this.$loop.schedule(this.CHANGE_FULL);\n }\n else if (this.$size.$dirty) {\n this.$loop.schedule(this.CHANGE_FULL);\n }\n else {\n this.$computeLayerConfig();\n }\n };\n VirtualRenderer.prototype.adjustWrapLimit = function () {\n var availableWidth = this.$size.scrollerWidth - this.$padding * 2;\n var limit = Math.floor(availableWidth / this.characterWidth);\n return this.session.adjustWrapLimit(limit, this.$showPrintMargin && this.$printMarginColumn);\n };\n VirtualRenderer.prototype.setAnimatedScroll = function (shouldAnimate) {\n this.setOption(\"animatedScroll\", shouldAnimate);\n };\n VirtualRenderer.prototype.getAnimatedScroll = function () {\n return this.$animatedScroll;\n };\n VirtualRenderer.prototype.setShowInvisibles = function (showInvisibles) {\n this.setOption(\"showInvisibles\", showInvisibles);\n this.session.$bidiHandler.setShowInvisibles(showInvisibles);\n };\n VirtualRenderer.prototype.getShowInvisibles = function () {\n return this.getOption(\"showInvisibles\");\n };\n VirtualRenderer.prototype.getDisplayIndentGuides = function () {\n return this.getOption(\"displayIndentGuides\");\n };\n VirtualRenderer.prototype.setDisplayIndentGuides = function (display) {\n this.setOption(\"displayIndentGuides\", display);\n };\n VirtualRenderer.prototype.getHighlightIndentGuides = function () {\n return this.getOption(\"highlightIndentGuides\");\n };\n VirtualRenderer.prototype.setHighlightIndentGuides = function (highlight) {\n this.setOption(\"highlightIndentGuides\", highlight);\n };\n VirtualRenderer.prototype.setShowPrintMargin = function (showPrintMargin) {\n this.setOption(\"showPrintMargin\", showPrintMargin);\n };\n VirtualRenderer.prototype.getShowPrintMargin = function () {\n return this.getOption(\"showPrintMargin\");\n };\n VirtualRenderer.prototype.setPrintMarginColumn = function (printMarginColumn) {\n this.setOption(\"printMarginColumn\", printMarginColumn);\n };\n VirtualRenderer.prototype.getPrintMarginColumn = function () {\n return this.getOption(\"printMarginColumn\");\n };\n VirtualRenderer.prototype.getShowGutter = function () {\n return this.getOption(\"showGutter\");\n };\n VirtualRenderer.prototype.setShowGutter = function (show) {\n return this.setOption(\"showGutter\", show);\n };\n VirtualRenderer.prototype.getFadeFoldWidgets = function () {\n return this.getOption(\"fadeFoldWidgets\");\n };\n VirtualRenderer.prototype.setFadeFoldWidgets = function (show) {\n this.setOption(\"fadeFoldWidgets\", show);\n };\n VirtualRenderer.prototype.setHighlightGutterLine = function (shouldHighlight) {\n this.setOption(\"highlightGutterLine\", shouldHighlight);\n };\n VirtualRenderer.prototype.getHighlightGutterLine = function () {\n return this.getOption(\"highlightGutterLine\");\n };\n VirtualRenderer.prototype.$updatePrintMargin = function () {\n if (!this.$showPrintMargin && !this.$printMarginEl)\n return;\n if (!this.$printMarginEl) {\n var containerEl = dom.createElement(\"div\");\n containerEl.className = \"ace_layer ace_print-margin-layer\";\n this.$printMarginEl = dom.createElement(\"div\");\n this.$printMarginEl.className = \"ace_print-margin\";\n containerEl.appendChild(this.$printMarginEl);\n this.content.insertBefore(containerEl, this.content.firstChild);\n }\n var style = this.$printMarginEl.style;\n style.left = Math.round(this.characterWidth * this.$printMarginColumn + this.$padding) + \"px\";\n style.visibility = this.$showPrintMargin ? \"visible\" : \"hidden\";\n if (this.session && this.session.$wrap == -1)\n this.adjustWrapLimit();\n };\n VirtualRenderer.prototype.getContainerElement = function () {\n return this.container;\n };\n VirtualRenderer.prototype.getMouseEventTarget = function () {\n return this.scroller;\n };\n VirtualRenderer.prototype.getTextAreaContainer = function () {\n return this.container;\n };\n VirtualRenderer.prototype.$moveTextAreaToCursor = function () {\n if (this.$isMousePressed)\n return;\n var style = this.textarea.style;\n var composition = this.$composition;\n if (!this.$keepTextAreaAtCursor && !composition) {\n dom.translate(this.textarea, -100, 0);\n return;\n }\n var pixelPos = this.$cursorLayer.$pixelPos;\n if (!pixelPos)\n return;\n if (composition && composition.markerRange)\n pixelPos = this.$cursorLayer.getPixelPosition(composition.markerRange.start, true);\n var config = this.layerConfig;\n var posTop = pixelPos.top;\n var posLeft = pixelPos.left;\n posTop -= config.offset;\n var h = composition && composition.useTextareaForIME || useragent.isMobile ? this.lineHeight : 1;\n if (posTop < 0 || posTop > config.height - h) {\n dom.translate(this.textarea, 0, 0);\n return;\n }\n var w = 1;\n var maxTop = this.$size.height - h;\n if (!composition) {\n posTop += this.lineHeight;\n }\n else {\n if (composition.useTextareaForIME) {\n var val = this.textarea.value;\n w = this.characterWidth * (this.session.$getStringScreenWidth(val)[0]);\n }\n else {\n posTop += this.lineHeight + 2;\n }\n }\n posLeft -= this.scrollLeft;\n if (posLeft > this.$size.scrollerWidth - w)\n posLeft = this.$size.scrollerWidth - w;\n posLeft += this.gutterWidth + this.margin.left;\n dom.setStyle(style, \"height\", h + \"px\");\n dom.setStyle(style, \"width\", w + \"px\");\n dom.translate(this.textarea, Math.min(posLeft, this.$size.scrollerWidth - w), Math.min(posTop, maxTop));\n };\n VirtualRenderer.prototype.getFirstVisibleRow = function () {\n return this.layerConfig.firstRow;\n };\n VirtualRenderer.prototype.getFirstFullyVisibleRow = function () {\n return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1);\n };\n VirtualRenderer.prototype.getLastFullyVisibleRow = function () {\n var config = this.layerConfig;\n var lastRow = config.lastRow;\n var top = this.session.documentToScreenRow(lastRow, 0) * config.lineHeight;\n if (top - this.session.getScrollTop() > config.height - config.lineHeight)\n return lastRow - 1;\n return lastRow;\n };\n VirtualRenderer.prototype.getLastVisibleRow = function () {\n return this.layerConfig.lastRow;\n };\n VirtualRenderer.prototype.setPadding = function (padding) {\n this.$padding = padding;\n this.$textLayer.setPadding(padding);\n this.$cursorLayer.setPadding(padding);\n this.$markerFront.setPadding(padding);\n this.$markerBack.setPadding(padding);\n this.$loop.schedule(this.CHANGE_FULL);\n this.$updatePrintMargin();\n };\n VirtualRenderer.prototype.setScrollMargin = function (top, bottom, left, right) {\n var sm = this.scrollMargin;\n sm.top = top | 0;\n sm.bottom = bottom | 0;\n sm.right = right | 0;\n sm.left = left | 0;\n sm.v = sm.top + sm.bottom;\n sm.h = sm.left + sm.right;\n if (sm.top && this.scrollTop <= 0 && this.session)\n this.session.setScrollTop(-sm.top);\n this.updateFull();\n };\n VirtualRenderer.prototype.setMargin = function (top, bottom, left, right) {\n var sm = this.margin;\n sm.top = top | 0;\n sm.bottom = bottom | 0;\n sm.right = right | 0;\n sm.left = left | 0;\n sm.v = sm.top + sm.bottom;\n sm.h = sm.left + sm.right;\n this.$updateCachedSize(true, this.gutterWidth, this.$size.width, this.$size.height);\n this.updateFull();\n };\n VirtualRenderer.prototype.getHScrollBarAlwaysVisible = function () {\n return this.$hScrollBarAlwaysVisible;\n };\n VirtualRenderer.prototype.setHScrollBarAlwaysVisible = function (alwaysVisible) {\n this.setOption(\"hScrollBarAlwaysVisible\", alwaysVisible);\n };\n VirtualRenderer.prototype.getVScrollBarAlwaysVisible = function () {\n return this.$vScrollBarAlwaysVisible;\n };\n VirtualRenderer.prototype.setVScrollBarAlwaysVisible = function (alwaysVisible) {\n this.setOption(\"vScrollBarAlwaysVisible\", alwaysVisible);\n };\n VirtualRenderer.prototype.$updateScrollBarV = function () {\n var scrollHeight = this.layerConfig.maxHeight;\n var scrollerHeight = this.$size.scrollerHeight;\n if (!this.$maxLines && this.$scrollPastEnd) {\n scrollHeight -= (scrollerHeight - this.lineHeight) * this.$scrollPastEnd;\n if (this.scrollTop > scrollHeight - scrollerHeight) {\n scrollHeight = this.scrollTop + scrollerHeight;\n this.scrollBarV.scrollTop = null;\n }\n }\n this.scrollBarV.setScrollHeight(scrollHeight + this.scrollMargin.v);\n this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top);\n };\n VirtualRenderer.prototype.$updateScrollBarH = function () {\n this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h);\n this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left);\n };\n VirtualRenderer.prototype.freeze = function () {\n this.$frozen = true;\n };\n VirtualRenderer.prototype.unfreeze = function () {\n this.$frozen = false;\n };\n VirtualRenderer.prototype.$renderChanges = function (changes, force) {\n if (this.$changes) {\n changes |= this.$changes;\n this.$changes = 0;\n }\n if ((!this.session || !this.container.offsetWidth || this.$frozen) || (!changes && !force)) {\n this.$changes |= changes;\n return;\n }\n if (this.$size.$dirty) {\n this.$changes |= changes;\n return this.onResize(true);\n }\n if (!this.lineHeight) {\n this.$textLayer.checkForSizeChanges();\n }\n this._signal(\"beforeRender\", changes);\n if (this.session && this.session.$bidiHandler)\n this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);\n var config = this.layerConfig;\n if (changes & this.CHANGE_FULL ||\n changes & this.CHANGE_SIZE ||\n changes & this.CHANGE_TEXT ||\n changes & this.CHANGE_LINES ||\n changes & this.CHANGE_SCROLL ||\n changes & this.CHANGE_H_SCROLL) {\n changes |= this.$computeLayerConfig() | this.$loop.clear();\n if (config.firstRow != this.layerConfig.firstRow && config.firstRowScreen == this.layerConfig.firstRowScreen) {\n var st = this.scrollTop + (config.firstRow - Math.max(this.layerConfig.firstRow, 0)) * this.lineHeight;\n if (st > 0) {\n this.scrollTop = st;\n changes = changes | this.CHANGE_SCROLL;\n changes |= this.$computeLayerConfig() | this.$loop.clear();\n }\n }\n config = this.layerConfig;\n this.$updateScrollBarV();\n if (changes & this.CHANGE_H_SCROLL)\n this.$updateScrollBarH();\n dom.translate(this.content, -this.scrollLeft, -config.offset);\n var width = config.width + 2 * this.$padding + \"px\";\n var height = config.minHeight + \"px\";\n dom.setStyle(this.content.style, \"width\", width);\n dom.setStyle(this.content.style, \"height\", height);\n }\n if (changes & this.CHANGE_H_SCROLL) {\n dom.translate(this.content, -this.scrollLeft, -config.offset);\n this.scroller.className = this.scrollLeft <= 0 ? \"ace_scroller \" : \"ace_scroller ace_scroll-left \";\n if (this.enableKeyboardAccessibility)\n this.scroller.className += this.keyboardFocusClassName;\n }\n if (changes & this.CHANGE_FULL) {\n this.$changedLines = null;\n this.$textLayer.update(config);\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n this.$markerBack.update(config);\n this.$markerFront.update(config);\n this.$cursorLayer.update(config);\n this.$moveTextAreaToCursor();\n this._signal(\"afterRender\", changes);\n return;\n }\n if (changes & this.CHANGE_SCROLL) {\n this.$changedLines = null;\n if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES)\n this.$textLayer.update(config);\n else\n this.$textLayer.scrollLines(config);\n if (this.$showGutter) {\n if (changes & this.CHANGE_GUTTER || changes & this.CHANGE_LINES)\n this.$gutterLayer.update(config);\n else\n this.$gutterLayer.scrollLines(config);\n }\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n this.$markerBack.update(config);\n this.$markerFront.update(config);\n this.$cursorLayer.update(config);\n this.$moveTextAreaToCursor();\n this._signal(\"afterRender\", changes);\n return;\n }\n if (changes & this.CHANGE_TEXT) {\n this.$changedLines = null;\n this.$textLayer.update(config);\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n }\n else if (changes & this.CHANGE_LINES) {\n if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.$showGutter)\n this.$gutterLayer.update(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n }\n else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) {\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n }\n else if (changes & this.CHANGE_CURSOR) {\n if (this.$highlightGutterLine)\n this.$gutterLayer.updateLineHighlight(config);\n if (this.$customScrollbar) {\n this.$scrollDecorator.$updateDecorators(config);\n }\n }\n if (changes & this.CHANGE_CURSOR) {\n this.$cursorLayer.update(config);\n this.$moveTextAreaToCursor();\n }\n if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) {\n this.$markerFront.update(config);\n }\n if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) {\n this.$markerBack.update(config);\n }\n this._signal(\"afterRender\", changes);\n };\n VirtualRenderer.prototype.$autosize = function () {\n var height = this.session.getScreenLength() * this.lineHeight;\n var maxHeight = this.$maxLines * this.lineHeight;\n var desiredHeight = Math.min(maxHeight, Math.max((this.$minLines || 1) * this.lineHeight, height)) + this.scrollMargin.v + (this.$extraHeight || 0);\n if (this.$horizScroll)\n desiredHeight += this.scrollBarH.getHeight();\n if (this.$maxPixelHeight && desiredHeight > this.$maxPixelHeight)\n desiredHeight = this.$maxPixelHeight;\n var hideScrollbars = desiredHeight <= 2 * this.lineHeight;\n var vScroll = !hideScrollbars && height > maxHeight;\n if (desiredHeight != this.desiredHeight ||\n this.$size.height != this.desiredHeight || vScroll != this.$vScroll) {\n if (vScroll != this.$vScroll) {\n this.$vScroll = vScroll;\n this.scrollBarV.setVisible(vScroll);\n }\n var w = this.container.clientWidth;\n this.container.style.height = desiredHeight + \"px\";\n this.$updateCachedSize(true, this.$gutterWidth, w, desiredHeight);\n this.desiredHeight = desiredHeight;\n this._signal(\"autosize\");\n }\n };\n VirtualRenderer.prototype.$computeLayerConfig = function () {\n var session = this.session;\n var size = this.$size;\n var hideScrollbars = size.height <= 2 * this.lineHeight;\n var screenLines = this.session.getScreenLength();\n var maxHeight = screenLines * this.lineHeight;\n var longestLine = this.$getLongestLine();\n var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible ||\n size.scrollerWidth - longestLine - 2 * this.$padding < 0);\n var hScrollChanged = this.$horizScroll !== horizScroll;\n if (hScrollChanged) {\n this.$horizScroll = horizScroll;\n this.scrollBarH.setVisible(horizScroll);\n }\n var vScrollBefore = this.$vScroll; // autosize can change vscroll value in which case we need to update longestLine\n if (this.$maxLines && this.lineHeight > 1)\n this.$autosize();\n var minHeight = size.scrollerHeight + this.lineHeight;\n var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd\n ? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd\n : 0;\n maxHeight += scrollPastEnd;\n var sm = this.scrollMargin;\n this.session.setScrollTop(Math.max(-sm.top, Math.min(this.scrollTop, maxHeight - size.scrollerHeight + sm.bottom)));\n this.session.setScrollLeft(Math.max(-sm.left, Math.min(this.scrollLeft, longestLine + 2 * this.$padding - size.scrollerWidth + sm.right)));\n var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible ||\n size.scrollerHeight - maxHeight + scrollPastEnd < 0 || this.scrollTop > sm.top);\n var vScrollChanged = vScrollBefore !== vScroll;\n if (vScrollChanged) {\n this.$vScroll = vScroll;\n this.scrollBarV.setVisible(vScroll);\n }\n var offset = this.scrollTop % this.lineHeight;\n var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;\n var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));\n var lastRow = firstRow + lineCount;\n var firstRowScreen, firstRowHeight;\n var lineHeight = this.lineHeight;\n firstRow = session.screenToDocumentRow(firstRow, 0);\n var foldLine = session.getFoldLine(firstRow);\n if (foldLine) {\n firstRow = foldLine.start.row;\n }\n firstRowScreen = session.documentToScreenRow(firstRow, 0);\n firstRowHeight = session.getRowLength(firstRow) * lineHeight;\n lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1);\n minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight +\n firstRowHeight;\n offset = this.scrollTop - firstRowScreen * lineHeight;\n var changes = 0;\n if (this.layerConfig.width != longestLine || hScrollChanged)\n changes = this.CHANGE_H_SCROLL;\n if (hScrollChanged || vScrollChanged) {\n changes |= this.$updateCachedSize(true, this.gutterWidth, size.width, size.height);\n this._signal(\"scrollbarVisibilityChanged\");\n if (vScrollChanged)\n longestLine = this.$getLongestLine();\n }\n this.layerConfig = {\n width: longestLine,\n padding: this.$padding,\n firstRow: firstRow,\n firstRowScreen: firstRowScreen,\n lastRow: lastRow,\n lineHeight: lineHeight,\n characterWidth: this.characterWidth,\n minHeight: minHeight,\n maxHeight: maxHeight,\n offset: offset,\n gutterOffset: lineHeight ? Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)) : 0,\n height: this.$size.scrollerHeight\n };\n if (this.session.$bidiHandler)\n this.session.$bidiHandler.setContentWidth(longestLine - this.$padding);\n return changes;\n };\n VirtualRenderer.prototype.$updateLines = function () {\n if (!this.$changedLines)\n return;\n var firstRow = this.$changedLines.firstRow;\n var lastRow = this.$changedLines.lastRow;\n this.$changedLines = null;\n var layerConfig = this.layerConfig;\n if (firstRow > layerConfig.lastRow + 1) {\n return;\n }\n if (lastRow < layerConfig.firstRow) {\n return;\n }\n if (lastRow === Infinity) {\n if (this.$showGutter)\n this.$gutterLayer.update(layerConfig);\n this.$textLayer.update(layerConfig);\n return;\n }\n this.$textLayer.updateLines(layerConfig, firstRow, lastRow);\n return true;\n };\n VirtualRenderer.prototype.$getLongestLine = function () {\n var charCount = this.session.getScreenWidth();\n if (this.showInvisibles && !this.session.$useWrapMode)\n charCount += 1;\n if (this.$textLayer && charCount > this.$textLayer.MAX_LINE_LENGTH)\n charCount = this.$textLayer.MAX_LINE_LENGTH + 30;\n return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth));\n };\n VirtualRenderer.prototype.updateFrontMarkers = function () {\n this.$markerFront.setMarkers(this.session.getMarkers(true));\n this.$loop.schedule(this.CHANGE_MARKER_FRONT);\n };\n VirtualRenderer.prototype.updateBackMarkers = function () {\n this.$markerBack.setMarkers(this.session.getMarkers());\n this.$loop.schedule(this.CHANGE_MARKER_BACK);\n };\n VirtualRenderer.prototype.addGutterDecoration = function (row, className) {\n this.$gutterLayer.addGutterDecoration(row, className);\n };\n VirtualRenderer.prototype.removeGutterDecoration = function (row, className) {\n this.$gutterLayer.removeGutterDecoration(row, className);\n };\n VirtualRenderer.prototype.updateBreakpoints = function (rows) {\n this._rows = rows;\n this.$loop.schedule(this.CHANGE_GUTTER);\n };\n VirtualRenderer.prototype.setAnnotations = function (annotations) {\n this.$gutterLayer.setAnnotations(annotations);\n this.$loop.schedule(this.CHANGE_GUTTER);\n };\n VirtualRenderer.prototype.updateCursor = function () {\n this.$loop.schedule(this.CHANGE_CURSOR);\n };\n VirtualRenderer.prototype.hideCursor = function () {\n this.$cursorLayer.hideCursor();\n };\n VirtualRenderer.prototype.showCursor = function () {\n this.$cursorLayer.showCursor();\n };\n VirtualRenderer.prototype.scrollSelectionIntoView = function (anchor, lead, offset) {\n this.scrollCursorIntoView(anchor, offset);\n this.scrollCursorIntoView(lead, offset);\n };\n VirtualRenderer.prototype.scrollCursorIntoView = function (cursor, offset, $viewMargin) {\n if (this.$size.scrollerHeight === 0)\n return;\n var pos = this.$cursorLayer.getPixelPosition(cursor);\n var newLeft = pos.left;\n var newTop = pos.top;\n var topMargin = $viewMargin && $viewMargin.top || 0;\n var bottomMargin = $viewMargin && $viewMargin.bottom || 0;\n if (this.$scrollAnimation) {\n this.$stopAnimation = true;\n }\n var currentTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop;\n if (currentTop + topMargin > newTop) {\n if (offset && currentTop + topMargin > newTop + this.lineHeight)\n newTop -= offset * this.$size.scrollerHeight;\n if (newTop === 0)\n newTop = -this.scrollMargin.top;\n this.session.setScrollTop(newTop);\n }\n else if (currentTop + this.$size.scrollerHeight - bottomMargin < newTop + this.lineHeight) {\n if (offset && currentTop + this.$size.scrollerHeight - bottomMargin < newTop - this.lineHeight)\n newTop += offset * this.$size.scrollerHeight;\n this.session.setScrollTop(newTop + this.lineHeight + bottomMargin - this.$size.scrollerHeight);\n }\n var currentLeft = this.scrollLeft;\n var twoCharsWidth = 2 * this.layerConfig.characterWidth;\n if (newLeft - twoCharsWidth < currentLeft) {\n newLeft -= twoCharsWidth;\n if (newLeft < this.$padding + twoCharsWidth) {\n newLeft = -this.scrollMargin.left;\n }\n this.session.setScrollLeft(newLeft);\n }\n else {\n newLeft += twoCharsWidth;\n if (currentLeft + this.$size.scrollerWidth < newLeft + this.characterWidth) {\n this.session.setScrollLeft(Math.round(newLeft + this.characterWidth - this.$size.scrollerWidth));\n }\n else if (currentLeft <= this.$padding && newLeft - currentLeft < this.characterWidth) {\n this.session.setScrollLeft(0);\n }\n }\n };\n VirtualRenderer.prototype.getScrollTop = function () {\n return this.session.getScrollTop();\n };\n VirtualRenderer.prototype.getScrollLeft = function () {\n return this.session.getScrollLeft();\n };\n VirtualRenderer.prototype.getScrollTopRow = function () {\n return this.scrollTop / this.lineHeight;\n };\n VirtualRenderer.prototype.getScrollBottomRow = function () {\n return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);\n };\n VirtualRenderer.prototype.scrollToRow = function (row) {\n this.session.setScrollTop(row * this.lineHeight);\n };\n VirtualRenderer.prototype.alignCursor = function (cursor, alignment) {\n if (typeof cursor == \"number\")\n cursor = { row: cursor, column: 0 };\n var pos = this.$cursorLayer.getPixelPosition(cursor);\n var h = this.$size.scrollerHeight - this.lineHeight;\n var offset = pos.top - h * (alignment || 0);\n this.session.setScrollTop(offset);\n return offset;\n };\n VirtualRenderer.prototype.$calcSteps = function (fromValue, toValue) {\n var i = 0;\n var l = this.STEPS;\n var steps = [];\n var func = function (t, x_min, dx) {\n return dx * (Math.pow(t - 1, 3) + 1) + x_min;\n };\n for (i = 0; i < l; ++i)\n steps.push(func(i / this.STEPS, fromValue, toValue - fromValue));\n return steps;\n };\n VirtualRenderer.prototype.scrollToLine = function (line, center, animate, callback) {\n var pos = this.$cursorLayer.getPixelPosition({ row: line, column: 0 });\n var offset = pos.top;\n if (center)\n offset -= this.$size.scrollerHeight / 2;\n var initialScroll = this.scrollTop;\n this.session.setScrollTop(offset);\n if (animate !== false)\n this.animateScrolling(initialScroll, callback);\n };\n VirtualRenderer.prototype.animateScrolling = function (fromValue, callback) {\n var toValue = this.scrollTop;\n if (!this.$animatedScroll)\n return;\n var _self = this;\n if (fromValue == toValue)\n return;\n if (this.$scrollAnimation) {\n var oldSteps = this.$scrollAnimation.steps;\n if (oldSteps.length) {\n fromValue = oldSteps[0];\n if (fromValue == toValue)\n return;\n }\n }\n var steps = _self.$calcSteps(fromValue, toValue);\n this.$scrollAnimation = { from: fromValue, to: toValue, steps: steps };\n clearInterval(this.$timer);\n _self.session.setScrollTop(steps.shift());\n _self.session.$scrollTop = toValue;\n function endAnimation() {\n _self.$timer = clearInterval(_self.$timer);\n _self.$scrollAnimation = null;\n _self.$stopAnimation = false;\n callback && callback();\n }\n this.$timer = setInterval(function () {\n if (_self.$stopAnimation) {\n endAnimation();\n return;\n }\n if (!_self.session)\n return clearInterval(_self.$timer);\n if (steps.length) {\n _self.session.setScrollTop(steps.shift());\n _self.session.$scrollTop = toValue;\n }\n else if (toValue != null) {\n _self.session.$scrollTop = -1;\n _self.session.setScrollTop(toValue);\n toValue = null;\n }\n else {\n endAnimation();\n }\n }, 10);\n };\n VirtualRenderer.prototype.scrollToY = function (scrollTop) {\n if (this.scrollTop !== scrollTop) {\n this.$loop.schedule(this.CHANGE_SCROLL);\n this.scrollTop = scrollTop;\n }\n };\n VirtualRenderer.prototype.scrollToX = function (scrollLeft) {\n if (this.scrollLeft !== scrollLeft)\n this.scrollLeft = scrollLeft;\n this.$loop.schedule(this.CHANGE_H_SCROLL);\n };\n VirtualRenderer.prototype.scrollTo = function (x, y) {\n this.session.setScrollTop(y);\n this.session.setScrollLeft(x);\n };\n VirtualRenderer.prototype.scrollBy = function (deltaX, deltaY) {\n deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY);\n deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX);\n };\n VirtualRenderer.prototype.isScrollableBy = function (deltaX, deltaY) {\n if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top)\n return true;\n if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight\n - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom)\n return true;\n if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left)\n return true;\n if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth\n - this.layerConfig.width < -1 + this.scrollMargin.right)\n return true;\n };\n VirtualRenderer.prototype.pixelToScreenCoordinates = function (x, y) {\n var canvasPos;\n if (this.$hasCssTransforms) {\n canvasPos = { top: 0, left: 0 };\n var p = this.$fontMetrics.transformCoordinates([x, y]);\n x = p[1] - this.gutterWidth - this.margin.left;\n y = p[0];\n }\n else {\n canvasPos = this.scroller.getBoundingClientRect();\n }\n var offsetX = x + this.scrollLeft - canvasPos.left - this.$padding;\n var offset = offsetX / this.characterWidth;\n var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight);\n var col = this.$blockCursor ? Math.floor(offset) : Math.round(offset);\n return { row: row, column: col, side: offset - col > 0 ? 1 : -1, offsetX: offsetX };\n };\n VirtualRenderer.prototype.screenToTextCoordinates = function (x, y) {\n var canvasPos;\n if (this.$hasCssTransforms) {\n canvasPos = { top: 0, left: 0 };\n var p = this.$fontMetrics.transformCoordinates([x, y]);\n x = p[1] - this.gutterWidth - this.margin.left;\n y = p[0];\n }\n else {\n canvasPos = this.scroller.getBoundingClientRect();\n }\n var offsetX = x + this.scrollLeft - canvasPos.left - this.$padding;\n var offset = offsetX / this.characterWidth;\n var col = this.$blockCursor ? Math.floor(offset) : Math.round(offset);\n var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight);\n return this.session.screenToDocumentPosition(row, Math.max(col, 0), offsetX);\n };\n VirtualRenderer.prototype.textToScreenCoordinates = function (row, column) {\n var canvasPos = this.scroller.getBoundingClientRect();\n var pos = this.session.documentToScreenPosition(row, column);\n var x = this.$padding + (this.session.$bidiHandler.isBidiRow(pos.row, row)\n ? this.session.$bidiHandler.getPosLeft(pos.column)\n : Math.round(pos.column * this.characterWidth));\n var y = pos.row * this.lineHeight;\n return {\n pageX: canvasPos.left + x - this.scrollLeft,\n pageY: canvasPos.top + y - this.scrollTop\n };\n };\n VirtualRenderer.prototype.visualizeFocus = function () {\n dom.addCssClass(this.container, \"ace_focus\");\n };\n VirtualRenderer.prototype.visualizeBlur = function () {\n dom.removeCssClass(this.container, \"ace_focus\");\n };\n VirtualRenderer.prototype.showComposition = function (composition) {\n this.$composition = composition;\n if (!composition.cssText) {\n composition.cssText = this.textarea.style.cssText;\n }\n if (composition.useTextareaForIME == undefined)\n composition.useTextareaForIME = this.$useTextareaForIME;\n if (this.$useTextareaForIME) {\n dom.addCssClass(this.textarea, \"ace_composition\");\n this.textarea.style.cssText = \"\";\n this.$moveTextAreaToCursor();\n this.$cursorLayer.element.style.display = \"none\";\n }\n else {\n composition.markerId = this.session.addMarker(composition.markerRange, \"ace_composition_marker\", \"text\");\n }\n };\n VirtualRenderer.prototype.setCompositionText = function (text) {\n var cursor = this.session.selection.cursor;\n this.addToken(text, \"composition_placeholder\", cursor.row, cursor.column);\n this.$moveTextAreaToCursor();\n };\n VirtualRenderer.prototype.hideComposition = function () {\n if (!this.$composition)\n return;\n if (this.$composition.markerId)\n this.session.removeMarker(this.$composition.markerId);\n dom.removeCssClass(this.textarea, \"ace_composition\");\n this.textarea.style.cssText = this.$composition.cssText;\n var cursor = this.session.selection.cursor;\n this.removeExtraToken(cursor.row, cursor.column);\n this.$composition = null;\n this.$cursorLayer.element.style.display = \"\";\n };\n VirtualRenderer.prototype.setGhostText = function (text, position) {\n var cursor = this.session.selection.cursor;\n var insertPosition = position || { row: cursor.row, column: cursor.column };\n this.removeGhostText();\n var textChunks = this.$calculateWrappedTextChunks(text, insertPosition);\n this.addToken(textChunks[0].text, \"ghost_text\", insertPosition.row, insertPosition.column);\n this.$ghostText = {\n text: text,\n position: {\n row: insertPosition.row,\n column: insertPosition.column\n }\n };\n if (textChunks.length > 1) {\n var divs = textChunks.slice(1).map(function (el) {\n return \"\").concat(el.text, \"\");\n });\n this.$ghostTextWidget = {\n html: divs.join(\"\"),\n row: insertPosition.row,\n column: insertPosition.column,\n className: \"ace_ghost_text\"\n };\n this.session.widgetManager.addLineWidget(this.$ghostTextWidget);\n var pixelPosition = this.$cursorLayer.getPixelPosition(insertPosition, true);\n var el = this.container;\n var height = el.getBoundingClientRect().height;\n var ghostTextHeight = textChunks.length * this.lineHeight;\n var fitsY = ghostTextHeight < (height - pixelPosition.top);\n if (fitsY)\n return;\n if (ghostTextHeight < height) {\n this.scrollBy(0, (textChunks.length - 1) * this.lineHeight);\n }\n else {\n this.scrollToRow(insertPosition.row);\n }\n }\n };\n VirtualRenderer.prototype.$calculateWrappedTextChunks = function (text, position) {\n var availableWidth = this.$size.scrollerWidth - this.$padding * 2;\n var limit = Math.floor(availableWidth / this.characterWidth) - 2;\n limit = limit <= 0 ? 60 : limit; // this is a hack to prevent the editor from crashing when the window is too small\n var textLines = text.split(/\\r?\\n/);\n var textChunks = [];\n for (var i = 0; i < textLines.length; i++) {\n var displayTokens = this.session.$getDisplayTokens(textLines[i], position.column);\n var wrapSplits = this.session.$computeWrapSplits(displayTokens, limit, this.session.$tabSize);\n if (wrapSplits.length > 0) {\n var start = 0;\n wrapSplits.push(textLines[i].length);\n for (var j = 0; j < wrapSplits.length; j++) {\n var textSlice = textLines[i].slice(start, wrapSplits[j]);\n textChunks.push({ text: textSlice, wrapped: true });\n start = wrapSplits[j];\n }\n }\n else {\n textChunks.push({ text: textLines[i], wrapped: false });\n }\n }\n return textChunks;\n };\n VirtualRenderer.prototype.removeGhostText = function () {\n if (!this.$ghostText)\n return;\n var position = this.$ghostText.position;\n this.removeExtraToken(position.row, position.column);\n if (this.$ghostTextWidget) {\n this.session.widgetManager.removeLineWidget(this.$ghostTextWidget);\n this.$ghostTextWidget = null;\n }\n this.$ghostText = null;\n };\n VirtualRenderer.prototype.addToken = function (text, type, row, column) {\n var session = this.session;\n session.bgTokenizer.lines[row] = null;\n var newToken = { type: type, value: text };\n var tokens = session.getTokens(row);\n if (column == null || !tokens.length) {\n tokens.push(newToken);\n }\n else {\n var l = 0;\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n l += token.value.length;\n if (column <= l) {\n var diff = token.value.length - (l - column);\n var before = token.value.slice(0, diff);\n var after = token.value.slice(diff);\n tokens.splice(i, 1, { type: token.type, value: before }, newToken, { type: token.type, value: after });\n break;\n }\n }\n }\n this.updateLines(row, row);\n };\n VirtualRenderer.prototype.removeExtraToken = function (row, column) {\n this.session.bgTokenizer.lines[row] = null;\n this.updateLines(row, row);\n };\n VirtualRenderer.prototype.setTheme = function (theme, cb) {\n var _self = this;\n this.$themeId = theme;\n _self._dispatchEvent('themeChange', { theme: theme });\n if (!theme || typeof theme == \"string\") {\n var moduleName = theme || this.$options.theme.initialValue;\n config.loadModule([\"theme\", moduleName], afterLoad);\n }\n else {\n afterLoad(theme);\n }\n function afterLoad(module) {\n if (_self.$themeId != theme)\n return cb && cb();\n if (!module || !module.cssClass)\n throw new Error(\"couldn't load module \" + theme + \" or it didn't call define\");\n if (module.$id)\n _self.$themeId = module.$id;\n dom.importCssString(module.cssText, module.cssClass, _self.container);\n if (_self.theme)\n dom.removeCssClass(_self.container, _self.theme.cssClass);\n var padding = \"padding\" in module ? module.padding\n : \"padding\" in (_self.theme || {}) ? 4 : _self.$padding;\n if (_self.$padding && padding != _self.$padding)\n _self.setPadding(padding);\n _self.$theme = module.cssClass;\n _self.theme = module;\n dom.addCssClass(_self.container, module.cssClass);\n dom.setCssClass(_self.container, \"ace_dark\", module.isDark);\n if (_self.$size) {\n _self.$size.width = 0;\n _self.$updateSizeAsync();\n }\n _self._dispatchEvent('themeLoaded', { theme: module });\n cb && cb();\n }\n };\n VirtualRenderer.prototype.getTheme = function () {\n return this.$themeId;\n };\n VirtualRenderer.prototype.setStyle = function (style, include) {\n dom.setCssClass(this.container, style, include !== false);\n };\n VirtualRenderer.prototype.unsetStyle = function (style) {\n dom.removeCssClass(this.container, style);\n };\n VirtualRenderer.prototype.setCursorStyle = function (style) {\n dom.setStyle(this.scroller.style, \"cursor\", style);\n };\n VirtualRenderer.prototype.setMouseCursor = function (cursorStyle) {\n dom.setStyle(this.scroller.style, \"cursor\", cursorStyle);\n };\n VirtualRenderer.prototype.attachToShadowRoot = function () {\n dom.importCssString(editorCss, \"ace_editor.css\", this.container);\n };\n VirtualRenderer.prototype.destroy = function () {\n this.freeze();\n this.$fontMetrics.destroy();\n this.$cursorLayer.destroy();\n this.removeAllListeners();\n this.container.textContent = \"\";\n this.setOption(\"useResizeObserver\", false);\n };\n VirtualRenderer.prototype.$updateCustomScrollbar = function (val) {\n var _self = this;\n this.$horizScroll = this.$vScroll = null;\n this.scrollBarV.element.remove();\n this.scrollBarH.element.remove();\n if (this.$scrollDecorator) {\n delete this.$scrollDecorator;\n }\n if (val === true) {\n this.scrollBarV = new VScrollBarCustom(this.container, this);\n this.scrollBarH = new HScrollBarCustom(this.container, this);\n this.scrollBarV.setHeight(this.$size.scrollerHeight);\n this.scrollBarH.setWidth(this.$size.scrollerWidth);\n this.scrollBarV.addEventListener(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollTop(e.data - _self.scrollMargin.top);\n });\n this.scrollBarH.addEventListener(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollLeft(e.data - _self.scrollMargin.left);\n });\n this.$scrollDecorator = new Decorator(this.scrollBarV, this);\n this.$scrollDecorator.$updateDecorators();\n }\n else {\n this.scrollBarV = new VScrollBar(this.container, this);\n this.scrollBarH = new HScrollBar(this.container, this);\n this.scrollBarV.addEventListener(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollTop(e.data - _self.scrollMargin.top);\n });\n this.scrollBarH.addEventListener(\"scroll\", function (e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollLeft(e.data - _self.scrollMargin.left);\n });\n }\n };\n VirtualRenderer.prototype.$addResizeObserver = function () {\n if (!window.ResizeObserver || this.$resizeObserver)\n return;\n var self = this;\n this.$resizeTimer = lang.delayedCall(function () {\n if (!self.destroyed)\n self.onResize();\n }, 50);\n this.$resizeObserver = new window.ResizeObserver(function (e) {\n var w = e[0].contentRect.width;\n var h = e[0].contentRect.height;\n if (Math.abs(self.$size.width - w) > 1\n || Math.abs(self.$size.height - h) > 1) {\n self.$resizeTimer.delay();\n }\n else {\n self.$resizeTimer.cancel();\n }\n });\n this.$resizeObserver.observe(this.container);\n };\n return VirtualRenderer;\n}());\nVirtualRenderer.prototype.CHANGE_CURSOR = 1;\nVirtualRenderer.prototype.CHANGE_MARKER = 2;\nVirtualRenderer.prototype.CHANGE_GUTTER = 4;\nVirtualRenderer.prototype.CHANGE_SCROLL = 8;\nVirtualRenderer.prototype.CHANGE_LINES = 16;\nVirtualRenderer.prototype.CHANGE_TEXT = 32;\nVirtualRenderer.prototype.CHANGE_SIZE = 64;\nVirtualRenderer.prototype.CHANGE_MARKER_BACK = 128;\nVirtualRenderer.prototype.CHANGE_MARKER_FRONT = 256;\nVirtualRenderer.prototype.CHANGE_FULL = 512;\nVirtualRenderer.prototype.CHANGE_H_SCROLL = 1024;\nVirtualRenderer.prototype.$changes = 0;\nVirtualRenderer.prototype.$padding = null;\nVirtualRenderer.prototype.$frozen = false;\nVirtualRenderer.prototype.STEPS = 8;\noop.implement(VirtualRenderer.prototype, EventEmitter);\nconfig.defineOptions(VirtualRenderer.prototype, \"renderer\", {\n useResizeObserver: {\n set: function (value) {\n if (!value && this.$resizeObserver) {\n this.$resizeObserver.disconnect();\n this.$resizeTimer.cancel();\n this.$resizeTimer = this.$resizeObserver = null;\n }\n else if (value && !this.$resizeObserver) {\n this.$addResizeObserver();\n }\n }\n },\n animatedScroll: { initialValue: false },\n showInvisibles: {\n set: function (value) {\n if (this.$textLayer.setShowInvisibles(value))\n this.$loop.schedule(this.CHANGE_TEXT);\n },\n initialValue: false\n },\n showPrintMargin: {\n set: function () { this.$updatePrintMargin(); },\n initialValue: true\n },\n printMarginColumn: {\n set: function () { this.$updatePrintMargin(); },\n initialValue: 80\n },\n printMargin: {\n set: function (val) {\n if (typeof val == \"number\")\n this.$printMarginColumn = val;\n this.$showPrintMargin = !!val;\n this.$updatePrintMargin();\n },\n get: function () {\n return this.$showPrintMargin && this.$printMarginColumn;\n }\n },\n showGutter: {\n set: function (show) {\n this.$gutter.style.display = show ? \"block\" : \"none\";\n this.$loop.schedule(this.CHANGE_FULL);\n this.onGutterResize();\n },\n initialValue: true\n },\n useSvgGutterIcons: {\n set: function (value) {\n this.$gutterLayer.$useSvgGutterIcons = value;\n },\n initialValue: false\n },\n showFoldedAnnotations: {\n set: function (value) {\n this.$gutterLayer.$showFoldedAnnotations = value;\n },\n initialValue: false\n },\n fadeFoldWidgets: {\n set: function (show) {\n dom.setCssClass(this.$gutter, \"ace_fade-fold-widgets\", show);\n },\n initialValue: false\n },\n showFoldWidgets: {\n set: function (show) {\n this.$gutterLayer.setShowFoldWidgets(show);\n this.$loop.schedule(this.CHANGE_GUTTER);\n },\n initialValue: true\n },\n displayIndentGuides: {\n set: function (show) {\n if (this.$textLayer.setDisplayIndentGuides(show))\n this.$loop.schedule(this.CHANGE_TEXT);\n },\n initialValue: true\n },\n highlightIndentGuides: {\n set: function (show) {\n if (this.$textLayer.setHighlightIndentGuides(show) == true) {\n this.$textLayer.$highlightIndentGuide();\n }\n else {\n this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells);\n }\n },\n initialValue: true\n },\n highlightGutterLine: {\n set: function (shouldHighlight) {\n this.$gutterLayer.setHighlightGutterLine(shouldHighlight);\n this.$loop.schedule(this.CHANGE_GUTTER);\n },\n initialValue: true\n },\n hScrollBarAlwaysVisible: {\n set: function (val) {\n if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll)\n this.$loop.schedule(this.CHANGE_SCROLL);\n },\n initialValue: false\n },\n vScrollBarAlwaysVisible: {\n set: function (val) {\n if (!this.$vScrollBarAlwaysVisible || !this.$vScroll)\n this.$loop.schedule(this.CHANGE_SCROLL);\n },\n initialValue: false\n },\n fontSize: {\n set: function (size) {\n if (typeof size == \"number\")\n size = size + \"px\";\n this.container.style.fontSize = size;\n this.updateFontSize();\n },\n initialValue: 12\n },\n fontFamily: {\n set: function (name) {\n this.container.style.fontFamily = name;\n this.updateFontSize();\n }\n },\n maxLines: {\n set: function (val) {\n this.updateFull();\n }\n },\n minLines: {\n set: function (val) {\n if (!(this.$minLines < 0x1ffffffffffff))\n this.$minLines = 0;\n this.updateFull();\n }\n },\n maxPixelHeight: {\n set: function (val) {\n this.updateFull();\n },\n initialValue: 0\n },\n scrollPastEnd: {\n set: function (val) {\n val = +val || 0;\n if (this.$scrollPastEnd == val)\n return;\n this.$scrollPastEnd = val;\n this.$loop.schedule(this.CHANGE_SCROLL);\n },\n initialValue: 0,\n handlesSet: true\n },\n fixedWidthGutter: {\n set: function (val) {\n this.$gutterLayer.$fixedWidth = !!val;\n this.$loop.schedule(this.CHANGE_GUTTER);\n }\n },\n customScrollbar: {\n set: function (val) {\n this.$updateCustomScrollbar(val);\n },\n initialValue: false\n },\n theme: {\n set: function (val) { this.setTheme(val); },\n get: function () { return this.$themeId || this.theme; },\n initialValue: \"./theme/textmate\",\n handlesSet: true\n },\n hasCssTransforms: {},\n useTextareaForIME: {\n initialValue: !useragent.isMobile && !useragent.isIE\n }\n});\nexports.VirtualRenderer = VirtualRenderer;\n\n});\n\nace.define(\"ace/worker/worker_client\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/net\",\"ace/lib/event_emitter\",\"ace/config\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar net = require(\"../lib/net\");\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar config = require(\"../config\");\n\nfunction $workerBlob(workerUrl) {\n var script = \"importScripts('\" + net.qualifyURL(workerUrl) + \"');\";\n try {\n return new Blob([script], {\"type\": \"application/javascript\"});\n } catch (e) { // Backwards-compatibility\n var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;\n var blobBuilder = new BlobBuilder();\n blobBuilder.append(script);\n return blobBuilder.getBlob(\"application/javascript\");\n }\n}\n\nfunction createWorker(workerUrl) {\n if (typeof Worker == \"undefined\")\n return { postMessage: function() {}, terminate: function() {} };\n if (config.get(\"loadWorkerFromBlob\")) {\n var blob = $workerBlob(workerUrl);\n var URL = window.URL || window.webkitURL;\n var blobURL = URL.createObjectURL(blob);\n return new Worker(blobURL);\n }\n return new Worker(workerUrl);\n}\n\nvar WorkerClient = function(worker) {\n if (!worker.postMessage)\n worker = this.$createWorkerFromOldConfig.apply(this, arguments);\n\n this.$worker = worker;\n this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this);\n this.changeListener = this.changeListener.bind(this);\n this.onMessage = this.onMessage.bind(this);\n\n this.callbackId = 1;\n this.callbacks = {};\n\n this.$worker.onmessage = this.onMessage;\n};\n\n(function(){\n\n oop.implement(this, EventEmitter);\n\n this.$createWorkerFromOldConfig = function(topLevelNamespaces, mod, classname, workerUrl, importScripts) {\n if (require.nameToUrl && !require.toUrl)\n require.toUrl = require.nameToUrl;\n\n if (config.get(\"packaged\") || !require.toUrl) {\n workerUrl = workerUrl || config.moduleUrl(mod, \"worker\");\n } else {\n var normalizePath = this.$normalizePath;\n workerUrl = workerUrl || normalizePath(require.toUrl(\"ace/worker/worker.js\", null, \"_\"));\n\n var tlns = {};\n topLevelNamespaces.forEach(function(ns) {\n tlns[ns] = normalizePath(require.toUrl(ns, null, \"_\").replace(/(\\.js)?(\\?.*)?$/, \"\"));\n });\n }\n\n this.$worker = createWorker(workerUrl);\n if (importScripts) {\n this.send(\"importScripts\", importScripts);\n }\n this.$worker.postMessage({\n init : true,\n tlns : tlns,\n module : mod,\n classname : classname\n });\n return this.$worker;\n };\n\n this.onMessage = function(e) {\n var msg = e.data;\n switch (msg.type) {\n case \"event\":\n this._signal(msg.name, {data: msg.data});\n break;\n case \"call\":\n var callback = this.callbacks[msg.id];\n if (callback) {\n callback(msg.data);\n delete this.callbacks[msg.id];\n }\n break;\n case \"error\":\n this.reportError(msg.data);\n break;\n case \"log\":\n window.console && console.log && console.log.apply(console, msg.data);\n break;\n }\n };\n \n this.reportError = function(err) {\n window.console && console.error && console.error(err);\n };\n\n this.$normalizePath = function(path) {\n return net.qualifyURL(path);\n };\n\n this.terminate = function() {\n this._signal(\"terminate\", {});\n this.deltaQueue = null;\n this.$worker.terminate();\n this.$worker.onerror = function(e) {\n e.preventDefault();\n };\n this.$worker = null;\n if (this.$doc)\n this.$doc.off(\"change\", this.changeListener);\n this.$doc = null;\n };\n\n this.send = function(cmd, args) {\n this.$worker.postMessage({command: cmd, args: args});\n };\n\n this.call = function(cmd, args, callback) {\n if (callback) {\n var id = this.callbackId++;\n this.callbacks[id] = callback;\n args.push(id);\n }\n this.send(cmd, args);\n };\n\n this.emit = function(event, data) {\n try {\n if (data.data && data.data.err)\n data.data.err = {message: data.data.err.message, stack: data.data.err.stack, code: data.data.err.code};\n this.$worker && this.$worker.postMessage({event: event, data: {data: data.data}});\n }\n catch(ex) {\n console.error(ex.stack);\n }\n };\n\n this.attachToDocument = function(doc) {\n if (this.$doc)\n this.terminate();\n\n this.$doc = doc;\n this.call(\"setValue\", [doc.getValue()]);\n doc.on(\"change\", this.changeListener, true);\n };\n\n this.changeListener = function(delta) {\n if (!this.deltaQueue) {\n this.deltaQueue = [];\n setTimeout(this.$sendDeltaQueue, 0);\n }\n if (delta.action == \"insert\")\n this.deltaQueue.push(delta.start, delta.lines);\n else\n this.deltaQueue.push(delta.start, delta.end);\n };\n\n this.$sendDeltaQueue = function() {\n var q = this.deltaQueue;\n if (!q) return;\n this.deltaQueue = null;\n if (q.length > 50 && q.length > this.$doc.getLength() >> 1) {\n this.call(\"setValue\", [this.$doc.getValue()]);\n } else\n this.emit(\"change\", {data: q});\n };\n\n}).call(WorkerClient.prototype);\n\n\nvar UIWorkerClient = function(topLevelNamespaces, mod, classname) {\n var main = null;\n var emitSync = false;\n var sender = Object.create(EventEmitter);\n\n var messageBuffer = [];\n var workerClient = new WorkerClient({\n messageBuffer: messageBuffer,\n terminate: function() {},\n postMessage: function(e) {\n messageBuffer.push(e);\n if (!main) return;\n if (emitSync)\n setTimeout(processNext);\n else\n processNext();\n }\n });\n\n workerClient.setEmitSync = function(val) { emitSync = val; };\n\n var processNext = function() {\n var msg = messageBuffer.shift();\n if (msg.command)\n main[msg.command].apply(main, msg.args);\n else if (msg.event)\n sender._signal(msg.event, msg.data);\n };\n\n sender.postMessage = function(msg) {\n workerClient.onMessage({data: msg});\n };\n sender.callback = function(data, callbackId) {\n this.postMessage({type: \"call\", id: callbackId, data: data});\n };\n sender.emit = function(name, data) {\n this.postMessage({type: \"event\", name: name, data: data});\n };\n\n config.loadModule([\"worker\", mod], function(Main) {\n main = new Main[classname](sender);\n while (messageBuffer.length)\n processNext();\n });\n\n return workerClient;\n};\n\nexports.UIWorkerClient = UIWorkerClient;\nexports.WorkerClient = WorkerClient;\nexports.createWorker = createWorker;\n\n\n});\n\nace.define(\"ace/placeholder\",[\"require\",\"exports\",\"module\",\"ace/range\",\"ace/lib/event_emitter\",\"ace/lib/oop\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"./range\").Range;\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar oop = require(\"./lib/oop\");\nvar PlaceHolder = /** @class */ (function () {\n function PlaceHolder(session, length, pos, others, mainClass, othersClass) {\n var _self = this;\n this.length = length;\n this.session = session;\n this.doc = session.getDocument();\n this.mainClass = mainClass;\n this.othersClass = othersClass;\n this.$onUpdate = this.onUpdate.bind(this);\n this.doc.on(\"change\", this.$onUpdate, true);\n this.$others = others;\n this.$onCursorChange = function () {\n setTimeout(function () {\n _self.onCursorChange();\n });\n };\n this.$pos = pos;\n var undoStack = session.getUndoManager().$undoStack || session.getUndoManager()[\"$undostack\"] || { length: -1 };\n this.$undoStackDepth = undoStack.length;\n this.setup();\n session.selection.on(\"changeCursor\", this.$onCursorChange);\n }\n PlaceHolder.prototype.setup = function () {\n var _self = this;\n var doc = this.doc;\n var session = this.session;\n this.selectionBefore = session.selection.toJSON();\n if (session.selection.inMultiSelectMode)\n session.selection.toSingleRange();\n this.pos = doc.createAnchor(this.$pos.row, this.$pos.column);\n var pos = this.pos;\n pos.$insertRight = true;\n pos.detach();\n pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false);\n this.others = [];\n this.$others.forEach(function (other) {\n var anchor = doc.createAnchor(other.row, other.column);\n anchor.$insertRight = true;\n anchor.detach();\n _self.others.push(anchor);\n });\n session.setUndoSelect(false);\n };\n PlaceHolder.prototype.showOtherMarkers = function () {\n if (this.othersActive)\n return;\n var session = this.session;\n var _self = this;\n this.othersActive = true;\n this.others.forEach(function (anchor) {\n anchor.markerId = session.addMarker(new Range(anchor.row, anchor.column, anchor.row, anchor.column + _self.length), _self.othersClass, null, false);\n });\n };\n PlaceHolder.prototype.hideOtherMarkers = function () {\n if (!this.othersActive)\n return;\n this.othersActive = false;\n for (var i = 0; i < this.others.length; i++) {\n this.session.removeMarker(this.others[i].markerId);\n }\n };\n PlaceHolder.prototype.onUpdate = function (delta) {\n if (this.$updating)\n return this.updateAnchors(delta);\n var range = delta;\n if (range.start.row !== range.end.row)\n return;\n if (range.start.row !== this.pos.row)\n return;\n this.$updating = true;\n var lengthDiff = delta.action === \"insert\" ? range.end.column - range.start.column : range.start.column - range.end.column;\n var inMainRange = range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1;\n var distanceFromStart = range.start.column - this.pos.column;\n this.updateAnchors(delta);\n if (inMainRange)\n this.length += lengthDiff;\n if (inMainRange && !this.session.$fromUndo) {\n if (delta.action === 'insert') {\n for (var i = this.others.length - 1; i >= 0; i--) {\n var otherPos = this.others[i];\n var newPos = { row: otherPos.row, column: otherPos.column + distanceFromStart };\n this.doc.insertMergedLines(newPos, delta.lines);\n }\n }\n else if (delta.action === 'remove') {\n for (var i = this.others.length - 1; i >= 0; i--) {\n var otherPos = this.others[i];\n var newPos = { row: otherPos.row, column: otherPos.column + distanceFromStart };\n this.doc.remove(new Range(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff));\n }\n }\n }\n this.$updating = false;\n this.updateMarkers();\n };\n PlaceHolder.prototype.updateAnchors = function (delta) {\n this.pos.onChange(delta);\n for (var i = this.others.length; i--;)\n this.others[i].onChange(delta);\n this.updateMarkers();\n };\n PlaceHolder.prototype.updateMarkers = function () {\n if (this.$updating)\n return;\n var _self = this;\n var session = this.session;\n var updateMarker = function (pos, className) {\n session.removeMarker(pos.markerId);\n pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + _self.length), className, null, false);\n };\n updateMarker(this.pos, this.mainClass);\n for (var i = this.others.length; i--;)\n updateMarker(this.others[i], this.othersClass);\n };\n PlaceHolder.prototype.onCursorChange = function (event) {\n if (this.$updating || !this.session)\n return;\n var pos = this.session.selection.getCursor();\n if (pos.row === this.pos.row && pos.column >= this.pos.column && pos.column <= this.pos.column + this.length) {\n this.showOtherMarkers();\n this._emit(\"cursorEnter\", event);\n }\n else {\n this.hideOtherMarkers();\n this._emit(\"cursorLeave\", event);\n }\n };\n PlaceHolder.prototype.detach = function () {\n this.session.removeMarker(this.pos && this.pos.markerId);\n this.hideOtherMarkers();\n this.doc.off(\"change\", this.$onUpdate);\n this.session.selection.off(\"changeCursor\", this.$onCursorChange);\n this.session.setUndoSelect(true);\n this.session = null;\n };\n PlaceHolder.prototype.cancel = function () {\n if (this.$undoStackDepth === -1)\n return;\n var undoManager = this.session.getUndoManager();\n var undosRequired = (undoManager.$undoStack || undoManager[\"$undostack\"]).length - this.$undoStackDepth;\n for (var i = 0; i < undosRequired; i++) {\n undoManager.undo(this.session, true);\n }\n if (this.selectionBefore)\n this.session.selection.fromJSON(this.selectionBefore);\n };\n return PlaceHolder;\n}());\noop.implement(PlaceHolder.prototype, EventEmitter);\nexports.PlaceHolder = PlaceHolder;\n\n});\n\nace.define(\"ace/mouse/multi_select_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/lib/useragent\"], function(require, exports, module){var event = require(\"../lib/event\");\nvar useragent = require(\"../lib/useragent\");\nfunction isSamePoint(p1, p2) {\n return p1.row == p2.row && p1.column == p2.column;\n}\nfunction onMouseDown(e) {\n var ev = e.domEvent;\n var alt = ev.altKey;\n var shift = ev.shiftKey;\n var ctrl = ev.ctrlKey;\n var accel = e.getAccelKey();\n var button = e.getButton();\n if (ctrl && useragent.isMac)\n button = ev.button;\n if (e.editor.inMultiSelectMode && button == 2) {\n e.editor.textInput.onContextMenu(e.domEvent);\n return;\n }\n if (!ctrl && !alt && !accel) {\n if (button === 0 && e.editor.inMultiSelectMode)\n e.editor.exitMultiSelectMode();\n return;\n }\n if (button !== 0)\n return;\n var editor = e.editor;\n var selection = editor.selection;\n var isMultiSelect = editor.inMultiSelectMode;\n var pos = e.getDocumentPosition();\n var cursor = selection.getCursor();\n var inSelection = e.inSelection() || (selection.isEmpty() && isSamePoint(pos, cursor));\n var mouseX = e.x, mouseY = e.y;\n var onMouseSelection = function (e) {\n mouseX = e.clientX;\n mouseY = e.clientY;\n };\n var session = editor.session;\n var screenAnchor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY);\n var screenCursor = screenAnchor;\n var selectionMode;\n if (editor.$mouseHandler.$enableJumpToDef) {\n if (ctrl && alt || accel && alt)\n selectionMode = shift ? \"block\" : \"add\";\n else if (alt && editor.$blockSelectEnabled)\n selectionMode = \"block\";\n }\n else {\n if (accel && !alt) {\n selectionMode = \"add\";\n if (!isMultiSelect && shift)\n return;\n }\n else if (alt && editor.$blockSelectEnabled) {\n selectionMode = \"block\";\n }\n }\n if (selectionMode && useragent.isMac && ev.ctrlKey) {\n editor.$mouseHandler.cancelContextMenu();\n }\n if (selectionMode == \"add\") {\n if (!isMultiSelect && inSelection)\n return; // dragging\n if (!isMultiSelect) {\n var range = selection.toOrientedRange();\n editor.addSelectionMarker(range);\n }\n var oldRange = selection.rangeList.rangeAtPoint(pos);\n editor.inVirtualSelectionMode = true;\n if (shift) {\n oldRange = null;\n range = selection.ranges[0] || range;\n editor.removeSelectionMarker(range);\n }\n editor.once(\"mouseup\", function () {\n var tmpSel = selection.toOrientedRange();\n if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor))\n selection.substractPoint(tmpSel.cursor);\n else {\n if (shift) {\n selection.substractPoint(range.cursor);\n }\n else if (range) {\n editor.removeSelectionMarker(range);\n selection.addRange(range);\n }\n selection.addRange(tmpSel);\n }\n editor.inVirtualSelectionMode = false;\n });\n }\n else if (selectionMode == \"block\") {\n e.stop();\n editor.inVirtualSelectionMode = true;\n var initialRange;\n var rectSel = [];\n var blockSelect = function () {\n var newCursor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY);\n var cursor = session.screenToDocumentPosition(newCursor.row, newCursor.column, newCursor.offsetX);\n if (isSamePoint(screenCursor, newCursor) && isSamePoint(cursor, selection.lead))\n return;\n screenCursor = newCursor;\n editor.selection.moveToPosition(cursor);\n editor.renderer.scrollCursorIntoView();\n editor.removeSelectionMarkers(rectSel);\n rectSel = selection.rectangularRangeBlock(screenCursor, screenAnchor);\n if (editor.$mouseHandler.$clickSelection && rectSel.length == 1 && rectSel[0].isEmpty())\n rectSel[0] = editor.$mouseHandler.$clickSelection.clone();\n rectSel.forEach(editor.addSelectionMarker, editor);\n editor.updateSelectionMarkers();\n };\n if (isMultiSelect && !accel) {\n selection.toSingleRange();\n }\n else if (!isMultiSelect && accel) {\n initialRange = selection.toOrientedRange();\n editor.addSelectionMarker(initialRange);\n }\n if (shift)\n screenAnchor = session.documentToScreenPosition(selection.lead);\n else\n selection.moveToPosition(pos);\n screenCursor = { row: -1, column: -1 };\n var onMouseSelectionEnd = function (e) {\n blockSelect();\n clearInterval(timerId);\n editor.removeSelectionMarkers(rectSel);\n if (!rectSel.length)\n rectSel = [selection.toOrientedRange()];\n if (initialRange) {\n editor.removeSelectionMarker(initialRange);\n selection.toSingleRange(initialRange);\n }\n for (var i = 0; i < rectSel.length; i++)\n selection.addRange(rectSel[i]);\n editor.inVirtualSelectionMode = false;\n editor.$mouseHandler.$clickSelection = null;\n };\n var onSelectionInterval = blockSelect;\n event.capture(editor.container, onMouseSelection, onMouseSelectionEnd);\n var timerId = setInterval(function () { onSelectionInterval(); }, 20);\n return e.preventDefault();\n }\n}\nexports.onMouseDown = onMouseDown;\n\n});\n\nace.define(\"ace/commands/multi_select_commands\",[\"require\",\"exports\",\"module\",\"ace/keyboard/hash_handler\"], function(require, exports, module){/**\n * commands to enter multiselect mode\n * @type {import(\"../../ace-internal\").Ace.Command[]}\n */\nexports.defaultCommands = [{\n name: \"addCursorAbove\",\n description: \"Add cursor above\",\n exec: function (editor) { editor.selectMoreLines(-1); },\n bindKey: { win: \"Ctrl-Alt-Up\", mac: \"Ctrl-Alt-Up\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"addCursorBelow\",\n description: \"Add cursor below\",\n exec: function (editor) { editor.selectMoreLines(1); },\n bindKey: { win: \"Ctrl-Alt-Down\", mac: \"Ctrl-Alt-Down\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"addCursorAboveSkipCurrent\",\n description: \"Add cursor above (skip current)\",\n exec: function (editor) { editor.selectMoreLines(-1, true); },\n bindKey: { win: \"Ctrl-Alt-Shift-Up\", mac: \"Ctrl-Alt-Shift-Up\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"addCursorBelowSkipCurrent\",\n description: \"Add cursor below (skip current)\",\n exec: function (editor) { editor.selectMoreLines(1, true); },\n bindKey: { win: \"Ctrl-Alt-Shift-Down\", mac: \"Ctrl-Alt-Shift-Down\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectMoreBefore\",\n description: \"Select more before\",\n exec: function (editor) { editor.selectMore(-1); },\n bindKey: { win: \"Ctrl-Alt-Left\", mac: \"Ctrl-Alt-Left\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectMoreAfter\",\n description: \"Select more after\",\n exec: function (editor) { editor.selectMore(1); },\n bindKey: { win: \"Ctrl-Alt-Right\", mac: \"Ctrl-Alt-Right\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectNextBefore\",\n description: \"Select next before\",\n exec: function (editor) { editor.selectMore(-1, true); },\n bindKey: { win: \"Ctrl-Alt-Shift-Left\", mac: \"Ctrl-Alt-Shift-Left\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"selectNextAfter\",\n description: \"Select next after\",\n exec: function (editor) { editor.selectMore(1, true); },\n bindKey: { win: \"Ctrl-Alt-Shift-Right\", mac: \"Ctrl-Alt-Shift-Right\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }, {\n name: \"toggleSplitSelectionIntoLines\",\n description: \"Split selection into lines\",\n exec: function (editor) {\n if (editor.multiSelect.rangeCount > 1)\n editor.multiSelect.joinSelections();\n else\n editor.multiSelect.splitIntoLines();\n },\n bindKey: { win: \"Ctrl-Alt-L\", mac: \"Ctrl-Alt-L\" },\n readOnly: true\n }, {\n name: \"splitSelectionIntoLines\",\n description: \"Split into lines\",\n exec: function (editor) { editor.multiSelect.splitIntoLines(); },\n readOnly: true\n }, {\n name: \"alignCursors\",\n description: \"Align cursors\",\n exec: function (editor) { editor.alignCursors(); },\n bindKey: { win: \"Ctrl-Alt-A\", mac: \"Ctrl-Alt-A\" },\n scrollIntoView: \"cursor\"\n }, {\n name: \"findAll\",\n description: \"Find all\",\n exec: function (editor) { editor.findAll(); },\n bindKey: { win: \"Ctrl-Alt-K\", mac: \"Ctrl-Alt-G\" },\n scrollIntoView: \"cursor\",\n readOnly: true\n }];\nexports.multiSelectCommands = [{\n name: \"singleSelection\",\n description: \"Single selection\",\n bindKey: \"esc\",\n exec: function (editor) { editor.exitMultiSelectMode(); },\n scrollIntoView: \"cursor\",\n readOnly: true,\n isAvailable: function (editor) { return editor && editor.inMultiSelectMode; }\n }];\nvar HashHandler = require(\"../keyboard/hash_handler\").HashHandler;\nexports.keyboardHandler = new HashHandler(exports.multiSelectCommands);\n\n});\n\nace.define(\"ace/multi_select\",[\"require\",\"exports\",\"module\",\"ace/range_list\",\"ace/range\",\"ace/selection\",\"ace/mouse/multi_select_handler\",\"ace/lib/event\",\"ace/lib/lang\",\"ace/commands/multi_select_commands\",\"ace/search\",\"ace/edit_session\",\"ace/editor\",\"ace/config\"], function(require, exports, module){/**\n * @typedef {import(\"./anchor\").Anchor} Anchor\n * @typedef {import(\"../ace-internal\").Ace.Point} Point\n * @typedef {import(\"../ace-internal\").Ace.ScreenCoordinates} ScreenCoordinates\n */\nvar RangeList = require(\"./range_list\").RangeList;\nvar Range = require(\"./range\").Range;\nvar Selection = require(\"./selection\").Selection;\nvar onMouseDown = require(\"./mouse/multi_select_handler\").onMouseDown;\nvar event = require(\"./lib/event\");\nvar lang = require(\"./lib/lang\");\nvar commands = require(\"./commands/multi_select_commands\");\nexports.commands = commands.defaultCommands.concat(commands.multiSelectCommands);\nvar Search = require(\"./search\").Search;\nvar search = new Search();\nfunction find(session, needle, dir) {\n search.$options.wrap = true;\n search.$options.needle = needle;\n search.$options.backwards = dir == -1;\n return search.find(session);\n}\nvar EditSession = require(\"./edit_session\").EditSession;\n(function () {\n this.getSelectionMarkers = function () {\n return this.$selectionMarkers;\n };\n}).call(EditSession.prototype);\n(function () {\n this.ranges = null;\n this.rangeList = null;\n this.addRange = function (range, $blockChangeEvents) {\n if (!range)\n return;\n if (!this.inMultiSelectMode && this.rangeCount === 0) {\n var oldRange = this.toOrientedRange();\n this.rangeList.add(oldRange);\n this.rangeList.add(range);\n if (this.rangeList.ranges.length != 2) {\n this.rangeList.removeAll();\n return $blockChangeEvents || this.fromOrientedRange(range);\n }\n this.rangeList.removeAll();\n this.rangeList.add(oldRange);\n this.$onAddRange(oldRange);\n }\n if (!range.cursor)\n range.cursor = range.end;\n var removed = this.rangeList.add(range);\n this.$onAddRange(range);\n if (removed.length)\n this.$onRemoveRange(removed);\n if (this.rangeCount > 1 && !this.inMultiSelectMode) {\n this._signal(\"multiSelect\");\n this.inMultiSelectMode = true;\n this.session.$undoSelect = false;\n this.rangeList.attach(this.session);\n }\n return $blockChangeEvents || this.fromOrientedRange(range);\n };\n this.toSingleRange = function (range) {\n range = range || this.ranges[0];\n var removed = this.rangeList.removeAll();\n if (removed.length)\n this.$onRemoveRange(removed);\n range && this.fromOrientedRange(range);\n };\n this.substractPoint = function (pos) {\n var removed = this.rangeList.substractPoint(pos);\n if (removed) {\n this.$onRemoveRange(removed);\n return removed[0];\n }\n };\n this.mergeOverlappingRanges = function () {\n var removed = this.rangeList.merge();\n if (removed.length)\n this.$onRemoveRange(removed);\n };\n this.$onAddRange = function (range) {\n this.rangeCount = this.rangeList.ranges.length;\n this.ranges.unshift(range);\n this._signal(\"addRange\", { range: range });\n };\n this.$onRemoveRange = function (removed) {\n this.rangeCount = this.rangeList.ranges.length;\n if (this.rangeCount == 1 && this.inMultiSelectMode) {\n var lastRange = this.rangeList.ranges.pop();\n removed.push(lastRange);\n this.rangeCount = 0;\n }\n for (var i = removed.length; i--;) {\n var index = this.ranges.indexOf(removed[i]);\n this.ranges.splice(index, 1);\n }\n this._signal(\"removeRange\", { ranges: removed });\n if (this.rangeCount === 0 && this.inMultiSelectMode) {\n this.inMultiSelectMode = false;\n this._signal(\"singleSelect\");\n this.session.$undoSelect = true;\n this.rangeList.detach(this.session);\n }\n lastRange = lastRange || this.ranges[0];\n if (lastRange && !lastRange.isEqual(this.getRange()))\n this.fromOrientedRange(lastRange);\n };\n this.$initRangeList = function () {\n if (this.rangeList)\n return;\n this.rangeList = new RangeList();\n this.ranges = [];\n this.rangeCount = 0;\n };\n this.getAllRanges = function () {\n return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()];\n };\n this.splitIntoLines = function () {\n var ranges = this.ranges.length ? this.ranges : [this.getRange()];\n var newRanges = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n var row = range.start.row;\n var endRow = range.end.row;\n if (row === endRow) {\n newRanges.push(range.clone());\n }\n else {\n newRanges.push(new Range(row, range.start.column, row, this.session.getLine(row).length));\n while (++row < endRow)\n newRanges.push(this.getLineRange(row, true));\n newRanges.push(new Range(endRow, 0, endRow, range.end.column));\n }\n if (i == 0 && !this.isBackwards())\n newRanges = newRanges.reverse();\n }\n this.toSingleRange();\n for (var i = newRanges.length; i--;)\n this.addRange(newRanges[i]);\n };\n this.joinSelections = function () {\n var ranges = this.rangeList.ranges;\n var lastRange = ranges[ranges.length - 1];\n var range = Range.fromPoints(ranges[0].start, lastRange.end);\n this.toSingleRange();\n this.setSelectionRange(range, lastRange.cursor == lastRange.start);\n };\n this.toggleBlockSelection = function () {\n if (this.rangeCount > 1) {\n var ranges = this.rangeList.ranges;\n var lastRange = ranges[ranges.length - 1];\n var range = Range.fromPoints(ranges[0].start, lastRange.end);\n this.toSingleRange();\n this.setSelectionRange(range, lastRange.cursor == lastRange.start);\n }\n else {\n var cursor = this.session.documentToScreenPosition(this.cursor);\n var anchor = this.session.documentToScreenPosition(this.anchor);\n var rectSel = this.rectangularRangeBlock(cursor, anchor);\n rectSel.forEach(this.addRange, this);\n }\n };\n this.rectangularRangeBlock = function (screenCursor, screenAnchor, includeEmptyLines) {\n var rectSel = [];\n var xBackwards = screenCursor.column < screenAnchor.column;\n if (xBackwards) {\n var startColumn = screenCursor.column;\n var endColumn = screenAnchor.column;\n var startOffsetX = screenCursor.offsetX;\n var endOffsetX = screenAnchor.offsetX;\n }\n else {\n var startColumn = screenAnchor.column;\n var endColumn = screenCursor.column;\n var startOffsetX = screenAnchor.offsetX;\n var endOffsetX = screenCursor.offsetX;\n }\n var yBackwards = screenCursor.row < screenAnchor.row;\n if (yBackwards) {\n var startRow = screenCursor.row;\n var endRow = screenAnchor.row;\n }\n else {\n var startRow = screenAnchor.row;\n var endRow = screenCursor.row;\n }\n if (startColumn < 0)\n startColumn = 0;\n if (startRow < 0)\n startRow = 0;\n if (startRow == endRow)\n includeEmptyLines = true;\n var docEnd;\n for (var row = startRow; row <= endRow; row++) {\n var range = Range.fromPoints(this.session.screenToDocumentPosition(row, startColumn, startOffsetX), this.session.screenToDocumentPosition(row, endColumn, endOffsetX));\n if (range.isEmpty()) {\n if (docEnd && isSamePoint(range.end, docEnd))\n break;\n docEnd = range.end;\n }\n range.cursor = xBackwards ? range.start : range.end;\n rectSel.push(range);\n }\n if (yBackwards)\n rectSel.reverse();\n if (!includeEmptyLines) {\n var end = rectSel.length - 1;\n while (rectSel[end].isEmpty() && end > 0)\n end--;\n if (end > 0) {\n var start = 0;\n while (rectSel[start].isEmpty())\n start++;\n }\n for (var i = end; i >= start; i--) {\n if (rectSel[i].isEmpty())\n rectSel.splice(i, 1);\n }\n }\n return rectSel;\n };\n}).call(Selection.prototype);\nvar Editor = require(\"./editor\").Editor;\n(function () {\n this.updateSelectionMarkers = function () {\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.addSelectionMarker = function (orientedRange) {\n if (!orientedRange.cursor)\n orientedRange.cursor = orientedRange.end;\n var style = this.getSelectionStyle();\n orientedRange.marker = this.session.addMarker(orientedRange, \"ace_selection\", style);\n this.session.$selectionMarkers.push(orientedRange);\n this.session.selectionMarkerCount = this.session.$selectionMarkers.length;\n return orientedRange;\n };\n this.removeSelectionMarker = function (range) {\n if (!range.marker)\n return;\n this.session.removeMarker(range.marker);\n var index = this.session.$selectionMarkers.indexOf(range);\n if (index != -1)\n this.session.$selectionMarkers.splice(index, 1);\n this.session.selectionMarkerCount = this.session.$selectionMarkers.length;\n };\n this.removeSelectionMarkers = function (ranges) {\n var markerList = this.session.$selectionMarkers;\n for (var i = ranges.length; i--;) {\n var range = ranges[i];\n if (!range.marker)\n continue;\n this.session.removeMarker(range.marker);\n var index = markerList.indexOf(range);\n if (index != -1)\n markerList.splice(index, 1);\n }\n this.session.selectionMarkerCount = markerList.length;\n };\n this.$onAddRange = function (e) {\n this.addSelectionMarker(e.range);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.$onRemoveRange = function (e) {\n this.removeSelectionMarkers(e.ranges);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.$onMultiSelect = function (e) {\n if (this.inMultiSelectMode)\n return;\n this.inMultiSelectMode = true;\n this.setStyle(\"ace_multiselect\");\n this.keyBinding.addKeyboardHandler(commands.keyboardHandler);\n this.commands.setDefaultHandler(\"exec\", this.$onMultiSelectExec);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.$onSingleSelect = function (e) {\n if (this.session.multiSelect.inVirtualMode)\n return;\n this.inMultiSelectMode = false;\n this.unsetStyle(\"ace_multiselect\");\n this.keyBinding.removeKeyboardHandler(commands.keyboardHandler);\n this.commands.removeDefaultHandler(\"exec\", this.$onMultiSelectExec);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n this._emit(\"changeSelection\");\n };\n this.$onMultiSelectExec = function (e) {\n var command = e.command;\n var editor = e.editor;\n if (!editor.multiSelect)\n return;\n if (!command.multiSelectAction) {\n var result = command.exec(editor, e.args || {});\n editor.multiSelect.addRange(editor.multiSelect.toOrientedRange());\n editor.multiSelect.mergeOverlappingRanges();\n }\n else if (command.multiSelectAction == \"forEach\") {\n result = editor.forEachSelection(command, e.args);\n }\n else if (command.multiSelectAction == \"forEachLine\") {\n result = editor.forEachSelection(command, e.args, true);\n }\n else if (command.multiSelectAction == \"single\") {\n editor.exitMultiSelectMode();\n result = command.exec(editor, e.args || {});\n }\n else {\n result = command.multiSelectAction(editor, e.args || {});\n }\n return result;\n };\n this.forEachSelection = function (cmd, args, options) {\n if (this.inVirtualSelectionMode)\n return;\n var keepOrder = options && options.keepOrder;\n var $byLines = options == true || options && options.$byLines;\n var session = this.session;\n var selection = this.selection;\n var rangeList = selection.rangeList;\n var ranges = (keepOrder ? selection : rangeList).ranges;\n var result;\n if (!ranges.length)\n return cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {});\n var reg = selection._eventRegistry;\n selection._eventRegistry = {};\n var tmpSel = new Selection(session);\n this.inVirtualSelectionMode = true;\n for (var i = ranges.length; i--;) {\n if ($byLines) {\n while (i > 0 && ranges[i].start.row == ranges[i - 1].end.row)\n i--;\n }\n tmpSel.fromOrientedRange(ranges[i]);\n tmpSel.index = i;\n this.selection = session.selection = tmpSel;\n var cmdResult = cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {});\n if (!result && cmdResult !== undefined)\n result = cmdResult;\n tmpSel.toOrientedRange(ranges[i]);\n }\n tmpSel.detach();\n this.selection = session.selection = selection;\n this.inVirtualSelectionMode = false;\n selection._eventRegistry = reg;\n selection.mergeOverlappingRanges();\n if (selection.ranges[0])\n selection.fromOrientedRange(selection.ranges[0]);\n var anim = this.renderer.$scrollAnimation;\n this.onCursorChange();\n this.onSelectionChange();\n if (anim && anim.from == anim.to)\n this.renderer.animateScrolling(anim.from);\n return result;\n };\n this.exitMultiSelectMode = function () {\n if (!this.inMultiSelectMode || this.inVirtualSelectionMode)\n return;\n this.multiSelect.toSingleRange();\n };\n this.getSelectedText = function () {\n var text = \"\";\n if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {\n var ranges = this.multiSelect.rangeList.ranges;\n var buf = [];\n for (var i = 0; i < ranges.length; i++) {\n buf.push(this.session.getTextRange(ranges[i]));\n }\n var nl = this.session.getDocument().getNewLineCharacter();\n text = buf.join(nl);\n if (text.length == (buf.length - 1) * nl.length)\n text = \"\";\n }\n else if (!this.selection.isEmpty()) {\n text = this.session.getTextRange(this.getSelectionRange());\n }\n return text;\n };\n this.$checkMultiselectChange = function (e, anchor) {\n if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {\n var range = this.multiSelect.ranges[0];\n if (this.multiSelect.isEmpty() && anchor == this.multiSelect.anchor)\n return;\n var pos = anchor == this.multiSelect.anchor\n ? range.cursor == range.start ? range.end : range.start\n : range.cursor;\n if (pos.row != anchor.row\n || this.session.$clipPositionToDocument(pos.row, pos.column).column != anchor.column)\n this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange());\n else\n this.multiSelect.mergeOverlappingRanges();\n }\n };\n this.findAll = function (needle, options, additive) {\n options = options || {};\n options.needle = needle || options.needle;\n if (options.needle == undefined) {\n var range = this.selection.isEmpty()\n ? this.selection.getWordRange()\n : this.selection.getRange();\n options.needle = this.session.getTextRange(range);\n }\n this.$search.set(options);\n var ranges = this.$search.findAll(this.session);\n if (!ranges.length)\n return 0;\n var selection = this.multiSelect;\n if (!additive)\n selection.toSingleRange(ranges[0]);\n for (var i = ranges.length; i--;)\n selection.addRange(ranges[i], true);\n if (range && selection.rangeList.rangeAtPoint(range.start))\n selection.addRange(range, true);\n return ranges.length;\n };\n this.selectMoreLines = function (dir, skip) {\n var range = this.selection.toOrientedRange();\n var isBackwards = range.cursor == range.end;\n var screenLead = this.session.documentToScreenPosition(range.cursor);\n if (this.selection.$desiredColumn)\n screenLead.column = this.selection.$desiredColumn;\n var lead = this.session.screenToDocumentPosition(screenLead.row + dir, screenLead.column);\n if (!range.isEmpty()) {\n var screenAnchor = this.session.documentToScreenPosition(isBackwards ? range.end : range.start);\n var anchor = this.session.screenToDocumentPosition(screenAnchor.row + dir, screenAnchor.column);\n }\n else {\n var anchor = lead;\n }\n if (isBackwards) {\n var newRange = Range.fromPoints(lead, anchor);\n newRange.cursor = newRange.start;\n }\n else {\n var newRange = Range.fromPoints(anchor, lead);\n newRange.cursor = newRange.end;\n }\n newRange.desiredColumn = screenLead.column;\n if (!this.selection.inMultiSelectMode) {\n this.selection.addRange(range);\n }\n else {\n if (skip)\n var toRemove = range.cursor;\n }\n this.selection.addRange(newRange);\n if (toRemove)\n this.selection.substractPoint(toRemove);\n };\n this.transposeSelections = function (dir) {\n var session = this.session;\n var sel = session.multiSelect;\n var all = sel.ranges;\n for (var i = all.length; i--;) {\n var range = all[i];\n if (range.isEmpty()) {\n var tmp_1 = session.getWordRange(range.start.row, range.start.column);\n range.start.row = tmp_1.start.row;\n range.start.column = tmp_1.start.column;\n range.end.row = tmp_1.end.row;\n range.end.column = tmp_1.end.column;\n }\n }\n sel.mergeOverlappingRanges();\n var words = [];\n for (var i = all.length; i--;) {\n var range = all[i];\n words.unshift(session.getTextRange(range));\n }\n if (dir < 0)\n words.unshift(words.pop());\n else\n words.push(words.shift());\n for (var i = all.length; i--;) {\n var range = all[i];\n var tmp = range.clone();\n session.replace(range, words[i]);\n range.start.row = tmp.start.row;\n range.start.column = tmp.start.column;\n }\n sel.fromOrientedRange(sel.ranges[0]);\n };\n this.selectMore = function (dir, skip, stopAtFirst) {\n var session = this.session;\n var sel = session.multiSelect;\n var range = sel.toOrientedRange();\n if (range.isEmpty()) {\n range = session.getWordRange(range.start.row, range.start.column);\n range.cursor = dir == -1 ? range.start : range.end;\n this.multiSelect.addRange(range);\n if (stopAtFirst)\n return;\n }\n var needle = session.getTextRange(range);\n var newRange = find(session, needle, dir);\n if (newRange) {\n newRange.cursor = dir == -1 ? newRange.start : newRange.end;\n this.session.unfold(newRange);\n this.multiSelect.addRange(newRange);\n this.renderer.scrollCursorIntoView(null, 0.5);\n }\n if (skip)\n this.multiSelect.substractPoint(range.cursor);\n };\n this.alignCursors = function () {\n var session = this.session;\n var sel = session.multiSelect;\n var ranges = sel.ranges;\n var row = -1;\n var sameRowRanges = ranges.filter(function (r) {\n if (r.cursor.row == row)\n return true;\n row = r.cursor.row;\n });\n if (!ranges.length || sameRowRanges.length == ranges.length - 1) {\n var range = this.selection.getRange();\n var fr = range.start.row, lr = range.end.row;\n var guessRange = fr == lr;\n if (guessRange) {\n var max = this.session.getLength();\n var line;\n do {\n line = this.session.getLine(lr);\n } while (/[=:]/.test(line) && ++lr < max);\n do {\n line = this.session.getLine(fr);\n } while (/[=:]/.test(line) && --fr > 0);\n if (fr < 0)\n fr = 0;\n if (lr >= max)\n lr = max - 1;\n }\n var lines = this.session.removeFullLines(fr, lr);\n lines = this.$reAlignText(lines, guessRange);\n this.session.insert({ row: fr, column: 0 }, lines.join(\"\\n\") + \"\\n\");\n if (!guessRange) {\n range.start.column = 0;\n range.end.column = lines[lines.length - 1].length;\n }\n this.selection.setRange(range);\n }\n else {\n sameRowRanges.forEach(function (r) {\n sel.substractPoint(r.cursor);\n });\n var maxCol = 0;\n var minSpace = Infinity;\n var spaceOffsets = ranges.map(function (r) {\n var p = r.cursor;\n var line = session.getLine(p.row);\n var spaceOffset = line.substr(p.column).search(/\\S/g);\n if (spaceOffset == -1)\n spaceOffset = 0;\n if (p.column > maxCol)\n maxCol = p.column;\n if (spaceOffset < minSpace)\n minSpace = spaceOffset;\n return spaceOffset;\n });\n ranges.forEach(function (r, i) {\n var p = r.cursor;\n var l = maxCol - p.column;\n var d = spaceOffsets[i] - minSpace;\n if (l > d)\n session.insert(p, lang.stringRepeat(\" \", l - d));\n else\n session.remove(new Range(p.row, p.column, p.row, p.column - l + d));\n r.start.column = r.end.column = maxCol;\n r.start.row = r.end.row = p.row;\n r.cursor = r.end;\n });\n sel.fromOrientedRange(ranges[0]);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n }\n };\n this.$reAlignText = function (lines, forceLeft) {\n var isLeftAligned = true, isRightAligned = true;\n var startW, textW, endW;\n return lines.map(function (line) {\n var m = line.match(/(\\s*)(.*?)(\\s*)([=:].*)/);\n if (!m)\n return [line];\n if (startW == null) {\n startW = m[1].length;\n textW = m[2].length;\n endW = m[3].length;\n return m;\n }\n if (startW + textW + endW != m[1].length + m[2].length + m[3].length)\n isRightAligned = false;\n if (startW != m[1].length)\n isLeftAligned = false;\n if (startW > m[1].length)\n startW = m[1].length;\n if (textW < m[2].length)\n textW = m[2].length;\n if (endW > m[3].length)\n endW = m[3].length;\n return m;\n }).map(forceLeft ? alignLeft :\n isLeftAligned ? isRightAligned ? alignRight : alignLeft : unAlign);\n function spaces(n) {\n return lang.stringRepeat(\" \", n);\n }\n function alignLeft(m) {\n return !m[2] ? m[0] : spaces(startW) + m[2]\n + spaces(textW - m[2].length + endW)\n + m[4].replace(/^([=:])\\s+/, \"$1 \");\n }\n function alignRight(m) {\n return !m[2] ? m[0] : spaces(startW + textW - m[2].length) + m[2]\n + spaces(endW)\n + m[4].replace(/^([=:])\\s+/, \"$1 \");\n }\n function unAlign(m) {\n return !m[2] ? m[0] : spaces(startW) + m[2]\n + spaces(endW)\n + m[4].replace(/^([=:])\\s+/, \"$1 \");\n }\n };\n}).call(Editor.prototype);\nfunction isSamePoint(p1, p2) {\n return p1.row == p2.row && p1.column == p2.column;\n}\nexports.onSessionChange = function (e) {\n var session = e.session;\n if (session && !session.multiSelect) {\n session.$selectionMarkers = [];\n session.selection.$initRangeList();\n session.multiSelect = session.selection;\n }\n this.multiSelect = session && session.multiSelect;\n var oldSession = e.oldSession;\n if (oldSession) {\n oldSession.multiSelect.off(\"addRange\", this.$onAddRange);\n oldSession.multiSelect.off(\"removeRange\", this.$onRemoveRange);\n oldSession.multiSelect.off(\"multiSelect\", this.$onMultiSelect);\n oldSession.multiSelect.off(\"singleSelect\", this.$onSingleSelect);\n oldSession.multiSelect.lead.off(\"change\", this.$checkMultiselectChange);\n oldSession.multiSelect.anchor.off(\"change\", this.$checkMultiselectChange);\n }\n if (session) {\n session.multiSelect.on(\"addRange\", this.$onAddRange);\n session.multiSelect.on(\"removeRange\", this.$onRemoveRange);\n session.multiSelect.on(\"multiSelect\", this.$onMultiSelect);\n session.multiSelect.on(\"singleSelect\", this.$onSingleSelect);\n session.multiSelect.lead.on(\"change\", this.$checkMultiselectChange);\n session.multiSelect.anchor.on(\"change\", this.$checkMultiselectChange);\n }\n if (session && this.inMultiSelectMode != session.selection.inMultiSelectMode) {\n if (session.selection.inMultiSelectMode)\n this.$onMultiSelect();\n else\n this.$onSingleSelect();\n }\n};\nfunction MultiSelect(editor) {\n if (editor.$multiselectOnSessionChange)\n return;\n editor.$onAddRange = editor.$onAddRange.bind(editor);\n editor.$onRemoveRange = editor.$onRemoveRange.bind(editor);\n editor.$onMultiSelect = editor.$onMultiSelect.bind(editor);\n editor.$onSingleSelect = editor.$onSingleSelect.bind(editor);\n editor.$multiselectOnSessionChange = exports.onSessionChange.bind(editor);\n editor.$checkMultiselectChange = editor.$checkMultiselectChange.bind(editor);\n editor.$multiselectOnSessionChange(editor);\n editor.on(\"changeSession\", editor.$multiselectOnSessionChange);\n editor.on(\"mousedown\", onMouseDown);\n editor.commands.addCommands(commands.defaultCommands);\n addAltCursorListeners(editor);\n}\nfunction addAltCursorListeners(editor) {\n if (!editor.textInput)\n return;\n var el = editor.textInput.getElement();\n var altCursor = false;\n event.addListener(el, \"keydown\", function (e) {\n var altDown = e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey);\n if (editor.$blockSelectEnabled && altDown) {\n if (!altCursor) {\n editor.renderer.setMouseCursor(\"crosshair\");\n altCursor = true;\n }\n }\n else if (altCursor) {\n reset();\n }\n }, editor);\n event.addListener(el, \"keyup\", reset, editor);\n event.addListener(el, \"blur\", reset, editor);\n function reset(e) {\n if (altCursor) {\n editor.renderer.setMouseCursor(\"\");\n altCursor = false;\n }\n }\n}\nexports.MultiSelect = MultiSelect;\nrequire(\"./config\").defineOptions(Editor.prototype, \"editor\", {\n enableMultiselect: {\n set: function (val) {\n MultiSelect(this);\n if (val) {\n this.on(\"mousedown\", onMouseDown);\n }\n else {\n this.off(\"mousedown\", onMouseDown);\n }\n },\n value: true\n },\n enableBlockSelect: {\n set: function (val) {\n this.$blockSelectEnabled = val;\n },\n value: true\n }\n});\n\n});\n\nace.define(\"ace/mode/folding/fold_mode\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../../range\").Range;\nvar FoldMode = exports.FoldMode = function () { };\n(function () {\n this.foldingStartMarker = null;\n this.foldingStopMarker = null;\n this.getFoldWidget = function (session, foldStyle, row) {\n var line = session.getLine(row);\n if (this.foldingStartMarker.test(line))\n return \"start\";\n if (foldStyle == \"markbeginend\"\n && this.foldingStopMarker\n && this.foldingStopMarker.test(line))\n return \"end\";\n return \"\";\n };\n this.getFoldWidgetRange = function (session, foldStyle, row) {\n return null;\n };\n this.indentationBlock = function (session, row, column) {\n var re = /\\S/;\n var line = session.getLine(row);\n var startLevel = line.search(re);\n if (startLevel == -1)\n return;\n var startColumn = column || line.length;\n var maxRow = session.getLength();\n var startRow = row;\n var endRow = row;\n while (++row < maxRow) {\n var level = session.getLine(row).search(re);\n if (level == -1)\n continue;\n if (level <= startLevel) {\n var token = session.getTokenAt(row, 0);\n if (!token || token.type !== \"string\")\n break;\n }\n endRow = row;\n }\n if (endRow > startRow) {\n var endColumn = session.getLine(endRow).length;\n return new Range(startRow, startColumn, endRow, endColumn);\n }\n };\n this.openingBracketBlock = function (session, bracket, row, column, typeRe) {\n var start = { row: row, column: column + 1 };\n var end = session.$findClosingBracket(bracket, start, typeRe);\n if (!end)\n return;\n var fw = session.foldWidgets[end.row];\n if (fw == null)\n fw = session.getFoldWidget(end.row);\n if (fw == \"start\" && end.row > start.row) {\n end.row--;\n end.column = session.getLine(end.row).length;\n }\n return Range.fromPoints(start, end);\n };\n this.closingBracketBlock = function (session, bracket, row, column, typeRe) {\n var end = { row: row, column: column };\n var start = session.$findOpeningBracket(bracket, end);\n if (!start)\n return;\n start.column++;\n end.column--;\n return Range.fromPoints(start, end);\n };\n}).call(FoldMode.prototype);\n\n});\n\nace.define(\"ace/ext/error_marker\",[\"require\",\"exports\",\"module\",\"ace/line_widgets\",\"ace/lib/dom\",\"ace/range\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar LineWidgets = require(\"../line_widgets\").LineWidgets;\nvar dom = require(\"../lib/dom\");\nvar Range = require(\"../range\").Range;\nvar nls = require(\"../config\").nls;\nfunction binarySearch(array, needle, comparator) {\n var first = 0;\n var last = array.length - 1;\n while (first <= last) {\n var mid = (first + last) >> 1;\n var c = comparator(needle, array[mid]);\n if (c > 0)\n first = mid + 1;\n else if (c < 0)\n last = mid - 1;\n else\n return mid;\n }\n return -(first + 1);\n}\nfunction findAnnotations(session, row, dir) {\n var annotations = session.getAnnotations().sort(Range.comparePoints);\n if (!annotations.length)\n return;\n var i = binarySearch(annotations, { row: row, column: -1 }, Range.comparePoints);\n if (i < 0)\n i = -i - 1;\n if (i >= annotations.length)\n i = dir > 0 ? 0 : annotations.length - 1;\n else if (i === 0 && dir < 0)\n i = annotations.length - 1;\n var annotation = annotations[i];\n if (!annotation || !dir)\n return;\n if (annotation.row === row) {\n do {\n annotation = annotations[i += dir];\n } while (annotation && annotation.row === row);\n if (!annotation)\n return annotations.slice();\n }\n var matched = [];\n row = annotation.row;\n do {\n matched[dir < 0 ? \"unshift\" : \"push\"](annotation);\n annotation = annotations[i += dir];\n } while (annotation && annotation.row == row);\n return matched.length && matched;\n}\nexports.showErrorMarker = function (editor, dir) {\n var session = editor.session;\n if (!session.widgetManager) {\n session.widgetManager = new LineWidgets(session);\n session.widgetManager.attach(editor);\n }\n var pos = editor.getCursorPosition();\n var row = pos.row;\n var oldWidget = session.widgetManager.getWidgetsAtRow(row).filter(function (w) {\n return w.type == \"errorMarker\";\n })[0];\n if (oldWidget) {\n oldWidget.destroy();\n }\n else {\n row -= dir;\n }\n var annotations = findAnnotations(session, row, dir);\n var gutterAnno;\n if (annotations) {\n var annotation = annotations[0];\n pos.column = (annotation.pos && typeof annotation.column != \"number\"\n ? annotation.pos.sc\n : annotation.column) || 0;\n pos.row = annotation.row;\n gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row];\n }\n else if (oldWidget) {\n return;\n }\n else {\n gutterAnno = {\n text: [nls(\"error-marker.good-state\", \"Looks good!\")],\n className: \"ace_ok\"\n };\n }\n editor.session.unfold(pos.row);\n editor.selection.moveToPosition(pos);\n var w = {\n row: pos.row,\n fixedWidth: true,\n coverGutter: true,\n el: dom.createElement(\"div\"),\n type: \"errorMarker\"\n };\n var el = w.el.appendChild(dom.createElement(\"div\"));\n var arrow = w.el.appendChild(dom.createElement(\"div\"));\n arrow.className = \"error_widget_arrow \" + gutterAnno.className;\n var left = editor.renderer.$cursorLayer\n .getPixelPosition(pos).left;\n arrow.style.left = left + editor.renderer.gutterWidth - 5 + \"px\";\n w.el.className = \"error_widget_wrapper\";\n el.className = \"error_widget \" + gutterAnno.className;\n el.innerHTML = gutterAnno.text.join(\"
\");\n el.appendChild(dom.createElement(\"div\"));\n var kb = function (_, hashId, keyString) {\n if (hashId === 0 && (keyString === \"esc\" || keyString === \"return\")) {\n w.destroy();\n return { command: \"null\" };\n }\n };\n w.destroy = function () {\n if (editor.$mouseHandler.isMousePressed)\n return;\n editor.keyBinding.removeKeyboardHandler(kb);\n session.widgetManager.removeLineWidget(w);\n editor.off(\"changeSelection\", w.destroy);\n editor.off(\"changeSession\", w.destroy);\n editor.off(\"mouseup\", w.destroy);\n editor.off(\"change\", w.destroy);\n };\n editor.keyBinding.addKeyboardHandler(kb);\n editor.on(\"changeSelection\", w.destroy);\n editor.on(\"changeSession\", w.destroy);\n editor.on(\"mouseup\", w.destroy);\n editor.on(\"change\", w.destroy);\n editor.session.widgetManager.addLineWidget(w);\n w.el.onmousedown = editor.focus.bind(editor);\n editor.renderer.scrollCursorIntoView(null, 0.5, { bottom: w.el.offsetHeight });\n};\ndom.importCssString(\"\\n .error_widget_wrapper {\\n background: inherit;\\n color: inherit;\\n border:none\\n }\\n .error_widget {\\n border-top: solid 2px;\\n border-bottom: solid 2px;\\n margin: 5px 0;\\n padding: 10px 40px;\\n white-space: pre-wrap;\\n }\\n .error_widget.ace_error, .error_widget_arrow.ace_error{\\n border-color: #ff5a5a\\n }\\n .error_widget.ace_warning, .error_widget_arrow.ace_warning{\\n border-color: #F1D817\\n }\\n .error_widget.ace_info, .error_widget_arrow.ace_info{\\n border-color: #5a5a5a\\n }\\n .error_widget.ace_ok, .error_widget_arrow.ace_ok{\\n border-color: #5aaa5a\\n }\\n .error_widget_arrow {\\n position: absolute;\\n border: solid 5px;\\n border-top-color: transparent!important;\\n border-right-color: transparent!important;\\n border-left-color: transparent!important;\\n top: -5px;\\n }\\n\", \"error_marker.css\", false);\n\n});\n\nace.define(\"ace/ace\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\",\"ace/range\",\"ace/editor\",\"ace/edit_session\",\"ace/undomanager\",\"ace/virtual_renderer\",\"ace/worker/worker_client\",\"ace/keyboard/hash_handler\",\"ace/placeholder\",\"ace/multi_select\",\"ace/mode/folding/fold_mode\",\"ace/theme/textmate\",\"ace/ext/error_marker\",\"ace/config\",\"ace/loader_build\"], function(require, exports, module){/**\n * The main class required to set up an Ace instance in the browser.\n *\n * @namespace Ace\n **/\n\"use strict\";\nrequire(\"./loader_build\")(exports)\nvar dom = require(\"./lib/dom\");\nvar Range = require(\"./range\").Range;\nvar Editor = require(\"./editor\").Editor;\nvar EditSession = require(\"./edit_session\").EditSession;\nvar UndoManager = require(\"./undomanager\").UndoManager;\nvar Renderer = require(\"./virtual_renderer\").VirtualRenderer;\nrequire(\"./worker/worker_client\");\nrequire(\"./keyboard/hash_handler\");\nrequire(\"./placeholder\");\nrequire(\"./multi_select\");\nrequire(\"./mode/folding/fold_mode\");\nrequire(\"./theme/textmate\");\nrequire(\"./ext/error_marker\");\nexports.config = require(\"./config\");\nexports.edit = function (el, options) {\n if (typeof el == \"string\") {\n var _id = el;\n el = document.getElementById(_id);\n if (!el)\n throw new Error(\"ace.edit can't find div #\" + _id);\n }\n if (el && el.env && el.env.editor instanceof Editor)\n return el.env.editor;\n var value = \"\";\n if (el && /input|textarea/i.test(el.tagName)) {\n var oldNode = el;\n value = oldNode.value;\n el = dom.createElement(\"pre\");\n oldNode.parentNode.replaceChild(el, oldNode);\n }\n else if (el) {\n value = el.textContent;\n el.innerHTML = \"\";\n }\n var doc = exports.createEditSession(value);\n var editor = new Editor(new Renderer(el), doc, options);\n var env = {\n document: doc,\n editor: editor,\n onResize: editor.resize.bind(editor, null)\n };\n if (oldNode)\n env.textarea = oldNode;\n editor.on(\"destroy\", function () {\n env.editor.container.env = null; // prevent memory leak on old ie\n });\n editor.container.env = editor.env = env;\n return editor;\n};\nexports.createEditSession = function (text, mode) {\n var doc = new EditSession(text, mode);\n doc.setUndoManager(new UndoManager());\n return doc;\n};\nexports.Range = Range;\nexports.Editor = Editor;\nexports.EditSession = EditSession;\nexports.UndoManager = UndoManager;\nexports.VirtualRenderer = Renderer;\nexports.version = exports.config.version;\n\n}); (function() {\n ace.require([\"ace/ace\"], function(a) {\n if (a) {\n a.config.init(true);\n a.define = ace.define;\n }\n var global = (function () {\n return this;\n })();\n if (!global && typeof window != \"undefined\") global = window; // can happen in strict mode\n if (!global && typeof self != \"undefined\") global = self; // can happen in webworker\n \n if (!global.ace)\n global.ace = a;\n for (var key in a) if (a.hasOwnProperty(key))\n global.ace[key] = a[key];\n global.ace[\"default\"] = global.ace;\n if ( true && module) {\n module.exports = global.ace;\n }\n });\n })();\n //# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvYWNlLWJ1aWxkcy9zcmMtbm9jb25mbGljdC9hY2UuanMiLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxrQ0FBa0M7QUFDbEM7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBOztBQUVBLDJCQUEyQixjQUFjO0FBQ3pDLDhEQUE4RDs7O0FBRzlEO0FBQ0E7OztBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQU07QUFDTjtBQUNBLDJDQUEyQyxPQUFPO0FBQ2xEO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ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ge1xuICAgICAgICBtb2R1bGUgPSBkZWZpbmUucGF5bG9hZHNbbW9kdWxlTmFtZV07XG4gICAgICAgIGlmICh0eXBlb2YgbW9kdWxlID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICB2YXIgZXhwb3J0cyA9IHt9O1xuICAgICAgICAgICAgdmFyIG1vZCA9IHtcbiAgICAgICAgICAgICAgICBpZDogbW9kdWxlTmFtZSxcbiAgICAgICAgICAgICAgICB1cmk6ICcnLFxuICAgICAgICAgICAgICAgIGV4cG9ydHM6IGV4cG9ydHMsXG4gICAgICAgICAgICAgICAgcGFja2FnZWQ6IHRydWVcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIHZhciByZXEgPSBmdW5jdGlvbihtb2R1bGUsIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF9yZXF1aXJlKG1vZHVsZU5hbWUsIG1vZHVsZSwgY2FsbGJhY2spO1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgdmFyIHJldHVyblZhbHVlID0gbW9kdWxlKHJlcSwgZXhwb3J0cywgbW9kKTtcbiAgICAgICAgICAgIGV4cG9ydHMgPSByZXR1cm5WYWx1ZSB8fCBtb2QuZXhwb3J0cztcbiAgICAgICAgICAgIGRlZmluZS5tb2R1bGVzW21vZHVsZU5hbWVdID0gZXhwb3J0cztcbiAgICAgICAgICAgIGRlbGV0ZSBkZWZpbmUucGF5bG9hZHNbbW9kdWxlTmFtZV07XG4gICAgICAgIH1cbiAgICAgICAgbW9kdWxlID0gZGVmaW5lLm1vZHVsZXNbbW9kdWxlTmFtZV0gPSBleHBvcnRzIHx8IG1vZHVsZTtcbiAgICB9XG4gICAgcmV0dXJuIG1vZHVsZTtcbn07XG5cbmZ1bmN0aW9uIGV4cG9ydEFjZShucykge1xuICAgIHZhciByb290ID0gZ2xvYmFsO1xuICAgIGlmIChucykge1xuICAgICAgICBpZiAoIWdsb2JhbFtuc10pXG4gICAgICAgICAgICBnb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gICAgICAgICAgIHJlc3VsdCArPSBzdHJpbmc7XG4gICAgICAgICAgICBpZiAoKGNvdW50ID4+PSAxKSlcbiAgICAgICAgICAgICAgICBzdHJpbmcgKz0gc3RyaW5nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfSk7XG59XG5pZiAoIVN0cmluZy5wcm90b3R5cGUuaW5jbHVkZXMpIHtcbiAgICBkZWZpbmVQcm9wKFN0cmluZy5wcm90b3R5cGUsIFwiaW5jbHVkZXNcIiwgZnVuY3Rpb24gKHN0ciwgcG9zaXRpb24pIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuaW5kZXhPZihzdHIsIHBvc2l0aW9uKSAhPSAtMTtcbiAgICB9KTtcbn1cbmlmICghT2JqZWN0LmFzc2lnbikge1xuICAgIE9iamVjdC5hc3NpZ24gPSBmdW5jdGlvbiAodGFyZ2V0KSB7XG4gICAgICAgIGlmICh0YXJnZXQgPT09IHVuZGVmaW5lZCB8fCB0YXJnZXQgPT09IG51bGwpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJDYW5ub3QgY29udmVydCB1bmRlZmluZWQgb3IgbnVsbCB0byBvYmplY3RcIik7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIG91dHB1dCA9IE9iamVjdCh0YXJnZXQpO1xuICAgICAgICBmb3IgKHZhciBpbmRleCA9IDE7IGluZGV4IDwgYXJndW1lbnRzLmxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICAgICAgdmFyIHNvdXJjZSA9IGFyZ3VtZW50c1tpbmRleF07XG4gICAgICAgICAgICBpZiAoc291cmNlICE9PSB1bmRlZmluZWQgJiYgc291cmNlICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmtleXMoc291cmNlKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0W2tleV0gPSBzb3VyY2Vba2V5XTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gb3V0cHV0O1xuICAgIH07XG59XG5pZiAoIU9iamVjdC52YWx1ZXMpIHtcbiAgICBPYmplY3QudmFsdWVzID0gZnVuY3Rpb24gKG8pIHtcbiAgICAgICAgcmV0dXJuIE9iamVjdC5rZXlzKG8pLm1hcChmdW5jdGlvbiAoaykge1xuICAgICAgICAgICAgcmV0dXJuIG9ba107XG4gICAgICAgIH0pO1xuICAgIH07XG59XG5pZiAoIUFycmF5LnByb3RvdHlwZS5maW5kKSB7XG4gICAgZGVmaW5lUHJvcChBcnJheS5wcm90b3R5cGUsIFwiZmluZFwiLCBmdW5jdGlvbiAocHJlZGljYXRlKSB7XG4gICAgICAgIHZhciBsZW4gPSB0aGlzLmxlbmd0aDtcbiAgICAgICAgdmFyIHRoaXNBcmcgPSBhcmd1bWVudHNbMV07XG4gICAgICAgIGZvciAodmFyIGsgPSAwOyBrIDwgbGVuOyBrKyspIHtcbiAgICAgICAgICAgIHZhciBrVmFsdWUgPSB0aGlzW2tdO1xuICAgICAgICAgICAgaWYgKHByZWRpY2F0ZS5jYWxsKHRoaXNBcmcsIGtWYWx1ZSwgaywgdGhpcykpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4ga1ZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSk7XG59XG5pZiAoIUFycmF5LnByb3RvdHlwZS5maW5kSW5kZXgpIHtcbiAgICBkZWZpbmVQcm9wKEFycmF5LnByb3RvdHlwZSwgXCJmaW5kSW5kZXhcIiwgZnVuY3Rpb24gKHByZWRpY2F0ZSkge1xuICAgICAgICB2YXIgbGVuID0gdGhpcy5sZW5ndGg7XG4gICAgICAgIHZhciB0aGlzQXJnID0gYXJndW1lbnRzWzFdO1xuICAgICAgICBmb3IgKHZhciBrID0gMDsgayA8IGxlbjsgaysrKSB7XG4gICAgICAgICAgICB2YXIga1ZhbHV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WNlKHJlZ0V4cCwgZnVuY3Rpb24gKHN0cikge1xuICAgICAgICBtYXRjaGVzLnB1c2goe1xuICAgICAgICAgICAgb2Zmc2V0OiBhcmd1bWVudHNbYXJndW1lbnRzLmxlbmd0aCAtIDJdLFxuICAgICAgICAgICAgbGVuZ3RoOiBzdHIubGVuZ3RoXG4gICAgICAgIH0pO1xuICAgIH0pO1xuICAgIHJldHVybiBtYXRjaGVzO1xufTtcbmV4cG9ydHMuZGVmZXJyZWRDYWxsID0gZnVuY3Rpb24gKGZjbikge1xuICAgIHZhciB0aW1lciA9IG51bGw7XG4gICAgdmFyIGNhbGxiYWNrID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB0aW1lciA9IG51bGw7XG4gICAgICAgIGZjbigpO1xuICAgIH07XG4gICAgdmFyIGRlZmVycmVkID0gZnVuY3Rpb24gKHRpbWVvdXQpIHtcbiAgICAgICAgZGVmZXJyZWQuY2FuY2VsKCk7XG4gICAgICAgIHRpbWVyID0gc2V0VGltZW91dChjYWxsYmFjaywgdGltZW91dCB8fCAwKTtcbiAgICAgICAgcmV0dXJuIGRlZmVycmVkO1xuICAgIH07XG4gICAgZGVmZXJyZWQuc2NoZWR1bGUgPSBkZWZlcnJlZDtcbiAgICBkZWZlcnJlZC5jYWxsID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLmNhbmNlbCgpO1xuICAgICAgICBmY24oKTtcbiAgICAgICAgcmV0dXJuIGRlZmVycmVkO1xuICAgIH07XG4gICAgZGVmZXJyZWQuY2FuY2VsID0gZnVuY3Rpb24gKCkge1xuICAgICAgICBjbGVhclRpbWVvdXQodGltZXIpO1xuICAgICAgICB0aW1lciA9IG51bGw7XG4gICAgICAgIHJldHVybiBkZWZlcnJlZDtcbiAgICB9O1xuICAgIGRlZmVycmVkLmlzUGVuZGluZyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRpbWVyO1xuICAgIH07XG4gICAgcmV0dXJuIGRlZmVycmVk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6Ly93d3cudzMub3JnLzE5OTkveGh0bWxcIjtcbmV4cG9ydHMuYnVpbGREb20gPSBmdW5jdGlvbiBidWlsZERvbShhcnIsIHBhcmVudCwgcmVmcykge1xuICAgIGlmICh0eXBlb2YgYXJyID09IFwic3RyaW5nXCIgJiYgYXJyKSB7XG4gICAgICAgIHZhciB0eHQgPSBkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZShhcnIpO1xuICAgICAgICBpZiAocGFyZW50KVxuICAgICAgICAgICAgcGFyZW50LmFwcGVuZENoaWxkKHR4dCk7XG4gICAgICAgIHJldHVybiB0eHQ7XG4gICAgfVxuICAgIGlmICghQXJyYXkuaXNBcnJheShhcnIpKSB7XG4gICAgICAgIGlmIChhcnIgJiYgYXJyLmFwcGVuZENoaWxkICYmIHBhcmVudClcbiAgICAgICAgICAgIHBhcmVudC5hcHBlbmRDaGlsZChhcnIpO1xuICAgICAgICByZXR1cm4gYXJyO1xuICAgIH1cbiAgICBpZiAodHlwZW9mIGFyclswXSAhPSBcInN0cmluZ1wiIHx8ICFhcnJbMF0pIHtcbiAgICAgICAgdmFyIGVscyA9IFtdO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGNoID0gYnVpbGREb20oYXJyW2ldLCBwYXJlbnQsIHJlZnMpO1xuICAgICAgICAgICAgY2ggJiYgZWxzLnB1c2goY2gpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBlbHM7XG4gICAgfVxuICAgIHZhciBlbCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoYXJyWzBdKTtcbiAgICB2YXIgb3B0aW9ucyA9IGFyclsxXTtcbiAgICB2YXIgY2hpbGRJbmRleCA9IDE7XG4gICAgaWYgKG9wdGlvbnMgJiYgdHlwZW9mIG9wdGlvbnMgPT0gXCJvYmplY3RcIiAmJiAhQXJyYXkuaXNBcnJheShvcHRpb25zKSlcbiAgICAgICAgY2hpbGRJbmRleCA9IDI7XG4gICAgZm9yICh2YXIgaSA9IGNoaWxkSW5kZXg7IGkgPCBhcnIubGVuZ3RoOyBpKyspXG4gICAgICAgIGJ1aWxkRG9tKGFycltpXSwgZWwsIHJlZnMpO1xuICAgIGlmIChjaGlsZEluZGV4ID09IDIpIHtcbiAgICAgICAgT2JqZWN0LmtleXMob3B0aW9ucykuZm9yRWFjaChmdW5jdGlvbiAobikge1xuICAgICAgICAgICAgdmFyIHZhbCA9IG9wdGlvbnNbbl07XG4gICAgICAgICAgICBpZiAobiA9PT0gXCJjbGFzc1wiKSB7XG4gICAgICAgICAgICAgICAgZWwuY2xhc3NOYW1lID0gQXJyYXkuaXNBcnJheSh2YWwpID8gdmFsLmpvaW4oXCIgXCIpIDogdmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIHZhbCA9PSBcImZ1bmN0aW9uXCIgfHwgbiA9PSBcInZhbHVlXCIgfHwgblswXSA9PSBcIiRcIikge1xuICAgICAgICAgICAgICAgIGVsW25dID0gdmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAobiA9PT0gXCJyZWZcIikge1xuICAgICAgICAgICAgICAgIGlmIChyZWZzKVxuICAgICAgICAgICAgICAgICAgICByZWZzW3ZhbF0gPSBlbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKG4gPT09IFwic3R5bGVcIikge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsID09IFwic3RyaW5nXCIpXG4gICAgICAgICAgICAgICAgICAgIGVsLnN0eWxlLmNzc1RleHQgPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh2YWwgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGVsLnNldEF0dHJpYnV0ZShuLCB2YWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgaWYgKHBhcmVud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ICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9O1xuICAgIEFwcENvbmZpZy5wcm90b3R5cGUucmVzZXRPcHRpb25zID0gZnVuY3Rpb24gKG9iaikge1xuICAgICAgICBPYmplY3Qua2V5cyhvYmouJG9wdGlvbnMpLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgdmFyIG9wdCA9IG9iai4kb3B0aW9uc1trZXldO1xuICAgICAgICAgICAgaWYgKFwidmFsdWVcIiBpbiBvcHQpXG4gICAgICAgICAgICAgICAgb2JqLnNldE9wdGlvbihrZXksIG9wdC52YWx1ZSk7XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgQXBwQ29uZmlnLnByb3RvdHlwZS5zZXREZWZhdWx0VmFsdWUgPSBmdW5jdGlvbiAocGF0aCwgbmFtZSwgdmFsdWUpIHtcbiAgICAgICAgaWYgKCFwYXRoKSB7XG4gICAgICAgICAgICBmb3IgKHBhdGggaW4gdGhpcy4kZGVmYXVsdE9wdGlvbnMpXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuJGRlZmF1bHRPcHRpb25zW3BhdGhdW25hbWVdKVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGlmICghdGhpcy4kZGVmYXVsdE9wdGlvbnNbcGF0aF1bbmFtZV0pXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIHZhciBvcHRzID0gdGhpcy4kZGVmYXVsdE9wdGlvbnNbcGF0aF0gfHwgKHRoaXMuJGRlZmF1bHRPcHRpb25zW3BhdGhdID0ge30pO1xuICAgICAgICBpZiAob3B0c1tuYW1lXSkge1xuICAgICAgICAgICAgaWYgKG9wdHMuZm9yd2FyZFRvKVxuICAgICAgICAgICAgICAgIHRoaXMuc2V0RGVmYXVsdFZhbHVlKG9wdHMuZm9yd2FyZFRvLCBuYW1lLCB2YWx1ZSk7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgIC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dGVuZXJzID0gZXhwb3J0cy4kbG9hZGluZ1ttb2R1bGVOYW1lXTtcbiAgICAgICAgICAgICAgICBleHBvcnRzLiRsb2FkaW5nW21vZHVsZU5hbWVdID0gbnVsbDtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lcnMuZm9yRWFjaChmdW5jdGlvbiAob25Mb2FkKSB7XG4gICAgICAgICAgICAgICAgICAgIG9uTG9hZCAmJiBvbkxvYWQobW9kdWxlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuICAgICAgICBpZiAoIWV4cG9ydHMuZ2V0KFwicGFja2FnZWRcIikpXG4gICAgICAgICAgICByZXR1cm4gYWZ0ZXJMb2FkKCk7XG4gICAgICAgIG5ldC5sb2FkU2NyaXB0KGV4cG9ydHMubW9kdWxlVXJsKG1vZHVsZU5hbWUsIG1vZHVsZVR5cGUpLCBhZnRlckxvYWQpO1xuICAgICAgICByZXBvcnRFcnJvcklmUGF0aElzTm90Q29uZmlndXJlZCgpO1xuICAgIH07XG4gICAgaWYgKGV4cG9ydHMuZHluYW1pY01vZHVsZXNbbW9kdWxlTmFtZV0pIHtcbiAgICAgICAgZXhwb3J0cy5keW5hbWljTW9kdWxlc1ttb2R1bGVOYW1lXSgpLnRoZW4oZnVuY3Rpb24gKG1vZHVsZSkge1xuICAgICAgICAgICAgaWYgKG1vZHVsZS5kZWZhdWx0KSB7XG4gICAgICAgICAgICAgICAgbG9hZChtb2R1bGUuZGVmYXVsdCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsb2FkKG1vZHVsZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIGxvYWRlZE1vZHVsZSA9IHRoaXMuJHJlcXVpcmUobW9kdWxlTmFtZSk7XG4gICAgICAgIH1cbiAgICAgICA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yO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY21wID09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGNtcCA9PSAtMSkge1xuICAgICAgICAgICAgcmV0dXJuIC0yO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgY21wID0gdGhpcy5jb21wYXJlKHN0YXJ0LnJvdywgc3RhcnQuY29sdW1uKTtcbiAgICAgICAgICAgIGlmIChjbXAgPT0gLTEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChjbXAgPT0gMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiA0MjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICBSYW5nZS5wcm90b3R5cGUuY29tcGFyZVBvaW50ID0gZnVuY3Rpb24gKHApIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShwLnJvdywgcC5jb2x1bW4pO1xuICAgIH07XG4gICAgUmFuZ2UucHJvdG90eXBlLmNvbnRhaW5zUmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZVBvaW50KHJhbmdlLnN0YXJ0KSA9PSAwICYmIHRoaXMuY29tcGFyZVBvaW50KHJhbmdlLmVuZCkgPT0gMDtcbiAgICB9O1xuICAgIFJhbmdlLnByb3RvdHlwZS5pbnRlcnNlY3RzID0gZnVuY3Rpb24gKHJhbmdlKSB7XG4gICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmVSYW5nZShyYW5nZSk7XG4gICAgICAgIHJldHVybiAoY21wID09IC0xIHx8IGNtcCA9PSAwIHx8IGNtcCA9PSAxKTtcbiAgICB9O1xuICAgIFJhbmdlLnByb3RvdHlwZS5pc0VuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikge1xuICAgICAgICByZXR1cm4gdGhpcy5lbmQucm93ID09IHJvdyAmJiB0aGlzLmVuZC5jb2x1bW4gPT0gY29sdW1uO1xuICAgIH07XG4gICAgUmFuZ2UucHJvdG90eXBlLmlzU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW47XG4gICAgfTtcbiAgICBSYW5nZS5wcm90b3R5cGUuc2V0U3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHtcbiAgICAgICAgaWYgKHR5cGVvZiByb3cgPT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgdGhpcy5zdGFydC5jb2x1bW4gPSByb3cuY29sdW1uO1xuICAgICAgICAgICAgdGhpcy5zdGFydC5yb3cgPSByb3cucm93O1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5zdGFydC5yb3cgPSByb3c7XG4gICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjtcbiAgICAgICAgfVxuICAgIH07XG4gICAgUmFuZ2UucHJvdG90eXBlLnNldEVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikge1xuICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSBcIm9iamVjdFwiKSB7XG4gICAgICAgICAgICB0aGlzLmVuZC5jb2x1bW4gPSByb3cuY29sdW1uO1xuICAgICAgICAgICAgdGhpcy5lbmQucm93ID0gcm93LnJvdztcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuZW5kLnJvdyA9IHJvdztcbiAgICAgICAgICAgIHRoaXMuZW5kLmNvbHVtbiA9IGNvbHVtbjtcbiAgICAgICAgfVxuICAgIH07XG4gICAgUmFuZ2UucHJvdG90eXBlLmluc2lkZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikge1xuICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5pc0VuZChyb3csIGNvbHVtbikgfHwgdGhpcy5pc1N0YXJ0KHJvdywgY29sdW1uKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9O1xuICAgIFJhbmdlLnByb3RvdHlwZS5pbnNpZGVTdGFydCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikge1xuICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5pc0VuZChyb3csIGNvbHVtbikpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfTtcbiAgICBSYW5nZS5wcm90b3R5cGUuaW5zaWRlRW5kID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7XG4gICAgICAgIGlmICh0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pID09IDApIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmlzU3RhcnQocm93LCBjb2x1bW4pKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH07XG4gICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmUgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHtcbiAgICAgICAgaWYgKCF0aGlzLmlzTXVsdGlMaW5lKCkpIHtcbiAgICAgICAgICAgIGlmIChyb3cgPT09IHRoaXMuc3RhcnQucm93KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbHVtbiA8IHRoaXMuc3RhcnQuY29sdW1uID8gLTEgOiAoY29sdW1uID4gdGhpcy5lbmQuY29sdW1uID8gMSA6IDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChyb3cgPCB0aGlzLnN0YXJ0LnJvdylcbiAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgaWYgKHJvdyA+IHRoaXMuZW5kLnJvdylcbiAgICAgICAgICAgIHJldHVybiAxO1xuICAgICAgICBpZiAodGhpcy5zdGFydC5yb3cgPT09IHJvdylcbiAgICAgICAgICAgIHJldHVybiBjb2x1bW4gPj0gdGhpcy5zdGFydC5jb2x1bW4gPyAwIDogLTE7XG4gICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT09IHJvdylcbiAgICAgICAgICAgIHJldHVybiBjb2x1bW4gPD0gdGhpcy5lbmQuY29sdW1uID8gMCA6IDE7XG4gICAgICAgIHJldHVybiAwO1xuICAgIH07XG4gICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmVTdGFydCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikge1xuICAgICAgICBpZiAodGhpcy5zdGFydC5yb3cgPT0gcm93ICYmIHRoaXMuc3RhcnQuY29sdW1uID09IGNvbHVtbikge1xuICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIFJhbmdlLnByb3RvdHlwZS5jb21wYXJlRW5kID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7XG4gICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW4pIHtcbiAgICAgICAgICAgIHJldHVybiAxO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIFJhbmdlLnByb3RvdHlwZS5jb21wYXJlSW5zaWRlID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7XG4gICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW4pIHtcbiAgICAgICAgICAgIHJldHVybiAxO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHtcbiAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBSYW5nZS5wcm90b3R5cGUuY2xpcFJvd3MgPSBmdW5jdGlvbiAoZmlyc3RSb3csIGxhc3RSb3cpIHtcbiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA+IGxhc3RSb3cpXG4gICAgICAgICAgICB2YXIgZ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4gICAgICAgIDkxOiAnTWV0YUxlZnQnLCA5MjogJ01ldGFSaWdodCcsIDkzOiAnQ29udGV4dE1lbnUnXG4gICAgfSxcbiAgICBLRVlfTU9EUzoge1xuICAgICAgICBcImN0cmxcIjogMSwgXCJhbHRcIjogMiwgXCJvcHRpb25cIjogMiwgXCJzaGlmdFwiOiA0LFxuICAgICAgICBcInN1cGVyXCI6IDgsIFwibWV0YVwiOiA4LCBcImNvbW1hbmRcIjogOCwgXCJjbWRcIjogOCxcbiAgICAgICAgXCJjb250cm9sXCI6IDFcbiAgICB9LFxuICAgIEZVTkNUSU9OX0tFWVM6IHtcbiAgICAgICAgODogXCJCYWNrc3BhY2VcIixcbiAgICAgICAgOTogXCJUYWJcIixcbiAgICAgICAgMTM6IFwiUmV0dXJuXCIsXG4gICAgICAgIDE5OiBcIlBhdXNlXCIsXG4gICAgICAgIDI3OiBcIkVzY1wiLFxuICAgICAgICAzMjogXCJTcGFjZVwiLFxuICAgICAgICAzMzogXCJQYWdlVXBcIixcbiAgICAgICAgMzQ6IFwiUGFnZURvd25cIixcbiAgICAgICAgMzU6IFwiRW5kXCIsXG4gICAgICAgIDM2OiBcIkhvbWVcIixcbiAgICAgICAgMzc6IFwiTGVmdFwiLFxuICAgICAgICAzODogXCJVcFwiLFxuICAgICAgICAzOTogXCJSaWdodFwiLFxuICAgICAgICA0MDogXCJEb3duXCIsXG4gICAgICAgIDQ0OiBcIlByaW50XCIsXG4gICAgICAgIDQ1OiBcIkluc2VydFwiLFxuICAgICAgICA0NjogXCJEZWxldGVcIixcbiAgICAgICAgJy0xMyc6IFwiTnVtcGFkRW50ZXJcIixcbiAgICAgICAgMTQ0OiBcIk51bWxvY2tcIixcbiAgICAgICAgMTQ1OiBcIlNjcm9sbGxvY2tcIlxuICAgIH0sXG4gICAgUFJJTlRBQkxFX0tFWVM6IHtcbiAgICAgICAgMzI6ICcgJywgNTk6ICc7JywgNjE6ICc9JywgMTA3OiAnKycsIDEwOTogJy0nLCAxMT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2UgZS5ET01fREVMVEFfUElYRUw6XG4gICAgICAgICAgICAgICAgZS53aGVlbFggPSBkZWx0YVggKiBmYWN0b3I7XG4gICAgICAgICAgICAgICAgZS53aGVlbFkgPSBkZWx0YVkgKiBmYWN0b3I7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIGUuRE9NX0RFTFRBX0xJTkU6XG4gICAgICAgICAgICAgICAgdmFyIGxpbmVQaXhlbHMgPSAxNTtcbiAgICAgICAgICAgICAgICBlLndoZWVsWCA9IGRlbHRhWCAqIGxpbmVQaXhlbHM7XG4gICAgICAgICAgICAgICAgZS53aGVlbFkgPSBkZWx0YVkgKiBsaW5lUGl4ZWxzO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBlLkRPTV9ERUxUQV9QQUdFOlxuICAgICAgICAgICAgICAgIHZhciBwYWdlUGl4ZWxzID0gMTUwO1xuICAgICAgICAgICAgICAgIGUud2hlZWxYID0gZGVsdGFYICogcGFnZVBpeGVscztcbiAgICAgICAgICAgICAgICBlLndoZWVsWSA9IGRlbHRhWSAqIHBhZ2VQaXhlbHM7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgY2FsbGJhY2soZSk7XG4gICAgfSwgZGVzdHJveWVyKTtcbn07XG5leHBvcnRzLmFkZE11bHRpTW91c2VEb3duTGlzdGVuZXIgPSBmdW5jdGlvbiAoZWxlbWVudHMsIHRpbWVvdXRzLCBldmVudEhhbmRsZXIsIGNhbGxiYWNrTmFtZSwgZGVzdHJveWVyKSB7XG4gICAgdmFyIGNsaWNrcyA9IDA7XG4gICAgdmFyIHN0YXJ0WCwgc3RhcnRZLCB0aW1lcjtcbiAgICB2YXIgZXZlbnROYW1lcyA9IHtcbiAgICAgICAgMjogXCJkYmxjbGlja1wiLFxuICAgICAgICAzOiBcInRyaXBsZWNsaWNrXCIsXG4gICAgICAgIDQ6IFwicXVhZGNsaWNrXCJcbiAgICB9O1xuICAgIGZ1bmN0aW9uIG9uTW91c2Vkb3duKGUpIHtcbiAgICAgICAgaWYgKGV4cG9ydHMuZ2V0QnV0dG9uKGUpICE9PSAwKSB7XG4gICAgICAgICAgICBjbGlja3MgPSAwO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGUuZGV0YWlsID4gMSkge1xuICAgICAgICAgICAgY2xpY2tzKys7XG4gICAgICAgICAgICBpZiAoY2xpY2tzID4gNClcbiAgICAgICAgICAgICAgICBjbGlja3MgPSAxO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgY2xpY2tzID0gMTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodXNlcmFnZW50LmlzSUUpIHtcbiAgICAgICAgICAgIHZhciBpc05ld0NsaWNrID0gTWF0aC5hYnMoZS5jbGllbnRYIC0gc3RhcnRYKSA+IDUgfHwgTWF0aC5hYnMoZS5jbGllbnRZIC0gc3RhcnRZKSA+IDU7XG4gICAgICAgICAgICBpZiAoIXRpbWVyIHx8IGlzTmV3Q2xpY2spXG4gICAgICAgICAgICAgICAgY2xpY2tzID0gMTtcbiAgICAgICAgICAgIGlmICh0aW1lcilcbiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZXIpO1xuICAgICAgICAgICAgdGltZXIgPSBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsgdGltZXIgPSBudWxsOyB9LCB0aW1lb3V0c1tjbGlja3MgLSAxXSB8fCA2MDApO1xuICAgICAgICAgICAgaWYgKGNsaWNrcyA9PSAxKSB7XG4gICAgICAgICAgICAgICAgc3RhcnRYID0gZS5jbGllbnRYO1xuICAgICAgICAgICAgICAgIHN0YXJ0WSA9IGUuY2xpZW50WTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlLl9jbGlja3MgPSBjbGlja3M7XG4gICAgICAgIGV2ZW50SGFuZGxlcltjYWxsYmFja05hbWVdKFwibW91c2Vkb3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5nZXRNb2RpZmllclN0YXRlICYmIChlLmdldE1vZGlmaWVyU3RhdGUoXCJPU1wiKSB8fCBlLmdldE1vZGlmaWVyU3RhdGUoXCJXaW5cIikpKVxuICAgICAgICAgICAgaGFzaElkIHw9IDg7XG4gICAgICAgIGlmIChwcmVzc2VkS2V5cy5hbHRHcikge1xuICAgICAgICAgICAgaWYgKCgzICYgaGFzaElkKSAhPSAzKVxuICAgICAgICAgICAgICAgIHByZXNzZWRLZXlzLmFsdEdyID0gMDtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGtleUNvZGUgPT09IDE4IHx8IGtleUNvZGUgPT09IDE3KSB7XG4gICAgICAgICAgICB2YXIgbG9jYXRpb24gPSBlLmxvY2F0aW9uO1xuICAgICAgICAgICAgaWYgKGtleUNvZGUgPT09IDE3ICYmIGxvY2F0aW9uID09PSAxKSB7XG4gICAgICAgICAgICAgICAgaWYgKHByZXNzZWRLZXlzW2tleUNvZGVdID09IDEpXG4gICAgICAgICAgICAgICAgICAgIHRzID0gZS50aW1lU3RhbXA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChrZXlDb2RlID09PSAxOCAmJiBoYXNoSWQgPT09IDMgJiYgbG9jYXRpb24gPT09IDIpIHtcbiAgICAgICAgICAgICAgICB2YXIgZHQgPSBlLnRpbWVTdGFtcCAtIHRzO1xuICAgICAgICAgICAgICAgIGlmIChkdCA8IDUwKVxuICAgICAgICAgICAgICAgICAgICBwcmVzc2VkS2V5cy5hbHRHciA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgaWYgKGtleUNvZGUgaW4ga2V5cy5NT0RJRklFUl9LRVlTKSB7XG4gICAgICAgIGtleUNvZGUgPSAtMTtcbiAgICB9XG4gICAgaWYgKCFoYXNoSWQgJiYga2V5Q29kZSA9PT0gMTMpIHtcbiAgICAgICAgaWYg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ZhciBsaW5lID0gXCJcIjtcbiAgICAgICAgICAgIGlmIChob3N0LnNlc3Npb24pIHtcbiAgICAgICAgICAgICAgICB2YXIgc2VsZWN0aW9uID0gaG9zdC5zZWxlY3Rpb247XG4gICAgICAgICAgICAgICAgdmFyIHJhbmdlID0gc2VsZWN0aW9uLmdldFJhbmdlKCk7XG4gICAgICAgICAgICAgICAgdmFyIHJvdyA9IHNlbGVjdGlvbi5jdXJzb3Iucm93O1xuICAgICAgICAgICAgICAgIGlmIChyb3cgPT09IHJvd0VuZCArIDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcm93U3RhcnQgPSByb3dFbmQgKyAxO1xuICAgICAgICAgICAgICAgICAgICByb3dFbmQgPSByb3dTdGFydCArIDIgKiBudW1iZXJPZkV4dHJhTGluZXM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHJvdyA9PT0gcm93U3RhcnQgLSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJvd0VuZCA9IHJvd1N0YXJ0IC0gMTtcbiAgICAgICAgICAgICAgICAgICAgcm93U3RhcnQgPSByb3dFbmQgLSAyICogbnVtYmVyT2ZFeHRyYUxpbmVzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChyb3cgPCByb3dTdGFydCAtIDEgfHwgcm93ID4gcm93RW5kICsgMSkge1xuICAgICAgICAgICAgICAgICAgICByb3dTdGFydCA9IHJvdyA+IG51bWJlck9mRXh0cmFMaW5lcyA/IHJvdyAtIG51bWJlck9mRXh0cmFMaW5lcyA6IDA7XG4gICAgICAgICAgICAgICAgICAgIHJvd0VuZCA9IHJvdyA+IG51bWJlck9mRXh0cmFMaW5lcyA/IHJvdyArIG51bWJlck9mRXh0cmFMaW5lcyA6IDIgKiBudW1iZXJPZkV4dHJhTGluZXM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBsaW5lcyA9IFtdO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSByb3dTdGFydDsgaSA8PSByb3dFbmQ7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBsaW5lcy5wdXNoKGhvc3Quc2Vzc2lvbi5nZXRMaW5lKGkpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGluZSA9IGxpbmVzLmpvaW4oJ1xcbicpO1xuICAgICAgICAgICAgICAgIHNlbGVjdGlvblN0YXJ0ID0gcG9zaXRpb25Ub1NlbGVjdGlvbihyYW5nZS5zdGFydC5yb3csIHJhbmdlLnN0YXJ0LmNvbHVtbik7XG4gICAgICAgICAgICAgICAgc2VsZWN0aW9uRW5kID0gcG9zaXRpb25Ub1NlbGVjdGlvbihyYW5nZS5lbmQucm93LCByYW5nZS5lbmQuY29sdW1uKTtcbiAgICAgICAgICAgICAgICBpZiAocmFuZ2Uuc3RhcnQucm93IDwgcm93U3RhcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHByZXZMaW5lID0gaG9zdC5zZXNzaW9uLmdldExpbmUocm93U3RhcnQgLSAxKTtcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uU3RhcnQgPSByYW5nZS5zdGFydC5yb3cgPCByb3dTdGFydCAtIDEgPyAwIDogc2VsZWN0aW9uU3RhcnQ7XG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbkVuZCArPSBwcmV2TGluZS5sZW5ndGggKyAxO1xuICAgICAgICAgICAgICAgICAgICBsaW5lID0gcHJldkxpbmUgKyBcIlxcblwiICsgbGluZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAocmFuZ2UuZW5kLnJvdyA+IHJvd0VuZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbmV4dExpbmUgPSBob3N0LnNlc3Npb24uZ2V0TGluZShyb3dFbmQgKyAxKTtcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uRW5kID0gcmFuZ2UuZW5kLnJvdyA+IHJvd0VuZCArIDEgPyBuZXh0TGluZS5sZW5ndGggOiByYW5nZS5lbmQuY29sdW1uO1xuICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb25FbmQgKz0gbGluZS5sZW5ndGggKyAxO1xuICAgICAgICAgICAgICAgICAgICBsaW5lID0gbGluZSArIFwiXFxuXCIgKyBuZXh0TGluZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoaXNNb2JpbGUgJiYgcm93ID4gMCkge1xuICAgICAgICAgICAgICAgICAgICBsaW5lID0gXCJcXG5cIiArIGxpbmU7XG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbkVuZCArPSAxO1xuICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb25TdGFydCArPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAobGluZS5sZW5ndGggPiBNQVhfTElORV9MRU5HVEgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGVjdGlvblN0YXJ0IDwgTUFYX0xJTkVfTEVOR1RIICYmIHNlbGVjdGlvbkVuZCA8IE1BWF9MSU5FX0xFTkdUSCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZSA9IGxpbmUuc2xpY2UoMCwgTUFYX0xJTkVfTEVOR1RIKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUgPSBcIlxcblwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGVjdGlvblN0YXJ0ID09IHNlbGVjdGlvbkVuZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvblN0YXJ0ID0gc2VsZWN0aW9uRW5kID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvblN0YXJ0ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb25FbmQgPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBuZXdWYWx1ZSA9IGxpbmUgKyBcIlxcblxcblwiO1xuICAgICAgICAgICAgICAgIGlmIChuZXdWYWx1ZSAhPSBsYXN0VmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGV4dC52YWx1ZSA9IGxhc3RWYWx1ZSA9IG5ld1ZhbHVlO1xuICAgICAgICAgICAgICAgICAgICBsYXN0U2VsZWN0aW9uU3RhcnQgPSBsYXN0U2VsZWN0aW9uRW5kID0gbmV3VmFsdWUubGVuZ3RoO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChhZnRlckNvbnRleHRNZW51KSB7XG4gICAgICAgICAgICAgICAgbGFzdFNlbGVjdGlvblN0YXJ0ID0gdGV4dC5zZWxlY3Rpb25TdGFydDtcbiAgICAgICAgICAgICAgICBsYXN0U2VsZWN0aW9uRW5kID0gdGV4dC5zZWxlY3Rpb25FbmQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobGFzdFNlbGVjdGlvbkVuZCAhPSBzZWxlY3Rpb25FbmRcbiAgICAgICAgICAgICAgICB8fCBsYXN0U2VsZWN0aW9uU3RhcnQgIT0gc2VsZWN0aW9uU3RhcnRcbiAgICAgICAgICAgICAgICB8fCB0ZXh0LnNlbGVjdGlvbkVuZCAhPSBsYXN0U2VsZWN0aW9uRW5kIC8vIG9uIGllIGVkZ2Ugc2VsZWN0aW9uRW5kIGNoYW5nZXMgc2lsZW50bHkgYWZ0ZXIgdGhlIGluaXRpYWxpemF0aW9uXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICA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gICAgICAgICAgICAgICAgZXh0ZW5kTGVmdCA9IC1lbmRJbmRleDtcbiAgICAgICAgICAgICAgICBlbmRJbmRleCA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpbnNlcnRlZCA9IGluc2VydGVkLnNsaWNlKDAsIGVuZEluZGV4KTtcbiAgICAgICAgICAgIGlmICghZnJvbUlucHV0ICYmICFpbnNlcnRlZCAmJiAhcmVzdG9yZVN0YXJ0ICYmICFleHRlbmRMZWZ0ICYmICFleHRlbmRSaWdodCAmJiAhcmVzdG9yZUVuZClcbiAgICAgICAgICAgICAgICByZXR1cm4gXCJcIjtcbiAgICAgICAgICAgIHNlbmRpbmdUZXh0ID0gdHJ1ZTtcbiAgICAgICAgICAgIHZhciBzaG91bGRSZXNldCA9IGZhbHNlO1xuICAgICAgICAgICAgaWYgKHVzZXJhZ2VudC5pc0FuZHJvaWQgJiYgaW5zZXJ0ZWQgPT0gXCIuIFwiKSB7XG4gICAgICAgICAgICAgICAgaW5zZXJ0ZWQgPSBcIiAgXCI7XG4gICAgICAgICAgICAgICAgc2hvdWxkUmVzZXQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGluc2VydGVkICYmICFleHRlbmRMZWZ0ICYmICFleHRlbmRSaWdodCAmJiAhcmVzdG9yZVN0YXJ0ICYmICFyZXN0b3JlRW5kIHx8IGNvbW1hbmRNb2RlKSB7XG4gICAgICAgICAgICAgICAgaG9zdC5vblRleHRJbnB1dChpbnNlcnRlZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBob3N0Lm9uVGV4dElucHV0KGluc2VydGVkLCB7XG4gICAgICAgICAgICAgICAgICAgIGV4dGVuZExlZnQ6IGV4dGVuZExlZnQsXG4gICAgICAgICAgICAgICAgICAgIGV4dGVuZFJpZ2h0OiBleHRlbmRSaWdodCxcbiAgICAgICAgICAgICAgICAgICAgcmVzdG9yZVN0YXJ0Oi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USCArIDEwMFxuICAgICAgICAgICAgfHwgdmFsdWVSZXNldFJlZ2V4LnRlc3QoaW5zZXJ0ZWQpXG4gICAgICAgICAgICB8fCBpc01vYmlsZSAmJiBsYXN0U2VsZWN0aW9uU3RhcnQgPCAxICYmIGxhc3RTZWxlY3Rpb25TdGFydCA9PSBsYXN0U2VsZWN0aW9uRW5kKSB7XG4gICAgICAgICAgICByZXNldFNlbGVjdGlvbigpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICB2YXIgaGFuZGxlQ2xpcGJvYXJkRGF0YSA9IGZ1bmN0aW9uIChlLCBkYXRhLCBmb3JjZUlFTWltZSkge1xuICAgICAgICB2YXIgY2xpcGJvYXJkRGF0YSA9IGUuY2xpcGJvYXJkRGF0YSB8fCB3aW5kb3dbXCJjbGlwYm9hcmREYXRhXCJdO1xuICAgICAgICBpZiAoIWNsaXBib2FyZERhdGEgfHwgQlJPS0VOX1NFVERBVEEpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIHZhciBtaW1lID0gVVNFX0lFX01JTUVfVFlQRSB8fCBmb3JjZUlFTWltZSA/IFwiVGV4dFwiIDogXCJ0ZXh0L3BsYWluXCI7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBpZiAoZGF0YSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjbGlwYm9hcmREYXRhLnNldERhdGEobWltZSwgZGF0YSkgIT09IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNsaXBib2FyZERhdGEuZ2V0RGF0YShtaW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgaWYgKCFmb3JjZUlFTWltZSlcbiAgICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlQ2xpcGJvYXJkRGF0YShlLCBkYXRhLCB0cnVlKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgdmFyIGRvQ29weSA9IGZ1bmN0aW9uIChlLCBpc0N1dCkge1xuICAgICAgICB2YXIgZGF0YSA9IGhvc3QuZ2V0Q29weVRleHQoKTtcbiAgICAgICAgaWYgKCFkYXRhKVxuICAgICAgICAgICAgcmV0dXJuIGV2ZW50LnByZXZlbnREZWZhdWx0KGUpO1xuICAgICAgICBpZiAoaGFuZGxlQ2xpcGJvYXJkRGF0YShlLCBkYXRhKSkge1xuICAgICAgICAgICAgaWYgKGlzSU9TKSB7XG4gICAgICAgICAgICAgICAgcmVzZXRTZWxlY3Rpb24oZGF0YSk7XG4gICAgICAgICAgICAgICAgY29waWVkID0gZGF0YTtcbiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgY29waWVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfSwgMTApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaXNDdXQgPyBob3N0Lm9uQ3V0KCkgOiBob3N0Lm9uQ29weSgpO1xuICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoZSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBjb3BpZWQgPSB0cnVlO1xuICAgICAgICAgICAgdGV4dC52YWx1ZSA9IGRhdGE7XG4gICAgICAgICAgICB0ZXh0LnNlbGVjdCgpO1xuICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgY29waWVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgcmVzZXRTZWxlY3Rpb24oKTtcbiAgICAgICAgICAgICAgICBpc0N1dCA/IGhvc3Qub25DdXQoKSA6IGhvc3Qub25Db3B5KCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgdmFyIG9uQ3V0ID0gZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgZG9Db3B5KGUsIHRydWUp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V0LCBob3N0KTtcbiAgICBldmVudC5hZGRMaXN0ZW5lcih0ZXh0LCBcImN1dFwiLCBvbkN1dCwgaG9zdCk7XG4gICAgZXZlbnQuYWRkTGlzdGVuZXIodGV4dCwgXCJjb3B5XCIsIG9uQ29weSwgaG9zdCk7XG4gICAgZXZlbnQuYWRkTGlzdGVuZXIodGV4dCwgXCJwYXN0ZVwiLCBvblBhc3RlLCBob3N0KTtcbiAgICBpZiAoISgnb25jdXQnIGluIHRleHQpIHx8ICEoJ29uY29weScgaW4gdGV4dCkgfHwgISgnb25wYXN0ZScgaW4gdGV4dCkpIHtcbiAgICAgICAgZXZlbnQuYWRkTGlzdGVuZXIocGFyZW50Tm9kZSwgXCJrZXlkb3duXCIsIGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICBpZiAoKHVzZXJhZ2VudC5pc01hYyAmJiAhZS5tZXRhS2V5KSB8fCAhZS5jdHJsS2V5KVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIHN3aXRjaCAoZS5rZXlDb2RlKSB7XG4gICAgICAgICAgICAgICAgY2FzZSA2NzpcbiAgICAgICAgICAgICAgICAgICAgb25Db3B5KGUpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDg2OlxuICAgICAgICAgICAgICAgICAgICBvblBhc3RlKGUpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDg4OlxuICAgICAgICAgICAgICAgICAgICBvbkN1dChlKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIGhvc3QpO1xuICAgIH1cbiAgICB2YXIgb25Db21wb3NpdGlvblN0YXJ0ID0gZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgaWYgKGluQ29tcG9zaXRpb24gfHwgIWhvc3Qub25Db21wb3NpdGlvblN0YXJ0IHx8IGhvc3QuJHJlYWRPbmx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RleHQpXG4gICAgICAgICAgICAgICAgaW5Db21wb3NpdGlvbi5jb250ZXh0ID0gdGV4dC5tc0dldElucHV0Q29udGV4dCgpO1xuICAgICAgICAgICAgaWYgKHRleHQuZ2V0SW5wdXRDb250ZXh0KVxuICAgICAgICAgICAgICAgIGluQ29tcG9zaXRpb24uY29udGV4dCA9IHRleHQuZ2V0SW5wdXRDb250ZXh0KCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIHZhciBvbkNvbXBvc2l0aW9uVXBkYXRlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAoIWluQ29tcG9zaXRpb24gfHwgIWhvc3Qub25Db21wb3NpdGlvblVwZGF0ZSB8fCBob3N0LiRyZWFkT25seSlcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgaWYgKGNvbW1hbmRNb2RlKVxuICAgICAgICAgICAgcmV0dXJuIGNhbmNlbENvbXBvc2l0aW9uKCk7XG4gICAgICAgIGlmIChpbkNvbXBvc2l0aW9uLnVzZVRleHRhcmVhRm9ySU1FKSB7XG4gICAgICAgICAgICBob3N0Lm9uQ29tcG9zaXRpb25VcGRhdGUodGV4dC52YWx1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB2YXIgZGF0YSA9IHRleHQudmFsdWU7XG4gICAgICAgICAgICBzZW5kVGV4dChkYXRhKTtcbiAgICAgICAgICAgIGlmIChpbkNvbXBvc2l0aW9uLm1hcmtlclJhbmdlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGluQ29tcG9zaXRpb24uY29udGV4dCkge1xuICAgICAgICAgICAgICAgICAgICBpbkNvbXBvc2l0aW9uLm1hcmtlclJhbmdlLnN0YXJ0LmNvbHVtbiA9IGluQ29tcG9zaXRpb24uc2VsZWN0aW9uU3RhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgID0gaW5Db21wb3NpdGlvbi5jb250ZXh0LmNvbXBvc2l0aW9uU3RhcnRPZmZzZXQ7XG4g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IocGFyZW50Tm9kZSwgaG9zdCwgdGV4dCk7XG4gICAgZnVuY3Rpb24gYWRkSW9zU2VsZWN0aW9uSGFuZGxlcihwYXJlbnROb2RlLCBob3N0LCB0ZXh0KSB7XG4gICAgICAgIHZhciB0eXBpbmdSZXNldFRpbWVvdXQgPSBudWxsO1xuICAgICAgICB2YXIgdHlwaW5nID0gZmFsc2U7XG4gICAgICAgIHRleHQuYWRkRXZlbnRMaXN0ZW5lcihcImtleWRvd25cIiwgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgIGlmICh0eXBpbmdSZXNldFRpbWVvdXQpXG4gICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHR5cGluZ1Jlc2V0VGltZW91dCk7XG4gICAgICAgICAgICB0eXBpbmcgPSB0cnVlO1xuICAgICAgICB9LCB0cnVlKTtcbiAgICAgICAgdGV4dC5hZGRFdmVudExpc3RlbmVyKFwia2V5dXBcIiwgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgIHR5cGluZ1Jlc2V0VGltZW91dCA9IHNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHR5cGluZyA9IGZhbHNlO1xuICAgICAgICAgICAgfSwgMTAwKTtcbiAgICAgICAgfSwgdHJ1ZSk7XG4gICAgICAgIHZhciBkZXRlY3RBcnJvd0tleXMgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgaWYgKGRvY3VtZW50LmFjdGl2ZUVsZW1lbnQgIT09IHRleHQpXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgaWYgKHR5cGluZyB8fCBpbkNvbXBvc2l0aW9uIHx8IGhvc3QuJG1vdXNlSGFuZGxlci5pc01vdXNlUHJlc3NlZClcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICBpZiAoY29waWVkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdm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3RhcnRcbiAgICAgICAgICAgICAgICAgICAgJiYgc2VsZWN0aW9uU3RhcnQgPT0gc2VsZWN0aW9uRW5kKSkge1xuICAgICAgICAgICAgICAgIGtleSA9IEtFWVMubGVmdDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHNlbGVjdGlvbkVuZCA+IGxhc3RTZWxlY3Rpb25FbmQgJiYgbGFzdFZhbHVlLnNsaWNlKDAsIHNlbGVjdGlvbkVuZCkuc3BsaXQoXCJcXG5cIikubGVuZ3RoID4gMikge1xuICAgICAgICAgICAgICAgIGtleSA9IEtFWVMuZG93bjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHNlbGVjdGlvbkVuZCA+IGxhc3RTZWxlY3Rpb25FbmQgJiYgbGFzdFZhbHVlW3NlbGVjdGlvbkVuZCAtIDFdID09IFwiIFwiKSB7XG4gICAgICAgICAgICAgICAga2V5ID0gS0VZUy5yaWdodDtcbiAgICAgICAgICAgICAgICBtb2RpZmllciA9IE1PRFMub3B0aW9uO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoc2VsZWN0aW9uRW5kID4gbGFzdFNlbGVjdGlvbkVuZFxuICAgICAgICAgICAgICAgIHx8IChzZWxlY3Rpb25FbmQgPT0gbGFzdFNlbGVjdGlvbkVuZFxuICAgICAgICAgICAgICAgICAgICAmJiBsYXN0U2VsZWN0aW9uRW5kICE9IGxhc3RTZWxlY3Rpb25TdGFydFxuICAgICAgICAgICAgICAgICAgICAmJiBzZWxlY3Rpb25TdGFydCA9PSBzZWxlY3Rpb25FbmQpKSB7XG4gICAgICAgICAgICAgICAga2V5ID0gS0VZUy5yaWdodDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChzZWxlY3Rpb25TdGFydCAhPT0gc2VsZWN0aW9uRW5kKVxuICAgICAgICAgICAgICAgIG1vZGlmaWVyIHw9IE1PRFMuc2hpZnQ7XG4gICAgICAgICAgICBpZiAoa2V5KSB7XG4gICAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9IGhvc3Qub25Db21tYW5kS2V5KHt9LCBtb2RpZmllciwga2V5KTtcbiAgICAgICAgICAgICAgICBpZiAoIXJlc3VsdCAmJiBob3N0LmNvbW1hbmRzKSB7XG4gICAgICAgICAgICAgICAgICAgIGtleSA9IEtFWVMua2V5Q29kZVRvU3RyaW5nKGtleSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjb21tYW5kID0gaG9zdC5jb21tYW5kcy5maW5kS2V5Q29tbWFuZChtb2RpZmllciwga2V5KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbW1hbmQpXG4gICAgICAgICAgICAgICAgICAgICAgICBob3N0LmV4ZWNDb21tYW5kKGNvbW1hbmQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsYXN0U2VsZWN0aW9uU3RhcnQgPSBzZWxlY3Rpb25TdGFydDtcbiAgICAgICAgICAgICAgICBsYXN0U2VsZWN0aW9uRW5kID0gc2VsZWN0aW9uRW5kO1xuICAgICAgICAgICAgICAgIHJlc2V0U2VsZWN0aW9uKFwiXCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKFwic2VsZWN0aW9uY2hhbmdlXCIsIGRldGVjdEFycm93S2V5cyk7XG4gICAgICAgIGhvc3Qub24oXCJkZXN0cm95XCIsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGRvY3VtZW50LnJlbW92ZUV2ZW50TGlzdGVuZXIoXCJzZWxlY3Rpb25jaGFuZ2VcIiwgZGV0ZWN0QXJyb3dLZXlzKTtcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIHRoaXMuZGVzdHJveSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKHRleHQucGFyZW50RWxlbWVudClcbiAgICAgICAgICAgIHRleHQucGFyZW50RWxlbWVud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ci5jb2x1bW4pXG4gICAgICAgICAgICAgICAgICAgIGN1cnNvciA9IHJhbmdlLnN0YXJ0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY21wRW5kID09IDEgJiYgY21wU3RhcnQgPj0gMCkge1xuICAgICAgICAgICAgICAgIGFuY2hvciA9IHRoaXMuJGNsaWNrU2VsZWN0aW9uLnN0YXJ0O1xuICAgICAgICAgICAgICAgIGlmIChyYW5nZS5zdGFydC5yb3cgIT0gY3Vyc29yLnJvdyB8fCByYW5nZS5zdGFydC5jb2x1bW4gIT0gY3Vyc29yLmNvbHVtbilcbiAgICAgICAgICAgICAgICAgICAgY3Vyc29yID0gcmFuZ2UuZW5kO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY21wU3RhcnQgPT0gLTEgJiYgY21wRW5kID09IDEpIHtcbiAgICAgICAgICAgICAgICBjdXJzb3IgPSByYW5nZS5lbmQ7XG4gICAgICAgICAgICAgICAgYW5jaG9yID0gcmFuZ2Uuc3RhcnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgb3JpZW50ZWRSYW5nZSA9IGNhbGNSYW5nZU9yaWVudGF0aW9uKHRoaXMuJGNsaWNrU2VsZWN0aW9uLCBjdXJzb3IpO1xuICAgICAgICAgICAgICAgIGN1cnNvciA9IG9yaWVudGVkUmFuZ2UuY3Vyc29yO1xuICAgICAgICAgICAgICAgIGFuY2hvciA9IG9yaWVudGVkUmFuZ2UuYW5jaG9yO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWRpdG9yLnNlbGVjdGlvbi5zZXRTZWxlY3Rpb25BbmNob3IoYW5jaG9yLnJvdywgYW5jaG9yLmNvbHVtbik7XG4gICAgICAgIH1cbiAgICAgICAgZWRpdG9yLnNlbGVjdGlvbi5zZWxlY3RUb1Bvc2l0aW9uKGN1cnNvcik7XG4gICAgICAgIGVkaXRvci5yZ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HJ5IHtcbiAgICAgICAgICAgIGZvciAodmFyIF9jID0gX192YWx1ZXModGhpcy5wb3B1cHMpLCBfZCA9IF9jLm5leHQoKTsgIV9kLmRvbmU7IF9kID0gX2MubmV4dCgpKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBvcHVwID0gX2QudmFsdWU7XG4gICAgICAgICAgICAgICAgdmFyIHNob3VsZERpc3BsYXkgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHZpc2libGVwb3B1cHNfMSA9IChlXzIgPSB2b2lkIDAsIF9fdmFsdWVzKHZpc2libGVwb3B1cHMpKSwgdmlzaWJsZXBvcHVwc18xXzEgPSB2aXNpYmxlcG9wdXBzXzEubmV4dCgpOyAhdmlzaWJsZXBvcHVwc18xXzEuZG9uZTsgdmlzaWJsZXBvcHVwc18xXzEgPSB2aXNpYmxlcG9wdXBzXzEubmV4dCgpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlzaWJsZVBvcHVwID0gdmlzaWJsZXBvcHVwc18xXzEudmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5kb1BvcHVwc092ZXJsYXAodmlzaWJsZVBvcHVwLCBwb3B1cCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG91bGREaXNwbGF5ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2F0Y2ggKGVfMl8xKSB7IGVfMiA9IHsgZXJyb3I6IGVfMl8xIH07IH1cbiAgICAgICAgICAgICAgICBmaW5hbGx5IHtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2aXNpYmxlcG9wdXBzXzFfM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ZWdpb24oZSk7XG4gICAgICAgIGlmIChndXR0ZXJSZWdpb24gPT0gXCJmb2xkV2lkZ2V0c1wiKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB2YXIgcm93ID0gZS5nZXREb2N1bWVudFBvc2l0aW9uKCkucm93O1xuICAgICAgICB2YXIgc2VsZWN0aW9uID0gZWRpdG9yLnNlc3Npb24uc2VsZWN0aW9uO1xuICAgICAgICBpZiAoZS5nZXRTaGlmdEtleSgpKVxuICAgICAgICAgICAgc2VsZWN0aW9uLnNlbGVjdFRvKHJvdywgMCk7XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKGUuZG9tRXZlbnQuZGV0YWlsID09IDIpIHtcbiAgICAgICAgICAgICAgICBlZGl0b3Iuc2VsZWN0QWxsKCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG1vdXNlSGFuZGxlci4kY2xpY2tTZWxlY3Rpb24gPSBlZGl0b3Iuc2VsZWN0aW9uLmdldExpbmVSYW5nZShyb3cpO1xuICAgICAgICB9XG4gICAgICAgIG1vdXNlSGFuZGxlci5zZXRTdGF0ZShcInNlbGVjdEJ5TGluZXNcIik7XG4gICAgICAgIG1vdXNlSGFuZGxlci5jYXB0dXJlTW91c2UoZSk7XG4gICAgICAgIHJldHVybiBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgfSk7XG4gICAgdmFyIHRvb2x0aXBUaW1lb3V0LCBtb3VzZUV2ZW50O1xuICAgIGZ1bmN0aW9uIHNob3dUb29sdGlwKCkge1xuICAgICAgICB2YXIgcm93ID0gbW91c2VFdmVudC5nZXREb2N1bWVudFBvc2l0aW9uKCkucm93O1xuICAgICAgICB2YXIgbWF4Um93ID0gZWRpdG9yLnNlc3Npb24uZ2V0TGVuZ3RoKCk7XG4gICAgICAgIGlmIChyb3cgPT0gbWF4Um93KSB7XG4gICAgICAgICAgICB2YXIgc2NyZWVuUm93ID0gZWRpdG9yLnJlbmRlcmVyLnBpeGVsVG9TY3JlZW5Db29yZGluYXRlcygwLCBtb3VzZUV2ZW50LnkpLnJvdztcbiAgICAgICAgICAgIHZhciBwb3MgPSBtb3VzZUV2ZW50LiRwb3M7XG4gICAgICAgICAgICBpZiAoc2NyZWVuUm93ID4gZWRpdG9yLnNlc3Npb24uZG9jdW1lbnRUb1NjcmVlblJvdyhwb3Mucm93LCBwb3MuY29sdW1uKSlcbiAgICAgICAgICAgICAgICByZXR1cm4gaGlkZVRvb2x0aXAoKTtcbiAgICAgICAgfVxuICAgICAgICB0b29sdGlwLnNob3dUb29sdGlwKHJvdyk7XG4gICAgICAgIGlmICghdG9vbHRpcC5pc09wZW4pXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIGVkaXRvci5vbihcIm1vdXNld2hlZWxcIiwgaGlkZVRvb2x0aXApO1xuICAgICAgICBpZiAobW91c2VIYW5kbGVyLiR0b29sdGlwRm9sbG93c01vdXNlKSB7XG4gICAgICAgICAgICBtb3ZlVG9vbHRpcChtb3VzZUV2ZW50KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHZhciBndXR0ZXJSb3cgPSBtb3VzZUV2ZW50LmdldEd1dHRlclJvdygpO1xuICAgICAgICAgICAgdmFyIGd1dHRlckNlbGwgPSBndXR0ZXIuJGxpbmVzLmdldChndXR0ZXJSb3cpO1xuICAgICAgICAgICAgaWYgKGd1dHRlckNlbGwpIHtcbiAgICAgICAgICAgICAgICB2YXIgZ3V0dGVyRWxlbWVudCA9IGd1dHRlckNlbGwuZWxlbWVudC5xdWVyeVNlbGVjdG9yKFwiLmFjZV9ndXR0ZXJfYW5ub3RhdGlvblwiKTtcbiAgICAgICAgICAgICAgICB2YXIgcmVjdCA9IGd1dHRlckVsZW1lbnQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XG4gICAgICAgICAgICAgICAgdmFyIHN0eWxlID0g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S5zZXRQb3NpdGlvbi5jYWxsKHRoaXMsIHgsIHkpO1xuICAgIH07XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEd1dHRlclRvb2x0aXAsIFwiYW5ub3RhdGlvbkxhYmVsc1wiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBlcnJvcjoge1xuICAgICAgICAgICAgICAgICAgICBzaW5ndWxhcjogbmxzKFwiZ3V0dGVyLXRvb2x0aXAuYXJpYS1sYWJlbC5lcnJvci5zaW5ndWxhclwiLCBcImVycm9yXCIpLFxuICAgICAgICAgICAgICAgICAgICBwbHVyYWw6IG5scyhcImd1dHRlci10b29sdGlwLmFyaWEtbGFiZWwuZXJyb3IucGx1cmFsXCIsIFwiZXJyb3JzXCIpXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB3YXJuaW5nOiB7XG4gICAgICAgICAgICAgICAgICAgIHNpbmd1bGFyOiBubHMoXCJndXR0ZXItdG9vbHRpcC5hcmlhLWxhYmVsLndhcm5pbmcuc2luZ3VsYXJcIiwgXCJ3YXJuaW5nXCIpLFxuICAgICAgICAgICAgICAgICAgICBwbHVyYWw6IG5scyhcImd1dHRlci10b29sdGlwLmFyaWEtbGFiZWwud2FybmluZy5wbHVyYWxcIiwgXCJ3YXJuaW5nc1wiKVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgaW5mbzoge1xuICAgICAgICAgICAgICAgICAgICBzaW5ndWxhcjogbmxzKFwiZ3V0dGVyLXRvb2x0aXAuYXJpYS1sYWJlbC5pbmZvLnNpbmd1bGFyXCIsIFwiaW5mb3JtYXRpb24gbWVzc2FnZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgcGx1cmFsOiBubHMoXCJndXR0ZXItdG9vbHRpcC5hcmlhLWxhYmVsLmluZm8ucGx1cmFsXCIsIFwiaW5mb3JtYXRpb24gbWVzc2F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FndXR0ZXIuJGFubm90YXRpb25zW2ldKVxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGd1dHRlci4kYW5ub3RhdGlvbnNbaV0udGV4dC5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYW5ub3RhdGlvblR5cGUgPSBndXR0ZXIuJGFubm90YXRpb25zW2ldLnR5cGVbal07XG4gICAgICAgICAgICAgICAgICAgIGFubm90YXRpb25zSW5Gb2xkW2Fubm90YXRpb25UeXBlXS5wdXNoKGd1dHRlci4kYW5ub3RhdGlvbnNbaV0udGV4dFtqXSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhbm5vdGF0aW9uVHlwZSA9PT0gXCJlcnJvclwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtb3N0U2V2ZXJlQW5ub3RhdGlvbkluRm9sZFR5cGUgPSBcImVycm9yX2ZvbGRcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChhbm5vdGF0aW9uVHlwZSA9PT0gXCJ3YXJuaW5nXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1vc3RTZXZlcmVBbm5vdGF0aW9uSW5Gb2xkVHlwZSA9IFwid2FybmluZ19mb2xkXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtb3N0U2V2ZXJlQW5ub3RhdGlvbkluRm9sZFR5cGUgPT09IFwiZXJyb3JfZm9sZFwiIHx8IG1vc3RTZXZlcmVBbm5vdGF0aW9uSW5Gb2xkVHlwZSA9PT0gXCJ3YXJuaW5nX2ZvbGRcIikge1xuICAgICAgICAgICAgICAgIHZhciB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XMub25EcmFnTGVhdmUgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICBjb3VudGVyLS07XG4gICAgICAgIGlmIChjb3VudGVyIDw9IDAgJiYgZHJhZ1NlbGVjdGlvbk1hcmtlcikge1xuICAgICAgICAgICAgY2xlYXJEcmFnTWFya2VyKCk7XG4gICAgICAgICAgICBkcmFnT3BlcmF0aW9uID0gbnVsbDtcbiAgICAgICAgICAgIHJldHVybiBldmVudC5wcmV2ZW50RGVmYXVsdChlKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgdGhpcy5vbkRyb3AgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICBpZiAoIWRyYWdDdXJzb3IpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIHZhciBkYXRhVHJhbnNmZXIgPSBlLmRhdGFUcmFuc2ZlcjtcbiAgICAgICAgaWYgKGlzSW50ZXJuYWwpIHtcbiAgICAgICAgICAgIHN3aXRjaCAoZHJhZ09wZXJhdGlvbikge1xuICAgICAgICAgICAgICAgIGNhc2UgXCJtb3ZlXCI6XG4gICAgICAgICAgICAgICAgICAgIGlmIChyYW5nZS5jb250YWlucyhkcmFnQ3Vyc29yLnJvdywgZHJhZ0N1cnNvci5jb2x1bW4pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByYW5nZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydDogZHJhZ0N1cnNvcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IGRyYWdDdXJzb3JcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByYW5nZSA9IGVkaXRvci5tb3ZlVGV4dChyYW5nZSwgZHJhZ0N1cnNvcik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAg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lja0NvdW50ID09PSAxICYmIGJ1dHRvbiA9PT0gMCAmJiBpblNlbGVjdGlvbikge1xuICAgICAgICAgICAgaWYgKGUuZWRpdG9yLmluTXVsdGlTZWxlY3RNb2RlICYmIChlLmdldEFjY2VsS2V5KCkgfHwgZS5nZXRTaGlmdEtleSgpKSlcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB0aGlzLm1vdXNlZG93bkV2ZW50LnRpbWUgPSBEYXRlLm5vdygpO1xuICAgICAgICAgICAgdmFyIGV2ZW50VGFyZ2V0ID0gZS5kb21FdmVudC50YXJnZXQgfHwgZS5kb21FdmVudC5zcmNFbGVtZW50O1xuICAgICAgICAgICAgaWYgKFwidW5zZWxlY3RhYmxlXCIgaW4gZXZlbnRUYXJnZXQpXG4gICAgICAgICAgICAgICAgZXZlbnRUYXJnZXQudW5zZWxlY3RhYmxlID0gXCJvblwiO1xuICAgICAgICAgICAgaWYgKGVkaXRvci5nZXREcmFnRGVsYXkoKSkge1xuICAgICAgICAgICAgICAgIGlmICh1c2VyYWdlbnQuaXNXZWJLaXQpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jYW5jZWxEcmFnID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1vdXNlVGFyZ2V0ID0gZWRpdG9yLmNvbnRhaW5lcjtcbiAgICAgICAgICAgICAgICAgICAgbW91c2VUYXJnZXQuZHJhZ2dhYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRTdGF0ZShcImRyYWdXYWl0XCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zdGFydERyYWcoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuY2FwdHVyZU1vdXNlKGUsIHRoaXMub25Nb3VzZURyYWcuYmluZCh0aGlzKSk7XG4gICAgICAgICAgICBlLmR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ZXh0KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGFjdGlvbikge1xuICAgICAgICAgICAgICAgIGlmIChhY3Rpb24gPT0gXCJjdXRcIiB8fCBhY3Rpb24gPT0gXCJjb3B5XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNsaXBib2FyZClcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsaXBib2FyZC53cml0ZVRleHQoZWRpdG9yLmdldENvcHlUZXh0KCkpO1xuICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5leGVjQ29tbWFuZChcImNvcHlcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVkaXRvci5leGVjQ29tbWFuZChhY3Rpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29udGV4dE1lbnUuZmlyc3RDaGlsZC5zdHlsZS5kaXNwbGF5ID0gXCJub25lXCI7XG4gICAgICAgICAgICBpc09wZW4gPSBmYWxzZTtcbiAgICAgICAgICAgIGlmIChhY3Rpb24gIT0gXCJvcGVuQ29tbWFuZFBhbGV0dGVcIilcbiAgICAgICAgICAgICAgICBlZGl0b3IuZm9jdXMoKTtcbiAgICAgICAgfTtcbiAgICAgICAgY29udGV4dE1lbnUgPSBkb20uYnVpbGREb20oW1wiZGl2XCIsXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgY2xhc3M6IFwiYWNlX21vYmlsZS1tZW51XCIsXG4gICAgICAgICAgICAgICAgb250b3VjaHN0YXJ0OiBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgICAgICBtb2RlID0gXCJtZW51XCI7XG4gICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAgICAgZWRpdG9yLnRleHRJbnB1dC5mb2N1cygpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgb250b3VjaGVuZDogZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICBoYW5kbGVDbGljayhlKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG9uY2xpY2s6IGhhbmRsZUNsaWNrXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgW1wic3BhblwiXSxcbiAgICAgICAgICAgIFtcInNwYW5cIiwgeyBjbGFzczogXCJhY2VfbW9iaWxlLWJ1dHRvblwiLCBhY3Rpb246IFwibW9yZVwiIH0sIFwiLi4uXCJdXG4gICAgICAgIF0sIGVkaXRvci5jb250YWluZXIpO1xuICAgIH1cbiAgICBmdW5jdGlvbiBzaG93Q29udGV4dE1lbnUoKSB7XG4gICAgICAgIGlmICghY29udGV4dE1lbnUpXG4gICAgICAgICAgICBjcmVhdGVDb250ZXh0TWVudSgpO1xuICAgICAgICB2YXIgY3Vyc29yID0gZWRpdG9yLnNlbGVjdGlvbi5jdXJzb3I7XG4gICAgICAgIHZhciBwYWdlUG9zID0gZWRpdG9yLnJlbmRlcmVyLnRleHRUb1NjcmVlbkNvb3JkaW5hdGVzKGN1cnNvci5yb3csIGN1cnNvci5jb2x1bW4pO1xuICAgICAgICB2YXIgbGVmdE9mZnNldCA9IGVkaXRvci5yZW5kZXJlci50ZXh0VG9TY3JlZW5Db29yZGluYXRlcygwLCAwKS5wYWdlWDtcbiAgICAgICAgdmFyIHNjcm9sbExlZnQgPSBlZGl0b3IucmVuZGVyZXIuc2Nyb2xsTGVmdDtcbiAgICAgICAgdmFyIHJlY3QgPSBlZGl0b3IuY29udGFpbmVyLmdldEJvdW5kaW5nQ2xpZW50UmVjd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3RlbmVyKGVsLCBcImNvbnRleHRtZW51XCIsIGZ1bmN0aW9uIChlKSB7XG4gICAgICAgIGlmICghcHJlc3NlZClcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgdmFyIHRleHRhcmVhID0gZWRpdG9yLnRleHRJbnB1dC5nZXRFbGVtZW50KCk7XG4gICAgICAgIHRleHRhcmVhLmZvY3VzKCk7XG4gICAgfSwgZWRpdG9yKTtcbiAgICBldmVudC5hZGRMaXN0ZW5lcihlbCwgXCJ0b3VjaHN0YXJ0XCIsIGZ1bmN0aW9uIChlKSB7XG4gICAgICAgIHZhciB0b3VjaGVzID0gZS50b3VjaGVzO1xuICAgICAgICBpZiAobG9uZ1RvdWNoVGltZXIgfHwgdG91Y2hlcy5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICBjbGVhclRpbWVvdXQobG9uZ1RvdWNoVGltZXIpO1xuICAgICAgICAgICAgbG9uZ1RvdWNoVGltZXIgPSBudWxsO1xuICAgICAgICAgICAgdG91Y2hTdGFydFQgPSAtMTtcbiAgICAgICAgICAgIG1vZGUgPSBcInpvb21cIjtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBwcmVzc2VkID0gZWRpdG9yLiRtb3VzZUhhbmRsZXIuaXNNb3VzZVByZXNzZWQgPSB0cnVlO1xuICAgICAgICB2YXIgaCA9IGVkaXRvci5yZW5kZXJlci5sYXllckNvbmZpZy5saW5lSGVpZ2h0O1xuICAgICAgICB2YXIgdyA9IGVkaXRvci5yZW5kZXJlci5sYXllckNvbmZpZy5saW5lSGVpZ2h0O1xuICAgICAgICB2YXIgdCA9IGUudGltZVN0YW1wO1xuICAgICAgICBsYXN0VCA9IHQ7XG4gICAgICAgIHZhciB0b3VjaE9iaiA9IHRvdWNoZXNbMF07XG4gICAgICAgIHZhciB4ID0gdG91Y2hPYmouY2xpZW50WDtcbiAgICAgICAgdmFyIHkgPSB0b3VjaE9iai5jbGllbnRZO1xuICAgICAgICBpZ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Sk7XG4gICAgICAgICAgICB2YXIgcmVjdCA9IGVkaXRvci5yZW5kZXJlci5zY3JvbGxlci5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKTtcbiAgICAgICAgICAgIHZhciBvZmZzZXRUb3AgPSBlZGl0b3IucmVuZGVyZXIubGF5ZXJDb25maWcub2Zmc2V0O1xuICAgICAgICAgICAgdmFyIG9mZnNldExlZnQgPSBlZGl0b3IucmVuZGVyZXIuc2Nyb2xsTGVmdDtcbiAgICAgICAgICAgIHZhciB3ZWlnaHRlZERpc3RhbmNlID0gZnVuY3Rpb24gKHgsIHkpIHtcbiAgICAgICAgICAgICAgICB4ID0geCAvIHc7XG4gICAgICAgICAgICAgICAgeSA9IHkgLyBoIC0gMC43NTtcbiAgICAgICAgICAgICAgICByZXR1cm4geCAqIHggKyB5ICogeTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoZS5jbGllbnRYIDwgcmVjdC5sZWZ0KSB7XG4gICAgICAgICAgICAgICAgbW9kZSA9IFwiem9vbVwiO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBkaWZmMSA9IHdlaWdodGVkRGlzdGFuY2UoZS5jbGllbnRYIC0gcmVjdC5sZWZ0IC0gY3Vyc29yUG9zLmxlZnQgKyBvZmZzZXRMZWZ0LCBlLmNsaWVudFkgLSByZWN0LnRvcCAtIGN1cnNvclBvcy50b3AgKyBvZmZzZXRUb3ApO1xuICAgICAgICAgICAgdmFyIGRpZmYyID0gd2VpZ2h0ZWREaXN0YW5jZShlLmNsaWVudFggLSByZWN0LmxlZnQgLSBhbmNob3JQb3MubGVmdCArIG9mZnNldExlZnQsIGUuY2xpZW50WSAtIHJlY3QudG9wIC0gYW5jaG9yUG9zLnRvcCArIG9mZnNldFRvcCk7XG4gICAgICAgICAgICBpZiAoZGlmZjEgPCAzLjUgJiYgZGlmZjIgPCAzLjUpXG4gICAgICAgICAgICAgICAgbW9kZSA9IGRpZmYxID4gZGlmZjIgPyBcImN1cnNvclwiIDogXCJhbmNob3JcIjtcbiAgICAgICAgICAgIGlmIChkaWZmMiA8IDMuNSlcbiAgICAgICAgICAgICAgICBtb2RlID0gXCJhbmNob3JcIjtcbiAgICAgICAgICAgIGVsc2UgaWYgKGRpZmYxIDwgMy41KVxuICAgICAgICAgICAgICAgIG1vZGUgPSBcImN1cnNvclwiO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIG1vZGUgPSBcInNjcm9sbFwiO1xuICAgICAgICAgICAgbG9uZ1RvdWNoVGltZXIgPSBzZXRUaW1lb3V0KGhhbmRsZUxvbmdUYXAsIDQ1MCk7XG4gICAgICAgIH1cbiAgICAgICAgdG91Y2hTdGFydFQgPSB0O1xuICAgIH0sIGVkaXRvcik7XG4gICAgZXZlbnQuYWRkTGlzdGVuZXIoZWwsIFwidG91Y2hlbmRcIiwgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgcHJlc3NlZCA9IGVkaXRvci4kbW91c2VIYW5kbGVyLmlzTW91c2VQcmVzc2VkID0gZmFsc2U7XG4gICAgICAgIGlmIChhbmltYXRpb25UaW1lcilcbiAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwoYW5pbWF0aW9uVGltZXIpO1xuICAgICAgICBpZiAobW9kZSA9PSBcInpvb21cIikge1xuICAgICAgICAgICAgbW9kZSA9IFwiXCI7XG4gICAgICAgICAgICBhbmltYXRpb25TdGVwcyA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAobG9uZ1RvdWNoVGltZXIpIHtcbiAgICAgICAgICAgIGVkaXRvci5zZWxlY3Rpb24ubW92ZVRvUG9zaXRpb24ocG9zKTtcbiAgICAgICAgICAgIGFuaW1hdGlvblN0ZXBzID0gMDtcbiAgICAgICAgICAgIHNob3dDb250ZXh0TWVudSgpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKG1vZGUgPT0gXCJzY3JvbGxcIikge1xuICAgICAgICAgICAgYW5pbWF0ZSgpO1xuICAgICAgICAgICAgaGlkZUNvbnRleHRNZW51KCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBzaG93Q29udGV4dE1lbnUoKTtcbiAgICAgICAgfVxuICAgICAgICBjbGVhclRpbWVvdXQobG9uZ1RvdWNoVGltZXIpO1xuICAgICAgICBsb25nVG91Y2hUaW1lciA9IG51bGw7XG4gICAgfSwgZWRpdG9yKTtcbiAgICBldmVudC5hZGRMaXN0ZW5lcihlbCwgXCJ0b3VjaG1vdmVcIiwgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgaWYgKGxvbmdUb3VjaFRpbWVyKSB7XG4gICAgICAgICAgICBjbGVhclRpbWVvdXQobG9uZ1RvdWNoVGltZXIpO1xuICAgICAgICAgICAgbG9uZ1RvdWNoVGltZXIgPSBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHZhciB0b3VjaGVzID0gZS50b3VjaGVzO1xuICAgICAgICBpZiAodG91Y2hlcy5sZW5ndGggPiAxIHx8IG1vZGUgPT0gXCJ6b29tXCIpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIHZhciB0b3VjaE9iaiA9IHRvdWNoZXNbMF07XG4gICAgICAgIHZhciB3aGVlbFggPSBzdGFydFggLSB0b3VjaE9iai5jbGllbnRYO1xuICAgICAgICB2YXIgd2hlZWxZID0gc3RhcnRZIC0gdG91Y2hPYmouY2xpZW50WTtcbiAgICAgICAgaWYgKG1vZGUgPT0gXCJ3YWl0XCIpIHtcbiAgICAgICAgICAgIGlmICh3aGVlbFggKiB3aGVlbFggKyB3aGVlbFkgKiB3aGVlbFkgPiA0KVxuICAgICAgICAgICAgICAgIG1vZGUgPSBcImN1cnNvclwiO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybiBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIH1cbiAgICAgICAgc3RhcnRYID0gdG91Y2hPYmouY2xpZW50WDtcbiAgICAgICAgc3RhcnRZID0gdG91Y2hPYmouY2xpZW50WTtcbiAgICAgICAgZS5jbGllbnRYID0gdG91Y2hPYmouY2xpZW50WDtcbiAgICAgICAgZS5jbGllbnRZID0gdG91Y2hPYmouY2xpZW50WTtcbiAgICAgICAgdmFyIHQgPSBlLnRpbWVTdGFtcDtcbiAgICAgICAgdmFyIGR0ID0gdCAtIGxhc3RUO1xuICAgICAgICBsYXN0VCA9IHQ7XG4gICAgICAgIGlmIChtb2RlID09IFwic2Nyb2xsXCIpIHtcbiAgICAgICAgICAgIHZhciBtb3VzZUV2ZW50ID0gbmV3IE1vdXNlRXZlbnQoZSwgZWRpdG9yKTtcbiAgICAgICAgICAgIG1vdXNlRXZlbnQuc3BlZWQgPSAxO1xuICAgICAgICAgICAgbW91c2VFdmVudC53aGVlbFggPSB3aGVlbFg7XG4gICAgICAgICAgICBtb3VzZUV2ZW50LndoZWVsWSA9IHdoZWVsWTtcbiAgICAgICAgICAgIGlmICgxMCAqIE1hdGguYWJzKHdoZWVsWCkgPCBNYXRoLmFicyh3aGVlbFkpKVxuICAgICAgICAgICAgICAgIHdoZWVsWCA9IDA7XG4gICAgICAgICAgICBpZiAoMTAgKiBNYXRoLmFicyh3aGVlbFkpIDwgTWF0aC5hYnMod2hlZWxYKSlcbiAgICAgICAgICAgICAgICB3aGVlbFkgPSAwO1xuICAgICAgICAgICAgaWYgKGR0ICE9IDApIHtcbiAgICAgICAgICAgICAgICB2WCA9IHdoZWVsWCAvIGR0O1xuICAgICAgICAgICAgICAgIHZZID0gd2hlZWxZIC8gZHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlZGl0b3IuX2VtaXQoXCJtb3VzZXdoZWVsXCIsIG1vdXNlRXZlbnQpO1xuICAgICAgICAgICAgaWYgKCFtb3VzZUV2ZW50LnByb3BhZ2F0aW9uU3RvcHBlZCkge1xuICAgICAgICAgICAgICAgIHZYID0gdlkgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdmFyIGV2ID0gbmV3IE1vdXNlRXZlbnQoZSwgZWRpdG9yKTtcbiAgICAgICAgICAgIHZhciBwb3MgPSBldi5nZXREb2N1bWVudFBvc2l0aW9uKCk7XG4gICAgICAgICAgICBpZiAobW9kZSA9PSBcImN1cnNvclwiKVxuICAgICAgICAgICAgICAgIGVkaXRvci5zZWxlY3Rpb24ubW92ZUN1cnNvclRvUG9zaXRpb24ocG9zKTtcbiAgICAgICAgICAgIGVsc2UgaWYgKG1vZGUgPT0gXCJhbmNob3JcIilcbiAgICAgICAgICAgICAgICBlZGl0b3Iuc2VsZWN0aW9uLnNldFNlbGVjdGlvbkFuY2hvcihwb3Mucm93LCBwb3MuY29sdW1uKTtcbiAgICAgICAgICAgIGVkaXRvci5yZW5kZXJlci5zY3JvbGxDdXJzb3JJbnRvVmlldyhwb3MpO1xuICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICB9XG4gICAgfSwgZWRpdG9yKTtcbiAgICBmdW5jdGlvbiBhbmltYXRlKCkge1xuICAgICAgICBhbmltYXRpb25TdGVwcyArPSA2MDtcbiAgICAgICAgYW5pbWF0aW9uVGltZXIgPSBzZXRJbnRlcnZhbChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAoYW5pbWF0aW9uU3RlcHMtLSA8PSAwKSB7XG4gICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbChhbmltYXRpb25UaW1lcik7XG4gICAgICAgICAgICAgICAgYW5pbWF0aW9uVGltZXIgPSBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKE1hdGguYWJzKHZYKSA8IDAuMDEpXG4gICAgICAgICAgICAgICAgdlggPSAwO1xuICAgICAgICAgICAgaWYgKE1hdGguYWJzKHZZKSA8IDAuMDEpXG4gICAgICAgICAgICAgICAgdlkgPSAwO1xuICAgICAgICAgICAgaWYgKGF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Qb3NpdGlvbigpO1xuICAgICAgICAgICAgdmFyIHNlc3Npb24gPSBlZGl0b3Iuc2Vzc2lvbjtcbiAgICAgICAgICAgIHZhciBmb2xkID0gc2Vzc2lvbi5nZXRGb2xkQXQocG9zaXRpb24ucm93LCBwb3NpdGlvbi5jb2x1bW4sIDEpO1xuICAgICAgICAgICAgaWYgKGZvbGQpIHtcbiAgICAgICAgICAgICAgICBpZiAoZS5nZXRBY2NlbEtleSgpKVxuICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLnJlbW92ZUZvbGQoZm9sZCk7XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLmV4cGFuZEZvbGQoZm9sZCk7XG4gICAgICAgICAgICAgICAgZS5zdG9wKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgdGFyZ2V0ID0gZS5kb21FdmVudCAmJiBlLmRvbUV2ZW50LnRhcmdldDtcbiAgICAgICAgICAgIGlmICh0YXJnZXQgJiYgZG9tLmhhc0Nzc0NsYXNzKHRhcmdldCwgXCJhY2VfaW5saW5lX2J1dHRvblwiKSkge1xuICAgICAgICAgICAgICAgIGlmIChkb20uaGFzQ3NzQ2xhc3ModGFyZ2V0LCBcImFjZV90b2dnbGVfd3JhcFwiKSkge1xuICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLnNldE9wdGlvbihcIndyYXBcIiwgIXNlc3Npb24uZ2V0VXNlV3JhcE1vZGUoKSk7XG4gICAgICAgICAgICAgICAgICAgIGVkaXRvci5yZW5kZXJlci5zY3JvbGxDdXJzb3JJbnRvVmlldygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGVkaXRvci5vbihcImd1dHRlcmNsaWNrXCIsIGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICB2YXIgZ3V0dGVyUmVnaW9uID0gZWRpdG9yLnJlbmRlcmVyLiRndXR0ZXJM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hLmZpcnN0UmFuZ2U7XG4gICAgICAgICAgICAgICAgaWYgKHJhbmdlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJvdyA9IHJhbmdlLnN0YXJ0LnJvdztcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZvbGQgPSBzZXNzaW9uLmdldEZvbGRBdChyb3csIHNlc3Npb24uZ2V0TGluZShyb3cpLmxlbmd0aCwgMSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChmb2xkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLnJlbW92ZUZvbGQoZm9sZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLmFkZEZvbGQoXCIuLi5cIiwgcmFuZ2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWRpdG9yLnJlbmRlcmVyLnNjcm9sbEN1cnNvckludG9WaWV3KHsgcm93OiByYW5nZS5zdGFydC5yb3csIGNvbHVtbjogMCB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlLnN0b3AoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuICAgIHJldHVybiBGb2xkSGFuZGxlcjtcbn0oKSk7XG5leHBvcnRzLkZvbGRIYW5kbGVyID0gRm9sZEhhbmRsZXI7XG5cbn0pO1xuXG5hY2UuZGVmaW5lKFwiYWNlL2tleWJvYXJkL2tleWJpbmRpbmdcIixbXCJyZXF1aXJlXCIsXCJleHBvcnRzXCIsXCJtb2R1bGVcIixcImFjZS9saWIva2V5c1wiLFwiYWNlL2xpYi9ldmVudFwiXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXtcInVzZSBzdHJpY3RcIjtcbnZhciBrZXlVdGlsID0gcmVxdWlyZShcIi4uL2xpYi9rZXlzXCI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cbiAgICB9O1xuICAgIEtleUJpbmRpbmcucHJvdG90eXBlLmFkZEtleWJvYXJkSGFuZGxlciA9IGZ1bmN0aW9uIChrYiwgcG9zKSB7XG4gICAgICAgIGlmICgha2IpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIGlmICh0eXBlb2Yga2IgPT0gXCJmdW5jdGlvblwiICYmICFrYi5oYW5kbGVLZXlib2FyZClcbiAgICAgICAgICAgIGtiLmhhbmRsZUtleWJvYXJkID0ga2I7XG4gICAgICAgIHZhciBpID0gdGhpcy4kaGFuZGxlcnMuaW5kZXhPZihrYik7XG4gICAgICAgIGlmIChpICE9IC0xKVxuICAgICAgICAgICAgdGhpcy4kaGFuZGxlcnMuc3BsaWNlKGksIDEpO1xuICAgICAgICBpZiAocG9zID09IHVuZGVmaW5lZClcbiAgICAgICAgICAgIHRoaXMuJGhhbmRsZXJzLnB1c2goa2IpO1xuICAgICAgICBlbHNlXG4gICAgICAgICAgICB0aGlzLiRoYW5kbGVycy5zcGxpY2UocG9zLCAwLCBrYik7XG4gICAgICAgIGlmIChpID09IC0xICYmIGtiLmF0dGFjaClcbiAgICAgICAgICAgIGtiLmF0dGFjaCh0aGlzLiRlZGl0b3IpO1xuICAgIH07XG4gICAgS2V5QmluZGluZy5wcm90b3R5cGUucmVtb3ZlS2V5Ym9hcmRIYW5kbGVyID0gZnVuY3Rpb24gKGtiKSB7XG4gICAgICAgIHZhciBpID0gdGhpcy4kaGFuZGxlcnMuaW5kZXhPZihrYik7XG4gICAgICAgIGlmIChpID09IC0xKVxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB0aGlzLiRoYW5kbGVycy5zcGxpY2UoaSwgMSk7XG4gICAgICAgIGtiLmRldGFjaCAmJiBrYi5kZXRhY2godGhpcy4kZWRpdG9yKTtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfTtcbiAgICBLZXlCaW5kaW5nLnByb3RvdHlwZS5nZXRLZXlib2FyZEhhbmRs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XG4gICAgICAgIG5ld1N0YXRlID0gaW1wVGFiW3ByZXZTdGF0ZV1bbmV3Q2xhc3NdO1xuICAgICAgICBhY3Rpb24gPSBuZXdTdGF0ZSAmIDB4RjA7XG4gICAgICAgIG5ld1N0YXRlICY9IDB4MEY7XG4gICAgICAgIGxldmVsc1tpeF0gPSBuZXdMZXZlbCA9IGltcFRhYltuZXdTdGF0ZV1bNV07XG4gICAgICAgIGlmIChhY3Rpb24gPiAwKSB7XG4gICAgICAgICAgICBpZiAoYWN0aW9uID09IDB4MTApIHtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSBjb25kUG9zOyBpIDwgaXg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXZlbHNbaV0gPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25kUG9zID0gLTE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25kUG9zID0gLTE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY29uZCA9IGltcFRhYltuZXdTdGF0ZV1bNl07XG4gICAgICAgIGlmIChjb25kKSB7XG4gICAgICAgICAgICBpZiAoY29uZFBvcyA9PSAtMSkge1xuICAgICAgICAgICAgICAgIGNvbmRQb3MgPSBpeDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmIChjb25kUG9zID4gLTEpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSBjb25kUG9zOyBpIDwgaXg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXZlbHNbaV0gPSBuZXdMZXZlbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY29uZFBvcyA9IC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChjaGFyVHlwZXNbaXhdID09IEIpIHtcbiAgICAgICAgICAgIGxldmVsc1tpeF0gPSAwO1xuICAgICAgICB9XG4gICAgICAgIGhpTGV2ZWwgfD0gbmV3TGV2ZWw7XG4gICAgfVxuICAgIGlmIChoYXNVQkFUX1MpIHtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgICAgICAgICBpZiAoY2hhclR5cGVzW2ldID09IFMpIHtcbiAgICAgICAgICAgICAgICBsZXZlbHNbaV0gPSBkaXI7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IGkgLSAxOyBqID49IDA7IGotLSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2hhclR5cGVzW2pdID09IFdTKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXZlbHNbal0gPSBkaXI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn1cbmZ1bmN0aW9uIF9pbnZlcnRMZXZlbChsZXYsIGxldmVscywgX2FycmF5KSB7XG4gICAgaWYgKGhpTGV2ZWwgPCBsZXYpIHtcbiAgICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICBpZiAobGV2ID09IDEgJiYgZGlyID09IFJUTCAmJiAhaGFzVUJBVF9CKSB7XG4gICAgICAgIF9hcnJheS5yZXZlcnNlKCk7XG4gICAgICAgIHJldHVybjtcbiAgICB9XG4gICAgdmFyIGxlbiA9IF9hcnJheS5sZW5ndGgsIHN0YXJ0ID0gMCwgZW5kLCBsbywgaGksIHRtcDtcbiAgICB3aGlsZSAoc3RhcnQgPCBsZW4pIHtcbiAgICAgICAgaWYgKGxldmVsc1tzdGFydF0gPj0gbGV2KSB7XG4gICAgICAgICAgICBlbmQgPSBzdGFydCArIDE7XG4gICAgICAgICAgICB3aGlsZSAoZW5kIDwgbGVuICYmIGxldmVsc1tlbmRdID49IGxldikge1xuICAgICAgICAgICAgICAgIGVuZCsrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yIChsbyA9IHN0YXJ0LCBoaSA9IGVuZCAtIDE7IGxvIDwgaGk7IGxvKyssIGhpLS0pIHtcbiAgICAgICAgICAgICAgICB0bXAgPSBfYXJyYXlbbG9dO1xuICAgICAgICAgICAgICAgIF9hcnJheVtsb10gPSBfYXJyYXlbaGldO1xuICAgICAgICAgICAgICAgIF9hcnJheVtoaV0gPSB0bXA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzdGFydCA9IGVuZDtcbiAgICAgICAgfVxuICAgICAgICBzdGFydCsrO1xuICAgIH1cbn1cbmZ1bmN0aW9uIF9nZXRDaGFyQ2xhc3MoY2hhcnMsIHR5cGVzLCBjbGFzc2VzLCBpeCkge1xuICAgIHZhciBjVHlwZSA9IHR5cGVzW2l4XSwgd1R5cGUsIG5UeXBlLCBsZW4sIGk7XG4gICAgc3dpdGNoIChjVHlwZSkge1xuICAgICAgICBjYXNlIEw6XG4gICAgICAgIGNhc2UgUjpcbiAgICAgICAgICAgIGxhc3RBcmFiaWMgPSBmYWxzZTtcbiAgICAgICAgY2FzZSBPTjpcbiAgICAgICAgY2FzZSBBTjpcbiAgICAgICAgICAgIHJldHVybiBjVHlwZTtcbiAgICAgICAgY2FzZSBFTjpcbiAgICAgICAgICAgIHJldHVybiBsYXN0QXJhYmljID8gQU4gOiBFTjtcbiAgICAgICAgY2FzZSBBTDpcbiAgICAgICAgICAgIGxhc3RBcmFiaWMgPSB0cnVlO1xuICAgICAgICAgICAgaGFzVUJBVF9BTCA9IHRydWU7XG4gICAgICAgICAgICByZXR1cm4gUjtcbiAgICAgICAgY2FzZSBXUzpcbiAgICAgICAgICAgIHJldHVybiBPTjtcbiAgICAgICAgY2FzZSBDUzpcbiAgICAgICAgICAgIGlmIChpeCA8IDEgfHwgKGl4ICsgMSkgPj0gdHlwZXMubGVuZ3RoIHx8XG4gICAgICAgICAgICAgICAgKCh3VHlwZSA9IGNsYXNzZXNbaXggLSAxXSkgIT0gRU4gJiYgd1R5cGUgIT0gQU4pIHx8XG4gICAgICAgICAgICAgICAgKChuVHlwZSA9IHR5cGVzW2l4ICsgMV0pICE9IEVOICYmIG5UeXBlICE9IEFOKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBPTjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChsYXN0QXJhYmljKSB7XG4gICAgICAgICAgICAgICAgblR5cGUgPSBBTjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBuVHlwZSA9PSB3VHlwZSA/IG5UeXBlIDogT047XG4gICAgICAgIGNhc2UgRVM6XG4gICAgICAgICAgICB3VHlwZSA9IGl4ID4gMCA/IGNsYXNzZXNbaXggLSAxXSA6IEI7XG4gICAgICAgICAgICBpZiAod1R5cGUgPT0gRU4gJiYgKGl4ICsgMSkgPCB0eXBlcy5sZW5ndGggJiYgdHlwZXNbaXggKyAxXSA9PSBFTikge1xuICAgICAgICAgICAgICAgIHJldHVybiBFTjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBPTjtcbiAgICAgICAgY2FzZSBFVDpcbiAgICAgICAgICAgIGlmIChpeCA+IDAgJiYgY2xhc3Nlc1tpeCAtIDFdID09IEVOKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEVOO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGxhc3RBcmFiaWMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gT047XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpID0gaXggKyAxO1xuICAgICAgICAgICAgbGVuID0gdHlwZXMubGVuZ3RoO1xuICAgICAgICAgICAgd2hpbGUgKGkgPCBsZW4gJiYgdHlwZXNbaV0gPT0gRVQpIHtcbiAgICAgICAgICAgICAgICBpKys7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaSA8IGxlbiAmJiB0eXBlc1tpXSA9PSBFTikge1xuICAgICAgICAgICAgICAgIHJldHVybiBFTjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBPTjtcbiAgICAgICAgY2FzZSBOU006XG4gICAgICAgICAgICBsZW4gPSB0eXBlcy5sZW5ndGg7XG4gICAgICAgICAgICBpID0gaXggKyAxO1xuICAgICAgICAgICAgd2hpbGUgKGkgPCBsZW4gJiYgdHlwZXNbaV0gPT0gTlNNKSB7XG4gICAgICAgICAgICAgICAgaSsrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGkgPCBsZW4pIHtcbiAgICAgICAgICAgICAgICB2YXIgYyA9IGNoYXJzW2l4XSwgcnRsQ2FuZGlkYXRlID0gKGMgPj0gMHgwNTkxICYmIGMgPD0gMHgwOEZGKSB8fCBjID09IDB4RkIxRTtcbiAgICAgICAgICAgICAgICB3VHlwZSA9IHR5cGVzW2ldO1xuICAgICAgICAgICAgICAgIGlmIChydGxDYW5kaWRhdGUgJiYgKHdUeXBlID09IFIgfHwgd1R5cGUgPT0gQUwpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBSO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpeCA8IDEgfHwgKHdUeXBlID0gdHlwZXNbaXggLSAxXSkgPT0gQikge1xuICAgICAgICAgICAgICAgIHJldHVybiBPTjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBjbGFzc2VzW2l4IC0gMV07XG4gICAgICAgIGNhc2UgQjpcbiAgICAgICAgICAgIGxhc3RBcmFiaWMgPSBmYWxzZTtcbiAgICAgICAgICAgIGhhc1VCQVRfQiA9IHRydWU7XG4gICAgICAgICAgICByZXR1cm4gZGlyO1xuICAgICAgICBjYXNlIFM6XG4gICAgICAgICAgICBoYXNVQkFUX1MgPSB0cnVlO1xuICAgICAgICAgICAgcmV0dX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HRoaXMuY3VycmVudFJvdyk7XG4gICAgICAgICAgICB3aGlsZSAodGhpcy5jdXJyZW50Um93IC0gc3BsaXRJbmRleCA+IDApIHtcbiAgICAgICAgICAgICAgICBjdXJyZW50SW5kZXggPSB0aGlzLnNlc3Npb24uJGdldFJvd0NhY2hlSW5kZXgocm93Q2FjaGUsIHRoaXMuY3VycmVudFJvdyAtIHNwbGl0SW5kZXggLSAxKTtcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVudEluZGV4ICE9PSBwcmV2SW5kZXgpXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIHByZXZJbmRleCA9IGN1cnJlbnRJbmRleDtcbiAgICAgICAgICAgICAgICBzcGxpdEluZGV4Kys7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBzcGxpdEluZGV4ID0gdGhpcy5jdXJyZW50Um93O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzcGxpdEluZGV4O1xuICAgIH07XG4gICAgQmlkaUhhbmRsZXIucHJvdG90eXBlLnVwZGF0ZVJvd0xpbmUgPSBmdW5jdGlvbiAoZG9jUm93LCBzcGxpdEluZGV4KSB7XG4gICAgICAgIGlmIChkb2NSb3cgPT09IHVuZGVmaW5lZClcbiAgICAgICAgICAgIGRvY1JvdyA9IHRoaXMuZ2V0RG9jdW1lbnRSb3coKTtcbiAgICAgICAgdmFyIGlzTGFzdFJvdyA9IChkb2NSb3cgPT09IHRoaXMuc2Vzc2lvbi5nZXRMZW5ndGgoKSAtIDEpLCBlbmRPZkxpbmUgPSBpc0xhc3RSb3cgPyB0aGlzLkVPRiA6IHRoaXMuRU9MO1xuICAgICAgICB0aGlzLndyYXBJbmRlbnQgPSAwO1xuICAgICAgICB0aGlzLmxpbmUgPSB0aGlzLnNlc3Npb24uZ2V0TGluZShkb2NSb3cpO1xuICAgICAgICB0aGlzLmlzUnRsRGlyID0gdGhpcy4kaXNSdGwgfHwgdGhpcy5saW5lLmNoYXJBdCgwKSA9PT0gdGhpcy5STEU7XG4gICAgICAgIGlmICh0aGlzLnNlc3Npb24uJHVzZVdyYXBNb2RlKSB7XG4gICAgICAgICAgICB2YXIgc3BsaXRzID0gdGhpcy5zZXNzaW9uLiR3cmFwRGF0YVtkb2NSb3ddO1xuICAgICAgICAgICAgaWYgKHNwbGl0cykge1xuICAgICAgICAgICAgICAgIGlmIChzcGxpdEluZGV4ID09PSB1bmRlZmluZWQpXG4gICAgICAgICAgICAgICAgICAgIHNwbGl0SW5kZXggPSB0aGlzLmdldFNwbGl0SW5kZXgoKTtcbiAgICAgICAgICAgICAgICBpZiAoc3BsaXRJbmRleCA+IDAgJiYgc3BsaXRzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLndyYXBJbmRlbnQgPSBzcGxpdHMuaW5kZW50O1xuICAgICAgICAgICAgICAgICAgICB0aGlzLndyYXBPZmZzZXQgPSB0aGlzLndyYXBJbmRlbnQgKiB0aGlzLmNoYXJXaWR0aHNbYmlkaVV0aWwuTF07XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubGluZSA9IChzcGxpdEluZGV4IDwgc3BsaXRzLmxlbmd0aCkgP1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5saW5lLnN1YnN0cmluZyhzcGxpdHNbc3BsaXRJbmRleCAtIDFdLCBzcGxpdHNbc3BsaXRJbmRleF0pIDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubGluZS5zdWJzdHJpbmcoc3BsaXRzW3NwbGl0cy5sZW5ndGggLSAxXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmxpbmUgPSB0aGlzLmxpbmUuc3Vic3RyaW5nKDAsIHNwbGl0c1tzcGxpdEluZGV4XSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChzcGxpdEluZGV4ID09IHNwbGl0cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5saW5lICs9ICh0aGlzLnNob3dJbnZpc2libGVzKSA/IGVuZE9mTGluZSA6IGJpZGlVdGlsLkRPVDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmxpbmUgKz0gdGhpcy5zaG93SW52aXNpYmxlcyA/IGVuZE9mTGluZSA6IGJpZGlVdGlsLkRPVDtcbiAgICAgICAgfVxuICAgICAgICB2YXIgc2Vzc2lvbiA9IHRoaXMuc2Vzc2lvbiwgc2hpZnQgPSAwLCBzaXplO1xuICAgICAgICB0aGlzLmxpbmUgPSB0aGlzLmxpbmUucmVwbGFjZSgvXFx0fFtcXHUxMTAwLVxcdTIwMjksIFxcdTIwMkYtXFx1RkZFNl0vZywgZnVuY3Rpb24gKGNoLCBpKSB7XG4gICAgICAgICAgICBpZiAoY2ggPT09ICdcXHQnIHx8IHNlc3Npb24uaXNGdWxsV2lkdGgoY2guY2hhckNvZGVBdCgwKSkpIHtcbiAgICAgICAgICAgICAgICBzaXplID0gKGNoID09PSAnXFx0JykgPyBzZXNzaW9uLmdldFNjcmVlblRhYlNpemUoaSArIHNoaWZ0KSA6IDI7XG4gICAgICAgICAgICAgICAgc2hpZnQgKz0gc2l6ZSAtIDE7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGxhbmcuc3RyaW5nUmVwZWF0KGJpZGlVdGlsLkRPVCwgc2l6ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gY2g7XG4gICAgICAgIH0pO1xuICAgICAgICBpZiAodGhpcy5pc1J0bERpcikge1xuICAgICAgICAgICAgdGhpcy5mb250TWV0cmljcy4kbWFpbi50ZXh0Q29udGVudCA9ICh0aGlzLmxpbmUuY2hhckF0KHRoaXMubGluZS5sZW5ndGggLSAxKSA9PSBiaWR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G9rZW5SZS5leGVjKGxlZnRPZkN1cnNvcikpIHtcbiAgICAgICAgICAgIGNvbHVtbiAtPSB0aGlzLnNlc3Npb24udG9rZW5SZS5sYXN0SW5kZXg7XG4gICAgICAgICAgICB0aGlzLnNlc3Npb24udG9rZW5SZS5sYXN0SW5kZXggPSAwO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMubW92ZUN1cnNvclRvKHJvdywgY29sdW1uKTtcbiAgICB9O1xuICAgIFNlbGVjdGlvbi5wcm90b3R5cGUuJHNob3J0V29yZEVuZEluZGV4ID0gZnVuY3Rpb24gKHJpZ2h0T2ZDdXJzb3IpIHtcbiAgICAgICAgdmFyIGluZGV4ID0gMCwgY2g7XG4gICAgICAgIHZhciB3aGl0ZXNwYWNlUmUgPSAvXFxzLztcbiAgICAgICAgdmFyIHRva2VuUmUgPSB0aGlzLnNlc3Npb24udG9rZW5SZTtcbiAgICAgICAgdG9rZW5SZS5sYXN0SW5kZXggPSAwO1xuICAgICAgICBpZiAodGhpcy5zZXNzaW9uLnRva2VuUmUuZXhlYyhyaWdodE9mQ3Vyc29yKSkge1xuICAgICAgICAgICAgaW5kZXggPSB0aGlzLnNlc3Npb24udG9rZW5SZS5sYXN0SW5kZXg7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB3aGlsZSAoKGNoID0gcmlnaHRPZkN1cnNvcltpbmRleF0pICYmIHdoaXRlc3BhY2VSZS50ZXN0KGNoKSlcbiAgICAgICAgICAgICAgICBpbmRleCsrO1xuICAgICAgICAgICAgaWYgKGluZGV4IDwgMSkge1xuICAgICAgICAgICAgICAgIHRva2VuUmUubGFzdEluZGV4ID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoKGNoID0gcmlnaHRPZkN1cnNvcltpbmRleF0pICYmICF0b2tlblJlLnRlc3QoY2gpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRva2VuUmUubGFzdEluZGV4ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgaW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgaWYgKHdoaXRlc3BhY2VSZS50ZXN0KGNoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID4gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4LS07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoKGNoID0gcmlnaHRPZkN1cnNvcltpbmRleF0pICYmIHdoaXRlc3BhY2VSZS50ZXN0KGNoKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPiAyKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0b2tlblJlLmxhc3RJbmRleCA9IDA7XG4gICAgICAgIHJldHVybiBpbmRleDtcbiAgICB9O1xuICAgIFNlbGVjdGlvbi5wcm90b3R5cGUubW92ZUN1cnNvclNob3J0V29yZFJpZ2h0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgcm93ID0gdGhpcy5sZWFkLnJvdztcbiAgICAgICAgdmFyIGNvbHVtbiA9IHRoaXMubGVhZC5jb2x1bW47XG4gICAgICAgIHZhciBsaW5lID0gdGhpcy5kb2MuZ2V0TGluZShyb3cpO1xuICAgICAgICB2YXIgcmlnaHRPZkN1cnNvciA9IGxpbmUuc3Vic3RyaW5nKGNvbHVtbik7XG4gICAgICAgIHZhciBmb2xkID0gdGhpcy5zZXNzaW9uLmdldEZvbGRBdChyb3csI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2VsZWN0aW9uLnByb3RvdHlwZS50b0pTT04gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLnJhbmdlQ291bnQpIHsgdmFyIGRhdGEgPSB0aGlzLnJhbmdlcy5tYXAoZnVuY3Rpb24gKHIpIHtcbiAgICAgICAgICAgICAgICB2YXIgcjEgPSByLmNsb25lKCk7XG4gICAgICAgICAgICAgICAgcjEuaXNCYWNrd2FyZHMgPSByLmN1cnNvciA9PSByLnN0YXJ0O1xuICAgICAgICAgICAgICAgIHJldHVybiByMTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgeyB2YXIgZGF0YSA9IHRoaXMuZ2V0UmFuZ2UoKTtcbiAgICAgICAgICAgIGRhdGEuaXNCYWNrd2FyZHMgPSB0aGlzLmlzQmFja3dhcmRzKCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGRhdGE7XG4gICAgfTtcbiAgICBTZWxlY3Rpb24ucHJvdG90eXBlLmZyb21KU09OID0gZnVuY3Rpb24gKGRhdGEpIHtcbiAgICAgICAgaWYgKGRhdGEuc3RhcnQgPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5yYW5nZUxpc3QgJiYgZGF0YS5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICAgICAgdGhpcy50b1NpbmdsZVJhbmdlKGRhdGFbMF0pO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSBkYXRhLmxlbmd0aDsgaS0tOykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgciA9IFJhbmdlLmZyb21Qb2ludHMoZGF0YVtpXS5zdGFydCwgZGF0YVtpXS5lbmQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YVtpXS5pc0JhY2t3YXJkcylcbiAgICAgICAgICAgICAgICAgICAgICAgIHIuY3Vyc29yID0gci5zdGFydDtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hZGRSYW5nZShy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gdGhpcy5tYXRjaE1hcHBpbmdzW2tleV0gPSB7IGRlZmF1bHRUb2tlbjogXCJ0ZXh0XCIgfTtcbiAgICAgICAgICAgIHZhciBmbGFnID0gXCJnXCI7XG4gICAgICAgICAgICB2YXIgc3BsaXR0ZXJSdXJsZXMgPSBbXTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc3RhdGUubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgcnVsZSA9IHN0YXRlW2ldO1xuICAgICAgICAgICAgICAgIGlmIChydWxlLmRlZmF1bHRUb2tlbilcbiAgICAgICAgICAgICAgICAgICAgbWFwcGluZy5kZWZhdWx0VG9rZW4gPSBydWxlLmRlZmF1bHRUb2tlbjtcbiAgICAgICAgICAgICAgICBpZiAocnVsZS5jYXNlSW5zZW5zaXRpdmUgJiYgZmxhZy5pbmRleE9mKFwiaVwiKSA9PT0gLTEpXG4gICAgICAgICAgICAgICAgICAgIGZsYWcgKz0gXCJpXCI7XG4gICAgICAgICAgICAgICAgaWYgKHJ1bGUudW5pY29kZSAmJiBmbGFnLmluZGV4T2YoXCJ1XCIpID09PSAtMSlcbiAgICAgICAgICAgICAgICAgICAgZmxhZyArPSBcInVcIjtcbiAgICAgICAgICAgICAgICBpZiAocnVsZS5yZWdleCA9PSBudWxsKVxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICBpZiAocnVsZS5yZWdleCBpbnN0YW5jZW9mIFJlZ0V4cClcbiAgICAgICAgICAgICAgICAgICAgcnVsZS5yZWdleCA9IHJ1bGUucmVnZXgudG9TdHJpbmcoKS5zbGljZSgxLCAtMSk7XG4gICAgICAgICAgICAgICAgdmFyIGFkanVzdGVkcmVnZXggPSBydWxlLnJlZ2V4O1xuICAgICAgICAgICAgICAgIHZhciBtYXRjaGNvdW50ID0gbmV3IFJlZ0V4cChcIig/OihcIiArIGFkanVzdGVkcmVnZXggKyBcIil8KC4pKVwiKS5leGVjKFwiYVwiKS5sZW5ndGggLSAyO1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHJ1bGUudG9rZW4pKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChydWxlLnRva2VuLmxlbmd0aCA9PSAxIHx8IG1hdGNoY291bnQgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZS50b2tlbiA9IHJ1bGUudG9rZW5bMF07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAobWF0Y2hjb3VudCAtIDEgIT0gcnVsZS50b2tlbi5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVwb3J0RXJyb3IoXCJudW1iZXIgb2YgY2xhc3NlcyBhbmQgcmVnZXhwIGdyb3VwcyBkb2Vzbid0IG1hdGNoXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiBydWxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwQ291bnQ6IG1hdGNoY291bnQgLSAxXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGUudG9rZW4gPSBydWxlLnRva2VuWzBdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZS50b2tlbkFycmF5ID0gcnVsZS50b2tlbjtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGUudG9rZW4gPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZS5vbk1hdGNoID0gdGhpcy4kYXJyYXlUb2tlbnM7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodHlwZW9mIHJ1bGUudG9rZW4gPT0gXCJmdW5jdGlvblwiICYmICFydWxlLm9uTWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hdGNoY291bnQgPiAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZS5vbk1hdGNoID0gdGhpcy4kYXBwbHlUb2tlbjtcbiAgICAgICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZS5vbk1hdGNoID0gcnVsZS50b2tlbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoY291bnQgPiAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXFxcZC8udGVzdChydWxlLnJlZ2V4KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYWRqdXN0ZWRyZWdleCA9IHJ1bGUucmVnZXgucmVwbGFjZSgvXFxcXChbMC05XSspL2csIGZ1bmN0aW9uIChtYXRjaCwgZGlnaXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJcXFxcXCIgKyAocGFyc2VJbnQoZGlnaXQsIDEwKSArIG1hdGNoVG90YWwgKyAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2hjb3VudCA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBhZGp1c3RlZHJlZ2V4ID0gdGhpcy5yZW1vdmVDYXB0dXJpbmdHcm91cHMocnVsZS5yZWdleCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFydWxlLnNwbGl0UmVnZXggJiYgdHlwZW9mIHJ1bGUudG9rZW4gIT0gXCJzdHJpbmdcIilcbiAgICAgICAgICAgICAgICAgICAgICAgIHNwbGl0dGVyUnVybGVzLnB1c2gocnVsZSk7IC8vIGZsYWcgd2lsbCBiZSBrbm93biBvbmx5IGF0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IHRoaXMuc3BsaXRSZWdleC5leGVjKHN0cikuc2xpY2UoMSk7XG4gICAgICAgIHZhciB0eXBlcyA9IHRoaXMudG9rZW4uYXBwbHkodGhpcywgdmFsdWVzKTtcbiAgICAgICAgaWYgKHR5cGVvZiB0eXBlcyA9PT0gXCJzdHJpbmdcIilcbiAgICAgICAgICAgIHJldHVybiBbeyB0eXBlOiB0eXBlcywgdmFsdWU6IHN0ciB9XTtcbiAgICAgICAgdmFyIHRva2VucyA9IFtdO1xuICAgICAgICBmb3IgKHZhciBpID0gMCwgbCA9IHR5cGVzLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgICAgICAgICAgaWYgKHZhbHVlc1tpXSlcbiAgICAgICAgICAgICAgICB0b2tlbnNbdG9rZW5zLmxlbmd0aF0gPSB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IHR5cGVzW2ldLFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWVzW2ldXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdG9rZW5zO1xuICAgIH07XG4gICAgVG9rZW5pemVyLnByb3RvdHlwZS4kYXJyYXlUb2tlbnMgPSBmdW5jdGlvbiAoc3RyKSB7XG4gICAgICAgIGlmICghc3RyKVxuICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICB2YXIgdmFsdWVzID0gdGhpcy5zcGxpdFJlZ2V4LmV4ZWMoc3RyKTtcbiAgICAgICAgaWYgKCF2YWx1ZXMpXG4gICAgICAgICAgICByZXR1cm4gXCJ0ZXh0XCI7XG4gICAgICAgIHZhciB0b2tlbnMgPSBbXTtcbiAgICAgICAgdmFyIHR5cGVzID0gdGhpcy50b2tlbkFycmF5O1xuICAgICAgICBmb3IgKHZhciBpID0gMCwgbCA9IHR5cGVzLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgICAgICAgICAgaWYgKHZhbHVlc1tpICsgMV0pXG4gICAgICAgICAgICAgICAgdG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gICAgICAgIGVsc2UgaWYgKHNxdWFyZSkge1xuICAgICAgICAgICAgICAgICAgICBpbkNoQ2xhc3MgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChwYXJlbkNsb3NlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzdGFjayA9PSBsYXN0Q2FwdHVyZS5zdGFjaykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGFzdENhcHR1cmUuZW5kID0gaW5kZXggKyAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGFzdENhcHR1cmUuc3RhY2sgPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBzdGFjay0tO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChwYXJlbk9wZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgc3RhY2srKztcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmVuT3Blbi5sZW5ndGggIT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGFzdENhcHR1cmUuc3RhY2sgPSBzdGFjaztcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RDYXB0dXJlLnN0YXJ0ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIG07XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmIChsYXN0Q2FwdHVyZS5lbmQgIT0gbnVsbCAmJiAvXlxcKSokLy50ZXN0KHNyYy5zdWJzdHIobGFzdENhcHR1cmUuZW5kKSkpXG4gICAgICAgICAgICAgICAgc3JjID0gc3JjLnN1YnN0cmluZygwLCBsYXN0Q2FwdHVyZS5zdGFydCkgKyBzcmMuc3Vic3RyKGxhc3RDYXB0dXJlLmVuZCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHNyYy5jaGFyQXQo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gICAgfVxuICAgICAgICB2YXIgbWFwcGluZyA9IHRoaXMubWF0Y2hNYXBwaW5nc1tjdXJyZW50U3RhdGVdO1xuICAgICAgICB2YXIgcmUgPSB0aGlzLnJlZ0V4cHNbY3VycmVudFN0YXRlXTtcbiAgICAgICAgcmUubGFzdEluZGV4ID0gMDtcbiAgICAgICAgdmFyIG1hdGNoLCB0b2tlbnMgPSBbXTtcbiAgICAgICAgdmFyIGxhc3RJbmRleCA9IDA7XG4gICAgICAgIHZhciBtYXRjaEF0dGVtcHRzID0gMDtcbiAgICAgICAgdmFyIHRva2VuID0geyB0eXBlOiBudWxsLCB2YWx1ZTogXCJcIiB9O1xuICAgICAgICB3aGlsZSAobWF0Y2ggPSByZS5leGVjKGxpbmUpKSB7XG4gICAgICAgICAgICB2YXIgdHlwZSA9IG1hcHBpbmcuZGVmYXVsdFRva2VuO1xuICAgICAgICAgICAgdmFyIHJ1bGUgPSBudWxsO1xuICAgICAgICAgICAgdmFyIHZhbHVlID0gbWF0Y2hbMF07XG4gICAgICAgICAgICB2YXIgaW5kZXggPSByZS5sYXN0SW5kZXg7XG4gICAgICAgICAgICBpZiAoaW5kZXggLSB2YWx1ZS5sZW5ndGggPiBsYXN0SW5kZXgpIHtcbiAgICAgICAgICAgICAgICB2YXIgc2tpcHBlZCA9IGxpbmUuc3Vic3RyaW5nKGxhc3RJbmRleCwgaW5kZXggLSB2YWx1ZS5sZW5ndGgpO1xuICAgICAgICAgICAgICAgIGlmICh0b2tlbi50eXBlID09IHR5cGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdG9rZW4udmFsdWUgKz0gc2tpcHBlZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbi50eXBlKVxuICAgICAgICAgICAgICAgICAgICAgICAgdG9rZW5zLnB1c2godG9rZW4pO1xuICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IHsgdHlwZTogdHlwZSwgdmFsdWU6IHNraXBwZWQgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG1hdGNoLmxlbmd0aCAtIDI7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChtYXRjaFtpICsgMV0gPT09IHVuZGVmaW5lZClcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgcnVsZSA9IHN0YXRlW21hcHBpbmdbaV1dO1xuICAgICAgICAgICAgICAgIGlmIChydWxlLm9uTWF0Y2gpXG4gICAgICAgICAgICAgICAgICAgIHR5cGUgPSBydWxlLm9uTWF0Y2godmFsdWUsIGN1cnJlbnRTdGF0ZSwgc3RhY2ssIGxpbmUpO1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgdHlwZSA9IHJ1bGUudG9rZW47XG4gICAgICAgICAgICAgICAgaWYgKHJ1bGUubmV4dCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJ1bGUubmV4dCA9PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50U3RhdGUgPSBydWxlLm5leHQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50U3RhdGUgPSBydWxlLm5leHQoY3VycmVudFN0YXRlLCBzdGFjayk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSB0aGlzLnN0YXRlc1tjdXJyZW50U3RhdGVdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXN0YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJlcG9ydEVycm9yKFwic3RhdGUgZG9lc24ndCBleGlzdFwiLCBjdXJyZW50U3RhdGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFN0YXRlID0gXCJzdGFydFwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSB0aGlzLnN0YXRlc1tjdXJyZW50U3RhdGVdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG1hcHBpbmcgPSB0aGlzLm1hdGNoTWFwcGluZ3NbY3VycmVudFN0YXRlXTtcbiAgICAgICAgICAgICAgICAgICAgbGFzdEluZGV4ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIHJlID0gdGhpcy5yZWdFeHBzW2N1cnJlbnRTdGF0ZV07XG4gICAgICAgICAgICAgICAgICAgIHJlLmxhc3RJbmRleCA9IGluZGV4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAocnVsZS5jb25zdW1lTGluZUVuZClcbiAgICAgICAgICAgICAgICAgICAgbGFzdEluZGV4ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHR5cGUgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCghcnVsZSB8fCBydWxlLm1lcmdlICE9PSBmYWxzZSkgJiYgdG9rZW4udHlwZSA9PT0gdHlwZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdG9rZW4udmFsdWUgKz0gdmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4udHlwZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2tlbnMucHVzaCh0b2tlbik7XG4gICAgICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IHsgdHlwZTogdHlwZSwgdmFsdWU6IHZhbHVlIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodHlwZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4udHlwZSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRva2Vucy5wdXNoKHRva2VuKTtcbiAgICAgICAgICAgICAgICAgICAgdG9rZW4gPSB7IHR5cGU6IG51bGwsIHZhbHVlOiBcIlwiIH07XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdHlwZS5sZW5ndGg7IGkrKylcbiAgICAgICAgICAgICAgICAgICAgICAgIHRva2Vucy5wdXNoKHR5cGVbaV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChsYXN0SW5kZXggPT0gbGluZS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBsYXN0SW5kZXggPSBpbmRleDtcbiAgICAgICAgICAgIGlmIChtYXRjaEF0dGVtcHRzKysgPiBNQVhfVE9LRU5fQ09VTlQpIHtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2hBdHRlbXB0cyA+IDIgKiBsaW5lLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlcG9ydEVycm9yKFwiaW5maW5pdGUgbG9vcCB3aXRoIGluIGFjZSB0b2tlbml6ZXJcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRTdGF0ZTogc3RhcnRTdGF0ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmU6IGxpbmVcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHdoaWxlIChsYXN0SW5kZXggPCBsaW5lLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4udHlwZSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRva2Vucy5wdXNoKHRva2VuKTtcbiAgICAgICAgICAgICAgICAgICAgdG9rZW4gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogbGluZS5zdWJzdHJpbmcobGFzdEluZGV4LCBsYXN0SW5kZXggKz0gNTAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFwib3ZlcmZsb3dcIlxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjdXJyZW50U3RhdGUgPSBcInN0YXJ0XCI7XG4gICAgICAgICAgICAgICAgc3RhY2sgPSBbXTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodG9rZW4udHlwZSlcbiAgICAgICAgICAgIHRva2Vucy5wdXNoKHRva2VuKTtcbiAgICAgICAgaWYgKHN0YWNrLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICAgIGlmIChzdGFja1swXSAhPT0gY3VycmVudFN0YXRlKVxuICAgICAgICAgICAgICAgIHN0YWNrLnVuc2hpZnQoXCIjdG1wXCIsIGN1cnJlbnRTdGF0ZSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHRva2VuczogdG9rZW5zLFxuICAgICAgICAgICAgc3RhdGU6IHN0YWNrLmxlbmd0aCA/IHN0YWNrIDogY3VycmVudFN0YXRlXG4gICAgICAgIH07XG4gICAgfTtcbiAgICByZXR1cm4gVG9rZW5pemVyO1xufSgpKTtcblRva2VuaXplci5wcm90b3R5cGUucmVwb3J0RXJyb3IgPSByZXBvcnRFcnJvcjtcbmV4cG9ydHMuVG9rZW5pemVyID0gVG9rZW5pemVyO1xuXG59KTtcblxuYWNlLmRlZmluZShcImFjZS9tb2RlL3RleHRfaGlnaGxpZ2h0X3J1bGVzXCIsW1wicmVxdWlyZVwiLFwiZXhwb3J0c1wiLFwibW9kdWxlXCIsXCJhY2UvbGliL2RlZXBfY29weVwiXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXtcInVzZSBzdHJpY3RcIjtcbnZhciBkZWVwQ29weSA9IHJlcXVpcmUoXCIuLi9saWIvZGVlcF9jb3B5XCIpLmRlZXBDb3B5O1xudmFyIFRleHRIaWdobGlnaHRSdWxlcztcblRleHRIaWdobGlnaHRSdWxlcyA9IGZ1bmN0aW9uICgpIHtcbiAgICB0aGlzLiRydWxlcyA9IHtcbiAgICAgICAgXCJzdGFydFwiOiBbe1xuICAgICAgICAgICAgICAgIHRva2VuOiBcImVtcHR5X2xpbmVcIixcbiAgICAgICAgICAgICAgICByZWdleDogJ14kJ1xuICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGRlZmF1bHRUb2tlbjogXCJ0ZXh0XCJcbiAgICAgICAgICAgIH1dXG4gICAgfTtcbn07XG4oZnVuY3Rpb24gKCkge1xuICAgIHRoaXMuYWRkUnVsZXMgPSBmdW5jdGlvbiAocnVsZXMsIHByZWZpeCkge1xuICAgICAgICBpZiAoIXByZWZpeCkge1xuICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIHJ1bGVzKVxuICAgICAgICAgICAgICAgIHRoaXMuJHJ1bGVzW2tleV0gPSBydWxlc1trZXldO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGZvciAodmFyIGtleSBpbiBydWxlcykge1xuICAgICAgICAgICAgdmFyIHN0YXRlID0gcnVsZXNba2V5XTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc3RhdGUubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgcnVsZSA9IHN0YXRlW2ldO1xuICAgICAgICAgICAgICAgIGlmIChydWxlLm5leHQgfHwgcnVsZS5vbk1hdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcnVsZS5uZXh0ID09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydWxlLm5leHQuaW5kZXhPZihwcmVmaXgpICE9PSAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGUubmV4dCA9IHByZWZpeCArIHJ1bGUubmV4dDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAocnVsZS5uZXh0U3RhdGUgJiYgcnVsZS5uZXh0U3RhdGUuaW5kZXhPZihwcmVmaXgpICE9PSAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZS5uZXh0U3RhdGUgPSBwcmVmaXggKyBydWxlLm5leHRTdGF0ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLiRydWxlc1twcmVmaXggKyBrZXldID0gc3RhdGU7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIHRoaXMuZ2V0UnVsZXMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLiRydWxlcztcbiAgICB9O1xuICAgIHRoaXMuZW1iZWRSdWxlcyA9IGZ1bmN0aW9uIChIaWdobGlnaHRSdWxlcywgcHJlZml4LCBlc2NhcGVSdWxlcywgc3RhdGVzLCBhcHBlbmQpIHtcbiAgICAgICAgdmFyIGVtYmVkUnVsZXMgPSB0eXBlb2YgSGlnaGxpZ2h0UnVsZXMgPT0gXCJmdW5jdGlvblwiXG4gICAgICAgICAgICA/IG5ldyBIaWdobGlnaHRSdWxlcygpLmdldFJ1bGVzKClcbiAgICAgICAgICAgIDogSGlnaGxpZ2h0UnVsZXM7XG4gICAgICAgIGlmIChzdGF0ZXMpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc3RhdGVzLmxlbmd0aDsgaSsrKVxuICAgICAgICAgICAgICAgIHN0YXRlc1tpXSA9IHByZWZpeCArIHN0YXRlc1tpXTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICA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F0ZSwgc3RhY2spIHtcbiAgICAgICAgc3RhY2suc2hpZnQoKTtcbiAgICAgICAgcmV0dXJuIHN0YWNrLnNoaWZ0KCkgfHwgXCJzdGFydFwiO1xuICAgIH07XG4gICAgdGhpcy5ub3JtYWxpemVSdWxlcyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIGlkID0gMDtcbiAgICAgICAgdmFyIHJ1bGVzID0gdGhpcy4kcnVsZXM7XG4gICAgICAgIGZ1bmN0aW9uIHByb2Nlc3NTdGF0ZShrZXkpIHtcbiAgICAgICAgICAgIHZhciBzdGF0ZSA9IHJ1bGVzW2tleV07XG4gICAgICAgICAgICBzdGF0ZVtcInByb2Nlc3NlZFwiXSA9IHRydWU7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0YXRlLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJ1bGUgPSBzdGF0ZVtpXTtcbiAgICAgICAgICAgICAgICB2YXIgdG9JbnNlcnQgPSBudWxsO1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHJ1bGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRvSW5zZXJ0ID0gcnVsZTtcbiAgICAgICAgICAgICAgICAgICAgcnVsZSA9IHt9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXJ1bGUucmVnZXggJiYgcnVsZS5zdGFydCkge1xuICAgICAgICAgICAgICAgICAgICBydWxlLnJlZ2V4ID0gcnVsZS5zdGFydDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFydWxlLm5leHQpXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlLm5leHQgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgcnVsZS5uZXh0LnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFRva2VuOiBydWxlLnRva2VuXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuOiBydWxlLnRva2VuICsgXCIuZW5kXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICByZWdleDogcnVsZS5lbmQgfHwgcnVsZS5zdGFydCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQ6IFwicG9wXCJcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIHJ1bGUudG9rZW4gPSBydWxlLnRva2VuICsgXCIuc3RhcnRcIjtcbiAgICAgICAgICAgICAgICAgICAgcnVsZS5wdXNoID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIG5leHQgPSBydWxlLm5leHQgfHwgcnVsZS5wdXNoO1xuICAgICAgICAgICAgICAgIGlmIChuZXh0ICYmIEFycmF5LmlzQXJyYXkobmV4dCkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0YXRlTmFtZSA9IHJ1bGUuc3RhdGVOYW1lO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXN0YXRlTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGVOYW1lID0gcnVsZS50b2tlbjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc3RhdGVOYW1lICE9IFwic3RyaW5nXCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGVOYW1lID0gc3RhdGVOYW1lWzBdIHx8IFwiXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVsZXNbc3RhdGVOYW1lXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZU5hbWUgKz0gaWQrKztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBydWxlc1tzdGF0ZU5hbWVdID0gbmV4dDtcbiAgICAgICAgICAgICAgICAgICAgcnVsZS5uZXh0ID0gc3RhdGVOYW1lO1xuICAgICAgICAgICAgICAgICAgICBwcm9jZXNzU3RhdGUoc3RhdGVOYW1lKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAobmV4dCA9PSBcInBvcFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIHJ1bGUubmV4dCA9IHBvcFN0YXRlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAocnVsZS5wdXNoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJ1bGUubmV4dFN0YXRlID0gcnVsZS5uZXh0IHx8IHJ1bGUucHVzaDtcbiAgICAgICAgICAgICAgICAgICAgcnVsZS5uZXh0ID0gcHVzaFN0YXRlO1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgcnVsZS5wdXNoO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAocnVsZS5ydWxlcykge1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciByIGluIHJ1bGUucnVsZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydWxlc1tyXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydWxlc1tyXS5wdXNoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlc1tyXS5wdXNoLmFwcGx5KHJ1bGVzW3JdLCBydWxlLnJ1bGVzW3JdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzW3JdID0gcnVsZS5ydWxlc1tyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgaW5jbHVkZU5hbWUgPSB0eXBlb2YgcnVsZSA9PSBcInN0cmluZ1wiID8gcnVsZSA6IHJ1bGUuaW5jbHVkZTtcbiAgICAgICAgICAgICAgICBpZiAoaW5jbHVkZU5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGluY2x1ZGVOYW1lID09PSBcIiRzZWxmXCIpXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmNsdWRlTmFtZSA9IFwic3RhcnRcIjtcbiAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoaW5jbHVkZU5hbWUpKVxuICAgICAgICAgICAgICAgICAgICAgICAgdG9JbnNlcnQgPSBpbmNsdWRlTmFtZS5tYXAoZnVuY3Rpb24gKHgpIHsgcmV0dXJuIHJ1bGVzW3hdOyB9KTtcbiAgICAgICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgdG9JbnNlcnQgPSBydWxlc1tpbmNsdWRlTmFtZV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0b0luc2VydCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYXJncyA9IFtpLCAxXS5jb25jYXQodG9JbnNlcnQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAocnVsZS5ub0VzY2FwZSlcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3MgPSBhcmdzLmZpbHRlcihmdW5jdGlvbiAoeCkgeyByZXR1cm4gIXgubmV4dDsgfSk7XG4gICAgICAgICAgICAgICAgICAgIHN0YXRlLnNwbGljZS5hcHBseShzdGF0ZSwgYXJncyk7XG4gICAgICAgICAgICAgICAgICAgIGktLTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHJ1bGUua2V5d29yZE1hcCkge1xuICAgICAgICAgICAgICAgICAgICBydWxlLnRva2VuID0gdGhpcy5jcmVhdGVLZXl3b3JkTWFwcGVyKHJ1bGUua2V5d29yZE1hcCwgcnVsZS5kZWZhdWx0VG9rZW4gfHwgXCJ0ZXh0XCIsIHJ1bGUuY2FzZUluc2Vuc2l0aXZlKTtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHJ1bGUuZGVmYXVsdFRva2VuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBPYmplY3Qua2V5cyhydWxlcykuZm9yRWFjaChwcm9jZXNzU3RhdGUsIHRoaXMpO1xuICAgIH07XG4gICAgdGhpcy5jcmVhdGVLZXl3b3JkTWFwcGVyID0gZnVuY3Rpb24gKG1hcCwgZGVmYXVsdFRva2VuLCBpZ25vcmVDYXNlLCBzcGxpdENoYXIpIHtcbiAgICAgICAgdmFyIGtleXdvcmRzID0gT2JqZWN0LmNyZWF0ZShudWxsKTtcbiAgICAgICAgdGhpcy4ka2V5d29yZExpc3QgPSBbXTtcbiAgICAgICAgT2JqZWN0LmtleXMobWFwKS5mb3JFYWNoKGZ1bmN0aW9uIChjbGFzc05hbWUpIHtcbiAgICAgICAgICAgIHZhciBhID0gbWFwW2NsYXNzTmFtZV07XG4gICAgICAgICAgICB2YXIgbGlzdCA9IGEuc3BsaXQoc3BsaXRDaGFyIHx8IFwifFwiKTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSBsaXN0Lmxlbmd0aDsgaS0tOykge1xuICAgICAgICAgICAgICAgIHZhciB3b3JkID0gbGlzdFtpXTtcbiAgICAgICAgICAgICAgICB0aGlzLiRrZXl3b3JkTGlzdC5wdXNoKHdvcmQpO1xuICAgICAgICAgICAgICAgIGlmIChpZ25vcmVDYXNlKVxuICAgICAgICAgICAgICAgICAgICB3b3JkID0gd29yZC50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgIGtleXdvcmRzW3dvcmRdID0gY2xhc3NOYW1lO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LCB0aGlzKTtcbiAgICAgICAgbWFwID0gbnVsbDtcbiAgICAgICAgcmV0dXJuIGlnbm9yZUNhc2VcbiAgICAgICAgICAgID8gZnVuY3Rpb24gKHZhbHVlKSB7IHJldHVybiBrZXl3b3Jkc1t2YWx1ZS50b0xvd2VyQ2Fz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FsQ29sdW1uKTtcbiAgICAgICAgdGhpcy4kdG9rZW5JbmRleCA9IHRva2VuID8gdG9rZW4uaW5kZXggOiAtMTtcbiAgICB9XG4gICAgVG9rZW5JdGVyYXRvci5wcm90b3R5cGUuc3RlcEJhY2t3YXJkID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLiR0b2tlbkluZGV4IC09IDE7XG4gICAgICAgIHdoaWxlICh0aGlzLiR0b2tlbkluZGV4IDwgMCkge1xuICAgICAgICAgICAgdGhpcy4kcm93IC09IDE7XG4gICAgICAgICAgICBpZiAodGhpcy4kcm93IDwgMCkge1xuICAgICAgICAgICAgICAgIHRoaXMuJHJvdyA9IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLiRyb3dUb2tlbnMgPSB0aGlzLiRzZXNzaW9uLmdldFRva2Vucyh0aGlzLiRyb3cpO1xuICAgICAgICAgICAgdGhpcy4kdG9rZW5JbmRleCA9IHRoaXMuJHJvd1Rva2Vucy5sZW5ndGggLSAxO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLiRyb3dUb2tlbnNbdGhpcy4kdG9rZW5JbmRleF07XG4gICAgfTtcbiAgICBUb2tlbkl0ZXJhdG9yLnByb3RvdHlwZS5zdGVwRm9yd2FyZCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy4kdG9rZW5JbmRleCArPSAxO1xuICAgICAgICB2YXIgcm93Q291bnQ7XG4gICAgICAgIHdoaWxlICh0aGlzLiR0b2tlbkluZGV4ID49IHRoaXMuJHJvd1Rva2Vucy5sZW5ndGgpIHtcbiAgICAgICAgICAgIHRoaXMuJHJvdyArPSAxO1xuICAgICAgICAgICAgaWYgKCFyb3dDb3VudClcbiAgICAgICAgICAgICAgICByb3dDb3VudCA9IHRoaXMuJHNlc3Npb24uZ2V0TGVuZ3RoKCk7XG4gICAgICAgICAgICBpZiAodGhpcy4kc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5jdGlvbiAoZWwpIHsgcmV0dXJuIGVsLnRlc3QodG9rZW4udHlwZSk7IH0pIHx8IC8oc3RyaW5nKVxcLnF1YXNpLy50ZXN0KHRva2VuLnR5cGUpXG4gICAgICAgICAgICAgICAgICAgICYmIHRva2VuLnZhbHVlW2N1cnNvci5jb2x1bW4gLSB0b2tlbi5zdGFydCAtIDFdICE9PSAnJCcpXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICBDc3R5bGVCZWhhdmlvdXIucmVjb3JkQXV0b0luc2VydChlZGl0b3IsIHNlc3Npb24sIFwifVwiKTtcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICB0ZXh0OiAne30nLFxuICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb246IFsxLCAxXVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChDc3R5bGVCZWhhdmlvdXIuaXNTYW5lSW5zZXJ0aW9uKGVkaXRvciwgc2Vzc2lvbikpIHtcbiAgICAgICAgICAgICAgICBpZiAoL1tcXF1cXH1cXCldLy50ZXN0KGxpbmVbY3Vyc29yLmNvbHVtbl0pIHx8IGVkaXRvci5pbk11bHRpU2VsZWN0TW9kZSB8fCBvcHRpb25zLmJyYWNlcykge1xuICAgICAgICAgICAgICAgICAgICBDc3R5bGVCZWhhdmlvdXIucmVjb3JkQXV0b0luc2VydChlZGl0b3IsIHNlc3Npb24sIFwifVwiKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ6ICd7fScsXG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb246IFsxLCAxXVxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgQ3N0eWxlQmVoYXZpb3VyLnJlY29yZE1heWJlSW5zZXJ0KGVkaXRvciwgc2Vzc2lvbiwgXCJ7XCIpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dDogJ3snLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uOiBbMSwgMV1cbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodGV4dCA9PSAnfScpIHtcbiAgICAgICAgICAgIGluaXRDb250ZXh0KGVkaXRvcik7XG4gICAgICAgICAgICB2YXIgcmlnaHRDaGFyID0gbGluZS5zdWJzdHJpbmcoY3Vyc29yLmNvbHVtbiwgY3Vyc29yLmNvbHVtbiArIDEpO1xuICAgICAgICAgICAgaWYgKHJpZ2h0Q2hhciA9PSAnfScpIHtcbiAgICAgICAgICAgICAgICB2YXIgbWF0Y2hpbmcgPSBzZXNzaW9uLiRmaW5kT3BlbmluZ0JyYWNrZXQoJ30nLCB7IGNvbHVtbjogY3Vyc29yLmNvbHVtbiArIDEsIHJvdzogY3Vyc29yLnJvdyB9KTtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2hpbmcgIT09IG51bGwgJiYgQ3N0eWxlQmVoYXZpb3VyLmlzQXV0b0luc2VydGVkQ2xvc2luZyhjdXJzb3IsIGxpbmUsIHRleHQpKSB7XG4gICAgICAgICAgICAgICAgICAgIENzdHlsZUJlaGF2aW91ci5wb3BBdXRvSW5zZXJ0ZWRDbG9zaW5nKCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiAnJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbjogWzEsIDFdXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9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BcIilcIik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgdGV4dDogJygpJyxcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uOiBbMSwgMV1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHRleHQgPT0gJyknKSB7XG4gICAgICAgICAgICBpbml0Q29udGV4dChlZGl0b3IpO1xuICAgICAgICAgICAgdmFyIGN1cnNvciA9IGVkaXRvci5nZXRDdXJzb3JQb3NpdGlvbigpO1xuICAgICAgICAgICAgdmFyIGxpbmUgPSBzZXNzaW9uLmRvYy5nZXRMaW5lKGN1cnNvci5yb3cpO1xuICAgICAgICAgICAgdmFyIHJpZ2h0Q2hhciA9IGxpbmUuc3Vic3RyaW5nKGN1cnNvci5jb2x1bW4sIGN1cnNvci5jb2x1bW4gKyAxKTtcbiAgICAgICAgICAgIGlmIChyaWdodENoYXIgPT0gJyknKSB7XG4gICAgICAgICAgICAgICAgdmFyIG1hdGNoaW5nID0gc2Vzc2lvbi4kZmluZE9wZW5pbmdCcmFja2V0KCcpJywgeyBjb2x1bW46IGN1cnNvci5jb2x1bW4gKyAxLCByb3c6IGN1cnNvci5yb3cgfSk7XG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoaW5nICE9PSBudWxsICYmIENzdHlsZUJlaGF2aW91ci5pc0F1dG9JbnNlcnRlZENsb3NpbmcoY3Vyc29yLCBsaW5lLCB0ZXh0KSkge1xuICAgICAgICAgICAgICAgICAgICBDc3R5bGVCZWhhdmlvdXIucG9wQXV0b0luc2VydGVkQ2xvc2luZygpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dDogJycsXG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb246IFsxLCAxXVxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICA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YW5nZShzZWxlY3Rpb24pO1xuICAgICAgICAgICAgaWYgKHNlbGVjdGVkICE9PSBcIlwiICYmIGVkaXRvci5nZXRXcmFwQmVoYXZpb3Vyc0VuYWJsZWQoKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBnZXRXcmFwcGVkKHNlbGVjdGlvbiwgc2VsZWN0ZWQsICdbJywgJ10nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKENzdHlsZUJlaGF2aW91ci5pc1NhbmVJbnNlcnRpb24oZWRpdG9yLCBzZXNzaW9uKSkge1xuICAgICAgICAgICAgICAgIENzdHlsZUJlaGF2aW91ci5yZWNvcmRBdXRvSW5zZXJ0KGVkaXRvciwgc2Vzc2lvbiwgXCJdXCIpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIHRleHQ6ICdbXScsXG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbjogWzEsIDFdXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0ZXh0ID09ICddJykge1xuICAgICAgICAgICAgaW5pdENvbnRleHQoZWRpdG9yKTtcbiAgICAgICAgICAgIHZhciBjdXJzb3IgPSBlZGl0b3IuZ2V0Q3Vyc29yUG9zaXRpb24oKTtcbiAgICAgICAgICAgIHZhciBsaW5lID0gc2Vzc2lvbi5kb2MuZ2V0TGluZShjdXJzb3Iucm93KTtcbiAgICAgICAgICAgIHZhciByaWdodENoYXIgPSBsaW5lLnN1YnN0cmluZyhjdXJzb3IuY29sdW1uLCBjdXJzb3IuY29sdW1uICsgMSk7XG4gICAgICAgICAgICBpZiAocmlnaHRDaGFyID09ICddJykge1xuICAgICAgICAgICAgICAgIHZhciBtYXRjaGluZyA9IHNlc3Npb24uJGZpbmRPcGVuaW5nQnJhY2tldCgnXScsIHsgY29sdW1uOiBjdXJzb3IuY29sdW1uICsgMSwgcm93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O1xuICAgICAgICAgICAgICAgICAgICBpZiAocGFpciAmJiAvc3RyaW5nXFwuZW5kLy50ZXN0KHJpZ2h0VG9rZW4udHlwZSkpXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWlyID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoc3RyaW5nQmVmb3JlICYmICFzdHJpbmdBZnRlcilcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOyAvLyB3cmFwIHN0cmluZyB3aXRoIGRpZmZlcmVudCBxdW90ZVxuICAgICAgICAgICAgICAgICAgICBpZiAoc3RyaW5nQmVmb3JlICYmIHN0cmluZ0FmdGVyKVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7IC8vIGRvIG5vdCBwYWlyIHF1b3RlcyBpbnNpZGUgc3RyaW5nc1xuICAgICAgICAgICAgICAgICAgICB2YXIgd29yZFJlID0gc2Vzc2lvbi4kbW9kZS50b2tlblJlO1xuICAgICAgICAgICAgICAgICAgICB3b3JkUmUubGFzdEluZGV4ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGlzV29yZEJlZm9yZSA9IHdvcmRSZS50ZXN0KGxlZnRDaGFyKTtcbiAgICAgICAgICAgICAgICAgICAgd29yZFJlLmxhc3RJbmRleCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpc1dvcmRBZnRlciA9IHdvcmRSZS50ZXN0KHJpZ2h0Q2hhcik7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYWlyUXVvdGVzQWZ0ZXIgPSBzZXNzaW9uLiRtb2RlLiRwYWlyUXVvdGVzQWZ0ZXI7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzaG91bGRQYWlyUXVvdGVzID0gcGFpclF1b3Rlc0FmdGVyICYmIHBhaXJRdW90ZXNBZnRlcltxdW90ZV0gJiYgcGFpclF1b3Rlc0FmdGVyW3F1b3RlXS50ZXN0KGxlZnRDaGFyKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCghc2hvdWxkUGFpclF1b3RlcyAmJiBpc1dvcmRCZWZvcmUpIHx8IGlzV29yZEFmdGVyKVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7IC8vIGJlZm9yZSBvciBhZnRlciBhbHBoYW51bWVyaWNcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJpZ2h0Q2hhciAmJiAhL1tcXHM7LC59KVxcXVxcXFxdLy50ZXN0KHJpZ2h0Q2hhcikpXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsgLy8gdGhlcmUgaXMgcmlnaHRDaGFyIGFuZCBpdCBpc24ndCBjbG9zaW5nXG4gICAgICAgICAgICAgICAgICAgIHZhciBjaGFyQmVmb3JlID0gbGluZVtjdXJzb3IuY29sdW1uIC0gMl07XG4gICAgICAgICAgICAgICAgICAgIGlmIChsZWZ0Q2hhciA9PSBxdW90ZSAmJiAoY2hhckJlZm9yZSA9PSBxdW90ZSB8fCB3b3JkUmUudGVzdChjaGFyQmVmb3JlKSkpXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgcGFpciA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIHRleHQ6IHBhaXIgPyBxdW90ZSArIHF1b3RlIDogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uOiBbMSwgMV1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSk7XG4gICAgdGhpcy5hZGQoXCJzdHJpbmdfZHF1b3Rlc1wiLCBcImRlbGV0aW9uXCIsIGZ1bmN0aW9uIChzdGF0ZSwgYWN0aW9uLCBlZGl0b3IsIHNlc3Npb24sIHJhbmdlKSB7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N1cnNvclBvc2l0aW9uKCk7XG4gICAgICAgICAgICAgICAgdmFyIGxpbmUgPSBzZXNzaW9uLmRvYy5nZXRMaW5lKGN1cnNvci5yb3cpO1xuICAgICAgICAgICAgICAgIHZhciBuZXh0TGluZSA9IHNlc3Npb24uZG9jLmdldExpbmUoY3Vyc29yLnJvdyArIDEpO1xuICAgICAgICAgICAgICAgIHZhciBpbmRlbnQgPSB0aGlzLiRnZXRJbmRlbnQobGluZSk7XG4gICAgICAgICAgICAgICAgaWYgKC9cXHMqXFwqLy50ZXN0KG5leHRMaW5lKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoL15cXHMqXFwqLy50ZXN0KGxpbmUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IHRleHQgKyBpbmRlbnQgKyBcIiogXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uOiBbMSwgMyArIGluZGVudC5sZW5ndGgsIDEsIDMgKyBpbmRlbnQubGVuZ3RoXVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dDogdGV4dCArIGluZGVudCArIFwiICogXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uOiBbMSwgMyArIGluZGVudC5sZW5ndGgsIDEsIDMgKyBpbmRlbnQubGVuZ3RoXVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoL1xcL1xcKlxcKi8udGVzdChsaW5lLnN1YnN0cmluZygwLCBjdXJzb3IuY29sdW1uKSkpIHtcbiAgICAgICAg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9IHRydWU7XG4gICAgICAgIHZhciBtaW5JbmRlbnQgPSBJbmZpbml0eTtcbiAgICAgICAgdmFyIHRhYlNpemUgPSBzZXNzaW9uLmdldFRhYlNpemUoKTtcbiAgICAgICAgdmFyIGluc2VydEF0VGFiU3RvcCA9IGZhbHNlO1xuICAgICAgICBpZiAoIXRoaXMubGluZUNvbW1lbnRTdGFydCkge1xuICAgICAgICAgICAgaWYgKCF0aGlzLmJsb2NrQ29tbWVudClcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB2YXIgbGluZUNvbW1lbnRTdGFydCA9IHRoaXMuYmxvY2tDb21tZW50LnN0YXJ0O1xuICAgICAgICAgICAgdmFyIGxpbmVDb21tZW50RW5kID0gdGhpcy5ibG9ja0NvbW1lbnQuZW5kO1xuICAgICAgICAgICAgdmFyIHJlZ2V4cFN0YXJ0ID0gbmV3IFJlZ0V4cChcIl4oXFxcXHMqKSg/OlwiICsgbGFuZy5lc2NhcGVSZWdFeHAobGluZUNvbW1lbnRTdGFydCkgKyBcIilcIik7XG4gICAgICAgICAgICB2YXIgcmVnZXhwRW5kID0gbmV3IFJlZ0V4cChcIig/OlwiICsgbGFuZy5lc2NhcGVSZWdFeHAobGluZUNvbW1lbnRFbmQpICsgXCIpXFxcXHMqJFwiKTtcbiAgICAgICAgICAgIHZhciBjb21tZW50ID0gZnVuY3Rpb24gKGxpbmUsIGkpIHtcbiAgICAgICAgICAgICAgICBpZiAodGVzdFJlbW92ZShsaW5lLCBpKSlcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIGlmICghaWdub3JlQmxhbmtMaW5lcyB8fCAvXFxTLy50ZXN0KGxpbmUpKSB7XG4gICAgICAgICAgICAgICAgICAgIGRvYy5pbnNlcnRJbkxpbmUoeyByb3c6IGksIGNvbHVtbjogbGluZS5sZW5ndGggfSwgbGluZUNvbW1lbnRFbmQpO1xuICAgICAgICAgICAgICAgICAgICBkb2MuaW5zZXJ0SW5MaW5lKHsgcm93OiBpLCBjb2x1bW46IG1pbkluZGVudCB9LCBsaW5lQ29tbWVudFN0YXJ0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgdmFyIHVuY29tbWVudCA9IGZ1bmN0aW9uIChsaW5lLCBpKSB7XG4gICAgICAgICAgICAgICAgdmFyIG07XG4gICAgICAgICAgICAgICAgaWYgKG0gPSBsaW5lLm1hdGNoKHJlZ2V4cEVuZCkpXG4gICAgICAgICAgICAgICAgICAgIGRvYy5yZW1vdmVJbkxpbmUoaSwgbGluZS5sZW5ndGggLSBtWzBdLmxlbmd0aCwgbGluZS5sZW5ndGgpO1xuICAgICAgICAgICAgICAgIGlmIChtID0gbGluZS5tYXRjaChyZWdleHBTdGFydCkpXG4gICAgICAgICAgICAgICAgICAgIGRvYy5yZW1vdmVJbkxpbmUoaSwgbVsxXS5sZW5ndGgsIG1bMF0ubGVuZ3RoKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB2YXIgdGVzdFJlbW92ZSA9IGZ1bmN0aW9uIChsaW5lLCByb3cpIHtcbiAgICAgICAgICAgICAgICBpZiAocmVnZXhwU3RhcnQudGVzdChsaW5lKSlcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgdmFyIHRva2VucyA9IHNlc3Npb24uZ2V0VG9rZW5zKHJvdyk7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0b2tlbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRva2Vuc1tpXS50eXBlID09PSBcImNvbW1lbnRcIilcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSh0aGlzLmxpbmVDb21tZW50U3RhcnQpKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJlZ2V4cFN0YXJ0ID0gdGhpcy5saW5lQ29tbWVudFN0YXJ0Lm1hcChsYW5nLmVzY2FwZVJlZ0V4cCkuam9pbihcInxcIik7XG4gICAgICAgICAgICAgICAgdmFyIGxpbmVDb21tZW50U3RhcnQgPSB0aGlzLmxpbmVDb21tZW50U3RhcnRbMF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgcmVnZXhwU3RhcnQgPSBsYW5nLmVzY2FwZVJlZ0V4cCh0aGlzLmxpbmVDb21tZW50U3RhcnQpO1xuICAgICAgICAgICAgICAgIHZhciBsaW5lQ29tbWVudFN0YXJ0ID0gdGhpcy5saW5lQ29tbWVudFN0YXJ0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVnZXhwU3RhcnQgPSBuZXcgUmVnRXhwKFwiXihcXFxccyopKD86XCIgKyByZWdleHBTdGFydCArIFwiKSA/XCIpO1xuICAgICAgICAgICAgaW5zZXJ0QXRUYWJTdG9wID0gc2Vzc2lvbi5nZXRVc2VTb2Z0VGFicygpO1xuICAgICAgICAgICAgdmFyIHVuY29tbWVudCA9IGZ1bmN0aW9uIChsaW5lLCBpKSB7XG4gICAgICAgICAgICAgICAgdmFyIG0gPSBsaW5lLm1hdGNoKHJlZ2V4cFN0YXJ0KTtcbiAgICAgICAgICAgICAgICBpZiAoIW0pXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB2YXIgc3RhcnQgPSBtWzFdLmxlbmd0aCwgZW5kID0gbVswXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgaWYgKCFzaG91bGRJbnNlcnRTcGFjZShsaW5lLCBzdGFydCwgZW5kKSAmJiBtWzBdW2VuZCAtIDFdID09IFwiIFwiKVxuICAgICAgICAgICAgICAgICAgICBlbmQtLTtcbiAgICAgICAgICAgICAgICBkb2MucmVtb3ZlSW5MaW5lKGksIHN0YXJ0LCBlbmQpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHZhciBjb21tZW50V2l0aFNwYWNlID0gbGluZUNvbW1lbnRTdGFydCArIFwiIFwiO1xuICAgICAgICAgICAgdmFyIGNvbW1lbnQgPSBmdW5jdGlvbiAobGluZSwgaSkge1xuICAgICAgICAgICAgICAgIGlmICghaWdub3JlQmxhbmtMaW5lcyB8fCAvXFxTLy50ZXN0KGxpbmUpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzaG91bGRJbnNlcnRTcGFjZShsaW5lLCBtaW5JbmRlbnQsIG1pbkluZGVudCkpXG4gICAgICAgICAgICAgICAgICAgICAgICBkb2MuaW5zZXJ0SW5MaW5lKHsgcm93OiBpLCBjb2x1bW46IG1pbkluZGVudCB9LCBjb21tZW50V2l0aFNwYWNlKTtcbiAgICAgICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgZG9jLmluc2VydEluTGluZSh7IHJvdzogaSwgY29sdW1uOiBtaW5JbmRlbnQgfSwgbGluZUNvbW1lbnRTdGFydCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHZhciB0ZXN0UmVtb3ZlID0gZnVuY3Rpb24gKGxpbmUsIGkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVnZXhwU3RhcnQudGVzdChsaW5lKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB2YXIgc2hvdWxkSW5zZXJ0U3BhY2UgPSBmdW5jdGlvbiAobGluZSwgYmVmb3JlLCBhZnRlcikge1xuICAgICAgICAgICAgICAgIHZhciBzcGFjZXMgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlIChiZWZvcmUtLSAmJiBsaW5lLmNoYXJBdChiZWZvcmUpID09IFwiIFwiKVxuICAgICAgICAgICAgICAgICAgICBzcGFjZXMrKztcbiAgICAgICAgICAgICAgICBpZiAoc3BhY2VzICUgdGFiU2l6ZSAhPSAwKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgdmFyIHNwYWNlcyA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKGxpbmUuY2hhckF0KGFmdGVyKyspID09IFwiIFwiKVxuICAgICAgICAgICAgICAgICAgICBzcGFjZXMrKztcbiAgICAgICAgICAgICAgICBpZiAodGFiU2l6ZSA+IDIpXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGFjZXMgJSB0YWJTaXplICE9IHRhYlNpemUgLSAxO1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwYWNlcyAlIHRhYlNpemUgPT0gMDtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gaXRlcihmdW4pIHtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSBzdGFydFJvdzsgaSA8PSBlbmRSb3c7IGkrKylcbiAgICAgICAgICAgICAgICBmdW4oZG9jLmdldExpbmUoaSksIGkpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBtaW5FbXB0eUxlbmd0aCA9IEluZmluaXR5O1xuICAgICAgICBpdGVyKGZ1bmN0aW9uIChsaW5lLCBpKSB7XG4gICAgICAgICAgICB2YXIgaW5kZW50ID0gbGluZS5zZWFyY2goL1xcUy8pO1xuICAgICAgICAgICAgaWYgKGluZGVudCAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICBpZiAoaW5kZW50IDwgbWluSW5kZW50KVxuICAgICAgICAgICAgICAgICAgICBtaW5JbmRlbnQgPSBpbmRlbnQ7XG4gICAgICAgICAgICAgICAgaWYgKHNob3VsZFJlbW92ZSAmJiAhdGVzdFJlbW92ZShsaW5lLCBpKSlcbiAgICAgICAgICAgICAgICAgICAgc2hvdWxkUmVtb3ZlID0gZmFsc2U7XG4gIC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JlbnRUb2tlbigpO1xuICAgICAgICB2YXIgc2VsID0gc2Vzc2lvbi5zZWxlY3Rpb247XG4gICAgICAgIHZhciBpbml0aWFsUmFuZ2UgPSBzZXNzaW9uLnNlbGVjdGlvbi50b09yaWVudGVkUmFuZ2UoKTtcbiAgICAgICAgdmFyIHN0YXJ0Um93LCBjb2xEaWZmO1xuICAgICAgICBpZiAodG9rZW4gJiYgL2NvbW1lbnQvLnRlc3QodG9rZW4udHlwZSkpIHtcbiAgICAgICAgICAgIHZhciBzdGFydFJhbmdlLCBlbmRSYW5nZTtcbiAgICAgICAgICAgIHdoaWxlICh0b2tlbiAmJiAvY29tbWVudC8udGVzdCh0b2tlbi50eXBlKSkge1xuICAgICAgICAgICAgICAgIHZhciBpID0gdG9rZW4udmFsdWUuaW5kZXhPZihjb21tZW50LnN0YXJ0KTtcbiAgICAgICAgICAgICAgICBpZiAoaSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcm93ID0gaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuUm93KCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjb2x1bW4gPSBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Db2x1bW4oKSArIGk7XG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0UmFuZ2UgPSBuZXcgUmFuZ2Uocm93LCBjb2x1bW4sIHJvdywgY29sdW1uICsgY29tbWVudC5zdGFydC5sZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdG9rZW4gPSBpdGVyYXRvci5zdGVwQmFja3dhcmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBpdGVyYXRvciA9IG5ldyBUb2tlbkl0ZXJhdG9yKHNlc3Npb24sIGN1cnNvci5yb3csIGN1cnNvci5jb2x1bW4pO1xuICAgICAgICAgICAgdmFyIHRva2VuID0gaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuKCk7XG4gICAgICAgICAgICB3aGlsZSAodG9rZW4gJiYgL2NvbW1lbnQvLnRlc3QodG9rZW4udHlwZSkpIHtcbiAgICAgICAgICAgICAgICB2YXIgaSA9IHRva2VuLnZhbHVlLmluZGV4T2YoY29tbWVudC5lbmQpO1xuICAgICAgICAgICAgICAgIGlmIChpICE9IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByb3cgPSBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Sb3coKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbHVtbiA9IGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlbkNvbHVtbigpICsgaTtcbiAgICAgICAgICAgICAgICAgICAgZW5kUmFuZ2UgPSBuZXcgUmFuZ2Uocm93LCBjb2x1bW4sIHJvdywgY29sdW1uICsgY29tbWVudC5lbmQubGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRva2VuID0gaXRlcmF0b3Iuc3RlcEZvcndhcmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChlbmRSYW5nZSlcbiAgICAgICAgICAgICAgICBzZXNzaW9uLnJlbW92ZShlbmRSYW5nZSk7XG4gICAgICAgICAgICBpZiAoc3RhcnRSYW5nZSkge1xuICAgICAgICAgICAgICAgIHNlc3Npb24ucmVtb3ZlKHN0YXJ0UmFuZ2UpO1xuICAgICAgICAgICAgICAgIHN0YXJ0Um93ID0gc3RhcnRSYW5nZS5zdGFydC5yb3c7XG4gICAgICAgICAgICAgICAgY29sRGlmZiA9IC1jb21tZW50LnN0YXJ0Lmxlbmd0aDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGNvbERpZmYgPSBjb21tZW50LnN0YXJ0Lmxlbmd0aDtcbiAgICAgICAgICAgIHN0YXJ0Um93ID0gcmFu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GVNb2RlRGVsZWdhdGVzID0gZnVuY3Rpb24gKG1hcHBpbmcpIHtcbiAgICAgICAgdGhpcy4kZW1iZWRzID0gW107XG4gICAgICAgIHRoaXMuJG1vZGVzID0ge307XG4gICAgICAgIGZvciAodmFyIGkgaW4gbWFwcGluZykge1xuICAgICAgICAgICAgaWYgKG1hcHBpbmdbaV0pIHtcbiAgICAgICAgICAgICAgICB2YXIgTW9kZSA9IG1hcHBpbmdbaV07XG4gICAgICAgICAgICAgICAgdmFyIGlkID0gTW9kZS5wcm90b3R5cGUuJGlkO1xuICAgICAgICAgICAgICAgIHZhciBtb2RlID0gY29uZmlnLiRtb2Rlc1tpZF07XG4gICAgICAgICAgICAgICAgaWYgKCFtb2RlKVxuICAgICAgICAgICAgICAgICAgICBjb25maWcuJG1vZGVzW2lkXSA9IG1vZGUgPSBuZXcgTW9kZSgpO1xuICAgICAgICAgICAgICAgIGlmICghY29uZmlnLiRtb2Rlc1tpXSlcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLiRtb2Rlc1tpXSA9IG1vZGU7XG4gICAgICAgICAgICAgICAgdGhpcy4kZW1iZWRzLnB1c2goaSk7XG4gICAgICAgICAgICAgICAgdGhpcy4kbW9kZXNbaV0gPSBtb2RlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhciBkZWxlZ2F0aW9ucyA9IFtcInRvZ2dsZUJsb2NrQ29tbWVudFwiLCBcInRvZ2dsZUNvbW1lbnRMaW5lc1wiLCBcImdldE5leHRMaW5lSW5kZW50XCIsXG4gICAgICAgICAgICBcImNoZWNrT3V0ZGVudFwiLCBcImF1dG9PdXRkZW50XCIsIFwidHJhbnNmb3JtQWN0aW9uXCIsIFwiZ2V0Q29tcGxldGlvbnNcIl07XG4gICAgICAgIHZhciBfbG9vcF8xID0gZnVuY3Rpb24gKGkpIHtcbiAgICAgICAgICAgIChmdW5jdGlvbiAoc2NvcGUpIHtcbiAgICAgICAgICAgICAgICB2YXIgZnVuY3Rpb25OYW1lID0gZGVsZWdhdGlvbnNbaV07XG4gICAgICAgICAgICAgICAgdmFyIGRlZmF1bHRIYW5kbGVyID0gc2NvcGVbZnVuY3Rpb25OYW1lXTtcbiAgICAgICAgICAgICAgICBzY29wZVtkZWxlZ2F0aW9uc1tpXV0gPVxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy4kZGVsZWdhdG9yKGZ1bmN0aW9uTmFtZSwgYXJndW1lbnRzLCBkZWZhdWx0SGFuZGxlcik7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9KHRoaXNfMSkpO1xuICAgICAgICB9O1xuICAgICAgICB2YXIgdGhpc18xID0gdGhpcztcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBkZWxlZ2F0aW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgX2xvb3BfMShpKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgdGhpcy4kZGVsZWdhdG9yID0gZnVuY3Rpb24gKG1ldGhvZCwgYXJncywgZGVmYXVsdEhhbmRsZXIpIHtcbiAgICAgICAgdmFyIHN0YXRlID0gYXJnc1swXSB8fCBcInN0YXJ0XCI7XG4gICAgICAgIGlmICh0eXBlb2Ygc3RhdGUgIT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoc3RhdGVbMl0pKSB7XG4gICAgICAgICAgICAgICAgdmFyIGxhbmd1YWdlID0gc3RhdGVbMl1bc3RhdGVbMl0ubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICAgICAgdmFyIG1vZGUgPSB0aGlzLiRtb2Rlc1tsYW5ndWFnZV07XG4gICAgICAgICAgICAgICAgaWYgKG1vZGUpXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtb2RlW21ldGhvZF0uYXBwbHkobW9kZSwgW3N0YXRlWzFdXS5jb25jYXQoW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ICAgIGlmIChiZWhhdmlvdXJzW2tleV1bYWN0aW9uXSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcmV0ID0gYmVoYXZpb3Vyc1trZXldW2FjdGlvbl0uYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgdGhpcy5nZXRLZXl3b3JkcyA9IGZ1bmN0aW9uIChhcHBlbmQpIHtcbiAgICAgICAgaWYgKCF0aGlzLmNvbXBsZXRpb25LZXl3b3Jkcykge1xuICAgICAgICAgICAgdmFyIHJ1bGVzID0gdGhpcy4kdG9rZW5pemVyW1wicnVsZXNcIl07XG4gICAgICAgICAgICB2YXIgY29tcGxldGlvbktleXdvcmRzID0gW107XG4gICAgICAgICAgICBmb3IgKHZhciBydWxlIGluIHJ1bGVzKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJ1bGVJdHIgPSBydWxlc1tydWxlXTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciByID0gMCwgbCA9IHJ1bGVJdHIubGVuZ3RoOyByIDwgbDsgcisrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcnVsZUl0cltyXS50b2tlbiA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC9rZXl3b3JkfHN1cHBvcnR8c3RvcmFnZS8udGVzdChydWxlSXRyW3JdLnRva2VuKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wbGV0aW9uS2V5d29yZHMucHVzaChydWxlSXRyW3JdLnJlZ2V4KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh0eXBlb2YgcnVsZUl0cltyXS50b2tlbiA9PT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgYSA9IDAsIGFMZW5ndGggPSBydWxlSXRyW3JdLnRva2VuLmxlbmd0aDsgYSA8IGFMZW5ndGg7IGErKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgva2V5d29yZHxzdXBwb3J0fHN0b3JhZ2UvLnRlc3QocnVsZUl0cltyXS50b2tlblthXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJ1bGUgPSBydWxlSXRyW3JdLnJlZ2V4Lm1hdGNoKC9cXCguKz9cXCkvZylbYV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBsZXRpb25LZXl3b3Jkcy5wdXNoKHJ1bGUuc3Vic3RyKDEsIHJ1bGUubGVuZ3RoIC0gMikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuY29tcGxldGlvbktleXdvcmRzID0gY29tcGxldGlvbktleXdvcmRzO1xuICAgICAgICB9XG4gICAgICAgIGlmICghYXBwZW5kKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuJGtleXdvcmRMaXN0O1xuICAgICAgICByZXR1cm4gY29tcGxldGlvbktleXdvcmRzLmNvbmNhdCh0aGlzLiRrZXl3b3JkTGlzdCB8fCBbXSk7XG4gICAgfTtcbiAgICB0aGlzLiRjcmVhdGVLZXl3b3JkTGlzdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKCF0aGlzLiRoaWdobGlnaHRSdWxlcylcbiAgICAgICAgICAgIHRoaXMuZ2V0VG9rZW5pemVyKCk7XG4gICAgICAgIHJldHVybiB0aGlzLiRrZXl3b3JkTGlzdCA9IHRoaXMuJGh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x0YSkge1xuICAgICAgICBpZiAoZGVsdGEuc3RhcnQucm93ID09IGRlbHRhLmVuZC5yb3cgJiYgZGVsdGEuc3RhcnQucm93ICE9IHRoaXMucm93KVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAoZGVsdGEuc3RhcnQucm93ID4gdGhpcy5yb3cpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIHZhciBwb2ludCA9ICRnZXRUcmFuc2Zvcm1lZFBvaW50KGRlbHRhLCB7IHJvdzogdGhpcy5yb3csIGNvbHVtbjogdGhpcy5jb2x1bW4gfSwgdGhpcy4kaW5zZXJ0UmlnaHQpO1xuICAgICAgICB0aGlzLnNldFBvc2l0aW9uKHBvaW50LnJvdywgcG9pbnQuY29sdW1uLCB0cnVlKTtcbiAgICB9O1xuICAgIEFuY2hvci5wcm90b3R5cGUuc2V0UG9zaXRpb24gPSBmdW5jdGlvbiAocm93LCBjb2x1bW4sIG5vQ2xpcCkge1xuICAgICAgICB2YXIgcG9zO1xuICAgICAgICBpZiAobm9DbGlwKSB7XG4gICAgICAgICAgICBwb3MgPSB7XG4gICAgICAgICAgICAgICAgcm93OiByb3csXG4gICAgICAgICAgICAgICAgY29sdW1uOiBjb2x1bW5cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBwb3MgPSB0aGlzLiRjbGlwUG9zaXRpb25Ub0RvY3VtZW50KHJvdywgY29sdW1uKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5yb3cgPT0gcG9zLnJvdyAmJiB0aGlzLmNvbHVtbiA9PSBwb3MuY29sdW1uKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB2YXIgb2xkID0ge1xuICAgICAgICAgICAgcm93OiB0aGlzLnJvdyxcbiAgICAgICAgICAgIGNvbHVtbjogdGhpcy5jb2x1bW5cbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5yb3cgPSBwb3Mucm93O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cbiAgICAgICAgICAgIHBvc2l0aW9uLnJvdyA9IE1hdGgubWF4KDAsIHBvc2l0aW9uLnJvdyk7XG4gICAgICAgICAgICBwb3NpdGlvbi5jb2x1bW4gPSBNYXRoLm1pbihNYXRoLm1heChwb3NpdGlvbi5jb2x1bW4sIDApLCB0aGlzLmdldExpbmUocG9zaXRpb24ucm93KS5sZW5ndGgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBwb3NpdGlvbjtcbiAgICB9O1xuICAgIERvY3VtZW50LnByb3RvdHlwZS5pbnNlcnRGdWxsTGluZXMgPSBmdW5jdGlvbiAocm93LCBsaW5lcykge1xuICAgICAgICByb3cgPSBNYXRoLm1pbihNYXRoLm1heChyb3csIDApLCB0aGlzLmdldExlbmd0aCgpKTtcbiAgICAgICAgdmFyIGNvbHVtbiA9IDA7XG4gICAgICAgIGlmIChyb3cgPCB0aGlzLmdldExlbmd0aCgpKSB7XG4gICAgICAgICAgICBsaW5lcyA9IGxpbmVzLmNvbmNhdChbXCJcIl0pO1xuICAgICAgICAgICAgY29sdW1uID0gMDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGxpbmVzID0gW1wiXCJdLmNvbmNhdChsaW5lcyk7XG4gICAgICAgICAgICByb3ctLTtcbiAgICAgICAgICAgIGNvbHVtbiA9IHRoaXMuJGxpbmVzW3Jvd10ubGVuZ3RoO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMoeyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfSwgbGluZXMpO1xuICAgIH07XG4gICAgRG9jdW1lbnQucHJvdG90eXBlLmluc2VydE1lcmdlZExpbmVzID0gZnVuY3Rpb24gKHBvc2l0aW9uLCBsaW5lcykge1xuICAgICAgICB2YXIgc3RhcnQgPSB0aGlzLmNsaXBwZWRQb3MocG9zaXRpb24ucm93LCBwb3NpdGlvbi5jb2x1bW4pO1xuICAgICAgICB2YXIgZW5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AgICAgICBpZiAoZGVsdGEuYWN0aW9uID09IFwicmVtb3ZlXCIgJiYgZGVsdGEuc3RhcnQucm93IDwgZG9jTGVuZ3RoICYmIGRlbHRhLmVuZC5yb3cgPCBkb2NMZW5ndGhcbiAgICAgICAgICAgIHx8IGRlbHRhLmFjdGlvbiA9PSBcImluc2VydFwiICYmIGRlbHRhLnN0YXJ0LnJvdyA8PSBkb2NMZW5ndGgpIHtcbiAgICAgICAgICAgIHRoaXMuYXBwbHlEZWx0YShkZWx0YSk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIERvY3VtZW50LnByb3RvdHlwZS4kc3BsaXRBbmRhcHBseUxhcmdlRGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEsIE1BWCkge1xuICAgICAgICB2YXIgbGluZXMgPSBkZWx0YS5saW5lcztcbiAgICAgICAgdmFyIGwgPSBsaW5lcy5sZW5ndGggLSBNQVggKyAxO1xuICAgICAgICB2YXIgcm93ID0gZGVsdGEuc3RhcnQucm93O1xuICAgICAgICB2YXIgY29sdW1uID0gZGVsdGEuc3RhcnQuY29sdW1uO1xuICAgICAgICBmb3IgKHZhciBmcm9tID0gMCwgdG8gPSAwOyBmcm9tIDwgbDsgZnJvbSA9IHRvKSB7XG4gICAgICAgICAgICB0byArPSBNQVggLSAxO1xuICAgICAgICAgICAgdmFyIGNodW5rID0gbGluZXMuc2xpY2UoZnJvbSwgdG8pO1xuICAgICAgICAgICAgY2h1bmsucHVzaChcIlwiKTtcbiAgICAgICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7XG4gICAgICAgICAgICAgICAgc3RhcnQ6IHRoaXMucG9zKHJvdyArIGZyb20sIGNvbHVtbiksXG4gICAgICAgICAgICAgICAgZW5kOiB0aGlzLnBvcyhyb3cgKyB0bywgY29sdW1uID0gMCksXG4gICAgICAgICAgICAgICAgYWN0aW9uOiBkZWx0YS5hY3Rpb24sXG4gICAgICAgICAgICAgICAgbGluZXM6IGNodW5rXG4gICAgICAgICAgICB9LC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AgdmFyIGN1cnJlbnRMaW5lID0gc2VsZi5jdXJyZW50TGluZTtcbiAgICAgICAgICAgIHZhciBlbmRMaW5lID0gLTE7XG4gICAgICAgICAgICB2YXIgZG9jID0gc2VsZi5kb2M7XG4gICAgICAgICAgICB2YXIgc3RhcnRMaW5lID0gY3VycmVudExpbmU7XG4gICAgICAgICAgICB3aGlsZSAoc2VsZi5saW5lc1tjdXJyZW50TGluZV0pXG4gICAgICAgICAgICAgICAgY3VycmVudExpbmUrKztcbiAgICAgICAgICAgIHZhciBsZW4gPSBkb2MuZ2V0TGVuZ3RoKCk7XG4gICAgICAgICAgICB2YXIgcHJvY2Vzc2VkTGluZXMgPSAwO1xuICAgICAgICAgICAgc2VsZi5ydW5uaW5nID0gZmFsc2U7XG4gICAgICAgICAgICB3aGlsZSAoY3VycmVudExpbmUgPCBsZW4pIHtcbiAgICAgICAgICAgICAgICBzZWxmLiR0b2tlbml6ZVJvdyhjdXJyZW50TGluZSk7XG4gICAgICAgICAgICAgICAgZW5kTGluZSA9IGN1cnJlbnRMaW5lO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudExpbmUrKztcbiAgICAgICAgICAgICAgICB9IHdoaWxlIChzZWxmLmxpbmVzW2N1cnJlbnRMaW5lXSk7XG4gICAgICAgICAgICAgICAgcHJvY2Vzc2VkTGluZXMrKztcbiAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3NlZExpbmVzICUgNSA9PT0gMCkgJiYgKG5ldyBEYXRlKCkgLSB3b3JrZXJTdGFydCkgPiAyMCkge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLnJ1bm5pbmcgPSBzZXRUaW1lb3V0KHNlbGYuJHdvcmtlciwgMjApO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzZWxmLmN1cnJlbnRMaW5lID0gY3VycmVudExpbmU7XG4gICAgICAgICAgICBpZiAoZW5kTGluZSA9PSAtMSlcbiAgICAgICAgICAgICAgICBlbmRMaW5lID0gY3VycmVudExpbmU7XG4gICAgICAgICAgICBpZiAoc3RhcnRMaW5lIDw9IGVuZExpbmUpXG4gICAgICAgICAgICAgICAgc2VsZi5maXJlVXBkYXRlRXZlbnQoc3RhcnRMaW5lLCBlbmRMaW5lKTtcbiAgICAgICAgfTtcbiAgICB9XG4gICAgQmFja2dyb3VuZFRva2VuaXplci5wcm90b3R5cGUuc2V0VG9rZW5pemVyID0gZnVuY3Rpb24gKHRva2VuaXplcikge1xuICAgICAgICB0aGlzLnRva2VuaXplciA9IHRva2VuaXplcjtcbiAgICAgICAgdGhpcy5saW5lcyA9IFtdO1xuICAgICAgICB0aGlzLnN0YXRlcyA9IFtdO1xuICAgICAgICB0aGlzLnN0YXJ0KDApO1xuICAgIH07XG4gICAgQmFja2dyb3VuZFRva2VuaXplci5wcm90b3R5cGUuc2V0RG9jdW1lbnQgPSBmdW5jdGlvbiAoZG9jKSB7XG4gICAgICAgIHRoaXMuZG9jID0gZG9jO1xuICAgICAgICB0aGlzLmxpbmVzID0gW107XG4gICAgICAgIHRoaXMuc3RhdGVzID0gW107XG4gICAgICAgIHRoaXMuc3RvcCgpO1xuICAgIH07XG4gICAgQmFja2dyb3VuZFRva2VuaXplci5wcm90b3R5cGUuZmlyZVVwZGF0ZUV2ZW50ID0gZnVuY3Rpb24gKGZpcnN0Um93LCBsYXN0Um93KSB7XG4gICAgICAgIHZhciBkYXRhID0ge1xuICAgICAgICAgICAgZmlyc3Q6IGZpcnN0Um93LFxuICAgICAgICAgICAgbGFzdDogbGFzdFJvd1xuICAgICAgICB9O1xuICAgICAgICB0aGlzLl9zaWduYWwoXCJ1cGRhdGVcIiwgeyBkYXRhOiBkYXRhIH0pO1xuICAgIH07XG4gICAgQmFja2dyb3VuZFRva2VuaXplci5wcm90b3R5cGUuc3RhcnQgPSBmdW5jdGlvbiAoc3RhcnRSb3cpIHtcbiAgIC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ICB9XG4gICAgICAgICAgICB0aGlzLiR1bmRvU3RhY2sucHVzaCh0aGlzLmxhc3REZWx0YXMpO1xuICAgICAgICAgICAgZGVsdGEuaWQgPSB0aGlzLiRyZXYgPSArK3RoaXMuJG1heFJldjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZGVsdGEuYWN0aW9uID09IFwicmVtb3ZlXCIgfHwgZGVsdGEuYWN0aW9uID09IFwiaW5zZXJ0XCIpXG4gICAgICAgICAgICB0aGlzLiRsYXN0RGVsdGEgPSBkZWx0YTtcbiAgICAgICAgdGhpcy5sYXN0RGVsdGFzLnB1c2goZGVsdGEpO1xuICAgIH07XG4gICAgVW5kb01hbmFnZXIucHJvdG90eXBlLmFkZFNlbGVjdGlvbiA9IGZ1bmN0aW9uIChzZWxlY3Rpb24sIHJldikge1xuICAgICAgICB0aGlzLnNlbGVjdGlvbnMucHVzaCh7XG4gICAgICAgICAgICB2YWx1ZTogc2VsZWN0aW9uLFxuICAgICAgICAgICAgcmV2OiByZXYgfHwgdGhpcy4kcmV2XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgVW5kb01hbmFnZXIucHJvdG90eXBlLnN0YXJ0TmV3R3JvdXAgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHRoaXMubGFzdERlbHRhcyA9IG51bGw7XG4gICAgICAgIHJldHVybiB0aGlzLiRyZXY7XG4gICAgfTtcbiAgICBVbmRvTWFuYWdlci5wcm90b3R5cGUubWFya0lnbm9yZWQgPSBmdW5jdGlvbiAoZnJvbSwgdG8pIHtcbiAgICAgICAgaWYgKHRvID09IG51bGwpXG4gICAgICAgICAgICB0byA9IHRoaXMuJHJldiArIDE7XG4gICAgICAgIHZhciBzdGFjayA9IHRoaXMuJHVuZG9TdGFjaztcbiAgICAgICAgZm9yICh2YXIgaSA9IHN0YWNrLmxlbmd0aDsgaS0tOykge1xuICAgICAgICAgICAgdmFyIGRlbHRhID0gc3RhY2tbaV1bMF07XG4gICAgICAgICAgICBpZiAoZGVsdGEuaWQgPD0gZnJvbSlcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGlmIChkZWx0YS5pZCA8IHRvKVxuICAgICAgICAgICAgICAgIGRlbHRhLmlnbm9yZSA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5sYXN0RGVsdGFzID0gbnVsbDtcbiAgICB9O1xuICAgIFVuZG9NYW5hZ2VyLnByb3RvdHlwZS5nZXRTZWxlY3Rpb24gPSBmdW5jdGlvbiAocmV2LCBhZnRlcikge1xuICAgICAgICB2YXIgc3RhY2sgPSB0aGlzLnNlbGVjdGlvbnM7XG4gICAgICAgIGZvciAodmFyIGkgPSBzdGFjay5sZW5ndGg7IGktLTspIHtcbiAgICAgICAgICAgIHZhciBzZWxlY3Rpb24gPSBzdGFja1tpXTtcbiAgICAgICAgICAgIGlmIChzZWxlY3Rpb24ucmV2IDwgcmV2KSB7XG4gICAgICAgICAgICAgICAgaWYgKGFmdGVyKVxuICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb24gPSBzdGFja1tpICsgMV07XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNlbGVjdGlvbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgVW5kb01hbmFnZXIucHJvdG90eXBlLmdldFJldmlzaW9uID0gZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy4kcmV2O1xuICAgIH07XG4gICAgVW5kb01hbmFnZXIucHJvdG90eXBlLmdldERlbHRhcyA9IGZ1bmN0aW9uIChmcm9tLCB0bykge1xuICAgICAgICBpZiAodG8gPT0gbnVsbClcbiAgICAgICAgICAgIHRvID0gdGhpcy4kcmV2ICsgMTtcbiAgICAgICAgdmFyIHN0YWNrID0gdGhpcy4kdW5kb1N0YWNrO1xuICAgICAgICB2YXIgZW5kID0gbnVsbCwgc3RhcnQgPSAwO1xuICAgICAgICBmb3IgKHZhciBpID0gc3RhY2subGVuZ3RoOyBpLS07KSB7XG4gICAgICAgICAgICB2YXIgZGVsdGEgPSBzdGFja1tpXVswXTtcbiAgICAgICAgICAgIGlmIChkZWx0YS5pZCA8IHRvICYmICFlbmQpXG4gICAgICAgICAgICAgICAgZW5kID0gaSArIDE7XG4gICAgICAgICAgICBpZiAoZGVsdGEuaWQgPD0gZnJvbSkge1xuICAgICAgICAgICAgICAgIHN0YXJ0ID0gaSArIDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHN0YWNrLnNsaWNlKHN0YXJ0LCBlbmQpO1xuICAgIH07XG4gICAgVW5kb01hbmFnZXIucHJvdG90eXBlLmdldENoYW5nZWRSYW5nZXMgPSBmdW5jdGlvbiAoZnJvbSwgdG8pIHtcbiAgICAgICAgaWYgKHRvID09IG51bGwpXG4gICAgICAgICAgICB0byA9IHRoaXMuJHJldiArIDE7XG4gICAgfTtcbiAgICBVbmRvTWFuYWdlci5wcm90b3R5cGUuZ2V0Q2hhbmdlZExpbmVzID0gZnVuY3Rpb24gKGZyb20sIHRvKSB7XG4gICAgICAgIGlmICh0byA9PSBudWxsKVxuICAgICAgICAgICAgdG8gPSB0aGlzLiRyZXYgKyAxO1xuICAgIH07XG4gICAgVW5kb01hbmFnZXIucHJvdG90eXBlLnVuZG8gPSBmdW5jdGlvbiAoc2Vzc2lvbiwgZG9udFNlbGVjdCkge1xuICAgICAgICB0aGlzLmxhc3REZWx0YXMgPSBudWxsO1xuICAgICAgICB2YXIgc3RhY2sgPSB0aGlzLiR1bmRvU3RhY2s7XG4gICAgICAgIGlmICghcmVhcnJhbmdlVW5kb1N0YWNrKHN0YWNrLCBzdGFjay5sZW5ndGgpKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAoIXNlc3Npb24pXG4gICAgICAgICAgICBzZXNzaW9uID0gdGhpcy4kc2Vzc2lvbjtcbiAgICAgICAgaWYgKHRoaXMuJHJlZG9TdGFja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hciBwb2ludCA9IHRoaXMubWFya3NbaV07XG4gICAgICAgIHZhciBjbXAgPSBjb21wYXJlUG9pbnRzKHBvaW50LCBzdGFydCk7XG4gICAgICAgIGlmIChjbXAgPCAwKSB7XG4gICAgICAgICAgICBjb250aW51ZTsgLy8gZGVsdGEgc3RhcnRzIGFmdGVyIHRoZSByYW5nZVxuICAgICAgICB9XG4gICAgICAgIGlmIChjbXAgPT09IDApIHtcbiAgICAgICAgICAgIGlmIChpc0luc2VydCkge1xuICAgICAgICAgICAgICAgIGlmIChwb2ludC5iaWFzID09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgY21wID0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50LmJpYXMgPT0gLTE7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB2YXIgY21wMiA9IGlzSW5zZXJ0ID8gY21wIDogY29tcGFyZVBvaW50cyhwb2ludCwgZW5kKTtcbiAgICAgICAgaWYgKGNtcDIgPiAwKSB7XG4gICAgICAgICAgICBwb2ludC5yb3cgKz0gcm93U2hpZnQ7XG4gICAgICAgICAgICBwb2ludC5jb2x1bW4gKz0gcG9pbnQucm93ID09IGVuZC5yb3cgPyBjb2xTaGlmdCA6IDA7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlzSW5zZXJ0ICYmIGNtcDIgPD0gMCkge1xuICAgICAgICAgICAgcG9pbnQucm93ID0gc3RhcnQucm93O1xuICAgICAgICAgICAgcG9pbnQuY29sdW1uID0gc3RhcnQuY29sdW1uO1xuICAgICAgICAgICAgaWYgKGNtcDIgPT09IDApXG4gICAgICAgICAgICAgICAgcG9pbnQuYmlhcyA9IDE7XG4gICAgICAgIH1cbiAgICB9XG59XG5mdW5jdGlvb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biAgICB9XG4gICAgZWxzZSBpZiAoIWkxICYmIGkyKSB7XG4gICAgICAgIGlmIChjbXAoZDIuc3RhcnQsIGQxLnN0YXJ0KSA+PSAwKSB7XG4gICAgICAgICAgICBzaGlmdChkMiwgZDEsICsxKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChjbXAoZDIuc3RhcnQsIGQxLnN0YXJ0KSA8PSAwKSB7XG4gICAgICAgICAgICBzaGlmdChkMSwgZDIsICsxKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgfVxuICAgIGVsc2UgaWYgKCFpMSAmJiAhaTIpIHtcbiAgICAgICAgaWYgKGNtcChkMi5zdGFydCwgZDEuc3RhcnQpID49IDApIHtcbiAgICAgICAgICAgIHNoaWZ0KGQyLCBkMSwgKzEpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGNtcChkMi5lbmQsIGQxLnN0YXJ0KSA8PSAwKSB7XG4gICAgICAgICAgICBzaGlmdChkMSwgZDIsIC0xKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiBbZDIsIGQxXTtcbn1cbmZ1bmN0aW9uIHN3YXBHcm91cHMoZHMxLCBkczIpIHtcbiAgICBmb3IgKHZhciBpID0gZHMxLmxlbmd0aDsgaS0tOykge1xuICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGRzMi5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgaWYgKCFzd2FwKGRzMVtpXSwgZHMyW2pdKSkge1xuICAgICAgICAgICAgICAgIHdoaWxlIChpIDwgZHMxLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoai0tKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzd2FwKGRzMltqXSwgZHMxW2ldKTtcbiAgICA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GlmICh4Zm9ybWVkWzJdKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbHRhU2V0LnNwbGljZShpICsgMSwgMSwgeGZvcm1lZFsxXSwgeGZvcm1lZFsyXSk7XG4gICAgICAgICAgICAgICAgICAgIGkrKztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoIXhmb3JtZWRbMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsdGFTZXQuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICBpLS07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICghZGVsdGFTZXQubGVuZ3RoKSB7XG4gICAgICAgICAgICByZWRvU3RhY2suc3BsaWNlKGosIDEpO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZWRvU3RhY2s7XG59XG5mdW5jdGlvbiByZWJhc2VSZWRvU3RhY2socmVkb1N0YWNrLCBkZWx0YVNldHMpIHtcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IGRlbHRhU2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICB2YXIgZGVsdGFzID0gZGVsdGFTZXRzW2ldO1xuICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGRlbHRhcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgbW92ZURlbHRhc0J5T25lKHJlZG9TdGFjaywgZGVsdGFzW2pdKTtcbiAgICAgICAgfVxuICAgIH1cbn1cbmV4cG9ydHMuVW5kb01hbmFnZXIgPSBVbmRvTWFuYWdlcjtcblxufSk7XG5cbmFjZS5kZWZpbmUoXCJhY2UvZWRpdF9zZXNzaW9uL2ZvbGRfbGluZVwiLFtcInJlcXVpcmVcIixcImV4cG9ydHNcIixcIm1vZHVsZVwiLFwiYWNlL3JhbmdlXCJdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpe1widXNlIHN0cmljdFwiO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BlbmRSb3csIGVuZENvbHVtbikge1xuICAgICAgICB2YXIgbGFzdEVuZCA9IDAsIGZvbGRzID0gdGhpcy5mb2xkcywgZm9sZCwgY21wLCBzdG9wLCBpc05ld1JvdyA9IHRydWU7XG4gICAgICAgIGlmIChlbmRSb3cgPT0gbnVsbCkge1xuICAgICAgICAgICAgZW5kUm93ID0gdGhpcy5lbmQucm93O1xuICAgICAgICAgICAgZW5kQ29sdW1uID0gdGhpcy5lbmQuY29sdW1uO1xuICAgICAgICB9XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZm9sZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGZvbGQgPSBmb2xkc1tpXTtcbiAgICAgICAgICAgIGNtcCA9IGZvbGQucmFuZ2UuY29tcGFyZVN0YXJ0KGVuZFJvdywgZW5kQ29sdW1uKTtcbiAgICAgICAgICAgIGlmIChjbXAgPT0gLTEpIHtcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhudWxsLCBlbmRSb3csIGVuZENvbHVtbiwgbGFzdEVuZCwgaXNOZXdSb3cpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHN0b3AgPSBjYWxsYmFjayhudWxsLCBmb2xkLnN0YXJ0LnJvdywgZm9sZC5zdGFydC5jb2x1bW4sIGxhc3RFbmQsIGlzTmV3Um93KTtcbiAgICAgICAgICAgIHN0b3AgPSAhc3RvcCAmJiBjYWxsYmFjayhmb2xkLnBsYWNlaG9sZGVyLCBmb2xkLnN0YXJ0LnJvdywgZm9sZC5zdGFydC5jb2x1bW4sIGxhc3RFbmQpO1xuICAgICAgICAgICAgaWYgKHN0b3AgfHwgY21wID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaXNOZXdSb3cgPSAhZm9sZC5zYW1lUm93O1xuICAgICAgICAgICAgbGFzdEVuZCA9IGZvbGQuZW5kLmNvbHVtbjtcbiAgICAgICAgfVxuICAgICAgICBjYWxsYmFjayhudWxsLCBlbmRSb3csIGVuZENvbHVtbiwgbGFzdEVuZCwgaXNOZXdSb3cpO1xuICAgIH07XG4gICAgRm9sZExpbmUucHJvdG90eXBlLmdldE5leHRGb2xkVG8gPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHtcbiAgICAgICAgdmFyIGZvbGQsIGNtcDtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGlzLmZvbGRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBmb2xkID0gdGhpcy5mb2xkc1tpXTtcbiAgICAgICAgICAgIGNtcCA9IGZvbGQucmFuZ2UuY29tcGFyZUVuZChyb3csIGNvbHVtbik7XG4gICAgICAgICAgICBpZiAoY21wID09IC0xKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgZm9sZDogZm9sZCxcbiAgICAgICAgICAgICAgICAgICAga2luZDogXCJhZnRlclwiXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNtcCA9PT0gMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIGZvbGQ6IGZvbGQsXG4gICAgICAgICAgICAgICAgICAgIGtpbmQ6IFwiaW5zaWRlXCJcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH07XG4gICAgRm9sZExpbmUucHJvdG90eXBlLmFkZFJlbW92ZUNoYXJzID0gZnVuY3Rpb24gKHJvdywgY29sdW1uLCBsZW4pIHtcbiAgICAgICAgdmFyIHJldCA9IHRoaXMuZ2V0TmV4dEZvbGRUbyhyb3csIGNvbHVtbiksIGZvbGQsIGZvbGRzO1xuICAgICAgICBpZiAocmV0KSB7XG4gICAgICAgICAgICBmb2xkID0gcmV0LmZvbGQ7XG4gICAgICAgICAgICBpZiAocmV0LmtpbmQgPT0gXCJpbnNpZGVcIlxuICAgICAgICAgICAgICAgICYmIGZvbGQuc3RhcnQuY29sdW1uICE9IGNvbHVtblxuICAgICAgICAgICAgICAgICYmIGZvbGQuc3RhcnQucm93ICE9IHJvdykge1xuICAgICAgICAgICAgICAgIHdpbmRvdy5jb25zb2xlICYmIHdpbmRvdy5jb25zb2xlLmxvZyhyb3csIGNvbHVtbiwgZm9sZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChmb2xkLnN0YXJ0LnJvdyA9PSByb3cpIHtcbiAgICAgICAgICAgICAgICBmb2xkcyA9IHRoaXMuZm9sZHM7XG4gICAgICAgICAgICAgICAgdmFyIGkgPSBmb2xkcy5pbmRleE9mKGZvbGQpO1xuICAgICAgICAgICAgICAgIGlmIChpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc3RhcnQuY29sdW1uICs9IGxlbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZm9yIChpOyBpIDwgZm9sZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgZm9sZCA9IGZvbGRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBmb2xkLnN0YXJ0LmNvbHVtbiArPSBsZW47XG4gICAgICAgICAgICAgICAgICAgIGlmICghZm9sZC5zYW1lUm93KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZm9sZC5lbmQuY29sdW1uICs9IGxlbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5lbmQuY29sdW1uICs9IGxlbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgRm9sZExpbmUucHJvdG90eXBlLnNwbGl0ID0gZnVuY3Rpb24gKHJvdywgY29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ggfHwgMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHZhciByYW5nZSA9IGxpc3RbaV07XG4gICAgICAgICAgICB2YXIgY21wRW5kID0gY29tcGFyZVBvaW50cyhwb3MsIHJhbmdlLmVuZCk7XG4gICAgICAgICAgICBpZiAoY21wRW5kID4gMClcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIHZhciBjbXBTdGFydCA9IGNvbXBhcmVQb2ludHMocG9zLCByYW5nZS5zdGFydCk7XG4gICAgICAgICAgICBpZiAoY21wRW5kID09PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBleGNsdWRlRWRnZXMgJiYgY21wU3RhcnQgIT09IDAgPyAtaSAtIDIgOiBpO1xuICAgICAgICAgICAgaWYgKGNtcFN0YXJ0ID4gMCB8fCAoY21wU3RhcnQgPT09IDAgJiYgIWV4Y2x1ZGVFZGdlcykpXG4gICAgICAgICAgICAgICAgcmV0dXJuIGk7XG4gICAgICAgICAgICByZXR1cm4gLWkgLSAxO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAtaSAtIDE7XG4gICAgfTtcbiAgICBSYW5nZUxpc3QucHJvdG90eXBlLmFkZCA9IGZ1bmN0aW9uIChyYW5nZSkge1xuICAgICAgICB2YXIgZXhjbHVkZUVkZ2VzID0gIXJhbmdlLmlzRW1wdHkoKTtcbiAgICAgICAgdmFyIHN0YXJ0SW5kZXggPSB0aGlzLnBvaW50SW5kZXgocmFuZ2Uuc3RhcnQsIGV4Y2x1ZGVFZGdlcyk7XG4gICAgICAgIGlmIChzdGFydEluZGV4IDwgMClcbiAgICAgICAgICAgIHN0YXJ0SW5kZXggPSAtc3RhcnRJbmRleCAtIDE7XG4gICAgICAgIHZhciBlbmRJbmRleCA9IHRoaXMucG9pbnRJbmRleChyYW5nZS5lbmQsIGV4Y2x1ZGVFZGdlcywgc3RhcnRJbmRleCk7XG4gICAgICAgIGlmIChlbmRJbmRleCA8IDApX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IGkgPCBsaXN0Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICByYW5nZSA9IG5leHQ7XG4gICAgICAgICAgICBuZXh0ID0gbGlzdFtpXTtcbiAgICAgICAgICAgIHZhciBjbXAgPSBjb21wYXJlUG9pbnRzKHJhbmdlLmVuZCwgbmV4dC5zdGFydCk7XG4gICAgICAgICAgICBpZiAoY21wIDwgMClcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIGlmIChjbXAgPT0gMCAmJiAhcmFuZ2UuaXNFbXB0eSgpICYmICFuZXh0LmlzRW1wdHkoKSlcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIGlmIChjb21wYXJlUG9pbnRzKHJhbmdlLmVuZCwgbmV4dC5lbmQpIDwgMCkge1xuICAgICAgICAgICAgICAgIHJhbmdlLmVuZC5yb3cgPSBuZXh0LmVuZC5yb3c7XG4gICAgICAgICAgICAgICAgcmFuZ2UuZW5kLmNvbHVtbiA9IG5leHQuZW5kLmNvbHVtbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxpc3Quc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgcmVtb3ZlZC5wdXNoKG5leHQpO1xuICAgICAgICAgICAgbmV4dCA9IHJhbmdlO1xuICAgICAgICAgICAgaS0tO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMucmFuZ2VzID0gbGlzdDtcbiAgICAgICAgcmV0dXJuIHJlbW92ZWQ7XG4gICAgfTtcbiAgICBSYW5nZUxpc3QucHJvdG90eXBlLmNvbnRhaW5zID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnBvaW50SW5kZXgoeyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfSkgPj0gMDtcbiAgICB9O1xuICAgIFJhbmdlTGlzdC5wcm90b3R5cGUuY29udGFpbnNQb2ludCA9IGZ1bmN0aW9uIChwb3MpIHtcbiAgICA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uZ2VzO1xuICAgICAgICBmb3IgKHZhciBpID0gMCwgbiA9IHJhbmdlcy5sZW5ndGg7IGkgPCBuOyBpKyspIHtcbiAgICAgICAgICAgIHZhciByID0gcmFuZ2VzW2ldO1xuICAgICAgICAgICAgaWYgKHIuZW5kLnJvdyA+PSBzdGFydFJvdylcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBpZiAoZGVsdGEuYWN0aW9uID09IFwiaW5zZXJ0XCIpIHtcbiAgICAgICAgICAgIHZhciBsaW5lRGlmID0gZW5kUm93IC0gc3RhcnRSb3c7XG4gICAgICAgICAgICB2YXIgY29sRGlmZiA9IC1zdGFydC5jb2x1bW4gKyBlbmQuY29sdW1uO1xuICAgICAgICAgICAgZm9yICg7IGkgPCBuOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgciA9IHJhbmdlc1tpXTtcbiAgICAgICAgICAgICAgICBpZiAoci5zdGFydC5yb3cgPiBzdGFydFJvdylcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgaWYgKHIuc3RhcnQucm93ID09IHN0YXJ0Um93ICYmIHIuc3RhcnQuY29sdW1uID49IHN0YXJ0LmNvbHVtbikge1xuICAgICAgICAgICAgICAgICAgICBpZiAoci5zdGFydC5jb2x1bW4gPT0gc3RhcnQuY29sdW1uICYmIHRoaXMuJGJpYXMgPD0gMCkge1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgci5zdGFydC5jb2x1bW4gKz0gY29sRGlmZjtcbiAgICAgICAgICAgICAgICAgICAgICAgIHIuc3RhcnQucm93ICs9IGxpbmVEaWY7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHIuZW5kLnJvdyA9PSBzdGFydFJvdyAmJiByLmVuZC5jb2x1bW4gPj0gc3RhcnQuY29sdW1uKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyLmVuZC5jb2x1bW4gPT0gc3RhcnQuY29sdW1uICYmIHRoaXMuJGJpYXMgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoci5lbmQuY29sdW1uID09IHN0YXJ0LmNvbHVtbiAmJiBjb2xEaWZmID4gMCAmJiBpIDwgbiAtIDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyLmVuZC5jb2x1bW4gPiByLnN0YXJ0LmNvbHVtbiAmJiByLmVuZC5jb2x1bW4gPT0gcmFuZ2VzW2kgKyAxXS5zdGFydC5jb2x1bW4pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgci5lbmQuY29sdW1uIC09IGNvbERpZmY7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgci5lbmQuY29sdW1uICs9IGNvbERpZmY7XG4gICAgICAgICAgICAgICAgICAgIHIuZW5kLnJvdyArPSBsaW5lRGlmO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHZhciBsaW5lRGlmID0gc3RhcnRSb3cgLSBlbmRSb3c7XG4gICAgICAgICAgICB2YXIgY29sRGlmZiA9IHN0YXJ0LmNvbHVtbiAtIGVuZC5jb2x1bW47XG4gICAgICAgICAgICBmb3IgKDsgaSA8IG47IGkrKykge1xuICAgICAgICAgICAgICAgIHZhciByID0gcmFuZ2VzW2ldO1xuICAgICAgICAgICAgICAgIGlmIChyLnN0YXJ0LnJvdyA+IGVuZFJvdylcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgaWYgKHIuZW5kLnJvdyA8IGVuZFJvd1xuICAgICAgICAgICAgICAgICAgICAmJiAoc3RhcnRSb3cgPCByLmVuZC5yb3dcbiAgICAgICAgICAgICAgICAgICAgICAgIHx8IHN0YXJ0Um93ID09IHIuZW5kLnJvdyAmJiBzdGFydC5jb2x1bW4gPCByLmVuZC5jb2x1bW4pKSB7XG4gICAgICAgICAgICAgICAgICAgIHIuZW5kLnJvdyA9IHN0YXJ0Um93O1xuICAgICAgICAgICAgICAgICAgICByLmVuZC5jb2x1bW4gPSBzdGFydC5jb2x1bW47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHIuZW5kLnJvdyA9PSBlbmRSb3cpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHIuZW5kLmNvbHVtbiA8PSBlbmQuY29sdW1uKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobGluZURpZiB8fCByLmVuZC5jb2x1bW4gPiBzdGFydC5jb2x1bW4pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByLmVuZC5jb2x1bW4gPSBzdGFydC5jb2x1bW47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgci5lbmQucm93ID0gc3RhcnQucm93O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgci5lbmQuY29sdW1uICs9IGNvbERpZmY7XG4gICAgICAgICAgICAgICAgICAgICAgICByLmVuZC5yb3cgKz0gbGluZURpZjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChyLmVuZC5yb3cgPiBlbmRSb3cpIHtcbiAgICAgICAgICAgICAgICAgICAgci5lbmQucm93ICs9IGxpbmVEaWY7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChyLnN0YXJ0LnJvdyA8IGVuZFJvd1xuICAgICAgICAgICAgICAgICAgICAmJiAoc3RhcnRSb3cgPCByLnN0YXJ0LnJvd1xuICAgICAgICAgICAgICAgICAgICAgICAgfHwgc3RhcnRSb3cgPT0gci5zdGFydC5yb3cgJiYgc3RhcnQuY29sdW1uIDwgci5zdGFydC5jb2x1bW4pKSB7XG4gICAgICAgICAgICAgICAgICAgIHIuc3RhcnQucm93ID0gc3RhcnRSb3c7XG4gICAgICAgICAgICAgICAgICAgIHIuc3RhcnQuY29sdW1uID0gc3RhcnQuY29sdW1uO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChyLnN0YXJ0LnJvdyA9PSBlbmRSb3cpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHIuc3RhcnQuY29sdW1uIDw9IGVuZC5jb2x1bW4pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsaW5lRGlmIHx8IHIuc3RhcnQuY29sdW1uID4gc3RhcnQuY29sdW1uKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgci5zdGFydC5jb2x1bW4gPSBzdGFydC5jb2x1bW47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgci5zdGFydC5yb3cgPSBzdGFydC5yb3c7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByLnN0YXJ0LmNvbHVtbiArPSBjb2xEaWZmO1xuICAgICAgICAgICAgICAgICAgICAgICAgci5zdGFydC5yb3cgKz0gbGluZURpZjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChyLnN0YXJ0LnJvdyA+IGVuZFJvdykge1xuICAgICAgICAgICAgICAgICAgICByLnN0YXJ0LnJvdyArPSBsaW5lRGlmO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB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ZW50XCIpLk1vdXNlRXZlbnQ7XG5mdW5jdGlvbiBGb2xkaW5nKCkge1xuICAgIHRoaXMuZ2V0Rm9sZEF0ID0gZnVuY3Rpb24gKHJvdywgY29sdW1uLCBzaWRlKSB7XG4gICAgICAgIHZhciBmb2xkTGluZSA9IHRoaXMuZ2V0Rm9sZExpbmUocm93KTtcbiAgICAgICAgaWYgKCFmb2xkTGluZSlcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB2YXIgZm9sZHMgPSBmb2xkTGluZS5mb2xkcztcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBmb2xkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIHJhbmdlID0gZm9sZHNbaV0ucmFuZ2U7XG4gICAgICAgICAgICBpZiAocmFuZ2UuY29udGFpbnMocm93LCBjb2x1bW4pKSB7XG4gICAgICAgICAgICAgICAgaWYgKHNpZGUgPT0gMSAmJiByYW5nZS5pc0VuZChyb3csIGNvbHVtbikgJiYgIXJhbmdlLmlzRW1wdHkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc2lkZSA9PSAtMSAmJiByYW5nZS5pc1N0YXJ0KHJvdywgY29sdW1uKSAmJiAhcmFuZ2UuaXNFbXB0eSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZm9sZHNbaV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIHRoaXMuZ2V0Rm9sZHNJblJhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7XG4gICAgICAgIHZhciBzdGFydCA9IHJhbmdlLnN0YXJ0O1xuICAgICAgICB2YXIgZW5kID0gcmFuZ2UuZW5kO1xuICAgICAgICB2YXIgZm9sZExpbmVzID0gdGhpcy4kZm9sZERhdGE7XG4gICAgICAgIHZhciBmb3VuZEZvbGRzID0gW107XG4gICAgICAgIHN0YXJ0LmNvbHVtbiArPSAxO1xuICAgICAgICBlbmQuY29sdW1uIC09IDE7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZm9sZExpbmVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgY21wID0gZm9sZExpbmVzW2ldLnJhbmdlLmNvbXBhcmVSYW5nZShyYW5nZSk7XG4gICAgICAgICAgICBpZiAoY21wID09IDIpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNtcCA9PSAtMikge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGZvbGRzID0gZm9sZExpbmVzW2ldLmZvbGRzO1xuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBmb2xkcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIHZhciBmb2xkID0gZm9sZHNbal07XG4gICAgICAgICAgICAgICAgY21wID0gZm9sZC5yYW5nZS5jb21wYXJlUmFuZ2UocmFuZ2UpO1xuICAgICAgICAgICAgICAgIGlmIChjbXAgPT0gLTIpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGNtcCA9PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIFxuICAgICAgICAgICAgICAgIGlmIChjbXAgPT0gNDIpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZvdW5kRm9sZHMucHVzaChmb2xkKTtcbiAgICAgICAgICAgIH1cbiAgICA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mUpIHtcbiAgICAgICAgZm9sZExpbmUgPSBmb2xkTGluZSB8fCB0aGlzLmdldEZvbGRMaW5lKHJvdyk7XG4gICAgICAgIGlmICghZm9sZExpbmUpXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgdmFyIGxhc3RGb2xkID0ge1xuICAgICAgICAgICAgZW5kOiB7IGNvbHVtbjogMCB9XG4gICAgICAgIH07XG4gICAgICAgIHZhciBzdHIsIGZvbGQ7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZm9sZExpbmUuZm9sZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGZvbGQgPSBmb2xkTGluZS5mb2xkc1tpXTtcbiAgICAgICAgICAgIHZhciBjbXAgPSBmb2xkLnJhbmdlLmNvbXBhcmVFbmQocm93LCBjb2x1bW4pO1xuICAgICAgICAgICAgaWYgKGNtcCA9PSAtMSkge1xuICAgICAgICAgICAgICAgIHN0ciA9IHRoaXNcbiAgICAgICAgICAgICAgICAgICAgLmdldExpbmUoZm9sZC5zdGFydC5yb3cpXG4gICAgICAgICAgICAgICAgICAgIC5zdWJzdHJpbmcobGFzdEZvbGQuZW5kLmNvbHVtbiwgZm9sZC5zdGFydC5jb2x1bW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY21wID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsYXN0Rm9sZCA9IGZvbGQ7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFzdHIpXG4gICAgICAgICAgICBzdHIgPSB0aGlzLmdldExpbmUoZm9sZC5zdGFydC5yb3cpLnN1YnN0cmluZyhsYXN0Rm9sZC5lbmQuY29sdW1uKTtcbiAgICAgICAgaWYgKHRyaW0gPT0gLTEpXG4gICAgICAgICAgICByZXR1cm4gc3RyLnN1YnN0cmluZygwL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hdGEgPSB0aGlzLiRmb2xkRGF0YTtcbiAgICAgICAgdmFyIGkgPSAwO1xuICAgICAgICBpZiAoc3RhcnRGb2xkTGluZSlcbiAgICAgICAgICAgIGkgPSBmb2xkRGF0YS5pbmRleE9mKHN0YXJ0Rm9sZExpbmUpO1xuICAgICAgICBpZiAoaSA9PSAtMSlcbiAgICAgICAgICAgIGkgPSAwO1xuICAgICAgICBmb3IgKGk7IGkgPCBmb2xkRGF0YS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGZvbGRMaW5lID0gZm9sZERhdGFbaV07XG4gICAgICAgICAgICBpZiAoZm9sZExpbmUuZW5kLnJvdyA+PSBkb2NSb3cpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZm9sZExpbmU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfTtcbiAgICB0aGlzLmdldEZvbGRlZFJvd0NvdW50ID0gZnVuY3Rpb24gKGZpcnN0LCBsYXN0KSB7XG4gICAgICAgIHZhciBmb2xkRGF0YSA9IHRoaXMuJGZvbGREYXRhLCByb3dDb3VudCA9IGxhc3QgLSBmaXJzdCArIDE7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZm9sZERhdGEubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHZhciBmb2xkTGluZSA9IGZvbGREYXRhW2ldLCBlbmQgPSBmb2xkTGluZS5lbmQucm93LCBzdGFydCA9IGZvbGRMaW5lLnN0YXJ0LnJvdztcbiAgICAgICAgICAgIGlmIChlbmQgPj0gbGFzdCkge1xuICAgICAgICAgICAgICAgIGlmIChzdGFydCA8IGxhc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXJ0ID49IGZpcnN0KVxuICAgICAgICAgICAgICAgICAgICAgICAgcm93Q291bnQgLT0gbGFzdCAtIHN0YXJ0O1xuICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICByb3dDb3VudCA9IDA7IC8vIGluIG9uZSBmb2xkXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoZW5kID49IGZpcnN0KSB7XG4gICAgICAgICAgICAgICAgaWYgKHN0YXJ0ID49IGZpcnN0KSAvLyBmb2xkIGluc2lkZSByYW5nZVxuICAgICAgICAgICAgICAgICAgICByb3dDb3VudCAtPSBlbmQgLSBzdGFydDtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIHJvd0NvdW50IC09IGVuZCAtIGZpcnN0ICsgMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcm93Q291bnQ7XG4gICAgfTtcbiAgICB0aGlzLiRhZGRGb2xkTGluZSA9IGZ1bmN0aW9uIChmb2xkTGluZSkge1xuICAgICAgICB0aGlzLiRmb2xkRGF0YS5wdXNoKGZvbGRMaW5lKTtcbiAgICAgICAgdGhpcy4kZm9sZERhdGEuc29ydChmdW5jdGlvbiAoYSwgYikge1xuICAgICAgICAgICAgcmV0dXJuIGEuc3RhcnQucm93IC0gYi5zdGFydC5yb3c7XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gZm9sZExpbmU7XG4gICAgfTtcbiAgICB0aGlzLmFkZEZvbGQgPSBmdW5jdGlvbiAocGxhY2Vob2xkZXIsIHJhbmdlKSB7XG4gICAgICAgIHZhciBmb2xkRGF0YSA9IHRoaXMuJGZvbGREYXRhO1xuICAgICAgICB2YXIgYWRkZWQgPSBmYWxzZTtcbiAgICAgICAgdmFyIGZvbGQ7XG4gICAgICAgIGlmIChwbGFjZWhvbGRlciBpbnN0YW5jZW9mIEZvbGQpXG4gICAgICAgICAgICBmb2xkID0gcGxhY2Vob2xkZXI7XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgZm9sZCA9IG5ldyBGb2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AgICAgICBpZiAoZm9sZHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgdGhpcy5yZW1vdmVGb2xkcyhmb2xkcyk7XG4gICAgICAgICAgICBpZiAoIWZvbGQuY29sbGFwc2VDaGlsZHJlbikge1xuICAgICAgICAgICAgICAgIGZvbGRzLmZvckVhY2goZnVuY3Rpb24gKHN1YkZvbGQpIHtcbiAgICAgICAgICAgICAgICAgICAgZm9sZC5hZGRTdWJGb2xkKHN1YkZvbGQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZm9sZERhdGEubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHZhciBmb2xkTGluZSA9IGZvbGREYXRhW2ldO1xuICAgICAgICAgICAgaWYgKGVuZFJvdyA9PSBmb2xkTGluZS5zdGFydC5yb3cpIHtcbiAgICAgICAgICAgICAgICBmb2xkTGluZS5hZGRGb2xkKGZvbGQpO1xuICAgICAgICAgICAgICAgIGFkZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHN0YXJ0Um93ID09IGZvbGRMaW5lLmVuZC5yb3cpIHtcbiAgICAgICAgICAgICAgICBmb2xkTGluZS5hZGRGb2xkKGZvbGQpO1xuICAgICAgICAgICAgICAgIGFkZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBpZiAoIWZvbGQuc2FtZVJvdykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZm9sZExpbmVOZXh0ID0gZm9sZERhdGFbaSArIDFdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZm9sZExpbmVOZXh0ICYmIGZvbGRMaW5lTmV4dC5zdGFydC5yb3cgPT0gZW5kUm93KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb2xkTGluZS5tZXJnZShmb2xkTGluZU5leHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChlbmRSb3cgPD0gZm9sZExpbmUuc3RhcnQucm93KSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFhZGRlZClcbiAgICAgICAgICAgIGZvbGRMaW5lID0gdGhpcy4kYWRkRm9sZExpbmUobmV3IEZvbGRMaW5lKHRoaXMuJGZvbGREYXRhLCBmb2xkKSk7XG4gICAgICAgIGlmICh0aGlzLiR1c2VXcmFwTW9kZSlcbiAgICAgICAgICAgIHRoaXMuJHVwZGF0ZVdyYXBEYXRhKGZvbGRMaW5lLnN0YXJ0LnJvdywgZm9sZExpbmUuc3RhcnQucm93KTtcbiAgICAgICAgZWxzZVxuICAgICAgICAgICAgdGhpcy4kdXBkYXRlUm93TGVuZ3RoQ2FjaGUoZm9sZExpbmUuc3RhcnQucm93LCBmb2xkTGluZS5zdGFydC5yb3cpO1xuICAgICAgICB0aGlzLiRtb2RpZmllZCA9IHRydWU7XG4gICAgICAgIHRoaXMuX3NpZ25hbChcImNoYW5nZUZvbGRcIiwgeyBkYXRhOiBmb2xkLCBhY3Rpb246IFwiYWRkXCIgfSk7XG4gICAgICAgIHJldHVybiBmb2xkO1xuICAgIH07XG4gICAgdGhpcy5hZGRGb2xkcyA9IGZ1bmN0aW9uIChmb2xkcykge1xuICAgICAgICBmb2xkcy5mb3JFYWNoKGZ1bmN0aW9uIChmb2xkKSB7XG4gICAgICAgICAgICB0aGlzLmFkZEZvbGQoZm9sZCk7XG4gICAgICAgIH0sIHRoaXMpO1xuICAgIH07XG4gICAgdGhpcy5yZW1vdmVGb2xkID0gZnVuY3Rpb24gKGZvbGQpIHtcbiAgICAgICAgdmFyIGZvbG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vbiA9PSBudWxsKSB7XG4gICAgICAgICAgICByYW5nZSA9IG5ldyBSYW5nZSgwLCAwLCB0aGlzLmdldExlbmd0aCgpLCAwKTtcbiAgICAgICAgICAgIGlmIChleHBhbmRJbm5lciA9PSBudWxsKVxuICAgICAgICAgICAgICAgIGV4cGFuZElubmVyID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0eXBlb2YgbG9jYXRpb24gPT0gXCJudW1iZXJcIikge1xuICAgICAgICAgICAgcmFuZ2UgPSBuZXcgUmFuZ2UobG9jYXRpb24sIDAsIGxvY2F0aW9uLCB0aGlzLmdldExpbmUobG9jYXRpb24pLmxlbmd0aCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoXCJyb3dcIiBpbiBsb2NhdGlvbikge1xuICAgICAgICAgICAgcmFuZ2UgPSBSYW5nZS5mcm9tUG9pbnRzKGxvY2F0aW9uLCBsb2NhdGlvbik7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoQXJyYXkuaXNBcnJheShsb2NhdGlvbikpIHtcbiAgICAgICAgICAgIGZvbGRzID0gW107XG4gICAgICAgICAgICBsb2NhdGlvbi5mb3JFYWNoKGZ1bmN0aW9uIChyYW5nZSkge1xuICAgICAgICAgICAgICAgIGZvbGRzID0gZm9sZHMuY29uY2F0KHRoaXMudW5mb2xkKHJhbmdlKSk7XG4gICAgICAgICAgICB9LCB0aGlzKTtcbiAgICAgICAgICAgIHJldHVybiBmb2xkcztcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJhbmdlID0gbG9jYXRpb247XG4gICAgICAgIH1cbiAgICAgICAgZm9sZHMgPSB0aGlzLmdldEZvbGRzSW5SYW5nZUxpc3QocmFuZ2UpO1xuICAgICAgICB2YXIgb3V0ZXJtb3N0Rm9sZHMgPSBmb2xkcztcbiAgICAgICAgd2hpbGUgKGZvbGRzLmxlbmd0aCA9PSAxXG4gICAgICAgICAgICAm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b2xkUm93KSB7XG4gICAgICAgIHZhciBmb2xkTGluZSA9IHRoaXMuZ2V0Rm9sZExpbmUoZG9jUm93LCBzdGFydEZvbGRSb3cpO1xuICAgICAgICByZXR1cm4gZm9sZExpbmUgPyBmb2xkTGluZS5zdGFydC5yb3cgOiBkb2NSb3c7XG4gICAgfTtcbiAgICB0aGlzLmdldEZvbGREaXNwbGF5TGluZSA9IGZ1bmN0aW9uIChmb2xkTGluZSwgZW5kUm93LCBlbmRDb2x1bW4sIHN0YXJ0Um93LCBzdGFydENvbHVtbikge1xuICAgICAgICBpZiAoc3RhcnRSb3cgPT0gbnVsbClcbiAgICAgICAgICAgIHN0YXJ0Um93ID0gZm9sZExpbmUuc3RhcnQucm93O1xuICAgICAgICBpZiAoc3RhcnRDb2x1bW4gPT0gbnVsbClcbiAgICAgICAgICAgIHN0YXJ0Q29sdW1uID0gMDtcbiAgICAgICAgaWYgKGVuZFJvdyA9PSBudWxsKVxuICAgICAgICAgICAgZW5kUm93ID0gZm9sZExpbmUuZW5kLnJvdztcbiAgICAgICAgaWYgKGVuZENvbHVtbiA9PSBudWxsKVxuICAgICAgICAgICAgZW5kQ29sdW1uID0gdGhpcy5nZXRMaW5lKGVuZFJvdykubGVuZ3RoO1xuICAgICAgICB2YXIgZG9jID0gdGhpcy5kb2M7XG4gICAgICAgIHZhciB0ZXh0TGluZSA9IFwiXCI7XG4gICAgICAgIGZvbGRMaW5lLndhbGsoZnVuY3Rpb24gKHBsYWNlaG9sZGVyLCByb3csIGNvbHVtbiwgbGFzdENvbHVtbikge1xuICAgICAgICAgICAgaWYgKHJvdyA8IHN0YXJ0Um93KVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIGlmIChyb3cgPT0gc3RhcnRSb3cpIHtcbiAgICAgICAgICAgICAgICBpZiAoY29sdW1uIDwgc3RhcnRDb2x1bW4pXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICBsYXN0Q29sdW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ICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJhbmdlLnN0YXJ0ID0gYnJhY2tldFBvcztcbiAgICAgICAgICAgICAgICAgICAgcmFuZ2Uuc3RhcnQuY29sdW1uKys7XG4gICAgICAgICAgICAgICAgICAgIHJhbmdlLmVuZC5jb2x1bW4tLTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChicmFja2V0UG9zID0gdGhpcy5maW5kTWF0Y2hpbmdCcmFja2V0KHsgcm93OiBjdXJzb3Iucm93LCBjb2x1bW46IGN1cnNvci5jb2x1bW4gKyAxIH0pKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJhbmdlLmNvbXBhcmVQb2ludChicmFja2V0UG9zKSA9PSAxKVxuICAgICAgICAgICAgICAgICAgICByYW5nZS5lbmQgPSBicmFja2V0UG9zO1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgcmFuZ2Uuc3RhcnQgPSBicmFja2V0UG9zO1xuICAgICAgICAgICAgICAgIHJhbmdlLnN0YXJ0LmNvbHVtbisrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcmFuZ2UgPSB0aGlzLmdldENvbW1lbnRGb2xkUmFuZ2UoY3Vyc29yLnJvdywgY3Vyc29yLmNvbHVtbikgfHwgcmFuZ2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB2YXIgZm9sZHMgPSB0aGlzLmdldEZvbGRzSW5SYW5nZShyYW5nZSk7XG4gICAgICAgICAgICBpZiAodHJ5VG9VbmZvbGQgJiYgZm9sZHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5leHBhbmRGb2xkcyhmb2xkcyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICA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cbiAgICAgICAgdmFyIHR5cGUgPSB0b2tlbiAmJiB0b2tlbi50eXBlO1xuICAgICAgICBpZiAodG9rZW4gJiYgL15jb21tZW50fHN0cmluZy8udGVzdCh0eXBlKSkge1xuICAgICAgICAgICAgdHlwZSA9IHR5cGUubWF0Y2goL2NvbW1lbnR8c3RyaW5nLylbMF07XG4gICAgICAgICAgICBpZiAodHlwZSA9PSBcImNvbW1lbnRcIilcbiAgICAgICAgICAgICAgICB0eXBlICs9IFwifGRvYy1zdGFydHxcXFxcLmRvY1wiO1xuICAgICAgICAgICAgdmFyIHJlID0gbmV3IFJlZ0V4cCh0eXBlKTtcbiAgICAgICAgICAgIHZhciByYW5nZSA9IG5ldyBSYW5nZSgpO1xuICAgICAgICAgICAgaWYgKGRpciAhPSAxKSB7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGl0ZXJhdG9yLnN0ZXBCYWNrd2FyZCgpO1xuICAgICAgICAgICAgICAgIH0gd2hpbGUgKHRva2VuICYmIHJlLnRlc3QodG9rZW4udHlwZSkgJiYgIS9eY29tbWVudC5lbmQvLnRlc3QodG9rZW4udHlwZSkpO1xuICAgICAgICAgICAgICAgIHRva2VuID0gaXRlcmF0b3Iuc3RlcEZvcndhcmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJhbmdlLnN0YXJ0LnJvdyA9IGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlblJvdygpO1xuICAgICAgICAgICAgcmFuZ2Uuc3RhcnQuY29sdW1uID0gaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuQ29sdW1uKCkgKyAoL15jb21tZW50LnN0YXJ0Ly50ZXN0KHRva2VuLnR5cGUpID8gdG9rZW4udmFsdWUubGVuZ3RoIDogMik7XG4gICAgICAgICAgICBpdGVyYXRvciA9IG5ldyBUb2tlbkl0ZXJhdG9yKHRoaXMsIHJvdywgY29sdW1uKTtcbiAgICAgICAgICAgIGlmIChkaXIgIT0gLTEpIHtcbiAgICAgICAgICAgICAgICB2YXIgbGFzdFJvdyA9IC0xO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgdG9rZW4gPSBpdGVyYXRvci5zdGVwRm9yd2FyZCgpO1xuICAgICAgICAgICAgICAgICAgICBpZiAobGFzdFJvdyA9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0YXRlID0gdGhpcy5nZXRTdGF0ZShpdGVyYXRvci4kcm93KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcmUudGVzdChzdGF0ZSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdFJvdyA9IGl0ZXJhdG9yLiRyb3c7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaXRlcmF0b3IuJHJvdyA+IGxhc3RSb3cpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAodG9rZW4gJiYgcmUudGVzdCh0b2tlbi50eXBlKSAmJiAhL15jb21tZW50LnN0YXJ0Ly50ZXN0KHRva2VuLnR5cGUpKTtcbiAgICAgICAgICAgICAgICB0b2tlbiA9IGl0ZXJhdG9yLnN0ZXBCYWNrd2FyZCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHRva2VuID0gaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuKCk7XG4gICAgICAgICAgICByYW5nZS5lbmQucm93ID0gaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuUm93KCk7XG4gICAgICAgICAgICByYW5nZS5lbmQuY29sdW1uID0gaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuQ29sdW1uKCk7XG4gICAgICAgICAgICBpZiAoIS9eY29tbWVudC5lbmQvLnRlc3QodG9rZW4udHlwZSkpIHtcbiAgICAgICAgICAgICAgICByYW5nZS5lbmQuY29sdW1uICs9IHRva2VuLnZhbHVlLmxlbmd0aCAtIDI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmFuZ2U7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIHRoaXMuZm9sZEFsbCA9IGZ1bmN0aW9uIChzdGFydFJvdywgZW5kUm93LCBkZXB0aCwgdGVzdCkge1xuICAgICAgICBpZiAoZGVwdGggPT0gdW5kZWZpbmVkKVxuICAgICAgICAgICAgZGVwdGggPSAxMDAwMDA7IC8vIEpTT04uc3RyaW5naWZ5IGRvZXNuJ3QgaGFubGUgSW5maW5pdHlcbiAgICAgICAgdmFyIGZvbGRXaWRnZXRzID0gdGhpcy5mb2xkV2lkZ2V0cztcbiAgICAgICAgaWYgKCFmb2xkV2lkZ2V0cylcbiAgICAgICAgICAgIHJldHVybjsgLy8gbW9kZSBkb2Vzbid0IHN1cHBvcnQgZm9sZGluZ1xuICAgICAgICBlbmRSb3cgPSBlbmRSb3cgfHwgdGhpcy5nZXRMZW5ndGgoKTtcbiAgICAgICAgc3RhcnRSb3cgPSBzdGFydFJvdyB8fCAwO1xuICAgICAgICBmb3IgKHZhciByb3cgPSBzdGFydFJvdzsgcm93IDwgZW5kUm93OyByb3crKykge1xuICAgICAgICAgICAgaWYgKGZvbGRXaWRnZXRzW3Jvd10gPT0gbnVsbClcbiAgICAgICAgICAgICAgICBmb2xkV2lkZ2V0c1tyb3ddID0gdGhpcy5nZXRGb2xkV2lkZ2V0KHJvdyk7XG4gICAgICAgICAgICBpZiAoZm9sZFdpZGdldHNbcm93XSAhPSBcInN0YXJ0XCIpXG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICBpZiAodGVzdCAmJiAhdGVzdChyb3cpKVxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgdmFyIHJhbmdlID0gdGhpcy5nZXRGb2xkV2lkZ2V0UmFuZ2Uocm93KTtcbiAgICAgICAgICAgIGlmIChyYW5nZSAmJiByYW5nZS5pc011bHRpTGluZSgpXG4gICAgICAgICAgICAgICAgJiYgcmFuZ2UuZW5kLnJvdyA8PSBlbmRSb3dcbiAgICAgICAgICAgICAgICAmJiByYW5nZS5zdGFydC5yb3cgPj0gc3RhcnRSb3cpIHtcbiAgICAgICAgICAgICAgICByb3cgPSByYW5nZS5lbmQucm93O1xuICAgICAgICAgICAgICAgIHJhbmdlLmNvbGxhcHNlQ2hpbGRyZW4gPSBkZXB0aDtcbiAgICAgICAgICAgICAgICB0aGlzLmFkZEZvbGQoXCIuLi5cIiwgcmFuZ2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICB0aGlzLmZvbGRUb0xldmVsID0gZnVuY3Rpb24gKGxldmVsKSB7XG4gICAgICAgIHRoaXMuZm9sZEFsbCgpO1xuICAgICAgICB3aGlsZSAobGV2ZWwtLSA+IDApXG4gICAgICAgICAgICB0aGlzLnVuZm9sZChudWxsLCBmYWxzZSk7XG4gICAgfTtcbiAgICB0aGlzLmZvbGRBbGxDb21tZW50cyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHNlc3Npb24gPSB0aGlzO1xuICAgICAgICB0aGlzLmZvbGRBbGwobnVsbCwgbnVsbCwgbnVsbCwgZnVuY3Rpb24gKHJvdykge1xuICAgICAgICAgICAgdmFyIHRva2VucyA9IHNlc3Npb24uZ2V0VG9rZW5zKHJvdyk7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRva2Vucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIHZhciB0b2tlbiA9IHRva2Vuc1tpXTtcbiAgICAgICAgICAgICAgICBpZiAodG9rZW4udHlwZSA9PSBcInRleHRcIiAmJiAvXlxccyskLy50ZXN0KHRva2VuLnZhbHVlKSlcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAg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gICAgICB0aGlzLm9uKCd0b2tlbml6ZXJVcGRhdGUnLCB0aGlzLiR0b2tlbml6ZXJVcGRhdGVGb2xkV2lkZ2V0cyk7XG4gICAgfTtcbiAgICB0aGlzLmdldFBhcmVudEZvbGRSYW5nZURhdGEgPSBmdW5jdGlvbiAocm93LCBpZ25vcmVDdXJyZW50KSB7XG4gICAgICAgIHZhciBmdyA9IHRoaXMuZm9sZFdpZGdldHM7XG4gICAgICAgIGlmICghZncgfHwgKGlnbm9yZUN1cnJlbnQgJiYgZndbcm93XSkpXG4gICAgICAgICAgICByZXR1cm4ge307XG4gICAgICAgIHZhciBpID0gcm93IC0gMSwgZmlyc3RSYW5nZTtcbiAgICAgICAgd2hpbGUgKGkgPj0gMCkge1xuICAgICAgICAgICAgdmFyIGMgPSBmd1tpXTtcbiAgICAgICAgICAgIGlmIChjID09IG51bGwpXG4gICAgICAgICAgICAgICAgYyA9IGZ3W2ldID0gdGhpcy5nZXRGb2xkV2lkZ2V0KGkpO1xuICAgICAgICAgICAgaWYgKGMgPT0gXCJzdGFydFwiKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJhbmdlID0gdGhpcy5nZXRGb2xkV2lkZ2V0UmFuZ2UoaSk7XG4gICAgICAgICAgICAgICAgaWYgKCFmaXJzdFJhbmdlKVxuICAgICAgICAgICAgICAgICAgICBmaXJzdFJhbmdlID0gcmFuZ2U7XG4gICAgICAgICAgICAgICAgaWYgKHJhbmdlICYmIHJhbmdlLmVuZC5yb3cgPj0gcm93KVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGktLTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgcmFuZ2U6IGkgIT09IC0xICYmIHJhbmdlLFxuICAgICAgICAgICAgZmlyc3RSYW5nZTogZmlyc3RSYW5nZVxuICAgICAgICB9O1xuICAgIH07XG4gICAgdGhpcy5vbkZvbGRXaWRnZXRDbGljayA9I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ICAgICAgICAgICBpZiAob3B0aW9ucy5jaGlsZHJlbiB8fCBvcHRpb25zLmFsbClcbiAgICAgICAgICAgICAgICB0aGlzLnJlbW92ZUZvbGQoZm9sZCk7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgdGhpcy5leHBhbmRGb2xkKGZvbGQpO1xuICAgICAgICAgICAgcmV0dXJuIGZvbGQ7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHJhbmdlID0gdGhpcy5nZXRGb2xkV2lkZ2V0UmFuZ2Uocm93LCB0cnVlKTtcbiAgICAgICAgaWYgKHJhbmdlICYmICFyYW5nZS5pc011bHRpTGluZSgpKSB7XG4gICAgICAgICAgICBmb2xkID0gdGhpcy5nZXRGb2xkQXQocmFuZ2Uuc3RhcnQucm93LCByYW5nZS5zdGFydC5jb2x1bW4sIDEpO1xuICAgICAgICAgICAgaWYgKGZvbGQgJiYgcmFuZ2UuaXNFcXVhbChmb2xkLnJhbmdlKSkge1xuICAgICAgICAgICAgICAgIHRoaXMucmVtb3ZlRm9sZChmb2xkKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZm9sZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAob3B0aW9ucy5zaWJsaW5ncykge1xuICAgICAgICAgICAgdmFyIGRhdGEgPSB0aGlzLmdldFBhcmVudEZvbGRSYW5nZURhdGEocm93KTtcbiAgICAgICAgICAgIGlmIChkYXRhLnJhbmdlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0YXJ0Um93ID0gZGF0YS5yYW5nZS5zdGFydC5yb3cgKyAxO1xuICAgICAgICAgICAgICAgIHZhciBlbmRSb3cgPSBkYXRhLnJhbmdlLmVuZC5yb3c7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLmZvbGRBbGwoc3RhcnRSb3csIGVuZFJvdywgb3B0aW9ucy5hbGwgPyAxMDAwMCA6IDApO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uga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BvcyA9IHRoaXMuJGZpbmRDbG9zaW5nQnJhY2tldChtYXRjaFsxXSwgcG9zKTtcbiAgICAgICAgICAgIGlmICghYnJhY2tldFBvcylcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIHJhbmdlID0gUmFuZ2UuZnJvbVBvaW50cyhwb3MsIGJyYWNrZXRQb3MpO1xuICAgICAgICAgICAgaWYgKCFiZWZvcmUpIHtcbiAgICAgICAgICAgICAgICByYW5nZS5lbmQuY29sdW1uKys7XG4gICAgICAgICAgICAgICAgcmFuZ2Uuc3RhcnQuY29sdW1uLS07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByYW5nZS5jdXJzb3IgPSByYW5nZS5lbmQ7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB2YXIgYnJhY2tldFBvcyA9IHRoaXMuJGZpbmRPcGVuaW5nQnJhY2tldChtYXRjaFsyXSwgcG9zKTtcbiAgICAgICAgICAgIGlmICghYnJhY2tldFBvcylcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIHJhbmdlID0gUmFuZ2UuZnJvbVBvaW50cyhicmFja2V0UG9zLCBwb3MpO1xuICAgICAgICAgICAgaWYgKCFiZWZvcmUpIHtcbiAgICAgICAgICAgICAgICByYW5nZS5zdGFydC5jb2x1bW4rKztcbiAgICAgICAgICAgICAgICByYW5nZS5lbmQuY29sdW1uLS07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByYW5nZS5jdXJzb3IgPSByYW5nZS5zdGFydDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmFuZ2U7XG4gICAgfTtcbiAgICB0aGlzLmdldE1hdGNoaW5nQnJhY2tldFJhbmdlcyA9IGZ1bmN0aW9uIChwb3MsIGlzQmFja3dhcmRzKSB7XG4gICAgICAgIHZhciBsaW5lID0gdGhpcy5nZXRMaW5lKHBvcy5yb3cpO1xuICAgICAgICB2YXIgY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BhcmVuXCIpXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXGIoPzplbmQpXFxiLywgXCIoPzpzdGFydHxiZWdpbnxlbmQpXCIpXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8tY2xvc2VcXGIvLCBcIi0oY2xvc2V8b3BlbilcIilcbiAgICAgICAgICAgICAgICArIFwiKStcIik7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHZhbHVlSW5kZXggPSBwb3NpdGlvbi5jb2x1bW4gLSBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Db2x1bW4oKSAtIDI7XG4gICAgICAgIHZhciB2YWx1ZSA9IHRva2VuLnZhbHVlO1xuICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgd2hpbGUgKHZhbHVlSW5kZXggPj0gMCkge1xuICAgICAgICAgICAgICAgIHZhciBjaHIgPSB2YWx1ZS5jaGFyQXQodmFsdWVJbmRleCk7XG4gICAgICAgICAgICAgICAgaWYgKGNociA9PSBvcGVuQnJhY2tldCkge1xuICAgICAgICAgICAgICAgICAgICBkZXB0aCAtPSAxO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZGVwdGggPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsgcm93OiBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Sb3coKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW46IHZhbHVlSW5kZXggKyBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Db2x1bW4oKSB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGNociA9PSBicmFja2V0KSB7XG4gICAgICAgICAgICAgICAgICAgIGRlcHRoICs9IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhbHVlSW5kZXggLT0gMTtcbiAgICAgICAgICAgIH1cbiAg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AgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvXFxiKD86c3RhcnR8YmVnaW4pXFxiLywgXCIoPzpzdGFydHxiZWdpbnxlbmQpXCIpXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8tb3BlblxcYi8sIFwiLShjbG9zZXxvcGVuKVwiKVxuICAgICAgICAgICAgICAgICsgXCIpK1wiKTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgdmFsdWVJbmRleCA9IHBvc2l0aW9uLmNvbHVtbiAtIGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlbkNvbHVtbigpO1xuICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgdmFyIHZhbHVlID0gdG9rZW4udmFsdWU7XG4gICAgICAgICAgICB2YXIgdmFsdWVMZW5ndGggPSB2YWx1ZS5sZW5ndGg7XG4gICAgICAgICAgICB3aGlsZSAodmFsdWVJbmRleCA8IHZhbHVlTGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGNociA9IHZhbHVlLmNoYXJBdCh2YWx1ZUluZGV4KTtcbiAgICAgICAgICAgICAgICBpZiAoY2hyID09IGNsb3NpbmdCcmFja2V0KSB7XG4gICAgICAgICAgICAgICAgICAgIGRlcHRoIC09IDE7XG4gICAgICAgICAgICAgICAgICAgIGlmIChkZXB0aCA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geyByb3c6IGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlblJvdygpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtbjogdmFsdWVJbmRleCArIGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlbkNvbHVtbigpIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoY2hyID09IGJyYWNrZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVwdGggKz0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFsdWVJbmRleCArPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgIHRva2VuID0gaXRlcmF0b3Iuc3RlcEZvcndhcmQoKTtcbiAgICAgICAgICAgIH0gd2hpbGUgKHRva2VuICYmICF0eXBlUmUudGVzdCh0b2tlbi50eXBlKSk7XG4gICAgICAgICAgICBpZiAodG9rZW4gPT0gbnVsbClcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIHZhbHVlSW5kZXggPSAwO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH07XG4gICAgdGhpcy5nZXRNYXRjaGluZ1RhZ3MgPSBmdW5jdGlvbiAocG9zKSB7XG4gICAgICAgIHZhciBpdGVyYXRvciA9IG5ldyBUb2tlbkl0ZXJhdG9yKHRoaXMsIHBvcy5yb3csIHBvcy5jb2x1bW4pO1xuICAgICAgICB2YXIgdG9rZW4gPSB0aGlzLiRmaW5kVGFnTmFtZShpdGVyYXRvcik7XG4gICAgICAgIGlmICghdG9rZW4pXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIHZhciBwcmV2VG9rZW4gPSBpdGVyYXRvci5zdGVwQmFja3dhcmQoKTtcbiAgICAgICAgaWYgKHByZXZUb2tlbi52YWx1ZSA9PT0gJzwnKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy4kZmluZENsb3NpbmdUYWcoaXRlcmF0b3IsIHRva2VuKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLiRmaW5kT3BlbmluZ1RhZyhpdGVyYXRvciwgdG9rZW4pO1xuICAgICAgICB9XG4gICAgfTtcbiAgICB0aGlzLiRmaW5kVGFnTmFtZSA9IGZ1bmN0aW9uIChpdGVyYXRvcikge1xuICAgICAgICB2YXIgdG9rZW4gPSBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW4oKTtcbiAgICAgICAgdmFyIGZvdW5kID0gZmFsc2U7XG4gICAgICAgIHZhciBiYWNrd2FyZCA9IGZhbHNlO1xuICAgICAgICBpZiAodG9rZW4gJiYgdG9rZW4udHlwZS5pbmRleE9mKCd0YWctbmFtZScpID09PSAtMSkge1xuICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgIGlmIChiYWNrd2FyZClcbiAgICAgICAgICAgICAgICAgICAgdG9rZW4gPSBpdGVyYXRvci5zdGVwQmFja3dhcmQoKTtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIHRva2VuID0gaXRlcmF0b3Iuc3RlcEZvcndhcmQoKTtcbiAgICAgICAgICAgICAgICBpZiAodG9rZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRva2VuLnZhbHVlID09PSBcIi8+XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2t3YXJkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh0b2tlbi50eXBlLmluZGV4T2YoJ3RhZy1uYW1lJykgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IHdoaWxlICh0b2tlbiAmJiAhZm91bmQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0b2tlbjtcbiAgICB9O1xuICAgIHRoaXMuJGZpbmRDbG9zaW5nVGFnID0gZnVuY3Rpb24gKGl0ZXJhdG9yLCB0b2tlbikge1xuICAgICAgICB2YXIgcHJldlRva2VuO1xuICAgICAgICB2YXIgY3VycmVudFRhZyA9IHRva2VuLnZhbHVlO1xuICAgICAgICB2YXIgdGFnID0gdG9rZW4udmFsdWU7XG4gICAgICAgIHZhciBkZXB0aCA9IDA7XG4gICAgICAgIHZhciB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gICAgICAgIHRva2VuID0gaXRlcmF0b3Iuc3RlcEZvcndhcmQoKTtcbiAgICAgICAgICAgIGlmICh0b2tlbikge1xuICAgICAgICAgICAgICAgIGlmICh0b2tlbi52YWx1ZSA9PT0gJz4nICYmICFmb3VuZE9wZW5UYWdFbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG9wZW5UYWdFbmQgPSBuZXcgUmFuZ2UoaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuUm93KCksIGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlbkNvbHVtbigpLCBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Sb3coKSwgaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuQ29sdW1uKCkgKyAxKTsgLy9SYW5nZSBmb3IgYD5gXG4gICAgICAgICAgICAgICAgICAgIGZvdW5kT3BlblRhZ0VuZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0b2tlbi50eXBlLmluZGV4T2YoJ3RhZy1uYW1lJykgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRUYWcgPSB0b2tlbi52YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRhZyA9PT0gY3VycmVudFRhZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZUb2tlbi52YWx1ZSA9PT0gJzwnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVwdGgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHByZXZUb2tlbi52YWx1ZSA9PT0gJzwvJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlcHRoLS07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRlcHRoIDwgMCkgeyAvL2ZvdW5kIGNsb3NpbmcgdGFnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZXJhdG9yLnN0ZXBCYWNrd2FyZCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2xvc2VUYWdTdGFydCA9IG5ldyBSYW5nZShpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Sb3coKSwgaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuQ29sdW1uKCksIGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlblJvdygpLCBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Db2x1bW4oKSArIDIpOyAvL1JhbmdlIGZvciA8L1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGl0ZXJhdG9yLnN0ZXBGb3J3YXJkKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjbG9zZVRhZ05hbWUgPSBuZXcgUmFuZ2UoaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuUm93KCksIGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlbkNvbHVtbigpLCBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Sb3coKSwgaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuQ29sdW1uKCkgKyB0b2tlbi52YWx1ZS5sZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4udHlwZS5pbmRleE9mKCd0YWctY2xvc2UnKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuID0gaXRlcmF0b3Iuc3RlcEZvcndhcmQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4gJiYgdG9rZW4udmFsdWUgPT09ICc+Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNsb3NlVGFnRW5kID0gbmV3IFJhbmdlKGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlblJvdygpLCBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Db2x1bW4oKSwgaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuUm93KCksIGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlbkNvbHVtbigpICsgMSk7IC8vUmFuZ2UgZm9yID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmICh0YWcgPT09IGN1cnJlbnRUYWcgJiYgdG9rZW4udmFsdWUgPT09ICcvPicpIHsgLy8gc2VsZi1jbG9zaW5nIHRhZ1xuICAgICAgICAgICAgICAgICAgICBkZXB0aC0tO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZGVwdGggPCAwKSB7IC8vZm91bmQgc2VsZi1jbG9zaW5nIHRhZyBlbmRcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjbG9zZVRhZ1N0YXJ0ID0gbmV3IFJhbmdlKGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlblJvdygpLCBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Db2x1bW4oKSwgaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuUm93KCksIGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlbkNvbHVtbigpICsgMik7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2xvc2VUYWdOYW1lID0gY2xvc2VUYWdTdGFydDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjbG9zZVRhZ0VuZCA9IGNsb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dXJyZW50VG9rZW5Sb3coKSwgaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuQ29sdW1uKCksIGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlblJvdygpLCBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Db2x1bW4oKSArIDEpOyAvL1JhbmdlIGZvciA+XG4gICAgICAgIGl0ZXJhdG9yLnN0ZXBCYWNrd2FyZCgpO1xuICAgICAgICBpdGVyYXRvci5zdGVwQmFja3dhcmQoKTtcbiAgICAgICAgZG8ge1xuICAgICAgICAgICAgdG9rZW4gPSBwcmV2VG9rZW47XG4gICAgICAgICAgICBzdGFydFJvdyA9IGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlblJvdygpO1xuICAgICAgICAgICAgc3RhcnRDb2x1bW4gPSBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Db2x1bW4oKTtcbiAgICAgICAgICAgIGVuZENvbHVtbiA9IHN0YXJ0Q29sdW1uICsgdG9rZW4udmFsdWUubGVuZ3RoO1xuICAgICAgICAgICAgcHJldlRva2VuID0gaXRlcmF0b3Iuc3RlcEJhY2t3YXJkKCk7XG4gICAgICAgICAgICBpZiAodG9rZW4pIHtcbiAgICAgICAgICAgICAgICBpZiAodG9rZW4udHlwZS5pbmRleE9mKCd0YWctbmFtZScpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGFnID09PSB0b2tlbi52YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZUb2tlbi52YWx1ZSA9PT0gJzwnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVwdGgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVwdGggPiAwKSB7IC8vZm91bmQgb3BlbmluZyB0YWdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9wZW5UYWdOYW1lID0gbmV3IFJhbmdlKHN0YXJ0Um93LCBzdGFydENvbHVtbiwgc3RhcnRSb3csIGVuZENvbHVtbik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvcGVuVGFnU3RhcnQgPSBuZXcgUmFuZ2UoaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuUm93KCksIGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlbkNvbHVtbigpLCBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Sb3coKSwgaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuQ29sdW1uKCkgKyAxKTsgLy9SYW5nZSBmb3IgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGl0ZXJhdG9yLnN0ZXBGb3J3YXJkKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKHRva2VuICYmIHRva2VuLnZhbHVlICE9PSAnPicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3BlblRhZ0VuZCA9IG5ldyBSYW5nZShpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Sb3coKSwgaXRlcmF0b3IuZ2V0Q3VycmVudFRva2VuQ29sdW1uKCksIGl0ZXJhdG9yLmdldEN1cnJlbnRUb2tlblJvdygpLCBpdGVyYXRvci5nZXRDdXJyZW50VG9rZW5Db2x1bW4oKSArIDEpOyAvL1JhbmdlIGZvciA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocHJldlRva2VuLnZhbHVlID09PSAnPC8nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVwdGgtLTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmICh0b2tlbi52YWx1ZSA9PT0gJy8+JykgeyAvLyBzZWxmLWNsb3NpbmcgdGFnXG4gICAgICAgICAgICAgICAgICAgIHZhciBzdGVwQ291bnQgPSAwO1xuICAgICAgICAgICAgICAgICAgICB2YXIgdG1wVG9rZW4gPSBwcmV2VG9rZW47XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICh0bXBUb2tlbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRtcFRva2VuLnR5cGUuaW5kZXhPZigndGFnLW5hbWUnKSAhPT0gLTEgJiYgdG1wVG9rZW4udmFsdWUgPT09IHRhZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlcHRoLS07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh0bXBUb2tlbi52YWx1ZSA9PT0gJzwnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0bXBUb2tlbiA9IGl0ZXJhdG9yLnN0ZXBCYWNrd2FyZCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RlcENvdW50Kys7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdGVwQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaXRlcmF0b3Iuc3RlcEZvcndhcmQoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSB3aGlsZSAocHJldlRva2VuICYmIGRlcHRoIDw9IDApO1xuICAgICAgICBpZiAob3BlblRhZ1N0YXJ0ICYmIG9wZW5UYWdFbmQgJiYgY2xvc2VUYWdTdGFydCAmJiBj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ICAgICAgaWYgKCFkb2NSb3cpIHtcbiAgICAgICAgICAgIHRoaXMuJGRvY1Jvd0NhY2hlID0gW107XG4gICAgICAgICAgICB0aGlzLiRzY3JlZW5Sb3dDYWNoZSA9IFtdO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHZhciBsID0gdGhpcy4kZG9jUm93Q2FjaGUubGVuZ3RoO1xuICAgICAgICB2YXIgaSA9IHRoaXMuJGdldFJvd0NhY2hlSW5kZXgodGhpcy4kZG9jUm93Q2FjaGUsIGRvY1JvdykgKyAxO1xuICAgICAgICBpZiAobCA+IGkpIHtcbiAgICAgICAgICAgIHRoaXMuJGRvY1Jvd0NhY2hlLnNwbGljZShpLCBsKTtcbiAgICAgICAgICAgIHRoaXMuJHNjcmVlblJvd0NhY2hlLnNwbGljZShpLCBsKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgRWRpdFNlc3Npb24ucHJvdG90eXBlLiRnZXRSb3dDYWNoZUluZGV4ID0gZnVuY3Rpb24gKGNhY2hlQXJyYXksIHZhbCkge1xuICAgICAgICB2YXIgbG93ID0gMDtcbiAgICAgICAgdmFyIGhpID0gY2FjaGVBcnJheS5sZW5ndGggLSAxO1xuICAgICAgICB3aGlsZSAobG93IDw9IGhpKSB7XG4gICAgICAgICAgICB2YXIgbWlkID0gKGxvdyArIGhpKSA+PiAxO1xuICAgICAgICAgICAgdmFyIGMgPSBjYWNoZUFycmF5W21pZF07XG4gICAgICAgICAgICBpZiAodmFsID4gYylcbiAgICAgICAgICAgICAgICBsb3cgPSBtaWQgKyAxO1xuICAgICAgICAgICAgZWxzZSBpZiAodmFsIDwgYylcbiAgICAgICAgICAgICAgICBoaSA9IG1pZCAtIDE7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgcmV0dXJuIG1pZDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbG93IC0gMTtcbiAgICB9O1xuICAgIEVkaXRTZXNzaW9uLnByb3Rv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IHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYmdUb2tlbml6ZXIuZ2V0U3RhdGUocm93KTtcbiAgICB9O1xuICAgIEVkaXRTZXNzaW9uLnByb3RvdHlwZS5nZXRUb2tlbnMgPSBmdW5jdGlvbiAocm93KSB7XG4gICAgICAgIHJldHVybiB0aGlzLmJnVG9rZW5pemVyLmdldFRva2Vucyhyb3cpO1xuICAgIH07XG4gICAgRWRpdFNlc3Npb24ucHJvdG90eXBlLmdldFRva2VuQXQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHtcbiAgICAgICAgdmFyIHRva2VucyA9IHRoaXMuYmdUb2tlbml6ZXIuZ2V0VG9rZW5zKHJvdyk7XG4gICAgICAgIHZhciB0b2tlbiwgYyA9IDA7XG4gICAgICAgIGlmIChjb2x1bW4gPT0gbnVsbCkge1xuICAgICAgICAgICAgdmFyIGkgPSB0b2tlbnMubGVuZ3RoIC0gMTtcbiAgICAgICAgICAgIGMgPSB0aGlzLmdldExpbmUocm93KS5sZW5ndGg7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRva2Vucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGMgKz0gdG9rZW5zW2ldLnZhbHVlLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZiAoYyA+PSBjb2x1bW4pXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRva2VuID0gdG9rZW5zW2ldO1xuICAgICAgICBpZiAoIXRva2VuKVxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIHRva2VuLmluZGV4ID0gaTtcbiAgICAgICAgdG9rZW4uc3RhcnQgPSBjIC0gdG9rZW4udmFsdWUubGVuZ3RoO1xuICAgICAgICByZXR1cm4gdG9rZW47XG4gICAgfTtcbiAgICBFZGl0U2Vzc2lvbi5wcm90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mVcIixcbiAgICAgICAgICAgIHJlbmRlcmVyOiB0eXBlb2YgdHlwZSA9PSBcImZ1bmN0aW9uXCIgPyB0eXBlIDogbnVsbCxcbiAgICAgICAgICAgIGNsYXp6OiBjbGF6eixcbiAgICAgICAgICAgIGluRnJvbnQ6ICEhaW5Gcm9udCxcbiAgICAgICAgICAgIGlkOiBpZFxuICAgICAgICB9O1xuICAgICAgICBpZiAoaW5Gcm9udCkge1xuICAgICAgICAgICAgdGhpcy4kZnJvbnRNYXJrZXJzW2lkXSA9IG1hcmtlcjtcbiAgICAgICAgICAgIHRoaXMuX3NpZ25hbChcImNoYW5nZUZyb250TWFya2VyXCIpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy4kYmFja01hcmtlcnNbaWRdID0gbWFya2VyO1xuICAgICAgICAgICAgdGhpcy5fc2lnbmFsKFwiY2hhbmdlQmFja01hcmtlclwiKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaWQ7XG4gICAgfTtcbiAgICBFZGl0U2Vzc2lvbi5wcm90b3R5cGUuYWRkRHluYW1pY01hcmtlciA9IGZ1bmN0aW9uIChtYXJrZXIsIGluRnJvbnQpIHtcbiAgICAgICAgaWYgKCFtYXJrZXIudXBkYXRlKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB2YXIgaWQgPSB0aGlzLiRtYXJrZXJJZCsrO1xuICAgICAgICBtYXJrZXIuaWQgPSBpZDtcbiAgICAgICAgbWFya2VyLmluRnJvbnQgPSAhIWluRnJvbnQ7XG4gICAgICAgIGlmIChpbkZyb250KSB7XG4gICAgICAgICAgICB0aGlzLiRmcm9udE1hcmtlcnNbaWRdID0gbWFya2VyO1xuICAgICAgICAgICAgdGhpcy5fc2lnbmFsKFwiY2hhbmdlRnJvbnRNYXJrZXJcIik7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aGlzLiRiYWNrTWFya2Vyc1tpZF0g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XTtcbiAgICB9O1xuICAgIEVkaXRTZXNzaW9uLnByb3RvdHlwZS5jbGVhckFubm90YXRpb25zID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLnNldEFubm90YXRpb25zKFtdKTtcbiAgICB9O1xuICAgIEVkaXRTZXNzaW9uLnByb3RvdHlwZS4kZGV0ZWN0TmV3TGluZSA9IGZ1bmN0aW9uICh0ZXh0KSB7XG4gICAgICAgIHZhciBtYXRjaCA9IHRleHQubWF0Y2goL14uKj8oXFxyP1xcbikvbSk7XG4gICAgICAgIGlmIChtYXRjaCkge1xuICAgICAgICAgICAgdGhpcy4kYXV0b05ld0xpbmUgPSBtYXRjaFsxXTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuJGF1dG9OZXdMaW5lID0gXCJcXG5cIjtcbiAgICAgICAgfVxuICAgIH07XG4gICAgRWRpdFNlc3Npb24ucHJvdG90eXBlLmdldFdvcmRSYW5nZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikge1xuICAgICAgICB2YXIgbGluZSA9IHRoaXMuZ2V0TGluZShyb3cpO1xuICAgICAgICB2YXIgaW5Ub2tlbiA9IGZhbHNlO1xuICAgICAgICBpZiAoY29sdW1uID4gMClcbiAgICAgICAgICAgIGluVG9rZW4gPSAhIWxpbmUuY2hhckF0KGNvbHVtbiAtIDEpLm1hdGNoKHRoaXMudG9rZW5SZSk7XG4gICAgICAgIGlmICghaW5Ub2tlbilcbiAgICAgICAgICAgIGluVG9rZW4gPSAhIWxpbmUuY2hhckF0KGNvbHVtbikubWF0Y2godGhpcy50b2tlblJlKTtcbiAgICAgICAgaWYgKGluVG9rZW4pXG4gICAgICAgICAgICB2YXIgcmUgPSB0aGlzLnRva2VuUmU7XG4gICAgICAgIGVsc2UgaWYgKC9eXFxzKyQvLnRlc3QobGluZS5zbGljZShjb2x1bW4gLSAxLCBjb2x1bW4gKyAxKSkpXG4gICAgICAgICAgICB2YXIgcmUgP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gICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHBhdGggPSAvKipAdHlwZXtzdHJpbmd9Ki8gKG1vZGUpIHx8IFwiYWNlL21vZGUvdGV4dFwiO1xuICAgICAgICB9XG4gICAgICAgIGlmICghdGhpcy4kbW9kZXNbXCJhY2UvbW9kZS90ZXh0XCJdKVxuICAgICAgICAgICAgdGhpcy4kbW9kZXNbXCJhY2UvbW9kZS90ZXh0XCJdID0gbmV3IFRleHRNb2RlKCk7XG4gICAgICAgIGlmICh0aGlzLiRtb2Rlc1twYXRoXSAmJiAhb3B0aW9ucykge1xuICAgICAgICAgICAgdGhpcy4kb25DaGFuZ2VNb2RlKHRoaXMuJG1vZGVzW3BhdGhdKTtcbiAgICAgICAgICAgIGNiICYmIGNiKCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy4kbW9kZUlkID0gcGF0aDtcbiAgICAgICAgY29uZmlnLmxvYWRNb2R1bGUoW1wibW9kZVwiLCBwYXRoXSwgZnVuY3Rpb24gKG0pIHtcbiAgICAgICAgICAgIGlmICh0aGlzLiRtb2RlSWQgIT09IHBhdGgpXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNiICYmIGNiKCk7XG4gICAgICAgICAgICBpZiAodGhpcy4kbW9kZXNbcGF0aF0gJiYgIW9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiRvbkNoYW5nZU1vZGUodGhpcy4kbW9kZXNbcGF0aF0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAobSAmJiBtLk1vZGUpIHtcbiAgICAgICAgICAgICAgICBtID0gbmV3IG0uTW9kZShvcHRpb25zKTtcbiAgICAgICAgICAgICAgICBpZiAoIW9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy4kbW9kZXNbcGF0aF0gPSBtO1xuICAgICAgICAgICAgICAgICAgICBtLiRpZCA9IHBhdGg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuJG9uQ2hhbmdlTW9kZShtKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNiICYmIGNiKCk7XG4gICAgICAgIH0uYmluZCh0aGlzKSk7XG4gICAgICAgIGlmICghdGhpcy4kbW9kZSlcbiAgICAgICAgICAgIHRoaXMuJG9uQ2hhbmdlTW9kZSh0aGlzLiRtb2Rlc1tcImFjZS9tb2RlL3RleHRcIl0sIHRydWUpO1xuICAgIH07XG4gICAgRWRpdFNlc3Npb24ucHJvdG90eXBlLiRvbkNoYW5nZU1vZGUgPSBmdW5jdGlvbiAobW9kZSwgJGlzUGxhY2Vob2xkZXIpIHtcbiAgICAgICAgaWYgKCEkaXNQbGFjZWhvbGRlcilcbiAgICAgICAgICAgIHRoaXMuJG1vZGVJZCA9IG1vZGUuJGlkO1xuICAgICAgICBpZiAodGhpcy4kbW9kZSA9PT0gbW9kZSlcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgdmFyIG9sZE1vZGUgPSB0aGlzLiRtb2RlO1xuICAgICAgICB0aGlzLiRtb2RlID0gbW9kZTtcbiAgICAgICAgdGhpcy4kc3RvcFdvcmtlcigpO1xuICAgICAgICBpZiAodGhpcy4kdXNlV29ya2VyKVxuICAgICAgICAgICAgdGhpcy4kc3RhcnRXb3JrZXIoKTtcbiAgICAgICAgdmFyIHRva2VuaXplciA9IG1vZGUuZ2V0VG9rZW5pemVyKCk7XG4gICAgICAgIGlmICh0b2tlbml6ZXIub24gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgdmFyIG9uUmVsb2FkVG9rZW5pemVyID0gdGhpcy5vblJlbG9hZFRva2VuaXplci5iaW5kKHRoaXMpO1xuICAgICAgICAgICAgdG9rZW5pemVyLm9uKFwidXBkYXRlXCIsIG9uUmVsb2FkVG9rZW5pemVyKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmJnVG9rZW5pemVyLnNldFRva2VuaXplcih0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RoaXMuJG1vZGlmaWVkID0gZmFsc2U7XG4gICAgICAgICAgICBpZiAodGhpcy4kdXNlV3JhcE1vZGUpXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc2NyZWVuV2lkdGggPSB0aGlzLiR3cmFwTGltaXQ7XG4gICAgICAgICAgICB2YXIgbGluZXMgPSB0aGlzLmRvYy5nZXRBbGxMaW5lcygpO1xuICAgICAgICAgICAgdmFyIGNhY2hlID0gdGhpcy4kcm93TGVuZ3RoQ2FjaGU7XG4gICAgICAgICAgICB2YXIgbG9uZ2VzdFNjcmVlbkxpbmUgPSAwO1xuICAgICAgICAgICAgdmFyIGZvbGRJbmRleCA9IDA7XG4gICAgICAgICAgICB2YXIgZm9sZExpbmUgPSB0aGlzLiRmb2xkRGF0YVtmb2xkSW5kZXhdO1xuICAgICAgICAgICAgdmFyIGZvbGRTdGFydCA9IGZvbGRMaW5lID8gZm9sZExpbmUuc3RhcnQucm93IDogSW5maW5pdHk7XG4gICAgICAgICAgICB2YXIgbGVuID0gbGluZXMubGVuZ3RoO1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChpID4gZm9sZFN0YXJ0KSB7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBmb2xkTGluZS5lbmQucm93ICsgMTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPj0gbGVuKVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGZvbGRMaW5lID0gdGhpcy4kZm9sZERhdGFbZm9sZEluZGV4KytdO1xuICAgICAgICAgICAgICAgICAgICBmb2xkU3RhcnQgPSBmb2xkTGluZSA/IGZvbGRMaW5lLnN0YXJ0LnJvdyA6IEluZmluaXR5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoY2FjaGVbaV0gPT0gbnVsbClcbiAgICAgICAgICAgICAgICAgICA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x0YS5zdGFydCwgZGVsdGEuc3RhcnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc0luc2VydChkZWx0YSkpIHtcbiAgICAgICAgICAgICAgICBwb2ludCA9IGRlbHRhLnN0YXJ0O1xuICAgICAgICAgICAgICAgIGlmIChyYW5nZS5jb21wYXJlKHBvaW50LnJvdywgcG9pbnQuY29sdW1uKSA9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByYW5nZS5zZXRTdGFydChwb2ludCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHBvaW50ID0gZGVsdGEuZW5kO1xuICAgICAgICAgICAgICAgIGlmIChyYW5nZS5jb21wYXJlKHBvaW50LnJvdywgcG9pbnQuY29sdW1uKSA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJhbmdlLnNldEVuZChwb2ludCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcG9pbnQgPSBkZWx0YS5zdGFydDtcbiAgICAgICAgICAgICAgICBpZiAocmFuZ2UuY29tcGFyZShwb2ludC5yb3csIHBvaW50LmNvbHVtbikgPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmFuZ2UgPSBSYW5nZS5mcm9tUG9pbnRzKGRlbHRhLnN0YXJ0LCBkZWx0YS5zdGFydCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByYW5nZTtcbiAgICB9O1xuICAgIEVkaXRTZXNzaW9uLnByb3RvdHlwZS5yZXBsYWNlID0gZnVuY3Rpb24gKHJhbmdlLCB0ZXh0KSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRvYy5yZXBsYWNlKHJhbmdlLCB0ZXh0KTtcbiAgICB9O1xuICAgIEVkaX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AgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocm93RGlmZiAmJiB0b1JhbmdlLnN0YXJ0LnJvdyA+PSBmcm9tUmFuZ2UuZW5kLnJvdykge1xuICAgICAgICAgICAgICAgIHRvUmFuZ2Uuc3RhcnQucm93ICs9IHJvd0RpZmY7XG4gICAgICAgICAgICAgICAgdG9SYW5nZS5lbmQucm93ICs9IHJvd0RpZmY7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdG9SYW5nZS5lbmQgPSB0aGlzLmluc2VydCh0b1JhbmdlLnN0YXJ0LCB0ZXh0KTtcbiAgICAgICAgaWYgKGZvbGRzLmxlbmd0aCkge1xuICAgICAgICAgICAgdmFyIG9sZFN0YXJ0ID0gZnJvbVJhbmdlLnN0YXJ0O1xuICAgICAgICAgICAgdmFyIG5ld1N0YXJ0ID0gdG9SYW5nZS5zdGFydDtcbiAgICAgICAgICAgIHZhciByb3dEaWZmID0gbmV3U3RhcnQucm93IC0gb2xkU3RhcnQucm93O1xuICAgICAgICAgICAgdmFyIGNvbGxEaWZmID0gbmV3U3RhcnQuY29sdW1uIC0gb2xkU3RhcnQuY29sdW1uO1xuICAgICAgICAgICAgdGhpcy5hZGRGb2xkcyhmb2xkcy5tYXAoZnVuY3Rpb24gKHgpIHtcbiAgICAgICAgICAgICAgICB4ID0geC5jbG9uZSgpO1xuICAgICAgICAgICAgICAgIGlmICh4LnN0YXJ0LnJvdyA9PSBvbGRTdGFydC5yb3cpXG4gICAgICAgICAgICAgICAgICAgIHguc3RhcnQuY29sdW1uICs9IGNvbGxEaWZmO1xuICAgICAgICAgICAgICAgIGlmICh4LmVuZC5yb3cgPT0gb2xkU3RhcnQucm93KVxuICAgICAgICAgICAgICAgICAgICB4LmVuZC5jb2x1bW4gKz0gY29sbERpZmY7XG4gICAgICAgICAgICAgICAgeC5zdGFydC5yb3cgKz0gcm93RGlmZjtcbiAgICAgICAgICAgICAgICB4LmVuZC5yb3cgKz0gcm93RGlmZjtc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gPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHtcbiAgICAgICAgY29sdW1uID0gTWF0aC5tYXgoMCwgY29sdW1uKTtcbiAgICAgICAgaWYgKHJvdyA8IDApIHtcbiAgICAgICAgICAgIHJvdyA9IDA7XG4gICAgICAgICAgICBjb2x1bW4gPSAwO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdmFyIGxlbiA9IHRoaXMuZG9jLmdldExlbmd0aCgpO1xuICAgICAgICAgICAgaWYgKHJvdyA+PSBsZW4pIHtcbiAgICAgICAgICAgICAgICByb3cgPSBsZW4gLSAxO1xuICAgICAgICAgICAgICAgIGNvbHVtbiA9IHRoaXMuZG9jLmdldExpbmUobGVuIC0gMSkubGVuZ3RoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgY29sdW1uID0gTWF0aC5taW4odGhpcy5kb2MuZ2V0TGluZShyb3cpLmxlbmd0aCwgY29sdW1uKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgcm93OiByb3csXG4gICAgICAgICAgICBjb2x1bW46IGNvbHVtblxuICAgICAgICB9O1xuICAgIH07XG4gICAgRWRpdFNlc3Npb24ucHJvdG90eXBlLiRjbGlwUmFuZ2VUb0RvY3VtZW50ID0gZnVuY3Rpb24gKHJhbmdlKSB7XG4gICAgICAgIGlmIChyYW5nZS5zdGFydC5yb3cgPCAwKSB7XG4gICAgICAgICAgICByYW5nZS5zdGFydC5yb3cgPSAwO1xuICAgICAgICAgICAgcmFuZ2Uuc3RhcnQuY29sdW1uID0gMDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJhbmdlLnN0YXJ0LmNvbHVtbiA9IHRoaXMuJGNsaXBDb2x1bW5Ub1JvdyhyYW5nZS5zdGFydC5yb3csIHJhbmdlLnN0YXJ0LmNvbHVtbik7XG4g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gICAgICAgICByZW1vdmVkRm9sZHMgPSB0aGlzLmdldEZvbGRzSW5SYW5nZShkZWx0YSk7XG4gICAgICAgICAgICAgICAgdGhpcy5yZW1vdmVGb2xkcyhyZW1vdmVkRm9sZHMpO1xuICAgICAgICAgICAgICAgIHZhciBmb2xkTGluZSA9IHRoaXMuZ2V0Rm9sZExpbmUoZW5kLnJvdyk7XG4gICAgICAgICAgICAgICAgdmFyIGlkeCA9IDA7XG4gICAgICAgICAgICAgICAgaWYgKGZvbGRMaW5lKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvbGRMaW5lLmFkZFJlbW92ZUNoYXJzKGVuZC5yb3csIGVuZC5jb2x1bW4sIHN0YXJ0LmNvbHVtbiAtIGVuZC5jb2x1bW4pO1xuICAgICAgICAgICAgICAgICAgICBmb2xkTGluZS5zaGlmdFJvdygtbGVuKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZvbGRMaW5lQmVmb3JlID0gdGhpcy5nZXRGb2xkTGluZShmaXJzdFJvdyk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChmb2xkTGluZUJlZm9yZSAmJiBmb2xkTGluZUJlZm9yZSAhPT0gZm9sZExpbmUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvbGRMaW5lQmVmb3JlLm1lcmdlKGZvbGRMaW5lKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvbGRMaW5lID0gZm9sZExpbmVCZWZvcmU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWR4ID0gZm9sZExpbmVzLmluZGV4T2YoZm9sZExpbmUpICsgMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZm9yIChpZHg7IGlkeCA8IGZvbGRMaW5lcy5sZW5ndGg7IGlkeCsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBmb2xkTGluZSA9IGZvbGRMaW5lc1tpZHhdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZm9sZExpbmUuc3RhcnQucm93ID49IGVuZC5yb3cpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvbGRMaW5lLnNoaWZ0Um93KC1sZW4pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGxhc3RSb3cgPSBmaXJzdFJvdztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBhcmdzID0gQXJyYXkobGVuKTtcbiAgICAgICAgICAgICAgICBhcmdzLnVuc2hpZnQoZmlyc3RSb3csIDApO1xuICAgICAgICAgICAgICAgIHZhciBhcnIgPSB1c2VXcmFwTW9kZSA/IHRoaXMuJHdyYXBEYXRhIDogdGhpcy4kcm93TGVuZ3RoQ2FjaGU7XG4gICAgICAgICAgICAgICAgYXJyLnNwbGljZS5hcHBseShhcnIsIGFyZ3MpO1xuICAgICAgICAgICAgICAgIHZhciBmb2xkTGluZXMgPSB0aGlzLiRmb2xkRGF0YTtcbiAgICAgICAgICAgICAgICB2YXIgZm9sZExpbmUgPSB0aGlzLmdldEZvbGRMaW5lKGZpcnN0Um93KTtcbiAgICAgICAgICAgICAgICB2YXIgaWR4ID0gMDtcbiAgICAgICAgICAgICAgICBpZiAoZm9sZExpbmUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNtcCA9IGZvbGRMaW5lLnJhbmdlLmNvbXBhcmVJbnNpZGUoc3RhcnQucm93LCBzdGFydC5jb2x1bW4pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY21wID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvbGRMaW5lID0gZm9sZExpbmUuc3BsaXQoc3RhcnQucm93LCBzdGFydC5jb2x1bW4pO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZvbGRMaW5lKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9sZExpbmUuc2hpZnRSb3cobGVuKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2xkTGluZS5hZGRSZW1vdmVDaGFycyhsYXN0Um93LCAwLCBlbmQuY29sdW1uIC0gc3RhcnQuY29sdW1uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIFxuICAgICAgICAgICAgICAgICAgICBpZiAoY21wID09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb2xkTGluZS5hZGRSZW1vdmVDaGFycyhmaXJzdFJvdywgMCwgZW5kLmNvbHVtbiAtIHN0YXJ0LmNvbHVtbik7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb2xkTGluZS5zaGlmdFJvdyhsZW4pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlkeCA9IGZvbGRMaW5lcy5pbmRleE9mKGZvbGRMaW5lKSArIDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZvciAoaWR4OyBpZHggPCBmb2xkTGluZXMubGVuZ3RoOyBpZHgrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZm9sZExpbmUgPSBmb2xkTGluZXNbaWR4XTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZvbGRMaW5lLnN0YXJ0LnJvdyA+PSBmaXJzdFJvdykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9sZExpbmUuc2hpZnRSb3cobGVuKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGxlbiA9IE1hdGguYWJzKGRlbHRhLnN0YXJ0LmNvbHVtbiAtIGRlbHRhLmVuZC5jb2x1bW4pO1xuICAgICAgICAgICAgaWYgKGFjdGlvbiA9PT0gXCJyZW1vdmVcIikge1xuICAgICAgICAgICAgICAgIHJlbW92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aW9uIChwbGFjZWhvbGRlciwgcm93LCBjb2x1bW4sIGxhc3RDb2x1bW4pIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHdhbGtUb2tlbnM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwbGFjZWhvbGRlciAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3YWxrVG9rZW5zID0gdGhpcy4kZ2V0RGlzcGxheVRva2VucyhwbGFjZWhvbGRlciwgdG9rZW5zLmxlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB3YWxrVG9rZW5zWzBdID0gUExBQ0VIT0xERVJfU1RBUlQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IHdhbGtUb2tlbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3YWxrVG9rZW5zW2ldID0gUExBQ0VIT0xERVJfQk9EWTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdhbGtUb2tlbnMgPSB0aGlzLiRnZXREaXNwbGF5VG9rZW5zKGxpbmVzW3Jvd10uc3Vic3RyaW5nKGxhc3RDb2x1bW4sIGNvbHVtbiksIHRva2Vucy5sZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRva2VucyA9IHRva2Vucy5jb25jYXQod2Fsa1Rva2Vucyk7XG4gICAgICAgICAgICAgICAgfS5iaW5kKHRoaXMpLCBmb2xkTGluZS5lbmQucm93LCBsaW5lc1tmb2xkTGluZS5lbmQucm93XS5sZW5ndGggKyAxKTtcbiAgICAgICAgICAgICAgICB3cmFwRGF0YVtmb2xkTGluZS5zdGFydC5yb3ddID0gdGhpcy4kY29tcHV0ZVdyYXBTcGxpdHModG9rZW5zLCB3cmFwTGltaXQsIHRhYlNpemUpO1xuICAgICAgICAgICAgICAgIHJvdyA9IGZvbGRMaW5lLmVuZC5yb3cgKyAxO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICBFZGl0U2Vzc2lvbi5wcm90b3R5cGUuJGNvbXB1dGVXcmFwU3BsaXRzID0gZnVuY3Rpb24gKHRva2Vucywgd3JhcExpbWl0LCB0YWJTaXplKSB7XG4gICAgICAgIGlmICh0b2tlbnMubGVuZ3RoID09IDApIHtcbiAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgc3BsaXRzID0gW107XG4gICAgICAgIHZhciBkaXNwbGF5TGVuZ3RoID0gdG9rZW5zLmxlbmd0aDtcbiAgICAgICAgdmFyIGxhc3RTcGxpdCA9IDAsIGxhc3REb2NTcGxpdCA9IDA7XG4gICAgICAgIHZhciBpc0NvZGUgPSB0aGlzLiR3cmFwQXNDb2RlO1xuICAgICAgICB2YXIgaW5kZW50ZWRTb2Z0V3JhcCA9IHRoaXMuJGluZGVudGVkU29mdFdyYXA7XG4gICAgICAgIHZhciBtYXhJbmRlbnQgPSB3cmFwTGltaXQgPD0gTWF0aC5tYXgoMiAqIHRhYlNpemUsIDgpXG4gICAgICAgICAgICB8fCBpbmRlbnRlZFNvZnRXcmFwID09PSBmYWxzZSA/IDAgOiBNYXRoLmZsb29yKHdyYXBMaW1pdCAvIDIpO1xuICAgICAgICBmdW5jdGlvbiBnZXRXcmFwSW5kZW50KCkge1xuICAgICAgICAgICAgdmFyIGluZGVudGF0aW9uID0gMDtcbiAgICAgICAgICAgIGlmIChtYXhJbmRlbnQgPT09IDApXG4gICAgICAgICAgICAgICAgcmV0dXJuIGluZGVudGF0aW9uO1xuICAgICAgICAgICAgaWYgKGluZGVudGVkU29mdFdyYXApIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRva2Vucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdG9rZW4gPSB0b2tlbnNbaV07XG4gICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbiA9PSBTUEFDRSlcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZGVudGF0aW9uICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRva2VuID09IFRBQilcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZGVudGF0aW9uICs9IHRhYlNpemU7XG4gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRva2VuID09IFRBQl9TUEFDRSlcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNDb2RlICYmIGluZGVudGVkU29mdFdyYXAgIT09IGZhbHNlKVxuICAgICAgICAgICAgICAgIGluZGVudGF0aW9uICs9IHRhYlNpemU7XG4gICAgICAgICAgICByZXR1cm4gTWF0aC5taW4oaW5kZW50YXRpb24sIG1heEluZGVudCk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gYWRkU3BsaXQoc2NyZWVuUG9zKSB7XG4gICAgICAgICAgICB2YXIgbGVuID0gc2NyZWVuUG9zIC0gbGFzdFNwbGl0O1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IGxhc3RTcGxpdDsgaSA8IHNjcmVlblBvczsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIGNoID0gdG9rZW5zW2ldO1xuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gMTIgfHwgY2ggPT09IDIpXG4gICAgICAgICAgICAgICAgICAgIGxlbiAtPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFzcGxpdHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgaW5kZW50ID0gZ2V0V3JhcEluZGVudCgpO1xuICAgICAgICAgICAgICAgIHNwbGl0cy5pbmRlbnQgPSBpbmRlbnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsYXN0RG9jU3BsaXQgKz0gbGVuO1xuICAgICAgICAgICAgc3BsaXRzLnB1c2gobGFzdERvY1NwbGl0KTtcbiAgICAgICAgICAgIGxhc3RTcGxpdCA9IHNjcmVlblBvcztcbiAgICAgICAgfVxuICAgICAgICB2YXIgaW5kZW50ID0gMDtcbiAgICAgICAgd2hpbGUgKGRpc3BsYXlMZW5ndGggLSBsYXN0U3BsaXQgPiB3cmFwTGltaXQgLSBpbmRlbnQpIHtcbiAgICAgICAgICAgIHZhciBzcGxpdCA9IGxhc3RTcGxpdCArIHdyYXBMaW1pdCAtIGluZGVudDtcbiAgICAgICAgICAgIGlmICh0b2tlbnNbc3BsaXQgLSAxXSA+PSBTUEFDRSAmJiB0b2tlbnNbc3BsaXRdID49IFNQQUNFKSB7XG4gICAgICAgICAgICAgICAgYWRkU3BsaXQoc3BsaXQpO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRva2Vuc1tzcGxpdF0gPT0gUExBQ0VIT0xERVJfU1RBUlQgfHwgdG9rZW5zW3NwbGl0XSA9PSBQTEFDRUhPTERFUl9CT0RZKSB7XG4gICAgICAgICAgICAgICAgZm9yIChzcGxpdDsgc3BsaXQgIT0gbGFzdFNwbGl0IC0gMTsgc3BsaXQtLSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW5zW3NwbGl0XSA9PSBQTEFDRUhPTERFUl9TVEFSVCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHNwbGl0ID4gbGFzdFNwbGl0KSB7XG4gICAgICAgICAgICAgICAgICAgIGFkZFNwbGl0KHNwbGl0KTtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHNwbGl0ID0gbGFzdFNwbGl0ICsgd3JhcExpbWl0O1xuICAgICAgICAgICAgICAgIGZvciAoc3BsaXQ7IHNwbGl0IDwgdG9rZW5zLmxlbmd0aDsgc3BsaXQrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW5zW3NwbGl0XSAhPSBQTEFDRUhPTERFUl9CT0RZKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc3BsaXQgPT0gdG9rZW5zLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBicmVhazsgLy8gQnJlYWtzIHRoZSB3aGlsZS1sb29wLlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBhZGRTcGxpdChzcGxpdCk7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgbWluU3BsaXQgPSBNYXRoLm1heChzcGxpdCAtICh3cmFwTGltaXQgLSAod3JhcExpbWl0ID4+IDIpKSwgbGFzdFNwbGl0IC0gMSk7XG4gICAgICAgICAgICB3aGlsZSAoc3BsaXQgPiBtaW5TcGxpdCAmJiB0b2tlbnNbc3BsaXRdIDwgUExBQ0VIT0xERVJfU1RBUlQpIHtcbiAgICAgICAgICAgICAgICBzcGxpdC0tO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzQ29kZSkge1xuICAgICAgICAgICAgICAgIHdoaWxlIChzcGxpdCA+IG1pblNwbGl0ICYmIHRva2Vuc1tzcGxpdF0gPCBQTEFDRUhPTERFUl9TVEFSVCkge1xuICAgICAgICAgICAgICAgICAgICBzcGxpdC0tO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB3aGlsZSAoc3BsaXQgPiBtaW5TcGxpdCAmJiB0b2tlbnNbc3BsaXRdID09IFBVTkNUVUFUSU9OKSB7XG4gICAgICAgICAgICAgICAgICAgIHNwbGl0LS07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgd2hpbGUgKHNwbGl0ID4gbWluU3BsaXQgJiYgdG9rZW5zW3NwbGl0XSA8IFNQQUNFKSB7XG4gICAgICAgICAgICAgICAgICAgIHNwbGl0LS07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHNwbGl0ID4gbWluU3BsaXQpIHtcbiAgICAgICAgICAgICAgICBhZGRTcGxpdCgrK3NwbGl0KTtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNwbGl0ID0gbGFzdFNwbGl0ICsgd3JhcExpbWl0O1xuICAgICAgICAgICAgaWYgKHRva2Vuc1tzcGxpdF0gPT0gQ0hBUl9FWFQpXG4gICAgICAgICAgICAgICAgc3BsaXQtLTtcbiAgICAgICAgICAgIGFkZFNwbGl0KHNwbGl0IC0gaW5kZW50KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3BsaXRzO1xuICAgIH07XG4gICAgRWRpdFNlc3Npb24ucHJvdG90eXBlLiRnZXREaXNwbGF5VG9rZW5zID0gZnVuY3Rpb24gKHN0ciwgb2Zmc2V0KSB7XG4gICAgICAgIHZhciBhcnIgPSBbXTtcbiAgICAgICAgdmFyIHRhYlNpemU7XG4gICAgICAgIG9mZnNldCA9IG9mZnNldCB8fCAwO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0ci5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGMgPSBzdHIuY2hhckNvZGVBdChpKTtcbiAgICAgICAgICAgIGlmIChjID09IDkpIHtcbiAgICAgICAgICAgICAgICB0YWJTaXplID0gdGhpcy5nZXRTY3JlZW5UYWJTaXplKGFyci5sZW5ndGggKyBvZmZzZXQpO1xuICAgICAgICAgICAgICAgIGFyci5wdXNoKFRBQik7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgbiA9IDE7IG4gPCB0YWJTaXplOyBuKyspIHtcbiAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2goVEFCX1NQQUNFKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChjID09IDMyKSB7XG4gICAgICAgICAgICAgICAgYXJyLnB1c2goU1BBQ0UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoKGMgPiAzOSAmJiBjIDwgNDgpIHx8IChjID4gNTcgJiYgYyA8IDY0KSkge1xuICAgICAgICAgICAgICAgIGFyci5wdXNoKFBVTkNUVUFUSU9OKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGMgPj0gMHgxMTAwICYmIGlzRnVsbFdpZHRoKGMpKSB7XG4gICAgICAgICAgICAgICAgYXJyLnB1c2goQ0hBUiwgQ0hBUl9FWFQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgYXJyLnB1c2goQ0hBUik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGFycjtcbiAgICB9O1xuICAgIEVkaXRTZXNzaW9uLnByb3RvdHlwZS4kZ2V0U3RyaW5nU2NyZWVuV2lkdGggPSBmdW5jdGlvbiAoc3RyLCBtYXhTY3JlZW5Db2x1bW4sIHNjcmVlbkNvbHVtbikge1xuICAgICAgICBpZiAobWF4U2NyZWVuQ29sdW1uID09IDApXG4gICAgICAgICAgICByZXR1cm4gWzAsIDBdO1xuICAgICAgICBpZiAobWF4U2NyZWVuQ29sdW1uID09IG51bGwpXG4gICAgICAgICAgICBtYXhTY3JlZW5Db2x1bW4gPSBJbmZpbml0eTtcbiAgICAgICAgc2NyZWVuQ29sdW1uID0gc2NyZWVuQ29sdW1uIHx8IDA7XG4gICAgICAgIHZhciBjLCBjb2x1bW47XG4gICAgICAgIGZvciAoY29sdW1uID0gMDsgY29sdW1uIDwgc3RyLmxlbmd0aDsgY29sdW1uKyspIHtcbiAgICAgICAgICAgIGMgPSBzdHIuY2hhckNvZGVBdChjb2x1bW4pO1xuICAgICAgICAgICAgaWYgKGMgPT0gOSkge1xuICAgICAgICAgICAgICAgIHNjcmVlbkNvbHVtbiArPSB0aGlzLmdldFNjcmVlblRhYlNpemUoc2NyZWVuQ29sdW1uKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGMgPj0gMHgxMTAwICYmIGlzRnVsbFdpZHRoKGMpKSB7XG4gICAgICAgICAgICAgICAgc2NyZWVuQ29sdW1uICs9IDI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBzY3JlZW5Db2x1bW4gKz0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChzY3JlZW5Db2x1bW4gPiBtYXhTY3JlZW5Db2x1bW4pIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gW3NjcmVlbkNvbHVtbiwgY29sdW1uXTtcbiAgICB9O1xuICAgIEVkaXRTZXNzaW9uLnByb3RvdHlwZS5nZXRSb3dMZW5ndGggPSBmdW5jdGlvbiAocm93KSB7XG4gICAgICAgIHZhciBoID0gMTtcbiAgICAgICAgaWYgKHRoaXMubGluZVdpZGdldHMpXG4gICAgICAgICAgICBoICs9IHRoaXMubGluZVdpZGdldHNbcm93XSAmJiB0aGlzLmxpbmVXaWRnZXRzW3Jvd10ucm93Q291bnQgfHwgMDtcbiAgICAgICAgaWYgKCF0aGlzLiR1c2VXcmFwTW9kZSB8fCAhdGhpcy4kd3J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hlID0gdGhpcy4kc2NyZWVuUm93Q2FjaGU7XG4gICAgICAgIHZhciBpID0gdGhpcy4kZ2V0Um93Q2FjaGVJbmRleChyb3dDYWNoZSwgc2NyZWVuUm93KTtcbiAgICAgICAgdmFyIGwgPSByb3dDYWNoZS5sZW5ndGg7XG4gICAgICAgIGlmIChsICYmIGkgPj0gMCkge1xuICAgICAgICAgICAgdmFyIHJvdyA9IHJvd0NhY2hlW2ldO1xuICAgICAgICAgICAgdmFyIGRvY1JvdyA9IHRoaXMuJGRvY1Jvd0NhY2hlW2ldO1xuICAgICAgICAgICAgdmFyIGRvQ2FjaGUgPSBzY3JlZW5Sb3cgPiByb3dDYWNoZVtsIC0gMV07XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB2YXIgZG9DYWNoZSA9ICFsO1xuICAgICAgICB9XG4gICAgICAgIHZhciBtYXhSb3cgPSB0aGlzLmdldExlbmd0aCgpIC0gMTtcbiAgICAgICAgdmFyIGZvbGRMaW5lID0gdGhpcy5nZXROZXh0Rm9sZExpbmUoZG9jUm93KTtcbiAgICAgICAgdmFyIGZvbGRTdGFydCA9IGZvbGRMaW5lID8gZm9sZExpbmUuc3RhcnQucm93IDogSW5maW5pdHk7XG4gICAgICAgIHdoaWxlIChyb3cgPD0gc2NyZWVuUm93KSB7XG4gICAgICAgICAgICByb3dMZW5ndGggPSB0aGlzLmdldFJvd0xlbmd0aChkb2NSb3cpO1xuICAgICAgICAgICAgaWYgKHJvdyArIHJvd0xlbmd0aCA+IHNjcmVlblJvdyB8fCBkb2NSb3cgPj0gbWF4Um93KSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICByb3cgKz0gcm93TGVuZ3RoO1xuICAgICAgICAgICAgICAgIGRvY1JvdysrO1xuICAgICAgICAgICAgICAgIGlmIChkb2NSb3cgPiBmb2xkU3RhcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgZG9jUm93ID0gZm9sZExpbmUuZW5kLnJvdyArIDE7XG4gICAgICAgICAgICAgICAgICAgIGZvbGRMaW5lID0gdGhpcy5nZXROZXh0Rm9sZExpbmUoZG9jUm93LCBmb2xkTGluZSk7XG4gICAgICAgICAgICAgICAgICAgIGZvbGRTdGFydCA9IGZvbGRMaW5lID8gZm9sZExpbmUuc3RhcnQucm93IDogSW5maW5pdHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGRvQ2FjaGUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiRkb2NSb3dDYWNoZS5wdXNoKGRvY1Jvdyk7XG4gICAgICAgICAgICAgICAgdGhpcy4kc2NyZWVuUm93Q2FjaGUucHVzaChyb3cpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChmb2xkTGluZSAmJiBmb2xkTGluZS5zdGFydC5yb3cgPD0gZG9jUm93KSB7XG4gICAgICAgICAgICBsaW5lID0gdGhpcy5nZXRGb2xkRGlzcGxheUxpbmUoZm9sZExpbmUpO1xuICAgICAgICAgICAgZG9jUm93ID0gZm9sZExpbmUuc3RhcnQucm93O1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHJvdyArIHJvd0xlbmd0aCA8PSBzY3JlZW5Sb3cgfHwgZG9jUm93ID4gbWF4Um93KSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHJvdzogbWF4Um93LFxuICAgICAgICAgICAgICAgIGNvbHVtbjogdGhpcy5nZXRMaW5lKG1heFJvdykubGVuZ3RoXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgbGluZSA9IHRoaXMuZ2V0TGluZShkb2NSb3cpO1xuICAgICAgICAgICAgZm9sZExpbmUgPSBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHZhciB3cmFwSW5kZW50ID0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RW5kLCByb3cgPSAwO1xuICAgICAgICB2YXIgcm93Q2FjaGUgPSB0aGlzLiRkb2NSb3dDYWNoZTtcbiAgICAgICAgdmFyIGkgPSB0aGlzLiRnZXRSb3dDYWNoZUluZGV4KHJvd0NhY2hlLCBkb2NSb3cpO1xuICAgICAgICB2YXIgbCA9IHJvd0NhY2hlLmxlbmd0aDtcbiAgICAgICAgaWYgKGwgJiYgaSA+PSAwKSB7XG4gICAgICAgICAgICB2YXIgcm93ID0gcm93Q2FjaGVbaV07XG4gICAgICAgICAgICB2YXIgc2NyZWVuUm93ID0gdGhpcy4kc2NyZWVuUm93Q2FjaGVbaV07XG4gICAgICAgICAgICB2YXIgZG9DYWNoZSA9IGRvY1JvdyA+IHJvd0NhY2hlW2wgLSAxXTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHZhciBkb0NhY2hlID0gIWw7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGZvbGRMaW5lID0gdGhpcy5nZXROZXh0Rm9sZExpbmUocm93KTtcbiAgICAgICAgdmFyIGZvbGRTdGFydCA9IGZvbGRMaW5lID8gZm9sZExpbmUuc3RhcnQucm93IDogSW5maW5pdHk7XG4gICAgICAgIHdoaWxlIChyb3cgPCBkb2NSb3cpIHtcbiAgICAgICAgICAgIGlmIChyb3cgPj0gZm9sZFN0YXJ0KSB7XG4gICAgICAgICAgICAgICAgcm93RW5kID0gZm9sZExpbmUuZW5kLnJvdyArIDE7XG4gICAgICAgICAgICAgICAgaWYgKHJvd0VuZCA+IGRvY1JvdylcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgZm9sZExpbmUgPSB0aGlzLmdldE5leHRGb2xkTGluZShyb3dFbmQsIGZvbGRMaW5lKTtcbiAgICAgICAgICAgICAgICBmb2xkU3RhcnQgPSBmb2xkTGluZSA/IGZvbGRMaW5lLnN0YXJ0LnJvdyA6IEluZmluaXR5O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcm93RW5kID0gcm93ICsgMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNjcmVlblJvdyArPSB0aGlzLmdldFJvd0xlbmd0aChyb3cpO1xuICAgICAgICAgICAgcm93ID0gcm93RW5kO1xuICAgICAgICAgICAgaWYgKGRvQ2FjaGUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiRkb2NSb3dDYWNoZS5wdXNoKHJvdyk7XG4gICAgICAgICAgICAgICAgdGhpcy4kc2NyZWVuUm93Q2FjaGUucHVzaChzY3JlZW5Sb3cpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhciB0ZXh0TGluZSA9IFwiXCI7XG4gICAgICAgIGlmIChmb2xkTGluZSAmJiByb3cgPj0gZm9sZFN0YXJ0KSB7XG4gICAgICAgICAgICB0ZXh0TGluZSA9IHRoaXMuZ2V0Rm9sZERpc3BsYXlMaW5lKGZvbGRMaW5lLCBkb2NSb3csIGRvY0NvbHVtbik7XG4gICAgICAgICAgICBmb2xkU3RhcnRSb3cgPSBmb2xkTGluZS5zdGFydC5yb3c7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0ZXh0TGluZSA9IHRoaXMuZ2V0TGluZShkb2NSb3cpLnN1YnN0cmluZygwLCBkb2NDb2x1bW4pO1xuICAgICAgICAgICAgZm9sZFN0YXJ0Um93ID0gZG9jUm93O1xuICAgICAgICB9XG4gICAgICAgIHZhciB3cmFwSW5kZW50ID0gMDtcbiAgICAgICAgaWYgKHRoaXMuJHVzZVdyYXBNb2RlKSB7XG4gICAgICAgICAgICB2YXIgd3JhcFJvdyA9IHRoaXMuJHdyYXBEYXRhW2ZvbGRTdGFydFJvd107XG4gICAgICAgICAgICBpZiAod3JhcFJvdykge1xuICAgICAgICAgICAgICAgIHZhciBzY3JlZW5Sb3dPZmZzZXQgPSAwO1xuICAgICAgICAgICAgICAgIH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A9IGZ1bmN0aW9uIChkb2NSb3csIGRvY0NvbHVtbikge1xuICAgICAgICByZXR1cm4gdGhpcy5kb2N1bWVudFRvU2NyZWVuUG9zaXRpb24oZG9jUm93LCBkb2NDb2x1bW4pLnJvdztcbiAgICB9O1xuICAgIEVkaXRTZXNzaW9uLnByb3RvdHlwZS5nZXRTY3JlZW5MZW5ndGggPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBzY3JlZW5Sb3dzID0gMDtcbiAgICAgICAgdmFyIGZvbGQgPSBudWxsO1xuICAgICAgICBpZiAoIXRoaXMuJHVzZVdyYXBNb2RlKSB7XG4gICAgICAgICAgICBzY3JlZW5Sb3dzID0gdGhpcy5nZXRMZW5ndGgoKTtcbiAgICAgICAgICAgIHZhciBmb2xkRGF0YSA9IHRoaXMuJGZvbGREYXRhO1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBmb2xkRGF0YS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGZvbGQgPSBmb2xkRGF0YVtpXTtcbiAgICAgICAgICAgICAgICBzY3JlZW5Sb3dzIC09IGZvbGQuZW5kLnJvdyAtIGZvbGQuc3RhcnQucm93O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdmFyIGxhc3RSb3cgPSB0aGlzLiR3cmFwRGF0YS5sZW5ndGg7XG4gICAgICAgICAgICB2YXIgcm93ID0gMCwgaSA9IDA7XG4gICAgICAgICAgICB2YXIgZm9sZCA9IHRoaXMuJGZvbGREYXRhW2krK107XG4gICAgICAgICAgICB2YXIgZm9sZFN0YXJ0ID0gZm9sZCA/IGZvbGQuc3RhcnQucm93IDogSW5maW5pdHk7XG4gICAgICAgICAgICB3aGlsZSAocm93IDwgbGFzdFJvdykge1xuICAgICAgICAgICAgICAgIHZhciBzcGxpdHMgPSB0aGlzLiR3cmFwRGF0YVtyb3ddO1xuICAgICAgICAgICAgICAgIHNjcmVlblJvd3MgKz0gc3BsaXRzID8gc3BsaXRzLmxlbmd0aCArIDEgOiAxO1xuICAgICAgICAgICAgICAgIHJvdysrO1xuICAgICAgICAgICAgICAgIGlmIChyb3cgPiBmb2xkU3RhcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgcm93ID0gZm9sZC5lbmQucm93ICsgMTtcbiAgICAgICAgICAgICAgICAgICAgZm9sZCA9IHRoaXMuJGZvbGREYXRhW2krK107XG4gICAgICAgICAgICAgICAgICAgIGZvbGRTdGFydCA9IGZvbGQgPyBmb2xkLnN0YXJ0LnJvdyA6IEluZmluaXR5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5saW5lV2lkZ2V0cylcbiAgICAgICAgICAgIHNjcmVlblJvd3MgKz0gdGhpcy4kZ2V0V2lkZ2V0U2NyZWVuTGVuZ3RoKCk7XG4gICAgICAgIHJldHVybiBzY3JlZW5Sb3dzO1xuICAgIH07XG4gICAgRWRpdFNlc3Npb24ucHJvdG90eXBlLiRzZXRGb250TWV0cmljcyA9IGZ1bmN0aW9uIChmbSkge1xuICAgICAgICBpZiAoIXRoaXMuJGVuYWJsZVZhckNoYXIpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIHRoaXMuJGdldFN0cmluZ1NjcmVlbldpZHRoID0gZnVuY3Rpb24gKHN0ciwgbWF4U2NyZWVuQ29sdW1uLCBzY3JlZW5Db2x1bW4pIHtcbiAgICAgICAgICAgIGlmIChtYXhTY3JlZW5Db2x1bW4gPT09IDApXG4gICAgICAgICAgICAgICAgcmV0dXJuIFswLCAwXTtcbiAgICAgICAgICAgIGlmICghbWF4U2NyZWVuQ29sdW1uKVxuICAgICAgICAgICAgICAgIG1heFNjcmVlbkNvbHVtbiA9IEluZmluaXR5O1xuICAgICAgICAgICAgc2NyZWVuQ29sdW1uID0gc2NyZWVuQ29sdW1uIHx8IDA7XG4gICAgICAgICAgICB2YXIgYywgY29sdW1uO1xuICAgICAgICAgICAgZm9yIChjb2x1bW4gPSAwOyBjb2x1bW4gPCBzdHIubGVuZ3RoOyBjb2x1bW4rKykge1xuICAgICAgICAgICAgICAgIGMgPSBzdHIuY2hhckF0KGNvbHVtbik7XG4gICAgICAgICAgICAgICAgaWYgKGMgPT09IFwiXFx0XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgc2NyZWVuQ29sdW1uICs9IHRoaXMuZ2V0U2NyZWVuVGFiU2l6ZShzY3JlZW5Db2x1bW4pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgc2NyZWVuQ29sdW1uICs9IGZtLmdldENoYXJhY3RlcldpZHRoKGMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc2NyZWVuQ29sdW1uID4gbWF4U2NyZWVuQ29sdW1uKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBbc2NyZWVuQ29sdW1uLCBjb2x1bW5dO1xuICAgICAgICB9O1xuICAgIH07XG4gICAgRWRpdFNlc3Npb24ucHJvdG90eXBlLmdldFByZWNlZGluZ0NoYXJhY3RlciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHBvcyA9IHRoaXMuc2VsZWN0aW9uLmdldEN1cnNvcigpO1xuICAgICAgICBpZiAocG9zLmNvbHVtbiA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIHBvcy5yb3cgPT09IDAgPyBcIlwiIDogdGhpcy5kb2MuZ2V0TmV3TGluZUNoYXJhY3RlcigpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBjdXJyZW50TGluZSA9IHRoaXMuZ2V0TGluZShwb3Mucm93KTtcbiAgICAgICAgcmV0dXJuIGN1cnJlbnRMaW5lW3Bvcy5jb2x1bW4gLSAxX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2YWx1ZSA9IHRydWU7XG4gICAgICAgICAgICBlbHNlIGlmICh2YWx1ZSA9PSBcInByaW50TWFyZ2luXCIpXG4gICAgICAgICAgICAgICAgdmFsdWUgPSAtMTtcbiAgICAgICAgICAgIGVsc2UgaWYgKHR5cGVvZiB2YWx1ZSA9PSBcInN0cmluZ1wiKVxuICAgICAgICAgICAgICAgIHZhbHVlID0gcGFyc2VJbnQodmFsdWUsIDEwKSB8fCBmYWxzZTtcbiAgICAgICAgICAgIGlmICh0aGlzLiR3cmFwID09IHZhbHVlKVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIHRoaXMuJHdyYXAgPSB2YWx1ZTtcbiAgICAgICAgICAgIGlmICghdmFsdWUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNldFVzZVdyYXBNb2RlKGZhbHNlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBjb2wgPSB0eXBlb2YgdmFsdWUgPT0gXCJudW1iZXJcIiA/IHZhbHVlIDogbnVsbDtcbiAgICAgICAgICAgICAgICB0aGlzLnNldFdyYXBMaW1pdFJhbmdlKGNvbCwgY29sKTtcbiAgICAgICAgICAgICAgICB0aGlzLnNldFVzZVdyYXBNb2RlKHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmdldFVzZVdyYXBNb2RlKCkpIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy4kd3JhcCA9PSAtMSlcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFwicHJpbnRNYXJnaW5cIjtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuZ2V0V3JhcExpbWl0UmFuZ2UoKS5taW4pXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcImZyZWVcIjtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy4kd3JhcDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBcIm9mZlwiO1xuICAgICAgICB9LFxuICAgICAgICBoYW5kbGVzU2V0OiB0cnVlXG4gICAgfSxcbiAgICB3cmFwTWV0aG9kOiB7XG4gICAgICAgIHNldDogZnVuY3Rpb24gKHZhbCkge1xuICAgICAgICAgICAgdmFsID0gdmFsID09IFwiYXV0b1wiXG4gICAgICAgICAgICAgICAgPyB0aGlzLiRtb2RlLnR5cGUgIT0gXCJ0ZXh0XCJcbiAgICAgICAgICAgICAgICA6IHZhbCAhPSBcInRleHRcIjtcbiAgICAgICAgICAgIGlmICh2YWwgIT0gdGhpcy4kd3JhcEFzQ29kZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuJHdyYXBBc0NvZGUgPSB2YWw7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuJHVzZVdyYXBNb2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJHVzZVdyYXBNb2RlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0VXNlV3JhcE1vZGUodHJ1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBpbml0aWFsVmFsdWU6IFwiYXV0b1wiXG4gICAgfSxcbiAgICBpbmRlbnRlZFNvZnRXcmFwOiB7XG4gICAgICAgIHNldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKHRoaXMuJHVzZVdyYXBNb2RlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy4kdXNlV3JhcE1vZGUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB0aGlzLnNldFVzZVdyYXBNb2RlKHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBpbml0aWFsVmFsdWU6IHRydWVcbiAgICB9LFxuICAgIGZpcnN0TGluZU51bWJlcjoge1xuICAgICAgICBzZXQ6IGZ1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yBSYW5nZShzciwgc2MsIGVyLCBlYyk7XG4gICAgICAgICAgICBpZiAoc2MgPT0gZWMgJiYgb3B0aW9ucy5zdGFydCAmJiAvKipAdHlwZXtSYW5nZX0qLyAob3B0aW9ucy5zdGFydCkuc3RhcnRcbiAgICAgICAgICAgICAgICAmJiBvcHRpb25zLnNraXBDdXJyZW50ICE9IGZhbHNlICYmIGZpcnN0UmFuZ2UuaXNFcXVhbCgvKipAdHlwZXtSYW5nZX0qLyAob3B0aW9ucy5zdGFydCkpKSB7XG4gICAgICAgICAgICAgICAgZmlyc3RSYW5nZSA9IG51bGw7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gZmlyc3RSYW5nZTtcbiAgICB9O1xuICAgIFNlYXJjaC5wcm90b3R5cGUuZmluZEFsbCA9IGZ1bmN0aW9uIChzZXNzaW9uKSB7XG4gICAgICAgIHZhciBvcHRpb25zID0gdGhpcy4kb3B0aW9ucztcbiAgICAgICAgaWYgKCFvcHRpb25zLm5lZWRsZSlcbiAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgdGhpcy4kYXNzZW1ibGVSZWdFeHAob3B0aW9ucyk7XG4gICAgICAgIHZhciByYW5nZSA9IG9wdGlvbnMucmFuZ2U7XG4gICAgICAgIHZhciBsaW5lcyA9IHJhbmdlXG4gICAgICAgICAgICA/IHNlc3Npb24uZ2V0TGluZXMocmFuZ2Uuc3RhcnQucm93LCByYW5nZS5lbmQucm93KVxuICAgICAgICAgICAgOiBzZXNzaW9uLmRvYy5nZXRBbGxMaW5lcygpO1xuICAgICAgICB2YXIgcmFuZ2VzID0gW107XG4gICAgICAgIHZhciByZSA9IG9wdGlvbnMucmU7XG4gICAgICAgIGlmIChvcHRpb25zLiRpc011bHRpTGluZSkge1xuICAgICAgICAgICAgdmFyIGxlbiA9IHJlLmxlbmd0aDtcbiAgICAgICAgICAgIHZhciBtYXhSb3cgPSBsaW5lcy5sZW5ndGggLSBsZW47XG4gICAgICAgICAgICB2YXIgcHJldlJhbmdlO1xuICAgICAgICAgICAgb3V0ZXI6IGZvciAodmFyIHJvdyA9IHJlLm9mZnNldCB8fCAwOyByb3cgPD0gbWF4Um93OyByb3crKykge1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgbGVuOyBqKyspXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaW5lc1tyb3cgKyBqXS5zZWFyY2gocmVbal0pID09IC0xKVxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWUgb3V0ZXI7XG4gICAgICAgICAgICAgICAgdmFyIHN0YXJ0TGluZSA9IGxpbmVzW3Jvd107XG4gICAgICAgICAgICAgICAgdmFyIGxpbmUgPSBsaW5lc1tyb3cgKyBsZW4gLSAxXTtcbiAgICAgICAgICAgICAgICB2YXIgc3RhcnRJbmRleCA9IHN0YXJ0TGluZS5sZW5ndGggLSBzdGFydExpbmUubWF0Y2gocmVbMF0pWzBdLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB2YXIgZW5kSW5kZXggPSBsaW5lLm1hdGNoKHJlW2xlbiAtIDFdKVswXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgaWYgKHByZXZSYW5nZSAmJiBwcmV2UmFuZ2UuZW5kLnJvdyA9PT0gcm93ICYmXG4gICAgICAgICAgICAgICAgICAgIHByZXZSYW5nZS5lbmQuY29sdW1uID4gc3RhcnRJbmRleCkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmFuZ2VzLnB1c2gocHJldlJhbmdlID0gbmV3IFJhbmdlKHJvdywgc3RhcnRJbmRleCwgcm93ICsgbGVuIC0gMSwgZW5kSW5kZXgpKTtcbiAgICAgICAgICAgICAgICBpZiAobGVuID4gMilcbiAgICAgICAgICAgICAgICAgICAgc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bal0uZW5kLnJvdyA9PSBlbmRSb3cpXG4gICAgICAgICAgICAgICAgai0tO1xuICAgICAgICAgICAgcmFuZ2VzID0gcmFuZ2VzLnNsaWNlKGksIGogKyAxKTtcbiAgICAgICAgICAgIGZvciAoaSA9IDAsIGogPSByYW5nZXMubGVuZ3RoOyBpIDwgajsgaSsrKSB7XG4gICAgICAgICAgICAgICAgcmFuZ2VzW2ldLnN0YXJ0LnJvdyArPSByYW5nZS5zdGFydC5yb3c7XG4gICAgICAgICAgICAgICAgcmFuZ2VzW2ldLmVuZC5yb3cgKz0gcmFuZ2Uuc3RhcnQucm93O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByYW5nZXM7XG4gICAgfTtcbiAgICBTZWFyY2gucHJvdG90eXBlLnJlcGxhY2UgPSBmdW5jdGlvbiAoaW5wdXQsIHJlcGxhY2VtZW50KSB7XG4gICAgICAgIHZhciBvcHRpb25zID0gdGhpcy4kb3B0aW9ucztcbiAgICAgICAgdmFyIHJlID0gdGhpcy4kYXNzZW1ibGVSZWdFeHAob3B0aW9ucyk7XG4gICAgICAgIGlmIChvcHRpb25zLiRpc011bHRpTGluZSlcbiAgICAgICAgICAgIHJldHVybiByZXBsYWNlbWVudDtcbiAgICAgICAgaWYgKCFyZSlcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgdmFyIG1hdGNoID0gcmUuZXhlYyhpbnB1dCk7XG4gICAgICAgIGlmICghbWF0Y2ggfHwgbWF0Y2hbMF0ubGVuZ3RoICE9IGlucHV0Lmxlbmd0aClcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICBpZiAoIW9wdGlvbnMucmVnRXhwKSB7XG4gICAgICAgICAgICByZXBsYWNlbWVudCA9IHJlcGxhY2VtZW50LnJlcGxhY2UoL1xcJC9nLCBcIiQkJCRcIik7XG4gICAgICAgIH1cbiAgICAgICAgcmVwbGFjZW1lbnQgPSBpbnB1dC5yZXBsYWNlKHJlLCByZXBsYWNlbWVudCk7XG4gICAgICAgIGlmIChvcHRpb25zLnByZXNlcnZlQ2FzZSkge1xuICAgICAgICAgICAgcmVwbGFjZW1lbnQgPSByZXBsYWNlbWVudC5zcGxpdChcIlwiKTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSBNYXRoLm1pbihpbnB1dC5sZW5ndGgsIGlucHV0Lmxlbmd0aCk7IGktLTspIHtcbiAgICAgICAgICAgICAgICB2YXIgY2ggPSBpbnB1dFtpXTtcbiAgICAgICAgICAgICAgICBpZiAoY2ggJiYgY2gudG9Mb3dlckNhc2UoKSAhPSBjaClcbiAgICAgICAgICAgICAgICAgICAgcmVwbGFjZW1lbnRbaV0gPSByZXBsYWNlbWVudFtpXS50b1VwcGVyQ2FzZSgpO1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgcmVwbGFjZW1lbnRbaV0gPSByZXBsYWNlbWVudFtpXS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVwbGFjZW1lbnQgPSByZXBsYWNlbWVudC5qb2luKFwiXCIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXBsYWNlbWVudDtcbiAgICB9O1xuICAgIFNlYXJjaC5wcm90b3R5cGUuJGFzc2VtYmxlUmVnRXhwID0gZnVuY3Rpb24gKG9wdGlvbnMsICRkaXNhYmxlRmFrZU11bHRpbGluZSkge1xuICAgICAgICBpZiAob3B0aW9ucy5uZWVkbGUgaW5zdGFuY2VvZiBSZWdFeHApXG4gICAgICAgICAgICByZXR1cm4gb3B0aW9ucy5yZSA9IG9wdGlvbnMubmVlZGxlO1xuICAgICAgICB2YXIgbmVlZGxlID0gb3B0aW9ucy5uZWVkbGU7XG4gICAgICAgIGlmICghb3B0aW9ucy5uZWVkbGUpXG4gICAgICAgICAgICByZXR1cm4gb3B0aW9ucy5yZSA9IGZhbHNlO1xuICAgICAgICBpZiAoIW9wdGlvbnMucmVnRXhwKVx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1xuICAgICAgICB2YXIgc3RhcnQgPSBvcHRpb25zLnN0YXJ0O1xuICAgICAgICBpZiAoIXN0YXJ0KVxuICAgICAgICAgICAgc3RhcnQgPSByYW5nZSA/IHJhbmdlW2JhY2t3YXJkcyA/IFwiZW5kXCIgOiBcInN0YXJ0XCJdIDogc2Vzc2lvbi5zZWxlY3Rpb24uZ2V0UmFuZ2UoKTtcbiAgICAgICAgaWYgKHN0YXJ0LnN0YXJ0KVxuICAgICAgICAgICAgc3RhcnQgPSBzdGFydFtza2lwQ3VycmVudCAhPSBiYWNrd2FyZHMgPyBcImVuZFwiIDogXCJzdGFydFwiXTtcbiAgICAgICAgdmFyIGZpcnN0Um93ID0gcmFuZ2UgPyByYW5nZS5zdGFydC5yb3cgOiAwO1xuICAgICAgICB2YXIgbGFzdFJvdyA9IHJhbmdlID8gcmFuZ2UuZW5kLnJvdyA6IHNlc3Npb24uZ2V0TGVuZ3RoKCkgLSAxO1xuICAgICAgICBpZiAoYmFja3dhcmRzKSB7XG4gICAgICAgICAgICB2YXIgZm9yRWFjaCA9IGZ1bmN0aW9uIChjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIHZhciByb3cgPSBzdGFydC5yb3c7XG4gICAgICAgICAgICAgICAgaWYgKGZvckVhY2hJbkxpbmUocm93LCBzdGFydC5jb2x1bW4sIGNhbGxiYWNrKSlcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIGZvciAocm93LS07IHJvdyA+PSBmaXJzdFJvdzsgcm93LS0pXG4gICAgICAgICAgICAgICAgICAgIGlmIChmb3JFYWNoSW5MaW5lKHJvdywgTnVtYmVyLk1BWF9WQUxVRSwgY2FsbGJhY2spKVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLndyYXAgPT0gZmFsc2UpXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICBmb3IgKHJvdyA9IGxhc3RSb3csIGZpcnN0Um93ID0gc3RhcnQucm93OyByb3cgPj0gZmlyc3RSb3c7IHJvdy0tKVxuICAgICAgICAgICAgICAgICAgICBpZiAoZm9yRWFjaEluTGluZShyb3csIE51bWJlci5NQVhfVkFMVUUsIGNhbGxiYWNrKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB2YXIgZm9yRWFjaCA9IGZ1bmN0aW9uIChjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIHZhciByb3cgPSBzdGFydC5yb3c7XG4gICAgICAgICAgICAgICAgaWYgKGZvckVhY2hJbkxpbmUocm93LCBzdGFydC5jb2x1bW4sIGNhbGxiYWNrKSlcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIGZvciAocm93ID0gcm93ICsgMTsgcm93IDw9IGxhc3RSb3c7IHJvdysrKVxuICAgICAgICAgICAgICAgICAgICBpZiAoZm9yRWFjaEluTGluZShyb3csIDAsIGNhbGxiYWNrKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy53cmFwID09IGZhbHNlKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgZm9yIChyb3cgPSBmaXJzdFJvdywgbGFzdFJvdyA9IHN0YXJ0LnJvdzsgcm93IDw9IGxhc3RSb3c7IHJvdysrKVxuICAgICAgICAgICAgICAgICAgICBpZiAoZm9yRWFjaEluTGluZShyb3csIDAsIGNhbGxiYWNrKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9wdGlvbnMuJGlzTXVsdGlMaW5lKSB7XG4gICAgICAgICAgICB2YXIgbGVuID0gcmUubGVuZ3RoO1xuICAgICAgICAgICAgdmFyIGZvckVhY2hJbkxpbmUgPSBmdW5jdGlvbiAocm93LCBvZmZzZXQsIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0YXJ0Um93ID0gYmFja3dhcmRzID8gcm93IC0gbGVuICsgMSA6IHJvdztcbiAgICAgICAgICAgICAgICBpZiAoc3RhcnRSb3cgPCAwIHx8IHN0YXJ0Um93ICsgbGVuID4gc2Vzc2lvbi5nZXRMZW5ndGgoKSlcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIHZhciBsaW5lID0gc2Vzc2lvbi5nZXRMaW5lKHN0YXJ0Um93KTtcbiAgICAgICAgICAgICAgICB2YXIgc3RhcnRJbmRleCA9IGxpbmUuc2VhcmNoKHJlWzBdKTtcbiAgICAgICAgICAgICAgICBpZiAoIWJhY2t3YXJkcyAmJiBzdGFydEluZGV4IDwgb2Zmc2V0IHx8IHN0YXJ0SW5kZXggPT09IC0xKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDE7IGkgPCBsZW47IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBsaW5lID0gc2Vzc2lvbi5nZXRMaW5lKHN0YXJ0Um93ICsgaSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChsaW5lLnNlYXJjaChyZVtpXSkgPT0gLTEpXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBlbmRJbmRleCA9IGxpbmUubWF0Y2gocmVbbGVuIC0gMV0pWzBdLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZiAoYmFja3dhcmRzICYmIGVuZEluZGV4ID4gb2Zmc2V0KVxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgaWYgKGNhbGxiYWNrKHN0YXJ0Um93LCBzdGFydEluZGV4LCBzdGFydFJvdyArIGxlbiAtIDEsIGVuZEluZGV4KSlcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGJhY2t3YXJkcykge1xuICAgICAgICAgICAgdmFyIGZvckVhY2hJbkxpbmUgPSBmdW5jdGlvbiAocm93LCBlbmRJbmRleCwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICB2YXIgbGluZSA9IHNlc3Npb24uZ2V0TGluZShyb3cpO1xuICAgICAgICAgICAgICAgIHZhciBtYXRjaGVzID0gW107XG4gICAgICAgICAgICAgICAgdmFyIG0sIGxhc3QgPSAwO1xuICAgICAgICAgICAgICAgIHJlLmxhc3RJbmRleCA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKChtID0gcmUuZXhlYyhsaW5lKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxlbmd0aCA9IG1bMF0ubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBsYXN0ID0gbS5pbmRleDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsYXN0ID49IGxpbmUubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmUubGFzdEluZGV4ID0gbGFzdCArPSBsYW5nLnNraXBFbXB0eU1hdGNoKGxpbmUsIGxhc3QsIHN1cHBvcnRzVW5pY29kZUZsYWcpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChtLmluZGV4ICsgbGVuZ3RoID4gZW5kSW5kZXgpXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgbWF0Y2hlcy5wdXNoKG0uaW5kZXgsIGxlbmd0aCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSBtYXRjaGVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgaSAtPSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjb2x1bW4gPSBtYXRjaGVzW2kgLSAxXTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxlbmd0aCA9IG1hdGNoZXNbaV07XG4gICAgICAgICAgICAgICAgICAgIGlmIChjYWxsYmFjayhyb3csIGNvbHVtbiwgcm93LCBjb2x1bW4gKyBsZW5ndGgpKVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHZhciBmb3JFYWNoSW5MaW5lID0gZnVuY3Rpb24gKHJvdywgc3RhcnRJbmRleCwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICB2YXIgbGluZSA9IHNlc3Npb24uZ2V0TGluZShyb3cpO1xuICAgICAgICAgICAgICAgIHZhciBsYXN0O1xuICAgICAgICAgICAgICAgIHZhciBtO1xuICAgICAgICAgICAgICAgIHJlLmxhc3RJbmRleCA9IHN0YXJ0SW5kZXg7XG4gICAgICAgICAgICAgICAgd2hpbGUgKChtID0gcmUuZXhlYyhsaW5lKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxlbmd0aCA9IG1bMF0ubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBsYXN0ID0gbS5pbmRleDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNhbGxiYWNrKHJvdywgbGFzdCwgcm93LCBsYXN0ICsgbGVuZ3RoKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmUubGFzdEluZGV4ID0gbGFzdCArPS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tbWFuZClcbiAgICAgICAgICAgIGRlbGV0ZSB0aGlzLmNvbW1hbmRzW25hbWVdO1xuICAgICAgICB2YXIgY2tiID0gdGhpcy5jb21tYW5kS2V5QmluZGluZztcbiAgICAgICAgZm9yICh2YXIga2V5SWQgaW4gY2tiKSB7XG4gICAgICAgICAgICB2YXIgY21kR3JvdXAgPSBja2Jba2V5SWRdO1xuICAgICAgICAgICAgaWYgKGNtZEdyb3VwID09IGNvbW1hbmQpIHtcbiAgICAgICAgICAgICAgICBkZWxldGUgY2tiW2tleUlkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoY21kR3JvdXApKSB7XG4gICAgICAgICAgICAgICAgdmFyIGkgPSBjbWRHcm91cC5pbmRleE9mKGNvbW1hbmQpO1xuICAgICAgICAgICAgICAgIGlmIChpICE9IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGNtZEdyb3VwLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNtZEdyb3VwLmxlbmd0aCA9PSAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgY2tiW2tleUlkXSA9IGNtZEdyb3VwWzBdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgTXVsdGlIYXNoSGFuZGxlci5wcm90b3R5cGUuYmluZEtleSA9IGZ1bmN0aW9uIChrZXksIGNvbW1hbmQsIHBvc2l0aW9uKSB7XG4gICAgICAgIGlmICh0eXBlb2Yga2V5ID09IFwib2JqZWN0XCIgJiYga2V5KSB7XG4gICAgICAgICAgICBpZiAocG9zaXRpb24gPT0gdW5kZWZpbmVkKVxuICAgICAgICAgICAgICAgIHBvc2l0aW9uID0ga2V5LnBvc2l0aW9uO1xuICAgICAgICAgICAga2V5ID0ga2V5W3RoaXMucGxhdGZvcm1dO1xuICAgICAgICB9XG4gICAgICAgIGlmICgha2V5KVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAodHlwZW9mIGNvbW1hbmQgPT0gXCJmdW5jdGlvblwiKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuYWRkQ29tbWFuZCh7IGV4ZWM6IGNvbW1hbmQsIGJpbmRLZXk6IGtleSwgbmFtZTogY29tbWFuZC5uYW1lIHx8IC8qKkB0eXBle3N0cmluZ30qLyAoa2V5KSB9KTsgKGtleSkuc3BsaXQoXCJ8XCIpLmZvckVhY2goZnVuY3Rpb24gKGtleVBhcnQpIHtcbiAgICAgICAgICAgIHZhciBjaGFpbiA9IFwiXCI7XG4gICAgICAgICAgICBpZiAoa2V5UGFydC5pbmRleE9mKFwiIFwiKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgIHZhciBwYXJ0cyA9IGtleVBhcnQuc3BsaXQoL1xccysvKTtcbiAgICAgICAgICAgICAgICBrZXlQYXJ0ID0gcGFydHMucG9wKCk7XG4gICAgICAgICAgICAgICAgcGFydHMuZm9yRWFjaChmdW5jdGlvbiAoa2V5UGFydCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYmluZGluZyA9IHRoaXMucGFyc2VLZXlzKGtleVBhcnQpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgaWQgPSBLRVlfTU9EU1tiaW5kaW5nLmhhc2hJZF0gKyBiaW5kaW5nLmtleTtcbiAgICAgICAgICAgICAgICAgICAgY2hhaW4gKz0gKGNoYWluID8gXCIgXCIgOiBcIlwiKSArIGlkO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9hZGRDb21tYW5kVG9CaW5kaW5nKGNoYWluLCBcImNoYWluS2V5c1wiKTtcbiAgICAgICAgICAgICAgICB9LCB0aGlzKTtcbiAgICAgICAgICAgICAgICBjaGFpbiArPSBcIiBcIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBiaW5kaW5nID0gdGhpcy5wYXJzZUtleXMoa2V5UGFydCk7XG4gICAgICAgICAgICB2YXIgaWQgPSBLRVlfTU9EU1tiaW5kaW5nLmhhc2hJZF0gKyBiaW5kaW5nLmtleTtcbiAgICAgICAgICAgIHRoaXMuX2FkZENvbW1hbmRUb0JpbmRpbmcoY2hhaW4gKyBpZCwgY29tbWFuZCwgcG9zaXRpb24pO1xuICAgICAgICB9LCB0aGlzKTtcbiAgICB9O1xuICAgIE11bHRpSGFzaEhhbmRsZXIucHJvdG90eXBlLl9hZGRDb21tYW5kVG9CaW5kaW5nID0gZnVuY3Rpb24gKGtleUlkLCBjb21tYW5kLCBwb3NpdGlvbikge1xuICAgICAgICB2YXIgY2tiID0gdGhpcy5jb21tYW5kS2V5QmluZGluZywgaTtcbiAgICAgICAgaWYgKCFjb21tYW5kKSB7XG4gICAgICAgICAgICBkZWxldGUgY2tiW2tleUlkXTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICghY2tiW2tleUlkXSB8fCB0aGlzLiRzaW5nbGVDb21tYW5kKSB7XG4gICAgICAgICAgICBja2Jba2V5SWRdID0gY29tbWFuZDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmICghQXJyYXkuaXNBcnJheShja2Jba2V5SWRdKSkge1xuICAgICAgICAgICAgICAgIGNrYltrZXlJZF0gPSBbY2tiW2tleUlkXV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICgoaSA9IGNrYltrZXlJZF0uaW5kZXhPZihjb21tYW5kKSkgIT0gLTEpIHtcbiAgICAgICAgICAgICAgICBja2Jba2V5SWRdLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0eXBlb2YgcG9zaXRpb24gIT0gXCJudW1iZXJcIikge1xuICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZ2V0UG9zaXRpb24oY29tbWFuZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgY29tbWFuZHMgPSBja2Jba2V5SWRdO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGNvbW1hbmRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIG90aGVyID0gY29tbWFuZHNbaV07XG4gICAgICAgICAgICAgICAgdmFyIG90aGVyUG9zID0gZ2V0UG9zaXRpb24ob3RoZXIpO1xuICAgICAgICAgICAgICAgIGlmIChvdGhlclBvcyA+IHBvc2l0aW9uKVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvbW1hbmRzLnNwbGljZShpLCAwLCBjb21tYW5kKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgTXVsdGlIYXNoSGFuZGxlci5wcm90b3R5cGUuYWRkQ29tbWFuZHMgPSBmdW5jdGlvbiAoY29tbWFuZHMpIHtcbiAgICAgICAgY29tbWFuZHMgJiYgT2JqZWN0LmtleXMoY29tbWFuZHMpLmZvckVhY2goZnVuY3Rpb24gKG5hbWUpIHtcbiAgICAgICAgICAgIHZhciBjb21tYW5kID0gY29tbWFuZHNbbmFtZV07XG4gICAgICAgICAgICBpZiAoIWNvbW1hbmQpXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBjb21tYW5kID09PSBcInN0cmluZ1wiKVxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmJpbmRLZXkoY29tbWFuZCwgbmFtZSk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGNvbW1hbmQgPT09IFwiZnVuY3Rpb25cIilcbiAgICAgICAgICAgICAgICBjb21tYW5kID0geyBleGVjOiBjb21tYW5kIH07XG4gICAgICAgICAgICBpZiAodHlwZW9mIGNvbW1hbmQgIT09IFwib2JqZWN0XCIpXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgaWYgKCFjb21tYW5kLm5hbWUpXG4gICAgICAgICAgICAgICAgY29tbWFuZC5uYW1lID0gbmFtZTtcbiAgICAgICAgICAgIHRoaXM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VU5DVElPTl9LRVlTW2tleUNvZGVdKVxuICAgICAgICAgICAga2V5ID0ga2V5VXRpbC5GVU5DVElPTl9LRVlTW2tleUNvZGVdLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgIGVsc2UgaWYgKCFwYXJ0cy5sZW5ndGgpXG4gICAgICAgICAgICByZXR1cm4geyBrZXk6IGtleSwgaGFzaElkOiAtMSB9O1xuICAgICAgICBlbHNlIGlmIChwYXJ0cy5sZW5ndGggPT0gMSAmJiBwYXJ0c1swXSA9PSBcInNoaWZ0XCIpXG4gICAgICAgICAgICByZXR1cm4geyBrZXk6IGtleS50b1VwcGVyQ2FzZSgpLCBoYXNoSWQ6IC0xIH07XG4gICAgICAgIHZhciBoYXNoSWQgPSAwO1xuICAgICAgICBmb3IgKHZhciBpID0gcGFydHMubGVuZ3RoOyBpLS07KSB7XG4gICAgICAgICAgICB2YXIgbW9kaWZpZXIgPSBrZXlVdGlsLktFWV9NT0RTW3BhcnRzW2ldXTtcbiAgICAgICAgICAgIGlmIChtb2RpZmllciA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb25zb2xlICE9IFwidW5kZWZpbmVkXCIpXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoXCJpbnZhbGlkIG1vZGlmaWVyIFwiICsgcGFydHNbaV0gKyBcIiBpbiBcIiArIGtleXMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGhhc2hJZCB8PSBtb2RpZmllcjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyBrZXk6IGtleSwgaGFzaElkOiBoYXNoSWQgfTtcbiAgICB9O1xuICAgIE11bHRpSGFzaEhhbmRsZXIucHJvdG90eXBlLmZpbmRLZXlDb21tYW5kID0gZnVuY3Rpb24gKGhhc2hJZCwga2V5U3RyaW5nKSB7XG4gICAgICAgIHZhciBrZXkgPSBLRVlfTU9EU1toYXNoSWRdICsga2V5U3RyaW5nO1xuICAgICAgICByZXR1cm4gdGhpcy5jb21tYW5kS2V5QmluZGluZ1trZXldO1xuICAgIH07XG4gICAgTXVsdGlIYXNoSGFuZGxlci5wcm90b3R5cGUuaGFuZGxlS2V5Ym9hcmQgPSBmdW5jdGlvbiAoZGF0YSwgaGFzaElkLCBrZXlTdHJpbmcsIGtleUNvZGUpIHtcbiAgICAgICAgaWYgKGtleUNvZGUgPCAwKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB2YXIga2V5ID0gS0VZX01PRFNbaGFzaElkXSArIGtleVN0cmluZztcbiAgICAgICAgdmFyIGNvbW1hbmQgPSB0aGlzLmNvbW1hbmRLZXlCaW5kaW5nW2tleV07XG4gICAgICAgIGlmIChkYXRhLiRrZXlDaGFpbikge1xuICAgICAgICAgICAgZGF0YS4ka2V5Q2hhaW4gKz0gXCIgXCIgKyBrZXk7XG4gICAgICAgICAgICBjb21tYW5kID0gdGhpcy5jb21tYW5kS2V5QmluZGluZ1tkYXRhLiRrZXlDaGFpbl0gfHwgY29tbWFuZDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY29tbWFuZCkge1xuICAgICAgICAgICAgaWYgKGNvbW1hbmQgPT0gXCJjaGFpbktleXNcIiB8fCBjb21tYW5kW2NvbW1hbmQubGVuZ3RoIC0gMV0gPT0gXCJjaGFpbktleXNcIikge1xuICAgICAgICAgICAgICAgIGRhdGEuJGtleUNoYWluID0gZGF0YS4ka2V5Q2hhaW4gfHwga2V5O1xuICAgICAgICAgICAgICAgIHJldHVybiB7IGNvbW1hbmQ6IFwibnVsbFwiIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGRhdGEuJGtleUNoYWluKSB7XG4gICAgICAgICAgICBpZiAoKCFoYXNoSWQgfHwgaGFzaElkID09IDQpICYmIGtleVN0cmluZy5sZW5ndGggPT0gMSlcbiAgICAgICAgICAgICAgICBkYXRhLiRrZXlDaGFpbi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AgbXVsdGlTZWxlY3RBY3Rpb246IFwiZm9yRWFjaFwiLFxuICAgICAgICBzY3JvbGxJbnRvVmlldzogXCJjdXJzb3JcIlxuICAgIH0sIHtcbiAgICAgICAgbmFtZTogXCJjdXRfb3JfZGVsZXRlXCIsXG4gICAgICAgIGRlc2NyaXB0aW9uOiBcIkN1dCBvciBkZWxldGVcIixcbiAgICAgICAgYmluZEtleTogYmluZEtleShcIlNoaWZ0LURlbGV0ZVwiLCBudWxsKSxcbiAgICAgICAgZXhlYzogZnVuY3Rpb24gKGVkaXRvcikge1xuICAgICAgICAgICAgaWYgKGVkaXRvci5zZWxlY3Rpb24uaXNFbXB0eSgpKSB7XG4gICAgICAgICAgICAgICAgZWRpdG9yLnJlbW92ZShcImxlZnRcIik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG11bHRpU2VsZWN0QWN0aW9uOiBcImZvckVhY2hcIixcbiAgICAgICAgc2Nyb2xsSW50b1ZpZXc6IFwiY3Vyc29yXCJcbiAgICB9LCB7XG4gICAgICAgIG5hbWU6IFwicmVtb3ZldG9saW5lc3RhcnRcIixcbiAgICAgICAgZGVzY3JpcHRpb246IFwiUmVtb3ZlIHRvIGxpbmUgc3RhcnRcIixcbiAgICAgICAgYmluZEtleTogYmluZEtleShcIkFsdC1CYWNrc3BhY2VcIiwgXCJDb21tYW5kLUJhY2tzcGFjZVwiKSxcbiAgICAgICAgZXhlYzogZnVuY3Rpb24gKGVkaXRvcikgeyBlZGl0b3IucmVtb3ZlVG9MaW5lU3RhcnQoKTsgfSxcbiAgICAgICAgbXVsdGlTZWxlY3RBY3Rpb246IFwiZm9yRWFjaFwiLFxuICAgICAgICBzY3JvbGxJbnRvVmlldzogXCJjdXJzb3JcIlxuICAgIH0sIHtcbiAgICAgICAgbmFtZTogXCJyZW1vdmV0b2xpb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GVzY3JpcHRpb246IFwiSW52ZXJ0IHNlbGVjdGlvblwiLFxuICAgICAgICBiaW5kS2V5OiBiaW5kS2V5KG51bGwsIG51bGwpLFxuICAgICAgICBleGVjOiBmdW5jdGlvbiAoZWRpdG9yKSB7XG4gICAgICAgICAgICB2YXIgZW5kUm93ID0gZWRpdG9yLnNlc3Npb24uZG9jLmdldExlbmd0aCgpIC0gMTtcbiAgICAgICAgICAgIHZhciBlbmRDb2wgPSBlZGl0b3Iuc2Vzc2lvbi5kb2MuZ2V0TGluZShlbmRSb3cpLmxlbmd0aDtcbiAgICAgICAgICAgIHZhciByYW5nZXMgPSBlZGl0b3Iuc2VsZWN0aW9uLnJhbmdlTGlzdC5yYW5nZXM7XG4gICAgICAgICAgICB2YXIgbmV3UmFuZ2VzID0gW107XG4gICAgICAgICAgICBpZiAocmFuZ2VzLmxlbmd0aCA8IDEpIHtcbiAgICAgICAgICAgICAgICByYW5nZXMgPSBbZWRpdG9yLnNlbGVjdGlvbi5nZXRSYW5nZSgpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcmFuZ2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGkgPT0gKHJhbmdlcy5sZW5ndGggLSAxKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIShyYW5nZXNbaV0uZW5kLnJvdyA9PT0gZW5kUm93ICYmIHJhbmdlc1tpXS5lbmQuY29sdW1uID09PSBlbmRDb2wpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdSYW5nZXMucHVzaChuZXcgUmFuZ2UocmFuZ2VzW2ldLmVuZC5yb3csIHJhbmdlc1tpXS5lbmQuY29sdW1uLCBlbmRSb3csIGVuZENvbCkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGlm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KVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB2YXIgc3RhcnRSb3cgPSBkZWx0YS5zdGFydC5yb3c7XG4gICAgICAgIHZhciBsZW4gPSBkZWx0YS5lbmQucm93IC0gc3RhcnRSb3c7XG4gICAgICAgIGlmIChsZW4gPT09IDApIHtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChkZWx0YS5hY3Rpb24gPT0gXCJyZW1vdmVcIikge1xuICAgICAgICAgICAgdmFyIHJlbW92ZWQgPSBsaW5lV2lkZ2V0cy5zcGxpY2Uoc3RhcnRSb3cgKyAxLCBsZW4pO1xuICAgICAgICAgICAgaWYgKCFsaW5lV2lkZ2V0c1tzdGFydFJvd10gJiYgcmVtb3ZlZFtyZW1vdmVkLmxlbmd0aCAtIDFdKSB7XG4gICAgICAgICAgICAgICAgbGluZVdpZGdldHNbc3RhcnRSb3ddID0gcmVtb3ZlZC5wb3AoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlbW92ZWQuZm9yRWFjaChmdW5jdGlvbiAodykge1xuICAgICAgICAgICAgICAgIHcgJiYgdGhpcy5yZW1vdmVMaW5lV2lkZ2V0KHcpO1xuICAgICAgICAgICAgfSwgdGhpcyk7XG4gICAgICAgICAgICB0aGlzLiR1cGRhdGVSb3dzKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB2YXIgYXJncyA9IG5ldyBBcnJheShsZW4pO1xuICAgICAgICAgICAgaWYgKGxpbmVXaWRnZXRzW3N0YXJ0Um93XSAmJiBsaW5lV2lkZ2V0c1tzdGFydFJvd10uY29sdW1uICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBpZiAoZGVsdGEuc3RhcnQuY29sdW1uID4gbGluZVdpZGdldHNbc3RhcnRSb3ddLmNvbHVtbilcbiAgICAgICAgICAgICAgICAgICAgc3RhcnRSb3crKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGFyZ3MudW5zaGlm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mV3IEFycmF5KHRoaXMuc2Vzc2lvbi5nZXRMZW5ndGgoKSk7XG4gICAgICAgIHZhciBvbGQgPSB0aGlzLnNlc3Npb24ubGluZVdpZGdldHNbdy5yb3ddO1xuICAgICAgICBpZiAob2xkKSB7XG4gICAgICAgICAgICB3LiRvbGRXaWRnZXQgPSBvbGQ7XG4gICAgICAgICAgICBpZiAob2xkLmVsICYmIG9sZC5lbC5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgICAgICAgb2xkLmVsLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQob2xkLmVsKTtcbiAgICAgICAgICAgICAgICBvbGQuX2luRG9jdW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNlc3Npb24ubGluZVdpZGdldHNbdy5yb3ddID0gdztcbiAgICAgICAgcmV0dXJuIHc7XG4gICAgfTtcbiAgICBMaW5lV2lkZ2V0cy5wcm90b3R5cGUuYWRkTGluZVdpZGdldCA9IGZ1bmN0aW9uICh3KSB7XG4gICAgICAgIHRoaXMuJHJlZ2lzdGVyTGluZVdpZGdldCh3KTtcbiAgICAgICAgdy5zZXNzaW9uID0gdGhpcy5zZXNzaW9uO1xuICAgICAgICBpZiAoIXRoaXMuZWRpdG9yKVxuICAgICAgICAgICAgcmV0dXJuIHc7XG4gICAgICAgIHZhciByZW5kZXJlciA9IHRoaXMuZWRpdG9yLnJlbmRlcmVyO1xuICAgICAgICBpZiAody5odG1sICYmICF3LmVsKSB7XG4gICAgICAgICAgICB3LmVsID0gZG9tLmNyZWF0ZUVsZW1lbnQoXCJkaXZcIik7XG4gICAgICAgICAgICB3LmVsLmlubmVySFRNTCA9IHcuaHRtbDtcbiAgICAgICAgfVxuICAgICAgICBpZiAody50ZXh0ICYmICF3LmVsKSB7XG4gICAgICAgICAgICB3LmVsID0gZG9tLmNyZWF0ZUVsZW1lbnQoXCJkaXZcIik7XG4gICAgICAgICAgICB3LmVsLnRleHRDb250ZW50ID0gdy50ZXh0O1xuICAgICAgICB9XG4gICAgICAgIGlmICh3LmVsKSB7XG4gICAgICAgICAgICBkb20uYWRkQ3NzQ2xhc3Mody5lbCwgXCJhY2VfbGluZVdpZGdldENvbnRhaW5lclwiKTtcbiAgICAgICAgICAgIGlmICh3LmNsYXNzTmFtZSkge1xuICAgICAgICAgICAgICAgIGRvbS5hZGRDc3NDbGFzcyh3LmVsLCB3LmNsYXNzTmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB3LmVsLnN0eWxlLnBvc2l0aW9uID0gXCJhYnNvbHV0ZVwiO1xuICAgICAgICAgICAgdy5lbC5zdHlsZS56SW5kZXggPSBcIjVcIjtcbiAgICAgICAgICAgIHJlbmRlcmVyLmNvbnRhaW5lci5hcHBlbmRDaGlsZCh3LmVsKTtcbiAgICAgICAgICAgIHcuX2luRG9jdW1lbnQgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKCF3LmNvdmVyR3V0dGVyKSB7XG4gICAgICAgICAgICAgICAgdy5lbC5zdHlsZS56SW5kZXggPSBcIjNcIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh3LnBpeGVsSGVpZ2h0ID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICB3LnBpeGVsSGVpZ2h0ID0gdy5lbC5vZmZzZXRIZWlnaHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHcucm93Q291bnQgPT0gbnVsbCkge1xuICAgICAgICAgICAgdy5yb3dDb3VudCA9IHcucGl4ZWxIZWlnaHQgLyByZW5kZXJlci5sYXllckNvbmZpZy5saW5lSGVpZ2h0O1xuICAgICAgICB9XG4gICAgICAgIHZhciBmb2xkID0gdGhpcy5zZXNzaW9uLmdldEZvbGRBdCh3LnJvdywgMCk7XG4gICAgICAgIHcuJGZvbGQgPSBmb2xkO1xuICAgICAgICBpZiAoZm9sZCkge1xuICAgICAgICAgICAgdmFyIGxpbmVXaWRnZXRzID0gdGhpcy5zZXNzaW9uLmxpbmVXaWRnZXRzO1xuICAgICAgICAgICAgaWYgKHcucm93ID09IGZvbGQuZW5kLnJvdyAmJiAhbGluZVdpZGdldHNbZm9sZC5zdGFydC5yb3ddKVxuICAgICAgICAgICAgICAgIGxpbmVXaWRnZXRzW2ZvbGQuc3RhcnQucm93XSA9IHc7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgdy5oaWRkZW4gPSB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuc2Vzc2lvbi5fZW1pdChcImNoYW5nZUZvbGRcIiwgeyBkYXRhOiB7IHN0YXJ0OiB7IHJvdzogdy5yb3cgfSB9IH0pO1xuICAgICAgICB0aGlzLiR1cGRhdGVSb3dzKCk7XG4gICAgICAgIHRoaXMucmVuZGVyV2lkZ2V0cyhudWxsLCByZW5kZXJlcik7XG4gICAgICAgIHRoaXMub25XaWRnZXRDaGFuZ2VkKHcpO1xuICAgICAgICByZXR1cm4gdztcbiAgICB9O1xuICAgIExpbmVXaWRnZXRzLnByb3RvdHlwZS5yZW1vdmVMaW5lV2lkZ2V0ID0gZnVuY3Rpb24gKHcpIHtcbiAgICAgICAgdy5faW5Eb2N1bWVudCA9IGZhbHNlO1xuICAgICAgICB3LnNlc3Npb24gPSBudWxsO1xuICAgICAgICBpZiAody5lbCAmJiB3LmVsLnBhcmVudE5vZGUpXG4gICAgICAgICAgICB3LmVsLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQody5lbCk7XG4gICAgICAgIGlmICh3LmVkaXRvciAmJiB3LmVkaXRvci5kZXN0cm95KVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB3LmVkaXRvci5kZXN0cm95KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaCAoZSkgeyB9XG4gICAgICAgIGlmICh0aGlzLnNlc3Npb24ubGluZVdpZGdldHMpIHtcbiAgICAgICAgICAgIHZhciB3MSA9IHRoaXMuc2Vzc2lvbi5saW5lV2lkZ2V0c1t3LnJvd107XG4gICAgICAgICAgICBpZiAodzEgPT0gdykge1xuICAgICAgICAgICAgICAgIHRoaXMuc2Vzc2lvbi5saW5lV2lkZ2V0c1t3LnJvd10gPSB3LiRvbGRXaWRnZXQ7XG4gICAgICAgICAgICAgICAgaWYgKHcuJG9sZFdpZGdldClcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vbldpZGdldENoYW5nZWQody4kb2xkV2lkZ2V0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHdoaWxlICh3MSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodzEuJG9sZFdpZGdldCA9PSB3KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3MS4kb2xkV2lkZ2V0ID0gdy4kb2xkV2lkZ2V0O1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdzEgPSB3MS4kb2xkV2lkZ2V0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNlc3Npb24uX2VtaXQoXCJjaGFuZ2VGb2xkXCIsIHsgZGF0YTogeyBzdGFydDogeyByb3c6IHcucm93IH0gfSB9KTtcbiAgICAgICAgdGhpcy4kdXBkYXRlUm93cygpO1xuICAgIH07XG4gICAgTGluZVdpZGdldHMucHJvdG90eXBlLmdldFdpZGdldHNBdFJvdyA9IGZ1bmN0aW9uIChyb3cpIHtcbiAgICAgICAgdmFyIGxpbmVXaWRnZXRzID0gdGhpcy5zZXNzaW9uLmxpbmVXaWRnZXRzO1xuICAgICAgICB2YXIgdyA9IGxpbmVXaWRnZXRzICYmIGxpbmVXaWRnZXRzW3Jvd107XG4gICAgICAgIHZhciBsaXN0ID0gW107XG4gICAgICAgIHdoaWxlICh3KSB7XG4gICAgICAgICAgICBsaXN0LnB1c2godyk7XG4gICAgICAgICAgICB3ID0gdy4kb2xkV2lkZ2V0O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBsaXN0O1xuICAgIH07XG4gICAgTGluZVdpZGdldHMucHJvdG90eXBlLm9uV2lkZ2V0Q2hhbmdlZCA9IGZ1bmN0aW9uICh3KSB7XG4gICAgICAgIHRoaXMuc2Vzc2lvbi5fY2hhbmdlZFdpZGdldHMucHVzaCh3KTtcbiAgICAgICAgdGhpcy5lZGl0b3IgJiYgdGhpcy5lZGl0b3IucmVuZGVyZXIudXBkYXRlRnVsbCgpO1xuICAgIH07XG4gICAgTGluZVdpZGdldHMucHJvdG90eXBlLm1lYXN1cmVXaWRnZXRzID0gZnVuY3Rpb24gKGUsIHJlbmRlcmVyKSB7XG4gICAgICAgIHZhciBjaGFuZ2VkV2lkZ2V0cyA9IHRoaXMuc2Vzc2lvbi5fY2hhbmdlZFdpZGdldHM7XG4gICAgICAgIHZhciBjb25maWcgPSByZW5kZXJlci5sYXllckNvbmZpZztcbiAgICAgICAgaWYgKCFjaGFuZ2VkV2lkZ2V0cyB8fCAhY2hhbmdlZFdpZGdldHMubGVuZ3RoKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB2YXIgbWluID0gSW5maW5pdHk7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY2hhbmdlZFdpZGdldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHZhciB3ID0gY2hhbmdlZFdpZGdldHNbaV07XG4gICAgICAgICAgICBpZiAoIXcgfHwgIXcuZWwpXG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICBpZiAody5zZXNzaW9uICE9IHRoaXMuc2Vzc2lvbilcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIGlmICghdy5faW5Eb2N1bWVudCkge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLnNlc3Npb24ubGluZVdpZGdldHNbdy5yb3ddICE9IHcpXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIHcuX2luRG9jdW1lbnQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHJlbmRlcmVyLmNvbnRhaW5lci5hcHBlbmRDaGlsZCh3LmVsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHcuaCA9IHcuZWwub2Zmc2V0SGVpZ2h0O1xuICAgICAgICAgICAgaWYgKCF3LmZpeGVkV2lkdGgpIHtcbiAgICAgICAgICAgICAgICB3LncgPSB3LmVsLm9mZnNldFdpZHRoO1xuICAgICAgICAgICAgICAgIHcuc2NyZWVuV2lkdGggPSBNYXRoLmNlaWwody53IC8gY29uZmlnLmNoYXJhY3RlcldpZHRoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciByb3dDb3VudCA9IHcuaCAvIGNvbmZpZy5saW5lSGVpZ2h0O1xuICAgICAgICAgICAgaWYgKHcuY292ZXJMaW5lKSB7XG4gICAgICAgICAgICAgICAgcm93Q291bnQgLT0gdGhpcy5zZXNzaW9uLmdldFJvd0xpbmVDb3VudCh3LnJvdyk7XG4gICAgICAgICAgICAgICAgaWYgKHJvd0NvdW50IDwgMClcbiAgICAgICAgICAgICAgICAgICAgcm93Q291bnQgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHcucm93Q291bnQgIT0gcm93Q291bnQpIHtcbiAgICAgICAgICAgICAgICB3LnJvd0NvdW50ID0gcm93Q291bnQ7XG4gICAgICAgICAgICAgICAgaWYgKHcucm93IDwgbWluKVxuICAgICAgICAgICAgICAgICAgICBtaW4gPSB3LnJvdztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWluICE9IEluZmluaXR5KSB7XG4gICAgICAgICAgICB0aGlzLnNlc3Npb24uX2VtaXQoXCJjaGFuZ2VGb2xkXCIsIHsgZGF0YTogeyBzdGFydDogeyByb3c6IG1pbiB9IH0g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xuICAgICAgICAgICAgICAgIHcuZWwuc3R5bGUudG9wID0gLTEwMCAtICh3LnBpeGVsSGVpZ2h0IHx8IDApICsgXCJweFwiO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCF3Ll9pbkRvY3VtZW50KSB7XG4gICAgICAgICAgICAgICAgdy5faW5Eb2N1bWVudCA9IHRydWU7XG4gICAgICAgICAgICAgICAgcmVuZGVyZXIuY29udGFpbmVyLmFwcGVuZENoaWxkKHcuZWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHRvcCA9IHJlbmRlcmVyLiRjdXJzb3JMYXllci5nZXRQaXhlbFBvc2l0aW9uKHsgcm93OiBpLCBjb2x1bW46IDAgfSwgdHJ1ZSkudG9wO1xuICAgICAgICAgICAgaWYgKCF3LmNvdmVyTGluZSlcbiAgICAgICAgICAgICAgICB0b3AgKz0gY29uZmlnLmxpbmVIZWlnaHQgKiB0aGlzLnNlc3Npb24uZ2V0Um93TGluZUNvdW50KHcucm93KTtcbiAgICAgICAgICAgIHcuZWwuc3R5bGUudG9wID0gdG9wIC0gY29uZmlnLm9mZnNldCArIFwicHhcIjtcbiAgICAgICAgICAgIHZhciBsZWZ0ID0gdy5jb3Zlckd1dHRlciA/IDAgOiByZW5kZXJlci5ndXR0ZXJXaWR0aDtcbiAgICAgICAgICAgIGlmICghdy5maXhlZFdpZHRoKVxuICAgICAgICAgICAgICAgIGxlZnQgLT0gcmVuZGVyZXIuc2Nyb2xsTGVmdDtcbiAgICAgICAgICAgIHcuZWwuc3R5bGUubGVmdCA9IGxlZnQgKyBcInB4XCI7XG4gICAgICAgICAgICBpZiAody5mdWxsV2lkdGggJiYgdy5zY3JlZW5XaWR0aCkge1xuICAgICAgICAgICAgICAgIHcuZWwuc3R5bGUubWluV2lkdGggPSBjb25maWcud2lkdGggKyAyICogY29uZmlnLnBhZGRpbmcgKyBcInB4XCI7XG4gICAgICAgICA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cy4kYmx1ckd1dHRlci5iaW5kKHRoaXMpKTtcbiAgICB9O1xuICAgIEd1dHRlcktleWJvYXJkSGFuZGxlci5wcm90b3R5cGUuJG9uR3V0dGVyS2V5RG93biA9IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgIGlmICh0aGlzLmFubm90YXRpb25Ub29sdGlwLmlzT3Blbikge1xuICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgaWYgKGUua2V5Q29kZSA9PT0ga2V5c1tcImVzY2FwZVwiXSlcbiAgICAgICAgICAgICAgICB0aGlzLmFubm90YXRpb25Ub29sdGlwLmhpZGVUb29sdGlwKCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGUudGFyZ2V0ID09PSB0aGlzLmVsZW1lbnQpIHtcbiAgICAgICAgICAgIGlmIChlLmtleUNvZGUgIT0ga2V5c1tcImVudGVyXCJdKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgdmFyIHJvdyA9IHRoaXMuZWRpdG9yLmdldEN1cnNvclBvc2l0aW9uKCkucm93O1xuICAgICAgICAgICAgaWYgKCF0aGlzLmVkaXRvci5pc1Jvd1Zpc2libGUocm93KSlcbiAgICAgICAgICAgICAgICB0aGlzLmVkaXRvci5zY3JvbGxUb0xpbmUocm93LCB0cnVlLCB0cnVlKTtcbiAgICAgICAgICAgIHNldFRpbWVvdXQoXG4gICAgICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gdGhpcy4kcm93VG9Sb3dJbmRleCh0aGlzLmd1dHRlckxheWVyLiRjdXJzb3JDZWxsLnJvdyk7XG4gICAgICAgICAgICAgICAgdmFyIG5lYXJlc3RGb2xkSW5kZXggPSB0aGlzLiRmaW5kTmVhcmVzdEZvbGRXaWRnZXQoaW5kZXgpO1xuICAgICAgICAgICAgICAgIHZhciBuZWFyZXN0QW5ub3RhdGlvbkluZGV4ID0gdGhpcy4kZmluZE5lYXJlc3RBbm5vdGF0aW9uKGluZGV4KTtcbiAgICAgICAgICAgICAgICBpZiAobmVhcmVzdEZvbGRJbmRleCA9PT0gbnVsbCAmJiBuZWFyZXN0QW5ub3RhdGlvbkluZGV4ID09PSBudWxsKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgaWYgKG5lYXJlc3RGb2xkSW5kZXggPT09IG51bGwgJiYgbmVhcmVzdEFubm90YXRpb25JbmRleCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmFjdGl2ZVJvd0luZGV4ID0gbmVhcmVzdEFubm90YXRpb25JbmRleDtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hY3RpdmVMYW5lID0gXCJhbm5vdGF0aW9uXCI7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJGZvY3VzQW5ub3RhdGlvbih0aGlzLmFjdGl2ZVJvd0luZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAobmVhcmVzdEZvbGRJbmRleCAhPT0gbnVsbCAmJiBuZWFyZXN0QW5ub3RhdGlvbkluZGV4ID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYWN0aXZlUm93SW5kZXggPSBuZWFyZXN0Rm9sZEluZGV4O1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmFjdGl2ZUxhbmUgPSBcImZvbGRcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy4kZm9jdXNGb2xkV2lkZ2V0KHRoaXMuYWN0aXZlUm93SW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChNYXRoLmFicyhuZWFyZXN0QW5ub3RhdGlvbkluZGV4IC0gaW5kZXgpIDwgTWF0aC5hYnMobmVhcmVzdEZvbGRJbmRleCAtIGluZGV4KSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmFjdGl2ZVJvd0luZGV4ID0gbmVhcmVzdEFubm90YXRpb25JbmRleDtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hY3RpdmVMYW5lID0gXCJhbm5vdGF0aW9uXCI7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJGZvY3VzQW5ub3RhdGlvbih0aGlzLmFjdGl2ZVJvd0luZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hY3RpdmVSb3dJbmRleCA9IG5lYXJlc3RGb2xkSW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYWN0aXZlTGFuZSA9IFwiZm9sZFwiO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLiRmb2N1c0ZvbGRXaWRnZXQodGhpcy5hY3RpdmVSb3dJbmRleCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LmJpbmQodGhpcyksIDEwKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLiRoYW5kbGVHdXR0ZXJLZXlib2FyZEludGVyYWN0aW9uKGUpO1xuICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHRoaXMuZWRpdG9yLl9zaWduYWwoXCJndXR0ZXJrZXlkb3duXCIsIG5ldyBHdXR0ZXJLZXlib2FyZEV2ZW50KGUsIHRoaXMpKTtcbiAgICAgICAgfS5iaW5kKHRoaXMpLCAxMCk7XG4gICAgfTtcbiAgICBHdXR0ZXJLZXlib2FyZEhhbmRsZXIucHJvdG90eXBlLiRoYW5kbGVHdXR0ZXJLZXlib2FyZEludGVyYWN0aW9uID0gZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgaWYgKGUua2V5Q29kZSA9PT0ga2V5c1tcInRhYlwiXSkge1xuICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChlLmtleUNvZGUgPT09IGtleXNbXCJlc2NhcGVcIl0pIHtcbiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgIHRoaXMuJGJsdXJHdXR0ZXIoKTtcbiAgICAgICAgICAgIHRoaXMuZWxlbWVudC5mb2N1cygpO1xuICAgICAgICAgICAgdGhpcy5sYW5lID0gbnVsbDtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZS5rZXlDb2RlID09PSBrZXlzW1widXBcIl0pIHtcbiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgIHN3aXRjaCAodGhpcy5hY3RpdmVMYW5lKSB7XG4gICAgICAgICAgICAgICAgY2FzZSBcImZvbGRcIjpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy4kbW92ZUZvbGRXaWRnZXRVcCgpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIFwiYW5ub3RhdGlvblwiOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLiRtb3ZlQW5ub3RhdGlvblVwKCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChlLmtleUNvZGUgPT09IGtleXNbXCJkb3duXCJdKSB7XG4gICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICBzd2l0Y2ggKHRoaXMuYWN0aXZlTGFuZSkge1xuICAgICAgICAgICAgICAgIGNhc2UgXCJmb2xkXCI6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJG1vdmVGb2xkV2lkZ2V0RG93bigpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIFwiYW5ub3RhdGlvblwiOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLiRtb3ZlQW5ub3RhdGlvbkRvd24oKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGUua2V5Q29kZSA9PT0ga2V5c1tcImxlZnRcIl0pIHtcbiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgIHRoaXMuJHN3aXRjaExhbmUoXCJhbm5vdGF0aW9uXCIpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChlLmtleUNvZGUgPT09IGtleXNbXCJyaWdodFwiXSkge1xuICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgdGhpcy4kc3dpdGNoTGFuZShcImZvbGRcIik7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGUua2V5Q29kZSA9PT0ga2V5c1tcImVudGVyXCJdIHx8IGUua2V5Q29kZSA9PT0ga2V5c1tcInNwYWNlXCJdKSB7XG4gICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICBzd2l0Y2ggKHRoaXMuYWN0aXZlTGFuZSkge1xuICAgICAgICAgICAgICAgIGNhc2UgXCJmb2xkXCI6XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmd1dHRlckxheWVyLnNlc3Npb24uZm9sZFdpZGdldHNbdGhpcy4kcm93SW5kZXhUb1Jvdyh0aGlzLmFjdGl2ZVJvd0luZGV4KV0gPT09ICdzdGFydCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByb3dGb2xkaW5nV2lkZ2V0ID0gdGhpcy4kcm93SW5kZXhUb1Jvdyh0aGlzLmFjdGl2ZVJvd0luZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZWRpdG9yLnNlc3Npb24ub25Gb2xkV2lkZ2V0Q2xpY2sodGhpcy4kcm93SW5kZXhUb1Jvdyh0aGlzLmFjdGl2ZVJvd0luZGV4KSwgZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLiRyb3dJbmRleFRvUm93KHRoaXMuYWN0aXZlUm93SW5kZXgpICE9PSByb3dGb2xkaW5nV2lkZ2V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuJGJsdXJGb2xkV2lkZ2V0KHRoaXMuYWN0aXZlUm93SW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmFjdGl2ZVJvd0luZGV4ID0gdGhpcy4kcm93VG9Sb3dJbmRleChyb3dGb2xkaW5nV2lkZ2V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy4kZm9jdXNGb2xkV2lkZ2V0KHRoaXMuYWN0aXZlUm93SW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0uYmluZCh0aGlzKSwgMTApO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodGhpcy5ndXR0ZXJMYXllci5zZXNzaW9uLmZvbGRXaWRnZXRzW3RoaXMuJHJvd0luZGV4VG9Sb3codGhpcy5hY3RpdmVSb3dJbmRleCldID09PSAnZW5kJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIGNhc2UgXCJhbm5vdGF0aW9uXCI6XG4gICAgICAgICAgICAgICAgICAgIHZhciBndXR0ZXJFbGVtZW50ID0gdGhpcy5saW5lcy5jZWxsc1t0aGlzLmFjdGl2ZVJvd0luZGV4XS5lbGVtZW50LmNoaWxkTm9kZXNbMl07XG4gICAgICAgICAgICAgICAgICAgIHZhciByZWN0ID0gZ3V0dGVyRWxlbWVudC5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0eWxlID0gdGhpcy5hbm5vdGF0aW9uVG9vbHRpcC5nZXRFbGVtZW50KCkuc3R5bGU7XG4gICAgICAgICAgICAgICAgICAgIHN0eWxlLmxlZnQgPSByZWN0LnJpZ2h0ICsgXCJweFwiO1xuICAgICAgICAgICAgICAgICAgICBzdHlsZS50b3AgPSByZWN0LmJvdHRvbSArIFwicHhcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hbm5vdGF0aW9uVG9vbHRpcC5zaG93VG9vbHRpcCh0aGlzLiRyb3dJbmRleFRvUm93KHRoaXMuYWN0aXZlUm93SW5kZXgpKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICB9O1xuICAgIEd1dHRlcktleWJvYXJkSGFuZGxlci5wcm90b3R5cGUuJGJsdXJHdXR0ZXIgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLmFjdGl2ZVJvd0luZGV4ICE9PSBudWxsKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHRoaXMuYWN0aXZlTGFuZSkge1xuICAgICA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md0aCgpIC0gMSkge1xuICAgICAgICAgICAgaSsrO1xuICAgICAgICAgICAgaWYgKGluZGV4IC0gaSA+PSAwICYmIHRoaXMuJGlzRm9sZFdpZGdldFZpc2libGUoaW5kZXggLSBpKSlcbiAgICAgICAgICAgICAgICByZXR1cm4gaW5kZXggLSBpO1xuICAgICAgICAgICAgaWYgKGluZGV4ICsgaSA8PSB0aGlzLmxpbmVzLmdldExlbmd0aCgpIC0gMSAmJiB0aGlzLiRpc0ZvbGRXaWRnZXRWaXNpYmxlKGluZGV4ICsgaSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIGluZGV4ICsgaTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9O1xuICAgIEd1dHRlcktleWJvYXJkSGFuZGxlci5wcm90b3R5cGUuJGZpbmROZWFyZXN0QW5ub3RhdGlvbiA9IGZ1bmN0aW9uIChpbmRleCkge1xuICAgICAgICBpZiAodGhpcy4kaXNBbm5vdGF0aW9uVmlzaWJsZShpbmRleCkpXG4gICAgICAgICAgICByZXR1cm4gaW5kZXg7XG4gICAgICAgIHZhciBpID0gMDtcbiAgICAgICAgd2hpbGUgKGluZGV4IC0gaSA+IDAgfHwgaW5kZXggKyBpIDwgdGhpcy5saW5lcy5nZXRMZW5ndGgoKSAtIDEpIHtcbiAgICAgICAgICAgIGkrKztcbiAgICAgICAgICAgIGlmIChpbmRleCAtIGkgPj0gMCAmJiB0aGlzLiRpc0Fubm90YXRpb25WaXNpYmxlKGluZGV4IC0gaSkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIGluZGV4IC0gaTtcbiAgICAgICAgICAgIGlmIChpbmRleCArIGkgPD0gdGhpcy5saW5lcy5nZXRMZW5ndGgoKSAtIDEgJiYgdGhpcy4kaXNBbm5vdGF0aW9uVmlzaWJsZShpbmRleCArIGkpKVxuICAgICAgICAgICAgICAgIHJldHVybiBpbmRleCArIGk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51b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pdmVSb3dJbmRleDtcbiAgICAgICAgd2hpbGUgKGluZGV4IDwgdGhpcy5saW5lcy5nZXRMZW5ndGgoKSAtIDEpIHtcbiAgICAgICAgICAgIGluZGV4Kys7XG4gICAgICAgICAgICBpZiAodGhpcy4kaXNGb2xkV2lkZ2V0VmlzaWJsZShpbmRleCkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiRibHVyRm9sZFdpZGdldCh0aGlzLmFjdGl2ZVJvd0luZGV4KTtcbiAgICAgICAgICAgICAgICB0aGlzLmFjdGl2ZVJvd0luZGV4ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgdGhpcy4kZm9jdXNGb2xkV2lkZ2V0KHRoaXMuYWN0aXZlUm93SW5kZXgpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm47XG4gICAgfTtcbiAgICBHdXR0ZXJLZXlib2FyZEhhbmRsZXIucHJvdG90eXBlLiRtb3ZlQW5ub3RhdGlvblVwID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgaW5kZXggPSB0aGlzLmFjdGl2ZVJvd0luZGV4O1xuICAgICAgICB3aGlsZSAoaW5kZXggPiAwKSB7XG4gICAgICAgICAgICBpbmRleC0tO1xuICAgICAgICAgICAgaWYgKHRoaXMuJGlzQW5ub3RhdGlvblZpc2libGUoaW5kZXgpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy4kYmx1ckFubm90YXRpb24odGhpcy5hY3RpdmVSb3dJbmRleCk7XG4gICAgICAgICAgICAgICAgdGhpcy5hY3RpdmVSb3dJbmRleCA9IGluZGV4O1xuICAgICAgICAgICAgICAgIHRoaXMuJGZvY3VzQW5ub3RhdGlvbih0aGlzLmFjdGl2ZVJvd0luZGV4KTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuO1xuICAgIH07XG4gICAgR3V0dGVyS2V5Ym9hcmRIYW5kbGVyLnByb3RvdHlwZS4kbW92ZUFubm90YXRpb25Eb3duID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgaW5kZXggPSB0aGlzLmFjdGl2ZVJvd0luZGV4O1xuICAgICAgICB3aGlsZSAoaW5kZXggPCB0aGlzLmxpbmVzLmdldExlbmd0aCgpIC0gMSkge1xuICAgICAgICAgICAgaW5kZXgrKztcbiAgICAgICAgICAgIGlmICh0aGlzLiRpc0Fubm90YXRpb25WaXNpYmxlKGluZGV4KSkge1xuICAgICAgICAgICAgICAgIHRoaXMuJGJsdXJBbm5vdGF0aW9uKHRoaXMuYWN0aXZlUm93SW5kZXgpO1xuICAgICAgICAgICAgICAgIHRoaXMuYWN0aXZlUm93SW5kZXggPSBpbmRleDtcbiAgICAgICAgICAgICAgICB0aGlzLiRmb2N1c0Fubm90YXRpb24odGhpcy5hY3RpdmVSb3dJbmRleCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybjtcbiAgICB9O1xuICAgIEd1dHRlcktleWJvYXJkSGFuZGxlci5wcm90b3R5cGUuJHN3aXRjaExhbmUgPSBmdW5jdGlvbiAoZGVzaW5hdGlvbkxhbmUpIHtcbiAgICAgICAgc3dpdGNoIChkZXNpbmF0aW9uTGFuZSkge1xuICAgICAgICAgICAgY2FzZSBcImFubm90YXRpb25cIjpcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5hY3RpdmVMYW5lID09PSBcImFubm90YXRpb25cIikge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGFubm90YXRpb25JbmRleCA9IHRoaXMuJGZpbmROZWFyZXN0QW5ub3RhdGlvbih0aGlzLmFjdGl2ZVJvd0luZGV4KTtcbiAgICAgICAgICAgICAgICBpZiAoYW5ub3RhdGlvbkluZGV4ID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuYWN0aXZlTGFuZSA9IFwiYW5ub3RhdGlvblwiO1xuICAgICAgICAgICAgICAgIHRoaXMuJGJsdXJGb2xkV2lkZ2V0KHRoaXMuYWN0aXZlUm93SW5kZXgpO1xuICAgICAgICAgICAgICAgIHRoaXMuYWN0aXZlUm93SW5kZXggPSBhbm5vdGF0aW9uSW5kZXg7XG4gICAgICAgICAgICAgICAgdGhpcy4kZm9jdXNBbm5vdGF0aW9uKHRoaXMuYWN0aXZlUm93SW5kZXgpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBcImZvbGRcIjpcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5hY3RpdmVMYW5lID09PSBcImZvbGRcIikge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGZvbGRXaWRnZXRJbmRleCA9IHRoaXMuJGZpbmROZWFyZXN0Rm9sZFdpZGdldCh0aGlzLmFjdGl2ZVJvd0luZGV4KTtcbiAgICAgICAgICAgICAgICBpZiAoZm9sZFdpZGdldEluZGV4ID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuYWN0aXZlTGFuZSA9IFwiZm9sZFwiO1xuICAgICAgICAgICAgICAgIHRoaXMuJGJsdXJBbm5vdGF0aW9uKHRoaXMuYWN0aXZlUm93SW5kZXgpO1xuICAgICAgICAgICAgICAgIHRoaXMuYWN0aXZlUm93SW5kZXggPSBmb2xkV2lkZ2V0SW5kZXg7XG4gICAgICAgICAgICAgICAgdGhpcy4kZm9jdXNGb2xkV2lkZ2V0KHRoaXMuYWN0aXZlUm93SW5kZXgpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICA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biAgICAgICAgICAgICAgICBzd2l0Y2ggKHNjcm9sbEludG9WaWV3KSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgXCJjZW50ZXItYW5pbWF0ZVwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgc2Nyb2xsSW50b1ZpZXcgPSBcImFuaW1hdGVcIjtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBcImNlbnRlclwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5zY3JvbGxDdXJzb3JJbnRvVmlldyhudWxsLCAwLjUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgXCJhbmltYXRlXCI6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgXCJjdXJzb3JcIjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIuc2Nyb2xsQ3Vyc29ySW50b1ZpZXcoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIFwic2VsZWN0aW9uUGFydFwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJhbmdlID0gdGhpcy5zZWxlY3Rpb24uZ2V0UmFuZ2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb25maWcgPSB0aGlzLnJlbmRlcmVyLmxheWVyQ29uZmlnO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJhbmdlLnN0YXJ0LnJvdyA+PSBjb25maWcubGFzdFJvdyB8fCByYW5nZS5lbmQucm93IDw9IGNvbmZpZy5maXJzdFJvdykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIuc2Nyb2xsU2VsZWN0aW9uSW50b1ZpZXcodGhpcy5zZWxlY3Rpb24uYW5jaG9yLCB0aGlzLnNlbGVjdGlvbi5sZWFkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChzY3JvbGxJbnRvVmlldyA9PSBcImFuaW1hdGVcIilcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5hbmltYXRlU2Nyb2xsaW5nKHRoaXMuY3VyT3Auc2Nyb2xsVG9wKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBzZWwgPSB0aGlzLnNlbGVjdGlvbi50b0pTT04oKTtcbiAgICAgICAgICAgIHRoaXMuY3VyT3Auc2VsZWN0aW9uQWZ0ZXIgPSBzZWw7XG4gICAgICAgICAgICB0aGlzLiRsYXN0U2VsID0gdGhpcy5zZWxlY3Rpb24udG9KU09OKCk7XG4gICAgICAgICAgICB0aGlzLnNlc3Npb24uZ2V0VW5kb01hbmFnZXIoKS5hZGRTZWxlY3Rpb24oc2VsKTtcbiAgICAgICAgICAgIHRoaXMucHJldk9wID0gdGhpcy5jdXJPcDtcbiAgICAgICAgICAgIHRoaXMuY3VyT3AgPSBudWxsO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBFZGl0b3IucHJvdG90eXBlLiRoaXN0b3J5VHJhY2tlciA9IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgIGlmICghdGhpcy4kbWVyZ2VVbmRvRGVsdGFzKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB2YXIgcHJldiA9IHRoaXMucHJldk9wO1xuICAgICAgICB2YXIgbWVyZ2VhYmxlQ29tbWFuZHMgPSB0aGlzLiRtZXJnZWFibGVDb21tYW5kcztcbiAgICAgICAgdmFyIHNob3VsZE1lcmdlID0gcHJldi5jb21tYW5kICYmIChlLmNvbW1hbmQubmFtZSA9PSBwcmV2LmNvbW1hbmQubmFtZSk7XG4gICAg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ICAgICAgICAgcmFuZ2VzID0gc2Vzc2lvbi4kbW9kZS5nZXRNYXRjaGluZyhzZWxmLnNlc3Npb24pO1xuICAgICAgICAgICAgaWYgKCFyYW5nZXMpIHtcbiAgICAgICAgICAgICAgICBpZiAoc2VsZi5nZXRIaWdobGlnaHRJbmRlbnRHdWlkZXMoKSlcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5yZW5kZXJlci4kdGV4dExheWVyLiRoaWdobGlnaHRJbmRlbnRHdWlkZSgpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBtYXJrZXJUeXBlID0gXCJhY2VfYnJhY2tldFwiO1xuICAgICAgICAgICAgaWYgKCFBcnJheS5pc0FycmF5KHJhbmdlcykpIHtcbiAgICAgICAgICAgICAgICByYW5nZXMgPSBbcmFuZ2VzXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHJhbmdlcy5sZW5ndGggPT0gMSkge1xuICAgICAgICAgICAgICAgIG1hcmtlclR5cGUgPSBcImFjZV9lcnJvcl9icmFja2V0XCI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocmFuZ2VzLmxlbmd0aCA9PSAyKSB7XG4gICAgICAgICAgICAgICAgaWYgKFJhbmdlLmNvbXBhcmVQb2ludHMocmFuZ2VzWzBdLmVuZCwgcmFuZ2VzWzFdLnN0YXJ0KSA9PSAwKVxuICAgICAgICAgICAgICAgICAgICByYW5nZXMgPSBbUmFuZ2UuZnJvbVBvaW50cyhyYW5nZXNbMF0uc3RhcnQsIHJhbmdlc1sxXS5lbmQpXTtcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChSYW5nZS5jb21wYXJlUG9pbnRzKHJhbmdlc1swXS5zdGFydCwgcmFuZ2VzWzFdLmVuZCkgPT0gMClcbiAgICAgICAgICAgICAgICAgICAgcmFuZ2VzID0gW1JhbmdlLmZyb21Qb2ludHMocmFuZ2VzWzFdL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B5V2l0aEVtcHR5U2VsZWN0aW9uKSB7XG4gICAgICAgICAgICBjb3B5TGluZSA9IHRydWU7XG4gICAgICAgICAgICB2YXIgcmFuZ2VzID0gdGhpcy5zZWxlY3Rpb24uZ2V0QWxsUmFuZ2VzKCk7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHJhbmdlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIHZhciByYW5nZSA9IHJhbmdlc1tpXTtcbiAgICAgICAgICAgICAgICBpZiAoaSAmJiByYW5nZXNbaSAtIDFdLnN0YXJ0LnJvdyA9PSByYW5nZS5zdGFydC5yb3cpXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIHRleHQgKz0gdGhpcy5zZXNzaW9uLmdldExpbmUocmFuZ2Uuc3RhcnQucm93KSArIG5sO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhciBlID0geyB0ZXh0OiB0ZXh0IH07XG4gICAgICAgIHRoaXMuX3NpZ25hbChcImNvcHlcIiwgZSk7XG4gICAgICAgIGNsaXBib2FyZC5saW5lTW9kZSA9IGNvcHlMaW5lID8gZS50ZXh0IDogZmFsc2U7XG4gICAgICAgIHJldHVybiBlLnRleHQ7XG4gICAgfTtcbiAgICBFZGl0b3IucHJvdG90eXBlLm9uQ29weSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy5jb21tYW5kcy5leGVjKFwiY29weVwiLCB0aGlzKTtcbiAgICB9O1xuICAgIEVkaXRvci5wcm90b3R5cGUub25DdXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHRoaXMuY29tbWFuZHMuZXhlYyhcImN1dFwiLCB0aGlzKTtcbiAgICB9O1xuICAgIEVkaXRvci5wcm90b3R5cGUub25QYXN0ZSA9IGZ1bmN0aW9uICh0ZXh0LCBldmVudCkge1xuICAgICAgICB2YXIgZSA9IHsgdGV4dDogdGV4dCwgZXZlb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ciByb3cgPSBzdGFydFJvdzsgcm93IDw9IGVuZFJvdzsgcm93KyspIHtcbiAgICAgICAgICAgICAgICBpZiAocm93ID4gMCkge1xuICAgICAgICAgICAgICAgICAgICBwcmV2TGluZVN0YXRlID0gc2Vzc2lvbi5nZXRTdGF0ZShyb3cgLSAxKTtcbiAgICAgICAgICAgICAgICAgICAgcHJldkxpbmUgPSBzZXNzaW9uLmdldExpbmUocm93IC0gMSk7XG4gICAgICAgICAgICAgICAgICAgIGxpbmVJbmRlbnQgPSBtb2RlLmdldE5leHRMaW5lSW5kZW50KHByZXZMaW5lU3RhdGUsIHByZXZMaW5lLCB0YWIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgbGluZSA9IHNlc3Npb24uZ2V0TGluZShyb3cpO1xuICAgICAgICAgICAgICAgIHZhciBjdXJySW5kZW50ID0gbW9kZS4kZ2V0SW5kZW50KGxpbmUpO1xuICAgICAgICAgICAgICAgIGlmIChsaW5lSW5kZW50ICE9PSBjdXJySW5kZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjdXJySW5kZW50Lmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByYW5nZSA9IG5ldyBSYW5nZShyb3csIDAsIHJvdywgY3VyckluZGVudC5sZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi5yZW1vdmUocmFuZ2UpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChsaW5lSW5kZW50Lmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb24uaW5zZXJ0KHsgcm93OiByb3csIGNvbHVtbjogMCB9LCBsaW5lSW5kZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBtb2RlLmF1dG9PdXRkZW50KHByZXZMaW5lU3RhdGUsIH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W50Um93cyhyb3dzLmZpcnN0LCByb3dzLmxhc3QsIFwiXFx0XCIpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB2YXIgbGluZSA9IHNlc3Npb24uZ2V0TGluZShyYW5nZS5zdGFydC5yb3cpO1xuICAgICAgICB2YXIgcG9zaXRpb24gPSByYW5nZS5zdGFydDtcbiAgICAgICAgdmFyIHNpemUgPSBzZXNzaW9uLmdldFRhYlNpemUoKTtcbiAgICAgICAgdmFyIGNvbHVtbiA9IHNlc3Npb24uZG9jdW1lbnRUb1NjcmVlbkNvbHVtbihwb3NpdGlvbi5yb3csIHBvc2l0aW9uLmNvbHVtbik7XG4gICAgICAgIGlmICh0aGlzLnNlc3Npb24uZ2V0VXNlU29mdFRhYnMoKSkge1xuICAgICAgICAgICAgdmFyIGNvdW50ID0gKHNpemUgLSBjb2x1bW4gJSBzaXplKTtcbiAgICAgICAgICAgIHZhciBpbmRlbnRTdHJpbmcgPSBsYW5nLnN0cmluZ1JlcGVhdChcIiBcIiwgY291bnQpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdmFyIGNvdW50ID0gY29sdW1uICUgc2l6ZTtcbiAgICAgICAgICAgIHdoaWxlIChsaW5lW3JhbmdlLnN0YXJ0LmNvbHVtbiAtIDFdID09IFwiIFwiICYmIGNvdW50KSB7XG4gICAgICAgICAgICAgICAgcmFuZ2Uuc3RhcnQuY29sdW1uLS07XG4gICAgICAgICAgICAgICAgY291bnQtLTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuc2VsZWN0aW9uLnNldFNlbGVjdGlvblJhbmdlKHJhbmdlKTtcbiAgICAgICAgICAgIGluZGVudFN0cmluZyA9IFwiXFx0XCI7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0KGluZGVudFN0cmluZyk7XG4gICAgfTtcbiAgICBFZGl0b3I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uUmFuZ2UoKTtcbiAgICAgICAgdGhpcy5zZXNzaW9uLmdldE1vZGUoKS50b2dnbGVCbG9ja0NvbW1lbnQoc3RhdGUsIHRoaXMuc2Vzc2lvbiwgcmFuZ2UsIGN1cnNvcik7XG4gICAgfTtcbiAgICBFZGl0b3IucHJvdG90eXBlLmdldE51bWJlckF0ID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7XG4gICAgICAgIHZhciBfbnVtYmVyUnggPSAvW1xcLV0/WzAtOV0rKD86XFwuWzAtOV0rKT8vZztcbiAgICAgICAgX251bWJlclJ4Lmxhc3RJbmRleCA9IDA7XG4gICAgICAgIHZhciBzID0gdGhpcy5zZXNzaW9uLmdldExpbmUocm93KTtcbiAgICAgICAgd2hpbGUgKF9udW1iZXJSeC5sYXN0SW5kZXggPCBjb2x1bW4pIHtcbiAgICAgICAgICAgIHZhciBtID0gX251bWJlclJ4LmV4ZWMocyk7XG4gICAgICAgICAgICBpZiAobS5pbmRleCA8PSBjb2x1bW4gJiYgbS5pbmRleCArIG1bMF0ubGVuZ3RoID49IGNvbHVtbikge1xuICAgICAgICAgICAgICAgIHZhciBudW1iZXIgPSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiBtWzBdLFxuICAgICAgICAgICAgICAgICAgICBzdGFydDogbS5pbmRleCxcbiAgICAgICAgICAgICAgICAgICAgZW5kOiBtLmluZGV4ICsgbVswXS5sZW5ndGhcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfTtcbiAgICBFZGl0b3IucHJvdG90eXBlLm1vZGlmeU51bWJlciA9IGZ1bmN0aW9uIChhbW91bnQpIHtcbiAgICAgICAgdmFyIHJvdyA9IHRoaXMuc2VsZWN0aW9uLmdldEN1cnNvcigpLnJvdztcbiAgICAgICAgdmFyIGNvbHVtbiA9IHRoaXMuc2VsZWN0aW9uLmdldEN1cnNvcigpLmNvbHVtbjtcbiAgICAgICAgdmFyIGNoYXJSYW5nZSA9IG5ldyBSYW5nZShyb3csIGNvbHVtbiAtIDEsIHJvdywgY29sdW1uKTtcbiAgICAgICAgdmFyIGMgPSB0aGlzLnNlc3Npb24uZ2V0VGV4dFJhbmdlKGNoYXJSYW5nZSk7XG4gICAgICAgIGlmICghaXNOYU4ocGFyc2VGbG9hdChjKSkgJiYgaXNGaW5pdGUoYykpIHtcbiAgICAgICAgICAgIHZhciBuciA9IHRoaXMuZ2V0TnVtYmVyQXQocm93LCBjb2x1bW4pO1xuICAgICAgICAgICAgaWYgKG5yKSB7XG4gICAgICAgICAgICAgICAgdmFyIGZwID0gbnIudmFsdWUuaW5kZXhPZihcIi5cIikgPj0gMCA/IG5yLnN0YXJ0ICsgbnIudmFsdWUuaW5kZXhPZihcIi5cIikgKyAxIDogbnIuZW5kO1xuICAgICAgICAgICAgICAgIHZhciBkZWNpbWFscyA9IG5yLnN0YXJ0ICsgbnIudmFsdWUubGVuZ3RoIC0gZnA7XG4gICAgICAgICAgICAgICAgdmFyIHQgPSBwYXJzZUZsb2F0KG5yLnZhbHVlKTtcbiAgICAgICAgICAgICAgICB0ICo9IE1hdGgucG93KDEwLCBkZWNpbWFscyk7XG4gICAgICAgICAgICAgICAgaWYgKGZwICE9PSBuci5lbmQgJiYgY29sdW1uIDwgZnApIHtcbiAgICAgICAgICAgICAgICAgICAgYW1vdW50ICo9IE1hdGgucG93KDEwLCBuci5lbmQgLSBjb2x1bW4gLSAxKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGFtb3VudCAqPSBNYXRoLnBvdygxMCwgbnIuZW5kIC0gY29sdW1uKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdCArPSBhbW91bnQ7XG4gICAgICAgICAgICAgICAgdCAvPSBNYXRoLnBvdygxMCwgZG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iAtIGN1cnJXb3JkU3RhcnQgLSAxO1xuICAgICAgICBpZiAoZGVsdGEgPCAwKVxuICAgICAgICAgICAgZGVsdGEgPSAwO1xuICAgICAgICB2YXIgY3VyTGVuZ3RoID0gMCwgaXRMZW5ndGggPSAwO1xuICAgICAgICB2YXIgdGhhdCA9IHRoaXM7XG4gICAgICAgIGlmIChjdXJyZW50U3RhdGUubWF0Y2goL1tBLVphLXowLTlfXSsvKSkge1xuICAgICAgICAgICAgd29yZFBhcnRzLmZvckVhY2goZnVuY3Rpb24gKGl0ZW0sIGkpIHtcbiAgICAgICAgICAgICAgICBpdExlbmd0aCA9IGN1ckxlbmd0aCArIGl0ZW0ubGVuZ3RoO1xuICAgICAgICAgICAgICAgIGlmIChkZWx0YSA+PSBjdXJMZW5ndGggJiYgZGVsdGEgPD0gaXRMZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudFN0YXRlID0gaXRlbTtcbiAgICAgICAgICAgICAgICAgICAgdGhhdC5zZWxlY3Rpb24uY2xlYXJTZWxlY3Rpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgdGhhdC5tb3ZlQ3Vyc29yVG8ocm93LCBjdXJMZW5ndGggKyBjdXJyV29yZFN0YXJ0KTtcbiAgICAgICAgICAgICAgICAgICAgdGhhdC5zZWxlY3Rpb24uc2VsZWN0VG8ocm93LCBpdExlbmd0aCArIGN1cnJXb3JkU3RhcnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjdXJMZW5ndGggPSBpdExlbmd0aDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHZhciB3b3JkUGFpcnMgPSB0aGlzLiR0b2dnbGVXb3JkUGFpcnM7XG4gICAgICAgIHZhciByZWc7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgd29yZFBhaXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgaXRlbSA9IHdvcmRQYWlyc1tpXTtcbiAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDw9IDE7IGorKykge1xuICAgICAgICAgICAgICAgIHZhciBuZWdhdGUgPSArIWo7XG4gICAgICAgICAgICAgICAgdmFyIGZpcnN0Q29uZGl0aW9uID0gY3VycmVudFN0YXRlLm1hdGNoKG5ldyBSZWdFeHAoJ15cXFxccz9fPygnICsgbGFuZy5lc2NhcGVSZWdFeHAoaXRlbVtqXSkgKyAnKVxcXFxzPyQnLCAnaScpKTtcbiAgICAgICAgICAgICAgICBpZiAoZmlyc3RDb25kaXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNlY29uZENvbmRpdGlvbiA9IGN1cnJlbnRTdGF0ZS5tYXRjaChuZXcgUmVnRXhwKCcoW19dfF58XFxcXHMpKCcgKyBsYW5nLmVzY2FwZVJlZ0V4cChmaXJzdENvbmRpdGlvblsxXSkgKyAnKSgkfFxcXFxzKScsICdnJykpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoc2Vjb25kQ29uZGl0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWcgPSBjdXJyZW50U3RhdGUucmVwbGFjZShuZXcgUmVnRXhwKGxhbmcuZXNjYXBlUmVnRXhwKGl0ZW1bal0pLCAnaScpLCBmdW5jdGlvbiAocmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IGl0ZW1bbmVnYXRlXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0LnRvVXBwZXJDYXNlKCkgPT0gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcyA9IHJlcy50b1VwcGVyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChyZXN1bHQuY2hhckF0KDApLnRvVXBwZXJDYXNlKCkgPT0gcmVzdWx0LmNoYXJBdCgwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMgPSByZXMuc3Vic3RyKDAsIDApICsgaXRlbVtuZWdhdGVdLmNoYXJBdCgwKS50b1VwcGVyQ2FzZSgpICsgcmVzLnN1YnN0cigxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlcztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5pbnNlcnQocmVnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZyA9IFwiXCI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIEVkaXRvci5wcm90b3R5cGUuZmluZExpbmtBdCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikge1xuICAgICAgICB2YXIgZV8xLCBfYTtcbiAgICAgICAgdmFyIGxpbmUgPSB0aGlzLnNlc3Npb24uZ2V0TGluZShyb3cpO1xuICAgICAgICB2YXIgd29yZFBhcnRzID0gbGluZS5zcGxpdCgvKCg/Omh0dHBzP3xmdHApOlxcL1xcL1tcXFNdKykvKTtcbiAgICAgICAgdmFyIGNvbHVtblBvc2l0aW9uID0gY29sdW1uO1xuICAgICAgICBpZiAoY29sdW1uUG9zaXRpb24gPCAwKVxuICAgICAgICAgICAgY29sdW1uUG9zaXRpb24gPSAwO1xuICAgICAgICB2YXIgcHJldmlvdXNQb3NpdGlvbiA9IDAsIGN1cnJlbnRQb3NpdGlvbiA9IDAsIG1hdGNoO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgZm9yICh2YXIgd29yZFBhcnRzXzEgPSBfX3ZhbHVlcyh3b3JkUGFydHMpLCB3b3JkUGFydHNfMV8xID0gd29yZFBhcnRzXzEubmV4dCgpOyAhd29yZFBhcnRzXzFfMS5kb25lOyB3b3JkUGFydHNfMV8xID0gd29yZFBhcnRzXzEubmV4dCgpKSB7XG4gICAgICAgICAgICAgICAgdmFyIGl0ZW0gPSB3b3JkUGFydHNfMV8xLnZhbHVlO1xuICAgICAgICAgICAgICAgIGN1cnJlbnRQb3NpdGlvbiA9IHByZXZpb3VzUG9zaXRpb24gKyBpdGVtLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZiAoY29sdW1uUG9zaXRpb24gPj0gcHJldmlvdXNQb3NpdGlvbiAmJiBjb2x1bW5Qb3NpdGlvbiA8PSBjdXJyZW50UG9zaXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW0ubWF0Y2goLygoPzpodHRwcz98ZnRwKTpcXC9cXC9bXFxTXSspLykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hdGNoID0gaXRlbS5yZXBsYWNlKC9bXFxzOi4sJ1wiO31cXF1dKyQvLCBcIlwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHByZXZpb3VzUG9zaXRpb24gPSBjdXJyZW50UG9zaXRpb247XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY2F0Y2ggKGVfMV8xKSB7IGVfMSA9IHsgZXJyb3I6IGVfMV8xIH07IH1cbiAgICAgICAgZmluYWxseSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIGlmICh3b3JkUGFydHNfMV8xICYmICF3b3JkUGFydHNfMV8xLmRvbmUgJiYgKF9hID0gd29yZFBhcnRzXzEucmV0dXJuKSkgX2EuY2FsbCh3b3JkUGFydHNfMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmaW5hbGx5IHsgaWYgKGVfMSkgdGhyb3cgZV8xLmVycm9yOyB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG1hdGNoO1xuICAgIH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ICAgICAgICAgcmFuZ2VzW2ldLm1vdmVCeShkaWZmLCAwKTtcbiAgICAgICAgICAgICAgICByb3dzID0gdGhpcy4kZ2V0U2VsZWN0ZWRSb3dzKHJhbmdlc1tpXSk7XG4gICAgICAgICAgICAgICAgdmFyIGZpcnN0ID0gcm93cy5maXJzdDtcbiAgICAgICAgICAgICAgICB2YXIgbGFzdCA9IHJvd3MubGFzdDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoKytpIDwgbCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodG90YWxEaWZmKVxuICAgICAgICAgICAgICAgICAgICAgICAgcmFuZ2VzW2ldLm1vdmVCeSh0b3RhbERpZmYsIDApO1xuICAgICAgICAgICAgICAgICAgICB2YXIgc3ViUm93cyA9IHRoaXMuJGdldFNlbGVjdGVkUm93cyhyYW5nZXNbaV0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29weSAmJiBzdWJSb3dzLmZpcnN0ICE9IGxhc3QpXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWNvcHkgJiYgc3ViUm93cy5maXJzdCA+IGxhc3QgKyAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGxhc3QgPSBzdWJSb3dzLmxhc3Q7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGktLTtcbiAgICAgICAgICAgICAgICBkaWZmID0gdGhpcy5zZXNzaW9uLiRtb3ZlTGluZXMoZmlyc3QsIGxhc3QsIGNvcHkgPyAwIDogZGlyKTtcbiAgICAgICAgICAgICAgICBpZiAoY29weSAmJiBkaXIgPT0gLTEpXG4gICAgICAgICAgICAgICAgICAgIHJhbmdlSW5kZXggPSBpICsgMTtcbiAgICAgICAgICAgICAgICB3aGlsZSAocmFuZ2VJbmRleCA8PSBpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJhbmdlc1tyYW5nZ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ICAgICAgdmFyIHRva2VuID0gcHJldlRva2VuIHx8IGl0ZXJhdG9yLnN0ZXBGb3J3YXJkKCk7XG4gICAgICAgIGlmICghdG9rZW4pXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIHZhciBtYXRjaFR5cGU7XG4gICAgICAgIHZhciBmb3VuZCA9IGZhbHNlO1xuICAgICAgICB2YXIgZGVwdGggPSB7fTtcbiAgICAgICAgdmFyIGkgPSBjdXJzb3IuY29sdW1uIC0gdG9rZW4uc3RhcnQ7XG4gICAgICAgIHZhciBicmFja2V0VHlwZTtcbiAgICAgICAgdmFyIGJyYWNrZXRzID0ge1xuICAgICAgICAgICAgXCIpXCI6IFwiKFwiLFxuICAgICAgICAgICAgXCIoXCI6IFwiKFwiLFxuICAgICAgICAgICAgXCJdXCI6IFwiW1wiLFxuICAgICAgICAgICAgXCJbXCI6IFwiW1wiLFxuICAgICAgICAgICAgXCJ7XCI6IFwie1wiLFxuICAgICAgICAgICAgXCJ9XCI6IFwie1wiXG4gICAgICAgIH07XG4gICAgICAgIGRvIHtcbiAgICAgICAgICAgIGlmICh0b2tlbi52YWx1ZS5tYXRjaCgvW3t9KClcXFtcXF1dL2cpKSB7XG4gICAgICAgICAgICAgICAgZm9yICg7IGkgPCB0b2tlbi52YWx1ZS5sZW5ndGggJiYgIWZvdW5kOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFicmFja2V0c1t0b2tlbi52YWx1ZVtpXV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGJyYWNrZXRUeXBlID0gYnJhY2tldHNbdG9rZW4udmFsdWVbaV1dICsgJy4nICsgdG9rZW4udHlwZS5yZXBsYWNlKFwicnBhcmVuXCIsIFwibHBhcmVuXCIpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNOYU4oZGVwdGhbYnJhY2tldFR5cGVdKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVwdGhbYnJhY2tldFR5cGVdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHRva2VuLnZhbHVlW2ldKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICcoJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ1snOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAneyc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVwdGhbYnJhY2tldFR5cGVdKys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICcpJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ10nOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnfSc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVwdGhbYnJhY2tldFR5cGVdLS07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRlcHRoW2JyYWNrZXRUeXBlXSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2hUeXBlID0gJ2JyYWNrZXQnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodG9rZW4udHlwZS5pbmRleE9mKCd0YWctbmFtZScpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgIGlmIChpc05hTihkZXB0aFt0b2tlbi52YWx1ZV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlcHRoW3Rva2VuLnZhbHVlXSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChwcmV2VG9rZW4udmFsdWUgPT09ICc8JyAmJiB0b2tlbkNvdW50ID4gMSkge1xuICAgICAgICAgICAgICAgICAgICBkZXB0aFt0b2tlbi52YWx1ZV0rKztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAocHJldlRva2VuLnZhbHVlID09PSAnPC8nKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlcHRoW3Rva2VuLnZhbHVlXS0tO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoZGVwdGhbdG9rZW4udmFsdWVdID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICBtYXRjaFR5cGUgPSAndGFnJztcbiAgICAgICAgICAgICAgICAgICAgZm91bmQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghZm91bmQpIHtcbiAgICAgICAgICAgICAgICBwcmV2VG9rZW4gPSB0b2tlbjtcbiAgICAgICAgICAgICAgICB0b2tlbkNvdW50Kys7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSBpdGVyYXRvci5zdGVwRm9yd2FyZCgpO1xuICAgICAgICAgICAgICAgIGkgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IHdoaWxlICh0b2tlbiAmJiAhZm91bmQpO1xuICAgICAgICBpZiAoIW1hdGNoVHlwZSlcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgdmFyIHJhbmdlLCBwb3M7XG4gICAgICAgIGlmIChtYXRjaFR5cGUgPT09ICdicmFja2V0Jykge1xuICAgICAgICAgICAgcmFuZ2UgPSB0aGlzLnNlc3Npb24uZ2V0QnJhY2tldFJhbmdlKGN1cnNvcik7XG4gICAgICAgICAgICBpZiAoIXJhbmdlKSB7XG4gICAgICAgICAgICAgICAgcmFuZ2UgPSBuZXcgUmFuZ2UoaXRlcmF0b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ICAgICAgICBpZiAodGFnc1Jhbmdlcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGFnc1Jhbmdlcy5vcGVuVGFnLmNvbnRhaW5zKGN1cnNvci5yb3csIGN1cnNvci5jb2x1bW4pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByYW5nZSA9IHRhZ3NSYW5nZXMuY2xvc2VUYWc7XG4gICAgICAgICAgICAgICAgICAgICAgICBwb3MgPSByYW5nZS5zdGFydDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJhbmdlID0gdGFnc1Jhbmdlcy5vcGVuVGFnO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRhZ3NSYW5nZXMuY2xvc2VUYWcuc3RhcnQucm93ID09PSBjdXJzb3Iucm93ICYmIHRhZ3NSYW5nZXMuY2xvc2VUYWcuc3RhcnQuY29sdW1uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPT09IGN1cnNvci5jb2x1bW4pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zID0gcmFuZ2UuZW5kO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcyA9IHJhbmdlLnN0YXJ0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcG9zID0gcG9zIHx8IHJhbmdlLnN0YXJ0O1xuICAgICAgICB9XG4gICAgICAgIHBvcyA9IHJhbmdlICYmIHJhbmdlLmN1cnNvciB8fCBwb3M7XG4gICAgICAgIGlmIChwb3MpIHtcbiAgICAgICAgICAgIGlmIChzZWxlY3QpIHtcbiAgICAgICAgICAgICAgICBpZiAocmFuZ2UgJiYgZXhwYW5kKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0aW9uLnNldFJhbmdlKH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nRvcCAtIGNvbmZpZy5vZmZzZXQ7XG4gICAgICAgICAgICAgICAgaWYgKHBvcy50b3AgPj0gMCAmJiB0b3AgKyByZWN0LnRvcCA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgc2hvdWxkU2Nyb2xsID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAocG9zLnRvcCA8IGNvbmZpZy5oZWlnaHQgJiZcbiAgICAgICAgICAgICAgICAgICAgcG9zLnRvcCArIHJlY3QudG9wICsgY29uZmlnLmxpbmVIZWlnaHQgPiB3aW5kb3cuaW5uZXJIZWlnaHQpIHtcbiAgICAgICAgICAgICAgICAgICAgc2hvdWxkU2Nyb2xsID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzaG91bGRTY3JvbGwgPSBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc2hvdWxkU2Nyb2xsICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgc2Nyb2xsQW5jaG9yLnN0eWxlLnRvcCA9IHRvcCArIFwicHhcIjtcbiAgICAgICAgICAgICAgICAgICAgc2Nyb2xsQW5jaG9yLnN0eWxlLmxlZnQgPSBwb3MubGVmdCArIFwicHhcIjtcbiAgICAgICAgICAgICAgICAgICAgc2Nyb2xsQW5jaG9yLnN0eWxlLmhlaWdodCA9IGNvbmZpZy5saW5lSGVpZ2h0ICsgXCJweFwiO1xuICAgICAgICAgICAgICAgICAgICBzY3JvbGxBbmNob3Iuc2Nyb2xsSW50b1ZpZXcoc2hvdWxkU2Nyb2xsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc2hvdWxkU2Nyb2xsID0gcmVjdCA9IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnNldEF1dG9TY3Jvb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md0aCA+IDApO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaGFzVmFsdWUgJiYgdGhpcy5yZW5kZXJlci5wbGFjZWhvbGRlck5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIub2ZmKFwiYWZ0ZXJSZW5kZXJcIiwgdGhpcy4kdXBkYXRlUGxhY2Vob2xkZXIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZG9tLnJlbW92ZUNzc0NsYXNzKHRoaXMuY29udGFpbmVyLCBcImFjZV9oYXNQbGFjZWhvbGRlclwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIucGxhY2Vob2xkZXJOb2RlLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5wbGFjZWhvbGRlck5vZGUgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFoYXNWYWx1ZSAmJiAhdGhpcy5yZW5kZXJlci5wbGFjZWhvbGRlck5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIub24oXCJhZnRlclJlbmRlclwiLCB0aGlzLiR1cGRhdGVQbGFjZWhvbGRlcik7XG4gICAgICAgICAgICAgICAgICAgICAgICBkb20uYWRkQ3NzQ2xhc3ModGhpcy5jb250YWluZXIsIFwiYWNlX2hhc1BsYWNlaG9sZGVyXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsID0gZG9tLmNyZWF0ZUVsZW1lbnQoXCJkaXZcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbC5jbGFzc05hbWUgPSBcImFjZV9wbGFjZWhvbGRlclwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWwudGV4dENvbnRlbnQgPSB0aGlzLiRwbGFjZWhvbGRlciB8fCBcIlwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5wbGFjZWhvbGRlck5vZGUgPSBlbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIuY29udGVudC5hcHBlbmRDaGlsZCh0aGlzLnJlbmRlcmVyLnBsYWNlaG9sZGVyTm9kZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWhhc1ZhbHVlICYmIHRoaXMucmVuZGVyZXIucGxhY2Vob2xkZXJOb2RlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJlbmRlcmVyLnBsYWNlaG9sZGVyTm9kZS50ZXh0Q29udGVudCA9IHRoaXMuJHBsYWNlaG9sZGVyIHx8IFwiXCI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LmJpbmQodGhpcyk7XG4gICAgICAgICAgICAgICAgdGhpcy5vbihcImlucHV0XCIsIHRoaXMuJHVwZGF0ZVBsYWNlaG9sZGVyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuJHVwZGF0ZVBsYWNlaG9sZGVyKCk7XG4gICAgICAgIH1cbiAgICB9LFxuICAgIGVuYWJsZUtleWJvYXJkQWNjZXNzaWJpbGl0eToge1xuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdmFyIGJsdXJDb21tYW5kID0ge1xuICAgICAgICAgICAgICAgIG5hbWU6IFwiYmx1clRleHRJbnB1dFwiLFxuICAgICAgICAgICAgICAgIGRlc2NyaXB0aW9uOiBcIlNldCBmb2N1cyB0byB0aGUgZWRpdG9yIGNvbnRlbnQgZGl2IHRvIGFsbG93IHRhYmJpbmcgdGhyb3VnaCB0aGUgcGFnZVwiLFxuICAgICAgICAgICAgICAgIGJpbmRLZXk6IFwiRXNjXCIsXG4gICAgICAgICAgICAgICAgZXhlYzogZnVuY3Rpb24gKGVkaXRvcikge1xuICAgICAgICAgICAgICAgICAgICBlZGl0b3IuYmx1cigpO1xuICAgICAgICAgICAgICAgICAgICBlZGl0b3IucmVuZGVyZXIuc2Nyb2xsZXIuZm9jdXMoKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHJlYWRPbmx5OiB0cnVlXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgdmFyIGZvY3VzT25FbnRlcktleXVwID0gZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICBpZiAoZS50YXJnZXQgPT0gdGhpcy5yZW5kZXJlci5zY3JvbGxlciAmJiBlLmtleUNvZGUgPT09IGtleXNbJ2VudGVyJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcm93ID0gdGhpcy5nZXRDdXJzb3JQb3NpdGlvbigpLnJvdztcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmlzUm93VmlzaWJsZShyb3cpKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zY3JvbGxUb0xpbmUocm93LCB0cnVlLCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5mb2N1cygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB2YXIgZ3V0dGVyS2V5Ym9hcmRIYW5kbGVyO1xuICAgICAgICAgICAgaWYgKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5lbmFibGVLZXlib2FyZEFjY2Vzc2liaWxpdHkgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIua2V5Ym9hcmRGb2N1c0NsYXNzTmFtZSA9IFwiYWNlX2tleWJvYXJkLWZvY3VzXCI7XG4gICAgICAgICAgICAgICAgdGhpcy50ZXh0SW5wdXQuZ2V0RWxlbWVudCgpLnNldEF0dHJpYnV0ZShcInRhYmluZGV4XCIsI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YXkuaXNBcnJheShjZWxsKSkge1xuICAgICAgICAgICAgdGhpcy5jZWxscy51bnNoaWZ0LmFwcGx5KHRoaXMuY2VsbHMsIGNlbGwpO1xuICAgICAgICAgICAgdmFyIGZyYWdtZW50ID0gZG9tLmNyZWF0ZUZyYWdtZW50KHRoaXMuZWxlbWVudCk7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNlbGwubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBmcmFnbWVudC5hcHBlbmRDaGlsZChjZWxsW2ldLmVsZW1lbnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRoaXMuZWxlbWVudC5maXJzdENoaWxkKVxuICAgICAgICAgICAgICAgIHRoaXMuZWxlbWVudC5pbnNlcnRCZWZvcmUoZnJhZ21lbnQsIHRoaXMuZWxlbWVudC5maXJzdENoaWxkKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICB0aGlzLmVsZW1lbnQuYXBwZW5kQ2hpbGQoZnJhZ21lbnQpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jZWxscy51bnNoaWZ0KGNlbGwpO1xuICAgICAgICAgICAgdGhpcy5lbGVtZW50Lmluc2VydEFkamFjZW50RWxlbWVudChcImFmdGVyYmVnaW5cIiwgY2VsbC5lbGVtZW50KTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgTGluZXMucHJvdG90eXBlLmxhc3QgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICh0aGlzLmNlbGxzLmxlbmd0aClcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmNlbGxzW3RoaXMuY2VsbHMubGVuZ3RoIC0gMV07XG4gICAgICAgIGVsc2VcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgIH07XG4gICAgTGluZXMucHJvdG90eXBlLiRjYWNoZUNlbGwgPSBmdW5jdGlvbiAoY2VsbCkge1xuICAgICAgICBpZiAoIWNlbGwpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIGNlbGwuZWxlbWVudC5yZW1vdmUoKTtcbiAgICAgICAgdGhpcy5jZWxsQ2FjaGUucHVzaChjZWxsKTtcbiAgICB9O1xuICAgIExpbmVzLnByb3RvdHlwZS5jcmVhdGVDZWxsID0gZnVuY3Rpb24gKHJvdywgY29uZmlnLCBzZXNzaW9uLCBpbml0RWxlbWVudCkge1xuICAgICAgICB2YXIgY2VsbCA9IHRoaXMuY2VsbENhY2hlLnBvcCgpO1xuICAgICAgICBpZiAoIWNlbGwpIHtcbiAgICAgICAgICAgIHZhciBlbGVtZW50ID0gZG9tLmNyZWF0ZUVsZW1lbnQoXCJkaXZcIik7XG4gICAgICAgICAgICBpZiAoaW5pdEVsZW1lbnQpXG4gICAgICAgICAgICAgICAgaW5pdEVsZW1lbnQoZWxlbWVudCk7XG4gICAgICAgICAgICB0aGlzLmVsZW1lbnQuYXBwZW5kQ2hpbGQoZWxlbWVudCk7XG4gICAgICAgICAgICBjZWxsID0ge1xuICAgICAgICAgICAgICAgIGVsZW1lbnQ6IGVsZW1lbnQsXG4gICAgICAgICAgICAgICAgdGV4dDogXCJcIixcbiAgICAgICAgICAgICAgICByb3c6IHJvd1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBjZWxsLnJvdyA9IHJvdztcbiAgICAgICAgcmV0dXJuIGNlbGw7XG4gICAgfTtcbiAgICByZXR1cm4gTGluZXM7XG59KCkpO1xuZXhwb3J0cy5MaW5lcyA9IExpbmVzO1xuXG59KTtcblxuYWNlLmRlZmluZShcImFjZS9sYXllci9ndXR0ZXJcIixbXCJyZXF1aXJlXCIsXCJleHBvcnRzXCIsXCJtb2R1bGVcIixcImFjZS9saWIvZG9tXCIsXCJhY2UvbGliL29vcFwiLFwiYWNlL2xpYi9sYW5nXCIsXCJhY2UvbGliL2V2ZW50X2VtaXR0ZXJcIixcImFjZS9sYXllci9saW5lc1wiLFw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lKTtcbiAgICB9O1xuICAgIEd1dHRlci5wcm90b3R5cGUuc2V0QW5ub3RhdGlvbnMgPSBmdW5jdGlvbiAoYW5ub3RhdGlvbnMpIHtcbiAgICAgICAgdGhpcy4kYW5ub3RhdGlvbnMgPSBbXTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhbm5vdGF0aW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGFubm90YXRpb24gPSBhbm5vdGF0aW9uc1tpXTtcbiAgICAgICAgICAgIHZhciByb3cgPSBhbm5vdGF0aW9uLnJvdztcbiAgICAgICAgICAgIHZhciByb3dJbmZvID0gdGhpcy4kYW5ub3RhdGlvbnNbcm93XTtcbiAgICAgICAgICAgIGlmICghcm93SW5mbylcbiAgICAgICAgICAgICAgICByb3dJbmZvID0gdGhpcy4kYW5ub3RhdGlvbnNbcm93XSA9IHsgdGV4dDogW10sIHR5cGU6IFtdIH07XG4gICAgICAgICAgICB2YXIgYW5ub1RleHQgPSBhbm5vdGF0aW9uLnRleHQ7XG4gICAgICAgICAgICB2YXIgYW5ub1R5cGUgPSBhbm5vdGF0aW9uLnR5cGU7XG4gICAgICAgICAgICBhbm5vVGV4dCA9IGFubm9UZXh0ID8gbGFuZy5lc2NhcGVIVE1MKGFubm9UZXh0KSA6IGFubm90YXRpb24uaHRtbCB8fCBcIlwiO1xuICAgICAgICAgICAgaWYgKHJvd0luZm8udGV4dC5pbmRleE9mKGFubm9UZXh0KSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICByb3dJbmZvLnRleHQucHVzaChhbm5vVGV4dCk7XG4gICAgICAgICAgICAgICAgcm93SW5mby50eXBlLnB1c2goYW5ub1R5cGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGNsYXNzTmFtZSA9IGFubm90YXRpb24uY2xhc3NOYW1lO1xuICAgICAgICAgICAgaWYgKGNsYXNzTmFtZSlcbiAgICAgICAgICAgICAgICByb3dJbmZvLmNsY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gZm9sZC5lbmQucm93ICsgMTtcbiAgICAgICAgICAgICAgICBmb2xkID0gc2Vzc2lvbi5nZXROZXh0Rm9sZExpbmUocm93LCBmb2xkKTtcbiAgICAgICAgICAgICAgICBmb2xkU3RhcnQgPSBmb2xkID8gZm9sZC5zdGFydC5yb3cgOiBJbmZpbml0eTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChyb3cgPiBsYXN0Um93KSB7XG4gICAgICAgICAgICAgICAgd2hpbGUgKHRoaXMuJGxpbmVzLmdldExlbmd0aCgpID4gaW5kZXggKyAxKVxuICAgICAgICAgICAgICAgICAgICB0aGlzLiRsaW5lcy5wb3AoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNlbGwgPSB0aGlzLiRsaW5lcy5nZXQoKytpbmRleCk7XG4gICAgICAgICAgICBpZiAoY2VsbCkge1xuICAgICAgICAgICAgICAgIGNlbGwucm93ID0gcm93O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgY2VsbCA9IHRoaXMuJGxpbmVzLmNyZWF0ZUNlbGwocm93LCBjb25maWcsIHRoaXMuc2Vzc2lvbiwgb25DcmVhdGVDZWxsKTtcbiAgICAgICAgICAgICAgICB0aGlzLiRsaW5lcy5wdXNoKGNlbGwpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy4kcmVuZGVyQ2VsbChjZWxsLCBjb25maWcsIGZvbGQsIHJvdyk7XG4gICAgICAgICAgICByb3crKztcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9zaWduYWwoXCJhZnRlclJlbmRlclwiKTtcbiAgICAgICAgdGhpcy4kdXBkYXRlR3V0dGVyV2lkdGgoY29uZmlnKTtcbiAgICB9O1xuICAgIEd1dHRlci5wcm90b3R5cGUuJHVwZGF0ZUd1dHRlcldpZHRoID0gZnVuY3Rpb24gKGNvbmZpZykge1xuICAgICAgICB2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WUgPSB0aGlzLiRjdXJzb3JDZWxsLmVsZW1lbnQuY2xhc3NOYW1lLnJlcGxhY2UoXCJhY2VfZ3V0dGVyLWFjdGl2ZS1saW5lIFwiLCBcIlwiKTtcbiAgICAgICAgdmFyIGNlbGxzID0gdGhpcy4kbGluZXMuY2VsbHM7XG4gICAgICAgIHRoaXMuJGN1cnNvckNlbGwgPSBudWxsO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNlbGxzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgY2VsbCA9IGNlbGxzW2ldO1xuICAgICAgICAgICAgaWYgKGNlbGwucm93ID49IHRoaXMuJGN1cnNvclJvdykge1xuICAgICAgICAgICAgICAgIGlmIChjZWxsLnJvdyA+IHRoaXMuJGN1cnNvclJvdykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZm9sZCA9IHRoaXMuc2Vzc2lvbi5nZXRGb2xkTGluZSh0aGlzLiRjdXJzb3JSb3cpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaSA+IDAgJiYgZm9sZCAmJiBmb2xkLnN0YXJ0LnJvdyA9PSBjZWxsc1tpIC0gMV0ucm93KVxuICAgICAgICAgICAgICAgICAgICAgICAgY2VsbCA9IGNlbGxzW2kgLSAxXTtcbiAgICAgICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNlbGwuZWxlbWVudC5jbGFzc05hbWUgPSBcImFjZV9ndXR0ZXItYWN0aXZlLWxpbmUgXCIgKyBjZWxsLmVsZW1lbnQuY2xhc3NOYW1lO1xuICAgICAgICAgICAgICAgIHRoaXMuJGN1cnNvckNlbGwgPSBjZWxsO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICBHdXR0ZXIucHJvdG90eXBlLnNjcm9sbExpbmVzID0g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mUocm93KTtcbiAgICAgICAgdmFyIGZvbGRTdGFydCA9IGZvbGRMaW5lID8gZm9sZExpbmUuc3RhcnQucm93IDogSW5maW5pdHk7XG4gICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICBpZiAocm93ID4gZm9sZFN0YXJ0KSB7XG4gICAgICAgICAgICAgICAgcm93ID0gZm9sZExpbmUuZW5kLnJvdyArIDE7XG4gICAgICAgICAgICAgICAgZm9sZExpbmUgPSB0aGlzLnNlc3Npb24uZ2V0TmV4dEZvbGRMaW5lKHJvdywgZm9sZExpbmUpO1xuICAgICAgICAgICAgICAgIGZvbGRTdGFydCA9IGZvbGRMaW5lID8gZm9sZExpbmUuc3RhcnQucm93IDogSW5maW5pdHk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocm93ID4gbGFzdFJvdylcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIHZhciBjZWxsID0gdGhpcy4kbGluZXMuY3JlYXRlQ2VsbChyb3csIGNvbmZpZywgdGhpcy5zZXNzaW9uLCBvbkNyZWF0ZUNlbGwpO1xuICAgICAgICAgICAgdGhpcy4kcmVuZGVyQ2VsbChjZWxsLCBjb25maWcsIGZvbGRMaW5lLCByb3cpO1xuICAgICAgICAgICAgZnJhZ21lbnQucHVzaChjZWxsKTtcbiAgICAgICAgICAgIHJvdysrO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmcmFnbWVudDtcbiAgICB9O1xuICAgIEd1dHRlci5wcm90b3R5cGUuJHJlbmRlckNlbGwgPSBmdW5jdGlvbiAoY2VsbCwgY29uZmlnLCBmb2xkLCByb3cpIHtcbiAgICAgICAgdmFyIGVsZW1lbnQgPSBjZWxsLmVsZW1lbnQ7XG4gICAgICAgIHZhciBzZXNzaW9uID0gdGhpcy5zZXNzaW9uO1xuICAgICAgICB2YXIgdGV4dE5vZGUgPSBlbGVtZW50LmNoaWxkTm9kZXNbMF07XG4gICAgICAgIHZhciBmb2xkV2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dGFydClcbiAgICAgICAgICAgIGNsYXNzTmFtZSArPSB0aGlzLiRhbm5vdGF0aW9uc1tyb3ddLmNsYXNzTmFtZTtcbiAgICAgICAgaWYgKGZvbGRXaWRnZXRzKSB7XG4gICAgICAgICAgICB2YXIgYyA9IGZvbGRXaWRnZXRzW3Jvd107XG4gICAgICAgICAgICBpZiAoYyA9PSBudWxsKVxuICAgICAgICAgICAgICAgIGMgPSBmb2xkV2lkZ2V0c1tyb3ddID0gc2Vzc2lvbi5nZXRGb2xkV2lkZ2V0KHJvdyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGMpIHtcbiAgICAgICAgICAgIHZhciBmb2xkQ2xhc3MgPSBcImFjZV9mb2xkLXdpZGdldCBhY2VfXCIgKyBjO1xuICAgICAgICAgICAgdmFyIGlzQ2xvc2VkRm9sZCA9IGMgPT0gXCJzdGFydFwiICYmIHJvdyA9PSBmb2xkU3RhcnQgJiYgcm93IDwgZm9sZC5lbmQucm93O1xuICAgICAgICAgICAgaWYgKGlzQ2xvc2VkRm9sZCkge1xuICAgICAgICAgICAgICAgIGZvbGRDbGFzcyArPSBcIiBhY2VfY2xvc2VkXCI7XG4gICAgICAgICAgICAgICAgdmFyIGZvbGRBbm5vdGF0aW9uQ2xhc3MgPSAnJztcbiAgICAgICAgICAgICAgICB2YXIgYW5ub3RhdGlvbkluRm9sZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSByb3cgKyAxOyBpIDw9IGZvbGQuZW5kLnJvdzsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy4kYW5ub3RhdGlvbnNbaV0pXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuJGFubm90YXRpb25zW2ldLmNsYXNzTmFtZSA9PT0gXCIgYWNlX2Vycm9yXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFubm90YXRpb25JbkZvbGQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9sZEFubm90YXRpb25DbGFzcyA9IFwiIGFjZV9lcnJvcl9mb2xkXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy4kYW5ub3RhdGlvbnNbaV0uY2xhc3NOYW1lID09PSBcIiBhY2Vfd2FybmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhbm5vdGF0aW9uSW5Gb2xkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvbGRBbm5vdGF0aW9uQ2xhc3MgPSBcIiBhY2Vfd2FybmluZ19mb2xkXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjbGFzc05hbWUgKz0gZm9sZEFubm90YXRpb25DbGFzcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBmb2xkQ2xhc3MgKz0gXCIgYWNlX29wZW5cIjtcbiAgICAgICAgICAgIGlmIChmb2xkV2lkZ2V0LmNsYXNzTmFtZSAhPSBmb2xkQ2xhc3MpXG4gICAgICAgICAgICAgICAgZm9sZFdpZGdldC5jbGFzc05hbWUgPSBmb2xkQ2xhc3M7XG4gICAgICAgICAgICBkb20uc2V0U3R5bGUoZm9sZFdpZGdldC5zdHlsZSwgXCJoZWlnaHRcIiwgbGluZUhlaWdodCk7XG4gICAgICAgICAgICBkb20uc2V0U3R5bGUoZm9sZFdpZGdldC5zdHlsZSwgXCJkaXNwbGF5XCIsIFwiaW5saW5lLWJsb2NrXCIpO1xuICAgICAgICAgICAgZm9sZFdpZGdldC5zZXRBdHRyaWJ1dGUoXCJyb2xlXCIsIFwiYnV0dG9uXCIpO1xuICAgICAgICAgICA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gICAgICAgdGhpcy4kcGFkZGluZyA9IHBhZGRpbmc7XG4gICAgfTtcbiAgICBNYXJrZXIucHJvdG90eXBlLnNldFNlc3Npb24gPSBmdW5jdGlvbiAoc2Vzc2lvbikge1xuICAgICAgICB0aGlzLnNlc3Npb24gPSBzZXNzaW9uO1xuICAgIH07XG4gICAgTWFya2VyLnByb3RvdHlwZS5zZXRNYXJrZXJzID0gZnVuY3Rpb24gKG1hcmtlcnMpIHtcbiAgICAgICAgdGhpcy5tYXJrZXJzID0gbWFya2VycztcbiAgICB9O1xuICAgIE1hcmtlci5wcm90b3R5cGUuZWx0ID0gZnVuY3Rpb24gKGNsYXNzTmFtZSwgY3NzKSB7XG4gICAgICAgIHZhciB4ID0gdGhpcy5pICE9IC0xICYmIHRoaXMuZWxlbWVudC5jaGlsZE5vZGVzW3RoaXMuaV07XG4gICAgICAgIGlmICgheCkge1xuICAgICAgICAgICAgeCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoXCJkaXZcIik7XG4gICAgICAgICAgICB0aGlzLmVsZW1lbnQuYXBwZW5kQ2hpbGQoeCk7XG4gICAgICAgICAgICB0aGlzLmkgPSAtMTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuaSsrO1xuICAgICAgICB9XG4gICAgICAgIHguc3R5bGUuY3NzVGV4dCA9IGNzcztcbiAgICAgICAgeC5jbGFzc05hbWUgPSBjbGFzc05hbWU7XG4gICAgfTtcbiAgICBNYXJrZXIucHJvdG90eXBlLnVwZGF0ZSA9IGZ1bmN0aW9uIChjb25maWcpIHtcbiAgICAgICAgaWYgKCFjb25maWcpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIHRoaXMuY29uZmlnID0gY29uZmlnO1xuICAgICAgICB0aGlzLmkgPSAwO1xuICAgICAgICB2YXIgaHRtbDtcbiAgICAgICAgZm9yICh2YXIga2V5IGluIHRoaXMubWFya2Vycykge1xuICAgICAgICAgICAgdmFyIG1hcmtlciA9IHRoaXMubWFya2Vyc1trZXldO1xuICAgICAgICAgICAgaWYgKCFtYXJrZXIucmFuZ2UpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXIudXBkYXRlKGh0bWwsIHRoaXMsIHRoaXMuc2Vzc2lvbiwgY29uZmlnKTtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciByYW5nZSA9IG1hcmtlci5yYW5nZS5jbGlwUm93cyhjb25maWcuZmlyc3RSb3csIGNvbmZpZy5sYXN0Um93KTtcbiAgICAgICAgICAgIGlmIChyYW5nZS5pc0VtcHR5KCkpXG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICByYW5nZSA9IHJhbmdlLnRvU2NyZWVuUmFuZ2UodGhpcy5zZXNzaW9uKTtcbiAgICAgICAgICAgIGlmIChtYXJrZXIucmVuZGVyZXIpIHtcbiAgICAgICAgICAgICAgICB2YXIgdG9wID0gdGhpcy4kZ2V0VG9wKHJhbmdlLnN0YXJ0LnJvdywgY29uZmlnKTtcbiAgICAgICAgICAgICAgICB2YXIgbGVmdCA9IHRoaXMuJHBhZGRpbmcgKyByYW5nZS5zdGFydC5jb2x1bW4gKiBjb25maWcuY2hhcmFjdGVyV2lkdGg7XG4gICAgICAgICAgICAgICAgbWFya2VyLnJlbmRlcmVyKGh0bWwsIHJhbmdlLCBsZWZ0LCB0b3AsIGNvbmZpZyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChtYXJrZXIudHlwZSA9PSBcImZ1bGxMaW5lXCIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmRyYXdGdWxsTGluZU1hcmtlcihodG1sLCByYW5nZSwgbWFya2VyLmNsYXp6LCBjb25maWcpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAobWFya2VyLnR5cGUgPT0gXCJzY3JlZW5MaW5lXCIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmRyYXdTY3JlZW5MaW5lTWFya2VyKGh0bWwsIHJhbmdlLCBtYXJrZXIuY2xhenosIGNvbmZpZyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChyYW5nZS5pc011bHRpTGluZSgpKSB7XG4gICAgICAgICAgICAgICAgaWYgKG1hcmtlci50eXBlID09IFwidGV4dFwiKVxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYXdUZXh0TWFya2VyKGh0bWwsIHJhbmdlLCBtYXJrZXIuY2xhenosIGNvbmZpZyk7XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYXdNdWx0aUxpbmVNYXJrZXIoaHRtbCwgcmFuZ2UsIG1hcmtlci5jbGF6eiwgY29uZmlnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuZHJhd1NpbmdsZUxpbmVNYXJrZXIoaHRtbCwgcmFuZ2UsIG1hcmtlci5jbGF6eiArIFwiIGFjZV9zdGFydFwiICsgXCIgYWNlX2JyMTVcIiwgY29uZmlnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5pICE9IC0xKSB7XG4gICAgICAgICAgICB3aGlsZSAodGhpcy5pIDwgdGhpcy5lbGVtZW50LmNoaWxkRWxlbWVudENvdW50KVxuICAgICAgICAgICAgICAgIHRoaXMuZWxlbWVudC5yZW1vdmVDaGlsZCh0aGlzLmVsZW1lbnQubGFzdENoaWxkKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgTWFya2VyLnByb3RvdHlwZS4kZ2V0VG9wID0gZnVuY3Rpb24gKHJvdywgbGF5ZXJDb25maWcpIHtcbiAgICAgICAgcmV0dXJuIChyb3cgLSBsYXllckNvbmZpZy5maXJzdFJvd1NjcmVlbikgKiBsYXllckNvbmZpZy5saW5lSGVpZ2h0O1xuICAgIH07XG4gICAgT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YgKHRoaXMuY29uZmlnLmxhc3RSb3cgIT0gY29uZmlnLmxhc3RSb3cgfHxcbiAgICAgICAgICAgIHRoaXMuY29uZmlnLmZpcnN0Um93ICE9IGNvbmZpZy5maXJzdFJvdykge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMudXBkYXRlKGNvbmZpZyk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5jb25maWcgPSBjb25maWc7XG4gICAgICAgIHZhciBmaXJzdCA9IE1hdGgubWF4KGZpcnN0Um93LCBjb25maWcuZmlyc3RSb3cpO1xuICAgICAgICB2YXIgbGFzdCA9IE1hdGgubWluKGxhc3RSb3csIGNvbmZpZy5sYXN0Um93KTtcbiAgICAgICAgdmFyIGxpbmVFbGVtZW50cyA9IHRoaXMuZWxlbWVudC5jaGlsZE5vZGVzO1xuICAgICAgICB2YXIgbGluZUVsZW1lbnRzSWR4ID0gMDtcbiAgICAgICAgZm9yICh2YXIgcm93ID0gY29uZmlnLmZpcnN0Um93OyByb3cgPCBmaXJzdDsgcm93KyspIHtcbiAgICAgICAgICAgIHZhciBmb2xkTGluZSA9IHRoaXMuc2Vzc2lvbi5nZXRGb2xkTGluZShyb3cpO1xuICAgICAgICAgICAgaWYgKGZvbGRMaW5lKSB7XG4gICAgICAgICAgICAgICAgaWYgKGZvbGRMaW5lLmNvbnRhaW5zUm93KGZpcnN0KSkge1xuICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZvbGRMaW5lLnN0YXJ0LnJvdztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByb3cgPSBmb2xkTGluZS5lbmQucm93O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxpbmVFbGVtZW50c0lkeCsrO1xuICAgICAgICB9XG4gICAgICAgIHZhciBoZWlnaHRDaGFuZ2VkID0gZmFsc2U7XG4gICAgICAgIHZhciByb3cgPSBmaXJzdDtcbiAgICAgICAgdmFyIGZvbGRMaW5lID0gdGhpcy5zZXNzaW9uLmdldE5leHRGb2xkTGluZShyb3cpO1xuICAgICAgICB2YXIgZm9sZFN0YXJ0ID0gZm9sZExpbmUgPyBmb2xkTGluZS5zdGFydC5yb3cgOiBJbmZpbml0eTtcbiAgICAgICAgd2hpbGUgKHRydWUpIHtcbiAgICAgICAgICAgIGlmIChyb3cgPiBmb2xkU3RhcnQpIHtcbiAgICAgICAgICAgICAgICByb3cgPSBmb2xkTGluZS5lbmQucm93ICsgMTtcbiAgICAgICAgICAgICAgICBmb2xkTGluZSA9IHRoaXMuc2Vzc2lvbi5nZXROZXh0Rm9sZExpbmUocm93LCBmb2xkTGluZSk7XG4gICAgICAgICAgICAgICAgZm9sZFN0YXJ0ID0gZm9sZExpbmUgPyBmb2xkTGluZS5zdGFydC5yb3cgOiBJbmZpbml0eTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChyb3cgPiBsYXN0KVxuICAgICAgICAgICAgICAgIGJyZWFrOyB2YXIgbGluZUVsZW1lbnQgPSBsaW5lRWxlbWVudHNbbGluZUVsZW1lbnRzSWR4KytdO1xuICAgICAgICAgICAgaWYgKGxpbmVFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5kb20ucmVtb3ZlQ2hpbGRyZW4obGluZUVsZW1lbnQpO1xuICAgICAgICAgICAgICAgIHRoaXMuJHJlbmRlckxpbmUobGluZUVsZW1lbnQsIHJvdywgcm93ID09IGZvbGRTdGFydCA/IGZvbGRMaW5lIDogZmFsc2UpO1xuICAgICAgICAgICAgICAgIGlmIChoZWlnaHRDaGFuZ2VkKVxuICAgICAgICAgICAgICAgICAgICBsaW5lRWxlbWVudC5zdHlsZS50b3AgPSB0aGlzLiRsaW5lcy5jb21wdXRlTGluZVRvcChyb3csIGNvbmZpZywgdGhpcy5zZXNzaW9uKSArIFwicHhcIjtcbiAgICAgICAgICAgICAgICB2YXIgaGVpZ2h0ID0gKGNvbmZpZy5saW5lSGVpZ2h0ICogdGhpcy5zZXNzaW9uLmdldFJvd0xlbmd0aChyb3cpKSArIFwicHhcIjtcbiAgICAgICAgICAgICAgICBpZiAobGluZUVsZW1lbnQuc3R5bGUuaGVpZ2h0ICE9IGhlaWdodCkge1xuICAgICAgICAgICAgICAgICAgICBoZWlnaHRDaGFuZ2VkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgbGluZUVsZW1lbnQuc3R5bGUuaGVpZ2h0ID0gaGVpZ2h0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJvdysrO1xuICAgICAgICB9XG4gICAgICAgIGlmIChoZWlnaHRDaGFuZ2VkKSB7XG4gICAgICAgICAgICB3aGlsZSAobGluZUVsZW1lbnRzSWR4IDwgdGhpcy4kbGluZXMuY2VsbHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGNlbGwgPSB0aGlzLiRsaW5lcy5jZWxsc1tsaW5lRWxlbWVudHNJZHgrK107XG4gICAgICAgICAgICAgICAgY2VsbC5lbGVtZW50LnN0eWxlLnRvcCA9IHRoaXMuJGxpbmVzLmNvbXB1dGVMaW5lVG9wKGNlbGwucm93LCBjb25maWcsIHRoaXMuc2Vzc2lvbikgKyBcInB4XCI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIFRleHQucHJvdG90eXBlLnNjcm9sbExpbmVzID0gZnVuY3Rpb24gKGNvbmZpZykge1xuICAgICAgICB2YXIgb2xkQ29uZmlnID0gdGhpcy5jb25maWc7XG4gICAgICAgIHRoaXMuY29uZmlnID0gY29uZmlnO1xuICAgICAgICBpZiAodGhpcy4kbGluZXMucGFnZUNoYW5nZWQob2xkQ29uZmlnLCBjb25maWcpKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMudXBkYXRlKGNvbmZpZyk7XG4gICAgICAgIHRoaXMuJGxpbmVzLm1vdmVDb250YWluZXIoY29uZmlnKTtcbiAgICAgICAgdmFyIGxhc3RSb3cgPSBjb25maWcubGFzdFJvdztcbiAgICAgICAgdmFyIG9sZExhc3RSb3cgPSBvbGRDb25maWcgPyBvbGRDb25maWcubGFzdFJvdyA6IC0xO1xuICAgICAgICBpZiAoIW9sZENvbmZpZyB8fCBvbGRMYXN0Um93IDwgY29uZmlnLmZpcnN0Um93KVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMudXBkYXRlKGNvbmZpZyk7XG4gICAgICAgIGlmIChsYXN0Um93IDwgb2xkQ29uZmlnLmZpcnN0Um93KVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMudXBkYXRlKGNvbmZpZyk7XG4gICAgICAgIGlmICghb2xkQ29uZmlnIHx8IG9sZENvbmZpZy5sYXN0Um93IDwgY29uZmlnLmZpcnN0Um93KVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMudXBkYXRlKGNvbmZpZyk7XG4gICAgICAgIGlmIChjb25maWcubGFzdFJvdyA8IG9sZENvbmZpZy5maXJzdFJvdylcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnVwZGF0ZShjb25maWcpO1xuICAgICAgICBpZiAob2xkQ29uZmlnLmZpcnN0Um93IDwgY29uZmlnLmZpcnN0Um93KVxuICAgICAgICAgICAgZm9yICh2YXIgcm93ID0gdGhpcy5zZXNzaW9uLmdldEZvbGRlZFJvd0NvdW50KG9sZENvbmZpZy5maXJzdFJvdywgY29uZmlnLmZpcnN0Um93IC0gMSk7IHJvdyA+IDA7IHJvdy0tKVxuICAgICAgICAgICAgICAgIHRoaXMuJGxpbmVzLnNoaWZ0KCk7XG4gICAgICAgIGlmIChvbGRDb25maWcubGFzdFJvdyA+IGNvbmZpZy5sYXN0Um93KVxuICAgICAgICAgICAgZm9yICh2YXIgcm93ID0gdGhpcy5zZXNzaW9uLmdldEZvbGRlZFJvd0NvdW50KGNvbmZpZy5sYXN0Um93ICsgMSwgb2xkQ29uZ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IHZhciBjamtTcGFjZSA9IG1bNF07XG4gICAgICAgICAgICB2YXIgY2prID0gbVs1XTtcbiAgICAgICAgICAgIGlmICghc2VsZi5zaG93U3BhY2VzICYmIHNpbXBsZVNwYWNlKVxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgdmFyIGJlZm9yZSA9IGkgIT0gbS5pbmRleCA/IHZhbHVlLnNsaWNlKGksIG0uaW5kZXgpIDogXCJcIjtcbiAgICAgICAgICAgIGkgPSBtLmluZGV4ICsgbVswXS5sZW5ndGg7XG4gICAgICAgICAgICBpZiAoYmVmb3JlKSB7XG4gICAgICAgICAgICAgICAgdmFsdWVGcmFnbWVudC5hcHBlbmRDaGlsZCh0aGlzLmRvbS5jcmVhdGVUZXh0Tm9kZShiZWZvcmUsIHRoaXMuZWxlbWVudCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRhYikge1xuICAgICAgICAgICAgICAgIHZhciB0YWJTaXplID0gc2VsZi5zZXNzaW9uLmdldFNjcmVlblRhYlNpemUoc2NyZWVuQ29sdW1uICsgbS5pbmRleCk7XG4gICAgICAgICAgICAgICAgdmFsdWVGcmFnbWVudC5hcHBlbmRDaGlsZChzZWxmLiR0YWJTdHJpbmdzW3RhYlNpemVdLmNsb25lTm9kZSh0cnVlKSk7XG4gICAgICAgICAgICAgICAgc2NyZWVuQ29sdW1uICs9IHRhYlNpemUgLSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoc2ltcGxlU3BhY2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoc2VsZi5zaG93U3BhY2VzKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzcGFuID0gdGhpcy5kb20uY3JlYXRlRWxlbWVudChcInNwYW5cIik7XG4gICAgICAgICAgICAgICAgICAgIHNwYW4uY2xhc3NOYW1lID0gXCJhY2VfaW52aXNpYmxlIGFjZV9pbnZpc2libGVfc3BhY2VcIjtcbiAgICAgIC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NlbGYuY29uZmlnLmNoYXJhY3RlcldpZHRoICogMikgKyBcInB4XCI7XG4gICAgICAgICAgICAgICAgc3Bhbi5jbGFzc05hbWUgPSBzZWxmLnNob3dTcGFjZXMgPyBcImFjZV9jamsgYWNlX2ludmlzaWJsZSBhY2VfaW52aXNpYmxlX3NwYWNlXCIgOiBcImFjZV9jamtcIjtcbiAgICAgICAgICAgICAgICBzcGFuLnRleHRDb250ZW50ID0gc2VsZi5zaG93U3BhY2VzID8gc2VsZi5TUEFDRV9DSEFSIDogY2prU3BhY2U7XG4gICAgICAgICAgICAgICAgdmFsdWVGcmFnbWVudC5hcHBlbmRDaGlsZChzcGFuKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGNqaykge1xuICAgICAgICAgICAgICAgIHNjcmVlbkNvbHVtbiArPSAxO1xuICAgICAgICAgICAgICAgIHZhciBzcGFuID0gdGhpcy5kb20uY3JlYXRlRWxlbWVudChcInNwYW5cIik7XG4gICAgICAgICAgICAgICAgc3Bhbi5zdHlsZS53aWR0aCA9IChzZWxmLmNvbmZpZy5jaGFyYWN0ZXJXaWR0aCAqIDIpICsgXCJweFwiO1xuICAgICAgICAgICAgICAgIHNwYW4uY2xhc3NOYW1lID0gXCJhY2VfY2prXCI7XG4gICAgICAgICAgICAgICAgc3Bhbi50ZXh0Q29udGVudCA9IGNqaztcbiAgICAgICAgICAgICAgICB2YWx1ZUZyYWdtZW50LmFwcGVuZENoaWxkKHNwYW4pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhbHVlRnJhZ21lbnQuYXBwZW5kQ2hpbGQodGhpcy5kb20uY3JlYXRlVGV4dE5vZGUoaSA/IHZhbHVlLnNsaWNlKGkpIDogdmFsdWUsIHRoaXMuZWxlbWVudCkpO1xuICAgICAgICBpZiAoIWlzVGV4dFRva2VuKHRva2VuLnR5cGUpKSB7XG4gICAgICAgICAgICB2YXIgY2xhc3NlcyA9IFwiYWNlX1wiICsgdG9rZW4udHlwZS5yZXBsYWNlKC9cXC4vZywgXCIgYWNlX1wiKTtcbiAgICAgICAgICAgIHZhciBzcGFuID0gdGhpcy5kb20uY3JlYXRlRWxlbWVudChcInNwYW5cIik7XG4gICAgICAgICAgICBpZiAodG9rZW4udHlwZSA9PSBcImZvbGRcIikge1xuICAgICAgICAgICAgICAgIHNwYW4uc3R5bGUud2lkdGggPSAodG9rZW4udmFsdWUubGVuZ3RoICogdGhpcy5jb25maWcuY2hhcmFjdGVyV2lkdGgpICsgXCJweFwiO1xuICAgICAgICAgICAgICAgIHNwYW4uc2V0QXR0cmlidXRlKFwidGl0bGVcIiwgbmxzKFwiaW5saW5lLWZvbGQuY2xvc2VkLnRpdGxlXCIsIFwiVW5mb2xkIGNvZGVcIikpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc3Bhbi5jbGFzc05hbWUgPSBjbGFzc2VzO1xuICAgICAgICAgICAgc3Bhbi5hcHBlbmRDaGlsZCh2YWx1ZUZyYWdtZW50KTtcbiAgICAgICAgICAgIHBhcmVudC5hcHBlbmRDaGlsZChzcGFuKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHBhcmVudC5hcHBlbmRDaGlsZCh2YWx1ZUZyYWdtZW50KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc2NyZWVuQ29sdW1uICsgdmFsdWUubGVuZ3RoO1xuICAgIH07XG4gICAgVGV4dC5wcm90b3R5cGUucmVuZGVySW5kZW50R3VpZGUgPSBmdW5jdGlvbiAocGFyZW50LCB2YWx1ZSwgbWF4KSB7XG4gICAgICAgIHZhciBjb2xzID0gdmFsdWUuc2VhcmNoKHRoaXMuJGluZGVudEd1aWRlUmUpO1xuICAgICAgICBpZiAoY29scyA8PSAwIHx8IGNvbHMgPj0gbWF4KVxuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICBpZiAodmFsdWVbMF0gPT0gXCIgXCIpIHtcbiAgICA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zb3Iucm93ICE9PSByYW5nZXNbaV0uc3RhcnQucm93KSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJGhpZ2hsaWdodEluZGVudEd1aWRlTWFya2VyLmVuZCA9IHJhbmdlc1tpXS5zdGFydC5yb3c7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjdXJzb3Iucm93ID4gcmFuZ2VzW2ldLnN0YXJ0LnJvdykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy4kaGlnaGxpZ2h0SW5kZW50R3VpZGVNYXJrZXIuZGlyID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLiRoaWdobGlnaHRJbmRlbnRHdWlkZU1hcmtlci5kaXIgPSAxO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoIXRoaXMuJGhpZ2hsaWdodEluZGVudEd1aWRlTWFya2VyLmVuZCkge1xuICAgICAgICAgICAgaWYgKGxpbmVzW2N1cnNvci5yb3ddICE9PSAnJyAmJiBjdXJzb3IuY29sdW1uID09PSBsaW5lc1tjdXJzb3Iucm93XS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiRoaWdobGlnaHRJbmRlbnRHdWlkZU1hcmtlci5kaXIgPSAxO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSBjdXJzb3Iucm93ICsgMTsgaSA8IGxpbmVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBsaW5lID0gbGluZXNbaV07XG4gICAgICAgICAgICAgICAgICAgIHZhciBjdXJyZW50SW5kZW50ID0gL15cXHMqLy5leGVjKGxpbmUpWzBdLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxpbmUgIT09ICcnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLiRoaWdobGlnaHRJbmRlbnRHdWlkZU1hcmtlci5lbmQgPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRJbmRlbnQgPD0gaW5pdGlhbEluZGVudClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLiRyZW5kZXJIaWdobGlnaHRJbmRlbnRHdWlkZSgpO1xuICAgIH07XG4gICAgVGV4dC5wcm90b3R5cGUuJGNsZWFyQWN0aXZlSW5kZW50R3VpZGUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBjZWxscyA9IHRoaXMuJGxpbmVzLmNlbGxzO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNlbGxzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgY2VsbCA9IGNlbGxzW2ldO1xuICAgICAgICAgICAgdmFyIGNoaWxkTm9kZXMgPSBjZWxsLmVsZW1lbnQuY2hpbGROb2RlcztcbiAgICAgICAgICAgIGlmIChjaGlsZE5vZGVzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGNoaWxkTm9kZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkTm9kZXNbal0uY2xhc3NMaXN0ICYmIGNoaWxkTm9kZXNbal0uY2xhc3NMaXN0LmNvbnRhaW5zKFwiYWNlX2luZGVudC1ndWlkZS1hY3RpdmVcIikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkTm9kZXNbal0uY2xhc3NMaXN0LnJlbW92ZShcImFjZV9pbmRlbnQtZ3VpZGUtYWN0aXZlXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIFRleHQucHJvdG90eXBlLiRzZXRJbmRlbnRHdWlkZUFjdGl2ZSA9IGZ1bmN0aW9uIChjZWxsLCBpbmRlbnRMZXZlbCkge1xuICAgICAgICB2YXIgbGluZSA9IHRoaXMuc2Vzc2lvbi5kb2MuZ2V0TGluZShjZWxsLnJvdyk7XG4gICAgICAgIGlmIChsaW5lICE9PSBcIlwiKSB7XG4gICAgICAgICAgICB2YXIgY2hpbGROb2RlcyA9IGNlbGwuZWxlbWVudC5jaGlsZE5vZGVzO1xuICAgICAgICAgICAgaWYgKGNoaWxkTm9kZXMpIHtcbiAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IGNoaWxkTm9kZXNbaW5kZW50TGV2ZWwgLSAxXTtcbiAgICAgICAgICAgICAgICBpZiAobm9kZSAmJiBub2RlLmNsYXNzTGlzdCAmJiBub2RlLmNsYXNzTGlzdC5jb250YWlucyhcImFjZV9pbmRlbnQtZ3VpZGVcIikpXG4gICAgICAgICAgICAgICAgICAgIG5vZGUuY2xhc3NMaXN0LmFkZChcImFjZV9pbmRlbnQtZ3VpZGUtYWN0aXZlXCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICBUZXh0LnByb3RvdHlwZS4kcmVuZGVySGlnaGxpZ2h0SW5kZW50R3VpZGUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICghdGhpcy4kbGluZXMpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIHZhciBjZWxscyA9IHRoaXMuJGxpbmVzLmNlbGxzO1xuICAgICAgICB0aGlzLiRjbGVhckFjdGl2ZUluZGVudEd1aWRlKCk7XG4gICAgICAgIHZhciBpbmRlbnRMZXZlbCA9IHRoaXMuJGhpZ2hsaWdodEluZGVudEd1aWRlTWFya2VyLmluZGVudExldmVsO1xuICAgICAgICBpZiAoaW5kZW50TGV2ZWwgIT09IDApIHtcbiAgICAgICAgICAgIGlmICh0aGlzLiRoaWdobGlnaHRJbmRlbnRHdWlkZU1hcmtlci5kaXIgPT09IDEpIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNlbGxzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjZWxsID0gY2VsbHNbaV07XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLiRoaWdobGlnaHRJbmRlbnRHdWlkZU1hcmtlci5lbmQgJiYgY2VsbC5yb3cgPj0gdGhpcy4kaGlnaGxpZ2h0SW5kZW50R3VpZGVNYXJrZXIuc3RhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgICsgMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNlbGwucm93ID49IHRoaXMuJGhpZ2hsaWdodEluZGVudEd1aWRlTWFya2VyLmVuZClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuJHNldEluZGVudEd1aWRlQWN0aXZlKGNlbGwsIGluZGVudExldmVsKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSBjZWxscy5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY2VsbCA9IGNlbGxzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy4kaGlnaGxpZ2h0SW5kZW50R3VpZGVNYXJrZXIuZW5kICYmIGNlbGwucm93IDwgdGhpcy4kaGlnaGxpZ2h0SW5kZW50R3VpZGVNYXJrZXIuc3RhcnQpIHtcbiAgICAgICAgICAgICAgICAg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PSBzcGxpdENoYXJzO1xuICAgICAgICAgICAgICAgICAgICBsaW5lRWwgPSB0aGlzLiRjcmVhdGVMaW5lRWxlbWVudCgpO1xuICAgICAgICAgICAgICAgICAgICBwYXJlbnQuYXBwZW5kQ2hpbGQobGluZUVsKTtcbiAgICAgICAgICAgICAgICAgICAgbGluZUVsLmFwcGVuZENoaWxkKHRoaXMuZG9tLmNyZWF0ZVRleHROb2RlKGxhbmcuc3RyaW5nUmVwZWF0KFwiXFx4YTBcIiwgc3BsaXRzLmluZGVudCksIHRoaXMuZWxlbWVudCkpO1xuICAgICAgICAgICAgICAgICAgICBzcGxpdCsrO1xuICAgICAgICAgICAgICAgICAgICBzY3JlZW5Db2x1bW4gPSAwO1xuICAgICAgICAgICAgICAgICAgICBzcGxpdENoYXJzID0gc3BsaXRzW3NwbGl0XSB8fCBOdW1iZXIuTUFYX1ZBTFVFO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAodmFsdWUubGVuZ3RoICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgY2hhcnMgKz0gdmFsdWUubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBzY3JlZW5Db2x1bW4gPSB0aGlzLiRyZW5kZXJUb2tlbihsaW5lRWwsIHNjcmVlbkNvbHVtbiwgdG9rZW4sIHZhbHVlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHNwbGl0c1tzcGxpdHMubGVuZ3RoIC0gMV0gPiB0aGlzLk1BWF9MSU5FX0xFTkdUSClcbiAgICAgICAgICAgIHRoaXMuJHJlbmRlck92ZXJmbG93TWVzc2FnZShsaW5lRWwsIHNjcmVlbkNvbHVtbiwgbnVsbCwgXCJcIiwgdHJ1ZSk7XG4gICAgfTtcbiAgICBUZXh0LnByb3RvdHlwZS4kcmVuZGVyU2ltcGxlTGluZSA9IGZ1bmN0aW9uIChwYXJlbnQsIHRva2Vucykge1xu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sIHNwbGl0cyk7XG4gICAgICAgICAgICAgICAgdmFyIGxhc3RMaW5lRWwgPSBwYXJlbnQubGFzdENoaWxkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGxhc3RMaW5lRWwgPSBwYXJlbnQ7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuJHVzZUxpbmVHcm91cHMoKSkge1xuICAgICAgICAgICAgICAgICAgICBsYXN0TGluZUVsID0gdGhpcy4kY3JlYXRlTGluZUVsZW1lbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50LmFwcGVuZENoaWxkKGxhc3RMaW5lRWwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLiRyZW5kZXJTaW1wbGVMaW5lKGxhc3RMaW5lRWwsIHRva2Vucyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodGhpcy4kdXNlTGluZUdyb3VwcygpKSB7XG4gICAgICAgICAgICBsYXN0TGluZUVsID0gdGhpcy4kY3JlYXRlTGluZUVsZW1lbnQoKTtcbiAgICAgICAgICAgIHBhcmVudC5hcHBlbmRDaGlsZChsYXN0TGluZUVsKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5zaG93RU9MICYmIGxhc3RMaW5lRWwpIHtcbiAgICAgICAgICAgIGlmIChmb2xkTGluZSlcbiAgICAgICAgICAgICAgICByb3cgPSBmb2xkTGluZS5lbmQucm93O1xuICAgICAgICAgICAgdmFyIGludmlzaWJsZUVsID0gdGhpcy5kb20uY3JlYXRlRWxlbWVudChcInNwYW5cIik7XG4gICAgICAgICAgICBpbnZpc2libGVFbC5jbGFzc05hbWUgPSBcImFjZV9pbnZpc2libGUgYWNlX2ludmlzaWJsZV9lb2xcIjtcbiAgICAgICAgICAgIGludmlzaWJsZUVsLnRleHRDb250ZW50ID0gcm93ID09IHRoaXMuc2Vzc2lvbi5nZXRMZW5ndGgoKSAtIDEgPyB0aGlzLkVPRl9DSEFSIDogdGhpcy5FT0xfQ0hBUjtcbiAgICAgICAgICAgIGxhc3RMaW5lRWwuYXBwZW5kQ2hpbGQoaW52aXNpYmxlRWwpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBUZXh0LnByb3RvdHlwZS4kZ2V0Rm9sZExpbmVUb2tlbnMgPSBmdW5jdGlvbiAocm93LCBmb2xkTGluZSkge1xuICAgICAgICB2YXIgc2Vzc2lvbiA9IHRoaXMuc2Vzc2lvbjtcbiAgICAgICAgdmFyIHJlbmRlclRva2VucyA9IFtdO1xuICAgICAgICBmdW5jdGlvbiBhZGRUb2tlbnModG9rZW5zLCBmcm9tLCB0bykge1xuICAgICAgICAgICAgdmFyIGlkeCA9IDAsIGNvbCA9IDA7XG4gICAgICAgICAgICB3aGlsZSAoKGNvbCArIHRva2Vuc1tpZHhdLnZhbHVlLmxlbmd0aCkgPCBmcm9tKSB7XG4gICAgICAgICAgICAgICAgY29sICs9IHRva2Vuc1tpZHhdLnZhbHVlLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZHgrKztcbiAgICAgICAgICAgICAgICBpZiAoaWR4ID09IHRva2Vucy5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjb2wgIT0gZnJvbSkge1xuICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9IHRva2Vuc1tpZHhdLnZhbHVlLnN1YnN0cmluZyhmcm9tIC0gY29sKTtcbiAgICAgICAgICAgICAgICBpZiAodmFsdWUubGVuZ3RoID4gKHRvIC0gZnJvbSkpXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUuc3Vic3RyaW5nKDAsIHRvIC0gZnJvbSk7XG4gICAgICAgICAgICAgICAgcmVuZGVyVG9rZW5zLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiB0b2tlbnNbaWR4XS50eXBlLFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWVcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBjb2wgPSBmcm9tICsgdmFsdWUubGVuZ3RoO1xuICAgICAgICAgICAgICAgIGlkeCArPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgd2hpbGUgKGNvbCA8IHRvICYmIGlkeCA8IHRva2Vucy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSB0b2tlbnNbaWR4XS52YWx1ZTtcbiAgICAgICAgICAgICAgICBpZiAodmFsdWUubGVuZ3RoICsgY29sID4gdG8pIHtcbiAgICAgICAgICAgICAgICAgICAgcmVuZGVyVG9rZW5zLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogdG9rZW5zW2lkeF0udHlwZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZS5zdWJzdHJpbmcoMCwgdG8gLSBjb2wpXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIHJlbmRlclRva2Vucy5wdXNoKHRva2Vuc1tpZHhdKTtcbiAgICAgICAgICAgICAgICBjb2wgKz0gdmFsdWUubGVuZ3RoO1xuICAgICAgICAgICAgICAgIGlkeCArPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhciB0b2tlbnMgPSBzZXNzaW9uLmdldFRva2Vucyhyb3cpO1xuICAgICAgICBmb2xkTGluZS53YWxrKGZ1bmN0aW9uIChwbGFjZWhvbGRlciwgcm93LCBjb2x1bW4sIGxhc3RDb2x1bW4sIGlzTmV3Um93KSB7XG4gICAgICAgICAgICBpZiAocGxhY2Vob2xkZXIgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJlbmRlclRva2Vucy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogXCJmb2xkXCIsXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwbGFjZWhvbGRlclxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzTmV3Um93KVxuICAgICAgICAgICAgICAgICAgICB0b2tlbnMgPSBzZXNzaW9uLmdldFRva2Vucyhyb3cpO1xuICAgICAgICAgICAgICAgIGlmICh0b2tlbnMubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICBhZGRUb2tlbnModG9rZW5zLCBsYXN0Q29sdW1uLCBjb2x1bW4pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LCBmb2xkTGluZS5lbmQucm93LCB0aGlzLnNlc3Npb24uZ2V0TGluZShmb2xkTGluZS5lbmQucm93KS5sZW5ndGgpO1xuICAgICAgICByZXR1cm4gcmVuZGVyVG9rZW5zO1xuICAgIH07XG4gICAgVGV4dC5wcm90b3R5cGUuJHVzZUxpbmVHcm91cHMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnNlc3Npb24uZ2V0VXNlV3JhcE1vZGUoKTtcbiAgICB9O1xuICAgIHJldHVybiBUZXh0O1xufSgpKTtcblRleHQucHJvdG90eXBlLkVPRl9DSEFSID0gXCJcXHhCNlwiO1xuVGV4dC5wcm90b3R5cGUuRU9MX0NIQVJfTEYgPSBcIlxceEFDXCI7XG5UZXh0LnByb3RvdHlwZS5FT0xfQ0hBUl9DUkxGID0gXCJcXHhhNFwiO1xuVGV4dC5wcm90b3R5cGUuRU9MX0NIQVIgPSBUZXh0LnByb3RvdHlwZS5FT0xfQ0hBUl9MRjtcblRleHQucHJvdG90eXBlLlRBQl9DSEFSID0gXCJcXHUyMDE0XCI7IC8vXCJcXHUyMUU1XCI7XG5UZXh0LnByb3RvdHlwZS5TUEFDRV9DSEFSID0gXCJcXHhCN1wiO1xuVGV4dC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nNldCB8fFxuICAgICAgICAgICAgICAgIHBpeGVsUG9zLnRvcCA8IDApICYmIGkgPiAxKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgZWxlbWVudCA9IHRoaXMuY3Vyc29yc1tjdXJzb3JJbmRleCsrXSB8fCB0aGlzLmFkZEN1cnNvcigpO1xuICAgICAgICAgICAgdmFyIHN0eWxlID0gZWxlbWVudC5zdHlsZTtcbiAgICAgICAgICAgIGlmICghdGhpcy5kcmF3Q3Vyc29yKSB7XG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLmlzQ3Vyc29ySW5WaWV3KHBpeGVsUG9zLCBjb25maWcpKSB7XG4gICAgICAgICAgICAgICAgICAgIGRvbS5zZXRTdHlsZShzdHlsZSwgXCJkaXNwbGF5XCIsIFwibm9uZVwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGRvbS5zZXRTdHlsZShzdHlsZSwgXCJkaXNwbGF5XCIsIFwiYmxvY2tcIik7XG4gICAgICAgICAgICAgICAgICAgIGRvbS50cmFuc2xhdGUoZWxlbWVudCwgcGl4ZWxQb3MubGVmdCwgcGl4ZWxQb3MudG9wKTtcbiAgICAgICAgICAgICAgICAgICAgZG9tLnNldFN0eWxlKHN0eWxlLCBcIndpZHRoXCIsIE1hdGgucm91bmQoY29uZmlnLmNoYXJhY3RlcldpZHRoKSArIFwicHhcIik7XG4gICAgICAgICAgICAgICAgICAgIGRvbS5zZXRTdHlsZShzdHlsZSwgXCJoZWlnaHRcIiwgY29uZmlnLmxpbmVIZWlnaHQgKyBcInB4XCIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuZHJhd0N1cnNvcihlbGVtZW50LCBwaXhlbFBvcywgY29uZmlnLCBzZWxlY3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Jy12JykgfHwgdGhpcztcbiAgICAgICAgX3RoaXMuc2Nyb2xsVG9wID0gMDtcbiAgICAgICAgX3RoaXMuc2Nyb2xsSGVpZ2h0ID0gMDtcbiAgICAgICAgX3RoaXMucGFyZW50ID0gcGFyZW50O1xuICAgICAgICBfdGhpcy53aWR0aCA9IF90aGlzLlZTY3JvbGxXaWR0aDtcbiAgICAgICAgX3RoaXMucmVuZGVyZXIgPSByZW5kZXJlcjtcbiAgICAgICAgX3RoaXMuaW5uZXIuc3R5bGUud2lkdGggPSBfdGhpcy5lbGVtZW50LnN0eWxlLndpZHRoID0gKF90aGlzLndpZHRoIHx8IDE1KSArIFwicHhcIjtcbiAgICAgICAgX3RoaXMuJG1pbldpZHRoID0gMDtcbiAgICAgICAgcmV0dXJuIF90aGlzO1xuICAgIH1cbiAgICBWU2Nyb2xsQmFyLnByb3RvdHlwZS5vbk1vdXNlRG93biA9IGZ1bmN0aW9uIChlVHlwZSwgZSkge1xuICAgICAgICBpZiAoZVR5cGUgIT09IFwibW91c2Vkb3duXCIpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIGlmIChldmVudC5nZXRCdXR0b24oZSkgIT09IDAgfHwgZS5kZXRhaWwgPT09IDIpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZS50YXJnZXQgPT09IHRoaXMuaW5uZXIpIHtcbiAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcbiAgICAgICAgICAgIHZhciBtb3VzZVBhZ2VZID0gZS5jbGllbnRZO1xuICAgICAgICAgICAgdmFyIG9uTW91c2VNb3ZlID0gZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICBtb3VzZVBhZ2VZID0gZS5jbGllbnRZO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHZhciBvbk1vdXNlVXAgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcklkKT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R0aCA9IDA7XG4gICAgICAgIF90aGlzLmhlaWdodCA9IF90aGlzLkhTY3JvbGxIZWlnaHQ7XG4gICAgICAgIF90aGlzLmlubmVyLnN0eWxlLmhlaWdodCA9IF90aGlzLmVsZW1lbnQuc3R5bGUuaGVpZ2h0ID0gKF90aGlzLmhlaWdodCB8fCAxMikgKyBcInB4XCI7XG4gICAgICAgIF90aGlzLnJlbmRlcmVyID0gcmVuZGVyZXI7XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgSFNjcm9sbEJhci5wcm90b3R5cGUub25Nb3VzZURvd24gPSBmdW5jdGlvbiAoZVR5cGUsIGUpIHtcbiAgICAgICAgaWYgKGVUeXBlICE9PSBcIm1vdXNlZG93blwiKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAoZXZlbnQuZ2V0QnV0dG9uKGUpICE9PSAwIHx8IGUuZGV0YWlsID09PSAyKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGUudGFyZ2V0ID09PSB0aGlzLmlubmVyKSB7XG4gICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICB2YXIgbW91c2VQYWdlWCA9IGUuY2xpZW50WDtcbiAgICAgICAgICAgIHZhciBvbk1vdXNlTW92ZSA9IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgbW91c2VQYWdlWCA9IGUuY2xpZW50WDtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB2YXIgb25Nb3VzZVVwID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXJJZCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgdmFyIHN0YXJ0WCA9IGUuY2xpZW50WDtcbiAgICAgICAgICAgIHZhciBzdGFydExlZnQgPSB0aGlzLnRodW1iTGVmdDtcbiAgICAgICAgICAgIHZhciBvblNjcm9sbEludGVydm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ZhciBSZW5kZXJMb29wID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKCkge1xuICAgIGZ1bmN0aW9uIFJlbmRlckxvb3Aob25SZW5kZXIsIHdpbikge1xuICAgICAgICB0aGlzLm9uUmVuZGVyID0gb25SZW5kZXI7XG4gICAgICAgIHRoaXMucGVuZGluZyA9IGZhbHNlO1xuICAgICAgICB0aGlzLmNoYW5nZXMgPSAwO1xuICAgICAgICB0aGlzLiRyZWN1cnNpb25MaW1pdCA9IDI7XG4gICAgICAgIHRoaXMud2luZG93ID0gd2luIHx8IHdpbmRvdztcbiAgICAgICAgdmFyIF9zZWxmID0gdGhpcztcbiAgICAgICAgdGhpcy5fZmx1c2ggPSBmdW5jdGlvbiAodHMpIHtcbiAgICAgICAgICAgIF9zZWxmLnBlbmRpbmcgPSBmYWxzZTtcbiAgICAgICAgICAgIHZhciBjaGFuZ2VzID0gX3NlbGYuY2hhbmdlcztcbiAgICAgICAgICAgIGlmIChjaGFuZ2VzKSB7XG4gICAgICAgICAgICAgICAgZXZlbnQuYmxvY2tJZGxlKDEwMCk7XG4gICAgICAgICAgICAgICAgX3NlbGYuY2hhbmdlcyA9IDA7XG4gICAgICAgICAgICAgICAgX3NlbGYub25SZW5kZXIoY2hhbmdlcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoX3NlbGYuY2hhbmdlcykge1xuICAgICAgICAgICAgICAgIGlmIChfc2VsZi4kcmVjdXJzaW9uTGltaXQtLSA8IDApXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICBfc2VsZi5zY2hlZHVsZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgX3NlbGYuJHJlY3Vyc2lvbkxpbWl0ID0gMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICB9XG4gICAgUmVuZGVyTG9vcC5wcm90b3R5cGUuc2NoZWR1bGUgPSB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AgICB2YXIgem9vbSA9IHRoaXMuJGdldFpvb20odGhpcy5lbCk7XG4gICAgICAgICAgICBjbGllbnRQb3MgPSBtdWwoMSAvIHpvb20sIGNsaWVudFBvcyk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gc29sdmUobDEsIGwyLCByKSB7XG4gICAgICAgICAgICB2YXIgZGV0ID0gbDFbMV0gKiBsMlswXSAtIGwxWzBdICogbDJbMV07XG4gICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAgICgtbDJbMV0gKiByWzBdICsgbDJbMF0gKiByWzFdKSAvIGRldCxcbiAgICAgICAgICAgICAgICAoK2wxWzFdICogclswXSAtIGwxWzBdICogclsxXSkgLyBkZXRcbiAgICAgICAgICAgIF07XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gc3ViKGEsIGIpIHsgcmV0dXJuIFthWzBdIC0gYlswXSwgYVsxXSAtIGJbMV1dOyB9XG4gICAgICAgIGZ1bmN0aW9uIGFkZChhLCBiKSB7IHJldHVybiBbYVswXSArIGJbMF0sIGFbMV0gKyBiWzFdXTsgfVxuICAgICAgICBmdW5jdGlvbiBtdWwoYSwgYikgeyByZXR1cm4gW2EgKiBiWzBdLCBhICogYlsxXV07IH1cbiAgICAgICAgaWYgKCF0aGlzLmVscylcbiAgICAgICAgICAgIHRoaXMuJGluaXRUcmFuc2Zvcm1NZWFzdXJlTm9kZXMoKTtcbiAgICAgICAgZnVuY3Rpb24gcChlbCkge1xuICAgICAgICAgICAgdmFyIHIgPSBlbC5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKTtcbiAgICAgICAgICAgIHJldHVybiBbci5sZWZ0LCByLnRvcF07XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGEgPSBwKHRoaXMuZWxzWzBdKTtcbiAgICAgICAgdmFyIGIgPSBwKHRoaXMuZWxzWzFdKTtcbiAgICAgICAgdmFyIGMgPSBwKHRoaXMuZWxzWzJdKTtcbiAgICAgICAgdmFyI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QuZWxlbWVudC5hcHBlbmRDaGlsZCh0aGlzLmNhbnZhcyk7XG4gICAgfVxuICAgIERlY29yYXRvci5wcm90b3R5cGUuJHVwZGF0ZURlY29yYXRvcnMgPSBmdW5jdGlvbiAoY29uZmlnKSB7XG4gICAgICAgIHZhciBjb2xvcnMgPSAodGhpcy5yZW5kZXJlci50aGVtZS5pc0RhcmsgPT09IHRydWUpID8gdGhpcy5jb2xvcnMuZGFyayA6IHRoaXMuY29sb3JzLmxpZ2h0O1xuICAgICAgICBpZiAoY29uZmlnKSB7XG4gICAgICAgICAgICB0aGlzLm1heEhlaWdodCA9IGNvbmZpZy5tYXhIZWlnaHQ7XG4gICAgICAgICAgICB0aGlzLmxpbmVIZWlnaHQgPSBjb25maWcubGluZUhlaWdodDtcbiAgICAgICAgICAgIHRoaXMuY2FudmFzSGVpZ2h0ID0gY29uZmlnLmhlaWdodDtcbiAgICAgICAgICAgIHZhciBhbGxMaW5lSGVpZ2h0ID0gKGNvbmZpZy5sYXN0Um93ICsgMSkgKiB0aGlzLmxpbmVIZWlnaHQ7XG4gICAgICAgICAgICBpZiAoYWxsTGluZUhlaWdodCA8IHRoaXMuY2FudmFzSGVpZ2h0KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oZWlnaHRSYXRpbyA9IDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmhlaWdodFJhdGlvID0gdGhpcy5jYW52YXNIZWlnaHQgLyB0aGlzLm1heEhlaWdodDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB2YXIgY3R4ID0gdGhpcy5jYW52YXMuZ2V0Q29udGV4dChcIjJkXCIpO1xuICAgICAgICBmdW5jdGlvbiBjb21wYXJlKGEsIGIpIHtcbiAgICAgICAgICAgIGlmIChhLnByaW9yaXR5IDwgYi5wcmlvcml0eSlcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICBpZiAoYS5wcmlvcml0eSA+IGIucHJpb3JpdHkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIDE7XG4gICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgfVxuICAgICAgICB2YXIgYW5ub3RhdGlvbnMgPSB0aGlzLnJlbmRlcmVyLnNlc3Npb24uJGFubm90YXRpb25zO1xuICAgICAgICBjdHguY2xlYXJSZWN0KDAsIDAsIHRoaXMuY2FudmFzLndpZHRoLCB0aGlzLmNhbnZhcy5oZWlnaHQpO1xuICAgICAgICBpZiAoYW5ub3RhdGlvbnMpIHtcbiAgICAgICAgICAgIHZhciBwcmlvcml0aWVzID0ge1xuICAgICAgICAgICAgICAgIFwiaW5mb1wiOiAxLFxuICAgICAgICAgICAgICAgIFwid2FybmluZ1wiOiAyLFxuICAgICAgICAgICAgICAgIFwiZXJyb3JcIjogM1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFubm90YXRpb25zLmZvckVhY2goZnVuY3Rpb24gKGl0ZW0pIHtcbiAgICAgICAgICAgICAgICBpdGVtLnByaW9yaXR5ID0gcHJpb3JpdGllc1tpdGVtLnR5cGVdIHx8IG51bGw7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGFubm90YXRpb25zID0gYW5ub3RhdGlvbnMuc29ydChjb21wYXJlKTtcbiAgICAgICAgICAgIHZhciBmb2xkRGF0YSA9IHRoaXMucmVuZGVyZXIuc2Vzc2lvbi4kZm9sZERhdGE7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFubm90YXRpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJvdyA9IGFubm90YXRpb25zW2ldLnJvdztcbiAgICAgICAgICAgICAgICB2YXIgY29tcGVuc2F0ZUZvbGQgPSB0aGlzLmNvbXBlbnNhdGVGb2xkUm93cyhyb3csIGZvbGREYXRhKTtcbiAgICAgICAgICAgICAgICB2YXIgY3VycmVudFkgPSBNYXRoLnJvdW5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XRhLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgZm9sZERhdGEubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpZiAocm93ID4gZm9sZERhdGFbal0uc3RhcnQucm93ICYmIHJvdyA8IGZvbGREYXRhW2pdLmVuZC5yb3cpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tcGVuc2F0ZUZvbGQgKz0gcm93IC0gZm9sZERhdGFbal0uc3RhcnQucm93O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChyb3cgPj0gZm9sZERhdGFbal0uZW5kLnJvdykge1xuICAgICAgICAgICAgICAgICAgICBjb21wZW5zYXRlRm9sZCArPSBmb2xkRGF0YVtqXS5lbmQucm93IC0gZm9sZERhdGFbal0uc3RhcnQucm93O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gY29tcGVuc2F0ZUZvbGQ7XG4gICAgfTtcbiAgICByZXR1cm4gRGVjb3JhdG9yO1xufSgpKTtcbm9vcC5pbXBsZW1lbnQoRGVjb3JhdG9yLnByb3RvdHlwZSwgRXZlbnRFbWl0dGVyKTtcbmV4cG9ydHMuRGVjb3JhdG9yID0gRGVjb3JhdG9yO1xuXG59KTtcblxuYWNlLmRlZmluZShcImFjZS92aXJ0dWFsX3JlbmRlcmVyXCIsW1wicmVxdWlyZVwiLFwiZXhwb3J0c1wiLFwibW9kdWxlXCIsXCJhY2UvbGliL29vcFwiLFwiYWNlL2xpYi9kb21cIixcImFjZS9saWIvbGFuZ1wiLFwiYWNlL2NvbmZpZ1wiLFwiYWNlL2xheWVyL2d1dHRlclwiLFwiYWNlL2xheWVyL21hcmtlclwiLFwiYWNlL2xheWVyL3RleHRcIixcImFjZS9sYXllci9jdXJzb3JcIixcImFjZS9zY3JvbGxiYXJcIixcImFjZS9zY3JvbGxiYXJcIixcImFjZS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7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnNjcm9sbFRvcCA9IDA7XG4gICAgICAgIHRoaXMuc2Nyb2xsTGVmdCA9IDA7XG4gICAgICAgIHRoaXMuY3Vyc29yUG9zID0ge1xuICAgICAgICAgICAgcm93OiAwLFxuICAgICAgICAgICAgY29sdW1uOiAwXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMuJGZvbnRNZXRyaWNzID0gbmV3IEZvbnRNZXRyaWNzKHRoaXMuY29udGFpbmVyKTtcbiAgICAgICAgdGhpcy4kdGV4dExheWVyLiRzZXRGb250TWV0cmljcyh0aGlzLiRmb250TWV0cmljcyk7XG4gICAgICAgIHRoaXMuJHRleHRMYXllci5vbihcImNoYW5nZUNoYXJhY3RlclNpemVcIiwgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgIF9zZWxmLnVwZGF0ZUNoYXJhY3RlclNpemUoKTtcbiAgICAgICAgICAgIF9zZWxmLm9uUmVzaXplKHRydWUsIF9zZWxmLmd1dHRlcldpZHRoLCBfc2VsZi4kc2l6ZS53aWR0aCwgX3NlbGYuJHNpemUuaGVpZ2h0KTtcbiAgICAgICAgICAgIF9zZWxmLl9zaWduYWwoXCJjaGFuZ2VDaGFyYWN0ZXJTaXplXCIsIGUpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy4kc2l6ZSA9IHtcbiAgICAgICAgICAgIHdpZHRoOiAwLFxuICAgICAgICAgICAgaGVpZ2h0OiAwLFxuICAgICAgICAgICAgc2Nyb2xsZXJIZWlnaHQ6IDAsXG4gICAgICAgICAgICBzY3JvbGxlcldpZHRoOiAwLFxuICAgICAgICAgICAgJGRpcnR5OiB0cnVlXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMubGF5ZXJDb25maWcgPSB7XG4gICAgICAgICAgICB3aWR0aDogMSxcbiAgICAgICAgICAgIHBhZGRpbmc6IDAsXG4gICAgICAgICAgICBmaXJzdFJvdzogMCxcbiAgICAgICAgICAgIGZpcnN0Um93U2NyZWVuOiAwLFxuICAgICAgICAgICAgbGFzdFJvdzogMCxcbiAgICAgICAgICAgIGxpbmVIZWlnaHQ6IDAsXG4gICAgICAgICAgICBjaGFyYWN0ZXJXaWR0aDogMCxcbiAgICAgICAgICAgIG1pbkhlaWdodDogMSxcbiAgICAgICAgICAgIG1heEhlaWdodDogMSxcbiAgICAgICAgICAgIG9mZnNldDogMCxcbiAgICAgICAgICAgIGhlaWdodDogMSxcbiAgICAgICAgICAgIGd1dHRlck9mZnNldDogMVxuICAgICAgICB9O1xuICAgICAgICB0aGlzLnNjcm9sbE1hcmdpbiA9IHtcbiAgICAgICAgICAgIGxlZnQ6IDAsXG4gICAgICAgICAgICByaWdodDogMCxcbiAgICAgICAgICAgIHRvcDogMCxcbiAgICAgICAgICAgIGJvdHRvbTogMCxcbiAgICAgICAgICAgIHY6IDAsXG4gICAgICAgICAgICBoOiAwXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMubWFyZ2luID0ge1xuICAgICAgICAgICAgbGVmdDogMCxcbiAgICAgICAgICAgIHJpZ2h0OiAwLFxuICAgICAgICAgICAgdG9wOiAwLFxuICAgICAgICAgICAgYm90dG9tOiAwLFxuICAgICAgICAgICAgdjogMCxcbiAgICAgICAgICAgIGg6IDBcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy4ka2VlcFRleHRBcmVhQXRDdXJzb3IgPSAhdXNlcmFnZW50LmlzSU9TO1xuICAgICAgICB0aGlzLiRsb29wID0gbmV3IFJlbmRlckxvb3AodGhpcy4kcmVuZGVyQ2hhbmdlcy5iaW5kKHRoaXMpLCB0aGlzLmNvbnRhaW5lci5vd25lckRvY3VtZW50LmRlZmF1bHRWaWV3KTtcbiAgICAgICAgdGhpcy4kbG9vcC5zY2hlZHVsZSh0aGlzLkNIQU5HRV9GVUxMKTtcbiAgICAgICAgdGhpcy51cGRhdGVDaGFyYWN0ZXJTaXplKCk7XG4gICAgICAgIHRoaXMuc2V0UGFkZGluZyg0KTtcbi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iLCBjaGFuZ2VzKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY2hhbmdlcyAmIHRoaXMuQ0hBTkdFX1NDUk9MTCkge1xuICAgICAgICAgICAgdGhpcy4kY2hhbmdlZExpbmVzID0gbnVsbDtcbiAgICAgICAgICAgIGlmIChjaGFuZ2VzICYgdGhpcy5DSEFOR0VfVEVYVCB8fCBjaGFuZ2VzICYgdGhpcy5DSEFOR0VfTElORVMpXG4gICAgICAgICAgICAgICAgdGhpcy4kdGV4dExheWVyLnVwZGF0ZShjb25maWcpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHRoaXMuJHRleHRMYXllci5zY3JvbGxMaW5lcyhjb25maWcpO1xuICAgICAgICAgICAgaWYgKHRoaXMuJHNob3dHdXR0ZXIpIHtcbiAgICAgICAgICAgICAgICBpZiAoY2hhbmdlcyAmIHRoaXMuQ0hBTkdFX0dVVFRFUiB8fCBjaGFuZ2VzICYgdGhpcy5DSEFOR0VfTElORVMpXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJGd1dHRlckxheWVyLnVwZGF0ZShjb25maWcpO1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgdGhpcy4kZ3V0dGVyTGF5ZXIuc2Nyb2xsTGluZXMoY29uZmlnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLiRjdXN0b21TY3JvbGxiYXIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiRzY3JvbGxEZWNvcmF0b3IuJHVwZGF0ZURlY29yYXRvcnMoY29uZmlnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuJG1hcmtlckJhY2sudXBkYXRlKGNvbmZpZyk7XG4gICAgICAgICAgICB0aGlzLiRtYXJrZXJGcm9udC51cGRhdGUoY29uZmlnKTtcbiAgICAgICAgICAgIHRoaXMuJGN1cnNvckxheWVyLnVwZGF0ZShjb25maWcpO1xuICAgICAgICAgICAgdGhpcy4kbW92ZVRleHRBcmVhVG9DdXJzb3IoKTtcbiAgICAgICAgICAgIHRoaXMuX3NpZ25hbChcImFmdGVyUmVuZGVyXCIsIGNoYW5nZXMpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjaGFuZ2VzICYgdGhpcy5DSEFOR0VfVEVYVCkge1xuICAgICAgICAgICAgdGhpcy4kY2hhbmdlZExpbmVzID0gbnVsbDtcbiAgICAgICAgICAgIHRoaXMuJHRleHRMYXllci51cGRhdGUoY29uZmlnKTtcbiAgICAgICAgICAgIGlmICh0aGlzLiRzaG93R3V0dGVyKVxuICAgICAgICAgICAgICAgIHRoaXMuJGd1dHRlckxheWVyLnVwZGF0ZShjb25maWcpO1xuICAgICAgICAgICAgaWYgKHRoaXMuJGN1c3RvbVNjcm9sbGJhcikge1xuICAgICAgICAgICAgICAgIHRoaXMuJHNjcm9sbERlY29yYXRvci4kdXBkYXRlRGVjb3JhdG9ycyhjb25maWcpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGNoYW5nZXMgJiB0aGlzLkNIQU5HRV9MSU5FUykge1xuICAgICAgICAgICAgaWYgKHRoaXMuJHVwZGF0ZUxpbmVzKCkgfHwgKGNoYW5nZXMgJiB0aGlzLkNIQU5HRV9HVVRURVIpICYmIHRoaXMuJHNob3dHdXR0ZXIpXG4gICAgICAgICAgICAgICAgdGhpcy4kZ3V0dGVyTGF5ZXIudXBkYXRlKGNvbmZpZyk7XG4gICAgICAgICAgICBpZiAodGhpcy4kY3VzdG9tU2Nyb2xsYmFyKSB7XG4gICAgICAgICAgICAgICAgdGhpcy4kc2Nyb2xsRGVjb3JhdG9yLiR1cGRhdGVEZWNvcmF0b3JzKGNvbmZpZyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoY2hhbmdlcyAmIHRoaXM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biAgICAgICAgdGhpcy4kY2hhbmdlZExpbmVzID0gbnVsbDtcbiAgICAgICAgdmFyIGxheWVyQ29uZmlnID0gdGhpcy5sYXllckNvbmZpZztcbiAgICAgICAgaWYgKGZpcnN0Um93ID4gbGF5ZXJDb25maWcubGFzdFJvdyArIDEpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAobGFzdFJvdyA8IGxheWVyQ29uZmlnLmZpcnN0Um93KSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGxhc3RSb3cgPT09IEluZmluaXR5KSB7XG4gICAgICAgICAgICBpZiAodGhpcy4kc2hvd0d1dHRlcilcbiAgICAgICAgICAgICAgICB0aGlzLiRndXR0ZXJMYXllci51cGRhdGUobGF5ZXJDb25maWcpO1xuICAgICAgICAgICAgdGhpcy4kdGV4dExheWVyLnVwZGF0ZShsYXllckNvbmZpZyk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy4kdGV4dExheWVyLnVwZGF0ZUxpbmVzKGxheWVyQ29uZmlnLCBmaXJzdFJvdywgbGFzdFJvdyk7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH07XG4gICAgVmlydHVhbFJlbmRlcmVyLnByb3RvdHlwZS4kZ2V0TG9uZ2VzdExpbmUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBjaGFyQ291bnQgPSB0aGlzLnNlc3Npb24uZ2V0U2NyZWVuV2lkdGgoKTtcbiAgICAgICAgaWYgKHRoaXMuc2hvd0ludmlzaWJsZXMgJiYgIXRoaXMuc2Vzc2lvbi4kdXNlV3JhcE1vZGUpXG4gICAgICAgICAgICBjaGFyQ291bnQgKz0gMTtcbiAgICAgICAgaWYgKHRoaXMuJHRleHRMYXllciAmJiBjaGFyQ291bnQgPiB0aGlzLiR0ZXh0TGF5ZXIuTUFYX0xJTkVfTEVOR1RIKVxuICAg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cy4kdGltZXIpO1xuICAgICAgICBfc2VsZi5zZXNzaW9uLnNldFNjcm9sbFRvcChzdGVwcy5zaGlmdCgpKTtcbiAgICAgICAgX3NlbGYuc2Vzc2lvbi4kc2Nyb2xsVG9wID0gdG9WYWx1ZTtcbiAgICAgICAgZnVuY3Rpb24gZW5kQW5pbWF0aW9uKCkge1xuICAgICAgICAgICAgX3NlbGYuJHRpbWVyID0gY2xlYXJJbnRlcnZhbChfc2VsZi4kdGltZXIpO1xuICAgICAgICAgICAgX3NlbGYuJHNjcm9sbEFuaW1hdGlvbiA9IG51bGw7XG4gICAgICAgICAgICBfc2VsZi4kc3RvcEFuaW1hdGlvbiA9IGZhbHNlO1xuICAgICAgICAgICAgY2FsbGJhY2sgJiYgY2FsbGJhY2soKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLiR0aW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmIChfc2VsZi4kc3RvcEFuaW1hdGlvbikge1xuICAgICAgICAgICAgICAgIGVuZEFuaW1hdGlvbigpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghX3NlbGYuc2Vzc2lvbilcbiAgICAgICAgICAgICAgICByZXR1cm4gY2xlYXJJbnRlcnZhbChfc2VsZi4kdGltZXIpO1xuICAgICAgICAgICAgaWYgKHN0ZXBzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIF9zZWxmLnNlc3Npb24uc2V0U2Nyb2xsVG9wKHN0ZXBzLnNoaWZ0KCkpO1xuICAgICAgICAgICAgICAgIF9zZWxmLnNlc3Npb24uJHNjcm9sbFRvcCA9IHRvVmFsdWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh0b1ZhbHVlICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBfc2VsZi5zZXNzaW9uLiRzY3JvbGxUb3AgPSAtMTtcbiAgICAgICAgICAgICA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GF5VG9rZW5zKHRleHRMaW5lc1tpXSwgcG9zaXRpb24uY29sdW1uKTtcbiAgICAgICAgICAgIHZhciB3cmFwU3BsaXRzID0gdGhpcy5zZXNzaW9uLiRjb21wdXRlV3JhcFNwbGl0cyhkaXNwbGF5VG9rZW5zLCBsaW1pdCwgdGhpcy5zZXNzaW9uLiR0YWJTaXplKTtcbiAgICAgICAgICAgIGlmICh3cmFwU3BsaXRzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICB2YXIgc3RhcnQgPSAwO1xuICAgICAgICAgICAgICAgIHdyYXBTcGxpdHMucHVzaCh0ZXh0TGluZXNbaV0ubGVuZ3RoKTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHdyYXBTcGxpdHMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRleHRTbGljZSA9IHRleHRMaW5lc1tpXS5zbGljZShzdGFydCwgd3JhcFNwbGl0c1tqXSk7XG4gICAgICAgICAgICAgICAgICAgIHRleHRDaHVua3MucHVzaCh7IHRleHQ6IHRleHRTbGljZSwgd3JhcHBlZDogdHJ1ZSB9KTtcbiAgICAgICAgICAgICAgICAgICAgc3RhcnQgPSB3cmFwU3BsaXRzW2pdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRleHRDaHVua3MucHVzaCh7IHRleHQ6IHRleHRMaW5lc1tpXSwgd3JhcHBlZDogZmFsc2UgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRleHRDaHVua3M7XG4gICAgfTtcbiAgICBWaXJ0dWFsUmVuZGVyZXIucHJvdG90eXBlLnJlbW92ZUdob3N0VGV4dCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKCF0aGlzLiRnaG9zdFRleHQpXG4gICAgICAgICAgICByZXR1cm47XG4gICA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WR1bGUodGhpcy5DSEFOR0VfR1VUVEVSKTtcbiAgICAgICAgfSxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiB0cnVlXG4gICAgfSxcbiAgICBkaXNwbGF5SW5kZW50R3VpZGVzOiB7XG4gICAgICAgIHNldDogZnVuY3Rpb24gKHNob3cpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLiR0ZXh0TGF5ZXIuc2V0RGlzcGxheUluZGVudEd1aWRlcyhzaG93KSlcbiAgICAgICAgICAgICAgICB0aGlzLiRsb29wLnNjaGVkdWxlKHRoaXMuQ0hBTkdFX1RFWFQpO1xuICAgICAgICB9LFxuICAgICAgICBpbml0aWFsVmFsdWU6IHRydWVcbiAgICB9LFxuICAgIGhpZ2hsaWdodEluZGVudEd1aWRlczoge1xuICAgICAgICBzZXQ6IGZ1bmN0aW9uIChzaG93KSB7XG4gICAgICAgICAgICBpZiAodGhpcy4kdGV4dExheWVyLnNldEhpZ2hsaWdodEluZGVudEd1aWRlcyhzaG93KSA9PSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy4kdGV4dExheWVyLiRoaWdobGlnaHRJbmRlbnRHdWlkZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy4kdGV4dExheWVyLiRjbGVhckFjdGl2ZUluZGVudEd1aWRlKHRoaXMuJHRleHRMYXllci4kbGluZXMuY2VsbHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBpbml0aWFsVmFsdWU6IHRydWVcbiAgICB9LFxuICAgIGhpZ2hsaWdodEd1dHRlckxpbmU6IHtcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAoc2hvdWxkSGlnaGxpZ2h0KSB7XG4gICAgICAgICAgICB0aGlzLiRndXR0ZXJMYXllci5zZXRIaWdobGlnaHRHdXR0ZXJMaW5lKHNob3VsZEhpZ2hsaWdodCk7XG4gICAgICAgICAgICB0aGlzLiRsb29wLn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XBsYWNlKC8oXFwuanMpPyhcXD8uKik/JC8sIFwiXCIpKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy4kd29ya2VyID0gY3JlYXRlV29ya2VyKHdvcmtlclVybCk7XG4gICAgICAgIGlmIChpbXBvcnRTY3JpcHRzKSB7XG4gICAgICAgICAgICB0aGlzLnNlbmQoXCJpbXBvcnRTY3JpcHRzXCIsIGltcG9ydFNjcmlwdHMpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuJHdvcmtlci5wb3N0TWVzc2FnZSh7XG4gICAgICAgICAgICBpbml0IDogdHJ1ZSxcbiAgICAgICAgICAgIHRsbnMgOiB0bG5zLFxuICAgICAgICAgICAgbW9kdWxlIDogbW9kLFxuICAgICAgICAgICAgY2xhc3NuYW1lIDogY2xhc3NuYW1lXG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdGhpcy4kd29ya2VyO1xuICAgIH07XG5cbiAgICB0aGlzLm9uTWVzc2FnZSA9IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgdmFyIG1zZyA9IGUuZGF0YTtcbiAgICAgICAgc3dpdGNoIChtc2cudHlwZSkge1xuICAgICAgICAgICAgY2FzZSBcImV2ZW50XCI6XG4gICAgICAgICAgICAgICAgdGhpcy5fc2lnbmFsKG1zZy5uYW1lLCB7ZGF0YTogbXNnLmRhdGF9KTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgXCJjYWxsXCI6XG4gICAgICAgICAgICAgICAgdmFyIGNhbGxiYWNrID0gdGhpcy5jYWxsYmFja3NbbXNnLmlkXTtcbiAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2sobXNnLmRhdGEpO1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgdGhpcy5jYWxsYmFja3NbbXNnLmlkXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIFwiZXJyb3JcIjpcbiAgICAgICAgICAgICAgICB0aGlzLnJlcG9ydEVycm9yKG1zZy5kYXRhKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgXCJsb2dcIjpcbiAgICAgICAgICAgICAgICB3aW5kb3cuY29uc29sZSAmJiBjb25zb2xlLmxvZyAmJiBjb25zb2xlLmxvZy5hcHBseShjb25zb2xlLCBtc2cuZGF0YSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIFxuICAgIHRoaXMucmVwb3J0RXJyb3IgPSBmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgd2luZG93LmNvbnNvbGUgJiYgY29uc29sZS5lcnJvciAmJiBjb25zb2xlLmVycm9yKGVycik7XG4gICAgfTtcblxuICAgIHRoaXMuJG5vcm1hbGl6ZVBhdGggPSBmdW5jdGlvbihwYXRoKSB7XG4gICAgICAgIHJldHVybiBuZXQucXVhbGlmeVVSTChwYXRoKTtcbiAgICB9O1xuXG4gICAgdGhpcy50ZXJtaW5hdGUgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgdGhpcy5fc2lnbmFsKFwidGVybWluYXRlXCIsIHt9KTtcbiAgICAgICAgdGhpcy5kZWx0YVF1ZXVlID0gbnVsbDtcbiAgICAgICAgdGhpcy4kd29ya2VyLnRlcm1pbmF0ZSgpO1xuICAgICAgICB0aGlzLiR3b3JrZXIub25lcnJvciA9IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy4kd29ya2VyID0gbnVsbDtcbiAgICAgICAgaWYgKHRoaXMuJGRvYylcbiAgICAgICAgICAgIHRoaXMuJGRvYy5vZmYoXCJjaGFuZ2VcIiwgdGhpcy5jaGFuZ2VMaXN0ZW5lcik7XG4gICAgICAgIHR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gaW50byBsaW5lc1wiLFxuICAgICAgICBleGVjOiBmdW5jdGlvbiAoZWRpdG9yKSB7XG4gICAgICAgICAgICBpZiAoZWRpdG9yLm11bHRpU2VsZWN0LnJhbmdlQ291bnQgPiAxKVxuICAgICAgICAgICAgICAgIGVkaXRvci5tdWx0aVNlbGVjdC5qb2luU2VsZWN0aW9ucygpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIGVkaXRvci5tdWx0aVNlbGVjdC5zcGxpdEludG9MaW5lcygpO1xuICAgICAgICB9LFxuICAgICAgICBiaW5kS2V5OiB7IHdpbjogXCJDdHJsLUFsdC1MXCIsIG1hYzogXCJDdHJsLUFsdC1MXCIgfSxcbiAgICAgICAgcmVhZE9ubHk6IHRydWVcbiAgICB9LCB7XG4gICAgICAgIG5hbWU6IFwic3BsaXRTZWxlY3Rpb25JbnRvTGluZXNcIixcbiAgICAgICAgZGVzY3JpcHRpb246IFwiU3BsaXQgaW50byBsaW5lc1wiLFxuICAgICAgICBleGVjOiBmdW5jdGlvbiAoZWRpdG9yKSB7IGVkaXRvci5tdWx0aVNlbGVjdC5zcGxpdEludG9MaW5lcygpOyB9LFxuICAgICAgICByZWFkT25seTogdHJ1ZVxuICAgIH0sIHtcbiAgICAgICAgbmFtZTogXCJhbGlnbkN1cnNvcnNcIixcbiAgICAgICAgZGVzY3JpcHRpb246IFwiQWxpZ24gY3Vyc29yc1wiLFxuICAgICAgICBleGVjOiBmdW5jdGlvbiAoZWRpdG9yKSB7IGVkaXRvci5hbGlnbkN1cnNvcnMoKTsgfSxcbiAgICAgICAgYmluZEtleTogeyB3aW46IFwiQ3RybC1BbHQtQVwiLCBtYWM6IFwiQ3RybC1BbHQtQVwiIH0sXG4gICAgICAgIHNjcm9sbEludG9WaWV3OiBcImN1cnNvclwiXG4gICAgfSwge1xuICAgICAgICBuYW1lOiBcImZpbmRBbGxcIixcbiAgICAgICAgZGVzY3JpcHRpb246IFwiRmluZCBhbGxcIixcbiAgICAg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0VuZCAmJiBpc1NhbWVQb2ludChyYW5nZS5lbmQsIGRvY0VuZCkpXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGRvY0VuZCA9IHJhbmdlLmVuZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJhbmdlLmN1cnNvciA9IHhCYWNrd2FyZHMgPyByYW5nZS5zdGFydCA6IHJhbmdlLmVuZDtcbiAgICAgICAgICAgIHJlY3RTZWwucHVzaChyYW5nZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHlCYWNrd2FyZHMpXG4gICAgICAgICAgICByZWN0U2VsLnJldmVyc2UoKTtcbiAgICAgICAgaWYgKCFpbmNsdWRlRW1wdHlMaW5lcykge1xuICAgICAgICAgICAgdmFyIGVuZCA9IHJlY3RTZWwubGVuZ3RoIC0gMTtcbiAgICAgICAgICAgIHdoaWxlIChyZWN0U2VsW2VuZF0uaXNFbXB0eSgpICYmIGVuZCA+IDApXG4gICAgICAgICAgICAgICAgZW5kLS07XG4gICAgICAgICAgICBpZiAoZW5kID4gMCkge1xuICAgICAgICAgICAgICAgIHZhciBzdGFydCA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKHJlY3RTZWxbc3RhcnRdLmlzRW1wdHkoKSlcbiAgICAgICAgICAgICAgICAgICAgc3RhcnQrKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAodmFyIGkgPSBlbmQ7IGkgPj0gc3RhcnQ7IGktLSkge1xuICAgICAgICAgICAgICAgIGlmIChyZWN0U2VsW2ldLmlzRW1wdHkoKSlcbiAgICAgICAgICAgICAgICAgICAgcmVjdFNlbC5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlY3RTZWw7XG4gICAgfTtcbn0pLmNhbGwoU2VsZWN0aW9uLnByb3RvdHlwZSk7XG52YXIgRWRpdG9yID0gcmVxdWlyZShcIi4vZWRp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VsLnJhbmdlcztcbiAgICAgICAgZm9yICh2YXIgaSA9IGFsbC5sZW5ndGg7IGktLTspIHtcbiAgICAgICAgICAgIHZhciByYW5nZSA9IGFsbFtpXTtcbiAgICAgICAgICAgIGlmIChyYW5nZS5pc0VtcHR5KCkpIHtcbiAgICAgICAgICAgICAgICB2YXIgdG1wXzEgPSBzZXNzaW9uLmdldFdvcmRSYW5nZShyYW5nZS5zdGFydC5yb3csIHJhbmdlLnN0YXJ0LmNvbHVtbik7XG4gICAgICAgICAgICAgICAgcmFuZ2Uuc3RhcnQucm93ID0gdG1wXzEuc3RhcnQucm93O1xuICAgICAgICAgICAgICAgIHJhbmdlLnN0YXJ0LmNvbHVtbiA9IHRtcF8xLnN0YXJ0LmNvbHVtbjtcbiAgICAgICAgICAgICAgICByYW5nZS5lbmQucm93ID0gdG1wXzEuZW5kLnJvdztcbiAgICAgICAgICAgICAgICByYW5nZS5lbmQuY29sdW1uID0gdG1wXzEuZW5kLmNvbHVtbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzZWwubWVyZ2VPdmVybGFwcGluZ1JhbmdlcygpO1xuICAgICAgICB2YXIgd29yZHMgPSBbXTtcbiAgICAgICAgZm9yICh2YXIgaSA9IGFsbC5sZW5ndGg7IGktLTspIHtcbiAgICAgICAgICAgIHZhciByYW5nZSA9IGFsbFtpXTtcbiAgICAgICAgICAgIHdvcmRzLnVuc2hpZnQoc2Vzc2lvbi5nZXRUZXh0UmFuZ2UocmFuZ2UpKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZGlyIDwgMClcbiAgICAgICAgICAgIHdvcmRzLnVuc2hpZnQod29yZHMucG9wKCkpO1xuICAgICAgICBlbHNlXG4gICAgICAgICAgICB3b3Jkcy5wdXNoKHdvcmRzLnNoaWZ0KCkpO1xuICAgICAgICBmb3IgKHZhciBpID0gYWxsLmxlbmd0aDsgaS0tOykge1xuICAgICAgICAgICAgdmFyIHJhbmdlID0gYWxsW2ldO1x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AgICB2YXIgZnIgPSByYW5nZS5zdGFydC5yb3csIGxyID0gcmFuZ2UuZW5kLnJvdztcbiAgICAgICAgICAgIHZhciBndWVzc1JhbmdlID0gZnIgPT0gbHI7XG4gICAgICAgICAgICBpZiAoZ3Vlc3NSYW5nZSkge1xuICAgICAgICAgICAgICAgIHZhciBtYXggPSB0aGlzLnNlc3Npb24uZ2V0TGVuZ3RoKCk7XG4gICAgICAgICAgICAgICAgdmFyIGxpbmU7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBsaW5lID0gdGhpcy5zZXNzaW9uLmdldExpbmUobHIpO1xuICAgICAgICAgICAgICAgIH0gd2hpbGUgKC9bPTpdLy50ZXN0KGxpbmUpICYmICsrbHIgPCBtYXgpO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgbGluZSA9IHRoaXMuc2Vzc2lvbi5nZXRMaW5lKGZyKTtcbiAgICAgICAgICAgICAgICB9IHdoaWxlICgvWz06XS8udGVzdChsaW5lKSAmJiAtLWZyID4gMCk7XG4gICAgICAgICAgICAgICAgaWYgKGZyIDwgMClcbiAgICAgICAgICAgICAgICAgICAgZnIgPSAwO1xuICAgICAgICAgICAgICAgIGlmIChsciA+PSBtYXgpXG4gICAgICAgICAgICAgICAgICAgIGxyID0gbWF4IC0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBsaW5lcyA9IHRoaXMuc2Vzc2lvbi5yZW1vdmVGdWxsTGluZXMoZnIsIGxyKTtcbiAgICAgICAgICAgIGxpbmVzID0gdGhpcy4kcmVBbGlnblRleHQobGluZXMsIGd1ZXNzUmFuZ2UpO1xuICAgICAgICAgICAgdGhpcy5zZXNzaW9uLmluc2VydCh7IHJvdzogZnIsIGNvbHVtbjogMCB9LCBsaW5lcy5qb2luKFwiXFxuXCIpICsgXCJcXG5cIik7XG4gICAgICAgICAgICBpZiAoIWd1ZXNzUmFuZ2UpIHtcbiAgICAgICAgICAgICAgICByYW5nZS5zdGFydC5jb2x1bW4gPSAwO1xuICAgICAgICAgICAgICAgIHJhbmdlLmVuZC5jb2x1bW4gPSBsaW5lc1tsaW5lcy5sZW5ndGggLSAxXS5sZW5ndGg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLnNlbGVjdGlvbi5zZXRSYW5nZShyYW5nZSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBzYW1lUm93UmFuZ2VzLmZvckVhY2goZnVuY3Rpb24gKHIpIHtcbiAgICAgICAgICAgICAgICBzZWwuc3Vic3RyYWN0UG9pbnQoci5jdXJzb3IpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB2YXIgbWF4Q29sID0gMDtcbiAgICAgICAgICAgIHZhciBtaW5TcGFjZSA9IEluZmluaXR5O1xuICAgICAgICAgICAgdmFyIHNwYWNlT2Zmc2V0cyA9IHJhbmdlcy5tYXAoZnVuY3Rpb24gKHIpIHtcbiAgICAgICAgICAgICAgICB2YXIgcCA9IHIuY3Vyc29yO1xuICAgICAgICAgICAgICAgIHZhciBsaW5lID0gc2Vzc2lvbi5nZXRMaW5lKHAucm93KTtcbiAgICAgICAgICAgICAgICB2YXIgc3BhY2VPZmZzZXQgPSBsaW5lLnN1YnN0cihwLmNvbHVtbikuc2VhcmNoKC9cXFMvZyk7XG4gICAgICAgICAgICAgICAgaWYgKHNwYWNlT2Zmc2V0ID09IC0xKVxuICAgICAgICAgICAgICAgICAgICBzcGFjZU9mZnNldCA9IDA7XG4gICAgICAgICAgICAgICAgaWYgKHAuY29sdW1uID4gbWF4Q29sKVxuICAgICAgICAgICAgICAgICAgICBtYXhDb2wgPSBwLmNvbHVtbjtcbiAgICAgICAgICAgICAgICBpZiAoc3BhY2VPZmZzZXQgPCBtaW5TcGFjZSlcbiAgICAgICAgICAgICAgICAgICAgbWluU3BhY2UgPSBzcGFjZU9mZnNldDtcbiAgICAgICAgICAgICAgICByZXR1cm4gc3BhY2VPZmZzZXQ7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJhbmdlcy5mb3JFYWNoKGZ1bmN0aW9uIChyLCBpKSB7XG4gICAgICAgICAgICAgICAgdmFyIHAgPSByLmN1cnNvcjtcbiAgICAgICAgICAgICAgICB2YXIgbCA9IG1heENvbCAtIHAuY29sdW1uO1xuICAgICAgICAgICAgICAgIHZhciBkID0gc3BhY2VPZmZzZXRzW2ldIC0gbWluU3BhY2U7XG4gICAgICAgICAgICAgICAgaWYgKGwgPiBkKVxuICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLmluc2VydChwLCBsYW5nLnN0cmluZ1JlcGVhdChcIiBcIiwgbCAtIGQpKTtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIHNlc3Npb24ucmVtb3ZlKG5ldyBSYW5nZShwLnJvdywgcC5jb2x1bW4sIHAucm93LCBwLmNvbHVtbiAtIGwgKyBkKSk7XG4gICAgICAgICAgICAgICAgci5zdGFydC5jb2x1bW4gPSByLmVuZC5jb2x1bW4gPSBtYXhDb2w7XG4gICAgICAgICAgICAgICAgci5zdGFydC5yb3cgPSByLmVuZC5yb3cgPSBwLnJvdztcbiAgICAgICAgICAgICAgICByLmN1cnNvciA9IHIuZW5kO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBzZWwuZnJvbU9yaWVudGVkUmFuZ2UocmFuZ2VzWzBdKTtcbiAgICAgICAgICAgIHRoaXMucmVuZGVyZXIudXBkYXRlQ3Vyc29yKCk7XG4gICAgICAgICAgICB0aGlzLnJlbmRlcmVyLnVwZGF0ZUJhY2tNYXJrZXJzKCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIHRoaXMuJHJlQWxpZ25UZXh0ID0gZnVuY3Rpb24gKGxpbmVzLCBmb3JjZUxlZnQpIHtcbiAgICAgICAgdmFyIGlzTGVmdEFsaWduZWQgPSB0cnVlLCBpc1JpZ2h0QWxpZ25lZCA9IHRydWU7XG4gICAgICAgIHZhciBzdGFydFcsIHRleHRXLCBlbmRXO1xuICAgICAgICByZXR1cm4gbGluZXMubWFwKGZ1bmN0aW9uIChsaW5lKSB7XG4gICAgICAgICAgICB2YXIgbSA9IGxpbmUubWF0Y2goLyhcXHMqKSguKj8pKFxccyopKFs9Ol0uKikvKTtcbiAgICAgICAgICAgIGlmICghbSlcbiAgICAgICAgICAgICAgICByZXR1cm4gW2xpbmVdO1xuICAgICAgICAgICAgaWYgKHN0YXJ0VyA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgc3RhcnRXID0gbVsxXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgdGV4dFcgPSBtWzJdLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBlbmRXID0gbVszXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoc3RhcnRXICsgdGV4dFcgKyBlbmRXICE9IG1bMV0ubGVuZ3RoICsgbVsyXS5sZW5ndGggKyBtWzNdLmxlbmd0aClcbiAgICAgICAgICAgICAgICBpc1JpZ2h0QWxpZ25lZCA9IGZhbHNlO1xuICAgICAgICAgICAgaWYgKHN0YXJ0VyAhPSBtWzFdLmxlbmd0aClcbiAgICAgICAgICAgICAgICBpc0xlZnRBbGlnbmVkID0gZmFsc2U7XG4gICAgICAgICAgICBpZiAoc3RhcnRXID4gbVsxXS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgc3RhcnRXID0gbVsxXS5sZW5ndGg7XG4gICAgICAgICAgICBpZiAodGV4dFcgPCBtWzJdLmxlbmd0aClcbiAgICAgICAgICAgICAgICB0ZXh0VyA9IG1bMl0ubGVuZ3RoO1xuICAgICAgICAgICAgaWYgKGVuZFcgPiBtWzNdLmxlbmd0aClcbiAgICAgICAgICAgICAgICBlbmRXID0gbVszXS5sZW5ndGg7XG4gICAgICAgICAgICByZXR1cm4gbTtcbiAgICAgICAgfSkubWFwKGZvcmNlTGVmdCA/IGFsaWduTGVmdCA6XG4gICAgICAgICAgICBpc0xlZnRBbGlnbmVkID8gaXNSaWdodEFsaWduZWQgPyBhbGlnblJpZ2h0IDogYWxpZ25MZWZ0IDogdW5BbGlnbik7XG4gICAgICAgIGZ1bmN0aW9uIHNwYWNlcyhuKSB7XG4gICAgICAgICAgICByZXR1cm4gbGFuZy5zdHJpbmdSZXBlYXQoXCIgXCIsIG4pO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGFsaWduTGVmdChtKSB7XG4gICAgICAgICAgICByZXR1cm4gIW1bMl0gPyBtWzBdIDogc3BhY2VzKHN0YXJ0VykgKyBtWzJdXG4gICAgICAgICAgICAgICAgKyBzcGFjZXModGV4dFcgLSBtWzJdLmxlbmd0aCArIGVuZFcpXG4gICAgICAgICAgICAgICAgKyBtWzRdLnJlcGxhY2UoL14oWz06XSlcXHMrLywgXCIkMSBcIik7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gYWxpZ25SaWdodChtKSB7XG4gICAgICAgICAgICByZXR1cm4gIW1bMl0gPyBtWzBdIDogc3BhY2VzKHN0YXJ0VyArIHRleHRXIC0gbVsyXS5sZW5ndGgpICsgbVsyXVxuICAgICAgICAgICAgICAgICsgc3BhY2VzKGVuZFcpXG4gICAgICAgICAgICAgICAgKyBtWzRdLnJlcGxhY2UoL14oWz06XSlcXHMrLywgXCIkMSBcIik7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gdW5BbGlnbihtKSB7XG4gICAgICAgICAgICByZXR1cm4gIW1bMl0gPyBtWzBdIDogc3BhY2VzKHN0YXJ0VykgKyBtWzJdXG4gICAgICAgICAgICAgICAgKyBzcGFjZXMoZW5kVylcbiAgICAgICAgICAgICAgICArIG1bNF0ucmVwbGFjZSgvXihbPTpdKVxccysvLCBcIiQxIFwiKTtcbiAgICAgICAgfVxuICAgIH07XG59KS5jYWxsKEVkaXRvci5wcm90b3R5cGUpO1xuZnVuY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gICAgICB2YXIgbWF4Um93ID0gc2Vzc2lvbi5nZXRMZW5ndGgoKTtcbiAgICAgICAgdmFyIHN0YXJ0Um93ID0gcm93O1xuICAgICAgICB2YXIgZW5kUm93ID0gcm93O1xuICAgICAgICB3aGlsZSAoKytyb3cgPCBtYXhSb3cpIHtcbiAgICAgICAgICAgIHZhciBsZXZlbCA9IHNlc3Npb24uZ2V0TGluZShyb3cpLnNlYXJjaChyZSk7XG4gICAgICAgICAgICBpZiAobGV2ZWwgPT0gLTEpXG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICBpZiAobGV2ZWwgPD0gc3RhcnRMZXZlbCkge1xuICAgICAgICAgICAgICAgIHZhciB0b2tlbiA9IHNlc3Npb24uZ2V0VG9rZW5BdChyb3csIDApO1xuICAgICAgICAgICAgICAgIGlmICghdG9rZW4gfHwgdG9rZW4udHlwZSAhPT0gXCJzdHJpbmdcIilcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbmRSb3cgPSByb3c7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGVuZFJvdyA+IHN0YXJ0Um93KSB7XG4gICAgICAgICAgICB2YXIgZW5kQ29sdW1uID0gc2Vzc2lvbi5nZXRMaW5lKGVuZFJvdykubGVuZ3RoO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBSYW5nZShzdGFydFJvdywgc3RhcnRDb2x1bW4sIGVuZFJvdywgZW5kQ29sdW1uKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgdGhpcy5vcGVuaW5nQnJhY2tldEJsb2NrID0gZnVuY3Rpb24gKHNlc3Npb24sIGJyYWNrZXQsIHJvdywgY29sdW1uLCB0eXBlUmUpIHtcbiAgICAgICAgdmFyIHN0YXJ0ID0geyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gKyAxIH07XG4gICAgICAgIHZhciBlbmQgPSBzZXNzaW9uLiRmaW5kQ2xvc2luZ0JyYW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yKG5ldyBVbmRvTWFuYWdlcigpKTtcbiAgICByZXR1cm4gZG9jO1xufTtcbmV4cG9ydHMuUmFuZ2UgPSBSYW5nZTtcbmV4cG9ydHMuRWRpdG9yID0gRWRpdG9yO1xuZXhwb3J0cy5FZGl0U2Vzc2lvbiA9IEVkaXRTZXNzaW9uO1xuZXhwb3J0cy5VbmRvTWFuYWdlciA9IFVuZG9NYW5hZ2VyO1xuZXhwb3J0cy5WaXJ0dWFsUmVuZGVyZXIgPSBSZW5kZXJlcjtcbmV4cG9ydHMudmVyc2lvbiA9IGV4cG9ydHMuY29uZmlnLnZlcnNpb247XG5cbn0pOyAgICAgICAgICAgIChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBhY2UucmVxdWlyZShbXCJhY2UvYWNlXCJdLCBmdW5jdGlvbihhKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhLmNvbmZpZy5pbml0KHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYS5kZWZpbmUgPSBhY2UuZGVmaW5lO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHZhciBnbG9iYWwgPSAoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgICAgICAgICAgICAgIH0pKCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghZ2xvYmFsICYmIHR5cGVvZiB3aW5kb3cgIT0gXCJ1bmRlZmluZWRcIikgZ2xvYmFsID0gd2luZG93OyAvLyBjYW4gaGFwcGVuIGluIHN0cmljdCBtb2RlXG4gICAgICAgICAgICAgICAgICAgIGlmICghZ2xvYmFsICYmIHR5cGVvZiBzZWxmICE9IFwidW5kZWZpbmVkXCIpIGdsb2JhbCA9IHNlbGY7IC8vIGNhbiBoYXBwZW4gaW4gd2Vid29ya2VyXG4gICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICBpZiAoIWdsb2JhbC5hY2UpXG4gICAgICAgICAgICAgICAgICAgICAgICBnbG9iYWwuYWNlID0gYTtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIGEpIGlmIChhLmhhc093blByb3BlcnR5KGtleSkpXG4gICAgICAgICAgICAgICAgICAgICAgICBnbG9iYWwuYWNlW2tleV0gPSBhW2tleV07XG4gICAgICAgICAgICAgICAgICAgIGdsb2JhbC5hY2VbXCJkZWZhdWx0XCJdID0gZ2xvYmFsLmFjZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtb2R1bGUgPT0gXCJvYmplY3RcIiAmJiB0eXBlb2YgZXhwb3J0cyA9PSBcIm9iamVjdFwiICYmIG1vZHVsZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlLmV4cG9ydHMgPSBnbG9iYWwuYWNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KSgpO1xuICAgICAgICAiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/ace-builds/src-noconflict/ace.js\n"); - -/***/ }), - -/***/ "./node_modules/ace-builds/src-noconflict/ext-split.js": -/*!*************************************************************!*\ - !*** ./node_modules/ace-builds/src-noconflict/ext-split.js ***! - \*************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("/* module decorator */ module = __webpack_require__.nmd(module);\nace.define(\"ace/split\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/lib/event_emitter\",\"ace/editor\",\"ace/virtual_renderer\",\"ace/edit_session\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"./lib/oop\");\nvar lang = require(\"./lib/lang\");\nvar EventEmitter = require(\"./lib/event_emitter\").EventEmitter;\nvar Editor = require(\"./editor\").Editor;\nvar Renderer = require(\"./virtual_renderer\").VirtualRenderer;\nvar EditSession = require(\"./edit_session\").EditSession;\nvar Split;\nSplit = function (container, theme, splits) {\n this.BELOW = 1;\n this.BESIDE = 0;\n this.$container = container;\n this.$theme = theme;\n this.$splits = 0;\n this.$editorCSS = \"\";\n this.$editors = [];\n this.$orientation = this.BESIDE;\n this.setSplits(splits || 1);\n this.$cEditor = this.$editors[0];\n this.on(\"focus\", function (editor) {\n this.$cEditor = editor;\n }.bind(this));\n};\n(function () {\n oop.implement(this, EventEmitter);\n this.$createEditor = function () {\n var el = document.createElement(\"div\");\n el.className = this.$editorCSS;\n el.style.cssText = \"position: absolute; top:0px; bottom:0px\";\n this.$container.appendChild(el);\n var editor = new Editor(new Renderer(el, this.$theme));\n editor.on(\"focus\", function () {\n this._emit(\"focus\", editor);\n }.bind(this));\n this.$editors.push(editor);\n editor.setFontSize(this.$fontSize);\n return editor;\n };\n this.setSplits = function (splits) {\n var editor;\n if (splits < 1) {\n throw \"The number of splits have to be > 0!\";\n }\n if (splits == this.$splits) {\n return;\n }\n else if (splits > this.$splits) {\n while (this.$splits < this.$editors.length && this.$splits < splits) {\n editor = this.$editors[this.$splits];\n this.$container.appendChild(editor.container);\n editor.setFontSize(this.$fontSize);\n this.$splits++;\n }\n while (this.$splits < splits) {\n this.$createEditor();\n this.$splits++;\n }\n }\n else {\n while (this.$splits > splits) {\n editor = this.$editors[this.$splits - 1];\n this.$container.removeChild(editor.container);\n this.$splits--;\n }\n }\n this.resize();\n };\n this.getSplits = function () {\n return this.$splits;\n };\n this.getEditor = function (idx) {\n return this.$editors[idx];\n };\n this.getCurrentEditor = function () {\n return this.$cEditor;\n };\n this.focus = function () {\n this.$cEditor.focus();\n };\n this.blur = function () {\n this.$cEditor.blur();\n };\n this.setTheme = function (theme) {\n this.$editors.forEach(function (editor) {\n editor.setTheme(theme);\n });\n };\n this.setKeyboardHandler = function (keybinding) {\n this.$editors.forEach(function (editor) {\n editor.setKeyboardHandler(keybinding);\n });\n };\n this.forEach = function (callback, scope) {\n this.$editors.forEach(callback, scope);\n };\n this.$fontSize = \"\";\n this.setFontSize = function (size) {\n this.$fontSize = size;\n this.forEach(function (editor) {\n editor.setFontSize(size);\n });\n };\n this.$cloneSession = function (session) {\n var s = new EditSession(session.getDocument(), session.getMode());\n var undoManager = session.getUndoManager();\n s.setUndoManager(undoManager);\n s.setTabSize(session.getTabSize());\n s.setUseSoftTabs(session.getUseSoftTabs());\n s.setOverwrite(session.getOverwrite());\n s.setBreakpoints(session.getBreakpoints());\n s.setUseWrapMode(session.getUseWrapMode());\n s.setUseWorker(session.getUseWorker());\n s.setWrapLimitRange(session.$wrapLimitRange.min, session.$wrapLimitRange.max);\n s.$foldData = session.$cloneFoldData();\n return s;\n };\n this.setSession = function (session, idx) {\n var editor;\n if (idx == null) {\n editor = this.$cEditor;\n }\n else {\n editor = this.$editors[idx];\n }\n var isUsed = this.$editors.some(function (editor) {\n return editor.session === session;\n });\n if (isUsed) {\n session = this.$cloneSession(session);\n }\n editor.setSession(session);\n return session;\n };\n this.getOrientation = function () {\n return this.$orientation;\n };\n this.setOrientation = function (orientation) {\n if (this.$orientation == orientation) {\n return;\n }\n this.$orientation = orientation;\n this.resize();\n };\n this.resize = function () {\n var width = this.$container.clientWidth;\n var height = this.$container.clientHeight;\n var editor;\n if (this.$orientation == this.BESIDE) {\n var editorWidth = width / this.$splits;\n for (var i = 0; i < this.$splits; i++) {\n editor = this.$editors[i];\n editor.container.style.width = editorWidth + \"px\";\n editor.container.style.top = \"0px\";\n editor.container.style.left = i * editorWidth + \"px\";\n editor.container.style.height = height + \"px\";\n editor.resize();\n }\n }\n else {\n var editorHeight = height / this.$splits;\n for (var i = 0; i < this.$splits; i++) {\n editor = this.$editors[i];\n editor.container.style.width = width + \"px\";\n editor.container.style.top = i * editorHeight + \"px\";\n editor.container.style.left = \"0px\";\n editor.container.style.height = editorHeight + \"px\";\n editor.resize();\n }\n }\n };\n}).call(Split.prototype);\nexports.Split = Split;\n\n});\n\nace.define(\"ace/ext/split\",[\"require\",\"exports\",\"module\",\"ace/split\"], function(require, exports, module){\"use strict\";\nmodule.exports = require(\"../split\");\n\n}); (function() {\n ace.require([\"ace/ext/split\"], function(m) {\n if ( true && module) {\n module.exports = m;\n }\n });\n })();\n //# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvYWNlLWJ1aWxkcy9zcmMtbm9jb25mbGljdC9leHQtc3BsaXQuanMiLCJtYXBwaW5ncyI6IjtBQUFBLHNNQUFzTTtBQUN0TTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGdEQUFnRCxTQUFTO0FBQ3pEO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQU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ICAgICBpZiAoc3BsaXRzID09IHRoaXMuJHNwbGl0cykge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHNwbGl0cyA+IHRoaXMuJHNwbGl0cykge1xuICAgICAgICAgICAgd2hpbGUgKHRoaXMuJHNwbGl0cyA8IHRoaXMuJGVkaXRvcnMubGVuZ3RoICYmIHRoaXMuJHNwbGl0cyA8IHNwbGl0cykge1xuICAgICAgICAgICAgICAgIGVkaXRvciA9IHRoaXMuJGVkaXRvcnNbdGhpcy4kc3BsaXRzXTtcbiAgICAgICAgICAgICAgICB0aGlzLiRjb250YWluZXIuYXBwZW5kQ2hpbGQoZWRpdG9yLmNvbnRhaW5lcik7XG4gICAgICAgICAgICAgICAgZWRpdG9yLnNldEZvbnRTaXplKHRoaXMuJGZvbnRTaXplKTtcbiAgICAgICAgICAgICAgICB0aGlzLiRzcGxpdHMrKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHdoaWxlICh0aGlzLiRzcGxpdHMgPCBzcGxpdHMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiRjcmVhdGVFZGl0b3IoKTtcbiAgICAgICAgICAgICAgICB0aGlzLiRzcGxpdHMrKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHdoaWxlICh0aGlzLiRzcGxpdHMgPiBzcGxpdHMpIHtcbiAgICAgICAgICAgICAgICBlZGl0b3IgPSB0aGlzLiRlZGl0b3JzW3RoaXMuJHNwbGl0cyAtIDFdO1xuICAgICAgICAgICAgICAgIHRoaXMuJGNvbnRhaW5lci5yZW1vdmVDaGlsZChlZGl0b3IuY29udGFpbmVyKTtcbiAgICAgICAgICAgICAgICB0aGlzLiRzcGxpdHMtLTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLnJlc2l6ZSgpO1xuICAgIH07XG4gICAgdGhpcy5nZXRTcGxpdHM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9uLiRjbG9uZUZvbGREYXRhKCk7XG4gICAgICAgIHJldHVybiBzO1xuICAgIH07XG4gICAgdGhpcy5zZXRTZXNzaW9uID0gZnVuY3Rpb24gKHNlc3Npb24sIGlkeCkge1xuICAgICAgICB2YXIgZWRpdG9yO1xuICAgICAgICBpZiAoaWR4ID09IG51bGwpIHtcbiAgICAgICAgICAgIGVkaXRvciA9IHRoaXMuJGNFZGl0b3I7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBlZGl0b3IgPSB0aGlzLiRlZGl0b3JzW2lkeF07XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGlzVXNlZCA9IHRoaXMuJGVkaXRvcnMuc29tZShmdW5jdGlvbiAoZWRpdG9yKSB7XG4gICAgICAgICAgICByZXR1cm4gZWRpdG9yLnNlc3Npb24gPT09IHNlc3Npb247XG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoaXNVc2VkKSB7XG4gICAgICAgICAgICBzZXNzaW9uID0gdGhpcy4kY2xvbmVTZXNzaW9uKHNlc3Npb24pO1xuICAgICAgICB9XG4gICAgICAgIGVkaXRvci5zZXRTZXNzaW9uKHNlc3Npb24pO1xuICAgICAgICByZXR1cm4gc2Vzc2lvbjtcbiAgICB9O1xuICAgIHRoaXMuZ2V0T3JpZW50YXRpb24gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLiRvcmllbnRhdGlvbjtcbiAgICB9O1xuICAgIHRoaXMuc2V0T3JpZW50YXRpb24gPSBmdW5jdGlvbiAob3JpZW50YXRpb24pIHtcbiAgICAgICAgaWYgKHRoaXMuJG9yaWVudGF0aW9uID09IG9yaWVudGF0aW9uKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy4kb3JpZW50YXRpb24gPSBvcmllbnRhdGlvbjtcbiAgICAgICAgdGhpcy5yZXNpemUoKTtcbiAgICB9O1xuICAgIHRoaXMucmVzaXplID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgd2lkdGggPSB0aGlzLiRjb250YWluZXIuY2xpZW50V2lkdGg7XG4gICAgICAgIHZhciBoZWlnaHQgPSB0aGlzLiRjb250YWluZXIuY2xpZW50SGVpZ2h0O1xuICAgICAgICB2YXIgZWRpdG9yO1xuICAgICAgICBpZiAodGhpcy4kb3JpZW50YXRpb24gPT0gdGhpcy5CRVNJREUpIHtcbiAgICAgICAgICAgIHZhciBlZGl0b3JXaWR0aCA9IHdpZHRoIC8gdGhpcy4kc3BsaXRzO1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGlzLiRzcGxpdHM7IGkrKykge1xuICAgICAgICAgICAgICAgIGVkaXRvciA9IHRoaXMuJGVkaXRvcnNbaV07XG4gICAgICAgICAgICAgICAgZWRpdG9yLmNvbnRhaW5lci5zdHlsZS53aWR0aCA9IGVkaXRvcldpZHRoICsgXCJweFwiO1xuICAgICAgICAgICAgICAgIGVkaXRvci5jb250YWluZXIuc3R5bGUudG9wID0gXCIwcHhcIjtcbiAgICAgICAgICAgICAgICBlZGl0b3IuY29udGFpbmVyLnN0eWxlLmxlZnQgPSBpICogZWRpdG9yV2lkdGggKyBcInB4XCI7XG4gICAgICAgICAgICAgICAgZWRpdG9yLmNvbnRhaW5lci5zdHlsZS5oZWlnaHQgPSBoZWlnaHQgKyBcInB4XCI7XG4gICAgICAgICAgICAgICAgZWRpdG9yLnJlc2l6ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdmFyIGVkaXRvckhlaWdodCA9IGhlaWdodCAvIHRoaXMuJHNwbGl0cztcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy4kc3BsaXRzOyBpKyspIHtcbiAgICAgICAgICAgICAgICBlZGl0b3IgPSB0aGlzLiRlZGl0b3JzW2ldO1xuICAgICAgICAgICAgICAgIGVkaXRvci5jb250YWluZXIuc3R5bGUud2lkdGggPSB3aWR0aCArIFwicHhcIjtcbiAgICAgICAgICAgICAgICBlZGl0b3IuY29udGFpbmVyLnN0eWxlLnRvcCA9IGkgKiBlZGl0b3JIZWlnaHQgKyBcInB4XCI7XG4gICAgICAgICAgICAgICAgZWRpdG9yLmNvbnRhaW5lci5zdHlsZS5sZWZ0ID0gXCIwcHhcIjtcbiAgICAgICAgICAgICAgICBlZGl0b3IuY29udGFpbmVyLnN0eWxlLmhlaWdodCA9IGVkaXRvckhlaWdodCArIFwicHhcIjtcbiAgICAgICAgICAgICAgICBlZGl0b3IucmVzaXplKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xufSkuY2FsbChTcGxpdC5wcm90b3R5cGUpO1xuZXhwb3J0cy5TcGxpdCA9IFNwbGl0O1xuXG59KTtcblxuYWNlLmRlZmluZShcImFjZS9leHQvc3BsaXRcIixbXCJyZXF1aXJlXCIsXCJleHBvcnRzXCIsXCJtb2R1bGVcIixcImFjZS9zcGxpdFwiXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXtcInVzZSBzdHJpY3RcIjtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZShcIi4uL3NwbGl0XCIpO1xuXG59KTsgICAgICAgICAgICAgICAgKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBhY2UucmVxdWlyZShbXCJhY2UvZXh0L3NwbGl0XCJdLCBmdW5jdGlvbihtKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG1vZHVsZSA9PSBcIm9iamVjdFwiICYmIHR5cGVvZiBleHBvcnRzID09IFwib2JqZWN0XCIgJiYgbW9kdWxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlLmV4cG9ydHMgPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KSgpO1xuICAgICAgICAgICAgIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/ace-builds/src-noconflict/ext-split.js\n"); - -/***/ }), - -/***/ "./node_modules/ace-builds/src-noconflict/mode-text.js": -/*!*************************************************************!*\ - !*** ./node_modules/ace-builds/src-noconflict/mode-text.js ***! - \*************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("/* module decorator */ module = __webpack_require__.nmd(module);\n\n; (function() {\n ace.require([\"ace/mode/text\"], function(m) {\n if ( true && module) {\n module.exports = m;\n }\n });\n })();\n //# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvYWNlLWJ1aWxkcy9zcmMtbm9jb25mbGljdC9tb2RlLXRleHQuanMiLCJtYXBwaW5ncyI6Ijs7QUFDQSxpQkFBaUI7QUFDakI7QUFDQSw0QkFBNEIsS0FBdUQ7QUFDbkY7QUFDQTtBQUNBLHFCQUFxQjtBQUNyQixpQkFBaUI7QUFDakIiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9wcml0dW5sLXplcm8vLi9ub2RlX21vZHVsZXMvYWNlLWJ1aWxkcy9zcmMtbm9jb25mbGljdC9tb2RlLXRleHQuanM/NDU0OSJdLCJzb3VyY2VzQ29udGVudCI6WyJcbjsgICAgICAgICAgICAgICAgKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBhY2UucmVxdWlyZShbXCJhY2UvbW9kZS90ZXh0XCJdLCBmdW5jdGlvbihtKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG1vZHVsZSA9PSBcIm9iamVjdFwiICYmIHR5cGVvZiBleHBvcnRzID09IFwib2JqZWN0XCIgJiYgbW9kdWxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlLmV4cG9ydHMgPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KSgpO1xuICAgICAgICAgICAgIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/ace-builds/src-noconflict/mode-text.js\n"); - -/***/ }), - -/***/ "./node_modules/ace-builds/src-noconflict/theme-dracula.js": -/*!*****************************************************************!*\ - !*** ./node_modules/ace-builds/src-noconflict/theme-dracula.js ***! - \*****************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("/* module decorator */ module = __webpack_require__.nmd(module);\nace.define(\"ace/theme/dracula-css\",[\"require\",\"exports\",\"module\"], function(require, exports, module){module.exports = \"/*\\n * Copyright \\u00A9 2017 Zeno Rocha \\n *\\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\u201CSoftware\\u201D), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n *\\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n *\\n * THE SOFTWARE IS PROVIDED \\u201CAS IS\\u201D, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n */\\n\\n.ace-dracula .ace_gutter {\\n background: #282a36;\\n color: rgb(144,145,148)\\n}\\n\\n.ace-dracula .ace_print-margin {\\n width: 1px;\\n background: #44475a\\n}\\n\\n.ace-dracula {\\n background-color: #282a36;\\n color: #f8f8f2\\n}\\n\\n.ace-dracula .ace_cursor {\\n color: #f8f8f0\\n}\\n\\n.ace-dracula .ace_marker-layer .ace_selection {\\n background: #44475a\\n}\\n\\n.ace-dracula.ace_multiselect .ace_selection.ace_start {\\n box-shadow: 0 0 3px 0px #282a36;\\n border-radius: 2px\\n}\\n\\n.ace-dracula .ace_marker-layer .ace_step {\\n background: rgb(198, 219, 174)\\n}\\n\\n.ace-dracula .ace_marker-layer .ace_bracket {\\n margin: -1px 0 0 -1px;\\n border: 1px solid #a29709\\n}\\n\\n.ace-dracula .ace_marker-layer .ace_active-line {\\n background: #44475a\\n}\\n\\n.ace-dracula .ace_gutter-active-line {\\n background-color: #44475a\\n}\\n\\n.ace-dracula .ace_marker-layer .ace_selected-word {\\n box-shadow: 0px 0px 0px 1px #a29709;\\n border-radius: 3px;\\n}\\n\\n.ace-dracula .ace_fold {\\n background-color: #50fa7b;\\n border-color: #f8f8f2\\n}\\n\\n.ace-dracula .ace_keyword {\\n color: #ff79c6\\n}\\n\\n.ace-dracula .ace_constant.ace_language {\\n color: #bd93f9\\n}\\n\\n.ace-dracula .ace_constant.ace_numeric {\\n color: #bd93f9\\n}\\n\\n.ace-dracula .ace_constant.ace_character {\\n color: #bd93f9\\n}\\n\\n.ace-dracula .ace_constant.ace_character.ace_escape {\\n color: #ff79c6\\n}\\n\\n.ace-dracula .ace_constant.ace_other {\\n color: #bd93f9\\n}\\n\\n.ace-dracula .ace_support.ace_function {\\n color: #8be9fd\\n}\\n\\n.ace-dracula .ace_support.ace_constant {\\n color: #6be5fd\\n}\\n\\n.ace-dracula .ace_support.ace_class {\\n font-style: italic;\\n color: #66d9ef\\n}\\n\\n.ace-dracula .ace_support.ace_type {\\n font-style: italic;\\n color: #66d9ef\\n}\\n\\n.ace-dracula .ace_storage {\\n color: #ff79c6\\n}\\n\\n.ace-dracula .ace_storage.ace_type {\\n font-style: italic;\\n color: #8be9fd\\n}\\n\\n.ace-dracula .ace_invalid {\\n color: #F8F8F0;\\n background-color: #ff79c6\\n}\\n\\n.ace-dracula .ace_invalid.ace_deprecated {\\n color: #F8F8F0;\\n background-color: #bd93f9\\n}\\n\\n.ace-dracula .ace_string {\\n color: #f1fa8c\\n}\\n\\n.ace-dracula .ace_comment {\\n color: #6272a4\\n}\\n\\n.ace-dracula .ace_variable {\\n color: #50fa7b\\n}\\n\\n.ace-dracula .ace_variable.ace_parameter {\\n font-style: italic;\\n color: #ffb86c\\n}\\n\\n.ace-dracula .ace_entity.ace_other.ace_attribute-name {\\n color: #50fa7b\\n}\\n\\n.ace-dracula .ace_entity.ace_name.ace_function {\\n color: #50fa7b\\n}\\n\\n.ace-dracula .ace_entity.ace_name.ace_tag {\\n color: #ff79c6\\n}\\n.ace-dracula .ace_invisible {\\n color: #626680;\\n}\\n\\n.ace-dracula .ace_indent-guide {\\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y\\n}\\n\\n.ace-dracula .ace_indent-guide-active {\\n background: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACAQMAAACjTyRkAAAABlBMVEUAAADCwsK76u2xAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjYGBoAAAAhACBGFbxzQAAAABJRU5ErkJggg==\\\") right repeat-y;\\n}\\n\";\n\n});\n\nace.define(\"ace/theme/dracula\",[\"require\",\"exports\",\"module\",\"ace/theme/dracula-css\",\"ace/lib/dom\"], function(require, exports, module){exports.isDark = true;\nexports.cssClass = \"ace-dracula\";\nexports.cssText = require(\"./dracula-css\");\nexports.$selectionColorConflict = true;\nvar dom = require(\"../lib/dom\");\ndom.importCssString(exports.cssText, exports.cssClass, false);\n\n}); (function() {\n ace.require([\"ace/theme/dracula\"], function(m) {\n if ( true && module)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3VsYS1jc3NcIixcImFjZS9saWIvZG9tXCJdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpe2V4cG9ydHMuaXNEYXJrID0gdHJ1ZTtcbmV4cG9ydHMuY3NzQ2xhc3MgPSBcImFjZS1kcmFjdWxhXCI7XG5leHBvcnRzLmNzc1RleHQgPSByZXF1aXJlKFwiLi9kcmFjdWxhLWNzc1wiKTtcbmV4cG9ydHMuJHNlbGVjdGlvbkNvbG9yQ29uZmxpY3QgPSB0cnVlO1xudmFyIGRvbSA9IHJlcXVpcmUoXCIuLi9saWIvZG9tXCIpO1xuZG9tLmltcG9ydENzc1N0cmluZyhleHBvcnRzLmNzc1RleHQsIGV4cG9ydHMuY3NzQ2xhc3MsIGZhbHNlKTtcblxufSk7ICAgICAgICAgICAgICAgIChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgYWNlLnJlcXVpcmUoW1wiYWNlL3RoZW1lL2RyYWN1bGFcIl0sIGZ1bmN0aW9uKG0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgbW9kdWxlID09IFwib2JqZWN0XCIgJiYgdHlwZW9mIGV4cG9ydHMgPT0gXCJvYmplY3RcIiAmJiBtb2R1bGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pKCk7XG4gICAgICAgICAgICAiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/ace-builds/src-noconflict/theme-dracula.js\n"); - -/***/ }), - -/***/ "./node_modules/ace-builds/src-noconflict/theme-eclipse.js": -/*!*****************************************************************!*\ - !*** ./node_modules/ace-builds/src-noconflict/theme-eclipse.js ***! - \*****************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("/* module decorator */ module = __webpack_require__.nmd(module);\nace.define(\"ace/theme/eclipse-css\",[\"require\",\"exports\",\"module\"], function(require, exports, module){module.exports = \".ace-eclipse .ace_gutter {\\n background: #ebebeb;\\n border-right: 1px solid rgb(159, 159, 159);\\n color: rgb(136, 136, 136);\\n}\\n\\n.ace-eclipse .ace_print-margin {\\n width: 1px;\\n background: #ebebeb;\\n}\\n\\n.ace-eclipse {\\n background-color: #FFFFFF;\\n color: black;\\n}\\n\\n.ace-eclipse .ace_fold {\\n background-color: rgb(60, 76, 114);\\n}\\n\\n.ace-eclipse .ace_cursor {\\n color: black;\\n}\\n\\n.ace-eclipse .ace_storage,\\n.ace-eclipse .ace_keyword,\\n.ace-eclipse .ace_variable {\\n color: rgb(127, 0, 85);\\n}\\n\\n.ace-eclipse .ace_constant.ace_buildin {\\n color: rgb(88, 72, 246);\\n}\\n\\n.ace-eclipse .ace_constant.ace_library {\\n color: rgb(6, 150, 14);\\n}\\n\\n.ace-eclipse .ace_function {\\n color: rgb(60, 76, 114);\\n}\\n\\n.ace-eclipse .ace_string {\\n color: rgb(42, 0, 255);\\n}\\n\\n.ace-eclipse .ace_comment {\\n color: rgb(113, 150, 130);\\n}\\n\\n.ace-eclipse .ace_comment.ace_doc {\\n color: rgb(63, 95, 191);\\n}\\n\\n.ace-eclipse .ace_comment.ace_doc.ace_tag {\\n color: rgb(127, 159, 191);\\n}\\n\\n.ace-eclipse .ace_constant.ace_numeric {\\n color: darkblue;\\n}\\n\\n.ace-eclipse .ace_tag {\\n color: rgb(25, 118, 116);\\n}\\n\\n.ace-eclipse .ace_type {\\n color: rgb(127, 0, 127);\\n}\\n\\n.ace-eclipse .ace_xml-pe {\\n color: rgb(104, 104, 91);\\n}\\n\\n.ace-eclipse .ace_marker-layer .ace_selection {\\n background: rgb(181, 213, 255);\\n}\\n\\n.ace-eclipse .ace_marker-layer .ace_bracket {\\n margin: -1px 0 0 -1px;\\n border: 1px solid rgb(192, 192, 192);\\n}\\n\\n.ace-eclipse .ace_meta.ace_tag {\\n color:rgb(25, 118, 116);\\n}\\n\\n.ace-eclipse .ace_invisible {\\n color: #ddd;\\n}\\n\\n.ace-eclipse .ace_entity.ace_other.ace_attribute-name {\\n color:rgb(127, 0, 127);\\n}\\n.ace-eclipse .ace_marker-layer .ace_step {\\n background: rgb(255, 255, 0);\\n}\\n\\n.ace-eclipse .ace_active-line {\\n background: rgb(232, 242, 254);\\n}\\n\\n.ace-eclipse .ace_gutter-active-line {\\n background-color : #DADADA;\\n}\\n\\n.ace-eclipse .ace_marker-layer .ace_selected-word {\\n border: 1px solid rgb(181, 213, 255);\\n}\\n\\n.ace-eclipse .ace_indent-guide {\\n background: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\\\") right repeat-y;\\n}\\n\\n.ace-eclipse .ace_indent-guide-active {\\n background: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC\\\") right repeat-y;\\n} \\n\";\n\n});\n\nace.define(\"ace/theme/eclipse\",[\"require\",\"exports\",\"module\",\"ace/theme/eclipse-css\",\"ace/lib/dom\"], function(require, exports, module){\"use strict\";\nexports.isDark = false;\nexports.cssText = require(\"./eclipse-css\");\nexports.cssClass = \"ace-eclipse\";\nvar dom = require(\"../lib/dom\");\ndom.importCssString(exports.cssText, exports.cssClass, false);\n\n}); (function() {\n ace.require([\"ace/theme/eclipse\"], function(m) {\n if ( true && module) {\n module.exports = m;\n }\n });\n })();\n //# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64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BcImFjZS1lY2xpcHNlXCI7XG52YXIgZG9tID0gcmVxdWlyZShcIi4uL2xpYi9kb21cIik7XG5kb20uaW1wb3J0Q3NzU3RyaW5nKGV4cG9ydHMuY3NzVGV4dCwgZXhwb3J0cy5jc3NDbGFzcywgZmFsc2UpO1xuXG59KTsgICAgICAgICAgICAgICAgKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBhY2UucmVxdWlyZShbXCJhY2UvdGhlbWUvZWNsaXBzZVwiXSwgZnVuY3Rpb24obSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtb2R1bGUgPT0gXCJvYmplY3RcIiAmJiB0eXBlb2YgZXhwb3J0cyA9PSBcIm9iamVjdFwiICYmIG1vZHVsZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZHVsZS5leHBvcnRzID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSkoKTtcbiAgICAgICAgICAgICJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/ace-builds/src-noconflict/theme-eclipse.js\n"); - -/***/ }), - /***/ "./node_modules/call-bind/callBound.js": /*!*********************************************!*\ !*** ./node_modules/call-bind/callBound.js ***! @@ -7747,16 +7697,6 @@ eval("\n\nvar $defineProperty = __webpack_require__(/*! es-define-property */ \" /***/ }), -/***/ "./node_modules/diff-match-patch/index.js": -/*!************************************************!*\ - !*** ./node_modules/diff-match-patch/index.js ***! - \************************************************/ -/***/ ((module) => { - -eval("/**\n * Diff Match and Patch\n * Copyright 2018 The diff-match-patch Authors.\n * https://github.com/google/diff-match-patch\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Computes the difference between two texts to create a patch.\n * Applies the patch onto another text, allowing for errors.\n * @author fraser@google.com (Neil Fraser)\n */\n\n/**\n * Class containing the diff, match and patch methods.\n * @constructor\n */\nvar diff_match_patch = function() {\n\n // Defaults.\n // Redefine these in your program to override the defaults.\n\n // Number of seconds to map a diff before giving up (0 for infinity).\n this.Diff_Timeout = 1.0;\n // Cost of an empty edit operation in terms of edit characters.\n this.Diff_EditCost = 4;\n // At what point is no match declared (0.0 = perfection, 1.0 = very loose).\n this.Match_Threshold = 0.5;\n // How far to search for a match (0 = exact location, 1000+ = broad match).\n // A match this many characters away from the expected location will add\n // 1.0 to the score (0.0 is a perfect match).\n this.Match_Distance = 1000;\n // When deleting a large block of text (over ~64 characters), how close do\n // the contents have to be to match the expected contents. (0.0 = perfection,\n // 1.0 = very loose). Note that Match_Threshold controls how closely the\n // end points of a delete need to match.\n this.Patch_DeleteThreshold = 0.5;\n // Chunk size for context length.\n this.Patch_Margin = 4;\n\n // The number of bits in an int.\n this.Match_MaxBits = 32;\n};\n\n\n// DIFF FUNCTIONS\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n/**\n * Class representing one diff tuple.\n * ~Attempts to look like a two-element array (which is what this used to be).~\n * Constructor returns an actual two-element array, to allow destructing @JackuB\n * See https://github.com/JackuB/diff-match-patch/issues/14 for details\n * @param {number} op Operation, one of: DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL.\n * @param {string} text Text to be deleted, inserted, or retained.\n * @constructor\n */\ndiff_match_patch.Diff = function(op, text) {\n return [op, text];\n};\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {boolean=} opt_checklines Optional speedup flag. If present and false,\n * then don't run a line-level diff first to identify the changed areas.\n * Defaults to true, which does a faster, slightly less optimal diff.\n * @param {number=} opt_deadline Optional time when the diff should be complete\n * by. Used internally for recursive calls. Users should set DiffTimeout\n * instead.\n * @return {!Array.} Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_main = function(text1, text2, opt_checklines,\n opt_deadline) {\n // Set a deadline by which time the diff must be complete.\n if (typeof opt_deadline == 'undefined') {\n if (this.Diff_Timeout <= 0) {\n opt_deadline = Number.MAX_VALUE;\n } else {\n opt_deadline = (new Date).getTime() + this.Diff_Timeout * 1000;\n }\n }\n var deadline = opt_deadline;\n\n // Check for null inputs.\n if (text1 == null || text2 == null) {\n throw new Error('Null input. (diff_main)');\n }\n\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [new diff_match_patch.Diff(DIFF_EQUAL, text1)];\n }\n return [];\n }\n\n if (typeof opt_checklines == 'undefined') {\n opt_checklines = true;\n }\n var checklines = opt_checklines;\n\n // Trim off common prefix (speedup).\n var commonlength = this.diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = this.diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = this.diff_compute_(text1, text2, checklines, deadline);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, commonprefix));\n }\n if (commonsuffix) {\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, commonsuffix));\n }\n this.diff_cleanupMerge(diffs);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {boolean} checklines Speedup flag. If false, then don't run a\n * line-level diff first to identify the changed areas.\n * If true, then run a faster, slightly less optimal diff.\n * @param {number} deadline Time when the diff should be complete by.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_compute_ = function(text1, text2, checklines,\n deadline) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [new diff_match_patch.Diff(DIFF_INSERT, text2)];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [new diff_match_patch.Diff(DIFF_DELETE, text1)];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [new diff_match_patch.Diff(DIFF_INSERT, longtext.substring(0, i)),\n new diff_match_patch.Diff(DIFF_EQUAL, shorttext),\n new diff_match_patch.Diff(DIFF_INSERT,\n longtext.substring(i + shorttext.length))];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [new diff_match_patch.Diff(DIFF_DELETE, text1),\n new diff_match_patch.Diff(DIFF_INSERT, text2)];\n }\n\n // Check to see if the problem can be split in two.\n var hm = this.diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = this.diff_main(text1_a, text2_a, checklines, deadline);\n var diffs_b = this.diff_main(text1_b, text2_b, checklines, deadline);\n // Merge the results.\n return diffs_a.concat([new diff_match_patch.Diff(DIFF_EQUAL, mid_common)],\n diffs_b);\n }\n\n if (checklines && text1.length > 100 && text2.length > 100) {\n return this.diff_lineMode_(text1, text2, deadline);\n }\n\n return this.diff_bisect_(text1, text2, deadline);\n};\n\n\n/**\n * Do a quick line-level diff on both strings, then rediff the parts for\n * greater accuracy.\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} deadline Time when the diff should be complete by.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_lineMode_ = function(text1, text2, deadline) {\n // Scan the text on a line-by-line basis first.\n var a = this.diff_linesToChars_(text1, text2);\n text1 = a.chars1;\n text2 = a.chars2;\n var linearray = a.lineArray;\n\n var diffs = this.diff_main(text1, text2, false, deadline);\n\n // Convert the diff back to original text.\n this.diff_charsToLines_(diffs, linearray);\n // Eliminate freak matches (e.g. blank lines)\n this.diff_cleanupSemantic(diffs);\n\n // Rediff any replacement blocks, this time character-by-character.\n // Add a dummy entry at the end.\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ''));\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete >= 1 && count_insert >= 1) {\n // Delete the offending records and add the merged ones.\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert);\n pointer = pointer - count_delete - count_insert;\n var subDiff =\n this.diff_main(text_delete, text_insert, false, deadline);\n for (var j = subDiff.length - 1; j >= 0; j--) {\n diffs.splice(pointer, 0, subDiff[j]);\n }\n pointer = pointer + subDiff.length;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n pointer++;\n }\n diffs.pop(); // Remove the dummy entry at the end.\n\n return diffs;\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} deadline Time at which to bail if not yet complete.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_bisect_ = function(text1, text2, deadline) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Bail out if deadline is reached.\n if ((new Date()).getTime() > deadline) {\n break;\n }\n\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [new diff_match_patch.Diff(DIFF_DELETE, text1),\n new diff_match_patch.Diff(DIFF_INSERT, text2)];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @param {number} deadline Time at which to bail if not yet complete.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_bisectSplit_ = function(text1, text2, x, y,\n deadline) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = this.diff_main(text1a, text2a, false, deadline);\n var diffsb = this.diff_main(text1b, text2b, false, deadline);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Split two texts into an array of strings. Reduce the texts to a string of\n * hashes where each Unicode character represents one line.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {{chars1: string, chars2: string, lineArray: !Array.}}\n * An object containing the encoded text1, the encoded text2 and\n * the array of unique strings.\n * The zeroth element of the array of unique strings is intentionally blank.\n * @private\n */\ndiff_match_patch.prototype.diff_linesToChars_ = function(text1, text2) {\n var lineArray = []; // e.g. lineArray[4] == 'Hello\\n'\n var lineHash = {}; // e.g. lineHash['Hello\\n'] == 4\n\n // '\\x00' is a valid character, but various debuggers don't like it.\n // So we'll insert a junk entry to avoid generating a null character.\n lineArray[0] = '';\n\n /**\n * Split a text into an array of strings. Reduce the texts to a string of\n * hashes where each Unicode character represents one line.\n * Modifies linearray and linehash through being a closure.\n * @param {string} text String to encode.\n * @return {string} Encoded string.\n * @private\n */\n function diff_linesToCharsMunge_(text) {\n var chars = '';\n // Walk the text, pulling out a substring for each line.\n // text.split('\\n') would would temporarily double our memory footprint.\n // Modifying text would create many large strings to garbage collect.\n var lineStart = 0;\n var lineEnd = -1;\n // Keeping our own length variable is faster than looking it up.\n var lineArrayLength = lineArray.length;\n while (lineEnd < text.length - 1) {\n lineEnd = text.indexOf('\\n', lineStart);\n if (lineEnd == -1) {\n lineEnd = text.length - 1;\n }\n var line = text.substring(lineStart, lineEnd + 1);\n\n if (lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) :\n (lineHash[line] !== undefined)) {\n chars += String.fromCharCode(lineHash[line]);\n } else {\n if (lineArrayLength == maxLines) {\n // Bail out at 65535 because\n // String.fromCharCode(65536) == String.fromCharCode(0)\n line = text.substring(lineStart);\n lineEnd = text.length;\n }\n chars += String.fromCharCode(lineArrayLength);\n lineHash[line] = lineArrayLength;\n lineArray[lineArrayLength++] = line;\n }\n lineStart = lineEnd + 1;\n }\n return chars;\n }\n // Allocate 2/3rds of the space for text1, the rest for text2.\n var maxLines = 40000;\n var chars1 = diff_linesToCharsMunge_(text1);\n maxLines = 65535;\n var chars2 = diff_linesToCharsMunge_(text2);\n return {chars1: chars1, chars2: chars2, lineArray: lineArray};\n};\n\n\n/**\n * Rehydrate the text in a diff from a string of line hashes to real lines of\n * text.\n * @param {!Array.} diffs Array of diff tuples.\n * @param {!Array.} lineArray Array of unique strings.\n * @private\n */\ndiff_match_patch.prototype.diff_charsToLines_ = function(diffs, lineArray) {\n for (var i = 0; i < diffs.length; i++) {\n var chars = diffs[i][1];\n var text = [];\n for (var j = 0; j < chars.length; j++) {\n text[j] = lineArray[chars.charCodeAt(j)];\n }\n diffs[i][1] = text.join('');\n }\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\ndiff_match_patch.prototype.diff_commonPrefix = function(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: https://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\ndiff_match_patch.prototype.diff_commonSuffix = function(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: https://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine if the suffix of one string is the prefix of another.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of the first\n * string and the start of the second string.\n * @private\n */\ndiff_match_patch.prototype.diff_commonOverlap_ = function(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n // Eliminate the null case.\n if (text1_length == 0 || text2_length == 0) {\n return 0;\n }\n // Truncate the longer string.\n if (text1_length > text2_length) {\n text1 = text1.substring(text1_length - text2_length);\n } else if (text1_length < text2_length) {\n text2 = text2.substring(0, text1_length);\n }\n var text_length = Math.min(text1_length, text2_length);\n // Quick check for the worst case.\n if (text1 == text2) {\n return text_length;\n }\n\n // Start by looking for a single character match\n // and increase length until no match is found.\n // Performance analysis: https://neil.fraser.name/news/2010/11/04/\n var best = 0;\n var length = 1;\n while (true) {\n var pattern = text1.substring(text_length - length);\n var found = text2.indexOf(pattern);\n if (found == -1) {\n return best;\n }\n length += found;\n if (found == 0 || text1.substring(text_length - length) ==\n text2.substring(0, length)) {\n best = length;\n length++;\n }\n }\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n * @private\n */\ndiff_match_patch.prototype.diff_halfMatch_ = function(text1, text2) {\n if (this.Diff_Timeout <= 0) {\n // Don't risk returning a non-optimal diff if we have unlimited time.\n return null;\n }\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n var dmp = this; // 'this' becomes 'window' in a closure.\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = dmp.diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = dmp.diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reduce the number of edits by eliminating semantically trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupSemantic = function(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastEquality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Number of characters that changed prior to the equality.\n var length_insertions1 = 0;\n var length_deletions1 = 0;\n // Number of characters that changed after the equality.\n var length_insertions2 = 0;\n var length_deletions2 = 0;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found.\n equalities[equalitiesLength++] = pointer;\n length_insertions1 = length_insertions2;\n length_deletions1 = length_deletions2;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastEquality = diffs[pointer][1];\n } else { // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_INSERT) {\n length_insertions2 += diffs[pointer][1].length;\n } else {\n length_deletions2 += diffs[pointer][1].length;\n }\n // Eliminate an equality that is smaller or equal to the edits on both\n // sides of it.\n if (lastEquality && (lastEquality.length <=\n Math.max(length_insertions1, length_deletions1)) &&\n (lastEquality.length <= Math.max(length_insertions2,\n length_deletions2))) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0,\n new diff_match_patch.Diff(DIFF_DELETE, lastEquality));\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n // Throw away the equality we just deleted.\n equalitiesLength--;\n // Throw away the previous equality (it needs to be reevaluated).\n equalitiesLength--;\n pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;\n length_insertions1 = 0; // Reset the counters.\n length_deletions1 = 0;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastEquality = null;\n changes = true;\n }\n }\n pointer++;\n }\n\n // Normalize the diff.\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n this.diff_cleanupSemanticLossless(diffs);\n\n // Find any overlaps between deletions and insertions.\n // e.g: abcxxxxxxdef\n // -> abcxxxdef\n // e.g: xxxabcdefxxx\n // -> defxxxabc\n // Only extract an overlap if it is as big as the edit ahead or behind it.\n pointer = 1;\n while (pointer < diffs.length) {\n if (diffs[pointer - 1][0] == DIFF_DELETE &&\n diffs[pointer][0] == DIFF_INSERT) {\n var deletion = diffs[pointer - 1][1];\n var insertion = diffs[pointer][1];\n var overlap_length1 = this.diff_commonOverlap_(deletion, insertion);\n var overlap_length2 = this.diff_commonOverlap_(insertion, deletion);\n if (overlap_length1 >= overlap_length2) {\n if (overlap_length1 >= deletion.length / 2 ||\n overlap_length1 >= insertion.length / 2) {\n // Overlap found. Insert an equality and trim the surrounding edits.\n diffs.splice(pointer, 0, new diff_match_patch.Diff(DIFF_EQUAL,\n insertion.substring(0, overlap_length1)));\n diffs[pointer - 1][1] =\n deletion.substring(0, deletion.length - overlap_length1);\n diffs[pointer + 1][1] = insertion.substring(overlap_length1);\n pointer++;\n }\n } else {\n if (overlap_length2 >= deletion.length / 2 ||\n overlap_length2 >= insertion.length / 2) {\n // Reverse overlap found.\n // Insert an equality and swap and trim the surrounding edits.\n diffs.splice(pointer, 0, new diff_match_patch.Diff(DIFF_EQUAL,\n deletion.substring(0, overlap_length2)));\n diffs[pointer - 1][0] = DIFF_INSERT;\n diffs[pointer - 1][1] =\n insertion.substring(0, insertion.length - overlap_length2);\n diffs[pointer + 1][0] = DIFF_DELETE;\n diffs[pointer + 1][1] =\n deletion.substring(overlap_length2);\n pointer++;\n }\n }\n pointer++;\n }\n pointer++;\n }\n};\n\n\n/**\n * Look for single edits surrounded on both sides by equalities\n * which can be shifted sideways to align the edit to a word boundary.\n * e.g: The cat came. -> The cat came.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {\n /**\n * Given two strings, compute a score representing whether the internal\n * boundary falls on logical boundaries.\n * Scores range from 6 (best) to 0 (worst).\n * Closure, but does not reference any external variables.\n * @param {string} one First string.\n * @param {string} two Second string.\n * @return {number} The score.\n * @private\n */\n function diff_cleanupSemanticScore_(one, two) {\n if (!one || !two) {\n // Edges are the best.\n return 6;\n }\n\n // Each port of this function behaves slightly differently due to\n // subtle differences in each language's definition of things like\n // 'whitespace'. Since this function's purpose is largely cosmetic,\n // the choice has been made to use each language's native features\n // rather than force total conformity.\n var char1 = one.charAt(one.length - 1);\n var char2 = two.charAt(0);\n var nonAlphaNumeric1 = char1.match(diff_match_patch.nonAlphaNumericRegex_);\n var nonAlphaNumeric2 = char2.match(diff_match_patch.nonAlphaNumericRegex_);\n var whitespace1 = nonAlphaNumeric1 &&\n char1.match(diff_match_patch.whitespaceRegex_);\n var whitespace2 = nonAlphaNumeric2 &&\n char2.match(diff_match_patch.whitespaceRegex_);\n var lineBreak1 = whitespace1 &&\n char1.match(diff_match_patch.linebreakRegex_);\n var lineBreak2 = whitespace2 &&\n char2.match(diff_match_patch.linebreakRegex_);\n var blankLine1 = lineBreak1 &&\n one.match(diff_match_patch.blanklineEndRegex_);\n var blankLine2 = lineBreak2 &&\n two.match(diff_match_patch.blanklineStartRegex_);\n\n if (blankLine1 || blankLine2) {\n // Five points for blank lines.\n return 5;\n } else if (lineBreak1 || lineBreak2) {\n // Four points for line breaks.\n return 4;\n } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {\n // Three points for end of sentences.\n return 3;\n } else if (whitespace1 || whitespace2) {\n // Two points for whitespace.\n return 2;\n } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {\n // One point for non-alphanumeric.\n return 1;\n }\n return 0;\n }\n\n var pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n var equality1 = diffs[pointer - 1][1];\n var edit = diffs[pointer][1];\n var equality2 = diffs[pointer + 1][1];\n\n // First, shift the edit as far left as possible.\n var commonOffset = this.diff_commonSuffix(equality1, edit);\n if (commonOffset) {\n var commonString = edit.substring(edit.length - commonOffset);\n equality1 = equality1.substring(0, equality1.length - commonOffset);\n edit = commonString + edit.substring(0, edit.length - commonOffset);\n equality2 = commonString + equality2;\n }\n\n // Second, step character by character right, looking for the best fit.\n var bestEquality1 = equality1;\n var bestEdit = edit;\n var bestEquality2 = equality2;\n var bestScore = diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n while (edit.charAt(0) === equality2.charAt(0)) {\n equality1 += edit.charAt(0);\n edit = edit.substring(1) + equality2.charAt(0);\n equality2 = equality2.substring(1);\n var score = diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n // The >= encourages trailing rather than leading whitespace on edits.\n if (score >= bestScore) {\n bestScore = score;\n bestEquality1 = equality1;\n bestEdit = edit;\n bestEquality2 = equality2;\n }\n }\n\n if (diffs[pointer - 1][1] != bestEquality1) {\n // We have an improvement, save it back to the diff.\n if (bestEquality1) {\n diffs[pointer - 1][1] = bestEquality1;\n } else {\n diffs.splice(pointer - 1, 1);\n pointer--;\n }\n diffs[pointer][1] = bestEdit;\n if (bestEquality2) {\n diffs[pointer + 1][1] = bestEquality2;\n } else {\n diffs.splice(pointer + 1, 1);\n pointer--;\n }\n }\n }\n pointer++;\n }\n};\n\n// Define some regex patterns for matching boundaries.\ndiff_match_patch.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;\ndiff_match_patch.whitespaceRegex_ = /\\s/;\ndiff_match_patch.linebreakRegex_ = /[\\r\\n]/;\ndiff_match_patch.blanklineEndRegex_ = /\\n\\r?\\n$/;\ndiff_match_patch.blanklineStartRegex_ = /^\\r?\\n\\r?\\n/;\n\n/**\n * Reduce the number of edits by eliminating operationally trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastEquality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Is there an insertion operation before the last equality.\n var pre_ins = false;\n // Is there a deletion operation before the last equality.\n var pre_del = false;\n // Is there an insertion operation after the last equality.\n var post_ins = false;\n // Is there a deletion operation after the last equality.\n var post_del = false;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found.\n if (diffs[pointer][1].length < this.Diff_EditCost &&\n (post_ins || post_del)) {\n // Candidate found.\n equalities[equalitiesLength++] = pointer;\n pre_ins = post_ins;\n pre_del = post_del;\n lastEquality = diffs[pointer][1];\n } else {\n // Not a candidate, and can never become one.\n equalitiesLength = 0;\n lastEquality = null;\n }\n post_ins = post_del = false;\n } else { // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_DELETE) {\n post_del = true;\n } else {\n post_ins = true;\n }\n /*\n * Five types to be split:\n * ABXYCD\n * AXCD\n * ABXC\n * AXCD\n * ABXC\n */\n if (lastEquality && ((pre_ins && pre_del && post_ins && post_del) ||\n ((lastEquality.length < this.Diff_EditCost / 2) &&\n (pre_ins + pre_del + post_ins + post_del) == 3))) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0,\n new diff_match_patch.Diff(DIFF_DELETE, lastEquality));\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n equalitiesLength--; // Throw away the equality we just deleted;\n lastEquality = null;\n if (pre_ins && pre_del) {\n // No changes made which could affect previous entry, keep going.\n post_ins = post_del = true;\n equalitiesLength = 0;\n } else {\n equalitiesLength--; // Throw away the previous equality.\n pointer = equalitiesLength > 0 ?\n equalities[equalitiesLength - 1] : -1;\n post_ins = post_del = false;\n }\n changes = true;\n }\n }\n pointer++;\n }\n\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupMerge = function(diffs) {\n // Add a dummy entry at the end.\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ''));\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = this.diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, new diff_match_patch.Diff(DIFF_EQUAL,\n text_insert.substring(0, commonlength)));\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = this.diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n pointer -= count_delete + count_insert;\n diffs.splice(pointer, count_delete + count_insert);\n if (text_delete.length) {\n diffs.splice(pointer, 0,\n new diff_match_patch.Diff(DIFF_DELETE, text_delete));\n pointer++;\n }\n if (text_insert.length) {\n diffs.splice(pointer, 0,\n new diff_match_patch.Diff(DIFF_INSERT, text_insert));\n pointer++;\n }\n pointer++;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n};\n\n\n/**\n * loc is a location in text1, compute and return the equivalent location in\n * text2.\n * e.g. 'The cat' vs 'The big cat', 1->1, 5->8\n * @param {!Array.} diffs Array of diff tuples.\n * @param {number} loc Location within text1.\n * @return {number} Location within text2.\n */\ndiff_match_patch.prototype.diff_xIndex = function(diffs, loc) {\n var chars1 = 0;\n var chars2 = 0;\n var last_chars1 = 0;\n var last_chars2 = 0;\n var x;\n for (x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_INSERT) { // Equality or deletion.\n chars1 += diffs[x][1].length;\n }\n if (diffs[x][0] !== DIFF_DELETE) { // Equality or insertion.\n chars2 += diffs[x][1].length;\n }\n if (chars1 > loc) { // Overshot the location.\n break;\n }\n last_chars1 = chars1;\n last_chars2 = chars2;\n }\n // Was the location was deleted?\n if (diffs.length != x && diffs[x][0] === DIFF_DELETE) {\n return last_chars2;\n }\n // Add the remaining character length.\n return last_chars2 + (loc - last_chars1);\n};\n\n\n/**\n * Convert a diff array into a pretty HTML report.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} HTML representation.\n */\ndiff_match_patch.prototype.diff_prettyHtml = function(diffs) {\n var html = [];\n var pattern_amp = /&/g;\n var pattern_lt = //g;\n var pattern_para = /\\n/g;\n for (var x = 0; x < diffs.length; x++) {\n var op = diffs[x][0]; // Operation (insert, delete, equal)\n var data = diffs[x][1]; // Text of change.\n var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<')\n .replace(pattern_gt, '>').replace(pattern_para, '¶
');\n switch (op) {\n case DIFF_INSERT:\n html[x] = '' + text + '';\n break;\n case DIFF_DELETE:\n html[x] = '' + text + '';\n break;\n case DIFF_EQUAL:\n html[x] = '' + text + '';\n break;\n }\n }\n return html.join('');\n};\n\n\n/**\n * Compute and return the source text (all equalities and deletions).\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Source text.\n */\ndiff_match_patch.prototype.diff_text1 = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_INSERT) {\n text[x] = diffs[x][1];\n }\n }\n return text.join('');\n};\n\n\n/**\n * Compute and return the destination text (all equalities and insertions).\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Destination text.\n */\ndiff_match_patch.prototype.diff_text2 = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_DELETE) {\n text[x] = diffs[x][1];\n }\n }\n return text.join('');\n};\n\n\n/**\n * Compute the Levenshtein distance; the number of inserted, deleted or\n * substituted characters.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {number} Number of changes.\n */\ndiff_match_patch.prototype.diff_levenshtein = function(diffs) {\n var levenshtein = 0;\n var insertions = 0;\n var deletions = 0;\n for (var x = 0; x < diffs.length; x++) {\n var op = diffs[x][0];\n var data = diffs[x][1];\n switch (op) {\n case DIFF_INSERT:\n insertions += data.length;\n break;\n case DIFF_DELETE:\n deletions += data.length;\n break;\n case DIFF_EQUAL:\n // A deletion and an insertion is one substitution.\n levenshtein += Math.max(insertions, deletions);\n insertions = 0;\n deletions = 0;\n break;\n }\n }\n levenshtein += Math.max(insertions, deletions);\n return levenshtein;\n};\n\n\n/**\n * Crush the diff into an encoded string which describes the operations\n * required to transform text1 into text2.\n * E.g. =3\\t-2\\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'.\n * Operations are tab-separated. Inserted text is escaped using %xx notation.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Delta text.\n */\ndiff_match_patch.prototype.diff_toDelta = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n switch (diffs[x][0]) {\n case DIFF_INSERT:\n text[x] = '+' + encodeURI(diffs[x][1]);\n break;\n case DIFF_DELETE:\n text[x] = '-' + diffs[x][1].length;\n break;\n case DIFF_EQUAL:\n text[x] = '=' + diffs[x][1].length;\n break;\n }\n }\n return text.join('\\t').replace(/%20/g, ' ');\n};\n\n\n/**\n * Given the original text1, and an encoded string which describes the\n * operations required to transform text1 into text2, compute the full diff.\n * @param {string} text1 Source string for the diff.\n * @param {string} delta Delta text.\n * @return {!Array.} Array of diff tuples.\n * @throws {!Error} If invalid input.\n */\ndiff_match_patch.prototype.diff_fromDelta = function(text1, delta) {\n var diffs = [];\n var diffsLength = 0; // Keeping our own length var is faster in JS.\n var pointer = 0; // Cursor in text1\n var tokens = delta.split(/\\t/g);\n for (var x = 0; x < tokens.length; x++) {\n // Each token begins with a one character parameter which specifies the\n // operation of this token (delete, insert, equality).\n var param = tokens[x].substring(1);\n switch (tokens[x].charAt(0)) {\n case '+':\n try {\n diffs[diffsLength++] =\n new diff_match_patch.Diff(DIFF_INSERT, decodeURI(param));\n } catch (ex) {\n // Malformed URI sequence.\n throw new Error('Illegal escape in diff_fromDelta: ' + param);\n }\n break;\n case '-':\n // Fall through.\n case '=':\n var n = parseInt(param, 10);\n if (isNaN(n) || n < 0) {\n throw new Error('Invalid number in diff_fromDelta: ' + param);\n }\n var text = text1.substring(pointer, pointer += n);\n if (tokens[x].charAt(0) == '=') {\n diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_EQUAL, text);\n } else {\n diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_DELETE, text);\n }\n break;\n default:\n // Blank tokens are ok (from a trailing \\t).\n // Anything else is an error.\n if (tokens[x]) {\n throw new Error('Invalid diff operation in diff_fromDelta: ' +\n tokens[x]);\n }\n }\n }\n if (pointer != text1.length) {\n throw new Error('Delta length (' + pointer +\n ') does not equal source text length (' + text1.length + ').');\n }\n return diffs;\n};\n\n\n// MATCH FUNCTIONS\n\n\n/**\n * Locate the best instance of 'pattern' in 'text' near 'loc'.\n * @param {string} text The text to search.\n * @param {string} pattern The pattern to search for.\n * @param {number} loc The location to search around.\n * @return {number} Best match index or -1.\n */\ndiff_match_patch.prototype.match_main = function(text, pattern, loc) {\n // Check for null inputs.\n if (text == null || pattern == null || loc == null) {\n throw new Error('Null input. (match_main)');\n }\n\n loc = Math.max(0, Math.min(loc, text.length));\n if (text == pattern) {\n // Shortcut (potentially not guaranteed by the algorithm)\n return 0;\n } else if (!text.length) {\n // Nothing to match.\n return -1;\n } else if (text.substring(loc, loc + pattern.length) == pattern) {\n // Perfect match at the perfect spot! (Includes case of null pattern)\n return loc;\n } else {\n // Do a fuzzy compare.\n return this.match_bitap_(text, pattern, loc);\n }\n};\n\n\n/**\n * Locate the best instance of 'pattern' in 'text' near 'loc' using the\n * Bitap algorithm.\n * @param {string} text The text to search.\n * @param {string} pattern The pattern to search for.\n * @param {number} loc The location to search around.\n * @return {number} Best match index or -1.\n * @private\n */\ndiff_match_patch.prototype.match_bitap_ = function(text, pattern, loc) {\n if (pattern.length > this.Match_MaxBits) {\n throw new Error('Pattern too long for this browser.');\n }\n\n // Initialise the alphabet.\n var s = this.match_alphabet_(pattern);\n\n var dmp = this; // 'this' becomes 'window' in a closure.\n\n /**\n * Compute and return the score for a match with e errors and x location.\n * Accesses loc and pattern through being a closure.\n * @param {number} e Number of errors in match.\n * @param {number} x Location of match.\n * @return {number} Overall score for match (0.0 = good, 1.0 = bad).\n * @private\n */\n function match_bitapScore_(e, x) {\n var accuracy = e / pattern.length;\n var proximity = Math.abs(loc - x);\n if (!dmp.Match_Distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy;\n }\n return accuracy + (proximity / dmp.Match_Distance);\n }\n\n // Highest score beyond which we give up.\n var score_threshold = this.Match_Threshold;\n // Is there a nearby exact match? (speedup)\n var best_loc = text.indexOf(pattern, loc);\n if (best_loc != -1) {\n score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold);\n // What about in the other direction? (speedup)\n best_loc = text.lastIndexOf(pattern, loc + pattern.length);\n if (best_loc != -1) {\n score_threshold =\n Math.min(match_bitapScore_(0, best_loc), score_threshold);\n }\n }\n\n // Initialise the bit arrays.\n var matchmask = 1 << (pattern.length - 1);\n best_loc = -1;\n\n var bin_min, bin_mid;\n var bin_max = pattern.length + text.length;\n var last_rd;\n for (var d = 0; d < pattern.length; d++) {\n // Scan for the best match; each iteration allows for one more error.\n // Run a binary search to determine how far from 'loc' we can stray at this\n // error level.\n bin_min = 0;\n bin_mid = bin_max;\n while (bin_min < bin_mid) {\n if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) {\n bin_min = bin_mid;\n } else {\n bin_max = bin_mid;\n }\n bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min);\n }\n // Use the result from this iteration as the maximum for the next.\n bin_max = bin_mid;\n var start = Math.max(1, loc - bin_mid + 1);\n var finish = Math.min(loc + bin_mid, text.length) + pattern.length;\n\n var rd = Array(finish + 2);\n rd[finish + 1] = (1 << d) - 1;\n for (var j = finish; j >= start; j--) {\n // The alphabet (s) is a sparse hash, so the following line generates\n // warnings.\n var charMatch = s[text.charAt(j - 1)];\n if (d === 0) { // First pass: exact match.\n rd[j] = ((rd[j + 1] << 1) | 1) & charMatch;\n } else { // Subsequent passes: fuzzy match.\n rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) |\n (((last_rd[j + 1] | last_rd[j]) << 1) | 1) |\n last_rd[j + 1];\n }\n if (rd[j] & matchmask) {\n var score = match_bitapScore_(d, j - 1);\n // This match will almost certainly be better than any existing match.\n // But check anyway.\n if (score <= score_threshold) {\n // Told you so.\n score_threshold = score;\n best_loc = j - 1;\n if (best_loc > loc) {\n // When passing loc, don't exceed our current distance from loc.\n start = Math.max(1, 2 * loc - best_loc);\n } else {\n // Already passed loc, downhill from here on in.\n break;\n }\n }\n }\n }\n // No hope for a (better) match at greater error levels.\n if (match_bitapScore_(d + 1, loc) > score_threshold) {\n break;\n }\n last_rd = rd;\n }\n return best_loc;\n};\n\n\n/**\n * Initialise the alphabet for the Bitap algorithm.\n * @param {string} pattern The text to encode.\n * @return {!Object} Hash of character locations.\n * @private\n */\ndiff_match_patch.prototype.match_alphabet_ = function(pattern) {\n var s = {};\n for (var i = 0; i < pattern.length; i++) {\n s[pattern.charAt(i)] = 0;\n }\n for (var i = 0; i < pattern.length; i++) {\n s[pattern.charAt(i)] |= 1 << (pattern.length - i - 1);\n }\n return s;\n};\n\n\n// PATCH FUNCTIONS\n\n\n/**\n * Increase the context until it is unique,\n * but don't let the pattern expand beyond Match_MaxBits.\n * @param {!diff_match_patch.patch_obj} patch The patch to grow.\n * @param {string} text Source text.\n * @private\n */\ndiff_match_patch.prototype.patch_addContext_ = function(patch, text) {\n if (text.length == 0) {\n return;\n }\n if (patch.start2 === null) {\n throw Error('patch not initialized');\n }\n var pattern = text.substring(patch.start2, patch.start2 + patch.length1);\n var padding = 0;\n\n // Look for the first and last matches of pattern in text. If two different\n // matches are found, increase the pattern length.\n while (text.indexOf(pattern) != text.lastIndexOf(pattern) &&\n pattern.length < this.Match_MaxBits - this.Patch_Margin -\n this.Patch_Margin) {\n padding += this.Patch_Margin;\n pattern = text.substring(patch.start2 - padding,\n patch.start2 + patch.length1 + padding);\n }\n // Add one chunk for good luck.\n padding += this.Patch_Margin;\n\n // Add the prefix.\n var prefix = text.substring(patch.start2 - padding, patch.start2);\n if (prefix) {\n patch.diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, prefix));\n }\n // Add the suffix.\n var suffix = text.substring(patch.start2 + patch.length1,\n patch.start2 + patch.length1 + padding);\n if (suffix) {\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, suffix));\n }\n\n // Roll back the start points.\n patch.start1 -= prefix.length;\n patch.start2 -= prefix.length;\n // Extend the lengths.\n patch.length1 += prefix.length + suffix.length;\n patch.length2 += prefix.length + suffix.length;\n};\n\n\n/**\n * Compute a list of patches to turn text1 into text2.\n * Use diffs if provided, otherwise compute it ourselves.\n * There are four ways to call this function, depending on what data is\n * available to the caller:\n * Method 1:\n * a = text1, b = text2\n * Method 2:\n * a = diffs\n * Method 3 (optimal):\n * a = text1, b = diffs\n * Method 4 (deprecated, use method 3):\n * a = text1, b = text2, c = diffs\n *\n * @param {string|!Array.} a text1 (methods 1,3,4) or\n * Array of diff tuples for text1 to text2 (method 2).\n * @param {string|!Array.=} opt_b text2 (methods 1,4) or\n * Array of diff tuples for text1 to text2 (method 3) or undefined (method 2).\n * @param {string|!Array.=} opt_c Array of diff tuples\n * for text1 to text2 (method 4) or undefined (methods 1,2,3).\n * @return {!Array.} Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_make = function(a, opt_b, opt_c) {\n var text1, diffs;\n if (typeof a == 'string' && typeof opt_b == 'string' &&\n typeof opt_c == 'undefined') {\n // Method 1: text1, text2\n // Compute diffs from text1 and text2.\n text1 = /** @type {string} */(a);\n diffs = this.diff_main(text1, /** @type {string} */(opt_b), true);\n if (diffs.length > 2) {\n this.diff_cleanupSemantic(diffs);\n this.diff_cleanupEfficiency(diffs);\n }\n } else if (a && typeof a == 'object' && typeof opt_b == 'undefined' &&\n typeof opt_c == 'undefined') {\n // Method 2: diffs\n // Compute text1 from diffs.\n diffs = /** @type {!Array.} */(a);\n text1 = this.diff_text1(diffs);\n } else if (typeof a == 'string' && opt_b && typeof opt_b == 'object' &&\n typeof opt_c == 'undefined') {\n // Method 3: text1, diffs\n text1 = /** @type {string} */(a);\n diffs = /** @type {!Array.} */(opt_b);\n } else if (typeof a == 'string' && typeof opt_b == 'string' &&\n opt_c && typeof opt_c == 'object') {\n // Method 4: text1, text2, diffs\n // text2 is not used.\n text1 = /** @type {string} */(a);\n diffs = /** @type {!Array.} */(opt_c);\n } else {\n throw new Error('Unknown call format to patch_make.');\n }\n\n if (diffs.length === 0) {\n return []; // Get rid of the null case.\n }\n var patches = [];\n var patch = new diff_match_patch.patch_obj();\n var patchDiffLength = 0; // Keeping our own length var is faster in JS.\n var char_count1 = 0; // Number of characters into the text1 string.\n var char_count2 = 0; // Number of characters into the text2 string.\n // Start with text1 (prepatch_text) and apply the diffs until we arrive at\n // text2 (postpatch_text). We recreate the patches one by one to determine\n // context info.\n var prepatch_text = text1;\n var postpatch_text = text1;\n for (var x = 0; x < diffs.length; x++) {\n var diff_type = diffs[x][0];\n var diff_text = diffs[x][1];\n\n if (!patchDiffLength && diff_type !== DIFF_EQUAL) {\n // A new patch starts here.\n patch.start1 = char_count1;\n patch.start2 = char_count2;\n }\n\n switch (diff_type) {\n case DIFF_INSERT:\n patch.diffs[patchDiffLength++] = diffs[x];\n patch.length2 += diff_text.length;\n postpatch_text = postpatch_text.substring(0, char_count2) + diff_text +\n postpatch_text.substring(char_count2);\n break;\n case DIFF_DELETE:\n patch.length1 += diff_text.length;\n patch.diffs[patchDiffLength++] = diffs[x];\n postpatch_text = postpatch_text.substring(0, char_count2) +\n postpatch_text.substring(char_count2 +\n diff_text.length);\n break;\n case DIFF_EQUAL:\n if (diff_text.length <= 2 * this.Patch_Margin &&\n patchDiffLength && diffs.length != x + 1) {\n // Small equality inside a patch.\n patch.diffs[patchDiffLength++] = diffs[x];\n patch.length1 += diff_text.length;\n patch.length2 += diff_text.length;\n } else if (diff_text.length >= 2 * this.Patch_Margin) {\n // Time for a new patch.\n if (patchDiffLength) {\n this.patch_addContext_(patch, prepatch_text);\n patches.push(patch);\n patch = new diff_match_patch.patch_obj();\n patchDiffLength = 0;\n // Unlike Unidiff, our patch lists have a rolling context.\n // https://github.com/google/diff-match-patch/wiki/Unidiff\n // Update prepatch text & pos to reflect the application of the\n // just completed patch.\n prepatch_text = postpatch_text;\n char_count1 = char_count2;\n }\n }\n break;\n }\n\n // Update the current character count.\n if (diff_type !== DIFF_INSERT) {\n char_count1 += diff_text.length;\n }\n if (diff_type !== DIFF_DELETE) {\n char_count2 += diff_text.length;\n }\n }\n // Pick up the leftover patch if not empty.\n if (patchDiffLength) {\n this.patch_addContext_(patch, prepatch_text);\n patches.push(patch);\n }\n\n return patches;\n};\n\n\n/**\n * Given an array of patches, return another array that is identical.\n * @param {!Array.} patches Array of Patch objects.\n * @return {!Array.} Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_deepCopy = function(patches) {\n // Making deep copies is hard in JavaScript.\n var patchesCopy = [];\n for (var x = 0; x < patches.length; x++) {\n var patch = patches[x];\n var patchCopy = new diff_match_patch.patch_obj();\n patchCopy.diffs = [];\n for (var y = 0; y < patch.diffs.length; y++) {\n patchCopy.diffs[y] =\n new diff_match_patch.Diff(patch.diffs[y][0], patch.diffs[y][1]);\n }\n patchCopy.start1 = patch.start1;\n patchCopy.start2 = patch.start2;\n patchCopy.length1 = patch.length1;\n patchCopy.length2 = patch.length2;\n patchesCopy[x] = patchCopy;\n }\n return patchesCopy;\n};\n\n\n/**\n * Merge a set of patches onto the text. Return a patched text, as well\n * as a list of true/false values indicating which patches were applied.\n * @param {!Array.} patches Array of Patch objects.\n * @param {string} text Old text.\n * @return {!Array.>} Two element Array, containing the\n * new text and an array of boolean values.\n */\ndiff_match_patch.prototype.patch_apply = function(patches, text) {\n if (patches.length == 0) {\n return [text, []];\n }\n\n // Deep copy the patches so that no changes are made to originals.\n patches = this.patch_deepCopy(patches);\n\n var nullPadding = this.patch_addPadding(patches);\n text = nullPadding + text + nullPadding;\n\n this.patch_splitMax(patches);\n // delta keeps track of the offset between the expected and actual location\n // of the previous patch. If there are patches expected at positions 10 and\n // 20, but the first patch was found at 12, delta is 2 and the second patch\n // has an effective expected position of 22.\n var delta = 0;\n var results = [];\n for (var x = 0; x < patches.length; x++) {\n var expected_loc = patches[x].start2 + delta;\n var text1 = this.diff_text1(patches[x].diffs);\n var start_loc;\n var end_loc = -1;\n if (text1.length > this.Match_MaxBits) {\n // patch_splitMax will only provide an oversized pattern in the case of\n // a monster delete.\n start_loc = this.match_main(text, text1.substring(0, this.Match_MaxBits),\n expected_loc);\n if (start_loc != -1) {\n end_loc = this.match_main(text,\n text1.substring(text1.length - this.Match_MaxBits),\n expected_loc + text1.length - this.Match_MaxBits);\n if (end_loc == -1 || start_loc >= end_loc) {\n // Can't find valid trailing context. Drop this patch.\n start_loc = -1;\n }\n }\n } else {\n start_loc = this.match_main(text, text1, expected_loc);\n }\n if (start_loc == -1) {\n // No match found. :(\n results[x] = false;\n // Subtract the delta for this failed patch from subsequent patches.\n delta -= patches[x].length2 - patches[x].length1;\n } else {\n // Found a match. :)\n results[x] = true;\n delta = start_loc - expected_loc;\n var text2;\n if (end_loc == -1) {\n text2 = text.substring(start_loc, start_loc + text1.length);\n } else {\n text2 = text.substring(start_loc, end_loc + this.Match_MaxBits);\n }\n if (text1 == text2) {\n // Perfect match, just shove the replacement text in.\n text = text.substring(0, start_loc) +\n this.diff_text2(patches[x].diffs) +\n text.substring(start_loc + text1.length);\n } else {\n // Imperfect match. Run a diff to get a framework of equivalent\n // indices.\n var diffs = this.diff_main(text1, text2, false);\n if (text1.length > this.Match_MaxBits &&\n this.diff_levenshtein(diffs) / text1.length >\n this.Patch_DeleteThreshold) {\n // The end points match, but the content is unacceptably bad.\n results[x] = false;\n } else {\n this.diff_cleanupSemanticLossless(diffs);\n var index1 = 0;\n var index2;\n for (var y = 0; y < patches[x].diffs.length; y++) {\n var mod = patches[x].diffs[y];\n if (mod[0] !== DIFF_EQUAL) {\n index2 = this.diff_xIndex(diffs, index1);\n }\n if (mod[0] === DIFF_INSERT) { // Insertion\n text = text.substring(0, start_loc + index2) + mod[1] +\n text.substring(start_loc + index2);\n } else if (mod[0] === DIFF_DELETE) { // Deletion\n text = text.substring(0, start_loc + index2) +\n text.substring(start_loc + this.diff_xIndex(diffs,\n index1 + mod[1].length));\n }\n if (mod[0] !== DIFF_DELETE) {\n index1 += mod[1].length;\n }\n }\n }\n }\n }\n }\n // Strip the padding off.\n text = text.substring(nullPadding.length, text.length - nullPadding.length);\n return [text, results];\n};\n\n\n/**\n * Add some padding on text start and end so that edges can match something.\n * Intended to be called only from within patch_apply.\n * @param {!Array.} patches Array of Patch objects.\n * @return {string} The padding string added to each side.\n */\ndiff_match_patch.prototype.patch_addPadding = function(patches) {\n var paddingLength = this.Patch_Margin;\n var nullPadding = '';\n for (var x = 1; x <= paddingLength; x++) {\n nullPadding += String.fromCharCode(x);\n }\n\n // Bump all the patches forward.\n for (var x = 0; x < patches.length; x++) {\n patches[x].start1 += paddingLength;\n patches[x].start2 += paddingLength;\n }\n\n // Add some padding on start of first diff.\n var patch = patches[0];\n var diffs = patch.diffs;\n if (diffs.length == 0 || diffs[0][0] != DIFF_EQUAL) {\n // Add nullPadding equality.\n diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, nullPadding));\n patch.start1 -= paddingLength; // Should be 0.\n patch.start2 -= paddingLength; // Should be 0.\n patch.length1 += paddingLength;\n patch.length2 += paddingLength;\n } else if (paddingLength > diffs[0][1].length) {\n // Grow first equality.\n var extraLength = paddingLength - diffs[0][1].length;\n diffs[0][1] = nullPadding.substring(diffs[0][1].length) + diffs[0][1];\n patch.start1 -= extraLength;\n patch.start2 -= extraLength;\n patch.length1 += extraLength;\n patch.length2 += extraLength;\n }\n\n // Add some padding on end of last diff.\n patch = patches[patches.length - 1];\n diffs = patch.diffs;\n if (diffs.length == 0 || diffs[diffs.length - 1][0] != DIFF_EQUAL) {\n // Add nullPadding equality.\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, nullPadding));\n patch.length1 += paddingLength;\n patch.length2 += paddingLength;\n } else if (paddingLength > diffs[diffs.length - 1][1].length) {\n // Grow last equality.\n var extraLength = paddingLength - diffs[diffs.length - 1][1].length;\n diffs[diffs.length - 1][1] += nullPadding.substring(0, extraLength);\n patch.length1 += extraLength;\n patch.length2 += extraLength;\n }\n\n return nullPadding;\n};\n\n\n/**\n * Look through the patches and break up any which are longer than the maximum\n * limit of the match algorithm.\n * Intended to be called only from within patch_apply.\n * @param {!Array.} patches Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_splitMax = function(patches) {\n var patch_size = this.Match_MaxBits;\n for (var x = 0; x < patches.length; x++) {\n if (patches[x].length1 <= patch_size) {\n continue;\n }\n var bigpatch = patches[x];\n // Remove the big old patch.\n patches.splice(x--, 1);\n var start1 = bigpatch.start1;\n var start2 = bigpatch.start2;\n var precontext = '';\n while (bigpatch.diffs.length !== 0) {\n // Create one of several smaller patches.\n var patch = new diff_match_patch.patch_obj();\n var empty = true;\n patch.start1 = start1 - precontext.length;\n patch.start2 = start2 - precontext.length;\n if (precontext !== '') {\n patch.length1 = patch.length2 = precontext.length;\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, precontext));\n }\n while (bigpatch.diffs.length !== 0 &&\n patch.length1 < patch_size - this.Patch_Margin) {\n var diff_type = bigpatch.diffs[0][0];\n var diff_text = bigpatch.diffs[0][1];\n if (diff_type === DIFF_INSERT) {\n // Insertions are harmless.\n patch.length2 += diff_text.length;\n start2 += diff_text.length;\n patch.diffs.push(bigpatch.diffs.shift());\n empty = false;\n } else if (diff_type === DIFF_DELETE && patch.diffs.length == 1 &&\n patch.diffs[0][0] == DIFF_EQUAL &&\n diff_text.length > 2 * patch_size) {\n // This is a large deletion. Let it pass in one chunk.\n patch.length1 += diff_text.length;\n start1 += diff_text.length;\n empty = false;\n patch.diffs.push(new diff_match_patch.Diff(diff_type, diff_text));\n bigpatch.diffs.shift();\n } else {\n // Deletion or equality. Only take as much as we can stomach.\n diff_text = diff_text.substring(0,\n patch_size - patch.length1 - this.Patch_Margin);\n patch.length1 += diff_text.length;\n start1 += diff_text.length;\n if (diff_type === DIFF_EQUAL) {\n patch.length2 += diff_text.length;\n start2 += diff_text.length;\n } else {\n empty = false;\n }\n patch.diffs.push(new diff_match_patch.Diff(diff_type, diff_text));\n if (diff_text == bigpatch.diffs[0][1]) {\n bigpatch.diffs.shift();\n } else {\n bigpatch.diffs[0][1] =\n bigpatch.diffs[0][1].substring(diff_text.length);\n }\n }\n }\n // Compute the head context for the next patch.\n precontext = this.diff_text2(patch.diffs);\n precontext =\n precontext.substring(precontext.length - this.Patch_Margin);\n // Append the end context for this patch.\n var postcontext = this.diff_text1(bigpatch.diffs)\n .substring(0, this.Patch_Margin);\n if (postcontext !== '') {\n patch.length1 += postcontext.length;\n patch.length2 += postcontext.length;\n if (patch.diffs.length !== 0 &&\n patch.diffs[patch.diffs.length - 1][0] === DIFF_EQUAL) {\n patch.diffs[patch.diffs.length - 1][1] += postcontext;\n } else {\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, postcontext));\n }\n }\n if (!empty) {\n patches.splice(++x, 0, patch);\n }\n }\n }\n};\n\n\n/**\n * Take a list of patches and return a textual representation.\n * @param {!Array.} patches Array of Patch objects.\n * @return {string} Text representation of patches.\n */\ndiff_match_patch.prototype.patch_toText = function(patches) {\n var text = [];\n for (var x = 0; x < patches.length; x++) {\n text[x] = patches[x];\n }\n return text.join('');\n};\n\n\n/**\n * Parse a textual representation of patches and return a list of Patch objects.\n * @param {string} textline Text representation of patches.\n * @return {!Array.} Array of Patch objects.\n * @throws {!Error} If invalid input.\n */\ndiff_match_patch.prototype.patch_fromText = function(textline) {\n var patches = [];\n if (!textline) {\n return patches;\n }\n var text = textline.split('\\n');\n var textPointer = 0;\n var patchHeader = /^@@ -(\\d+),?(\\d*) \\+(\\d+),?(\\d*) @@$/;\n while (textPointer < text.length) {\n var m = text[textPointer].match(patchHeader);\n if (!m) {\n throw new Error('Invalid patch string: ' + text[textPointer]);\n }\n var patch = new diff_match_patch.patch_obj();\n patches.push(patch);\n patch.start1 = parseInt(m[1], 10);\n if (m[2] === '') {\n patch.start1--;\n patch.length1 = 1;\n } else if (m[2] == '0') {\n patch.length1 = 0;\n } else {\n patch.start1--;\n patch.length1 = parseInt(m[2], 10);\n }\n\n patch.start2 = parseInt(m[3], 10);\n if (m[4] === '') {\n patch.start2--;\n patch.length2 = 1;\n } else if (m[4] == '0') {\n patch.length2 = 0;\n } else {\n patch.start2--;\n patch.length2 = parseInt(m[4], 10);\n }\n textPointer++;\n\n while (textPointer < text.length) {\n var sign = text[textPointer].charAt(0);\n try {\n var line = decodeURI(text[textPointer].substring(1));\n } catch (ex) {\n // Malformed URI sequence.\n throw new Error('Illegal escape in patch_fromText: ' + line);\n }\n if (sign == '-') {\n // Deletion.\n patch.diffs.push(new diff_match_patch.Diff(DIFF_DELETE, line));\n } else if (sign == '+') {\n // Insertion.\n patch.diffs.push(new diff_match_patch.Diff(DIFF_INSERT, line));\n } else if (sign == ' ') {\n // Minor equality.\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, line));\n } else if (sign == '@') {\n // Start of next patch.\n break;\n } else if (sign === '') {\n // Blank line? Whatever.\n } else {\n // WTF?\n throw new Error('Invalid patch mode \"' + sign + '\" in: ' + line);\n }\n textPointer++;\n }\n }\n return patches;\n};\n\n\n/**\n * Class representing one patch operation.\n * @constructor\n */\ndiff_match_patch.patch_obj = function() {\n /** @type {!Array.} */\n this.diffs = [];\n /** @type {?number} */\n this.start1 = null;\n /** @type {?number} */\n this.start2 = null;\n /** @type {number} */\n this.length1 = 0;\n /** @type {number} */\n this.length2 = 0;\n};\n\n\n/**\n * Emulate GNU diff's format.\n * Header: @@ -382,8 +481,9 @@\n * Indices are printed as 1-based, not 0-based.\n * @return {string} The GNU diff string.\n */\ndiff_match_patch.patch_obj.prototype.toString = function() {\n var coords1, coords2;\n if (this.length1 === 0) {\n coords1 = this.start1 + ',0';\n } else if (this.length1 == 1) {\n coords1 = this.start1 + 1;\n } else {\n coords1 = (this.start1 + 1) + ',' + this.length1;\n }\n if (this.length2 === 0) {\n coords2 = this.start2 + ',0';\n } else if (this.length2 == 1) {\n coords2 = this.start2 + 1;\n } else {\n coords2 = (this.start2 + 1) + ',' + this.length2;\n }\n var text = ['@@ -' + coords1 + ' +' + coords2 + ' @@\\n'];\n var op;\n // Escape the body of the patch with %xx notation.\n for (var x = 0; x < this.diffs.length; x++) {\n switch (this.diffs[x][0]) {\n case DIFF_INSERT:\n op = '+';\n break;\n case DIFF_DELETE:\n op = '-';\n break;\n case DIFF_EQUAL:\n op = ' ';\n break;\n }\n text[x + 1] = op + encodeURI(this.diffs[x][1]) + '\\n';\n }\n return text.join('').replace(/%20/g, ' ');\n};\n\n\n// The following export code was added by @ForbesLindesay\nmodule.exports = diff_match_patch;\nmodule.exports.diff_match_patch = diff_match_patch;\nmodule.exports.DIFF_DELETE = DIFF_DELETE;\nmodule.exports.DIFF_INSERT = DIFF_INSERT;\nmodule.exports.DIFF_EQUAL = DIFF_EQUAL;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZGlmZi1tYXRjaC1wYXRjaC9pbmRleC5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOzs7QUFHQTs7O0FBR0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E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GRl9JTlNFUlQ6XG4gICAgICAgIGNvdW50X2luc2VydCsrO1xuICAgICAgICB0ZXh0X2luc2VydCArPSBkaWZmc1twb2ludGVyXVsxXTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIERJRkZfREVMRVRFOlxuICAgICAgICBjb3VudF9kZWxldGUrKztcbiAgICAgICAgdGV4dF9kZWxldGUgKz0gZGlmZnNbcG9pbnRlcl1bMV07XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSBESUZGX0VRVUFMOlxuICAgICAgICAvLyBVcG9uIHJlYWNoaW5nIGFuIGVxdWFsaXR5LCBjaGVjayBmb3IgcHJpb3IgcmVkdW5kYW5jaWVzLlxuICAgICAgICBpZiAoY291bnRfZGVsZXRlID49IDEgJiYgY291bnRfaW5zZXJ0ID49IDEpIHtcbiAgICAgICAgICAvLyBEZWxldGUgdGhlIG9mZmVuZGluZyByZWNvcmRzIGFuZCBhZGQgdGhlIG1lcmdlZCBvbmVzLlxuICAgICAgICAgIGRpZmZzLnNwbGljZShwb2ludGVyIC0gY291bnRfZGVsZXRlIC0gY291bnRfaW5zZXJ0LFxuICAgICAgICAgICAgICAgICAgICAgICBjb3VudF9kZWxldGUgKyBjb3VudF9pbnNlcnQpO1xuICAgICAgICAgIHBvaW50ZXIgPSBwb2ludGVyIC0gY291bnRfZGVsZXRlIC0gY291bnRfaW5zZXJ0O1xuICAgICAgICAgIHZhciBzdWJEaWZmID1cbiAgICAgICAgICAgICAgdGhpcy5kaWZmX21haW4odGV4dF9kZWxldGUsIHRleHRfaW5zZXJ0LCBmYWxzZSwgZGVhZGxpbmUpO1xuICAgICAgICAgIGZvciAodmFyIGogPSBzdWJEaWZmLmxlbmd0aCAtIDE7IGogPj0gMDsgai0tKSB7XG4gICAgICAgICAgICBkaWZmcy5zcGxpY2UocG9pbnRlciwgMCwgc3ViRGlmZltqXSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHBvaW50ZXIgPSBwb2ludGVyICsgc3ViR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rKztcbiAgICAgICAgdGV4dF9pbnNlcnQgKz0gZGlmZnNbcG9pbnRlcl1bMV07XG4gICAgICAgIHBvaW50ZXIrKztcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIERJRkZfREVMRVRFOlxuICAgICAgICBjb3VudF9kZWxldGUrKztcbiAgICAgICAgdGV4dF9kZWxldGUgKz0gZGlmZnNbcG9pbnRlcl1bMV07XG4gICAgICAgIHBvaW50ZXIrKztcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIERJRkZfRVFVQUw6XG4gICAgICAgIC8vIFVwb24gcmVhY2hpbmcgYW4gZXF1YWxpdHksIGNoZWNrIGZvciBwcmlvciByZWR1bmRhbmNpZXMuXG4gICAgICAgIGlmIChjb3VudF9kZWxldGUgKyBjb3VudF9pbnNlcnQgPiAxKSB7XG4gICAgICAgICAgaWYgKGNvdW50X2RlbGV0ZSAhPT0gMCAmJiBjb3VudF9pbnNlcnQgIT09IDApIHtcbiAgICAgICAgICAgIC8vIEZhY3RvciBvdXQgYW55IGNvbW1vbiBwcmVmaXhpZXMuXG4gICAgICAgICAgICBjb21tb25sZW5ndGggPSB0aGlzLmRpZmZfY29tbW9uUHJlZml4KHRleHRfaW5zZXJ0LCB0ZXh0X2RlbGV0ZSk7XG4gICAgICAgICAgICBpZiAoY29tbW9ubGVuZ3RoICE9PSAwKSB7XG4gICAgICAgICAgICAgIGlmICgocG9pbnRlciAtIGNvdW50X2RlbGV0ZSAtIGNvdW50X2luc2VydCkgPiAwICYmXG4gICAgICAgICAgICAgICAgICBkaWZmc1twb2ludGVyIC0gY291bnRfZGVsZXRlIC0gY291bnRfaW5zZXJ0IC0gMV1bMF0gPT1cbiAgICAgICAgICAgICAgICAgIERJRkZfRVFVQUwpIHtcbiAgICAgICAgICAgICAgICBkaWZmc1twb2ludGVyIC0gY291bnRfZGVsZXRlIC0gY291bnRfaW5zZXJ0IC0gMV1bMV0gKz1cbiAgICAgICAgICAgICAgICAgICAgdGV4dF9pbn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lLnN1YnN0cmluZygwLCB0ZXh0X2RlbGV0ZS5sZW5ndGggLVxuICAgICAgICAgICAgICAgICAgY29tbW9ubGVuZ3RoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgLy8gRGVsZXRlIHRoZSBvZmZlbmRpbmcgcmVjb3JkcyBhbmQgYWRkIHRoZSBtZXJnZWQgb25lcy5cbiAgICAgICAgICBwb2ludGVyIC09IGNvdW50X2RlbGV0ZSArIGNvdW50X2luc2VydDtcbiAgICAgICAgICBkaWZmcy5zcGxpY2UocG9pbnRlciwgY291bnRfZGVsZXRlICsgY291bnRfaW5zZXJ0KTtcbiAgICAgICAgICBpZiAodGV4dF9kZWxldGUubGVuZ3RoKSB7XG4gICAgICAgICAgICBkaWZmcy5zcGxpY2UocG9pbnRlciwgMCxcbiAgICAgICAgICAgICAgICBuZXcgZGlmZl9tYXRjaF9wYXRjaC5EaWZmKERJRkZfREVMRVRFLCB0ZXh0X2RlbGV0ZSkpO1xuICAgICAgICAgICAgcG9pbnRlcisrO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAodGV4dF9pbnNlcnQubGVuZ3RoKSB7XG4gICAgICAgICAgICBkaWZmcy5zcGxpY2UocG9pbnRlciwgMCxcbiAgICAgICAgICAgICAgICBuZXcgZGlmZl9tYXRjaF9wYXRjaC5EaWZmKERJRkZfSU5TRVJULCB0ZXh0X2luc2VydCkpO1xuICAgICAgICAgICAgcG9pbnRlcisrO1xuICAgICAgICAgIH1cbiAgICAgICAgICBwb2ludGVyKys7XG4gICAgICAgIH0gZWxzZSBpZiAocG9pbnRlciAhPT0gMCAmJiBkaWZmc1twb2ludGVyIC0gMV1bMF0gPT0gRElGRl9FUVVBTCkge1xuICAgICAgICAgIC8vIE1lcmdlIHRoaXMgZXF1YWxpdHkgd2l0aCB0aGUgcHJldmlvdXMgb25lLlxuICAgICAgICAgIGRpZmZzW3BvaW50ZXIgLSAxXVsxXSArPSBkaWZmc1twb2ludGVy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07XG4gICAgICAgICAgICBpZiAobW9kWzBdICE9PSBESUZGX0VRVUFMKSB7XG4gICAgICAgICAgICAgIGluZGV4MiA9IHRoaXMuZGlmZl94SW5kZXgoZGlmZnMsIGluZGV4MSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobW9kWzBdID09PSBESUZGX0lOU0VSVCkgeyAgLy8gSW5zZXJ0aW9uXG4gICAgICAgICAgICAgIHRleHQgPSB0ZXh0LnN1YnN0cmluZygwLCBzdGFydF9sb2MgKyBpbmRleDIpICsgbW9kWzFdICtcbiAgICAgICAgICAgICAgICAgICAgIHRleHQuc3Vic3RyaW5nKHN0YXJ0X2xvYyArIGluZGV4Mik7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1vZFswXSA9PT0gRElGRl9ERUxFVEUpIHsgIC8vIERlbGV0aW9uXG4gICAgICAgICAgICAgIHRleHQgPSB0ZXh0LnN1YnN0cmluZygwLCBzdGFydF9sb2MgKyBpbmRleDIpICtcbiAgICAgICAgICAgICAgICAgICAgIHRleHQuc3Vic3RyaW5nKHN0YXJ0X2xvYyArIHRoaXMuZGlmZl94SW5kZXgoZGlmZnMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXgxICsgbW9kWzFdLmxlbmd0aCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1vZFswXSAhPT0gRElGRl9ERUxFVEUpIHtcbiAgICAgICAgICAgICAgaW5kZXgxICs9IG1vZFsxXS5sZW5ndGg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG4gIC8vIFN0cmlwIHRoZSBwYWRkaW5nIG9mZi5cbiAgdGV4dCA9IHRleHQuc3Vic3RyaW5nKG51bGxQYWRkaW5nLmxlbmd0aCwgdGV4dC5sZW5ndGggLSBudWxsUGFkZGluZy5sZW5ndGgpO1xuICByZXR1cm4gW3RleHQsIHJlc3VsdHNdO1xufTtcblxuXG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yBAQFxcbiddO1xuICB2YXIgb3A7XG4gIC8vIEVzY2FwZSB0aGUgYm9keSBvZiB0aGUgcGF0Y2ggd2l0aCAleHggbm90YXRpb24uXG4gIGZvciAodmFyIHggPSAwOyB4IDwgdGhpcy5kaWZmcy5sZW5ndGg7IHgrKykge1xuICAgIHN3aXRjaCAodGhpcy5kaWZmc1t4XVswXSkge1xuICAgICAgY2FzZSBESUZGX0lOU0VSVDpcbiAgICAgICAgb3AgPSAnKyc7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSBESUZGX0RFTEVURTpcbiAgICAgICAgb3AgPSAnLSc7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSBESUZGX0VRVUFMOlxuICAgICAgICBvcCA9ICcgJztcbiAgICAgICAgYnJlYWs7XG4gICAgfVxuICAgIHRleHRbeCArIDFdID0gb3AgKyBlbmNvZGVVUkkodGhpcy5kaWZmc1t4XVsxXSkgKyAnXFxuJztcbiAgfVxuICByZXR1cm4gdGV4dC5qb2luKCcnKS5yZXBsYWNlKC8lMjAvZywgJyAnKTtcbn07XG5cblxuLy8gVGhlIGZvbGxvd2luZyBleHBvcnQgY29kZSB3YXMgYWRkZWQgYnkgQEZvcmJlc0xpbmRlc2F5XG5tb2R1bGUuZXhwb3J0cyA9IGRpZmZfbWF0Y2hfcGF0Y2g7XG5tb2R1bGUuZXhwb3J0c1snZGlmZl9tYXRjaF9wYXRjaCddID0gZGlmZl9tYXRjaF9wYXRjaDtcbm1vZHVsZS5leHBvcnRzWydESUZGX0RFTEVURSddID0gRElGRl9ERUxFVEU7XG5tb2R1bGUuZXhwb3J0c1snRElGRl9JTlNFUlQnXSA9IERJRkZfSU5TRVJUO1xubW9kdWxlLmV4cG9ydHNbJ0RJRkZfRVFVQUwnXSA9IERJRkZfRVFVQUw7Il0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/diff-match-patch/index.js\n"); - -/***/ }), - /***/ "./node_modules/dot-case/dist.es2015/index.js": /*!****************************************************!*\ !*** ./node_modules/dot-case/dist.es2015/index.js ***! @@ -7976,26 +7916,6 @@ eval("\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.ha /***/ }), -/***/ "./node_modules/lodash.get/index.js": -/*!******************************************!*\ - !*** ./node_modules/lodash.get/index.js ***! - \******************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -eval("/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n symbolTag = '[object Symbol]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n reLeadingDot = /^\\./,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n splice = arrayProto.splice;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = isKey(path, object) ? [path] : castPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n string = toString(string);\n\n var result = [];\n if (reLeadingDot.test(string)) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result);\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoLmdldC9pbmRleC5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxvQ0FBb0M7O0FBRXBDO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBLHdCQUF3QixxQkFBTSxnQkFBZ0IscUJBQU0sSUFBSSxxQkFBTSxzQkFBc0IscUJBQU07O0FBRTFGO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsUUFBUTtBQUNuQix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ID0+IDNcbiAqXG4gKiBfLmdldChvYmplY3QsICdhLmIuYycsICdkZWZhdWx0Jyk7XG4gKiAvLyA9PiAnZGVmYXVsdCdcbiAqL1xuZnVuY3Rpb24gZ2V0KG9iamVjdCwgcGF0aCwgZGVmYXVsdFZhbHVlKSB7XG4gIHZhciByZXN1bHQgPSBvYmplY3QgPT0gbnVsbCA/IHVuZGVmaW5lZCA6IGJhc2VHZXQob2JqZWN0LCBwYXRoKTtcbiAgcmV0dXJuIHJlc3VsdCA9PT0gdW5kZWZpbmVkID8gZGVmYXVsdFZhbHVlIDogcmVzdWx0O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGdldDtcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash.get/index.js\n"); - -/***/ }), - -/***/ "./node_modules/lodash.isequal/index.js": -/*!**********************************************!*\ - !*** ./node_modules/lodash.isequal/index.js ***! - \**********************************************/ -/***/ ((module, exports, __webpack_require__) => { - -eval("/* module decorator */ module = __webpack_require__.nmd(module);\n/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && \"object\" == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoLmlzZXF1YWwvaW5kZXguanMiLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0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4gICAgICB9XG4gICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgIGJyZWFrO1xuICAgIH1cbiAgICAvLyBSZWN1cnNpdmVseSBjb21wYXJlIGFycmF5cyAoc3VzY2VwdGlibGUgdG8gY2FsbCBzdGFjayBsaW1pdHMpLlxuICAgIGlmIChzZWVuKSB7XG4gICAgICBpZiAoIWFycmF5U29tZShvdGhlciwgZnVuY3Rpb24ob3RoVmFsdWUsIG90aEluZGV4KSB7XG4gICAgICAgICAgICBpZiAoIWNhY2hlSGFzKHNlZW4sIG90aEluZGV4KSAmJlxuICAgICAgICAgICAgICAgIChhcnJWYWx1ZSA9PT0gb3RoVmFsdWUgfHwgZXF1YWxGdW5jKGFyclZhbHVlLCBvdGhWYWx1ZSwgYml0bWFzaywgY3VzdG9taXplciwgc3RhY2spKSkge1xuICAgICAgICAgICAgICByZXR1cm4gc2Vlbi5wdXNoKG90aEluZGV4KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KSkge1xuICAgICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgfSBlbHNlIGlmICghKFxuICAgICAgICAgIGFyclZhbHVlID09PSBvdGhWYWx1ZSB8fFxuICAgICAgICAgICAgZXF1YWxGdW5jKGFyclZhbHVlLCBvdGhWYWx1ZSwgYml0bWFzaywgY3VzdG9taXplciwgc3RhY2spXG4gICAgICAgICkpIHtcbiAgICAgIHJlc3VsdCA9IGZhbHNlO1xuICAgICAgYnJlYWs7XG4gICAgfVxuICB9XG4gIHN0YWNrWydkZWxldGUnXShhcnJheSk7XG4gIHN0YWNrWydkZWxldGUnXShvdGhlcik7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbi8qKlxuICogQSBzcGVjaWFsaXplZCB2ZXJzaW9uIG9mIGBiYXNlSXNFcXVhbERlZXBgIGZvciBjb21wYXJpbmcgb2JqZWN0cyBvZlxuICogdGhlIHNhbWUgYHRvU3RyaW5nVGFnYC5cb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bHNlYC5cbiAqIEBleGFtcGxlXG4gKlxuICogXy50aW1lcygyLCBfLnN0dWJGYWxzZSk7XG4gKiAvLyA9PiBbZmFsc2UsIGZhbHNlXVxuICovXG5mdW5jdGlvbiBzdHViRmFsc2UoKSB7XG4gIHJldHVybiBmYWxzZTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBpc0VxdWFsO1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash.isequal/index.js\n"); - -/***/ }), - /***/ "./node_modules/lower-case/dist.es2015/index.js": /*!******************************************************!*\ !*** ./node_modules/lower-case/dist.es2015/index.js ***! @@ -9528,61 +9448,6 @@ eval("\n\nvar formats = __webpack_require__(/*! ./formats */ \"./node_modules/qs /***/ }), -/***/ "./node_modules/react-ace/lib/ace.js": -/*!*******************************************!*\ - !*** ./node_modules/react-ace/lib/ace.js ***! - \*******************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar ace_builds_1 = __webpack_require__(/*! ace-builds */ \"./node_modules/ace-builds/src-noconflict/ace.js\");\nvar PropTypes = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar isEqual = __webpack_require__(/*! lodash.isequal */ \"./node_modules/lodash.isequal/index.js\");\nvar editorOptions_1 = __webpack_require__(/*! ./editorOptions */ \"./node_modules/react-ace/lib/editorOptions.js\");\nvar ace = (0, editorOptions_1.getAceInstance)();\nvar ReactAce = /** @class */ (function (_super) {\n __extends(ReactAce, _super);\n function ReactAce(props) {\n var _this = _super.call(this, props) || this;\n editorOptions_1.editorEvents.forEach(function (method) {\n _this[method] = _this[method].bind(_this);\n });\n _this.debounce = editorOptions_1.debounce;\n return _this;\n }\n ReactAce.prototype.isInShadow = function (node) {\n var parent = node && node.parentNode;\n while (parent) {\n if (parent.toString() === \"[object ShadowRoot]\") {\n return true;\n }\n parent = parent.parentNode;\n }\n return false;\n };\n ReactAce.prototype.componentDidMount = function () {\n var _this = this;\n var _a = this.props, className = _a.className, onBeforeLoad = _a.onBeforeLoad, onValidate = _a.onValidate, mode = _a.mode, focus = _a.focus, theme = _a.theme, fontSize = _a.fontSize, lineHeight = _a.lineHeight, value = _a.value, defaultValue = _a.defaultValue, showGutter = _a.showGutter, wrapEnabled = _a.wrapEnabled, showPrintMargin = _a.showPrintMargin, _b = _a.scrollMargin, scrollMargin = _b === void 0 ? [0, 0, 0, 0] : _b, keyboardHandler = _a.keyboardHandler, onLoad = _a.onLoad, commands = _a.commands, annotations = _a.annotations, markers = _a.markers, placeholder = _a.placeholder;\n this.editor = ace.edit(this.refEditor);\n if (onBeforeLoad) {\n onBeforeLoad(ace);\n }\n var editorProps = Object.keys(this.props.editorProps);\n for (var i = 0; i < editorProps.length; i++) {\n this.editor[editorProps[i]] = this.props.editorProps[editorProps[i]];\n }\n if (this.props.debounceChangePeriod) {\n this.onChange = this.debounce(this.onChange, this.props.debounceChangePeriod);\n }\n this.editor.renderer.setScrollMargin(scrollMargin[0], scrollMargin[1], scrollMargin[2], scrollMargin[3]);\n if (this.isInShadow(this.refEditor)) {\n this.editor.renderer.attachToShadowRoot();\n }\n this.editor\n .getSession()\n .setMode(typeof mode === \"string\" ? \"ace/mode/\".concat(mode) : mode);\n if (theme && theme !== \"\")\n this.editor.setTheme(\"ace/theme/\".concat(theme));\n this.editor.setFontSize(typeof fontSize === \"number\" ? \"\".concat(fontSize, \"px\") : fontSize);\n if (lineHeight) {\n this.editor.container.style.lineHeight =\n typeof lineHeight === \"number\" ? \"\".concat(lineHeight, \"px\") : \"\".concat(lineHeight);\n this.editor.renderer.updateFontSize();\n }\n this.editor\n .getSession()\n .setValue(!defaultValue ? value || \"\" : defaultValue);\n if (this.props.navigateToFileEnd) {\n this.editor.navigateFileEnd();\n }\n this.editor.renderer.setShowGutter(showGutter);\n this.editor.getSession().setUseWrapMode(wrapEnabled);\n this.editor.setShowPrintMargin(showPrintMargin);\n this.editor.on(\"focus\", this.onFocus);\n this.editor.on(\"blur\", this.onBlur);\n this.editor.on(\"copy\", this.onCopy);\n this.editor.on(\"paste\", this.onPaste);\n this.editor.on(\"change\", this.onChange);\n this.editor.on(\"input\", this.onInput);\n if (placeholder) {\n this.updatePlaceholder();\n }\n this.editor\n .getSession()\n .selection.on(\"changeSelection\", this.onSelectionChange);\n this.editor.getSession().selection.on(\"changeCursor\", this.onCursorChange);\n if (onValidate) {\n // @ts-ignore types don't include\n this.editor.getSession().on(\"changeAnnotation\", function () {\n // tslint:disable-next-line:no-shadowed-variable\n var annotations = _this.editor.getSession().getAnnotations();\n _this.props.onValidate(annotations);\n });\n }\n this.editor.session.on(\"changeScrollTop\", this.onScroll);\n this.editor.getSession().setAnnotations(annotations || []);\n if (markers && markers.length > 0) {\n this.handleMarkers(markers);\n }\n // get a list of possible options to avoid 'misspelled option errors'\n var availableOptions = this.editor.$options;\n editorOptions_1.editorOptions.forEach(function (option) {\n if (availableOptions.hasOwnProperty(option)) {\n // @ts-ignore\n _this.editor.setOption(option, _this.props[option]);\n }\n else if (_this.props[option]) {\n console.warn(\"ReactAce: editor option \".concat(option, \" was activated but not found. Did you need to import a related tool or did you possibly mispell the option?\"));\n }\n });\n this.handleOptions(this.props);\n if (Array.isArray(commands)) {\n commands.forEach(function (command) {\n if (typeof command.exec === \"string\") {\n _this.editor.commands.bindKey(command.bindKey, command.exec);\n }\n else {\n _this.editor.commands.addCommand(command);\n }\n });\n }\n if (keyboardHandler) {\n this.editor.setKeyboardHandler(\"ace/keyboard/\" + keyboardHandler);\n }\n if (className) {\n this.refEditor.className += \" \" + className;\n }\n if (onLoad) {\n onLoad(this.editor);\n }\n this.editor.resize();\n if (focus) {\n this.editor.focus();\n }\n };\n ReactAce.prototype.componentDidUpdate = function (prevProps) {\n var oldProps = prevProps;\n var nextProps = this.props;\n for (var i = 0; i < editorOptions_1.editorOptions.length; i++) {\n var option = editorOptions_1.editorOptions[i];\n if (nextProps[option] !== oldProps[option]) {\n // @ts-ignore\n this.editor.setOption(option, nextProps[option]);\n }\n }\n if (nextProps.className !== oldProps.className) {\n var appliedClasses = this.refEditor.className;\n var appliedClassesArray_1 = appliedClasses.trim().split(\" \");\n var oldClassesArray = oldProps.className.trim().split(\" \");\n oldClassesArray.forEach(function (oldClass) {\n var index = appliedClassesArray_1.indexOf(oldClass);\n appliedClassesArray_1.splice(index, 1);\n });\n this.refEditor.className =\n \" \" + nextProps.className + \" \" + appliedClassesArray_1.join(\" \");\n }\n // First process editor value, as it may create a new session (see issue #300)\n var valueChanged = this.editor &&\n nextProps.value != null &&\n this.editor.getValue() !== nextProps.value;\n if (valueChanged) {\n // editor.setValue is a synchronous function call, change event is emitted before setValue return.\n this.silent = true;\n var pos = this.editor.session.selection.toJSON();\n this.editor.setValue(nextProps.value, nextProps.cursorStart);\n this.editor.session.selection.fromJSON(pos);\n this.silent = false;\n }\n if (nextProps.placeholder !== oldProps.placeholder) {\n this.updatePlaceholder();\n }\n if (nextProps.mode !== oldProps.mode) {\n this.editor\n .getSession()\n .setMode(typeof nextProps.mode === \"string\"\n ? \"ace/mode/\".concat(nextProps.mode)\n : nextProps.mode);\n }\n if (nextProps.theme !== oldProps.theme) {\n this.editor.setTheme(\"ace/theme/\" + nextProps.theme);\n }\n if (nextProps.keyboardHandler !== oldProps.keyboardHandler) {\n if (nextProps.keyboardHandler) {\n this.editor.setKeyboardHandler(\"ace/keyboard/\" + nextProps.keyboardHandler);\n }\n else {\n this.editor.setKeyboardHandler(null);\n }\n }\n if (nextProps.fontSize !== oldProps.fontSize) {\n this.editor.setFontSize(typeof nextProps.fontSize === \"number\"\n ? \"\".concat(nextProps.fontSize, \"px\")\n : nextProps.fontSize);\n }\n if (nextProps.lineHeight !== oldProps.lineHeight) {\n this.editor.container.style.lineHeight =\n typeof nextProps.lineHeight === \"number\"\n ? \"\".concat(nextProps.lineHeight, \"px\")\n : nextProps.lineHeight;\n this.editor.renderer.updateFontSize();\n }\n if (nextProps.wrapEnabled !== oldProps.wrapEnabled) {\n this.editor.getSession().setUseWrapMode(nextProps.wrapEnabled);\n }\n if (nextProps.showPrintMargin !== oldProps.showPrintMargin) {\n this.editor.setShowPrintMargin(nextProps.showPrintMargin);\n }\n if (nextProps.showGutter !== oldProps.showGutter) {\n this.editor.renderer.setShowGutter(nextProps.showGutter);\n }\n if (!isEqual(nextProps.setOptions, oldProps.setOptions)) {\n this.handleOptions(nextProps);\n }\n // if the value or annotations changed, set the annotations\n // changing the value may create create a new session which will require annotations to be re-set\n if (valueChanged || !isEqual(nextProps.annotations, oldProps.annotations)) {\n this.editor.getSession().setAnnotations(nextProps.annotations || []);\n }\n if (!isEqual(nextProps.markers, oldProps.markers) &&\n Array.isArray(nextProps.markers)) {\n this.handleMarkers(nextProps.markers);\n }\n // this doesn't look like it works at all....\n if (!isEqual(nextProps.scrollMargin, oldProps.scrollMargin)) {\n this.handleScrollMargins(nextProps.scrollMargin);\n }\n if (prevProps.height !== this.props.height ||\n prevProps.width !== this.props.width) {\n this.editor.resize();\n }\n if (this.props.focus && !prevProps.focus) {\n this.editor.focus();\n }\n };\n ReactAce.prototype.handleScrollMargins = function (margins) {\n if (margins === void 0) { margins = [0, 0, 0, 0]; }\n this.editor.renderer.setScrollMargin(margins[0], margins[1], margins[2], margins[3]);\n };\n ReactAce.prototype.componentWillUnmount = function () {\n if (this.editor) {\n this.editor.destroy();\n this.editor = null;\n }\n };\n ReactAce.prototype.onChange = function (event) {\n if (this.props.onChange && !this.silent) {\n var value = this.editor.getValue();\n this.props.onChange(value, event);\n }\n };\n ReactAce.prototype.onSelectionChange = function (event) {\n if (this.props.onSelectionChange) {\n var value = this.editor.getSelection();\n this.props.onSelectionChange(value, event);\n }\n };\n ReactAce.prototype.onCursorChange = function (event) {\n if (this.props.onCursorChange) {\n var value = this.editor.getSelection();\n this.props.onCursorChange(value, event);\n }\n };\n ReactAce.prototype.onInput = function (event) {\n if (this.props.onInput) {\n this.props.onInput(event);\n }\n if (this.props.placeholder) {\n this.updatePlaceholder();\n }\n };\n ReactAce.prototype.onFocus = function (event) {\n if (this.props.onFocus) {\n this.props.onFocus(event, this.editor);\n }\n };\n ReactAce.prototype.onBlur = function (event) {\n if (this.props.onBlur) {\n this.props.onBlur(event, this.editor);\n }\n };\n ReactAce.prototype.onCopy = function (_a) {\n var text = _a.text;\n if (this.props.onCopy) {\n this.props.onCopy(text);\n }\n };\n ReactAce.prototype.onPaste = function (_a) {\n var text = _a.text;\n if (this.props.onPaste) {\n this.props.onPaste(text);\n }\n };\n ReactAce.prototype.onScroll = function () {\n if (this.props.onScroll) {\n this.props.onScroll(this.editor);\n }\n };\n ReactAce.prototype.handleOptions = function (props) {\n var setOptions = Object.keys(props.setOptions);\n for (var y = 0; y < setOptions.length; y++) {\n // @ts-ignore\n this.editor.setOption(setOptions[y], props.setOptions[setOptions[y]]);\n }\n };\n ReactAce.prototype.handleMarkers = function (markers) {\n var _this = this;\n // remove foreground markers\n var currentMarkers = this.editor.getSession().getMarkers(true);\n for (var i in currentMarkers) {\n if (currentMarkers.hasOwnProperty(i)) {\n this.editor.getSession().removeMarker(currentMarkers[i].id);\n }\n }\n // remove background markers except active line marker and selected word marker\n currentMarkers = this.editor.getSession().getMarkers(false);\n for (var i in currentMarkers) {\n if (currentMarkers.hasOwnProperty(i) &&\n currentMarkers[i].clazz !== \"ace_active-line\" &&\n currentMarkers[i].clazz !== \"ace_selected-word\") {\n this.editor.getSession().removeMarker(currentMarkers[i].id);\n }\n }\n // add new markers\n markers.forEach(function (_a) {\n var startRow = _a.startRow, startCol = _a.startCol, endRow = _a.endRow, endCol = _a.endCol, className = _a.className, type = _a.type, _b = _a.inFront, inFront = _b === void 0 ? false : _b;\n var range = new ace_builds_1.Range(startRow, startCol, endRow, endCol);\n _this.editor.getSession().addMarker(range, className, type, inFront);\n });\n };\n ReactAce.prototype.updatePlaceholder = function () {\n // Adapted from https://stackoverflow.com/questions/26695708/how-can-i-add-placeholder-text-when-the-editor-is-empty\n var editor = this.editor;\n var placeholder = this.props.placeholder;\n var showPlaceholder = !editor.session.getValue().length;\n var node = editor.renderer.placeholderNode;\n if (!showPlaceholder && node) {\n editor.renderer.scroller.removeChild(editor.renderer.placeholderNode);\n editor.renderer.placeholderNode = null;\n }\n else if (showPlaceholder && !node) {\n node = editor.renderer.placeholderNode = document.createElement(\"div\");\n node.textContent = placeholder || \"\";\n node.className = \"ace_comment ace_placeholder\";\n node.style.padding = \"0 9px\";\n node.style.position = \"absolute\";\n node.style.zIndex = \"3\";\n editor.renderer.scroller.appendChild(node);\n }\n else if (showPlaceholder && node) {\n node.textContent = placeholder;\n }\n };\n ReactAce.prototype.updateRef = function (item) {\n this.refEditor = item;\n };\n ReactAce.prototype.render = function () {\n var _a = this.props, name = _a.name, width = _a.width, height = _a.height, style = _a.style;\n var divStyle = __assign({ width: width, height: height }, style);\n return React.createElement(\"div\", { ref: this.updateRef, id: name, style: divStyle });\n };\n ReactAce.propTypes = {\n mode: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n focus: PropTypes.bool,\n theme: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n height: PropTypes.string,\n width: PropTypes.string,\n fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n lineHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n showGutter: PropTypes.bool,\n onChange: PropTypes.func,\n onCopy: PropTypes.func,\n onPaste: PropTypes.func,\n onFocus: PropTypes.func,\n onInput: PropTypes.func,\n onBlur: PropTypes.func,\n onScroll: PropTypes.func,\n value: PropTypes.string,\n defaultValue: PropTypes.string,\n onLoad: PropTypes.func,\n onSelectionChange: PropTypes.func,\n onCursorChange: PropTypes.func,\n onBeforeLoad: PropTypes.func,\n onValidate: PropTypes.func,\n minLines: PropTypes.number,\n maxLines: PropTypes.number,\n readOnly: PropTypes.bool,\n highlightActiveLine: PropTypes.bool,\n tabSize: PropTypes.number,\n showPrintMargin: PropTypes.bool,\n cursorStart: PropTypes.number,\n debounceChangePeriod: PropTypes.number,\n editorProps: PropTypes.object,\n setOptions: PropTypes.object,\n style: PropTypes.object,\n scrollMargin: PropTypes.array,\n annotations: PropTypes.array,\n markers: PropTypes.array,\n keyboardHandler: PropTypes.string,\n wrapEnabled: PropTypes.bool,\n enableSnippets: PropTypes.bool,\n enableBasicAutocompletion: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.array\n ]),\n enableLiveAutocompletion: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.array\n ]),\n navigateToFileEnd: PropTypes.bool,\n commands: PropTypes.array,\n placeholder: PropTypes.string\n };\n ReactAce.defaultProps = {\n name: \"ace-editor\",\n focus: false,\n mode: \"\",\n theme: \"\",\n height: \"500px\",\n width: \"500px\",\n fontSize: 12,\n enableSnippets: false,\n showGutter: true,\n onChange: null,\n onPaste: null,\n onLoad: null,\n onScroll: null,\n minLines: null,\n maxLines: null,\n readOnly: false,\n highlightActiveLine: true,\n showPrintMargin: true,\n tabSize: 4,\n cursorStart: 1,\n editorProps: {},\n style: {},\n scrollMargin: [0, 0, 0, 0],\n setOptions: {},\n wrapEnabled: false,\n enableBasicAutocompletion: false,\n enableLiveAutocompletion: false,\n placeholder: null,\n navigateToFileEnd: true\n };\n return ReactAce;\n}(React.Component));\nexports[\"default\"] = ReactAce;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvcmVhY3QtYWNlL2xpYi9hY2UuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDRHQUF3QztBQUV4Qyw0RkFBd0M7QUFDeEMsOEVBQStCO0FBQy9CLElBQU0sT0FBTyxHQUFHLG1CQUFPLENBQUMsOERBQWdCLENBQUMsQ0FBQztBQUMxQyxrSEFLeUI7QUFDekIsSUFBTSxHQUFHLEdBQUcsa0NBQWMsR0FBRSxDQUFDO0FBaUU3QjtJQUFzQyw0QkFBZ0M7SUEyRnBFLGtCQUFZLEtBQXNCO1FBQ2hDLGtCQUFLLFlBQUMsS0FBSyxDQUFDLFNBQUM7UUFDYiw0QkFBWSxDQUFDLE9BQU8sQ0FBQyxnQkFBTTtZQUN6QixLQUFJLENBQUMsTUFBTSxDQUFDLEdBQUcsS0FBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLElBQUksQ0FBQyxLQUFJLENBQUMsQ0FBQztRQUN6QyxDQUFDLENBQUMsQ0FBQztRQUNILEtBQUksQ0FBQyxRQUFRLEdBQUcsd0JBQVEsQ0FBQzs7SUFDM0IsQ0FBQztJQUNNLDZCQUFVLEdBQWpCLFVBQWtCLElBQWlCO1FBQ2pDLElBQUksTUFBTSxHQUFHLElBQUksSUFBSSxJQUFJLENBQUMsVUFBVSxDQUFDO1FBQ3JDLE9BQU8sTUFBTSxFQUFFLENBQUM7WUFDZCxJQUFJLE1BQU0sQ0FBQyxRQUFRLEVBQUUsS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yb2xsZXIuYXBwZW5kQ2hpbGQobm9kZSk7XG4gICAgfSBlbHNlIGlmIChzaG93UGxhY2Vob2xkZXIgJiYgbm9kZSkge1xuICAgICAgbm9kZS50ZXh0Q29udGVudCA9IHBsYWNlaG9sZGVyO1xuICAgIH1cbiAgfVxuXG4gIHB1YmxpYyB1cGRhdGVSZWYoaXRlbTogSFRNTEVsZW1lbnQpIHtcbiAgICB0aGlzLnJlZkVkaXRvciA9IGl0ZW07XG4gIH1cblxuICBwdWJsaWMgcmVuZGVyKCkge1xuICAgIGNvbnN0IHsgbmFtZSwgd2lkdGgsIGhlaWdodCwgc3R5bGUgfSA9IHRoaXMucHJvcHM7XG4gICAgY29uc3QgZGl2U3R5bGUgPSB7IHdpZHRoLCBoZWlnaHQsIC4uLnN0eWxlIH07XG4gICAgcmV0dXJuIDxkaXYgcmVmPXt0aGlzLnVwZGF0ZVJlZn0gaWQ9e25hbWV9IHN0eWxlPXtkaXZTdHlsZX0gLz47XG4gIH1cbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/react-ace/lib/ace.js\n"); - -/***/ }), - -/***/ "./node_modules/react-ace/lib/diff.js": -/*!********************************************!*\ - !*** ./node_modules/react-ace/lib/diff.js ***! - \********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar PropTypes = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar split_1 = __webpack_require__(/*! ./split */ \"./node_modules/react-ace/lib/split.js\");\nvar DiffMatchPatch = __webpack_require__(/*! diff-match-patch */ \"./node_modules/diff-match-patch/index.js\");\nvar DiffComponent = /** @class */ (function (_super) {\n __extends(DiffComponent, _super);\n function DiffComponent(props) {\n var _this = _super.call(this, props) || this;\n _this.state = {\n value: _this.props.value\n };\n _this.onChange = _this.onChange.bind(_this);\n _this.diff = _this.diff.bind(_this);\n return _this;\n }\n DiffComponent.prototype.componentDidUpdate = function () {\n var value = this.props.value;\n if (value !== this.state.value) {\n this.setState({ value: value });\n }\n };\n DiffComponent.prototype.onChange = function (value) {\n this.setState({\n value: value\n });\n if (this.props.onChange) {\n this.props.onChange(value);\n }\n };\n DiffComponent.prototype.diff = function () {\n var dmp = new DiffMatchPatch();\n var lhString = this.state.value[0];\n var rhString = this.state.value[1];\n if (lhString.length === 0 && rhString.length === 0) {\n return [];\n }\n var diff = dmp.diff_main(lhString, rhString);\n dmp.diff_cleanupSemantic(diff);\n var diffedLines = this.generateDiffedLines(diff);\n var codeEditorSettings = this.setCodeMarkers(diffedLines);\n return codeEditorSettings;\n };\n DiffComponent.prototype.generateDiffedLines = function (diff) {\n var C = {\n DIFF_EQUAL: 0,\n DIFF_DELETE: -1,\n DIFF_INSERT: 1\n };\n var diffedLines = {\n left: [],\n right: []\n };\n var cursor = {\n left: 1,\n right: 1\n };\n diff.forEach(function (chunk) {\n var chunkType = chunk[0];\n var text = chunk[1];\n var lines = text.split(\"\\n\").length - 1;\n // diff-match-patch sometimes returns empty strings at random\n if (text.length === 0) {\n return;\n }\n var firstChar = text[0];\n var lastChar = text[text.length - 1];\n var linesToHighlight = 0;\n switch (chunkType) {\n case C.DIFF_EQUAL:\n cursor.left += lines;\n cursor.right += lines;\n break;\n case C.DIFF_DELETE:\n // If the deletion starts with a newline, push the cursor down to that line\n if (firstChar === \"\\n\") {\n cursor.left++;\n lines--;\n }\n linesToHighlight = lines;\n // If the deletion does not include a newline, highlight the same line on the right\n if (linesToHighlight === 0) {\n diffedLines.right.push({\n startLine: cursor.right,\n endLine: cursor.right\n });\n }\n // If the last character is a newline, we don't want to highlight that line\n if (lastChar === \"\\n\") {\n linesToHighlight -= 1;\n }\n diffedLines.left.push({\n startLine: cursor.left,\n endLine: cursor.left + linesToHighlight\n });\n cursor.left += lines;\n break;\n case C.DIFF_INSERT:\n // If the insertion starts with a newline, push the cursor down to that line\n if (firstChar === \"\\n\") {\n cursor.right++;\n lines--;\n }\n linesToHighlight = lines;\n // If the insertion does not include a newline, highlight the same line on the left\n if (linesToHighlight === 0) {\n diffedLines.left.push({\n startLine: cursor.left,\n endLine: cursor.left\n });\n }\n // If the last character is a newline, we don't want to highlight that line\n if (lastChar === \"\\n\") {\n linesToHighlight -= 1;\n }\n diffedLines.right.push({\n startLine: cursor.right,\n endLine: cursor.right + linesToHighlight\n });\n cursor.right += lines;\n break;\n default:\n throw new Error(\"Diff type was not defined.\");\n }\n });\n return diffedLines;\n };\n // Receives a collection of line numbers and iterates through them to highlight appropriately\n // Returns an object that tells the render() method how to display the code editors\n DiffComponent.prototype.setCodeMarkers = function (diffedLines) {\n if (diffedLines === void 0) { diffedLines = { left: [], right: [] }; }\n var codeEditorSettings = [];\n var newMarkerSet = {\n left: [],\n right: []\n };\n for (var i = 0; i < diffedLines.left.length; i++) {\n var markerObj = {\n startRow: diffedLines.left[i].startLine - 1,\n endRow: diffedLines.left[i].endLine,\n type: \"text\",\n className: \"codeMarker\"\n };\n newMarkerSet.left.push(markerObj);\n }\n for (var i = 0; i < diffedLines.right.length; i++) {\n var markerObj = {\n startRow: diffedLines.right[i].startLine - 1,\n endRow: diffedLines.right[i].endLine,\n type: \"text\",\n className: \"codeMarker\"\n };\n newMarkerSet.right.push(markerObj);\n }\n codeEditorSettings[0] = newMarkerSet.left;\n codeEditorSettings[1] = newMarkerSet.right;\n return codeEditorSettings;\n };\n DiffComponent.prototype.render = function () {\n var markers = this.diff();\n return (React.createElement(split_1.default, { name: this.props.name, className: this.props.className, focus: this.props.focus, orientation: this.props.orientation, splits: this.props.splits, mode: this.props.mode, theme: this.props.theme, height: this.props.height, width: this.props.width, fontSize: this.props.fontSize, showGutter: this.props.showGutter, onChange: this.onChange, onPaste: this.props.onPaste, onLoad: this.props.onLoad, onScroll: this.props.onScroll, minLines: this.props.minLines, maxLines: this.props.maxLines, readOnly: this.props.readOnly, highlightActiveLine: this.props.highlightActiveLine, showPrintMargin: this.props.showPrintMargin, tabSize: this.props.tabSize, cursorStart: this.props.cursorStart, editorProps: this.props.editorProps, style: this.props.style, scrollMargin: this.props.scrollMargin, setOptions: this.props.setOptions, wrapEnabled: this.props.wrapEnabled, enableBasicAutocompletion: this.props.enableBasicAutocompletion, enableLiveAutocompletion: this.props.enableLiveAutocompletion, value: this.state.value, markers: markers }));\n };\n DiffComponent.propTypes = {\n cursorStart: PropTypes.number,\n editorProps: PropTypes.object,\n enableBasicAutocompletion: PropTypes.bool,\n enableLiveAutocompletion: PropTypes.bool,\n focus: PropTypes.bool,\n fontSize: PropTypes.number,\n height: PropTypes.string,\n highlightActiveLine: PropTypes.bool,\n maxLines: PropTypes.number,\n minLines: PropTypes.number,\n mode: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n onLoad: PropTypes.func,\n onPaste: PropTypes.func,\n onScroll: PropTypes.func,\n onChange: PropTypes.func,\n orientation: PropTypes.string,\n readOnly: PropTypes.bool,\n scrollMargin: PropTypes.array,\n setOptions: PropTypes.object,\n showGutter: PropTypes.bool,\n showPrintMargin: PropTypes.bool,\n splits: PropTypes.number,\n style: PropTypes.object,\n tabSize: PropTypes.number,\n theme: PropTypes.string,\n value: PropTypes.array,\n width: PropTypes.string,\n wrapEnabled: PropTypes.bool\n };\n DiffComponent.defaultProps = {\n cursorStart: 1,\n editorProps: {},\n enableBasicAutocompletion: false,\n enableLiveAutocompletion: false,\n focus: false,\n fontSize: 12,\n height: \"500px\",\n highlightActiveLine: true,\n maxLines: null,\n minLines: null,\n mode: \"\",\n name: \"ace-editor\",\n onLoad: null,\n onScroll: null,\n onPaste: null,\n onChange: null,\n orientation: \"beside\",\n readOnly: false,\n scrollMargin: [0, 0, 0, 0],\n setOptions: {},\n showGutter: true,\n showPrintMargin: true,\n splits: 2,\n style: {},\n tabSize: 4,\n theme: \"github\",\n value: [\"\", \"\"],\n width: \"500px\",\n wrapEnabled: true\n };\n return DiffComponent;\n}(React.Component));\nexports[\"default\"] = DiffComponent;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvcmVhY3QtYWNlL2xpYi9kaWZmLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsNEZBQXdDO0FBQ3hDLDhFQUErQjtBQUMvQiwwRkFBa0M7QUFDbEMsSUFBTSxjQUFjLEdBQUcsbUJBQU8sQ0FBQyxrRUFBa0IsQ0FBQyxDQUFDO0FBd0NuRDtJQUEyQyxpQ0FHMUM7SUFpRUMsdUJBQVksS0FBdUI7UUFDakMsa0JBQUssWUFBQyxLQUFLLENBQUMsU0FBQztRQUNiLEtBQUksQ0FBQyxLQUFLLEdBQUc7WUFDWCxLQUFLLEVBQUUsS0FBSSxDQUFDLEtBQUssQ0FBQyxLQUFLO1NBQ3hCLENBQUM7UUFDRixLQUFJLENBQUMsUUFBUSxHQUFHLEtBQUksQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLEtBQUksQ0FBQyxDQUFDO1FBQ3pDLEtBQUksQ0FBQyxJQUFJLEdBQUcsS0FBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsS0FBSSxDQUFDLENBQUM7O0lBQ25DLENBQUM7SUFFTSw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AgICBoaWdobGlnaHRBY3RpdmVMaW5lPXt0aGlzLnByb3BzLmhpZ2hsaWdodEFjdGl2ZUxpbmV9XG4gICAgICAgIHNob3dQcmludE1hcmdpbj17dGhpcy5wcm9wcy5zaG93UHJpbnRNYXJnaW59XG4gICAgICAgIHRhYlNpemU9e3RoaXMucHJvcHMudGFiU2l6ZX1cbiAgICAgICAgY3Vyc29yU3RhcnQ9e3RoaXMucHJvcHMuY3Vyc29yU3RhcnR9XG4gICAgICAgIGVkaXRvclByb3BzPXt0aGlzLnByb3BzLmVkaXRvclByb3BzfVxuICAgICAgICBzdHlsZT17dGhpcy5wcm9wcy5zdHlsZX1cbiAgICAgICAgc2Nyb2xsTWFyZ2luPXt0aGlzLnByb3BzLnNjcm9sbE1hcmdpbn1cbiAgICAgICAgc2V0T3B0aW9ucz17dGhpcy5wcm9wcy5zZXRPcHRpb25zfVxuICAgICAgICB3cmFwRW5hYmxlZD17dGhpcy5wcm9wcy53cmFwRW5hYmxlZH1cbiAgICAgICAgZW5hYmxlQmFzaWNBdXRvY29tcGxldGlvbj17dGhpcy5wcm9wcy5lbmFibGVCYXNpY0F1dG9jb21wbGV0aW9ufVxuICAgICAgICBlbmFibGVMaXZlQXV0b2NvbXBsZXRpb249e3RoaXMucHJvcHMuZW5hYmxlTGl2ZUF1dG9jb21wbGV0aW9ufVxuICAgICAgICB2YWx1ZT17dGhpcy5zdGF0ZS52YWx1ZX1cbiAgICAgICAgbWFya2Vycz17bWFya2Vyc31cbiAgICAgIC8+XG4gICAgKTtcbiAgfVxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/react-ace/lib/diff.js\n"); - -/***/ }), - -/***/ "./node_modules/react-ace/lib/editorOptions.js": -/*!*****************************************************!*\ - !*** ./node_modules/react-ace/lib/editorOptions.js ***! - \*****************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getAceInstance = exports.debounce = exports.editorEvents = exports.editorOptions = void 0;\nvar editorOptions = [\n \"minLines\",\n \"maxLines\",\n \"readOnly\",\n \"highlightActiveLine\",\n \"tabSize\",\n \"enableBasicAutocompletion\",\n \"enableLiveAutocompletion\",\n \"enableSnippets\"\n];\nexports.editorOptions = editorOptions;\nvar editorEvents = [\n \"onChange\",\n \"onFocus\",\n \"onInput\",\n \"onBlur\",\n \"onCopy\",\n \"onPaste\",\n \"onSelectionChange\",\n \"onCursorChange\",\n \"onScroll\",\n \"handleOptions\",\n \"updateRef\"\n];\nexports.editorEvents = editorEvents;\nvar getAceInstance = function () {\n var ace;\n if (typeof window === \"undefined\") {\n // ace-builds just needs some window object to attach ace to.\n // During SSR even just an empty object will work.\n __webpack_require__.g.window = {};\n ace = __webpack_require__(/*! ace-builds */ \"./node_modules/ace-builds/src-noconflict/ace.js\");\n // And it can be discarded immediately afterward to avoid confusing\n // other libraries that might detect SSR the same way we did.\n delete __webpack_require__.g.window;\n }\n else if (window.ace) {\n // Fallback for ace.require when vanilla ACE is hosted over a CDN\n ace = window.ace;\n ace.acequire = window.ace.require || window.ace.acequire;\n }\n else {\n ace = __webpack_require__(/*! ace-builds */ \"./node_modules/ace-builds/src-noconflict/ace.js\");\n }\n return ace;\n};\nexports.getAceInstance = getAceInstance;\nvar debounce = function (fn, delay) {\n var timer = null;\n // tslint:disable-next-line\n return function () {\n var context = this;\n var args = arguments;\n clearTimeout(timer);\n timer = setTimeout(function () {\n fn.apply(context, args);\n }, delay);\n };\n};\nexports.debounce = debounce;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvcmVhY3QtYWNlL2xpYi9lZGl0b3JPcHRpb25zLmpzIiwibWFwcGluZ3MiOiI7OztBQVlBLElBQU0sYUFBYSxHQUFtQjtJQUNwQyxVQUFVO0lBQ1YsVUF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0dXJuIGFjZTtcbn07XG5cbmNvbnN0IGRlYm91bmNlID0gKGZuOiAoLi4uYXJnczogYW55W10pID0+IHZvaWQsIGRlbGF5OiBudW1iZXIpID0+IHtcbiAgbGV0IHRpbWVyOiBhbnkgPSBudWxsO1xuICAvLyB0c2xpbnQ6ZGlzYWJsZS1uZXh0LWxpbmVcbiAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICBjb25zdCBjb250ZXh0ID0gdGhpcztcbiAgICBjb25zdCBhcmdzID0gYXJndW1lbnRzO1xuICAgIGNsZWFyVGltZW91dCh0aW1lcik7XG4gICAgdGltZXIgPSBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgIGZuLmFwcGx5KGNvbnRleHQsIGFyZ3MpO1xuICAgIH0sIGRlbGF5KTtcbiAgfTtcbn07XG5leHBvcnQgeyBlZGl0b3JPcHRpb25zLCBlZGl0b3JFdmVudHMsIGRlYm91bmNlLCBnZXRBY2VJbnN0YW5jZSB9O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/react-ace/lib/editorOptions.js\n"); - -/***/ }), - -/***/ "./node_modules/react-ace/lib/index.js": -/*!*********************************************!*\ - !*** ./node_modules/react-ace/lib/index.js ***! - \*********************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.diff = exports.split = void 0;\nvar ace_1 = __webpack_require__(/*! ./ace */ \"./node_modules/react-ace/lib/ace.js\");\nvar diff_1 = __webpack_require__(/*! ./diff */ \"./node_modules/react-ace/lib/diff.js\");\nexports.diff = diff_1.default;\nvar split_1 = __webpack_require__(/*! ./split */ \"./node_modules/react-ace/lib/split.js\");\nexports.split = split_1.default;\nexports[\"default\"] = ace_1.default;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi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cHNcbn07XG5leHBvcnQgZGVmYXVsdCBhY2U7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/react-ace/lib/index.js\n"); - -/***/ }), - -/***/ "./node_modules/react-ace/lib/split.js": -/*!*********************************************!*\ - !*** ./node_modules/react-ace/lib/split.js ***! - \*********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar editorOptions_1 = __webpack_require__(/*! ./editorOptions */ \"./node_modules/react-ace/lib/editorOptions.js\");\nvar ace = (0, editorOptions_1.getAceInstance)();\nvar ace_builds_1 = __webpack_require__(/*! ace-builds */ \"./node_modules/ace-builds/src-noconflict/ace.js\");\nvar ext_split_1 = __webpack_require__(/*! ace-builds/src-noconflict/ext-split */ \"./node_modules/ace-builds/src-noconflict/ext-split.js\");\nvar PropTypes = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar isEqual = __webpack_require__(/*! lodash.isequal */ \"./node_modules/lodash.isequal/index.js\");\nvar get = __webpack_require__(/*! lodash.get */ \"./node_modules/lodash.get/index.js\");\nvar SplitComponent = /** @class */ (function (_super) {\n __extends(SplitComponent, _super);\n function SplitComponent(props) {\n var _this = _super.call(this, props) || this;\n editorOptions_1.editorEvents.forEach(function (method) {\n _this[method] = _this[method].bind(_this);\n });\n _this.debounce = editorOptions_1.debounce;\n return _this;\n }\n SplitComponent.prototype.isInShadow = function (node) {\n var parent = node && node.parentNode;\n while (parent) {\n if (parent.toString() === \"[object ShadowRoot]\") {\n return true;\n }\n parent = parent.parentNode;\n }\n return false;\n };\n SplitComponent.prototype.componentDidMount = function () {\n var _this = this;\n var _a = this.props, className = _a.className, onBeforeLoad = _a.onBeforeLoad, mode = _a.mode, focus = _a.focus, theme = _a.theme, fontSize = _a.fontSize, value = _a.value, defaultValue = _a.defaultValue, cursorStart = _a.cursorStart, showGutter = _a.showGutter, wrapEnabled = _a.wrapEnabled, showPrintMargin = _a.showPrintMargin, _b = _a.scrollMargin, scrollMargin = _b === void 0 ? [0, 0, 0, 0] : _b, keyboardHandler = _a.keyboardHandler, onLoad = _a.onLoad, commands = _a.commands, annotations = _a.annotations, markers = _a.markers, splits = _a.splits;\n this.editor = ace.edit(this.refEditor);\n if (this.isInShadow(this.refEditor)) {\n this.editor.renderer.attachToShadowRoot();\n }\n this.editor.setTheme(\"ace/theme/\".concat(theme));\n if (onBeforeLoad) {\n onBeforeLoad(ace);\n }\n var editorProps = Object.keys(this.props.editorProps);\n var split = new ext_split_1.Split(this.editor.container, \"ace/theme/\".concat(theme), splits);\n this.editor.env.split = split;\n this.splitEditor = split.getEditor(0);\n this.split = split;\n // in a split scenario we don't want a print margin for the entire application\n this.editor.setShowPrintMargin(false);\n this.editor.renderer.setShowGutter(false);\n // get a list of possible options to avoid 'misspelled option errors'\n var availableOptions = this.splitEditor.$options;\n if (this.props.debounceChangePeriod) {\n this.onChange = this.debounce(this.onChange, this.props.debounceChangePeriod);\n }\n split.forEach(function (editor, index) {\n for (var i = 0; i < editorProps.length; i++) {\n editor[editorProps[i]] = _this.props.editorProps[editorProps[i]];\n }\n var defaultValueForEditor = get(defaultValue, index);\n var valueForEditor = get(value, index, \"\");\n editor.session.setUndoManager(new ace.UndoManager());\n editor.setTheme(\"ace/theme/\".concat(theme));\n editor.renderer.setScrollMargin(scrollMargin[0], scrollMargin[1], scrollMargin[2], scrollMargin[3]);\n editor.getSession().setMode(\"ace/mode/\".concat(mode));\n editor.setFontSize(fontSize);\n editor.renderer.setShowGutter(showGutter);\n editor.getSession().setUseWrapMode(wrapEnabled);\n editor.setShowPrintMargin(showPrintMargin);\n editor.on(\"focus\", _this.onFocus);\n editor.on(\"blur\", _this.onBlur);\n editor.on(\"input\", _this.onInput);\n editor.on(\"copy\", _this.onCopy);\n editor.on(\"paste\", _this.onPaste);\n editor.on(\"change\", _this.onChange);\n editor\n .getSession()\n .selection.on(\"changeSelection\", _this.onSelectionChange);\n editor.getSession().selection.on(\"changeCursor\", _this.onCursorChange);\n editor.session.on(\"changeScrollTop\", _this.onScroll);\n editor.setValue(defaultValueForEditor === undefined\n ? valueForEditor\n : defaultValueForEditor, cursorStart);\n var newAnnotations = get(annotations, index, []);\n var newMarkers = get(markers, index, []);\n editor.getSession().setAnnotations(newAnnotations);\n if (newMarkers && newMarkers.length > 0) {\n _this.handleMarkers(newMarkers, editor);\n }\n for (var i = 0; i < editorOptions_1.editorOptions.length; i++) {\n var option = editorOptions_1.editorOptions[i];\n if (availableOptions.hasOwnProperty(option)) {\n editor.setOption(option, _this.props[option]);\n }\n else if (_this.props[option]) {\n console.warn(\"ReaceAce: editor option \".concat(option, \" was activated but not found. Did you need to import a related tool or did you possibly mispell the option?\"));\n }\n }\n _this.handleOptions(_this.props, editor);\n if (Array.isArray(commands)) {\n commands.forEach(function (command) {\n if (typeof command.exec === \"string\") {\n editor.commands.bindKey(command.bindKey, command.exec);\n }\n else {\n editor.commands.addCommand(command);\n }\n });\n }\n if (keyboardHandler) {\n editor.setKeyboardHandler(\"ace/keyboard/\" + keyboardHandler);\n }\n });\n if (className) {\n this.refEditor.className += \" \" + className;\n }\n if (focus) {\n this.splitEditor.focus();\n }\n var sp = this.editor.env.split;\n sp.setOrientation(this.props.orientation === \"below\" ? sp.BELOW : sp.BESIDE);\n sp.resize(true);\n if (onLoad) {\n onLoad(sp);\n }\n };\n SplitComponent.prototype.componentDidUpdate = function (prevProps) {\n var _this = this;\n var oldProps = prevProps;\n var nextProps = this.props;\n var split = this.editor.env.split;\n if (nextProps.splits !== oldProps.splits) {\n split.setSplits(nextProps.splits);\n }\n if (nextProps.orientation !== oldProps.orientation) {\n split.setOrientation(nextProps.orientation === \"below\" ? split.BELOW : split.BESIDE);\n }\n split.forEach(function (editor, index) {\n if (nextProps.mode !== oldProps.mode) {\n editor.getSession().setMode(\"ace/mode/\" + nextProps.mode);\n }\n if (nextProps.keyboardHandler !== oldProps.keyboardHandler) {\n if (nextProps.keyboardHandler) {\n editor.setKeyboardHandler(\"ace/keyboard/\" + nextProps.keyboardHandler);\n }\n else {\n editor.setKeyboardHandler(null);\n }\n }\n if (nextProps.fontSize !== oldProps.fontSize) {\n editor.setFontSize(nextProps.fontSize);\n }\n if (nextProps.wrapEnabled !== oldProps.wrapEnabled) {\n editor.getSession().setUseWrapMode(nextProps.wrapEnabled);\n }\n if (nextProps.showPrintMargin !== oldProps.showPrintMargin) {\n editor.setShowPrintMargin(nextProps.showPrintMargin);\n }\n if (nextProps.showGutter !== oldProps.showGutter) {\n editor.renderer.setShowGutter(nextProps.showGutter);\n }\n for (var i = 0; i < editorOptions_1.editorOptions.length; i++) {\n var option = editorOptions_1.editorOptions[i];\n if (nextProps[option] !== oldProps[option]) {\n editor.setOption(option, nextProps[option]);\n }\n }\n if (!isEqual(nextProps.setOptions, oldProps.setOptions)) {\n _this.handleOptions(nextProps, editor);\n }\n var nextValue = get(nextProps.value, index, \"\");\n if (editor.getValue() !== nextValue) {\n // editor.setValue is a synchronous function call, change event is emitted before setValue return.\n _this.silent = true;\n var pos = editor.session.selection.toJSON();\n editor.setValue(nextValue, nextProps.cursorStart);\n editor.session.selection.fromJSON(pos);\n _this.silent = false;\n }\n var newAnnotations = get(nextProps.annotations, index, []);\n var oldAnnotations = get(oldProps.annotations, index, []);\n if (!isEqual(newAnnotations, oldAnnotations)) {\n editor.getSession().setAnnotations(newAnnotations);\n }\n var newMarkers = get(nextProps.markers, index, []);\n var oldMarkers = get(oldProps.markers, index, []);\n if (!isEqual(newMarkers, oldMarkers) && Array.isArray(newMarkers)) {\n _this.handleMarkers(newMarkers, editor);\n }\n });\n if (nextProps.className !== oldProps.className) {\n var appliedClasses = this.refEditor.className;\n var appliedClassesArray_1 = appliedClasses.trim().split(\" \");\n var oldClassesArray = oldProps.className.trim().split(\" \");\n oldClassesArray.forEach(function (oldClass) {\n var index = appliedClassesArray_1.indexOf(oldClass);\n appliedClassesArray_1.splice(index, 1);\n });\n this.refEditor.className =\n \" \" + nextProps.className + \" \" + appliedClassesArray_1.join(\" \");\n }\n if (nextProps.theme !== oldProps.theme) {\n split.setTheme(\"ace/theme/\" + nextProps.theme);\n }\n if (nextProps.focus && !oldProps.focus) {\n this.splitEditor.focus();\n }\n if (nextProps.height !== this.props.height ||\n nextProps.width !== this.props.width) {\n this.editor.resize();\n }\n };\n SplitComponent.prototype.componentWillUnmount = function () {\n this.editor.destroy();\n this.editor = null;\n };\n SplitComponent.prototype.onChange = function (event) {\n if (this.props.onChange && !this.silent) {\n var value_1 = [];\n this.editor.env.split.forEach(function (editor) {\n value_1.push(editor.getValue());\n });\n this.props.onChange(value_1, event);\n }\n };\n SplitComponent.prototype.onSelectionChange = function (event) {\n if (this.props.onSelectionChange) {\n var value_2 = [];\n this.editor.env.split.forEach(function (editor) {\n value_2.push(editor.getSelection());\n });\n this.props.onSelectionChange(value_2, event);\n }\n };\n SplitComponent.prototype.onCursorChange = function (event) {\n if (this.props.onCursorChange) {\n var value_3 = [];\n this.editor.env.split.forEach(function (editor) {\n value_3.push(editor.getSelection());\n });\n this.props.onCursorChange(value_3, event);\n }\n };\n SplitComponent.prototype.onFocus = function (event) {\n if (this.props.onFocus) {\n this.props.onFocus(event);\n }\n };\n SplitComponent.prototype.onInput = function (event) {\n if (this.props.onInput) {\n this.props.onInput(event);\n }\n };\n SplitComponent.prototype.onBlur = function (event) {\n if (this.props.onBlur) {\n this.props.onBlur(event);\n }\n };\n SplitComponent.prototype.onCopy = function (text) {\n if (this.props.onCopy) {\n this.props.onCopy(text);\n }\n };\n SplitComponent.prototype.onPaste = function (text) {\n if (this.props.onPaste) {\n this.props.onPaste(text);\n }\n };\n SplitComponent.prototype.onScroll = function () {\n if (this.props.onScroll) {\n this.props.onScroll(this.editor);\n }\n };\n SplitComponent.prototype.handleOptions = function (props, editor) {\n var setOptions = Object.keys(props.setOptions);\n for (var y = 0; y < setOptions.length; y++) {\n editor.setOption(setOptions[y], props.setOptions[setOptions[y]]);\n }\n };\n SplitComponent.prototype.handleMarkers = function (markers, editor) {\n // remove foreground markers\n var currentMarkers = editor.getSession().getMarkers(true);\n for (var i in currentMarkers) {\n if (currentMarkers.hasOwnProperty(i)) {\n editor.getSession().removeMarker(currentMarkers[i].id);\n }\n }\n // remove background markers\n currentMarkers = editor.getSession().getMarkers(false);\n for (var i in currentMarkers) {\n if (currentMarkers.hasOwnProperty(i)) {\n editor.getSession().removeMarker(currentMarkers[i].id);\n }\n }\n // add new markers\n markers.forEach(function (_a) {\n var startRow = _a.startRow, startCol = _a.startCol, endRow = _a.endRow, endCol = _a.endCol, className = _a.className, type = _a.type, _b = _a.inFront, inFront = _b === void 0 ? false : _b;\n var range = new ace_builds_1.Range(startRow, startCol, endRow, endCol);\n editor\n .getSession()\n .addMarker(range, className, type, inFront);\n });\n };\n SplitComponent.prototype.updateRef = function (item) {\n this.refEditor = item;\n };\n SplitComponent.prototype.render = function () {\n var _a = this.props, name = _a.name, width = _a.width, height = _a.height, style = _a.style;\n var divStyle = __assign({ width: width, height: height }, style);\n return React.createElement(\"div\", { ref: this.updateRef, id: name, style: divStyle });\n };\n SplitComponent.propTypes = {\n className: PropTypes.string,\n debounceChangePeriod: PropTypes.number,\n defaultValue: PropTypes.arrayOf(PropTypes.string),\n focus: PropTypes.bool,\n fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n height: PropTypes.string,\n mode: PropTypes.string,\n name: PropTypes.string,\n onBlur: PropTypes.func,\n onChange: PropTypes.func,\n onCopy: PropTypes.func,\n onFocus: PropTypes.func,\n onInput: PropTypes.func,\n onLoad: PropTypes.func,\n onPaste: PropTypes.func,\n onScroll: PropTypes.func,\n orientation: PropTypes.string,\n showGutter: PropTypes.bool,\n splits: PropTypes.number,\n theme: PropTypes.string,\n value: PropTypes.arrayOf(PropTypes.string),\n width: PropTypes.string,\n onSelectionChange: PropTypes.func,\n onCursorChange: PropTypes.func,\n onBeforeLoad: PropTypes.func,\n minLines: PropTypes.number,\n maxLines: PropTypes.number,\n readOnly: PropTypes.bool,\n highlightActiveLine: PropTypes.bool,\n tabSize: PropTypes.number,\n showPrintMargin: PropTypes.bool,\n cursorStart: PropTypes.number,\n editorProps: PropTypes.object,\n setOptions: PropTypes.object,\n style: PropTypes.object,\n scrollMargin: PropTypes.array,\n annotations: PropTypes.array,\n markers: PropTypes.array,\n keyboardHandler: PropTypes.string,\n wrapEnabled: PropTypes.bool,\n enableBasicAutocompletion: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.array\n ]),\n enableLiveAutocompletion: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.array\n ]),\n commands: PropTypes.array\n };\n SplitComponent.defaultProps = {\n name: \"ace-editor\",\n focus: false,\n orientation: \"beside\",\n splits: 2,\n mode: \"\",\n theme: \"\",\n height: \"500px\",\n width: \"500px\",\n value: [],\n fontSize: 12,\n showGutter: true,\n onChange: null,\n onPaste: null,\n onLoad: null,\n onScroll: null,\n minLines: null,\n maxLines: null,\n readOnly: false,\n highlightActiveLine: true,\n showPrintMargin: true,\n tabSize: 4,\n cursorStart: 1,\n editorProps: {},\n style: {},\n scrollMargin: [0, 0, 0, 0],\n setOptions: {},\n wrapEnabled: false,\n enableBasicAutocompletion: false,\n enableLiveAutocompletion: false\n };\n return SplitComponent;\n}(React.Component));\nexports[\"default\"] = SplitComponent;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvcmVhY3QtYWNlL2xpYi9zcGxpdC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsa0hBS3lCO0FBQ3pCLElBQU0sR0FBRyxHQUFHLGtDQUFjLEdBQUUsQ0FBQztBQUM3Qiw0R0FBd0M7QUFDeEMsMElBQTREO0FBQzVELDRGQUF3QztBQUN4Qyw4RUFBK0I7QUFDL0IsSUFBTSxPQUFPLEdBQUcsbUJBQU8sQ0FBQyw4REFBZ0IsQ0FBQyxDQUFDO0FBQzFDLElBQU0sR0FBRyxHQUFHLG1CQUFPLENBQUMsc0RBQVksQ0FBQyxDQUFDO0FBaUVsQztJQUE0QyxrQ0FBa0M7SUEyRjVFLHdCQUFZLEtBQXdCO1FBQ2xDLGtCQUFLLFlBQUMsS0FBSyxDQUFDLFNBQUM7UUFDYiw0QkFBWSxDQUFDLE9BQU8sQ0FBQyxnQkFBTTtZQUN6QixLQUFJLENBQUMsTUFBTSxDQUFDLEdBQUcsS0FBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLElBQUksQ0FBQyxLQUFJLENBQUMsQ0FBQztRQUN6QyxDQUFDLENBQUMsQ0FBQztRQUNILEtBQUksQ0FBQyxRQUFRLEdBQUcsd0JBQVEsQ0FBQzs7SUFDM0IsQ0FBQztJQUNNLG1DQUFVLEdBQWpCLFVBQWtCLElBQWlCO1FBQ2pDLElBQUksTUFBTSxHQUFHLElBQUksSUFBSSx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tcbiAgICAgICAgZWRpdG9yXG4gICAgICAgICAgLmdldFNlc3Npb24oKVxuICAgICAgICAgIC5hZGRNYXJrZXIocmFuZ2UgYXMgYW55LCBjbGFzc05hbWUsIHR5cGUgYXMgYW55LCBpbkZyb250KTtcbiAgICAgIH1cbiAgICApO1xuICB9XG5cbiAgcHVibGljIHVwZGF0ZVJlZihpdGVtOiBIVE1MRWxlbWVudCkge1xuICAgIHRoaXMucmVmRWRpdG9yID0gaXRlbTtcbiAgfVxuXG4gIHB1YmxpYyByZW5kZXIoKSB7XG4gICAgY29uc3QgeyBuYW1lLCB3aWR0aCwgaGVpZ2h0LCBzdHlsZSB9ID0gdGhpcy5wcm9wcztcbiAgICBjb25zdCBkaXZTdHlsZSA9IHsgd2lkdGgsIGhlaWdodCwgLi4uc3R5bGUgfTtcbiAgICByZXR1cm4gPGRpdiByZWY9e3RoaXMudXBkYXRlUmVmfSBpZD17bmFtZX0gc3R5bGU9e2RpdlN0eWxlfSAvPjtcbiAgfVxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/react-ace/lib/split.js\n"); - -/***/ }), - /***/ "./node_modules/react-day-picker/dist/index.esm.js": /*!*********************************************************!*\ !*** ./node_modules/react-day-picker/dist/index.esm.js ***! @@ -10098,6 +9963,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ }), +/***/ "./node_modules/@monaco-editor/react/dist/index.mjs": +/*!**********************************************************!*\ + !*** ./node_modules/@monaco-editor/react/dist/index.mjs ***! + \**********************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DiffEditor: () => (/* binding */ we),\n/* harmony export */ Editor: () => (/* binding */ de),\n/* harmony export */ \"default\": () => (/* binding */ Ft),\n/* harmony export */ loader: () => (/* reexport safe */ _monaco_editor_loader__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ useMonaco: () => (/* binding */ Le)\n/* harmony export */ });\n/* harmony import */ var _monaco_editor_loader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @monaco-editor/loader */ \"./node_modules/@monaco-editor/loader/lib/es/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar le={wrapper:{display:\"flex\",position:\"relative\",textAlign:\"initial\"},fullWidth:{width:\"100%\"},hide:{display:\"none\"}},v=le;var ae={container:{display:\"flex\",height:\"100%\",width:\"100%\",justifyContent:\"center\",alignItems:\"center\"}},Y=ae;function Me({children:e}){return react__WEBPACK_IMPORTED_MODULE_1__.createElement(\"div\",{style:Y.container},e)}var Z=Me;var $=Z;function Ee({width:e,height:r,isEditorReady:n,loading:t,_ref:a,className:m,wrapperProps:E}){return react__WEBPACK_IMPORTED_MODULE_1__.createElement(\"section\",{style:{...v.wrapper,width:e,height:r},...E},!n&&react__WEBPACK_IMPORTED_MODULE_1__.createElement($,null,t),react__WEBPACK_IMPORTED_MODULE_1__.createElement(\"div\",{ref:a,style:{...v.fullWidth,...!n&&v.hide},className:m}))}var ee=Ee;var H=(0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(ee);function Ce(e){(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(e,[])}var k=Ce;function he(e,r,n=!0){let t=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!0);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(t.current||!n?()=>{t.current=!1}:e,r)}var l=he;function D(){}function h(e,r,n,t){return De(e,t)||be(e,r,n,t)}function De(e,r){return e.editor.getModel(te(e,r))}function be(e,r,n,t){return e.editor.createModel(r,n,t?te(e,t):void 0)}function te(e,r){return e.Uri.parse(r)}function Oe({original:e,modified:r,language:n,originalLanguage:t,modifiedLanguage:a,originalModelPath:m,modifiedModelPath:E,keepCurrentOriginalModel:g=!1,keepCurrentModifiedModel:N=!1,theme:x=\"light\",loading:P=\"Loading...\",options:y={},height:V=\"100%\",width:z=\"100%\",className:F,wrapperProps:j={},beforeMount:A=D,onMount:q=D}){let[M,O]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[T,s]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!0),u=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null),c=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null),w=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null),d=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(q),o=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(A),b=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1);k(()=>{let i=_monaco_editor_loader__WEBPACK_IMPORTED_MODULE_0__[\"default\"].init();return i.then(f=>(c.current=f)&&s(!1)).catch(f=>f?.type!==\"cancelation\"&&console.error(\"Monaco initialization: error:\",f)),()=>u.current?I():i.cancel()}),l(()=>{if(u.current&&c.current){let i=u.current.getOriginalEditor(),f=h(c.current,e||\"\",t||n||\"text\",m||\"\");f!==i.getModel()&&i.setModel(f)}},[m],M),l(()=>{if(u.current&&c.current){let i=u.current.getModifiedEditor(),f=h(c.current,r||\"\",a||n||\"text\",E||\"\");f!==i.getModel()&&i.setModel(f)}},[E],M),l(()=>{let i=u.current.getModifiedEditor();i.getOption(c.current.editor.EditorOption.readOnly)?i.setValue(r||\"\"):r!==i.getValue()&&(i.executeEdits(\"\",[{range:i.getModel().getFullModelRange(),text:r||\"\",forceMoveMarkers:!0}]),i.pushUndoStop())},[r],M),l(()=>{u.current?.getModel()?.original.setValue(e||\"\")},[e],M),l(()=>{let{original:i,modified:f}=u.current.getModel();c.current.editor.setModelLanguage(i,t||n||\"text\"),c.current.editor.setModelLanguage(f,a||n||\"text\")},[n,t,a],M),l(()=>{c.current?.editor.setTheme(x)},[x],M),l(()=>{u.current?.updateOptions(y)},[y],M);let L=(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{if(!c.current)return;o.current(c.current);let i=h(c.current,e||\"\",t||n||\"text\",m||\"\"),f=h(c.current,r||\"\",a||n||\"text\",E||\"\");u.current?.setModel({original:i,modified:f})},[n,r,a,e,t,m,E]),U=(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{!b.current&&w.current&&(u.current=c.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...y}),L(),c.current?.editor.setTheme(x),O(!0),b.current=!0)},[y,x,L]);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{M&&d.current(u.current,c.current)},[M]),(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{!T&&!M&&U()},[T,M,U]);function I(){let i=u.current?.getModel();g||i?.original?.dispose(),N||i?.modified?.dispose(),u.current?.dispose()}return react__WEBPACK_IMPORTED_MODULE_1__.createElement(H,{width:z,height:V,isEditorReady:M,loading:P,_ref:w,className:F,wrapperProps:j})}var ie=Oe;var we=(0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(ie);function Pe(){let[e,r]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_monaco_editor_loader__WEBPACK_IMPORTED_MODULE_0__[\"default\"].__getMonacoInstance());return k(()=>{let n;return e||(n=_monaco_editor_loader__WEBPACK_IMPORTED_MODULE_0__[\"default\"].init(),n.then(t=>{r(t)})),()=>n?.cancel()}),e}var Le=Pe;function He(e){let r=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{r.current=e},[e]),r.current}var se=He;var _=new Map;function Ve({defaultValue:e,defaultLanguage:r,defaultPath:n,value:t,language:a,path:m,theme:E=\"light\",line:g,loading:N=\"Loading...\",options:x={},overrideServices:P={},saveViewState:y=!0,keepCurrentModel:V=!1,width:z=\"100%\",height:F=\"100%\",className:j,wrapperProps:A={},beforeMount:q=D,onMount:M=D,onChange:O,onValidate:T=D}){let[s,u]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[c,w]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!0),d=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null),o=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null),b=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null),L=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(M),U=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(q),I=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(),i=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(t),f=se(m),Q=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1),B=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1);k(()=>{let p=_monaco_editor_loader__WEBPACK_IMPORTED_MODULE_0__[\"default\"].init();return p.then(R=>(d.current=R)&&w(!1)).catch(R=>R?.type!==\"cancelation\"&&console.error(\"Monaco initialization: error:\",R)),()=>o.current?pe():p.cancel()}),l(()=>{let p=h(d.current,e||t||\"\",r||a||\"\",m||n||\"\");p!==o.current?.getModel()&&(y&&_.set(f,o.current?.saveViewState()),o.current?.setModel(p),y&&o.current?.restoreViewState(_.get(m)))},[m],s),l(()=>{o.current?.updateOptions(x)},[x],s),l(()=>{!o.current||t===void 0||(o.current.getOption(d.current.editor.EditorOption.readOnly)?o.current.setValue(t):t!==o.current.getValue()&&(B.current=!0,o.current.executeEdits(\"\",[{range:o.current.getModel().getFullModelRange(),text:t,forceMoveMarkers:!0}]),o.current.pushUndoStop(),B.current=!1))},[t],s),l(()=>{let p=o.current?.getModel();p&&a&&d.current?.editor.setModelLanguage(p,a)},[a],s),l(()=>{g!==void 0&&o.current?.revealLine(g)},[g],s),l(()=>{d.current?.editor.setTheme(E)},[E],s);let X=(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{if(!(!b.current||!d.current)&&!Q.current){U.current(d.current);let p=m||n,R=h(d.current,t||e||\"\",r||a||\"\",p||\"\");o.current=d.current?.editor.create(b.current,{model:R,automaticLayout:!0,...x},P),y&&o.current.restoreViewState(_.get(p)),d.current.editor.setTheme(E),g!==void 0&&o.current.revealLine(g),u(!0),Q.current=!0}},[e,r,n,t,a,m,x,P,y,E,g]);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{s&&L.current(o.current,d.current)},[s]),(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{!c&&!s&&X()},[c,s,X]),i.current=t,(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{s&&O&&(I.current?.dispose(),I.current=o.current?.onDidChangeModelContent(p=>{B.current||O(o.current.getValue(),p)}))},[s,O]),(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{if(s){let p=d.current.editor.onDidChangeMarkers(R=>{let G=o.current.getModel()?.uri;if(G&&R.find(J=>J.path===G.path)){let J=d.current.editor.getModelMarkers({resource:G});T?.(J)}});return()=>{p?.dispose()}}return()=>{}},[s,T]);function pe(){I.current?.dispose(),V?y&&_.set(m,o.current.saveViewState()):o.current.getModel()?.dispose(),o.current.dispose()}return react__WEBPACK_IMPORTED_MODULE_1__.createElement(H,{width:z,height:F,isEditorReady:s,loading:N,_ref:b,className:j,wrapperProps:A})}var fe=Ve;var de=(0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(fe);var Ft=de;\n//# sourceMappingURL=index.mjs.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQG1vbmFjby1lZGl0b3IvcmVhY3QvZGlzdC9pbmRleC5tanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFpUCxRQUFRLFNBQVMsdURBQXVELFlBQVksYUFBYSxPQUFPLGdCQUFnQixN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/LmRpc3Bvc2UoKX19cmV0dXJuKCk9Pnt9fSxbcyxUXSk7ZnVuY3Rpb24gcGUoKXtJLmN1cnJlbnQ/LmRpc3Bvc2UoKSxWP3kmJl8uc2V0KG0sby5jdXJyZW50LnNhdmVWaWV3U3RhdGUoKSk6by5jdXJyZW50LmdldE1vZGVsKCk/LmRpc3Bvc2UoKSxvLmN1cnJlbnQuZGlzcG9zZSgpfXJldHVybiBXZS5jcmVhdGVFbGVtZW50KEgse3dpZHRoOnosaGVpZ2h0OkYsaXNFZGl0b3JSZWFkeTpzLGxvYWRpbmc6TixfcmVmOmIsY2xhc3NOYW1lOmosd3JhcHBlclByb3BzOkF9KX12YXIgZmU9VmU7dmFyIGRlPXplKGZlKTt2YXIgRnQ9ZGU7ZXhwb3J0e3dlIGFzIERpZmZFZGl0b3IsZGUgYXMgRWRpdG9yLEZ0IGFzIGRlZmF1bHQsX3QgYXMgbG9hZGVyLExlIGFzIHVzZU1vbmFjb307XG4vLyMgc291cmNlTWFwcGluZ1VSTD1pbmRleC5tanMubWFwIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/@monaco-editor/react/dist/index.mjs\n"); + +/***/ }), + /***/ "./node_modules/dot-case/node_modules/tslib/tslib.es6.mjs": /*!****************************************************************!*\ !*** ./node_modules/dot-case/node_modules/tslib/tslib.es6.mjs ***! diff --git a/www/dist-dev/static/global.css b/www/dist-dev/static/global.css index 12be740b..1c193b3b 100644 --- a/www/dist-dev/static/global.css +++ b/www/dist-dev/static/global.css @@ -28,6 +28,11 @@ body.bp5-dark { background-color: #252a31; } +code { + font-family: Consolas, Menlo, 'Roboto Mono', 'DejaVu Sans Mono'; + font-weight: 400; +} + h2 { font-size: 28px; } diff --git a/www/dist/index.html b/www/dist/index.html index 251fb003..03fa29c7 100644 --- a/www/dist/index.html +++ b/www/dist/index.html @@ -21,6 +21,6 @@
- + diff --git a/www/dist/static/app.4fc09b.js b/www/dist/static/app.4fc09b.js deleted file mode 100644 index 953f93a7..00000000 --- a/www/dist/static/app.4fc09b.js +++ /dev/null @@ -1,356 +0,0 @@ -(()=>{var e,t,n,o,r={22523:(e,t,n)=>{var o={"./_lib/buildFormatLongFn/index.js":[86273,7,36108],"./_lib/buildLocalizeFn/index.js":[53347,7,23534],"./_lib/buildMatchFn/index.js":[94461,7,46144],"./_lib/buildMatchPatternFn/index.js":[44497,7,70140],"./af/_lib/formatDistance/index.js":[72630,7,61953],"./af/_lib/formatLong/index.js":[18519,7,68288],"./af/_lib/formatRelative/index.js":[66413,7,16490],"./af/_lib/localize/index.js":[74013,7,50722],"./af/_lib/match/index.js":[82691,7,73868],"./af/index.js":[3128,7,27435],"./ar-DZ/_lib/formatDistance/index.js":[9879,7,54212],"./ar-DZ/_lib/formatLong/index.js":[12850,7,33185],"./ar-DZ/_lib/formatRelative/index.js":[44968,7,41699],"./ar-DZ/_lib/localize/index.js":[88856,7,3035],"./ar-DZ/_lib/match/index.js":[77696,7,23391],"./ar-DZ/index.js":[31629,7,89854],"./ar-EG/_lib/formatDistance/index.js":[1853,7,10970],"./ar-EG/_lib/formatLong/index.js":[83288,7,97559],"./ar-EG/_lib/formatRelative/index.js":[15226,7,98421],"./ar-EG/_lib/localize/index.js":[19938,7,11469],"./ar-EG/_lib/match/index.js":[65254,7,11053],"./ar-EG/index.js":[54347,7,98260],"./ar-MA/_lib/formatDistance/index.js":[31507,7,48100],"./ar-MA/_lib/formatLong/index.js":[66494,7,9921],"./ar-MA/_lib/formatRelative/index.js":[8620,7,11843],"./ar-MA/_lib/localize/index.js":[40980,7,80347],"./ar-MA/_lib/match/index.js":[28212,7,39615],"./ar-MA/index.js":[80217,7,26270],"./ar-SA/_lib/formatDistance/index.js":[27977,7,24822],"./ar-SA/_lib/formatLong/index.js":[12356,7,81283],"./ar-SA/_lib/formatRelative/index.js":[88014,7,78889],"./ar-SA/_lib/localize/index.js":[23502,7,42489],"./ar-SA/_lib/match/index.js":[75498,7,35681],"./ar-SA/index.js":[83719,7,9200],"./ar-TN/_lib/formatDistance/index.js":[90747,7,51504],"./ar-TN/_lib/formatLong/index.js":[85974,7,61021],"./ar-TN/_lib/formatRelative/index.js":[52084,7,31479],"./ar-TN/_lib/localize/index.js":[13868,7,29383],"./ar-TN/_lib/match/index.js":[72492,7,35875],"./ar-TN/index.js":[91761,7,12314],"./ar/_lib/formatDistance/index.js":[51570,7,79181],"./ar/_lib/formatLong/index.js":[30243,7,2732],"./ar/_lib/formatRelative/index.js":[28625,7,27886],"./ar/_lib/localize/index.js":[34521,7,79614],"./ar/_lib/match/index.js":[23895,7,29040],"./ar/index.js":[95860,7,47559],"./az/_lib/formatDistance/index.js":[31450,7,66453],"./az/_lib/formatLong/index.js":[50843,7,62340],"./az/_lib/formatRelative/index.js":[38841,7,79734],"./az/_lib/localize/index.js":[25457,7,66550],"./az/_lib/match/index.js":[2863,7,71368],"./az/index.js":[21676,7,27071],"./be-tarask/_lib/formatDistance/index.js":[98655,7,96100],"./be-tarask/_lib/formatLong/index.js":[82282,7,34625],"./be-tarask/_lib/formatRelative/index.js":[9968,7,86313,3363],"./be-tarask/_lib/localize/index.js":[92080,7,99291],"./be-tarask/_lib/match/index.js":[2040,7,65023],"./be-tarask/index.js":[60165,7,86313,6302],"./be/_lib/formatDistance/index.js":[28276,7,9599],"./be/_lib/formatLong/index.js":[47749,7,63646],"./be/_lib/formatRelative/index.js":[12839,7,86313,50484],"./be/_lib/localize/index.js":[49255,7,36596],"./be/_lib/match/index.js":[24905,7,39482],"./be/index.js":[7742,7,86313,22369],"./bg/_lib/formatDistance/index.js":[66186,7,72665],"./bg/_lib/formatLong/index.js":[60011,7,29128],"./bg/_lib/formatRelative/index.js":[22857,7,17026],"./bg/_lib/localize/index.js":[7265,7,87786],"./bg/_lib/match/index.js":[88767,7,4084],"./bg/index.js":[10620,7,32339],"./bn/_lib/formatDistance/index.js":[6461,7,70550],"./bn/_lib/formatLong/index.js":[5688,7,76195],"./bn/_lib/formatRelative/index.js":[68634,7,37833],"./bn/_lib/localize/index.js":[47906,9,80441],"./bn/_lib/match/index.js":[902,7,1121],"./bn/index.js":[11147,7,36240],"./bs/_lib/formatDistance/index.js":[44654,7,39909],"./bs/_lib/formatLong/index.js":[43295,7,66900],"./bs/_lib/formatRelative/index.js":[2373,7,11974],"./bs/_lib/localize/index.js":[24165,7,82502],"./bs/_lib/match/index.js":[62251,7,24184],"./bs/index.js":[88384,7,51247],"./ca/_lib/formatDistance/index.js":[62185,7,49318],"./ca/_lib/formatLong/index.js":[57444,7,93427],"./ca/_lib/formatRelative/index.js":[5870,7,60729],"./ca/_lib/localize/index.js":[36814,7,24713],"./ca/_lib/match/index.js":[74730,7,4689],"./ca/index.js":[37543,7,41568],"./cs/_lib/formatDistance/index.js":[74819,7,61460],"./cs/_lib/formatLong/index.js":[38766,7,21489],"./cs/_lib/formatRelative/index.js":[54748,7,93747],"./cs/_lib/localize/index.js":[81188,7,45387],"./cs/_lib/match/index.js":[99204,7,71759],"./cs/index.js":[42345,7,54126],"./cy/_lib/formatDistance/index.js":[46737,7,43454],"./cy/_lib/formatLong/index.js":[96828,7,51099],"./cy/_lib/formatRelative/index.js":[11830,7,82545],"./cy/_lib/localize/index.js":[18470,7,36913],"./cy/_lib/match/index.js":[92898,7,93209],"./cy/index.js":[75455,7,80392],"./da/_lib/formatDistance/index.js":[77898,7,21209],"./da/_lib/formatLong/index.js":[90699,7,55976],"./da/_lib/formatRelative/index.js":[54409,7,44514],"./da/_lib/localize/index.js":[11969,7,54026],"./da/_lib/match/index.js":[7903,7,94356],"./da/index.js":[49980,7,11123],"./de-AT/_lib/localize/index.js":[59527,7,37236],"./de-AT/index.js":[58142,7,41537],"./de/_lib/formatDistance/index.js":[4286,7,11573],"./de/_lib/formatLong/index.js":[44623,7,99268],"./de/_lib/formatRelative/index.js":[23189,7,4374],"./de/_lib/localize/index.js":[18101,7,44214],"./de/_lib/match/index.js":[35003,7,95144],"./de/index.js":[84496,7,38975],"./el/_lib/formatDistance/index.js":[27748,7,94131],"./el/_lib/formatLong/index.js":[40885,7,47490],"./el/_lib/formatRelative/index.js":[91639,7,38768],"./el/_lib/localize/index.js":[64663,7,94296],"./el/_lib/match/index.js":[87513,7,98598],"./el/index.js":[26574,7,93589],"./en-AU/_lib/formatLong/index.js":[31630,7,43553],"./en-AU/index.js":[19049,7,65886],"./en-CA/_lib/formatDistance/index.js":[80737,7,27062],"./en-CA/_lib/formatLong/index.js":[48172,7,66147],"./en-CA/index.js":[84175,7,86864],"./en-GB/_lib/formatLong/index.js":[30085,7,99458],"./en-GB/index.js":[89630,7,97813],"./en-IE/index.js":[28113,7,30774],"./en-IN/_lib/formatLong/index.js":[82031,7,7840],"./en-IN/index.js":[63792,7,32907],"./en-NZ/_lib/formatLong/index.js":[60384,7,22403],"./en-NZ/index.js":[33555,7,47216],"./en-US/_lib/formatDistance/index.js":[28793,7,48606],"./en-US/_lib/formatLong/index.js":[36212,7,68379],"./en-US/_lib/formatRelative/index.js":[47710,7,43057],"./en-US/_lib/localize/index.js":[68702,7,11281],"./en-US/_lib/match/index.js":[26266,7,5721],"./en-US/index.js":[44087,7,91304],"./en-ZA/_lib/formatLong/index.js":[92121,7,45234],"./en-ZA/index.js":[8450,7,6277],"./eo/_lib/formatDistance/index.js":[76757,7,72658],"./eo/_lib/formatLong/index.js":[35712,7,64191],"./eo/_lib/formatRelative/index.js":[5842,7,845],"./eo/_lib/localize/index.js":[44202,7,7541],"./eo/_lib/match/index.js":[50894,7,92597],"./eo/index.js":[24627,7,81468],"./es/_lib/formatDistance/index.js":[62417,7,23806],"./es/_lib/formatLong/index.js":[39708,7,95643],"./es/_lib/formatRelative/index.js":[63254,7,34609],"./es/_lib/localize/index.js":[68134,7,5777],"./es/_lib/match/index.js":[73858,7,56729],"./es/index.js":[18559,7,51336],"./et/_lib/formatDistance/index.js":[1708,7,24331],"./et/_lib/formatLong/index.js":[10253,7,7690],"./et/_lib/formatRelative/index.js":[73695,7,74248],"./et/_lib/localize/index.js":[45615,7,14336],"./et/_lib/match/index.js":[76497,7,24110],"./et/index.js":[40198,7,20509],"./eu/_lib/formatDistance/index.js":[50967,7,43336],"./eu/_lib/formatLong/index.js":[31538,7,52357],"./eu/_lib/formatRelative/index.js":[89096,7,48975],"./eu/_lib/localize/index.js":[24216,7,49039],"./eu/_lib/match/index.js":[63488,7,65995],"./eu/index.js":[75757,7,93474],"./fa-IR/_lib/formatDistance/index.js":[5764,7,68447],"./fa-IR/_lib/formatLong/index.js":[23669,7,89598],"./fa-IR/_lib/formatRelative/index.js":[53303,7,64180],"./fa-IR/_lib/localize/index.js":[81559,7,27924],"./fa-IR/_lib/match/index.js":[97785,7,76314],"./fa-IR/index.js":[46254,7,56129],"./fi/_lib/formatDistance/index.js":[50228,7,71215],"./fi/_lib/formatLong/index.js":[41317,7,90350],"./fi/_lib/formatRelative/index.js":[64007,7,76772],"./fi/_lib/localize/index.js":[67591,7,67364],"./fi/_lib/match/index.js":[66441,7,72714],"./fi/index.js":[87806,7,42033],"./fr-CA/_lib/formatLong/index.js":[14533,7,76562],"./fr-CA/index.js":[5534,7,19973],"./fr-CH/_lib/formatLong/index.js":[47186,7,85861],"./fr-CH/_lib/formatRelative/index.js":[28264,7,14159],"./fr-CH/index.js":[98541,7,1506],"./fr/_lib/formatDistance/index.js":[24941,7,38678],"./fr/_lib/formatLong/index.js":[56552,7,48803],"./fr/_lib/formatRelative/index.js":[4394,7,73769],"./fr/_lib/localize/index.js":[37650,7,38041],"./fr/_lib/match/index.js":[58422,7,68417],"./fr/index.js":[51035,7,82544],"./fy/_lib/formatDistance/index.js":[99748,7,33151],"./fy/_lib/formatLong/index.js":[83317,7,2910],"./fy/_lib/formatRelative/index.js":[47287,7,46964],"./fy/_lib/localize/index.js":[56247,7,36948],"./fy/_lib/match/index.js":[20166,7,1082],"./fy/index.js":[9249,7,53601],"./gd/_lib/formatDistance/index.js":[57542,7,25169],"./gd/_lib/formatLong/index.js":[23271,7,59664],"./gd/_lib/formatRelative/index.js":[75229,7,79002],"./gd/_lib/localize/index.js":[60877,7,6258],"./gd/_lib/match/index.js":[94931,7,52380],"./gd/index.js":[84584,7,89083],"./gl/_lib/formatDistance/index.js":[92366,7,81081],"./gl/_lib/formatLong/index.js":[5183,7,67112],"./gl/_lib/formatRelative/index.js":[63557,7,13634],"./gl/_lib/localize/index.js":[6789,7,44458],"./gl/_lib/match/index.js":[64235,7,5556],"./gl/index.js":[99488,7,43251],"./gu/_lib/formatDistance/index.js":[85841,7,47142],"./gu/_lib/formatLong/index.js":[62972,7,66579],"./gu/_lib/formatRelative/index.js":[90710,7,31097],"./gu/_lib/localize/index.js":[9894,7,99561],"./gu/_lib/match/index.js":[40738,7,5425],"./gu/index.js":[47967,7,74048],"./he/_lib/formatDistance/index.js":[81098,7,38697],"./he/_lib/formatLong/index.js":[10027,7,65560],"./he/_lib/formatRelative/index.js":[85737,7,14386],"./he/_lib/localize/index.js":[70657,7,77498],"./he/_lib/match/index.js":[26527,7,98500],"./he/index.js":[16988,7,64643],"./hi/_lib/formatDistance/index.js":[79894,7,58909],"./hi/_lib/formatLong/index.js":[9687,7,77468],"./hi/_lib/formatRelative/index.js":[82157,7,82686],"./hi/_lib/localize/index.js":[24253,9,22670],"./hi/_lib/match/index.js":[52835,7,85472],"./hi/index.js":[85720,7,51255],"./hr/_lib/formatDistance/index.js":[10515,7,84904],"./hr/_lib/formatLong/index.js":[65726,7,43461],"./hr/_lib/formatRelative/index.js":[69900,7,62415],"./hr/_lib/localize/index.js":[45268,7,59823],"./hr/_lib/match/index.js":[31764,7,15339],"./hr/index.js":[97145,7,49826],"./ht/_lib/formatDistance/index.js":[66389,7,18622],"./ht/_lib/formatLong/index.js":[91968,7,74363],"./ht/_lib/formatRelative/index.js":[95474,7,57713],"./ht/_lib/localize/index.js":[34506,7,36273],"./ht/_lib/match/index.js":[73998,7,91449],"./ht/index.js":[1331,7,24392],"./hu/_lib/formatDistance/index.js":[41242,7,3481],"./hu/_lib/formatLong/index.js":[81947,7,94824],"./hu/_lib/formatRelative/index.js":[51353,7,47842],"./hu/_lib/localize/index.js":[71281,7,78730],"./hu/_lib/match/index.js":[42127,7,12596],"./hu/index.js":[49100,7,81395],"./hy/_lib/formatDistance/index.js":[21062,7,59085],"./hy/_lib/formatLong/index.js":[62183,7,80332],"./hy/_lib/formatRelative/index.js":[55517,7,3406],"./hy/_lib/localize/index.js":[90637,7,10526],"./hy/_lib/match/index.js":[43571,7,24304],"./hy/index.js":[21608,7,56871],"./id/_lib/formatDistance/index.js":[66136,7,77503],"./id/_lib/formatLong/index.js":[86009,7,60478],"./id/_lib/formatRelative/index.js":[21747,7,91316],"./id/_lib/localize/index.js":[34363,7,45364],"./id/_lib/match/index.js":[75685,7,74458],"./id/index.js":[77346,7,48545],"./is/_lib/formatDistance/index.js":[7269,7,13754],"./is/_lib/formatLong/index.js":[79696,7,98935],"./is/_lib/formatRelative/index.js":[31682,7,54005],"./is/_lib/localize/index.js":[8794,7,56909],"./is/_lib/match/index.js":[36414,7,94157],"./is/index.js":[7971,7,56692],"./it-CH/_lib/formatLong/index.js":[53205,7,14802],"./it-CH/index.js":[7822,7,50213],"./it/_lib/formatDistance/index.js":[53064,7,15567],"./it/_lib/formatLong/index.js":[66089,7,47918],"./it/_lib/formatRelative/index.js":[27747,7,21124],"./it/_lib/localize/index.js":[77291,7,75780],"./it/_lib/match/index.js":[75317,7,62442],"./it/index.js":[56594,7,36977],"./ja-Hira/_lib/formatDistance/index.js":[86029,7,73306],"./ja-Hira/_lib/formatLong/index.js":[40424,7,58487],"./ja-Hira/_lib/formatRelative/index.js":[86954,7,60757],"./ja-Hira/_lib/localize/index.js":[79922,7,79821],"./ja-Hira/_lib/match/index.js":[27446,7,34349],"./ja-Hira/index.js":[13275,7,18132],"./ja/_lib/formatDistance/index.js":[24928,7,28131],"./ja/_lib/formatLong/index.js":[39089,7,88850],"./ja/_lib/formatRelative/index.js":[4091,7,97792],"./ja/_lib/localize/index.js":[51987,7,42728],"./ja/_lib/match/index.js":[28349,7,7030],"./ja/index.js":[97306,7,66309],"./ka/_lib/formatDistance/index.js":[57761,7,62974],"./ka/_lib/formatLong/index.js":[22476,7,31931],"./ka/_lib/formatRelative/index.js":[36998,7,85713],"./ka/_lib/localize/index.js":[49110,7,44689],"./ka/_lib/match/index.js":[42866,7,64825],"./ka/index.js":[18415,7,19336],"./kk/_lib/formatDistance/index.js":[53555,7,64628],"./kk/_lib/formatLong/index.js":[17630,7,85969],"./kk/_lib/formatRelative/index.js":[74956,7,96915],"./kk/_lib/localize/index.js":[66836,7,53163],"./kk/_lib/match/index.js":[48916,7,43375],"./kk/index.js":[25273,7,93070],"./km/_lib/formatDistance/index.js":[36437,7,99010],"./km/_lib/formatLong/index.js":[54528,7,29519],"./km/_lib/formatRelative/index.js":[94194,7,96349],"./km/_lib/localize/index.js":[19690,7,1669],"./km/_lib/match/index.js":[33806,7,45893],"./km/index.js":[95795,7,71148],"./kn/_lib/formatDistance/index.js":[54084,7,5411],"./kn/_lib/formatLong/index.js":[88597,7,43314],"./kn/_lib/formatRelative/index.js":[12471,7,12096],"./kn/_lib/localize/index.js":[63351,7,71464],"./kn/_lib/match/index.js":[85113,7,97782],"./kn/index.js":[43182,7,33509],"./ko/_lib/formatDistance/index.js":[89359,7,36512],"./ko/_lib/formatLong/index.js":[10970,7,70893],"./ko/_lib/formatRelative/index.js":[52864,7,83207],"./ko/_lib/localize/index.js":[35763,7,74999],"./ko/_lib/match/index.js":[59336,7,53427],"./ko/index.js":[70901,7,82122],"./lb/_lib/formatDistance/index.js":[65559,7,72948],"./lb/_lib/formatLong/index.js":[47282,7,23377],"./lb/_lib/formatRelative/index.js":[53320,7,96819],"./lb/_lib/localize/index.js":[97912,7,62059],"./lb/_lib/match/index.js":[992,7,42415],"./lb/index.js":[51981,7,90030],"./lt/_lib/formatDistance/index.js":[13409,7,60914],"./lt/_lib/formatLong/index.js":[64908,7,11007],"./lt/_lib/formatRelative/index.js":[92646,7,90509],"./lt/_lib/localize/index.js":[57046,7,53909],"./lt/_lib/match/index.js":[69490,7,93493],"./lt/index.js":[23471,7,38588],"./lv/_lib/formatDistance/index.js":[41259,7,16432],"./lv/_lib/formatLong/index.js":[69030,7,85373],"./lv/_lib/formatRelative/index.js":[16388,7,43095],"./lv/_lib/localize/index.js":[36508,7,72199],"./lv/_lib/match/index.js":[32220,7,5603],"./lv/index.js":[72673,7,51610],"./mk/_lib/formatDistance/index.js":[77553,7,83022],"./mk/_lib/formatLong/index.js":[62524,7,93067],"./mk/_lib/formatRelative/index.js":[26294,7,79905],"./mk/_lib/localize/index.js":[9414,7,20129],"./mk/_lib/match/index.js":[17762,7,34665],"./mk/index.js":[8159,7,90552],"./mn/_lib/formatDistance/index.js":[21154,7,12005],"./mn/_lib/formatLong/index.js":[84275,7,86164],"./mn/_lib/formatRelative/index.js":[66433,7,34790],"./mn/_lib/localize/index.js":[16489,7,77894],"./mn/_lib/match/index.js":[87431,7,13176],"./mn/index.js":[996,7,89711],"./ms/_lib/formatDistance/index.js":[93001,7,15478],"./ms/_lib/formatLong/index.js":[23140,7,28451],"./ms/_lib/formatRelative/index.js":[36686,7,69545],"./ms/_lib/localize/index.js":[27758,7,67481],"./ms/_lib/match/index.js":[99594,7,47553],"./ms/index.js":[70247,7,42096],"./mt/_lib/formatDistance/index.js":[62276,7,73443],"./mt/_lib/formatLong/index.js":[98229,7,90546],"./mt/_lib/formatRelative/index.js":[42839,7,62176],"./mt/_lib/localize/index.js":[10263,7,54920],"./mt/_lib/match/index.js":[73337,7,43734],"./mt/index.js":[89102,7,33221],"./nb/_lib/formatDistance/index.js":[35573,7,84382],"./nb/_lib/formatLong/index.js":[42624,7,34491],"./nb/_lib/formatRelative/index.js":[64658,7,93201],"./nb/_lib/localize/index.js":[43562,7,15345],"./nb/_lib/match/index.js":[49134,7,69401],"./nb/index.js":[68627,7,11976],"./nl-BE/_lib/formatDistance/index.js":[98351,7,82012],"./nl-BE/_lib/formatLong/index.js":[49338,7,3241],"./nl-BE/_lib/formatRelative/index.js":[91744,7,24443],"./nl-BE/_lib/localize/index.js":[26848,7,52675],"./nl-BE/_lib/match/index.js":[92904,7,47463],"./nl-BE/index.js":[57685,7,71462],"./nl/_lib/formatDistance/index.js":[27243,7,22880],"./nl/_lib/formatLong/index.js":[35398,7,68237],"./nl/_lib/formatRelative/index.js":[95876,7,7879],"./nl/_lib/localize/index.js":[44380,7,82903],"./nl/_lib/match/index.js":[48572,7,48851],"./nl/index.js":[85249,7,86986],"./nn/_lib/formatDistance/index.js":[26849,7,72290],"./nn/_lib/formatLong/index.js":[98668,7,56655],"./nn/_lib/formatRelative/index.js":[25382,7,25117],"./nn/_lib/localize/index.js":[38665,7,86117],"./nn/_lib/match/index.js":[35794,7,88037],"./nn/index.js":[40079,7,73036],"./oc/_lib/formatDistance/index.js":[25759,7,50712],"./oc/_lib/formatLong/index.js":[66634,7,99925],"./oc/_lib/formatRelative/index.js":[32944,7,95967],"./oc/_lib/localize/index.js":[32976,7,99935],"./oc/_lib/match/index.js":[86840,7,86267],"./oc/index.js":[10853,7,49458],"./pl/_lib/formatDistance/index.js":[94565,7,66606],"./pl/_lib/formatLong/index.js":[94128,7,32267],"./pl/_lib/formatRelative/index.js":[18850,7,41345],"./pl/_lib/localize/index.js":[29146,7,385],"./pl/_lib/match/index.js":[75038,7,2569],"./pl/index.js":[85795,7,34776],"./pt-BR/_lib/formatDistance/index.js":[8148,7,33135],"./pt-BR/_lib/formatLong/index.js":[32677,7,29006],"./pt-BR/_lib/formatRelative/index.js":[5255,7,42468],"./pt-BR/_lib/localize/index.js":[87495,7,87236],"./pt-BR/_lib/match/index.js":[51113,7,99818],"./pt-BR/index.js":[5598,7,45649],"./pt/_lib/formatDistance/index.js":[78701,7,74262],"./pt/_lib/formatLong/index.js":[59528,7,35843],"./pt/_lib/formatRelative/index.js":[79626,7,94921],"./pt/_lib/localize/index.js":[96914,7,53337],"./pt/_lib/match/index.js":[45494,7,95105],"./pt/index.js":[32347,7,35600],"./ro/_lib/formatDistance/index.js":[49522,7,6721],"./ro/_lib/formatLong/index.js":[7075,7,46432],"./ro/_lib/formatRelative/index.js":[31729,7,56874],"./ro/_lib/localize/index.js":[44793,7,10658],"./ro/_lib/match/index.js":[90167,7,37868],"./ro/index.js":[83572,7,20939],"./ru/_lib/formatDistance/index.js":[88596,7,93919],"./ru/_lib/formatLong/index.js":[26277,7,14302],"./ru/_lib/formatRelative/index.js":[2375,7,84628],"./ru/_lib/localize/index.js":[69351,7,83764],"./ru/_lib/match/index.js":[33065,7,43546],"./ru/index.js":[22398,7,26337],"./sk/_lib/formatDistance/index.js":[987,7,97276],"./sk/_lib/formatLong/index.js":[53302,7,82857],"./sk/_lib/formatRelative/index.js":[70708,7,63995],"./sk/_lib/localize/index.js":[72012,7,54851],"./sk/_lib/match/index.js":[39308,7,70887],"./sk/index.js":[62001,7,60294],"./sl/_lib/formatDistance/index.js":[63490,7,17557],"./sl/_lib/formatLong/index.js":[58707,7,71876],"./sl/_lib/formatRelative/index.js":[38337,7,94006],"./sl/_lib/localize/index.js":[46217,7,34518],"./sl/_lib/match/index.js":[66375,7,18248],"./sl/index.js":[78052,7,99327],"./sq/_lib/formatDistance/index.js":[17001,7,39622],"./sq/_lib/formatLong/index.js":[97220,7,70099],"./sq/_lib/formatRelative/index.js":[80942,7,47321],"./sq/_lib/localize/index.js":[13070,7,81161],"./sq/_lib/match/index.js":[52554,7,19409],"./sq/index.js":[44263,7,84736],"./sr-Latn/_lib/formatDistance/index.js":[54498,7,22841],"./sr-Latn/_lib/formatLong/index.js":[97587,7,47944],"./sr-Latn/_lib/formatRelative/index.js":[29345,7,29794],"./sr-Latn/_lib/localize/index.js":[54153,7,75658],"./sr-Latn/_lib/match/index.js":[97639,7,77492],"./sr-Latn/index.js":[26148,7,28179],"./sr/_lib/formatDistance/index.js":[66360,7,8039],"./sr/_lib/formatLong/index.js":[3705,7,97398],"./sr/_lib/formatRelative/index.js":[62355,7,73884],"./sr/_lib/localize/index.js":[35291,7,26828],"./sr/_lib/match/index.js":[15365,7,94738],"./sr/index.js":[16322,7,14969],"./sv/_lib/formatDistance/index.js":[93764,7,28115],"./sv/_lib/formatLong/index.js":[27061,7,77666],"./sv/_lib/formatRelative/index.js":[57655,7,72752],"./sv/_lib/localize/index.js":[49591,7,93016],"./sv/_lib/match/index.js":[91033,7,78726],"./sv/index.js":[54926,7,65237],"./ta/_lib/formatDistance/index.js":[11002,7,21353],"./ta/_lib/formatLong/index.js":[28891,7,68824],"./ta/_lib/formatRelative/index.js":[18393,7,2162],"./ta/_lib/localize/index.js":[44209,7,83610],"./ta/_lib/match/index.js":[71247,7,34116],"./ta/index.js":[12268,7,44355],"./te/_lib/formatDistance/index.js":[86382,7,19717],"./te/_lib/formatLong/index.js":[32575,7,35860],"./te/_lib/formatRelative/index.js":[73925,7,23718],"./te/_lib/localize/index.js":[16485,7,68614],"./te/_lib/match/index.js":[41131,7,63256],"./te/index.js":[22784,7,60335],"./th/_lib/formatDistance/index.js":[9997,7,37126],"./th/_lib/formatLong/index.js":[2344,7,11091],"./th/_lib/formatRelative/index.js":[32618,7,59321],"./th/_lib/localize/index.js":[16946,7,5769],"./th/_lib/match/index.js":[74358,7,53617],"./th/index.js":[12219,7,80224],"./tr/_lib/formatDistance/index.js":[22687,7,45212],"./tr/_lib/formatLong/index.js":[57578,7,297],"./tr/_lib/formatRelative/index.js":[34e3,7,16187],"./tr/_lib/localize/index.js":[54384,7,1411],"./tr/_lib/match/index.js":[64120,7,90631],"./tr/index.js":[87173,7,10662],"./ug/_lib/formatDistance/index.js":[36061,7,58058],"./ug/_lib/formatLong/index.js":[28376,7,51239],"./ug/_lib/formatRelative/index.js":[49434,7,8901],"./ug/_lib/localize/index.js":[33250,7,16541],"./ug/_lib/match/index.js":[64486,7,73789],"./ug/index.js":[8171,7,62820],"./uk/_lib/formatDistance/index.js":[81017,7,18646],"./uk/_lib/formatLong/index.js":[63156,7,9283],"./uk/_lib/formatRelative/index.js":[52574,7,86313,72713],"./uk/_lib/localize/index.js":[98302,7,75257],"./uk/_lib/match/index.js":[82458,7,35521],"./uk/index.js":[32343,7,86313,81040],"./uz-Cyrl/_lib/formatDistance/index.js":[34499,7,60876],"./uz-Cyrl/_lib/formatLong/index.js":[53070,7,23513],"./uz-Cyrl/_lib/formatRelative/index.js":[87964,7,66411],"./uz-Cyrl/_lib/localize/index.js":[39332,7,31059],"./uz-Cyrl/_lib/match/index.js":[91204,7,95639],"./uz-Cyrl/index.js":[95465,7,62550],"./uz/_lib/formatDistance/index.js":[58382,7,34721],"./uz/_lib/formatLong/index.js":[75007,7,20352],"./uz/_lib/formatRelative/index.js":[29573,7,1226],"./uz/_lib/localize/index.js":[30450,7,2722],"./uz/_lib/match/index.js":[67755,7,11244],"./uz/index.js":[27840,7,32235],"./vi/_lib/formatDistance/index.js":[30468,7,58047],"./vi/_lib/formatLong/index.js":[85813,7,43166],"./vi/_lib/formatRelative/index.js":[88855,7,98932],"./vi/_lib/localize/index.js":[74327,7,42612],"./vi/_lib/match/index.js":[81881,7,60826],"./vi/index.js":[11182,7,43073],"./zh-CN/_lib/formatDistance/index.js":[4907,7,11468],"./zh-CN/_lib/formatLong/index.js":[28326,7,55993],"./zh-CN/_lib/formatRelative/index.js":[57668,7,22187],"./zh-CN/_lib/localize/index.js":[64284,7,83955],"./zh-CN/_lib/match/index.js":[22108,7,66615],"./zh-CN/index.js":[4257,7,3126],"./zh-HK/_lib/formatDistance/index.js":[77927,7,28132],"./zh-HK/_lib/formatLong/index.js":[96706,7,38337],"./zh-HK/_lib/formatRelative/index.js":[92344,7,483],"./zh-HK/_lib/localize/index.js":[70024,7,43035],"./zh-HK/_lib/match/index.js":[45680,7,53631],"./zh-HK/index.js":[65501,7,4254],"./zh-TW/_lib/formatDistance/index.js":[92383,7,79684],"./zh-TW/_lib/formatLong/index.js":[33226,7,58817],"./zh-TW/_lib/formatRelative/index.js":[3696,7,35683],"./zh-TW/_lib/localize/index.js":[84112,7,53371],"./zh-TW/_lib/match/index.js":[27256,7,32287],"./zh-TW/index.js":[41157,7,99902]};function r(e){if(!n.o(o,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=o[e],r=t[0];return Promise.all(t.slice(2).map(n.e)).then((()=>n.t(r,16|t[1])))}r.keys=()=>Object.keys(o),r.id=22523,e.exports=r},35358:(e,t,n)=>{var o={"./af":19183,"./af.js":19183,"./ar":31035,"./ar-dz":47214,"./ar-dz.js":47214,"./ar-kw":40830,"./ar-kw.js":40830,"./ar-ly":68899,"./ar-ly.js":68899,"./ar-ma":77258,"./ar-ma.js":77258,"./ar-sa":64096,"./ar-sa.js":64096,"./ar-tn":97826,"./ar-tn.js":97826,"./ar.js":31035,"./az":20051,"./az.js":20051,"./be":23813,"./be.js":23813,"./bg":64323,"./bg.js":64323,"./bm":57837,"./bm.js":57837,"./bn":75780,"./bn-bd":25959,"./bn-bd.js":25959,"./bn.js":75780,"./bo":81451,"./bo.js":81451,"./br":76480,"./br.js":76480,"./bs":91607,"./bs.js":91607,"./ca":23232,"./ca.js":23232,"./cs":91034,"./cs.js":91034,"./cv":54213,"./cv.js":54213,"./cy":95800,"./cy.js":95800,"./da":40739,"./da.js":40739,"./de":66951,"./de-at":82181,"./de-at.js":82181,"./de-ch":61339,"./de-ch.js":61339,"./de.js":66951,"./dv":16938,"./dv.js":16938,"./el":59573,"./el.js":59573,"./en-au":62458,"./en-au.js":62458,"./en-ca":51816,"./en-ca.js":51816,"./en-gb":8069,"./en-gb.js":8069,"./en-ie":15586,"./en-ie.js":15586,"./en-il":60009,"./en-il.js":60009,"./en-in":51207,"./en-in.js":51207,"./en-nz":83724,"./en-nz.js":83724,"./en-sg":24334,"./en-sg.js":24334,"./eo":1292,"./eo.js":1292,"./es":66328,"./es-do":61452,"./es-do.js":61452,"./es-mx":94444,"./es-mx.js":94444,"./es-us":81285,"./es-us.js":81285,"./es.js":66328,"./et":7181,"./et.js":7181,"./eu":62830,"./eu.js":62830,"./fa":19565,"./fa.js":19565,"./fi":85541,"./fi.js":85541,"./fil":65661,"./fil.js":65661,"./fo":26087,"./fo.js":26087,"./fr":25396,"./fr-ca":96581,"./fr-ca.js":96581,"./fr-ch":81294,"./fr-ch.js":81294,"./fr.js":25396,"./fy":12533,"./fy.js":12533,"./ga":55796,"./ga.js":55796,"./gd":50847,"./gd.js":50847,"./gl":60439,"./gl.js":60439,"./gom-deva":46514,"./gom-deva.js":46514,"./gom-latn":66525,"./gom-latn.js":66525,"./gu":34232,"./gu.js":34232,"./he":50915,"./he.js":50915,"./hi":22095,"./hi.js":22095,"./hr":10762,"./hr.js":10762,"./hu":88275,"./hu.js":88275,"./hy-am":73094,"./hy-am.js":73094,"./id":27769,"./id.js":27769,"./is":99676,"./is.js":99676,"./it":74313,"./it-ch":25141,"./it-ch.js":25141,"./it.js":74313,"./ja":11985,"./ja.js":11985,"./jv":53908,"./jv.js":53908,"./ka":32808,"./ka.js":32808,"./kk":33930,"./kk.js":33930,"./km":71532,"./km.js":71532,"./kn":69461,"./kn.js":69461,"./ko":60502,"./ko.js":60502,"./ku":18660,"./ku.js":18660,"./ky":83088,"./ky.js":83088,"./lb":65742,"./lb.js":65742,"./lo":25417,"./lo.js":25417,"./lt":64968,"./lt.js":64968,"./lv":41202,"./lv.js":41202,"./me":34438,"./me.js":34438,"./mi":18498,"./mi.js":18498,"./mk":6744,"./mk.js":6744,"./ml":63949,"./ml.js":63949,"./mn":4459,"./mn.js":4459,"./mr":46679,"./mr.js":46679,"./ms":56960,"./ms-my":47483,"./ms-my.js":47483,"./ms.js":56960,"./mt":99989,"./mt.js":99989,"./my":64978,"./my.js":64978,"./nb":88460,"./nb.js":88460,"./ne":23993,"./ne.js":23993,"./nl":95378,"./nl-be":62678,"./nl-be.js":62678,"./nl.js":95378,"./nn":67560,"./nn.js":67560,"./oc-lnc":87060,"./oc-lnc.js":87060,"./pa-in":62187,"./pa-in.js":62187,"./pl":93532,"./pl.js":93532,"./pt":49396,"./pt-br":92485,"./pt-br.js":92485,"./pt.js":49396,"./ro":33179,"./ro.js":33179,"./ru":93797,"./ru.js":93797,"./sd":40675,"./sd.js":40675,"./se":59036,"./se.js":59036,"./si":59160,"./si.js":59160,"./sk":31266,"./sk.js":31266,"./sl":74699,"./sl.js":74699,"./sq":69728,"./sq.js":69728,"./sr":87129,"./sr-cyrl":55e3,"./sr-cyrl.js":55e3,"./sr.js":87129,"./ss":74346,"./ss.js":74346,"./sv":9877,"./sv.js":9877,"./sw":918,"./sw.js":918,"./ta":24787,"./ta.js":24787,"./te":6199,"./te.js":6199,"./tet":91851,"./tet.js":91851,"./tg":33881,"./tg.js":33881,"./th":87828,"./th.js":87828,"./tk":99677,"./tk.js":99677,"./tl-ph":29253,"./tl-ph.js":29253,"./tlh":95586,"./tlh.js":95586,"./tr":17254,"./tr.js":17254,"./tzl":61192,"./tzl.js":61192,"./tzm":69631,"./tzm-latn":72841,"./tzm-latn.js":72841,"./tzm.js":69631,"./ug-cn":71720,"./ug-cn.js":71720,"./uk":28048,"./uk.js":28048,"./ur":86751,"./ur.js":86751,"./uz":96343,"./uz-latn":60513,"./uz-latn.js":60513,"./uz.js":96343,"./vi":44821,"./vi.js":44821,"./x-pseudo":23973,"./x-pseudo.js":23973,"./yo":15e3,"./yo.js":15e3,"./zh-cn":43762,"./zh-cn.js":43762,"./zh-hk":9246,"./zh-hk.js":9246,"./zh-mo":41107,"./zh-mo.js":41107,"./zh-tw":79014,"./zh-tw.js":79014};function r(e){var t=i(e);return n(t)}function i(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=i,e.exports=r,r.id=35358},70772:(e,t,n)=>{"use strict";var o;n.d(t,{l:()=>o}),function(e){e[e.STANDARD=16]="STANDARD",e[e.LARGE=20]="LARGE"}(o||(o={}))},16990:(e,t,n)=>{e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,o){"string"==typeof e?(2==arguments.length&&(o=n),t.modules[e]||(t.payloads[e]=o,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,o,r=function(e,t,n){if("string"==typeof t){var o=s(e,t);if(null!=o)return n&&n(),o}else if("[object Array]"===Object.prototype.toString.call(t)){for(var r=[],a=0,l=t.length;an.length)&&(t=n.length),t-=e.length;var o=n.indexOf(e,t);return-1!==o&&o===t})),String.prototype.repeat||o(String.prototype,"repeat",(function(e){for(var t="",n=this;e>0;)1&e&&(t+=n),(e>>=1)&&(n+=n);return t})),String.prototype.includes||o(String.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Object.assign||(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n>>0,o=arguments[1]|0,r=o<0?Math.max(n+o,0):Math.min(o,n),i=arguments[2],a=void 0===i?n:i|0,s=a<0?Math.max(n+a,0):Math.min(a,n);r0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var o=/^\s\s*/,r=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(o,"")},t.stringTrimRight=function(e){return e.replace(r,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,o=e.length;n65535?2:1}})),ace.define("ace/lib/useragent",["require","exports","module"],(function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var o="object"==typeof navigator?navigator:{},r=(/mac|win|linux/i.exec(o.platform)||["other"])[0].toLowerCase(),i=o.userAgent||"",a=o.appName||"";t.isWin="win"==r,t.isMac="mac"==r,t.isLinux="linux"==r,t.isIE="Microsoft Internet Explorer"==a||a.indexOf("MSAppHost")>=0?parseFloat((i.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((i.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=i.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(i.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(i.split(" Chrome/")[1])||void 0,t.isSafari=parseFloat(i.split(" Safari/")[1])&&!t.isChrome||void 0,t.isEdge=parseFloat(i.split(" Edge/")[1])||void 0,t.isAIR=i.indexOf("AdobeAIR")>=0,t.isAndroid=i.indexOf("Android")>=0,t.isChromeOS=i.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(i)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid})),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],(function(e,t,n){"use strict";var o,r=e("./useragent");t.buildDom=function e(t,n,o){if("string"==typeof t&&t){var r=document.createTextNode(t);return n&&n.appendChild(r),r}if(!Array.isArray(t))return t&&t.appendChild&&n&&n.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var i=[],a=0;a=1.5,r.isChromeOS&&(t.HI_DPI=!1),"undefined"!=typeof document){var l=document.createElement("div");t.HI_DPI&&void 0!==l.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===l.style.animationName||(t.HAS_CSS_ANIMATION=!0),l=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}})),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],(function(e,t,n){ -/* - * based on code from: - * - * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ -"use strict";var o=e("./dom");t.get=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){4===n.readyState&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var n=o.getDocumentHead(),r=document.createElement("script");r.src=e,n.appendChild(r),r.onload=r.onreadystatechange=function(e,n){!n&&r.readyState&&"loaded"!=r.readyState&&"complete"!=r.readyState||(r=r.onload=r.onreadystatechange=null,n||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}})),ace.define("ace/lib/oop",["require","exports","module"],(function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}})),ace.define("ace/lib/event_emitter",["require","exports","module"],(function(e,t,n){"use strict";var o={},r=function(){this.propagationStopped=!0},i=function(){this.defaultPrevented=!0};o._emit=o._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],o=this._defaultHandlers[e];if(n.length||o){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=r),t.preventDefault||(t.preventDefault=i),n=n.slice();for(var a=0;a1&&(r=n[n.length-2]);var a=s[t+"Path"];return null==a?a=s.basePath:"/"==o&&(t=o=""),a&&"/"!=a.slice(-1)&&(a+="/"),a+t+o+r+this.get("suffix")},t.setModuleUrl=function(e,t){return s.$moduleUrls[e]=t};var l;t.setLoader=function(e){l=e},t.dynamicModules=Object.create(null),t.$loading={},t.$loaded={},t.loadModule=function(n,o){var i;if(Array.isArray(n))var a=n[0],s=n[1];else if("string"==typeof n)s=n;var d=function(n){if(n&&!t.$loading[s])return o&&o(n);if(t.$loading[s]||(t.$loading[s]=[]),t.$loading[s].push(o),!(t.$loading[s].length>1)){var i=function(){!function(t,n){"ace/theme/textmate"===t||"./theme/textmate"===t?n(null,e("./theme/textmate")):l?l(t,n):console.error("loader is not configured")}(s,(function(e,n){n&&(t.$loaded[s]=n),t._emit("load.module",{name:s,module:n});var o=t.$loading[s];t.$loading[s]=null,o.forEach((function(e){e&&e(n)}))}))};if(!t.get("packaged"))return i();r.loadScript(t.moduleUrl(s,a),i),c()}};if(t.dynamicModules[s])t.dynamicModules[s]().then((function(e){e.default?d(e.default):d(e)}));else{try{i=this.$require(s)}catch(e){}d(i||t.$loaded[s])}},t.$require=function(e){if("function"==typeof n.require){return n.require(e)}},t.setModuleLoader=function(e,n){t.dynamicModules[e]=n};var c=function(){s.basePath||s.workerPath||s.modePath||s.themePath||Object.keys(s.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})};t.version="1.33.2"})),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],(function(e,t,o){"use strict";e("./lib/fixoldbrowsers");var r=e("./config");r.setLoader((function(t,n){e([t],(function(e){n(null,e)}))}));var i=function(){return this||"undefined"!=typeof window&&window}();function a(t){if(i&&i.document){r.set("packaged",t||e.packaged||o.packaged||i.define&&n.amdD.packaged);var a={},s="",l=document.currentScript||document._currentScript,c=l&&l.ownerDocument||document;l&&l.src&&(s=l.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var d,u=c.getElementsByTagName("script"),h=0;h ["+this.end.row+"/"+this.end.column+"]"},e.prototype.contains=function(e,t){return 0==this.compare(e,t)},e.prototype.compareRange=function(e){var t,n=e.end,o=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(o.row,o.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(o.row,o.column))?-1:1==t?42:0},e.prototype.comparePoint=function(e){return this.compare(e.row,e.column)},e.prototype.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},e.prototype.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},e.prototype.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},e.prototype.isStart=function(e,t){return this.start.row==e&&this.start.column==t},e.prototype.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},e.prototype.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},e.prototype.inside=function(e,t){return 0==this.compare(e,t)&&(!this.isEnd(e,t)&&!this.isStart(e,t))},e.prototype.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},e.prototype.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},e.prototype.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},e.prototype.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},e.prototype.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.clipRows=function(t,n){if(this.end.row>n)var o={row:n+1,column:0};else if(this.end.rown)var r={row:n+1,column:0};else if(this.start.row1?++u>4&&(u=1):u=1,i.isIE){var a=Math.abs(e.clientX-s)>5||Math.abs(e.clientY-l)>5;c&&!a||(u=1),c&&clearTimeout(c),c=setTimeout((function(){c=null}),n[u-1]||600),1==u&&(s=e.clientX,l=e.clientY)}if(e._clicks=u,o[r]("mousedown",e),u>4)u=0;else if(u>1)return o[r](h[u],e)}Array.isArray(e)||(e=[e]),e.forEach((function(e){d(e,"mousedown",p,a)}))},t.getModifierString=function(e){return r.KEY_MODS[h(e)]},t.addCommandKeyListener=function(e,n,o){var l=null;d(e,"keydown",(function(e){a[e.keyCode]=(a[e.keyCode]||0)+1;var t=function(e,t,n){var o=h(t);if(!n&&t.code&&(n=r.$codeToKeyCode[t.code]||n),!i.isMac&&a){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(o|=8),a.altGr){if(!(3&~o))return;a.altGr=0}if(18===n||17===n){var l=t.location;17===n&&1===l?1==a[n]&&(s=t.timeStamp):18===n&&3===o&&2===l&&t.timeStamp-s<50&&(a.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),o||13!==n||3!==t.location||(e(t,o,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&o){if(e(t,o,n),t.defaultPrevented)return;o&=-9}return!!(o||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,o,n)}}(n,e,e.keyCode);return l=e.defaultPrevented,t}),o),d(e,"keypress",(function(e){l&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),l=null)}),o),d(e,"keyup",(function(e){a[e.keyCode]=null}),o),a||(p(),d(window,"focus",p))},"object"==typeof window&&window.postMessage&&!i.isOldIE){var f=1;t.nextTick=function(e,n){n=n||window;var o="zero-timeout-message-"+f++,r=function(i){i.data==o&&(t.stopPropagation(i),u(n,"message",r),e())};d(n,"message",r),n.postMessage(o,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout((function n(){t.$idleBlocked?setTimeout(n,100):e()}),n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout((function(){t.$idleBlocked=!1}),e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}})),ace.define("ace/clipboard",["require","exports","module"],(function(e,t,n){"use strict";var o;n.exports={lineMode:!1,pasteCancelled:function(){return!!(o&&o>Date.now()-50)||(o=!1)},cancel:function(){o=Date.now()}}})),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],(function(e,t,n){"use strict";var o,r=e("../lib/event"),i=e("../config").nls,a=e("../lib/useragent"),s=e("../lib/dom"),l=e("../lib/lang"),c=e("../clipboard"),d=a.isChrome<18,u=a.isIE,h=a.isChrome>63,p=400,f=e("../lib/keys"),m=f.KEY_MODS,g=a.isIOS,b=g?/\s/:/\n/,y=a.isMobile;o=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck","false"),n.style.opacity="0",e.insertBefore(n,e.firstChild);var o=!1,v=!1,_=!1,k=!1,w="";y||(n.style.fontSize="1px");var x=!1,S=!1,M="",T=0,L=0,C=0,E=Number.MAX_SAFE_INTEGER,A=Number.MIN_SAFE_INTEGER,D=0;try{var P=document.activeElement===n}catch(e){}this.setNumberOfExtraLines=function(e){E=Number.MAX_SAFE_INTEGER,A=Number.MIN_SAFE_INTEGER,D=e<0?0:e},this.setAriaOptions=function(e){if(e.activeDescendant?(n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-autocomplete",e.inline?"both":"list"),n.setAttribute("aria-activedescendant",e.activeDescendant)):(n.setAttribute("aria-haspopup","false"),n.setAttribute("aria-autocomplete","both"),n.removeAttribute("aria-activedescendant")),e.role&&n.setAttribute("role",e.role),e.setLabel&&(n.setAttribute("aria-roledescription",i("text-input.aria-roledescription","editor")),t.session)){var o=t.session.selection.cursor.row;n.setAttribute("aria-label",i("text-input.aria-label","Cursor at row $0",[o+1]))}},this.setAriaOptions({role:"textbox"}),r.addListener(n,"blur",(function(e){S||(t.onBlur(e),P=!1)}),t),r.addListener(n,"focus",(function(e){if(!S){if(P=!0,a.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),a.isEdge?setTimeout(O):O()}}),t),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:t.renderer.enableKeyboardAccessibility}),w||h||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var o=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(o)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext","true"),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),o&&r.forEach((function(e){e.removeAttribute("ace_nocontext")})),setTimeout((function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)}),0)},this.blur=function(){n.blur()},this.isFocused=function(){return P},t.on("beforeEndOperation",(function(){var e=t.curOp,o=e&&e.command&&e.command.name;if("insertstring"!=o){var r=o&&(e.docChanged||e.selectionChanged);_&&r&&(M=n.value="",G()),O()}}));var R=function(e,n){for(var o=n,r=1;r<=e-E&&r<2*D+1;r++)o+=t.session.getLine(e-r).length+1;return o},O=g?function(e){if(P&&(!o||e)&&!k){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=M=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==T&&L==i||n.setSelectionRange(4,i),T=4,L=i}}:function(){if(!_&&!k&&(P||N)){_=!0;var e=0,o=0,r="";if(t.session){var i=t.selection,a=i.getRange(),s=i.cursor.row;s===A+1?A=(E=A+1)+2*D:s===E-1?E=(A=E-1)-2*D:(sA+1)&&(E=s>D?s-D:0,A=s>D?s+D:2*D);for(var l=[],c=E;c<=A;c++)l.push(t.session.getLine(c));if(r=l.join("\n"),e=R(a.start.row,a.start.column),o=R(a.end.row,a.end.column),a.start.rowA){var u=t.session.getLine(A+1);o=a.end.row>A+1?u.length:a.end.column,o+=r.length+1,r=r+"\n"+u}else y&&s>0&&(r="\n"+r,o+=1,e+=1);r.length>p&&(e0&&M[h]==e[h];)h++,s--;for(c=c.slice(h),h=1;l>0&&M.length-h>T-1&&M[M.length-h]==e[e.length-h];)h++,l--;d-=h-1,u-=h-1;var p=c.length-h+1;if(p<0&&(s=-p,p=0),c=c.slice(0,p),!(o||c||d||s||l||u))return"";k=!0;var f=!1;return a.isAndroid&&". "==c&&(c=" ",f=!0),c&&!s&&!l&&!d&&!u||x?t.onTextInput(c):t.onTextInput(c,{extendLeft:s,extendRight:l,restoreStart:d,restoreEnd:u}),k=!1,M=e,T=r,L=i,C=u,f?"\n":c},H=function(e){if(_)return z();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var o=n.value,r=Y(o,!0);(o.length>500||b.test(r)||y&&T<1&&T==L)&&O()},I=function(e,t,n){var o=e.clipboardData||window.clipboardData;if(o&&!d){var r=u||n?"Text":"text/plain";try{return t?!1!==o.setData(r,t):o.getData(r)}catch(e){if(!n)return I(e,t,!0)}}},F=function(e,i){var a=t.getCopyText();if(!a)return r.preventDefault(e);I(e,a)?(g&&(O(a),o=a,setTimeout((function(){o=!1}),10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(o=!0,n.value=a,n.select(),setTimeout((function(){o=!1,O(),i?t.onCut():t.onCopy()})))},B=function(e){F(e,!0)},$=function(e){F(e,!1)},W=function(e){var o=I(e);c.pasteCancelled()||("string"==typeof o?(o&&t.onPaste(o,e),a.isIE&&setTimeout(O),r.preventDefault(e)):(n.value="",v=!0))};r.addCommandKeyListener(n,(function(e,n,o){if(!_)return t.onCommandKey(e,n,o)}),t),r.addListener(n,"select",(function(e){_||(o?o=!1:!function(e){return 0===e.selectionStart&&e.selectionEnd>=M.length&&e.value===M&&M&&e.selectionEnd!==L}(n)?y&&n.selectionStart!=T&&O():(t.selectAll(),O()))}),t),r.addListener(n,"input",H,t),r.addListener(n,"cut",B,t),r.addListener(n,"copy",$,t),r.addListener(n,"paste",W,t),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",(function(e){if((!a.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:$(e);break;case 86:W(e);break;case 88:B(e)}}),t);var z=function(){if(_&&t.onCompositionUpdate&&!t.$readOnly){if(x)return U();if(_.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;Y(e),_.markerRange&&(_.context&&(_.markerRange.start.column=_.selectionStart=_.context.compositionStartOffset),_.markerRange.end.column=_.markerRange.start.column+L-_.selectionStart+C)}}},G=function(e){t.onCompositionEnd&&!t.$readOnly&&(_=!1,t.onCompositionEnd(),t.off("mousedown",U),e&&H())};function U(){S=!0,n.blur(),n.focus(),S=!1}var V,K=l.delayedCall(z,50).schedule.bind(null,null);function q(){clearTimeout(V),V=setTimeout((function(){w&&(n.style.cssText=w,w=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()}),0)}r.addListener(n,"compositionstart",(function(e){if(!_&&t.onCompositionStart&&!t.$readOnly&&(_={},!x)){e.data&&(_.useTextareaForIME=!1),setTimeout(z,0),t._signal("compositionStart"),t.on("mousedown",U);var o=t.getSelectionRange();o.end.row=o.start.row,o.end.column=o.start.column,_.markerRange=o,_.selectionStart=T,t.onCompositionStart(_),_.useTextareaForIME?(M=n.value="",T=0,L=0):(n.msGetInputContext&&(_.context=n.msGetInputContext()),n.getInputContext&&(_.context=n.getInputContext()))}}),t),r.addListener(n,"compositionupdate",z,t),r.addListener(n,"keyup",(function(e){27==e.keyCode&&n.value.lengthL&&"\n"==M[a]?s=f.end:rL&&M.slice(0,a).split("\n").length>2?s=f.down:a>L&&" "==M[a-1]?(s=f.right,l=m.option):(a>L||a==L&&L!=T&&r==a)&&(s=f.right),r!==a&&(l|=m.shift),s){if(!t.onCommandKey({},l,s)&&t.commands){s=f.keyCodeToString(s);var c=t.commands.findKeyCommand(l,s);c&&t.execCommand(c)}T=r,L=a,O("")}}};document.addEventListener("selectionchange",a),t.on("destroy",(function(){document.removeEventListener("selectionchange",a)}))}(0,t,n),this.destroy=function(){n.parentElement&&n.parentElement.removeChild(n)}},t.TextInput=o,t.$setUserAgentForTests=function(e,t){y=e,g=t}})),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],(function(e,t,n){"use strict";var o=e("../lib/useragent"),r=function(){function e(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach((function(t){e[t]=this[t]}),this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}return e.prototype.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var r=this.editor,i=e.getButton();return 0!==i?((r.getSelectionRange().isEmpty()||1==i)&&r.selection.moveToPosition(n),void(2==i&&(r.textInput.onContextMenu(e.domEvent),o.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||r.isFocused()||(r.focus(),!this.$focusTimeout||this.$clickSelection||r.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},e.prototype.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.setStyle("ace_selecting"),this.setState("select"))},e.prototype.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(n);if(-1==o)e=this.$clickSelection.end;else if(1==o)e=this.$clickSelection.start;else{var r=i(this.$clickSelection,n);n=r.cursor,e=r.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},e.prototype.extendSelectionBy=function(e){var t,n=this.editor,o=n.renderer.screenToTextCoordinates(this.x,this.y),r=n.selection[e](o.row,o.column);if(this.$clickSelection){var a=this.$clickSelection.comparePoint(r.start),s=this.$clickSelection.comparePoint(r.end);if(-1==a&&s<=0)t=this.$clickSelection.end,r.end.row==o.row&&r.end.column==o.column||(o=r.start);else if(1==s&&a>=0)t=this.$clickSelection.start,r.start.row==o.row&&r.start.column==o.column||(o=r.end);else if(-1==a&&1==s)o=r.end,t=r.start;else{var l=i(this.$clickSelection,o);o=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(o),n.renderer.scrollCursorIntoView()},e.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},e.prototype.focusWait=function(){var e,t,n,o,r=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,o=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(o-t,2))),i=Date.now();(r>0||i-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},e.prototype.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,o=n.session.getBracketRange(t);o?(o.isEmpty()&&(o.start.column--,o.end.column++),this.setState("select")):(o=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=o,this.select()},e.prototype.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var o=n.getSelectionRange();o.isMultiLine()&&o.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(o.start.row),this.$clickSelection.end=n.selection.getLineRange(o.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},e.prototype.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},e.prototype.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,o=e.domEvent.timeStamp,r=o-n.t,i=r?e.wheelX/r:n.vx,a=r?e.wheelY/r:n.vy;r<550&&(i=(i+n.vx)/2,a=(a+n.vy)/2);var s=Math.abs(i/a),l=!1;if(s>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),s<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l)n.allowed=o;else if(o-n.allowed<550){Math.abs(i)<=1.5*Math.abs(n.vx)&&Math.abs(a)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=o):n.allowed=0}return n.t=o,n.vx=i,n.vy=a,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}},e}();function i(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else var n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}r.prototype.selectEnd=r.prototype.selectByLinesEnd,r.prototype.selectAllEnd=r.prototype.selectByLinesEnd,r.prototype.selectByWordsEnd=r.prototype.selectByLinesEnd,t.DefaultHandlers=r})),ace.define("ace/lib/scroll",["require","exports","module"],(function(e,t,n){t.preventParentScroll=function(e){e.stopPropagation();var t=e.currentTarget;t.scrollHeight>t.clientHeight||e.preventDefault()}})),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],(function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=e("./lib/dom"),s=(e("./lib/event"),e("./range").Range),l=e("./lib/scroll").preventParentScroll,c="ace_tooltip",d=function(){function e(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}return e.prototype.$init=function(){return this.$element=a.createElement("div"),this.$element.className=c,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},e.prototype.getElement=function(){return this.$element||this.$init()},e.prototype.setText=function(e){this.getElement().textContent=e},e.prototype.setHtml=function(e){this.getElement().innerHTML=e},e.prototype.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},e.prototype.setClassName=function(e){a.addCssClass(this.getElement(),e)},e.prototype.setTheme=function(e){this.$element.className=c+" "+(e.isDark?"ace_dark ":"")+(e.cssClass||"")},e.prototype.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},e.prototype.hide=function(e){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=c,this.isOpen=!1)},e.prototype.getHeight=function(){return this.getElement().offsetHeight},e.prototype.getWidth=function(){return this.getElement().offsetWidth},e.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},e}(),u=new(function(){function e(){this.popups=[]}return e.prototype.addPopup=function(e){this.popups.push(e),this.updatePopups()},e.prototype.removePopup=function(e){var t=this.popups.indexOf(e);-1!==t&&(this.popups.splice(t,1),this.updatePopups())},e.prototype.updatePopups=function(){var e,t,n,o;this.popups.sort((function(e,t){return t.priority-e.priority}));var r=[];try{for(var a=i(this.popups),s=a.next();!s.done;s=a.next()){var l=s.value,c=!0;try{for(var d=(n=void 0,i(r)),u=d.next();!u.done;u=d.next()){var h=u.value;if(this.doPopupsOverlap(h,l)){c=!1;break}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}c?r.push(l):l.hide()}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}},e.prototype.doPopupsOverlap=function(e,t){var n=e.getElement().getBoundingClientRect(),o=t.getElement().getBoundingClientRect();return n.lefto.left&&n.topo.top},e}());t.popupManager=u,t.Tooltip=d;var h=function(e){function t(t){void 0===t&&(t=document.body);var n=e.call(this,t)||this;n.timeout=void 0,n.lastT=0,n.idleTime=350,n.lastEvent=void 0,n.onMouseOut=n.onMouseOut.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.waitForHover=n.waitForHover.bind(n),n.hide=n.hide.bind(n);var o=n.getElement();return o.style.whiteSpace="pre-wrap",o.style.pointerEvents="auto",o.addEventListener("mouseout",n.onMouseOut),o.tabIndex=-1,o.addEventListener("blur",function(){o.contains(document.activeElement)||this.hide()}.bind(n)),o.addEventListener("wheel",l),n}return r(t,e),t.prototype.addToEditor=function(e){e.on("mousemove",this.onMouseMove),e.on("mousedown",this.hide),e.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},t.prototype.removeFromEditor=function(e){e.off("mousemove",this.onMouseMove),e.off("mousedown",this.hide),e.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},t.prototype.onMouseMove=function(e,t){this.lastEvent=e,this.lastT=Date.now();var n=t.$mouseHandler.isMousePressed;if(this.isOpen){var o=this.lastEvent&&this.lastEvent.getDocumentPosition();this.range&&this.range.contains(o.row,o.column)&&!n&&!this.isOutsideOfText(this.lastEvent)||this.hide()}this.timeout||n||(this.lastEvent=e,this.timeout=setTimeout(this.waitForHover,this.idleTime))},t.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var e=Date.now()-this.lastT;this.idleTime-e>10?this.timeout=setTimeout(this.waitForHover,this.idleTime-e):(this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor))},t.prototype.isOutsideOfText=function(e){var t=e.editor,n=e.getDocumentPosition(),o=t.session.getLine(n.row);if(n.column==o.length){var r=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY),i=t.session.documentToScreenPosition(n.row,n.column);if(i.column!=r.column||i.row!=r.row)return!0}return!1},t.prototype.setDataProvider=function(e){this.$gatherData=e},t.prototype.showForRange=function(e,t,n,o){if(!(o&&o!=this.lastEvent||this.isOpen&&document.activeElement==this.getElement())){var r=e.renderer;this.isOpen||(u.addPopup(this),this.$registerCloseEvents(),this.setTheme(r.theme)),this.isOpen=!0,this.addMarker(t,e.session),this.range=s.fromPoints(t.start,t.end);var i=r.textToScreenCoordinates(t.start.row,t.start.column),a=r.scroller.getBoundingClientRect();i.pageX=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=e("../lib/dom"),s=e("../lib/event"),l=e("../tooltip").Tooltip,c=e("../config").nls;t.GutterHandler=function(e){var t,n,o=e.editor,r=o.renderer.$gutterLayer,i=new d(o);function l(){t&&(t=clearTimeout(t)),i.isOpen&&(i.hideTooltip(),o.off("mousewheel",l))}function c(e){i.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",(function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=r.getRegion(t)){var n=t.getDocumentPosition().row,i=o.session.selection;if(t.getShiftKey())i.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}})),e.editor.setDefaultHandler("guttermousemove",(function(s){var d=s.domEvent.target||s.domEvent.srcElement;if(a.hasCssClass(d,"ace_fold-widget"))return l();i.isOpen&&e.$tooltipFollowsMouse&&c(s),n=s,t||(t=setTimeout((function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row;if(t==o.session.getLength()){var a=o.renderer.pixelToScreenCoordinates(0,n.y).row,s=n.$pos;if(a>o.session.documentToScreenRow(s.row,s.column))return l()}if(i.showTooltip(t),i.isOpen)if(o.on("mousewheel",l),e.$tooltipFollowsMouse)c(n);else{var d=n.getGutterRow(),u=r.$lines.get(d);if(u){var h=u.element.querySelector(".ace_gutter_annotation").getBoundingClientRect(),p=i.getElement().style;p.left=h.right+"px",p.top=h.bottom+"px"}else c(n)}}():l()}),50))})),s.addListener(o.renderer.$gutter,"mouseout",(function(e){n=null,i.isOpen&&!t&&(t=setTimeout((function(){t=null,l()}),50))}),o),o.on("changeSession",l),o.on("input",l)};var d=function(e){function t(t){var n=e.call(this,t.container)||this;return n.editor=t,n}return r(t,e),t.prototype.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight,r=this.getWidth(),i=this.getHeight();(e+=15)+r>n&&(e-=e+r-n),(t+=15)+i>o&&(t-=20+i),l.prototype.setPosition.call(this,e,t)},Object.defineProperty(t,"annotationLabels",{get:function(){return{error:{singular:c("gutter-tooltip.aria-label.error.singular","error"),plural:c("gutter-tooltip.aria-label.error.plural","errors")},warning:{singular:c("gutter-tooltip.aria-label.warning.singular","warning"),plural:c("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:c("gutter-tooltip.aria-label.info.singular","information message"),plural:c("gutter-tooltip.aria-label.info.plural","information messages")}}},enumerable:!1,configurable:!0}),t.prototype.showTooltip=function(e){var n,o=this.editor.renderer.$gutterLayer,r=o.$annotations[e];n=r?{text:Array.from(r.text),type:Array.from(r.type)}:{text:[],type:[]};var i=o.session.getFoldLine(e);if(i&&o.$showFoldedAnnotations){for(var a,s={error:[],warning:[],info:[]},l=e+1;l<=i.end.row;l++)if(o.$annotations[l])for(var c=0;c ").concat(n.text[l]);h[n.type[l].replace("_fold","")].push(f)}var m=[].concat(h.error,h.warning,h.info).join("
");this.setHtml(m),this.$element.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},t.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},t.annotationsToSummaryString=function(e){var n,o,r=[];try{for(var a=i(["error","warning","info"]),s=a.next();!s.done;s=a.next()){var l=s.value;if(e[l].length){var c=1===e[l].length?t.annotationLabels[l].singular:t.annotationLabels[l].plural;r.push("".concat(e[l].length," ").concat(c))}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return r.join(", ")},t}(l);t.GutterTooltip=d})),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,n){"use strict";var o=e("../lib/event"),r=e("../lib/useragent"),i=function(){function e(e,t){this.speed,this.wheelX,this.wheelY,this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return e.prototype.stopPropagation=function(){o.stopPropagation(this.domEvent),this.propagationStopped=!0},e.prototype.preventDefault=function(){o.preventDefault(this.domEvent),this.defaultPrevented=!0},e.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},e.prototype.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},e.prototype.getGutterRow=function(){var e=this.getDocumentPosition().row;return this.editor.session.documentToScreenRow(e,0)-this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0)},e.prototype.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},e.prototype.getButton=function(){return o.getButton(this.domEvent)},e.prototype.getShiftKey=function(){return this.domEvent.shiftKey},e.prototype.getAccelKey=function(){return r.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},e}();t.MouseEvent=i})),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],(function(e,t,n){"use strict";var o=e("../lib/dom"),r=e("../lib/event"),i=e("../lib/useragent");function a(e){var t=e.editor,n=o.createElement("div");n.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",n.textContent=" ";["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(t){e[t]=this[t]}),this),t.on("mousedown",this.onMouseDown.bind(e));var a,l,c,d,u,h,p,f,m,g,b,y=t.container,v=0;function _(){var e=h;(function(e,n){var o=Date.now(),r=!n||e.row!=n.row,i=!n||e.column!=n.column;!g||r||i?(t.moveCursorToPosition(e),g=o,b={x:l,y:c}):s(b.x,b.y,l,c)>5?g=null:o-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(h=t.renderer.screenToTextCoordinates(l,c),e),function(e,n){var o=Date.now(),r=t.renderer.layerConfig.lineHeight,i=t.renderer.layerConfig.characterWidth,a=t.renderer.scroller.getBoundingClientRect(),s={x:{left:l-a.left,right:a.right-l},y:{top:c-a.top,bottom:a.bottom-c}},d=Math.min(s.x.left,s.x.right),u=Math.min(s.y.top,s.y.bottom),h={row:e.row,column:e.column};d/i<=2&&(h.column+=s.x.left=200&&t.renderer.scrollCursorIntoView(h):m=o:m=null}(h,e)}function k(){u=t.selection.toOrientedRange(),a=t.session.addMarker(u,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(d),_(),d=setInterval(_,20),v=0,r.addListener(document,"mousemove",S)}function w(){clearInterval(d),t.session.removeMarker(a),a=null,t.selection.fromOrientedRange(u),t.isFocused()&&!f&&t.$resetCursorStyle(),u=null,h=null,v=0,m=null,g=null,r.removeListener(document,"mousemove",S)}this.onDragStart=function(e){if(this.cancelDrag||!y.draggable){var o=this;return setTimeout((function(){o.startSelect(),o.captureMouse(e)}),0),e.preventDefault()}u=t.getSelectionRange();var r=e.dataTransfer;r.effectAllowed=t.getReadOnly()?"copy":"copyMove",t.container.appendChild(n),r.setDragImage&&r.setDragImage(n,0,0),setTimeout((function(){t.container.removeChild(n)})),r.clearData(),r.setData("Text",t.session.getTextRange()),f=!0,this.setState("drag")},this.onDragEnd=function(e){if(y.draggable=!1,f=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;p||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&M(e.dataTransfer))return l=e.clientX,c=e.clientY,a||k(),v++,e.dataTransfer.dropEffect=p=T(e),r.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&M(e.dataTransfer))return l=e.clientX,c=e.clientY,a||(k(),v++),null!==x&&(x=null),e.dataTransfer.dropEffect=p=T(e),r.preventDefault(e)},this.onDragLeave=function(e){if(--v<=0&&a)return w(),p=null,r.preventDefault(e)},this.onDrop=function(e){if(h){var n=e.dataTransfer;if(f)switch(p){case"move":u=u.contains(h.row,h.column)?{start:h,end:h}:t.moveText(u,h);break;case"copy":u=t.moveText(u,h,!0)}else{var o=n.getData("Text");u={start:h,end:t.session.insert(h,o)},t.focus(),p=null}return w(),r.preventDefault(e)}},r.addListener(y,"dragstart",this.onDragStart.bind(e),t),r.addListener(y,"dragend",this.onDragEnd.bind(e),t),r.addListener(y,"dragenter",this.onDragEnter.bind(e),t),r.addListener(y,"dragover",this.onDragOver.bind(e),t),r.addListener(y,"dragleave",this.onDragLeave.bind(e),t),r.addListener(y,"drop",this.onDrop.bind(e),t);var x=null;function S(){null==x&&(x=setTimeout((function(){null!=x&&a&&w()}),20))}function M(e){var t=e.types;return!t||Array.prototype.some.call(t,(function(e){return"text/plain"==e||"Text"==e}))}function T(e){var t=["copy","copymove","all","uninitialized"],n=i.isMac?e.altKey:e.ctrlKey,o="uninitialized";try{o=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var r="none";return n&&t.indexOf(o)>=0?r="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(o)>=0?r="move":t.indexOf(o)>=0&&(r="copy"),r}}function s(e,t,n,o){return Math.sqrt(Math.pow(n-e,2)+Math.pow(o-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=i.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;i.isIE&&"dragReady"==this.state&&(s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop());"dragWait"===this.state&&(s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition())))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),o=e.getButton();if(1===(e.domEvent.detail||1)&&0===o&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var r=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in r&&(r.unselectable="on"),t.getDragDelay()){if(i.isWebKit)this.cancelDrag=!0,t.container.draggable=!0;this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(a.prototype),t.DragdropHandler=a})),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],(function(e,t,n){"use strict";var o=e("./mouse_event").MouseEvent,r=e("../lib/event"),i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,a,s,l,c,d,u,h,p,f="scroll",m=0,g=0,b=0,y=0;function v(){var e=window.navigator&&window.navigator.clipboard,n=!1,o=function(o){var r,a,s=o.target.getAttribute("action");if("more"==s||!n)return n=!n,r=t.getCopyText(),a=t.session.getUndoManager().hasUndo(),void p.replaceChild(i.buildDom(n?["span",!r&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],r&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],r&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],a&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),p.firstChild);"paste"==s?e.readText().then((function(e){t.execCommand(s,e)})):s&&("cut"!=s&&"copy"!=s||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(s)),p.firstChild.style.display="none",n=!1,"openCommandPalette"!=s&&t.focus()};p=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),o(e)},onclick:o},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container)}function _(){p||v();var e=t.selection.cursor,n=t.renderer.textToScreenCoordinates(e.row,e.column),o=t.renderer.textToScreenCoordinates(0,0).pageX,r=t.renderer.scrollLeft,i=t.container.getBoundingClientRect();p.style.top=n.pageY-i.top-3+"px",n.pageX-i.left1)return clearTimeout(c),c=null,s=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var i=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,p=e.timeStamp;l=p;var v=r[0],_=v.clientX,k=v.clientY;Math.abs(n-_)+Math.abs(a-k)>i&&(s=-1),n=e.clientX=_,a=e.clientY=k,b=y=0;var x=new o(e,t);if(u=x.getDocumentPosition(),p-s<500&&1==r.length&&!m)g++,e.preventDefault(),e.button=0,function(){c=null,clearTimeout(c),t.selection.moveToPosition(u);var e=g>=2?t.selection.getLineRange(u.row):t.session.getBracketRange(u);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{g=0;var S=t.selection.cursor,M=t.selection.isEmpty()?S:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(S,!0),L=t.renderer.$cursorLayer.getPixelPosition(M,!0),C=t.renderer.scroller.getBoundingClientRect(),E=t.renderer.layerConfig.offset,A=t.renderer.scrollLeft,D=function(e,t){return(e/=d)*e+(t=t/i-.75)*t};if(e.clientXR?"cursor":"anchor"),f=R<3.5?"anchor":P<3.5?"cursor":"scroll",c=setTimeout(w,450)}s=p}),t),r.addListener(e,"touchend",(function(e){h=t.$mouseHandler.isMousePressed=!1,d&&clearInterval(d),"zoom"==f?(f="",m=0):c?(t.selection.moveToPosition(u),m=0,_()):"scroll"==f?(m+=60,d=setInterval((function(){m--<=0&&(clearInterval(d),d=null),Math.abs(b)<.01&&(b=0),Math.abs(y)<.01&&(y=0),m<20&&(b*=.9),m<20&&(y*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*b,10*y),e==t.session.getScrollTop()&&(m=0)}),10),k()):_(),clearTimeout(c),c=null}),t),r.addListener(e,"touchmove",(function(e){c&&(clearTimeout(c),c=null);var r=e.touches;if(!(r.length>1||"zoom"==f)){var i=r[0],s=n-i.clientX,d=a-i.clientY;if("wait"==f){if(!(s*s+d*d>4))return e.preventDefault();f="cursor"}n=i.clientX,a=i.clientY,e.clientX=i.clientX,e.clientY=i.clientY;var u=e.timeStamp,h=u-l;if(l=u,"scroll"==f){var p=new o(e,t);p.speed=1,p.wheelX=s,p.wheelY=d,10*Math.abs(s)=e){for(i=u+1;i=e;)i++;for(s=u,l=i-1;s=t.length||(l=n[r-1])!=h&&l!=p||(c=t[r+1])!=h&&c!=p?f:(i&&(c=p),c==l?c:f);case _:return(l=r>0?n[r-1]:m)==h&&r+10&&n[r-1]==h)return h;if(i)return f;for(A=r+1,E=t.length;A=1425&&P<=2303||64286==P;if(l=t[A],R&&(l==u||l==b))return u}return r<1||(l=t[r-1])==m?f:n[r-1];case m:return i=!1,a=!0,o;case g:return s=!0,f;case x:case S:case T:case L:case M:i=!1;case C:return f}}function R(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?d:E[t]:5==n?/[\u0591-\u05f4]/.test(e)?u:d:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?w:/[\u0660-\u0669\u066b-\u066c]/.test(e)?p:1642==t?k:/[\u06f0-\u06f9]/.test(e)?h:b:32==n&&t<=8287?A[255&t]:254==n&&t>=65136?b:f}t.L=d,t.R=u,t.EN=h,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,d){if(e.length<2)return{};var h=e.split(""),v=new Array(h.length),_=new Array(h.length),k=[];o=d?1:0,function(e,t,n,d){var u=o?c:l,h=null,p=null,f=null,b=0,v=null,_=-1,k=null,w=null,x=[];if(!d)for(k=0,d=[];k0)if(16==v){for(k=_;k-1){for(k=_;k=0&&d[S]==y;S--)t[S]=o}}(h,k,h.length,n);for(var w=0;wb&&n[w]0&&"ل"===h[w-1]&&/\u0622|\u0623|\u0625|\u0627/.test(h[w])&&(k[w-1]=k[w]=t.R_H,w++);h[h.length-1]===t.DOT&&(k[h.length-1]=t.B),"‫"===h[0]&&(k[0]=t.RLE);for(w=0;w=0&&(e=this.session.$docRowCache[n])}return e},e.prototype.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,o=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===o;)o=n,e++;else e=this.currentRow;return e},e.prototype.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var i=this.session.$wrapData[e];i&&(void 0===t&&(t=this.getSplitIndex()),t>0&&i.length?(this.wrapIndent=i.indent,this.wrapOffset=this.wrapIndent*this.charWidths[o.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,r=o.getVisualFromLogicalIdx(n,this.bidiMap),i=this.bidiMap.bidiLevels,a=0;!this.session.getOverwrite()&&e<=t&&i[r]%2!=0&&r++;for(var s=0;st&&i[r]%2==0&&(a+=this.charWidths[i[r]]),this.wrapIndent&&(a+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(a+=this.rtlLineOffset),a},e.prototype.getSelections=function(e,t){var n,o=this.bidiMap,r=o.bidiLevels,i=[],a=0,s=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,c=!1,d=!1,u=0;this.wrapIndent&&(a+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var h,p=0;p=s&&hn+i/2;){if(n+=i,o===r.length-1){i=0;break}i=this.charWidths[r[++o]]}return o>0&&r[o-1]%2!=0&&r[o]%2==0?(e0&&r[o-1]%2==0&&r[o]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[o]:this.bidiMap.logicalFromVisual[o-1]):this.isRtlDir&&o===r.length-1&&0===i&&r[o-1]%2==0||!this.isRtlDir&&0===o&&r[o]%2!=0?t=1+this.bidiMap.logicalFromVisual[o]:(o>0&&r[o-1]%2!=0&&0!==i&&o--,t=this.bidiMap.logicalFromVisual[o]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent},e}();t.BidiHandler=a})),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],(function(e,t,n){"use strict";var o=e("./lib/oop"),r=e("./lib/lang"),i=e("./lib/event_emitter").EventEmitter,a=e("./range").Range,s=function(){function e(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",(function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)})),this.anchor.on("change",(function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")}))}return e.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},e.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},e.prototype.getCursor=function(){return this.lead.getPosition()},e.prototype.setAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},e.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},e.prototype.getSelectionLead=function(){return this.lead.getPosition()},e.prototype.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},e.prototype.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?a.fromPoints(t,t):this.isBackwards()?a.fromPoints(t,e):a.fromPoints(e,t)},e.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},e.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},e.prototype.setRange=function(e,t){var n=t?e.end:e.start,o=t?e.start:e.end;this.$setSelection(n.row,n.column,o.row,o.column)},e.prototype.$setSelection=function(e,t,n,o){if(!this.$silent){var r=this.$isEmpty,i=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,o),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||i)&&this._emit("changeSelection")}},e.prototype.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},e.prototype.selectTo=function(e,t){this.$moveSelection((function(){this.moveCursorTo(e,t)}))},e.prototype.selectToPosition=function(e){this.$moveSelection((function(){this.moveCursorToPosition(e)}))},e.prototype.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},e.prototype.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},e.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},e.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},e.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},e.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},e.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},e.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},e.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},e.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},e.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},e.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},e.prototype.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},e.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},e.prototype.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},e.prototype.getLineRange=function(e,t){var n,o="number"==typeof e?e:this.lead.row,r=this.session.getFoldLine(o);return r?(o=r.start.row,n=r.end.row):n=o,!0===t?new a(o,0,n,this.session.getLine(n).length):new a(o,0,n+1,0)},e.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},e.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},e.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},e.prototype.wouldMoveIntoSoftTab=function(e,t,n){var o=e.column,r=e.column+t;return n<0&&(o=e.column-t,r=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(o,r).split(" ").length-1==t},e.prototype.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},e.prototype.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=o)}}this.moveCursorTo(t.row,t.column)},e.prototype.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},e.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},e.prototype.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),o=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(e,t,1);if(r)this.moveCursorTo(r.end.row,r.end.column);else{if(this.session.nonTokenRe.exec(o)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,o=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(i)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},e.prototype.$shortWordEndIndex=function(e){var t,n=0,o=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&o.test(t);)n++;if(n<1)for(r.lastIndex=0;(t=e[n])&&!r.test(t);)if(r.lastIndex=0,n++,o.test(t)){if(n>2){n--;break}for(;(t=e[n])&&o.test(t);)n++;if(n>2)break}}return r.lastIndex=0,n},e.prototype.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),o=n.substring(t),r=this.session.getFoldAt(e,t,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(t==n.length){var i=this.doc.getLength();do{e++,o=this.doc.getLine(e)}while(e0&&/^\s*$/.test(o));n=o.length,/\s+$/.test(o)||(o="")}var i=r.stringReverse(o),a=this.$shortWordEndIndex(i);return this.moveCursorTo(t,n-a)},e.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},e.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},e.prototype.moveCursorBy=function(e,t){var n,o=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(o.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(o.column),o.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=o.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?o.column=this.$desiredColumn:this.$desiredColumn=o.column),0!=e&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var r=this.session.lineWidgets[this.lead.row];e<0?e-=r.rowsAbove||0:e>0&&(e+=r.rowCount-(r.rowsAbove||0))}var i=this.session.screenToDocumentPosition(o.row+e,o.column,n);0!==e&&0===t&&i.row===this.lead.row&&(i.column,this.lead.column),this.moveCursorTo(i.row,i.column+t,0===t)},e.prototype.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},e.prototype.moveCursorTo=function(e,t,n){var o=this.session.getFoldAt(e,t,1);o&&(e=o.start.row,t=o.start.column),this.$keepDesiredColumnOnChange=!0;var r=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(r.charAt(t))&&r.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},e.prototype.moveCursorToScreen=function(e,t,n){var o=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(o.row,o.column,n)},e.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},e.prototype.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},e.prototype.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},e.prototype.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return a.fromPoints(t,n)}catch(e){return a.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},e.prototype.toJSON=function(){if(this.rangeCount)var e=this.ranges.map((function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t}));else(e=this.getRange()).isBackwards=this.isBackwards();return e},e.prototype.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=a.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},e.prototype.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0},e}();s.prototype.setSelectionAnchor=s.prototype.setAnchor,s.prototype.getSelectionAnchor=s.prototype.getAnchor,s.prototype.setSelectionRange=s.prototype.setRange,o.implement(s.prototype,i),t.Selection=s})),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],(function(e,t,n){"use strict";var o=e("./lib/report_error").reportError,r=2e3,i=function(){function e(e){for(var t in this.splitRegex,this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],o=[],r=0,i=this.matchMappings[t]={defaultToken:"text"},a="g",s=[],l=0;l1?this.$applyToken:c.token),u>1&&(/\\\d/.test(c.regex)?d=c.regex.replace(/\\([0-9]+)/g,(function(e,t){return"\\"+(parseInt(t,10)+r+1)})):(u=1,d=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||s.push(c)),i[r]=l,r+=u,o.push(d),c.onMatch||(c.onMatch=null)}}o.length||(i[0]=0,o.push("$")),s.forEach((function(e){e.splitRegex=this.createSplitterRegexp(e.regex,a)}),this),this.regExps[t]=new RegExp("("+o.join(")|(")+")|($)",a)}}return e.prototype.$setMaxTokenCount=function(e){r=0|e},e.prototype.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var o=[],r=0,i=n.length;rd){var b=e.substring(d,g-m.length);h.type==p?h.value+=b:(h.type&&c.push(h),h={type:p,value:b})}for(var y=0;yr){for(u>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});d1&&n[0]!==o&&n.unshift("#tmp",o),{tokens:c,state:n.length?n:o}},e}();i.prototype.reportError=o,t.Tokenizer=i})),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],(function(e,t,n){"use strict";var o,r=e("../lib/deep_copy").deepCopy;(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var o=e[n],r=0;r=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentTokenRow=function(){return this.$row},e.prototype.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},e.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},e.prototype.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new o(this.$row,t,this.$row,t+e.value.length)},e}();t.TokenIterator=r})),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],(function(e,t,n){"use strict";var o,r,i=e("../../lib/oop"),a=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,l=e("../../lib/lang"),c=["text","paren.rparen","rparen","paren","punctuation.operator"],d=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],u={},h={'"':'"',"'":"'"},p=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,u.rangeCount!=e.multiSelect.rangeCount&&(u={rangeCount:e.multiSelect.rangeCount})),u[t])return o=u[t];o=u[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,o){var r=e.end.row-e.start.row;return{text:n+t+o,selection:[0,e.start.column+1,r,e.end.column+(r?0:1)]}};(r=function(e){e=e||{},this.add("braces","insertion",(function(t,n,i,a,s){var c=i.getCursorPosition(),d=a.doc.getLine(c.row);if("{"==s){p(i);var u=i.getSelectionRange(),h=a.doc.getTextRange(u),m=a.getTokenAt(c.row,c.column);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(u,h,"{","}");if(m&&/(?:string)\.quasi|\.xml/.test(m.type)){if([/tag\-(?:open|name)/,/attribute\-name/].some((function(e){return e.test(m.type)}))||/(string)\.quasi/.test(m.type)&&"$"!==m.value[c.column-m.start-1])return;return r.recordAutoInsert(i,a,"}"),{text:"{}",selection:[1,1]}}if(r.isSaneInsertion(i,a))return/[\]\}\)]/.test(d[c.column])||i.inMultiSelectMode||e.braces?(r.recordAutoInsert(i,a,"}"),{text:"{}",selection:[1,1]}):(r.recordMaybeInsert(i,a,"{"),{text:"{",selection:[1,1]})}else if("}"==s){if(p(i),"}"==d.substring(c.column,c.column+1))if(null!==a.$findOpeningBracket("}",{column:c.column+1,row:c.row})&&r.isAutoInsertedClosing(c,d,s))return r.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==s||"\r\n"==s){p(i);var g="";if(r.isMaybeInsertedClosing(c,d)&&(g=l.stringRepeat("}",o.maybeInsertedBrackets),r.clearMaybeInsertedClosing()),"}"===d.substring(c.column,c.column+1)){var b=a.findMatchingBracket({row:c.row,column:c.column+1},"}");if(!b)return null;var y=this.$getIndent(a.getLine(b.row))}else{if(!g)return void r.clearMaybeInsertedClosing();y=this.$getIndent(d)}var v=y+a.getTabString();return{text:"\n"+v+"\n"+y+g,selection:[1,v.length,1,v.length]}}r.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(e,t,n,r,i){var a=r.doc.getTextRange(i);if(!i.isMultiLine()&&"{"==a){if(p(n),"}"==r.doc.getLine(i.start.row).substring(i.end.column,i.end.column+1))return i.end.column++,i;o.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(e,t,n,o,i){if("("==i){p(n);var a=n.getSelectionRange(),s=o.doc.getTextRange(a);if(""!==s&&n.getWrapBehavioursEnabled())return f(a,s,"(",")");if(r.isSaneInsertion(n,o))return r.recordAutoInsert(n,o,")"),{text:"()",selection:[1,1]}}else if(")"==i){p(n);var l=n.getCursorPosition(),c=o.doc.getLine(l.row);if(")"==c.substring(l.column,l.column+1))if(null!==o.$findOpeningBracket(")",{column:l.column+1,row:l.row})&&r.isAutoInsertedClosing(l,c,i))return r.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("parens","deletion",(function(e,t,n,o,r){var i=o.doc.getTextRange(r);if(!r.isMultiLine()&&"("==i&&(p(n),")"==o.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r})),this.add("brackets","insertion",(function(e,t,n,o,i){if("["==i){p(n);var a=n.getSelectionRange(),s=o.doc.getTextRange(a);if(""!==s&&n.getWrapBehavioursEnabled())return f(a,s,"[","]");if(r.isSaneInsertion(n,o))return r.recordAutoInsert(n,o,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){p(n);var l=n.getCursorPosition(),c=o.doc.getLine(l.row);if("]"==c.substring(l.column,l.column+1))if(null!==o.$findOpeningBracket("]",{column:l.column+1,row:l.row})&&r.isAutoInsertedClosing(l,c,i))return r.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("brackets","deletion",(function(e,t,n,o,r){var i=o.doc.getTextRange(r);if(!r.isMultiLine()&&"["==i&&(p(n),"]"==o.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r})),this.add("string_dquotes","insertion",(function(e,t,n,o,r){var i=o.$mode.$quotes||h;if(1==r.length&&i[r]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(r))return;p(n);var a=r,s=n.getSelectionRange(),l=o.doc.getTextRange(s);if(!(""===l||1==l.length&&i[l])&&n.getWrapBehavioursEnabled())return f(s,l,a,a);if(!l){var c=n.getCursorPosition(),d=o.doc.getLine(c.row),u=d.substring(c.column-1,c.column),m=d.substring(c.column,c.column+1),g=o.getTokenAt(c.row,c.column),b=o.getTokenAt(c.row,c.column+1);if("\\"==u&&g&&/escape/.test(g.type))return null;var y,v=g&&/string|escape/.test(g.type),_=!b||/string|escape/.test(b.type);if(m==a)(y=v!==_)&&/string\.end/.test(b.type)&&(y=!1);else{if(v&&!_)return null;if(v&&_)return null;var k=o.$mode.tokenRe;k.lastIndex=0;var w=k.test(u);k.lastIndex=0;var x=k.test(m),S=o.$mode.$pairQuotesAfter;if(!(S&&S[a]&&S[a].test(u))&&w||x)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var M=d[c.column-2];if(u==a&&(M==a||k.test(M)))return null;y=!0}return{text:y?a+a:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(e,t,n,o,r){var i=o.$mode.$quotes||h,a=o.doc.getTextRange(r);if(!r.isMultiLine()&&i.hasOwnProperty(a)&&(p(n),o.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)==a))return r.end.column++,r})),!1!==e.closeDocComment&&this.add("doc comment end","insertion",(function(e,t,n,o,r){if("doc-start"===e&&("\n"===r||"\r\n"===r)&&n.selection.isEmpty()){var i=n.getCursorPosition(),a=o.doc.getLine(i.row),s=o.doc.getLine(i.row+1),l=this.$getIndent(a);if(/\s*\*/.test(s))return/^\s*\*/.test(a)?{text:r+l+"* ",selection:[1,3+l.length,1,3+l.length]}:{text:r+l+" * ",selection:[1,3+l.length,1,3+l.length]};if(/\/\*\*/.test(a.substring(0,i.column)))return{text:r+l+" * "+r+" "+l+"*/",selection:[1,4+l.length,1,4+l.length]}}}))}).isSaneInsertion=function(e,t){var n=e.getCursorPosition(),o=new s(t,n.row,n.column);if(!this.$matchTokenType(o.getCurrentToken()||"text",c)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var r=new s(t,n.row,n.column+1);if(!this.$matchTokenType(r.getCurrentToken()||"text",c))return!1}return o.stepForward(),o.getCurrentTokenRow()!==n.row||this.$matchTokenType(o.getCurrentToken()||"text",d)},r.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},r.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,o.autoInsertedLineEnd[0])||(o.autoInsertedBrackets=0),o.autoInsertedRow=r.row,o.autoInsertedLineEnd=n+i.substr(r.column),o.autoInsertedBrackets++},r.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(o.maybeInsertedBrackets=0),o.maybeInsertedRow=r.row,o.maybeInsertedLineStart=i.substr(0,r.column)+n,o.maybeInsertedLineEnd=i.substr(r.column),o.maybeInsertedBrackets++},r.isAutoInsertedClosing=function(e,t,n){return o.autoInsertedBrackets>0&&e.row===o.autoInsertedRow&&n===o.autoInsertedLineEnd[0]&&t.substr(e.column)===o.autoInsertedLineEnd},r.isMaybeInsertedClosing=function(e,t){return o.maybeInsertedBrackets>0&&e.row===o.maybeInsertedRow&&t.substr(e.column)===o.maybeInsertedLineEnd&&t.substr(0,e.column)==o.maybeInsertedLineStart},r.popAutoInsertedClosing=function(){o.autoInsertedLineEnd=o.autoInsertedLineEnd.substr(1),o.autoInsertedBrackets--},r.clearMaybeInsertedClosing=function(){o&&(o.maybeInsertedBrackets=0,o.maybeInsertedRow=-1)},i.inherits(r,a),t.CstyleBehaviour=r})),ace.define("ace/unicode",["require","exports","module"],(function(e,t,n){"use strict";for(var o=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],r=0,i=[],a=0;a2?o%l!=l-1:o%l==0})}else{if(!this.blockComment)return!1;var p=this.blockComment.start,f=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+c.escapeRegExp(p)+")"),g=new RegExp("(?:"+c.escapeRegExp(f)+")\\s*$"),b=function(e,t){v(e,t)||i&&!/\S/.test(e)||(r.insertInLine({row:t,column:e.length},f),r.insertInLine({row:t,column:s},p))},y=function(e,t){var n;(n=e.match(g))&&r.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&r.removeInLine(t,n[1].length,n[0].length)},v=function(e,n){if(m.test(e))return!0;for(var o=t.getTokens(n),r=0;re.length&&(k=e.length)})),s==1/0&&(s=k,i=!1,a=!1),d&&s%l!=0&&(s=Math.floor(s/l)*l),_(a?y:b)},this.toggleBlockComment=function(e,t,n,o){var r=this.blockComment;if(r){!r.start&&r[0]&&(r=r[0]);var i,a,s=(m=new d(t,o.row,o.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(s&&/comment/.test(s.type)){for(var c,h;s&&/comment/.test(s.type);){if(-1!=(g=s.value.indexOf(r.start))){var p=m.getCurrentTokenRow(),f=m.getCurrentTokenColumn()+g;c=new u(p,f,p,f+r.start.length);break}s=m.stepBackward()}var m;for(s=(m=new d(t,o.row,o.column)).getCurrentToken();s&&/comment/.test(s.type);){var g;if(-1!=(g=s.value.indexOf(r.end))){p=m.getCurrentTokenRow(),f=m.getCurrentTokenColumn()+g;h=new u(p,f,p,f+r.end.length);break}s=m.stepForward()}h&&t.remove(h),c&&(t.remove(c),i=c.start.row,a=-r.start.length)}else a=r.start.length,i=n.start.row,t.insert(n.end,r.end),t.insert(n.start,r.start);l.start.row==i&&(l.start.column+=a),l.end.row==i&&(l.end.column+=a),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],o=n.prototype.$id,i=r.$modes[o];i||(r.$modes[o]=i=new n),r.$modes[t]||(r.$modes[t]=i),this.$embeds.push(t),this.$modes[t]=i}var a=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],s=function(e){var t,n,o;o=(t=l)[n=a[e]],t[a[e]]=function(){return this.$delegator(n,arguments,o)}},l=this;for(t=0;tthis.row)){var t=function(e,t,n){var o="insert"==e.action,r=(o?1:-1)*(e.end.row-e.start.row),i=(o?1:-1)*(e.end.column-e.start.column),s=e.start,l=o?s:e.end;if(a(t,s,n))return{row:t.row,column:t.column};if(a(l,t,!n))return{row:t.row+r,column:t.column+(t.row==l.row?i:0)};return{row:s.row,column:s.column}}(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(t.row,t.column,!0)}},e.prototype.setPosition=function(e,t,n){var o;if(o=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=o.row||this.column!=o.column){var r={row:this.row,column:this.column};this.row=o.row,this.column=o.column,this._signal("change",{old:r,value:o})}},e.prototype.detach=function(){this.document.off("change",this.$onChange)},e.prototype.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},e.prototype.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n},e}();function a(e,t,n){var o=n?e.column<=t.column:e.column=n&&(e=n-1,t=void 0);var o=this.getLine(e);return null==t&&(t=o.length),{row:e,column:t=Math.min(Math.max(t,0),o.length)}},e.prototype.clonePos=function(e){return{row:e.row,column:e.column}},e.prototype.pos=function(e,t){return{row:e,column:t}},e.prototype.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},e.prototype.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,o=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},e.prototype.replace=function(e,t){return e instanceof a||(e=a.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},e.prototype.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},e.prototype.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!a.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(r(this.$lines,e,t),this._signal("change",e)))},e.prototype.$safeApplyDelta=function(e){var t=this.$lines.length;("remove"==e.action&&e.start.row20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==o&&(o=t),i<=o&&n.fireUpdateEvent(i,o)}}}return e.prototype.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},e.prototype.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},e.prototype.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},e.prototype.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},e.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},e.prototype.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var o=Array(n+1);o.unshift(t,1),this.lines.splice.apply(this.lines,o),this.states.splice.apply(this.states,o)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},e.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},e.prototype.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},e.prototype.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},e.prototype.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],o=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=o.state+""?(this.states[e]=o.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=o.tokens},e.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},e}();o.implement(i.prototype,r),t.BackgroundTokenizer=i})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],(function(e,t,n){"use strict";var o=e("./lib/lang"),r=e("./range").Range,i=function(){function e(e,t,n){void 0===n&&(n="text"),this.setRegexp(e),this.clazz=t,this.type=n}return e.prototype.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},e.prototype.update=function(e,t,n,i){if(this.regExp)for(var a=i.firstRow,s=i.lastRow,l={},c=a;c<=s;c++){var d=this.cache[c];null==d&&((d=o.getMatchOffsets(n.getLine(c),this.regExp)).length>this.MAX_RANGES&&(d=d.slice(0,this.MAX_RANGES)),d=d.map((function(e){return new r(c,e.offset,c,e.offset+e.length)})),this.cache[c]=d.length?d:"");for(var u=d.length;u--;){var h=d[u].toScreenRange(n),p=h.toString();l[p]||(l[p]=!0,t.drawSingleLineMarker(e,h,this.clazz,i))}}},e}();i.prototype.MAX_RANGES=500,t.SearchHighlight=i})),ace.define("ace/undomanager",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var o=function(){function e(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return e.prototype.addSession=function(e){this.$session=e},e.prototype.add=function(e,t,n){if(!this.$fromUndo&&e!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),!1===t||!this.lastDeltas){this.lastDeltas=[];var o=this.$undoStack.length;o>this.$undoDepth-1&&this.$undoStack.splice(0,o-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev}"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e)}},e.prototype.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},e.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},e.prototype.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,o=n.length;o--;){var r=n[o][0];if(r.id<=e)break;r.id0},e.prototype.canRedo=function(){return this.$redoStack.length>0},e.prototype.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},e.prototype.isAtBookmark=function(){return this.$rev===this.mark},e.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},e.prototype.fromJSON=function(e){this.reset(),this.$undoStack=e.$undoStack,this.$redoStack=e.$redoStack},e.prototype.$prettyPrint=function(e){return e?s(e):s(this.$undoStack)+"\n---\n"+s(this.$redoStack)},e}();o.prototype.hasUndo=o.prototype.canUndo,o.prototype.hasRedo=o.prototype.canRedo,o.prototype.isClean=o.prototype.isAtBookmark,o.prototype.markClean=o.prototype.bookmark;var r=e("./range").Range,i=r.comparePoints;r.comparePoints;function a(e){return{row:e.row,column:e.column}}function s(e){if(e=e||this,Array.isArray(e))return e.map(s).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function c(e,t){var n="insert"==e.action,o="insert"==t.action;if(n&&o)if(i(t.start,e.end)>=0)h(t,e,-1);else{if(!(i(t.start,e.start)<=0))return null;h(e,t,1)}else if(n&&!o)if(i(t.start,e.end)>=0)h(t,e,-1);else{if(!(i(t.end,e.start)<=0))return null;h(e,t,-1)}else if(!n&&o)if(i(t.start,e.start)>=0)h(t,e,1);else{if(!(i(t.start,e.start)<=0))return null;h(e,t,1)}else if(!n&&!o)if(i(t.start,e.start)>=0)h(t,e,1);else{if(!(i(t.end,e.start)<=0))return null;h(e,t,-1)}return[t,e]}function d(e,t){for(var n=e.length;n--;)for(var o=0;o=0?h(e,t,-1):(i(e.start,t.start)<=0||h(e,r.fromPoints(t.start,e.start),-1),h(t,e,1));else if(!n&&o)i(t.start,e.end)>=0?h(t,e,-1):(i(t.start,e.start)<=0||h(t,r.fromPoints(e.start,t.start),-1),h(e,t,1));else if(!n&&!o)if(i(t.start,e.end)>=0)h(t,e,-1);else{var a,s;if(!(i(t.end,e.start)<=0))return i(e.start,t.start)<0&&(a=e,e=f(e,t.start)),i(e.end,t.end)>0&&(s=f(e,t.end)),p(t.end,e.start,e.end,-1),s&&!a&&(e.lines=s.lines,e.start=s.start,e.end=s.end,s=e),[t,a,s].filter(Boolean);h(e,t,-1)}return[t,e]}function h(e,t,n){p(e.start,t.start,t.end,n),p(e.end,t.start,t.end,n)}function p(e,t,n,o){e.row==(1==o?t:n).row&&(e.column+=o*(n.column-t.column)),e.row+=o*(n.row-t.row)}function f(e,t){var n=e.lines,o=e.end;e.end=a(t);var r=e.end.row-e.start.row,i=n.splice(r,n.length),s=r?t.column:t.column-e.start.column;return n.push(i[0].substring(0,s)),i[0]=i[0].substr(s),{start:a(t),end:o,lines:i,action:e.action}}function m(e,t){t=function(e){return{start:a(e.start),end:a(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var o=e[n],r=0;rthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort((function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)})),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},e.prototype.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},e.prototype.walk=function(e,t,n){var o,r,i=0,a=this.folds,s=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=o(e,a.start);return 0===s?t&&0!==l?-i-2:i:l>0||0===l&&!t?i:-i-1}}return-i-1},e.prototype.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var o=this.pointIndex(e.end,t,n);return o<0?o=-o-1:o++,this.ranges.splice(n,o-n,e)},e.prototype.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},e.prototype.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},e.prototype.merge=function(){for(var e,t=[],n=this.ranges,r=(n=n.sort((function(e,t){return o(e.start,t.start)})))[0],i=1;i=0},e.prototype.containsPoint=function(e){return this.pointIndex(e)>=0},e.prototype.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},e.prototype.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=o)break}if("insert"==e.action)for(var l=r-o,c=-t.column+n.column;ao)break;if(d.start.row==o&&d.start.column>=t.column&&(d.start.column==t.column&&this.$bias<=0||(d.start.column+=c,d.start.row+=l)),d.end.row==o&&d.end.column>=t.column){if(d.end.column==t.column&&this.$bias<0)continue;d.end.column==t.column&&c>0&&ad.start.column&&d.end.column==i[a+1].start.column&&(d.end.column-=c),d.end.column+=c,d.end.row+=l}}else for(l=o-r,c=t.column-n.column;ar)break;d.end.rowt.column)&&(d.end.column=t.column,d.end.row=t.row):(d.end.column+=c,d.end.row+=l):d.end.row>r&&(d.end.row+=l),d.start.rowt.column)&&(d.start.column=t.column,d.start.row=t.row):(d.start.column+=c,d.start.row+=l):d.start.row>r&&(d.start.row+=l)}if(0!=l&&a=e)return r;if(r.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,o=0;for(t&&(o=n.indexOf(t)),-1==o&&(o=0);o=e)return r}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,o=t-e+1,r=0;r=t){s=e?o-=t-s:o=0);break}a>=e&&(o-=s>=e?a-s:a-e+1)}return o},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort((function(e,t){return e.start.row-t.start.row})),e},this.addFold=function(e,t){var n,o=this.$foldData,a=!1;e instanceof i?n=e:(n=new i(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var s=n.start.row,l=n.start.column,c=n.end.row,d=n.end.column,u=this.getFoldAt(s,l,1),h=this.getFoldAt(c,d,-1);if(u&&h==u)return u.addSubFold(n);u&&!u.range.isStart(s,l)&&this.removeFold(u),h&&!h.range.isEnd(c,d)&&this.removeFold(h);var p=this.getFoldsInRange(n.range);p.length>0&&(this.removeFolds(p),n.collapseChildren||p.forEach((function(e){n.addSubFold(e)})));for(var f=0;f0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach((function(e){this.expandFold(e)}),this)},this.unfold=function(e,t){var n,r;if(null==e)n=new o(0,0,this.getLength(),0),null==t&&(t=!0);else if("number"==typeof e)n=new o(e,0,e,this.getLine(e).length);else if("row"in e)n=o.fromPoints(e,e);else{if(Array.isArray(e))return r=[],e.forEach((function(e){r=r.concat(this.unfold(e))}),this),r;n=e}for(var i=r=this.getFoldsInRangeList(n);1==r.length&&o.comparePoints(r[0].start,n.start)<0&&o.comparePoints(r[0].end,n.end)>0;)this.expandFolds(r),r=this.getFoldsInRangeList(n);if(0!=t?this.removeFolds(r):this.expandFolds(r),i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,o,r){null==o&&(o=e.start.row),null==r&&(r=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var i=this.doc,a="";return e.walk((function(e,t,n,s){if(!(td)break}while(i&&l.test(i.type)&&!/^comment.start/.test(i.type));i=r.stepBackward()}else i=r.getCurrentToken();return c.end.row=r.getCurrentTokenRow(),c.end.column=r.getCurrentTokenColumn(),/^comment.end/.test(i.type)||(c.end.column+=i.value.length-2),c}},this.foldAll=function(e,t,n,o){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e&&(i=a.end.row,a.collapseChildren=n,this.addFold("...",a))}}},this.foldToLevel=function(e){for(this.foldAll();e-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,(function(t){for(var n=e.getTokens(t),o=0;o=0;){var i=n[r];if(null==i&&(i=n[r]=this.getFoldWidget(r)),"start"==i){var a=this.getFoldWidgetRange(r);if(o||(o=a),a&&a.end.row>=e)break}r--}return{range:-1!==r&&a,firstRange:o}},this.onFoldWidgetClick=function(e,t){t instanceof s&&(t=t.domEvent);var n={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var o=t.target||t.srcElement;o&&/ace_fold-widget/.test(o.className)&&(o.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),o=this.getLine(e),r="end"===n?-1:1,i=this.getFoldAt(e,-1===r?0:o.length,r);if(i)return t.children||t.all?this.removeFold(i):this.expandFold(i),i;var a=this.getFoldWidgetRange(e,!0);if(a&&!a.isMultiLine()&&(i=this.getFoldAt(a.start.row,a.start.column,1))&&a.isEqual(i.range))return this.removeFold(i),i;if(t.siblings){var s=this.getParentFoldRangeData(e);if(s.range)var l=s.range.start.row+1,c=s.range.end.row;this.foldAll(l,c,t.all?1e4:0)}else t.children?(c=a?a.end.row:this.getLength(),this.foldAll(e+1,c,t.all?1e4:0)):a&&(t.all&&(a.collapseChildren=1e4),this.addFold("...",a));return a}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var o=this.getParentFoldRangeData(t,!0);if(n=o.range||o.firstRange){t=n.start.row;var r=this.getFoldAt(t,this.getLine(t).length,1);r?this.removeFold(r):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var o=Array(n+1);o.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,o)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}})),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],(function(e,t,n){"use strict";var o=e("../token_iterator").TokenIterator,r=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var o=n.match(/([\(\[\{])|([\)\]\}])/);return o?o[1]?this.$findClosingBracket(o[1],e):this.$findOpeningBracket(o[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),o=!0,i=n.charAt(e.column-1),a=i&&i.match(/([\(\[\{])|([\)\]\}])/);if(a||(i=n.charAt(e.column),e={row:e.row,column:e.column+1},a=i&&i.match(/([\(\[\{])|([\)\]\}])/),o=!1),!a)return null;if(a[1]){if(!(s=this.$findClosingBracket(a[1],e)))return null;t=r.fromPoints(e,s),o||(t.end.column++,t.start.column--),t.cursor=t.end}else{var s;if(!(s=this.$findOpeningBracket(a[2],e)))return null;t=r.fromPoints(s,e),o||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(e,t){var n=this.getLine(e.row),o=/([\(\[\{])|([\)\]\}])/,i=!t&&n.charAt(e.column-1),a=i&&i.match(o);if(a||(i=(void 0===t||t)&&n.charAt(e.column),e={row:e.row,column:e.column+1},a=i&&i.match(o)),!a)return null;var s=new r(e.row,e.column-1,e.row,e.column),l=a[1]?this.$findClosingBracket(a[1],e):this.$findOpeningBracket(a[2],e);return l?[s,new r(l.row,l.column,l.row,l.column+1)]:[s]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var r=this.$brackets[e],i=1,a=new o(this,t.row,t.column),s=a.getCurrentToken();if(s||(s=a.stepForward()),s){n||(n=new RegExp("(\\.?"+s.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var l=t.column-a.getCurrentTokenColumn()-2,c=s.value;;){for(;l>=0;){var d=c.charAt(l);if(d==r){if(0==(i-=1))return{row:a.getCurrentTokenRow(),column:l+a.getCurrentTokenColumn()}}else d==e&&(i+=1);l-=1}do{s=a.stepBackward()}while(s&&!n.test(s.type));if(null==s)break;l=(c=s.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var r=this.$brackets[e],i=1,a=new o(this,t.row,t.column),s=a.getCurrentToken();if(s||(s=a.stepForward()),s){n||(n=new RegExp("(\\.?"+s.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var l=t.column-a.getCurrentTokenColumn();;){for(var c=s.value,d=c.length;l"===t.value?o=!0:-1!==t.type.indexOf("tag-name")&&(n=!0))}while(t&&!n);return t},this.$findClosingTag=function(e,t){var n,o=t.value,i=t.value,a=0,s=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);t=e.stepForward();var l=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length),c=!1;do{if(-1!==(n=t).type.indexOf("tag-close")&&!c){var d=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);c=!0}if(t=e.stepForward()){if(">"===t.value&&!c){d=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);c=!0}if(-1!==t.type.indexOf("tag-name")){if(i===(o=t.value))if("<"===n.value)a++;else if(""!==t.value)return;var p=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else if(i===o&&"/>"===t.value&&--a<0)p=h=u=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2),d=new r(l.end.row,l.end.column,l.end.row,l.end.column+1)}}while(t&&a>=0);if(s&&d&&u&&p&&l&&h)return{openTag:new r(s.start.row,s.start.column,d.end.row,d.end.column),closeTag:new r(u.start.row,u.start.column,p.end.row,p.end.column),openTagName:l,closeTagName:h}},this.$findOpeningTag=function(e,t){var n=e.getCurrentToken(),o=t.value,i=0,a=e.getCurrentTokenRow(),s=e.getCurrentTokenColumn(),l=s+2,c=new r(a,s,a,l);e.stepForward();var d=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);if(-1===t.type.indexOf("tag-close")&&(t=e.stepForward()),t&&">"===t.value){var u=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);e.stepBackward(),e.stepBackward();do{if(t=n,a=e.getCurrentTokenRow(),l=(s=e.getCurrentTokenColumn())+t.value.length,n=e.stepBackward(),t)if(-1!==t.type.indexOf("tag-name")){if(o===t.value)if("<"===n.value){if(++i>0){var h=new r(a,s,a,l),p=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);do{t=e.stepForward()}while(t&&">"!==t.value);var f=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else""===t.value){for(var m=0,g=n;g;){if(-1!==g.type.indexOf("tag-name")&&g.value===o){i--;break}if("<"===g.value)break;g=e.stepBackward(),m++}for(var b=0;bn&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},e.prototype.$getRowCacheIndex=function(e,t){for(var n=0,o=e.length-1;n<=o;){var r=n+o>>1,i=e[r];if(t>i)n=r+1;else{if(!(t=t);i++);return(n=o[i])?(n.index=i,n.start=r-n.value.length,n):null},e.prototype.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=r.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},e.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},e.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},e.prototype.getTabString=function(){return this.getUseSoftTabs()?r.stringRepeat(" ",this.getTabSize()):"\t"},e.prototype.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},e.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},e.prototype.setTabSize=function(e){this.setOption("tabSize",e)},e.prototype.getTabSize=function(){return this.$tabSize},e.prototype.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},e.prototype.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},e.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},e.prototype.setOverwrite=function(e){this.setOption("overwrite",e)},e.prototype.getOverwrite=function(){return this.$overwrite},e.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},e.prototype.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},e.prototype.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},e.prototype.getBreakpoints=function(){return this.$breakpoints},e.prototype.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(o=!!n.charAt(t-1).match(this.tokenRe)),o||(o=!!n.charAt(t).match(this.tokenRe)),o)var r=this.tokenRe;else if(/^\s+$/.test(n.slice(t-1,t+1)))r=/\s/;else r=this.nonTokenRe;var i=t;if(i>0){do{i--}while(i>=0&&n.charAt(i).match(r));i++}for(var a=t;ae&&(e=t.screenWidth)})),this.lineWidgetWidth=e},e.prototype.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,o=0,r=0,i=this.$foldData[r],a=i?i.start.row:1/0,s=t.length,l=0;la){if((l=i.end.row+1)>=s)break;a=(i=this.$foldData[r++])?i.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>o&&(o=n[l])}this.screenWidth=o}},e.prototype.getLine=function(e){return this.doc.getLine(e)},e.prototype.getLines=function(e,t){return this.doc.getLines(e,t)},e.prototype.getLength=function(){return this.doc.getLength()},e.prototype.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},e.prototype.insert=function(e,t){return this.doc.insert(e,t)},e.prototype.remove=function(e){return this.doc.remove(e)},e.prototype.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},e.prototype.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var o=e[n];"insert"==o.action||"remove"==o.action?this.doc.revertDelta(o):o.folds&&this.addFolds(o.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},e.prototype.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(i.start.column+=c),i.end.row==e.end.row&&i.end.column>e.end.column&&(i.end.column+=c)),a&&i.start.row>=e.end.row&&(i.start.row+=a,i.end.row+=a)}if(i.end=this.insert(i.start,o),r.length){var s=e.start,l=i.start,c=(a=l.row-s.row,l.column-s.column);this.addFolds(r.map((function(e){return(e=e.clone()).start.row==s.row&&(e.start.column+=c),e.end.row==s.row&&(e.end.column+=c),e.start.row+=a,e.end.row+=a,e})))}return i},e.prototype.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var o=e;o<=t;o++)this.doc.insertInLine({row:o,column:0},n)},e.prototype.outdentRows=function(e){for(var t=e.collapseRows(),n=new d(0,0,0,0),o=this.getTabSize(),r=t.start.row;r<=t.end.row;++r){var i=this.getLine(r);n.start.row=r,n.end.row=r;for(var a=0;a0){var r;if((r=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;o=r-t}else{e=this.$clipRowToDocument(e);o=(t=this.$clipRowToDocument(t))-e+1}var i=new d(e,0,t,Number.MAX_VALUE),a=this.getFoldsInRange(i).map((function(e){return(e=e.clone()).start.row+=o,e.end.row+=o,e})),s=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+o,s),a.length&&this.addFolds(a),o},e.prototype.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},e.prototype.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},e.prototype.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},e.prototype.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},e.prototype.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},e.prototype.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},e.prototype.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},e.prototype.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},e.prototype.getUseWrapMode=function(){return this.$useWrapMode},e.prototype.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},e.prototype.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var o=this.$constrainWrapLimit(e,n.min,n.max);return o!=this.$wrapLimit&&o>1&&(this.$wrapLimit=o,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},e.prototype.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},e.prototype.getWrapLimit=function(){return this.$wrapLimit},e.prototype.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},e.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},e.prototype.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,o=e.start,r=e.end,i=o.row,a=r.row,s=a-i,l=null;if(this.$updating=!0,0!=s)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(i,s);var c=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var d=0;if(m=this.getFoldLine(r.row)){m.addRemoveChars(r.row,r.column,o.column-r.column),m.shiftRow(-s);var u=this.getFoldLine(i);u&&u!==m&&(u.merge(m),m=u),d=c.indexOf(m)+1}for(;d=r.row&&m.shiftRow(-s)}a=i}else{var h=Array(s);h.unshift(i,0);var p=t?this.$wrapData:this.$rowLengthCache;p.splice.apply(p,h);c=this.$foldData,d=0;if(m=this.getFoldLine(i)){var f=m.range.compareInside(o.row,o.column);0==f?(m=m.split(o.row,o.column))&&(m.shiftRow(s),m.addRemoveChars(a,0,r.column-o.column)):-1==f&&(m.addRemoveChars(i,0,r.column-o.column),m.shiftRow(s)),d=c.indexOf(m)+1}for(;d=i&&m.shiftRow(s)}}else s=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),s=-s),(m=this.getFoldLine(i))&&m.addRemoveChars(i,o.column,s);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(i,a):this.$updateRowLengthCache(i,a),l},e.prototype.$updateRowLengthCache=function(e,t){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},e.prototype.$updateWrapData=function(e,t){var n,o,r=this.doc.getAllLines(),i=this.getTabSize(),a=this.$wrapData,s=this.$wrapLimit,l=e;for(t=Math.min(t,r.length-1);l<=t;)(o=this.getFoldLine(l,o))?(n=[],o.walk(function(e,t,o,i){var a;if(null!=e){(a=this.$getDisplayTokens(e,n.length))[0]=y;for(var s=1;st-u;){var h=i+t-u;if(e[h-1]>=k&&e[h]>=k)d(h);else if(e[h]!=y&&e[h]!=v){for(var p=Math.max(h-(t-(t>>2)),i-1);h>p&&e[h]p&&e[h]p&&e[h]==_;)h--}else for(;h>p&&e[h]p?d(++h):(e[h=i+t]==b&&h--,d(h-u))}else{for(;h!=i-1&&e[h]!=y;h--);if(h>i){d(h);continue}for(h=i+t;h39&&i<48||i>57&&i<64?o.push(_):i>=4352&&S(i)?o.push(g,b):o.push(g)}return o},e.prototype.$getStringScreenWidth=function(e,t,n){if(0==t)return[0,0];var o,r;for(null==t&&(t=1/0),n=n||0,r=0;r=4352&&S(o)?n+=2:n+=1,!(n>t));r++);return[n,r]},e.prototype.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+t:t},e.prototype.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},e.prototype.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){s=c[d],i=this.$docRowCache[d];var h=e>c[u-1]}else h=!u;for(var p=this.getLength()-1,f=this.getNextFoldLine(i),m=f?f.start.row:1/0;s<=e&&!(s+(l=this.getRowLength(i))>e||i>=p);)s+=l,++i>m&&(i=f.end.row+1,m=(f=this.getNextFoldLine(i,f))?f.start.row:1/0),h&&(this.$docRowCache.push(i),this.$screenRowCache.push(s));if(f&&f.start.row<=i)o=this.getFoldDisplayLine(f),i=f.start.row;else{if(s+l<=e||i>p)return{row:p,column:this.getLine(p).length};o=this.getLine(i),f=null}var g=0,b=Math.floor(e-s);if(this.$useWrapMode){var y=this.$wrapData[i];y&&(r=y[b],b>0&&y.length&&(g=y.indent,a=y[b-1]||y[y.length-1],o=o.substring(a)))}return void 0!==n&&this.$bidiHandler.isBidiRow(s+b,i,b)&&(t=this.$bidiHandler.offsetToCol(n)),a+=this.$getStringScreenWidth(o,t-g)[1],this.$useWrapMode&&a>=r&&(a=r-1),f?f.idxToPosition(a):{row:i,column:a}},e.prototype.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var o,r=0,i=null;(o=this.getFoldAt(e,t,1))&&(e=o.start.row,t=o.start.column);var a,s=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,e),d=l.length;if(d&&c>=0){s=l[c],r=this.$screenRowCache[c];var u=e>l[d-1]}else u=!d;for(var h=this.getNextFoldLine(s),p=h?h.start.row:1/0;s=p){if((a=h.end.row+1)>e)break;p=(h=this.getNextFoldLine(a,h))?h.start.row:1/0}else a=s+1;r+=this.getRowLength(s),s=a,u&&(this.$docRowCache.push(s),this.$screenRowCache.push(r))}var f="";h&&s>=p?(f=this.getFoldDisplayLine(h,e,t),i=h.start.row):(f=this.getLine(e).substring(0,t),i=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[i];if(g){for(var b=0;f.length>=g[b];)r++,b++;f=f.substring(g[b-1]||0,f.length),m=b>0?g.indent:0}}return this.lineWidgets&&this.lineWidgets[s]&&this.lineWidgets[s].rowsAbove&&(r+=this.lineWidgets[s].rowsAbove),{row:r,column:m+this.$getStringScreenWidth(f)[0]}},e.prototype.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},e.prototype.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},e.prototype.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,o=0,r=(s=0,(t=this.$foldData[s++])?t.start.row:1/0);or&&(o=t.end.row+1,r=(t=this.$foldData[s++])?t.start.row:1/0)}else{e=this.getLength();for(var a=this.$foldData,s=0;sn);i++);return[o,i]})},e.prototype.getPrecedingCharacter=function(){var e=this.selection.getCursor();return 0===e.column?0===e.row?"":this.doc.getNewLineCharacter():this.getLine(e.row)[e.column-1]},e.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},e}();m.$uid=0,m.prototype.$modes=a.$modes,m.prototype.getValue=m.prototype.toString,m.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},m.prototype.$overwrite=!1,m.prototype.$mode=null,m.prototype.$modeId=null,m.prototype.$scrollTop=0,m.prototype.$scrollLeft=0,m.prototype.$wrapLimit=80,m.prototype.$useWrapMode=!1,m.prototype.$wrapLimitRange={min:null,max:null},m.prototype.lineWidgets=null,m.prototype.isFullWidth=S,o.implement(m.prototype,s);var g=1,b=2,y=3,v=4,_=9,k=10,w=11,x=12;function S(e){return!(e<4352)&&(e>=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}e("./edit_session/folding").Folding.call(m.prototype),e("./edit_session/bracket_match").BracketMatch.call(m.prototype),a.defineOptions(m.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=m})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,n){"use strict";var o=e("./lib/lang"),r=e("./lib/oop"),i=e("./range").Range,a=function(){function e(){this.$options={}}return e.prototype.set=function(e){return r.mixin(this.$options,e),this},e.prototype.getOptions=function(){return o.copyObject(this.$options)},e.prototype.setOptions=function(e){this.$options=e},e.prototype.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var o=null;return n.forEach((function(e,n,r,a){return o=new i(e,n,r,a),!(n==a&&t.start&&t.start.start&&0!=t.skipCurrent&&o.isEqual(t.start))||(o=null,!1)})),o},e.prototype.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,r=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),a=[],s=t.re;if(t.$isMultiLine){var l,c=s.length,d=r.length-c;e:for(var u=s.offset||0;u<=d;u++){for(var h=0;hm||(a.push(l=new i(u,m,u+c-1,g)),c>2&&(u=u+c-2))}}else for(var b=0;bk&&a[h].end.row==w;)h--;for(a=a.slice(b,h+1),b=0,h=a.length;b=c;n--)if(p(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=d,c=l.row;n>=c;n--)if(p(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=l.row;if(!p(n,l.column,e)){for(n+=1;n<=d;n++)if(p(n,0,e))return;if(0!=t.wrap)for(n=c,d=l.row;n<=d;n++)if(p(n,0,e))return}};if(t.$isMultiLine)var h=n.length,p=function(t,o,i){var a=r?t-h+1:t;if(!(a<0||a+h>e.getLength())){var s=e.getLine(a),l=s.search(n[0]);if(!(!r&&lo))return!!i(a,l,a+h-1,d)||void 0}}};else if(r)p=function(t,r,i){var s,l=e.getLine(t),c=[],d=0;for(n.lastIndex=0;s=n.exec(l);){var u=s[0].length;if(d=s.index,!u){if(d>=l.length)break;n.lastIndex=d+=o.skipEmptyMatch(l,d,a)}if(s.index+u>r)break;c.push(s.index,u)}for(var h=c.length-1;h>=0;h-=2){var p=c[h-1];if(i(t,p,t,p+(u=c[h])))return!0}};else p=function(t,r,i){var s,l,c=e.getLine(t);for(n.lastIndex=r;l=n.exec(c);){var d=l[0].length;if(i(t,s=l.index,t,s+d))return!0;if(!d&&(n.lastIndex=s+=o.skipEmptyMatch(c,s,a),s>=c.length))return!1}};return{forEach:u}},e}();t.Search=a})),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=e("../lib/keys"),a=e("../lib/useragent"),s=i.KEY_MODS,l=function(){function e(e,t){this.$init(e,t,!1)}return e.prototype.$init=function(e,t,n){this.platform=t||(a.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=n},e.prototype.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},e.prototype.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var o=this.commandKeyBinding;for(var r in o){var i=o[r];if(i==e)delete o[r];else if(Array.isArray(i)){var a=i.indexOf(e);-1!=a&&(i.splice(a,1),1==i.length&&(o[r]=i[0]))}}},e.prototype.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach((function(e){var o="";if(-1!=e.indexOf(" ")){var r=e.split(/\s+/);e=r.pop(),r.forEach((function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;o+=(o?" ":"")+n,this._addCommandToBinding(o,"chainKeys")}),this),o+=" "}var i=this.parseKeys(e),a=s[i.hashId]+i.key;this._addCommandToBinding(o+a,t,n)}),this)},e.prototype._addCommandToBinding=function(e,t,n){var o,r=this.commandKeyBinding;if(t)if(!r[e]||this.$singleCommand)r[e]=t;else{Array.isArray(r[e])?-1!=(o=r[e].indexOf(t))&&r[e].splice(o,1):r[e]=[r[e]],"number"!=typeof n&&(n=c(t));var i=r[e];for(o=0;on)break}i.splice(o,0,t)}else delete r[e]},e.prototype.addCommands=function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}}),this)},e.prototype.removeCommands=function(e){Object.keys(e).forEach((function(t){this.removeCommand(e[t])}),this)},e.prototype.bindKeys=function(e){Object.keys(e).forEach((function(t){this.bindKey(t,e[t])}),this)},e.prototype._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},e.prototype.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter((function(e){return e})),n=t.pop(),o=i[n];if(i.FUNCTION_KEYS[o])n=i.FUNCTION_KEYS[o].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var r=0,a=t.length;a--;){var s=i.KEY_MODS[t[a]];if(null==s)return"undefined"!=typeof console&&console.error("invalid modifier "+t[a]+" in "+e),!1;r|=s}return{key:n,hashId:r}},e.prototype.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},e.prototype.handleKeyboard=function(e,t,n,o){if(!(o<0)){var r=s[t]+n,i=this.commandKeyBinding[r];return e.$keyChain&&(e.$keyChain+=" "+r,i=this.commandKeyBinding[e.$keyChain]||i),!i||"chainKeys"!=i&&"chainKeys"!=i[i.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||o>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-r.length-1)),{command:i}):(e.$keyChain=e.$keyChain||r,{command:"null"})}},e.prototype.getStatusText=function(e,t){return t.$keyChain||""},e}();function c(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}var d=function(e){function t(t,n){var o=e.call(this,t,n)||this;return o.$singleCommand=!0,o}return r(t,e),t}(l);d.call=function(e,t,n){l.prototype.$init.call(e,t,n,!0)},l.call=function(e,t,n){l.prototype.$init.call(e,t,n,!1)},t.HashHandler=d,t.MultiHashHandler=l})),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],(function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=e("../lib/oop"),a=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,l=function(e){function t(t,n){var o=e.call(this,n,t)||this;return o.byName=o.commands,o.setDefaultHandler("exec",(function(e){return e.args?e.command.exec(e.editor,e.args,e.event,!1):e.command.exec(e.editor,{},e.event,!0)})),o}return r(t,e),t.prototype.exec=function(e,t,n){if(Array.isArray(e)){for(var o=e.length;o--;)if(this.exec(e[o],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var r={editor:t,command:e,args:n};return r.returnValue=this._emit("exec",r),this._signal("afterExec",r),!1!==r.returnValue},t.prototype.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},t.prototype.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach((function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])}),this)}finally{this.$inReplay=!1}}},t.prototype.trimMacro=function(e){return e.map((function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e}))},t}(a);i.implement(l.prototype,s),t.CommandManager=l})),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],(function(e,t,n){"use strict";var o=e("../lib/lang"),r=e("../config"),i=e("../range").Range;function a(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:a("Ctrl-,","Command-,"),exec:function(e){r.loadModule("ace/ext/settings_menu",(function(t){t.init(e),e.showSettingsMenu()}))},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:a("Alt-E","F4"),exec:function(e){r.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,1)}))},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:a("Alt-Shift-E","Shift-F4"),exec:function(e){r.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,-1)}))},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:a("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:a(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:a("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:a("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:a("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:a("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:a("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:a("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:a("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:a("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:a("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:a("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:a("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:a("Ctrl-F","Command-F"),exec:function(e){r.loadModule("ace/ext/searchbox",(function(t){t.Search(e)}))},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:a("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:a("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:a("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:a("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:a("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:a("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:a("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:a("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:a("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:a("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:a("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:a("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:a("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:a("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:a("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:a("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:a("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:a("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:a("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:a("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:a(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:a("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:a(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:a("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:a("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:a("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:a("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:a("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:a("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:a("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:a(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:a("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:a("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:a("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:a("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:a("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:a("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:a("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:a("Ctrl-H","Command-Option-F"),exec:function(e){r.loadModule("ace/ext/searchbox",(function(t){t.Search(e,!0)}))}},{name:"undo",description:"Undo",bindKey:a("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:a("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:a("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:a("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:a("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:a("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:a("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:a("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:a("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:a("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:a("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:a("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:a("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:a("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:a("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:a("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:a("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:a("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:a("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(o.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:a(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:a("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:a("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:a("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:a(null,null),exec:function(e){e.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:a("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:a("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:a(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),r=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),a=e.session.doc.getLine(n.row).length,s=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),c=n.row+1;c<=r.row+1;c++){var d=o.stringTrimLeft(o.stringTrimRight(e.session.doc.getLine(c)));0!==d.length&&(d=" "+d),l+=d}r.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+s)):(a=e.session.doc.getLine(n.row).length>a?a+1:a,e.selection.moveCursorTo(n.row,a))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:a(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,o=e.selection.rangeList.ranges,r=[];o.length<1&&(o=[e.selection.getRange()]);for(var a=0;at[n].column&&n++,i.unshift(n,0),t.splice.apply(t,i),this.$updateRows()}}},e.prototype.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach((function(e,n){if(e)for(t=!1,e.row=n;e.$oldWidget;)e.$oldWidget.row=n,e=e.$oldWidget})),t&&(this.session.lineWidgets=null)}},e.prototype.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e},e.prototype.addLineWidget=function(e){if(this.$registerLineWidget(e),e.session=this.session,!this.editor)return e;var t=this.editor.renderer;e.html&&!e.el&&(e.el=o.createElement("div"),e.el.innerHTML=e.html),e.text&&!e.el&&(e.el=o.createElement("div"),e.el.textContent=e.text),e.el&&(o.addCssClass(e.el,"ace_lineWidgetContainer"),e.className&&o.addCssClass(e.el,e.className),e.el.style.position="absolute",e.el.style.zIndex="5",t.container.appendChild(e.el),e._inDocument=!0,e.coverGutter||(e.el.style.zIndex="3"),null==e.pixelHeight&&(e.pixelHeight=e.el.offsetHeight)),null==e.rowCount&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight);var n=this.session.getFoldAt(e.row,0);if(e.$fold=n,n){var r=this.session.lineWidgets;e.row!=n.end.row||r[n.start.row]?e.hidden=!0:r[n.start.row]=e}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e),e},e.prototype.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},e.prototype.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,n=t&&t[e],o=[];n;)o.push(n),n=n.$oldWidget;return o},e.prototype.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},e.prototype.measureWidgets=function(e,t){var n=this.session._changedWidgets,o=t.layerConfig;if(n&&n.length){for(var r=1/0,i=0;i0&&!o[r];)r--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var a=r;a<=i;a++){var s=o[a];if(s&&s.el)if(s.hidden)s.el.style.top=-100-(s.pixelHeight||0)+"px";else{s._inDocument||(s._inDocument=!0,t.container.appendChild(s.el));var l=t.$cursorLayer.getPixelPosition({row:a,column:0},!0).top;s.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(s.row)),s.el.style.top=l-n.offset+"px";var c=s.coverGutter?0:t.gutterWidth;s.fixedWidth||(c-=t.scrollLeft),s.el.style.left=c+"px",s.fullWidth&&s.screenWidth&&(s.el.style.minWidth=n.width+2*n.padding+"px"),s.fixedWidth?s.el.style.right=t.scrollBar.getWidth()+"px":s.el.style.right=""}}}},e}();t.LineWidgets=r})),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],(function(e,t,n){"use strict";var o=e("../lib/keys"),r=e("../mouse/default_gutter_handler").GutterTooltip,i=function(){function e(e){this.editor=e,this.gutterLayer=e.renderer.$gutterLayer,this.element=e.renderer.$gutter,this.lines=e.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new r(this.editor)}return e.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},e.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},e.prototype.$onGutterKeyDown=function(e){if(this.annotationTooltip.isOpen)return e.preventDefault(),void(e.keyCode===o.escape&&this.annotationTooltip.hideTooltip());if(e.target===this.element){if(e.keyCode!=o.enter)return;e.preventDefault();var t=this.editor.getCursorPosition().row;return this.editor.isRowVisible(t)||this.editor.scrollToLine(t,!0,!0),void setTimeout(function(){var e=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),t=this.$findNearestFoldWidget(e),n=this.$findNearestAnnotation(e);if(null!==t||null!==n)return null===t&&null!==n?(this.activeRowIndex=n,this.activeLane="annotation",void this.$focusAnnotation(this.activeRowIndex)):null!==t&&null===n?(this.activeRowIndex=t,this.activeLane="fold",void this.$focusFoldWidget(this.activeRowIndex)):Math.abs(n-e)0||e+t=0&&this.$isFoldWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(e+t))return e+t}return null},e.prototype.$findNearestAnnotation=function(e){if(this.$isAnnotationVisible(e))return e;for(var t=0;e-t>0||e+t=0&&this.$isAnnotationVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isAnnotationVisible(e+t))return e+t}return null},e.prototype.$focusFoldWidget=function(e){if(null!=e){var t=this.$getFoldWidget(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},e.prototype.$focusAnnotation=function(e){if(null!=e){var t=this.$getAnnotation(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},e.prototype.$blurFoldWidget=function(e){var t=this.$getFoldWidget(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},e.prototype.$blurAnnotation=function(e){var t=this.$getAnnotation(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},e.prototype.$moveFoldWidgetUp=function(){for(var e=this.activeRowIndex;e>0;)if(e--,this.$isFoldWidgetVisible(e))return this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=e,void this.$focusFoldWidget(this.activeRowIndex)},e.prototype.$moveFoldWidgetDown=function(){for(var e=this.activeRowIndex;e0;)if(e--,this.$isAnnotationVisible(e))return this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,void this.$focusAnnotation(this.activeRowIndex)},e.prototype.$moveAnnotationDown=function(){for(var e=this.activeRowIndex;e=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},r=e("./lib/oop"),i=e("./lib/dom"),a=e("./lib/lang"),s=e("./lib/useragent"),l=e("./keyboard/textinput").TextInput,c=e("./mouse/mouse_handler").MouseHandler,d=e("./mouse/fold_handler").FoldHandler,u=e("./keyboard/keybinding").KeyBinding,h=e("./edit_session").EditSession,p=e("./search").Search,f=e("./range").Range,m=e("./lib/event_emitter").EventEmitter,g=e("./commands/command_manager").CommandManager,b=e("./commands/default_commands").commands,y=e("./config"),v=e("./token_iterator").TokenIterator,_=e("./line_widgets").LineWidgets,k=e("./keyboard/gutter_handler").GutterKeyboardHandler,w=e("./config").nls,x=e("./clipboard"),S=e("./lib/keys"),M=function(){function e(t,n,o){this.session,this.$toDestroy=[];var r=t.getContainerElement();this.container=r,this.renderer=t,this.id="editor"+ ++e.$uid,this.commands=new g(s.isMac?"mac":"win",b),"object"==typeof document&&(this.textInput=new l(t.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new c(this),new d(this)),this.keyBinding=new u(this),this.$search=(new p).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=a.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",(function(e,t){t._$emitInputEvent.schedule(31)})),this.setSession(n||o&&o.session||new h("")),y.resetOptions(this),o&&this.setOptions(o),y._signal("editor",this)}return e.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=a.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},e.prototype.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},e.prototype.endOperation=function(e){if(this.curOp&&this.session){if(e&&!1===e.returnValue||!this.session)return this.curOp=null;if(1==e&&this.curOp.command&&"mouse"==this.curOp.command.name)return;if(this._signal("beforeEndOperation"),!this.curOp)return;var t=this.curOp.command,n=t&&t.scrollIntoView;if(n){switch(n){case"center-animate":n="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var o=this.selection.getRange(),r=this.renderer.layerConfig;(o.start.row>=r.lastRow||o.end.row<=r.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var i=this.selection.toJSON();this.curOp.selectionAfter=i,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(i),this.prevOp=this.curOp,this.curOp=null}},e.prototype.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,o=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var r=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),o=o&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(t.args)),this.mergeNextCommand=!0}else o=o&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(o=!1),o?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},e.prototype.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;y.loadModule(["keybinding",e],(function(o){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(o&&o.handler),t&&t()}))}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},e.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},e.prototype.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&!e.destroyed&&e.bgTokenizer.scheduleStart()}},e.prototype.getSession=function(){return this.session},e.prototype.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},e.prototype.getValue=function(){return this.session.getValue()},e.prototype.getSelection=function(){return this.selection},e.prototype.resize=function(e){this.renderer.onResize(e)},e.prototype.setTheme=function(e,t){this.renderer.setTheme(e,t)},e.prototype.getTheme=function(){return this.renderer.getTheme()},e.prototype.setStyle=function(e){this.renderer.setStyle(e)},e.prototype.unsetStyle=function(e){this.renderer.unsetStyle(e)},e.prototype.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},e.prototype.setFontSize=function(e){this.setOption("fontSize",e)},e.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout((function(){e.$highlightPending=!1;var t=e.session;if(t&&!t.destroyed){t.$bracketHighlight&&(t.$bracketHighlight.markerIds.forEach((function(e){t.removeMarker(e)})),t.$bracketHighlight=null);var n=e.getCursorPosition(),o=e.getKeyboardHandler(),r=o&&o.$getDirectionForHighlight&&o.$getDirectionForHighlight(e),i=t.getMatchingBracketRanges(n,r);if(!i){var a=new v(t,n.row,n.column).getCurrentToken();if(a&&/\b(?:tag-open|tag-name)/.test(a.type)){var s=t.getMatchingTags(n);s&&(i=[s.openTagName.isEmpty()?s.openTag:s.openTagName,s.closeTagName.isEmpty()?s.closeTag:s.closeTagName])}}if(!i&&t.$mode.getMatching&&(i=t.$mode.getMatching(e.session)),i){var l="ace_bracket";Array.isArray(i)?1==i.length&&(l="ace_error_bracket"):i=[i],2==i.length&&(0==f.comparePoints(i[0].end,i[1].start)?i=[f.fromPoints(i[0].start,i[1].end)]:0==f.comparePoints(i[0].start,i[1].end)&&(i=[f.fromPoints(i[1].start,i[0].end)])),t.$bracketHighlight={ranges:i,markerIds:i.map((function(e){return t.addMarker(e,l,"text")}))},e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide()}else e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide()}}),50)}},e.prototype.focus=function(){this.textInput.focus()},e.prototype.isFocused=function(){return this.textInput.isFocused()},e.prototype.blur=function(){this.textInput.blur()},e.prototype.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},e.prototype.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},e.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},e.prototype.onDocumentChange=function(e){var t=this.session.$useWrapMode,n=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,n,t),this._signal("change",e),this.$cursorChange()},e.prototype.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)},e.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},e.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},e.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},e.prototype.$updateHighlightActiveLine=function(){var e,t=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(e=!1),!this.renderer.$maxLines||1!==this.session.getLength()||this.renderer.$minLines>1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},e.prototype.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),o=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",o)}var r=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(r),this._signal("changeSelection")},e.prototype.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,o=t.end.column,r=e.getLine(t.start.row),i=r.substring(n,o);if(!(i.length>5e3)&&/[\w\d]/.test(i)){var a=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:i}),s=r.substring(n-1,o+1);if(a.test(s))return a}}},e.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},e.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},e.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},e.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},e.prototype.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},e.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},e.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},e.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},e.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},e.prototype.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var o=this.selection.getAllRanges(),r=0;rs.search(/\S|$/)){var l=s.substr(r.column).search(/\S|$/);n.doc.removeInLine(r.row,r.column,r.column+l)}}this.clearSelection();var c=r.column,d=n.getState(r.row),u=(s=n.getLine(r.row),o.checkOutdent(d,s,e));if(n.insert(r,e),i&&i.selection&&(2==i.selection.length?this.selection.setSelectionRange(new f(r.row,c+i.selection[0],r.row,c+i.selection[1])):this.selection.setSelectionRange(new f(r.row+i.selection[0],i.selection[1],r.row+i.selection[2],i.selection[3]))),this.$enableAutoIndent){if(n.getDocument().isNewLine(e)){var h=o.getNextLineIndent(d,s.slice(0,r.column),n.getTabString());n.insert({row:r.row+1,column:0},h)}u&&o.autoOutdent(d,n,r.row)}},e.prototype.autoIndent=function(){for(var e=this.session,t=e.getMode(),n=this.selection.isEmpty()?[new f(0,0,e.doc.getLength()-1,0)]:this.selection.getAllRanges(),o="",r="",i="",a=e.getTabString(),s=0;s0&&(o=e.getState(d-1),r=e.getLine(d-1),i=t.getNextLineIndent(o,r,a));var u=e.getLine(d),h=t.$getIndent(u);if(i!==h){if(h.length>0){var p=new f(d,0,d,h.length);e.remove(p)}i.length>0&&e.insert({row:d,column:0},i)}t.autoOutdent(o,e,d)}},e.prototype.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},e.prototype.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),e||n.isEmpty()||this.remove());(!e&&this.selection.isEmpty()||this.insert(e,!0),t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},e.prototype.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},e.prototype.setOverwrite=function(e){this.session.setOverwrite(e)},e.prototype.getOverwrite=function(){return this.session.getOverwrite()},e.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},e.prototype.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},e.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},e.prototype.setDragDelay=function(e){this.setOption("dragDelay",e)},e.prototype.getDragDelay=function(){return this.getOption("dragDelay")},e.prototype.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},e.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},e.prototype.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},e.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},e.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},e.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},e.prototype.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},e.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},e.prototype.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},e.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},e.prototype.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},e.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},e.prototype.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},e.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},e.prototype.setHighlightIndentGuides=function(e){this.renderer.setHighlightIndentGuides(e)},e.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},e.prototype.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},e.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},e.prototype.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},e.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},e.prototype.setReadOnly=function(e){this.setOption("readOnly",e)},e.prototype.getReadOnly=function(){return this.getOption("readOnly")},e.prototype.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},e.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},e.prototype.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},e.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},e.prototype.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},e.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},e.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},e.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},e.prototype.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,o=n.getState(t.start.row),r=n.getMode().transformAction(o,"deletion",this,n,t);if(0===t.end.column){var i=n.getTextRange(t);if("\n"==i[i.length-1]){var a=n.getLine(t.end.row);/^\s+$/.test(a)&&(t.end.column=a.length)}}r&&(t=r)}this.session.remove(t),this.clearSelection()},e.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},e.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},e.prototype.setGhostText=function(e,t){this.session.widgetManager||(this.session.widgetManager=new _(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(e,t)},e.prototype.removeGhostText=function(){this.session.widgetManager&&this.renderer.removeGhostText()},e.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,o,r=this.session.getLine(e.row);tt.toLowerCase()?1:0}));var r=new f(0,0,0,0);for(o=e.first;o<=e.last;o++){var i=t.getLine(o);r.start.row=o,r.end.row=o,r.end.column=i.length,t.replace(r,n[o-e.first])}},e.prototype.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},e.prototype.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},e.prototype.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var o=this.session.getLine(e);n.lastIndex=t)return{value:r[0],start:r.index,end:r.index+r[0].length}}return null},e.prototype.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,o=new f(t,n-1,t,n),r=this.session.getTextRange(o);if(!isNaN(parseFloat(r))&&isFinite(r)){var i=this.getNumberAt(t,n);if(i){var a=i.value.indexOf(".")>=0?i.start+i.value.indexOf(".")+1:i.end,s=i.start+i.value.length-a,l=parseFloat(i.value);l*=Math.pow(10,s),a!==i.end&&n=s&&i<=l&&(n=t,c.selection.clearSelection(),c.moveCursorTo(e,s+o),c.selection.selectTo(e,l+o)),s=l}));for(var d,u=this.$toggleWordPairs,h=0;h=l&&a<=c&&h.match(/((?:https?|ftp):\/\/[\S]+)/)){s=h.replace(/[\s:.,'";}\]]+$/,"");break}l=c}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return s},e.prototype.openLink=function(){var e=this.selection.getCursor(),t=this.findLinkAt(e.row,e.column);return t&&window.open(t,"_blank"),null!=t},e.prototype.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},e.prototype.duplicateSelection=function(){var e=this.selection,t=this.session,n=e.getRange(),o=e.isBackwards();if(n.isEmpty()){var r=n.start.row;t.duplicateLines(r,r)}else{var i=o?n.start:n.end,a=t.insert(i,t.getTextRange(n));n.start=i,n.end=a,e.setSelectionRange(n,o)}},e.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},e.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},e.prototype.moveText=function(e,t,n){return this.session.moveText(e,t,n)},e.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},e.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},e.prototype.$moveLines=function(e,t){var n,o,r=this.selection;if(!r.inMultiSelectMode||this.inVirtualSelectionMode){var i=r.toOrientedRange();n=this.$getSelectedRows(i),o=this.session.$moveLines(n.first,n.last,t?0:e),t&&-1==e&&(o=0),i.moveBy(o,0),r.fromOrientedRange(i)}else{var a=r.rangeList.ranges;r.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var s=0,l=0,c=a.length,d=0;dp+1)break;p=f.last}for(d--,s=this.session.$moveLines(h,p,t?0:e),t&&-1==e&&(u=d+1);u<=d;)a[u].moveBy(s,0),u++;t||(s=0),l+=s}r.fromOrientedRange(r.ranges[0]),r.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},e.prototype.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},e.prototype.onCompositionStart=function(e){this.renderer.showComposition(e)},e.prototype.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},e.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},e.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},e.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},e.prototype.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},e.prototype.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},e.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},e.prototype.$moveByPage=function(e,t){var n=this.renderer,o=this.renderer.layerConfig,r=e*Math.floor(o.height/o.lineHeight);!0===t?this.selection.$moveSelection((function(){this.moveCursorBy(r,0)})):!1===t&&(this.selection.moveCursorBy(r,0),this.selection.clearSelection());var i=n.scrollTop;n.scrollBy(0,r*o.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(i)},e.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},e.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},e.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},e.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},e.prototype.scrollPageDown=function(){this.$moveByPage(1)},e.prototype.scrollPageUp=function(){this.$moveByPage(-1)},e.prototype.scrollToRow=function(e){this.renderer.scrollToRow(e)},e.prototype.scrollToLine=function(e,t,n,o){this.renderer.scrollToLine(e,t,n,o)},e.prototype.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},e.prototype.getCursorPosition=function(){return this.selection.getCursor()},e.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},e.prototype.getSelectionRange=function(){return this.selection.getRange()},e.prototype.selectAll=function(){this.selection.selectAll()},e.prototype.clearSelection=function(){this.selection.clearSelection()},e.prototype.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},e.prototype.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},e.prototype.jumpToMatching=function(e,t){var n=this.getCursorPosition(),o=new v(this.session,n.row,n.column),r=o.getCurrentToken(),i=0;r&&-1!==r.type.indexOf("tag-name")&&(r=o.stepBackward());var a=r||o.stepForward();if(a){var s,l,c=!1,d={},u=n.column-a.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(a.value.match(/[{}()\[\]]/g)){for(;u1?d[a.value]++:"=0;--i)this.$tryReplace(n[i],e)&&o++;return this.selection.setSelectionRange(r),o},e.prototype.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},e.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},e.prototype.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var o=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(o)||this.$search.$options.needle)||(o=this.session.getWordRange(o.start.row,o.start.column),e=this.session.getTextRange(o)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:o});var i=this.$search.find(this.session);return t.preventScroll?i:i?(this.revealRange(i,n),i):(t.backwards?o.start=o.end:o.end=o.start,void this.selection.setRange(o))},e.prototype.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},e.prototype.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},e.prototype.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},e.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},e.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},e.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach((function(e){e.destroy()})),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},e.prototype.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,o=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var r=this.$scrollAnchor;r.style.cssText="position:absolute",this.container.insertBefore(r,this.container.firstChild);var i=this.on("changeSelection",(function(){o=!0})),a=this.renderer.on("beforeRender",(function(){o&&(t=n.renderer.container.getBoundingClientRect())})),s=this.renderer.on("afterRender",(function(){if(o&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,i=e.$cursorLayer.$pixelPos,a=e.layerConfig,s=i.top-a.offset;null!=(o=i.top>=0&&s+t.top<0||!(i.topwindow.innerHeight)&&null)&&(r.style.top=s+"px",r.style.left=i.left+"px",r.style.height=a.lineHeight+"px",r.scrollIntoView(o)),o=t=null}}));this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",i),this.renderer.off("afterRender",s),this.renderer.off("beforeRender",a))}}},e.prototype.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},e.prototype.prompt=function(e,t,n){var o=this;y.loadModule("ace/ext/prompt",(function(r){r.prompt(o,e,t,n)}))},e}();M.$uid=0,M.prototype.curOp=null,M.prototype.prevOp={},M.prototype.$mergeableCommands=["backspace","del","insertstring"],M.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],r.implement(M.prototype,m),y.defineOptions(M.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?T.attach(this):T.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?T.attach(this):T.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(e||this.renderer.placeholderNode)!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(e){var t,n={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(e){e.blur(),e.renderer.scroller.focus()},readOnly:!0},o=function(e){if(e.target==this.renderer.scroller&&e.keyCode===S.enter){e.preventDefault();var t=this.getCursorPosition().row;this.isRowVisible(t)||this.scrollToLine(t,!0,!0),this.focus()}};e?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(s.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",w("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",w("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",o.bind(this)),this.commands.addCommand(n),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",w("editor.gutter.aria-roledescription","editor")),this.renderer.$gutter.setAttribute("aria-label",w("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),t||(t=new k(this)),t.addListener()):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",o.bind(this)),this.commands.removeCommand(n),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),t&&t.removeListener())},initialValue:!1},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var T={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=M})),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var o=e("../lib/dom"),r=function(){function e(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return e.prototype.moveContainer=function(e){o.translate(this.element,0,-e.firstRowScreen*e.lineHeight%this.canvasHeight-e.offset*this.$offsetCoefficient)},e.prototype.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},e.prototype.computeLineTop=function(e,t,n){var o=t.firstRowScreen*t.lineHeight,r=Math.floor(o/this.canvasHeight);return n.documentToScreenRow(e,0)*t.lineHeight-r*this.canvasHeight},e.prototype.computeLineHeight=function(e,t,n){return t.lineHeight*n.getRowLineCount(e)},e.prototype.getLength=function(){return this.cells.length},e.prototype.get=function(e){return this.cells[e]},e.prototype.shift=function(){this.$cacheCell(this.cells.shift())},e.prototype.pop=function(){this.$cacheCell(this.cells.pop())},e.prototype.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=o.createFragment(this.element),n=0;ni&&(l=r.end.row+1,i=(r=t.getNextFoldLine(l,r))?r.start.row:1/0),l>o){for(;this.$lines.getLength()>s+1;)this.$lines.pop();break}(a=this.$lines.get(++s))?a.row=l:(a=this.$lines.createCell(l,e,this.session,d),this.$lines.push(a)),this.$renderCell(a,e,r,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},e.prototype.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,o=t.$firstLineNumber,r=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(r=t.getLength()+o-1);var i=n?n.getWidth(t,r,e):r.toString().length*e.characterWidth,a=this.$padding||this.$computePadding();(i+=a.left+a.right)===this.gutterWidth||isNaN(i)||(this.gutterWidth=i,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",i))},e.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},e.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(o.row>this.$cursorRow){var r=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&r&&r.start.row==t[n-1].row))break;o=t[n-1]}o.element.className="ace_gutter-active-line "+o.element.className,this.$cursorCell=o;break}}}}},e.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),o=this.oldLastRow;if(this.oldLastRow=n,!t||o0;r--)this.$lines.shift();if(o>n)for(r=this.session.getFoldedRowCount(n+1,o);r>0;r--)this.$lines.pop();e.firstRowo&&this.$lines.push(this.$renderLines(e,o+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},e.prototype.$renderLines=function(e,t,n){for(var o=[],r=t,i=this.session.getNextFoldLine(r),a=i?i.start.row:1/0;r>a&&(r=i.end.row+1,a=(i=this.session.getNextFoldLine(r,i))?i.start.row:1/0),!(r>n);){var s=this.$lines.createCell(r,e,this.session,d);this.$renderCell(s,e,i,r),o.push(s),r++}return o},e.prototype.$renderCell=function(e,t,n,r){var i=e.element,a=this.session,s=i.childNodes[0],c=i.childNodes[1],d=i.childNodes[2],u=d.firstChild,h=a.$firstLineNumber,p=a.$breakpoints,f=a.$decorations,m=a.gutterRenderer||this.$renderer,g=this.$showFoldWidgets&&a.foldWidgets,b=n?n.start.row:Number.MAX_VALUE,y=t.lineHeight+"px",v=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",_=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",k=(m?m.getText(a,r):r+h).toString();if(this.$highlightGutterLine&&(r==this.$cursorRow||n&&r=b&&this.$cursorRow<=n.end.row)&&(v+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),p[r]&&(v+=p[r]),f[r]&&(v+=f[r]),this.$annotations[r]&&r!==b&&(v+=this.$annotations[r].className),g){var w=g[r];null==w&&(w=g[r]=a.getFoldWidget(r))}if(w){var x="ace_fold-widget ace_"+w,S="start"==w&&r==b&&rn.right-t.right?"foldWidgets":void 0},e}();function d(e){var t=document.createTextNode("");e.appendChild(t);var n=o.createElement("span");e.appendChild(n);var r=o.createElement("span");e.appendChild(r);var i=o.createElement("span");return r.appendChild(i),e}c.prototype.$fixedWidth=!1,c.prototype.$highlightGutterLine=!0,c.prototype.$renderer="",c.prototype.$showLineNumbers=!0,c.prototype.$showFoldWidgets=!0,r.implement(c.prototype,a),t.Gutter=c})),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],(function(e,t,n){"use strict";var o=e("../range").Range,r=e("../lib/dom"),i=function(){function e(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}return e.prototype.setPadding=function(e){this.$padding=e},e.prototype.setSession=function(e){this.session=e},e.prototype.setMarkers=function(e){this.markers=e},e.prototype.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},e.prototype.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var o=this.markers[n];if(o.range){var r=o.range.clipRows(e.firstRow,e.lastRow);if(!r.isEmpty())if(r=r.toScreenRange(this.session),o.renderer){var i=this.$getTop(r.start.row,e),a=this.$padding+r.start.column*e.characterWidth;o.renderer(t,r,a,i,e)}else"fullLine"==o.type?this.drawFullLineMarker(t,r,o.clazz,e):"screenLine"==o.type?this.drawScreenLineMarker(t,r,o.clazz,e):r.isMultiLine()?"text"==o.type?this.drawTextMarker(t,r,o.clazz,e):this.drawMultiLineMarker(t,r,o.clazz,e):this.drawSingleLineMarker(t,r,o.clazz+" ace_start ace_br15",e)}else o.update(t,this,this.session,e)}if(-1!=this.i)for(;this.ih?4:0)|(c==l?8:0)),r,c==l?0:1,i)},e.prototype.drawMultiLineMarker=function(e,t,n,o,r){var i=this.$padding,a=o.lineHeight,s=this.$getTop(t.start.row,o),l=i+t.start.column*o.characterWidth;(r=r||"",this.session.$bidiHandler.isBidiRow(t.start.row))?((c=t.clone()).end.row=c.start.row,c.end.column=this.session.getLine(c.start.row).length,this.drawBidiSingleLineMarker(e,c,n+" ace_br1 ace_start",o,null,r)):this.elt(n+" ace_br1 ace_start","height:"+a+"px;right:0;top:"+s+"px;left:"+l+"px;"+(r||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var c;(c=t.clone()).start.row=c.end.row,c.start.column=0,this.drawBidiSingleLineMarker(e,c,n+" ace_br12",o,null,r)}else{s=this.$getTop(t.end.row,o);var d=t.end.column*o.characterWidth;this.elt(n+" ace_br12","height:"+a+"px;width:"+d+"px;top:"+s+"px;left:"+i+"px;"+(r||""))}if(!((a=(t.end.row-t.start.row-1)*o.lineHeight)<=0)){s=this.$getTop(t.start.row+1,o);var u=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(u?" ace_br"+u:""),"height:"+a+"px;right:0;top:"+s+"px;left:"+i+"px;"+(r||""))}},e.prototype.drawSingleLineMarker=function(e,t,n,o,r,i){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,o,r,i);var a=o.lineHeight,s=(t.end.column+(r||0)-t.start.column)*o.characterWidth,l=this.$getTop(t.start.row,o),c=this.$padding+t.start.column*o.characterWidth;this.elt(n,"height:"+a+"px;width:"+s+"px;top:"+l+"px;left:"+c+"px;"+(i||""))},e.prototype.drawBidiSingleLineMarker=function(e,t,n,o,r,i){var a=o.lineHeight,s=this.$getTop(t.start.row,o),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach((function(e){this.elt(n,"height:"+a+"px;width:"+(e.width+(r||0))+"px;top:"+s+"px;left:"+(l+e.left)+"px;"+(i||""))}),this)},e.prototype.drawFullLineMarker=function(e,t,n,o,r){var i=this.$getTop(t.start.row,o),a=o.lineHeight;t.start.row!=t.end.row&&(a+=this.$getTop(t.end.row,o)-i),this.elt(n,"height:"+a+"px;top:"+i+"px;left:0;right:0;"+(r||""))},e.prototype.drawScreenLineMarker=function(e,t,n,o,r){var i=this.$getTop(t.start.row,o),a=o.lineHeight;this.elt(n,"height:"+a+"px;top:"+i+"px;left:0;right:0;"+(r||""))},e}();i.prototype.$padding=0,t.Marker=i})),ace.define("ace/layer/text_util",["require","exports","module"],(function(e,t,n){var o=new Set(["text","rparen","lparen"]);t.isTextToken=function(e){return o.has(e)}})),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],(function(e,t,n){"use strict";var o=e("../lib/oop"),r=e("../lib/dom"),i=e("../lib/lang"),a=e("./lines").Lines,s=e("../lib/event_emitter").EventEmitter,l=e("../config").nls,c=e("./text_util").isTextToken,d=function(){function e(e){this.dom=r,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new a(this.element)}return e.prototype.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},e.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},e.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},e.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},e.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},e.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},e.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},e.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString()},e.prototype.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,"string"==typeof e?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},e.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},e.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides!==e&&(this.$highlightIndentGuides=e,e)},e.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nd&&(s=l.end.row+1,d=(l=this.session.getNextFoldLine(s,l))?l.start.row:1/0),!(s>r);){var u=i[a++];if(u){this.dom.removeChildren(u),this.$renderLine(u,s,s==d&&l),c&&(u.style.top=this.$lines.computeLineTop(s,e,this.session)+"px");var h=e.lineHeight*this.session.getRowLength(s)+"px";u.style.height!=h&&(c=!0,u.style.height=h)}s++}if(c)for(;a0;r--)this.$lines.shift();if(t.lastRow>e.lastRow)for(r=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);r>0;r--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},e.prototype.$renderLinesFragment=function(e,t,n){for(var o=[],i=t,a=this.session.getNextFoldLine(i),s=a?a.start.row:1/0;i>s&&(i=a.end.row+1,s=(a=this.session.getNextFoldLine(i,a))?a.start.row:1/0),!(i>n);){var l=this.$lines.createCell(i,e,this.session),c=l.element;this.dom.removeChildren(c),r.setStyle(c.style,"height",this.$lines.computeLineHeight(i,e,this.session)+"px"),r.setStyle(c.style,"top",this.$lines.computeLineTop(i,e,this.session)+"px"),this.$renderLine(c,i,i==s&&a),this.$useLineGroups()?c.className="ace_line_group":c.className="ace_line",o.push(l),i++}return o},e.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,o=this.$lines;o.getLength();)o.pop();o.push(this.$renderLinesFragment(e,t,n))},e.prototype.$renderToken=function(e,t,n,o){for(var r,a=this,s=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,d=this.dom.createFragment(this.element),u=0;r=s.exec(o);){var h=r[1],p=r[2],f=r[3],m=r[4],g=r[5];if(a.showSpaces||!p){var b=u!=r.index?o.slice(u,r.index):"";if(u=r.index+r[0].length,b&&d.appendChild(this.dom.createTextNode(b,this.element)),h){var y=a.session.getScreenTabSize(t+r.index);d.appendChild(a.$tabStrings[y].cloneNode(!0)),t+=y-1}else if(p){if(a.showSpaces)(_=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",_.textContent=i.stringRepeat(a.SPACE_CHAR,p.length),d.appendChild(_);else d.appendChild(this.dom.createTextNode(p,this.element))}else if(f){(_=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",_.textContent=i.stringRepeat(a.SPACE_CHAR,f.length),d.appendChild(_)}else if(m){t+=1,(_=this.dom.createElement("span")).style.width=2*a.config.characterWidth+"px",_.className=a.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",_.textContent=a.showSpaces?a.SPACE_CHAR:m,d.appendChild(_)}else if(g){t+=1,(_=this.dom.createElement("span")).style.width=2*a.config.characterWidth+"px",_.className="ace_cjk",_.textContent=g,d.appendChild(_)}}}if(d.appendChild(this.dom.createTextNode(u?o.slice(u):o,this.element)),c(n.type))e.appendChild(d);else{var v="ace_"+n.type.replace(/\./g," ace_"),_=this.dom.createElement("span");"fold"==n.type&&(_.style.width=n.value.length*this.config.characterWidth+"px",_.setAttribute("title",l("inline-fold.closed.title","Unfold code"))),_.className=v,_.appendChild(d),e.appendChild(_)}return t+o.length},e.prototype.renderIndentGuide=function(e,t,n){var o=t.search(this.$indentGuideRe);if(o<=0||o>=n)return t;if(" "==t[0]){for(var r=(o-=o%this.tabSize)/this.tabSize,i=0;ir[i].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}if(!this.$highlightIndentGuideMarker.end&&""!==e[t.row]&&t.column===e[t.row].length){this.$highlightIndentGuideMarker.dir=1;for(i=t.row+1;i0)for(var o=0;o=this.$highlightIndentGuideMarker.start+1){if(o.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(o,t)}}else for(n=e.length-1;n>=0;n--){o=e[n];if(this.$highlightIndentGuideMarker.end&&o.row=a;)s=this.$renderToken(l,s,d,u.substring(0,a-o)),u=u.substring(a-o),o=a,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(i.stringRepeat(" ",n.indent),this.element)),s=0,a=n[++r]||Number.MAX_VALUE;0!=u.length&&(o+=u.length,s=this.$renderToken(l,s,d,u))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,s,null,"",!0)},e.prototype.$renderSimpleLine=function(e,t){for(var n=0,o=0;othis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}}},e.prototype.$renderOverflowMessage=function(e,t,n,o,r){n&&this.$renderToken(e,t,n,o.slice(0,this.MAX_LINE_LENGTH-t));var i=this.dom.createElement("span");i.className="ace_inline_button ace_keyword ace_toggle_wrap",i.textContent=r?"":"",e.appendChild(i)},e.prototype.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var o=this.$getFoldLineTokens(t,n);else o=this.session.getTokens(t);var r=e;if(o.length){var i=this.session.getRowSplitData(t);if(i&&i.length){this.$renderWrappedLine(e,o,i);r=e.lastChild}else{r=e;this.$useLineGroups()&&(r=this.$createLineElement(),e.appendChild(r)),this.$renderSimpleLine(r,o)}}else this.$useLineGroups()&&(r=this.$createLineElement(),e.appendChild(r));if(this.showEOL&&r){n&&(t=n.end.row);var a=this.dom.createElement("span");a.className="ace_invisible ace_invisible_eol",a.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,r.appendChild(a)}},e.prototype.$getFoldLineTokens=function(e,t){var n=this.session,o=[];var r=n.getTokens(e);return t.walk((function(e,t,i,a,s){null!=e?o.push({type:"fold",value:e}):(s&&(r=n.getTokens(t)),r.length&&function(e,t,n){for(var r=0,i=0;i+e[r].value.lengthn-t&&(a=a.substring(0,n-t)),o.push({type:e[r].type,value:a}),i=t+a.length,r+=1);in?o.push({type:e[r].type,value:a.substring(0,n-i)}):o.push(e[r]),i+=a.length,r+=1}}(r,a,i))}),t.end.row,this.session.getLine(t.end.row).length),o},e.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},e}();d.prototype.EOF_CHAR="¶",d.prototype.EOL_CHAR_LF="¬",d.prototype.EOL_CHAR_CRLF="¤",d.prototype.EOL_CHAR=d.prototype.EOL_CHAR_LF,d.prototype.TAB_CHAR="—",d.prototype.SPACE_CHAR="·",d.prototype.$padding=0,d.prototype.MAX_LINE_LENGTH=1e4,d.prototype.showInvisibles=!1,d.prototype.showSpaces=!1,d.prototype.showTabs=!1,d.prototype.showEOL=!1,d.prototype.displayIndentGuides=!0,d.prototype.$highlightIndentGuides=!0,d.prototype.$tabStrings=[],d.prototype.destroy={},d.prototype.onChangeTabSize=d.prototype.$computeTabString,o.implement(d.prototype,s),t.Text=d})),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var o=e("../lib/dom"),r=function(){function e(e){this.element=o.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),o.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return e.prototype.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)o.setStyle(t[n].style,"opacity",e?"":"0")},e.prototype.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&o.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},e.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,o.removeCssClass(this.element,"ace_animate-blinking")},e.prototype.setPadding=function(e){this.$padding=e},e.prototype.setSession=function(e){this.session=e},e.prototype.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},e.prototype.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},e.prototype.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,o.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},e.prototype.addCursor=function(){var e=o.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},e.prototype.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},e.prototype.hideCursor=function(){this.isVisible=!1,o.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},e.prototype.showCursor=function(){this.isVisible=!0,o.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},e.prototype.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,o.removeCssClass(this.element,"ace_smooth-blinking")),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&o.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),o.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout((function(){e(!1)}),.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval((function(){e(!0),t()}),this.blinkInterval),t()}else this.$stopCssAnimation()},e.prototype.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},e.prototype.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||a.top<0)&&n>1)){var s=this.cursors[r++]||this.addCursor(),l=s.style;this.drawCursor?this.drawCursor(s,a,e,t[n],this.session):this.isCursorInView(a,e)?(o.setStyle(l,"display","block"),o.translate(s,a.left,a.top),o.setStyle(l,"width",Math.round(e.characterWidth)+"px"),o.setStyle(l,"height",e.lineHeight+"px")):o.setStyle(l,"display","none")}}for(;this.cursors.length>r;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=a,this.restartTimer()},e.prototype.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?o.addCssClass(this.element,"ace_overwrite-cursors"):o.removeCssClass(this.element,"ace_overwrite-cursors"))},e.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},e}();r.prototype.$padding=0,r.prototype.drawCursor=null,t.Cursor=r})),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=e("./lib/oop"),a=e("./lib/dom"),s=e("./lib/event"),l=e("./lib/event_emitter").EventEmitter,c=32768,d=function(){function e(e,t){this.element=a.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+t,this.inner=a.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)}return e.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},e}();i.implement(d.prototype,l);var u=function(e){function t(t,n){var o=e.call(this,t,"-v")||this;return o.scrollTop=0,o.scrollHeight=0,n.$scrollbarWidth=o.width=a.scrollbarWidth(t.ownerDocument),o.inner.style.width=o.element.style.width=(o.width||15)+5+"px",o.$minWidth=0,o}return r(t,e),t.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(e){this.element.style.height=e+"px"},t.prototype.setScrollHeight=function(e){this.scrollHeight=e,e>c?(this.coeff=c/e,e=c):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},t.prototype.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)},t}(d);u.prototype.setInnerHeight=u.prototype.setScrollHeight;var h=function(e){function t(t,n){var o=e.call(this,t,"-h")||this;return o.scrollLeft=0,o.height=n.$scrollbarWidth,o.inner.style.height=o.element.style.height=(o.height||15)+5+"px",o}return r(t,e),t.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.setWidth=function(e){this.element.style.width=e+"px"},t.prototype.setInnerWidth=function(e){this.inner.style.width=e+"px"},t.prototype.setScrollWidth=function(e){this.inner.style.width=e+"px"},t.prototype.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)},t}(d);t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=h,t.VScrollBar=u,t.HScrollBar=h})),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=e("./lib/oop"),a=e("./lib/dom"),s=e("./lib/event"),l=e("./lib/event_emitter").EventEmitter;a.importCssString(".ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\n position: absolute;\n background: rgba(128, 128, 128, 0.6);\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n border: 1px solid #bbb;\n border-radius: 2px;\n z-index: 8;\n}\n.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\n position: absolute;\n z-index: 6;\n background: none;\n overflow: hidden!important;\n}\n.ace_editor>.ace_sb-v {\n z-index: 6;\n right: 0;\n top: 0;\n width: 12px;\n}\n.ace_editor>.ace_sb-v div {\n z-index: 8;\n right: 0;\n width: 100%;\n}\n.ace_editor>.ace_sb-h {\n bottom: 0;\n left: 0;\n height: 12px;\n}\n.ace_editor>.ace_sb-h div {\n bottom: 0;\n height: 100%;\n}\n.ace_editor>.ace_sb_grabbed {\n z-index: 8;\n background: #000;\n}","ace_scrollbar.css",!1);var c=function(){function e(e,t){this.element=a.createElement("div"),this.element.className="ace_sb"+t,this.inner=a.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return e.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},e}();i.implement(c.prototype,l);var d=function(e){function t(t,n){var o=e.call(this,t,"-v")||this;return o.scrollTop=0,o.scrollHeight=0,o.parent=t,o.width=o.VScrollWidth,o.renderer=n,o.inner.style.width=o.element.style.width=(o.width||15)+"px",o.$minWidth=0,o}return r(t,e),t.prototype.onMouseDown=function(e,t){if("mousedown"===e&&0===s.getButton(t)&&2!==t.detail){if(t.target===this.inner){var n=this,o=t.clientY,r=t.clientY,i=this.thumbTop;s.capture(this.inner,(function(e){o=e.clientY}),(function(){clearInterval(a)}));var a=setInterval((function(){if(void 0!==o){var e=n.scrollTopFromThumbTop(i+o-r);e!==n.scrollTop&&n._emit("scroll",{data:e})}}),20);return s.preventDefault(t)}var l=t.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(l)}),s.preventDefault(t)}},t.prototype.getHeight=function(){return this.height},t.prototype.scrollTopFromThumbTop=function(e){var t=e*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return(t|=0)<0?t=0:t>this.pageHeight-this.viewHeight&&(t=this.pageHeight-this.viewHeight),t},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(e){this.height=Math.max(0,e),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},t.prototype.setScrollHeight=function(e,t){(this.pageHeight!==e||t)&&(this.pageHeight=e,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},t.prototype.setScrollTop=function(e){this.scrollTop=e,e<0&&(e=0),this.thumbTop=e*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},t}(c);d.prototype.setInnerHeight=d.prototype.setScrollHeight;var u=function(e){function t(t,n){var o=e.call(this,t,"-h")||this;return o.scrollLeft=0,o.scrollWidth=0,o.height=o.HScrollHeight,o.inner.style.height=o.element.style.height=(o.height||12)+"px",o.renderer=n,o}return r(t,e),t.prototype.onMouseDown=function(e,t){if("mousedown"===e&&0===s.getButton(t)&&2!==t.detail){if(t.target===this.inner){var n=this,o=t.clientX,r=t.clientX,i=this.thumbLeft;s.capture(this.inner,(function(e){o=e.clientX}),(function(){clearInterval(a)}));var a=setInterval((function(){if(void 0!==o){var e=n.scrollLeftFromThumbLeft(i+o-r);e!==n.scrollLeft&&n._emit("scroll",{data:e})}}),20);return s.preventDefault(t)}var l=t.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(l)}),s.preventDefault(t)}},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.scrollLeftFromThumbLeft=function(e){var t=e*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return(t|=0)<0?t=0:t>this.pageWidth-this.viewWidth&&(t=this.pageWidth-this.viewWidth),t},t.prototype.setWidth=function(e){this.width=Math.max(0,e),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},t.prototype.setScrollWidth=function(e,t){(this.pageWidth!==e||t)&&(this.pageWidth=e,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},t.prototype.setScrollLeft=function(e){this.scrollLeft=e,e<0&&(e=0),this.thumbLeft=e*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},t}(c);u.prototype.setInnerWidth=u.prototype.setScrollWidth,t.ScrollBar=d,t.ScrollBarV=d,t.ScrollBarH=u,t.VScrollBar=d,t.HScrollBar=u})),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],(function(e,t,n){"use strict";var o=e("./lib/event"),r=function(){function e(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(o.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}}return e.prototype.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(o.nextFrame(this._flush),this.pending=!0)},e.prototype.clear=function(e){var t=this.changes;return this.changes=0,t},e}();t.RenderLoop=r})),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],(function(e,t,n){var o=e("../lib/oop"),r=e("../lib/dom"),i=e("../lib/lang"),a=e("../lib/event"),s=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,c=512,d="function"==typeof ResizeObserver,u=200,h=function(){function e(e){this.el=r.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=r.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=r.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=i.stringRepeat("X",c),this.$characterSize={width:0,height:0},d?this.$addObserver():this.checkForSizeChanges()}return e.prototype.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",s.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},e.prototype.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},e.prototype.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver((function(t){e.checkForSizeChanges()})),this.$observer.observe(this.$measureNode)},e.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=a.onIdle((function t(){e.checkForSizeChanges(),a.onIdle(t,500)}),500)},e.prototype.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},e.prototype.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/c};return 0===t.width||0===t.height?null:t},e.prototype.$measureCharWidth=function(e){return this.$main.textContent=i.stringRepeat(e,c),this.$main.getBoundingClientRect().width/c},e.prototype.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},e.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.$getZoom=function(e){return e&&e.parentElement?(window.getComputedStyle(e).zoom||1)*this.$getZoom(e.parentElement):1},e.prototype.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=r.buildDom([e(0,0),e(u,0),e(0,u),e(u,u)],this.el)},e.prototype.transformCoordinates=function(e,t){e&&(e=i(1/this.$getZoom(this.el),e));function n(e,t,n){var o=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/o,(+e[1]*n[0]-e[0]*n[1])/o]}function o(e,t){return[e[0]-t[0],e[1]-t[1]]}function r(e,t){return[e[0]+t[0],e[1]+t[1]]}function i(e,t){return[e*t[0],e*t[1]]}function a(e){var t=e.getBoundingClientRect();return[t.left,t.top]}this.els||this.$initTransformMeasureNodes();var s=a(this.els[0]),l=a(this.els[1]),c=a(this.els[2]),d=a(this.els[3]),h=n(o(d,l),o(d,c),o(r(l,c),r(d,s))),p=i(1+h[0],o(l,s)),f=i(1+h[1],o(c,s));if(t){var m=t,g=h[0]*m[0]/u+h[1]*m[1]/u+1,b=r(i(m[0],p),i(m[1],f));return r(i(1/g/u,b),s)}var y=o(e,s),v=n(o(p,i(h[0],y)),o(f,i(h[1],y)),y);return i(u,v)},e}();h.prototype.$characterSize={width:0,height:0},o.implement(h.prototype,l),t.FontMetrics=h})),ace.define("ace/css/editor-css",["require","exports","module"],(function(e,t,n){n.exports='\n.ace_br1 {border-top-left-radius : 3px;}\n.ace_br2 {border-top-right-radius : 3px;}\n.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\n.ace_br4 {border-bottom-right-radius: 3px;}\n.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\n.ace_br8 {border-bottom-left-radius : 3px;}\n.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n\n\n.ace_editor {\n position: relative;\n overflow: hidden;\n padding: 0;\n font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'Source Code Pro\', \'source-code-pro\', monospace;\n direction: ltr;\n text-align: left;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.ace_scroller {\n position: absolute;\n overflow: hidden;\n top: 0;\n bottom: 0;\n background-color: inherit;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n cursor: text;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n min-width: 100%;\n contain: style size layout;\n font-variant-ligatures: no-common-ligatures;\n}\n\n.ace_keyboard-focus:focus {\n box-shadow: inset 0 0 0 2px #5E9ED6;\n outline: none;\n}\n\n.ace_dragging .ace_scroller:before{\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: \'\';\n background: rgba(250, 250, 250, 0.01);\n z-index: 1000;\n}\n.ace_dragging.ace_dark .ace_scroller:before{\n background: rgba(0, 0, 0, 0.01);\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n width: auto;\n top: 0;\n bottom: 0;\n left: 0;\n cursor: default;\n z-index: 4;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n contain: style size layout;\n}\n\n.ace_gutter-active-line {\n position: absolute;\n left: 0;\n right: 0;\n}\n\n.ace_scroller.ace_scroll-left:after {\n content: "";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n pointer-events: none;\n}\n\n.ace_gutter-cell, .ace_gutter-cell_svg-icons {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-left: 19px;\n padding-right: 6px;\n background-repeat: no-repeat;\n}\n\n.ace_gutter-cell_svg-icons .ace_gutter_annotation {\n margin-left: -14px;\n float: left;\n}\n\n.ace_gutter-cell .ace_gutter_annotation {\n margin-left: -19px;\n float: left;\n}\n\n.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info, .ace_icon.ace_info {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");\n}\n\n.ace_icon_svg.ace_error {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");\n background-color: darkorange;\n}\n.ace_icon_svg.ace_info {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");\n background-color: royalblue;\n}\n\n.ace_icon_svg.ace_error_fold {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvM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EuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");\n background-color: darkorange;\n}\n\n.ace_scrollbar {\n contain: strict;\n position: absolute;\n right: 0;\n bottom: 0;\n z-index: 6;\n}\n\n.ace_scrollbar-inner {\n position: absolute;\n cursor: text;\n left: 0;\n top: 0;\n}\n\n.ace_scrollbar-v{\n overflow-x: hidden;\n overflow-y: scroll;\n top: 0;\n}\n\n.ace_scrollbar-h {\n overflow-x: scroll;\n overflow-y: hidden;\n left: 0;\n}\n\n.ace_print-margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_text-input {\n position: absolute;\n z-index: 0;\n width: 0.5em;\n height: 1em;\n opacity: 0;\n background: transparent;\n -moz-appearance: none;\n appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n font: inherit;\n padding: 0 1px;\n margin: 0 -1px;\n contain: strict;\n -ms-user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n user-select: text;\n /*with `pre-line` chrome inserts   instead of space*/\n white-space: pre!important;\n}\n.ace_text-input.ace_composition {\n background: transparent;\n color: inherit;\n z-index: 1000;\n opacity: 1;\n}\n.ace_composition_placeholder { color: transparent }\n.ace_composition_marker { \n border-bottom: 1px solid;\n position: absolute;\n border-radius: 0;\n margin-top: 1px;\n}\n\n[ace_nocontext=true] {\n transform: none!important;\n filter: none!important;\n clip-path: none!important;\n mask : none!important;\n contain: none!important;\n perspective: none!important;\n mix-blend-mode: initial!important;\n z-index: auto;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/\n word-wrap: normal;\n white-space: pre;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter-layer {\n position: relative;\n width: auto;\n text-align: right;\n pointer-events: auto;\n height: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer {\n font: inherit !important;\n position: absolute;\n height: 1000000px;\n width: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\n contain: style size layout;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n contain: strict;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n box-sizing: border-box;\n border-left: 2px solid;\n /* workaround for smooth cursor repaintng whole screen in chrome */\n transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n border-left-width: 0;\n border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: step-end;\n animation-name: blink-ace-animate;\n animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: ease-in-out;\n animation-name: blink-ace-animate-smooth;\n}\n \n@keyframes blink-ace-animate {\n from, to { opacity: 1; }\n 60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n from, to { opacity: 1; }\n 45% { opacity: 1; }\n 60% { opacity: 0; }\n 85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n position: absolute;\n border-bottom: 1px solid #DE5555;\n border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n\n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image:\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n border-radius: 2px;\n\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image:\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");\n}\n\n.ace_tooltip {\n background-color: #f5f5f5;\n border: 1px solid gray;\n border-radius: 1px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n color: black;\n max-width: 100%;\n padding: 3px 4px;\n position: fixed;\n z-index: 999999;\n box-sizing: border-box;\n cursor: default;\n white-space: pre-wrap;\n word-wrap: break-word;\n line-height: normal;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n pointer-events: none;\n overflow: auto;\n max-width: min(60em, 66vw);\n overscroll-behavior: contain;\n}\n.ace_tooltip pre {\n white-space: pre-wrap;\n}\n\n.ace_tooltip.ace_dark {\n background-color: #636363;\n color: #fff;\n}\n\n.ace_tooltip:focus {\n outline: 1px solid #5E9ED6;\n}\n\n.ace_icon {\n display: inline-block;\n width: 18px;\n vertical-align: top;\n}\n\n.ace_icon_svg {\n display: inline-block;\n width: 12px;\n vertical-align: top;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: 12px;\n -webkit-mask-position: center;\n}\n\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n\n margin: 0 -12px 0 1px;\n display: none;\n width: 11px;\n vertical-align: top;\n\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: center;\n\n border-radius: 3px;\n \n border: 1px solid transparent;\n cursor: pointer;\n}\n\n.ace_folding-enabled .ace_fold-widget {\n display: inline-block; \n}\n\n.ace_fold-widget.ace_end {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");\n}\n\n.ace_fold-widget.ace_closed {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n/**\n * Dark version for fold widgets\n */\n.ace_dark .ace_fold-widget {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");\n}\n.ace_dark .ace_fold-widget.ace_end {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");\n}\n.ace_dark .ace_fold-widget.ace_closed {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");\n}\n.ace_dark .ace_fold-widget:hover {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n background-color: rgba(255, 255, 255, 0.1);\n}\n.ace_dark .ace_fold-widget:active {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n\n.ace_inline_button {\n border: 1px solid lightgray;\n display: inline-block;\n margin: -1px 8px;\n padding: 0 5px;\n pointer-events: auto;\n cursor: pointer;\n}\n.ace_inline_button:hover {\n border-color: gray;\n background: rgba(200,200,200,0.2);\n display: inline-block;\n pointer-events: auto;\n}\n\n.ace_fold-widget.ace_invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n transition: opacity 0.4s ease 0.05s;\n opacity: 0;\n}\n\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n transition: opacity 0.05s ease 0.05s;\n opacity:1;\n}\n\n.ace_underline {\n text-decoration: underline;\n}\n\n.ace_bold {\n font-weight: bold;\n}\n\n.ace_nobold .ace_bold {\n font-weight: normal;\n}\n\n.ace_italic {\n font-style: italic;\n}\n\n\n.ace_error-marker {\n background-color: rgba(255, 0, 0,0.2);\n position: absolute;\n z-index: 9;\n}\n\n.ace_highlight-marker {\n background-color: rgba(255, 255, 0,0.2);\n position: absolute;\n z-index: 8;\n}\n\n.ace_mobile-menu {\n position: absolute;\n line-height: 1.5;\n border-radius: 4px;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n background: white;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #dcdcdc;\n color: black;\n}\n.ace_dark > .ace_mobile-menu {\n background: #333;\n color: #ccc;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #444;\n\n}\n.ace_mobile-button {\n padding: 2px;\n cursor: pointer;\n overflow: hidden;\n}\n.ace_mobile-button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_mobile-button:active {\n background-color: #ddd;\n}\n\n.ace_placeholder {\n font-family: arial;\n transform: scale(0.9);\n transform-origin: left;\n white-space: pre;\n opacity: 0.7;\n margin: 0 10px;\n}\n\n.ace_ghost_text {\n opacity: 0.5;\n font-style: italic;\n}\n\n.ace_ghost_text > div {\n white-space: pre;\n}\n\n.ghost_text_line_wrapped::after {\n content: "↩";\n position: absolute;\n}\n\n.ace_lineWidgetContainer.ace_ghost_text {\n margin: 0px 4px\n}\n\n.ace_screenreader-only {\n position:absolute;\n left:-10000px;\n top:auto;\n width:1px;\n height:1px;\n overflow:hidden;\n}'})),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,n){"use strict";var o=e("../lib/dom"),r=e("../lib/oop"),i=e("../lib/event_emitter").EventEmitter,a=function(){function e(e,t){this.canvas=o.createElement("canvas"),this.renderer=t,this.pixelRatio=1,this.maxHeight=t.layerConfig.maxHeight,this.lineHeight=t.layerConfig.lineHeight,this.canvasHeight=e.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=e.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},e.element.appendChild(this.canvas)}return e.prototype.$updateDecorators=function(e){var t=!0===this.renderer.theme.isDark?this.colors.dark:this.colors.light;e&&(this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height,(e.lastRow+1)*this.lineHeightt.priority?1:0}));for(var i=this.renderer.session.$foldData,a=0;athis.canvasHeight&&(h=this.canvasHeight-this.halfMinDecorationHeight),d=Math.round(h-this.halfMinDecorationHeight),u=Math.round(h+this.halfMinDecorationHeight)}n.fillStyle=t[o[a].type]||null,n.fillRect(0,c,this.canvasWidth,u-d)}}var p=this.renderer.session.selection.getCursor();if(p){l=this.compensateFoldRows(p.row,i),c=Math.round((p.row-l)*this.lineHeight*this.heightRatio);n.fillStyle="rgba(0, 0, 0, 0.5)",n.fillRect(0,c,this.canvasWidth,2)}},e.prototype.compensateFoldRows=function(e,t){var n=0;if(t&&t.length>0)for(var o=0;ot[o].start.row&&e=t[o].end.row&&(n+=t[o].end.row-t[o].start.row);return n},e}();r.implement(a.prototype,i),t.Decorator=a})),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent"],(function(e,t,n){"use strict";var o=e("./lib/oop"),r=e("./lib/dom"),i=e("./lib/lang"),a=e("./config"),s=e("./layer/gutter").Gutter,l=e("./layer/marker").Marker,c=e("./layer/text").Text,d=e("./layer/cursor").Cursor,u=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,p=e("./scrollbar_custom").HScrollBar,f=e("./scrollbar_custom").VScrollBar,m=e("./renderloop").RenderLoop,g=e("./layer/font_metrics").FontMetrics,b=e("./lib/event_emitter").EventEmitter,y=e("./css/editor-css"),v=e("./layer/decorators").Decorator,_=e("./lib/useragent");r.importCssString(y,"ace_editor.css",!1);var k=function(){function e(e,t){var n=this;this.container=e||r.createElement("div"),r.addCssClass(this.container,"ace_editor"),r.HI_DPI&&r.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),null==a.get("useStrictCSP")&&a.set("useStrictCSP",!1),this.$gutter=r.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=r.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=r.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new s(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new l(this.content);var o=this.$textLayer=new c(this.content);this.canvas=o.element,this.$markerFront=new l(this.content),this.$cursorLayer=new d(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.on("scroll",(function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)})),this.scrollBarH.on("scroll",(function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)})),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new g(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",(function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)})),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!_.isIOS,this.$loop=new m(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),a.resetOptions(this),a._signal("renderer",this)}return e.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),r.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},e.prototype.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},e.prototype.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},e.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},e.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},e.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},e.prototype.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},e.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},e.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},e.prototype.onResize=function(e,t,n,o){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var r=this.container;o||(o=r.clientHeight||r.scrollHeight),n||(n=r.clientWidth||r.scrollWidth);var i=this.$updateCachedSize(e,t,n,o);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!n&&!o)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(i|this.$changes,!0):this.$loop.schedule(i|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},e.prototype.$updateCachedSize=function(e,t,n,o){o-=this.$extraHeight||0;var i=0,a=this.$size,s={width:a.width,height:a.height,scrollerHeight:a.scrollerHeight,scrollerWidth:a.scrollerWidth};if(o&&(e||a.height!=o)&&(a.height=o,i|=this.CHANGE_SIZE,a.scrollerHeight=a.height,this.$horizScroll&&(a.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(a.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",i|=this.CHANGE_SCROLL),n&&(e||a.width!=n)){i|=this.CHANGE_SIZE,a.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,r.setStyle(this.scrollBarH.element.style,"left",t+"px"),r.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),a.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),r.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";r.setStyle(this.scrollBarH.element.style,"right",l),r.setStyle(this.scroller.style,"right",l),r.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(a.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(i|=this.CHANGE_FULL)}return a.$dirty=!n||!o,i&&this._signal("resize",s),i},e.prototype.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},e.prototype.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},e.prototype.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},e.prototype.getAnimatedScroll=function(){return this.$animatedScroll},e.prototype.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},e.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},e.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},e.prototype.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},e.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},e.prototype.setHighlightIndentGuides=function(e){this.setOption("highlightIndentGuides",e)},e.prototype.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},e.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},e.prototype.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},e.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},e.prototype.getShowGutter=function(){return this.getOption("showGutter")},e.prototype.setShowGutter=function(e){return this.setOption("showGutter",e)},e.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},e.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},e.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},e.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},e.prototype.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=r.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=r.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},e.prototype.getContainerElement=function(){return this.container},e.prototype.getMouseEventTarget=function(){return this.scroller},e.prototype.getTextAreaContainer=function(){return this.container},e.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var o=this.layerConfig,i=n.top,a=n.left;i-=o.offset;var s=t&&t.useTextareaForIME||_.isMobile?this.lineHeight:1;if(i<0||i>o.height-s)r.translate(this.textarea,0,0);else{var l=1,c=this.$size.height-s;if(t)if(t.useTextareaForIME){var d=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(d)[0]}else i+=this.lineHeight+2;else i+=this.lineHeight;(a-=this.scrollLeft)>this.$size.scrollerWidth-l&&(a=this.$size.scrollerWidth-l),a+=this.gutterWidth+this.margin.left,r.setStyle(e,"height",s+"px"),r.setStyle(e,"width",l+"px"),r.translate(this.textarea,Math.min(a,this.$size.scrollerWidth-l),Math.min(i,c))}}}else r.translate(this.textarea,-100,0)}},e.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},e.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},e.prototype.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},e.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},e.prototype.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},e.prototype.setScrollMargin=function(e,t,n,o){var r=this.scrollMargin;r.top=0|e,r.bottom=0|t,r.right=0|o,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,r.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-r.top),this.updateFull()},e.prototype.setMargin=function(e,t,n,o){var r=this.margin;r.top=0|e,r.bottom=0|t,r.right=0|o,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},e.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},e.prototype.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},e.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},e.prototype.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},e.prototype.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},e.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},e.prototype.freeze=function(){this.$frozen=!0},e.prototype.unfreeze=function(){this.$frozen=!1},e.prototype.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var o=this.scrollTop+(n.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;o>0&&(this.scrollTop=o,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),r.translate(this.content,-this.scrollLeft,-n.offset);var i=n.width+2*this.$padding+"px",a=n.minHeight+"px";r.setStyle(this.content.style,"width",i),r.setStyle(this.content.style,"height",a)}if(e&this.CHANGE_H_SCROLL&&(r.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_LINES?((this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender",e)}else this.$changes|=e},e.prototype.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var o=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||o!=this.$vScroll){o!=this.$vScroll&&(this.$vScroll=o,this.scrollBarV.setVisible(o));var r=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,r,n),this.desiredHeight=n,this._signal("autosize")}},e.prototype.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,o=this.session.getScreenLength()*this.lineHeight,r=this.$getLongestLine(),i=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-r-2*this.$padding<0),a=this.$horizScroll!==i;a&&(this.$horizScroll=i,this.scrollBarH.setVisible(i));var s=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,c=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;o+=c;var d=this.scrollMargin;this.session.setScrollTop(Math.max(-d.top,Math.min(this.scrollTop,o-t.scrollerHeight+d.bottom))),this.session.setScrollLeft(Math.max(-d.left,Math.min(this.scrollLeft,r+2*this.$padding-t.scrollerWidth+d.right)));var u=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-o+c<0||this.scrollTop>d.top),h=s!==u;h&&(this.$vScroll=u,this.scrollBarV.setVisible(u));var p,f,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,b=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),y=b+g,v=this.lineHeight;b=e.screenToDocumentRow(b,0);var _=e.getFoldLine(b);_&&(b=_.start.row),p=e.documentToScreenRow(b,0),f=e.getRowLength(b)*v,y=Math.min(e.screenToDocumentRow(y,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(y)*v+f,m=this.scrollTop-p*v;var k=0;return(this.layerConfig.width!=r||a)&&(k=this.CHANGE_H_SCROLL),(a||h)&&(k|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),h&&(r=this.$getLongestLine())),this.layerConfig={width:r,padding:this.$padding,firstRow:b,firstRowScreen:p,lastRow:y,lineHeight:v,characterWidth:this.characterWidth,minHeight:l,maxHeight:o,offset:m,gutterOffset:v?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/v)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(r-this.$padding),k},e.prototype.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},e.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},e.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},e.prototype.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},e.prototype.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},e.prototype.updateBreakpoints=function(e){this._rows=e,this.$loop.schedule(this.CHANGE_GUTTER)},e.prototype.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},e.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},e.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},e.prototype.showCursor=function(){this.$cursorLayer.showCursor()},e.prototype.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},e.prototype.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var o=this.$cursorLayer.getPixelPosition(e),r=o.left,i=o.top,a=n&&n.top||0,s=n&&n.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+a>i?(t&&l+a>i+this.lineHeight&&(i-=t*this.$size.scrollerHeight),0===i&&(i=-this.scrollMargin.top),this.session.setScrollTop(i)):l+this.$size.scrollerHeight-s=1-this.scrollMargin.top||(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||(e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0)))},e.prototype.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var o=this.$fontMetrics.transformCoordinates([e,t]);e=o[1]-this.gutterWidth-this.margin.left,t=o[0]}else n=this.scroller.getBoundingClientRect();var r=e+this.scrollLeft-n.left-this.$padding,i=r/this.characterWidth,a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),s=this.$blockCursor?Math.floor(i):Math.round(i);return{row:a,column:s,side:i-s>0?1:-1,offsetX:r}},e.prototype.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var o=this.$fontMetrics.transformCoordinates([e,t]);e=o[1]-this.gutterWidth-this.margin.left,t=o[0]}else n=this.scroller.getBoundingClientRect();var r=e+this.scrollLeft-n.left-this.$padding,i=r/this.characterWidth,a=this.$blockCursor?Math.floor(i):Math.round(i),s=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(s,Math.max(a,0),r)},e.prototype.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),o=this.session.documentToScreenPosition(e,t),r=this.$padding+(this.session.$bidiHandler.isBidiRow(o.row,e)?this.session.$bidiHandler.getPosLeft(o.column):Math.round(o.column*this.characterWidth)),i=o.row*this.lineHeight;return{pageX:n.left+r-this.scrollLeft,pageY:n.top+i-this.scrollTop}},e.prototype.visualizeFocus=function(){r.addCssClass(this.container,"ace_focus")},e.prototype.visualizeBlur=function(){r.removeCssClass(this.container,"ace_focus")},e.prototype.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),null==e.useTextareaForIME&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(r.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},e.prototype.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},e.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),r.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var e=this.session.selection.cursor;this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},e.prototype.setGhostText=function(e,t){var n=this.session.selection.cursor,o=t||{row:n.row,column:n.column};this.removeGhostText();var r=this.$calculateWrappedTextChunks(e,o);if(this.addToken(r[0].text,"ghost_text",o.row,o.column),this.$ghostText={text:e,position:{row:o.row,column:o.column}},r.length>1){var i=r.slice(1).map((function(e){return"").concat(e.text,"")}));this.$ghostTextWidget={html:i.join(""),row:o.row,column:o.column,className:"ace_ghost_text"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var a=this.$cursorLayer.getPixelPosition(o,!0),s=this.container.getBoundingClientRect().height,l=r.length*this.lineHeight;if(l0){var c=0;l.push(r[a].length);for(var d=0;d1||Math.abs(e.$size.height-o)>1?e.$resizeTimer.delay():e.$resizeTimer.cancel()})),this.$resizeObserver.observe(this.container)}},e}();k.prototype.CHANGE_CURSOR=1,k.prototype.CHANGE_MARKER=2,k.prototype.CHANGE_GUTTER=4,k.prototype.CHANGE_SCROLL=8,k.prototype.CHANGE_LINES=16,k.prototype.CHANGE_TEXT=32,k.prototype.CHANGE_SIZE=64,k.prototype.CHANGE_MARKER_BACK=128,k.prototype.CHANGE_MARKER_FRONT=256,k.prototype.CHANGE_FULL=512,k.prototype.CHANGE_H_SCROLL=1024,k.prototype.$changes=0,k.prototype.$padding=null,k.prototype.$frozen=!1,k.prototype.STEPS=8,o.implement(k.prototype,b),a.defineOptions(k.prototype,"renderer",{useResizeObserver:{set:function(e){!e&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):e&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(e){this.$gutterLayer.$useSvgGutterIcons=e},initialValue:!1},showFoldedAnnotations:{set:function(e){this.$gutterLayer.$showFoldedAnnotations=e},initialValue:!1},fadeFoldWidgets:{set:function(e){r.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(e){1==this.$textLayer.setHighlightIndentGuides(e)?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){this.$hScrollBarAlwaysVisible&&this.$horizScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){this.$vScrollBarAlwaysVisible&&this.$vScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof e&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(e){this.$updateCustomScrollbar(e)},initialValue:!1},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!_.isMobile&&!_.isIE}}),t.VirtualRenderer=k})),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],(function(e,t,n){"use strict";var o=e("../lib/oop"),r=e("../lib/net"),i=e("../lib/event_emitter").EventEmitter,a=e("../config");function s(e){if("undefined"==typeof Worker)return{postMessage:function(){},terminate:function(){}};if(a.get("loadWorkerFromBlob")){var t=function(e){var t="importScripts('"+r.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return n.append(t),n.getBlob("application/javascript")}}(e),n=(window.URL||window.webkitURL).createObjectURL(t);return new Worker(n)}return new Worker(e)}var l=function(e){e.postMessage||(e=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=e,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){o.implement(this,i),this.$createWorkerFromOldConfig=function(t,n,o,r,i){if(e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),a.get("packaged")||!e.toUrl)r=r||a.moduleUrl(n,"worker");else{var l=this.$normalizePath;r=r||l(e.toUrl("ace/worker/worker.js",null,"_"));var c={};t.forEach((function(t){c[t]=l(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))}))}return this.$worker=s(r),i&&this.send("importScripts",i),this.$worker.postMessage({init:!0,tlns:c,module:n,classname:o}),this.$worker},this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var n=this.callbacks[t.id];n&&(n(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return r.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(e){e.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,n){if(n){var o=this.callbackId++;this.callbacks[o]=n,t.push(o)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker&&this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener,!0)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,e.length>50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype);t.UIWorkerClient=function(e,t,n){var o=null,r=!1,s=Object.create(i),c=[],d=new l({messageBuffer:c,terminate:function(){},postMessage:function(e){c.push(e),o&&(r?setTimeout(u):u())}});d.setEmitSync=function(e){r=e};var u=function(){var e=c.shift();e.command?o[e.command].apply(o,e.args):e.event&&s._signal(e.event,e.data)};return s.postMessage=function(e){d.onMessage({data:e})},s.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},s.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},a.loadModule(["worker",t],(function(e){for(o=new e[n](s);c.length;)u()})),d},t.WorkerClient=l,t.createWorker=s})),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],(function(e,t,n){"use strict";var o=e("./range").Range,r=e("./lib/event_emitter").EventEmitter,i=e("./lib/oop"),a=function(){function e(e,t,n,o,r,i){var a=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=r,this.othersClass=i,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=o,this.$onCursorChange=function(){setTimeout((function(){a.onCursorChange()}))},this.$pos=n;var s=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=s.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}return e.prototype.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var r=this.pos;r.$insertRight=!0,r.detach(),r.markerId=n.addMarker(new o(r.row,r.column,r.row,r.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach((function(n){var o=t.createAnchor(n.row,n.column);o.$insertRight=!0,o.detach(),e.others.push(o)})),n.setUndoSelect(!1)},e.prototype.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach((function(n){n.markerId=e.addMarker(new o(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)}))}},e.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,i=t.start.column-this.pos.column;if(this.updateAnchors(e),r&&(this.length+=n),r&&!this.session.$fromUndo)if("insert"===e.action)for(var a=this.others.length-1;a>=0;a--){var s={row:(l=this.others[a]).row,column:l.column+i};this.doc.insertMergedLines(s,e.lines)}else if("remove"===e.action)for(a=this.others.length-1;a>=0;a--){var l;s={row:(l=this.others[a]).row,column:l.column+i};this.doc.remove(new o(s.row,s.column,s.row,s.column-n))}this.$updating=!1,this.updateMarkers()}},e.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},e.prototype.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,r){t.removeMarker(n.markerId),n.markerId=t.addMarker(new o(n.row,n.column,n.row,n.column+e.length),r,null,!1)};n(this.pos,this.mainClass);for(var r=this.others.length;r--;)n(this.others[r],this.othersClass)}},e.prototype.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},e.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},e.prototype.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var o=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new o(t.multiSelectCommands)})),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],(function(e,t,n){var o=e("./range_list").RangeList,r=e("./range").Range,i=e("./selection").Selection,a=e("./mouse/multi_select_handler").onMouseDown,s=e("./lib/event"),l=e("./lib/lang"),c=e("./commands/multi_select_commands");t.commands=c.defaultCommands.concat(c.multiSelectCommands);var d=new(0,e("./search").Search);var u=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(u.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}e.cursor||(e.cursor=e.end);var o=this.rangeList.add(e);return this.$onAddRange(e),o.length&&this.$onRemoveRange(o),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var o=this.ranges.indexOf(e[n]);this.ranges.splice(o,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new o,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var e=this.ranges.length?this.ranges:[this.getRange()],t=[],n=0;n1){var e=this.rangeList.ranges,t=e[e.length-1],n=r.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var o=this.session.documentToScreenPosition(this.cursor),i=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(o,i).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var o=[],i=e.column0;)y--;if(y>0)for(var v=0;o[v].isEmpty();)v++;for(var _=y;_>=v;_--)o[_].isEmpty()&&o.splice(_,1)}return o}}.call(i.prototype);var h=e("./editor").Editor;function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",a),e.commands.addCommands(c.defaultCommands),function(e){if(!e.textInput)return;var t=e.textInput.getElement(),n=!1;function o(t){n&&(e.renderer.setMouseCursor(""),n=!1)}s.addListener(t,"keydown",(function(t){var r=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&r?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&o()}),e),s.addListener(t,"keyup",o,e),s.addListener(t,"blur",o,e)}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var o=e[n];if(o.marker){this.session.removeMarker(o.marker);var r=t.indexOf(o);-1!=r&&t.splice(r,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(c.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(c.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?o=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?o=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),o=t.exec(n,e.args||{})):o=t.multiSelectAction(n,e.args||{});else{var o=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return o}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var o,r=n&&n.keepOrder,a=1==n||n&&n.$byLines,s=this.session,l=this.selection,c=l.rangeList,d=(r?l:c).ranges;if(!d.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var u=l._eventRegistry;l._eventRegistry={};var h=new i(s);this.inVirtualSelectionMode=!0;for(var p=d.length;p--;){if(a)for(;p>0&&d[p].start.row==d[p-1].end.row;)p--;h.fromOrientedRange(d[p]),h.index=p,this.selection=s.selection=h;var f=e.exec?e.exec(this,t||{}):e(this,t||{});o||void 0===f||(o=f),h.toOrientedRange(d[p])}h.detach(),this.selection=s.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=u,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),o}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],o=0;oa&&(a=n.column),od?e.insert(o,l.stringRepeat(" ",i-d)):e.remove(new r(o.row,o.column,o.row,o.column-i+d)),t.start.column=t.end.column=a,t.start.row=t.end.row=o.row,t.cursor=t.end})),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var d=this.selection.getRange(),u=d.start.row,h=d.end.row,p=u==h;if(p){var f,m=this.session.getLength();do{f=this.session.getLine(h)}while(/[=:]/.test(f)&&++h0);u<0&&(u=0),h>=m&&(h=m-1)}var g=this.session.removeFullLines(u,h);g=this.$reAlignText(g,p),this.session.insert({row:u,column:0},g.join("\n")+"\n"),p||(d.start.column=0,d.end.column=g[g.length-1].length),this.selection.setRange(d)}},this.$reAlignText=function(e,t){var n,o,r,i=!0,a=!0;return e.map((function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,o=t[2].length,r=t[3].length,t):(n+o+r!=t[1].length+t[2].length+t[3].length&&(a=!1),n!=t[1].length&&(i=!1),n>t[1].length&&(n=t[1].length),ot[3].length&&(r=t[3].length),t):[e]})).map(t?c:i?a?function(e){return e[2]?s(n+o-e[2].length)+e[2]+s(r)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:c:function(e){return e[2]?s(n)+e[2]+s(r)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function s(e){return l.stringRepeat(" ",e)}function c(e){return e[2]?s(n)+e[2]+s(o-e[2].length+r)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(h.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(h.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?this.on("mousedown",a):this.off("mousedown",a)},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})})),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var o=e("../../range").Range,r=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var o=e.getLine(n);return this.foldingStartMarker.test(o)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(o)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var r=/\S/,i=e.getLine(t),a=i.search(r);if(-1!=a){for(var s=n||i.length,l=e.getLength(),c=t,d=t;++tc){var p=e.getLine(d).length;return new o(c,s,d,p)}}},this.openingBracketBlock=function(e,t,n,r,i){var a={row:n,column:r+1},s=e.$findClosingBracket(t,a,i);if(s){var l=e.foldWidgets[s.row];return null==l&&(l=e.getFoldWidget(s.row)),"start"==l&&s.row>a.row&&(s.row--,s.column=e.getLine(s.row).length),o.fromPoints(a,s)}},this.closingBracketBlock=function(e,t,n,r,i){var a={row:n,column:r},s=e.$findOpeningBracket(t,a);if(s)return s.column++,a.column--,o.fromPoints(s,a)}}).call(r.prototype)})),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],(function(e,t,n){"use strict";var o=e("../line_widgets").LineWidgets,r=e("../lib/dom"),i=e("../range").Range,a=e("../config").nls;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new o(n),n.widgetManager.attach(e));var s=e.getCursorPosition(),l=s.row,c=n.widgetManager.getWidgetsAtRow(l).filter((function(e){return"errorMarker"==e.type}))[0];c?c.destroy():l-=t;var d,u=function(e,t,n){var o=e.getAnnotations().sort(i.comparePoints);if(o.length){var r=function(e,t,n){for(var o=0,r=e.length-1;o<=r;){var i=o+r>>1,a=n(t,e[i]);if(a>0)o=i+1;else{if(!(a<0))return i;r=i-1}}return-(o+1)}(o,{row:t,column:-1},i.comparePoints);r<0&&(r=-r-1),r>=o.length?r=n>0?0:o.length-1:0===r&&n<0&&(r=o.length-1);var a=o[r];if(a&&n){if(a.row===t){do{a=o[r+=n]}while(a&&a.row===t);if(!a)return o.slice()}var s=[];t=a.row;do{s[n<0?"unshift":"push"](a),a=o[r+=n]}while(a&&a.row==t);return s.length&&s}}}(n,l,t);if(u){var h=u[0];s.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,s.row=h.row,d=e.renderer.$gutterLayer.$annotations[s.row]}else{if(c)return;d={text:[a("error-marker.good-state","Looks good!")],className:"ace_ok"}}e.session.unfold(s.row),e.selection.moveToPosition(s);var p={row:s.row,fixedWidth:!0,coverGutter:!0,el:r.createElement("div"),type:"errorMarker"},f=p.el.appendChild(r.createElement("div")),m=p.el.appendChild(r.createElement("div"));m.className="error_widget_arrow "+d.className;var g=e.renderer.$cursorLayer.getPixelPosition(s).left;m.style.left=g+e.renderer.gutterWidth-5+"px",p.el.className="error_widget_wrapper",f.className="error_widget "+d.className,f.innerHTML=d.text.join("
"),f.appendChild(r.createElement("div"));var b=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return p.destroy(),{command:"null"}};p.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(b),n.widgetManager.removeLineWidget(p),e.off("changeSelection",p.destroy),e.off("changeSession",p.destroy),e.off("mouseup",p.destroy),e.off("change",p.destroy))},e.keyBinding.addKeyboardHandler(b),e.on("changeSelection",p.destroy),e.on("changeSession",p.destroy),e.on("mouseup",p.destroy),e.on("change",p.destroy),e.session.widgetManager.addLineWidget(p),p.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:p.el.offsetHeight})},r.importCssString("\n .error_widget_wrapper {\n background: inherit;\n color: inherit;\n border:none\n }\n .error_widget {\n border-top: solid 2px;\n border-bottom: solid 2px;\n margin: 5px 0;\n padding: 10px 40px;\n white-space: pre-wrap;\n }\n .error_widget.ace_error, .error_widget_arrow.ace_error{\n border-color: #ff5a5a\n }\n .error_widget.ace_warning, .error_widget_arrow.ace_warning{\n border-color: #F1D817\n }\n .error_widget.ace_info, .error_widget_arrow.ace_info{\n border-color: #5a5a5a\n }\n .error_widget.ace_ok, .error_widget_arrow.ace_ok{\n border-color: #5aaa5a\n }\n .error_widget_arrow {\n position: absolute;\n border: solid 5px;\n border-top-color: transparent!important;\n border-right-color: transparent!important;\n border-left-color: transparent!important;\n top: -5px;\n }\n","error_marker.css",!1)})),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],(function(e,t,n){"use strict";e("./loader_build")(t);var o=e("./lib/dom"),r=e("./range").Range,i=e("./editor").Editor,a=e("./edit_session").EditSession,s=e("./undomanager").UndoManager,l=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof i)return e.env.editor;var a="";if(e&&/input|textarea/i.test(e.tagName)){var s=e;a=s.value,e=o.createElement("pre"),s.parentNode.replaceChild(e,s)}else e&&(a=e.textContent,e.innerHTML="");var c=t.createEditSession(a),d=new i(new l(e),c,n),u={document:c,editor:d,onResize:d.resize.bind(d,null)};return s&&(u.textarea=s),d.on("destroy",(function(){u.editor.container.env=null})),d.container.env=d.env=u,d},t.createEditSession=function(e,t){var n=new a(e,t);return n.setUndoManager(new s),n},t.Range=r,t.Editor=i,t.EditSession=a,t.UndoManager=s,t.VirtualRenderer=l,t.version=t.config.version})),ace.require(["ace/ace"],(function(t){t&&(t.config.init(!0),t.define=ace.define);var n=function(){return this}();for(var o in n||"undefined"==typeof window||(n=window),n||"undefined"==typeof self||(n=self),n.ace||(n.ace=t),t)t.hasOwnProperty(o)&&(n.ace[o]=t[o]);n.ace.default=n.ace,e&&(e.exports=n.ace)}))},93391:(e,t,n)=>{e=n.nmd(e),ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],(function(e,t,n){"use strict";var o,r=e("./lib/oop"),i=(e("./lib/lang"),e("./lib/event_emitter").EventEmitter),a=e("./editor").Editor,s=e("./virtual_renderer").VirtualRenderer,l=e("./edit_session").EditSession;(function(){r.implement(this,i),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new a(new s(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e!=this.$splits){if(e>this.$splits){for(;this.$splitse;)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach((function(t){t.setTheme(e)}))},this.setKeyboardHandler=function(e){this.$editors.forEach((function(t){t.setKeyboardHandler(e)}))},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach((function(t){t.setFontSize(e)}))},this.$cloneSession=function(e){var t=new l(e.getDocument(),e.getMode()),n=e.getUndoManager();return t.setUndoManager(n),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;n=null==t?this.$cEditor:this.$editors[t];var o=this.$editors.some((function(t){return t.session===e}));return o&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){this.$orientation!=e&&(this.$orientation=e,this.resize())},this.resize=function(){var e,t=this.$container.clientWidth,n=this.$container.clientHeight;if(this.$orientation==this.BESIDE)for(var o=t/this.$splits,r=0;r{e=n.nmd(e),ace.require(["ace/mode/text"],(function(t){e&&(e.exports=t)}))},14483:(e,t,n)=>{e=n.nmd(e),ace.define("ace/theme/dracula-css",["require","exports","module"],(function(e,t,n){n.exports='/*\n * Copyright © 2017 Zeno Rocha \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n.ace-dracula .ace_gutter {\n background: #282a36;\n color: rgb(144,145,148)\n}\n\n.ace-dracula .ace_print-margin {\n width: 1px;\n background: #44475a\n}\n\n.ace-dracula {\n background-color: #282a36;\n color: #f8f8f2\n}\n\n.ace-dracula .ace_cursor {\n color: #f8f8f0\n}\n\n.ace-dracula .ace_marker-layer .ace_selection {\n background: #44475a\n}\n\n.ace-dracula.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #282a36;\n border-radius: 2px\n}\n\n.ace-dracula .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174)\n}\n\n.ace-dracula .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a29709\n}\n\n.ace-dracula .ace_marker-layer .ace_active-line {\n background: #44475a\n}\n\n.ace-dracula .ace_gutter-active-line {\n background-color: #44475a\n}\n\n.ace-dracula .ace_marker-layer .ace_selected-word {\n box-shadow: 0px 0px 0px 1px #a29709;\n border-radius: 3px;\n}\n\n.ace-dracula .ace_fold {\n background-color: #50fa7b;\n border-color: #f8f8f2\n}\n\n.ace-dracula .ace_keyword {\n color: #ff79c6\n}\n\n.ace-dracula .ace_constant.ace_language {\n color: #bd93f9\n}\n\n.ace-dracula .ace_constant.ace_numeric {\n color: #bd93f9\n}\n\n.ace-dracula .ace_constant.ace_character {\n color: #bd93f9\n}\n\n.ace-dracula .ace_constant.ace_character.ace_escape {\n color: #ff79c6\n}\n\n.ace-dracula .ace_constant.ace_other {\n color: #bd93f9\n}\n\n.ace-dracula .ace_support.ace_function {\n color: #8be9fd\n}\n\n.ace-dracula .ace_support.ace_constant {\n color: #6be5fd\n}\n\n.ace-dracula .ace_support.ace_class {\n font-style: italic;\n color: #66d9ef\n}\n\n.ace-dracula .ace_support.ace_type {\n font-style: italic;\n color: #66d9ef\n}\n\n.ace-dracula .ace_storage {\n color: #ff79c6\n}\n\n.ace-dracula .ace_storage.ace_type {\n font-style: italic;\n color: #8be9fd\n}\n\n.ace-dracula .ace_invalid {\n color: #F8F8F0;\n background-color: #ff79c6\n}\n\n.ace-dracula .ace_invalid.ace_deprecated {\n color: #F8F8F0;\n background-color: #bd93f9\n}\n\n.ace-dracula .ace_string {\n color: #f1fa8c\n}\n\n.ace-dracula .ace_comment {\n color: #6272a4\n}\n\n.ace-dracula .ace_variable {\n color: #50fa7b\n}\n\n.ace-dracula .ace_variable.ace_parameter {\n font-style: italic;\n color: #ffb86c\n}\n\n.ace-dracula .ace_entity.ace_other.ace_attribute-name {\n color: #50fa7b\n}\n\n.ace-dracula .ace_entity.ace_name.ace_function {\n color: #50fa7b\n}\n\n.ace-dracula .ace_entity.ace_name.ace_tag {\n color: #ff79c6\n}\n.ace-dracula .ace_invisible {\n color: #626680;\n}\n\n.ace-dracula .ace_indent-guide {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y\n}\n\n.ace-dracula .ace_indent-guide-active {\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACAQMAAACjTyRkAAAABlBMVEUAAADCwsK76u2xAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjYGBoAAAAhACBGFbxzQAAAABJRU5ErkJggg==") right repeat-y;\n}\n'})),ace.define("ace/theme/dracula",["require","exports","module","ace/theme/dracula-css","ace/lib/dom"],(function(e,t,n){t.isDark=!0,t.cssClass="ace-dracula",t.cssText=e("./dracula-css"),t.$selectionColorConflict=!0,e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)})),ace.require(["ace/theme/dracula"],(function(t){e&&(e.exports=t)}))},42896:(e,t,n)=>{e=n.nmd(e),ace.define("ace/theme/eclipse-css",["require","exports","module"],(function(e,t,n){n.exports='.ace-eclipse .ace_gutter {\n background: #ebebeb;\n border-right: 1px solid rgb(159, 159, 159);\n color: rgb(136, 136, 136);\n}\n\n.ace-eclipse .ace_print-margin {\n width: 1px;\n background: #ebebeb;\n}\n\n.ace-eclipse {\n background-color: #FFFFFF;\n color: black;\n}\n\n.ace-eclipse .ace_fold {\n background-color: rgb(60, 76, 114);\n}\n\n.ace-eclipse .ace_cursor {\n color: black;\n}\n\n.ace-eclipse .ace_storage,\n.ace-eclipse .ace_keyword,\n.ace-eclipse .ace_variable {\n color: rgb(127, 0, 85);\n}\n\n.ace-eclipse .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-eclipse .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-eclipse .ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-eclipse .ace_string {\n color: rgb(42, 0, 255);\n}\n\n.ace-eclipse .ace_comment {\n color: rgb(113, 150, 130);\n}\n\n.ace-eclipse .ace_comment.ace_doc {\n color: rgb(63, 95, 191);\n}\n\n.ace-eclipse .ace_comment.ace_doc.ace_tag {\n color: rgb(127, 159, 191);\n}\n\n.ace-eclipse .ace_constant.ace_numeric {\n color: darkblue;\n}\n\n.ace-eclipse .ace_tag {\n color: rgb(25, 118, 116);\n}\n\n.ace-eclipse .ace_type {\n color: rgb(127, 0, 127);\n}\n\n.ace-eclipse .ace_xml-pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-eclipse .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-eclipse .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-eclipse .ace_meta.ace_tag {\n color:rgb(25, 118, 116);\n}\n\n.ace-eclipse .ace_invisible {\n color: #ddd;\n}\n\n.ace-eclipse .ace_entity.ace_other.ace_attribute-name {\n color:rgb(127, 0, 127);\n}\n.ace-eclipse .ace_marker-layer .ace_step {\n background: rgb(255, 255, 0);\n}\n\n.ace-eclipse .ace_active-line {\n background: rgb(232, 242, 254);\n}\n\n.ace-eclipse .ace_gutter-active-line {\n background-color : #DADADA;\n}\n\n.ace-eclipse .ace_marker-layer .ace_selected-word {\n border: 1px solid rgb(181, 213, 255);\n}\n\n.ace-eclipse .ace_indent-guide {\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;\n}\n\n.ace-eclipse .ace_indent-guide-active {\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;\n} \n'})),ace.define("ace/theme/eclipse",["require","exports","module","ace/theme/eclipse-css","ace/lib/dom"],(function(e,t,n){"use strict";t.isDark=!1,t.cssText=e("./eclipse-css"),t.cssClass="ace-eclipse",e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)})),ace.require(["ace/theme/eclipse"],(function(t){e&&(e.exports=t)}))},67913:(e,t,n)=>{"use strict";var o=n(28651),r=n(26601),i=r(o("String.prototype.indexOf"));e.exports=function(e,t){var n=o(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?r(n):n}},26601:(e,t,n)=>{"use strict";var o=n(5049),r=n(28651),i=n(86255),a=n(96785),s=r("%Function.prototype.apply%"),l=r("%Function.prototype.call%"),c=r("%Reflect.apply%",!0)||o.call(l,s),d=n(56649),u=r("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new a("a function is required");var t=c(o,l,arguments);return i(t,1+u(0,e.length-(arguments.length-1)),!0)};var h=function(){return c(o,s,arguments)};d?d(e.exports,"apply",{value:h}):e.exports.apply=h},75755:(e,t)=>{var n; -/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t{function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,o=this._callbacks["$"+e];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var r=0;r{"use strict";var o=n(56649),r=n(57770),i=n(96785),a=n(68109);e.exports=function(e,t,n){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,d=arguments.length>6&&arguments[6],u=!!a&&a(e,t);if(o)o(e,t,{configurable:null===c&&u?u.configurable:!c,enumerable:null===s&&u?u.enumerable:!s,value:n,writable:null===l&&u?u.writable:!l});else{if(!d&&(s||l||c))throw new r("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=n}}},7855:e=>{var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},n=-1;t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,o,r){void 0===r&&(r=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var i=r;if(null==e||null==n)throw new Error("Null input. (diff_main)");if(e==n)return e?[new t.Diff(0,e)]:[];void 0===o&&(o=!0);var a=o,s=this.diff_commonPrefix(e,n),l=e.substring(0,s);e=e.substring(s),n=n.substring(s),s=this.diff_commonSuffix(e,n);var c=e.substring(e.length-s);e=e.substring(0,e.length-s),n=n.substring(0,n.length-s);var d=this.diff_compute_(e,n,a,i);return l&&d.unshift(new t.Diff(0,l)),c&&d.push(new t.Diff(0,c)),this.diff_cleanupMerge(d),d},t.prototype.diff_compute_=function(e,o,r,i){var a;if(!e)return[new t.Diff(1,o)];if(!o)return[new t.Diff(n,e)];var s=e.length>o.length?e:o,l=e.length>o.length?o:e,c=s.indexOf(l);if(-1!=c)return a=[new t.Diff(1,s.substring(0,c)),new t.Diff(0,l),new t.Diff(1,s.substring(c+l.length))],e.length>o.length&&(a[0][0]=a[2][0]=n),a;if(1==l.length)return[new t.Diff(n,e),new t.Diff(1,o)];var d=this.diff_halfMatch_(e,o);if(d){var u=d[0],h=d[1],p=d[2],f=d[3],m=d[4],g=this.diff_main(u,p,r,i),b=this.diff_main(h,f,r,i);return g.concat([new t.Diff(0,m)],b)}return r&&e.length>100&&o.length>100?this.diff_lineMode_(e,o,i):this.diff_bisect_(e,o,i)},t.prototype.diff_lineMode_=function(e,o,r){var i=this.diff_linesToChars_(e,o);e=i.chars1,o=i.chars2;var a=i.lineArray,s=this.diff_main(e,o,!1,r);this.diff_charsToLines_(s,a),this.diff_cleanupSemantic(s),s.push(new t.Diff(0,""));for(var l=0,c=0,d=0,u="",h="";l=1&&d>=1){s.splice(l-c-d,c+d),l=l-c-d;for(var p=this.diff_main(u,h,!1,r),f=p.length-1;f>=0;f--)s.splice(l,0,p[f]);l+=p.length}d=0,c=0,u="",h=""}l++}return s.pop(),s},t.prototype.diff_bisect_=function(e,o,r){for(var i=e.length,a=o.length,s=Math.ceil((i+a)/2),l=s,c=2*s,d=new Array(c),u=new Array(c),h=0;hr);v++){for(var _=-v+m;_<=v-g;_+=2){for(var k=l+_,w=(L=_==-v||_!=v&&d[k-1]i)g+=2;else if(w>a)m+=2;else if(f){if((M=l+p-_)>=0&&M=(S=i-u[M]))return this.diff_bisectSplit_(e,o,L,w,r)}}for(var x=-v+b;x<=v-y;x+=2){for(var S,M=l+x,T=(S=x==-v||x!=v&&u[M-1]i)y+=2;else if(T>a)b+=2;else if(!f){if((k=l+p-x)>=0&&k=(S=i-S))return this.diff_bisectSplit_(e,o,L,w,r)}}}}return[new t.Diff(n,e),new t.Diff(1,o)]},t.prototype.diff_bisectSplit_=function(e,t,n,o,r){var i=e.substring(0,n),a=t.substring(0,o),s=e.substring(n),l=t.substring(o),c=this.diff_main(i,a,!1,r),d=this.diff_main(s,l,!1,r);return c.concat(d)},t.prototype.diff_linesToChars_=function(e,t){var n=[],o={};function r(e){for(var t="",r=0,a=-1,s=n.length;ao?e=e.substring(n-o):nt.length?e:t,o=e.length>t.length?t:e;if(n.length<4||2*o.length=e.length?[o,i,a,s,d]:null}var a,s,l,c,d,u=i(n,o,Math.ceil(n.length/4)),h=i(n,o,Math.ceil(n.length/2));return u||h?(a=h?u&&u[4].length>h[4].length?u:h:u,e.length>t.length?(s=a[0],l=a[1],c=a[2],d=a[3]):(c=a[0],d=a[1],s=a[2],l=a[3]),[s,l,c,d,a[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var o=!1,r=[],i=0,a=null,s=0,l=0,c=0,d=0,u=0;s0?r[i-1]:-1,l=0,c=0,d=0,u=0,a=null,o=!0)),s++;for(o&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),s=1;s=m?(f>=h.length/2||f>=p.length/2)&&(e.splice(s,0,new t.Diff(0,p.substring(0,f))),e[s-1][1]=h.substring(0,h.length-f),e[s+1][1]=p.substring(f),s++):(m>=h.length/2||m>=p.length/2)&&(e.splice(s,0,new t.Diff(0,h.substring(0,m))),e[s-1][0]=1,e[s-1][1]=p.substring(0,p.length-m),e[s+1][0]=n,e[s+1][1]=h.substring(m),s++),s++}s++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var o=e.charAt(e.length-1),r=n.charAt(0),i=o.match(t.nonAlphaNumericRegex_),a=r.match(t.nonAlphaNumericRegex_),s=i&&o.match(t.whitespaceRegex_),l=a&&r.match(t.whitespaceRegex_),c=s&&o.match(t.linebreakRegex_),d=l&&r.match(t.linebreakRegex_),u=c&&e.match(t.blanklineEndRegex_),h=d&&n.match(t.blanklineStartRegex_);return u||h?5:c||d?4:i&&!s&&l?3:s||l?2:i||a?1:0}for(var o=1;o=h&&(h=p,c=r,d=i,u=a)}e[o-1][1]!=c&&(c?e[o-1][1]=c:(e.splice(o-1,1),o--),e[o][1]=d,u?e[o+1][1]=u:(e.splice(o+1,1),o--))}o++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var o=!1,r=[],i=0,a=null,s=0,l=!1,c=!1,d=!1,u=!1;s0?r[i-1]:-1,d=u=!1),o=!0)),s++;o&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,""));for(var o,r=0,i=0,a=0,s="",l="";r1?(0!==i&&0!==a&&(0!==(o=this.diff_commonPrefix(l,s))&&(r-i-a>0&&0==e[r-i-a-1][0]?e[r-i-a-1][1]+=l.substring(0,o):(e.splice(0,0,new t.Diff(0,l.substring(0,o))),r++),l=l.substring(o),s=s.substring(o)),0!==(o=this.diff_commonSuffix(l,s))&&(e[r][1]=l.substring(l.length-o)+e[r][1],l=l.substring(0,l.length-o),s=s.substring(0,s.length-o))),r-=i+a,e.splice(r,i+a),s.length&&(e.splice(r,0,new t.Diff(n,s)),r++),l.length&&(e.splice(r,0,new t.Diff(1,l)),r++),r++):0!==r&&0==e[r-1][0]?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,a=0,i=0,s="",l=""}""===e[e.length-1][1]&&e.pop();var c=!1;for(r=1;rt));o++)a=r,s=i;return e.length!=o&&e[o][0]===n?s:s+(t-a)},t.prototype.diff_prettyHtml=function(e){for(var t=[],o=/&/g,r=//g,a=/\n/g,s=0;s");switch(l){case 1:t[s]=''+c+"";break;case n:t[s]=''+c+"";break;case 0:t[s]=""+c+""}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;nthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var o=this.match_alphabet_(t),r=this;function i(e,o){var i=e/t.length,a=Math.abs(n-o);return r.Match_Distance?i+a/r.Match_Distance:a?1:i}var a=this.Match_Threshold,s=e.indexOf(t,n);-1!=s&&(a=Math.min(i(0,s),a),-1!=(s=e.lastIndexOf(t,n+t.length))&&(a=Math.min(i(0,s),a)));var l,c,d=1<=f;b--){var y=o[e.charAt(b-1)];if(g[b]=0===p?(g[b+1]<<1|1)&y:(g[b+1]<<1|1)&y|(u[b+1]|u[b])<<1|1|u[b+1],g[b]&d){var v=i(p,b-1);if(v<=a){if(a=v,!((s=b-1)>n))break;f=Math.max(1,2*n-s)}}}if(i(p+1,n)>a)break;u=g}return s},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(e&&"object"==typeof e&&void 0===o&&void 0===r)a=e,i=this.diff_text1(a);else if("string"==typeof e&&o&&"object"==typeof o&&void 0===r)i=e,a=o;else{if("string"!=typeof e||"string"!=typeof o||!r||"object"!=typeof r)throw new Error("Unknown call format to patch_make.");i=e,a=r}if(0===a.length)return[];for(var s=[],l=new t.patch_obj,c=0,d=0,u=0,h=i,p=i,f=0;f=2*this.Patch_Margin&&c&&(this.patch_addContext_(l,h),s.push(l),l=new t.patch_obj,c=0,h=p,d=u)}1!==m&&(d+=g.length),m!==n&&(u+=g.length)}return c&&(this.patch_addContext_(l,h),s.push(l)),s},t.prototype.patch_deepCopy=function(e){for(var n=[],o=0;othis.Match_MaxBits?-1!=(s=this.match_main(t,d.substring(0,this.Match_MaxBits),c))&&(-1==(u=this.match_main(t,d.substring(d.length-this.Match_MaxBits),c+d.length-this.Match_MaxBits))||s>=u)&&(s=-1):s=this.match_main(t,d,c),-1==s)i[a]=!1,r-=e[a].length2-e[a].length1;else if(i[a]=!0,r=s-c,d==(l=-1==u?t.substring(s,s+d.length):t.substring(s,u+this.Match_MaxBits)))t=t.substring(0,s)+this.diff_text2(e[a].diffs)+t.substring(s+d.length);else{var h=this.diff_main(d,l,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(h)/d.length>this.Patch_DeleteThreshold)i[a]=!1;else{this.diff_cleanupSemanticLossless(h);for(var p,f=0,m=0;ma[0][1].length){var s=n-a[0][1].length;a[0][1]=o.substring(a[0][1].length)+a[0][1],i.start1-=s,i.start2-=s,i.length1+=s,i.length2+=s}if(0==(a=(i=e[e.length-1]).diffs).length||0!=a[a.length-1][0])a.push(new t.Diff(0,o)),i.length1+=n,i.length2+=n;else if(n>a[a.length-1][1].length){s=n-a[a.length-1][1].length;a[a.length-1][1]+=o.substring(0,s),i.length1+=s,i.length2+=s}return o},t.prototype.patch_splitMax=function(e){for(var o=this.Match_MaxBits,r=0;r2*o?(c.length1+=h.length,a+=h.length,d=!1,c.diffs.push(new t.Diff(u,h)),i.diffs.shift()):(h=h.substring(0,o-c.length1-this.Patch_Margin),c.length1+=h.length,a+=h.length,0===u?(c.length2+=h.length,s+=h.length):d=!1,c.diffs.push(new t.Diff(u,h)),h==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(h.length))}l=(l=this.diff_text2(c.diffs)).substring(l.length-this.Patch_Margin);var p=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);""!==p&&(c.length1+=p.length,c.length2+=p.length,0!==c.diffs.length&&0===c.diffs[c.diffs.length-1][0]?c.diffs[c.diffs.length-1][1]+=p:c.diffs.push(new t.Diff(0,p))),d||e.splice(++r,0,c)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n{"use strict";var o=n(28651)("%Object.defineProperty%",!0)||!1;if(o)try{o({},"a",{value:1})}catch(e){o=!1}e.exports=o},29055:e=>{"use strict";e.exports=EvalError},15293:e=>{"use strict";e.exports=Error},18888:e=>{"use strict";e.exports=RangeError},47900:e=>{"use strict";e.exports=ReferenceError},57770:e=>{"use strict";e.exports=SyntaxError},96785:e=>{"use strict";e.exports=TypeError},54055:e=>{"use strict";e.exports=URIError},64785:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,o){function r(n){e.removeListener(t,i),o(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}m(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,n)}(e,r,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,o){var r,i,a,c;if(s(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=o?[n,a]:[a,n]:o?a.unshift(n):a.push(n),(r=l(e))>0&&a.length>r&&!a.warned){a.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=a.length,c=d,console&&console.warn&&console.warn(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,n){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=d.bind(o);return r.listener=n,o.wrapFn=r,r}function h(e,t,n){var o=e._events;if(void 0===o)return[];var r=o[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var c=l.length,d=f(l,c);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,r=i;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;o--)this.removeListener(e,t[o]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},84617:e=>{e.exports=a,a.default=a,a.stable=d,a.stableStringify=d;var t="[...]",n="[Circular]",o=[],r=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=i()),l(e,"",0,[],void 0,0,a);try{s=0===r.length?JSON.stringify(e,t,n):JSON.stringify(e,h(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==o.length;){var c=o.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function s(e,t,n,i){var a=Object.getOwnPropertyDescriptor(i,n);void 0!==a.get?a.configurable?(Object.defineProperty(i,n,{value:e}),o.push([i,n,t,a])):r.push([t,n,e]):(i[n]=e,o.push([i,n,t]))}function l(e,o,r,i,a,c,d){var u;if(c+=1,"object"==typeof e&&null!==e){for(u=0;ud.depthLimit)return void s(t,e,o,a);if(void 0!==d.edgesLimit&&r+1>d.edgesLimit)return void s(t,e,o,a);if(i.push(e),Array.isArray(e))for(u=0;ut?1:0}function d(e,t,n,a){void 0===a&&(a=i());var s,l=u(e,"",0,[],void 0,0,a)||e;try{s=0===r.length?JSON.stringify(l,t,n):JSON.stringify(l,h(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==o.length;){var c=o.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function u(e,r,i,a,l,d,h){var p;if(d+=1,"object"==typeof e&&null!==e){for(p=0;ph.depthLimit)return void s(t,e,r,l);if(void 0!==h.edgesLimit&&i+1>h.edgesLimit)return void s(t,e,r,l);if(a.push(e),Array.isArray(e))for(p=0;p0)for(var o=0;o{"use strict";var t=Object.prototype.toString,n=Math.max,o=function(e,t){for(var n=[],o=0;o{"use strict";var o=n(12719);e.exports=Function.prototype.bind||o},28651:(e,t,n)=>{"use strict";var o,r=n(15293),i=n(29055),a=n(18888),s=n(47900),l=n(57770),c=n(96785),d=n(54055),u=Function,h=function(e){try{return u('"use strict"; return ('+e+").constructor;")()}catch(e){}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch(e){p=null}var f=function(){throw new c},m=p?function(){try{return f}catch(e){try{return p(arguments,"callee").get}catch(e){return f}}}():f,g=n(73257)(),b=n(85726)(),y=Object.getPrototypeOf||(b?function(e){return e.__proto__}:null),v={},_="undefined"!=typeof Uint8Array&&y?y(Uint8Array):o,k={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?o:ArrayBuffer,"%ArrayIteratorPrototype%":g&&y?y([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?o:Atomics,"%BigInt%":"undefined"==typeof BigInt?o:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?o:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?o:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?o:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?o:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?o:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?o:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?o:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&y?y(y([][Symbol.iterator]())):o,"%JSON%":"object"==typeof JSON?JSON:o,"%Map%":"undefined"==typeof Map?o:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&y?y((new Map)[Symbol.iterator]()):o,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?o:Promise,"%Proxy%":"undefined"==typeof Proxy?o:Proxy,"%RangeError%":a,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?o:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?o:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&y?y((new Set)[Symbol.iterator]()):o,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&y?y(""[Symbol.iterator]()):o,"%Symbol%":g?Symbol:o,"%SyntaxError%":l,"%ThrowTypeError%":m,"%TypedArray%":_,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?o:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?o:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?o:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?o:Uint32Array,"%URIError%":d,"%WeakMap%":"undefined"==typeof WeakMap?o:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?o:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?o:WeakSet};if(y)try{null.error}catch(e){var w=y(y(e));k["%Error.prototype%"]=w}var x=function e(t){var n;if("%AsyncFunction%"===t)n=h("async function () {}");else if("%GeneratorFunction%"===t)n=h("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=h("async function* () {}");else if("%AsyncGenerator%"===t){var o=e("%AsyncGeneratorFunction%");o&&(n=o.prototype)}else if("%AsyncIteratorPrototype%"===t){var r=e("%AsyncGenerator%");r&&y&&(n=y(r.prototype))}return k[t]=n,n},S={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},M=n(5049),T=n(55215),L=M.call(Function.call,Array.prototype.concat),C=M.call(Function.apply,Array.prototype.splice),E=M.call(Function.call,String.prototype.replace),A=M.call(Function.call,String.prototype.slice),D=M.call(Function.call,RegExp.prototype.exec),P=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,O=function(e,t){var n,o=e;if(T(S,o)&&(o="%"+(n=S[o])[0]+"%"),T(k,o)){var r=k[o];if(r===v&&(r=x(o)),void 0===r&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:r}}throw new l("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===D(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=A(e,0,1),n=A(e,-1);if("%"===t&&"%"!==n)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var o=[];return E(e,P,(function(e,t,n,r){o[o.length]=n?E(r,R,"$1"):t||e})),o}(e),o=n.length>0?n[0]:"",r=O("%"+o+"%",t),i=r.name,a=r.value,s=!1,d=r.alias;d&&(o=d[0],C(n,L([0,1],d)));for(var u=1,h=!0;u=n.length){var b=p(a,f);a=(h=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:a[f]}else h=T(a,f),a=a[f];h&&!s&&(k[i]=a)}}return a}},68109:(e,t,n)=>{"use strict";var o=n(28651)("%Object.getOwnPropertyDescriptor%",!0);if(o)try{o([],"length")}catch(e){o=null}e.exports=o},18890:(e,t,n)=>{"use strict";var o=n(56649),r=function(){return!!o};r.hasArrayLengthDefineBug=function(){if(!o)return null;try{return 1!==o([],"length",{value:1}).length}catch(e){return!0}},e.exports=r},85726:e=>{"use strict";var t={__proto__:null,foo:{}},n=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof n)}},73257:(e,t,n)=>{"use strict";var o="undefined"!=typeof Symbol&&Symbol,r=n(12843);e.exports=function(){return"function"==typeof o&&("function"==typeof Symbol&&("symbol"==typeof o("foo")&&("symbol"==typeof Symbol("bar")&&r())))}},12843:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(e,t);if(42!==r.value||!0!==r.enumerable)return!1}return!0}},55215:(e,t,n)=>{"use strict";var o=Function.prototype.call,r=Object.prototype.hasOwnProperty,i=n(5049);e.exports=i.call(o,r)},68188:(e,t,n)=>{var o="__lodash_hash_undefined__",r=1/0,i="[object Function]",a="[object GeneratorFunction]",s="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,d=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,p=/^\[object .+?Constructor\]$/,f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,m="object"==typeof self&&self&&self.Object===Object&&self,g=f||m||Function("return this")();var b,y=Array.prototype,v=Function.prototype,_=Object.prototype,k=g["__core-js_shared__"],w=(b=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",x=v.toString,S=_.hasOwnProperty,M=_.toString,T=RegExp("^"+x.call(S).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=g.Symbol,C=y.splice,E=F(g,"Map"),A=F(Object,"create"),D=L?L.prototype:void 0,P=D?D.toString:void 0;function R(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1},O.prototype.set=function(e,t){var n=this.__data__,o=N(n,e);return o<0?n.push([e,t]):n[o][1]=t,this},j.prototype.clear=function(){this.__data__={hash:new R,map:new(E||O),string:new R}},j.prototype.delete=function(e){return I(this,e).delete(e)},j.prototype.get=function(e){return I(this,e).get(e)},j.prototype.has=function(e){return I(this,e).has(e)},j.prototype.set=function(e,t){return I(this,e).set(e,t),this};var B=W((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(U(e))return P?P.call(e):"";var t=e+"";return"0"==t&&1/e==-r?"-0":t}(t);var n=[];return d.test(e)&&n.push(""),e.replace(u,(function(e,t,o,r){n.push(o?r.replace(h,"$1"):t||e)})),n}));function $(e){if("string"==typeof e||U(e))return e;var t=e+"";return"0"==t&&1/e==-r?"-0":t}function W(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var o=arguments,r=t?t.apply(this,o):o[0],i=n.cache;if(i.has(r))return i.get(r);var a=e.apply(this,o);return n.cache=i.set(r,a),a};return n.cache=new(W.Cache||j),n}W.Cache=j;var z=Array.isArray;function G(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function U(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&M.call(e)==s}e.exports=function(e,t,n){var o=null==e?void 0:Y(e,t);return void 0===o?n:o}},46216:(e,t,n)=>{e=n.nmd(e);var o="__lodash_hash_undefined__",r=1,i=2,a=9007199254740991,s="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",d="[object Boolean]",u="[object Date]",h="[object Error]",p="[object Function]",f="[object GeneratorFunction]",m="[object Map]",g="[object Number]",b="[object Null]",y="[object Object]",v="[object Promise]",_="[object Proxy]",k="[object RegExp]",w="[object Set]",x="[object String]",S="[object Symbol]",M="[object Undefined]",T="[object WeakMap]",L="[object ArrayBuffer]",C="[object DataView]",E=/^\[object .+?Constructor\]$/,A=/^(?:0|[1-9]\d*)$/,D={};D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D[s]=D[l]=D[L]=D[d]=D[C]=D[u]=D[h]=D[p]=D[m]=D[g]=D[y]=D[k]=D[w]=D[x]=D[T]=!1;var P="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,R="object"==typeof self&&self&&self.Object===Object&&self,O=P||R||Function("return this")(),j=t&&!t.nodeType&&t,N=j&&e&&!e.nodeType&&e,Y=N&&N.exports===j,H=Y&&P.process,I=function(){try{return H&&H.binding&&H.binding("util")}catch(e){}}(),F=I&&I.isTypedArray;function B(e,t){for(var n=-1,o=null==e?0:e.length;++nc))return!1;var u=s.get(e);if(u&&s.get(t))return u==t;var h=-1,p=!0,f=n&i?new Le:void 0;for(s.set(e,t),s.set(t,e);++h-1},Me.prototype.set=function(e,t){var n=this.__data__,o=Ae(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this},Te.prototype.clear=function(){this.size=0,this.__data__={hash:new Se,map:new(he||Me),string:new Se}},Te.prototype.delete=function(e){var t=He(this,e).delete(e);return this.size-=t?1:0,t},Te.prototype.get=function(e){return He(this,e).get(e)},Te.prototype.has=function(e){return He(this,e).has(e)},Te.prototype.set=function(e,t){var n=He(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this},Le.prototype.add=Le.prototype.push=function(e){return this.__data__.set(e,o),this},Le.prototype.has=function(e){return this.__data__.has(e)},Ce.prototype.clear=function(){this.__data__=new Me,this.size=0},Ce.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ce.prototype.get=function(e){return this.__data__.get(e)},Ce.prototype.has=function(e){return this.__data__.has(e)},Ce.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Me){var o=n.__data__;if(!he||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Te(o)}return n.set(e,t),this.size=n.size,this};var Fe=le?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,o=null==e?0:e.length,r=0,i=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=a}function Xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Je(e){return null!=e&&"object"==typeof e}var Ze=F?function(e){return function(t){return e(t)}}(F):function(e){return Je(e)&&qe(e.length)&&!!D[De(e)]};function Qe(e){return null!=(t=e)&&qe(t.length)&&!Ke(t)?Ee(e):je(e);var t}e.exports=function(e,t){return Re(e,t)}},45093:(e,t,n)=>{ -/*!mobile-detect v1.4.5 2021-03-13*/ -/*!@license Copyright 2013, Heinrich Goebl, License: MIT, see https://github.com/hgoebl/mobile-detect.js*/ -!function(e,t){e((function(){"use strict";var e,n={mobileDetectRules:{phones:{iPhone:"\\biPhone\\b|\\biPod\\b",BlackBerry:"BlackBerry|\\bBB10\\b|rim[0-9]+|\\b(BBA100|BBB100|BBD100|BBE100|BBF100|STH100)\\b-[0-9]+",Pixel:"; \\bPixel\\b",HTC:"HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m|Android [0-9.]+; Pixel",Nexus:"Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 5X|Nexus 6",Dell:"Dell[;]? (Streak|Aero|Venue|Venue Pro|Flash|Smoke|Mini 3iX)|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b",Motorola:"Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b|XT1068|XT1092|XT1052",Samsung:"\\bSamsung\\b|SM-G950F|SM-G955F|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C|SM-A310F|GT-I9190|SM-J500FN|SM-G903F|SM-J330F|SM-G610F|SM-G981B|SM-G892A|SM-A530F",LG:"\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323|M257)|LM-G710",Sony:"SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533|SOV34|601SO|F8332",Asus:"Asus.*Galaxy|PadFone.*Mobile",Xiaomi:"^(?!.*\\bx11\\b).*xiaomi.*$|POCOPHONE F1|MI 8|Redmi Note 9S|Redmi Note 5A Prime|N2G47H|M2001J2G|M2001J2I|M1805E10A|M2004J11G|M1902F1G|M2002J9G|M2004J19G|M2003J6A1G",NokiaLumia:"Lumia [0-9]{3,4}",Micromax:"Micromax.*\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\b",Palm:"PalmSource|Palm",Vertu:"Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature",Pantech:"PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790",Fly:"IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250",Wiko:"KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM",iMobile:"i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)",SimValley:"\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\b",Wolfgang:"AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q",Alcatel:"Alcatel",Nintendo:"Nintendo (3DS|Switch)",Amoi:"Amoi",INQ:"INQ",OnePlus:"ONEPLUS",GenericPhone:"Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\bwap\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser"},tablets:{iPad:"iPad|iPad.*Mobile",NexusTablet:"Android.*Nexus[\\s]+(7|9|10)",GoogleTablet:"Android.*Pixel C",SamsungTablet:"SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y?|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|SM-P555M|SM-P355M|SM-T113NU|SM-T815Y|SM-T585|SM-T285|SM-T825|SM-W708|SM-T835|SM-T830|SM-T837V|SM-T720|SM-T510|SM-T387V|SM-P610|SM-T290|SM-T515|SM-T590|SM-T595|SM-T725|SM-T817P|SM-P585N0|SM-T395|SM-T295|SM-T865|SM-P610N|SM-P615|SM-T970|SM-T380|SM-T5950|SM-T905|SM-T231|SM-T500|SM-T860",Kindle:"Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\\b|Android.*Silk/[0-9.]+ like Chrome/[0-9.]+ (?!Mobile)",SurfaceTablet:"Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)",HPTablet:"HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10",AsusTablet:"^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z|\\bP027\\b|\\bP024\\b|\\bP00C\\b",BlackBerryTablet:"PlayBook|RIM Tablet",HTCtablet:"HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410",MotorolaTablet:"xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617",NookTablet:"Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2",AcerTablet:"Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|\\bA3-A20\\b|\\bA3-A30|A3-A40",ToshibaTablet:"Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO",LGTablet:"\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\b",FujitsuTablet:"Android.*\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\b",PrestigioTablet:"PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002",LenovoTablet:"Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)|TB-X103F|TB-X304X|TB-X304F|TB-X304L|TB-X505F|TB-X505L|TB-X505X|TB-X605F|TB-X605L|TB-8703F|TB-8703X|TB-8703N|TB-8704N|TB-8704F|TB-8704X|TB-8704V|TB-7304F|TB-7304I|TB-7304X|Tab2A7-10F|Tab2A7-20F|TB2-X30L|YT3-X50L|YT3-X50F|YT3-X50M|YT-X705F|YT-X703F|YT-X703L|YT-X705L|YT-X705X|TB2-X30F|TB2-X30L|TB2-X30M|A2107A-F|A2107A-H|TB3-730F|TB3-730M|TB3-730X|TB-7504F|TB-7504X|TB-X704F|TB-X104F|TB3-X70F|TB-X705F|TB-8504F|TB3-X70L|TB3-710F|TB-X704L",DellTablet:"Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7",YarvikTablet:"Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b",MedionTablet:"Android.*\\bOYO\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB",ArnovaTablet:"97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2",IntensoTablet:"INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004",IRUTablet:"M702pro",MegafonTablet:"MegaFon V9|\\bZTE V9\\b|Android.*\\bMT7A\\b",EbodaTablet:"E-Boda (Supreme|Impresspeed|Izzycomm|Essential)",AllViewTablet:"Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)",ArchosTablet:"\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b",AinolTablet:"NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark",NokiaLumiaTablet:"Lumia 2520",SonyTablet:"Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP641|SGP612|SOT31|SGP771|SGP611|SGP612|SGP712",PhilipsTablet:"\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\b",CubeTablet:"Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT",CobyTablet:"MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010",MIDTablet:"M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10",MSITablet:"MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b",SMiTTablet:"Android.*(\\bMID\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)",RockChipTablet:"Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A",FlyTablet:"IQ310|Fly Vision",bqTablet:"Android.*(bq)?.*\\b(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris ([E|M]10|M8))\\b|Maxwell.*Lite|Maxwell.*Plus",HuaweiTablet:"MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim|M2-A01L|BAH-L09|BAH-W09|AGS-L09|CMR-AL19",NecTablet:"\\bN-06D|\\bN-08D",PantechTablet:"Pantech.*P4100",BronchoTablet:"Broncho.*(N701|N708|N802|a710)",VersusTablet:"TOUCHPAD.*[78910]|\\bTOUCHTAB\\b",ZyncTablet:"z1000|Z99 2G|z930|z990|z909|Z919|z900",PositivoTablet:"TB07STA|TB10STA|TB07FTA|TB10FTA",NabiTablet:"Android.*\\bNabi",KoboTablet:"Kobo Touch|\\bK080\\b|\\bVox\\b Build|\\bArc\\b Build",DanewTablet:"DSlide.*\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\b",TexetTablet:"NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE",PlaystationTablet:"Playstation.*(Portable|Vita)",TrekstorTablet:"ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab",PyleAudioTablet:"\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\b",AdvanTablet:"Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b ",DanyTechTablet:"Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1",GalapadTablet:"Android [0-9.]+; [a-z-]+; \\bG1\\b",MicromaxTablet:"Funbook|Micromax.*\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\b",KarbonnTablet:"Android.*\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\b",AllFineTablet:"Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide",PROSCANTablet:"\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b",YONESTablet:"BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026",ChangJiaTablet:"TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503",GUTablet:"TX-A1301|TX-M9002|Q702|kf026",PointOfViewTablet:"TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10",OvermaxTablet:"OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)|Qualcore 1027",HCLTablet:"HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync",DPSTablet:"DPS Dream 9|DPS Dual 7",VistureTablet:"V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10",CrestaTablet:"CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989",MediatekTablet:"\\bMT8125|MT8389|MT8135|MT8377\\b",ConcordeTablet:"Concorde([ ]+)?Tab|ConCorde ReadMan",GoCleverTablet:"GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042",ModecomTablet:"FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003",VoninoTablet:"\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b",ECSTablet:"V07OT2|TM105A|S10OT1|TR10CS1",StorexTablet:"eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab",VodafoneTablet:"SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497|VFD 1400",EssentielBTablet:"Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2",RossMoorTablet:"RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711",iMobileTablet:"i-mobile i-note",TolinoTablet:"tolino tab [0-9.]+|tolino shine",AudioSonicTablet:"\\bC-22Q|T7-QC|T-17B|T-17P\\b",AMPETablet:"Android.* A78 ",SkkTablet:"Android.* (SKYPAD|PHOENIX|CYCLOPS)",TecnoTablet:"TECNO P9|TECNO DP8D",JXDTablet:"Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\b",iJoyTablet:"Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)",FX2Tablet:"FX2 PAD7|FX2 PAD10",XoroTablet:"KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151",ViewsonicTablet:"ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a",VerizonTablet:"QTAQZ3|QTAIR7|QTAQTZ3|QTASUN1|QTASUN2|QTAXIA1",OdysTablet:"LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\bXELIO\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10",CaptivaTablet:"CAPTIVA PAD",IconbitTablet:"NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S",TeclastTablet:"T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi",OndaTablet:"\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\b[\\s]+|V10 \\b4G\\b",JaytechTablet:"TPC-PA762",BlaupunktTablet:"Endeavour 800NG|Endeavour 1010",DigmaTablet:"\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\b",EvolioTablet:"ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\bEvotab\\b|\\bNeura\\b",LavaTablet:"QPAD E704|\\bIvoryS\\b|E-TAB IVORY|\\bE-TAB\\b",AocTablet:"MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712",MpmanTablet:"MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010",CelkonTablet:"CT695|CT888|CT[\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\bCT-1\\b",WolderTablet:"miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b",MediacomTablet:"M-MPI10C3G|M-SP10EG|M-SP10EGP|M-SP10HXAH|M-SP7HXAH|M-SP10HXBH|M-SP8HXAH|M-SP8MXA",MiTablet:"\\bMI PAD\\b|\\bHM NOTE 1W\\b",NibiruTablet:"Nibiru M1|Nibiru Jupiter One",NexoTablet:"NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI",LeaderTablet:"TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100",UbislateTablet:"UbiSlate[\\s]?7C",PocketBookTablet:"Pocketbook",KocasoTablet:"\\b(TB-1207)\\b",HisenseTablet:"\\b(F5281|E2371)\\b",Hudl:"Hudl HT7S3|Hudl 2",TelstraTablet:"T-Hub2",GenericTablet:"Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bTP750\\b|\\bQTAQZ3\\b|WVT101|TM1088|KT107"},oss:{AndroidOS:"Android",BlackBerryOS:"blackberry|\\bBB10\\b|rim tablet os",PalmOS:"PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino",SymbianOS:"Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b",WindowsMobileOS:"Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Windows Mobile|Windows Phone [0-9.]+|WCE;",WindowsPhoneOS:"Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;",iOS:"\\biPhone.*Mobile|\\biPod|\\biPad|AppleCoreMedia",iPadOS:"CPU OS 13",SailfishOS:"Sailfish",MeeGoOS:"MeeGo",MaemoOS:"Maemo",JavaOS:"J2ME/|\\bMIDP\\b|\\bCLDC\\b",webOS:"webOS|hpwOS",badaOS:"\\bBada\\b",BREWOS:"BREW"},uas:{Chrome:"\\bCrMo\\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?",Dolfin:"\\bDolfin\\b",Opera:"Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+$|Coast/[0-9.]+",Skyfire:"Skyfire",Edge:"\\bEdgiOS\\b|Mobile Safari/[.0-9]* Edge",IE:"IEMobile|MSIEMobile",Firefox:"fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS",Bolt:"bolt",TeaShark:"teashark",Blazer:"Blazer",Safari:"Version((?!\\bEdgiOS\\b).)*Mobile.*Safari|Safari.*Mobile|MobileSafari",WeChat:"\\bMicroMessenger\\b",UCBrowser:"UC.*Browser|UCWEB",baiduboxapp:"baiduboxapp",baidubrowser:"baidubrowser",DiigoBrowser:"DiigoBrowser",Mercury:"\\bMercury\\b",ObigoBrowser:"Obigo",NetFront:"NF-Browser",GenericBrowser:"NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger",PaleMoon:"Android.*PaleMoon|Mobile.*PaleMoon"},props:{Mobile:"Mobile/[VER]",Build:"Build/[VER]",Version:"Version/[VER]",VendorID:"VendorID/[VER]",iPad:"iPad.*CPU[a-z ]+[VER]",iPhone:"iPhone.*CPU[a-z ]+[VER]",iPod:"iPod.*CPU[a-z ]+[VER]",Kindle:"Kindle/[VER]",Chrome:["Chrome/[VER]","CriOS/[VER]","CrMo/[VER]"],Coast:["Coast/[VER]"],Dolfin:"Dolfin/[VER]",Firefox:["Firefox/[VER]","FxiOS/[VER]"],Fennec:"Fennec/[VER]",Edge:"Edge/[VER]",IE:["IEMobile/[VER];","IEMobile [VER]","MSIE [VER];","Trident/[0-9.]+;.*rv:[VER]"],NetFront:"NetFront/[VER]",NokiaBrowser:"NokiaBrowser/[VER]",Opera:[" OPR/[VER]","Opera Mini/[VER]","Version/[VER]"],"Opera Mini":"Opera Mini/[VER]","Opera Mobi":"Version/[VER]",UCBrowser:["UCWEB[VER]","UC.*Browser/[VER]"],MQQBrowser:"MQQBrowser/[VER]",MicroMessenger:"MicroMessenger/[VER]",baiduboxapp:"baiduboxapp/[VER]",baidubrowser:"baidubrowser/[VER]",SamsungBrowser:"SamsungBrowser/[VER]",Iron:"Iron/[VER]",Safari:["Version/[VER]","Safari/[VER]"],Skyfire:"Skyfire/[VER]",Tizen:"Tizen/[VER]",Webkit:"webkit[ /][VER]",PaleMoon:"PaleMoon/[VER]",SailfishBrowser:"SailfishBrowser/[VER]",Gecko:"Gecko/[VER]",Trident:"Trident/[VER]",Presto:"Presto/[VER]",Goanna:"Goanna/[VER]",iOS:" \\bi?OS\\b [VER][ ;]{1}",Android:"Android [VER]",Sailfish:"Sailfish [VER]",BlackBerry:["BlackBerry[\\w]+/[VER]","BlackBerry.*Version/[VER]","Version/[VER]"],BREW:"BREW [VER]",Java:"Java/[VER]","Windows Phone OS":["Windows Phone OS [VER]","Windows Phone [VER]"],"Windows Phone":"Windows Phone [VER]","Windows CE":"Windows CE/[VER]","Windows NT":"Windows NT [VER]",Symbian:["SymbianOS/[VER]","Symbian/[VER]"],webOS:["webOS/[VER]","hpwOS/[VER];"]},utils:{Bot:"Googlebot|facebookexternalhit|Google-AMPHTML|s~amp-validator|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom|contentkingapp|AspiegelBot",MobileBot:"Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker/M1A1-R2D2",DesktopMode:"WPDesktop",TV:"SonyDTV|HbbTV",WebKit:"(webkit)[ /]([\\w.]+)",Console:"\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|Nintendo Switch|PLAYSTATION|Xbox)\\b",Watch:"SM-V700"}},detectMobileBrowsers:{fullPattern:/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,shortPattern:/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,tabletPattern:/android|ipad|playbook|silk/i}},o=Object.prototype.hasOwnProperty;function r(e,t){return null!=e&&null!=t&&e.toLowerCase()===t.toLowerCase()}function i(e,t){var n,o,r=e.length;if(!r||!t)return!1;for(n=t.toLowerCase(),o=0;o=0&&(i=i.substring(0,c)+"([\\w._\\+]+)"+i.substring(c+5)),r[s]=new RegExp(i,"i");d.props[t]=r}a(d.oss),a(d.phones),a(d.tablets),a(d.uas),a(d.utils),d.oss0={WindowsPhoneOS:d.oss.WindowsPhoneOS,WindowsMobileOS:d.oss.WindowsMobileOS}}(),n.findMatch=function(e,t){for(var n in e)if(o.call(e,n)&&e[n].test(t))return n;return null},n.findMatches=function(e,t){var n=[];for(var r in e)o.call(e,r)&&e[r].test(t)&&n.push(r);return n},n.getVersionStr=function(e,t){var r,i,a,s,l=n.mobileDetectRules.props;if(o.call(l,e))for(a=(r=l[e]).length,i=0;i1&&(e=t[0]+".",t.shift(),e+=t.join("")),Number(e)},n.isMobileFallback=function(e){return n.detectMobileBrowsers.fullPattern.test(e)||n.detectMobileBrowsers.shortPattern.test(e.substr(0,4))},n.isTabletFallback=function(e){return n.detectMobileBrowsers.tabletPattern.test(e)},n.prepareDetectionCache=function(e,o,r){if(e.mobile===t){var i,a,l;if(a=n.findMatch(n.mobileDetectRules.tablets,o))return e.mobile=e.tablet=a,void(e.phone=null);if(i=n.findMatch(n.mobileDetectRules.phones,o))return e.mobile=e.phone=i,void(e.tablet=null);n.isMobileFallback(o)?(l=s.isPhoneSized(r))===t?(e.mobile=n.FALLBACK_MOBILE,e.tablet=e.phone=null):l?(e.mobile=e.phone=n.FALLBACK_PHONE,e.tablet=null):(e.mobile=e.tablet=n.FALLBACK_TABLET,e.phone=null):n.isTabletFallback(o)?(e.mobile=e.tablet=n.FALLBACK_TABLET,e.phone=null):e.mobile=e.tablet=e.phone=null}},n.mobileGrade=function(e){var t=null!==e.mobile();return e.os("iOS")&&e.version("iPad")>=4.3||e.os("iOS")&&e.version("iPhone")>=3.1||e.os("iOS")&&e.version("iPod")>=3.1||e.version("Android")>2.1&&e.is("Webkit")||e.version("Windows Phone OS")>=7||e.is("BlackBerry")&&e.version("BlackBerry")>=6||e.match("Playbook.*Tablet")||e.version("webOS")>=1.4&&e.match("Palm|Pre|Pixi")||e.match("hp.*TouchPad")||e.is("Firefox")&&e.version("Firefox")>=12||e.is("Chrome")&&e.is("AndroidOS")&&e.version("Android")>=4||e.is("Skyfire")&&e.version("Skyfire")>=4.1&&e.is("AndroidOS")&&e.version("Android")>=2.3||e.is("Opera")&&e.version("Opera Mobi")>11&&e.is("AndroidOS")||e.is("MeeGoOS")||e.is("Tizen")||e.is("Dolfin")&&e.version("Bada")>=2||(e.is("UC Browser")||e.is("Dolfin"))&&e.version("Android")>=2.3||e.match("Kindle Fire")||e.is("Kindle")&&e.version("Kindle")>=3||e.is("AndroidOS")&&e.is("NookTablet")||e.version("Chrome")>=11&&!t||e.version("Safari")>=5&&!t||e.version("Firefox")>=4&&!t||e.version("MSIE")>=7&&!t||e.version("Opera")>=10&&!t?"A":e.os("iOS")&&e.version("iPad")<4.3||e.os("iOS")&&e.version("iPhone")<3.1||e.os("iOS")&&e.version("iPod")<3.1||e.is("Blackberry")&&e.version("BlackBerry")>=5&&e.version("BlackBerry")<6||e.version("Opera Mini")>=5&&e.version("Opera Mini")<=6.5&&(e.version("Android")>=2.3||e.is("iOS"))||e.match("NokiaN8|NokiaC7|N97.*Series60|Symbian/3")||e.version("Opera Mobi")>=11&&e.is("SymbianOS")?"B":(e.version("BlackBerry")<5||e.match("MSIEMobile|Windows CE.*Mobile")||e.version("Windows Mobile"),"C")},n.detectOS=function(e){return n.findMatch(n.mobileDetectRules.oss0,e)||n.findMatch(n.mobileDetectRules.oss,e)},n.getDeviceSmallerSide=function(){return window.screen.width=20?"ste":"de")},week:{dow:1,doy:4}})}(n(41655))},47214:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,i,a){var s=t(o),l=n[e][t(o)];return 2===s&&(l=l[r?0:1]),l.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n(41655))},40830:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n(41655))},68899:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,i,a){var s=n(t),l=o[e][n(t)];return 2===s&&(l=l[r?0:1]),l.replace(/%d/i,t)}},i=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:i,monthsShort:i,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n(41655))},77258:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n(41655))},64096:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n(41655))},97826:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n(41655))},31035:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},i=function(e){return function(t,n,i,a){var s=o(t),l=r[e][o(t)];return 2===s&&(l=l[n?0:1]),l.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:i("s"),ss:i("s"),m:i("m"),mm:i("m"),h:i("h"),hh:i("h"),d:i("d"),dd:i("d"),M:i("M"),MM:i("M"),y:i("y"),yy:i("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n(41655))},20051:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10,o=e%100-n,r=e>=100?100:null;return e+(t[n]||t[o]||t[r])},week:{dow:1,doy:7}})}(n(41655))},23813:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t){var n=e.split("_");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,o){return"m"===o?n?"хвіліна":"хвіліну":"h"===o?n?"гадзіна":"гадзіну":e+" "+t({ss:n?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:n?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:n?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[o],+e)}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:n,mm:n,h:n,hh:n,d:"дзень",dd:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n(41655))},64323:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n(41655))},57837:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n(41655))},25959:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n(41655))},75780:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n(41655))},81451:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n(41655))},76480:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n){return e+" "+r({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){switch(o(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}function o(e){return e>9?o(e%10):e}function r(e,t){return 2===t?i(e):e}function i(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}var a=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],s=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,l=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,c=/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,d=[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],u=[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],h=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:h,fullWeekdaysParse:d,shortWeekdaysParse:u,minWeekdaysParse:h,monthsRegex:s,monthsShortRegex:s,monthsStrictRegex:l,monthsShortStrictRegex:c,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:n},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n(41655))},91607:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi";case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta";case"h":return t?"jedan sat":"jednog sata";case"hh":return o+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return o+=1===e?"dan":"dana";case"MM":return o+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return o+=1===e?"godina":2===e||3===e||4===e?"godine":"godina"}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(41655))},23232:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n(41655))},91034:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function i(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(i(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(i(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(i(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(i(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(i(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(i(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},54213:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n(41655))},95800:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n(41655))},40739:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},82181:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},61339:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},66951:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},16938:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n(41655))},59573:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){return 6===this.day()?"[το προηγούμενο] dddd [{}] LT":"[την προηγούμενη] dddd [{}] LT"},sameElse:"L"},calendar:function(e,n){var o=this._calendarEl[e],r=n&&n.hours();return t(o)&&(o=o.apply(n)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n(41655))},62458:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n(41655))},51816:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n(41655))},8069:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n(41655))},15586:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n(41655))},60009:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n(41655))},51207:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n(41655))},83724:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n(41655))},24334:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n(41655))},1292:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n(41655))},61452:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(41655))},94444:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n(41655))},81285:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n(41655))},66328:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n(41655))},7181:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},62830:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(41655))},19565:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n(41655))},85541:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,t,n,o){var i="";switch(n){case"s":return o?"muutaman sekunnin":"muutama sekunti";case"ss":i=o?"sekunnin":"sekuntia";break;case"m":return o?"minuutin":"minuutti";case"mm":i=o?"minuutin":"minuuttia";break;case"h":return o?"tunnin":"tunti";case"hh":i=o?"tunnin":"tuntia";break;case"d":return o?"päivän":"päivä";case"dd":i=o?"päivän":"päivää";break;case"M":return o?"kuukauden":"kuukausi";case"MM":i=o?"kuukauden":"kuukautta";break;case"y":return o?"vuoden":"vuosi";case"yy":i=o?"vuoden":"vuotta"}return i=r(e,o)+" "+i}function r(e,o){return e<10?o?n[e]:t[e]:e}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},65661:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n(41655))},26087:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},96581:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n(41655))},81294:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n(41655))},25396:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t=/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,o=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,r=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:o,monthsShortRegex:o,monthsStrictRegex:t,monthsShortStrictRegex:n,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n(41655))},12533:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n(41655))},55796:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t=["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],n=["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],o=["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],r=["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],i=["Do","Lu","Má","Cé","Dé","A","Sa"];e.defineLocale("ga",{months:t,monthsShort:n,monthsParseExact:!0,weekdays:o,weekdaysShort:r,weekdaysMin:i,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n(41655))},50847:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t=["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],n=["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],o=["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],r=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],i=["Dò","Lu","Mà","Ci","Ar","Ha","Sa"];e.defineLocale("gd",{months:t,monthsShort:n,monthsParseExact:!0,weekdays:o,weekdaysShort:r,weekdaysMin:i,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n(41655))},60439:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(41655))},46514:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){return"D"===t?e+"वेर":e},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n(41655))},66525:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){return"D"===t?e+"er":e},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n(41655))},34232:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n(41655))},50915:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n(41655))},22095:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i],r=[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:r,monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n(41655))},10762:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi";case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta";case"h":return t?"jedan sat":"jednog sata";case"hh":return o+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return o+=1===e?"dan":"dana";case"MM":return o+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return o+=1===e?"godina":2===e||3===e||4===e?"godine":"godina"}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(41655))},88275:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},73094:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n(41655))},27769:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n(41655))},99676:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var i=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?i+(n||r?"sekúndur":"sekúndum"):i+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?i+(n||r?"mínútur":"mínútum"):n?i+"mínúta":i+"mínútu";case"hh":return t(e)?i+(n||r?"klukkustundir":"klukkustundum"):i+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?i+"dagar":i+(r?"daga":"dögum"):n?i+"dagur":i+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?i+"mánuðir":i+(r?"mánuði":"mánuðum"):n?i+"mánuður":i+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?i+(n||r?"ár":"árum"):i+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},25141:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){return 0===this.day()?"[la scorsa] dddd [alle] LT":"[lo scorso] dddd [alle] LT"},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(41655))},74313:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){return 0===this.day()?"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT":"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(41655))},11985:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n(41655))},53908:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n(41655))},32808:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n(41655))},33930:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){var n=e%10,o=e>=100?100:null;return e+(t[e]||t[n]||t[o])},week:{dow:1,doy:7}})}(n(41655))},71532:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n(41655))},69461:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n(41655))},60502:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n(41655))},18660:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n(41655))},83088:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){var n=e%10,o=e>=100?100:null;return e+(t[e]||t[n]||t[o])},week:{dow:1,doy:7}})}(n(41655))},65742:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){return r(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e}function o(e){return r(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e}function r(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return r(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return r(e)}return r(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:n,past:o,s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},25417:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n(41655))},64968:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"}function o(e,t,n,o){return t?i(n)[0]:o?i(n)[1]:i(n)[2]}function r(e){return e%10==0||e>10&&e<20}function i(e){return t[e].split("_")}function a(e,t,n,a){var s=e+" ";return 1===e?s+o(e,t,n[0],a):t?s+(r(e)?i(n)[1]:i(n)[0]):a?s+i(n)[1]:s+(r(e)?i(n)[1]:i(n)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:n,ss:a,m:o,mm:a,h:o,hh:a,d:o,dd:a,M:o,MM:a,y:o,yy:a},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n(41655))},41202:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}function i(e,t){return t?"dažas sekundes":"dažām sekundēm"}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:i,ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},34438:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(41655))},18498:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(41655))},6744:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n(41655))},63949:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n(41655))},4459:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n(41655))},46679:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n(41655))},47483:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n(41655))},56960:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n(41655))},99989:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(41655))},64978:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n(41655))},88460:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},23993:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n(41655))},62678:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n(41655))},95378:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n(41655))},67560:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},87060:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n(41655))},62187:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n(41655))},93532:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function i(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:i,m:i,mm:i,h:i,hh:i,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:i,M:"miesiąc",MM:i,y:"rok",yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},92485:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n(41655))},49396:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(41655))},33179:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n(41655))},93797:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t){var n=e.split("_");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,o){return"m"===o?n?"минута":"минуту":e+" "+t({ss:n?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:n?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[o],+e)}var o=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:n,m:n,mm:n,h:"час",hh:n,d:"день",dd:n,w:"неделя",ww:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n(41655))},40675:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n(41655))},59036:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},59160:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n(41655))},31266:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var i=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?i+(o(e)?"sekundy":"sekúnd"):i+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?i+(o(e)?"minúty":"minút"):i+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?i+(o(e)?"hodiny":"hodín"):i+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?i+(o(e)?"dni":"dní"):i+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?i+(o(e)?"mesiace":"mesiacov"):i+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?i+(o(e)?"roky":"rokov"):i+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:case 4:case 5:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},74699:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+=1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund";case"m":return t?"ena minuta":"eno minuto";case"mm":return r+=1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami";case"h":return t?"ena ura":"eno uro";case"hh":return r+=1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami";case"d":return t||o?"en dan":"enim dnem";case"dd":return r+=1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi";case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+=1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci";case"y":return t||o?"eno leto":"enim letom";case"yy":return r+=1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti"}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(41655))},69728:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},55e3:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(41655))},87129:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(41655))},74346:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n(41655))},9877:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n(41655))},918:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n(41655))},24787:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n(41655))},6199:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n(41655))},91851:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n(41655))},33881:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){var n=e%10,o=e>=100?100:null;return e+(t[e]||t[n]||t[o])},week:{dow:1,doy:7}})}(n(41655))},87828:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n(41655))},99677:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10,r=e%100-o,i=e>=100?100:null;return e+(t[o]||t[r]||t[i])}},week:{dow:1,doy:7}})}(n(41655))},29253:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n(41655))},95586:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e){var t=e;return t=-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"}function o(e){var t=e;return t=-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"}function r(e,t,n,o){var r=i(e);switch(n){case"ss":return r+" lup";case"mm":return r+" tup";case"hh":return r+" rep";case"dd":return r+" jaj";case"MM":return r+" jar";case"yy":return r+" DIS"}}function i(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,i="";return n>0&&(i+=t[n]+"vatlh"),o>0&&(i+=(""!==i?" ":"")+t[o]+"maH"),r>0&&(i+=(""!==i?" ":"")+t[r]),""===i?"pagh":i}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:n,past:o,s:"puS lup",ss:r,m:"wa’ tup",mm:r,h:"wa’ rep",hh:r,d:"wa’ jaj",dd:r,M:"wa’ jar",MM:r,y:"wa’ DIS",yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},17254:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10,r=e%100-o,i=e>=100?100:null;return e+(t[o]||t[r]||t[i])}},week:{dow:1,doy:7}})}(n(41655))},61192:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(41655))},72841:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n(41655))},69631:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n(41655))},71720:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n(41655))},28048:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -function t(e,t){var n=e.split("_");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,o){return"m"===o?n?"хвилина":"хвилину":"h"===o?n?"година":"годину":e+" "+t({ss:n?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:n?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:n?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[o],+e)}function o(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative}function r(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:o,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:r("[Сьогодні "),nextDay:r("[Завтра "),lastDay:r("[Вчора "),nextWeek:r("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return r("[Минулої] dddd [").call(this);case 1:case 2:case 4:return r("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:n,m:n,mm:n,h:"годину",hh:n,d:"день",dd:n,M:"місяць",MM:n,y:"рік",yy:n},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n(41655))},86751:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n(41655))},60513:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n(41655))},96343:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n(41655))},44821:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n(41655))},23973:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n(41655))},15e3:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n(41655))},43762:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n(41655))},9246:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(41655))},41107:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(41655))},79014:function(e,t,n){!function(e){"use strict"; -//! moment.js locale configuration -e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(41655))},41655:function(e,t,n){(e=n.nmd(e)).exports=function(){"use strict";var t,o;function r(){return t.apply(null,arguments)}function i(e){t=e}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(l(e,t))return!1;return!0}function d(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function p(e,t){var n,o=[];for(n=0;n>>0;for(t=0;t0)for(n=0;n<_.length;n++)d(r=t[o=_[n]])||(e[o]=r);return e}function x(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===k&&(k=!0,r.updateOffset(this),k=!1)}function S(e){return e instanceof x||null!=e&&null!=e._isAMomentObject}function M(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function T(e,t){var n=!0;return f((function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var o,i,a,s=[];for(i=0;i=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+o}var Y=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,H=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,I={},F={};function B(e,t,n,o){var r=o;"string"==typeof o&&(r=function(){return this[o]()}),e&&(F[e]=r),t&&(F[t[0]]=function(){return N(r.apply(this,arguments),t[1],t[2])}),n&&(F[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function $(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function W(e){var t,n,o=e.match(Y);for(t=0,n=o.length;t=0&&H.test(e);)e=e.replace(H,o),H.lastIndex=0,n-=1;return e}var U={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function V(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Y).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var K="Invalid date";function q(){return this._invalidDate}var X="%d",J=/\d{1,2}/;function Z(e){return this._ordinal.replace("%d",e)}var Q={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ee(e,t,n,o){var r=this._relativeTime[n];return A(r)?r(e,t,n,o):r.replace(/%d/i,e)}function te(e,t){var n=this._relativeTime[e>0?"future":"past"];return A(n)?n(t):n.replace(/%s/i,t)}var ne={};function oe(e,t){var n=e.toLowerCase();ne[n]=ne[n+"s"]=ne[t]=e}function re(e){return"string"==typeof e?ne[e]||ne[e.toLowerCase()]:void 0}function ie(e){var t,n,o={};for(n in e)l(e,n)&&(t=re(n))&&(o[t]=e[n]);return o}var ae={};function se(e,t){ae[e]=t}function le(e){var t,n=[];for(t in e)l(e,t)&&n.push({unit:t,priority:ae[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}function ce(e){return e%4==0&&e%100!=0||e%400==0}function de(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ue(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=de(t)),n}function he(e,t){return function(n){return null!=n?(fe(this,e,n),r.updateOffset(this,t),this):pe(this,e)}}function pe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function fe(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&ce(e.year())&&1===e.month()&&29===e.date()?(n=ue(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),et(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function me(e){return A(this[e=re(e)])?this[e]():this}function ge(e,t){if("object"==typeof e){var n,o=le(e=ie(e));for(n=0;n68?1900:2e3)};var bt=he("FullYear",!0);function yt(){return ce(this.year())}function vt(e,t,n,o,r,i,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,o,r,i,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,o,r,i,a),s}function _t(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function kt(e,t,n){var o=7+t-n;return-(7+_t(e,0,o).getUTCDay()-t)%7+o-1}function wt(e,t,n,o,r){var i,a,s=1+7*(t-1)+(7+n-o)%7+kt(e,o,r);return s<=0?a=gt(i=e-1)+s:s>gt(e)?(i=e+1,a=s-gt(e)):(i=e,a=s),{year:i,dayOfYear:a}}function xt(e,t,n){var o,r,i=kt(e.year(),t,n),a=Math.floor((e.dayOfYear()-i-1)/7)+1;return a<1?o=a+St(r=e.year()-1,t,n):a>St(e.year(),t,n)?(o=a-St(e.year(),t,n),r=e.year()+1):(r=e.year(),o=a),{week:o,year:r}}function St(e,t,n){var o=kt(e,t,n),r=kt(e+1,t,n);return(gt(e)-o+r)/7}function Mt(e){return xt(e,this._week.dow,this._week.doy).week}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),oe("week","w"),oe("isoWeek","W"),se("week",5),se("isoWeek",5),je("w",xe),je("ww",xe,ve),je("W",xe),je("WW",xe,ve),Be(["w","ww","W","WW"],(function(e,t,n,o){t[o.substr(0,1)]=ue(e)}));var Tt={dow:0,doy:6};function Lt(){return this._week.dow}function Ct(){return this._week.doy}function Et(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function At(e){var t=xt(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Dt(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Pt(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Rt(e,t){return e.slice(t,7).concat(e.slice(0,t))}B("d",0,"do","day"),B("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),B("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),B("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),oe("day","d"),oe("weekday","e"),oe("isoWeekday","E"),se("day",11),se("weekday",11),se("isoWeekday",11),je("d",xe),je("e",xe),je("E",xe),je("dd",(function(e,t){return t.weekdaysMinRegex(e)})),je("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),je("dddd",(function(e,t){return t.weekdaysRegex(e)})),Be(["dd","ddd","dddd"],(function(e,t,n,o){var r=n._locale.weekdaysParse(e,o,n._strict);null!=r?t.d=r:b(n).invalidWeekday=e})),Be(["d","e","E"],(function(e,t,n,o){t[o]=ue(e)}));var Ot="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),jt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Nt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Yt=Oe,Ht=Oe,It=Oe;function Ft(e,t){var n=a(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Rt(n,this._week.dow):e?n[e.day()]:n}function Bt(e){return!0===e?Rt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function $t(e){return!0===e?Rt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Wt(e,t,n){var o,r,i,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)i=m([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(r=We.call(this._weekdaysParse,a))?r:null:"ddd"===t?-1!==(r=We.call(this._shortWeekdaysParse,a))?r:null:-1!==(r=We.call(this._minWeekdaysParse,a))?r:null:"dddd"===t?-1!==(r=We.call(this._weekdaysParse,a))||-1!==(r=We.call(this._shortWeekdaysParse,a))||-1!==(r=We.call(this._minWeekdaysParse,a))?r:null:"ddd"===t?-1!==(r=We.call(this._shortWeekdaysParse,a))||-1!==(r=We.call(this._weekdaysParse,a))||-1!==(r=We.call(this._minWeekdaysParse,a))?r:null:-1!==(r=We.call(this._minWeekdaysParse,a))||-1!==(r=We.call(this._weekdaysParse,a))||-1!==(r=We.call(this._shortWeekdaysParse,a))?r:null}function zt(e,t,n){var o,r,i;if(this._weekdaysParseExact)return Wt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(r=m([2e3,1]).day(o),n&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[o]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[o]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[o].test(e))return o;if(n&&"ddd"===t&&this._shortWeekdaysParse[o].test(e))return o;if(n&&"dd"===t&&this._minWeekdaysParse[o].test(e))return o;if(!n&&this._weekdaysParse[o].test(e))return o}}function Gt(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Dt(e,this.localeData()),this.add(e-t,"d")):t}function Ut(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Vt(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Pt(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Kt(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Jt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=Yt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function qt(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Jt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ht),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Xt(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Jt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=It),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Jt(){function e(e,t){return t.length-e.length}var t,n,o,r,i,a=[],s=[],l=[],c=[];for(t=0;t<7;t++)n=m([2e3,1]).day(t),o=He(this.weekdaysMin(n,"")),r=He(this.weekdaysShort(n,"")),i=He(this.weekdays(n,"")),a.push(o),s.push(r),l.push(i),c.push(o),c.push(r),c.push(i);a.sort(e),s.sort(e),l.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Zt(){return this.hours()%12||12}function Qt(){return this.hours()||24}function en(e,t){B(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function tn(e,t){return t._meridiemParse}function nn(e){return"p"===(e+"").toLowerCase().charAt(0)}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,Zt),B("k",["kk",2],0,Qt),B("hmm",0,0,(function(){return""+Zt.apply(this)+N(this.minutes(),2)})),B("hmmss",0,0,(function(){return""+Zt.apply(this)+N(this.minutes(),2)+N(this.seconds(),2)})),B("Hmm",0,0,(function(){return""+this.hours()+N(this.minutes(),2)})),B("Hmmss",0,0,(function(){return""+this.hours()+N(this.minutes(),2)+N(this.seconds(),2)})),en("a",!0),en("A",!1),oe("hour","h"),se("hour",13),je("a",tn),je("A",tn),je("H",xe),je("h",xe),je("k",xe),je("HH",xe,ve),je("hh",xe,ve),je("kk",xe,ve),je("hmm",Se),je("hmmss",Me),je("Hmm",Se),je("Hmmss",Me),Fe(["H","HH"],Ve),Fe(["k","kk"],(function(e,t,n){var o=ue(e);t[Ve]=24===o?0:o})),Fe(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),Fe(["h","hh"],(function(e,t,n){t[Ve]=ue(e),b(n).bigHour=!0})),Fe("hmm",(function(e,t,n){var o=e.length-2;t[Ve]=ue(e.substr(0,o)),t[Ke]=ue(e.substr(o)),b(n).bigHour=!0})),Fe("hmmss",(function(e,t,n){var o=e.length-4,r=e.length-2;t[Ve]=ue(e.substr(0,o)),t[Ke]=ue(e.substr(o,2)),t[qe]=ue(e.substr(r)),b(n).bigHour=!0})),Fe("Hmm",(function(e,t,n){var o=e.length-2;t[Ve]=ue(e.substr(0,o)),t[Ke]=ue(e.substr(o))})),Fe("Hmmss",(function(e,t,n){var o=e.length-4,r=e.length-2;t[Ve]=ue(e.substr(0,o)),t[Ke]=ue(e.substr(o,2)),t[qe]=ue(e.substr(r))}));var on=/[ap]\.?m?\.?/i,rn=he("Hours",!0);function an(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var sn,ln={calendar:O,longDateFormat:U,invalidDate:K,ordinal:X,dayOfMonthOrdinalParse:J,relativeTime:Q,months:tt,monthsShort:nt,week:Tt,weekdays:Ot,weekdaysMin:Nt,weekdaysShort:jt,meridiemParse:on},cn={},dn={};function un(e,t){var n,o=Math.min(e.length,t.length);for(n=0;n0;){if(o=fn(r.slice(0,t).join("-")))return o;if(n&&n.length>=t&&un(r,n)>=t-1)break;t--}i++}return sn}function fn(t){var o=null;if(void 0===cn[t]&&e&&e.exports)try{o=sn._abbr,n(35358)("./"+t),mn(o)}catch(e){cn[t]=null}return cn[t]}function mn(e,t){var n;return e&&((n=d(t)?yn(e):gn(e,t))?sn=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),sn._abbr}function gn(e,t){if(null!==t){var n,o=ln;if(t.abbr=e,null!=cn[e])E("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=cn[e]._config;else if(null!=t.parentLocale)if(null!=cn[t.parentLocale])o=cn[t.parentLocale]._config;else{if(null==(n=fn(t.parentLocale)))return dn[t.parentLocale]||(dn[t.parentLocale]=[]),dn[t.parentLocale].push({name:e,config:t}),null;o=n._config}return cn[e]=new R(P(o,t)),dn[e]&&dn[e].forEach((function(e){gn(e.name,e.config)})),mn(e),cn[e]}return delete cn[e],null}function bn(e,t){if(null!=t){var n,o,r=ln;null!=cn[e]&&null!=cn[e].parentLocale?cn[e].set(P(cn[e]._config,t)):(null!=(o=fn(e))&&(r=o._config),t=P(r,t),null==o&&(t.abbr=e),(n=new R(t)).parentLocale=cn[e],cn[e]=n),mn(e)}else null!=cn[e]&&(null!=cn[e].parentLocale?(cn[e]=cn[e].parentLocale,e===mn()&&mn(e)):null!=cn[e]&&delete cn[e]);return cn[e]}function yn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return sn;if(!a(e)){if(t=fn(e))return t;e=[e]}return pn(e)}function vn(){return L(cn)}function _n(e){var t,n=e._a;return n&&-2===b(e).overflow&&(t=n[Ge]<0||n[Ge]>11?Ge:n[Ue]<1||n[Ue]>et(n[ze],n[Ge])?Ue:n[Ve]<0||n[Ve]>24||24===n[Ve]&&(0!==n[Ke]||0!==n[qe]||0!==n[Xe])?Ve:n[Ke]<0||n[Ke]>59?Ke:n[qe]<0||n[qe]>59?qe:n[Xe]<0||n[Xe]>999?Xe:-1,b(e)._overflowDayOfYear&&(tUe)&&(t=Ue),b(e)._overflowWeeks&&-1===t&&(t=Je),b(e)._overflowWeekday&&-1===t&&(t=Ze),b(e).overflow=t),e}var kn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,xn=/Z|[+-]\d\d(?::?\d\d)?/,Sn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Mn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Tn=/^\/?Date\((-?\d+)/i,Ln=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Cn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function En(e){var t,n,o,r,i,a,s=e._i,l=kn.exec(s)||wn.exec(s);if(l){for(b(e).iso=!0,t=0,n=Sn.length;tgt(i)||0===e._dayOfYear)&&(b(e)._overflowDayOfYear=!0),n=_t(i,0,e._dayOfYear),e._a[Ge]=n.getUTCMonth(),e._a[Ue]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=o[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Ve]&&0===e._a[Ke]&&0===e._a[qe]&&0===e._a[Xe]&&(e._nextDay=!0,e._a[Ve]=0),e._d=(e._useUTC?_t:vt).apply(null,a),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Ve]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(b(e).weekdayMismatch=!0)}}function Fn(e){var t,n,o,r,i,a,s,l,c;null!=(t=e._w).GG||null!=t.W||null!=t.E?(i=1,a=4,n=Yn(t.GG,e._a[ze],xt(qn(),1,4).year),o=Yn(t.W,1),((r=Yn(t.E,1))<1||r>7)&&(l=!0)):(i=e._locale._week.dow,a=e._locale._week.doy,c=xt(qn(),i,a),n=Yn(t.gg,e._a[ze],c.year),o=Yn(t.w,c.week),null!=t.d?((r=t.d)<0||r>6)&&(l=!0):null!=t.e?(r=t.e+i,(t.e<0||t.e>6)&&(l=!0)):r=i),o<1||o>St(n,i,a)?b(e)._overflowWeeks=!0:null!=l?b(e)._overflowWeekday=!0:(s=wt(n,o,r,i,a),e._a[ze]=s.year,e._dayOfYear=s.dayOfYear)}function Bn(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],b(e).empty=!0;var t,n,o,i,a,s,l=""+e._i,c=l.length,d=0;for(o=G(e._f,e._locale).match(Y)||[],t=0;t0&&b(e).unusedInput.push(a),l=l.slice(l.indexOf(n)+n.length),d+=n.length),F[i]?(n?b(e).empty=!1:b(e).unusedTokens.push(i),$e(i,n,e)):e._strict&&!n&&b(e).unusedTokens.push(i);b(e).charsLeftOver=c-d,l.length>0&&b(e).unusedInput.push(l),e._a[Ve]<=12&&!0===b(e).bigHour&&e._a[Ve]>0&&(b(e).bigHour=void 0),b(e).parsedDateParts=e._a.slice(0),b(e).meridiem=e._meridiem,e._a[Ve]=$n(e._locale,e._a[Ve],e._meridiem),null!==(s=b(e).era)&&(e._a[ze]=e._locale.erasConvertYear(s,e._a[ze])),In(e),_n(e)}else jn(e);else En(e)}function $n(e,t,n){var o;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((o=e.isPM(n))&&t<12&&(t+=12),o||12!==t||(t=0),t):t}function Wn(e){var t,n,o,r,i,a,s=!1;if(0===e._f.length)return b(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;rthis?this:e:v()}));function Zn(e,t){var n,o;if(1===t.length&&a(t[0])&&(t=t[0]),!t.length)return qn();for(n=t[0],o=1;othis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function xo(){if(!d(this._isDSTShifted))return this._isDSTShifted;var e,t={};return w(t,this),(t=Un(t))._a?(e=t._isUTC?m(t._a):qn(t._a),this._isDSTShifted=this.isValid()&&co(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function So(){return!!this.isValid()&&!this._isUTC}function Mo(){return!!this.isValid()&&this._isUTC}function To(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Lo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Co=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Eo(e,t){var n,o,r,i=e,a=null;return so(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(i={},t?i[t]=+e:i.milliseconds=+e):(a=Lo.exec(e))?(n="-"===a[1]?-1:1,i={y:0,d:ue(a[Ue])*n,h:ue(a[Ve])*n,m:ue(a[Ke])*n,s:ue(a[qe])*n,ms:ue(lo(1e3*a[Xe]))*n}):(a=Co.exec(e))?(n="-"===a[1]?-1:1,i={y:Ao(a[2],n),M:Ao(a[3],n),w:Ao(a[4],n),d:Ao(a[5],n),h:Ao(a[6],n),m:Ao(a[7],n),s:Ao(a[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(r=Po(qn(i.from),qn(i.to)),(i={}).ms=r.milliseconds,i.M=r.months),o=new ao(i),so(e)&&l(e,"_locale")&&(o._locale=e._locale),so(e)&&l(e,"_isValid")&&(o._isValid=e._isValid),o}function Ao(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Do(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Po(e,t){var n;return e.isValid()&&t.isValid()?(t=fo(t,e),e.isBefore(t)?n=Do(e,t):((n=Do(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Ro(e,t){return function(n,o){var r;return null===o||isNaN(+o)||(E(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=o,o=r),Oo(this,Eo(n,o),e),this}}function Oo(e,t,n,o){var i=t._milliseconds,a=lo(t._days),s=lo(t._months);e.isValid()&&(o=null==o||o,s&&dt(e,pe(e,"Month")+s*n),a&&fe(e,"Date",pe(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),o&&r.updateOffset(e,a||s))}Eo.fn=ao.prototype,Eo.invalid=io;var jo=Ro(1,"add"),No=Ro(-1,"subtract");function Yo(e){return"string"==typeof e||e instanceof String}function Ho(e){return S(e)||h(e)||Yo(e)||u(e)||Fo(e)||Io(e)||null==e}function Io(e){var t,n,o=s(e)&&!c(e),r=!1,i=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;tn.valueOf():n.valueOf()9999?z(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):A(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",z(n,"Z")):z(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function tr(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,o,r="moment",i="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",o=i+'[")]',this.format(e+t+n+o)}function nr(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=z(this,e);return this.localeData().postformat(t)}function or(e,t){return this.isValid()&&(S(e)&&e.isValid()||qn(e).isValid())?Eo({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function rr(e){return this.from(qn(),e)}function ir(e,t){return this.isValid()&&(S(e)&&e.isValid()||qn(e).isValid())?Eo({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ar(e){return this.to(qn(),e)}function sr(e){var t;return void 0===e?this._locale._abbr:(null!=(t=yn(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var lr=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function cr(){return this._locale}var dr=1e3,ur=60*dr,hr=60*ur,pr=3506328*hr;function fr(e,t){return(e%t+t)%t}function mr(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-pr:new Date(e,t,n).valueOf()}function gr(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-pr:Date.UTC(e,t,n)}function br(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?gr:mr,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=fr(t+(this._isUTC?0:this.utcOffset()*ur),hr);break;case"minute":t=this._d.valueOf(),t-=fr(t,ur);break;case"second":t=this._d.valueOf(),t-=fr(t,dr)}return this._d.setTime(t),r.updateOffset(this,!0),this}function yr(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?gr:mr,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=hr-fr(t+(this._isUTC?0:this.utcOffset()*ur),hr)-1;break;case"minute":t=this._d.valueOf(),t+=ur-fr(t,ur)-1;break;case"second":t=this._d.valueOf(),t+=dr-fr(t,dr)-1}return this._d.setTime(t),r.updateOffset(this,!0),this}function vr(){return this._d.valueOf()-6e4*(this._offset||0)}function _r(){return Math.floor(this.valueOf()/1e3)}function kr(){return new Date(this.valueOf())}function wr(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function xr(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Sr(){return this.isValid()?this.toISOString():null}function Mr(){return y(this)}function Tr(){return f({},b(this))}function Lr(){return b(this).overflow}function Cr(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Er(e,t){var n,o,i,a=this._eras||yn("en")._eras;for(n=0,o=a.length;n=0)return l[o]}function Dr(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n}function Pr(){var e,t,n,o=this.localeData().eras();for(e=0,t=o.length;e(i=St(e,o,r))&&(t=i),Zr.call(this,e,t,n,o,r))}function Zr(e,t,n,o,r){var i=wt(e,t,n,o,r),a=_t(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Qr(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}B("N",0,0,"eraAbbr"),B("NN",0,0,"eraAbbr"),B("NNN",0,0,"eraAbbr"),B("NNNN",0,0,"eraName"),B("NNNNN",0,0,"eraNarrow"),B("y",["y",1],"yo","eraYear"),B("y",["yy",2],0,"eraYear"),B("y",["yyy",3],0,"eraYear"),B("y",["yyyy",4],0,"eraYear"),je("N",Ir),je("NN",Ir),je("NNN",Ir),je("NNNN",Fr),je("NNNNN",Br),Fe(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,o){var r=n._locale.erasParse(e,o,n._strict);r?b(n).era=r:b(n).invalidEra=e})),je("y",Ee),je("yy",Ee),je("yyy",Ee),je("yyyy",Ee),je("yo",$r),Fe(["y","yy","yyy","yyyy"],ze),Fe(["yo"],(function(e,t,n,o){var r;n._locale._eraYearOrdinalRegex&&(r=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[ze]=n._locale.eraYearOrdinalParse(e,r):t[ze]=parseInt(e,10)})),B(0,["gg",2],0,(function(){return this.weekYear()%100})),B(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),zr("gggg","weekYear"),zr("ggggg","weekYear"),zr("GGGG","isoWeekYear"),zr("GGGGG","isoWeekYear"),oe("weekYear","gg"),oe("isoWeekYear","GG"),se("weekYear",1),se("isoWeekYear",1),je("G",Ae),je("g",Ae),je("GG",xe,ve),je("gg",xe,ve),je("GGGG",Le,ke),je("gggg",Le,ke),je("GGGGG",Ce,we),je("ggggg",Ce,we),Be(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,o){t[o.substr(0,2)]=ue(e)})),Be(["gg","GG"],(function(e,t,n,o){t[o]=r.parseTwoDigitYear(e)})),B("Q",0,"Qo","quarter"),oe("quarter","Q"),se("quarter",7),je("Q",ye),Fe("Q",(function(e,t){t[Ge]=3*(ue(e)-1)})),B("D",["DD",2],"Do","date"),oe("date","D"),se("date",9),je("D",xe),je("DD",xe,ve),je("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),Fe(["D","DD"],Ue),Fe("Do",(function(e,t){t[Ue]=ue(e.match(xe)[0])}));var ei=he("Date",!0);function ti(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}B("DDD",["DDDD",3],"DDDo","dayOfYear"),oe("dayOfYear","DDD"),se("dayOfYear",4),je("DDD",Te),je("DDDD",_e),Fe(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=ue(e)})),B("m",["mm",2],0,"minute"),oe("minute","m"),se("minute",14),je("m",xe),je("mm",xe,ve),Fe(["m","mm"],Ke);var ni=he("Minutes",!1);B("s",["ss",2],0,"second"),oe("second","s"),se("second",15),je("s",xe),je("ss",xe,ve),Fe(["s","ss"],qe);var oi,ri,ii=he("Seconds",!1);for(B("S",0,0,(function(){return~~(this.millisecond()/100)})),B(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),B(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),B(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),B(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),B(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),B(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),oe("millisecond","ms"),se("millisecond",16),je("S",Te,ye),je("SS",Te,ve),je("SSS",Te,_e),oi="SSSS";oi.length<=9;oi+="S")je(oi,Ee);function ai(e,t){t[Xe]=ue(1e3*("0."+e))}for(oi="S";oi.length<=9;oi+="S")Fe(oi,ai);function si(){return this._isUTC?"UTC":""}function li(){return this._isUTC?"Coordinated Universal Time":""}ri=he("Milliseconds",!1),B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var ci=x.prototype;function di(e){return qn(1e3*e)}function ui(){return qn.apply(null,arguments).parseZone()}function hi(e){return e}ci.add=jo,ci.calendar=Wo,ci.clone=zo,ci.diff=Jo,ci.endOf=yr,ci.format=nr,ci.from=or,ci.fromNow=rr,ci.to=ir,ci.toNow=ar,ci.get=me,ci.invalidAt=Lr,ci.isAfter=Go,ci.isBefore=Uo,ci.isBetween=Vo,ci.isSame=Ko,ci.isSameOrAfter=qo,ci.isSameOrBefore=Xo,ci.isValid=Mr,ci.lang=lr,ci.locale=sr,ci.localeData=cr,ci.max=Jn,ci.min=Xn,ci.parsingFlags=Tr,ci.set=ge,ci.startOf=br,ci.subtract=No,ci.toArray=wr,ci.toObject=xr,ci.toDate=kr,ci.toISOString=er,ci.inspect=tr,"undefined"!=typeof Symbol&&null!=Symbol.for&&(ci[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ci.toJSON=Sr,ci.toString=Qo,ci.unix=_r,ci.valueOf=vr,ci.creationData=Cr,ci.eraName=Pr,ci.eraNarrow=Rr,ci.eraAbbr=Or,ci.eraYear=jr,ci.year=bt,ci.isLeapYear=yt,ci.weekYear=Gr,ci.isoWeekYear=Ur,ci.quarter=ci.quarters=Qr,ci.month=ut,ci.daysInMonth=ht,ci.week=ci.weeks=Et,ci.isoWeek=ci.isoWeeks=At,ci.weeksInYear=qr,ci.weeksInWeekYear=Xr,ci.isoWeeksInYear=Vr,ci.isoWeeksInISOWeekYear=Kr,ci.date=ei,ci.day=ci.days=Gt,ci.weekday=Ut,ci.isoWeekday=Vt,ci.dayOfYear=ti,ci.hour=ci.hours=rn,ci.minute=ci.minutes=ni,ci.second=ci.seconds=ii,ci.millisecond=ci.milliseconds=ri,ci.utcOffset=go,ci.utc=yo,ci.local=vo,ci.parseZone=_o,ci.hasAlignedHourOffset=ko,ci.isDST=wo,ci.isLocal=So,ci.isUtcOffset=Mo,ci.isUtc=To,ci.isUTC=To,ci.zoneAbbr=si,ci.zoneName=li,ci.dates=T("dates accessor is deprecated. Use date instead.",ei),ci.months=T("months accessor is deprecated. Use month instead",ut),ci.years=T("years accessor is deprecated. Use year instead",bt),ci.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",bo),ci.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",xo);var pi=R.prototype;function fi(e,t,n,o){var r=yn(),i=m().set(o,t);return r[n](i,e)}function mi(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return fi(e,t,n,"month");var o,r=[];for(o=0;o<12;o++)r[o]=fi(e,o,n,"month");return r}function gi(e,t,n,o){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var r,i=yn(),a=e?i._week.dow:0,s=[];if(null!=n)return fi(t,(n+a)%7,o,"day");for(r=0;r<7;r++)s[r]=fi(t,(r+a)%7,o,"day");return s}function bi(e,t){return mi(e,t,"months")}function yi(e,t){return mi(e,t,"monthsShort")}function vi(e,t,n){return gi(e,t,n,"weekdays")}function _i(e,t,n){return gi(e,t,n,"weekdaysShort")}function ki(e,t,n){return gi(e,t,n,"weekdaysMin")}pi.calendar=j,pi.longDateFormat=V,pi.invalidDate=q,pi.ordinal=Z,pi.preparse=hi,pi.postformat=hi,pi.relativeTime=ee,pi.pastFuture=te,pi.set=D,pi.eras=Er,pi.erasParse=Ar,pi.erasConvertYear=Dr,pi.erasAbbrRegex=Yr,pi.erasNameRegex=Nr,pi.erasNarrowRegex=Hr,pi.months=at,pi.monthsShort=st,pi.monthsParse=ct,pi.monthsRegex=ft,pi.monthsShortRegex=pt,pi.week=Mt,pi.firstDayOfYear=Ct,pi.firstDayOfWeek=Lt,pi.weekdays=Ft,pi.weekdaysMin=$t,pi.weekdaysShort=Bt,pi.weekdaysParse=zt,pi.weekdaysRegex=Kt,pi.weekdaysShortRegex=qt,pi.weekdaysMinRegex=Xt,pi.isPM=nn,pi.meridiem=an,mn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===ue(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=T("moment.lang is deprecated. Use moment.locale instead.",mn),r.langData=T("moment.langData is deprecated. Use moment.localeData instead.",yn);var wi=Math.abs;function xi(){var e=this._data;return this._milliseconds=wi(this._milliseconds),this._days=wi(this._days),this._months=wi(this._months),e.milliseconds=wi(e.milliseconds),e.seconds=wi(e.seconds),e.minutes=wi(e.minutes),e.hours=wi(e.hours),e.months=wi(e.months),e.years=wi(e.years),this}function Si(e,t,n,o){var r=Eo(t,n);return e._milliseconds+=o*r._milliseconds,e._days+=o*r._days,e._months+=o*r._months,e._bubble()}function Mi(e,t){return Si(this,e,t,1)}function Ti(e,t){return Si(this,e,t,-1)}function Li(e){return e<0?Math.floor(e):Math.ceil(e)}function Ci(){var e,t,n,o,r,i=this._milliseconds,a=this._days,s=this._months,l=this._data;return i>=0&&a>=0&&s>=0||i<=0&&a<=0&&s<=0||(i+=864e5*Li(Ai(s)+a),a=0,s=0),l.milliseconds=i%1e3,e=de(i/1e3),l.seconds=e%60,t=de(e/60),l.minutes=t%60,n=de(t/60),l.hours=n%24,a+=de(n/24),s+=r=de(Ei(a)),a-=Li(Ai(r)),o=de(s/12),s%=12,l.days=a,l.months=s,l.years=o,this}function Ei(e){return 4800*e/146097}function Ai(e){return 146097*e/4800}function Di(e){if(!this.isValid())return NaN;var t,n,o=this._milliseconds;if("month"===(e=re(e))||"quarter"===e||"year"===e)switch(t=this._days+o/864e5,n=this._months+Ei(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Ai(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function Pi(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ue(this._months/12):NaN}function Ri(e){return function(){return this.as(e)}}var Oi=Ri("ms"),ji=Ri("s"),Ni=Ri("m"),Yi=Ri("h"),Hi=Ri("d"),Ii=Ri("w"),Fi=Ri("M"),Bi=Ri("Q"),$i=Ri("y");function Wi(){return Eo(this)}function zi(e){return e=re(e),this.isValid()?this[e+"s"]():NaN}function Gi(e){return function(){return this.isValid()?this._data[e]:NaN}}var Ui=Gi("milliseconds"),Vi=Gi("seconds"),Ki=Gi("minutes"),qi=Gi("hours"),Xi=Gi("days"),Ji=Gi("months"),Zi=Gi("years");function Qi(){return de(this.days()/7)}var ea=Math.round,ta={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function na(e,t,n,o,r){return r.relativeTime(t||1,!!n,e,o)}function oa(e,t,n,o){var r=Eo(e).abs(),i=ea(r.as("s")),a=ea(r.as("m")),s=ea(r.as("h")),l=ea(r.as("d")),c=ea(r.as("M")),d=ea(r.as("w")),u=ea(r.as("y")),h=i<=n.ss&&["s",i]||i0,h[4]=o,na.apply(null,h)}function ra(e){return void 0===e?ea:"function"==typeof e&&(ea=e,!0)}function ia(e,t){return void 0!==ta[e]&&(void 0===t?ta[e]:(ta[e]=t,"s"===e&&(ta.ss=t-1),!0))}function aa(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,o,r=!1,i=ta;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(r=e),"object"==typeof t&&(i=Object.assign({},ta,t),null!=t.s&&null==t.ss&&(i.ss=t.s-1)),o=oa(this,!r,i,n=this.localeData()),r&&(o=n.pastFuture(+this,o)),n.postformat(o)}var sa=Math.abs;function la(e){return(e>0)-(e<0)||+e}function ca(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,o,r,i,a,s,l=sa(this._milliseconds)/1e3,c=sa(this._days),d=sa(this._months),u=this.asSeconds();return u?(e=de(l/60),t=de(e/60),l%=60,e%=60,n=de(d/12),d%=12,o=l?l.toFixed(3).replace(/\.?0+$/,""):"",r=u<0?"-":"",i=la(this._months)!==la(u)?"-":"",a=la(this._days)!==la(u)?"-":"",s=la(this._milliseconds)!==la(u)?"-":"",r+"P"+(n?i+n+"Y":"")+(d?i+d+"M":"")+(c?a+c+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+o+"S":"")):"P0D"}var da=ao.prototype;return da.isValid=ro,da.abs=xi,da.add=Mi,da.subtract=Ti,da.as=Di,da.asMilliseconds=Oi,da.asSeconds=ji,da.asMinutes=Ni,da.asHours=Yi,da.asDays=Hi,da.asWeeks=Ii,da.asMonths=Fi,da.asQuarters=Bi,da.asYears=$i,da.valueOf=Pi,da._bubble=Ci,da.clone=Wi,da.get=zi,da.milliseconds=Ui,da.seconds=Vi,da.minutes=Ki,da.hours=qi,da.days=Xi,da.weeks=Qi,da.months=Ji,da.years=Zi,da.humanize=aa,da.toISOString=ca,da.toString=ca,da.toJSON=ca,da.locale=sr,da.localeData=cr,da.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ca),da.lang=lr,B("X",0,0,"unix"),B("x",0,0,"valueOf"),je("x",Ae),je("X",Re),Fe("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),Fe("x",(function(e,t,n){n._d=new Date(ue(e))})), -//! moment.js -r.version="2.29.1",i(qn),r.fn=ci,r.min=Qn,r.max=eo,r.now=to,r.utc=m,r.unix=di,r.months=bi,r.isDate=h,r.locale=mn,r.invalid=v,r.duration=Eo,r.isMoment=S,r.weekdays=vi,r.parseZone=ui,r.localeData=yn,r.isDuration=so,r.monthsShort=yi,r.weekdaysMin=ki,r.defineLocale=gn,r.updateLocale=bn,r.locales=vn,r.weekdaysShort=_i,r.normalizeUnits=re,r.relativeTimeRounding=ra,r.relativeTimeThreshold=ia,r.calendarFormat=$o,r.prototype=ci,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()},33780:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});function o(e){return e.toLowerCase()}var r=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],i=/[^A-Z0-9]+/gi;function a(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,a=void 0===n?r:n,l=t.stripRegexp,c=void 0===l?i:l,d=t.transform,u=void 0===d?o:d,h=t.delimiter,p=void 0===h?" ":h,f=s(s(e,a,"$1\0$2"),c,"\0"),m=0,g=f.length;"\0"===f.charAt(m);)m++;for(;"\0"===f.charAt(g-1);)g--;return f.slice(m,g).split("\0").map(u).join(p)}function s(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}},15937:(e,t,n)=>{var o="function"==typeof Map&&Map.prototype,r=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=o&&r&&"function"==typeof r.get?r.get:null,a=o&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&l&&"function"==typeof l.get?l.get:null,d=s&&Set.prototype.forEach,u="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,b=String.prototype.match,y=String.prototype.slice,v=String.prototype.replace,_=String.prototype.toUpperCase,k=String.prototype.toLowerCase,w=RegExp.prototype.test,x=Array.prototype.concat,S=Array.prototype.join,M=Array.prototype.slice,T=Math.floor,L="function"==typeof BigInt?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,A="function"==typeof Symbol&&"object"==typeof Symbol.iterator,D="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===A||"symbol")?Symbol.toStringTag:null,P=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function O(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||w.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var o=e<0?-T(-e):T(e);if(o!==e){var r=String(o),i=y.call(t,r.length+1);return v.call(r,n,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(t,n,"$&_")}var j=n(42634),N=j.custom,Y=$(N)?N:null;function H(e,t,n){var o="double"===(n.quoteStyle||t)?'"':"'";return o+e+o}function I(e){return v.call(String(e),/"/g,""")}function F(e){return!("[object Array]"!==G(e)||D&&"object"==typeof e&&D in e)}function B(e){return!("[object RegExp]"!==G(e)||D&&"object"==typeof e&&D in e)}function $(e){if(A)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!E)return!1;try{return E.call(e),!0}catch(e){}return!1}e.exports=function e(t,o,r,s){var l=o||{};if(z(l,"quoteStyle")&&"single"!==l.quoteStyle&&"double"!==l.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!z(l,"customInspect")||l.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var _=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return V(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return _?O(t,w):w}if("bigint"==typeof t){var T=String(t)+"n";return _?O(t,T):T}var C=void 0===l.depth?5:l.depth;if(void 0===r&&(r=0),r>=C&&C>0&&"object"==typeof t)return F(t)?"[Array]":"[Object]";var N=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=S.call(Array(e.indent+1)," ")}return{base:n,prev:S.call(Array(t+1),n)}}(l,r);if(void 0===s)s=[];else if(U(s,t)>=0)return"[Circular]";function W(t,n,o){if(n&&(s=M.call(s)).push(n),o){var i={depth:l.depth};return z(l,"quoteStyle")&&(i.quoteStyle=l.quoteStyle),e(t,i,r+1,s)}return e(t,l,r+1,s)}if("function"==typeof t&&!B(t)){var K=function(e){if(e.name)return e.name;var t=b.call(g.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),ee=Q(t,W);return"[Function"+(K?": "+K:" (anonymous)")+"]"+(ee.length>0?" { "+S.call(ee,", ")+" }":"")}if($(t)){var te=A?v.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):E.call(t);return"object"!=typeof t||A?te:q(te)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var ne="<"+k.call(String(t.nodeName)),oe=t.attributes||[],re=0;re"}if(F(t)){if(0===t.length)return"[]";var ie=Q(t,W);return N&&!function(e){for(var t=0;t=0)return!1;return!0}(ie)?"["+Z(ie,N)+"]":"[ "+S.call(ie,", ")+" ]"}if(function(e){return!("[object Error]"!==G(e)||D&&"object"==typeof e&&D in e)}(t)){var ae=Q(t,W);return"cause"in Error.prototype||!("cause"in t)||P.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+S.call(ae,", ")+" }":"{ ["+String(t)+"] "+S.call(x.call("[cause]: "+W(t.cause),ae),", ")+" }"}if("object"==typeof t&&m){if(Y&&"function"==typeof t[Y]&&j)return j(t,{depth:C-r});if("symbol"!==m&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var se=[];return a&&a.call(t,(function(e,n){se.push(W(n,t,!0)+" => "+W(e,t))})),J("Map",i.call(t),se,N)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var le=[];return d&&d.call(t,(function(e){le.push(W(e,t))})),J("Set",c.call(t),le,N)}if(function(e){if(!u||!e||"object"!=typeof e)return!1;try{u.call(e,u);try{h.call(e,h)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return X("WeakMap");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{h.call(e,h);try{u.call(e,u)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return X("WeakSet");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{return p.call(e),!0}catch(e){}return!1}(t))return X("WeakRef");if(function(e){return!("[object Number]"!==G(e)||D&&"object"==typeof e&&D in e)}(t))return q(W(Number(t)));if(function(e){if(!e||"object"!=typeof e||!L)return!1;try{return L.call(e),!0}catch(e){}return!1}(t))return q(W(L.call(t)));if(function(e){return!("[object Boolean]"!==G(e)||D&&"object"==typeof e&&D in e)}(t))return q(f.call(t));if(function(e){return!("[object String]"!==G(e)||D&&"object"==typeof e&&D in e)}(t))return q(W(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if(t===n.g)return"{ [object globalThis] }";if(!function(e){return!("[object Date]"!==G(e)||D&&"object"==typeof e&&D in e)}(t)&&!B(t)){var ce=Q(t,W),de=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,ue=t instanceof Object?"":"null prototype",he=!de&&D&&Object(t)===t&&D in t?y.call(G(t),8,-1):ue?"Object":"",pe=(de||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||ue?"["+S.call(x.call([],he||[],ue||[]),": ")+"] ":"");return 0===ce.length?pe+"{}":N?pe+"{"+Z(ce,N)+"}":pe+"{ "+S.call(ce,", ")+" }"}return String(t)};var W=Object.prototype.hasOwnProperty||function(e){return e in this};function z(e,t){return W.call(e,t)}function G(e){return m.call(e)}function U(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,o=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,o="... "+n+" more character"+(n>1?"s":"");return V(y.call(e,0,t.maxStringLength),t)+o}return H(v.call(v.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,K),"single",t)}function K(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+_.call(t.toString(16))}function q(e){return"Object("+e+")"}function X(e){return e+" { ? }"}function J(e,t,n,o){return e+" ("+t+") {"+(o?Z(n,o):S.call(n,", "))+"}"}function Z(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+S.call(e,","+n)+"\n"+t.prev}function Q(e,t){var n=F(e),o=[];if(n){o.length=e.length;for(var r=0;r{"use strict";n.d(t,{fL:()=>a});var o=function(){return o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&n>="0"&&n<="9"?"_"+n+o:""+n.toUpperCase()+o}function a(e,t){return void 0===t&&(t={}),(0,r.W)(e,o({delimiter:"",transform:i},t))}},70628:(e,t,n)=>{"use strict";var o=n(54067);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,a){if(a!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},75826:(e,t,n)=>{e.exports=n(70628)()},54067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},59647:e=>{"use strict";var t=String.prototype.replace,n=/%20/g,o="RFC1738",r="RFC3986";e.exports={default:r,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:o,RFC3986:r}},97691:(e,t,n)=>{"use strict";var o=n(25882),r=n(21348),i=n(59647);e.exports={formats:i,parse:r,stringify:o}},21348:(e,t,n)=>{"use strict";var o=n(54662),r=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:o.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},l=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,n,o){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(i),c=s?i.slice(0,s.index):i,d=[];if(c){if(!n.plainObjects&&r.call(Object.prototype,c)&&!n.allowPrototypes)return;d.push(c)}for(var u=0;n.depth>0&&null!==(s=a.exec(i))&&u=0;--i){var a,s=e[i];if("[]"===s&&n.parseArrays)a=n.allowEmptyArrays&&""===r?[]:[].concat(r);else{a=n.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,d=n.decodeDotInKeys?c.replace(/%2E/g,"."):c,u=parseInt(d,10);n.parseArrays||""!==d?!isNaN(u)&&s!==d&&String(u)===d&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(a=[])[u]=r:"__proto__"!==d&&(a[d]=r):a={0:r}}r=a}return r}(d,t,n,o)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset,n=void 0===e.duplicates?a.duplicates:e.duplicates;if("combine"!==n&&"first"!==n&&"last"!==n)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||a.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:a.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||o.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,duplicates:n,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var d="string"==typeof e?function(e,t){var n,c={__proto__:null},d=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,u=t.parameterLimit===1/0?void 0:t.parameterLimit,h=d.split(t.delimiter,u),p=-1,f=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(g=i(g)?[g]:g);var _=r.call(c,m);_&&"combine"===t.duplicates?c[m]=o.combine(c[m],g):_&&"last"!==t.duplicates||(c[m]=g)}return c}(e,n):e,u=n.plainObjects?Object.create(null):{},h=Object.keys(d),p=0;p{"use strict";var o=n(38402),r=n(54662),i=n(59647),a=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,d=function(e,t){c.apply(e,l(t)?t:[t])},u=Date.prototype.toISOString,h=i.default,p={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,format:h,formatter:i.formatters[h],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},f={},m=function e(t,n,i,a,s,c,u,h,m,g,b,y,v,_,k,w,x,S){for(var M,T=t,L=S,C=0,E=!1;void 0!==(L=L.get(f))&&!E;){var A=L.get(t);if(C+=1,void 0!==A){if(A===C)throw new RangeError("Cyclic object value");E=!0}void 0===L.get(f)&&(C=0)}if("function"==typeof g?T=g(n,T):T instanceof Date?T=v(T):"comma"===i&&l(T)&&(T=r.maybeMap(T,(function(e){return e instanceof Date?v(e):e}))),null===T){if(c)return m&&!w?m(n,p.encoder,x,"key",_):n;T=""}if("string"==typeof(M=T)||"number"==typeof M||"boolean"==typeof M||"symbol"==typeof M||"bigint"==typeof M||r.isBuffer(T))return m?[k(w?n:m(n,p.encoder,x,"key",_))+"="+k(m(T,p.encoder,x,"value",_))]:[k(n)+"="+k(String(T))];var D,P=[];if(void 0===T)return P;if("comma"===i&&l(T))w&&m&&(T=r.maybeMap(T,m)),D=[{value:T.length>0?T.join(",")||null:void 0}];else if(l(g))D=g;else{var R=Object.keys(T);D=b?R.sort(b):R}var O=h?n.replace(/\./g,"%2E"):n,j=a&&l(T)&&1===T.length?O+"[]":O;if(s&&l(T)&&0===T.length)return j+"[]";for(var N=0;N0?_+v:""}},54662:(e,t,n)=>{"use strict";var o=n(59647),r=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},o=0;o1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var o=[],r=0;r=l?s.slice(d,d+l):s,h=[],p=0;p=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||i===o.RFC1738&&(40===f||41===f)?h[h.length]=u.charAt(p):f<128?h[h.length]=a[f]:f<2048?h[h.length]=a[192|f>>6]+a[128|63&f]:f<55296||f>=57344?h[h.length]=a[224|f>>12]+a[128|f>>6&63]+a[128|63&f]:(p+=1,f=65536+((1023&f)<<10|1023&u.charCodeAt(p)),h[h.length]=a[240|f>>18]+a[128|f>>12&63]+a[128|f>>6&63]+a[128|63&f])}c+=h.join("")}return c},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],o=0;o0&&this.handleMarkers(x);var L=this.editor.$options;d.editorOptions.forEach((function(t){L.hasOwnProperty(t)?e.editor.setOption(t,e.props[t]):e.props[t]&&console.warn("ReactAce: editor option ".concat(t," was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"))})),this.handleOptions(this.props),Array.isArray(k)&&k.forEach((function(t){"string"==typeof t.exec?e.editor.commands.bindKey(t.bindKey,t.exec):e.editor.commands.addCommand(t)})),v&&this.editor.setKeyboardHandler("ace/keyboard/"+v),n&&(this.refEditor.className+=" "+n),_&&_(this.editor),this.editor.resize(),a&&this.editor.focus()},t.prototype.componentDidUpdate=function(e){for(var t=e,n=this.props,o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAceInstance=t.debounce=t.editorEvents=t.editorOptions=void 0;t.editorOptions=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"];t.editorEvents=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"];t.getAceInstance=function(){var e;return"undefined"==typeof window?(n.g.window={},e=n(16990),delete n.g.window):window.ace?(e=window.ace).acequire=window.ace.require||window.ace.acequire:e=n(16990),e};t.debounce=function(e,t){var n=null;return function(){var o=this,r=arguments;clearTimeout(n),n=setTimeout((function(){e.apply(o,r)}),t)}}},76216:(e,t,n)=>{"use strict";var o=n(75055);n(85405).default,n(55768).default,t.Ay=o.default},55768:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&e.handleMarkers(k,t);for(o=0;o{"use strict"; -/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var o=n(77810),r=n(82328);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n