From d68701a0dc3cd718cace162918c1648a8c2c4b35 Mon Sep 17 00:00:00 2001 From: joewdavies Date: Fri, 29 Nov 2024 18:04:50 +0100 Subject: [PATCH] migrate EUR demo to gridviz V3 --- .prettierrc | 2 +- dist/gridviz.js | 4 +- dist/gridviz.min.js | 2 +- examples/demos/EUR.html | 1022 ++++++++++++++++++-------------------- examples/demos/demos.css | 67 +++ package.json | 2 +- src/core/Map.js | 2 +- src/utils/utils.js | 2 +- 8 files changed, 567 insertions(+), 536 deletions(-) create mode 100644 examples/demos/demos.css diff --git a/.prettierrc b/.prettierrc index 8055f893b..fa3dd8ea7 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,7 +3,7 @@ "tabWidth": 4, "semi": false, "singleQuote": true, - "printWidth": 110, + "printWidth": 120, "bracketSpacing": true, "bracketSameLine": false } diff --git a/dist/gridviz.js b/dist/gridviz.js index f22caab03..3d6c614ef 100644 --- a/dist/gridviz.js +++ b/dist/gridviz.js @@ -8241,7 +8241,7 @@ class Map { * @type {HTMLCanvasElement|null} */ this.canvasSave = null - this.selectionRectangleColor = opts.selectionRectangleColor || 'red' + this.selectionRectangleColor = opts.selectionRectangleColor || '#FF6347' this.selectionRectangleWidthPix = opts.selectionRectangleWidthPix || (() => 4) //(r,z) => {} // transparent background (e.g. leaflet) 'red painting' fix @@ -16166,4 +16166,4 @@ const getParameterByName = _core_GeoCanvas_js__WEBPACK_IMPORTED_MODULE_1__.GeoCa /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JpZHZpei5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDO0FBQ0QsTzs7Ozs7Ozs7Ozs7Ozs7QUNWZTtBQUNmO0FBQ0E7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQ0Z1QztBQUNGO0FBQ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ICAgICAgICAgIHV5MCArIHQgKiBkeSxcbiAgICAgICAgICB3MCAqIE1hdGguZXhwKHJobyAqIHQgKiBTKVxuICAgICAgICBdO1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIEdlbmVyYWwgY2FzZS5cbiAgICBlbHNlIHtcbiAgICAgIHZhciBkMSA9IE1hdGguc3FydChkMiksXG4gICAgICAgICAgYjAgPSAodzEgKiB3MSAtIHcwICogdzAgKyByaG80ICogZDIpIC8gKDIgKiB3MCAqIHJobzIgKiBkMSksXG4gICAgICAgICAgYjEgPSAodzEgKiB3MSAtIHcwICogdzAgLSByaG80ICogZDIpIC8gKDIgKiB3MSAqIHJobzIgKiBkMSksXG4gICAgICAgICAgcjAgPSBNYXRoLmxvZyhNYXRoLnNxcnQoYjAgKiBiMCArIDEpIC0gYjApLFxuICAgICAgICAgIHIxID0gTWF0aC5sb2coTWF0aC5zcXJ0KGIxICogYjEgKyAxKSAtIGIxKTtcbiAgICAgIFMgPSAocjEgLSByMCkgLyByaG87XG4gICAgICBpID0gZnVuY3Rpb24odCkge1xuICAgICAgICB2YXIgcyA9IHQgKiBTLFxuICAgICAgICAgICAgY29zaHIwID0gY29zaChyMCksXG4gICAgICAgICAgICB1ID0gdzAgLyAocmhvMiAqIGQxKSAqIChjb3NocjAgKiB0YW5oKHJobyAqIHMgKyByMCkgLSBzaW5oKHIwKSk7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgdXgwICsgdSAqIGR4LFxuICAgICAgICAgIHV5MCArIHUgKiBkeSxcbiAgICAgICAgICB3MCAqIGNvc2hyMCAvIGNvc2gocmhvICogcyArIHIwKVxuICAgICAgICBdO1xuICAgICAgfVxuICAgIH1cblxuICAgIGkuZHVyYXRpb24gPSBTICogMTAwMCAqIHJobyAvIE1hdGguU1FSVDI7XG5cbiAgICByZXR1cm4gaTtcbiAgfVxuXG4gIHpvb20ucmhvID0gZnVuY3Rpb24oXykge1xuICAgIHZhciBfMSA9IE1hdGgubWF4KDFlL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ic3RhcnRcIik7XG4gICAgICB9XG4gICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuICAgIHpvb206IGZ1bmN0aW9uKGtleSwgdHJhbnNmb3JtKSB7XG4gICAgICBpZiAodGhpcy5tb3VzZSAmJiBrZXkgIT09IFwibW91c2VcIikgdGhpcy5tb3VzZVsxXSA9IHRyYW5zZm9ybS5pbnZlcnQodGhpcy5tb3VzZVswXSk7XG4gICAgICBpZiAodGhpcy50b3VjaDAgJiYga2V5ICE9PSBcInRvdWNoXCIpIHRoaXMudG91Y2gwWzFdID0gdHJhbnNmb3JtLmludmVydCh0aGlzLnRvdWNoMFswXSk7XG4gICAgICBpZiAodGhpcy50b3VjaDEgJiYga2V5ICE9PSBcInRvdWNoXCIpIHRoaXMudG91Y2gxWzFdID0gdHJhbnNmb3JtLmludmVydCh0aGlzLnRvdWNoMVswXSk7XG4gICAgICB0aGlzLnRoYXQuX196b29tID0gdHJhbnNmb3JtO1xuICAgICAgdGhpcy5lbWl0KFwiem9vbVwiKTtcbiAgICAgIHJldHVybiB0aGlzO1xuICAgIH0sXG4gICAgZW5kOiBmdW5jdGlvbigpIHtcbiAgICAgIGlmICgtLXRoaXMuYWN0aXZlID09PSAwKSB7XG4gICAgICAgIGRlbGV0ZSB0aGlzLnRoYXQuX196b29taW5nO1xuICAgICAgICB0aGlzLmVtaXQoXCJlbmRcIik7XG4gICAgICB9XG4gICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuICAgIGVtaXQ6IGZ1bmN0aW9uKHR5cGUpIHtcbiAgICAgIHZhciBkID0gc2VsZWN0KHRoaXMudGhhdCkuZGF0dW0oKTtcbiAgICAgIGxpc3RlbmVycy5jYWxsKFxuICAgICAgICB0eXBlLFxuICAgICAgICB0aGlzLnRoYXQsXG4gICAgICAgIG5ldyBab29tRXZlbnQodHlwZSwge1xuICAgICAgICAgIHNvdXJjZUV2ZW50OiB0aGlzLnNvdXJjZUV2ZW50LFxuICAgICAgICAgIHRhcmdldDogem9vb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WFwLndcblxuICAgICAgICAvLyBldmVudCBoYW5kbGVyXG4gICAgICAgIHRoaXMuZGl2Lm9uKCdjbGljaycsIChlKSA9PiB7XG4gICAgICAgICAgICB0aGlzLm9uQ2xpY2tGdW5jdGlvbihlKVxuICAgICAgICB9KVxuICAgICAgICB0aGlzLmRpdi5vbignbW91c2VvdmVyJywgKGUpID0+IHtcbiAgICAgICAgICAgIHRoaXMuc3R5bGUoJ2JhY2tncm91bmQtY29sb3InLCAnbGlnaHRncmV5JylcbiAgICAgICAgfSlcbiAgICAgICAgdGhpcy5kaXYub24oJ21vdXNlb3V0JywgKGUpID0+IHtcbiAgICAgICAgICAgIHRoaXMuc3R5bGUoJ2JhY2tncm91bmQtY29sb3InLCAnI2ZmZmZmZicpXG4gICAgICAgIH0pXG5cbiAgICAgICAgLy9zZXQgcG9zaXRpb25cbiAgICAgICAgaWYgKG9wdHMueCkge1xuICAgICAgICAgICAgdGhpcy5zdHlsZSgnbGVmdCcsIG9wdHMueCArICdweCcpXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnN0eWxlKCdyaWdodCcsICcxMHB4JylcbiAgICAgICAgfVxuICAgICAgICBpZiAob3B0cy55KSB7XG4gICAgICAgICAgICB0aGlzLnN0eWxlKCd0b3AnLCBvcHRzLnkgKyAncHgnKVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5zdHlsZSgndG9wJywgJzkwcHgnKVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgb25DbGlja0Z1bmN0aW9uKGUpIHtcbiAgICAgICAgaWYgKHRoaXMuaXNGdWxsc2NyZWVuKSB7XG4gICAgICAgICAgICB0aGlzLmNsb3NlRnVsbHNjcmVlbih0aGlzLm1hcC5jb250YWluZXIpXG4gICAgICAgICAgICAvL3Jlc2l6ZSBjYW52YXMgdG8gZGVmYXVsdFxuICAgICAgICAgICAgdGhpcy5tYXAuaCA9IHRoaXMuZGVmYXVsdEhlaWdodFxuICAgIC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yXG4gICAgICogQHBhcmFtIHtPYmplY3R9IG9wdHNcclxuICAgICAqL1xyXG4gICAgY29uc3RydWN0b3Iob3B0cykge1xyXG4gICAgICAgIHN1cGVyKG9wdHMpO1xyXG4gICAgXHJcbiAgICAgICAgdGhpcy5vblpvb20gPSBvcHRzLm9uWm9vbTsgLy8gY3VzdG9tIHVzZXIgZXZlbnQgaGFuZGxlclxyXG4gICAgICAgIHRoaXMuZGVsdGEgPSBvcHRzLmRlbHRhIHx8IDAuMjtcclxuICAgIFxyXG4gICAgICAgIC8vIENyZWF0ZSB6b29tIGluIGJ1dHRvblxyXG4gICAgICAgIHRoaXMuem9vbUluQnRuID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYScpO1xyXG4gICAgICAgIHRoaXMuem9vbUluQnRuLmlkID0gJ3pvb20taW4nO1xyXG4gICAgICAgIHRoaXMuem9vbUluQnRuLmNsYXNzTmFtZSA9ICdncmlkdml6LXpvb20tYnV0dG9uJztcclxuICAgICAgICB0aGlzLnpvb21JbkJ0bi50aXRsZSA9ICdab29tIGluJztcclxuICAgICAgICB0aGlzLnpvb21JbkJ0bi50ZXh0Q29udGVudCA9ICcrJztcclxuICAgICAgICB0aGlzLnpvb21JbkJ0bi5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsIChlKSA9PiB7XHJcbiAgICAgICAgICAgIHRoaXMuem9vbUluKGUpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIHRoaXMuem9vbUluQnRuLmFkZEV2ZW50TGlzdGVuZXIoJ21vdXNlb3ZlcicsICgpID0+IHtcclxuICAgICAgICAgICAgdGhpcy56b29tSW5CdG4uc3R5bGUuYmFja2dyb3VuZENvbG9yID0gJ2xpZ2h0Z3JleSc7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgdGhpcy56b29tSW5CdG4uYWRkRXZlbnRMaXN0ZW5lcignbW91c2VvdXQnLCAoKSA9PiB7XHJcbiAgICAgICAgICAgIHRoaXMuem9vbUluQnRuLnN0eWxlLmJhY2tncm91bmRDb2xvciA9ICcjZmZmZmZmJztcclxuICAgICAgICB9KTtcclxuICAgIFxyXG4gICAgICAgIC8vIENyZWF0ZSB6b29tIG91dCBidXR0b25cclxuICAgICAgICB0aGlzLnpvb21PdXRCdG4gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdhJyk7XHJcbiAgICAgICAgdGhpcy56b29tT3V0QnRuLmlkID0gJ3pvb20tb3V0JztcclxuICAgICAgICB0aGlzLnpvb21PdXRCdG4uY2xhc3NOYW1lID0gJ2dyaWR2aXotem9vbS1idXR0b24nO1xyXG4gICAgICAgIHRoaXMuem9vbU91dEJ0bi50aXRsZSA9ICdab29tIG91dCc7XHJcbiAgICAgICAgdGhpcy56b29tT3V0QnRuLnRleHRDb250ZW50ID0gJy0nO1xyXG4gICAgICAgIHRoaXMuem9vbU91dEJ0bi5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsIChlKSA9PiB7XHJcbiAgICAgICAgICAgIHRoaXMuem9vbU91dChlKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLnpvb21PdXRCdG4uYWRkRXZlbnRMaXN0ZW5lcignbW91c2VvdmVyJywgKCkgPT4ge1xyXG4gICAgICAgICAgICB0aGlzLnpvb21PdXRCdG4uc3R5bGUuYmFja2dyb3VuZENvbG9yID0gJ2xpZ2h0Z3JleSc7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgdGhpcy56b29tT3V0QnRuLmFkZEV2ZW50TGlzdGVuZXIoJ21vdXNlb3V0JywgKCkgPT4ge1xyXG4gICAgICAgICAgICB0aGlzLnpvb21PdXRCdG4uc3R5bGUuYmFja2dyb3VuZENvbG9yID0gJyNmZmZmZmYnO1xyXG4gICAgICAgIH0pO1xyXG4gICAgXHJcbiAgICAgICAgLy8gU2V0IGNvbW1vbiBzdHlsZXMgZm9yIGJ1dHRvbnNcclxuICAgICAgICBjb25zdCBidXR0b25zID0gW3RoaXMuem9vbUluQnRuLCB0aGlzLnpvb21PdXRCdG5dO1xyXG4gICAgICAgIGJ1dHRvbnMuZm9yRWFjaCgoYnRuLCBpbmRleCkgPT4ge1xyXG4gICAgICAgICAgICBidG4uc3R5bGUuYWxpZ25JdGVtcyA9ICdjZW50ZXInO1xyXG4gICAgICAgICAgICBidG4uc3R5bGUuanVzdGlmeUNvbnRlbnQgPSAnY2VudGVyJztcclxuICAgICAgICAgICAgYnRuLnN0eWxlLmRpc3BsYXkgPSAnZmxleCc7XHJcbiAgICAgICAgICAgIGJ0bi5zdHlsZS5ib3JkZXIgPSAnbm9uZSc7XHJcbiAgICAgICAgICAgIGJ0bi5zdHlsZS5jb2xvciA9ICdibGFjayc7XHJcbiAgICAgICAgICAgIGJ0bi5zdHlsZS50ZXh0QWxpZ24gPSAnY2VudGVyJztcclxuICAgICAgICAgICAgYnRuLnN0eWxlLnRleHREZWNvcmF0aW9uID0gJ25vbmUnO1xyXG4gICAgICAgICAgICBidG4uc3R5bGUucGFkZGluZyA9ICc0cHgnO1xyXG4gICAgICAgICAgICBidG4uc3R5bGUuZm9udFNpemUgPSAnMjBweCc7XHJcbiAgICAgICAgICAgIGJ0bi5zdHlsZS5mb250V2VpZ2h0ID0gJ2JvbGQnO1xyXG4gICAgICAgICAgICBidG4uc3R5bGUudXNlclNlbGVjdCA9ICdub25lJztcclxuICAgICAgICAgICAgYnRuLnN0eWxlLmJhY2tncm91bmRDb2xvciA9ICcjZmZmZmZmJztcclxuICAgICAgICAgICAgaWYgKGluZGV4ID09PSAwKSBidG4uc3R5bGUuYm9yZGVyQm90dG9tID0gJzFweCBzb2xpZCBncmV5JzsgLy8gWm9vbSBpbiBidXR0b24gb25seVxyXG4gICAgICAgIH0pO1xyXG4gICAgXHJcbiAgICAgICAgLy8gVW5zZXQgcGFyZW50IGNsYXNzIGhlaWdodCBhbmQgZGlzcGxheSBmb3IgZHVhbCBidXR0b25zXHJcbiAgICAgICAgdGhpcy5zdHlsZSgnaGVpZ2h0JywgJ3Vuc2V0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b29yKHBvc0dlby55IC8gcilcclxuXHJcbiAgICAgICAgLyovZ2V0IGNlbGxcclxuICAgICAgICBmb3IgKGNvbnN0IGNlbGwgb2YgY2VsbHMpIHtcclxuICAgICAgICAgICAgaWYgKGNlbGwueCAhPSBjZWxsWCkgY29udGludWVcclxuICAgICAgICAgICAgaWYgKGNlbGwueSAhPSBjZWxsWSkgY29udGludWVcclxuICAgICAgICAgICAgcmV0dXJuIGNlbGxcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHVuZGVmaW5lZCovXHJcblxyXG4gICAgICAgIC8vcmFyZSBjYXNlIG9mIG1peGVkIHJlc29sdXRpb24gZGF0YXNldFxyXG4gICAgICAgIGlmICh0aGlzLm1peGVkUmVzb2x1dGlvbikge1xyXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGMgb2YgY2VsbHMpIHtcclxuICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfSAqL1xyXG4gICAgICAgICAgICAgICAgY29uc3QgciA9ICt0aGlzLm1peGVkUmVzb2x1dGlvbihjKVxyXG4gICAgICAgICAgICAgICAgaWYgKHBvc0dlby54IDwgYy54KSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoYy54ICsgciA8IHBvc0dlby54KSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAocG9zR2VvLnkgPCBjLnkpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChjLnkgKyByIDwgcG9zR2VvLnkpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICBlbHNlIHJldHVybiBjXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZFxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9jb21tb24gY2FzZVxyXG5cclxuICAgICAgICAvKiogQHR5cGUge251bWJlcn0gKi9cclxuICAgICAgICBjb25zdCByID0gdGhpcy5nZX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hTiwgeE1heDogTmFOLCB5TWluOiBOYU4sIHlNYXg6IE5hTiB9XHJcbiAgICAgICAgdGhpcy51cGRhdGVFeHRlbnRHZW8oKVxyXG5cclxuICAgICAgICAvL3JlbHkgb24gZDMgem9vbSBmb3IgcGFuL3pvb21cclxuICAgICAgICBpZiAoIW9wdHMuZGlzYWJsZVpvb20pIHtcclxuICAgICAgICAgICAgbGV0IHRQID0gem9vbUlkZW50aXR5XHJcbiAgICAgICAgICAgIGNvbnN0IHogPSBkM3pvb20oKVxyXG4gICAgICAgICAgICAgICAgLy90byBtYWtlIHRoZSB6b29taW5nIGEgYml0IGZhc3RlclxyXG4gICAgICAgICAgICAgICAgLndoZWVsRGVsdGEoKGUpID0+IC1lLmRlbHRhWSAqIChlLmRlbHRhTW9kZSA9PT0gMSA/IDAuMDcgOiBlLmRlbHRhTW9kZSA/IDEgOiAwLjAwNCkpXHJcbiAgICAgICAgICAgICAgICAub24oJ3pvb20nLCAoZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHQgPSBlLnRyYW5zZm9ybVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGYgPSB0UC5rIC8gdC5rXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYgPT0gMSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3BhblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBkeCA9IHRQLnggLSB0LnhcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZHkgPSB0UC55IC0gdC55XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuKGR4ICogdGhpcy52aWV3LnosIC1keSAqIHRoaXMudmlldy56KVxyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlID0gZS5zb3VyY2VFdmVudFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2UgaW5zdGFuY2VvZiBXaGVlbEV2ZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3pvb20gYXQgdGhlIG1vdXNlIHBvc2l0aW9uXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnpvb20oXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBpeFRvR2VvWChlLnNvdXJjZUV2ZW50Lm9mZnNldFgpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGl4VG9HZW9ZKGUuc291cmNlRXZlbnQub2Zmc2V0WSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzZSBpbnN0YW5jZW9mIFRvdWNoRXZlbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2UudGFyZ2V0VG91Y2hlcy5sZW5ndGgpIHJldHVyblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9waW5jaCB6b29tXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvbXB1dGUgYXZlcmFnZSBwb3NpdGlvbiBvZiB0aGUgdG91Y2hlc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHR4ID0gMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eSA9IDBcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IHR0IG9mIHNlLnRhcmdldFRvdWNoZXMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eCArPSB0dC5jbGllbnRYXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHkgKz0gdHQuY2xpZW50WVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHggLz0gc2UudGFyZ2V0VG91Y2hlcy5sZW5ndGhcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5IC89IHNlLnRhcmdldFRvdWNoZXMubGVuZ3RoXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3pvb20gYXQgdGhpcyBhdmVyYWdlIHBvc2l0aW9uXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnpvb20oZiwgdGhpcy5waXhUb0dlb1godHgpLCB0aGlzLnBpeFRvR2VvWSh0eSkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgdFAgPSB0XHJcblxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLm9uWm9vbUZ1bikgdGhpcy5vblpvb21GdW4oZSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ3N0YXJ0JywgKGUpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBzdGFydCBvZiB6b29tIGV2ZW50XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gc2F2ZSB0aGUgY3VycmVudCBjYW52YXMgc3RhdGUgdG8ga2VlcCBvbnNjcmVlbiBkdXJpbmcgcGFuL3pvb20gYmVmb3JlIHJlZHJhd2luZ1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY2FudmFzU2F2ZS5jID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJylcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUuYy5zZXRBdHRyaWJ1dGUoJ3dpZHRoJywgJycgKyB0aGlzLncpXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jYW52YXNTYXZlLmMuc2V0QXR0cmlidXRlKCdoZWlnaHQnLCAnJyArIHRoaXMuaClcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUuYy5nZXRDb250ZXh0KCcyZCcpPy5kcmF3SW1hZ2UodGhpcy5jYW52YXMsIDAsIDApXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jYW52YXNTYXZlLmR4ID0gMFxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY2FudmFzU2F2ZS5keSA9IDBcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUuZiA9IDFcclxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5vblpvb21TdGFydEZ1bikgdGhpcy5vblpvb21TdGFydEZ1bihlKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5vbignZW5kJywgKGUpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBlbmQgb2Ygem9vbSBldmVudFxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVkcmF3KClcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUgPSB7IGM6IG51bGwsIGR4OiAwLCBkeTogMCwgZjogMSB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLm9uWm9vbUVuZEZ1bikgdGhpcy5vblpvb21FbmRGdW4oZSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIHooc2VsZWN0KHRoaXMuY2FudmFzKSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vY2VudGVyIGV4dGVudFxyXG4gICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfHVuZGVmaW5lZH0gKi9cclxuICAgICAgICB0aGlzLnhNaW4gPSBvcHRzLmNlbnRlckV4dGVudCA/IG9wdHMuY2VudGVyRXh0ZW50WzBdIDogdW5kZWZpbmVkXHJcbiAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgIHRoaXMueU1pbiA9IG9wdHMuY2VudGVyRXh0ZW50ID8gb3B0cy5jZW50ZXJFeH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ueFxyXG4gICAgICAgIGlmICh0aGlzLnlNaW4gIT0gdW5kZWZpbmVkICYmIHRoaXMudmlldy55ICsgZHlHZW8gPCB0aGlzLnlNaW4pIGR5R2VvID0gdGhpcy55TWluIC0gdGhpcy52aWV3LnlcclxuICAgICAgICBpZiAodGhpcy54TWF4ICE9IHVuZGVmaW5lZCAmJiB0aGlzLnZpZXcueCArIGR4R2VvID4gdGhpcy54TWF4KSBkeEdlbyA9IHRoaXMueE1heCAtIHRoaXMudmlldy54XHJcbiAgICAgICAgaWYgKHRoaXMueU1heCAhPSB1bmRlZmluZWQgJiYgdGhpcy52aWV3LnkgKyBkeUdlbyA+IHRoaXMueU1heCkgZHlHZW8gPSB0aGlzLnlNYXggLSB0aGlzLnZpZXcueVxyXG5cclxuICAgICAgICAvL3BhblxyXG4gICAgICAgIHRoaXMudmlldy54ICs9IGR4R2VvXHJcbiAgICAgICAgdGhpcy52aWV3LnkgKz0gZHlHZW9cclxuICAgICAgICB0aGlzLnVwZGF0ZUV4dGVudEdlbygpXHJcblxyXG4gICAgICAgIGlmICh0aGlzLmNhbnZhc1NhdmUuYykge1xyXG4gICAgICAgICAgICBjb25zdCBzY2FsZSA9IDEgLyB0aGlzLnZpZXcuelxyXG5cclxuICAgICAgICAgICAgLy8gVXBkYXRlIHNhdmVkIGNhbnZhcyBvZmZzZXRcclxuICAgICAgICAgICAgdGhpcy5jYW52YXNTYXZlLmR4IC09IGR4R2VvICogc2NhbGVcclxuICAgICAgICAgICAgdGhpcy5jYW52YXNTYXZlLmR5ICs9IGR5R2VvICogc2NhbGVcclxuXHJcbiAgICAgICAgICAgIC8vIGNsZWFyIGNhbnZhc1xyXG4gICAgICAgICAgICB0aGlzLmNsZWFyKHRoaXMuYmFja2dyb3VuZENvbG9yKVxyXG5cclxuICAgICAgICAgICAgLy8gdGhpcyBkb2VzbnQgd29yayBvbiBtb2JpbGUgaHR0cHM6Ly9naXRodWIuY29tL2V1cm9zdGF0L2dyaWR2aXovaXNzdWVz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dlbyA9IHRoaXMudmlldy55KSB7XHJcbiAgICAgICAgLy9UT0RPIGZvcmNlIGdlbyBleHRlbmQgdG8gcmVtYWluXHJcblxyXG4gICAgICAgIC8vdHJ5aW5nIHRvIHpvb20gaW4vb3V0IGJleW9uZCBsaW1pdFxyXG4gICAgICAgIGlmICh0aGlzLnpvb21FeHRlbnRbMF0gPT0gdGhpcy52aWV3LnogJiYgZiA8PSAxKSByZXR1cm5cclxuICAgICAgICBpZiAodGhpcy56b29tRXh0ZW50WzFdID09IHRoaXMudmlldy56ICYmIGYgPj0gMSkgcmV0dXJuXHJcblxyXG4gICAgICAgIC8vZW5zdXJlIHpvb20gZXh0ZW50IHByZXNlcnZlZFxyXG4gICAgICAgIGNvbnN0IG5ld1pmID0gZiAqIHRoaXMudmlldy56XHJcbiAgICAgICAgaWYgKG5ld1pmIDwgdGhpcy56b29tRXh0ZW50WzBdKSBmID0gdGhpcy56b29tRXh0ZW50WzBdIC8gdGhpcy52aWV3LnpcclxuICAgICAgICBpZiAobmV3WmYgPiB0aGlzLnpvb21FeHRlbnRbMV0pIGYgPSB0aGlzLnpvb21FeHRlbnRbMV0gLyB0aGlzLnZpZXcuelxyXG5cclxuICAgICAgICB0aGlzLnZpZXcueiAqPSBmXHJcblxyXG4gICAgICAgIC8vY29tcHV0ZSBwYW5cclxuICAgICAgICBsZXQgZHhHZW8gPSAoeEdlbyAtIHRoaXMudmlldy54KSAqICgxIC0gZilcclxuICAgICAgICBsZXQgZHlHZW8gPSAoeUdlbyAtIHRoaXMudmlldy55KSAqICgxIC0gZilcclxuXHJcbiAgICAgICAgLy9lbnN1cmVzIHgveSBleHRlbnRcclxuICAgICAgICBpZiAodGhpcy54TWluICE9IHVuZGVmaW5lZCAmJiB0aGlzLnZpZXcueCArIGR4R2VvIDwgdGhpcy54TWluKSBkeEdlbyA9IHRoaXMueE1pbiAtIHRoaXMudmlldy54XHJcbiAgICAgICAgaWYgKHRoaXMueU1pbiAhPSB1bmRlZmluZWQgJiYgdGhpcy52aWV3LnkgKyBkeUdlbyA8IHRoaXMueU1pbikgZHlHZW8gPSB0aGlzLnlNaW4gLSB0aGlzLnZpZXcueVxyXG4gICAgICAgIGlmICh0aGlzLnhNYXggIT0gdW5kZWZpbmVkICYmIHRoaXMudmlldy54ICsgZHhHZW8gPiB0aGlzLnhNYXgpIGR4R2VvID0gdGhpcy54TWF4IC0gdGhpcy52aWV3LnhcclxuICAgICAgICBpZiAodGhpcy55TWF4ICE9IHVuZGVmaW5lZCAmJiB0aGlzLnZpZXcueSArIGR5R2VvID4gdGhpcy55TWF4KSBkeUdlbyA9IHRoaXMueU1heCAtIHRoaXMudmlldy55XHJcblxyXG4gICAgICAgIC8vcGFuXHJcbiAgICAgICAgdGhpcy52aWV3LnggKz0gZHhHZW9cclxuICAgICAgICB0aGlzLnZpZXcueSArPSBkeUdlb1xyXG4gICAgICAgIHRoaXMudXBkYXRlRXh0ZW50R2VvKClcclxuXHJcbiAgICAgICAgLy8gem9vbSBpbiBvbiB0aGUgY3VycmVudCBjYW52YXMgc3RhdGVcclxuICAgICAgICBpZiAodGhpcy5jYW52YXNTYXZlLmMpIHtcclxuICAgICAgICAgICAgdGhpcy5jbGVhcih0aGlzLmJhY2tncm91bmRDb2xvcilcclxuICAgICAgICAgICAgdGhpcy5jYW52YXNTYXZlLmYgLz0gZlxyXG4gICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUuZHggPSB0aGlzLmdlb1RvUGl4WCh4R2VvKSAqICgxIC0gdGhpcy5jYW52YXNTYXZlLmYpXHJcbiAgICAgICAgICAgIHRoaXMuY2FudmFzU2F2ZS5keSA9IHRoaXMuZ2VvVG9QaXhZKHlHZW8pICogKDEgLSB0aGlzLmNhbnZhc1NhdmUuZilcclxuICAgICAgICAgICAgdGhpcy5vZmZzY3JlZW5DdHguZHJhd0ltYWdlKFxyXG4gICAgICAgICAgICAgICAgdGhpcy5jYW52YXNTYXZlLmMsXHJcbiAgICAgICAgICAgICAgICB0aGlzLmN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IHhNaW46IHRoaXMucGl4VG9HZW9YKC1tYXJnaW5QeCksXHJcbiAgICAgICAgICAgIHhNYXg6IHRoaXMucGl4VG9HZW9YKHRoaXMudyArIG1hcmdpblB4KSxcclxuICAgICAgICAgICAgeU1pbjogdGhpcy5waXhUb0dlb1kodGhpcy5oICsgbWFyZ2luUHgpLFxyXG4gICAgICAgICAgICB5TWF4OiB0aGlzLnBpeFRvR2VvWSgtbWFyZ2luUHgpLFxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdGhpcy5leHRHZW9cclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIENoZWNrIGlmIHRoZSBvYmplY3QgaGFzIHRvIGJlIGRyYXduXHJcbiAgICAgKlxyXG4gICAgICogQHBhcmFtIHt7eDpudW1iZXIseTpudW1iZXJ9fSBvYmpcclxuICAgICAqL1xyXG4gICAgdG9EcmF3KG9iaikge1xyXG4gICAgICAgIGlmIChvYmoueCA8IHRoaXMuZXh0R2VvLnhNaW4pIHJldHVybiBmYWxzZVxyXG4gICAgICAgIGlmIChvYmoueCA+IHRoaXMuZXh0R2VvLnhNYXgpIHJldHVybiBmYWxzZVxyXG4gICAgICAgIGlmIChvYmoueSA8IHRoaXMuZXh0R2VvLnlNaW4pIHJldHVybiBmYWxzZVxyXG4gICAgICAgIGlmIChvYmoueSA+IHRoaXMuZXh0R2VvLnlNYXgpIHJldHVybiBmYWxzZVxyXG4gICAgICAgIHJldHVybiB0cnVlXHJcbiAgICB9XHJcblxyXG4gICAgLy9jb252ZXJzaW9uIGZ1bmN0aW9uc1xyXG4gICAgLyoqXHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0geEdlbyBHZW8geCBjb29yZGluYXRlLCBpbiBtLlxyXG4gICAgICogQHJldHVybnMge251bWJlcn0gU2NyZWVuIHggY29vcmRpbmF0ZSwgaW4gcGl4LlxyXG4gICAgICovXHJcbiAgICBnZW9Ub1BpeFgoeEdlbykge1xyXG4gICAgICAgIHJldHVybiAoeEdlbyAtIHRoaXMudmlldy54KSAvIHRoaXMudmlldy56ICsgdGhpcy53ICogMC41XHJcbiAgICB9XHJcbiAgICAvKipcclxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSB5R2VvIEdlbyB5IGNvb3JkaW5hdGUsIGluIG0uXHJcbiAgICAgKiBAcmV0dXJucyB7bnVtYmVyfSBTY3JlZW4geSBjb29yZGluYXRlLCBpbiBwaXguXHJcbiAgICAgKi9cclxuICAgIGdlb1RvUGl4WSh5R2VvKSB7XHJcbiAgICAgICAgcmV0dXJuIC0oeUdlbyAtIHRoaXMudmlldy55KSAvIHRoaXMudmlldy56ICsgdGhpcy5oICogMC41XHJcbiAgICB9XHJcbiAgICAvKipcclxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSB4IFNjcmVlbiB4IGNvb3JkaW5hdGUsIGluIHBpeC5cclxuICAgICAqIEByZXR1cm5zIHtudW1iZXJ9IEdlbyB4IGNvb3JkaW5hdGUsIGluIG0uXHJcbiAgICAgKi9cclxuICAgIHBpeFRvR2VvWCh4KSB7XHJcbiAgICAgICAgcmV0dXJuICh4IC0gdGhpcy53ICogMC41KSAqIHRoaXMudmlldy56ICsgdGhpcy52aWV3LnhcclxuICAgIH1cclxuICAgIC8qKlxyXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IHkgU2NyZWVuIHkgY29vcmRpbmF0ZSwgaW4gcGl4LlxyXG4gICAgICogQHJldHVybnMge251bWJlcn0gR2VvIHkgY29vcmRpbmF0ZSwgaW4gbS5cclxuICAgICAqL1xyXG4gICAgcGl4VG9HZW9ZKHkpIHtcclxuICAgICAgICByZXR1cm4gLSh5IC0gdGhpcy5oICogMC41KSAqIHRoaXMudmlldy56ICsgdGhpcy52aWV3LnlcclxuICAgIH1cclxuXHJcbiAgICAvKiogR2V0IHgseSx6IGVsZW1lbnRzIGZyb20gVVJMIGFuZCBhc3NpZ24gdGhlbSB0byB0aGUgdmlldy4gKi9cclxuICAgIHNldFZpZXdGcm9tVVJMKCkge1xyXG4gICAgICAgIGNvbnN0IHggPSBHZW9DYW52YXMuZ2V0UGFyYW1ldGVyQnlOYW1lKCd4JyksXHJcbiAgICAgICAgICAgIHkgPSBHZW9DYW52YXMuZ2V0UGFyYW1ldGVyQnlOYW1lKCd5JyksXHJcbiAgICAgICAgICAgIHogPSBHZW9DYW52YXMuZ2V0UGFyYW1ldGVyQnlOYW1lKCd6JylcclxuICAgICAgICBpZiAoeCAhPSBudWxsICYmIHggIT0gdW5kZWZpbmVkICYmICFpc05hTigreCkpIHRoaXMudmlldy54ID0gK3hcclxuICAgICAgICBpZiAoeSAhPSBudWxsICYmIHkgIT0gdW5kZWZpbmVkICYmICFpc05hTigreSkpIHRoaXMudmlldy55ID0gK3lcclxuICAgICAgICBpZiAoeiAhPSBudWxsICYmIHogIT0gdW5kZWZpbmVkICYmICFpc05hTigreikpIHRoaXMudmlldy56ID0gK3pcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEdldCBhIFVSTCBwYXJhbWV0ZXIgYnkgbmFtZS5cclxuICAgICAqXHJcbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZVxyXG4gICAgICogQHJldHVybnMge3N0cmluZyB8IG51bGx9XHJcbiAgICAgKi9cclxuICAgIHN0YXRpYyBnZXRQYXJhbWV0ZXJCeU5hbWUobmFtZSkge1xyXG4gICAgICAgIG5hbWUgPSBuYW1lLnJlcGxhY2UoL1tcXFtdLywgJ1xcXFxbJykucmVwbGFjZSgvW1xcXV0vLCAnXFxcXF0nKVxyXG4gICAgICAgIHZhciByZWdleCA9IG5ldyBSZWdFeHAoJ1tcXFxcPyZdJyArIG5hbWUgKyAnPShbXiYjXSopJyksXHJcbiAgICAgICAgICAgIHJlc3VsdHMgPSByZWdleC5leGVjKGxvY2F0aW9uLnNlYXJjaClcclxuICAgICAgICByZXR1cm4gIXJlc3VsdHMgPyBudWxsIDogZGVjb2RlVVJJQ29tcG9uZW50KHJlc3VsdHNbMV0ucmVwb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RoaXMubGFiZWxGb3JtYXQgPSBvcHRzLmxhYmVsRm9ybWF0XHJcbiAgICB9XHJcblxyXG4gICAgbWFrZVRpdGxlKCkge1xyXG4gICAgICAgIGlmICghdGhpcy50aXRsZSkgcmV0dXJuXHJcbiAgICAgICAgdGhpcy5kaXZcclxuICAgICAgICAgICAgLmFwcGVuZCgnZGl2JylcclxuICAgICAgICAgICAgLnN0eWxlKCdmb250LXNpemUnLCB0aGlzLnRpdGxlRm9udFNpemUpXHJcbiAgICAgICAgICAgIC5zdHlsZSgnZm9udC13ZWlnaHQnLCB0aGlzLnRpdGxlRm9udFdlaWdodClcclxuICAgICAgICAgICAgLnN0eWxlKCdtYXJnaW4tYm90dG9tJywgJzdweCcpXHJcbiAgICAgICAgICAgIC50ZXh0KHRoaXMudGl0bGUpXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBBcHBseSBhIHN0eWxlIHRvIHRoZSBsZWdlbmQgZGl2LlxyXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IGtcclxuICAgICAqIEBwYXJhbSB7c3RyaW5nfSB2XHJcbiAgICAgKiBAcmV0dXJucyB7dGhpc3xzdHJpbmd9XHJcbiAgICAgKi9cclxuICAgIHN0eWxlKGssIHYpIHtcclxuICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PSAxKSByZXR1cm4gdGhpcy5kaXYuc3R5bGUoaylcclxuICAgICAgICB0aGlzLmRpdi5zdHlsZShrLCB2KVxyXG4gICAgICAgIHJldHVybiB0aGlzXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gb3B0c1xyXG4gICAgICogQGFic3RyYWN0XHJcbiAgICAgKi9cclxuICAgIHVwZGF0ZShvcHRzID0ge30pIHtcclxuICAgICAgICBjb25zb2xlLmVycm9yKCdMZWdlbmQgdXBkYXRlIG5vdCBpbXBsZW1lbnRlZCB5ZXQuJylcclxuICAgIH1cclxufVxyXG4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GlhbGl6ZSBHZW9DYW52YXNcclxuICAgICAgICAgKiBAdHlwZSB7R2VvQ2FudmFzfVxyXG4gICAgICAgICAqIEBwcml2YXRlICovXHJcbiAgICAgICAgdGhpcy5nZW9DYW52YXMgPSBuZXcgR2VvQ2FudmFzKHRoaXMuX2NhbnZhcywgb3B0cy54LCBvcHRzLnksIG9wdHMueiwgb3B0cylcclxuXHJcbiAgICAgICAgdGhpcy5nZW9DYW52YXMucmVkcmF3ID0gKCkgPT4ge1xyXG4gICAgICAgICAgICB0aGlzLnJlZHJhdygpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBsZWdlbmQgZGl2XHJcbiAgICAgICAgdGhpcy5sZWdlbmREaXZJZCA9IG9wdHMubGVnZW5kRGl2SWQgfHwgJ2d2aXpMZWdlbmQnXHJcbiAgICAgICAgdGhpcy5sZWdlbmQgPSBzZWxlY3QoJyMnICsgdGhpcy5sZWdlbmREaXZJZClcclxuICAgICAgICBpZiAodGhpcy5sZWdlbmQuZW1wdHkoKSkgdGhpcy5pbml0aWFsaXNlTGVnZW5kKClcclxuXHJcbiAgICAgICAgLy90b29sdGlwXHJcblxyXG4gICAgICAgIC8vIHNldCBBcHAgY29udGFpbmVyIGFzIGRlZmF1bHQgcGFyZW50IGVsZW1lbnQgZm9yIHRvb2x0aXBcclxuICAgICAgICBpZiAoIW9wdHMudG9vbHRpcCkgb3B0cy50b29sdGlwID0ge31cclxuICAgICAgICBpZiAoIW9wdHMudG9vbHRpcC5wYXJlbnRFbGVtZW50KSBvcHRzLnRvb2x0aXAucGFyZW50RWxlbWVudCA9IHRoaXMuY29udGFpbmVyXHJcblxyXG4gICAgICAgIC8qKlxyXG4gICAgICAgICAqIEBwcml2YXRlXHJcbiAgICAgICAgICogQHR5cGUge1Rvb2x0aXB9ICovXHJcbiAgICAgICAgdGhpcy50b29sdGlwID0gbmV3IFRvb2x0aXAob3B0cy50b29sdGlwKVxyXG5cclxuICAgICAgICAvLyBhZGQgZXZlbn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gJ0hlbHZldGljYSwgQXJpYWwsIHNhbnMtc2VyaWYnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ2JvdHRvbScsICcxNXB4JylcclxuICAgICAgICAgICAgLnN0eWxlKCdyaWdodCcsICcxNXB4JylcclxuICAgICAgICAvL2hpZGVcclxuICAgICAgICAvLy5zdHlsZShcInZpc2liaWxpdHlcIiwgXCJoaWRkZW5cIilcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIFNldC9nZXQgbGF5ZXIgc3RhY2suXHJcbiAgICAgKlxyXG4gICAgICogQHBhcmFtIHt1bmRlZmluZWR8aW1wb3J0KFwiLi9MYXllci5qc1wiKS5MYXllcnxpbXBvcnQoXCIuL0xheWVyLmpzXCIpLkxheWVyW119IGxheWVyc1xyXG4gICAgICogQHJldHVybnMgeyB0aGlzIHwgaW1wb3J0KFwiLi9MYXllci5qc1wiKS5MYXllcltdIH1cclxuICAgICAqL1xyXG4gICAgbGF5ZXJzXyhsYXllcnMpIHtcclxuICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PT0gMCkgcmV0dXJuIHRoaXMubGF5ZXJzXHJcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT09IDEpXHJcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGxheWVycykpIHRoaXMubGF5ZXJzID0gbGF5ZXJzXHJcbiAgICAgICAgICAgIGVsc2UgdGhpcy5sYXllcnMgPSBbbGF5ZXJzXVxyXG4gICAgICAgIGVsc2UgdGhpcy5sYXllcnMgPSBhcmd1bWVudHNcclxuICAgICAgICByZXR1cm4gdGhpc1xyXG4gICAgfVxyXG5cclxuICAgIC8qKiBAcmV0dXJucyB7dGhpc30gKi9cclxuICAgIHJlZHJhdygpIHtcclxuICAgICAgICAvL3JlbW92ZSBsZWdlbmQgZWxlbWVudHNcclxuICAgICAgICBpZiAodGhpcy5sZWdlbmQpIHRoaXMubGVnZW5kLnNlbGVjdEFsbCgnKicpLnJlbW92ZSgpXHJcblxyXG4gICAgICAgIC8vY2xlYXJcclxuICAgICAgICB0aGlzLmdlb0NhbnZhcy5pbml0Q2FudmFzVHJhbnNmb3JtKClcclxuICAgICAgICB0aGlzLmdlb0NhbnZhcy5jbGVhcih0aGlzLmdlb0NhbnZhcy5iYWNrZ3JvdW5kQ29sb3IpXHJcblxyXG4gICAgICAgIGNvbnN0IHogPSB0aGlzLmdlb0NhbnZhcy52aWV3LnpcclxuICAgICAgICB0aGlzLnVwZGF0ZUV4dGVudEdlbygpXHJcblxyXG4gICAgICAgIC8vZ28gdGhyb3VnaCB0aGUgbGF5ZXJzXHJcbiAgICAgICAgZm9yIChjb25zdCBsYXllciBvZiB0aGlzLmxheWVycykge1xyXG4gICAgICAgICAgICAvL2NoZWNrIGlmIGxheWVyIGlzIHZpc2libGVcclxuICAgICAgICAgICAgaWYgKGxheWVyLnZpc2libGUgJiYgIWxheWVyLnZpc2libGUoeikpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL3NldCBsYXllciBhbHBoYSBhbmQgYmxlbmQgbW9kZVxyXG4gICAgICAgICAgICB0aGlzLmdlb0NhbnZhcy5vZmZzY3JlZW5DdHguZ2xvYmFsQWxwaGEgPSBsYXllci5hbHBoYSA/IGxheWVyLmFscGhhKHopIDogMS4wXHJcbiAgICAgICAgICAgIGlmIChsYXllci5ibGVuZE9wZXJhdGlvbilcclxuICAgICAgICAgICAgICAgIHRoaXMuZ2VvQ2FudmFzLm9mZnNjcmVlbkN0eC5nbG9iYWxDb21wb3NpdGVPcGVyYXRpb24gPSBsYXllci5ibGVuZE9wZXJhdGlvbih6KVxyXG5cclxuICAgICAgICAgICAgLy9zZXQgYWZmaW4gdHJhbnNmb3JtIHRvIGRyYXcgd2l0aCBnZW9ncmFwaGljYWwgY29vcmRpbmF0ZXNcclxuICAgICAgICAgICAgdGhpcy5nZW9DYW52YXMuc2V0Q2FudmFzVHJhbnNmb3JtKClcclxuXHJcbiAgICAgICAg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iZXIseTpudW1iZXJ9fSBwb3NHZW9cclxuICAgICAqIEByZXR1cm5zIHt7Y2VsbDppbXBvcnQoJy4vRGF0YXNldC5qcycpLkNlbGwsaHRtbDpzdHJpbmcscmVzb2x1dGlvbjpudW1iZXJ9IHwgdW5kZWZpbmVkfVxyXG4gICAgICogQHByb3RlY3RlZFxyXG4gICAgICovXHJcbiAgICBnZXRDZWxsRm9jdXNJbmZvKHBvc0dlbykge1xyXG4gICAgICAgIC8vZ28gdGhyb3VnaCB0aGUgbGF5ZXJzLCBzdGFydGluZyBmcm9tIHRvcFxyXG4gICAgICAgIGNvbnN0IHogPSB0aGlzLmdlb0NhbnZhcy52aWV3LnpcclxuICAgICAgICBmb3IgKGxldCBpID0gdGhpcy5sYXllcnMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcclxuICAgICAgICAgICAgLyoqIEB0eXBlIHtpbXBvcnQoXCIuL0xheWVyLmpzXCIpLkxheWVyfSAqL1xyXG4gICAgICAgICAgICBjb25zdCBsYXllciA9IHRoaXMubGF5ZXJzW2ldXHJcbiAgICAgICAgICAgIGlmIChsYXllci52aXNpYmxlICYmICFsYXllci52aXNpYmxlKHopKSBjb250aW51ZVxyXG4gICAgICAgICAgICBpZiAoIWxheWVyLmNlbGxJbmZvSFRNTCkgY29udGludWVcclxuICAgICAgICAgICAgLy9pZiAobGF5ZXIuY2VsbEluZm9IVE1MID09PSAnbm9uZScpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGlmICghbGF5ZXIuZ2V0RGF0YXNldCkgY29udGludWVcclxuICAgICAgICAgICAgY29uc3QgZHNjID0gbGF5ZXIuZ2V0RGF0YXNldCh6KVxyXG4gICAgICAgICAgICBpZiAoIWRzYykgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vZ2V0IGNlbGwgYXQgbW91c2UgcG9zaXRpb25cclxuICAgICAgICAgICAgLyoqIEB0eXBlIHtpbXBvcnQoJy4vRGF0YXNldC5qcycpLkNlbGx8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgICAgICBjb25zdCBjZWxsID0gZHNjLmdldENlbGxGcm9tUG9zaXRpb24ocG9zR2VvLCBkc2MuZ2V0Vmlld0NhY2hlKCkpXHJcbiAgICAgICAgICAgIC8vY29uc29sZS5sb2coY2VsbCwgZHNjLnJlc29sdXRpb24pXHJcbiAgICAgICAgICAgIGlmICghY2VsbCkgcmV0dXJuIHVuZGVmaW5lZFxyXG5cclxuICAgICAgICAgICAgLy9yYXJlIGNhc2UgZm9yIGEgZGF0YXNldCB3aXRoIG1peGVkIHJlc29sdXRpb25zXHJcbiAgICAgICAgICAgIGlmIChkc2MubWl4ZWRSZXNvbHV0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCByID0gK2RzYy5taXhlZFJlc29sdXRpb24oY2VsbClcclxuICAgICAgICAgICAgICAgIGNvbnN0IGh0bWwgPSBsYXllci5jZWxsSW5mb0hUTUwoY2VsbCwgcilcclxuICAgICAgICAgICAgICAgIGlmICghaHRtbCkgcmV0dXJuIHVuZGVmaW5lZFxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHsgY2VsbDogY2VsbCwgaHRtbDogaHRtbCwgcmVzb2x1dGlvbjogciB9XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIGNvbnN0IGh0bWwgPSBsYXllci5jZWxsSW5mb0hUTUwoY2VsbCwgZHNjLmdldFJlc29sdXRpb24oKSlcclxuICAgICAgICAgICAgaWYgKCFodG1sKSByZXR1cm4gdW5kZWZpbmVkXHJcbiAgICAgICAgICAgIHJldHVybiB7IGNlbGw6IGNlbGwsIGh0bWw6IGh0bWwsIHJlc29sdXRpb246IGRzYy5nZXRSZXNvbHV0aW9uKCkgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSB4XHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0geVxyXG4gICAgICogQHBhcmFtIHtudW1iZXJ8dW5kZWZpbmVkfSB6XHJcbiAgICAgKi9cclxuICAgIHNldFZpZXcoeCwgeSwgeiA9IHVuZGVmaW5lZCkge1xyXG4gICAgICAgIHRoaXMuZ2VvQ2FudmFzLnZpZXcueCA9IHhcclxuICAgICAgICB0aGlzLmdlb0NhbnZhcy52aWV3LnkgPSB5XHJcbiAgICAgICAgaWYgKHogIT0gdW5kZWZpbmVkKSB0aGlzLmdlb0NhbnZhcy52aWV3LnogPSB6XHJcbiAgICAgICAgcmV0dXJuIHRoaXNcclxuICAgIH1cclxuXHJcbiAgICAvKiogQHJldHVybnMge2ltcG9ydCgnLi9HZW9DYW52YXMuanMnKS5WaWV3fSAqL1xyXG4gICAgZ2V0VmlldygpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5nZW9DYW52YXMudmlld1xyXG4gICAgfVxyXG5cclxuICAgIC8qKiBAcmV0dXJucyB7bnVtYmVyfSAqL1xyXG4gICAgZ2V0Wm9vbSgpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5nZW9DYW52YXMudmlldy56XHJcbiAgICB9XHJcbiAgICAvKiogQHBhcmFtIHtudW1iZXJ9IHogQHJldHVybnMge3RoaXN9ICovXHJcbiAgICBzZXRab29tKHopIHtcclxuICAgICAgICB0aGlzLmdlb0NhbnZhcy52aWV3LnogPSB6XHJcbiAgICAgICAgcmV0dXJuIHRoaXNcclxuICAgIH1cclxuXHJcbiAgICAvKiogQHJldHVybnMge0FycmF5LjxudW1iZXJ8dW5kZWZpbmVkPn0gKi9cclxuICAgIGdldENlbnRlckV4dGVudCgpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5nZW9DYW52YXMuZ2V0Q2VudGVyRXh0ZW50KClcclxuICAgIH1cclxuICAgIC8qKiBAcGFyYW0ge0FycmF5LjxudW1iZXI+fSB2YWwgQHJldHVybnMge3RoaXN9ICovXHJcbiAgICBzZXRDZW50ZXJFeHRlbnQodmFsKSB7XHJcbiAgICAgICAgdGhpcy5nZW9DYW52YXMuc2V0Q2VudGVyRXh0ZW50KHZhbClcclxuICAgICAgICByZXR1cm4gdGhpc1xyXG4gICAgfVxyXG5cclxuICAgIC8qKiBAcmV0dXJucyB7QXJyYXkuPG51bWJlcj59ICovXHJcbiAgICBnZXRab29tRXh0ZW50KCkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLmdlb0NhbnZhcy5nZXRab29tRXh0ZW50KClcclxuICAgIH1cclxuICAgIC8qKiBAcGFyYW0ge0FycmF5LjxudW1iZXI+fSB2YWwgQHJldHVybnMge3RoaXN9ICovXHJcbiAgICBzZXRab29tRXh0ZW50KHZhbCkge1xyXG4gICAgICAgIHRoaXMuZ2VvQ2FudmFzLnNldFpvb21FeHRlbnQodmFsKVxyXG4gICAgICAgIHJldHVybiB0aGlzXHJcbiAgICB9XHJcblxyXG4gICAgLyoqIEByZXR1cm5zIHtzdHJpbmd9ICovXHJcbiAgICBnZXRCYWNrZ3JvdW5kQ29sb3IoKSB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMuZ2VvQ2FudmFzLmJhY2tncm91bmRDb2xvclxyXG4gICAgfVxyXG4gICAgLyoqIEBwYXJhbSB7c3RyaW5nfSB2YWwgQHJldHVybnMge3RoaXN9ICovXHJcbiAgICBzZXRCYWNrZ3JvdW5kQ29sb3IodmFsKSB7XHJcbiAgICAgICAgdGhpcy5nZW9DYW52YXMuYmFja2dyb3VuZENvbG9yID0gdmFsXHJcbiAgICAgICAgcmV0dXJuIHRoaXNcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEFkZHMgYSBzZXQgb2Ygem9vbSBidXR0b25zIHRvIHRoZSBtYXBcclxuICAgICAqXHJcbiAgICAgKiBAcGFyYW0ge29iamVjdH0gb3B0c1xyXG4gICAgICogQHJldHVybnMge3RoaXN9XHJcbiAgICAgKi9cclxuICAgIGFkZFpvb21CdXR0b25zKG9wdHMpIHtcclxuICAgICAgICAvLyAqIG9wdHMuaWRcclxuICAgICAgICAvLyAqIG9wdHMub25ab29tIC0gY3VzdG9tIGV2ZW50IGhhbmRsZXIgZnVuY3Rpb25cclxuICAgICAgICAvLyAqIG9wdHMueFxyXG4gICAgICAgIC8vICogb3B0cy55XHJcbiAgICAgICAgLy8gKiBvcHRzLmRlbHRhIC0gem9vbSBkZWx0YSBhcHBsaWVkIG9uIGVhY2ggY2xpY2tcclxuXHJcbiAgICAgICAgdGhpcy56b29tQnV0dG9ucyA9IG5ldyBab29tQnV0dG9ucyh7XHJcbiAgICAgICAgICAgIG1hcDogdGhpcyxcclxuICAgICAgICAgICAgaWQ6IG9wdHM/LmlkIHx8ICdncmlkdml6LXpvb20tYnV0dG9ucy0nICsgdGhpcy5jb250YWluZXIuaWQsXHJcbiAgICAgICAgICAgIGNsYXNzOiBvcHRzPy5jbGFzcyxcclxuICAgICAgICAgICAgeDogb3B0cz8ueCxcclxuICAgICAgICAgICAgeTogb3B0cz8ueSxcclxuICAgICAgICAgICAgb25ab29tOiBvcHRzPy5vblpvb20sXHJcbiAgICAgICAgICAgIGRlbHRhOiBvcHRzPy5kZWx0YSB8fCAwLjIsXHJcbiAgICAgICAgfSlcclxuXHJcbiAgICAgICAgcmV0dXJuIHRoaXNcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEFkZHMgYSBmdWxsc2NyZWVuIHRvZ2dsZSBidXR0b24gdG8gdGhlIGFwcFxyXG4gICAgICpcclxuICAgICAqIEBwYXJhbSB7b2JqZWN0fSBvcHRzXHJcbiAgICAgKiBAcmV0dXJucyB7dGhpc31cclxuICAgICAqL1xyXG4gICAgYWRkRnVsbHNjcmVlbkJ1dHRvbihvcHRzKSB7XHJcbiAgICAgICAgLy8gKiBvcHRzLm1hcCAtIHRoZSBncmlkdml6IG1hcFxyXG4gICAgICAgIC8vICogb3B0cy5pZFxyXG4gICAgICAgIC8vICogb3B0cy54XHJcbiAgICAgICAgLy8gKiBvcHRzLnlcclxuXHJcbiAgICAgICAgdGhpcy5mdWxsc2NyZW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VyLmNsaWVudEhlaWdodCA+IDApIHtcclxuICAgICAgICAgICAgICAgIC8vIG1ha2Ugc3VyZSB3ZSBkb250IGV4Y2VlZCBsb29wIGxpbWl0IGZpcnN0XHJcbiAgICAgICAgICAgICAgICAvLyBzZWU6IGh0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vcXVlc3Rpb25zLzQ5Mzg0MTIwL3Jlc2l6ZW9ic2VydmVyLWxvb3AtbGltaXQtZXhjZWVkZWRcclxuICAgICAgICAgICAgICAgIHdpbmRvdy5yZXF1ZXN0QW5pbWF0aW9uRnJhbWUoKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICghQXJyYXkuaXNBcnJheShlbnRyaWVzKSB8fCAhZW50cmllcy5sZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSB0aGUgbWFwIGFuZCBjYW52YXMgc2l6ZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmggIT09IGNvbnRhaW5lci5jbGllbnRIZWlnaHQgfHwgdGhpcy53ICE9PSBjb250YWluZXIuY2xpZW50V2lkdGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5oID0gY29udGFpbmVyLmNsaWVudEhlaWdodFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLncgPSBjb250YWluZXIuY2xpZW50V2lkdGhcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5nZW9DYW52YXMuaCA9IGNvbnRhaW5lci5jbGllbnRIZWlnaHRcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5nZW9DYW52YXMudyA9IGNvbnRhaW5lci5jbGllbnRXaWR0aFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmdlb0NhbnZhcy5jYW52YXMuc2V0QXR0cmlidXRlKCd3aWR0aCcsICcnICsgdGhpcy53KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmdlb0NhbnZhcy5jYW52YXMuc2V0QXR0cmlidXRlKCdoZWlnaHQnLCAnJyArIHRoaXMuaClcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gb2Zmc2NyZWVuIGNhbnZhc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmdlb0NhbnZhcy5vZmZzY3JlZW5DYW52YXMuc2V0QXR0cmlidXRlKCd3aWR0aCcsICcnICsgdGhpcy53KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmdlb0NhbnZhcy5vZmZzY3JlZW5DYW52YXMuc2V0QXR0cmlidXRlKCdoZWlnaHQnLCAnJyArIHRoaXMuaClcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWRyYXcoKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgLy91cGRhdGUgYnV0dG9uIHBvc2l0aW9uc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiAodGhpcy56b29tQnV0dG9ucykgdGhpcy56b29tQnV0dG9ucy5ub2RlLnN0eWxlLmxlZnQgPSB0aGlzLncgLSA1MCArICdweCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgKHRoaXMuZnVsbHNjcmVlbkJ1dHRvbikgdGhpcy5mdWxsc2NyZWVuQnV0dG9uLm5vZGUuc3R5bGUubGVmdCA9IHRoaXMudyAtIDUwICsgJ3B4J1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KVxyXG5cclxuICAgICAgICByZXNpemVPYnNlcnZlci5vYnNlcnZlKHRoaXMuY29udGFpbmVyKVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogQGRlc2NyaXB0aW9uIERlc3Ryb3kgdGhlIG1hcCBhbmQgaXQncyBldmVudCBsaXN0ZW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9cbiAgICAgICAgdGhpcy5mb250U2l6ZSA9IG9wdHMuZm9udFNpemUgfHwgJzEuMmVtJ1xuICAgICAgICAvKiogQHR5cGUge3N0cmluZ30gKi9cbiAgICAgICAgdGhpcy5iYWNrZ3JvdW5kID0gb3B0cy5iYWNrZ3JvdW5kIHx8ICd3aGl0ZSdcbiAgICAgICAgLyoqIEB0eXBlIHtzdHJpbmd9ICovXG4gICAgICAgIHRoaXMucGFkZGluZyA9IG9wdHMucGFkZGluZyB8fCAnNXB4J1xuICAgICAgICAvKiogQHR5cGUge3N0cmluZ30gKi9cbiAgICAgICAgdGhpcy5ib3JkZXIgPSBvcHRzLmJvcmRlciB8fCAnMHB4J1xuICAgICAgICAvKiogQHR5cGUge3N0cmluZ30gKi9cbiAgICAgICAgdGhpc1snYm9yZGVyLXJhZGl1cyddID0gb3B0c1snYm9yZGVyLXJhZGl1cyddIHx8ICcwcHgnXG4gICAgICAgIC8qKiBAdHlwZSB7c3RyaW5nfSAqL1xuICAgICAgICB0aGlzWydib3gtc2hhZG93J10gPSBvcHRzWydib3gtc2hhZG93J10gfHwgJzVweCA1cHggNXB4IGdyZXknXG4gICAgICAgIC8qKiBAdHlwZSB7c3RyaW5nfSAqL1xuICAgICAgICB0aGlzWydmb250LWZhbWlseSddID0gb3B0c1snZm9udC1mYW1pbHknXSB8fCAnSGVsdmV0aWNhLCBBcmlhbCwgc2Fucy1zZXJpZidcblxuICAgICAgICAvKiogQHR5cGUge251bWJlcn0gKi9cbiAgICAgICAgdGhpcy50cmFuc2l0aW9uRHVyYXRpb24gPSBvcHRzLnRyYW5zaXRpb25EdXJhdGlvbiB8fCAxMDBcbiAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ9ICovXG4gICAgICAgIHRoaXMueE9mZnNldCA9IG9wdHMueE9mZnNldCB8fCAzMFxuICAgICAgICAvKiogQHR5cGUge251bWJlcn0gKi9cbiAgICAgICAgdGhpcy55T2Zmc2V0ID0gb3B0cy55T2Zmc2V0IHx8I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ZvciAoY29uc3QgYyBvZiBkYXRhKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgYy54ID0gK2MueFxyXG4gICAgICAgICAgICAgICAgICAgIGMueSA9ICtjLnlcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAvL3ByZXByb2Nlc3MvZmlsdGVyXHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5wcmVwcm9jZXNzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jZWxscyA9IFtdXHJcbiAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCBjIG9mIGRhdGEpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYiA9IHRoaXMucHJlcHJvY2VzcyhjKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYiA9PSBmYWxzZSkgY29udGludWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jZWxscy5wdXNoKGMpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNlbGxzID0gZGF0YVxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIC8vVE9ETyBjaGVjayBpZiByZWRyYXcgaXMgbmVjZXNzYXJ5XHJcbiAgICAgICAgICAgICAgICAvL3RoYXQgaXMgaWYgdGhlIGRhdGFzZXQgYmVsb25ncyB0byBhIGxheWVyIHdoaWNoIGlzIHZpc2libGUgYXQgdGhlIGN1cnJlbnQgem9vbSBsZXZlbFxyXG5cclxuICAgICAgICAgICAgICAgIC8vcmVkcmF3IG1hcFxyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubWFwKSB0aGlzLm1hcC5yZWRyYXcoKVxyXG5cclxuICAgICAgICAgICAgICAgIHRoaXMuaW5mb0xvYWRpbmdTdGF0dXMgPSAnbG9hZGVkJ1xyXG4gICAgICAgICAgICB9IGNhdGNoIChlcnJvcikge1xyXG4gICAgICAgICAgICAgICAgLy9tYXJrIGFzIGZhaWxlZFxyXG4gICAgICAgICAgICAgICAgdGhpcy5pbmZvTG9hZGluZ1N0YXR1cyA9ICdmYWlsZWQnXHJcbiAgICAgICAgICAgICAgICB0aGlzLmNlbGxzID0gW11cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pKClcclxuXHJcbiAgICAgICAgcmV0dXJuIHRoaXNcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEZpbGwgdGhlIHZpZXcgY2FjaGUgd2l0aCBhbGwgY2VsbHMgd2hpY2ggYXJlIHdpdGhpbiBhIGdlb2dyYXBoaWNhbCBlbnZlbG9wZS5cclxuICAgICAqXHJcbiAgICAgKiBAcGFyYW0ge2ltcG9ydChcIi4uL2NvcmUvR2VvQ2FudmFzLmpzXCIpLkVudmVsb3BlfSBleHRHZW9cclxuICAgICAqIEByZXR1cm5zIHt2b2lkfVxyXG4gICAgICovXHJcbiAgICB1cGRhdGVWaWV3Q2FjaGUoZXh0R2VvKSB7XHJcbiAgICAgICAgLy9kYXRhIG5vdCBsb2FkZWQgeWV0XHJcbiAgICAgICAgaWYgKCF0aGlzLmNlbGxzKSByZXR1cm5cclxuXHJcbiAgICAgICAgdGhpcy5jZWxsc1ZpZXdDYWNoZSA9IFtdXHJcbiAgICAgICAgZm9yIChjb25zdCBjZWxsIG9mIHRoaXMuY2VsbHMpIHtcclxuICAgICAgICAgICAgaWYgKCtjZWxsLnggKyB0aGlzLnJlc29sdXRpb24gPCBleHRHZW8ueE1pbikgY29udGludWVcclxuICAgICAgICAgICAgaWYgKCtjZWxsLnggLSB0aGlzLnJlc29sdXRpb24gPiBleHRHZW8ueE1heCkgY29udGludWVcclxuICAgICAgICAgICAgaWYgKCtjZWxsLnkgKyB0aGlzLnJlc29sdXRpb24gPCBleHRHZW8ueU1pbikgY29udGludWVcclxuICAgICAgICAgICAgaWYgKCtjZWxsLnkgLSB0aGl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Vt4VF1beVRdIHJldHVybnMgdGhlIHRpbGUgYXQgW3hUXVt5VF0gbG9jYXRpb24uXHJcbiAgICAgICAgICpcclxuICAgICAgICAgKiBAdHlwZSB7b2JqZWN0fVxyXG4gICAgICAgICAqICovXHJcbiAgICAgICAgdGhpcy5jYWNoZSA9IHt9XHJcblxyXG4gICAgICAgIC8vbGF1bmNoIGxvYWRpbmdcclxuICAgICAgICB0aGlzLmxvYWRJbmZvKClcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIExvYWQgdGhlIGluZm8uanNvbiBmcm9tIHRoZSB1cmwuXHJcbiAgICAgKiBAcmV0dXJucyB0aGlzXHJcbiAgICAgKi9cclxuICAgIGxvYWRJbmZvKCkge1xyXG4gICAgICAgIGlmICghdGhpcy5pbmZvICYmIHRoaXMuaW5mb0xvYWRpbmdTdGF0dXMgPT09ICdub3RMb2FkZWQnKSB7XHJcbiAgICAgICAgICAgIDsoYXN5bmMgKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBkYXRhID0gYXdhaXQganNvbih0aGlzLnVybCArICdpbmZvLmpzb24nKVxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaW5mbyA9IGRhdGFcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlc29sdXRpb24gPSBkYXRhLnJlc29sdXRpb25HZW9cclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmluZm9Mb2FkaW5nU3RhdHVzID0gJ2xvYWRlZCdcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLm1hcC5yZWRyYXcoKVxyXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcclxuICAgICAgICAgICAgICAgICAgICAvL21hcmsgYXMgZmFpbGVkXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbmZvTG9hZGluZ1N0YXR1cyA9ICdmYWlsZWQnXHJcbiAgICAgICAgICAgICAgICB9XH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0IHlNaW4gPSBNYXRoLm1heCh0Yi55TWluLCBnYllNaW4pXHJcbiAgICAgICAgY29uc3QgeU1heCA9IE1hdGgubWluKHRiLnlNYXgsIGdiWU1heClcclxuXHJcbiAgICAgICAgLy8gQ291bnQgdGhlIHRvdGFsIG51bWJlciBvZiB0aWxlc1xyXG4gICAgICAgIGNvbnN0IHRvdGFsVGlsZXMgPSAoeE1heCAtIHhNaW4gKyAxKSAqICh5TWF4IC0geU1pbiArIDEpXHJcblxyXG4gICAgICAgIGxldCBwcm9jZXNzZWRUaWxlcyA9IDAgLy8gQ291bnRlciBmb3IgbG9hZGVkIHRpbGVzXHJcbiAgICAgICAgY29uc3QgdGlsZVByb21pc2VzID0gW11cclxuXHJcbiAgICAgICAgLy8gSXRlcmF0ZSBvdmVyIHRpbGVzIHdpdGhpbiBib3VuZHNcclxuICAgICAgICBmb3IgKGxldCB4VCA9IHhNaW47IHhUIDw9IHhNYXg7IHhUKyspIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgeVQgPSB5TWluOyB5VCA8PSB5TWF4OyB5VCsrKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuY2FjaGVbeFRdKSB0aGlzLmNhY2hlW3hUXSA9IHt9XHJcblxyXG4gICAgICAgICAgICAgICAgLy8gU2tpcCBhbHJlYWR5IGxvYWRlZCBvciBsb2FkaW5nIHRpbGVzXHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5jYWNoZVt4VF1beVRdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgKytwcm9jZXNzZWRUaWxlc1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgLy8gTWFyayB0aWxlIGFzIGxvYWRpbmdcclxuICAgICAgICAgICAgICAgIHRoaXMuY2FjaGVbeFRdW3lUXSA9ICdsb2FkaW5nJ1xyXG5cclxuICAgICAgICAgICAgICAgIC8vIFByZXBhcmUgdGhlIHRpbGUgcmVxdWVzdCBhbmQgc3RvcmUgaXQgaW4gdGlsZVByb21pc2VzXHJcbiAgICAgICAgICAgICAgICB0aWxlUHJvbWlzZXMucHVzaChcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxvYWRUaWxlKHhULCB5VClcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4oKHRpbGUpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEJlZm9yZSB3ZSBpbmNyZW1lbnQgcHJvY2Vzc2VkVGlsZXMsIGNoZWNrIGlmIGl0J3MgdGhlIGxhc3QgdGlsZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgaXNMYXN0VGlsZSA9ICsrcHJvY2Vzc2VkVGlsZXMgPT09IHRvdGFsVGlsZXNcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTdG9yZSB0aGUgdGlsZSBpbiB0aGUgY2FjaGVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY2FjaGVbeFRdW3lUXSA9IHRpbGVcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBQYXNzIHRoZSBpc0xhc3RUaWxlIGFyZ3VtZW50IHRvIGNoZWNrQW5kUmVkcmF3XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNoZWNrQW5kUmVkcmF3KHRpbGUsIGlzTGFzdFRpbGUpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5jYXRjaCgoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBNYXJrIGFzIGZhaWxlZCBidXQgYWxsb3cgcHJvY2Vzc2luZyB0byBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jYWNoZVt4VF1beVRdID0gJ2ZhaWxlZCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrcHJvY2Vzc2VkVGlsZXNcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gSGFuZGxlIGFsbCB0aWxlIHByb21pc2VzLCBpbmNsdWRpbmcgZmFpbHVyZXNcclxuICAgICAgICBhd2FpdCBQcm9taXNlLmFsbFNldHRsZWQodGlsZVByb21pc2VzKVxyXG4gICAgICAgIHJldHVybiB0aGlzXHJcbiAgICB9XHJcblxyXG4gICAgYXN5bmMgbG9hZFRpbGUoeFQsIHlUKSB7XHJcbiAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YSA9IGF3YWl0IGNzdihgJHt0aGlzLnVybH0ke3hUfS8ke3lUfS5jc3ZgKVxyXG5cclxuICAgICAgICAgICAgLy8gUHJlcHJvY2VzcyBvciBmaWx0ZXIgdGhlIGRhdGEgaWYgbmVlZGVkXHJcbiAgICAgICAgICAgIGNvbnN0IGNlbGxzID0gdGhpcy5wcmVwcm9jZXNzID8gZGF0YS5maWx0ZXIoKGNlbGwpID0+IHRoaXMucHJlcHJvY2VzcyhjZWxsKSAhPT0gZmFsc2UpIDogZGF0YVxyXG5cclxuICAgICAgICAgICAgaWYgKCF0aGlzLmluZm8pIHRocm93IG5ldyBFcnJvcignVGlsZSBpbmZvIHVua25vd24nKVxyXG5cclxuICAgICAgICAgICAgcmV0dXJuIGdldEdyaWRUaWxlKGNlbGxzLCB4VCwgeVQsIHRoaXMuaW5mbylcclxuICAgICAgICB9IGNhdGNoIChlcnJvcikge1xyXG4gICAgICAgICAgICBjb25zb2xlLndhcm4oYEZhaWxlZCB0byBsb2FkIHRpbGUgJHt4VH0sICR7eVR9OmAsIGVycm9yKVxyXG4gICAgICAgICAgICB0aHJvdyBlcnJvclxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBjaGVja0FuZFJlZHJhdyh0aWxlLCBpc0xhc3RUaWxlKSB7XHJcbiAgICAgICAgLy8gQ2hlY2sgaWYgYW55IHZpc2libGUgbGF5ZXIgZGVwZW5kcyBvbiB0aGlzIGRhdGFzZXRcclxuICAgICAgICAvL2NoZWNrIGlmIHJlZHJhdyBpcyByZWFsbHkgbmVlZGVkLCB0aGF0IGlzIGlmOlxyXG4gICAgICAgIC8vIDEuIHRoZSBkYXRhc2V0IGJlbG9uZ3MgdG8gYSBsYXllciB3aGljaCBpcyB2aXNpYmxlIGF0IHRoZSBjdXJyZW50IHpvb20gbGV2ZWxcclxuICAgICAgICBsZXQgbmVlZHNSZWRyYXcgPSBmYWxzZVxyXG4gICAgICAgIC8vZ28gdGhyb3VnaCB0aGUgbGF5ZXJzXHJcbiAgICAgICAgY29uc3QgeiA9IHRoaXMubWFwLmdldFpvb20oKVxyXG4gICAgICAgIGZvciAoY29uc3QgbGF5IG9mIHRoaXMubWFwLmxheWVycykge1xyXG4gICAgICAgICAgICBpZiAobGF5LnZpc2libGUgJiYgIWxheS52aXNpYmxlKHopKSBjb250aW51ZVxyXG4gICAgICAgICAgICBpZiAoIWxheS5nZXREYXRhc2V0KSBjb250aW51ZVxyXG4gICAgICAgICAgICBpZiAobGF5LmdldERhdGFzZXQoeikgIT0gdGhpcykgY29udGludWVcclxuICAgICAgICAgICAgLy9mb3VuZCBvbmUgbGF5ZXIuIE5vIG5lZWQgdG8gc2VlayBtb3JlLlxyXG4gICAgICAgICAgICBuZWVkc1JlZHJhdyA9IHRydWVcclxuICAgICAgICAgICAgYnJlYWtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmICghbmVlZHNSZWRyYXcpIHJldHVyblxyXG5cclxuICAgICAgICAvLyBDaGVjayBpZiB0aWxlIGludGVyc2VjdHMgdGhlIGN1cnJlbnQgdmlld1xyXG4gICAgICAgIGNvbnN0IGVudiA9IHRoaXMubWFwLnVwZGF0ZUV4dGVudEdlbygpXHJcbiAgICAgICAgY29uc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ydChcIi4uL2NvcmUvR2VvQ2FudmFzLmpzXCIpLkVudmVsb3BlfHVuZGVmaW5lZH0gKi9cclxuICAgICAgICBjb25zdCB0YiA9IHRoaXMuZ2V0VGlsaW5nRW52ZWxvcGUoZXh0R2VvKVxyXG4gICAgICAgIGlmICghdGIpIHJldHVyblxyXG5cclxuICAgICAgICAvL2dyaWQgYm91bmRzXHJcbiAgICAgICAgLyoqIEB0eXBlIHtpbXBvcnQoXCIuLi9jb3JlL0dlb0NhbnZhcy5qc1wiKS5FbnZlbG9wZX0gKi9cclxuICAgICAgICBjb25zdCBnYiA9IHRoaXMuaW5mby50aWxpbmdCb3VuZHNcclxuXHJcbiAgICAgICAgZm9yIChsZXQgeFQgPSBNYXRoLm1heCh0Yi54TWluLCBnYi54TWluKTsgeFQgPD0gTWF0aC5taW4odGIueE1heCwgZ2IueE1heCk7IHhUKyspIHtcclxuICAgICAgICAgICAgaWYgKCF0aGlzLmNhY2hlW3hUXSkgY29udGludWVcclxuICAgICAgICAgICAgZm9yIChsZXQgeVQgPSBNYXRoLm1heCh0Yi55TWluLCBnYi55TWluKTsgeVQgPD0gTWF0aC5taW4odGIueU1heCwgZ2IueU1heCk7IHlUKyspIHtcclxuICAgICAgICAgICAgICAgIC8vZ2V0IHRpbGVcclxuICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7b2JqZWN0fSAqL1xyXG4gICAgICAgICAgICAgICAgY29uc3QgdGlsZSA9IHRoaXMuY2FjaGVbeFRdW3lUXVxyXG4gICAgICAgICAgICAgICAgaWYgKCF0aWxlIHx8IHR5cGVvZiB0aWxlID09PSAnc3RyaW5nJykgY29udGludWVcclxuXHJcbiAgICAgICAgICAgICAgICAvL2dldCBjZWxsc1xyXG4gICAgICAgICAgICAgICAgLy90aGlzLmNlbGxzVmlld0NhY2hlID0gdGhpcy5jZWxsc1ZpZXdDYWNoZS5jb25jYXQodGlsZS5jZWxscylcclxuXHJcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IGNlbGwgb2YgdGlsZS5jZWxscykge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICgrY2VsbC54ICsgdGhpcy5yZXNvbHV0aW9uIDwgZXh0R2VvLnhNaW4pIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCtjZWxsLnggLSB0aGlzLnJlc29sdXRpb24gPiBleHRHZW8ueE1heCkgY29udGludWVcclxuICAgICAgICAgICAgICAgICAgICBpZiAoK2NlbGwueSArIHRoaXMucmVzb2x1dGlvbiA8IGV4dEdlby55TWluKSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICgrY2VsbC55IC0gdGhpcy5yZXNvbHV0aW9uID4gZXh0R2VvLnlNYXgpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jZWxsc1ZpZXdDYWNoZS5wdXNoKGNlbGwpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuXHJcbmZ1bmN0aW9uIGdldEdyaWRUaWxlKGNlbGxzLCB4VCwgeVQsIGdyaWRJbmZvKSB7XHJcbiAgICBjb25zdCB0aWxlID0ge31cclxuXHJcbiAgICAvKiogQHR5cGUge0FycmF5LjxpbXBvcnQoXCIuLi9jb3JlL0RhdGFzZXRcIikuQ2VsbD59ICovXHJcbiAgICB0aWxlLmNlbGxzID0gY2VsbHNcclxuICAgIC8qKiBAdHlwZSB7bnVtYmVyfSAqL1xyXG4gICAgdGlsZS54ID0geFRcclxuICAgIC8qKiBAdHlwZSB7bnVtYmVyfSAqL1xyXG4gICAgdGlsZS55ID0geVRcclxuXHJcbiAgICBjb25zdCByID0gZ3JpZEluZm8ucmVzb2x1dGlvbkdlb1xyXG4gICAgY29uc3QgcyA9IGdyaWRJbmZvLnRpbGVTaXplQ2VsbFxyXG5cclxuICAgIC8qKiBAdHlwZSB7aW1wb3J0KFwiLi4vY29yZS9HZW9DYW52YX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b2plY3Rpb24vIzYvMjcuODgvNDQuNDhcclxuICpcclxuICogQG1vZHVsZSBsYXllclxyXG4gKiBAYXV0aG9yIEp1bGllbiBHYWZmdXJpXHJcbiAqL1xyXG5leHBvcnQgY2xhc3MgQmFja2dyb3VuZExheWVyIGV4dGVuZHMgTGF5ZXIge1xyXG4gICAgLyoqXHJcbiAgICAgKiBAcGFyYW0ge29iamVjdH0gb3B0c1xyXG4gICAgICovXHJcbiAgICBjb25zdHJ1Y3RvcihvcHRzKSB7XHJcbiAgICAgICAgc3VwZXIob3B0cylcclxuICAgICAgICBvcHRzID0gb3B0cyB8fCB7fVxyXG5cclxuICAgICAgICAvKiogVGhlIGltYWdlIGNhY2hlLCBpbmRleGVkIGJ5IHoveS94ICovXHJcbiAgICAgICAgdGhpcy5jYWNoZSA9IHt9XHJcblxyXG4gICAgICAgIC8qKlxyXG4gICAgICAgICAqIEB0eXBlIHtzdHJpbmd9ICovXHJcbiAgICAgICAgdGhpcy51cmwgPSBvcHRzLnVybFxyXG4gICAgICAgIC8qKiBAdHlwZSB7ZnVuY3Rpb24obnVtYmVyLG51bWJlcixudW1iZXIpOnN0cmluZ30gKi9cclxuICAgICAgICB0aGlzLnVybEZ1biA9IG9wdHMudXJsRnVuIHx8ICgoeCwgeSwgeikgPT4gdGhpcy51cmwgKyB6ICsgJy8nICsgeCArICcvJyArIHkgKyAnLnBuZycpXHJcblxyXG4gICAgICAgIC8qKiBAdHlwZSB7QXJyYXkuPG51bWJlcj59ICovXHJcbiAgICAgICAgdGhpcy5yZXNvbHV0aW9ucyA9IG9wdHMucmVzb2x1dGlvbnNcclxuICAgICAgICBpZiAoIXRoaXMucmVzb2x1dGlvbnMgfHwgdGhpcy5yZXNvbHV0aW9ucy5sZW5ndGggPT0gMClcclxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdObyByZXNvbHV0aW9ucyBwcm92aWRlZCBmb3IgYmFja2dyb3VuZCBsYXllcicpXHJcblxyXG4gICAgICAgIC8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R1cm5zXHJcbiAgICAgKiBAcHJpdmF0ZVxyXG4gICAgICovXHJcbiAgICBwdXQoaW1nLCB6LCB4LCB5KSB7XHJcbiAgICAgICAgaWYgKCF0aGlzLmNhY2hlW3pdKSB0aGlzLmNhY2hlW3pdID0ge31cclxuICAgICAgICBpZiAoIXRoaXMuY2FjaGVbel1beF0pIHRoaXMuY2FjaGVbel1beF0gPSB7fVxyXG4gICAgICAgIHRoaXMuY2FjaGVbel1beF1beV0gPSBpbWdcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEBwYXJhbSB7aW1wb3J0KFwiLi4vY29yZS9HZW9DYW52YXNcIikuR2VvQ2FudmFzfSBnZW9DYW52YXMgVGhlIGNhbnZhcyB3aGVyZSB0byBkcmF3IHRoZSBsYXllci5cclxuICAgICAqIEByZXR1cm5zIHt2b2lkfVxyXG4gICAgICovXHJcbiAgICBkcmF3KGdlb0NhbnZhcykge1xyXG4gICAgICAgIGlmICghdGhpcy5yZXNvbHV0aW9ucyB8fCB0aGlzLnJlc29sdXRpb25zLmxlbmd0aCA9PSAwKSB7XHJcbiAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoJ05vIHJlc29sdXRpb25zIHByb3ZpZGVkIGZvciBiYWNrZ3JvdW5kIGxheWVyJylcclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL1xyXG4gICAgICAgIGNvbnN0IHogPSBnZW9DYW52YXMudmlldy56XHJcbiAgICAgICAgY29uc3QgeDAgPSB0aGlzLm9yaWdpblswXSxcclxuICAgICAgICAgICAgeTAgPSB0aGlzLm9yaWdpblsxXVxyXG5cclxuICAgICAgICAvL2dldCB6b29tIGxldmVsIGFuZCByZXNvbHV0aW9uXHJcbiAgICAgICAgbGV0IHpfID0gMFxyXG4gICAgICAgIGZvciAoel8gPSAwOyB6XyA8IHRoaXMucmVzb2x1dGlvbnMubGVuZ3RoOyB6XysrKSBpZiAodGhpcy5yZXNv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ID0geU1pbjsgeSA8IHlNYXg7IHkrKykge1xyXG4gICAgICAgICAgICAgICAgLy9nZXQgaW1hZ2VcclxuICAgICAgICAgICAgICAgIGxldCBpbWcgPSB0aGlzLmdldCh6XywgeCwgeSlcclxuXHJcbiAgICAgICAgICAgICAgICAvL2xvYWQgaW1hZ2VcclxuICAgICAgICAgICAgICAgIGlmICghaW1nKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgaW1nID0gbmV3IEltYWdlKClcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnB1dChpbWcsIHpfLCB4LCB5KVxyXG4gICAgICAgICAgICAgICAgICAgIGltZy5vbmxvYWQgPSAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGdlb0NhbnZhcy5yZWRyYXcoKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpbWcub25lcnJvciA9ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9jYXNlIHdoZW4gbm8gaW1hZ2VcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wdXQoJ2ZhaWxlZCcsIHpfLCB4LCB5KVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpbWcuc3JjID0gdGhpcy51cmxGdW4oeCwgeSwgel8pXHJcbiAgICAgICAgICAgICAgICAgICAgY29udGludWVcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAvL2Nhc2Ugd2hlbiBubyBpbWFnZVxyXG4gICAgICAgICAgICAgICAgaWYgKGltZyA9PT0gJ2ZhaWxlZCcpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICBpZiAoIShpbWcgaW5zdGFuY2VvZiBIVE1MSW1hZ2VFbGVtZW50KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGltZylcclxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKGltZy53aWR0aCA9PSAwIHx8IGltZy5oZWlnaHQgPT0gMCkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgaW1hZ2VcclxuICAgICAgICAgICAgICAgIGNvbnN0IHhHZW8gPSB4MCArIHggKiBzaXplR1xyXG4gICAgICAgICAgICAgICAgY29uc3QgeUdlbyA9IHkwIC0geSAqIHNpemVHXHJcbiAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgIGdlb0NhbnZhcy5pbml0Q2FudmFzVHJhbnNmb3JtKClcclxuICAgICAgICAgICAgICAgICAgICBnZW9DYW52YXMub2Zmc2NyZWVuQ3R4LmRyYXdJbWFnZShcclxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBnZW9DYW52YXMuZ2VvVG9QaXhYKHhHZW8pLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBnZW9DYW52YXMuZ2VvVG9QaXhZKHlHZW8pLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzaXplLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzaXplXHJcbiAgICAgICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAgICAgICAgIC8vY2cuY3R4LmRyYXdJbWFnZShpbWcsIHhHZW8sIHlHZW8sIHNpemVHLCAtc2l6ZUcpXHJcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnJvcikge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyb3IpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuIiwiLy9AdHMtY2hlY2tcclxuJ3VzZSBzdHJpY3QnXHJcblxyXG5pbXBvcnQgeyBMYXllciB9IGZyb20gJy4uL2NvcmUvTGF5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FzLmgpXHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgLy90aGUgbWFwIG1vdmVkOiByZXRyaWV2ZSBuZXcgaW1hZ2VcclxuXHJcbiAgICAgICAgICAgIC8vXHJcbiAgICAgICAgICAgIHRoaXMueE1pbiA9IGdlb0NhbnZhcy5leHRHZW8ueE1pblxyXG4gICAgICAgICAgICB0aGlzLnhNYXggPSBnZW9DYW52YXMuZXh0R2VvLnhNYXhcclxuICAgICAgICAgICAgdGhpcy55TWluID0gZ2VvQ2FudmFzLmV4dEdlby55TWluXHJcbiAgICAgICAgICAgIHRoaXMueU1heCA9IGdlb0NhbnZhcy5leHRHZW8ueU1heFxyXG5cclxuICAgICAgICAgICAgLy9idWlsZCBXTVMgVVJMXHJcbiAgICAgICAgICAgIGNvbnN0IHVybCA9IFtdXHJcbiAgICAgICAgICAgIHVybC5wdXNoKHRoaXMudXJsKVxyXG4gICAgICAgICAgICB1cmwucHVzaCgnJndpZHRoPScpXHJcbiAgICAgICAgICAgIHVybC5wdXNoKGdlb0NhbnZhcy53KVxyXG4gICAgICAgICAgICB1cmwucHVzaCgnJmhlaWdodD0nKVxyXG4gICAgICAgICAgICB1cmwucHVzaChnZW9DYW52YXMuaClcclxuICAgICAgICAgICAgLy9iYm94OiB4bWluIHltaW4geG1heCB5bWF4XHJcbiAgICAgICAgICAgIHVybC5wdXNoKCcmYmJveD0nKVxyXG4gICAgICAgICAgICB1cmwucHVzaChnZW9DYW52YXMuZXh0R2VvLnhNaW4pXHJcbiAgICAgICAgICAgIHVybC5wdXNoKCcsJylcclxuICAgICAgICAgICAgdXJsLnB1c2goZ2VvQ2FudmFzLmV4dEdlby55TWluKVxyXG4gICAgICAgICAgICB1cmwucHVzaCgnLCcpXHJcbiAgICAgICAgICAgIHVybC5wdXNoKGdlb0NhbnZhcy5leHRHZW8ueE1heClcclxuICAgICAgICAgICAgdXJsLnB1c2goJywnKVxyXG4gICAgICAgICAgICB1cmwucHVzaChnZW9DYW52YXMuZXh0R2VvLnlNYXgpXHJcblxyXG4gICAgICAgICAgICBjb25zdCB1cmxTID0gdXJsLmpvaW4oJycpXHJcbiAgICAgICAgICAgIC8vY29uc29sZS5sb2codXJsUylcclxuXHJcbiAgICAgICAgICAgIGlmICghdGhpcy5pbWcpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuaW1nID0gbmV3IEltYWdlKClcclxuICAgICAgICAgICAgICAgIHRoaXMuaW1nLm9ubG9hZCA9ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBnZW9DYW52YXMucmVkcmF3KClcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHRoaXMuaW1nLm9uZXJyb3IgPSAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9jYXNlIHdoZW4gbm8gaW1hZ2VcclxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ0NvdWxkIG5vdCByZXRyaWV2ZSBXTVMgYmFja2dyb3VuZCBpbWFnZSBmcm9tJywgdXJsUylcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy9zZXQgVVJMIHRvIGxhdW5jaCB0aGUgZG93bmxvYWRcclxuICAgICAgICAgICAgdGhpcy5pbWcuc3JjID0gdXJsU1xyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG4iLCIvL0B0cy1jaGVja1xyXG4ndXNlIHN0cmljdCdcclxuXHJcbmltcG9ydCB7IExheWVyIH0gZnJvbSAnLi4vY29yZS9MYXllci5qcydcclxuaW1wb3J0IHsganNvbiB9IGZyb20gJ2QzLWZldGNoJ1xyXG5cclxuLyoqXHJcbiAqIEBtb2R1bGUgbGF5ZXJcclxuICogQGF1dGhvciBKb3NlcGggRGF2aWVzLCBKdWxpZW4gR2FmZnVyaVxyXG4gKi9cclxuZXhwb3J0IGNsYXNzIEdlb0pTT05MYXllciBleHRlbmRzIExheWVyIHtcclxuICAgIC8qKl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AgKiBAcHJpdmF0ZVxyXG4gICAgICAgICAqIEB0eXBlIHtmdW5jdGlvbihvYmplY3QsbnVtYmVyKTpudW1iZXJ9ICovXHJcbiAgICAgICAgdGhpcy53aWR0aCA9IG9wdHMud2lkdGggfHwgKChmLCB6KSA9PiAyKVxyXG4gICAgICAgIC8qKlxyXG4gICAgICAgICAqIEBwcml2YXRlXHJcbiAgICAgICAgICogQHR5cGUge2Z1bmN0aW9uKG9iamVjdCxudW1iZXIpOkFycmF5LjxudW1iZXI+fHVuZGVmaW5lZH0gKi9cclxuICAgICAgICB0aGlzLmxpbmVEYXNoID0gb3B0cy5saW5lRGFzaCB8fCAoKGYsIHopID0+IHVuZGVmaW5lZClcclxuXHJcbiAgICAgICAgLyoqXHJcbiAgICAgICAgICogQHByaXZhdGVcclxuICAgICAgICAgKiBAdHlwZSB7QXJyYXkuPG9iamVjdD4gfCB1bmRlZmluZWR9ICovXHJcbiAgICAgICAgdGhpcy5mcyA9IHVuZGVmaW5lZFxyXG5cclxuICAgICAgICAvKipcclxuICAgICAgICAgKiBAcHJpdmF0ZVxyXG4gICAgICAgICAqIEB0eXBlIHtzdHJpbmd9ICovXHJcbiAgICAgICAgdGhpcy5sb2FkaW5nU3RhdHVzID0gJ25vdExvYWRlZCdcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIERyYXcgdGhlIGxheWVyLlxyXG4gICAgICogQHBhcmFtIHtpbXBvcnQoXCIuLi9jb3JlL0dlb0NhbnZhcy5qc1wiKS5HZW9DYW52YXN9IGdlb0NhbnZhcyBUaGUgY2FudmFzIHdoZXJlIHRvIGRyYXcgdGhlIGxheWVyLlxyXG4gICAgICogQHJldHVybnMge3ZvaWR9XHJcbiAgICAgKi9cclxuICAgIGRyYXcoZ2VvQ2FudmFzKSB7XHJcbiAgICAgICAgLy9sb2FkIGRhdGEsIGlmIG5vdCBkb25lIHlldC5cclxuICAgICAgICBpZiAoIXRoaXMuZnMpIHtcclxuICAgICAgICAgICAgdGhpcy5sb2FkKGdlb0NhbnZhcy5yZWRyYXcpXHJcbiAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9cclxuICAgICAgICBjb25zdCB6ID0gZ2VvQ2FudmFzLnZpZXcuelxyXG4gICAgICAgIGNvbnN0IGN0eCA9IGdlb0NhbnZhcy5vZmZzY3JlZW5DdHhcclxuXHJcbiAgICAgICAgZm9yIChjb25zdCBmIG9mIHRoaXMuZnMpIHtcclxuICAgICAgICAgICAgY29uc3QgZ3QgPSBmLmdlb21ldHJ5LnR5cGVcclxuXHJcbiAgICAgICAgICAgIGlmIChndCA9PSAnUG9pbnQnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjID0gZi5nZW9tZXRyeS5jb29yZGluYXRlc1xyXG5cclxuICAgICAgICAgICAgICAgIC8vZ2V0IHN0eWxlIHBhcmFtZXRlcnMgZm9yIHRoZSBwb2ludCBmZWF0dXJlXHJcbiAgICAgICAgICAgICAgICBjb25zdCBzaGFwZSA9IHRoaXMuc2hhcGUoZiwgeilcclxuICAgICAgICAgICAgICAgIGlmICghc2hhcGUgfHwgc2hhcGUgPT0gJ25vbmUnKSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgY29uc3Qgc2l6ZSA9IHRoaXMuc2l6ZShmLCB6KSAqIHpcclxuICAgICAgICAgICAgICAgIGlmICghc2l6ZSkgY29udGludWVcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN0cm9rZVN0eWxlID0gdGhpcy5zdHJva2VTdHlsZShmLCB6KVxyXG4gICAgICAgICAgICAgICAgY29uc3QgZmlsbFN0eWxlID0gdGhpcy5maWxsU3R5bGUoZiwgeilcclxuICAgICAgICAgICAgICAgIGNvbnN0IGxpbmVXaWR0aCA9IHRoaXMubGluZVdpZHRoKGYsIHopICogelxyXG5cclxuICAgICAgICAgICAgICAgIC8vc2V0IGNhbnZhcyBkcmF3aW5nIHBhcmFtZXRlcnNcclxuICAgICAgICAgICAgICAgIGlmIChzdHJva2VTdHlsZSkgY3R4LnN0cm9rZVN0eWxlID0gc3Ryb2tlU3R5bGVcclxuICAgICAgICAgICAgICAgIGlmIChmaWxsU3R5bGUpIGN0eC5maWxsU3R5bGUgPSBmaWxsU3R5bGVcclxuICAgICAgICAgICAgICAgIGlmIChsaW5lV2lkdGgpIGN0eC5saW5lV2lkdGggPSBsaW5lV2lkdGhcclxuXHJcbiAgICAgICAgICAgICAgICBpZiAoc2hhcGUgPT0gJ2NpcmNsZScpIHtcclxuICAgICAgICAgICAgICAgICAgICAvL2RyYXcgY2lyY2xlIC0gZmlsbCBhbmQgc3Ryb2tlXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmFyYyhjWzBdLCBjWzFdLCBzaXplIC8gMiwgMCwgMiAqIE1hdGguUEksIGZhbHNlKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChmaWxsU3R5bGUpIGN0eC5maWxsKClcclxuICAgICAgICAgICAgICAgICAgICBpZiAoc3Ryb2tlU3R5bGUgJiYgbGluZVdpZHRoKSBjdHguc3Ryb2tlKClcclxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2hhcGUgPT0gJ3NxdWFyZScpIHtcclxuICAgICAgICAgICAgICAgICAgICAvL2RyYXcgc3F1YXJlIC0gZmlsbCBhbmQgc3Ryb2tlXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LnJlY3QoY1swXSAtIHNpemUgLyAyLCBjWzFdIC0gc2l6ZSAvIDIsIHNpemUsIHNpemUpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGxTdHlsZSkgY3R4LmZpbGwoKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChzdHJva2VTdHlsZSAmJiBsaW5lV2lkdGgpIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKCdVbmV4cGVjdGVkIHNoYXBlIGZvciBwb2ludCBnZW9qc29uOiAnICsgc2hhcGUpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZ3QgPT0gJ0xpbmVTdHJpbmcnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjcyA9IGYuZ2VvbWV0cnkuY29vcmRpbmF0ZXNcclxuICAgICAgICAgICAgICAgIGlmIChjcy5sZW5ndGggPCAyKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgICAgIC8vc2V0IGNvbG9yXHJcbiAgICAgICAgICAgICAgICBjb25zdCBjb2wgPSB0aGlzLmNvbG9yKGYsIHopXHJcbiAgICAgICAgICAgICAgICBpZiAoIWNvbCB8fCBjb2wgPT0gJ25vbmUnKSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gY29sXHJcblxyXG4gICAgICAgICAgICAgICAgLy9zZXQgbGluZXdpZHRoXHJcbiAgICAgICAgICAgICAgICBjb25zdCB3UCA9IHRoaXMud2lkdGgoZiwgeilcclxuICAgICAgICAgICAgICAgIGlmICghd1AgfHwgd1AgPCAwKSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IHdQICogelxyXG5cclxuICAgICAgICAgICAgICAgIC8vc2V0IGxpbmUgZGFzaFxyXG4gICAgICAgICAgICAgICAgY29uc3QgbGRQID0gdGhpcy5saW5lRGFzaChmLCB6KVxyXG4gICAgICAgICAgICAgICAgaWYgKGxkUCkgY3R4LnNldExpbmVEYXNoKGxkUClcclxuXHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgbGluZVxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGNzWzBdWzBdLCBjc1swXVsxXSlcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAxOyBpIDwgY3MubGVuZ3RoOyBpKyspIGN0eC5saW5lVG8oY3NbaV1bMF0sIGNzW2ldWzFdKVxyXG4gICAgICAgICAgICAgICAgY3R4LnN0cm9rZSgpXHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnVW5zdXBwb3J0ZWQgZ2VvbWV0cnkgdHlwZSBpbiBHZW9KU09OTGF5ZXI6ICcgKyBndClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8uLi5cclxuICAgICAgICBjdHguc2V0TGluZURhc2goW10pXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBMb2FkIGRhdGEgZm9yIGxhYmVscywgZnJvbSBVUkwgdGhpcy51cmxcclxuICAgICAqIEBwYXJhbSB7ZnVuY3Rpb24oKTp2b2lkfSBjYWxsYmFja1xyXG4gICAgICogQHByaXZhdGVcclxuICAgICAqL1xyXG4gICAgYXN5bmMgbG9hZChjYWxsYmFjaykge1xyXG4gICAgICAgIGlmICghdGhpcy51cmwpIHtcclxuICAgICAgICAgICAgY29uc29sZS5sb2coJ0ZhaWxlZCBsb2FkaW5nIGJvdW5kYXJpZXM6IE5vIFVSTCBzcGVjaWZpZWQuICcgKyB0aGlzLnVybClcclxuICAgICAgICAgICAgdGhpcy5sb2FkaW5nU3RhdHVzID0gJ2ZhaWxlZCdcclxuICAgICAgICAgICAgdGhpcy5sYWJlbHMgPSBbXVxyXG4gICAgICAgICAgICByZXR1cm5cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vY2hlY2sgaWYgZGF0YSBhbHJlYWR5IGxvYWRlZFxyXG4gICAgICAgIGlmICh0aGlzLmxvYWRpbmdTdGF0dXMgIT0gJ25vdExvYWRlZCcpIHJldHVyblxyXG5cclxuICAgICAgICAvL2xvYWQgZGF0YVxyXG4gICAgICAgIHRoaXMubG9hZGluZ1N0YXR1cyA9ICdsb2FkaW5nJ1xyXG5cclxuICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICBjb25zdCBkYXRhXyA9IGF3YWl0IGpzb24odGhpcy51cmwpXHJcblxyXG4gICAgICAgICAgICAvKiogQHR5cGUgeyBBcnJheS48b2JqZWN0PiB9ICovXHJcbiAgICAgICAgICAgIGNvbnN0IGRhdGEgPSBkYXRhXy5mZWF0dXJlc1xyXG5cclxuICAgICAgICAgICAgLy9wcmVwcm9jZXNzL2ZpbHRlclxyXG4gICAgICAgICAgICBpZiAodGhpcy5wcmVwcm9jZXNzKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmZzID0gW11cclxuICAgICAgICAgICAgICAgIGZvciAoY29uc3QgYyBvZiBkYXRhKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgYiA9IHRoaXMucHJlcHJvY2VzcyhjKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChiID09IGZhbHNlKSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZnMucHVzaChjKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy9zdG9yZSBsYWJlbHNcclxuICAgICAgICAgICAgICAgIHRoaXMuZnMgPSBkYXRhXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIHRoaXMubG9hZGluZ1N0YXR1cyA9ICdsb2FkZWQnXHJcblxyXG4gICAgICAgICAgICAvL3JlZHJhd1xyXG4gICAgICAgICAgICBpZiAoY2FsbGJhY2spIGNhbGxiYWNrKClcclxuICAgICAgICB9IGNhdGNoIChlcnJvcikge1xyXG4gICAgICAgICAgICBjb25zb2xlLmxvZygnRmFpbGVkIGxvYWRpbmcgYm91bmRhcmllcyBmcm9tICcgKyB0aGlzLnVybClcclxuICAgICAgICAgICAgdGhpcy5m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XHJcblxyXG4gICAgICAgICAgICAvL3NldCBhZmZpbiB0cmFuc2Zvcm0gdG8gZHJhdyB3aXRoIGdlb2dyYXBoaWNhbCBjb29yZGluYXRlc1xyXG4gICAgICAgICAgICBnZW9DYW52YXMuc2V0Q2FudmFzVHJhbnNmb3JtKClcclxuXHJcbiAgICAgICAgICAgIC8vZHJhdyB3aXRoIHN0eWxlXHJcbiAgICAgICAgICAgIHMuZHJhdyhkc2MuZ2V0Vmlld0NhY2hlKCksIGdlb0NhbnZhcywgZHNjLmdldFJlc29sdXRpb24oKSlcclxuXHJcbiAgICAgICAgICAgIC8vZHJhdyBzdHlsZSBmaWx0ZXJcclxuICAgICAgICAgICAgaWYgKHMuZmlsdGVyQ29sb3IpIHMuZHJhd0ZpbHRlcihnZW9DYW52YXMpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2FkZCBsZWdlbmQgZWxlbWVudFxyXG4gICAgICAgIGlmIChsZWdlbmQpIHtcclxuICAgICAgICAgICAgZm9yIChjb25zdCBzIG9mIHRoaXMuc3R5bGVzKSB7XHJcbiAgICAgICAgICAgICAgICAvL2NoZWNrIGlmIHN0eWxlIGlzIHZpc2libGVcclxuICAgICAgICAgICAgICAgIGlmIChzLnZpc2libGUgJiYgIXMudmlzaWJsZSh6KSkgY29udGludWVcclxuICAgICAgICAgICAgICAgIEdyaWRMYXllci5hZGRMZWdlbmRzKGxlZ2VuZCwgcy5sZWdlbmRzKVxyXG5cclxuICAgICAgICAgICAgICAgIC8vY2FzZSBmb3Igc3R5bGVzIG9mIHN0eWxlcywgbGlrZSBrZXJuZWwgc21vb3RoaW5nXHJcbiAgICAgICAgICAgICAgICAvL1RPRE8gZG8gYmV0dGVyXHJcbiAgICAgICAgICAgICAgICBpZiAoc1snc3R5bGVzJ10pIHtcclxuICAgICAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHMyIG9mIHNbJ3N0eWxlcyddKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlm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HlQID0gZ2VvQ2FudmFzLmdlb1RvUGl4WShsYi55KSAtIHRoaXMub2Zmc2V0UGl4WzFdXHJcblxyXG4gICAgICAgICAgICAvL2xhYmVsIHN0cm9rZSwgZm9yIHRoZSBoYWxvXHJcbiAgICAgICAgICAgIGlmICh0aGlzLmhhbG9Db2xvciAmJiB0aGlzLmhhbG9XaWR0aCkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgaGMgPSB0aGlzLmhhbG9Db2xvcihsYiwgeilcclxuICAgICAgICAgICAgICAgIGNvbnN0IGh3ID0gdGhpcy5oYWxvV2lkdGgobGIsIHopXHJcbiAgICAgICAgICAgICAgICBpZiAoaGMgJiYgaHcgJiYgaHcgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gaGNcclxuICAgICAgICAgICAgICAgICAgICBjdHgubGluZVdpZHRoID0gaHdcclxuICAgICAgICAgICAgICAgICAgICBjdHguc3Ryb2tlVGV4dChsYi5uYW1lLCB4UCwgeVApXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vbGFiZWwgZmlsbFxyXG4gICAgICAgICAgICBpZiAodGhpcy5jb2xvcikge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY29sID0gdGhpcy5jb2xvcihsYiwgeilcclxuICAgICAgICAgICAgICAgIGlmIChjb2wpIHtcclxuICAgICAgICAgICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gY29sXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmZpbGxUZXh0KGxiLm5hbWUsIHhQLCB5UClcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIExvYWQgZGF0YSBmb3IgbGFiZWxzLCBmcm9tIFVSTCB0aGlzLnVybFxyXG4gICAgICogQHBhcmFtIHtmdW5jdGlvbigpOnZvaWR9IGNhbGxiYWNrXHJcbiAgICAgKiBAcHJpdmF0ZVxyXG4gICAgICovXHJcbiAgICBhc3luYyBsb2FkKGNhbGxiYWNrKSB7XHJcbiAgICAgICAgaWYgKCF0aGlzLnVybCkge1xyXG4gICAgICAgICAgICBjb25zb2xlLmxvZygnRmFpbGVkIGxvYWRpbmcgbGFiZWxzOiBObyBVUkwgc3BlY2lmaWVkLiAnICsgdGhpcy51cmwpXHJcbiAgICAgICAgICAgIHRoaXMubG9hZGluZ1N0YXR1cyA9ICdmYWlsZWQnXHJcbiAgICAgICAgICAgIHRoaXMubGFiZWxzID0gW11cclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2NoZWNrIGlmIGRhdGEgYWxyZWFkeSBsb2FkZWRcclxuICAgICAgICBpZiAodGhpcy5sb2FkaW5nU3RhdHVzICE9ICdub3RMb2FkZWQnKSByZXR1cm5cclxuXHJcbiAgICAgICAgLy9sb2FkIGRhdGFcclxuICAgICAgICB0aGlzLmxvYWRpbmdTdGF0dXMgPSAnbG9hZGluZydcclxuXHJcbiAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgLyoqIEB0eXBlIHsgQXJyYXkuPExhYmVsPiB9ICovXHJcbiAgICAgICAgICAgIGNvbnN0IGRhdGEgPSBhd2FpdCBjc3YodGhpcy51cmwpXHJcblxyXG4gICAgICAgICAgICAvL3ByZXByb2Nlc3MvZmlsdGVyXHJcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXByb2Nlc3MpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMubGFiZWxzID0gW11cclxuICAgICAgICAgICAgICAgIGZvciAoY29uc3QgYyBvZiBkYXRhKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgYiA9IHRoaXMucHJlcHJvY2VzcyhjKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChiID09IGZhbHNlKSBjb250aW51ZVxyXG4gICAgICAgICAgICAg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obGV0IGkgPSAwOyBpIDwgbmI7IGkrKykge1xyXG4gICAgICAgICAgICBjb25zdCBjYXQgPSB0aGlzLmNvbG9yTGFiZWxbaV1cclxuXHJcbiAgICAgICAgICAgIC8vbWFrZSBkaXYgZm9yIGNhdGVnb3J5XHJcbiAgICAgICAgICAgIGNvbnN0IGQgPSB0aGlzLmRpdi5hcHBlbmQoJ2RpdicpXHJcbiAgICAgICAgICAgIC8vdG8gZW5hYmxlIHZlcnRpY2FsIGNlbnRlcmluZ1xyXG4gICAgICAgICAgICAvLy5zdHlsZShcInBvc2l0aW9uXCIsIFwicmVsYXRpdmVcIilcclxuXHJcbiAgICAgICAgICAgIGNvbnN0IHN3ID0gdGhpcy5zdHJva2VXaWR0aFxyXG5cclxuICAgICAgICAgICAgLy9kcmF3IGdyYXBoaWMgZWxlbWVudDogYm94IC8gY2lyY2xlXHJcbiAgICAgICAgICAgIGlmICh0aGlzLnNoYXBlID09PSAnc3F1YXJlJykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgaCA9IHRoaXMuZGltZW5zaW9uLmggfHwgMTVcclxuICAgICAgICAgICAgICAgIGNvbnN0IHcgPSB0aGlzLmRpbWVuc2lvbi53IHx8IDIwXHJcbiAgICAgICAgICAgICAgICBkLmFwcGVuZCgnZGl2JylcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2Rpc3BsYXknLCAnaW5saW5lJylcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnc3ZnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCB3ICsgMiAqIHN3KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBoICsgMiAqIHN3KVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsIHN3KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5Jywgc3cpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgdylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgaClcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBjYXRbMF0pXHJcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCB0aGlzLnN0cm9rZUNvbG9yKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLXdpZHRoJywgdGhpcy5zdHJva2VXaWR0aClcclxuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLnNoYXBlID09PSAnY2lyY2xlJykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgciA9IHRoaXMuZGltZW5zaW9uLnIgfHwgOFxyXG4gICAgICAgICAgICAgICAgY29uc3QgaCA9IDIgKiByICsgMiAqIHN3XHJcbiAgICAgICAgICAgICAgICBkLmFwcGVuZCgnZGl2JylcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2Rpc3BsYXknLCAnaW5saW5lJylcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnc3ZnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBoKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdjaXJjbGUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjeCcsIHIgKyBzdylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY3knLCByICsgc3cpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3InLCByKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIGNhdFswXSlcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsIHRoaXMuc3Ryb2tlQ29sb3IpXHJcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2Utd2lkdGgnLCB0aGlzLnN0cm9rZVdpZHRoKVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdVbmV4cGVjdGVkIHNoYXBlOicgKyB0aGlzLnNoYXBlKVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvL3dyaXRlIGxhYmVsIHRleHRcclxuICAgICAgICAgICAgZC5hcHBlbmQoJ2RpdicpXHJcbiAgICAgICAgICAgICAgICAvL3Nob3cgb24gcmlnaHQgb2YgZ3JhcGhpY1xyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdkaXNwbGF5JywgJ2lubGluZScpXHJcblxyXG4gICAgICAgICAgICAgICAgLy9jZW50ZXIgdmVydGljYWxseVxyXG4gICAgICAgICAgICAgICAgLy8uc3R5bGUoXCJwb3NpdGlvblwiLCBcImFic29sdXRlXCIpLnN0eWxlKFwidG9wXCIsIFwiMFwiKS5zdHlsZShcImJvdHRvbVwiLCBcIjBcIilcclxuXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ3BhZGRpbmctbGVmdCcsICc1cHgnKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmb250LXNpemUnLCB0aGlzLmxhYmVsRm9udFNpemUpXHJcbiAgICAgICAgICAgICAgICAudGV4dChjYXRbMV0pXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59XHJcbiIsIi8vQHRzLWNoZWNrXHJcbid1c2Ugc3RyaWN0J1xyXG5cclxuaW1wb3J0IHsgTGVnZW5kIH0gZnJvbSAnLi4vY29yZS9MZWdlbmQuanMnXHJcblxyXG4vKipcclxuICogQSBsZWdlbmQgZWxlbWVudCBmb3IgZGlzY3JldGUgY29sb3Igc3R5bGUuXHJcbiAqIEluc3BpcmF0aW9uOiBodHRwczovL29ic2VydmFibGVocS5jb20vQGQzL2NvbG9yLWxlZ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lKG9wdHMpIHtcclxuICAgICAgICAvL2NsZWFyXHJcbiAgICAgICAgdGhpcy5kaXYuc2VsZWN0QWxsKCcqJykucmVtb3ZlKClcclxuXHJcbiAgICAgICAgLy90aXRsZVxyXG4gICAgICAgIHRoaXMubWFrZVRpdGxlKClcclxuXHJcbiAgICAgICAgLy9nZXQgY29sb3JzIGFuZCBicmVha3NcclxuICAgICAgICBjb25zdCBjb2xvcnMgPSB0aGlzLmNvbG9ycyhvcHRzLnZpZXdTY2FsZSlcclxuICAgICAgICBjb25zdCBicmVha3MgPSB0aGlzLmJyZWFrcyhvcHRzLnZpZXdTY2FsZSlcclxuICAgICAgICBpZiAoIWJyZWFrcykgcmV0dXJuXHJcblxyXG4gICAgICAgIC8vY2xhc3Nlc1xyXG4gICAgICAgIGNvbnN0IG5iID0gY29sb3JzLmxlbmd0aFxyXG4gICAgICAgIGlmIChuYiA9PSAwKSByZXR1cm5cclxuICAgICAgICBjb25zdCB3ID0gdGhpcy53aWR0aCAvIG5iXHJcblxyXG4gICAgICAgIC8vbWFrZSBzdmcgZWxlbWVudFxyXG4gICAgICAgIGNvbnN0IHN2ZyA9IHRoaXMuZGl2XHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ3N2ZycpXHJcbiAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHRoaXMud2lkdGgpXHJcbiAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCB0aGlzLmhlaWdodCArIHRoaXMudGlja1NpemUgKyAyICsgMTApXHJcblxyXG4gICAgICAgIC8vZHJhdyBncmFwaGljIGVsZW1lbnRzXHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBuYjsgaSsrKSB7XHJcbiAgICAgICAgICAgIHN2Zy5hcHBlbmQoJ3JlY3QnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBpICogdylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgMClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgdGhpcy5oZWlnaHQpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBjb2xvcnNbaV0pXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL3RpY2sgbGluZVxyXG4gICAgICAgIGZvciAobGV0IGkgPSAxOyBpIDwgbmI7IGkrKykge1xyXG4gICAgICAgICAgICBzdmcuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4MScsIHcgKiBpKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3kxJywgMClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIHcgKiBpKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgdGhpcy5oZWlnaHQgKyB0aGlzLnRpY2tTaXplKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCAnYmxhY2snKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9sYWJlbHNcclxuICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IG5iOyBpKyspIHtcclxuICAgICAgICAgICAgbGV0IGxhYmVsID0gYnJlYWtzW2kgLSAxXVxyXG4gICAgICAgICAgICBpZiAoaXNOYU4obGFiZWwpIHx8IGxhYmVsID09IHVuZGVmaW5lZCkgY29udGludWVcclxuICAgICAgICAgICAgaWYgKHRoaXMubGFiZWxGb3JtYXQpIGxhYmVsID0gdGhpcy5sYWJlbEZvcm1hdChsYWJlbClcclxuXHJcbiAgICAgICAgICAgIC8vbGFiZWxcclxuICAgICAgICAgICAgc3ZnLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAndGlja2xhYmVsXycgKyBpKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCB3ICogaSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5Jyw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naHRcclxuICAgICAgICBjb25zdCBzdGVwID0gNVxyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdzsgaSArPSBzdGVwKSB7XHJcbiAgICAgICAgICAgIGxldCB0ID0gaSAvICh3IC0gMSlcclxuICAgICAgICAgICAgaWYgKHRoaXMuaW52ZXJ0KSB0ID0gMSAtIHRcclxuICAgICAgICAgICAgZy5hcHBlbmQoJ3JlY3QnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBpKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCAwKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgc3RlcClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBoKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgdGhpcy5jb2xvclNjYWxlKHQsIG9wdHMudmlld1NjYWxlKSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy50aWNrczsgaSsrKSB7XHJcbiAgICAgICAgICAgIGxldCB0ID0gaSAvICh0aGlzLnRpY2tzIC0gMSlcclxuXHJcbiAgICAgICAgICAgIC8vdGljayBsaW5lXHJcbiAgICAgICAgICAgIGcuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4MScsIHcgKiB0KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3kxJywgMClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIHcgKiB0KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgaCArIHRoaXMudGlja1NpemUpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsICdibGFjaycpXHJcblxyXG4gICAgICAgICAgICAvL3ByZXBhcmUgdGljayBsYWJlbFxyXG4gICAgICAgICAgICBnLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAndGlja2xhYmVsXycgKyBpKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCB3ICogdClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgaCArIHRoaXMudGlja1NpemUgKyAyKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmb250LXNpemUnLCB0aGlzLmZvbnRTaXplKVxyXG4gICAgICAgICAgICAgICAgLy8uc3R5bGUoXCJmb250LXdlaWdodFwiLCBcImJvbGRcIilcclxuICAgICAgICAgICAgICAgIC8vLnN0eWxlKFwiZm9udC1mYW1pbHlcIiwgXCJBcmlhbFwiKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCd0ZXh0LWFuY2hvcicsIGkgPT0gMCA/ICdzdGFydCcgOiBpID09IHRoaXMudGlja3MgLSAxID8gJ2VuZCcgOiAnbWlkZGxlJylcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnYWxpZ25tZW50LWJhc2VsaW5lJywgJ3RvcCcpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ2RvbWluYW50LWJhc2VsaW5lJywgJ2hhbmdpbmcnKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdwb2ludGVyLWV2ZW50cycsICdub25lJylcclxuICAgICAgICAgICAgLy8udGV4dChcIi1cIilcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vdXBkYXRlIHRpY2sgbGFiZWxzXHJcblxyXG4gICAgICAgIC8vbGFiZWwgdGV4dCBmb3JtYXRcclxuICAgICAgICBjb25zdCBmID0gdGhpcy50aWNrRm9ybWF0ICYmIHRoaXMudGlja0Zvcm1hdCAhPSAndGV4dCcgPyB0aGlzLnRpY2tGb3JtYXQgOiAodikgPT4gdlxyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy50aWNrczsgaSsrKSB7XHJcbiAgICAgICAgICAgIGxldCB0ID0gaSAvICh0aGlzLnRpY2tzIC0gMSlcclxuXHJcb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FwicG9zaXRpb25cIiwgXCJyZWxhdGl2ZVwiKVxyXG5cclxuICAgICAgICAvL2RlZmF1bHQgc3ZnIGNvbnN0cnVjdGlvbiwgZm9yIHNxdWFyZSBhbmQgY2lyY2xlXHJcbiAgICAgICAgY29uc3Qgc3ZnID0gKCkgPT5cclxuICAgICAgICAgICAgZFxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnc3ZnJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHNpemVQaXggKyB0aGlzLnN0cm9rZVdpZHRoICsgMilcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBzaXplUGl4ICsgdGhpcy5zdHJva2VXaWR0aCArIDIpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJycsICdpbmxpbmUtYmxvY2snKVxyXG5cclxuICAgICAgICBpZiAodGhpcy5zaGFwZSA9PT0gJ3NxdWFyZScpIHtcclxuICAgICAgICAgICAgc3ZnKClcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3JlY3QnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCAwKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCAwKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgc2l6ZVBpeClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBzaXplUGl4KVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgdGhpcy5maWxsQ29sb3IpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsIHRoaXMuc3Ryb2tlQ29sb3IpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS13aWR0aCcsIHRoaXMuc3Ryb2tlV2lkdGgpXHJcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLnNoYXBlID09PSAnY2lyY2xlJykge1xyXG4gICAgICAgICAgICAvLyA8Y2lyY2xlIGN4PVwiNTBcIiBjeT1cIjUwXCIgcj1cIjQwXCIgc3Ryb2tlPVwiYmxhY2tcIiBzdHJva2Utd2lkdGg9XCIzXCIgZmlsbD1cInJlZFwiIC8+XHJcbiAgICAgICAgICAgIGNvbnN0IHIgPSAoc2l6ZVBpeCArIHRoaXMuc3Ryb2tlV2lkdGgpICogMC41XHJcbiAgICAgICAgICAgIHN2ZygpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdjaXJjbGUnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2N4JywgciArIDEpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY3knLCByICsgMSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdyJywgcilcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIHRoaXMuZmlsbENvbG9yKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCB0aGlzLnN0cm9rZUNvbG9yKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2Utd2lkdGgnLCB0aGlzLnN0cm9rZVdpZHRoKVxyXG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5zaGFwZSA9PT0gJ2RvbnV0Jykge1xyXG4gICAgICAgICAgICAvL1RPRE9cclxuICAgICAgICB9IGVsc2UgaWYgKHRoaXMuc2hhcGUgPT09ICdkaWFtb25kJykge1xyXG4gICAgICAgICAgICAvL1RPRE9cclxuICAgICAgICB9IGVsc2UgaWYgKHRoaXMuc2hhcGUgPT09ICdsaW5lJykge1xyXG4gICAgICAgICAgICAvL2dldCBzZWdtZW50IGxlbmd0aFxyXG4gICAgICAgICAgICBsZXQgbGVuZ3RoUGl4ID0gdGhpcy5sZW5ndGhcclxuICAgICAgICAgICAgICAgID8gdGhpcy5sZW5ndGgob3B0cy5yZXNvbHV0aW9uLCBvcHRzLnosIG9wdHMudmlld1NjYWxlKVxyXG4gICAgICAgICAgICAgICAgOiBvcHRzLnJlc29sdXRpb25cclxuICAgICAgICAgICAgbGVuZ3RoUGl4IC89IG9wdHMuelxyXG5cclxuICAgICAgICAgICAgY29uc3Qgc3ZnID0gZFxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnc3ZnJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIGxlbmd0aFBpeClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBzaXplUGl4KVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCcnLCAnaW5saW5lLWJsb2NrJylcclxuXHJcbiAgICAgICAgICAgIC8vVE9ETyBvcmllbnRhdGlvblxyXG4gICAgICAgICAgICAvLzxsaW5lIHgxPVwiMFwiIHkxPVwiMFwiIHgyPVwiMjAwXCIgeTI9XCIyMDBcIiBzdHlsZT1cInN0cm9rZTpyZ2IoMjU1LDAsMCk7c3Ryb2tlLXdpZHRoOjJcIiAvPlxyXG4gICAgICAgICAgICBzdmcuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4MScsIDApXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneTEnLCBzaXplUGl4IC8gMilcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIGxlbmd0aFBpeClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5MicsIHNpemVQaXggLyAyKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCB0aGlzLmNvbG9yKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2Utd2lkdGgnLCBzaXplUGl4KVxyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5leHBlY3RlZCBzaGFwZTonICsgdGhpcy5zaGFwZSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vbGFiZWxcclxuICAgICAgICBkLmFwcGVuZCgnZGl2JylcclxuICAgICAgICAgICAgLnN0eWxlKCdkaXNwbGF5Jywg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c3QgcGFkZGluZyA9IDJcclxuICAgICAgICBjb25zdCBmb250U2l6ZSA9IDEyXHJcblxyXG4gICAgICAgIC8vbWFrZSBzdmcgZWxlbWVudFxyXG4gICAgICAgIGNvbnN0IHN2ZyA9IHRoaXMuZGl2XHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ3N2ZycpXHJcbiAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHcgKyBzZWxlY3Rpb25TdHJva2VXaWR0aClcclxuICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGggKyA0ICogcGFkZGluZyArIDIgKiBmb250U2l6ZSlcclxuXHJcbiAgICAgICAgLy90b3AgbGFiZWxcclxuICAgICAgICBzdmcuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgLmF0dHIoJ3gnLCB3IC8gMilcclxuICAgICAgICAgICAgLmF0dHIoJ3knLCBwYWRkaW5nICsgZm9udFNpemUpXHJcbiAgICAgICAgICAgIC50ZXh0KHRoaXMudG9wVGV4dClcclxuICAgICAgICAgICAgLmF0dHIoJ2ZvbnQtc2l6ZScsIGZvbnRTaXplKVxyXG4gICAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCAnbWlkZGxlJylcclxuICAgICAgICAvL2xlZnQgbGFiZWxcclxuICAgICAgICBzdmcuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgLmF0dHIoJ3gnLCAwKVxyXG4gICAgICAgICAgICAuYXR0cigneScsIDMgKiBwYWRkaW5nICsgMiAqIGZvbnRTaXplICsgaClcclxuICAgICAgICAgICAgLnRleHQodGhpcy5sZWZ0VGV4dClcclxuICAgICAgICAgICAgLmF0dHIoJ2ZvbnQtc2l6ZScsIGZvbnRTaXplKVxyXG4gICAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCAnc3RhcnQnKVxyXG4gICAgICAgIC8vcmlnaHQgbGFiZWxcclxuICAgICAgICBzdmcuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgLmF0dHIoJ3gnLCB3KVxyXG4gICAgICAgICAgICAuYXR0cigneScsIDMgKiBwYWRkaW5nICsgMiAqIGZvbnRTaXplICsgaClcclxuICAgICAgICAgICAgLnRleHQodGhpcy5yaWdodFRleHQpXHJcbiAgICAgICAgICAgIC5hdHRyKCdmb250LXNpemUnLCBmb250U2l6ZSlcclxuICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ2VuZCcpXHJcblxyXG4gICAgICAgIC8vdHJpYW5nbGUgZ3JvdXBcclxuICAgICAgICBjb25zdCBnID0gc3ZnXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAuYXR0cihcclxuICAgICAgICAgICAgICAgICd0cmFuc2Zvcm0nLFxyXG4gICAgICAgICAgICAgICAgJ3RyYW5zbGF0ZSgnICtcclxuICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb25TdHJva2VXaWR0aCAvIDIgK1xyXG4gICAgICAgICAgICAgICAgICAgICcgJyArXHJcbiAgICAgICAgICAgICAgICAgICAgKHNlbGVjdGlvblN0cm9rZVdpZHRoIC8gMiArICgyICogcGFkZGluZyArIGZvbnRTaXplKSkgK1xyXG4gICAgICAgICAgICAgICAgICAgICcpJ1xyXG4gICAgICAgICAgICApXHJcblxyXG4gICAgICAgIC8vY29tbW9uIGZ1bmN0aW9uIGZvciB0cmlhbmdsZSBwYXRjaGVzXHJcbiAgICAgICAgY29uc3Qgc2V0QXR0cmlidXRlcyA9IChlbHQsIGNvbG9yLCB0ZXh0KSA9PiB7XHJcbiAgICAgICAgICAgIC8vZWx0LnJhaXNlKCk7XHJcbiAgICAgICAgICAgIGVsdC5hdHRyKCdmaWxsJywgY29sb3IpXHJcbiAgICAgICAgICAgICAgICAvLy5hdHRyKFwic3Ryb2tlXCIsIGNvbG9yT3ZlcilcclxuICAgICAgICAgICAgICAgIC8vLmF0dHIoXCJzdHJva2Utd2lkdGhcIiwgMClcclxuICAgICAgICAgICAgICAgIC8vLmF0dHIoXCJzdHJva2UtbGluZWpvaW5cIiwgXCJyb3VuZFwiKVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8qdGhpcy5wYXJlbnROb2RlLmFwcGVuZENoaWxkKHRoaXMpOyBzZWxlY3QodGhpcykuYXR0cihcInN0cm9rZS13aWR0aFwiLCBzZWxlY3Rpb25TdHJva2VXaWR0aCk7Ki9cclxuICAgICAgICAgICAgICAgICAgICBzZWxlY3QodGhpcykuYXR0cignZmlsbCcsIHNlbGVjdGlvbkNvbG9yKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghdHQgfHwgIXRleHQpIHJldHVyblxyXG4gICAgICAgICAgICAgICAgICAgIHR0Lmh0bWwodGV4dClcclxuICAgICAgICAgICAgICAgICAgICB0dC5zZXRQb3NpdGlvbihlKVxyXG4gICAgICAgICAgICAgICAgICAgIHR0LnNob3coKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLypzZWxlY3QodGhpcykuYXR0cihcInN0cm9rZS13aWR0aFwiLCAwKTsqL1xyXG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdCh0aGlzKS5hdHRyKCdmaWxsJywgY29sb3IpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR0KSB0dC5oaWRlKClcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIGlmICh0dCAmJiB0ZXh0KVxyXG4gICAgICAgICAgICAgICAgZWx0Lm9uKCdtb3VzZW1vdmUnLCBmdW5jdGlvbiAoZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHR0LnNldFBvc2l0aW9uKGUpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9jb25zdCBbYzAsIGMxLCBjMl0gPSBjbGFzc2lmaWVyLmNlbnRlclxyXG5cclxuICAgICAgICAvL3RyYXBleml1bSBzMFxyXG4gICAgICAgIGNvbnN0IHQwID0gZ1xyXG4gICAgICAgICAgICAuYXBwZW5kKCdwb2x5Z29uJylcclxuICAgICAgICAgICAgLmF0dHIoXHJcbiAgICAgICAgICAgICAgICAncG9pbnRzJyxcclxuICAgICAgICAgICAgICAgICcwLCcgK1xyXG4gICAgICAgICAgICAgICAgICAgIGggK1xyXG4gICAgICAgICAgICAgICAgICAgICcgJyArXHJcbiAgICAgICAgICAgICAgICAgICAgdyAvIDMgK1xyXG4gICAgICAgICAgICAgICAgICAgICcsJyArXHJcbiAgICAgICAgICAgICAgICAgICAgaCArXHJcbiAgICAgICAgICAgICAgICAgICAgJyAnICtcclxuICAgICAgICAgICAgICAgICAgICB3IC8gMiArXHJcbiAgICAgICAgICAgICAgICAgICAgJywnICtcclxuICAgICAgICAgICAgICAgICAgICAoaCAqIDIpIC8gMyArXHJcbiAgICAgICAgICAgICAgICAgICAgJyAnICtcclxuICAgICAgICAgICAgICAgICAgICB3IC8gNiArXHJcbiAgICAgICAgICAgICAgICAgICAgJywnICtcclxuICAgICAgICAgICAgICAgICAgICAoaCAqIDIpIC8gM1xyXG4gICAgICAgICAgICApXHJcbiAgICAgICAgc2V0QXR0cmlidXRlcyh0MCwgY2xhc3NpZmllci5jb2xvcnNbMF0sIHRleHRzWycwJ10pXHJcbiAgICAgICAgLy90cmFwZXppdW0gczFcclxuICAgICAgICBjb25zdCB0MSA9IGdcclxuICAgICAgICAgICAgLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgIC5hdHRyKFxyXG4gICAgICAgICAgICAgICAgJ3BvaW50cycsXHJcbiAgICAgICAgICAgICAgICB3IC8gMiArXHJcbiAgICAgICAgICAgICAgICAgICAgJywwICcgK1xyXG4gICAgICAgICAgICAgICAgICAgICh3ICogMikgLyAzICtcclxuICAgICAgICAgICAgICAgICAgICAnLCcgK1xyXG4gICAgICAgICAgICAgICAgICAgIGggLyAzICtcclxuICAgICAgICAgICAgICAgICAgICAnICcgK1xyXG4gICAgICAgICAgICAgICAgICAgIHcgLyAyICtcclxuICAgICAgICAgICAgICAgICAgICAnLCcgK1xyXG4gICAgICAgICAgICAgICAgICAgIChoICogMikgLyAzICtcclxuICAgICAgICAgICAgICAgICAgICAnICcgK1xyXG4gICAgICAgICAgICAgICAgICAgIHcgLyAzICtcclxuICAgICAgICAgICAgICAgICAgICAnLCcgK1xyXG4gICAgICAgICAgICAgICAgICAgIGggLyAzXHJcbiAgICAgICAgICAgIClcclxuICAgICAgICBzZXRBdHRyaWJ1dGVzKHQxLCBjbGFzc2lmaWVyLmNvbG9yc1sxXSwgdGV4dHNbJzEnXSlcclxuICAgICAgICAvL3RyYXBleml1bSBzMlxyXG4gICAgICAgIGNvbnN0IHQyID0gZ1xyXG4gICAgICAgICAgICAuYXBwZW5kKCdwb2x5Z29uJylcclxuICAgICAgICAgICAgLmF0dHIoXHJcbiAgICAgICAgICAgICAgICAncG9pbnRzJyxcclxuICAgICAgICAgICAgICAgIHcgK1xyXG4gICAgICAgICAgICAgICAgICAgICcsJyArXHJcbiAgICAgICAgICAgICAgICAgICAgaCArXHJcbiAgICAgICAgICAgICAgICAgICAgJyAnICtcclxuICAgICAgICAgICAgICAgICAgICAodyAqIDUpIC8gNiArXHJcbiAgICAgICAgICAgICAgICAgICAgJywnICtcclxuICAgICAgICAgICAgICAgICAgICAoMiAqIGgpIC8gMyArXHJcbiAgICAgICAgICAgICAgICAgICAgJyAnICtcclxuICAgICAgICAgICAgICAgICAgICB3IC8gMiArXHJcbiAgICAgICAgICAgICAgICAgICAgJywnICtcclxuICAgICAgICAgICAgICAgICAgICAoaCAqIDIpIC8gMyArXHJcbiAgICAgICAgICAgICAgICAgICAgJyAnICtcclxuICAgICAgICAgICAgICAgICAgICAodyAqIDIpIC8gMyArXHJcbiAgICAgICAgICAgICAgICAgICAgJywnICtcclxuICAgICAgICAgICAgICAgICAgICBoXHJcbiAgICAgICAgICAgIClcclxuICAgICAgICBzZXRBdHRyaWJ1dGVzKHQyLCBjbGFzc2lmaWVyLmNvbG9yc1syXSwgdGV4dHNbJzInXSlcclxuICAgICAgICAvL3RyaWFuZ2xlIHMwXHJcbiAgICAgICAgY29uc3QgdDBfID0gZ1xyXG4gICAgICAgICAgICAuYXBwZW5kKCdwb2x5Z29uJylcclxuICAgICAgICAgICAgLmF0dHIoXHJcbiAgICAgICAgICAgICAgICAncG9pbnRzJyxcclxuICAgICAgICAgICAgICAgIHcgLyAyICtcclxuICAgICAgICAgICAgICAgICAgICAnLCcgK1xyXG4gICAgICAgICAgICAgICAgICAgIChoICogMikgLyAzICtcclxuICAgICAgICAgICAgICAgICAgICAnICcgK1xyXG4gICAgICAgICAgICAgICAgICAgICh3ICogNSkgLyA2ICtcclxuICAgICAgICAgICAgICAgICAgICAnLCcgK1xyXG4gICAgICAgICAgICAgICAgICAgIChoICogMikgLyAzICtcclxuICAgICAgICAgICAgICAgICAgICAnICcgK1xyXG4gICAgICAgICAgICAgICAgICAgICh3ICogMikgLyAzICtcclxuICAgICAgICAgICAgICAgICAgICAnLCcgK1xyXG4gICAgICAgICAgICAgICAgICAgIGggLyAzXHJcbiAgICAgICAgICAgIClcclxuICAgICAgICBzZXRBdHRyaWJ1dGVzKHQwXywgY2xhc3NpZmllci5taXhDb2xvcnNbMF0sIHRleHRzWydtMTInXSlcclxuICAgICAgICAvL3RyaWFuZ2xlIHMxXHJcbiAgICAgICAgY29uc3QgdDFfID0gZ1xyXG4gICAgICAgICAgICAuYXBwZW5kKCdwb2x5Z29uJylcclxuICAgICAgICAgICAgLmF0dHIoJ3BvaW50cycsIHcgLyAyICsgJywnICsgKGggKiAyKSAvIDMgKyAnICcgKyB3IC8gMyArICcsJyArIGggKyAnICcgKyAodyAqIDIpIC8gMyArICcsJyArIGgpXHJcbiAgICAgICAgc2V0QXR0cmlidXRlcyh0MV8sIGNsYXNzaWZpZXIubWl4Q29sb3JzWzFdLCB0ZXh0c1snbTAyJ10pXHJcbiAgICAgICAgLy90cmlhbmdsZSBzMlxyXG4gICAgICAgIGNvbnN0IHQyXyA9IGdcclxuICAgICAgICAgICAgLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgIC5hdHRyKFxyXG4gICAgICAgICAgICAgICAgJ3BvaW50cycsXHJcbiAgICAgICAgICAgICAgICB3IC8gMiArICcsJyArIChoICogMikgLyAzICsgJyAnICsgdyAvIDYgKyAnLCcgKyAoaCAqIDIpIC8gMyArICcgJyArIHcgLyAzICsgJywnICsgaCAvIDNcclxuICAgICAgICAgICAgKVxyXG4gICAgICAgIHNldEF0dHJpYnV0ZXModDJfLCBjbGFzc2lmaWVyLm1peENvbG9yc1syXSwgdGV4dHNbJ20wMSddKVxyXG5cclxuICAgICAgICAvL2NlbnRlclxyXG4gICAgICAgIGlmICh0aGlzLmNlbnRlckNvZWZmaWNpZW50KSB7XHJcbiAgICAgICAgICAgIC8vVE9ETyBtYWtlIGl0IGFuIGhleGFnb24gIVxyXG4gICAgICAgICAgICBjb25zdCBjZW50ZXIgPSBnXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdjaXJjbGUnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2N4JywgdyAvIDIpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY3knLCAoaCAqIDIpIC8gMylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdyJywgKHRoaXMuY2VudGVyQ29lZmZpY2llbnQgKiBoKSAvIDMpXHJcbiAgICAgICAgICAgIHNldEF0dHJpYnV0ZXMoY2VudGVyLCBjbGFzc2lmaWVyLmNlbnRlckNvbG9yLCB0ZXh0c1snY2VudGVyJ10pXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvKlxyXG4gICAgICAgIGxldCBtaWRkbGUsIGxlZnQsIHRvcCwgcmlnaHQsIGxlZnRfLCBib3R0b21fLCByaWdodF9cclxuICAgICAgICBpZiAoIXRoaXMucmVhbCkge1xyXG5cclxuICAgICAgICAgICAgLy8wIGxlZnQgdHJpYW5nbGVcclxuICAgICAgICAgICAgbGVmdCA9IGcuYXBwZW5kKCdwb2x5Z29uJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdwb2ludHMnLCBcIjAsXCIgKyBoICsgXCIgXCIgKyAodyAvIDMpICsgXCIsXCIgKyBoICsgXCIgXCIgKyAodyAvIDYpICsgXCIsXCIgKyAoMiAqIGggLyAzKSlcclxuICAgICAgICAgICAgLy8xIHRvcCB0cmlhbmdsZVxyXG4gICAgICAgICAgICB0b3AgPSBnLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigncG9pbnRzJywgKHcgLyAzKSArIFwiLFwiICsgKGggLyAzKSArIFwiIFwiICsgKHcgKiAyIC8gMykgKyBcIixcIiArIChoIC8gMykgKyBcIiBcIiArICh3IC8gMikgKyBcIiwwXCIpXHJcbiAgICAgICAgICAgIC8vMiByaWdodCB0cmlhbmdsZVxyXG4gICAgICAgICAgICByaWdodCA9IGcuYXBwZW5kKCdwb2x5Z29uJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdwb2ludHMnLCAodyAqIDIgLyAzKSArIFwiLFwiICsgaCArIFwiIFwiICsgdyArIFwiLFwiICsgaCArIFwiIFwiICsgKHcgKiA1IC8gNikgKyBcIixcIiArICgyICogaCAvIDMpKVxyXG4gICAgICAgICAgICAvL21pZGRsZSB0cmlhbmdsZVxyXG4gICAgICAgICAgICBtaWRkbGUgPSBnLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigncG9pbnRzJywgKHcgLyAyKSArIFwiLFwiICsgKGggLyAzKSArIFwiIFwiICsgKHcgLyA0KSArIFwiLFwiICsgKGggKiA1IC8gNikgKyBcIiBcIiArICgzICogdyAvIDQpICsgXCIsXCIgKyAoaCAqIDUgLyA2KSlcclxuICAgICAgICAgICAgLy8wMSBsZWZ0IHRyYXBleml1bVxyXG4gICAgICAgICAgICBsZWZ0XyA9IGcuYXBwZW5kKCdwb2x5Z29uJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdwb2ludHMnLCAodyAvIDYpICsgXCIsXCIgKyAoaCAqIDIgLyAzKSArIFwiIFwiICsgKHcgLyA0KSArIFwiLFwiICsgKGggKiA1IC8gNikgKyBcIiBcIiArICh3IC8gMikgKyBcIixcIiArIChoIC8gMykgKyBcIiBcIiArICh3IC8gMykgKyBcIixcIiArIChoIC8gMykpXHJcbiAgICAgICAgICAgIC8vMDIgYm90dG9tIHRyYXBleml1bVxyXG4gICAgICAgICAgICBib3R0b21fID0gZy5hcHBlbmQoJ3BvbHlnb24nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3BvaW50cycsICh3IC8gMykgKyBcIixcIiArIChoKSArIFwiIFwiICsgKDIgKiB3IC8gMykgKyBcIixcIiArIChoKSArIFwiIFwiICsgKHcgKiAzIC8gNCkgKyBcIixcIiArIChoICogNSAvIDYpICsgXCIgXCIgKyAodyAvIDQpICsgXCIsXCIgKyAoaCAqIDUgLyA2KSlcclxuICAgICAgICAgICAgLy8xMiByaWdodCB0cmFwZXppdW1cclxuICAgICAgICAgICAgcmlnaHRfID0gZy5hcHBlbmQoJ3BvbHlnb24nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3BvaW50cycsICh3IC8gMikgKyBcIixcIiArIChoIC8gMykgKyBcIiBcIiArICh3ICogMyAvIDQpICsgXCIsXCIgKyAoaCAqIDUgLyA2KSArIFwiIFwiICsgKHcgKiA1IC8gNikgKyBcIixcIiArIChoICogMiAvIDMpICsgXCIgXCIgKyAodyAqIDIgLyAzKSArIFwiLFwiICsgKGggLyAzKSlcclxuXHJcbiAgICAgICAgfSBlbHNlIHtcclxuXHJcbiAgICAgICAgICAgIC8vbWlkZGxlIHRyaWFuZ2xlXHJcbiAgICAgICAgICAgIG1pZGRsZSA9IGcuYXBwZW5kKCdwb2x5Z29uJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdwb2ludHMnLCAodyAvIDIpICsgXCIsMCAwLFwiICsgaCArIFwiIFwiICsgdyArIFwiLFwiICsgaClcclxuXHJcbiAgICAgICAgICAgIC8vZHJhdyB0cmFwZXppdW1cclxuICAgICAgICAgICAgLy9kcmF3IGxhcmdlIHRyYXBleml1bSBmaXJzdFxyXG4gICAgICAgICAgICBmb3IgKGxldCBpXyA9IDI7IGlfID49IDA7IGlfLS0pIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGkgPSB0aGlzLmNsYXNzaWZpZXIubG93SW5kZXhbaV9dXHJcbiAgICAgICAgICAgICAgICBjb25zdCByID0gdGhpcy5jbGFzc2lmaWVyLmxvd1RocmVzaG9sZFtpXVxyXG4gICAgICAgICAgICAgICAgaWYgKGkgPT0gMilcclxuICAgICAgICAgICAgICAgICAgICAvLzAxIGxlZnQgdHJhcGV6aXVtXHJcbiAgICAgICAgICAgICAgICAgICAgbGVmdF8gPSBnLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdwb2ludHMnLCB3IC8gMiArIFwiLDAgMCxcIiArIGggKyBcIiBcIiArIHcgKiByICsgXCIsXCIgKyBoICsgXCIgXCIgKyB3ICogKDEgKyByKSAvIDIgKyBcIixcIiArIHIgKiBoKVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoaSA9PSAxKVxyXG4gICAgICAgICAgICAgICAgICAgIC8vMDIgYm90dG9tIHRyYXBleml1bVxyXG4gICAgICAgICAgICAgICAgICAgIGJvdHRvbV8gPSBnLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdwb2ludHMnLCBcIjAsXCIgKyBoICsgXCIgXCIgKyB3ICsgXCIsXCIgKyBoICsgXCIgXCIgKyB3ICogKDEgLSByIC8gMikgKyBcIixcIiArIGggKiAoMSAtIHIpICsgXCIgXCIgKyByICogdyAvIDIgKyBcIixcIiArIGggKiAoMSAtIHIpKVxyXG4gICAgICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICAgICAgICAgIC8vMTIgcmlnaHQgdHJhcGV6aXVtXHJcbiAgICAgICAgICAgICAgICAgICAgcmlnaHRfID0gZy5hcHBlbmQoJ3BvbHlnb24nKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigncG9pbnRzJywgdyArIFwiLFwiICsgaCArIFwiIFwiICsgdyAvIDIgKyBcIiwwIFwiICsgdyAqICgxIC0gcikgLyAyICsgXCIsXCIgKyBoICogciArIFwiIFwiICsgdyAqICgxIC0gcikgKyBcIixcIiArIGgpXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vZHJhdyB0cmlhbmdsZXNcclxuICAgICAgICAgICAgLy9kcmF3IGxhcmdlIHRyaWFuZ2xlcyBmaXJzdFxyXG4gICAgICAgICAgICBmb3IgKGxldCBpXyA9IDI7IGlfID49IDA7IGlfLS0pIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGkgPSB0aGlzLmNsYXNzaWZpZXIuaGlnaEluZGV4W2lfXVxyXG4gICAgICAgICAgICAgICAgY29uc3QgciA9IHRoaXMuY2xhc3NpZmllci5oaWdoVGhyZXNob2xkW2ldXHJcblxyXG4gICAgICAgICAgICAgICAgaWYgKGkgPT0gMilcclxuICAgICAgICAgICAgICAgICAgICAvLzIgcmlnaHQgdHJpYW5nbGVcclxuICAgICAgICAgICAgICAgICAgICByaWdodCA9IGcuYXBwZW5kKCdwb2x5Z29uJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3BvaW50cycsIHcgKyBcIixcIiArIGggKyBcIiBcIiArIHcgKiByICsgXCIsXCIgKyBoICsgXCIgXCIgKyB3ICogKDEgKyByKSAvIDIgKyBcIixcIiArIGggKiByKVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoaSA9PSAxKVxyXG4gICAgICAgICAgICAgICAgICAgIC8vMSB0b3AgdHJpYW5nbGVcclxuICAgICAgICAgICAgICAgICAgICB0b3AgPSBnLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdwb2ludHMnLCAodyAvIDIpICsgXCIsMCBcIiArIHcgKiByIC8gMiArIFwiLFwiICsgaCAqICgxIC0gcikgKyBcIiBcIiArIHcgKiAoMSAtIHIgLyAyKSArIFwiLFwiICsgaCAqICgxIC0gcikpXHJcbiAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgLy8wIGxlZnQgdHJpYW5nbGVcclxuICAgICAgICAgICAgICAgICAgICBsZWZ0ID0gZy5hcHBlbmQoJ3BvbHlnb24nKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigncG9pbnRzJywgXCIwLFwiICsgaCArIFwiIFwiICsgdyAqICgxIC0gcikgKyBcIixcIiArIGggKyBcIiBcIiArIHcgKiAoMSAtIHIpIC8gMiArIFwiLFwiICsgaCAqIHIpXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgfSovXHJcbiAgICB9XHJcbn1cclxuIiwiLy9AdHMtY2hlY2tcclxuJ3VzZSBzdHJpY3QnXHJcblxyXG5pbXBvcnQgeyBTdHlsZSB9IGZyb20gJy4uL2NvcmUvU3R5bGUuanMnXHJcblxyXG4vKiogQHR5cGVkZWYge1wiZmxhZ1wifFwicGllY2hhcnRcInxcInJpbmdcInxcInNlZ21lbnRcInxcInJhZGFyXCJ8XCJhZ2VweXJhbWlkXCJ8XCJoYWxmdG9uZVwifSBDb21wb3NpdGlvblR5cGUgKi9cclxuXHJcbi8qKlxyXG4gKiBBIHN0eWxlIHNob3dpbmcgdGhlIGNvbXBvc2l0aW9uIG9mIGEgdG90YWwgaW4gZGlmZmVyZW50IGNhdGVnb3JpZXMsIHdpdGggZGlmZmVyZW50IGNvbG9yIGh1ZXMuXHJcbiA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uICAgICAgICAgICAgLy9zaXplXHJcbiAgICAgICAgICAgIGNvbnN0IHNHID0gdGhpcy5zaXplID8gdGhpcy5zaXplKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiByZXNvbHV0aW9uXHJcbiAgICAgICAgICAgIGlmICghc0cpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL2dldCBvZmZzZXRcclxuICAgICAgICAgICAgY29uc3Qgb2Zmc2V0ID0gdGhpcy5vZmZzZXQoY2VsbCwgcmVzb2x1dGlvbiwgeilcclxuXHJcbiAgICAgICAgICAgIC8vZ2V0IHN5bWJvbCB0eXBlXHJcbiAgICAgICAgICAgIGNvbnN0IHR5cGVfID0gdGhpcy50eXBlID8gdGhpcy50eXBlKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiAnZmxhZydcclxuXHJcbiAgICAgICAgICAgIC8vY29tcHV0ZSBjZW50ZXIgcG9zaXRpb25cclxuICAgICAgICAgICAgY29uc3QgeGMgPSBjZWxsLnggKyBvZmZzZXQuZHggKyAodHlwZV8gPT09ICdhZ2VweXJhbWlkJyA/IDAgOiByZXNvbHV0aW9uICogMC41KVxyXG4gICAgICAgICAgICBjb25zdCB5YyA9IGNlbGwueSArIG9mZnNldC5keSArICh0eXBlXyA9PT0gJ2FnZXB5cmFtaWQnID8gMCA6IHJlc29sdXRpb24gKiAwLjUpXHJcblxyXG4gICAgICAgICAgICAvL2NvbXB1dGUgb2Zmc2V0IGFuZ2xlLCB3aGVuIHJlbGV2YW50XHJcbiAgICAgICAgICAgIGNvbnN0IG9mZkFuZyA9IHRoaXMub2Zmc2V0QW5nbGVcclxuICAgICAgICAgICAgICAgID8gKHRoaXMub2Zmc2V0QW5nbGUoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSAqIE1hdGguUEkpIC8gMTgwXHJcbiAgICAgICAgICAgICAgICA6IDBcclxuXHJcbiAgICAgICAgICAgIGlmICh0eXBlXyA9PT0gJ2FnZXB5cmFtaWQnIHx8IHR5cGVfID09PSAncmFkYXInIHx8IHR5cGVfID09PSAnaGFsZnRvbmUnKSB7XHJcbiAgICAgICAgICAgICAgICAvL2dldCBjZWxsIGNhdGVnb3J5IG1heCB2YWx1ZVxyXG4gICAgICAgICAgICAgICAgbGV0IG1heFZhbCA9IC1JbmZpbml0eVxyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQga2V5IG9mIE9iamVjdC5rZXlzKHRoaXMuY29sb3IpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdiA9ICtjZWxsW2tleV1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodiA+IG1heFZhbCkgbWF4VmFsID0gdlxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIC8vY3VtdWxcclxuICAgICAgICAgICAgICAgIGxldCBjdW11bCA9IDBcclxuICAgICAgICAgICAgICAgIGlmICh0eXBlXyA9PT0gJ2FnZXB5cmFtaWQnICYmIHRoaXMuYWdlUHlyYW1pZEhlaWdodClcclxuICAgICAgICAgICAgICAgICAgICBjdW11bCA9IChyZXNvbHV0aW9uIC0gdGhpcy5hZ2VQeXJhbWlkSGVpZ2h0KGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkpIC8gMlxyXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVfID09PSAncmFkYXInIHx8IHR5cGVfID09PSAnaGFsZnRvbmUnKSBjdW11bCA9IE1hdGguUEkgLyAyICsgb2ZmQW5nXHJcblxyXG4gICAgICAgICAgICAgICAgLy9jb21wdXRlIHRoZSBpbmNyZW1lbnQsIHdoaWNoIGlzIHRoZSB2YWx1ZSB0byBpbmNyZW1lbnQgdGhlIGN1bXVsIGZvciBlYWNoIGNhdGVnb3J5XHJcbiAgICAgICAgICAgICAgICBjb25zdCBpbmNyID1cclxuICAgICAgICAgICAgICAgICAgICB0eXBlXyA9PT0gJ2FnZXB5cmFtaWQnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgID8gKHRoaXMuYWdlUHlyYW1pZEhlaWdodFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRoaXMuYWdlUHlyYW1pZEhlaWdodChjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogcmVzb2x1dGlvbikgLyBuYkNhdFxyXG4gICAgICAgICAgICAgICAgICAgICAgICA6IHR5cGVfID09PSAncmFkYXInIHx8IHR5cGVfID09PSAnaGFsZnRvbmUnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgID8gKDIgKiBNYXRoLlBJKSAvIG5iQ2F0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgICAgICBpZiAoaW5jciA9PT0gdW5kZWZpbmVkKSB0aHJvdyBuZXcgRXJyb3IoJ1VuZXhwZWN0ZWQgc3ltYm9sIHR5cGU6JyArIHR5cGVfKVxyXG5cclxuICAgICAgICAgICAgICAgIGZvciAobGV0IFtjb2x1bW4sIGNvbG9yXSBvZiBPYmplY3QuZW50cmllcyh0aGlzLmNvbG9yKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlXyA9PT0gJ2FnZXB5cmFtaWQnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vc2V0IGNhdGVnb3J5IGNvbG9yXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsU3R5bGUgPSBjb2xvclxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9nZXQgY2F0ZWdvcnkgdmFsdWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsID0gY2VsbFtjb2x1bW5dXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2NvbXB1dGUgY2F0ZWdvcnkgbGVuZ3RoIC0gaW4gZ2VvXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfSAqL1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB3RyA9IChzRyAqIHZhbCkgLyBtYXhWYWxcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZHJhdyBiYXJcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmZpbGxSZWN0KHhjICsgKHJlc29sdXRpb24gLSB3RykgLyAyLCB5YyArIGN1bXVsLCB3RywgaW5jcilcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbmV4dCBoZWlnaHRcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3VtdWwgKz0gaW5jclxyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZV8gPT09ICdyYWRhcicpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9zZXQgY2F0ZWdvcnkgY29sb3JcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IGNvbG9yXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2dldCBjYXRlZ3JveSB2YWx1ZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2YWwgPSBjZWxsW2NvbHVtbl1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vY29tcHV0ZSBjYXRlZ29yeSByYWRpdXMgLSBpbiBnZW9cclxuICAgICAgICAgICAgICAgICAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ9ICovXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vY29uc3QgckcgPSB0aGlzLnJhZGl1cyh2YWwsIHIsIHN0YXQsIGNlbGxTdGF0LCB6KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCByRyA9IChzRyAvIDIpICogTWF0aC5zcXJ0KHZhbCAvIG1heFZhbClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZHJhdyBhbmd1bGFyIHNlY3RvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyh4YywgeWMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5hcmMoeGMsIHljLCByRywgY3VtdWwgLSBpbmNyLCBjdW11bClcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmxpbmVUbyh4YywgeWMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbmV4dCBhbmd1bGFyIHNlY3RvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdW11bCArPSBpbmNyXHJcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlXyA9PT0gJ2hhbGZ0b25lJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3NldCBjYXRlZ29yeSBjb2xvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gY29sb3JcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZ2V0IGNhdGVncm95IHZhbHVlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9IGNlbGxbY29sdW1uXVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9jb21wdXRlIGNhdGVnb3J5IHJhZGl1cyAtIGluIGdlb1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvKiogQHR5cGUge251bWJlcn0gKi9cclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgckcgPSBzRyAqIDAuMzMzICogTWF0aC5zcXJ0KHZhbCAvIG1heFZhbClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZHJhdyBjaXJjbGVcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5hcmMoXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB4YyArIHJlc29sdXRpb24gKiAwLjI1ICogTWF0aC5jb3MoY3VtdWwpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeWMgKyByZXNvbHV0aW9uICogMC4yNSAqIE1hdGguc2luKGN1bXVsKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJHLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgKiBNYXRoLlBJXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmZpbGwoKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9uZXh0IGFuZ3VsYXIgc2VjdG9yXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1bXVsICs9IGluY3JcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1VuZXhwZWN0ZWQgc3ltYm9sIHR5cGU6JyArIHR5cGVfKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vY29tcHV0ZSB0b3RhbFxyXG4gICAgICAgICAgICAgICAgbGV0IHRvdGFsID0gMFxyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgY29sdW1uIG9mIE9iamVjdC5rZXlzKHRoaXMuY29sb3IpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdiA9ICtjZWxsW2NvbHVtbl1cclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXYpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICAgICAgdG90YWwgKz0gdlxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKCF0b3RhbCB8fCBpc05hTih0b3RhbCkpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAgICAgLy9kcmF3IGRlY29tcG9zaXRpb24gc3ltYm9sXHJcbiAgICAgICAgICAgICAgICBsZXQgY3VtdWwgPSAwXHJcbiAgICAgICAgICAgICAgICBjb25zdCBkID0gcmVzb2x1dGlvbiAqICgxIC0gc0cgLyByZXNvbHV0aW9uKSAqIDAuNVxyXG4gICAgICAgICAgICAgICAgY29uc3Qgb3JpID0gdGhpcy5zdHJpcGVzT3JpZW50YXRpb24oY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKVxyXG5cclxuICAgICAgICAgICAgICAgIGZvciAobGV0IFtjb2x1bW4sIGNvbG9yXSBvZiBPYmplY3QuZW50cmllcyh0aGlzLmNvbG9yKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vZ2V0IHNoYXJlXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2hhcmUgPSBjZWxsW2NvbHVtbl0gLyB0b3RhbFxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghc2hhcmUgfHwgaXNOYU4oc2hhcmUpKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAvL3NldCBjb2xvclxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5maWxsU3R5bGUgPSBjb2xvclxyXG5cclxuICAgICAgICAgICAgICAgICAgICAvL2RyYXcgc3ltYm9sIHBhcnRcclxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZV8gPT09ICdmbGFnJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2RyYXcgZmxhZyBzdHJpcGVcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9yaSA9PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2hvcml6b250YWxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsUmVjdChcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZWxsLnggKyBkICsgb2Zmc2V0LmR4LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbGwueSArIGQgKyBjdW11bCAqIHNHICsgb2Zmc2V0LmR5LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNHLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoYXJlICogc0dcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmVydGljYWxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsUmVjdChcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZWxsLnggKyBkICsgY3VtdWwgKiBzRyArIG9mZnNldC5keCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZWxsLnkgKyBkICsgb2Zmc2V0LmR5LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoYXJlICogc0csXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc0dcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZV8gPT09ICdwaWVjaGFydCcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9kcmF3IHBpZSBjaGFydCBhbmd1bGFyIHNlY3RvclxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9jb21wdXRlIGFuZ2xlc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBhMSA9IGN1bXVsICogMiAqIE1hdGguUElcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYTIgPSAoY3VtdWwgKyBzaGFyZSkgKiAyICogTWF0aC5QSVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9kcmF3XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdHgubW92ZVRvKHhjLCB5YylcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmFyYyh4YywgeWMsIHNHICogMC41LCBhMSArIG9mZkFuZywgYTIgKyBvZmZBbmcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnBpZUNoYXJ0SW50ZXJuYWxSYWRpdXNGYWN0b3IpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdHguYXJjKFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhjLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHljLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNHICogMC41ICogdGhpcy5waWVDaGFydEludGVybmFsUmFkaXVzRmFjdG9yLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGExICsgb2ZmQW5nLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEyICsgb2ZmQW5nLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmNsb3NlUGF0aCgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVfID09PSAncmluZycpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9kcmF3IHJpbmdcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5hcmMoeGMsIHljLCBNYXRoLnNxcnQoMSAtIGN1bXVsKSAqIHNHICogMC41LCAwLCAyICogTWF0aC5QSSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmZpbGwoKVxyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZV8gPT09ICdzZWdtZW50Jykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2RyYXcgc2VnbWVudCBzZWN0aW9uc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB3RyA9IChzRyAqIHNHKSAvIHJlc29sdXRpb25cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9yaSA9PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2hvcml6b250YWxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsUmVjdChcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZWxsLnggKyBvZmZzZXQuZHgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VsbC55ICsgKHJlc29sdXRpb24gLSB3RykgLyAyICsgY3VtdWwgKiB3RyArIG9mZnNldC5keSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHV0aW9uLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoYXJlICogd0dcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmVydGljYWxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsUmVjdChcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZWxsLnggKyBjdW11bCAqIHJlc29sdXRpb24gKyBvZmZzZXQuZHgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VsbC55ICsgKHJlc29sdXRpb24gLSB3RykgLyAyICsgb2Zmc2V0LmR5LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoYXJlICogcmVzb2x1dGlvbixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3R1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdVbmV4cGVjdGVkIHN5bWJvbCB0eXBlOicgKyB0eXBlXylcclxuICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgIGN1bXVsICs9IHNoYXJlXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vdXBkYXRlIGxlZ2VuZHNcclxuICAgICAgICB0aGlzLnVwZGF0ZUxlZ2VuZHMoeyBzdHlsZTogdGhpcywgcmVzb2x1dGlvbjogcmVzb2x1dGlvbiwgejogeiwgdmlld1NjYWxlOiB2aWV3U2NhbGUgfSlcclxuICAgIH1cclxufVxyXG4iLCIvL0B0cy1jaGVja1xyXG4ndXNlIHN0cmljdCdcclxuXHJcbmltcG9ydCB7IFN0eWxlIH0gZnJvbSAnLi4vY29yZS9TdHlsZS5qcydcclxuaW1wb3J0IHsgcmFuZG9tTm9ybWFsIH0gZnJvbSAnZDMtcmFuZG9tJ1xyXG5pbXBvcnQgeyBjaGVja1dlYkdMU3VwcG9ydCwgbWFrZVdlYkdMQ2FudmFzIH0gZnJvbSAnLi4vdXRpbHMvd2ViR0xVdGlscy5qcydcclxuaW1wb3J0IHsgV2ViR0xTcXVhcmVDb2xvcmluZyB9IGZyb20gJy4uL3V0aWxzL1dlYkdMU3F1YXJlQ29sb3JpbmcuanMnXHJcbmltcG9ydCB7IGNvbG9yIH0gZnJvbSAnZDMtY29sb3InXHJcblxyXG4vKipccl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9ncmFtXHJcbiAgICAgICAgICAgIGNvbnN0IHByb2cgPSBuZXcgV2ViR0xTcXVhcmVDb2xvcmluZyhjdldHTC5nbCwgc0dlbyAvIHopXHJcblxyXG4gICAgICAgICAgICBjb25zdCByMiA9IHJlc29sdXRpb24gLyAyXHJcblxyXG4gICAgICAgICAgICBmb3IgKGxldCBjZWxsIG9mIGNlbGxzKSB7XHJcbiAgICAgICAgICAgICAgICAvL2dldCBjb2xvclxyXG4gICAgICAgICAgICAgICAgY29uc3QgY29sID0gdGhpcy5jb2xvcihjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpXHJcbiAgICAgICAgICAgICAgICBpZiAoIWNvbCB8fCBjb2wgPT09ICdub25lJykgY29udGludWVcclxuXHJcbiAgICAgICAgICAgICAgICAvL251bWJlciBvZiBkb3RzXHJcbiAgICAgICAgICAgICAgICBjb25zdCBkb3ROdW1iZXIgPSB0aGlzLmRvdE51bWJlcihjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpXHJcblxyXG4gICAgICAgICAgICAgICAgLy9nZXQgb2Zmc2V0XHJcbiAgICAgICAgICAgICAgICBjb25zdCBvZmZzZXQgPSB0aGlzLm9mZnNldChjZWxsLCByZXNvbHV0aW9uLCB6KVxyXG5cclxuICAgICAgICAgICAgICAgIC8vY2VsbCBjZW50ZXJcclxuICAgICAgICAgICAgICAgIGNvbnN0IGN4ID0gY2VsbC54ICsgb2Zmc2V0LmR4ICsgcjJcclxuICAgICAgICAgICAgICAgIGNvbnN0IGN5ID0gY2VsbC55ICsgb2Zmc2V0LmR5ICsgcjJcclxuXHJcbiAgICAgICAgICAgICAgICAvL2NvbnZlcnQgY29sb3JcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNjID0gY29sb3IoY29sKVxyXG4gICAgICAgICAgICAgICAgaWYgKCFjYykgcmV0dXJuXHJcblxyXG4gICAgICAgICAgICAgICAgLy9yYW5kb20gcG9pbnRzXHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8PSBkb3ROdW1iZXI7IGkrKylcclxuICAgICAgICAgICAgICAgICAgICBwcm9nLmFkZFBvaW50RGF0YTIoY3ggKyByYW5kKCksIGN5ICsgcmFuZCgpLCBjYy5yLCBjYy5nLCBjYy5iLCBjYy5vcGFjaXR5KVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvL2RyYXdcclxuICAgICAgICAgICAgcHJvZy5kcmF3KGdlb0NhbnZhcy5nZXRXZWJHTFRyYW5zZm9ybSgpKVxyXG5cclxuICAgICAgICAgICAgLy9kcmF3IGluIGNhbnZhcyBnZW9cclxuICAgICAgICAgICAgZ2VvQ2FudmFzLmluaXRDYW52YXNUcmFuc2Zvcm0oKVxyXG4gICAgICAgICAgICBjdHguZHJhd0ltYWdlKGN2V0dMLmNhbnZhcywgMCwgMClcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBjZWxsIG9mIGNlbGxzKSB7XHJcbiAgICAgICAgICAgICAgICAvL2dldCBjb2xvclxyXG4gICAgICAgICAgICAgICAgY29uc3QgY29sID0gdGhpcy5jb2xvcihjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpXHJcbiAgICAgICAgICAgICAgICBpZiAoIWNvbCB8fCBjb2wgPT09ICdub25lJykgY29udGludWVcclxuICAgICAgICAgICAgICAgIC8vc2V0IGNvbG9yXHJcbiAgICAgICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gY29sXHJcblxyXG4gICAgICAgICAgICAgICAgLy9udW1iZXIgb2YgZG90c1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZG90TnVtYmVyID0gdGhpcy5kb3ROdW1iZXIoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKVxyXG5cclxuICAgICAgICAgICAgICAgIC8vZ2V0IG9mZnNldFxyXG4gICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2V0ID0gdGhp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AgICogQG92ZXJyaWRlXHJcbiAgICAgKi9cclxuICAgIGFzeW5jIGRyYXcoY2VsbHMsIGdlb0NhbnZhcywgcmVzb2x1dGlvbikge1xyXG4gICAgICAgIC8vXHJcbiAgICAgICAgY29uc3QgeiA9IGdlb0NhbnZhcy52aWV3LnosXHJcbiAgICAgICAgICAgIHJlc29sdXRpb25QaXggPSByZXNvbHV0aW9uIC8gelxyXG5cclxuICAgICAgICAvL2dldCB2aWV3IHNjYWxlXHJcbiAgICAgICAgY29uc3Qgdmlld1NjYWxlID0gdGhpcy52aWV3U2NhbGUgPyB0aGlzLnZpZXdTY2FsZShjZWxscywgcmVzb2x1dGlvbiwgeikgOiB1bmRlZmluZWRcclxuXHJcbiAgICAgICAgLy9kcmF3IGluIHNjcmVlbiBjb29yZGluYXRlc1xyXG4gICAgICAgIGdlb0NhbnZhcy5pbml0Q2FudmFzVHJhbnNmb3JtKClcclxuXHJcbiAgICAgICAgLy9cclxuICAgICAgICBmb3IgKGxldCBjZWxsIG9mIGNlbGxzKSB7XHJcbiAgICAgICAgICAgIC8vZ2V0IGNlbGwgaW1hZ2UgdXJsXHJcbiAgICAgICAgICAgIGNvbnN0IHVybCA9IHRoaXMuaW1hZ2UoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKVxyXG4gICAgICAgICAgICBpZiAoIXVybCkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vc2l6ZSBhbmQgcG9zaXRpb24gdmFsdWVzXHJcbiAgICAgICAgICAgIGxldCBzaXplUGl4ID0gdGhpcy5zaXplKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgLyB6XHJcbiAgICAgICAgICAgIGlmICghc2l6ZVBpeCkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vZ2V0IGltYWdlIGZyb20gY2FjaGVcclxuICAgICAgICAgICAgY29uc3QgaW1hZ2UgPSB0aGlzLmNhY2hlW3VybF1cclxuXHJcbiAgICAgICAgICAgIC8vbG9hZGluZywga2VlcCB3YWl0aW5nXHJcbiAgICAgICAgICAgIGlmIChpbWFnZSA9PSAnbG9hZGluZycpIHJldHVyblxyXG4gICAgICAgICAgICAvL25vIGltYWdlOiBsb2FkIGl0XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKCFpbWFnZSkge1xyXG4gICAgICAgICAgICAgICAgLy90YWcgYXMgbG9hZGluZ1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jYWNoZVt1cmxdID0gJ2xvYWRpbmcnXHJcblxyXG4gICAgICAgICAgICAgICAgLy9kZWZpbmUgaW1hZ2VcclxuICAgICAgICAgICAgICAgIGNvbnN0IGltZyA9IG5ldyBJbWFnZSgpXHJcbiAgICAgICAgICAgICAgICBpbWcub25sb2FkID0gKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vc3RvcmUgaW1hZ2UgZGF0YSBpbiBjYWNoZSBhbmQgcmVkcmF3XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jYWNoZVt1cmxdID0gaW1nXHJcbiAgICAgICAgICAgICAgICAgICAgZ2VvQ2FudmFzLnJlZHJhdygpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpbWcub25lcnJvciA9ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAvL2Nhc2Ugd2hlbiBubyBpbWFnZVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybignQ291bGQgbm90IHJldHJpZXZlIGltYWdlIGZyb20nLCB1cmwpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvL3NldCBVUkwgdG8gbGF1bmNoIHRoZSBkb3dubG9hZFxyXG4gICAgICAgICAgICAgICAgaW1nLnNyYyA9IHVybFxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy9kcmF3IGltYWdlXHJcbiAgICAgICAgICAgICAgICBjb25zdCBkID0gKHJlc29sdXRpb25QaXggLSBzaXplUGl4KSAvIDJcclxuICAgICAgICAgICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZ2VvQ2FudmFzLm9mZnNjcmVlbkN0eC5kcmF3SW1hZ2UoXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBnZW9DYW52YXMuZ2VvVG9QaXhYKGNlbGwueCkgKyBkLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBnZW9DYW52YXMuZ2VvVG9QaXhZKGNlbGwueSkgKyBkIC0gcmVzb2x1dGlvblBpeCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZVBpeCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZVBpeFxyXG4gICAgICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihlcnJvcilcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy91cGRhdGUgbGVnZW5kc1xyXG4gICAgICAgIHRoaXMudXBkYXRlTGVnZW5kcyh7IHN0eWxlOiB0aGlzLCByZXNvbHV0aW9uOiByZXNvbHV0aW9uLCB6OiB6LCB2aWV3U2NhbGU6IHZpZXdTY2FsZSB9KVxyXG4gICAgfVxyXG59XHJcbiIsIi8vQHRzLWNoZWNrXHJcbid1c2Ugc3RyaWN0J1xyXG5cclxuaW1wb3J0IHsgU3R5bGUgfSBmcm9tICcuLi9jb3JlL1N0eWxlLmpzJ1xyXG5pbXBvcnQgeyBTaWRlU3R5bGUgfSBmcm9tICcuL1NpZGVTdHlsZS5qcydcclxuXHJcbi8qKiBAdHlwZWRlZiB7e3g6bnVtYmVyLHk6bnVtYmVyLG9yOlwidlwifFwiaFwiLGMxOmltcG9ydCgnLi4vY29yZS9EYXRhc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yXHJcbiAgICAgICAgICAgICAgICA/IHRoaXMuY29ybmVyTGluZVN0cm9rZUNvbG9yKGNlbGwsIHJlc29sdXRpb24sIHosIHRoaXMuYW5nbGUpXHJcbiAgICAgICAgICAgICAgICA6ICcjMzMzJ1xyXG4gICAgICAgICAgICBjdHgubGluZVdpZHRoID0gbHdcclxuXHJcbiAgICAgICAgICAgIC8vaGVpZ2h0IC0gaW4gZ2VvXHJcbiAgICAgICAgICAgIGNvbnN0IGhHID0gdGhpcy5oZWlnaHQoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKVxyXG5cclxuICAgICAgICAgICAgLy9kcmF3IGxpbmVcclxuICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgIGN0eC5tb3ZlVG8oY2VsbC54ICsgcjIgKyBkeCwgY2VsbC55ICsgcjIgKyBkeSlcclxuICAgICAgICAgICAgY3R4LmxpbmVUbyhjZWxsLnggKyByMiArIGhHICogY29zICsgZHgsIGNlbGwueSArIHIyICsgaEcgKiBzaW4gKyBkeSlcclxuICAgICAgICAgICAgY3R4LnN0cm9rZSgpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2RyYXcgc2lkZXNcclxuICAgICAgICBjdHgubGluZUNhcCA9ICdyb3VuZCdcclxuICAgICAgICBmb3IgKGxldCBzaWRlIG9mIHNpZGVzKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGMxID0gc2lkZS5jMSxcclxuICAgICAgICAgICAgICAgIGMyID0gc2lkZS5jMixcclxuICAgICAgICAgICAgICAgIHggPSBzaWRlLngsXHJcbiAgICAgICAgICAgICAgICB5ID0gc2lkZS55XHJcblxyXG4gICAgICAgICAgICAvL2hlaWdodHMgLSBpbiBnZW9cclxuICAgICAgICAgICAgY29uc3QgaEcxID0gYzEgPyB0aGlzLmhlaWdodChjMSwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IDAsXHJcbiAgICAgICAgICAgICAgICBoRzIgPSBjMiA/IHRoaXMuaGVpZ2h0KGMyLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogMFxyXG5cclxuICAgICAgICAgICAgLy9jb21wdXRlIHRvdGFscyBmb3IgYm90aCBjZWxsc1xyXG4gICAgICAgICAgICBjb25zdCB0b3RhbDEgPSBjb21wdXRlVG90YWwoYzEsIGNhdHMpLFxyXG4gICAgICAgICAgICAgICAgdG90YWwyID0gY29tcHV0ZVRvdGFsKGMyLCBjYXRzKVxyXG4gICAgICAgICAgICBpZiAodG90YWwxID09IDAgJiYgdG90YWwyID09IDApIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICBsZXQgY3VtdWwxID0gMCxcclxuICAgICAgICAgICAgICAgIGN1bXVsMiA9IDBcclxuICAgICAgICAgICAgZm9yIChsZXQgW2NvbHVtbiwgY29sb3JdIG9mIE9iamVjdC5lbnRyaWVzKHRoaXMuY29sb3IpKSB7XHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgc3RyaXBlIG9mIHNpZGUgcyBhbmQgY2F0ZWdvcnkgY29sdW1uXHJcblxyXG4gICAgICAgICAgICAgICAgLy9nZXQgdmFsdWVzIGZvciBib3RoIGNlbGxzXHJcbiAgICAgICAgICAgICAgICBsZXQgdjEgPSBjMSA/ICtjMVtjb2x1bW5dIDogMFxyXG4gICAgICAgICAgICAgICAgbGV0IHYyID0gYzIgPyArYzJbY29sdW1uXSA6IDBcclxuICAgICAgICAgICAgICAgIGlmICh2MSA9PSAwICYmIHYyID09IDApIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAgICAgLy9jb21wdXRlIGhlaWdodHNcclxuICAgICAgICAgICAgICAgIGNvbnN0IGgxID0gKGhHMSAqIGN1bXVsMSkgLyB0b3RhbDEgfHwgMFxyXG4gICAgICAgICAgICAgICAgY29uc3QgaDFuID0gKGhHMSAqIChjdW11bDEgKyB2MSkpIC8gdG90YWwxIHx8IDBcclxuICAgICAgICAgICAgICAgIGNvbnN0IGgyID0gKGhHMiAqIGN1bXVsMikgLyB0b3RhbDIgfHwgMFxyXG4gICAgICAgICAgICAgICAgY29uc3QgaDJuID0gKGhHMiAqIChjdW11bDIgKyB2MikpIC8gdG90YWwyIHx8IDBcclxuXHJcbiAgICAgICAgICAgICAgICAvL21ha2UgcGF0aFxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBpZiAoc2lkZS5vciA9PSAnaCcpIHtcclxuICAgICAgICAgICAgICAgICAgICAvL2hvcml6b250YWwgc2lkZSAtIHZlcnRpY2FsIHNlY3Rpb25cclxuICAgICAgICAgICAgICAgICAgICAvL2JvdHRvbSBsZWZ0XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyh4ICsgaDEgKiBjb3MgKyBkeCwgeSAtIHIyICsgaDEgKiBzaW4gKyBkeSlcclxuICAgICAgICAgICAgICAgICAgICAvL3RvcCBsZWZ0XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmxpbmVUbyh4ICsgaDIgKiBjb3MgKyBkeCwgeSArIHIyICsgaDIgKiBzaW4gKyBkeSlcclxuICAgICAgICAgICAgICAgICAgICAvL3RvcCByaWdodFxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oeCArIGgybiAqIGNvcyArIGR4LCB5ICsgcjIgKyBoMm4gKiBzaW4gKyBkeSlcclxuICAgICAgICAgICAgICAgICAgICAvL2JvdHRvbSByaWdodFxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oeCArIGgxbiAqIGNvcyArIGR4LCB5IC0gcjIgKyBoMW4gKiBzaW4gKyBkeSlcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy92ZXJ0aWNhbCBzaWRlIC0gaG9yaXpvbnRhbCBzZWN0aW9uXHJcbiAgICAgICAgICAgICAgICAgICAgLy9ib3R0b20gbGVmdFxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oeCAtIHIyICsgaDEgKiBjb3MgKyBkeCwgeSArIGgxICogc2luICsgZHkpXHJcbiAgICAgICAgICAgICAgICAgICAgLy9ib3R0b20gcmlnaHRcclxuICAgICAgICAgICAgICAgICAgICBjdHgubGluZVRvKHggKyByMiArIGgyICogY29zICsgZHgsIHkgKyBoMiAqIHNpbiArIGR5KVxyXG4gICAgICAgICAgICAgICAgICAgIC8vdG9wIHJpZ2h0XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmxpbmVUbyh4ICsgcjIgKyBoMm4gKiBjb3MgKyBkeCwgeSArIGgybiAqIHNpbiArIGR5KVxyXG4gICAgICAgICAgICAgICAgICAgIC8vdG9wIGxlZnRcclxuICAgICAgICAgICAgICAgICAgICBjdHgubGluZVRvKHggLSByMiArIGgxbiAqIGNvcyArIGR4LCB5ICsgaDFuICogc2luICsgZHkpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvL2NnLmN0eC5jbG9zZVBhdGgoKVxyXG5cclxuICAgICAgICAgICAgICAgIC8vZmlsbFxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IGNvbG9yXHJcbiAgICAgICAgICAgICAgICBjdHguZmlsbCgpXHJcblxyXG4gICAgICAgICAgICAgICAgY3VtdWwxICs9IHYxXHJcbiAgICAgICAgICAgICAgICBjdW11bDIgKz0gdjJcclxuXHJcbiAgICAgICAgICAgICAgICAvL1RPRE8gZHJhdyBvbmx5IG9uZSBsaW5lXHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgY29ybmVyIGxpbmVcclxuICAgICAgICAgICAgICAgIC8vaWYgKHNpZGUub3IgPT0gXCJoXCIpIHtcclxuICAgICAgICAgICAgICAgIGRyYXdDb3JuZXJMaW5lKGMxKVxyXG4gICAgICAgICAgICAgICAgZHJhd0Nvcm5lckxpbmUoYzIpXHJcbiAgICAgICAgICAgICAgICAvL2lmICh0aGlzLmF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xyXG5cclxuICAgIC8qKlxyXG4gICAgICogQHBhcmFtIHtBcnJheS48aW1wb3J0KFwiLi4vY29yZS9EYXRhc2V0LmpzXCIpLkNlbGw+fSBjZWxsc1xyXG4gICAgICogQHBhcmFtIHtpbXBvcnQoXCIuLi9jb3JlL0dlb0NhbnZhcy5qc1wiKS5HZW9DYW52YXN9IGdlb0NhbnZhc1xyXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IHJlc29sdXRpb25cclxuICAgICAqIEBvdmVycmlkZVxyXG4gICAgICovXHJcbiAgICBkcmF3KGNlbGxzLCBnZW9DYW52YXMsIHJlc29sdXRpb24pIHtcclxuICAgICAgICAvL2ZpbHRlclxyXG4gICAgICAgIGlmICh0aGlzLmZpbHRlcikgY2VsbHMgPSBjZWxscy5maWx0ZXIodGhpcy5maWx0ZXIpXHJcblxyXG4gICAgICAgIC8vXHJcbiAgICAgICAgY29uc3QgeiA9IGdlb0NhbnZhcy52aWV3LnpcclxuICAgICAgICBjb25zdCBjdHggPSBnZW9DYW52YXMub2Zmc2NyZWVuQ3R4XHJcblxyXG4gICAgICAgIC8vZ2V0IHZpZXcgc2NhbGVcclxuICAgICAgICBjb25zdCB2aWV3U2NhbGUgPSB0aGlzLnZpZXdTY2FsZSA/IHRoaXMudmlld1NjYWxlKGNlbGxzLCByZXNvbHV0aW9uLCB6KSA6IHVuZGVmaW5lZFxyXG5cclxuICAgICAgICAvL2luZGV4IGNlbGxzIGJ5IHkgYW5kIHhcclxuICAgICAgICAvKiogIEB0eXBlIHtvYmplY3R9ICovXHJcbiAgICAgICAgY29uc3QgaW5kID0ge31cclxuICAgICAgICBmb3IgKGNvbnN0IGNlbGwgb2YgY2VsbHMpIHtcclxuICAgICAgICAgICAgbGV0IHJvdyA9IGluZFtjZWxsLnldXHJcbiAgICAgICAgICAgIGlmICghcm93KSB7XHJcbiAgICAgICAgICAgICAgICByb3cgPSB7fVxyXG4gICAgICAgICAgICAgICAgaW5kW2NlbGwueV0gPSByb3dcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByb3dbY2VsbC54XSA9IHRoaXMuaGVpZ2h0KGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vY29tcHV0ZSBleHRlbnRcclxuICAgICAgICBjb25zdCBlID0gZ2VvQ2FudmFzLmV4dEdlb1xyXG4gICAgICAgIGlmICghZSkgcmV0dXJuXHJcbiAgICAgICAgY29uc3QgeE1pbiA9IE1hdGguZmxvb3IoZS54TWluIC8gcmVzb2x1dGlvbikgKiByZXNvbHV0aW9uXHJcbiAgICAgICAgY29uc3QgeE1heCA9IE1hdGguZmxvb3IoZS54TWF4IC8gcmVzb2x1dGlvbikgKiByZXNvbHV0aW9uXHJcbiAgICAgICAgY29uc3QgeU1pbiA9IE1hdGguZmxvb3IoZS55TWluIC8gcmVzb2x1dGlvbikgKiByZXNvbHV0aW9uXHJcbiAgICAgICAgY29uc3QgeU1heCA9IE1hdGguZmxvb3IoZS55TWF4IC8gcmVzb2x1dGlvbikgKiByZXNvbHV0aW9uXHJcblxyXG4gICAgICAgIC8qKiAgQHR5cGUge3ttaW46bnVtYmVyLCBtYXg6bnVtYmVyfX0gKi9cclxuICAgICAgICBjb25zdCB5cyA9IHsgbWluOiB5TWluLCBtYXg6IHlNYXggfVxyXG5cclxuICAgICAgICAvL2RyYXcgbGluZXMsIHJvdyBieSByb3csIHN0YXRpbmcgZnJvbSB0aGUgdG9wXHJcbiAgICAgICAgY3R4LmxpbmVKb2luID0gJ3JvdW5kJ1xyXG4gICAgICAgIGZvciAobGV0IHkgPSB5TWF4OyB5ID49IHlNaW47IHkgLT0gcmVzb2x1dGlvbikge1xyXG4gICAgICAgICAgICAvL2dldCByb3dcclxuICAgICAgICAgICAgY29uc3Qgcm93ID0gaW5kW3ldXHJcblxyXG4gICAgICAgICAgICAvL25vIHJvd1xyXG4gICAgICAgICAgICBpZiAoIXJvdykgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vcGxhY2UgZmlyc3QgcG9pbnRcclxuICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgIGN0eC5tb3ZlVG8oeE1pbiAtIHJlc29sdXRpb24gLyAyLCB5KVxyXG5cclxuICAgICAgICAgICAgLy9zdG9yZSB0aGUgcHJldmlvdXMgaGVpZ2h0XHJcbiAgICAgICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfHVuZGVmaW5lZH0gKi9cclxuICAgICAgICAgICAgbGV0IGhHX1xyXG5cclxuICAgICAgICAgICAgLy9nbyB0aHJvdWdoIHRoZSBsaW5lIGNlbGxzXHJcbiAgICAgICAgICAgIGZvciAobGV0IHggPSB4TWluOyB4IDw9IHhNYXg7IHggKz0gcmVzb2x1dGlvbikge1xyXG4gICAgICAgICAgICAgICAgLy9nZXQgY29sdW1uIHZhbHVlXHJcbiAgICAgICAgICAgICAgICAvKiogQHR5cGUge251bWJlcn0gKi9cclxuICAgICAgICAgICAgICAgIGxldCBoRyA9IHJvd1t4XVxyXG4gICAgICAgICAgICAgICAgaWYgKCFoRykgaEcgPSAwXHJcblxyXG4gICAgICAgICAgICAgICAgaWYgKGhHIHx8IGhHXykge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vZHJhdyBsaW5lIG9ubHkgd2hlbiBhdCBsZWFzdCBvbmUgb2YgYm90aCB2YWx1ZXMgaXMgbm9uLW51bGxcclxuICAgICAgICAgICAgICAgICAgICAvL1RPRE8gdGVzdCBiZXppZXJDdXJ2ZVRvXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmxpbmVUbyh4ICsgcmVzb2x1dGlvbiAvIDIsIHkgKyBoRylcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9lbHNlIG1vdmUgdGhlIHBvaW50XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyh4ICsgcmVzb2x1dGlvbiAvIDIsIHkpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvL3N0b3JlIHRoZSBwcmV2aW91cyB2YWx1ZVxyXG4gICAgICAgICAgICAgICAgaEdfID0gaEdcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy9sYXN0IHBvaW50XHJcbiAgICAgICAgICAgIGlmIChoR18pIGN0eC5saW5lVG8oeE1heCArIHJlc29sdXRpb24gLyAyLCB5KVxyXG5cclxuICAgICAgICAgICAgLy9kcmF3IGZpbGxcclxuICAgICAgICAgICAgY29uc3QgZmMgPSB0aGlzLmZpbGxDb2xvcih5LCB5cywgcmVzb2x1dGlvbiwgeilcclxuICAgICAgICAgICAgaWYgKGZjICYmIGZjICE9ICdub25lJykge1xyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IGZjXHJcbiAgICAgICAgICAgICAgICBjdHguZmlsbCgpXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vZHJhdyBsaW5lXHJcbiAgICAgICAgICAgIGNvbnN0IGxjID0gdGhpcy5saW5lQ29sb3IoeSwgeXMsIHJlc29sdXRpb24sIHopXHJcbiAgICAgICAgICAgIGNvbnN0IGx3ID0gdGhpcy5saW5lV2lkdGgoeSwgeXMsIHJlc29sdXRpb24sIHopXHJcbiAgICAgICAgICAgIGlmIChsYyAmJiBsYyAhPSAnbm9uZScgJiYgbHcgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICBjdHguc3Ryb2tlU3R5bGUgPSBsY1xyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IGx3XHJcbiAgICAgICAgICAgICAgICBjdHguc3Ryb2tlKClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG4iLCIvL0B0cy1jaGVja1xyXG4ndXNlIHN0cmljdCdcclxuXHJcbmltcG9ydCB7IFRhbmFrYVN0eWxlIH0gZnJvbSAnLi9U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ICAgICAnI2NiNGUyOScsIC8vcmVkaXNoXHJcbiAgICAgICAgICAgICcjYjQwMDAwJywgLy9yZWRcclxuICAgICAgICAgICAgJyM3MjAwMTInLCAvL2RhcmsgcmVkXHJcbiAgICAgICAgICAgIC8vXCJwdXJwbGVcIixcclxuICAgICAgICAgICAgLy9cIiNlZWVcIiAvL3doaXRoZVxyXG4gICAgICAgIF0qL1xyXG5cclxuICAgICAgICBvcHRzLmNvbERhcmsgPSBvcHRzLmNvbERhcmsgfHwgJyMzMzMnXHJcbiAgICAgICAgb3B0cy5jb2xCcmlnaHQgPSBvcHRzLmNvbEJyaWdodCB8fCAnI2FhYSdcclxuICAgICAgICBvcHRzLndpZHRoRmFjdG9yID0gb3B0cy53aWR0aEZhY3RvciB8fCAwLjEyXHJcblxyXG4gICAgICAgIC8vcmV1c2UgdGFuYWthIGFzIGJhc2lzXHJcbiAgICAgICAgY29uc3QgdHMgPSBUYW5ha2FTdHlsZS5nZXQodmFsdWUsIGJyZWFrcywgY29sb3JzLCBvcHRzKVxyXG4gICAgICAgIC8vc3R5bGUgdG8gc2hvdyBsaW1pdHMgYmV0d2VlbiBwaWVjZXNcclxuICAgICAgICBjb25zdCBzc3QgPSBuZXcgU3Ryb2tlU3R5bGUoe1xyXG4gICAgICAgICAgICBzdHJva2VDb2xvcjogKCkgPT4gJyM2NjYnLFxyXG4gICAgICAgICAgICBzdHJva2VXaWR0aDogKGMsIHIsIHopID0+IDAuMiAqIHosXHJcbiAgICAgICAgICAgIGZpbHRlcjogb3B0cy5maWx0ZXIsXHJcbiAgICAgICAgfSlcclxuXHJcbiAgICAgICAgcmV0dXJuIFtcclxuICAgICAgICAgICAgdHNbMF0sXHJcbiAgICAgICAgICAgIHNzdCxcclxuICAgICAgICAgICAgdHNbMV0sXHJcbiAgICAgICAgICAgIG5ldyBMZWdvVG9wU3R5bGUoeyBjb2xEYXJrOiBvcHRzLmNvbERhcmssIGNvbEJyaWdodDogb3B0cy5jb2xCcmlnaHQsIGZ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pcy5jb2xvciA/IHRoaXMuY29sb3IoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICBpZiAoIWNvbCB8fCBjb2wgPT09ICdub25lJykgY29udGludWVcclxuICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IGNvbFxyXG5cclxuICAgICAgICAgICAgLy9nZXQgb2Zmc2V0XHJcbiAgICAgICAgICAgIGNvbnN0IG9mZnNldCA9IHRoaXMub2Zmc2V0KGNlbGwsIHJlc29sdXRpb24sIHopXHJcblxyXG4gICAgICAgICAgICAvL2NvbXB1dGUgcG9zaXRpb24gbW9zYWljIGVmZmVjdFxyXG4gICAgICAgICAgICBjb25zdCBsbCA9IG1vc2FpYygpLFxyXG4gICAgICAgICAgICAgICAgdWwgPSBtb3NhaWMoKSxcclxuICAgICAgICAgICAgICAgIGxyID0gbW9zYWljKCksXHJcbiAgICAgICAgICAgICAgICB1ciA9IG1vc2FpYygpXHJcblxyXG4gICAgICAgICAgICAvL3N0cm9rZVxyXG4gICAgICAgICAgICBpZiAodGhpcy5zaGFkb3dGYWN0b3IgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oY2VsbC54ICsgb2Zmc2V0LmR4ICsgbGwueCwgY2VsbC55ICsgb2Zmc2V0LmR5ICsgbGwueSlcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oY2VsbC54ICsgb2Zmc2V0LmR4ICsgcmVzb2x1dGlvbiAtIGxyLngsIGNlbGwueSArIG9mZnNldC5keSArIGxyLnkpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGNlbGwueCArIG9mZnNldC5keCArIHJlc29sdXRpb24gLSB1ci54LCBjZWxsLnkgKyBvZmZzZXQuZHkgKyByZXNvbHV0aW9uIC0gdXIueSlcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvL2ZpbGxcclxuXHJcbiAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICBjdHgubW92ZVRvKGNlbGwueCArIG9mZnNldC5keCArIGxsLngsIGNlbGwueSArIG9mZnNldC5keSArIGxsLnkpXHJcbiAgICAgICAgICAgIGN0eC5saW5lVG8oY2VsbC54ICsgb2Zmc2V0LmR4ICsgcmVzb2x1dGlvbiAtIGxyLngsIGNlbGwueSArIG9mZnNldC5keSArIGxyLnkpXHJcbiAgICAgICAgICAgIGN0eC5saW5lVG8oY2VsbC54ICsgb2Zmc2V0LmR4ICsgcmVzb2x1dGlvbiAtIHVyLngsIGNlbGwueSArIG9mZnNldC5keSArIHJlc29sdXRpb24gLSB1ci55KVxyXG4gICAgICAgICAgICBjdHgubGluZVRvKGNlbGwueCArIG9mZnNldC5keCArIHVsLngsIGNlbGwueSArIG9mZnNldC5keSArIHJlc29sdXRpb24gLSB1bC55KVxyXG4gICAgICAgICAgICBjdHguZmlsbCgpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL3VwZGF0ZSBsZWdlbmRzXHJcbiAgICAgICAgdGhpcy51cGRhdGVMZWdlbmRzKHsgc3R5bGU6IHRoaXMsIHJlc29sdXRpb246IHJlc29sdXRpb24sIHo6IHosIHZpZXdTY2FsZTogdmlld1NjYWxlIH0pXHJcbiAgICB9XHJcbn1cclxuIiwiLy9AdHMtY2hlY2tcclxuJ3VzZSBzdHJpY3QnXHJcblxyXG5pbXBvcnQgeyBTdHlsZSB9IGZyb20gJy4uL2NvcmUvU3R5bGUuanMnXHJcblxyXG4vKipcclxuICogQG1vZHVsZSBzdHlsZVxyXG4gKiBAYXV0aG9yIEpvc2VwaCBEYXZpZXMsIEp1bGllbiBHYWZmdXJpXHJcbiAqL1xyXG5leHBvcnQgY2xhc3MgTmluamFTdGFyU3R5bGUgZXh0ZW5kcyBTdHlsZS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pIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGN0eC5maWxsU3R5bGUgPSBjb2xcclxuXHJcbiAgICAgICAgICAgIC8vc2l6ZSAtIGluIGdlbyB1bml0XHJcbiAgICAgICAgICAgIGxldCBrID0gdGhpcy5zaXplKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSlcclxuICAgICAgICAgICAgayA9IGsgPCAwID8gMCA6IGsgPiAxID8gMSA6IGtcclxuICAgICAgICAgICAgY29uc3Qgc0cyID0gayAqIHIyXHJcblxyXG4gICAgICAgICAgICAvL3NoYXBlXHJcbiAgICAgICAgICAgIGNvbnN0IHNoYXBlID0gdGhpcy5zaGFwZSA/IHRoaXMuc2hhcGUoY2VsbCkgOiAnbydcclxuICAgICAgICAgICAgaWYgKHNoYXBlID09PSAnbm9uZScpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL2dldCBvZmZzZXRcclxuICAgICAgICAgICAgLy9UT0RPIHVzZVxyXG4gICAgICAgICAgICAvL2NvbnN0IG9mZnNldCA9IHRoaXMub2Zmc2V0KGNlbGwsIHIsIHopXHJcblxyXG4gICAgICAgICAgICAvL2NlbnRlciBwb3NpdGlvblxyXG4gICAgICAgICAgICBjb25zdCBjeCA9IGNlbGwueCArIHIyXHJcbiAgICAgICAgICAgIGNvbnN0IGN5ID0gY2VsbC55ICsgcjJcclxuXHJcbiAgICAgICAgICAgIGlmIChzaGFwZSA9PT0gJ3AnKSB7XHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oY3gsIGN5ICsgcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4ICsgc0cyLCBjeSArIHNHMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oY3ggKyByMiwgY3kpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4ICsgc0cyLCBjeSAtIHNHMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oY3gsIGN5IC0gcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4IC0gc0cyLCBjeSAtIHNHMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oY3ggLSByMiwgY3kpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4IC0gc0cyLCBjeSArIHNHMilcclxuICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChzaGFwZSA9PT0gJ28nKSB7XHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oY3gsIGN5ICsgc0cyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjeCArIHIyLCBjeSArIHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjeCArIHNHMiwgY3kpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4ICsgcjIsIGN5IC0gcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4LCBjeSAtIHNHMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oY3ggLSByMiwgY3kgLSByMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oY3ggLSBzRzIsIGN5KVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjeCAtIHIyLCBjeSArIHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGwoKVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdVbmV4cGVjdGVkIHNoYXBlOicgKyBzaGFwZSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy91cGRhdGUgbGVnZW5kc1xyXG4gICAgICAgIHRoaXMudXBkYXRlTGVnZW5kcyh7IHN0eWxlO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SkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKCFoRyB8fCBoRyA8IDApIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL2dldCBvZmZzZXRcclxuICAgICAgICAgICAgLy9UT0RPIHVzZSB0aGF0XHJcbiAgICAgICAgICAgIC8vY29uc3Qgb2Zmc2V0ID0gdGhpcy5vZmZzZXQoYywgcmVzb2x1dGlvbiwgeilcclxuXHJcbiAgICAgICAgICAgIC8vc2V0IHdpZHRoXHJcbiAgICAgICAgICAgIGN0eC5saW5lV2lkdGggPSB3R1xyXG5cclxuICAgICAgICAgICAgLy9jb21wdXRlIGNlbGwgY2VudGVyIHBvc3RpdGlvblxyXG4gICAgICAgICAgICBjb25zdCBjeCA9IGNlbGwueCArIHJlc29sdXRpb24gLyAyXHJcbiAgICAgICAgICAgIGNvbnN0IGN5ID0gY2VsbC55ICsgcmVzb2x1dGlvbiAvIDJcclxuICAgICAgICAgICAgY29uc3QgbHMgPSBoRyAqIHRoaXMuc2hhZG93RmFjdG9yXHJcblxyXG4gICAgICAgICAgICAvL2RyYXcgc2VnbWVudFxyXG4gICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgY3R4Lm1vdmVUbyhjeCwgY3kpXHJcbiAgICAgICAgICAgIGN0eC5saW5lVG8oY3ggKyBscyAqIE1hdGguY29zKHRoaXMuc2hhZG93RGlyZWN0aW9uKSwgY3kgKyBscyAqIE1hdGguc2luKHRoaXMuc2hhZG93RGlyZWN0aW9uKSlcclxuICAgICAgICAgICAgY3R4LnN0cm9rZSgpXHJcblxyXG4gICAgICAgICAgICAvKlxyXG4gICAgICAgICAgICBpZiAodGhpcy5zaW1wbGUpIHtcclxuICAgICAgICAgICAgICAgIC8vZHJhdyBiYXNlIGNpcmNsZVxyXG4gICAgICAgICAgICAgICAgY2cuY3R4LmJlZ2luUGF0aCgpO1xyXG4gICAgICAgICAgICAgICAgY2cuY3R4LmFyYyhcclxuICAgICAgICAgICAgICAgICAgICBjeCwgY3ksXHJcbiAgICAgICAgICAgICAgICAgICAgd0cgKiAwLjUsXHJcbiAgICAgICAgICAgICAgICAgICAgMCwgMiAqIE1hdGguUEksIGZhbHNlKTtcclxuICAgICAgICAgICAgICAgIC8vY2cuY3R4LnN0cm9rZSgpO1xyXG4gICAgICAgICAgICAgICAgY2cuY3R4LmZpbGwoKTtcclxuICAgICAgICAgICAgfSovXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2RyYXcgcGlsbGFyc1xyXG4gICAgICAgIGZvciAobGV0IGNlbGwgb2YgY2VsbHMpIHtcclxuICAgICAgICAgICAgLy9jb2xvclxyXG4gICAgICAgICAgICAvKiogQHR5cGUge3N0cmluZ3x1bmRlZmluZWR9ICovXHJcbiAgICAgICAgICAgIGNvbnN0IGNvbCA9IHRoaXMuY29sb3IgPyB0aGlzLmNvbG9yKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKCFjb2wpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL3dpZHRoXHJcbiAgICAgICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfHVuZGVmaW5lZH0gKi9cclxuICAgICAgICAgICAgY29uc3Qgd0cgPSB0aGlzLndpZHRoID8gdGhpcy53aWR0aChjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgIGlmICghd0cgfHwgd0cgPCAwKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy9oZWlnaHRcclxuICAgICAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgICAgICBjb25zdCBoRyA9IHRoaXMuaGVpZ2h0ID8gdGhpcy5oZWlnaHQoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICBpZiAoIWhHIHx8IGhHIDwgMCkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vZ2V0IG9mZnNldFxyXG4gICAgICAgICAgICAvL1RPRE8gdXNlIHRoYXRcclxuICAgICAgICAgICAgLy9jb25zdCBvZmZzZXQgPSB0aGlzLm9mZnNldChjLCByZXNvbHV0aW9uLCB6KVxyXG5cclxuICAgICAgICAgICAgLy9jb21wdXRlIGNlbGwgY2VudGVyIHBvc3RpdGlvblxyXG4gICAgICAgICAgICBjb25zdCBjeCA9IGNlbGwueCArIHJlc29sdXRpb24gLyAyXHJcbiAgICAgICAgICAgIGNvbnN0IGN5ID0gY2VsbC55ICsgcmVzb2x1dGlvbiAvIDJcclxuXHJcbiAgICAgICAgICAgIC8vY29tcHV0ZSBhbmdsZVxyXG4gICAgICAgICAgICBjb25zdCBkeCA9IGN4IC0gY3Z4LFxyXG4gICAgICAgICAgICAgICAgZHkgPSBjeSAtIGN2eVxyXG4gICAgICAgICAgICBjb25zdCBhID0gTWF0aC5hdGFuMihkeSwgZHgpXHJcbiAgICAgICAgICAgIGNvbnN0IEQgPSBNYXRoLnNxcnQoZHggKiBkeCArIGR5ICogZHkpXHJcbiAgICAgICAgICAgIGNvbnN0IGQgPSAoRCAqIGhHKSAvIChIIC0gaEcpXHJcblxyXG4gICAgICAgICAgICBpZiAoc2ltcGxlKSB7XHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgc2VnbWVudFxyXG4gICAgICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gY29sXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVdpZHRoID0gd0dcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyhjeCwgY3kpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4ICsgZCAqIE1hdGguY29zKGEpLCBjeSArIGQgKiBNYXRoLnNpbihhKSlcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy9kcmF3IGJhY2tncm91bmQgc2VnbWVudFxyXG4gICAgICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gdGhpcy5vdXRsaW5lQ29sXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVdpZHRoID0gd0cgKyAyICogdGhpcy5vdXRsaW5lV2lkdGhQaXggKiB6XHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oY3gsIGN5KVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjeCArIGQgKiBNYXRoLmNvcyhhKSwgY3kgKyBkICogTWF0aC5zaW4oYSkpXHJcbiAgICAgICAgICAgICAgICBjdHguc3Ryb2tlKClcclxuXHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgc2VnbWVudFxyXG4gICAgICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gY29sXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVdpZHRoID0gd0dcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyhjeCwgY3kpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4ICsgZCAqIE1hdGguY29zKGEpLCBjeSArIGQgKiBNYXRoLnNpbihhKSlcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG5cclxuICAgICAgICAgICAgICAgIC8vZHJhdyB0b3AgY2lyY2xlXHJcbiAgICAgICAgICAgICAgICBjdHguc3Ryb2tlU3R5bGUgPSB0aGlzLm91dGxpbmVDb2xcclxuICAgICAgICAgICAgICAgIC8vY2cuY3R4LmZpbGxTdHlsZSA9IFwiI2MwOGM1OVwiXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVdpZH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DYW52YXMudmlldy56XHJcbiAgICAgICAgY29uc3QgY3R4ID0gZ2VvQ2FudmFzLm9mZnNjcmVlbkN0eFxyXG5cclxuICAgICAgICAvL2dldCB2aWV3IHNjYWxlXHJcbiAgICAgICAgY29uc3Qgdmlld1NjYWxlID0gdGhpcy52aWV3U2NhbGUgPyB0aGlzLnZpZXdTY2FsZShjZWxscywgcmVzb2x1dGlvbiwgeikgOiB1bmRlZmluZWRcclxuXHJcbiAgICAgICAgLy9cclxuICAgICAgICBjdHgubGluZUNhcCA9ICdidXR0J1xyXG5cclxuICAgICAgICAvL2NvbnZlcnNpb24gZmFjdG9yIGRlZ3JlZSAtPiByYWRpYW5cclxuICAgICAgICBjb25zdCBmID0gTWF0aC5QSSAvIDE4MFxyXG5cclxuICAgICAgICBmb3IgKGxldCBjZWxsIG9mIGNlbGxzKSB7XHJcbiAgICAgICAgICAgIC8vY29sb3JcclxuICAgICAgICAgICAgLyoqIEB0eXBlIHtzdHJpbmd8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgICAgICBjb25zdCBjb2wgPSB0aGlzLmNvbG9yID8gdGhpcy5jb2xvcihjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgIGlmICghY29sKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy93aWR0aFxyXG4gICAgICAgICAgICAvKiogQHR5cGUge251bWJlcnx1bmRlZmluZWR9ICovXHJcbiAgICAgICAgICAgIGNvbnN0IHdHID0gdGhpcy53aWR0aCA/IHRoaXMud2lkdGgoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICBpZiAoIXdHIHx8IHdHIDwgMCkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vbGVuZ3RoXHJcbiAgICAgICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfHVuZGVmaW5lZH0gKi9cclxuICAgICAgICAgICAgY29uc3QgbEcgPSB0aGlzLmxlbmd0aCA/IHRoaXMubGVuZ3RoKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKCFsRyB8fCBsRyA8IDApIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL29yaWVudGF0aW9uIChpbiByYWRpYW4pXHJcbiAgICAgICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfSAqL1xyXG4gICAgICAgICAgICBjb25zdCBvciA9IHRoaXMub3JpZW50YXRpb24oY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSAqIGZcclxuICAgICAgICAgICAgaWYgKG9yID09PSB1bmRlZmluZWQgfHwgaXNOYU4ob3IpKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy9nZXQgb2Zmc2V0XHJcbiAgICAgICAgICAgIGNvbnN0IG9mZnNldCA9IHRoaXMub2Zmc2V0KGNlbGwsIHJlc29sdXRpb24sIHopXHJcblxyXG4gICAgICAgICAgICAvL3NldCBjb2xvciBhbmQgd2lkdGhcclxuICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gY29sXHJcbiAgICAgICAgICAgIGN0eC5saW5lV2lkdGggPSB3R1xyXG5cclxuICAgICAgICAgICAgLy9jb21wdXRlIHNlZ21lbnQgY2VudGVyIHBvc3RpdGlvblxyXG4gICAgICAgICAgICBjb25zdCBjeCA9IGNlbGwueCArIHJlc29sdXRpb24gLyAyICsgb2Zmc2V0LmR4XHJcbiAgICAgICAgICAgIGNvbnN0IGN5ID0gY2VsbC55ICsgcmVzb2x1dGlvbiAvIDIgKyBvZmZzZXQuZHlcclxuXHJcbiAgICAgICAgICAgIC8vY29tcHV0ZSBzZWdtZW50IGRpcmVjdGlvblxyXG4gICAgICAgICAgICBjb25zdCBkeCA9IDAuNSAqIE1hdGguY29zKG9yKSAqIGxHXHJcbiAgICAgICAgICAg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HZpZXdTY2FsZSkgOiBkZWZhdWx0U2l6ZVxyXG4gICAgICAgICAgICBpZiAoIXNpemUpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvLyBEZXRlcm1pbmUgc2hhcGVcclxuICAgICAgICAgICAgLy9AdHMtaWdub3JlXHJcbiAgICAgICAgICAgIGNvbnN0IHNoYXBlID0gc2hhcGVGdW5jdGlvbiA/IHNoYXBlRnVuY3Rpb24oYywgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IGRlZmF1bHRTaGFwZVxyXG4gICAgICAgICAgICBpZiAoc2hhcGUgPT09ICdub25lJykgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vZ2V0IG9mZnNldFxyXG4gICAgICAgICAgICBjb25zdCBvZmZzZXQgPSB0aGlzLm9mZnNldChjLCByZXNvbHV0aW9uLCB6KVxyXG5cclxuICAgICAgICAgICAgLy9nZXQgY29udGV4dFxyXG4gICAgICAgICAgICBjb25zdCBjdHggPSBnZW9DYW52YXMub2Zmc2NyZWVuQ3R4XHJcbiAgICAgICAgICAgIGN0eC5maWxsU3R5bGUgPSBjb2xcclxuICAgICAgICAgICAgaWYgKHNoYXBlID09PSAnc3F1YXJlJykge1xyXG4gICAgICAgICAgICAgICAgLy9kcmF3IHNxdWFyZVxyXG4gICAgICAgICAgICAgICAgY29uc3QgZCA9IHJlc29sdXRpb24gKiAoMSAtIHNpemUgLyByZXNvbHV0aW9uKSAqIDAuNVxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGxSZWN0KGMueCArIGQgKyBvZmZzZXQuZHgsIGMueSArIGQgKyBvZmZzZXQuZHksIHNpemUsIHNpemUpXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc2hhcGUgPT09ICdjaXJjbGUnKSB7XHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgY2lyY2xlXHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5hcmMoYy54ICsgcjIgKyBvZmZzZXQuZHgsIGMueSArIHIyICsgb2Zmc2V0LmR5LCBzaXplICogMC41LCAwLCAyICogTWF0aC5QSSwgZmFsc2UpXHJcbiAgICAgICAgICAgICAgICBjdHguZmlsbCgpXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc2hhcGUgPT09ICdkb251dCcpIHtcclxuICAgICAgICAgICAgICAgIC8vZHJhdyBkb251dFxyXG4gICAgICAgICAgICAgICAgY29uc3QgeGMgPSBjLnggKyByMiArIG9mZnNldC5keCxcclxuICAgICAgICAgICAgICAgICAgICB5YyA9IGMueSArIHIyICsgb2Zmc2V0LmR5XHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oeGMsIHljKVxyXG4gICAgICAgICAgICAgICAgY3R4LmFyYyh4YywgeWMsIHIyLCAwLCAyICogTWF0aC5QSSlcclxuICAgICAgICAgICAgICAgIGN0eC5hcmMoeGMsIHljLCAoMSAtIHNpemUgLyByZXNvbHV0aW9uKSAqIHIyLCAwLCAyICogTWF0aC5QSSwgdHJ1ZSlcclxuICAgICAgICAgICAgICAgIGN0eC5jbG9zZVBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGwoKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAnZGlhbW9uZCcpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHMyID0gc2l6ZSAqIDAuNVxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGMueCArIHIyIC0gczIsIGMueSArIHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByMiwgYy55ICsgcjIgKyBzMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcjIgKyBzMiwgYy55ICsgcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCArIHIyLCBjLnkgKyByMiAtIHMyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGwoKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAndHJpYW5nbGVfdXAnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBkcjIgPSAoc2l6ZSAtIHJlc29sdXRpb24pIC8gMlxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGMueCAtIGRyMiwgYy55IC0gZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByMiwgYy55ICsgcmVzb2x1dGlvbiArIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcmVzb2x1dGlvbiArIGRyMiwgYy55IC0gZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGwoKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAndHJpYW5nbGVfZG93bicpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGRyMiA9IChzaXplIC0gcmVzb2x1dGlvbikgLyAyXHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oYy54IC0gZHIyLCBjLnkgKyByZXNvbHV0aW9uICsgZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByMiwgYy55IC0gZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByZXNvbHV0aW9uICsgZHIyLCBjLnkgKyByZXNvbHV0aW9uICsgZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGwoKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAndHJpYW5nbGVfbGVmdCcpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGRyMiA9IChzaXplIC0gcmVzb2x1dGlvbikgLyAyXHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oYy54ICsgcmVzb2x1dGlvbiArIGRyMiwgYy55ICsgcmVzb2x1dGlvbiArIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54IC0gZHIyLCBjLnkgKyByMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcmVzb2x1dGlvbiArIGRyMiwgYy55IC0gZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGwoKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAndHJpYW5nbGVfcmlnaHQnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBkcjIgPSAoc2l6ZSAtIHJlc29sdXRpb24pIC8gMlxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGMueCAtIGRyMiwgYy55IC0gZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByZXNvbHV0aW9uICsgZHIyLCBjLnkgKyByMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54IC0gZHIyLCBjLnkgKyByZXNvbHV0aW9uICsgZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGwoKVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdVbmV4cGVjdGVkIHNoYXBlOicgKyBzaGFwZSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy91cGRhdGUgbGVnZW5kc1xyXG4gICAgICAgIHRoaXMudXBkYXRlTGVnZW5kcyh7IHZpZXdTY2FsZTogdmlld1NjYWxlLCByZXN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bmVDYXAgPSAnYnV0dCdcclxuICAgICAgICBjb25zdCByMiA9IHJlc29sdXRpb24gKiAwLjVcclxuICAgICAgICBmb3IgKGxldCBzaWRlIG9mIHNpZGVzKSB7XHJcbiAgICAgICAgICAgIC8vZ2V0IGNhdGVnb3J5IGNvZGVzIGZvciBib3RoIGNlbGxzXHJcbiAgICAgICAgICAgIGNvbnN0IGNvZGUxID0gc2lkZS5jMSA/IHRoaXMuY29kZShzaWRlLmMxLCByZXNvbHV0aW9uLCB6KSA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICBjb25zdCBjb2RlMiA9IHNpZGUuYzIgPyB0aGlzLmNvZGUoc2lkZS5jMiwgcmVzb2x1dGlvbiwgeikgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKGNvZGUxID09IGNvZGUyKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy93aWR0aFxyXG4gICAgICAgICAgICAvKiogQHR5cGUge251bWJlcnx1bmRlZmluZWR9ICovXHJcbiAgICAgICAgICAgIGNvbnN0IHdHID0gdGhpcy53aWR0aCA/IHRoaXMud2lkdGgoc2lkZSwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICBpZiAoIXdHIHx8IHdHIDw9IDApIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGNvbnN0IHcyID0gd0cgKiAwLjVcclxuXHJcbiAgICAgICAgICAgIC8vc2V0IHdpZHRoXHJcbiAgICAgICAgICAgIGN0eC5saW5lV2lkdGggPSB3R1xyXG5cclxuICAgICAgICAgICAgLy9kcmF3IHNlZ21lbnQgd2l0aCBjb3JyZWN0IG9yaWVudGF0aW9uXHJcbiAgICAgICAgICAgIGlmIChzaWRlLm9yID09PSAnaCcpIHtcclxuICAgICAgICAgICAgICAgIC8vdG9wIGxpbmVcclxuICAgICAgICAgICAgICAgIGlmIChjb2RlMikge1xyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IHRoaXMuY29sb3JbY29kZTJdXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyhzaWRlLnggLSByMiwgc2lkZS55ICsgdzIpXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhzaWRlLnggKyByMiwgc2lkZS55ICsgdzIpXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LnN0cm9rZSgpXHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgLy9ib3R0b20gbGluZVxyXG4gICAgICAgICAgICAgICAgaWYgKGNvZGUxKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gdGhpcy5jb2xvcltjb2RlMV1cclxuICAgICAgICAgICAgICAgICAgICBjdHgubW92ZVRvKHNpZGUueCAtIHIyLCBzaWRlLnkgLSB3MilcclxuICAgICAgICAgICAgICAgICAgICBjdHgubGluZVRvKHNpZGUueCArIHIyLCBzaWRlLnkgLSB3MilcclxuICAgICAgICAgICAgICAgICAgICBjdHguc3Ryb2tlKClcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vcmlnaHQgbGluZVxyXG4gICAgICAgICAgICAgICAgaWYgKGNvZGUyKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gdGhpcy5jb2xvcltjb2RlMl1cclxuICAgICAgICAgICAgICAgICAgICBjdHgubW92ZVRvKHNpZGUueCArIHcyLCBzaWRlLnkgLSByMilcclxuICAgICAgICAgICAgICAgICAgICBjdHgubGluZVRvKHNpZGUueCArIHcyLCBzaWRlLnkgKyByMilcclxuICAgICAgICAgICAgICAgICAgICBjdHguc3Ryb2tlKClcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAvL2xlZnQgbGluZVxyXG4gICAgICAgICAgICAgICAgaWYgKGNvZGUxKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gdGhpcy5jb2xvcltjb2RlMV1cclxuICAgICAgICAgICAgICAgICAgICBjdHgubW92ZVRvKHNpZGUueCAtIHcyLCBzaWRlLnkgLSByMilcclxuICAgICAgICAgICAgICAgICAgICBjdHgubGluZVRvKHNpZGUueCAtIHcyLCBzaWRlLnkgKyByMilcclxuICAgICAgICAgICAgICAgICAgICBjdHguc3Ryb2tlKClcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy91cGRhdGUgbGVnZW5kc1xyXG4gICAgICAgIHRoaXMudXBkYXRlTGVnZW5kcyh7IHN0eWxlOiB0aGlzLCByZXNvbHV0aW9uOiByZXNvbHV0aW9uLCB6OiB6LCB2aWV3U2NhbGU6IHZpZXdTY2FsZSB9KVxyXG4gICAgfVxyXG59XHJcbiIsIi8vQHRzLWNoZWNrXHJcbid1c2Ugc3RyaWN0J1xyXG5cclxuaW1wb3J0IHsgU3R5bGUgfSBmcm9tICcuLi9jb3JlL1N0eWxlLmpzJ1xyXG5cclxuLyoqIEB0eXBlZGVmIHt7IHg6bnVtYmVyLCB5Om51bWJlciwgb3I6XCJ2XCJ8XCJoXCIsIGMxOihpbXBvcnQoJy4uL2NvcmUvRGF0YXNldCcpLkNlbGwpfHVuZGVmaW5lZCwgYzI6KGltcG9ydCgnLi4vY29yZS9EYXRhc2V0JykuQ2VsbCl8dW5kZWZpbmVkIH19IFNpZGUgKi9cclxuXHJcbi8qKlxyXG4gKiBAdHl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NvbHV0aW9uKVxyXG4gICAgICAgIGlmIChzaWRlcy5sZW5ndGggPT0gMCkgcmV0dXJuXHJcblxyXG4gICAgICAgIC8vZ2V0IHNpZGUgdmlldyBzY2FsZVxyXG4gICAgICAgIGNvbnN0IHZpZXdTY2FsZSA9IHRoaXMudmlld1NjYWxlID8gdGhpcy52aWV3U2NhbGUoc2lkZXMsIHJlc29sdXRpb24sIHopIDogdW5kZWZpbmVkXHJcblxyXG4gICAgICAgIC8vZHJhdyBzaWRlc1xyXG5cclxuICAgICAgICBjdHgubGluZUNhcCA9ICdidXR0J1xyXG4gICAgICAgIGNvbnN0IHIyID0gcmVzb2x1dGlvbiAqIDAuNVxyXG4gICAgICAgIGZvciAobGV0IHNpZGUgb2Ygc2lkZXMpIHtcclxuICAgICAgICAgICAgLy9jb2xvclxyXG4gICAgICAgICAgICAvKiogQHR5cGUge3N0cmluZ3x1bmRlZmluZWR9ICovXHJcbiAgICAgICAgICAgIGNvbnN0IGNvbCA9IHRoaXMuY29sb3IgPyB0aGlzLmNvbG9yKHNpZGUsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKCFjb2wgfHwgY29sID09ICdub25lJykgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIGlmICh0aGlzLmRpYW1vbmQpIHtcclxuICAgICAgICAgICAgICAgIC8vc2V0IGNvbG9yXHJcbiAgICAgICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gY29sXHJcblxyXG4gICAgICAgICAgICAgICAgLy9kcmF3IGRpYW1vbmRcclxuICAgICAgICAgICAgICAgIGNvbnN0IHggPSBzaWRlLngsXHJcbiAgICAgICAgICAgICAgICAgICAgeSA9IHNpZGUueVxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKHggLSByMiwgeSlcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oeCwgeSArIHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyh4ICsgcjIsIHkpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKHgsIHkgLSByMilcclxuICAgICAgICAgICAgICAgIGN0eC5jbG9zZVBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGwoKVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy93aWR0aFxyXG4gICAgICAgICAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgICAgICAgICAgY29uc3Qgd0cgPSB0aGlzLndpZHRoID8gdGhpcy53aWR0aChzaWRlLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgICAgICBpZiAoIXdHIHx8IHdHIDw9IDApIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAgICAgLy9sZW5ndGhcclxuICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfHVuZGVmaW5lZH0gKi9cclxuICAgICAgICAgICAgICAgIGNvbnN0IGxHID0gdGhpcy5sZW5ndGggPyB0aGlzLmxlbmd0aChzaWRlLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgICAgICBpZiAoIWxHIHx8IGxHIDw9IDApIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICBjb25zdCBsRzIgPSBsRyAqIDAuNVxyXG5cclxuICAgICAgICAgICAgICAgIC8vc2V0IHdpZHRoXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVdpZHRoID0gd0dcclxuICAgICAgICAgICAgICAgIC8vc2V0IGNvbG9yXHJcbiAgICAgICAgICAgICAgICBjdHguc3Ryb2tlU3R5bGUgPSBjb2xcclxuXHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgc2VnbWVudCB3aXRoIGNvcnJlY3Qgb3JpZW50YXRpb25cclxuICAgICAgICAgICAgICAgIGNvbnN0IHggPSBzaWRlLngsXHJcbiAgICAgICAgICAgICAgICAgICAgeSA9IHNpZGUueVxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBpZiAoc2lkZS5vciA9PT0gJ3YnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyh4LCB5IC0gbEcyKVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oeCwgeSArIGxHMilcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyh4IC0gbEcyLCB5KVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oeCArIGxHMiwgeSlcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL3VwZGF0ZSBsZWdlbmRzXHJcbiAgICAgICAgdGhpcy51cGRhdGVMZWdlbmRzKHsgc3R5bGU6IHRoaXMsIHJlc29sdXRpb246IHJlc29sdXRpb24sIHo6IHosIHZpZXdTY2FsZTogdmlld1NjYWxlIH0pXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKlxyXG4gICAgICogQHBhcmFtIHtBcnJheS48aW1wb3J0KCcuLi9jb3JlL0RhdGFzZXQnKS5DZWxsPn0gY2VsbHMgVGhlIGNlbGxzIHRvIHVzZSB0byBidWlsZCB0aGUgc2lkZXMuXHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0gcmVzb2x1dGlvbiBUaGUgY2VsbHMgcmVzb2x1dGlvblxyXG4gICAgICogQHBhcmFtIHtib29sZWFufSB3aXRoSG9yaXpvbnRhbCBTZXQgdG8gdHJ1ZSB0byBidWlsZCBob3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XQgYzEgPSBjZWxsc1swXVxyXG4gICAgICAgIGZvciAobGV0IGkgPSAxOyBpIDwgY2VsbHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgbGV0IGMyID0gY2VsbHNbaV1cclxuXHJcbiAgICAgICAgICAgIGlmIChjMS55ICsgcmVzb2x1dGlvbiA9PSBjMi55ICYmIGMxLnggPT0gYzIueClcclxuICAgICAgICAgICAgICAgIC8vY2VsbHMgaW4gc2FtZSBjb2x1bW4gYW5kIHRvdWNoIGFsb25nIGhvcml6b250YWwgc2lkZVxyXG4gICAgICAgICAgICAgICAgLy9tYWtlIHNoYXJlZCBzaWRlXHJcbiAgICAgICAgICAgICAgICBzaWRlcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgICAgICBvcjogJ2gnLFxyXG4gICAgICAgICAgICAgICAgICAgIHg6IGMxLnggKyByMixcclxuICAgICAgICAgICAgICAgICAgICB5OiBjMi55LFxyXG4gICAgICAgICAgICAgICAgICAgIGMxOiBjMSxcclxuICAgICAgICAgICAgICAgICAgICBjMjogYzIsXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vY2VsbHMgZG8gbm90IHRvdWNoIGFsb25nIGhvcml6b250YWwgc2lkZVxyXG4gICAgICAgICAgICAgICAgLy9tYWtlIHR3byBzaWRlczogdG9wIG9uZSBmb3IgYzEsIGJvdHRvbSBmb3IgYzJcclxuICAgICAgICAgICAgICAgIHNpZGVzLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgICAgIG9yOiAnaCcsXHJcbiAgICAgICAgICAgICAgICAgICAgeDogYzEueCArIHIyLFxyXG4gICAgICAgICAgICAgICAgICAgIHk6IGMxLnkgKyByZXNvbHV0aW9uLFxyXG4gICAgICAgICAgICAgICAgICAgIGMxOiBjMSxcclxuICAgICAgICAgICAgICAgICAgICBjMjogdW5kZWZpbmVkLFxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIHNpZGVzLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgICAgIG9yOiAnaCcsXHJcbiAgICAgICAgICAgICAgICAgICAgeDogYzIueCArIHIyLFxyXG4gICAgICAgICAgICAgICAgICAgIHk6IGMyLnksXHJcbiAgICAgICAgICAgICAgICAgICAgYzE6IHVuZGVmaW5lZCxcclxuICAgICAgICAgICAgICAgICAgICBjMjogYzIsXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICBjMSA9IGMyXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL21ha2UgdmVydGljYWwgc2lkZXNcclxuICAgICAgICAvL3NvcnQgY2VsbHMgYnkgeSBhbmQgeFxyXG4gICAgICAgIGNlbGxzLnNvcnQoKGMxLCBjMikgPT4gKGMyLnkgPT0gYzEueSA/IGMxLnggLSBjMi54IDogYzEueSAtIGMyLnkpKVxyXG4gICAgICAgIGMxID0gY2VsbHNbMF1cclxuICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IGNlbGxzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGxldCBjMiA9IGNlbGxzW2ldXHJcblxyXG4gICAgICAgICAgICBpZiAoYzEueCArIHJlc29sdXRpb24gPT0gYzIueCAmJiBjMS55ID09IGMyLnkpXHJcbiAgICAgICAgICAgICAgICAvL2NlbGxzIGluIHNhbWUgcm93IGFuZCB0b3VjaCBhbG9uZyB2ZXJ0aWNhbCBzaWRlXHJcbiAgICAgICAgICAgICAgICAvL21ha2Ugc2hhcmVkIHNpZGVcclxuICAgICAgICAgICAgICAgIHNpZGVzLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgICAgIG9yOiAndicsXHJcbiAgICAgICAgICAgICAgICAgICAgeDogYzEueCArIHJlc29sdXRpb24sXHJcbiAgICAgICAgICAgICAgICAgICAgeTogYzEueSArIHIyLFxyXG4gICAgICAgICAgICAgICAgICAgIGMxOiBjMSxcclxuICAgICAgICAgICAgICAgICAgICBjMjogYzIsXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vY2VsbHMgZG8gbm90IHRvdWNoIGFsb25nIHZlcnRpY2FsIHNpZGVcclxuICAgICAgICAgICAgICAgIC8vbWFrZSB0d28gc2lkZXM6IHJpZ2h0IG9uZSBmb3IgYzEsIGxlZnQgZm9yIGMyXHJcbiAgICAgICAgICAgICAgICBzaWRlcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgICAgICBvcjogJ3YnLFxyXG4gICAgICAgICAgICAgICAgICAgIHg6IGMxLnggKyByZXNvbHV0aW9uLFxyXG4gICAgICAgICAgICAgICAgICAgIHk6IGMxLnkgKyByMixcclxuICAgICAgICAgICAgICAgICAgICBjMTogYzEsXHJcbiAgICAgICAgICAgICAgICAgICAgYzI6IHVuZGVmaW5lZCxcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICBzaWRlcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgICAgICBvcjogJ3YnLFxyXG4gICAgICAgICAgICAgICAgICAgIHg6IGMyLngsXHJcbiAgICAgICAgICAgICAgICAgICAgeTogYzIueSArIHIyLFxyXG4gICAgICAgICAgICAgICAgICAgIGMxOiB1bmRlZmluZWQsXHJcbiAgICAgICAgICAgICAgICAgICAgYzI6IGMyLFxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgYzEgPSBjMlxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gc2lkZXNcclxuICAgIH1cclxufVxyXG4iLCIvL0B0cy1jaGVja1xyXG4ndXNlIHN0cmljdCdcclxuXHJcbmltcG9ydCB7IFN0eWxlIH0gZnJvbSAnLi4vY29yZS9TdHlsZS5qcydcclxuaW1wb3J0IHsgbWFrZVdlYkdMQ2FudmFzIH0gZnJvbSAnLi4vdXRpb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HJcbiAgICAgICAgdGhpcy5jb2xvcnMgPVxyXG4gICAgICAgICAgICBvcHRzLmNvbG9ycyB8fFxyXG4gICAgICAgICAgICBbXHJcbiAgICAgICAgICAgICAgICAncmdiKDE1OCwgMSwgNjYpJyxcclxuICAgICAgICAgICAgICAgICdyZ2IoMjQ4LCAxNDIsIDgzKScsXHJcbiAgICAgICAgICAgICAgICAncmdiKDI1MSwgMjQ4LCAxNzYpJyxcclxuICAgICAgICAgICAgICAgICdyZ2IoMTM3LCAyMDcsIDE2NSknLFxyXG4gICAgICAgICAgICAgICAgJ3JnYig5NCwgNzksIDE2MiknLFxyXG4gICAgICAgICAgICBdLnJldmVyc2UoKVxyXG4gICAgICAgIGlmIChvcHRzLmNvbG9yKVxyXG4gICAgICAgICAgICB0aGlzLmNvbG9ycyA9IFtcclxuICAgICAgICAgICAgICAgIG9wdHMuY29sb3IoMCksXHJcbiAgICAgICAgICAgICAgICBvcHRzLmNvbG9yKDAuMiksXHJcbiAgICAgICAgICAgICAgICBvcHRzLmNvbG9yKDAuNCksXHJcbiAgICAgICAgICAgICAgICBvcHRzLmNvbG9yKDAuNiksXHJcbiAgICAgICAgICAgICAgICBvcHRzLmNvbG9yKDAuOCksXHJcbiAgICAgICAgICAgICAgICBvcHRzLmNvbG9yKDEpLFxyXG4gICAgICAgICAgICBdXHJcblxyXG4gICAgICAgIC8qKlxyXG4gICAgICAgICAqIERlZmluZSB0aGUgb3BhY2l0eSBvZiB0aGUgc3R5bGUsIHdpdGhpbiBbMCwxXS5cclxuICAgICAgICAgKiBJZiB0aGlzIG9wYWNpdHkgaXMgZGVmaW5lZCwgdGhlIGluZGl2aWR1YWwgY29sb3Igb3BhY2l0eSB3aWxsIGJlIGlnbm9yZWQuXHJcbiAgICAgICAgICogQHR5cGUge2Z1bmN0aW9uKG51bWJlcixudW1iZXIpOm51bWJlcn0gKi9cclxuICAgICAgICB0aGlzLm9wYWNpdHkgPSBvcHRzLm9wYWNpdHkgLy8gKHIseikgPT4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y9mb3Igb3BhY2l0eSBjb250cm9sLCBzZWU6IGh0dHBzOi8vd2ViZ2xmdW5kYW1lbnRhbHMub3JnL3dlYmdsL2xlc3NvbnMvd2ViZ2wtYW5kLWFscGhhLmh0bWxcclxuICAgICAgICBjb25zdCBjdldHTCA9IG1ha2VXZWJHTENhbnZhcyhcclxuICAgICAgICAgICAgZ2VvQ2FudmFzLncgKyAnJyxcclxuICAgICAgICAgICAgZ2VvQ2FudmFzLmggKyAnJyxcclxuICAgICAgICAgICAgdGhpcy5vcGFjaXR5ICE9IHVuZGVmaW5lZCA/IHsgcHJlbXVsdGlwbGllZEFscGhhOiBmYWxzZSB9IDogdW5kZWZpbmVkXHJcbiAgICAgICAgKVxyXG4gICAgICAgIGlmICghY3ZXR0wpIHtcclxuICAgICAgICAgICAgY29uc29sZS5lcnJvcignTm8gd2ViR0wnKVxyXG4gICAgICAgICAgICByZXR1cm5cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vYWRkIHZlcnRpY2UgYW5kIGZyYWdtZW50IGRhdGFcclxuICAgICAgICBjb25zdCByMiA9IHJlc29sdXRpb24gLyAyXHJcbiAgICAgICAgY29uc3QgdmVydGljZXNCdWZmZXIgPSBbXVxyXG4gICAgICAgIGNvbnN0IHRCdWZmZXIgPSBbXVxyXG4gICAgICAgIGZvciAobGV0IGNlbGwgb2YgY2VsbHMpIHtcclxuICAgICAgICAgICAgY29uc3QgdCA9IHRoaXMudEZ1bihjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpXHJcbiAgICAgICAgICAgIGlmICh0ID09IG51bGwgfHwgdCA9PSB1bmRlZmluZWQpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIHZlcnRpY2VzQnVmZmVyLnB1c2goY2VsbC54ICsgcjIsIGNlbGwueSArIHIyKVxyXG4gICAgICAgICAgICB0QnVmZmVyLnB1c2godCA+IDEgPyAxIDogdCA8IDAgPyAwIDogdClcclxuICAgICAgICB9XHJcblxyXG4gICA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ICAgICAgICAgIC8vd2lkdGhcclxuICAgICAgICAgICAgY29uc3Qgd2kgPSB0aGlzLnN0cm9rZVdpZHRoID8gdGhpcy5zdHJva2VXaWR0aChjLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogMSAqIHpcclxuICAgICAgICAgICAgaWYgKCF3aSB8fCB3aSA8PSAwKSBjb250aW51ZVxyXG4gICAgICAgICAgICBjdHgubGluZVdpZHRoID0gd2lcclxuXHJcbiAgICAgICAgICAgIC8vc2hhcGVcclxuICAgICAgICAgICAgY29uc3Qgc2hhcGUgPSB0aGlzLnNoYXBlID8gdGhpcy5zaGFwZShjLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogJ3NxdWFyZSdcclxuICAgICAgICAgICAgaWYgKHNoYXBlID09PSAnbm9uZScpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL2dldCBvZmZzZXRcclxuICAgICAgICAgICAgY29uc3Qgb2Zmc2V0ID0gdGhpcy5vZmZzZXQoYywgcmVzb2x1dGlvbiwgeilcclxuXHJcbiAgICAgICAgICAgIGlmIChzaGFwZSA9PT0gJ3NxdWFyZScpIHtcclxuICAgICAgICAgICAgICAgIC8vZHJhdyBzcXVhcmVcclxuICAgICAgICAgICAgICAgIGNvbnN0IGQgPSByZXNvbHV0aW9uICogKDEgLSBzaXplIC8gcmVzb2x1dGlvbikgKiAwLjVcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4LnJlY3QoYy54ICsgZCArIG9mZnNldC5keCwgYy55ICsgZCArIG9mZnNldC5keSwgc2l6ZSwgc2l6ZSlcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAnY2lyY2xlJykge1xyXG4gICAgICAgICAgICAgICAgLy9kcmF3IGNpcmNsZVxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHguYXJjKGMueCArIHIyICsgb2Zmc2V0LmR4LCBjLnkgKyByMiArIG9mZnNldC5keSwgc2l6ZSAqIDAuNSwgMCwgMiAqIE1hdGguUEksIGZhbHNlKVxyXG4gICAgICAgICAgICAgICAgY3R4LnN0cm9rZSgpXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc2hhcGUgPT09ICdkaWFtb25kJykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgczIgPSBzaXplICogMC41XHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oYy54ICsgcjIgLSBzMiwgYy55ICsgcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCArIHIyLCBjLnkgKyByMiArIHMyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByMiArIHMyLCBjLnkgKyByMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcjIsIGMueSArIHIyIC0gczIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCArIHIyIC0gczIsIGMueSArIHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LnN0cm9rZSgpXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc2hhcGUgPT09ICdkb251dCcpIHtcclxuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoJ05vdCBpbXBsZW1lbnRlZCcpXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc2hhcGUgPT09ICd0cmlhbmdsZV91cCcpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGRyMiA9IChzaXplIC0gcmVzb2x1dGlvbikgLyAyXHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oYy54IC0gZHIyLCBjLnkgLSBkcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCArIHIyLCBjLnkgKyByZXNvbHV0aW9uICsgZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByZXNvbHV0aW9uICsgZHIyLCBjLnkgLSBkcjIpXHJcbiAgICAgICAgICAgICAgICBjdHguY2xvc2VQYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAndHJpYW5nbGVfZG93bicpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGRyMiA9IChzaXplIC0gcmVzb2x1dGlvbikgLyAyXHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oYy54IC0gZHIyLCBjLnkgKyByZXNvbHV0aW9uICsgZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByMiwgYy55IC0gZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByZXNvbHV0aW9uICsgZHIyLCBjLnkgKyByZXNvbHV0aW9uICsgZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmNsb3NlUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHguc3Ryb2tlKClcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChzaGFwZSA9PT0gJ3RyaWFuZ2xlX2xlZnQnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBkcjIgPSAoc2l6ZSAtIHJlc29sdXRpb24pIC8gMlxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGMueCArIHJlc29sdXRpb24gKyBkcjIsIGMueSArIHJlc29sdXRpb24gKyBkcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCAtIGRyMiwgYy55ICsgcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCArIHJlc29sdXRpb24gKyBkcjIsIGMueSAtIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5jbG9zZVBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4LnN0cm9rZSgpXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc2hhcGUgPT09ICd0cmlhbmdsZV9yaWdodCcpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGRyMiA9IChzaXplIC0gcmVzb2x1dGlvbikgLyAyXHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oYy54IC0gZHIyLCBjLnkgLSBkcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCArIHJlc29sdXRpb24gKyBkcjIsIGMueSArIHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggLSBkcjIsIGMueSArIHJlc29sdXRpb24gKyBkcjIpXHJcbiAgICAgICAgICAgICAgICBjdHguY2xvc2VQYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdVbmV4cGVjdGVkIHNoYXBlOicgKyBzaGFwZSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy91cGRhdGUgbGVnZW5kc1xyXG4gICAgICAgIHRoaXMudXBkYXRlTGVnZW5kcyh7IHN0eWxlOiB0aGlzLCByZXNvbHV0aW9uOiByZXNvbHV0aW9uLCB6OiB6LCB2aWV3U2NhbGU6IHZpZXdTY2FsZSB9KVxyXG4gICAgfVxyXG59XHJcbiIsIi8vQHRzLWNoZWNrXHJcbid1c2Ugc3RyaWN0J1xyXG5cclxuaW1wb3J0IHsgU2lkZVN0eWxlIH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ICAvL3NoYWRvdyBjb2xvcnNcclxuICAgICAgICBvcHRzLmNvbG9yRGFyayA9IG9wdHMuY29sb3JEYXJrIHx8ICcjMTExJ1xyXG4gICAgICAgIG9wdHMuY29sb3JCcmlnaHQgPSBvcHRzLmNvbG9yQnJpZ2h0IHx8ICcjZGRkJ1xyXG5cclxuICAgICAgICAvKiogQHR5cGUgeyBmdW5jdGlvbihudW1iZXIsIG51bWJlcik6bnVtYmVyIH0gKi9cclxuICAgICAgICBvcHRzLndpZHRoID1cclxuICAgICAgICAgICAgb3B0cy53aWR0aCB8fFxyXG4gICAgICAgICAgICAoKHNpZGVWYWx1ZSwgcmVzb2x1dGlvbiwgeikgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgbWluV0cgPSAxICogelxyXG4gICAgICAgICAgICAgICAgY29uc3QgbWF4V0cgPSA0ICogelxyXG4gICAgICAgICAgICAgICAgY29uc3Qgc3RlcCA9IChtYXhXRyAtIG1pbldHKSAvIDNcclxuICAgICAgICAgICAgICAgIHJldHVybiBNYXRoLm1pbihtaW5XRyArIChzaWRlVmFsdWUgLSAxKSAqIHN0ZXAsIG1heFdHKVxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAvL21ha2UgY2xhc3NpZmllclxyXG4gICAgICAgIGNvbnN0IGNsYXNzaWZpZXIgPSBjbEZ1bihicmVha3MpXHJcbiAgICAgICAgLy9tYWtlIGNvbG9ycyB0YWJsZVxyXG4gICAgICAgIGNvbnN0IGNvbG9yc0RpY3QgPSB7fVxyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY29sb3JzLmxlbmd0aDsgaSsrKSBjb2xvcnNEaWN0W2kgKyAnJ10gPSBjb2xvcnNbaV1cclxuXHJcbiAgICAgICAgY29uc3QgY2VsbFN0eWxlID0gbmV3IFNxdWFyZUNvbG9yQ2F0ZWdvcnlXZWJHTFN0eWxlKHtcclxuICAgICAgICAgICAgY29kZTogKGNlbGwpID0+IGNsYXNzaWZpZXIodmFsdWUoY2VsbCkpLFxyXG4gICAgICAgICAgICBjb2xvcjogY29sb3JzRGljdCxcclxuICAgICAgICB9KVxyXG5cclxuICAgICAgICBjb25zdCBnZXRTaWRlVmFsdWUgPSAoc2lkZSkgPT4ge1xyXG4gICAgICAgICAgICBjb25zdCBjbDEgPSBzaWRlLmMxID8gY2xhc3NpZmllcih2YWx1ZShzaWRlLmMxKSkgOiAtMVxyXG4gICAgICAgICAgICBjb25zdCBjbDIgPSBzaWRlLmMyID8gY2xhc3NpZmllcih2YWx1ZShzaWRlLmMyKSkgOiAtMVxyXG4gICAgICAgICAgICByZXR1cm4gY2wxIC0gY2wyXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvKiogVGhlIHNpZGUgc3R5bGUsIGZvciB0aGUgc2hhZG93IGVmZmVjdCAqL1xyXG4gICAgICAgIGNvbnN0IHNpZGVTdHlsZSA9IG5ldyBTaWRlU3R5bGUoe1xyXG4gICAgICAgICAgICAvL3doaXRlIG9yIGJsYWNrLCBkZXBlbmRpbmcgb24gb3JpZW50YXRpb24gYW5kIHZhbHVlXHJcbiAgICAgICAgICAgIGNvbG9yOiAoc2lkZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgdiA9IGdldFNpZGVWYWx1ZShzaWRlKVxyXG4gICAgICAgICAgICAgICAgaWYgKHYgPT09IDApIHJldHVyblxyXG4gICAgICAgICAgICAgICAgaWYgKHNpZGUub3IgPT09ICd2JykgcmV0dXJuIHYgPCAwID8gb3B0cy5jb2xvckJyaWdodCA6IG9wdHMuY29sb3JEYXJrXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdiA8IDAgPyBvcHRzLmNvbG9yRGFyayA6IG9wdHMuY29sb3JCcmlnaHRcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgLy93aWR0aCBkZXBlbmRzIG9uIHRoZSB2YWx1ZSwgdGhhdCBpcyB0aGUgbnVtYmVyIG9mIGNsYXNzZXMgb2YgZGlmZm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50ZXh0KGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKHRleHQgPT0gdW5kZWZpbmVkIHx8IHRleHQgPT0gbnVsbCB8fCB0ZXh0ICsgJycgPT09ICcnKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy9jb2xvclxyXG4gICAgICAgICAgICBjb25zdCBjb2wgPSB0aGlzLmNvbG9yID8gdGhpcy5jb2xvcihjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgIGlmICghY29sKSBjb250aW51ZVxyXG4gICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gY29sXHJcblxyXG4gICAgICAgICAgICAvL2ZvbnQgc2l6ZVxyXG4gICAgICAgICAgICAvL3NpemUgLSBpbiBwaXhlbCB1bml0XHJcbiAgICAgICAgICAgIGNvbnN0IGZvbnRTaXplUGl4ID0gdGhpcy5mb250U2l6ZShjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIC8gelxyXG4gICAgICAgICAgICBpZiAoIWZvbnRTaXplUGl4KSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy9zZXQgZm9udFxyXG4gICAgICAgICAgICBjb25zdCBmb250RmFtaWx5ID0gdGhpcy5mb250RmFtaWx5ID8gdGhpcy5mb250RmFtaWx5KGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiAnQXJpYWwnXHJcbiAgICAgICAgICAgIGNvbnN0IGZvbnRXZWlnaHQgPSB0aGlzLmZvbnRXZWlnaHQgPyB0aGlzLmZvbnRXZWlnaHQoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6ICdib2xkJ1xyXG4gICAgICAgICAgICBjdHguZm9udCA9IGZvbnRXZWlnaHQgKyAnICcgKyBmb250U2l6ZVBpeCArICdweCAnICsgZm9udEZhbWlseVxy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B1bmRlZmluZWRcclxuXHJcbiAgICAgICAgLy9jb21wdXRlIGNlbGwgYW1wbGl0dWRlXHJcbiAgICAgICAgY29uc3QgZ2V0QW1wbGl0dWRlID0gKGMpID0+IHtcclxuICAgICAgICAgICAgbGV0IG1pbiwgbWF4XHJcbiAgICAgICAgICAgIGZvciAobGV0IHQgb2YgdGhpcy50cykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgdmFsID0gY1t0XVxyXG4gICAgICAgICAgICAgICAgaWYgKHZhbCA9PSB1bmRlZmluZWQpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICBpZiAobWluID09IHVuZGVmaW5lZCB8fCB2YWwgPCBtaW4pIG1pbiA9IHZhbFxyXG4gICAgICAgICAgICAgICAgaWYgKG1heCA9PSB1bmRlZmluZWQgfHwgdmFsID4gbWF4KSBtYXggPSB2YWxcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAobWluID09IHVuZGVmaW5lZCkgcmV0dXJuIHVuZGVmaW5lZFxyXG4gICAgICAgICAgICByZXR1cm4gbWF4IC0gbWluXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2NvbXB1dGUgbWF4IGFtcGxpdHVkZVxyXG4gICAgICAgIGxldCBhbXBNYXhcclxuICAgICAgICBmb3IgKGxldCBjIG9mIGNlbGxzKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGFtcCA9IGdldEFtcGxpdHVkZShjKVxyXG4gICAgICAgICAgICBpZiAoYW1wID09IHVuZGVmaW5lZCkgY29udGludWVcclxuICAgICAgICAgICAgaWYgKGFtcE1heCA9PSB1bmRlZmluZWQgfHwgYW1wID4gYW1wTWF4KSBhbXBNYXggPSBhbXBcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKCFhbXBNYXgpIHJldHVyblxyXG5cclxuICAgICAgICBjb25zdCBuYiA9IHRoaXMudHMubGVuZ3RoXHJcblxyXG4gICAgICAgIGN0eC5saW5lQ2FwID0gJ2J1dHQnXHJcbiAgICAgICAgZm9yIChsZXQgYyBvZiBjZWxscykge1xyXG4gICAgICAgICAgICAvL2xpbmUgd2lkdGhcclxuICAgICAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgICAgICBjb25zdCB3RyA9IHRoaXMubGluZVdpZHRoID8gdGhpcy5saW5lV2lkdGgoYywgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICBpZiAoIXdHIHx8IHdHIDwgMCkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vbGluZSBjb2xvclxyXG4gICAgICAgICAgICAvKiogQHR5cGUge3N0cmluZ3x1bmRlZmluZWR9ICovXHJcbiAgICAgICAgICAgIGNvbnN0IGNvbCA9IHRoaXMuY29sb3IgPyB0aGlzLmNvbG9yKGMsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKCFjb2wpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL3hcclxuICAgICAgICAgICAgY29uc3Qgb2ZmWCA9IHRoaXMub2Zmc2V0WCA/IHRoaXMub2Zmc2V0WChjLCByZXNvbHV0aW9uLCB6KSA6IDBcclxuICAgICAgICAgICAgaWYgKG9mZlggPT0gdW5kZWZpbmVkIHx8IGlzTmFOKG9mZlgpKSBjb250aW51ZVxyXG4gICAgICAgICAgICBjb25zdCB3ID0gdGhpcy53aWR0aCA/IHRoaXMud2lkdGgoYywgcmVzb2x1dGlvbiwgeikgOiByZXNvbHV0aW9uXHJcbiAgICAgICAgICAgIGlmICh3ID09IHVuZGVmaW5lZCB8fCBpc05hTih3KSkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8veVxyXG4gICAgICAgICAgICBjb25zdCBvZmZZID0gdGhpcy5vZmZzZXRZID8gdGhpcy5vZmZzZXRZKGMsIHJlc29sdXRpb24sIHopIDogMFxyXG4gICAgICAgICAgICBpZiAob2ZmWSA9PSB1bmRlZmluZWQgfHwgaXNOYU4ob2ZmWSkpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGNvbnN0IGggPSB0aGlzLmhlaWdodCA/IHRoaXMuaGVpZ2h0KGMsIHJlc29sdXRpb24sIHopIDogcmVzb2x1dGlvblxyXG4gICAgICAgICAgICBpZiAoaCA9PSB1bmRlZmluZWQgfHwgaXNOYU4oaCkpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGNvbnN0IGFuY2hZID0gdGhpcy5hbmNob3JNb2RlWSA/IHRoaXMuYW5jaG9yTW9kZVkoYywgcmVzb2x1dGlvbiwgeikgOiAnY2VudGVyJ1xyXG4gICAgICAgICAgICBpZiAoIWFuY2hZKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IHdHXHJcbiAgICAgICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IGNvbFxyXG5cclxuICAgICAgICAgICAgLy9jb21wdXRlIGFuY2hvciBZIGZpZ3VyZXNcclxuICAgICAgICAgICAgbGV0IHZhbDAsIHkwXHJcbiAgICAgICAgICAgIGlmIChhbmNoWSA9PT0gJ2ZpcnN0Jykge1xyXG4gICAgICAgICAgICAgICAgLy9nZXQgZmlyc3QgdmFsdWVcclxuICAgICAgICAgICAgICAgIHZhbDAgPSBjW3RoaXMudHNbMF1dXHJcbiAgICAgICAgICAgICAgICB5MCA9IDBcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChhbmNoWSA9PT0gJ2xhc3QnKSB7XHJcbiAgICAgICAgICAgICAgICAvL2dldCBsYXN0IHZhbHVlXHJcbiAgICAgICAgICAgICAgICB2YWwwID0gY1t0aGlzLnRzW3RoaXMudHMubGVuZ3RoIC0gMV1dXHJcbiAgICAgICAgICAgICAgICB5MCA9IDBcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChhbmNoWSA9PT0gJ2JvdHRvbScpIHtcclxuICAgICAgICAgICAgICAgIC8vZ2V0IG1pblxyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgdCBvZiB0aGlzLnRzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsID0gK2NbdF1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodmFsID09IHVuZGVmaW5lZCkgY29udGludWVcclxuICAgICAgICAgICAgICAgICAgICBpZiAodmFsMCA9PSB1bmRlZmluZWQgfHwgdmFsIDwgdmFsMCkgdmFsMCA9IHZhbFxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgeTAgPSAwXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoYW5jaFkgPT09ICd0b3AnKSB7XHJcbiAgICAgICAgICAgICAgICAvL2dldCBtYXhcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IHQgb2YgdGhpcy50cykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9ICtjW3RdXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbCA9PSB1bmRlZmluZWQpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbDAgPT0gdW5kZWZpbmVkIHx8IHZhbCA+IHZhbDApIHZhbDAgPSB2YWxcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHkwID0gcmVzb2x1dGlvblxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGFuY2hZID09PSAnY2VudGVyJykge1xyXG4gICAgICAgICAgICAgICAgLy9nZXQgbWluIGFuZCBtYXhcclxuICAgICAgICAgICAgICAgIGxldCBtaW4sIG1heFxyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgdCBvZiB0aGlzLnRzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsID0gY1t0XVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWwgPT0gdW5kZWZpbmVkKSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChtaW4gPT0gdW5kZWZpbmVkIHx8IHZhbCA8IG1pbikgbWluID0gdmFsXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1heCA9PSB1bmRlZmluZWQgfHwgdmFsID4gbWF4KSBtYXggPSB2YWxcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHZhbDAgPSAoK21heCArICttaW4pICogMC41XHJcbiAgICAgICAgICAgICAgICB5MCA9IHJlc29sdXRpb24gLyAyXHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnVW5leHBlY3RlZCBhbmNob3JNb2RlWTogJyArIGFuY2hZKVxyXG4gICAgICAgICAgICAgICAgY29udGludWVcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLyovZHJhdyBsaW5lXHJcbiAgICAgICAgICAgIGlmICh2YWwwID09IHVuZGVmaW5lZCB8fCBpc05hTih2YWwwKSkgY29udGludWVcclxuICAgICAgICAgICAgY2cuY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgIGNvbnN0IHNYID0gdyAvIChuYiAtIDEpXHJcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbmI7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgdmFsID0gY1t0aGlzLnRzW2ldXVxyXG4gICAgICAgICAgICAgICAgaWYgKHZhbCA9PSB1bmRlZmluZWQgfHwgaXNOYU4odmFsKSkgYnJlYWtcclxuICAgICAgICAgICAgICAgIGlmIChpID09IDApXHJcbiAgICAgICAgICAgICAgICAgICAgY2cuY3R4Lm1vdmVUbyhjLnggKyBpICogc1ggKyBvZmZYLCBjLnkgKyB5MCArICh2YWwgLSB2YWwwKSAqIGggLyBhbXBNYXggKyBvZmZZKVxyXG4gICAgICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICAgICAgICAgIGNnLmN0eC5saW5lVG8oYy54ICsgaSAqIHNYICsgb2ZmWCwgYy55ICsgeTAgKyAodmFsIC0gdmFsMCkgKiBoIC8gYW1wTWF4ICsgb2ZmWSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjZy5jdHguc3Ryb2tlKCkqL1xyXG5cclxuICAgICAgICAgICAgLy9kcmF3IGxpbmUsIHNlZ21lbnQgYnkgc2VnbWVudFxyXG4gICAgICAgICAgICBjb25zdCBzWCA9IHcgLyAobmIgLSAxKVxyXG5cclxuICAgICAgICAgICAgLy9oYW5kbGUgZmlyc3QgcG9pbnRcclxuICAgICAgICAgICAgbGV0IHYwID0gY1t0aGlzLnRzWzBdXVxyXG4gICAgICAgICAgICBpZiAoIXRoaXMubm9EYXRhKHYwKSkge1xyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGMueCArIG9mZlgsIGMueSArIHkwICsgKCh2MCAtIHZhbDApICogaCkgLyBhbXBNYXggKyBvZmZZKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vY29uc29sZS5sb2codjAsIGlzTmFOKHYwKSlcclxuXHJcbiAgICAgICAgICAgIGxldCB2MVxyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IG5iOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIHYxID0gY1t0aGlzLnRzW2ldXVxyXG5cclxuICAgICAgICAgICAgICAgIC8vZHJhdyBzZWdtZW50IGZyb20gdjAgdG8gdjFcclxuXHJcbiAgICAgICAgICAgICAgICAvL2JvdGggcG9pbnRzICdubyBkYXRhJ1xyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubm9EYXRhKHYwKSAmJiB0aGlzLm5vRGF0YSh2MSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAvL3NlY29uZCBwb2ludCAnbm8gZGF0YSdcclxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIXRoaXMubm9EYXRhKHYwKSAmJiB0aGlzLm5vRGF0YSh2MSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBjdHguc3Ryb2tlKClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLy9maXJzdCBwb2ludCAnbm8gZGF0YSdcclxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5ub0RhdGEodjApICYmICF0aGlzLm5vRGF0YSh2MSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGMueCArIGkgKiBzWCArIG9mZlgsIGMueSArIHkwICsgKCh2MSAtIHZhbDApICogaCkgLyBhbXBNYXggKyBvZmZZKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAvL2JvdGggcG9pbnRzIGhhdmUgZGF0YTogdHJhY2UgbGluZVxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCArIGkgKiBzWCArIG9mZlgsIGMueSArIHkwICsgKCh2MSAtIHZhbDApICogaCkgLyBhbXBNYXggKyBvZmZZKVxyXG4gICAgICAgICAgICAgICAgICAgIC8vaWYgaXQgaXMgdGhlIGxhc3QgcG9pbnQsIHN0cm9rZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChpID09IG5iIC0gMSkgY3R4LnN0cm9rZSgpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB2MCA9IHYxXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vdXBkYXRlIGxlZ2VuZCwgaWYgYW55XHJcbiAgICAgICAgdGhpcy51cGRhdGVMZWdlbmRzKHsgc3R5bGU6IHRoaXMsIHJlc29sdXRpb246IHJlc29sdXRpb24sIHo6IHosIHZpZXdTY2FsZTogdmlld1NjYWxlIH0pXHJcbiAgICB9XHJcbn1cclxuIiwiLy9AdHMtY2hlY2tcbid1c2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VjMyhwb3MsIDEuMCksIDEuMCk7XG4gICAgICAgICAgICAgIGdsX1BvaW50U2l6ZSA9IHNpemVQaXg7XG4gICAgICAgICAgICAgIHZDb2xvciA9IGNvbG9yO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIGBcbiAgICAgICAgICAgICksXG4gICAgICAgICAgICBjcmVhdGVTaGFkZXIoXG4gICAgICAgICAgICAgICAgZ2wsXG4gICAgICAgICAgICAgICAgZ2wuRlJBR01FTlRfU0hBREVSLFxuICAgICAgICAgICAgICAgIGBcbiAgICAgICAgICAgIHByZWNpc2lvbiBtZWRpdW1wIGZsb2F0O1xuICAgICAgICAgICAgdmFyeWluZyB2ZWM0IHZDb2xvcjtcbiAgICAgICAgICAgIHZvaWQgbWFpbih2b2lkKSB7XG4gICAgICAgICAgICAgICAgdmVjNCB2Q29sb3JfID0gdkNvbG9yIC8gMjU1LjA7XG4gICAgICAgICAgICAgICAgdkNvbG9yX1szXSA9IDI1NS4wICogdkNvbG9yX1szXTtcbiAgICAgICAgICAgICAgICBnbF9GcmFnQ29sb3IgPSB2Q29sb3JfO1xuICAgICAgICAgICAgfWBcbiAgICAgICAgICAgIClcbiAgICAgICAgKVxuICAgICAgICBnbC51c2VQcm9ncmFtKHRoaXMucHJvZ3JhbSlcblxuICAgICAgICAvL2J1ZmZlciBkYXRhXG4gICAgICAgIHRoaXMudmVydGljZXNCdWZmZXIgPSBbXVxuICAgICAgICB0aGlzLmNvbG9yc0J1ZmZlciA9IFtdXG4gICAgfVxuXG4gICAgLyoqIEFkZCBkYXRhIHRvIHZlcnRpY2VzL3NpemUvY29sb3IgYnVmZmVycyBmb3IgY29sb3Igc3F1YXJlcyBkcmF3aW5nICovXG4gICAgYWRkUG9pbnREYXRhKHhDLCB5QywgY29sKSB7XG4gICAgICAgIC8vY29udmVydCBjb2xvclxuICAgICAgICBjb25zdCBjYyA9IGNvbG9yKGNvbClcbiAgICAgICAgLy9jb25zdCBjYyA9IHtyOjQ1LGc6ODcsYjo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BhdHRyaWJ1dGUgdmVjMiBwb3M7XG4gICAgICAgIHVuaWZvcm0gZmxvYXQgc2l6ZVBpeDtcbiAgICAgICAgdW5pZm9ybSBtYXQzIG1hdDtcblxuICAgICAgICBhdHRyaWJ1dGUgZmxvYXQgdDtcbiAgICAgICAgdmFyeWluZyBmbG9hdCB2dDtcblxuICAgICAgICB2b2lkIG1haW4oKSB7XG4gICAgICAgICAgZ2xfUG9zaXRpb24gPSB2ZWM0KG1hdCAqIHZlYzMocG9zLCAxLjApLCAxLjApO1xuICAgICAgICAgIGdsX1BvaW50U2l6ZSA9IHNpemVQaXg7XG4gICAgICAgICAgdnQgPSB0O1xuICAgICAgICB9XG4gICAgICBgXG4gICAgICAgIClcblxuICAgICAgICAvL3ByZXBhcmUgZnJhZ21lbnQgc2hhZGVyIGNvZGVcbiAgICAgICAgLy9kZWNsYXJlIHRoZSB1bmlmb3JtIGFuZCBvdGhlciB2YXJpYWJsZXNcbiAgICAgICAgbGV0IGZzaFN0cmluZyA9XG4gICAgICAgICAgICAnJyArXG4gICAgICAgICAgICAncHJlY2lzaW9uIG1lZGl1bXAgZmxvYXQ7XFxuJyArXG4gICAgICAgICAgICAndmFyeWluZyBmbG9hdCB2dDtcXG4nICtcbiAgICAgICAgICAgICd1bmlmb3JtIGZsb2F0IGFscGhhO1xcbicgK1xuICAgICAgICAgICAgKCgpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBvdXQgPSBbXVxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY29sb3JzLmxlbmd0aDsgaSsrKSBvdXQucHVzaCgndW5pZm9ybSB2ZWM0IGMnICsgaSArICc7XFxuJylcbiAgICAgICAgICAgICAgICByZXR1cm4gb3V0LmpvaW4oJycpXG4gICAgICAgICAgICB9KSgpICtcbiAgICAgICAgICAgIC8vc3RhcnQgdGhlIG1haW4gZnVuY3Rpb24sIGFwcGx5IHRoZSBzdHJldGNoaW5nIG9mIHRcbiAgICAgICAgICAgICd2b2lkIG1haW4odm9pZCkge1xcbidcblxuICAgICAgICBpZiAoc3RyZXRjaGluZykge1xuICAgICAgICAgICAgaWYgKHN0cmV0Y2hpbmcuZnVuID09ICdwb3cnKVxuICAgICAgICAgICAgICAgIC8vc1BvdyA9ICh0LCBhbHBoYSA9IDMpID0+IE1hdGgucG93KHQsIGFscGhhKTtcbiAgICAgICAgICAgICAgICBmc2hTdHJpbmcgKz0gJyAgIGZsb2F0IHQgPSBwb3codnQsIGFscGhhKTtcXG4nXG4gICAgICAgICAgICBlbHNlIGlmIChzdHJldGNoaW5nLmZ1biA9PSAncG93SW52JylcbiAgICAgICAgICAgICAgICAvL3NQb3dSZXYgPSAodCwgYWxwaGEgPSAzKSA9PiAxIC0gTWF0aC5wb3coMSAtIHQsIDEgLyBhbHBoYSk7XG4gICAgICAgICAgICAgICAgZnNoU3RyaW5nICs9ICcgICBmbG9hdCB0ID0gMS4wLXBvdygxLjAtdnQsIDEuMC9hbHBoYSk7XFxuJ1xuICAgICAgICAgICAgZWxzZSBpZiAoc3RyZXRjaGluZy5mdW4gPT0gJ2V4cCcpXG4gICAgICAgICAgICAgICAgLy9zRXhwID0gKHQsIGFscGhhID0gMykgPT4gYWxwaGEgPT0gMCA/IHQgOiAoTWF0aC5leHAodCAqIGFscGhhKSAtIDEpIC8gKE1hdGguZXhwKGFscGhhKSAtIDEpO1xuICAgICAgICAgICAgICAgIGZzaFN0cmluZyArPVxuICAgICAgICAgICAgICAgICAgICBzdHJldGNoaW5nLmFscGhhID09IDBcbiAgICAgICAgICAgICAgICAgICAgICAgID8gYGZsb2F0IHQgPSB2dDtgXG4gICAgICAgICAgICAgICAgICAgICAgICA6ICcgICBmbG9hdCB0ID0gKGV4cCh2dCAqIGFscGhhKSAtIDEuMCkgLyAoZXhwKGFscGhhKSAtIDEuMCk7XFxuJ1xuICAgICAgICAgICAgZWxzZSBpZiAoc3RyZXRjaGluZy5mdW4gPT0gJ2xvZycpXG4gICAgICAgICAgICAgICAgLy9zRXhwUmV2ID0gKHQsIGFscGhhID0gMykgPT4gYWxwaGEgPT0gMCA/IHQgOiAxIC0gKDEgLyBhbHBoYSkgKiBNYXRoLmxvZyhNYXRoLmV4cChhbHBoYSkgKiAoMSAtIHQpICsgdCk7XG4gICAgICAgICAgICAgICAgZnNoU3RyaW5nICs9XG4gICAgICAgICAgICAgICAgICAgIHN0cmV0Y2hpbmcuYWxwaGEgPT0gMFxuICAgICAgICAgICAgICAgICAgICAgICAgPyBgZmxvYXQgdCA9IHZ0O2BcbiAgICAgICAgICAgICAgICAgICAgICAgIDogJyAgIGZsb2F0IHQgPSAxLjAgLSAoMS4wIC8gYWxwaGEpICogbG9nKGV4cChhbHBoYSkgKiAoMS4wIC0gdnQpICsgdnQpO1xcbidcbiAgICAgICAgICAgIGVsc2UgaWYgKHN0cmV0Y2hpbmcuZnVuID09ICdjaXJjbGUnKSB7XG4gICAgICAgICAgICAgICAgaWYgKHN0cmV0Y2hpbmcuYWxwaGEgPT0gMClcbiAgICAgICAgICAgICAgICAgICAgLy9pZiAoYWxwaGEgPT0gMCkgcmV0dXJuIHQ7XG4gICAgICAgICAgICAgICAgICAgIGZzaFN0cmluZyArPSAnICAgZmxvYXQgdCA9IHZ0O1xcbidcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzdHJldGNoaW5nLmFscGhhID09IDEpXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmIChhbHBoYSA9PSAxKSByZXR1cm4gTWF0aC5zcXJ0KDIgKiB0IC0gdCAqIHQpO1xuICAgICAgICAgICAgICAgICAgICBmc2hTdHJpbmcgKz0gJyAgIGZsb2F0IHQgPSBzcXJ0KHZ0ICogKDIuMCAtIHZ0KSk7XFxuJ1xuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvL2NvbnN0IGEgPSBhbHBoYSAvICgxIC0gYWxwaGEpO1xuICAgICAgICAgICAgICAgICAgICAvL3JldHVybiBNYXRoLnNxcnQoMSAvIChhICogYSkgKyB0ICogKDIgLyBhICsgMiAtIHQpKSAtIDEgLyBhO1xuICAgICAgICAgICAgICAgICAgICBmc2hTdHJpbmcgKz1cbiAgICAgICAgICAgICAgICAgICAgICAgICcgICBmbG9hdCBhID0gYWxwaGEgLyAoMS4wIC0gYWxwaGEpO1xcbicgK1xuICAgICAgICAgICAgICAgICAgICAgICAgJyAgIGZsb2F0IHQgPSBzcXJ0KDEuMCAvIChhICogYSkgKyB2dCAqICggMi4wL2EgKyAyLjAgLSB2dCApKSAtIDEuMCAvIGE7XFxuJ1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RyZXRjaGluZy5mdW4gPT0gJ2NpcmNsZUludicpIHtcbiAgICAgICAgICAgICAgICAvLyAxIC0gc0NpcmNsZUxvdygxIC0gdCwgYWxwaGEpXG4gICAgICAgICAgICAgICAgaWYgKHN0cmV0Y2hpbmcuYWxwaGEgPT0gMClcbiAgICAgICAgICAgICAgICAgICAgLy9pZiAoYWxwaGEgPT0gMCkgcmV0dXJuIHQ7XG4gICAgICAgICAgICAgICAgICAgIGZzaFN0cmluZyArPSAnICAgZmxvYXQgdCA9IHZ0O1xcbidcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzdHJldGNoaW5nLmFscGhhID09IDEpXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmIChhbHBoYSA9PSAxKSByZXR1cm4gTWF0aC5zcXJ0KDIgKiB0IC0gdCAqIHQpO1xuICAgICAgICAgICAgICAgICAgICBmc2hTdHJpbmcgKz0gJyAgIGZsb2F0IHQgPSAxLjAgLSBzcXJ0KCgxLjAgLSB2dCkgKiAoMS4wICsgdnQpKTtcXG4nXG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vY29uc3QgYSA9IGFscGhhIC8gKDEgLSBhbHBoYSk7XG4gICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIE1hdGguc3FydCgxIC8gKGEgKiBhKSArICgyICogdCkgLyBhICsgMiAqIHQgLSB0ICogdCkgLSAxIC8gYTtcbiAgICAgICAgICAgICAgICAgICAgZnNoU3RyaW5nICs9XG4gICAgICAgICAgICAgICAgICAgICAgICAnICAgZmxvYXQgYSA9IGFscGhhIC8gKDEuMCAtIGFscGhhKTtcXG4nICtcbiAgICAgICAgICAgICAgICAgICAgICAgICcgICBmbG9hdCB0ID0gMS4wIC0gc3FydCgxLjAgLyAoYSAqIGEpICsgKDEuMC12dCkgKiAoIDIuMC9hICsgMS4wICsgdnQgKSkgKyAxLjAgLyBhO1xcbidcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoJ1VuZXhwZWN0ZWQgc3RyZXRjaGluZyBmdW5jdGlvbiBjb2RlOiAnICsgc3RyZXRjaGluZy5mdW4pXG4gICAgICAgICAgICAgICAgZnNoU3RyaW5nICs9ICcgICBmbG9hdCB0ID0gdnQ7XFxuJ1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZnNoU3RyaW5nICs9ICcgICBmbG9hdCB0ID0gdnQ7XFxuJ1xuICAgICAgICB9XG5cbiAgICAgICAgLy9jaG9vc2UgaW5pdGlhbCBhbmQgZmluYWwgY29sb3JzLCBhbmQgYWRqdXN0IHQgdmFsdWVcbiAgICAgICAgaWYgKGNvbG9ycy5sZW5ndGggPT0gMSkgZnNoU3RyaW5nICs9ICcgICB2ZWM0IGNJPWMwO1xcbiAgIHZlYzQgY0Y9YzA7XFxuJ1xuICAgICAgICBlbHNlIGlmIChjb2xvcnMubGVuZ3RoID09IDIpIGZzaFN0cmluZyArPSAnICAgdmVjNCBjST1jMDtcXG4gICB2ZWM0IGNGPWMxO1xcbidcbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBjb25zdCBuYiA9IGNvbG9ycy5sZW5ndGggLSAxXG4gICAgICAgICAgICBjb25zdCBuYnMgPSBuYiArICcuMCdcbiAgICAgICAgICAgIGZzaFN0cmluZyArPSAnICAgdmVjNCBjSTtcXG4nXG4gICAgICAgICAgICBmc2hTdHJpbmcgKz0gJyAgIHZlYzQgY0Y7XFxuJ1xuICAgICAgICAgICAgZnNoU3RyaW5nICs9ICcgICBpZih0PDEuMC8nICsgbmJzICsgJykgeyBjST1jMDsgY0Y9YzE7IHQ9dConICsgbmJzICsgJzsgfVxcbidcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAyOyBpIDwgbmI7IGkrKylcbiAgICAgICAgICAgICAgICBmc2hTdHJpbmcgKz1cbiAgICAgICAgICAgICAgICAgICAgJyAgIGVsc2UgaWYodDwnICtcbiAgICAgICAgICAgICAgICAgICAgaSArXG4gICAgICAgICAgICAgICAgICAgICcuMC8nICtcbiAgICAgICAgICAgICAgICAgICAgbmJzICtcbiAgICAgICAgICAgICAgICAgICAgJykgeyBjST1jJyArXG4gICAgICAgICAgICAgICAgICAgIChpIC0gMSkgK1xuICAgICAgICAgICAgICAgICAgICAnOyBjRj1jJyArXG4gICAgICAgICAgICAgICAgICAgIGkgK1xuICAgICAgICAgICAgICAgICAgICAnOyB0PScgK1xuICAgICAgICAgICAgICAgICAgICBuYnMgK1xuICAgICAgICAgICAgICAgICAgICAnKnQtJyArXG4gICAgICAgICAgICAgICAgICAgIChpIC0gMSkgK1xuICAgICAgICAgICAgICAgICAgICAnLjA7IH1cXG4nXG4gICAgICAgICAgICBmc2hTdHJpbmcgKz1cbiAgICAgICAgICAgICAgICAnICAgZWxzZSB7IGNJPWMnICsgKG5iIC0gMSkgKyAnOyBjRj1jJyArIG5iICsgJzsgdD0nICsgbmJzICsgJyp0LScgKyAobmIgLSAxKSArICcuMDsgfVxcbidcbiAgICAgICAgfVxuXG4gICAgICAgIC8vb25lIHNpbmdsZSBjb2xvclxuICAgICAgICBpZiAoY29sb3JzLmxlbmd0aCA9PSAxKSBmc2hTdHJpbmcgKz0gJyAgIGdsX0ZyYWdDb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G4gICAgICAgICAgICBpZiAoaSA+IDApIG91dC5wdXNoKCdlbHNlICcpXG4gICAgICAgICAgICBvdXQucHVzaCgnaWYodmk9PScpXG4gICAgICAgICAgICBvdXQucHVzaChpKVxuICAgICAgICAgICAgb3V0LnB1c2goJy4wKSBnbF9GcmFnQ29sb3IgPSB2ZWM0KGMnKVxuICAgICAgICAgICAgb3V0LnB1c2goaSlcbiAgICAgICAgICAgIG91dC5wdXNoKCdbMF0sIGMnKVxuICAgICAgICAgICAgb3V0LnB1c2goaSlcbiAgICAgICAgICAgIG91dC5wdXNoKCdbMV0sIGMnKVxuICAgICAgICAgICAgb3V0LnB1c2goaSlcbiAgICAgICAgICAgIG91dC5wdXNoKCdbMl0sIGMnKVxuICAgICAgICAgICAgb3V0LnB1c2goaSlcbiAgICAgICAgICAgIG91dC5wdXNoKCdbM10pO1xcbicpXG4gICAgICAgIH1cbiAgICAgICAgb3V0LnB1c2goJ2Vsc2UgZ2xfRnJhZ0NvbG9yID0gdmVjNCgwLjAsIDAuMCwgMC4wLCAxLjApO1xcbn0nKVxuICAgICAgICAvKiogRnJhZ21lbnQgc2hhZGVyIHByb2dyYW1cbiAgICAgICAgICogQHR5cGUge3N0cmluZ30gKi9cbiAgICAgICAgdGhpcy5mc2hTdHJpbmcgPSBvdXQuam9pbignJylcbiAgICB9XG5cbiAgICAvKiogICovXG4gICAgZHJhdyhnbCwgdmVydGljZXNCdWZmZXIsIGlCdWZmZXIsIHRyYW5zZm9NYXQsIHNpemVQaXggPSAxMCkge1xuICAgICAgICAvKiogQHR5cGUge1dlYkdMU2hhZGVyfSAqL1xuICAgICAgICBjb25zdCB2U2hhZGVyID0gY3JlYXRlU2hhZGVyKGdsLCBnbC5WRVJURVhfU0hBREVSLCB0aGlzLnZzaFN0cmluZylcblxuICAgICAgICAvKiogQHR5cGUge1dlYkdMU2hhZGVyfSAqL1xuICAgICAgICBjb25zdCBmU2hhZGVyID0gY3JlYXRlU2hhZGVyKGdsLCBnbC5GUkF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ICAgICBjb25zdCBkb21haW5TaXplID0gZG9tYWluWzFdIC0gZG9tYWluWzBdLFxyXG4gICAgICAgICAgICBkb21haW5NaW4gPSBkb21haW5bMF1cclxuICAgICAgICBjb25zdCByYW5nZVNpemUgPSByYW5nZVsxXSAtIHJhbmdlWzBdLFxyXG4gICAgICAgICAgICByYW5nZU1pbiA9IHJhbmdlWzBdXHJcbiAgICAgICAgcmV0dXJuICh0KSA9PiB7XHJcbiAgICAgICAgICAgIC8vc2NhbGUgdG8gWzAsMV1cclxuICAgICAgICAgICAgdCA9ICh0IC0gZG9tYWluTWluKSAvIGRvbWFpblNpemVcclxuICAgICAgICAgICAgLy9zdHJldGNoXHJcbiAgICAgICAgICAgIGlmIChzdHJldGNoaW5nKSB0ID0gc3RyZXRjaGluZyh0KVxyXG4gICAgICAgICAgICAvL2NsYXNzaWZ5XHJcbiAgICAgICAgICAgIGlmIChjbGFzc051bWJlcikgdCA9IHQgPT0gMSA/IDEgOiBNYXRoLmZsb29yKHQgKiBjbGFzc051bWJlcikgLyAoY2xhc3NOdW1iZXIgLSAxKVxyXG4gICAgICAgICAgICAvL3NjYWxlIHRvIHJhbmdlXHJcbiAgICAgICAgICAgIHJldHVybiByYW5nZU1pbiArIHQgKiByYW5nZVNpemVcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuXHJcbi8qKlxyXG4gKiBHZW5lcmljIGZ1bmN0aW9uIGZvciB2aWV3IHNjYWxlIC0gcXVhbnRpbGVcclxuICpcclxuICogQHBhcmFtIHt7IHZhbHVlRnVuY3Rpb246ZnVuY3Rpb24oaW1wb3J0KFwiLi4vY29yZS9EYXRhc2V0XCIpLkNlbGwpOm51bWJlciwgY2xhc3NOdW1iZXI/Om51bWJlciwgbWluU2l6ZVBpeD86bnVtYmVyLCBtYXhTaXplRmFjdG9yPzpudW1iZXIgfX0gb3B0c1xyXG4gKiBAcmV0dXJucyB7ZnVuY3Rpb24oQXJyYXkuPGltcG9ydChcIi4uL2NvcmUvRGF0YXNldFwiKS5DZWxsPik6U2NhbGV9XHJcbiAqL1xyXG5leHBvcnQgY29uc3Qgdmlld1NjYWxlUXVhbnRpbGUgPSAob3B0cykgPT4ge1xyXG4gICAgY29uc3QgdmFsdWVGdW5jdGlvbiA9IG9wdHMudmFsdWVGdW5jdGlvblxyXG4gICAgY29uc3QgY2xhc3NOdW1iZXIgPSBvcHRzLmNsYXNzTnVtYmVyIHx8IDEyXHJcbiAgICBjb25zdCBtaW5TaXplUGl4ID0gb3B0cy5taW5TaXplUGl4IHx8IDFcclxuICAgIGNvbnN0IG1heFNpemVGYWN0b3IgPSBvcHRzLm1heFNpemVGYWN0b3IgfHwgMVxyXG4gICAgY29uc3Qgc2NhbGUgPSBzY2FsZVF1YW50aWxlKClcclxuICAgIHJldHVybiAoY2VsbHMsIHJlc29sdXRpb24sIHopID0+IHtcclxuICAgICAgICBzY2FsZS5kb21haW4oY2VsbHMubWFwKHZhbHVlRnVuY3Rpb24pKVxyXG4gICAgICAgIGNvbnN0IG1pblNpemVHZW8gPSBtaW5TaXplUGl4ICogeixcclxuICAgICAgICAgICAgbWF4U2l6ZUdlbyA9IHJlc29sdXRpb24gKiBtYXhTaXplRmFjdG9yXHJcbiAgICAgICAgc2NhbGUucmFuZ2UoXHJcbiAgICAgICAgICAgIEFycmF5LmZyb20oXHJcbiAgICAgICAgICAgICAgICB7IGxlbmd0aDogY2xhc3NOdW1iZXIgfSxcclxuICAgICAgICAgICAgICAgIChfLCBpKSA9PiBtaW5TaXplR2VvICsgKGkgKiAobWF4U2l6ZUdlbyAtIG1pblNpemVHZW8pKSAvIChjbGFzc051bWJlciAtIDEpXHJcbiAgICAgICAgICAgIClcclxuICAgICAgICApXHJcbiAgICAgICAgc2NhbGUuYnJlYWtzID0gc2NhbGUucXVhbnRpbGVzKClcclxuICAgICAgICBzY2FsZS52YWx1ZXMgPSBzY2FsZS5yYW5nZSgpXHJcbiAgICAgICAgcmV0dXJuIHNjYWxlXHJcbiAgICB9XHJcbn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G5cclxuICAgIHJldHVybiAoY2VsbHMpID0+IHtcclxuICAgICAgICBpZiAoY2VsbHMubGVuZ3RoID09IDAgfHwgIWNlbGxzKSByZXR1cm5cclxuICAgICAgICAvKiogQHR5cGUge1t1bmRlZmluZWQsIHVuZGVmaW5lZF0gfCBbbnVtYmVyLCBudW1iZXJdfSAqL1xyXG4gICAgICAgIGNvbnN0IGRvbWFpbiA9IGV4dGVudChjZWxscywgdmFsdWVGdW5jdGlvbilcclxuICAgICAgICBpZiAoZG9tYWluWzBdID09IHVuZGVmaW5lZCkgcmV0dXJuXHJcbiAgICAgICAgY29uc3QgZG9tYWluU2l6ZSA9IGRvbWFpblsxXSAtIGRvbWFpblswXVxyXG4gICAgICAgIGNvbnN0IHNjYWxlID0gKHQpID0+IHtcclxuICAgICAgICAgICAgLy9zY2FsZSB0byBbMCwxXVxyXG4gICAgICAgICAgICB0ID0gKHQgLSBkb21haW5bMF0pIC8gZG9tYWluU2l6ZVxyXG4gICAgICAgICAgICAvL3N0cmV0Y2hcclxuICAgICAgICAgICAgaWYgKHN0cmV0Y2hpbmcpIHQgPSBzdHJldGNoaW5nKHQpXHJcbiAgICAgICAgICAgIHJldHVybiBjb2xvclNjYWxlKHQpXHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vZnVuY3Rpb24gdGhhdCByZXR1cm4gdGhlIGRvbWFpbiB2YWx1ZSBmcm9tIHRoZSBbMCwxXSByYW5nZS5cclxuICAgICAgICBzY2FsZS5pbnZlcnQgPSAodCkgPT4ge1xyXG4gICAgICAgICAgICBpZiAoc3RyZXRjaGluZykgdCA9IHN0cmV0Y2hpbmcuaW52ZXJ0KHQpXHJcbiAgICAgICAgICAgIHJldHVybiBkb21haW5bMF0gKyB0ICogZG9tYWluU2l6ZVxyXG4gICAgICAgIH1cclxuICAgICAgICAvL2Rpc2NyZXRlIGNvbG9yczogcmV0dXJuIHRoZSBicmVha3NcclxuICAgICAgICBpZiAob3B0cy5jb2xvcnMgJiYgbmJDbGF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gICAgICAgICAgIHJldHVybiAnMSdcclxuICAgICAgICB9XHJcbiAgICAgICAgLy9jbGFzcyAyXHJcbiAgICAgICAgaWYgKHMwIDw9IGMwICYmIHMxIDw9IGMxICYmIHMyID49IGMyKSB7XHJcbiAgICAgICAgICAgIC8vY2VudHJhbCBjbGFzcyBuZWFyIGNsYXNzIDJcclxuICAgICAgICAgICAgaWYgKGNjICE9IHVuZGVmaW5lZCAmJiAoczEgLSBjMSkgKiAoYzAgLSBjYyAqIGMwKSA+PSAoczAgLSBjYyAqIGMwKSAqIChjYyAqIGMxIC0gYzEpKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuICdjZW50ZXInXHJcbiAgICAgICAgICAgIHJldHVybiAnMidcclxuICAgICAgICB9XHJcbiAgICAgICAgLy9taWRkbGUgY2xhc3MgMCAtIGludGVyc2VjdGlvbiBjbGFzcyAxIGFuZCAyXHJcbiAgICAgICAgaWYgKHMwIDw9IGMwICYmIHMxID49IGMxICYmIHMyID49IGMyKSB7XHJcbiAgICAgICAgICAgIC8vY2VudHJhbCBjbGFzc1xyXG4gICAgICAgICAgICBpZiAoY2MgIT0gdW5kZWZpbmVkICYmIHMwID4gY2MgKiBjMCkgcmV0dXJuICdjZW50ZXInXHJcbiAgICAgICAgICAgIGlmICh3aXRoTWl4ZWRDbGFzc2VzKSByZXR1cm4gJ20xMidcclxuICAgICAgICAgICAgcmV0dXJuIHMxID4gczIgPyAnMScgOiAnMidcclxuICAgICAgICB9XHJcbiAgICAgICAgLy9taWRkbGUgY2xhc3MgMSAtIGludGVyc2VjdGlvbiBjbGFzcyAwIGFuZCAxXHJcbiAgICAgICAgaWYgKHMwID49IGMwICYmIHMxIDw9IGMxICYmIHMyID49IGMyKSB7XHJcbiAgICAgICAgICAgIC8vY2VudHJhbCBjbGFzc1xyXG4gICAgICAgICAgICBpZiAoY2MgIT0gdW5kZWZpbmVkICYmIHMxID4gY2MgKiBjMSkgcmV0dXJuICdjZW50ZXInXHJcbiAgICAgICAg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uICAgICAgICAgICAgICBhcmdzID0gYXJndW1lbnRzLFxuICAgICAgICAgICAgICBnID0gZ2VzdHVyZSh0aGF0LCBhcmdzKS5ldmVudChldmVudCksXG4gICAgICAgICAgICAgIGUgPSBleHRlbnQuYXBwbHkodGhhdCwgYXJncyksXG4gICAgICAgICAgICAgIHAgPSBwb2ludCA9PSBudWxsID8gY2VudHJvaWQoZSkgOiB0eXBlb2YgcG9pbnQgPT09IFwiZnVuY3Rpb25cIiA/IHBvaW50LmFwcGx5KHRoYXQsIGFyZ3MpIDogcG9pbnQsXG4gICAgICAgICAgICAgIHcgPSBNYXRoLm1heChlWzFdWzBdIC0gZVswXVswXSwgZVsxXVsxXSAtIGVbMF1bMV0pLFxuICAgICAgICAgICAgICBhID0gdGhhdC5fX3pvb20sXG4gICAgICAgICAgICAgIGIgPSB0eXBlb2YgdHJhbnNmb3JtID09PSBcImZ1bmN0aW9uXCIgPyB0cmFuc2Zvcm0uYXBwbHkodGhhdCwgYXJncykgOiB0cmFuc2Zvcm0sXG4gICAgICAgICAgICAgIGkgPSBpbnRlcnBvbGF0ZShhLmludmVydChwKS5jb25jYXQodyAvIGEuayksIGIuaW52ZXJ0KHApLmNvbmNhdCh3IC8gYi5rKSk7XG4gICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHtcbiAgICAgICAgICAgIGlmICh0ID09PSAxKSB0ID0gYjsgLy8gQXZvaWQgcm91bmRpbmcgZXJyb3Igb24gZW5kLlxuICAgICAgICAgICAgZWxzZSB7IHZhciBsID0gaSh0KSwgayA9IHcgLyBsWzJdOyB0ID0gbmV3IFRyYW5zZm9ybShrLCBwWzBdIC0gbFswXSAqIGssIHBbMV0gLSBsWzFdICogayk7IH1cbiAgICAgICAgICAgIGcuem9vbShudWxsLCB0KTtcbiAgICAgICAgICB9O1xuICAgICAgICB9KTtcbiAgfVxuXG4gIGZ1bmN0aW9uIGdlc3R1cmUodGhhdCwgYXJncywgY2xlYW4pIHtcbiAgICByZXR1cm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RoaXMudG91Y2gxWzFdID0gdHJhbnNmb3JtLmludmVydCh0aGlzLnRvdWNoMVswXSk7XG4gICAgICB0aGlzLnRoYXQuX196b29tID0gdHJhbnNmb3JtO1xuICAgICAgdGhpcy5lbWl0KFwiem9vbVwiKTtcbiAgICAgIHJldHVybiB0aGlzO1xuICAgIH0sXG4gICAgZW5kOiBmdW5jdGlvbigpIHtcbiAgICAgIGlmICgtLXRoaXMuYWN0aXZlID09PSAwKSB7XG4gICAgICAgIGRlbGV0ZSB0aGlzLnRoYXQuX196b29taW5nO1xuICAgICAgICB0aGlzLmVtaXQoXCJlbmRcIik7XG4gICAgICB9XG4gICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuICAgIGVtaXQ6IGZ1bmN0aW9uKHR5cGUpIHtcbiAgICAgIHZhciBkID0gc2VsZWN0KHRoaXMudGhhdCkuZGF0dW0oKTtcbiAgICAgIGxpc3RlbmVycy5jYWxsKFxuICAgICAgICB0eXBlLFxuICAgICAgICB0aGlzLnRoYXQsXG4gICAgICAgIG5ldyBab29tRXZlbnQodHlwZSwge1xuICAgICAgICAgIHNvdXJjZUV2ZW50OiB0aGlzLnNvdXJjZUV2ZW50LFxuICAgICAgICAgIHRhcmdldDogem9vbSxcbiAgICAgICAgICB0eXBlLFxuICAgICAgICAgIHRyYW5zZm9ybTogdGhpcy50aGF0Ll9fem9vbSxcbiAgICAgICAgICBkaXNwYXRjaDogbGlzdGVuZXJzXG4gICAgICAgIH0pLFxuICAgICAgICBkXG4gICAgICApO1xuICAgIH1cbiAgfTtcblxuICBmdW5jdGlvbiB3aGVlbGVkKGV2ZW50LCAuLi5hcmdzKSB7XG4gICAgaWYgKCFmaWx0ZXIuYXBwbHkodGhpcywgYXJndW1lbnRzKSkgcmV0dXJuO1xuICAgIHZhciBnID0gZ2VzdHVyZSh0aGlzLCBhcmdzKS5ldmVudChldmVudCksXG4gICAgICAgIHQgPSB0aGlzLl9fem9vbSxcbiAgICAgICAgayA9IE1hdGgubWF4K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gICAgIHRoaXMuem9vbUluQnRuLmlkID0gJ3pvb20taW4nO1xyXG4gICAgICAgIHRoaXMuem9vbUluQnRuLmNsYXNzTmFtZSA9ICdncmlkdml6LXpvb20tYnV0dG9uJztcclxuICAgICAgICB0aGlzLnpvb21JbkJ0bi50aXRsZSA9ICdab29tIGluJztcclxuICAgICAgICB0aGlzLnpvb21JbkJ0bi50ZXh0Q29udGVudCA9ICcrJztcclxuICAgICAgICB0aGlzLnpvb21JbkJ0bi5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsIChlKSA9PiB7XHJcbiAgICAgICAgICAgIHRoaXMuem9vbUluKGUpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIHRoaXMuem9vbUluQnRuLmFkZEV2ZW50TGlzdGVuZXIoJ21vdXNlb3ZlcicsICgpID0+IHtcclxuICAgICAgICAgICAgdGhpcy56b29tSW5CdG4uc3R5bGUuYmFja2dyb3VuZENvbG9yID0gJ2xpZ2h0Z3JleSc7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgdGhpcy56b29tSW5CdG4uYWRkRXZlbnRMaXN0ZW5lcignbW91c2VvdXQnLCAoKSA9PiB7XHJcbiAgICAgICAgICAgIHRoaXMuem9vbUluQnRuLnN0eWxlLmJhY2tncm91bmRDb2xvciA9ICcjZmZmZmZmJztcclxuICAgICAgICB9KTtcclxuICAgIFxyXG4gICAgICAgIC8vIENyZWF0ZSB6b29tIG91dCBidXR0b25cclxuICAgICAgICB0aGlzLnpvb21PdXRCdG4gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdhJyk7XHJcbiAgICAgICAgdGhpcy56b29tT3V0QnRuLmlkID0gJ3pvb20tb3V0JztcclxuICAgICAgICB0aGlzLnpvb21PdXRCdG4uY2xhc3NOYW1lID0gJ2dyaWR2aXotem9vbS1idXR0b24nO1xyXG4gICAgICAgIHRoaXMuem9vbU91dEJ0bi50aXRsZSA9ICdab29tIG91dCc7XHJcbiAgICAgICAgdGhpcy56b29t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ZXh0QWxpZ24gPSAnY2VudGVyJztcclxuICAgICAgICAgICAgYnRuLnN0eWxlLnRleHREZWNvcmF0aW9uID0gJ25vbmUnO1xyXG4gICAgICAgICAgICBidG4uc3R5bGUucGFkZGluZyA9ICc0cHgnO1xyXG4gICAgICAgICAgICBidG4uc3R5bGUuZm9udFNpemUgPSAnMjBweCc7XHJcbiAgICAgICAgICAgIGJ0bi5zdHlsZS5mb250V2VpZ2h0ID0gJ2JvbGQnO1xyXG4gICAgICAgICAgICBidG4uc3R5bGUudXNlclNlbGVjdCA9ICdub25lJztcclxuICAgICAgICAgICAgYnRuLnN0eWxlLmJhY2tncm91bmRDb2xvciA9ICcjZmZmZmZmJztcclxuICAgICAgICAgICAgaWYgKGluZGV4ID09PSAwKSBidG4uc3R5bGUuYm9yZGVyQm90dG9tID0gJzFweCBzb2xpZCBncmV5JzsgLy8gWm9vbSBpbiBidXR0b24gb25seVxyXG4gICAgICAgIH0pO1xyXG4gICAgXHJcbiAgICAgICAgLy8gVW5zZXQgcGFyZW50IGNsYXNzIGhlaWdodCBhbmQgZGlzcGxheSBmb3IgZHVhbCBidXR0b25zXHJcbiAgICAgICAgdGhpcy5zdHlsZSgnaGVpZ2h0JywgJ3Vuc2V0Jyk7XHJcbiAgICAgICAgdGhpcy5zdHlsZSgnZGlzcGxheScsICd1bnNldCcpO1xyXG4gICAgXHJcbiAgICAgICAgLy8gU2V0IHBvc2l0aW9uXHJcbiAgICAgICAgaWYgKG9wdHMueCkge1xyXG4gICAgICAgICAgICB0aGlzLnN0eWxlKCdsZWZ0Jywgb3B0cy54ICsgJ3B4Jyk7XHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgdGhpcy5zdHlsZSgncmlnaHQnLCAnMTBweCcpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAob3B0cy55KSB7XHJcbiAgICAgICAgICAgIHRoaXMuc3R5bGUoJ3RvcCcsIG9wdHMueSArICdweCcpO1xyXG4gICAgICAgIH0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B7e3g6bnVtYmVyLHk6bnVtYmVyfX0gcG9zR2VvXHJcbiAgICAgKiBAcGFyYW0ge0FycmF5LjxDZWxsPn0gY2VsbHMgU29tZSBjZWxscyBmcm9tIHRoZSBkYXRhc2V0IChhIHN1YnNldCBpZiBuZWNlc3NhcnksIHVzdWFsbHkgdGhlIHZpZXcgY2FjaGUpLlxyXG4gICAgICogQHJldHVybnMge0NlbGx8dW5kZWZpbmVkfVxyXG4gICAgICovXHJcbiAgICBnZXRDZWxsRnJvbVBvc2l0aW9uKHBvc0dlbywgY2VsbHMpIHtcclxuICAgICAgICAvL2NvbXB1dGUgY2FuZGlkYXRlIGNlbGwgcG9zaXRpb25cclxuICAgICAgICAvKiogQHR5cGUge251bWJlcn0gKi9cclxuICAgICAgICAvL2NvbnN0IHIgPSB0aGlzLmdldFJlc29sdXRpb24oKVxyXG4gICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfSAqL1xyXG4gICAgICAgIC8vY29uc3QgY2VsbFggPSByICogTWF0aC5mbG9vcihwb3NHZW8ueCAvIHIpXHJcbiAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ9ICovXHJcbiAgICAgICAgLy9jb25zdCBjZWxsWSA9IHIgKiBNYXRoLmZsb29yKHBvc0dlby55IC8gcilcclxuXHJcbiAgICAgICAgLyovZ2V0IGNlbGxcclxuICAgICAgICBmb3IgKGNvbnN0IGNlbGwgb2YgY2VsbHMpIHtcclxuICAgICAgICAgICAgaWYgKGNlbGwueCAhPSBjZWxsWCkgY29udGludWVcclxuICAgICAgICAgICAgaWYgKGNlbGwueSAhPSBjZWxsWSkgY29udGludWVcclxuICAgICAgICAgICAgcmV0dXJuIGNlbGxcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHVuZGVmaW5lZCovXHJcblxyXG4gICAgICAgIC8vcmFyZSBjYXNlIG9mIG1peGVkIHJlc29sdXRpb24gZGF0YXNldFxyXG4gICAgICAgIGlmICh0aGlzLm1peGVkUmVzb2x1dGlvbikge1xyXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGMgb2YgY2VsbHMpIHtcclxuICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfSAqL1xyXG4gICAgICAgICAgICAgICAgY29uc3QgciA9ICt0aGlzLm1peGVkUmVzb2x1dGlvbihjKVxyXG4gICAgICAgICAgICAgICAgaWYgKHBvc0dlby54IDwgYy54KSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoYy54ICsgciA8IHBvc0dlby54KSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAocG9zR2VvLnkgPCBjLnkpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChjLnkgKyByIDwgcG9zR2VvLnkpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICBlbHNlIHJldHVybiBjXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZFxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9jb21tb24gY2FzZVxyXG5cclxuICAgICAgICAvKiogQHR5cGUge251bWJlcn0gKi9cclxuICAgICAgICBjb25zdCByID0gdGhpcy5nZXRSZXNvbHV0aW9uKClcclxuICAgICAgICBmb3IgKGNvbnN0IGNlbGwgb2YgY2VsbHMpIHtcclxuICAgICAgICAgICAgaWYgKHBvc0dlby54IDwgY2VsbC54KSBjb250aW51ZVxyXG4gICAgICAgICAgICBlbHNlIGlmIChjZWxsLnggKyByIDwgcG9zR2VvLngpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGVsc2UgaWYgKHBvc0dlby55IDwgY2VsbC55KSBjb250aW51ZVxyXG4gICAgICAgICAgICBlbHNlIGlmIChjZWxsLnkgKyByIDwgcG9zR2VvLnkpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGVsc2UgcmV0dXJuIGNlbGxcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJu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AgKiBAdHlwZSB7c3RyaW5nfSAqL1xyXG4gICAgICAgIHRoaXMuYmFja2dyb3VuZENvbG9yID0gb3B0cy5iYWNrZ3JvdW5kQ29sb3IgfHwgJ3doaXRlJ1xyXG5cclxuICAgICAgICAvKiogQHR5cGUge2Z1bmN0aW9uKG9iamVjdHx1bmRlZmluZWQpOnZvaWR9ICovXHJcbiAgICAgICAgdGhpcy5vblpvb21TdGFydEZ1biA9IG9wdHMub25ab29tU3RhcnRGdW5cclxuXHJcbiAgICAgICAgLyoqIEB0eXBlIHtmdW5jdGlvbihvYmplY3R8dW5kZWZpbmVkKTp2b2lkfSAqL1xyXG4gICAgICAgIHRoaXMub25ab29tRW5kRnVuID0gb3B0cy5vblpvb21FbmRGdW5cclxuXHJcbiAgICAgICAgLyoqIEB0eXBlIHtmdW5jdGlvbihvYmplY3R8dW5kZWZpbmVkKTp2b2lkfSAqL1xyXG4gICAgICAgIHRoaXMub25ab29tRnVuID0gb3B0cy5vblpvb21GdW5cclxuXHJcbiAgICAgICAgLy9jdXJyZW50IGV4dGVudFxyXG4gICAgICAgIC8qKiBAdHlwZSB7RW52ZWxvcGV9ICovXHJcbiAgICAgICAgdGhpcy5leHRHZW8gPSB7IHhNaW46IE5hTiwgeE1heDogTmFOLCB5TWluOiBOYU4sIHlNYXg6IE5hTiB9XHJcbiAgICAgICAgdGhpcy51cGRhdGVFeHRlbnRHZW8oKVxyXG5cclxuICAgICAgICAvL3JlbHkgb24gZDMgem9vbSBmb3IgcGFuL3pvb21cclxuICAgICAgICBpZiAoIW9wdHMuZGlzYWJsZVpvb20pIHtcclxuICAgICAgICAgICAgbGV0IHRQID0gem9vbUlkZW50aXR5XHJcbiAgICAgICAgICAgIGNvbnN0IHogPSBkM3pvb20oKVxyXG4gICAgICAgICAgICAgICAgLy90byBtYWtlIHRoZSB6b29taW5nIGEgYml0IGZhc3RlclxyXG4gICAgICAgICAgICAgICAgLndoZWVsRGVsdGEoKGUpID0+IC1lLmRlbHRhWSAqIChlLmRlbHRhTW9kZSA9PT0gMSA/IDAuMDcgOiBlLmRlbHRhTW9kZSA/IDEgOiAwLjAwNCkpXHJcbiAgICAgICAgICAgICAgICAub24oJ3pvb20nLCAoZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHQgPSBlLnRyYW5zZm9ybVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGYgPSB0UC5rIC8gdC5rXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYgPT0gMSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3BhblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBkeCA9IHRQLnggLSB0LnhcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZHkgPSB0UC55IC0gdC55XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuKGR4ICogdGhpcy52aWV3LnosIC1keSAqIHRoaXMudmlldy56KVxyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlID0gZS5zb3VyY2VFdmVudFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2UgaW5zdGFuY2VvZiBXaGVlbEV2ZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3pvb20gYXQgdGhlIG1vdXNlIHBvc2l0aW9uXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnpvb20oXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBpeFRvR2VvWChlLnNvdXJjZUV2ZW50Lm9mZnNldFgpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGl4VG9HZW9ZKGUuc291cmNlRXZlbnQub2Zmc2V0WSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzZSBpbnN0YW5jZW9mIFRvdWNoRXZlbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2UudGFyZ2V0VG91Y2hlcy5sZW5ndGgpIHJldHVyblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9waW5jaCB6b29tXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvbXB1dGUgYXZlcmFnZSBwb3NpdGlvbiBvZiB0aGUgdG91Y2hlc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHR4ID0gMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eSA9IDBcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IHR0IG9mIHNlLnRhcmdldFRvdWNoZXMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eCArPSB0dC5jbGllbnRYXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHkgKz0gdHQuY2xpZW50WVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHggLz0gc2UudGFyZ2V0VG91Y2hlcy5sZW5ndGhcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5IC89IHNlLnRhcmdldFRvdWNoZXMubGVuZ3RoXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3pvb20gYXQgdGhpcyBhdmVyYWdlIHBvc2l0aW9uXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnpvb20oZiwgdGhpcy5waXhUb0dlb1godHgpLCB0aGlzLnBpeFRvR2VvWSh0eSkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgdFAgPSB0XHJcblxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLm9uWm9vbUZ1bikgdGhpcy5vblpvb21GdW4oZSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ3N0YXJ0JywgKGUpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBzdGFydCBvZiB6b29tIGV2ZW50XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gc2F2ZSB0aGUgY3VycmVudCBjYW52YXMgc3RhdGUgdG8ga2VlcCBvbnNjcmVlbiBkdXJpbmcgcGFuL3pvb20gYmVmb3JlIHJlZHJhd2luZ1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY2FudmFzU2F2ZS5jID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJylcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUuYy5zZXRBdHRyaWJ1dGUoJ3dpZHRoJywgJycgKyB0aGlzLncpXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jYW52YXNTYXZlLmMuc2V0QXR0cmlidXRlKCdoZWlnaHQnLCAnJyArIHRoaXMuaClcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUuYy5nZXRDb250ZXh0KCcyZCcpPy5kcmF3SW1hZ2UodGhpcy5jYW52YXMsIDAsIDApXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jYW52YXNTYXZlLmR4ID0gMFxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY2FudmFzU2F2ZS5keSA9IDBcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUuZiA9IDFcclxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5vblpvb21TdGFydEZ1bikgdGhpcy5vblpvb21TdGFydEZ1bihlKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5vbignZW5kJywgKGUpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBlbmQgb2Ygem9vbSBldmVudFxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVkcmF3KClcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUgPSB7IGM6IG51bGwsIGR4OiAwLCBkeTogMCwgZjogMSB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLm9uWm9vbUVuZEZ1bikgdGhpcy5vblpvb21FbmRGdW4oZSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIHooc2VsZWN0KHRoaXMuY2FudmFzKSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vY2VudGVyIGV4dGVudFxyXG4gICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfHVuZGVmaW5lZH0gKi9cclxuICAgICAgICB0aGlzLnhNaW4gPSBvcHRzLmNlbnRlckV4dGVudCA/IG9wdHMuY2VudGVyRXh0ZW50WzBdIDogdW5kZWZpbmVkXHJcbiAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgIHRoaXMueU1pbiA9IG9wdHMuY2VudGVyRXh0ZW50ID8gb3B0cy5jZW50ZXJFeHRlbnRbMV0gOiB1bmRlZmluZWRcclxuICAgICAgICAvKiogQHR5cGUge251bWJlcnx1bmRlZmluZWR9ICovXHJcbiAgICAgICAgdGhpcy54TWF4ID0gb3B0cy5jZW50ZXJFeHRlbnQgPyBvcHRzLmNlbnRlckV4dGVudFsyXSA6IHVuZGVmaW5lZFxyXG4gICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfHVuZGVmaW5lZH0gKi9cclxuICAgICAgICB0aGlzLnlNYXggPSBvcHRzLmNlbnRlckV4dGVudCA/IG9wdHMuY2VudGVyRXh0ZW50WzNdIDogdW5kZWZpbmVkXHJcblxyXG4gICAgICAgIC8qKiBab29tIGV4dGVudCwgdG8gbGltaXQgem9vbSBpbiBhbmQgb3V0XHJcbiAgICAgICAgICogIEB0eXBlIHtBcnJheS48bnVtYmVyPn0gKi9cclxuICAgICAgICB0aGlzLnpvb21FeHRlbnQgPSBvcHRzLnpvb21FeHRlbnQgfHwgWzAsIEluZmluaXR5XVxyXG5cclxuICAgICAgICAvKiogQ2FudmFzIHN0YXRlLCB0byBiZSB1c2VkIHRvIGF2b2lkIHVubmVjZXNzYXJ5IHJlZHJhd3Mgb24gem9vbS9wYW5cclxuICAgICAgICAgKiAgQHR5cGUge3tjOkhUTUxDYW52YXNFbGVtZW50fG51bGwsZHg6bnVtYmVyLGR5Om51bWJlcixmOm51bWJlcn19ICovXHJcbiAgICAgICAgdGhpcy5jYW52YXNTYXZlID0geyBjOiBudWxsLCBkeDogMCwgZHk6IDAsIGY6IDEgfVxyXG4gICAgfVxyXG5cclxuICAgIC8qKiBAcmV0dXJucyB7Vmlld30gKi9cclxuICAgIGdldFZpZXcoKSB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMudmlld1xyXG4gICAgfVxyXG5cclxuICAgIC8qKiBAcGFyYW0ge0FycmF5LjxudW1iZXI+fSB2ICovXHJcbiAgICBzZXRDZW50ZXJFeHRlbnQodikge1xyXG4gICAgICAgIHRoaXMueE1pbiA9IHZbMF1cclxuICAgICAgICB0aGlzLnlNaW4gPSB2WzFdXHJcbiAgICAgICAgdGhpcy54TWF4ID0gdlsyXVxyXG4gICAgICAgIHRoaXMueU1heCA9IHZbM11cclxuICAgIH1cclxuICAgIC8qKiBAcmV0dXJucyB7QXJyYXkuPG51bWJlcnx1bmRlZmluZWQ+fSAqL1xyXG4gICAgZ2V0Q2VudGVyRXh0ZW50KCkge1xyXG4gICAgICAgIHJldHVybiBbdGhpcy54TWluLCB0aGlzLnlNaW4sIHRoaXMueE1heCwgdGhpcy55TWF4XVxyXG4gICAgfVxyXG5cclxuICAgIC8qKiBAcGFyYW0ge0FycmF5LjxudW1iZXI+fSB2ICovXHJcbiAgICBzZXRab29tRXh0ZW50KHYpIHtcclxuICAgICA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mID0gZiAqIHRoaXMudmlldy56XHJcbiAgICAgICAgaWYgKG5ld1pmIDwgdGhpcy56b29tRXh0ZW50WzBdKSBmID0gdGhpcy56b29tRXh0ZW50WzBdIC8gdGhpcy52aWV3LnpcclxuICAgICAgICBpZiAobmV3WmYgPiB0aGlzLnpvb21FeHRlbnRbMV0pIGYgPSB0aGlzLnpvb21FeHRlbnRbMV0gLyB0aGlzLnZpZXcuelxyXG5cclxuICAgICAgICB0aGlzLnZpZXcueiAqPSBmXHJcblxyXG4gICAgICAgIC8vY29tcHV0ZSBwYW5cclxuICAgICAgICBsZXQgZHhHZW8gPSAoeEdlbyAtIHRoaXMudmlldy54KSAqICgxIC0gZilcclxuICAgICAgICBsZXQgZHlHZW8gPSAoeUdlbyAtIHRoaXMudmlldy55KSAqICgxIC0gZilcclxuXHJcbiAgICAgICAgLy9lbnN1cmVzIHgveSBleHRlbnRcclxuICAgICAgICBpZiAodGhpcy54TWluICE9IHVuZGVmaW5lZCAmJiB0aGlzLnZpZXcueCArIGR4R2VvIDwgdGhpcy54TWluKSBkeEdlbyA9IHRoaXMueE1pbiAtIHRoaXMudmlldy54XHJcbiAgICAgICAgaWYgKHRoaXMueU1pbiAhPSB1bmRlZmluZWQgJiYgdGhpcy52aWV3LnkgKyBkeUdlbyA8IHRoaXMueU1pbikgZHlHZW8gPSB0aGlzLnlNaW4gLSB0aGlzLnZpZXcueVxyXG4gICAgICAgIGlmICh0aGlzLnhNYXggIT0gdW5kZWZpbmVkICYmIHRoaXMudmlldy54ICsgZHhHZW8gPiB0aGlzLnhNYXgpIGR4R2VvID0gdGhpcy54TWF4IC0gdGhpcy52aWV3LnhcclxuICAgICAgICBpZiAodGhpcy55TWF4ICE9IHVuZGVmaW5lZCAmJiB0aGlzLnZpZXcueSArIGR5R2VvID4gdGhpcy55TWF4KSBkeUdlbyA9IHRoaXMueU1heCAtIHRoaXMudmlldy55XHJcblxyXG4gICAgICAgIC8vcGFuXHJcbiAgICAgICAgdGhpcy52aW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ICogQHBhcmFtIHt7eDpudW1iZXIseTpudW1iZXJ9fSBvYmpcclxuICAgICAqL1xyXG4gICAgdG9EcmF3KG9iaikge1xyXG4gICAgICAgIGlmIChvYmoueCA8IHRoaXMuZXh0R2VvLnhNaW4pIHJldHVybiBmYWxzZVxyXG4gICAgICAgIGlmIChvYmoueCA+IHRoaXMuZXh0R2VvLnhNYXgpIHJldHVybiBmYWxzZVxyXG4gICAgICAgIGlmIChvYmoueSA8IHRoaXMuZXh0R2VvLnlNaW4pIHJldHVybiBmYWxzZVxyXG4gICAgICAgIGlmIChvYmoueSA+IHRoaXMuZXh0R2VvLnlNYXgpIHJldHVybiBmYWxzZVxyXG4gICAgICAgIHJldHVybiB0cnVlXHJcbiAgICB9XHJcblxyXG4gICAgLy9jb252ZXJzaW9uIGZ1bmN0aW9uc1xyXG4gICAgLyoqXHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0geEdlbyBHZW8geCBjb29yZGluYXRlLCBpbiBtLlxyXG4gICAgICogQHJldHVybnMge251bWJlcn0gU2NyZWVuIHggY29vcmRpbmF0ZSwgaW4gcGl4LlxyXG4gICAgICovXHJcbiAgICBnZW9Ub1BpeFgoeEdlbykge1xyXG4gICAgICAgIHJldHVybiAoeEdlbyAtIHRoaXMudmlldy54KSAvIHRoaXMudmlldy56ICsgdGhpcy53ICogMC41XHJcbiAgICB9XHJcbiAgICAvKipcclxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSB5R2VvIEdlbyB5IGNvb3JkaW5hdGUsIGluIG0uXHJcbiAgICAgKiBAcmV0dXJucyB7bnVtYmVyfSBTY3JlZW4geSBjb29yZGluYXRlLCBpbiBwaXguXHJcbiAgICAgKi9cclxuICAgIGdlb1RvUGl4WSh5R2VvKSB7XHJcbiAgICAgICAgcmV0dXJuIC0oeUdlbyAtIHRoaXMudmlldy55KSAvIHRoaXMudmlldy56ICsgdGhpcy5oICogMC41XHJcbiAgICB9XHJcbiAgICAvKipcclxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSB4IFNjcmVlbiB4IGNvb3JkaW5hdGUsIGluIHBpeC5cclxuICAgICAqIEByZXR1cm5zIHtudW1iZXJ9IEdlbyB4IGNvb3JkaW5hdGUsIGluIG0uXHJcbiAgICAgKi9cclxuICAgIHBpeFRvR2VvWCh4KSB7XHJcbiAgICAgICAgcmV0dXJuICh4IC0gdGhpcy53ICogMC41KSAqIHRoaXMudmlldy56ICsgdGhpcy52aWV3LnhcclxuICAgIH1cclxuICAgIC8qKlxyXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IHkgU2NyZWVuIHkgY29vcmRpbmF0ZSwgaW4gcGl4LlxyXG4gICAgICogQHJldHVybnMge251bWJlcn0gR2VvIHkgY29vcmRpbmF0ZSwgaW4gbS5cclxuICAgICAqL1xyXG4gICAgcGl4VG9HZW9ZKHkpIHtcclxuICAgICAgICByZXR1cm4gLSh5IC0gdGhpcy5oICogMC41KSAqIHRoaXMudmlldy56ICsgdGhpcy52aWV3LnlcclxuICAgIH1cclxuXHJcbiAgICAvKiogR2V0IHgseSx6IGVsZW1lbnRzIGZyb20gVVJMIGFuZCBhc3NpZ24gdGhlbSB0byB0aGUgdmlldy4gKi9cclxuICAgIHNldFZpZXdGcm9tVVJMKCkge1xyXG4gICAgICAgIGNvbnN0IHggPSBHZW9DYW52YXMuZ2V0UGFyYW1ldGVyQnlOYW1lKCd4JyksXHJcbiAgICAgICAgICAgIHkgPSBHZW9DYW52YXMuZ2V0UGFyYW1ldGVyQnlOYW1lKCd5JyksXHJcbiAgICAgICAgICAgIHogPSBHZW9DYW52YXMuZ2V0UGFyYW1ldGVyQnlOYW1lKCd6JylcclxuICAgICAgICBpZiAoeCAhPSBudWxsICYmIHggIT0gdW5kZWZpbmVkICYmICFpc05hTigreCkpIHRoaXMudmlldy54ID0gK3hcclxuICAgICAgICBpZiAoeSAhPSBudWxsICYmIHkgIT0gdW5kZWZpbmVkICYmICFpc05hTigreSkpIHRoaXMudmlldy55ID0gK3lcclxuICA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3J0KFwiLi9MYXllci5qc1wiKS5MYXllcltdfSBsYXllcnNcclxuICAgICAqIEByZXR1cm5zIHsgdGhpcyB8IGltcG9ydChcIi4vTGF5ZXIuanNcIikuTGF5ZXJbXSB9XHJcbiAgICAgKi9cclxuICAgIGxheWVyc18obGF5ZXJzKSB7XHJcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT09IDApIHJldHVybiB0aGlzLmxheWVyc1xyXG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAxKVxyXG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShsYXllcnMpKSB0aGlzLmxheWVycyA9IGxheWVyc1xyXG4gICAgICAgICAgICBlbHNlIHRoaXMubGF5ZXJzID0gW2xheWVyc11cclxuICAgICAgICBlbHNlIHRoaXMubGF5ZXJzID0gYXJndW1lbnRzXHJcbiAgICAgICAgcmV0dXJuIHRoaXNcclxuICAgIH1cclxuXHJcbiAgICAvKiogQHJldHVybnMge3RoaXN9ICovXHJcbiAgICByZWRyYXcoKSB7XHJcbiAgICAgICAgLy9yZW1vdmUgbGVnZW5kIGVsZW1lbnRzXHJcbiAgICAgICAgaWYgKHRoaXMubGVnZW5kKSB0aGlzLmxlZ2VuZC5zZWxlY3RBbGwoJyonKS5yZW1vdmUoKVxyXG5cclxuICAgICAgICAvL2NsZWFyXHJcbiAgICAgICAgdGhpcy5nZW9DYW52YXMuaW5pdENhbnZhc1RyYW5zZm9ybSgpXHJcbiAgICAgICAgdGhpcy5nZW9DYW52YXMuY2xlYXIodGhpcy5nZW9DYW52YXMuYmFja2dyb3VuZENvbG9yKVxyXG5cclxuICAgICAgICBjb25zdCB6ID0gdGhpcy5nZW9DYW52YXMudmlldy56XHJcbiAgICAgICAgdGhpcy51cGRhdGVFeHRlbnRHZW8oKVxyXG5cclxuICAgICAgICAvL2dvIHRocm91Z2ggdGhlIGxheWVyc1xyXG4gICAgICAgIGZvciAoY29uc3QgbGF5ZXIgb2YgdGhp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YW52YXMucGl4VG9HZW9YKGUub2Zmc2V0WCArIHRoaXMudG9vbHRpcC54TW91c2VPZmZzZXQpLFxyXG4gICAgICAgICAgICB5OiB0aGlzLmdlb0NhbnZhcy5waXhUb0dlb1koZS5vZmZzZXRZICsgdGhpcy50b29sdGlwLnlNb3VzZU9mZnNldCksXHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8qKiBAdHlwZSB7e2NlbGw6aW1wb3J0KCcuL0RhdGFzZXQuanMnKS5DZWxsLGh0bWw6c3RyaW5nLHJlc29sdXRpb246bnVtYmVyfSB8IHVuZGVmaW5lZH0gKi9cclxuICAgICAgICBjb25zdCBmb2N1cyA9IHRoaXMuZ2V0Q2VsbEZvY3VzSW5mbyhtb3VzZVBvc2l0aW9uR2VvKVxyXG5cclxuICAgICAgICAvLyB0cmFuc3BhcmVudCBiYWNrZ3JvdW5kIChlLmcuIGxlYWZsZXQpICdyZWQgcGFpbnRpbmcnIGZpeFxyXG4gICAgICAgIGlmICh0aGlzLnRyYW5zcGFyZW50QmFja2dyb3VuZCkge1xyXG4gICAgICAgICAgICBpZiAoZm9jdXMpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMudG9vbHRpcC5odG1sKGZvY3VzLmh0bWwpXHJcbiAgICAgICAgICAgICAgICB0aGlzLnRvb2x0aXAuc2V0UG9zaXRpb24oZSlcclxuICAgICAgICAgICAgICAgIHRoaXMudG9vbHRpcC5zaG93KClcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHRoaXMudG9vbHRpcC5oaWRlKClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdjYW52YXMnKVxyXG4gICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUuc2V0QXR0cmlidXRlKCd3aWR0aCcsICcnICsgdGhpcy53KVxyXG4gICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUuc2V0QXR0cmlidXRlKCdoZWlnaHQnLCAnJyArIHRoaXMuaClcclxuICAgICAgICAgICAgdGhpcy5jYW52YXNTYXZlLmdldENvbnRleHQoJzJkJyk/LmRyYXdJbWFnZSh0aGlzLmdlb0NhbnZhcy5jYW52YXMsIDAsIDApXHJcbiAgICAgICAgICAgIHRoaXMuZ2VvQ2FudmFzLmluaXRDYW52YXNUcmFuc2Zvcm0oKVxyXG4gICAgICAgICAgICByZXR1cm5cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmIChmb2N1cykge1xyXG4gICAgICAgICAgICB0aGlzLnRvb2x0aXAuaHRtbChmb2N1cy5odG1sKVxyXG4gICAgICAgICAgICB0aGlzLnRvb2x0aXAuc2V0UG9zaXRpb24oZSlcclxuICAgICAgICAgICAgdGhpcy50b29sdGlwLnNob3coKVxyXG5cclxuICAgICAgICAgICAgLy9zaG93IGNlbGwgcG9zaXRpb24gYXMgYSByZWN0YW5nbGVcclxuICAgICAgICAgICAgaWYgKCF0aGlzLmNhbnZhc1NhdmUpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuY2FudmFzU2F2ZSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2NhbnZhcycpXHJcbiAgICAgICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUuc2V0QXR0cmlidXRlKCd3aWR0aCcsICcnICsgdGhpcy53KVxyXG4gICAgICAgICAgICAgICAgdGhpcy5jYW52YXNTYXZlLnNldEF0dHJpYnV0ZSgnaGVpZ2h0JywgJycgKyB0aGlzLmgpXHJcbiAgICAgICAgICAgICAgICB0aGlzLmNhbnZhc1NhdmUuZ2V0Q29udGV4dCgnMmQnKT8uZHJhd0ltYWdlKHRoaXMuZ2VvQ2FudmFzLm9mZnNjcmVlbkNhbnZhcywgMCwgMClcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuZ2VvQ2FudmFzLm9mZnNjcmVlbkN0eC5kcmF3SW1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ICAgY29uc3QgciA9ICtkc2MubWl4ZWRSZXNvbHV0aW9uKGNlbGwpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBodG1sID0gbGF5ZXIuY2VsbEluZm9IVE1MKGNlbGwsIHIpXHJcbiAgICAgICAgICAgICAgICBpZiAoIWh0bWwpIHJldHVybiB1bmRlZmluZWRcclxuICAgICAgICAgICAgICAgIHJldHVybiB7IGNlbGw6IGNlbGwsIGh0bWw6IGh0bWwsIHJlc29sdXRpb246IHIgfVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICBjb25zdCBodG1sID0gbGF5ZXIuY2VsbEluZm9IVE1MKGNlbGwsIGRzYy5nZXRSZXNvbHV0aW9uKCkpXHJcbiAgICAgICAgICAgIGlmICghaHRtbCkgcmV0dXJuIHVuZGVmaW5lZFxyXG4gICAgICAgICAgICByZXR1cm4geyBjZWxsOiBjZWxsLCBodG1sOiBodG1sLCByZXNvbHV0aW9uOiBkc2MuZ2V0UmVzb2x1dGlvbigpIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0geFxyXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IHlcclxuICAgICAqIEBwYXJhbSB7bnVtYmVyfHVuZGVmaW5lZH0gelxyXG4gICAgICovXHJcbiAgICBzZXRWaWV3KHgsIHksIHogPSB1bmRlZmluZWQpIHtcclxuICAgICAgICB0aGlzLmdlb0NhbnZhcy52aWV3LnggPSB4XHJcbiAgICAgICAgdGhpcy5nZW9DYW52YXMudmlldy55ID0geVxyXG4gICAgICAgIGlmICh6ICE9IHVuZGVmaW5lZCkgdGhpcy5nZW9DYW52YXMudmlldy56ID0gelxyXG4gICAgICAgIHJldHVybiB0aGlzXHJcbiAgICB9XHJcblxyXG4gICAgLyoqIEByZXR1cm5zIHtpbXBvcnQoJy4vR2VvQ2FudmFzLmpzJykuVmlld30gKi9cclxuICAgIGdldFZpZXcoKSB7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vbnMtJyArIHRoaXMuY29udGFpbmVyLmlkLFxyXG4gICAgICAgICAgICBjbGFzczogb3B0cz8uY2xhc3MsXHJcbiAgICAgICAgICAgIHg6IG9wdHM/LngsXHJcbiAgICAgICAgICAgIHk6IG9wdHM/LnksXHJcbiAgICAgICAgICAgIG9uWm9vbTogb3B0cz8ub25ab29tLFxyXG4gICAgICAgICAgICBkZWx0YTogb3B0cz8uZGVsdGEgfHwgMC4yLFxyXG4gICAgICAgIH0pXHJcblxyXG4gICAgICAgIHJldHVybiB0aGlzXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBBZGRzIGEgZnVsbHNjcmVlbiB0b2dnbGUgYnV0dG9uIHRvIHRoZSBhcHBcclxuICAgICAqXHJcbiAgICAgKiBAcGFyYW0ge29iamVjdH0gb3B0c1xyXG4gICAgICogQHJldHVybnMge3RoaXN9XHJcbiAgICAgKi9cclxuICAgIGFkZEZ1bGxzY3JlZW5CdXR0b24ob3B0cykge1xyXG4gICAgICAgIC8vICogb3B0cy5tYXAgLSB0aGUgZ3JpZHZpeiBtYXBcclxuICAgICAgICAvLyAqIG9wdHMuaWRcclxuICAgICAgICAvLyAqIG9wdHMueFxyXG4gICAgICAgIC8vICogb3B0cy55XHJcblxyXG4gICAgICAgIHRoaXMuZnVsbHNjcmVlbkJ1dHRvbiA9IG5ldyBGdWxsc2NyZWVuQnV0dG9uKHtcclxuICAgICAgICAgICAgbWFwOiB0aGlzLFxyXG4gICAgICAgICAgICBpZDogb3B0cz8uaWQgfHwgJ2dyaWR2aXotZnVsbHNjcmVlbi1idXR0b24nLFxyXG4gICAgICAgICAgICBjbGFzczogb3B0cz8uY2xhc3MsXHJcbiAgICAgICAgICAgIHg6IG9wdHM/LngsXHJcbiAgICAgICAgICAgIHk6IG9wdHM/LnksXHJcbiAgICAgICAgfSlcclxuXHJcbiAgICAgICAgcmV0dXJuIHRoaXNcclxuICAgIH1cclxuXHJcbiAgICAvKiogQHJldHVybnMge3Roa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lzQXJyYXkoZW50cmllcykgfHwgIWVudHJpZXMubGVuZ3RoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAvLyB1cGRhdGUgdGhlIG1hcCBhbmQgY2FudmFzIHNpemVcclxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5oICE9PSBjb250YWluZXIuY2xpZW50SGVpZ2h0IHx8IHRoaXMudyAhPT0gY29udGFpbmVyLmNsaWVudFdpZHRoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaCA9IGNvbnRhaW5lci5jbGllbnRIZWlnaHRcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy53ID0gY29udGFpbmVyLmNsaWVudFdpZHRoXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZ2VvQ2FudmFzLmggPSBjb250YWluZXIuY2xpZW50SGVpZ2h0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZ2VvQ2FudmFzLncgPSBjb250YWluZXIuY2xpZW50V2lkdGhcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5nZW9DYW52YXMuY2FudmFzLnNldEF0dHJpYnV0ZSgnd2lkdGgnLCAnJyArIHRoaXMudylcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5nZW9DYW52YXMuY2FudmFzLnNldEF0dHJpYnV0ZSgnaGVpZ2h0JywgJycgKyB0aGlzLmgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9mZnNjcmVlbiBjYW52YXNcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5nZW9DYW52YXMub2Zmc2NyZWVuQ2FudmFzLnNldEF0dHJpYnV0ZSgnd2lkdGgnLCAnJyArIHRoaXMudylcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5nZW9DYW52YXMub2Zmc2NyZWVuQ2FudmFzLnNld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clxuICAgICAqIFJldHVybiB0aGUgcmVsZXZhbnQgZGF0YXNldCBmb3IgYSBzcGVjaWZpZWQgem9vbS5cclxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSB6XHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0gbWluUGl4ZWxzUGVyQ2VsbFxyXG4gICAgICogQHJldHVybnMge2ltcG9ydChcIi4vRGF0YXNldFwiKS5EYXRhc2V0fHVuZGVmaW5lZH1cclxuICAgICAqICovXHJcbiAgICBnZXREYXRhc2V0KHosIG1pblBpeGVsc1BlckNlbGwpIHtcclxuICAgICAgICAvL3NwZWNpYWwgY2FzZSB3aGl0aCBzaW5nbGUgZGF0YXNldFxyXG4gICAgICAgIGlmICh0aGlzLmRhdGFzZXRzLmxlbmd0aCA9PSAxKSByZXR1cm4gdGhpcy5kYXRhc2V0c1swXVxyXG5cclxuICAgICAgICBjb25zdCBycyA9IHRoaXMucmVzb2x1dGlvbnNcclxuICAgICAgICBsZXQgaSA9IDBcclxuICAgICAgICBsZXQgel8gPSByc1tpXSAvIG1pblBpeGVsc1BlckNlbGxcclxuICAgICAgICB3aGlsZSAoel8gPCB6ICYmIGkgPCBycy5sZW5ndGgpIHtcclxuICAgICAgICAgICAgaSsrXHJcbiAgICAgICAgICAgIHpfID0gcnNbaV0gLyBtaW5QaXhlbHNQZXJDZWxsXHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vaWYgKGkgPT0gMCkgcmV0dXJuIHRoaXMuZGF0YXNldC5kYXRhc2V0c1swXTtcclxuICAgICAgICAvL3JldHVybiB0aGlzLmRhdGFzZXQuZGF0YXNldHNbaSAtIDFdO1xyXG4gICAgICAgIGlmIChpID09IHJzLmxlbmd0aCkgcmV0dXJuIHRoaXMuZGF0YXNldHNbcnMubGVuZ3RoIC0gMV1cclxuICAgICAgICByZXR1cm4gdGhpcy5kYXRhc2V0c1tpXVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogU2V0IGEgcHJlcHJv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EVsZW1lbnR9ICovXG4gICAgICAgIHRoaXMucGFyZW50RWxlbWVudCA9IG9wdHMucGFyZW50RWxlbWVudCB8fCBkb2N1bWVudC5ib2R5XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBwdWJsaWNcbiAgICAgICAgICogQHR5cGUge2ltcG9ydChcImQzLXNlbGVjdGlvblwiKS5TZWxlY3Rpb259ICovXG4gICAgICAgIHRoaXMudG9vbHRpcCA9IHNlbGVjdCgnIycgKyB0aGlzLmRpdilcblxuICAgICAgICBpZiAodGhpcy50b29sdGlwLmVtcHR5KCkpIHtcbiAgICAgICAgICAgIC8vY3JlYXRlIHRvb2x0aXAgRE9NIG5vZGVcbiAgICAgICAgICAgIC8vIHRoaXMudG9vbHRpcCA9IHNlbGVjdChcbiAgICAgICAgICAgIC8vICAgICAnIycgKyB0aGlzLnBhcmVudEVsZW1lbnQuaWQgJiYgdGhpcy5wYXJlbnRFbGVtZW50LmlkICE9ICcnXG4gICAgICAgICAgICAvLyAgICAgICAgID8gJyMnICsgdGhpcy5wYXJlbnRFbGVtZW50LmlkXG4gICAgICAgICAgICAvLyAgICAgICAgIDogJ2JvZHknXG4gICAgICAgICAgICAvLyApXG4gICAgICAgICAgICB0aGlzLnRvb2x0aXAgPSBzZWxlY3QoJ2JvZHknKS5hcHBlbmQoJ2RpdicpLmF0dHIoJ2lkJywgdGhpcy5kaXYpXG4gICAgICAgIH1cblxuICAgICAgICAvL2luaXRpYWxpc2VcbiAgICAgICAgdGhpcy50b29sdGlwLnN0eWxlKCdtYXgtd2lkdGgnLCB0aGlzLm1heFdpZHRoKVxuICAgICAgICB0aGlzLnRvb2x0aXAuc3R5bGUoJ292ZXJmbG93JywgJ2hpZGRlbicpXG4gICAgICAgIHRoaXMudG9vbHRpcC5zdHlsZSgnZm9udC1zaXplJywgdGhpcy5mb250U2l6ZSlcbiAgICAgICAgdGhpcy50b29sdGlwLnN0eWxlKCdiYWNrZ3JvdW5kJywgdGhpcy5iYWNrZ3J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ICAgZW5zdXJlVG9vbHRpcEluc2lkZUNvbnRhaW5lciA9IGZ1bmN0aW9uIChldmVudCwgcGFyZW50UmVjdCkge1xuICAgICAgICBsZXQgbm9kZSA9IHRoaXMudG9vbHRpcC5ub2RlKClcbiAgICAgICAgbGV0IHBhcmVudFdpZHRoID0gcGFyZW50UmVjdC53aWR0aFxuICAgICAgICBsZXQgcGFyZW50SGVpZ2h0ID0gcGFyZW50UmVjdC5oZWlnaHRcblxuICAgICAgICAvL3RvbyBmYXIgcmlnaHRcbiAgICAgICAgaWYgKG5vZGUub2Zmc2V0TGVmdCA+IHBhcmVudFJlY3QubGVmdCArIHBhcmVudFdpZHRoIC0gbm9kZS5jbGllbnRXaWR0aCkge1xuICAgICAgICAgICAgbGV0IGxlZnQgPSBldmVudC54IC0gbm9kZS5jbGllbnRXaWR0aCAtIHRoaXMueE9mZnNldFxuICAgICAgICAgICAgbm9kZS5zdHlsZS5sZWZ0ID0gbGVmdCArICdweCdcbiAgICAgICAgICAgIC8vIGNoZWNrIGlmIG1vdXNlIGNvdmVycyB0b29sdGlwXG4gICAgICAgICAgICBpZiAobm9kZS5vZmZzZXRMZWZ0ICsgbm9kZS5jbGllbnRXaWR0aCA+IGV2ZW50LngpIHtcbiAgICAgICAgICAgICAgICAvL21vdmUgdG9vbHRpcCBsZWZ0IHNvIGl0IGRvZXNudCBjb3ZlciBtb3VzZVxuICAgICAgICAgICAgICAgIGxldCBsZWZ0MiA9IGV2ZW50LnggLSBub2RlLmNsaWVudFdpZHRoIC0gdGhpcy54T2Zmc2V0XG4gICAgICAgICAgICAgICAgbm9kZS5zdHlsZS5sZWZ0ID0gbGVmdDIgKyAncHgnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBub2RlLnN0eWxlLnRvcCA9IG5vZGUub2Zmc2V0VG9wICsgY29uZmlnLnlPZmZzZXQgKyBcInB4XCI7XG4gICAgICAgIH1cblxuICAgICAgICAvL3RvbyBmYXIgZG93blxuICAgICAgICBpZiA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AgLy9nZXQgZGF0YVxyXG4gICAgICAgIHRoaXMuZ2V0RGF0YSh1bmRlZmluZWQpXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBSZXF1ZXN0IGRhdGEgd2l0aGluIGEgZ2VvZ3JhcGhpYyBlbnZlbG9wZS5cclxuICAgICAqIEBwYXJhbSB7aW1wb3J0KFwiLi4vY29yZS9HZW9DYW52YXMuanNcIikuRW52ZWxvcGV8dW5kZWZpbmVkfSBlXHJcbiAgICAgKi9cclxuICAgIGdldERhdGEoZSkge1xyXG4gICAgICAgIC8vY2hlY2sgaWYgZGF0YSBhbHJlYWR5IGxvYWRlZFxyXG4gICAgICAgIGlmICh0aGlzLmluZm9Mb2FkaW5nU3RhdHVzICE9ICdub3RMb2FkZWQnKSByZXR1cm4gdGhpc1xyXG5cclxuICAgICAgICAvL2xvYWQgZGF0YVxyXG4gICAgICAgIHRoaXMuaW5mb0xvYWRpbmdTdGF0dXMgPSAnbG9hZGluZydcclxuICAgICAgICA7KGFzeW5jICgpID0+IHtcclxuICAgICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGRhdGEgPSBhd2FpdCBkc3YodGhpcy5kZWxpbWl0ZXIsIHRoaXMudXJsKVxyXG5cclxuICAgICAgICAgICAgICAgIC8vY29udmVydCBjb29yZGluYXRlcyBpbiBudW1iZXJzXHJcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IGMgb2YgZGF0YSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGMueCA9ICtjLnhcclxuICAgICAgICAgICAgICAgICAgICBjLnkgPSArYy55XHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgLy9wcmVwcm9jZXNzL2ZpbHRlclxyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMucHJlcHJvY2Vzcykge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY2VsbHMgPSBbXVxyXG4gICAgICAgICAgICAgICAgICAgIGZvciAoY29uc3QgYyBvZiBkYXRhKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGIgPSB0aGlzLnByZXByb2Nlc3MoYylcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGIgPT0gZmFsc2UpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY2VsbHMucHVzaChjKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jZWxscyA9IGRhdGFcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAvL1RPRE8gY2hlY2sgaWYgcmVkcmF3IGlzIG5lY2Vzc2FyeVxyXG4gICAgICAgICAgICAgICAgLy90aGF0IGlzIGlmIHRoZSBkYXRhc2V0IGJlbG9uZ3MgdG8gYSBsYXllciB3aGljaCBpcyB2aXNpYmxlIGF0IHRoZSBjdXJyZW50IHpvb20gbGV2ZWxcclxuXHJcbiAgICAgICAgICAgICAgICAvL3JlZHJhdyBtYXBcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLm1hcCkgdGhpcy5tYXAucmVkcmF3KClcclxuXHJcbiAgICAgICAgICAgICAgICB0aGlzLmluZm9Mb2FkaW5nU3RhdHVzID0gJ2xvYWRlZCdcclxuICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcclxuICAgICAgICAgICAgICAgIC8vbWFyayBhcyBmYWlsZWRcclxuICAgICAgICAgICAgICAgIHRoaXMuaW5mb0xvYWRpbmdTdGF0dXMgPSAnZmFpbGVkJ1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jZWxscyA9IFtdXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KSgpXHJcblxyXG4gICAgICAgIHJldHVybiB0aGlzXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBGaWxsI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YXRhKGUpIHtcclxuICAgICAgICByZXR1cm4gdGhpc1xyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogRmlsbCB0aGUgdmlldyBjYWNoZSB3aXRoIGFsbCBjZWxscyB3aGljaCBhcmUgd2l0aGluIGEgZ2VvZ3JhcGhpY2FsIGVudmVsb3BlLlxyXG4gICAgICpcclxuICAgICAqIEBwYXJhbSB7aW1wb3J0KFwiLi4vY29yZS9HZW9DYW52YXMuanNcIikuRW52ZWxvcGV9IGV4dEdlb1xyXG4gICAgICogQHJldHVybnMge3ZvaWR9XHJcbiAgICAgKi9cclxuICAgIHVwZGF0ZVZpZXdDYWNoZShleHRHZW8pIHtcclxuICAgICAgICAvL2RhdGEgbm90IGxvYWRlZCB5ZXRcclxuICAgICAgICBpZiAoIXRoaXMuY2VsbHMpIHJldHVyblxyXG5cclxuICAgICAgICB0aGlzLmNlbGxzVmlld0NhY2hlID0gW11cclxuICAgICAgICBmb3IgKGNvbnN0IGNlbGwgb2YgdGhpcy5jZWxscykge1xyXG4gICAgICAgICAgICBpZiAoK2NlbGwueCArIHRoaXMucmVzb2x1dGlvbiA8IGV4dEdlby54TWluKSBjb250aW51ZVxyXG4gICAgICAgICAgICBpZiAoK2NlbGwueCAtIHRoaXMucmVzb2x1dGlvbiA+IGV4dEdlby54TWF4KSBjb250aW51ZVxyXG4gICAgICAgICAgICBpZiAoK2NlbGwueSArIHRoaXMucmVzb2x1dGlvbiA8IGV4dEdlby55TWluKSBjb250aW51ZVxyXG4gICAgICAgICAgICBpZiAoK2NlbGwueSAtIHRoaXMucmVzb2x1dGlvbiA+IGV4dEdlby55TWF4KSBjb250aW51ZVxyXG4gICAgICAgICAgICB0aGlzLmNlbGxzVmlld0NhY2hlLnB1c2goY2VsbClcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuIiwiLy9AdHMtY2hlY2tcclxuJ3VzZSBzdHJpY3QnXHJcblxyXG4vKiogQHR5cGVkZWYge3sgZGltczogb2J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ICAgKiBMb2FkIHRoZSBpbmZvLmpzb24gZnJvbSB0aGUgdXJsLlxyXG4gICAgICogQHJldHVybnMgdGhpc1xyXG4gICAgICovXHJcbiAgICBsb2FkSW5mbygpIHtcclxuICAgICAgICBpZiAoIXRoaXMuaW5mbyAmJiB0aGlzLmluZm9Mb2FkaW5nU3RhdHVzID09PSAnbm90TG9hZGVkJykge1xyXG4gICAgICAgICAgICA7KGFzeW5jICgpID0+IHtcclxuICAgICAgICAgICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZGF0YSA9IGF3YWl0IGpzb24odGhpcy51cmwgKyAnaW5mby5qc29uJylcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmluZm8gPSBkYXRhXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXNvbHV0aW9uID0gZGF0YS5yZXNvbHV0aW9uR2VvXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbmZvTG9hZGluZ1N0YXR1cyA9ICdsb2FkZWQnXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXAucmVkcmF3KClcclxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9tYXJrIGFzIGZhaWxlZFxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaW5mb0xvYWRpbmdTdGF0dXMgPSAnZmFpbGVkJ1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KSgpXHJcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLmluZm9Mb2FkaW5nU3RhdHVzID09PSAnbG9hZGVkJyB8fCB0aGlzLmluZm9Mb2FkaW5nU3RhdHVzID09PSAnZmFpbGVkJylcclxuICAgICAgICAgICAgdGhpcy5tYXAucmVkcmF3KClcclxuICAgICAgICByZXR1cm4gdGhpc1xyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogQ29tcHV0ZSBhIHR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XQgcHJvY2Vzc2VkVGlsZXMgPSAwIC8vIENvdW50ZXIgZm9yIGxvYWRlZCB0aWxlc1xyXG4gICAgICAgIGNvbnN0IHRpbGVQcm9taXNlcyA9IFtdXHJcblxyXG4gICAgICAgIC8vIEl0ZXJhdGUgb3ZlciB0aWxlcyB3aXRoaW4gYm91bmRzXHJcbiAgICAgICAgZm9yIChsZXQgeFQgPSB4TWluOyB4VCA8PSB4TWF4OyB4VCsrKSB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IHlUID0geU1pbjsgeVQgPD0geU1heDsgeVQrKykge1xyXG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLmNhY2hlW3hUXSkgdGhpcy5jYWNoZVt4VF0gPSB7fVxyXG5cclxuICAgICAgICAgICAgICAgIC8vIFNraXAgYWxyZWFkeSBsb2FkZWQgb3IgbG9hZGluZyB0aWxlc1xyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuY2FjaGVbeFRdW3lUXSkge1xyXG4gICAgICAgICAgICAgICAgICAgICsrcHJvY2Vzc2VkVGlsZXNcclxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIC8vIE1hcmsgdGlsZSBhcyBsb2FkaW5nXHJcbiAgICAgICAgICAgICAgICB0aGlzLmNhY2hlW3hUXVt5VF0gPSAnbG9hZGluZydcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBQcmVwYXJlIHRoZSB0aWxlIHJlcXVlc3QgYW5kIHN0b3JlIGl0IGluIHRpbGVQcm9taXNlc1xyXG4gICAgICAgICAgICAgICAgdGlsZVByb21pc2VzLnB1c2goXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5sb2FkVGlsZSh4VCwgeVQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKCh0aWxlKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBCZWZvcmUgd2UgaW5jcmVtZW50IHByb2Nlc3NlZFRpbGVzLCBjaGVjayBpZiBpdCdzIHRoZSBsYXN0IHRpbGVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGlzTGFzdFRpbGUgPSArK3Byb2Nlc3NlZFRpbGVzID09PSB0b3RhbFRpbGVzXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3RvcmUgdGhlIHRpbGUgaW4gdGhlIGNhY2hlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNhY2hlW3hUXVt5VF0gPSB0aWxlXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUGFzcyB0aGUgaXNMYXN0VGlsZSBhcmd1bWVudCB0byBjaGVja0FuZFJlZHJhd1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jaGVja0FuZFJlZHJhdyh0aWxlLCBpc0xhc3RUaWxlKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuY2F0Y2goKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTWFyayBhcyBmYWlsZWQgYnV0IGFsbG93IHByb2Nlc3NpbmcgdG8gY29udGludWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY2FjaGVbeFRdW3lUXSA9ICdmYWlsZWQnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArK3Byb2Nlc3NlZFRpbGVzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICApXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIEhhbmRsZSBhbGwgdGlsZSBwcm9taXNlcywgaW5jbHVkaW5nIGZhaWx1cmVzXHJcbiAgICAgICAgYXdhaXQgUHJvbWlzZS5hbGxTZXR0bGVkKHRpbGVQcm9taXNlcylccl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dmlzaWJsZSBhdCB0aGUgY3VycmVudCB6b29tIGxldmVsXHJcbiAgICAgICAgbGV0IG5lZWRzUmVkcmF3ID0gZmFsc2VcclxuICAgICAgICAvL2dvIHRocm91Z2ggdGhlIGxheWVyc1xyXG4gICAgICAgIGNvbnN0IHogPSB0aGlzLm1hcC5nZXRab29tKClcclxuICAgICAgICBmb3IgKGNvbnN0IGxheSBvZiB0aGlzLm1hcC5sYXllcnMpIHtcclxuICAgICAgICAgICAgaWYgKGxheS52aXNpYmxlICYmICFsYXkudmlzaWJsZSh6KSkgY29udGludWVcclxuICAgICAgICAgICAgaWYgKCFsYXkuZ2V0RGF0YXNldCkgY29udGludWVcclxuICAgICAgICAgICAgaWYgKGxheS5nZXREYXRhc2V0KHopICE9IHRoaXMpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIC8vZm91bmQgb25lIGxheWVyLiBObyBuZWVkIHRvIHNlZWsgbW9yZS5cclxuICAgICAgICAgICAgbmVlZHNSZWRyYXcgPSB0cnVlXHJcbiAgICAgICAgICAgIGJyZWFrXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAoIW5lZWRzUmVkcmF3KSByZXR1cm5cclxuXHJcbiAgICAgICAgLy8gQ2hlY2sgaWYgdGlsZSBpbnRlcnNlY3RzIHRoZSBjdXJyZW50IHZpZXdcclxuICAgICAgICBjb25zdCBlbnYgPSB0aGlzLm1hcC51cGRhdGVFeHRlbnRHZW8oKVxyXG4gICAgICAgIGNvbnN0IHsgeE1pbiwgeE1heCwgeU1pbiwgeU1heCB9ID0gdGlsZS5leHRHZW9cclxuICAgICAgICBpZiAoZW52LnhNYXggPD0geE1pbiB8fCBlbnYueE1pbiA+PSB4TWF4IHx8IGVudi55TWF4IDw9IHlNaW4gfHwgZW52LnlNaW4gPj0geU1heCkgcmV0dXJuXHJcblxyXG4gICAgICAgIC8vIFRyaWdnZXIgcmVkcmF3XHJcbiAgICAgICAgaWYgKHRoaXMub25seURyYXdXaGVuQWxsVG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XMuanNcIikuRW52ZWxvcGV9ICovXHJcbiAgICAgICAgY29uc3QgZ2IgPSB0aGlzLmluZm8udGlsaW5nQm91bmRzXHJcblxyXG4gICAgICAgIGZvciAobGV0IHhUID0gTWF0aC5tYXgodGIueE1pbiwgZ2IueE1pbik7IHhUIDw9IE1hdGgubWluKHRiLnhNYXgsIGdiLnhNYXgpOyB4VCsrKSB7XHJcbiAgICAgICAgICAgIGlmICghdGhpcy5jYWNoZVt4VF0pIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGZvciAobGV0IHlUID0gTWF0aC5tYXgodGIueU1pbiwgZ2IueU1pbik7IHlUIDw9IE1hdGgubWluKHRiLnlNYXgsIGdiLnlNYXgpOyB5VCsrKSB7XHJcbiAgICAgICAgICAgICAgICAvL2dldCB0aWxlXHJcbiAgICAgICAgICAgICAgICAvKiogQHR5cGUge29iamVjdH0gKi9cclxuICAgICAgICAgICAgICAgIGNvbnN0IHRpbGUgPSB0aGlzLmNhY2hlW3hUXVt5VF1cclxuICAgICAgICAgICAgICAgIGlmICghdGlsZSB8fCB0eXBlb2YgdGlsZSA9PT0gJ3N0cmluZycpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAgICAgLy9nZXQgY2VsbHNcclxuICAgICAgICAgICAgICAgIC8vdGhpcy5jZWxsc1ZpZXdDYWNoZSA9IHRoaXMuY2VsbHNWaWV3Q2FjaGUuY29uY2F0KHRpbGUuY2VsbHMpXHJcblxyXG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBjZWxsIG9mIHRpbGUuY2VsbHMpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoK2NlbGwueCArIHRoaXMucmVzb2x1dGlvbiA8IGV4dEdlby54TWluKSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICgrY2VsbC54IC0gdGhpcy5yZXNvbHV0aW9uID4gZXh0R2VvLnhNYXgpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCtjZWxsLnkgKyB0aGlzLnJlc29sdXRpb24gPCBleHRHZW8ueU1pbikgY29udGludWVcclxuICAgICAgICAgICAgICAgICAgICBpZiAoK2NlbGwueSAtIHRoaXMucmVzb2x1dGlvbiA+IGV4dEdlby55TWF4KSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY2VsbHNWaWV3Q2FjaGUucHVzaChjZWxsKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59XHJcblxyXG5mdW5jdGlvbiBnZXRHcmlkVGlsZShjZWxscywgeFQsIHlULCBncmlkSW5mbykge1xyXG4gICAgY29uc3QgdGlsZSA9IHt9XHJcblxyXG4gICAgLyoqIEB0eXBlIHtBcnJheS48aW1wb3J0KFwiLi4vY29yZS9EYXRhc2V0XCIpLkNlbGw+fSAqL1xyXG4gICAgdGlsZS5jZWxscyA9IGNlbGxzXHJcbiAgICAvKiogQHR5cGUge251bWJlcn0gKi9cclxuICAgIHRpbGUueCA9IHhUXHJcbiAgICAvKiogQHR5cGUge251bWJlcn0gKi9cclxuICAgIHRpbGUueSA9IHlUXHJcblxyXG4gICAgY29uc3QgciA9IGdyaWRJbmZvLnJlc29sdXRpb25HZW9cclxuICAgIGNvbnN0IHMgPSBncmlkSW5mby50aWxlU2l6ZUNlbGxcclxuXHJcbiAgICAvKiogQHR5cGUge2ltcG9ydChcIi4uL2NvcmUvR2VvQ2FudmFzXCIpLkVudmVsb3BlfSAqL1xyXG4gICAgdGlsZS5leHRHZW8gPSB7XHJcbiAgICAgICAgeE1pbjogZ3JpZEluZm8ub3JpZ2luUG9pbnQueCArIHIgKiBzICogdGlsZS54LFxyXG4gICAgICAgIHhNYXg6IGdyaWRJbmZvLm9yaWdpblBvaW50LnggKyByICogcyAqICh0aWxlLnggKyAxKSxcclxuICAgICAgICB5TWluOiBncmlkSW5mby5vcmlnaW5Qb2ludC55ICsgciAqIHMgKiB0aWxl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yXG4gICAgICAgIHN1cGVyKG9wdHMpXHJcbiAgICAgICAgb3B0cyA9IG9wdHMgfHwge31cclxuXHJcbiAgICAgICAgLyoqIFRoZSBpbWFnZSBjYWNoZSwgaW5kZXhlZCBieSB6L3kveCAqL1xyXG4gICAgICAgIHRoaXMuY2FjaGUgPSB7fVxyXG5cclxuICAgICAgICAvKipcclxuICAgICAgICAgKiBAdHlwZSB7c3RyaW5nfSAqL1xyXG4gICAgICAgIHRoaXMudXJsID0gb3B0cy51cmxcclxuICAgICAgICAvKiogQHR5cGUge2Z1bmN0aW9uKG51bWJlcixudW1iZXIsbnVtYmVyKTpzdHJpbmd9ICovXHJcbiAgICAgICAgdGhpcy51cmxGdW4gPSBvcHRzLnVybEZ1biB8fCAoKHgsIHksIHopID0+IHRoaXMudXJsICsgeiArICcvJyArIHggKyAnLycgKyB5ICsgJy5wbmcnKVxyXG5cclxuICAgICAgICAvKiogQHR5cGUge0FycmF5LjxudW1iZXI+fSAqL1xyXG4gICAgICAgIHRoaXMucmVzb2x1dGlvbnMgPSBvcHRzLnJlc29sdXRpb25zXHJcbiAgICAgICAgaWYgKCF0aGlzLnJlc29sdXRpb25zIHx8IHRoaXMucmVzb2x1dGlvbnMubGVuZ3RoID09IDApXHJcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTm8gcmVzb2x1dGlvbnMgcHJvdmlkZWQgZm9yIGJhY2tncm91bmQgbGF5ZXInKVxyXG5cclxuICAgICAgICAvKiogQHR5cGUge251bWJlcn0gKi9cclxuICAgICAgICB0aGlzLm5iUGl4ID0gb3B0cy5uYlBpeCB8fCAyNTZcclxuICAgICAgICAvKiogQ1JTIGNvb3JkaW5hdGVzIG9mIHRvcCBsZWZ0IGNvcm5lclxyXG4gICAgICAgICAqIEB0eXBlIHtBcnJheS48bnVtYmVyPn0gKi9cclxuICAgICAgICB0aGlzLm9yaWdpbiA9IG9wdHMub3JpZ2luIHx8IFswLCAwXVxyXG4gICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfSAqL1xyXG4gICAgICAgIHRoaXMuejAgPSBvcHRzLnowIHx8IDBcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEdldCB6L3gveSBjYWNoZSBkYXRhLlxyXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IHpcclxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSB4XHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0geVxyXG4gICAgICogQHJldHVybnMge0hUTUxJbWFnZUVsZW1lbnR8c3RyaW5nfHVuZGVmaW5lZH1cclxuICAgICAqIEBwcml2YXRlXHJcbiAgICAgKi9cclxuICAgIGdldCh6LCB4LCB5KSB7XHJcbiAgICAgICAgbGV0IGQgPSB0aGlzLmNhY2hlW3pdXHJcbiAgICAgICAgaWYgKCFkKSByZXR1cm5cclxuICAgICAgICBkID0gZFt4XVxyXG4gICAgICAgIGlmICghZCkgcmV0dXJuXHJcbiAgICAgICAgcmV0dXJuIGRbeV1cclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEdldCB6L3gveSBjYWNoZSBkYXRhLlxyXG4gICAgICogQHBhcmFtIHtIVE1MSW1hZ2VFbGVtZW50fHN0cmluZ30gaW1nXHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0gelxyXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IHhcclxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSB5XHJcbiAgICAgKiBAcmV0dXJuc1xyXG4gICAgICogQHByaXZhdGVcclxuICAgICAqL1xyXG4gICAgcHV0KGltZywgeiwgeCwgeSkge1xyXG4gICAgICAgIGlmICghdGhpcy5jYWNoZVt6XSkgdGhpcy5jYWNoZVt6XSA9IHt9XHJcbiAgICAgICAgaWYgKCF0aGlzLmNhY2hlW3pdW3hdKSB0aGlzLmNhY2hlW3pdW3hdID0ge31cclxuICAgICAgICB0aGlzLmNhY2hlW3pdW3hdW3ldID0gaW1nXHJcbiAgICB9XHJcblxyXG4gIC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JcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wdXQoaW1nLCB6XywgeCwgeSlcclxuICAgICAgICAgICAgICAgICAgICBpbWcub25sb2FkID0gKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBnZW9DYW52YXMucmVkcmF3KClcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaW1nLm9uZXJyb3IgPSAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vY2FzZSB3aGVuIG5vIGltYWdlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucHV0KCdmYWlsZWQnLCB6XywgeCwgeSlcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaW1nLnNyYyA9IHRoaXMudXJsRnVuKHgsIHksIHpfKVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgLy9jYXNlIHdoZW4gbm8gaW1hZ2VcclxuICAgICAgICAgICAgICAgIGlmIChpbWcgPT09ICdmYWlsZWQnKSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgaWYgKCEoaW1nIGluc3RhbmNlb2YgSFRNTEltYWdlRWxlbWVudCkpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhpbWcpXHJcbiAgICAgICAgICAgICAgICAgICAgY29udGludWVcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmIChpbWcud2lkdGggPT0gMCB8fCBpbWcuaGVpZ2h0ID09IDApIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAgICAgLy9kcmF3IGltYWdlXHJcbiAgICAgICAgICAgICAgICBjb25zdCB4R2VvID0geDAgKyB4ICogc2l6ZUdcclxuICAgICAgICAgICAgICAgIGNvbnN0IHlHZW8gPSB5MCAtIHkgKiBzaXplR1xyXG4gICAgICAgICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgICAgICAgICBnZW9DYW52YXMuaW5pdENhbnZhc1RyYW5zZm9ybSgpXHJcbiAgICAgICAgICAgICAgICAgICAgZ2VvQ2FudmFzLm9mZnNjcmVlbkN0eC5kcmF3SW1hZ2UoXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZ2VvQ2FudmFzLmdlb1RvUGl4WCh4R2VvKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZ2VvQ2FudmFzLmdlb1RvUGl4WSh5R2VvKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZVxyXG4gICAgICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgICAgICAvL2NnLmN0eC5kcmF3SW1hZ2UoaW1nLCB4R2VvLCB5R2VvLCBzaXplRywgLXNpemVHKVxyXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKGVycm9yKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59XHJcbiIsIi8vQHRzLWNoZWNrXHJcbid1c2Ugc3RyaWN0J1xyXG5cclxuaW1wb3J0IHsgTGF5ZXIgfSBmcm9tICcuLi9jb3JlL0xheWVyLmpzJ1xyXG5cclxuLyoqXHJcbiAqXHJcbiAqIEEgbWFwIGJhY2tncm91bmQgbGF5ZXIgY29tcG9zZWQgb2YgYSBzaW5nbGUgaW1hZ2UgZmlsZSwgZ2VvbG9jYXRlZC5cclxuICpcclxuICogQG1vZHVsZSBsYXllclxyXG4gKiBAYXV0aG9yIEp1bGllbiBHYWZmdXJpXHJcbiAqL1xyXG5leHBvcnQgY2xhc3MgQmFja2dyb3VuZExheWVySW1hZ2UgZXh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CF0aGlzLmltZykge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5pbWcgPSBuZXcgSW1hZ2UoKVxyXG4gICAgICAgICAgICAgICAgdGhpcy5pbWcub25sb2FkID0gKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGdlb0NhbnZhcy5yZWRyYXcoKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgdGhpcy5pbWcub25lcnJvciA9ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAvL2Nhc2Ugd2hlbiBubyBpbWFnZVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybignQ291bGQgbm90IHJldHJpZXZlIGJhY2tncm91bmQgaW1hZ2UgZnJvbScsIHRoaXMudXJsKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvL3NldCBVUkwgdG8gbGF1bmNoIHRoZSBkb3dubG9hZFxyXG4gICAgICAgICAgICB0aGlzLmltZy5zcmMgPSB0aGlzLnVybFxyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG4iLCIvL0B0cy1jaGVja1xyXG4ndXNlIHN0cmljdCdcclxuXHJcbmltcG9ydCB7IExheWVyIH0gZnJvbSAnLi4vY29yZS9MYXllci5qcydcclxuXHJcbi8qKlxyXG4gKlxyXG4gKiBBIG1hcCBXTVMgYmFja2dyb3VuZCBsYXllci5cclxuICpcclxuICogQG1vZHVsZSBsYXllclxyXG4gKiBAYXV0aG9yIEp1bGllbiBHYWZmdXJpXHJcbiAqL1xyXG5leHBvcnQgY2xhc3MgQmFja2dyb3VuZExheWVyV01TIGV4dGVuZHMgTGF5ZXIge1xyXG4gICAgLyoqXHJcbiAgICAgKiBAcGFyYW0ge29iamVjdH0gb3B0c1xyXG4gICAgICovXHJcbiAgICBjb25zdHJ1Y3RvcihvcHRzKSB7XHJcbiAgICAgICAgc3VwZXIob3B0cylcclxuICAgICAgICBvcHRzID0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pblxyXG4gICAgICAgICAgICB0aGlzLnlNYXggPSBnZW9DYW52YXMuZXh0R2VvLnlNYXhcclxuXHJcbiAgICAgICAgICAgIC8vYnVpbGQgV01TIFVSTFxyXG4gICAgICAgICAgICBjb25zdCB1cmwgPSBbXVxyXG4gICAgICAgICAgICB1cmwucHVzaCh0aGlzLnVybClcclxuICAgICAgICAgICAgdXJsLnB1c2goJyZ3aWR0aD0nKVxyXG4gICAgICAgICAgICB1cmwucHVzaChnZW9DYW52YXMudylcclxuICAgICAgICAgICAgdXJsLnB1c2goJyZoZWlnaHQ9JylcclxuICAgICAgICAgICAgdXJsLnB1c2goZ2VvQ2FudmFzLmgpXHJcbiAgICAgICAgICAgIC8vYmJveDogeG1pbiB5bWluIHhtYXggeW1heFxyXG4gICAgICAgICAgICB1cmwucHVzaCgnJmJib3g9JylcclxuICAgICAgICAgICAgdXJsLnB1c2goZ2VvQ2FudmFzLmV4dEdlby54TWluKVxyXG4gICAgICAgICAgICB1cmwucHVzaCgnLCcpXHJcbiAgICAgICAgICAgIHVybC5wdXNoKGdlb0NhbnZhcy5leHRHZW8ueU1pbilcclxuICAgICAgICAgICAgdXJsLnB1c2goJywnKVxyXG4gICAgICAgICAgICB1cmwucHVzaChnZW9DYW52YXMuZXh0R2VvLnhNYXgpXHJcbiAgICAgICAgICAgIHVybC5wdXNoKCcsJylcclxuICAgICAgICAgICAgdXJsLnB1c2goZ2VvQ2FudmFzLmV4dEdlby55TWF4KVxyXG5cclxuICAgICAgICAgICAgY29uc3QgdXJsUyA9IHVybC5qb2luKCcnKVxyXG4gICAgICAgICAgICAvL2NvbnNvbGUubG9nKHVybFMpXHJcblxyXG4gICAgICAgICAgICBpZiAoIXRoaXMuaW1nKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmltZyA9IG5ldyBJbWFnZSgpXHJcbiAgICAgICAgICAgICAgICB0aGlzLmltZy5vbmxvYWQgPSAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgZ2VvQ2FudmFzLnJlZHJhdygpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB0aGlzLmltZy5vbmVycm9yID0gKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vY2FzZSB3aGVuIG5vIGltYWdlXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKCdDb3VsZCBub3QgcmV0cmlldmUgV01TIGJhY2tncm91bmQgaW1hZ2UgZnJvbScsIHVybFMpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vc2V0IFVSTCB0byBsYXVuY2ggdGhlIGRvd25sb2FkXHJcbiAgICAgICAgICAgIHRoaXMuaW1nLnNyYyA9IHVybFNcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuIiwiLy9AdHMtY2hlY2tcclxuJ3VzZSBzdHJpY3QnXHJcblxyXG5pbXBvcnQgeyBMYXllciB9IGZyb20gJy4uL2NvcmUvTGF5ZXIuanMnXHJcbmltcG9ydCB7IGpzb24gfSBmcm9tICdkMy1mZXRjaCdcclxuXHJcbi8qKlxyXG4gKiBAbW9kdWxlIGxheWVyXHJcbiAqIEBhdXRob3IgSm9zZXBoIERhdmllcywgSnVsaWVuIEdhZmZ1cmlcclxuICovXHJcbmV4cG9ydCBjbGFzcyBHZW9KU09OTGF5ZXIgZXh0ZW5kcyBMYXllciB7XHJcbiAgICAvKipcclxuICAgICAqIEBwYXJhbSB7b2JqZWN0fSBvcHRzXHJcbiAgICAgKi9cclxuICAgIGNvbnN0cnVjdG9yKG9wdHMpIHtcclxuICAgICAgICBzdXBlcihvcHRzKVxyXG4gICAgICAgIG9wdHMgPSBvcHRzIHx8IHt9XHJcblxyXG4gICAgICAgIC8qKlxyXG4gICAgICAgICAqIEBwcml2YXRlXHJcbiAgICAgICAgICogQHR5cGUge3N0cmluZ30gKi9cclxuICAgICAgICB0aGlzLnVybCA9IG9wdHMudXJsXH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LnN0cm9rZVN0eWxlID0gb3B0cy5zdHJva2VTdHlsZSB8fCAoKGYsIHopID0+ICdyZWQnKVxyXG4gICAgICAgIC8qKlxyXG4gICAgICAgICAqIEBwcml2YXRlXHJcbiAgICAgICAgICogQHR5cGUge2Z1bmN0aW9uKG9iamVjdCxudW1iZXIpOnN0cmluZ30gKi9cclxuICAgICAgICB0aGlzLmZpbGxTdHlsZSA9IG9wdHMuZmlsbFN0eWxlIHx8ICgoZiwgeikgPT4gJ2JsYWNrJylcclxuICAgICAgICAvKipcclxuICAgICAgICAgKiBJbiBwaXhlbFxyXG4gICAgICAgICAqIEBwcml2YXRlXHJcbiAgICAgICAgICogQHR5cGUge2Z1bmN0aW9uKG9iamVjdCxudW1iZXIpOm51bWJlcn0gKi9cclxuICAgICAgICB0aGlzLmxpbmVXaWR0aCA9IG9wdHMubGluZVdpZHRoIHx8ICgoZiwgeikgPT4gMilcclxuXHJcbiAgICAgICAgLy9mb3IgbGluZXNcclxuXHJcbiAgICAgICAgLyoqXHJcbiAgICAgICAgICogQHByaXZhdGVcclxuICAgICAgICAgKiBAdHlwZSB7ZnVuY3Rpb24ob2JqZWN0LG51bWJlcik6c3RyaW5nfSAqL1xyXG4gICAgICAgIHRoaXMuY29sb3IgPSBvcHRzLmNvbG9yIHx8ICgoZiwgeikgPT4gJ2dyYXknKVxyXG4gICAgICAgIC8qKlxyXG4gICAgICAgICAqIEluIHBpeGVsXHJcbiAgICAgICAgICogQHByaXZhdGVcclxuICAgICAgICAgKiBAdHlwZSB7ZnVuY3Rpb24ob2JqZWN0LG51bWJlcik6bnVtYmVyfSAqL1xyXG4gICAgICAgIHRoaXMud2lkdGggPSBvcHRzLndpZHRoIHx8ICgoZiwgeikgPT4gMilcclxuICAgICAgICAvKipcclxuICAgICAgICAgKiBAcHJpdmF0ZVxyXG4gICAgICAgICAqIEB0eXBlIHtmdW5jdGlvbihvYmplY3QsbnVtYmVyKTpBcnJheS48bnVtYmVyPnx1bmRlZmluZWR9ICovXHJcbiAgICAgICAgdGhpcy5saW5lRGFzaCA9IG9wdHMubGluZURhc2ggfHwgKChmLCB6KSA9PiB1bmRlZmluZWQpXHJcblxyXG4gICAgICAgIC8qKlxyXG4gICAgICAgICAqIEBwcml2YXRlXHJcbiAgICAgICAgICogQHR5cGUge0FycmF5LjxvYmplY3Q+IHwgdW5kZWZpbmVkfSAqL1xyXG4gICAgICAgIHRoaXMuZnMgPSB1bmRlZmluZWRcclxuXHJcbiAgICAgICAgLyoqXHJcbiAgICAgICAgICogQHByaXZhdGVcclxuICAgICAgICAgKiBAdHlwZSB7c3RyaW5nfSAqL1xyXG4gICAgICAgIHRoaXMubG9hZGluZ1N0YXR1cyA9ICdub3RMb2FkZWQnXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBEcmF3IHRoZSBsYXllci5cclxuICAgICAqIEBwYXJhbSB7aW1wb3J0KFwiLi4vY29yZS9HZW9DYW52YXMuanNcIikuR2VvQ2FudmFzfSBnZW9DYW52YXMgVGhlIGNhbnZhcyB3aGVyZSB0byBkcmF3IHRoZSBsYXllci5cclxuICAgICAqIEByZXR1cm5zIHt2b2lkfVxyXG4gICAgICovXHJcbiAgICBkcmF3KGdlb0NhbnZhcykge1xyXG4gICAgICAgIC8vbG9hZCBkYXRhLCBpZiBub3QgZG9uZSB5ZXQuXHJcbiAgICAgICAgaWYgKCF0aGlzLmZzKSB7XHJcbiAgICAgICAgICAgIHRoaXMubG9hZChnZW9DYW52YXMucmVkcmF3KVxyXG4gICAgICAgICAgICByZXR1cm5cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vXHJcbiAgICAgICAgY29uc3QgeiA9IGdlb0NhbnZhcy52aWV3LnpcclxuICAgICAgICBjb25zdCBjdHggPSBnZW9DYW52YXMub2Zmc2NyZWVuQ3R4XHJcblxyXG4gICAgICAgIGZvciAoY29uc3QgZiBvZiB0aGlzLmZzKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGd0ID0gZi5nZW9tZXRyeS50eXBlXHJcblxyXG4gICAgICAgICAgICBpZiAoZ3QgPT0gJ1BvaW50Jykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgYyA9IGYuZ2VvbWV0cnkuY29vcmRpbmF0ZXNcclxuXHJcbiAgICAgICAgICAgICAgICAvL2dldCBzdHlsZSBwYXJhbWV0ZXJzIGZvciB0aGUgcG9pbnQgZmVhdHVyZVxyXG4gICAgICAgICAgICAgICAgY29uc3Qgc2hhcGUgPSB0aGlzLnNoYXBlKGYsIHopXHJcbiAgICAgICAgICAgICAgICBpZiAoIXNoYXBlIHx8IHNoYXBlID09ICdub25lJykgY29udGludWVcclxuICAgICAgICAgICAgICAgIGNvbnN0IHNpemUgPSB0aGlzLnNpemUoZiwgeikgKiB6XHJcbiAgICAgICAgICAgICAgICBpZiAoIXNpemUpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICBjb25zdCBzdHJva2VTdHlsZSA9IHRoaXMuc3Ryb2tlU3R5bGUoZiwgeilcclxuICAgICAgICAgICAgICAgIGNvbnN0IGZpbGxTdHlsZSA9IHRoaXMuZmlsbFN0eWxlKGYsIHopXHJcbiAgICAgICAgICAgICAgICBjb25zdCBsaW5lV2lkdGggPSB0aGlzLmxpbmVXaWR0aChmLCB6KSAqIHpcclxuXHJcbiAgICAgICAgICAgICAgICAvL3NldCBjYW52YXMgZHJhd2luZyBwYXJhbWV0ZXJzXHJcbiAgICAgICAgICAgICAgICBpZiAoc3Ryb2tlU3R5bGUpIGN0eC5zdHJva2VTdHlsZSA9IHN0cm9rZVN0eWxlXHJcbiAgICAgICAgICAgICAgICBpZiAoZmlsbFN0eWxlKSBjdHguZmlsbFN0eWxlID0gZmlsbFN0eWxlXHJcbiAgICAgICAgICAgICAgICBpZiAobGluZVdpZHRoKSBjdHgubGluZVdpZHRoID0gbGluZVdpZHRoXHJcblxyXG4gICAgICAgICAgICAgICAgaWYgKHNoYXBlID09ICdjaXJjbGUnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9kcmF3IGNpcmNsZSAtIGZpbGwgYW5kIHN0cm9rZVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5hcmMoY1swXSwgY1sxXSwgc2l6ZSAvIDIsIDAsIDIgKiBNYXRoLlBJLCBmYWxzZSlcclxuICAgICAgICAgICAgICAgICAgICBpZiAoZmlsbFN0eWxlKSBjdHguZmlsbCgpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0cm9rZVN0eWxlICYmIGxpbmVXaWR0aCkgY3R4LnN0cm9rZSgpXHJcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09ICdzcXVhcmUnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9kcmF3IHNxdWFyZSAtIGZpbGwgYW5kIHN0cm9rZVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5yZWN0KGNbMF0gLSBzaXplIC8gMiwgY1sxXSAtIHNpemUgLyAyLCBzaXplLCBzaXplKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChmaWxsU3R5bGUpIGN0eC5maWxsKClcclxuICAgICAgICAgICAgICAgICAgICBpZiAoc3Ryb2tlU3R5bGUgJiYgbGluZVdpZHRoKSBjdHguc3Ryb2tlKClcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignVW5leHBlY3RlZCBzaGFwZSBmb3IgcG9pbnQgZ2VvanNvbjogJyArIHNoYXBlKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGd0ID09ICdMaW5lU3RyaW5nJykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY3MgPSBmLmdlb21ldHJ5LmNvb3JkaW5hdGVzXHJcbiAgICAgICAgICAgICAgICBpZiAoY3MubGVuZ3RoIDwgMikgY29udGludWVcclxuXHJcbiAgICAgICAgICAgICAgICAvL3NldCBjb2xvclxyXG4gICAgICAgICAgICAgICAgY29uc3QgY29sID0gdGhpcy5jb2xvcihmLCB6KVxyXG4gICAgICAgICAgICAgICAgaWYgKCFjb2wgfHwgY29sID09ICdub25lJykgY29udGludWVcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IGNvbFxyXG5cclxuICAgICAgICAgICAgICAgIC8vc2V0IGxpbmV3aWR0aFxyXG4gICAgICAgICAgICAgICAgY29uc3Qgd1AgPSB0aGlzLndpZHRoKGYsIHopXHJcbiAgICAgICAgICAgICAgICBpZiAoIXdQIHx8IHdQIDwgMCkgY29udGludWVcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lV2lkdGggPSB3UCAqIHpcclxuXHJcbiAgICAgICAgICAgICAgICAvL3NldCBsaW5lIGRhc2hcclxuICAgICAgICAgICAgICAgIGNvbnN0IGxkUCA9IHRoaXMubGluZURhc2goZiwgeilcclxuICAgICAgICAgICAgICAgIGlmIChsZFApIGN0eC5zZXRMaW5lRGFzaChsZFApXHJcblxyXG4gICAgICAgICAgICAgICAgLy9kcmF3IGxpbmVcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyhjc1swXVswXSwgY3NbMF1bMV0pXHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IGNzLmxlbmd0aDsgaSsrKSBjdHgubGluZVRvKGNzW2ldWzBdLCBjc1tpXVsxXSlcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ1Vuc3VwcG9ydGVkIGdlb21ldHJ5IHR5cGUgaW4gR2VvSlNPTkxheWVyOiAnICsgZ3QpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vLi4uXHJcbiAgICAgICAgY3R4LnNldExpbmVEYXNoKFtdKVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogTG9hZCBkYXRhIGZvciBsYWJlbHMsIGZyb20gVVJMIHRoaXMudXJsXHJcbiAgICAgKiBAcGFyYW0ge2Z1bmN0aW9uKCk6dm9pZH0gY2FsbGJhY2tcclxuICAgICAqIEBwcml2YXRlXHJcbiAgICAgKi9cclxuICAgIGFzeW5jIGxvYWQoY2FsbGJhY2spIHtcclxuICAgICAgICBpZiAoIXRoaXMudXJsKSB7XHJcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKCdGYWlsZWQgbG9hZGluZyBib3VuZGFyaWVzOiBObyBVUkwgc3BlY2lmaWVkLiAnICsgdGhpcy51cmwpXHJcbiAgICAgICAgICAgIHRoaXMubG9hZGluZ1N0YXR1cyA9ICdmYWlsZWQnXHJcbiAgICAgICAgICAgIHRoaXMubGFiZWxzID0gW11cclxuICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2NoZWNrIGlmIGRhdGEgYWxyZWFkeSBsb2FkZWRcclxuICAgICAgICBpZiAodGhpcy5sb2FkaW5nU3RhdHVzICE9ICdub3RMb2FkZWQnKSByZXR1cm5cclxuXHJcbiAgICAgICAgLy9sb2FkIGRhdGFcclxuICAgICAgICB0aGlzLmxvYWRpbmdTdGF0dXMgPSAnbG9hZGluZydcclxuXHJcbiAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YV8gPSBhd2FpdCBqc29uKHRoaXMudXJsKVxyXG5cclxuICAgICAgICAgICAgLyoqIEB0eXBlIHsgQXJyYXkuPG9iamVjdD4gfSAqL1xyXG4gICAgICAgICAgICBjb25zdCBkYXRhID0gZGF0YV8uZmVhdHVyZXNcclxuXHJcbiAgICAgICAgICAgIC8vcHJlcHJvY2Vzcy9maWx0ZXJcclxuICAgICAgICAgICAgaWYgKHRoaXMucHJlcHJvY2Vzcykge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5mcyA9IFtdXHJcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IGMgb2YgZGF0YSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGIgPSB0aGlzLnByZXByb2Nlc3MoYylcclxuICAgICAgICAgICAgICAgICAgICBpZiAoYiA9PSBmYWxzZSkgY29udGludWVcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmZzLnB1c2goYylcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vc3RvcmUgbGFiZWxzXHJcbiAgICAgICAgICAgICAgICB0aGlzLmZzID0gZGF0YVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICB0aGlzLmxvYWRpbmdTdGF0dXMgPSAnbG9hZGVkJ1xyXG5cclxuICAgICAgICAgICAgLy9yZWRyYXdcclxuICAgICAgICAgICAgaWYgKGNhbGxiYWNrKSBjYWxsYmFjaygpXHJcbiAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcclxuICAgICAgICAgICAgY29uc29sZS5sb2coJ0ZhaWxlZCBsb2FkaW5nIGJvdW5kYXJpZXMgZnJvbSAnICsgdGhpcy51cmwpXHJcbiAgICAgICAgICAgIHRoaXMuZnMgPSBbXVxyXG4gICAgICAgICAgICB0aGlzLmxvYWRpbmdTdGF0dXMgPSAnZmFpbGVkJ1xyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG4iLCIvL0B0cy1jaGVja1xyXG4ndXNlIHN0cmljdCdcclxuXHJcbmltcG9ydCB7IExheWVyIH0gZnJvbSAnLi4vY29yZS9MYXllci5qcydcclxuXHJcbi8qKlxyXG4gKiBBIGxheWVyLCB3aGljaCBzcGVjaWZpZXMgYSBkYXRhc2V0IHRvIGJlIHNob3duIHdpdGggc3BlY2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4gICAgICAgICAgICAvL2RyYXcgc3R5bGUgZmlsdGVyXHJcbiAgICAgICAgICAgIGlmIChzLmZpbHRlckNvbG9yKSBzLmRyYXdGaWx0ZXIoZ2VvQ2FudmFzKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9hZGQgbGVnZW5kIGVsZW1lbnRcclxuICAgICAgICBpZiAobGVnZW5kKSB7XHJcbiAgICAgICAgICAgIGZvciAoY29uc3QgcyBvZiB0aGlzLnN0eWxlcykge1xyXG4gICAgICAgICAgICAgICAgLy9jaGVjayBpZiBzdHlsZSBpcyB2aXNpYmxlXHJcbiAgICAgICAgICAgICAgICBpZiAocy52aXNpYmxlICYmICFzLnZpc2libGUoeikpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICBHcmlkTGF5ZXIuYWRkTGVnZW5kcyhsZWdlbmQsIHMubGVnZW5kcylcclxuXHJcbiAgICAgICAgICAgICAgICAvL2Nhc2UgZm9yIHN0eWxlcyBvZiBzdHlsZXMsIGxpa2Uga2VybmVsIHNtb290aGluZ1xyXG4gICAgICAgICAgICAgICAgLy9UT0RPIGRvIGJldHRlclxyXG4gICAgICAgICAgICAgICAgaWYgKHNbJ3N0eWxlcyddKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCBzMiBvZiBzWydzdHlsZXMnXSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoczIudmlzaWJsZSAmJiAhczIudmlzaWJsZSh6KSkgY29udGludWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgR3JpZExheWVyLmFkZExlZ2VuZHMobGVnZW5kLCBzMi5sZWdlbmRzKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvKiogQHByaXZhdGUgKi9cclxuICAgIHN0YXRpYyBhZGRMZWdlbmRzKGxlZ2VuZENvbXAsIGx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gICAgICB0aGlzLmxhYmVscyA9IHVuZGVmaW5lZFxyXG5cclxuICAgICAgICAvKipcclxuICAgICAgICAgKiBAcHJpdmF0ZVxyXG4gICAgICAgICAqIEB0eXBlIHtzdHJpbmd9ICovXHJcbiAgICAgICAgdGhpcy5sb2FkaW5nU3RhdHVzID0gJ25vdExvYWRlZCdcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIERyYXcgdGhlIGxhYmVsIGxheWVyLlxyXG4gICAgICpcclxuICAgICAqIEBwYXJhbSB7aW1wb3J0KFwiLi4vY29yZS9HZW9DYW52YXNcIikuR2VvQ2FudmFzfSBnZW9DYW52YXMgVGhlIGNhbnZhcyB3aGVyZSB0byBkcmF3IHRoZSBsYXllci5cclxuICAgICAqIEByZXR1cm5zIHt2b2lkfVxyXG4gICAgICovXHJcbiAgICBkcmF3KGdlb0NhbnZhcykge1xyXG4gICAgICAgIC8vbG9hZCBsYWJlbHMsIGlmIG5vdCBkb25lIHlldC5cclxuICAgICAgICBpZiAoIXRoaXMubGFiZWxzKSB7XHJcbiAgICAgICAgICAgIHRoaXMubG9hZChnZW9DYW52YXMucmVkcmF3KVxyXG4gICAgICAgICAgICByZXR1cm5cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vXHJcbiAgICAgICAgY29uc3QgeiA9IGdlb0NhbnZhcy52aWV3LnpcclxuICAgICAgICBjb25zdCBjdHggPSBnZW9DYW52YXMub2Zmc2NyZWVuQ3R4XHJcblxyXG4gICAgICAgIC8vdGV4dCBhbGlnblxyXG4gICAgICAgIGN0eC50ZXh0QWxpZ24gPSB0aGlzLnRleHRBbGlnbiB8fCAnc3RhcnQnXHJcblxyXG4gICAgICAgIC8vbGluZSBqb2luIGFuZCBjYXBcclxuICAgICAgICBjdHgubGluZUpvaW4gPSAnYmV2ZWwnIC8vfHwgXCJyb3VuZFwiIHx8IFwibWl0ZXJcIjtcclxuICAgICAgICBjdHgubGluZUNhcCA9ICdidXR0JyAvL3x8IFwicm91bmRcIiB8fCBcInNxdWFyZVwiO1xyXG5cclxuICAgICAgICAvL2RyYXcgaW4gcGl4IGNvb3JkaW5hdGVzXHJcbiAgICAgICAgZ2VvQ2FudmFzLmluaXRDYW52YXNUcmFuc2Zvcm0oKVxyXG5cclxuICAgICAgICAvL2RyYXcgbGFiZWxzLCBvbmUgYnkgb25lXHJcbiAgICAgICAgZm9yIChjb25zdCBsYiBvZiB0aGlzLmxhYmVscykge1xyXG4gICAgICAgICAgICAvL2dldCBsYWJlbCBzdHlsZVxyXG4gICAgICAgICAgICBjb25zdCBzdCA9IHRoaXMuc3R5bGUobGIsIHopXHJcbiAgICAgICAgICAgIGlmICghc3QpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGN0eC5mb250ID0gc3RcclxuXHJcbiAgICAgICAgICAgIC8vY2hlY2sgbGFiZWwgd2l0aGluIHRoZSB2aWV3LCB0byBiZSBkcmF3blxyXG4gICAgICAgICAgICBpZiAoIWdlb0NhbnZhcy50b0RyYXcobGIpKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy9wb3NpdGlvblxyXG4gICAgICAgICAgICBjb25zdCB4UCA9IGdlb0NhbnZhcy5nZW9Ub1BpeFgobGIueCkgKyB0aGlzLm9mZnNldFBpeFswXVxyXG4gICAgICAgICAgICBjb25zdCB5UCA9IGdlb0NhbnZhcy5nZW9Ub1BpeFkobGIueSkgLSB0aGlzLm9mZnNldFBpeFsxXVxyXG5cclxuICAgICAgICAgICAgLy9sYWJlbCBzdHJva2UsIGZvciB0aGUgaGFsb1xyXG4gICAgICAgICAgICBpZiAodGhpcy5oYWxvQ29sb3IgJiYgdGhpcy5oYWxvV2lkdGgpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGhjID0gdGhpcy5oYWxvQ29sb3IobGIsIHopXHJcbiAgICAgICAgICAgICAgICBjb25zdCBodyA9IHRoaXMuaGFsb1dpZHRoKGxiLCB6KVxyXG4gICAgICAgICAgICAgICAgaWYgKGhjICYmIGh3ICYmIGh3ID4gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IGhjXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IGh3XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LnN0cm9rZVRleHQobGIubmFtZSwgeFAsIHlQKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvL2xhYmVsIGZpbGxcclxuICAgICAgICAgICAgaWYgKHRoaXMuY29sb3IpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNvbCA9IHRoaXMuY29sb3IobGIsIHopXHJcbiAgICAgICAgICAgICAgICBpZiAoY29sKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IGNvbFxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5maWxsVGV4dChsYi5uYW1lLCB4UCwgeVApXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBMb2FkIGRhdGEgZm9yIGxhYmVscywgZnJvbSBVUkwgdGhpcy51cmxcclxuICAgICAqIEBwYXJhbSB7ZnVuY3Rpb24oKTp2b2lkfSBjYWxsYmFja1xyXG4gICAgICogQHByaXZhdGVcclxuICAgICAqL1xyXG4gICAgYXN5bmMgbG9hZChjYWxsYmFjaykge1xyXG4gICAgICAgIGlmICghdGhpcy51cmwpIHtcclxuICAgICAgICAgICAgY29uc29sZS5sb2coJ0ZhaWxlZCBsb2FkaW5nIGxhYmVsczogTm8gVVJMIHNwZWNpZmllZC4gJyArIHRoaXMudXJsKVxyXG4gICAgICAgICAgICB0aGlzLmxvYWRpbmdTdGF0dXMgPSAnZmFpbGVkJ1xyXG4gICAgICAgICAgICB0aGlzLmxhYmVscyA9IFtdXHJcbiAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9jaGVjayBpZiBkYXRhIGFscmVhZHkgbG9hZGVkXHJcbiAgICAgICAgaWYgKHRoaXMubG9hZGluZ1N0YXR1cyAhPSAnbm90TG9hZGVkJykgcmV0dXJuXHJcblxyXG4gICAgICAgIC8vbG9hZCBkYXRhXHJcbiAgICAgICAgdGhpcy5sb2FkaW5nU3RhdHVzID0gJ2xvYWRpbmcnXHJcblxyXG4gICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgIC8qKiBAdHlwZSB7IEFycmF5LjxMYWJlbD4gfSAqL1xyXG4gICAgICAgICAgICBjb25zdCBkYXRhID0gYXdhaXQgY3N2KHRoaXMudXJsKVxyXG5cclxuICAgICAgICAgICAgLy9wcmVwcm9jZXNzL2ZpbHRlclxyXG4gICAgICAgICAgICBpZiAodGhpcy5wcmVwcm9jZXNzKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmxhYmVscyA9IFtdXHJcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IGMgb2YgZGF0YSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGIgPSB0aGlzLnByZXByb2Nlc3MoYylcclxuICAgICAgICAgICAgICAgICAgICBpZiAoYiA9PSBmYWxzZSkgY29udGludWVcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxhYmVscy5wdXNoKGMpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvL3N0b3JlIGxhYmVsc1xyXG4gICAgICAgICAgICAgICAgdGhpcy5sYWJlbHMgPSBkYXRhXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIHRoaXMubG9hZGluZ1N0YXR1cyA9ICdsb2FkZWQnXHJcblxyXG4gICAgICAgICAgICAvL3JlZHJhd1xyXG4gICAgICAgICAgICBpZiAoY2FsbGJhY2spIGNhbGxiYWNrKClcclxu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dyA9IHRoaXMuc3Ryb2tlV2lkdGhcclxuXHJcbiAgICAgICAgICAgIC8vZHJhdyBncmFwaGljIGVsZW1lbnQ6IGJveCAvIGNpcmNsZVxyXG4gICAgICAgICAgICBpZiAodGhpcy5zaGFwZSA9PT0gJ3NxdWFyZScpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGggPSB0aGlzLmRpbWVuc2lvbi5oIHx8IDE1XHJcbiAgICAgICAgICAgICAgICBjb25zdCB3ID0gdGhpcy5kaW1lbnNpb24udyB8fCAyMFxyXG4gICAgICAgICAgICAgICAgZC5hcHBlbmQoJ2RpdicpXHJcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdkaXNwbGF5JywgJ2lubGluZScpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3N2ZycpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgdyArIDIgKiBzdylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgaCArIDIgKiBzdylcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgncmVjdCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBzdylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIHN3KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGgpXHJcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgY2F0WzBdKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgdGhpcy5zdHJva2VDb2xvcilcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS13aWR0aCcsIHRoaXMuc3Ryb2tlV2lkdGgpXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5zaGFwZSA9PT0gJ2NpcmNsZScpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHIgPSB0aGlzLmRpbWVuc2lvbi5yIHx8IDhcclxuICAgICAgICAgICAgICAgIGNvbnN0IGggPSAyICogciArIDIgKiBzd1xyXG4gICAgICAgICAgICAgICAgZC5hcHBlbmQoJ2RpdicpXHJcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdkaXNwbGF5JywgJ2lubGluZScpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3N2ZycpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgaClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgaClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnY2lyY2xlJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY3gnLCByICsgc3cpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2N5JywgciArIHN3KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdyJywgcilcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBjYXRbMF0pXHJcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCB0aGlzLnN0cm9rZUNvbG9yKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLXdpZHRoJywgdGhpcy5zdHJva2VXaWR0aClcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5leHBlY3RlZCBzaGFwZTonICsgdGhpcy5zaGFwZSlcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy93cml0ZSBsYWJlbCB0ZXh0XHJcbiAgICAgICAgICAgIGQuYXBwZW5kKCdkaXYnKVxyXG4gICAgICAgICAgICAgICAgLy9zaG93IG9uIHJpZ2h0IG9mIGdyYXBo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WYgKCFicmVha3MpIHJldHVyblxyXG5cclxuICAgICAgICAvL2NsYXNzZXNcclxuICAgICAgICBjb25zdCBuYiA9IGNvbG9ycy5sZW5ndGhcclxuICAgICAgICBpZiAobmIgPT0gMCkgcmV0dXJuXHJcbiAgICAgICAgY29uc3QgdyA9IHRoaXMud2lkdGggLyBuYlxyXG5cclxuICAgICAgICAvL21ha2Ugc3ZnIGVsZW1lbnRcclxuICAgICAgICBjb25zdCBzdmcgPSB0aGlzLmRpdlxyXG4gICAgICAgICAgICAuYXBwZW5kKCdzdmcnKVxyXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCB0aGlzLndpZHRoKVxyXG4gICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgdGhpcy5oZWlnaHQgKyB0aGlzLnRpY2tTaXplICsgMiArIDEwKVxyXG5cclxuICAgICAgICAvL2RyYXcgZ3JhcGhpYyBlbGVtZW50c1xyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbmI7IGkrKykge1xyXG4gICAgICAgICAgICBzdmcuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgaSAqIHcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIDApXHJcbiAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCB3KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIHRoaXMuaGVpZ2h0KVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgY29sb3JzW2ldKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy90aWNrIGxpbmVcclxuICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IG5iOyBpKyspIHtcclxuICAgICAgICAgICAgc3ZnLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneDEnLCB3ICogaSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5MScsIDApXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneDInLCB3ICogaSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5MicsIHRoaXMuaGVpZ2h0ICsgdGhpcy50aWNrU2l6ZSlcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgJ2JsYWNrJylcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vbGFiZWxzXHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDE7IGkgPCBuYjsgaSsrKSB7XHJcbiAgICAgICAgICAgIGxldCBsYWJlbCA9IGJyZWFrc1tpIC0gMV1cclxuICAgICAgICAgICAgaWYgKGlzTmFOKGxhYmVsKSB8fCBsYWJlbCA9PSB1bmRlZmluZWQpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGlmICh0aGlzLmxhYmVsRm9ybWF0KSBsYWJlbCA9IHRoaXMubGFiZWxGb3JtYXQobGFiZWwpXHJcblxyXG4gICAgICAgICAgICAvL2xhYmVsXHJcbiAgICAgICAgICAgIHN2Zy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ3RpY2tsYWJlbF8nICsgaSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgdyAqIGkpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHRoaXMuaGVpZ2h0ICsgdGhpcy50aWNrU2l6ZSArIDIpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZvbnQtc2l6ZScsIHRoaXMubGFiZWxGb250U2l6ZSlcclxuICAgICAgICAgICAgICAgIC8vLnN0eWxlKFwiZm9udC13ZWlnaHRcIiwgXCJib2xkXCIpXHJcbiAgICAgICAgICAgICAgICAvLy5zdHlsZShcImZvbnQtZmFtaWx5XCIsIFwiQXJpYWxcIilcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgndGV4dC1hbmNob3InLCAnbWlkZGxlJylcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnYWxpZ25tZW50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csIHN0ZXApXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgaClcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIHRoaXMuY29sb3JTY2FsZSh0LCBvcHRzLnZpZXdTY2FsZSkpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMudGlja3M7IGkrKykge1xyXG4gICAgICAgICAgICBsZXQgdCA9IGkgLyAodGhpcy50aWNrcyAtIDEpXHJcblxyXG4gICAgICAgICAgICAvL3RpY2sgbGluZVxyXG4gICAgICAgICAgICBnLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneDEnLCB3ICogdClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5MScsIDApXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneDInLCB3ICogdClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5MicsIGggKyB0aGlzLnRpY2tTaXplKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCAnYmxhY2snKVxyXG5cclxuICAgICAgICAgICAgLy9wcmVwYXJlIHRpY2sgbGFiZWxcclxuICAgICAgICAgICAgZy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ3RpY2tsYWJlbF8nICsgaSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgdyAqIHQpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIGggKyB0aGlzLnRpY2tTaXplICsgMilcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnZm9udC1zaXplJywgdGhpcy5mb250U2l6ZSlcclxuICAgICAgICAgICAgICAgIC8vLnN0eWxlKFwiZm9udC13ZWlnaHRcIiwgXCJib2xkXCIpXHJcbiAgICAgICAgICAgICAgICAvLy5zdHlsZShcImZvbnQtZmFtaWx5XCIsIFwiQXJpYWxcIilcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgndGV4dC1hbmNob3InLCBpID09IDAgPyAnc3RhcnQnIDogaSA9PSB0aGlzLnRpY2tzIC0gMSA/ICdlbmQnIDogJ21pZGRsZScpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ2FsaWdubWVudC1iYXNlbGluZScsICd0b3AnKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdkb21pbmFudC1iYXNlbGluZScsICdoYW5naW5nJylcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgncG9pbnRlci1ldmVudHMnLCAnbm9uZScpXHJcbiAgICAgICAgICAgIC8vLnRleHQoXCItXCIpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL3VwZGF0ZSB0aWNrIGxhYmVsc1xyXG5cclxuICAgICAgICAvL2xhYmVsIHRleHQgZm9ybWF0XHJcbiAgICAgICAgY29uc3QgZiA9IHRoaXMudGlja0Zvcm1hdCAmJiB0aGlzLnRpY2tGb3JtYXQgIT0gJ3RleHQnID8gdGhpcy50aWNrRm9ybWF0IDogKHYpID0+IHZcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMudGlja3M7IGkrKykge1xyXG4gICAgICAgICAgICBsZXQgdCA9IGkgLyAodGhpcy50aWNrcyAtIDEpXHJcblxyXG4gICAgICAgICAgICBjb25zdCB2ID0gdGhpcy50ZXh0U2NhbGUodCwgb3B0cy52aWV3U2NhbGUpXHJcbiAgICAgICAgICAgIGNvbnN0IHRleHQgPSAodiA/IGYodikgOiAnMCcpICsgKHRoaXMudGlja1VuaXQgPyB0aGlzLnRpY2tVbml0IDogJycpXHJcbiAgICAgICAgICAgIGlmICh0ZXh0ID09IHVuZGVmaW5lZCkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vdGljayBsYWJlbFxyXG4gICAgICAgICAgICB0aGlzLmRpdi5zZWxlY3QoJyMnICsgJ3RpY2tsYWJlbF8nICsgaSkudGV4dCh0ZXh0KVxyXG4gICAgICAg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0dHIoJ2hlaWdodCcsIHN2Z1MpLnN0eWxlKCcnLCAnaW5saW5lLWJsb2NrJylcclxuXHJcbiAgICAgICAgY29uc3QgY29zID0gTWF0aC5jb3MoKC10aGlzLm9yaWVudGF0aW9uICogTWF0aC5QSSkgLyAxODApXHJcbiAgICAgICAgY29uc3Qgc2luID0gTWF0aC5zaW4oKC10aGlzLm9yaWVudGF0aW9uICogTWF0aC5QSSkgLyAxODApXHJcbiAgICAgICAgY29uc3QgZGMgPSBzdmdTICogMC41LFxyXG4gICAgICAgICAgICBsMiA9IGxlbmd0aFBpeCAqIDAuNVxyXG4gICAgICAgIHN2Zy5hcHBlbmQoJ2xpbmUnKVxyXG4gICAgICAgICAgICAuYXR0cigneDEnLCBkYyAtIGNvcyAqIGwyKVxyXG4gICAgICAgICAgICAuYXR0cigneTEnLCBkYyAtIHNpbiAqIGwyKVxyXG4gICAgICAgICAgICAuYXR0cigneDInLCBkYyArIGNvcyAqIGwyKVxyXG4gICAgICAgICAgICAuYXR0cigneTInLCBkYyArIHNpbiAqIGwyKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsIGNvbG9yKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS13aWR0aCcsIHdpZHRoUGl4KVxyXG5cclxuICAgICAgICAvL2xhYmVsXHJcbiAgICAgICAgZC5hcHBlbmQoJ2RpdicpXHJcbiAgICAgICAgICAgIC5zdHlsZSgnZGlzcGxheScsICdpbmxpbmUnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ3BhZGRpbmctbGVmdCcsICc1cHgnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ2ZvbnQtc2l6ZScsIHRoaXMubGFiZWxGb250U2l6ZSlcclxuICAgICAgICAgICAgLnRleHQodGhpcy5sYWJlbCArICh0aGlzLmxhYmVsVW5pdFRleHQgPyAnICcgOiAnJykgKyB0aGlzLmxhYmVsVW5pdFRleHQpXHJcbiAgICB9XHJcbn1cclxuXHJcbi8q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0Jywgc2l6ZVBpeCArIHRoaXMuc3Ryb2tlV2lkdGggKyAyKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCcnLCAnaW5saW5lLWJsb2NrJylcclxuXHJcbiAgICAgICAgaWYgKHRoaXMuc2hhcGUgPT09ICdzcXVhcmUnKSB7XHJcbiAgICAgICAgICAgIHN2ZygpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgMClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgMClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHNpemVQaXgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0Jywgc2l6ZVBpeClcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIHRoaXMuZmlsbENvbG9yKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCB0aGlzLnN0cm9rZUNvbG9yKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2Utd2lkdGgnLCB0aGlzLnN0cm9rZVdpZHRoKVxyXG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5zaGFwZSA9PT0gJ2NpcmNsZScpIHtcclxuICAgICAgICAgICAgLy8gPGNpcmNsZSBjeD1cIjUwXCIgY3k9XCI1MFwiIHI9XCI0MFwiIHN0cm9rZT1cImJsYWNrXCIgc3Ryb2tlLXdpZHRoPVwiM1wiIGZpbGw9XCJyZWRcIiAvPlxyXG4gICAgICAgICAgICBjb25zdCByID0gKHNpemVQaXggKyB0aGlzLnN0cm9rZVdpZHRoKSAqIDAuNVxyXG4gICAgICAgICAgICBzdmcoKVxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnY2lyY2xlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjeCcsIHIgKyAxKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2N5JywgciArIDEpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigncicsIHIpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCB0aGlzLmZpbGxDb2xvcilcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgdGhpcy5zdHJva2VDb2xvcilcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLXdpZHRoJywgdGhpcy5zdHJva2VXaWR0aClcclxuICAgICAgICB9IGVsc2UgaWYgKHRoaXMuc2hhcGUgPT09ICdkb251dCcpIHtcclxuICAgICAgICAgICAgLy9UT0RPXHJcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLnNoYXBlID09PSAnZGlhbW9uZCcpIHtcclxuICAgICAgICAgICAgLy9UT0RPXHJcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLnNoYXBlID09PSAnbGluZScpIHtcclxuICAgICAgICAgICAgLy9nZXQgc2VnbWVudCBsZW5ndGhcclxuICAgICAgICAgICAgbGV0IGxlbmd0aFBpeCA9IHRoaXMubGVuZ3RoXHJcbiAgICAgICAgICAgICAgICA/IHRoaXMubGVuZ3RoKG9wdHMucmVzb2x1dGlvbiwgb3B0cy56LCBvcHRzLnZpZXdTY2FsZSlcclxuICAgICAgICAgICAgICAgIDogb3B0cy5yZXNvbHV0aW9uXHJcbiAgICAgICAgICAgIGxlbmd0aFBpeCAvPSBvcHRzLnpcclxuXHJcbiAgICAgICAgICAgIGNvbnN0IHN2ZyA9IGRcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3N2ZycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBsZW5ndGhQaXgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0Jywgc2l6ZVBpeClcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnJywgJ2lubGluZS1ibG9jaycpXHJcblxyXG4gICAgICAgICAgICAvL1RPRE8gb3JpZW50YXRpb25cclxuICAgICAgICAgICAgLy88bGluZSB4MT1cIjBcIiB5MT1cIjBcIiB4Mj1cIjIwMFwiIHkyPVwiMjAwXCIgc3R5bGU9XCJzdHJva2U6cmdiKDI1NSwwLDApO3N0cm9rZS13aWR0aDoyXCIgLz5cclxuICAgICAgICAgICAgc3ZnLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneDEnLCAwKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3kxJywgc2l6ZVBpeCAvIDIpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneDInLCBsZW5ndGhQaXgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneTInLCBzaXplUGl4IC8gMilcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgdGhpcy5jb2xvcilcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLXdpZHRoJywgc2l6ZVBpeClcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1VuZXhwZWN0ZWQgc2hhcGU6JyArIHRoaXMuc2hhcGUpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2xhYmVsXHJcbiAgICAgICAgZC5hcHBlbmQoJ2RpdicpXHJcbiAgICAgICAgICAgIC5zdHlsZSgnZGlzcGxheScsICdpbmxpbmUnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ3BhZGRpbmctbGVmdCcsICc1cHgnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ2ZvbnQtc2l6ZScsIHRoaXMubGFiZWxGb250U2l6ZSlcclxuICAgICAgICAgICAgLnRleHQobGFiZWwgKyAodGhpcy5sYWJlbFVuaXRUZXh0ID8gJyAnIDogJycpICsgdGhpcy5sYWJlbFVuaXRUZXh0KVxyXG4gICAgfVxyXG59XHJcblxyXG4vKipcclxuICogQHBhcmFtIHtBcnJheS48bnVtYmVyPn0gdmFsdWVzXHJcbiAqIEBwYXJh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JcblxyXG4gICAgICAgIC8vdG9wIGxhYmVsXHJcbiAgICAgICAgc3ZnLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgdyAvIDIpXHJcbiAgICAgICAgICAgIC5hdHRyKCd5JywgcGFkZGluZyArIGZvbnRTaXplKVxyXG4gICAgICAgICAgICAudGV4dCh0aGlzLnRvcFRleHQpXHJcbiAgICAgICAgICAgIC5hdHRyKCdmb250LXNpemUnLCBmb250U2l6ZSlcclxuICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ21pZGRsZScpXHJcbiAgICAgICAgLy9sZWZ0IGxhYmVsXHJcbiAgICAgICAgc3ZnLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgMClcclxuICAgICAgICAgICAgLmF0dHIoJ3knLCAzICogcGFkZGluZyArIDIgKiBmb250U2l6ZSArIGgpXHJcbiAgICAgICAgICAgIC50ZXh0KHRoaXMubGVmdFRleHQpXHJcbiAgICAgICAgICAgIC5hdHRyKCdmb250LXNpemUnLCBmb250U2l6ZSlcclxuICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ3N0YXJ0JylcclxuICAgICAgICAvL3JpZ2h0IGxhYmVsXHJcbiAgICAgICAgc3ZnLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgdylcclxuICAgICAgICAgICAgLmF0dHIoJ3knLCAzICogcGFkZGluZyArIDIgKiBmb250U2l6ZSArIGgpXHJcbiAgICAgICAgICAgIC50ZXh0KHRoaXMucmlnaHRUZXh0KVxyXG4gICAgICAgICAgICAuYXR0cignZm9udC1zaXplJywgZm9udFNpemUpXHJcbiAgICAgICAgICAgIC5hdHRyKCd0ZXh0LWFuY2hvcicsICdlbmQnKVxyXG5cclxuICAgICAgICAvL3RyaWFuZ2xlIGdyb3VwXHJcbiAgICAgICAgY29uc3QgZyA9IHN2Z1xyXG4gICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgLmF0dHIoXHJcbiAgICAgICAgICAgICAgICAndHJhbnNmb3JtJyxcclxuICAgICAgICAgICAgICAgICd0cmFuc2xhdGUoJyArXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uU3Ryb2tlV2lkdGggLyAyICtcclxuICAgICAgICAgICAgICAgICAgICAnICcgK1xyXG4gICAgICAgICAgICAgICAgICAgIChzZWxlY3Rpb25TdHJva2VXaWR0aCAvIDIgKyAoMiAqIHBhZGRpbmcgKyBmb250U2l6ZSkpICtcclxuICAgICAgICAgICAgICAgICAgICAnKSdcclxuICAgICAgICAgICAgKVxyXG5cclxuICAgICAgICAvL2NvbW1vbiBmdW5jdGlvbiBmb3IgdHJpYW5nbGUgcGF0Y2hlc1xyXG4gICAgICAgIGNvbnN0IHNldEF0dHJpYnV0ZXMgPSAoZWx0LCBjb2xvciwgdGV4dCkgPT4ge1xyXG4gICAgICAgICAgICAvL2VsdC5yYWlzZSgpO1xyXG4gICAgICAgICAgICBlbHQuYXR0cignZmlsbCcsIGNvbG9yKVxyXG4gICAgICAgICAgICAgICAgLy8uYXR0cihcInN0cm9rZVwiLCBjb2xvck92ZXIpXHJcbiAgICAgICAgICAgICAgICAvLy5hdHRyKFwic3Ryb2tlLXdpZHRoXCIsIDApXHJcbiAgICAgICAgICAgICAgICAvLy5hdHRyKFwic3Ryb2tlLWxpbmVqb2luXCIsIFwicm91bmRcIilcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAvKnRoaXMucGFyZW50Tm9kZS5hcHBlbmRDaGlsZCh0aGlzKTsgc2VsZWN0KHRoaXMpLmF0dHIoXCJzdHJva2Utd2lkdGhcIiwgc2VsZWN0aW9uU3Ryb2tlV2lkdGgpOyovXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLmF0dHIoJ2ZpbGwnLCBzZWxlY3Rpb25Db2xvcilcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXR0IHx8ICF0ZXh0KSByZXR1cm5cclxuICAgICAgICAgICAgICAgICAgICB0dC5odG1sKHRleHQpXHJcbiAgICAgICAgICAgICAgICAgICAgdHQuc2V0UG9zaXRpb24oZSlcclxuICAgICAgICAgICAgICAgICAgICB0dC5zaG93KClcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8qc2VsZWN0KHRoaXMpLmF0dHIoXCJzdHJva2Utd2lkdGhcIiwgMCk7Ki9cclxuICAgICAgICAgICAgICAgICAgICBzZWxlY3QodGhpcykuYXR0cignZmlsbCcsIGNvbG9yKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0dCkgdHQuaGlkZSgpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICBpZiAodHQgJiYgdGV4dClcclxuICAgICAgICAgICAgICAgIGVsdC5vbignbW91c2Vtb3ZlJywgZnVuY3Rpb24gKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICB0dC5zZXRQb3NpdGlvbihlKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vY29uc3QgW2MwLCBjMSwgYzJdID0gY2xhc3NpZmllci5jZW50ZXJcclxuXHJcbiAgICAgICAgLy90cmFwZXppdW0gczBcclxuICAgICAgICBjb25zdCB0MCA9IGdcclxuICAgICAgICAgICAgLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgIC5hdHRyKFxyXG4gICAgICAgICAgICAgICAgJ3BvaW50cycsXHJcbiAgICAgICAgICAgICAgICAnMCwnICtcclxuICAgICAgICAgICAgICAgICAgICBoICtcclxuICAgICAgICAgICAgICAgICAgICAnICcgK1xyXG4gICAgICAgICAgICAgICAgICAgIHcgLyAzICtcclxuICAgICAgICAgICAgICAgICAgICAnLCcgK1xyXG4gICAgICAgICAgICAgICAgICAgIGggK1xyXG4gICAgICAgICAgICAgICAgICAgICcgJyArXHJcbiAgICAgICAgICAgICAgICAgICAgdyAvIDIgK1xyXG4gICAgICAgICAgICAgICAgICAgICcsJyArXHJcbiAgICAgICAgICAgICAgICAgICAgKGggKiAyKSAvIDMgK1xyXG4gICAgICAgICAgICAgICAgICAgICcgJyArXHJcbiAgICAgICAgICAgICAgICAgICAgdyAvIDYgK1xyXG4gICAgICAgICAgICAgICAgICAgICcsJyArXHJcbiAgICAgICAgICAgICAgICAgICAgKGggKiAyKSAvIDNcclxuICAgICAgICAgICAgKVxyXG4gICAgICAgIHNldEF0dHJpYnV0ZXModDAsIGNsYXNzaWZpZXIuY29sb3JzWzBdLCB0ZXh0c1snMCddKVxyXG4gICAgICAgIC8vdHJhcGV6aXVtIHMxXHJcbiAgICAgICAgY29uc3QgdDEgPSBnXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ3BvbHlnb24nKVxyXG4gICAgICAgICAgICAuYXR0cihcclxuICAgICAgICAgICAgICAgICdwb2ludHMnLFxyXG4gICAgICAgICAgICAgICAgdyAvIDIgK1xyXG4gICAgICAgICAgICAgICAgICAgICcsMCAnICtcclxuICAgICAgICAgICAgICAgICAgICAodyAqIDIpIC8gMyArXHJcbiAgICAgICAgICAgICAgICAgICAgJywnICtcclxuICAgICAgICAgICAgICAgICAgICBoIC8gMyArXHJcbiAgICAgICAgICAgICAgICAgICAgJyAnICtcclxuICAgICAgICAgICAgICAgICAgICB3IC8gMiArXHJcbiAgICAgICAgICAgICAgICAgICAgJywnICtcclxuICAgICAgICAgICAgICAgICAgICAoaCAqIDIpIC8gMyArXHJcbiAgICAgICAgICAgICAgICAgICAgJyAnICtcclxuICAgICAgICAgICAgICAgICAgICB3IC8gMyArXHJcbiAgICAgICAgICAgICAgICAgICAgJywnICtcclxuICAgICAgICAgICAgICAgICAgICBoIC8gM1xyXG4gICAgICAgICAgICApXHJcbiAgICAgICAgc2V0QXR0cmlidXRlcyh0MSwgY2xhc3NpZmllci5jb2xvcnNbMV0sIHRleHRzWycxJ10pXHJcbiAgICAgICAgLy90cmFwZXppdW0gczJcclxuICAgICAgICBjb25zdCB0MiA9IGdcclxuICAgICAgICAgICAgLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgIC5hdHRyKFxyXG4gICAgICAgICAgICAgICAgJ3BvaW50cycsXHJcbiAgICAgICAgICAgICAgICB3ICtcclxuICAgICAgICAgICAgICAgICAgICAnLCcgK1xyXG4gICAgICAgICAgICAgICAgICAgIGggK1xyXG4gICAgICAgICAgICAgICAgICAgICcgJyArXHJcbiAgICAgICAgICAgICAgICAgICAgKHcgKiA1KSAvIDYgK1xyXG4gICAgICAgICAgICAgICAgICAgICcsJyArXHJcbiAgICAgICAgICAgICAgICAgICAgKDIgKiBoKSAvIDMgK1xyXG4gICAgICAgICAgICAgICAgICAgICcgJyArXHJcbiAgICAgICAgICAgICAgICAgICAgdyAvIDIgK1xyXG4gICAgICAgICAgICAgICAgICAgICcsJyArXHJcbiAgICAgICAgICAgICAgICAgICAgKGggKiAyKSAvIDMgK1xyXG4gICAgICAgICAgICAgICAgICAgICcgJyArXHJcbiAgICAgICAgICAgICAgICAgICAgKHcgKiAyKSAvIDMgK1xyXG4gICAgICAgICAgICAgICAgICAgICcsJyArXHJcbiAgICAgICAgICAgICAgICAgICAgaFxyXG4gICAgICAgICAgICApXHJcbiAgICAgICAgc2V0QXR0cmlidXRlcyh0MiwgY2xhc3NpZmllci5jb2xvcnNbMl0sIHRleHRzWycyJ10pXHJcbiAgICAgICAgLy90cmlhbmdsZSBzMFxyXG4gICAgICAgIGNvbnN0IHQwXyA9IGdcclxuICAgICAgICAgICAgLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgIC5hdHRyKFxyXG4gICAgICAgICAgICAgICAgJ3BvaW50cycsXHJcbiAgICAgICAgICAgICAgICB3IC8gMiArXHJcbiAgICAgICAgICAgICAgICAgICAgJywnICtcclxuICAgICAgICAgICAgICAgICAgICAoaCAqIDIpIC8gMyArXHJcbiAgICAgICAgICAgICAgICAgICAgJyAnICtcclxuICAgICAgICAgICAgICAgICAgICAodyAqIDUpIC8gNiArXHJcbiAgICAgICAgICAgICAgICAgICAgJywnICtcclxuICAgICAgICAgICAgICAgICAgICAoaCAqIDIpIC8gMyArXHJcbiAgICAgICAgICAgICAgICAgICAgJyAnICtcclxuICAgICAgICAgICAgICAgICAgICAodyAqIDIpIC8gMyArXHJcbiAgICAgICAgICAgICAgICAgICAgJywnICtcclxuICAgICAgICAgICAgICAgICAgICBoIC8gM1xyXG4gICAgICAgICAgICApXHJcbiAgICAgICAgc2V0QXR0cmlidXRlcyh0MF8sIGNsYXNzaWZpZXIubWl4Q29sb3JzWzBdLCB0ZXh0c1snbTEyJ10pXHJcbiAgICAgICAgLy90cmlhbmdsZSBzMVxyXG4gICAgICAgIGNvbnN0IHQxXyA9IGdcclxuICAgICAgICAgICAgLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgIC5hdHRyKCdwb2ludHMnLCB3IC8gMiArICcsJyArIChoICogMikgLyAzICsgJyAnICsgdyAvIDMgKyAnLCcgKyBoICsgJyAnICsgKHcgKiAyKSAvIDMgKyAnLCcgKyBoKVxyXG4gICAgICAgIHNldEF0dHJpYnV0ZXModDFfLCBjbGFzc2lmaWVyLm1peENvbG9yc1sxXSwgdGV4dHNbJ20wMiddKVxyXG4gICAgICAgIC8vdHJpYW5nbGUgczJcclxuICAgICAgICBjb25zdCB0Ml8gPSBnXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ3BvbHlnb24nKVxyXG4gICAgICAgICAgICAuYXR0cihcclxuICAgICAgICAgICAgICAgICdwb2ludHMnLFxyXG4gICAgICAgICAgICAgICAgdyAvIDIgKyAnLCcgKyAoaCAqIDIpIC8gMyArICcgJyArIHcgLyA2ICsgJywnICsgKGggKiAyKSAvIDMgKyAnICcgKyB3IC8gMyArICcsJyArIGggLyAzXHJcbiAgICAgICAgICAgIClcclxuICAgICAgICBzZXRBdHRyaWJ1dGVzKHQyXywgY2xhc3NpZmllci5taXhDb2xvcnNbMl0sIHRleHRzWydtMDEnXSlcclxuXHJcbiAgICAgICAgLy9jZW50ZXJcclxuICAgICAgICBpZiAodGhpcy5jZW50ZXJDb2VmZmljaWVudCkge1xyXG4gICAgICAgICAgICAvL1RPRE8gbWFrZSBpdCBhbiBoZXhhZ29uICFcclxuICAgICAgICAgICAgY29uc3QgY2VudGVyID0gZ1xyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnY2lyY2xlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjeCcsIHcgLyAyKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2N5JywgKGggKiAyKSAvIDMpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigncicsICh0aGlzLmNlbnRlckNvZWZmaWNpZW50ICogaCkgLyAzKVxyXG4gICAgICAgICAgICBzZXRBdHRyaWJ1dGVzKGNlbnRlciwgY2xhc3NpZmllci5jZW50ZXJDb2xvciwgdGV4dHNbJ2NlbnRlciddKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLypcclxuICAgICAgICBsZXQgbWlkZGxlLCBsZWZ0LCB0b3AsIHJpZ2h0LCBsZWZ0XywgYm90dG9tXywgcmlnaHRfXHJcbiAgICAgICAgaWYgKCF0aGlzLnJlYWwpIHtcclxuXHJcbiAgICAgICAgICAgIC8vMCBsZWZ0IHRyaWFuZ2xlXHJcbiAgICAgICAgICAgIGxlZnQgPSBnLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigncG9pbnRzJywgXCIwLFwiICsgaCArIFwiIFwiICsgKHcgLyAzKSArIFwiLFwiICsgaCArIFwiIFwiICsgKHcgLyA2KSArIFwiLFwiICsgKDIgKiBoIC8gMykpXHJcbiAgICAgICAgICAgIC8vMSB0b3AgdHJpYW5nbGVcclxuICAgICAgICAgICAgdG9wID0gZy5hcHBlbmQoJ3BvbHlnb24nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3BvaW50cycsICh3IC8gMykgKyBcIixcIiArIChoIC8gMykgKyBcIiBcIiArICh3ICogMiAvIDMpICsgXCIsXCIgKyAoaCAvIDMpICsgXCIgXCIgKyAodyAvIDIpICsgXCIsMFwiKVxyXG4gICAgICAgICAgICAvLzIgcmlnaHQgdHJpYW5nbGVcclxuICAgICAgICAgICAgcmlnaHQgPSBnLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigncG9pbnRzJywgKHcgKiAyIC8gMykgKyBcIixcIiArIGggKyBcIiBcIiArIHcgKyBcIixcIiArIGggKyBcIiBcIiArICh3ICogNSAvIDYpICsgXCIsXCIgKyAoMiAqIGggLyAzKSlcclxuICAgICAgICAgICAgLy9taWRkbGUgdHJpYW5nbGVcclxuICAgICAgICAgICAgbWlkZGxlID0gZy5hcHBlbmQoJ3BvbHlnb24nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3BvaW50cycsICh3IC8gMikgKyBcIixcIiArIChoIC8gMykgKyBcIiBcIiArICh3IC8gNCkgKyBcIixcIiArIChoICogNSAvIDYpICsgXCIgXCIgKyAoMyAqIHcgLyA0KSArIFwiLFwiICsgKGggKiA1IC8gNikpXHJcbiAgICAgICAgICAgIC8vMDEgbGVmdCB0cmFwZXppdW1cclxuICAgICAgICAgICAgbGVmdF8gPSBnLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigncG9pbnRzJywgKHcgLyA2KSArIFwiLFwiICsgKGggKiAyIC8gMykgKyBcIiBcIiArICh3IC8gNCkgKyBcIixcIiArIChoICogNSAvIDYpICsgXCIgXCIgKyAodyAvIDIpICsgXCIsXCIgKyAoaCAvIDMpICsgXCIgXCIgKyAodyAvIDMpICsgXCIsXCIgKyAoaCAvIDMpKVxyXG4gICAgICAgICAgICAvLzAyIGJvdHRvbSB0cmFwZXppdW1cclxuICAgICAgICAgICAgYm90dG9tXyA9IGcuYXBwZW5kKCdwb2x5Z29uJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdwb2ludHMnLCAodyAvIDMpICsgXCIsXCIgKyAoaCkgKyBcIiBcIiArICgyICogdyAvIDMpICsgXCIsXCIgKyAoaCkgKyBcIiBcIiArICh3ICogMyAvIDQpICsgXCIsXCIgKyAoaCAqIDUgLyA2KSArIFwiIFwiICsgKHcgLyA0KSArIFwiLFwiICsgKGggKiA1IC8gNikpXHJcbiAgICAgICAgICAgIC8vMTIgcmlnaHQgdHJhcGV6aXVtXHJcbiAgICAgICAgICAgIHJpZ2h0XyA9IGcuYXBwZW5kKCdwb2x5Z29uJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdwb2ludHMnLCAodyAvIDIpICsgXCIsXCIgKyAoaCAvIDMpICsgXCIgXCIgKyAodyAqIDMgLyA0KSArIFwiLFwiICsgKGggKiA1IC8gNikgKyBcIiBcIiArICh3ICogNSAvIDYpICsgXCIsXCIgKyAoaCAqIDIgLyAzKSArIFwiIFwiICsgKHcgKiAyIC8gMykgKyBcIixcIiArIChoIC8gMykpXHJcblxyXG4gICAgICAgIH0gZWxzZSB7XHJcblxyXG4gICAgICAgICAgICAvL21pZGRsZSB0cmlhbmdsZVxyXG4gICAgICAgICAgICBtaWRkbGUgPSBnLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigncG9pbnRzJywgKHcgLyAyKSArIFwiLDAgMCxcIiArIGggKyBcIiBcIiArIHcgKyBcIixcIiArIGgpXHJcblxyXG4gICAgICAgICAgICAvL2RyYXcgdHJhcGV6aXVtXHJcbiAgICAgICAgICAgIC8vZHJhdyBsYXJnZSB0cmFwZXppdW0gZmlyc3RcclxuICAgICAgICAgICAgZm9yIChsZXQgaV8gPSAyOyBpXyA+PSAwOyBpXy0tKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBpID0gdGhpcy5jbGFzc2lmaWVyLmxvd0luZGV4W2lfXVxyXG4gICAgICAgICAgICAgICAgY29uc3QgciA9IHRoaXMuY2xhc3NpZmllci5sb3dUaHJlc2hvbGRbaV1cclxuICAgICAgICAgICAgICAgIGlmIChpID09IDIpXHJcbiAgICAgICAgICAgICAgICAgICAgLy8wMSBsZWZ0IHRyYXBleml1bVxyXG4gICAgICAgICAgICAgICAgICAgIGxlZnRfID0gZy5hcHBlbmQoJ3BvbHlnb24nKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigncG9pbnRzJywgdyAvIDIgKyBcIiwwIDAsXCIgKyBoICsgXCIgXCIgKyB3ICogciArIFwiLFwiICsgaCArIFwiIFwiICsgdyAqICgxICsgcikgLyAyICsgXCIsXCIgKyByICogaClcclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGkgPT0gMSlcclxuICAgICAgICAgICAgICAgICAgICAvLzAyIGJvdHRvbSB0cmFwZXppdW1cclxuICAgICAgICAgICAgICAgICAgICBib3R0b21fID0gZy5hcHBlbmQoJ3BvbHlnb24nKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigncG9pbnRzJywgXCIwLFwiICsgaCArIFwiIFwiICsgdyArIFwiLFwiICsgaCArIFwiIFwiICsgdyAqICgxIC0gciAvIDIpICsgXCIsXCIgKyBoICogKDEgLSByKSArIFwiIFwiICsgciAqIHcgLyAyICsgXCIsXCIgKyBoICogKDEgLSByKSlcclxuICAgICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgICAgICAvLzEyIHJpZ2h0IHRyYXBleml1bVxyXG4gICAgICAgICAgICAgICAgICAgIHJpZ2h0XyA9IGcuYXBwZW5kKCdwb2x5Z29uJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3BvaW50cycsIHcgKyBcIixcIiArIGggKyBcIiBcIiArIHcgLyAyICsgXCIsMCBcIiArIHcgKiAoMSAtIHIpIC8gMiArIFwiLFwiICsgaCAqIHIgKyBcIiBcIiArIHcgKiAoMSAtIHIpICsgXCIsXCIgKyBoKVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvL2RyYXcgdHJpYW5nbGVzXHJcbiAgICAgICAgICAgIC8vZHJhdyBsYXJnZSB0cmlhbmdsZXMgZmlyc3RcclxuICAgICAgICAgICAgZm9yIChsZXQgaV8gPSAyOyBpXyA+PSAwOyBpXy0tKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBpID0gdGhpcy5jbGFzc2lmaWVyLmhpZ2hJbmRleFtpX11cclxuICAgICAgICAgICAgICAgIGNvbnN0IHIgPSB0aGlzLmNsYXNzaWZpZXIuaGlnaFRocmVzaG9sZFtpXVxyXG5cclxuICAgICAgICAgICAgICAgIGlmIChpID09IDIpXHJcbiAgICAgICAgICAgICAgICAgICAgLy8yIHJpZ2h0IHRyaWFuZ2xlXHJcbiAgICAgICAgICAgICAgICAgICAgcmlnaHQgPSBnLmFwcGVuZCgncG9seWdvbicpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdwb2ludHMnLCB3ICsgXCIsXCIgKyBoICsgXCIgXCIgKyB3ICogciArIFwiLFwiICsgaCArIFwiIFwiICsgdyAqICgxICsgcikgLyAyICsgXCIsXCIgKyBoICogcilcclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGkgPT0gMSlcclxuICAgICAgICAgICAgICAgICAgICAvLzEgdG9wIHRyaWFuZ2xlXHJcbiAgICAgICAgICAgICAgICAgICAgdG9wID0gZy5hcHBlbmQoJ3BvbHlnb24nKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigncG9pbnRzJywgKHcgLyAyKSArIFwiLDAgXCIgKyB3ICogciAvIDIgKyBcIixcIiArIGggKiAoMSAtIHIpICsgXCIgXCIgKyB3ICogKDEgLSByIC8gMikgKyBcIixcIiArIGggKiAoMSAtIHIpKVxyXG4gIC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lc29sdXRpb24sIHopXHJcblxyXG4gICAgICAgICAgICAvL2dldCBzeW1ib2wgdHlwZVxyXG4gICAgICAgICAgICBjb25zdCB0eXBlXyA9IHRoaXMudHlwZSA/IHRoaXMudHlwZShjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogJ2ZsYWcnXHJcblxyXG4gICAgICAgICAgICAvL2NvbXB1dGUgY2VudGVyIHBvc2l0aW9uXHJcbiAgICAgICAgICAgIGNvbnN0IHhjID0gY2VsbC54ICsgb2Zmc2V0LmR4ICsgKHR5cGVfID09PSAnYWdlcHlyYW1pZCcgPyAwIDogcmVzb2x1dGlvbiAqIDAuNSlcclxuICAgICAgICAgICAgY29uc3QgeWMgPSBjZWxsLnkgKyBvZmZzZXQuZHkgKyAodHlwZV8gPT09ICdhZ2VweXJhbWlkJyA/IDAgOiByZXNvbHV0aW9uICogMC41KVxyXG5cclxuICAgICAgICAgICAgLy9jb21wdXRlIG9mZnNldCBhbmdsZSwgd2hlbiByZWxldmFudFxyXG4gICAgICAgICAgICBjb25zdCBvZmZBbmcgPSB0aGlzLm9mZnNldEFuZ2xlXHJcbiAgICAgICAgICAgICAgICA/ICh0aGlzLm9mZnNldEFuZ2xlKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgKiBNYXRoLlBJKSAvIDE4MFxyXG4gICAgICAgICAgICAgICAgOiAwXHJcblxyXG4gICAgICAgICAgICBpZiAodHlwZV8gPT09ICdhZ2VweXJhbWlkJyB8fCB0eXBlXyA9PT0gJ3JhZGFyJyB8fCB0eXBlXyA9PT0gJ2hhbGZ0b25lJykge1xyXG4gICAgICAgICAgICAgICAgLy9nZXQgY2VsbCBjYXRlZ29yeSBtYXggdmFsdWVcclxuICAgICAgICAgICAgICAgIGxldCBtYXhWYWwgPSAtSW5maW5pdHlcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IGtleSBvZiBPYmplY3Qua2V5cyh0aGlzLmNvbG9yKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHYgPSArY2VsbFtrZXldXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHYgPiBtYXhWYWwpIG1heFZhbCA9IHZcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAvL2N1bXVsXHJcbiAgICAgICAgICAgICAgICBsZXQgY3VtdWwgPSAwXHJcbiAgICAgICAgICAgICAgICBpZiAodHlwZV8gPT09ICdhZ2VweXJhbWlkJyAmJiB0aGlzLmFnZVB5cmFtaWRIZWlnaHQpXHJcbiAgICAgICAgICAgICAgICAgICAgY3VtdWwgPSAocmVzb2x1dGlvbiAtIHRoaXMuYWdlUHlyYW1pZEhlaWdodChjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpKSAvIDJcclxuICAgICAgICAgICAgICAgIGlmICh0eXBlXyA9PT0gJ3JhZGFyJyB8fCB0eXBlXyA9PT0gJ2hhbGZ0b25lJykgY3VtdWwgPSBNYXRoLlBJIC8gMiArIG9mZkFuZ1xyXG5cclxuICAgICAgICAgICAgICAgIC8vY29tcHV0ZSB0aGUgaW5jcmVtZW50LCB3aGljaCBpcyB0aGUgdmFsdWUgdG8gaW5jcmVtZW50IHRoZSBjdW11bCBmb3IgZWFjaCBjYXRlZ29yeVxyXG4gICAgICAgICAgICAgICAgY29uc3QgaW5jciA9XHJcbiAgICAgICAgICAgICAgICAgICAgdHlwZV8gPT09ICdhZ2VweXJhbWlkJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICh0aGlzLmFnZVB5cmFtaWRIZWlnaHRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0aGlzLmFnZVB5cmFtaWRIZWlnaHQoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHJlc29sdXRpb24pIC8gbmJDYXRcclxuICAgICAgICAgICAgICAgICAgICAgICAgOiB0eXBlXyA9PT0gJ3JhZGFyJyB8fCB0eXBlXyA9PT0gJ2hhbGZ0b25lJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICgyICogTWF0aC5QSSkgLyBuYkNhdFxyXG4gICAgICAgICAgICAgICAgICAgICAgICA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICAgICAgaWYgKGluY3IgPT09IHVuZGVmaW5lZCkgdGhyb3cgbmV3IEVycm9yKCdVbmV4cGVjdGVkIHN5bWJvbCB0eXBlOicgKyB0eXBlXylcclxuXHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBbY29sdW1uLCBjb2xvcl0gb2YgT2JqZWN0LmVudHJpZXModGhpcy5jb2xvcikpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZV8gPT09ICdhZ2VweXJhbWlkJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3NldCBjYXRlZ29yeSBjb2xvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gY29sb3JcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZ2V0IGNhdGVnb3J5IHZhbHVlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9IGNlbGxbY29sdW1uXVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9jb21wdXRlIGNhdGVnb3J5IGxlbmd0aCAtIGluIGdlb1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvKiogQHR5cGUge251bWJlcn0gKi9cclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgd0cgPSAoc0cgKiB2YWwpIC8gbWF4VmFsXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2RyYXcgYmFyXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsUmVjdCh4YyArIChyZXNvbHV0aW9uIC0gd0cpIC8gMiwgeWMgKyBjdW11bCwgd0csIGluY3IpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL25leHQgaGVpZ2h0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1bXVsICs9IGluY3JcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVfID09PSAncmFkYXInKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vc2V0IGNhdGVnb3J5IGNvbG9yXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsU3R5bGUgPSBjb2xvclxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9nZXQgY2F0ZWdyb3kgdmFsdWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsID0gY2VsbFtjb2x1bW5dXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2NvbXB1dGUgY2F0ZWdvcnkgcmFkaXVzIC0gaW4gZ2VvXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfSAqL1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnN0IHJHID0gdGhpcy5yYWRpdXModmFsLCByLCBzdGF0LCBjZWxsU3RhdCwgeilcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgckcgPSAoc0cgLyAyKSAqIE1hdGguc3FydCh2YWwgLyBtYXhWYWwpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2RyYXcgYW5ndWxhciBzZWN0b3JcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oeGMsIHljKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdHguYXJjKHhjLCB5YywgckcsIGN1bXVsIC0gaW5jciwgY3VtdWwpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oeGMsIHljKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdHguZmlsbCgpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL25leHQgYW5ndWxhciBzZWN0b3JcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3VtdWwgKz0gaW5jclxyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZV8gPT09ICdoYWxmdG9uZScpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9zZXQgY2F0ZWdvcnkgY29sb3JcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IGNvbG9yXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2dldCBjYXRlZ3JveSB2YWx1ZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2YWwgPSBjZWxsW2NvbHVtbl1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vY29tcHV0ZSBjYXRlZ29yeSByYWRpdXMgLSBpbiBnZW9cclxuICAgICAgICAgICAgICAgICAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ9ICovXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHJHID0gc0cgKiAwLjMzMyAqIE1hdGguc3FydCh2YWwgLyBtYXhWYWwpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2RyYXcgY2lyY2xlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdHguYXJjKFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeGMgKyByZXNvbHV0aW9uICogMC4yNSAqIE1hdGguY29zKGN1bXVsKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHljICsgcmVzb2x1dGlvbiAqIDAuMjUgKiBNYXRoLnNpbihjdW11bCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByRyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICogTWF0aC5QSVxyXG4gICAgICAgICAgICAgICAgICAgICAgICApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbmV4dCBhbmd1bGFyIHNlY3RvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdW11bCArPSBpbmNyXHJcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdVbmV4cGVjdGVkIHN5bWJvbCB0eXBlOicgKyB0eXBlXylcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvL2NvbXB1dGUgdG90YWxcclxuICAgICAgICAgICAgICAgIGxldCB0b3RhbCA9IDBcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IGNvbHVtbiBvZiBPYmplY3Qua2V5cyh0aGlzLmNvbG9yKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHYgPSArY2VsbFtjb2x1bW5dXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF2KSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgICAgIHRvdGFsICs9IHZcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICghdG90YWwgfHwgaXNOYU4odG90YWwpKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgICAgIC8vZHJhdyBkZWNvbXBvc2l0aW9uIHN5bWJvbFxyXG4gICAgICAgICAgICAgICAgbGV0IGN1bXVsID0gMFxyXG4gICAgICAgICAgICAgICAgY29uc3QgZCA9IHJlc29sdXRpb24gKiAoMSAtIHNHIC8gcmVzb2x1dGlvbikgKiAwLjVcclxuICAgICAgICAgICAgICAgIGNvbnN0IG9yaSA9IHRoaXMuc3RyaXBlc09yaWVudGF0aW9uKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSlcclxuXHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBbY29sdW1uLCBjb2xvcl0gb2YgT2JqZWN0LmVudHJpZXModGhpcy5jb2xvcikpIHtcclxuICAgICAgICAgICAgICAgICAgICAvL2dldCBzaGFyZVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHNoYXJlID0gY2VsbFtjb2x1bW5dIC8gdG90YWxcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXNoYXJlIHx8IGlzTmFOKHNoYXJlKSkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLy9zZXQgY29sb3JcclxuICAgICAgICAgICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gY29sb3JcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLy9kcmF3IHN5bWJvbCBwYXJ0XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVfID09PSAnZmxhZycpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9kcmF3IGZsYWcgc3RyaXBlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcmkgPT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9ob3Jpem9udGFsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdHguZmlsbFJlY3QoXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VsbC54ICsgZCArIG9mZnNldC5keCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZWxsLnkgKyBkICsgY3VtdWwgKiBzRyArIG9mZnNldC5keSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFyZSAqIHNHXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ZlcnRpY2FsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdHguZmlsbFJlY3QoXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VsbC54ICsgZCArIGN1bXVsICogc0cgKyBvZmZzZXQuZHgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VsbC55ICsgZCArIG9mZnNldC5keSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFyZSAqIHNHLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNHXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVfID09PSAncGllY2hhcnQnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZHJhdyBwaWUgY2hhcnQgYW5ndWxhciBzZWN0b3JcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vY29tcHV0ZSBhbmdsZXNcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYTEgPSBjdW11bCAqIDIgKiBNYXRoLlBJXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGEyID0gKGN1bXVsICsgc2hhcmUpICogMiAqIE1hdGguUElcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZHJhd1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyh4YywgeWMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5hcmMoeGMsIHljLCBzRyAqIDAuNSwgYTEgKyBvZmZBbmcsIGEyICsgb2ZmQW5nKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5waWVDaGFydEludGVybmFsUmFkaXVzRmFjdG9yKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmFyYyhcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4YyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5YyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRyAqIDAuNSAqIHRoaXMucGllQ2hhcnRJbnRlcm5hbFJhZGl1c0ZhY3RvcixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhMSArIG9mZkFuZyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhMiArIG9mZkFuZyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnVlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5jbG9zZVBhdGgoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdHguZmlsbCgpXHJcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlXyA9PT0gJ3JpbmcnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZHJhdyByaW5nXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdHguYXJjKHhjLCB5YywgTWF0aC5zcXJ0KDEgLSBjdW11bCkgKiBzRyAqIDAuNSwgMCwgMiAqIE1hdGguUEkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVfID09PSAnc2VnbWVudCcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9kcmF3IHNlZ21lbnQgc2VjdGlvbnNcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgd0cgPSAoc0cgKiBzRykgLyByZXNvbHV0aW9uXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcmkgPT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9ob3Jpem9udGFsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdHguZmlsbFJlY3QoXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VsbC54ICsgb2Zmc2V0LmR4LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbGwueSArIChyZXNvbHV0aW9uIC0gd0cpIC8gMiArIGN1bXVsICogd0cgKyBvZmZzZXQuZHksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x1dGlvbixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFyZSAqIHdHXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ZlcnRpY2FsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdHguZmlsbFJlY3QoXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VsbC54ICsgY3VtdWwgKiByZXNvbHV0aW9uICsgb2Zmc2V0LmR4LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbGwueSArIChyZXNvbHV0aW9uIC0gd0cpIC8gMiArIG9mZnNldC5keSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFyZSAqIHJlc29sdXRpb24sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd0dcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5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gc2l6ZVxyXG4gICAgICAgIGNvbnN0IHNHZW8gPSB0aGlzLmRvdFNpemUgPyB0aGlzLmRvdFNpemUocmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IHpcclxuXHJcbiAgICAgICAgLy9tYWtlIHJhbmRvbSBmdW5jdGlvblxyXG4gICAgICAgIGNvbnN0IHNpZyA9IHRoaXMuc2lnbWEgPyB0aGlzLnNpZ21hKHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiByZXNvbHV0aW9uICogMC40XHJcbiAgICAgICAgY29uc3QgcmFuZCA9IHJhbmRvbU5vcm1hbCgwLCBzaWcpXHJcblxyXG4gICAgICAgIGNvbnN0IGN0eCA9IGdlb0NhbnZhcy5vZmZzY3JlZW5DdHhcclxuXHJcbiAgICAgICAgaWYgKGNoZWNrV2ViR0xTdXBwb3J0KCkpIHtcclxuICAgICAgICAgICAgLy9jcmVhdGUgY2FudmFzIGFuZCB3ZWJnbCByZW5kZXJlclxyXG4gICAgICAgICAgICBjb25zdCBjdldHTCA9IG1ha2VXZWJHTENhbnZhcyhnZW9DYW52YXMudyArICcnLCBnZW9DYW52YXMuaCArICcnKVxyXG4gICAgICAgICAgICBpZiAoIWN2V0dMKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKCdObyB3ZWJHTCcpXHJcbiAgICAgICAgICAgICAgICByZXR1cm5cclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy9jcmVhdGUgd2ViR0wgcHJvZ3JhbVxyXG4gICAgICAgICAgICBjb25zdCBwcm9nID0gbmV3IFdlYkdMU3F1YXJlQ29sb3JpbmcoY3ZXR0wuZ2wsIHNHZW8gLyB6KVxyXG5cclxuICAgICAgICAgICAgY29uc3QgcjIgPSByZXNvbHV0aW9uIC8gMlxyXG5cclxuICAgICAgICAgICAgZm9yIChsZXQgY2VsbCBvZiBjZWxscykge1xyXG4gICAgICAgICAgICAgICAgLy9nZXQgY29sb3JcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNvbCA9IHRoaXMuY29sb3IoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKVxyXG4gICAgICAgICAgICAgICAgaWYgKCFjb2wgfHwgY29sID09PSAnbm9uZScpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAgICAgLy9udW1iZXIgb2YgZG90c1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZG90TnVtYmVyID0gdGhpcy5kb3ROdW1iZXIoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKVxyXG5cclxuICAgICAgICAgICAgICAgIC8vZ2V0IG9mZnNldFxyXG4gICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2V0ID0gdGhpcy5vZmZzZXQoY2VsbCwgcmVzb2x1dGlvbiwgeilcclxuXHJcbiAgICAgICAgICAgICAgICAvL2NlbGwgY2VudGVyXHJcbiAgICAgICAgICAgICAgICBjb25zdCBjeCA9IGNlbGwueCArIG9mZnNldC5keCArIHIyXHJcbiAgICAgICAgICAgICAgICBjb25zdCBjeSA9IGNlbGwueSArIG9mZnNldC5keSArIHIyXHJcblxyXG4gICAgICAgICAgICAgICAgLy9jb252ZXJ0IGNvbG9yXHJcbiAgICAgICAgICAgICAgICBjb25zdCBjYyA9IGNvbG9yKGNvbClcclxuICAgICAgICAgICAgICAgIGlmICghY2MpIHJldHVyblxyXG5cclxuICAgICAgICAgICAgICAgIC8vcmFuZG9tIHBvaW50c1xyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPD0gZG90TnVtYmVyOyBpKyspXHJcbiAgICAgICAgICAgICAgICAgICAgcHJvZy5hZGRQb2ludERhdGEyKGN4ICsgcmFuZCgpLCBjeSArIHJhbmQoKSwgY2MuciwgY2MuZywgY2MuYiwgY2Mub3BhY2l0eSlcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy9kcmF3XHJcbiAgICAgICAgICAgIHByb2cuZHJhdyhnZW9DYW52YXMuZ2V0V2ViR0xUcmFuc2Zvcm0oKSlcclxuXHJcbiAgICAgICAgICAgIC8vZHJhdyBpbiBjYW52YXMgZ2VvXHJcbiAgICAgICAgICAgIGdlb0NhbnZhcy5pbml0Q2FudmFzVHJhbnNmb3JtKClcclxuICAgICAgICAgICAgY3R4LmRyYXdJbWFnZShjdldHTC5jYW52YXMsIDAsIDApXHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgY2VsbCBvZiBjZWxscykge1xyXG4gICAgICAgICAgICAgICAgLy9nZXQgY29sb3JcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNvbCA9IHRoaXMuY29sb3IoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKVxyXG4gICAgICAgICAgICAgICAgaWYgKCFjb2wgfHwgY29sID09PSAnbm9uZScpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICAvL3NldCBjb2xvclxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IGNvbFxyXG5cclxuICAgICAgICAgICAgICAgIC8vbnVtYmVyIG9mIGRvdHNcclxuICAgICAgICAgICAgICAgIGNvbnN0IGRvdE51bWJlciA9IHRoaXMuZG90TnVtYmVyKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSlcclxuXHJcbiAgICAgICAgICAgICAgICAvL2dldCBvZmZzZXRcclxuICAgICAgICAgICAgICAgIGNvbnN0IG9mZnNldCA9IHRoaXMub2Zmc2V0KGNlbGwsIHJlc29sdXRpb24sIHopXHJcblxyXG4gICAgICAgICAgICAgICAgLy9kcmF3IHJhbmRvbSBkb3RzXHJcbiAgICAgICAgICAgICAgICBjb25zdCBjeCA9IGNlbGwueCArIG9mZnNldC5keCArIHJlc29sdXRpb24gLyAyLFxyXG4gICAgICAgICAgICAgICAgICAgIGN5ID0gY2VsbC55ICsgb2Zmc2V0LmR5ICsgcmVzb2x1dGlvbiAvIDJ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ICAgIGNvbnN0IHZpZXdTY2FsZSA9IHRoaXMudmlld1NjYWxlID8gdGhpcy52aWV3U2NhbGUoY2VsbHMsIHJlc29sdXRpb24sIHopIDogdW5kZWZpbmVkXHJcblxyXG4gICAgICAgIC8vZHJhdyBpbiBzY3JlZW4gY29vcmRpbmF0ZXNcclxuICAgICAgICBnZW9DYW52YXMuaW5pdENhbnZhc1RyYW5zZm9ybSgpXHJcblxyXG4gICAgICAgIC8vXHJcbiAgICAgICAgZm9yIChsZXQgY2VsbCBvZiBjZWxscykge1xyXG4gICAgICAgICAgICAvL2dldCBjZWxsIGltYWdlIHVybFxyXG4gICAgICAgICAgICBjb25zdCB1cmwgPSB0aGlzLmltYWdlKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSlcclxuICAgICAgICAgICAgaWYgKCF1cmwpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL3NpemUgYW5kIHBvc2l0aW9uIHZhbHVlc1xyXG4gICAgICAgICAgICBsZXQgc2l6ZVBpeCA9IHRoaXMuc2l6ZShjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIC8gelxyXG4gICAgICAgICAgICBpZiAoIXNpemVQaXgpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL2dldCBpbWFnZSBmcm9tIGNhY2hlXHJcbiAgICAgICAgICAgIGNvbnN0IGltYWdlID0gdGhpcy5jYWNoZVt1cmxdXHJcblxyXG4gICAgICAgICAgICAvL2xvYWRpbmcsIGtlZXAgd2FpdGluZ1xyXG4gICAgICAgICAgICBpZiAoaW1hZ2UgPT0gJ2xvYWRpbmcnKSByZXR1cm5cclxuICAgICAgICAgICAgLy9ubyBpbWFnZTogbG9hZCBpdFxyXG4gICAgICAgICAgICBlbHNlIGlmICghaW1hZ2UpIHtcclxuICAgICAgICAgICAgICAgIC8vdGFnIGFzIGxvYWRpbmdcclxuICAgICAgICAgICAgICAgIHRoaXMuY2FjaGVbdXJsXSA9ICdsb2FkaW5nJ1xyXG5cclxuICAgICAgICAgICAgICAgIC8vZGVmaW5lIGltYWdlXHJcbiAgICAgICAgICAgICAgICBjb25zdCBpbWcgPSBuZXcgSW1hZ2UoKVxyXG4gICAgICAgICAgICAgICAgaW1nLm9ubG9hZCA9ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAvL3N0b3JlIGltYWdlIGRhdGEgaW4gY2FjaGUgYW5kIHJlZHJhd1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY2FjaGVbdXJsXSA9IGltZ1xyXG4gICAgICAgICAgICAgICAgICAgIGdlb0NhbnZhcy5yZWRyYXcoKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaW1nLm9uZXJyb3IgPSAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9jYXNlIHdoZW4gbm8gaW1hZ2VcclxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ0NvdWxkIG5vdCByZXRyaWV2ZSBpbWFnZSBmcm9tJywgdXJsKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy9zZXQgVVJMIHRvIGxhdW5jaCB0aGUgZG93bmxvYWRcclxuICAgICAgICAgICAgICAgIGltZy5zcmMgPSB1cmxcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vZHJhdyBpbWFnZVxyXG4gICAgICAgICAgICAgICAgY29uc3QgZCA9IChyZXNvbHV0aW9uUGl4IC0gc2l6ZVBpeCkgLyAyXHJcbiAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgIGdlb0NhbnZhcy5vZmZzY3JlZW5DdHguZHJhd0ltYWdlKFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWFnZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZ2VvQ2FudmFzLmdlb1RvUGl4WChjZWxsLngpICsgZCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZ2VvQ2FudmFzLmdlb1RvUGl4WShjZWxsLnkpICsgZCAtIHJlc29sdXRpb25QaXgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNpemVQaXgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNpemVQaXhcclxuICAgICAgICAgICAgICAgICAgICApXHJcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnJvcikge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyb3IpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vdXBkYXRlIGxlZ2VuZHNcclxuICAgICAgICB0aGlzLnVwZGF0ZUxlZ2VuZHMoeyBzdHlsZTogdGhpcywgcmVzb2x1dGlvbjogcmVzb2x1dGlvbiwgejogeiwgdmlld1NjYWxlOiB2aWV3U2NhbGUgfSlcclxuICAgIH1cclxufVxyXG4iLCIvL0B0cy1jaGVja1xyXG4ndXNlIHN0cmljdCdcclxuXHJcbmltcG9ydCB7IFN0eWxlIH0gZnJvbSAnLi4vY29yZS9TdHlsZS5qcydcclxuaW1wb3J0IHsgU2lkZVN0eWxlIH0gZnJvbSAnLi9TaWRlU3R5bGUuanMnXHJcblxyXG4vKiogQHR5cGVkZWYge3t4Om51bWJlcix5Om51bWJlcixvcjpcInZcInxcImhcIixjMTppbXBvcnQoJy4uL2NvcmUvRGF0YXNldC5qcycpLkNlbGx8dW5kZWZpbmVkLGMyOmltcG9ydCgnLi4vY29yZS9EYXRhc2V0LmpzJykuQ2VsbHx1bmRlZmluZWR9fSBTaWRlICovXHJcblxyXG4vKipcclxuICogQG1vZHVsZSBzdHlsZVxyXG4gKiBAYXV0aG9yIEp1bGllbiBHYWZmdXJpXHJcbiAqL1xyXG5leHBvcnQgY2xhc3MgSXNvRmVuY2VTdHlsZSBleHRlbmRzIFN0eWxlIHtcclxuICAgIC8qKiBAcG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CwgcmVzb2x1dGlvbiwgeiksXHJcbiAgICAgICAgICAgIGR4ID0gb2Zmc2V0LmR4LFxyXG4gICAgICAgICAgICBkeSA9IG9mZnNldC5keVxyXG5cclxuICAgICAgICAvL21ha2Ugc2lkZXNcclxuICAgICAgICAvKiogIEB0eXBlIHtBcnJheS48U2lkZT59ICovXHJcbiAgICAgICAgY29uc3Qgc2lkZXMgPSBTaWRlU3R5bGUuYnVpbGRTaWRlcyhcclxuICAgICAgICAgICAgY2VsbHMsXHJcbiAgICAgICAgICAgIHJlc29sdXRpb24sXHJcbiAgICAgICAgICAgIHRoaXMuYW5nbGUgJSAxODAgIT0gOTAgJiYgdGhpcy5zVmVydCxcclxuICAgICAgICAgICAgdGhpcy5hbmdsZSAlIDE4MCAhPSAwICYmIHRoaXMuc0hvclxyXG4gICAgICAgIClcclxuXHJcbiAgICAgICAgLy9cclxuICAgICAgICBpZiAoc2lkZXMubGVuZ3RoID09IDApIHJldHVyblxyXG5cclxuICAgICAgICAvL2FuZ2xlIGluIHJhZGlhbnNcclxuICAgICAgICBjb25zdCBhUmFkID0gKHRoaXMuYW5nbGUgKiBNYXRoLlBJKSAvIDE4MCxcclxuICAgICAgICAgICAgY29zID0gTWF0aC5jb3MoYVJhZCksXHJcbiAgICAgICAgICAgIHNpbiA9IE1hdGguc2luKGFSYWQpXHJcblxyXG4gICAgICAgIC8vc29ydCBzaWRlcyBzbyB0aGF0IHRoZSBiYWNrIG9uZXMgYXJlIGRyYXduIGZpcnN0LiBUaGlzIGRlcGVuZHMgb24gdGhlIGFuZ2xlLlxyXG4gICAgICAgIC8vZGVwZW5kaW5nIG9uIGRpc3RhbmNlIHRvIHRoZSByZWZlcmVuY2UgY29ybmVyIHBvaW50XHJcbiAgICAgICAgY29uc3QgeENvcm5lciA9IE1hdGguYWJzKHRoaXMuYW5nbGUpIDwgOTAgPyBnZW9DYW52YXMuZXh0R2VvLnhNaW4gOiBnZW9DYW52YXMuZXh0R2VvLnhNYXhcclxuICAgICAgICBjb25zdCB5Q29ybmVyID0gdGhpcy5hbmdsZSA8IDAgPyBnZW9DYW52YXMuZXh0R2VvLnlNYXggOiBnZW9DYW52YXMuZXh0R2VvLnlNaW5cclxuICAgICAgICBzaWRlcy5zb3J0KFxyXG4gICAgICAgICAgICAoczEsIHMyKSA9PlxyXG4gICAgICAgICAgICAgICAgTWF0aC5oeXBvdChzMi54IC0geENvcm5lciwgczIueSAtIHlDb3JuZXIpIC0gTWF0aC5oeXBvdChzMS54IC0geENvcm5lciwgczEueSAtIHlDb3JuZXIpXHJcbiAgICAgICAgKVxyXG5cclxuICAgICAgICAvL3ByZXBhcmUgZnVuY3Rpb24gdG8gZHJhdyBjb3JuZXIgbGluZSBmb3IgYSBjZWxsICpjKlxyXG4gICAgICAgIGNvbnN0IGRyYXdDb3JuZXJMaW5lID0gKGNlbGwpID0+IHtcclxuICAgICAgICAgICAgaWYgKCFjZWxsKSByZXR1cm5cclxuICAgICAgICAgICAgLy9saW5lIHN0eWxlXHJcbiAgICAgICAgICAgIGNvbnN0IGx3ID0gdGhpcy5jb3JuZXJMaW5lV2lkdGggPyB0aGlzLmNvcm5lckxpbmVXaWR0aChjZWxsLCByZXNvbHV0aW9uLCB6LCB0aGlzLmFuZ2xlKSA6IDAuOCAqIHpcclxuICAgICAgICAgICAgaWYgKGx3ID09IDApIHJldHVyblxyXG4gICAgICAgICAgICBjdHguc3Ryb2tlU3R5bGUgPSB0aGlzLmNvcm5lckxpbmVTdHJva2VDb2xvclxyXG4gICAgICAgICAgICAgICAgPyB0aGlzLmNvcm5lckxpbmVTdHJva2VDb2xvcihjZWxsLCByZXNvbHV0aW9uLCB6LCB0aGlzLmFuZ2xlKVxyXG4gICAgICAgICAgICAgICAgOiAnIzMzMydcclxuICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IGx3XHJcblxyXG4gICAgICAgICAgICAvL2hlaWdodCAtIGluIGdlb1xyXG4gICAgICAgICAgICBjb25zdCBoRyA9IHRoaXMuaGVpZ2h0KGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSlcclxuXHJcbiAgICAgICAgICAgIC8vZHJhdyBsaW5lXHJcbiAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICBjdHgubW92ZVRvKGNlbGwueCArIHIyICsgZHgsIGNlbGwueSArIHIyICsgZHkpXHJcbiAgICAgICAgICAgIGN0eC5saW5lVG8oY2VsbC54ICsgcjIgKyBoRyAqIGNvcyArIGR4LCBjZWxsLnkgKyByMiArIGhHICogc2luICsgZHkpXHJcbiAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9kcmF3IHNpZGVzXHJcbiAgICAgICAgY3R4LmxpbmVDYXAgPSAncm91bmQnXHJcbiAgICAgICAgZm9yIChsZXQgc2lkZSBvZiBzaWRlcykge1xyXG4gICAgICAgICAgICBjb25zdCBjMSA9IHNpZGUuYzEsXHJcbiAgICAgICAgICAgICAgICBjMiA9IHNpZGUuYzIsXHJcbiAgICAgICAgICAgICAgICB4ID0gc2lkZS54LFxyXG4gICAgICAgICAgICAgICAgeSA9IHNpZGUueVxyXG5cclxuICAgICAgICAgICAgLy9oZWlnaHRzIC0gaW4gZ2VvXHJcbiAgICAgICAgICAgIGNvbnN0IGhHMSA9IGMxID8gdGhpcy5oZWlnaHQoYzEsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiAwLFxyXG4gICAgICAgICAgICAgICAgaEcyID0gYzIgPyB0aGlzLmhlaWdodChjMiwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IDBcclxuXHJcbiAgICAgICAgICAgIC8vY29tcHV0ZSB0b3RhbHMgZm9yIGJvdGggY2VsbHNcclxuICAgICAgICAgICAgY29uc3QgdG90YWwxID0gY29tcHV0ZVRvdGFsKGMxLCBjYXRzKSxcclxuICAgICAgICAgICAgICAgIHRvdGFsMiA9IGNvbXB1dGVUb3RhbChjMiwgY2F0cylcclxuICAgICAgICAgICAgaWYgKHRvdGFsMSA9PSAwICYmIHRvdGFsMiA9PSAwKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgbGV0IGN1bXVsMSA9IDAsXHJcbiAgICAgICAgICAgICAgICBjdW11bDIgPSAwXHJcbiAgICAgICAgICAgIGZvciAobGV0IFtjb2x1bW4sIGNvbG9yXSBvZiBPYmplY3QuZW50cmllcyh0aGlzLmNvbG9yKSkge1xyXG4gICAgICAgICAgICAgICAgLy9kcmF3IHN0cmlwZSBvZiBzaWRlIHMgYW5kIGNhdGVnb3J5IGNvbHVtblxyXG5cclxuICAgICAgICAgICAgICAgIC8vZ2V0IHZhbHVlcyBmb3IgYm90aCBjZWxsc1xyXG4gICAgICAgICAgICAgICAgbGV0IHYxID0gYzEgPyArYzFbY29sdW1uXSA6IDBcclxuICAgICAgICAgICAgICAgIGxldCB2MiA9IGMyID8gK2MyW2NvbHVtbl0gOiAwXHJcbiAgICAgICAgICAgICAgICBpZiAodjEgPT0gMCAmJiB2MiA9PSAwKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgICAgIC8vY29tcHV0ZSBoZWlnaHRzXHJcbiAgICAgICAgICAgICAgICBjb25zdCBoMSA9IChoRzEgKiBjdW11bDEpIC8gdG90YWwxIHx8IDBcclxuICAgICAgICAgICAgICAgIGNvbnN0IGgxbiA9IChoRzEgKiAoY3VtdWwxICsgdjEpKSAvIHRvdGFsMSB8fCAwXHJcbiAgICAgICAgICAgICAgICBjb25zdCBoMiA9IChoRzIgKiBjdW11bDIpIC8gdG90YWwyIHx8IDBcclxuICAgICAgICAgICAgICAgIGNvbnN0IGgybiA9IChoRzIgKiAoY3VtdWwyICsgdjIpKSAvIHRvdGFsMiB8fCAwXHJcblxyXG4gICAgICAgICAgICAgICAgLy9tYWtlIHBhdGhcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgaWYgKHNpZGUub3IgPT0gJ2gnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9ob3Jpem9udGFsIHNpZGUgLSB2ZXJ0aWNhbCBzZWN0aW9uXHJcbiAgICAgICAgICAgICAgICAgICAgLy9ib3R0b20gbGVmdFxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oeCArIGgxICogY29zICsgZHgsIHkgLSByMiArIGgxICogc2luICsgZHkpXHJcbiAgICAgICAgICAgICAgICAgICAgLy90b3AgbGVmdFxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oeCArIGgyICogY29zICsgZHgsIHkgKyByMiArIGgyICogc2luICsgZHkpXHJcbiAgICAgICAgICAgICAgICAgICAgLy90b3AgcmlnaHRcclxuICAgICAgICAgICAgICAgICAgICBjdHgubGluZVRvKHggKyBoMm4gKiBjb3MgKyBkeCwgeSArIHIyICsgaDJuICogc2luICsgZHkpXHJcbiAgICAgICAgICAgICAgICAgICAgLy9ib3R0b20gcmlnaHRcclxuICAgICAgICAgICAgICAgICAgICBjdHgubGluZVRvKHggKyBoMW4gKiBjb3MgKyBkeCwgeSAtIHIyICsgaDFuICogc2luICsgZHkpXHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vdmVydGljYWwgc2lkZSAtIGhvcml6b250YWwgc2VjdGlvblxyXG4gICAgICAgICAgICAgICAgICAgIC8vYm90dG9tIGxlZnRcclxuICAgICAgICAgICAgICAgICAgICBjdHgubW92ZVRvKHggLSByMiArIGgxICogY29zICsgZHgsIHkgKyBoMSAqIHNpbiArIGR5KVxyXG4gICAgICAgICAgICAgICAgICAgIC8vYm90dG9tIHJpZ2h0XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmxpbmVUbyh4ICsgcjIgKyBoMiAqIGNvcyArIGR4LCB5ICsgaDIgKiBzaW4gKyBkeSlcclxuICAgICAgICAgICAgICAgICAgICAvL3RvcCByaWdodFxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oeCArIHIyICsgaDJuICogY29zICsgZHgsIHkgKyBoMm4gKiBzaW4gKyBkeSlcclxuICAgICAgICAgICAgICAgICAgICAvL3RvcCBsZWZ0XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmxpbmVUbyh4IC0gcjIgKyBoMW4gKiBjb3MgKyBkeCwgeSArIGgxbiAqIHNpbiArIGR5KVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy9jZy5jdHguY2xvc2VQYXRoKClcclxuXHJcbiAgICAgICAgICAgICAgICAvL2ZpbGxcclxuICAgICAgICAgICAgICAgIGN0eC5maWxsU3R5bGUgPSBjb2xvclxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGwoKVxyXG5cclxuICAgICAgICAgICAgICAgIGN1bXVsMSArPSB2MVxyXG4gICAgICAgICAgICAgICAgY3VtdWwyICs9IHYyXHJcblxyXG4gICAgICAgICAgICAgICAgLy9UT0RPIGRyYXcgb25seSBvbmUgbGluZVxyXG4gICAgICAgICAgICAgICAgLy9kcmF3IGNvcm5lciBsaW5lXHJcbiAgICAgICAgICAgICAgICAvL2lmIChzaWRlLm9yID09IFwiaFwiKSB7XHJcbiAgICAgICAgICAgICAgICBkcmF3Q29ybmVyTGluZShjMSlcclxuICAgICAgICAgICAgICAgIGRyYXdDb3JuZXJMaW5lKGMyKVxyXG4gICAgICAgICAgICAgICAgLy9pZiAodGhpcy5hbmdsZSA+IDAgJiYgc2lkZS5vciA9PSBcImhcIikgZHJhd0Nvcm5lckxpbmUoYzIpXHJcbiAgICAgICAgICAgICAgICAvL2Vsc2UgZHJhd0Nvcm5lckxpbmUoYzIpXHJcbiAgICAgICAgICAgICAgICAvL31cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy91cGRhdGUgbGVnZW5kc1xyXG4gICAgICAgIHRoaXMudXBkYXRlTGVnZW5kcyh7IHN0eWxlOiB0aGlzLCByZXN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gICAqL1xyXG4gICAgZHJhdyhjZWxscywgZ2VvQ2FudmFzLCByZXNvbHV0aW9uKSB7XHJcbiAgICAgICAgLy9maWx0ZXJcclxuICAgICAgICBpZiAodGhpcy5maWx0ZXIpIGNlbGxzID0gY2VsbHMuZmlsdGVyKHRoaXMuZmlsdGVyKVxyXG5cclxuICAgICAgICAvL1xyXG4gICAgICAgIGNvbnN0IHogPSBnZW9DYW52YXMudmlldy56XHJcbiAgICAgICAgY29uc3QgY3R4ID0gZ2VvQ2FudmFzLm9mZnNjcmVlbkN0eFxyXG5cclxuICAgICAgICAvL2dldCB2aWV3IHNjYWxlXHJcbiAgICAgICAgY29uc3Qgdmlld1NjYWxlID0gdGhpcy52aWV3U2NhbGUgPyB0aGlzLnZpZXdTY2FsZShjZWxscywgcmVzb2x1dGlvbiwgeikgOiB1bmRlZmluZWRcclxuXHJcbiAgICAgICAgLy9pbmRleCBjZWxscyBieSB5IGFuZCB4XHJcbiAgICAgICAgLyoqICBAdHlwZSB7b2JqZWN0fSAqL1xyXG4gICAgICAgIGNvbnN0IGluZCA9IHt9XHJcbiAgICAgICAgZm9yIChjb25zdCBjZWxsIG9mIGNlbGxzKSB7XHJcbiAgICAgICAgICAgIGxldCByb3cgPSBpbmRbY2VsbC55XVxyXG4gICAgICAgICAgICBpZiAoIXJvdykge1xyXG4gICAgICAgICAgICAgICAgcm93ID0ge31cclxuICAgICAgICAgICAgICAgIGluZFtjZWxsLnldID0gcm93XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcm93W2NlbGwueF0gPSB0aGlzLmhlaWdodChjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2NvbXB1dGUgZXh0ZW50XHJcbiAgICAgICAgY29uc3QgZSA9IGdlb0NhbnZhcy5leHRHZW9cclxuICAgICAgICBpZiAoIWUpIHJldHVyblxyXG4gICAgICAgIGNvbnN0IHhNaW4gPSBNYXRoLmZsb29yKGUueE1pbiAvIHJlc29sdXRpb24pICogcmVzb2x1dGlvblxyXG4gICAgICAgIGNvbnN0IHhNYXggPSBNYXRoLmZsb29yKGUueE1heCAvIHJlc29sdXRpb24pICogcmVzb2x1dGlvblxyXG4gICAgICAgIGNvbnN0IHlNaW4gPSBNYXRoLmZsb29yKGUueU1pbiAvIHJlc29sdXRpb24pICogcmVzb2x1dGlvblxyXG4gICAgICAgIGNvbnN0IHlNYXggPSBNYXRoLmZsb29yKGUueU1heCAvIHJlc29sdXRpb24pICogcmVzb2x1dGlvblxyXG5cclxuICAgICAgICAvKiogIEB0eXBlIHt7bWluOm51bWJlciwgbWF4Om51bWJlcn19ICovXHJcbiAgICAgICAgY29uc3QgeXMgPSB7IG1pbjogeU1pbiwgbWF4OiB5TWF4IH1cclxuXHJcbiAgICAgICAgLy9kcmF3IGxpbmVzLCByb3cgYnkgcm93LCBzdGF0aW5nIGZyb20gdGhlIHRvcFxyXG4gICAgICAgIGN0eC5saW5lSm9pbiA9ICdyb3VuZCdcclxuICAgICAgICBmb3IgKGxldCB5ID0geU1heDsgeSA+PSB5TWluOyB5IC09IHJlc29sdXRpb24pIHtcclxuICAgICAgICAgICAgLy9nZXQgcm93XHJcbiAgICAgICAgICAgIGNvbnN0IHJvdyA9IGluZFt5XVxyXG5cclxuICAgICAgICAgICAgLy9ubyByb3dcclxuICAgICAgICAgICAgaWYgKCFyb3cpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL3BsYWNlIGZpcnN0IHBvaW50XHJcbiAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICBjdHgubW92ZVRvKHhNaW4gLSByZXNvbHV0aW9uIC8gMiwgeSlcclxuXHJcbiAgICAgICAgICAgIC8vc3RvcmUgdGhlIHByZXZpb3VzIGhlaWdodFxyXG4gICAgICAgICAgICAvKiogQHR5cGUge251bWJlcnx1bmRlZmluZWR9ICovXHJcbiAgICAgICAgICAgIGxldCBoR19cclxuXHJcbiAgICAgICAgICAgIC8vZ28gdGhyb3VnaCB0aGUgbGluZSBjZWxsc1xyXG4gICAgICAgICAgICBmb3IgKGxldCB4ID0geE1pbjsgeCA8PSB4TWF4OyB4ICs9IHJlc29sdXRpb24pIHtcclxuICAgICAgICAgICAgICAgIC8vZ2V0IGNvbHVtbiB2YWx1ZVxyXG4gICAgICAgICAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ9ICovXHJcbiAgICAgICAgICAgICAgICBsZXQgaEcgPSByb3dbeF1cclxuICAgICAgICAgICAgICAgIGlmICghaEcpIGhHID0gMFxyXG5cclxuICAgICAgICAgICAgICAgIGlmIChoRyB8fCBoR18pIHtcclxuICAgICAgICAgICAgICAgICAgICAvL2RyYXcgbGluZSBvbmx5IHdoZW4gYXQgbGVhc3Qgb25lIG9mIGJvdGggdmFsdWVzIGlzIG5vbi1udWxsXHJcbiAgICAgICAgICAgICAgICAgICAgLy9UT0RPIHRlc3QgYmV6aWVyQ3VydmVUb1xyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oeCArIHJlc29sdXRpb24gLyAyLCB5ICsgaEcpXHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vZWxzZSBtb3ZlIHRoZSBwb2ludFxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oeCArIHJlc29sdXRpb24gLyAyLCB5KVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy9zdG9yZSB0aGUgcHJldmlvdXMgdmFsdWVcclxuICAgICAgICAgICAgICAgIGhHXyA9IGhHXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vbGFzdCBwb2ludFxyXG4gICAgICAgICAgICBpZiAoaEdfKSBjdHgubGluZVRvKHhNYXggKyByZXNvbHV0aW9uIC8gMiwgeSlcclxuXHJcbiAgICAgICAgICAgIC8vZHJhdyBmaWxsXHJ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dHlsZVxyXG4gKiBAYXV0aG9yIEp1bGllbiBHYWZmdXJpXHJcbiAqL1xyXG5leHBvcnQgY2xhc3MgTGVnb1N0eWxlIHtcclxuICAgIHN0YXRpYyBnZXQodmFsdWUsIGJyZWFrcywgY29sb3JzLCBvcHRzID0ge30pIHtcclxuICAgICAgICBvcHRzID0gb3B0cyB8fCB7fVxyXG5cclxuICAgICAgICAvL3RoZSBjb2xvcnNcclxuICAgICAgICAvL2h0dHA6Ly93d3cuamVubnlzY3JheW9uY29sbGVjdGlvbi5jb20vMjAyMS8wNi9hbGwtY3VycmVudC1sZWdvLWNvbG9ycy5odG1sXHJcbiAgICAgICAgLy9odHRwczovL2xlb25hd2ljei5naXRodWIuaW8vbGVnb2NvbG9ycy9yZWZlcmVuY2UvZmlndXJlcy9SRUFETUUtcGxvdC0xLnBuZ1xyXG4gICAgICAgIC8qb3B0cy5jb2xvcnMgPSBvcHRzLmNvbG9ycyB8fCBbXHJcbiAgICAgICAgICAgICcjMDA4NTJiJywgLy9kYXJrZXIgZ3JlZW5cclxuICAgICAgICAgICAgJyNhZmQyNDYnLCAvL2xpZ2h0IGdyZWVuXHJcbiAgICAgICAgICAgICcjZmFjODBhJywgLy9kYXJrIHllbGxvd1xyXG4gICAgICAgICAgICAnI2JiODA1YScsIC8vYnJvd25cclxuICAgICAgICAgICAgJyNkNjc5MjMnLCAvL21vc3RhcmRcclxuICAgICAgICAgICAgJyNjYjRlMjknLCAvL3JlZGlzaFxyXG4gICAgICAgICAgICAnI2I0MDAwMCcsIC8vcmVkXHJcbiAgICAgICAgICAgICcjNzIwMDEyJywgLy9kYXJrIHJlZFxyXG4gICAgICAgICAgICAvL1wicHVycGxlXCIsXHJcbiAgICAgICAgICAgIC8vXCIjZWVlXCIgLy93aGl0aGVcclxuICAgICAgICBdKi9cclxuXHJcbiAgICAgICAgb3B0cy5jb2xEYXJrID0gb3B0cy5jb2xEYXJrIHx8ICcjMzMzJ1xyXG4gICAgICAgIG9wdHMuY29sQ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HRzLmNvbERhcmsgfHwgJyMzMzMnXHJcbiAgICAgICAgdGhpcy5jb2xCcmlnaHQgPSBvcHRzLmNvbEJyaWdodCB8fCAnI2FhYSdcclxuICAgIH1cclxuXHJcbiAgICBkcmF3KGNlbGxzLCBnZW9DYW52YXMsIHIpIHtcclxuICAgICAgICAvL2ZpbHRlclxyXG4gICAgICAgIGlmICh0aGlzLmZpbHRlcikgY2VsbHMgPSBjZWxscy5maWx0ZXIodGhpcy5maWx0ZXIpXHJcbiAgICAgICAgY29uc3QgY3R4ID0gZ2VvQ2FudmFzLm9mZnNjcmVlbkN0eFxyXG5cclxuICAgICAgICBjdHgubGluZVdpZHRoID0gMC42ICogZ2VvQ2FudmFzLnZpZXcuelxyXG5cclxuICAgICAgICAvL2RhcmsgcGFydFxyXG4gICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IHRoaXMuY29sRGFya1xyXG4gICAgICAgIGZvciAobGV0IGMgb2YgY2VsbHMpIHtcclxuICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgIGN0eC5hcmMoYy54ICsgciAqIDAuNSwgYy55ICsgciAqIDAuNSwgciAqIDAuNTUgKiAwLjUsIE1hdGguUEkgLyA0LCAtTWF0aC5QSSAqICgzIC8gNCksIHRydWUpXHJcbiAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9icmlnaHQgcGFydFxyXG4gICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IHRoaXMuY29sQnJpZ2h0XHJcbiAgICAgICAgZm9yIChsZXQgYyBvZiBjZWxscykge1xyXG4gICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgY3R4LmFyYyhjLnggKyByICogMC41LCBjLnkgKyByICogMC41LCByICogMC41NSAqIDAuNSwgTWF0aC5QSSAvIDQsIC1NYXRoLlBJICogKDMgLyA0KSwgZmFsc2UpXHJcbiAgICAgICAgICAgIGN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cy52aWV3U2NhbGUgPyB0aGlzLnZpZXdTY2FsZShjZWxscywgcmVzb2x1dGlvbiwgeikgOiB1bmRlZmluZWRcclxuXHJcbiAgICAgICAgLy9zZXQgc3Ryb2tlIHN0eWxlLCBmb3Igc2hhZG93XHJcbiAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gdGhpcy5zaGFkb3dDb2xvclxyXG4gICAgICAgIGN0eC5saW5lV2lkdGggPSB0aGlzLnNoYWRvd0ZhY3RvciAqIHJlc29sdXRpb25cclxuICAgICAgICBjdHgubGluZUpvaW4gPSAncm91bmQnXHJcbiAgICAgICAgY3R4LmxpbmVDYXAgPSAnYnV0dCdcclxuXHJcbiAgICAgICAgLy9mdW5jdGlvbiB0byBjb21wdXRlIHBvc2l0aW9uIG1vc2FpYyBlZmZlY3RcclxuICAgICAgICBjb25zdCBkID0gcmVzb2x1dGlvbiAqIHRoaXMubW9zYWljRmFjdG9yXHJcbiAgICAgICAgY29uc3QgbW9zYWljID0gKCkgPT4ge1xyXG4gICAgICAgICAgICByZXR1cm4geyB4OiBNYXRoLnJhbmRvbSgpICogZCwgeTogTWF0aC5yYW5kb20oKSAqIGQgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgZm9yIChsZXQgY2VsbCBvZiBjZWxscykge1xyXG4gICAgICAgICAgICAvL3NldCBmaWxsIGNvbG9yXHJcbiAgICAgICAgICAgIGNvbnN0IGNvbCA9IHRoaXMuY29sb3IgPyB0aGlzLmNvbG9yKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKCFjb2wgfHwgY29sID09PSAnbm9uZScpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGN0eC5maWxsU3R5bGUgPSBjb2xcclxuXHJcbiAgICAgICAgICAgIC8vZ2V0IG9mZnNldFxyXG4gICAgICAgICAgICBjb25zdCBvZmZzZXQgPSB0aGlzLm9mZnNldChjZWxsLCByZXNvbHV0aW9uLCB6KVxyXG5cclxuICAgICAgICAgICAgLy9jb21wdXRlIHBvc2l0aW9uIG1vc2FpYyBlZmZlY3RcclxuICAgICAgICAgICAgY29uc3QgbGwgPSBtb3NhaWMoKSxcclxuICAgICAgICAgICAgICAgIHVsID0gbW9zYWljKCksXHJcbiAgICAgICAgICAgICAgICBsciA9IG1vc2FpYygpLFxyXG4gICAgICAgICAgICAgICAgdXIgPSBtb3NhaWMoKVxyXG5cclxuICAgICAgICAgICAgLy9zdHJva2VcclxuICAgICAgICAgICAgaWYgKHRoaXMuc2hhZG93RmFjdG9yID4gMCkge1xyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGNlbGwueCArIG9mZnNldC5keCArIGxsLngsIGNlbGwueSArIG9mZnNldC5keSArIGxsLnkpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGNlbGwueCArIG9mZnNldC5keCArIHJlc29sdXRpb24gLSBsci54LCBjZWxsLnkgKyBvZmZzZXQuZHkgKyBsci55KVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjZWxsLnggKyBvZmZzZXQuZHggKyByZXNvbHV0aW9uIC0gdXIueCwgY2VsbC55ICsgb2Zmc2V0LmR5ICsgcmVzb2x1dGlvbiAtIHVyLnkpXHJcbiAgICAgICAgICAgICAgICBjdHguc3Ryb2tlKClcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy9maWxsXHJcblxyXG4gICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgY3R4Lm1vdmVUbyhjZWxsLnggKyBvZmZzZXQuZHggKyBsbC54LCBjZWxsLnkgKyBvZmZzZXQuZHkgKyBsbC55KVxyXG4gICAgICAgICAgICBjdHgubGluZVRvKGNlbGwueCArIG9mZnNldC5keCArIHJlc29sdXRpb24gLSBsci54LCBjZWxsLnkgKyBvZmZzZXQuZHkgKyB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GsgKiByMlxyXG5cclxuICAgICAgICAgICAgLy9zaGFwZVxyXG4gICAgICAgICAgICBjb25zdCBzaGFwZSA9IHRoaXMuc2hhcGUgPyB0aGlzLnNoYXBlKGNlbGwpIDogJ28nXHJcbiAgICAgICAgICAgIGlmIChzaGFwZSA9PT0gJ25vbmUnKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy9nZXQgb2Zmc2V0XHJcbiAgICAgICAgICAgIC8vVE9ETyB1c2VcclxuICAgICAgICAgICAgLy9jb25zdCBvZmZzZXQgPSB0aGlzLm9mZnNldChjZWxsLCByLCB6KVxyXG5cclxuICAgICAgICAgICAgLy9jZW50ZXIgcG9zaXRpb25cclxuICAgICAgICAgICAgY29uc3QgY3ggPSBjZWxsLnggKyByMlxyXG4gICAgICAgICAgICBjb25zdCBjeSA9IGNlbGwueSArIHIyXHJcblxyXG4gICAgICAgICAgICBpZiAoc2hhcGUgPT09ICdwJykge1xyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGN4LCBjeSArIHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjeCArIHNHMiwgY3kgKyBzRzIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4ICsgcjIsIGN5KVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjeCArIHNHMiwgY3kgLSBzRzIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4LCBjeSAtIHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjeCAtIHNHMiwgY3kgLSBzRzIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4IC0gcjIsIGN5KVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjeCAtIHNHMiwgY3kgKyBzRzIpXHJcbiAgICAgICAgICAgICAgICBjdHguZmlsbCgpXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc2hhcGUgPT09ICdvJykge1xyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGN4LCBjeSArIHNHMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oY3ggKyByMiwgY3kgKyByMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oY3ggKyBzRzIsIGN5KVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjeCArIHIyLCBjeSAtIHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjeCwgY3kgLSBzRzIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4IC0gcjIsIGN5IC0gcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGN4IC0gc0cyLCBjeSlcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oY3ggLSByMiwgY3kgKyByMilcclxuICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5leHBlY3RlZCBzaGFwZTonICsgc2hhcGUpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vdXBkYXRlIGxlZ2VuZHNcclxuICAgICAgICB0aGlzLnVwZGF0ZUxlZ2VuZHMoeyBzdHlsZTogdGhpcywgcmVzb2x1dGlvbjogcmVzb2x1dGlvbiwgejogeiwgdmlld1NjYWxlOiB2aWV3U2NhbGUgfSlcclxuICAgIH1cclxufVxyXG4iLCIvL0B0cy1jaGVja1xyXG4ndXNlIHN0cmljdCdcclxuXHJcbmltcG9ydCB7IFN0eWxlIH0gZnJvbSAnLi4vY29yZS9TdHlsZS5qcydcclxuXHJcbi8qKlxyXG4gKiBAbW9kdWxlIHN0eWxlXHJcbiAqIEBhdXRob3IgSnVsaWVuIEd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gc2ltcGxlID0gdGhpcy5zaW1wbGUocmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKVxyXG5cclxuICAgICAgICBjdHgubGluZUNhcCA9IHNpbXBsZSA/ICdidXR0JyA6ICdyb3VuZCdcclxuXHJcbiAgICAgICAgLy9kcmF3IHNoYWRvd3NcclxuICAgICAgICBjdHguc3Ryb2tlU3R5bGUgPSB0aGlzLnNoYWRvd0NvbG9yXHJcbiAgICAgICAgY3R4LmZpbGxTdHlsZSA9IHRoaXMuc2hhZG93Q29sb3JcclxuICAgICAgICBmb3IgKGxldCBjZWxsIG9mIGNlbGxzKSB7XHJcbiAgICAgICAgICAgIC8vd2lkdGhcclxuICAgICAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgICAgICBjb25zdCB3RyA9IHRoaXMud2lkdGggPyB0aGlzLndpZHRoKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKCF3RyB8fCB3RyA8IDApIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL2hlaWdodFxyXG4gICAgICAgICAgICAvKiogQHR5cGUge251bWJlcnx1bmRlZmluZWR9ICovXHJcbiAgICAgICAgICAgIGNvbnN0IGhHID0gdGhpcy5oZWlnaHQgPyB0aGlzLmhlaWdodChjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgIGlmICghaEcgfHwgaEcgPCAwKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy9nZXQgb2Zmc2V0XHJcbiAgICAgICAgICAgIC8vVE9ETyB1c2UgdGhhdFxyXG4gICAgICAgICAgICAvL2NvbnN0IG9mZnNldCA9IHRoaXMub2Zmc2V0KGMsIHJlc29sdXRpb24sIHopXHJcblxyXG4gICAgICAgICAgICAvL3NldCB3aWR0aFxyXG4gICAgICAgICAgICBjdHgubGluZVdpZHRoID0gd0dcclxuXHJcbiAgICAgICAgICAgIC8vY29tcHV0ZSBjZWxsIGNlbnRlciBwb3N0aXRpb25cclxuICAgICAgICAgICAgY29uc3QgY3ggPSBjZWxsLnggKyByZXNvbHV0aW9uIC8gMlxyXG4gICAgICAgICAgICBjb25zdCBjeSA9IGNlbGwueSArIHJlc29sdXRpb24gLyAyXHJcbiAgICAgICAgICAgIGNvbnN0IGxzID0gaEcgKiB0aGlzLnNoYWRvd0ZhY3RvclxyXG5cclxuICAgICAgICAgICAgLy9kcmF3IHNlZ21lbnRcclxuICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgIGN0eC5tb3ZlVG8oY3gsIGN5KVxyXG4gICAgICAgICAgICBjdHgubGluZVRvKGN4ICsgbHMgKiBNYXRoLmNvcyh0aGlzLnNoYWRvd0RpcmVjdGlvbiksIGN5ICsgbHMgKiBNYXRoLnNpbih0aGlzLnNoYWRvd0RpcmVjdGlvbikpXHJcbiAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG5cclxuICAgICAgICAgICAgLypcclxuICAgICAgICAgICAgaWYgKHRoaXMuc2ltcGxlKSB7XHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgYmFzZSBjaXJjbGVcclxuICAgICAgICAgICAgICAgIGNnLmN0eC5iZWdpblBhdGgoKTtcclxuICAgICAgICAgICAgICAgIGNnLmN0eC5hcmMoXHJcbiAgICAgICAgICAgICAgICAgICAgY3gsIGN5LFxyXG4gICAgICAgICAgICAgICAgICAgIHdHICogMC41LFxyXG4gICAgICAgICAgICAgICAgICAgIDAsIDIgKiBNYXRoLlBJLCBmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICAvL2NnLmN0eC5zdHJva2UoKTtcclxuICAgICAgICAgICAgICAgIGNnLmN0eC5maWxsKCk7XHJcbiAgICAgICAgICAgIH0qL1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9kcmF3IHBpbGxhcnNcclxuICAgICAgICBmb3IgKGxldCBjZWxsIG9mIGNlbGxzKSB7XHJcbiAgICAgICAgICAgIC8vY29sb3JcclxuICAgICAgICAgICAgLyoqIEB0eXBlIHtzdHJpbmd8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgICAgICBjb25zdCBjb2wgPSB0aGlzLmNvbG9yID8gdGhpcy5jb2xvcihjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgIGlmICghY29sKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy93aWR0aFxyXG4gICAgICAgICAgICAvKiogQHR5cGUge251bWJlcnx1bmRlZmluZWR9ICovXHJcbiAgICAgICAgICAgIGNvbnN0IHdHID0gdGhpcy53aWR0aCA/IHRoaXMud2lkdGgoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICBpZiAoIXdHIHx8IHdHIDwgMCkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vaGVpZ2h0XHJcbiAgICAgICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfHVuZGVmaW5lZH0gKi9cclxuICAgICAgICAgICAgY29uc3QgaEcgPSB0aGlzLmhlaWdodCA/IHRoaXMuaGVpZ2h0KGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKCFoRyB8fCBoRyA8IDApIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL2dldCBvZmZzZXRcclxuICAgICAgICAgICAgLy9UT0RPIHVzZSB0aGF0XHJcbiAgICAgICAgICAgIC8vY29uc3Qgb2Zmc2V0ID0gdGhpcy5vZmZzZXQoYywgcmVzb2x1dGlvbiwgeilcclxuXHJcbiAgICAgICAgICAgIC8vY29tcHV0ZSBjZWxsIGNlbnRlciBwb3N0aXRpb25cclxuICAgICAgICAgICAgY29uc3QgY3ggPSBjZWxsLnggKyByZXNvbHV0aW9uIC8gMlxyXG4gICAgICAgICAgICBjb25zdCBjeSA9IGNlbGwueSArIHJlc29sdXRpb24gLyAyXHJcblxyXG4gICAgICAgICAgICAvL2NvbXB1dGUgYW5nbGVcclxuICAgICAgICAgICAgY29uc3QgZHggPSBjeCAtIGN2eCxcclxuICAgICAgICAgICAgICAgIGR5ID0gY3kgLSBjdnlcclxuICAgICAgICAgICAgY29uc3QgYSA9IE1hdGguYXRhbjIoZHksIGR4KVxyXG4gICAgICAgICAgICBjb25zdCBEID0gTWF0aC5zcXJ0KGR4ICogZHggKyBkeSAqIGR5KVxyXG4gICAgICAgICAgICBjb25zdCBkID0gKEQgKiBoRykgLyAoSCAtIGhHKVxyXG5cclxuICAgICAgICAgICAgaWYgKHNpbXBsZSkge1xyXG4gICAgICAgICAgICAgICAgLy9kcmF3IHNlZ21lbnRcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IGNvbFxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IHdHXHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oY3gsIGN5KVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjeCArIGQgKiBNYXRoLmNvcyhhKSwgY3kgKyBkICogTWF0aC5zaW4oYSkpXHJcbiAgICAgICAgICAgICAgICBjdHguc3Ryb2tlKClcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vZHJhdyBiYWNrZ3JvdW5kIHNlZ21lbnRcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IHRoaXMub3V0bGluZUNvbFxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IHdHICsgMiAqIHRoaXMub3V0bGluZVdpZHRoUGl4ICogelxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGN4LCBjeSlcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oY3ggKyBkICogTWF0aC5jb3MoYSksIGN5ICsgZCAqIE1hdGguc2luKGEpKVxyXG4gICAgICAgICAgICAgICAgY3R4LnN0cm9rZSgpXHJcblxyXG4gICAgICAgICAgICAgICAgLy9kcmF3IHNlZ21lbnRcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IGNvbFxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IHdHXHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oY3gsIGN5KVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjeCArIGQgKiBNYXRoLmNvcyhhKSwgY3kgKyBkICogTWF0aC5zaW4oYSkpXHJcbiAgICAgICAgICAgICAgICBjdHguc3Ryb2tlKClcclxuXHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgdG9wIGNpcmNsZVxyXG4gICAgICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gdGhpcy5vdXRsaW5lQ29sXHJcbiAgICAgICAgICAgICAgICAvL2NnLmN0eC5maWxsU3R5bGUgPSBcIiNjMDhjNTlcIlxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IHRoaXMub3V0bGluZVdpZHRoUGl4ICogelxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHguYXJjKGN4ICsgZCAqIE1hdGguY29zKGEpLCBjeSArIGQgKiBNYXRoLnNpbihhKSwgd0cgKiAwLjUsIDAsIDIgKiBNYXRoLlBJLCBmYWxzZSlcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICAgICAgLy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iAgICAgICAgY3R4LmxpbmVDYXAgPSAnYnV0dCdcclxuXHJcbiAgICAgICAgLy9jb252ZXJzaW9uIGZhY3RvciBkZWdyZWUgLT4gcmFkaWFuXHJcbiAgICAgICAgY29uc3QgZiA9IE1hdGguUEkgLyAxODBcclxuXHJcbiAgICAgICAgZm9yIChsZXQgY2VsbCBvZiBjZWxscykge1xyXG4gICAgICAgICAgICAvL2NvbG9yXHJcbiAgICAgICAgICAgIC8qKiBAdHlwZSB7c3RyaW5nfHVuZGVmaW5lZH0gKi9cclxuICAgICAgICAgICAgY29uc3QgY29sID0gdGhpcy5jb2xvciA/IHRoaXMuY29sb3IoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICBpZiAoIWNvbCkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vd2lkdGhcclxuICAgICAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgICAgICBjb25zdCB3RyA9IHRoaXMud2lkdGggPyB0aGlzLndpZHRoKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKCF3RyB8fCB3RyA8IDApIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL2xlbmd0aFxyXG4gICAgICAgICAgICAvKiogQHR5cGUge251bWJlcnx1bmRlZmluZWR9ICovXHJcbiAgICAgICAgICAgIGNvbnN0IGxHID0gdGhpcy5sZW5ndGggPyB0aGlzLmxlbmd0aChjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgIGlmICghbEcgfHwgbEcgPCAwKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy9vcmllbnRhdGlvbiAoaW4gcmFkaWFuKVxyXG4gICAgICAgICAgICAvKiogQHR5cGUge251bWJlcn0gKi9cclxuICAgICAgICAgICAgY29uc3Qgb3IgPSB0aGlzLm9yaWVudGF0aW9uKGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgKiBmXHJcbiAgICAgICAgICAgIGlmIChvciA9PT0gdW5kZWZpbmVkIHx8IGlzTmFOKG9yKSkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vZ2V0IG9mZnNldFxyXG4gICAgICAgICAgICBjb25zdCBvZmZzZXQgPSB0aGlzLm9mZnNldChjZWxsLCByZXNvbHV0aW9uLCB6KVxyXG5cclxuICAgICAgICAgICAgLy9zZXQgY29sb3IgYW5kIHdpZHRoXHJcbiAgICAgICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IGNvbFxyXG4gICAgICAgICAgICBjdHgubGluZVdpZHRoID0gd0dcclxuXHJcbiAgICAgICAgICAgIC8vY29tcHV0ZSBzZWdtZW50IGNlbnRlciBwb3N0aXRpb25cclxuICAgICAgICAgICAgY29uc3QgY3ggPSBjZWxsLnggKyByZXNvbHV0aW9uIC8gMiArIG9mZnNldC5keFxyXG4gICAgICAgICAgICBjb25zdCBjeSA9IGNlbGwueSArIHJlc29sdXRpb24gLyAyICsgb2Zmc2V0LmR5XHJcblxyXG4gICAgICAgICAgICAvL2NvbXB1dGUgc2VnbWVudCBkaXJlY3Rpb25cclxuICAgICAgICAgICAgY29uc3QgZHggPSAwLjUgKiBNYXRoLmNvcyhvcikgKiBsR1xyXG4gICAgICAgICAgICBjb25zdCBkeSA9IDAuNSAqIE1hdGguc2luKG9yKSAqIGxHXHJcblxyXG4gICAgICAgICAgICAvL2RyYXcgc2VnbWVudFxyXG4gICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgY3R4Lm1vdmVUbyhjeCAtIGR4LCBjeSAtIGR5KVxyXG4gICAgICAgICAgICBjdHgubGluZVRvKGN4ICsgZHgsIGN5ICsgZHkpXHJcbiAgICAgICAgICAgIGN0eC5zdHJva2UoKV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KHNoYXBlID09PSAnbm9uZScpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL2dldCBvZmZzZXRcclxuICAgICAgICAgICAgY29uc3Qgb2Zmc2V0ID0gdGhpcy5vZmZzZXQoYywgcmVzb2x1dGlvbiwgeilcclxuXHJcbiAgICAgICAgICAgIC8vZ2V0IGNvbnRleHRcclxuICAgICAgICAgICAgY29uc3QgY3R4ID0gZ2VvQ2FudmFzLm9mZnNjcmVlbkN0eFxyXG4gICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gY29sXHJcbiAgICAgICAgICAgIGlmIChzaGFwZSA9PT0gJ3NxdWFyZScpIHtcclxuICAgICAgICAgICAgICAgIC8vZHJhdyBzcXVhcmVcclxuICAgICAgICAgICAgICAgIGNvbnN0IGQgPSByZXNvbHV0aW9uICogKDEgLSBzaXplIC8gcmVzb2x1dGlvbikgKiAwLjVcclxuICAgICAgICAgICAgICAgIGN0eC5maWxsUmVjdChjLnggKyBkICsgb2Zmc2V0LmR4LCBjLnkgKyBkICsgb2Zmc2V0LmR5LCBzaXplLCBzaXplKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAnY2lyY2xlJykge1xyXG4gICAgICAgICAgICAgICAgLy9kcmF3IGNpcmNsZVxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHguYXJjKGMueCArIHIyICsgb2Zmc2V0LmR4LCBjLnkgKyByMiArIG9mZnNldC5keSwgc2l6ZSAqIDAuNSwgMCwgMiAqIE1hdGguUEksIGZhbHNlKVxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGwoKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAnZG9udXQnKSB7XHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgZG9udXRcclxuICAgICAgICAgICAgICAgIGNvbnN0IHhjID0gYy54ICsgcjIgKyBvZmZzZXQuZHgsXHJcbiAgICAgICAgICAgICAgICAgICAgeWMgPSBjLnkgKyByMiArIG9mZnNldC5keVxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKHhjLCB5YylcclxuICAgICAgICAgICAgICAgIGN0eC5hcmMoeGMsIHljLCByMiwgMCwgMiAqIE1hdGguUEkpXHJcbiAgICAgICAgICAgICAgICBjdHguYXJjKHhjLCB5YywgKDEgLSBzaXplIC8gcmVzb2x1dGlvbikgKiByMiwgMCwgMiAqIE1hdGguUEksIHRydWUpXHJcbiAgICAgICAgICAgICAgICBjdHguY2xvc2VQYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChzaGFwZSA9PT0gJ2RpYW1vbmQnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBzMiA9IHNpemUgKiAwLjVcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyhjLnggKyByMiAtIHMyLCBjLnkgKyByMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcjIsIGMueSArIHIyICsgczIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCArIHIyICsgczIsIGMueSArIHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByMiwgYy55ICsgcjIgLSBzMilcclxuICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChzaGFwZSA9PT0gJ3RyaWFuZ2xlX3VwJykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZHIyID0gKHNpemUgLSByZXNvbHV0aW9uKSAvIDJcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyhjLnggLSBkcjIsIGMueSAtIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcjIsIGMueSArIHJlc29sdXRpb24gKyBkcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCArIHJlc29sdXRpb24gKyBkcjIsIGMueSAtIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChzaGFwZSA9PT0gJ3RyaWFuZ2xlX2Rvd24nKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBkcjIgPSAoc2l6ZSAtIHJlc29sdXRpb24pIC8gMlxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGMueCAtIGRyMiwgYy55ICsgcmVzb2x1dGlvbiArIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcjIsIGMueSAtIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcmVzb2x1dGlvbiArIGRyMiwgYy55ICsgcmVzb2x1dGlvbiArIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChzaGFwZSA9PT0gJ3RyaWFuZ2xlX2xlZnQnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBkcjIgPSAoc2l6ZSAtIHJlc29sdXRpb24pIC8gMlxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGMueCArIHJlc29sdXRpb24gKyBkcjIsIGMueSArIHJlc29sdXRpb24gKyBkcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCAtIGRyMiwgYy55ICsgcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCArIHJlc29sdXRpb24gKyBkcjIsIGMueSAtIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChzaGFwZSA9PT0gJ3RyaWFuZ2xlX3JpZ2h0Jykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZHIyID0gKHNpemUgLSByZXNvbHV0aW9uKSAvIDJcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyhjLnggLSBkcjIsIGMueSAtIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcmVzb2x1dGlvbiArIGRyMiwgYy55ICsgcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCAtIGRyMiwgYy55ICsgcmVzb2x1dGlvbiArIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5leHBlY3RlZCBzaGFwZTonICsgc2hhcGUpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vdXBkYXRlIGxlZ2VuZHNcclxuICAgICAgICB0aGlzLnVwZGF0ZUxlZ2VuZHMoeyB2aWV3U2NhbGU6IHZpZXdTY2FsZSwgcmVzb2x1dGlvbjogcmVzb2x1dGlvbiwgejogeiwgY2VsbHM6IGNlbGxzIH0pXHJcbiAgICB9XHJcbn1cclxuIiwiLy9AdHMtY2hlY2tcclxuJ3VzZSBzdHJpY3QnXHJcblxyXG5pbXBvcnQgeyBTaWRlU3R5bGUgfSBmcm9tICcuL1NpZGVTdHlsZS5qcydcclxuXHJcbi8qKlxyXG4gKiBBIHN0eWxlIHRvIHNob3cgdGhlIHNpZGVzIG9mIGdyaWQgY2VsbHMgYmFzZWQgb24gdGhlaXIgZGlmZmVyZW50IGNhdGVnb3JpZXMuXHJcbiAqXHJcbiAqIEBtb2R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WRlLmMyID8gdGhpcy5jb2RlKHNpZGUuYzIsIHJlc29sdXRpb24sIHopIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgIGlmIChjb2RlMSA9PSBjb2RlMikgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vd2lkdGhcclxuICAgICAgICAgICAgLyoqIEB0eXBlIHtudW1iZXJ8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgICAgICBjb25zdCB3RyA9IHRoaXMud2lkdGggPyB0aGlzLndpZHRoKHNpZGUsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKCF3RyB8fCB3RyA8PSAwKSBjb250aW51ZVxyXG4gICAgICAgICAgICBjb25zdCB3MiA9IHdHICogMC41XHJcblxyXG4gICAgICAgICAgICAvL3NldCB3aWR0aFxyXG4gICAgICAgICAgICBjdHgubGluZVdpZHRoID0gd0dcclxuXHJcbiAgICAgICAgICAgIC8vZHJhdyBzZWdtZW50IHdpdGggY29ycmVjdCBvcmllbnRhdGlvblxyXG4gICAgICAgICAgICBpZiAoc2lkZS5vciA9PT0gJ2gnKSB7XHJcbiAgICAgICAgICAgICAgICAvL3RvcCBsaW5lXHJcbiAgICAgICAgICAgICAgICBpZiAoY29kZTIpIHtcclxuICAgICAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgICAgICBjdHguc3Ryb2tlU3R5bGUgPSB0aGlzLmNvbG9yW2NvZGUyXVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oc2lkZS54IC0gcjIsIHNpZGUueSArIHcyKVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oc2lkZS54ICsgcjIsIHNpZGUueSArIHcyKVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIC8vYm90dG9tIGxpbmVcclxuICAgICAgICAgICAgICAgIGlmIChjb2RlMSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IHRoaXMuY29sb3JbY29kZTFdXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyhzaWRlLnggLSByMiwgc2lkZS55IC0gdzIpXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhzaWRlLnggKyByMiwgc2lkZS55IC0gdzIpXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LnN0cm9rZSgpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvL3JpZ2h0IGxpbmVcclxuICAgICAgICAgICAgICAgIGlmIChjb2RlMikge1xyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IHRoaXMuY29sb3JbY29kZTJdXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyhzaWRlLnggKyB3Miwgc2lkZS55IC0gcjIpXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhzaWRlLnggKyB3Miwgc2lkZS55ICsgcjIpXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LnN0cm9rZSgpXHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgLy9sZWZ0IGxpbmVcclxuICAgICAgICAgICAgICAgIGlmIChjb2RlMSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5zdHJva2VTdHlsZSA9IHRoaXMuY29sb3JbY29kZTFdXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyh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0dCdcclxuICAgICAgICBjb25zdCByMiA9IHJlc29sdXRpb24gKiAwLjVcclxuICAgICAgICBmb3IgKGxldCBzaWRlIG9mIHNpZGVzKSB7XHJcbiAgICAgICAgICAgIC8vY29sb3JcclxuICAgICAgICAgICAgLyoqIEB0eXBlIHtzdHJpbmd8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgICAgICBjb25zdCBjb2wgPSB0aGlzLmNvbG9yID8gdGhpcy5jb2xvcihzaWRlLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgIGlmICghY29sIHx8IGNvbCA9PSAnbm9uZScpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICBpZiAodGhpcy5kaWFtb25kKSB7XHJcbiAgICAgICAgICAgICAgICAvL3NldCBjb2xvclxyXG4gICAgICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IGNvbFxyXG5cclxuICAgICAgICAgICAgICAgIC8vZHJhdyBkaWFtb25kXHJcbiAgICAgICAgICAgICAgICBjb25zdCB4ID0gc2lkZS54LFxyXG4gICAgICAgICAgICAgICAgICAgIHkgPSBzaWRlLnlcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyh4IC0gcjIsIHkpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKHgsIHkgKyByMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oeCArIHIyLCB5KVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyh4LCB5IC0gcjIpXHJcbiAgICAgICAgICAgICAgICBjdHguY2xvc2VQYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5maWxsKClcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vd2lkdGhcclxuICAgICAgICAgICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfHVuZGVmaW5lZH0gKi9cclxuICAgICAgICAgICAgICAgIGNvbnN0IHdHID0gdGhpcy53aWR0aCA/IHRoaXMud2lkdGgoc2lkZSwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICAgICAgaWYgKCF3RyB8fCB3RyA8PSAwKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgICAgIC8vbGVuZ3RoXHJcbiAgICAgICAgICAgICAgICAvKiogQHR5cGUge251bWJlcnx1bmRlZmluZWR9ICovXHJcbiAgICAgICAgICAgICAgICBjb25zdCBsRyA9IHRoaXMubGVuZ3RoID8gdGhpcy5sZW5ndGgoc2lkZSwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICAgICAgaWYgKCFsRyB8fCBsRyA8PSAwKSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgY29uc3QgbEcyID0gbEcgKiAwLjVcclxuXHJcbiAgICAgICAgICAgICAgICAvL3NldCB3aWR0aFxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IHdHXHJcbiAgICAgICAgICAgICAgICAvL3NldCBjb2xvclxyXG4gICAgICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gY29sXHJcblxyXG4gICAgICAgICAgICAgICAgLy9kcmF3IHNlZ21lbnQgd2l0aCBjb3JyZWN0IG9yaWVudGF0aW9uXHJcbiAgICAgICAgICAgICAgICBjb25zdCB4ID0gc2lkZS54LFxyXG4gICAgICAgICAgICAgICAgICAgIHkgPSBzaWRlLnlcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgaWYgKHNpZGUub3IgPT09ICd2Jykge1xyXG4gICAgICAgICAgICAgICAgICAgIGN0eC5tb3ZlVG8oeCwgeSAtIGxHMilcclxuICAgICAgICAgICAgICAgICAgICBjdHgubGluZVRvKHgsIHkgKyBsR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ICAgICAgIC8vbWFrZSBzaGFyZWQgc2lkZVxyXG4gICAgICAgICAgICAgICAgc2lkZXMucHVzaCh7XHJcbiAgICAgICAgICAgICAgICAgICAgb3I6ICdoJyxcclxuICAgICAgICAgICAgICAgICAgICB4OiBjMS54ICsgcjIsXHJcbiAgICAgICAgICAgICAgICAgICAgeTogYzIueSxcclxuICAgICAgICAgICAgICAgICAgICBjMTogYzEsXHJcbiAgICAgICAgICAgICAgICAgICAgYzI6IGMyLFxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvL2NlbGxzIGRvIG5vdCB0b3VjaCBhbG9uZyBob3Jpem9udGFsIHNpZGVcclxuICAgICAgICAgICAgICAgIC8vbWFrZSB0d28gc2lkZXM6IHRvcCBvbmUgZm9yIGMxLCBib3R0b20gZm9yIGMyXHJcbiAgICAgICAgICAgICAgICBzaWRlcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgICAgICBvcjogJ2gnLFxyXG4gICAgICAgICAgICAgICAgICAgIHg6IGMxLnggKyByMixcclxuICAgICAgICAgICAgICAgICAgICB5OiBjMS55ICsgcmVzb2x1dGlvbixcclxuICAgICAgICAgICAgICAgICAgICBjMTogYzEsXHJcbiAgICAgICAgICAgICAgICAgICAgYzI6IHVuZGVmaW5lZCxcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICBzaWRlcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgICAgICBvcjogJ2gnLFxyXG4gICAgICAgICAgICAgICAgICAgIHg6IGMyLnggKyByMixcclxuICAgICAgICAgICAgICAgICAgICB5OiBjMi55LFxyXG4gICAgICAgICAgICAgICAgICAgIGMxOiB1bmRlZmluZWQsXHJcbiAgICAgICAgICAgICAgICAgICAgYzI6IGMyLFxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgYzEgPSBjMlxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9tYWtlIHZlcnRpY2FsIHNpZGVzXHJcbiAgICAgICAgLy9zb3J0IGNlbGxzIGJ5IHkgYW5kIHhcclxuICAgICAgICBjZWxscy5zb3J0KChjMSwgYzIpID0+IChjMi55ID09IGMxLnkgPyBjMS54IC0gYzIueCA6IGMxLnkgLSBjMi55KSlcclxuICAgICAgICBjMSA9IGNlbGxzWzBdXHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDE7IGkgPCBjZWxscy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICBsZXQgYzIgPSBjZWxsc1tpXVxyXG5cclxuICAgICAgICAgICAgaWYgKGMxLnggKyByZXNvbHV0aW9uID09IGMyLnggJiYgYzEueSA9PSBjMi55KVxyXG4gICAgICAgICAgICAgICAgLy9jZWxscyBpbiBzYW1lIHJvdyBhbmQgdG91Y2ggYWxvbmcgdmVydGljYWwgc2lkZVxyXG4gICAgICAgICAgICAgICAgLy9tYWtlIHNoYXJlZCBzaWRlXHJcbiAgICAgICAgICAgICAgICBzaWRlcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgICAgICBvcjogJ3YnLFxyXG4gICAgICAgICAgICAgICAgICAgIHg6IGMxLnggKyByZXNvbHV0aW9uLFxyXG4gICAgICAgICAgICAgICAgICAgIHk6IGMxLnkgKyByMixcclxuICAgICAgICAgICAgICAgICAgICBjMTogYzEsXHJcbiAgICAgICAgICAgICAgICAgICAgYzI6IGMyLFxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvL2NlbGxzIGRvIG5vdCB0b3VjaCBhbG9uZyB2ZXJ0aWNhbCBzaWRlXHJcbiAgICAgICAgICAgICAgICAvL21ha2UgdHdvIHNpZGVzOiByaWdodCBvbmUgZm9yIGMxLCBsZWZ0IGZvciBjMlxyXG4gICAgICAgICAgICAgICAgc2lkZXMucHVzaCh7XHJcbiAgICAgICAgICAgICAgICAgICAgb3I6ICd2JyxcclxuICAgICAgICAgICAgICAgICAgICB4OiBjMS54ICsgcmVzb2x1dGlvbixcclxuICAgICAgICAgICAgICAgICAgICB5OiBjMS55ICsgcjIsXHJcbiAgICAgICAgICAgICAgICAgICAgYzE6IGMxLFxyXG4gICAgICAgICAgICAgICAgICAgIGMyOiB1bmRlZmluZWQsXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgc2lkZXMucHVzaCh7XHJcbiAgICAgICAgICAgICAgICAgICAgb3I6ICd2JyxcclxuICAgICAgICAgICAgICAgICAgICB4OiBjMi54LFxyXG4gICAgICAgICAgICAgICAgICAgIHk6IGMyLnkgKyByMixcclxuICAgICAgICAgICAgICAgICAgICBjMTogdW5kZWZpbmVkLFxyXG4gICAgICAgICAgICAgICAgICAgIGMyOiBjMixcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIGMxID0gYzJcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHNpZGVzXHJcbiAgICB9XHJcbn1cclxuIiwiLy9AdHMtY2hlY2tcclxuJ3VzZSBzdHJpY3QnXHJcblxyXG5pbXBvcnQgeyBTdHlsZSB9IGZyb20gJy4uL2NvcmUvU3R5bGUuanMnXHJcbmltcG9ydCB7IG1ha2VXZWJHTENhbnZhcyB9IGZyb20gJy4uL3V0aWxzL3dlYkdMVXRpbHMuanMnXHJcbmltcG9ydCB7IFdlYkdMU3F1YXJlQ29sb3JpbmdDYXRBZHZhbmNlZCB9IGZyb20gJy4uL3V0aWxzL1dlYkdMU3F1YXJlQ29sb3JpbmdDYXRBZHZhbmNlZC5qcydcclxuXHJcbi8qKlxyXG4gKiBTdHlsZSBiYXNlZCBvbiB3ZWJHTFxyXG4gKiBUbyBzaG93IGNlbGxzIGFzIGNvbG9yZWQgc3F1YXJlcywgZnJvbSBjYXRlZ29yaWVzLlxyXG4gKiBBbGwgY2VsbHMgYXJ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c30gZ2VvQ2FudmFzXHJcbiAgICAgKiBAcGFyYW0ge251bWJlcn0gcmVzb2x1dGlvblxyXG4gICAgICovXHJcbiAgICBkcmF3KGNlbGxzLCBnZW9DYW52YXMsIHJlc29sdXRpb24pIHtcclxuICAgICAgICAvL2ZpbHRlclxyXG4gICAgICAgIGlmICh0aGlzLmZpbHRlcikgY2VsbHMgPSBjZWxscy5maWx0ZXIodGhpcy5maWx0ZXIpXHJcblxyXG4gICAgICAgIC8vXHJcbiAgICAgICAgY29uc3QgeiA9IGdlb0NhbnZhcy52aWV3LnpcclxuXHJcbiAgICAgICAgLy9hZGQgdmVydGljZSBhbmQgZnJhZ21lbnQgZGF0YVxyXG4gICAgICAgIGNvbnN0IHIyID0gcmVzb2x1dGlvbiAvIDJcclxuICAgICAgICBsZXQgYyxcclxuICAgICAgICAgICAgbmIgPSBjZWxscy5sZW5ndGhcclxuICAgICAgICBjb25zdCB2ZXJ0aWNlc0J1ZmZlciA9IFtdXHJcbiAgICAgICAgY29uc3QgaUJ1ZmZlciA9IFtdXHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBuYjsgaSsrKSB7XHJcbiAgICAgICAgICAgIGMgPSBjZWxsc1tpXVxyXG4gICAgICAgICAgICBjb25zdCBjYXQgPSB0aGlzLmNvZGUoYylcclxuICAgICAgICAgICAgaWYgKGNhdCA9PSB1bmRlZmluZWQpIHtcclxuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdVbmV4cGVjdGVkIGNhdGVnb3J5OiAnICsgY2F0KVxyXG4gICAgICAgICAgICAgICAgY29udGludWVcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvKiogQHR5cGUge251bWJlcn0gKi9cclxuICAgICAgICAgICAgY29uc3QgaV8gPSB0aGlzLmNhdFRvSVtjYXRdXHJcbiAgICAgICAgICAgIGlmIChpc05hTigraV8pKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnVW5leHBlY3RlZCBjYXRlZ29yeSBpbmRleDogJyArIGNhdCArICcgJyArIGlfKVxyXG4gICAgICAgICAgICAgICAgY29udGludWVcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB2ZXJ0aWNlc0J1ZmZlci5wdXNoKGMueCArIHIyLCBjLnkgKyByMilcclxuICAgICAgICAgICAgaUJ1ZmZlci5wdXNoKCtpXylcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vY3JlYXRlIGNhbnZhcyBhbmQgd2ViZ2wgcmVuZGVyZXJcclxuICAgICAgICBjb25zdCBjdldHTCA9IG1ha2VXZWJHTENhbnZhcyhnZW9DYW52YXMudyArICcnLCBnZW9DYW52YXMuaCArICcnKVxyXG4gICAgICAgIGlmICghY3ZXR0wpIHtcclxuICAgICAgICAgICAgY29uc29sZS5lcnJvcignTm8gd2ViR0wnKVxyXG4gICAgICAgICAgICByZXR1cm5cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vZHJhd1xyXG4gICAgICAgIGNvbnN0IHNpemVHZW8gPSB0aGlzLnNpemUgPyB0aGlzLnNpemUocmVzb2x1dGlvbiwgeikgOiByZXNvbHV0aW9uICsgMC4yICogelxyXG4gICAgICAgIHRoaXMud2dwLmRyYXcoY3ZXR0wuZ2wsIHZlcnRpY2VzQnVmZmVyLCBpQnVmZmVyLCBnZW9DYW52YXMuZ2V0V2ViR0xUcmFuc2Zvcm0oKSwgc2l6ZUdlbyAvIHopXHJcblxyXG4gICAgICAgIC8vZHJhdyBpbiBjYW52YXMgZ2VvXHJcbiAgICAgICAgZ2VvQ2FudmFzLmluaXRDYW52YXNUcmFuc2Zvcm0oKVxyXG4gICAgICAgIGdlb0NhbnZhcy5vZmZzY3JlZW5DdHguZHJhd0ltYWdlKGN2V0dMLmNhbnZhcywgMCwgMClcclxuXHJcbiAgICAgICAgLy91cGRhdGUgbGVnZW5kc1xyXG4gICAgICAgIHRoaXMudXBkYXRlTGVnZW5kcyh7IHN0eWxlOiB0aGlzLCByZXNvb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pJyxcclxuICAgICAgICAgICAgXS5yZXZlcnNlKClcclxuICAgICAgICBpZiAob3B0cy5jb2xvcilcclxuICAgICAgICAgICAgdGhpcy5jb2xvcnMgPSBbXHJcbiAgICAgICAgICAgICAgICBvcHRzLmNvbG9yKDApLFxyXG4gICAgICAgICAgICAgICAgb3B0cy5jb2xvcigwLjIpLFxyXG4gICAgICAgICAgICAgICAgb3B0cy5jb2xvcigwLjQpLFxyXG4gICAgICAgICAgICAgICAgb3B0cy5jb2xvcigwLjYpLFxyXG4gICAgICAgICAgICAgICAgb3B0cy5jb2xvcigwLjgpLFxyXG4gICAgICAgICAgICAgICAgb3B0cy5jb2xvcigxKSxcclxuICAgICAgICAgICAgXVxyXG5cclxuICAgICAgICAvKipcclxuICAgICAgICAgKiBEZWZpbmUgdGhlIG9wYWNpdHkgb2YgdGhlIHN0eWxlLCB3aXRoaW4gWzAsMV0uXHJcbiAgICAgICAgICogSWYgdGhpcyBvcGFjaXR5IGlzIGRlZmluZWQsIHRoZSBpbmRpdmlkdWFsIGNvbG9yIG9wYWNpdHkgd2lsbCBiZSBpZ25vcmVkLlxyXG4gICAgICAgICAqIEB0eXBlIHtmdW5jdGlvbihudW1iZXIsbnVtYmVyKTpudW1iZXJ9ICovXHJcbiAgICAgICAgdGhpcy5vcGFjaXR5ID0gb3B0cy5vcGFjaXR5IC8vIChyLHopID0+IC4uLlxyXG5cclxuICAgICAgICAvKipcclxuICAgICAgICAgKiBBIGZ1bmN0aW9uIHJldHVybmluZyB0aGUgc2l6ZSBvZiB0aGUgY2VsbHMsIGluIGdlb2dyYXBoaWNhbCB1bml0LiBBbGwgY2VsbHMgaGF2ZSB0aGUgc2FtZSBzaXplLlxyXG4gICAgICAgICAqIEB0eXBlIHtmdW5jdGlvbihudW1iZXIsbnVtYmVyKTpudW1iZXJ9ICovXHJcbiAgICAgICAgdGhpcy5zaXplID0gb3B0cy5zaXplIC8vIChyZXNvbHV0aW9uLCB6KSA9PiAuLi5cclxuICAgIH1c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4XHJcblxyXG4gICAgICAgIC8vZ2V0IHZpZXcgc2NhbGVcclxuICAgICAgICBjb25zdCB2aWV3U2NhbGUgPSB0aGlzLnZpZXdTY2FsZSA/IHRoaXMudmlld1NjYWxlKGNlbGxzLCByZXNvbHV0aW9uLCB6KSA6IHVuZGVmaW5lZFxyXG5cclxuICAgICAgICBjb25zdCByMiA9IHJlc29sdXRpb24gKiAwLjVcclxuICAgICAgICBmb3IgKGxldCBjIG9mIGNlbGxzKSB7XHJcbiAgICAgICAgICAgIC8vY29sb3JcclxuICAgICAgICAgICAgY29uc3QgY29sID0gdGhpcy5zdHJva2VDb2xvciA/IHRoaXMuc3Ryb2tlQ29sb3IoYywgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICBpZiAoIWNvbCB8fCBjb2wgPT09ICdub25lJykgY29udGludWVcclxuICAgICAgICAgICAgY3R4LnN0cm9rZVN0eWxlID0gY29sXHJcblxyXG4gICAgICAgICAgICAvL3NpemUgLSBpbiBnZW8gdW5pdFxyXG4gICAgICAgICAgICBjb25zdCBzaXplID0gdGhpcy5zaXplID8gdGhpcy5zaXplKGMsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiByZXNvbHV0aW9uXHJcblxyXG4gICAgICAgICAgICAvL3dpZHRoXHJcbiAgICAgICAgICAgIGNvbnN0IHdpID0gdGhpcy5zdHJva2VXaWR0aCA/IHRoaXMuc3Ryb2tlV2lkdGgoYywgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IDEgKiB6XHJcbiAgICAgICAgICAgIGlmICghd2kgfHwgd2kgPD0gMCkgY29udGludWVcclxuICAgICAgICAgICAgY3R4LmxpbmVXaWR0aCA9IHdpXHJcblxyXG4gICAgICAgICAgICAvL3NoYXBlXHJcbiAgICAgICAgICAgIGNvbnN0IHNoYXBlID0gdGhpcy5zaGFwZSA/IHRoaXMuc2hhcGUoYywgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6ICdzcXVhcmUnXHJcbiAgICAgICAgICAgIGlmIChzaGFwZSA9PT0gJ25vbmUnKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy9nZXQgb2Zmc2V0XHJcbiAgICAgICAgICAgIGNvbnN0IG9mZnNldCA9IHRoaXMub2Zmc2V0KGMsIHJlc29sdXRpb24sIHopXHJcblxyXG4gICAgICAgICAgICBpZiAoc2hhcGUgPT09ICdzcXVhcmUnKSB7XHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgc3F1YXJlXHJcbiAgICAgICAgICAgICAgICBjb25zdCBkID0gcmVzb2x1dGlvbiAqICgxIC0gc2l6ZSAvIHJlc29sdXRpb24pICogMC41XHJcbiAgICAgICAgICAgICAgICBjdHguYmVnaW5QYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5yZWN0KGMueCArIGQgKyBvZmZzZXQuZHgsIGMueSArIGQgKyBvZmZzZXQuZHksIHNpemUsIHNpemUpXHJcbiAgICAgICAgICAgICAgICBjdHguc3Ryb2tlKClcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChzaGFwZSA9PT0gJ2NpcmNsZScpIHtcclxuICAgICAgICAgICAgICAgIC8vZHJhdyBjaXJjbGVcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4LmFyYyhjLnggKyByMiArIG9mZnNldC5keCwgYy55ICsgcjIgKyBvZmZzZXQuZHksIHNpemUgKiAwLjUsIDAsIDIgKiBNYXRoLlBJLCBmYWxzZSlcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAnZGlhbW9uZCcpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHMyID0gc2l6ZSAqIDAuNVxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGMueCArIHIyIC0gczIsIGMueSArIHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByMiwgYy55ICsgcjIgKyBzMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcjIgKyBzMiwgYy55ICsgcjIpXHJcbiAgICAgICAgICAgICAgICBjdHgubGluZVRvKGMueCArIHIyLCBjLnkgKyByMiAtIHMyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByMiAtIHMyLCBjLnkgKyByMilcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAnZG9udXQnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKCdOb3QgaW1wbGVtZW50ZWQnKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAndHJpYW5nbGVfdXAnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBkcjIgPSAoc2l6ZSAtIHJlc29sdXRpb24pIC8gMlxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGMueCAtIGRyMiwgYy55IC0gZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByMiwgYy55ICsgcmVzb2x1dGlvbiArIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcmVzb2x1dGlvbiArIGRyMiwgYy55IC0gZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmNsb3NlUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHguc3Ryb2tlKClcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChzaGFwZSA9PT0gJ3RyaWFuZ2xlX2Rvd24nKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBkcjIgPSAoc2l6ZSAtIHJlc29sdXRpb24pIC8gMlxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKGMueCAtIGRyMiwgYy55ICsgcmVzb2x1dGlvbiArIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcjIsIGMueSAtIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5saW5lVG8oYy54ICsgcmVzb2x1dGlvbiArIGRyMiwgYy55ICsgcmVzb2x1dGlvbiArIGRyMilcclxuICAgICAgICAgICAgICAgIGN0eC5jbG9zZVBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4LnN0cm9rZSgpXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc2hhcGUgPT09ICd0cmlhbmdsZV9sZWZ0Jykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZHIyID0gKHNpemUgLSByZXNvbHV0aW9uKSAvIDJcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyhjLnggKyByZXNvbHV0aW9uICsgZHIyLCBjLnkgKyByZXNvbHV0aW9uICsgZHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggLSBkcjIsIGMueSArIHIyKVxyXG4gICAgICAgICAgICAgICAgY3R4LmxpbmVUbyhjLnggKyByZXNvbHV0aW9uICsgZHIyLCBjLnkgLSBkcjIpXHJcbiAgICAgICAgICAgICAgICBjdHguY2xvc2VQYXRoKClcclxuICAgICAgICAgICAgICAgIGN0eC5zdHJva2UoKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHNoYXBlID09PSAndHJpYW5nbGVfcmlnaHQnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBkcjIgPSAoc2l6ZSAtIHJlc29sdXRpb24pIC8gMlxyXG4gICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aC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opID0+IHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IG1pbldHID0gMSAqIHpcclxuICAgICAgICAgICAgICAgIGNvbnN0IG1heFdHID0gNCAqIHpcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN0ZXAgPSAobWF4V0cgLSBtaW5XRykgLyAzXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gTWF0aC5taW4obWluV0cgKyAoc2lkZVZhbHVlIC0gMSkgKiBzdGVwLCBtYXhXRylcclxuICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgLy9tYWtlIGNsYXNzaWZpZXJcclxuICAgICAgICBjb25zdCBjbGFzc2lmaWVyID0gY2xGdW4oYnJlYWtzKVxyXG4gICAgICAgIC8vbWFrZSBjb2xvcnMgdGFibGVcclxuICAgICAgICBjb25zdCBjb2xvcnNEaWN0ID0ge31cclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvbG9ycy5sZW5ndGg7IGkrKykgY29sb3JzRGljdFtpICsgJyddID0gY29sb3JzW2ldXHJcblxyXG4gICAgICAgIGNvbnN0IGNlbGxTdHlsZSA9IG5ldyBTcXVhcmVDb2xvckNhdGVnb3J5V2ViR0xTdHlsZSh7XHJcbiAgICAgICAgICAgIGNvZGU6IChjZWxsKSA9PiBjbGFzc2lmaWVyKHZhbHVlKGNlbGwpKSxcclxuICAgICAgICAgICAgY29sb3I6IGNvbG9yc0RpY3QsXHJcbiAgICAgICAgfSlcclxuXHJcbiAgICAgICAgY29uc3QgZ2V0U2lkZVZhbHVlID0gKHNpZGUpID0+IHtcclxuICAgICAgICAgICAgY29uc3QgY2wxID0gc2lkZS5jMSA/IGNsYXNzaWZpZXIodmFsdWUoc2lkZS5jMSkpIDogLTFcclxuICAgICAgICAgICAgY29uc3QgY2wyID0gc2lkZS5jMiA/IGNsYXNzaWZpZXIodmFsdWUoc2lkZS5jMikpIDogLTFcclxuICAgICAgICAgICAgcmV0dXJuIGNsMSAtIGNsMlxyXG4gICAgICAgIH1c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iAgICAgICAgaWYgKHRoaXMuZmlsdGVyKSBjZWxscyA9IGNlbGxzLmZpbHRlcih0aGlzLmZpbHRlcilcclxuXHJcbiAgICAgICAgLy9cclxuICAgICAgICBjb25zdCB6ID0gZ2VvQ2FudmFzLnZpZXcuelxyXG4gICAgICAgIGNvbnN0IGN0eCA9IGdlb0NhbnZhcy5vZmZzY3JlZW5DdHhcclxuICAgICAgICAvL2dldCB2aWV3IHNjYWxlXHJcbiAgICAgICAgY29uc3Qgdmlld1NjYWxlID0gdGhpcy52aWV3U2NhbGUgPyB0aGlzLnZpZXdTY2FsZShjZWxscywgcmVzb2x1dGlvbiwgeikgOiB1bmRlZmluZWRcclxuXHJcbiAgICAgICAgLy9kcmF3IHdpdGggSFRNTCBjYW52YXNcclxuICAgICAgICAvL2luIHNjcmVlbiBjb29yZGluYXRlc1xyXG4gICAgICAgIGdlb0NhbnZhcy5pbml0Q2FudmFzVHJhbnNmb3JtKClcclxuXHJcbiAgICAgICAgZm9yIChsZXQgY2VsbCBvZiBjZWxscykge1xyXG4gICAgICAgICAgICAvL2dldCBjZWxsIHRleHRcclxuICAgICAgICAgICAgY29uc3QgdGV4dCA9IHRoaXMudGV4dCA/IHRoaXMudGV4dChjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgIGlmICh0ZXh0ID09IHVuZGVmaW5lZCB8fCB0ZXh0ID09IG51bGwgfHwgdGV4dCArICcnID09PSAnJykgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vY29sb3JcclxuICAgICAgICAgICAgY29uc3QgY29sID0gdGhpcy5jb2xvciA/IHRoaXMuY29sb3IoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSA6IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICBpZiAoIWNvbCkgY29udGludWVcclxuICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9IGNvbFxyXG5cclxuICAgICAgICAgICAgLy9mb250IHNpemVcclxuICAgICAgICAgICAgLy9zaXplIC0gaW4gcGl4ZWwgdW5pdFxyXG4gICAgICAgICAgICBjb25zdCBmb250U2l6ZVBpeCA9IHRoaXMuZm9udFNpemUoY2VsbCwgcmVzb2x1dGlvbiwgeiwgdmlld1NjYWxlKSAvIHpcclxuICAgICAgICAgICAgaWYgKCFmb250U2l6ZVBpeCkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIC8vc2V0IGZvbnRcclxuICAgICAgICAgICAgY29uc3QgZm9udEZhbWlseSA9IHRoaXMuZm9udEZhbWlseSA/IHRoaXMuZm9udEZhbWlseShjZWxsLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogJ0FyaWFsJ1xyXG4gICAgICAgICAgICBjb25zdCBmb250V2VpZ2h0ID0gdGhpcy5mb250V2VpZ2h0ID8gdGhpcy5mb250V2VpZ2h0KGNlbGwsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiAnYm9sZCdcclxuICAgICAgICAgICAgY3R4LmZvbnQgPSBmb250V2VpZ2h0ICsgJyAnICsgZm9udFNpemVQaXggKyAncHggJyArIGZvbnRGYW1pbHlcclxuXHJcbiAgICAgICAgICAgIC8vZ2V0IG9mZnNldFxyXG4gICAgICAgICAgICBjb25zdCBvZmZzZXQgPSB0aGlzLm9mZnNldChjZWxsLCByZXNvbHV0aW9uLCB6KVxyXG5cclxuICAgICAgICAgICAgLy90ZXh0IHBvc2l0aW9uXHJcbiAgICAgICAgICAgIGN0eC50ZXh0QWxpZ24gPSAnY2VudGVyJ1xyXG4gICAgICAgICAgICBjb25zdCB0eCA9IGdlb0NhbnZhcy5nZW9Ub1BpeFgoY2VsbC54ICsgcmVzb2x1dGlvbiAqIDAuNSArIG9mZnNldC5keClcclxuICAgICAgICAgICAgY29uc3QgdHkgPSBnZW9DYW52YXMuZ2VvVG9QaXhZKGNlbGwueSArIHJlc29sdXRpb24gKiAwLjUgKyBvZmZzZXQuZHkpICs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ID0gdmFsXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKG1pbiA9PSB1bmRlZmluZWQpIHJldHVybiB1bmRlZmluZWRcclxuICAgICAgICAgICAgcmV0dXJuIG1heCAtIG1pblxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9jb21wdXRlIG1heCBhbXBsaXR1ZGVcclxuICAgICAgICBsZXQgYW1wTWF4XHJcbiAgICAgICAgZm9yIChsZXQgYyBvZiBjZWxscykge1xyXG4gICAgICAgICAgICBjb25zdCBhbXAgPSBnZXRBbXBsaXR1ZGUoYylcclxuICAgICAgICAgICAgaWYgKGFtcCA9PSB1bmRlZmluZWQpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGlmIChhbXBNYXggPT0gdW5kZWZpbmVkIHx8IGFtcCA+IGFtcE1heCkgYW1wTWF4ID0gYW1wXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICghYW1wTWF4KSByZXR1cm5cclxuXHJcbiAgICAgICAgY29uc3QgbmIgPSB0aGlzLnRzLmxlbmd0aFxyXG5cclxuICAgICAgICBjdHgubGluZUNhcCA9ICdidXR0J1xyXG4gICAgICAgIGZvciAobGV0IGMgb2YgY2VsbHMpIHtcclxuICAgICAgICAgICAgLy9saW5lIHdpZHRoXHJcbiAgICAgICAgICAgIC8qKiBAdHlwZSB7bnVtYmVyfHVuZGVmaW5lZH0gKi9cclxuICAgICAgICAgICAgY29uc3Qgd0cgPSB0aGlzLmxpbmVXaWR0aCA/IHRoaXMubGluZVdpZHRoKGMsIHJlc29sdXRpb24sIHosIHZpZXdTY2FsZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgaWYgKCF3RyB8fCB3RyA8IDApIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL2xpbmUgY29sb3JcclxuICAgICAgICAgICAgLyoqIEB0eXBlIHtzdHJpbmd8dW5kZWZpbmVkfSAqL1xyXG4gICAgICAgICAgICBjb25zdCBjb2wgPSB0aGlzLmNvbG9yID8gdGhpcy5jb2xvcihjLCByZXNvbHV0aW9uLCB6LCB2aWV3U2NhbGUpIDogdW5kZWZpbmVkXHJcbiAgICAgICAgICAgIGlmICghY29sKSBjb250aW51ZVxyXG5cclxuICAgICAgICAgICAgLy94XHJcbiAgICAgICAgICAgIGNvbnN0IG9mZlggPSB0aGlzLm9mZnNldFggPyB0aGlzLm9mZnNldFgoYywgcmVzb2x1dGlvbiwgeikgOiAwXHJcbiAgICAgICAgICAgIGlmIChvZmZYID09IHVuZGVmaW5lZCB8fCBpc05hTihvZmZYKSkgY29udGludWVcclxuICAgICAgICAgICAgY29uc3QgdyA9IHRoaXMud2lkdGggPyB0aGlzLndpZHRoKGMsIHJlc29sdXRpb24sIHopIDogcmVzb2x1dGlvblxyXG4gICAgICAgICAgICBpZiAodyA9PSB1bmRlZmluZWQgfHwgaXNOYU4odykpIGNvbnRpbnVlXHJcblxyXG4gICAgICAgICAgICAvL3lcclxuICAgICAgICAgICAgY29uc3Qgb2ZmWSA9IHRoaXMub2Zmc2V0WSA/IHRoaXMub2Zmc2V0WShjLCByZXNvbHV0aW9uLCB6KSA6IDBcclxuICAgICAgICAgICAgaWYgKG9mZlkgPT0gdW5kZWZpbmVkIHx8IGlzTmFOKG9mZlkpKSBjb250aW51ZVxyXG4gICAgICAgICAgICBjb25zdCBoID0gdGhpcy5oZWlnaHQgPyB0aGlzLmhlaWdodChjLCByZXNvbHV0aW9uLCB6KSA6IHJlc29sdXRpb25cclxuICAgICAgICAgICAgaWYgKGggPT0gdW5kZWZpbmVkIHx8IGlzTmFOKGgpKSBjb250aW51ZVxyXG4gICAgICAgICAgICBjb25zdCBhbmNoWSA9IHRoaXMuYW5jaG9yTW9kZVkgPyB0aGlzLmFuY2hvck1vZGVZKGMsIHJlc29sdXRpb24sIHopIDogJ2NlbnRlcidcclxuICAgICAgICAgICAgaWYgKCFhbmNoWSkgY29udGludWVcclxuXHJcbiAgICAgICAgICAgIGN0eC5saW5lV2lkdGggPSB3R1xyXG4gICAgICAgICAgICBjdHguc3Ryb2tlU3R5bGUgPSBjb2xcclxuXHJcbiAgICAgICAgICAgIC8vY29tcHV0ZSBhbmNob3IgWSBmaWd1cmVzXHJcbiAgICAgICAgICAgIGxldCB2YWwwLCB5MFxyXG4gICAgICAgICAgICBpZiAoYW5jaFkgPT09ICdmaXJzdCcpIHtcclxuICAgICAgICAgICAgICAgIC8vZ2V0IGZpcnN0IHZhbHVlXHJcbiAgICAgICAgICAgICAgICB2YWwwID0gY1t0aGlzLnRzWzBdXVxyXG4gICAgICAgICAgICAgICAgeTAgPSAwXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoYW5jaFkgPT09ICdsYXN0Jykge1xyXG4gICAgICAgICAgICAgICAgLy9nZXQgbGFzdCB2YWx1ZVxyXG4gICAgICAgICAgICAgICAgdmFsMCA9IGNbdGhpcy50c1t0aGlzLnRzLmxlbmd0aCAtIDFdXVxyXG4gICAgICAgICAgICAgICAgeTAgPSAwXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoYW5jaFkgPT09ICdib3R0b20nKSB7XHJcbiAgICAgICAgICAgICAgICAvL2dldCBtaW5cclxuICAgICAgICAgICAgICAgIGZvciAobGV0IHQgb2YgdGhpcy50cykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9ICtjW3RdXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbCA9PSB1bmRlZmluZWQpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbDAgPT0gdW5kZWZpbmVkIHx8IHZhbCA8IHZhbDApIHZhbDAgPSB2YWxcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHkwID0gMFxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGFuY2hZID09PSAndG9wJykge1xyXG4gICAgICAgICAgICAgICAgLy9nZXQgbWF4XHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCB0IG9mIHRoaXMudHMpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCB2YWwgPSArY1t0XVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWwgPT0gdW5kZWZpbmVkKSBjb250aW51ZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWwwID09IHVuZGVmaW5lZCB8fCB2YWwgPiB2YWwwKSB2YWwwID0gdmFsXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB5MCA9IHJlc29sdXRpb25cclxuICAgICAgICAgICAgfSBlbHNlIGlmIChhbmNoWSA9PT0gJ2NlbnRlcicpIHtcclxuICAgICAgICAgICAgICAgIC8vZ2V0IG1pbiBhbmQgbWF4XHJcbiAgICAgICAgICAgICAgICBsZXQgbWluLCBtYXhcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IHQgb2YgdGhpcy50cykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9IGNbdF1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodmFsID09IHVuZGVmaW5lZCkgY29udGludWVcclxuICAgICAgICAgICAgICAgICAgICBpZiAobWluID09IHVuZGVmaW5lZCB8fCB2YWwgPCBtaW4pIG1pbiA9IHZhbFxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChtYXggPT0gdW5kZWZpbmVkIHx8IHZhbCA+IG1heCkgbWF4ID0gdmFsXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB2YWwwID0gKCttYXggKyArbWluKSAqIDAuNVxyXG4gICAgICAgICAgICAgICAgeTAgPSByZXNvbHV0aW9uIC8gMlxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ1VuZXhwZWN0ZWQgYW5jaG9yTW9kZVk6ICcgKyBhbmNoWSlcclxuICAgICAgICAgICAgICAgIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8qL2RyYXcgbGluZVxyXG4gICAgICAgICAgICBpZiAodmFsMCA9PSB1bmRlZmluZWQgfHwgaXNOYU4odmFsMCkpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgIGNnLmN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICBjb25zdCBzWCA9IHcgLyAobmIgLSAxKVxyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5iOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9IGNbdGhpcy50c1tpXV1cclxuICAgICAgICAgICAgICAgIGlmICh2YWwgPT0gdW5kZWZpbmVkIHx8IGlzTmFOKHZhbCkpIGJyZWFrXHJcbiAgICAgICAgICAgICAgICBpZiAoaSA9PSAwKVxyXG4gICAgICAgICAgICAgICAgICAgIGNnLmN0eC5tb3ZlVG8oYy54ICsgaSAqIHNYICsgb2ZmWCwgYy55ICsgeTAgKyAodmFsIC0gdmFsMCkgKiBoIC8gYW1wTWF4ICsgb2ZmWSlcclxuICAgICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgICAgICBjZy5jdHgubGluZVRvKGMueCArIGkgKiBzWCArIG9mZlgsIGMueSArIHkwICsgKHZhbCAtIHZhbDApICogaCAvIGFtcE1heCArIG9mZlkpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY2cuY3R4LnN0cm9rZSgpKi9cclxuXHJcbiAgICAgICAgICAgIC8vZHJhdyBsaW5lLCBzZWdtZW50IGJ5IHNlZ21lbnRcclxuICAgICAgICAgICAgY29uc3Qgc1ggPSB3IC8gKG5iIC0gMSlcclxuXHJcbiAgICAgICAgICAgIC8vaGFuZGxlIGZpcnN0IHBvaW50XHJcbiAgICAgICAgICAgIGxldCB2MCA9IGNbdGhpcy50c1swXV1cclxuICAgICAgICAgICAgaWYgKCF0aGlzLm5vRGF0YSh2MCkpIHtcclxuICAgICAgICAgICAgICAgIGN0eC5iZWdpblBhdGgoKVxyXG4gICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyhjLnggKyBvZmZYLCBjLnkgKyB5MCArICgodjAgLSB2YWwwKSAqIGgpIC8gYW1wTWF4ICsgb2ZmWSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvL2NvbnNvbGUubG9nKHYwLCBpc05hTih2MCkpXHJcblxyXG4gICAgICAgICAgICBsZXQgdjFcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDE7IGkgPCBuYjsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICB2MSA9IGNbdGhpcy50c1tpXV1cclxuXHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgc2VnbWVudCBmcm9tIHYwIHRvIHYxXHJcblxyXG4gICAgICAgICAgICAgICAgLy9ib3RoIHBvaW50cyAnbm8gZGF0YSdcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLm5vRGF0YSh2MCkgJiYgdGhpcy5ub0RhdGEodjEpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9zZWNvbmQgcG9pbnQgJ25vIGRhdGEnXHJcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCF0aGlzLm5vRGF0YSh2MCkgJiYgdGhpcy5ub0RhdGEodjEpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LnN0cm9rZSgpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC8vZmlyc3QgcG9pbnQgJ25vIGRhdGEnXHJcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMubm9EYXRhKHYwKSAmJiAhdGhpcy5ub0RhdGEodjEpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY3R4LmJlZ2luUGF0aCgpXHJcbiAgICAgICAgICAgICAgICAgICAgY3R4Lm1vdmVUbyhjLnggKyBpICogc1ggKyBvZmZYLCBjLnkgKyB5MCArICgodjEgLSB2YWwwKSAqIGgpIC8gYW1wTWF4ICsgb2ZmWSlcclxuXHJcbiAgICAgICAgICAgICAgICA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ViR0xSZW5kZXJpbmdDb250ZXh0fSBnbFxuICAgICAqL1xuICAgIGNvbnN0cnVjdG9yKGdsLCBzaXplUGl4KSB7XG4gICAgICAgIHRoaXMuZ2wgPSBnbFxuICAgICAgICB0aGlzLnNpemVQaXggPSBzaXplUGl4IHx8IDEwLjBcblxuICAgICAgICB0aGlzLnByb2dyYW0gPSBpbml0U2hhZGVyUHJvZ3JhbShcbiAgICAgICAgICAgIGdsLFxuICAgICAgICAgICAgY3JlYXRlU2hhZGVyKFxuICAgICAgICAgICAgICAgIGdsLFxuICAgICAgICAgICAgICAgIGdsLlZFUlRFWF9TSEFERVIsXG4gICAgICAgICAgICAgICAgYFxuICAgICAgICAgICAgYXR0cmlidXRlIHZlYzIgcG9zO1xuICAgICAgICAgICAgdW5pZm9ybSBmbG9hdCBzaXplUGl4O1xuICAgICAgICAgICAgdW5pZm9ybSBtYXQzIG1hdDtcbiAgICAgICAgICAgIGF0dHJpYnV0ZSB2ZWM0IGNvbG9yO1xuICAgICAgICAgICAgdmFyeWluZyB2ZWM0IHZDb2xvcjtcbiAgICAgICAgICAgIHZvaWQgbWFpbigpIHtcbiAgICAgICAgICAgICAgZ2xfUG9zaXRpb24gPSB2ZWM0KG1hdCAqIHZlYzMocG9zLCAxLjApLCAxLjApO1xuICAgICAgICAgICAgICBnbF9Qb2ludFNpemUgPSBzaXplUGl4O1xuICAgICAgICAgICAgICB2Q29sb3IgPSBjb2xvcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICBgXG4gICAgICAgICAgICApLFxuICAgICAgICAgICAgY3JlYXRlU2hhZGVyKFxuICAgICAgICAgICAgICAgIGdsLFxuICAgICAgICAgICAgICAgIGdsLkZSQUdNRU5UX1NIQURFUixcbiAgICAgICAgICAgICAgICBgXG4gICAgICAgICAgICBwcmVjaXNpb24gbWVkaXVtcCBmbG9hdDtcbiAgICAgICAgICAgIHZhcnlpbmcgdmVjNCB2Q29sb3I7XG4gICAgICAgICAgICB2b2lkIG1haW4odm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ZyYWdtZW50IHNoYWRlciBjb2RlXG4gICAgICAgIC8vZGVjbGFyZSB0aGUgdW5pZm9ybSBhbmQgb3RoZXIgdmFyaWFibGVzXG4gICAgICAgIGxldCBmc2hTdHJpbmcgPVxuICAgICAgICAgICAgJycgK1xuICAgICAgICAgICAgJ3ByZWNpc2lvbiBtZWRpdW1wIGZsb2F0O1xcbicgK1xuICAgICAgICAgICAgJ3ZhcnlpbmcgZmxvYXQgdnQ7XFxuJyArXG4gICAgICAgICAgICAndW5pZm9ybSBmbG9hdCBhbHBoYTtcXG4nICtcbiAgICAgICAgICAgICgoKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3Qgb3V0ID0gW11cbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvbG9ycy5sZW5ndGg7IGkrKykgb3V0LnB1c2goJ3VuaWZvcm0gdmVjNCBjJyArIGkgKyAnO1xcbicpXG4gICAgICAgICAgICAgICAgcmV0dXJuIG91dC5qb2luKCcnKVxuICAgICAgICAgICAgfSkoKSArXG4gICAgICAgICAgICAvL3N0YXJ0IHRoZSBtYWluIGZ1bmN0aW9uLCBhcHBseSB0aGUgc3RyZXRjaGluZyBvZiB0XG4gICAgICAgICAgICAndm9pZCBtYWluKHZvaWQpIHtcXG4nXG5cbiAgICAgICAgaWYgKHN0cmV0Y2hpbmcpIHtcbiAgICAgICAgICAgIGlmIChzdHJldGNoaW5nLmZ1biA9PSAncG93JylcbiAgICAgICAgICAgICAgICAvL3NQb3cgPSAodCwgYWxwaGEgPSAzKSA9PiBNYXRoLnBvdyh0LCBhbHBoYSk7XG4gICAgICAgICAgICAgICAgZnNoU3RyaW5nICs9ICcgICBmbG9hdCB0ID0gcG93KHZ0LCBhbHBoYSk7XFxuJ1xuICAgICAgICAgICAgZWxzZSBpZiAoc3RyZXRjaGluZy5mdW4gPT0gJ3Bvd0ludicpXG4gICAgICAgICAgICAgICAgLy9zUG93UmV2ID0gKHQsIGFscGhhID0gMykgPT4gMSAtIE1hdGgucG93KDEgLSB0LCAxIC8gYWxwaGEpO1xuICAgICAgICAgICAgICAgIGZzaFN0cmluZyArPSAnICAgZmxvYXQgdCA9IDEuMC1wb3coMS4wLXZ0LCAxLjAvYWxwaGEpO1xcbidcbiAgICAgICAgICAgIGVsc2UgaWYgKHN0cmV0Y2hpbmcuZnVuID09ICdleHAnKVxuICAgICAgICAgICAgICAgIC8vc0V4cCA9ICh0LCBhbHBoYSA9IDMpID0+IGFscGhhID09IDAgPyB0IDogKE1hdGguZXhwKHQgKiBhbHBoYSkgLSAxKSAvIChNYXRoLmV4cChhbHBoYSkgLSAxKTtcbiAgICAgICAgICAgICAgICBmc2hTdHJpbmcgKz1cbiAgICAgICAgICAgICAgICAgICAgc3RyZXRjaGluZy5hbHBoYSA9PSAwXG4gICAgICAgICAgICAgICAgICAgICAgICA/IGBmbG9hdCB0ID0gdnQ7YFxuICAgICAgICAgICAgICAgICAgICAgICAgOiAnICAgZmxvYXQgdCA9IChleHAodnQgKiBhbHBoYSkgLSAxLjApIC8gKGV4cChhbHBoYSkgLSAxLjApO1xcbidcbiAgICAgICAgICAgIGVsc2UgaWYgKHN0cmV0Y2hpbmcuZnVuID09ICdsb2cnKVxuICAgICAgICAgICAgICAgIC8vc0V4cFJldiA9ICh0LCBhbHBoYSA9IDMpID0+IGFscGhhID09IDAgPyB0IDogMSAtICgxIC8gYWxwaGEpICogTWF0aC5sb2coTWF0aC5leHAoYWxwaGEpICogKDEgLSB0KSArIHQpO1xuICAgICAgICAgICAgICAgIGZzaFN0cmluZyArPVxuICAgICAgICAgICAgICAgICAgICBzdHJldGNoaW5nLmFscGhhID09IDBcbiAgICAgICAgICAgICAgICAgICAgICAgID8gYGZsb2F0IHQgPSB2dDtgXG4gICAgICAgICAgICAgICAgICAgICAgICA6ICcgICBmbG9hdCB0ID0gMS4wIC0gKDEuMCAvIGFscGhhKSAqIGxvZyhleHAoYWxwaGEpICogKDEuMCAtIHZ0KSArIHZ0KTtcXG4nXG4gICAgICAgICAgICBlbHNlIGlmIChzdHJldGNoaW5nLmZ1biA9PSAnY2lyY2xlJykge1xuICAgICAgICAgICAgICAgIGlmIChzdHJldGNoaW5nLmFscGhhID09IDApXG4gICAgICAgICAgICAgICAgICAgIC8vaWYgKGFscGhhID09IDApIHJldHVybiB0O1xuICAgICAgICAgICAgICAgICAgICBmc2hTdHJpbmcgKz0gJyAgIGZsb2F0IHQgPSB2dDtcXG4nXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc3RyZXRjaGluZy5hbHBoYSA9PSAxKVxuICAgICAgICAgICAgICAgICAgICAvLyBpZiAoYWxwaGEgPT0gMSkgcmV0dXJuIE1hdGguc3FydCgyICogdCAtIHQgKiB0KTtcbiAgICAgICAgICAgICAgICAgICAgZnNoU3RyaW5nICs9ICcgICBmbG9hdCB0ID0gc3FydCh2dCAqICgyLjAgLSB2dCkpO1xcbidcbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy9jb25zdCBhID0gYWxwaGEgLyAoMSAtIGFscGhhKTtcbiAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gTWF0aC5zcXJ0KDEgLyAoYSAqIGEpICsgdCAqICgyIC8gYSArIDIgLSB0KSkgLSAxIC8gYTtcbiAgICAgICAgICAgICAgICAgICAgZnNoU3RyaW5nICs9XG4gICAgICAgICAgICAgICAgICAgICAgICAnICAgZmxvYXQgYSA9IGFscGhhIC8gKDEuMCAtIGFscGhhKTtcXG4nICtcbiAgICAgICAgICAgICAgICAgICAgICAgICcgICBmbG9hdCB0ID0gc3FydCgxLjAgLyAoYSAqIGEpICsgdnQgKiAoIDIuMC9hICsgMi4wIC0gdnQgKSkgLSAxLjAgLyBhO1xcbidcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHN0cmV0Y2hpbmcuZnVuID09ICdjaXJjbGVJbnYnKSB7XG4gICAgICAgICAgICAgICAgLy8gMSAtIHNDaXJjbGVMb3coMSAtIHQsIGFscGhhKVxuICAgICAgICAgICAgICAgIGlmIChzdHJldGNoaW5nLmFscGhhID09IDApXG4gICAgICAgICAgICAgICAgICAgIC8vaWYgKGFscGhhID09IDApIHJldHVybiB0O1xuICAgICAgICAgICAgICAgICAgICBmc2hTdHJpbmcgKz0gJyAgIGZsb2F0IHQgPSB2dDtcXG4nXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc3RyZXRjaGluZy5hbHBoYSA9PSAxKVxuICAgICAgICAgICAgICAgICAgICAvLyBpZiAoYWxwaGEgPT0gMSkgcmV0dXJuIE1hdGguc3FydCgyICogdCAtIHQgKiB0KTtcbiAgICAgICAgICAgICAgICAgICAgZnNoU3RyaW5nICs9ICcgICBmbG9hdCB0ID0gMS4wIC0gc3FydCgoMS4wIC0gdnQpICogKDEuMCArIHZ0KSk7XFxuJ1xuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvL2NvbnN0IGEgPSBhbHBoYSAvICgxIC0gYWxwaGEpO1xuICAgICAgICAgICAgICAgICAgICAvL3JldHVybiBNYXRoLnNxcnQoMSAvIChhICogYSkgKyAoMiAqIHQpIC8gYSArIDIgKiB0IC0gdCAqIHQpIC0gMSAvIGE7XG4gICAgICAgICAgICAgICAgICAgIGZzaFN0cmluZyArPVxuICAgICAgICAgICAgICAgICAgICAgICAgJyAgIGZsb2F0IGEgPSBhbHBoYSAvICgxLjAgLSBhbHBoYSk7XFxuJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAnICAgZmxvYXQgdCA9IDEuMCAtIHNxcnQoMS4wIC8gKGEgKiBhKSArICgxLjAtdnQpICogKCAyLjAvYSArIDEuMCArIHZ0ICkpICsgMS4wIC8gYTtcXG4nXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKCdVbmV4cGVjdGVkIHN0cmV0Y2hpbmcgZnVuY3Rpb24gY29kZTogJyArIHN0cmV0Y2hpbmcuZnVuKVxuICAgICAgICAgICAgICAgIGZzaFN0cmluZyArPSAnICAgZmxvYXQgdCA9IHZ0O1xcbidcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGZzaFN0cmluZyArPSAnICAgZmxvYXQgdCA9IHZ0O1xcbidcbiAgICAgICAgfVxuXG4gICAgICAgIC8vY2hvb3NlIGluaXRpYWwgYW5kIGZpbmFsIGNvbG9ycywgYW5kIGFkanVzdCB0IHZhbHVlXG4gICAgICAgIGlmIChjb2xvcnMubGVuZ3RoID09IDEpIGZzaFN0cmluZyArPSAnICAgdmVjNCBjST1jMDtcXG4gICB2ZWM0IGNGPWMwO1xcbidcbiAgICAgICAgZWxzZSBpZiAoY29sb3JzLmxlbmd0aCA9PSAyKSBmc2hTdHJpbmcgKz0gJyAgIHZlYzQgY0k9YzA7XFxuICAgdmVjNCBjRj1jMTtcXG4nXG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgY29uc3QgbmIgPSBjb2xvcnMubGVuZ3RoIC0gMVxuICAgICAgICAgICAgY29uc3QgbmJzID0gbmIgKyAnLjAnXG4gICAgICAgICAgICBmc2hTdHJpbmcgKz0gJyAgIHZlYzQgY0k7XFxuJ1xuICAgICAgICAgICAgZnNoU3RyaW5nICs9ICcgICB2ZWM0IGNGO1xcbidcbiAgICAgICAgICAgIGZzaFN0cmluZyArPSAnICAgaWYodDwxLjAvJyArIG5icyArICcpIHsgY0k9YzA7IGNGPWMxOyB0PXQqJyArIG5icyArICc7IH1cXG4nXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMjsgaSA8IG5iOyBpKyspXG4gICAgICAgICAgICAgICAgZnNoU3RyaW5nICs9XG4gICAgICAgICAgICAgICAgICAgICcgICBlbHNlIGlmKHQ8JyArXG4gICAgICAgICAgICAgICAgICAgIGkgK1xuICAgICAgICAgICAgICAgICAgICAnLjAvJyArXG4gICAgICAgICAgICAgICAgICAgIG5icyArXG4gICAgICAgICAgICAgICAgICAgICcpIHsgY0k9YycgK1xuICAgICAgICAgICAgICAgICAgICAoaSAtIDEpICtcbiAgICAgICAgICAgICAgICAgICAgJzsgY0Y9YycgK1xuICAgICAgICAgICAgICAgICAgICBpICtcbiAgICAgICAgICAgICAgICAgICAgJzsgdD0nICtcbiAgICAgICAgICAgICAgICAgICAgbmJzICtcbiAgICAgICAgICAgICAgICAgICAgJyp0LScgK1xuICAgICAgICAgICAgICAgICAgICAoaSAtIDEpICtcbiAgICAgICAgICAgICAgICAgICAgJy4wOyB9XFxuJ1xuICAgICAgICAgICAgZnNoU3RyaW5nICs9XG4gICAgICAgICAgICAgICAgJyAgIGVsc2UgeyBjST1jJyArIChuYiAtIDEpICsgJzsgY0Y9YycgKyBuYiArICc7IHQ9JyArIG5icyArICcqdC0nICsgKG5iIC0gMSkgKyAnLjA7IH1cXG4nXG4gICAgICAgIH1cblxuICAgICAgICAvL29uZSBzaW5nbGUgY29sb3JcbiAgICAgICAgaWYgKGNvbG9ycy5sZW5ndGggPT0gMSkgZnNoU3RyaW5nICs9ICcgICBnbF9GcmFnQ29sb3IgPSB2ZWM0KGMwWzBdLCBjMFsxXSwgYzBbMl0sIGMwWzNdKTt9XFxuJ1xuICAgICAgICAvL3NldCBpbnRlcnBvbGF0ZWQgY29sb3IsIGJldHdlZW4gaW5pdGlhbCBhbmQgZmluYWwgb25lXG4gICAgICAgIGVsc2UgZnNoU3RyaW5nICs9ICcgICBnbF9GcmFnQ29sb3IgPSBtaXgoY0ksIGNGLCB0KTt9XFxuJ1xuXG4gICAgICAgIC8vY29uc29sZS5sb2coZnNoU3RyaW5nKVxuXG4gICAgICAgIC8qKiBAdHlwZSB7V2ViR0xTaGFkZXJ9ICovXG4gICAgICAgIGNvbnN0IGZTaGFkZXIgPSBjcmVhdGVTaGFkZXIoZ2wsIGdsLkZSQUdNRU5UX1NIQURFUiwgZnNoU3RyaW5nKVxuXG4gICAgICAgIC8qKiBA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ZXIgdmFyaWFibGVzXG4gICAgICAgIGNvbnN0IG91dCA9IFtdXG4gICAgICAgIG91dC5wdXNoKCdwcmVjaXNpb24gbWVkaXVtcCBmbG9hdDtcXG52YXJ5aW5nIGZsb2F0IHZpO1xcbicpXG4gICAgICAgIC8vYWRkIGNvbG9yIHVuaWZvcm1zXG4gICAgICAgIG91dC5wdXNoKCd1bmlmb3JtIHZlYzQnKVxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvbG9ycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKGkgPiAwKSBvdXQucHVzaCgnLCcpXG4gICAgICAgICAgICBvdXQucHVzaCgnIGMnICsgaSlcbiAgICAgICAgfVxuICAgICAgICBvdXQucHVzaCgnO1xcbicpXG4gICAgICAgIC8vc3RhcnQgdGhlIG1haW4gZnVuY3Rpb25cbiAgICAgICAgb3V0LnB1c2goJ3ZvaWQgbWFpbih2b2lkKSB7XFxuJylcbiAgICAgICAgLy9jaG9vc2UgY29sb3IgaVxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvbG9ycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKGkgPiAwKSBvdXQucHVzaCgnZWxzZSAnKVxuICAgICAgICAgICAgb3V0LnB1c2goJ2lmKHZpPT0nKVxuICAgICAgICAgICAgb3V0LnB1c2goaSlcbiAgICAgICAgICAgIG91dC5wdXNoKCcuMCkgZ2xfRnJhZ0NvbG9yID0gdmVjNChjJylcbiAgICAgICAgICAgIG91dC5wdXNoKGkpXG4gICAgICAgICAgICBvdXQucHVzaCgnWzBdLCBjJylcbiAgICAgICAgICAgIG91dC5wdXNoKGkpXG4gICAgICAgICAgICBvdXQucHVzaCgnWzFdLCBjJylcbiAgICAgICAgICAgIG91dC5wdXNoKGkpXG4gICAgICAgICAgICBvdXQucHVzaCgnWzJdLCBjJylcbiAgICAgICAgICAgIG91dC5wdXNoKGkpXG4gICAgICAgICAgICBvdXQucHVzaCgnW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AgY29uc3QgbWluVmFsdWUgPSBvcHRzLm1pblZhbHVlIHx8IDBcclxuICAgIGNvbnN0IG1pblNpemVQaXggPSBvcHRzLm1pblNpemVQaXggfHwgMFxyXG4gICAgY29uc3QgbWF4U2l6ZUZhY3RvciA9IG9wdHMubWF4U2l6ZUZhY3RvciB8fCAxXHJcbiAgICBjb25zdCBzdHJldGNoaW5nID0gb3B0cy5zdHJldGNoaW5nXHJcbiAgICBjb25zdCByYW5nZV8gPSBvcHRzLnJhbmdlXHJcbiAgICBjb25zdCBkb21haW5fID0gb3B0cy5kb21haW5cclxuICAgIGNvbnN0IGNsYXNzTnVtYmVyID0gb3B0cy5jbGFzc051bWJlclxyXG4gICAgcmV0dXJuIChjZWxscywgcmVzb2x1dGlvbiwgeikgPT4ge1xyXG4gICAgICAgIGNvbnN0IGRvbWFpbiA9IGRvbWFpbl8gfHwgW21pblZhbHVlLCBtYXgoY2VsbHMsIHZhbHVlRnVuY3Rpb24pXVxyXG4gICAgICAgIGNvbnN0IHJhbmdlID0gcmFuZ2VfIHx8IFttaW5TaXplUGl4ICogeiwgcmVzb2x1dGlvbiAqIG1heFNpemVGYWN0b3JdXHJcbiAgICAgICAgY29uc3QgZG9tYWluU2l6ZSA9IGRvbWFpblsxXSAtIGRvbWFpblswXSxcclxuICAgICAgICAgICAgZG9tYWluTWluID0gZG9tYWluWzBdXHJcbiAgICAgICAgY29uc3QgcmFuZ2VTaXplID0gcmFuZ2VbMV0gLSByYW5nZVswXSxcclxuICAgICAgICAgICAgcmFuZ2VNaW4gPSByYW5nZVswXVxyXG4gICAgICAgIHJldHVybiAodCkgPT4ge1xyXG4gICAgICAgICAgICAvL3NjYWxlIHRvIFswLDFdXHJcbiAgICAgICAgICAgIHQgPSAodCAtIGRvbWFpbk1pbikgLyBkb21haW5TaXplXHJcbiAgICAgICAgICAgIC8vc3RyZXRjaFxyXG4gICAgICAgICAgICBpZiAoc3RyZXRjaGluZykgdCA9IHN0cmV0Y2hpbmcodClcclxu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G4gICAgICAgICAgICByZXR1cm4gJzInXHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vbWlkZGxlIGNsYXNzIDAgLSBpbnRlcnNlY3Rpb24gY2xhc3MgMSBhbmQgMlxyXG4gICAgICAgIGlmIChzMCA8PSBjMCAmJiBzMSA+PSBjMSAmJiBzMiA+PSBjMikge1xyXG4gICAgICAgICAgICAvL2NlbnRyYWwgY2xhc3NcclxuICAgICAgICAgICAgaWYgKGNjICE9IHVuZGVmaW5lZCAmJiBzMCA+IGNjICogYzApIHJldHVybiAnY2VudGVyJ1xyXG4gICAgICAgICAgICBpZiAod2l0aE1peGVkQ2xhc3NlcykgcmV0dXJuICdtMTInXHJcbiAgICAgICAgICAgIHJldHVybiBzMSA+IHMyID8gJzEnIDogJzInXHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vbWlkZGxlIGNsYXNzIDEgLSBpbnRlcnNlY3Rpb24gY2xhc3MgMCBhbmQgMVxyXG4gICAgICAgIGlmIChzMCA+PSBjMCAmJiBzMSA8PSBjMSAmJiBzMiA+PSBjMikge1xyXG4gICAgICAgICAgICAvL2NlbnRyYWwgY2xhc3NcclxuICAgICAgICAgICAgaWYgKGNjICE9IHVuZGVmaW5lZCAmJiBzMSA+IGNjICogYzEpIHJldHVybiAnY2VudGVyJ1xyXG4gICAgICAgICAgICBpZiAod2l0aE1peGVkQ2xhc3NlcykgcmV0dXJuICdtMDInXHJcbiAgICAgICAgICAgIHJldHVybiBzMCA+IHMyID8gJzAnIDogJzInXHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vbWlkZGxlIGNsYXNzIDIgLSBpbnRlcnNlY3Rpb24gY2xhc3MgMCBhbmQgMVxyXG4gICAgICAgIGlmIChzMCA+PSBjMCAmJiBzMSA+PSBjMSAmJiBzMiA8PSBjMikge1xyXG4gICAgICAgICAgICAvL2NlbnRyYWwgY2xhc3NcclxuICAgICAgICAgICAgaWYgKGNjICE9IHVuZGVmaW5lZCAmJiBzMiA+IGNjIC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uL2xlZ2VuZC9TaXplTGVnZW5kLmpzJ1xyXG5leHBvcnQgeyBPcmllbnRhdGlvbkxlZ2VuZCwgb3JpZW50YXRpb25MZWdlbmQgfSBmcm9tICcuL2xlZ2VuZC9PcmllbnRhdGlvbkxlZ2VuZC5qcydcclxuZXhwb3J0IHsgVGVybmFyeUxlZ2VuZCB9IGZyb20gJy4vbGVnZW5kL1Rlcm5hcnlMZWdlbmQuanMnXHJcblxyXG4vLyBleHBvcnQgeyBnb1RvU3RyYWlnaHQsIHpvb21UbyB9IGZyb20gXCIuL3V0aWxzL3pvb21VdGlsc1wiXHJcbmV4cG9ydCAqIGZyb20gJy4vdXRpbHMvc3RyZXRjaGluZy5qcydcclxuZXhwb3J0ICogZnJvbSAnLi91dGlscy9zY2FsZS5qcydcclxuZXhwb3J0ICogZnJvbSAnLi91dGlscy90ZXJuYXJ5LmpzJ1xyXG5leHBvcnQgeyBuaWNlIH0gZnJvbSAnLi91dGlscy91dGlscy5qcydcclxuXHJcbmltcG9ydCB7IEdlb0NhbnZhcyB9IGZyb20gJy4vY29yZS9HZW9DYW52YXMuanMnXHJcbmV4cG9ydCBjb25zdCBnZXRQYXJhbWV0ZXJCeU5hbWUgPSBHZW9DYW52YXMuZ2V0UGFyYW1ldGVyQnlOYW1lXHJcblxyXG4vLyBzZXQgZGVmYXVsdCBkMyBsb2NhbGVcclxuaW1wb3J0IHsgZm9ybWF0RGVmYXVsdExvY2FsZSB9IGZyb20gJ2QzLWZvcm1hdCdcclxuZm9ybWF0RGVmYXVsdExvY2FsZSh7XHJcbiAgICBkZWNpbWFsOiAnLicsXHJcbiAgICB0aG91c2FuZHM6ICcgJyxcclxuICAgIGdyb3VwaW5nOiBbM10sXHJcbiAgICBjdXJyZW5jeTogWycnLCAn4oKsJ10sXHJcbn0pXHJcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/dist/gridviz.min.js b/dist/gridviz.min.js index 7481a262b..4af8e5ceb 100644 --- a/dist/gridviz.min.js +++ b/dist/gridviz.min.js @@ -1,2 +1,2 @@ /*! For license information please see gridviz.min.js.LICENSE.txt */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gridviz=e():t.gridviz=e()}(self,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(){}function n(t){return null==t?r:function(){return this.querySelector(t)}}function o(){return[]}function i(t){return null==t?o:function(){return this.querySelectorAll(t)}}function a(t){return function(){return this.matches(t)}}function u(t){return function(e){return e.matches(t)}}t.r(e),t.d(e,{BackgroundLayer:()=>dl,BackgroundLayerImage:()=>Ml,BackgroundLayerWMS:()=>_l,CSVGrid:()=>Wo,ColorCategoryLegend:()=>Cs,ColorDiscreteLegend:()=>Ss,ColorLegend:()=>ps,CompositionStyle:()=>Ri,Dataset:()=>$n,DotDensityStyle:()=>Ya,GeoCanvas:()=>Dr,GeoJSONLayer:()=>rs,GridLayer:()=>cl,ImageStyle:()=>Kc,IsoFenceStyle:()=>Bc,JSGrid:()=>Jo,JoyPlotStyle:()=>_i,LabelLayer:()=>$l,Layer:()=>Nn,LegoStyle:()=>Bu,Map:()=>dn,MosaicStyle:()=>cc,MultiResolutionDataset:()=>Xn,NinjaStarStyle:()=>bc,OrientationLegend:()=>ef,PillarStyle:()=>la,SegmentStyle:()=>$i,ShapeColorSizeStyle:()=>ai,SideCategoryStyle:()=>ka,SideStyle:()=>ma,SizeLegend:()=>Ws,SquareColorCategoryWebGLStyle:()=>nu,SquareColorWebGLStyle:()=>Qu,StrokeStyle:()=>vi,Style:()=>Cn,TanakaStyle:()=>ku,TernaryLegend:()=>ff,TextStyle:()=>Qi,TiledGrid:()=>To,TimeSeriesStyle:()=>kc,circularInverseScale:()=>mf,circularScale:()=>bf,classifier:()=>xu,colorClassifier:()=>Su,discreteColors:()=>Ou,exponentialScale:()=>yf,getParameterByName:()=>th,logarithmicScale:()=>pf,nice:()=>Ms,orientationLegend:()=>rf,powerInverseScale:()=>df,powerScale:()=>vf,sizeDiscreteLegend:()=>Ys,sizeDiscreteViewScaleLegend:()=>Hs,sizeLegend:()=>Us,sizeLegendViewScale:()=>$s,ternaryClassifier:()=>Df,ternaryColorClassifier:()=>Gf,viewScale:()=>du,viewScaleColor:()=>mu,viewScaleColorQuantile:()=>gu,viewScaleCombination:()=>wu,viewScaleQuantile:()=>bu});var c=Array.prototype.find;function l(){return this.firstElementChild}var s=Array.prototype.filter;function f(){return Array.from(this.children)}function h(t){return new Array(t.length)}function y(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function p(t,e,r,n,o,i){for(var a,u=0,c=e.length,l=i.length;ue?1:t>=e?0:NaN}y.prototype={constructor:y,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var g="http://www.w3.org/1999/xhtml";const w={svg:"http://www.w3.org/2000/svg",xhtml:g,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function x(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),w.hasOwnProperty(e)?{space:w[e],local:t}:t}function S(t){return function(){this.removeAttribute(t)}}function O(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _(t,e){return function(){this.setAttribute(t,e)}}function j(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function P(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}function k(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function E(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function T(t){return function(){this.style.removeProperty(t)}}function C(t,e,r){return function(){this.style.setProperty(t,e,r)}}function A(t,e,r){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function M(t,e){return t.style.getPropertyValue(e)||E(t).getComputedStyle(t,null).getPropertyValue(e)}function z(t){return function(){delete this[t]}}function L(t,e){return function(){this[t]=e}}function R(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}function I(t){return t.trim().split(/^|\s+/)}function F(t){return t.classList||new N(t)}function N(t){this._node=t,this._names=I(t.getAttribute("class")||"")}function B(t,e){for(var r=F(t),n=-1,o=e.length;++n=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var st=[null];function ft(t,e){this._groups=t,this._parents=e}function ht(){return new ft([[document.documentElement]],st)}ft.prototype=ht.prototype={constructor:ft,select:function(t){"function"!=typeof t&&(t=n(t));for(var e=this._groups,r=e.length,o=new Array(r),i=0;i=j&&(j=_+1);!(O=x[j])&&++j=0;)(n=o[i])&&(a&&4^n.compareDocumentPosition(a)&&a.parentNode.insertBefore(n,a),a=n);return this},sort:function(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=m);for(var r=this._groups,n=r.length,o=new Array(n),i=0;i1?this.each((null==e?T:"function"==typeof e?A:C)(t,e,null==r?"":r)):M(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?z:"function"==typeof e?R:L)(t,e)):this.node()[t]},classed:function(t,e){var r=I(t+"");if(arguments.length<2){for(var n=F(this.node()),o=-1,i=r.length;++o=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?at:it,n=0;n{}};function dt(){for(var t,e=0,r=arguments.length,n={};e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,u=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var r,n,o=new Array(r),i=0;i=0&&e._call.call(void 0,t),e=e._next;--Et}()}finally{Et=0,function(){for(var t,e,r=Pt,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:Pt=e);kt=t,Ut(n)}(),zt=0}}function Wt(){var t=Rt.now(),e=t-Mt;e>At&&(Lt-=e,Mt=t)}function Ut(t){Et||(Tt&&(Tt=clearTimeout(Tt)),t-zt>24?(t<1/0&&(Tt=setTimeout(Gt,t-Rt.now()-Lt)),Ct&&(Ct=clearInterval(Ct))):(Ct||(Mt=Rt.now(),Ct=setInterval(Wt,At)),Et=1,It(Gt)))}function $t(t,e,r){var n=new Bt;return e=null==e?0:+e,n.restart((r=>{n.stop(),t(r+e)}),e,r),n}Bt.prototype=Dt.prototype={constructor:Bt,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?Ft():+r)+(null==e?0:+e),this._next||kt===this||(kt?kt._next=this:Pt=this,kt=this),this._call=t,this._time=r,Ut()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ut())}};var Yt=wt("start","end","cancel","interrupt"),Ht=[],Vt=0,qt=2,Xt=3,Zt=5,Jt=6;function Kt(t,e,r,n,o,i){var a=t.__transition;if(a){if(r in a)return}else t.__transition={};!function(t,e,r){var n,o=t.__transition;function i(c){var l,s,f,h;if(1!==r.state)return u();for(l in o)if((h=o[l]).name===r.name){if(h.state===Xt)return $t(i);4===h.state?(h.state=Jt,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[l]):+lVt)throw new Error("too late; already scheduled");return r}function te(t,e){var r=ee(t,e);if(r.state>Xt)throw new Error("too late; already running");return r}function ee(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function re(t,e){var r,n,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(r=i[o]).name===e?(n=r.state>qt&&r.state180?e+=360:e-t>180&&(t+=360),i.push({i:r.push(o(r)+"rotate(",null,n)-2,x:ne(t,e)})):e&&r.push(o(r)+"rotate("+e+n)}(i.rotate,a.rotate,u,c),function(t,e,r,i){t!==e?i.push({i:r.push(o(r)+"skewX(",null,n)-2,x:ne(t,e)}):e&&r.push(o(r)+"skewX("+e+n)}(i.skewX,a.skewX,u,c),function(t,e,r,n,i,a){if(t!==r||e!==n){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:ne(t,r)},{i:u-2,x:ne(e,n)})}else 1===r&&1===n||i.push(o(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,u,c),i=a=null,function(t){for(var e,r=-1,n=c.length;++r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?Le(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?Le(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Oe.exec(t))?new Fe(e[1],e[2],e[3],1):(e=_e.exec(t))?new Fe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=je.exec(t))?Le(e[1],e[2],e[3],e[4]):(e=Pe.exec(t))?Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ke.exec(t))?Ue(e[1],e[2]/100,e[3]/100,1):(e=Ee.exec(t))?Ue(e[1],e[2]/100,e[3]/100,e[4]):Te.hasOwnProperty(t)?ze(Te[t]):"transparent"===t?new Fe(NaN,NaN,NaN,0):null}function ze(t){return new Fe(t>>16&255,t>>8&255,255&t,1)}function Le(t,e,r,n){return n<=0&&(t=e=r=NaN),new Fe(t,e,r,n)}function Re(t){return t instanceof de||(t=Me(t)),t?new Fe((t=t.rgb()).r,t.g,t.b,t.opacity):new Fe}function Ie(t,e,r,n){return 1===arguments.length?Re(t):new Fe(t,e,r,null==n?1:n)}function Fe(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function Ne(){return`#${We(this.r)}${We(this.g)}${We(this.b)}`}function Be(){const t=De(this.opacity);return`${1===t?"rgb(":"rgba("}${Ge(this.r)}, ${Ge(this.g)}, ${Ge(this.b)}${1===t?")":`, ${t})`}`}function De(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ge(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function We(t){return((t=Ge(t))<16?"0":"")+t.toString(16)}function Ue(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Ye(t,e,r,n)}function $e(t){if(t instanceof Ye)return new Ye(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Me(t)),!t)return new Ye;if(t instanceof Ye)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),i=Math.max(e,r,n),a=NaN,u=i-o,c=(i+o)/2;return u?(a=e===i?(r-n)/u+6*(r0&&c<1?0:a,new Ye(a,u,c,t.opacity)}function Ye(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function He(t){return(t=(t||0)%360)<0?t+360:t}function Ve(t){return Math.max(0,Math.min(1,t||0))}function qe(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function Xe(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+a*o)/6}pe(de,Me,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ce,formatHex:Ce,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return $e(this).formatHsl()},formatRgb:Ae,toString:Ae}),pe(Fe,Ie,ve(de,{brighter(t){return t=null==t?me:Math.pow(me,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?be:Math.pow(be,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Fe(Ge(this.r),Ge(this.g),Ge(this.b),De(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ne,formatHex:Ne,formatHex8:function(){return`#${We(this.r)}${We(this.g)}${We(this.b)}${We(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Be,toString:Be})),pe(Ye,(function(t,e,r,n){return 1===arguments.length?$e(t):new Ye(t,e,r,null==n?1:n)}),ve(de,{brighter(t){return t=null==t?me:Math.pow(me,t),new Ye(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?be:Math.pow(be,t),new Ye(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new Fe(qe(t>=240?t-240:t+120,o,n),qe(t,o,n),qe(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new Ye(He(this.h),Ve(this.s),Ve(this.l),De(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=De(this.opacity);return`${1===t?"hsl(":"hsla("}${He(this.h)}, ${100*Ve(this.s)}%, ${100*Ve(this.l)}%${1===t?")":`, ${t})`}`}}));const Ze=t=>()=>t;function Je(t,e){var r=e-t;return r?function(t,e){return function(r){return t+r*e}}(t,r):Ze(isNaN(t)?e:t)}const Ke=function t(e){var r=function(t){return 1==(t=+t)?Je:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):Ze(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=Ie(t)).r,(e=Ie(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=Je(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return n.gamma=t,n}(1);function Qe(t){return function(e){var r,n,o=e.length,i=new Array(o),a=new Array(o),u=new Array(o);for(r=0;r=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,u=ni&&(o=e.slice(i,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(n=n[0])?u[a]?u[a]+=n:u[++a]=n:(u[++a]=null,c.push({i:a,x:ne(r,n)})),i=er.lastIndex;return i=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Qt:te;return function(){var a=i(this,t),u=a.on;u!==n&&(o=(n=u).copy()).on(e,r),a.on=o}}(r,t,e))},attr:function(t,e){var r=x(t),n="transform"===r?se:nr;return this.attrTween(t,"function"==typeof e?(r.local?lr:cr)(r,n,ye(this,"attr."+t,e)):null==e?(r.local?ir:or)(r):(r.local?ur:ar)(r,n,e))},attrTween:function(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;var n=x(t);return this.tween(r,(n.local?sr:fr)(n,e))},style:function(t,e,r){var n="transform"==(t+="")?le:nr;return null==e?this.styleTween(t,function(t,e){var r,n,o;return function(){var i=M(this,t),a=(this.style.removeProperty(t),M(this,t));return i===a?null:i===r&&a===n?o:o=e(r=i,n=a)}}(t,n)).on("end.style."+t,br(t)):"function"==typeof e?this.styleTween(t,function(t,e,r){var n,o,i;return function(){var a=M(this,t),u=r(this),c=u+"";return null==u&&(this.style.removeProperty(t),c=u=M(this,t)),a===c?null:a===n&&c===o?i:(o=c,i=e(n=a,u))}}(t,n,ye(this,"style."+t,e))).each(function(t,e){var r,n,o,i,a="style."+e,u="end."+a;return function(){var c=te(this,t),l=c.on,s=null==c.value[a]?i||(i=br(e)):void 0;l===r&&o===s||(n=(r=l).copy()).on(u,o=s),c.on=n}}(this._id,t)):this.styleTween(t,function(t,e,r){var n,o,i=r+"";return function(){var a=M(this,t);return a===i?null:a===n?o:o=e(n=a,r)}}(t,n,e),r).on("end.style."+t,null)},styleTween:function(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;return this.tween(n,function(t,e,r){var n,o;function i(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&function(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}(t,i,r)),n}return i._value=e,i}(t,e,null==r?"":r))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(ye(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,r;function n(){var n=t.apply(this,arguments);return n!==r&&(e=(r=n)&&function(t){return function(e){this.textContent=t.call(this,e)}}(n)),e}return n._value=t,n}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n,o=ee(this.node(),r).tween,i=0,a=o.length;i()=>t;function jr(t,{sourceEvent:e,target:r,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function Pr(t,e,r){this.k=t,this.x=e,this.y=r}Pr.prototype={constructor:Pr,scale:function(t){return 1===t?this:new Pr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Pr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var kr=new Pr(1,0,0);function Er(t){t.stopImmediatePropagation()}function Tr(t){t.preventDefault(),t.stopImmediatePropagation()}function Cr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Ar(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Mr(){return this.__zoom||kr}function zr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Lr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Rr(t,e,r){var n=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],i=t.invertY(e[0][1])-r[0][1],a=t.invertY(e[1][1])-r[1][1];return t.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Ir(t){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ir(t)}function Fr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.opts=a||{},this.canvas=e,this.w=this.canvas.offsetWidth,this.h=this.canvas.offsetHeight,this.offscreenCanvas=document.createElement("canvas"),this.offscreenCanvas.width=this.w,this.offscreenCanvas.height=this.h;var u=this.canvas.getContext("2d"),c=this.offscreenCanvas.getContext("2d");if(!u)throw"Impossible to create canvas 2D context";if(!c)throw"Impossible to create canvas 2D context";if(this.ctx=u,this.offscreenCtx=c,this.view={x:n,y:o,z:i},this.backgroundColor=a.backgroundColor||"white",this.onZoomStartFun=a.onZoomStartFun,this.onZoomEndFun=a.onZoomEndFun,this.onZoomFun=a.onZoomFun,this.extGeo={xMin:NaN,xMax:NaN,yMin:NaN,yMax:NaN},this.updateExtentGeo(),!a.disableZoom){var l=kr;(function(){var t,e,r,n=Cr,o=Ar,i=Rr,a=zr,u=Lr,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,f=_t,h=wt("start","zoom","end"),y=500,p=150,v=0,d=10;function b(t){t.property("__zoom",Mr).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",P).filter(u).on("touchstart.zoom",k).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(t,e){return(e=Math.max(c[0],Math.min(c[1],e)))===t.k?t:new Pr(e,t.x,t.y)}function g(t,e,r){var n=e[0]-r[0]*t.k,o=e[1]-r[1]*t.k;return n===t.x&&o===t.y?t:new Pr(t.k,n,o)}function w(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,e,r,n){t.on("start.zoom",(function(){S(this,arguments).event(n).start()})).on("interrupt.zoom end.zoom",(function(){S(this,arguments).event(n).end()})).tween("zoom",(function(){var t=this,i=arguments,a=S(t,i).event(n),u=o.apply(t,i),c=null==r?w(u):"function"==typeof r?r.apply(t,i):r,l=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),s=t.__zoom,h="function"==typeof e?e.apply(t,i):e,y=f(s.invert(c).concat(l/s.k),h.invert(c).concat(l/h.k));return function(t){if(1===t)t=h;else{var e=y(t),r=l/e[2];t=new Pr(r,c[0]-e[0]*r,c[1]-e[1]*r)}a.zoom(null,t)}}))}function S(t,e,r){return!r&&t.__zooming||new O(t,e)}function O(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(t,e),this.taps=0}function _(t,...e){if(n.apply(this,arguments)){var r=S(this,e).event(t),o=this.__zoom,u=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,a.apply(this,arguments)))),s=jt(t);if(r.wheel)r.mouse[0][0]===s[0]&&r.mouse[0][1]===s[1]||(r.mouse[1]=o.invert(r.mouse[0]=s)),clearTimeout(r.wheel);else{if(o.k===u)return;r.mouse=[s,o.invert(s)],re(this),r.start()}Tr(t),r.wheel=setTimeout((function(){r.wheel=null,r.end()}),p),r.zoom("mouse",i(g(m(o,u),r.mouse[0],r.mouse[1]),r.extent,l))}}function j(t,...e){if(!r&&n.apply(this,arguments)){var o=t.currentTarget,a=S(this,e,!0).event(t),u=pt(t.view).on("mousemove.zoom",(function(t){if(Tr(t),!a.moved){var e=t.clientX-s,r=t.clientY-f;a.moved=e*e+r*r>v}a.event(t).zoom("mouse",i(g(a.that.__zoom,a.mouse[0]=jt(t,o),a.mouse[1]),a.extent,l))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),function(t,e){var r=t.document.documentElement,n=pt(t).on("dragstart.drag",null);e&&(n.on("click.drag",St,xt),setTimeout((function(){n.on("click.drag",null)}),0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}(t.view,a.moved),Tr(t),a.event(t).end()}),!0),c=jt(t,o),s=t.clientX,f=t.clientY;!function(t){var e=t.document.documentElement,r=pt(t).on("dragstart.drag",St,xt);"onselectstart"in e?r.on("selectstart.drag",St,xt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),Er(t),a.mouse=[c,this.__zoom.invert(c)],re(this),a.start()}}function P(t,...e){if(n.apply(this,arguments)){var r=this.__zoom,a=jt(t.changedTouches?t.changedTouches[0]:t,this),u=r.invert(a),c=r.k*(t.shiftKey?.5:2),f=i(g(m(r,c),a,u),o.apply(this,e),l);Tr(t),s>0?pt(this).transition().duration(s).call(x,f,a,t):pt(this).call(b.transform,f,a,t)}}function k(r,...o){if(n.apply(this,arguments)){var i,a,u,c,l=r.touches,s=l.length,f=S(this,o,r.changedTouches.length===s).event(r);for(Er(r),a=0;a=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(a.targetTouches);try{for(f.s();!(u=f.n()).done;){var h=u.value;c+=h.clientX,s+=h.clientY}}catch(t){f.e(t)}finally{f.f()}c/=a.targetTouches.length,s/=a.targetTouches.length,r.zoom(n,r.pixToGeoX(c),r.pixToGeoY(s))}}l=e,r.onZoomFun&&r.onZoomFun(t)})).on("start",(function(t){var e;r.canvasSave.c=document.createElement("canvas"),r.canvasSave.c.setAttribute("width",""+r.w),r.canvasSave.c.setAttribute("height",""+r.h),null===(e=r.canvasSave.c.getContext("2d"))||void 0===e||e.drawImage(r.canvas,0,0),r.canvasSave.dx=0,r.canvasSave.dy=0,r.canvasSave.f=1,r.onZoomStartFun&&r.onZoomStartFun(t)})).on("end",(function(t){r.redraw(),r.canvasSave={c:null,dx:0,dy:0,f:1},r.onZoomEndFun&&r.onZoomEndFun(t)}))(pt(this.canvas))}this.xMin=a.centerExtent?a.centerExtent[0]:void 0,this.yMin=a.centerExtent?a.centerExtent[1]:void 0,this.xMax=a.centerExtent?a.centerExtent[2]:void 0,this.yMax=a.centerExtent?a.centerExtent[3]:void 0,this.zoomExtent=a.zoomExtent||[0,1/0],this.canvasSave={c:null,dx:0,dy:0,f:1}}return e=t,r=[{key:"getView",value:function(){return this.view}},{key:"setCenterExtent",value:function(t){this.xMin=t[0],this.yMin=t[1],this.xMax=t[2],this.yMax=t[3]}},{key:"getCenterExtent",value:function(){return[this.xMin,this.yMin,this.xMax,this.yMax]}},{key:"setZoomExtent",value:function(t){this.zoomExtent=t}},{key:"getZoomExtent",value:function(){return this.zoomExtent}},{key:"initCanvasTransform",value:function(){this.ctx.setTransform(1,0,0,1,0,0),this.offscreenCtx.setTransform(1,0,0,1,0,0)}},{key:"setCanvasTransform",value:function(){var t=1/this.view.z,e=-this.view.x/this.view.z+.5*this.w,r=this.view.y/this.view.z+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,r),this.offscreenCtx.setTransform(t,0,0,-t,e,r)}},{key:"getWebGLTransform",value:function(){var t=2/(this.w*this.view.z),e=2/(this.h*this.view.z);return[t,0,0,0,e,0,-t*this.view.x,-e*this.view.y,1]}},{key:"redraw",value:function(){throw new Error("Method redraw not implemented.")}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"white";this.opts.transparentBackground?(this.ctx.clearRect(0,0,this.w,this.h),this.offscreenCtx.clearRect(0,0,this.w,this.h)):(this.ctx&&(this.ctx.fillStyle=t),this.offscreenCtx&&(this.offscreenCtx.fillStyle=t),this.ctx.fillRect(0,0,this.w,this.h),this.offscreenCtx.fillRect(0,0,this.w,this.h))}},{key:"pan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null!=this.xMin&&this.view.x+tthis.xMax&&(t=this.xMax-this.view.x),null!=this.yMax&&this.view.y+e>this.yMax&&(e=this.yMax-this.view.y),this.view.x+=t,this.view.y+=e,this.updateExtentGeo(),this.canvasSave.c){var r=1/this.view.z;this.canvasSave.dx-=t*r,this.canvasSave.dy+=e*r,this.clear(this.backgroundColor),this.offscreenCtx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy),this.ctx.drawImage(this.offscreenCtx.canvas,0,0)}else console.log("no canvas save")}},{key:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.view.x,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.view.y;if(!(this.zoomExtent[0]==this.view.z&&t<=1||this.zoomExtent[1]==this.view.z&&t>=1)){var n=t*this.view.z;nthis.zoomExtent[1]&&(t=this.zoomExtent[1]/this.view.z),this.view.z*=t;var o=(e-this.view.x)*(1-t),i=(r-this.view.y)*(1-t);null!=this.xMin&&this.view.x+othis.xMax&&(o=this.xMax-this.view.x),null!=this.yMax&&this.view.y+i>this.yMax&&(i=this.yMax-this.view.y),this.view.x+=o,this.view.y+=i,this.updateExtentGeo(),this.canvasSave.c&&(this.clear(this.backgroundColor),this.canvasSave.f/=t,this.canvasSave.dx=this.geoToPixX(e)*(1-this.canvasSave.f),this.canvasSave.dy=this.geoToPixY(r)*(1-this.canvasSave.f),this.offscreenCtx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy,this.canvasSave.f*this.canvasSave.c.width,this.canvasSave.f*this.canvasSave.c.height),this.ctx.drawImage(this.offscreenCanvas,0,0,this.canvas.width,this.canvas.height))}}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.extGeo={xMin:this.pixToGeoX(-t),xMax:this.pixToGeoX(this.w+t),yMin:this.pixToGeoY(this.h+t),yMax:this.pixToGeoY(-t)},this.extGeo}},{key:"toDraw",value:function(t){return!(t.xthis.extGeo.xMax||t.ythis.extGeo.yMax)}},{key:"geoToPixX",value:function(t){return(t-this.view.x)/this.view.z+.5*this.w}},{key:"geoToPixY",value:function(t){return-(t-this.view.y)/this.view.z+.5*this.h}},{key:"pixToGeoX",value:function(t){return(t-.5*this.w)*this.view.z+this.view.x}},{key:"pixToGeoY",value:function(t){return-(t-.5*this.h)*this.view.z+this.view.y}},{key:"setViewFromURL",value:function(){var e=t.getParameterByName("x"),r=t.getParameterByName("y"),n=t.getParameterByName("z");null==e||null==e||isNaN(+e)||(this.view.x=+e),null==r||null==r||isNaN(+r)||(this.view.y=+r),null==n||null==n||isNaN(+n)||(this.view.z=+n)}}],n=[{key:"getParameterByName",value:function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return e?decodeURIComponent(e[1].replace(/\+/g," ")):null}}],r&&Nr(e.prototype,r),n&&Nr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Gr(t){return Gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gr(t)}function Wr(t,e){for(var r=0;re.left+n-r.clientWidth){var i=t.x-r.clientWidth-this.xOffset;if(r.style.left=i+"px",r.offsetLeft+r.clientWidth>t.x){var a=t.x-r.clientWidth-this.xOffset;r.style.left=a+"px"}}r.offsetTop+r.clientHeight>e.top+o&&(r.style.top=r.offsetTop-r.clientHeight+"px"),r.offsetTop0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.map=e.map,this.parentNode=e.parentNode||e.map.container,e.id&&(this.div=pt("#"+e.id)),this.div&&!this.div.empty()||(this.div=pt(document.createElement("div")),e.id&&this.div.attr("id",e.id)),e.title&&this.div.attr("title",e.title),e.class&&this.div.attr("class",e.class),e.onClickFunction&&this.div.on("click",e.onClickFunction),this.style("box-shadow","0 7px 8px rgba(0,47,103,.08), 0 0 22px rgba(0,47,103,.04), 0 12px 17px rgba(0,47,103,.04), 0 -4px 4px rgba(0,47,103,.04)"),this.style("background-color","#ffffff"),this.style("position","absolute"),this.style("cursor","pointer"),this.style("display","flex"),this.style("justify-content","center"),this.style("align-items","center"),this.style("width","30px"),this.style("height","30px"),this.parentNode.appendChild(this.div.node())},(e=[{key:"style",value:function(t,e){return this.div.style(t,e),this}}])&&Hr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Xr(t){return Xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xr(t)}function Zr(t,e){for(var r=0;r