').addClass('treegrid-' + node.id).data('nodeId', node.id); // Storing node ID for easy access later\n\n if (depth === 0) {\n tr.css({\n 'display': 'none'\n });\n }\n if (node.parent) {\n var parentSelector = \".treegrid-\".concat(node.parent);\n var lastChildSelector = \".treegrid-parent-\".concat(node.parent);\n if ($(lastChildSelector).length > 0) {\n var lastChild = $(lastChildSelector).last();\n tr.insertAfter(lastChild);\n } else {\n tr.insertAfter($(parentSelector));\n }\n tr.addClass('treegrid-parent-' + node.parent);\n } else {\n tr.appendTo(this.table);\n }\n return tr;\n }\n }, {\n key: \"toggleChildrenVisibility\",\n value: function toggleChildrenVisibility(nodeId, isExpanded) {\n var _this = this;\n var selector = \".treegrid-parent-\".concat(nodeId);\n $(selector).each(function (_, el) {\n $(el).toggle(!isExpanded);\n if (isExpanded) {\n // If we are hiding the children\n var childNodeId = $(el).data('nodeId'); // Assume data-nodeId is set when rows are created\n _this.toggleChildrenVisibility(childNodeId, true); // Recursively hide all descendants\n var expander = $(\".treegrid-\".concat(nodeId, \" .treegrid-expander\"));\n expander.html(isExpanded ? '+' : '-');\n }\n });\n }\n }, {\n key: \"setupExpander\",\n value: function setupExpander(cell, callback) {\n var expander = $('').addClass('treegrid-expander').html('-').appendTo(cell);\n expander.click(callback);\n }\n }]);\n return LayoutTreeDataGridView;\n}();\nvar LayoutTreeGridController = /*#__PURE__*/function () {\n function LayoutTreeGridController(model, view, options) {\n _classCallCheck(this, LayoutTreeGridController);\n this.model = model;\n this.view = view;\n this.options = options;\n this.apiClient = new _APIClient__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n }\n _createClass(LayoutTreeGridController, [{\n key: \"init\",\n value: function init(targetConent, callback) {\n this.targetContent = targetConent;\n this.view.addHeaders(this.options);\n this.processNode(this.model.dataRoot, 0);\n this.setupEditableFields();\n this.callback = callback;\n }\n }, {\n key: \"getIndent\",\n value: function getIndent(depth) {\n return new Array(depth + 1).join('');\n }\n }, {\n key: \"fillPadding\",\n value: function () {\n var _fillPadding = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, dataLength) {\n var paddedValue;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this.apiClient.processPreScriptAndVariables(this.model.apiRequest, value.toString());\n case 2:\n paddedValue = _context.sent;\n while (paddedValue.length < dataLength) {\n paddedValue = ' ' + paddedValue; // Prepend a space character to the string\n }\n return _context.abrupt(\"return\", paddedValue);\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function fillPadding(_x, _x2) {\n return _fillPadding.apply(this, arguments);\n }\n return fillPadding;\n }()\n }, {\n key: \"concatenateFieldValues\",\n value: function () {\n var _concatenateFieldValues = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(root) {\n var queue, concatenatedValues, node, _iterator, _step, child;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n queue = [root];\n concatenatedValues = '';\n case 2:\n if (!(queue.length > 0)) {\n _context2.next = 15;\n break;\n }\n node = queue.shift();\n if (!(node.loutItemType === 'Field')) {\n _context2.next = 12;\n break;\n }\n _context2.t0 = concatenatedValues;\n _context2.next = 8;\n return this.fillPadding(node.value, node.loutItemLength);\n case 8:\n _context2.t1 = _context2.sent;\n if (_context2.t1) {\n _context2.next = 11;\n break;\n }\n _context2.t1 = '';\n case 11:\n concatenatedValues = _context2.t0 += _context2.t1;\n case 12:\n if (node.children && node.children.length > 0) {\n _iterator = _createForOfIteratorHelper(node.children);\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n child = _step.value;\n queue.push(child);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n _context2.next = 2;\n break;\n case 15:\n return _context2.abrupt(\"return\", concatenatedValues);\n case 16:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function concatenateFieldValues(_x3) {\n return _concatenateFieldValues.apply(this, arguments);\n }\n return concatenateFieldValues;\n }()\n }, {\n key: \"sumFieldLoutItemLengths\",\n value: function sumFieldLoutItemLengths() {\n var queue = [this.model.dataRoot];\n var sum = 0;\n while (queue.length > 0) {\n var node = queue.shift();\n if (node.loutItemType === 'Field') {\n sum += node.loutItemLength || 0; // Add the loutItemLength of the node, or 0 if undefined\n }\n if (node.children && node.children.length > 0) {\n var _iterator2 = _createForOfIteratorHelper(node.children),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var child = _step2.value;\n queue.push(child);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n }\n return sum;\n }\n }, {\n key: \"setupEditableFields\",\n value: function setupEditableFields() {\n var _this2 = this;\n this.view.table.find('.editable').each(function (index, editableElement) {\n var editableInput = new _EditableInput__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n name: editableElement.dataset.name,\n value: editableElement.dataset.value,\n path: editableElement.dataset.path\n });\n editableInput.init(editableElement, /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(value) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n console.log(editableElement.dataset.path);\n console.log(value);\n _.set(_this2.model.dataRoot, editableElement.dataset.path, value);\n console.log(_this2.model.dataRoot);\n _context3.t0 = _this2;\n _context3.next = 7;\n return _this2.concatenateFieldValues(_this2.model.dataRoot);\n case 7:\n _context3.t1 = _context3.sent;\n _context3.t0.callback.call(_context3.t0, _context3.t1);\n case 9:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function (_x4) {\n return _ref.apply(this, arguments);\n };\n }());\n });\n this.targetContent.find('.total_message_length').text(this.sumFieldLoutItemLengths());\n }\n }, {\n key: \"addCell\",\n value: function addCell(row, node, fieldInfo, depth) {\n var td = $('').appendTo(row);\n var padding = fieldInfo.isFirst ? this.getIndent(depth) : '';\n var nodePath = this.model.getNodePath(this.model.dataRoot, node.id) + \".value\";\n if (node.loutItemType === 'Field' && fieldInfo.type === 'textfield') {\n var div = $('');\n div.addClass('editable');\n div.appendTo(td);\n div.attr('data-name', fieldInfo.name);\n div.attr('data-value', node[fieldInfo.name]);\n div.attr('data-path', nodePath);\n } else {\n td.html(padding); // Default to just displaying the content\n }\n if (fieldInfo.width) {\n td.css({\n 'width': fieldInfo.width + 'px',\n 'border': '1px gray solid'\n });\n }\n if (fieldInfo.align) {\n td.css({\n 'text-align': fieldInfo.align\n });\n }\n return td;\n }\n\n //processNode in bfs\n }, {\n key: \"processNode\",\n value: function processNode(node, depth) {\n var _this3 = this;\n var queue = [{\n node: node,\n depth: depth\n }];\n var _loop = function _loop() {\n var _queue$shift = queue.shift(),\n node = _queue$shift.node,\n depth = _queue$shift.depth;\n var tr = _this3.view.addRow(node, depth);\n _this3.options.forEach(function (fieldInfo) {\n var content = node[fieldInfo.name];\n var td = _this3.addCell(tr, node, fieldInfo, depth);\n if (fieldInfo.isFirst) {\n if (node.children && node.children.length > 0) {\n _this3.view.setupExpander($(tr.children()[0]), function () {\n return _this3.handleExpanderClick(node.id);\n });\n }\n }\n if (fieldInfo.type !== 'textfield') {\n td.append(content);\n }\n });\n if (node.children && node.children.length > 0) {\n var _iterator3 = _createForOfIteratorHelper(node.children),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var child = _step3.value;\n queue.push({\n node: child,\n depth: depth + 1\n });\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n };\n while (queue.length > 0) {\n _loop();\n }\n }\n }, {\n key: \"handleExpanderClick\",\n value: function handleExpanderClick(nodeId) {\n var expander = $(\".treegrid-\".concat(nodeId, \" .treegrid-expander\"));\n var isExpanded = expander.html() === '-';\n expander.html(isExpanded ? '+' : '-');\n this.view.toggleChildrenVisibility(nodeId, isExpanded);\n }\n }]);\n return LayoutTreeGridController;\n}();\nvar LayoutTreeDataGrid = /*#__PURE__*/function () {\n function LayoutTreeDataGrid(selector, root, apiRequest, options) {\n _classCallCheck(this, LayoutTreeDataGrid);\n this.model = new LayoutTreeDataGridModel(root, apiRequest);\n this.view = new LayoutTreeDataGridView(selector);\n this.controller = new LayoutTreeGridController(this.model, this.view, options);\n }\n _createClass(LayoutTreeDataGrid, [{\n key: \"init\",\n value: function init(targetContent, callback) {\n this.controller.init(targetContent, callback);\n }\n }]);\n return LayoutTreeDataGrid;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LayoutTreeDataGrid);\n\n//# sourceURL=webpack://APITestManager/./src/components/LayoutTreeDataGrid.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _EditableInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EditableInput */ \"./src/components/EditableInput.js\");\n/* harmony import */ var _APIClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../APIClient */ \"./src/APIClient.js\");\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\nvar LayoutTreeDataGridModel = /*#__PURE__*/function () {\n function LayoutTreeDataGridModel(root, apiRequest) {\n _classCallCheck(this, LayoutTreeDataGridModel);\n this.dataRoot = root;\n this.apiRequest = apiRequest;\n console.log('LayoutTreeDataGridModel', this.dataRoot);\n }\n _createClass(LayoutTreeDataGridModel, [{\n key: \"getNodePath\",\n value: function getNodePath(node, targetId) {\n var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n // Check if the current node is the target node\n if (node.id === targetId) {\n return path;\n }\n\n // If the current node has children, iterate over them\n if (node.children) {\n for (var i = 0; i < node.children.length; i++) {\n // Construct the path to the current child\n var currentPath = path ? \"\".concat(path, \".children[\").concat(i, \"]\") : \"children[\".concat(i, \"]\");\n\n // Recursively call findPath on the child\n var resultPath = this.getNodePath(node.children[i], targetId, currentPath);\n\n // If resultPath is not null, the target has been found in the subtree\n if (resultPath) {\n return resultPath;\n }\n }\n }\n\n // Return null if the target is not found in this subtree\n return null;\n }\n }]);\n return LayoutTreeDataGridModel;\n}();\nvar LayoutTreeDataGridView = /*#__PURE__*/function () {\n function LayoutTreeDataGridView(selector) {\n _classCallCheck(this, LayoutTreeDataGridView);\n console.log({\n selector: selector\n });\n this.table = $(' ').appendTo($(selector));\n this.table.addClass('layout_table');\n this.table.css({\n 'width': 'inherit',\n 'border-collapse': 'collapse',\n 'border': '1px gray solid'\n });\n console.log(this.table);\n }\n _createClass(LayoutTreeDataGridView, [{\n key: \"addHeaders\",\n value: function addHeaders(fields) {\n var thead = $('').appendTo(this.table);\n var tr = $('').appendTo(thead);\n tr.addClass('layout-grid-row');\n fields.forEach(function (field) {\n var th = $('| ').html(field.label).appendTo(tr);\n th.css({\n 'width': field.width + 'px',\n 'border': '1px gray solid',\n 'text-align': 'center'\n });\n });\n }\n }, {\n key: \"toggleChildrenVisibility\",\n value: function toggleChildrenVisibility(nodeId, isExpanded) {\n var _this = this;\n var selector = \".treegrid-parent-\".concat(nodeId);\n $(selector).each(function (_, el) {\n $(el).toggle(!isExpanded);\n if (isExpanded) {\n // If we are hiding the children\n var childNodeId = $(el).data('nodeId'); // Assume data-nodeId is set when rows are created\n _this.toggleChildrenVisibility(childNodeId, true); // Recursively hide all descendants\n var expander = $(\".treegrid-\".concat(nodeId, \" .treegrid-expander\"));\n expander.html(isExpanded ? '+' : '-');\n }\n });\n }\n }, {\n key: \"setupExpander\",\n value: function setupExpander(cell, callback) {\n var expander = $('').addClass('treegrid-expander').html('-').appendTo(cell);\n expander.click(callback);\n }\n }]);\n return LayoutTreeDataGridView;\n}();\nvar LayoutTreeGridController = /*#__PURE__*/function () {\n function LayoutTreeGridController(model, view, options, totalMessageLengthSelector) {\n _classCallCheck(this, LayoutTreeGridController);\n this.model = model;\n this.view = view;\n this.options = options;\n this.apiClient = new _APIClient__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this.totalMessageLengthSelector = totalMessageLengthSelector;\n }\n _createClass(LayoutTreeGridController, [{\n key: \"init\",\n value: function init(callback) {\n this.view.addHeaders(this.options);\n this.processNode(this.model.dataRoot, 0);\n this.setupEditableFields();\n this.callback = callback;\n }\n }, {\n key: \"rebuild\",\n value: function () {\n var _rebuild = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dataRoot) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n this.model.dataRoot = dataRoot;\n this.view.table.children().remove();\n this.view.addHeaders(this.options);\n this.processNode(this.model.dataRoot, 0);\n this.setupEditableFields();\n _context.t0 = this;\n _context.next = 8;\n return this.concatenateFieldValues(this.model.dataRoot);\n case 8:\n _context.t1 = _context.sent;\n _context.t0.callback.call(_context.t0, _context.t1);\n case 10:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function rebuild(_x) {\n return _rebuild.apply(this, arguments);\n }\n return rebuild;\n }()\n }, {\n key: \"getIndent\",\n value: function getIndent(depth) {\n return new Array(depth + 1).join('');\n }\n }, {\n key: \"fillPadding\",\n value: function () {\n var _fillPadding = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(value, dataLength) {\n var paddedValue;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this.apiClient.processPreScriptAndVariables(this.model.apiRequest, value.toString());\n case 2:\n paddedValue = _context2.sent;\n while (paddedValue.length < dataLength) {\n paddedValue = ' ' + paddedValue; // Prepend a space character to the string\n }\n return _context2.abrupt(\"return\", paddedValue);\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function fillPadding(_x2, _x3) {\n return _fillPadding.apply(this, arguments);\n }\n return fillPadding;\n }()\n }, {\n key: \"concatenateFieldValues\",\n value: function () {\n var _concatenateFieldValues = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(node) {\n var concatenatedValues, _iterator, _step, child;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n concatenatedValues = ''; // Process the current node if it is of type 'Field'\n if (!(node.loutItemType === 'Field')) {\n _context3.next = 9;\n break;\n }\n _context3.t0 = concatenatedValues;\n _context3.next = 5;\n return this.fillPadding(node.value, node.loutItemLength);\n case 5:\n _context3.t1 = _context3.sent;\n if (_context3.t1) {\n _context3.next = 8;\n break;\n }\n _context3.t1 = '';\n case 8:\n concatenatedValues = _context3.t0 += _context3.t1;\n case 9:\n if (!(node.children && node.children.length > 0)) {\n _context3.next = 29;\n break;\n }\n _iterator = _createForOfIteratorHelper(node.children);\n _context3.prev = 11;\n _iterator.s();\n case 13:\n if ((_step = _iterator.n()).done) {\n _context3.next = 21;\n break;\n }\n child = _step.value;\n _context3.t2 = concatenatedValues;\n _context3.next = 18;\n return this.concatenateFieldValues(child);\n case 18:\n concatenatedValues = _context3.t2 += _context3.sent;\n case 19:\n _context3.next = 13;\n break;\n case 21:\n _context3.next = 26;\n break;\n case 23:\n _context3.prev = 23;\n _context3.t3 = _context3[\"catch\"](11);\n _iterator.e(_context3.t3);\n case 26:\n _context3.prev = 26;\n _iterator.f();\n return _context3.finish(26);\n case 29:\n return _context3.abrupt(\"return\", concatenatedValues);\n case 30:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this, [[11, 23, 26, 29]]);\n }));\n function concatenateFieldValues(_x4) {\n return _concatenateFieldValues.apply(this, arguments);\n }\n return concatenateFieldValues;\n }()\n }, {\n key: \"sumFieldLoutItemLengths\",\n value: function sumFieldLoutItemLengths() {\n var queue = [this.model.dataRoot];\n var sum = 0;\n while (queue.length > 0) {\n var node = queue.shift();\n if (node.loutItemType === 'Field') {\n sum += parseInt(node.loutItemLength) || 0; // Add the loutItemLength of the node, or 0 if undefined\n }\n if (node.children && node.children.length > 0) {\n var _iterator2 = _createForOfIteratorHelper(node.children),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var child = _step2.value;\n queue.push(child);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n }\n return sum;\n }\n }, {\n key: \"setupEditableFields\",\n value: function setupEditableFields() {\n var _this2 = this;\n this.view.table.find('.editable').each(function (index, editableElement) {\n var editableInput = new _EditableInput__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n name: editableElement.dataset.name,\n value: editableElement.dataset.value,\n path: editableElement.dataset.path\n });\n editableInput.init(editableElement, /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(value) {\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n console.log(editableElement.dataset.path);\n console.log(value);\n _.set(_this2.model.dataRoot, editableElement.dataset.path, value);\n console.log(_this2.model.dataRoot);\n _context4.t0 = _this2;\n _context4.next = 7;\n return _this2.concatenateFieldValues(_this2.model.dataRoot);\n case 7:\n _context4.t1 = _context4.sent;\n _context4.t0.callback.call(_context4.t0, _context4.t1);\n case 9:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return function (_x5) {\n return _ref.apply(this, arguments);\n };\n }());\n });\n this.totalMessageLengthSelector.text(this.sumFieldLoutItemLengths());\n }\n }, {\n key: \"addCell\",\n value: function addCell(row, node, fieldInfo, depth) {\n var td = $(' | ').appendTo(row);\n var padding = fieldInfo.isFirst ? this.getIndent(depth) : '';\n var nodePath = this.model.getNodePath(this.model.dataRoot, node.id) + '.value';\n if (node.loutItemType === 'Field' && fieldInfo.type === 'textfield') {\n var div = $('');\n div.addClass('editable');\n div.appendTo(td);\n div.attr('data-name', fieldInfo.name);\n div.attr('data-value', node[fieldInfo.name]);\n div.attr('data-path', nodePath);\n } else {\n td.html(padding); // Default to just displaying the content\n }\n if (fieldInfo.width) {\n td.css({\n 'width': fieldInfo.width + 'px',\n 'border': '1px gray solid'\n });\n }\n if (fieldInfo.align) {\n td.css({\n 'text-align': fieldInfo.align\n });\n }\n return td;\n }\n }, {\n key: \"addRow\",\n value: function addRow(node, depth) {\n var tr = $(' ').addClass('treegrid-' + node.id).data('nodeId', node.id); // Storing node ID for easy access later\n\n if (depth === 0) {\n tr.css({\n 'display': 'none'\n });\n }\n if (node.parent) {\n var parentSelector = \".treegrid-\".concat(node.parent);\n var lastChildSelector = \".treegrid-parent-\".concat(node.parent);\n if ($(this.view.table).find(lastChildSelector).length > 0) {\n var lastChild = $(this.view.table).find(lastChildSelector).last();\n tr.insertAfter(lastChild);\n } else {\n tr.insertAfter($(this.view.table).find(parentSelector));\n }\n tr.addClass('treegrid-parent-' + node.parent);\n } else {\n tr.appendTo(this.view.table);\n }\n return tr;\n }\n\n //processNode in bfs\n }, {\n key: \"processNode\",\n value: function processNode(node, depth) {\n var _this3 = this;\n var queue = [{\n node: node,\n depth: depth\n }];\n var _loop = function _loop() {\n var _queue$shift = queue.shift(),\n node = _queue$shift.node,\n depth = _queue$shift.depth;\n var tr = _this3.addRow(node, depth);\n _this3.options.forEach(function (fieldInfo) {\n var content = node[fieldInfo.name];\n var td = _this3.addCell(tr, node, fieldInfo, depth);\n if (fieldInfo.isFirst) {\n if (node.children && node.children.length > 0) {\n _this3.view.setupExpander($(tr.children()[0]), function () {\n return _this3.handleExpanderClick(node.id);\n });\n }\n }\n if (fieldInfo.type !== 'textfield') {\n td.append(content);\n }\n });\n if (node.children && node.children.length > 0) {\n var _iterator3 = _createForOfIteratorHelper(node.children),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var child = _step3.value;\n queue.push({\n node: child,\n depth: depth + 1\n });\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n };\n while (queue.length > 0) {\n _loop();\n }\n }\n }, {\n key: \"handleExpanderClick\",\n value: function handleExpanderClick(nodeId) {\n var expander = $(\".treegrid-\".concat(nodeId, \" .treegrid-expander\"));\n var isExpanded = expander.html() === '-';\n expander.html(isExpanded ? '+' : '-');\n this.view.toggleChildrenVisibility(nodeId, isExpanded);\n }\n }]);\n return LayoutTreeGridController;\n}();\nvar LayoutTreeDataGrid = /*#__PURE__*/function () {\n function LayoutTreeDataGrid(selector, root, apiRequest, options, totalMessageLengthSelector) {\n _classCallCheck(this, LayoutTreeDataGrid);\n this.model = new LayoutTreeDataGridModel(root, apiRequest);\n this.view = new LayoutTreeDataGridView(selector);\n this.controller = new LayoutTreeGridController(this.model, this.view, options, totalMessageLengthSelector);\n }\n _createClass(LayoutTreeDataGrid, [{\n key: \"init\",\n value: function init(callback) {\n this.controller.init(callback);\n }\n }, {\n key: \"rebuild\",\n value: function rebuild(dataRoot) {\n this.controller.rebuild(dataRoot);\n }\n }]);\n return LayoutTreeDataGrid;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LayoutTreeDataGrid);\n\n//# sourceURL=webpack://APITestManager/./src/components/LayoutTreeDataGrid.js?");
/***/ }),
@@ -631,7 +631,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\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _EditableInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EditableInput */ \"./src/components/EditableInput.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LayoutTreeGridModel = /*#__PURE__*/_createClass(function LayoutTreeGridModel(root) {\n _classCallCheck(this, LayoutTreeGridModel);\n this.root = root;\n});\nvar LayoutTreeGridView = /*#__PURE__*/function () {\n function LayoutTreeGridView(selector) {\n _classCallCheck(this, LayoutTreeGridView);\n this.table = $('').appendTo($(selector));\n this.table.addClass('table');\n this.table.css({\n 'width': 'inherit',\n 'border-collapse': 'collapse',\n 'border': '1px gray solid'\n });\n }\n _createClass(LayoutTreeGridView, [{\n key: \"addHeaders\",\n value: function addHeaders(fields) {\n var thead = $('').appendTo(this.table);\n var tr = $('').appendTo(thead);\n tr.addClass('layout-grid-row');\n fields.forEach(function (field) {\n var th = $('| ').html(field.label).appendTo(tr);\n th.css({\n 'width': field.width + 'px',\n 'border': '1px gray solid',\n 'text-align': 'center'\n });\n });\n }\n }, {\n key: \"addRow\",\n value: function addRow(node, depth) {\n var tr = $(' | ').addClass('treegrid-' + node.id).data('nodeId', node.id); // Storing node ID for easy access later\n\n if (depth === 0) {\n tr.css({\n 'display': 'none'\n });\n }\n if (node.parent) {\n var parentSelector = \".treegrid-\".concat(node.parent);\n var lastChildSelector = \".treegrid-parent-\".concat(node.parent);\n if ($(lastChildSelector).length > 0) {\n var lastChild = $(lastChildSelector).last();\n tr.insertAfter(lastChild);\n } else {\n tr.insertAfter($(parentSelector));\n }\n tr.addClass('treegrid-parent-' + node.parent);\n } else {\n tr.appendTo(this.table);\n }\n return tr;\n }\n }, {\n key: \"getIndent\",\n value: function getIndent(depth) {\n return new Array(depth + 1).join('');\n }\n }, {\n key: \"addCell\",\n value: function addCell(row, node, fieldInfo, depth) {\n var td = $('').appendTo(row);\n var padding = fieldInfo.isFirst ? this.getIndent(depth) : '';\n if (fieldInfo.type === 'textfield') {\n var div = $('');\n div.addClass('editable');\n div.appendTo(td);\n div.attr('data-name', fieldInfo.name);\n div.attr('data-value', node[fieldInfo.name]);\n } else {\n td.html(padding); // Default to just displaying the content\n }\n if (fieldInfo.width) {\n td.css({\n 'width': fieldInfo.width + 'px',\n 'border': '1px gray solid'\n });\n }\n if (fieldInfo.align) {\n td.css({\n 'text-align': fieldInfo.align\n });\n }\n return td;\n }\n }, {\n key: \"toggleChildrenVisibility\",\n value: function toggleChildrenVisibility(nodeId, isExpanded) {\n var _this = this;\n var selector = \".treegrid-parent-\".concat(nodeId);\n $(selector).each(function (_, el) {\n $(el).toggle(!isExpanded);\n if (isExpanded) {\n // If we are hiding the children\n var childNodeId = $(el).data('nodeId'); // Assume data-nodeId is set when rows are created\n _this.toggleChildrenVisibility(childNodeId, true); // Recursively hide all descendants\n var expander = $(\".treegrid-\".concat(nodeId, \" .treegrid-expander\"));\n expander.html(isExpanded ? '+' : '-');\n }\n });\n }\n }, {\n key: \"setupExpander\",\n value: function setupExpander(cell, callback) {\n var expander = $(' ').addClass('treegrid-expander').html('-').appendTo(cell);\n expander.click(callback);\n }\n }]);\n return LayoutTreeGridView;\n}();\nvar LayoutTreeGridController = /*#__PURE__*/function () {\n function LayoutTreeGridController(model, view, options) {\n _classCallCheck(this, LayoutTreeGridController);\n this.model = model;\n this.view = view;\n this.options = options;\n this.init();\n }\n _createClass(LayoutTreeGridController, [{\n key: \"init\",\n value: function init() {\n this.view.addHeaders(this.options);\n this.processNode(this.model.root, 0);\n this.view.table.find('.editable').each(function (index, editableElement) {\n var editableInput = new _EditableInput__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n name: editableElement.dataset.name,\n value: editableElement.dataset.value\n });\n editableInput.init(editableElement, function (value) {\n console.log(value);\n });\n });\n }\n }, {\n key: \"processNode\",\n value: function processNode(node, depth) {\n var _this2 = this;\n var tr = this.view.addRow(node, depth);\n this.options.forEach(function (fieldInfo) {\n var content = node[fieldInfo.name];\n var td = _this2.view.addCell(tr, node, fieldInfo, depth);\n if (fieldInfo.isFirst) {\n if (node.children && node.children.length > 0) {\n _this2.view.setupExpander($(tr.children()[0]), function () {\n return _this2.handleExpanderClick(node.id);\n });\n }\n }\n if (fieldInfo.type !== 'textfield') {\n td.append(content);\n }\n });\n\n // Recursively process each child node if any\n if (node.children && node.children.length > 0) {\n node.children.forEach(function (child) {\n _this2.processNode(child, depth + 1); // Increment depth for each child\n });\n }\n }\n }, {\n key: \"handleExpanderClick\",\n value: function handleExpanderClick(nodeId) {\n var expander = $(\".treegrid-\".concat(nodeId, \" .treegrid-expander\"));\n var isExpanded = expander.html() === '-';\n expander.html(isExpanded ? '+' : '-');\n this.view.toggleChildrenVisibility(nodeId, isExpanded);\n }\n }]);\n return LayoutTreeGridController;\n}();\nvar LayoutTreeGrid = /*#__PURE__*/function () {\n function LayoutTreeGrid(selector, root, options) {\n _classCallCheck(this, LayoutTreeGrid);\n this.model = new LayoutTreeGridModel(root);\n this.view = new LayoutTreeGridView(selector);\n this.controller = new LayoutTreeGridController(this.model, this.view, options);\n }\n _createClass(LayoutTreeGrid, [{\n key: \"init\",\n value: function init(targetContent, callback) {\n this.controller.init(targetContent, callback);\n }\n }, {\n key: \"rebuild\",\n value: function rebuild(model) {\n console.log('Rebuilding LayoutValueGrid');\n console.log(model);\n }\n }]);\n return LayoutTreeGrid;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LayoutTreeGrid);\n\n//# sourceURL=webpack://APITestManager/./src/components/LayoutTreeGrid.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _EditableInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EditableInput */ \"./src/components/EditableInput.js\");\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\nvar LayoutTreeGridModel = /*#__PURE__*/function () {\n function LayoutTreeGridModel(root) {\n _classCallCheck(this, LayoutTreeGridModel);\n this.root = root;\n this.rootId = root.id;\n }\n _createClass(LayoutTreeGridModel, [{\n key: \"setRoot\",\n value: function setRoot(newRoot) {\n this.root = newRoot;\n }\n }, {\n key: \"getNodePath\",\n value: function getNodePath(node, targetId) {\n var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"\";\n // Check if the current node is the target node\n if (node.id === targetId) {\n return path;\n }\n\n // If the current node has children, iterate over them\n if (node.children) {\n for (var i = 0; i < node.children.length; i++) {\n // Construct the path to the current child\n var currentPath = path ? \"\".concat(path, \".children[\").concat(i, \"]\") : \"children[\".concat(i, \"]\");\n\n // Recursively call findPath on the child\n var resultPath = this.getNodePath(node.children[i], targetId, currentPath);\n\n // If resultPath is not null, the target has been found in the subtree\n if (resultPath) {\n return resultPath;\n }\n }\n }\n\n // Return null if the target is not found in this subtree\n return null;\n }\n }]);\n return LayoutTreeGridModel;\n}();\nvar LayoutTreeGridView = /*#__PURE__*/function () {\n function LayoutTreeGridView(selector) {\n _classCallCheck(this, LayoutTreeGridView);\n this.selector = selector;\n this.table = $('').appendTo($(this.selector));\n this.table.addClass('layout_table');\n this.table.css({\n 'width': 'inherit',\n 'border-collapse': 'collapse',\n 'border': '1px gray solid'\n });\n this.init();\n }\n _createClass(LayoutTreeGridView, [{\n key: \"init\",\n value: function init() {\n this.table.children().remove();\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.init();\n }\n }, {\n key: \"addHeaders\",\n value: function addHeaders(fields) {\n var thead = $('').appendTo(this.table);\n var tr = $('').appendTo(thead);\n tr.addClass('layout-grid-row');\n fields.forEach(function (field) {\n var th = $('').html(field.label).appendTo(tr);\n th.css({\n 'width': field.width + 'px',\n 'border': '1px gray solid',\n 'text-align': 'center'\n });\n });\n }\n }, {\n key: \"toggleChildrenVisibility\",\n value: function toggleChildrenVisibility(nodeId, isExpanded) {\n var _this = this;\n var selector = \".treegrid-parent-\".concat(nodeId);\n $(selector).each(function (_, el) {\n $(el).toggle(!isExpanded);\n if (isExpanded) {\n // If we are hiding the children\n var childNodeId = $(el).data('nodeId'); // Assume data-nodeId is set when rows are created\n _this.toggleChildrenVisibility(childNodeId, true); // Recursively hide all descendants\n var expander = $(\".treegrid-\".concat(nodeId, \" .treegrid-expander\"));\n expander.html(isExpanded ? '+' : '-');\n }\n });\n }\n }, {\n key: \"setupExpander\",\n value: function setupExpander(cell, callback) {\n var expander = $('').addClass('treegrid-expander').html('-').appendTo(cell);\n expander.click(callback);\n }\n }]);\n return LayoutTreeGridView;\n}();\nvar LayoutTreeGridController = /*#__PURE__*/function () {\n function LayoutTreeGridController(model, view, options, callback) {\n _classCallCheck(this, LayoutTreeGridController);\n this.model = model;\n this.view = view;\n this.options = options;\n this.callback = callback;\n this.init();\n }\n _createClass(LayoutTreeGridController, [{\n key: \"init\",\n value: function init() {\n var _this2 = this;\n this.view.addHeaders(this.options);\n this.processNode(this.model.root, 0);\n this.view.table.find('.editable').each(function (index, editableElement) {\n var editableInput = new _EditableInput__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n name: editableElement.dataset.name,\n value: editableElement.dataset.value,\n path: editableElement.dataset.path\n });\n editableInput.init(editableElement, /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _.set(_this2.model.root, editableElement.dataset.path, value);\n _this2.callback(_this2.model.root);\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n });\n }\n }, {\n key: \"getIndent\",\n value: function getIndent(depth) {\n return new Array(depth + 1).join('');\n }\n }, {\n key: \"addRow\",\n value: function addRow(node, depth) {\n var tr = $('').addClass('treegrid-' + node.id).data('nodeId', node.id); // Storing node ID for easy access later\n\n if (depth === 0) {\n tr.css({\n 'display': 'none'\n });\n }\n if (node.parent || node.parent !== null && parseInt(node.parent) !== this.model.rootId) {\n var parentSelector = \".treegrid-\".concat(node.parent);\n var lastChildSelector = \".treegrid-parent-\".concat(node.parent);\n if ($(this.view.table).find(lastChildSelector).length > 0) {\n var lastChild = $(this.view.table).find(lastChildSelector).last();\n console.log('lastChild: ', lastChild);\n tr.insertAfter(lastChild);\n } else {\n console.log('parentSelector: ', parentSelector);\n tr.insertAfter($(this.view.table).find(parentSelector));\n }\n tr.addClass('treegrid-parent-' + node.parent);\n } else {\n console.log('no parent');\n tr.appendTo(this.view.table);\n }\n console.log('addRow, node: ', node.id, ' parent: ', node.parent);\n console.log('addRow tr: ', tr);\n return tr;\n }\n }, {\n key: \"addCell\",\n value: function addCell(row, node, fieldInfo, depth) {\n var td = $('').appendTo(row);\n var padding = fieldInfo.isFirst ? this.getIndent(depth) : '';\n var nodePath = this.model.getNodePath(this.model.root, node.id) + \".value\";\n if (node.loutItemType === 'Field' && fieldInfo.type === 'textfield') {\n var div = $('');\n div.addClass('editable');\n div.appendTo(td);\n div.attr('data-name', fieldInfo.name);\n div.attr('data-value', node[fieldInfo.name]);\n div.attr('data-path', nodePath);\n } else {\n td.html(padding); // Default to just displaying the content\n }\n if (fieldInfo.width) {\n td.css({\n 'width': fieldInfo.width + 'px',\n 'border': '1px gray solid'\n });\n }\n if (fieldInfo.align) {\n td.css({\n 'text-align': fieldInfo.align\n });\n }\n return td;\n }\n }, {\n key: \"processNode\",\n value: function processNode(node, depth) {\n var _this3 = this;\n console.log('node: ', node.id);\n var tr = this.addRow(node, depth);\n this.options.forEach(function (fieldInfo) {\n var content = node[fieldInfo.name];\n var td = _this3.addCell(tr, node, fieldInfo, depth);\n if (fieldInfo.isFirst) {\n if (node.children && node.children.length > 0) {\n _this3.view.setupExpander($(tr.children()[0]), function () {\n return _this3.handleExpanderClick(node.id);\n });\n }\n }\n if (fieldInfo.type !== 'textfield') {\n td.append(content);\n }\n });\n\n // Recursively process each child node if any\n if (node.children && node.children.length > 0) {\n node.children.forEach(function (child) {\n _this3.processNode(child, depth + 1); // Increment depth for each child\n });\n }\n }\n }, {\n key: \"handleExpanderClick\",\n value: function handleExpanderClick(nodeId) {\n var expander = $(\".treegrid-\".concat(nodeId, \" .treegrid-expander\"));\n var isExpanded = expander.html() === '-';\n expander.html(isExpanded ? '+' : '-');\n this.view.toggleChildrenVisibility(nodeId, isExpanded);\n }\n }, {\n key: \"rebuild\",\n value: function rebuild(newRoot) {\n this.model.setRoot(newRoot);\n this.view.clear();\n this.init();\n }\n }]);\n return LayoutTreeGridController;\n}();\nvar LayoutTreeGrid = /*#__PURE__*/function () {\n function LayoutTreeGrid(selector, root, options, callback) {\n _classCallCheck(this, LayoutTreeGrid);\n this.model = new LayoutTreeGridModel(root);\n this.view = new LayoutTreeGridView(selector);\n this.controller = new LayoutTreeGridController(this.model, this.view, options, callback);\n }\n _createClass(LayoutTreeGrid, [{\n key: \"rebuild\",\n value: function rebuild(root, callback) {\n this.controller.rebuild(root);\n callback(root);\n }\n }]);\n return LayoutTreeGrid;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LayoutTreeGrid);\n\n//# sourceURL=webpack://APITestManager/./src/components/LayoutTreeGrid.js?");
/***/ }),
@@ -708,7 +708,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\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _LayoutGrid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./LayoutGrid */ \"./src/components/LayoutGrid.js\");\n/* harmony import */ var _LayoutTreeGrid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LayoutTreeGrid */ \"./src/components/LayoutTreeGrid.js\");\n/* harmony import */ var _LayoutTreeDataGrid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LayoutTreeDataGrid */ \"./src/components/LayoutTreeDataGrid.js\");\n/* harmony import */ var monaco_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! monaco-editor */ \"include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.main.js\");\n/* harmony import */ var _ApiLayoutItemTreeBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ApiLayoutItemTreeBuilder */ \"./src/components/ApiLayoutItemTreeBuilder.js\");\n/* harmony import */ var _ApiLayoutItemTreeDataBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ApiLayoutItemTreeDataBuilder */ \"./src/components/ApiLayoutItemTreeDataBuilder.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\nvar TCPClientView = /*#__PURE__*/function () {\n function TCPClientView(parent, serverManager, apiRequestTabContent, model, index) {\n _classCallCheck(this, TCPClientView);\n this.parent = parent;\n this.serverManager = serverManager;\n this.apiRequestTabContent = apiRequestTabContent;\n this.model = model;\n this.index = index;\n this.server = this.serverManager.getServer(this.model.server);\n }\n _createClass(TCPClientView, [{\n key: \"init\",\n value: function init() {\n var _this = this;\n console.log('TCPClientView init');\n this.apiRequestTabContent.append(this.tcpApiRequestTemplate(this.model, this.index));\n if (this.server && this.server.headers === undefined) {\n this.server.headers = [];\n }\n if (this.server) {\n this.serverManager.renderTcpServerOptions('.server_options', this.server.serverOptions, this.model.headers, this.parent);\n }\n var layoutJson = JSON.stringify(this.model.layout, null, 2);\n this.layoutJsonEditor = monaco_editor__WEBPACK_IMPORTED_MODULE_3__.editor.create(this.apiRequestTabContent.find(\"#api_request_\".concat(this.model.id)).find('.layout-json')[0], {\n value: layoutJson,\n language: 'json',\n automaticLayout: true,\n quickSuggestions: false\n });\n var layoutTreeOptions = [{\n name: 'loutItemSerno',\n width: 100,\n isFirst: true,\n label: '#'\n }, {\n name: 'loutItemName',\n width: 100,\n align: 'center',\n label: '항목명(영문)'\n }, {\n name: 'loutItemDesc',\n width: 100,\n align: 'center',\n label: '항목설명'\n }, {\n name: 'loutItemDepth',\n width: 60,\n align: 'center',\n label: '깊이'\n }, {\n name: 'loutItemType',\n width: 100,\n align: 'center',\n label: '아이템 유형'\n }, {\n name: 'loutItemOccCnt',\n width: 100,\n align: 'center',\n label: '반복 횟수'\n }, {\n name: 'loutItemOccRef',\n width: 120,\n align: 'center',\n label: '반복 참조 필드'\n }, {\n name: 'loutItemLength',\n width: 100,\n align: 'center',\n label: '데이터 길이'\n }];\n var layoutDataTreeOptions = [{\n name: 'loutItemSerno',\n width: 100,\n isFirst: true,\n label: '#'\n }, {\n name: 'loutItemName',\n width: 100,\n align: 'center',\n label: '항목명(영문)'\n }, {\n name: 'loutItemDesc',\n width: 100,\n align: 'center',\n label: '항목설명'\n }, {\n name: 'loutItemDepth',\n width: 60,\n align: 'center',\n label: '깊이'\n }, {\n name: 'loutItemType',\n width: 100,\n align: 'center',\n label: '아이템 유형'\n }, {\n name: 'loutItemOccCnt',\n width: 100,\n align: 'center',\n label: '반복 횟수'\n }, {\n name: 'loutItemOccRef',\n width: 120,\n align: 'center',\n label: '반복 참조 필드'\n }, {\n name: 'loutItemLength',\n width: 100,\n align: 'center',\n label: '데이터 길이'\n }, {\n name: 'value',\n width: 200,\n align: 'left',\n label: '값',\n type: 'textfield'\n }];\n var layoutRoot = _ApiLayoutItemTreeBuilder__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createTree(this.model.layout.layoutItems);\n var replicator = new _ApiLayoutItemTreeDataBuilder__WEBPACK_IMPORTED_MODULE_5__[\"default\"](10000);\n var layoutDataRoot = replicator.createReplicatedTree(layoutRoot);\n var layoutTreeDataGrid = new _LayoutTreeDataGrid__WEBPACK_IMPORTED_MODULE_2__[\"default\"]('.request_layout_data_tree', layoutDataRoot, this.model, layoutDataTreeOptions);\n layoutTreeDataGrid.init(this.apiRequestTabContent, /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(finalMessage) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _this.requestBodyEditor.setValue(finalMessage);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n var layoutTreeGrid = new _LayoutTreeGrid__WEBPACK_IMPORTED_MODULE_1__[\"default\"]('.request_layout_tree', layoutRoot, layoutDataTreeOptions);\n var layoutGrid = new _LayoutGrid__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this.model.layout);\n layoutGrid.init(this.apiRequestTabContent, function (model) {\n // layoutValueGrid.rebuild(model);\n $('span.variable').off('mouseover');\n $('span.variable').off('mouseout');\n document.querySelectorAll('span.variable').forEach(function (element) {\n var text = element.innerText;\n element.addEventListener('mouseover', function () {\n return _this.parent.showPopper(element, text);\n });\n element.addEventListener('mouseout', function () {\n return _this.parent.hidePopper(element);\n });\n });\n });\n window.addEventListener('resize', this.resizeEditor.bind(this));\n }\n }, {\n key: \"resizeEditor\",\n value: function resizeEditor() {\n this.requestBodyEditor.layout({\n width: 0\n });\n this.requestBodyEditor.layout({});\n this.layoutJsonEditor.layout({\n width: 0\n });\n this.layoutJsonEditor.layout({});\n }\n }, {\n key: \"tcpApiRequestTemplate\",\n value: function tcpApiRequestTemplate(apiRequest, index) {\n console.log('tcpApiRequestTemplate');\n return \"\\n \\n \").concat(apiRequest.collectionName, \" > \").concat(apiRequest.name, \" \\n \\n \\n \").concat(this.serverManager.renderTcpServers(apiRequest.server), \"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n - \\n \\n
\\n - \\n \\n
\\n - \\n \\n
\\n - \\n \\n
\\n - \\n \\n
\\n - \\n \\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\uC804\\uCCB4 \\uBA54\\uC2DC\\uC9C0 \\uAE38\\uC774: \\n \\n \\n \\n \\n \\n \\n Response\\n \\n \\n \\n \\n - \\n \\n
\\n - \\n \\n
\\n \\n \\n \\n \\n \\n \\n \");\n }\n }]);\n return TCPClientView;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TCPClientView);\n\n//# sourceURL=webpack://APITestManager/./src/components/TCPClientView.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _LayoutGrid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./LayoutGrid */ \"./src/components/LayoutGrid.js\");\n/* harmony import */ var _LayoutTreeGrid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LayoutTreeGrid */ \"./src/components/LayoutTreeGrid.js\");\n/* harmony import */ var _LayoutTreeDataGrid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LayoutTreeDataGrid */ \"./src/components/LayoutTreeDataGrid.js\");\n/* harmony import */ var monaco_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! monaco-editor */ \"include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.main.js\");\n/* harmony import */ var _ApiLayoutItemTreeBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ApiLayoutItemTreeBuilder */ \"./src/components/ApiLayoutItemTreeBuilder.js\");\n/* harmony import */ var _ApiLayoutItemTreeDataBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ApiLayoutItemTreeDataBuilder */ \"./src/components/ApiLayoutItemTreeDataBuilder.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\nvar TCPClientView = /*#__PURE__*/function () {\n function TCPClientView(parent, serverManager, apiRequestTabContent, model, index) {\n _classCallCheck(this, TCPClientView);\n this.parent = parent;\n this.serverManager = serverManager;\n this.apiRequestTabContent = apiRequestTabContent;\n this.model = model;\n this.index = index;\n this.server = this.serverManager.getServer(this.model.server);\n }\n _createClass(TCPClientView, [{\n key: \"init\",\n value: function init() {\n var _this = this;\n console.log('TCPClientView init');\n this.apiRequestTabContent.append(this.tcpApiRequestTemplate(this.model, this.index));\n if (this.server && this.server.headers === undefined) {\n this.server.headers = [];\n }\n if (this.server) {\n this.serverManager.renderTcpServerOptions('.server_options', this.server.serverOptions, this.model.headers, this.parent);\n }\n var layoutJson = JSON.stringify(this.model.layout, null, 2);\n this.layoutJsonEditor = monaco_editor__WEBPACK_IMPORTED_MODULE_3__.editor.create(this.apiRequestTabContent.find(\"#api_request_\".concat(this.model.id)).find('.layout-json')[0], {\n value: layoutJson,\n language: 'json',\n automaticLayout: true,\n quickSuggestions: false\n });\n var layoutDataTreeOptions = [{\n name: 'loutItemSerno',\n width: 100,\n isFirst: true,\n label: '#'\n }, {\n name: 'loutItemName',\n width: 100,\n align: 'center',\n label: '항목명(영문)'\n }, {\n name: 'loutItemDesc',\n width: 100,\n align: 'center',\n label: '항목설명'\n }, {\n name: 'loutItemDepth',\n width: 60,\n align: 'center',\n label: '깊이'\n }, {\n name: 'loutItemType',\n width: 100,\n align: 'center',\n label: '아이템 유형'\n }, {\n name: 'loutItemOccCnt',\n width: 100,\n align: 'center',\n label: '반복 횟수'\n }, {\n name: 'loutItemOccRef',\n width: 120,\n align: 'center',\n label: '반복 참조 필드'\n }, {\n name: 'loutItemLength',\n width: 100,\n align: 'center',\n label: '데이터 길이'\n }, {\n name: 'value',\n width: 200,\n align: 'left',\n label: '값',\n type: 'textfield'\n }];\n var layoutRoot = _ApiLayoutItemTreeBuilder__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createTree(this.model.layout.layoutItems);\n var replicator = new _ApiLayoutItemTreeDataBuilder__WEBPACK_IMPORTED_MODULE_5__[\"default\"](10000);\n var layoutDataRoot = replicator.createReplicatedTree(layoutRoot);\n console.log(this.apiRequestTabContent.find(\"#api_request_\".concat(this.model.id)).find('.request_layout_data_tree'));\n console.log(this.apiRequestTabContent.find(\"#api_request_\".concat(this.model.id)).find('.request_layout_tree'));\n console.log(this.apiRequestTabContent.find(\"#api_request_\".concat(this.model.id)).find('.total_message_length'));\n var layoutTreeDataGrid = new _LayoutTreeDataGrid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.apiRequestTabContent.find(\"#api_request_\".concat(this.model.id)).find('.request_layout_data_tree'), layoutDataRoot, this.model, layoutDataTreeOptions, this.apiRequestTabContent.find(\"#api_request_\".concat(this.model.id)).find('.total_message_length'));\n layoutTreeDataGrid.init( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(finalMessage) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _this.requestBodyEditor.setValue(finalMessage);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n var layoutTreeGrid = new _LayoutTreeGrid__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this.apiRequestTabContent.find(\"#api_request_\".concat(this.model.id)).find('.request_layout_tree'), layoutRoot, layoutDataTreeOptions, function (root) {\n var replicator = new _ApiLayoutItemTreeDataBuilder__WEBPACK_IMPORTED_MODULE_5__[\"default\"](10000);\n var layoutDataRoot = replicator.createReplicatedTree(root);\n layoutTreeDataGrid.rebuild(layoutDataRoot);\n });\n var layoutGrid = new _LayoutGrid__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this.model.layout);\n layoutGrid.init(this.apiRequestTabContent.find(\"#api_request_\".concat(this.model.id)), function (model) {\n model.items.forEach(function (item) {\n item.children = [];\n });\n var updatedRoot = _ApiLayoutItemTreeBuilder__WEBPACK_IMPORTED_MODULE_4__[\"default\"].createTree(model.items);\n layoutTreeGrid.rebuild(updatedRoot, function (root) {\n var replicator = new _ApiLayoutItemTreeDataBuilder__WEBPACK_IMPORTED_MODULE_5__[\"default\"](10000);\n var layoutDataRoot = replicator.createReplicatedTree(root);\n layoutTreeDataGrid.rebuild(layoutDataRoot);\n });\n $('span.variable').off('mouseover');\n $('span.variable').off('mouseout');\n document.querySelectorAll('span.variable').forEach(function (element) {\n var text = element.innerText;\n element.addEventListener('mouseover', function () {\n return _this.parent.showPopper(element, text);\n });\n element.addEventListener('mouseout', function () {\n return _this.parent.hidePopper(element);\n });\n });\n });\n window.addEventListener('resize', this.resizeEditor.bind(this));\n }\n }, {\n key: \"resizeEditor\",\n value: function resizeEditor() {\n this.requestBodyEditor.layout({\n width: 0\n });\n this.requestBodyEditor.layout({});\n this.layoutJsonEditor.layout({\n width: 0\n });\n this.layoutJsonEditor.layout({});\n }\n }, {\n key: \"tcpApiRequestTemplate\",\n value: function tcpApiRequestTemplate(apiRequest, index) {\n console.log('tcpApiRequestTemplate');\n return \"\\n \\n \").concat(apiRequest.collectionName, \" > \").concat(apiRequest.name, \" \\n \\n \\n \").concat(this.serverManager.renderTcpServers(apiRequest.server), \"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n - \\n \\n
\\n - \\n \\n
\\n - \\n \\n
\\n - \\n \\n
\\n - \\n \\n
\\n - \\n \\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\uC804\\uCCB4 \\uBA54\\uC2DC\\uC9C0 \\uAE38\\uC774: \\n \\n \\n \\n \\n \\n \\n Response\\n \\n \\n \\n \\n - \\n \\n
\\n - \\n \\n
\\n \\n \\n \\n \\n \\n \\n \");\n }\n }]);\n return TCPClientView;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TCPClientView);\n\n//# sourceURL=webpack://APITestManager/./src/components/TCPClientView.js?");
/***/ }),
| | | | |