From d391affb8c21e870f27262af87cc6b9233db2a0c Mon Sep 17 00:00:00 2001 From: joewdavies Date: Fri, 10 Jan 2025 14:11:32 +0100 Subject: [PATCH] add flow labelling --- build/eurostatmap.js | 82 ++++++++++++------------- src/maptypes/map-flow.js | 84 +++++++++++++------------- test/map-types/flow-map/test_flow.html | 2 +- 3 files changed, 84 insertions(+), 84 deletions(-) diff --git a/build/eurostatmap.js b/build/eurostatmap.js index 10f22ffc..b2a3aad2 100644 --- a/build/eurostatmap.js +++ b/build/eurostatmap.js @@ -20695,8 +20695,8 @@ const map = function (config) { //create map object to return, using the template const out = _core_stat_map__WEBPACK_IMPORTED_MODULE_2__.statMap(config, true) out.strokeWidthScale = (0,d3__WEBPACK_IMPORTED_MODULE_1__.scaleLinear)() - out.labelOffsetX = 10 - out.labelOffsetY = 0 + out.labelOffsetX = 15 + out.labelOffsetY = 5 out.labelFormatter = (d) => (0,d3__WEBPACK_IMPORTED_MODULE_1__.format)('.2s')(d) /** @@ -20772,13 +20772,13 @@ const map = function (config) { // Add flow gradients addFlowGradients(defs, gradientIds, links) - // Add geographical layers - //addGeographicalLayers(svg, geometries, poi, exporters, countryBorders) - // Define our container SVG const zoomGroup = (0,d3_selection__WEBPACK_IMPORTED_MODULE_4__["default"])('#em-zoom-group-' + out.svgId_) const sankeyContainer = zoomGroup.append('g').attr('class', 'sankey-container') + // Add geographical layers + addOverlayPolygons(sankeyContainer, graph) + // Add Sankey flows addSankeyFlows(sankeyContainer, links, arrowId, arrowOutlineId, gradientIds) @@ -20793,45 +20793,43 @@ const map = function (config) { /** * Adds geographical layers (regions, POI overlay, borders) - * @param {Object} svg - D3 selection of SVG - * @param {Array} geometries - Geographical shapes for regions - * @param {Object} poi - Points of interest data - * @param {Set} exporters - Exporters data - * @param {Array} countryBorders - Borders data + * @param {Object} svg - D3 selection of SVG container */ - function addGeographicalLayers(svg, geometries, poi, exporters, countryBorders) { - const path = out._pathFunction + function addOverlayPolygons(svg, graph) { + const importerIds = [] + const exporterIds = [] + + const features = out.Geometries.geoJSONs.nutsrg.concat(out.Geometries.geoJSONs.cntrg) + if (features) { + graph.nodes.forEach((node) => { + const overlay = features.find((feature) => { + if (node.id == feature.properties.id) return feature + }) - // Regions - svg.append('g') - .attr('class', 'regions') - .selectAll('path') - .data(geometries) - .join('path') - .attr('d', path) - .attr('fill', '#f4f4f4') - .attr('stroke', 'none') + if (overlay) { + let isImporter = graph.links.some((link) => link.source == node.id) + if (isImporter) { + importerIds.push(node.id) + } else { + exporterIds.push(node.id) + } + } else { + console.error('could not find geometry for', node.id) + } + }) - // Overlay for exporters and importers - svg.append('g') - .attr('class', 'importers-overlay') - .selectAll('path') - .data(poi.features) - .join('path') - .attr('d', path) - .attr('fill', (d) => (exporters.has(d.properties.id) ? '#c7e3c6' : '#bbd7ee')) - .attr('stroke', 'none') + //update existing region fills + let selector = out.geo_ === 'WORLD' ? '#em-worldrg path' : '#em-nutsrg path' + if (out.Geometries.userGeometries) selector = '#em-user-regions path' // for user-defined geometries + const allRegions = out.svg_.selectAll(selector) - // National borders - svg.append('g') - .attr('class', 'borders') - .selectAll('path') - .data(countryBorders) - .join('path') - .attr('d', path) - .attr('fill', 'none') - .attr('stroke', 'grey') - .attr('stroke-width', 0.3) + allRegions.each(function () { + ;(0,d3_selection__WEBPACK_IMPORTED_MODULE_4__["default"])(this).style('fill', (region) => { + if (importerIds.includes(region.properties.id)) return '#bbd7ee' + if (exporterIds.includes(region.properties.id)) return '#c7e3c6' + }) + }) + } } // if nodes in the graph dont have coordinates specified by the user then use nuts2json centroids instead @@ -20958,6 +20956,7 @@ const map = function (config) { */ function addLabels(svg, nodes) { // for aligning left or right + //TODO: get midpoint of flow source point, not map const mapMidpointX = svg.node().getBoundingClientRect().width / 2 svg.append('g') @@ -20965,6 +20964,7 @@ const map = function (config) { .selectAll('text') .data(nodes.filter((node) => node.targetLinks && node.sourceLinks.length == 0)) .join('text') + .attr('text-anchor', (d) => (d.x > mapMidpointX ? 'start' : 'end')) .attr('x', (d) => { const x = d.x return x > mapMidpointX ? x + out.labelOffsetX : x - out.labelOffsetX @@ -63242,4 +63242,4 @@ __webpack_require__.r(__webpack_exports__); /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXVyb3N0YXRtYXAuanMiLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsQ0FBQztBQUNELE87Ozs7Ozs7Ozs7Ozs7Ozs7OztBQ1ZBO0FBQzZHO0FBQ2pCO0FBQzVGLDhCQUE4QixtRkFBMkIsQ0FBQyw0RkFBcUM7QUFDL0Y7QUFDQTtBQUNBO0FBQ0E7QUFDQSxPQUFPLDBGQUEwRixZQUFZLGdEQUFnRCw2QkFBNkIsS0FBSyx1QkFBdUI7QUFDdE47QUFDQSxpRUFBZSx1QkFBdUIsRUFBQzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FDVnZDO0FBQzZHO0FBQ2pCO0FBQ1U7QUFDSTtBQUNEO0FBQ0E7QUFDSztBQUM5Ryw4QkFBOEIsbUZBQTJCLENBQUMsNEZBQXFDO0FBQy9GLDBCQUEwQixvRkFBaUM7QUFDM0QsMEJBQTBCLHdGQUFpQztBQUMzRCwwQkFBMEIsdUZBQWlDO0FBQzNELDBCQUEwQix1RkFBaUM7QUFDM0QsMEJBQTBCLDRGQUFpQztBQUMzRDtBQUNBO0FBQ0EsT0FBTyxrRUFBa0U7QUFDekU7QUFDQSxpRUFBZSx1QkFBdUIsRUFBQzs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQ2xCdkM7QUFDNkc7QUFDakI7QUFDNUYsOEJBQThCLG1GQUEyQixDQUFDLDRGQUFxQztBQUMvRjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QU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/IHBpIDogLXBpKSwgcGhpKSA6IDA7XG4gICAgICAgIGlmICghcG9pbnQwICYmICh2MDAgPSB2MCA9IHYpKSBzdHJlYW0ubGluZVN0YXJ0KCk7XG4gICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgaWYgKCFwb2ludDIgfHwgcG9pbnRFcXVhbChwb2ludDAsIHBvaW50MikgfHwgcG9pbnRFcXVhbChwb2ludDEsIHBvaW50MikpXG4gICAgICAgICAgICBwb2ludDFbMl0gPSAxO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgLy8gb3V0c2lkZSBnb2luZyBpblxuICAgICAgICAgICAgc3RyZWFtLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgcG9pbnQyID0gaW50ZXJzZWN0KHBvaW50MSwgcG9pbnQwKTtcbiAgICAgICAgICAgIHN0cmVhbS5wb2ludChwb2ludDJbMF0sIHBvaW50MlsxXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIGluc2lkZSBnb2luZyBvdXRcbiAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgICBzdHJlYW0ucG9pbnQocG9pbnQyWzBdLCBwb2ludDJbMV0sIDIpO1xuICAgICAgICAgICAgc3RyZWFtLmxpbmVFbmQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcG9pbnQwID0gcG9pbnQyO1xuICAgICAgICB9IGVsc2UgaWYgKG5vdEhlbWlzcGhlcmUgJiYgcG9pbnQwICYmIHNtYWxsUmFkaXVzIF4gdikge1xuICAgICAgICAgIHZhciB0O1xuICAgICAgICAgIC8vIElmIHRoZSBjb2RlcyBmb3IgdHdvIHBvaW50cyBhcmUgZGlmZmVyZW50LCBvciBhcmUgYm90aCB6ZXJvLFxuICAgICAgICAgIC8vIGFuZCB0aGVyZSB0aGlzIHNlZ21lbnQgaW50ZXJzZWN0cyB3aXRoIHRoZSBzbWFsbCBjaXJjbGUuXG4gICAgICAgICAgaWYgKCEoYyAmIGMwKSAmJiAodCA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCwgdHJ1ZSkpKSB7XG4gICAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgICBpZiAoc21hbGxSYWRpdXMpIHtcbiAgICAgICAgICAgICAgc3RyZWFtLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBzdHJlYW0ucG9pbnQodFswXVswXSwgdFswXVsxXSk7XG4gICAgICAgICAgICAgIHN0cmVhbS5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgc3RyZWFtLmxpbmVFbmQoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHN0cmVhbS5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgc3RyZWFtLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgc3RyZWFtLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBzdHJlYW0ucG9pbnQodFswXVswXSwgdFswXVsxXSwgMyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh2ICYmICghcG9pbnQwIHx8ICFwb2ludEVxdWFsKHBvaW50MCwgcG9pbnQxKSkpIHtcbiAgICAgICAgICBzdHJlYW0ucG9pbnQocG9pbnQxWzBdLCBwb2ludDFbMV0pO1xuICAgICAgICB9XG4gICAgICAgIHBvaW50MCA9IHBvaW50MSwgdjAgPSB2LCBjMCA9IGM7XG4gICAgICB9LFxuICAgICAgbGluZUVuZDogZnVuY3Rpb24oKSB7XG4gICAgICAgIGlmICh2MCkgc3RyZWFtLmxpbmVFbmQoKT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nB1c2goW2xhbWJkYSwgcGhpXSk7XG4gICAgICByaW5nU2luay5wb2ludChsYW1iZGEsIHBoaSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcmluZ1N0YXJ0KCkge1xuICAgICAgcmluZ1NpbmsubGluZVN0YXJ0KCk7XG4gICAgICByaW5nID0gW107XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcmluZ0VuZCgpIHtcbiAgICAgIHBvaW50UmluZyhyaW5nWzBdWzBdLCByaW5nWzBdWzFdKTtcbiAgICAgIHJpbmdTaW5rLmxpbmVFbmQoKTtcblxuICAgICAgdmFyIGNsZWFuID0gcmluZ1NpbmsuY2xlYW4oKSxcbiAgICAgICAgICByaW5nU2VnbWVudHMgPSByaW5nQnVmZmVyLnJlc3VsdCgpLFxuICAgICAgICAgIGksIG4gPSByaW5nU2VnbWVudHMubGVuZ3RoLCBtLFxuICAgICAgICAgIHNlZ21lbnQsXG4gICAgICAgICAgcG9pbnQ7XG5cbiAgICAgIHJpbmcucG9wKCk7XG4gICAgICBwb2x5Z29uLnB1c2gocmluZyk7XG4gICAgICByaW5nID0gbnVsbDtcblxuICAgICAgaWYgKCFuKSByZXR1cm47XG5cbiAgICAgIC8vIE5vIGludGVyc2VjdGlvbnMuXG4gICAgICBpZiAoY2xlYW4gJiAxKSB7XG4gICAgICAgIHNlZ21lbnQgPSByaW5nU2VnbWVudHNbMF07XG4gICAgICAgIGlmICgobSA9IHNlZ21lbnQubGVuZ3RoIC0gMSkgPiAwKSB7XG4gICAgICAgICAgaWYgKCFwb2x5Z29uU3RhcnRlZCkgc2luay5wb2x5Z29uU3RhcnQoKSwgcG9seWdvblN0YXJ0ZWQgPSB0cnVlO1xuICAgICAgICAgIHNpbmsubGluZVN0YXJ0KCk7XG4gICAgICAgICAgZm9yIChpID0gMDsgaSA8IG07ICsraSkgc2luay5wb2ludCgocG9pbnQgPSBzZWdtZW50W2ldKVswXSwgcG9pbnRbMV0pO1xuICAgICAgICAgIHNpbmsubGlu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gICAgYnkgPSBiWzFdLFxuICAgICAgdDAgPSAwLFxuICAgICAgdDEgPSAxLFxuICAgICAgZHggPSBieCAtIGF4LFxuICAgICAgZHkgPSBieSAtIGF5LFxuICAgICAgcjtcblxuICByID0geDAgLSBheDtcbiAgaWYgKCFkeCAmJiByID4gMCkgcmV0dXJuO1xuICByIC89IGR4O1xuICBpZiAoZHggPCAwKSB7XG4gICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgfSBlbHNlIGlmIChkeCA+IDApIHtcbiAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICB9XG5cbiAgciA9IHgxIC0gYXg7XG4gIGlmICghZHggJiYgciA8IDApIHJldHVybjtcbiAgciAvPSBkeDtcbiAgaWYgKGR4IDwgMCkge1xuICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gIH0gZWxzZSBpZiAoZHggPiAwKSB7XG4gICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgfVxuXG4gIHIgPSB5MCAtIGF5O1xuICBpZiAoIWR5ICYmIHIgPiAwKSByZXR1cm47XG4gIHIgLz0gZHk7XG4gIGlmIChkeSA8IDApIHtcbiAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICB9IGVsc2UgaWYgKGR5ID4gMCkge1xuICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gIH1cblxuICByID0geTEgLSBheTtcbiAgaWYgKCFkeSAmJiByIDwgMCkgcmV0dXJuO1xuICByIC89IGR5O1xuICBpZiAoZHkgPCAwKSB7XG4gICAgaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgfSBlbH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A/IGNhIC0gY2JcbiAgICAgICAgOiBjYSA9PT0gMCA/IGJbMV0gLSBhWzFdXG4gICAgICAgIDogY2EgPT09IDEgPyBhWzBdIC0gYlswXVxuICAgICAgICA6IGNhID09PSAyID8gYVsxXSAtIGJbMV1cbiAgICAgICAgOiBiWzBdIC0gYVswXTtcbiAgfVxuXG4gIHJldHVybiBmdW5jdGlvbihzdHJlYW0pIHtcbiAgICB2YXIgYWN0aXZlU3RyZWFtID0gc3RyZWFtLFxuICAgICAgICBidWZmZXJTdHJlYW0gPSBjbGlwQnVmZmVyKCksXG4gICAgICAgIHNlZ21lbnRzLFxuICAgICAgICBwb2x5Z29uLFxuICAgICAgICByaW5nLFxuICAgICAgICB4X18sIHlfXywgdl9fLCAvLyBmaXJzdCBwb2ludFxuICAgICAgICB4XywgeV8sIHZfLCAvLyBwcmV2aW91cyBwb2ludFxuICAgICAgICBmaXJzdCxcbiAgICAgICAgY2xlYW47XG5cbiAgICB2YXIgY2xpcFN0cmVhbSA9IHtcbiAgICAgIHBvaW50OiBwb2ludCxcbiAgICAgIGxpbmVTdGFydDogbGluZVN0YXJ0LFxuICAgICAgbGluZUVuZDogbGluZUVuZCxcbiAgICAgIHBvbHlnb25TdGFydDogcG9seWdvblN0YXJ0LFxuICAgICAgcG9seWdvbkVuZDogcG9seWdvbkVuZFxuICAgIH07XG5cbiAgICBmdW5jdGlvbiBwb2ludCh4LCB5KSB7XG4gICAgICBpZiAodmlzaWJsZSh4LCB5KSkgYWN0aXZlU3RyZWFtLnBvaW50KHgsIHkpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBvbHlnb25JbnNpZGUoKSB7XG4gICAgICB2YXIgd2luZGluZyA9IDA7XG5cbiAgICAgIGZvciAodmFyIGkgPSAwLCBuID0gcG9seWdvbi5sZW5ndGg7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgZm9yICh2YXIgcmluZyA9IHBvbHlnb25baV0sIGogPSAxLCBtID0gcmluZy5sZW5ndGgsIHB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H07XG4gICAgfSxcbiAgICBzZXQ6IGZ1bmN0aW9uIHNldCQkMShfcmVmMikge1xuICAgICAgdmFyIHggPSBfcmVmMi54LFxuICAgICAgICAgIHkgPSBfcmVmMi55O1xuXG4gICAgICB0aGlzLl9keCA9IHg7XG4gICAgICB0aGlzLl9keSA9IHk7XG4gICAgICB0aGlzLnVwZGF0ZU9mZnNldCgpO1xuICAgIH1cbiAgfSwge1xuICAgIGtleTogXCJwb3NpdGlvblwiLFxuICAgIGdldDogZnVuY3Rpb24gZ2V0JCQxKCkge1xuICAgICAgcmV0dXJuIHsgeDogdGhpcy5feCwgeTogdGhpcy5feSB9O1xuICAgIH0sXG4gICAgc2V0OiBmdW5jdGlvbiBzZXQkJDEoX3JlZjMpIHtcbiAgICAgIHZhciB4ID0gX3JlZjMueCxcbiAgICAgICAgICB5ID0gX3JlZjMueTtcblxuICAgICAgdGhpcy5feCA9IHg7XG4gICAgICB0aGlzLl95ID0geTtcbiAgICAgIHRoaXMudXBkYXRlUG9zaXRpb24oKTtcbiAgICB9XG4gIH0sIHtcbiAgICBrZXk6IFwidHJhbnNsYXRpb25cIixcbiAgICBnZXQ6IGZ1bmN0aW9uIGdldCQkMSgpIHtcbiAgICAgIHJldHVybiB7XG4gICAgICAgIHg6IHRoaXMuX3ggKyB0aGlzLl9keCxcbiAgICAgICAgeTogdGhpcy5feSArIHRoaXMuX2R5XG4gICAgICB9O1xuICAgIH1cbiAgfSwge1xuICAgIGtleTogXCJqc29uXCIsXG4gICAgZ2V0OiBmdW5jdGlvbiBnZXQkJDEoKSB7XG4gICAgICB2YXIganNvbiA9IHtcbiAgICAgICAgeDogdGhpcy5feCxcbiAgICAgICAgeTogdGhpcy5feSxcbiAgICAgICAgZHg6IHRoaXMuX2R4LFxuICAgICAgICBkeTogdGhpcy5fZHlcbiAgICAgIH07XG5cbiAgICAgIGlmICh0aGlzLmRhdGEgJiYgT2JqZWN0LmtleXModGhpcy5kYXRhKS5sZW5ndGggPiAwKSBqc29u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gIGFsaWduID0gdG9wQm90dG9tRHluYW1pYyhhbGlnbiwgb2Zmc2V0LngpO1xuICAgIGlmIChvZmZzZXQueSA8IDAgJiYgb3JpZW50YXRpb24gPT09IFwidG9wQm90dG9tXCIgfHwgb3JpZW50YXRpb24gPT09IFwidG9wXCIpIHtcbiAgICAgIHkgLT0gYmJveC5oZWlnaHQgKyBwYWRkaW5nO1xuICAgIH0gZWxzZSB7XG4gICAgICB5ICs9IHBhZGRpbmc7XG4gICAgfVxuXG4gICAgaWYgKGFsaWduID09PSBcIm1pZGRsZVwiKSB7XG4gICAgICB4IC09IGJib3gud2lkdGggLyAyO1xuICAgIH0gZWxzZSBpZiAoYWxpZ24gPT09IFwicmlnaHRcIikge1xuICAgICAgeCAtPSBiYm94LndpZHRoO1xuICAgIH1cbiAgfSBlbHNlIGlmIChvcmllbnRhdGlvbkxlZnRSaWdodC5pbmRleE9mKG9yaWVudGF0aW9uKSAhPT0gLTEpIHtcbiAgICBhbGlnbiA9IGxlZnRSaWdodER5bmFtaWMoYWxpZ24sIG9mZnNldC55KTtcbiAgICBpZiAob2Zmc2V0LnggPCAwICYmIG9yaWVudGF0aW9uID09PSBcImxlZnRSaWdodFwiIHx8IG9yaWVudGF0aW9uID09PSBcImxlZnRcIikge1xuICAgICAgeCAtPSBiYm94LndpZHRoICsgcGFkZGluZztcbiAgICB9IGVsc2Uge1xuICAgICAgeCArPSBwYWRkaW5nO1xuICAgIH1cblxuICAgIGlmIChhbGlnbiA9PT0gXCJtaWRkbGVcIikge1xuICAgICAgeSAtPSBiYm94LmhlaWdodCAvIDI7XG4gICAgfSBlbHNlIGlmIChhbGlnbiA9PT0gXCJ0b3BcIikge1xuICAgICAgeSAtPSBiYm94LmhlaWdodDtcbiAgICB9XG4gIH1cblxuICByZXR1cm4geyB4OiB4LCB5OiB5IH07XG59KTtcblxudmFyIGxpbmVCdWlsZGVyID0gZnVuY3Rpb24gbGluZUJ1aWxkZXIoX3JlZikge1xuICB2YXIgZGF0YS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gIXIpIHtcbiAgICAgIHRoaXMuXyArPSBcIkxcIiArICh0aGlzLl94MSA9IHgxKSArIFwiLFwiICsgKHRoaXMuX3kxID0geTEpO1xuICAgIH1cblxuICAgIC8vIE90aGVyd2lzZSwgZHJhdyBhbiBhcmMhXG4gICAgZWxzZSB7XG4gICAgICB2YXIgeDIwID0geDIgLSB4MCxcbiAgICAgICAgICB5MjAgPSB5MiAtIHkwLFxuICAgICAgICAgIGwyMV8yID0geDIxICogeDIxICsgeTIxICogeTIxLFxuICAgICAgICAgIGwyMF8yID0geDIwICogeDIwICsgeTIwICogeTIwLFxuICAgICAgICAgIGwyMSA9IE1hdGguc3FydChsMjFfMiksXG4gICAgICAgICAgbDAxID0gTWF0aC5zcXJ0KGwwMV8yKSxcbiAgICAgICAgICBsID0gciAqIE1hdGgudGFuKChwaSAtIE1hdGguYWNvcygobDIxXzIgKyBsMDFfMiAtIGwyMF8yKSAvICgyICogbDIxICogbDAxKSkpIC8gMiksXG4gICAgICAgICAgdDAxID0gbCAvIGwwMSxcbiAgICAgICAgICB0MjEgPSBsIC8gbDIxO1xuXG4gICAgICAvLyBJZiB0aGUgc3RhcnQgdGFuZ2VudCBpcyBub3QgY29pbmNpZGVudCB3aXRoICh4MCx5MCksIGxpbmUgdG8uXG4gICAgICBpZiAoTWF0aC5hYnModDAxIC0gMSkgPiBlcHNpbG9uKSB7XG4gICAgICAgIHRoaXMuXyArPSBcIkxcIiArICh4MSArIHQwMSAqIHgwMSkgKyBcIixcIiArICh5MSArIHQwMSAqIHkwMSk7XG4gICAgICB9XG5cbiAgICAgIHRoaXMuXyArPSBcIkFcIiArIHIgKyBcIixcIiArIHIgKyBcIiwwLDAsXCIgKyAoKyh5MDEgKiB4MjAgPiB4MDEgKiB5MjApKSArIFwiLFwiICsgKHRoaXMuX3gxID0geDEgKyB0MjEgKiB4MjEpICsgXCIsXCIgKyAodGhpcy5feTEgPSB5MSArIHQyMSAqIHkyMSk7XG4gICAgfVxuICB9LFxuICBhc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pICYmIChwYWRSYWRpdXMgPyArcGFkUmFkaXVzLmFwcGx5KHRoaXMsIGFyZ3VtZW50cykgOiBNYXRoLnNxcnQocjAgKiByMCArIHIxICogcjEpKSxcbiAgICAgICAgICByYyA9IE1hdGgubWluKE1hdGguYWJzKHIxIC0gcjApIC8gMiwgK2Nvcm5lclJhZGl1cy5hcHBseSh0aGlzLCBhcmd1bWVudHMpKSxcbiAgICAgICAgICByYzAgPSByYyxcbiAgICAgICAgICByYzEgPSByYyxcbiAgICAgICAgICB0MCxcbiAgICAgICAgICB0MTtcblxuICAgICAgLy8gQXBwbHkgcGFkZGluZz8gTm90ZSB0aGF0IHNpbmNlIHIxIOKJpSByMCwgZGExIOKJpSBkYTAuXG4gICAgICBpZiAocnAgPiBlcHNpbG9uKSB7XG4gICAgICAgIHZhciBwMCA9IGFzaW4ocnAgLyByMCAqIE1hdGguc2luKGFwKSksXG4gICAgICAgICAgICBwMSA9IGFzaW4ocnAgLyByMSAqIE1hdGguc2luKGFwKSk7XG4gICAgICAgIGlmICgoZGEwIC09IHAwICogMikgPiBlcHNpbG9uKSBwMCAqPSAoY3cgPyAxIDogLTEpLCBhMDAgKz0gcDAsIGExMCAtPSBwMDtcbiAgICAgICAgZWxzZSBkYTAgPSAwLCBhMDAgPSBhMTAgPSAoYTAgKyBhMSkgLyAyO1xuICAgICAgICBpZiAoKGRhMSAtPSBwMSAqIDIpID4gZXBzaWxvbikgcDEgKj0gKGN3ID8gMSA6IC0xKSwgYTAxICs9IHAxLCBhMTEgLT0gcDE7XG4gICAgICAgIGVsc2UgZGExID0gMCwgYTAxID0gYTExID0gKGEwICsgYTEpIC8gMjtcbiAgICAgIH1cblxuICAgICAgdmFyIHgwMSA9IHIxICogTWF0aC5jb3MoYTAxKSxcbiAgICAgICAgICB5MDEgPSByMSAqIE1hdGguc2luKGEwMSksXG4gICAgICAgICAgeDEwID0gcjAgKiBNYXRoLmNvcyhhMTApLFxuICAgICAgICAgIHkxMCA9IHIwICogTWF0aC5zaW4oYTEwKTtcblxuICAgICAgLy8gQXBwbHkgcm91bmRlZCBjb3JuZXJzP1xuICAgICAgaWYgKHJjID4gZXBzaWxvbikge1xuICAgICAgICB2YXIgeDExID0gcjEgKiBNYXRoLmNvcyhhMTEpLFxuICAgICAgICAgICAgeTExID0gcjEgKiBNYXRoLnNpbihhMTEpLFxuICAgICAgICAgICAgeDAwID0gcjAgKiBNYXRoLmNvcyhhMDApLFxuICAgICAgICAgICAgeTAwID0gcjAgKiBNYXRoLnNpbihhMDApO1xuXG4gICAgICAgIC8vIFJlc3RyaWN0IHRoZSBjb3JuZXIgcmFkaXVzIGFjY29yZGluZyB0byB0aGUgc2VjdG9yIGFuZ2xlLlxuICAgICAgICBpZiAoZGEgPCBwaSkge1xuICAgICAgICAgIHZhciBvYyA9IGRhMCA+IGVwc2lsb24gPyBpbnRlcnNlY3QoeDAxLCB5MDEsIHgwMCwgeTAwLCB4MTEsIHkxMSwgeDEwLCB5MTApIDogW3gxMCwgeTEwXSxcbiAgICAgICAgICAgICAgYXggPSB4MDEgLSBvY1swXSxcbiAgICAgICAgICAgICAgYXkgPSB5MDEgLSBvY1sxXSxcbiAgICAgICAgICAgICAgYnggPSB4MTEgLSBvY1swXSxcbiAgICAgICAgICAgICAgYnkgPSB5MTEgLSBvY1sxXSxcbiAgICAgICAgICAgICAga2MgPSAxIC8gTWF0aC5zaW4oTWF0aC5hY29zKChheCAqIGJ4ICsgYXkgKiBieSkgLyAoTWF0aC5zcXJ0KGF4ICogYXggKyBheSAqIGF5KSAqIE1hdGguc3FydChieCAqIGJ4ICsgYnkgKiBieSkpKSAvIDIpLFxuICAgICAgICAgICAgICBsYyA9IE1hdGguc3FydChvY1swXSAqIG9jWzBdICsgb2NbMV0gKiBvY1sxXSk7XG4gICAgICAgICAgcmMwID0gTWF0aC5taW4ocmMsIChyMCAtIGxjKSAvIChrYyAtIDEpKTtcbiAgICAgICAgICByYzEgPSBNYXRoLm1pbihyYywgKHIxIC0gbGMpIC8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JhdzogZnVuY3Rpb24oY29udGV4dCwgc2l6ZSkge1xuICAgIHZhciByID0gTWF0aC5zcXJ0KHNpemUgLyA1KSAvIDI7XG4gICAgY29udGV4dC5tb3ZlVG8oLTMgKiByLCAtcik7XG4gICAgY29udGV4dC5saW5lVG8oLXIsIC1yKTtcbiAgICBjb250ZXh0LmxpbmVUbygtciwgLTMgKiByKTtcbiAgICBjb250ZXh0LmxpbmVUbyhyLCAtMyAqIHIpO1xuICAgIGNvbnRleHQubGluZVRvKHIsIC1yKTtcbiAgICBjb250ZXh0LmxpbmVUbygzICogciwgLXIpO1xuICAgIGNvbnRleHQubGluZVRvKDMgKiByLCByKTtcbiAgICBjb250ZXh0LmxpbmVUbyhyLCByKTtcbiAgICBjb250ZXh0LmxpbmVUbyhyLCAzICogcik7XG4gICAgY29udGV4dC5saW5lVG8oLXIsIDMgKiByKTtcbiAgICBjb250ZXh0LmxpbmVUbygtciwgcik7XG4gICAgY29udGV4dC5saW5lVG8oLTMgKiByLCByKTtcbiAgICBjb250ZXh0LmNsb3NlUGF0aCgpO1xuICB9XG59O1xuIiwidmFyIHRhbjMwID0gTWF0aC5zcXJ0KDEgLyAzKSxcbiAgICB0YW4zMF8yID0gdGFuMzAgKiAyO1xuXG5leHBvcnQgZGVmYXVsdCB7XG4gIGRyYXc6IGZ1bmN0aW9uKGNvbnRleHQsIHNpemUpIHtcbiAgICB2YXIgeSA9IE1hdGguc3FydChzaXplIC8gdGFuMzBfMiksXG4gICAgICAgIHggPSB5ICogdGFuMzA7XG4gICAgY29udGV4dC5tb3ZlVG8oMCwgLXkpO1xuICAgIGNvbnRleHQubGluZVRvKHgsIDApO1xuICAgIGNvbnRleHQubGluZVRvKDAsIHkpO1xuICAgIGNvbnRleHQubGluZVRvKC14LCAwKTtcbiAgICBjb250ZXh0LmNsb3NlUGF0aCgpO1xuICB9XG59O1xuIiwiZXhwb3J0IGRlZmF1bHQge1xuICBkcmF3OiBmdW5jdGlvbihjb250ZXh0LCBzaXpl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U1hdGguc3FydChzaXplIC8gKHNxcnQzICogMykpO1xuICAgIGNvbnRleHQubW92ZVRvKDAsIHkgKiAyKTtcbiAgICBjb250ZXh0LmxpbmVUbygtc3FydDMgKiB5LCAteSk7XG4gICAgY29udGV4dC5saW5lVG8oc3FydDMgKiB5LCAteSk7XG4gICAgY29udGV4dC5jbG9zZVBhdGgoKTtcbiAgfVxufTtcbiIsInZhciBjID0gLTAuNSxcbiAgICBzID0gTWF0aC5zcXJ0KDMpIC8gMixcbiAgICBrID0gMSAvIE1hdGguc3FydCgxMiksXG4gICAgYSA9IChrIC8gMiArIDEpICogMztcblxuZXhwb3J0IGRlZmF1bHQge1xuICBkcmF3OiBmdW5jdGlvbihjb250ZXh0LCBzaXplKSB7XG4gICAgdmFyIHIgPSBNYXRoLnNxcnQoc2l6ZSAvIGEpLFxuICAgICAgICB4MCA9IHIgLyAyLFxuICAgICAgICB5MCA9IHIgKiBrLFxuICAgICAgICB4MSA9IHgwLFxuICAgICAgICB5MSA9IHIgKiBrICsgcixcbiAgICAgICAgeDIgPSAteDEsXG4gICAgICAgIHkyID0geTE7XG4gICAgY29udGV4dC5tb3ZlVG8oeDAsIHkwKTtcbiAgICBjb250ZXh0LmxpbmVUbyh4MSwgeTEpO1xuICAgIGNvbnRleHQubGluZVRvKHgyLCB5Mik7XG4gICAgY29udGV4dC5saW5lVG8oYyAqIHgwIC0gcyAqIHkwLCBzICogeDAgKyBjICogeTApO1xuICAgIGNvbnRleHQubGluZVRvKGMgKiB4MSAtIHMgKiB5MSwgcyAqIHgxICsgYyAqIHkxKTtcbiAgICBjb250ZXh0LmxpbmVUbyhjICogeDIgLSBzICogeTIsIHMgKiB4MiArIGMgKiB5Mik7XG4gICAgY29udGV4dC5saW5lVG8oYyAqIHgwICsgcyAqIHkwLCBjICogeTAgLSBzICogeDApO1xuICAgIGNvbnRleHQubGluZVRvKGMgKiB4MSArIHMgKiB5MSwgYyAqIHkxIC0gcyAqIHgxKTtcbiAgICBjb250ZXh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ZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgb3V0Lmdlb0pTT05zLmdyYXRpY3VsZSA9IGZlYXR1cmUob3V0LmRlZmF1bHRHZW9EYXRhLCBvdXQuZGVmYXVsdEdlb0RhdGEub2JqZWN0cy5ncmEpLmZlYXR1cmVzXHJcbiAgICAgICAgICAgICAgICAgICAgb3V0Lmdlb0pTT05zLm51dHNyZyA9IGZlYXR1cmUob3V0LmRlZmF1bHRHZW9EYXRhLCBvdXQuZGVmYXVsdEdlb0RhdGEub2JqZWN0cy5udXRzcmcpLmZlYXR1cmVzXHJcbiAgICAgICAgICAgICAgICAgICAgb3V0Lmdlb0pTT05zLm51dHNibiA9IGZlYXR1cmUob3V0LmRlZmF1bHRHZW9EYXRhLCBvdXQuZGVmYXVsdEdlb0RhdGEub2JqZWN0cy5udXRzYm4pLmZlYXR1cmVzXHJcbiAgICAgICAgICAgICAgICAgICAgb3V0Lmdlb0pTT05zLmNudHJnID0gZmVhdHVyZShvdXQuZGVmYXVsdEdlb0RhdGEsIG91dC5kZWZhdWx0R2VvRGF0YS5vYmplY3RzLmNudHJnKS5mZWF0dXJlc1xyXG4gICAgICAgICAgICAgICAgICAgIG91dC5nZW9KU09Ocy5jbnRibiA9IGZlYXR1cmUob3V0LmRlZmF1bHRHZW9EYXRhLCBvdXQuZGVmYXVsdEdlb0RhdGEub2JqZWN0cy5jbnRibikuZmVhdHVyZXNcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0c1xyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuY2F0Y2goKGVycikgPT4ge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVqZWN0KGVycilcclxuICAgICAgICAgICAgfSlcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIFJldHVybnMgYW4gYXJyYXkgb2YgcHJvbWlzZXMgZm9yIE51dHMySlNPTiB0b3BvanNvbiBk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ICdtaXhlZCcgJiYgbWFwLmdlb18gIT09ICdXT1JMRCcpIHtcclxuICAgICAgICAgICAgbnV0c0xldmVscy5mb3JFYWNoKChsdmwpID0+XHJcbiAgICAgICAgICAgICAgICBwcm9taXNlcy5wdXNoKGpzb24oYnVpbGRVcmwobWFwLm51dHMyanNvbkJhc2VVUkxfLCBtYXAubnV0c1llYXJfLCBtYXAuZ2VvXywgbWFwLnByb2pfLCBtYXAuc2NhbGVfLCBsdmwpKSlcclxuICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICBpZiAod2l0aENlbnRlclBvaW50cykge1xyXG4gICAgICAgICAgICAgICAgbnV0c0xldmVscy5mb3JFYWNoKChsdmwpID0+XHJcbiAgICAgICAgICAgICAgICAgICAgcHJvbWlzZXMucHVzaChcclxuICAgICAgICAgICAgICAgICAgICAgICAganNvbihidWlsZFVybChtYXAubnV0czJqc29uQmFzZVVSTF8sIG1hcC5udXRzWWVhcl8sIG1hcC5nZW9fLCBtYXAucHJval8sIG1hcC5zY2FsZV8sIGx2bCwgdHJ1ZSkpXHJcbiAgICAgICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSBlbHNlIGlmIChtYXAuZ2VvXyA9PT0gJ1dPUkxEJykge1xyXG4gICAgICAgICAgICBwcm9taXNlcy5wdXNoKFxyXG4gICAgICAgICAgICAgICAganNvbignaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL2V1cm9zdGF0L2V1cm9zdGF0LW1hcC9tYXN0ZXIvc3JjL2Fzc2V0cy90b3BvanNvbi9XT1JMRF80MzI2Lmpzb24nKVxyXG4gICAgICAgICAgICApXHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgcHJvbWlzZXMucHVzaChqc29uKGJ1aWxkVXJsKG1hcC5udXRzMmpzb25CYXNlVVJMXywgbWFwLm51dHNZZWFyXywgbWFwLmdlb18sIG1hcC5wcm9qXywgbWFwLnNjYWxlXywgbWFwLm51dHNMZXZlbF8pKSlcclxuICAgICAgICAgICAgaWYgKHdpdGhDZW50ZXJQb2ludHMpIHtcclxuICAgICAgICAgICAgICAgIHByb21pc2VzLnB1c2goXHJcbiAgICAgICAgICAgICAgICAgICAganNvbihidWlsZFVybChtYXAubnV0czJqc29uQmFzZVVSTF8sIG1hcC5udXRzWWVhcl8sIG1hcC5nZW9fLCBtYXAucHJval8sIG1hcC5zY2FsZV8sIG1hcC5udXRzTGV2ZWxfLCB0cnVlKSlcclxuICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgcmV0dXJuIHByb21pc2VzXHJcbiAgICB9XHJcbiAgICAvKiogQ2hlY2tzIGlmIGFsbCBnZW8gZGF0YSBpcyByZWFkeSAqL1xyXG4gICAgb3V0LmlzR2VvUmVhZHkgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgaWYgKCFvdXQuZGVmYXVsdEdlb0RhdGEgJiYgIW91dC51c2VyR2VvbWV0cmllcykgcmV0dXJuIGZhbHNlXHJcblxyXG4gICAgICAgIGxldCBhbGxSZWFkeSA9IHRydWVcclxuXHJcbiAgICAgICAgZXhlY3V0ZUZvckFsbEluc2V0cyhtYXAuaW5zZXRUZW1wbGF0ZXNfLCBudWxsLCAoaW5zZXQpID0+IHtcclxuICAgICAgICAgICAgaWYgKCFpbnNldC5HZW9tZXRyaWVzLmlzR2VvUmVhZHkoKSkge1xyXG4gICAgICAgICAgICAgICAgYWxsUmVhZHkgPSBmYWxzZVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSlcclxuXHJcbiAgICAgICAgcmV0dXJuIGFsbFJlYWR5XHJcbiAgICB9XHJcblxyXG4gICAgb3V0LnNldFVzZXJHZW9tZXRyaWVzID0gZnVuY3Rpb24gKGdlb21ldHJpZXMpIHtcclxuICAgICAgICB0aGlzLnVzZXJHZW9tZXRyaWVzID0gZ2VvbWV0cmllc1xyXG5cclxuICAgICAgICAvLyBnZXQgcmVnaW9ucyB0aGF0IGFyZSBsaW5rZWQgdG8gdGhlIHN0YXRpc3RpY3NcclxuICAgICAgICBnZW9tZXRyaWVzLmZvckVhY2goKGdlb21ldHJ5KSA9PiB7XHJcbiAgICAgICAgICAgIGlmIChnZW9tZXRyeS5zdGF0aXN0aWNhbFJlZ2lvbnMpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuc3RhdGlzdGljYWxSZWdpb25zID0gZ2VvbWV0cnlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pXHJcbiAgICB9XHJcblxyXG4gICAgb3V0LmFkZERlZmF1bHRHZW9tZXRyaWVzVG9NYXAgPSBmdW5jdGlvbiAoY29udGFpbmVyLCBkcmF3R3JhdGljdWxlLCBwYXRoRnVuY3Rpb24sIG51dHNMZXZlbCwgbnV0c1llYXIsIGdlbywgcHJvaiwgc2NhbGUpIHtcclxuICAgICAgICBpZiAodGhpcy5nZW9KU09Ocy5ncmF0aWN1bGUgJiYgZHJhd0dyYXRpY3VsZSkge1xyXG4gICAgICAgICAgICAvL2RyYXcgZ3JhdGljdWxlXHJcbiAgICAgICAgICAgIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tZ3JhdGljdWxlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1ncmF0aWN1bGUnKVxyXG4gICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuZGF0YSh0aGlzLmdlb0pTT05zLmdyYXRpY3VsZSlcclxuICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9kcmF3IGNvdW50cnkgcmVnaW9uc1xyXG4gICAgICAgIGlmICh0aGlzLmdlb0pTT05zLmNudHJnKSB7XHJcbiAgICAgICAgICAgIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tY250cmcnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWNudHJnJylcclxuICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmRhdGEodGhpcy5nZW9KU09Ocy5jbnRyZylcclxuICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9kcmF3IHdvcmxkIG1hcFxyXG4gICAgICAgIGlmICh0aGlzLmdlb0pTT05zLndvcmxkcmcpIHtcclxuICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS13b3JsZHJnJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS13b3JsZHJnJylcclxuICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmRhdGEodGhpcy5nZW9KU09Ocy53b3JsZHJnKVxyXG4gICAgICAgICAgICAgICAgLmVudGVyKClcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2QnLCBwYXRoRnVuY3Rpb24pXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAg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3RoaXMuZ2VvSlNPTnMubWl4ZWQucmcwLCB0aGlzLmdlb0pTT05zLm1peGVkLnJnMSwgdGhpcy5nZW9KU09Ocy5taXhlZC5yZzIsIHRoaXMuZ2VvSlNPTnMubWl4ZWQucmczXS5mb3JFYWNoKFxyXG4gICAgICAgICAgICAgICAgICAgIChyLCBpKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vYXBwZW5kIGVhY2ggbnV0cyBsZXZlbCB0byBtYXBcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1udXRzcmcnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLW51dHNyZycpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXRoJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKHIpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignZCcsIHBhdGhGdW5jdGlvbilcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdsdmwnLCBpKSAvL3RvIGJlIGFibGUgdG8gZGlzdGluZ3Vpc2ggbnV0cyBsZXZlbHNcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICApXHJcblxyXG4gICAgICAgICAgICAgICAgLy9hZGQga29zb3ZvXHJcbiAgICAgICAgICAgICAgICBpZiAoZ2VvID09ICdFVVInICYmIHByb2ogPT0gJzMwMzUnICYmIChudXRzWWVhciA9PSAnMjAxNicgfHwgbnV0c1llYXIgPT0gJzIwMjEnKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGFkZCBrb3Nvdm8gbWFudWFsbHlcclxuICAgICAgICAgICAgICAgICAgICBsZXQga29zb3ZvQm4gPSBmZWF0dXJlKGtvc292b0JuRmVhdHVyZXNbc2NhbGVdLCAnbnV0c2JuXzEnKS5mZWF0dXJlc1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2VtLWtvc292by1ibicpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1rb3Nvdm8tYm4gZW0tYm4tY2MnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXRoJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoa29zb3ZvQm4pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignZCcsIHBhdGhGdW5jdGlvbilcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vIHdoZW4gbnV0c0xldmVsIGlzIG5vdCAnbWl4ZWQnXHJcbiAgICAgICAgICAgICAgICBjb250YWluZXJcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tbnV0c3JnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbnV0c3JnJylcclxuICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXRoJylcclxuICAgICAgICAgICAgICAgICAgICAuZGF0YSh0aGlzLmdlb0pTT05zLm51dHNyZylcclxuICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2RyYXcgY291bnRyeSBib3VuZGFyaWVzXHJcbiAgICAgICAgaWYgKHRoaXMuZ2VvSlNPTnMuY250Ym4pIHtcclxuICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1jbnRibicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tY250Ym4nKVxyXG4gICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuZGF0YSh0aGlzLmdlb0pTT05zLmNudGJuKVxyXG4gICAgICAgICAgICAgICAgLmVudGVyKClcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbiAoYm4pIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoYm4ucHJvcGVydGllcy5ldSA9PSAnVCcpIHJldHVybiBiblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmVmdGEgPT0gJ1QnKSByZXR1cm4gYm5cclxuICAgICAgICAgICAgICAgICAgICBpZiAoYm4ucHJvcGVydGllcy5jYyA9PSAnVCcpIHJldHVybiBiblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLm90aCA9PSAnVCcpIHJldHVybiBiblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmNvID09ICdUJykgcmV0dXJuIGJuXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2QnLCBwYXRoRnVuY3Rpb24pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAoYm4pID0+ICdlbS1ibi0nICsgYm4ucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGZ1bmN0aW9uIChibikge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBjbGFzc0xpc3QgPSBbXVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBpZiAoYm4ucHJvcGVydGllcy5ldSA9PT0gJ1QnKSBjbGFzc0xpc3QucHVzaCgnZW0tYm4tZXUnKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmVmdGEgPT09ICdUJykgY2xhc3NMaXN0LnB1c2goJ2VtLWJuLWVmdGEnKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmNjID09PSAnVCcpIGNsYXNzTGlzdC5wdXNoKCdlbS1ibi1jYycpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGJuLnByb3BlcnRpZXMub3RoID09PSAnVCcpIGNsYXNzTGlzdC5wdXNoKCdlbS1ibi1vdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmNvID09PSAnVCcpIGNsYXNzTGlzdC5wdXNoKCdlbS1ibi1jbycpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmlkID09IDE1NikgY29uc29sZS5sb2coY2xhc3NMaXN0LCBibilcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2xhc3NMaXN0LmpvaW4oJyAnKSAvLyBVc2Ugam9pbiB3aXRoIGEgc3BhY2UgdG8gY3JlYXRlIGEgdmFsaWQgY2xhc3Mgc3RyaW5nXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9kcmF3IE5VVFMgYm91bmRhcmllc1xyXG4gICAgICAgIGlmICh0aGlzLmdlb0pTT05zLm51dHNibikge1xyXG4gICAgICAgICAgICB0aGlzLmdlb0pTT05zLm51dHNibi5zb3J0KGZ1bmN0aW9uIChibjEsIGJuMikge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGJuMi5wcm9wZXJ0aWVzLmx2bCAtIGJuMS5wcm9wZXJ0aWVzLmx2bFxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICBjb250YWluZXJcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2VtLW51dHNibicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbnV0c2JuJylcclxuICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmRhdGEodGhpcy5nZW9KU09Ocy5udXRzYm4pXHJcbiAgICAgICAgICAgICAgICAuZW50ZXIoKVxyXG4gICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbiAoYm4pIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoYm4ucHJvcGVydGllcy5ldSA9PSAnVCcpIHJldHVybiBiblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmVmdGEgPT0gJ1QnKSByZXR1cm4gYm5cclxuICAgICAgICAgICAgICAgICAgICBpZiAoYm4ucHJvcGVydGllcy5jYyA9PSAnVCcpIHJldHVybiBiblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLm90aCA9PSAnVCcpIHJldHVybiBiblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmNvID09ICdUJykgcmV0dXJuIGJuXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZCcsIHBhdGhGdW5jdGlvbilcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGZ1bmN0aW9uIChibikge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBwcm9wcyA9IGJuLnByb3BlcnRpZXNcclxuICAgICAgICAgICAgICAgICAgICAvL0tPU09WT1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcm9wcy5pZCA+IDEwMDAwMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2VtLWtvc292by1ibidcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHByb3BzLmNvID09PSAnVCcpIHJldHVybiAnZW0tYm4tY28nXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY2wgPSBbJ2VtLWJuLScgKyBwcm9wcy5sdmxdXHJcbiAgICAgICAgICAgICAgICAgICAgLy9pZiAoYm4ub3RoID09PSBcIlRcIikgY2wucHVzaChcImJuLW90aFwiKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2wuam9pbignICcpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgaWYgKGdlbyA9PSAnRVVSJyAmJiBwcm9qID09ICczMDM1JyAmJiAobnV0c1llYXIgPT0gJzIwMTYnIHx8IG51dHNZZWFyID09ICcyMDIxJykpIHtcclxuICAgICAgICAgICAgICAgIC8vIGFkZCBrb3Nvdm8gbWFudWFsbHlcclxuICAgICAgICAgICAgICAgIGxldCBrb3Nvdm9CbiA9IGZlYXR1cmUoa29zb3ZvQm5GZWF0dXJlc1tzY2FsZV0sICdudXRzYm5fMScpLmZlYXR1cmVzXHJcblxyXG4gICAgICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2VtLWtvc292by1ibicpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWtvc292by1ibicpXHJcbiAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmRhdGEoa29zb3ZvQm4pXHJcbiAgICAgICAgICAgICAgICAgICAgLmVudGVyKClcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignZCcsIHBhdGhGdW5jdGlvbilcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9kcmF3IHdvcmxkIGJvdW5kYXJpZXNcclxuICAgICAgICBpZiAodGhpcy5nZW9KU09Ocy53b3JsZGJuKSB7XHJcbiAgICAgICAgICAgIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0td29ybGRibicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0td29ybGRibicpXHJcbiAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5kYXRhKHRoaXMuZ2VvSlNPTnMud29ybGRibilcclxuICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgZnVuY3Rpb24gKGJuKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGJuLnByb3BlcnRpZXMuUE9MX1NUQVQgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZGlzcHV0ZWRcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdlbS1ibi1kJ1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYm4ucHJvcGVydGllcy5DT0FTX0ZMQUcgPT09ICdUJyA/ICdlbS1ibi1jbycgOiAnZW0td29ybGRibidcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC8vLmF0dHIoXCJpZFwiLCAoYm4pID0+IGJuLnByb3BlcnRpZXMuQ05UUl9CTl9JRClcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmICh0aGlzLmdlb0pTT05zLmtvc292bykge1xyXG4gICAgICAgICAgICAvL2FkZCBrb3Nvdm8gdG8gd29ybGQgbWFwXHJcbiAgICAgICAgICAgIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0ta29zb3ZvLWJuJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1rb3Nvdm8tYm4nKVxyXG4gICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuZGF0YSh0aGlzLmdlb0pTT05zLmtvc292bylcclxuICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEBkZXNjcmlwdGlvbiBBZGRzIHVzZXItZGVmaW5lZCBnZW9tZXRyaWVzIHRvIHRoZSBtYXBcclxuICAgICAqIEUuZy5cclxuICAgICAqIG1hcC5nZW9tZXRyaWVzKFtcclxuICAgICAqICB7I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YmUgc3BlY2lmaWVkIGluIHRoZSB0cmFuc2Zvcm0gcHJvcGVydHlcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hcC5fcHJvamVjdGlvbihbZC54LCBkLnldKVswXVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgZnVuY3Rpb24gKGQpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoZC5yb3RhdGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDAgLy9mb3Igcm90YXRlZCB0ZXh0LCB4IGFuZCB5IHBvc2l0aW9ucyBtdXN0IGJlIHNwZWNpZmllZCBpbiB0aGUgdHJhbnNmb3JtIHByb3BlcnR5XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXAuX3Byb2plY3Rpb24oW2QueCwgZC55XSlbMV1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZHknLCAtNykgLy8gc2V0IHkgcG9zaXRpb24gb2YgYm90dG9tIG9mIHRleHRcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAoZCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChkLnJvdGF0ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcG9zID0gbWFwLl9wcm9qZWN0aW9uKFtkLngsIGQueV0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB4ID0gcG9zWzBdXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB5ID0gcG9zWzFdXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBgdHJhbnNsYXRlKCR7eH0sJHt5fSkgcm90YXRlKCR7ZC5yb3RhdGV9KWBcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3JvdGF0ZSgwKSdcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24gKGQpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC50ZXh0XHJcbiAgICAgICAgICAgICAgICB9KSAvLyBkZWZpbmUgdGhlIHRleHQgdG8gZGlzcGxheVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9MQUJFTCB0ZXh0c1xyXG4gICAgICAgIGxhYmVsZ1xyXG4gICAgICAgICAgICAuc2VsZWN0QWxsKCd0ZXh0JylcclxuICAgICAgICAgICAgLmRhdGEobGFiZWxzQXJyYXkpXHJcbiAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAuYXR0cignaWQnLCAoZCkgPT4gJ2VtLWxhYmVsLScgKyBkLnRleHQucmVwbGFjZSgvXFxzKy9nLCAnLScpKVxyXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAoZCkgPT4gJ2VtLWxhYmVsIGVtLWxhYmVsLScgKyBkLmNsYXNzKVxyXG4gICAgICAgICAgICAvL3Bvc2l0aW9uIGxhYmVsXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgZnVuY3Rpb24gKGQpIHtcclxuICAgICAgICAgICAgICAgIGlmIChkLnJvdGF0ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAwIC8vZm9yIHJvdGF0ZWQgdGV4dCwgeCBhbmQgeSBwb3NpdGlvbnMgbXVzdCBiZSBzcGVjaWZpZWQgaW4gdGhlIHRyYW5zZm9ybSBwcm9wZXJ0eVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIG1hcC5fcHJvamVjdGlvbihbZC54LCBkLnldKVswXVxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuYXR0cigneScsIGZ1bmN0aW9uIChkKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoZC5yb3RhdGUpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMCAvL2ZvciByb3RhdGVkIHRleHQsIHggYW5kIHkgcG9zaXRpb25zIG11c3QgYmUgc3BlY2lmaWVkIGluIHRoZSB0cmFuc2Zvcm0gcHJvcGVydHlcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHJldHVybiBtYXAuX3Byb2plY3Rpb24oW2QueCwgZC55XSlbMV1cclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgLmF0dHIoJ2R5JywgLTcpIC8vIHNldCB5IHBvc2l0aW9uIG9mIGJvdHRvbSBvZiB0ZXh0XHJcbiAgICAgICAgICAgIC8vdHJhbnNmb3JtIGxhYmVscyB3aGljaCBoYXZlIGEgXCJyb3RhdGVcIiBwcm9wZXJ0eSBpbiB0aGUgbGFiZWxzIGNvbmZpZy4gRm9yIHJvdGF0ZWQgbGFiZWxzLCB0aGVpciBYLFkgbXVzdCBhbHNvIGJlIHNldCBpbiB0aGUgdHJhbnNmb3JtLlxyXG4gICAgICAgICAgICAvLyBub3RlOiBkb250IGFwcGx5IHRvIGNvdW50cnkgY29kZSBsYWJlbHNcclxuICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIChkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoZC5yb3RhdGUpIHtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgcG9zID0gbWFwLl9wcm9qZWN0aW9uKFtkLngsIGQueV0pXHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHggPSBwb3NbMF1cclxuICAgICAgICAgICAgICAgICAgICBsZXQgeSA9IHBvc1sxXVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgdHJhbnNsYXRlKCR7eH0sJHt5fSkgcm90YXRlKCR7Z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WxzUG9zaXRpb25zW2QucHJvcGVydGllcy5pZF0ueSxcclxuICAgICAgICAgICAgICAgICAgICBdKVxyXG4gICAgICAgICAgICAgICAgICAgIGxldCB4ID0gcG9zWzBdLnRvRml4ZWQoMylcclxuICAgICAgICAgICAgICAgICAgICBsZXQgeSA9IHBvc1sxXS50b0ZpeGVkKDMpXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGB0cmFuc2xhdGUoJHt4fSwke3l9KWBcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNlbnRyb2lkID0gbWFwLl9wYXRoRnVuY3Rpb24uY2VudHJvaWQoZClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5sYWJlbHNfLnByb2Nlc3NWYWx1ZUxhYmVsQ2VudHJvaWRzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRyb2lkID0gbWFwLmxhYmVsc18ucHJvY2Vzc1ZhbHVlTGFiZWxDZW50cm9pZHMoZCwgY2VudHJvaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIC8vIG90aGVyd2lzZSB3ZSBjYWxjdWxhdGUgY2VudHJvaWRzXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArIGNlbnRyb2lkICsgJyknXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tc3RhdC1sYWJlbC1zaGFkb3cnKVxyXG4gICAgfVxyXG59XHJcbi8qKlxyXG4gKiBEZWZhdWx0IGxhYmVscyBmb3IgY291bnRyeSAvIGdlb2dyYXBoaWNhbCBuYW1lcy5cclxuICogVXNpbmcgY2VudHJvaWRzIHdvdWxkIGNsYXNoIHdpdGggcHJvcG9ydGlvbmFsIHN5bWJvbHMsIGFuZCBhcm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ICAgICAgICAgICAgICAgIC8vb3ZlcnJpZGUgZGVmYXVsdCBwcm9wZXJ0aWVzXHJcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHAgaW4gdikge1xyXG4gICAgICAgICAgICAgICAgICAgIG91dFthdHRdW3BdID0gdltwXVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgb3V0W2F0dF0gPSB2XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vcmVjdXJzaXZlIGNhbGwgdG8gaW5zZXQgY29tcG9uZW50c1xyXG4gICAgICAgICAgICBpZiAob3V0Lmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgZXhlY3V0ZUZvckFsbEluc2V0cyhcclxuICAgICAgICAgICAgICAgICAgICBvdXQuaW5zZXRUZW1wbGF0ZXNfLFxyXG4gICAgICAgICAgICAgICAgICAgIG91dC5zdmdJZF8sXHJcbiAgICAgICAgICAgICAgICAgICAgKGluc2V0LCB2YWx1ZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBmbk5hbWUgPSBhdHQuc3Vic3RyaW5nKDAsIGF0dC5sZW5ndGggLSAxKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpbnNldFtmbk5hbWVdKHZhbHVlKVxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgdlxyXG4gICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiBvdXRcclxuICAgICAgICB9XHJcbiAgICB9KVxyXG5cclxuICAgIC8vdGl0bGUgZ2V0dGVyIGFuZCBzZXR0ZXJcclxuICAgIG91dC50aXRsZSA9IGZ1bmN0aW9uICh2KSB7XHJcbiAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gb3V0LnRpdGxlX1xyXG4gICAgICAgIG91dC50aXRsZV8gPSB2XHJcbiAgICAgICAgaWYgKG91dC5zdmcoKSlcclxuICAgICAgICAgICAgb3V0LnN2ZygpXHJcbiAgICAgICAgICAgICAgICAuc2VsZWN0KCcjdGl0bGUnICsgb3V0LmdlbygpKVxyXG4gICAgICAgICAgICAgICAgLnRleHQodilcclxuICAgICAgICByZXR1cm4gb3V0XHJcbiAgICB9XHJcblxyXG4gICAgLy9zdWJ0aXRsZSBnZXR0ZXIgYW5kIHNldHRlclxyXG4gICAgb3V0LnN1YnRpdGxlID0gZnVuY3Rpb24gKHYpIHtcclxuICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBvdXQuc3VidGl0bGVfXHJcbiAgICAgICAgb3V0LnN1YnRpdGxlXyA9IHZcclxuICAgICAgICBpZiAob3V0LnN2ZygpKVxyXG4gICAgICAgICAgICBvdXQuc3ZnKClcclxuICAgICAgICAgICAgICAgIC5zZWxlY3QoJyNzdWJ0aXRsZScgKyBvdXQuZ2VvKCkpXHJcbiAgICAgICAgICAgICAgICAudGV4dCh2KVxyXG4gICAgICAgIHJldHVybiBvdXRcclxuICAgIH1cclxuXHJcbiAgICAvL2luc2V0cyBnZXR0ZXIvc2V0dGVyXHJcbiAgICBvdXQuaW5zZXRzID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG91dC5pbnNldHNfXHJcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT0gMSAmJiBhcmd1bWVudHNbMF0gPT09ICdkZWZhdWx0Jykgb3V0Lmluc2V0c18gPSAnZGVmYXVsdCdcclxuICAgICAgICBlbHNlIGlmIChhcmd1bWVudHMubGVuZ3RoID09IDEgJiYgYXJndW1lbnRzWzBdID09PSBmYWxzZSkgb3V0Lmluc2V0c18gPSBmYWxzZVxyXG4gICAgICAgIGVsc2UgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT0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ldHJpZXMuZ2VvSlNPTnMuZ3JhdGljdWxlICYmIG91dC5fcGF0aEZ1bmN0aW9uICYmIHpnICYmIHYgPT0gdHJ1ZSkge1xyXG4gICAgICAgICAgICAgICAgLy9yZW1vdmUgZXhpc3RpbmcgZ3JhdGljdWxlXHJcbiAgICAgICAgICAgICAgICBncmF0aWN1bGUucmVtb3ZlKClcclxuICAgICAgICAgICAgICAgIC8vIGFkZCBuZXcgZ3JhdGljdWxlXHJcbiAgICAgICAgICAgICAgICB6Zy5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1ncmF0aWN1bGUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5kYXRhKG91dC5HZW9tZXRyaWVzLmdlb0pTT05zLmdyYXRpY3VsZSlcclxuICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgb3V0Ll9wYXRoRnVuY3Rpb24pXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWdyYXRpY3VsZScpXHJcblxyXG4gICAgICAgICAgICAgICAgb3V0LnN2ZygpXHJcbiAgICAgICAgICAgICAgICAgICAgLnNlbGVjdCgnI2VtLWdyYXRpY3VsZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBtb3ZlIGdyYXRpY3VsZSBiZWhpbmQgbGFuZCBtYXNzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG91dC5nZW9fID09ICdXT1JMRCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGhpcy5wYXJlbnROb2RlLmluc2VydEJlZm9yZSh0aGlzLCB0aGlzLnBhcmVudE5vZGUuY2hpbGROb2Rlc1szXSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogdGhpcy5wYXJlbnROb2RlLmluc2VydEJlZm9yZSh0aGlzLCB0aGlzLnBhcmVudE5vZGUuY2hpbGROb2Rlc1sxXSlcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBvdXRcclxuICAgIH1cclxuXHJcbiAgICAvL2NvYXN0YWwgbWFyZ2luIG92ZXJyaWRlXHJcbiAgICBvdXQuZHJhd0NvYXN0YWxNYXJnaW4gPSBmdW5jdGlvbiAodikge1xyXG4gICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG91dC5kcmF3Q29hc3RhbE1hcmdpbl9cclxuICAgICAgICBvdXQuZHJhd0NvYXN0YWxNYXJnaW5fID0gdlxyXG5cclxuICAgICAgICAvL3VwZGF0ZSBleGlzdGluZ1xyXG4gICAgICAgIGlmIChvdXQuc3ZnXykge1xyXG4gICAgICAgICAgICBsZXQgbWFyZ2luID0gc2VsZWN0QWxsKCcjZW0tY29hc3QtbWFyZ2luJylcclxuICAgICAgICAgICAgbGV0IGZpbHRlciA9IHNlbGVjdCgnI2VtLWNvYXN0YWwtYmx1cicpXHJcbiAgICAgICAgICAgIGxldCB6ZyA9IHNlbGVjdCgnI2VtLXpvb20tZ3JvdXAtJyArIG91dC5zdmdJZF8pIHx8IG51bGxcclxuICAgICAgICAgICAgaWYgKG1hcmdpbi5fZ3JvdXBzWzBdWzBdICYmIHYgPT0gZmFsc2UpIHtcclxuICAgICAgICAgICAgICAgIC8vIHJlbW92ZSBleGlzdGluZ1xyXG4gICAgICAgICAgICAgICAgbWFyZ2luLnJlbW92ZSgpXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodiA9PSB0cnVlICYmIG91dC5fcGF0aEZ1bmN0aW9uICYmIHpnKSB7XHJcbiAgICAgICAgICAgICAgICAvL3JlbW92ZSBleGlzdGluZyBncmF0aWN1bGVcclxuICAgICAgICAgICAgICAgIG1hcmdpbi5yZW1vdmUoKVxyXG4gICAgICAgICAgICAgICAgZmlsdGVyLnJlbW92ZSgpXHJcbiAgICAgICAgICAgICAgICAvL2FkZCBmaWx0ZXJcclxuICAgICAgICAgICAgICAgIG91dC5zdmdfXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnZmlsdGVyJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tY29hc3RhbC1ibHVyJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsICctMjAwJScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3knLCAnLTIwMCUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsICc0MDAlJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgJzQwMCUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ2ZlR2F1c3NpYW5CbHVyJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaW4nLCAnU291cmNlR3JhcGhpYycpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3N0ZERldmlhdGlvbicsIG91dC5jb2FzdGFsTWFyZ2luU3RkRGV2XylcclxuXHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgZm9yIG1haW4gbWFwIC0gZ2VvbWV0cmllcyBhcmUgc3RpbGwgaW4gbWVtb3J5IHNvIG5vIHJlYnVpbGQgbmVlZGVkXHJcbiAgICAgICAgICAgICAgICBjb25zdCBkcmF3TmV3Q29hc3RhbE1hcmdpbiA9IChtYXApID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAvLyB6b29tIGdyb3VwIG1pZ2h0IG5vdCBiZSBpbnNpZGUgbWFpbiBtYXAgKG91dC5zdmdfKVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHpvb21Hcm91cCA9IHNlbGVjdCgnI2VtLXpvb20tZ3JvdXAtJyArIG1hcC5zdmdJZF8pXHJcbiAgICAgICAgICAgICAgICAgICAgLy9kcmF3IG5ldyBjb2FzdGFsIG1hcmdpblxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNnID0gem9vbUdyb3VwLmFwcGVuZCgnZycpLmF0dHIoJ2lkJywgJ2VtLWNvYXN0LW1hcmdpbicpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC8vY291bnRyaWVzIGJuXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5fZ2VvbS5jbnRibilcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2cuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1jb2FzdC1tYXJnaW4tY250JylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEobWFwLl9nZW9tLmNudGJuKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVudGVyKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24gKGJuKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJuLnByb3BlcnRpZXMuY28gPT09ICdUJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2QnLCBtYXAuX3BhdGhGdW5jdGlvbilcclxuICAgICAgICAgICAgICAgICAgICAvL251dHMgYm5cclxuICAgICAgICAgICAgICAgICAgICBpZiAobWFwLl9nZW9tLm51dHNibilcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2cuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1jb2FzdC1tYXJnaW4tbnV0cycpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXRoJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKG1hcC5fZ2VvbS5udXRzYm4pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbiAoYm4pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYm4ucHJvcGVydGllcy5jbyA9PT0gJ1QnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignZCcsIG1hcC5fcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgICAgICAgICAgICAgIC8vd29ybGQgYm5cclxuICAgICAgICAgICAgICAgICAgICBpZiAobWFwLl9nZW9tLndvcmxkYm4pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNnLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tY29hc3QtbWFyZ2luLW51dHMnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShtYXAuX2dlb20ud29ybGRibilcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChibikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBibi5wcm9wZXJ0aWVzLkNPQVNfRkxBRyA9PT0gJ1QnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignZCcsIG1hcC5fcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIC8vZHJhdyBmb3IgaW5zZXRzIC0gcmVxdWlyZXMgZ2VvbWV0cmllcyBzbyB3ZSBoYXZlIHRvIHJlYnVpbGQgYmFzZSB0ZW1wbGF0ZVxyXG4gICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc18gJiYgb3V0LmRyYXdDb2FzdGFsTWFyZ2luXykge1xyXG4gICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lmluc2V0VGVtcGxhdGVzXywgb3V0LnN2Z0lkXywgZHJhd05ld0NvYXN0YWxNYXJnaW4pXHJcbiAgICAgICAgICAgICAgICAgICAgZHJhd05ld0NvYXN0YWxNYXJnaW4ob3V0KVxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIC8vIG1vdmUgbWFyZ2luIHRvIGJhY2sgKGluIGZyb250IG9mIHNlYSlcclxuICAgICAgICAgICAgICAgIHNlbGVjdEFsbCgnI2VtLWNvYXN0LW1hcmdpbicpLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIG91dC5nZW9fID09ICdXT1JMRCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgPyB0aGlzLnBhcmVudE5vZGUuaW5zZXJ0QmVmb3JlKHRoaXMsIHRoaXMucGFyZW50Tm9kZS5jaGlsZE5vZGVzWzNdKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICA6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dHNcclxuICAgICAgICBsZXQgc3ZnID0gc2VsZWN0KCcjJyArIG91dC5zdmdJZCgpKVxyXG4gICAgICAgIGlmIChzdmcuc2l6ZSgpID09IDApIHtcclxuICAgICAgICAgICAgc3ZnID0gc2VsZWN0KCdib2R5JykuYXBwZW5kKCdzdmcnKS5hdHRyKCdpZCcsIG91dC5zdmdJZCgpKVxyXG4gICAgICAgIH1cclxuICAgICAgICBzdmcuYXR0cignY2xhc3MnLCAnZW0tbWFwJylcclxuICAgICAgICBvdXQuc3ZnXyA9IHN2Z1xyXG5cclxuICAgICAgICAvL3NldCBjb250YWluZXIgZm9yIGNhc2VzIHdoZXJlIGNvbnRhaW5lciBjb250YWlucyB2YXJpb3VzIG1hcHNcclxuICAgICAgICBpZiAoIW91dC5jb250YWluZXJJZF8pIG91dC5jb250YWluZXJJZF8gPSBvdXQuc3ZnSWRfXHJcbiAgICAgICAgLy90b29sdGlwIG5lZWRzIHRvIGtub3cgY29udGFpbmVyIHRvIHByZXZlbnQgb3ZlcmZsb3dcclxuICAgICAgICBpZiAoIW91dC50b29sdGlwXy5jb250YWluZXJJZCkge1xyXG4gICAgICAgICAgICBvdXQudG9vbHRpcF8uY29udGFpbmVySWQgPSBvdXQuY29udGFpbmVySWRfXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2NsZWFyIFNWRyAodG8gYXZvaWQgYnVpbGRpbmcgbXVsdGlwbGUgc3ZncyBvbiB0b3Agb2YgZWFjaCBvdGhlciBkdXJpbmcgbXVsdGlwbGUgYnVpbGQoKSBjYWxscylcclxuICAgICAgICBzZWxlY3RBbGwoJyMnICsgb3V0LnN2Z0lkKCkgKyAnID4gKicpLnJlbW92ZSgpXHJcblxyXG4gICAgICAgIC8vc2V0IFNWRyBkaW1lbnNpb25zXHJcbiAgICAgICAgaWYgKG91dC5nZW9fLnRvVXBwZXJDYXNlKCkgPT0gJ1dPUkxEJykge1xyXG4gICAgICAgICAgICAvL2lmIG5vIGhlaWdodCB3YXM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Xywgb3V0LmhlaWdodF8pKVxyXG5cclxuICAgICAgICBpZiAob3V0LmRyYXdDb2FzdGFsTWFyZ2luXykge1xyXG4gICAgICAgICAgICAvL2RlZmluZSBmaWx0ZXIgZm9yIGNvYXN0YWwgbWFyZ2luXHJcbiAgICAgICAgICAgIHN2Zy5hcHBlbmQoJ2ZpbHRlcicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tY29hc3RhbC1ibHVyJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgJy0yMDAlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgJy0yMDAlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsICc0MDAlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAnNDAwJScpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdmZUdhdXNzaWFuQmx1cicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaW4nLCAnU291cmNlR3JhcGhpYycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignc3RkRGV2aWF0aW9uJywgb3V0LmNvYXN0YWxNYXJnaW5TdGREZXZfKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9jcmVhdGUgZHJhd2luZyBncm91cCwgYXMgZmlyc3QgY2hpbGRcclxuICAgICAgICBjb25zdCBkZyA9IHN2Z1xyXG4gICAgICAgICAgICAuaW5zZXJ0KCdnJywgJzpmaXJzdC1jaGlsZCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1kcmF3aW5nLScgKyBvdXQuc3ZnSWRfKVxyXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tZHJhd2luZy1ncm91cCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGlwLXBhdGgnLCAndXJsKCMnICsgb3V0LnN2Z0lkXyArICctY2xpcC1wYXRoJyArICcpJylcclxuXHJcbiAgICAgICAgLy9jcmVhdGUgbWFpbiB6b29tIGdyb3VwXHJcbiAgICAgICAgY29uc3QgemcgPSBkZ1xyXG4gICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2VtLXpvb20tZ3JvdXAtJyArIG91dC5zdmdJZF8pXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS16b29tLWdyb3VwJykgLy9vdXQuZ2VvIGNoYW5nZWQgdG8gb3V0LnN2Z0lkIGluIG9yZGVyIHRvIGJlIHVuaXF1ZVxyXG5cclxuICAgICAgICAvL2luc2V0c1xyXG4gICAgICAgIG91dC5yZW1vdmVJbnNldHMoKSAvL3JlbW92ZSBleGlzdGluZ1xyXG4gICAgICAgIG91dC5idWlsZEluc2V0cygpIC8vYnVpbGQgbmV3XHJcblxyXG4gICAgICAgIC8vZHJhdyBmcmFtZVxyXG4gICAgICAgIGRnLmFwcGVuZCgncmVjdCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1mcmFtZS0nICsgb3V0Lmdlb18pXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1mcmFtZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgMClcclxuICAgICAgICAgICAgLmF0dHIoJ3knLCAwKVxyXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCBvdXQud2lkdGhfKVxyXG4gICAgICAgICAgICAuYXR0cignaGVpZ2h0Jywgb3V0LmhlaWdodF8pXHJcblxyXG4gICAgICAgIHJldHVybiBvdXRcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIFJlbW92ZSBpbnNldHMgbWFwcyBmcm9tIHRoZSBET01cclxuICAgICAqL1xyXG4gICAgb3V0LnJlbW92ZUluc2V0cyA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBpZiAob3V0Lmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICBmb3IgKGxldCB0ZW1wb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AgICAgICAgICAgbGV0IHN2ZyA9IHNlbGVjdCgnIycgKyBjb25maWcuc3ZnSWQpXHJcbiAgICAgICAgICAgIGlmIChzdmcuc2l6ZSgpID09IDApIHtcclxuICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBpdCBhcyBhbiBlbWJlZGVkIFNWRyBpZiBpdCBkb2VzIG5vdCBleGlzdFxyXG4gICAgICAgICAgICAgICAgY29uc3QgeCA9IGNvbmZpZy54ID09IHVuZGVmaW5lZCA/IG91dC5pbnNldEJveFBhZGRpbmdfIDogY29uZmlnLnhcclxuICAgICAgICAgICAgICAgIGNvbnN0IHkgPVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy55ID09IHVuZGVmaW5lZCA/IG91dC5pbnNldEJveFBhZGRpbmdfICsgaSAqIChvdXQuaW5zZXRCb3hQYWRkaW5nXyArIG91dC5pbnNldEJveFdpZHRoXykgOiBjb25maWcueVxyXG4gICAgICAgICAgICAgICAgY29uc3QgZ2dlbyA9IGluZ1xyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1pbnNldC0nICsgY29uZmlnLnN2Z0lkKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1pbnNldCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIHggKyAnLCcgKyB5ICsgJyknKVxyXG4gICAgICAgICAgICAgICAgZ2dlby5hcHBlbmQoJ3N2ZycpLmF0dHIoJ2lkJywgY29uZmlnLnN2Z0lkKVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvLyBidWlsZCBpbnNldFxyXG4gICAgICAgICAgICAvLyBHSVNDTy0yNjc2IC0gUFQgYXpvcmVzIGluc2V0IGhhcyAyIGluc2V0cyB3aXRoIHRoZSBzYW1lIEdlbywgc28g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gdGhlIGRlZmF1bHQgb25lLCBvciB0aGUgY29tcHV0ZSBvbmUgZnJvbSB0aGUgdG9wb2pzb24gYmJveFxyXG4gICAgICAgIGlmICghb3V0LnBvc2l0aW9uXy54IHx8ICFvdXQucG9zaXRpb25fLnkpIHtcclxuICAgICAgICAgICAgZGVmaW5lRGVmYXVsdFBvc2l0aW9uKClcclxuICAgICAgICB9XHJcbiAgICAgICAgb3V0LnBvc2l0aW9uXy56ID0gb3V0LnBvc2l0aW9uXy56IHx8IGdldERlZmF1bHRaKClcclxuXHJcbiAgICAgICAgLy8gZDMgcHJvamVjdGlvbiBmdW5jdGlvbnNcclxuICAgICAgICBkZWZpbmVQcm9qZWN0aW9uKClcclxuICAgICAgICBkZWZpbmVQYXRoRnVuY3Rpb24oKVxyXG4gICAgICAgIC8vIGQzIHpvb21cclxuICAgICAgICBpZiAob3V0Lnpvb21FeHRlbnQoKSkge1xyXG4gICAgICAgICAgICBkZWZpbmVNYXBab29tKClcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vcHJlcGFyZSBkcmF3aW5nIGdyb3VwXHJcbiAgICAgICAgY29uc3Qgem9vbUdyb3VwID0gb3V0LnN2ZygpLnNlbGVjdCgnI2VtLXpvb20tZ3JvdXAtJyArIG91dC5zdmdJZF8pXHJcbiAgICAgICAgem9vbUdyb3VwLnNlbGVjdEFsbCgnKicpLnJlbW92ZSgpXHJcblxyXG4gICAgICAgIC8vZHJhdyBiYWNrZ3JvdW5kIHJlY3RhbmdsZVxyXG4gICAgICAgIHpvb21Hcm91cFxyXG4gICAgICAgICAgICAuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ3NlYScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zZWEnKVxyXG4gICAgICAgICAgICAuYXR0cigneCcsIC01ICogb3V0LndpZHRoXylcclxuICAgICAgICAgICAgLmF0dHIoJ3knLCAtNSAqIG91dC5oZWlnaHRfKVxyXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCAxMSAqIG91dC53aWR0aF8pXHJcbiAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAxMSAqIG91dC5oZWlnaHRfKVxyXG5cclxuICAgICAgICAvL3NwaGVyZSBmb3Igd29ybGQgbWFwXHJcbiAgICAgICAgaWYgKG91dC5nZW9fID09ICdXT1JMRCcpIHtcclxuICAgICAgICAgICAgem9vbUdyb3VwXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5kYXR1bSh7IHR5cGU6ICdTcGhlcmUnIH0pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnc3BoZXJlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgb3V0Ll9wYXRoRnVuY3Rpb24pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tZ3JhdGljdWxlJylcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmIChvdXQuZHJhd0NvYXN0YWxNYXJnaW5fKSB7XHJcbiAgICAgICAgICAgIGFkZENvYXN0YWxNYXJnaW5Ub01hcCgpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAob3V0Lmdlb21ldHJpZXNfKSB7XHJcbiAgICAgICAgICAgIG91dC5HZW9tZXRyaWVzLmFkZFVzZXJHZW9tZXRyaWVzVG9NYXAob3V0Lmdlb21ldHJpZXNfLCB6b29tR3JvdXAsIG91dC5fcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIG91dC5HZW9tZXRyaWVzLmFkZERlZmF1bHRHZW9tZXRyaWVzVG9NYXAoXHJcbiAgICAgICAgICAgICAgICB6b29tR3JvdXAsXHJcbiAgICAgICAgICAgICAgICBvdXQuZHJhd0dyYXRpY3VsZV8sXHJcbiAgICAgICAgICAgICAgICBvdXQuX3BhdGhGdW5jdGlvbixcclxuICAgICAgICAgICAgICAgIG91dC5udXRzTGV2ZWxfLFxyXG4gICAgICAgICAgICAgICAgb3V0Lm51dHNZZWFyXyxcclxuICAgICAgICAgICAgICAgIG91dC5nZW9fLFxyXG4gICAgICAgICAgICAgICAgb3V0LnByb2pfLFxyXG4gICAgICAgICAgICAgICAgb3V0LnNjYWxlX1xyXG4gICAgICAgICAgICApXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL3ByZXBhcmUgZ3JvdXAgZm9yIHByb3BvcnRpb25hbCBzeW1ib2xzLCB3aXRoIGNlbnRyb2lkc1xyXG4gICAgICAgIGlmICh3aXRoQ2VudGVyUG9pbnRzKSB7XHJcbiAgICAgICAgICAgIGFkZENlbnRyb2lkc1RvTWFwKG91dClcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIGFkZCBnZW9ncmFwaGljYWwgbGFiZWxzIHRvIG1hcFxyXG4gICAgICAgIGlmIChvdXQubGFiZWxzXykge1xyXG4gICAgICAgICAgICBhZGRMYWJlbHNUb01hcChvdXQsIHpvb21Hcm91cClcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmIChvdXQuYW5ub3RhdGlvbnNfKSB7XHJcbiAgICAgICAgICAgIGFwcGVuZEFubm90YXRpb25zKHpvb21Hcm91cCwgb3V0LmFubm90YXRpb25zXylcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vdGl0bGVcclxuICAgICAgICBpZiAob3V0LnRpdGxlKCkpIHtcclxuICAgICAgICAgICAgLy9kZWZpbmUgZGVmYXVsdCBwb3NpdGlvblxyXG4gICAgICAgICAgICBsZXQgY3NzQ2xhc3MgPSBvdXQuaXNJbnNldCA/ICdlbS1pbnNldC10aXRsZScgOiAnZW0tdGl0bGUnXHJcbiAgICAgICAgICAgIGlmICghb3V0LnRpdGxlUG9zaXRpb24oKSkgb3V0LnRpdGxlUG9zaXRpb24oWzEwLCBnZXRGb250U2l6ZUZyb21DbGFzcyhjc3NDbGFzcykgKyAob3V0LmlzSW5zZXQgPyAwIDogMTApXSlcclxuICAgICAgICAgICAgLy9kcmF3IHRpdGxlXHJcbiAgICAgICAgICAgIG91dC5zdmcoKVxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAndGl0bGUnICsgb3V0Lmdlb18pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCBjc3NDbGFzcylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LnRpdGxlUG9zaXRpb24oKVswXSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5Jywgb3V0LnRpdGxlUG9zaXRpb24oKVsxXSlcclxuICAgICAgICAgICAgICAgIC5odG1sKG91dC50aXRsZSgpKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKG91dC5zdWJ0aXRsZSgpKSB7XHJcbiAgICAgICAgICAgIGxldCBjc3NTdWJ0aXRsZUNsYXNzID0gb3V0LmlzSW5zZXQgPyAnZW0taW5zZXQtc3VidGl0bGUnIDogJ2VtLXN1YnRpdGxlJ1xyXG4gICAgICAgICAgICBsZXQgY3NzVGl0bGVDbGFzcyA9IG91dC5pc0luc2V0ID8gJ2VtLWluc2V0LXRpdGxlJyA6ICdlbS10aXRsZSdcclxuICAgICAgICAgICAgLy9kZWZpbmUgZGVmYXVsdCBwb3NpdGlvblxyXG4gICAgICAgICAgICBpZiAoIW91dC5zdWJ0aXRsZVBvc2l0aW9uKCkpXHJcbiAgICAgICAgICAgICAgICBvdXQuc3VidGl0bGVQb3NpdGlvbihbMTAsIGdldEZvbnRTaXplRnJvbUNsYXNzKGNzc1RpdGxlQ2xhc3MpICsgZ2V0Rm9udFNpemVGcm9tQ2xhc3MoY3NzU3VidGl0bGVDbGFzcykgKyAxNV0pXHJcbiAgICAgICAgICAgIC8vZHJhdyBzdWJ0aXRsZVxyXG4gICAgICAgICAgICBvdXQuc3ZnKClcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ3N1YnRpdGxlJyArIG91dC5nZW9fKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgY3NzU3VidGl0bGVDbGFzcylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LnN1YnRpdGxlUG9zaXRpb24oKVswXSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5Jywgb3V0LnN1YnRpdGxlUG9zaXRpb24oKVsxXSlcclxuICAgICAgICAgICAgICAgIC5odG1sKG91dC5zdWJ0aXRsZSgpKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9ib3R0b20gdGV4dFxyXG4gICAgICAgIGlmIChvdXQuZm9vdG5vdGVfKSB7XHJcbiAgICAgICAgICAgIGFkZEZvb3Rub3RlKClcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vc291cmNlIGRhdGFzZXQgVVJMXHJcbiAgICAgICAgaWYgKG91dC5zaG93U291cmNlTGlua18pIHtcclxuICAgICAgICAgICAgbGV0IHN0YXRcclxuICAgICAgICAgICAgaWYgKHdpdGhDZW50ZXJQb2ludHMpIHtcclxuICAgICAgICAgICAgICAgIHN0YXQgPSBvdXQuc3RhdCgnc2l6ZScpXHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBzdGF0ID0gb3V0LnN0YXQoKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChzdGF0KSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoc3RhdC5ldXJvc3RhdERhdGFzZXRDb2RlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9kYXRhc2V0IGxpbmtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgY29kZSA9IHN0YXQuZXVyb3N0YXREYXRhc2V0Q29kZVxyXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBgaHR0cHM6Ly9lYy5ldXJvcGEuZXUvZXVyb3N0YXQvZGF0YWJyb3dzZXIvdmlldy8ke2NvZGV9L2RlZmF1bHQvdGFibGU/bGFuZz1lbmBcclxuICAgICAgICAgICAgICAgICAgICBsZXQgbGluayA9IG91dFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc3ZnKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnYScpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zb3VyY2UtZGF0YXNldC1saW5rJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2hyZWYnLCB1cmwpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0YXJnZXQnLCAnX2JsYW5rJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zb3VyY2UtZGF0YXNldC1saW5rLXRleHQnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC53aWR0aF8pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5Jywgb3V0LmhlaWdodF8pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0KCdFVVJPU1RBVCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0ZXh0LWFuY2hvcicsICdlbmQnKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAvL3ByZXRleHQgXCJTb3VyY2U6XCJcclxuICAgICAgICAgICAgICAgICAgICBsZXQgbGlua1cgPSBsaW5rLm5vZGUoKS5nZXRDb21wdXRlZFRleHRMZW5ndGgoKVxyXG4gICAgICAgICAgICAgICAgICAgIG91dC5zdmcoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLXNvdXJjZS1wcmV0ZXh0JylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQud2lkdGhfIC0gbGlua1cgLSAyKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIG91dC5oZWlnaHRfKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAudGV4dCgnU291cmNlOicpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0ZXh0LWFuY2hvcicsICdlbmQnKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2FkZCBzY2FsZWJhclxyXG4gICAgICAgIGlmIChvdXQuc2hvd1NjYWxlYmFyXykge1xyXG4gICAgICAgICAgICBpZiAob3V0LnNjYWxlYmFyUG9zaXRpb25fLmxlbmd0aCAhPT0gMikge1xyXG4gICAgICAgICAgICAgICAgb3V0LnNjYWxlYmFyUG9zaXRpb25fWzBdID0gMTVcclxuICAgICAgICAgICAgICAgIG91dC5zY2FsZWJhclBvc2l0aW9uX1sxXSA9IG91dC5oZWlnaHRfIC0gNTBcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBhZGRTY2FsZWJhclRvTWFwKClcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiBvdXRcclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBkZWZpbmVEZWZhdWx0UG9zaXRpb24gPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgY29uc3QgZGVmYXVsdFBvc2l0aW9uID0gX2RlZmF1bHRQb3NpdGlvbltvdXQuZ2VvXyArICdfJyArIG91dC5wcm9qX11cclxuICAgICAgICBpZiAoZGVmYXVsdFBvc2l0aW9uKSB7XHJcbiAgICAgICAgICAgIG91dC5wb3NpdGlvbl8ueCA9IG91dC5wb3NpdGlvbl8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VJMKClcclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBnZXREZWZhdWx0WiA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBjb25zdCBkZWZhdWx0UG9zaXRpb24gPSBfZGVmYXVsdFBvc2l0aW9uW291dC5nZW9fICsgJ18nICsgb3V0LnByb2pfXVxyXG4gICAgICAgIGlmIChkZWZhdWx0UG9zaXRpb24pIHtcclxuICAgICAgICAgICAgcmV0dXJuIChkZWZhdWx0UG9zaXRpb24ucGl4ZWxTaXplICogODAwKSAvIG91dC53aWR0aF9cclxuICAgICAgICB9IGVsc2UgaWYgKG91dC5HZW9tZXRyaWVzLmRlZmF1bHRHZW9EYXRhPy5iYm94KSB7XHJcbiAgICAgICAgICAgIHJldHVybiBNYXRoLm1pbihcclxuICAgICAgICAgICAgICAgIChvdXQuR2VvbWV0cmllcy5kZWZhdWx0R2VvRGF0YS5iYm94WzJdIC0gb3V0Lkdlb21ldHJpZXMuZGVmYXVsdEdlb0RhdGEuYmJveFswXSkgLyBvdXQud2lkdGhfLFxyXG4gICAgICAgICAgICAgICAgKG91dC5HZW9tZXRyaWVzLmRlZmF1bHRHZW9EYXRhLmJib3hbM10gLSBvdXQuR2VvbWV0cmllcy5kZWZhdWx0R2VvRGF0YS5iYm94WzFdKSAvIG91dC5oZWlnaHRfXHJcbiAgICAgICAgICAgIClcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICByZXR1cm4gMTAwXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGNvbnN0IGRlZmluZVByb2plY3Rpb24gPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgLy8gRGVmaW5lIHByb2plY3Rpb24gYmFzZWQgb24gdGhlIGdlb2dyYXBoaWNhbCBjb250ZXh0XHJcblxyXG4gICAgICAgIGlmIChvdXQuZ2VvXyA9PT0gJ1dPUkxEJykge1xyXG4gICAgICAgICAgICAvLyBVc2UgUm9iaW5zb24gcHJvamVjdGlvbiB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WdodCA9IDAuNSAqIG91dC5wb3NpdGlvbl8ueiAqIG91dC5oZWlnaHRfXHJcbiAgICAgICAgY29uc3QgYmJveCA9IFtcclxuICAgICAgICAgICAgb3V0LnBvc2l0aW9uXy54IC0gaGFsZldpZHRoLFxyXG4gICAgICAgICAgICBvdXQucG9zaXRpb25fLnkgLSBoYWxmSGVpZ2h0LFxyXG4gICAgICAgICAgICBvdXQucG9zaXRpb25fLnggKyBoYWxmV2lkdGgsXHJcbiAgICAgICAgICAgIG91dC5wb3NpdGlvbl8ueSArIGhhbGZIZWlnaHQsXHJcbiAgICAgICAgXVxyXG4gICAgICAgIHJldHVybiBiYm94XHJcbiAgICB9XHJcblxyXG4gICAgY29uc3QgZGVmaW5lUGF0aEZ1bmN0aW9uID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIG91dC5fcGF0aEZ1bmN0aW9uID0gZ2VvUGF0aCgpLnByb2plY3Rpb24ob3V0Ll9wcm9qZWN0aW9uKVxyXG4gICAgfVxyXG5cclxuICAgIGNvbnN0IGRlZmluZU1hcFpvb20gPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgbGV0IHN2ZyA9IHNlbGVjdCgnIycgKyBvdXQuc3ZnSWQoKSlcclxuICAgICAgICBsZXQgcHJldmlvdXNUID0gem9vbUlkZW50aXR5XHJcbiAgICAgICAgY29uc3QgeG9vID0gem9vbSgpXHJcbiAgICAgICAgICAgIC5zY2FsZUV4dGVudChvdXQuem9vbUV4dGVudCgpKVxyXG4gICAgICAgICAgICAub24oJ3pvb20nLCBmdW5jdGlvbiAoZSkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgdCA9IGUudHJhbnNmb3JtXHJcbiAgICAgICAgICAgICAgICBpZiAodC5rICE9PSBwcmV2aW91c1Quaykge1xyXG4gICAgICAgICAgICAgICAgICAgIHpvb21IYW5kbGVyKGUsIHByZXZpb3VzVClcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAg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iAoZm9udFNpemUgJiYgcGFyc2VGbG9hdChmb250U2l6ZSkgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBvcmlnaW5hbEZvbnRTaXplID1cclxuICAgICAgICAgICAgICAgICAgICBwYXJzZUZsb2F0KGVsZW1lbnQuYXR0cignZGF0YS1mcycpKSB8fCBwYXJzZUZsb2F0KGlubGluZUZvbnRTaXplKSB8fCBwYXJzZUZsb2F0KGNzc0ZvbnRTaXplKVxyXG5cclxuICAgICAgICAgICAgICAgIC8vIFN0b3JlIHRoZSBvcmlnaW5hbCBmb250IHNpemUgZm9yIHRoZSBmaXJzdCB0aW1lXHJcbiAgICAgICAgICAgICAgICBpZiAoIWVsZW1lbnQuYXR0cignZGF0YS1mcycpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCdkYXRhLWZzJywgb3JpZ2luYWxGb250U2l6ZSlcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAvLyBDYWxjdWxhdGUgdGhlIHRhcmdldCBmb250IHNpemUgYmFzZWQgb24gem9vbSBmYWN0b3JcclxuICAgICAgICAgICAgICAgIGNvbnN0IHRhcmdldEZvbnRTaXplID0gb3JpZ2luYWxGb250U2l6ZSAvIHpvb21GYWN0b3JcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBBZGQgdGhlIHN0eWxlIGNoYW5nZSB0byBhIGJhdGNoIGFycmF5XHJcbiAgICAgICAgICAgICAgICB1cGRhdGVzLnB1c2goeyBlbGVtZW50OiB0aGlzLCB0YXJnZXRGb250U2l6ZSB9KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSlcclxuXHJcbiAgICAgICAgLy8gQXBwbHkgYWxsIHN0eWxlIGNoYW5nZXMgYXQgb25jZVxyXG4gICAgICAgIHVwZGF0ZXMuZm9yRWFjaCgoeyBlbGVtZW50LCB0YXJnZXRGb250U2l6ZSB9KSA9PiB7XHJcbiAgICAgICAgICAgIG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V0IHgseSx6IGVsZW1lbnRzIGZyb20gVVJMIGFuZCBhc3NpZ24gdGhlbSB0byB0aGUgdmlldy4gKi9cclxuICAgIGNvbnN0IHNldFZpZXdGcm9tVVJMID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGNvbnN0IHggPSBnZXRQYXJhbWV0ZXJCeU5hbWUoJ3gnKSxcclxuICAgICAgICAgICAgeSA9IGdldFBhcmFtZXRlckJ5TmFtZSgneScpLFxyXG4gICAgICAgICAgICB6ID0gZ2V0UGFyYW1ldGVyQnlOYW1lKCd6JylcclxuICAgICAgICBpZiAoeCAhPSBudWxsICYmIHggIT0gdW5kZWZpbmVkICYmICFpc05hTigreCkpIG91dC5wb3NpdGlvbl8ueCA9ICt4XHJcbiAgICAgICAgaWYgKHkgIT0gbnVsbCAmJiB5ICE9IHVuZGVmaW5lZCAmJiAhaXNOYU4oK3kpKSBvdXQucG9zaXRpb25fLnkgPSAreVxyXG4gICAgICAgIGlmICh6ICE9IG51bGwgJiYgeiAhPSB1bmRlZmluZWQgJiYgIWlzTmFOKCt6KSkgb3V0LnBvc2l0aW9uXy56ID0gK3pcclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBhZGRGb290bm90ZSA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBvdXQuc3ZnKClcclxuICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1mb290bm90ZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1mb290bm90ZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgMClcclxuICAgICAgICAgICAgLmF0dHIoJ3knLCBvdXQuaGVpZ2h0XylcclxuICAgICAgICAgICAgLmh0bWwob3V0LmZvb3Rub3RlXylcclxuICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICBvdXQuX3Rvb2x0aXA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xuICAgICAgICAvL2NvdW50cmllcyBiblxyXG4gICAgICAgIGlmIChvdXQuR2VvbWV0cmllcy5nZW9KU09Ocy5jbnRibikge1xyXG4gICAgICAgICAgICBjZy5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2VtLWNvYXN0LW1hcmdpbi1jbnQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWNvYXN0LW1hcmdpbi1jbnQnKVxyXG4gICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuZGF0YShvdXQuR2VvbWV0cmllcy5nZW9KU09Ocy5jbnRibilcclxuICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChibikge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBibi5wcm9wZXJ0aWVzLmNvID09PSAnVCdcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgb3V0Ll9wYXRoRnVuY3Rpb24pXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL251dHMgYm5cclxuICAgICAgICBpZiAob3V0Lkdlb21ldHJpZXMuZ2VvSlNPTnMubnV0c2JuKSB7XHJcbiAgICAgICAgICAgIGNnLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tY29hc3QtbWFyZ2luLW51dHMnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWNvYXN0LW1hcmdpbi1udXRzJylcclxuICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmRhdGEob3V0Lkdlb21ldHJpZXMuZ2VvSlNPTnMubnV0c2JuKVxyXG4gICAgICAgICAgICAgICAgLmVudGVyKClcclxuICAgICAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24gKGJuKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJuLnByb3BlcnRpZXMuY28gPT09ICdUJ1xyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2QnLCBvdXQuX3BhdGhGdW5jdGlvbilcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vd29ybGQgYm5cclxuICAgICAgICBpZiAob3V0Lkdlb21ldHJpZXMuZ2VvSlNPTnMud29ybGRibikge1xyXG4gICAgICAgICAgICBjZy5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2VtLWNvYXN0LW1hcmdpbi13b3JsZCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tY29hc3QtbWFyZ2luLXdvcmxkJylcclxuICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmRhdGEob3V0Lkdlb21ldHJpZXMuZ2VvSlNPTnMud29ybGRibilcclxuICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChibikge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBibi5wcm9wZXJ0aWVzLkNPQVNfRkxBRyA9PT0gJ1QnXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZCcsIG91dC5fcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBhZGRDZW50cm9pZHNUb01hcCA9IGZ1bmN0aW9uIChtYXApIHtcclxuICAgICAgICBsZXQgY2VudHJvaWRGZWF0dXJlc1xyXG5cclxuICAgICAgICBpZiAoIW1hcC5HZW9tZXRyaWVzLmNlbnRyb2lkc0RhdGEpIHtcclxuICAgICAgICAgICAgLy8gaWYgY2VudHJvaWRzIGRhdGEgaXMgYWJzZW50IChlLmcuIGZvciB3b3JsZCBtYXBzKSB0aGVuIGNhbGN1bGF0ZSBtYW51YWxseVxyXG4gICAgICAgICAgICBpZiAobWFwLmdlb18gPT0gJ1dPUkxEJykge1xyXG4gICAgICAgICAgICAgICAgY2VudHJvaWRGZWF0dXJlcyA9IFtdXHJcbiAgICAgICAgICAgICAgICBtYXAuR2VvbWV0cmllcy5nZW9KU09Ocy53b3JsZHJnLmZvckVhY2goKGZlYXR1cmUpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgbmV3RmVhdHVyZSA9IHsgLi4uZmVhdHVyZSB9XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gZXhjZXB0aW9uIGZvciBGcmFuY2UgKGJlY2F1c2UgZ3V5YW5lKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChmZWF0dXJlLnByb3BlcnRpZXMuaWQgPT0gJ0ZSJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdGZWF0dXJlLmdlb21ldHJ5ID0ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29vcmRpbmF0ZXM6IFsyLjIsIDQ2LjJdLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ1BvaW50JyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0ZlYXR1cmUuZ2VvbWV0cnkgPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29yZGluYXRlczogZ2VvQ2VudHJvaWQoZmVhdHVyZSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnUG9pbnQnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNlbnRyb2lkRmVhdHVyZXMucHVzaChuZXdGZWF0dXJlKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIGlmIChtYXAubnV0c0xldmVsXyA9PSAnbWl4ZWQnKSB7XHJcbiAgICAgICAgICAgICAgICBjZW50cm9pZEZlYXR1cmVzID0gW1xyXG4gICAgICAgICAgICAgICAgICAgIC4uLm1hcC5HZW9tZXRyaWVzLmNlbnRyb2lkc0RhdGFbMF0uZmVhdHVyZXMsXHJcbiAgICAgICAgICAgICAgICAgICAgLi4ubWFwLkdlb21ldHJpZXMuY2VudHJvaWRzRGF0YVsxXS5mZWF0dXJlcyxcclxuICAgICAgICAgICAgICAgICAgICAuLi5tYXAuR2VvbWV0cmllcy5jZW50cm9pZHNEYXRhWzJdLmZlYXR1cmVzLFxyXG4gICAgICAgICAgICAgICAgICAgIC4uLm1hcC5HZW9tZXRyaWVzLmNlbnRyb2lkc0RhdGFbM10uZmVhdHVyZXMsXHJcbiAgICAgICAgICAgICAgICBdXHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBjZW50cm9pZEZlYXR1cmVzID0gbWFwLkdlb21ldHJpZXMuY2VudHJvaWRzRGF0YS5mZWF0dXJlc1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAobWFwLnByb2Nlc3NDZW50cm9pZHNfKSBjZW50cm9pZEZlYXR1cmVzID0gbWFwLnByb2Nlc3NDZW50cm9pZHNfKGNlbnRyb2lkRmVhdHVyZXMpXHJcblxyXG4gICAgICAgIG1hcC5fY2VudHJvaWRGZWF0dXJlcy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RoTSlcclxuICAgICAgICBjb25zdCBuaWNlTGVuZ3RoUGl4ZWwgPSBuaWNlTGVuZ3RoTVswXSAvIHBpeGVsU2l6ZU1cclxuICAgICAgICBjb25zdCBzY2FsZUJhclN0YXJ0RGlnaXQgPSBuaWNlTGVuZ3RoTVsxXVxyXG4gICAgICAgIGNvbnN0IHN1YmRpdmlzaW9uTmJzID0ge1xyXG4gICAgICAgICAgICAxOiA0LFxyXG4gICAgICAgICAgICAyOiAyLFxyXG4gICAgICAgICAgICA1OiA1LFxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgY29uc3Qgc2NhbGViYXJTVkcgPSBvdXRcclxuICAgICAgICAgICAgLnN2ZygpXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ3N2ZycpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhcicpXHJcbiAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LnNjYWxlYmFyUG9zaXRpb25fWzBdKVxyXG4gICAgICAgICAgICAuYXR0cigneScsIG91dC5zY2FsZWJhclBvc2l0aW9uX1sxXSlcclxuICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgbWF4TGVuZ3RoUGl4ICsgMjApXHJcbiAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBvdXQuc2NhbGViYXJIZWlnaHRfKVxyXG5cclxuICAgICAgICAvLyB0b3AgbGluZSBmdWxsIHdpZHRoXHJcbiAgICAgICAgc2NhbGViYXJTVkdcclxuICAgICAgICAgICAgLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1saW5lJylcclxuICAgICAgICAgICAgLmF0dHIoJ3gxJywgbWFyZ2luTGVmdClcclxuICAgICAgICAgICAgLmF0dHIoJ3kxJywgMSlcclxuICAgICAgICAgICAgLmF0dHIoJ3gyJywgbmljZUxlbmd0aFBpeGVsICsgbWFyZ2luTGVmdClcclxuICAgICAgICAgICAgLmF0dHIoJ3kyJywgMSlcclxuXHJcbiAgICAgICAgLy9ib3R0b20gbGluZSBmdWxsIHdpZHRoXHJcbiAgICAgICAgc2NhbGViYXJTVkdcclxuICAgICAgICAgICAgLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1saW5lJylcclxuICAgICAgICAgICAgLmF0dHIoJ3gxJywgbWFyZ2luTGVmdClcclxuICAgICAgICAgICAgLmF0dHIoJ3kxJywgb3V0LnNjYWxlYmFyU2VnbWVudEhlaWdodF8pXHJcbiAgICAgICAgICAgIC5hdHRyKCd4MicsIG5pY2VMZW5ndGhQaXhlbCArIG1hcmdpbkxlZnQpXHJcbiAgICAgICAgICAgIC5hdHRyKCd5MicsIG91dC5zY2FsZWJhclNlZ21lbnRIZWlnaHRfKVxyXG5cclxuICAgICAgICAvL2ZpcnN0IHRpY2tcclxuICAgICAgICBzY2FsZWJhclNWR1xyXG4gICAgICAgICAgICAuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLXNjYWxlYmFyLWxpbmUnKVxyXG4gICAgICAgICAgICAuYXR0cigneDEnLCBtYXJnaW5MZWZ0KVxyXG4gICAgICAgICAgICAuYXR0cigneTEnLCAxKVxyXG4gICAgICAgICAgICAuYXR0cigneDInLCBtYXJnaW5MZWZ0KVxyXG4gICAgICAgICAgICAuYXR0cigneTInLCBvdXQuc2NhbGViYXJUaWNrSGVpZ2h0XylcclxuXHJcbiAgICAgICAgc2NhbGViYXJTVkdcclxuICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1sYWJlbCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgbWFyZ2luTGVmdCArIHRleHRPZmZzZXRYKVxyXG4gICAgICAgICAgICAuYXR0cigneScsIG91dC5zY2FsZWJhclRpY2tIZWlnaHRfICsgdGV4dE9mZnNldFkpXHJcbiAgICAgICAgICAgIC50ZXh0KCcwJylcclxuXHJcbiAgICAgICAgLy9taWRkbGUgdGlja3NcclxuICAgICAgICBjb25zdCBzdWJkaXZpc2lvbk5iID0gc3ViZGl2aXNpb25OYnNbc2NhbGVCYXJTdGFydERpZ2l0XVxyXG4gICAgICAgIGNvbnN0IGRpdmlzaW9uV2lkdGggPSBuaWNlTGVuZ3RoUGl4ZWwgLyBzdWJkaXZpc2lvbk5iXHJcbiAgICAgICAgY29uc3QgZGl2aXNpb25NaW5XaWR0aCA9IDE1XHJcbiAgICAgICAgaWYgKGRpdmlzaW9uV2lkdGggPj0gZGl2aXNpb25NaW5XaWR0aCkge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IHN1YmRpdmlzaW9uTmI7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgc2NhbGViYXJTVkdcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tc2NhbGViYXItbGluZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gxJywgbWFyZ2luTGVmdCArIG91dC5zY2FsZWJhclN0cm9rZVdpZHRoXyAvIDIgKyBpICogZGl2aXNpb25XaWR0aClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneTEnLCAxKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIG1hcmdpbkxlZnQgKyBvdXQuc2NhbGViYXJTdHJva2VXaWR0aF8gLyAyICsgaSAqIGRpdmlzaW9uV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgb3V0LnNjYWxlYmFyVGlja0hlaWdodF8pXHJcbiAgICAgICAgICAgICAgICBzY2FsZWJhclNWR1xyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBtYXJnaW5MZWZ0ICsgdGV4dE9mZnNldFggKyBpICogZGl2aXNpb25XaWR0aClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIG91dC5zY2FsZWJhclRpY2tIZWlnaHRfICsgdGV4dE9mZnNldFkpXHJcbiAgICAgICAgICAgICAgICAgICAgLnRleHQoZ2V0U2NhbGViYXJMYWJlbCgobmljZUxlbmd0aE1bMF0gLyBzdWJkaXZpc2lvbk5iKSAqIGkpKVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvL2V2ZXJ5IG90aGVyIHNlZ21lbnQgbWlkLWxpbmVcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IC0xOyBpIDwgc3ViZGl2aXNpb25OYjsgaSArPSAyKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaSA9PSAxKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLXNjYWxlYmFyLWxpbmUnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneDEnLCBtYXJnaW5MZWZ0ICsgb3V0LnNjYWxlYmFyU3Ryb2tlV2lkdGhfIC0gMSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kxJywgb3V0LnNjYWxlYmFyU2VnbWVudEhlaWdodF8gLyAyKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneDInLCBtYXJnaW5MZWZ0ICsgb3V0LnNjYWxlYmFyU3Ryb2tlV2lkdGhfIC8gMiArIGkgKiBkaXZpc2lvbldpZHRoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneTInLCBvdXQuc2NhbGViYXJTZWdtZW50SGVpZ2h0XyAvIDIpXHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCB4MSA9IG1hcmdpbkxlZnQgKyBvdXQuc2NhbGViYXJTdHJva2VXaWR0aF8gLyAyICsgKGkgLSAxKSAqIGRpdmlzaW9uV2lkdGhcclxuICAgICAgICAgICAgICAgICAgICBpZiAoeDEgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tc2NhbGViYXItbGluZScpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneDEnLCB4MSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5MScsIG91dC5zY2FsZWJhclNlZ21lbnRIZWlnaHRfIC8gMilcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIG1hcmdpbkxlZnQgKyBvdXQuc2NhbGViYXJTdHJva2VXaWR0aF8gLyAyICsgaSAqIGRpdmlzaW9uV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneTInLCBvdXQuc2NhbGViYXJTZWdtZW50SGVpZ2h0XyAvIDIpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgLy8gc2luZ2xlIGZ1bGwtbGVuZ3RoIGhvcml6b250YWwgbWlkLWxpbmVcclxuICAgICAgICAgICAgc2IuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1saW5lJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4MScsIG1hcmdpbkxlZnQgKyBvdXQuc2NhbGViYXJTdHJva2VXaWR0aF8gLSAxKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3kxJywgb3V0LnNjYWxlYmFyU2VnbWVudEhlaWdodF8gLyAyKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gyJywgbWFyZ2luTGVmdCArIG91dC5zY2FsZWJhclN0cm9rZVdpZHRoXyAvIDIgKyBkaXZpc2lvbldpZHRoICogc3ViZGl2aXNpb25OYilcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5MicsIG91dC5zY2FsZWJhclNlZ21lbnRIZWlnaHRfIC8gMilcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vbGFzdCB0aWNrXHJcbiAgICAgICAgc2NhbGViYXJTVkdcclxuICAgICAgICAgICAgLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1saW5lJylcclxuICAgICAgICAgICAgLmF0dHIoJ3gxJywgbmljZUxlbmd0aFBpeGVsICsgbWFyZ2luTGVmdClcclxuICAgICAgICAgICAgLmF0dHIoJ3kxJywgMSlcclxuICAgICAgICAgICAgLmF0dHIoJ3gyJywgbmljZUxlbmd0aFBpeGVsICsgbWFyZ2luTGVmdClcclxuICAgICAgICAgICAgLmF0dHIoJ3kyJywgb3V0LnNjYWxlYmFyVGlja0hlaWdodF8pXHJcbiAgICAgICAgc2NhbGViYXJTVkdcclxuICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1sYWJlbCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgbmljZUxlbmd0aFBpeGVsICsgbWFyZ2luTGVmdCArIHRleHRPZmZzZXRYKVxyXG4gICAgICAgICAgICAuYXR0cigneScsIG91dC5zY2FsZWJhclRpY2tIZWlnaHRfICsgdGV4dE9mZnNldFkpXHJcbiAgICAgICAgICA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b25maWcuaGVpZ2h0ID0gY29uZmlnLmhlaWdodCB8fCBvdXQuaW5zZXRCb3hXaWR0aF9cclxuICAgICAgICBjb25maWcuaW5zZXRzID0gY29uZmlnLmluc2V0cyB8fCBbXVxyXG4gICAgICAgIGNvbmZpZy5pbnNldFRlbXBsYXRlcyA9IGNvbmZpZy5pbnNldFRlbXBsYXRlcyB8fCB7fVxyXG4gICAgICAgIGNvbmZpZy5jYWxsYmFjayA9IGNvbmZpZy5jYWxsYmFjayB8fCB1bmRlZmluZWRcclxuXHJcbiAgICAgICAgLy9jb3B5IHRlbXBsYXRlIGF0dHJpYnV0ZXNcclxuICAgICAgICA7W1xyXG4gICAgICAgICAgICAnbnV0c0xldmVsXycsXHJcbiAgICAgICAgICAgICdudXRzWWVhcl8nLFxyXG4gICAgICAgICAgICAnaG92ZXJDb2xvcl8nLFxyXG4gICAgICAgICAgICAvLydudXRzYm5TdHJva2VfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAvLyAnbnV0c2JuU3Ryb2tlV2lkdGhfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnY250cmdGaWxsU3R5bGVfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnY250Ym5TdHJva2VfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnY250Ym5TdHJva2VXaWR0aF8nLCAvLyBERVBSRUNBVEVEXHJcbiAgICAgICAgICAgICdzZWFGaWxsU3R5bGVfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnZHJhd0NvYXN0YWxNYXJnaW5fJyxcclxuICAgICAgICAgICAgJ2NvYXN0YWxNYXJnaW5Db2xvcl8nLCAvLyBERVBSRUNBVEVEXHJcbiAgICAgICAgICAgICdjb2FzdGFsTWFyZ2luV2lkdGhfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnY29hc3RhbE1hcmdpblN0ZERldl8nLFxyXG4gICAgICAgICAgICAnZ3JhdGljdWxlU3Ryb2tlXycsIC8vIERFUFJFQ0FURURcclxuICAgICAgICAgICAgJ2dyYXRpY3VsZVN0cm9rZVdpZHRoXycsIC8vIERFUFJFQ0FURURcclxuICAgICAgICAgICAgJ2xhYmVsbGluZ18nLCAvLyBERVBSRUNBVEVEXHJcbiAgICAgICAgICAgICdsYWJlbEZpbGxfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnbGFiZWxWYWx1ZXNGb250U2l6ZV8nLCAvLyBERVBSRUNBVEVEXHJcbiAgICAgICAgICAgICdsYWJlbE9wYWNpdHlfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnbGFiZWxTdHJva2VfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnbGFiZWxTdHJva2VXaWR0aF8nLCAvLyBERVBSRUNBVEVEXHJcbiAgICAgICAgICAgICdsYWJlbFNoYWRvd1dpZHRoXycsIC8vIERFUFJFQ0FURURcclxuICAgICAgICAgICAgJ2xhYmVsU2hhZG93XycsIC8vIERFUFJFQ0FURURcclxuICAgICAgICAgICAgJ2xhYmVsU2hhZG93Q29sb3JfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnbGFiZWxTaGFkb3dzVG9TaG93XycsXHJcbiAgICAgICAgICAgICdsYWJlbHNUb1Nob3dfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnZm9udEZhbWlseV8nLCAvLyBERVBSRUNBVEVEXHJcbiAgICAgICAgICAgICdsZ18nLFxyXG4gICAgICAgICAgICAncHJvamVjdGlvbkZ1bmN0aW9uXycsXHJcbiAgICAgICAgICAgICdmaWx0ZXJHZW9tZXRyaWVzRnVuY3Rpb25fJyxcclxuICAgICAgICBdLmZvckVhY2goZnVuY3Rpb24gKGF0dCkge1xyXG4gICAgICAgICAgICBtdFthdHRdID0gb3V0W2F0dF1cclxuICAgICAgICB9KVxyXG5cclxuICAgICAgICAvL2NvcHkgc3RhdCBtYXA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AwLjI1ICogcyxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgZ2VvOiAnUkUnLFxyXG4gICAgICAgICAgICB4OiAwLjc1ICogcyxcclxuICAgICAgICAgICAgeTogMS4wNSAqIHMgKyBwLFxyXG4gICAgICAgICAgICB3aWR0aDogMC4yNSAqIHMsXHJcbiAgICAgICAgICAgIGhlaWdodDogMC4yNSAqIHMsXHJcbiAgICAgICAgfSxcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGdlbzogJ1BUMjAnLFxyXG4gICAgICAgICAgICB4OiAwLFxyXG4gICAgICAgICAgICB5OiAxLjMgKiBzICsgMiAqIHAsXHJcbiAgICAgICAgICAgIHdpZHRoOiAwLjc1ICogcyxcclxuICAgICAgICAgICAgaGVpZ2h0OiAwLjI1ICogcyxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgZ2VvOiAnUFQzMCcsXHJcbiAgICAgICAgICAgIHg6IDAuNzUgKiBzLFxyXG4gICAgICAgICAgICB5OiAxLjMgKiBzICsgMiAqIHAsXHJcbiAgICAgICAgICAgIHdpZHRoOiAwLjI1ICogcyxcclxuICAgICAgICAgICAgaGVpZ2h0OiAwLjI1ICogcyxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHsgZ2VvOiAnTVQnLCB4OiAwLCB5OiAxLjU1ICogcyArIDMgKiBwLCB3aWR0aDogMC4yNSAqIHMsIGhlaWdodDogMC4yNSAqIHMgfSxcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGdlbzogJ0xJJyxcclxuICAgICAgICAgICAgeDogMC4yNSAqIHMsXHJcbiAgICAgICAgICAgIHk6IDEuNTUgKiBzICsgMyAqIHAsXHJcbiAgICAgICAgICAgIHdpZHRoOiAwLjI1ICogcyxcclxuICAgICAgICAgICAgaGVpZ2h0OiAwLjI1ICogcyxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgZ2VvOiAnU0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V0Ll9kYXRhXylcclxuICAgICAgICAgICAgLm1hcCgocykgPT4gcy52YWx1ZSlcclxuICAgICAgICAgICAgLmZpbHRlcigoaXRlbSwgaSwgYXIpID0+IGFyLmluZGV4T2YoaXRlbSkgPT09IGkpXHJcbiAgICB9XHJcblxyXG4gICAgLyoqIEdldCBtaW4gdmFsdWUuICovXHJcbiAgICBvdXQuZ2V0TWluID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGlmIChvdXQuX2RhdGFfKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBPYmplY3QudmFsdWVzKG91dC5fZGF0YV8pXHJcbiAgICAgICAgICAgICAgICAubWFwKChzKSA9PiBzLnZhbHVlKVxyXG4gICAgICAgICAgICAgICAgLmZpbHRlcigocykgPT4gcyA9PSAwIHx8IChzICYmIHMgIT09ICc6JykpXHJcbiAgICAgICAgICAgICAgICAucmVkdWNlKChhY2MsIHYpID0+IE1hdGgubWluKGFjYywgdikpXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgLyoqIEdldCBtYXggdmFsdWUuICovXHJcbiAgICBvdXQuZ2V0TWF4ID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGlmIChvdXQuX2RhdGFfKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBPYmplY3QudmFsdWVzKG91dC5fZGF0YV8pXHJcbiAgICAgICAgICAgICAgICAubWFwKChzKSA9PiBzLnZhbHVlKVxyXG4gICAgICAgICAgICAgICAgLmZpbHRlcigocykgPT4gcyA9PSAwIHx8IChzICYmIHMgIT09ICc6JykpXHJcbiAgICAgICAgICAgICAgICAucmVkdWNlKChhY2MsIHYpID0+IE1hdGgubWF4KGFjYywgdikpXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8qKiBDaGVjayBpZiB0aGUgc3RhdCBkYXRhIGlzIHJlYWR5LiAqL1xyXG4gICAgb3V0LmlzUmVhZHkgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAg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gICAgICAgICAgIHNvdXJjZToganNkLnNvdXJjZSxcclxuICAgICAgICAgICAgICAgIHVwZGF0ZWQ6IGpzZC51cGRhdGVkLFxyXG4gICAgICAgICAgICAgICAgZXh0ZW5zaW9uOiBqc2QuZXh0ZW5zaW9uLFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIG91dC5tZXRhZGF0YS50aW1lID0ganNkLkRpbWVuc2lvbigndGltZScpLmlkWzBdXHJcblxyXG4gICAgICAgICAgICAvL2luZGV4XHJcbiAgICAgICAgICAgIG91dC5fZGF0YV8gPSBqc29uc3RhdFRvSW5kZXgoanNkKVxyXG4gICAgICAgICAgICAvL1RPRE86IHVzZSBtYXliZSBodHRwczovL2dpdGh1Yi5jb20vYmFkb3NhL0pTT04tc3RhdC9ibG9iL21hc3Rlci91dGlscy9mcm9tdGFibGUubWQgdG8gYnVpbGQgZGlyZWN0bHkgYW4gaW5kZXggP1xyXG5cclxuICAgICAgICAgICAgaWYgKGNhbGxiYWNrKSBjYWxsYmFjaygpXHJcbiAgICAgICAgfSlcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIFJldHVybiB0aGUgdGltZSBzdGFtcCBvZiB0aGUganNvbnN0YXQgZGF0YXNldC5cclxuICAgICAqL1xyXG4gICAgb3V0LmdldFRpbWUgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgY29uc3QgdCA9IG91dC5maWx0ZXJzXy50aW1lXHJcbiAgICAgICAgaWYgKHQpIHJldHVybiB0XHJcbiAgICAgICAgaWYgKCFvdXQuX2RhdGFfKSByZXR1cm5cclxuICAgICAgICByZXR1cm4gb3V0Lm1ldGFkYXRhLnRpbWVcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIENTViBkYXRhIHNvdXJjZVxyXG4gICAgICovXHJcblxyXG4gICAgLyoqIFRoZSBDU1YgZmlsZSBVUkwgKi9cclxuICAgIG91dC5jc3ZVUkxfID0gdW5kZWZpbmVkXHJcbiAgIC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PSBsZWdlbmQueCA9PSB1bmRlZmluZWQgPyBvdXQud2lkdGgoKSAtIDEwMCAtIGxlZ2VuZC5ib3hQYWRkaW5nIDogbGVnZW5kLnhcclxuICAgICAgICAgICAgICAgIGNvbnN0IHkgPSBsZWdlbmQueSA9PSB1bmRlZmluZWQgPyBsZWdlbmQuYm94UGFkZGluZyA6IGxlZ2VuZC55XHJcblxyXG4gICAgICAgICAgICAgICAgLy9idWlsZCBsZWdlbmQgU1ZHIGluIGEgbmV3IGdyb3VwXHJcbiAgICAgICAgICAgICAgICBvdXQuc3ZnKClcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgeCArICcsJyArIHkgKyAnKScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnc3ZnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaWQnLCBsZWdlbmQuc3ZnSWQpXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIGxlZ2VuZC5idWlsZCgpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2RlZmluZSB0b29sdGlwXHJcbiAgICAgICAgLy9wcmVwYXJlIG1hcCB0b29sdGlwXHJcbiAgICAgICAgaWYgKG91dC50b29sdGlwXykge1xyXG4gICAgICAgICAgICBvdXQuX3Rvb2x0aXAgPSB0cC50b29sdGlwKG91dC50b29sdGlwXylcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAvL25vIGNvbmZpZyBzcGVjaWZpZWQsIHVzZSBkZWZhdWx0XHJcbiAgICAgICAgICAgIG91dC5fdG9vbHRpcCA9IHRwLnRvb2x0aXAoKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9sYXVuY2ggZ2VvI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ibnVtYmVyT2ZDbGFzc2VzXCI6Y2xhc3MgbnVtYmVyXHJcbiAgICAgKi9cclxuICAgIG91dC5zZXRGcm9tVVJMID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGNvbnN0IG9wdHMgPSBnZXRVUkxQYXJhbWV0ZXJzKClcclxuICAgICAgICBpZiAob3B0cy53KSBvdXQud2lkdGgob3B0cy53KVxyXG4gICAgICAgIGlmIChvcHRzLmgpIG91dC5oZWlnaHQob3B0cy5oKVxyXG4gICAgICAgIGlmIChvcHRzLnggJiYgb3B0cy55KSBvdXQuZ2VvQ2VudGVyKFtvcHRzLngsIG9wdHMueV0pXHJcbiAgICAgICAgaWYgKG9wdHMueikgb3V0LnBpeGVsU2l6ZShvcHRzLnopXHJcbiAgICAgICAgaWYgKG9wdHMucykgb3V0LnNjYWxlKG9wdHMucylcclxuICAgICAgICBpZiAob3B0cy5sdmwpIG91dC5udXRzTGV2ZWwob3B0cy5sdmwpXHJcbiAgICAgICAgaWYgKG9wdHMudGltZSkge1xyXG4gICAgICAgICAgICBvdXQuZmlsdGVyc18udGltZSA9IG9wdHMudGltZVxyXG4gICAgICAgICAgICBkZWxldGUgb3V0LmZpbHRlcnNfLmxhc3RUaW1lUGVyaW9kXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChvcHRzLnByb2opIG91dC5wcm9qKG9wdHMucHJvailcclxuICAgICAgICBpZiAob3B0cy5nZW8pIG91dC5nZW8ob3B0cy5nZW8pXHJcbiAgICAgICAgaWYgKG9wdHMubnkpIG91dC5udXRzWWVhcihvcHRzLm55KVxyXG4gICAgICAgIGlmIChvcHRzLmxhbmd1YWdlKSBvdXQubGFuZ3VhZ2Uob3B0cy5sYW5ndWFnZSlcclxuICAgICAgICBpZiAob3B0cy5udW1iZXJPZkNsYXNzZXMpIG91dC5udW1iZXJPZkNsYXNzZXMoK29wdHMubnVtYmVyT2ZDbGFzc2VzKVxyXG4gICAgICAgIHJldHVybiBvdXRcclxuICAgIH1c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ICAgICAgICAgICAgLy8gU3RlcCA2OiBDb252ZXJ0IHRoZSBjYW52YXMgdG8gYSBQTkcgYmxvYlxyXG4gICAgICAgICAgICBjYW52YXMudG9CbG9iKGZ1bmN0aW9uIChwbmdCbG9iKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBTdGVwIDc6IERvd25sb2FkIHRoZSBQTkcgZmlsZVxyXG4gICAgICAgICAgICAgICAgY29uc3QgcG5nVXJsID0gVVJMLmNyZWF0ZU9iamVjdFVSTChwbmdCbG9iKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgZG93bmxvYWRMaW5rID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYScpXHJcbiAgICAgICAgICAgICAgICBkb3dubG9hZExpbmsuaHJlZiA9IHBuZ1VybFxyXG4gICAgICAgICAgICAgICAgZG93bmxvYWRMaW5rLmRvd25sb2FkID0gJ2V1cm9zdGF0LW1hcC5wbmcnXHJcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKGRvd25sb2FkTGluaylcclxuICAgICAgICAgICAgICAgIGRvd25sb2FkTGluay5jbGljaygpXHJcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5ib2R5LnJlbW92ZUNoaWxkKGRvd25sb2FkTGluaylcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBDbGVhbiB1cCBVUkxzXHJcbiAgICAgICAgICAgICAgICBVUkwucmV2b2tlT2JqZWN0VVJMKHVybClcclxuICAgICAgICAgICAgICAgIFVSTC5yZXZva2VPYmplY3RVUkwocG5nVXJsKVxyXG4gICAgICAgICAgICB9LCAnaW1hZ2UvcG5nJylcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIFNldCB0aGUgaW1hZ2Ugc291cmNlIHRvIHRoZSBCbG9iIFVSTFxyXG4gICAgICAgIGltZy5zcmMgPSB1cmxcclxuICAgICAgICByZXR1cm4gb3V0XHJcbiAgICB9XHJcblxyXG4gICAgcmV0dXJuIG91dFx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gICAgICAgICAgICAgLmF0dHIoJ3gnLCAwKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCAwKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgcHMpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgcHMpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsICdub25lJylcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIG9wdHMuYmNrQ29sb3IpXHJcbiAgICAgICAgICAgIGlmIChvcHRzLnNoYXBlID09ICdzcXVhcmUnKVxyXG4gICAgICAgICAgICAgICAgcGF0dC5hcHBlbmQoJ3JlY3QnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgMClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIDApXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgc2kpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIHNpKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgJ25vbmUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIG9wdHMuc3ltYkNvbG9yKVxyXG4gICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICBwYXR0LmFwcGVuZCgnY2lyY2xlJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY3gnLCBwcyAqIDAuNSlcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY3knLCBwcyAqIDAuNSlcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigncicsIHNpICogMC41KVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgJ25vbmUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIG9wdHMuc3ltYkNvbG9yKVxyXG4gICAgICA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LnJlbW92ZSgpXHJcblxyXG4gICAgICAgIC8vZHJhdyBsZWdlbmQgYmFja2dyb3VuZCBib3hcclxuICAgICAgICBvdXQubWFrZUJhY2tncm91bmRCb3goKVxyXG5cclxuICAgICAgICAvL2RyYXcgdGl0bGVcclxuICAgICAgICBpZiAob3V0LnRpdGxlKSB7XHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC10aXRsZScpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCBvdXQuYm94UGFkZGluZyArIG91dC50aXRsZUZvbnRTaXplKVxyXG4gICAgICAgICAgICAgICAgLnRleHQob3V0LnRpdGxlKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9nZXQgY2F0ZWdvcnkgY29kZXNcclxuICAgICAgICBjb25zdCBlY2xzID0gb3V0Lm9yZGVyID8gb3V0Lm9yZGVyIDogbS5jbGFzc2lmaWVyKCkuZG9tYWluKClcclxuXHJcbiAgICAgICAgLy9kcmF3IGxlZ2VuZCBlbGVtZW50cyBmb3IgY2xhc3NlczogcmVjdGFuZ2xlICsgbGFiZWxcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGVjbHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgLy90aGUgY2xhc3NcclxuICAgICAgICAgICAgY29uc3QgZWNsXyA9IGVjbHNbaV1cclxuICAgICAgICAgICAgY29uc3QgZWNsID0gbS5jbGFzc2lmaWVyKCkoZWNsXylcclxuICAgICAgICAgICAgY29uc3QgZmlsbENvbG9yID0gbS5jbGFzc1RvRmlsbFN0eWxlKClbZWNsX11cclxuXHJcbiAgICAgICAgICAgIC8vdGhlIHZlcnRpY2FsIHBvc2l0aW9uIG9mIHRoZSBsZWdlbmQgZWxlbWVudFxyXG4gICAgICAgICAgICBjb25zdCB5ID1cclxuICAgICAgICAgICAgICAgIG91dC5ib3hQYWRkaW5nICsgKG91dC50aXRsZSA/IG91dC50aXRsZUZvbnRTaXplICsgb3V0LmJveFBhZGRpbmcgOiAwKSArIGkgKiAob3V0LnNoYXBlSGVpZ2h0ICsgb3V0LnNoYXBlUGFkZGluZylcclxuXHJcbiAgICAgICAgICAgIC8vcmVjdGFuZ2xlXHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3JlY3QnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1yZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LmJveFBhZGRpbmcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHkpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBvdXQuc2hhcGVXaWR0aClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBvdXQuc2hhcGVIZWlnaHQpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBmaWxsQ29sb3IpXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBzZWxlY3QodGhpcykuc3R5bGUoJ2ZpbGwnLCBtLmhvdmVyQ29sb3JfKVxyXG4gICAgICAgICAgICAgICAgICAgIGhpZ2hsaWdodFJlZ2lvbnMob3V0Lm1hcCwgZWNsKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQuc3ZnSWRfLCBoaWdobGlnaHRSZWdpb25zLCBlY2wpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnN0eWxlKCdmaWxsJywgZmlsbENvbG9yKVxyXG4gICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwLCBlY2wpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5zdmdJZF8sIHVuaGlnaGxpZ2h0UmVnaW9ucywgZWNsKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAvL2xhYmVsXHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nICsgb3V0LnNoYXBlV2lkdGggKyBvdXQubGFiZWxPZmZzZXQpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHkgKyBvdXQuc2hhcGVIZWlnaHQgKiAwLjUpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZG9taW5hbnQtYmFzZWxpbmUnLCAnbWlkZGxlJylcclxuICAgICAgICAgICAgICAgIC50ZXh0KG0uY2xhc3NUb1RleHQoKSA/IG0uY2xhc3NUb1RleHQoKVtlY2xfXSA6IGVjbF8pXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLydubyBkYXRhJyBsZWdlbmQgYm94XHJcbiAgICAgICAgaWYgKG91dC5ub0RhdGEpIHtcclxuICAgICAgICAgICAgY29uc3QgeSA9XHJcbiAgICAgICAgICAgICAgICBvdXQuYm94UGFkZGluZyArXHJcbiAgICAgICAgICAgICAgICAob3V0LnRpdGxlID8gb3V0LnRpdGxlRm9udFNpemUgKyBvdXQuYm94UGFkZGluZyA6IDApICtcclxuICAgICAgICAgICAgICAgIGVjbHMubGVuZ3RoICogKG91dC5zaGFwZUhlaWdodCArIG91dC5zaGFwZVBhZGRpbmcpXHJcblxyXG4gICAgICAgICAgICAvL3JlY3RhbmdsZVxyXG4gICAgICAgICAgICBsZ2cuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtcmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgb3V0LnNoYXBlV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0Jywgb3V0LnNoYXBlSGVpZ2h0KVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgbS5ub0RhdGFGaWxsU3R5bGVfKVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwLCAnbmQnKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQuc3ZnSWRfLCBoaWdobGlnaHRSZWdpb25zLCAnbmQnKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwLCAnbmQnKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQuc3ZnSWRfLCB1bmhpZ2hsaWdodFJlZ2lvbnMsICduZCcpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIC8vJ25vIGRhdGEnIGxhYmVsXHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nICsgb3V0LnNoYXBlV2lkdGggKyBvdXQubGFiZWxPZmZzZXQpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHkgKyBvdXQuc2hhcGVIZWlnaHQgKiAwLjUpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZG9taW5hbnQtYmFzZWxpbmUnLCAnbWlkZGxlJylcclxuICAgICAgICAgICAgICAgIC50ZXh0KG91dC5ub0RhdGFUZXh0KVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9zZXQgbGVnZW5kIGJveCBkaW1lbnNpb25zXHJcbiAgICAgICAgb3V0LnNldEJveERpbWVuc2lvbigpXHJcbiAgICB9XHJcblxyXG4gICAgLy8gSGlnaGxpZ2h0IHNlbGVjdGVkIHJlZ2lvbnMgb24gbW91c2VvdmVyXHJcbiA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hcmVcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tYml2YXJpYXRlLXNxdWFyZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBpbml0aWFsWCArIChudW1iZXJPZkNsYXNzZXMgLSAxIC0gaSkgKiBzeilcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIGogKiBzeilcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBzeilcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0Jywgc3opXHJcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgZmlsbClcclxuICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwLCBlY2wxLCBlY2wyKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIGhpZ2hsaWdodFJlZ2lvbnMsIGVjbDEsIGVjbDIpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnJhaXNlKCkgLy8gcmFpc2UgbGVnZW5kIHNxdWFyZSB0byBhdm9pZCBzdHJva2UgaXNzdWVcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIHVuaGlnaGxpZ2h0UmVnaW9ucywgZWNsMSwgZWNsMilcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIHNldCBicmVha3MgaWYgdXNlciBoYXNudCBkZWZpbmVkIHRoZW0gYnV0IGhhcyBlbmFibGVkIHRoZW1cclxuICAgICAgICBpZiAoIW91dC5icmVha3MxICYmICFvdXQuYnJlYWtzMiAmJiBvdXQuc2hvd0JyZWFrcykge1xyXG4gICAgICAgICAgICAvLyBHZXQgcXVhbnRpbGVzIGZvciB0aGUgZmlyc3QgdmFyaWFibGUgKFggYXhpcykgYW5kIHRydW5jYXRlIHRvIG9uZSBkZWNpbWFsIHBsYWNlXHJcbiAgICAgICAgICAgIG91dC5icmVha3MxID0gbWFwLmNsYXNzaWZpZXIxXy5xdWFudGlsZXMoKS5tYXAoKHZhbHVlKSA9PiBwYXJzZUZsb2F0KHZhbHVlLnRvRml4ZWQoMCkpKVxyXG5cclxuICAgICAgICAgICAgLy8gR2V0IHF1YW50aWxlcyBmb3IgdGhlIHNlY29uZCB2YXJpYWJsZSAoWSBheGlzKSBhbmQgdHJ1bmNhdGUgdG8gb25lIGRlY2ltYWwgcGxhY2VcclxuICAgICAgICAgICAgb3V0LmJyZWFrczIgPSBtYXAuY2xhc3NpZmllcjJfLnF1YW50aWxlcygpLm1hcCgodmFsdWUpID0+IHBhcnNlRmxvYXQodmFsdWUudG9GaXhlZCgwKSkpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBEcmF3IGJyZWFrcyBsYWJlbHMgMSAoWCBheGlzKVxyXG4gICAgICAgIGlmIChvdXQuYnJlYWtzMSkge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG91dC5icmVha3MxLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCB4ID0gaW5pdGlhbFggKyBzeiAqIChpICsgMSlcclxuICAgICAgICAgICAgICAgIGNvbnN0IHkgPSBvdXQuc3F1YXJlU2l6ZSArIGdldEZvbnRTaXplRnJvbUNsYXNzKCdlbS1iaXZhcmlhdGUtdGljay1sYWJlbCcpXHJcblxyXG4gICAgICAgICAgICAgICAgc3F1YXJlXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWJpdmFyaWF0ZS10aWNrLWxhYmVsJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsIHggKyBvdXQueEF4aXNMYWJlbHNPZmZzZXQueClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIHkgKyBvdXQueEF4aXNMYWJlbHNPZmZzZXQueSlcclxuICAgICAgICAgICAgICAgICAgICAudGV4dChvdXQuYnJlYWtzMVtpXSlcclxuXHJcbiAgICAgICAgICAgICAgICBzcXVhcmVcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tYml2YXJpYXRlLXRpY2snKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MScsIHggKyBvdXQueEF4aXNMYWJlbHNPZmZzZXQueClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneDInLCB4ICsgb3V0LnhBeGlzTGFiZWxzT2Zmc2V0LngpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kxJywgb3V0LnNxdWFyZVNpemUpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgb3V0LnNxdWFyZVNpemUgKyA1KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBEcmF3IGJyZWFrcyBsYWJlbHMgMiAoWSBheGlzKVxyXG4gICAgICAgIGlmIChvdXQuYnJlYWtzMikge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG91dC5icmVha3MyLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCB4ID0gaW5pdGlhbFhcclxuICAgICAgICAgICAgICAgIGNvbnN0IHkgPSBzeiAqIChpICsgMikgLSBzelxyXG5cclxuICAgICAgICAgICAgICAgIHNxdWFyZVxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1iaXZhcmlhdGUtdGljay1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCB4ICsgb3V0LnlBeGlzTGFiZWxzT2Zmc2V0LnkpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5IC0gb3V0LnlBeGlzTGFiZWxzT2Zmc2V0LngpXHJcbiAgICAgICAgICAgICAgICAgICAgLnRleHQoWy4uLm91dC5icmVha3MyXS5yZXZlcnNlKClbaV0pXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ21pZGRsZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGByb3RhdGUoLTkwLCAke3h9LCAke3l9KWApXHJcblxyXG4gICAgICAgICAgICAgICAgc3F1YXJlXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWJpdmFyaWF0ZS10aWNrJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneDEnLCB4KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIHggLSA1KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5MScsIHkpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgeSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gQXBwZW5kIFggYXhpcyBhcnJvd1xyXG4gICAgICAgIGxldCB4QXhpc0Fycm93WSA9IG91dC5zcXVhcmVTaXplICsgb3V0LmFycm93SGVpZ2h0ICsgb3V0LnhBeGlzTGFiZWxzT2Zmc2V0LnlcclxuICAgICAgICBpZiAob3V0LnNob3dCcmVha3MgfHwgKG91dC5icmVha3MxICYmIG91dC5icmVha3MyKSkgeEF4aXNBcnJvd1kgKz0gZ2V0Rm9udFNpemVGcm9tQ2xhc3MoJ2VtLWJpdmFyaWF0ZS10aWNrLWxhYmVsJykgLyAxLjUgLy8gbW92ZSBvdmVyIGZvciB0aWNrIGxhYmVsc1xyXG5cclxuICAgICAgICBzcXVhcmVcclxuICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1iaXZhcmlhdGUtYXhpcy1hcnJvdycpXHJcbiAgICAgICAgICAgIC5hdHRyKFxyXG4gICAgICAgICAgICAgICAgJ2QnLFxyXG4gICAgICAgICAgICAgICAgbGluZSgpKFtcclxuICAgICAgICAgICAgICAgICAgICBbaW5pdGlhbFgsIHhBeGlzQXJyb3dZXSxcclxuICAgICAgICAgICAgICAgICAgICBbaW5pdGlhbFggKyBvdXQuc3F1YXJlU2l6ZSwgeEF4aXNBcnJvd1ldLFxyXG4gICAgICAgICAgICAgICAgXSlcclxuICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAuYXR0cignc3Ryb2tlJywgJ2JsYWNrJylcclxuICAgICAgICAgICAgLmF0dHIoJ21hcmtlci1lbmQnLCAndXJsKCNhcnJvd2hlYWQpJylcclxuXHJcbiAgICAgICAgLy8gQXBwZW5kIFkgYXhpcyBhcnJvd1xyXG4gICAgICAgIGxldCB5QXhpc0Fycm93WCA9IC1vdXQuYXJyb3dIZWlnaHQgKyBvdXQueUF4aXNMYWJlbHNPZmZzZXQueFxyXG4gICAgICAgIGlmIChvdXQuc2hvd0JyZWFrcyB8fCAob3V0LmJyZWFrczEgJiYgb3V0LmJyZWFrczIpKSB5QXhpc0Fycm93WCAtPSBvdXQubGFiZWxGb250U2l6ZSAvIDIgLy8gbW92ZSBvdmVyIGZvciB0aWNrIGxhYmVsc1xyXG5cclxuICAgICAgICBzcXVhcmVcclxuICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1iaXZhcmlhdGUtYXhpcy1hcnJvdycpXHJcbiAgICAgICAgICAgIC5hdHRyKFxyXG4gICAgICAgICAgICAgICAgJ2QnLFxyXG4gICAgICAgICAgICAgICAgbGluZSgpKFtcclxuICAgICAgICAgICAgICAgICAgICBbeUF4aXNBcnJvd1gsIG91dC5zcXVhcmVTaXplXSxcclxuICAgICAgICAgICAgICAgICAgICBbeUF4aXNBcnJvd1gsIDBdLFxyXG4gICAgICAgICAgICAgICAgXSlcclxuICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAuYXR0cignc3Ryb2tlJywgJ2JsYWNrJylcclxuICAgICAgICAgICAgLmF0dHIoJ21hcmtlci1lbmQnLCAndXJsKCNhcnJvd2hlYWQpJylcclxuXHJcbiAgICAgICAgLy8gWCBheGlzIHRpdGxlXHJcbiAgICAgICAgc3F1YXJlXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tYml2YXJpYXR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oJ3knLCAwKVxyXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCBvdXQuc3F1YXJlU2l6ZSlcclxuICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIG91dC5zcXVhcmVTaXplKVxyXG4gICAgICAgICAgICAuYXR0cignc3Ryb2tlLXdpZHRoJywgMC43KVxyXG5cclxuICAgICAgICAvLyBBcnJvdyBkZWZzXHJcbiAgICAgICAgc3F1YXJlXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ2RlZnMnKVxyXG4gICAgICAgICAgICAuYXBwZW5kKCdtYXJrZXInKVxyXG4gICAgICAgICAgICAuYXR0cigndmlld0JveCcsIGAwIDAgJHtvdXQuYXJyb3dXaWR0aH0gJHtvdXQuYXJyb3dIZWlnaHR9YClcclxuICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2Fycm93aGVhZCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdyZWZYJywgMClcclxuICAgICAgICAgICAgLmF0dHIoJ3JlZlknLCA1KVxyXG4gICAgICAgICAgICAuYXR0cignbWFya2VyV2lkdGgnLCBvdXQuYXJyb3dXaWR0aClcclxuICAgICAgICAgICAgLmF0dHIoJ21hcmtlckhlaWdodCcsIG91dC5hcnJvd0hlaWdodClcclxuICAgICAgICAgICAgLmF0dHIoJ29yaWVudCcsICdhdXRvJylcclxuICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdkJywgJ00gMCAwIEwgNSA1IEwgMCAxMCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdtYXJrZXItdW5pdHMnLCAnc3Ryb2tlV2lkdGgnKVxyXG5cclxuICAgICAgICAvLyAnTm8gZGF0YScgbGVnZW5kIGJveFxyXG4gICAgICAgIGlmIChvdXQubm9EYXRhKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IG5vRGF0YVlPZmZzZXQgPVxyXG4gICAgICAgICAgICAgICAgb3V0LnJvdGF0aW9uID09PSAwID8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G4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHJlZ2lvbnMuc2VsZWN0QWxsKFwiW25kPSduZCddXCIpXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsLnN0eWxlKCdmaWxsJywgJ3JlZCcpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBuUmcgPSBvdXQubWFwLm51dHNMZXZlbF8gPT0gJ21peGVkJyA/IHNlbGVjdEFsbCgnI2VtLW51dHNyZycpIDogc2VsZWN0KCcjZW0tbnV0c3JnJylcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBuUmcuc2VsZWN0QWxsKFwiW25kPSduZCddXCIpXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsLnN0eWxlKCdmaWxsJywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0KHRoaXMpLmF0dHIoJ2ZpbGxfX18nKVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnN0eWxlKCdmaWxsJywgb3V0Lm1hcC5ub0RhdGFGaWxsU3R5bGUoKSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWJpdmFyaWF0ZS1ub2RhdGEtbGFiZWwnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZyArIG91dC5ub0RhdGFTaGFwZVdpZHRoICsgNSArIChvdXQucm90YXRpb24gPT0gMCA/IDEgOiAxNSkpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHkgKyBvdXQubm9EYXRhU2hhc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mZpZyB2YWx1ZXNcclxuICAgIGlmIChjb25maWcpIGZvciAobGV0IGtleSBpbiBjb25maWcpIG91dFtrZXldID0gY29uZmlnW2tleV1cclxuXHJcbiAgICAvL0BvdmVycmlkZVxyXG4gICAgb3V0LnVwZGF0ZSA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBjb25zdCBtID0gb3V0Lm1hcFxyXG4gICAgICAgIGNvbnN0IGxnZyA9IG91dC5sZ2dcclxuXHJcbiAgICAgICAgLy8gVXBkYXRlIGxlZ2VuZCBwYXJhbWV0ZXJzIGlmIG5lY2Vzc2FyeVxyXG4gICAgICAgIGlmIChtLmxlZ2VuZF8pIHtcclxuICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihvdXQsIG0ubGVnZW5kXylcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIFJlbW92ZSBwcmV2aW91cyBjb250ZW50XHJcbiAgICAgICAgbGdnLnNlbGVjdEFsbCgnKicpLnJlbW92ZSgpXHJcblxyXG4gICAgICAgIC8vIERyYXcgbGVnZW5kIGJhY2tncm91bmQgYm94IGFuZCB0aXRsZSBpZiBwcm92aWRlZFxyXG4gICAgICAgIG91dC5tYWtlQmFja2dyb3VuZEJveCgpXHJcbiAgICAgICAgaWYgKG91dC50aXRsZSkge1xyXG4gICAgICAgICAgICBsZXQgY3NzRm9udFNpemUgPSBnZXRGb250U2l6ZUZyb21DbGFzcygnZW0tbGVnZW5kLXRpdGxlJylcclxuICAgICAgICAgICAgbGdnLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLXRpdGxlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LmJveFBhZGRpbmcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIG91dC5ib3hQYWRkaW5nICsgY3NzRm9udFNpemUpXHJcbiAgICAgICAgICAgICAgICAudGV4dChvdXQudGl0bGUpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAob3V0LmJhckNoYXJ0KSB7XHJcbiAgICAgICAgICAgIGxldCB0aHJlc2hvbGRzID1cclxuICAgICAgICAgICAgICAgIG0udGhyZXNob2xkc18ubGVuZ3RoID4gMVxyXG4gICAgICAgICAgICAgICAgICAgID8gbS50aHJlc2hvbGRzX1xyXG4gICAgICAgICAgICAgICAgICAgIDogQXJyYXkuZnJvbSh7IGxlbmd0aDogbS5udW1iZXJPZkNsYXNzZXNfIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgLm1hcCgoXywgaW5kZXgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG0uY2xhc3NpZmllcigpLmludmVydEV4dGVudChpbmRleClbb3V0LmFzY2VuZGluZyA/IDAgOiAxXVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgLnNsaWNlKDEpIC8vIFJlbW92ZSB0aGUgZmlyc3QgZW50cnkgYW5kIHJldHVybiB0aGUgcmVzdCBhcyBhbiBhcnJheVxyXG4gICAgICAgICAgICBsZXQgY29sb3JzID0gbS5jb2xvcnNfXHJcbiAgICAgICAgICAgICAgICA/IG0uY29sb3JzX1xyXG4gICAgICAgICAgICAgICAgOiBBcnJheS5mcm9tKHsgbGVuZ3RoOiBtLm51bWJlck9mQ2xhc3Nlc18gfSkubWFwKChfLCBpbmRleCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG0uY2xhc3NUb0ZpbGxTdHlsZSgpKGluZGV4LCBtLm51bWJlck9mQ2xhc3Nlc18pXHJcbiAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIGxldCBkYXRhID0gT2JqZWN0LnZhbHVlcyhtLnN0YXREYXRhKCkuX2RhdGFfKS5tYXAoKGl0ZW0pID0+IGl0ZW0udmFsdWUpXHJcbiAgICAgICAgICAgIGNvbnNv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BtLm51bWJlck9mQ2xhc3NlcygpIC0gaSAtIDEgOiBpXHJcbiAgICAgICAgICAgIGNvbnN0IGZpbGxDb2xvciA9IG0uY2xhc3NUb0ZpbGxTdHlsZSgpKGVjbCwgbS5udW1iZXJPZkNsYXNzZXNfKVxyXG5cclxuICAgICAgICAgICAgLy8gQXBwZW5kIHJlY3RhbmdsZSBmb3IgZWFjaCBjbGFzc1xyXG4gICAgICAgICAgICBsZ2cuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtcmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIHgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHkpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBvdXQuc2hhcGVXaWR0aClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBvdXQuc2hhcGVIZWlnaHQpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBmaWxsQ29sb3IpXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBoaWdobGlnaHRSZWdpb25zKG91dC5tYXAsIGVjbClcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZXhlY3V0ZUZvckFsbEluc2V0cyhvdXQubWFwLmluc2V0VGVtcGxhdGVzXywgb3V0Lm1hcC5zdmdJZCwgaGlnaGxpZ2h0UmVnaW9ucywgZWNsKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQubWFwLnN2Z0lkLCB1bmhpZ2hsaWdodFJlZ2lvbnMsIGVjbClcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgLy8gQXBwZW5kIHNlcGFyYXRpb24gbGluZVxyXG4gICAgICAgICAgICBpZiAoaSA+IDApIHtcclxuICAgICAgICAgICAgICAgIGxnZy5hcHBlbmQoJ2xpbmUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtc2VwYXJhdG9yJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneDEnLCBvdXQuYm94UGFkZGluZylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneTEnLCB5KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIG91dC5ib3hQYWRkaW5nICsgb3V0LnNlcExpbmVMZW5ndGgpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgeSlcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy8gQXBwZW5kIHRpY2sgbGluZVxyXG4gICAgICAgICAgICBpZiAoaSA+IDApIHtcclxuICAgICAgICAgICAgICAgIGxnZy5hcHBlbmQoJ2xpbmUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtdGljaycpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gxJywgb3V0LmJveFBhZGRpbmcgKyBvdXQuc2VwTGluZUxlbmd0aClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneTEnLCB5KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIG91dC5ib3hQYWRkaW5nICsgb3V0LnNlcExpbmVMZW5ndGggKyBvdXQudGlja0xlbmd0aClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneTInLCB5KVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvLyBBcHBlbmQgbGFiZWxcclxuICAgICAgICAgICAgaWYgKGkgPCBtLm51bWJlck9mQ2xhc3NlcygpIC0gMSkge1xyXG4gICAgICAgICAgICAgICAgbGdnLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZyArIE1hdGgubWF4KG91dC5zaGFwZVdpZHRoLCBvdXQuc2VwTGluZUxlbmd0aCArIG91dC50aWNrTGVuZ3RoKSArIG91dC5sYWJlbE9mZnNldClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIHkgKyBvdXQuc2hhcGVIZWlnaHQpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2RvbWluYW50LWJhc2VsaW5lJywgJ21pZGRsZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLnRleHQob3V0LmxhYmVscyA/IG91dC5sYWJlbHNbaV0gOiBmb3JtYXRMYWJlbChtLmNsYXNzaWZpZXIoKS5pbnZlcnRFeHRlbnQoZWNsKVtvdXQuYXNjZW5kaW5nID8gMCA6IDFdKSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gJ05vIGRhdGEnIGJveCBhbmQgbGFiZWwgaWYgYXBwbGljYWJsZVxyXG4gICAgICAgIGlmIChvdXQubm9EYXRhKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHkgPSBiYXNlWSArIG0ubnVtYmVyT2ZDbGFzc2VzKCkgKiBvdXQuc2hhcGVIZWlnaHQgKyBvdXQuYm94UGFkZGluZ1xyXG4gICAgICAgICAgICBsZ2cuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtcmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgb3V0LnNoYXBlV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0Jywgb3V0LnNoYXBlSGVpZ2h0KVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgb3V0Lm1hcC5ub0RhdGFGaWxsU3R5bGVfKVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnN0eWxlKCdmaWxsJywgbS5ob3ZlckNvbG9yXylcclxuICAgICAgICAgICAgICAgICAgICBoaWdobGlnaHRSZWdpb25zKG91dC5tYXAsICduZCcpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIGhpZ2hsaWdodFJlZ2lvbnMsICduZCcpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnN0eWx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gICAgICBjb25zdCBlY2wgPSBzZWwuYXR0cignZWNsJylcclxuICAgICAgICAgICAgICAgIGNvbnN0IGN1cnJlbnRJbmRleCA9IHBhcnNlSW50KGVjbCwgMTApXHJcbiAgICAgICAgICAgICAgICBjb25zdCByZXZlcnNlZEluZGV4ID0gY29sb3JzLmxlbmd0aCAtIDEgLSBjdXJyZW50SW5kZXggLy8gcmV2ZXJzZVxyXG4gICAgICAgICAgICAgICAgaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwLCByZXZlcnNlZEluZGV4KVxyXG4gICAgICAgICAgICAgICAgaWYgKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZXhlY3V0ZUZvckFsbEluc2V0cyhvdXQubWFwLmluc2V0VGVtcGxhdGVzXywgb3V0Lm1hcC5zdmdJZCwgaGlnaGxpZ2h0UmVnaW9ucywgZWNsKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKF8sIGkpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgc2VsLnN0eWxlKCdzdHJva2UnLCAnbm9uZScpXHJcbiAgICAgICAgICAgICAgICB1bmhpZ2hsaWdodFJlZ2lvbnMob3V0Lm1hcClcclxuICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIHVuaGlnaGxpZ2h0UmVnaW9ucylcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgLy8gQWRkIGNvdW50IGxhYmVscyBuZXh0IHRvIGJhcnNcclxuICAgICAgICBpZiAob3V0LmJhckNoYXJ0Q291bnRzKSB7XHJcbiAgICAgICAgICAgIGJhckdyb3VwXHJcbiAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCd0ZXh0LmNvdW50LWxhYmVsJylcclxuICAgICAgICAgICAgICAgIC5kYXRhKHJldmVyc2VkQ291bnRzKVxyXG4gICAgICAgICAgICAgICAgLmpvaW4oJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2NvdW50LWxhYmVsJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgKGQpID0+IHhTY2FsZShkKSArIDUpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIChfLCBpKSA9PiB5U2NhbGUoaSkgKyB5U2NhbGUuYmFuZHdpZHRoKCkgLyAyKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ3N0YXJ0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdhbGlnbm1lbnQtYmFzZWxpbmUnLCAnbWlkZGxlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdmb250LXNpemUnLCAnMTRweCcpIC8vIFNldCBsYWJlbCBmb250IHNpemUgdG8gMTRweFxyXG4gICAgICAgICAgICAgICAgLnRleHQoKGQpID0+IGQpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBBZGQgWSBheGlzIHdpdGggY3VzdG9tIHRpY2sgbGFiZWxzIGluIHJldmVyc2VkIG9yZGVyIGF0IDE0cHhcclxuICAgICAgICBjb25zdCB5QXhpcyA9IGJhckdyb3VwXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgYHRyYW5zbGF0ZSgke21hcmdpbi5sZWZ0fSwgMClgKVxyXG4gICAgICAgICAgICAuY2FsbChcclxuICAgICAgICAgICAgICAgIGF4aXNMZWZ0KHlTY2FsZSlcclxuICAgICAgICAgICAgICAgICAgICAudGlja1NpemVPdXRlcigwKVxyXG4gICAgICAgICAgICAgICAgICAgIC50aWNrU2l6ZSgwKVxyXG4gICAgICAgICAgICAgICAgICAgIC50aWNrRm9ybWF0KFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBvdXQuYmFyQ2hhcnRMYWJlbEZvcm1hdFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdXQuYmFyQ2hhcnRMYWJlbEZvcm1hdFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoXywgaSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT09IDApIHJldHVybiBgPiAke3RocmVzaG9sZHNbdGhyZXNob2xkcy5sZW5ndGggLSAxXX1gXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PT0gdGhyZXNob2xkcy5sZW5ndGgpIHJldHVybiBgPCAke3RocmVzaG9sZHNbMF19YFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGAke3RocmVzaG9sZHNbdGhyZXNob2xkcy5sZW5ndGggLSBpXX0gLSA8ICR7dGhyZXNob2xkc1t0aHJlc2hvbGRzLmxlbmd0aCAtIGkgLSAxXX1gXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICApXHJcbiAgICAgICAgICAgIClcclxuICAgICAgICAgICAgLnNlbGVjdEFsbCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdmb250LXNpemUnLCAnMTRweCcpIC8vIFNldCBZLWF4aXMgdGljayBsYWJlbCBmb250IHNpemUgdG8gMTRweFxyXG4gICAgfVxyXG5cclxuICAgIC8vIEhpZ2hsaWdodCBzZWxlY3RlZCByZWdpb25zIG9uIG1vdXNlb3ZlclxyXG4gICAgZnVuY3Rpb24gaGlnaGxpZ2h0UmVnaW9ucyh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ICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5jb2xvckxlZ2VuZCA9PSBmYWxzZSkgb3V0LmNvbG9yTGVnZW5kID0gZmFsc2VcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIG91dFtrZXldID0gY29uZmlnW2tleV1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAvL0BvdmVycmlkZVxyXG4gICAgb3V0LnVwZGF0ZSA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBjb25zdCBtID0gb3V0Lm1hcFxyXG4gICAgICAgIGNvbnN0IGxnZyA9IG91dC5sZ2dcclxuXHJcbiAgICAgICAgLy8gdXBkYXRlIGxlZ2VuZCBwYXJhbWV0ZXJzIGlmIG5lY2Vzc2FyeVxyXG4gICAgICAgIGlmIChtLmxlZ2VuZF8pXHJcbiAgICAgICAgICAgIGZvciAobGV0IGtleSBpbiBtLmxlZ2VuZF8pIHtcclxuICAgICAgICAgICAgICAgIGlmIChrZXkgPT0gJ2NvbG9yTGVnZW5kJyB8fCBrZXkgPT0gJ3NpemVMZWdlbmQnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgcCBpbiBvdXRba2V5XSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL292ZXJyaWRlIGVhY2ggcHJvcGVydHkgaW4gc2l6ZSBhbmQgY29sb3IgbGVnZW5kIG0ubGVnZW5kX1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobS5sZWdlbmRfW2tleV1bcF0gIT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0W2tleV1bcF0gPSBtLmxlZ2VuZF9ba2V5XVtwXVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSB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yXHJcbiAgICAgICAgY29uc3QgY29udGFpbmVyID0gbGdnLmFwcGVuZCgnZycpLmF0dHIoJ2NsYXNzJywgJ2VtLXBpZS1jb2xvci1sZWdlbmQnKVxyXG5cclxuICAgICAgICAvL2RyYXcgdGl0bGVcclxuICAgICAgICBpZiAoY29uZmlnLnRpdGxlKSB7XHJcbiAgICAgICAgICAgIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLXRpdGxlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LmJveFBhZGRpbmcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIG91dC5fc2l6ZUxlZ2VuZEhlaWdodCArIG91dC5sZWdlbmRTcGFjaW5nICsgb3V0LmJveFBhZGRpbmcgKyBvdXQudGl0bGVGb250U2l6ZSlcclxuICAgICAgICAgICAgICAgIC50ZXh0KGNvbmZpZy50aXRsZSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vZHJhdyBsZWdlbmQgZWxlbWVudHMgZm9yIGNsYXNzZXM6IHJlY3RhbmdsZSArIGxhYmVsXHJcbiAgICAgICAgbGV0IGkgPSAwXHJcbiAgICAgICAgY29uc3Qgc2NzID0gbS5jYXRDb2xvcnMoKVxyXG4gICAgICAgIGZvciAobGV0IGNvZGUgaW4gc2NzKSB7XHJcbiAgICAgICAgICAgIC8vdGhlIHZlcnRpY2FsIHBvc2l0aW9uIG9mIHRoZSBsZWdlbmQgZWxlbWVudFxyXG4gICAgICAgICAgICBjb25zdCB5ID1cclxuICAgICAgICAgICAgICAgIG91dC5fc2l6ZUxlZ2VuZEhlaWdodCArXHJcbiAgICAgICAgICAgICAgICBvdXQubGVnZW5kU3BhY2luZyArXHJcbiAgICAgICAgICAgICAgICBvdXQuYm94UGFkZGluZyArXHJcbiAgICAgICAgICAgICAgICAoY29uZmlnLnRpdGxlID8gb3V0LnRpdGxlRm9udFNpemUgKyBvdXQuYm94UGFkZGluZyA6IDApICtcclxuICAgICAgICAgICAgICAgIGkgKiAoY29uZmlnLnNoYXBlSGVpZ2h0ICsgY29uZmlnLnNoYXBlUGFkZGluZylcclxuICAgICAgICAgICAgLy90aGUgY29sb3JcclxuICAgICAgICAgICAgY29uc3QgY29sID0gbS5jYXRDb2xvcnMoKVtjb2RlXSB8fCAnbGlnaHRncmF5J1xyXG5cclxuICAgICAgICAgICAgLy9yZWN0YW5nbGVcclxuICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtcmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgY29uZmlnLnNoYXBlV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgY29uZmlnLnNoYXBlSGVpZ2h0KVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgc2NzW2NvZGVdKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZScsICdibGFjaycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignc3Ryb2tlLXdpZHRoJywgMC41KVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwLCBjb2RlKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQubWFwLnN2Z0lkLCBoaWdobGlnaHRSZWdpb25zLCBjb2RlKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQubWFwLnN2Z0lkLCB1bmhpZ2hsaWdodFJlZ2lvbnMsIGNvZGUpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIC8vbGFiZWxcclxuICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtbGFiZWwnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZyArIGNvbmZpZy5zaGFwZVdpZHRoICsgY29uZmlnLmxhYmVsT2Zmc2V0KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5ICsgY29uZmlnLnNoYXBlSGVpZ2h0ICogMC41KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2RvbWluYW50LWJhc2VsaW5lJywgJ21pZGRsZScpXHJcbiAgICAgICAgICAgICAgICAudGV4dChtLmNhdExhYmVscygpW2NvZGVdIHx8IGNvZGUpXHJcblxyXG4gICAgICAgICAgICBpKytcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vJ25vIGRhdGEnIGxlZ2VuZCBib3hcclxuICAgICAgICBpZiAoY29uZmlnLm5vRGF0YSkge1xyXG4gICAgICAgICAgICBjb25zdCB5ID1cclxuICAgICAgICAgICAgICAgIG91dC5fc2l6ZUxlZ2VuZEhlaWdodCArXHJcbiAgICAgICAgICAgICAgICBvdXQubGVnZW5kU3BhY2luZyArXHJcbiAgICAgICAgICAgICAgICBvdXQuYm94UGFkZGluZyArXHJcbiAgICAgICAgICAgICAgICAoY29uZmlnLnRpdGxlID8gb3V0LnRpdGxlRm9udFNpemUgKyBvdXQuYm94UGFkZGluZyA6IDApICtcclxuICAgICAgICAgICAgICAgIGkgKiAoY29uZmlnLnNoYXBlSGVpZ2h0ICsgY29uZmlnLnNoYXBlUGFkZGluZylcclxuXHJcbiAgICAgICAgICAgIC8vcmVjdGFuZ2xlXHJcbiAgICAgICAgICAgIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgncmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLXJlY3QnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgeSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIGNvbmZpZy5zaGFwZVdpZHRoKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGNvbmZpZy5zaGFwZUhlaWdodClcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIG0ubm9EYXRhRmlsbFN0eWxlKCkpXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBoaWdobGlnaHRSZWdpb25zKG91dC5tYXAsICduZCcpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIGhpZ2hsaWdodFJlZ2lvbnMsICduZCcpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdW5oaWdobGlnaHRSZWdpb25zKG91dC5tYXApXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIHVuaGlnaGxpZ2h0UmVnaW9ucywgJ25kJylcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgLy8nbm8gZGF0YScgbGFiZWxcclxuICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtbGFiZWwnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZyArIGNvbmZpZy5zaGFwZVdpZHRoICsgY29uZmlnLmxhYmVsT2Zmc2V0KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5ICsgY29uZmlnLnNoYXBlSGVpZ2h0ICogMC41KVxyXG4gICAgICAgICAgICAgICAgLnRleHQoY29uZmlnLm5vRGF0YVRleHQpXHJcbiAgICAgICAgfVxyXG4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ICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIG91dFtrZXldID0gY29uZmlnW2tleV1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAvL0BvdmVycmlkZVxyXG4gICAgb3V0LnVwZGF0ZSA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBjb25zdCBtID0gb3V0Lm1hcFxyXG4gICAgICAgIGNvbnN0IGxnZyA9IG91dC5sZ2dcclxuXHJcbiAgICAgICAgLy8gdXBkYXRlIGxlZ2VuZCBwYXJhbWV0ZXJzIGlmIG5lY2Vzc2FyeVxyXG4gICAgICAgIGlmIChtLmxlZ2VuZF8pXHJcbiAgICAgICAgICAgIGZvciAobGV0IGtleSBpbiBtLmxlZ2VuZF8pIHtcclxuICAgICAgICAgICAgICAgIGlmIChrZXkgPT0gJ2NvbG9yTGVnZW5kJyB8fCBrZXkgPT0gJ3NpemVMZWdlbmQnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgcCBpbiBvdXRba2V5XSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL292ZXJyaWRlIGVhY2ggcHJvcGVydHkgaW4gc2l6ZSBhbmQgY29sb3IgbGVnZW5kIG0ubGVnZW5kX1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobS5sZWdlbmRfW2tleV1bcF0gIT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0W2tleV1bcF0gPSBtLmxlZ2VuZF9ba2V5XVtwXVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBvdXRba2V5XSA9IG0ubGVnZW5kX1trZXldXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9yZW1vdmUgcHJld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2Zvcm0nLCBgdHJhbnNsYXRlKCR7eH0sJHt5fSlgKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtcmVjdCcpXHJcblxyXG4gICAgICAgICAgICAgICAgYnVpbGROb0RhdGFMZWdlbmQoeCwgeSwgY29udGFpbmVyLCBvdXQuc2l6ZUxlZ2VuZC5ub0RhdGFUZXh0KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9kZWZpbmUgZm9ybWF0IGZvciBsYWJlbHNcclxuICAgICAgICBsZXQgbGFiZWxGb3JtYXR0ZXIgPSBvdXQuc2l6ZUxlZ2VuZC5sYWJlbEZvcm1hdHRlciB8fCBzcGFjZUFzVGhvdXNhbmRTZXBhcmF0b3JcclxuICAgICAgICAvL2RyYXcgdGl0bGVcclxuICAgICAgICBpZiAob3V0LnNpemVMZWdlbmQudGl0bGUpIHtcclxuICAgICAgICAgICAgb3V0Ll9zaXplTGVnZW5kTm9kZVxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLXRpdGxlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LmJveFBhZGRpbmcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIG91dC5ib3hQYWRkaW5nICsgb3V0LnRpdGxlRm9udFNpemUpXHJcbiAgICAgICAgICAgICAgICAudGV4dChvdXQuc2l6ZUxlZ2VuZC50aXRsZSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGxldCBkb21haW4gPSBtLmNsYXNzaWZpZXJTaXplXy5kb21haW4oKVxyXG4gICAgICAgIGxldCBtYXhWYWwgPSBkb21haW5bMV0gLy9tYXhpbXVtIHZhbHVlIG9mIGRhdGFzZXQgKHVzZWQgZm9yIGZpcnN0I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gICAgICAgICAgIGlmIChtLnBzU2hhcGVfID09ICdiYXInKSB7XHJcbiAgICAgICAgICAgICAgICBidWlsZEJhcnNJdGVtKG1hcCwgdmFsLCBzeW1ib2xTaXplLCBpLCBsYWJlbEZvcm1hdHRlcilcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChtLnBzU2hhcGVfID09ICdjdXN0b20nIHx8IG0ucHNDdXN0b21TVkdfKSB7XHJcbiAgICAgICAgICAgICAgICBidWlsZEN1c3RvbVNWR0l0ZW0obWFwLCB2YWwsIHN5bWJvbFNpemUsIGksIGxhYmVsRm9ybWF0dGVyKVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgYnVpbGREM1N5bWJvbEl0ZW0obWFwLCB2YWwsIHN5bWJvbFNpemUsIGksIGxhYmVsRm9ybWF0dGVyKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAob3V0LnNpemVMZWdlbmQubm9EYXRhKSB7XHJcbiAgICAgICAgICAgIGxldCB5ID0gb3V0Ll9zaXplTGVnZW5kTm9kZS5ub2RlKCkuZ2V0QkJveCgpLmhlaWdodFxyXG4gICAgICAgICAgICBpZiAob3V0LmNvbG9yTGVnZW5kKSB7XHJcbiAgICAgICAgICAgICAgICB5ICs9IG91dC5jb2xvckxlZ2VuZC5zaGFwZUhlaWdodCArIDVcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBsZXQgeCA9IG91dC5ib3hQYWRkaW5nXHJcbiAgICAgICAgICAgIGxldCBjb250YWluZXIgPSBvdXQuX3NpemVMZWdlbmROb2RlXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBgdHJhbnNsYXRlKCR7eH0sJHt5fSlgKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1yZWN0Jylccl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KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5Jywgb3V0LmJveFBhZGRpbmcgKyBvdXQudGl0bGVGb250U2l6ZSlcclxuICAgICAgICAgICAgICAgIC50ZXh0KG91dC5zaXplTGVnZW5kLnRpdGxlKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgbGV0IG1heFJhZGl1cyA9IG0uY2xhc3NpZmllclNpemVfKG1heChvdXQuX3NpemVMZWdlbmRWYWx1ZXMpKSAvL21heGltdW0gY2lyY2xlIHJhZGl1cyB0byBiZSBzaG93biBpbiBsZWdlbmRcclxuICAgICAgICBsZXQgeCA9IG91dC5ib3hQYWRkaW5nICsgbWF4UmFkaXVzXHJcbiAgICAgICAgbGV0IHkgPSBvdXQuYm94UGFkZGluZyArIG1heFJhZGl1cyAqIDIgKyAob3V0LnNpemVMZWdlbmQudGl0bGUgPyBvdXQudGl0bGVGb250U2l6ZSArIG91dC5zaXplTGVnZW5kLnRpdGxlUGFkZGluZyA6IDApICsgMjBcclxuXHJcbiAgICAgICAgbGV0IGl0ZW1Db250YWluZXIgPSBvdXQuX3NpemVMZWdlbmROb2RlXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgYHRyYW5zbGF0ZSgke3h9LCR7eX0pYClcclxuICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2NpcmNsZS1sZWdlbmQnKVxyXG4gICAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCAncmlnaHQnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCAnYmxhY2snKVxyXG4gICAgICAgICAgICAuc2VsZWN0QWxsKCdnJylcclxuICAgICAgICAgICAgLmRhdGEob3V0Ll9zaXplTGVnZW5kVmFsdWVzKVxyXG4gICAgICAgICAgICAuam9pbignZycpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtaXRlbScpXHJcblxyXG4gICAgICAgIC8vY2lyY2xlc1xyXG4gICAgICAgIGl0ZW1Db250YWluZXJcclxuICAgICAgICAgICAgLmFwcGVuZCgnY2lyY2xlJylcclxuICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1jaXJjbGUnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCAnbm9uZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdzdHJva2UnLCAnYmxhY2snKVxyXG4gICAgICAgICAgICAuYXR0cignY3knLCAoZCkgPT4gLW0uY2xhc3NpZmllclNpemVfKGQpKVxyXG4gICAgICAgICAgICAuYXR0cigncicsIG0uY2xhc3NpZmllclNpemVfKVxyXG5cclxuICAgICAgICAvL2xhYmVsc1xyXG4gICAgICAgIGl0ZW1Db250YWluZXJcclxuICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtbGFiZWwnKVxyXG4gICAgICAgICAgICAuYXR0cigneScsIChkLCBpKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBsZXQgeSA9IC0xIC0gMiAqIG0uY2xhc3NpZmllclNpemVfKGQpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4geVxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuYXR0cigneCcsIG1heFJhZGl1cyArIDUpXHJcbiAgICAgICAgICAgIC50ZXh0KChkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZC50b0xvY2FsZVN0cmluZygnZW4nKS5yZXBsYWNlKC8sL2dpLCAnICcpXHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgLy9saW5lIHBvaW50aW5nIHRvIHRvcCBvZiBjb3JyZXNwb25kaW5nIGNpcmNsZTpcclxuICAgICAgICBpdGVtQ29udGFpbmVyXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ2xpbmUnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS1kYXNoYXJyYXknLCAyKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsICdncmV5JylcclxuICAgICAgICAgICAgLmF0dHIoJ3gxJywgMilcclxuICAgICAgICAgICAgLmF0dHIoJ3kxJywgKGQsIGkpID0+IHtcclxuICAgICAgICAgICAgICAgIGxldCB5ID0gLTEgLSAyICogbS5jbGFzc2lmaWVyU2l6ZV8oZClcclxuICAgICAgICAgICAgICAgIHJldHVybiB5XHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC5hdHRyKCd4MicsIG1heFJhZGl1cyArIDUpXHJcbiAgICAgICAgICAgIC5hdHRyKCd5MicsIChkLCBpKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBsZXQgeSA9IC0xIC0gMiAqIG0uY2xhc3NpZmllclNpemVfKGQpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4geVxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICByZXR1cm4gb3V0XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBCdWlsZHMgYSBsZWdlbmQgaWxsdXN0cmF0aW5nIHRoZSBzdGF0aXN0aWNhbCB2YWx1ZXMgb2YgZGlmZmVyZW50IHN5bWJvbCBjb2xvdXJzXHJcbiAgICAgKlxyXG4gICAgICogQHBhcmFtIHsqfSBtIG1hcFxyXG4gICAgICovXHJcbiAgICBmdW5jdGlvbiBidWlsZENvbG9yTGVnZW5kKG0pIHtcclxuICAgICAgICAvL2RlZmluZSBmb3JtYXQgZm9yIGxhYmVsc1xyXG4gICAgICAgIGxldCBmID0gb3V0LmNvbG9yTGVnZW5kLmxhYmVsRm9ybWF0dGVyIHx8IHNwYWNlQXNUaG91c2FuZFNlcGFyYXRvclxyXG4gICAgICAgIGNvbnN0IHN2Z01hcCA9IG0uc3ZnK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b3IgdGl0bGUgKyBtYXJnaW5cclxuXHJcbiAgICAgICAgICAgIC8vdGhlIGNsYXNzIG51bWJlciwgZGVwZW5kaW5nIG9uIG9yZGVyXHJcbiAgICAgICAgICAgIGNvbnN0IGVjbCA9IG91dC5hc2NlbmRpbmcgPyBpIDogbnVtYmVyT2ZDbGFzc2VzIC0gaSAtIDFcclxuXHJcbiAgICAgICAgICAgIGxldCBpdGVtQ29udGFpbmVyID0gb3V0Ll9jb2xvckxlZ2VuZE5vZGVcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGB0cmFuc2xhdGUoJHt4fSwke3l9KWApXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLWl0ZW0nKVxyXG5cclxuICAgICAgICAgICAgLy9hcHBlbmQgc3ltYm9sICYgc3R5bGVcclxuICAgICAgICAgICAgaXRlbUNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgncmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLXJlY3QnKVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgbS5wc0NsYXNzVG9GaWxsU3R5bGUoKShlY2wsIG51bWJlck9mQ2xhc3NlcykpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBvdXQuY29sb3JMZWdlbmQuc2hhcGVXaWR0aClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBvdXQuY29sb3JMZWdlbmQuc2hhcGVIZWlnaHQpXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBoaWdobGlnaHRSZWdpb25zKG91dC5tYXAsIGVjbClcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZXhlY3V0ZUZvckFsbEluc2V0cyhvdXQubWFwLmluc2V0VGVtcGxhdGVzXywgb3V0Lm1hcC5zdmdJZCwgaGlnaGxpZ2h0UmVnaW9ucywgZWNsKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQubWFwLnN2Z0lkLCB1bmhpZ2hsaWdodFJlZ2lvbnMsIGVjbClcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgLy9zZXBhcmF0aW9uIGxpbmVcclxuICAgICAgICAgICAgaWYgKGkgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICBpdGVtQ29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1zZXBhcmF0b3InKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MScsIDApXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kxJywgMClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneDInLCAwICsgb3V0LmNvbG9yTGVnZW5kLnNlcExpbmVMZW5ndGgpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgMClcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy8gQXBwZW5kIHRpY2sgbGluZVxyXG4gICAgICAgICAgICBpZiAoaSA+IDApIHtcclxuICAgICAgICAgICAgICAgIGl0ZW1Db250YWluZXJcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLXRpY2snKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MScsIG91dC5jb2xvckxlZ2VuZC5zaGFwZVdpZHRoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5MScsIDApXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gyJywgb3V0LmNvbG9yTGVnZW5kLnNlcExpbmVMZW5ndGggKyBvdXQuY29sb3JMZWdlbmQudGlja0xlbmd0aClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneTInLCAwKVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvL2xhYmVsXHJcbiAgICAgICAgICAgIGlmIChpIDwgbnVtYmVyT2ZDbGFzc2VzIC0gMSkge1xyXG4gICAgICAgICAgICAgICAgaXRlbUNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtbGFiZWwnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LmNvbG9yTGVnZW5kLnNlcExpbmVMZW5ndGggKyBvdXQuY29sb3JMZWdlbmQudGlja0xlbmd0aCArIG91dC5jb2xvckxlZ2VuZC5sYWJlbE9mZnNldC54KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5Jywgb3V0LmNvbG9yTGVnZW5kLnNoYXBlSGVpZ2h0KVxyXG4gICAgICAgICAgICAgICAgICAgIC50ZXh0KChkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0ID0gZihtLmNsYXNzaWZpZXJDb2xvcl8uaW52ZXJ0RXh0ZW50KG91dC5hc2NlbmRpbmcgPyBlY2wgKyAxIDogZWNsIC0gMSlbb3V0LmFzY2VuZGluZyA/IDAgOiAxXSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRleHRcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLydubyBkYXRhJyBsZWdlbmQgYm94XHJcbiAgICAgICAgaWYgKG91dC5jb2xvckxlZ2VuZC5ub0RhdGEpIHtcclxuICAgICAgICAgICAgbGV0IHkgPSBvdXQudGl0bGVGb250U2l6ZSArIG91dC5jb2xvckxlZ2VuZC5tYXJnaW5Ub3AgKyBudW1iZXJPZkNsYXNzZXMgKiBvdXQuY29sb3JMZWdlbmQuc2hhcGVIZWlnaHQgKyAyMCAvLyBhZGQgMjAgdG8gc2VwYXJhdGUgaXQgZnJvbSB0aGUgcmVzdFxyXG4gICAgICAgICAgICBsZXQgY29udGFpbmVyID0gb3V0Ll9jb2xvckxlZ2VuZE5vZGVcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGB0cmFuc2xhdGUoJHt4fSwke3l9KWApXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLWl0ZW0nKVxyXG5cclxuICAgICAgICAgICAgYnVpbGROb0RhdGFMZWdlbmQoeCwgeSwgY29udGFpbmVyLCBvdXQuY29sb3JMZWdlbmQubm9EYXRhVGV4dClcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBAZGVzY3JpcHRpb24gcmV0dXJucyB0aGUgZDMuc3ltYm9sIG9iamVjdCBjaG9zZW4gYnkgdGhlIHVzZXJcclxuICAgICAqIEByZXR1cm4ge2QzLnNoYXBlIHx8IFNWR31cclxuICAgICAqL1xyXG4gICAgZnVuY3Rpb24gZ2V0U2hhcGUoKSB7XHJcbiAgICAgICAgbGV0IHNoYXBlXHJcbiAgICAgICAgaWYgKG91dC5tYXAucHNDdXN0b21TVkdfKSB7XHJcbiAgICAgICAgICAgIHNoYXBlID0gb3V0Lm1hcC5wc0N1c3RvbVNWR19cclxuICAgICAgICB9IGVsc2UgaWYgKG91dC5tYXAucHNDdXN0b21TaGFwZV8pIHtcclxuICAgICAgICAgICAgc2hhcGUgPSBvdXQubWFwLnBzQ3VzdG9tU2hhcGVfXHJcbiAgICAgICAgfSBlbHNlIGlmIChvdXQubWFwLnBzU2hhcGVfID09ICdiYXInKSB7XHJcbiAgICAgICAgICAgIC8vZm9yIHJlY3RhbmdsZXMsIHdlIHVzZSBhIGN1c3RvbSBkMyBzeW1ib2xcclxuICAgICAgICAgICAgbGV0IGRyYXdSZWN0YW5nbGUgPSAoY29udGV4dCwgc2l6ZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgbGV0IGhlaWdodCA9IE1hdGguc3FydChzaXplKVxyXG4gICAgICAgICAgICAgICAgY29udGV4dC5tb3ZlVG8oMCwgMClcclxuICAgICAgICAgICAgICAgIGNvbnRleHQubGluZVRvKDAsIGhlaWdodClcclxuICAgICAgICAgICAgICAgIGNvbnRleHQubGluZVRvKG91dC5tYXAucHNCYXJXaWR0aF8sIGhlaWdodClcclxuICAgICAgICAgICAgICAgIGNvbnRleHQubGluZVRvKG91dC5tYXAucHNCYXJXaWR0aF8sIDApXHJcbiAgICAgICAgICAgICAgICBjb250ZXh0LmxpbmVUbygwLCAwKVxyXG4gICAgICAgICAgICAgICAgY29udGV4dC5jbG9zZVBhdGgoKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHNoYXBlID0gc3ltYm9sKCkudHlwZSh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bGUpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2RyYXcgbGVnZW5kIGVsZW1lbnRzIGZvciBjbGFzc2VzOiByZWN0YW5nbGUgKyBsYWJlbFxyXG4gICAgICAgIGxldCBpID0gMFxyXG4gICAgICAgIGNvbnN0IHNjcyA9IG0uY2F0Q29sb3JzKClcclxuICAgICAgICBmb3IgKGxldCBjb2RlIGluIHNjcykge1xyXG4gICAgICAgICAgICAvL3RoZSB2ZXJ0aWNhbCBwb3NpdGlvbiBvZiB0aGUgbGVnZW5kIGVsZW1lbnRcclxuICAgICAgICAgICAgY29uc3QgeSA9XHJcbiAgICAgICAgICAgICAgICBvdXQuYm94UGFkZGluZyArIChvdXQudGl0bGUgPyBvdXQudGl0bGVGb250U2l6ZSArIG91dC5ib3hQYWRkaW5nIDogMCkgKyBpICogKG91dC5zaGFwZUhlaWdodCArIG91dC5zaGFwZVBhZGRpbmcpXHJcblxyXG4gICAgICAgICAgICAvL3RoZSBjb2xvclxyXG4gICAgICAgICAgICBjb25zdCBjb2wgPSBtLmNhdENvbG9ycygpW2NvZGVdIHx8ICdsaWdodGdyYXknXHJcblxyXG4gICAgICAgICAgICAvL3JlY3RhbmdsZVxyXG4gICAgICAgICAgICBsZ2cuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtcmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgb3V0LnNoYXBlV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0Jywgb3V0LnNoYXBlSGVpZ2h0KVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgc2NzW2NvZGVdKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZScsICdibGFjaycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignc3Ryb2tlLXdpZHRoJywgMC41KVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogY2hhbmdlIHRoaXMgdG8gZXN0YXQgbG9naWMgb2YgbWFraW5nIGFsbCBvdGhlciBjbGFzc2VzIHRyYW5zcGFyZW50P1xyXG4gICAgICAgICAgICAgICAgICAgIHN2Z01hcFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXR0ZXJuJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbChcInJlY3RbY29kZT0nXCIgKyBjb2RlICsgXCInXVwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBtLmhvdmVyQ29sb3IoKSlcclxuICAgICAgICAgICAgICAgICAgICBzZWxlY3QodGhpcykuc3R5bGUoJ2ZpbGwnLCBtLmhvdmVyQ29sb3IoKSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN2Z01hcFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXR0ZXJuJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbChcInJlY3RbY29kZT0nXCIgKyBjb2RlICsgXCInXVwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBjb2wpXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnN0eWxlKCdmaWxsJywgY29sKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIC8vbGFiZWxcclxuICAgICAgICAgICAgbGdnLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLWxhYmVsJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LmJveFBhZGRpbmcgKyBvdXQuc2hhcGVXaWR0aCArIG91dC5sYWJlbE9mZnNldClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgeSArIG91dC5zaGFwZUhlaWdodCAqIDAuNSlcclxuICAgICAgICAgICAgICAgIC50ZXh0KG0uY2F0TGFiZWxzKClbY29kZV0gfHwgY29kZSlcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN2Z01hcFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXR0ZXJuJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbChcInJlY3RbY29kZT0nXCIgKyBjb2RlICsgXCInXVwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBtLmhvdmVyQ29sb3IoKSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNvbCA9IG0uY2F0Q29sb3JzKClbY29kZV0gfHwgJ2xpZ2h0Z3JheSdcclxuICAgICAgICAgICAgICAgICAgICBzdmdNYXBcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0dGVybicpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoXCJyZWN0W2NvZGU9J1wiICsgY29kZSArIFwiJ11cIilcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgY29sKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIGkrK1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8nbm8gZGF0YScgbGVnZW5kIGJveFxyXG4gICAgICAgIGlmIChvdXQubm9EYXRhKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHkgPVxyXG4gICAgICAgICAgICAgICAgb3V0LmJveFBhZGRpbmcgKyAob3V0LnRpdGxlID8gb3V0LnRpdGxlRm9udFNpemUgKyBvdXQuYm94UGFkZGluZyA6IDApICsgaSAqIChvdXQuc2hhcGVIZWlnaHQgKyBvdXQuc2hhcGVQYWRkaW5nKVxyXG5cclxuICAgICAgICAgICAgLy9yZWN0YW5nbGVcclxuICAgICAgICAgICAgbGdnLmFwcGVuZCgncmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLXJlY3QnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgeSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIG91dC5zaGFwZVdpZHRoKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIG91dC5zaGFwZUhlaWdodClcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIG0ubm9EYXRhRmlsbFN0eWxlKCkpXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBzdmdNYXAuc2VsZWN0KCcjZW0tbnV0c3JnJykuc2VsZWN0QWxsKFwiW25kPSduZCddXCIpLnN0eWxlKCdmaWxsJywgbS5ob3ZlckNvbG9yKCkpXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnN0eWxlKCdmaWxsJywgbS5ob3ZlckNvbG9yKCkpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzdmdNYXBcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdCgnI2VtLW51dHNyZycpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoXCJbbmQ9J25kJ11cIilcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgZnVuY3Rpb24gKGQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0ubm9EYXRhRmlsbFN0eWxlKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICBzZWxlY3QodGhpcykuc3R5bGUoJ2ZpbGwnLCBtLm5vRGF0YUZpbGxTdHlsZSgpKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIC8vJ25vIGRhdGEnIGxhYmVsXHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nICsgb3V0LnNoYXBlV2lkdGggKyBvdXQubGFiZWxPZmZzZXQpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHkgKyBvdXQuc2hhcGVIZWlnaHQgKiAwLjUpXHJcbiAgICAgICAgICAgICAgICAudGV4dChvdXQubm9EYXRhVGV4dClcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN2Z01hcC5zZWxlY3QoJyNlbS1udXRzcmcnKS5zZWxlY3RBbGwoXCJbbmQ9J25kJ11cIikuc3R5bGUoJ2ZpbGwnLCBtLmhvdmVyQ29sb3IoKSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHN2Z01hcFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0KCcjZW0tbnV0c3JnJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbChcIltuZD0nbmQnXVwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBmdW5jdGlvbiAoZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbS5ub0RhdGFGaWxsU3R5bGUoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vc2V0IGxlZ2VuZCBib3ggZGltZW5zaW9uc1xyXG4gICAgICAgIG91dC5zZXRCb3hEaW1lbnNpb24oKVxyXG4gICAgfVxyXG5cclxuICAgIHJldHVybiBvdXRcclxufVxyXG4iLCJpbXBvcnQgeyBzZWxlY3QgfSBmcm9tICdkMy1zZWxlY3Rpb24nXHJcbmltcG9ydCB7IGdldEZvbnRTaXplRnJvbUNsYXNzIH0gZnJvbSAnLi4vY29yZS91dGlscydcclxuXHJcbi8qKlxyXG4gKiBBIGV1cm9zdGF0LW1hcCBsZWdlbmQuIFRoaXMgaXMgYW4gYWJzdHJhY3QgbWV0aG9kLlxyXG4gKi9cclxuZXhwb3J0IGNvbnN0IGxlZ2VuZCA9IGZ1bmN0aW9uIChtYXApIHtcclxuICAgIC8vYnVpbGQgbGVnZW5kIG9iamVjdFxyXG4gICAgY29uc3Qgb3V0ID0ge31cclxuXHJcbiAgICAvL2xpbmsgbWFwIHRvIGxlZ2VuZFxyXG4gICAgb3V0Lm1hcCA9IG1hcFxyXG5cclx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WNsID09PSAnbmQnKSByZXR1cm4gb3V0Lm5vRGF0YUZpbGxTdHlsZV8gfHwgJ2dyYXknXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG91dC5jbGFzc1RvRmlsbFN0eWxlX1tvdXQuY2xhc3NpZmllcigpLmRvbWFpbigpW2VjbF1dIHx8IG91dC5ub0RhdGFGaWxsU3R5bGVfIHx8ICdncmF5J1xyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5lbmQoKVxyXG4gICAgICAgICAgICAgICAgLnRoZW4oKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIFN0b3JlIHRoZSBvcmlnaW5hbCBjb2xvciBmb3IgZWFjaCByZWdpb25cclxuICAgICAgICAgICAgICAgICAgICByZWdpb25zLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsLmF0dHIoJ2ZpbGxfX18nLCBzZWwuc3R5bGUoJ2ZpbGwnKSlcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAvLyBTZXQgdXAgbW91c2UgZXZlbnRzXHJcbiAgICAgICAgICAgICAgICAgICAgcmVnaW9uc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uIChlLCByZykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2VsID0gc2VsZWN0KHRoaXMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWwuc3R5bGUoJ2ZpbGwnLCBtYXAuaG92ZXJDb2xvcl8pIC8vIEFwcGx5IGhpZ2hsaWdodCBjb2xvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5fdG9vbHRpcCkgb3V0Ll90b29sdGlwLm1vdXNlb3ZlcihvdXQudG9vbHRpcF8udGV4dEZ1bmN0aW9uKHJnLCBvdXQpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGZ1bmN0aW9uIChlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2Vtb3ZlKGUpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbC5zdHlsZSgnZmlsbCcsIHNlbC5hdHRyKCdmaWxsX19fJykpIC8vIFJldmVydCB0byBvcmlnaW5hbCBjb2xvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5fdG9vbHRpcCkgbWFwLl90b29sdGlwLm1vdXNlb3V0KClcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuY2F0Y2goKGVycikgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vY29uc29sZS5lcnJvcignRXJyb3IgYXBwbHlpbmcgdHJhbnNpdGlvbiB0byByZWdpb25zOicsIGVycilcclxuICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAvLyBBcHBseSBhZGRpdGlvbmFsIHNldHRpbmdzIGZvciBtaXhlZCBOVVRTIGxldmVsIHZpZXdcclxuICAgICAgICAgICAgaWYgKG91dC5udXRzTGV2ZWxfID09PSAnbWl4ZWQnKSB7XHJcbiAgICAgICAgICAgICAgICBtYXAuc3ZnKClcclxuICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCcjZW0tbnV0c3JnIHBhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnZGlzcGxheScsIGZ1bmN0aW9uIChyZykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZWNsID0gc2VsLmF0dHIoJ2VjbCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGx2bCA9IHNlbC5hdHRyKCdsdmwnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZWNsIHx8IGx2bCA9PT0gJzAnID8gJ2Jsb2NrJyA6ICdub25lJ1xyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBsdmwgPSBzZWwuYXR0cignbHZsJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZWNsID0gc2VsLmF0dHIoJ2VjbCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHN0cm9rZSA9IHNlbC5zdHlsZSgnc3Ryb2tlJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVjbCAmJiBsdmwgIT09ICcwJyA/IHN0cm9rZSB8fCAnIzc3NycgOiBudWxsXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS13aWR0aCcsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2VsID0gc2VsZWN0KHRoaXMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgI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ICAgICAgICBpZiAob3V0Lmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGdlbyBpbiBvdXQuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb10pKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb10ubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5zZXRzIHdpdGggc2FtZSBnZW8gdGhhdCBkbyBub3Qgc2hhcmUgdGhlIHNhbWUgcGFyZW50IGluc2V0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgaXMgdGhlIGNhc2Ugd2hlbiB0aGVyZSBhcmUgbW9yZSB0aGFuIDIgZGlmZmVyZW50IGluc2V0cyB3aXRoIHRoZSBzYW1lIGdlby4gRS5nLiAzIGluc2V0cyBmb3IgUFQyMFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgYyA9IDA7IGMgPCBvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0ubGVuZ3RoOyBjKyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dW2ldW2NdLnN2Z0lkXyAhPT0gb3V0LnN2Z0lkXylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBwbHlDbGFzc2lmaWNhdGlvblRvTWFwKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXVtjXSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0uc3ZnSWRfICE9PSBvdXQuc3ZnSWRfKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIHVuaXF1ZSBpbnNldCBnZW9fXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXS5zdmdJZF8gIT09IG91dC5zdmdJZF8pIGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb10pXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIGFwcGx5IHRvIG1haW4gbWFwXHJcbiAgICAgICAgYXBwbHlDbGFzc2lmaWNhdGlvblRvTWFwKG91dClcclxuXHJcbiAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgfVxyXG5cclxuICAgIGZ1bmN0aW9uIGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcChtYXApIHtcclxuICAgICAgICAvL3NldCBjbGFzc2lmaWVyc1xyXG4gICAgICAgIGxldCBzdGF0MSA9IG91dC5zdGF0RGF0YSgndjEnKS5nZXRBcnJheSgpIHx8IG91dC5zdGF0RGF0YSgpLmdldEFycmF5KClcclxuICAgICAgICBsZXQgc3RhdDIgPSBvdXQuc3RhdERhdGEoJ3YyJykuZ2V0QXJyYXkoKVxyXG5ccl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gICAgICAgICAgICAgICAgICBjb25zdCB2ID0gc3YudmFsdWVcclxuICAgICAgICAgICAgICAgICAgICBpZiAoKHYgIT0gMCAmJiAhdikgfHwgdiA9PSAnOicpIHJldHVybiAnbmQnXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICtvdXQuY2xhc3NpZmllcjFfKCt2KVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdlY2wyJywgZnVuY3Rpb24gKHJnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBvdXQuc3RhdERhdGEoJ3YyJykuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdikgcmV0dXJuXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdiA9IHN2LnZhbHVlXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh2ICE9IDAgJiYgIXYpIHx8IHYgPT0gJzonKSByZXR1cm4gJ25kJ1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiArb3V0LmNsYXNzaWZpZXIyXygrdilcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignbmQnLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzdjEgPSBvdXQuc3RhdERhdGEoJ3YxJykuZ2V0KHJnLnByb3BlcnRpZXMuaWQpIHx8IG91dC5zdGF0RGF0YSgpLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHN2MiA9IG91dC5zdGF0RGF0YSgndjInKS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXN2MSB8fCAhc3YyKSByZXR1cm5cclxuICAgICAgICAgICAgICAgICAgICBsZXQgdiA9IHN2MS52YWx1ZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICgodiAhPSAwICYmICF2KSB8fCB2ID09ICc6JykgcmV0dXJuICduZCdcclxuICAgICAgICAgICAgICAgICAgICB2ID0gc3YyLnZhbHVlXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh2ICE9IDAgJiYgIXYpIHx8IHYgPT0gJzonKSByZXR1cm4gJ25kJ1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnJ1xyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIC8vd2hlbiBtaXhpbmcgTlVUUywgbGV2ZWwgMCBpcyBzZXBhcmF0ZWQgZnJvbSB0aGUgcmVzdCAoY2xhc3MgbnV0c3JnMClcclxuICAgICAgICAgICAgaWYgKG1hcC5udXRzTGV2ZWxfID09ICdtaXhlZCcpIHtcclxuICAgICAgICAgICAgICAgIG1hcC5zdmcoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGguZW0tbnV0c3JnMCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2VjbDEnLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBvdXQuc3RhdERhdGEoJ3YxJykuZ2V0KHJnLnByb3BlcnRpZXMuaWQpIHx8IG91dC5zdGF0RGF0YSgpLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXN2KSByZXR1cm5cclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdiA9IHN2LnZhbHVlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodiAhPSAwICYmICF2KSB8fCB2ID09ICc6JykgcmV0dXJuICduZCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICtvdXQuY2xhc3NpZmllcjFfKCt2KVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2VjbDInLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBvdXQuc3RhdERhdGEoJ3YyJykuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3YpIHJldHVyblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2ID0gc3YudmFsdWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh2ICE9IDAgJiYgIXYpIHx8IHYgPT0gJzonKSByZXR1cm4gJ25kJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gK291dC5jbGFzc2lmaWVyMl8oK3YpXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy9kZWZpbmUgYml2YXJpYXRlIHNjYWxlXHJcbiAgICAgICAgICAgIGlmICghb3V0LmNsYXNzVG9GaWxsU3R5bGUoKSkge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qgc2NhbGUgPSBzY2FsZUJpdmFyaWF0ZShvdXQubnVtYmVyT2ZDbGFzc2VzKCksIG91dC5zdGFydENvbG9yKCksIG91dC5jb2xvcjEoKSwgb3V0LmNvbG9yMigpLCBvdXQuZW5kQ29sb3IoKSlcclxuICAgICAgICAgICAgICAgIG91dC5jbGFzc1RvRmlsbFN0eWxlKHNjYWxlKVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvL3doZW4gbWl4aW5nIE5VVFMsIGxldmVsIDAgaXMgc2VwYXJhdGVkIGZyb20gdGhlIHJlc3QgKHVzaW5nIGNsYXNzIG51dHNyZzApXHJcbiAgICAgICAgICAgIGlmIChvdXQubnV0c0xldmVsXyA9PSAnbWl4ZWQnKSB7XHJcbiAgICAgICAgICAgICAgICBtYXAuc3ZnX1xyXG4gICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGguZW0tbnV0c3JnMCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2VjbDEnLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBvdXQuc3RhdERhdGEoJ3YyJykuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3YpIHJldHVyblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2ID0gc3YudmFsdWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh2ICE9IDAgJiYgIXYpIHx8IHYgPT0gJzonKSByZXR1cm4gJ25kJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gK291dC5jbGFzc2lmaWVyMV8oK3YpXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignZWNsMicsIGZ1bmN0aW9uIChyZykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzdiA9IG91dC5zdGF0RGF0YSgndjInKS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzdikgcmV0dXJuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHYgPSBzdi52YWx1ZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHYgIT0gMCAmJiAhdikgfHwgdiA9PSAnOicpIHJldHVybiAnbmQnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiArb3V0LmNsYXNzaWZpZXIyXygrdilcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8vQG92ZXJyaWRlXHJcbiAgICBvdXQudXBkYXRlU3R5bGUgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgLy8gYXBwbHkgc3R5bGUgdG8gaW5zZXRzXHJcbiAgICAgICAgLy8gYXBwbHkgY2xhc3NpZmljYXRpb24gdG8gYWxsIGluc2V0c1xyXG4gICAgICAgIGlmIChvdXQuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgIGZvciAoY29uc3QgZ2VvIGluIG91dC5pbnNldFRlbXBsYXRlc18pIHtcclxuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXS5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpbnNldHMgd2l0aCBzYW1lIGdlbyB0aGF0IGRvIG5vdCBzaGFyZSB0aGUgc2FtZSBwYXJlbnQgaW5zZXRcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dW2ldKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhpcyBpcyB0aGUgY2FzZSB3aGVuIHRoZXJlIGFyZSBtb3JlIHRoYW4gMiBkaWZmZXJlbnQgaW5zZXRzIHdpdGggdGhlIHNhbWUgZ2VvLiBFLmcuIDMgaW5zZXRzIGZvciBQVDIwXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBjID0gMDsgYyA8IG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXS5sZW5ndGg7IGMrKykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV1bY10uc3ZnSWRfICE9PSBvdXQuc3ZnSWRfKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBseVN0eWxlVG9NYXAob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dW2ldW2NdKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXS5zdmdJZF8gIT09IG91dC5zdmdJZF8pIGFwcGx5U3R5bGVUb01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIHVuaXF1ZSBpbnNldCBnZW9fXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXS5zdmdJZF8gIT09IG91dC5zdmdJZF8pIGFwcGx5U3R5bGVUb01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb10pXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIGFwcGx5IHRvIG1haW4gbWFwXHJcbiAgICAgICAgYXBwbHlTdHlsZVRvTWFwKG91dClcclxuXHJcbiAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgfVxyXG5cclxuICAgIGZ1bmN0aW9uIGFwcGx5U3R5bGVUb01hcChtYXApIHtcclxuICAgICAgICAvL2FwcGx5IHN0eWxlIHRvIG51dHMgcmVnaW9uc1xyXG5cclxuICAgICAgICAvLyBzZXQgY29sb3VyIG9mIHJlZ2lvbnNcclxuICAgICAgICBpZiAobWFwLnN2ZygpKSB7XHJcbiAgICAgICAgICAgIGxldCBzZWxlY3RvciA9IG91dC5nZW9fID09PSAnV09STEQnID8gJyNlbS13b3JsZHJnIHBhdGgnIDogJyNlbS1udXRzcm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GV0IGNvbG9yID0gb3V0LmNsYXNzVG9GaWxsU3R5bGUoKSgrZWNsMSwgK2VjbDIpXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbG9yXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIGdldENTU1Byb3BlcnR5RnJvbUNsYXNzKCdlbS1udXRzcmcnLCAnZmlsbCcpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLmVuZCgpXHJcbiAgICAgICAgICAgICAgICAudGhlbihcclxuICAgICAgICAgICAgICAgICAgICAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN0b3JlIHRoZSBvcmlnaW5hbCBjb2xvciBmb3IgZWFjaCByZWdpb25cclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVnaW9ucy5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsLmF0dHIoJ2ZpbGxfX18nLCBzZWwuc3R5bGUoJ2ZpbGwnKSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lvbnNcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKGUsIHJnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2VsID0gc2VsZWN0KHRoaXMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsLnN0eWxlKCdmaWxsJywgbWFwLmhvdmVyQ29sb3JfKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQuX3Rvb2x0aXApIG91dC5fdG9vbHRpcC5tb3VzZW92ZXIob3V0LnRvb2x0aXBfLnRleHRGdW5jdGlvbihyZywgb3V0KSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGZ1bmN0aW9uIChlLCByZykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQuX3Rvb2x0aXApIG91dC5fdG9vbHRpcC5tb3VzZW1vdmUoZSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdGaWxsID0gc2VsLmF0dHIoJ2ZpbGxfX18nKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdGaWxsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbC5zdHlsZSgnZmlsbCcsIHNlbC5hdHRyKCdmaWxsX19fJykpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXAuX3Rvb2x0aXApIG1hcC5fdG9vbHRpcC5tb3VzZW91dCgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIChlcnIpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVqZWN0aW9uXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgKVxyXG5cclxuICAgICAgICAgICAgaWYgKG91dC5udXRzTGV2ZWxfID09ICdtaXhlZCcpIHtcclxuICAgICAgICAgICAgICAgIHN0eWxlTWl4ZWROVVRTKG1hcClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvL0BvdmVycmlkZVxyXG4gICAgb3V0LmdldExlZ2VuZENvbnN0cnVjdG9yID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIHJldHVybiBCaXZhcmlhdGVMZWdlbmQubGVnZW5kXHJcbiAgICB9XHJcblxyXG4gICAgcmV0dXJuIG91dFxyXG59XHJcblxyXG5jb25zdCBzdHlsZU1peGVkTlVUUyA9IGZ1bmN0aW9uIChtYXApIHtcclxuICAgIG1hcC5zdmcoKVxyXG4gICAgICAgIC5zZWxlY3RBbGwoJyNlbS1udXRzcmcgcGF0aCcpXHJcbiAgICAgICAgLnN0eWxlKCdkaXNwbGF5JywgZnVuY3Rpb24gKHJnKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICBjb25zdCBlY2wgPSBzZWwuYXR0cignZWNsJylcclxuICAgICAgICAgICAgY29uc3QgbHZsID0gc2VsLmF0dHIoJ2x2bCcpXHJcbiAgICAgICAgICAgIGNvbnN0IGNvdW50cnlJZCA9IHJnLnByb3BlcnRpZXMuaWQuc2xpY2UoMCwgMilcclxuICAgICAgICAgICAgcmV0dXJuIGVjbCB8fCBsdmwgPT09ICcwJyA/ICdibG9jaycgOiAnbm9uZSdcclxuICAgICAgICB9KVxyXG4gICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgY29uc3QgbHZsID0gc2VsLmF0dHIoJ2x2bCcpXHJcbiAgICAgICAgICAgIGNvbnN0IGVjbCA9IHNlbC5hdHRyKCdlY2wnKVxyXG4gICAgICAgICAgICBjb25zdCBzdHJva2UgPSBzZWwuc3R5bGUoJ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uICAgICAgICAgICAgICAgIGNhc2UgJ3F1YW50aWxlJzoge1xyXG4gICAgICAgICAgICAgICAgICAgIG91dC5jbGFzc2lmaWVyKHNjYWxlUXVhbnRpbGUoKS5kb21haW4oZGF0YUFycmF5KS5yYW5nZShyYW5nZSkpXHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNhc2UgJ2VxdWFsLWludGVydmFsJzpcclxuICAgICAgICAgICAgICAgIGNhc2UgJ2VxdWludGVyJzoge1xyXG4gICAgICAgICAgICAgICAgICAgIG91dC5jbGFzc2lmaWVyKFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzY2FsZVF1YW50aXplKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kb21haW4oW21pbihkYXRhQXJyYXkpLCBtYXgoZGF0YUFycmF5KV0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAucmFuZ2UocmFuZ2UpXHJcbiAgICAgICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFrZUNsYXNzaWZOaWNlXykgb3V0LmNsYXNzaWZpZXIoKS5uaWNlKClcclxuICAgICAgICAgICAgICAgICAgICBicmVha1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY2FzZSAndGhyZXNob2xkJzoge1xyXG4gICAgICAgICAgICAgICAgICAgIG91dC5udW1iZXJPZkNsYXNzZXMob3V0LnRocmVzaG9sZHNfLmxlbmd0aCArIDEpXHJcbiAgICAgICAgICAgICAgICAgICAgb3V0LmNsYXNzaWZpZXIoc2NhbGVUaHJlc2hvbGQoKS5kb21haW4ob3V0LnRocmVzaG9sZHNfKS5yYW5nZShnZW5lcmF0ZVJhbmdlKG91dC5udW1iZXJPZkNsYXNzZXNfKSkpXHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNhc2UgJ2plbmtzJzoge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGplbmtzQnJlYWtzID0gamVua3MoZGF0YUFycmF5LCBvdXQubnVtYmVyT2ZDbGFzc2VzXykgLy8gQ2FsY3VsYXRlIGJyZWFrcyBmb3IgSmVua3NcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBkb21haW4gPSBqZW5rc0JyZWFrcy5zbGljZSgxLCAtMSlcclxuICAgICAgICAgICAgICAgICAgICBvdXQuY2xhc3NpZmllcihzY2FsZVRocmVzaG9sZCgpLmRvbWFpbihkb21haW4pLnJhbmdlKHJhbmdlKSkgLy8gVXNlIEplbmtzIGJyZWFrcyBpbiBzY2FsZVxyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjYXNlICdja21lYW5zJzoge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIENhbGN1bGF0ZSBja21lYW5zIGJyZWFrcywgZXh0cmFjdGluZyB0aGUgbWF4aW11bSB2YWx1ZSBmcm9tIGVhY2ggY2x1c3RlclxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNrbWVhbnNCcmVha3MgPSBja21lYW5zKGRhdGFBcnJheSwgb3V0Lm51bWJlck9mQ2xhc3Nlc18pLm1hcCgoY2x1c3RlcikgPT4gY2x1c3Rlci5wb3AoKSlcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gU2V0IHRoZSBkb21haW4gZm9yIHNjYWxlVGhyZXNob2xkIGV4Y2x1ZGluZyB0aGUgbGFzdCB2YWx1ZSwgYXMgaXQgc2VydmVzIGFzIHRoZSB1cHBlciBib3VuZFxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGRvbWFpbiA9IGNrbWVhbnNCcmVha3Muc2xpY2UoMCwgLTEpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC8vIFVzZSB0aGUgY2ttZWFucyBicmVha3MgaW4gdGhlIHNjYWxlVGhyZXNob2xkIGFuZCBzZXQgdGhlIGNsYXNzaWZpZXJcclxuICAgICAgICAgICAgICAgICAgICBvdXQuY2xhc3NpZmllcihzY2FsZVRocmVzaG9sZCgpLmRvbWFpbihkb21haW4pLnJhbmdlKHJhbmdlKSlcclxuICAgICAgICAgICAgICAgICAgICBicmVha1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBBcHBseSBjbGFzc2lmaWVyIGFuZCBzZXQgJ2VjbCcgYXR0cmlidXRlIHRvIHJlZ2lvbnMgYmFzZWQgb24gdmFsdWVcclxuICAgICAgICBjb25zdCBjbGFzc2lmeVJlZ2lvbnMgPSAocmVnaW9ucykgPT4ge1xyXG4gICAgICAgICAgICByZWdpb25zLmF0dHIoJ2VjbCcsIChyZykgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcmVnaW9uRGF0YSA9IG91dC5zdGF0RGF0YSgpLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgaWYgKCFyZWdpb25EYXRhKSByZXR1cm4gLy8gTGFjayBvZiBkYXRhIGlzIGhhbmRsZWQgZXhwbGljaXRseVxyXG4gICAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSByZWdpb25EYXRhLnZhbHVlXHJcbiAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09ICc6JyB8fCB2YWx1ZSA9PT0gbnVsbCkgcmV0dXJuICduZCdcclxuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZSAhPSBudWxsID8gK291dC5jbGFzc2lmaWVyXyh2YWx1ZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgfSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIEluaXRpYWxpemUgY2xhc3NpZmllclxyXG4gICAgICAgIHNldHVwQ2xhc3NpZmllcigpXHJcblxyXG4gICAg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yR2VvbWV0cmllcykgc2VsZWN0b3IgPSAnI2VtLXVzZXItcmVnaW9ucyBwYXRoJyAvLyBmb3IgdXNlci1kZWZpbmVkIGdlb21ldHJpZXNcclxuICAgICAgICAgICAgY29uc3QgcmVnaW9ucyA9IG1hcC5zdmcoKS5zZWxlY3RBbGwoc2VsZWN0b3IpXHJcblxyXG4gICAgICAgICAgICAvLyBBcHBseSB0cmFuc2l0aW9uIGFuZCBzZXQgaW5pdGlhbCBmaWxsIGNvbG9ycyB3aXRoIGRhdGEtZHJpdmVuIGxvZ2ljXHJcbiAgICAgICAgICAgIHJlZ2lvbnNcclxuICAgICAgICAgICAgICAgIC50cmFuc2l0aW9uKClcclxuICAgICAgICAgICAgICAgIC5kdXJhdGlvbihvdXQudHJhbnNpdGlvbkR1cmF0aW9uKCkpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCByZWdpb25zRmlsbEZ1bmN0aW9uKVxyXG4gICAgICAgICAgICAgICAgLmVuZCgpXHJcbiAgICAgICAgICAgICAgICAudGhlbigoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gU3RvcmUgdGhlIG9yaWdpbmFsIGNvbG9yIGZvciBlYWNoIHJlZ2lvblxyXG4gICAgICAgICAgICAgICAgICAgIHJlZ2lvbnMuZWFjaChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzZWwuYXR0cignZmlsbF9fXycsIHNlbC5zdHlsZSgnZmlsbCcpKVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gU2V0IHVwIG1vdXNlIGV2ZW50c1xyXG4gICAgICAgICAgICAgICAgICAgIGFkZE1vdXNlRXZlbnRzVG9SZWdpb25zKG1hcCwgcmVnaW9ucylcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuY2F0Y2goKGVycikgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vY29uc29sZS5lcnJvcignRXJyb3IgYXBwbHlpbmcgdHJhbnNpdGlvbiB0byByZWdpb25zOicsIGVycilcclxuICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAvLyBBcHBseSBhZGRpdGlvbmFsIHNldHRpbmdzIGZvciBtaXhlZCBOVVRTIGxldmVsIHZpZXdcclxuICAgICAgICAgICAgaWYgKG91dC5udXRzTGV2ZWxfID09PSAnbWl4ZWQnKSB7XHJcbiAgICAgICAgICAgICAgICBzdHlsZU1peGVkTlVUUyhtYXApXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vIFVwZGF0ZSBsYWJlbHMgZm9yIHN0YXRpc3RpY2FsIHZhbHVlcyBpZiByZXF1aXJlZFxyXG4gICAgICAgICAgICBpZiAob3V0LmxhYmVsc18/LnZhbHVlcykge1xyXG4gICAgICAgICAgICAgICAgb3V0LnVwZGF0ZVZhbHVlc0xhYmVscyhtYXApXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLy9Ab3ZlcnJpZGVcclxuICAgIG91dC5nZXRMZWdlbmRDb25zdHJ1Y3RvciA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICByZXR1cm4gQ2hvcm9wbGV0aExlZ2VuZC5sZWdlbmRcclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBzdHlsZU1peGVkTlVUUyA9IGZ1bmN0aW9uIChtYXApIHtcclxuICAgICAgICBtYXAuc3ZnKClcclxuICAgICAgICAgICAgLnNlbGVjdEFsbCgnI2VtLW51dHNyZyBwYXRoJylcclxuICAgICAgICAgICAgLnN0eWxlKCdkaXNwbGF5JywgZnVuY3Rpb24gKHJnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgIGNvbnN0IGVjbCA9IHNlbC5hdHRyKCdlY2wnKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgbHZsID0gc2VsLmF0dHIoJ2x2bCcpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBjb3VudHJ5SWQgPSByZy5wcm9wZXJ0aWVzLmlkLnNsaWNlKDAsIDIpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZWNsIHx8IGx2bCA9PT0gJzAnID8gJ2Jsb2NrJyA6ICdub25lJ1xyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgbHZsID0gc2VsLmF0dHIoJ2x2bCcpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBlY2wgPSBzZWwuYXR0cignZWNsJylcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN0cm9rZSA9IHNlbC5zdHlsZSgnc3Ryb2tlJylcclxuICAgICAgICAgICAgICAgIHJldHVybiBlY2wgJiYgbHZsICE9PSAnMCcgPyBzdHJva2UgfHwgJyM3NzcnIDogbnVsbFxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS13aWR0aCcsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgbHZsID0gc2VsLmF0dHIoJ2x2bCcpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBlY2wgPSBzZWwuYXR0cignZWNsJylcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN0cm9rZVdpZHRoID0gc2VsLnN0eWxlKCdzdHJva2Utd2lkdGgnKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGVjbCAmJiBsdm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AgICBjb25zdCB1bml0ID0gc3RhdERhdGEudW5pdFRleHQoKSB8fCAnJ1xyXG5cclxuICAgIC8vIE5vIGRhdGEgY2FzZVxyXG4gICAgaWYgKCFzdiB8fCAoc3YudmFsdWUgIT09IDAgJiYgIXN2LnZhbHVlKSB8fCBzdi52YWx1ZSA9PT0gJzonKSB7XHJcbiAgICAgICAgYnVmLnB1c2goYFxyXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZXN0YXQtdmlzLXRvb2x0aXAtdGV4dCBuby1kYXRhXCI+XHJcbiAgICAgICAgICAgICAgICA8dGFibGUgY2xhc3M9XCJudXRzLXRhYmxlXCI+XHJcbiAgICAgICAgICAgICAgICAgICAgPHRib2R5PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8dHI+PHRkPiR7bWFwLm5vRGF0YVRleHRffTwvdGQ+PC90cj5cclxuICAgICAgICAgICAgICAgICAgICA8L3Rib2R5PlxyXG4gICAgICAgICAgICAgICAgPC90YWJsZT5cclxuICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgYClcclxuICAgICAgICByZXR1cm4gYnVmLmpvaW4oJycpXHJcbiAgICB9XHJcblxyXG4gICAgLy8gRGF0YSBkaXNwbGF5XHJcbiAgICBidWYucHVzaChgXHJcbiAgICAgICAgPGRpdiBjbGFzcz1cImVzdGF0LXZpcy10b29sdGlwLXRleHRcIj5cclxuICAgICAgICAgICAgPHRhYmxlIGNsYXNzPVwibnV0cy10YWJsZVwiPlxyXG4gICAgICAgICAgICAgICAgPHRib2R5PlxyXG4gICAgICAgICAgICAgICAgICAgIDx0cj48dGQ+JHtzcGFjZUFzVGhvdXNhbmRTZXBhcmF0b3Ioc3YudmFsdWUpfSAke3VuaXR9PC90ZD48L3RyPlxyXG4gICAgICAgICAgICAgICAgPC90Ym9keT5cclxuICAgICAgICAgICAgPC90YWJsZT5cclxuICAgICAgICA8L2Rpdj5cclxuICAgIGApXHJcblxyXG4gICAgLy8gT3B0aW9uYWwgc3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Wdpb25zXHJcbiAgICAgICAgc3ZnLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdyZWdpb25zJylcclxuICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5kYXRhKGdlb21ldHJpZXMpXHJcbiAgICAgICAgICAgIC5qb2luKCdwYXRoJylcclxuICAgICAgICAgICAgLmF0dHIoJ2QnLCBwYXRoKVxyXG4gICAgICAgICAgICAuYXR0cignZmlsbCcsICcjZjRmNGY0JylcclxuICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZScsICdub25lJylcclxuXHJcbiAgICAgICAgLy8gT3ZlcmxheSBmb3IgZXhwb3J0ZXJzIGFuZCBpbXBvcnRlcnNcclxuICAgICAgICBzdmcuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2ltcG9ydGVycy1vdmVybGF5JylcclxuICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5kYXRhKHBvaS5mZWF0dXJlcylcclxuICAgICAgICAgICAgLmpvaW4oJ3BhdGgnKVxyXG4gICAgICAgICAgICAuYXR0cignZCcsIHBhdGgpXHJcbiAgICAgICAgICAgIC5hdHRyKCdmaWxsJywgKGQpID0+IChleHBvcnRlcnMuaGFzKGQucHJvcGVydGllcy5pZCkgPyAnI2M3ZTNjNicgOiAnI2JiZDdlZScpKVxyXG4gICAgICAgICAgICAuYXR0cignc3Ryb2tlJywgJ25vbmUnKVxyXG5cclxuICAgICAgICAvLyBOYXRpb25hbCBib3JkZXJzXHJcbiAgICAgICAgc3ZnLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdib3JkZXJzJylcclxuICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5kYXRhKGNvdW50cnlCb3JkZXJzKVxyXG4gICAgICAgIC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ZnVuY3Rpb24gYWRkU2Fua2V5Rmxvd3Moc3ZnLCBsaW5rcywgYXJyb3dJZCwgYXJyb3dPdXRsaW5lSWQsIGdyYWRpZW50SWRzKSB7XHJcbiAgICAgICAgY29uc3QgZmxvd3NHcm91cCA9IHN2Zy5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdmbG93cy1ncm91cCcpXHJcblxyXG4gICAgICAgIGxpbmtzLmZvckVhY2goKGxpbmssIGkpID0+IHtcclxuICAgICAgICAgICAgLy8gT3V0bGluZSBwYXRoXHJcbiAgICAgICAgICAgIGZsb3dzR3JvdXBcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2QnLCBzYW5rZXlMaW5rSG9yaXpvbnRhbCgpKGxpbmspKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2ZpbGwnLCAnbm9uZScpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignc3Ryb2tlJywgJyNmZmZmZmYnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZS13aWR0aCcsIGxpbmsud2lkdGggKyAxLjUpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignbWFya2VyLWVuZCcsIGB1cmwoIyR7YXJyb3dPdXRsaW5lSWR9KWApXHJcblxyXG4gICAgICAgICAgICAvLyBNYWluIHBhdGhcclxuICAgICAgICAgICAgZmxvd3NHcm91cFxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZCcsIHNhbmtleUxpbmtIb3Jpem9udGFsKCkobGluaykpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZmlsbCcsICdub25lJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdzdHJva2UnLCBgdXJsKCMke2dyYWRpZW50SWRzW2ldfSlgKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZS13aWR0aC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AgICAgICAgZm9yIChjb25zdCBbaSwgbm9kZV0gb2Ygbm9kZXMuZW50cmllcygpKSB7XHJcbiAgICAgICAgICAgIG5vZGUuaW5kZXggPSBpXHJcbiAgICAgICAgICAgIG5vZGUuc291cmNlTGlua3MgPSBbXVxyXG4gICAgICAgICAgICBub2RlLnRhcmdldExpbmtzID0gW11cclxuICAgICAgICB9XHJcbiAgICAgICAgY29uc3Qgbm9kZUJ5SWQgPSBuZXcgTWFwKG5vZGVzLm1hcCgoZCwgaSkgPT4gW2lkKGQsIGksIG5vZGVzKSwgZF0pKVxyXG4gICAgICAgIGZvciAoY29uc3QgW2ksIGxpbmtdIG9mIGxpbmtzLmVudHJpZXMoKSkge1xyXG4gICAgICAgICAgICBsaW5rLmluZGV4ID0gaVxyXG4gICAgICAgICAgICBsZXQgeyBzb3VyY2UsIHRhcmdldCB9ID0gbGlua1xyXG4gICAgICAgICAgICBpZiAodHlwZW9mIHNvdXJjZSAhPT0gJ29iamVjdCcpIHNvdXJjZSA9IGxpbmsuc291cmNlID0gZmluZChub2RlQnlJZCwgc291cmNlKVxyXG4gICAgICAgICAgICBpZiAodHlwZW9mIHRhcmdldCAhPT0gJ29iamVjdCcpIHRhcmdldCA9IGxpbmsudGFyZ2V0ID0gZmluZChub2RlQnlJZCwgdGFyZ2V0KVxyXG4gICAgICAgICAgICBzb3VyY2Uuc291cmNlTGlua3MucHVzaChsaW5rKVxyXG4gICAgICAgICAgICB0YXJnZXQudGFyZ2V0TGlua3MucHVzaChsaW5rKVxyXG4gICAgICAgIH1cclxuICAgICAgICAvLyBpZiAobGlua1NvcnQgIT0gbnVsbCkge1xyXG4gICAgICAgIC8vICAgICBmb3IgKGNvbnN0IHsgc291cmNlTGlua3MsIHRhcmdldExpbmtzIH0gb2Ygbm9kZXMpIHtcclxuICAgICAgICAvLyAgICAgICAgIHNvdXJjZUxpbmtzLnNvcnQobGlua1NvcnQpXHJcbiAgICAgICAgLy8gICAgICAgICB0YXJnZXRMaW5rcy5zb3J0KGxpbmtTb3J0KVxyXG4gICAgICAgIC8vICAgICB9XHJcbiAgICAgICAgLy8gfVxyXG4gICAgfVxyXG5cclxuICAgIGZ1bmN0aW9uIGZpbmQobm9kZUJ5SWQsIGlkKSB7XHJcbiAgICAgICAgY29uc3Qgbm9kZSA9IG5vZGVCeUlkLmdldChpZClcclxuICAgICAgICBpZiAoIW5vZGUpIHRocm93IG5ldyBFcnJvcignbWlzc2luZzogJyArIGlkKVxyXG4gICAgICAgIHJldHVybiBub2RlXHJcbiAgICB9XHJcblxyXG4gICAgZnVuY3Rpb24gY29tcHV0ZU5vZGVEZXB0aHMoeyBub2RlcyB9KSB7XHJcbiAgICAgICAgY29uc3QgbiA9IG5vZGVzLmxlbmd0aFxyXG4gICAgICAgIGxldCBjdXJyZW50ID0gbmV3IFNldChub2RlcylcclxuICAgICAgICBsZXQgbmV4dCA9IG5ldyBTZXQoKVxyXG4gICAgICAgIGxldCB4ID0gMFxyXG4gICAgICAgIHdoaWxlIChjdXJyZW50LnNpemUpIHtcclxuICAgICAgICAgICAgZm9yIChjb25zdCBub2RlIG9mIGN1cnJlbnQpIHtcclxuICAgICAgICAgICAgICAgIG5vZGUuZGVwdGggPSB4XHJcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHsgdGFyZ2V0IH0gb2Ygbm9kZS5zb3VyY2VMaW5rcykge1xyXG4gICAgICAgICAgICAgICAgICAgIG5leHQuYWRkKHRhcmdldClcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoKyt4ID4gbikgdGhyb3cgbmV3IEVycm9yKCdjaXJjdWxhciBsaW5rJylcclxuICAgICAgICAgICAgY3VycmVudCA9IG5leHRcclxuICAgICAgICAgICAgbmV4dCA9IG5ldyBTZXQoKVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBmdW5jdGlvbiBjb21wdXRlTm9kZUhlaWdodHMoeyBub2RlcyB9KSB7XHJcbiAgICAgICAgY29uc3QgbiA9IG5vZGVzLmxlbmd0aFxyXG4gICAgICAgIGxldCBjdXJyZW50ID0gbmV3IFNldChub2RlcylcclxuICAgICAgICBsZXQgbmV4dCA9IG5ldyBTZXQoKVxyXG4gICAgICAgIGxldCB4ID0gMFxyXG4gICAgICAgIHdoaWxlIChjdXJyZW50LnNpemUpIHtcclxuICAgICAgICAgICAgZm9yIChjb25zdCBub2RlIG9mIGN1cnJlbnQpIHtcclxuICAgICAgICAgICAgICAgIG5vZGUuaGVpZ2h0ID0geFxyXG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCB7IHNvdXJjZSB9IG9mIG5vZGUudGFyZ2V0TGlua3MpIHtcclxuICAgICAgICAgICAgICAgICAgICBuZXh0LmFkZChzb3VyY2UpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKCsreCA+IG4pIHRocm93IG5ldyBFcnJvcignY2lyY3VsYXIgbGluaycpXHJcbiAgICAgICAgICAgIGN1cnJlbnQgPSBuZXh0XHJcbiAgICAgICAgICAgIG5leHQgPSBuZXcgU2V0KClcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgZnVuY3Rpb24gY29tcHV0ZUxpbmtCcmVhZHRocyh7IG5vZGVzIH0pIHtcclxuICAgICAgICBmb3IgKGNvbnN0IG5vZGUgb2Ygbm9kZXMpIHtcclxuICAgICAgICAgICAgbGV0IHkwID0gbm9kZS55MFxyXG4gICAgICAgICAgICBsZXQgeTEgPSB5MFxyXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGxpbmsgb2Ygbm9kZS5zb3VyY2VMaW5rcykge1xyXG4gICAgICAgICAgICAgICAgbGluay55MCA9IHkwICsgbGluay53aWR0aCAvIDJcclxuICAgICAgICAgICAgICAgIHkwICs9IGxpbmsud2lkdGhcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGxpbmsgb2Ygbm9kZS50YXJnZXRMaW5rcykge1xyXG4gICAgICAgICAgICAgICAgbGluay55MSA9IHkxICsgbGluay53aWR0aCAvIDJcclxuICAgICAgICAgICAgICAgIHkxICs9IGxpbmsud2lkdGhcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGZ1bmN0aW9uIGhvcml6b250YWxTb3VyY2UoZCkge1xyXG4gICAgICAgIHJldHVybiBbZC5zb3VyY2UueDEsIGQueTBdXHJcbiAgICB9XHJcblxyXG4gICAgZnVuY3Rpb24gaG9yaXpvbnRhbFRhcmdldChkKSB7XHJcbiAgICAgICAgcmV0dXJuIFtkLnRhcmdldC54MCwgZC55MV1cclxuICAgIH1cclxuXHJcbiAgICBmdW5jdGlvbiBjb21wdXRlTm9kZVZhbHVlcyh7IG5vZGVzIH0pIHtcclxuICAgICAgICBmb3IgKGNvbnN0IG5vZGUgb2Ygbm9kZXMpIHtcclxuICAgICAgICAgICAgbm9kZS52YWx1ZSA9IE1hdGgubWF4KFxyXG4gICAgICAgICAgICAgICAgc3VtKG5vZGUuc291cmNlTGlua3MsIChkKSA9PiBkLnZhbHVlKSxcclxuICAgICAgICAgICAgICAgIHN1bShub2RlLnRhcmdldExpbmtzLCAoZCkgPT4gZC52YWx1ZSlcclxuICAgICAgICAgICAgKVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBmdW5jdGlvbiByZW9yZGVyTGlua3Mobm9kZXMpIHtcclxuICAgICAgICBmb3IgKGNvbnN0IHsgc291cmNlTGlua3MsIHRhcmdldExpbmtzIH0gb2Ygbm9kZXMpIHtcclxuICAgICAgICAgICAgc291cmNlTGlua3Muc29ydChhc2NlbmRpbmdUYXJnZXRZKVxyXG4gICAgICAgICAgICB0YXJnZXRMaW5rcy5zb3J0KGFzY2VuZGluZ1NvdXJjZVkpXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGNvbnN0IGFzY2VuZGluZ1RhcmdldFkgPSAoYSwgYikgPT4gYS50YXJnZXQueSAtIGIudGFyZ2V0LnlcclxuICAgIGNvbnN0IGFzY2VuZGluZ1NvdXJjZVkgPSAoYSwgYikgPT4gYS5zb3VyY2UueSAtIGIuc291cmNlLnlcclxuXHJcbiAgICBmdW5jdGlvbiBjb21wdXRlTm9kZUJyZWFkdGhzKHsgbm9kZXMgfSkge1xyXG4gICAgICAgIGZvciAoY29uc3Qgbm9kZSBvZiBub2Rlcykge1xyXG4gICAgICAgICAgICBjb25zdCBoZWlnaHQgPSBvdXQuc3Ryb2tlV2lkdGhTY2FsZShub2RlLnZhbHVlKVxyXG4gICAgICAgICAgICBub2RlLngwID0gbm9kZS54MSA9IG5vZGUueFxyXG4gICAgICAgICAgICBub2RlLnkwID0gbm9kZS55IC0gaGVpZ2h0IC8gMlxyXG4gICAgICAgICAgICBub2RlLnkxID0gbm9kZS55MCArIGhlaWdodFxyXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGxpbmsgb2Ygbm9kZS5zb3VyY2VMaW5rcykge1xyXG4gICAgICAgICAgICAgICAgbGluay53aWR0aCA9IG91dC5zdHJva2VXaWR0aFNjYWxlKGxpbmsudmFsdWUpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmVvcmRlckxpbmtzKG5vZGVzKVxyXG4gICAgfVxyXG5cclxuICAgIGNvbnN0IGlkID0gKGQpID0+IGQuaWQgLy8gdXNlZCBpbiBzYW5rZXkgaW1wb3J0XHJcblxyXG4gICAgY29uc3Qgc2Fua2V5TGlua0hvcml6b250YWwgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgcmV0dXJuIGxpbmtIb3Jpem9udGFsKCkuc291cmNlKGhvcml6b250YWxTb3VyY2UpLnRhcmdldChob3Jpem9udGFsVGFyZ2V0KVxyXG4gICAgfVxyXG5cclxuICAgIHJldHVybiBvdXRcclxufVxyXG4iLCJpbXBvcnQgeyBzY2FsZVNxcnQgfSBmcm9tICdkMy1zY2FsZSdccl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ZXJzID0gc3RhdC5maWx0ZXJzIHx8IHt9XHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb2Rlcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAvL2NhdGVnb3J5IGNvZGVcclxuICAgICAgICAgICAgY29uc3QgY29kZSA9IGNvZGVzW2ldXHJcbiAgICAgICAgICAgIHN0YXQuZmlsdGVyc1tkaW1dID0gY29kZVxyXG4gICAgICAgICAgICBjb25zdCBzY18gPSB7fVxyXG4gICAgICAgICAgICBmb3IgKGxldCBrZXkgaW4gc3RhdCkge1xyXG4gICAgICAgICAgICAgICAgc2NfW2tleV0gPSBzdGF0W2tleV1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBzY18uZmlsdGVycyA9IHt9XHJcbiAgICAgICAgICAgIGZvciAobGV0IGtleSBpbiBzdGF0LmZpbHRlcnMpIHtcclxuICAgICAgICAgICAgICAgIHNjXy5maWx0ZXJzW2tleV0gPSBzdGF0LmZpbHRlcnNba2V5XVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIG91dC5zdGF0KGNvZGUsIHNjXylcclxuXHJcbiAgICAgICAgICAgIC8vaWYgc3BlY2lmaWVkLCByZXRyaWV2ZSBhbmQgYXNzaWduIGNvbG9yXHJcbiAgICAgICAgICAgIGlmIChjb2xvcnMpIHtcclxuICAgICAgICAgICAgICAgIG91dC5jYXRDb2xvcnNfID0gb3V0LmNhdENvbG9yc18gfHwge31cclxuICAgICAgICAgICAgICAgIG91dC5jYXRDb2xvcnNfW2NvZGVdID0gY29sb3JzW2ldXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy9pZiBzcGVjaWZpZWQsIHJldHJpZXZlIGFuZCBhc3NpZ24gbGFiZWxcclxuICAgICAgICAgICAgaWYgKGxhYmVscykge1xyXG4gICAgICAgICAgICAgICAgb3V0LmNhdExhYmVsc18gPSBvdXQuY2F0TGFiZWxzXyB8fCB7fVxyXG4gICAgICAgICAgICAgICAgb3V0LmNhdExhYmVsc19bY29kZV0gPSBsYWJlbHNbaV1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9zZXQgb3V0LnN0YXRDb2Rlc19cclxuICAgICAgICBvdXQuc3RhdENvZGVzXyA9IGNvZGVzXHJcblxyXG4gICAgICAgIC8vc2V0IG91dC50b3RhbENvZGVfXHJcbiAgICAgICAgaWYgKHRDb2RlKSB7XHJcbiAgICAgICAgICAgIG91dC50b3RhbENvZGVfID0gdENvZGVcclxuICAgICAgICAgICAgc3RhdC5maWx0ZXJzW2RpbV0gPSB0Q29kZVxyXG4gICAgICAgICAgICBjb25zdCBzY18gPSB7fVxyXG4gICAgICAgICAgICBmb3IgKGxldCBrZXkgaW4gc3RhdCkgc2NfW2tleV0gPSBzdGF0W2tleV1cclxuICAgICAgICAgICAgc2NfLmZpbHRlcnMgPSB7fVxyXG4gICAgICAgICAgICBmb3IgKGxldCBrZXkgaW4gc3RhdC5maWx0ZXJzKSBzY18uZmlsdGVyc1trZXldID0gc3RhdC5maWx0ZXJzW2tleV1cclxuICAgICAgICAgICAgb3V0LnN0YXQodENvZGUsIHNjXylcclxuXHJcbiAgICAgICAgICAgIC8vd2hlbiB0b3RhbCBjb2RlIGlzIHVzZWQsIGFuICdvdGhlcicgc2VjdGlvbiBpcyBhZGRlZCB0byB0aGUgcGllXHJcbiAgICAgICAgICAgIG91dC5jYXRDb2xvcnNfWydvdGhlciddID0gb3V0LnBpZU90aGVyQ29sb3JfXHJcbiAgICAgICAgICAgIG91dC5jYXRMYWJlbHNfWydvdGhlciddID0gb3V0LnBpZU90aGVyVGV4dF9cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiBvdXRcclxuICAgIH1cclxuXHJcbiAgICAvL0BvdmVycmlkZVxyXG4gICAgb3V0LnVwZGF0ZUNsYXNzaWZpY2F0aW9uID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIC8vIGF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ICAgICAgYXBwbHlDbGFzc2lmaWNhdGlvblRvTWFwKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXVtjXSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0uc3ZnSWRfICE9PSBvdXQuc3ZnSWRfKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIHVuaXF1ZSBpbnNldCBnZW9fXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXS5zdmdJZF8gIT09IG91dC5zdmdJZF8pIGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb10pXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIGFwcGx5IHRvIG1haW4gbWFwXHJcbiAgICAgICAgYXBwbHlDbGFzc2lmaWNhdGlvblRvTWFwKG91dClcclxuXHJcbiAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgfVxyXG5cclxuICAgIGNvbnN0IGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcCA9IGZ1bmN0aW9uIChtYXApIHtcclxuICAgICAgICAvL2lmIG5vdCBwcm92aWRlZCwgZ2V0IGxpc3Qgb2Ygc3RhdCBjb2RlcyBmcm9tIHRoZSBtYXAgc3RhdCBkYXRhXHJcbiAgICAgICAgaWYgKCFvdXQuc3RhdENvZGVzXykge1xyXG4gICAgICAgICAgICAvL2dldCBsaXN0IG9mIHN0YXQgY29kZXMuXHJcbiAgICAgICAgICAgIG91dC5zdGF0Q29kZXNfID0gT2JqZWN0LmtleXMob3V0LnN0YXREYXRhXylcclxuICAgICAgICAgICAgLy9yZW1vdmUgXCJkZWZhdWx0XCIsIGlmIHByZXNlbnRcclxuICAgICAgICAgICAgY29uc3QgaW5kZXggPSBvdXQuc3RhdENvZGVzXy5pbmRleE9mKCdkZWZhdWx0JylcclxuICAgICAgICAgICAgaWYgKGluZGV4ID4gLTEpIG91dC5zdGF0Q29kZXNfLnNwbGljZShpbmRleCwgMSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vZGVmaW5lIHNpemUgc2NhbGluZyBmdW5jdGlvblxyXG4gICAgICAgIGxldCBkb21haW4gPSBnZXREYXRhc2V0TWF4TWluKClcclxuICAgICAgICBpZiAoIWlzTmFOKGRvbWFpblswXSkpIHtcclxuICAgICAgICAgICAgb3V0LnNpemVDbGFzc2lmaWVyXyA9IHNjYWxlU3FydCgpLmRvbWFpbihkb21haW4pLnJhbmdlKFtvdXQucGllTWluUmFkaXVzXywgb3V0LnBpZU1heFJhZGl1c19dKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgfVxyXG5cclxuICAgIC8vQG92ZXJyaWRlXHJcbiAgICBvdXQudXBkYXRlU3R5bGUgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgLy9pZiBub3Qgc3BlY2lmaWVkLCBidWlsZCBkZWZhdWx0IGNvbG9yIHJhbXBcclxuICAgICAgICBpZiAoIW91dC5jYXRDb2xvcnNfKSB7XHJcbiAgICAgICAgICAgIG91dC5jYXRDb2xvcnMoe30pXHJcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3V0LnN0YXRDb2Rlc18ubGVuZ3RoOyBpKyspIG91dC5jYXRDb2xvcnNfW291dC5zdGF0Q29kZXNfW2ldXSA9IHNjaGVtZUNhdGVnb3J5MTBbaSAlIDEwXVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9pZiBub3Qgc3BlY2lmaWVkLCBpbml0aWFsaXNlIGNhdGVnb3J5IGxhYmVsc1xyXG4gICAgICAgIG91dC5jYXRMYWJlbHNfID0gb3V0LmNhdExhYmVsc18gfHwge31cclxuXHJcbiAgICAgICAgLy9idWlsZCBhbmQgYXNzaWduIHBpZSBjaGFydHMgdG8gdGhlIHJlZ2lvbnNcclxuICAgICAgICAvL2NvbGxlY3QgbnV0cyBpZHMgZnJvbSBnIGVsZW1lbnRzLiBUT0RPOiBmaW5kIGJldHRlciB3YXkgb2Ygc2hhcmluZyByZWdpb25zIHdpdGggcGllc1xyXG4gICAgICAgIGxldCByZWdpb25GZWF0dXJlcyA9IFtdXHJcbiAgICAgICAgaWYgKG91dC5zdmdfKSB7XHJcbiAgICAgICAgICAgIGxldCBzID0gb3V0LnN2Z18uc2VsZWN0QWxsKCcjZ19wcycpXHJcbiAgICAgICAgICAgIGlmIChzKSB7XHJcbiAgICAgICAgICAgICAgICBsZXQgc3ltID0gcy5zZWxlY3RBbGwoJ2cuZW0tc3ltYm9sJylcclxuICAgICAgICAgICAgICAgIHN5bS5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1waWUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsIChyZykgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZWdpb25GZWF0dXJlcy5wdXNoKHJnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3BpZV8nICsgcmcucHJvcGVydGllcy5pZFxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAgICAgLy8gc2V0IHJlZ2lvbiBob3ZlciBmdW5jdGlvblxyXG4gICAgICAgICAgICAgICAgbGV0IHNlbGVjdG9yID0gb3V0Lmdlb18gPT09ICdXT1JMRCcgPyAnI2VtLXdvcmxkcmcgcGF0aCcgOiAnI2VtLW51dHNyZyBwYXRoJ1xyXG4gICAgICAgICAgICAgICAgaWYgKG91dC5HZW9tZXRyaWVzLnVzZXJHZW9tZXRyaWVzKSBzZWxlY3RvciA9ICcjZW0tdXNlci1yZWdpb25zIHBhdGgnIC8vIGZvciB1c2VyLWRlZmluZWQgZ2VvbWV0cmllc1xyXG4gICAgICAgICAgICAgICAgbGV0IHJlZ2lvbnMgPSBvdXQuc3ZnKCkuc2VsZWN0QWxsKHNlbGVjdG9yKVxyXG4gICAgICAgICAgICAgICAgcmVnaW9uc1xyXG4gICAgICAgICAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKGUsIHJnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzZWwuYXR0cignZmlsbF9fXycsIHNlbC5zdHlsZSgnZmlsbCcpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzZWwuc3R5bGUoJ2ZpbGwnLCBvdXQuaG92ZXJDb2xvcl8pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQuX3Rvb2x0aXApIG91dC5fdG9vbHRpcC5tb3VzZW92ZXIob3V0LnRvb2x0aXBfLnRleHRGdW5jdGlvbihyZywgb3V0KSlcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgIC5vbignbW91c2Vtb3ZlJywgZnVuY3Rpb24gKGUsIHJnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQuX3Rvb2x0aXApIG91dC5fdG9vbHRpcC5tb3VzZW1vdmUoZSlcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3RmlsbCA9IHNlbC5hdHRyKCdmaWxsX19fJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5ld0ZpbGwpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbC5zdHlsZSgnZmlsbCcsIHNlbC5hdHRyKCdmaWxsX19fJykpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2VvdXQoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgICAgICBhZGRQaWVDaGFydHNUb01hcChyZWdpb25GZWF0dXJlcylcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gb3V0XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBGdW5jdGlvbiB0byBjb21wdXRlIGNvbXBvc2l0aW9uIGZvciByZWdpb24gaWQsIGZvciBlYWNoIGNhdGVnb3J5LlxyXG4gICAgICogUmV0dXJuIGFuIG9iamVjdCB3aXRoLCBmb3IgZWFjaCBjYXRlZ29yeSwgdGhlIHNoYXJlIFswLDFdIG9mIHRoZSBjYXRlZ29yeS5cclxuICAgICAqIEBwYXJhbSB7Kn0gaWRcclxuICAgICAqL1xyXG4gICAgY29uc3QgZ2V0Q29tcG9zaXRpb24gPSBmdW5jdGlvbiAoaWQpIHtcclxuICAgICAgICBsZXQgY29tcCA9IHt9LFxyXG4gICAgICAgICAgICBzdW0gPSAwXHJcbiAgICAgICAgLy9nZXQgc3RhdCB2YWx1ZSBmb3IgZWFjaCBjYXRlZ29yeS4gQ29tcHV0ZSB0aGUgc3VtLlxyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3V0LnN0YXRDb2Rlc18ubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgLy9yZXRyaWV2ZSBjb2RlIGFuZCBzdGF0IHZhbHVlXHJcbiAgICAgICAgICAgIGNvbnN0IHNjID0gb3V0LnN0YXRDb2Rlc19baV1cclxuICAgICAgICAgICAgY29uc3QgcyA9IG91dC5zdGF0RGF0YShzYykuZ2V0KGlkKVxyXG5cclxuICAgICAgICAgICAgLy9jYXNlIHdoZW4gc29tZSBkYXRhIGlzIG1pc3NpbmdcclxuICAgICAgICAgICAgaWYgKCFzIHx8IChzLnZhbHVlICE9IDAgJiYgIXMudmFsdWUpIHx8IGlzTmFOKHMudmFsdWUpKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAob3V0LnNob3dPbmx5V2hlbkNvbXBsZXRlKCkpIHJldHVybiB1bmRlZmluZWRcclxuICAgICAgICAgICAgICAgIGVsc2UgY29udGludWVcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgY29tcFtzY10gPSBzLnZhbHVlXHJcbiAgICAgICAgICAgIHN1bSArPSBzLnZhbHVlXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyB3aGVuIG91dC50b3RhbENvZGVfIGlzIHNwZWNpZmllZCwgdXNlIGl0IGFzIHRoZSBzdW0gaW5zdGVhZCBvZiB0aGUgc3VtIG9mIHRoZSBzcGVjaWZpZWQgY2F0ZWdvcmllcy5cclxuICAgICAgICBpZiAob3V0LnRvdGFsQ29kZV8pIHtcclxuICAgICAgICAgICAgbGV0IHMgPSBvdXQuc3RhdERhdGEob3V0LnRvdGFsQ29kZV8pLmdldChpZClcclxuICAgICAgICAgICAgaWYgKHMpIHtcclxuICAgICAgICAgICAgICAgIHN1bSA9IHMudmFsdWVcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHN1bSA9PSAwXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vY2FzZSB3aGVuIG5vIGRhdGFcclxuICAgICAgICBpZiAoc3VtID09IDApIHJldHVybiB1bmRlZmluZWRcclxuXHJcbiAgICAgICAgLy9jb21wdXRlIHJhdGlvc1xyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3V0LnN0YXRDb2Rlc18ubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgY29tcFtvdXQuc3RhdENvZGVzX1tpXV0gLz0gc3VtXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2FkZCBcIm90aGVyXCIgY2F0ZWdvcnkgd2hlbiBvdXQudG90YWxDb2RlXyBpcyB1c2VkXHJcbiAgICAgICAgaWYgKG91dC50b3RhbENvZGVfKSB7XHJcbiAgICAgICAgICAgIGxldCB0b3RhbFBlcmMgPSAwXHJcbiAgICAgICAgICAgIGZvciAobGV0IGtleSBpbiBjb21wKSB7XHJcbiAgICAgICAgICAgICAgICB0b3RhbFBlcmMgPSB0b3RhbFBlcmMgKyBjb21wW2tleV1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjb21wWydvdGhlciddID0gMSAtIHRvdGFsUGVyY1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgcmV0dXJuIGNvbXBcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEBmdW5jdGlvbiBnZXREYXRhc2V0TWF4TWluXHJcbiAgICAgKiBAZGVzY3JpcHRpb24gZ2V0cyB0aGUgbWF4aW11bSBhbmQgbWluaW11bSB0b3RhbCBvZiBhbGwgZGltZW5zaW9ucyBjb21iaW5lZCBmb3IgZWFjaCByZWdpb24uIFVzZWQgdG8gZGVmaW5lIHRoZSBkb21haW4gb2YgdGhlIHBpZSBzaXplIHNjYWxpbmcgZnVuY3Rpb24uXHJcbiAgICAgKiBAcmV0dXJucyBbbWluLG1heF1cclxuICAgICAqL1xyXG4gICAgZnVuY3Rpb24gZ2V0RGF0YXNldE1heE1pbigpIHtcclxuICAgICAgICBsZXQgdG90YWxzID0gW11cclxuICAgICAgICBsZXQgc2VsID0gb3V0LnN2ZygpLnNlbGVjdEFsbCgnI2dfcHMnKS5zZWxlY3RBbGwoJ2cuZW0tc3ltYm9sJykuZGF0YSgpXHJcblxyXG4gICAgICAgIHNlbC5mb3JFYWNoKChyZykgPT4ge1xyXG4gICAgICAgICAgICBsZXQgaWQgPSByZy5wcm9wZXJ0aWVzLmlkXHJcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IGdldFJlZ2lvblRvdGFsKGlkKVxyXG4gICAgICAgICAgICBpZiAodG90YWwpIHtcclxuICAgICAgICAgICAgICAgIHRvdGFscy5wdXNoKHRvdGFsKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSlcclxuXHJcbiAgICAgICAgbGV0IG1pbm1heCA9IGV4dGVudCh0b3RhbHMpXHJcbiAgICAgICAgcmV0dXJuIG1pbm1heFxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogR2V0IGFic29sdXRlIHRvdGFsIHZhbHVlIG9mIGNvbWJpbmVkIHN0YXRpc3RpY2FsIHZhbHVlcyBmb3IgYSBzcGVjaWZpYyByZWdpb24uIEUuZyB0b3RhbCBsaXZlc3RvY2tcclxuICAgICAqIEBwYXJhbSB7Kn0gaWQgbnV0cyByZWdpb24gaWRcclxuICAgICAqL1xyXG4gICAgY29uc3QgZ2V0UmVnaW9uVG90YWwgPSBmdW5jdGlvbiAoaWQpIHtcclxuICAgICAgICBsZXQgc3VtID0gMFxyXG4gICAgICAgIGxldCBzXHJcbiAgICAgICAgaWYgKG91dC50b3RhbENvZGVfKSB7XHJcbiAgICAgICAgICAgIC8vd2hlbiB0b3RhbCBpcyBhIHN0YXQgY29kZVxyXG4gICAgICAgICAgICBzID0gb3V0LnN0YXREYXRhKG91dC50b3RhbENvZGVfKS5nZXQoaWQpXHJcbiAgICAgICAgICAgIC8vY2FzZSB3aGVuIHNvbWUgZGF0YSBpcyBtaXNzaW5nXHJcbiAgICAgICAgICAgIGlmICghcyB8fCAocy52YWx1ZSAhPSAwICYmICFzLnZhbHVlKSB8fCBpc05hTihzLnZhbHVlKSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKG91dC5zaG93T25seVdoZW5Db21wbGV0ZSgpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc3VtID0gdW5kZWZpbmVkXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBzdW0gPSBzLnZhbHVlXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAvL2dldCBzdGF0IHZhbHVlIGZvciBlYWNoIGNhdGVnb3J5LiBDb21wdXRlIHRoZSBzdW0uXHJcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3V0LnN0YXRDb2Rlc18ubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIC8vcmV0cmlldmUgY29kZSBhbmQgc3RhdCB2YWx1ZVxyXG4gICAgICAgICAgICAgICAgY29uc3Qgc2MgPSBvdXQuc3RhdENvZGVzX1tpXVxyXG4gICAgICAgICAgICAgICAgcyA9IG91dC5zdGF0RGF0YShzYykuZ2V0KGlkKVxyXG4gICAgICAgICAgICAgICAgLy9jYXNlIHdoZW4gc29tZSBkYXRhIGlzIG1pc3NpbmdcclxuICAgICAgICAgICAgICAgIGlmICghcyB8fCAocy52YWx1ZSAhPSAwICYmICFzLnZhbHVlKSB8fCBpc05hTihzLnZhbHVlKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQuc2hvd09ubHlXaGVuQ29tcGxldGUoKSkgcmV0dXJuIHVuZGVmaW5lZFxyXG4gICAgICAgICAgICAgICAgICAgIGVsc2UgY29udGludWVcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHN1bSArPSBzLnZhbHVlXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vY2FzZSB3aGVuIG5vIGRhdGFcclxuICAgICAgICBpZiAoc3VtID09IDApIHJldHVybiB1bmRlZmluZWRcclxuICAgICAgICByZXR1cm4gc3VtXHJcbiAgICB9XHJcblxyXG4gICAgZnVuY3Rpb24gYWRkUGllQ2hhcnRzVG9NYXAocmVnaW9uRmVhdHVyZXMpIHtcclxuICAgICAgICByZWdpb25GZWF0dXJlcy5mb3JFYWNoKChyZWdpb24pID0+IHtcclxuICAgICAgICAgICAgY29uc3QgcmVnaW9uSWQgPSByZWdpb24ucHJvcGVydGllcy5pZFxyXG4gICAgICAgICAgICAvL3ByZXBhcmUgZGF0YSBmb3IgcGllIGNoYXJ0XHJcbiAgICAgICAgICAgIGNvbnN0IGRhdGEgPSBbXVxyXG4gICAgICAgICAgICBjb25zdCBjb21wID0gZ2V0Q29tcG9zaXRpb24ocmVnaW9uSWQpXHJcbiAgICAgICAgICAgIGZvciAoY29uc3Qga2V5IGluIGNvbXApIGRhdGEucHVzaCh7IGNvZGU6IGtleSwgdmFsdWU6IGNvbXBba2V5XSB9KVxyXG5cclxuICAgICAgICAgICAgLy9jYXNlIG9mIHJlZ2lvbnMgd2l0aCBubyBkYXRhXHJcbiAgICAgICAgICAgIGlmICghZGF0YSB8fCBkYXRhLmxlbmd0aCA9PSAwKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm5cclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy9jcmVhdGUgc3ZnIGZvciBwaWUgY2hhcnRcclxuICAgICAgICAgICAgLy8gY2FuIGJlIG1vcmUgdGhhbiBvbmUgY2VudGVyIHBvaW50IGZvciBlYWNoIG51dHMgSUQgKGUuZy4gTWFsdGEgd2hlbiBpbmNsdWRlZCBpbiBpbnNldHMpXHJcbiAgICAgICAgICAgIGxldCBub2RlcyA9IG91dC5zdmcoKS5zZWxlY3RBbGwoJyNwaWVfJyArIHJlZ2lvbklkKVxyXG5cclxuICAgICAgICAgICAgLy8gZGVmaW5lIHJhZGl1c1xyXG4gICAgICAgICAgICBjb25zdCByID0gb3V0LnNpemVDbGFzc2lmaWVyXyhnZXRSZWdpb25Ub3RhbChyZWdpb25JZCkpXHJcbiAgICAgICAgICAgIGNvbnN0IGlyID0gb3V0LnBpZUNoYXJ0SW5uZXJSYWRpdXNfXHJcblxyXG4gICAgICAgICAgICAvL21ha2UgcGllIGNoYXJ0LiBTZWUgaHR0cHM6Ly9vYnNlcnZhYmxlaHEuY29tL0BkMy9waWUtY2hhcnRcclxuICAgICAgICAgICAgY29uc3QgcGllXyA9IHBpZSgpXHJcbiAgICAgICAgICAgICAgICAuc29ydChudWxsKVxyXG4gICAgICAgICAgICAgICAgLnZhbHVlKChkKSA9PiBkLnZhbHVlKVxyXG4gICAgICAgICAgICBub2Rlc1xyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignc3Ryb2tlJywgb3V0LnBpZVN0cm9rZUZpbGxfKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZS13aWR0aCcsIG91dC5waWVTdHJva2VXaWR0aF8gKyAncHgnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ3BpZWNoYXJ0JylcclxuICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmRhdGEocGllXyhkYXRhKSlcclxuICAgICAgICAgICAgICAgIC5qb2luKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIChkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG91dC5jYXRDb2xvcnNfW2QuZGF0YS5jb2RlXSB8fCAnbGlnaHRncmF5J1xyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdmaWxsX19fJywgKGQpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3V0LmNhdENvbG9yc19bZC5kYXRhLmNvZGVdIHx8ICdsaWdodGdyYXknXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NvZGUnLCAoZCkgPT4gZC5kYXRhLmNvZGUpIC8vZm9yIG1vdXNlb3ZlciBsZWdlbmQgaGlnaGxpZ2h0aW5nIGZ1bmN0aW9uXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZCcsIGFyYygpLmlubmVyUmFkaXVzKGlyKS5vdXRlclJhZGl1cyhyKSlcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKGUsIHJnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2VsID0gc2VsZWN0KHRoaXMpXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gQXBwbHkgYSB0aGljayBzdHJva2Ugd2lkdGggdG8gdGhlIHBhcmVudCBlbGVtZW50XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGFyZW50ID0gc2VsZWN0KHNlbC5ub2RlKCkucGFyZW50Tm9kZSlcclxuICAgICAgICAgICAgICAgICAgICBwYXJlbnQuc3R5bGUoJ3N0cm9rZS13aWR0aCcsICcycHgnKS5zdHlsZSgnc3Ryb2tlJywgJ2JsYWNrJykgLy8gU2V0IHN0cm9rZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQuX3Rvb2x0aXApIG91dC5fdG9vbHRpcC5tb3VzZW92ZXIob3V0LnRvb2x0aXBfLnRleHRGdW5jdGlvbihyZWdpb24sIG91dCkpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW1vdmUnLCBmdW5jdGlvbiAoZSwgcmcpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2Vtb3ZlKGUpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgICAgICAvLyBSZXNldCBzdHJva2VcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBwYXJlbnQgPSBzZWxlY3Qoc2VsLm5vZGUoKS5wYXJlbnROb2RlKVxyXG4gICAgICAgICAgICAgICAgICAgIHBhcmVudC5zdHlsZSgnc3Ryb2tlLXdpZHRoJywgb3V0LnBpZVN0cm9rZVdpZHRoXykuc3R5bGUoJ3N0cm9rZScsIG91dC5waWVTdHJva2VGaWxsXykgLy8gU2V0IHN0cm9rZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQuX3Rvb2x0aXApIG91dC5fdG9vbHRpcC5tb3VzZW91dCgpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgIH0pXHJcbiAgICB9XHJcblxyXG4gICAgLy9Ab3ZlcnJpZGVcclxuICAgIG91dC5nZXRMZWdlbmRDb25zdHJ1Y3RvciA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICByZXR1cm4gUGllY2hhcnRMZWdlbmQubGVnZW5kXHJcbiAgICB9XHJcblxyXG4gICAgLy9zcGVjaWZpYyB0b29sdGlwIHRleHQgZnVuY3Rpb25cclxuICAgIG91dC50b29sdGlwXy50ZXh0RnVuY3Rpb24gPSBmdW5jdGlvbiAocmcsIG1hcCkge1xyXG4gICAgICAgIC8vZ2V0IHRvb2x0aXBcclxuICAgICAgICBjb25zdCB0cCA9IHNlbGVjdCgnI3Rvb2x0aXBfZXVyb3N0YXQnKVxyXG5cclxuICAgICAgICAvL2NsZWFyXHJcbiAgICAgICAgdHAuaHRtbCgnJylcclxuICAgICAgICB0cC5zZWxlY3RBbGwoJyonKS5yZW1vdmUoKVxyXG5cclxuICAgICAgICBpZiAocmcucHJvcGVydGllcy5pZCkge1xyXG4gICAgICAgICAgICAvL25hbWUgYW5kIGNvZGVcclxuICAgICAgICAgICAgdHAuYXBwZW5kKCdkaXYnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VzdGF0LXZpcy10b29sdGlwLWJhcicpXHJcbiAgICAgICAgICAgICAgICAuaHRtbChyZy5wcm9wZXJ0aWVzLm5hICsgJyAoJyArIHJnLnByb3BlcnRpZXMuaWQgKyAnKScpXHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgLy9yZWdpb24gbmFtZVxyXG4gICAgICAgICAgICB0cC5hcHBlbmQoJ2RpdicpLmF0dHIoJ2NsYXNzJywgJ2VzdGF0LXZpcy10b29sdGlwLWJhcicpLmh0bWwocmcucHJvcGVydGllcy5uYSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vcHJlcGFyZSBkYXRhIGZvciBwaWUgY2hhcnRcclxuICAgICAgICBjb25zdCBkYXRhID0gW11cclxuICAgICAgICBjb25zdCBjb21wID0gZ2V0Q29tcG9zaXRpb24ocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiBjb21wKSBkYXRhLnB1c2goeyBjb2RlOiBrZXksIHZhbHVlOiBjb21wW2tleV0gfSlcclxuXHJcbiAgICAgICAgLy9jYXNlIG9mIHJlZ2lvbnMgd2l0aCBubyBkYXRhXHJcbiAgICAgICAgaWYgKCFkYXRhIHx8IGRhdGEubGVuZ3RoID09IDApIHtcclxuICAgICAgICAgICAgdHAuYXBwZW5kKCdkaXYnKS5odG1sKG91dC5ub0RhdGFUZXh0KCkpXHJcbiAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9jcmVhdGUgc3ZnIGZvciBwaWUgY2hhcnRcclxuICAgICAgICAvLy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DIgKyAnLCcgKyBoZWlnaHQgLyAyICsgJyknKVxyXG5cclxuICAgICAgICAvL21ha2UgcGllIGNoYXJ0LiBTZWUgaHR0cHM6Ly9vYnNlcnZhYmxlaHEuY29tL0BkMy9waWUtY2hhcnRcclxuICAgICAgICBjb25zdCBwaWVfID0gcGllKClcclxuICAgICAgICAgICAgLnNvcnQobnVsbClcclxuICAgICAgICAgICAgLnZhbHVlKChkKSA9PiBkLnZhbHVlKVxyXG5cclxuICAgICAgICBjb25zdCBpbm5lckFyYyA9IGFyYygpXHJcbiAgICAgICAgICAgIC5pbm5lclJhZGl1cygwKSAvLyBUaGlzIGlzIHRoZSBzaXplIG9mIHRoZSBkb251dCBob2xlXHJcbiAgICAgICAgICAgIC5vdXRlclJhZGl1cyhyYWRpdXMgKiAwLjgpXHJcblxyXG4gICAgICAgIC8vIEFub3RoZXIgYXJjIHRoYXQgd29uJ3QgYmUgZHJhd24uIEp1c3QgZm9yIGxhYmVscyBwb3NpdGlvbmluZ1xyXG4gICAgICAgIGNvbnN0IG91dGVyQXJjID0gYXJjKClcclxuICAgICAgICAgICAgLmlubmVyUmFkaXVzKHJhZGl1cyAqIDAuOSlcclxuICAgICAgICAgICAgLm91dGVyUmFkaXVzKHJhZGl1cyAqIDAuOSlcclxuXHJcbiAgICAgICAgY29uc3QgcGllRGF0YSA9IHBpZV8oZGF0YSlcclxuICAgICAgICBzdmcuc2VsZWN0QWxsKCdhbGxTbGljZXMnKVxyXG4gICAgICAgICAgICAuZGF0YShwaWVEYXRhKVxyXG4gICAgICAgICAgICAuZW50ZXIoKVxyXG4gICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgLmF0dHIoJ2QnLCBpbm5lckFyYylcclxuICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgKGQpID0+IHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBvdXQuY2F0Q29sb3JzKClbZC5kYXRhLmNvZGVdIHx8ICdsaWdodGdyYXknXHJcb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01pblNpemVfJyxcclxuICAgICAgICAncHNNYXhWYWx1ZV8nLFxyXG4gICAgICAgICdwc01pblZhbHVlXycsXHJcbiAgICAgICAgJ3BzRmlsbF8nLFxyXG4gICAgICAgICdwc0ZpbGxPcGFjaXR5XycsXHJcbiAgICAgICAgJ3BzU3Ryb2tlXycsXHJcbiAgICAgICAgJ3BzU3Ryb2tlV2lkdGhfJyxcclxuICAgICAgICAnY2xhc3NpZmllclNpemVfJyxcclxuICAgICAgICAnY2xhc3NpZmllckNvbG9yXycsXHJcbiAgICAgICAgJ3BzU2hhcGVfJyxcclxuICAgICAgICAncHNDdXN0b21TaGFwZV8nLFxyXG4gICAgICAgICdwc0JhcldpZHRoXycsXHJcbiAgICAgICAgJ3BzQ2xhc3NUb0ZpbGxTdHlsZV8nLFxyXG4gICAgICAgICdwc0NvbG9yRnVuXycsXHJcbiAgICAgICAgJ25vRGF0YUZpbGxTdHlsZV8nLFxyXG4gICAgICAgICdwc1RocmVzaG9sZF8nLFxyXG4gICAgICAgICdwc0NvbG9yc18nLFxyXG4gICAgICAgICdwc0N1c3RvbVNWR18nLFxyXG4gICAgICAgICdwc09mZnNldF8nLFxyXG4gICAgICAgICdwc0NsYXNzaWZpY2F0aW9uTWV0aG9kXycsXHJcbiAgICAgICAgJ3BzQ2xhc3Nlc18nLFxyXG4gICAgXS5mb3JFYWNoKGZ1bmN0aW9uIChhdHQpIHtcclxuICAgICAgICBvdXRbYXR0LnN1YnN0cmluZygwLCBhdHQubGVuZ3RoIC0gMSldID0gZnVuY3Rpb24gKHYpIHtcclxuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gb3V0W2F0dF1cclxuICAgICAgICAgICAgb3V0W2F0dF0gPSB2XHJcbiAgICAgICAgICAgIHJldHVybiBvdXRcclxuICAgICAgICB9XHJcbiAgICB9KVxyXG5cclxuICAgIC8vb3ZlcnJpZGUgYXR0cmlidXRlIHZhbHVlcyB3aXRoIGNvbmZpZyB2YWx1ZXNcclxuICAgIGlmIChjb25maWcpXHJcbiAgICAgICAgW1xyXG4gICAgICAgICAgICAncHNNYXhTaXplJyxcclxuICAgICAgICAgICAgJ3BzTWluU2l6ZScsXHJcbiAgICAgICAgICAgICdwc0ZpbGwnLFxyXG4gICAgICAgICAgICAncHNGaWxsT3BhY2l0eScsXHJcbiAgICAgICAgICAgICdwc1N0cm9rZScsXHJcbiAgICAgICAgICAgICdwc1N0cm9rZVdpZHRoJyxcclxuICAgICAgICAgICAgJ2NsYXNzaWZpZXJTaXplJyxcclxuICAgICAgICAgICAgJ2NsYXNzaWZpZXJDb2xvcicsXHJcbiAgICAgICAgICAgICdwc1NoYXBlJyxcclxuICAgICAgICAgICAgJ3BzQ3VzdG9tU2hhcGUnLFxyXG4gICAgICAgICAgICAncHNCYXJXaWR0aCcsXHJcbiAgICAgICAgICAgICdwc0NsYXNzVG9GaWxsU3R5bGUnLFxyXG4gICAgICAgICAgICAncHNDb2xvckZ1bicsXHJcbiAgICAgICAgICAgICdub0RhdGFGaWxsU3R5bGUnLFxyXG4gICAgICAgICAgICAncHNUaHJlc2hvbGQnLFxyXG4gICAgICAgICAgICAncHNDb2xvcnMnLFxyXG4gICAgICAgICAgICAncHNDdXN0b21TVkcnLFxyXG4gICAgICAgICAgICAncHNPZmZzZXQnLFxyXG4gICAgICAgICAgICAncHNDbGFzc2lmaWNhdGlvbk1ldGhvZCcsXHJcbiAgICAgICAgICAgICdwc0NsYXNzZXMnLFxyXG4gICAgICAgIF0uZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XHJcbiAgICAgICAgICAgIGlmIChjb25maWdba2V5XSAhPSB1bmRlZmluZWQpIG91dFtrZXldKGNvbmZpZ1trZXldKVxyXG4gICAgICAgIH0pXHJcblxyXG4gICAgLy9vdmVycmlkZSBvZiBzb21lIHNwZWNpYWwgZ2V0dGVycy9zZXR0ZXJzXHJcbiAgICBvdXQucHNDb2xvckZ1biA9IGZ1bmN0aW9uICh2KSB7XHJc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dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gdW5pcXVlIGluc2V0IGdlb19cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dLnN2Z0lkXyAhPT0gb3V0LnN2Z0lkXykgYXBwbHlDbGFzc2lmaWNhdGlvblRvTWFwKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXSlcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gYXBwbHkgdG8gbWFpbiBtYXBcclxuICAgICAgICBhcHBseUNsYXNzaWZpY2F0aW9uVG9NYXAob3V0KVxyXG5cclxuICAgICAgICByZXR1cm4gb3V0XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBAZGVzY3JpcHRpb24gYXNzaWducyBhIGNvbG9yIHRvIGVhY2ggc3ltYm9sLCBiYXNlZCBvbiB0aGVpciBzdGF0aXN0aWNhbCB2YWx1ZVxyXG4gICAgICogQHBhcmFtIHsqfSBtYXBcclxuICAgICAqL1xyXG4gICAgZnVuY3Rpb24gYXBwbHlDbGFzc2lmaWNhdGlvblRvTWFwKG1hcCkge1xyXG4gICAgICAgIGlmIChtYXAuc3ZnXykge1xyXG4gICAgICAgICAgICBpZiAob3V0LmNsYXNzaWZpZXJDb2xvcl8pIHtcclxuICAgICAgICAgICAgICAgIC8vYXNzaWduIGNvbG9yIGNsYXNzIHRvIGVhY2ggc3ltYm9sLCBiYXNlZCBvbiB0aGVpciB2YWx1ZVxyXG4gICAgICAgICAgICAgICAgLy8gYXQgdGhpcyBwb2ludCwgdGhlIHN5bWJvbCBwYXRoIGhhc250IGJlZW4gYXBwZW5kZWQuIE9ubHkgdGhlIHBhcmVudCBnLmVtLXN5bWJvbCBlbGVtZW50IChpbiBtYXAtdGVtcGxhdGUpXHJcbiAgICAgICAgICAgICAgICBsZXQgY29sb3JEYXRhID0gbWFwLnN0YXREYXRhKCdjb2xvcicpXHJcbiAgICAgICAgICAgICAgICBtYXAuc3ZnXy5zZWxlY3RBbGwoJy5lbS1zeW1ib2wnKS5hdHRyKCdlY2wnLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzdiA9IGNvbG9yRGF0YS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXN2KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnbmQnXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHYgPSBzdi52YWx1ZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh2ICE9PSAwICYmICF2KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnbmQnXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGxldCBjID0gK291dC5jbGFzc2lmaWVyQ29sb3JfKCt2KVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogQGRlc2NyaXB0aW9uIGRlZmluZXMgY2xhc3NpZmllciBmdW5jdGlvbnMgKG91dC5jbGFzc2lmaWVyQ29sb3IgYW5kIG91dC5jbGFzc2lmaWVyU2l6ZSkgZm9yIGJvdGggc3ltYm9sIHNpemUgYW5kIGNvbG9yXHJcbiAgICAgKi9cclxuICAgIGZ1bmN0aW9uIGRlZmluZUNsYXNzaWZpZXJzKCkge1xyXG4gICAgICAgIC8vc2ltcGx5IHJldHVybiB0aGUgYXJyYXkgWzAsMSwyLDMsLi4uLG5iLTFdXHJcbiAgICAgICAgY29uc3QgZ2V0QSA9IGZ1bmN0aW9uIChuYikge1xyXG4gICAgICAgICAgICByZXR1cm4gWy4uLkFycmF5KG5iKS5rZXlzKCldXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyB1c2Ugc2l6ZSBkYXRhc2V0XHJcbiAgICAgICAgbGV0IHNpemVEb21haW5cclxuICAgICAgICBsZXQgZGF0YSA9IG91dC5zdGF0RGF0YSgnc2l6ZScpLmdldEFycmF5KClcclxuICAgICAgICAvLyBsZXQgZG9tYWluID0gZXh0ZW50KGRhdGEpXHJcbiAgICAgICAgbGV0IG1pbiA9IG91dC5wc01pblZhbHVlXyA/IG91dC5wc01pblZhbHVlXyA6IG91dC5zdGF0RGF0YSgnc2l6ZScpLmdldE1pbigpXHJcbiAgICAgICAgbGV0IG1heCA9IG91dC5wc01heFZhbHVlXyA/IG91dC5wc01heFZhbHVlXyA6IG91dC5zdGF0RGF0YSgnc2l6ZScpLmdldE1heCgpXHJcblxyXG4gICAgICAgIHNpemVEb21haW4gPSBkYXRhID8gW21pbiwgbWF4XSA6IFtvdXQuc3RhdERhdGEoKS5nZXRNaW4oKSwgb3V0LnN0YXREYXRhKCkuZ2V0TWF4KCldXHJcblxyXG4gICAgICAgIG91dC5jbGFzc2lmaWVyU2l6ZShvdXQucHNTaXplRnVuXygpLmRvbWFpbihzaXplRG9tYWluKS5yYW5nZShbb3V0LnBzTWluU2l6ZV8sIG91dC5wc01heFNpemVfXSkpXHJcblxyXG4gICAgICAgIC8vIGNvbG91clxyXG4gICAgICAgIGlmIChvdXQuc3RhdERhdGEoJ2NvbG9yJykuZ2V0QXJyYXkoKSkge1xyXG4gICAgICAgICAgICAvL3VzZSBzdWl0YWJsZSBjbGFzc2lmaWNhdGlvbiB0eXBlIGZvciBjb2xvdXJpbmdcclxuICAgICAgICAgICAgaWYgKG91dC5wc0NsYXNzaWZpY2F0aW9uTWV0aG9kXyA9PT0gJ3F1YW50aWxlJykge1xyXG4gICAgICAgICAgICAgICAgLy9odHRwczovL2dpdGh1Yi5jb20vZDMvZDMtc2NhbGUjcXVhbnRpbGUtc2NhbGVzXHJcbiAgICAgICAgICAgICAgICBjb25zdCBkb21haW4gPSBvdXQuc3RhdERhdGEoJ2NvbG9yJykuZ2V0QXJyYXkoKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgcmFuZ2UgPSBnZXRBKG91dC5wc0NsYXNzZXNfKVxyXG4gICAgICAgICAgICAgICAgb3V0LmNsYXNzaWZpZXJDb2xvcihzY2FsZVF1YW50aWxlKCkuZG9tYWluKGRvbWFpbikucmFuZ2UocmFuZ2UpKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKG91dC5wc0NsYXNzaWZpY2F0aW9uTWV0aG9kXyA9PT0gJ2VxdWludGVyJykge1xyXG4gICAgICAgICAgICAgICAgLy9odHRwczovL2dpdGh1Yi5jb20vZDMvZDMtc2NhbGUjcXVhbnRpemUtc2NhbGVzXHJcbiAgICAgICAgICAgICAgICBjb25zdCBkb21haW4gPSBvdXQuc3RhdERhdGEoJ2NvbG9yJykuZ2V0QXJyYXkoKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgcmFuZ2UgPSBnZXRBKG91dC5wc0NsYXNzZXNfKVxyXG4gICAgICAgICAgICAgICAgb3V0LmNsYXNzaWZpZXJDb2xvcihcclxuICAgICAgICAgICAgICAgICAgICBzY2FsZVF1YW50aXplKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmRvbWFpbihbbWluKGRvbWFpbiksIG1heChkb21haW4pXSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnJhbmdlKHJhbmdlKVxyXG4gICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAgICAgaWYgKG91dC5tYWtlQ2xhc3NpZk5pY2VfKSBvdXQuY2xhc3NpZmllckNvbG9yKCkubmljZSgpXHJcbiAgICAgICAgICAgIH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gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgLy8gbnV0cyByZWdpb25zIGZpbGwgY29sb3VyIG9ubHkgZm9yIHRob3NlIHdpdGggc2l6ZURhdGFcclxuICAgICAgICAgICAgICAgIHJlZ2lvbnMuc3R5bGUoJ2ZpbGwnLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzdiA9IHNpemVEYXRhLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghc3YgfHwgKCFzdi52YWx1ZSAmJiBzdiAhPT0gMCAmJiBzdi52YWx1ZSAhPT0gMCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gTk8gSU5QVVRcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG91dC5ub0RhdGFGaWxsU3R5bGVfXHJcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoc3YgJiYgc3YudmFsdWUpIHx8IChzdiAmJiBzdi52YWx1ZSA9PSAwKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3YudmFsdWUgPT0gJzonKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBEQVRBIE5PVCBBVkFJTEFCTEVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvdXQubm9EYXRhRmlsbFN0eWxlX1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIERBVEFcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdldENTU1Byb3BlcnR5RnJvbUNsYXNzKCdlbS1udXRzcmcnLCAnZmlsbCcpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBhcHBseSAnbmQnIGNsYXNzIHRvIG5vIGRhdGEgZm9yIGxlZ2VuZCBpdGVtIGhvdmVyXHJcbiAgICAgICAgICAgICAgICByZWdpb25zLmF0dHIoJ2VjbCcsIGZ1bmN0aW9uIChyZykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdiB8fCAoIXN2LnZhbHVlICYmIHN2ICE9PSAwICYmIHN2LnZhbHVlICE9PSAwKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBOTyBJTlBVVFxyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ25kJ1xyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHN2ICYmIHN2LnZhbHVlKSB8fCAoc3YgJiYgc3YudmFsdWUgPT0gMCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN2LnZhbHVlID09ICc6Jykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gREFUQSBOT1QgQVZBSUxBQkxFXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ25kJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vIHdvcmxkIGNvdW50cmllcyBmaWxsXHJcbiAgICAgICAgICAgICAgICByZWdpb25zLnN0eWxlKCdmaWxsJywgZnVuY3Rpb24gKHJnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBzaXplRGF0YS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXN2IHx8ICghc3YudmFsdWUgJiYgc3YgIT09IDAgJiYgc3YudmFsdWUgIT09IDApIHx8IHN2LnZhbHVlID09ICc6Jykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3V0LndvcmxkRmlsbFN0eWxlX1xyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXRDU1NQcm9wZXJ0eUZyb21DbGFzcygnZW0tbnV0c3JnJywgJ2ZpbGwnKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vIHNldCBjb2xvci9zdHJva2Uvb3BhY2l0eSBzdHlsZXNcclxuICAgICAgICAgICAgc2V0U3ltYm9sU3R5bGVzKHN5bWIpXHJcblxyXG4gICAgICAgICAgICBhZGRNb3VzZUV2ZW50cyhtYXApXHJcblxyXG4gICAgICAgICAgICAvLyBVcGRhdGUgbGFiZWxzIGZvciBzdGF0aXN0aWNhbCB2YWx1ZXMgaWYgcmVxdWlyZWRcclxuICAgICAgICAgICAgaWYgKG91dC5sYWJlbHNfPy52YWx1ZXMpIHtcclxuICAgICAgICAgICAgICAgIG91dC51cGRhdGVWYWx1ZXNMYWJlbHMobWFwKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBtYXBcclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBhZGRNb3VzZUV2ZW50cyA9IGZ1bmN0aW9uIChtYXApIHtcclxuICAgICAgICBsZXQgc3ltYm9scyA9IG1hcC5zdmcoKS5zZWxlY3RBbGwoJ2cuZW0tc3ltYm9sJylcclxuICAgICAgICBzeW1ib2xzXHJcbiAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKGUsIHJnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcy5jaGlsZE5vZGVzWzBdKVxyXG4gICAgICAgICAgICAgICAgc2VsLmF0dHIoJ2ZpbGxfX18nLCBzZWwuc3R5bGUoJ2ZpbGwnKSlcclxuICAgICAgICAgICAgICAgIHNlbC5zdHlsZSgnZmlsbCcsIG91dC5ob3ZlckNvbG9yXylcclxuICAgICAgICAgICAgICAgIGlmIChvdXQuX3Rvb2x0aXApIG91dC5fdG9vbHRpcC5tb3VzZW92ZXIob3V0LnRvb2x0aXBfLnRleHRGdW5jdGlvbihyZywgb3V0KSlcclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgLm9uKCdtb3VzZW1vdmUnLCBmdW5jdGlvbiAoZSwgcmcpIHtcclxuICAgICAgICAgICAgICAgIGlmIChvdXQuX3Rvb2x0aXApIG91dC5fdG9vbHRpcC5tb3VzZW1vdmUoZSlcclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uIChlKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcy5jaGlsZE5vZGVzWzBdKVxyXG4gICAgICAgICAgICAgICAgbGV0IG5ld0ZpbGwgPSBzZWwuYXR0cignZmlsbF9fXycpXHJcbiAgICAgICAgICAgICAgICBpZiAobmV3RmlsbCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHNlbC5zdHlsZSgnZmlsbCcsIG5ld0ZpbGwpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5fdG9vbHRpcCkgb3V0Ll90b29sdGlwLm1vdXNlb3V0KClcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSlcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIE9WRVJSSURFXHJcbiAgICAgKiBAZGVzY3JpcHRpb24gdXBkYXRlIHRoZSBzdGF0aXN0aWNhbCB2YWx1ZXMgbGFiZWxzIG9uIHRoZSBtYXBcclxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBtYXAgZXVyb3N0YXQtbWFwIG1hcCBpbnN0YW5jZVxyXG4gICAgICogQHJldHVybiB7fSBvdXRcclxuICAgICAqL1xyXG4gICAgb3V0LnVwZGF0ZVZhbHVlc0xhYmVscyA9IGZ1bmN0aW9uIChtYXApIHtcclxuICAgICAgICAvLyBhcHBseSB0byBtYWluIG1hcFxyXG4gICAgICAgIC8vY2xlYXIgcHJldmlvdXMgbGFiZWxzXHJcbiAgICAgICAgbGV0IHByZXZMYWJlbHMgPSBtYXAuc3ZnXy5zZWxlY3RBbGwoJ2cuZW0tc3RhdC1sYWJlbCA+IConKVxyXG4gICAgICAgIHByZXZMYWJlbHMucmVtb3ZlKClcclxuICAgICAgICBsZXQgcHJldlNoYWRvd3MgPSBtYXAuc3ZnXy5zZWxlY3RBbGwoJ2cuZW0tc3RhdC1sYWJlbC1zaGFkb3cgPiAqJylcclxuICAgICAgICBwcmV2U2hhZG93cy5yZW1vdmUoKVxyXG5cclxuICAgICAgICBsZXQgc3RhdExhYmVscyA9IG1hcC5zdmdfLnNlbGVjdEFsbCgnZy5lbS1zdGF0LWxhYmVsJylcclxuICAgICAgICBsZXQgc2l6ZURhdGEgPSBtYXAuc3RhdERhdGEoJ3NpemUnKS5nZXRBcnJheSgpID8gbWFwLnN0YXREYXRhKCdzaXplJykgOiBtYXAuc3RhdERhdGEoKVxyXG5cclxuICAgICAgICBzdGF0TGFiZWxzXHJcbiAgICAgICAgICAgIC5maWx0ZXIoKGQpID0+IHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KGQucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgIGlmICghc3YgfHwgKCFzdi52YWx1ZSAmJiBzdiAhPT0gMCAmJiBzdi52YWx1ZSAhPT0gMCkpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2VcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWVcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uIChkKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBzdiA9IHNpemVEYXRhLmdldChkLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICBpZiAoIXN2IHx8ICghc3YudmFsdWUgJiYgc3YgIT09IDAgJiYgc3YudmFsdWUgIT09IDApKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICcnXHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChzdi52YWx1ZSAhPT0gJzonKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGFjZUFzVGhvdXNhbmRTZXBhcmF0b3Ioc3YudmFsdWUpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAvL2FkZCBzaGFkb3dzIHRvIGxhYmVsc1xyXG4gICAgICAgIGlmIChvdXQubGFiZWxTaGFkb3dfKSB7XHJcbiAgICAgICAgICAgIG1hcC5zdmdfXHJcbiAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdnLmVtLXN0YXQtbGFiZWwtc2hhZG93JylcclxuICAgICAgICAgICAgICAgIC5maWx0ZXIoKGQpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzdiA9IHNpemVEYXRhLmdldChkLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdiB8fCAoIXN2LnZhbHVlICYmIHN2ICE9PSAwICYmIHN2LnZhbHVlICE9PSAwKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2VcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uIChkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBzaXplRGF0YS5nZXQoZC5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghc3YgfHwgKCFzdi52YWx1ZSAmJiBzdiAhPT0gMCAmJiBzdi52YWx1ZSAhPT0gMCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICcnXHJcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN2LnZhbHVlICE9PSAnOicpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGFjZUFzVGhvdXNhbmRTZXBhcmF0b3Ioc3YudmFsdWUpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gb3V0XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBAZGVzY3JpcHRpb24gc2V0cyBjb2xvci9zdHJva2Uvb3BhY2l0eSBzdHlsZXMgb2YgYWxsIHN5bWJvbHNcclxuICAgICAqIEBwYXJhbSB7ZDMuc2VsZWN0aW9ufSBzeW1iIHN5bWJvbHMgZDMgc2VsZWN0aW9uXHJcbiAgICAgKi9cclxuICAgIGZ1bmN0aW9uIHNldFN5bWJvbFN0eWxlcyhzeW1iKSB7XHJcbiAgICAgICAgc3ltYi5zdHlsZSgnZmlsbC1vcGFjaXR5Jywgb3V0LnBzRmlsbE9wYWNpdHkoKSlcclxuICAgICAgICAgIC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cGVydGllcy5pZClcclxuICAgICAgICAgICAgbGV0IHZhbEIgPSBzaXplRGF0YS5nZXQoYi5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICBpZiAodmFsQSB8fCB2YWxBPy52YWx1ZSA9PSAwIHx8IHZhbEIgfHwgdmFsQj8udmFsdWUgPT0gMCkge1xyXG4gICAgICAgICAgICAgICAgaWYgKCh2YWxBIHx8IHZhbEE/LnZhbHVlID09IDApICYmICh2YWxCIHx8IHZhbEI/LnZhbHVlID09IDApKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9ib3RoIHZhbHVlcyBleGlzdFxyXG4gICAgICAgICAgICAgICAgICAgIC8vYmlnZ2VzdCBjaXJjbGVzIGF0IHRoZSBib3R0b21cclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmFsQi52YWx1ZSAtIHZhbEEudmFsdWVcclxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHZhbEEgfHwgdmFsQT8udmFsdWUgPT0gMCkgJiYgKCF2YWxCIHx8ICF2YWxCPy52YWx1ZSA9PSAwKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vb25seSB2YWxBIGV4aXN0c1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAtMVxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgodmFsQiB8fCB2YWxCPy52YWx1ZSA9PSAwKSAmJiAoIXZhbEEgfHwgIXZhbEE/LnZhbHVlID09IDApKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9vbmx5IHZhbEIgZXhpc3RzXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDFcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiAwXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KVxyXG5cclxuICAgICAgICBsZXQgc3ltYm9scyA9IGdjcFxyXG4gICAgICAgICAgICAuc2VsZWN0QWxsKCdnLmVtLXN5bWJvbCcpXHJcbiAgICAgICAgICAgIC5kYXRhKFxyXG4gICAgICAgICAgICAgICAgLy8gRklMVEVSSU5HIEJSRUFLUyBJTUFHRSAtXHJcbiAgICAgICAgICAgICAgICAvLyBpdCByZW1vdmVzIHJlZ2lvbnMgbm90IHByZXNlbnQgaW4gY3VycmVudCBkYXRhLCBidXQgaWYgeW91IHVwZGF0ZSB0aGUgZGF0YSBhbmQgYWRkIGRhdGEgZm9yIHRob3NlIHJlZ2lvbnMgdGhlbiB0aGV5IGFyZSBub3QgZHJhd24hISlcclxuICAgICAgICAgICAgICAgIC8vIGZpbHRlciBvdXQgcmVnaW9ucyB3aXRoIG5vIGRhdGFcclxuICAgICAgICAgICAgICAgIC8vIC5maWx0ZXIoKHJnKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAvLyAgICAgY29uc3Qgc3YgPSBzaXplRGF0YS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgIC8vICAgICAvLyBoYXMgc2l6ZSBkYXRhXHJcbiAgICAgICAgICAgICAgICAvLyAgICAgaWYgKHN2ICYmIHN2LnZhbHVlICE9PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgIHJldHVybiByZ1xyXG4gICAgICAgICAgICAgICAgLy8gICAgIH1cclxuICAgICAgICAgICAgICAgIC8vIH0pXHJcbiAgICAgICAgICAgICAgICAvLyBzb3J0IGJ5IHNpemVcclxuICAgICAgICAgICAgICAgIHNvcnRlZEJ5U2l6ZVxyXG4gICAgICAgICAgICApXHJcbiAgICAgICAgICAgIC8vIC5lbnRlcigpXHJcbiAgICAgICAgICAgIC5qb2luKCdnJylcclxuICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uIChkKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgbWFwLl9wcm9qZWN0aW9uKGQuZ2VvbWV0cnkuY29vcmRpbmF0ZXMpICsgJyknXHJcbiAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgIC8vIHVwZGF0ZSBjb2xvcnNcclxuICAgICAgICBzZXRTeW1ib2xTdHlsZXMoc3ltYm9scylcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEBkZXNjcmlwdGlvbiBBcHBlbmRzIDxjaXJjbGU+IGVsZW1lbnRzIGZvciBlYWNoIHJlZ2lvbiBpbiB0aGUgbWFwIFNWR1xyXG4gICAgICogQHBhcmFtIHsqfSBtYXAgbWFwIGluc3RhbmNlXHJcbiAgICAgKiBAcGFyYW0geyp9IHNpemVEYXRhIHN0YXRpc3RpY2FsIGRhdGEgZm9yIHNpemUgZS5nLiBtYXAuc3RhdERhdGEoJ3NpemUnKVxyXG4gICAgICogQHJldHVybiB7dm9pZH1cclxuICAgICAqL1xyXG4gICAgZnVuY3Rpb24gYXBwZW5kQ2lyY2xlc1RvTWFwKG1hcCwgc2l6ZURhdGEpIHtcclxuICAgICAgICBsZXQgc3ltYm9sQ29udGFpbmVycyA9IG1hcC5zdmcoKS5zZWxlY3RBbGwoJ2cuZW0tc3ltYm9sJylcclxuXHJcbiAgICAgICAgcmV0dXJuIChcclxuICAgICAgICAgICAgc3ltYm9sQ29udGFpbmVyc1xyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnY2lyY2xlJylcclxuICAgICAgICAgICAgICAgIC8vIC5maWx0ZXIoKHJnKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAvLyAgICAgY29uc3Qgc3YgPSBzaXplRGF0YS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgIC8vICAgICBpZiAoc3YgJiYgc3YudmFsdWUgIT09ICc6JykgcmV0dXJuIHJnXHJcbiAgICAgICAgICAgICAgICAvLyB9KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3InLCAocmcpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoc2l6ZURhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXR1bSA9IHNpemVEYXRhLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGF0dW0udmFsdWUgPT0gMCkgcmV0dXJuIDBcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJhZGl1cyA9IG91dC5jbGFzc2lmaWVyU2l6ZV8oZGF0dW0udmFsdWUpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByYWRpdXM/LnRvRml4ZWQoMykgfHwgMFxyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICApXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBAZGVzY3JpcHRpb24gQXBwZW5kcyA8cGF0aD4gZWxlbWVudHMgY29udGFpbmluZyBzeW1ib2xzIGZvciBlYWNoIHJlZ2lvbiBpbiB0aGUgbWFwIFNWR1xyXG4gICAgICogQHBhcmFtIHsqfSBtYXAgbWFwIGluc3RhbmNlXHJcbiAgICAgKiBAcGFyYW0geyp9IHNpemVEYXRhIGUuZy4gbWFwLnN0YXREYXRhKCdzaXplJylcclxuICAgICAqIEByZXR1cm4geyp9XHJcbiAgICAgKi9cclxuICAgIGZ1bmN0aW9uIGFwcGVuZEQzU3ltYm9sc1RvTWFwKG1hcCwgc2l6ZURhdGEpIHtcclxuICAgICAgICByZXR1cm4gbWFwXHJcbiAgICAgICAgICAgIC5zdmcoKVxyXG4gICAgICAgICAgICAuc2VsZWN0QWxsKCdnLmVtLXN5bWJvbCcpXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAuZmlsdGVyKChyZykgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBzaXplRGF0YS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgIGlmIChzdiAmJiBzdi52YWx1ZSAhPT0gJzonKSByZXR1cm4gcmdcclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ3BzJylcclxuICAgICAgICAgICAgLmF0dHIoJ2QnLCAocmcpID0+IHtcclxuICAgICAgICAgICAgICAgIC8vY2FsY3VsYXRlIHNpemVcclxuICAgICAgICAgICAgICAgIGlmICghc2l6ZURhdGEpIHJldHVyblxyXG4gICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBzaXplRGF0YS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgIGlmIChzdiAhPSAwICYmICFzdikgcmV0dXJuXHJcbiAgICAgICAgICAgICAgICBsZXQgc2l6ZSA9IG91dC5jbGFzc2lmaWVyU2l6ZV8oK3N2LnZhbHVlKSB8fCAwXHJcblxyXG4gICAgICAgICAgICAgICAgLy9hcHBseSBzaXplIHRvIHNoYXBlXHJcbiAgICAgICAgICAgICAgICBpZiAob3V0LnBzQ3VzdG9tU2hhcGVfKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG91dC5wc0N1c3RvbVNoYXBlXy5zaXplKHNpemUgKiBzaXplKSgpXHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHN5bWJvbFR5cGUgPSBzeW1ib2xzTGlicmFyeVtvdXQucHNTaGFwZV9dIHx8IHN5bWJvbHNMaWJyYXJ5WydjaXJjbGUnXVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2woKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAudHlwZShzeW1ib2xUeXBlKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2l6ZShzaXplICogc2l6ZSkoKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogQGRlc2NyaXB0aW9uIEFwcGVuZHMgPHJlY3Q+IGVsZW1lbnRzIGNvbnRhaW5pbmcgYmFycyBmb3IgZWFjaCByZWdpb24gaW4gdGhlIG1hcCBTVkdcclxuICAgICAqIEBwYXJhbSB7Kn0gbWFwIG1hcCBpbnN0YW5jZVxyXG4gICAgICogQHBhcmFtIHsqfSBzaXplRGF0YSBlLmcuIG1hcC5zdGF0RGF0YSgnc2l6ZScpXHJcbiAgICAgKiBAcmV0dXJuIHsqfVxyXG4gICAgICovXHJcbiAgICBmdW5jdGlvbiBhcHBlbmRCYXJzVG9NYXAobWFwLCBzaXplRGF0YSkge1xyXG4gICAgICAgIHJldHVybiAoXHJcbiAgICAgICAgICAgIG1hcFxyXG4gICAgICAgICAgICAgICAgLnN2ZygpXHJcbiAgICAgICAgICAgICAgICAuc2VsZWN0KCcjZ19wcycpXHJcbiAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdnLmVtLXN5bWJvbCcpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgIC5maWx0ZXIoKHJnKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBzaXplRGF0YS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgICAgICBpZiAoc3YgJiYgc3YudmFsdWUgIT09ICc6JykgcmV0dXJuIHJnXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgb3V0LnBzQmFyV2lkdGhfKVxyXG4gICAgICAgICAgICAgICAgLy9mb3IgdmVydGljYWwgYmFycyB3ZSBzY2FsZSB0aGUgaGVpZ2h0IGF0dHJpYnV0ZSB1c2luZyB0aGUgY2xhc3NpZmllclxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGZ1bmN0aW9uIChyZykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdiB8fCAhc3YudmFsdWUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDBcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHYgPSBvdXQuY2xhc3NpZmllclNpemVfKCtzdi52YWx1ZSlcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGJSZWN0ID0gdGhpcy5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgdHJhbnNsYXRlKCR7LXRoaXMuZ2V0QXR0cmlidXRlKCd3aWR0aCcpIC8gMn1gICsgYCwgLSR7dGhpcy5nZXRBdHRyaWJ1dGUoJ2hlaWdodCcpfSlgXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAvLyB0byB1c2UgdHJhbnNpdGlvbnMgd2UgbmVlZCB0byByZWZhY3RvciB0aGUgZHJhd2luZyBmdW5jdGlvbnMgdG8gcHJvbWlzZXMgZS5nLiBhcHBlbmRCYXJzVG9NYXAoKS50aGVuKCgpPT57fSlcclxuICAgICAgICAgICAgLy90aGlzIGlzIGJlY2F1c2UgLmF0dHIoJ2ZpbGxfX18nLCBmdW5jdGlvbiAoKSB7c2VsZWN0KHRoaXMpLnN0eWxlKCdmaWxsJyl9KSBkb2VzbnQgd29yayB1bmxlc3MgeW91IGV4ZWN1dGUgaXQgYWZ0ZXIgdGhlIHRyYW5zaXRpb24gZW5kcy5cclxuICAgICAgICAgICAgLy8gZS5nLlxyXG4gICAgICAgICAgICAvLyAudHJhbnNpdGlvbigpXHJcbiAgICAgICAgICAgIC8vIC5kdXJhdGlvbihvdXQudHJhbnNpdGlvbkR1cmF0aW9uKCkpXHJcbiAgICAgICAgICAgIC8vIC5zdHlsZSgnZmlsbCcsIGZ1bmN0aW9uIChyZykge30pXHJcbiAgICAgICAgICAgIC8vIC5lbmQoKVxyXG4gICAgICAgICAgICAvLyAudGhlbigpXHJcbiAgICAgICAgKVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogQGRlc2NyaXB0aW9uIEFwcGVuZHMgY3VzdG9tIFNWRyBzeW1ib2xzIGZvciBlYWNoIHJlZ2lvbiBpbiB0aGUgbWFwXHJcbiAgICAgKiBAcGFyYW0geyp9IG1hcFxyXG4gICAgICogQHBhcmFtIHsqfSBzaXplRGF0YVxyXG4gICAgICogQHJldHVybiB7Kn1cclxuICAgICAqL1xyXG4gICAgZnVuY3Rpb24gYXBwZW5kQ3VzdG9tU3ltYm9sc1RvTWFwKG1hcCwgc2l6ZURhdGEpIHtcclxuICAgICAgICByZXR1cm4gbWFwXHJcbiAgICAgICAgICAgIC5zdmcoKVxyXG4gICAgICAgICAgICAuc2VsZWN0KCcjZ19wcycpXHJcbiAgICAgICAgICAgIC5zZWxlY3RBbGwoJ2cuZW0tc3ltYm9sJylcclxuICAgICAgICAgICAgLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgIC5maWx0ZXIoKHJnKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBzdiA9IHNpemVEYXRhLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgaWYgKHN2ICYmIHN2LnZhbHVlICE9PSAnOicpIHJldHVybiByZ1xyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAncHMnKVxyXG4gICAgICAgICAgICAuaHRtbChvdXQucHNDdXN0b21TVkdfKVxyXG4gICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgKHJnKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAvL2NhbGN1bGF0ZSBzaXplXHJcbiAgICAgICAgICAgICAgICBjb25zdCBzdiA9IHNpemVEYXRhLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgbGV0IHNpemUgPSBvdXQuY2xhc3NpZmllclNpemVfKCtzdi52YWx1ZSlcclxuICAgICAgICAgICAgICAgIGlmIChzaXplKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGB0cmFuc2xhdGUoJHtvdXQucHNPZmZzZXRfLnggKiBzaXplfSwke291dC5wc09mZnNldF8ueSAqIHNpemV9KSBzY2FsZSgke3NpemV9KWBcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSlcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEBkZXNjcmlwdGlvbiBhZGRzIHByb3BvcnRpb25hbCBzeW1ib2xzIHRvIGVhY2ggcmVnaW9ucyBpbiBhIG1hcCB3aXRoIG1peGVkIE5VVFMgbGV2ZWxzIChJTUFHRSlcclxuICAgICAqIEBwYXJhbSB7Kn0gbWFwXHJcbiAgICAgKiBAcGFyYW0geyp9IHNpemVEYXRhXHJcbiAgICAgKiBAcGFyYW0geyp9IHJlZ2lvbnNcclxuICAgICAqIEByZXR1cm4geyp9XHJcbiAgICAgKi9cclxuICAgIGZ1bmN0aW9uIGFkZFN5bWJvbHNUb01peGVkTlVUUyhtYXAsIHNpemVEYXRhLCByZWdpb25zKSB7XHJcbiAgICAgICAgLy8gVG9nZ2xlIHN5bWJvbCB2aXNpYmlsaXR5IC0gb25seSBzaG93IHJlZ2lvbnMgd2l0aCBzaXplRGF0YSBzdGF0IHZhbHVlcyB3aGVuIG1peGluZyBkaWZmZXJlbnQgTlVUUyBsZXZlbHNcclxuICAgICAgICBsZXQgc3ltYiA9IG1hcFxyXG4gICAgICAgICAgICAuc3ZnKClcclxuICAgICAgICAgICAgLnNlbGVjdEFsbCgnZy5lbS1zeW1ib2wnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ2Rpc3BsYXknLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICBpZiAoIXN2IHx8ICghc3YudmFsdWUgJiYgc3YgIT09IDAgJiYgc3YudmFsdWUgIT09IDApKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gbm8gc3ltYm9sIGZvciBubyBpbnB1dFxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnbm9uZSdcclxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWFwLmdlb18gPT0gJ1dPUkxEJykge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnYmxvY2snXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgIC8vIHRvZ2dsZSBkaXNwbGF5IG9mIG1peGVkIE5VVFMgbGV2ZWxzXHJcbiAgICAgICAgcmVnaW9ucy5zdHlsZSgnZGlzcGxheScsIGZ1bmN0aW9uIChyZykge1xyXG4gICAgICAgICAgICBjb25zdCBzdiA9IHNpemVEYXRhLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICBpZiAoIXN2IHx8ICghc3YudmFsdWUgJiYgc3YgIT09IDAgJiYgc3YudmFsdWUgIT09IDApKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBubyBzeW1ib2wgZm9yIG5vIGRhdGFcclxuICAgICAgICAgICAgICAgIHJldHVybiAnbm9uZSdcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChtYXAuZ2VvXyA9PSAnV09STEQnKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2Jsb2NrJ1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSlcclxuXHJcbiAgICAgICAgLy8gbnV0cyBib3JkZXIgc3Ryb2tlXHJcbiAgICAgICAgcmVnaW9uc1xyXG4gICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsIGZ1bmN0aW9uIChyZykge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qgc2VsID0gc2VsZWN0KHRoaXMpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBsdmwgPSBzZWwuYXR0cignbHZsJylcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN0cm9rZSA9IHNlbC5zdHlsZSgnc3Ryb2tlJylcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICBpZiAoIXN2IHx8ICFzdi52YWx1ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAobHZsICE9PSAnMCcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0cm9rZSB8fCAnIzc3NydcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAvLyBudXRzIGJvcmRlciBzdHJva2Ugd2lkdGhcclxuICAgICAgICAgICAgLnN0eWxlKCdzdHJva2Utd2lkdGgnLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgbHZsID0gc2VsLmF0dHIoJ2x2bCcpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBzdHJva2VXaWR0aCA9IHNlbC5zdHlsZSgnc3Ryb2tlLXdpZHRoJylcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICBpZiAoIXN2IHx8ICFzdi52YWx1ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvdXQuZ2VvXyA9PSAnV09STEQnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGx2bCAhPT0gJzAnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHJva2VXaWR0aCB8fCAnIzc3NydcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgIHJldHVybiBzeW1iXHJcbiAgICB9XHJcblxyXG4gICAgLy9Ab3ZlcnJpZGVcclxuICAgIG91dC51cGRhdGVTdHlsZSA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAvLyBhcHBseSB0byBtYWluIG1hcFxyXG4gICAgICAgIGFwcGx5U3R5bGVUb01hcChvdXQpXHJcblxyXG4gICAgICAgIC8vIGFwcGx5IHN0eWxlIHRvIGluc2V0c1xyXG4gICAgICAgIC8vIGFwcGx5IGNsYXNzaWZpY2F0aW9uIHRvIGFsbCBpbnNldHNcclxuICAgICAgICBpZiAob3V0Lmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGdlbyBpbiBvdXQuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb10pKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb10ubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5zZXRzIHdpdGggc2FtZSBnZW8gdGhhdCBkbyBub3Qgc2hhcmUgdGhlIHNhbWUgcGFyZW50IGluc2V0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgaXMgdGhlIGNhc2Ugd2hlbiB0aGVyZSBhcmUgbW9yZSB0aGFuIDIgZGlmZmVyZW50IGluc2V0cyB3aXRoIHRoZSBzYW1lIGdlby4gRS5nLiAzIGluc2V0cyBmb3IgUFQyMFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgYyA9IDA7IGMgPCBvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0ubGVuZ3RoOyBjKyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dW2ldW2NdLnN2Z0lkXyAhPT0gb3V0LnN2Z0lkXykgYXBwbHlTdHlsZVRvTWFwKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXVtjXSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0uc3ZnSWRfICE9PSBvdXQuc3ZnSWRfKSBhcHBseVN0eWxlVG9NYXAob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dW2ldKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyB1bml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9zdGF0IDEgdmFsdWVcclxuICAgIGNvbnN0IHYxID0gbWFwLnN0YXREYXRhKCdzaXplJykuZ2V0QXJyYXkoKSA/IG1hcC5zdGF0RGF0YSgnc2l6ZScpIDogbWFwLnN0YXREYXRhKClcclxuICAgIGNvbnN0IHN2MSA9IHYxLmdldChyZWdpb24ucHJvcGVydGllcy5pZClcclxuICAgIGlmICghc3YxIHx8IChzdjEudmFsdWUgIT0gMCAmJiAhc3YxLnZhbHVlKSkgYnVmLnB1c2gobWFwLm5vRGF0YVRleHRfKVxyXG4gICAgZWxzZSB7XHJcbiAgICAgICAgLy91bml0IDFcclxuICAgICAgICBjb25zdCB1bml0MSA9IHYxLnVuaXRUZXh0KClcclxuICAgICAgICBidWYucHVzaChgPGRpdiBjbGFzcz1cImVzdGF0LXZpcy10b29sdGlwLXRleHRcIj4ke3NwYWNlQXNUaG91c2FuZFNlcGFyYXRvcihzdjEudmFsdWUpfSAke3VuaXQxID8gdW5pdDEgOiAnICd9PC9kaXY+YClcclxuICAgIH1cclxuXHJcbiAgICAvL3N0YXQgMiB2YWx1ZVxyXG4gICAgaWYgKG1hcC5zdGF0RGF0YSgnY29sb3InKS5nZXRBcnJheSgpKSB7XHJcbiAgICAgICAgY29uc3Qgc3YyID0gbWFwLnN0YXREYXRhKCdjb2xvcicpLmdldChyZWdpb24ucHJvcGVydGllcy5pZClcclxuICAgICAgICBpZiAoIXN2MiB8fCAoc3YyLnZhbHVlICE9IDAgJiYgIXN2Mi52YWx1ZSkpIGJ1Zi5wdXNoKG1hcC5ub0RhdGFUZXh0XylcclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgLy9zdGF0IDJcclxuICAgICAgICAgICAgY29uc3QgdW5pdDIgPSBtYXAuc3RhdERhdGEoJ2NvbG9yJykudW5pdFRleHQoKVxyXG4gICAgICAgICAgICBidWYucHVzaChgPGRpdiBjbGFzcz1cImVzdGF0LXZpcy10b29sdGlwLXRleHRcIj4ke3NwYWNlQXNUaG91c2F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gICAgICAgICAgLy8gUmV0cmlldmUgY29kZSBhbmQgc3RhdCB2YWx1ZVxyXG4gICAgICAgICAgICBjb25zdCBkYXRlID0gb3V0Ll9zdGF0RGF0ZXNbaV1cclxuICAgICAgICAgICAgY29uc3QgcyA9IG91dC5zdGF0RGF0YShkYXRlKS5nZXQoaWQpXHJcblxyXG4gICAgICAgICAgICAvLyBDYXNlIHdoZW4gc29tZSBkYXRhIGlzIG1pc3NpbmdcclxuICAgICAgICAgICAgaWYgKCFzIHx8IChzLnZhbHVlICE9IDAgJiYgIXMudmFsdWUpIHx8IGlzTmFOKHMudmFsdWUpKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAob3V0LnNob3dPbmx5V2hlbkNvbXBsZXRlKCkpIHJldHVybiB1bmRlZmluZWRcclxuICAgICAgICAgICAgICAgIGVsc2UgY29udGludWVcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgY29tcC5wdXNoKHsgZGF0ZTogZGF0ZSwgdmFsdWU6IHMudmFsdWUgfSlcclxuICAgICAgICAgICAgc3VtICs9IHMudmFsdWVcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIENhc2Ugd2hlbiBubyBkYXRhXHJcbiAgICAgICAgaWYgKHN1bSA9PSAwKSByZXR1cm4gdW5kZWZpbmVkXHJcblxyXG4gICAgICAgIC8vIENhbGN1bGF0ZSB5ZWFyLW9uLXllYXIgcGVyY2VudGFnZSBjaGFuZ2VcclxuICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IGNvbXAubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgY29uc3QgcHJldmlvdXNWYWx1ZSA9IGNvbXBbaSAtIDFdLnZhbHVlXHJcbiAgICAgICAgICAgIGNvbnN0IGN1cnJlbnRWYWx1ZSA9IGNvbXBbaV0udmFsdWVcclxuXHJcbiAgICAgICAgICAgIC8vIENhbGN1bGF0ZSBwZXJjZW50YWdlIGNoYW5nZSBmcm9tIHByZXZpb3VzIHZh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5tb3VzZW92ZXIob3V0LnRvb2x0aXBfLnRleHRGdW5jdGlvbihyZywgb3V0KSlcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgLm9uKCdtb3VzZW1vdmUnLCBmdW5jdGlvbiAoZSwgcmcpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGRhdGEgPSBnZXRDb21wb3NpdGlvbihyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgaWYgKGRhdGEpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2Vtb3ZlKGUpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgIGxldCBjdXJyZW50RmlsbCA9IHNlbC5zdHlsZSgnZmlsbCcpXHJcbiAgICAgICAgICAgICAgICBsZXQgbmV3RmlsbCA9IHNlbC5hdHRyKCdmaWxsX19fJylcclxuICAgICAgICAgICAgICAgIGlmIChuZXdGaWxsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2VsLnN0eWxlKCdmaWxsJywgc2VsLmF0dHIoJ2ZpbGxfX18nKSlcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2VvdXQoKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICBhZGRTcGFya0xpbmVzVG9NYXAobnV0c0lkcylcclxuICAgICAgICByZXR1cm4gb3V0XHJcbiAgICB9XHJcblxyXG4gICAgZnVuY3Rpb24gYWRkU3BhcmtMaW5lc1RvTWFwKGlkcykge1xyXG4gICAgICAg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zb2xlLmxvZygnbm8gZGF0YScpXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vIFByZWNvbXB1dGUgc2NhbGVkIFkgZGF0YVxyXG4gICAgICAgICAgICBzY2FsZWREYXRhID0gZGF0YS5tYXAoKGQpID0+IHtcclxuICAgICAgICAgICAgICAgIGQuc2NhbGVkWVZhbHVlID1cclxuICAgICAgICAgICAgICAgICAgICBkLnBlcmNlbnRhZ2VDaGFuZ2UgPCAwXHJcbiAgICAgICAgICAgICAgICAgICAgICAgID8gc2NhbGVMb2dOZWdhdGl2ZShzYW5pdGl6ZUxvZ1ZhbHVlKGQucGVyY2VudGFnZUNoYW5nZSkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDogc2NhbGVMb2dQb3NpdGl2ZShzYW5pdGl6ZUxvZ1ZhbHVlKGQucGVyY2VudGFnZUNoYW5nZSkpXHJcblxyXG4gICAgICAgICAgICAgICAgZC5zY2FsZWRYVmFsdWUgPSB4U2NhbGUoZC5kYXRlKVxyXG5cclxuICAgICAgICAgICAgICAgIGlmIChpc05hTihkLnNjYWxlZFlWYWx1ZSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKCdOYU4gZGV0ZWN0ZWQgaW4gc2NhbGVkVmFsdWU6JywgZClcclxuICAgICAgICAgICAgICAgICAgICBkLnNjYWxlZFlWYWx1ZSA9IDAuMDFcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHJldHVybiBkXHJcbiAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAvLyBEcmF3IHRoZSBheGlzXHJcbiAgICAgICAgICAgIGlmIChpc0ZvclRvb2x0aXApIHtcclxuICAgICAgICAgICAgICAgIC8vIEFkZCB0aGUgWCBBeGlzXHJcbiAgICAgICAgICAgICAgICBub2RlLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2F4aXMnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArIGhlaWdodCArICcpJylcclxuICAgICAgICAgICAgICAgICAgICAuY2FsbChheGlzQm90dG9tKHhTY2FsZSkudGlja3Mob3V0Ll9zdGF0RGF0ZXMubGVuZ3RoKS50aWNrRm9ybWF0KGZvcm1hdCgnLjBmJykpKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgndGV4dC1hbmNob3InLCAnZW5kJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignZHgnLCAnLS44ZW0nKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdkeScsICcuMTVlbScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICdyb3RhdGUoLTY1KScpXHJcblxyXG4gICAgICAgICAgICAgICAgLy8gQWRkIHRoZSBZIEF4aXMgZm9yIHBvc2l0aXZlIHZhbHVlc1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcG9zaXRpdmVUaWNrVmFsdWVzWSA9IFsxXVxyXG4gICAgICAgICAgICAgICAgY29uc3QgbmVnYXRpdmVUaWNrVmFsdWVzWSA9IFstMC41XVxyXG4gICAgICAgICAgICAgICAgbm9kZS5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICd5LWF4aXMtbmVnYXRpdmUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBgdHJhbnNsYXRlKC0xMCwgJHswfSlgKSAvLyBQb3NpdGlvbiBmb3IgbmVnYXRpdmUgYXhpc1xyXG4gICAgICAgICAgICAgICAgICAgIC5jYWxsKGF4aXNMZWZ0KHNjYWxlTG9nTmVnYXRpdmUpLnRpY2tWYWx1ZXMobmVnYXRpdmVUaWNrVmFsdWVzWSkudGlja0Zvcm1hdChmb3JtYXQoJywuMnInKSkpXHJcblxyXG4gICAgICAgICAgICAgICAgbm9kZS5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICd5LWF4aXMtcG9zaXRpdmUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBgdHJhbnNsYXRlKCR7LTEwfSwgMClgKVxyXG4gICAgICAgICAgICAgICAgICAgIC5jYWxsKGF4aXNMZWZ0KHNjYWxlTG9nUG9zaXRpdmUpLnRpY2tWYWx1ZXMocG9zaXRpdmVUaWNrVmFsdWVzWSkudGlja0Zvcm1hdChmb3JtYXQoJywuMnInKSkpXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gTWFudWFsbHkgYWRkIGEgY3VzdG9tIGxhYmVsIGZvciAwXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ3RpY2snKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBgdHJhbnNsYXRlKDAsICR7aGVpZ2h0IC8gMn0pYClcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignZmlsbCcsICdjdXJyZW50Q29sb3InKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgLTEyKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgndGV4dC1hbmNob3InLCAnbWlkZGxlJylcclxuICAgICAgICAgICAgICAgICAgICAudGV4dCgnMCcpIC8vIEN1c3RvbSBsYWJlbCBmb3Igc21hbGwgdmFsdWUgKDAuMTApXHJcblxyXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2cocG9zaXRpdmVUaWNrVmFsdWVzWSwgbmVnYXRpdmVUaWNrVmFsdWVzWSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIC8vIFJhdyBjb3VudHMgKGxpbmVhciBzY2FsZSBmb3IgYm90aCBwb3NpdGl2ZSBhbmQgbmVnYXRpdmUpXHJcblxyXG4gICAgICAgICAgICBjb25zdCB5U2NhbGUgPSBzY2FsZUxpbmVhcigpXHJcbiAgICAgICAgICAgICAgICAuZG9tYWluKGV4dClcclxuICAgICAgICAgICAgICAgIC5yYW5nZShbaGVpZ2h0IC0gMC41LCAwXSlcclxuXHJcbiAgICAgICAgICAgIHNjYWxlZERhdGEgPSBkYXRhLm1hcCgoZCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgZC5zY2FsZWRYVmFsdWUgPSB4U2NhbGUoZC5kYXRlKVxyXG4gICAgICAgICAgICAgICAgZC5zY2FsZWRZVmFsdWUgPSB5U2NhbGUoZC52YWx1ZSlcclxuICAgICAgICAgICAgICAgIHJldHVybiBkXHJcbiAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAvL0RyYXcgYXhpc1xyXG4gICAgICAgICAgICBpZiAoaXNGb3JUb29sdGlwKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBBZGQgdGhlIFggQXhpc1xyXG4gICAgICAgICAgICAgICAgbm9kZS5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdheGlzJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyBoZWlnaHQgKyAnKScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmNhbGwoYXhpc0JvdHRvbSh4U2NhbGUpLnRpY2tzKG91dC5fc3RhdERhdGVzLmxlbmd0aCkudGlja0Zvcm1hdChmb3JtYXQoJy4wZicpKSlcclxuICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCd0ZXh0JylcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ3RleHQtYW5jaG9yJywgJ2VuZCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2R4JywgJy0uOGVtJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignZHknLCAnLjE1ZW0nKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAncm90YXRlKC02NSknKVxyXG5cclxuICAgICAgICAgICAgICAgIC8vIEFkZCB0aGUgWSBBeGlzXHJcbiAgICAgICAgICAgICAgICBsZXQgZG9tYWluWSA9IHlTY2FsZS5kb21haW4oKVxyXG4gICAgICAgICAgICAgICAgbGV0IHRpY2tWYWx1ZXMgPSBbZG9tYWluWVswXSwgKChkb21haW5ZWzBdICsgZG9tYWluWVsxXSkgLyAyKS50b0ZpeGVkKDEpLCBkb21haW5ZWzFdXVxyXG4gICAgICAgICAgICAgICAgbm9kZS5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdheGlzJylcclxuICAgICAgICAgICAgICAgICAgICAuY2FsbChheGlzTGVmdCh5U2NhbGUpLnRpY2tWYWx1ZXModGlja1ZhbHVlcykudGlja0Zvcm1hdChmb3JtYXQoJywuMnInKSkpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGNvbnN0IGxpbmVHZW5lcmF0b3IgPSBsaW5lKClcclxuICAgICAgICAgICAgLngoKGQsIGkpID0+IGQuc2NhbGVkWFZhbHVlKVxyXG4gICAgICAgICAgICAueSgoZCkgPT4gZC5zY2FsZWRZVmFsdWUpXHJcblxyXG4gICAgICAgIC8vIERyYXcgdGhlIGFyZWEgKGZvciBhcmVhIGNoYXJ0KVxyXG4gICAgICAgIGlmIChvdXQuc3BhcmtUeXBlXyA9PT0gJ2FyZWEnKSB7XHJcbiAgICAgICAgICAgIG5vZGUuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5kYXR1bShkYXRhKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2ZpbGwnLCB0eXBlb2Ygb3V0LnNwYXJrQXJlYUNvbG9yXyA9PT0gJ2Z1bmN0aW9uJyA/IChkLCBpKSA9PiBvdXQuc3BhcmtBcmVhQ29sb3JfKGQsIGkpIDogb3V0LnNwYXJrQXJlYUNvbG9yXylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdzdHJva2UnLCB0eXBlb2Ygb3V0LnNwYXJrTGluZUNvbG9yXyA9PT0gJ2Z1bmN0aW9uJyA/IChkLCBpKSA9PiBvdXQuc3BhcmtMaW5lQ29sb3JfKGQsIGkpIDogb3V0LnNwYXJrTGluZUNvbG9yXylcclxuICAgICAgICAgICAgICAgIC5hdHRyKFxyXG4gICAgICAgICAgICAgICAgICAgICdzdHJva2Utd2lkdGgnLFxyXG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiBvdXQuc3BhcmtMaW5lU3Ryb2tlV2lkdGhfID09PSAnZnVuY3Rpb24nID8gKGQsIGkpID0+IG91dC5zcGFya0xpbmVTdHJva2VXaWR0aF8oZCwgaSkgOiBvdXQuc3BhcmtMaW5lU3Ryb2tlV2lkdGhfICsgJ3B4J1xyXG4gICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ29wYWNpdHknLCBvdXQuc3BhcmtMaW5lT3BhY2l0eV8pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZmlsbC1vcGFjaXR5JywgMC4zKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZScsICdub25lJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKFxyXG4gICAgICAgICAgICAgICAgICAgICdkJyxcclxuICAgICAgICAgICAgICAgICAgICBhcmVhKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgLngoKGQsIGkpID0+IGQuc2NhbGVkWFZhbHVlKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAue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JldHVybnMgW21pbixtYXhdXHJcbiAgICAgKi9cclxuICAgIGZ1bmN0aW9uIGdldERhdGFzZXRNYXhNaW4oKSB7XHJcbiAgICAgICAgbGV0IG1heHMgPSBbXVxyXG4gICAgICAgIGxldCBzZWwgPSBvdXQuc3ZnKCkuc2VsZWN0QWxsKCcjZ19wcycpLnNlbGVjdEFsbCgnZy5lbS1zeW1ib2wnKS5kYXRhKClcclxuXHJcbiAgICAgICAgc2VsLmZvckVhY2goKHJnKSA9PiB7XHJcbiAgICAgICAgICAgIGxldCBpZCA9IHJnLnByb3BlcnRpZXMuaWRcclxuICAgICAgICAgICAgbGV0IG1heCA9IGdldFJlZ2lvbk1heChpZClcclxuICAgICAgICAgICAgaWYgKG1heCkge1xyXG4gICAgICAgICAgICAgICAgbWF4cy5wdXNoKG1heClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pXHJcblxyXG4gICAgICAgIGxldCBtaW5tYXggPSBleHRlbnQobWF4cylcclxuICAgICAgICByZXR1cm4gbWlubWF4XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBHZXQgYWJzb2x1dGUgdG90YWwgdmFsdWUgb2YgY29tYmluZWQgc3RhdGlzdGljYWwgdmFsdWVzIGZvciBhIHNwZWNpZmljIHJlZ2lvbi4gRS5nIHRvdGFsIGxpdmVzdG9ja1xyXG4gICAgICogQHBhcmFtIHsqfSBpZCBudXRzIHJlZ2lvbiBpZFxyXG4gICAgICovXHJcbiAgICBjb25zdCBnZXRSZWdpb25NYXggPSBmdW5jdGlvbiAoaWQpIHtcclxuICAgICAgICBsZXQgbWF4ID0gMFxyXG4gICAgICAgIGxldCBzXHJcblxyXG4gICAgICAgIC8vZ2V0IHN0YXQgdmFsdWUgZm9yIGVhY2ggZGF0ZSBhbmQgZmluZCB0aGUgbWF4XHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvdXQuX3N0YXREYXRlcy5sZW5ndGg7IGkrKykge1xyXG4gIC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AgICAqL1xyXG4gICAgb3V0LnN0YXRDb21wID0gZnVuY3Rpb24gKHN0YXQsIGRpbSwgY29kZXMsIGxhYmVscywgY29sb3JzKSB7XHJcbiAgICAgICAgLy9hZGQgb25lIGRhdGFzZXQgY29uZmlnIGZvciBlYWNoIGNhdGVnb3J5XHJcbiAgICAgICAgc3RhdC5maWx0ZXJzID0gc3RhdC5maWx0ZXJzIHx8IHt9XHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb2Rlcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAvL2NhdGVnb3J5IGNvZGVcclxuICAgICAgICAgICAgY29uc3QgY29kZSA9IGNvZGVzW2ldXHJcbiAgICAgICAgICAgIHN0YXQuZmlsdGVyc1tkaW1dID0gY29kZVxyXG4gICAgICAgICAgICBjb25zdCBzY18gPSB7fVxyXG4gICAgICAgICAgICBmb3IgKGxldCBrZXkgaW4gc3RhdCkgc2NfW2tleV0gPSBzdGF0W2tleV1cclxuICAgICAgICAgICAgc2NfLmZpbHRlcnMgPSB7fVxyXG4gICAgICAgICAgICBmb3IgKGxldCBrZXkgaW4gc3RhdC5maWx0ZXJzKSBzY18uZmlsdGVyc1trZXldID0gc3RhdC5maWx0ZXJzW2tleV1cclxuICAgICAgICAgICAgb3V0LnN0YXQoY29kZSwgc2NfKVxyXG5cclxuICAgICAgICAgICAgLy9pZiBzcGVjaWZpZWQsIHJldHJpZXZlIGFuZCBhc3NpZ24gY29sb3JcclxuICAgICAgICAgICAgaWYgKGNvbG9ycykge1xyXG4gICAgICAgICAgICAgICAgb3V0LmNhdENvbG9yc18gPSBvdXQuY2F0Q29sb3JzXyB8fCB7fVxyXG4gICAgICAgICAgICAgICAgb3V0LmNhdENvbG9yc19bY29kZV0gPSBjb2xvcnNbaV1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvL2lmIHNwZWNpZmllZCwgcmV0cmlldmUgYW5kIGFzc2lnbiBsYWJlbFxyXG4gICAgIC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HN0YXQgdmFsdWVcclxuICAgICAgICAgICAgY29uc3Qgc2MgPSBzdGF0Q29kZXNbaV1cclxuICAgICAgICAgICAgY29uc3QgcyA9IG91dC5zdGF0RGF0YShzYykuZ2V0KGlkKVxyXG5cclxuICAgICAgICAgICAgLy9jYXNlIHdoZW4gc29tZSBkYXRhIGlzIG1pc3NpbmdcclxuICAgICAgICAgICAgaWYgKCFzIHx8IChzLnZhbHVlICE9IDAgJiYgIXMudmFsdWUpIHx8IGlzTmFOKHMudmFsdWUpKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAob3V0LnNob3dPbmx5V2hlbkNvbXBsZXRlKCkpIHJldHVybiB1bmRlZmluZWRcclxuICAgICAgICAgICAgICAgIGVsc2UgY29udGludWVcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgY29tcFtzY10gPSBzLnZhbHVlXHJcbiAgICAgICAgICAgIHN1bSArPSBzLnZhbHVlXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2Nhc2Ugd2hlbiBubyBkYXRhXHJcbiAgICAgICAgaWYgKHN1bSA9PSAwKSByZXR1cm4gdW5kZWZpbmVkXHJcblxyXG4gICAgICAgIC8vY29tcHV0ZSByYXRpb3NcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHN0YXRDb2Rlcy5sZW5ndGg7IGkrKykgY29tcFtzdGF0Q29kZXNbaV1dIC89IHN1bVxyXG5cclxuICAgICAgICByZXR1cm4gY29tcFxyXG4gICAgfVxyXG5cclxuICAgIC8vQG92ZXJyaWRlXHJcbiAgICBvdXQudXBkYXRlQ2xhc3NpZmljYXRpb24gPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgLy9pZiBub3QgcHJvdmlkZWQsIGdldCBsaXN0IG9mIHN0YXQgY29kZXMgZnJvbSB0aGUgbWFwIHN0YXQgZGF0YVxyXG4gICAgICAgIGlmICghc3RhdENvZGVzKSB7XHJcbiAgICAgICAgICAgIC8vZ2V0IGxpc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HJcbiAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIGZ1bmN0aW9uIChkKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBpZCA9IGQucHJvcGVydGllcy5pZFxyXG5cclxuICAgICAgICAgICAgICAgIC8vY29tcHV0ZSBjb21wb3NpdGlvblxyXG4gICAgICAgICAgICAgICAgY29uc3QgY29tcG9zaXRpb24gPSBnZXRDb21wb3NpdGlvbihpZClcclxuXHJcbiAgICAgICAgICAgICAgICAvL2Nhc2Ugd2hlbiBubyBvciBtaXNzaW5nIGRhdGFcclxuICAgICAgICAgICAgICAgIGlmICghY29tcG9zaXRpb24pIHJldHVybiBvdXQubm9EYXRhRmlsbFN0eWxlKCkgfHwgJ2dyYXknXHJcblxyXG4gICAgICAgICAgICAgICAgLy9tYWtlIHN0cmlwZSBwYXR0ZXJuXHJcbiAgICAgICAgICAgICAgICBjb25zdCBwYXR0ID0gb3V0XHJcbiAgICAgICAgICAgICAgICAgICAgLnN2ZygpXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgncGF0dGVybicpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ3BhdHRlcm5fJyArIGlkKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgJzAnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgJzAnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIG91dC5zdHJpcGVXaWR0aCgpKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAxKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdwYXR0ZXJuVW5pdHMnLCAndXNlclNwYWNlT25Vc2UnKVxyXG4gICAgICAgICAgICAgICAgLy91c2Ugb3JpZW50YXRpb24sIGlmIHNwZWNpZmllZFxyXG4gICAgICAgICAgICAgICAgaWYgKG91dC5zdHJpcGVPcmllbnRhdGlvbigpKSBwYXR0LmF0dHIoJ3BhdHRlcm5UcmFuc2Zvcm0nLCAncm90YXRlKCcgKyBvdXQuc3RyaXBlT3JpZW50YXRpb24oKSArICcpJylcclxuXHJcbiAgICAgICAgICAgICAgICAvL2JhY2tncm91bmRcclxuICAgICAgICAgICAgICAgIHBhdHQuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsIDApXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3knLCAwKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIG91dC5zdHJpcGVXaWR0aCgpKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAxKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgJ25vbmUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsICdsaWdodGdyYXknKVxyXG5cclxuICAgICAgICAgICAgICAgIC8vbWFrZSBzdHJpcGVzLCBvbmUgcGVyIGNhdGVnb3J5XHJcbiAgICAgICAgICAgICAgICBsZXQgeCA9IDBcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IGNvZGUgaW4gY29tcG9zaXRpb24pIHtcclxuICAgICAgICAgICAgICAgICAgICAvL2dldCBzdHJpcGUgc2l6ZVxyXG4gICAgICAgICAgICAgICAgICAgIGxldCBkeCA9IGNvbXBvc2l0aW9uW2NvZGVdXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFkeCkgY29udGludWVcclxuICAgICAgICAgICAgICAgICAgICBkeCAqPSBvdXQuc3RyaXBlV2lkdGgoKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAvL2dldCBzdHJpcGUgY29sb3JcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBjb2wgPSBvdXQuY2F0Q29sb3JzKClbY29kZV0gfHwgJ2xpZ2h0Z3JheSdcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLy9hZGQgc3RyaXBlIHRvIHBhdHRlcm46IGEgdGhpbiByZWN0YW5nbGVcclxuICAgICAgICAgICAgICAgICAgICBwYXR0LmFwcGVuZCgncmVjdCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgeClcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3knLCAwKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgMSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCAnbm9uZScpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjb2RlJywgY29kZSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgY29sKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3RyYW5zaXRpb24gYWxvbmcgeFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAudHJhbnNpdGlvbigpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5kdXJhdGlvbihvdXQudHJhbnNpdGlvbkR1cmF0aW9uKCkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIGR4KVxyXG4gICAgICAgICAgICAgICAgICAgIHggKz0gZHhcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAvL3JldHVybiBwYXR0ZXJuIHJlZmVyZW5jZVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuICd1cmwoI3BhdHRlcm5fJyArIGlkICsgJyknXHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC5hdHRyKCduZCcsIGZ1bmN0aW9uIChkKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gIWdldENvbXBvc2l0aW9uKGQucHJvcGVydGllcy5pZCkgPyAnbmQnIDogJydcclxuICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgLy8gc2V0IHJl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4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbnRGaWxsID0gc2VsLnN0eWxlKCdmaWxsJylcclxuICAgICAgICAgICAgICAgIGxldCBuZXdGaWxsID0gc2VsLmF0dHIoJ2ZpbGxfX18nKVxyXG4gICAgICAgICAgICAgICAgaWYgKG5ld0ZpbGwpIHtcclxuICAgICAgICAgICAgICAgICAgICBzZWwuc3R5bGUoJ2ZpbGwnLCBzZWwuYXR0cignZmlsbF9fXycpKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQuX3Rvb2x0aXApIG91dC5fdG9vbHRpcC5tb3VzZW91dCgpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgIHJldHVybiBvdXRcclxuICAgIH1cclxuXHJcbiAgICAvL0BvdmVycmlkZVxyXG4gICAgb3V0LmdldExlZ2VuZENvbnN0cnVjdG9yID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIHJldHVybiBTdHJpcGVDb21wb3NpdGlvbkxlZ2VuZC5sZWdlbmRcclxuICAgIH1cclxuXHJcbiAgICAvL3NwZWNpZmljIHRvb2x0aXAgdGV4dCBmdW5jdGlvblxyXG4gICAgb3V0LnRvb2x0aXBfLnRleHRGdW5jdGlvbiA9IGZ1bmN0aW9uIChyZywgbWFwKSB7XHJcbiAgICAgICAgLy9nZXQgdG9vbHRpcFxyXG4gICAgICAgIGNvbnN0IHRwID0gc2VsZWN0KCcjdG9vbHRpcF9ldXJvc3RhdCcpXHJcblxyXG4gICAgICAgIC8vY2xlYXJcclxuICAgICAgICB0cC5odG1sKCcnKVxyXG4gICAgICAgIHRwLnNlbGVjdEFsbCgnKicpLnJlbW92ZSgpXHJcblxyXG4gICAgICAgIC8vd3JpdGUgcmVnaW9uIG5hbWVcclxuICAgICAgICBpZiAocmcucHJvcGVydGllcy5pZCkge1xyXG4gICAgICAgICAgICAvL25hbWUgYW5kIGNvZGVcclxuICAgICAgICAgICAgdHAuYXBwZW5kKCdkaXYnKS5odG1sKCc8Yj4nICsgcmcucHJvcGVydGllcy5uYSArICc8L2I+ICgnICsgcmcucHJvcGVydGllcy5pZCArICcpIDxicj4nKVxyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIC8vcmVnaW9uIG5hbWVcclxuICAgICAgICAgICAgdHAuYXBwZW5kKCdkaXYnKS5odG1sKCc8Yj4nICsgcmcucHJvcGVydGllcy5uYSArICc8L2I+PGJyPicpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL3ByZXBhcmUgZGF0YSBmb3IgcGllIGNoYXJ0XHJcbiAgICAgICAgY29uc3QgZGF0YSA9IFtdXHJcbiAgICAgICAgY29uc3QgY29tcCA9IGdldENvbXBvc2l0aW9uKHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gY29tcCkgZGF0YS5wdXNoKHsgY29kZToga2V5LCB2YWx1ZTogY29tcFtrZXldIH0pXHJcblxyXG4gICAgICAgIC8vY2FzZSBvZiByZWdpb25zIHdpdGggbm8gZGF0YVxyXG4gICAgICAgIGlmICghZGF0YSB8fCBkYXRhLmxlbmd0aCA9PSAwKSB7XHJcbiAgICAgICAgICAgIHRwLmFwcGVuZCgnZGl2JykuaHRtbChvdXQubm9EYXRhVGV4dCgpKVxyXG4gICAgICAgICAgICByZXR1cm5cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vY3JlYXRlIHN2ZyBmb3IgcGllIGNoYXJ0XHJcbiAgICAgICAgY29uc3QgciA9IG91dC5waWVDaGFydFJhZGl1cygpLFxyXG4gICAgICAgICAgICBpciA9IG91dC5waWVDaGFydElubmVyUmFkaXVzKClcclxuICAgICAgICBjb25zdCBzdmcgPSB0cFxyXG4gICAgICAgICAgICAuYXBwZW5kKCdzdmcnKVxyXG4gICAgICAgICAgICAuYXR0cigndmlld0JveCcsIFstciwgLXIsIDIgKiByLCAyICogcl0pXHJcbiAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIDIgKiByKVxyXG5cclxuICAgICAgICAvL21ha2UgcGllIGNoYXJ0LiBTZWUgaHR0cHM6Ly9vYnNlcnZhYmxlaHEuY29tL0BkMy9waWUtY2hhcnRcclxuICAgICAgICBjb25zdCBwaWVfID0gcGllKClcclxuICAgICAgICAgICAgLnNvcnQobnVsbClcclxuICAgICAgICAgICAgLnZhbHVlKChkKSA9PiBkLnZhbHVlKVxyXG4gICAgICAgIHN2Zy5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAuYXR0cignc3Ryb2tlJywgJ2RhcmtncmF5JylcclxuICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5kYXRhKHBpZV8oZGF0YSkpXHJcbiAgICAgICAgICAgIC5qb2luKCdwYXRoJylcclxuICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgKGQpID0+IHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBvdXQuY2F0Q29sb3JzKClbZC5kYXRhLmNvZGVdIHx8ICdsaWdodGdyYXknXHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC5hdHRyKCdkJywgYXJjKCkuaW5uZXJSYWRpdXMoaXIpLm91dGVyUmFkaXVzKHIpKVxyXG4gICAgfVxyXG5cclxuICAgIHJldHVybiBvdXRcclxufVxyXG4iLCJpbXBvcnQgeyBzZWxlY3QgfSBmcm9tICdkMy1zZWxlY3Rpb24nXHJcblxyXG4vKipcclxuICogQHBhcmFtIHsqfSBjb25maWdcclxuICogQHJldHVybnNcclxuICovXHJcbmV4cG9ydCBjb25zdCB0b29sdGlwID0gZnVuY3Rpb24gKGNvbmZpZykge1xyXG4gICAgY29uZmlnID0gY29uZmlnIHx8IHt9XHJcbiAgICBjb25maWcuY29udGFpbmVySWQgPSBjb25maWcuY29udGFpbmVySWQgfHwgJ21hcCdcclxuICAgIGNvbmZpZy5kaXYgPSBjb25maWcuZGl2IHx8ICd0b29sdG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KHBvaW50LmN1clswXSAtIHBvaW50WzBdKSA+IGFicyhwb2ludC5jdXJbMV0gLSBwb2ludFsxXSkpXG4gICAgICAgICAgbG9ja1kgPSB0cnVlO1xuICAgICAgICBlbHNlXG4gICAgICAgICAgbG9ja1ggPSB0cnVlO1xuICAgICAgfVxuICAgICAgZm9yIChjb25zdCBwb2ludCBvZiBwb2ludHMpXG4gICAgICAgIGlmIChwb2ludC5jdXIpIHBvaW50WzBdID0gcG9pbnQuY3VyWzBdLCBwb2ludFsxXSA9IHBvaW50LmN1clsxXTtcbiAgICAgIG1vdmluZyA9IHRydWU7XG4gICAgICBub2V2ZW50KGV2ZW50KTtcbiAgICAgIG1vdmUoZXZlbnQpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1vdmUoZXZlbnQpIHtcbiAgICAgIGNvbnN0IHBvaW50ID0gcG9pbnRzWzBdLCBwb2ludDAgPSBwb2ludC5wb2ludDA7XG4gICAgICB2YXIgdDtcblxuICAgICAgZHggPSBwb2ludFswXSAtIHBvaW50MFswXTtcbiAgICAgIGR5ID0gcG9pbnRbMV0gLSBwb2ludDBbMV07XG5cbiAgICAgIHN3aXRjaCAobW9kZSkge1xuICAgICAgICBjYXNlIE1PREVfU1BBQ0U6XG4gICAgICAgIGNhc2UgTU9ERV9EUkFHOiB7XG4gICAgICAgICAgaWYgKHNpZ25YKSBkeCA9IG1heChXIC0gdzAsIG1pbihFIC0gZTAsIGR4KSksIHcxID0gdzAgKyBkeCwgZTEgPSBlMCArIGR4O1xuICAgICAgICAgIGlmIChzaWduWSkgZHkgPSBtYXgoTiAtIG4wLCBtaW4oUyAtIHMwLCBkeSkpLCBuMSA9IG4wICsgZHksIHMxID0gczAgKyBkeTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBjYXNlIE1PREVfSEFORExFOiB7XG4gICAgICAgICAgaWYgKHBvaW50c1sxXSkge1xuICAgICAgICAgICAgaWYgKHNpZ25YKSB3MSA9IG1heChXLC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xlY3Rpb24pO1xuICAgICAgICAgICAgbW92ZShldmVudCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGRlZmF1bHQ6IHJldHVybjtcbiAgICAgIH1cbiAgICAgIG5vZXZlbnQoZXZlbnQpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGtleXVwcGVkKGV2ZW50KSB7XG4gICAgICBzd2l0Y2ggKGV2ZW50LmtleUNvZGUpIHtcbiAgICAgICAgY2FzZSAxNjogeyAvLyBTSElGVFxuICAgICAgICAgIGlmIChzaGlmdGluZykge1xuICAgICAgICAgICAgbG9ja1ggPSBsb2NrWSA9IHNoaWZ0aW5nID0gZmFsc2U7XG4gICAgICAgICAgICBtb3ZlKGV2ZW50KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSAxODogeyAvLyBBTFRcbiAgICAgICAgICBpZiAobW9kZSA9PT0gTU9ERV9DRU5URVIpIHtcbiAgICAgICAgICAgIGlmIChzaWduWCA8IDApIGUwID0gZTE7IGVsc2UgaWYgKHNpZ25YID4gMCkgdzAgPSB3MTtcbiAgICAgICAgICAgIGlmIChzaWduWSA8IDApIHMwID0gczE7IGVsc2UgaWYgKHNpZ25ZID4gMCkgbjAgPSBuMTtcbiAgICAgICAgICAgIG1vZGUgPSBNT0RFX0hBTkRMRTtcbiAgICAgICAgICAgIG1vdmUoZXZlbnQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBjYXNlIDMyOiB7IC8vIFNQQUNFXG4gICAgICAgICAgaWYgKG1vZGUgPT09IE1PREVfU1BBQ0UpIHtcbiAgICAgICAgICAgIGlmIChldmVudC5hbHRLZXkpIHtcbiAgICAgICAgICAgICAgaWYgKHNpZ25YKSBlMCA9IGUxIC0gZHggKiBzaWduWCwgdzAgPSB3MSArIGR4ICogc2lnblg7XG4gICAgICAgICAgICAgIGlmIChzaWduWSkgczAgPSBzMSAtIGR5ICogc2lnblksIG4wID0gbjEgKyBkeSAqIHNpZ25ZO1xuICAgICAgICAgICAgICBtb2RlID0gTU9ERV9DRU5URVI7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoc2lnblggPCAwKSBlMCA9IGUxOyBlbHNlIGlmIChzaWduWCA+IDApIHcwID0gdzE7XG4gICAgICAgICAgICAgIGlmIChzaWduWSA8IDApIHMwID0gczE7IGVsc2UgaWYgKHNpZ25ZID4gMCkgbjAgPSBuMTtcbiAgICAgICAgICAgICAgbW9kZSA9IE1PREVfSEFORExFO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb3ZlcmxheS5hdHRyKFwiY3Vyc29yXCIsIGN1cnNvcnNbdHlwZV0pO1xuICAgICAgICAgICAgbW92ZShldmVudCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGRlZmF1bHQ6IHJldHVybjtcbiAgICAgIH1cbiAgICAgIG5vZXZlbnQoZXZlbnQpO1xuICAgIH1cbiAgfVxuXG4gIGZ1bmN0aW9uIHRvdWNobW92ZWQoZXZlbnQpIHtcbiAgICBlbWl0dGVyKHRoaXMsIGFyZ3VtZW50cykubW92ZWQoZXZlbnQpO1xuICB9XG5cbiAgZnVuY3Rpb24gdG91Y2hlbmRlZChldmVudCkge1xuICAgIGVtaXR0ZXIodGhpcywgYXJndW1lbnRzKS5lbmRlZChldmVudCk7XG4gIH1cblxuICBmdW5jdGlvbiBpbml0aWFsaXplKCkge1xuICAgIHZhciBzdGF0ZSA9IHRoaXMuX19icnVzaCB8fCB7c2VsZWN0aW9uOiBudWxsfTtcbiAgICBzdGF0ZS5leHRlbnQgPSBudW1iZXIyKGV4dGVudC5hcHBseSh0aGlzLCBhcmd1bWVudHMpKTtcbiAgICBzdGF0ZS5kaW0gPSBkaW07XG4gICAgcmV0dXJuIHN0YXRlO1xuIC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aC5wb3coMiwgLWspLFxuICAgICAgICBpID0gLTE7XG5cbiAgICBmb3IgKGNvbnN0IGQgb2YgZGF0YSkge1xuICAgICAgdmFyIHhpID0gKHgoZCwgKytpLCBkYXRhKSArIG8pICogcG93MmssXG4gICAgICAgICAgeWkgPSAoeShkLCBpLCBkYXRhKSArIG8pICogcG93MmssXG4gICAgICAgICAgd2kgPSArd2VpZ2h0KGQsIGksIGRhdGEpO1xuICAgICAgaWYgKHdpICYmIHhpID49IDAgJiYgeGkgPCBuICYmIHlpID49IDAgJiYgeWkgPCBtKSB7XG4gICAgICAgIHZhciB4MCA9IE1hdGguZmxvb3IoeGkpLFxuICAgICAgICAgICAgeTAgPSBNYXRoLmZsb29yKHlpKSxcbiAgICAgICAgICAgIHh0ID0geGkgLSB4MCAtIDAuNSxcbiAgICAgICAgICAgIHl0ID0geWkgLSB5MCAtIDAuNTtcbiAgICAgICAgdmFsdWVzW3gwICsgeTAgKiBuXSArPSAoMSAtIHh0KSAqICgxIC0geXQpICogd2k7XG4gICAgICAgIHZhbHVlc1t4MCArIDEgKyB5MCAqIG5dICs9IHh0ICogKDEgLSB5dCkgKiB3aTtcbiAgICAgICAgdmFsdWVzW3gwICsgMSArICh5MCArIDEpICogbl0gKz0geHQgKiB5dCAqIHdpO1xuICAgICAgICB2YWx1ZXNbeDAgKyAoeTAgKyAxKSAqIG5dICs9ICgxIC0geHQpICogeXQgKiB3aTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBibHVyMih7ZGF0YTogdmFsdWVzLCB3aWR0aDogbiwgaGVpZ2h0OiBtfSwgciAqIHBvdzJrKTtcbiAgICByZXR1cm4gdmFsdWVzO1xuICB9XG5cbiAgZnVuY3Rpb24gZGVuc2l0eShkYXRhKSB7XG4gICAgdmFyIHZhbHVlcyA9IGdyaWQoZGF0YSksXG4gICAgICAgIHR6ID0gdGhyZXNob2xkKHZhbHVlcyksXG4gICAgICAgIHBvdzRrID0gTWF0aC5wb3coMiwgMiAqIGspO1xu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1wiOiBwID0gcG9pbnRlcih0b3VjaCB8fCBldmVudCwgY29udGFpbmVyKSwgbiA9IGFjdGl2ZTsgYnJlYWs7XG4gICAgICB9XG4gICAgICBkaXNwYXRjaC5jYWxsKFxuICAgICAgICB0eXBlLFxuICAgICAgICB0aGF0LFxuICAgICAgICBuZXcgRHJhZ0V2ZW50KHR5cGUsIHtcbiAgICAgICAgICBzb3VyY2VFdmVudDogZXZlbnQsXG4gICAgICAgICAgc3ViamVjdDogcyxcbiAgICAgICAgICB0YXJnZXQ6IGRyYWcsXG4gICAgICAgICAgaWRlbnRpZmllcixcbiAgICAgICAgICBhY3RpdmU6IG4sXG4gICAgICAgICAgeDogcFswXSArIGR4LFxuICAgICAgICAgIHk6IHBbMV0gKyBkeSxcbiAgICAgICAgICBkeDogcFswXSAtIHAwWzBdLFxuICAgICAgICAgIGR5OiBwWzFdIC0gcDBbMV0sXG4gICAgICAgICAgZGlzcGF0Y2hcbiAgICAgICAgfSksXG4gICAgICAgIGRcbiAgICAgICk7XG4gICAgfTtcbiAgfVxuXG4gIGRyYWcuZmlsdGVyID0gZnVuY3Rpb24oXykge1xuICAgIHJldHVybiBhcmd1bWVudHMubGVuZ3RoID8gKGZpbHRlciA9IHR5cGVvZiBfID09PSBcImZ1bmN0aW9uXCIgPyBfIDogY29uc3RhbnQoISFfKSwgZHJhZykgOiBmaWx0ZXI7XG4gIH07XG5cbiAgZHJhZy5jb250YWluZXIgPSBmdW5jdGlvbihfKSB7XG4gICAgcmV0dXJuIGFyZ3VtZW50cy5sZW5ndGggPyAoY29udGFpbmVyID0gdHlwZW9mIF8gPT09IFwiZnVuY3Rpb25cIiA/IF8gOiBjb25zdGFudChfKSwgZHJhZykgOiBjb250YWluZXI7XG4gIH07XG5cbiAgZHJhZy5zdWJqZWN0ID0gZnVuY3Rpb24oXykge1xuICAgIHJldHVybiBhcmd1bWVudHMubGVuZ3RoID8gKHN1YmplY3QgPSB0eXBlb2YgXyA9PT0gXCJmdW5jdGlvblw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XNpdEFmdGVyKHByZXBhcmUpO1xuICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICBub2RlID0gbm9kZXNbaV07XG4gICAgICAgIHJpID0gcmFkaWlbbm9kZS5pbmRleF0sIHJpMiA9IHJpICogcmk7XG4gICAgICAgIHhpID0gbm9kZS54ICsgbm9kZS52eDtcbiAgICAgICAgeWkgPSBub2RlLnkgKyBub2RlLnZ5O1xuICAgICAgICB0cmVlLnZpc2l0KGFwcGx5KTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBhcHBseShxdWFkLCB4MCwgeTAsIHgxLCB5MSkge1xuICAgICAgdmFyIGRhdGEgPSBxdWFkLmRhdGEsIHJqID0gcXVhZC5yLCByID0gcmkgKyByajtcbiAgICAgIGlmIChkYXRhKSB7XG4gICAgICAgIGlmIChkYXRhLmluZGV4ID4gbm9kZS5pbmRleCkge1xuICAgICAgICAgIHZhciB4ID0geGkgLSBkYXRhLnggLSBkYXRhLnZ4LFxuICAgICAgICAgICAgICB5ID0geWkgLSBkYXRhLnkgLSBkYXRhLnZ5LFxuICAgICAgICAgICAgICBsID0geCAqIHggKyB5ICogeTtcbiAgICAgICAgICBpZiAobCA8IHIgKiByKSB7XG4gICAgICAgICAgICBpZiAoeCA9PT0gMCkgeCA9IGppZ2dsZShyYW5kb20pLCBsICs9IHggKiB4O1xuICAgICAgICAgICAgaWYgKHkgPT09IDApIHkgPSBqaWdnbGUocmFuZG9tKSwgbCArPSB5ICogeTtcbiAgICAgICAgICAgIGwgPSAociAtIChsID0gTWF0aC5zcXJ0KGwpKSkgLyBsICogc3RyZW5ndGg7XG4gICAgICAgICAgICBub2RlLnZ4ICs9ICh4ICo9IGwpICogKHIgPSAocmogKj0gcmopIC8gKHJpMiArIHJqKSk7XG4gICAgICAgICAgICBub2RlLnZ5ICs9ICh5ICo9IGwpICogcjtcbiAgICAgICAgICAgIGRhdGEudnggLT0geCAqIChyID0gMSAtIHIpO1xuICA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SArPSB5ICogYjtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBmdW5jdGlvbiBpbml0aWFsaXplKCkge1xuICAgIGlmICghbm9kZXMpIHJldHVybjtcblxuICAgIHZhciBpLFxuICAgICAgICBuID0gbm9kZXMubGVuZ3RoLFxuICAgICAgICBtID0gbGlua3MubGVuZ3RoLFxuICAgICAgICBub2RlQnlJZCA9IG5ldyBNYXAobm9kZXMubWFwKChkLCBpKSA9PiBbaWQoZCwgaSwgbm9kZXMpLCBkXSkpLFxuICAgICAgICBsaW5rO1xuXG4gICAgZm9yIChpID0gMCwgY291bnQgPSBuZXcgQXJyYXkobik7IGkgPCBtOyArK2kpIHtcbiAgICAgIGxpbmsgPSBsaW5rc1tpXSwgbGluay5pbmRleCA9IGk7XG4gICAgICBpZiAodHlwZW9mIGxpbmsuc291cmNlICE9PSBcIm9iamVjdFwiKSBsaW5rLnNvdXJjZSA9IGZpbmQobm9kZUJ5SWQsIGxpbmsuc291cmNlKTtcbiAgICAgIGlmICh0eXBlb2YgbGluay50YXJnZXQgIT09IFwib2JqZWN0XCIpIGxpbmsudGFyZ2V0ID0gZmluZChub2RlQnlJZCwgbGluay50YXJnZXQpO1xuICAgICAgY291bnRbbGluay5zb3VyY2UuaW5kZXhdID0gKGNvdW50W2xpbmsuc291cmNlLmluZGV4XSB8fCAwKSArIDE7XG4gICAgICBjb3VudFtsaW5rLnRhcmdldC5pbmRleF0gPSAoY291bnRbbGluay50YXJnZXQuaW5kZXhdIHx8IDApICsgMTtcbiAgICB9XG5cbiAgICBmb3IgKGkgPSAwLCBiaWFzID0gbmV3IEFycmF5KG0pOyBpIDwgbTsgKytpKSB7XG4gICAgICBsaW5rID0gbGlua3NbaV0sIGJpYXNbaV0gPSBjb3VudFtsaW5rLnNvdXJjZS5pbmRleF0gLyAoY291bnRbbGluay5zb3VyY2UuaW5kZXhdICsgY291bnRbbGluay50YXJnZXQuaW5kZXhdKTtcbiAgICB9XG5cbiAgICBzdHJlbmd0aH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IHk6ICh5MSArIHkyICsgeTIxIC8gbCAqIHIyMSkgLyAyLFxuICAgIHI6IChsICsgcjEgKyByMikgLyAyXG4gIH07XG59XG5cbmZ1bmN0aW9uIGVuY2xvc2VCYXNpczMoYSwgYiwgYykge1xuICB2YXIgeDEgPSBhLngsIHkxID0gYS55LCByMSA9IGEucixcbiAgICAgIHgyID0gYi54LCB5MiA9IGIueSwgcjIgPSBiLnIsXG4gICAgICB4MyA9IGMueCwgeTMgPSBjLnksIHIzID0gYy5yLFxuICAgICAgYTIgPSB4MSAtIHgyLFxuICAgICAgYTMgPSB4MSAtIHgzLFxuICAgICAgYjIgPSB5MSAtIHkyLFxuICAgICAgYjMgPSB5MSAtIHkzLFxuICAgICAgYzIgPSByMiAtIHIxLFxuICAgICAgYzMgPSByMyAtIHIxLFxuICAgICAgZDEgPSB4MSAqIHgxICsgeTEgKiB5MSAtIHIxICogcjEsXG4gICAgICBkMiA9IGQxIC0geDIgKiB4MiAtIHkyICogeTIgKyByMiAqIHIyLFxuICAgICAgZDMgPSBkMSAtIHgzICogeDMgLSB5MyAqIHkzICsgcjMgKiByMyxcbiAgICAgIGFiID0gYTMgKiBiMiAtIGEyICogYjMsXG4gICAgICB4YSA9IChiMiAqIGQzIC0gYjMgKiBkMikgLyAoYWIgKiAyKSAtIHgxLFxuICAgICAgeGIgPSAoYjMgKiBjMiAtIGIyICogYzMpIC8gYWIsXG4gICAgICB5YSA9IChhMyAqIGQyIC0gYTIgKiBkMykgLyAoYWIgKiAyKSAtIHkxLFxuICAgICAgeWIgPSAoYTIgKiBjMyAtIGEzICogYzIpIC8gYWIsXG4gICAgICBBID0geGIgKiB4YiArIHliICogeWIgLSAxLFxuICAgICAgQiA9IDIgKiAocjEgKyB4YSAqIHhiICsgeWEgKiB5YiksXG4gICAgICBDID0geGEgKiB4YSArIHlhICogeWEgLSByMSAqIHIxLFxuICAgICAgciA9IC0oTWF0aC5hYnMoQSkgPiAxZS02ID8gKEIgKyBNYXRoLnNxcnQ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0cmF0aWZ5KGRhdGEpIHtcbiAgICB2YXIgbm9kZXMgPSBBcnJheS5mcm9tKGRhdGEpLFxuICAgICAgICBjdXJyZW50SWQgPSBpZCxcbiAgICAgICAgY3VycmVudFBhcmVudElkID0gcGFyZW50SWQsXG4gICAgICAgIG4sXG4gICAgICAgIGQsXG4gICAgICAgIGksXG4gICAgICAgIHJvb3QsXG4gICAgICAgIHBhcmVudCxcbiAgICAgICAgbm9kZSxcbiAgICAgICAgbm9kZUlkLFxuICAgICAgICBub2RlS2V5LFxuICAgICAgICBub2RlQnlLZXkgPSBuZXcgTWFwO1xuXG4gICAgaWYgKHBhdGggIT0gbnVsbCkge1xuICAgICAgY29uc3QgSSA9IG5vZGVzLm1hcCgoZCwgaSkgPT4gbm9ybWFsaXplKHBhdGgoZCwgaSwgZGF0YSkpKTtcbiAgICAgIGNvbnN0IFAgPSBJLm1hcChwYXJlbnRvZik7XG4gICAgICBjb25zdCBTID0gbmV3IFNldChJKS5hZGQoXCJcIik7XG4gICAgICBmb3IgKGNvbnN0IGkgb2YgUCkge1xuICAgICAgICBpZiAoIVMuaGFzKGkpKSB7XG4gICAgICAgICAgUy5hZGQoaSk7XG4gICAgICAgICAgSS5wdXNoKGkpO1xuICAgICAgICAgIFAucHVzaChwYXJlbnRvZihpKSk7XG4gICAgICAgICAgbm9kZXMucHVzaChpbXB1dGVkKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgY3VycmVudElkID0gKF8sIGkpID0+IElbaV07XG4gICAgICBjdXJyZW50UGFyZW50SWQgPSAoXywgaSkgPT4gUFtpXTtcbiAgICB9XG5cbiAgICBmb3IgKGkgPSAwLCBuID0gbm9kZXMubGVuZ3RoOyBpIDwgbjsgKytpKSB7XG4gICAgICBkID0gbm9kZXNbaV0sIG5vZGUgPSBub2Rlc1tpXSA9IG5ldyBOb2RlKGQpO1xuICAgICAgaWYgKChub2RlSWQgPSBjdXJyZW50SWQoZCwgaSwgZGF0YSkpICE9IG51bGwgJiYg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FxuICAgICAgICAgIHZpbSA9IHcsXG4gICAgICAgICAgdm9tID0gdmlwLnBhcmVudC5jaGlsZHJlblswXSxcbiAgICAgICAgICBzaXAgPSB2aXAubSxcbiAgICAgICAgICBzb3AgPSB2b3AubSxcbiAgICAgICAgICBzaW0gPSB2aW0ubSxcbiAgICAgICAgICBzb20gPSB2b20ubSxcbiAgICAgICAgICBzaGlmdDtcbiAgICAgIHdoaWxlICh2aW0gPSBuZXh0UmlnaHQodmltKSwgdmlwID0gbmV4dExlZnQodmlwKSwgdmltICYmIHZpcCkge1xuICAgICAgICB2b20gPSBuZXh0TGVmdCh2b20pO1xuICAgICAgICB2b3AgPSBuZXh0UmlnaHQodm9wKTtcbiAgICAgICAgdm9wLmEgPSB2O1xuICAgICAgICBzaGlmdCA9IHZpbS56ICsgc2ltIC0gdmlwLnogLSBzaXAgKyBzZXBhcmF0aW9uKHZpbS5fLCB2aXAuXyk7XG4gICAgICAgIGlmIChzaGlmdCA+IDApIHtcbiAgICAgICAgICBtb3ZlU3VidHJlZShuZXh0QW5jZXN0b3IodmltLCB2LCBhbmNlc3RvciksIHYsIHNoaWZ0KTtcbiAgICAgICAgICBzaXAgKz0gc2hpZnQ7XG4gICAgICAgICAgc29wICs9IHNoaWZ0O1xuICAgICAgICB9XG4gICAgICAgIHNpbSArPSB2aW0ubTtcbiAgICAgICAgc2lwICs9IHZpcC5tO1xuICAgICAgICBzb20gKz0gdm9tLm07XG4gICAgICAgIHNvcCArPSB2b3AubTtcbiAgICAgIH1cbiAgICAgIGlmICh2aW0gJiYgIW5leHRSaWdodCh2b3ApKSB7XG4gICAgICAgIHZvcC50ID0gdmltO1xuICAgICAgICB2b3AubSArPSBzaW0gLSBzb3A7XG4gICAgICB9XG4gICAgICBpZiAodmlwICYmICFuZXh0TGVmdCh2b20pKSB7XG4gICAgICAgIHZvbS50ID0gdmlwO1xuICAgICAgICB2b20ubSArPSBzaXAgLSBzb207XG4gICAgICAgIGFuY2VzdG9yID0gdjtcbi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iB6b29tKHAwLCBwMSkge1xuICAgIHZhciB1eDAgPSBwMFswXSwgdXkwID0gcDBbMV0sIHcwID0gcDBbMl0sXG4gICAgICAgIHV4MSA9IHAxWzBdLCB1eTEgPSBwMVsxXSwgdzEgPSBwMVsyXSxcbiAgICAgICAgZHggPSB1eDEgLSB1eDAsXG4gICAgICAgIGR5ID0gdXkxIC0gdXkwLFxuICAgICAgICBkMiA9IGR4ICogZHggKyBkeSAqIGR5LFxuICAgICAgICBpLFxuICAgICAgICBTO1xuXG4gICAgLy8gU3BlY2lhbCBjYXNlIGZvciB1MCDiiYUgdTEuXG4gICAgaWYgKGQyIDwgZXBzaWxvbjIpIHtcbiAgICAgIFMgPSBNYXRoLmxvZyh3MSAvIHcwKSAvIHJobztcbiAgICAgIGkgPSBmdW5jdGlvbih0KSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgdXgwICsgdCAqIGR4LFxuICAgICAgICAgIHV5MCArIHQgKiBkeSxcbiAgICAgICAgICB3MCAqIE1hdGguZXhwKHJobyAqIHQgKiBTKVxuICAgICAgICBdO1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIEdlbmVyYWwgY2FzZS5cbiAgICBlbHNlIHtcbiAgICAgIHZhciBkMSA9IE1hdGguc3FydChkMiksXG4gICAgICAgICAgYjAgPSAodzEgKiB3MSAtIHcwICogdzAgKyByaG80ICogZDIpIC8gKDIgKiB3MCAqIHJobzIgKiBkMSksXG4gICAgICAgICAgYjEgPSAodzEgKiB3MSAtIHcwICogdzAgLSByaG80ICogZDIpIC8gKDIgKiB3MSAqIHJobzIgKiBkMSksXG4gICAgICAgICAgcjAgPSBNYXRoLmxvZyhNYXRoLnNxcnQoYjAgKiBiMCArIDEpIC0gYjApLFxuICAgICAgICAgIHIxID0gTWF0aC5sb2coTWF0aC5zcXJ0KGIxICogYjEgKyAxKSAtIGIxKTtcbiAgICAgIFMgPSAocjEgLSByMCkgLyByaG87XG4gICAgICBpID0gZnVuY3Rpb24odCkge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G4gICAgICBCID0gYmV0YS5zb3VyY2Uoc291cmNlKTtcblxuICBmdW5jdGlvbiByYW5kb21CaW5vbWlhbChuLCBwKSB7XG4gICAgbiA9ICtuO1xuICAgIGlmICgocCA9ICtwKSA+PSAxKSByZXR1cm4gKCkgPT4gbjtcbiAgICBpZiAocCA8PSAwKSByZXR1cm4gKCkgPT4gMDtcbiAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICB2YXIgYWNjID0gMCwgbm4gPSBuLCBwcCA9IHA7XG4gICAgICB3aGlsZSAobm4gKiBwcCA+IDE2ICYmIG5uICogKDEgLSBwcCkgPiAxNikge1xuICAgICAgICB2YXIgaSA9IE1hdGguZmxvb3IoKG5uICsgMSkgKiBwcCksXG4gICAgICAgICAgICB5ID0gQihpLCBubiAtIGkgKyAxKSgpO1xuICAgICAgICBpZiAoeSA8PSBwcCkge1xuICAgICAgICAgIGFjYyArPSBpO1xuICAgICAgICAgIG5uIC09IGk7XG4gICAgICAgICAgcHAgPSAocHAgLSB5KSAvICgxIC0geSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgbm4gPSBpIC0gMTtcbiAgICAgICAgICBwcCAvPSB5O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB2YXIgc2lnbiA9IHBwIDwgMC41LFxuICAgICAgICAgIHBGaW5hbCA9IHNpZ24gPyBwcCA6IDEgLSBwcCxcbiAgICAgICAgICBnID0gRyhwRmluYWwpO1xuICAgICAgZm9yICh2YXIgcyA9IGcoKSwgayA9IDA7IHMgPD0gbm47ICsraykgcyArPSBnKCk7XG4gICAgICByZXR1cm4gYWNjICsgKHNpZ24gPyBrIDogbm4gLSBrKTtcbiAgICB9O1xuICB9XG5cbiAgcmFuZG9tQmlub21pYWwuc291cmNlID0gc291cmNlUmFuZG9tQmlub21pYWw7XG5cbiAgcmV0dXJuIHJhbmRvbUJpbm9taWFsO1xufSkoZGVmYXVsdFNvdXJjZSk7XG4iLCJpbXBvcnQgZGVmYX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Y2FsZS50aWNrcyA9IGNvdW50ID0+IHtcbiAgICBjb25zdCBkID0gZG9tYWluKCk7XG4gICAgbGV0IHUgPSBkWzBdO1xuICAgIGxldCB2ID0gZFtkLmxlbmd0aCAtIDFdO1xuICAgIGNvbnN0IHIgPSB2IDwgdTtcblxuICAgIGlmIChyKSAoW3UsIHZdID0gW3YsIHVdKTtcblxuICAgIGxldCBpID0gbG9ncyh1KTtcbiAgICBsZXQgaiA9IGxvZ3Modik7XG4gICAgbGV0IGs7XG4gICAgbGV0IHQ7XG4gICAgY29uc3QgbiA9IGNvdW50ID09IG51bGwgPyAxMCA6ICtjb3VudDtcbiAgICBsZXQgeiA9IFtdO1xuXG4gICAgaWYgKCEoYmFzZSAlIDEpICYmIGogLSBpIDwgbikge1xuICAgICAgaSA9IE1hdGguZmxvb3IoaSksIGogPSBNYXRoLmNlaWwoaik7XG4gICAgICBpZiAodSA+IDApIGZvciAoOyBpIDw9IGo7ICsraSkge1xuICAgICAgICBmb3IgKGsgPSAxOyBrIDwgYmFzZTsgKytrKSB7XG4gICAgICAgICAgdCA9IGkgPCAwID8gayAvIHBvd3MoLWkpIDogayAqIHBvd3MoaSk7XG4gICAgICAgICAgaWYgKHQgPCB1KSBjb250aW51ZTtcbiAgICAgICAgICBpZiAodCA+IHYpIGJyZWFrO1xuICAgICAgICAgIHoucHVzaCh0KTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIGZvciAoOyBpIDw9IGo7ICsraSkge1xuICAgICAgICBmb3IgKGsgPSBiYXNlIC0gMTsgayA+PSAxOyAtLWspIHtcbiAgICAgICAgICB0ID0gaSA+IDAgPyBrIC8gcG93cygtaSkgOiBrICogcG93cyhpKTtcbiAgICAgICAgICBpZiAodCA8IHUpIGNvbnRpbnVlO1xuICAgICAgICAgIGlmICh0ID4gdikgYnJlYWs7XG4gICAgICAgICAgei5wdXNoKHQpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoei5sZW5ndGggKiAyIDwgbikge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AqIHNpbihhMCkpO1xuICAgICAgY29udGV4dC5hcmMoMCwgMCwgcjEsIGEwLCBhMSwgIWN3KTtcbiAgICAgIGlmIChyMCA+IGVwc2lsb24pIHtcbiAgICAgICAgY29udGV4dC5tb3ZlVG8ocjAgKiBjb3MoYTEpLCByMCAqIHNpbihhMSkpO1xuICAgICAgICBjb250ZXh0LmFyYygwLCAwLCByMCwgYTEsIGEwLCBjdyk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgLy8gT3IgaXMgaXQgYSBjaXJjdWxhciBvciBhbm51bGFyIHNlY3Rvcj9cbiAgICBlbHNlIHtcbiAgICAgIHZhciBhMDEgPSBhMCxcbiAgICAgICAgICBhMTEgPSBhMSxcbiAgICAgICAgICBhMDAgPSBhMCxcbiAgICAgICAgICBhMTAgPSBhMSxcbiAgICAgICAgICBkYTAgPSBkYSxcbiAgICAgICAgICBkYTEgPSBkYSxcbiAgICAgICAgICBhcCA9IHBhZEFuZ2xlLmFwcGx5KHRoaXMsIGFyZ3VtZW50cykgLyAyLFxuICAgICAgICAgIHJwID0gKGFwID4gZXBzaWxvbikgJiYgKHBhZFJhZGl1cyA/ICtwYWRSYWRpdXMuYXBwbHkodGhpcywgYXJndW1lbnRzKSA6IHNxcnQocjAgKiByMCArIHIxICogcjEpKSxcbiAgICAgICAgICByYyA9IG1pbihhYnMocjEgLSByMCkgLyAyLCArY29ybmVyUmFkaXVzLmFwcGx5KHRoaXMsIGFyZ3VtZW50cykpLFxuICAgICAgICAgIHJjMCA9IHJjLFxuICAgICAgICAgIHJjMSA9IHJjLFxuICAgICAgICAgIHQwLFxuICAgICAgICAgIHQxO1xuXG4gICAgICAvLyBBcHBseSBwYWRkaW5nPyBOb3RlIHRoYXQgc2luY2UgcjEg4omlIHIwLCBkYTEg4omlIGRhMC5cbiAgICAgIGlmIChycCA+IGVwc2lsb24pIHtcbiAgICAgICAgdmFyIHAwID0gYXNpbihycCAvIHIwICogc2luKGFwKSksXG4gICAgICAgICAgICBwMSA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cyBlbnRpcmVseS5cbiAgICAgICAgaWYgKGRhIDwgcGkpIHtcbiAgICAgICAgICBpZiAob2MgPSBpbnRlcnNlY3QoeDAxLCB5MDEsIHgwMCwgeTAwLCB4MTEsIHkxMSwgeDEwLCB5MTApKSB7XG4gICAgICAgICAgICB2YXIgYXggPSB4MDEgLSBvY1swXSxcbiAgICAgICAgICAgICAgICBheSA9IHkwMSAtIG9jWzFdLFxuICAgICAgICAgICAgICAgIGJ4ID0geDExIC0gb2NbMF0sXG4gICAgICAgICAgICAgICAgYnkgPSB5MTEgLSBvY1sxXSxcbiAgICAgICAgICAgICAgICBrYyA9IDEgLyBzaW4oYWNvcygoYXggKiBieCArIGF5ICogYnkpIC8gKHNxcnQoYXggKiBheCArIGF5ICogYXkpICogc3FydChieCAqIGJ4ICsgYnkgKiBieSkpKSAvIDIpLFxuICAgICAgICAgICAgICAgIGxjID0gc3FydChvY1swXSAqIG9jWzBdICsgb2NbMV0gKiBvY1sxXSk7XG4gICAgICAgICAgICByYzAgPSBtaW4ocmMsIChyMCAtIGxjKSAvIChrYyAtIDEpKTtcbiAgICAgICAgICAgIHJjMSA9IG1pbihyYywgKHIxIC0gbGMpIC8gKGtjICsgMSkpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByYzAgPSByYzEgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBJcyB0aGUgc2VjdG9yIGNvbGxhcHNlZCB0byBhIGxpbmU/XG4gICAgICBpZiAoIShkYTEgPiBlcHNpbG9uKSkgY29udGV4dC5tb3ZlVG8oeDAxLCB5MDEpO1xuXG4gICAgICAvLyBEb2VzIHRoZSBzZWN0b3LigJlzIG91dGVyIHJpbmcgaGF2ZSByb3VuZGVkIGNvcm5lcnM/XG4gICAgICBlbHNlIGlmIChyYzEgPiBlcHNpbG9uKSB7XG4gICAgICAgIHQwID0gY29ybmVyVGFuZ2VudHMoeDAwLCB5MDAsIHgwMSw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1bmN0aW9uXCIgPyB5MCA6ICh5MCA9PT0gdW5kZWZpbmVkKSA/IGNvbnN0YW50KDApIDogY29uc3RhbnQoK3kwKTtcbiAgeTEgPSB0eXBlb2YgeTEgPT09IFwiZnVuY3Rpb25cIiA/IHkxIDogKHkxID09PSB1bmRlZmluZWQpID8gcG9pbnRZIDogY29uc3RhbnQoK3kxKTtcblxuICBmdW5jdGlvbiBhcmVhKGRhdGEpIHtcbiAgICB2YXIgaSxcbiAgICAgICAgaixcbiAgICAgICAgayxcbiAgICAgICAgbiA9IChkYXRhID0gYXJyYXkoZGF0YSkpLmxlbmd0aCxcbiAgICAgICAgZCxcbiAgICAgICAgZGVmaW5lZDAgPSBmYWxzZSxcbiAgICAgICAgYnVmZmVyLFxuICAgICAgICB4MHogPSBuZXcgQXJyYXkobiksXG4gICAgICAgIHkweiA9IG5ldyBBcnJheShuKTtcblxuICAgIGlmIChjb250ZXh0ID09IG51bGwpIG91dHB1dCA9IGN1cnZlKGJ1ZmZlciA9IHBhdGgoKSk7XG5cbiAgICBmb3IgKGkgPSAwOyBpIDw9IG47ICsraSkge1xuICAgICAgaWYgKCEoaSA8IG4gJiYgZGVmaW5lZChkID0gZGF0YVtpXSwgaSwgZGF0YSkpID09PSBkZWZpbmVkMCkge1xuICAgICAgICBpZiAoZGVmaW5lZDAgPSAhZGVmaW5lZDApIHtcbiAgICAgICAgICBqID0gaTtcbiAgICAgICAgICBvdXRwdXQuYXJlYVN0YXJ0KCk7XG4gICAgICAgICAgb3V0cHV0LmxpbmVTdGFydCgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG91dHB1dC5saW5lRW5kKCk7XG4gICAgICAgICAgb3V0cHV0LmxpbmVTdGFydCgpO1xuICAgICAgICAgIGZvciAoayA9IGkgLSAxOyBrID49IGo7IC0taykge1xuICAgICAgICAgICAgb3V0cHV0LnBvaW50KHgweltrXSwgeTB6W2tdKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgb3V0cHV0Lm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ZSA9PT0gMSkge1xuICAgICAgICB0aGlzLnRoYXQuX196b29taW5nID0gdGhpcztcbiAgICAgICAgdGhpcy5lbWl0KFwic3RhcnRcIik7XG4gICAgICB9XG4gICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuICAgIHpvb206IGZ1bmN0aW9uKGtleSwgdHJhbnNmb3JtKSB7XG4gICAgICBpZiAodGhpcy5tb3VzZSAmJiBrZXkgIT09IFwibW91c2VcIikgdGhpcy5tb3VzZVsxXSA9IHRyYW5zZm9ybS5pbnZlcnQodGhpcy5tb3VzZVswXSk7XG4gICAgICBpZiAodGhpcy50b3VjaDAgJiYga2V5ICE9PSBcInRvdWNoXCIpIHRoaXMudG91Y2gwWzFdID0gdHJhbnNmb3JtLmludmVydCh0aGlzLnRvdWNoMFswXSk7XG4gICAgICBpZiAodGhpcy50b3VjaDEgJiYga2V5ICE9PSBcInRvdWNoXCIpIHRoaXMudG91Y2gxWzFdID0gdHJhbnNmb3JtLmludmVydCh0aGlzLnRvdWNoMVswXSk7XG4gICAgICB0aGlzLnRoYXQuX196b29tID0gdHJhbnNmb3JtO1xuICAgICAgdGhpcy5lbWl0KFwiem9vbVwiKTtcbiAgICAgIHJldHVybiB0aGlzO1xuICAgIH0sXG4gICAgZW5kOiBmdW5jdGlvbigpIHtcbiAgICAgIGlmICgtLXRoaXMuYWN0aXZlID09PSAwKSB7XG4gICAgICAgIGRlbGV0ZSB0aGlzLnRoYXQuX196b29taW5nO1xuICAgICAgICB0aGlzLmVtaXQoXCJlbmRcIik7XG4gICAgICB9XG4gICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuICAgIGVtaXQ6IGZ1bmN0aW9uKHR5cGUpIHtcbiAgICAgIHZhciBkID0gc2VsZWN0KHRoaXMudGhhdCkuZGF0dW0oKTtcbiAgICAgIGxpc3RlbmVycy5jYWxsKFxuICAgICAgICB0eXBlLFxuICAgICAgICB0aGlzLnRoYXQsXG4gICAgICAgIG5ldyBab29tRXZlbnQodHlwZSwge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wgcGhpKSA6IDA7XG4gICAgICAgIGlmICghcG9pbnQwICYmICh2MDAgPSB2MCA9IHYpKSBzdHJlYW0ubGluZVN0YXJ0KCk7XG4gICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgaWYgKCFwb2ludDIgfHwgcG9pbnRFcXVhbChwb2ludDAsIHBvaW50MikgfHwgcG9pbnRFcXVhbChwb2ludDEsIHBvaW50MikpXG4gICAgICAgICAgICBwb2ludDFbMl0gPSAxO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgLy8gb3V0c2lkZSBnb2luZyBpblxuICAgICAgICAgICAgc3RyZWFtLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgcG9pbnQyID0gaW50ZXJzZWN0KHBvaW50MSwgcG9pbnQwKTtcbiAgICAgICAgICAgIHN0cmVhbS5wb2ludChwb2ludDJbMF0sIHBvaW50MlsxXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIGluc2lkZSBnb2luZyBvdXRcbiAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgICBzdHJlYW0ucG9pbnQocG9pbnQyWzBdLCBwb2ludDJbMV0sIDIpO1xuICAgICAgICAgICAgc3RyZWFtLmxpbmVFbmQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcG9pbnQwID0gcG9pbnQyO1xuICAgICAgICB9IGVsc2UgaWYgKG5vdEhlbWlzcGhlcmUgJiYgcG9pbnQwICYmIHNtYWxsUmFkaXVzIF4gdikge1xuICAgICAgICAgIHZhciB0O1xuICAgICAgICAgIC8vIElmIHRoZSBjb2RlcyBmb3IgdHdvIHBvaW50cyBhcmUgZGlmZmVyZW50LCBvciBhcmUgYm90aCB6ZXJvLFxuICAgICAgICAgIC8vIGFuZCB0aGVyZSB0aGlzIHNlZ21lbnQgaW50ZXJzZWN0cyB3aXRoIHRoZSBzbWFsbCBjaXJjbGUuXG4gICAgICAgICAgaWYgKCEoYyAmIGMwKSAmJiAodCA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCwgdHJ1ZSkpKSB7XG4gICAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgICBpZiAoc21hbGxSYWRpdXMpIHtcbiAgICAgICAgICAgICAgc3RyZWFtLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBzdHJlYW0ucG9pbnQodFswXVswXSwgdFswXVsxXSk7XG4gICAgICAgICAgICAgIHN0cmVhbS5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgc3RyZWFtLmxpbmVFbmQoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHN0cmVhbS5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgc3RyZWFtLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgc3RyZWFtLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBzdHJlYW0ucG9pbnQodFswXVswXSwgdFswXVsxXSwgMyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh2ICYmICghcG9pbnQwIHx8ICFwb2ludEVxdWFsKHBvaW50MCwgcG9pbnQxKSkpIHtcbiAgICAgICAgICBzdHJlYW0ucG9pbnQocG9pbnQxWzBdLCBwb2ludDFbMV0pO1xuICAgICAgICB9XG4gICAgICAgIHBvaW50MCA9IHBvaW50MSwgdjAgPSB2LCBjMCA9IGM7XG4gICAgICB9LFxuICAgICAgbGluZUVuZDogZnVuY3Rpb24oKSB7XG4gICAgICAgIGlmICh2MCkgc3RyZWFtLmxpbmVFbmQoKTtcbiAgICAgICAgcG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gcmV0dXJuO1xuXG4gIGNsaXAuc29ydChjb21wYXJlSW50ZXJzZWN0aW9uKTtcbiAgbGluayhzdWJqZWN0KTtcbiAgbGluayhjbGlwKTtcblxuICBmb3IgKGkgPSAwLCBuID0gY2xpcC5sZW5ndGg7IGkgPCBuOyArK2kpIHtcbiAgICBjbGlwW2ldLmUgPSBzdGFydEluc2lkZSA9ICFzdGFydEluc2lkZTtcbiAgfVxuXG4gIHZhciBzdGFydCA9IHN1YmplY3RbMF0sXG4gICAgICBwb2ludHMsXG4gICAgICBwb2ludDtcblxuICB3aGlsZSAoMSkge1xuICAgIC8vIEZpbmQgZmlyc3QgdW52aXNpdGVkIGludGVyc2VjdGlvbi5cbiAgICB2YXIgY3VycmVudCA9IHN0YXJ0LFxuICAgICAgICBpc1N1YmplY3QgPSB0cnVlO1xuICAgIHdoaWxlIChjdXJyZW50LnYpIGlmICgoY3VycmVudCA9IGN1cnJlbnQubikgPT09IHN0YXJ0KSByZXR1cm47XG4gICAgcG9pbnRzID0gY3VycmVudC56O1xuICAgIHN0cmVhbS5saW5lU3RhcnQoKTtcbiAgICBkbyB7XG4gICAgICBjdXJyZW50LnYgPSBjdXJyZW50Lm8udiA9IHRydWU7XG4gICAgICBpZiAoY3VycmVudC5lKSB7XG4gICAgICAgIGlmIChpc1N1YmplY3QpIHtcbiAgICAgICAgICBmb3IgKGkgPSAwLCBuID0gcG9pbnRzLmxlbmd0aDsgaSA8IG47ICsraSkgc3RyZWFtLnBvaW50KChwb2ludCA9IHBvaW50c1tpXSlbMF0sIHBvaW50WzFdKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpbnRlcnBvbGF0ZShjdXJyZW50LngsIGN1cnJlbnQubi54LCAxLCBzdHJlYW0pO1xuICAgICAgICB9XG4gICAgICAgIGN1cnJlbnQgPSBjdXJyZW50Lm47XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoaXNTdWJqZWN0KSB7XG4gICAgICAgICAgcG9pbnRzID0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Zyb20gXCIuL21hdGguanNcIjtcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oYSwgYikge1xuICB2YXIgeDAgPSBhWzBdICogcmFkaWFucyxcbiAgICAgIHkwID0gYVsxXSAqIHJhZGlhbnMsXG4gICAgICB4MSA9IGJbMF0gKiByYWRpYW5zLFxuICAgICAgeTEgPSBiWzFdICogcmFkaWFucyxcbiAgICAgIGN5MCA9IGNvcyh5MCksXG4gICAgICBzeTAgPSBzaW4oeTApLFxuICAgICAgY3kxID0gY29zKHkxKSxcbiAgICAgIHN5MSA9IHNpbih5MSksXG4gICAgICBreDAgPSBjeTAgKiBjb3MoeDApLFxuICAgICAga3kwID0gY3kwICogc2luKHgwKSxcbiAgICAgIGt4MSA9IGN5MSAqIGNvcyh4MSksXG4gICAgICBreTEgPSBjeTEgKiBzaW4oeDEpLFxuICAgICAgZCA9IDIgKiBhc2luKHNxcnQoaGF2ZXJzaW4oeTEgLSB5MCkgKyBjeTAgKiBjeTEgKiBoYXZlcnNpbih4MSAtIHgwKSkpLFxuICAgICAgayA9IHNpbihkKTtcblxuICB2YXIgaW50ZXJwb2xhdGUgPSBkID8gZnVuY3Rpb24odCkge1xuICAgIHZhciBCID0gc2luKHQgKj0gZCkgLyBrLFxuICAgICAgICBBID0gc2luKGQgLSB0KSAvIGssXG4gICAgICAgIHggPSBBICoga3gwICsgQiAqIGt4MSxcbiAgICAgICAgeSA9IEEgKiBreTAgKyBCICoga3kxLFxuICAgICAgICB6ID0gQSAqIHN5MCArIEIgKiBzeTE7XG4gICAgcmV0dXJuIFtcbiAgICAgIGF0YW4yKHksIHgpICogZGVncmVlcyxcbiAgICAgIGF0YW4yKHosIHNxcnQoeCAqIHggKyB5ICogeSkpICogZGVncmVlc1xuICAgIF07XG4gIH0gOiBmdW5jdGlvbigpIHtcbiAgICByZXR1cm4gW3gwICogZGVncmVlcywgeTAgKiBkZWdyZWVzXTtcbiAgfTtcblxuICBpbnRlcnBvbGF0ZS5kaXN0YW5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jRBcnJheShuKTtcblxuICAgICAgICB0aGlzLnVwZGF0ZSgpO1xuICAgIH1cblxuICAgIHVwZGF0ZSgpIHtcbiAgICAgICAgY29uc3Qge2Nvb3JkcywgX2h1bGxQcmV2OiBodWxsUHJldiwgX2h1bGxOZXh0OiBodWxsTmV4dCwgX2h1bGxUcmk6IGh1bGxUcmksIF9odWxsSGFzaDogaHVsbEhhc2h9ID0gIHRoaXM7XG4gICAgICAgIGNvbnN0IG4gPSBjb29yZHMubGVuZ3RoID4+IDE7XG5cbiAgICAgICAgLy8gcG9wdWxhdGUgYW4gYXJyYXkgb2YgcG9pbnQgaW5kaWNlczsgY2FsY3VsYXRlIGlucHV0IGRhdGEgYmJveFxuICAgICAgICBsZXQgbWluWCA9IEluZmluaXR5O1xuICAgICAgICBsZXQgbWluWSA9IEluZmluaXR5O1xuICAgICAgICBsZXQgbWF4WCA9IC1JbmZpbml0eTtcbiAgICAgICAgbGV0IG1heFkgPSAtSW5maW5pdHk7XG5cbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBuOyBpKyspIHtcbiAgICAgICAgICAgIGNvbnN0IHggPSBjb29yZHNbMiAqIGldO1xuICAgICAgICAgICAgY29uc3QgeSA9IGNvb3Jkc1syICogaSArIDFdO1xuICAgICAgICAgICAgaWYgKHggPCBtaW5YKSBtaW5YID0geDtcbiAgICAgICAgICAgIGlmICh5IDwgbWluWSkgbWluWSA9IHk7XG4gICAgICAgICAgICBpZiAoeCA+IG1heFgpIG1heFggPSB4O1xuICAgICAgICAgICAgaWYgKHkgPiBtYXhZKSBtYXhZID0geTtcbiAgICAgICAgICAgIHRoaXMuX2lkc1tpXSA9IGk7XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgY3ggPSAobWluWCArIG1heFgpIC8gMjtcbiAgICAgICAgY29uc3QgY3kgPSAobWluWSArIG1heFkpIC8gMjtcblxuICAgICAgICBsZXQgbWluRGlzdCA9IEluZmluaXR5O1xuICAgICAgICBsZXQgaTAsIGkxLCBpMjtcblxuICAgICAgICAvLyBwaWNrIGEgc2VlZCBwb2ludCBjbG9zZSB0byB0aGUgY2VudGVyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbjsgaSsrKSB7XG4gICAgICAgICAgICBjb25zdCBkID0gZGlzdChjeCwgY3ksIGNvb3Jkc1syICogaV0sIGNvb3Jkc1syICogaSArIDFdKTtcbiAgICAgICAgICAgIGlmIChkIDwgbWluRGlzdCkge1xuICAgICAgICAgICAgICAgIGkwID0gaTtcbiAgICAgICAgICAgICAgICBtaW5EaXN0ID0gZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjb25zdCBpMHggPSBjb29yZHNbMiAqIGkwXTtcbiAgICAgICAgY29uc3QgaTB5ID0gY29vcmRzWzIgKiBpMCArIDFdO1xuXG4gICAgICAgIG1pbkRpc3QgPSBJbmZpbml0eTtcblxuICAgICAgICAvLyBmaW5kIHRoZSBwb2ludCBjbG9zZXN0IHRvIHRoZSBzZWVkXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbjsgaSsrKSB7XG4gICAgICAgICAgICBpZiAoaSA9PT0gaTApIGNvbnRpbnVlO1xuICAgICAgICAgICAgY29uc3QgZCA9IGRpc3QoaTB4LCBpMHksIGNvb3Jkc1syICogaV0sIGNvb3Jkc1syICogaSArIDFdKTtcbiAgICAgICAgICAgIGlmIChkIDwgbWluRGlzdCAmJiBkID4gMCkge1xuICAgICAgICAgICAgICAgIGkxID0gaTtcbiAgICAgICAgICAgICAgICBtaW5EaXN0ID0gZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgaTF4ID0gY29vcmRzWzIgKiBpMV07XG4gICAgICAgIGxldCBpMXkgPSBjb29yZHNbMiAqIGkxICsgMV07XG5cbiAgICAgICAgbGV0IG1pblJhZGl1cyA9IEluZmluaXR5O1xuXG4gICAgICAgIC8vIGZpbmQgdGhlIHRoaXJkIHBvaW50IHdoaWNoI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pO1xuICAgICAgICAgICAgbGV0IGogPSAwO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDAsIGQwID0gLUluZmluaXR5OyBpIDwgbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgaWQgPSB0aGlzLl9pZHNbaV07XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuX2Rpc3RzW2lkXSA+IGQwKSB7XG4gICAgICAgICAgICAgICAgICAgIGh1bGxbaisrXSA9IGlkO1xuICAgICAgICAgICAgICAgICAgICBkMCA9IHRoaXMuX2Rpc3RzW2lkXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLmh1bGwgPSBodWxsLnN1YmFycmF5KDAsIGopO1xuICAgICAgICAgICAgdGhpcy50cmlhbmdsZXMgPSBuZXcgVWludDMyQXJyYXkoMCk7XG4gICAgICAgICAgICB0aGlzLmhhbGZlZGdlcyA9IG5ldyBVaW50MzJBcnJheSgwKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHN3YXAgdGhlIG9yZGVyIG9mIHRoZSBzZWVkIHBvaW50cyBmb3IgY291bnRlci1jbG9ja3dpc2Ugb3JpZW50YXRpb25cbiAgICAgICAgaWYgKG9yaWVudDJkKGkweCwgaTB5LCBpMXgsIGkxeSwgaTJ4LCBpMnkpIDwgMCkge1xuICAgICAgICAgICAgY29uc3QgaSA9IGkxO1xuICAgICAgICAgICAgY29uc3QgeCA9IGkxeDtcbiAgICAgICAgICAgIGNvbnN0IHkgPSBpMXk7XG4gICAgICAgICAgICBpMSA9IGkyO1xuICAgICAgICAgICAgaTF4ID0gaTJ4O1xuICAgICAgICAgICAgaTF5ID0gaTJ5O1xuICAgICAgICAgICAgaTIgPSBpO1xuICAgICAgICAgICAgaTJ4ID0geDtcbiAgICAgICAgICAgIGkyeSA9IHk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBjZW50ZXIgPSBj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pMTtcbiAgICAgICAgaHVsbEhhc2hbdGhpcy5faGFzaEtleShpMngsIGkyeSldID0gaTI7XG5cbiAgICAgICAgdGhpcy50cmlhbmdsZXNMZW4gPSAwO1xuICAgICAgICB0aGlzLl9hZGRUcmlhbmdsZShpMCwgaTEsIGkyLCAtMSwgLTEsIC0xKTtcblxuICAgICAgICBmb3IgKGxldCBrID0gMCwgeHAsIHlwOyBrIDwgdGhpcy5faWRzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBjb25zdCBpID0gdGhpcy5faWRzW2tdO1xuICAgICAgICAgICAgY29uc3QgeCA9IGNvb3Jkc1syICogaV07XG4gICAgICAgICAgICBjb25zdCB5ID0gY29vcmRzWzIgKiBpICsgMV07XG5cbiAgICAgICAgICAgIC8vIHNraXAgbmVhci1kdXBsaWNhdGUgcG9pbnRzXG4gICAgICAgICAgICBpZiAoayA+IDAgJiYgTWF0aC5hYnMoeCAtIHhwKSA8PSBFUFNJTE9OICYmIE1hdGguYWJzKHkgLSB5cCkgPD0gRVBTSUxPTikgY29udGludWU7XG4gICAgICAgICAgICB4cCA9IHg7XG4gICAgICAgICAgICB5cCA9IHk7XG5cbiAgICAgICAgICAgIC8vIHNraXAgc2VlZCB0cmlhbmdsZSBwb2ludHNcbiAgICAgICAgICAgIGlmIChpID09PSBpMCB8fCBpID09PSBpMSB8fCBpID09PSBpMikgY29udGludWU7XG5cbiAgICAgICAgICAgIC8vIGZpbmQgYSB2aXNpYmxlIGVkZ2Ugb24gdGhlIGNvbnZleCBodWxsIHVzaW5nIGVkZ2UgaGFzaFxuICAgICAgICAgICAgbGV0IHN0YXJ0ID0gMDtcbiAgICAgICAgICAgIGZvciAobGV0IGogPSAwLCBrZXkgPSB0aGlzLl9oYXNoS2V5KHgsIHkpOyBqIDwgdGhpcy5faGFzaFNpemU7IGorKykge1xuICAgICAgICAgICAgICAgIHN0YXJ0ID0gaHVsbEhhc2hbKGtleSArIGopICUgdGhpcy5faGFzaFNpemVdO1xuICAgICAgICAgICAgICAgIGlmIChzdGFydCAhPT0gLTEgJiYgc3RhcnQgIT09IGh1bGxOZXh0W3N0YXJ0XSkgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHN0YXJ0ID0gaHVsbFByZXZbc3RhcnRdO1xuICAgICAgICAgICAgbGV0IGUgPSBzdGFydCwgcTtcbiAgICAgICAgICAgIHdoaWxlIChxID0gaHVsbE5leHRbZV0sIG9yaWVudDJkKHgsIHksIGNvb3Jkc1syICogZV0sIGNvb3Jkc1syICogZSArIDFdLCBjb29yZHNbMiAqIHFdLCBjb29yZHNbMiAqIHEgKyAxXSkgPj0gMCkge1xuICAgICAgICAgICAgICAgIGUgPSBxO1xuICAgICAgICAgICAgICAgIGlmIChlID09PSBzdGFydCkge1xuICAgICAgICAgICAgICAgICAgICBlID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChlID09PSAtMSkgY29udGludWU7IC8vIGxpa2VseSBhIG5lYXItZHVwbGljYXRlIHBvaW50OyBza2lwIGl0XG5cbiAgICAgICAgICAgIC8vIGFkZCB0aGUgZmlyc3QgdHJpYW5nbGUgZnJvbSB0aGUgcG9pbnRcbiAgICAgICAgICAgIGxldCB0ID0gdGhpcy5fYWRkVHJpYW5nbGUoZSwgaSwgaHVsbE5leHRbZV0sIC0xLCAtMSwgaHVsbFRyaVtlXSk7XG5cbiAgICAgICAgICAgIC8vIHJlY3Vyc2l2ZWx5IGZsaXAgdHJpYW5nbGVzIGZyb20gdGhlIHBvaW50IHVudGlsIHRoZXkgc2F0aXNmeSB0aGUgRGVsYXVuYXkgY29uZGl0aW9uXG4gICAgICAgICAgICBodWxsVHJpW2ldID0gdGhpcy5fbGVnYWxpemUodCArIDIpO1xuICAgICAgICAgICAgaHVsbFRyaVtlXSA9IHQ7IC8vIGtlZXAgdHJhY2sgb2YgYm91bmRhcnkgdHJpYW5nbGVzIG9uIHRoZSBodWxsXG4gICAgICAgICAgICBodWxsU2l6ZSsrO1xuXG4gICAgICAgICAgICAvLyB3YWxrIGZvcndhcmQgdGhyb3VnaCB0aGUgaHVsbCwgYWRkaW5nIG1vcmUgdHJpYW5nbGVzIGFuZCBmbGlwcGluZyByZWN1cnNpdmVseVxuICAgICAgICAgICAgbGV0IG4gPSBodWxsTmV4dFtlXTtcbiAgICAgICAgICAgIHdoaWxlIChxID0gaHVsbE5leHRbbl0sIG9yaWVudDJkKHgsIHksIGNvb3Jkc1syICogbl0sIGNvb3Jkc1syICogbiArIDFdLCBjb29yZHNbMiAqIHFdLCBjb29yZHNbMiAqIHEgKyAxXSkgPCAwKSB7XG4gICAgICAgICAgICAgICAgdCA9IHRoaXMuX2FkZFRyaWFuZ2xlKG4sIGksIHEsIGh1bGxUcmlbaV0sIC0xLCBodWxsVHJpW25dKTtcbiAgICAgICAgICAgICAgICBodWxsVHJpW2ldID0gdGhpcy5fbGVnYWxpemUodCArIDIpO1xuICAgICAgICAgICAgICAgIGh1bGxOZXh0W25dID0gbjsgLy8gbWFyayBhcyByZW1vdmVkXG4gICAgICAgICAgICAgICAgaHVsbFNpemUtLTtcbiAgICAgICAgICAgICAgICBuID0gcTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gd2FsayBiYWNrd2FyZCBmcm9tIHRoZSBvdGhlciBzaWRlLCBhZGRpbmcgbW9yZSB0cmlhbmdsZXMgYW5kIGZsaXBwaW5nXG4gICAgICAgICAgICBpZiAoZSA9PT0gc3RhcnQpIHtcbiAgICAgICAgICAgICAgICB3aGlsZSAocSA9IGh1bGxQcmV2W2VdLCBvcmllbnQyZCh4LCB5LCBjb29yZHNbMiAqIHFdLCBjb29yZHNbMiAqIHEgKyAxXSwgY29vcmRzWzIgKiBlXSwgY29vcmRzWzIgKiBlICsgMV0pIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICB0ID0gdGhpcy5fYWRkVHJpYW5nbGUocSwgaSwgZSwgLTEsIGh1bGxUcmlbZV0sIGh1bGxUcmlbcV0pO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9sZWdhbGl6ZSh0ICsgMik7XG4gICAgICAgICAgICAgICAgICAgIGh1bGxUcmlbcV0gPSB0O1xuICAgICAgICAgICAgICAgICAgICBodWxsTmV4dFtlXSA9IGU7IC8vIG1hcmsgYXMgcmVtb3ZlZFxuICAgICAgICAgICAgICAgICAgICBodWxsU2l6ZS0tO1xuICAgICAgICAgICAgICAgICAgICBlID0gcTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIHVwZGF0ZSB0aGUgaHVsbCBpbmRpY2VzXG4gICAgICAgICAgICB0aGlzLl9odWxsU3RhcnQgPSBodWxsUHJldltpXSA9IGU7XG4gICAgICAgICAgICBodWxsTmV4dFtlXSA9IGh1bGxQcmV2W25dID0gaTtcbiAgICAgICAgICAgIGh1bGxOZXh0W2ldID0gbjtcblxuICAgICAgICAgICAgLy8gc2F2ZSB0aGUgdHdvIG5ldyBlZGdlcyBpbiB0aGUgaGFzaCB0YWJsZVxuICAgICAgICAgICAgaHVsbEhhc2hbdGhpcy5faGFzaEtleSh4LCB5KV0gPSBpO1xuICAgICAgICAgICAgaHVsbEhhc2hbdGhpcy5faGFzaEtleShjb29yZHNbMiAqIGVdLCBjb29yZHNbMiAqIGUgKyAxXSldID0gZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuaHVsbCA9IG5ldyBVaW50MzJBcnJheShodWxsU2l6ZSk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwLCBlID0gdGhpcy5faHVsbFN0YXJ0OyBpIDwgaHVsbFNpemU7IGkrKykge1xuICAgICAgICAgICAgdGhpcy5odWxsW2ldID0gZTtcbiAgICAgICAgICAgIGUgPSBodWxsTmV4dFtlXTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHRyaW0gdHlwZWQgdHJpYW5nbGU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gICAgICAgKlxuICAgICAgICAgICAgICogICAgICAgICAgIHBsICAgICAgICAgICAgICAgICAgICBwbFxuICAgICAgICAgICAgICogICAgICAgICAgL3x8XFwgICAgICAgICAgICAgICAgICAvICBcXFxuICAgICAgICAgICAgICogICAgICAgYWwvIHx8IFxcYmwgICAgICAgICAgICBhbC8gICAgXFxhXG4gICAgICAgICAgICAgKiAgICAgICAgLyAgfHwgIFxcICAgICAgICAgICAgICAvICAgICAgXFxcbiAgICAgICAgICAgICAqICAgICAgIC8gIGF8fGIgIFxcICAgIGZsaXAgICAgL19fX2FyX19fXFxcbiAgICAgICAgICAgICAqICAgICBwMFxcICAgfHwgICAvcDEgICA9PiAgIHAwXFwtLS1ibC0tLS9wMVxuICAgICAgICAgICAgICogICAgICAgIFxcICB8fCAgLyAgICAgICAgICAgICAgXFwgICAgICAvXG4gICAgICAgICAgICAgKiAgICAgICBhclxcIHx8IC9iciAgICAgICAgICAgICBiXFwgICAgL2JyXG4gICAgICAgICAgICAgKiAgICAgICAgICBcXHx8LyAgICAgICAgICAgICAgICAgIFxcICAvXG4gICAgICAgICAgICAgKiAgICAgICAgICAgcHIgICAgICAgICAgICAgICAgICAgIHByXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGNvbnN0IGEwID0gYSAtIGEgJSAzO1xuICAgICAgICAgICAgYXIgPSBhMCArIChhICsgMikgJSAzO1xuXG4gICAgICAgICAgICBpZiAoYiA9PT0gLTEpIHsgLy8gY29udmV4IGh1bGwgZWRnZVxuICAgICAgICAgICAgICAgIGlmIChpID09PSAwKSBicmVhaztcbiAgICAgICAgICAgICAgICBhID0gRURHRV9TVEFDS1stLWldO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBiMCA9IGIgLSBiICUgMztcbiAgICAgICAgICAgIGNvbnN0IGFsID0gYTAgKyAoYSArIDEpICUgMztcbiAgICAgICAgICAgIGNvbnN0IGJsID0gYjAgKyAoYiArIDIpICUgMztcblxuICAgICAgICAgICAgY29uc3QgcDAgPSB0cmlhbmdsZXNbYXJdO1xuICAgICAgICAgICAgY29uc3QgcHIgPSB0cmlhbmdsZXNbYV07XG4gICAgICAgICAgICBjb25zdCBwbCA9IHRyaWFuZ2xlc1thbF07XG4gICAgICAgICAgICBjb25zdCBwMSA9IHRyaWFuZ2xlc1tibF07XG5cbiAgICAgICAgICAgIGNvbnN0IGlsbGVnYWwgPSBpbkNpcmNsZShcbiAgICAgICAgICAgICAgICBjb29yZHNbMiAqIHAwXSwgY29vcmRzWzIgKiBwMCArIDFdLFxuICAgICAgICAgICAgICAgIGNvb3Jkc1syICogcHJdLCBjb29yZHNbMiAqIHByICsgMV0sXG4gICAgICAgICAgICAgICAgY29vcmRzWzIgKiBwbF0sIGNvb3Jkc1syICogcGwgKyAxXSxcbiAgICAgICAgICAgICAgICBjb29yZHNbMiAqIHAxXSwgY29vcmRzWzIgKiBwMSArIDFdKTtcblxuICAgICAgICAgICAgaWYgKGlsbGVnYWwpIHtcbiAgICAgICAgICAgICAgICB0cmlhbmdsZXNbYV0gPSBwMTtcbiAgICAgICAgICAgICAgICB0cmlhbmdsZXNbYl0gPSBwMDtcblxuICAgICAgICAgICAgICAgIGNvbnN0IGhibCA9IGhhbGZlZGdlc1tibF07XG5cbiAgICAgICAgICAgICAgICAvLyBlZGdlIHN3YXBwZWQgb24gdGhlIG90aGVyIHNpZGUgb2YgdGhlIGh1bGwgKHJhcmUpOyBmaXggdGhlIGhhbGZlZGdlIHJlZmVyZW5jZVxuICAgICAgICAgICAgICAgIGlmIChoYmwgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBlID0gdGhpcy5faHVsbFN0YXJ0O1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5faHVsbFRyaVtlXSA9PT0gYmwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9odWxsVHJpW2VdID0gYTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSB0aGlzLl9odWxsUHJldltlXTtcbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoZSAhPT0gdGhpcy5faHVsbFN0YXJ0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5fbGluayhhLCBoYmwpO1xuICAgICAgICAgICAgICAgIHRoaXMuX2xpbmsoYiwgaGFsZmVkZ2VzW2FyXSk7XG4gICAgICAgICAgICAgICAgdGhpcy5fbGluayhhciwgYmwpO1xuXG4gICAgICAgICAgICAgICAgY29uc3QgYnIgPSBiMCArIChiICsgMSkgJSAzO1xuXG4gICAgICAgICAgICAgICAgLy8gZG9uJ3Qgd29ycnkgYWJvdXQgaGl0dGluZyB0aGUgY2FwOiBpdCBjYW4gb25seSBoYXBwZW4gb24gZXh0cmVtZWx5IGRlZ2VuZXJhdGUgaW5wdXRcbiAgICAgICAgICAgICAgICBpZiAoaSA8IEVER0VfU1RBQ0subGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIEVER0VfU1RBQ0tbaSsrXSA9IGJyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGkgPT09IDApIGJyZWFrO1xuICAgICAgICAgICAgICAgIGEgPSBFREdFX1NUQUNLWy0taV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gYXI7XG4gICAgfVxuXG4gICAgX2xpbmsoYSwgYikge1xuICAgICAgICB0aGlzLl9oYWxmZWRnZXNbYV0gPSBiO1xuICAgICAgICBpZiAoYiAhPT0gLTEpIHRoaXMuX2hhbGZlZGdlc1tiXSA9IGE7XG4gICAgfVxuXG4gICAgLy8gYWRkIGEgbmV3IHRya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iAgICAgICAgICAgIHVbMl0gPSBfaiAtICh1MyAtIGJ2aXJ0KSArIChfaSAtIGJ2aXJ0KTtcbiAgICAgICAgICAgIHVbM10gPSB1MztcbiAgICAgICAgICAgIHMxID0gY2R4dGFpbCAqIC1iZHk7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBjZHh0YWlsO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0gY2R4dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSBjZHh0YWlsIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogLWJkeTtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIC1iZHkpO1xuICAgICAgICAgICAgYmxvID0gLWJkeSAtIGJoaTtcbiAgICAgICAgICAgIHMwID0gYWxvICogYmxvIC0gKHMxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIHQxID0gY2R4ICogLWJkeXRhaWw7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBjZHg7XG4gICAgICAgICAgICBhaGkgPSBjIC0gKGMgLSBjZHgpO1xuICAgICAgICAgICAgYWxvID0gY2R4IC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogLWJkeXRhaWw7XG4gICAgICAgICAgICBiaGkgPSBjIC0gKGMgLSAtYmR5dGFpbCk7XG4gICAgICAgICAgICBibG8gPSAtYmR5dGFpbCAtIGJoaTtcbiAgICAgICAgICAgIHQwID0gYWxvICogYmxvIC0gKHQxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIF9pID0gczAgKyB0MDtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2kgLSBzMDtcbiAgICAgICAgICAgIHZbMF0gPSBzMCAtIChfaSAtIGJ2aXJ0KSArICh0MCAtIGJ2aXJ0KTtcbiAgICAgICAgICAgIF9qID0gczEgKyBfaTtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2ogLSBzMTtcbiAgICAgICAgICAgIF8wID0gczEgLSAoX2ogLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBfaSA9IF8wICsgdDE7XG4gICAgICAgICAgICBidmlydCA9IF9pIC0gXzA7XG4gICAgICAgICAgICB2WzFdID0gXzAgLSAoX2kgLSBidmlydCkgKyAodDEgLSBidmlydCk7XG4gICAgICAgICAgICB1MyA9IF9qICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IHUzIC0gX2o7XG4gICAgICAgICAgICB2WzJdID0gX2ogLSAodTMgLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICB2WzNdID0gdTM7XG4gICAgICAgICAgICBiY3RsZW4gPSBzdW0oNCwgdSwgNCwgdiwgYmN0KTtcbiAgICAgICAgICAgIHMxID0gYmR4dGFpbCAqIGNkeXRhaWw7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBiZHh0YWlsO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0gYmR4dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSBiZHh0YWlsIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogY2R5dGFpbDtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGNkeXRhaWwpO1xuICAgICAgICAgICAgYmxvID0gY2R5dGFpbCAtIGJoaTtcbiAgICAgICAgICAgIHMwID0gYWxvICogYmxvIC0gKHMxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIHQxID0gY2R4dGFpbCAqIGJkeXRhaWw7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBjZHh0YWlsO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0gY2R4dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSBjZHh0YWlsIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogYmR5dGFpbDtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGJkeXRhaWwpO1xuICAgICAgICAgICAgYmxvID0gYmR5dGFpbCAtIGJoaTtcbiAgICAgICAgICAgIHQwID0gYWxvICogYmxvIC0gKHQxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIF9pID0gczAgLSB0MDtcbiAgICAgICAgICAgIGJ2aXJ0ID0gczAgLSBfaTtcbiAgICAgICAgICAgIGJjdHRbMF0gPSBzMCAtIChfaSArIGJ2aXJ0KSArIChidmlydCAtIHQwKTtcbiAgICAgICAgICAgIF9qID0gczEgKyBfaTtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2ogLSBzMTtcbiAgICAgICAgICAgIF8wID0gczEgLSAoX2ogLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBfaSA9IF8wIC0gdDE7XG4gICAgICAgICAgICBidmlydCA9IF8wIC0gX2k7XG4gICAgICAgICAgICBiY3R0WzFdID0gXzAgLSAoX2kgKyBidmlydCkgKyAoYnZpcnQgLSB0MSk7XG4gICAgICAgICAgICB1MyA9IF9qICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IHUzIC0gX2o7XG4gICAgICAgICAgICBiY3R0WzJdID0gX2ogLSAodTMgLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBiY3R0WzNdID0gdTM7XG4gICAgICAgICAgICBiY3R0bGVuID0gNDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGJjdFswXSA9IDA7XG4gICAgICAgICAgICBiY3RsZW4gPSAxO1xuICAgICAgICAgICAgYmN0dFswXSA9IDA7XG4gICAgICAgICAgICBiY3R0bGVuID0gMTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYWR4dGFpbCAhPT0gMCkge1xuICAgICAgICAgICAgY29uc3QgbGVuID0gc2NhbGUoYmN0bGVuLCBiY3Qs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0KSArIChfaSAtIGJ2aXJ0KTtcbiAgICAgICAgICAgIHVbM10gPSB1MztcbiAgICAgICAgICAgIG4xID0gLWNkeTtcbiAgICAgICAgICAgIG4wID0gLWNkeXRhaWw7XG4gICAgICAgICAgICBzMSA9IGFkeHRhaWwgKiBuMTtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIGFkeHRhaWw7XG4gICAgICAgICAgICBhaGkgPSBjIC0gKGMgLSBhZHh0YWlsKTtcbiAgICAgICAgICAgIGFsbyA9IGFkeHRhaWwgLSBhaGk7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBuMTtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIG4xKTtcbiAgICAgICAgICAgIGJsbyA9IG4xIC0gYmhpO1xuICAgICAgICAgICAgczAgPSBhbG8gKiBibG8gLSAoczEgLSBhaGkgKiBiaGkgLSBhbG8gKiBiaGkgLSBhaGkgKiBibG8pO1xuICAgICAgICAgICAgdDEgPSBhZHggKiBuMDtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIGFkeDtcbiAgICAgICAgICAgIGFoaSA9IGMgLSAoYyAtIGFkeCk7XG4gICAgICAgICAgICBhbG8gPSBhZHggLSBhaGk7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBuMDtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIG4wKTtcbiAgICAgICAgICAgIGJsbyA9IG4wIC0gYmhpO1xuICAgICAgICAgICAgdDAgPSBhbG8gKiBibG8gLSAodDEgLSBhaGkgKiBiaGkgLSBhbG8gKiBiaGkgLSBhaGkgKiBibG8pO1xuICAgICAgICAgICAgX2kgPSBzMCArIHQwO1xuICAgICAgICAgICAgYnZpcnQgPSBfaSAtIHMwO1xuICAgICAgICAgICAgdlswXSA9IHMwIC0gKF9pIC0gYnZpcnQpICsgKHQwIC0gYnZpcnQpO1xuICAgICAgICAgICAgX2ogPSBzMSArIF9pO1xuICAgICAgICAgICAgYn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tcbiAgICBkZXQgKz1cbiAgICAgICAgKCgoYmV4ICogYmV4ICsgYmV5ICogYmV5ICsgYmV6ICogYmV6KSAqICgoY2V6ICogZGFlcHMgKyBkZXogKiBhY2VwcyArIGFleiAqIGNkZXBzKSArXG4gICAgICAgIChjZXp0YWlsICogZGEzICsgZGV6dGFpbCAqIGFjMyArIGFlenRhaWwgKiBjZDMpKSArIChkZXggKiBkZXggKyBkZXkgKiBkZXkgKyBkZXogKiBkZXopICpcbiAgICAgICAgKChhZXogKiBiY2VwcyAtIGJleiAqIGFjZXBzICsgY2V6ICogYWJlcHMpICsgKGFlenRhaWwgKiBiYzMgLSBiZXp0YWlsICogYWMzICsgY2V6dGFpbCAqIGFiMykpKSAtXG4gICAgICAgICgoYWV4ICogYWV4ICsgYWV5ICogYWV5ICsgYWV6ICogYWV6KSAqICgoYmV6ICogY2RlcHMgLSBjZXogKiBiZGVwcyArIGRleiAqIGJjZXBzKSArXG4gICAgICAgIChiZXp0YWlsICogY2QzIC0gY2V6dGFpbCAqIGJkMyArIGRlenRhaWwgKiBiYzMpKSArIChjZXggKiBjZXggKyBjZXkgKiBjZXkgKyBjZXogKiBjZXopICpcbiAgICAgICAgKChkZXogKiBhYmVwcyArIGFleiAqIGJkZXBzICsgYmV6ICogZGFlcHMpICsgKGRlenRhaWwgKiBhYjMgKyBhZXp0YWlsICogYmQzICsgYmV6dGFpbCAqIGRhMykpKSkgK1xuICAgICAgICAyICogKCgoYmV4ICogYmV4dGFpbCArIGJleSAqIGJleXRhaWwgKyBiZXogKiBiZXp0YWlsKSAqIChjZXogKiBkYTMgKyBkZXogKiBhYzMgKyBhZXogKiBjZDMpICtcbiAgICAgICAgKGRleCAqIGRleHRhaWwgKyBkZXkgKiBkZXl0YWlsICsgZGV6ICogZGV6dGFpbCkgKiAoYWV6ICogYmMzIC0gYmV6ICogYWMzICsgY2V6ICogYWIzKSkgLVxuICAgICAgICAoKGFleCAqIGFleHRhaWwgKyBhZXkgKiBhZXl0YWlsICsgYWV6ICogYWV6dGFpbCkgKiAoYmV6ICogY2QzIC0gY2V6ICogYmQzICsgZGV6ICogYmMzKSArXG4gICAgICAgIChjZXggKiBjZXh0YWlsICsgY2V5ICogY2V5dGFpbCArIGNleiAqIGNlenRhaWwpICogKGRleiAqIGFiMyArIGFleiAqIGJkMyArIGJleiAqIGRhMykpKTtcblxuICAgIGlmIChkZXQgPj0gZXJyYm91bmQgfHwgLWRldCA+PSBlcnJib3VuZCkge1xuICAgICAgICByZXR1cm4gZGV0O1xuICAgIH1cblxuICAgIHJldHVybiBpbnNwaGVyZWV4YWN0KGF4LCBheSwgYXosIGJ4LCBieSwgYnosIGN4LCBjeSwgY3osIGR4LCBkeSwgZHosIGV4LCBleSwgZXopO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gaW5zcGhlcmUoYXgsIGF5LCBheiwgYngsIGJ5LCBieiwgY3gsIGN5LCBjeiwgZHgsIGR5LCBkeiwgZXgsIGV5LCBleikge1xuICAgIGNvbnN0IGFleCA9IGF4IC0gZXg7XG4gICAgY29uc3QgYmV4ID0gYnggLSBleDtcbiAgICBjb25zdCBjZXggPSBjeCAtIGV4O1xuICAgIGNvbnN0IGRleCA9IGR4IC0gZXg7XG4gICAgY29uc3QgYWV5ID0gYXkgLSBleTtcbiAgICBjb25zdCBiZXkgPSBieSAtIGV5O1xuICAgIGNvbnN0IGNleSA9IGN5IC0gZXk7XG4gICAgY29uc3QgZGV5ID0gZHkgLSBleTtcbiAgICBjb25zdCBhZXogPSBheiAtIGV6O1xuICAgIGNvbnN0IGJleiA9IGJ6IC0gZXo7XG4gICAgY29uc3QgY2V6ID0gY3ogLSBlejtcbiAgICBjb25zdCBkZXogPSBkeiAtIGV6O1xuXG4gICAgY29uc3QgYWV4YmV5ID0gYWV4ICogYmV5O1xuICAgIGNvbnN0IGJleGFleSA9IGJleCAqIGFleTtcbiAgICBjb25zdCBhYiA9IGFleGJleSAtIGJleGFleTtcbiAgICBjb25zdCBiZXhjZXkgPSBiZXggKiBjZXk7XG4gICAgY29uc3QgY2V4YmV5ID0gY2V4ICogYmV5O1xuICAgIGNvbnN0IGJjID0gYmV4Y2V5IC0gY2V4YmV5O1xuICAgIGNvbnN0IGNleGRleSA9IGNleCAqIGRleTtcbiAgICBjb25zdCBkZXhjZXkgPSBkZXggKiBjZXk7XG4gICAgY29uc3QgY2QgPSBjZXhkZXkgLSBkZXhjZXk7XG4gICAgY29uc3QgZGV4YWV5ID0gZGV4ICogYWV5O1xuICAgIGNvbnN0IGFleGRleSA9IGFleCAqIGRleTtcbiAgICBjb25zdCBkYSA9IGRleGFleSAtIGFleGRleTtcbiAgICBjb25zdCBhZXhjZXkgPSBhZXggKiBjZXk7XG4gICAgY29uc3QgY2V4YWV5ID0gY2V4ICogYWV5O1xuICAgIGNvbnN0IGFjID0gYWV4Y2V5IC0gY2V4YWV5O1xuICAgIGNvbnN0IGJleGRleSA9IGJleCAqIGRleTtcbiAgICBjb25zdCBkZXhiZXkgPSBkZXggKiBiZXk7XG4gICAgY29uc3QgYmQgPSBiZXhkZXkgLSBkZXhiZXk7XG5cbiAgICBjb25zdCBhbGlmdCA9IGFleCAqIGFleCArIGFleSAqIGFleSArIGFleiAqIGFlejtcbiAgICBjb25zdCBibGlmdCA9IGJleCAqIGJleCArIGJleSAqIGJleSArIGJleiAqIGJlejtcbiAgICBjb25zdCBjbGlmdCA9IGNleCAqIGNleCArIGNleSAqIGNleSArIGNleiAqIGNlejtcbiAgICBjb25zdCBkbGlmdCA9IGRleCAqIGRleCArIGRleSAqIGRleSArIGRleiAqIGRlejtcblxuICAgIGNvbnN0IGRldCA9XG4gICAgICAgIChjbGlmdCAqIChkZXogKiBhYiArIGFleiAqIGJkICsgYmV6ICogZGEpIC0gZGxpZnQgKiAoYWV6ICogYmMgLSBiZXogKiBhYyArIGNleiAqIGFiKSkgK1xuICAgICAgICAoYWxpZnQgKiAoYmV6ICogY2QgLSBjZXogKiBiZCArIGRleiAqIGJjKSAtIGJsaWZ0ICogK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iZXk7XG4gICAgY29uc3QgY2QgPSBjZXggKiBkZXkgLSBkZXggKiBjZXk7XG4gICAgY29uc3QgZGEgPSBkZXggKiBhZXkgLSBhZXggKiBkZXk7XG4gICAgY29uc3QgYWMgPSBhZXggKiBjZXkgLSBjZXggKiBhZXk7XG4gICAgY29uc3QgYmQgPSBiZXggKiBkZXkgLSBkZXggKiBiZXk7XG5cbiAgICBjb25zdCBhYmMgPSBhZXogKiBiYyAtIGJleiAqIGFjICsgY2V6ICogYWI7XG4gICAgY29uc3QgYmNkID0gYmV6ICogY2QgLSBjZXogKiBiZCArIGRleiAqIGJjO1xuICAgIGNvbnN0IGNkYSA9IGNleiAqIGRhICsgZGV6ICogYWMgKyBhZXogKiBjZDtcbiAgICBjb25zdCBkYWIgPSBkZXogKiBhYiArIGFleiAqIGJkICsgYmV6ICogZGE7XG5cbiAgICBjb25zdCBhbGlmdCA9IGFleCAqIGFleCArIGFleSAqIGFleSArIGFleiAqIGFlejtcbiAgICBjb25zdCBibGlmdCA9IGJleCAqIGJleCArIGJleSAqIGJleSArIGJleiAqIGJlejtcbiAgICBjb25zdCBjbGlmdCA9IGNleCAqIGNleCArIGNleSAqIGNleSArIGNleiAqIGNlejtcbiAgICBjb25zdCBkbGlmdCA9IGRleCAqIGRleCArIGRleSAqIGRleSArIGRleiAqIGRlejtcblxuICAgIHJldHVybiAoY2xpZnQgKiBkYWIgLSBkbGlmdCAqIGFiYykgKyAoYWxpZnQgKiBiY2QgLSBibGlmdCAqIGNkYSk7XG59XG4iLCJpbXBvcnQge2Vwc2lsb24sIHNwbGl0dGVyLCByZXN1bHRlcnJib3VuZCwgZXN0aW1hdGUsIHZlYywgc3VtfSBmcm9tICcuL3V0aWwuanMnO1xuXG5jb25zdCBjY3dlcnJib3VuZEEgPSAoMyArIDE2ICogZXBzaWxvbikgKiBlcHNpbG9uO1xuY29uc3QgY2N3ZXJyYm91bmRCID0gKDIgKyAxMiAqIGVwc2lsb24pICogZXBzaWxvbjtcbmNv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vID0gbmVnYXRlIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogYXg7XG4gICAgICAgICAgICBiaGkgPSBjIC0gKGMgLSBheCk7XG4gICAgICAgICAgICBibG8gPSBheCAtIGJoaTtcbiAgICAgICAgICAgIGFbMF0gPSBhbG8gKiBibG8gLSAoczEgLSBhaGkgKiBiaGkgLSBhbG8gKiBiaGkgLSBhaGkgKiBibG8pO1xuICAgICAgICAgICAgYVsxXSA9IHMxO1xuICAgICAgICAgICAgczEgPSB5dGFpbCAqIGJ4O1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogeXRhaWw7XG4gICAgICAgICAgICBhaGkgPSBjIC0gKGMgLSB5dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSB5dGFpbCAtIGFoaTtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIGJ4O1xuICAgICAgICAgICAgYmhpID0gYyAtIChjIC0gYngpO1xuICAgICAgICAgICAgYmxvID0gYnggLSBiaGk7XG4gICAgICAgICAgICBiWzBdID0gYWxvICogYmxvIC0gKHMxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIGJbMV0gPSBzMTtcbiAgICAgICAgICAgIHJldHVybiAyO1xuICAgICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKHl0YWlsID09PSAwKSB7XG4gICAgICAgICAgICBzMSA9IHh0YWlsICogYXk7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiB4dGFpbDtcbiAgICAgICAgICAgIGFoaSA9IGMgLSAoYyAtIHh0YWlsKTtcbiAgICAgICAgICAgIGFsbyA9IHh0YWlsIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogYXk7XG4gICAgICAgICAgICBiaGkgPSBjIC0gKGMgLSBheSk7XG4gICAgICAgICAgICBibG8gPSBheSAtIGJoaTtcbiAgICAgICAgICAgIGFbMF0gPSBhbG8gKiBibG8gLSAoczEgLSBhaGkgKiBiaGkgLSBhbG8gKiBiaGkgLSBhaGkgKiBibG8pO1xuICAgICAgICAgICAgYVsxXSA9IHMxO1xuICAgICAgICAgICAgbmVnYXRlID0gLXh0YWlsO1xuICAgICAgICAgICAgczEgPSBuZWdhdGUgKiBieTtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIG5lZ2F0ZTtcbiAgICAgICAgICAgIGFoaSA9IGMgLSAoYyAtIG5lZ2F0ZSk7XG4gICAgICAgICAgICBhbG8gPSBuZWdhdGUgLSBhaGk7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBieTtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGJ5KTtcbiAgICAgICAgICAgIGJsbyA9IGJ5IC0gYmhpO1xuICAgICAgICAgICAgYlswXSA9IGFsbyAqIGJsbyAtIChzMSAtIGFoaSAqIGJoaSAtIGFsbyAqIGJoaSAtIGFoaSAqIGJsbyk7XG4gICAgICAgICAgICBiWzFdID0gczE7XG4gICAgICAgICAgICByZXR1cm4gMjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHMxID0geHRhaWwgKiBheTtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIHh0YWlsO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0geHRhaWwpO1xuICAgICAgICAgICAgYWxvID0geHRhaWwgLSBhaGk7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBheTtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGF5KTtcbiAgICAgICAgICAgIGJsbyA9IGF5IC0gYmhpO1xuICAgICAgICAgICAgczAgPSBhbG8gKiBibG8gLSAoczEgLSBhaGkgKiBiaGkgLSBhbG8gKiBiaGkgLSBhaGkgKiBibG8pO1xuICAgICAgICAgICAgdDEgPSB5dGFpbCAqIGF4O1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogeXRhaWw7XG4gICAgICAgICAgICBhaGkgPSBjIC0gKGMgLSB5dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSB5dGFpbCAtIGFoaTtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIGF4O1xuICAgICAgICAgICAgYmhpID0gYyAtIChjIC0gYXgpO1xuICAgICAgICAgICAgYmxvID0gYXggLSBiaGk7XG4gICAgICAgICAgICB0MCA9IGFsbyAqIGJsbyAtICh0MSAtIGFoaSAqIGJoaSAtIGFsbyAqIGJoaSAtIGFoaSAqIGJsbyk7XG4gICAgICAgICAgICBfaSA9IHMwIC0gdDA7XG4gICAgICAgICAgICBidmlydCA9IHMwIC0gX2k7XG4gICAgICAgICAgICBhWzBdID0gczAgLSAoX2kgKyBidmlydCkgKyAoYnZpcnQgLSB0MCk7XG4gICAgICAgICAgICBfaiA9IHMxICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IF9qIC0gczE7XG4gICAgICAgICAgICBfMCA9IHMxIC0gKF9qIC0gYnZpcnQpICsgKF9pIC0gYnZpcnQpO1xuICAgICAgICAgICAgX2kgPSBfMCAtIHQxO1xuICAgICAgICAgICAgYnZpcnQgPSBfMCAtIF9pO1xuICAgICAgICAgICAgYVsxXSA9IF8wIC0gKF9pICsgYnZpcnQpICsgKGJ2aXJ0IC0gdDEpO1xuICAgICAgICAgICAgdTMgPSBfaiArIF9pO1xuICAgICAgICAgICAgYnZpcnQgPSB1MyAtIF9qO1xuICAgICAgICAgICAgYVsyXSA9IF9qIC0gKHUzIC0gYnZpcnQpICsgKF9pIC0gYnZpcnQpO1xuICAgICAgICAgICAgYVszXSA9IHUzO1xuICAgICAgICAgICAgczEgPSB5dGFpbCAqIGJ4O1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogeXRhaWw7XG4gICAgICAgICAgICBhaGkgPSBjIC0gKGMgLSB5dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSB5dGFpbCAtIGFoaTtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIGJ4O1xuICAgICAgICAgICAgYmhpID0gYyAtIChjIC0gYngpO1xuICAgICAgICAgICAgYmxvID0gYnggLSBiaGk7XG4gICAgICAgICAgICBzMCA9IGFsbyAqIGJsbyAtIChzMSAtIGFoaSAqIGJoaSAtIGFsbyAqIGJoaSAtIGFoaSAqIGJsbyk7XG4gICAgICAgICAgICB0MSA9IHh0YWlsICogYnk7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiB4dGFpbDtcbiAgICAgICAgICAgIGFoaSA9IGMgLSAoYyAtIHh0YWlsKTtcbiAgICAgICAgICAgIGFsbyA9IHh0YWlsIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogYnk7XG4gICAgICAgICAgICBiaGkgPSBjIC0gKGMgLSBieSk7XG4gICAgICAgICAgICBibG8gPSBieSAtIGJoaTtcbiAgICAgICAgICAgIHQwID0gYWxvICogYmxvIC0gKHQxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIF9pID0gczAgLSB0MDtcbiAgICAgICAgICAgIGJ2aXJ0ID0gczAgLSBfaTtcbiAgICAgICAgICAgIGJbMF0gPSBzMCAtIChfaSArIGJ2aXJ0KSArIChidmlydCAtIHQwKTtcbiAgICAgICAgICAgIF9qID0gczEgKyBfaTtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2ogLSBzMTtcbiAgICAgICAgICAgIF8wID0gczEgLSAoX2ogLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBfaSA9IF8wIC0gdDE7XG4gICAgICAgICAgICBidmlydCA9IF8wIC0gX2k7XG4gICAgICAgICAgICBiWzFdID0gXzAgLSAoX2kgKyBidmlydCkgKyAoYnZpcnQgLSB0MSk7XG4gICAgICAgICAgICB1MyA9IF9qICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IHUzIC0gX2o7XG4gICAgICAgICAgICBiWzJdID0gX2ogLSAodTMgLSBidmlydCkgKyAoX2k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MCkge1xuICAgICAgICAgICAgaFtoaW5kZXgrK10gPSBoaDtcbiAgICAgICAgfVxuICAgICAgICB3aGlsZSAoZWluZGV4IDwgZWxlbiAmJiBmaW5kZXggPCBmbGVuKSB7XG4gICAgICAgICAgICBpZiAoKGZub3cgPiBlbm93KSA9PT0gKGZub3cgPiAtZW5vdykpIHtcbiAgICAgICAgICAgICAgICBRbmV3ID0gUSArIGVub3c7XG4gICAgICAgICAgICAgICAgYnZpcnQgPSBRbmV3IC0gUTtcbiAgICAgICAgICAgICAgICBoaCA9IFEgLSAoUW5ldyAtIGJ2aXJ0KSArIChlbm93IC0gYnZpcnQpO1xuICAgICAgICAgICAgICAgIGVub3cgPSBlWysrZWluZGV4XTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgUW5ldyA9IFEgKyBmbm93O1xuICAgICAgICAgICAgICAgIGJ2aXJ0ID0gUW5ldyAtIFE7XG4gICAgICAgICAgICAgICAgaGggPSBRIC0gKFFuZXcgLSBidmlydCkgKyAoZm5vdyAtIGJ2aXJ0KTtcbiAgICAgICAgICAgICAgICBmbm93ID0gZlsrK2ZpbmRleF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBRID0gUW5ldztcbiAgICAgICAgICAgIGlmIChoaCAhPT0gMCkge1xuICAgICAgICAgICAgICAgIGhbaGluZGV4KytdID0gaGg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgd2hpbGUgKGVpbmRleCA8IGVsZW4pIHtcbiAgICAgICAgUW5ldyA9IFEgKyBlbm93O1xuICAgICAgICBidmlydCA9IFFuZXcgLSBRO1xuICAgICAgICBoaCA9IFEgLSAoUW5ldyAtIGJ2aXJ0KSArIChlbm93IC0gYnZpcnQpO1xuICAgICAgICBlbm93ID0gZVsrK2VpbmRleF07XG4gICAgICAgIFEgPSBRbmV3O1xuICAgICAgICBpZiAoaGggIT09IDApIHtcbiAgICAgICAgICAgIGhbaGluZGV4KytdID0g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AgIHZhciBzdW1ZID0gMDtcbiAgICAgICAgdmFyIHN1bVhYID0gMDtcbiAgICAgICAgdmFyIHN1bVhZID0gMDtcblxuICAgICAgICAvLyBVc2UgbG9jYWwgdmFyaWFibGVzIHRvIGdyYWIgcG9pbnQgdmFsdWVzXG4gICAgICAgIC8vIHdpdGggbWluaW1hbCBvYmplY3QgcHJvcGVydHkgbG9va3Vwc1xuICAgICAgICB2YXIgcG9pbnQ7XG4gICAgICAgIHZhciB4O1xuICAgICAgICB2YXIgeTtcblxuICAgICAgICAvLyBHYXRoZXIgdGhlIHN1bSBvZiBhbGwgeCB2YWx1ZXMsIHRoZSBzdW0gb2YgYWxsXG4gICAgICAgIC8vIHkgdmFsdWVzLCBhbmQgdGhlIHN1bSBvZiB4XjIgYW5kICh4KnkpIGZvciBlYWNoXG4gICAgICAgIC8vIHZhbHVlLlxuICAgICAgICAvL1xuICAgICAgICAvLyBJbiBtYXRoIG5vdGF0aW9uLCB0aGVzZSB3b3VsZCBiZSBTU194LCBTU195LCBTU194eCwgYW5kIFNTX3h5XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGF0YUxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBwb2ludCA9IGRhdGFbaV07XG4gICAgICAgICAgICB4ID0gcG9pbnRbMF07XG4gICAgICAgICAgICB5ID0gcG9pbnRbMV07XG5cbiAgICAgICAgICAgIHN1bVggKz0geDtcbiAgICAgICAgICAgIHN1bVkgKz0geTtcblxuICAgICAgICAgICAgc3VtWFggKz0geCAqIHg7XG4gICAgICAgICAgICBzdW1YWSArPSB4ICogeTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGBtYCBpcyB0aGUgc2xvcGUgb2YgdGhlIHJlZ3Jlc3Npb24gbGluZVxuICAgICAgICBtID1cbiAgICAgICAgICAgIChkYXRhTGVuZ3RoICogc3VtWFkgLSBzdW1YICogc3VtWSkgL1xuICAgICAgICAgICAgKGRhdGFMZW5ndGggKiBzdW1YWCA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ciB6ID0gTWF0aC5sb2cobik7XG4gICAgICAgICAgICB2YXIgcyA9IDAuNSAqIE1hdGguZXhwKCgyICogeikgLyAzKTtcbiAgICAgICAgICAgIHZhciBzZCA9IDAuNSAqIE1hdGguc3FydCgoeiAqIHMgKiAobiAtIHMpKSAvIG4pO1xuICAgICAgICAgICAgaWYgKG0gLSBuIC8gMiA8IDApIHsgc2QgKj0gLTE7IH1cbiAgICAgICAgICAgIHZhciBuZXdMZWZ0ID0gTWF0aC5tYXgobGVmdCwgTWF0aC5mbG9vcihrIC0gKG0gKiBzKSAvIG4gKyBzZCkpO1xuICAgICAgICAgICAgdmFyIG5ld1JpZ2h0ID0gTWF0aC5taW4oXG4gICAgICAgICAgICAgICAgcmlnaHQsXG4gICAgICAgICAgICAgICAgTWF0aC5mbG9vcihrICsgKChuIC0gbSkgKiBzKSAvIG4gKyBzZClcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBxdWlja3NlbGVjdChhcnIsIGssIG5ld0xlZnQsIG5ld1JpZ2h0KTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciB0ID0gYXJyW2tdO1xuICAgICAgICB2YXIgaSA9IGxlZnQ7XG4gICAgICAgIHZhciBqID0gcmlnaHQ7XG5cbiAgICAgICAgc3dhcChhcnIsIGxlZnQsIGspO1xuICAgICAgICBpZiAoYXJyW3JpZ2h0XSA+IHQpIHsgc3dhcChhcnIsIGxlZnQsIHJpZ2h0KTsgfVxuXG4gICAgICAgIHdoaWxlIChpIDwgaikge1xuICAgICAgICAgICAgc3dhcChhcnIsIGksIGopO1xuICAgICAgICAgICAgaSsrO1xuICAgICAgICAgICAgai0tO1xuICAgICAgICAgICAgd2hpbGUgKGFycltpXSA8IHQpIHsgaSsrOyB9XG4gICAgICAgICAgICB3aGlsZSAoYXJyW2pdID4gdCkgeyBqLS07IH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChhcnJbbGVmdF0gPT09IHQpIHsgc3dhcChhcnIsIGxlZnQsIGopO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OiAwLjExLFxuICAgICAgICAwLjk3NTogMC4yMixcbiAgICAgICAgMC45NTogMC4zNSxcbiAgICAgICAgMC45OiAwLjU4LFxuICAgICAgICAwLjU6IDIuMzcsXG4gICAgICAgIDAuMTogNi4yNSxcbiAgICAgICAgMC4wNTogNy44MSxcbiAgICAgICAgMC4wMjU6IDkuMzUsXG4gICAgICAgIDAuMDE6IDExLjM0LFxuICAgICAgICAwLjAwNTogMTIuODRcbiAgICB9LFxuICAgIDQ6IHtcbiAgICAgICAgMC45OTU6IDAuMjEsXG4gICAgICAgIDAuOTk6IDAuMyxcbiAgICAgICAgMC45NzU6IDAuNDgsXG4gICAgICAgIDAuOTU6IDAuNzEsXG4gICAgICAgIDAuOTogMS4wNixcbiAgICAgICAgMC41OiAzLjM2LFxuICAgICAgICAwLjE6IDcuNzgsXG4gICAgICAgIDAuMDU6IDkuNDksXG4gICAgICAgIDAuMDI1OiAxMS4xNCxcbiAgICAgICAgMC4wMTogMTMuMjgsXG4gICAgICAgIDAuMDA1OiAxNC44NlxuICAgIH0sXG4gICAgNToge1xuICAgICAgICAwLjk5NTogMC40MSxcbiAgICAgICAgMC45OTogMC41NSxcbiAgICAgICAgMC45NzU6IDAuODMsXG4gICAgICAgIDAuOTU6IDEuMTUsXG4gICAgICAgIDAuOTogMS42MSxcbiAgICAgICAgMC41OiA0LjM1LFxuICAgICAgICAwLjE6IDkuMjQsXG4gICAgICAgIDAuMDU6IDExLjA3LFxuICAgICAgICAwLjAyNTogMTIuODMsXG4gICAgICAgIDAuMDE6IDE1LjA5LFxuICAgICAgICAwLjAwNTogMTYuNzVcbiAgICB9LFxuICAgIDY6IHtcbiAgICAgICAgMC45OTU6IDAuNjgsXG4gICAgICAgIDAuOTk6IDAuODcsXG4gICAgICAgIDAuOTc1OiAxLjI0LFxuICAgICAgICAwLjk1OiAxLjY0LFxuICAgICAgICAwLjk6IDIuMixcbiAgICAgICAgMC41OiA1LjM1LFxuICAgICAgICAwLjE6IDEwLjY1LFxuICAgICAgICAwLjA1OiAxMi41OSxcbiAgICAgICAgMC4wMjU6IDE0LjQ1LFxuICAgICAgICAwLjAxOiAxNi44MSxcbiAgICAgICAgMC4wMDU6IDE4LjU1XG4gICAgfSxcbiAgICA3OiB7XG4gICAgICAgIDAuOTk1OiAwLjk5LFxuICAgICAgICAwLjk5OiAxLjI1LFxuICAgICAgICAwLjk3NTogMS42OSxcbiAgICAgICAgMC45NTogMi4xNyxcbiAgICAgICAgMC45OiAyLjgzLFxuICAgICAgICAwLjU6IDYuMzUsXG4gICAgICAgIDAuMTogMTIuMDIsXG4gICAgICAgIDAuMDU6IDE0LjA3LFxuICAgICAgICAwLjAyNTogMTYuMDEsXG4gICAgICAgIDAuMDE6IDE4LjQ4LFxuICAgICAgICAwLjAwNTogMjAuMjhcbiAgICB9LFxuICAgIDg6IHtcbiAgICAgICAgMC45OTU6IDEuMzQsXG4gICAgICAgIDAuOTk6IDEuNjUsXG4gICAgICAgIDAuOTc1OiAyLjE4LFxuICAgICAgICAwLjk1OiAyLjczLFxuICAgICAgICAwLjk6IDMuNDksXG4gICAgICAgIDAuNTogNy4zNCxcbiAgICAgICAgMC4xOiAxMy4zNixcbiAgICAgICAgMC4wNTogMTUuNTEsXG4gICAgICAgIDAuMDI1OiAxNy41MyxcbiAgICAgICAgMC4wMTogMjAuMDksXG4gICAgICAgIDAuMDA1OiAyMS45NlxuICAgIH0sXG4gICAgOToge1xuICAgICAgICAwLjk5NTogMS43MyxcbiAgICAgICAgMC45OTogMi4wOSxcbiAgICAgICAgMC45NzU6IDIuNyxcbiAgICAgICAgMC45NTogMy4zMyxcbiAgICAgICAgMC45OiA0LjE3LFxuICAgICAgICAwLjU6IDguMzQsXG4gICAgICAgIDAuMTogMTQuNjgsXG4gICAgICAgIDAuMDU6IDE2LjkyLFxuICAgICAgICAwLjAyNTogMTkuMDIsXG4gICAgICAgIDAuMDE6IDIxLjY3LFxuICAgICAgICAwLjAwNTogMjMuNTlcbiAgICB9LFxuICAgIDEwOiB7XG4gICAgICAgIDAuOTk1OiAyLjE2LFxuICAgICAgICAwLjk5OiAyLjU2LFxuICAgICAgICAwLjk3NTogMy4yNSxcbiAgICAgICAgMC45NTogMy45NCxcbiAgICAgICAgMC45OiA0Ljg3LFxuICAgICAgICAwLjU6IDkuMzQsXG4gICAgICAgIDAuMTogMTUuOTksXG4gICAgICAgIDAuMDU6IDE4LjMxLFxuICAgICAgICAwLjAyNTogMjAuNDgsXG4gICAgICAgIDAuMDE6IDIzLjIxLFxuICAgICAgICAwLjAwNTogMjUuMTlcbiAgICB9LFxuICAgIDExOiB7XG4gICAgICAgIDAuOTk1OiAyLjYsXG4gICAgICAgIDAuOTk6IDMuMDUsXG4gICAgICAgIDAuOTc1OiAzLjgyLFxuICAgICAgICAwLjk1OiA0LjU3LFxuICAgICAgICAwLjk6IDUuNTgsXG4gICAgICAgIDAuNTogMTAuMzQsXG4gICAgICAgIDAuMTogMTcuMjgsXG4gICAgICAgIDAuMDU6IDE5LjY4LFxuICAgICAgICAwLjAyNTogMjEuOTIsXG4gICAgICAgIDAuMDE6IDI0LjcyLFxuICAgICAgICAwLjAwNTogMjYuNzZcbiAgICB9LFxuICAgIDEyOiB7XG4gICAgICAgIDAuOTk1OiAzLjA3LFxuICAgICAgICAwLjk5OiAzLjU3LFxuICAgICAgICAwLjk3NTogNC40LFxuICAgICAgICAwLjk1OiA1LjIzLFxuICAgICAgICAwLjk6IDYuMyxcbiAgICAgICAgMC41OiAxMS4zNCxcbiAgICAgICAgMC4xOiAxOC41NSxcbiAgICAgICAgMC4wNTogMjEuMDMsXG4gICAgICAgIDAuMDI1OiAyMy4zNCxcbiAgICAgICAgMC4wMTogMjYuMjIsXG4gICAgICAgIDAuMDA1OiAyOC4zXG4gICAgfSxcbiAgICAxMzoge1xuICAgICAgICAwLjk5NTogMy41NyxcbiAgICAgICAgMC45OTogNC4xMSxcbiAgICAgICAgMC45NzU6IDUuMDEsXG4gICAgICAgIDAuOTU6IDUuODksXG4gICAgICAgIDAuOTogNy4wNCxcbiAgICAgICAgMC41OiAxMi4zNCxcbiAgICAgICAgMC4xOiAxOS44MSxcbiAgICAgICAgMC4wNTogMjIuMzYsXG4gICAgICAgIDAuMDI1OiAyNC43NCxcbiAgICAgICAgMC4wMTogMjcuNjksXG4gICAgICAgIDAuMDA1OiAyOS44MlxuICAgIH0sXG4gICAgMTQ6IHtcbiAgICAgICAgMC45OTU6IDQuMDcsXG4gICAgICAgIDAuOTk6IDQuNjYsXG4gICAgICAgIDAuOTc1OiA1LjYzLFxuICAgICAgICAwLjk1OiA2LjU3LFxuICAgICAgICAwLjk6IDcuNzksXG4gICAgICAgIDAuNTogMTMuMzQsXG4gICAgICAgIDAuMTogMjEuMDYsXG4gICAgICAgIDAuMDU6IDIzLjY4LFxuICAgICAgICAwLjAyNTogMjYuMTIsXG4gICAgICAgIDAuMDE6IDI5LjE0LFxuICAgICAgICAwLjAwNTogMzEuMzJcbiAgICB9LFxuICAgIDE1OiB7XG4gICAgICAgIDAuOTk1OiA0LjYsXG4gICAgICAgIDAuOTk6IDUuMjMsXG4gICAgICAgIDAuOTc1OiA2LjI3LFxuICAgICAgICAwLjk1OiA3LjI2LFxuICAgICAgICAwLjk6IDguNTUsXG4gICAgICAgIDAuNTogMTQuMzQsXG4gICAgICAgIDAuMTogMjIuMzEsXG4gICAgICAgIDAuMDU6IDI1LFxuICAgICAgICAwLjAyNTogMjcuNDksXG4gICAgICAgIDAuMDE6IDMwLjU4LFxuICAgICAgICAwLjAwNTogMzIuOFxuICAgIH0sXG4gICAgMTY6IHtcbiAgICAgICAgMC45OTU6IDUuMTQsXG4gICAgICAgIDAuOTk6IDUuODEsXG4gICAgICAgIDAuOTc1OiA2LjkxLFxuICAgICAgICAwLjk1OiA3Ljk2LFxuICAgICAgICAwLjk6IDkuMzEsXG4gICAgICAgIDAuNTogMTUuMzQsXG4gICAgICAgIDAuMTogMjMuNTQsXG4gICAgICAgIDAuMDU6IDI2LjMsXG4gICAgICAgIDAuMDI1OiAyOC44NSxcbiAgICAgICAgMC4wMTogMzIsXG4gICAgICAgIDAuMDA1OiAzNC4yN1xuICAgIH0sXG4gICAgMTc6IHtcbiAgICAgICAgMC45OTU6IDUuNyxcbiAgICAgICAgMC45OTogNi40MSxcbiAgICAgICAgMC45NzU6IDcuNTYsXG4gICAgICAgIDAuOTU6IDguNjcsXG4gICAgICAgIDAuOTogMTAuMDksXG4gICAgICAgIDAuNTogMTYuMzQsXG4gICAgICAgIDAuMTogMjQuNzcsXG4gICAgICAgIDAuMDU6IDI3LjU5LFxuICAgICAgICAwLjAyNTogMzAuMTksXG4gICAgICAgIDAuMDE6IDMzLjQxLFxuICAgICAgICAwLjAwNTogMzUuNzJcbiAgICB9LFxuICAgIDE4OiB7XG4gICAgICAgIDAuOTk1OiA2LjI2LFxuICAgICAgICAwLjk5OiA3LjAxLFxuICAgICAgICAwLjk3NTogOC4yMyxcbiAgICAgICAgMC45NTogOS4zOSxcbiAgICAgICAgMC45OiAxMC44NyxcbiAgICAgICAgMC41OiAxNy4zNCxcbiAgICAgICAgMC4xOiAyNS45OSxcbiAgICAgICAgMC4wNTogMjguODcsXG4gICAgICAgIDAuMDI1OiAzMS41MyxcbiAgICAgICAgMC4wMTogMzQuODEsXG4gICAgICAgIDAuMDA1OiAzNy4xNlxuICAgIH0sXG4gICAgMTk6IHtcbiAgICAgICAgMC45OTU6IDYuODQsXG4gICAgICAgIDAuOTk6IDcuNjMsXG4gICAgICAgIDAuOTc1OiA4LjkxLFxuICAgICAgICAwLjk1OiAxMC4xMixcbiAgICAgICAgMC45OiAxMS42NSxcbiAgICAgICAgMC41OiAxOC4zNCxcbiAgICAgICAgMC4xOiAyNy4yLFxuICAgICAgICAwLjA1OiAzMC4xNCxcbiAgICAgICAgMC4wMjU6IDMyLjg1LFxuICAgICAgICAwLjAxOiAzNi4xOSxcbiAgICAgICAgMC4wMDU6IDM4LjU4XG4gICAgfSxcbiAgICAyMDoge1xuICAgICAgICAwLjk5NTogNy40MyxcbiAgICAgICAgMC45OTogOC4yNixcbiAgICAgICAgMC45NzU6IDkuNTksXG4gICAgICAgIDAuOTU6IDEwLjg1LFxuICAgICAgICAwLjk6IDEyLjQ0LFxuICAgICAgICAwLjU6IDE5LjM0LFxuICAgICAgICAwLjE6IDI4LjQxLFxuICAgICAgICAwLjA1OiAzMS40MSxcbiAgICAgICAgMC4wMjU6IDM0LjE3LFxuICAgICAgICAwLjAxOiAzNy41NyxcbiAgICAgICAgMC4wMDU6IDQwXG4gICAgfSxcbiAgICAyMToge1xuICAgICAgICAwLjk5NTogOC4wMyxcbiAgICAgICAgMC45OTogOC45LFxuICAgICAgICAwLjk3NTogMTAuMjgsXG4gICAgICAgIDAuOTU6IDExLjU5LFxuICAgICAgICAwLjk6IDEzLjI0LFxuICAgICAgICAwLjU6IDIwLjM0LFxuICAgICAgICAwLjE6IDI5LjYyLFxuICAgICAgICAwLjA1OiAzMi42NyxcbiAgICAgICAgMC4wMjU6IDM1LjQ4LFxuICAgICAgICAwLjAxOiAzOC45MyxcbiAgICAgICAgMC4wMDU6IDQxLjRcbiAgICB9LFxuICAgIDIyOiB7XG4gICAgICAgIDAuOTk1OiA4LjY0LFxuICAgICAgICAwLjk5OiA5LjU0LFxuICAgICAgICAwLjk3NTogMTAuOTgsXG4gICAgICAgIDAuOTU6IDEyLjM0LFxuICAgICAgICAwLjk6IDE0LjA0LFxuICAgICAgICAwLjU6IDIxLjM0LFxuICAgICAgICAwLjE6IDMwLjgxLFxuICAgICAgICAwLjA1OiAzMy45MixcbiAgICAgICAgMC4wMjU6IDM2Ljc4LFxuICAgICAgICAwLjAxOiA0MC4yOSxcbiAgICAgICAgMC4wMDU6IDQyLjhcbiAgICB9LFxuICAgIDIzOiB7XG4gICAgICAgIDAuOTk1OiA5LjI2LFxuICAgICAgICAwLjk5OiAxMC4yLFxuICAgICAgICAwLjk3NTogMTEuNjksXG4gICAgICAgIDAuOTU6IDEzLjA5LFxuICAgICAgICAwLjk6IDE0Ljg1LFxuICAgICAgICAwLjU6IDIyLjM0LFxuICAgICAgICAwLjE6IDMyLjAxLFxuICAgICAgICAwLjA1OiAzNS4xNyxcbiAgICAgICAgMC4wMjU6IDM4LjA4LFxuICAgICAgICAwLjAxOiA0MS42NCxcbiAgICAgICAgMC4wMDU6IDQ0LjE4XG4gICAgfSxcbiAgICAyNDoge1xuICAgICAgICAwLjk5NTogOS44OSxcbiAgICAgICAgMC45OTogMTAuODYsXG4gICAgICAgIDAuOTc1OiAxMi40LFxuICAgICAgICAwLjk1OiAxMy44NSxcbiAgICAgICAgMC45OiAxNS42NixcbiAgICAgICAgMC41OiAyMy4zNCxcbiAgICAgICAgMC4xOiAzMy4yLFxuICAgICAgICAwLjA1OiAzNi40MixcbiAgICAgICAgMC4wMjU6IDM5LjM2LFxuICAgICAgICAwLjAxOiA0Mi45OCxcbiAgICAgICAgMC4wMDU6IDQ1LjU2XG4gICAgfSxcbiAgICAyNToge1xuICAgICAgICAwLjk5NTogMTAuNTIsXG4gICAgICAgIDAuOTk6IDExLjUyLFxuICAgICAgICAwLjk3NTogMTMuMTIsXG4gICAgICAgIDAuOTU6IDE0LjYxLFxuICAgICAgICAwLjk6IDE2LjQ3LFxuICAgICAgICAwLjU6IDI0LjM0LFxuICAgICAgICAwLjE6IDM0LjI4LFxuICAgICAgICAwLjA1OiAzNy42NSxcbiAgICAgICAgMC4wMjU6IDQwLjY1LFxuICAgICAgICAwLjAxOiA0NC4zMSxcbiAgICAgICAgMC4wMDU6IDQ2LjkzXG4gICAgfSxcbiAgICAyNjoge1xuICAgICAgICAwLjk5NTogMTEuMTYsXG4gICAgICAgIDAuOTk6IDEyLjIsXG4gICAgICAgIDAuOTc1OiAxMy44NCxcbiAgICAgICAgMC45NTogMTUuMzgsXG4gICAgICAgIDAuOTogMTcuMjksXG4gICAgICAgIDAuNTogMjUuMzQsXG4gICAgICAgIDAuMTogMzUuNTYsXG4gICAgICAgIDAuMDU6IDM4Ljg5LFxuICAgICAgICAwLjAyNTogNDEuOTIsXG4gICAgICAgIDAuMDE6IDQ1LjY0LFxuICAgICAgICAwLjAwNTogNDguMjlcbiAgICB9LFxuICAgIDI3OiB7XG4gICAgICAgIDAuOTk1OiAxMS44MSxcbiAgICAgICAgMC45OTogMTIuODgsXG4gICAgICAgIDAuOTc1OiAxNC41NyxcbiAgICAgICAgMC45NTogMTYuMTUsXG4gICAgICAgIDAuOTogMTguMTEsXG4gICAgICAgIDAuNTogMjYuMzQsXG4gICAgICAgIDAuMTogMzYuNzQsXG4gICAgICAgIDAuMDU6IDQwLjExLFxuICAgICAgICAwLjAyNTogNDMuMTksXG4gICAgICAgIDAuMDE6IDQ2Ljk2LFxuICAgICAgICAwLjAwNTogNDkuNjVcbiAgICB9LFxuICAgIDI4OiB7XG4gICAgICAgIDAuOTk1OiAxMi40NixcbiAgICAgICAgMC45OTogMTMuNTcsXG4gICAgICAgIDAuOTc1OiAxNS4zMSxcbiAgICAgICAgMC45NTogMTYuOTMsXG4gICAgICAgIDAuOTogMTguOTQsXG4gICAgICAgIDAuNTogMjcuMzQsXG4gICAgICAgIDAuMTogMzcuOTIsXG4gICAgICAgIDAuMDU6IDQxLjM0LFxuICAgICAgICAwLjAyNTogNDQuNDYsXG4gICAgICAgIDAuMDE6IDQ4LjI4LFxuICAgICAgICAwLjAwNTogNTAuOTlcbiAgICB9LFxuICAgIDI5OiB7XG4gICAgICAgIDAuOTk1OiAxMy4xMixcbiAgICAgICAgMC45OTogMTQuMjYsXG4gICAgICAgIDAuOTc1OiAxNi4wNSxcbiAgICAgICAgMC45NTogMTcuNzEsXG4gICAgICAgIDAuOTogMTkuNzcsXG4gICAgICAgIDAuNTogMjguMzQsXG4gICAgICAgIDAuMTogMzkuMDksXG4gICAgICAgIDAuMDU6IDQyLjU2LFxuICAgICAgICAwLjAyNTogNDUuNzIsXG4gICAgICAgIDAuMDE6IDQ5LjU5LFxuICAgICAgICAwLjAwNTogNTIuMzRcbiAgICB9LFxuICAgIDMwOiB7XG4gICAgICAgIDAuOTk1OiAxMy43OSxcbiAgICAgICAgMC45OTogMTQuOTUsXG4gICAgICAgIDAuOTc1OiAxNi43OSxcbiAgICAgICAgMC45NTogMTguNDksXG4gICAgICAgIDAuOTogMjAuNixcbiAgICAgICAgMC41OiAyOS4zNCxcbiAgICAgICAgMC4xOiA0MC4yNixcbiAgICAgICAgMC4wNTogNDMuNzcsXG4gICAgICAgIDAuMDI1OiA0Ni45OCxcbiAgICAgICAgMC4wMTogNTAuODksXG4gICAgICAgIDAuMDA1OiA1My42N1xuICAgIH0sXG4gICAgNDA6IHtcbiAgICAgICAgMC45OTU6IDIwLjcxLFxuICAgICAgICAwLjk5OiAyMi4xNixcbiAgICAgICAgMC45NzU6IDI0LjQzLFxuICAgICAgICAwLjk1OiAyNi41MSxcbiAgICAgICAgMC45OiAyOS4wNSxcbiAgICAgICAgMC41OiAzOS4zNCxcbiAgICAgICAgMC4xOiA1MS44MSxcbiAgICAgICAgMC4wNTogNTUuNzYsXG4gICAgICAgIDAuMDI1OiA1OS4zNCxcbiAgICAgICAgMC4wMTogNjMuNjksXG4gICAgICAgIDAuMDA1OiA2Ni43N1xuICAgIH0sXG4gICAgNTA6IHtcbiAgICAgICAgMC45OTU6IDI3Ljk5LFxuICAgICAgICAwLjk5OiAyOS43MSxcbiAgICAgICAgMC45NzU6IDMyLjM2LFxuICAgICAgICAwLjk1OiAzNC43NixcbiAgICAgICAgMC45OiAzNy42OSxcbiAgICAgICAgMC41OiA0OS4zMyxcbiAgICAgICAgMC4xOiA2My4xNyxcbiAgICAgICAgMC4wNTogNjcuNSxcbiAgICAgICAgMC4wMjU6IDcxLjQyLFxuICAgICAgICAwLjAxOiA3Ni4xNSxcbiAgICAgICAgMC4wMDU6IDc5LjQ5XG4gICAgfSxcbiAgICA2MDoge1xuICAgICAgICAwLjk5NTogMzUuNTMsXG4gICAgICAgIDAuOTk6IDM3LjQ4LFxuICAgICAgICAwLjk3NTogNDAuNDgsXG4gICAgICAgIDAuOTU6IDQzLjE5LFxuICAgICAgICAwLjk6IDQ2LjQ2LFxuICAgICAgICAwLjU6IDU5LjMzLFxuICAgICAgICAwLjE6IDc0LjQsXG4gICAgICAgIDAuMDU6IDc5LjA4LFxuICAgICAgICAwLjAyNTogODMuMyxcbiAgICAgICAgMC4wMTogODguMzgsXG4gICAgICAgIDAuMDA1OiA5MS45NVxuICAgIH0sXG4gICAgNzA6IHtcbiAgICAgICAgMC45OTU6IDQzLjI4LFxuICAgICAgICAwLjk5OiA0NS40NCxcbiAgICAgICAgMC45NzU6IDQ4Ljc2LFxuICAgICAgICAwLjk1OiA1MS43NCxcbiAgICAgICAgMC45OiA1NS4zMyxcbiAgICAgICAgMC41OiA2OS4zMyxcbiAgICAgICAgMC4xOiA4NS41MyxcbiAgICAgICAgMC4wNTogOTAuNTMsXG4gICAgICAgIDAuMDI1OiA5NS4wMixcbiAgICAgICAgMC4wMTogMTAwLjQyLFxuICAgICAgICAwLjAwNTogMTA0LjIyXG4gICAgfSxcbiAgICA4MDoge1xuICAgICAgICAwLjk5NTogNTEuMTcsXG4gICAgICAgIDAuOTk6IDUzLjU0LFxuICAgICAgICAwLjk3NTogNTcuMTUsXG4gICAgICAgIDAuOTU6IDYwLjM5LFxuICAgICAgICAwLjk6IDY0LjI4LFxuICAgICAgICAwLjU6IDc5LjMzLFxuICAgICAgICAwLjE6IDk2LjU4LFxuICAgICAgICAwLjA1OiAxMDEuODgsXG4gICAgICAgIDAuMDI1OiAxMDYuNjMsXG4gICAgICAgIDAuMDE6IDExMi4zMyxcbiAgICAgICAgMC4wMDU6IDExNi4zMlxuICAgIH0sXG4gICAgOTA6IHtcbiAgICAgICAgMC45OTU6IDU5LjIsXG4gICAgICAgIDAuOTk6IDYxLjc1LFxuICAgICAgICAwLjk3NTogNjUuNjUsXG4gICAgICAgIDAuOTU6IDY5LjEzLFxuICAgICAgICAwLjk6IDczLjI5LFxuICAgICAgICAwLjU6IDg5LjMzLFxuICAgICAgICAwLjE6IDEwNy41NyxcbiAgIC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GF1ID1cbiAgICAgICAgdCAqXG4gICAgICAgIE1hdGguZXhwKFxuICAgICAgICAgICAgLXggKiB4ICtcbiAgICAgICAgICAgICAgICAoKCgoKCgoKDAuMTcwODcyNzcgKiB0IC0gMC44MjIxNTIyMykgKiB0ICsgMS40ODg1MTU4NykgKiB0IC1cbiAgICAgICAgICAgICAgICAgICAgMS4xMzUyMDM5OCkgKlxuICAgICAgICAgICAgICAgICAgICB0ICtcbiAgICAgICAgICAgICAgICAgICAgMC4yNzg4NjgwNykgKlxuICAgICAgICAgICAgICAgICAgICB0IC1cbiAgICAgICAgICAgICAgICAgICAgMC4xODYyODgwNikgKlxuICAgICAgICAgICAgICAgICAgICB0ICtcbiAgICAgICAgICAgICAgICAgICAgMC4wOTY3ODQxOCkgKlxuICAgICAgICAgICAgICAgICAgICB0ICtcbiAgICAgICAgICAgICAgICAgICAgMC4zNzQwOTE5NikgKlxuICAgICAgICAgICAgICAgICAgICB0ICtcbiAgICAgICAgICAgICAgICAgICAgMS4wMDAwMjM2OCkgKlxuICAgICAgICAgICAgICAgICAgICB0IC1cbiAgICAgICAgICAgICAgICAxLjI2NTUxMjIzXG4gICAgICAgICk7XG4gICAgaWYgKHggPj0gMCkge1xuICAgICAgICByZXR1cm4gMSAtIHRhdTtcbiAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gdGF1IC0gMTtcbiAgICB9XG59XG5cbi8qKlxuICogVGhlIEludmVyc2UgW0dhdXNzaWFuIGVycm9yIGZ1bmN0aW9uXShodHRwOi8vZW4ud2lraXBlZGlhLm9yZy93aWtpL0Vycm9yX2Z1bmN0aW9uKVxuICogcmV0dXJucyBhIG51bWVyaWNhbCBhcHByb3hpbWF0aW9uIHRvIHRoZSB2YWx1ZSB0aGF0IHdvdWxkIGhhdmUgY2F1c2VkXG4gKiBgZXJyb3JGdW5jdGlvbigpYCB0byByZXR1cm4geC5cbiAqXG4gKiBAcGFyYW0ge251bWJlcn0geCB2YWx1ZSBvZiBlcnJvciBm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YmxlKGxhbWJkYSwgcGhpKSxcbiAgICAgICAgICAgIGMgPSBzbWFsbFJhZGl1c1xuICAgICAgICAgICAgICA/IHYgPyAwIDogY29kZShsYW1iZGEsIHBoaSlcbiAgICAgICAgICAgICAgOiB2ID8gY29kZShsYW1iZGEgKyAobGFtYmRhIDwgMCA/IHBpIDogLXBpKSwgcGhpKSA6IDA7XG4gICAgICAgIGlmICghcG9pbnQwICYmICh2MDAgPSB2MCA9IHYpKSBzdHJlYW0ubGluZVN0YXJ0KCk7XG4gICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgaWYgKCFwb2ludDIgfHwgcG9pbnRFcXVhbChwb2ludDAsIHBvaW50MikgfHwgcG9pbnRFcXVhbChwb2ludDEsIHBvaW50MikpXG4gICAgICAgICAgICBwb2ludDFbMl0gPSAxO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgLy8gb3V0c2lkZSBnb2luZyBpblxuICAgICAgICAgICAgc3RyZWFtLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgcG9pbnQyID0gaW50ZXJzZWN0KHBvaW50MSwgcG9pbnQwKTtcbiAgICAgICAgICAgIHN0cmVhbS5wb2ludChwb2ludDJbMF0sIHBvaW50MlsxXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIGluc2lkZSBnb2luZyBvdXRcbiAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgICBzdHJlYW0ucG9pbnQocG9pbnQyWzBdLCBwb2ludDJbMV0sIDIpO1xuICAgICAgICAgICAgc3RyZWFtLmxpbmVFbmQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcG9pbnQwID0gcG9pbnQyO1xuICAgICAgICB9IGVsc2UgaWYgKG5vdEhlbWlzcGhlcmUgJiYgcG9pbnQwICYmIHNtYWxsUmFkaXVzIF4gdikge1xuICAgICAgICAgIHZhciB0O1xuICAgICAgICAgIC8vIElmIHRoZSBjb2RlcyBmb3IgdHdvIHBvaW50cyBhcmUgZGlmZmVyZW50LCBvciBhcmUgYm90aCB6ZXJvLFxuICAgICAgICAgIC8vIGFuZCB0aGVyZSB0aGlzIHNlZ21lbnQgaW50ZXJzZWN0cyB3aXRoIHRoZSBzbWFsbCBjaXJjbGUuXG4gICAgICAgICAgaWYgKCEoYyAmIGMwKSAmJiAodCA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCwgdHJ1ZSkpKSB7XG4gICAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgICBpZiAoc21hbGxSYWRpdXMpIHtcbiAgICAgICAgICAgICAgc3RyZWFtLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBzdHJlYW0ucG9pbnQodFswXVswXSwgdFswXVsxXSk7XG4gICAgICAgICAgICAgIHN0cmVhbS5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgc3RyZWFtLmxpbmVFbmQoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHN0cmVhbS5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgc3RyZWFtLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgc3RyZWFtLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBzdHJlYW0ucG9pbnQodFswXVswXSwgdFswXVsxXSwgMyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh2ICYmICghcG9pbnQwIHx8ICFwb2ludEVxdWFsKHBvaW50MCwgcG9pbnQxKSkpIHtcbiAgICAgICAgICBzdHJlYW0ucG9pbnQocG9pbnQxWzBdLCBw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mVQb2ludChhLngsIGIueCk7XG4gIH1cblxuICBmdW5jdGlvbiBjb21wYXJlUG9pbnQoYSwgYikge1xuICAgIHZhciBjYSA9IGNvcm5lcihhLCAxKSxcbiAgICAgICAgY2IgPSBjb3JuZXIoYiwgMSk7XG4gICAgcmV0dXJuIGNhICE9PSBjYiA/IGNhIC0gY2JcbiAgICAgICAgOiBjYSA9PT0gMCA/IGJbMV0gLSBhWzFdXG4gICAgICAgIDogY2EgPT09IDEgPyBhWzBdIC0gYlswXVxuICAgICAgICA6IGNhID09PSAyID8gYVsxXSAtIGJbMV1cbiAgICAgICAgOiBiWzBdIC0gYVswXTtcbiAgfVxuXG4gIHJldHVybiBmdW5jdGlvbihzdHJlYW0pIHtcbiAgICB2YXIgYWN0aXZlU3RyZWFtID0gc3RyZWFtLFxuICAgICAgICBidWZmZXJTdHJlYW0gPSBjbGlwQnVmZmVyKCksXG4gICAgICAgIHNlZ21lbnRzLFxuICAgICAgICBwb2x5Z29uLFxuICAgICAgICByaW5nLFxuICAgICAgICB4X18sIHlfXywgdl9fLCAvLyBmaXJzdCBwb2ludFxuICAgICAgICB4XywgeV8sIHZfLCAvLyBwcmV2aW91cyBwb2ludFxuICAgICAgICBmaXJzdCxcbiAgICAgICAgY2xlYW47XG5cbiAgICB2YXIgY2xpcFN0cmVhbSA9IHtcbiAgICAgIHBvaW50OiBwb2ludCxcbiAgICAgIGxpbmVTdGFydDogbGluZVN0YXJ0LFxuICAgICAgbGluZUVuZDogbGluZUVuZCxcbiAgICAgIHBvbHlnb25TdGFydDogcG9seWdvblN0YXJ0LFxuICAgICAgcG9seWdvbkVuZDogcG9seWdvbkVuZFxuICAgIH07XG5cbiAgICBmdW5jdGlvbiBwb2ludCh4LCB5KSB7XG4gICAgICBpZiAodmlzaWJsZSh4LCB5KSkgYWN0aXZlU3RyZWFtLnBvaW50KHgsIHkpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBvbHlnb25JbnNpZGUoKSB7XG4gICAgICB2Y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2lkZW50IHdpdGggKHgyLHkyKT9cbiAgICAvLyBPciwgaXMgdGhlIHJhZGl1cyB6ZXJvPyBMaW5lIHRvICh4MSx5MSkuXG4gICAgZWxzZSBpZiAoIShNYXRoLmFicyh5MDEgKiB4MjEgLSB5MjEgKiB4MDEpID4gZXBzaWxvbikgfHwgIXIpIHtcbiAgICAgIHRoaXMuXyArPSBcIkxcIiArICh0aGlzLl94MSA9IHgxKSArIFwiLFwiICsgKHRoaXMuX3kxID0geTEpO1xuICAgIH1cblxuICAgIC8vIE90aGVyd2lzZSwgZHJhdyBhbiBhcmMhXG4gICAgZWxzZSB7XG4gICAgICB2YXIgeDIwID0geDIgLSB4MCxcbiAgICAgICAgICB5MjAgPSB5MiAtIHkwLFxuICAgICAgICAgIGwyMV8yID0geDIxICogeDIxICsgeTIxICogeTIxLFxuICAgICAgICAgIGwyMF8yID0geDIwICogeDIwICsgeTIwICogeTIwLFxuICAgICAgICAgIGwyMSA9IE1hdGguc3FydChsMjFfMiksXG4gICAgICAgICAgbDAxID0gTWF0aC5zcXJ0KGwwMV8yKSxcbiAgICAgICAgICBsID0gciAqIE1hdGgudGFuKChwaSAtIE1hdGguYWNvcygobDIxXzIgKyBsMDFfMiAtIGwyMF8yKSAvICgyICogbDIxICogbDAxKSkpIC8gMiksXG4gICAgICAgICAgdDAxID0gbCAvIGwwMSxcbiAgICAgICAgICB0MjEgPSBsIC8gbDIxO1xuXG4gICAgICAvLyBJZiB0aGUgc3RhcnQgdGFuZ2VudCBpcyBub3QgY29pbmNpZGVudCB3aXRoICh4MCx5MCksIGxpbmUgdG8uXG4gICAgICBpZiAoTWF0aC5hYnModDAxIC0gMSkgPiBlcHNpbG9uKSB7XG4gICAgICAgIHRoaXMuXyArPSBcIkxcIiArICh4MSArIHQwMSAqIHgwMSkgKyBcIixcIiArICh5MSArIHQwMSAqIHkwMSk7XG4gICAgICB9XG5cbiAgICAgIHRoaXMuXyArPSBcIkFcIiArIHIgKyBcIixcIiArIHIgKyBc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AgICAgICAgYTEwID0gYTEsXG4gICAgICAgICAgZGEwID0gZGEsXG4gICAgICAgICAgZGExID0gZGEsXG4gICAgICAgICAgYXAgPSBwYWRBbmdsZS5hcHBseSh0aGlzLCBhcmd1bWVudHMpIC8gMixcbiAgICAgICAgICBycCA9IChhcCA+IGVwc2lsb24pICYmIChwYWRSYWRpdXMgPyArcGFkUmFkaXVzLmFwcGx5KHRoaXMsIGFyZ3VtZW50cykgOiBNYXRoLnNxcnQocjAgKiByMCArIHIxICogcjEpKSxcbiAgICAgICAgICByYyA9IE1hdGgubWluKE1hdGguYWJzKHIxIC0gcjApIC8gMiwgK2Nvcm5lclJhZGl1cy5hcHBseSh0aGlzLCBhcmd1bWVudHMpKSxcbiAgICAgICAgICByYzAgPSByYyxcbiAgICAgICAgICByYzEgPSByYyxcbiAgICAgICAgICB0MCxcbiAgICAgICAgICB0MTtcblxuICAgICAgLy8gQXBwbHkgcGFkZGluZz8gTm90ZSB0aGF0IHNpbmNlIHIxIOKJpSByMCwgZGExIOKJpSBkYTAuXG4gICAgICBpZiAocnAgPiBlcHNpbG9uKSB7XG4gICAgICAgIHZhciBwMCA9IGFzaW4ocnAgLyByMCAqIE1hdGguc2luKGFwKSksXG4gICAgICAgICAgICBwMSA9IGFzaW4ocnAgLyByMSAqIE1hdGguc2luKGFwKSk7XG4gICAgICAgIGlmICgoZGEwIC09IHAwICogMikgPiBlcHNpbG9uKSBwMCAqPSAoY3cgPyAxIDogLTEpLCBhMDAgKz0gcDAsIGExMCAtPSBwMDtcbiAgICAgICAgZWxzZSBkYTAgPSAwLCBhMDAgPSBhMTAgPSAoYTAgKyBhMSkgLyAyO1xuICAgICAgICBpZiAoKGRhMSAtPSBwMSAqIDIpID4gZXBzaWxvbikgcDEgKj0gKGN3ID8gMSA6IC0xKSwgYTAxICs9IHAxLCBhMTEgLT0gcDE7XG4gICAgICAgIGVsc2UgZGExID0gMCwgYTAxID0gYTExID0gKGEwICsgYTEpIC8gMjtcbiAgICAgIH1cblxuICAgICAgdmFyIHgwMSA9IHIxICogTWF0aC5jb3MoYTAxKSxcbiAgICAgICAgICB5MDEgPSByMSAqIE1hdGguc2luKGEwMSksXG4gICAgICAgICAgeDEwID0gcjAgKiBNYXRoLmNvcyhhMTApLFxuICAgICAgICAgIHkxMCA9IHIwICogTWF0aC5zaW4oYTEwKTtcblxuICAgICAgLy8gQXBwbHkgcm91bmRlZCBjb3JuZXJzP1xuICAgICAgaWYgKHJjID4gZXBzaWxvbikge1xuICAgICAgICB2YXIgeDExID0gcjEgKiBNYXRoLmNvcyhhMTEpLFxuICAgICAgICAgICAgeTExID0gcjEgKiBNYXRoLnNpbihhMTEpLFxuICAgICAgICAgICAgeDAwID0gcjAgKiBNYXRoLmNvcyhhMDApLFxuICAgICAgICAgICAgeTAwID0gcjAgKiBNYXRoLnNpbihhMDApO1xuXG4gICAgICAgIC8vIFJlc3RyaWN0IHRoZSBjb3JuZXIgcmFkaXVzIGFjY29yZGluZyB0byB0aGUgc2VjdG9yIGFuZ2xlLlxuICAgICAgICBpZiAoZGEgPCBwaSkge1xuICAgICAgICAgIHZhciBvYyA9IGRhMCA+IGVwc2lsb24gPyBpbnRlcnNlY3QoeDAxLCB5MDEsIHgwMCwgeTAwLCB4MTEsIHkxMSwgeDEwLCB5MTApIDogW3gxMCwgeTEwXSxcbiAgICAgICAgICAgICAgYXggPSB4MDEgLSBvY1swXSxcbiAgICAgICAgICAgICAgYXkgPSB5MDEgLSBvY1sxXSxcbiAgICAgICAgICAgICAgYnggPSB4MTEgLSBvY1swXSxcbiAgICAgICAgICAgICAgYnkgPSB5MTEgLSBvY1sxXSxcbiAgICAgICAgICAgICAga2MgPSAxIC8gTWF0aC5zaW4oTWF0aC5hY29zKChheCAqIGJ4ICsgYXkgKiBieSkgLyAoTWF0aC5zcXJ0KGF4ICogYXggKyBheSAqIGF5KSAqIE1hdGguc3FydChieCAqIGJ4ICsgYnkgKiBieSkpKSAvIDIpLFxuICAgICAgICAgICAgICBsYyA9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ge1xuICAgIHZhciByID0gTWF0aC5zcXJ0KHNpemUgLyBwaSk7XG4gICAgY29udGV4dC5tb3ZlVG8ociwgMCk7XG4gICAgY29udGV4dC5hcmMoMCwgMCwgciwgMCwgdGF1KTtcbiAgfVxufTtcbiIsImV4cG9ydCBkZWZhdWx0IHtcbiAgZHJhdzogZnVuY3Rpb24oY29udGV4dCwgc2l6ZSkge1xuICAgIHZhciByID0gTWF0aC5zcXJ0KHNpemUgLyA1KSAvIDI7XG4gICAgY29udGV4dC5tb3ZlVG8oLTMgKiByLCAtcik7XG4gICAgY29udGV4dC5saW5lVG8oLXIsIC1yKTtcbiAgICBjb250ZXh0LmxpbmVUbygtciwgLTMgKiByKTtcbiAgICBjb250ZXh0LmxpbmVUbyhyLCAtMyAqIHIpO1xuICAgIGNvbnRleHQubGluZVRvKHIsIC1yKTtcbiAgICBjb250ZXh0LmxpbmVUbygzICogciwgLXIpO1xuICAgIGNvbnRleHQubGluZVRvKDMgKiByLCByKTtcbiAgICBjb250ZXh0LmxpbmVUbyhyLCByKTtcbiAgICBjb250ZXh0LmxpbmVUbyhyLCAzICogcik7XG4gICAgY29udGV4dC5saW5lVG8oLXIsIDMgKiByKTtcbiAgICBjb250ZXh0LmxpbmVUbygtciwgcik7XG4gICAgY29udGV4dC5saW5lVG8oLTMgKiByLCByKTtcbiAgICBjb250ZXh0LmNsb3NlUGF0aCgpO1xuICB9XG59O1xuIiwidmFyIHRhbjMwID0gTWF0aC5zcXJ0KDEgLyAzKSxcbiAgICB0YW4zMF8yID0gdGFuMzAgKiAyO1xuXG5leHBvcnQgZGVmYXVsdCB7XG4gIGRyYXc6IGZ1bmN0aW9uKGNvbnRleHQsIHNpemUpIHtcbiAgICB2YXIgeSA9IE1hdGguc3FydChzaXplIC8gdGFuMzBfMiksXG4gICAgICAgIHggPSB5ICogdGFuMzA7XG4gICAgY29udGV4dC5tb3ZlVG8oMCwgLXkpO1xuICAgIGNvbnRleHQubGluZVRvKHgsIDApO1xuICAgIG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GNvbnRleHQuY2xvc2VQYXRoKCk7XG4gIH1cbn07XG4iLCJ2YXIgc3FydDMgPSBNYXRoLnNxcnQoMyk7XG5cbmV4cG9ydCBkZWZhdWx0IHtcbiAgZHJhdzogZnVuY3Rpb24oY29udGV4dCwgc2l6ZSkge1xuICAgIHZhciB5ID0gLU1hdGguc3FydChzaXplIC8gKHNxcnQzICogMykpO1xuICAgIGNvbnRleHQubW92ZVRvKDAsIHkgKiAyKTtcbiAgICBjb250ZXh0LmxpbmVUbygtc3FydDMgKiB5LCAteSk7XG4gICAgY29udGV4dC5saW5lVG8oc3FydDMgKiB5LCAteSk7XG4gICAgY29udGV4dC5jbG9zZVBhdGgoKTtcbiAgfVxufTtcbiIsInZhciBjID0gLTAuNSxcbiAgICBzID0gTWF0aC5zcXJ0KDMpIC8gMixcbiAgICBrID0gMSAvIE1hdGguc3FydCgxMiksXG4gICAgYSA9IChrIC8gMiArIDEpICogMztcblxuZXhwb3J0IGRlZmF1bHQge1xuICBkcmF3OiBmdW5jdGlvbihjb250ZXh0LCBzaXplKSB7XG4gICAgdmFyIHIgPSBNYXRoLnNxcnQoc2l6ZSAvIGEpLFxuICAgICAgICB4MCA9IHIgLyAyLFxuICAgICAgICB5MCA9IHIgKiBrLFxuICAgICAgICB4MSA9IHgwLFxuICAgICAgICB5MSA9IHIgKiBrICsgcixcbiAgICAgICAgeDIgPSAteDEsXG4gICAgICAgIHkyID0geTE7XG4gICAgY29udGV4dC5tb3ZlVG8oeDAsIHkwKTtcbiAgICBjb250ZXh0LmxpbmVUbyh4MSwgeTEpO1xuICAgIGNvbnRleHQubGluZVRvKHgyLCB5Mik7XG4gICAgY29udGV4dC5saW5lVG8oYyAqIHgwIC0gcyAqIHkwLCBzICogeDAgKyBjICogeTApO1xuICAgIGNvbnRleHQubGluZVRvKGMgKiB4MSAtIHMgKiB5MSwgcyAqIHgxICsgYyAqIHkxKTtcbiAgICBjb250ZXh0LmxpbmVUbyhjICogeDIgLSBzICogeTIsIHMg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Sk7XG4gIH1cblxuICBwb2x5Z29ucy5mb3JFYWNoKGZ1bmN0aW9uKHBvbHlnb24pIHtcbiAgICBpZiAoIXBvbHlnb24uXykge1xuICAgICAgdmFyIGdyb3VwID0gW10sXG4gICAgICAgICAgbmVpZ2hib3JzID0gW3BvbHlnb25dO1xuICAgICAgcG9seWdvbi5fID0gMTtcbiAgICAgIGdyb3Vwcy5wdXNoKGdyb3VwKTtcbiAgICAgIHdoaWxlIChwb2x5Z29uID0gbmVpZ2hib3JzLnBvcCgpKSB7XG4gICAgICAgIGdyb3VwLnB1c2gocG9seWdvbik7XG4gICAgICAgIHBvbHlnb24uZm9yRWFjaChmdW5jdGlvbihyaW5nKSB7XG4gICAgICAgICAgcmluZy5mb3JFYWNoKGZ1bmN0aW9uKGFyYykge1xuICAgICAgICAgICAgcG9seWdvbnNCeUFyY1thcmMgPCAwID8gfmFyYyA6IGFyY10uZm9yRWFjaChmdW5jdGlvbihwb2x5Z29uKSB7XG4gICAgICAgICAgICAgIGlmICghcG9seWdvbi5fKSB7XG4gICAgICAgICAgICAgICAgcG9seWdvbi5fID0gMTtcbiAgICAgICAgICAgICAgICBuZWlnaGJvcnMucHVzaChwb2x5Z29uKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH1cbiAgfSk7XG5cbiAgcG9seWdvbnMuZm9yRWFjaChmdW5jdGlvbihwb2x5Z29uKSB7XG4gICAgZGVsZXRlIHBvbHlnb24uXztcbiAgfSk7XG5cbiAgcmV0dXJuIHtcbiAgICB0eXBlOiBcIk11bHRpUG9seWdvblwiLFxuICAgIGFyY3M6IGdyb3Vwcy5tYXAoZnVuY3Rpb24ocG9seWdvbnMpIHtcbiAgICAgIHZhciBhcmNzID0gW10sIG47XG5cbiAgICAgIC8vIEV4dHJhY3QgdGhlIGV4dGVyaW9yICh1bmlxdWUpIGFyY3MuXG4gICAgICBwb2x5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ICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVqZWN0KGVycilcclxuICAgICAgICAgICAgfSlcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIFJldHVybnMgYW4gYXJyYXkgb2YgcHJvbWlzZXMgZm9yIE51dHMySlNPTiB0b3BvanNvbiBkYXRhLlxyXG4gICAgICovXHJcbiAgICBvdXQuZ2V0RGVmYXVsdEdlb0RhdGFQcm9taXNlID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGNvbnN0IG51dHNMZXZlbHMgPSBbMCwgMSwgMiwgM11cclxuICAgICAgICBjb25zdCBwcm9taXNlcyA9IFtdXHJcblxyXG4gICAgICAgIGNvbnN0IGJ1aWxkVXJsID0gKGJhc2UsIHllYXIsIGdlbywgcHJvaiwgc2NhbGUsIGxldmVsLCB3aXRoQ2VudGVyID0gZmFsc2UpID0+IHtcclxuICAgICAgICAgICAgbGV0IHBhdGggPSBgJHtiYXNlfS8ke3llYXJ9YFxyXG5cclxuICAgICAgICAgICAgLy8gSW5jbHVkZSBnZW8gcGFydCBpZiBpdCdzIHNwZWNpZmllZCBhbmQgbm90ICdFVVInIG9yICdXT1JMRCdcclxuICAgICAgICAgICAgaWYgKGdlbyAmJiBnZW8gIT09ICdFVVInICYmIGdlbyAhPT0gJ1dPUkxEJykgcGF0aCArPSBgLyR7Z2VvfWBcclxuXHJcbiAgICAgICAgICAgIC8vIEFkZCBwcm9qZWN0aW9uXHJcbiAgICAgICAgICAgIHBhdGggKz0gYC8ke3Byb2p9YFxyXG5cclxuICAgICAgICAgICAgLy8gQWRkIHNjYWxlIG9ubHkgaWYgbm90IHVzaW5nIGNlbnRlciBwb2ludHNcclxuICAgICAgICAgICAgaWYgKCF3aXRoQ2VudGVyICYmIHNjYWxlKSBwYXRoICs9IGAvJHtzY2FsZX1gXHJcblxyXG4gICAgICAgICAgICAvLyBBcHBlbmQgdGhlIGFwcHJvcHJpYXRlIGZpbGUgbmFtZVxyXG4gICAgICAgICAgICBwYXRoICs9IGAvJHt3aXRoQ2VudGVyID8gJ251dHNwdF8nIDogJyd9JHtsZXZlbH0uanNvbmBcclxuXHJcbiAgICAgICAgICAgIHJldHVybiBwYXRoXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAobWFwLm51dHNMZXZlbF8gPT09ICdtaXhlZCcgJiYgbWFwLmdlb18gIT09ICdXT1JMRCcpIHtcclxuICAgICAgICAgICAgbnV0c0xldmVscy5mb3JFYWNoKChsdmwpID0+XHJcbiAgICAgICAgICAgICAgICBwcm9taXNlcy5wdXNoKGpzb24oYnVpbGRVcmwobWFwLm51dHMyanNvbkJhc2VVUkxfLCBtYXAubnV0c1llYXJfLCBtYXAuZ2VvXywgbWFwLnByb2pfLCBtYXAuc2NhbGVfLCBsdmwpKSlcclxuICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICBpZiAod2l0aENlbnRlclBvaW50cykge1xyXG4gICAgICAgICAgICAgICAgbnV0c0xldmVscy5mb3JFYWNoKChsdmwpID0+XHJcbiAgICAgICAgICAgICAgICAgICAgcHJvbWlzZXMucHVzaChcclxuICAgICAgICAgICAgICAgICAgICAgICAganNvbihidWlsZFVybChtYXAubnV0czJqc29uQmFzZVVSTF8sIG1hcC5udXRzWWVhcl8sIG1hcC5nZW9fLCBtYXAucHJval8sIG1hcC5zY2FsZV8sIGx2bCwgdHJ1ZSkpXHJcbiAgICAgICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSBlbHNlIGlmIChtYXAuZ2VvXyA9PT0gJ1dPUkxEJykge1xyXG4gICAgICAgICAgICBwcm9taXNlcy5wdXNoKFxyXG4gICAgICAgICAgICAgICAganNvbignaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL2V1cm9zdGF0L2V1cm9zdGF0LW1hcC9tYXN0ZXIvc3JjL2Fzc2V0cy90b3BvanNvbi9XT1JMRF80MzI2Lmpzb24nKVxyXG4gICAgICAgICAgICApXHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgcHJvbWlzZXMucHVzaChqc29uKGJ1aWxkVXJsKG1hcC5udXRzMmpzb25CYXNlVVJMXywgbWFwLm51dHNZZWFyXywgbWFwLmdlb18sIG1hcC5wcm9qXywgbWFwLnNjYWxlXywgbWFwLm51dHNMZXZlbF8pKSlcclxuICAgICAgICAgICAgaWYgKHdpdGhDZW50ZXJQb2ludHMpIHtcclxuICAgICAgICAgICAgICAgIHByb21pc2VzLnB1c2goXHJcbiAgICAgICAgICAgICAgICAgICAganNvbihidWlsZFVybChtYXAubnV0czJqc29uQmFzZVVSTF8sIG1hcC5udXRzWWVhcl8sIG1hcC5nZW9fLCBtYXAucHJval8sIG1hcC5zY2FsZV8sIG1hcC5udXRzTGV2ZWxfLCB0cnVlKSlcclxuICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgcmV0dXJuIHByb21pc2VzXHJcbiAgICB9XHJcbiAgICAvKiogQ2hlY2tzIGlmIGFsbCBnZW8gZGF0YSBpcyByZWFkeSAqL1xyXG4gICAgb3V0LmlzR2VvUmVhZHkgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgaWYgKCFvdXQuZGVmYXVsdEdlb0RhdGEgJiYgIW91dC51c2VyR2VvbWV0cmllcykgcmV0dXJuIGZhbHNlXHJcblxyXG4gICAgICAgIGxldCBhbGxSZWFkeSA9IHRydWVcclxuXHJcbiAgICAgICAgZXhlY3V0ZUZvckFsbEluc2V0cyhtYXAuaW5zZXRUZW1wbGF0ZXNfLCBudWxsLCAoaW5zZXQpID0+IHtcclxuICAgICAgICAgICAgaWYgKCFpbnNldC5HZW9tZXRyaWVzLmlzR2VvUmVhZHkoKSkge1xyXG4gICAgICAgICAgICAgICAgYWxsUmVhZHkgPSBmYWxzZVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgIC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Sh0aGlzLmdlb0pTT05zLmdyYXRpY3VsZSlcclxuICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9kcmF3IGNvdW50cnkgcmVnaW9uc1xyXG4gICAgICAgIGlmICh0aGlzLmdlb0pTT05zLmNudHJnKSB7XHJcbiAgICAgICAgICAgIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tY250cmcnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWNudHJnJylcclxuICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmRhdGEodGhpcy5nZW9KU09Ocy5jbnRyZylcclxuICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9kcmF3IHdvcmxkIG1hcFxyXG4gICAgICAgIGlmICh0aGlzLmdlb0pTT05zLndvcmxkcmcpIHtcclxuICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS13b3JsZHJnJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS13b3JsZHJnJylcclxuICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmRhdGEodGhpcy5nZW9KU09Ocy53b3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ZSBzdGF0IGRhdGFcclxuICAgICAgICAgICAgICAgIC8vIHNlZSB1cGRhdGVDbGFzc2lmaWNhdGlvbiBhbmQgdXBkYXRlU3R5bGUgaW4gbWFwLWNob3JvcGxldGguanMgZm9yIGhpZGluZy9zaG93aW5nXHJcbiAgICAgICAgICAgICAgICA7W3RoaXMuZ2VvSlNPTnMubWl4ZWQucmcwLCB0aGlzLmdlb0pTT05zLm1peGVkLnJnMSwgdGhpcy5nZW9KU09Ocy5taXhlZC5yZzIsIHRoaXMuZ2VvSlNPTnMubWl4ZWQucmczXS5mb3JFYWNoKFxyXG4gICAgICAgICAgICAgICAgICAgIChyLCBpKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vYXBwZW5kIGVhY2ggbnV0cyBsZXZlbCB0byBtYXBcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1udXRzcmcnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLW51dHNyZycpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXRoJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKHIpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignZCcsIHBhdGhGdW5jdGlvbilcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdsdmwnLCBpKSAvL3RvIGJlIGFibGUgdG8gZGlzdGluZ3Vpc2ggbnV0cyBsZXZlbHNcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICApXHJcblxyXG4gICAgICAgICAgICAgICAgLy9hZGQga29zb3ZvXHJcbiAgICAgICAgICAgICAgICBpZiAoZ2VvID09ICdFVVInICYmIHByb2ogPT0gJzMwMzUnICYmIChudXRzWWVhciA9PSAnMjAxNicgfHwgbnV0c1llYXIgPT0gJzIwMjEnKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGFkZCBrb3Nvdm8gbWFudWFsbHlcclxuICAgICAgICAgICAgICAgICAgICBsZXQga29zb3ZvQm4gPSBmZWF0dXJlKGtvc292b0JuRmVhdHVyZXNbc2NhbGVdLCAnbnV0c2JuXzEnKS5mZWF0dXJlc1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2VtLWtvc292by1ibicpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1rb3Nvdm8tYm4gZW0tYm4tY2MnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXRoJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoa29zb3ZvQm4pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignZCcsIHBhdGhGdW5jdGlvbilcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vIHdoZW4gbnV0c0xldmVsIGlzIG5vdCAnbWl4ZWQnXHJcbiAgICAgICAgICAgICAgICBjb250YWluZXJcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tbnV0c3JnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbnV0c3JnJylcclxuICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXRoJylcclxuICAgICAgICAgICAgICAgICAgICAuZGF0YSh0aGlzLmdlb0pTT05zLm51dHNyZylcclxuICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2RyYXcgY291bnRyeSBib3VuZGFyaWVzXHJcbiAgICAgICAgaWYgKHRoaXMuZ2VvSlNPTnMuY250Ym4pIHtcclxuICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1jbnRibicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tY250Ym4nKVxyXG4gICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuZGF0YSh0aGlzLmdlb0pTT05zLmNudGJuKVxyXG4gICAgICAgICAgICAgICAgLmVudGVyKClcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbiAoYm4pIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoYm4ucHJvcGVydGllcy5ldSA9PSAnVCcpIHJldHVybiBiblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmVmdGEgPT0gJ1QnKSByZXR1cm4gYm5cclxuICAgICAgICAgICAgICAgICAgICBpZiAoYm4ucHJvcGVydGllcy5jYyA9PSAnVCcpIHJldHVybiBiblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLm90aCA9PSAnVCcpIHJldHVybiBiblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmNvID09ICdUJykgcmV0dXJuIGJuXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2QnLCBwYXRoRnVuY3Rpb24pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAoYm4pID0+ICdlbS1ibi0nICsgYm4ucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGZ1bmN0aW9uIChibikge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBjbGFzc0xpc3QgPSBbXVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBpZiAoYm4ucHJvcGVydGllcy5ldSA9PT0gJ1QnKSBjbGFzc0xpc3QucHVzaCgnZW0tYm4tZXUnKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmVmdGEgPT09ICdUJykgY2xhc3NMaXN0LnB1c2goJ2VtLWJuLWVmdGEnKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmNjID09PSAnVCcpIGNsYXNzTGlzdC5wdXNoKCdlbS1ibi1jYycpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGJuLnByb3BlcnRpZXMub3RoID09PSAnVCcpIGNsYXNzTGlzdC5wdXNoKCdlbS1ibi1vdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmNvID09PSAnVCcpIGNsYXNzTGlzdC5wdXNoKCdlbS1ibi1jbycpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmlkID09IDE1NikgY29uc29sZS5sb2coY2xhc3NMaXN0LCBibilcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2xhc3NMaXN0LmpvaW4oJyAnKSAvLyBVc2Ugam9pbiB3aXRoIGEgc3BhY2UgdG8gY3JlYXRlIGEgdmFsaWQgY2xhc3Mgc3RyaW5nXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9kcmF3IE5VVFMgYm91bmRhcmllc1xyXG4gICAgICAgIGlmICh0aGlzLmdlb0pTT05zLm51dHNibikge1xyXG4gICAgICAgICAgICB0aGlzLmdlb0pTT05zLm51dHNibi5zb3J0KGZ1bmN0aW9uIChibjEsIGJuMikge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGJuMi5wcm9wZXJ0aWVzLmx2bCAtIGJuMS5wcm9wZXJ0aWVzLmx2bFxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICBjb250YWluZXJcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2VtLW51dHNibicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbnV0c2JuJylcclxuICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmRhdGEodGhpcy5nZW9KU09Ocy5udXRzYm4pXHJcbiAgICAgICAgICAgICAgICAuZW50ZXIoKVxyXG4gICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbiAoYm4pIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoYm4ucHJvcGVydGllcy5ldSA9PSAnVCcpIHJldHVybiBiblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmVmdGEgPT0gJ1QnKSByZXR1cm4gYm5cclxuICAgICAgICAgICAgICAgICAgICBpZiAoYm4ucHJvcGVydGllcy5jYyA9PSAnVCcpIHJldHVybiBiblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLm90aCA9PSAnVCcpIHJldHVybiBiblxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChibi5wcm9wZXJ0aWVzLmNvID09ICdUJykgcmV0dXJuIGJuXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZCcsIHBhdGhGdW5jdGlvbilcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGZ1bmN0aW9uIChibikge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBwcm9wcyA9IGJuLnByb3BlcnRpZXNcclxuICAgICAgICAgICAgICAgICAgICAvL0tPU09WT1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcm9wcy5pZCA+IDEwMDAwMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2VtLWtvc292by1ibidcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHByb3BzLmNvID09PSAnVCcpIHJldHVybiAnZW0tYm4tY28nXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY2wgPSBbJ2VtLWJuLScgKyBwcm9wcy5sdmxdXHJcbiAgICAgICAgICAgICAgICAgICAgLy9pZiAoYm4ub3RoID09PSBcIlRcIikgY2wucHVzaChcImJuLW90aFwiKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2wuam9pbignICcpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgaWYgKGdlbyA9PSAnRVVSJyAmJiBwcm9qID09ICczMDM1JyAmJiAobnV0c1llYXIgPT0gJzIwMTYnIHx8IG51dHNZZWFyID09ICcyMDIxJykpIHtcclxuICAgICAgICAgICAgICAgIC8vIGFkZCBrb3Nvdm8gbWFudWFsbHlcclxuICAgICAgICAgICAgICAgIGxldCBrb3Nvdm9CbiA9IGZlYXR1cmUoa29zb3ZvQm5GZWF0dXJlc1tzY2FsZV0sICdudXRzYm5fMScpLmZlYXR1cmVzXHJcblxyXG4gICAgICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2VtLWtvc292by1ibicpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWtvc292by1ibicpXHJcbiAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmRhdGEoa29zb3ZvQm4pXHJcbiAgICAgICAgICAgICAgICAgICAgLmVudGVyKClcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignZCcsIHBhdGhGdW5jdGlvbilcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9kcmF3IHdvcmxkIGJvdW5kYXJpZXNcclxuICAgICAgICBpZiAodGhpcy5nZW9KU09Ocy53b3JsZGJuKSB7XHJcbiAgICAgICAgICAgIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0td29ybGRibicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0td29ybGRibicpXHJcbiAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5kYXRhKHRoaXMuZ2VvSlNPTnMud29ybGRibilcclxuICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgZnVuY3Rpb24gKGJuKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGJuLnByb3BlcnRpZXMuUE9MX1NUQVQgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZGlzcHV0ZWRcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdlbS1ibi1kJ1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYm4ucHJvcGVydGllcy5DT0FTX0ZMQUcgPT09ICdUJyA/ICdlbS1ibi1jbycgOiAnZW0td29ybGRibidcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC8vLmF0dHIoXCJpZFwiLCAoYm4pID0+IGJuLnByb3BlcnRpZXMuQ05UUl9CTl9JRClcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmICh0aGlzLmdlb0pTT05zLmtvc292bykge1xyXG4gICAgICAgICAgICAvL2FkZCBrb3Nvdm8gdG8gd29ybGQgbWFwXHJcbiAgICAgICAgICAgIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0ta29zb3ZvLWJuJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1rb3Nvdm8tYm4nKVxyXG4gICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuZGF0YSh0aGlzLmdlb0pTT05zLmtvc292bylcclxuICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgIH1cclxuICA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IoJ3gnLCBmdW5jdGlvbiAoZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChkLnJvdGF0ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMCAvL2ZvciByb3RhdGVkIHRleHQsIHggYW5kIHkgcG9zaXRpb25zIG11c3QgYmUgc3BlY2lmaWVkIGluIHRoZSB0cmFuc2Zvcm0gcHJvcGVydHlcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hcC5fcHJvamVjdGlvbihbZC54LCBkLnldKVswXVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgZnVuY3Rpb24gKGQpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoZC5yb3RhdGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDAgLy9mb3Igcm90YXRlZCB0ZXh0LCB4IGFuZCB5IHBvc2l0aW9ucyBtdXN0IGJlIHNwZWNpZmllZCBpbiB0aGUgdHJhbnNmb3JtIHByb3BlcnR5XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXAuX3Byb2plY3Rpb24oW2QueCwgZC55XSlbMV1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZHknLCAtNykgLy8gc2V0IHkgcG9zaXRpb24gb2YgYm90dG9tIG9mIHRleHRcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAoZCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChkLnJvdGF0ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcG9zID0gbWFwLl9wcm9qZWN0aW9uKFtkLngsIGQueV0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB4ID0gcG9zWzBdXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB5ID0gcG9zWzFdXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBgdHJhbnNsYXRlKCR7eH0sJHt5fSkgcm90YXRlKCR7ZC5yb3RhdGV9KWBcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3JvdGF0ZSgwKSdcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24gKGQpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC50ZXh0XHJcbiAgICAgICAgICAgICAgICB9KSAvLyBkZWZpbmUgdGhlIHRleHQgdG8gZGlzcGxheVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9MQUJFTCB0ZXh0c1xyXG4gICAgICAgIGxhYmVsZ1xyXG4gICAgICAgICAgICAuc2VsZWN0QWxsKCd0ZXh0JylcclxuICAgICAgICAgICAgLmRhdGEobGFiZWxzQXJyYXkpXHJcbiAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAuYXR0cignaWQnLCAoZCkgPT4gJ2VtLWxhYmVsLScgKyBkLnRleHQucmVwbGFjZSgvXFxzKy9nLCAnLScpKVxyXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAoZCkgPT4gJ2VtLWxhYmVsIGVtLWxhYmVsLScgKyBkLmNsYXNzKVxyXG4gICAgICAgICAgICAvL3Bvc2l0aW9uIGxhYmVsXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgZnVuY3Rpb24gKGQpIHtcclxuICAgICAgICAgICAgICAgIGlmIChkLnJvdGF0ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAwIC8vZm9yIHJvdGF0ZWQgdGV4dCwgeCBhbmQgeSBwb3NpdGlvbnMgbXVzdCBiZSBzcGVjaWZpZWQgaW4gdGhlIHRyYW5zZm9ybSBwcm9wZXJ0eVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIG1hcC5fcHJvamVjdGlvbihbZC54LCBkLnldKVswXVxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuYXR0cigneScsIGZ1bmN0aW9uIChkKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoZC5yb3RhdGUpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMCAvL2ZvciByb3RhdGVkIHRleHQsIHggYW5kIHkgcG9zaXRpb25zIG11c3QgYmUgc3BlY2lmaWVkIGluIHRoZSB0cmFuc2Zvcm0gcHJvcGVydHlcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHJldHVybiBtYXAuX3Byb2plY3Rpb24oW2QueCwgZC55XSlbMV1cclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgLmF0dHIoJ2R5JywgLTcpIC8vIHNldCB5IHBvc2l0aW9uIG9mIGJvdHRvbSBvZiB0ZXh0XHJcbiAgICAgICAgICAgIC8vdHJhbnNmb3JtIGxhYmVscyB3aGljaCBoYXZlIGEgXCJyb3RhdGVcIiBwcm9wZXJ0eSBpbiB0aGUgbGFiZWxzIGNvbmZpZy4gRm9yIHJvdGF0ZWQgbGFiZWxzLCB0aGVpciBYLFkgbXVzdCBhbHNvIGJlIHNldCBpbiB0aGUgdHJhbnNmb3JtLlxyXG4gICAgICAgICAgICAvLyBub3RlOiBkb250IGFwcGx5IHRvIGNvdW50cnkgY29kZSBsYWJlbHNcclxuICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIChkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoZC5yb3RhdGUpIHtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgcG9zID0gbWFwLl9wcm9qZWN0aW9uKFtkLngsIGQue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JvamVjdGlvbihbXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hcC5sYWJlbHNfLnN0YXRMYWJlbHNQb3NpdGlvbnNbZC5wcm9wZXJ0aWVzLmlkXS54LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXAubGFiZWxzXy5zdGF0TGFiZWxzUG9zaXRpb25zW2QucHJvcGVydGllcy5pZF0ueSxcclxuICAgICAgICAgICAgICAgICAgICBdKVxyXG4gICAgICAgICAgICAgICAgICAgIGxldCB4ID0gcG9zWzBdLnRvRml4ZWQoMylcclxuICAgICAgICAgICAgICAgICAgICBsZXQgeSA9IHBvc1sxXS50b0ZpeGVkKDMpXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGB0cmFuc2xhdGUoJHt4fSwke3l9KWBcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNlbnRyb2lkID0gbWFwLl9wYXRoRnVuY3Rpb24uY2VudHJvaWQoZClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5sYWJlbHNfLnByb2Nlc3NWYWx1ZUxhYmVsQ2VudHJvaWRzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRyb2lkID0gbWFwLmxhYmVsc18ucHJvY2Vzc1ZhbHVlTGFiZWxDZW50cm9pZHMoZCwgY2VudHJvaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIC8vIG90aGVyd2lzZSB3ZSBjYWxjdWxhdGUgY2VudHJvaWRzXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArIGNlbnRyb2lkICsgJyknXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tc3RhdC1sYWJlbC1zaGFkb3cnKVxyXG4gICAgfVxyXG59X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XHJcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG91dFthdHRdXHJcblxyXG4gICAgICAgICAgICBpZiAodHlwZW9mIHYgPT09ICdvYmplY3QnICYmIHYgIT09IG51bGwgJiYgIUFycmF5LmlzQXJyYXkodikpIHtcclxuICAgICAgICAgICAgICAgIC8vb3ZlcnJpZGUgZGVmYXVsdCBwcm9wZXJ0aWVzXHJcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHAgaW4gdikge1xyXG4gICAgICAgICAgICAgICAgICAgIG91dFthdHRdW3BdID0gdltwXVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgb3V0W2F0dF0gPSB2XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vcmVjdXJzaXZlIGNhbGwgdG8gaW5zZXQgY29tcG9uZW50c1xyXG4gICAgICAgICAgICBpZiAob3V0Lmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgZXhlY3V0ZUZvckFsbEluc2V0cyhcclxuICAgICAgICAgICAgICAgICAgICBvdXQuaW5zZXRUZW1wbGF0ZXNfLFxyXG4gICAgICAgICAgICAgICAgICAgIG91dC5zdmdJZF8sXHJcbiAgICAgICAgICAgICAgICAgICAgKGluc2V0LCB2YWx1ZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBmbk5hbWUgPSBhdHQuc3Vic3RyaW5nKDAsIGF0dC5sZW5ndGggLSAxKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpbnNldFtmbk5hbWVdKHZhbHVlKVxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgdlxyXG4gICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiBvdXRcclxuICAgICAgICB9XHJcbiAg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ICAgICAgICAgICAgICBncmF0aWN1bGUucmVtb3ZlKClcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBpZiBtYXAgYWxyZWFkeSBjcmVhdGVkIGFuZCBhcmd1bWVudCBpcyB0cnVlXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAob3V0Lkdlb21ldHJpZXMuZ2VvSlNPTnMuZ3JhdGljdWxlICYmIG91dC5fcGF0aEZ1bmN0aW9uICYmIHpnICYmIHYgPT0gdHJ1ZSkge1xyXG4gICAgICAgICAgICAgICAgLy9yZW1vdmUgZXhpc3RpbmcgZ3JhdGljdWxlXHJcbiAgICAgICAgICAgICAgICBncmF0aWN1bGUucmVtb3ZlKClcclxuICAgICAgICAgICAgICAgIC8vIGFkZCBuZXcgZ3JhdGljdWxlXHJcbiAgICAgICAgICAgICAgICB6Zy5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1ncmF0aWN1bGUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5kYXRhKG91dC5HZW9tZXRyaWVzLmdlb0pTT05zLmdyYXRpY3VsZSlcclxuICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgb3V0Ll9wYXRoRnVuY3Rpb24pXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWdyYXRpY3VsZScpXHJcblxyXG4gICAgICAgICAgICAgICAgb3V0LnN2ZygpXHJcbiAgICAgICAgICAgICAgICAgICAgLnNlbGVjdCgnI2VtLWdyYXRpY3VsZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBtb3ZlIGdyYXRpY3VsZSBiZWhpbmQgbGFuZCBtYXNzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG91dC5nZW9fID09ICdXT1JMRCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGhpcy5wYXJlbnROb2RlLmluc2VydEJlZm9yZSh0aGlzLCB0aGlzLnBhcmVudE5vZGUuY2hpbGROb2Rlc1szXSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogdGhpcy5wYXJlbnROb2RlLmluc2VydEJlZm9yZSh0aGlzLCB0aGlzLnBhcmVudE5vZGUuY2hpbGROb2Rlc1sxXSlcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBvdXRcclxuICAgIH1cclxuXHJcbiAgICAvL2NvYXN0YWwgbWFyZ2luIG92ZXJyaWRlXHJcbiAgICBvdXQuZHJhd0NvYXN0YWxNYXJnaW4gPSBmdW5jdGlvbiAodikge1xyXG4gICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG91dC5kcmF3Q29hc3RhbE1hcmdpbl9cclxuICAgICAgICBvdXQuZHJhd0NvYXN0YWxNYXJnaW5fID0gdlxyXG5cclxuICAgICAgICAvL3VwZGF0ZSBleGlzdGluZ1xyXG4gICAgICAgIGlmIChvdXQuc3ZnXykge1xyXG4gICAgICAgICAgICBsZXQgbWFyZ2luID0gc2VsZWN0QWxsKCcjZW0tY29hc3QtbWFyZ2luJylcclxuICAgICAgICAgICAgbGV0IGZpbHRlciA9IHNlbGVjdCgnI2VtLWNvYXN0YWwtYmx1cicpXHJcbiAgICAgICAgICAgIGxldCB6ZyA9IHNlbGVjdCgnI2VtLXpvb20tZ3JvdXAtJyArIG91dC5zdmdJZF8pIHx8IG51bGxcclxuICAgICAgICAgICAgaWYgKG1hcmdpbi5fZ3JvdXBzWzBdWzBdICYmIHYgPT0gZmFsc2UpIHtcclxuICAgICAgICAgICAgICAgIC8vIHJlbW92ZSBleGlzdGluZ1xyXG4gICAgICAgICAgICAgICAgbWFyZ2luLnJlbW92ZSgpXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodiA9PSB0cnVlICYmIG91dC5fcGF0aEZ1bmN0aW9uICYmIHpnKSB7XHJcbiAgICAgICAgICAgICAgICAvL3JlbW92ZSBleGlzdGluZyBncmF0aWN1bGVcclxuICAgICAgICAgICAgICAgIG1hcmdpbi5yZW1vdmUoKVxyXG4gICAgICAgICAgICAgICAgZmlsdGVyLnJlbW92ZSgpXHJcbiAgICAgICAgICAgICAgICAvL2FkZCBmaWx0ZXJcclxuICAgICAgICAgICAgICAgIG91dC5zdmdfXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnZmlsdGVyJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tY29hc3RhbC1ibHVyJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsICctMjAwJScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3knLCAnLTIwMCUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsICc0MDAlJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgJzQwMCUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ2ZlR2F1c3NpYW5CbHVyJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaW4nLCAnU291cmNlR3JhcGhpYycpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3N0ZERldmlhdGlvbicsIG91dC5jb2FzdGFsTWFyZ2luU3RkRGV2XylcclxuXHJcbiAgICAgICAgICAgICAgICAvL2RyYXcgZm9yIG1haW4gbWFwIC0gZ2VvbWV0cmllcyBhcmUgc3RpbGwgaW4gbWVtb3J5IHNvIG5vIHJlYnVpbGQgbmVlZGVkXHJcbiAgICAgICAgICAgICAgICBjb25zdCBkcmF3TmV3Q29hc3RhbE1hcmdpbiA9IChtYXApID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAvLyB6b29tIGdyb3VwIG1pZ2h0IG5vdCBiZSBpbnNpZGUgbWFpbiBtYXAgKG91dC5zdmdfKVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHpvb21Hcm91cCA9IHNlbGVjdCgnI2VtLXpvb20tZ3JvdXAtJyArIG1hcC5zdmdJZF8pXHJcbiAgICAgICAgICAgICAgICAgICAgLy9kcmF3IG5ldyBjb2FzdGFsIG1hcmdpblxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNnID0gem9vbUdyb3VwLmFwcGVuZCgnZycpLmF0dHIoJ2lkJywgJ2VtLWNvYXN0LW1hcmdpbicpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC8vY291bnRyaWVzIGJuXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5fZ2VvbS5jbnRibilcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2cuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1jb2FzdC1tYXJnaW4tY250JylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEobWFwLl9nZW9tLmNudGJuKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVudGVyKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24gKGJuKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJuLnByb3BlcnRpZXMuY28gPT09ICdUJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2QnLCBtYXAuX3BhdGhGdW5jdGlvbilcclxuICAgICAgICAgICAgICAgICAgICAvL251dHMgYm5cclxuICAgICAgICAgICAgICAgICAgICBpZiAobWFwLl9nZW9tLm51dHNibilcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2cuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1jb2FzdC1tYXJnaW4tbnV0cycpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXRoJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKG1hcC5fZ2VvbS5udXRzYm4pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbiAoYm4pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYm4ucHJvcGVydGllcy5jbyA9PT0gJ1QnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignZCcsIG1hcC5fcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgICAgICAgICAgICAgIC8vd29ybGQgYm5cclxuICAgICAgICAgICAgICAgICAgICBpZiAobWFwLl9nZW9tLndvcmxkYm4pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNnLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tY29hc3QtbWFyZ2luLW51dHMnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShtYXAuX2dlb20ud29ybGRibilcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChibikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBibi5wcm9wZXJ0aWVzLkNPQVNfRkxBRyA9PT0gJ1QnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignZCcsIG1hcC5fcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIC8vZHJhdyBmb3IgaW5zZXRzIC0gcmVxdWlyZXMgZ2VvbWV0cmllcyBzbyB3ZSBoYXZlIHRvIHJlYnVpbGQgYmFzZSB0ZW1wbGF0ZVxyXG4gICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc18gJiYgb3V0LmRyYXdDb2FzdGFsTWFyZ2luXykge1xyXG4gICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lmluc2V0VGVtcGxhdGVzXywgb3V0LnN2Z0lkXywgZHJhd05ld0NvYXN0YWxNYXJnaW4pXHJcbiAgICAgICAgICAgICAgICAgICAgZHJhd05ld0NvYXN0YWxNYXJnaW4ob3V0KVxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIC8vIG1vdmUgbWFyZ2luIHRvIGJhY2sgKGluIGZyb250IG9mIHNlYSlcclxuICAgICAgICAgICAgICAgIHNlbGVjdEFsbCgnI2VtLWNvYXN0LW1hcmdpbicpLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIG91dC5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mQgZDMgem9vbVxyXG4gICAgICovXHJcbiAgICBvdXQuYnVpbGRNYXBUZW1wbGF0ZUJhc2UgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgLy9nZXQgc3ZnIGVsZW1lbnQuIENyZWF0ZSBpdCBpZiBpdCBkb2VzIG5vdCBleGlzdHNcclxuICAgICAgICBsZXQgc3ZnID0gc2VsZWN0KCcjJyArIG91dC5zdmdJZCgpKVxyXG4gICAgICAgIGlmIChzdmcuc2l6ZSgpID09IDApIHtcclxuICAgICAgICAgICAgc3ZnID0gc2VsZWN0KCdib2R5JykuYXBwZW5kKCdzdmcnKS5hdHRyKCdpZCcsIG91dC5zdmdJZCgpKVxyXG4gICAgICAgIH1cclxuICAgICAgICBzdmcuYXR0cignY2xhc3MnLCAnZW0tbWFwJylcclxuICAgICAgICBvdXQuc3ZnXyA9IHN2Z1xyXG5cclxuICAgICAgICAvL3NldCBjb250YWluZXIgZm9yIGNhc2VzIHdoZXJlIGNvbnRhaW5lciBjb250YWlucyB2YXJpb3VzIG1hcHNcclxuICAgICAgICBpZiAoIW91dC5jb250YWluZXJJZF8pIG91dC5jb250YWluZXJJZF8gPSBvdXQuc3ZnSWRfXHJcbiAgICAgICAgLy90b29sdGlwIG5lZWRzIHRvIGtub3cgY29udGFpbmVyIHRvIHByZXZlbnQgb3ZlcmZsb3dcclxuICAgICAgICBpZiAoIW91dC50b29sdGlwXy5jb250YWluZXJJZCkge1xyXG4gICAgICAgICAgICBvdXQudG9vbHRpcF8uY29udGFpbmVySWQgPSBvdXQuY29udGFpbmVySWRfXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2NsZWFyIFNWRyAodG8gYXZvaWQgYnVpbGRpbmcgbXVsdGlwbGUgc3ZncyBvbiB0b3Agb2YgZWFjaCBvdGhlciBkdXJpbmcgbXVsdGlwbGUgYnVpbGQoKSBjYWxscylcclxuICAgICAgICBzZWxlY3RBbGwoJyMnICsgb3V0LnN2Z0lkKCkgKyAnID4g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gICAgICAgICAgLmF0dHIoJ2lkJywgb3V0LnN2Z0lkXyArICctY2xpcC1wYXRoJylcclxuICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdkJywgY29udmVydFJlY3RhbmdsZXMoMCwgMCwgb3V0LndpZHRoXywgb3V0LmhlaWdodF8pKVxyXG5cclxuICAgICAgICBpZiAob3V0LmRyYXdDb2FzdGFsTWFyZ2luXykge1xyXG4gICAgICAgICAgICAvL2RlZmluZSBmaWx0ZXIgZm9yIGNvYXN0YWwgbWFyZ2luXHJcbiAgICAgICAgICAgIHN2Zy5hcHBlbmQoJ2ZpbHRlcicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tY29hc3RhbC1ibHVyJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgJy0yMDAlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgJy0yMDAlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsICc0MDAlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAnNDAwJScpXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdmZUdhdXNzaWFuQmx1cicpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaW4nLCAnU291cmNlR3JhcGhpYycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignc3RkRGV2aWF0aW9uJywgb3V0LmNvYXN0YWxNYXJnaW5TdGREZXZfKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9jcmVhdGUgZHJhd2luZyBncm91cCwgYXMgZmlyc3QgY2hpbGRcclxuICAgICAgICBjb25zdCBkZyA9IHN2Z1xyXG4gICAgICAgICAgICAuaW5zZXJ0KCdnJywgJzpmaXJzdC1jaGlsZCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1kcmF3aW5nLScgKyBvdXQuc3ZnSWRfKVxyXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tZHJhd2luZy1ncm91cCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGlwLXBhdGgnLCAndXJsKCMnICsgb3V0LnN2Z0lkXyArICctY2xpcC1wYXRoJyArICcpJylcclxuXHJcbiAgICAgICAgLy9jcmVhdGUgbWFpbiB6b29tIGdyb3VwXHJcbiAgICAgICAgY29uc3QgemcgPSBkZ1xyXG4gICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2VtLXpvb20tZ3JvdXAtJyArIG91dC5zdmdJZF8pXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS16b29tLWdyb3VwJykgLy9vdXQuZ2VvIGNoYW5nZWQgdG8gb3V0LnN2Z0lkIGluIG9yZGVyIHRvIGJlIHVuaXF1ZVxyXG5cclxuICAgICAgICAvL2luc2V0c1xyXG4gICAgICAgIG91dC5yZW1vdmVJbnNldHMoKSAvL3JlbW92ZSBleGlzdGluZ1xyXG4gICAgICAgIG91dC5idWlsZEluc2V0cygpIC8vYnVpbGQgbmV3XHJcblxyXG4gICAgICAgIC8vZHJhdyBmcmFtZVxyXG4gICAgICAgIGRnLmFwcGVuZCgncmVjdCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1mcmFtZS0nICsgb3V0Lmdlb18pXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1mcmFtZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgMClcclxuICAgICAgICAgICAgLmF0dHIoJ3knLCAwKVxyXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCBvdXQud2lkdGhfKVxyXG4gICAgICAgICAgICAuYXR0cignaGVpZ2h0Jywgb3V0LmhlaWdodF8pXHJcblxyXG4gICAgICAgIHJldHVybiBvdXRcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIFJlbW92ZSBpbnNldH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gY29uZmlnLnN2Z0lkID0gY29uZmlnLnN2Z0lkIHx8ICdpbnNldCcgKyBjb25maWcuZ2VvICsgTWF0aC5yYW5kb20oKS50b1N0cmluZygzNikuc3Vic3RyaW5nKDcpXHJcblxyXG4gICAgICAgICAgICAvL2dldCBzdmcgZWxlbWVudC5cclxuICAgICAgICAgICAgbGV0IHN2ZyA9IHNlbGVjdCgnIycgKyBjb25maWcuc3ZnSWQpXHJcbiAgICAgICAgICAgIGlmIChzdmcuc2l6ZSgpID09IDApIHtcclxuICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBpdCBhcyBhbiBlbWJlZGVkIFNWRyBpZiBpdCBkb2VzIG5vdCBleGlzdFxyXG4gICAgICAgICAgICAgICAgY29uc3QgeCA9IGNvbmZpZy54ID09IHVuZGVmaW5lZCA/IG91dC5pbnNldEJveFBhZGRpbmdfIDogY29uZmlnLnhcclxuICAgICAgICAgICAgICAgIGNvbnN0IHkgPVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy55ID09IHVuZGVmaW5lZCA/IG91dC5pbnNldEJveFBhZGRpbmdfICsgaSAqIChvdXQuaW5zZXRCb3hQYWRkaW5nXyArIG91dC5pbnNldEJveFdpZHRoXykgOiBjb25maWcueVxyXG4gICAgICAgICAgICAgICAgY29uc3QgZ2dlbyA9IGluZ1xyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1pbnNldC0nICsgY29uZmlnLnN2Z0lkKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1pbnNldCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIHggKyAnLCcgKyB5ICsgJyknKVxyXG4gICAgICAgICAgICAgICAgZ2dlby5hcHBlbmQoJ3N2ZycpLmF0dHIoJ2lkJywgY29uZmlnLnN2Z0lkKVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvLyBidWlsZCBpbnNldFxyXG4gICAgICAgICAgICAvLyBHSVNDTy0yNjc2IC0gUFQgYXpvcmVzIGluc2V0IGhhcyAyIGluc2V0cyB3aXRoIHRoZSBzYW1lIEdlbywgc28gc2Vjb25kIHdhcyBvdmVycmlkaW5nIGZpcnN0OlxyXG4gICAgICAgICAgICBpZiAob3V0Lmluc2V0VGVtcGxhdGVzX1tjb25maWcuZ2VvXSkge1xyXG4gICAgICAgICAgICAgICAgLy9pZiBpbnNldCBhbHJlYWR5IGV4aXN0cyBpbiBtYXAgd2l0aCBzYW1lIGdlbywgdGhlbiBwdXNoIGJvdGggdG8gYW4gYXJyYXlcclxuICAgICAgICAgICAgICAgIGxldCBpbnNldCA9IGJ1aWxkSW5zZXQoY29uZmlnLCBvdXQpXHJcbiAgICAgICAgICAgICAgICBpbnNldC5idWlsZE1hcFRlbXBsYXRlQmFzZSgpXHJcbiAgICAgICAgICAgICAgICBvdXQuaW5zZXRUZW1wbGF0ZXNfW2NvbmZpZy5nZW9dID0gW291dC5pbnNldFRlbXBsYXRlc19bY29uZmlnLmdlb10sIGluc2V0XVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgbGV0IGluc2V0ID0gYnVpbGRJbnNldChjb25maWcsIG91dClcclxuICAgICAgICAgICAgICAgIGxldCBkcmF3bkluc2V0ID0gaW5zZXQuYnVpbGRNYXBUZW1wbGF0ZUJhc2UoKVxyXG4gICAgICAgICAgICAgICAgb3V0Lmluc2V0VGVtcGxhdGVzX1tjb25maWcuZ2VvXSA9IGRyYXduSW5zZXRcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogQnVpZCBhbiBlbXB0eSBtYXAgdGVtcGxhdGUsIGJhc2VkIG9uIHRoZ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oJ2lkJywgJ3NlYScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zZWEnKVxyXG4gICAgICAgICAgICAuYXR0cigneCcsIC01ICogb3V0LndpZHRoXylcclxuICAgICAgICAgICAgLmF0dHIoJ3knLCAtNSAqIG91dC5oZWlnaHRfKVxyXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCAxMSAqIG91dC53aWR0aF8pXHJcbiAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAxMSAqIG91dC5oZWlnaHRfKVxyXG5cclxuICAgICAgICAvL3NwaGVyZSBmb3Igd29ybGQgbWFwXHJcbiAgICAgICAgaWYgKG91dC5nZW9fID09ICdXT1JMRCcpIHtcclxuICAgICAgICAgICAgem9vbUdyb3VwXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5kYXR1bSh7IHR5cGU6ICdTcGhlcmUnIH0pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnc3BoZXJlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgb3V0Ll9wYXRoRnVuY3Rpb24pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tZ3JhdGljdWxlJylcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmIChvdXQuZHJhd0NvYXN0YWxNYXJnaW5fKSB7XHJcbiAgICAgICAgICAgIGFkZENvYXN0YWxNYXJnaW5Ub01hcCgpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAob3V0Lmdlb21ldHJpZXNfKSB7XHJcbiAgICAgICAgICAgIG91dC5HZW9tZXRyaWVzLmFkZFVzZXJHZW9tZXRyaWVzVG9NYXAob3V0Lmdlb21ldHJpZXNfLCB6b29tR3JvdXAsIG91dC5fcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIG91dC5HZW9tZXRyaWVzLmFkZERlZmF1bHRHZW9tZXRyaWVzVG9NYXAoXHJcbiAgICAgICAgICAgICAgICB6b29tR3JvdXAsXHJcbiAgICAgICAgICAgICAgICBvdXQuZHJhd0dyYXRpY3VsZV8sXHJcbiAgICAgICAgICAgICAgICBvdXQuX3BhdGhGdW5jdGlvbixcclxuICAgICAgICAgICAgICAgIG91dC5udXRzTGV2ZWxfLFxyXG4gICAgICAgICAgICAgICAgb3V0Lm51dHNZZWFyXyxcclxuICAgICAgICAgICAgICAgIG91dC5nZW9fLFxyXG4gICAgICAgICAgICAgICAgb3V0LnByb2pfLFxyXG4gICAgICAgICAgICAgICAgb3V0LnNjYWxlX1xyXG4gICAgICAgICAgICApXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL3ByZXBhcmUgZ3JvdXAgZm9yIHByb3BvcnRpb25hbCBzeW1ib2xzLCB3aXRoIGNlbnRyb2lkc1xyXG4gICAgICAgIGlmICh3aXRoQ2VudGVyUG9pbnRzKSB7XHJcbiAgICAgICAgICAgIGFkZENlbnRyb2lkc1RvTWFwKG91dClcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIGFkZCBnZW9ncmFwaGljYWwgbGFiZWxzIHRvIG1hcFxyXG4gICAgICAgIGlmIChvdXQubGFiZWxzXykge1xyXG4gICAgICAgICAgICBhZGRMYWJlbHNUb01hcChvdXQsIHpvb21Hcm91cClcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmIChvdXQuYW5ub3RhdGlvbnNfKSB7XHJcbiAgICAgICAgICAgIGFwcGVuZEFubm90YXRpb25zKHpvb21Hcm91cCwgb3V0LmFubm90YXRpb25zXylcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vdGl0bGVcclxuICAgICAgICBpZiAob3V0LnRpdGxlKCkpIHtcclxuICAgICAgICAgICAgLy9kZWZpbmUgZGVmYXVsdCBwb3NpdGlvblxyXG4gICAgICAgICAgICBsZXQgY3NzQ2xhc3MgPSBvdXQuaXNJbnNldCA/ICdlbS1pbnNldC10aXRsZScgOiAnZW0tdGl0bGUnXHJcbiAgICAgICAgICAgIGlmICghb3V0LnRpdGxlUG9zaXRpb24oKSkgb3V0LnRpdGxlUG9zaXRpb24oWzEwLCBnZXRGb250U2l6ZUZyb21DbGFzcyhjc3NDbGFzcykgKyAob3V0LmlzSW5zZXQgPyAwIDogMTApXSlcclxuICAgICAgICAgICAgLy9kcmF3IHRpdGxlXHJcbiAgICAgICAgICAgIG91dC5zdmcoKVxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAndGl0bGUnICsgb3V0Lmdlb18pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCBjc3NDbGFzcylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LnRpdGxlUG9zaXRpb24oKVswXSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5Jywgb3V0LnRpdGxlUG9zaXRpb24oKVsxXSlcclxuICAgICAgICAgICAgICAgIC5odG1sKG91dC50aXRsZSgpKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKG91dC5zdWJ0aXRsZSgpKSB7XHJcbiAgICAgICAgICAgIGxldCBjc3NTdWJ0aXRsZUNsYXNzID0gb3V0LmlzSW5zZXQgPyAnZW0taW5zZXQtc3VidGl0bGUnIDogJ2VtLXN1YnRpdGxlJ1xyXG4gICAgICAgICAgICBsZXQgY3NzVGl0bGVDbGFzcyA9IG91dC5pc0luc2V0ID8gJ2VtLWluc2V0LXRpdGxlJyA6ICdlbS10aXRsZSdcclxuICAgICAgICAgICAgLy9kZWZpbmUgZGVmYXVsdCBwb3NpdGlvblxyXG4gICAgICAgICAgICBpZiAoIW91dC5zdWJ0aXRsZVBvc2l0aW9uKCkpXHJcbiAgICAgICAgICAgICAgICBvdXQuc3VidGl0bGVQb3NpdGlvbihbMTAsIGdldEZvbnRTaXplRnJvbUNsYXNzKGNzc1RpdGxlQ2xhc3MpICsgZ2V0Rm9udFNpemVGcm9tQ2xhc3MoY3NzU3VidGl0bGVDbGFzcykgKyAxNV0pXHJcbiAgICAgICAgICAgIC8vZHJhdyBzdWJ0aXRsZVxyXG4gICAgICAgICAgICBvdXQuc3ZnKClcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ3N1YnRpdGxlJyArIG91dC5nZW9fKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgY3NzU3VidGl0bGVDbGFzcylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LnN1YnRpdGxlUG9zaXRpb24oKVswXSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5Jywgb3V0LnN1YnRpdGxlUG9zaXRpb24oKVsxXSlcclxuICAgICAgICAgICAgICAgIC5odG1sKG91dC5zdWJ0aXRsZSgpKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9ib3R0b20gdGV4dFxyXG4gICAgICAgIGlmIChvdXQuZm9vdG5vdGVfKSB7XHJcbiAgICAgICAgICAgIGFkZEZvb3Rub3RlKClcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vc291cmNlIGRhdGFzZXQgVVJMXHJcbiAgICAgICAgaWYgKG91dC5zaG93U291cmNlTGlua18pIHtcclxuICAgICAgICAgICAgbGV0IHN0YXRcclxuICAgICAgICAgICAgaWYgKHdpdGhDZW50ZXJQb2ludHMpIHtcclxuICAgICAgICAgICAgICAgIHN0YXQgPSBvdXQuc3RhdCgnc2l6ZScpXHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBzdGF0ID0gb3V0LnN0YXQoKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChzdGF0KSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoc3RhdC5ldXJvc3RhdERhdGFzZXRDb2RlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9kYXRhc2V0IGxpbmtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgY29kZSA9IHN0YXQuZXVyb3N0YXREYXRhc2V0Q29kZVxyXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBgaHR0cHM6Ly9lYy5ldXJvcGEuZXUvZXVyb3N0YXQvZGF0YWJyb3dzZXIvdmlldy8ke2NvZGV9L2RlZmF1bHQvdGFibGU/bGFuZz1lbmBcclxuICAgICAgICAgICAgICAgICAgICBsZXQgbGluayA9IG91dFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc3ZnKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnYScpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zb3VyY2UtZGF0YXNldC1saW5rJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2hyZWYnLCB1cmwpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0YXJnZXQnLCAnX2JsYW5rJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zb3VyY2UtZGF0YXNldC1saW5rLXRleHQnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC53aWR0aF8pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5Jywgb3V0LmhlaWdodF8pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0KCdFVVJPU1RBVCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0ZXh0LWFuY2hvcicsICdlbmQnKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAvL3ByZXRleHQgXCJTb3VyY2U6XCJcclxuICAgICAgICAgICAgICAgICAgICBsZXQgbGlua1cgPSBsaW5rLm5vZGUoKS5nZXRDb21wdXRlZFRleHRMZW5ndGgoKVxyXG4gICAgICAgICAgICAgICAgICAgIG91dC5zdmcoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLXNvdXJjZS1wcmV0ZXh0JylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQud2lkdGhfIC0gbGlua1cgLSAyKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIG91dC5oZWlnaHRfKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAudGV4dCgnU291cmNlOicpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0ZXh0LWFuY2hvcicsICdlbmQnKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2FkZCBzY2FsZWJhclxyXG4gICAgICAgIGlmIChvdXQuc2hvd1NjYWxlYmFyXykge1xyXG4gICAgICAgICAgICBpZiAob3V0LnNjYWxlYmFyUG9zaXRpb25fLmxlbmd0aCAhPT0gMikge1xyXG4gICAgICAgICAgICAgICAgb3V0LnNjYWxlYmFyUG9zaXRpb25fWzBdID0gMTVcclxuICAgICAgICAgICAgICAgIG91dC5zY2FsZWJhclBvc2l0aW9uX1sxXSA9IG91dC5oZWlnaHRfIC0gNTBcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBhZGRTY2FsZWJhclRvTWFwKClcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiBvdXRcclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBkZWZpbmVEZWZhdWx0UG9zaXRpb24gPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgY29uc3QgZGVmYXVsdFB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uICAgICAgICAgICAgLy8gb3V0LnBvc2l0aW9uXy55ID0gR2VvbWV0cmllcy51c2VyR2VvbWV0cmllc1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gb3B0aW9uYWw6IHNldCBmcm9tIFVSTFxyXG4gICAgICAgIHNldFZpZXdGcm9tVVJMKClcclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBnZXREZWZhdWx0WiA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBjb25zdCBkZWZhdWx0UG9zaXRpb24gPSBfZGVmYXVsdFBvc2l0aW9uW291dC5nZW9fICsgJ18nICsgb3V0LnByb2pfXVxyXG4gICAgICAgIGlmIChkZWZhdWx0UG9zaXRpb24pIHtcclxuICAgICAgICAgICAgcmV0dXJuIChkZWZhdWx0UG9zaXRpb24ucGl4ZWxTaXplICogODAwKSAvIG91dC53aWR0aF9cclxuICAgICAgICB9IGVsc2UgaWYgKG91dC5HZW9tZXRyaWVzLmRlZmF1bHRHZW9EYXRhPy5iYm94KSB7XHJcbiAgICAgICAgICAgIHJldHVybiBNYXRoLm1pbihcclxuICAgICAgICAgICAgICAgIChvdXQuR2VvbWV0cmllcy5kZWZhdWx0R2VvRGF0YS5iYm94WzJdIC0gb3V0Lkdlb21ldHJpZXMuZGVmYXVsdEdlb0RhdGEuYmJveFswXSkgLyBvdXQud2lkdGhfLFxyXG4gICAgICAgICAgICAgICAgKG91dC5HZW9tZXRyaWVzLmRlZmF1bHRHZW9EYXRhLmJib3hbM10gLSBvdXQuR2VvbWV0cmllcy5kZWZhdWx0R2VvRGF0YS5iYm94WzFdKSAvIG91dC5oZWlnaHRfXHJcbiAgICAgICAgICAgIClcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICByZXR1cm4gMTAwXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGNvbnN0IGRlZmluZVByb2plY3Rpb24gPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgLy8gRGVm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BiYm94XHJcbiAgICBjb25zdCBnZXRDdXJyZW50QmJveCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBjb25zdCBoYWxmV2lkdGggPSAwLjUgKiBvdXQucG9zaXRpb25fLnogKiBvdXQud2lkdGhfXHJcbiAgICAgICAgY29uc3QgaGFsZkhlaWdodCA9IDAuNSAqIG91dC5wb3NpdGlvbl8ueiAqIG91dC5oZWlnaHRfXHJcbiAgICAgICAgY29uc3QgYmJveCA9IFtcclxuICAgICAgICAgICAgb3V0LnBvc2l0aW9uXy54IC0gaGFsZldpZHRoLFxyXG4gICAgICAgICAgICBvdXQucG9zaXRpb25fLnkgLSBoYWxmSGVpZ2h0LFxyXG4gICAgICAgICAgICBvdXQucG9zaXRpb25fLnggKyBoYWxmV2lkdGgsXHJcbiAgICAgICAgICAgIG91dC5wb3NpdGlvbl8ueSArIGhhbGZIZWlnaHQsXHJcbiAgICAgICAgXVxyXG4gICAgICAgIHJldHVybiBiYm94XHJcbiAgICB9XHJcblxyXG4gICAgY29uc3QgZGVmaW5lUGF0aEZ1bmN0aW9uID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIG91dC5fcGF0aEZ1bmN0aW9uID0gZ2VvUGF0aCgpLnByb2plY3Rpb24ob3V0Ll9wcm9qZWN0aW9uKVxyXG4gICAgfVxyXG5cclxuICAgIGNvbnN0IGRlZmluZU1hcFpvb20gPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgbGV0IHN2ZyA9IHNlbGVjdCgnIycgKyBvdXQuc3ZnSWQoKSlcclxuICAgICAgICBsZXQgcHJldmlvdXNUID0gem9vbUlkZW50aXR5XHJcbiAgICAgICAgY29uc3QgeG9vID0gem9vbSgpXHJcbiAgICAgICAgICAgIC5zY2FsZUV4dGVudChvdXQuem9vbUV4dGVudCgpKVxyXG4gICAgICAgICAgICAub24oJ3pvb20nLCBmdW5jdGlvbiAoZSkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgdCA9IGUudHJhbnNmb3JtXHJcbiAgICAgICAgICAgICAgICBpZiAodC5rICE9PSBwcmV2aW91c1Quaykge1xyXG4gICAgICAgICAgICAgICAgICAgIHpvb21IYW5kbGVyKGUsIHByZXZpb3VzVClcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcGFuSGFuZGxlcihlKVxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIC8vIGFwcGx5IGRlZmF1bHQgdHJhbnNmb3JtIHRvIG1hcFxyXG4gICAgICAgICAgICAgICAgY29uc3Qgem9vbUdyb3VwID0gb3V0LnN2Z18uc2VsZWN0KCcjZW0tem9vbS1ncm91cC0nICsgb3V0LnN2Z0lkXylcclxuICAgICAgICAgICAgICAgIHpvb21Hcm91cC5hdHRyKCd0cmFuc2Zvcm0nLCB0KVxyXG5cclxuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdQb3NpdGlvbjonLCBvdXQucG9zaXRpb25fKVxyXG4gICAgICAgICAgICAgICAgcHJldmlvdXNUID0gdFxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICBzdmcuY2FsbCh4b28pXHJcbiAgICB9XHJcblxyXG4gICAgLy8gWm9vbSBoYW5kbGVyIGZ1bmN0aW9uXHJcbiAgICBjb25zdCB6b29tSGFuZGxlciA9IGZ1bmN0aW9uIChldmVudCwgcHJldmlvdXNUKSB7XHJcbiAgICAgICAgY29uc3QgdHJhbnNmb3JtID0gZXZlbnQudHJhbnNmb3JtXHJcbiAgICAgICAgLy8gQ29tcHV0ZSB0aGUgcHJvamVjdGVkIGNlbnRlclxyXG4gICAgICAgIGNvbnN0IGNlbnRlclggPSAob3V0LndpZHRoXyAvIDIgLSB0cmFuc2Zvcm0ueCkgLyB0cmFuc2Zvcm0ua1xyXG4gICAgICAgIGNvbnN0IGNlbnRlclkgPSAob3V0LmhlaWdodF8gLyAyIC0gdHJhbnNmb3JtLnkpIC8gdHJhbnNmb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GNvbnN0IGZvbnRTaXplID0gaW5saW5lRm9udFNpemUgfHwgY3NzRm9udFNpemVcclxuXHJcbiAgICAgICAgICAgIC8vIE9ubHkgcHJvY2VzcyBlbGVtZW50cyB0aGF0IGhhdmUgYSBmb250IHNpemUgZGVmaW5lZFxyXG4gICAgICAgICAgICBpZiAoZm9udFNpemUgJiYgcGFyc2VGbG9hdChmb250U2l6ZSkgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBvcmlnaW5hbEZvbnRTaXplID1cclxuICAgICAgICAgICAgICAgICAgICBwYXJzZUZsb2F0KGVsZW1lbnQuYXR0cignZGF0YS1mcycpKSB8fCBwYXJzZUZsb2F0KGlubGluZUZvbnRTaXplKSB8fCBwYXJzZUZsb2F0KGNzc0ZvbnRTaXplKVxyXG5cclxuICAgICAgICAgICAgICAgIC8vIFN0b3JlIHRoZSBvcmlnaW5hbCBmb250IHNpemUgZm9yIHRoZSBmaXJzdCB0aW1lXHJcbiAgICAgICAgICAgICAgICBpZiAoIWVsZW1lbnQuYXR0cignZGF0YS1mcycpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCdkYXRhLWZzJywgb3JpZ2luYWxGb250U2l6ZSlcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAvLyBDYWxjdWxhdGUgdGhlIHRhcmdldCBmb250IHNpemUgYmFzZWQgb24gem9vbSBmYWN0b3JcclxuICAgICAgICAgICAgICAgIGNvbnN0IHRhcmdldEZvbnRTaXplID0gb3JpZ2luYWxGb250U2l6ZSAvIHpvb21GYWN0b3JcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBBZGQgdGhlIHN0eWxlIGNoYW5nZSB0byBhIGJhdGNoIGFycmF5XHJcbiAgICAgICAgICAgICAgICB1cGRhdGVzLnB1c2goeyBlbGVtZW50OiB0aGlzLCB0YXJnZXRGb250U2l6ZSB9KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICA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AgICAgfVxyXG5cclxuICAgICAgICAvLyBzZXQgbmV3IHBvc2l0aW9uXHJcbiAgICAgICAgb3V0LnBvc2l0aW9uXy54ID0gZ2VvWFxyXG4gICAgICAgIG91dC5wb3NpdGlvbl8ueSA9IGdlb1lcclxuICAgIH1cclxuXHJcbiAgICAvKiogR2V0IHgseSx6IGVsZW1lbnRzIGZyb20gVVJMIGFuZCBhc3NpZ24gdGhlbSB0byB0aGUgdmlldy4gKi9cclxuICAgIGNvbnN0IHNldFZpZXdGcm9tVVJMID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGNvbnN0IHggPSBnZXRQYXJhbWV0ZXJCeU5hbWUoJ3gnKSxcclxuICAgICAgICAgICAgeSA9IGdldFBhcmFtZXRlckJ5TmFtZSgneScpLFxyXG4gICAgICAgICAgICB6ID0gZ2V0UGFyYW1ldGVyQnlOYW1lKCd6JylcclxuICAgICAgICBpZiAoeCAhPSBudWxsICYmIHggIT0gdW5kZWZpbmVkICYmICFpc05hTigreCkpIG91dC5wb3NpdGlvbl8ueCA9ICt4XHJcbiAgICAgICAgaWYgKHkgIT0gbnVsbCAmJiB5ICE9IHVuZGVmaW5lZCAmJiAhaXNOYU4oK3kpKSBvdXQucG9zaXRpb25fLnkgPSAreVxyXG4gICAgICAgIGlmICh6ICE9IG51bGwgJiYgeiAhPSB1bmRlZmluZWQgJiYgIWlzTmFOKCt6KSkgb3V0LnBvc2l0aW9uXy56ID0gK3pcclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBhZGRGb290bm90ZSA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBvdXQuc3ZnKClcclxuICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdpZCcsICdlbS1mb290bm90ZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1mb290bm90ZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgMClcclxuICAgICAgICAgICAgLmF0dHIoJ3knLCBvdXQuaGVpZ2h0XylcclxuICAgICAgICAgICAgLmh0bWwob3V0LmZvb3Rub3RlXylcclxuICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICBvdXQuX3Rvb2x0aXAubXdfX18gPSBvdXQuX3Rvb2x0aXAuc3R5bGUoJ21heC13aWR0aCcpXHJcbiAgICAgICAgICAgICAgICBvdXQuX3Rvb2x0aXAuc3R5bGUoJ21heC13aWR0aCcsICc0MDBweCcpXHJcbiAgICAgICAgICAgICAgICBpZiAob3V0LmZvb3Rub3RlVG9vbHRpcFRleHRfKSBvdXQuX3Rvb2x0aXAubW91c2VvdmVyKG91dC5mb290bm90ZVRvb2x0aXBUZXh0XylcclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgLm9uKCdtb3VzZW1vdmUnLCBmdW5jdGlvbiAoZSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKG91dC5mb290bm90ZVRvb2x0aXBUZXh0Xykgb3V0Ll90b29sdGlwLm1vdXNlbW92ZShlKVxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKGUpIHtcclxuICAgICAgICAgICAgICAgIGlmIChvdXQuZm9vdG5vdGVUb29sdGlwVGV4dF8pIG91dC5fdG9vbHRpcC5tb3VzZW91dChlKVxyXG4gICAgICAgICAgICAgICAgb3V0Ll90b29sdGlwLnN0eWxlKCdtYXgtd2lkdGgnLCBvdXQuX3Rvb2x0aXAubXdfX18pXHJcbiAgICAgICAgICAgIH0pXHJcbiAgICB9XHJcblxyXG4gICAgY29uc3QgYWRkQ29hc3RhbE1hcmdpblRvTWFwID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGNvbnN0IHpnID0gb3V0LnN2ZygpLnNlbGVjdCgnI2VtLXpvb20tZ3JvdXAtJyArIG91dC5zdmdJZF8pXHJcbiAgICAgICAgLy9kcmF3IGNvYXN0YWwgbWFyZ2luXHJcbiAgICAgICAgY29uc3QgY2cgPSB6Zy5hcHBlbmQoJ2cnKS5hdHRyKCdpZCcsICdlbS1jb2FzdC1tYXJnaW4nKS5hdHRyKCdjbGFzcycsICdlbS1jb2FzdC1tYXJnaW4nKVxyXG5cclxuICAgICAgICAvL2NvdW50cmllcyBiblxyXG4gICAgICAgIGlmIChvdXQuR2VvbWV0cmllcy5nZW9KU09Ocy5jbnRibikge1xyXG4gICAgICAgICAgICBjZy5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2VtLWNvYXN0LW1hcmdpbi1jbnQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWNvYXN0LW1hcmdpbi1jbnQnKVxyXG4gICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuZGF0YShvdXQuR2VvbWV0cmllcy5nZW9KU09Ocy5jbnRibilcclxuICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChibikge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBibi5wcm9wZXJ0aWVzLmNvID09PSAnVCdcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgb3V0Ll9wYXRoRnVuY3Rpb24pXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL251dHMgYm5cclxuICAgICAgICBpZiAob3V0Lkdlb21ldHJpZXMuZ2VvSlNPTnMubnV0c2JuKSB7XHJcbiAgICAgICAgICAgIGNnLmFwcGVuZCgnZycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnZW0tY29hc3QtbWFyZ2luLW51dHMnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWNvYXN0LW1hcmdpbi1udXRzJylcclxuICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmRhdGEob3V0Lkdlb21ldHJpZXMuZ2VvSlNPTnMubnV0c2JuKVxyXG4gICAgICAgICAgICAgICAgLmVudGVyKClcclxuICAgICAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24gKGJuKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJuLnByb3BlcnRpZXMuY28gPT09ICdUJ1xyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2QnLCBvdXQuX3BhdGhGdW5jdGlvbilcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vd29ybGQgYm5cclxuICAgICAgICBpZiAob3V0Lkdlb21ldHJpZXMuZ2VvSlNPTnMud29ybGRibikge1xyXG4gICAgICAgICAgICBjZy5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2VtLWNvYXN0LW1hcmdpbi13b3JsZCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tY29hc3QtbWFyZ2luLXdvcmxkJylcclxuICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAgICAgLmRhdGEob3V0Lkdlb21ldHJpZXMuZ2VvSlNPTnMud29ybGRibilcclxuICAgICAgICAgICAgICAgIC5lbnRlcigpXHJcbiAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChibikge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBibi5wcm9wZXJ0aWVzLkNPQVNfRkxBRyA9PT0gJ1QnXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZCcsIG91dC5fcGF0aEZ1bmN0aW9uKVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBhZGRDZW50cm9pZHNUb01hcCA9IGZ1bmN0aW9uIChtYXApIHtcclxuICAgICAgICBsZXQgY2VudHJvaWRGZWF0dXJlc1xyXG5cclxuICAgICAgICBpZiAoIW1hcC5HZW9tZXRyaWVzLmNlbnRyb2lkc0RhdGEpIHtcclxuICAgICAgICAgICAgLy8gaWYgY2VudHJvaWRzIGRhdGEgaXMgYWJzZW50IChlLmcuIGZvciB3b3JsZCBtYXBzKSB0aGVuIGNhbGN1bGF0ZSBtYW51YWxseVxyXG4gICAgICAgICAgICBpZiAobWFwLmdlb18gPT0gJ1dPUkxEJykge1xyXG4gICAgICAgICAgICAgICAgY2VudHJvaWRGZWF0dXJlcyA9IFtdXHJcbiAgICAgICAgICAgICAgICBtYXAuR2VvbWV0cmllcy5nZW9KU09Ocy53b3JsZHJnLmZvckVhY2goKGZlYXR1cmUpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgbmV3RmVhdHVyZSA9IHsgLi4uZmVhdHVyZSB9XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gZXhjZXB0aW9uIGZvciBGcmFuY2UgKGJlY2F1c2UgZ3V5YW5lKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChmZWF0dXJlLnByb3BlcnRpZXMuaWQgPT0gJ0ZSJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdGZWF0dXJlLmdlb21ldHJ5ID0ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29vcmRpbmF0ZXM6IFsyLjIsIDQ2LjJdLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ1BvaW50JyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0ZlYXR1cmUuZ2VvbWV0cnkgPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29yZGluYXRlczogZ2VvQ2VudHJvaWQoZmVhdHVyZSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnUG9pbnQnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNlbnRyb2lkRmVhdHVyZXMucHVzaChuZXdGZWF0dXJlKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIGlmIChtYXAubnV0c0xldmVsXyA9PSAnbWl4ZWQnKSB7XHJcbiAgICAgICAgICAgICAgICBjZW50cm9pZEZlYXR1cmVzID0gW1xyXG4gICAgICAgICAgICAgICAgICAgIC4uLm1hcC5HZW9tZXRyaWVzLmNlbnRyb2lkc0RhdGFbMF0uZmVhdHVyZXMsXHJcbiAgICAgICAgICAgICAgICAgICAgLi4ubWFwLkdlb21ldHJpZXMuY2VudHJvaWRzRGF0YVsxXS5mZWF0dXJlcyxcclxuICAgICAgICAgICAgICAgICAgICAuLi5tYXAuR2VvbWV0cmllcy5jZW50cm9pZHNEYXRhWzJdLmZlYXR1cmVzLFxyXG4gICAgICAgICAgICAgICAgICAgIC4uLm1hcC5HZW9tZXRyaWVzLmNlbnRyb2lkc0RhdGFbM10uZmVhdHVyZXMsXHJcbiAgICAgICAgICAgICAgICBdXHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBjZW50cm9pZEZlYXR1cmVzID0gbWFwLkdlb21ldHJpZXMuY2VudHJvaWRzRGF0YS5mZWF0dXJlc1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5c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hci1saW5lJylcclxuICAgICAgICAgICAgLmF0dHIoJ3gxJywgbWFyZ2luTGVmdClcclxuICAgICAgICAgICAgLmF0dHIoJ3kxJywgMSlcclxuICAgICAgICAgICAgLmF0dHIoJ3gyJywgbmljZUxlbmd0aFBpeGVsICsgbWFyZ2luTGVmdClcclxuICAgICAgICAgICAgLmF0dHIoJ3kyJywgMSlcclxuXHJcbiAgICAgICAgLy9ib3R0b20gbGluZSBmdWxsIHdpZHRoXHJcbiAgICAgICAgc2NhbGViYXJTVkdcclxuICAgICAgICAgICAgLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1saW5lJylcclxuICAgICAgICAgICAgLmF0dHIoJ3gxJywgbWFyZ2luTGVmdClcclxuICAgICAgICAgICAgLmF0dHIoJ3kxJywgb3V0LnNjYWxlYmFyU2VnbWVudEhlaWdodF8pXHJcbiAgICAgICAgICAgIC5hdHRyKCd4MicsIG5pY2VMZW5ndGhQaXhlbCArIG1hcmdpbkxlZnQpXHJcbiAgICAgICAgICAgIC5hdHRyKCd5MicsIG91dC5zY2FsZWJhclNlZ21lbnRIZWlnaHRfKVxyXG5cclxuICAgICAgICAvL2ZpcnN0IHRpY2tcclxuICAgICAgICBzY2FsZWJhclNWR1xyXG4gICAgICAgICAgICAuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLXNjYWxlYmFyLWxpbmUnKVxyXG4gICAgICAgICAgICAuYXR0cigneDEnLCBtYXJnaW5MZWZ0KVxyXG4gICAgICAgICAgICAuYXR0cigneTEnLCAxKVxyXG4gICAgICAgICAgICAuYXR0cigneDInLCBtYXJnaW5MZWZ0KVxyXG4gICAgICAgICAgICAuYXR0cigneTInLCBvdXQuc2NhbGViYXJUaWNrSGVpZ2h0XylcclxuXHJcbiAgICAgICAgc2NhbGViYXJTVkdcclxuICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1sYWJlbCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgbWFyZ2luTGVmdCArIHRleHRPZmZzZXRYKVxyXG4gICAgICAgICAgICAuYXR0cigneScsIG91dC5zY2FsZWJhclRpY2tIZWlnaHRfICsgdGV4dE9mZnNldFkpXHJcbiAgICAgICAgICAgIC50ZXh0KCcwJylcclxuXHJcbiAgICAgICAgLy9taWRkbGUgdGlja3NcclxuICAgICAgICBjb25zdCBzdWJkaXZpc2lvbk5iID0gc3ViZGl2aXNpb25OYnNbc2NhbGVCYXJTdGFydERpZ2l0XVxyXG4gICAgICAgIGNvbnN0IGRpdmlzaW9uV2lkdGggPSBuaWNlTGVuZ3RoUGl4ZWwgLyBzdWJkaXZpc2lvbk5iXHJcbiAgICAgICAgY29uc3QgZGl2aXNpb25NaW5XaWR0aCA9IDE1XHJcbiAgICAgICAgaWYgKGRpdmlzaW9uV2lkdGggPj0gZGl2aXNpb25NaW5XaWR0aCkge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IHN1YmRpdmlzaW9uTmI7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgc2NhbGViYXJTVkdcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tc2NhbGViYXItbGluZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gxJywgbWFyZ2luTGVmdCArIG91dC5zY2FsZWJhclN0cm9rZVdpZHRoXyAvIDIgKyBpICogZGl2aXNpb25XaWR0aClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneTEnLCAxKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIG1hcmdpbkxlZnQgKyBvdXQuc2NhbGViYXJTdHJva2VXaWR0aF8gLyAyICsgaSAqIGRpdmlzaW9uV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgb3V0LnNjYWxlYmFyVGlja0hlaWdodF8pXHJcbiAgICAgICAgICAgICAgICBzY2FsZWJhclNWR1xyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBtYXJnaW5MZWZ0ICsgdGV4dE9mZnNldFggKyBpICogZGl2aXNpb25XaWR0aClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIG91dC5zY2FsZWJhclRpY2tIZWlnaHRfICsgdGV4dE9mZnNldFkpXHJcbiAgICAgICAgICAgICAgICAgICAgLnRleHQoZ2V0U2NhbGViYXJMYWJlbCgobmljZUxlbmd0aE1bMF0gLyBzdWJkaXZpc2lvbk5iKSAqIGkpKVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvL2V2ZXJ5IG90aGVyIHNlZ21lbnQgbWlkLWxpbmVcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IC0xOyBpIDwgc3ViZGl2aXNpb25OYjsgaSArPSAyKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaSA9PSAxKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLXNjYWxlYmFyLWxpbmUnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneDEnLCBtYXJnaW5MZWZ0ICsgb3V0LnNjYWxlYmFyU3Ryb2tlV2lkdGhfIC0gMSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kxJywgb3V0LnNjYWxlYmFyU2VnbWVudEhlaWdodF8gLyAyKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneDInLCBtYXJnaW5MZWZ0ICsgb3V0LnNjYWxlYmFyU3Ryb2tlV2lkdGhfIC8gMiArIGkgKiBkaXZpc2lvbldpZHRoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneTInLCBvdXQuc2NhbGViYXJTZWdtZW50SGVpZ2h0XyAvIDIpXHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCB4MSA9IG1hcmdpbkxlZnQgKyBvdXQuc2NhbGViYXJTdHJva2VXaWR0aF8gLyAyICsgKGkgLSAxKSAqIGRpdmlzaW9uV2lkdGhcclxuICAgICAgICAgICAgICAgICAgICBpZiAoeDEgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tc2NhbGViYXItbGluZScpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneDEnLCB4MSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5MScsIG91dC5zY2FsZWJhclNlZ21lbnRIZWlnaHRfIC8gMilcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIG1hcmdpbkxlZnQgKyBvdXQuc2NhbGViYXJTdHJva2VXaWR0aF8gLyAyICsgaSAqIGRpdmlzaW9uV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneTInLCBvdXQuc2NhbGViYXJTZWdtZW50SGVpZ2h0XyAvIDIpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgLy8gc2luZ2xlIGZ1bGwtbGVuZ3RoIGhvcml6b250YWwgbWlkLWxpbmVcclxuICAgICAgICAgICAgc2IuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1saW5lJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4MScsIG1hcmdpbkxlZnQgKyBvdXQuc2NhbGViYXJTdHJva2VXaWR0aF8gLSAxKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3kxJywgb3V0LnNjYWxlYmFyU2VnbWVudEhlaWdodF8gLyAyKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gyJywgbWFyZ2luTGVmdCArIG91dC5zY2FsZWJhclN0cm9rZVdpZHRoXyAvIDIgKyBkaXZpc2lvbldpZHRoICogc3ViZGl2aXNpb25OYilcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5MicsIG91dC5zY2FsZWJhclNlZ21lbnRIZWlnaHRfIC8gMilcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vbGFzdCB0aWNrXHJcbiAgICAgICAgc2NhbGViYXJTVkdcclxuICAgICAgICAgICAgLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1saW5lJylcclxuICAgICAgICAgICAgLmF0dHIoJ3gxJywgbmljZUxlbmd0aFBpeGVsICsgbWFyZ2luTGVmdClcclxuICAgICAgICAgICAgLmF0dHIoJ3kxJywgMSlcclxuICAgICAgICAgICAgLmF0dHIoJ3gyJywgbmljZUxlbmd0aFBpeGVsICsgbWFyZ2luTGVmdClcclxuICAgICAgICAgICAgLmF0dHIoJ3kyJywgb3V0LnNjYWxlYmFyVGlja0hlaWdodF8pXHJcbiAgICAgICAgc2NhbGViYXJTVkdcclxuICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1zY2FsZWJhci1sYWJlbCcpXHJcbiAgICAgIC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gY29uZmlnLnpvb21FeHRlbnQgPSBjb25maWcuem9vbUV4dGVudCB8fCBvdXQuaW5zZXRab29tRXh0ZW50X1xyXG4gICAgICAgIGNvbmZpZy53aWR0aCA9IGNvbmZpZy53aWR0aCB8fCBvdXQuaW5zZXRCb3hXaWR0aF9cclxuICAgICAgICBjb25maWcuaGVpZ2h0ID0gY29uZmlnLmhlaWdodCB8fCBvdXQuaW5zZXRCb3hXaWR0aF9cclxuICAgICAgICBjb25maWcuaW5zZXRzID0gY29uZmlnLmluc2V0cyB8fCBbXVxyXG4gICAgICAgIGNvbmZpZy5pbnNldFRlbXBsYXRlcyA9IGNvbmZpZy5pbnNldFRlbXBsYXRlcyB8fCB7fVxyXG4gICAgICAgIGNvbmZpZy5jYWxsYmFjayA9IGNvbmZpZy5jYWxsYmFjayB8fCB1bmRlZmluZWRcclxuXHJcbiAgICAgICAgLy9jb3B5IHRlbXBsYXRlIGF0dHJpYnV0ZXNcclxuICAgICAgICA7W1xyXG4gICAgICAgICAgICAnbnV0c0xldmVsXycsXHJcbiAgICAgICAgICAgICdudXRzWWVhcl8nLFxyXG4gICAgICAgICAgICAnaG92ZXJDb2xvcl8nLFxyXG4gICAgICAgICAgICAvLydudXRzYm5TdHJva2VfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAvLyAnbnV0c2JuU3Ryb2tlV2lkdGhfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnY250cmdGaWxsU3R5bGVfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnY250Ym5TdHJva2VfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnY250Ym5TdHJva2VXaWR0aF8nLCAvLyBERVBSRUNBVEVEXHJcbiAgICAgICAgICAgICdzZWFGaWxsU3R5bGVfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnZHJhd0NvYXN0YWxNYXJnaW5fJyxcclxuICAgICAgICAgICAgJ2NvYXN0YWxNYXJnaW5Db2xvcl8nLCAvLyBERVBSRUNBVEVEXHJcbiAgICAgICAgICAgICdjb2FzdGFsTWFyZ2luV2lkdGhfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnY29hc3RhbE1hcmdpblN0ZERldl8nLFxyXG4gICAgICAgICAgICAnZ3JhdGljdWxlU3Ryb2tlXycsIC8vIERFUFJFQ0FURURcclxuICAgICAgICAgICAgJ2dyYXRpY3VsZVN0cm9rZVdpZHRoXycsIC8vIERFUFJFQ0FURURcclxuICAgICAgICAgICAgJ2xhYmVsbGluZ18nLCAvLyBERVBSRUNBVEVEXHJcbiAgICAgICAgICAgICdsYWJlbEZpbGxfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnbGFiZWxWYWx1ZXNGb250U2l6ZV8nLCAvLyBERVBSRUNBVEVEXHJcbiAgICAgICAgICAgICdsYWJlbE9wYWNpdHlfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnbGFiZWxTdHJva2VfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnbGFiZWxTdHJva2VXaWR0aF8nLCAvLyBERVBSRUNBVEVEXHJcbiAgICAgICAgICAgICdsYWJlbFNoYWRvd1dpZHRoXycsIC8vIERFUFJFQ0FURURcclxuICAgICAgICAgICAgJ2xhYmVsU2hhZG93XycsIC8vIERFUFJFQ0FURURcclxuICAgICAgICAgICAgJ2xhYmVsU2hhZG93Q29sb3JfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnbGFiZWxTaGFkb3dzVG9TaG93XycsXHJcbiAgICAgICAgICAgICdsYWJlbHNUb1Nob3dfJywgLy8gREVQUkVDQVRFRFxyXG4gICAgICAgICAgICAnZm9udEZhbWlseV8nLCAvLyBERVBSRUNBVEVEXHJcbiAgICAgICAgICAgICdsZ18nLFxyXG4gICAgICAgICAgICAncHJvamVjdGlvbkZ1bmN0aW9uXycsXHJcbiAgICAgICAgICAgICdmaWx0ZXJHZW9tZXRyaWVzRnVuY3Rpb25fJyxcclxuICAgICAgICBdLmZvckVhY2goZnVuY3Rpb24gKGF0dCkge1xyXG4gICAgICAgICAgICBtdFthdHRdID0gb3V0W2F0dF1cclxuICAgICAgICB9KVxyXG5cclxuICAgICAgICAvL2NvcHkgc3RhdCBtYXAgYXR0cmlidXRlcy9tZXRob2RzXHJcbiAgICAgICAgO1tcclxuICAgICAgICAgICAgJ3N0YXQnLFxyXG4gICAgICAgICAgICAnc3RhdERhdGEnLFxyXG4gICAgICAgICAgICAnbGVnZW5kJyxcclxuICAgICAgICAgICAgJ2xlZ2VuZE9iaicsXHJcbiAgICAgICAgICAgICdub0RhdGFUZXh0JyxcclxuICAgICAgICAgICAgJ2xhbmd1YWdlJyxcclxuICAgICAgICAgICAgJ3RyYW5zaXRpb25EdXJhdGlvbicsXHJcbiAgICAgICAgICAgICd0b29sdGlwXycsXHJcbiAgICAgICAgICAgICdjbGFzc1RvVGV4dF8nLFxyXG4gICAgICAgIF0uZm9yRWFjaChmdW5jdGlvbiAoYXR0KSB7XHJcbiAgICAgICAgICAgIG10W2F0dF0gPSBvdXRbYXR0XVxyXG4gICAgICAgIH0pXHJcblxyXG4gICAgICAgIC8vYXBwbHkgY29uZmlnIHZhbHVlcyBmb3IgaW5zZXRcclxuICAgICAgICBmb3IgKGxldCBrZXkgaW4gY29uZmlnKSBtdFtrZXkgKyAnXyddID0gY29uZmlnW2tleV1cclxuXHJcbiAgICAgICAgbXQuaXNJbnNldCA9IHRydWUgLy8gZmxhZyBmb3IgaW5zZXQtc3BlY2lmaWMgc2V0dGluZ3MgZS5nLiBDU1MgY2xhc3MgZm9yIHRpdGxlc1xyXG4gICAgICAgIHJldHVybiBtdFxyXG4gICAgfVxyXG5cclxuICAgIHJldHVybiBvdXRcclxufVxyXG5cclxuLyoqIERlZmF1bHQgZ2VvY2VudGVyIHBvc2l0aW9ucyBhbmQgcGl4ZWxTaXplIChmb3IgZGVmYXVsdCB3aWR0aCA9ID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cclxuICAgICAgICAgICAgZ2VvOiAnWVQnLFxyXG4gICAgICAgICAgICB4OiAwLjUgKiBzLFxyXG4gICAgICAgICAgICB5OiAxLjA1ICogcyArIHAsXHJcbiAgICAgICAgICAgIHdpZHRoOiAwLjI1ICogcyxcclxuICAgICAgICAgICAgaGVpZ2h0OiAwLjI1ICogcyxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgZ2VvOiAnUkUnLFxyXG4gICAgICAgICAgICB4OiAwLjc1ICogcyxcclxuICAgICAgICAgICAgeTogMS4wNSAqIHMgKyBwLFxyXG4gICAgICAgICAgICB3aWR0aDogMC4yNSAqIHMsXHJcbiAgICAgICAgICAgIGhlaWdodDogMC4yNSAqIHMsXHJcbiAgICAgICAgfSxcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGdlbzogJ1BUMjAnLFxyXG4gICAgICAgICAgICB4OiAwLFxyXG4gICAgICAgICAgICB5OiAxLjMgKiBzICsgMiAqIHAsXHJcbiAgICAgICAgICAgIHdpZHRoOiAwLjc1ICogcyxcclxuICAgICAgICAgICAgaGVpZ2h0OiAwLjI1ICogcyxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgZ2VvOiAnUFQzMCcsXHJcbiAgICAgICAgICAgIHg6IDAuNzUgKiBzLFxyXG4gICAgICAgICAgICB5OiAxLjMgKiBzICsgMiAqIHAsXHJcbiAgICAgICAgICAgIHdpZHRoOiAwLjI1ICogcyxcclxuICAgICAgICAgICAgaGVpZ2h0OiAwLjI1ICogcyxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHsgZ2VvOiAnTVQnLCB4OiAwLCB5OiAxLjU1ICogcyArIDMgKiBwLCB3aWR0aDogMC4yNSAqIHMsIGhlaWdodDogMC4yNSAqIHMgfSxcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGdlbzogJ0xJJyxcclxuICAgICAgICAgICAgeDogMC4yNSAqIHMsXHJcbiAgICAgICAg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1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIG91dC5fZGF0YV9bbnV0c0lkXVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogUmV0dXJuIHRoZSBzdGF0IHZhbHVlIGZyb20gYSBudXRzIGlkLlxyXG4gICAgICogQHBhcmFtIHsqfSBudXRzSWRcclxuICAgICAqL1xyXG4gICAgb3V0LmdldFZhbHVlID0gKG51dHNJZCkgPT4ge1xyXG4gICAgICAgIGNvbnN0IHMgPSBvdXQuZ2V0KG51dHNJZClcclxuICAgICAgICByZXR1cm4gcyA/IHMudmFsdWUgOiB1bmRlZmluZWRcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIFNldCBhIHN0YXQgdmFsdWUgZnJvbSBhIG51dHMgaWQuXHJcbiAgICAgKlxyXG4gICAgICogQHBhcmFtIHtTdHJpbmd9IG51dHNJZFxyXG4gICAgICogQHBhcmFtIHtPYmplY3QgfHwgU3RyaW5nIHx8IE51bWJlcn0gc3RhdCBUaGUgbmV3IHN0YXRpc3RpY2FsIGRhdGEuIFRoZSBmb3JtYXQgY2FuIGJlIGVpdGhlciB7dmFsdWU6MzQuMzI0LHN0YXR1czpcImVcIn0gb3IgYSB0aGUgdmFsdWUgb25seS5cclxuICAgICAqL1xyXG4gICAgb3V0LnNldCA9IChudXRzSWQsIHN0YXQpID0+IHtcclxuICAgICAgICBvdXQuX2RhdGFfID0gb3V0Ll9kYXRhXyB8fCB7fVxyXG4gICAgICAgIGNvbnN0IHMgPSBvdXQuX2RhdGFfW251dHNJZF1cclxuXHJcbiAgICAgICAgaWYgKHMpIHtcclxuICAgICAgICAgICAgaWYgKHN0YXQudmFsdWUpIHtcclxuICAgICAgICAgICAgICAgIHMudmFsdWUgPSBzdGF0LnZhbHVl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lIHZhbHVlcy4gVGhpcyBjYW4gYmUgdXNlZCBmb3IgY2F0ZWdvcmljYWwgbWFwcy4gKi9cclxuICAgIG91dC5nZXRVbmlxdWVWYWx1ZXMgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgcmV0dXJuIE9iamVjdC52YWx1ZXMob3V0Ll9kYXRhXylcclxuICAgICAgICAgICAgLm1hcCgocykgPT4gcy52YWx1ZSlcclxuICAgICAgICAgICAgLmZpbHRlcigoaXRlbSwgaSwgYXIpID0+IGFyLmluZGV4T2YoaXRlbSkgPT09IGkpXHJcbiAgICB9XHJcblxyXG4gICAgLyoqIEdldCBtaW4gdmFsdWUuICovXHJcbiAgICBvdXQuZ2V0TWluID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGlmIChvdXQuX2RhdGFfKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBPYmplY3QudmFsdWVzKG91dC5fZGF0YV8pXHJcbiAgICAgICAgICAgICAgICAubWFwKChzKSA9PiBzLnZhbHVlKVxyXG4gICAgICAgICAgICAgICAgLmZpbHRlcigocykgPT4gcyA9PSAwIHx8IChzICYmIHMgIT09ICc6JykpXHJcbiAgICAgICAgICAgICAgICAucmVkdWNlKChhY2MsIHYpID0+IE1hdGgubWluKGFjYywgdikpXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgLyoqIEdldCBtYXggdmFsdWUuICovXHJcbiAgICBvdXQuZ2V0TWF4ID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGlmIChvdXQuX2RhdGFfKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBPYmplY3QudmFsdWVzKG91dC5fZGF0YV8pXHJcbiAgICAgICAgICAgICAgICAubWFwKChzKSA9PiBzLnZhbHVlKVxyXG4gICAgICAgICAgICAgICAgLmZpbHRlcigocykgPT4gcyA9PSAwIHx8IChzICYmIHMgIT09ICc6JykpXHJcbiAgICAgICAgICAgICAgICAucmVkdWNlKChhY2MsIHYpID0+IE1hdGg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gICAvL3N0b3JlIGpzb25zdGF0IG1ldGFkYXRhXHJcbiAgICAgICAgICAgIG91dC5tZXRhZGF0YSA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsOiBqc2QubGFiZWwsXHJcbiAgICAgICAgICAgICAgICBocmVmOiBqc2QuaHJlZixcclxuICAgICAgICAgICAgICAgIHNvdXJjZToganNkLnNvdXJjZSxcclxuICAgICAgICAgICAgICAgIHVwZGF0ZWQ6IGpzZC51cGRhdGVkLFxyXG4gICAgICAgICAgICAgICAgZXh0ZW5zaW9uOiBqc2QuZXh0ZW5zaW9uLFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIG91dC5tZXRhZGF0YS50aW1lID0ganNkLkRpbWVuc2lvbigndGltZScpLmlkWzBdXHJcblxyXG4gICAgICAgICAgICAvL2luZGV4XHJcbiAgICAgICAgICAgIG91dC5fZGF0YV8gPSBqc29uc3RhdFRvSW5kZXgoanNkKVxyXG4gICAgICAgICAgICAvL1RPRE86IHVzZSBtYXliZSBodHRwczovL2dpdGh1Yi5jb20vYmFkb3NhL0pTT04tc3RhdC9ibG9iL21hc3Rlci91dGlscy9mcm9tdGFibGUubWQgdG8gYnVpbGQgZGlyZWN0bHkgYW4gaW5kZXggP1xyXG5cclxuICAgICAgICAgICAgaWYgKGNhbGxiYWNrKSBjYWxsYmFjaygpXHJcbiAgICAgICAgfSlcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIFJldHVybiB0aGUgdGltZSBzdGFtcCBvZiB0aGUganNvbnN0YXQgZGF0YXNldC5cclxuICAgICAqL1xyXG4gICAgb3V0LmdldFRpbWUgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgY29uc3QgdCA9IG91dC5maWx0ZXJzXy50aW1lXHJcbiAgICAgICAgaWYgKHQpIHJldHVybiB0XHJcbiAgICAgICAgaWYgKCFvdXQuX2RhdGFfKSByZXR1cm5cclxuICAgICAgICByZXR1cm4gb3V0Lm1ldGFkYXRhLn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ZWxlY3QoJyMnICsgbGVnZW5kLnN2Z0lkKVxyXG4gICAgICAgICAgICBpZiAobGVnZW5kU3ZnLnNpemUoKSA9PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAvL2dldCBsZWdlbmQgcG9zaXRpb25cclxuICAgICAgICAgICAgICAgIGNvbnN0IHggPSBsZWdlbmQueCA9PSB1bmRlZmluZWQgPyBvdXQud2lkdGgoKSAtIDEwMCAtIGxlZ2VuZC5ib3hQYWRkaW5nIDogbGVnZW5kLnhcclxuICAgICAgICAgICAgICAgIGNvbnN0IHkgPSBsZWdlbmQueSA9PSB1bmRlZmluZWQgPyBsZWdlbmQuYm94UGFkZGluZyA6IGxlZ2VuZC55XHJcblxyXG4gICAgICAgICAgICAgICAgLy9idWlsZCBsZWdlbmQgU1ZHIGluIGEgbmV3IGdyb3VwXHJcbiAgICAgICAgICAgICAgICBvdXQuc3ZnKClcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgeCArICcsJyArIHkgKyAnKScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnc3ZnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaWQnLCBsZWdlbmQuc3ZnSWQpXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIGxlZ2VuZC5idWlsZCgpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2RlZmluZSB0b29sdGlwXHJcbiAgICAgICAgLy9wcmVwYXJlIG1hcCB0b29sdGlwXHJcbiAgICAgICAgaWYgKG91dC50b29sdGlwXykge1xyXG4gICAgICAgICAgICBvdXQuX3Rvb2x0aXAgPSB0cC50b29sdGlwKG91dC50b29sdGlwXylcclxuICAgICAgICB9IGVsc2Uge1x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G5cclxuICAgICAgICAgICAgY29uc3QgY29udGV4dCA9IGNhbnZhcy5nZXRDb250ZXh0KCcyZCcpXHJcbiAgICAgICAgICAgIGNvbnRleHQuZHJhd0ltYWdlKGltZywgMCwgMCwgY2FudmFzLndpZHRoLCBjYW52YXMuaGVpZ2h0KVxyXG5cclxuICAgICAgICAgICAgLy8gU3RlcCA2OiBDb252ZXJ0IHRoZSBjYW52YXMgdG8gYSBQTkcgYmxvYlxyXG4gICAgICAgICAgICBjYW52YXMudG9CbG9iKGZ1bmN0aW9uIChwbmdCbG9iKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBTdGVwIDc6IERvd25sb2FkIHRoZSBQTkcgZmlsZVxyXG4gICAgICAgICAgICAgICAgY29uc3QgcG5nVXJsID0gVVJMLmNyZWF0ZU9iamVjdFVSTChwbmdCbG9iKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgZG93bmxvYWRMaW5rID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYScpXHJcbiAgICAgICAgICAgICAgICBkb3dubG9hZExpbmsuaHJlZiA9IHBuZ1VybFxyXG4gICAgICAgICAgICAgICAgZG93bmxvYWRMaW5rLmRvd25sb2FkID0gJ2V1cm9zdGF0LW1hcC5wbmcnXHJcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKGRvd25sb2FkTGluaylcclxuICAgICAgICAgICAgICAgIGRvd25sb2FkTGluay5jbGljaygpXHJcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5ib2R5LnJlbW92ZUNoaWxkKGRvd25sb2FkTGluaylcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBDbGVhbiB1cCBVUkxzXHJcbiAgICAgICAgICAgICAgICBVUkwucmV2b2tlT2JqZWN0VVJMKHVybClcclxuICAgICAgICAgICAgICAgIFVSTC5yZXZva2VPYmplY3RVUkwocG5nVXJsKVxyXG4gICAgICAgICAgICB9LCAnaW1hZ2UvcG5nJylcclxuICAgICAgIC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gICAgY2FsbGJhY2sobmVzdGVkSW5zZXQsIHBhcmFtZXRlciwgcGFyYW1ldGVyMilcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnNldC5zdmdJZF8gIT09IG1haW5TdmdJZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhpbnNldCwgcGFyYW1ldGVyLCBwYXJhbWV0ZXIyKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSlcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAvLyBBcHBseSBjYWxsYmFjayB0byB1bmlxdWUgaW5zZXRcclxuICAgICAgICAgICAgaWYgKGluc2V0R3JvdXAuc3ZnSWRfICE9PSBtYWluU3ZnSWQpIHtcclxuICAgICAgICAgICAgICAgIGNhbGxiYWNrKGluc2V0R3JvdXAsIHBhcmFtZXRlciwgcGFyYW1ldGVyMilcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG5cclxuZXhwb3J0IGNvbnN0IHVwcGVyQ2FzZUZpcnN0TGV0dGVyID0gKHN0cmluZykgPT4gYCR7c3RyaW5nLnNsaWNlKDAsIDEpLnRvVXBwZXJDYXNlKCl9JHtzdHJpbmcuc2xpY2UoMSl9YFxyXG5cclxuZXhwb3J0IGNvbnN0IGxvd2VyQ2FzZUFsbFdvcmRzRXhjZXB0Rmlyc3RMZXR0ZXJzID0gKHN0cmluZykgPT5cclxuICAgIHN0cmluZy5yZXBsYWNlQWxsKC9cXFMqL2csICh3b3JkKSA9PiBgJHt3b3JkLnNsaWNlKDAsIDEpfSR7d29yZC5zbGljZSgxKS50b0xvd2VyQ2FzZSgpfWApXHJcblxyXG5leHBvcnQgZnVuY3Rpb24gZ2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HJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgcHMpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigncGF0dGVyblVuaXRzJywgJ3VzZXJTcGFjZU9uVXNlJylcclxuICAgICAgICAgICAgcGF0dC5hcHBlbmQoJ3JlY3QnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCAwKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCAwKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgcHMpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgcHMpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsICdub25lJylcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIG9wdHMuYmNrQ29sb3IpXHJcbiAgICAgICAgICAgIGlmIChvcHRzLnNoYXBlID09ICdzcXVhcmUnKVxyXG4gICAgICAgICAgICAgICAgcGF0dC5hcHBlbmQoJ3JlY3QnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgMClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIDApXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgc2kpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIHNpKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgJ25vbmUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIG9wdHMuc3ltYkNvbG9yKVxyXG4gICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICBwYXR0LmFwcGVuZCgnY2lyY2xlJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY3gnLCBwcyAqIDAuNSlcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY3knLCBwcyAqIDAuNSlcclxuICAgICAgICAgICA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BcclxuICAgICAgICBjb25zdCBsZ2cgPSBvdXQubGdnXHJcbiAgICAgICAgY29uc3Qgc3ZnTWFwID0gbS5zdmcoKVxyXG5cclxuICAgICAgICAvL3JlbW92ZSBwcmV2aW91cyBjb250ZW50XHJcbiAgICAgICAgbGdnLnNlbGVjdEFsbCgnKicpLnJlbW92ZSgpXHJcblxyXG4gICAgICAgIC8vZHJhdyBsZWdlbmQgYmFja2dyb3VuZCBib3hcclxuICAgICAgICBvdXQubWFrZUJhY2tncm91bmRCb3goKVxyXG5cclxuICAgICAgICAvL2RyYXcgdGl0bGVcclxuICAgICAgICBpZiAob3V0LnRpdGxlKSB7XHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC10aXRsZScpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCBvdXQuYm94UGFkZGluZyArIG91dC50aXRsZUZvbnRTaXplKVxyXG4gICAgICAgICAgICAgICAgLnRleHQob3V0LnRpdGxlKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9nZXQgY2F0ZWdvcnkgY29kZXNcclxuICAgICAgICBjb25zdCBlY2xzID0gb3V0Lm9yZGVyID8gb3V0Lm9yZGVyIDogbS5jbGFzc2lmaWVyKCkuZG9tYWluKClcclxuXHJcbiAgICAgICAgLy9kcmF3IGxlZ2VuZCBlbGVtZW50cyBmb3IgY2xhc3NlczogcmVjdGFuZ2xlICsgbGFiZWxcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGVjbHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgLy90aGUgY2xhc3NcclxuICAgICAgICAgICAgY29uc3QgZWNsXyA9IGVjbHNbaV1cclxuICAgICAgICAgICAgY29uc3QgZWNsID0gbS5jbGFzc2lmaWVyKCkoZWNsXylcclxuICAgICAgICAgICAgY29uc3QgZmlsbENvbG9yID0gbS5jbGFzc1RvRmlsbFN0eWxlKClbZWNsX11cclxuXHJcbiAgICAgICAgICAgIC8vdGhlIHZlcnRpY2FsIHBvc2l0aW9uIG9mIHRoZSBsZWdlbmQgZWxlbWVudFxyXG4gICAgICAgICAgICBjb25zdCB5ID1cclxuICAgICAgICAgICAgICAgIG91dC5ib3hQYWRkaW5nICsgKG91dC50aXRsZSA/IG91dC50aXRsZUZvbnRTaXplICsgb3V0LmJveFBhZGRpbmcgOiAwKSArIGkgKiAob3V0LnNoYXBlSGVpZ2h0ICsgb3V0LnNoYXBlUGFkZGluZylcclxuXHJcbiAgICAgICAgICAgIC8vcmVjdGFuZ2xlXHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3JlY3QnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1yZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LmJveFBhZGRpbmcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHkpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBvdXQuc2hhcGVXaWR0aClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBvdXQuc2hhcGVIZWlnaHQpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBmaWxsQ29sb3IpXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBzZWxlY3QodGhpcykuc3R5bGUoJ2ZpbGwnLCBtLmhvdmVyQ29sb3JfKVxyXG4gICAgICAgICAgICAgICAgICAgIGhpZ2hsaWdodFJlZ2lvbnMob3V0Lm1hcCwgZWNsKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQuc3ZnSWRfLCBoaWdobGlnaHRSZWdpb25zLCBlY2wpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnN0eWxlKCdmaWxsJywgZmlsbENvbG9yKVxyXG4gICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwLCBlY2wpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5zdmdJZF8sIHVuaGlnaGxpZ2h0UmVnaW9ucywgZWNsKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAvL2xhYmVsXHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nICsgb3V0LnNoYXBlV2lkdGggKyBvdXQubGFiZWxPZmZzZXQpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHkgKyBvdXQuc2hhcGVIZWlnaHQgKiAwLjUpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZG9taW5hbnQtYmFzZWxpbmUnLCAnbWlkZGxlJylcclxuICAgICAgICAgICAgICAgIC50ZXh0KG0uY2xhc3NUb1RleHQoKSA/IG0uY2xhc3NUb1RleHQoKVtlY2xfXSA6IGVjbF8pXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLydubyBkYXRhJyBsZWdlbmQgYm94XHJcbiAgICAgICAgaWYgKG91dC5ub0RhdGEpIHtcclxuICAgICAgICAgICAgY29uc3QgeSA9XHJcbiAgICAgICAgICAgICAgICBvdXQuYm94UGFkZGluZyArXHJcbiAgICAgICAgICAgICAgICAob3V0LnRpdGxlID8gb3V0LnRpdGxlRm9udFNpemUgKyBvdXQuYm94UGFkZGluZyA6IDApICtcclxuICAgICAgICAgICAgICAgIGVjbHMubGVuZ3RoICogKG91dC5zaGFwZUhlaWdodCArIG91dC5zaGFwZVBhZGRpbmcpXHJcblxyXG4gICAgICAgICAgICAvL3JlY3RhbmdsZVxyXG4gICAgICAgICAgICBsZ2cuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtcmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgb3V0LnNoYXBlV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0Jywgb3V0LnNoYXBlSGVpZ2h0KVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgbS5ub0RhdGFGaWxsU3R5bGVfKVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwLCAnbmQnKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQuc3ZnSWRfLCBoaWdobGlnaHRSZWdpb25zLCAnbmQnKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwLCAnbmQnKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQuc3ZnSWRfLCB1bmhpZ2hsaWdodFJlZ2lvbnMsICduZCcpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIC8vJ25vIGRhdGEnIGxhYmVsXHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nICsgb3V0LnNoYXBlV2lkdGggKyBvdXQubGFiZWxPZmZzZXQpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHkgKyBvdXQuc2hhcGVIZWlnaHQgKiAwLjUpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZG9taW5hbnQtYmFzZWxpbmUnLCAnbWlkZGxlJylcclxuICAgICAgICAgICAgICAgIC50ZXh0KG91dC5ub0RhdGFUZXh0KVxyXG4gICAgICAgIH1cclxuXHJcbiAgIC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AgY29uc3QgZWNsMiA9IG51bWJlck9mQ2xhc3NlcyAtIGogLSAxXHJcbiAgICAgICAgICAgICAgICBjb25zdCBmaWxsID0gb3V0Lm1hcC5jbGFzc1RvRmlsbFN0eWxlKCkoZWNsMSwgZWNsMilcclxuXHJcbiAgICAgICAgICAgICAgICBzcXVhcmVcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tYml2YXJpYXRlLXNxdWFyZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBpbml0aWFsWCArIChudW1iZXJPZkNsYXNzZXMgLSAxIC0gaSkgKiBzeilcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIGogKiBzeilcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBzeilcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0Jywgc3opXHJcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgZmlsbClcclxuICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwLCBlY2wxLCBlY2wyKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIGhpZ2hsaWdodFJlZ2lvbnMsIGVjbDEsIGVjbDIpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnJhaXNlKCkgLy8gcmFpc2UgbGVnZW5kIHNxdWFyZSB0byBhdm9pZCBzdHJva2UgaXNzdWVcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIHVuaGlnaGxpZ2h0UmVnaW9ucywgZWNsMSwgZWNsMilcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIHNldCBicmVha3MgaWYgdXNlciBoYXNudCBkZWZpbmVkIHRoZW0gYnV0IGhhcyBlbmFibGVkIHRoZW1cclxuICAgICAgICBpZiAoIW91dC5icmVha3MxICYmICFvdXQuYnJlYWtzMiAmJiBvdXQuc2hvd0JyZWFrcykge1xyXG4gICAgICAgICAgICAvLyBHZXQgcXVhbnRpbGVzIGZvciB0aGUgZmlyc3QgdmFyaWFibGUgKFggYXhpcykgYW5kIHRydW5jYXRlIHRvIG9uZSBkZWNpbWFsIHBsYWNlXHJcbiAgICAgICAgICAgIG91dC5icmVha3MxID0gbWFwLmNsYXNzaWZpZXIxXy5xdWFudGlsZXMoKS5tYXAoKHZhbHVlKSA9PiBwYXJzZUZsb2F0KHZhbHVlLnRvRml4ZWQoMCkpKVxyXG5cclxuICAgICAgICAgICAgLy8gR2V0IHF1YW50aWxlcyBmb3IgdGhlIHNlY29uZCB2YXJpYWJsZSAoWSBheGlzKSBhbmQgdHJ1bmNhdGUgdG8gb25lIGRlY2ltYWwgcGxhY2VcclxuICAgICAgICAgICAgb3V0LmJyZWFrczIgPSBtYXAuY2xhc3NpZmllcjJfLnF1YW50aWxlcygpLm1hcCgodmFsdWUpID0+IHBhcnNlRmxvYXQodmFsdWUudG9GaXhlZCgwKSkpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBEcmF3IGJyZWFrcyBsYWJlbHMgMSAoWCBheGlzKVxyXG4gICAgICAgIGlmIChvdXQuYnJlYWtzMSkge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG91dC5icmVha3MxLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCB4ID0gaW5pdGlhbFggKyBzeiAqIChpICsgMSlcclxuICAgICAgICAgICAgICAgIGNvbnN0IHkgPSBvdXQuc3F1YXJlU2l6ZSArIGdldEZvbnRTaXplRnJvbUNsYXNzKCdlbS1iaXZhcmlhdGUtdGljay1sYWJlbCcpXHJcblxyXG4gICAgICAgICAgICAgICAgc3F1YXJlXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWJpdmFyaWF0ZS10aWNrLWxhYmVsJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsIHggKyBvdXQueEF4aXNMYWJlbHNPZmZzZXQueClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIHkgKyBvdXQueEF4aXNMYWJlbHNPZmZzZXQueSlcclxuICAgICAgICAgICAgICAgICAgICAudGV4dChvdXQuYnJlYWtzMVtpXSlcclxuXHJcbiAgICAgICAgICAgICAgICBzcXVhcmVcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tYml2YXJpYXRlLXRpY2snKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MScsIHggKyBvdXQueEF4aXNMYWJlbHNPZmZzZXQueClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneDInLCB4ICsgb3V0LnhBeGlzTGFiZWxzT2Zmc2V0LngpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kxJywgb3V0LnNxdWFyZVNpemUpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgb3V0LnNxdWFyZVNpemUgKyA1KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBEcmF3IGJyZWFrcyBsYWJlbHMgMiAoWSBheGlzKVxyXG4gICAgICAgIGlmIChvdXQuYnJlYWtzMikge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG91dC5icmVha3MyLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCB4ID0gaW5pdGlhbFhcclxuICAgICAgICAgICAgICAgIGNvbnN0IHkgPSBzeiAqIChpICsgMikgLSBzelxyXG5cclxuICAgICAgICAgICAgICAgIHNxdWFyZVxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1iaXZhcmlhdGUtdGljay1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCB4ICsgb3V0LnlBeGlzTGFiZWxzT2Zmc2V0LnkpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5IC0gb3V0LnlBeGlzTGFiZWxzT2Zmc2V0LngpXHJcbiAgICAgICAgICAgICAgICAgICAgLnRleHQoWy4uLm91dC5icmVha3MyXS5yZXZlcnNlKClbaV0pXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ21pZGRsZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGByb3RhdGUoLTkwLCAke3h9LCAke3l9KWApXHJcblxyXG4gICAgICAgICAgICAgICAgc3F1YXJlXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWJpdmFyaWF0ZS10aWNrJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneDEnLCB4KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIHggLSA1KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5MScsIHkpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgeSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gQXBwZW5kIFggYXhpcyBhcnJvd1xyXG4gICAgICAgIGxldCB4QXhpc0Fycm93WSA9IG91dC5zcXVhcmVTaXplICsgb3V0LmFycm93SGVpZ2h0ICsgb3V0LnhBeGlzTGFiZWxzT2Zmc2V0LnlcclxuICAgICAgICBpZiAob3V0LnNob3dCcmVha3MgfHwgKG91dC5icmVha3MxICYmIG91dC5icmVha3MyKSkgeEF4aXNBcnJvd1kgKz0gZ2V0Rm9udFNpemVGcm9tQ2xhc3MoJ2VtLWJpdmFyaWF0ZS10aWNrLWxhYmVsJykgLyAxLjUgLy8gbW92ZSBvdmVyIGZvciB0aWNrIGxhYmVsc1xyXG5cclxuICAgICAgICBzcXVhcmVcclxuICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1iaXZhcmlhdGUtYXhpcy1hcnJvdycpXHJcbiAgICAgICAgICAgIC5hdHRyKFxyXG4gICAgICAgICAgICAgICAgJ2QnLFxyXG4gICAgICAgICAgICAgICAgbGluZSgpKFtcclxuICAgICAgICAgICAgICAgICAgICBbaW5pdGlhbFgsIHhBeGlzQXJyb3dZXSxcclxuICAgICAgICAgICAgICAgICAgICBbaW5pdGlhbFggKyBvdXQuc3F1YXJlU2l6ZSwgeEF4aXNBcnJvd1ldLFxyXG4gICAgICAgICAgICAgICAgXSlcclxuICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAuYXR0cignc3Ryb2tlJywgJ2JsYWNrJylcclxuICAgICAgICAgICAgLmF0dHIoJ21hcmtlci1lbmQnLCAndXJsKCNhcnJvd2hlYWQpJylcclxuXHJcbiAgICAgICAgLy8gQXBwZW5kIFkgYXhpcyBhcnJvd1xyXG4gICAgICAgIGxldCB5QXhpc0Fycm93WCA9IC1vdXQuYXJyb3dIZWlnaHQgKyBvdXQueUF4aXNMYWJlbHNPZmZzZXQueFxyXG4gICAgICAgIGlmIChvdXQuc2hvd0JyZWFrcyB8fCAob3V0LmJyZWFrczEgJiYgb3V0LmJyZWFrczIpKSB5QXhpc0Fycm93WCAtPSBvdXQubGFiZWxGb250U2l6ZSAvIDIgLy8gbW92ZSBvdmVyIGZvciB0aWNrIGxhYmVsc1xyXG5cclxuICAgICAgICBzcXVhcmVcclxuICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1iaXZhcmlhdGUtYXhpcy1hcnJvdycpXHJcbiAgICAgICAgICAgIC5hdHRyKFxyXG4gICAgICAgICAgICAgICAgJ2QnLFxyXG4gICAgICAgICAgICAgICAgbGluZSgpKFtcclxuICAgICAgICAgICAgICAgICAgICBbeUF4aXNBcnJvd1gsIG91dC5zcXVhcmVTaXplXSxcclxuICAgICAgICAgICAgICAgICAgICBbeUF4aXNBcnJvd1gsIDBdLFxyXG4gICAgICAgICAgICAgICAgXSlcclxuICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAuYXR0cignc3Ryb2tlJywgJ2JsYWNrJylcclxuICAgICAgICAgICAgLmF0dHIoJ21hcmtlci1lbmQnLCAndXJsK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HJcbiAgICAgICAgICAgIC5hcHBlbmQoJ3JlY3QnKVxyXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tYml2YXJpYXRlLWZyYW1lJylcclxuICAgICAgICAgICAgLmF0dHIoJ3gnLCBpbml0aWFsWClcclxuICAgICAgICAgICAgLmF0dHIoJ3knLCAwKVxyXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCBvdXQuc3F1YXJlU2l6ZSlcclxuICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIG91dC5zcXVhcmVTaXplKVxyXG4gICAgICAgICAgICAuYXR0cignc3Ryb2tlLXdpZHRoJywgMC43KVxyXG5cclxuICAgICAgICAvLyBBcnJvdyBkZWZzXHJcbiAgICAgICAgc3F1YXJlXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ2RlZnMnKVxyXG4gICAgICAgICAgICAuYXBwZW5kKCdtYXJrZXInKVxyXG4gICAgICAgICAgICAuYXR0cigndmlld0JveCcsIGAwIDAgJHtvdXQuYXJyb3dXaWR0aH0gJHtvdXQuYXJyb3dIZWlnaHR9YClcclxuICAgICAgICAgICAgLmF0dHIoJ2lkJywgJ2Fycm93aGVhZCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdyZWZYJywgMClcclxuICAgICAgICAgICAgLmF0dHIoJ3JlZlknLCA1KVxyXG4gICAgICAgICAgICAuYXR0cignbWFya2VyV2lkdGgnLCBvdXQuYXJyb3dXaWR0aClcclxuICAgICAgICAgICAgLmF0dHIoJ21hcmtlckhlaWdodCcsIG91dC5hcnJvd0hlaWdodClcclxuICAgICAgICAgICAgLmF0dHIoJ29yaWVudCcsICdhdXRvJylcclxuICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdkJywgJ00gMCAwIEwgNSA1IEwgMCAxMCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdtYXJrZXItdW5pdHMnLCAnc3Ryb2tlV2lkdGgnKVxyXG5ccl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dW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVnaW9ucyA9IG91dC5tYXAubnV0c0xldmVsXyA9PSAnbWl4ZWQnID8gc2VsZWN0QWxsKCcjZW0tbnV0c3JnJykgOiBzZWxlY3QoJyNlbS1udXRzcmcnKVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHJlZ2lvbnMuc2VsZWN0QWxsKFwiW25kPSduZCddXCIpXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsLnN0eWxlKCdmaWxsJywgJ3JlZCcpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBuUmcgPSBvdXQubWFwLm51dHNMZXZlbF8gPT0gJ21peGVkJyA/IHNlbGVjdEFsbCgnI2VtLW51dHNyZycpIDogc2VsZWN0KCcjZW0tbnV0c3JnJylcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBuUmcuc2VsZWN0QWxsKFwiW25kPSduZCddXCIpXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsLnN0eWxlKCdmaWxsJywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0KHRoaXMpLmF0dHIoJ2ZpbGxfX18nKVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnN0eWxlKCdmaWxsJywgb3V0Lm1hcC5ub0RhdGFGaWxsU3R5bGUoKSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWJpdmFyaWF0ZS1ub2RhdGEtbGFiZWwnKVxyXG4gICAgICAgICAg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AgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LmJveFBhZGRpbmcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIG91dC5ib3hQYWRkaW5nICsgY3NzRm9udFNpemUpXHJcbiAgICAgICAgICAgICAgICAudGV4dChvdXQudGl0bGUpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAob3V0LmJhckNoYXJ0KSB7XHJcbiAgICAgICAgICAgIGxldCB0aHJlc2hvbGRzID1cclxuICAgICAgICAgICAgICAgIG0udGhyZXNob2xkc18ubGVuZ3RoID4gMVxyXG4gICAgICAgICAgICAgICAgICAgID8gbS50aHJlc2hvbGRzX1xyXG4gICAgICAgICAgICAgICAgICAgIDogQXJyYXkuZnJvbSh7IGxlbmd0aDogbS5udW1iZXJPZkNsYXNzZXNfIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgLm1hcCgoXywgaW5kZXgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG0uY2xhc3NpZmllcigpLmludmVydEV4dGVudChpbmRleClbb3V0LmFzY2VuZGluZyA/IDAgOiAxXVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgLnNsaWNlKDEpIC8vIFJlbW92ZSB0aGUgZmlyc3QgZW50cnkgYW5kIHJldHVybiB0aGUgcmVzdCBhcyBhbiBhcnJheVxyXG4gICAgICAgICAgICBsZXQgY29sb3JzID0gbS5jb2xvcnNfXHJcbiAgICAgICAgICAgICAgICA/IG0uY29sb3JzX1xyXG4gICAgICAgICAgICAgICAgOiBBcnJheS5mcm9tKHsgbGVuZ3RoOiBtLm51bWJlck9mQ2xhc3Nlc18gfSkubWFwKChfLCBpbmRleCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG0uY2xhc3NUb0ZpbGxTdHlsZSgpKGluZGV4LCBtLm51bWJlck9mQ2xhc3Nl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JcbiAgICAgICAgICAgIGNvbnN0IHkgPSBiYXNlWSArIGkgKiBvdXQuc2hhcGVIZWlnaHRcclxuICAgICAgICAgICAgY29uc3QgeCA9IG91dC5ib3hQYWRkaW5nXHJcbiAgICAgICAgICAgIGNvbnN0IGVjbCA9IG91dC5hc2NlbmRpbmcgPyBtLm51bWJlck9mQ2xhc3NlcygpIC0gaSAtIDEgOiBpXHJcbiAgICAgICAgICAgIGNvbnN0IGZpbGxDb2xvciA9IG0uY2xhc3NUb0ZpbGxTdHlsZSgpKGVjbCwgbS5udW1iZXJPZkNsYXNzZXNfKVxyXG5cclxuICAgICAgICAgICAgLy8gQXBwZW5kIHJlY3RhbmdsZSBmb3IgZWFjaCBjbGFzc1xyXG4gICAgICAgICAgICBsZ2cuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtcmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIHgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHkpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBvdXQuc2hhcGVXaWR0aClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBvdXQuc2hhcGVIZWlnaHQpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBmaWxsQ29sb3IpXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBoaWdobGlnaHRSZWdpb25zKG91dC5tYXAsIGVjbClcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZXhlY3V0ZUZvckFsbEluc2V0cyhvdXQubWFwLmluc2V0VGVtcGxhdGVzXywgb3V0Lm1hcC5zdmdJZCwgaGlnaGxpZ2h0UmVnaW9ucywgZWNsKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQubWFwLnN2Z0lkLCB1bmhpZ2hsaWdodFJlZ2lvbnMsIGVjbClcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgLy8gQXBwZW5kIHNlcGFyYXRpb24gbGluZVxyXG4gICAgICAgICAgICBpZiAoaSA+IDApIHtcclxuICAgICAgICAgICAgICAgIGxnZy5hcHBlbmQoJ2xpbmUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtc2VwYXJhdG9yJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneDEnLCBvdXQuYm94UGFkZGluZylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneTEnLCB5KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIG91dC5ib3hQYWRkaW5nICsgb3V0LnNlcExpbmVMZW5ndGgpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgeSlcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy8gQXBwZW5kIHRpY2sgbGluZVxyXG4gICAgICAgICAgICBpZiAoaSA+IDApIHtcclxuICAgICAgICAgICAgICAgIGxnZy5hcHBlbmQoJ2xpbmUnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtdGljaycpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gxJywgb3V0LmJveFBhZGRpbmcgKyBvdXQuc2VwTGluZUxlbmd0aClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneTEnLCB5KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MicsIG91dC5ib3hQYWRkaW5nICsgb3V0LnNlcExpbmVMZW5ndGggKyBvdXQudGlja0xlbmd0aClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneTInLCB5KVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvLyBBcHBlbmQgbGFiZWxcclxuICAgICAgICAgICAgaWYgKGkgPCBtLm51bWJlck9mQ2xhc3NlcygpIC0gMSkge1xyXG4gICAgICAgICAgICAgICAgbGdnLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZyArIE1hdGgubWF4KG91dC5zaGFwZVdpZHRoLCBvdXQuc2VwTGluZUxlbmd0aCArIG91dC50aWNrTGVuZ3RoKSArIG91dC5sYWJlbE9mZnNldClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIHkgKyBvdXQuc2hhcGVIZWlnaHQpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2RvbWluYW50LWJhc2VsaW5lJywgJ21pZGRsZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLnRleHQob3V0LmxhYmVscyA/IG91dC5sYWJlbHNbaV0gOiBmb3JtYXRMYWJlbChtLmNsYXNzaWZpZXIoKS5pbnZlcnRFeHRlbnQoZWNsKVtvdXQuYXNjZW5kaW5nID8gMCA6IDFdKSlcclxuICAgICAgICAgICAgfV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MsICduZCcpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnN0eWxlKCdmaWxsJywgb3V0Lm1hcC5ub0RhdGFGaWxsU3R5bGVfKVxyXG4gICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQubWFwLnN2Z0lkLCB1bmhpZ2hsaWdodFJlZ2lvbnMpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nICsgb3V0LnNoYXBlV2lkdGggKyBvdXQubGFiZWxPZmZzZXQpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHkgKyBvdXQuc2hhcGVIZWlnaHQgKiAwLjUpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZG9taW5hbnQtYmFzZWxpbmUnLCAnbWlkZGxlJylcclxuICAgICAgICAgICAgICAgIC50ZXh0KG91dC5ub0RhdGFUZXh0KVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBmdW5jdGlvbiBjcmVhdGVCYXJDaGFydExlZ2VuZCh0aHJlc2hvbGRzLCBkYXRhLCBjb2xvcnMpIHtcclxuICAgICAgICBjb25zdCBsZ2cgPSBvdXQubGdnXHJcbiAgICAgICAgbGV0IGJhc2VZID0gb3V0LmJveFBhZGRpbmcgKyAzMFxyXG4gICAgICAgIGlmIChvdXQudGl0bGUpIGJhc2VZID0gYmFzZVkgKyBnZXRGb250U2l6ZUZyb21DbGFzcygnZW0tbGVnZW5kLXRpdGxlJykgKyA4IC8vIHRpdGxlIHNpemUgKyBwYWRkaW5nXHJcblxyXG4gICAgICAgIC8vIFNldCB1cCBkaW1lbnNpb25zXHJcbiAgICAgICAgY29uc3Qgc3ZnV2lkdGggPSAzMDBcclxuICAgICAgICBjb25zdCBzdmdIZWlnaHQgPSAzMDBcclxuICAgICAgICBjb25zdCBtYXJnaW4gPSB7IHRvcDogMjAsIHJpZ2h0OiA2MCwgYm90dG9tOiAyMCwgbGVmdDogMTUwIH0gLy8gSW5jcmVhc2VkIGxlZnQgbWFyZ2luXHJcblxyXG4gICAgICAgIC8vIENhbGN1bGF0ZSBjb3VudHMgZm9yIGVhY2ggdGhyZXNob2xkIHJhbmdlXHJcbiAgICAgICAgbGV0IGNvdW50cyA9IG5ldyBBcnJheSh0aHJlc2hvbGRzLmxlbmd0aCArIDEpLmZpbGwoMClcclxuICAgICAgICBkYXRhLmZvckVhY2goKHZhbHVlKSA9PiB7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhyZXNob2xkcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlIDwgdGhyZXNob2xkc1tpXSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvdW50c1tpXSsrXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY291bnRzW3RocmVzaG9sZHMubGVuZ3RoXSsrXHJcbiAgICAgICAgfSlcclxuXHJcbiAgICAgICAgLy8gUmV2ZXJzZSB0aG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9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoXywgaSkge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qgc2VsID0gc2VsZWN0KHRoaXMpXHJcbiAgICAgICAgICAgICAgICBzZWwuc3R5bGUoJ3N0cm9rZScsICdibGFjaycpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBlY2wgPSBzZWwuYXR0cignZWNsJylcclxuICAgICAgICAgICAgICAgIGNvbnN0IGN1cnJlbnRJbmRleCA9IHBhcnNlSW50KGVjbCwgMTApXHJcbiAgICAgICAgICAgICAgICBjb25zdCByZXZlcnNlZEluZGV4ID0gY29sb3JzLmxlbmd0aCAtIDEgLSBjdXJyZW50SW5kZXggLy8gcmV2ZXJzZVxyXG4gICAgICAgICAgICAgICAgaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwLCByZXZlcnNlZEluZGV4KVxyXG4gICAgICAgICAgICAgICAgaWYgKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZXhlY3V0ZUZvckFsbEluc2V0cyhvdXQubWFwLmluc2V0VGVtcGxhdGVzXywgb3V0Lm1hcC5zdmdJZCwgaGlnaGxpZ2h0UmVnaW9ucywgZWNsKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKF8sIGkpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgc2VsLnN0eWxlKCdzdHJva2UnLCAnbm9uZScpXHJcbiAgICAgICAgICAgICAgICB1bmhpZ2hsaWdodFJlZ2lvbnMob3V0Lm1hcClcclxuICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIHVuaGlnaGxpZ2h0UmVnaW9ucylcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgLy8gQWRkIGNvdW50IGxhYmVscyBuZXh0IHRvIGJhcnNcclxuICAgICAgICBpZiAob3V0LmJhckNoYXJ0Q291bnRzKSB7XHJcbiAgICAgICAgICAgIGJhckdyb3VwXHJcbiAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCd0ZXh0LmNvdW50LWxhYmVsJylcclxuICAgICAgICAgICAgICAgIC5kYXRhKHJldmVyc2VkQ291bnRzKVxyXG4gICAgICAgICAgICAgICAgLmpvaW4oJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2NvdW50LWxhYmVsJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgKGQpID0+IHhTY2FsZShkKSArIDUpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIChfLCBpKSA9PiB5U2NhbGUoaSkgKyB5U2NhbGUuYmFuZHdpZHRoKCkgLyAyKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ3N0YXJ0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdhbGlnbm1lbnQtYmFzZWxpbmUnLCAnbWlkZGxlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdmb250LXNpemUnLCAnMTRweCcpIC8vIFNldCBsYWJlbCBmb250IHNpemUgdG8gMTRweFxyXG4gICAgICAgICAgICAgICAgLnRleHQoKGQpID0+IGQpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBBZGQgWSBheGlzIHdpdGggY3VzdG9tIHRpY2sgbGFiZWxzIGluIHJldmVyc2VkIG9yZGVyIGF0IDE0cHhcclxuICAgICAgICBjb25zdCB5QXhpcyA9IGJhckdyb3VwXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgYHRyYW5zbGF0ZSgke21hcmdpbi5sZWZ0fSwgMClgKVxyXG4gICAgICAgICAgICAuY2FsbChcclxuICAgICAgICAgICAgICAgIGF4aXNMZWZ0KHlTY2FsZSlcclxuICAgICAgICAgICAgICAgICAgICAudGlja1NpemVPdXRlcigwKVxyXG4gICAgICAgICAgICAgICAgICAgIC50aWNrU2l6ZSgwKVxyXG4gICAgICAgICAgICAgICAgICAgIC50aWNrRm9ybWF0KFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBvdXQuYmFyQ2hhcnRMYWJlbEZvcm1hdFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdXQuYmFyQ2hhcnRMYWJlbEZvcm1hdFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoXywgaSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT09IDApIHJldHVybiBgPiAke3RocmVzaG9sZHNbdGhyZXNob2xkcy5sZW5ndGggLSAxXX1gXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PT0gdGhyZXNob2xkcy5sZW5ndGgpIHJldHVybiBgPCAke3RocmVzaG9sZHNbMF19YFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGAke3RocmVzaG9sZHNbdGhyZXNob2xkcy5sZW5ndGggLSBpXX0gLSA8ICR7dGhyZXNob2xkc1t0aHJlc2hvbGRzLmxlbmd0aCAtIGkgLSAxXX1gXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICApXHJcbiAgICAgICAgICAgIClcclxuICAgICAgICAgICAgLnNlbGVjdEFsbCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdmb250LXNpemUnLCAnMTRweCcpIC8vIFNldCB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nZW5kIGNvbmZpZ3NcclxuICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnW2tleV1bcF0gIT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBvdXRba2V5XVtwXSA9IGNvbmZpZ1trZXldW3BdXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5jb2xvckxlZ2VuZCA9PSBmYWxzZSkgb3V0LmNvbG9yTGVnZW5kID0gZmFsc2VcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIG91dFtrZXldID0gY29uZmlnW2tleV1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAvL0BvdmVycmlkZVxyXG4gICAgb3V0LnVwZGF0ZSA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBjb25zdCBtID0gb3V0Lm1hcFxyXG4gICAgICAgIGNvbnN0IGxnZyA9IG91dC5sZ2dcclxuXHJcbiAgICAgICAgLy8gdXBkYXRlIGxlZ2VuZCBwYXJhbWV0ZXJzIGlmIG5lY2Vzc2FyeVxyXG4gICAgICAgIGlmIChtLmxlZ2VuZF8pXHJcbiAgICAgICAgICAgIGZvciAobGV0IGtleSBpbiBtLmxlZ2VuZF8pIHtcclxuICAgICAgICAgICAgICAgIGlmIChrZXkgPT0gJ2NvbG9yTGVnZW5kJyB8fCBrZXkgPT0gJ3NpemVMZWdlbmQnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgcCBpbiBvdXRba2V5XSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL292ZXJyaWRlIGVhY2ggcHJvcGVydHkgaW4gc2l6ZSBhbmQgY29sb3IgbGVnZW5kIG0ubGVnZW5kX1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobS5sZWdlbmRfW2tleV1bcF0gIT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0W2tleV1bcF0gPSBtLmxlZ2VuZF9ba2V5XVtwXVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBvdXRba2V5XSA9IG0ubGVnZW5kX1trZXldXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9yZW1vdmUgcHJldmlvdXMgY29udGVudFxyXG4gICAgICAgIGxnZy5zZWxlY3RBbGwoJyonKS5yZW1vdmUoKVxyXG5cclxuICAgICAgICAvL2RyYXcgbGVnZW5kIGJhY2tncm91bmQgYm94XHJcbiAgICAgICAgb3V0Lm1ha2VCYWNrZ3JvdW5kQm94KClcclxuXHJcbiAgICAgICAgYnVpbGRGbG93TGVnZW5kKClcclxuXHJcbiAgICAgICAgLy9zZXQgbGVnZW5kIGJveCBkaW1lbnNpb25zXHJcbiAgICAgICAgb3V0LnNldEJveERpbWVuc2lvbigpXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBCdWlsZHMgYSBsZWdlbmQgd2hpY2ggaWxsdXN0cmF0ZXMgdGhlIHN0YXRpc3RpY2FsIHZhbHVlcyBvZiBkaWZmZXJlbnQgZmxvdyBzeW1ib2wgc2l6ZXNcclxuICAgICAqXHJcbiAgICAgKiBAcGFyYW0geyp9IG1hcCBtYXAgaW5zdGFuY2VcclxuICAgICAqIEBwYXJhbSB7Kn0gY29udGFpbmVyIHBhcmVudCBsZWdlbmQgb2JqZWN0IGZyb20gY29yZS9sZWdlbmQuanNcclxuICAgICAqL1xyXG4gICAgZnVuY3Rpb24gYnVpbGRGbG93TGVnZW5kKG0pIHt9XHJcblxyXG4gICAgcmV0dXJuIG91dFxyXG59XHJcbiIsImltcG9ydCB7IGZvcm1hdCB9IG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XJ0eSBpbiBzaXplIGFuZCBjb2xvciBsZWdlbmQgY29uZmlnc1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChjb25maWdba2V5XVtwXSAhPT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG91dFtrZXldW3BdID0gY29uZmlnW2tleV1bcF1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBvdXRba2V5XSA9IGNvbmZpZ1trZXldXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgLy9Ab3ZlcnJpZGVcclxuICAgIG91dC51cGRhdGUgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgY29uc3QgbSA9IG91dC5tYXBcclxuICAgICAgICBjb25zdCBsZ2cgPSBvdXQubGdnXHJcblxyXG4gICAgICAgIC8vcmVtb3ZlIHByZXZpb3VzIGNvbnRlbnRcclxuICAgICAgICBsZ2cuc2VsZWN0QWxsKCcqJykucmVtb3ZlKClcclxuXHJcbiAgICAgICAgLy9kcmF3IGxlZ2VuZCBiYWNrZ3JvdW5kIGJveFxyXG4gICAgICAgIG91dC5tYWtlQmFja2dyb3VuZEJveCgpXHJcblxyXG4gICAgICAgIC8vIGxlZ2VuZCBmb3Igc2l6ZXNcclxuICAgICAgICBpZiAobS5zaXplQ2xhc3NpZmllcl8pIHtcclxuICAgICAgICAgICAgYnVpbGRTaXplTGVnZW5kKG0sIGxnZywgb3V0LnNpemVMZWdlbmQpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBsZWdlbmQgZm9yIHBzIGNvbG9yIHZhbHVlc1xyXG4gICAgICAgIGJ1aWxkQ29sb3JMZWdlbmQobSwgbGdnLCBvdXQuY29sb3JMZWdlbmQpXHJcblxyXG4gICAgICAgIC8vc2V0IGxlZ2VuZCBib3ggZGltZW5zaW9uc1x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cclxuICAgICAgICAgICAgICAgIG91dC5fc2l6ZUxlZ2VuZEhlaWdodCArXHJcbiAgICAgICAgICAgICAgICBvdXQubGVnZW5kU3BhY2luZyArXHJcbiAgICAgICAgICAgICAgICBvdXQuYm94UGFkZGluZyArXHJcbiAgICAgICAgICAgICAgICAoY29uZmlnLnRpdGxlID8gb3V0LnRpdGxlRm9udFNpemUgKyBvdXQuYm94UGFkZGluZyA6IDApICtcclxuICAgICAgICAgICAgICAgIGkgKiAoY29uZmlnLnNoYXBlSGVpZ2h0ICsgY29uZmlnLnNoYXBlUGFkZGluZylcclxuICAgICAgICAgICAgLy90aGUgY29sb3JcclxuICAgICAgICAgICAgY29uc3QgY29sID0gbS5jYXRDb2xvcnMoKVtjb2RlXSB8fCAnbGlnaHRncmF5J1xyXG5cclxuICAgICAgICAgICAgLy9yZWN0YW5nbGVcclxuICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtcmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgY29uZmlnLnNoYXBlV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgY29uZmlnLnNoYXBlSGVpZ2h0KVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgc2NzW2NvZGVdKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZScsICdibGFjaycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignc3Ryb2tlLXdpZHRoJywgMC41KVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwLCBjb2RlKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQubWFwLnN2Z0lkLCBoaWdobGlnaHRSZWdpb25zLCBjb2RlKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQubWFwLnN2Z0lkLCB1bmhpZ2hsaWdodFJlZ2lvbnMsIGNvZGUpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIC8vbGFiZWxcclxuICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtbGFiZWwnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZyArIGNvbmZpZy5zaGFwZVdpZHRoICsgY29uZmlnLmxhYmVsT2Zmc2V0KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5ICsgY29uZmlnLnNoYXBlSGVpZ2h0ICogMC41KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2RvbWluYW50LWJhc2VsaW5lJywgJ21pZGRsZScpXHJcbiAgICAgICAgICAgICAgICAudGV4dChtLmNhdExhYmVscygpW2NvZGVdIHx8IGNvZGUpXHJcblxyXG4gICAgICAgICAgICBpKytcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vJ25vIGRhdGEnIGxlZ2VuZCBib3hcclxuICAgICAgICBpZiAoY29uZmlnLm5vRGF0YSkge1xyXG4gICAgICAgICAgICBjb25zdCB5ID1cclxuICAgICAgICAgICAgICAgIG91dC5fc2l6ZUxlZ2VuZEhlaWdodCArXHJcbiAgICAgICAgICAgICAgICBvdXQubGVnZW5kU3BhY2luZyArXHJcbiAgICAgICAgICAgICAgICBvdXQuYm94UGFkZGluZyArXHJcbiAgICAgICAgICAgICAgICAoY29uZmlnLnRpdGxlID8gb3V0LnRpdGxlRm9udFNpemUgKyBvdXQuYm94UGFkZGluZyA6IDApICtcclxuICAgICAgICAgICAgICAgIGkgKiAoY29uZmlnLnNoYXBlSGVpZ2h0ICsgY29uZmlnLnNoYXBlUGFkZGluZylcclxuXHJcbiAgICAgICAgICAgIC8vcmVjdGFuZ2xlXHJcbiAgICAgICAgICAgIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgncmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLXJlY3QnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgeSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIGNvbmZpZy5zaGFwZVdpZHRoKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGNvbmZpZy5zaGFwZUhlaWdodClcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIG0ubm9EYXRhRmlsbFN0eWxlKCkpXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBoaWdobGlnaHRSZWdpb25zKG91dC5tYXAsICduZCcpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIGhpZ2hsaWdodFJlZ2lvbnMsICduZCcpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdW5oaWdobGlnaHRSZWdpb25zKG91dC5tYXApXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIHVuaGlnaGxpZ2h0UmVnaW9ucywgJ25kJylcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgLy8nbm8gZGF0YScgbGFiZWxcclxuICAgICAgICAgICAgY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtbGFiZWwnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZyArIGNvbmZpZy5zaGFwZVdpZHRoICsgY29uZm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1trZXldW3BdXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5jb2xvckxlZ2VuZCA9PSBmYWxzZSkgb3V0LmNvbG9yTGVnZW5kID0gZmFsc2VcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIG91dFtrZXldID0gY29uZmlnW2tleV1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAvL0BvdmVycmlkZVxyXG4gICAgb3V0LnVwZGF0ZSA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBjb25zdCBtID0gb3V0Lm1hcFxyXG4gICAgICAgIGNvbnN0IGxnZyA9IG91dC5sZ2dcclxuXHJcbiAgICAgICAgLy8gdXBkYXRlIGxlZ2VuZCBwYXJhbWV0ZXJzIGlmIG5lY2Vzc2FyeVxyXG4gICAgICAgIGlmIChtLmxlZ2VuZF8pXHJcbiAgICAgICAgICAgIGZvciAobGV0IGtleSBpbiBtLmxlZ2VuZF8pIHtcclxuICAgICAgICAgICAgICAgIGlmIChrZXkgPT0gJ2NvbG9yTGVnZW5kJyB8fCBrZXkgPT0gJ3NpemVMZWdlbmQnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgcCBpbiBvdXRba2V5XSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL292ZXJyaWRlIGVhY2ggcHJvcGVydHkgaW4gc2l6ZSBhbmQgY29sb3IgbGVnZW5kIG0ubGVnZW5kX1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobS5sZWdlbmRfW2tleV1bcF0gIT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0W2tleV1bcF0gPSBtLmxlZ2VuZF9ba2V5XVtwXVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAg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C5ib3hQYWRkaW5nXHJcbiAgICAgICAgICAgICAgICBsZXQgY29udGFpbmVyID0gb3V0Ll9zaXplTGVnZW5kTm9kZVxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBgdHJhbnNsYXRlKCR7eH0sJHt5fSlgKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtcmVjdCcpXHJcblxyXG4gICAgICAgICAgICAgICAgYnVpbGROb0RhdGFMZWdlbmQoeCwgeSwgY29udGFpbmVyLCBvdXQuc2l6ZUxlZ2VuZC5ub0RhdGFUZXh0KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9kZWZpbmUgZm9ybWF0IGZvciBsYWJlbHNcclxuICAgICAgICBsZXQgbGFiZWxGb3JtYXR0ZXIgPSBvdXQuc2l6ZUxlZ2VuZC5sYWJlbEZvcm1hdHRlciB8fCBzcGFjZUFzVGhvdXNhbmRTZXBhcmF0b3JcclxuICAgICAgICAvL2RyYXcgdGl0bGVcclxuICAgICAgICBpZiAob3V0LnNpemVMZWdlbmQudGl0bGUpIHtcclxuICAgICAgICAgICAgb3V0Ll9zaXplTGVnZW5kTm9kZVxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLXRpdGxlJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LmJveFBhZGRpbmcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIG91dC5ib3hQYWRkaW5nICsgb3V0LnRpdGxlRm9udFNpemUpXHJcbiAgICAgICAgICAgICAgICAudGV4dChvdXQuc2l6ZUxlZ2VuZC50aXRsZSlcclxuICAgICAgIC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ZWdlbmQudmFsdWVzW2MgLSAxXSA6IG1heFZhbCAvIGNcclxuICAgICAgICAgICAgLy9jYWxjdWxhdGUgc2hhcGUgc2l6ZVxyXG4gICAgICAgICAgICBsZXQgc3ltYm9sU2l6ZSA9IG0uY2xhc3NpZmllclNpemVfKHZhbClcclxuXHJcbiAgICAgICAgICAgIGlmIChtLnBzU2hhcGVfID09ICdiYXInKSB7XHJcbiAgICAgICAgICAgICAgICBidWlsZEJhcnNJdGVtKG1hcCwgdmFsLCBzeW1ib2xTaXplLCBpLCBsYWJlbEZvcm1hdHRlcilcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChtLnBzU2hhcGVfID09ICdjdXN0b20nIHx8IG0ucHNDdXN0b21TVkdfKSB7XHJcbiAgICAgICAgICAgICAgICBidWlsZEN1c3RvbVNWR0l0ZW0obWFwLCB2YWwsIHN5bWJvbFNpemUsIGksIGxhYmVsRm9ybWF0dGVyKVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgYnVpbGREM1N5bWJvbEl0ZW0obWFwLCB2YWwsIHN5bWJvbFNpemUsIGksIGxhYmVsRm9ybWF0dGVyKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAob3V0LnNpemVMZWdlbmQubm9EYXRhKSB7XHJcbiAgICAgICAgICAgIGxldCB5ID0gb3V0Ll9zaXplTGVnZW5kTm9kZS5ub2RlKCkuZ2V0QkJveCgpLmhlaWdodFxyXG4gICAgICAgICAgICBpZiAob3V0LmNvbG9yTGVnZW5kKSB7XHJcbiAgICAgICAgICAgICAgICB5ICs9IG91dC5jb2xvckxlZ2VuZC5zaGFwZUhlaWdodCArIDVcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBsZXQgeCA9IG91dC5ib3hQYWRkaW5nXHJcbiAgICAgICAgICAgIGxldCBjb250YWluZXIgPSBvdXQuX3NpemVMZWdlbmROb2RlXHJcbiAgICAgICAgICAg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lZ2lvbnMob3V0Lm1hcCwgJ25kJylcclxuICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIGhpZ2hsaWdodFJlZ2lvbnMsICduZCcpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICB1bmhpZ2hsaWdodFJlZ2lvbnMob3V0Lm1hcClcclxuICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgIGV4ZWN1dGVGb3JBbGxJbnNldHMob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18sIG91dC5tYXAuc3ZnSWQsIHVuaGlnaGxpZ2h0UmVnaW9ucywgJ25kJylcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgLy8nbm8gZGF0YScgbGFiZWxcclxuICAgICAgICBjb250YWluZXJcclxuICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtbGFiZWwnKVxyXG4gICAgICAgICAgICAuYXR0cigneCcsIG91dC5jb2xvckxlZ2VuZCA/IG91dC5jb2xvckxlZ2VuZC5zaGFwZVdpZHRoICsgb3V0LmNvbG9yTGVnZW5kLmxhYmVsT2Zmc2V0LnggOiBvdXQubm9EYXRhU2hhcGVXaWR0aCArIDUpXHJcbiAgICAgICAgICAgIC5hdHRyKCd5Jywgb3V0LmNvbG9yTGVnZW5kID8gb3V0LmNvbG9yTGVnZW5kLnNoYXBlSGVpZ2h0IC8gM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rZS13aWR0aCcsIDAuNSlcclxuICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdkJywgZClcclxuICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICgpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLnBzQ3VzdG9tU1ZHXylcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYHRyYW5zbGF0ZSgke291dC5zaXplTGVnZW5kLnNoYXBlT2Zmc2V0Lnh9LCR7b3V0LnNpemVMZWdlbmQuc2hhcGVPZmZzZXQueX0pIHNjYWxlKCR7c3ltYm9sU2l6ZX0pYFxyXG4gICAgICAgICAgICAgICAgZWxzZSByZXR1cm4gYHRyYW5zbGF0ZSgke291dC5zaXplTGVnZW5kLnNoYXBlT2Zmc2V0Lnh9LCR7b3V0LnNpemVMZWdlbmQuc2hhcGVPZmZzZXQueX0pYFxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgIC8vbGFiZWwgcG9zaXRpb25cclxuICAgICAgICBsZXQgbGFiZWxYID0geCArIG91dC5tYXAucHNCYXJXaWR0aF8gKyBvdXQuc2l6ZUxlZ2VuZC5sYWJlbE9mZnNldC54XHJcbiAgICAgICAgbGV0IGxhYmVsWSA9IHN5bWJvbFNpemUgLyAyICsgb3V0LnNpemVMZWdlbmQubGFiZWxPZmZzZXQueVxyXG5cclxuICAgICAgICAvL2FwcGVuZCBsYWJlbFxyXG4gICAgICAgIGl0ZW1Db250YWluZXJcclxuICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtbGFiZWwnKVxyXG4gICAgICAgICAgICAuYXR0cigneCcsIGxhYmVsWClcclxuICAgICAgICAgICAgLmF0dHIoJ3knLCBsYWJlbFkpXHJcbiAgICAgICAgICAgIC50ZXh0KGxhYmVsRm9ybWF0dGVyKHZhbHVlKSlcclxuICAg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ZUxlZ2VuZC50aXRsZSkge1xyXG4gICAgICAgICAgICBvdXQuX3NpemVMZWdlbmROb2RlXHJcbiAgICAgICAgICAgICAgICAuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtdGl0bGUnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5Jywgb3V0LmJveFBhZGRpbmcgKyBvdXQudGl0bGVGb250U2l6ZSlcclxuICAgICAgICAgICAgICAgIC50ZXh0KG91dC5zaXplTGVnZW5kLnRpdGxlKVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgbGV0IG1heFJhZGl1cyA9IG0uY2xhc3NpZmllclNpemVfKG1heChvdXQuX3NpemVMZWdlbmRWYWx1ZXMpKSAvL21heGltdW0gY2lyY2xlIHJhZGl1cyB0byBiZSBzaG93biBpbiBsZWdlbmRcclxuICAgICAgICBsZXQgeCA9IG91dC5ib3hQYWRkaW5nICsgbWF4UmFkaXVzXHJcbiAgICAgICAgbGV0IHkgPSBvdXQuYm94UGFkZGluZyArIG1heFJhZGl1cyAqIDIgKyAob3V0LnNpemVMZWdlbmQudGl0bGUgPyBvdXQudGl0bGVGb250U2l6ZSArIG91dC5zaXplTGVnZW5kLnRpdGxlUGFkZGluZyA6IDApICsgMjBcclxuXHJcbiAgICAgICAgbGV0IGl0ZW1Db250YWluZXIgPSBvdXQuX3NpemVMZWdlbmROb2RlXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgYHRyYW5zbGF0ZSgke3h9LCR7eX0pYClcclxuICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2NpcmNsZS1sZWdlbmQnKVxyXG4gICAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCAncmlnaHQnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCAnYmxhY2snKVxyXG4gICAgICAgICAgICAuc2VsZWN0QWxsKCdnJylcclxuICAgICAgICAgICAgLmRhdGEob3V0Ll9zaXplTGVnZW5kVmFsdWVzKVxyXG4gICAgICAgICAgICAuam9pbignZycpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtaXRlbScpXHJcblxyXG4gICAgICAgIC8vY2lyY2xlc1xyXG4gICAgICAgIGl0ZW1Db250YWluZXJcclxuICAgICAgICAgICAgLmFwcGVuZCgnY2lyY2xlJylcclxuICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1jaXJjbGUnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCAnbm9uZScpXHJcbiAgICAgICAgICAgIC5hdHRyKCdzdHJva2UnLCAnYmxhY2snKVxyXG4gICAgICAgICAgICAuYXR0cignY3knLCAoZCkgPT4gLW0uY2xhc3NpZmllclNpemVfKGQpKVxyXG4gICAgICAgICAgICAuYXR0cigncicsIG0uY2xhc3NpZmllclNpemVfKVxyXG5cclxuICAgICAgICAvL2xhYmVsc1xyXG4gICAgICAgIGl0ZW1Db250YWluZXJcclxuICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtbGFiZWwnKVxyXG4gICAgICAgICAgICAuYXR0cigneScsIChkLCBpKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBsZXQgeSA9IC0xIC0gMiAqIG0uY2xhc3NpZmllclNpemVfKGQpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4geVxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuYXR0cigneCcsIG1heFJhZGl1cyArIDUpXHJcbiAgICAgICAgICAgIC50ZXh0KChkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZC50b0xvY2FsZVN0cmluZygnZW4nKS5yZXBsYWNlKC8sL2dpLCAnICcpXHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgLy9saW5lIHBvaW50aW5nIHRvIHRvcCBvZiBjb3JyZXNwb25kaW5nIGNpcmNsZTpcclxuICAgICAgICBpdGVtQ29udGFpbmVyXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ2xpbmUnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS1kYXNoYXJyYXknLCAyKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsICdncmV5JylcclxuICAgICAgICAgICAgLmF0dHIoJ3gxJywgMilcclxuICAgICAgICAgICAgLmF0dHIoJ3kxJywgKGQsIGkpID0+IHtcclxuICAgICAgICAgICAgICAgIGxldCB5ID0gLTEgLSAyICogbS5jbGFzc2lmaWVyU2l6ZV8oZClcclxuICAgICAgICAgICAgICAgIHJldHVybiB5XHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC5hdHRyKCd4MicsIG1heFJhZGl1cyArIDUpXHJcbiAgICAgICAgICAgIC5hdHRyKCd5MicsIChkLCBpKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBsZXQgeSA9IC0xIC0gMiAqIG0uY2xhc3NpZmllclNpemVfKGQpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4geVxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICByZXR1cm4gb3V0XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBCdWlsZHMgYSBsZWdlbmQgaWxsdXN0cmF0aW5nIHRoZSBzdGF0aXN0aWNhbCB2YWx1ZXMgb2YgZGlmZmVyZW50IHN5bWJvbCBjb2xvdXJzXHJcbiAgICAgKlxyXG4gICAgICogQHBhcmFtIHsqfSBtIG1hcFxyXG4gICAgICovXHJcbiAgICBmdW5jdGlvbiBidWlsZENvbG9yTGVnZW5kKG0pIHtcclxuICAgICAgICAvL2RlZmluZ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hcGVIZWlnaHQpXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBoaWdobGlnaHRSZWdpb25zKG91dC5tYXAsIGVjbClcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0Lm1hcC5pbnNldFRlbXBsYXRlc18pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZXhlY3V0ZUZvckFsbEluc2V0cyhvdXQubWFwLmluc2V0VGVtcGxhdGVzXywgb3V0Lm1hcC5zdmdJZCwgaGlnaGxpZ2h0UmVnaW9ucywgZWNsKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHVuaGlnaGxpZ2h0UmVnaW9ucyhvdXQubWFwKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFwLmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlRm9yQWxsSW5zZXRzKG91dC5tYXAuaW5zZXRUZW1wbGF0ZXNfLCBvdXQubWFwLnN2Z0lkLCB1bmhpZ2hsaWdodFJlZ2lvbnMsIGVjbClcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgLy9zZXBhcmF0aW9uIGxpbmVcclxuICAgICAgICAgICAgaWYgKGkgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICBpdGVtQ29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgnbGluZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1zZXBhcmF0b3InKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MScsIDApXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kxJywgMClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneDInLCAwICsgb3V0LmNvbG9yTGVnZW5kLnNlcExpbmVMZW5ndGgpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgMClcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy8gQXBwZW5kIHRpY2sgbGluZVxyXG4gICAgICAgICAgICBpZiAoaSA+IDApIHtcclxuICAgICAgICAgICAgICAgIGl0ZW1Db250YWluZXJcclxuICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCdsaW5lJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLXRpY2snKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4MScsIG91dC5jb2xvckxlZ2VuZC5zaGFwZVdpZHRoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5MScsIDApXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gyJywgb3V0LmNvbG9yTGVnZW5kLnNlcExpbmVMZW5ndGggKyBvdXQuY29sb3JMZWdlbmQudGlja0xlbmd0aClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneTInLCAwKVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvL2xhYmVsXHJcbiAgICAgICAgICAgIGlmIChpIDwgbnVtYmVyT2ZDbGFzc2VzIC0gMSkge1xyXG4gICAgICAgICAgICAgICAgaXRlbUNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtbGFiZWwnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LmNvbG9yTGVnZW5kLnNlcExpbmVMZW5ndGggKyBvdXQuY29sb3JMZWdlbmQudGlja0xlbmd0aCArIG91dC5jb2xvckxlZ2VuZC5sYWJlbE9mZnNldC54KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hd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HJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBAZGVzY3JpcHRpb24gcmV0dXJucyB0aGUgZDMuc3ltYm9sIG9iamVjdCBjaG9zZW4gYnkgdGhlIHVzZXJcclxuICAgICAqIEByZXR1cm4ge2QzLnNoYXBlIHx8IFNWR31cclxuICAgICAqL1xyXG4gICAgZnVuY3Rpb24gZ2V0U2hhcGUoKSB7XHJcbiAgICAgICAgbGV0IHNoYXBlXHJcbiAgICAgICAgaWYgKG91dC5tYXAucHNDdXN0b21TVkdfKSB7XHJcbiAgICAgICAgICAgIHNoYXBlID0gb3V0Lm1hcC5wc0N1c3RvbVNWR19cclxuICAgICAgICB9IGVsc2UgaWYgKG91dC5tYXAucHNDdXN0b21TaGFwZV8pIHtcclxuICAgICAgICAgICAgc2hhcGUgPSBvdXQubWFwLnBzQ3VzdG9tU2hhcGVfXHJcbiAgICAgICAgfSBlbHNlIGlmIChvdXQubWFwLnBzU2hhcGVfID09ICdiYXInKSB7XHJcbiAgICAgICAgICAgIC8vZm9yIHJlY3RhbmdsZXMsIHdlIHVzZSBhIGN1c3RvbSBkMyBzeW1ib2xcclxuICAgICAgICAgICAgbGV0IGRyYXdSZWN0YW5nbGUgPSAoY29udGV4dCwgc2l6ZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgbGV0IGhlaWdodCA9IE1hdGguc3FydChzaXplKVxyXG4gICAgICAgICAgICAgICAgY29udGV4dC5tb3ZlVG8oMCwgMClcclxuICAgICAgICAgICAgICAgIGNvbnRleHQubGluZVRvKDAsIGhlaWdodClcclxuICAgICAgICAgICAgICAgIGNvbnRleHQubGluZVRvKG91dC5tYXAucHNCYXJXaWR0aF8sIGhlaWdodClcclxuICAgICAgICAgICAgICAgIGNvbnRleHQubGluZVRvKG91dC5tYXAucHNCYXJXaWR0aF8sIDApXHJcbiAgICAgICAgICAgICAgICBjb250ZXh0LmxpbmVUbygwLCAwKVxyXG4gICAgICAgICAgICAgICAgY29udGV4dC5jbG9zZVBhdGgoK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aW5nICsgb3V0LnRpdGxlRm9udFNpemUpXHJcbiAgICAgICAgICAgICAgICAudGV4dChvdXQudGl0bGUpXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2RyYXcgbGVnZW5kIGVsZW1lbnRzIGZvciBjbGFzc2VzOiByZWN0YW5nbGUgKyBsYWJlbFxyXG4gICAgICAgIGxldCBpID0gMFxyXG4gICAgICAgIGNvbnN0IHNjcyA9IG0uY2F0Q29sb3JzKClcclxuICAgICAgICBmb3IgKGxldCBjb2RlIGluIHNjcykge1xyXG4gICAgICAgICAgICAvL3RoZSB2ZXJ0aWNhbCBwb3NpdGlvbiBvZiB0aGUgbGVnZW5kIGVsZW1lbnRcclxuICAgICAgICAgICAgY29uc3QgeSA9XHJcbiAgICAgICAgICAgICAgICBvdXQuYm94UGFkZGluZyArIChvdXQudGl0bGUgPyBvdXQudGl0bGVGb250U2l6ZSArIG91dC5ib3hQYWRkaW5nIDogMCkgKyBpICogKG91dC5zaGFwZUhlaWdodCArIG91dC5zaGFwZVBhZGRpbmcpXHJcblxyXG4gICAgICAgICAgICAvL3RoZSBjb2xvclxyXG4gICAgICAgICAgICBjb25zdCBjb2wgPSBtLmNhdENvbG9ycygpW2NvZGVdIHx8ICdsaWdodGdyYXknXHJcblxyXG4gICAgICAgICAgICAvL3JlY3RhbmdsZVxyXG4gICAgICAgICAgICBsZ2cuYXBwZW5kKCdyZWN0JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdlbS1sZWdlbmQtcmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5KVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgb3V0LnNoYXBlV2lkdGgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0Jywgb3V0LnNoYXBlSGVpZ2h0KVxyXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgc2NzW2NvZGVdKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZScsICdibGFjaycpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignc3Ryb2tlLXdpZHRoJywgMC41KVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogY2hhbmdlIHRoaXMgdG8gZXN0YXQgbG9naWMgb2YgbWFraW5nIGFsbCBvdGhlciBjbGFzc2VzIHRyYW5zcGFyZW50P1xyXG4gICAgICAgICAgICAgICAgICAgIHN2Z01hcFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXR0ZXJuJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbChcInJlY3RbY29kZT0nXCIgKyBjb2RlICsgXCInXVwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBtLmhvdmVyQ29sb3IoKSlcclxuICAgICAgICAgICAgICAgICAgICBzZWxlY3QodGhpcykuc3R5bGUoJ2ZpbGwnLCBtLmhvdmVyQ29sb3IoKSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN2Z01hcFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXR0ZXJuJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbChcInJlY3RbY29kZT0nXCIgKyBjb2RlICsgXCInXVwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBjb2wpXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnN0eWxlKCdmaWxsJywgY29sKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIC8vbGFiZWxcclxuICAgICAgICAgICAgbGdnLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLWxhYmVsJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd4Jywgb3V0LmJveFBhZGRpbmcgKyBvdXQuc2hhcGVXaWR0aCArIG91dC5sYWJlbE9mZnNldClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgeSArIG91dC5zaGFwZUhlaWdodCAqIDAuNSlcclxuICAgICAgICAgICAgICAgIC50ZXh0KG0uY2F0TGFiZWxzKClbY29kZV0gfHwgY29kZSlcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN2Z01hcFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXR0ZXJuJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbChcInJlY3RbY29kZT0nXCIgKyBjb2RlICsgXCInXVwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBtLmhvdmVyQ29sb3IoKSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNvbCA9IG0uY2F0Q29sb3JzKClbY29kZV0gfHwgJ2xpZ2h0Z3JheSdcclxuICAgICAgICAgICAgICAgICAgICBzdmdNYXBcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgncGF0dGVybicpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoXCJyZWN0W2NvZGU9J1wiICsgY29kZSArIFwiJ11cIilcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgY29sKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIGkrK1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8nbm8gZGF0YScgbGVnZW5kIGJveFxyXG4gICAgICAgIGlmIChvdXQubm9EYXRhKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHkgPVxyXG4gICAgICAgICAgICAgICAgb3V0LmJveFBhZGRpbmcgKyAob3V0LnRpdGxlID8gb3V0LnRpdGxlRm9udFNpemUgKyBvdXQuYm94UGFkZGluZyA6IDApICsgaSAqIChvdXQuc2hhcGVIZWlnaHQgKyBvdXQuc2hhcGVQYWRkaW5nKVxyXG5cclxuICAgICAgICAgICAgLy9yZWN0YW5nbGVcclxuICAgICAgICAgICAgbGdnLmFwcGVuZCgncmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tbGVnZW5kLXJlY3QnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBvdXQuYm94UGFkZGluZylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgeSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIG91dC5zaGFwZVdpZHRoKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIG91dC5zaGFwZUhlaWdodClcclxuICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIG0ubm9EYXRhRmlsbFN0eWxlKCkpXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBzdmdNYXAuc2VsZWN0KCcjZW0tbnV0c3JnJykuc2VsZWN0QWxsKFwiW25kPSduZCddXCIpLnN0eWxlKCdmaWxsJywgbS5ob3ZlckNvbG9yKCkpXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0KHRoaXMpLnN0eWxlKCdmaWxsJywgbS5ob3ZlckNvbG9yKCkpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzdmdNYXBcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdCgnI2VtLW51dHNyZycpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoXCJbbmQ9J25kJ11cIilcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgZnVuY3Rpb24gKGQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0ubm9EYXRhRmlsbFN0eWxlKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICBzZWxlY3QodGhpcykuc3R5bGUoJ2ZpbGwnLCBtLm5vRGF0YUZpbGxTdHlsZSgpKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIC8vJ25vIGRhdGEnIGxhYmVsXHJcbiAgICAgICAgICAgIGxnZy5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2VtLWxlZ2VuZC1sYWJlbCcpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIG91dC5ib3hQYWRkaW5nICsgb3V0LnNoYXBlV2lkdGggKyBvdXQubGFiZWxPZmZzZXQpXHJcbiAgICAgICAgICAgICAgICAuYXR0cigneScsIHkgKyBvdXQuc2hhcGVIZWlnaHQgKiAwLjUpXHJcbiAgICAgICAgICAgICAgICAudGV4dChvdXQubm9EYXRhVGV4dClcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN2Z01hcC5zZWxlY3QoJyNlbS1udXRzcmcnKS5zZWxlY3RBbGwoXCJbbmQ9J25kJ11cIikuc3R5bGUoJ2ZpbGwnLCBtLmhvdmVyQ29sb3IoKSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHN2Z01hcFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0KCcjZW0tbnV0c3JnJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbChcIltuZD0nbmQnXVwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBmdW5jdGlvbiAoZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbS5ub0RhdGFGaWxsU3R5bGUoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vc2V0IGxlZ2VuZCBib3ggZGltZW5zaW9uc1xyXG4gICAgICAgIG91dC5zZXRCb3hEaW1lbnNpb24oKVxyXG4gICAgfVxyXG5cclxuICAgIHJldHVybiBvdXRcclxufVxyXG4iLCJpbXBvcnQgeyBzZWxlY3QgfSBmcm9tICdkMy1zZWxlY3Rpb24nXHJcbmltcG9ydCB7IGdldEZvbnRTaXplRnJvbUNsYXNzIH0gZnJvbSAnLi4vY29yZS91dGlscydcclxuXHJcbi8qKlxyXG4gKiBBIGV1cm9zdGF0LW1hcCBsZWdlbmQuIFRoaXMgaXMgYW4gYWJzdHJhY3QgbWV0aG9kLlxyXG4gKi9cclxuZXhwb3J0IGNvbnN0IGxlZ2VuZCA9IGZ1bmN0aW9uIChtYXApIHtcclxuICAgIC8vYnVpbGQgbGVnZW5kIG9iamVjdFxyXG4gICAgY29uc3Qgb3V0ID0ge31cclxuXHJcbiAgIC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oaXMpLmF0dHIoJ2VjbCcpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFlY2wgfHwgZWNsID09PSAnbmQnKSByZXR1cm4gb3V0Lm5vRGF0YUZpbGxTdHlsZV8gfHwgJ2dyYXknXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG91dC5jbGFzc1RvRmlsbFN0eWxlX1tvdXQuY2xhc3NpZmllcigpLmRvbWFpbigpW2VjbF1dIHx8IG91dC5ub0RhdGFGaWxsU3R5bGVfIHx8ICdncmF5J1xyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5lbmQoKVxyXG4gICAgICAgICAgICAgICAgLnRoZW4oKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIFN0b3JlIHRoZSBvcmlnaW5hbCBjb2xvciBmb3IgZWFjaCByZWdpb25cclxuICAgICAgICAgICAgICAgICAgICByZWdpb25zLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsLmF0dHIoJ2ZpbGxfX18nLCBzZWwuc3R5bGUoJ2ZpbGwnKSlcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAvLyBTZXQgdXAgbW91c2UgZXZlbnRzXHJcbiAgICAgICAgICAgICAgICAgICAgcmVnaW9uc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uIChlLCByZykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2VsID0gc2VsZWN0KHRoaXMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWwuc3R5bGUoJ2ZpbGwnLCBtYXAuaG92ZXJDb2xvcl8pIC8vIEFwcGx5IGhpZ2hsaWdodCBjb2xvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5fdG9vbHRpcCkgb3V0Ll90b29sdGlwLm1vdXNlb3ZlcihvdXQudG9vbHRpcF8udGV4dEZ1bmN0aW9uKHJnLCBvdXQpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGZ1bmN0aW9uIChlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2Vtb3ZlKGUpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbC5zdHlsZSgnZmlsbCcsIHNlbC5hdHRyKCdmaWxsX19fJykpIC8vIFJldmVydCB0byBvcmlnaW5hbCBjb2xvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5fdG9vbHRpcCkgbWFwLl90b29sdGlwLm1vdXNlb3V0KClcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuY2F0Y2goKGVycikgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vY29uc29sZS5lcnJvcignRXJyb3IgYXBwbHlpbmcgdHJhbnNpdGlvbiB0byByZWdpb25zOicsIGVycilcclxuICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAvLyBBcHBseSBhZGRpdGlvbmFsIHNldHRpbmdzIGZvciBtaXhlZCBOVVRTIGxldmVsIHZpZXdcclxuICAgICAgICAgICAgaWYgKG91dC5udXRzTGV2ZWxfID09PSAnbWl4ZWQnKSB7XHJcbiAgICAgICAgICAgICAgICBtYXAuc3ZnKClcclxuICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCcjZW0tbnV0c3JnIHBhdGgnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnZGlzcGxheScsIGZ1bmN0aW9uIChyZykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZWNsID0gc2VsLmF0dHIoJ2VjbCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGx2bCA9IHNlbC5hdHRyKCdsdmwnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZWNsIHx8IGx2bCA9PT0gJzAnID8gJ2Jsb2NrJyA6ICdub25lJ1xyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBsdmwgPSBzZWwuYXR0cignbHZsJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZWNsID0gc2VsLmF0dHIoJ2VjbCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHN0cm9rZSA9IHNlbC5zdHlsZSgnc3Ryb2tlJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVjbCAmJiBsdmwgIT09ICcwJyA/IHN0cm9rZSB8fCAnIzc3NycgOiBudWxsXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS13aWR0aCcsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2VsID0gc2VsZWN0KHRoaXMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGx2bCA9IHNlbC5hdHRyKCdsdmwnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBlY2wgPSBzZWwuYXR0cignZWNsJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3Ryb2tlV2lkdGggPSBzZWwuc3R5bGUoJ3N0cm9rZS13aWR0aCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlY2wgJiYgbHZsICE9PSAnMCcgPyBzdHJva2VXaWR0aCB8fCAwLjIgOiBudWxsXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy8gVXBkYXRlIGxhYmVscyBmb3Igc3RhdGlzdGljYWwgdmFsdWVzIGlmIHJlcXVpcmVkXHJcbiAgICAgICAgICAgIGlmICggbWFwLmxhYmVsc18gJiYgb3V0LmxhYmVsc18udmFsdWVzKSB7XHJcbiAgICAgICAgICAgICAgICBvdXQudXBkYXRlVmFsdWVzTGFiZWxzKG1hcClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvL0BvdmVycmlkZVxyXG4gICAgb3V0LmdldExlZ2VuZENvbnN0cnVjdG9yID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIHJldHVybiBDYXRlZ29yaWNhbExlZ2VuZC5sZWdlbmRcclxuICAgIH1cclxuXHJcbiAgICByZXR1cm4gb3V0XHJcbn1cclxuXHJcbi8qKlxyXG4gKiBTcGVjaWZpYyBmdW5jdGlvbiBmb3IgdG9vbHRpcCB0ZXh0LlxyXG4gKlxyXG4gKiBAcGFyYW0geyp9IHJnIFRoZSByZWdpb24gdG8gc2hvdyBpbmZvcm1hdGlvbiBvbi5cclxuICogQHBhcmFtIHsqfSBtYXAgVGhlIG1hcCBlbGVtZW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jFfJyxcclxuICAgICAgICAnY29sb3IyXycsXHJcbiAgICAgICAgJ2VuZENvbG9yXycsXHJcbiAgICAgICAgJ2NsYXNzVG9GaWxsU3R5bGVfJyxcclxuICAgICAgICAnbm9EYXRhRmlsbFN0eWxlXycsXHJcbiAgICAgICAgJ2NsYXNzaWZpZXIxXycsXHJcbiAgICAgICAgJ2NsYXNzaWZpZXIyXycsXHJcbiAgICBdLmZvckVhY2goZnVuY3Rpb24gKGF0dCkge1xyXG4gICAgICAgIG91dFthdHQuc3Vic3RyaW5nKDAsIGF0dC5sZW5ndGggLSAxKV0gPSBmdW5jdGlvbiAodikge1xyXG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBvdXRbYXR0XVxyXG4gICAgICAgICAgICBvdXRbYXR0XSA9IHZcclxuICAgICAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgICAgIH1cclxuICAgIH0pXHJcblxyXG4gICAgLy9vdmVycmlkZSBhdHRyaWJ1dGUgdmFsdWVzIHdpdGggY29uZmlnIHZhbHVlc1xyXG4gICAgaWYgKGNvbmZpZylcclxuICAgICAgICBbJ251bWJlck9mQ2xhc3NlcycsICdzdGFydENvbG9yJywgJ2NvbG9yMScsICdjb2xvcjInLCAnZW5kQ29sb3InLCAnY2xhc3NUb0ZpbGxTdHlsZScsICdub0RhdGFGaWxsU3R5bGUnXS5mb3JFYWNoKFxyXG4gICAgICAgICAgICBmdW5jdGlvbiAoa2V5KSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnW2tleV0gIT0gdW5kZWZpbmVkKSBvdXRba2V5XShjb25maWdba2V5XSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIClcclxuXHJcbiAgICAvL0BvdmVycmlkZVxyXG4gICAgb3V0LnVwZGF0ZUNsYXNzaWZpY2F0aW9uID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIC8vIGFwcGx5IGNsYXNzaWZpY2F0aW9uIHRvIGFs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TWFwKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXVtjXSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0uc3ZnSWRfICE9PSBvdXQuc3ZnSWRfKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIHVuaXF1ZSBpbnNldCBnZW9fXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXS5zdmdJZF8gIT09IG91dC5zdmdJZF8pIGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb10pXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIGFwcGx5IHRvIG1haW4gbWFwXHJcbiAgICAgICAgYXBwbHlDbGFzc2lmaWNhdGlvblRvTWFwKG91dClcclxuXHJcbiAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgfVxyXG5cclxuICAgIGZ1bmN0aW9uIGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcChtYXApIHtcclxuICAgICAgICAvL3NldCBjbGFzc2lmaWVyc1xyXG4gICAgICAgIGxldCBzdGF0MSA9IG91dC5zdGF0RGF0YSgndjEnKS5nZXRBcnJheSgpIHx8IG91dC5zdGF0RGF0YSgpLmdldEFycmF5KClcclxuICAgICA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ucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXN2KSByZXR1cm5cclxuICAgICAgICAgICAgICAgICAgICBjb25zdCB2ID0gc3YudmFsdWVcclxuICAgICAgICAgICAgICAgICAgICBpZiAoKHYgIT0gMCAmJiAhdikgfHwgdiA9PSAnOicpIHJldHVybiAnbmQnXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICtvdXQuY2xhc3NpZmllcjFfKCt2KVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdlY2wyJywgZnVuY3Rpb24gKHJnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBvdXQuc3RhdERhdGEoJ3YyJykuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdikgcmV0dXJuXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdiA9IHN2LnZhbHVlXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh2ICE9IDAgJiYgIXYpIHx8IHYgPT0gJzonKSByZXR1cm4gJ25kJ1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiArb3V0LmNsYXNzaWZpZXIyXygrdilcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignbmQnLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzdjEgPSBvdXQuc3RhdERhdGEoJ3YxJykuZ2V0KHJnLnByb3BlcnRpZXMuaWQpIHx8IG91dC5zdGF0RGF0YSgpLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHN2MiA9IG91dC5zdGF0RGF0YSgndjInKS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXN2MSB8fCAhc3YyKSByZXR1cm5cclxuICAgICAgICAgICAgICAgICAgICBsZXQgdiA9IHN2MS52YWx1ZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICgodiAhPSAwICYmICF2KSB8fCB2ID09ICc6JykgcmV0dXJuICduZCdcclxuICAgICAgICAgICAgICAgICAgICB2ID0gc3YyLnZhbHVlXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh2ICE9IDAgJiYgIXYpIHx8IHYgPT0gJzonKSByZXR1cm4gJ25kJ1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnJ1xyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgIC8vd2hlbiBtaXhpbmcgTlVUUywgbGV2ZWwgMCBpcyBzZXBhcmF0ZWQgZnJvbSB0aGUgcmVzdCAoY2xhc3MgbnV0c3JnMClcclxuICAgICAgICAgICAgaWYgKG1hcC5udXRzTGV2ZWxfID09ICdtaXhlZCcpIHtcclxuICAgICAgICAgICAgICAgIG1hcC5zdmcoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGguZW0tbnV0c3JnMCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2VjbDEnLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBvdXQuc3RhdERhdGEoJ3YxJykuZ2V0KHJnLnByb3BlcnRpZXMuaWQpIHx8IG91dC5zdGF0RGF0YSgpLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXN2KSByZXR1cm5cclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdiA9IHN2LnZhbHVlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodiAhPSAwICYmICF2KSB8fCB2ID09ICc6JykgcmV0dXJuICduZCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICtvdXQuY2xhc3NpZmllcjFfKCt2KVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2VjbDInLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBvdXQuc3RhdERhdGEoJ3YyJykuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3YpIHJldHVyblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2ID0gc3YudmFsdWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh2ICE9IDAgJiYgIXYpIHx8IHYgPT0gJzonKSByZXR1cm4gJ25kJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gK291dC5jbGFzc2lmaWVyMl8oK3YpXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy9kZWZpbmUgYml2YXJpYXRlIHNjYWxlXHJcbiAgICAgICAgICAgIGlmICghb3V0LmNsYXNzVG9GaWxsU3R5bGUoKSkge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qgc2NhbGUgPSBzY2FsZUJpdmFyaWF0ZShvdXQubnVtYmVyT2ZDbGFzc2VzKCksIG91dC5zdGFydENvbG9yKCksIG91dC5jb2xvcjEoKSwgb3V0LmNvbG9yMigpLCBvdXQuZW5kQ29sb3IoKSlcclxuICAgICAgICAgICAgICAgIG91dC5jbGFzc1RvRmlsbFN0eWxlKHNjYWxlKVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvL3doZW4gbWl4aW5nIE5VVFMsIGxldmVsIDAgaXMgc2VwYXJhdGVkIGZyb20gdGhlIHJlc3QgKHVzaW5nIGNsYXNzIG51dHNyZzApXHJcbiAgICAgICAgICAgIGlmIChvdXQubnV0c0xldmVsXyA9PSAnbWl4ZWQnKSB7XHJcbiAgICAgICAgICAgICAgICBtYXAuc3ZnX1xyXG4gICAgICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGguZW0tbnV0c3JnMCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2VjbDEnLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBvdXQuc3RhdERhdGEoJ3YyJykuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3YpIHJldHVyblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2ID0gc3YudmFsdWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh2ICE9IDAgJiYgIXYpIHx8IHYgPT0gJzonKSByZXR1cm4gJ25kJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gK291dC5jbGFzc2lmaWVyMV8oK3YpXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignZWNsMicsIGZ1bmN0aW9uIChyZykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzdiA9IG91dC5zdGF0RGF0YSgndjInKS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzdikgcmV0dXJuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHYgPSBzdi52YWx1ZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHYgIT0gMCAmJiAhdikgfHwgdiA9PSAnOicpIHJldHVybiAnbmQnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiArb3V0LmNsYXNzaWZpZXIyXygrdilcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8vQG92ZXJyaWRlXHJcbiAgICBvdXQudXB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fKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBseVN0eWxlVG9NYXAob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dW2ldW2NdKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXS5zdmdJZF8gIT09IG91dC5zdmdJZF8pIGFwcGx5U3R5bGVUb01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIHVuaXF1ZSBpbnNldCBnZW9fXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXS5zdmdJZF8gIT09IG91dC5zdmdJZF8pIGFwcGx5U3R5bGVUb01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb10pXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIGFwcGx5IHRvIG1haW4gbWFwXHJcbiAgICAgICAgYXBwbHlTdHlsZVRvTWFwKG91dClcclxuXHJcbiAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgfVxyXG5cclxuICAgIGZ1bmN0aW9uIGFwcGx5U3R5bGVUb01hcChtYXApIHtcclxuICAgICAgICAvL2FwcGx5IHN0eWxlIHRvIG51dHMgcmVnaW9uc1xyXG5cclxuICAgICAgICAvLyBzZXQgY29sb3VyIG9mIHJlZ2lvbnNcclxuICAgICAgICBpZiAobWFwLnN2ZygpKSB7XHJcbiAgICAgICAgICAgIGxldCBzZWxlY3RvciA9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XQubm9EYXRhRmlsbFN0eWxlKCkgfHwgJ2dyYXknXHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbG9yID0gb3V0LmNsYXNzVG9GaWxsU3R5bGUoKSgrZWNsMSwgK2VjbDIpXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbG9yXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIGdldENTU1Byb3BlcnR5RnJvbUNsYXNzKCdlbS1udXRzcmcnLCAnZmlsbCcpXHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLmVuZCgpXHJcbiAgICAgICAgICAgICAgICAudGhlbihcclxuICAgICAgICAgICAgICAgICAgICAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN0b3JlIHRoZSBvcmlnaW5hbCBjb2xvciBmb3IgZWFjaCByZWdpb25cclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVnaW9ucy5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsLmF0dHIoJ2ZpbGxfX18nLCBzZWwuc3R5bGUoJ2ZpbGwnKSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lvbnNcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKGUsIHJnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2VsID0gc2VsZWN0KHRoaXMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsLnN0eWxlKCdmaWxsJywgbWFwLmhvdmVyQ29sb3JfKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQuX3Rvb2x0aXApIG91dC5fdG9vbHRpcC5tb3VzZW92ZXIob3V0LnRvb2x0aXBfLnRleHRGdW5jdGlvbihyZywgb3V0KSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGZ1bmN0aW9uIChlLCByZykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQuX3Rvb2x0aXApIG91dC5fdG9vbHRpcC5tb3VzZW1vdmUoZSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdGaWxsID0gc2VsLmF0dHIoJ2ZpbGxfX18nKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdGaWxsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbC5zdHlsZSgnZmlsbCcsIHNlbC5hdHRyKCdmaWxsX19fJykpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXAuX3Rvb2x0aXApIG1hcC5fdG9vbHRpcC5tb3VzZW91dCgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIChlcnIpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVqZWN0aW9uXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgKVxyXG5cclxuICAgICAgICAgICAgaWYgKG91dC5udXRzTGV2ZWxfID09ICdtaXhlZCcpIHtcclxuICAgICAgICAgICAgICAgIHN0eWxlTWl4ZWROVVRTKG1hcClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvL0BvdmVycmlkZVxyXG4gICAgb3V0LmdldExlZ2VuZENvbnN0cnVjdG9yID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIHJldHVybiBCaXZhcmlhdGVMZWdlbmQubGVnZW5kXHJcbiAgICB9XHJcblxyXG4gICAgcmV0dXJuIG91dFxyXG59XHJcblxyXG5jb25zdCBzdHlsZU1peGVkTlVUUyA9IGZ1bmN0aW9uIChtYXApIHtcclxuICAgIG1hcC5zdmcoKVxyXG4gICAgICAgIC5zZWxlY3RBbGwoJyNlbS1udXRzcmcgcGF0aCcpXHJcbiAgICAgICAgLnN0eWxlKCdkaXNwbGF5JywgZnVuY3Rpb24gKHJnKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICBjb25zdCBlY2wgPSBzZWwuYXR0cignZWNsJylcclxuICAgICAgICAgICAgY29uc3QgbHZsID0gc2VsLmF0dHIoJ2x2bCcpXHJcbiAgICAgICAgICAgIGNvbnN0IGNvdW50cnlJZCA9IHJnLnByb3BlcnRpZXMuaWQuc2xpY2UoMCwgMilcclxuICAgICAgICAgICAgcmV0dXJuIGVjbCB8fCBsdmwgPT09ICcwJyA/ICdibG9jaycgOiAnbm9uZSdcclxuICAgICAgICB9KVxyXG4gICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgY29uc3QgbHZsID0gc2VsLmF0dHIoJ2x2bCcpXHJcbiAgICAgICAgICAgIGNvbnN0IGVjbCA9IHNlbC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G4gICAgICAgICAgICBzd2l0Y2ggKG91dC5jbGFzc2lmaWNhdGlvbk1ldGhvZF8pIHtcclxuICAgICAgICAgICAgICAgIGNhc2UgJ3F1YW50aWxlJzoge1xyXG4gICAgICAgICAgICAgICAgICAgIG91dC5jbGFzc2lmaWVyKHNjYWxlUXVhbnRpbGUoKS5kb21haW4oZGF0YUFycmF5KS5yYW5nZShyYW5nZSkpXHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNhc2UgJ2VxdWFsLWludGVydmFsJzpcclxuICAgICAgICAgICAgICAgIGNhc2UgJ2VxdWludGVyJzoge1xyXG4gICAgICAgICAgICAgICAgICAgIG91dC5jbGFzc2lmaWVyKFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzY2FsZVF1YW50aXplKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kb21haW4oW21pbihkYXRhQXJyYXkpLCBtYXgoZGF0YUFycmF5KV0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAucmFuZ2UocmFuZ2UpXHJcbiAgICAgICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQubWFrZUNsYXNzaWZOaWNlXykgb3V0LmNsYXNzaWZpZXIoKS5uaWNlKClcclxuICAgICAgICAgICAgICAgICAgICBicmVha1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY2FzZSAndGhyZXNob2xkJzoge1xyXG4gICAgICAgICAgICAgICAgICAgIG91dC5udW1iZXJPZkNsYXNzZXMob3V0LnRocmVzaG9sZHNfLmxlbmd0aCArIDEpXHJcbiAgICAgICAgICAgICAgICAgICAgb3V0LmNsYXNzaWZpZXIoc2NhbGVUaHJlc2hvbGQoKS5kb21haW4ob3V0LnRocmVzaG9sZHNfKS5yYW5nZShnZW5lcmF0ZVJhbmdlKG91dC5udW1iZXJPZkNsYXNzZXNfKSkpXHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNhc2UgJ2plbmtzJzoge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGplbmtzQnJlYWtzID0gamVua3MoZGF0YUFycmF5LCBvdXQubnVtYmVyT2ZDbGFzc2VzXykgLy8gQ2FsY3VsYXRlIGJyZWFrcyBmb3IgSmVua3NcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBkb21haW4gPSBqZW5rc0JyZWFrcy5zbGljZSgxLCAtMSlcclxuICAgICAgICAgICAgICAgICAgICBvdXQuY2xhc3NpZmllcihzY2FsZVRocmVzaG9sZCgpLmRvbWFpbihkb21haW4pLnJhbmdlKHJhbmdlKSkgLy8gVXNlIEplbmtzIGJyZWFrcyBpbiBzY2FsZVxyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjYXNlICdja21lYW5zJzoge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIENhbGN1bGF0ZSBja21lYW5zIGJyZWFrcywgZXh0cmFjdGluZyB0aGUgbWF4aW11bSB2YWx1ZSBmcm9tIGVhY2ggY2x1c3RlclxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNrbWVhbnNCcmVha3MgPSBja21lYW5zKGRhdGFBcnJheSwgb3V0Lm51bWJlck9mQ2xhc3Nlc18pLm1hcCgoY2x1c3RlcikgPT4gY2x1c3Rlci5wb3AoKSlcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gU2V0IHRoZSBkb21haW4gZm9yIHNjYWxlVGhyZXNob2xkIGV4Y2x1ZGluZyB0aGUgbGFzdCB2YWx1ZSwgYXMgaXQgc2VydmVzIGFzIHRoZSB1cHBlciBib3VuZFxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGRvbWFpbiA9IGNrbWVhbnNCcmVha3Muc2xpY2UoMCwgLTEpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC8vIFVzZSB0aGUgY2ttZWFucyBicmVha3MgaW4gdGhlIHNjYWxlVGhyZXNob2xkIGFuZCBzZXQgdGhlIGNsYXNzaWZpZXJcclxuICAgICAgICAgICAgICAgICAgICBvdXQuY2xhc3NpZmllcihzY2FsZVRocmVzaG9sZCgpLmRvbWFpbihkb21haW4pLnJhbmdlKHJhbmdlKSlcclxuICAgICAgICAgICAgICAgICAgICBicmVha1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBBcHBseSBjbGFzc2lmaWVyIGFuZCBzZXQgJ2VjbCcgYXR0cmlidXRlIHRvIHJlZ2lvbnMgYmFzZWQgb24gdmFsdWVcclxuICAgICAgICBjb25zdCBjbGFzc2lmeVJlZ2lvbnMgPSAocmVnaW9ucykgPT4ge1xyXG4gICAgICAgICAgICByZWdpb25zLmF0dHIoJ2VjbCcsIChyZykgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcmVnaW9uRGF0YSA9IG91dC5zdGF0RGF0YSgpLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgaWYgKCFyZWdpb25EYXRhKSByZXR1cm4gLy8gTGFjayBvZiBkYXRhIGlzIGhhbmRsZWQgZXhwbGljaXRseVxyXG4gICAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSByZWdpb25EYXRhLnZhbHVlXHJcbiAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09ICc6JyB8fCB2YWx1ZSA9PT0gbnVsbCkgcmV0dXJuICduZCdcclxuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZSAhPSBudWxsID8gK291dC5jbGFzc2lmaWVyXyh2YWx1ZSkgOiB1bmRlZmluZWRcclxuICAgICAgICAgICAgfSlcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIEluaXRpYW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ZW0tbnV0c3JnIHBhdGgnXHJcbiAgICAgICAgICAgIGlmIChtYXAuR2VvbWV0cmllcy51c2VyR2VvbWV0cmllcykgc2VsZWN0b3IgPSAnI2VtLXVzZXItcmVnaW9ucyBwYXRoJyAvLyBmb3IgdXNlci1kZWZpbmVkIGdlb21ldHJpZXNcclxuICAgICAgICAgICAgY29uc3QgcmVnaW9ucyA9IG1hcC5zdmcoKS5zZWxlY3RBbGwoc2VsZWN0b3IpXHJcblxyXG4gICAgICAgICAgICAvLyBBcHBseSB0cmFuc2l0aW9uIGFuZCBzZXQgaW5pdGlhbCBmaWxsIGNvbG9ycyB3aXRoIGRhdGEtZHJpdmVuIGxvZ2ljXHJcbiAgICAgICAgICAgIHJlZ2lvbnNcclxuICAgICAgICAgICAgICAgIC50cmFuc2l0aW9uKClcclxuICAgICAgICAgICAgICAgIC5kdXJhdGlvbihvdXQudHJhbnNpdGlvbkR1cmF0aW9uKCkpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCByZWdpb25zRmlsbEZ1bmN0aW9uKVxyXG4gICAgICAgICAgICAgICAgLmVuZCgpXHJcbiAgICAgICAgICAgICAgICAudGhlbigoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gU3RvcmUgdGhlIG9yaWdpbmFsIGNvbG9yIGZvciBlYWNoIHJlZ2lvblxyXG4gICAgICAgICAgICAgICAgICAgIHJlZ2lvbnMuZWFjaChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzZWwuYXR0cignZmlsbF9fXycsIHNlbC5zdHlsZSgnZmlsbCcpKVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gU2V0IHVwIG1vdXNlIGV2ZW50c1xyXG4gICAgICAgICAgICAgICAgICAgIGFkZE1vdXNlRXZlbnRzVG9SZWdpb25zKG1hcCwgcmVnaW9ucylcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuY2F0Y2goKGVycikgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vY29uc29sZS5lcnJvcignRXJyb3IgYXBwbHlpbmcgdHJhbnNpdGlvbiB0byByZWdpb25zOicsIGVycilcclxuICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAvLyBBcHBseSBhZGRpdGlvbmFsIHNldHRpbmdzIGZvciBtaXhlZCBOVVRTIGxldmVsIHZpZXdcclxuICAgICAgICAgICAgaWYgKG91dC5udXRzTGV2ZWxfID09PSAnbWl4ZWQnKSB7XHJcbiAgICAgICAgICAgICAgICBzdHlsZU1peGVkTlVUUyhtYXApXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vIFVwZGF0ZSBsYWJlbHMgZm9yIHN0YXRpc3RpY2FsIHZhbHVlcyBpZiByZXF1aXJlZFxyXG4gICAgICAgICAgICBpZiAob3V0LmxhYmVsc18/LnZhbHVlcykge1xyXG4gICAgICAgICAgICAgICAgb3V0LnVwZGF0ZVZhbHVlc0xhYmVscyhtYXApXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLy9Ab3ZlcnJpZGVcclxuICAgIG91dC5nZXRMZWdlbmRDb25zdHJ1Y3RvciA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICByZXR1cm4gQ2hvcm9wbGV0aExlZ2VuZC5sZWdlbmRcclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBzdHlsZU1peGVkTlVUUyA9IGZ1bmN0aW9uIChtYXApIHtcclxuICAgICAgICBtYXAuc3ZnKClcclxuICAgICAgICAgICAgLnNlbGVjdEFsbCgnI2VtLW51dHNyZyBwYXRoJylcclxuICAgICAgICAgICAgLnN0eWxlKCdkaXNwbGF5JywgZnVuY3Rpb24gKHJnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgIGNvbnN0IGVjbCA9IHNlbC5hdHRyKCdlY2wnKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgbHZsID0gc2VsLmF0dHIoJ2x2bCcpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBjb3VudHJ5SWQgPSByZy5wcm9wZXJ0aWVzLmlkLnNsaWNlKDAsIDIpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZWNsIHx8IGx2bCA9PT0gJzAnID8gJ2Jsb2NrJyA6ICdub25lJ1xyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgbHZsID0gc2VsLmF0dHIoJ2x2bCcpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBlY2wgPSBzZWwuYXR0cignZWNsJylcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN0cm9rZSA9IHNlbC5zdHlsZSgnc3Ryb2tlJylcclxuICAgICAgICAgICAgICAgIHJldHVybiBlY2wgJiYgbHZsICE9PSAnMCcgPyBzdHJva2UgfHwgJyM3NzcnIDogbnVsbFxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS13aWR0aCcsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgbHZsID0gc2VsLmF0dHIoJ2x2bCcpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBlY2wgPSBzZWwuYXR0cignZWNsJylcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN0cm9rZVdpZHRoID0gc2VsLnN0eWx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hdGEoKVxyXG4gICAgY29uc3Qgc3YgPSBzdGF0RGF0YS5nZXQocmVnaW9uSWQpXHJcbiAgICBjb25zdCB1bml0ID0gc3RhdERhdGEudW5pdFRleHQoKSB8fCAnJ1xyXG5cclxuICAgIC8vIE5vIGRhdGEgY2FzZVxyXG4gICAgaWYgKCFzdiB8fCAoc3YudmFsdWUgIT09IDAgJiYgIXN2LnZhbHVlKSB8fCBzdi52YWx1ZSA9PT0gJzonKSB7XHJcbiAgICAgICAgYnVmLnB1c2goYFxyXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZXN0YXQtdmlzLXRvb2x0aXAtdGV4dCBuby1kYXRhXCI+XHJcbiAgICAgICAgICAgICAgICA8dGFibGUgY2xhc3M9XCJudXRzLXRhYmxlXCI+XHJcbiAgICAgICAgICAgICAgICAgICAgPHRib2R5PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8dHI+PHRkPiR7bWFwLm5vRGF0YVRleHRffTwvdGQ+PC90cj5cclxuICAgICAgICAgICAgICAgICAgICA8L3Rib2R5PlxyXG4gICAgICAgICAgICAgICAgPC90YWJsZT5cclxuICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgYClcclxuICAgICAgICByZXR1cm4gYnVmLmpvaW4oJycpXHJcbiAgICB9XHJcblxyXG4gICAgLy8gRGF0YSBkaXNwbGF5XHJcbiAgICBidWYucHVzaChgXHJcbiAgICAgICAgPGRpdiBjbGFzcz1cImVzdGF0LXZpcy10b29sdGlwLXRleHRcIj5cclxuICAgICAgICAgICAgPHRhYmxlIGNsYXNzPVwibnV0cy10YWJsZVwiPlxyXG4gICAgICAgICAgICAgICAgPHRib2R5PlxyXG4gICAgICAgICAgICAgICAgICAgIDx0cj48dGQ+JHtzcGFjZUFzVGhvdXNhbmRTZXBhcmF0b3Ioc3YudmFsdWUpfSAke3VuaXR9PC90ZD48L3RyPlxyXG4gICAgICAgICAgICAgICAgPC90Ym9keT5cclxuICAgICAgICAgICAgPC90YWJsZ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ICAgICAgICAgICAgICBpZiAobm9kZS5pZCA9PSBmZWF0dXJlLnByb3BlcnRpZXMuaWQpIHJldHVybiBmZWF0dXJlXHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgIGlmIChvdmVybGF5KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlzSW1wb3J0ZXIgPSBncmFwaC5saW5rcy5zb21lKChsaW5rKSA9PiBsaW5rLnNvdXJjZSA9PSBub2RlLmlkKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc0ltcG9ydGVyKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGltcG9ydGVySWRzLnB1c2gobm9kZS5pZClcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBleHBvcnRlcklkcy5wdXNoKG5vZGUuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKCdjb3VsZCBub3QgZmluZCBnZW9tZXRyeSBmb3InLCBub2RlLmlkKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgLy91cGRhdGUgZXhpc3RpbmcgcmVnaW9uIGZpbGxzXHJcbiAgICAgICAgICAgIGxldCBzZWxlY3RvciA9IG91dC5nZW9fID09PSAnV09STEQnID8gJyNlbS13b3JsZHJnIHBhdGgnIDogJyNlbS1udXRzcmcgcGF0aCdcclxuICAgICAgICAgICAgaWYgKG91dC5HZW9tZXRyaWVzLnVzZXJHZW9tZXRyaWVzKSBzZWxlY3RvciA9ICcjZW0tdXNlci1yZWdpb25zIHBhdGgnIC8vIGZvciB1c2VyLWRlZmluZWQgZ2VvbWV0cmllc1xyXG4gICAgICAgICAgICBjb25zdCBhbGxSZWdpb25zID0gb3V0LnN2Z18uc2VsZWN0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gICAgICAgICAgICAgICAuYXR0cignZCcsIHNhbmtleUxpbmtIb3Jpem9udGFsKCkobGluaykpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZmlsbCcsICdub25lJylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdzdHJva2UnLCBgdXJsKCMke2dyYWRpZW50SWRzW2ldfSlgKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZS13aWR0aCcsIGxpbmsud2lkdGgpXHJcbiAgICAgICAgICAgICAgICAuYXR0cignbWFya2VyLWVuZCcsIGB1cmwoIyR7YXJyb3dJZH0pYClcclxuICAgICAgICB9KVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogQWRkcyByZWN0YW5nbGVzIHRvIGZpbGwgZ2FwcyBsZWZ0IGJ5IFNhbmtleSBsaW5rc1xyXG4gICAgICogQHBhcmFtIHtPYmplY3R9IHN2ZyAtIEQzIHNlbGVjdGlvbiBvZiBTVkdcclxuICAgICAqIEBwYXJhbSB7QXJyYXl9IG5vZGVzIC0gU2Fua2V5IG5vZGVzIGRhdGFcclxuICAgICAqL1xyXG4gICAgZnVuY3Rpb24gYWRkRmlsbEdhcHMoc3ZnLCBub2Rlcykge1xyXG4gICAgICAgIHN2Zy5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZmlsbC1pbi1nYXBzJylcclxuICAgICAgICAgICAgLnNlbGVjdEFsbCgncmVjdCcpXHJcbiAgICAgICAgICAgIC5kYXRhKG5vZGVzKVxyXG4gICAgICAgICAgICAuam9pbigncmVjdCcpXHJcbiAgICAgICAgICAgIC5maWx0ZXIoKGQpID0+IGQuZGVwdGggJiYgZC5oZWlnaHQpXHJcbiAgICAgICAgICAgIC5hdHRyKCd4JywgKGQpID0+IGQueDAgLSAwLjUpXHJcbiAgICAgICAgICAgIC5hdHRyKCd5JywgKGQpID0+IGQueTApXHJcbiAgICAgICAgICAgIC5hdHRyKCd3aWR0aC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JnZXQgPSBsaW5rLnRhcmdldCA9IGZpbmQobm9kZUJ5SWQsIHRhcmdldClcclxuICAgICAgICAgICAgc291cmNlLnNvdXJjZUxpbmtzLnB1c2gobGluaylcclxuICAgICAgICAgICAgdGFyZ2V0LnRhcmdldExpbmtzLnB1c2gobGluaylcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gaWYgKGxpbmtTb3J0ICE9IG51bGwpIHtcclxuICAgICAgICAvLyAgICAgZm9yIChjb25zdCB7IHNvdXJjZUxpbmtzLCB0YXJnZXRMaW5rcyB9IG9mIG5vZGVzKSB7XHJcbiAgICAgICAgLy8gICAgICAgICBzb3VyY2VMaW5rcy5zb3J0KGxpbmtTb3J0KVxyXG4gICAgICAgIC8vICAgICAgICAgdGFyZ2V0TGlua3Muc29ydChsaW5rU29ydClcclxuICAgICAgICAvLyAgICAgfVxyXG4gICAgICAgIC8vIH1cclxuICAgIH1cclxuXHJcbiAgICBmdW5jdGlvbiBmaW5kKG5vZGVCeUlkLCBpZCkge1xyXG4gICAgICAgIGNvbnN0IG5vZGUgPSBub2RlQnlJZC5nZXQoaWQpXHJcbiAgICAgICAgaWYgKCFub2RlKSB0aHJvdyBuZXcgRXJyb3IoJ21pc3Npbmc6ICcgKyBpZClcclxuICAgICAgICByZXR1cm4gbm9kZVxyXG4gICAgfVxyXG5cclxuICAgIGZ1bmN0aW9uIGNvbXB1dGVOb2RlRGVwdGhzKHsgbm9kZXMgfSkge1xyXG4gICAgICAgIGNvbnN0IG4gPSBub2Rlcy5sZW5ndGhcclxuICAgICAgICBsZXQgY3VycmVudCA9IG5ldyBTZXQobm9kZXMpXHJcbiAgICAgICAgbGV0IG5leHQgPSBuZXcgU2V0KClcclxuICAgICAgICBsZXQgeCA9IDBcclxuICAgICAgICB3aGlsZSAoY3VycmVudC5zaXplKSB7XHJcbiAgICAgICAgICAgIGZvciAoY29uc3Qgbm9kZSBvZiBjdXJyZW50KSB7XHJcbiAgICAgICAgICAgICAgICBub2RlLmRlcHRoID0geFxyXG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCB7IHRhcmdldCB9IG9mIG5vZGUuc291cmNlTGlua3MpIHtcclxuICAgICAgICAgICAgICAgICAgICBuZXh0LmFkZCh0YXJnZXQpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKCsreCA+IG4pIHRocm93IG5ldyBFcnJvcignY2lyY3VsYXIgbGluaycpXHJcbiAgICAgICAgICAgIGN1cnJlbnQgPSBuZXh0XHJcbiAgICAgICAgICAgIG5leHQgPSBuZXcgU2V0KClcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgZnVuY3Rpb24gY29tcHV0ZU5vZGVIZWlnaHRzKHsgbm9kZXMgfSkge1xyXG4gICAgICAgIGNvbnN0IG4gPSBub2Rlcy5sZW5ndGhcclxuICAgICAgICBsZXQgY3VycmVudCA9IG5ldyBTZXQobm9kZXMpXHJcbiAgICAgICAgbGV0IG5leHQgPSBuZXcgU2V0KClcclxuICAgICAgICBsZXQgeCA9IDBcclxuICAgICAgICB3aGlsZSAoY3VycmVudC5zaXplKSB7XHJcbiAgICAgICAgICAgIGZvciAoY29uc3Qgbm9kZSBvZiBjdXJyZW50KSB7XHJcbiAgICAgICAgICAgICAgICBub2RlLmhlaWdodCA9IHhcclxuICAgICAgICAgICAgICAgIGZvciAoY29uc3QgeyBzb3VyY2UgfSBvZiBub2RlLnRhcmdldExpbmtzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV4dC5hZGQoc291cmNlKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmICgrK3ggPiBuKSB0aHJvdyBuZXcgRXJyb3IoJ2NpcmN1bGFyIGxpbmsnKVxyXG4gICAgICAgICAgICBjdXJyZW50ID0gbmV4dFxyXG4gICAgICAgICAgICBuZXh0ID0gbmV3IFNldCgpXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGZ1bmN0aW9uIGNvbXB1dGVMaW5rQnJlYWR0aHMoeyBub2RlcyB9KSB7XHJcbiAgICAgICAgZm9yIChjb25zdCBub2RlIG9mIG5vZGVzKSB7XHJcbiAgICAgICAgICAgIGxldCB5MCA9IG5vZGUueTBcclxuICAgICAgICAgICAgbGV0IHkxID0geTBcclxuICAgICAgICAgICAgZm9yIChjb25zdCBsaW5rIG9mIG5vZGUuc291cmNlTGlua3MpIHtcclxuICAgICAgICAgICAgICAgIGxpbmsueTAgPSB5MCArIGxpbmsud2lkdGggLyAyXHJcbiAgICAgICAgICAgICAgICB5MCArPSBsaW5rLndpZHRoXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZm9yIChjb25zdCBsaW5rIG9mIG5vZGUudGFyZ2V0TGlua3MpIHtcclxuICAgICAgICAgICAgICAgIGxpbmsueTEgPSB5MSArIGxpbmsud2lkdGggLyAyXHJcbiAgICAgICAgICAgICAgICB5MSArPSBsaW5rLndpZHRoXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBmdW5jdGlvbiBob3Jpem9udGFsU291cmNlKGQpIHtcclxuICAgICAgICByZXR1cm4gW2Quc291cmNlLngxLCBkLnkwXVxyXG4gICAgfVxyXG5cclxuICAgIGZ1bmN0aW9uIGhvcml6b250YWxUYXJnZXQoZCkge1xyXG4gICAgICAgIHJldHVybiBbZC50YXJnZXQueDAsIGQueTFdXHJcbiAgICB9XHJcblxyXG4gICAgZnVuY3Rpb24gY29tcHV0ZU5vZGVWYWx1ZXMoeyBub2RlcyB9KSB7XHJcbiAgICAgICAgZm9yIChjb25zdCBub2RlIG9mIG5vZGVzKSB7XHJcbiAgICAgICAgICAgIG5vZGUudmFsdWUgPSBNYXRoLm1heChcclxuICAgICAgICAgICAgICAgIHN1bShub2RlLnNvdXJjZUxpbmtzLCAoZCkgPT4gZC52YWx1ZSksXHJcbiAgICAgICAgICAgICAgICBzdW0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ICAncGllT3RoZXJDb2xvcl8nLFxyXG4gICAgICAgICdwaWVPdGhlclRleHRfJyxcclxuICAgICAgICAncGllU3Ryb2tlRmlsbF8nLFxyXG4gICAgICAgICdwaWVTdHJva2VXaWR0aF8nLFxyXG4gICAgXS5mb3JFYWNoKGZ1bmN0aW9uIChhdHQpIHtcclxuICAgICAgICBvdXRbYXR0LnN1YnN0cmluZygwLCBhdHQubGVuZ3RoIC0gMSldID0gZnVuY3Rpb24gKHYpIHtcclxuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gb3V0W2F0dF1cclxuICAgICAgICAgICAgb3V0W2F0dF0gPSB2XHJcbiAgICAgICAgICAgIHJldHVybiBvdXRcclxuICAgICAgICB9XHJcbiAgICB9KVxyXG5cclxuICAgIC8vb3ZlcnJpZGUgYXR0cmlidXRlIHZhbHVlcyB3aXRoIGNvbmZpZyB2YWx1ZXNcclxuICAgIGlmIChjb25maWcpXHJcbiAgICAgICAgW1xyXG4gICAgICAgICAgICAnY2F0Q29sb3JzJyxcclxuICAgICAgICAgICAgJ2NhdExhYmVscycsXHJcbiAgICAgICAgICAgICdzaG93T25seVdoZW5Db21wbGV0ZScsXHJcbiAgICAgICAgICAgICdub0RhdGFGaWxsU3R5bGUnLFxyXG4gICAgICAgICAgICAncGllTWF4UmFkaXVzJyxcclxuICAgICAgICAgICAgJ3BpZU1pblJhZGl1cycsXHJcbiAgICAgICAgICAgICdwaWVDaGFydElubmVyUmFkaXVzJyxcclxuICAgICAgICAgICAgJ3BpZU90aGVyQ29sb3InLFxyXG4gICAgICAgICAgICAncGllT3RoZXJUZXh0JyxcclxuICAgICAgICAgICAgJ3BpZVN0cm9rZUZpbGwnLFxyXG4gICAgICAgICAgICAncGllU3Ryb2tlV2lkdGgnLFxyXG4gICAgICAgIF0uZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XHJcbiAgICAgICAgICAgIGlmIChjb25maWdba2V5XSAhPSB1bmRlZmluZWQ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luZ30gdENvZGUgT3B0aW9uYWw6IFRoZSBjYXRlZ29yeSBjb2RlIG9mIHRoZSB0b3RhbCAodXNlZCB0byBjYWxjdWxhdGUgdG90YWwgJiBcIm90aGVyXCIgdmFsdWVzIGlmIGNvZGVzIGFycmF5IGRvbnQgcmVwcmVzZW50IGFsbCBwb3NzaWJsZSBjYXRlZ29yaWVzKVxyXG4gICAgICovXHJcbiAgICBvdXQuc3RhdFBpZSA9IGZ1bmN0aW9uIChzdGF0LCBkaW0sIGNvZGVzLCBsYWJlbHMsIGNvbG9ycywgdENvZGUpIHtcclxuICAgICAgICAvL2FkZCBvbmUgZGF0YXNldCAoc3RhdCkgY29uZmlnIGZvciBlYWNoIGNhdGVnb3J5IChjb2RlKVxyXG4gICAgICAgIHN0YXQuZmlsdGVycyA9IHN0YXQuZmlsdGVycyB8fCB7fVxyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY29kZXMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgLy9jYXRlZ29yeSBjb2RlXHJcbiAgICAgICAgICAgIGNvbnN0IGNvZGUgPSBjb2Rlc1tpXVxyXG4gICAgICAgICAgICBzdGF0LmZpbHRlcnNbZGltXSA9IGNvZGVcclxuICAgICAgICAgICAgY29uc3Qgc2NfID0ge31cclxuICAgICAgICAgICAgZm9yIChsZXQga2V5IGluIHN0YXQpIHtcclxuICAgICAgICAgICAgICAgIHNjX1trZXldID0gc3RhdFtrZXldXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgc2NfLmZpbHRlcnMgPSB7fVxyXG4gICAgICAgICAgICBmb3IgKGxldCBrZXkgaW4gc3RhdC5maWx0ZXJzKSB7XHJcbiAgICAgICAgICAgICAgICBzY18uZmlsdGVyc1trZXldID0gc3RhdC5maWx0ZXJzW2tleV1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBvdXQuc3RhdChjb2RlLCBzY18pXHJcblxyXG4gICAgICAgICAgICAvL2lmIHNwZWNpZmllZCwgcmV0cmlldmUgYW5kIGFzc2lnbiBjb2xvclxyXG4gICAgICAgICAgICBpZiAoY29sb3JzKSB7XHJcbiAgICAgICAgICAgICAgICBvdXQuY2F0Q29sb3JzXyA9IG91dC5jYXRDb2xvcnNfIHx8IHt9XHJcbiAgICAgICAgICAgICAgICBvdXQuY2F0Q29sb3JzX1tjb2RlXSA9IGNvbG9yc1tpXVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vaWYgc3BlY2lmaWVkLCByZXRyaWV2ZSBhbmQgYXNzaWduIGxhYmVsXHJcbiAgICAgICAgICAgIGlmIChsYWJlbHMpIHtcclxuICAgICAgICAgICAgICAgIG91dC5jYXRMYWJlbHNfID0gb3V0LmNhdExhYmVsc18gfHwge31cclxuICAgICAgICAgICAgICAgIG91dC5jYXRMYWJlbHNfW2NvZGVdID0gbGFiZWxzW2ldXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vc2V0IG91dC5zdGF0Q29kZXNfXHJcbiAgICAgICAgb3V0LnN0YXRDb2Rlc18gPSBjb2Rlc1xyXG5cclxuICAgICAgICAvL3NldCBvdXQudG90YWxDb2RlX1xyXG4gICAgICAgIGlmICh0Q29kZSkge1xyXG4gICAgICAgICAgICBvdXQudG90YWxDb2RlXyA9IHRDb2RlXHJcbiAgICAgICAgICAgIHN0YXQuZmlsdGVyc1tkaW1dID0gdENvZGVcclxuICAgICAgICAgICAgY29uc3Qgc2NfID0ge31cclxuICAgICAgICAgICAgZm9yIChsZXQga2V5IGluIHN0YXQpIHNjX1trZXldID0gc3RhdFtrZXldXHJcbiAgICAgICAgICAgIHNjXy5maWx0ZXJzID0ge31cclxuICAgICAgICAgICAgZm9yIChsZXQga2V5IGluIHN0YXQuZmlsdGVycykgc2NfLmZpbHRlcnNba2V5XSA9IHN0YXQuZmlsdGVyc1trZXldXHJcbiAgICAgICAgICAgIG91dC5zdGF0KHRDb2RlLCBzY18pXHJcblxyXG4gICAgICAgICAgICAvL3doZW4gdG90YWwgY29kZSBpcyB1c2VkLCBhbiAnb3RoZXInIHNlY3Rpb24gaXMgYWRkZWQgdG8gdGhlIHBpZVxyXG4gICAgICAgICAgICBvdXQuY2F0Q29sb3JzX1snb3RoZXInXSA9IG91dC5waWVPdGhlckNvbG9yX1xyXG4gICAgICAgICAgICBvdXQuY2F0TGFiZWxzX1snb3RoZXInXSA9IG91dC5waWVPdGhlclRleHRfXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICByZXR1cm4gb3V0XHJcbiAgICB9XHJcblxyXG4gICAgLy9Ab3ZlcnJpZGVcclxuICAgIG91dC51cGRhdGVDbGFzc2lmaWNhdGlvbiA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAvLyBhcHBseSBjbGFzc2lmaWNhdGlvbiB0byBhbGwgaW5zZXRzIHRoYXQgYXJlIG91dHNpZGUgb2YgdGhlIG1haW4gbWFwJ3MgU1ZHXHJcbiAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc18pIHtcclxuICAgICAgICAgICAgZm9yIChjb25zdCBnZW8gaW4gb3V0Lmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGluc2V0cyB3aXRoIHNhbWUgZ2VvIHRoYXQgZG8gbm90IHNoYXJlIHRoZSBzYW1lIHBhcmVudCBpbnNldFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0pKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGlzIHRoZSBjYXNlIHdoZW4gdGhlcmUgYXJlIG1vcmUgdGhhbiAyIGRpZmZlcmVudCBpbnNldHMgd2l0aCB0aGUgc2FtZSBnZW8uIEUuZy4gMyBpbnNldHMgZm9yIFBUMjBcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGMgPSAwOyBjIDwgb3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dW2ldLmxlbmd0aDsgYysrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXVtjXS5zdmdJZF8gIT09IG91dC5zdmdJZF8pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV1bY10pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dW2ldLnN2Z0lkXyAhPT0gb3V0LnN2Z0lkXylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBseUNsYXNzaWZpY2F0aW9uVG9NYXAob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dW2ldKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyB1bmlxdWUgaW5zZXQgZ2VvX1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb10uc3ZnSWRfICE9PSBvdXQuc3ZnSWRfKSBhcHBseUNsYXNzaWZpY2F0aW9u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AgbGV0IHN5bSA9IHMuc2VsZWN0QWxsKCdnLmVtLXN5bWJvbCcpXHJcbiAgICAgICAgICAgICAgICBzeW0uYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnZW0tcGllJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAocmcpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVnaW9uRmVhdHVyZXMucHVzaChyZylcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdwaWVfJyArIHJnLnByb3BlcnRpZXMuaWRcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgIC8vIHNldCByZWdpb24gaG92ZXIgZnVuY3Rpb25cclxuICAgICAgICAgICAgICAgIGxldCBzZWxlY3RvciA9IG91dC5nZW9fID09PSAnV09STEQnID8gJyNlbS13b3JsZHJnIHBhdGgnIDogJyNlbS1udXRzcmcgcGF0aCdcclxuICAgICAgICAgICAgICAgIGlmIChvdXQuR2VvbWV0cmllcy51c2VyR2VvbWV0cmllcykgc2VsZWN0b3IgPSAnI2VtLXVzZXItcmVnaW9ucyBwYXRoJyAvLyBmb3IgdXNlci1kZWZpbmVkIGdlb21ldHJpZXNcclxuICAgICAgICAgICAgICAgIGxldCByZWdpb25zID0gb3V0LnN2ZygpLnNlbGVjdEFsbChzZWxlY3RvcilcclxuICAgICAgICAgICAgICAgIHJlZ2lvbnNcclxuICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uIChlLCByZykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsLmF0dHIoJ2ZpbGxfX18nLCBzZWwuc3R5bGUoJ2ZpbGwnKSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsLnN0eWxlKCdmaWxsJywgb3V0LmhvdmVyQ29sb3JfKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2VvdmVyKG91dC50b29sdGlwXy50ZXh0RnVuY3Rpb24ocmcsIG91dCkpXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGZ1bmN0aW9uIChlLCByZykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2Vtb3ZlKGUpXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld0ZpbGwgPSBzZWwuYXR0cignZmlsbF9fXycpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdGaWxsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWwuc3R5bGUoJ2ZpbGwnLCBzZWwuYXR0cignZmlsbF9fXycpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5fdG9vbHRpcCkgb3V0Ll90b29sdGlwLm1vdXNlb3V0KClcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAgICAgYWRkUGllQ2hhcnRzVG9NYXAocmVnaW9uRmVhdHVyZXMpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogRnVuY3Rpb24gdG8gY29tcHV0ZSBjb21wb3NpdGlvbiBmb3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cclxuXHJcbiAgICAgICAgLy8gd2hlbiBvdXQudG90YWxDb2RlXyBpcyBzcGVjaWZpZWQsIHVzZSBpdCBhcyB0aGUgc3VtIGluc3RlYWQgb2YgdGhlIHN1bSBvZiB0aGUgc3BlY2lmaWVkIGNhdGVnb3JpZXMuXHJcbiAgICAgICAgaWYgKG91dC50b3RhbENvZGVfKSB7XHJcbiAgICAgICAgICAgIGxldCBzID0gb3V0LnN0YXREYXRhKG91dC50b3RhbENvZGVfKS5nZXQoaWQpXHJcbiAgICAgICAgICAgIGlmIChzKSB7XHJcbiAgICAgICAgICAgICAgICBzdW0gPSBzLnZhbHVlXHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBzdW0gPT0gMFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2Nhc2Ugd2hlbiBubyBkYXRhXHJcbiAgICAgICAgaWYgKHN1bSA9PSAwKSByZXR1cm4gdW5kZWZpbmVkXHJcblxyXG4gICAgICAgIC8vY29tcHV0ZSByYXRpb3NcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG91dC5zdGF0Q29kZXNfLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGNvbXBbb3V0LnN0YXRDb2Rlc19baV1dIC89IHN1bVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9hZGQgXCJvdGhlclwiIGNhdGVnb3J5IHdoZW4gb3V0LnRvdGFsQ29kZV8gaXMgdXNlZFxyXG4gICAgICAgIGlmIChvdXQudG90YWxDb2RlXykge1xyXG4gICAgICAgICAgICBsZXQgdG90YWxQZXJjID0gMFxyXG4gICAgICAgICAgICBmb3IgKGxldCBrZXkgaW4gY29tcCkge1xyXG4gICAgICAgICAgICAgICAgdG90YWxQZXJjID0gdG90YWxQZXJjICsgY29tcFtrZXldXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY29tcFsnb3RoZXInXSA9IDEgLSB0b3RhbFBlcmNcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiBjb21wXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBAZnVuY3Rpb24gZ2V0RGF0YXNldE1heE1pblxyXG4gICAgICogQGRlc2NyaXB0aW9uIGdldHMgdGhlIG1heGltdW0gYW5kIG1pbmltdW0gdG90YWwgb2YgYWxsIGRpbWVuc2lvbnMgY29tYmluZWQgZm9yIGVhY2ggcmVnaW9uLiBVc2VkIHRvIGRlZmluZSB0aGUgZG9tYWluIG9mIHRoZSBwaWUgc2l6ZSBzY2FsaW5nIGZ1bmN0aW9uLlxyXG4gICAgICogQHJldHVybnMgW21pbixtYXhdXHJcbiAgICAgKi9cclxuICAgIGZ1bmN0aW9uIGdldERhdGFzZXRNYXhNaW4oKSB7XHJcbiAgICAgICAgbGV0IHRvdGFscyA9IFtdXHJcbiAgICAgICAgbGV0IHNlbCA9IG91dC5zdmcoKS5zZWxlY3RBbGwoJyNnX3BzJykuc2VsZWN0QWxsKCdnLmVtLXN5bWJvbCcpLmRhdGEoKVxyXG5cclxuICAgICAgICBzZWwuZm9yRWFjaCgocmcpID0+IHtcclxuICAgICAgICAgICAgbGV0IGlkID0gcmcucHJvcGVydGllcy5pZFxyXG4gICAgICAgICAgICBsZXQgdG90YWwgPSBnZXRSZWdpb25Ub3RhbChpZClcclxuICAgICAgICAgICAgaWYgKHRvdGFsKSB7XHJcbiAgICAgICAgICAgICAgICB0b3RhbHMucHVzaCh0b3RhbClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pXHJcblxyXG4gICAgICAgIGxldCBtaW5tYXggPSBleHRlbnQodG90YWxzKVxyXG4gICAgICAgIHJldHVybiBtaW5tYXhcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEdldCBhYnNvbHV0ZSB0b3RhbCB2YWx1ZSBvZiBjb21iaW5lZCBzdGF0aXN0aWNhbCB2YWx1ZXMgZm9yIGEgc3BlY2lmaWMgcmVnaW9uLiBFLmcgdG90YWwgbGl2ZXN0b2NrXHJcbiAgICAgKiBAcGFyYW0geyp9IGlkIG51dHMgcmVnaW9uIGlkXHJcbiAgICAgKi9cclxuICAgIGNvbnN0IGdldFJlZ2lvblRvdGFsID0gZnVuY3Rpb24gKGlkKSB7XHJcbiAgICAgICAgbGV0IHN1bSA9IDBcclxuICAgICAgICBsZXQgc1xyXG4gICAgICAgIGlmIChvdXQudG90YWxDb2RlXykge1xyXG4gICAgICAgICAgICAvL3doZW4gdG90YWwgaXMgYSBzdGF0IGNvZGVcclxuICAgICAgICAgICAgcyA9IG91dC5zdGF0RGF0YShvdXQudG90YWxDb2RlXykuZ2V0KGlkKVxyXG4gICAgICAgICAgICAvL2Nhc2Ugd2hlbiBzb21lIGRhdGEgaXMgbWlzc2luZ1xyXG4gICAgICAgICAgICBpZiAoIXMgfHwgKHMudmFsdWUgIT0gMCAmJiAhcy52YWx1ZSkgfHwgaXNOYU4ocy52YWx1ZSkpIHtcclxuICAgICAgICAgICAgICAgIGlmIChvdXQuc2hvd09ubHlXaGVuQ29tcGxldGUoKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN1bSA9IHVuZGVmaW5lZFxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgc3VtID0gcy52YWx1ZVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgLy9nZXQgc3RhdCB2YWx1ZSBmb3IgZWFjaCBjYXRlZ29yeS4gQ29tcHV0ZSB0aGUgc3VtLlxyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG91dC5zdGF0Q29kZXNfLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICAvL3JldHJpZXZlIGNvZGUgYW5kIHN0YXQgdmFsdWVcclxuICAgICAgICAgICAgICAgIGNvbnN0IHNjID0gb3V0LnN0YXRDb2Rlc19baV1cclxuICAgICAgICAgICAgICAgIHMgPSBvdXQuc3RhdERhdGEoc2MpLmdldChpZClcclxuICAgICAgICAgICAgICAgIC8vY2FzZSB3aGVuIHNvbWUgZGF0YSBpcyBtaXNzaW5nXHJcbiAgICAgICAgICAgICAgICBpZiAoIXMgfHwgKHMudmFsdWUgIT0gMCAmJiAhcy52YWx1ZSkgfHwgaXNOYU4ocy52YWx1ZSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0LnNob3dPbmx5V2hlbkNvbXBsZXRlKCkpIHJldHVybiB1bmRlZmluZWRcclxuICAgICAgICAgICAgICAgICAgICBlbHNlIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBzdW0gKz0gcy52YWx1ZVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvL2Nhc2Ugd2hlbiBubyBkYXRhXHJcbiAgICAgICAgaWYgKHN1bSA9PSAwKSByZXR1cm4gdW5kZWZpbmVkXHJcbiAgICAgICAgcmV0dXJuIHN1bVxyXG4gICAgfVxyXG5cclxuICAgIGZ1bmN0aW9uIGFkZFBpZUNoYXJ0c1RvTWFwKHJlZ2lvbkZlYXR1cmVzKSB7XHJcbiAgICAgICAgcmVnaW9uRmVhdHVyZXMuZm9yRWFjaCgocmVnaW9uKSA9PiB7XHJcbiAgICAgICAgICAgIGNvbnN0IHJlZ2lvbklkID0gcmVnaW9uLnByb3BlcnRpZXMuaWRcclxuICAgICAgICAgICAgLy9wcmVwYXJlIGRhdGEgZm9yIHBpZSBjaGFydFxyXG4gICAgICAgICAgICBjb25zdCBkYXRhID0gW11cclxuICAgICAgICAgICAgY29uc3QgY29tcCA9IGdldENvbXBvc2l0aW9uKHJlZ2lvbklkKVxyXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiBjb21wKSBkYXRhLnB1c2goeyBjb2RlOiBrZXksIHZhbHVlOiBjb21wW2tleV0gfSlcclxuXHJcbiAgICAgICAgICAgIC8vY2FzZSBvZiByZWdpb25zIHdpdGggbm8gZGF0YVxyXG4gICAgICAgICAgICBpZiAoIWRhdGEgfHwgZGF0YS5sZW5ndGggPT0gMCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vY3JlYXRlIHN2ZyBmb3IgcGllIGNoYXJ0XHJcbiAgICAgICAgICAgIC8vIGNhbiBiZSBtb3JlIHRoYW4gb25lIGNlbnRlciBwb2ludCBmb3IgZWFjaCBudXRzIElEIChlLmcuIE1hbHRhIHdoZW4gaW5jbHVkZWQgaW4gaW5zZXRzKVxyXG4gICAgICAgICAgICBsZXQgbm9kZXMgPSBvdXQuc3ZnKCkuc2VsZWN0QWxsKCcjcGllXycgKyByZWdpb25JZClcclxuXHJcbiAgICAgICAgICAgIC8vIGRlZmluZSByYWRpdXNcclxuICAgICAgICAgICAgY29uc3QgciA9IG91dC5zaXplQ2xhc3NpZmllcl8oZ2V0UmVnaW9uVG90YWwocmVnaW9uSWQpKVxyXG4gICAgICAgICAgICBjb25zdCBpciA9IG91dC5waWVDaGFydElubmVyUmFkaXVzX1xyXG5cclxuICAgICAgICAgICAgLy9tYWtlIHBpZSBjaGFydC4gU2VlIGh0dHBzOi8vb2JzZXJ2YWJsZWhxLmNvbS9AZDMvcGllLWNoYXJ0XHJcbiAgICAgICAgICAgIGNvbnN0IHBpZV8gPSBwaWUoKVxyXG4gICAgICAgICAgICAgICAgLnNvcnQobnVsbClcclxuICAgICAgICAgICAgICAgIC52YWx1ZSgoZCkgPT4gZC52YWx1ZSlcclxuICAgICAgICAgICAgbm9kZXNcclxuICAgICAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZScsIG91dC5waWVTdHJva2VGaWxsXylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdzdHJva2Utd2lkdGgnLCBvdXQucGllU3Ryb2tlV2lkdGhfICsgJ3B4JylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdwaWVjaGFydCcpXHJcbiAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdwYXRoJylcclxuICAgICAgICAgICAgICAgIC5kYXRhKHBpZV8oZGF0YSkpXHJcbiAgICAgICAgICAgICAgICAuam9pbigncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCAoZCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvdXQuY2F0Q29sb3JzX1tkLmRhdGEuY29kZV0gfHwgJ2xpZ2h0Z3JheSdcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignZmlsbF9fXycsIChkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG91dC5jYXRDb2xvcnNfW2QuZGF0YS5jb2RlXSB8fCAnbGlnaHRncmF5J1xyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdjb2RlJywgKGQpID0+IGQuZGF0YS5jb2RlKSAvL2ZvciBtb3VzZW92ZXIgbGVnZW5kIGhpZ2hsaWdodGluZyBmdW5jdGlvblxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2QnLCBhcmMoKS5pbm5lclJhZGl1cyhpcikub3V0ZXJSYWRpdXMocikpXHJcbiAgICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uIChlLCByZykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgICAgIC8vIEFwcGx5IGEgdGhpY2sgc3Ryb2tlIHdpZHRoIHRvIHRoZSBwYXJlbnQgZWxlbWVudFxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhcmVudCA9IHNlbGVjdChzZWwubm9kZSgpLnBhcmVudE5vZGUpXHJcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50LnN0eWxlKCdzdHJva2Utd2lkdGgnLCAnMnB4Jykuc3R5bGUoJ3N0cm9rZScsICdibGFjaycpIC8vIFNldCBzdHJva2VcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2VvdmVyKG91dC50b29sdGlwXy50ZXh0RnVuY3Rpb24ocmVnaW9uLCBvdXQpKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2Vtb3ZlJywgZnVuY3Rpb24gKGUsIHJnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5fdG9vbHRpcCkgb3V0Ll90b29sdGlwLm1vdXNlbW92ZShlKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2VsID0gc2VsZWN0KHRoaXMpXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gUmVzZXQgc3Ryb2tlXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGFyZW50ID0gc2VsZWN0KHNlbC5ub2RlKCkucGFyZW50Tm9kZSlcclxuICAgICAgICAgICAgICAgICAgICBwYXJlbnQuc3R5bGUoJ3N0cm9rZS13aWR0aCcsIG91dC5waWVTdHJva2VXaWR0aF8pLnN0eWxlKCdzdHJva2UnLCBvdXQucGllU3Ryb2tlRmlsbF8pIC8vIFNldCBzdHJva2VcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2VvdXQoKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICB9KVxyXG4gICAgfVxyXG5cclxuICAgIC8vQG92ZXJyaWR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WRpdXMgKiAwLjkpXHJcbiAgICAgICAgICAgIC5vdXRlclJhZGl1cyhyYWRpdXMgKiAwLjkpXHJcblxyXG4gICAgICAgIGNvbnN0IHBpZURhdGEgPSBwaWVfKGRhdGEpXHJcbiAgICAgICAgc3ZnLnNlbGVjdEFsbCgnYWxsU2xpY2VzJylcclxuICAgICAgICAgICAgLmRhdGEocGllRGF0YSlcclxuICAgICAgICAgICAgLmVudGVyKClcclxuICAgICAgICAgICAgLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgIC5hdHRyKCdkJywgaW5uZXJBcmMpXHJcbiAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIChkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gb3V0LmNhdENvbG9ycygpW2QuZGF0YS5jb2RlXSB8fCAnbGlnaHRncmF5J1xyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuYXR0cignc3Ryb2tlJywgJ3doaXRlJylcclxuICAgICAgICAgICAgLnN0eWxlKCdzdHJva2Utd2lkdGgnLCAnMXB4JylcclxuICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMC43KVxyXG5cclxuICAgICAgICAvLyBBZGQgdGhlIHBvbHlsaW5lcyBiZXR3ZWVuIGNoYXJ0IGFuZCBsYWJlbHM6XHJcbiAgICAgICAgc3ZnLnNlbGVjdEFsbCgnYWxsUG9seWxpbmVzJylcclxuICAgICAgICAgICAgLmRhdGEocGllRGF0YSlcclxuICAgICAgICAgICAgLmVudGVyKClcclxuICAgICAgICAgICAgLmFwcGVuZCgncG9seWxpbmUnKVxyXG4gICAgICAgICAgICAuYXR0cignc3Ryb2tlJywgJ2JsYWNrJylcclxuICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgJ25vbmUnKVxyXG4gICAgICAgICAgICAuYXR0cignc3Ryb2tlLXdpZHRoJywgMSlcclxuICAgICAgICAgICAgLmF0dHIoJ3BvaW50cycsIGZ1bmN0aW9uIChkKSB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c2VsZWN0QWxsKCdhbGxMYWJlbHMnKVxyXG4gICAgICAgICAgICAuZGF0YShwaWVEYXRhKVxyXG4gICAgICAgICAgICAuZW50ZXIoKVxyXG4gICAgICAgICAgICAuYXBwZW5kKCd0ZXh0JylcclxuICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24gKGQpIHtcclxuICAgICAgICAgICAgICAgIGlmIChkLmRhdGEudmFsdWUgPiAwLjAyKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IG4gPSAoZC5kYXRhLnZhbHVlICogMTAwKS50b0ZpeGVkKClcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKG4pKSByZXR1cm4gbiArICclJ1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24gKGQpIHtcclxuICAgICAgICAgICAgICAgIHZhciBwb3MgPSBvdXRlckFyYy5jZW50cm9pZChkKVxyXG4gICAgICAgICAgICAgICAgdmFyIG1pZGFuZ2xlID0gZC5zdGFydEFuZ2xlICsgKGQuZW5kQW5nbGUgLSBkLnN0YXJ0QW5nbGUpIC8gMlxyXG4gICAgICAgICAgICAgICAgcG9zWzBdID0gcmFkaXVzICogMC45OSAqIChtaWRhbmdsZSA8IE1hdGguUEkgPyAxIDogLTEpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgcG9zICsgJyknXHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC5zdHlsZSgndGV4dC1hbmNob3InLCBmdW5jdGlvbiAoZCkge1xyXG4gICAgICAgICAgICAgICAgdmFyIG1pZGFuZ2xlID0gZC5zdGFydEFuZ2xlICsgKGQuZW5kQW5nbGUgLSBkLnN0YXJ0QW5nbGUpIC8gMlxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIG1pZGFuZ2xlIDwgTWF0aC5QSSA/ICdzdGFydCcgO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GUgYXR0cmlidXRlIG5hbWUsIHdpdGhvdXQgdGhlIHRyYWlsaW5nIFwiX1wiIGNoYXJhY3Rlci5cclxuICAgICAqICAtIFRvIGdldCB0aGUgYXR0cmlidXRlIHZhbHVlLCBjYWxsIHRoZSBtZXRob2Qgd2l0aG91dCBhcmd1bWVudC5cclxuICAgICAqICAtIFRvIHNldCB0aGUgYXR0cmlidXRlIHZhbHVlLCBjYWxsIHRoZSBzYW1lIG1ldGhvZCB3aXRoIHRoZSBuZXcgdmFsdWUgYXMgc2luZ2xlIGFyZ3VtZW50LlxyXG4gICAgICovXHJcbiAgICA7W1xyXG4gICAgICAgICdwc01heFNpemVfJyxcclxuICAgICAgICAncHNNaW5TaXplXycsXHJcbiAgICAgICAgJ3BzTWF4VmFsdWVfJyxcclxuICAgICAgICAncHNNaW5WYWx1ZV8nLFxyXG4gICAgICAgICdwc0ZpbGxfJyxcclxuICAgICAgICAncHNGaWxsT3BhY2l0eV8nLFxyXG4gICAgICAgICdwc1N0cm9rZV8nLFxyXG4gICAgICAgICdwc1N0cm9rZVdpZHRoXycsXHJcbiAgICAgICAgJ2NsYXNzaWZpZXJTaXplXycsXHJcbiAgICAgICAgJ2NsYXNzaWZpZXJDb2xvcl8nLFxyXG4gICAgICAgICdwc1NoYXBlXycsXHJcbiAgICAgICAgJ3BzQ3VzdG9tU2hhcGVfJyxcclxuICAgICAgICAncHNCYXJXaWR0aF8nLFxyXG4gICAgICAgICdwc0NsYXNzVG9GaWxsU3R5bGVfJyxcclxuICAgICAgICAncHNDb2xvckZ1bl8nLFxyXG4gICAgICAgICdub0RhdGFGaWxsU3R5bGVfJyxcclxuICAgICAgICAncHNUaHJlc2hvbGRfJyxcclxuICAgICAgICAncHNDb2xvcnNfJyxcclxuICAgICAgICAncHNDdXN0b21TVkdfJyxcclxuICAgICAgICAncHNPZmZzZXRfJyxcclxuICAgICAgICAncHNDbGFzc2lmaWNhdGlvbk1ldGhvZF8nLFxyXG4gICAgICAgICdwc0NsYXNzZXNfJyxcclxuICAgIF0uZm9yRWFjaChmdW5jdGlvbiAoYXR0KSB7XHJcbiAgICAgICAgb3V0W2F0dC5zdWJzdHJpbmcoMCwgYXR0Lmxlbmd0aCAtIDEpXSA9IGZ1bmN0aW9uICh2KSB7XHJcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG91dFthdHRdXHJcbiAgICAgICAgICAgIG91dFthdHRdID0gdlxyXG4gICAgICAgICAgICByZXR1cm4gb3V0XHJcbiAgICAgICAgfVxyXG4gICAgfSlcclxuXHJcbiAgICAvL292ZXJyaWRlIGF0dHJpYnV0ZSB2YWx1ZXMgd2l0aCBjb25maWcgdmFsdWVzXHJcbiAgICBpZiAoY29uZmlnKVxyXG4gICAgICAgIFtcclxuICAgICAgICAgICAgJ3BzTWF4U2l6ZScsXHJcbiAgICAgICAgICAgICdwc01pblNpemUnLFxyXG4gICAgICAgICAgICAncHNGaWxsJyxcclxuICAgICAgICAgICAgJ3BzRmlsbE9wYWNpdHknLFxyXG4gICAgICAgICAgICAncHNTdHJva2UnLFxyXG4gICAgICAgICAgICAncHNTdHJva2VXaWR0aCcsXHJcbiAgICAgICAgICAgICdjbGFzc2lmaWVyU2l6ZScsXHJcbiAgICAgICAgICAgICdjbGFzc2lmaWVyQ29sb3InLFxyXG4gICAgICAgICAgICAncHNTaGFwZScsXHJcbiAgICAgICAgICAgICdwc0N1c3RvbVNoYXBlJyxcclxuICAgICAgICAgICAgJ3BzQmFyV2lkdGgnLFxyXG4gICAgICAgICAgICAncHNDbGFzc1RvRmlsbFN0eWxlJyxcclxuICAgICAgICAgICAgJ3BzQ29sb3JGdW4nLFxyXG4gICAgICAgICAgICAnbm9EYXRhRmlsbFN0eWxlJyxcclxuICAgICAgICAgICAgJ3BzVGhyZXNob2xkJyxcclxuICAgICAgICAgICAgJ3BzQ29sb3JzJyxcclxuICAgICAgICAgICAgJ3BzQ3VzdG9tU1ZHJyxcclxuICAgICAgICAgICAgJ3BzT2Zmc2V0JyxcclxuICAgICAgICAgICAgJ3BzQ2xhc3NpZmljYXRpb25NZXRob2QnLFxyXG4gICAgICAgICAgICAncHNDbGFzc2VzJyxcclxuICAgICAgICBdLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xyXG4gICAgICAgICAgICBpZiAoY29uZmlnW2tleV0gIT0gdW5kZWZpbmVkKSBvdXRba2V5XShjb25maWdba2V5XSlcclxuICAgICAgICB9KVxyXG5cclxuICAgIC8vb3ZlcnJpZGUgb2Ygc29tZSBzcGVjaWFsIGdldHRlcnMvc2V0dGVyc1xyXG4gICAgb3V0LnBzQ29sb3JGdW4gPSBmdW5jdGlvbiAodikge1xyXG4gICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG91dC5wc0NvbG9yRnVuX1xyXG4gICAgICAgIG91dC5wc0NvbG9yRnVuXyA9IHZcclxuICAgICAgICBvdXQucHNDbGFzc1RvRmlsbFN0eWxlXyA9IGdldENvbG9yTGVnZW5kKG91dC5wc0NvbG9yRnVuXywgb3V0LnBzQ29sb3JzXylcclxuICAgICAgICByZXR1cm4gb3V0XHJcbiAgICB9XHJcbiAgICBvdXQucHNUaHJlc2hvbGQgPSBmdW5jdGlvbiAodikge1xyXG4gICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG91dC5wc1RocmVzaG9sZF9cclxuICAgICAgICBvdXQucHNUaHJlc2hvbGRfID0gdlxyXG4gICAgICAgIG91dC5wc0NsYXNzZXModi5sZW5ndGggKyAxKVxyXG4gICAgICAgIHJldHVybiBvdXRcclxuICAgIH1cclxuXHJcbiAgICAvL0BvdmVycmlkZVxyXG4gICAgb3V0LnVwZGF0ZUNsYXNzaWZpY2F0aW9uID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIC8vZGVmaW5lIGNsYXNzaWZpZXJzIGZvciBzaXppbmcgYW5kIGNvbG91cmluZyAob3V0LmNsYXNzaWZpZXJTaXplXyAmIG91dC5jbGFzc2lmaWVyQ29sb3JfKVxyXG4gICAgICAgIGRlZmluZUNsYXNzaWZpZXJzKClcclxuXHJcbiAgICAgICAgLy8gYXBwbHkgY2xhc3NpZmljYXRpb24gdG8gYWxsIGluc2V0cyB0aGF0IGFyZSBvdXRzaWRlIG9mIHRoZSBtYWluIG1hcCdzIFNWR1xyXG4gICAgICAgIGlmIChvdXQuaW5zZXRUZW1wbGF0ZXNfKSB7XHJcbiAgICAgICAgICAgIGZvciAoY29uc3QgZ2VvIGluIG91dC5pbnNldFRlbXBsYXRlc18pIHtcclxuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXS5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpbnNldHMgd2l0aCBzYW1lIGdlbyB0aGF0IGRvIG5vdCBzaGFyZSB0aGUgc2FtZSBwYXJlbnQgaW5zZXRcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dW2ldKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhpcyBpcyB0aGUgY2FzZSB3aGVuIHRoZXJlIGFyZSBtb3JlIHRoYW4gMiBkaWZmZXJlbnQgaW5zZXRzIHdpdGggdGhlIHNhbWUgZ2VvLiBFLmcuIDMgaW5zZXRzIGZvciBQVDIwXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBjID0gMDsgYyA8IG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXS5sZW5ndGg7IGMrKykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV1bY10uc3ZnSWRfICE9PSBvdXQuc3ZnSWRfKSBhcHBseUNsYXNzaWZpY2F0aW9uVG9NYXAob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dW2ldW2NdKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXS5zdmdJZF8gIT09IG91dC5zdmdJZF8pIGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIHVuaXF1ZSBpbnNldCBnZW9fXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXS5zdmdJZF8gIT09IG91dC5zdmdJZF8pIGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb10pXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIGFwcGx5IHRvIG1haW4gbWFwXHJcbiAgICAgICAgYXBwbHlDbGFzc2lmaWNhdGlvblRvTWFwKG91dClcclxuXHJcbiAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogQGRlc2NyaXB0aW9uIGFzc2lnbnMgYSBjb2xvciB0byBlYWNoIHN5bWJvbCwgYmFzZWQgb24gdGhlaXIgc3RhdGlzdGljYWwgdmFsdWVcclxuICAgICAqIEBwYXJhbSB7Kn0gbWFwXHJcbiAgICAgKi9cclxuICAgIGZ1bmN0aW9uIGFwcGx5Q2xhc3NpZmljYXRpb25Ub01hcChtYXApIHtcclxuICAgICAgICBpZiAobWFwLnN2Z18pIHtcclxuICAgICAgICAgICAgaWYgKG91dC5jbGFzc2lmaWVyQ29sb3JfKSB7XHJcbiAgICAgICAgICAgICAgICAvL2Fzc2lnbiBjb2xvciBjbGFzcyB0byBlYWNoIHN5bWJvbCwgYmFzZWQgb24gdGhlaXIgdmFsdWVcclxuICAgICAgICAgICAgICAgIC8vIGF0IHRoaXMgcG9pbnQsIHRoZSBzeW1ib2wgcGF0aCBoYXNudCBiZWVuIGFwcGVuZGVkLiBPbmx5IHRoZSBwYXJlbnQgZy5lbS1zeW1ib2wgZWxlbWVudCAoaW4gbWFwLXRlbXBsYXRlKVxyXG4gICAgICAgICAgICAgICAgbGV0IGNvbG9yRGF0YSA9IG1hcC5zdGF0RGF0YSgnY29sb3InKVxyXG4gICAgICAgICAgICAgICAgbWFwLnN2Z18uc2VsZWN0QWxsKCcuZW0tc3ltYm9sJykuYXR0cignZWNsJywgZnVuY3Rpb24gKHJnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBjb2xvckRhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ25kJ1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBjb25zdCB2ID0gc3YudmFsdWVcclxuICAgICAgICAgICAgICAgICAgICBpZiAodiAhPT0gMCAmJiAhdikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ25kJ1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBsZXQgYyA9ICtvdXQuY2xhc3NpZmllckNvbG9yXygrdilcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY1xyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEBkZXNjcmlwdGlvbiBkZWZpbmVzIGNsYXNzaWZpZXIgZnVuY3Rpb25zIChvdXQuY2xhc3NpZmllckNvbG9yIGFuZCBvdXQuY2xhc3NpZmllclNpemUpIGZvciBib3RoIHN5bWJvbCBzaXplIGFuZCBjb2xvclxyXG4gICAgICovXHJcbiAgICBmdW5jdGlvbiBkZWZpbmVDbGFzc2lmaWVycygpIHtcclxuICAgICAgICAvL3NpbXBseSByZXR1cm4gdGhlIGFycmF5IFswLDEsMiwzLC4uLixuYi0xXVxyXG4gICAgICAgIGNvbnN0IGdldEEgPSBmdW5jdGlvbiAobmIpIHtcclxuICAgICAgICAgICAgcmV0dXJuIFsuLi5BcnJheShuYikua2V5cygpXVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gdXNlIHNpemUgZGF0YXNldFxyXG4gICAgICAgIGxldCBzaXplRG9tYWluXHJcbiAgICAgICAgbGV0IGRhdGEgPSBvdXQuc3RhdERhdGEoJ3NpemUnKS5nZXRBcnJheSgpXHJcbiAgICAgICAgLy8gbGV0IGRvbWFpbiA9IGV4dGVudChkYXRhKVxyXG4gICAgICAgIGxldCBtaW4gPSBvdXQucHNNaW5WYWx1ZV8gPyBvdXQucHNNaW5WYWx1ZV8gOiBvdXQuc3RhdERhdGEoJ3NpemUnKS5nZXRNaW4oKVxyXG4gICAgICAgIGxldCBtYXggPSBvdXQucHNNYXhWYWx1ZV8gPyBvdXQucHNNYXhWYWx1ZV8gOiBvdXQuc3RhdERhdGEoJ3NpemUnKS5nZXRNYXgoKVxyXG5cclxuICAgICAgICBzaXplRG9tYWluID0gZGF0YSA/IFttaW4sIG1heF0gOiBbb3V0LnN0YXREYXRhKCkuZ2V0TWluKCksIG91dC5zdGF0RGF0YSgpLmdldE1heCgpXVxyXG5cclxuICAgICAgICBvdXQuY2xhc3NpZmllclNpemUob3V0LnBzU2l6ZUZ1bl8oKS5kb21haW4oc2l6ZURvbWFpbikucmFuZ2UoW291dC5wc01pblNpemVfLCBvdXQucHNNYXhTaXplX10pKVxyXG5cclxuICAgICAgICAvLyBjb2xvdXJcclxuICAgICAgICBpZiAob3V0LnN0YXREYXRhKCdjb2xvcicpLmdldEFycmF5KCkpIHtcclxuICAgICAgICAgICAgLy91c2Ugc3VpdGFibGUgY2xhc3NpZmljYXRpb24gdHlwZSBmb3IgY29sb3VyaW5nXHJcbiAgICAgICAgICAgIGlmIChvdXQucHNDbGFzc2lmaWNhdGlvbk1ldGhvZF8gPT09ICdxdWFudGlsZScpIHtcclxuICAgICAgICAgICAgICAgIC8vaHR0cHM6Ly9naXRodWIuY29tL2QzL2QzLXNjYWxlI3F1YW50aWxlLXNjYWxlc1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZG9tYWluID0gb3V0LnN0YXREYXRhKCdjb2xvcicpLmdldEFycmF5KClcclxuICAgICAgICAgICAgICAgIGNvbnN0IHJhbmdlID0gZ2V0QShvdXQucHNDbGFzc2VzXylcclxuICAgICAgICAgICAgICAgIG91dC5jbGFzc2lmaWVyQ29sb3Ioc2NhbGVRdWFudGlsZSgpLmRvbWFpbihkb21haW4pLnJhbmdlKHJhbmdlKSlcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChvdXQucHNDbGFzc2lmaWNhdGlvbk1ldGhvZF8gPT09ICdlcXVpbnRlcicpIHtcclxuICAgICAgICAgICAgICAgIC8vaHR0cHM6Ly9naXRodWIuY29tL2QzL2QzLXNjYWxlI3F1YW50aXplLXNjYWxlc1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZG9tYWluID0gb3V0LnN0YXREYXRhKCdjb2xvcicpLmdldEFycmF5KClcclxuICAgICAgICAgICAgICAgIGNvbnN0IHJhbmdlID0gZ2V0QShvdXQucHNDbGFzc2VzXylcclxuICAgICAgICAgICAgICAgIG91dC5jbGFzc2lmaWVyQ29sb3IoXHJcbiAgICAgICAgICAgICAgICAgICAgc2NhbGVRdWFudGl6ZSgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5kb21haW4oW21pbihkb21haW4pLCBtYXgoZG9tYWluKV0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yYW5nZShyYW5nZSlcclxuICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgIGlmIChvdXQubWFrZUNsYXNzaWZOaWNlXykgb3V0LmNsYXNzaWZpZXJDb2xvcigpLm5pY2UoKVxyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKG91dC5wc0NsYXNzaWZpY2F0aW9uTWV0aG9kXyA9PT0gJ3RocmVzaG9sZCcpIHtcclxuICAgICAgICAgICAgICAgIC8vaHR0cHM6Ly9naXRodWIuY29tL2QzL2QzLXNjYWxlI3RocmVzaG9sZC1zY2FsZXNcclxuICAgICAgICAgICAgICAgIG91dC5wc0NsYXNzZXMob3V0LnBzVGhyZXNob2xkKCkubGVuZ3RoICsgMSlcclxuICAgICAgICAgICAgICAgIGNvbnN0IHJhbmdlID0gZ2V0QShvdXQucHNDbGFzc2VzXylcclxuICAgICAgICAgICAgICAgIG91dC5jbGFzc2lmaWVyQ29sb3Ioc2NhbGVUaHJlc2hvbGQoKS5kb21haW4ob3V0LnBzVGhyZXNob2xkKCkpLnJhbmdlKHJhbmdlKSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEFwcGxpZXMgcHJvcG9ydGlvbmFsIHN5bWJvbCBzdHlsaW5nIHRvIGEgbWFwIG9iamVjdFxyXG4gICAgICpcclxuICAgICAqIEBwYXJhbSB7Kn0gbWFwXHJcbiAgICAgKiBAcmV0dXJuc1xyXG4gICAgICovXHJcbiAgICBmdW5jdGlvbiBhcHBseVN0eWxlVG9NYXAobWFwKSB7XHJcbiAgICAgICAgLy9zZWUgaHR0cHM6Ly9ibC5vY2tzLm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zc2lmaWNhdGlvblRvTWFwKG1hcClcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy8gYXBwZW5kIHN5bWJvbHNcclxuICAgICAgICAgICAgbGV0IHN5bWJcclxuICAgICAgICAgICAgaWYgKG91dC5wc0N1c3RvbVNWR18pIHtcclxuICAgICAgICAgICAgICAgIHN5bWIgPSBhcHBlbmRDdXN0b21TeW1ib2xzVG9NYXAobWFwLCBzaXplRGF0YSlcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChvdXQucHNTaGFwZV8gPT0gJ2JhcicpIHtcclxuICAgICAgICAgICAgICAgIHN5bWIgPSBhcHBlbmRCYXJzVG9NYXAobWFwLCBzaXplRGF0YSlcclxuICAgICAgICAgICAgfSBlbHNlIGlmIChvdXQucHNTaGFwZV8gPT0gJ2NpcmNsZScpIHtcclxuICAgICAgICAgICAgICAgIHN5bWIgPSBhcHBlbmRDaXJjbGVzVG9NYXAobWFwLCBzaXplRGF0YSlcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vIGNpcmNsZSwgY3Jvc3MsIHN0YXIsIHRyaWFuZ2xlLCBkaWFtb25kLCBzcXVhcmUsIHd5ZSBvciBjdXN0b21cclxuICAgICAgICAgICAgICAgIHN5bWIgPSBhcHBlbmREM1N5bWJvbHNUb01hcChtYXAsIHNpemVEYXRhKVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvLyBzZXQgc3R5bGUgb2Ygc3ltYm9sc1xyXG4gICAgICAgICAgICBsZXQgc2VsZWN0b3IgPSBvdXQuZ2VvXyA9PT0gJ1dPUkxEJyA/ICcjZW0td29ybGRyZyBwYXRoJyA6ICcjZW0tbnV0c3JnIHBhdGgnXHJcbiAgICAgICAgICAgIGlmIChvdXQuR2VvbWV0cmllcy51c2VyR2VvbWV0cmllcykgc2VsZWN0b3IgPSAnI2VtLXVzZXItcmVnaW9ucyBwYXRoJyAvLyBmb3IgdXNlci1kZWZpbmVkIGdlb21ldHJpZXNcclxuICAgICAgICAgICAgbGV0IHJlZ2lvbnMgPSBtYXAuc3ZnKCkuc2VsZWN0QWxsKHNlbGVjdG9yKVxyXG5cclxuICAgICAgICAgICAgaWYgKG1hcC5nZW9fICE9PSAnV09STEQnKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAobWFwLm51dHNMZXZlbF8gPT0gJ21peGVkJykge1xyXG4gICAgICAgICAgICAgICAgICAgIGFkZFN5bWJvbHNUb01peGVkTlVUUyhtYXAsIHNpemVEYXRhLCByZWdpb25zKVxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIC8vIG51dHMgcmVnaW9ucyBmaWxsIGNvbG91ciBvbmx5IGZvciB0aG9zZSB3aXRoIHNpemVEYXRhXHJcbiAgICAgICAgICAgICAgICByZWdpb25zLnN0eWxlKCdmaWxsJywgZnVuY3Rpb24gKHJnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBzaXplRGF0YS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXN2IHx8ICghc3YudmFsdWUgJiYgc3YgIT09IDAgJiYgc3YudmFsdWUgIT09IDApKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5PIElOUFVUXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvdXQubm9EYXRhRmlsbFN0eWxlX1xyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHN2ICYmIHN2LnZhbHVlKSB8fCAoc3YgJiYgc3YudmFsdWUgPT0gMCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN2LnZhbHVlID09ICc6Jykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gREFUQSBOT1QgQVZBSUxBQkxFXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3V0Lm5vRGF0YUZpbGxTdHlsZV9cclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBEQVRBXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXRDU1NQcm9wZXJ0eUZyb21DbGFzcygnZW0tbnV0c3JnJywgJ2ZpbGwnKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAgICAgLy8gYXBwbHkgJ25kJyBjbGFzcyB0byBubyBkYXRhIGZvciBsZWdlbmQgaXRlbSBob3ZlclxyXG4gICAgICAgICAgICAgICAgcmVnaW9ucy5hdHRyKCdlY2wnLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzdiA9IHNpemVEYXRhLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghc3YgfHwgKCFzdi52YWx1ZSAmJiBzdiAhPT0gMCAmJiBzdi52YWx1ZSAhPT0gMCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gTk8gSU5QVVRcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICduZCdcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChzdiAmJiBzdi52YWx1ZSkgfHwgKHN2ICYmIHN2LnZhbHVlID09IDApKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdi52YWx1ZSA9PSAnOicpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERBVEEgTk9UIEFWQUlMQUJMRVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICduZCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvLyB3b3JsZCBjb3VudHJpZXMgZmlsbFxyXG4gICAgICAgICAgICAgICAgcmVnaW9ucy5zdHlsZSgnZmlsbCcsIGZ1bmN0aW9uIChyZykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdiB8fCAoIXN2LnZhbHVlICYmIHN2ICE9PSAwICYmIHN2LnZhbHVlICE9PSAwKSB8fCBzdi52YWx1ZSA9PSAnOicpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG91dC53b3JsZEZpbGxTdHlsZV9cclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2V0Q1NTUHJvcGVydHlGcm9tQ2xhc3MoJ2VtLW51dHNyZycsICdmaWxsJylcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvLyBzZXQgY29sb3Ivc3Ryb2tlL29wYWNpdHkgc3R5bGVzXHJcbiAgICAgICAgICAgIHNldFN5bWJvbFN0eWxlcyhzeW1iKVxyXG5cclxuICAgICAgICAgICAgYWRkTW91c2VFdmVudHMobWFwKVxyXG5cclxuICAgICAgICAgICAgLy8gVXBkYXRlIGxhYmVscyBmb3Igc3RhdGlzdGljYWwgdmFsdWVzIGlmIHJlcXVpcmVkXHJcbiAgICAgICAgICAgIGlmIChvdXQubGFiZWxzXz8udmFsdWVzKSB7XHJcbiAgICAgICAgICAgICAgICBvdXQudXBkYXRlVmFsdWVzTGFiZWxzKG1hcClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbWFwXHJcbiAgICB9XHJcblxyXG4gICAgY29uc3QgYWRkTW91c2VFdmVudHMgP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JcbiAgICAgICAgICAgICAgICBjb25zdCBzdiA9IHNpemVEYXRhLmdldChkLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICBpZiAoIXN2IHx8ICghc3YudmFsdWUgJiYgc3YgIT09IDAgJiYgc3YudmFsdWUgIT09IDApKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlXHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC5hcHBlbmQoJ3RleHQnKVxyXG4gICAgICAgICAgICAudGV4dChmdW5jdGlvbiAoZCkge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBzaXplRGF0YS5nZXQoZC5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgaWYgKCFzdiB8fCAoIXN2LnZhbHVlICYmIHN2ICE9PSAwICYmIHN2LnZhbHVlICE9PSAwKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnJ1xyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoc3YudmFsdWUgIT09ICc6Jykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BhY2VBc1Rob3VzYW5kU2VwYXJhdG9yKHN2LnZhbHVlKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgLy9hZGQgc2hhZG93cyB0byBsYWJlbHNcclxuICAgICAgICBpZiAob3V0LmxhYmVsU2hhZG93Xykge1xyXG4gICAgICAgICAgICBtYXAuc3ZnX1xyXG4gICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgnZy5lbS1zdGF0LWxhYmVsLXNoYWRvdycpXHJcbiAgICAgICAgICAgICAgICAuZmlsdGVyKChkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBzaXplRGF0YS5nZXQoZC5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghc3YgfHwgKCFzdi52YWx1ZSAmJiBzdiAhPT0gMCAmJiBzdi52YWx1ZSAhPT0gMCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWVcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAudGV4dChmdW5jdGlvbiAoZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KGQucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXN2IHx8ICghc3YudmFsdWUgJiYgc3YgIT09IDAgJiYgc3YudmFsdWUgIT09IDApKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnJ1xyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdi52YWx1ZSAhPT0gJzonKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BhY2VBc1Rob3VzYW5kU2VwYXJhdG9yKHN2LnZhbHVlKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICog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AgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvdXQucHNGaWxsX1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuYXR0cignZmlsbF9fXycsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIGxldCBmaWxsID0gc2VsZWN0KHRoaXMpLnN0eWxlKCdmaWxsJylcclxuICAgICAgICAgICAgICAgIHJldHVybiBmaWxsIC8vIHNhdmUgZm9yIGxlZ2VuZCBtb3VzZW92ZXJcclxuICAgICAgICAgICAgfSlcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEBkZXNjcmlwdGlvbiBVcGRhdGVzIHRoZSBkcmF3IG9yZGVyIG9mIHRoZSBzeW1ib2xzIGFjY29yZGluZyB0byB0aGVpciBkYXRhIHZhbHVlc1xyXG4gICAgICogQHBhcmFtIHsqfSBtYXAgbWFwIGluc3RhbmNlXHJcbiAgICAgKi9cclxuICAgIGZ1bmN0aW9uIHVwZGF0ZVN5bWJvbHNEcmF3T3JkZXIobWFwKSB7XHJcbiAgICAgICAgbGV0IHpvb21Hcm91cCA9IG1hcC5zdmdfID8gbWFwLnN2Z18uc2VsZWN0KCcjem9vbWdyb3VwJyArIG1hcC5zdmdJZF8pIDogbnVsbFxyXG4gICAgICAgIGNvbnN0IGdjcCA9IHpvb21Hcm91cC5zZWxlY3QoJyNnX3BzJylcclxuICAgICAgICBsZXQgc2l6ZURhdGEgPSBtYXAuc3RhdERhdGEoJ3NpemUnKS5nZXRBcnJheSgpID8gbWFwLnN0YXREYXRhKCdzaXplJykgOiBtYXAuc3RhdERhdGEoKVxyXG5cclxuICAgICAgICBsZXQgc29ydGVkQnlTaXplID0gWy4uLm1hcC5fY2VudHJvaWRGZWF0dXJlc10uc29ydChmdW5jdGlvbiAoYSwgYikge1xyXG4gICAgICAgICAgICAvL0EgbmVnYXRpdmUgdmFsdWUgaW5kaWNhdGVzIHRoYXQgYSBzaG91bGQgY29tZSBiZWZvcmUgYi5cclxuICAgICAgICAgICAgLy9BIHBvc2l0aXZlIHZhbHVlIGluZGljYXRlcyB0aGF0IGEgc2hvdWxkIGNvbWUgYWZ0ZXIgYi5cclxuICAgICAgICAgICAgLy9aZXJvIG9yIE5hTiBpbmRpY2F0ZXMgdGhhdCBhIGFuZCBiIGFyZSBjb25zaWRlcmVkIGVxdWFsLlxyXG4gICAgICAgICAgICBsZXQgdmFsQSA9IHNpemVEYXRhLmdldChhLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgIGxldCB2YWxCID0gc2l6ZURhdGEuZ2V0KGIucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgaWYgKHZhbEEgfHwgdmFsQT8udmFsdWUgPT0gMCB8fCB2YWxCIHx8IHZhbEI/LnZhbHVlID09IDApIHtcclxuICAgICAgICAgICAgICAgIGlmICgodmFsQSB8fCB2YWxBPy52YWx1ZSA9PSAwKSAmJiAodmFsQiB8fCB2YWxCPy52YWx1ZSA9PSAwKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vYm90aCB2YWx1ZXMgZXhpc3RcclxuICAgICAgICAgICAgICAgICAgICAvL2JpZ2dlc3QgY2lyY2xlcyBhdCB0aGUgYm90dG9tXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbEIudmFsdWUgLSB2YWxBLnZhbHVlXHJcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCh2YWxBIHx8IHZhbEE/LnZhbHVlID09IDApICYmICghdmFsQiB8fCAhdmFsQj8udmFsdWUgPT0gMCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAvL29ubHkgdmFsQSBleGlzdHNcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTFcclxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHZhbEIgfHwgdmFsQj8udmFsdWUgPT0gMCkgJiYgKCF2YWxBIHx8ICF2YWxBPy52YWx1ZSA9PSAwKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vb25seSB2YWxCIGV4aXN0c1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gMFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSlcclxuXHJcbiAgICAgICAgbGV0IHN5bWJvbHMgPSBnY3BcclxuICAgICAgICAgICAgLnNlbGVjdEFsbCgnZy5lbS1zeW1ib2wnKVxyXG4gICAgICAgICAgICAuZGF0YShcclxuICAgICAgICAgICAgICAgIC8vIEZJTFRFUklORyBCUkVBS1MgSU1BR0UgLVxyXG4gICAgICAgICAgICAgICAgLy8gaXQgcmVtb3ZlcyByZWdpb25zIG5vdCBwcmVzZW50IGluIGN1cnJlbnQgZGF0YSwgYnV0IGlmIHlvdSB1cGRhdGUgdGhlIGRhdGEgYW5kIGFkZCBkYXRhIGZvciB0aG9zZSByZWdpb25zIHRoZW4gdGhleSBhcmUgbm90IGRyYXduISEpXHJcbiAgICAgICAgICAgICAgICAvLyBmaWx0ZXIgb3V0IHJlZ2lvbnMgd2l0aCBubyBkYXRhXHJcbiAgICAgICAgICAgICAgICAvLyAuZmlsdGVyKChyZykgPT4ge1xyXG4gICAgICAgICAgICAgICAgLy8gICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAvLyAgICAgLy8gaGFzIHNpemUgZGF0YVxyXG4gICAgICAgICAgICAgICAgLy8gICAgIGlmIChzdiAmJiBzdi52YWx1ZSAhPT0gMCkge1xyXG4gICAgICAgICAgICAgICAgLy8gICAgICAgICByZXR1cm4gcmdcclxuICAgICAgICAgICAgICAgIC8vICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyB9KVxyXG4gICAgICAgICAgICAgICAgLy8gc29ydC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T4ge1xyXG4gICAgICAgICAgICAgICAgLy8gICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAvLyAgICAgaWYgKHN2ICYmIHN2LnZhbHVlICE9PSAnOicpIHJldHVybiByZ1xyXG4gICAgICAgICAgICAgICAgLy8gfSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdyJywgKHJnKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNpemVEYXRhLmdldChyZy5wcm9wZXJ0aWVzLmlkKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0dW0gPSBzaXplRGF0YS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRhdHVtLnZhbHVlID09IDApIHJldHVybiAwXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByYWRpdXMgPSBvdXQuY2xhc3NpZmllclNpemVfKGRhdHVtLnZhbHVlKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmFkaXVzPy50b0ZpeGVkKDMpIHx8IDBcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMFxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgKVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogQGRlc2NyaXB0aW9uIEFwcGVuZHMgPHBhdGg+IGVsZW1lbnRzIGNvbnRhaW5pbmcgc3ltYm9scyBmb3IgZWFjaCByZWdpb24gaW4gdGhlIG1hcCBTVkdcclxuICAgICAqIEBwYXJhbSB7Kn0gbWFwIG1hcCBpbnN0YW5jZVxyXG4gICAgICogQHBhcmFtIHsqfSBzaXplRGF0YSBlLmcuIG1hcC5zdGF0RGF0YSgnc2l6ZScpXHJcbiAgICAgKiBAcmV0dXJuIHsqfVxyXG4gICAgICovXHJcbiAgICBmdW5jdGlvbiBhcHBlbmREM1N5bWJvbHNUb01hcChtYXAsIHNpemVEYXRhKSB7XHJcbiAgICAgICAgcmV0dXJuIG1hcFxyXG4gICAgICAgICAgICAuc3ZnKClcclxuICAgICAgICAgICAgLnNlbGVjdEFsbCgnZy5lbS1zeW1ib2wnKVxyXG4gICAgICAgICAgICAuYXBwZW5kKCdwYXRoJylcclxuICAgICAgICAgICAgLmZpbHRlcigocmcpID0+IHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICBpZiAoc3YgJiYgc3YudmFsdWUgIT09ICc6JykgcmV0dXJuIHJnXHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdwcycpXHJcbiAgICAgICAgICAgIC5hdHRyKCdkJywgKHJnKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAvL2NhbGN1bGF0ZSBzaXplXHJcbiAgICAgICAgICAgICAgICBpZiAoIXNpemVEYXRhKSByZXR1cm5cclxuICAgICAgICAgICAgICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICBpZiAoc3YgIT0gMCAmJiAhc3YpIHJldHVyblxyXG4gICAgICAgICAgICAgICAgbGV0IHNpemUgPSBvdXQuY2xhc3NpZmllclNpemVfKCtzdi52YWx1ZSkgfHwgMFxyXG5cclxuICAgICAgICAgICAgICAgIC8vYXBwbHkgc2l6ZSB0byBzaGFwZVxyXG4gICAgICAgICAgICAgICAgaWYgKG91dC5wc0N1c3RvbVNoYXBlXykge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvdXQucHNDdXN0b21TaGFwZV8uc2l6ZShzaXplICogc2l6ZSkoKVxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzeW1ib2xUeXBlID0gc3ltYm9sc0xpYnJhcnlbb3V0LnBzU2hhcGVfXSB8fCBzeW1ib2xzTGlicmFyeVsnY2lyY2xlJ11cclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3ltYm9sKClcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnR5cGUoc3ltYm9sVHlwZSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnNpemUoc2l6ZSAqIHNpemUpKClcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSlcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEBkZXNjcmlwdGlvbiBBcHBlbmRzIDxyZWN0PiBlbGVtZW50cyBjb250YWluaW5nIGJhcnMgZm9yIGVhY2ggcmVnaW9uIGluIHRoZSBtYXAgU1ZHXHJcbiAgICAgKiBAcGFyYW0geyp9IG1hcCBtYXAgaW5zdGFuY2VcclxuICAgICAqIEBwYXJhbSB7Kn0gc2l6ZURhdGEgZS5nLiBtYXAuc3RhdERhdGEoJ3NpemUnKVxyXG4gICAgICogQHJldHVybiB7Kn1cclxuICAgICAqL1xyXG4gICAgZnVuY3Rpb24gYXBwZW5kQmFyc1RvTWFwKG1hcCwgc2l6ZURhdGEpIHtcclxuICAgICAgICByZXR1cm4gKFxyXG4gICAgICAgICAgICBtYXBcclxuICAgICAgICAgICAgICAgIC5zdmcoKVxyXG4gICAgICAgICAgICAgICAgLnNlbGVjdCgnI2dfcHMnKVxyXG4gICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgnZy5lbS1zeW1ib2wnKVxyXG4gICAgICAgICAgICAgICAgLmFwcGVuZCgncmVjdCcpXHJcbiAgICAgICAgICAgICAgICAuZmlsdGVyKChyZykgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHN2ID0gc2l6ZURhdGEuZ2V0KHJnLnByb3BlcnRpZXMuaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN2ICYmIHN2LnZhbHVlICE9PSAnOicpIHJldHVybiByZ1xyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIG91dC5wc0JhcldpZHRoXylcclxuICAgICAgICAgICAgICAgIC8vZm9yIHZlcnRpY2FsIGJhcnMgd2Ugc2NhbGUgdGhlIGhlaWdodCBhdHRyaWJ1dGUgdXNpbmcgdGhlIGNsYXNzaWZpZXJcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzdiA9IHNpemVEYXRhLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghc3YgfHwgIXN2LnZhbHVlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGxldCB2ID0gb3V0LmNsYXNzaWZpZXJTaXplXygrc3YudmFsdWUpXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBiUmVjdCA9IHRoaXMuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KClcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYHRyYW5zbGF0ZSgkey10aGlzLmdldEF0dHJpYnV0ZSgnd2lkdGgnKSAvIDJ9YCArIGAsIC0ke3RoaXMuZ2V0QXR0cmlidXRlKCdoZWlnaHQnKX0pYFxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgLy8gdG8gdXNlIHRyYW5zaXRpb25zIHdlIG5lZ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AgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAuZmlsdGVyKChyZykgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBzaXplRGF0YS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgIGlmIChzdiAmJiBzdi52YWx1ZSAhPT0gJzonKSByZXR1cm4gcmdcclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ3BzJylcclxuICAgICAgICAgICAgLmh0bWwob3V0LnBzQ3VzdG9tU1ZHXylcclxuICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIChyZykgPT4ge1xyXG4gICAgICAgICAgICAgICAgLy9jYWxjdWxhdGUgc2l6ZVxyXG4gICAgICAgICAgICAgICAgY29uc3Qgc3YgPSBzaXplRGF0YS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgIGxldCBzaXplID0gb3V0LmNsYXNzaWZpZXJTaXplXygrc3YudmFsdWUpXHJcbiAgICAgICAgICAgICAgICBpZiAoc2l6ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgdHJhbnNsYXRlKCR7b3V0LnBzT2Zmc2V0Xy54ICogc2l6ZX0sJHtvdXQucHNPZmZzZXRfLnkgKiBzaXplfSkgc2NhbGUoJHtzaXplfSlgXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pXHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBAZGVzY3JpcHRpb24gYWRkcyBwcm9wb3J0aW9uYWwgc3ltYm9scyB0byBlYWNoIHJlZ2lvbnMgaW4gYSBtYXAgd2l0aCBtaXhlZCBOVVRTIGxldmVscyAoSU1BR0UpXHJcbiAgICAgKiBAcGFyYW0geyp9IG1hcFxyXG4gICAgICogQHBhcmFtIHsqfSBzaXplRGF0YVxyXG4gICAgICogQHBhcmFtIHsqfSByZWdpb25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SBzaXplRGF0YS5nZXQocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgaWYgKCFzdiB8fCAoIXN2LnZhbHVlICYmIHN2ICE9PSAwICYmIHN2LnZhbHVlICE9PSAwKSkge1xyXG4gICAgICAgICAgICAgICAgLy8gbm8gc3ltYm9sIGZvciBubyBkYXRhXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gJ25vbmUnXHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWFwLmdlb18gPT0gJ1dPUkxEJykge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuICdibG9jaydcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pXHJcblxyXG4gICAgICAgIC8vIG51dHMgYm9yZGVyIHN0cm9rZVxyXG4gICAgICAgIHJlZ2lvbnNcclxuICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCBmdW5jdGlvbiAocmcpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHNlbCA9IHNlbGVjdCh0aGlzKVxyXG4gICAgICAgICAgICAgICAgY29uc3QgbHZsID0gc2VsLmF0dHIoJ2x2bCcpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBzdHJva2UgPSBzZWwuc3R5bGUoJ3N0cm9rZScpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBzdiA9IHNpemVEYXRhLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgaWYgKCFzdiB8fCAhc3YudmFsdWUpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm5cclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGx2bCAhPT0gJzAnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHJva2UgfHwgJyM3NzcnXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgLy8gbnV0cyBib3JkZXIgc3Ryb2tlIHdpZHRoXHJcbiAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLXdpZHRoJywgZnVuY3Rpb24gKHJnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgIGNvbnN0IGx2bCA9IHNlbC5hdHRyKCdsdmwnKVxyXG4gICAgICAgICAgICAgICAgY29uc3Qgc3Ryb2tlV2lkdGggPSBzZWwuc3R5bGUoJ3N0cm9rZS13aWR0aCcpXHJcbiAgICAgICAgICAgICAgICBjb25zdCBzdiA9IHNpemVEYXRhLmdldChyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgaWYgKCFzdiB8fCAhc3YudmFsdWUpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm5cclxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3V0Lmdlb18gPT0gJ1dPUkxEJykge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChsdmwgIT09ICcwJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3Ryb2tlV2lkdGggfHwgJyM3NzcnXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICByZXR1cm4gc3ltYlxyXG4gICAgfVxyXG5cclxuICAgIC8vQG92ZXJyaWRlXHJcbiAgICBvdXQudXBkYXRlU3R5bGUgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgLy8gYXBwbHkgdG8gbWFpbiBtYXBcclxuICAgICAgICBhcHBseVN0eWxlVG9NYXAob3V0KVxyXG5cclxuICAgICAgICAvLyBhcHBseSBzdHlsZSB0byBpbnNldHNcclxuICAgICAgICAvLyBhcHBseSBjbGFzc2lmaWNhdGlvbiB0byBhbGwgaW5zZXRzXHJcbiAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc18pIHtcclxuICAgICAgICAgICAgZm9yIChjb25zdCBnZW8gaW4gb3V0Lmluc2V0VGVtcGxhdGVzXykge1xyXG4gICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkob3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGluc2V0cyB3aXRoIHNhbWUgZ2VvIHRoYXQgZG8gbm90IHNoYXJlIHRoZSBzYW1lIHBhcmVudCBpbnNldFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV0pKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGlzIHRoZSBjYXNlIHdoZW4gdGhlcmUgYXJlIG1vcmUgdGhhbiAyIGRpZmZlcmVudCBpbnNldHMgd2l0aCB0aGUgc2FtZSBnZW8uIEUuZy4gMyBpbnNldHMgZm9yIFBUMjBcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGMgPSAwOyBjIDwgb3V0Lmluc2V0VGVtcGxhdGVzX1tnZW9dW2ldLmxlbmd0aDsgYysrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5pbnNldFRlbXBsYXRlc19bZ2VvXVtpXVtjXS5zdmdJZF8gIT09IG91dC5zdmdJZF8pIGFwcGx5U3R5bGVUb01hcChvdXQuaW5zZXRUZW1wbGF0ZXNfW2dlb11baV1bY10pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIC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VhQ29sb3JfJyxcclxuICAgICAgICAnc3BhcmtUb29sdGlwQ2hhcnRfJyxcclxuICAgICAgICAnc3BhcmtQZXJjZW50YWdlQ2hhbmdlXycsXHJcbiAgICBdLmZvckVhY2goZnVuY3Rpb24gKGF0dCkge1xyXG4gICAgICAgIG91dFthdHQuc3Vic3RyaW5nKDAsIGF0dC5sZW5ndGggLSAxKV0gPSBmdW5jdGlvbiAodikge1xyXG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBvdXRbYXR0XVxyXG4gICAgICAgICAgICBvdXRbYXR0XSA9IHZcclxuICAgICAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgICAgIH1cclxuICAgIH0pXHJcblxyXG4gICAgLy9vdmVycmlkZSBhdHRyaWJ1dGUgdmFsdWVzIHdpdGggY29uZmlnIHZhbHVlc1xyXG4gICAgaWYgKGNvbmZpZylcclxuICAgICAgICBbXHJcbiAgICAgICAgICAgICdzcGFya0xpbmVDb2xvcicsXHJcbiAgICAgICAgICAgICdzaG93T25seVdoZW5Db21wbGV0ZScsXHJcbiAgICAgICAgICAgICdzcGFya1R5cGUnLFxyXG4gICAgICAgICAgICAnc3BhcmtMaW5lV2lkdGgnLFxyXG4gICAgICAgICAgICAnc3BhcmtMaW5lSGVpZ2h0JyxcclxuICAgICAgICAgICAgJ3NwYXJrTGluZVN0cm9rZVdpZHRoJyxcclxuICAgICAgICAgICAgJ3NwYXJrTGluZU9wYWNpdHknLFxyXG4gICAgICAgICAgICAnc3BhcmtMaW5lQ2lyY2xlUmFkaXVzXycsXHJcbiAgICAgICAgICAgICdzcGFya0xpbmVBcmVhQ29sb3InLFxyXG4gICAgICAgICAgICAnc3BhcmtUb29sdGlwQ2hhcnRfJyxcclxuICAgICAgICAgICAgJ3NwYXJrUGVyY2VudGFnZUNoYW5nZV8nLFxyXG4gICAgICAgIF0uZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XHJcbiAgICAgICAgICAgIGl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nZXRDb21wb3NpdGlvbihyZy5wcm9wZXJ0aWVzLmlkKVxyXG4gICAgICAgICAgICAgICAgaWYgKGRhdGEpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgICAgICBzZWwuYXR0cignZmlsbF9fXycsIHNlbC5zdHlsZSgnZmlsbCcpKVxyXG4gICAgICAgICAgICAgICAgICAgIHNlbC5zdHlsZSgnZmlsbCcsIG91dC5ob3ZlckNvbG9yXylcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2VvdmVyKG91dC50b29sdGlwXy50ZXh0RnVuY3Rpb24ocmcsIG91dCkpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC5vbignbW91c2Vtb3ZlJywgZnVuY3Rpb24gKGUsIHJnKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBkYXRhID0gZ2V0Q29tcG9zaXRpb24ocmcucHJvcGVydGllcy5pZClcclxuICAgICAgICAgICAgICAgIGlmIChkYXRhKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG91dC5fdG9vbHRpcCkgb3V0Ll90b29sdGlwLm1vdXNlbW92ZShlKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qgc2VsID0gc2VsZWN0KHRoaXMpXHJcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVudEZpbGwgPSBzZWwuc3R5bGUoJ2ZpbGwnKVxyXG4gICAgICAgICAgICAgICAgbGV0IG5ld0ZpbGwgPSBzZWwuYXR0cignZmlsbF9fXycpXHJcbiAgICAgICAgICAgICAgICBpZiAobmV3RmlsbCkge1xyXG4gICAgICAgICAgICAg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AgICAgICAgZC5zY2FsZWRZVmFsdWUgPSAwLjAxXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZFxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgLy8gRHJhdyB0aGUgYXhpc1xyXG4gICAgICAgICAgICBpZiAoaXNGb3JUb29sdGlwKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBBZGQgdGhlIFggQXhpc1xyXG4gICAgICAgICAgICAgICAgbm9kZS5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdheGlzJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyBoZWlnaHQgKyAnKScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmNhbGwoYXhpc0JvdHRvbSh4U2NhbGUpLnRpY2tzKG91dC5fc3RhdERhdGVzLmxlbmd0aCkudGlja0Zvcm1hdChmb3JtYXQoJy4wZicpKSlcclxuICAgICAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCd0ZXh0JylcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ3RleHQtYW5jaG9yJywgJ2VuZCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2R4JywgJy0uOGVtJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignZHknLCAnLjE1ZW0nKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAncm90YXRlKC02NSknKVxyXG5cclxuICAgICAgICAgICAgICAgIC8vIEFkZCB0aGUgWSBBeGlzIGZvciBwb3NpdGl2ZSB2YWx1ZXNcclxuICAgICAgICAgICAgICAgIGNvbnN0IHBvc2l0aXZlVGlja1ZhbHVlc1kgPSBbMV1cclxuICAgICAgICAgICAgICAgIGNvbnN0IG5lZ2F0aXZlVGlja1ZhbHVlc1kgPSBbLTAuNV1cclxuICAgICAgICAgICAgICAgIG5vZGUuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAneS1heGlzLW5lZ2F0aXZlJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgYHRyYW5zbGF0ZSgtMTAsICR7MH0pYCkgLy8gUG9zaXRpb24gZm9yIG5lZ2F0aXZlIGF4aXNcclxuICAgICAgICAgICAgICAgICAgICAuY2FsbChheGlzTGVmdChzY2FsZUxvZ05lZ2F0aXZlKS50aWNrVmFsdWVzKG5lZ2F0aXZlVGlja1ZhbHVlc1kpLnRpY2tGb3JtYXQoZm9ybWF0KCcsLjJyJykpKVxyXG5cclxuICAgICAgICAgICAgICAgIG5vZGUuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAneS1heGlzLXBvc2l0aXZlJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgYHRyYW5zbGF0ZSgkey0xMH0sIDApYClcclxuICAgICAgICAgICAgICAgICAgICAuY2FsbChheGlzTGVmdChzY2FsZUxvZ1Bvc2l0aXZlKS50aWNrVmFsdWVzKHBvc2l0aXZlVGlja1ZhbHVlc1kpLnRpY2tGb3JtYXQoZm9ybWF0KCcsLjJyJykpKVxyXG4gICAgICAgICAgICAgICAgICAgIC8vIE1hbnVhbGx5IGFkZCBhIGN1c3RvbSBsYWJlbCBmb3IgMFxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ2cnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICd0aWNrJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgYHRyYW5zbGF0ZSgwLCAke2hlaWdodCAvIDJ9KWApXHJcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2ZpbGwnLCAnY3VycmVudENvbG9yJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsIC0xMilcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ3RleHQtYW5jaG9yJywgJ21pZGRsZScpXHJcbiAgICAgICAgICAgICAgICAgICAgLnRleHQoJzAnKSAvLyBDdXN0b20gbGFiZWwgZm9yIHNtYWxsIHZhbHVlICgwLjEwKVxyXG5cclxuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKHBvc2l0aXZlVGlja1ZhbHVlc1ksIG5lZ2F0aXZlVGlja1ZhbHVlc1kpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAvLyBSYXcgY291bnRzIChsaW5lYXIgc2NhbGUgZm9yIGJvdGggcG9zaXRpdmUgYW5kIG5lZ2F0aXZlKVxyXG5cclxuICAgICAgICAgICAgY29uc3QgeVNjYWxlID0gc2NhbGVMaW5lYXIoKVxyXG4gICAgICAgICAgICAgICAgLmRvbWFpbihleHQpXHJcbiAgICAgICAgICAgICAgICAucmFuZ2UoW2hlaWdodCAtIDAuNSwgMF0pXHJcblxyXG4gICAgICAgICAgICBzY2FsZWREYXRhID0gZGF0YS5tYXAoKGQpID0+IHtcclxuICAgICAgICAgICAgICAgIGQuc2NhbGVkWFZhbHVlID0geFNjYWxlKGQuZGF0ZSlcclxuICAgICAgICAgICAgICAgIGQuc2NhbGVkWVZhbHVlID0geVNjYWxlKGQudmFsdWUpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZFxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgLy9EcmF3IGF4aXNcclxuICAgICAgICAgICAgaWYgKGlzRm9yVG9vbHRpcCkge1xyXG4gICAgICAgICAgICAgICAgLy8gQWRkIHRoZSBYIEF4aXNcclxuICAgICAgICAgICAgICAgIG5vZGUuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnYXhpcycpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgaGVpZ2h0ICsgJyknKVxyXG4gICAgICAgICAgICAgICAgICAgIC5jYWxsKGF4aXNCb3R0b20oeFNjYWxlKS50aWNrcyhvdXQuX3N0YXREYXRlcy5sZW5ndGgpLnRpY2tGb3JtYXQoZm9ybWF0KCcuMGYnKSkpXHJcbiAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgndGV4dCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCd0ZXh0LWFuY2hvcicsICdlbmQnKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdkeCcsICctLjhlbScpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2R5JywgJy4xNWVtJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3JvdGF0ZSgtNjUpJylcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBBZGQgdGhlIFkgQXhpc1xyXG4gICAgICAgICAgICAgICAgbGV0IGRvbWFpblkgPSB5U2NhbGUuZG9tYWluKClcclxuICAgICAgICAgICAgICAgIGxldCB0aWNrVmFsdWVzID0gW2RvbWFpbllbMF0sICgoZG9tYWluWVswXSArIGRvbWFpbllbMV0pIC8gMikudG9GaXhlZCgxKSwgZG9tYWluWVsxXV1cclxuICAgICAgICAgICAgICAgIG5vZGUuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnYXhpcycpXHJcbiAgICAgICAgICAgICAgICAgICAgLmNhbGwoYXhpc0xlZnQoeVNjYWxlKS50aWNrVmFsdWVzKHRpY2tWYWx1ZXMpLnRpY2tGb3JtYXQoZm9ybWF0KCcsLjJyJykpKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBjb25zdCBsaW5lR2VuZXJhdG9yID0gbGluZSgpXHJcbiAgICAgICAgICAgIC54KChkLCBpKSA9PiBkLnNjYWxlZFhWYWx1ZSlcclxuICAgICAgICAgICAgLnkoKGQpID0+IGQuc2NhbGVkWVZhbHVlKVxyXG5cclxuICAgICAgICAvLyBEcmF3IHRoZSBhcmVhIChmb3IgYXJlYSBjaGFydClcclxuICAgICAgICBpZiAob3V0LnNwYXJrVHlwZV8gPT09ICdhcmVhJykge1xyXG4gICAgICAgICAgICBub2RlLmFwcGVuZCgncGF0aCcpXHJcbiAgICAgICAgICAgICAgICAuZGF0dW0oZGF0YSlcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdmaWxsJywgdHlwZW9mIG91dC5zcGFya0FyZWFDb2xvcl8gPT09ICdmdW5jdGlvbicgPyAoZCwgaSkgPT4gb3V0LnNwYXJrQXJlYUNvbG9yXyhkLCBpKSA6IG91dC5zcGFya0FyZWFDb2xvcl8pXHJcbiAgICAgICAgICAgICAgICAuYXR0cignc3Ryb2tlJywgdHlwZW9mIG91dC5zcGFya0xpbmVDb2xvcl8gPT09ICdmdW5jdGlvbicgPyAoZCwgaSkgPT4gb3V0LnNwYXJrTGluZUNvbG9yXyhkLCBpKSA6IG91dC5zcGFya0xpbmVDb2xvcl8pXHJcbiAgICAgICAgICAgICAgICAuYXR0cihcclxuICAgICAgICAgICAgICAgICAgICAnc3Ryb2tlLXdpZHRoJyxcclxuICAgICAgICAgICAgICAgICAgICB0eXBlb2Ygb3V0LnNwYXJrTGluZVN0cm9rZVdpZHRoXyA9PT0gJ2Z1bmN0aW9uJyA/IChkLCBpKSA9PiBvdXQuc3BhcmtMaW5lU3Ryb2tlV2lkdGhfKGQsIGkpIDogb3V0LnNwYXJrTGluZVN0cm9rZVdpZHRoXyArICdweCdcclxuICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdvcGFjaXR5Jywgb3V0LnNwYXJrTGluZU9wYWNpdHlfKVxyXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2ZpbGwtb3BhY2l0eScsIDAuMylcclxuICAgICAgICAgICAgICAgIC5hdHRyKCdzdHJva2UnLCAnbm9uZScpXHJcbiAgICAgICAgICAgICAgICAuYXR0cihcclxuICAgICAgICAgICAgICAgICAgICAnZCcsXHJcbiAgICAgICAgICAgICAgICAgICAgYXJlYSgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC54KChkLCBpKSA9PiBkLnNjYWxlZFhWYWx1ZSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnkwKGhlaWdodCkgLy8gQmFzZWxpbmVcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnkxKChkKSA9PiBkLnNjYWxlZFlWYWx1ZSlcclxuICAgICAgICAgICAgICAgIClcclxuICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAoZCkgPT4gYHRyYW5zbGF0ZSgwLC0ke2hlaWdodCAvIDJ9KWApXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBEcmF3IHRoZSBsaW5lXHJcbiAgICAgICAgbm9kZS5hcHBlbmQoJ3BhdGgnKVxyXG4gICAgICAgICAgICAuZGF0dW0oc2NhbGVkRGF0YSlcclxuICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgJ25vbmUnKVxyXG4gICAgICAgICAgICAuYXR0cignb3BhY2l0eScsIG91dC5zcGFya0xpbmVPcGFjaXR5XylcclxuICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZScsIHR5cGVvZiBvdXQuc3BhcmtMaW5lQ29sb3JfID09PSAnZnVuY3Rpb24nID8gKGQsIGkpID0+IG91dC5zcGFya0xpbmVDb2xvcl8oZCwgaSkgOiBvdXQuc3BhcmtMaW5lQ29sb3JfKVxyXG4gICAgICAgICAgICAuYXR0cihcclxuICAgICAgICAgICAgICAgICdzdHJva2Utd2lkdGgnLFxyXG4gICAgICAgICAgICAgICAgdHlwZW9mIG91dC5zcGFya0xpbmVTdHJva2VX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SA9IHZcclxuICAgICAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgICAgIH1cclxuICAgIH0pXHJcblxyXG4gICAgLy9vdmVycmlkZSBhdHRyaWJ1dGUgdmFsdWVzIHdpdGggY29uZmlnIHZhbHVlc1xyXG4gICAgaWYgKGNvbmZpZylcclxuICAgICAgICBbXHJcbiAgICAgICAgICAgICdzdHJpcGVXaWR0aCcsXHJcbiAgICAgICAgICAgICdzdHJpcGVPcmllbnRhdGlvbicsXHJcbiAgICAgICAgICAgICdjYXRDb2xvcnMnLFxyXG4gICAgICAgICAgICAnY2F0TGFiZWxzJyxcclxuICAgICAgICAgICAgJ3Nob3dPbmx5V2hlbkNvbXBsZXRlJyxcclxuICAgICAgICAgICAgJ25vRGF0YUZpbGxTdHlsZScsXHJcbiAgICAgICAgICAgICdwaWVDaGFydFJhZGl1cycsXHJcbiAgICAgICAgICAgICdwaWVDaGFydElubmVyUmFkaXVzJyxcclxuICAgICAgICBdLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xyXG4gICAgICAgICAgICBpZiAoY29uZmlnW2tleV0gIT0gdW5kZWZpbmVkKSBvdXRba2V5XShjb25maWdba2V5XSlcclxuICAgICAgICB9KVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogQSBmdW5jdGlvbiB0byBkZWZpbmUgYSBzdHJpcGUgbWFwIGVhc2lseSwgd2l0aG91dCByZXBldGl0aW9uIG9mIGluZm9ybWF0aW9uLlxyXG4gICAgICogT25seSBmb3IgZXVyb2Jhc2UgZGF0YSBzb3VyY2VzLlxyXG4gICAgICpcclxuICAgICAqIEBwYXJhbSB7Kn0gc3RhdCBBIHBhdHRlcm4gZm9yIHRoZSBzdGF0IGRhdGEgc291cmNlXHJcbiAgICAgKiBAcGFyYW0ge1N0cmluZ30gZGltIFRoZSBkaW1lbnNpb24gb2YgdGhlIGNvbXBvc2l0aW9uLlxyXG4gICAgICogQHBhcmFtIHtBcnJheX0gY29kZXMgVGhlIGNhdGVnb3J5IGN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AgICAgICAgICAgICAgIG91dC5jYXRDb2xvcnNfID0gb3V0LmNhdENvbG9yc18gfHwge31cclxuICAgICAgICAgICAgICAgIG91dC5jYXRDb2xvcnNfW2NvZGVdID0gY29sb3JzW2ldXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy9pZiBzcGVjaWZpZWQsIHJldHJpZXZlIGFuZCBhc3NpZ24gbGFiZWxcclxuICAgICAgICAgICAgaWYgKGxhYmVscykge1xyXG4gICAgICAgICAgICAgICAgb3V0LmNhdExhYmVsc18gPSBvdXQuY2F0TGFiZWxzXyB8fCB7fVxyXG4gICAgICAgICAgICAgICAgb3V0LmNhdExhYmVsc19bY29kZV0gPSBsYWJlbHNbaV1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy9zZXQgc3RhdENvZGVzXHJcbiAgICAgICAgc3RhdENvZGVzID0gY29kZXNcclxuXHJcbiAgICAgICAgcmV0dXJuIG91dFxyXG4gICAgfVxyXG5cclxuICAgIC8qKiBUaGUgY29kZXMgb2YgdGhlIGNhdGVnb3JpZXMgdG8gY29uc2lkZXIgZm9yIHRoZSBjb21wb3NpdGlvbi4gKi9cclxuICAgIGxldCBzdGF0Q29kZXMgPSB1bmRlZmluZWRcclxuXHJcbiAgICAvKipcclxuICAgICAqIEZ1bmN0aW9uIHRvIGNvbXB1dGUgY29tcG9zaXRpb24gZm9yIHJlZ2lvbiBpZCwgZm9yIGVhY2ggY2F0ZWdvcnkuXHJcbiAgICAgKiBSZXR1cm4gYW4gb2JqZWN0IHdpdGgsIGZvciBlYWNoIGNhdGVnb3J5LCB0aGUgc2hhcmUgWzAsMV0gb2YgdGhlIGNhdGVnb3J5LlxyXG4gICAgICogQHBhcmFtIHsqfSBpZFxyXG4gICAgICovXHJcbiAgICBjb25zdCBnZXRDb21wb3NpdGlvbiA9IGZ1bmN0aW9uIChpZCkge1xyXG4gICAgICAgIGxldCBjb21wID0ge30sXHJcbiAgICAgICAg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FiZWxzXHJcbiAgICAgICAgb3V0LmNhdExhYmVsc18gPSBvdXQuY2F0TGFiZWxzXyB8fCB7fVxyXG5cclxuICAgICAgICAvL2J1aWxkIGFuZCBhc3NpZ24gdGV4dHVyZSB0byB0aGUgcmVnaW9uc1xyXG4gICAgICAgIG91dC5zdmcoKVxyXG4gICAgICAgICAgICAuc2VsZWN0QWxsKCcjZW0tbnV0c3JnIHBhdGgnKVxyXG4gICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBmdW5jdGlvbiAoZCkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgaWQgPSBkLnByb3BlcnRpZXMuaWRcclxuXHJcbiAgICAgICAgICAgICAgICAvL2NvbXB1dGUgY29tcG9zaXRpb25cclxuICAgICAgICAgICAgICAgIGNvbnN0IGNvbXBvc2l0aW9uID0gZ2V0Q29tcG9zaXRpb24oaWQpXHJcblxyXG4gICAgICAgICAgICAgICAgLy9jYXNlIHdoZW4gbm8gb3IgbWlzc2luZyBkYXRhXHJcbiAgICAgICAgICAgICAgICBpZiAoIWNvbXBvc2l0aW9uKSByZXR1cm4gb3V0Lm5vRGF0YUZpbGxTdHlsZSgpIHx8ICdncmF5J1xyXG5cclxuICAgICAgICAgICAgICAgIC8vbWFrZSBzdHJpcGUgcGF0dGVyblxyXG4gICAgICAgICAgICAgICAgY29uc3QgcGF0dCA9IG91dFxyXG4gICAgICAgICAgICAgICAgICAgIC5zdmcoKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoJ3BhdHRlcm4nKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdwYXR0ZXJuXycgKyBpZClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsICcwJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsICcwJylcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBvdXQuc3RyaXBlV2lkdGgoKSlcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgMSlcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigncGF0dGVyblVuaXRzJywgJ3VzZXJTcGFjZU9uVXNlJylcclxuICAgICAgICAgICAgICAgIC8vdXNlIG9yaWVudGF0aW9uLCBpZiBzcGVjaWZpZWRcclxuICAgICAgICAgICAgICAgIGlmIChvdXQuc3RyaXBlT3JpZW50YXRpb24oKSkgcGF0dC5hdHRyKCdwYXR0ZXJuVHJhbnNmb3JtJywgJ3JvdGF0ZSgnICsgb3V0LnN0cmlwZU9yaWVudGF0aW9uKCkgKyAnKScpXHJcblxyXG4gICAgICAgICAgICAgICAgLy9iYWNrZ3JvdW5kXHJcbiAgICAgICAgICAgICAgICBwYXR0LmFwcGVuZCgncmVjdCcpXHJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCAwKVxyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgMClcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBvdXQuc3RyaXBlV2lkdGgoKSlcclxuICAgICAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgMSlcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsICdub25lJylcclxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCAnbGlnaHRncmF5JylcclxuXHJcbiAgICAgICAgICAgICAgICAvL21ha2Ugc3RyaXBlcywgb25lIHBlciBjYXRlZ29yeVxyXG4gICAgICAgICAgICAgICAgbGV0IHggPSAwXHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBjb2RlIGluIGNvbXBvc2l0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy9nZXQgc3RyaXBlIHNpemVcclxuICAgICAgICAgICAgICAgICAgICBsZXQgZHggPSBjb21wb3NpdGlvbltjb2RlXVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghZHgpIGNvbnRpbnVlXHJcbiAgICAgICAgICAgICAgICAgICAgZHggKj0gb3V0LnN0cmlwZVdpZHRoKClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLy9nZXQgc3RyaXBlIGNvbG9yXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY29sID0gb3V0LmNhdENvbG9ycygpW2NvZGVdIHx8ICdsaWdodGdyYXknXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC8vYWRkIHN0cmlwZSB0byBwYXR0ZXJuOiBhIHRoaW4gcmVjdGFuZ2xlXHJcbiAgICAgICAgICAgICAgICAgICAgcGF0dC5hcHBlbmQoJ3JlY3QnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsIHgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgMClcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIDEpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgJ25vbmUnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignY29kZScsIGNvZGUpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIGNvbClcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy90cmFuc2l0aW9uIGFsb25nIHhcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnRyYW5zaXRpb24oKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuZHVyYXRpb24ob3V0LnRyYW5zaXRpb25EdXJhdGlvbigpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBkeClcclxuICAgICAgICAgICAgICAgICAgICB4ICs9IGR4XHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgLy9yZXR1cm4gcGF0dGVybiByZWZlcmVuY2VcclxuICAgICAgICAgICAgICAgIHJldHVybiAndXJsKCNwYXR0ZXJuXycgKyBpZCArICcp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AgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2Vtb3ZlKGUpXHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBzZWwgPSBzZWxlY3QodGhpcylcclxuICAgICAgICAgICAgICAgIGxldCBjdXJyZW50RmlsbCA9IHNlbC5zdHlsZSgnZmlsbCcpXHJcbiAgICAgICAgICAgICAgICBsZXQgbmV3RmlsbCA9IHNlbC5hdHRyKCdmaWxsX19fJylcclxuICAgICAgICAgICAgICAgIGlmIChuZXdGaWxsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2VsLnN0eWxlKCdmaWxsJywgc2VsLmF0dHIoJ2ZpbGxfX18nKSlcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3V0Ll90b29sdGlwKSBvdXQuX3Rvb2x0aXAubW91c2VvdXQoKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICByZXR1cm4gb3V0XHJcbiAgICB9XHJcblxyXG4gICAgLy9Ab3ZlcnJpZGVcclxuICAgIG91dC5nZXRMZWdlbmRDb25zdHJ1Y3RvciA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICByZXR1cm4gU3RyaXBlQ29tcG9zaXRpb25MZWdlbmQubGVnZW5kXHJcbiAgICB9XHJcblxyXG4gICAgLy9zcGVjaWZpYyB0b29sdGlwIHRleHQgZnVuY3Rpb25cclxuICAgIG91dC50b29sdGlwXy50ZXh0RnVuY3Rpb24gPSBmdW5jdGlvbiAocmcsIG1hcCkge1xyXG4gICAgICAgIC8vZ2V0IHRvb2x0aXBcclxuICAgICAgICBjb25zdCB0cCA9IHNlbGVjdCgnI3Rvb2x0aXBfZXVyb3N0YXQnKVxyXG5cclxuICAgICAgICAvL2NsZWFyXHJcbiAgICAgICAgdHAu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IHIgPSBvdXQucGllQ2hhcnRSYWRpdXMoKSxcclxuICAgICAgICAgICAgaXIgPSBvdXQucGllQ2hhcnRJbm5lclJhZGl1cygpXHJcbiAgICAgICAgY29uc3Qgc3ZnID0gdHBcclxuICAgICAgICAgICAgLmFwcGVuZCgnc3ZnJylcclxuICAgICAgICAgICAgLmF0dHIoJ3ZpZXdCb3gnLCBbLXIsIC1yLCAyICogciwgMiAqIHJdKVxyXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCAyICogcilcclxuXHJcbiAgICAgICAgLy9tYWtlIHBpZSBjaGFydC4gU2VlIGh0dHBzOi8vb2JzZXJ2YWJsZWhxLmNvbS9AZDMvcGllLWNoYXJ0XHJcbiAgICAgICAgY29uc3QgcGllXyA9IHBpZSgpXHJcbiAgICAgICAgICAgIC5zb3J0KG51bGwpXHJcbiAgICAgICAgICAgIC52YWx1ZSgoZCkgPT4gZC52YWx1ZSlcclxuICAgICAgICBzdmcuYXBwZW5kKCdnJylcclxuICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZScsICdkYXJrZ3JheScpXHJcbiAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKVxyXG4gICAgICAgICAgICAuZGF0YShwaWVfKGRhdGEpKVxyXG4gICAgICAgICAgICAuam9pbigncGF0aCcpXHJcbiAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIChkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gb3V0LmNhdENvbG9ycygpW2QuZGF0YS5jb2RlXSB8fCAnbGlnaHRncmF5J1xyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuYXR0cignZCcsIGFyYygpLmlubmVyUmFkaXVzKGlyKS5vdXRlclJhZGl1cyhyKSlcclxuICAgIH1cclxuXHJcbiAgICByZXR1cm4gb3V0XHJcbn1cclxuIiwiaW1wb3J0IHsgc2VsZWN0IH0gZnJvbSAnZDMtc2VsZWN0aW9uJ1xyXG5cclxuLyoqXHJcbiA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WNlIGJ1dCBzaG91bGRudCBiZVxyXG4gICAgICAgIGlmIChub2RlLm9mZnNldExlZnQgPiByZWN0LmxlZnQgKyBwYXJlbnRXaWR0aCAtIG5vZGUuY2xpZW50V2lkdGgpIHtcclxuICAgICAgICAgICAgbGV0IGxlZnQgPSBldmVudFggLSBub2RlLmNsaWVudFdpZHRoIC0gY29uZmlnLnhPZmZzZXRcclxuICAgICAgICAgICAgbm9kZS5zdHlsZS5sZWZ0ID0gbGVmdCArICdweCdcclxuICAgICAgICAgICAgLy8gY2hlY2sgaWYgbW91c2UgY292ZXJzIHRvb2x0aXBcclxuICAgICAgICAgICAgaWYgKG5vZGUub2Zmc2V0TGVmdCArIG5vZGUuY2xpZW50V2lkdGggPiBldmVudFgpIHtcclxuICAgICAgICAgICAgICAgIC8vbW92ZSB0b29sdGlwIGxlZnQgc28gaXQgZG9lc250IGNvdmVyIG1vdXNlXHJcbiAgICAgICAgICAgICAgICBsZXQgbGVmdDIgPSBldmVudFggLSBub2RlLmNsaWVudFdpZHRoIC0gY29uZmlnLnhPZmZzZXRcclxuICAgICAgICAgICAgICAgIG5vZGUuc3R5bGUubGVmdCA9IGxlZnQyICsgJ3B4J1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIG5vZGUuc3R5bGUudG9wID0gbm9kZS5vZmZzZXRUb3AgKyBjb25maWcueU9mZnNldCArIFwicHhcIjtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vdG9vIGZhciBkb3duXHJcbiAgICAgICAgaWYgKG5vZGUub2Zmc2V0VG9wICsgbm9kZS5jbGllbnRIZWlnaHQgPiByZWN0LnRvcCArIHBhcmVudEhlaWdodCkge1xyXG4gICAgICAgICAgICBub2RlLnN0eWxlLnRvcCA9IG5vZGUub2Zmc2V0VG9wIC0gbm9kZS5jbGllbnRIZWlnaHQgKyAncHgnXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIG15KClcclxuICAgIHJldHVybiBteVxyX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lvbiA/IGNvbnRleHQuc2VsZWN0aW9uKCkgOiBjb250ZXh0LFxuICAgICAgICBwYXRoID0gc2VsZWN0aW9uLnNlbGVjdEFsbChcIi5kb21haW5cIikuZGF0YShbbnVsbF0pLFxuICAgICAgICB0aWNrID0gc2VsZWN0aW9uLnNlbGVjdEFsbChcIi50aWNrXCIpLmRhdGEodmFsdWVzLCBzY2FsZSkub3JkZXIoKSxcbiAgICAgICAgdGlja0V4aXQgPSB0aWNrLmV4aXQoKSxcbiAgICAgICAgdGlja0VudGVyID0gdGljay5lbnRlcigpLmFwcGVuZChcImdcIikuYXR0cihcImNsYXNzXCIsIFwidGlja1wiKSxcbiAgICAgICAgbGluZSA9IHRpY2suc2VsZWN0KFwibGluZVwiKSxcbiAgICAgICAgdGV4dCA9IHRpY2suc2VsZWN0KFwidGV4dFwiKTtcblxuICAgIHBhdGggPSBwYXRoLm1lcmdlKHBhdGguZW50ZXIoKS5pbnNlcnQoXCJwYXRoXCIsIFwiLnRpY2tcIilcbiAgICAgICAgLmF0dHIoXCJjbGFzc1wiLCBcImRvbWFpblwiKVxuICAgICAgICAuYXR0cihcInN0cm9rZVwiLCBcImN1cnJlbnRDb2xvclwiKSk7XG5cbiAgICB0aWNrID0gdGljay5tZXJnZSh0aWNrRW50ZXIpO1xuXG4gICAgbGluZSA9IGxpbmUubWVyZ2UodGlja0VudGVyLmFwcGVuZChcImxpbmVcIilcbiAgICAgICAgLmF0dHIoXCJzdHJva2VcIiwgXCJjdXJyZW50Q29sb3JcIilcbiAgICAgICAgLmF0dHIoeCArIFwiMlwiLCBrICogdGlja1NpemVJbm5lcikpO1xuXG4gICAgdGV4dCA9IHRleHQubWVyZ2UodGlja0VudGVyLmFwcGVuZChcInRleHRcIilcbiAgICAgICAgLmF0dHIoXCJmaWxsXCIsIFwiY3VycmVudENvbG9yXCIpXG4gICAgICAgIC5hdHRyKHgsIGsgKiBzcGFjaW5nKVxuICAgICAgICAuYXR0cihcImR5XCIsIG9yaWVudCA9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UgPT09IE1PREVfQ0VOVEVSKSB7XG4gICAgICAgICAgICBpZiAoc2lnblggPCAwKSBlMCA9IGUxIC0gZHg7IGVsc2UgaWYgKHNpZ25YID4gMCkgdzAgPSB3MSAtIGR4O1xuICAgICAgICAgICAgaWYgKHNpZ25ZIDwgMCkgczAgPSBzMSAtIGR5OyBlbHNlIGlmIChzaWduWSA+IDApIG4wID0gbjEgLSBkeTtcbiAgICAgICAgICAgIG1vZGUgPSBNT0RFX1NQQUNFO1xuICAgICAgICAgICAgb3ZlcmxheS5hdHRyKFwiY3Vyc29yXCIsIGN1cnNvcnMuc2VsZWN0aW9uKTtcbiAgICAgICAgICAgIG1vdmUoZXZlbnQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBkZWZhdWx0OiByZXR1cm47XG4gICAgICB9XG4gICAgICBub2V2ZW50KGV2ZW50KTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBrZXl1cHBlZChldmVudCkge1xuICAgICAgc3dpdGNoIChldmVudC5rZXlDb2RlKSB7XG4gICAgICAgIGNhc2UgMTY6IHsgLy8gU0hJRlRcbiAgICAgICAgICBpZiAoc2hpZnRpbmcpIHtcbiAgICAgICAgICAgIGxvY2tYID0gbG9ja1kgPSBzaGlmdGluZyA9IGZhbHNlO1xuICAgICAgICAgICAgbW92ZShldmVudCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGNhc2UgMTg6IHsgLy8gQUxUXG4gICAgICAgICAgaWYgKG1vZGUgPT09IE1PREVfQ0VOVEVSKSB7XG4gICAgICAgICAgICBpZiAoc2lnblggPCAwKSBlMCA9IGUxOyBlbHNlIGlmIChzaWduWCA+IDApIHcwID0gdzE7XG4gICAgICAgICAgICBpZiAoc2lnblkgPCAwKSBzMCA9IHMxOyBlbHNlIGlmIChzaWduWSA+IDApIG4wID0gbjE7XG4gICAgICAgICAgICBtb2RlID0gTU9ERV9IQU5ETEU7XG4gICAgICAgICAgICBtb3ZlKGV2ZW50KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgY2FzZSAzMjogeyAvLyBTUEFDRVxuICAgICAgICAgIGlmIChtb2RlID09PSBNT0RFX1NQQUNFKSB7XG4gICAgICAgICAgICBpZiAoZXZlbnQuYWx0S2V5KSB7XG4gICAgICAgICAgICAgIGlmIChzaWduWCkgZTAgPSBlMSAtIGR4ICogc2lnblgsIHcwID0gdzEgKyBkeCAqIHNpZ25YO1xuICAgICAgICAgICAgICBpZiAoc2lnblkpIHMwID0gczEgLSBkeSAqIHNpZ25ZLCBuMCA9IG4xICsgZHkgKiBzaWduWTtcbiAgICAgICAgICAgICAgbW9kZSA9IE1PREVfQ0VOVEVSO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaWYgKHNpZ25YIDwgMCkgZTAgPSBlMTsgZWxzZSBpZiAoc2lnblggPiAwKSB3MCA9IHcxO1xuICAgICAgICAgICAgICBpZiAoc2lnblkgPCAwKSBzMCA9IHMxOyBlbHNlIGlmIChzaWduWSA+IDApIG4wID0gbjE7XG4gICAgICAgICAgICAgIG1vZGUgPSBNT0RFX0hBTkRMRTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG92ZXJsYXkuYXR0cihcImN1cnNvclwiLCBjdXJzb3JzW3R5cGVdKTtcbiAgICAgICAgICAgIG1vdmUoZXZlbnQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBkZWZhdWx0OiByZXR1cm47XG4gICAgICB9XG4gICAgICBub2V2ZW50KGV2ZW50KTtcbiAgICB9XG4gIH1cblxuICBmdW5jdGlvbiB0b3VjaG1vdmVkKGV2ZW50KSB7XG4gICAgZW1pdHRlcih0aGlzLCBhcmd1bWVudHMpLm1vdmVkKGV2ZW50KTtcbiAgfVxuXG4gIGZ1bmN0aW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TogbnVsbCwgdGFyZ2V0OiBudWxsfSk7XG4gICAgICAgICAgICAgIGNob3JkLnNvdXJjZSA9IHtpbmRleDogaSwgc3RhcnRBbmdsZTogeCwgZW5kQW5nbGU6IHggKz0gbWF0cml4W2kgKiBuICsgal0gKiBrLCB2YWx1ZTogbWF0cml4W2kgKiBuICsgal19O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgY2hvcmQgPSBjaG9yZHNbaiAqIG4gKyBpXSB8fCAoY2hvcmRzW2ogKiBuICsgaV0gPSB7c291cmNlOiBudWxsLCB0YXJnZXQ6IG51bGx9KTtcbiAgICAgICAgICAgICAgY2hvcmQudGFyZ2V0ID0ge2luZGV4OiBpLCBzdGFydEFuZ2xlOiB4LCBlbmRBbmdsZTogeCArPSBtYXRyaXhbaSAqIG4gKyBqXSAqIGssIHZhbHVlOiBtYXRyaXhbaSAqIG4gKyBqXX07XG4gICAgICAgICAgICAgIGlmIChpID09PSBqKSBjaG9yZC5zb3VyY2UgPSBjaG9yZC50YXJnZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY2hvcmQuc291cmNlICYmIGNob3JkLnRhcmdldCAmJiBjaG9yZC5zb3VyY2UudmFsdWUgPCBjaG9yZC50YXJnZXQudmFsdWUpIHtcbiAgICAgICAgICAgICAgY29uc3Qgc291cmNlID0gY2hvcmQuc291cmNlO1xuICAgICAgICAgICAgICBjaG9yZC5zb3VyY2UgPSBjaG9yZC50YXJnZXQ7XG4gICAgICAgICAgICAgIGNob3JkLnRhcmdldCA9IHNvdXJjZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZ3JvdXBzW2ldID0ge2luZGV4OiBpLCBzdGFydEFuZ2xlOiB4MCwgZW5kQW5nbGU6IHgsIHZhbHVlOiBncm91cFN1bXNbaV19O1xuICAgICAgICB9XG4gICAgICAgIHggKz0gZHg7XG4gICAgICB9XG4gICAgfVxuXG4gICAgLy8gUmVtb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lvblwiKSByYWRpdXMgPSBjb25zdGFudChyYWRpdXMgPT0gbnVsbCA/IDEgOiArcmFkaXVzKTtcblxuICBmdW5jdGlvbiBmb3JjZSgpIHtcbiAgICB2YXIgaSwgbiA9IG5vZGVzLmxlbmd0aCxcbiAgICAgICAgdHJlZSxcbiAgICAgICAgbm9kZSxcbiAgICAgICAgeGksXG4gICAgICAgIHlpLFxuICAgICAgICByaSxcbiAgICAgICAgcmkyO1xuXG4gICAgZm9yICh2YXIgayA9IDA7IGsgPCBpdGVyYXRpb25zOyArK2spIHtcbiAgICAgIHRyZWUgPSBxdWFkdHJlZShub2RlcywgeCwgeSkudmlzaXRBZnRlcihwcmVwYXJlKTtcbiAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgbm9kZSA9IG5vZGVzW2ldO1xuICAgICAgICByaSA9IHJhZGlpW25vZGUuaW5kZXhdLCByaTIgPSByaSAqIHJpO1xuICAgICAgICB4aSA9IG5vZGUueCArIG5vZGUudng7XG4gICAgICAgIHlpID0gbm9kZS55ICsgbm9kZS52eTtcbiAgICAgICAgdHJlZS52aXNpdChhcHBseSk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gYXBwbHkocXVhZCwgeDAsIHkwLCB4MSwgeTEpIHtcbiAgICAgIHZhciBkYXRhID0gcXVhZC5kYXRhLCByaiA9IHF1YWQuciwgciA9IHJpICsgcmo7XG4gICAgICBpZiAoZGF0YSkge1xuICAgICAgICBpZiAoZGF0YS5pbmRleCA+IG5vZGUuaW5kZXgpIHtcbiAgICAgICAgICB2YXIgeCA9IHhpIC0gZGF0YS54IC0gZGF0YS52eCxcbiAgICAgICAgICAgICAgeSA9IHlpIC0gZGF0YS55IC0gZGF0YS52eSxcbiAgICAgICAgICAgICAgbCA9IHggKiB4ICsgeSAqIHk7XG4gICAgICAgICAgaWYgKGwgPCByICogcikge1xuICAgICAgICAgICAgaWYgKHggPT09IDApIHggPSBqaWdnbGUocmFuZG9tKSwgbCArPSB4ICogeDtcbiAgICAgICAgICAgIGlmICh5ID09PSAwKSB5ID0gamlnZ2xlKHJhbmRvbSksIGwgKz0geSAqIHk7XG4gICAgICAgICAgICBsID0gKHIgLSAobCA9IE1hdGguc3FydChsKSkpIC8gbCAqIHN0cmVuZ3RoO1xuICAgICAgICAgICAgbm9kZS52eCArPSAoeCAqPSBsKSAqIChyID0gKHJqICo9IHJqKSAvIChyaTIgKyByaikpO1xuICAgICAgICAgICAgbm9kZS52eSArPSAoeSAqPSBsKSAqIHI7XG4gICAgICAgICAgICBkYXRhLnZ4IC09IHggKiAociA9IDEgLSByKTtcbiAgICAgICAgICAgIGRhdGEudnkgLT0geSAqIHI7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIHJldHVybiB4MCA+IHhpICsgciB8fCB4MSA8IHhpIC0gciB8fCB5MCA+IHlpICsgciB8fCB5MSA8IHlpIC0gcjtcbiAgICB9XG4gIH1cblxuICBmdW5jdGlvbiBwcmVwYXJlKHF1YWQpIHtcbiAgICBpZiAocXVhZC5kYXRhKSByZXR1cm4gcXVhZC5yID0gcmFkaWlbcXVhZC5kYXRhLmluZGV4XTtcbiAgICBmb3IgKHZhciBpID0gcXVhZC5yID0gMDsgaSA8IDQ7ICsraSkge1xuICAgICAgaWYgKHF1YWRbaV0gJiYgcXVhZFtpXS5yID4gcXVhZC5yKSB7XG4gICAgICAgIHF1YWQuciA9IHF1YWRbaV0ucjtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBmdW5jdGlvbiBpbml0aWFsaXplKCkge1xuICAgIGlmICghbm9kZXMpIHJldHVybjtcbiAgICB2YXIgaSwgbiA9IG5vZGVzLmxlbmd0aCwgbm9kZTtcbiAgICByYWRpaSA9IG5ldyBBcnJheShuKTtcbiAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSBub2RlID0gbm9kZXNbaV0sIHJhZGlpW25vZGUuaW5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SkpLCBzaW11bGF0aW9uKSA6IGZvcmNlcy5nZXQobmFtZSk7XG4gICAgfSxcblxuICAgIGZpbmQ6IGZ1bmN0aW9uKHgsIHksIHJhZGl1cykge1xuICAgICAgdmFyIGkgPSAwLFxuICAgICAgICAgIG4gPSBub2Rlcy5sZW5ndGgsXG4gICAgICAgICAgZHgsXG4gICAgICAgICAgZHksXG4gICAgICAgICAgZDIsXG4gICAgICAgICAgbm9kZSxcbiAgICAgICAgICBjbG9zZXN0O1xuXG4gICAgICBpZiAocmFkaXVzID09IG51bGwpIHJhZGl1cyA9IEluZmluaXR5O1xuICAgICAgZWxzZSByYWRpdXMgKj0gcmFkaXVzO1xuXG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgIG5vZGUgPSBub2Rlc1tpXTtcbiAgICAgICAgZHggPSB4IC0gbm9kZS54O1xuICAgICAgICBkeSA9IHkgLSBub2RlLnk7XG4gICAgICAgIGQyID0gZHggKiBkeCArIGR5ICogZHk7XG4gICAgICAgIGlmIChkMiA8IHJhZGl1cykgY2xvc2VzdCA9IG5vZGUsIHJhZGl1cyA9IGQyO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gY2xvc2VzdDtcbiAgICB9LFxuXG4gICAgb246IGZ1bmN0aW9uKG5hbWUsIF8pIHtcbiAgICAgIHJldHVybiBhcmd1bWVudHMubGVuZ3RoID4gMSA/IChldmVudC5vbihuYW1lLCBfKSwgc2ltdWxhdGlvbikgOiBldmVudC5vbihuYW1lKTtcbiAgICB9XG4gIH07XG59XG4iLCJpbXBvcnQgY29uc3RhbnQgZnJvbSBcIi4vY29uc3RhbnQuanNcIjtcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oeCkge1xuICB2YXIgc3RyZW5ndGggPSBjb25zdGFudCgwLjEpLFxuICAgICAgbm9kZXMsXG4gICAgICBzdHJlbmd0aHMsXG4gICAgICB4ejtcblxuICBpZiAodHlwZW9mIHggIT09IFwiZnVuY3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MSwgcjIxID0gcjIgLSByMSxcbiAgICAgIGwgPSBNYXRoLnNxcnQoeDIxICogeDIxICsgeTIxICogeTIxKTtcbiAgcmV0dXJuIHtcbiAgICB4OiAoeDEgKyB4MiArIHgyMSAvIGwgKiByMjEpIC8gMixcbiAgICB5OiAoeTEgKyB5MiArIHkyMSAvIGwgKiByMjEpIC8gMixcbiAgICByOiAobCArIHIxICsgcjIpIC8gMlxuICB9O1xufVxuXG5mdW5jdGlvbiBlbmNsb3NlQmFzaXMzKGEsIGIsIGMpIHtcbiAgdmFyIHgxID0gYS54LCB5MSA9IGEueSwgcjEgPSBhLnIsXG4gICAgICB4MiA9IGIueCwgeTIgPSBiLnksIHIyID0gYi5yLFxuICAgICAgeDMgPSBjLngsIHkzID0gYy55LCByMyA9IGMucixcbiAgICAgIGEyID0geDEgLSB4MixcbiAgICAgIGEzID0geDEgLSB4MyxcbiAgICAgIGIyID0geTEgLSB5MixcbiAgICAgIGIzID0geTEgLSB5MyxcbiAgICAgIGMyID0gcjIgLSByMSxcbiAgICAgIGMzID0gcjMgLSByMSxcbiAgICAgIGQxID0geDEgKiB4MSArIHkxICogeTEgLSByMSAqIHIxLFxuICAgICAgZDIgPSBkMSAtIHgyICogeDIgLSB5MiAqIHkyICsgcjIgKiByMixcbiAgICAgIGQzID0gZDEgLSB4MyAqIHgzIC0geTMgKiB5MyArIHIzICogcjMsXG4gICAgICBhYiA9IGEzICogYjIgLSBhMiAqIGIzLFxuICAgICAgeGEgPSAoYjIgKiBkMyAtIGIzICogZDIpIC8gKGFiICogMikgLSB4MSxcbiAgICAgIHhiID0gKGIzICogYzIgLSBiMiAqIGMzKSAvIGFiLFxuICAgICAgeWEgPSAoYTMgKiBkMiAtIGEyICogZDMpIC8gKGFiICogMikgLSB5MSxcbiAgICAgIHliID0gKGEyICogYzMgLSBhMyAqIGMyKSAvIGFiLFxuICAgICAgQSA9IHhiICogeGIgKyB5YiAqIHliIC0gMSxcbiAgICAgIEIgPSAyICogKHIxICs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GNpcmNsZXMsIGxjZygpKTtcbiAgcmV0dXJuIGNpcmNsZXM7XG59XG4iLCJpbXBvcnQgcm91bmROb2RlIGZyb20gXCIuL3RyZWVtYXAvcm91bmQuanNcIjtcbmltcG9ydCB0cmVlbWFwRGljZSBmcm9tIFwiLi90cmVlbWFwL2RpY2UuanNcIjtcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oKSB7XG4gIHZhciBkeCA9IDEsXG4gICAgICBkeSA9IDEsXG4gICAgICBwYWRkaW5nID0gMCxcbiAgICAgIHJvdW5kID0gZmFsc2U7XG5cbiAgZnVuY3Rpb24gcGFydGl0aW9uKHJvb3QpIHtcbiAgICB2YXIgbiA9IHJvb3QuaGVpZ2h0ICsgMTtcbiAgICByb290LngwID1cbiAgICByb290LnkwID0gcGFkZGluZztcbiAgICByb290LngxID0gZHg7XG4gICAgcm9vdC55MSA9IGR5IC8gbjtcbiAgICByb290LmVhY2hCZWZvcmUocG9zaXRpb25Ob2RlKGR5LCBuKSk7XG4gICAgaWYgKHJvdW5kKSByb290LmVhY2hCZWZvcmUocm91bmROb2RlKTtcbiAgICByZXR1cm4gcm9vdDtcbiAgfVxuXG4gIGZ1bmN0aW9uIHBvc2l0aW9uTm9kZShkeSwgbikge1xuICAgIHJldHVybiBmdW5jdGlvbihub2RlKSB7XG4gICAgICBpZiAobm9kZS5jaGlsZHJlbikge1xuICAgICAgICB0cmVlbWFwRGljZShub2RlLCBub2RlLngwLCBkeSAqIChub2RlLmRlcHRoICsgMSkgLyBuLCBub2RlLngxLCBkeSAqIChub2RlLmRlcHRoICsgMikgLyBuKTtcbiAgICAgIH1cbiAgICAgIHZhciB4MCA9IG5vZGUueDAsXG4gICAgICAgICAgeTAgPSBub2RlLnkwLFxuICAgICAgICAgIHgxID0gbm9kZS54MSAtIHBhZGRpbmcsXG4gICAgICAgICAgeTEgPSBub2RlLnkxIC0gcGFkZGluZztcbiAgICAgIGlmICh4MSA8IHgwKSB4MCA9IHgxID0gKHgw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bHQgZnVuY3Rpb24oKSB7XG4gIHZhciBpZCA9IGRlZmF1bHRJZCxcbiAgICAgIHBhcmVudElkID0gZGVmYXVsdFBhcmVudElkLFxuICAgICAgcGF0aDtcblxuICBmdW5jdGlvbiBzdHJhdGlmeShkYXRhKSB7XG4gICAgdmFyIG5vZGVzID0gQXJyYXkuZnJvbShkYXRhKSxcbiAgICAgICAgY3VycmVudElkID0gaWQsXG4gICAgICAgIGN1cnJlbnRQYXJlbnRJZCA9IHBhcmVudElkLFxuICAgICAgICBuLFxuICAgICAgICBkLFxuICAgICAgICBpLFxuICAgICAgICByb290LFxuICAgICAgICBwYXJlbnQsXG4gICAgICAgIG5vZGUsXG4gICAgICAgIG5vZGVJZCxcbiAgICAgICAgbm9kZUtleSxcbiAgICAgICAgbm9kZUJ5S2V5ID0gbmV3IE1hcDtcblxuICAgIGlmIChwYXRoICE9IG51bGwpIHtcbiAgICAgIGNvbnN0IEkgPSBub2Rlcy5tYXAoKGQsIGkpID0+IG5vcm1hbGl6ZShwYXRoKGQsIGksIGRhdGEpKSk7XG4gICAgICBjb25zdCBQID0gSS5tYXAocGFyZW50b2YpO1xuICAgICAgY29uc3QgUyA9IG5ldyBTZXQoSSkuYWRkKFwiXCIpO1xuICAgICAgZm9yIChjb25zdCBpIG9mIFApIHtcbiAgICAgICAgaWYgKCFTLmhhcyhpKSkge1xuICAgICAgICAgIFMuYWRkKGkpO1xuICAgICAgICAgIEkucHVzaChpKTtcbiAgICAgICAgICBQLnB1c2gocGFyZW50b2YoaSkpO1xuICAgICAgICAgIG5vZGVzLnB1c2goaW1wdXRlZCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGN1cnJlbnRJZCA9IChfLCBpKSA9PiBJW2ldO1xuICAgICAgY3VycmVudFBhcmVudElkID0gKF8sIGkpID0+IFBbaV07XG4gICAgfVxuXG4gICAgZm9yIChpID0gMCwgbiA9IG5vZGVzLmxlbmd0aDsgaSA8IG47ICsraSkge1xuICAgICAgZCA9IG5vZGVzW2ldLCBub2RlID0gbm9kZXNbaV0gPSBuZXcgTm9kZShkKTtcbiAgICAgIGlmICgobm9kZUlkID0gY3VycmVudElkKGQsIGksIGRhdGEpKSAhPSBudWxsICYmIChub2RlSWQgKz0gXCJcIikpIHtcbiAgICAgICAgbm9kZUtleSA9IG5vZGUuaWQgPSBub2RlSWQ7XG4gICAgICAgIG5vZGVCeUtleS5zZXQobm9kZUtleSwgbm9kZUJ5S2V5Lmhhcyhub2RlS2V5KSA/IGFtYmlndW91cyA6IG5vZGUpO1xuICAgICAgfVxuICAgICAgaWYgKChub2RlSWQgPSBjdXJyZW50UGFyZW50SWQoZCwgaSwgZGF0YSkpICE9IG51bGwgJiYgKG5vZGVJZCArPSBcIlwiKSkge1xuICAgICAgICBub2RlLnBhcmVudCA9IG5vZGVJZDtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICBub2RlID0gbm9kZXNbaV07XG4gICAgICBpZiAobm9kZUlkID0gbm9kZS5wYXJlbnQpIHtcbiAgICAgICAgcGFyZW50ID0gbm9kZUJ5S2V5LmdldChub2RlSWQpO1xuICAgICAgICBpZiAoIXBhcmVudCkgdGhyb3cgbmV3IEVycm9yKFwibWlzc2luZzogXCIgKyBub2RlSWQpO1xuICAgICAgICBpZiAocGFyZW50ID09PSBhbWJpZ3VvdXMpIHRocm93IG5ldyBFcnJvcihcImFtYmlndW91czogXCIgKyBub2RlSWQpO1xuICAgICAgICBpZiAocGFyZW50LmNoaWxkcmVuKSBwYXJlbnQuY2hpbGRyZW4ucHVzaChub2RlKTtcbiAgICAgICAgZWxzZSBwYXJlbnQuY2hpbGRyZW4gPSBbbm9kZV07XG4gICAgICAgIG5vZGUucGFyZW50ID0gcGFyZW50O1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKHJvb3QpIHRocm93IG5ldyBFcnJvcihcIm11bHRpcGxlIHJvb3RzXCIpO1xuICAgICAg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HBvcnRpb24odiwgdywgYW5jZXN0b3IpIHtcbiAgICBpZiAodykge1xuICAgICAgdmFyIHZpcCA9IHYsXG4gICAgICAgICAgdm9wID0gdixcbiAgICAgICAgICB2aW0gPSB3LFxuICAgICAgICAgIHZvbSA9IHZpcC5wYXJlbnQuY2hpbGRyZW5bMF0sXG4gICAgICAgICAgc2lwID0gdmlwLm0sXG4gICAgICAgICAgc29wID0gdm9wLm0sXG4gICAgICAgICAgc2ltID0gdmltLm0sXG4gICAgICAgICAgc29tID0gdm9tLm0sXG4gICAgICAgICAgc2hpZnQ7XG4gICAgICB3aGlsZSAodmltID0gbmV4dFJpZ2h0KHZpbSksIHZpcCA9IG5leHRMZWZ0KHZpcCksIHZpbSAmJiB2aXApIHtcbiAgICAgICAgdm9tID0gbmV4dExlZnQodm9tKTtcbiAgICAgICAgdm9wID0gbmV4dFJpZ2h0KHZvcCk7XG4gICAgICAgIHZvcC5hID0gdjtcbiAgICAgICAgc2hpZnQgPSB2aW0ueiArIHNpbSAtIHZpcC56IC0gc2lwICsgc2VwYXJhdGlvbih2aW0uXywgdmlwLl8pO1xuICAgICAgICBpZiAoc2hpZnQgPiAwKSB7XG4gICAgICAgICAgbW92ZVN1YnRyZWUobmV4dEFuY2VzdG9yKHZpbSwgdiwgYW5jZXN0b3IpLCB2LCBzaGlmdCk7XG4gICAgICAgICAgc2lwICs9IHNoaWZ0O1xuICAgICAgICAgIHNvcCArPSBzaGlmdDtcbiAgICAgICAgfVxuICAgICAgICBzaW0gKz0gdmltLm07XG4gICAgICAgIHNpcCArPSB2aXAubTtcbiAgICAgICAgc29tICs9IHZvbS5tO1xuICAgICAgICBzb3AgKz0gdm9wLm07XG4gICAgICB9XG4gICAgICBpZiAodmltICYmICFuZXh0UmlnaHQodm9wKSkge1xuICAgICAgICB2b3AudCA9IHZpbTtcbiAgICAgICAgdm9wLm0gKz0gc2ltIC0gc29wO1xuICAgICAgfVxuICAgICAgaWYgKHZpcCAmJiAhbmV4dExlZnQodm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aG8sIHJobzIsIHJobzQpIHtcblxuICAvLyBwMCA9IFt1eDAsIHV5MCwgdzBdXG4gIC8vIHAxID0gW3V4MSwgdXkxLCB3MV1cbiAgZnVuY3Rpb24gem9vbShwMCwgcDEpIHtcbiAgICB2YXIgdXgwID0gcDBbMF0sIHV5MCA9IHAwWzFdLCB3MCA9IHAwWzJdLFxuICAgICAgICB1eDEgPSBwMVswXSwgdXkxID0gcDFbMV0sIHcxID0gcDFbMl0sXG4gICAgICAgIGR4ID0gdXgxIC0gdXgwLFxuICAgICAgICBkeSA9IHV5MSAtIHV5MCxcbiAgICAgICAgZDIgPSBkeCAqIGR4ICsgZHkgKiBkeSxcbiAgICAgICAgaSxcbiAgICAgICAgUztcblxuICAgIC8vIFNwZWNpYWwgY2FzZSBmb3IgdTAg4omFIHUxLlxuICAgIGlmIChkMiA8IGVwc2lsb24yKSB7XG4gICAgICBTID0gTWF0aC5sb2codzEgLyB3MCkgLyByaG87XG4gICAgICBpID0gZnVuY3Rpb24odCkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgIHV4MCArIHQgKiBkeCxcbiAgICAgICAgICB1eTAgKyB0ICogZHksXG4gICAgICAgICAgdzAgKiBNYXRoLmV4cChyaG8gKiB0ICogUylcbiAgICAgICAgXTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBHZW5lcmFsIGNhc2UuXG4gICAgZWxzZSB7XG4gICAgICB2YXIgZDEgPSBNYXRoLnNxcnQoZDIpLFxuICAgICAgICAgIGIwID0gKHcxICogdzEgLSB3MCAqIHcwICsgcmhvNCAqIGQyKSAvICgyICogdzAgKiByaG8yICogZDEpLFxuICAgICAgICAgIGIxID0gKHcxICogdzEgLSB3MCAqIHcwIC0gcmhvNCAqIGQyKSAvICgyICogdzEgKiByaG8yICogZDEpLFxuICAgICAgICAgIHIwID0gTWF0aC5sb2coTWF0aC5zcXJ0KGIwICogYjAgKyAxKSAtIGIwKSxcbiAgICAgICAgICByMSA9IE1hdGgubG9n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IFwiLi9kZWZhdWx0U291cmNlLmpzXCI7XG5pbXBvcnQgYmV0YSBmcm9tIFwiLi9iZXRhLmpzXCI7XG5pbXBvcnQgZ2VvbWV0cmljIGZyb20gXCIuL2dlb21ldHJpYy5qc1wiO1xuXG5leHBvcnQgZGVmYXVsdCAoZnVuY3Rpb24gc291cmNlUmFuZG9tQmlub21pYWwoc291cmNlKSB7XG4gIHZhciBHID0gZ2VvbWV0cmljLnNvdXJjZShzb3VyY2UpLFxuICAgICAgQiA9IGJldGEuc291cmNlKHNvdXJjZSk7XG5cbiAgZnVuY3Rpb24gcmFuZG9tQmlub21pYWwobiwgcCkge1xuICAgIG4gPSArbjtcbiAgICBpZiAoKHAgPSArcCkgPj0gMSkgcmV0dXJuICgpID0+IG47XG4gICAgaWYgKHAgPD0gMCkgcmV0dXJuICgpID0+IDA7XG4gICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgdmFyIGFjYyA9IDAsIG5uID0gbiwgcHAgPSBwO1xuICAgICAgd2hpbGUgKG5uICogcHAgPiAxNiAmJiBubiAqICgxIC0gcHApID4gMTYpIHtcbiAgICAgICAgdmFyIGkgPSBNYXRoLmZsb29yKChubiArIDEpICogcHApLFxuICAgICAgICAgICAgeSA9IEIoaSwgbm4gLSBpICsgMSkoKTtcbiAgICAgICAgaWYgKHkgPD0gcHApIHtcbiAgICAgICAgICBhY2MgKz0gaTtcbiAgICAgICAgICBubiAtPSBpO1xuICAgICAgICAgIHBwID0gKHBwIC0geSkgLyAoMSAtIHkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG5uID0gaSAtIDE7XG4gICAgICAgICAgcHAgLz0geTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIHNpZ24gPSBwcCA8IDAuNSxcbiAgICAgICAgICBwRmluYWwgPSBzaWduID8gcHAgOiAxIC0gcHAsXG4gICAgICAgICAgZyA9IEcocEZpbmFsKTtcbiAgICAgIGZvciAodmFyIHMgPSBnKCksI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jEgPCByMCkgciA9IHIxLCByMSA9IHIwLCByMCA9IHI7XG5cbiAgICAvLyBJcyBpdCBhIHBvaW50P1xuICAgIGlmICghKHIxID4gZXBzaWxvbikpIGNvbnRleHQubW92ZVRvKDAsIDApO1xuXG4gICAgLy8gT3IgaXMgaXQgYSBjaXJjbGUgb3IgYW5udWx1cz9cbiAgICBlbHNlIGlmIChkYSA+IHRhdSAtIGVwc2lsb24pIHtcbiAgICAgIGNvbnRleHQubW92ZVRvKHIxICogY29zKGEwKSwgcjEgKiBzaW4oYTApKTtcbiAgICAgIGNvbnRleHQuYXJjKDAsIDAsIHIxLCBhMCwgYTEsICFjdyk7XG4gICAgICBpZiAocjAgPiBlcHNpbG9uKSB7XG4gICAgICAgIGNvbnRleHQubW92ZVRvKHIwICogY29zKGExKSwgcjAgKiBzaW4oYTEpKTtcbiAgICAgICAgY29udGV4dC5hcmMoMCwgMCwgcjAsIGExLCBhMCwgY3cpO1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIE9yIGlzIGl0IGEgY2lyY3VsYXIgb3IgYW5udWxhciBzZWN0b3I/XG4gICAgZWxzZSB7XG4gICAgICB2YXIgYTAxID0gYTAsXG4gICAgICAgICAgYTExID0gYTEsXG4gICAgICAgICAgYTAwID0gYTAsXG4gICAgICAgICAgYTEwID0gYTEsXG4gICAgICAgICAgZGEwID0gZGEsXG4gICAgICAgICAgZGExID0gZGEsXG4gICAgICAgICAgYXAgPSBwYWRBbmdsZS5hcHBseSh0aGlzLCBhcmd1bWVudHMpIC8gMixcbiAgICAgICAgICBycCA9IChhcCA+IGVwc2lsb24pICYmIChwYWRSYWRpdXMgPyArcGFkUmFkaXVzLmFwcGx5KHRoaXMsIGFyZ3VtZW50cykgOiBzcXJ0KHIwICogcjAgKyByMSAqIHIxKSksXG4gICAgICAgICAgcmMgPSBtaW4oYWJzKHIxIC0gcjApIC8gMiwgK2Nvcm5lclJhZGl1cy5hcHBseSh0aGlzLCBhcmd1bWVudHMpKSxcbiAgICAgICAgICByYzAgPSByYyxcbiAgICAgICAgICByYzEgPSByYyxcbiAgICAgICAgICB0MCxcbiAgICAgICAgICB0MTtcblxuICAgICAgLy8gQXBwbHkgcGFkZGluZz8gTm90ZSB0aGF0IHNpbmNlIHIxIOKJpSByMCwgZGExIOKJpSBkYTAuXG4gICAgICBpZiAocnAgPiBlcHNpbG9uKSB7XG4gICAgICAgIHZhciBwMCA9IGFzaW4ocnAgLyByMCAqIHNpbihhcCkpLFxuICAgICAgICAgICAgcDEgPSBhc2luKHJwIC8gcjEgKiBzaW4oYXApKTtcbiAgICAgICAgaWYgKChkYTAgLT0gcDAgKiAyKSA+IGVwc2lsb24pIHAwICo9IChjdyA/IDEgOiAtMSksIGEwMCArPSBwMCwgYTEwIC09IHAwO1xuICAgICAgICBlbHNlIGRhMCA9IDAsIGEwMCA9IGExMCA9IChhMCArIGExKSAvIDI7XG4gICAgICAgIGlmICgoZGExIC09IHAxICogMikgPiBlcHNpbG9uKSBwMSAqPSAoY3cgPyAxIDogLTEpLCBhMDEgKz0gcDEsIGExMSAtPSBwMTtcbiAgICAgICAgZWxzZSBkYTEgPSAwLCBhMDEgPSBhMTEgPSAoYTAgKyBhMSkgLyAyO1xuICAgICAgfVxuXG4gICAgICB2YXIgeDAxID0gcjEgKiBjb3MoYTAxKSxcbiAgICAgICAgICB5MDEgPSByMSAqIHNpbihhMDEpLFxuICAgICAgICAgIHgxMCA9IHIwICogY29zKGExMCksXG4gICAgICAgICAgeTEwID0gcjAgKiBzaW4oYTEwKTtcblxuICAgICAgLy8gQXBwbHkgcm91bmRlZCBjb3JuZXJzP1xuICAgICAgaWYgKHJjID4gZXBzaWxvbikge1xuICAgICAgICB2YXIgeDExID0gcjEgKiBjb3MoYTExKSxcbiAgICAgICAgICAgIHkxMSA9IHIxICogc2luKGExMSksXG4gICAgICAgICAgICB4MDAgPSByMCAqIGNvcyhhMDApLFxuICAgICAgICAgICAgeTAwID0gcjAgKiBzaW4oYTAwKSxcbiAgICAgICAgICAgIG9jO1xuXG4gICAgICAgIC8vIFJlc3RyaWN0IHRoZSBjb3JuZXIgcmFkaXVzIGFjY29yZGluZyB0byB0aGUgc2VjdG9yIGFuZ2xlLiBJZiB0aGlzXG4gICAgICAgIC8vIGludGVyc2VjdGlvbiBmYWlscywgaXTigJlzIHByb2JhYmx5IGJlY2F1c2UgdGhlIGFyYyBpcyB0b28gc21hbGwsIHNvXG4gICAgICAgIC8vIGRpc2FibGUgdGhlIGNvcm5lciByYWRpdXMgZW50aXJlbHkuXG4gICAgICAgIGlmIChkYSA8IHBpKSB7XG4gICAgICAgICAgaWYgKG9jID0gaW50ZXJzZWN0KHgwMSwgeTAxLCB4MDAsIHkwMCwgeDExLCB5MTEsIHgxMCwgeTEwKSkge1xuICAgICAgICAgICAgdmFyIGF4ID0geDAxIC0gb2NbMF0sXG4gICAgICAgICAgICAgICAgYXkgPSB5MDEgLSBvY1sxXSxcbiAgICAgICAgICAgICAgICBieCA9IHgxMSAtIG9jWzBdLFxuICAgICAgICAgICAgICAgIGJ5ID0geTExIC0gb2NbMV0sXG4gICAgICAgICAgICAgICAga2MgPSAxIC8gc2luKGFjb3MoKGF4ICogYnggKyBheSAqIGJ5KSAvIChzcXJ0KGF4ICogYXggKyBheSAqIGF5KSAqIHNxcnQoYnggKiBieCArIGJ5ICogYnkpKSkgLyAyKSxcbiAgICAgICAgICAgICAgICBsYyA9IHNxcnQob2NbMF0gKiBvY1swXSArIG9jWzFdICogb2NbMV0pO1xuICAgICAgICAgICAgcmMwID0gbWluKHJjLCAocjAgLSBsYykgLyAoa2MgLSAxKSk7XG4gICAgICAgICAgICByYzEgPSBtaW4ocmMsIChyMSAtIGxjKSAvIChrYyArIDEpKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmMwID0gcmMxID0gMDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLy8gSXMgdGhlIHNlY3RvciBjb2xsYXBzZWQgdG8gYS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250ZXh0LmxpbmVUbyh1LCB0KTtcbiAgICBjb250ZXh0Lm1vdmVUbygtdSwgdCk7XG4gICAgY29udGV4dC5saW5lVG8odSwgLXQpO1xuICB9XG59O1xuIiwiaW1wb3J0IHtwaSwgc3FydCwgdGF1fSBmcm9tIFwiLi4vbWF0aC5qc1wiO1xuXG5leHBvcnQgZGVmYXVsdCB7XG4gIGRyYXcoY29udGV4dCwgc2l6ZSkge1xuICAgIGNvbnN0IHIgPSBzcXJ0KHNpemUgLyBwaSk7XG4gICAgY29udGV4dC5tb3ZlVG8ociwgMCk7XG4gICAgY29udGV4dC5hcmMoMCwgMCwgciwgMCwgdGF1KTtcbiAgfVxufTtcbiIsImltcG9ydCB7c3FydH0gZnJvbSBcIi4uL21hdGguanNcIjtcblxuZXhwb3J0IGRlZmF1bHQge1xuICBkcmF3KGNvbnRleHQsIHNpemUpIHtcbiAgICBjb25zdCByID0gc3FydChzaXplIC8gNSkgLyAyO1xuICAgIGNvbnRleHQubW92ZVRvKC0zICogciwgLXIpO1xuICAgIGNvbnRleHQubGluZVRvKC1yLCAtcik7XG4gICAgY29udGV4dC5saW5lVG8oLXIsIC0zICogcik7XG4gICAgY29udGV4dC5saW5lVG8ociwgLTMgKiByKTtcbiAgICBjb250ZXh0LmxpbmVUbyhyLCAtcik7XG4gICAgY29udGV4dC5saW5lVG8oMyAqIHIsIC1yKTtcbiAgICBjb250ZXh0LmxpbmVUbygzICogciwgcik7XG4gICAgY29udGV4dC5saW5lVG8ociwgcik7XG4gICAgY29udGV4dC5saW5lVG8ociwgMyAqIHIpO1xuICAgIGNvbnRleHQubGluZVRvKC1yLCAzICogcik7XG4gICAgY29udGV4dC5saW5lVG8oLXIsIHIpO1xuICAgIGNvbnRleHQubGluZVRvKC0zICogciwgcik7XG4gICAgY29udGV4dC5jbG9zZVBhdGgoKTtcbiAgfVxufTtcbiIsImltcG9ydCB7c3FydH0gZnJvbSBcIi4uL21hdGguanNcIjtcblxuY29uc3QgdGFuMzAgPS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0gdjAgPSB2KSkgc3RyZWFtLmxpbmVTdGFydCgpO1xuICAgICAgICBpZiAodiAhPT0gdjApIHtcbiAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQwLCBwb2ludDEpO1xuICAgICAgICAgIGlmICghcG9pbnQyIHx8IHBvaW50RXF1YWwocG9pbnQwLCBwb2ludDIpIHx8IHBvaW50RXF1YWwocG9pbnQxLCBwb2ludDIpKVxuICAgICAgICAgICAgcG9pbnQxWzJdID0gMTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodiAhPT0gdjApIHtcbiAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgIC8vIG91dHNpZGUgZ29pbmcgaW5cbiAgICAgICAgICAgIHN0cmVhbS5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCk7XG4gICAgICAgICAgICBzdHJlYW0ucG9pbnQocG9pbnQyWzBdLCBwb2ludDJbMV0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBpbnNpZGUgZ29pbmcgb3V0XG4gICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQwLCBwb2ludDEpO1xuICAgICAgICAgICAgc3RyZWFtLnBvaW50KHBvaW50MlswXSwgcG9pbnQyWzFdLCAyKTtcbiAgICAgICAgICAgIHN0cmVhbS5saW5lRW5kKCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHBvaW50MCA9IHBvaW50MjtcbiAgICAgICAgfSBlbHNlIGlmIChub3RIZW1pc3BoZXJlICYmIHBvaW50MCAmJiBzbWFsbFJhZGl1cyBeIHYpIHtcbiAgICAgICAgICB2YXIgdDtcbiAgICAgICAgICAvLyBJZiB0aGUgY29kZXMgZm9yIHR3byBwb2ludHMgYXJlIGRpZmZlcmVudCwgb3IgYXJlIGJvdGggemVybyxcbiAgICAgICAgICAvLyBhbmQgdGhlcmUgdGhpcyBzZWdtZW50IGludGVyc2VjdHMgd2l0aCB0aGUgc21hbGwgY2lyY2xlLlxuICAgICAgICAgIGlmICghKGMgJiBjMCkgJiYgKHQgPSBpbnRlcnNlY3QocG9pbnQxLCBwb2ludDAsIHRydWUpKSkge1xuICAgICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICAgICAgaWYgKHNtYWxsUmFkaXVzKSB7XG4gICAgICAgICAgICAgIHN0cmVhbS5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgc3RyZWFtLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0pO1xuICAgICAgICAgICAgICBzdHJlYW0ucG9pbnQodFsxXVswXSwgdFsxXVsxXSk7XG4gICAgICAgICAgICAgIHN0cmVhbS5saW5lRW5kKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBzdHJlYW0ucG9pbnQodFsxXVswXSwgdFsxXVsxXSk7XG4gICAgICAgICAgICAgIHN0cmVhbS5saW5lRW5kKCk7XG4gICAgICAgICAgICAgIHN0cmVhbS5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgc3RyZWFtLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0sIDMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodiAmJiAoIXBvaW50MCB8fCAhcG9pbnRFcXVhbChwb2ludDAsIHBvaW50MSkpKSB7XG4gICAgICAgICAgc3RyZWFtLnBvaW50KHBvaW50MVswXSwgcG9pbnQxWzFdKTtcbiAgICAgICAgfVxuICAgICAgICBwb2ludDAgPSBwb2ludDEsIHYwID0gdiwgYzAgPSBjO1xuICAgICAgfSxcbiAgICAgIGxpbmVFbmQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICBpZiAodjApIHN0cmVhbS5saW5lRW5kKCk7XG4gICAgICAgIHBvaW50MCA9IG51bGw7XG4gICAgICB9LFxuICAgICAgLy8gUmVqb2luIG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IHtcbiAgICAgICAgY2xpcC5wb2ludCA9IHBvaW50O1xuICAgICAgICBjbGlwLmxpbmVTdGFydCA9IGxpbmVTdGFydDtcbiAgICAgICAgY2xpcC5saW5lRW5kID0gbGluZUVuZDtcbiAgICAgICAgc2VnbWVudHMgPSBtZXJnZShzZWdtZW50cyk7XG4gICAgICAgIHZhciBzdGFydEluc2lkZSA9IHBvbHlnb25Db250YWlucyhwb2x5Z29uLCBzdGFydCk7XG4gICAgICAgIGlmIChzZWdtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICBpZiAoIXBvbHlnb25TdGFydGVkKSBzaW5rLnBvbHlnb25TdGFydCgpLCBwb2x5Z29uU3RhcnRlZCA9IHRydWU7XG4gICAgICAgICAgY2xpcFJlam9pbihzZWdtZW50cywgY29tcGFyZUludGVyc2VjdGlvbiwgc3RhcnRJbnNpZGUsIGludGVycG9sYXRlLCBzaW5rKTtcbiAgICAgICAgfSBlbHNlIGlmIChzdGFydEluc2lkZSkge1xuICAgICAgICAgIGlmICghcG9seWdvblN0YXJ0ZWQpIHNpbmsucG9seWdvblN0YXJ0KCksIHBvbHlnb25TdGFydGVkID0gdHJ1ZTtcbiAgICAgICAgICBzaW5rLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGludGVycG9sYXRlKG51bGwsIG51bGwsIDEsIHNpbmspO1xuICAgICAgICAgIHNpbmsubGluZUVuZCgpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChwb2x5Z29uU3RhcnRlZCkgc2luay5wb2x5Z29uRW5kKCksIHBvbHlnb25TdGFydGVkID0gZmFsc2U7XG4gICAgICAgIHNlZ21lbnRzID0gcG9seWdvbiA9IG51bGw7XG4gICAgICB9LFxuICAgICAgc3BoZXJlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgc2luay5wb2x5Z29uU3RhcnQoKTtcbiAgICAgICAgc2luay5saW5lU3RhcnQoKTtcbiAgICAgICAgaW50ZXJwb2xhdGUobnVsbCwgbnVsbCwgMSwgc2luayk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O1xuICAgICAgICBjb25zdCBuID0gY29vcmRzLmxlbmd0aCA+PiAxO1xuXG4gICAgICAgIC8vIHBvcHVsYXRlIGFuIGFycmF5IG9mIHBvaW50IGluZGljZXM7IGNhbGN1bGF0ZSBpbnB1dCBkYXRhIGJib3hcbiAgICAgICAgbGV0IG1pblggPSBJbmZpbml0eTtcbiAgICAgICAgbGV0IG1pblkgPSBJbmZpbml0eTtcbiAgICAgICAgbGV0IG1heFggPSAtSW5maW5pdHk7XG4gICAgICAgIGxldCBtYXhZID0gLUluZmluaXR5O1xuXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbjsgaSsrKSB7XG4gICAgICAgICAgICBjb25zdCB4ID0gY29vcmRzWzIgKiBpXTtcbiAgICAgICAgICAgIGNvbnN0IHkgPSBjb29yZHNbMiAqIGkgKyAxXTtcbiAgICAgICAgICAgIGlmICh4IDwgbWluWCkgbWluWCA9IHg7XG4gICAgICAgICAgICBpZiAoeSA8IG1pblkpIG1pblkgPSB5O1xuICAgICAgICAgICAgaWYgKHggPiBtYXhYKSBtYXhYID0geDtcbiAgICAgICAgICAgIGlmICh5ID4gbWF4WSkgbWF4WSA9IHk7XG4gICAgICAgICAgICB0aGlzLl9pZHNbaV0gPSBpO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IGN4ID0gKG1pblggKyBtYXhYKSAvIDI7XG4gICAgICAgIGNvbnN0IGN5ID0gKG1pblkgKyBtYXhZKSAvIDI7XG5cbiAgICAgICAgbGV0IG1pbkRpc3QgPSBJbmZpbml0eTtcbiAgICAgICAgbGV0IGkwLCBpMSwgaTI7XG5cbiAgICAgICAgLy8gcGljayBhIHNlZWQgcG9pbnQgY2xvc2UgdG8gdGhlIGNlbnRlclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG47IGkrKykge1xuICAgICAgICAgICAgY29uc3QgZCA9IGRpc3QoY3gsIGN5LCBjb29yZHNbMiAqIGldLCBjb29yZHNbMiAqIGkgKyAxXSk7XG4gICAgICAgICAgICBpZiAoZCA8IG1pbkRpc3QpIHtcbiAgICAgICAgICAgICAgICBpMCA9IGk7XG4gICAgICAgICAgICAgICAgbWluRGlzdCA9IGQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgaTB4ID0gY29vcmRzWzIgKiBpMF07XG4gICAgICAgIGNvbnN0IGkweSA9IGNvb3Jkc1syICogaTAgKyAxXTtcblxuICAgICAgICBtaW5EaXN0ID0gSW5maW5pdHk7XG5cbiAgICAgICAgLy8gZmluZCB0aGUgcG9pbnQgY2xvc2VzdCB0byB0aGUgc2VlZFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG47IGkrKykge1xuICAgICAgICAgICAgaWYgKGkgPT09IGkwKSBjb250aW51ZTtcbiAgICAgICAgICAgIGNvbnN0IGQgPSBkaXN0KGkweCwgaTB5LCBjb29yZHNbMiAqIGldLCBjb29yZHNbMiAqIGkgKyAxXSk7XG4gICAgICAgICAgICBpZiAoZCA8IG1pbkRpc3QgJiYgZCA+IDApIHtcbiAgICAgICAgICAgICAgICBpMSA9IGk7XG4gICAgICAgICAgICAgICAgbWluRGlzdCA9IGQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGkxeCA9IGNvb3Jkc1syICogaTFdO1xuICAgICAgICBsZXQgaTF5ID0gY29vcmRzWzIgKiBpMSArIDFdO1xuXG4gICAgICAgIGxldCBtaW5SYWRpdXMgPSBJbmZpbml0eTtcblxuICAgICAgICAvLyBmaW5kIHRoZSB0aGlyZCBwb2ludCB3aGljaCBmb3JtcyB0aGUgc21hbGxlc3QgY2lyY3VtY2lyY2xlIHdpdGggdGhlIGZpcnN0IHR3b1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG47IGkrKykge1xuICAgICAgICAgICAgaWYgKGkgPT09IGkwIHx8IGkgPT09IGkxKSBjb250aW51ZTtcbiAgICAgICAgICAgIGNvbnN0IHIgPSBjaXJjdW1yYWRpdXMoaTB4LCBpMHksIGkxeCwgaTF5LCBjb29yZHNbMiAqIGldLCBjb29yZHNbMiAqIGkgKyAxXSk7XG4gICAgICAgICAgICBpZiAociA8IG1pblJhZGl1cykge1xuICAgICAgICAgICAgICAgIGkyID0gaTtcbiAgICAgICAgICAgICAgICBtaW5SYWRpdXMgPSByO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBpMnggPSBjb29yZHNbMiAqIGkyXTtcbiAgICAgICAgbGV0IGkyeSA9IGNvb3Jkc1syICogaTIgKyAxXTtcblxuICAgICAgICBpZiAobWluUmFkaXVzID09PSBJbmZpbml0eSkge1xuICAgICAgICAgICAgLy8gb3JkZXIgY29sbGluZWFyIHBvaW50cyBieSBkeCAob3IgZHkgaWYgYWxsIHggYXJlIGlkZW50aWNhbClcbiAgICAgICAgICAgIC8vIGFuZCByZXR1cm4gdGhlIGxpc3QgYXMgYSBodWxsXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG47IGkrKykge1xuICAgICAgICAgICAgICAgIHRoaXMuX2Rpc3RzW2ldID0gKGNvb3Jkc1syICogaV0gLSBjb29yZHNbMF0pIHx8IChjb29yZHNbMiAqIGkgKyAxXSAtIGNvb3Jkc1sxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBxdWlja3NvcnQodGhpcy5faWRzLCB0aGlzLl9kaXN0cywgMCwgbiAtIDEpO1xuICAgICAgICAgICAgY29uc3QgaHVsbCA9IG5ldyBVaW50MzJBcnJheShuKTtcbiAgICAgICAgICAgIGxldCBqID0gMDtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwLCBkMCA9IC1JbmZpbml0eTsgaSA8IG47IGkrKykge1xuICAgICAgICAgICAgICAgIGNvbnN0IGlkID0gdGhpcy5faWRzW2ldO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLl9kaXN0c1tpZF0gPiBkMCkge1xuICAgICAgICAgICAgICAgICAgICBodWxsW2orK10gPSBpZDtcbiAgICAgICAgICAgICAgICAgICAgZDAgPSB0aGlzLl9kaXN0c1tpZF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5odWxsID0gaHVsbC5zdWJhcnJheSgwLCBqKTtcbiAgICAgICAgICAgIHRoaXMudHJpYW5nbGVzID0gbmV3IFVpbnQzMkFycmF5KDApO1xuICAgICAgICAgICAgdGhpcy5oYWxmZWRnZXMgPSBuZXcgVWludDMyQXJyYXkoMCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBzd2FwIHRoZSBvcmRlciBvZiB0aGUgc2VlZCBwb2ludHMgZm9yIGNvdW50ZXItY2xvY2t3aXNlIG9yaWVudGF0aW9uXG4gICAgICAgIGlmIChvcmllbnQyZChpMHgsIGkweSwgaTF4LCBpMXksIGkyeCwgaTJ5KSA8IDApIHtcbiAgICAgICAgICAgIGNvbnN0IGkgPSBpMTtcbiAgICAgICAgICAgIGNvbnN0IHggPSBpMXg7XG4gICAgICAgICAgICBjb25zdCB5ID0gaTF5O1xuICAgICAgICAgICAgaTEgPSBpMjtcbiAgICAgICAgICAgIGkxeCA9IGkyeDtcbiAgICAgICAgICAgIGkxeSA9IGkyeTtcbiAgICAgICAgICAgIGkyID0gaTtcbiAgICAgICAgICAgIGkyeCA9IHg7XG4gICAgICAgICAgICBpMnkgPSB5O1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgY2VudGVyID0gY2lyY3VtY2VudGVyKGkweCwgaTB5LCBpMXgsIGkxeSwgaTJ4LCBpMnkpO1xuICAgICAgICB0aGlzLl9jeCA9IGNlbnRlci54O1xuICAgICAgICB0aGlzLl9jeSA9IGNlbnRlci55O1xuXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbjsgaSsrKSB7XG4gICAgICAgICAgICB0aGlzLl9kaXN0c1tpXSA9IGRpc3QoY29vcmRzWzIgKiBpXSwgY29v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W5ndGg7IGsrKykge1xuICAgICAgICAgICAgY29uc3QgaSA9IHRoaXMuX2lkc1trXTtcbiAgICAgICAgICAgIGNvbnN0IHggPSBjb29yZHNbMiAqIGldO1xuICAgICAgICAgICAgY29uc3QgeSA9IGNvb3Jkc1syICogaSArIDFdO1xuXG4gICAgICAgICAgICAvLyBza2lwIG5lYXItZHVwbGljYXRlIHBvaW50c1xuICAgICAgICAgICAgaWYgKGsgPiAwICYmIE1hdGguYWJzKHggLSB4cCkgPD0gRVBTSUxPTiAmJiBNYXRoLmFicyh5IC0geXApIDw9IEVQU0lMT04pIGNvbnRpbnVlO1xuICAgICAgICAgICAgeHAgPSB4O1xuICAgICAgICAgICAgeXAgPSB5O1xuXG4gICAgICAgICAgICAvLyBza2lwIHNlZWQgdHJpYW5nbGUgcG9pbnRzXG4gICAgICAgICAgICBpZiAoaSA9PT0gaTAgfHwgaSA9PT0gaTEgfHwgaSA9PT0gaTIpIGNvbnRpbnVlO1xuXG4gICAgICAgICAgICAvLyBmaW5kIGEgdmlzaWJsZSBlZGdlIG9uIHRoZSBjb252ZXggaHVsbCB1c2luZyBlZGdlIGhhc2hcbiAgICAgICAgICAgIGxldCBzdGFydCA9IDA7XG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMCwga2V5ID0gdGhpcy5faGFzaEtleSh4LCB5KTsgaiA8IHRoaXMuX2hhc2hTaXplOyBqKyspIHtcbiAgICAgICAgICAgICAgICBzdGFydCA9IGh1bGxIYXNoWyhrZXkgKyBqKSAlIHRoaXMuX2hhc2hTaXplXTtcbiAgICAgICAgICAgICAgICBpZiAoc3RhcnQgIT09IC0xICYmIHN0YXJ0ICE9PSBodWxsTmV4dFtzdGFydF0pIGJyZWFrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzdGFydCA9IGh1bGxQcmV2W3N0YXJ0XTtcbiAgICAgICAgICAgIGxldCBlID0gc3RhcnQsIHE7XG4gICAgICAgICAgICB3aGlsZSAocSA9IGh1bGxOZXh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sbE5leHRbZV07XG4gICAgICAgICAgICB3aGlsZSAocSA9IGh1bGxOZXh0W25dLCBvcmllbnQyZCh4LCB5LCBjb29yZHNbMiAqIG5dLCBjb29yZHNbMiAqIG4gKyAxXSwgY29vcmRzWzIgKiBxXSwgY29vcmRzWzIgKiBxICsgMV0pIDwgMCkge1xuICAgICAgICAgICAgICAgIHQgPSB0aGlzLl9hZGRUcmlhbmdsZShuLCBpLCBxLCBodWxsVHJpW2ldLCAtMSwgaHVsbFRyaVtuXSk7XG4gICAgICAgICAgICAgICAgaHVsbFRyaVtpXSA9IHRoaXMuX2xlZ2FsaXplKHQgKyAyKTtcbiAgICAgICAgICAgICAgICBodWxsTmV4dFtuXSA9IG47IC8vIG1hcmsgYXMgcmVtb3ZlZFxuICAgICAgICAgICAgICAgIGh1bGxTaXplLS07XG4gICAgICAgICAgICAgICAgbiA9IHE7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIHdhbGsgYmFja3dhcmQgZnJvbSB0aGUgb3RoZXIgc2lkZSwgYWRkaW5nIG1vcmUgdHJpYW5nbGVzIGFuZCBmbGlwcGluZ1xuICAgICAgICAgICAgaWYgKGUgPT09IHN0YXJ0KSB7XG4gICAgICAgICAgICAgICAgd2hpbGUgKHEgPSBodWxsUHJldltlXSwgb3JpZW50MmQoeCwgeSwgY29vcmRzWzIgKiBxXSwgY29vcmRzWzIgKiBxICsgMV0sIGNvb3Jkc1syICogZV0sIGNvb3Jkc1syICogZSArIDFdKSA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdCA9IHRoaXMuX2FkZFRyaWFuZ2xlKHEsIGksIGUsIC0xLCBodWxsVHJpW2VdLCBodWxsVHJpW3FdKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fbGVnYWxpemUodCArIDIpO1xuICAgICAgICAgICAgICAgICAgICBodWxsVHJpW3FdID0gdDtcbiAgICAgICAgICAgICAgICAgICAgaHVsbE5leHRbZV0gPSBlOyAvLyBtYXJrIGFzIHJlbW92ZWRcbiAgICAgICAgICAgICAgICAgICAgaHVsbFNpemUtLTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IHE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyB1cGRhdGUgdGhlIGh1bGwgaW5kaWNlc1xuICAgICAgICAgICAgdGhpcy5faHVsbFN0YXJ0ID0gaHVsbFByZXZbaV0gPSBlO1xuICAgICAgICAgICAgaHVsbE5leHRbZV0gPSBodWxsUHJldltuXSA9IGk7XG4gICAgICAgICAgICBodWxsTmV4dFtpXSA9IG47XG5cbiAgICAgICAgICAgIC8vIHNhdmUgdGhlIHR3byBuZXcgZWRnZXMgaW4gdGhlIGhhc2ggdGFibGVcbiAgICAgICAgICAgIGh1bGxIYXNoW3RoaXMuX2hhc2hLZXkoeCwgeSldID0gaTtcbiAgICAgICAgICAgIGh1bGxIYXNoW3RoaXMuX2hhc2hLZXkoY29vcmRzWzIgKiBlXSwgY29vcmRzWzIgKiBlICsgMV0pXSA9IGU7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmh1bGwgPSBuZXcgVWludDMyQXJyYXkoaHVsbFNpemUpO1xuICAgICAgICBmb3IgKGxldCBpID0gMCwgZSA9IHRoaXMuX2h1bGxTdGFydDsgaSA8IGh1bGxTaXplOyBpKyspIHtcbiAgICAgICAgICAgIHRoaXMuaHVsbFtpXSA9IGU7XG4gICAgICAgICAgICBlID0gaHVsbE5leHRbZV07XG4gICAgICAgIH1cblxuICAgICAgICAvLyB0cmltIHR5cGVkIHRyaWFuZ2xlIG1lc2ggYXJyYXlzXG4gICAgICAgIHRoaXMudHJpYW5nbGVzID0gdGhpcy5fdHJpYW5nbGVzLnN1YmFycmF5KDAsIHRoaXMudHJpYW5nbGVzTGVuKTtcbiAgICAgICAgdGhpcy5oYWxmZWRnZXMgPSB0aGlzLl9oYWxmZWRnZXMuc3ViYXJyYXkoMCwgdGhpcy50cmlhbmdsZXNMZW4pO1xuICAgIH1cblxuICAgIF9oYXNoS2V5KHgsIHkpIHtcbiAgICAgICAgcmV0dXJuIE1hdGguZmxvb3IocHNldWRvQW5nbGUoeCAtIHRoaXMuX2N4LCB5IC0gdGhpcy5fY3kpICogdGhpcy5faGFzaFNpemUpICUgdGhpcy5faGFzaFNpemU7XG4gICAgfVxuXG4gICAgX2xlZ2FsaXplKGEpIHtcbiAgICAgICAgY29uc3Qge190cmlhbmdsZXM6IHRyaWFuZ2xlcywgX2hhbGZlZGdlczogaGFsZmVkZ2VzLCBjb29yZHN9ID0gdGhpcztcblxuICAgICAgICBsZXQgaSA9IDA7XG4gICAgICAgIGxldCBhciA9IDA7XG5cbiAgICAgICAgLy8gcmVjdXJzaW9uIGVsaW1pbmF0ZWQgd2l0aCBhIGZpeGVkLXNpemUgc3RhY2tcbiAgICAgICAgd2hpbGUgKHRydWUpIHtcbiAgICAgICAgICAgIGNvbnN0IGIgPSBoYWxmZWRnZXNbYV07XG5cbiAgICAgICAgICAgIC8qIGlmIHRoZSBwYWlyIG9mIHRyaWFuZ2xlcyBkb2Vzbid0IHNhdGlzZnkgdGhlIERlbGF1bmF5IGNvbmRpdGlvblxuICAgICAgICAgICAgICogKHAxIGlzIGluc2lkZSB0aGUgY2lyY3VtY2lyY2xlIG9mIFtwMCwgcGwsIHByXSksIGZsaXAgdGhlbSxcbiAgICAgICAgICAgICAqIHRoZW4gZG8gdGhlIHNhbWUgY2hlY2svZmxpcCByZWN1cnNpdmVseSBmb3IgdGhlIG5ldyBwYWlyIG9mIHRyaWFuZ2xlc1xuICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAqICAgICAgICAgICBwbCAgICAgICAgICAgICAgICAgICAgcGxcbiAgICAgICAgICAgICAqICAgICAgICAgIC98fFxcICAgICAgICAgICAgICAgICAgLyAgXFxcbiAgICAgICAgICAgICAqICAgICAgIGFsLyB8fCBcXGJsICAgICAgICAgICAgYWwvICAgIFxcYVxuICAgICAgICAgICAgICogICAgICAgIC8gIHx8ICBcXCAgICAgICAgICAgICAgLyAgICAgIFxcXG4gICAgICAgICAgICAgKiAgICAgICAvICBhfHxiICBcXCAgICBmbGlwICAgIC9fX19hcl9fX1xcXG4gICAgICAgICAgICAgKiAgICAgcDBcXCAgIHx8ICAgL3AxICAgPT4gICBwMFxcLS0tYmwtLS0vcDFcbiAgICAgICAgICAgICAqICAgICAgICBcXCAgfHwgIC8gICAgICAgICAgICAgIFxcICAgICAgL1xuICAgICAgICAgICAgICogICAgICAgYXJcXCB8fCAvYnIgICAgICAgICAgICAgYlxcICAgIC9iclxuICAgICAgICAgICAgICogICAgICAgICAgXFx8fC8gICAgICAgICAgICAgICAgICBcXCAgL1xuICAgICAgICAgICAgICogICAgICAgICAgIHByICAgICAgICAgICAgICAgICAgICBwclxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBjb25zdCBhMCA9IGEgLSBhICUgMztcbiAgICAgICAgICAgIGFyID0gYTAgKyAoYSArIDIpICUgMztcblxuICAgICAgICAgICAgaWYgKGIgPT09IC0xKSB7IC8vIGNvbnZleCBodWxsIGVkZ2VcbiAgICAgICAgICAgICAgICBpZiAoaSA9PT0gMCkgYnJlYWs7XG4gICAgICAgICAgICAgICAgYSA9IEVER0VfU1RBQ0tbLS1pXTtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3QgYjAgPSBiIC0gYiAlIDM7XG4gICAgICAgICAgICBjb25zdCBhbCA9IGEwICsgKGEgKyAxKSAlIDM7XG4gICAgICAgICAgICBjb25zdCBibCA9IGIwICsgKGIgKyAyKSAlIDM7XG5cbiAgICAgICAgICAgIGNvbnN0IHAwID0gdHJpYW5nbGVzW2FyXTtcbiAgICAgICAgICAgIGNvbnN0IHByID0gdHJpYW5nbGVzW2FdO1xuICAgICAgICAgICAgY29uc3QgcGwgPSB0cmlhbmdsZXNbYWxdO1xuICAgICAgICAgICAgY29uc3QgcDEgPSB0cmlhbmdsZXNbYmxdO1xuXG4gICAgICAgICAgICBjb25zdCBpbGxlZ2FsID0gaW5DaXJjbGUoXG4gICAgICAgICAgICAgICAgY29vcmRzWzIgKiBwMF0sIGNvb3Jkc1syICogcDAgKyAxXSxcbiAgICAgICAgICAgICAgICBjb29yZHNbMiAqIHByXSwgY29vcmRzWzIgKiBwciArIDFdLFxuICAgICAgICAgICAgICAgIGNvb3Jkc1syICogcGxdLCBjb29yZHNbMiAqIHBsICsgMV0sXG4gICAgICAgICAgICAgICAgY29vcmRzWzIgKiBwMV0sIGNvb3Jkc1syICogcDEgKyAxXSk7XG5cbiAgICAgICAgICAgIGlmIChpbGxlZ2FsKSB7XG4gICAgICAgICAgICAgICAgdHJpYW5nbGVzW2FdID0gcDE7XG4gICAgICAgICAgICAgICAgdHJpYW5nbGVzW2JdID0gcDA7XG5cbiAgICAgICAgICAgICAgICBjb25zdCBoYmwgPSBoYWxmZWRnZXNbYmxdO1xuXG4gICAgICAgICAgICAgICAgLy8gZWRnZSBzd2FwcGVkIG9uIHRoZSBvdGhlciBzaWRlIG9mIHRoZSBodWxsIChyYXJlKTsgZml4IHRoZSBoYWxmZWRnZSByZWZlcmVuY2VcbiAgICAgICAgICAgICAgICBpZiAoaGJsID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgZSA9IHRoaXMuX2h1bGxTdGFydDtcbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2h1bGxUcmlbZV0gPT09IGJsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5faHVsbFRyaVtlXSA9IGE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gdGhpcy5faHVsbFByZXZbZV07XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKGUgIT09IHRoaXMuX2h1bGxTdGFydCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuX2xpbmsoYSwgaGJsKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9saW5rKGIsIGhhbGZlZGdlc1thcl0pO1xuICAgICAgICAgICAgICAgIHRoaXMuX2xpbmsoYXIsIGJsKTtcblxuICAgICAgICAgICAgICAgIGNvbnN0IGJyID0gYjAgKyAoYiArIDEpICUgMztcblxuICAgICAgICAgICAgICAgIC8vIGRvbid0IHdvcnJ5IGFib3V0IGhpdHRpbmcgdGhlIGNhcDogaXQgY2FuIG9ubHkgaGFwcGVuIG9uIGV4dHJlbWVseSBkZWdlbmVyYXRlIGlucHV0XG4gICAgICAgICAgICAgICAgaWYgKGkgPCBFREdFX1NUQUNLLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBFREdFX1NUQUNLW2krK10gPSBicjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChpID09PSAwKSBicmVhaztcbiAgICAgICAgICAgICAgICBhID0gRURHRV9TVEFDS1stLWldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGFyO1xuICAgIH1cblxuICAgIF9saW5rKGEsIGIpIHtcbiAgICAgICAgdGhpcy5faGFsZmVkZ2VzW2FdID0gYjtcbiAgICAgICAgaWYgKGIgIT09IC0xKSB0aGlzLl9oYWxmZWRnZXNbYl0gPSBhO1xuICAgIH1cblxuICAgIC8vIGFkZCBhIG5ldyB0cmlhbmdsZSBnaXZlbiB2ZXJ0ZXggaW5kaWNlcyBhbmQgYWRqYWNlbnQgaGFsZi1lZGdlIGlkc1xuICAgIF9hZGRUcmlhbmdsZShpMCwgaTEsIGkyLCBhLCBiLCBjKSB7XG4gICAgICAgIGNvbnN0IHQgPSB0aGlzLnRyaWFuZ2xlc0xlbjtcblxuICAgICAgICB0aGlzLl90cmlhbmdsZXNbdF0gPSBp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ICAgICAgICAgICAgYWxvID0gYmR4IC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogY2R5dGFpbDtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGNkeXRhaWwpO1xuICAgICAgICAgICAgYmxvID0gY2R5dGFpbCAtIGJoaTtcbiAgICAgICAgICAgIHQwID0gYWxvICogYmxvIC0gKHQxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIF9pID0gczAgKyB0MDtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2kgLSBzMDtcbiAgICAgICAgICAgIHVbMF0gPSBzMCAtIChfaSAtIGJ2aXJ0KSArICh0MCAtIGJ2aXJ0KTtcbiAgICAgICAgICAgIF9qID0gczEgKyBfaTtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2ogLSBzMTtcbiAgICAgICAgICAgIF8wID0gczEgLSAoX2ogLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBfaSA9IF8wICsgdDE7XG4gICAgICAgICAgICBidmlydCA9IF9pIC0gXzA7XG4gICAgICAgICAgICB1WzFdID0gXzAgLSAoX2kgLSBidmlydCkgKyAodDEgLSBidmlydCk7XG4gICAgICAgICAgICB1MyA9IF9qICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IHUzIC0gX2o7XG4gICAgICAgICAgICB1WzJdID0gX2ogLSAodTMgLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICB1WzNdID0gdTM7XG4gICAgICAgICAgICBzMSA9IGNkeHRhaWwgKiAtYmR5O1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogY2R4dGFpbDtcbiAgICAgICAgICAgIGFoaSA9IGMgLSAoYyAtIGNkeHRhaWwpO1xuICAgICAgICAgICAgYWxvID0gY2R4dGFpbCAtIGFoaTtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIC1iZHk7XG4gICAgICAgICAgICBiaGkgPSBjIC0gKGMgLSAtYmR5KTtcbiAgICAgICAgICAgIGJsbyA9IC1iZHkgLSBiaGk7XG4gICAgICAgICAgICBzMCA9IGFsbyAqIGJsbyAtIChzMSAtIGFoaSAqIGJoaSAtIGFsbyAqIGJoaSAtIGFoaSAqIGJsbyk7XG4gICAgICAgICAgICB0MSA9IGNkeCAqIC1iZHl0YWlsO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogY2R4O1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0gY2R4KTtcbiAgICAgICAgICAgIGFsbyA9IGNkeCAtIGFoaTtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIC1iZHl0YWlsO1xuICAgICAgICAgICAgYmhpID0gYyAtIChjIC0gLWJkeXRhaWwpO1xuICAgICAgICAgICAgYmxvID0gLWJkeXRhaWwgLSBiaGk7XG4gICAgICAgICAgICB0MCA9IGFsbyAqIGJsbyAtICh0MSAtIGFoaSAqIGJoaSAtIGFsbyAqIGJoaSAtIGFoaSAqIGJsbyk7XG4gICAgICAgICAgICBfaSA9IHMwICsgdDA7XG4gICAgICAgICAgICBidmlydCA9IF9pIC0gczA7XG4gICAgICAgICAgICB2WzBdID0gczAgLSAoX2kgLSBidmlydCkgKyAodDAgLSBidmlydCk7XG4gICAgICAgICAgICBfaiA9IHMxICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IF9qIC0gczE7XG4gICAgICAgICAgICBfMCA9IHMxIC0gKF9qIC0gYnZpcnQpICsgKF9pIC0gYnZpcnQpO1xuICAgICAgICAgICAgX2kgPSBfMCArIHQxO1xuICAgICAgICAgICAgYnZpcnQgPSBfaSAtIF8wO1xuICAgICAgICAgICAgdlsxXSA9IF8wIC0gKF9pIC0gYnZpcnQpICsgKHQxIC0gYnZpcnQpO1xuICAgICAgICAgICAgdTMgPSBfaiArIF9pO1xuICAgICAgICAgICAgYnZpcnQgPSB1MyAtIF9qO1xuICAgICAgICAgICAgdlsyXSA9IF9qI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X2kgKyBidmlydCkgKyAoYnZpcnQgLSB0MCk7XG4gICAgICAgICAgICBfaiA9IHMxICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IF9qIC0gczE7XG4gICAgICAgICAgICBfMCA9IHMxIC0gKF9qIC0gYnZpcnQpICsgKF9pIC0gYnZpcnQpO1xuICAgICAgICAgICAgX2kgPSBfMCAtIHQxO1xuICAgICAgICAgICAgYnZpcnQgPSBfMCAtIF9pO1xuICAgICAgICAgICAgYmN0dFsxXSA9IF8wIC0gKF9pICsgYnZpcnQpICsgKGJ2aXJ0IC0gdDEpO1xuICAgICAgICAgICAgdTMgPSBfaiArIF9pO1xuICAgICAgICAgICAgYnZpcnQgPSB1MyAtIF9qO1xuICAgICAgICAgICAgYmN0dFsyXSA9IF9qIC0gKHUzIC0gYnZpcnQpICsgKF9pIC0gYnZpcnQpO1xuICAgICAgICAgICAgYmN0dFszXSA9IHUzO1xuICAgICAgICAgICAgYmN0dGxlbiA9IDQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBiY3RbMF0gPSAwO1xuICAgICAgICAgICAgYmN0bGVuID0gMTtcbiAgICAgICAgICAgIGJjdHRbMF0gPSAwO1xuICAgICAgICAgICAgYmN0dGxlbiA9IDE7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFkeHRhaWwgIT09IDApIHtcbiAgICAgICAgICAgIGNvbnN0IGxlbiA9IHNjYWxlKGJjdGxlbiwgYmN0LCBhZHh0YWlsLCBfMTZjKTtcbiAgICAgICAgICAgIGZpbmxlbiA9IGZpbmFkZChmaW5sZW4sIHN1bShcbiAgICAgICAgICAgICAgICBzY2FsZShheHRiY2xlbiwgYXh0YmMsIGFkeHRhaWwsIF8xNiksIF8xNixcbiAgICAgICAgICAgICAgICBzY2FsZShsZW4sIF8xNmMsIDIgKiBhZHgsIF8zMiksIF8zMiwgXzQ4KSwgXzQ4KTtcblxuICAgICAgICAgICAgY29uc3QgbGVuMiA9IHNjYWxlKGJjdHRsZ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4IC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogYWR5dGFpbDtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGFkeXRhaWwpO1xuICAgICAgICAgICAgYmxvID0gYWR5dGFpbCAtIGJoaTtcbiAgICAgICAgICAgIHQwID0gYWxvICogYmxvIC0gKHQxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIF9pID0gczAgKyB0MDtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2kgLSBzMDtcbiAgICAgICAgICAgIHVbMF0gPSBzMCAtIChfaSAtIGJ2aXJ0KSArICh0MCAtIGJ2aXJ0KTtcbiAgICAgICAgICAgIF9qID0gczEgKyBfaTtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2ogLSBzMTtcbiAgICAgICAgICAgIF8wID0gczEgLSAoX2ogLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBfaSA9IF8wICsgdDE7XG4gICAgICAgICAgICBidmlydCA9IF9pIC0gXzA7XG4gICAgICAgICAgICB1WzFdID0gXzAgLSAoX2kgLSBidmlydCkgKyAodDEgLSBidmlydCk7XG4gICAgICAgICAgICB1MyA9IF9qICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IHUzIC0gX2o7XG4gICAgICAgICAgICB1WzJdID0gX2ogLSAodTMgLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICB1WzNdID0gdTM7XG4gICAgICAgICAgICBuMSA9IC1jZHk7XG4gICAgICAgICAgICBuMCA9IC1jZHl0YWlsO1xuICAgICAgICAgICAgczEgPSBhZHh0YWlsICogbjE7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBhZHh0YWlsO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0gYWR4dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSBhZHh0YWlsIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogbjE7XG4gICAgICAgICAgICBiaGkgPSBjIC0gKGMgLSBuMSk7XG4gICAgICAgICAgICBibG8gPSBuMSAtIGJoaTtcbiAgICAgICAgICAgIHMwID0gYWxvICogYmxvIC0gKHMxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIHQxID0gYWR4ICogbjA7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBhZHg7XG4gICAgICAgICAgICBhaGkgPSBjIC0gKGMgLSBhZHgpO1xuICAgICAgICAgICAgYWxvID0gYWR4IC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogbjA7XG4gICAgICAgICAgICBiaGkgPSBjIC0gKGMgLSBuMCk7XG4gICAgICAgICAgICBibG8gPSBuMCAtIGJoaTtcbiAgICAgICAgICAgIHQwID0gYWxvICogYmxvIC0gKHQxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIF9pID0gczAgKyB0MDtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2kgLSBzMDtcbiAgICAgICAgICAgIHZbMF0gPSBzMCAtIChfaSAtIGJ2aXJ0KSArICh0MCAtIGJ2aXJ0KTtcbiAgICAgICAgICAgIF9qID0gczEgKyBfaTtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2ogLSBzMTtcbiAgICAgICAgICAgIF8wID0gczEgLSAoX2ogLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBfaSA9IF8wICsgdDE7XG4gICAgICAgICAgICBidmlydCA9IF9pIC0gXzA7XG4gICAgICAgICAgICB2WzFdID0gXzAgLSAoX2kgLSBidmlydCkgKyAodDEgLSBidmlydCk7XG4gICAgICAgICAgICB1MyA9IF9qICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IHUzIC0gX2o7XG4gICAgICAgICAgICB2WzJdID0gX2ogLSAodTMgLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICB2WzNdID0gdTM7XG4gICAgICAgICAgICBjYXRsZW4gPSBzdW0oNCwgdSwgNCwgdiwgY2F0KTtcbiAgICAgICAgICAgIHMxID0gY2R4dGFpbCAqIGFkeXRhaWw7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBjZHh0YWlsO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0gY2R4dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSBjZHh0YWlsIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogYWR5dGFpbDtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGFkeXRhaWwpO1xuICAgICAgICAgICAgYmxvID0gYWR5dGFpbCAtIGJoaTtcbiAgICAgICAgICAgIHMwID0gYWxvICogYmxvIC0gKHMxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIHQxID0gYWR4dGFpbCAqIGNkeXRhaWw7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBhZHh0YWlsO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0gYWR4dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSBhZHh0YWlsIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogY2R5dGFpbDtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGNkeXRhaWwpO1xuICAgICAgICAgICAgYmxvID0gY2R5dGFpbCAtIGJoaTtcbiAgICAgICAgICAgIHQwID0gYWxvICogYmxvIC0gKHQxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIF9pID0gczAgLSB0MDtcbiAgICAgICAgICAgIGJ2aXJ0ID0gczAgLSBfaTtcbiAgICAgICAgICAgIGNhdHRbMF0gPSBzMCAtIChfaSArIGJ2aXJ0KSArIChidmlydCAtIHQwKTtcbiAgICAgICAgICAgIF9qID0gczEgKyBfaTtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2ogLSBzMTtcbiAgICAgICAgICAgIF8wID0gczEgLSAoX2ogLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBfaSA9IF8wIC0gdDE7XG4gICAgICAgICAgICBidmlydCA9IF8wIC0gX2k7XG4gICAgICAgICAgICBjYXR0WzFdID0gXzAgLSAoX2kgKyBidmlydCkgKyAoYnZpcnQgLSB0MSk7XG4gICAgICAgICAgICB1MyA9IF9qICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IHUzIC0gX2o7XG4gICAgICAgICAgICBjYXR0WzJdID0gX2ogLSAodTMgLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBjYXR0WzNdID0gdTM7XG4gICAgICAgICAgICBjYXR0bGVuID0gNDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNhdFswXSA9IDA7XG4gICAgICAgICAgICBjYXRsZW4gPSAxO1xuICAgICAgICAgICAgY2F0dFswXSA9IDA7XG4gICAgICAgICAgICBjYXR0bGVuID0gMTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYmR4dGFpbCAhPT0gMCkge1xuICAgICAgICAgICAgY29uc3QgbGVuID0gc2NhbGUoY2F0bGVuLCBjYXQsIGJkeHRhaWwsIF8xNmMpO1xuICAgICAgICAgICAgZmlubGVuID0gZmluYWRkKGZpbmxlbiwgc3VtKFxuICAgICAgICAgICAgICAgIHNjYWxlKGJ4dGNhbGVuLCBieHRjYSwgYmR4dGFpbCwgXzE2KSwgXzE2LFxuICAgICAgICAgICAgICAgIHNjYWxlKGxlbiwgXzE2YywgMiAqIGJkeCwgXzMyKSwgXzMyLCBfNDgpLCBfNDgpO1xuXG4gICAgICAgICAgICBjb25zdCBsZW4yID0gc2NhbGUoY2F0dGxlbiwgY2F0dCwgYmR4dGFpbCwgXzgpO1xuICAgICAgICAgICAgZmlubGVu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FpbDtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGJkeXRhaWwpO1xuICAgICAgICAgICAgYmxvID0gYmR5dGFpbCAtIGJoaTtcbiAgICAgICAgICAgIHQwID0gYWxvICogYmxvIC0gKHQxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIF9pID0gczAgKyB0MDtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2kgLSBzMDtcbiAgICAgICAgICAgIHVbMF0gPSBzMCAtIChfaSAtIGJ2aXJ0KSArICh0MCAtIGJ2aXJ0KTtcbiAgICAgICAgICAgIF9qID0gczEgKyBfaTtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2ogLSBzMTtcbiAgICAgICAgICAgIF8wID0gczEgLSAoX2ogLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBfaSA9IF8wICsgdDE7XG4gICAgICAgICAgICBidmlydCA9IF9pIC0gXzA7XG4gICAgICAgICAgICB1WzFdID0gXzAgLSAoX2kgLSBidmlydCkgKyAodDEgLSBidmlydCk7XG4gICAgICAgICAgICB1MyA9IF9qICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IHUzIC0gX2o7XG4gICAgICAgICAgICB1WzJdID0gX2ogLSAodTMgLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICB1WzNdID0gdTM7XG4gICAgICAgICAgICBuMSA9IC1hZHk7XG4gICAgICAgICAgICBuMCA9IC1hZHl0YWlsO1xuICAgICAgICAgICAgczEgPSBiZHh0YWlsICogbjE7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBiZHh0YWlsO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0gYmR4dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSBiZHh0YWlsIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogbjE7XG4gICAgICAgICAgICBiaGkgPSBjIC0gKGMgLSBuMSk7XG4gICAgICAgICAgICBibG8gPSBuMSAtIGJoaTtcbiAgICAgICAgICAgIHMwID0gYWxvICogYmxvIC0gKHMxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIHQxID0gYmR4ICogbjA7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBiZHg7XG4gICAgICAgICAgICBhaGkgPSBjIC0gKGMgLSBiZHgpO1xuICAgICAgICAgICAgYWxvID0gYmR4IC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogbjA7XG4gICAgICAgICAgICBiaGkgPSBjIC0gKGMgLSBuMCk7XG4gICAgICAgICAgICBibG8gPSBuMCAtIGJoaTtcbiAgICAgICAgICAgIHQwID0gYWxvICogYmxvIC0gKHQxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIF9pID0gczAgKyB0MDtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2kgLSBzMDtcbiAgICAgICAgICAgIHZbMF0gPSBzMCAtIChfaSAtIGJ2aXJ0KSArICh0MCAtIGJ2aXJ0KTtcbiAgICAgICAgICAgIF9qID0gczEgKyBfaTtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2ogLSBzMTtcbiAgICAgICAgICAgIF8wID0gczEgLSAoX2ogLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBfaSA9IF8wICsgdDE7XG4gICAgICAgICAgICBidmlydCA9IF9pIC0gXzA7XG4gICAgICAgICAgICB2WzFdID0gXzAgLSAoX2kgLSBidmlydCkgKyAodDEgLSBidmlydCk7XG4gICAgICAgICAgICB1MyA9IF9qICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IHUzIC0gX2o7XG4gICAgICAgICAgICB2WzJdID0gX2ogLSAodTMgLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICB2WzNdID0gdTM7XG4gICAgICAgICAgICBhYnRsZW4gPSBzdW0oNCwgdSwgNCwgdiwgYWJ0KTtcbiAgICAgICAgICAgIHMxID0gYWR4dGFpbCAqIGJkeXRhaWw7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBhZHh0YWlsO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0gYWR4dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSBhZHh0YWlsIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogYmR5dGFpbDtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGJkeXRhaWwpO1xuICAgICAgICAgICAgYmxvID0gYmR5dGFpbCAtIGJoaTtcbiAgICAgICAgICAgIHMwID0gYWxvICogYmxvIC0gKHMxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIHQxID0gYmR4dGFpbCAqIGFkeXRhaWw7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBiZHh0YWlsO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0gYmR4dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSBiZHh0YWlsIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogYWR5dGFpbDtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGFkeXRhaWwpO1xuICAgICAgICAgICAgYmxvID0gYWR5dGFpbCAtIGJoaTtcbiAgICAgICAgICAgIHQwID0gYWxvICogYmxvIC0gKHQxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIF9pID0gczAgLSB0MDtcbiAgICAgICAgICAgIGJ2aXJ0ID0gczAgLSBfaTtcbiAgICAgICAgICAgIGFidHRbMF0gPSBzMCAtIChfaSArIGJ2aXJ0KSArIChidmlydCAtIHQwKTtcbiAgICAgICAgICAgIF9qID0gczEgKyBfaTtcbiAgICAgICAgICAgIGJ2aXJ0ID0gX2ogLSBzMTtcbiAgICAgICAgICAgIF8wID0gczEgLSAoX2ogLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBfaSA9IF8wIC0gdDE7XG4gICAgICAgICAgICBidmlydCA9IF8wIC0gX2k7XG4gICAgICAgICAgICBhYnR0WzFdID0gXzAgLSAoX2kgKyBidmlydCkgKyAoYnZpcnQgLSB0MSk7XG4gICAgICAgICAgICB1MyA9IF9qICsgX2k7XG4gICAgICAgICAgICBidmlydCA9IHUzIC0gX2o7XG4gICAgICAgICAgICBhYnR0WzJdID0gX2ogLSAodTMgLSBidmlydCkgKyAoX2kgLSBidmlydCk7XG4gICAgICAgICAgICBhYnR0WzNdID0gdTM7XG4gICAgICAgICAgICBhYnR0bGVuID0gNDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGFidFswXSA9IDA7XG4gICAgICAgICAgICBhYnRsZW4gPSAxO1xuICAgICAgICAgICAgYWJ0dFswXSA9IDA7XG4gICAgICAgICAgICBhYnR0bGVuID0gMTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY2R4dGFpbCAhPT0gMCkge1xuICAgICAgICAgICAgY29uc3QgbGVuID0gc2NhbGUoYWJ0bGVuLCBhYnQsIGNkeHRhaWwsIF8xNmMpO1xuICAgICAgICAgICAgZmlubGVuID0gZmluYWRkKGZpbmxlbiwgc3VtKFxuICAgICAgICAgICAgICAgIHNjYWxlKGN4dGFibGVuLCBjeHRhYiwgY2R4dGFpbCwgXzE2KSwgXzE2LFxuICAgICAgICAgICAgICAgIHNjYWxlKGxlbiwgXzE2YywgMiAqIGNkeCwgXzMyKSwgXzMyLCBfNDgpLCBfNDgpO1xuXG4gICAgICAgICAgICBjb25zdCBsZW4yID0gc2NhbGUoYWJ0dGxlbiwgYWJ0dCwgY2R4dGFpbCwgXzgpO1xuICAgICAgICAgICAgZmlubGVuID0gZmluYWRkKGZpbmxlbiwgc3VtX3RocmVlKFxuICAgICAgICAgIC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ZDMgKyBkZXp0YWlsICogYmMzKSkgKyAoY2V4ICogY2V4ICsgY2V5ICogY2V5ICsgY2V6ICogY2V6KSAqXG4gICAgICAgICgoZGV6ICogYWJlcHMgKyBhZXogKiBiZGVwcyArIGJleiAqIGRhZXBzKSArIChkZXp0YWlsICogYWIzICsgYWV6dGFpbCAqIGJkMyArIGJlenRhaWwgKiBkYTMpKSkpICtcbiAgICAgICAgMiAqICgoKGJleCAqIGJleHRhaWwgKyBiZXkgKiBiZXl0YWlsICsgYmV6ICogYmV6dGFpbCkgKiAoY2V6ICogZGEzICsgZGV6ICogYWMzICsgYWV6ICogY2QzKSArXG4gICAgICAgIChkZXggKiBkZXh0YWlsICsgZGV5ICogZGV5dGFpbCArIGRleiAqIGRlenRhaWwpICogKGFleiAqIGJjMyAtIGJleiAqIGFjMyArIGNleiAqIGFiMykpIC1cbiAgICAgICAgKChhZXggKiBhZXh0YWlsICsgYWV5ICogYWV5dGFpbCArIGFleiAqIGFlenRhaWwpICogKGJleiAqIGNkMyAtIGNleiAqIGJkMyArIGRleiAqIGJjMykgK1xuICAgICAgICAoY2V4ICogY2V4dGFpbCArIGNleSAqIGNleXRhaWwgKyBjZXogKiBjZXp0YWlsKSAqIChkZXogKiBhYjMgKyBhZXogKiBiZDMgKyBiZXogKiBkYTMpKSk7XG5cbiAgICBpZiAoZGV0ID49IGVycmJvdW5kIHx8IC1kZXQgPj0gZXJyYm91bmQpIHtcbiAgICAgICAgcmV0dXJuIGRldDtcbiAgICB9XG5cbiAgICByZXR1cm4gaW5zcGhlcmVleGFjdChheCwgYXksIGF6LCBieCwgYnksIGJ6LCBjeCwgY3ksIGN6LCBkeCwgZHksIGR6LCBleCwgZXksIGV6KTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGluc3BoZXJlKGF4LCBheSwgYXosIGJ4LCBieSwgYnosIGN4LCBjeSwgY3osIGR4LCBkeSwgZHosIGV4LCBleSwgZXopIHtcbiAgICBjb25zdCBhZXggPSBheCAtIGV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RtcDtcbiAgICByZXR1cm4gZmlubGVuO1xufVxuXG5mdW5jdGlvbiB0YWlsaW5pdCh4dGFpbCwgeXRhaWwsIGF4LCBheSwgYngsIGJ5LCBhLCBiKSB7XG4gICAgbGV0IGJ2aXJ0LCBjLCBhaGksIGFsbywgYmhpLCBibG8sIF9pLCBfaiwgX2ssIF8wLCBzMSwgczAsIHQxLCB0MCwgdTMsIG5lZ2F0ZTtcbiAgICBpZiAoeHRhaWwgPT09IDApIHtcbiAgICAgICAgaWYgKHl0YWlsID09PSAwKSB7XG4gICAgICAgICAgICBhWzBdID0gMDtcbiAgICAgICAgICAgIGJbMF0gPSAwO1xuICAgICAgICAgICAgcmV0dXJuIDE7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBuZWdhdGUgPSAteXRhaWw7XG4gICAgICAgICAgICBzMSA9IG5lZ2F0ZSAqIGF4O1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogbmVnYXRlO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0gbmVnYXRlKTtcbiAgICAgICAgICAgIGFsbyA9IG5lZ2F0ZSAtIGFoaTtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIGF4O1xuICAgICAgICAgICAgYmhpID0gYyAtIChjIC0gYXgpO1xuICAgICAgICAgICAgYmxvID0gYXggLSBiaGk7XG4gICAgICAgICAgICBhWzBdID0gYWxvICogYmxvIC0gKHMxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIGFbMV0gPSBzMTtcbiAgICAgICAgICAgIHMxID0geXRhaWwgKiBieDtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIHl0YWlsO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0geXRhaWwpO1xuICAgICAgICAgICAgYWxvID0geXRhaWwgLSBhaGk7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBieDtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGJ4KTtcbiAgICAgICAgICAgIGJsbyA9IGJ4IC0gYmhpO1xuICAgICAgICAgICAgYlswXSA9IGFsbyAqIGJsbyAtIChzMSAtIGFoaSAqIGJoaSAtIGFsbyAqIGJoaSAtIGFoaSAqIGJsbyk7XG4gICAgICAgICAgICBiWzFdID0gczE7XG4gICAgICAgICAgICByZXR1cm4gMjtcbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIGlmICh5dGFpbCA9PT0gMCkge1xuICAgICAgICAgICAgczEgPSB4dGFpbCAqIGF5O1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogeHRhaWw7XG4gICAgICAgICAgICBhaGkgPSBjIC0gKGMgLSB4dGFpbCk7XG4gICAgICAgICAgICBhbG8gPSB4dGFpbCAtIGFoaTtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIGF5O1xuICAgICAgICAgICAgYmhpID0gYyAtIChjIC0gYXkpO1xuICAgICAgICAgICAgYmxvID0gYXkgLSBiaGk7XG4gICAgICAgICAgICBhWzBdID0gYWxvICogYmxvIC0gKHMxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIGFbMV0gPSBzMTtcbiAgICAgICAgICAgIG5lZ2F0ZSA9IC14dGFpbDtcbiAgICAgICAgICAgIHMxID0gbmVnYXRlICogYnk7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBuZWdhdGU7XG4gICAgICAgICAgICBhaGkgPSBjIC0gKGMgLSBuZWdhdGUpO1xuICAgICAgICAgICAgYWxvID0gbmVnYXRlIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogYnk7XG4gICAgICAgICAgICBiaGkgPSBjIC0gKGMgLSBieSk7XG4gICAgICAgICAgICBibG8gPSBieSAtIGJoaTtcbiAgICAgICAgICAgIGJbMF0gPSBhbG8gKiBibG8gLSAoczEgLSBhaGkgKiBiaGkgLSBhbG8gKiBiaGkgLSBhaGkgKiBibG8pO1xuICAgICAgICAgICAgYlsxXSA9IHMxO1xuICAgICAgICAgICAgcmV0dXJuIDI7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzMSA9IHh0YWlsICogYXk7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiB4dGFpbDtcbiAgICAgICAgICAgIGFoaSA9IGMgLSAoYyAtIHh0YWlsKTtcbiAgICAgICAgICAgIGFsbyA9IHh0YWlsIC0gYWhpO1xuICAgICAgICAgICAgYyA9IHNwbGl0dGVyICogYXk7XG4gICAgICAgICAgICBiaGkgPSBjIC0gKGMgLSBheSk7XG4gICAgICAgICAgICBibG8gPSBheSAtIGJoaTtcbiAgICAgICAgICAgIHMwID0gYWxvICogYmxvIC0gKHMxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgICAgIHQxID0geXRhaWwgKiBheDtcbiAgICAgICAgICAgIGMgPSBzcGxpdHRlciAqIHl0YWlsO1xuICAgICAgICAgICAgYWhpID0gYyAtIChjIC0geXRhaWwpO1xuICAgICAgICAgICAgYWxvID0geXRhaWwgLSBhaGk7XG4gICAgICAgICAgICBjID0gc3BsaXR0ZXIgKiBheDtcbiAgICAgICAgICAgIGJoaSA9IGMgLSAoYyAtIGF4KTtcbiAgICAgICAgICAgIGJsbyA9IGF4IC0gYmhpO1xuICAgICAgICAgICAgdDAgPSBhbG8gKiBibG8gLSAodDEgLSBhaGkgKiBiaGkgLSBhbG8gKiBiaGkgLSBhaGkgKiBibG8pO1xuICAgICAgICAgICAgX2kgPSBzMCAtIHQwO1xuICAgICAgICAgICAgYnZpcnQgPSBzMCAtIF9pO1xuICAgICAgICAgICAgYVswXSA9IHMwIC0gKF9pICsgYnZpcnQpICsgKGJ2aXJ0IC0gdDApO1xuICAgICAgICAgICAgX2ogPSBzMSArIF9pO1xuICAgICAgICAgICAgYnZpcnQgPSBfaiAtIHMxO1xuICAgICAg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ZpbmRleCA9IDA7XG4gICAgaWYgKChmbm93ID4gZW5vdykgPT09IChmbm93ID4gLWVub3cpKSB7XG4gICAgICAgIFEgPSBlbm93O1xuICAgICAgICBlbm93ID0gZVsrK2VpbmRleF07XG4gICAgfSBlbHNlIHtcbiAgICAgICAgUSA9IGZub3c7XG4gICAgICAgIGZub3cgPSBmWysrZmluZGV4XTtcbiAgICB9XG4gICAgbGV0IGhpbmRleCA9IDA7XG4gICAgaWYgKGVpbmRleCA8IGVsZW4gJiYgZmluZGV4IDwgZmxlbikge1xuICAgICAgICBpZiAoKGZub3cgPiBlbm93KSA9PT0gKGZub3cgPiAtZW5vdykpIHtcbiAgICAgICAgICAgIFFuZXcgPSBlbm93ICsgUTtcbiAgICAgICAgICAgIGhoID0gUSAtIChRbmV3IC0gZW5vdyk7XG4gICAgICAgICAgICBlbm93ID0gZVsrK2VpbmRleF07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBRbmV3ID0gZm5vdyArIFE7XG4gICAgICAgICAgICBoaCA9IFEgLSAoUW5ldyAtIGZub3cpO1xuICAgICAgICAgICAgZm5vdyA9IGZbKytmaW5kZXhdO1xuICAgICAgICB9XG4gICAgICAgIFEgPSBRbmV3O1xuICAgICAgICBpZiAoaGggIT09IDApIHtcbiAgICAgICAgICAgIGhbaGluZGV4KytdID0gaGg7XG4gICAgICAgIH1cbiAgICAgICAgd2hpbGUgKGVpbmRleCA8IGVsZW4gJiYgZmluZGV4IDwgZmxlbikge1xuICAgICAgICAgICAgaWYgKChmbm93ID4gZW5vdykgPT09IChmbm93ID4gLWVub3cpKSB7XG4gICAgICAgICAgICAgICAgUW5ldyA9IFEgKyBlbm93O1xuICAgICAgICAgICAgICAgIGJ2aXJ0ID0gUW5ldyAtIFE7XG4gICAgICAgICAgICAgICAgaGggPSBRIC0gKFFuZXcgLSBidmlydCkgKyAoZW5vdyAtIGJ2aXJ0KTtcbiAgICAgICAgICAgICAgICBlbm93ID0gZVsrK2VpbmRleF07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIFFuZXcgPSBRICsgZm5vdztcbiAgICAgICAgICAgICAgICBidmlydCA9IFFuZXcgLSBRO1xuICAgICAgICAgICAgICAgIGhoID0gUSAtIChRbmV3IC0gYnZpcnQpICsgKGZub3cgLSBidmlydCk7XG4gICAgICAgICAgICAgICAgZm5vdyA9IGZbKytmaW5kZXhdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgUSA9IFFuZXc7XG4gICAgICAgICAgICBpZiAoaGggIT09IDApIHtcbiAgICAgICAgICAgICAgICBoW2hpbmRleCsrXSA9IGhoO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIHdoaWxlIChlaW5kZXggPCBlbGVuKSB7XG4gICAgICAgIFFuZXcgPSBRICsgZW5vdztcbiAgICAgICAgYnZpcnQgPSBRbmV3IC0gUTtcbiAgICAgICAgaGggPSBRIC0gKFFuZXcgLSBidmlydCkgKyAoZW5vdyAtIGJ2aXJ0KTtcbiAgICAgICAgZW5vdyA9IGVbKytlaW5kZXhdO1xuICAgICAgICBRID0gUW5ldztcbiAgICAgICAgaWYgKGhoICE9PSAwKSB7XG4gICAgICAgICAgICBoW2hpbmRleCsrXSA9IGhoO1xuICAgICAgICB9XG4gICAgfVxuICAgIHdoaWxlIChmaW5kZXggPCBmbGVuKSB7XG4gICAgICAgIFFuZXcgPSBRICsgZm5vdztcbiAgICAgICAgYnZpcnQgPSBRbmV3IC0gUTtcbiAgICAgICAgaGggPSBRIC0gKFFuZXcgLSBidmlydCkgKyAoZm5vdyAtIGJ2aXJ0KTtcbiAgICAgICAgZm5vdyA9IGZbKytmaW5kZXhdO1xuICAgICAgICBRID0gUW5ldztcbiAgICAgICAgaWYgKGhoICE9PSAwKSB7XG4gICAgICAgICAgICBoW2hpbmRleCsrXSA9IGhoO1xuICAgICAgICB9XG4gICAgfVxuICAgIGlmIChRICE9PSAwIHx8IGhpbmRleCA9PT0gMCkge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yAtIChjIC0gZW5vdyk7XG4gICAgICAgIGFsbyA9IGVub3cgLSBhaGk7XG4gICAgICAgIHByb2R1Y3QwID0gYWxvICogYmxvIC0gKHByb2R1Y3QxIC0gYWhpICogYmhpIC0gYWxvICogYmhpIC0gYWhpICogYmxvKTtcbiAgICAgICAgc3VtID0gUSArIHByb2R1Y3QwO1xuICAgICAgICBidmlydCA9IHN1bSAtIFE7XG4gICAgICAgIGhoID0gUSAtIChzdW0gLSBidmlydCkgKyAocHJvZHVjdDAgLSBidmlydCk7XG4gICAgICAgIGlmIChoaCAhPT0gMCkge1xuICAgICAgICAgICAgaFtoaW5kZXgrK10gPSBoaDtcbiAgICAgICAgfVxuICAgICAgICBRID0gcHJvZHVjdDEgKyBzdW07XG4gICAgICAgIGhoID0gc3VtIC0gKFEgLSBwcm9kdWN0MSk7XG4gICAgICAgIGlmIChoaCAhPT0gMCkge1xuICAgICAgICAgICAgaFtoaW5kZXgrK10gPSBoaDtcbiAgICAgICAgfVxuICAgIH1cbiAgICBpZiAoUSAhPT0gMCB8fCBoaW5kZXggPT09IDApIHtcbiAgICAgICAgaFtoaW5kZXgrK10gPSBRO1xuICAgIH1cbiAgICByZXR1cm4gaGluZGV4O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gbmVnYXRlKGVsZW4sIGUpIHtcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGVsZW47IGkrKykgZVtpXSA9IC1lW2ldO1xuICAgIHJldHVybiBlbGVuO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZXN0aW1hdGUoZWxlbiwgZSkge1xuICAgIGxldCBRID0gZVswXTtcbiAgICBmb3IgKGxldCBpID0gMTsgaSA8IGVsZW47IGkrKykgUSArPSBlW2ldO1xuICAgIHJldHVybiBRO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gdmVjKG4pIHtcbiAgICByZXR1cm4gbmV3IEZsb2F0NjRBcnJheShuKTtcbn1cbiIsIlxuZXhwb3J0IHtvcmllbnQyZCwgb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9IE1hdGgubWluKFxuICAgICAgICAgICAgICAgIHJpZ2h0LFxuICAgICAgICAgICAgICAgIE1hdGguZmxvb3IoayArICgobiAtIG0pICogcykgLyBuICsgc2QpXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgcXVpY2tzZWxlY3QoYXJyLCBrLCBuZXdMZWZ0LCBuZXdSaWdodCk7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgdCA9IGFycltrXTtcbiAgICAgICAgdmFyIGkgPSBsZWZ0O1xuICAgICAgICB2YXIgaiA9IHJpZ2h0O1xuXG4gICAgICAgIHN3YXAoYXJyLCBsZWZ0LCBrKTtcbiAgICAgICAgaWYgKGFycltyaWdodF0gPiB0KSB7IHN3YXAoYXJyLCBsZWZ0LCByaWdodCk7IH1cblxuICAgICAgICB3aGlsZSAoaSA8IGopIHtcbiAgICAgICAgICAgIHN3YXAoYXJyLCBpLCBqKTtcbiAgICAgICAgICAgIGkrKztcbiAgICAgICAgICAgIGotLTtcbiAgICAgICAgICAgIHdoaWxlIChhcnJbaV0gPCB0KSB7IGkrKzsgfVxuICAgICAgICAgICAgd2hpbGUgKGFycltqXSA+IHQpIHsgai0tOyB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYXJyW2xlZnRdID09PSB0KSB7IHN3YXAoYXJyLCBsZWZ0LCBqKTsgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGorKztcbiAgICAgICAgICAgIHN3YXAoYXJyLCBqLCByaWdodCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaiA8PSBrKSB7IGxlZnQgPSBqICsgMTsgfVxuICAgICAgICBpZiAoayA8PSBqKSB7IHJpZ2h0ID0gaiAtIDE7IH1cbiAgICB9XG59XG5cbmZ1bmN0aW9uIHN3YXAoYXJyLCBpLCBqKSB7XG4gICAgdmFyIHRtcCA9IGFycltpXTtcbiAgICBhcnJbaV0gPSBhcnJbal07XG4gICAgYXJyW2pdID0gdG1wO1xufVxuXG4vKipcbiAqIF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1YW50aWxlU29ydGVkKGNvcHksIHApO1xuICAgIH1cbn1cblxuZnVuY3Rpb24gcXVhbnRpbGVTZWxlY3QoYXJyLCBrLCBsZWZ0LCByaWdodCkge1xuICAgIGlmIChrICUgMSA9PT0gMCkge1xuICAgICAgICBxdWlja3NlbGVjdChhcnIsIGssIGxlZnQsIHJpZ2h0KTtcbiAgICB9IGVsc2Uge1xuICAgICAgICBrID0gTWF0aC5mbG9vcihrKTtcbiAgICAgICAgcXVpY2tzZWxlY3QoYXJyLCBrLCBsZWZ0LCByaWdodCk7XG4gICAgICAgIHF1aWNrc2VsZWN0KGFyciwgayArIDEsIGsgKyAxLCByaWdodCk7XG4gICAgfVxufVxuXG5mdW5jdGlvbiBtdWx0aVF1YW50aWxlU2VsZWN0KGFyciwgcCkge1xuICAgIHZhciBpbmRpY2VzID0gWzBdO1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcC5sZW5ndGg7IGkrKykge1xuICAgICAgICBpbmRpY2VzLnB1c2gocXVhbnRpbGVJbmRleChhcnIubGVuZ3RoLCBwW2ldKSk7XG4gICAgfVxuICAgIGluZGljZXMucHVzaChhcnIubGVuZ3RoIC0gMSk7XG4gICAgaW5kaWNlcy5zb3J0KGNvbXBhcmUpO1xuXG4gICAgdmFyIHN0YWNrID0gWzAsIGluZGljZXMubGVuZ3RoIC0gMV07XG5cbiAgICB3aGlsZSAoc3RhY2subGVuZ3RoKSB7XG4gICAgICAgIHZhciByID0gTWF0aC5jZWlsKHN0YWNrLnBvcCgpKTtcbiAgICAgICAgdmFyIGwgPSBNYXRoLmZsb29yKHN0YWNrLnBvcCgpKTtcbiAgICAgICAgaWYgKHIgLSBsIDw9IDEpIHsgY29udGludWU7IH1cblxuICAgICAgICB2YXIgbSA9IE1hdGguZmxvb3IoKGwgKyByKSAvIDIpO1xuICAgICAgICBxdWFudGlsZVNlbGVjdChcbiAgICAgICAgICAgIGFycixcbiAgICAgICAgICAgIGluZGljZXNbbV0sXG4gICAgICAgICA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SBsb3dlckNsYXNzTGltaXQgLSAxO1xuXG4gICAgICAgICAgICBpZiAoaTQgIT09IDApIHtcbiAgICAgICAgICAgICAgICBmb3IgKGogPSAyOyBqIDwgbkNsYXNzZXMgKyAxOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgYWRkaW5nIHRoaXMgZWxlbWVudCB0byBhbiBleGlzdGluZyBjbGFzc1xuICAgICAgICAgICAgICAgICAgICAvLyB3aWxsIGluY3JlYXNlIGl0cyB2YXJpYW5jZSBiZXlvbmQgdGhlIGxpbWl0LCBicmVha1xuICAgICAgICAgICAgICAgICAgICAvLyB0aGUgY2xhc3MgYXQgdGhpcyBwb2ludCwgc2V0dGluZyB0aGUgYGxvd2VyQ2xhc3NMaW1pdGBcbiAgICAgICAgICAgICAgICAgICAgLy8gYXQgdGhpcyBwb2ludC5cbiAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyaWFuY2VDb21iaW5hdGlvbnNbbF1bal0gPj1cbiAgICAgICAgICAgICAgICAgICAgICAgIHZhcmlhbmNlICsgdmFyaWFuY2VDb21iaW5hdGlvbnNbaTRdW2ogLSAxXVxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvd2VyQ2xhc3NMaW1pdHNbbF1bal0gPSBsb3dlckNsYXNzTGltaXQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXJpYW5jZUNvbWJpbmF0aW9uc1tsXVtqXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyaWFuY2UgKyB2YXJpYW5jZUNvbWJpbmF0aW9uc1tpNF1baiAtIDFdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbG93ZXJDbGFzc0xpbWl0c1tsXVsxXSA9IDE7XG4gICAgICAgIHZhcmlhbmNlQ29tYmluYX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tcbiAgICAgICAgMC45OTU6IDAsXG4gICAgICAgIDAuOTk6IDAsXG4gICAgICAgIDAuOTc1OiAwLFxuICAgICAgICAwLjk1OiAwLFxuICAgICAgICAwLjk6IDAuMDIsXG4gICAgICAgIDAuNTogMC40NSxcbiAgICAgICAgMC4xOiAyLjcxLFxuICAgICAgICAwLjA1OiAzLjg0LFxuICAgICAgICAwLjAyNTogNS4wMixcbiAgICAgICAgMC4wMTogNi42MyxcbiAgICAgICAgMC4wMDU6IDcuODhcbiAgICB9LFxuICAgIDI6IHtcbiAgICAgICAgMC45OTU6IDAuMDEsXG4gICAgICAgIDAuOTk6IDAuMDIsXG4gICAgICAgIDAuOTc1OiAwLjA1LFxuICAgICAgICAwLjk1OiAwLjEsXG4gICAgICAgIDAuOTogMC4yMSxcbiAgICAgICAgMC41OiAxLjM5LFxuICAgICAgICAwLjE6IDQuNjEsXG4gICAgICAgIDAuMDU6IDUuOTksXG4gICAgICAgIDAuMDI1OiA3LjM4LFxuICAgICAgICAwLjAxOiA5LjIxLFxuICAgICAgICAwLjAwNTogMTAuNlxuICAgIH0sXG4gICAgMzoge1xuICAgICAgICAwLjk5NTogMC4wNyxcbiAgICAgICAgMC45OTogMC4xMSxcbiAgICAgICAgMC45NzU6IDAuMjIsXG4gICAgICAgIDAuOTU6IDAuMzUsXG4gICAgICAgIDAuOTogMC41OCxcbiAgICAgICAgMC41OiAyLjM3LFxuICAgICAgICAwLjE6IDYuMjUsXG4gICAgICAgIDAuMDU6IDcuODEsXG4gICAgICAgIDAuMDI1OiA5LjM1LFxuICAgICAgICAwLjAxOiAxMS4zNCxcbiAgICAgICAgMC4wMDU6IDEyLjg0XG4gICAgfSxcbiAgICA0OiB7XG4gICAgICAgIDAuOTk1OiAwLjIxLFxuICAgICAgICAwLjk5OiAwLjMsXG4gICAgICAgIDAuOTc1OiAwLjQ4LFxuICAgICAgICAwLjk1OiAwLjcxLFxuICAgICAgICAwLjk6IDEuMDYsXG4gICAgICAgIDAuNTogMy4zNixcbiAgICAgICAgMC4xOiA3Ljc4LFxuICAgICAgICAwLjA1OiA5LjQ5LFxuICAgICAgICAwLjAyNTogMTEuMTQsXG4gICAgICAgIDAuMDE6IDEzLjI4LFxuICAgICAgICAwLjAwNTogMTQuODZcbiAgICB9LFxuICAgIDU6IHtcbiAgICAgICAgMC45OTU6IDAuNDEsXG4gICAgICAgIDAuOTk6IDAuNTUsXG4gICAgICAgIDAuOTc1OiAwLjgzLFxuICAgICAgICAwLjk1OiAxLjE1LFxuICAgICAgICAwLjk6IDEuNjEsXG4gICAgICAgIDAuNTogNC4zNSxcbiAgICAgICAgMC4xOiA5LjI0LFxuICAgICAgICAwLjA1OiAxMS4wNyxcbiAgICAgICAgMC4wMjU6IDEyLjgzLFxuICAgICAgICAwLjAxOiAxNS4wOSxcbiAgICAgICAgMC4wMDU6IDE2Ljc1XG4gICAgfSxcbiAgICA2OiB7XG4gICAgICAgIDAuOTk1OiAwLjY4LFxuICAgICAgICAwLjk5OiAwLjg3LFxuICAgICAgICAwLjk3NTogMS4yNCxcbiAgICAgICAgMC45NTogMS42NCxcbiAgICAgICAgMC45OiAyLjIsXG4gICAgICAgIDAuNTogNS4zNSxcbiAgICAgICAgMC4xOiAxMC42NSxcbiAgICAgICAgMC4wNTogMTIuNTksXG4gICAgICAgIDAuMDI1OiAxNC40NSxcbiAgICAgICAgMC4wMTogMTYuODEsXG4gICAgICAgIDAuMDA1OiAxOC41NVxuICAgIH0sXG4gICAgNzoge1xuICAgICAgICAwLjk5NTogMC45OSxcbiAgICAgICAgMC45OTogMS4yNSxcbiAgICAgICAgMC45NzU6IDEuNjksXG4gICAgICAgIDAuOTU6IDIuMTcsXG4gICAgICAgIDAuOTogMi44MyxcbiAgICAgICAgMC41OiA2LjM1LFxuICAgICAgICAwLjE6IDEyLjAyLFxuICAgICAgICAwLjA1OiAxNC4wNyxcbiAgICAgICAgMC4wMjU6IDE2LjAxLFxuICAgICAgICAwLjAxOiAxOC40OCxcbiAgICAgICAgMC4wMDU6IDIwLjI4XG4gICAgfSxcbiAgICA4OiB7XG4gICAgICAgIDAuOTk1OiAxLjM0LFxuICAgICAgICAwLjk5OiAxLjY1LFxuICAgICAgICAwLjk3NTogMi4xOCxcbiAgICAgICAgMC45NTogMi43MyxcbiAgICAgICAgMC45OiAzLjQ5LFxuICAgICAgICAwLjU6IDcuMzQsXG4gICAgICAgIDAuMTogMTMuMzYsXG4gICAgICAgIDAuMDU6IDE1LjUxLFxuICAgICAgICAwLjAyNTogMTcuNTMsXG4gICAgICAgIDAuMDE6IDIwLjA5LFxuICAgICAgICAwLjAwNTogMjEuOTZcbiAgICB9LFxuICAgIDk6IHtcbiAgICAgICAgMC45OTU6IDEuNzMsXG4gICAgICAgIDAuOTk6IDIuMDksXG4gICAgICAgIDAuOTc1OiAyLjcsXG4gICAgICAgIDAuOTU6IDMuMzMsXG4gICAgICAgIDAuOTogNC4xNyxcbiAgICAgICAgMC41OiA4LjM0LFxuICAgICAgICAwLjE6IDE0LjY4LFxuICAgICAgICAwLjA1OiAxNi45MixcbiAgICAgICAgMC4wMjU6IDE5LjAyLFxuICAgICAgICAwLjAxOiAyMS42NyxcbiAgICAgICAgMC4wMDU6IDIzLjU5XG4gICAgfSxcbiAgICAxMDoge1xuICAgICAgICAwLjk5NTogMi4xNixcbiAgICAgICAgMC45OTogMi41NixcbiAgICAgICAgMC45NzU6IDMuMjUsXG4gICAgICAgIDAuOTU6IDMuOTQsXG4gICAgICAgIDAuOTogNC44NyxcbiAgICAgICAgMC41OiA5LjM0LFxuICAgICAgICAwLjE6IDE1Ljk5LFxuICAgICAgICAwLjA1OiAxOC4zMSxcbiAgICAgICAgMC4wMjU6IDIwLjQ4LFxuICAgICAgICAwLjAxOiAyMy4yMSxcbiAgICAgICAgMC4wMDU6IDI1LjE5XG4gICAgfSxcbiAgICAxMToge1xuICAgICAgICAwLjk5NTogMi42LFxuICAgICAgICAwLjk5OiAzLjA1LFxuICAgICAgICAwLjk3NTogMy44MixcbiAgICAgICAgMC45NTogNC41NyxcbiAgICAgICAgMC45OiA1LjU4LFxuICAgICAgICAwLjU6IDEwLjM0LFxuICAgICAgICAwLjE6IDE3LjI4LFxuICAgICAgICAwLjA1OiAxOS42OCxcbiAgICAgICAgMC4wMjU6IDIxLjkyLFxuICAgICAgICAwLjAxOiAyNC43MixcbiAgICAgICAgMC4wMDU6IDI2Ljc2XG4gICAgfSxcbiAgICAxMjoge1xuICAgICAgICAwLjk5NTogMy4wNyxcbiAgICAgICAgMC45OTogMy41NyxcbiAgICAgICAgMC45NzU6IDQuNCxcbiAgICAgICAgMC45NTogNS4yMyxcbiAgICAgICAgMC45OiA2LjMsXG4gICAgICAgIDAuNTogMTEuMzQsXG4gICAgICAgIDAuMTogMTguNTUsXG4gICAgICAgIDAuMDU6IDIxLjAzLFxuICAgICAgICAwLjAyNTogMjMuMzQsXG4gICAgICAgIDAuMDE6IDI2LjIyLFxuICAgICAgICAwLjAwNTogMjguM1xuICAgIH0sXG4gICAgMTM6IHtcbiAgICAgICAgMC45OTU6IDMuNTcsXG4gICAgICAgIDAuOTk6IDQuMTEsXG4gICAgICAgIDAuOTc1OiA1LjAxLFxuICAgICAgICAwLjk1OiA1Ljg5LFxuICAgICAgICAwLjk6IDcuMDQsXG4gICAgICAgIDAuNTogMTIuMzQsXG4gICAgICAgIDAuMTogMTkuODEsXG4gICAgICAgIDAuMDU6IDIyLjM2LFxuICAgICAgICAwLjAyNTogMjQuNzQsXG4gICAgICAgIDAuMDE6IDI3LjY5LFxuICAgICAgICAwLjAwNTogMjkuODJcbiAgICB9LFxuICAgIDE0OiB7XG4gICAgICAgIDAuOTk1OiA0LjA3LFxuICAgICAgICAwLjk5OiA0LjY2LFxuICAgICAgICAwLjk3NTogNS42MyxcbiAgICAgICAgMC45NTogNi41NyxcbiAgICAgICAgMC45OiA3Ljc5LFxuICAgICAgICAwLjU6IDEzLjM0LFxuICAgICAgICAwLjE6IDIxLjA2LFxuICAgICAgICAwLjA1OiAyMy42OCxcbiAgICAgICAgMC4wMjU6IDI2LjEyLFxuICAgICAgICAwLjAxOiAyOS4xNCxcbiAgICAgICAgMC4wMDU6IDMxLjMyXG4gICAgfSxcbiAgICAxNToge1xuICAgICAgICAwLjk5NTogNC42LFxuICAgICAgICAwLjk5OiA1LjIzLFxuICAgICAgICAwLjk3NTogNi4yNyxcbiAgICAgICAgMC45NTogNy4yNixcbiAgICAgICAgMC45OiA4LjU1LFxuICAgICAgICAwLjU6IDE0LjM0LFxuICAgICAgICAwLjE6IDIyLjMxLFxuICAgICAgICAwLjA1OiAyNSxcbiAgICAgICAgMC4wMjU6IDI3LjQ5LFxuICAgICAgICAwLjAxOiAzMC41OCxcbiAgICAgICAgMC4wMDU6IDMyLjhcbiAgICB9LFxuICAgIDE2OiB7XG4gICAgICAgIDAuOTk1OiA1LjE0LFxuICAgICAgICAwLjk5OiA1LjgxLFxuICAgICAgICAwLjk3NTogNi45MSxcbiAgICAgICAgMC45NTogNy45NixcbiAgICAgICAgMC45OiA5LjMxLFxuICAgICAgICAwLjU6IDE1LjM0LFxuICAgICAgICAwLjE6IDIzLjU0LFxuICAgICAgICAwLjA1OiAyNi4zLFxuICAgICAgICAwLjAyNTogMjguODUsXG4gICAgICAgIDAuMDE6IDMyLFxuICAgICAgICAwLjAwNTogMzQuMjdcbiAgICB9LFxuICAgIDE3OiB7XG4gICAgICAgIDAuOTk1OiA1LjcsXG4gICAgICAgIDAuOTk6IDYuNDEsXG4gICAgICAgIDAuOTc1OiA3LjU2LFxuICAgICAgICAwLjk1OiA4LjY3LFxuICAgICAgICAwLjk6IDEwLjA5LFxuICAgICAgICAwLjU6IDE2LjM0LFxuICAgICAgICAwLjE6IDI0Ljc3LFxuICAgICAgICAwLjA1OiAyNy41OSxcbiAgICAgICAgMC4wMjU6IDMwLjE5LFxuICAgICAgICAwLjAxOiAzMy40MSxcbiAgICAgICAgMC4wMDU6IDM1LjcyXG4gICAgfSxcbiAgICAxODoge1xuICAgICAgICAwLjk5NTogNi4yNixcbiAgICAgICAgMC45OTogNy4wMSxcbiAgICAgICAgMC45NzU6IDguMjMsXG4gICAgICAgIDAuOTU6IDkuMzksXG4gICAgICAgIDAuOTogMTAuODcsXG4gICAgICAgIDAuNTogMTcuMzQsXG4gICAgICAgIDAuMTogMjUuOTksXG4gICAgICAgIDAuMDU6IDI4Ljg3LFxuICAgICAgICAwLjAyNTogMzEuNTMsXG4gICAgICAgIDAuMDE6IDM0LjgxLFxuICAgICAgICAwLjAwNTogMzcuMTZcbiAgICB9LFxuICAgIDE5OiB7XG4gICAgICAgIDAuOTk1OiA2Ljg0LFxuICAgICAgICAwLjk5OiA3LjYzLFxuICAgICAgICAwLjk3NTogOC45MSxcbiAgICAgICAgMC45NTogMTAuMTIsXG4gICAgICAgIDAuOTogMTEuNjUsXG4gICAgICAgIDAuNTogMTguMzQsXG4gICAgICAgIDAuMTogMjcuMixcbiAgICAgICAgMC4wNTogMzAuMTQsXG4gICAgICAgIDAuMDI1OiAzMi44NSxcbiAgICAgICAgMC4wMTogMzYuMTksXG4gICAgICAgIDAuMDA1OiAzOC41OFxuICAgIH0sXG4gICAgMjA6IHtcbiAgICAgICAgMC45OTU6IDcuNDMsXG4gICAgICAgIDAuOTk6IDguMjYsXG4gICAgICAgIDAuOTc1OiA5LjU5LFxuICAgICAgICAwLjk1OiAxMC44NSxcbiAgICAgICAgMC45OiAxMi40NCxcbiAgICAgICAgMC41OiAxOS4zNCxcbiAgICAgICAgMC4xOiAyOC40MSxcbiAgICAgICAgMC4wNTogMzEuNDEsXG4gICAgICAgIDAuMDI1OiAzNC4xNyxcbiAgICAgICAgMC4wMTogMzcuNTcsXG4gICAgICAgIDAuMDA1OiA0MFxuICAgIH0sXG4gICAgMjE6IHtcbiAgICAgICAgMC45OTU6IDguMDMsXG4gICAgICAgIDAuOTk6IDguOSxcbiAgICAgICAgMC45NzU6IDEwLjI4LFxuICAgICAgICAwLjk1OiAxMS41OSxcbiAgICAgICAgMC45OiAxMy4yNCxcbiAgICAgICAgMC41OiAyMC4zNCxcbiAgICAgICAgMC4xOiAyOS42MixcbiAgICAgICAgMC4wNTogMzIuNjcsXG4gICAgICAgIDAuMDI1OiAzNS40OCxcbiAgICAgICAgMC4wMTogMzguOTMsXG4gICAgICAgIDAuMDA1OiA0MS40XG4gICAgfSxcbiAgICAyMjoge1xuICAgICAgICAwLjk5NTogOC42NCxcbiAgICAgICAgMC45OTogOS41NCxcbiAgICAgICAgMC45NzU6IDEwLjk4LFxuICAgICAgICAwLjk1OiAxMi4zNCxcbiAgICAgICAgMC45OiAxNC4wNCxcbiAgICAgICAgMC41OiAyMS4zNCxcbiAgICAgICAgMC4xOiAzMC44MSxcbiAgICAgICAgMC4wNTogMzMuOTIsXG4gICAgICAgIDAuMDI1OiAzNi43OCxcbiAgICAgICAgMC4wMTogNDAuMjksXG4gICAgICAgIDAuMDA1OiA0Mi44XG4gICAgfSxcbiAgICAyMzoge1xuICAgICAgICAwLjk5NTogOS4yNixcbiAgICAgICAgMC45OTogMTAuMixcbiAgICAgICAgMC45NzU6IDExLjY5LFxuICAgICAgICAwLjk1OiAxMy4wOSxcbiAgICAgICAgMC45OiAxNC44NSxcbiAgICAgICAgMC41OiAyMi4zNCxcbiAgICAgICAgMC4xOiAzMi4wMSxcbiAgICAgICAgMC4wNTogMzUuMTcsXG4gICAgICAgIDAuMDI1OiAzOC4wOCxcbiAgICAgICAgMC4wMTogNDEuNjQsXG4gICAgICAgIDAuMDA1OiA0NC4xOFxuICAgIH0sXG4gICAgMjQ6IHtcbiAgICAgICAgMC45OTU6IDkuODksXG4gICAgICAgIDAuOTk6IDEwLjg2LFxuICAgICAgICAwLjk3NTogMTIuNCxcbiAgICAgICAgMC45NTogMTMuODUsXG4gICAgICAgIDAuOTogMTUuNjYsXG4gICAgICAgIDAuNTogMjMuMzQsXG4gICAgICAgIDAuMTogMzMuMixcbiAgICAgICAgMC4wNTogMzYuNDIsXG4gICAgICAgIDAuMDI1OiAzOS4zNixcbiAgICAgICAgMC4wMTogNDIuOTgsXG4gICAgICAgIDAuMDA1OiA0NS41NlxuICAgIH0sXG4gICAgMjU6IHtcbiAgICAgICAgMC45OTU6IDEwLjUyLFxuICAgICAgICAwLjk5OiAxMS41MixcbiAgICAgICAgMC45NzU6IDEzLjEyLFxuICAgICAgICAwLjk1OiAxNC42MSxcbiAgICAgICAgMC45OiAxNi40NyxcbiAgICAgICAgMC41OiAyNC4zNCxcbiAgICAgICAgMC4xOiAzNC4yOCxcbiAgICAgICAgMC4wNTogMzcuNjUsXG4gICAgICAgIDAuMDI1OiA0MC42NSxcbiAgICAgICAgMC4wMTogNDQuMzEsXG4gICAgICAgIDAuMDA1OiA0Ni45M1xuICAgIH0sXG4gICAgMjY6IHtcbiAgICAgICAgMC45OTU6IDExLjE2LFxuICAgICAgICAwLjk5OiAxMi4yLFxuICAgICAgICAwLjk3NTogMTMuODQsXG4gICAgICAgIDAuOTU6IDE1LjM4LFxuICAgICAgICAwLjk6IDE3LjI5LFxuICAgICAgICAwLjU6IDI1LjM0LFxuICAgICAgICAwLjE6IDM1LjU2LFxuICAgICAgICAwLjA1OiAzOC44OSxcbiAgICAgICAgMC4wMjU6IDQxLjkyLFxuICAgICAgICAwLjAxOiA0NS42NCxcbiAgICAgICAgMC4wMDU6IDQ4LjI5XG4gICAgfSxcbiAgICAyNzoge1xuICAgICAgICAwLjk5NTogMTEuODEsXG4gICAgICAgIDAuOTk6IDEyLjg4LFxuICAgICAgICAwLjk3NTogMTQuNTcsXG4gICAgICAgIDAuOTU6IDE2LjE1LFxuICAgICAgICAwLjk6IDE4LjExLFxuICAgICAgICAwLjU6IDI2LjM0LFxuICAgICAgICAwLjE6IDM2Ljc0LFxuICAgICAgICAwLjA1OiA0MC4xMSxcbiAgICAgICAgMC4wMjU6IDQzLjE5LFxuICAgICAgICAwLjAxOiA0Ni45NixcbiAgICAgICAgMC4wMDU6IDQ5LjY1XG4gICAgfSxcbiAgICAyODoge1xuICAgICAgICAwLjk5NTogMTIuNDYsXG4gICAgICAgIDAuOTk6IDEzLjU3LFxuICAgICAgICAwLjk3NTogMTUuMzEsXG4gICAgICAgIDAuOTU6IDE2LjkzLFxuICAgICAgICAwLjk6IDE4Ljk0LFxuICAgICAgICAwLjU6IDI3LjM0LFxuICAgICAgICAwLjE6IDM3LjkyLFxuICAgICAgICAwLjA1OiA0MS4zNCxcbiAgICAgICAgMC4wMjU6IDQ0LjQ2LFxuICAgICAgICAwLjAxOiA0OC4yOCxcbiAgICAgICAgMC4wMDU6IDUwLjk5XG4gICAgfSxcbiAgICAyOToge1xuICAgICAgICAwLjk5NTogMTMuMTIsXG4gICAgICAgIDAuOTk6IDE0LjI2LFxuICAgICAgICAwLjk3NTogMTYuMDUsXG4gICAgICAgIDAuOTU6IDE3LjcxLFxuICAgICAgICAwLjk6IDE5Ljc3LFxuICAgICAgICAwLjU6IDI4LjM0LFxuICAgICAgICAwLjE6IDM5LjA5LFxuICAgICAgICAwLjA1OiA0Mi41NixcbiAgICAgICAgMC4wMjU6IDQ1LjcyLFxuICAgICAgICAwLjAxOiA0OS41OSxcbiAgICAgICAgMC4wMDU6IDUyLjM0XG4gICAgfSxcbiAgICAzMDoge1xuICAgICAgICAwLjk5NTogMTMuNzksXG4gICAgICAgIDAuOTk6IDE0Ljk1LFxuICAgICAgICAwLjk3NTogMTYuNzksXG4gICAgICAgIDAuOTU6IDE4LjQ5LFxuICAgICAgICAwLjk6IDIwLjYsXG4gICAgICAgIDAuNTogMjkuMzQsXG4gICAgICAgIDAuMTogNDAuMjYsXG4gICAgICAgIDAuMDU6IDQzLjc3LFxuICAgICAgICAwLjAyNTogNDYuOTgsXG4gICAgICAgIDAuMDE6IDUwLjg5LFxuICAgICAgICAwLjAwNTogNTMuNjdcbiAgICB9LFxuICAgIDQwOiB7XG4gICAgICAgIDAuOTk1OiAyMC43MSxcbiAgICAgICAgMC45OTogMjIuMTYsXG4gICAgICAgIDAuOTc1OiAyNC40MyxcbiAgICAgICAgMC45NTogMjYuNTEsXG4gICAgICAgIDAuOTogMjkuMDUsXG4gICAgICAgIDAuNTogMzkuMzQsXG4gICAgICAgIDAuMTogNTEuODEsXG4gICAgICAgIDAuMDU6IDU1Ljc2LFxuICAgICAgICAwLjAyNTogNTkuMzQsXG4gICAgICAgIDAuMDE6IDYzLjY5LFxuICAgICAgICAwLjAwNTogNjYuNzdcbiAgICB9LFxuICAgIDUwOiB7XG4gICAgICAgIDAuOTk1OiAyNy45OSxcbiAgICAgICAgMC45OTogMjkuNzEsXG4gICAgICAgIDAuOTc1OiAzMi4zNixcbiAgICAgICAgMC45NTogMzQuNzYsXG4gICAgICAgIDAuOTogMzcuNjksXG4gICAgICAgIDAuNTogNDkuMzMsXG4gICAgICAgIDAuMTogNjMuMTcsXG4gICAgICAgIDAuMDU6IDY3LjUsXG4gICAgICAgIDAuMDI1OiA3MS40MixcbiAgICAgICAgMC4wMTogNzYuMTUsXG4gICAgICAgIDAuMDA1OiA3OS40OVxuICAgIH0sXG4gICAgNjA6IHtcbiAgICAgICAgMC45OTU6IDM1LjUzLFxuICAgICAgICAwLjk5OiAzNy40OCxcbiAgICAgICAgMC45NzU6IDQwLjQ4LFxuICAgICAgICAwLjk1OiA0My4xOSxcbiAgICAgICAgMC45OiA0Ni40NixcbiAgICAgICAgMC41OiA1OS4zMyxcbiAgICAgICAgMC4xOiA3NC40LFxuICAgICAgICAwLjA1OiA3OS4wOCxcbiAgICAgICAgMC4wMjU6IDgzLjMsXG4gICAgICAgIDAuMDE6IDg4LjM4LFxuICAgICAgICAwLjAwNTogOTEuOTVcbiAgICB9LFxuICAgIDcwOiB7XG4gICAgICAgIDAuOTk1OiA0My4yOCxcbiAgICAgICAgMC45OTogNDUuNDQsXG4gICAgICAgIDAuOTc1OiA0OC43NixcbiAgICAgICAgMC45NTogNTEuNzQsXG4gICAgICAgIDAuOTogNTUuMzMsXG4gICAgICAgIDAuNTogNjkuMzMsXG4gICAgICAgIDAuMTogODUuNTMsXG4gICAgICAgIDAuMDU6IDkwLjUzLFxuICAgICAgICAwLjAyNTogOTUuMDIsXG4gICAgICAgIDAuMDE6IDEwMC40MixcbiAgICAgICAgMC4wMDU6IDEwNC4yMlxuICAgIH0sXG4gICAgODA6IHtcbiAgICAgICAgMC45OTU6IDUxLjE3LFxuICAgICAgICAwLjk5OiA1My41NCxcbiAgICAgICAgMC45NzU6IDU3LjE1LFxuICAgICAgICAwLjk1OiA2MC4zOSxcbiAgICAgICAgMC45OiA2NC4yOCxcbiAgICAgICAgMC41OiA3OS4zMyxcbiAgICAgICAgMC4xOiA5Ni41OCxcbiAgICAgICAgMC4wNTogMTAxLjg4LFxuICAgICAgICAwLjAyNTogMTA2LjYzLFxuICAgICAgICAwLjAxOiAxMTIuMzMsXG4gICAgICAgIDAuMDA1OiAxMTYuMzJcbiAgICB9LFxuICAgIDkwOiB7XG4gICAgICAgIDAuOTk1OiA1OS4yLFxuICAgICAgICAwLjk5OiA2MS43NSxcbiAgICAgICAgMC45NzU6IDY1LjY1LFxuICAgICAgICAwLjk1OiA2OS4xMyxcbiAgICAgICAgMC45OiA3My4yOSxcbiAgICAgICAgMC41OiA4OS4zMyxcbiAgICAgICAgMC4xOiAxMDcuNTcsXG4gICAgICAgIDAuMDU6IDExMy4xNCxcbiAgICAgICAgMC4wMjU6IDExOC4xNCxcbiAgICAgICAgMC4wMTogMTI0LjEyLFxuICAgICAgICAwLjAwNTogMTI4LjNcbiAgICB9LFxuICAgIDEwMDoge1xuICAgICAgICAwLjk5NTogNjcuMzMsXG4gICAgICAgIDAuOTk6IDcwLjA2LFxuICAgICAgICAwLjk3NTogNzQuMjIsXG4gICAgICAgIDAuOTU6IDc3LjkzLFxuICAgICAgICAwLjk6IDgyLjM2LFxuICAgICAgICAwLjU6IDk5LjMzLFxuICAgICAgICAwLjE6IDExOC41LFxuICAgICAgICAwLjA1OiAxMjQuMzQsXG4gICAgICAgIDAuMDI1OiAxMjkuNTYsXG4gICAgICAgIDAuMDE6IDEzNS44MSxcbiAgICAgICAgMC4wMDU6ID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ZSBwcm9iYWJpbGl0eSB0aGF0IGEgdmFsdWUgaW4gYVxuICogbm9ybWFsIGRpc3RyaWJ1dGlvbiB3aXRoIHN0YW5kYXJkIGRldmlhdGlvbiBzZCBpcyB3aXRoaW4geCBvZiB0aGUgbWVhbi5cbiAqXG4gKiBUaGlzIGZ1bmN0aW9uIHJldHVybnMgYSBudW1lcmljYWwgYXBwcm94aW1hdGlvbiB0byB0aGUgZXhhY3QgdmFsdWUuXG4gKiBJdCB1c2VzIEhvcm5lcidzIG1ldGhvZCB0byBldmFsdWF0ZSB0aGUgcG9seW5vbWlhbCBvZiDPhCAodGF1KS5cbiAqXG4gKiBAcGFyYW0ge251bWJlcn0geCBpbnB1dFxuICogQHJldHVybiB7bnVtYmVyfSBlcnJvciBlc3RpbWF0aW9uXG4gKiBAZXhhbXBsZVxuICogZXJyb3JGdW5jdGlvbigxKS50b0ZpeGVkKDIpOyAvLyA9PiAnMC44NCdcbiAqL1xuZnVuY3Rpb24gZXJyb3JGdW5jdGlvbih4KSB7XG4gICAgdmFyIHQgPSAxIC8gKDEgKyAwLjUgKiBNYXRoLmFicyh4KSk7XG4gICAgdmFyIHRhdSA9XG4gICAgICAgIHQgKlxuICAgICAgICBNYXRoLmV4cChcbiAgICAgICAgICAgIC14ICogeCArXG4gICAgICAgICAgICAgICAgKCgoKCgoKCgwLjE3MDg3Mjc3ICogdCAtIDAuODIyMTUyMjMpICogdCArIDEuNDg4NTE1ODcpICogdCAtXG4gICAgICAgICAgICAgICAgICAgIDEuMTM1MjAzOTgpICpcbiAgICAgICAgICAgICAgICAgICAgdCArXG4gICAgICAgICAgICAgICAgICAgIDAuMjc4ODY4MDcpICpcbiAgICAgICAgICAgICAgICAgICAgdCAtXG4gICAgICAgICAgICAgICAgICAgIDAuMTg2Mjg4MDYpICpcbiAgICAgICAgICAgICAgICAgICAgdCArXG4gICAgICAgICAgICAgICAgICAgIDAuMDk2Nzg0MTgpICpcbiAgICAgICAgICAgICAgICAgICAgdCArXG4g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gICB9XG4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICAvLyBhbHRlcm5hdGl2ZSA9PT0gJ2xlc3MnXG4gICAgICAgIGZvciAodmFyIGkkMyA9IDA7IGkkMyA8PSBrOyBpJDMrKykge1xuICAgICAgICAgICAgLyogYzggaWdub3JlIHN0YXJ0ICovXG4gICAgICAgICAgICBpZiAodGVzdFN0YXREc25baSQzXSA8PSB0ZXN0U3RhdGlzdGljKSB7XG4gICAgICAgICAgICAgICAgbnVtRXh0cmVtZVRTdGF0cyArPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLyogYzggaWdub3JlIGVuZCAqL1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIG51bUV4dHJlbWVUU3RhdHMgLyBrO1xufVxuXG4vKipcbiAqIFtTaWduXShodHRwczovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9TaWduX2Z1bmN0aW9uKSBpcyBhIGZ1bmN0aW9uXG4gKiB0aGF0IGV4dHJhY3RzIHRoZSBzaWduIG9mIGEgcmVhbCBudW1iZXJcbiAqXG4gKiBAcGFyYW0ge251bWJlcn0geCBpbnB1dCB2YWx1ZVxuICogQHJldHVybnMge251bWJlcn0gc2lnbiB2YWx1ZSBlaXRoZXIgMSwgMCBvciAtMVxuICogQHRocm93cyB7VHlwZUVycm9yfSBpZiB0aGUgaW5wdXQgYXJndW1lbnQgeCBpcyBub3QgYSBudW1iZXJcbiAqIEBwcml2YXRlXG4gKlxuICogQGV4YW1wbGVcbiAqIHNpZ24oMik7IC8vID0+IDFcbiAqL1xuZnVuY3Rpb24gc2lnbih4KSB7XG4gICAgaWYgKHR5cGVvZiB4ID09PSBcIm51bWJlclwiKSB7XG4gICAgICAgIGlmICh4IDwgMCkge1xuICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICB9IGVsc2UgaWYgKHggPT09IDApIHtcbiAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICB9IGVsc2Uge1x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bnRzXCIpO1xuICAgIH1cbiAgICB2YXIgZ3JvdXBpbmdzID0gY3JlYXRlR3JvdXBzKGxhYmVscyk7XG4gICAgdmFyIGRpc3RhbmNlcyA9IGNhbGN1bGF0ZUFsbERpc3RhbmNlcyhwb2ludHMpO1xuICAgIHZhciByZXN1bHQgPSBbXTtcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBvaW50cy5sZW5ndGg7IGkrKykge1xuICAgICAgICB2YXIgcyA9IDA7XG4gICAgICAgIGlmIChncm91cGluZ3NbbGFiZWxzW2ldXS5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICB2YXIgYSA9IG1lYW5EaXN0YW5jZUZyb21Qb2ludFRvR3JvdXAoXG4gICAgICAgICAgICAgICAgaSxcbiAgICAgICAgICAgICAgICBncm91cGluZ3NbbGFiZWxzW2ldXSxcbiAgICAgICAgICAgICAgICBkaXN0YW5jZXNcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICB2YXIgYiA9IG1lYW5EaXN0YW5jZVRvTmVhcmVzdEdyb3VwKFxuICAgICAgICAgICAgICAgIGksXG4gICAgICAgICAgICAgICAgbGFiZWxzLFxuICAgICAgICAgICAgICAgIGdyb3VwaW5ncyxcbiAgICAgICAgICAgICAgICBkaXN0YW5jZXNcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBzID0gKGIgLSBhKSAvIE1hdGgubWF4KGEsIGIpO1xuICAgICAgICB9XG4gICAgICAgIHJlc3VsdC5wdXNoKHMpO1xuICAgIH1cbiAgICByZXR1cm4gcmVzdWx0O1xufVxuXG4vKipcbiAqIENyZWF0ZSBhIGxvb2t1cCB0YWJsZSBtYXBwaW5nIGdyb3VwIElEcyB0byBwb2ludCBJRHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7QXJyYXk8bnVtYmVyPn0gbGFiZWxzIExhYmVscyBvZiBwb2ludHMuIFRoaXMgbXVzdCBiZSB0aGUgc2FtZSBsZW5ndGggYXMgYHBvaW50c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GVmaW5lUHJvcGVydHkoZXhwb3J0cywga2V5LCB7IGVudW1lcmFibGU6IHRydWUsIGdldDogZGVmaW5pdGlvbltrZXldIH0pO1xuXHRcdH1cblx0fVxufTsiLCJfX3dlYnBhY2tfcmVxdWlyZV9fLm8gPSAob2JqLCBwcm9wKSA9PiAoT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iaiwgcHJvcCkpIiwiLy8gZGVmaW5lIF9fZXNNb2R1bGUgb24gZXhwb3J0c1xuX193ZWJwYWNrX3JlcXVpcmVfXy5yID0gKGV4cG9ydHMpID0+IHtcblx0aWYodHlwZW9mIFN5bWJvbCAhPT0gJ3VuZGVmaW5lZCcgJiYgU3ltYm9sLnRvU3RyaW5nVGFnKSB7XG5cdFx0T2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFN5bWJvbC50b1N0cmluZ1RhZywgeyB2YWx1ZTogJ01vZHVsZScgfSk7XG5cdH1cblx0T2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICdfX2VzTW9kdWxlJywgeyB2YWx1ZTogdHJ1ZSB9KTtcbn07IiwiX193ZWJwYWNrX3JlcXVpcmVfXy5uYyA9IHVuZGVmaW5lZDsiLCJpbXBvcnQgJy4vY3NzL2luZGV4LmNzcydcclxuZXhwb3J0ICogZnJvbSAnLi9ldXJvc3RhdC1tYXAnXHJcbi8vZXhwb3J0IHsgc3RhdERhdGEgfSBmcm9tIFwiLi9jb3JlL3N0YXQtZGF0YS5qc1wiO1xyXG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/src/maptypes/map-flow.js b/src/maptypes/map-flow.js index 98d83fa9..1296ffac 100644 --- a/src/maptypes/map-flow.js +++ b/src/maptypes/map-flow.js @@ -16,8 +16,8 @@ export const map = function (config) { //create map object to return, using the template const out = StatMap.statMap(config, true) out.strokeWidthScale = scaleLinear() - out.labelOffsetX = 10 - out.labelOffsetY = 0 + out.labelOffsetX = 15 + out.labelOffsetY = 5 out.labelFormatter = (d) => format('.2s')(d) /** @@ -93,13 +93,13 @@ export const map = function (config) { // Add flow gradients addFlowGradients(defs, gradientIds, links) - // Add geographical layers - //addGeographicalLayers(svg, geometries, poi, exporters, countryBorders) - // Define our container SVG const zoomGroup = select('#em-zoom-group-' + out.svgId_) const sankeyContainer = zoomGroup.append('g').attr('class', 'sankey-container') + // Add geographical layers + addOverlayPolygons(sankeyContainer, graph) + // Add Sankey flows addSankeyFlows(sankeyContainer, links, arrowId, arrowOutlineId, gradientIds) @@ -114,45 +114,43 @@ export const map = function (config) { /** * Adds geographical layers (regions, POI overlay, borders) - * @param {Object} svg - D3 selection of SVG - * @param {Array} geometries - Geographical shapes for regions - * @param {Object} poi - Points of interest data - * @param {Set} exporters - Exporters data - * @param {Array} countryBorders - Borders data + * @param {Object} svg - D3 selection of SVG container */ - function addGeographicalLayers(svg, geometries, poi, exporters, countryBorders) { - const path = out._pathFunction + function addOverlayPolygons(svg, graph) { + const importerIds = [] + const exporterIds = [] + + const features = out.Geometries.geoJSONs.nutsrg.concat(out.Geometries.geoJSONs.cntrg) + if (features) { + graph.nodes.forEach((node) => { + const overlay = features.find((feature) => { + if (node.id == feature.properties.id) return feature + }) - // Regions - svg.append('g') - .attr('class', 'regions') - .selectAll('path') - .data(geometries) - .join('path') - .attr('d', path) - .attr('fill', '#f4f4f4') - .attr('stroke', 'none') - - // Overlay for exporters and importers - svg.append('g') - .attr('class', 'importers-overlay') - .selectAll('path') - .data(poi.features) - .join('path') - .attr('d', path) - .attr('fill', (d) => (exporters.has(d.properties.id) ? '#c7e3c6' : '#bbd7ee')) - .attr('stroke', 'none') - - // National borders - svg.append('g') - .attr('class', 'borders') - .selectAll('path') - .data(countryBorders) - .join('path') - .attr('d', path) - .attr('fill', 'none') - .attr('stroke', 'grey') - .attr('stroke-width', 0.3) + if (overlay) { + let isImporter = graph.links.some((link) => link.source == node.id) + if (isImporter) { + importerIds.push(node.id) + } else { + exporterIds.push(node.id) + } + } else { + console.error('could not find geometry for', node.id) + } + }) + + //update existing region fills + let selector = out.geo_ === 'WORLD' ? '#em-worldrg path' : '#em-nutsrg path' + if (out.Geometries.userGeometries) selector = '#em-user-regions path' // for user-defined geometries + const allRegions = out.svg_.selectAll(selector) + + allRegions.each(function () { + select(this).style('fill', (region) => { + if (importerIds.includes(region.properties.id)) return '#bbd7ee' + if (exporterIds.includes(region.properties.id)) return '#c7e3c6' + }) + }) + } } // if nodes in the graph dont have coordinates specified by the user then use nuts2json centroids instead @@ -279,6 +277,7 @@ export const map = function (config) { */ function addLabels(svg, nodes) { // for aligning left or right + //TODO: get midpoint of flow source point, not map const mapMidpointX = svg.node().getBoundingClientRect().width / 2 svg.append('g') @@ -286,6 +285,7 @@ export const map = function (config) { .selectAll('text') .data(nodes.filter((node) => node.targetLinks && node.sourceLinks.length == 0)) .join('text') + .attr('text-anchor', (d) => (d.x > mapMidpointX ? 'start' : 'end')) .attr('x', (d) => { const x = d.x return x > mapMidpointX ? x + out.labelOffsetX : x - out.labelOffsetX diff --git a/test/map-types/flow-map/test_flow.html b/test/map-types/flow-map/test_flow.html index 602585b5..d833aba1 100644 --- a/test/map-types/flow-map/test_flow.html +++ b/test/map-types/flow-map/test_flow.html @@ -49,7 +49,7 @@ .nutsLevel(0) .legend({ x: 10, y: 120, title: 'Test', boxOpacity: 0, barChart: false }) .drawCoastalMargin(false) - .insets('default') + .insets(false) .zoomExtent([1, 10]) .build()