From e6d2bd684176a3d4711b52b20eb1710821bb5967 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Tue, 5 Dec 2017 22:39:19 +0000 Subject: [PATCH] 1.10.292 [ci skip] --- build/ccxt.browser.js | 6 +++--- ccxt.js | 2 +- ccxt.php | 2 +- package.json | 2 +- php/bithumb.php | 2 +- python/ccxt/__init__.py | 2 +- python/ccxt/async/__init__.py | 2 +- python/ccxt/async/base/exchange.py | 2 +- python/ccxt/async/bithumb.py | 2 +- python/ccxt/base/exchange.py | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/ccxt.browser.js b/build/ccxt.browser.js index 0686c0720810..65438573b473 100644 --- a/build/ccxt.browser.js +++ b/build/ccxt.browser.js @@ -45,7 +45,7 @@ const errors = require ('./js/base/errors') //----------------------------------------------------------------------------- // this is updated by vss.js when building -const version = '1.10.291' +const version = '1.10.292' Exchange.ccxtVersion = version @@ -5410,7 +5410,7 @@ module.exports = class bithumb extends Exchange { for (let i = 0; i < currencies.length; i++) { let id = currencies[i]; if (id != 'date') { - let market = markets[id]; + let market = markets['data'][id]; let base = id; let quote = 'KRW'; let symbol = id + '/' + quote; @@ -33473,4 +33473,4 @@ exports.isBuffer = function isBuffer(obj) { }; },{}]},{},[1]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJjY3h0LmJyb3dzZXIuanMiLCJjY3h0LmpzIiwianMvXzFicm9rZXIuanMiLCJqcy9fMWJ0Y3hlLmpzIiwianMvYWN4LmpzIiwianMvYWxsY29pbi5qcyIsImpzL2FueHByby5qcyIsImpzL2Jhc2UvRXhjaGFuZ2UuanMiLCJqcy9iYXNlL01hcmtldC5qcyIsImpzL2Jhc2UvZXJyb3JzLmpzIiwianMvYmFzZS9mdW5jdGlvbnMuanMiLCJqcy9iYXNlL3Rocm90dGxlLmpzIiw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ICAgICByZXF1aXJlICgnLi9qcy9hbnhwcm8uanMnKSxcbiAgICAnYmluYW5jZSc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaW5hbmNlLmpzJyksXG4gICAgJ2JpdDJjJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0MmMuanMnKSxcbiAgICAnYml0YmF5JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRiYXkuanMnKSxcbiAgICAnYml0Y29pbmNvaWQnOiAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRjb2luY29pZC5qcycpLFxuICAgICdiaXRmaW5leCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZpbmV4LmpzJyksXG4gICAgJ2JpdGZpbmV4Mic6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0ZmluZXgyLmpzJyksXG4gICAgJ2JpdGZseWVyJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0Zmx5ZXIuanMnKSxcbiAgICAnYml0aHVtYic6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRodW1iLmpzJyksXG4gICAgJ2JpdGxpc2gnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0bGlzaC5qcycpLFxuICAgICdiaXRtYXJrZXQnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdG1hcmtldC5qcycpLFxuICAgICdiaXRtZXgnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdG1leC5qcycpLFxuICAgICdiaXRzbyc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHNvLmpzJyksXG4gICAgJ2JpdHN0YW1wJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0c3RhbXAuanMnKSxcbiAgICAnYml0c3RhbXAxJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRzdGFtcDEuanMnKSxcbiAgICAnYml0dHJleCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXR0cmV4LmpzJyksXG4gICAgJ2JsM3AnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmwzcC5qcycpLFxuICAgICdibGV1dHJhZGUnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JsZXV0cmFkZS5qcycpLFxuICAgICdidGNib3gnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2JveC5qcycpLFxuICAgICdidGNjaGluYSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2NoaW5hLmpzJyksXG4gICAgJ2J0Y2V4Y2hhbmdlJzogICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjZXhjaGFuZ2UuanMnKSxcbiAgICAnYnRjbWFya2V0cyc6ICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNtYXJrZXRzLmpzJyksXG4gICAgJ2J0Y3RyYWRldWEnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjdHJhZGV1YS5qcycpLFxuICAgICdidGN0dXJrJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y3R1cmsuanMnKSxcbiAgICAnYnRjeCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGN4LmpzJyksXG4gICAgJ2J0ZXInOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRlci5qcycpLFxuICAgICdieGludGgnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J4aW50aC5qcycpLFxuICAgICdjY2V4JzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NjZXguanMnKSxcbiAgICAnY2V4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jZXguanMnKSxcbiAgICAnY2hidGMnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jaGJ0Yy5qcycpLFxuICAgICdjaGlsZWJpdCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NoaWxlYml0LmpzJyksXG4gICAgJ2NvaW5jaGVjayc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmNoZWNrLmpzJyksXG4gICAgJ2NvaW5mbG9vcic6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmZsb29yLmpzJyksXG4gICAgJ2NvaW5naSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmdpLmpzJyksXG4gICAgJ2NvaW5tYXJrZXRjYXAnOiAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbm1hcmtldGNhcC5qcycpLFxuICAgICdjb2lubWF0ZSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5tYXRlLmpzJyksXG4gICAgJ2NvaW5zZWN1cmUnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbnNlY3VyZS5qcycpLFxuICAgICdjb2luc3BvdCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5zcG90LmpzJyksXG4gICAgJ2NyeXB0b3BpYSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY3J5cHRvcGlhLmpzJyksXG4gICAgJ2RzeCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZHN4LmpzJyksXG4gICAgJ2V4bW8nOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZXhtby5qcycpLFxuICAgICdmbG93YnRjJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2Zsb3didGMuanMnKSxcbiAgICAnZm94Yml0JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9mb3hiaXQuanMnKSxcbiAgICAnZnlic2UnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9meWJzZS5qcycpLFxuICAgICdmeWJzZyc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2Z5YnNnLmpzJyksXG4gICAgJ2dhdGVjb2luJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2F0ZWNvaW4uanMnKSxcbiAgICAnZ2F0ZWlvJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nYXRlaW8uanMnKSxcbiAgICAnZ2RheCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nZGF4LmpzJyksXG4gICAgJ2dlbWluaSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2VtaW5pLmpzJyksXG4gICAgJ2hpdGJ0Yyc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaGl0YnRjLmpzJyksXG4gICAgJ2hpdGJ0YzInOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaGl0YnRjMi5qcycpLFxuICAgICdodW9iaSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2h1b2JpLmpzJyksXG4gICAgJ2h1b2JpY255JzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaHVvYmljbnkuanMnKSxcbiAgICAnaHVvYmlwcm8nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9odW9iaXByby5qcycpLFxuICAgICdpbmRlcGVuZGVudHJlc2VydmUnOiAgICAgIHJlcXVpcmUgKCcuL2pzL2luZGVwZW5kZW50cmVzZXJ2ZS5qcycpLFxuICAgICdpdGJpdCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2l0Yml0LmpzJyksXG4gICAgJ2p1YmknOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvanViaS5qcycpLFxuICAgICdrcmFrZW4nOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2tyYWtlbi5qcycpLFxuICAgICdrdW5hJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2t1bmEuanMnKSxcbiAgICAnbGFrZWJ0Yyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9sYWtlYnRjLmpzJyksXG4gICAgJ2xpcXVpJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGlxdWkuanMnKSxcbiAgICAnbGl2ZWNvaW4nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9saXZlY29pbi5qcycpLFxuICAgICdsdW5vJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2x1bm8uanMnKSxcbiAgICAnbWVyY2Fkbyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9tZXJjYWRvLmpzJyksXG4gICAgJ21peGNvaW5zJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbWl4Y29pbnMuanMnKSxcbiAgICAnbm92YSc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ub3ZhLmpzJyksXG4gICAgJ29rY29pbmNueSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvb2tjb2luY255LmpzJyksXG4gICAgJ29rY29pbnVzZCc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvb2tjb2ludXNkLmpzJyksXG4gICAgJ29rZXgnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvb2tleC5qcycpLFxuICAgICdwYXltaXVtJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3BheW1pdW0uanMnKSxcbiAgICAncG9sb25pZXgnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9wb2xvbmlleC5qcycpLFxuICAgICdxcnlwdG9zJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3FyeXB0b3MuanMnKSxcbiAgICAncXVhZHJpZ2FjeCc6ICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9xdWFkcmlnYWN4LmpzJyksXG4gICAgJ3F1b2luZSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcXVvaW5lLmpzJyksXG4gICAgJ3NvdXRoeGNoYW5nZSc6ICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc291dGh4Y2hhbmdlLmpzJyksXG4gICAgJ3N1cmJpdGNvaW4nOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc3VyYml0Y29pbi5qcycpLFxuICAgICd0aGVyb2NrJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3RoZXJvY2suanMnKSxcbiAgICAndGlkZXgnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy90aWRleC5qcycpLFxuICAgICd1cmR1Yml0JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3VyZHViaXQuanMnKSxcbiAgICAndmF1bHRvcm8nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92YXVsdG9yby5qcycpLFxuICAgICd2YnRjJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3ZidGMuanMnKSxcbiAgICAndmlyd294JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92aXJ3b3guanMnKSxcbiAgICAnd2V4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy93ZXguanMnKSxcbiAgICAneGJ0Y2UnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy94YnRjZS5qcycpLFxuICAgICd5b2JpdCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3lvYml0LmpzJyksXG4gICAgJ3l1bmJpJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMveXV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ICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdfMWJyb2tlcicsXG4gICAgICAgICAgICAnbmFtZSc6ICcxQnJva2VyJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVVMnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MicsXG4gICAgICAgICAgICAnaGFzUHVibGljQVBJJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICc5MDAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICczNjAwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnODY0MDAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYwMjEtNDIwYmQ5ZmMtNWVjYi0xMWU3LThlZDYtNTZkMDA4MWVmZWQyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovLzFicm9rZXIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovLzFicm9rZXIuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vMWJyb2tlci5jb20vP2M9ZW4vY29udGVudC9hcGktZG9jdW1lbnRhdGlvbicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2JhcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9jYXRlZ29yaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9xdW90ZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29wZW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbG9zZV9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2VkaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL29wZW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3NoYXJlZC9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NvY2lhbC9wcm9maWxlX3N0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NvY2lhbC9wcm9maWxlX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9iaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL292ZXJ2aWV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3F1b3RhX3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci90cmFuc2FjdGlvbl9sb2cnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaENhdGVnb3JpZXMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRNYXJrZXRDYXRlZ29yaWVzICgpO1xuICAgICAgICAvLyB0aGV5IHJldHVybiBhbiBlbXB0eSBzdHJpbmcgYW1vbmcgdGhlaXIgY2F0ZWdvcmllcywgd3RmP1xuICAgICAgICBsZXQgY2F0ZWdvcmllcyA9IHJlc3BvbnNlWydyZXNwb25zZSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY2F0ZWdvcmllcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKGNhdGVnb3JpZXNbaV0pXG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKGNhdGVnb3JpZXNbaV0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHRoaXNfID0gdGhpczsgLy8gd29ya2Fyb3VuZCBmb3IgQmFiZW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XNlID0gcGFydHNbMF07XG4gICAgICAgICAgICAgICAgICAgIHF1b3RlID0gcGFydHNbMV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9IGlkO1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9ICdVU0QnO1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlzXy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpc18uY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICAgICAnb3RoZXJmaWVsZCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvbmVtb3JlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyT3ZlcnZpZXcgKC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ib29rID0gYXdhaXQgdGhpcy5mZXRjaE9yZGVyQm9vayAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3VsdFsncmVzcG9uc2UnXVswXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0aWNrZXJbJ2RhdGUnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbCddKSxcbiAgICAgICAgICAgICdiaWQnOiBvcmRlcmJvb2tbJ2JpZHMnXVswXVswXSxcbiAgICAgICAgICAgICdhc2snOiBvcmRlcmJvb2tbJ2Fza3MnXVswXVswXSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ28nXSksXG4gICAgICAgICAgICAnY2xvc2UnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2MnXSksXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAg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pZiAobGltaXQpXG4gICAgICAgICAgICByZXF1ZXN0WydsaW1pdCddID0gbGltaXQ7XG4gICAgICAgIGxldCByZXN1bHQgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRNYXJrZXRCYXJzICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT0hMQ1ZzIChyZXN1bHRbJ3Jlc3BvbnNlJ10sIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ21hcmdpbic6IGFtb3VudCxcbiAgICAgICAgICAgICdkaXJlY3Rpb24nOiAoc2lkZSA9PSAnc2VsbCcpID8gJ3Nob3J0JyA6ICdsb25nJyxcbiAgICAgICAgICAgICdsZXZlcmFnZSc6IDEsXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBlbHNlXG4gICAgICAgICAgICBvcmRlclsndHlwZSddICs9ICdfbWFya2V0JztcbiAgICAgICAgbGV0IHJlc3VsdCA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE9yZGVyQ3JlYXRlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gIC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LCB7XG4gICAgICAgICAgICAnaWQnOiAnXzFidGN4ZScsXG4gICAgICAgICAgICAnbmFtZSc6ICcxQlRDWEUnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdQQScsIC8vIFBhbmFtYVxuICAgICAgICAgICAgJ2NvbW1lbnQnOiAnQ3J5cHRvIENhcGl0YWwgQVBJJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMWQnOiAnMXllYXInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYwNDktMmIyOTQ0MDgtNWVjYy0xMWU3LTg1Y2MtYWRhZmYwMTNkYzFhLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovLzFidGN4ZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vMWJ0Y3hlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovLzFidGN4ZS5jb20vYXBpLWRvY3MucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcmljYWwtcHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci1ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzLWFuZC1pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci10cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J0Yy1kZXBvc2l0LWFkZHJlc3MvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidGMtZGVwb3NpdC1hZGRyZXNzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9lZGl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdVU0QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnRVVSJywgJ3N5b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7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ21ha2VyX3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYW5zYWN0aW9ucyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0cmFkZXMgPSB0aGlzLm9taXQgKHJlc3BvbnNlWyd0cmFuc2FjdGlvbnMnXSwgJ3JlcXVlc3RfY3VycmVuY3knKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHRyYWRlcywgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcm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cbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0IChhbW91bnQpLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncmVzdWx0J11bJ3V1aWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICh0aGlzLmlkID09ICdjcnlwdG9jYXBpdGFsJylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBpcyBhbiBhYnN0cmFjdCBiYXNlIEFQSSBmb3IgXzFidGN4ZScpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhcGlfa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgIC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xcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMTIwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzcyMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICczZCc6ICc0MzIwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzAyNDc2MTQtMWZlNjFjNzQtOTYyMS0xMWU3LTllOGMtZjFhNjI3YWZhMjc5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuanNvbicsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FjeC5pby9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hY3guaW8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hY3guaW8vZG9jdW1lbnRzL2FwaV92MicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLCAvLyBHZXQgYWxsIGF2YWlsYWJsZSBtYXJrZXRzXG4gICAgIC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ltZSwgaW4gc2Vjb25kcyBzaW5jZSBVbml4IGVwb2NoXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZW1iZXJzL21lJywgLy8gR2V0IHlvdXIgcHJvZmlsZSBhbmQgYWNjb3VudHMgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzJywgLy8gR2V0IHlvdXIgZGVwb3NpdHMgaGlzdG9yeVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLCAvLyBHZXQgZGV0YWlscyBvZiBzcGVjaWZpYyBkZXBvc2l0XG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9hZGRyZXNzJywgLy8gV2hlcmUgdG8gZGVwb3NpdCBUaGUgYWRkcmVzcyBmaWVsZCBjb3VsZCBiZSBlbXB0eSB3aGVuIGEgbmV3IGFkZHJlc3MgaXMgZ2VuZXJhdGluZyAoZS5nLiBmb3IgYml0Y29pbiksIHlvdSBzaG91bGQgdHJ5IGFnYWluIGxhdGVyIGluIHRoYXQgY2FzZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLCAvLyBHZXQgeW91ciBvcmRlcnMsIHJlc3VsdHMgaXMgcGFnaW5hdGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLCAvLyBHZXQgaW5mb3JtYXRpb24gb2Ygc3BlY2lmaWVkIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL215JywgLy8gR2V0IHlvdXIgZXhlY3V0ZWQgdHJhZGVzIFRyYWRlcyBhcmUgc29ydGVkIGluIHJldmVyc2UgY3JlYXRpb24gb3JkZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdzJywgLy8gR2V0IHlvdXIgY3J5cHRvY3VycmVuY3kgd2l0aGRyYXdzXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLCAvLyBHZXQgeW91ciBjcnlwdG9jdXJyZW5jeSB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLCAvLyBDcmVhdGUgYSBTZWxsL0J1eSBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9tdWx0aScsIC8vIENyZWF0ZSBtdWx0aXBsZSBzZWxsL2J1eSBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvY2xlYXInLCAvLyBDYW5jZWwgYWxsIG15IG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RlbGV0ZScsIC8vIENhbmNlbCBhbiBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JywgLy8gQ3JlYXRlIGEgd2l0aGRyYXdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRNZW1iZXJzTWUgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydhY2NvdW50cyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgIC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eSAocmVzdWx0Wydhc2tzJ10sIDApO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWydhdCddICogMTAwMDtcbiAgICAgICAgdGlja2VyID0gdGlja2VyWyd0aWNrZXInXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnLCB1bmRlZmluZWQpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnLCB1bmRlZmluZWQpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknLCB1bmRlZmluZWQpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJywgdW5kZWZpbmVkKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICds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IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaWRdO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2Vyc01hcmtldCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAocmVzcG9uc2UsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge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HF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHJlcXVlc3Q7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmtleXNvcnQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FjY2Vzc19rZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAndG9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbWV0aG9kICsgJ3wnICsgcmVxdWVzdCArICd8JyArIHF1ZXJ5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGxldCBzdWZmaXggPSBxdWVyeSArICcmc2lnbmF0dXJlPScgKyBzaWduYXR1cmU7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHN1ZmZpeDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICA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GNsYXNzIGFsbGNvaW4gZXh0ZW5kcyBva2NvaW51c2Qge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2FsbGNvaW4nLFxuICAgICAgICAgICAgJ25hbWUnOiAnQWxsY29pbicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0NBJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnZXh0ZW5zaW9uJzogJycsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMxNTYxODA5LWMzMTZiMzdjLWIwNjEtMTFlNy04ZDVhLWI1NDdiNGQ3MzBlYi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly9hbGxjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuYWxsY29pbi5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYWxsY29pbi5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hbGxjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2FsbGNvaW4uY29tL0Fib3V0L0FQSVJlZmVyZW5jZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldG92ZXJ2aWV3cy8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXRjaF90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnNfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB1bmRlZmluZWQsXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gWyAnQlRDJywgJ0VUSCcsICdVU0QnLCAnUVRVTScgXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldE1hcmtldG92ZXJ2aWV3cyAoe1xuICAgICAgICAgICAgICAgICd0eXBlJzogJ2Z1bGwnLFxuICAgICAgICAgICAgICAgICdzZWNvbmRhcnknOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnTWFya2V0cyddO1xuICAgICAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBtYXJrZXRzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba107XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ1ByaW1hcnknXTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ1NlY29uZGFyeSddO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGJhc2UudG9Mb3dlckNhc2UgKCkgKyAnXycgKyBxdW90ZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAndHlwZSc6ICdzcG90Jyxc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3J0cyA9IGNsYXNzIGFueHBybyBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdhbnhwcm8nLFxuICAgICAgICAgICAgJ25hbWUnOiAnQU5YUHJvJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdKUCcsICdTRycsICdISycsICdOWicgXSxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJzInLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NTk4My1mZDg1OTVkYS01ZWM5LTExZTctODJlMy1hZGIzYWI4YzI2MTIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYW54cHJvLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hbnhwcm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cDovL2RvY3MuYW54djIuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYW54cHJvLmNvbS9wYWdlcy9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9kZXB0aC9mdWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvdHJhZGUvZmV0Y2gnLCAvLyBkaXNhYmxlZCBieSBBTlhQcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvYWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvcXVvdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9yZXN1bHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21vbmV5L3tjdXJyZW5jeX0vYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkve2N1cnJlbmN5fS9zZW5kX3NpbXBsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvdHJhZGUvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvd2FsbGV0L2hpc3RvcnknLF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AgICAgICAgICAgICAnICgraHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dCknICtcbiAgICAgICAgICAgICAgICAgICAgJyBOb2RlLmpzLycgKyB0aGlzLm5vZGVWZXJzaW9uICsgJyAoSmF2YVNjcmlwdCknXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmhlYWRlcnMgPSB7fVxuXG4gICAgICAgIC8vIHByZXBlbmRlZCB0byBVUkwsIGxpa2UgaHR0cHM6Ly9wcm94eS5jb20vaHR0cHM6Ly9leGNoYW5nZS5jb20vYXBpLi4uXG4gICAgICAgIHRoaXMucHJveHkgPSAnJ1xuXG4gICAgICAgIHRoaXMuaXNvODYwMSAgICAgICAgID0gdGltZXN0YW1wID0+IG5ldyBEYXRlICh0aW1lc3RhbXApLnRvSVNPU3RyaW5nICgpXG4gICAgICAgIHRoaXMucGFyc2U4NjAxICAgICAgID0geCA9PiBEYXRlLnBhcnNlICgoKHguaW5kZXhPZiAoJysnKSA+PSAwKSB8fCAoeC5zbGljZSAoLTEpID09ICdaJykpID8geCA6ICh4ICsgJ1onKSlcbiAgICAgICAgdGhpcy5taWxsaXNlY29uZHMgICAgPSBEYXRlLm5vd1xuICAgICAgICB0aGlzLm1pY3Jvc2Vjb25kcyAgICA9ICgpID0+IE1hdGguZmxvb3IgKHRoaXMubWlsbGlzZWNvbmRzICgpICogMTAwMClcbiAgICAgICAgdGhpcy5zZWNvbmRzICAgICAgICAgPSAoKSA9PiBNYXRoLmZsb29yICh0aGlzLm1pbGxpc2Vjb25kcyAoKSAvIDEwMDApXG4gICAgICAgIHRoaXMuaWQgICAgICAgICAgICAgID0gdW5kZWZpbmVkXG5cbiAgICAgICAgLy8gcmF0ZSBsaW1pdGVyIHNldHRpbmdzXG4gICAgICAgIHRoaXMuZW5hYmxlUmF0ZUxpbWl0ID0gZmFsc2VcbiAgICAgICAgdGhpcy5yYXRlTGltaXQgICAgICAgPSAyMDAwICAvLyBtaWxsaXNlY29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ICAgICAgdGhpcy5oYXNGZXRjaE9wZW5PcmRlcnMgICA9IGZhbHNlXG4gICAgICAgIHRoaXMuaGFzRmV0Y2hPcmRlciAgICAgICAgPSBmYWxzZVxuICAgICAgICB0aGlzLmhhc0ZldGNoT3JkZXJCb29rICAgID0gdHJ1ZVxuICAgICAgICB0aGlzLmhhc0ZldGNoT3JkZXJzICAgICAgID0gZmFsc2VcbiAgICAgICAgdGhpcy5oYXNGZXRjaFRpY2tlciAgICAgICA9IHRydWVcbiAgICAgICAgdGhpcy5oYXNGZXRjaFRpY2tlcnMgICAgICA9IGZhbHNlXG4gICAgICAgIHRoaXMuaGFzRmV0Y2hUcmFkZXMgICAgICAgPSB0cnVlXG4gICAgICAgIHRoaXMuaGFzV2l0aGRyYXcgICAgICAgICAgPSBmYWxzZVxuICAgICAgICB0aGlzLmhhc0NyZWF0ZU9yZGVyICAgICAgID0gdGhpcy5oYXNQcml2YXRlQVBJXG4gICAgICAgIHRoaXMuaGFzQ2FuY2VsT3JkZXIgICAgICAgPSB0aGlzLmhhc1ByaXZhdGVBUElcblxuICAgICAgICB0aGlzLnJlcXVpcmVkQ3JlZGVudGlhbHMgPSB7XG4gICAgICAgICAgICAnYXBpS2V5JzogICB0cnVlLFxuICAgICAgICAgICAgJ3NlY3JldCc6ICAgdHJ1ZSxcbiAgICAgICAgICAgICd1aWQnOiAgICAgIGZhbHNlLFxuICAgICAgICAgICAgJ2xvZ2luJzogICAgZmFsc2UsXG4gICAgICAgICAgICAncGFzc3dvcmQnOiBmYWxzZSxcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuYmFsYW5jZSAgICA9IHt9XG4gICAgICAgIHRoaXMub3JkZXJib29rcyA9IHt9XG4gICAgICAgIHRoaXMudGlja2VycyAgICA9IHt9XG4gICAgICAgIHRoaXMuZmVlcyAgICAgICA9IHt9XG4gICAgICAgIHRoaXMub3JkZXJzICAgICA9IHt9XG4gICAgICAgIHRoaXMudHJhZGVzICAgICA9IHt9XG4gICA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xuICAgICAgICB0aGlzLmZldGNoX3RpY2tlciAgICAgICAgICAgICAgICA9IHRoaXMuZmV0Y2hUaWNrZXJcbiAgICAgICAgdGhpcy5mZXRjaF90cmFkZXMgICAgICAgICAgICAgICAgPSB0aGlzLmZldGNoVHJhZGVzXG4gICAgICAgIHRoaXMuZmV0Y2hfb3JkZXIgICAgICAgICAgICAgICAgID0gdGhpcy5mZXRjaE9yZGVyXG4gICAgICAgIHRoaXMuZmV0Y2hfb3JkZXJzICAgICAgICAgICAgICAgID0gdGhpcy5mZXRjaE9yZGVyc1xuICAgICAgICB0aGlzLmZldGNoX29wZW5fb3JkZXJzICAgICAgICAgICA9IHRoaXMuZmV0Y2hPcGVuT3JkZXJzXG4gICAgICAgIHRoaXMuZmV0Y2hfY2xvc2VkX29yZGVycyAgICAgICAgID0gdGhpcy5mZXRjaENsb3NlZE9yZGVyc1xuICAgICAgICB0aGlzLmZldGNoX29yZGVyX3N0YXR1cyAgICAgICAgICA9IHRoaXMuZmV0Y2hPcmRlclN0YXR1c1xuICAgICAgICB0aGlzLmZldGNoX21hcmtldHMgICAgICAgICAgICAgICA9IHRoaXMuZmV0Y2hNYXJrZXRzXG4gICAgICAgIHRoaXMubG9hZF9tYXJrZXRzICAgICAgICAgICAgICAgID0gdGhpcy5sb2FkTWFya2V0c1xuICAgICAgICB0aGlzLnNldF9tYXJrZXRzICAgICAgICAgICAgICAgICA9IHRoaXMuc2V0TWFya2V0c1xuICAgICAgICB0aGlzLnBhcnNlX2JhbGFuY2UgICAgICAgICAgICAgICA9IHRoaXMucGFyc2VCYWxhbmNlXG4gICAgICAgIHRoaXMucGFyc2VfYmlkX2FzayAgICAgICAgICAgICAgID0gdGhpcy5wYXJzZUJpZEFza1xuICAgICAgICB0aGlzLnBhcnNlX2JpZHNfYXNrcyAgICAgICAgICAgICA9IHRoaXMucGFyc2VCaWRzQXNrc1xuICAgICAgICB0aGlzLnBhcnNlX29yZGVyX2Jvb2sgICAgICAgICAgICA9IHRoaX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pcy5jcmVhdGVPcmRlclxuICAgICAgICB0aGlzLmNhbGN1bGF0ZV9mZWUgICAgICAgICAgICAgICA9IHRoaXMuY2FsY3VsYXRlRmVlXG4gICAgICAgIHRoaXMuY29tbW9uX2N1cnJlbmN5X2NvZGUgICAgICAgID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGVcbiAgICAgICAgdGhpcy5wcmljZV90b19wcmVjaXNpb24gICAgICAgICAgPSB0aGlzLnByaWNlVG9QcmVjaXNpb25cbiAgICAgICAgdGhpcy5hbW91bnRfdG9fcHJlY2lzaW9uICAgICAgICAgPSB0aGlzLmFtb3VudFRvUHJlY2lzaW9uXG4gICAgICAgIHRoaXMuZmVlX3RvX3ByZWNpc2lvbiAgICAgICAgICAgID0gdGhpcy5mZWVUb1ByZWNpc2lvblxuICAgICAgICB0aGlzLmNvc3RfdG9fcHJlY2lzaW9uICAgICAgICAgICA9IHRoaXMuY29zdFRvUHJlY2lzaW9uXG4gICAgICAgIHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAgICAgICAgID0gcHJlY2lzaW9uRnJvbVN0cmluZ1xuICAgICAgICB0aGlzLnByZWNpc2lvbl9mcm9tX3N0cmluZyAgICAgICA9IHByZWNpc2lvbkZyb21TdHJpbmdcbiAgICAgICAgdGhpcy50cnVuY2F0ZSAgICAgICAgICAgICAgICAgICAgPSBmdW5jdGlvbnMudHJ1bmNhdGVcbiAgICAgICAgdGhpcy51dWlkICAgICAgICAgICAgICAgICAgICAgICAgPSB1dWlkXG5cbiAgICAgICAgLy8gQVBJIG1ldGhvZHMgbWV0YWluZm9cbiAgICAgICAgdGhpcy5oYXMgPSB7XG4gICAgICAgICAgICAnY2FuY2VsT3JkZXInOiB0aGlzLmhhc1ByaXZhdGVBUEksXG4gICAgICAgICAgICAnY3JlYXRlT3JkZXInOiB0aGlzLmhhc1ByaXZhdGVBUEksXG4gICAgICAgICAgICAnZGVwb3NpdCc6IGZhbHNlLFxuICAgICAgICAgICAgJ2ZldGN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XN0JylcblxuICAgICAgICB0aGlzLmluaXRSZXN0UmF0ZUxpbWl0ZXIgKClcblxuICAgICAgICBpZiAodGhpcy5tYXJrZXRzKVxuICAgICAgICAgICAgdGhpcy5zZXRNYXJrZXRzICh0aGlzLm1hcmtldHMpXG5cbiAgICAgICAgaWYgKHRoaXMuZGVidWcgJiYgam91cm5hbCkge1xuICAgICAgICAgICAgam91cm5hbCAoKCkgPT4gdGhpcy5qb3VybmFsLCB0aGlzLCBPYmplY3Qua2V5cyAodGhpcy5oYXMpKVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZGVmYXVsdHMgKCkge1xuICAgICAgICByZXR1cm4geyAvKiBvdmVycmlkZSBtZSAqLyB9XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5zZWNvbmRzICgpXG4gICAgfVxuXG4gICAgZW5jb2RlVVJJQ29tcG9uZW50ICguLi5hcmdzKSB7XG4gICAgICAgIHJldHVybiBlbmNvZGVVUklDb21wb25lbnQgKC4uLmFyZ3MpXG4gICAgfVxuXG4gICAgY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpIHtcbiAgICAgICAgT2JqZWN0LmtleXMgKHRoaXMucmVxdWlyZWRDcmVkZW50aWFscykubWFwIChrZXkgPT4ge1xuICAgICAgICAgICAgaWYgKHRoaXMucmVxdWlyZWRDcmVkZW50aWFsc1trZXldICYmICF0aGlzW2tleV0pXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKHRoaXMuaWQgKyAnIHJlcXVpcmVzIGAnICsga2V5ICsgJ2AnKVxuICAgICAgICB9KVxuICAgIH1cblxuICAgIGluaXRSZXN0UmF0ZUxpbWl0ZXIgKCkge1xuXG4gICAgICAgIHRoaXMudG9rZW5CdWNrZXQgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgcmVmaWxsUmF0ZTogIDEgLyB0aGlzLnJhdGVMaW1pdCxcbiAgICAgICAgICAgIGRlbGF5OiAgICAgICAxLFxuICAgICAgICAgICAgY2FwYWNpdHk6ICAgIDEsXG4gICAgICAgICAgICBkZWZhdWx0Q29zdDogMSxcbiAgICAgICAgICAgIG1heENhcGFjaXR5OiAxMDAwLFxuICAgICAgICB9LCB0aGlzLnRva2VuQnVja2V0KVxuXG4gICAgICAgIHRoaXMudGhyb3R0bGUgPSB0aHJvdHRsZSAodGhpcy50b2tlbkJ1Y2tldClcblxuICAgICAgICB0aGlzLmV4ZWN1dGVSZXN0UmVxdWVzdCA9IGZ1bmN0aW9uICh1cmwsIG1ldGhvZCA9ICdHRVQnLCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG5cbiAgICAgICAgICAgIGxldCBwcm9taXNlID1cbiAgICAgICAgICAgICAgICBmZXRjaCAodXJsLCB7ICdtZXRob2QnOiBtZXRob2QsICdoZWFkZXJzJzogaGVhZGVycywgJ2JvZHknOiBib2R5LCAnYWdlbnQnOiB0aGlzLnR1bm5lbEFnZW50IHx8IG51bGx9KVxuICAgICAgICAgICAgICAgICAgICAuY2F0Y2ggKGUgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzTm9kZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKFsgdGhpcy5pZCwgbWV0aG9kLCB1cmwsIGUudHlwZSwgZS5tZXNzYWdlIF0uam9pbiAoJyAnKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IGUgLy8gcmV0aHJvdyBhbGwgdW5rbm93biBlcnJvcnNcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLnRoZW4gKHJlc3BvbnNlID0+IHRoaXMuaGFuZGxlUmVzdEVycm9ycyAocmVzcG9uc2UsIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSlcbiAgICAgICAgICAgICAgICAgICAgLnRoZW4gKHJlc3BvbnNlID0+IHRoaXMuaGFuZGxlUmVzdFJlc3BvbnNlIChyZXNwb25zZSwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpKVxuXG4gICAgICAgICAgICByZXR1cm4gdGltZW91dCAodGhpcy50aW1lb3V0LCBwcm9taXNlKS5jYXRjaCAoZSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKGUgaW5zdGFuY2VvZiBSZXF1ZXN0VGltZW91dClcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJlcXVlc3RUaW1lb3V0ICh0aGlzLmlkICsgJyAnICsgbWV0aG9kICsgJyAnICsgdXJsICsgJyAnICsgZS5tZXNzYWdlICsgJyAoJyArIHRoaXMudGltZW91dCArICcgbXMpJylcbiAgICAgICAgICAgICAgICB0aHJvdyBlXG4gICAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZGVmaW5lUmVzdEFwaSAoYXBpLCBtZXRob2ROYW1lLCBvcHRpb25zID0ge30pIHtcblxuICAgICAgICBmb3IgKGNvbnN0IHR5cGUgb2YgT2JqZWN0LmtleXMgKGFwaSkpIHtcbiAgICAgICAgICAgIGZvciAoY29uc3QgaHR0cE1ldGhvZCBvZiBPYmplY3Qua2V5cyAoYXBpW3R5cGVdKSkge1xuXG4gICAgICAgICAgICAgICAgbGV0IHVybHMgPSBhcGlbdHlwZV1baHR0cE1ldGhvZF1cbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHVybHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IHVybHNbaV0udHJpbSAoKVxuICAgICAgICAgICAgICAgICAgICBsZXQgc3BsaXRQYXRoID0gdXJsLnNwbGl0ICgvW15hLXpBLVowLTldLylcblxuICAgICAgICAgICAgICAgICAgICBsZXQgdXBwZXJjYXNlTWV0aG9kICA9IGh0dHBNZXRob2QudG9VcHBlckNhc2UgKClcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxvd2VyY2FzZU1ldGhvZCAgPSBodHRwTWV0aG9kLnRvTG93ZXJDYXNlICgpXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2VNZXRob2QgID0gdGhpcy5jYXBpdGFsaXplIChsb3dlcmNhc2VNZXRob2QpXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2VTdWZmaXggID0gc3BsaXRQYXRoLm1hcCAodGhpcy5jYXBpdGFsaXplKS5qb2luICgnJylcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVuZGVyc2NvcmVTdWZmaXggPSBzcGxpdFBhdGgubWFwICh4ID0+IHgudHJpbSAoKS50b0xvd2VyQ2FzZSAoKSkuZmlsdGVyICh4ID0+IHgubGVuZ3RoID4gMCkuam9pbiAoJ18nKVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChjYW1lbGNhc2VTdWZmaXguaW5kZXhPZiAoY2FtZWxjYXNlTWV0aG9kKSA9PT0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbWVsY2FzZVN1ZmZpeCA9IGNhbWVsY2FzZVN1ZmZpeC5zbGljZSAoY2FtZWxjYXNlTWV0aG9kLmxlbmd0aClcblxuICAgICAgICAgICAgICAgICAgICBpZiAodW5kZXJzY29yZVN1ZmZpeC5pbmRleE9mIChsb3dlcmNhc2VNZXRob2QpID09PSAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgdW5kZXJzY29yZVN1ZmZpeCA9IHVuZGVyc2NvcmVTdWZmaXguc2xpY2UgKGxvd2VyY2FzZU1ldGhvZC5sZW5ndGgpXG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IGNhbWVsY2FzZSAgPSB0eXBlICsgY2FtZWxjYXNlTWV0aG9kICsgdGhpcy5jYXBpdGFsaXplIChjYW1lbGNhc2VTdWZmaXgpXG4gICAgICAgICAgICAgICAgICAgIGxldCB1bmRlcnNjb3JlID0gdHlwZSArICdfJyArIGxvd2VyY2FzZU1ldGhvZCArICdfJyArIHVuZGVyc2NvcmVTdWZmaXhcblxuICAgICAgICAgICAgICAgICAgICBpZiAoJ3N1ZmZpeGVzJyBpbiBvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ2NhbWVsY2FzZScgaW4gb3B0aW9uc1snc3VmZml4ZXMnXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW1lbGNhc2UgKz0gb3B0aW9uc1snc3VmZml4ZXMnXVsnY2FtZWxjYXNlJ11cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgndW5kZXJzY29yZScgaW4gb3B0aW9ucy5zdWZmaXhlcylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmRlcnNjb3JlICs9IG9wdGlvbnNbJ3N1ZmZpeGVzJ11bJ3VuZGVyc2NvcmUnXVxuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCd1bmRlcnNjb3JlX3N1ZmZpeCcgaW4gb3B0aW9ucylcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuZGVyc2NvcmUgKz0gb3B0aW9ucy51bmRlcnNjb3JlU3VmZml4O1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ2NhbWVsY2FzZV9zdWZmaXgnIGluIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgICAgICBjYW1lbGNhc2UgKz0gb3B0aW9ucy5jYW1lbGNhc2VTdWZmaXg7XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhcnRpYWwgPSBhc3luYyBwYXJhbXMgPT4gdGhpc1ttZXRob2ROYW1lXSAodXJsLCB0eXBlLCB1cHBlcmNhc2VNZXRob2QsIHBhcmFtcyB8fCB7fSlcblxuICAgICAgICAgICAgICAgICAgICB0aGlzW2NhbWVsY2FzZV0gID0gcGFydGlhbFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3VuZGVyc2NvcmVdID0gcGFydGlhbFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZldGNoICh1cmwsIG1ldGhvZCA9ICdHRVQnLCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG5cbiAgICAgICAgaWYgKGlzTm9kZSAmJiB0aGlzLnVzZXJBZ2VudCkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiB0aGlzLnVzZXJBZ2VudCA9PSAnc3RyaW5nJylcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0gZXh0ZW5kICh7ICdVc2VyLUFnZW50JzogdGhpcy51c2VyQWdlbnQgfSwgaGVhZGVycylcbiAgICAgICAgICAgIGVsc2UgaWYgKCh0eXBlb2YgdGhpcy51c2VyQWdlbnQgPT0gJ29iamVjdCcpICYmICgnVXNlci1BZ2VudCcgaW4gdGhpcy51c2VyQWdlbnQpKVxuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSBleHRlbmQgKHRoaXMudXNlckFnZW50LCBoZWFkZXJzKVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGVvZiB0aGlzLnByb3h5ID09ICdmdW5jdGlvbicpIHtcblxuICAgICAgICAgICAgdXJsID0gdGhpcy5wcm94eSAodXJsKVxuICAgICAgICAgICAgaGVhZGVycyA9IGV4dGVuZCAoeyAnT3JpZ2luJzogJyonIH0sIGhlYWRlcnMpXG5cbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgdGhpcy5wcm94eSA9PSAnc3RyaW5nJykge1xuXG4gICAgICAgICAgICBpZiAodGhpcy5wcm94eS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IGV4dGVuZCAoeyAnT3JpZ2luJzogJyonIH0sIGhlYWRlcnMpXG5cbiAgICAgICAgICAgIHVybCA9IHRoaXMucHJveHkgKyB1cmxcbiAgICAgICAgfVxuXG4gICAgICAgIGhlYWRlcnMgPSBleHRlbmQgK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b3RlY3Rpb24gPSBib2R5Lm1hdGNoICgvY2xvdWRmbGFyZXxpbmNhcHN1bGEvaSlcbiAgICAgICAgICAgIGlmIChkZG9zUHJvdGVjdGlvbikge1xuICAgICAgICAgICAgICAgIGVycm9yID0gRERvU1Byb3RlY3Rpb25cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZXJyb3IgPSBFeGNoYW5nZU5vdEF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGRldGFpbHMgKz0gJyAocG9zc2libGUgcmVhc29uczogJyArIFtcbiAgICAgICAgICAgICAgICAgICAgJ2ludmFsaWQgQVBJIGtleXMnLFxuICAgICAgICAgICAgICAgICAgICAnYmFkIG9yIG9sZCBub25jZScsXG4gICAgICAgICAgICAgICAgICAgICdleGNoYW5nZSBpcyBkb3duIG9yIG9mZmxpbmUnLFxuICAgICAgICAgICAgICAgICAgICAnb24gbWFpbnRlbmFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAnRERvUyBwcm90ZWN0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUtbGltaXRpbmcnLFxuICAgICAgICAgICAgICAgIF0uam9pbiAoJywgJykgKyAnKSdcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChbIDQwOCwgNTA0IF0uaW5jbHVkZXMgKGNvZGUpKSB7XG4gICAgICAgICAgICBlcnJvciA9IFJlcXVlc3RUaW1lb3V0XG4gICAgICAgIH0gZWxzZSBpZiAoWyA0MDEsIDUxMSBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBBdXRoZW50aWNhdGlvbkVycm9yXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBlcnJvciA9IEV4Y2hhbmdlRXJyb3JcbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBuZXcgZXJyb3IgKFsgdGhpcy5pZCwgbWV0aG9kLCB1cmwsIGNvZGUsIHJlYXNvbiwgZGV0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mVzcG9uc2VcblxuICAgICAgICB9IGNhdGNoIChlKSB7XG5cbiAgICAgICAgICAgIGxldCBtYWludGVuYW5jZSA9IHJlc3BvbnNlLm1hdGNoICgvb2ZmbGluZXxidXN5fHJldHJ5fHdhaXR8dW5hdmFpbGFibGV8bWFpbnRhaW58bWFpbnRlbmFuY2V8bWFpbnRlbmFuY2luZy9pKVxuICAgICAgICAgICAgbGV0IGRkb3NQcm90ZWN0aW9uID0gcmVzcG9uc2UubWF0Y2ggKC9jbG91ZGZsYXJlfGluY2Fwc3VsYXxvdmVybG9hZC9pKVxuXG4gICAgICAgICAgICBpZiAoZSBpbnN0YW5jZW9mIFN5bnRheEVycm9yKSB7XG5cbiAgICAgICAgICAgICAgICBsZXQgZXJyb3IgPSBFeGNoYW5nZU5vdEF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGxldCBkZXRhaWxzID0gJ25vdCBhY2Nlc3NpYmxlIGZyb20gdGhpcyBsb2NhdGlvbiBhdCB0aGUgbW9tZW50J1xuICAgICAgICAgICAgICAgIGlmIChtYWludGVuYW5jZSlcbiAgICAgICAgICAgICAgICAgICAgZGV0YWlscyA9ICdvZmZsaW5lLCBvbiBtYWludGVuYW5jZSBvciB1bnJlYWNoYWJsZSBmcm9tIHRoaXMgbG9jYXRpb24gYXQgdGhlIG1vbWVudCdcbiAgICAgICAgICAgICAgICBpZiAoZGRvc1Byb3RlY3Rpb24pXG4gICAgICAgICAgICAgICAgICAgIGVycm9yID0gRERvU1Byb3RlY3Rpb25cbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgZXJyb3IgKFsgdGhpcy5pZCwgbWV0aG9kLCB1cmwsIGRldGFpbHMgXS5qb2luICgnICcpKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy52ZXJib3NlKVxuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nICh0aGlzLmlkLCBtZXRob2QsIHVybCwgJ2Vycm9yJywgZSwgXCJyZXNwb25zZSBib2R5OlxcbidcIiArIHJlc3BvbnNlICsgXCInXCIpXG5cbiAgICAgICAgICAgIHRocm93IGVcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHNldE1hcmtldHMgKG1hcmtldHMpIHtcbiAgICAgICAgbGV0IHZhbHVlcyA9IE9iamVjdC52YWx1ZXMgKG1hcmtldHMpLm1hcCAobWFya2V0ID0+IGRlZXBFeHRlbmQgKHtcbiAgICAgICAgICAgICdsaW1pdHMnOiB0aGlzLmxpbWl0cyxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB0aGlzLnByZWNpc2lvbixcbiAgICAgICAgfSwgdGhpcy5mZWVzWyd0cmFkaW5nJ10sIG1hcmtldCkpXG4gICAgICAgIHRoaXMubWFya2V0cyA9IGRlZXBFeHRlbmQgKHRoaXMubWFya2V0cywgaW5kZXhCeSAodmFsdWVzLCAnc3ltYm9sJykpXG4gICAgICAgIHRoaXMubWFya2V0c0J5SWQgPSBpbmRleEJ5IChtYXJrZXRzLCAnaWQnKVxuICAgICAgICB0aGlzLm1hcmtldHNfYnlfaWQgPSB0aGlzLm1hcmtldHNCeUlkXG4gICAgICAgIHRoaXMuc3ltYm9scyA9IE9iamVjdC5rZXlzICh0aGlzLm1hcmtldHMpLnNvcnQgKClcbiAgICAgICAgdGhpcy5pZHMgPSBPYmplY3Qua2V5cyAodGhpcy5tYXJrZXRzX2J5X2lkKS5zb3J0ICgpXG4gICAgICAgIGNvbnN0IGJhc2VDdXJyZW5jaWVzID1cbiAgICAgICAgICAgIHZhbHVlcy5maWx0ZXIgKG1hcmtldCA9PiAnYmFzZScgaW4gbWFya2V0KVxuICAgICAgICAgICAgICAgIC5tYXAgKG1hcmtldCA9PiAoe1xuICAgICAgICAgICAgICAgICAgICBpZDogbWFya2V0LmJhc2VJZCB8fCBtYXJrZXQuYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgY29kZTogbWFya2V0LmJhc2UsXG4gICAgICAgICAgICAgICAgfSkpXG4gICAgICAgIGNvbnN0IHF1b3RlQ3VycmVuY2llcyA9XG4gICAgICAgICAgICB2YWx1ZXMuZmlsdGVyIChtYXJrZXQgPT4gJ3F1b3RlJyBpbiBtYXJrZXQpXG4gICAgICAgICAgICAgICAgLm1hcCAobWFya2V0ID0+ICh7XG4gICAgICAgICAgICAgICAgICAgIGlkOiBtYXJrZXQucXVvdGVJZCB8fCBtYXJrZXQucXVvdGUsXG4gICAgICAgICAgICAgICAgICAgIGNvZGU6IG1hcmtldC5xdW90ZSxcbiAgICAgICAgICAgICAgICB9KSlcbiAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IHNvcnRCeSAoYmFzZUN1cnJlbmNpZXMuY29uY2F0IChxdW90ZUN1cnJlbmNpZXMpLCAnY29kZScpXG4gICAgICAgIHRoaXMuY3VycmVuY2llcyA9IGRlZXBFeHRlbmQgKGluZGV4QnkgKGN1cnJlbmNpZXMsICdjb2RlJyksIHRoaXMuY3VycmVuY2llcyB8fCB7fSlcbiAgICAgICAgcmV0dXJuIHRoaXMubWFya2V0c1xuICAgIH1cblxuICAgIGFzeW5jIGxvYWRNYXJrZXRzIChyZWxvYWQgPSBmYWxzZSkge1xuICAgICAgICBpZiAoIXJlbG9hZCAmJiB0aGlzLm1hcmtldHMpIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5tYXJrZXRzQnlJZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnNldE1hcmtldHMgKHRoaXMubWFya2V0cylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBtYXJrZXRzID0gYXdhaXQgdGhpcy5mZXRjaE1hcmtldHMgKClcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSB1bmRlZmluZWRcbiAgICAgICAgaWYgKHRoaXMuaGFzLmZldGNoQ3VycmVuY2llcykge1xuICAgICAgICAgICAgY3VycmVuY2llcyA9IGF3YWl0IHRoaXMuZmV0Y2hDd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0dXJuIHtcbiAgICAgICAgICAgICdiaWRzJzogKGJpZHNLZXkgaW4gb3JkZXJib29rKSA/IHRoaXMucGFyc2VCaWRzQXNrcyAob3JkZXJib29rW2JpZHNLZXldLCBwcmljZUtleSwgYW1vdW50S2V5KSA6IFtdLFxuICAgICAgICAgICAgJ2Fza3MnOiAoYXNrc0tleSBpbiBvcmRlcmJvb2spID8gdGhpcy5wYXJzZUJpZHNBc2tzIChvcmRlcmJvb2tbYXNrc0tleV0sIHByaWNlS2V5LCBhbW91bnRLZXkpIDogW10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGdldEN1cnJlbmN5VXNlZE9uT3Blbk9yZGVycyAoY3VycmVuY3kpIHtcbiAgICAgICAgcmV0dXJuIE9iamVjdC52YWx1ZXMgKHRoaXMub3JkZXJzKS5maWx0ZXIgKG9yZGVyID0+IChvcmRlclsnc3RhdHVzJ10gPT0gJ29wZW4nKSkucmVkdWNlICgodG90YWwsIG9yZGVyKSA9PiB7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gb3JkZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgbGV0IGFtb3VudCA9IG9yZGVyWydyZW1haW5pbmcnXVxuICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09IG1hcmtldFsnYmFzZSddICYmIG9yZGVyWydzaWRlJ10gPT0gJ3NlbGwnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRvdGFsICsgYW1vdW50XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09IG1hcmtldFsncXVvdGUnXSAmJiBvcmRlclsnc2lkZSddID09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRvdGFsICsgKG9yZGVyWydjb3N0J10gfHwgKG9yZGVyWydwcmljZSddICogYW1vdW50KSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRvdGFsXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIDApXG4gICAgfVxuXG4gICAgcGFyc2VCYWxhbmNlIChiYWxhbmNlKSB7XG5cbiAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLm9taXQgKGJhbGFuY2UsICdpbmZvJykpO1xuXG4gICAgICAgIGN1cnJlbmNpZXMuZm9yRWFjaCAoY3VycmVuY3kgPT4ge1xuXG4gICAgICAgICAgICBpZiAodHlwZW9mIGJhbGFuY2VbY3VycmVuY3ldLnVzZWQgPT0gJ3VuZGVmaW5lZCcpIHtcblxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnBhcnNlQmFsYW5jZUZyb21PcGVuT3JkZXJzICYmICgnb3Blbl9vcmRlcnMnIGluIGJhbGFuY2VbJ2luZm8nXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjaGFuZ2VPcmRlcnNDb3VudCA9IGJhbGFuY2VbJ2luZm8nXVsnb3Blbl9vcmRlcnMnXTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY2FjaGVkT3JkZXJzQ291bnQgPSBPYmplY3QudmFsdWVzICh0aGlzLm9yZGVycykuZmlsdGVyIChvcmRlciA9PiAob3JkZXJbJ3N0YXR1cyddID09ICdvcGVuJykpLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNhY2hlZE9yZGVyc0NvdW50ID09IGV4Y2hhbmdlT3JkZXJzQ291bnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhbGFuY2VbY3VycmVuY3ldLnVzZWQgPSB0aGlzLmdldEN1cnJlbmN5VXNlZE9uT3Blbk9yZGVycyAoY3VycmVuY3kpXG4gICAgICAgICAgICA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Z3MpIHtcblxuICAgICAgICBpZiAoYXJnICYmICh0eXBlb2YgYXJnID09ICdvYmplY3QnKSAmJiAoYXJnLmNvbnN0cnVjdG9yID09PSBPYmplY3QgfHwgISgnY29uc3RydWN0b3InIGluIGFyZykpKSB7XG5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0ICE9ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0ge31cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gYXJnKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0W2tleV0gPSBkZWVwRXh0ZW5kIChyZXN1bHRba2V5XSwgYXJnW2tleV0pXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgfSBlbHNlIHtcblxuICAgICAgICAgICAgcmVzdWx0ID0gYXJnXG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gcmVzdWx0XG59XG5cbmNvbnN0IG9taXQgPSAob2JqZWN0LCAuLi5hcmdzKSA9PiB7XG4gICAgY29uc3QgcmVzdWx0ID0gZXh0ZW5kIChvYmplY3QpXG4gICAgZm9yIChjb25zdCB4IG9mIGFyZ3MpIHtcbiAgICAgICAgaWYgKHR5cGVvZiB4ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgZGVsZXRlIHJlc3VsdFt4XVxuICAgICAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkgKHgpKSB7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGsgb2YgeClcbiAgICAgICAgICAgICAgICBkZWxldGUgcmVzdWx0W2tdXG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHJlc3VsdFxufVxuXG5jb25zdCBncm91cEJ5ID0gKGFycmF5LCBrZXkpID0+IHtcbiAgICBjb25zdCByZXN1bHQgPSB7fVxuICAgIE9iamVjdFxuICAgICAgICAudmFsdWVzIChhcnJheSlcbiAgICAgICAgLmZpbHRlciAoZW50cn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MCkgOiAobnVtVG9rZW5zID49IDApXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFzRW5vdWdoVG9rZW5zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHsgY29zdCwgcmVzb2x2ZSwgcmVqZWN0IH0gPSBxdWV1ZVswXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3N0ID0gKGNvc3QgfHwgY2ZnLmRlZmF1bHRDb3N0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtVG9rZW5zID49IE1hdGgubWluIChjb3N0LCBjZmcuY2FwYWNpdHkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1Ub2tlbnMgLT0gY29zdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVldWUuc2hpZnQgKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUgKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub3cgPSBEYXRlLm5vdyAoKVxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGVsYXBzZWQgPSBub3cgLSBsYXN0VGltZXN0YW1wXG4gICAgICAgICAgICAgICAgICAgICAgICBsYXN0VGltZXN0YW1wID0gbm93XG4gICAgICAgICAgICAgICAgICAgICAgICBudW1Ub2tlbnMgPSBNYXRoLm1pbiAoY2ZnLmNhcGFjaXR5LCBudW1Ub2tlbnMgKyBlbGFwc2VkICogY2ZnLnJlZmlsbFJhdGUpXG4gICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBzbGVlcCAoY2ZnLmRlbGF5KVxuIC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AgICAnY291bnRyaWVzJzogJ0NOJywgLy8gQ2hpbmFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiA1MDAsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgLy8gb2Jzb2xldGUgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICczbSc6ICczbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJoJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGgnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzhoJzogJzhoJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkJyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2QnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxdycsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI5NjA0MDIwLWQ1NDgzY2RjLTg3ZWUtMTFlNy05NGM3LWQxYThkOTE2OTI5My5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cuYmluYW5jZS5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnd2FwaSc6ICdodHRwczovL2FwaS5iaW5hbmNlLmNvbS93YXBpL3YzJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5iaW5hbmNlLmNvbS9hcGkvdjEnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5iaW5hbmNlLmNvbS9hcGkvdjMnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbS9yZXN0YXBpcHViLmh0bWwnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYmluYW5jZS56ZW5kZXNrLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDA0MjkzMzInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9wdWJsaWMvcHJvZHVjdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FnZ1RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvMjRocicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbEJvb2tUaWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbGxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3Rlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJEYXRhU3RyZWFtJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyRGF0YVN0cmVhbSdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlckRhdGFTdHJlYW0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5CJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogNTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAwLjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQVMnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5UJzogMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ08nOiAwLjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDguMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS05DJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSU5LJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hWRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FMVCc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT1RBJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01EQSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEwnOiAwLjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VORyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBU1QnOiA0LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVRJzogMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMUkMnOiA3LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogNy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiA1MDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1dSJzogMTUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUksnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZTyc6IDMwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4xNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT0QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUT1JKJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldEV4Y2hhbmdlUHVibGljUHJvZHVjdCAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAobWFya2V0WydiYXNlQXNzZXQnXSk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAobWFya2V0WydxdW90ZUFzc2V0J10pO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBwYXJzZUZsb2F0IChtYXJrZXRbJ21pblRyYWRlJ10pO1xuICAgICAgICAgICAgbGV0IHRpY2tTaXplID0gcGFyc2VGbG9hdCAobWFya2V0Wyd0aWNrU2l6ZSddKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0Wyd0aWNrU2l6ZSddKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsndGlja1NpemUnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IG1hcmtldFsnYWN0aXZlJ10sXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aWNrU2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCBrZXkgPSAncXVvdGUnO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAqIHJhdGUpKTtcbiAgICAgICAgaWYgKHNpZGUgPT0gJ3NlbGwnKSB7XG4gICAgICAgICAgICBjb3N0ICo9IHByaWNlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAga2V5ID0gJ2Jhc2UnO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndHlwZSc6IHRha2VyT3JNYWtlcixcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFtrZXldLFxuICAgICAgICAgICAgJ3JhdGUnOiByYXRlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0ICh0aGlzLmZlZVRvUHJlY2lzaW9uIChzeW1ib2wsIGNvc3QpKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnQgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2VzJ107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICBsZXQgYXNzZXQgPSBiYWxhbmNlWydhc3NldCddO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGFzc2V0KTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnZnJlZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2xvY2tlZCddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnbGltaXQnOiAxMDAsIC8vIGRlZmF1bHQgPSBtYXhpbXVtID0gMTAwXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZUludGVnZXIgKHRpY2tlciwgJ2Nsb3NlVGltZScpO1xuICAgICAgICBpZiAodHlwZW9mIHRpbWVzdGFtcCA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaFByaWNlJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5z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zICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyMjRociAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAocmVzcG9uc2UsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyQWxsQm9va1RpY2tlcnMgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aWNrZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IHRpY2tlclsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgIC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AvLyB0aGlzIGlzIHJldmVyc2VkIGludGVudGlvbmFsbHlcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHNpZGUgPSAodHJhZGVbJ2lzQnV5ZXInXSkgPyAnYnV5JyA6ICdzZWxsJzsgLy8gdGhpcyBpcyBhIHRydWUgc2lkZVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY29tbWlzc2lvbicgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHBhcnNlRmxvYXQgKHRyYWRlWydjb21taXNzaW9uJ10pLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh0cmFkZVsnY29tbWlzc2lvbkFzc2V0J10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXIsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwcmljZSAqIGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2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XMgKHN0YXR1cykge1xuICAgICAgICBpZiAoc3RhdHVzID09ICdORVcnKVxuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAnUEFSVElBTExZX0ZJTExFRCcpXG4gICAgICAgICAgICByZXR1cm4gJ3BhcnRpYWwnO1xuICAgICAgICBpZiAoc3RhdHVzID09ICdGSUxMRUQnKVxuICAgICAgICAgICAgcmV0dXJuICdjbG9zZWQnO1xuICAgICAgICBpZiAoc3RhdHVzID09ICdDQU5DRUxFRCcpXG4gICAgICAgICAgICByZXR1cm4gJ2NhbmNlbGVkJztcbiAgICAgICAgcmV0dXJuIHN0YXR1cy50b0xvd2VyQ2FzZSAoKTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKG9yZGVyWydzdGF0dXMnXSk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBvcmRlclsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBvcmRlclsndGltZSddO1xuICAgICAgICBsZXQgcHJpY2UgPSBwYXJzZUZsb2F0IChvcmRlclsncHJpY2UnXSk7XG4gICAgICAgIG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IHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3F1YW50aXR5JzogdGhpcy5hbW91bnRUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQpLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbGltaXQnKSB7XG4gICAgICAgICAgICBvcmRlciA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgICAgICAgICAgJ3RpbWVJbkZvcmNlJzogJ0dUQycsIC8vICdHVEMnID0gR29vZCBUbyBDYW5jZWwgKGRlZmF1bHQpLCAnSU9DJyA9IEltbWVkaWF0ZSBPciBDYW5jZWxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlciAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnb3JkZXJJZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICA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gKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICBsZXQgYWRkcmVzcyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdhZGRyZXNzJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZmV0Y2hEZXBvc2l0QWRkcmVzcyBmYWlsZWQ6ICcgKyB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSk7XG4gICAgfVxuXG4gICAgYXN5bmMgd2l0aGRyYXcgKGN1cnJlbmN5LCBhbW91bnQsIGFkZHJlc3MsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2FwaVBvc3RXaXRoZHJhdyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdhc3NldCc6IHRoaXMuY3VycmVuY3lJZCAoY3VycmVuY3kpLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKGFtb3VudCksXG4gICAgICAgICAgICAncmVjdldpbmRvdyc6IDEwMDAwMDAwLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICB1cmwgKz0gJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAnd2FwaScpXG4gICAgICAgICAgICB1cmwgKz0gJy5odG1sJztcbiAgICAgICAgaWYgKChhcGkgPT0gJ3ByaXZhdGUnKSB8fCAoYXBpID09ICd3YXBpJykpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoeyAndGltZXN0YW1wJzogbm9uY2UgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIHF1ZXJ5ICs9ICcmJyArICdzaWduYXR1cmU9JyArIHNpZ25hdHVyZTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ1gtTUJYLUFQSUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmICgobWV0aG9kID09ICdHRVQnKSB8fCAoYXBpID09ICd3YXBpJykpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnk7XG4gICAgICAgICAgICB9IGV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AgICdodHRwczovL3d3dy5iaXQyYy5jby5pbC9ob21lL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vT2ZlckUvYml0MmMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0V4Y2hhbmdlcy97cGFpcn0vVGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeGNoYW5nZXMve3BhaXJ9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9CYWxhbmNlL3YyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNZXJjaGFudC9DcmVhdGVDaGVja291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWNjb3VudEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZENvaW5GdW5kc1JlcXVlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZEZ1bmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRPcmRlck1hcmtldFByaWNlQnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRPcmRlck1hcmtldFByaWNlU2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL015T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQYXltZW50L0dldE15SWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BheW1lbnQvU2VuZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL05JUyc6IHsgJ2lkJzogJ0J0Y05pcycsICdzeW1ib2wnOiAnQlRDL05JUycsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICAgICAgJ0JDSC9OSVMnOiB7ICdpZCc6ICdCY2hOaXMnLCAnc3ltYm9sJzogJ0JDSC9OSVMnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnTklTJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvTklTJzogeyAnaWQnOiAnTHRjTmlzJywgJ3N5bWJvbCc6ICdMVEMvTklTJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ05JUycgfSxcbiAgICAgICAgICAgICAgICAnQlRHL05JUyc6IHsgJ2lkJzogJ0J0Z05pcycsICdzeW1ib2wnOiAnQlRHL05JUycsICdiYXNlJzogJ0JURycsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC41IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgIC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2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGwnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IGF2ZXJhZ2VQcmljZSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEV4Y2hhbmdlc1BhaXJUcmFkZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0T3JkZXJBZGRPcmRlcic7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdBbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnUGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdtYXJrZXQnKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ01hcmtldFByaWNl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tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgYml0YmF5IGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2JpdGJheScsXG4gICAgICAgICAgICAnbmFtZSc6ICdCaXRCYXknLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ1BMJywgJ0VVJyBdLCAvLyBQb2xhbmRcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYxMzItOTc4YTdiZDgtNWVjZS0xMWU3LTk1NDAtYmM5NmQxZTliYmI4LmpwZycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2JpdGJheS5uZXQnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9iaXRiYXkubmV0L0FQSS9QdWJsaWMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2JpdGJheS5uZXQvQVBJL1RyYWRpbmcvdHJhZGluZ0FwaS5waHAnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0YmF5Lm5ldC9wdWJsaWMtYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0YmF5Lm5ldC9hY2NvdW50L3RhYi1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdEJheU5ldC9BUEknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJ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DA0MyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0SW5mbyAoKTtcbiAgICAgICAgaWYgKCdiYWxhbmNlcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ2JhbGFuY2VzJ107XG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydhdmFpbGFibGUnXSk7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydsb2NrZWQnXSk7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0aGlzLnN1bSAoYWNjb3VudFsnZnJlZSddLCBhY2NvdW50Wyd1c2VkJ10pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXN1bHRbY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4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21heCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdtaW4nKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2FzaycpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0JyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhdmVyYWdlJyksXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHR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9DVU1FTlRBVElPTi5wZGYnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly92aXAuYml0Y29pbi5jby5pZC90cmFkZV9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0lEUic6IHsgJ2lkJzogJ2J0Y19pZHInLCAnc3ltYm9sJzogJ0JUQy9JRFInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnSURSJywgJ2Jhc2VJZCc6ICdidGMnLCAncXVvdGVJZCc6ICdpZHInIH0sXG4gICAgICAgICAgICAgICAgJ0J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iBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RpY2tlciddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VGbG9hdCAodGlja2VyWydzZXJ2ZXJfdGltZSddKSAqIDEwMDA7XG4gICAgICAgIGxldCBiYXNlVm9sdW1lID0gJ3ZvbF8nICsgbWFya2V0WydiYXNlSWQnXS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgbGV0IHF1b3RlVm9sdW1lID0gJ3ZvbF8nICsgbWFya2V0WydxdW90ZUlkJ10udG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGV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dmF0ZVBvc3RDYW5jZWxPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdvcmRlcl9pZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiB0aGlzLm5vbmNlICgpLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLC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HJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW0nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWgnLFxuICAgICAgICAgICAgICAgICczaCc6ICczaCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFEJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnN0QnLFxuICAgICAgICAgICAgICAgICcydyc6ICcxNEQnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI0NC1lMzI4YTUwYy01ZWQyLTExZTctOTQ3Yi0wNDE0MTY1NzliYjMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGZpbmV4LnJlYWRtZS5pby92MS9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaXRmaW5leGNvbS9iaXRmaW5leC1hcGktbm9kZScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd2Mic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L3tzZWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy90cmFkZTp7dGltZWZyYW1lfTp7c3ltYm9sfS9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdjYW5kbGVzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kYm9vay97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kcy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzX2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RvZGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRfaW5mb3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXNrZXRfbWFuYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVkaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0L25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZy9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9tb3ZlbWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tleV9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5faW5mb3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlc19mdW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVyL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXIvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVycy9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9tdWx0aScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL3JlcGxhY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvbmV3L211bHRpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2NsYWltJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VuX2Z1bmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0b3RhbF90YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VudXNlZF90YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIC8vIGlz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iAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWluaW11bV9vcmRlcl9zaXplJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4aW11bV9vcmRlcl9zaXplJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VUeXBlID0gdGhpcy5zYWZlU3RyaW5nIChwYXJhbXMsICd0eXBlJywgJ2V4Y2hhbmdlJyk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgaWYgKGJhbGFuY2VbJ3R5cGUnXSA9PSBiYWxhbmNlVHlwZSkge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIHVwcGVyY2FzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1cHBlcmNhc2UpO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW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tcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRpY2tlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2ldO1xuICAgICAgICAgICAgaWYgKCdwYWlyJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ3BhaXInXTtcbiAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoVGlja2VycygpIGZhaWxlZCB0byByZWNvZ25pemUgc3ltYm9sICcgKyBpZCArICcgJyArIHRoaXMuanNvbiAodGlja2VyKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZmV0Y2hUaWNrZXJzKCkgcmVzcG9uc2Ugbm90IHJlY29nbml6ZWQgJyArIHRoaXMuanNvbiAodGlja2VycykpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJ0aWNrZXJTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlRmxvYXQgKHRpY2tlclsndGltZXN0YW1wJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIGlmICgncGFpcicgaW4gdGlja2VyKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ3BhaXInXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyB1bnJlY29nbml6ZWQgdGlja2VyIHN5bWJvbCAnICsgaWQgKyAnICcgKyB0aGlzLmpzb24gKHRpY2tlcikpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0X3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ21pZCddKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICA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gICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJUeXBlID0gdHlwZTtcbiAgICAgICAgaWYgKCh0eXBlID09ICdsaW1pdCcpIHx8ICh0eXBlID09ICdtYXJrZXQnKSlcbiAgICAgICAgICAgIG9yZGVyVHlwZSA9ICdleGNoYW5nZSAnICsgdHlwZTtcbiAgICAgICAgLy8gYW1vdW50ID0gdGhpcy5hbW91bnRUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyVHlwZSxcbiAgICAgICAgICAgICdvY29vcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgJ2J1eV9wcmljZV9vY28nOiAwLFxuICAgICAgICAgICAgJ3NlbGxfcHJpY2Vfb2NvJzogMCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIHByaWNlID0gdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKTtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2UudG9TdHJpbmcgKCk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJ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iB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbZXhjaGFuZ2VdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgb3JkZXJUeXBlID0gb3JkZXJbJ3R5cGUnXTtcbiAgICAgICAgbGV0IGV4Y2hhbmdlID0gb3JkZXJUeXBlLmluZGV4T2YgKCdleGNoYW5nZSAnKSA+PSAwO1xuICAgICAgICBpZiAoZXhjaGFuZ2UpIHtcbiAgICAgICAgICAgIGxldCBbIHByZWZpeCwgb3JkZXJUeXBlIF0gPSBvcmRlclsndHlwZSddLnNwbGl0ICgnICcpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAocGFyc2VGbG9hdCAob3JkZXJbJ3RpbWVzdGFtcCddKSAqIDEwMDApO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyVHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKG9yZGVyWydwcmljZSddKSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogcGFyc2VGbG9hdCAob3JkZXJbJ2F2Z19leGVjdXRpb25fcHJpY2UnXSksXG4gICAgICAgIC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GN1cnJlbmN5ID09ICdMVEMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2xpdGVjb2luJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnRVRIJykge1xuICAgICAgICAgICAgcmV0dXJuICdldGhlcmV1bSc7XG4gICAgICAgIH0gZWxzZSBpZiAoY3VycmVuY3kgPT0gJ0VUQycpIHtcbiAgICAgICAgICAgIHJldHVybiAnZXRoZXJldW1jJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnT01OSScpIHtcbiAgICAgICAgICAgIHJldHVybiAnbWFzdGVyY29pbic7IC8vID8/P1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdaRUMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ3pjYXNoJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnWE1SJykge1xuICAgICAgICAgICAgcmV0dXJuICdtb25lcm8nO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdVU0QnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ3dpcmUnO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdEQVNIJykge1xuICAgICAgICAgICAgcmV0dXJuICdkYXNoJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnWFJQJykge1xuICAgICAgICAgICAgcmV0dXJuICdyaXBwbGUnO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdFT1MnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2Vvcyc7XG4gICAgICAgIH0gZWxzZSBpZiAoY3VycmVuY3kgPT0gJ0JDSCcpIHtcbiAgICAgICAgICAgIHJldHVybiAnYmNhc2gnO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdVU0RUJykge1xuICAgICAgICAgICAgcmV0dXJuICd0ZXRoZXJ1c28nO1xuICAgICAgICB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3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgaWYgKGFwaSA9PSAndjInKSB7XG4gICAgICAgICAgICByZXF1ZXN0ID0gJy8nICsgYXBpICsgcmVxdWVzdDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlcXVlc3QgPSAnLycgKyB0aGlzLnZlcnNpb24gKyByZXF1ZXN0O1xuICAgICAgICB9XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyByZXF1ZXN0O1xuICAgICAgICBpZiAoKGFwaSA9PSAncHVibGljJykgfHwgKHBhdGguaW5kZXhPZiAoJy9oaXN0JykgPj0gMCkpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGxldCBzdWZmaXggPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIHVybCArPSBzdWZmaXg7XG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSBzdWZmaXg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICAgICAncmVxdWVzdCc6IHJlcXVlc3QsXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSB0aGlzLnN0cmluZ1RvQmFzZTY0IChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHBheWxvYWQsIHNlY3JldCwgJ3NoYTM4NCcpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1CRlgtQVBJS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1gtQkZYLVBBWUxPQUQnOiB0aGlzLmRlY29kZSAocGF5bG9hZCksXG4gICAgICAgICAgICAgICAgJ1gtQkZYLVNJR05BVFVSRSc6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gcmVzcG9uc2VbJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnS2V5IHByaWNlIHNob3VsZCBiZSBhIGRlY2ltYWwgbnVtYmVyJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlLmluZGV4T2YgKCdJbnZhbGlkIG9yZGVyOiBub3QgZW5vdWdoIGV4Y2hhbmdlIGJhbGFuY2UnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS5pbmRleE9mICgnSW52YWxpZCBvcmRlcicpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS5pbmRleE9mICgnT3JkZXIgY291bGQgbm90IGJlIGNhbmNlbGxlZC4nKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYW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gICAgICAgICdjb3VudHJpZXMnOiAnVVMnLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgLy8gb2xkIG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0RlcG9zaXQnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9wZW5PcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaENsb3NlZE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnM2gnOiAnM2gnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxRCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzdEJyxcbiAgICAgICAgICAgICAgICAnMncnOiAnMTREJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI0NC1lMzI4YTUwYy01ZWQyLTExZTctOTQ3Yi0wNDE0MTY1NzliYjMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGZpbmV4LnJlYWRtZS5pby92Mi9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaXRmaW5leGNvbS9iaXRmaW5leC1hcGktbm9kZScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYXRmb3JtL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS97cHJlY2lzaW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9SMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sc19kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L3tzaWRlfS97c2VjdGlvbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzMS97a2V5fTp7c2l6ZX06e3N5bWJvbH0vbG9uZy9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L2xvbmcvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9zaG9ydC9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L3Nob3J0L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2xhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbGMvdHJhZGUvYXZnJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVycy97c3ltYm9sfS9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVyL3tzeW1ib2x9OntpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvdHJhZGVzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL29mZmVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvb2ZmZXJzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL2xvYW5zL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9sb2Fucy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9jcmVkaXRzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9jcmVkaXRzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL3RyYWRlcy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvaW5mby9tYXJnaW4ve2tleX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9pbmZvL2Z1bmRpbmcve2tleX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9tb3ZlbWVudHMve2N1cnJlbmN5fS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivc3RhdHMvcGVyZjp7dGltZWZyYW1lfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvYWxlcnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3cvYWxlcnQvc2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3cvYWxlcnQve3R5cGV9OntzeW1ib2x9OntwcmljZX0vZGVsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL2NhbGMvb3JkZXIvYXZhaWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0FWVC9CVEMnOiB7ICdpZCc6ICd0QVZUQlRDJywgJ3N5bWJvbCc6ICdBVlQvQlRDJywgJ2Jhc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zeW1ib2wnOiAnWE1SL1VTRCcsICdiYXNlJzogJ1hNUicsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ1hSUC9CVEMnOiB7ICdpZCc6ICd0WFJQQlRDJywgJ3N5bWJvbCc6ICdYUlAvQlRDJywgJ2Jhc2UnOiAnWFJQJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgICAgICAnWFJQL1VTRCc6IHsgJ2lkJzogJ3RYUlBVU0QnLCAnc3ltYm9sJzogJ1hSUC9VU0QnLCAnYmFzZSc6ICdYUlAnLCAncXVvdGUnOiAnVVNEJyB9LFxuICAgICAgICAgICAgICAgICdaRUMvQlRDJzogeyAnaWQnOiAndFpFQ0JUQycsICdzeW1ib2wnOiAnWkVDL0JUQycsICdiYXNlJzogJ1pFQycsICdxdW90ZSc6ICdCVEMnIH0sXG4gICAgICAgICAgICAgICAgJ1pFQy9VU0QnOiB7ICdpZCc6ICd0WkVDVVNEJywgJ3N5bWJvbCc6ICdaRUMvVVNEJywgJ2Jhc2UnOiAnWkVDJywgJ3F1b3RlJzogJ1VTRCcgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICAvLyBpc3N1ZSAjNCBCaXRmaW5leCBuYW1lcyBEYXNoIGFzIERTSCwgaW5zdGVhZCBvZiBEQVNIXG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRFNIJylcbiAgICAgICAgICAgIHJldHVybiAnREFTSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnUVRNJylcbiAgICAgICAgICAgIHJldHVybiAnUVRVTSc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RBdXRoUldhbGxldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlVHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICdleGNoYW5nZScpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgcmVzcG9uc2UubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbYl07XG4gICAgICAgICAgICBsZXQgWyBhY2NvdW50VHlwZSwgY3VycmVuY3ksIHRvdGFsLCBpbnRlcmVzdCwgYXZhaWxhYmxlIF0gPSBiYWxhbmNlO1xuICAgICAgICAgICAgaWYgKGFjY291bnRUeXBlID09IGJhbGFuY2VUeXBlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5WzBdID09ICd0JylcbiAgICAgICAgICAgICAgICAgICAgY3VycmVuY3kgPSBjdXJyZW5jeS5zbGljZSAoMSk7XG4gICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIHVwcGVyY2FzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1cHBlcmNhc2UpO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGF2YWlsYWJsZTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdG90YWw7XG4gICAgICAgICAgICAgICAgaWYgKGFjY291bnRbJ2ZyZWUnXSlcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJvb2tTeW1ib2xQcmVjaXNpb24gKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiAnUjAnLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiBbXSxcbiAgICAgICAgICAgICdhc2tzJzogW10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVyYm9vay5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJib29rW2ldO1xuICAgICAgICAgICAgbGV0IHByaWNlID0gb3JkZXJbMV07XG4gICAgICAgICAgICBsZXQ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07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCBbIGlkLCB0aW1lc3RhbXAsIGFtb3VudCwgcHJpY2UgXSA9IHRyYWRlO1xuICAgICAgICBsZXQgc2lkZSA9IChhbW91bnQgPCAwKSA/ICdzZWxsJyA6ICdidXknO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG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FkZXJzID0ge1xuICAgICAgICAgICAgICAgICdiZngtbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYmZ4LWFwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdiZngtc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmIChyZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddLmluZGV4T2YgKCdub3QgZW5vdWdoIGV4Y2hhbmdlIGJhbGFuY2UnKSA+PSAwKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICB9XG4gICAgICA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W1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MDUxNjQyLTU2MTU0MTgyLTY2MGUtMTFlNy05YjBkLTYwNDJkMWU2ZWRkOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYml0Zmx5ZXIuanAnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXRmbHllci5qcCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JpdGZseWVyLmpwL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHMnLCAgICAvLyBvciAnbWFya2V0cydcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRib2FyZCcsICAgICAgLy8gb3IgJ2JvYXJkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHRpY2tlcicsICAgICAvLyBvciAndGlja2VyJ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGV4ZWN1dGlvbnMnLCAvLyBvciAnZXhlY3V0aW9ucydcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRoZWFsdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNoYXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBlcm1pc3Npb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjb2xsYXRlcmFsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjb2xsYXRlcmFsYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29pbmlucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29pbm91dHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbmthY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHdpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjaGlsZG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGFyZW50b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRwYXJlbnRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR0cmFkaW5nY29tbWlzc2lvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRjb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZGNoaWxkb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbGNoaWxkb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRwYXJlbnRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VscGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbGFsbGNoaWxkb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wydwcm9kdWN0X2NvZGUnXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGxldCBudW1DdXJyZW5jaWVzID0gY3VycmVuY2llcy5sZW5ndGg7XG4gICAgICAgICAgICBpZiAobnVtQ3VycmVuY2llcyA9PSAxKSB7XG4gICAgICAgICAgICAgICAgYmFzZSA9IHN5bWJvbC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBzeW1ib2wuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChudW1DdXJyZW5jaWVzID09IDIpIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1swXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMV07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1sxXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMl07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHt9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHJlc3BvbnNlLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHJlc3BvbnNlW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYWNjb3VudFsnY3VycmVuY3lfY29kZSddO1xuICAgICAgICAgICAgYmFsYW5jZXNbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZXNbY3VycmVuY3ldWydhdmFpbGFibGUnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJvYXJkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3Byb2R1Y3RfY29kZSc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnc2l6ZScpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwcm9kdWN0X2NvZGUnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0aWNrZXJbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmVzdF9iaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydiZXN0X2FzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbHRwJ10pLFxuICAgICAgICAgICAgJ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W50LFxuICAgICAgICAgICAgLy8gJ2JhbmtfYWNjb3VudF9pZCc6IDEyMzQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydtZXNzYWdlX2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9ICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpXG4gICAgICAgICAgICByZXF1ZXN0ICs9ICdtZS8nO1xuICAgICAgICByZXF1ZXN0ICs9IHBhdGg7XG4gICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHJlcXVlc3Q7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBbIG5vbmNlLCBtZXRob2QsIHJlcXVlc3QsIGJvZHkgXS5qb2luICg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LCB7XG4gICAgICAgICAgICAnaWQnOiAnYml0aHVtYicsXG4gICAgICAgICAgICAnbmFtZSc6ICdCaXRodW1iJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnS1InLCAvLyBTb3V0aCBLb3JlYVxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDUwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDU5NzE3Ny1lYTgwMDE3Mi05ZDVlLTExZTctODA0Yy1iOWQ0ZmE5YjU2YjAuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJpdGh1bWIuY29tL3B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJpdGh1bWIuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0aHVtYi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYml0aHVtYi5jb20vdTEvVVMxMjcnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlY2VudF90cmFuc2FjdGlvbnMve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVjZW50X3RyYW5zYWN0aW9ucy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3dhbGxldF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vdXNlcl90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL3BsYWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL29yZGVyX2RldGFpbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9idGNfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUva3J3X2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2tyd193aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9tYXJrZXRfYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9tYXJrZXRfc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlckFsbCAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAobWFya2V0c1snZGF0YSddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBpZiAoaWQgIT0gJ2RhdGUnKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gaWQ7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gJ0tSVyc7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgICAgICdsb3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG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W50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rQ3VycmVuY3kgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY291bnQnOiA1MCwgLy8gbWF4ID0gNTBcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnYmFzZSddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAob3JkZXJib29rWyd0aW1lc3RhbXAnXSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHRpbWVzdGFtcCwgJ2JpZHMnLCAnYXNrcycsICdwcmljZScsICdxdWFudGl0eScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRpY2tlclsnZGF0ZSddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldG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MgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyQWxsIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSByZXNwb25zZVsnZGF0YSddWydkYXRlJ107XG4gICAgICAgIGxldCB0aWNrZXJzID0gdGhpcy5vbWl0IChyZXNwb25zZVsnZGF0YSddLCAnZGF0ZScpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICB0aWNrZXJbJ2RhdGUnXSA9IHRpbWVzdGFtcDtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0I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pZCArICcgcHJpdmF0ZSBBUEkgbm90IGltcGxlbWVudGVkIHlldCcpO1xuICAgICAgICAvLyAgICAgbGV0IHByZWZpeCA9ICcnO1xuICAgICAgICAvLyAgICAgaWYgKHR5cGUgPT0gJ21hcmtldCcpXG4gICAgICAgIC8vICAgICAgICAgcHJlZml4ID0gJ21hcmtldF8nO1xuICAgICAgICAvLyAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAvLyAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgLy8gICAgICAgICAncXVhbnRpdHknOiBhbW91bnQsXG4gICAgICAgIC8vICAgICAgICAgJ3ByaWNlJzogcHJpY2UgfHwgMCxcbiAgICAgICAgLy8gICAgICAgICAndHlwZSc6IHByZWZpeCArIHNpZGUsXG4gICAgICAgIC8vICAgICB9O1xuICAgICAgICAvLyAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVyQ3JlYXRlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICAvLyAgICAgcmV0dXJuIHtcbiAgICAgICAgLy8gICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAvLyAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAvLyAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHNpZGUgPSAoJ3NpZGUnIGluIHBhcmFtcyk7XG4gICAgICAgIGlmICghc2lkZSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBjYW5jZWxPcmRlciByZXF1aXJlcyBhIHNpZGUgcGFyYW1ldGVyIChzZWxsIG9yIGJ1eSknKTt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1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnZW5kcG9pbnQnOiBlbmRwb2ludCxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KSk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBlbmRwb2ludCArIFwiXFwwXCIgKyBib2R5ICsgXCJcXDBcIiArIG5vbmNlO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBcGktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FwaS1TaWduJzogdGhpcy5kZWNvZGUgKHRoaXMuc3RyaW5nVG9CYXNlNjQgKHRoaXMuZW5jb2RlIChzaWduYXR1cmUpKSksXG4gICAgICAgICAgICAgICAgJ0FwaS1Ob25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID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GlzaCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdiaXRsaXNoJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdHQicsICdFVScsICdSVScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYyNzUtZGNmYzZjMzAtNWVkMy0xMWU3LTgzOWQtMDBhODQ2Mzg1ZDBiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2JpdGxpc2guY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2JpdGxpc2guY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYml0bGlzaC5jb20vYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjdicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc19kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY3YnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50c19vcGVyYXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF90cmFkZXNfYnlfaWRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfYWxsX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX2Jjb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfdGVtcGxhdGVfd2FsbGV0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfYWNjb3VudHNfb3BlcmF0aW9uc19mcm9tX3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2FjdGl2ZV90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfYmNvZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X215X21hdGNoZXNfZnJvbV90cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9teV90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfbXlfdHJhZHNfZnJvbV90cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9wYXltZW50X21ldGhvZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfcGF5bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZGVlbV9jb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXNpZ24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ25pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2lnbm91dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfb3B0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2J5X2lkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoIXRoaXMuc3Vic3RpdHV0ZUNvbW1vbkN1cnJlbmN5Q29kZXMpXG4gICAgICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWEJUJylcbiAgICAgICAgICAgIHJldHVybiAnQlRDJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCQ0MnKVxuICAgICAgICAgICAgcmV0dXJuICdCQ0gnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0RSSycpXG4gICAgICAgICAgICByZXR1cm4gJ0RBU0gnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0RTSCcpXG4gICAgICAgICAgICBjdXJyZW5jeSA9ICdEQVNIJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQYWlycyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1trZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21heCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdtaW4nKSxcbiAgICAgICAgICAgICdiaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdmaXJz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m9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXNEZXB0aCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyX2lkJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAocGFyc2VJbnQgKG9yZGVyYm9va1snbGFzdCddKSAvIDEwMDApO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXAsICdiaWQnLCAnYXNrJywgJ3ByaWNlJywgJ3ZvbHVtZScpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNpZGUgPSAodHJhZGVbJ2RpciddID09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsnY3JlYXRlZCddIC8gMTAwMCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb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ICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgc2lnbkluICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMucHJpdmF0ZVBvc3RTaWduaW4gKHtcbiAgICAgICAgICAgICdsb2dpbic6IHRoaXMubG9naW4sXG4gICAgICAgICAgICAncGFzc3dkJzogdGhpcy5wYXNzd29yZCxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3BhaXJfaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2Rpcic6IChzaWRlID09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbGltaXQnKVxuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDcmVhdGVUcmFkZSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzdWx0LFxuICAgICAgICAgICAgJ2lkJzogcmVzdWx0WydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBw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VbJ21lc3NhZ2VfaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uICh0aGlzLmV4dGVuZCAoeyAndG9rZW4nOiB0aGlzLmFwaUtleSB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuIC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AgJzFNJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnM00nOiAnM20nLFxuICAgICAgICAgICAgICAgICc2TSc6ICc2bScsXG4gICAgICAgICAgICAgICAgJzF5JzogJzF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY3MjU2LWE4NTU1MjAwLTVlZjktMTFlNy05NmZkLTQ2OWE2NWUyYjBiZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LmJpdG1hcmtldC5wbC9hcGkyLycsIC8vIGxhc3Qgc2xhc2ggaXMgY3JpdGljYWxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQucGwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldC9kb2NzLnBocD9maWxlPWFwaV9wdWJsaWMuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0L2RvY3MucGhwP2ZpbGU9YXBpX3ByaXZhdGUuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0bWFya2V0LW5ldC9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24ve21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqc29uL3ttYXJrZXR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnanNvbi97bWFya2V0fS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24vY3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vOTBtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vNmgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8xZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzdkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8zbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzZtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ2Rlc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdkZXNrU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nZGVza0NvbmZpcm0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b3RyYWRpbmdkZXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG90cmFkaW5nZGVza1N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvdHJhZGluZ2Rlc2tDb25maXJtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdGaWF0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd1BMTlBQJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0ZpYXRGYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5MaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5PcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5DbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5Nb2RpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VBZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VSZW1vdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N3YXBMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzd2FwT3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3dhcENsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvUExOJzogeyAnaWQnOiAnQlRDUExOJywgJ3N5bWJvbCc6ICdCVEMvUExOJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ0JUQ0VVUicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9QTE4nOiB7ICdpZCc6ICdMVENQTE4nLCAnc3ltYm9sJzogJ0xUQy9QTE4nLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnUExOJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvQlRDJzogeyAnaWQnOiAnTFRDQlRDJywgJ3N5bWJvbCc6ICdMVEMvQlRDJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgICAgICAnTGl0ZU1pbmVYL0JUQyc6IHsgJ2lkJzogJ0xpdGVNaW5lWEJUQycsICdzeW1ib2wnOiAnTGl0ZU1pbmVYL0JUQycsICdiYXNlJzogJ0xpdGVNaW5lWCcsICdxdW90ZSc6ICdCVEMnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDQ1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RJbmZvICgpO1xuICAgICAgICBsZXQgZGF0YSA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBiYWxhbmNlID0gZGF0YVsnYmFsYW5jZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBkYXRhIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VbJ2F2YWlsYWJsZSddKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGJhbGFuY2VbJ2F2YWlsYWJsZSddW2N1cnJlbmN5XTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlWydibG9ja2VkJ10pXG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYmFsYW5jZVsnYmxvY2tlZCddW2N1cnJlbmN5XTtcbiAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0aGlzLnN1bSAoYW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2d2FwID0gcGFyc2VGbG9hdCAodGlja2VyWyd2d2FwJ10pO1xuICAgICAgICBsZXQgYmFzZVZvbHVtZSA9IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lJ10pO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSBiYXNlVm9sdW1lICogdndhcDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2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ICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIGFzeW5jIHdpdGhkcmF3IChjdXJyZW5jeSwgYW1vdW50LCBhZGRyZXNzLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWV0aG9kID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgJ3F1YW50aXR5JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodGhpcy5pc0ZpYXQgKGN1cnJlbmN5KSkge1xuICAgICAgICAgICAgbWV0aG9kID0gJ3ByaXZhdGVQb3N0V2l0aGRyYXdGaWF0JztcbiAgICAgICAgICAgIGlmICgnYWNjb3VudCcgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICAgICAgcmVxdWVzdFsnYWNjb3VudCddID0gcGFyYW1zWydhY2NvdW50J107IC8vIGJhbmsgYWNjb3VudCBjb2RlIGZvciB3aXRoZHJhd2FsXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXF1aXJlcyBhY2NvdW50IHBhcmFtZXRlciB0byB3aXRoZHJhdyBmaWF0IGN1cnJlbmN5Jyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoJ2FjY291bnQyJyBpbiBwYXJhbXMpIHtcbiAgICAgICAgICAgICAgICByZXF1ZXN0WydhY2NvdW50MiddID0gcGFyYW1zWydhY2NvdW50MiddOyAvLyBiYW5rIFNXSUZUIGNvZGUgKEVVUiBvbmx5KVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0VVUic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4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjMxOS1mNjUzYzZlNi01ZWQ0LTExZTctOTMzZC1mMGJjMzY5OWFlOGYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJpdG1leC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmJpdG1leC5jb20vYXBwL2FwaU92ZXJ2aWV3JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9CaXRNRVgvYXBpLWNvbm5lY3RvcnMvdHJlZS9tYXN0ZXIvb2ZmaWNpYWwtaHR0cCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYW5ub3VuY2VtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbm5vdW5jZW1lbnQvdXJnZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudC9hY3RpdmVBbmRJbmRpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZUludGVydmFscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudC9jb21wb3NpdGVJbmRleCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudC9pbmRpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN1cmFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlYWRlcmJvYXJkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXF1aWRhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJCb29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2svTDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZS9idWNrZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2NoZW1hJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzY2hlbWEvd2Vic29ja2V0SGVscCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2V0dGxlbWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9idWNrZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQvY2hhbm5lbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQvY29ubmVjdGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGVjdXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbi90cmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25vdGlmaWNhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FmZmlsaWF0ZVN0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jaGVja1JlZmVycmFsQ29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb21taXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21hcmdpbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9taW5XaXRoZHJhd2FsRmVlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXRIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleS9kaXNhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXkvZW5hYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjaGF0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvYnVsaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsQWxsQWZ0ZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2Nsb3NlUG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2lzb2xhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9yaXNrTGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3RyYW5zZmVyTWFyZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NhbmNlbFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybUVtYWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NvbmZpcm1FbmFibGVURkEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybVdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGlzYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dvdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbG9nb3V0QWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByZWZlcmVuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3JlcXVlc3RFbmFibGVURkEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcmVxdWVzdFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9idWxrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0SW5zdHJ1bWVudEFjdGl2ZUFuZEluZGljZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0WydzdGF0ZSddICE9ICdVbmxpc3RlZCcpO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wyd1bmRlcmx5aW5nJ107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3F1b3RlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB0eXBlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IGZ1dHVyZSA9IGZhbHNlO1xuICAgICAgICAgICAgbGV0IHByZWRpY3Rpb24gPSBmYWxzZTtcbiAgICAgICAgICAgIGxldCBiYXNlcXVvdGUgPSBiYXNlICsgcXVvdGU7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN3YXAgPSAoaWQgPT0gYmFzZXF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGlmIChzd2FwKSB7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdzd2FwJztcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlkLmluZGV4T2YgKCdCXycpID49IDApIHtcbiAgICAgICAgICAgICAgICBwcmVkaWN0aW9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB0eXBlID0gJ3ByZWRpY3Rpb24nO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBmdXR1cmUgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnZnV0dXJlJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBtYWtlciA9IG1hcmtldFsnbWFrZXJGZWUnXTtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IG1hcmtldFsndGFrZXJGZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAgICAgJ3Nwb3QnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnc3dhcCc6IHN3YXAsXG4gICAgICAgICAgICAgICAgJ2Z1dHVyZSc6IGZ1dHVyZSxcbiAgICAgICAgICAgICAgICAncHJlZGljdGlvbic6IHByZWRpY3Rpb24sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlck1hcmdpbiAoeyAnY3VycmVuY3knOiAnYWxsJyB9KTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHJlc3BvbnNlLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHJlc3BvbnNlW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnYXZhaWxhYmxlTWFyZ2luJ10sXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZVsnYW1vdW50J10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCVEMnKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYWNjb3VudFsnZnJlZSddICogMC4wMDAwMDAwMTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gYWNjb3VudFsndG90YWwnXSAqIDAuMDAwMDAwMDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyQm9va0wyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnYmlkcyc6IFtdLFxuICAgICAgICAgICAgJ2Fza3MnOiBbXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgIH07XG4gICAgICAgIGZvciAobGV0IG8gPSAwOyBvIDwgb3JkZXJib29rLmxlbmd0aDsgbysrKSB7XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcmJvb2tbb107XG4gICAgICA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cmVzcG9uc2VbJ3RyYW5zYWN0SUQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2VbJ2Vycm9yJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gJy9hcGknICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgIHF1ZXJ5ICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHF1ZXJ5O1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBtZXRob2QgKyBxdWVyeSArIG5vbmNlO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICAgICAgICAgIGF1dGggKz0gYm9keTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ2FwaS1ub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdhcGkta2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ2FwaS1zaWduYXR1cmUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxufVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vICAtLS0tL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OiAnaHR0cHM6Ly9iaXRzby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRzby5jb20vYXBpX2luZm8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdmFpbGFibGVfYm9va3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRfc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5ncycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ3Mve2ZpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdfZGVzdGluYXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2t5Y19kb2N1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlZGdlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyL3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyL2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlZGdlci9mdW5kaW5ncycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyL3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteF9iYW5rX2NvZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfdHJhZGVzL3tvaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve29pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYWRlcy97dGlkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy97d2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGViaXRfY2FyZF93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldGhlcl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bob25lX251bWJlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGhvbmVfdmVyaWZpY2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwaG9uZV93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzcGVpX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97b2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRBdmFpbGFibGVCb29rcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHNbJ3BheWxvYWQnXS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3BheWxvYWQnXVtpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnYm9vayddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkLnRvVXBwZXJDYXNlICgpLnJlcGxhY2UgKCdfJywgJy8nKTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pbmltdW1fYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogcGFyc2VGbG9hdCAobWFya2V0WydtYXhpbXVtX2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWluaW11bV9wcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4aW11bV9wcmljZSddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAobWFya2V0WydtaW5pbXVtX3ZhbHVlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogcGFyc2VGbG9hdCAobWFya2V0WydtYXhpbXVtX3ZhbHVlJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ21pbmltdW1fYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydtaW5pbXVtX3ByaWNlJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBsaW1pdHNbJ2Ftb3VudCddWydtaW4nXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3Bvb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V9pZFt0cmFkZVsnYm9vayddXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsnbWFrZXJfc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKHRyYWRlWydhbW91bnQnXSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2Jvb2snOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYX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lZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2sve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyX2hvdXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nLXBhaXJzLWluZm8vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhbnNhY3Rpb25zL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzL2FsbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfc3RhdHVzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS9tYXJrZXQve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsdGNfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2x0Y19hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldGhfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyLXRvLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlci1mcm9tLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4cnBfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3hycF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC9vcGVuLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC9zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL2NhbmNlbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpcXVpZGF0aW9uX2FkZHJlc3MvbmV3LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlxdWlkYXRpb25fYWRkcmVzcy9pbmZvLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndjEnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fZGVwb3NpdF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkaW5nUGFpcnNJbmZvICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wyd1cmxfc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRbJ2Jhc2VfZGVjaW1hbHMnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ2NvdW50ZXJfZGVjaW1hbHMnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgWyBjb3N0LCBjdXJyZW5jeSBdID0gbWFya2V0WydtaW5pbXVtX29yZGVyJ10uc3BsaXQgKCcgJyk7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gKG1hcmtldFsndHJhZGluZyddID09ICdFbmFibGVkJyk7XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChjb3N0KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAob3JkZXJib29rWyd0aW1lc3RhbXAnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXApO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlclBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRpY2tlclsndGltZXN0YW1wJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHZ3YXAgPSBwYXJzZUZsb2F0ICh0aWNrZXJbJ3Z3YXAnXSk7XG4gICAgICAgIGxldCBi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biAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3Nzg2Mzc3LThjOGFiNTdlLTVmZTktMTFlNy04ZWE0LTJiMDViNmJjY2VlYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0L2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyX2hvdXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXVyX3VzZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2FsbF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VuY29uZmlybWVkX2J0YycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmlwcGxlX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JpcHBsZV9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsX3JlcXVlc3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdidGN1c2QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ21ha2VyJzogMC4wMDI1LCAndGFrZXInOiAwLjAwMjUgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ2J0Y2V1cicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInLCAnbWFrZXInOiAwLjAwMjUsICd0YW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WVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnZGF0ZXRpbWUnXSk7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGV0aW1lJ10pICogMTAwMDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsndHlwZSddID09IDApID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIGxldCBvcmRlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdvcmRlcl9pZCcgaW4gdHJhZGUpXG4gICAgICAgICAgICBvcmRlciA9IHRyYWRlWydvcmRlcl9pZCddLnRvU3RyaW5nICgpO1xuICAgICAgICBpZiAoJ2N1cnJlbmN5X3BhaXInIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBpZiAodHJhZGVbJ2N1cnJlbmN5X3BhaXInXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeV9wYWlyJ11dO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXIsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAg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2hNeVRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJ29uZU1pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJ2ZpdmVNaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAndGhpcnR5TWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnaG91cicsXG4gICAgICAgICAgICAgICAgJzFkJzogJ2RheScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjM1Mi1jZjBiM2MyNi01ZWQ1LTExZTctODJiNy1mMzgyNmI3YTk3ZDguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYml0dHJleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnbWFya2V0JzogJ2h0dHBzOi8vYml0dHJleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3YyJzogJ2h0dHBzOi8vYml0dHJleC5jb20vYXBpL3YyLjAvcHViJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0dHJleC5jb20vSG9tZS9BcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubnBtanMub3JnL3BhY2thZ2Uvbm9kZS5iaXR0cmV4LmFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0dHJleC5jb20vRmVlcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQuYml0dHJleC5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDAwMTk5NjUxLVdoYXQtZmVlcy1kb2VzLUJpdHRyZXgtY2hhcmdlLScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd2Mic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL0dldEJUQ1ByaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvR2V0VGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9HZXRMYXRlc3RUaWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNYXJrZXRzL0dldE1hcmtldFN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L0dldExhdGVzdFRpY2snLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzdW1tYXJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdhY2NvdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0YWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eWxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXltYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbm9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbGxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGNvc3QpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMudHJ1bmNhdGUgKHBhcnNlRmxvYXQgKGNvc3QpLCB0aGlzLm1hcmtldHNbc3ltYm9sXS5wcmVjaXNpb24ucHJpY2UpO1xuICAgIH1cblxuICAgIGZlZVRvUHJlY2lzaW9uIChzeW1ib2wsIGZlZSkge1xuICAgICAgICByZXR1cm4gdGhpcy50cnVuY2F0ZSAocGFyc2VGbG9hdCAoZmVlKSwgdGhpcy5tYXJrZXRzW3N5bWJvbF1bJ3ByZWNpc2lvbiddWydwcmljZSddKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnYyR2V0TWFya2V0c0dldE1hcmtldFN1bW1hcmllcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJlc3BvbnNlWydyZXN1bHQnXS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHJlc3BvbnNlWydyZXN1bHQnXVtpXVsnTWFya2V0J107XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ01hcmtldE5hbWUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydNYXJrZXRDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydCYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluVHJhZGVTaXplJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJpY2VMaW1pdHMgPSB7ICdtaW4nOiB1bmRlZmluZWQsICdtYXgnOiB1bmRlZmluZWQgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydJc0FjdGl2ZSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5hY2NvdW50R2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAg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gICAvLyB0b2RvOiB3aWxsIG5lZWQgdG8gcmV0aGluayB0aGUgZmVlc1xuICAgICAgICAgICAgLy8gdG8gYWRkIHN1cHBvcnQgZm9yIG11bHRpcGxlIHdpdGhkcmF3YWwvZGVwb3NpdCBtZXRob2RzIGFuZFxuICAgICAgICAgICAgLy8gZGlmZmVyZW50aWF0ZWQgZmVlcyBmb3IgZWFjaCBwYXJ0aWN1bGFyIG1ldGhvZFxuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCwgLy8gZGVmYXVsdCBwcmVjaXNpb24sIHRvZG86IGZpeCBcIm1hZ2ljIGNvbnN0YW50c1wiXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnQ3VycmVuY3lMb25nJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGN1cnJlbmN5WydJc0FjdGl2ZSddLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsnVHhGZWUnXSwgLy8gdG9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ1R4RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzdW1tYXJpZXMgKHBhcmFtcyk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgdGlja2Vycy5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbdF07XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ01hcmtldE5hbWUnXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgWyBxdW90ZSwgYmFzZSBdID0gaWQuc3BsaXQgKCctJyk7XG4gICAgICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0c3VtbWFyeSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3Jlc3VsdCddWzBdO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnVGltZVN0YW1wJ10pO1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHRyYWRlWydPcmRlclR5cGUnXSA9PSAnQlVZJykge1xuICAgICAgICAgICAgc2lkZSA9ICdidXknO1xuICAgICAgICB9IGVsc2UgaWYgKHRyYWRlWydPcmRlclR5cGUnXSA9PSAnU0VMTCcpIHtcbiAgICAgICAgICAgIHNpZGUgPSAnc2VsbCc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGlkID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ0lkJyBpbiB0cmFkZSlcbiAgICAgICAgICAgIGlkID0gdHJhZGVbJ0lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICA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ChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncmF0ZSddID0gdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXN1bHQnXVsndXVpZCddLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICByZXNwb25zZSA9IGF3YWl0IHRoaXMubWFya2V0R2V0Q2FuY2VsICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICd1dWlkJzogaWQsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgaWYgKHRoaXMubGFzdF9qc29uX3Jlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKHRoaXMubGFzdF9qc29uX3Jlc3BvbnNlLCAnbWVzc2FnZScpO1xuICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09ICdPUkRFUl9OT1RfT1BFTicpXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJb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tldCkge1xuICAgICAgICAgICAgaWYgKCdFeGNoYW5nZScgaW4gb3JkZXIpXG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydFeGNoYW5nZSddIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW29yZGVyWydFeGNoYW5nZSddXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdPcGVuZWQnIGluIG9yZGVyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydPcGVuZWQnXSk7XG4gICAgICAgIGlmICgnVGltZVN0YW1wJyBpbiBvcmRlcilcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvcmRlclsnVGltZVN0YW1wJ10pO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29tbWlzc2lvbiA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdDb21taXNzaW9uJyBpbiBvcmRlcikge1xuICAgICAgICAgICAgY29tbWlzc2lvbiA9ICdDb21taXNzaW9uJztcbiAgICAgICAgfSBlbHNlIGlmICgnQ29tbWlzc2lvblBhaWQnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICBjb21taXNzaW9uID0gJ0NvbW1pc3Npb25QYWlkJztcbiAgICAgICAgfVxuICAgICAgICBpZiAoY29tbWlzc2lvbikge1xuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAob3JkZXJbY29tbWlzc2lvbl0pLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnTGltaXQnKTtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUXVhbnRpdHknKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1F1YW50aXR5UmVtYWluaW5nJywgMC4wKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgaWYgKCFjb3N0KSB7XG4gICAgICAgICAgICBpZiAocHJpY2UgJiYgYW1vdW50KVxuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIXByaWNlKSB7XG4gICAgICAgICAgICBpZiAoY29zdCAmJiBmaWxsZWQpXG4gICAgICAgICAgICAgICAgcHJpY2UgPSBjb3N0IC8gZmlsbGVkO1xuICAgICAgICB9XG4gICAgICAgIGxldCBhdmVyYWdlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUHJpY2VQZXJVbml0Jyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ09yZGVyVXVpZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHJlc3BvbnNlID0gYXdhaXQgdGhpcy5hY2NvdW50R2V0T3JkZXIgKHsgJ3V1aWQnOiBpZCB9KTtcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgaWYgKHRoaXMubGFzdF9qc29uX3Jlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKHRoaXMubGFzdF9qc29uX3Jlc3BvbnNlLCAnbWVzc2FnZScpO1xuICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09ICdVVUlEX0lOVkFMSUQnKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgZmV0Y2hPcmRlcigpIGVycm9yOiAnICsgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdG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CArPSBhcGkgKyAnLycgKyBtZXRob2QudG9Mb3dlckNhc2UgKCkgKyBwYXRoO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSBpZiAoYXBpID09ICd2MicpIHtcbiAgICAgICAgICAgIHVybCArPSBwYXRoO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gYXBpICsgJy8nO1xuICAgICAgICAgICAgaWYgKCgoYXBpID09ICdhY2NvdW50JykgJiYgKHBhdGggIT0gJ3dpdGhkcmF3JykpIHx8IChwYXRoID09ICdvcGVub3JkZXJzJykpXG4gICAgICAgICAgICAgICAgdXJsICs9IG1ldGhvZC50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIHVybCArPSBwYXRoICsgJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAodXJsKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ2FwaXNpZ24nOiBzaWduYXR1cmUgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA+PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09IFwie1wiKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ21lc3NhZ2UnXSA9PSAnTUlOX1RSQURFX1JFUVVJUkVNRU5UX05PVF9NRVQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddID09ICdBUElLRVlfSU5WQUxJRCcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydzdWNjZXNzJ10pXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgICAgICB9XG4gICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddID09ICdBRERSRVNTX0dFTkVSQVRJTkcnKVxuICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddID09IFwiSU5TVUZGSUNJRU5UX0ZVTkRTXCIpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICB9XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdF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ICAnd3d3JzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9ibDNwLmV1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0b25pYy5ubCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdG9uaWNOTC9ibDNwLWFwaS90cmVlL21hc3Rlci9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYmwzcC5ldS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRvbmljLm5sL2VuL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvZGVwdGgvZnVsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXIvYWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVyL3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlcnMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvdHJhZGVzL2ZldGNoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L25ld19kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFTk1LVC9tb25leS93YWxsZXQvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDRVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicsICdtYWtlcic6IDAuMDAyNSwgJ3Rha2VyJzogMC4wMDI1IH0sXG4gICAgICAgICAgICAgICAgLy8gJ0xUQy9FVVInOiB7ICdpZCc6ICdMVENFVVInLCAnc3ltYm9sJzogJ0xUQy9FVVInLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZh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AoYWNjb3VudFsnZnJlZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIHBhcnNlQmlkQXNrIChiaWRhc2ssIHByaWNlS2V5ID0gMCwgYW1vdW50S2V5ID0gMCkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgYmlkYXNrWydwcmljZV9pbnQnXSAvIDEwMDAwMC4wLFxuICAgICAgICAgICAgYmlkYXNrWydhbW91bnRfaW50J10gLyAxMDAwMDAwMDAuMCxcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXVsnMjRoJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW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ndHJhZGVzJ10sIG1hcmtldCk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2Ftb3VudF9pbnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmVlX2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgJ3R5cGUnOiAoc2lkZSA9PSAnYnV5JykgPyAnYmlkJyA6ICdhc2snLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbGltaXQnKVxuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlX2ludCddID0gcHJpY2U7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RNYXJrZXRNb25leU9yZGVyQWRkICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE1hcmtldE1vbmV5T3JkZXJDYW5jZWwgKHsgJ29yZGVyX2lkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocG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Fsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMxMjc1ODAzLTRkZjc1NWE4LWFhYTEtMTFlNy05YWJiLTExZWMyZmFkOWYyZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYnRjYm94LmNvLmpwL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5idGNib3guY28uanAvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmJ0Y2JveC5jby5qcC9oZWxwL2FzbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWxsdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfdmlldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSlBZJzogeyAnaWQnOiAnQlRDL0pQWScsICdzeW1ib2wnOiAnQlRDL0pQWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdKUFknIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBsb3dlcmNhc2UgPSBjdXJyZW5jeS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGlmIChsb3dlcmNhc2UgPT0gJ2Rhc2gnKVxuICAgICAgICAgICAgICAgIGxvd2VyY2FzZSA9ICdkcmsnO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBsZXQgZnJlZSA9IGxvd2VyY2FzZSArICdfYmFsYW5jZSc7XG4gICAgICAgICAgICBsZXQgdXNlZCA9IGxvd2VyY2FzZSArICdfbG9jayc7XG4gICAgICAgICAgICBpZiAoZnJlZSBpbiBiYWxhbmNlcyl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1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2VsbCcpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAg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TQvMjc3NjYzNjgtNDY1YjMyODYtNWVkNi0xMWU3LTlhMTEtMGY2NDY3ZTFkODJiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3BsdXMnOiAnaHR0cHM6Ly9wbHVzLWFwaS5idGNjaGluYS5jb20vbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2RhdGEuYnRjY2hpbmEuY29tL2RhdGEnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5idGNjaGluYS5jb20vYXBpX3RyYWRlX3YxLnBocCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJ0Y2NoaW5hLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5idGNjaGluYS5jb20vYXBpZG9jcydcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwbHVzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnlkYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0J1eU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlPcmRlcjInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0J1eVN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsSWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsU3RvcE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QXJjaGl2ZWRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QXJjaGl2ZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEljZWJlcmdPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXREZXB0aDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0U3RvcE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRXaXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2VsbE9yZGVyMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2VsbFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0NOWSc6IHsgJ2lkJzogJ2J0Y2NueScsICdzeW1ib2wnOiAnQlRDL0NOWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdDTlknLCAnYXBpJzogJ3B1YmxpYycsICdwbHVzJzogZmFsc2UgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0NOWSc6IHsgJ2lkJzogJ2x0Y2NueScsICdzeW1ib2wnOiAnTFRDL0NOWScsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdDTlknLCAnYXBpJzogJ3B1YmxpYycsICdwbHVzJzogZmFsc2UgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0JUQyc6IHsgJ2lkJzogJ2x0Y2J0YycsICdzeW1ib2wnOiAnTFRDL0JUQycsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdCVEMnLCAnYXBpJzogJ3B1YmxpYycsICdwbHVzJzogZmFsc2UgfSxcbiAgICAgICAgICAgICAgICAnQkNIL0NOWSc6IHsgJ2lkJzogJ2JjY2NueScsICdzeW1ib2wnOiAnQkNIL0NOWScsICdiYXNlJzogJ0JDSCcsICdxdW90ZSc6ICdDTlknLCAnYXBpJzogJ3BsdXMnLCAncGx1cyc6IHRydWUgfSxcbiAgICAgICAgICAgICAgICAnRVRIL0NOWSc6IHsgJ2lkJzogJ2V0aGNueScsICdzeW1ib2wnOiAnRVRIL0NOWScsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdDTlknLCAnYXBpJzogJ3BsdXMnLCAncGx1cyc6IHRydWUgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiAnYWxsJyxcbiAgICAgICAgfSk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IGtleSA9IGtleXNbcF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1trZXldO1xuICAgICAgICAgICAgbGV0IHBhcnRzID0ga2V5LnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGlkID0gcGFydHNbMV07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGJhc2UgPSBiYXNlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBsb3dlcmNhc2UgPSBjdXJyZW5jeS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGxvd2VyY2FzZSBpbiBiYWxhbmNlc1snYmFsYW5jZSddKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlc1snYmFsYW5jZSddW2xvd2VyY2FzZV1bJ2Ftb3VudCddKTtc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gICAgICAgbGV0IHRpbWVzdGFtcCA9IG9yZGVyYm9va1snZGF0ZSddICogMTAwMDtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdGltZXN0YW1wKTtcbiAgICAgICAgcmVzdWx0Wydhc2tzJ10gPSB0aGlzLnNvcnRCeSAocmVzdWx0Wydhc2tzJ10sIDApO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWydkYXRlJ10gKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogcGFyc2VGbG9hdCAodGlja2VyWyd2d2FwJ10pLFxuICAgICAgICAgICAgJ29wZW4nOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ29wZW4nXSksXG4gICAgICAgICAgICAnY2xvc2UnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ByZXZfY2xvc2UnXSksXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdj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ICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlUGx1cyAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWyd0aW1lc3RhbXAnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bm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ncGFyYW1zJ107XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3BhcmFtcyc6IHAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcCA9IHAuam9pbiAoJywnKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHJlcXVlc3QpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gKFxuICAgICAgICAgICAgICAgICd0b25jZT0nICsgbm9uY2UgK1xuICAgICAgICAgICAgICAgICcmYWNjZXNza2V5PScgKyB0aGlzLmFwaUtleSArXG4gICAgICAgICAgICAgICAgJyZyZXF1ZXN0bWV0aG9kPScgKyBtZXRob2QudG9Mb3dlckNhc2UgKCkgK1xuICAgICAgICAgICAgICAgICcmaWQ9JyArIG5vbmNlICtcbiAgICAgICAgICAgICAgICAnJm1ldGhvZD0nICsgcGF0aCArXG4gICAgICAgICAgICAgICAgJyZwYXJhbXM9JyArIHBcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMScpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmFwaUtleSArICc6JyArIHNpZ25hdHVyZTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiAnQmFzaWMgJyArIHRoaXMuc3RyaW5nVG9CYXNlNjQgKGF1dGgpLFxuICAgICAgICAgICAgICAgICdKc29uLVJwYy1Ub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgf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aWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdidGNtYXJrZXRzJyxcbiAgICAgICAgICAgICduYW1lJzogJ0JUQyBNYXJrZXRzJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQVUnLCAvLyBBdXN0cmFsaWFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLCAvLyBtYXJrZXQgZGF0YSBjYWNoZWQgZm9yIDEgc2Vjb25kICh0cmFkZXMgY2FjaGVkIGZvciAyIHNlY29uZHMpXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yOTE0MjkxMS0wZTFhY2ZjMi03ZDVjLTExZTctOThjNC0wN2Q5NTMyYjI5ZDcuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJ0Y21hcmtldHMubmV0JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYnRjbWFya2V0cy5uZXQvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9CVENNYXJrZXRzL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC97aWR9L3RpY2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC97aWR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97aWR9L3RyYWRpbmdmZWUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kdHJhbnNmZXIvd2l0aGRyYXdDcnlwdG8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmR0cmFuc2Zlci93aXRoZHJhd0VGVCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29wZW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3RyYWRlL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NyZWF0ZUJhdGNoJywgLy8gdGhleSBwcm9taXNlIGl0J3MgY29taW5nIHNvb24uLi5cbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZXRhaWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9BVUQnOiB7ICdpZCc6ICdCVEMvQVVEJywgJ3N5bWJvbCc6ICdCVEMvQVVEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0FVRCcsICdtYWtlcic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AgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gb3JkZXJib29rWyd0aW1lc3RhbXAnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHRpbWVzdGFtcCk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2Jlc3RCaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydiZXN0QXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0UHJpY2UnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUyNGgnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldElkVGljayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiA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yc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTQxNDgzLTc5ZmM3MzUwLTYyZDktMTFlNy05ZjYxLWFjNDdmMjhmY2Q5Ni5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9idGMtdHJhZGUuY29tLnVhL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J0Yy10cmFkZS5jb20udWEnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vZG9jdW1lbnQvZC8xb2NZQTB5TXlfUlhkNTYxc2ZHM3FFUFo4MGt5bGwzNkhVeHZDUmU1R2JoRS9lZGl0JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVhbHMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9zZWxsL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvYnV5L3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqYXBhbl9zdGF0L2hpZ2gve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzay97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlkL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215X29yZGVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvc3RhdHVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbW92ZS9vcmRlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVUFIJzogeyAnaWQnOiAnYnRjX3VhaCcsICdzeW1ib2wnOiAnQlRDL1VBSCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVQUgnLCAncHJlY2lzaW9uJzogeyAncHJpY2UnOiAxIH0sICdsaW1pdHMnOiB7ICdhbW91bnQnOiB7ICdtaW4nOiAwLjAwMDAwMDAwMDEgfX19LFxuICAgICAgICAgICAgICAgICdFVEgvVUFIJzogeyAnaWQnOiAnZXRoX3VhaCcsICdzeW1ib2wnOiAnRVRIL1VBSCcsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdVQUgnIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9VQUgnOiB7ICdpZCc6ICdsdGNfdWFoJywgJ3N5bWJvbCc6ICdMVEMvVUFIJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ1VBSCcgfSxcbiAgICAgICAgICAgICAgICAnRE9HRS9VQUgnOiB7ICdpZCc6ICdkb2dlX3VhaCcsICdzeW1ib2wnOiAnRE9HRS9VQUgnLCAnYmFzZSc6ICdET0dFJywgJ3F1b3RlJzogJ1VBSCcgfSxcbiAgICAgICAgICAgICAgICAnREFTSC9VQUgnOiB7ICdpZ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Cc6ICdkYXNoX2J0YycsICdzeW1ib2wnOiAnREFTSC9CVEMnLCAnYmFzZSc6ICdEQVNIJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHNpZ25JbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnByaXZhdGVQb3N0QXV0aCAoKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGlmICgnYWNjb3VudHMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBsZXQgYWNjb3VudHMgPSByZXNwb25zZVsnYWNjb3VudHMnXTtcbiAgICAgICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYWNjb3VudHMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IGFjY291bnRzW2JdO1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGFjY291bnRbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBwYXJzZUZsb2F0IChhY2NvdW50WydiYWxhbmNlJ10pO1xuICAgICAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZSxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgYmlkcyA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzQnV5U3ltYm9sICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBhc2tzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXNTZWxsU3ltYm9sICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAnYmlkcyc6IFtdLFxuICAgICAgICAgICAgJ2Fza3MnOiBbXSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKGJpZHMpIHtcbiAgICAgICAgICAgIGlmICgnbGlzdCcgaW4gYmlkcylcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2tbJ2JpZHMnXSA9IGJpZHNbJ2xpc3QnXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYXNrcykge1xuICAgICAgICAgICAgaWYgKCdsaXN0JyBpbiBhc2tzKVxuICAgICAgICAgICAgICAgIG9yZGVyYm9va1snYXNrcyddID0gYXNrc1snbGlzdCddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2JpZHMnLCAnYXNrcycsICdwcmljZScsICdjdXJyZW5jeV90cmFkZScpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0SmFwYW5TdGF0SGlnaFN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMuZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCk7XG4gICAgICAgIGxldCBiaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBudW1CaWRzID0gb3JkZXJib29rWydiaWRzJ10ubGVuZ3RoO1xuICAgICAgICBpZiAobnVtQmlkcyA+IDApXG4gICAgICAgICAgICBiaWQgPSBvcmRlcmJvb2tbJ2JpZHMnXVswXVswXTtcbiAgICAgICAgbGV0IGFzayA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IG51bUFza3MgPSBvcmRlcmJvb2tbJ2Fza3MnXS5sZW5ndGg7XG4gICAgICAgIGlmIChudW1Bc2tzID4gMClcbiAgICAgICAgICAgIGFzayA9IG9yZGVyYm9va1snYXNrcyddWzBdWzBdO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RyYWRlcyddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiBiaWQsXG4gICAgICAgICAgICAnYXNrJzogYXNrLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgdGlja2VyTGVuZ3RoID0gdGlja2VyLmxlbmd0aDtcbiAgICAgICAgaWYgKHRpY2tlckxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGxldCBzdGFydCA9IE1hdGgubWF4ICh0aWNrZXJMZW5ndGggLSA0OCwgMCk7XG4gICAgICAgICAgICBmb3IgKGxldCB0ID0gc3RhcnQ7IHQgPCB0aWNrZXIubGVuZ3RoOyB0KyspIHtcbiAgICAgICAgICAgICAgICBsZXQgY2FuZGxlID0gdGlja2VyW3RdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0WydvcGVuJ10gPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnb3BlbiddID0gY2FuZGxlWzFdO1xuICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHJlc3VsdFsnaGlnaCddID09ICd1bmRlZmluZWQnKSB8fCAocmVzdWx0WydoaWdoJ10gPCBjYW5kbGVbMl0pKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2hpZ2gnXSA9IGNhbmRsZVsyXTtcbiAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiByZXN1bHRbJ2xvdyddID09ICd1bmRlZmluZWQnKSB8fCAocmVzdWx0Wydsb3cnXSA+IGNhbmRsZVszXSkpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnbG93J10gPSBjYW5kbGVbM107XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiByZXN1bHRbJ2Jhc2VWb2x1bWUnXSA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0WydiYXNlVm9sdW1lJ10gPSAtY2FuZGxlWzVdO1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0WydiYXNlVm9sdW1lJ10gLT0gY2FuZGxlWzVdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IGxhc3QgPSB0aWNrZXJMZW5ndGggLSAxO1xuICAgICAgICAgICAgcmVzdWx0WydjbG9zZSddID0gdGlja2VyW2xhc3RdWzRdO1xuICAgICAgICAgICAgcmVzdWx0WydiYXNlVm9sdW1lJ10gPSAtMSAqIHJlc3VsdFsnYmFzZVZvbHVtZSddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY29udmVydEN5cmlsbGljTW9udGhOYW1lVG9TdHJpbmcgKGN5cmlsbGljKSB7XG4gICAgICAgIGxldCBtb250aHMgPSBbXG4gICAgICAgICAgICAn0Y/QvdCy0LDRgNGPJyxcbiAgICAgICAgICAgICfRhNC10LLRgNCw0LvRjycsXG4gICAgICAgICAgICAn0LzQsNGA0YLQsCcsXG4gICAgICAgICAgICAn0LDQv9GA0LXQu9GPJyxcbiAgICAgICAgICAgICfQvNCw0Y8nLFxuICAgICAgICAgICAgJ9C40Y7QvdGPJyxcbiAgICAgICAgICAgICfQuNGO0LvRjycsXG4gICAgICAgICAgICAn0LDQstCz0YPRgdGC0LAnLFxuICAgICAgICAgICAgJ9GB0LXQvdGC0Y/QsdGA0Y8nLFxuICAgICAgICAgICAgJ9C+0LrRgtGP0LHRgNGPJyxcbiAgICAgICAgICAgICfQvdC+0Y/QsdGA0Y8nLFxuICAgICAgICAgICAgJ9C00LXQutCw0LHRgNGPJyxcbiAgICAgICAgXTtcbiAgICAgICAgbGV0IG1vbnRoID0gdW5kZWZpbmVkO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1vbnRocy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKGN5cmlsbGljID09IG1vbnRoc1tpXSkge1xuICAgICAgICAgICAgICAgIG1vbnRoID0gaSArIDE7XG4gICAgICAgICAgICAgICAgbW9udGggPSBtb250aC50b1N0cmluZyAoKTtcbiAgICAgICAgICAgICAgICBpZiAoaSA8IDkpXG4gICAgICAgICAgICAgICAgICAgIG1vbnRoID0gJzAnICsgbW9udGg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG1vbnRoO1xuICAgIH1cblxuICAgIHBhcnNlQ3lyaWxsaWNEYXRldGltZSAoY3lyaWxsaWMpIHtcbiAgICAgICAgbGV0IHBhcnRzID0gY3lyaWxsaWMuc3BsaXQgKCcgJyk7XG4gICAgICAgIGxldCBkYXkgPSBwYXJ0c1swXTtcbiAgICAgICAgbGV0IG1vbnRoID0gdGhpcy5jb252ZXJ0Q3lyaWxsaWNNb250aE5hbWVUb1N0cmluZyAocGFydHNbMV0pO1xuICAgICAgICBpZiAoIW1vbnRoKVxuIC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ByZXR1cm4gdGhpcy5wYXJzZU9yZGVycyAob3JkZXJzLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnb3V0X29yZGVyX2lkJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBib2R5ICsgdGhpcy5zZWNyZXQ7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdwdWJsaWM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W1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxZCc6ICcxZCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MjcwOS0xOGUxNTY0Ni02NGEzLTExZTctOWZhMi1iMDk1MGVjNzcxMmYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJ0Y3R1cmsuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5idGN0dXJrLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vQlRDVHJhZGVyL2Jyb2tlci1hcGktZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGNkYXRhJywgLy8gP2xhc3Q9Q09VTlRcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJywgICAvLyA/bGFzdD1DT1VOVCAobWF4IDUwKVxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlclRyYW5zYWN0aW9ucycsIC8vID9vZmZzZXQ9MCZsaW1pdD0yNSZzb3J0PWFzY1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVFJZJzogeyAnaWQnOiAnQlRDVFJZJywgJ3N5bWJvbCc6ICdCVEMvVFJZJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1RSWScsICdtYWtlcic6IDAuMDAyICogMS4xOCwgJ3Rha2VyJzogMC4wMDM1ICogMS4xOCB9LFxuICAgICAgICAgICAgICAgICdFVEgvVFJZJzogeyAnaWQnOiAnRVRIVFJZJywgJ3N5bWJvbCc6ICdFVEgvVFJZJywgJ2Jhc2UnOiAnRVRIJywgJ3F1b3RlJzogJ1RSWScsICdtYWtlcic6IDAuMDAyICogMS4xOCwgJ3Rha2VyJzogMC4wMDM1ICogMS4xOCB9LFxuICAgICAgICAgICAgICAgICdFVEgvQlRDJzogeyAnaWQnOiAnRVRIQlRDJywgJ3N5bWJvbCc6ICdFVEgvQlRDJywgJ2Jhc2UnOiAnRVRIJywgJ3F1b3RlJzogJ0JUQycsICdtYWtlcic6IDAuMDAyICogMS4xOCwgJ3Rha2VyJzogMC4wMDM1ICogMS4xOCB9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AgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ29wZW4nXSksXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogcGFyc2VGbG9hdCAodGlja2VyWydhdmVyYWdlJ10pLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbHVtZSddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRpY2tlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHRpY2tlclsncGFpciddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChzeW1ib2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gJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5iYXNlNjRUb0JpbmFyeSAodGhpcy5zZWNyZXQpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmFwaUtleSArIG5vbmNlO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1QQ0snOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnWC1TdGFtcCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdYLVNpZ25hdHVyZSc6IHRoaXMuc3RyaW5nVG9CYXNlNjQodGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHNlY3JldCwgJ3NoYTI1NicsICdiaW5hcnknKSksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAgLS0tLS0tLS0tLS0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RwczovL2J0Yy14LmlzL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J0Yy14LmlzJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYnRjLXguaXMvY3VzdG9tL2FwaS1kb2N1bWVudC5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve2lkfS97bGltaXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfS97bGltaXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Yy91c2QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJyB9L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RoaXMucHVibGljR2V0RGVwdGhJZExpbWl0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdsaW1pdCc6IDEwMDAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnYW1vdW50Jyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VySWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndGltZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic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gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlSWRMaW1pdCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdsaW1pdCc6IDEwMDAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2UsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlciddWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbCAoeyAnb3JkZXInOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgdXJsICs9IGFwaTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnTWV0aG9kJzogcGF0aC50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduYXR1cmUnOiB0aGlzLmhtYWM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XG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgYnRlciBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdidGVyJyxcbiAgICAgICAgICAgICduYW1lJzogJ0J0ZXInLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ1ZHJywgJ0NOJyBdLCAvLyBCcml0aXNoIFZpcmdpbiBJc2xhbmRzLCBDaGluYVxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMicsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk4MDQ3OS1jZmEzMTg4Yy02Mzg3LTExZTctODE5MS05M2ZjNDE4NGJhNWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vZGF0YS5idGVyLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5idGVyLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J0ZXIuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYnRlci5jb20vYXBpMicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRsaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJCb29rL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeS97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZUhpc3Rvcnkve2lkfS97dGlkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICduZXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0c1dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxBbGxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRpbmZvICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydwYWlycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXQpO1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1swXTtcbiAgICAgICAgICAgIGxldCBkZXRhaWxzID0gbWFya2V0W2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGJhc2UgPSBiYXNlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogZGV0YWlsc1snZGVjaW1hbF9wbGFjZXMnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBkZXRhaWxzWydkZWNpbWFsX3BsYWNlcyddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IGRldGFpbHNbJ21pbl9hbW91bnQnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50TGltaXRzLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlTGltaXRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogZGV0YWlsc1snZmVlJ10gLyAxMDAsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogZGV0YWlsc1snZmVlJ10gLyAxMDAsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3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5XSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlckJvb2tJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICAgICAgcmVzdWx0Wydhc2tzJ10gPSB0aGlzLnNvcnRCeSAocmVzdWx0Wydhc2tzJ10sIDApO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0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d2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IFsgYmFzZUlkLCBxdW90ZUlkIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaWRdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChzeW1ib2wgaW4gdGhpcy5tYXJrZXRzKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZX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hcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBwcmVmaXggPSAoYXBpID09ICdwcml2YXRlJykgPyAoYXBpICsgJy8nKSA6ICcnO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgdGhpcy52ZXJzaW9uICsgJy8xLycgKyBwcmVmaXggKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB7ICdub25jZSc6IG5vbmNlIH07XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICA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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgYnhpbnRoIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2J4aW50aCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdCWC5pbi50aCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1RIJywgLy8gVGhhaWxhbmRcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQxMi01NjdiMWViNC01ZWQ3LTExZTctOTRhOC1mZjZhMzg4NGY2YzUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYnguaW4udGgvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYnguaW4udGgnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9ieC5pbi50aC9pbmZvL2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJycsIC8vIHRpY2tlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcmluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlsbGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaWxsZ3JvdXAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpbGxwYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24taXNzdWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1iaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tbXlpc3N1ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLW15YmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tbXlvcHRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tZXhlcmNpc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC1oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpcmluZyAoKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1trZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncGFpcmluZ19pZCddLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3NlY29uZGFyeV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydwcmltYXJ5X2N1cnJlbmN5J107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeU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6IGJhbGFuY2UgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZSk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2F2YWlsYWJsZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlW2N1cnJlbmN5XVsndG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyaW5nJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2spO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydvcmRlcmJvb2snXVsnYmlkcyddWydoaWdoYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnb3JkZXJib29rJ11bJ2Fza3MnXVsnaGlnaGJpZCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdF9wcmljZSddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2NoYW5nZSddKSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpb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B0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyaW5nJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWyd0cmFkZV9kYXRlJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ29yZGVyJzogdHJhZGVbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3RyYWRlX3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydyYXRlJ10pLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLC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h7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICAgICAgLy8gdHdvZmE6IHRoaXMudHdvZmEsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKVxuICAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydzdWNjZXNzJ10pXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICB9XG59XG4iL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0dHBzOi8vYy1jZXguY29tL3QnLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYy1jZXguY29tL3QvYXBpX3B1Yi5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9jLWNleC5jb20vdC9hcGkuaHRtbCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYy1jZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYy1jZXguY29tLz9pZD1hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3RpY2tlcnMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29pbm5hbWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndm9sdW1lX3tjb2lufScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VkaXN0cmlidXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eWxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcGVub3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXJoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbGxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0lPVCcpXG4gICAgICAgICAgICByZXR1cm4gJ0lvVGNvaW4nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JMQycpXG4gICAgICAgICAgICByZXR1cm4gJ0NyeXB0b2J1bGxjb2luJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdYSUQnKVxuICAgICAgICAgICAgcmV0dXJuICdJbnRlcm5hdGlvbmFsRGlhbW9uZCc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ3Jlc3VsdCddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncmVzdWx0J11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ01hcmtldE5hbWUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydNYXJrZXRDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydCYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2h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uZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICd0eXBlJzogJ2JvdGgnLFxuICAgICAgICAgICAgJ2RlcHRoJzogMTAwLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYnV5JywgJ3NlbGwnLCAnUmF0ZScsICdRdWFudGl0eScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd1cGRhdGVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydidXknXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAn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Sk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsndGlja2VyJ107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydUaW1lU3RhbXAnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnSWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ09yZGVyVHlwZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ1ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ1F1YW50aXR5J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0aGlzdG9y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Y2VsICh7ICd1dWlkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5rZXlzb3J0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ2FwaXNpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh1cmwpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJykgfTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYSc6ICdnZXQnICsgcGF0aCxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMu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C5pby9jZXgtYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfbGltaXRzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlcy97Y3VycmVuY2llc30vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjdi9oZC97eXl5eW1tZGR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vay97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2Vycy97Y3VycmVuY2llc30vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb252ZXJ0L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2Vfc3RhdHMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfb3JkZXJzX3N0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FyY2hpdmVkX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfcmVwbGFjZV9vcmRlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjbG9zZV9wb3NpdGlvbi97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9teWZlZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcl90eC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9wb3NpdGlvbi97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX3Bvc2l0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9vcmRlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeUxpbWl0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ2RhdGEnXVsncGFpcnMnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVsncGFpcnMnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sMSddICsgJy8nICsgbWFya2V0WydzeW1ib2wyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluUHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiAtMSAqIE1hdGgubG9nMTAgKG1hcmtldFsnbWluTG90U2l6ZSddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5Mb3RTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhMb3RTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pblByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4UHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluTG90U2l6ZVMyJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IG9tbWl0ZWQgPSBbICd1c2VybmFtZScsICd0aW1lc3RhbXAnIF07XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMub21pdCAocmVzcG9uc2UsIG9tbWl0ZWQpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0sICdhdmFpbGFibGUnLCAwLjApLFxuICAgICAgICAgICAgICAgICAgICAndXNlZCc6IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0sICdvcmRlcnMnLCAwLjApLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcG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AgICAgIGxldCBhc2sgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXNrJyk7XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnaGlnaCc6IGhpZ2gsXG4gICAgICAgICAgICAnbG93JzogbG93LFxuICAgICAgICAgICAgJ2JpZCc6IGJpZCxcbiAgICAgICAgICAgICdhc2snOiBhc2ssXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCw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ncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlSGlzdG9yeVBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbGltaXQnKSB7XG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gZm9yIG1hcmtldCBidXkgQ0VYLmlvIHJlcXVpcmVzIHRoZSBhbW91bnQgb2YgcXVvdGUgY3VycmVuY3kgdG8gc3BlbmRcbiAgICAgICAgICAgIGlmIChzaWRlID09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFwcmljZSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICgnRm9yIG1hcmtldCBidXkgb3JkZXJzICcgKyB0aGlzLmlkICsgXCIgcmVxdWlyZXMgdGhlIGFtb3VudCBvZiBxdW90ZSBjdXJyZW5jeSB0byBzcGVuZCwgdG8gY2FsY3VsYXRlIHByb3BlciBjb3N0cyBjYWxsIGNyZWF0ZU9yZGVyIChzeW1ib2wsICdtYXJrZXQnLCAnYnV5JywgYW1vdW50LCBwcmljZSlcIik7XG4gICAgICAgICAgICAgICA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AgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndGE6JyArIG1hcmtldFsncXVvdGUnXSk7XG4gICAgICAgICAgICBsZXQgYmFzZUZlZSA9ICdmYTonICsgbWFya2V0WydiYXNlJ107XG4gICAgICAgICAgICBsZXQgcXVvdGVGZWUgPSAnZmE6JyArIG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgIGxldCBmZWVSYXRlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndHJhZGluZ0ZlZU1ha2VyJyk7XG4gICAgICAgICAgICBpZiAoIWZlZVJhdGUpXG4gICAgICAgICAgICAgICAgZmVlUmF0ZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3RyYWRpbmdGZWVUYWtlcicsIGZlZVJhdGUpO1xuICAgICAgICAgICAgaWYgKGZlZVJhdGUpXG4gICAgICAgICAgICAgICAgZmVlUmF0ZSAvPSAxMDAuMDsgLy8gY29udmVydCB0byBtYXRoZW1hdGljYWxseS1jb3JyZWN0IHBlcmNlbnRhZ2UgY29lZmZpY2llbnRzOiAxLjAgPSAxMDAlXG4gICAgICAgICAgICBpZiAoYmFzZUZlZSBpbiBvcmRlcikge1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydiYXNlJ10sXG4gICAgICAgICAgICAgICAgICAgICdyYXRlJzogZmVlUmF0ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsIGJhc2VGZWUpLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHF1b3RlRmVlIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICAgICAgICAgICdyYXRlJzogZmVlUmF0ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsIHF1b3RlRmVlKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICghY29zdClcbiAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGZpbGxlZDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9wZW5PcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAg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tcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB0aGlzLnVpZCArIHRoaXMuYXBpS2V5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3NpZ25hdHVyZSc6IHNpZ25hdHVyZS50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKCFyZXNwb25zZSkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHJldHVybmVkICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgIH0gZWxzZSBpZiAocmVzcG9uc2UgPT0gdHJ1ZSkge1xuICAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgICAgICB9IGVsc2UgaWYgKCdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCdvaycgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydvayddID09ICdvaycpXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICB9IGVsc2UgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3InXSlcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgfVxufVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vIC0tLS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mV4cG9ydHMgPSBjbGFzcyBjb2luY2hlY2sgZXh0ZW5kcyBFeGNoYW5nZSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29pbmNoZWNrJyxcbiAgICAgICAgICAgICduYW1lJzogJ2NvaW5jaGVjaycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnSlAnLCAnSUQnIF0sXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDY0LTNiNWMzYzc0LTVlZDktMTFlNy04NDBlLTMxYjMyOTY4ZTFkYS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9jb2luY2hlY2suY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5jaGVjay5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9jb2luY2hlY2suY29tL2RvY3VtZW50cy9leGNoYW5nZS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcnMvcmF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9va3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JhdGUve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMvYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMvbGV2ZXJhZ2VfYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFua19hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9tb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL29wZW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcnMvdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcnMvdHJhbnNhY3Rpb25zX3BhZ2luYXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2xldmVyYWdlL3Bvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVuZGluZy9ib3Jyb3dzL21hdGNoZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRfbW9uZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfbW9uZXkve2lkfS9mYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYW5zZmVycy90b19sZXZlcmFnZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdHJhbnNmZXJzL2Zyb21fbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVuZGluZy9ib3Jyb3dzL3tpZH0vcmVwYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRfbW9uZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFua19hY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9KUFknOiB7ICdpZCc6ICdidGNfanB5JywgJ3N5bWJvbCc6ICdCVEMvSlBZJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0pQWScgfSwgLy8gdGhlIG9ubHkgcmVhbCBwYWlyXG4gICAgICAgICAgICAgICAgLy8gJ0VUSC9KUFknOiB7ICdpZCc6ICdldGhfanB5JywgJ3N5bWJvbCc6ICdFVEgvSlBZJywgJ2Jhc2UnOiAnRVRIJywgJ3F1b3RlJzogJ0pQWScgfSxcbiAgICAgICAgICAgICAgICAvLyAnRVRDL0pQWSc6IHsgJ2lkJzogJ2V0Y19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ZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydjcmVhdGVkX2F0J10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydvcmRlcl90eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsncmF0ZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuIC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MDAsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1VLJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MjQ2MDgxLTYyM2ZjMTY0LTZhMWMtMTFlNy05MTNmLWJhYzBkNTU3NmM5MC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93ZWJhcGkuY29pbmZsb29yLmNvLnVrOjgwOTAvYmlzdCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb2luZmxvb3IuY28udWsnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vY29pbmZsb29yL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5jb2luZmxvb3IuY28udWsvYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd1aWQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3RpY2tlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vb3JkZXJfYm9vay8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdHJhbnNhY3Rpb25zLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9iYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS91c2VyX3RyYW5zYWN0aW9ucy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vb3Blbl9vcmRlcnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2NhbmNlbF9vcmRlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vYnV5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9zZWxsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9idXlfbWFya2V0LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9zZWxsX21hcmtldC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vZXN0aW1hdGVfc2VsbF9tYXJrZXQvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2VzdGltYXRlX2J1eV9tYXJrZXQvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvR0JQJzogeyAnaWQnOiAnWEJUL0dCUCcsICdzeW1ib2wnOiAnQlRDL0dCUCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdHQlAnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdYQlQvRVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsg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0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldElkVHJhbnNhY3Rpb25zICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3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29pbmZsb29yLmNvLnVrOjgwOTAvYmlzdC9YQlQvR0JQL2JhbGFuY2UvXG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHsgJ25vbmNlJzogbm9uY2UgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy51aWQgKyAnLycgKyB0aGlzLmFwaUtleSArICc6JyArIHRoaXMucGFzc3dvcmQ7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAoYXV0aCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnQXV0aG9yaXphdGlvbic6ICdCYXNpYyAnICsgc2lnbmF0dXJlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV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tLzEyOTQ0NTQvMjg2MTk3MDctNWM5MjMyYTgtNzIxMi0xMWU3LTg2ZDYtOThmZTVkMTVjYzZlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbmdpLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwOi8vZG9jcy5jb2luZ2kuYXBpYXJ5LmlvLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnY3VycmVudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci1ib29rL3twYWlyfS97YXNrQ291bnR9L3tiaWRDb3VudH0ve2RlcHRofScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zL3twYWlyfS97bWF4Q291bnR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICcyNGhvdXItcm9sbGluZy1hZ2dyZWdhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndXNlcic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWRkLW9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwtb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGUtY3J5cHRvLXdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sX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gICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBsb3dlcmNhc2VDdXJyZW5jaWVzID0gW107XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxvd2VyY2FzZUN1cnJlbmNpZXMucHVzaCAoY3VycmVuY3kudG9Mb3dlckNhc2UgKCkpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMudXNlclBvc3RCYWxhbmNlICh7XG4gICAgICAgICAgICAnY3VycmVuY2llcyc6IGxvd2VyY2FzZUN1cnJlbmNpZXMuam9pbiAoJywnKVxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXVsnbmFtZSddO1xuICAgICAgICAgICAgY3VycmVuY3kgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnYXZhaWxhYmxlJ10sXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiBiYWxhbmNlWydibG9ja2VkJ10gKyBiYWxhbmNlWydpbk9yZGVycyddICsgYmFsYW5jZVsnd2l0aGRyYXdpbmcnXSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5jdXJyZW50R2V0T3JkZXJCb29rUGFpckFza0NvdW50QmlkQ291bnREZXB0aCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2Fza0NvdW50JzogNTEyLCAvLyBtYXhpbXVtIHJldHVybmVkIG51bWJlciBvZiBhc2tzIDEtNTEyXG4gICAgICAgICAgICAnYmlkQ291bnQnOiA1MTIsIC8vIG1heGltdW0gcmV0dXJuZWQgbnVtYmVyIG9mIGJpZHMgMS01MTJcbiAgICAgICAgICAgICdkZXB0aCc6IDMyLCAvLyBtYXhpbXVtIG51bWJlciBvZiBkZXB0aCByYW5nZSBzdGVwcyAxLTMyXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnYmFzZUFtb3VudCcpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnaGlnaCddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnbG93J10sXG4gICAgICAgICAgICAnYmlkJzogdGlja2VyWydoaWdoZXN0QmlkJ10sXG4gICAgICAgICAgICAnYXNrJzogdGlja2VyWydsb3dlc3RBc2snXSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFu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VGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMuZmV0Y2hUaWNrZXJzICh1bmRlZmluZWQsIHBhcmFtcyk7XG4gICAgICAgIGlmIChzeW1ib2wgaW4gdGlja2VycylcbiAgICAgICAgICAgIHJldHVybiB0aWNrZXJzW3N5bWJvbF07XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm4gZGlkIG5vdCBjb250YWluICcgKyBzeW1ib2wpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKCFtYXJrZXQpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbdHJhZGVbJ2N1cnJlbmN5UGFpciddXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0cmFkZVsndGltZXN0YW1wJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRyYWRlWyd0aW1lc3RhbXAnXSksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsIC8vIHR5cGVcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSdd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Y2hPcmRlckJvb2snOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODI0NDI0NC05YmU2MzEyYS02OWVkLTExZTctOTljMS03YzE3OTcyNzUyNjUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmNvaW5tYXJrZXRjYXAuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbm1hcmtldGNhcC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9jb2lubWFya2V0Y2FwLmNvbS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2xvYmFsLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY3VycmVuY3lDb2Rlcyc6IFtcbiAgICAgICAgICAgICAgICAnQVVEJyxcbiAgICAgICAgICAgICAgICAnQlJMJyxcbiAgICAgICAgICAgICAgICAnQ0FEJyxcbiAgICAgICAgICAgICAgICAnQ0hGJyxcbiAgICAgICAgICAgICAgICAnQ05ZJyxcbiAgICAgICAgICAgICAgICAnRVVSJyxcbiAgICAgICAgICAgICAgICAnR0JQJyxcbiAgICAgICAgICAgICAgICAnSEtEJyxcbiAgICAgICAgICAgICAgICAnSURSJyxcbiAgICAgICAgICAgICAgICAnSU5SJyxcbiAgICAgICAgICAgICAgICAnSlBZJyxcbiAgICAgICAgICAgICAgICAnS1JXJyxcbiAgICAgICAgICAgICAgICAnTVhOJyxcbiAgICAgICAgICAgICAgICAnUlVCJyxcbiAgICAgICAgICAgICAgICAnVVNEJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICgnRmV0Y2hpbmcgb3JkZXIgYm9va3MgaXMgbm90IHN1cHBvcnRlZCBieSB0aGUgQVBJIG9mICcgKyB0aGlzLmlkKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh7XG4gICAgICAgICAgICAnbGltaXQnOiAwLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSB0aGlzLmN1cnJlbmN5Q29kZXM7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoR2xvYmFsIChjdXJyZW5jeSA9ICdVU0QnKSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIG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Zsb2F0ICh0aWNrZXJbcHJpY2VdKTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdm9sdW1lS2V5ID0gJzI0aF92b2x1bWVfJyArIG1hcmtldFsncXVvdGVJZCddO1xuICAgICAgICAgICAgaWYgKHZvbHVtZUtleSBpbiB0aWNrZXIpXG4gICAgICAgICAgICAgICAgdm9sdW1lID0gcGFyc2VGbG9hdCAodGlja2VyW3ZvbHVtZUtleV0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiBjaGFuZ2UsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB2b2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY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GZvciBtdWx0aXBsZSB3aXRoZHJhd2FsL2RlcG9zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsIC8vIGRlZmF1bHQgcHJlY2lzaW9uLCB0b2RvOiBmaXggXCJtYWdpYyBjb25zdGFudHNcIlxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICA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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBjb2lubWF0ZSBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdjb2lubWF0ZScsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb2luTWF0ZScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnR0InLCAnQ1onIF0sIC8vIFVLLCBDemVjaCBSZXB1YmxpY1xuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3ODExMjI5LWMxZWZiNTEwLTYwNmMtMTFlNy05YTM2LTg0YmEyY2U0MTJkOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9jb2lubWF0ZS5pby9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2lubWF0ZS5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly9kb2NzLmNvaW5tYXRlLmFwaWFyeS5pbycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NvaW5tYXRlLmlvL2RldmVsb3BlcnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbkRlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eUluc3RhbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eUxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJXaXRoSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlVm91Y2hlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVkZWVtVm91Y2hlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbEluc3RhbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxMaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25IaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bmNvbmZpcm1lZEJpdGNvaW5EZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ0JUQ19FVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDQsICdwcmljZSc6IDIgfX0sXG4gICAgICAgICAgICAgICAgJ0JUQy9DWksnOiB7ICdpZCc6ICdCVENfQ1pLJywgJ3N5bWJvbCc6ICdCVEMvQ1pLJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NaSycsICdwcmVjaXNpb24nOiB7ICdhbW91bnQnOiA0LCAncHJpY2UnOiAyIH19LFxuICAgICAgICAgICAgICAgICdMVEMvQlRDJzogeyAnaWQnOiAnTFRDX0JUQycsICdzeW1ib2wnOiAnTFRDL0JUQycsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdCVEMnLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogNCwgJ3ByaWNlJzogNSB9fSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMzUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZXNbY3VycmVuY3ldWydhdmFpbGFibGUnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBiYWxhbmNlc1tjdXJyZW5jeV1bJ3Jlc2VydmVkJ107XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsnYmFsYW5jZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4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RoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB0aGlzLnVpZCArIHRoaXMuYXBpS2V5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnY2xpZW50SWQnOiB0aGlzLnVpZCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAncHVibGljS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3NpZ25hdHVyZSc6IHNpZ25hdHVyZS50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgf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AgICAgICdpZCc6ICdjb2luc2VjdXJlJyxcbiAgICAgICAgICAgICduYW1lJzogJ0NvaW5zZWN1cmUnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdJTicsIC8vIEluZGlhXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY0NzItOWNiZDIwMGEtNWVkOS0xMWU3LTk1NTEtMjI2N2FkN2JhYzA4LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5jb2luc2VjdXJlLmluJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbnNlY3VyZS5pbicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLmNvaW5zZWN1cmUuaW4nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2NvaW5zZWN1cmUvcGx1Z2lucycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW4vc2VhcmNoL2NvbmZpcm1hdGlvbi97dHhpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2Fzay9sb3cnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2Fzay9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2JpZC9oaWdoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9iaWQvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9sYXN0VHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL21heDI0SHInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL21pbjI0SHInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9hdXRoeS9jYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZmEvYXV0aHkvc21zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICduZXRraS9zZWFyY2gve25ldGtpTmFtZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYmFuay9vdHAve251bWJlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIva3ljL290cC97bnVtYmVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL3Bob25lL290cC97bnVtYmVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9hZGRyZXNzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vZGVwb3NpdC9jb25maXJtZWQvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvY29uZmlybWVkL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vZGVwb3NpdC91bmNvbmZpcm1lZC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vZGVwb3NpdC91bmNvbmZpcm1lZC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9iYWxhbmNlL2F2YWlsYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYmFsYW5jZS9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9iYWxhbmNlL3RvdGFsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvdmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9iYWxhbmNlL2F2YWlsYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYmFsYW5jZS9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9iYWxhbmNlL3RvdGFsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9kZXBvc2l0L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vZGVwb3NpdC91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9kZXBvc2l0L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvdmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9zdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2NvaW4vZmVlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2ZpYXQvZmVlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2t5Y3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvcmVmZXJyYWwvY29pbi9wYWlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFsL2NvaW4vc3VjY2Vzc2Z1bCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbC9maWF0L3BhaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvcmVmZXJyYWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3RyYWRlL3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbG9naW4vdG9rZW4ve3Rva2VufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9zdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9zdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvdmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2dpbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9naW4vaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvZ2luL3Bhc3N3b3JkL2ZvcmdvdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2F1dGh5L2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZmEvZ2EvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ251cCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9uZXRraS91cGRhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9pbWFnZS91cGRhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9uZXdWZXJpZnljb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvbmV3VmVyaWZ5Y29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wYXNzd29yZC9jaGFuZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcGFzc3dvcmQvcmVzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L25ld1ZlcmlmeWNvZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ251cC92ZXJpZnkve3Rva2VufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9reWMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9pbnN0YW50L2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9pbnN0YW50L3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3ZlcmlmeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYWNjb3VudC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3ZlcmlmeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9tZmEvYXV0aHkvaW5pdGlhdGUvZW5hYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9nYS9pbml0aWF0ZS9lbmFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbmV0a2kvY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvcGhvbmUvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2FkZHJlc3MvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93aXRoZHJhdy9zZW5kVG9FeGNoYW5nZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93aXRoZHJhdy92ZXJpZnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZ2NtL3tjb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dvdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQvY2FuY2VsL3t3aXRoZHJhd0lEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC9jYW5jZWwve2RlcG9zaXRJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL2NhbmNlbC97b3JkZXJJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL2NhbmNlbC97b3JkZXJJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3VudmVyaWZpZWQvY2FuY2VsL3t3aXRoZHJhd0lEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9tZmEvYXV0aHkvZGlzYWJsZS97Y29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2dhL2Rpc2FibGUve2NvZGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvcGhvbmUvZGVsZXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvaW1hZ2UvZGVsZXRlL3tuZXRraU5hbWV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQvY2FuY2VsL3t3aXRoZHJhd0lEfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0lOUic6IHsgJ2lkJzogJ0JUQy9JTlInLCAnc3ltYm9sJzogJ0JUQy9JTlInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnSU5SJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjQgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuNCAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyRXhjaGFuZ2VCYW5rU3VtbWFyeSAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVsnbWVzc2FnZSddO1xuICAgICAgICBsZXQgY29pbiA9IHtcbiAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnYXZhaWxhYmxlQ29pbkJhbGFuY2UnXSxcbiAgICAgICAgICAgICd1c2VkJzogYmFsYW5jZVsncGVuZGluZ0NvaW5CYWxhbmNlJ10sXG4gICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWyd0b3RhbENvaW5CYWxhbmNlJ10sXG4gICAgICAgIH07XG4gICAgICAgIGxldCBmaWF0ID0ge1xuICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVGaWF0QmFsYW5jZSddLFxuICAgICAgICAgICAgJ3VzZWQnOiBiYWxhbmNlWydwZW5kaW5nRmlhdEJhbGFuY2UnXSxcbiAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ3RvdGFsRmlhdEJhbGFuY2UnXSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogYmFsYW5jZSxcbiAgICAgICAgICAgICdCVEMnOiBjb2luLFxuICAgICAgICAgICAgJ0lOUic6I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dW1lID0gYmFzZVZvbHVtZSAqIHNhdG9zaGk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogcGFyc2VGbG9hdCAodGlja2VyWydvcGVuJ10pLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3RQcmljZSddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWydmaWF0dm9sdW1lJ10pLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZmV0Y2hUcmFkZXMgKHN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JvciwgQXV0aGVudGljYXRpb25FcnJvciB9ID0gcmVxdWlyZSAoJy4vYmFzZS9lcnJvcnMnKVxuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgY29pbnNwb3QgZXh0ZW5kcyBFeGNoYW5nZSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29pbnNwb3QnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQ29pblNwb3QnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdBVScsIC8vIEF1c3RyYWxpYVxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODIwODQyOS0zY2FjZGY5YS02ODk2LTExZTctODU0ZS00Yzc5YTc3MmEzMGYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vd3d3LmNvaW5zcG90LmNvbS5hdS9wdWJhcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUvYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY29pbnNwb3QuY29tLmF1JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmNvaW5zcG90LmNvbS5hdS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXRlc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2NvaW4vZGVwb3NpdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvY29pbi9zZW5kJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZS9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlL3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvYnV5L2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvc2VsbC9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9BVUQnOiB7ICdpZCc6ICdCVEMnLCAnc3ltYm9sJzogJ0JUQy9BVUQnLCAnYmFzZS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VibGljR2V0TGF0ZXN0IChwYXJhbXMpO1xuICAgICAgICBsZXQgaWQgPSB0aGlzLm1hcmtldElkIChzeW1ib2wpO1xuICAgICAgICBpZCA9IGlkLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3ByaWNlcyddW2lkXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZ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YWNlXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNEZXBvc2l0JzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjk0ODQzOTQtN2I0ZWE2ZTItODRjNi0xMWU3LTgzZTUtMWZjY2Y0YjJkYzgxLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5jcnlwdG9waWEuY28ubnovYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5ueicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9DYXRlZ29yeS80NScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5jcnlwdG9waWEuY28ubnovRm9ydW0vVGhyZWFkLzI1NScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5jcnlwdG9waWEuY28ubnovRm9ydW0vVGhyZWFkLzI1NicsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0Q3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzL3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0L3tpZH0ve2hvdXJzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0SGlzdG9yeS97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRIaXN0b3J5L3tpZH0ve2hvdXJzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldE9yZGVycy97aWR9L3tjb3VudH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldE9yZGVyR3JvdXBzL3tpZHN9L3tjb3VudH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbFRyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRCYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFRpcCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0VHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFRyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTdWJtaXRXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdDQycpXG4gICAgICAgICAgICByZXR1cm4gJ0NDWCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRkNOJylcbiAgICAgICAgICAgIHJldHVybiAnRmFjaWxlY29pbic7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnTkVUJylcbiAgICAgICAgICAgIHJldHVybiAnTmV0Q29pbic7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQlRHJylcbiAgICAgICAgICAgIHJldHVybiAnQml0Z2VtJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGN1cnJlbmN5SWQgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQ0NYJylcbiAgICAgICAgICAgIHJldHVybiAnQ0MnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0ZhY2lsZWNvaW4nKVxuICAgICAgICAgICAgcmV0dXJuICdGQ04nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ05ldENvaW4nKVxuICAgICAgICAgICAgcmV0dXJuICdORVQnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JpdGdlbScpXG4gICAgICAgICAgICByZXR1cm4gJ0JURyc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlUGFpcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnRGF0YSddO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydJZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnTGFiZWwnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluaW11bVRyYWRlJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnTWF4aW11bVRyYWRlJ11cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJpY2VMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluaW11bVByaWNlJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnTWF4aW11bVByaWNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50TGltaXRzLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlTGltaXRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ1N0YXR1cyddID09ICdPSyc7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1hcmtldFsnVHJhZGVGZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBtYXJrZXRbJ1RyYWRlRmVlJ10gLyAxMDAsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGFtb3VudExpbWl0c1snbWluJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3JkZXJzSWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWydEYXRhJ107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ0J1eScsICdT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HRyYWRlLCAnUHJpY2UnKTtcbiAgICAgICAgaWYgKCFwcmljZSlcbiAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnUmF0ZScpO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ1RvdGFsJyk7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdUcmFkZUlkJyk7XG4gICAgICAgIGlmICghbWFya2V0KSB7XG4gICAgICAgICAgICBpZiAoJ1RyYWRlUGFpcklkJyBpbiB0cmFkZSlcbiAgICAgICAgICAgICAgICBpZiAodHJhZGVbJ1RyYWRlUGFpcklkJ10gaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbdHJhZGVbJ1RyYWRlUGFpcklkJ11dO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoJ0ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB0cmFkZVsnRmVlJ10sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydUeXBlJ10udG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnQW1vdW50J10sXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldEhpc3RvcnlJZEhvdXJzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2hvdXJzJzogMjQsIC8vIGRlZmF1bHRcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0cmFkZXMgPSByZXNwb25zZVsnRGF0YSddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAodHJhZGVzLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTXlUcmFkZXMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZW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TtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydTeW1ib2wnXTtcbiAgICAgICAgICAgIC8vIHRvZG86IHdpbGwgbmVlZCB0byByZXRoaW5rIHRoZSBmZWVzXG4gICAgICAgICAgICAvLyB0byBhZGQgc3VwcG9ydCBmb3IgbXVsdGlwbGUgd2l0aGRyYXdhbC9kZXBvc2l0IG1ldGhvZHMgYW5kXG4gICAgICAgICAgICAvLyBkaWZmZXJlbnRpYXRlZCBmZWVzIGZvciBlYWNoIHBhcnRpY3VsYXIgbWV0aG9kXG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LCAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoY3VycmVuY3lbJ0xpc3RpbmdTdGF0dXMnXSA9PSAnQWN0aXZlJyk7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gY3VycmVuY3lbJ1N0YXR1cyddLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ05hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5WydXaXRoZHJhd0ZlZSddLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnTWluQmFzZVRyYWRlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ01pbldpdGhkcmF3J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogY3VycmVuY3lbJ01heFdpdGhkcmF3J10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRCYWxhbmNlICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnRGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGJhbGFuY2VbJ1N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGNvZGUpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydBdmFpbGFibGUnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydUb3RhbCddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtld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AgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdGaWxsZWRPcmRlcnMnIGluIHJlc3BvbnNlWydEYXRhJ10pIHtcbiAgICAgICAgICAgICAgICBsZXQgZmlsbGVkT3JkZXJzID0gcmVzcG9uc2VbJ0RhdGEnXVsnRmlsbGVkT3JkZXJzJ107XG4gICAgICAgICAgICAgICAgbGV0IGZpbGxlZE9yZGVyc0xlbmd0aCA9IGZpbGxlZE9yZGVycy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgaWYgKGZpbGxlZE9yZGVyc0xlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBmaWxsZWQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgLy8gJ3RyYWRlcyc6IHRoaX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ICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnIGNhbmNlbE9yZGVyKCkgZXJyb3I6ICcgKyB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2UgaWYgKCdNYXJrZXQnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBvcmRlclsnTWFya2V0J107XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAob3JkZXJbJ1RpbWVTdGFtcCddKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ0Ftb3VudCcpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUmVtYWluaW5nJyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQn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PcmRlcklkcyA9IE9iamVjdC5rZXlzICh0aGlzLm9yZGVycyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBjYWNoZWRPcmRlcklkcy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY2FjaGVkT3JkZXJJZHNba107XG4gICAgICAgICAgICBpZiAoaWQgaW4gb3Blbk9yZGVyc0luZGV4ZWRCeUlkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gdGhpcy5leHRlbmQgKHRoaXMub3JkZXJzW2lkXSwgb3Blbk9yZGVyc0luZGV4ZWRCeUlkW2lkXSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBvcmRlciA9IHRoaXMub3JkZXJzW2lkXTtcbiAgICAgICAgICAgICAgICBpZiAob3JkZXJbJ3N0YXR1cyddID09ICdvcGVuJykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSB0aGlzLmV4dGVuZCAob3JkZXIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnY2xvc2VkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0Jzogb3JkZXJbJ2Ftb3VudCddICogb3JkZXJbJ3ByaWNlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlsbGVkJzogb3JkZXJbJ2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbWFpbmluZyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgaWYgKG9yZGVyWydzeW1ib2wnXSA9PSBzeW1ib2wpXG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2gg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Y0Jyk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9ICdhbXggJyArIHRoaXMuYXBpS2V5ICsgJzonICsgdGhpcy5iaW5hcnlUb1N0cmluZyAoc2lnbmF0dXJlKSArICc6JyArIG5vbmNlO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogYXV0aCxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAoJ1N1Y2Nlc3MnIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnU3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCdFcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydFcnJvciddID09ICdJbnN1ZmZpY2llbnQgRnVuZHMuJylcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZ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ICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTkwMjc1LTE0MTMxNThhLTY0NWEtMTFlNy05MzFjLTk0NzE3Zjc1MTBlMy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9kc3gudWsvbWFwaScsIC8vIG1hcmtldCBkYXRhXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vZHN4LnVrL3RhcGknLCAvLyB0cmFkaW5nXG4gICAgICAgICAgICAgICAgICAgICdkd2FwaSc6ICdodHRwczovL2RzeC51ay9kd2FwaScsIC8vIGRlcG9zaXQvd2l0aGRyYXdcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9kc3gudWsnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5kc3gudWsnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kc3gudWsvYXBpX2RvY3MvcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZHN4LnVrL2FwaV9kb2NzL3ByaXZhdGUnLFxuICAgICAgICAgICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgLy8gbWFya2V0IGRhdGEgKHB1YmxpYylcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhcnNGcm9tTW9tZW50L3tpZH0ve3BlcmlvZH0ve3N0YXJ0fScsIC8vIGVtcHR5IHJlcGx5IDpcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdEJhcnMve2lkfS97cGVyaW9kfS97YW1vdW50fScsIC8vIHBlcmlvZCBpcyAobSwgaCBvciBkKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BlcmlvZEJhcnMve2lkfS97cGVyaW9kfS97c3RhcnR9L3tlbmR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIC8vIHRyYWRpbmcgKHByaXZhdGUpXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYW5zSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIC8vIGRlcG9zaXQgLyB3aXRoZHJhdyAocHJpdmF0ZSlcbiAgICAgICAgICAgICAgICAnZHdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENyeXB0b0RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG9XaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdFdpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvblN0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgZ2V0QmFzZVF1b3RlRnJvbU1hcmtldElkIChpZCkge1xuICAgICAgICBsZXQgdXBwZXJjYXNlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgIGxldCBiYXNlID0gdXBwZXJjYXNlLnNsaWNlICgwLCAzKTtcbiAgICAgICAgbGV0IHF1b3RlID0gdXBwZXJjYXNlLnNsaWNlICgzLCA2KTtcbiAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICByZXR1cm4gWyBiYXNlLCBxdW90ZSBdO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZX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4bW8nLFxuICAgICAgICAgICAgJ25hbWUnOiAnRVhNTycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnRVMnLCAnUlUnIF0sIC8vIFNwYWluLCBSdXNzaWFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLCAvLyBvbmNlIGV2ZXJ5IDM1MCBtcyDiiYggMTgwIHJlcXVlc3RzIHBlciBtaW51dGUg4omIIDMgcmVxdWVzdHMgcGVyIHNlY29uZFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY0OTEtMWIwZWE5NTYtNWVkYS0xMWU3LTkyMjUtNDBkNjdiNDgxYjhkLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5leG1vLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2V4bW8ubWUnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2V4bW8ubWUvZW4vYXBpX2RvYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vZXhtby1kZXYvZXhtb19hcGlfbGliL3RyZWUvbWFzdGVyL25vZGVqcycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJfc2V0dGluZ3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl9jYW5jZWxsZWRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcXVpcmVkX2Ftb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19jcnlwdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfZ2V0X3R4aWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y29kZV9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y29kZV9sb2FkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQYWlyU2V0dGluZ3MgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1twXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZC5yZXBsYWNlICgnXycsICcvJyk7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluX3F1YW50aXR5J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfcXVhbnRpdHknXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluX3ByaWNlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfcHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5fYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RVc2VySW5mbyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCB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kZXJib29rID0gcmVzcG9uc2VbbWFya2V0WydpZCddXTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkJywgJ2FzaycpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd1cGRhdGVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydidXlfcHJpY2UnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsX3ByaWNlJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0X3RyYWRlJ10pLFxuICAgICAgICAgICAgJ2NoYW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gbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHsgJ25vbmNlJzogbm9uY2UgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0I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cbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQlInLCAvLyBCcmF6aWxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODE2MjQ2NS1jZDgxNWQ0Yy02N2NmLTExZTctOGU1Ny00MzhiZWEwNTIzYTIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmZsb3didGMuY29tOjg0MDAvYWpheCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RyYWRlci5mbG93YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwOi8vd3d3LmZsb3didGMuY29tLmJyL2FwaS8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd1aWQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlc0J5RGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJCb29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRQcm9kdWN0UGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFByb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVBY2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRVc2VySW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2V0VXNlckluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0QWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ3JlYXRlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01vZGlmeU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsQWxsT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50T3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJGZWUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY1Bvc3RHZXRQcm9kdWN0UGFpcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3Byb2R1Y3RQYWlycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydwcm9kdWN0MUxhYmVsJ107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3Byb2R1Y3QyTGFiZWwnXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2N1cnJlbmNpZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID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iAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lMjRociddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lMjRoclByb2R1Y3QyJ10pLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ3VuaXh0aW1lJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsnaW5jb21pbmdPcmRlclNpZGUnXSA9PSAwKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3B4J10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ3F0eSddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2ws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V0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnc2VydmVyT3JkZXJJZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBpZiAoJ2lucycgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdzZXJ2ZXJPcmRlcklkJzogaWQsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgYGluc2Agc3ltYm9sIHBhcmFtZXRlciBmb3IgY2FuY2VsbGluZyBhbiBvcmRlcicpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2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2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MTQxMy0xMWI0MGQ0Mi02NDdmLTExZTctOTFlZS03OGNlZDg3NGRkMDkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2ZveGJpdC5leGNoYW5nZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JsaW5rdHJhZGUuY29tL2RvY3MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tZW50JzogJ0JsaW5rdHJhZGUgQVBJJyxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3l9L3RpY2tlcicsICAgIC8vID9jcnlwdG9fY3VycmVuY3k9QlRDXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5fS9vcmRlcmJvb2snLCAvLyA/Y3J5cHRvX2N1cnJlbmN5PUJUQ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeX0vdHJhZGVzJywgICAgLy8gP2NyeXB0b19jdXJyZW5jeT1CVEMmc2luY2U9PFRJTUVTVEFNUD4mbGltaXQ9PE5VTUJFUj5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdEJywgICAvLyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0YnLCAgIC8vIGNhbmNlbCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1UyJywgIC8vIGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNCcsICAvLyBteSBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNicsICAvLyB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UxOCcsIC8vIGRlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMjQnLCAvLyBjb25maXJtIHdpdGhkcmF3YWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMjYnLCAvLyBsaXN0IHdpdGhkcmF3YWxzXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTMwJywgLy8gbGlzdCBkZXBvc2l0c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UzNCcsIC8vIGxlZGdlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1U3MCcsIC8vIGNhbmNlbCB3aXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1ZFRic6IHsgJ2lkJzogJ0JUQ1ZFRicsICdzeW1ib2wnOiAnQlRDL1ZFRicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdWRUYnLCAnYnJva2VySWQnOiAxLCAnYnJva2VyJzogJ1N1ckJpdGNvaW4nIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9WTkQnOiB7ICdpZCc6ICdCVENWTkQnLCAnc3ltYm9sJzogJ0JUQy9WTkQnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVk5EJywgJ2Jyb2tlcklkJzogM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4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdDbE9yZElEJzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgICdTeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnU2lkZSc6IG9yZGVyU2lkZSxcbiAgICAgICAgICAgICdPcmRUeXBlJzogJzInLFxuICAgICAgICAgICAgJ1ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnT3JkZXJRdHknOiBhbW91bnQsXG4gICAgICAgICAgICAnQnJva2VySUQnOiBtYXJrZXRbJ2Jyb2tlcklkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3REICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICBsZXQgaW5kZXhlZCA9IHRoaXMuaW5kZXhCeSAocmVzcG9uc2VbJ1Jlc3BvbnNlcyddLCAnTXNnVHlwZScpO1xuICAgICAgICBsZXQgZXhlY3V0aW9uID0gaW5kZXhlZFsnOCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGV4ZWN1dGlvblsnT3JkZXJJRCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEYgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnQ2xPcmRJRCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAoeyAnTXNnVHlwZSc6IHBhdGggfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBUElLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnU2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAobm9uY2UpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG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uICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2Z5YnNlJyxcbiAgICAgICAgICAgICduYW1lJzogJ0ZZQi1TRScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1NFJywgLy8gU3dlZGVuXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTEyLTMxMDE5NzcyLTVlZGItMTFlNy04MjQxLTJlNjc1ZTY3OTdmMS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuZnlic2Uuc2UvYXBpL1NFSycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5meWJzZS5zZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwOi8vZG9jcy5meWIuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJkZXRhaWxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGFjY2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBlbmRpbmdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VscGVuZGluZ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZW9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1NFSyc6IHsgJ2lkJzogJ1NFSycsICdzeW1ib2wnOiAnQlRDL1NFSycsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdTRUsnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldGFjY2luZm8gKCk7XG4gICAgICAgIGxldCBidGMgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydidGNCYWwnXSk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB0aGlzLnN5bWJvbHNbMF07XG4gICAgICAgIGxldCBxdW90ZSA9IHRoaXMubWFya2V0c1tzeW1ib2xdWydxdW90ZSddO1xuICAgICAgICBsZXQgbG93ZXJjYXNlID0gcXVvdGUudG9Mb3dlckNhc2UgKCkgKyAnQmFsJztcbiAgICAgICAgbGV0IGZpYXQgPSBwYXJzZUZsb2F0IChiYWxhbmNlW2xvd2VyY2FzZV0pO1xuICAgICAgICBsZXQgY3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ndm9sJyBpbiB0aWNrZXIpXG4gICAgICAgICAgICB2b2x1bWUgPSBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbCddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB2b2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICA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hpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdxdHknOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZVswXS50b1VwcGVyQ2FzZSAoKVxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncGVuZGluZ19vaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxwZW5kaW5nb3JkZXIgKHsgJ29yZGVyTm8nOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcuanNvbic7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7ICd0aW1lc3RhbXAnOiBub25jZSB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0Nvb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AgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcyNGgnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjg2NDY4MTctNTA4NDU3ZjItNzI2Yy0xMWU3LTllZWItMzUyOGQyNDEzYTU4LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5nYXRlY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nYXRlY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dhdGVjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0dhdGVjb2luL1JFU1RmdWwtQVBJLUltcGxlbWVudGF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLmdhdGVjb2luLmNvbS9zd2FnZ2VyLXVpL2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9FeGNoYW5nZVJhdGUnLCAvLyBHZXQgdGhlIGV4Y2hhbmdlIHJhdGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnUHVibGljL0xpdmVUaWNrZXInLCAvLyBHZXQgbGl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ICAgICAgICAgICdTdHJlYW0vUHVibGljQ2hhbm5lbCcsIC8vIEdldCB0aGUgcHVibGljIHB1Ym51YiBjaGFubmVsIGxpc3RcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhwb3J0L1RyYW5zYWN0aW9ucycsIC8vIFJlcXVlc3QgYSBleHBvcnQgb2YgYWxsIHRyYWRlcyBmcm9tIGJhc2VkIG9uIGN1cnJlbmN5cGFpciwgc3RhcnQgZGF0ZSBhbmQgZW5kIGRhdGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdQaW5nJywgLy8gUG9zdCBhIHN0cmluZywgdGhlbiBnZXQgaXQgYmFjay5cbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvVW5zdWJzY3JpYmUve0VtYWlsQ29kZX0nLCAvLyBMZXRzIHRoZSB1c2VyIHVuc3Vic2NyaWJlIGZyb20gZW1haWxzXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVnaXN0ZXJVc2VyJywgLy8gSW5pdGlhbCB0cmFkZXIgcmVnaXN0cmF0aW9uLlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Db3Jwb3JhdGVEYXRhJywgLy8gR2V0IGNvcnBvcmF0ZSBhY2NvdW50IGRhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50QWRkcmVzcycsIC8vIENoZWNrIGlmIHJlc2lkZW5jZSBwcm9vZiB1cGxvYWRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRDb3Jwb3JhdGlvbicsIC8vIENoZWNrIGlmIHJlZ2lzdGVyZWQgZG9jdW1lbnQgdXBsb2FkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SUQnLCAvLyBDaGVjayBpZiBJRCBkb2N1bWVudCBjb3B5IHVwbG9hZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEluZm9ybWF0aW9uJywgLy8gR2V0IFN0ZXAzIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsJywgLy8gR2V0IHVzZXIgZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0ZlZVJhdGUnLCAvLyBHZXQgZmVlIHJhdGUgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0xldmVsJywgLy8gR2V0IHZlcmlmIGxldmVsIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9QZXJzb25hbEluZm9ybWF0aW9uJywgLy8gR2V0IFN0ZXAxIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Bob25lJywgLy8gR2V0IHVzZXIgcGhvbmUgbnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Qcm9maWxlJywgLy8gR2V0IHRyYWRlciBwcm9maWxlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9RdWVzdGlvbm5haXJlJywgLy8gRmlsbCB0aGUgcXVlc3Rpb25uYWlyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWwnLCAvLyBHZXQgcmVmZXJyYWwgaW5mb3JtYXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsQ29kZScsIC8vIEdldCB0aGUgcmVmZXJyYWwgY29kZSBvZiB0aGUgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICA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AgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEFkZHJlc3MnLCAvLyBVcGxvYWQgYWRkcmVzcyBwcm9vZiBkb2N1bWVudFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRDb3Jwb3JhdGlvbicsIC8vIFVwbG9hZCByZWdpc3RlcmVkIGRvY3VtZW50IGRvY3VtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudElEJywgLy8gVXBsb2FkIElEIGRvY3VtZW50IGNvcHlcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsL1JlcXVlc3RWZXJpZnknLCAvLyBSZXF1ZXN0IGZvciB2ZXJpZmljYXRpb24gZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsL1ZlcmlmeScsIC8vIFZlcmlmaWNhdGlvbiBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvR29vZ2xlQXV0aCcsIC8vIEVuYWJsZSBnb29nbGUgYXV0aFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvTGV2ZWwnLCAvLyBSZXF1ZXN0IHZlcmlmIGxldmVsIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9RdWVzdGlvbm5haXJlJywgLy8gRmlsbCB0aGUgcXVlc3Rpb25uYWlyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWwnLCAvLyBQb3N0IGEgcmVmZXJyYWwgZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUElLZXkvQVBJS2V5JywgLy8gQ3JlYXRlIGEgbmV3IEFQSSBrZXkgZm9yIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9DaGFuZ2VQYXNzd29yZCcsIC8vIENoYW5nZSBwYXNzd29yZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0ZvcmdvdFBhc3N3b3JkJywgLy8gUmVxdWVzdCByZXNldCBwYXNzd29yZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvRm9yZ290VXNlcklEJywgLy8gUmVxdWVzdCB1c2VyIGlkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Mb2dpbicsIC8vIFRyYWRlciBzZXNzaW9uIGxvZyBpbi5cbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0xvZ291dCcsIC8vIExvZ291dCBmcm9tIHRoZSBjdXJyZW50IHNlc3Npb24uXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Mb2dvdXRPdGhlclNlc3Npb25zJywgLy8gTG9nb3V0IG90aGVyIHNlc3Npb25zLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvUmVzZXRQYXNzd29yZCcsIC8vIFJlc2V0IHBhc3N3b3JkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFuay9UcmFuc2FjdGlvbnMnLCAvLyBSZXF1ZXN0IGEgdHJhbnNmZXIgZnJvbSB0aGUgdHJhZGVycyBhY2NvdW50IG9mIHRoZSBsb2dnZWQgaW4gdXNlci4gVGhpcyBpcyBvbmx5IGF2YWlsYWJsZSBmb3IgYmFuayBhY2NvdW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFuay9Vc2VyQWNjb3VudHMnLCAvLyBBZGQgYW4gYWNjb3VudCB0aGUgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdFbGVjdHJvbmljV2FsbGV0L0RlcG9zaXRXYWxsZXRzL3tEaWdpQ3VycmVuY3l9JywgLy8gQWRkIGFuIGRpZ2l0YWwgY3VycmVuY3kgYWRkcmVzc2VzIHRvIHRoZSBsb2dnZ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YWRlL09yZGVycycsIC8vIFBsYWNlIGFuIG9yZGVyIGF0IHRoZSBleGNoYW5nZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZS9TdG9wT3JkZXJzJywgLy8gUGxhY2UgYSBzdG9wIG9yZGVyIGF0IHRoZSBleGNoYW5nZS5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0NvcnBvcmF0ZURhdGEnLCAvLyBVcGRhdGUgdXNlciBjb21wYW55IGRhdGEgZm9yIGNvcnBvcmF0ZSBhY2NvdW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudElEJywgLy8gVXBkYXRlIElEIGRvY3VtZW50IG1ldGEgZGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJbmZvcm1hdGlvbicsIC8vIFVwZGF0ZSBTdGVwMyBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9FbWFpbCcsIC8vIFVwZGF0ZSB1c2VyIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9QZXJzb25hbEluZm9ybWF0aW9uJywgLy8gVXBkYXRlIFN0ZXAxIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Bob25lJywgLy8gVXBkYXRlIHVzZXIgcGhvbmUgbnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9RdWVzdGlvbm5haXJlJywgLy8gdXBkYXRlIHRoZSBxdWVzdGlvbm5haXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJlZENvZGUnLCAvLyBVcGRhdGUgcmVmZXJyYWwgY29kZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVzaWRlbnRJbmZvcm1hdGlvbicsIC8vIFVwZGF0ZSBTdGVwMiBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9TZWN1cml0eVNldHRpbmdzJywgLy8gVXBkYXRlIHZlcmlmIGRldGFpbHMgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1VzZXInLCAvLyBVcGRhdGUgYWxsIHVzZXIgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JhbmsvVXNlckFjY291bnRzJywgLy8gVXBkYXRlIHRoZSBsYWJlbCBvZiBleGlzdGluZyB1c2VyIGJhbmsgYWNjb3VubnRcbiAgICAgICAgICAgICAgICAgICAgICAgICdFbGVjdHJvbmljV2FsbGV0L0RlcG9zaXRXYWxsZXRzL3tEaWdpQ3VycmVuY3l9L3tBZGRyZXNzTmFtZX0nLCAvLyBVcGRhdGUgdGhlIG5hbWUgb2YgYW4gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0VsZWN0cm9uaWNXYWxsZXQvVXNlcldhbGxldHMve0RpZ2lDdXJyZW5jeX0nLCAvLyBVcGRhdGUgdGhlIG5hbWUgb2YgYW4gZXh0ZXJuYWwgYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0luZm8vUmVmZXJlbmNlQ3VycmVuY3knLCAvLyBVc2VyJ3MgcmVmZXJlbmNlIGN1cnJlbmN5XG4gICAgICAgICAgICAgICAgICAgICAgICAnSW5mby9SZWZlcmVuY2VMYW5ndWFnZScsIC8vIFVwZGF0ZSB1c2VyJ3MgcmVmZXJlbmNlIGxhbmd1YWdlXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVBJS2V5L0FQSUtleS97UHVibGljS2V5fScsIC8vIFJlbW92ZSBhbiBBUEkga2V5XG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFuay9UcmFuc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xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDM1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFB1YmxpY0xpdmVUaWNrZXJzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWyd0aWNrZXJzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnY3VycmVuY3lQYWlyJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2VCYWxhbmNlcyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2VzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2F2YWlsYWJsZUJhbGFuY2UnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHRoaXMuc3VtIChcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVsncGVuZGluZ0luY29taW5nJ10sXG4gICAgICAgICAgICAgICAgICAgIGJhbGFuY2VbJ3BlbmRpbmdPdXRnb2luZyddLFxuICAgICAgICAgICAgICAgICAgICBiYWxhbmNlWydvcGVuT3JkZXInXSksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZVsnYmFsYW5jZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcb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ogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHBhcnNlRmxvYXQgKHRpY2tlclsnb3BlbiddKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJsaWNMaXZlVGlja2VycyAocGFyYW1zKT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ICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgb3JkZXIgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnd2F5JyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgc2lkZSA9ICh0cmFkZVsnd2F5J10gPT0gJ2JpZCcpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgICAgICBsZXQgb3JkZXJJZCA9IHRyYWRlWyd3YXknXSArICdPcmRlcklkJztcbiAgICAgICAgICAgIG9yZGVyID0gdHJhZGVbb3JkZXJJZF07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsndHJhbnNhY3Rpb25UaW1lJ10pICogMTAwMDtcbiAgICAgICAgaWYgKCFtYXJrZXQpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbdHJhZGVbJ2N1cnJlbmN5UGFpciddXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndHJhbnNhY3Rpb25JZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXIsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydxdWFudGl0eSddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1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MudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IGNvbnRlbnRUeXBlID0gKG1ldGhvZCA9PSAnR0VUJykgPyAnJyA6ICdhcHBsaWNhdGlvbi9qc29uJztcbiAgICAgICAgICAgIGxldCBhdXRoID0gbWV0aG9kICsgdXJsICsgY29udGVudFR5cGUgKyBub25jZS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGF1dGggPSBhdXRoLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2JywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQVBJX1BVQkxJQ19LRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQVBJX1JFUVVFU1RfU0lHTkFUVVJFJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgICAgICdBUElfUkVRVUVTVF9EQVRFJzogbm9uY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICA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ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6IDYwLFxuICAgICAgICAgICAgICAgICc1bSc6IDMwMCxcbiAgICAgICAgICAgICAgICAnMTVtJzogOTAwLFxuICAgICAgICAgICAgICAgICczMG0nOiAxODAwLFxuICAgICAgICAgICAgICAgICcxaCc6IDM2MDAsXG4gICAgICAgICAgICAgICAgJzJoJzogNzIwMCxcbiAgICAgICAgICAgICAgICAnNGgnOiAxNDQwMCxcbiAgICAgICAgICAgICAgICAnMTJoJzogNDMyMDAsXG4gICAgICAgICAgICAgICAgJzFkJzogODY0MDAsXG4gICAgICAgICAgICAgICAgJzF3JzogNjA0ODAwLFxuICAgICAgICAgICAgICAgICcxTSc6IDI1OTIwMDAsXG4gICAgICAgICAgICAgICAgJzF5JzogMzE1MzYwMDAsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ3Rlc3QnOiAnaHR0cHM6Ly9hcGktcHVibGljLnNhbmRib3guZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1MjctYjFiZTQxYzYtNWVkYi0xMWU3LTk1ZjYtNWI0OTZjNDY5ZTJjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5nZGF4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5nZGF4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2RvY3MuZ2RheC5jb20nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vY2FuZGxlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9zdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2hvbGRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2xlZGdlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29pbmJhc2UtYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50LW1ldGhvZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBvcnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJzL3NlbGYvdHJhaWxpbmctdm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvY29pbmJhc2UtYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvcGF5bWVudC1tZXRob2QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcvcmVwYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2ZpbGVzL21hcmdpbi10cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwb3J0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvY29pbmJhc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL2NyeXB0bycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvcGF5bWVudC1tZXRob2QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnYmFzZV9taW5fc2l6ZSddLFxuICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ2Jhc2VfbWF4X3NpemUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJpY2VMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsncXVvdGVfaW5jcmVtZW50J10sXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgY29zdExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogcHJpY2VMaW1pdHNbJ21pbiddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50TGltaXRzLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlTGltaXRzLFxuICAgICAgICAgICAgICAgICdjb3N0JzogY29zdExpbWl0cyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiAtTWF0aC5sb2cxMCAocGFyc2VGbG9hdCAoYW1vdW50TGltaXRzWydtaW4nXSkpLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IC1NYXRoLmxvZzEwIChwYXJzZUZsb2F0IChwcmljZUxpbWl0c1snbWluJ10pKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSB0aGlzLmZlZXNbJ3RyYWRpbmcnXVsndGFrZXInXTtcbiAgICAgICAgICAgIGlmICgoYmFzZSA9PSAnRVRIJykgfHwgKGJhc2UgPT0gJ0xUQycpKSB7XG4gICAgICAgICAgICAgICAgdGFrZXIgPSAwLjAwMztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydob2xkJ10pLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2JhbGFuY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IG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CAodGlja2VyWyd2b2x1bWUnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ3RpbWUnXSk7XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWydzaWRlJ10gPT0gJ2J1eScpID8gJ3NlbGwnIDogJ2J1eSc7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2ZpbGxfZmVlcycgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHBhcnNlRmxvYXQgKHRyYWRlWydmaWxsX2ZlZXMnXSksXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICA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LCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICAvLyBsZXQgb2lkID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3Byb2R1Y3RfaWQnOiB0aGlzLm1hcmtldElkIChtYXJrZXQpLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3NpemUnOiBhbW91bnQsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJzICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlRGVsZXRlT3JkZXJzSWQgKHsgJ2lkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZ2V0UGF5bWVudE1ldGhvZHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRQYXltZW50TWV0aG9kcyAoKTtcbiAgICAgICAgcmV0dXJ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XBvc2l0KCkgcmVxdWlyZXMgb25lIG9mIGBjb2luYmFzZV9hY2NvdW50X2lkYCBvciBgcGF5bWVudF9tZXRob2RfaWRgIGV4dHJhIHBhcmFtcycpO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBpZiAoIXJlc3BvbnNlKVxuICAgICAgICAgICAgdGhyb3cgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZGVwb3NpdCgpIGVycm9yOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIHdpdGhkcmF3IChjdXJyZW5jeSwgYW1vdW50LCBhZGRyZXNzLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlUG9zdFdpdGhkcmF3YWxzJztcbiAgICAgICAgaWYgKCdwYXltZW50X21ldGhvZF9pZCcgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ1BheW1lbnRNZXRob2QnO1xuICAgICAgICB9IGVsc2UgaWYgKCdjb2luYmFzZV9hY2NvdW50X2lkJyBpbiBwYXJhbXMpIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnQ29pbmJhc2VBY2NvdW50JztcbiAgICAgICAgfSBlbHNlIHtcbiAg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Jykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSAnJztcbiAgICAgICAgICAgIGlmIChtZXRob2QgIT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICBwYXlsb2FkID0gYm9keTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBsZXQgcGF5bG9hZCA9IChib2R5KSA/IGJvZHkgOiAnJztcbiAgICAgICAgICAgIGxldCB3aGF0ID0gbm9uY2UgKyBtZXRob2QgKyByZXF1ZXN0ICsgcGF5bG9hZDtcbiAgICAgICAgICAgIGxldCBzZWNyZXQgPSB0aGlzLmJhc2U2NFRvQmluYXJ5ICh0aGlzLnNlY3JldCk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAod2hhdCksIHNlY3JldCwgJ3NoYTI1NicsICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NCLUFDQ0VTUy1LRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQ0ItQUNDRVNTLVNJR04nOiB0aGlzLmRlY29kZSAoc2lnbmF0dXJlKSxcbiAgICAgICAgICAgICAgICAnQ0ItQUNDRVNTLVRJTUVTVEFNUCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdDQi1BQ0NFU1MtUEFTU1BIUkFTRSc6IHRoaXMucGFzc3dvcmQsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gcmVzcG9uc2VbJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgncHJpY2UgdG9vIHNtYWxsJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlLmluZGV4T2YgKCdwcmljZSB0b28gcHJlY2lzZScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PSAnSW52YWxpZCBBUEkgS2V5Jykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGF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IGNsYXNzIGdlbWluaSBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdnZW1pbmknLFxuICAgICAgICAgICAgJ25hbWUnOiAnR2VtaW5pJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVVMnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsIC8vIDIwMCBmb3IgcHJpdmF0ZSBBUElcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3ODE2ODU3LWNlN2JlNjQ0LTYwOTYtMTFlNy04MmQ2LTNjMjU3MjYzMjI5Yy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZ2VtaW5pLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2dlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmdlbWluaS5jb20vcmVzdC1hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfS9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL3Nlc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGV2b2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0L3tjdXJyZW5jeX0vbmV3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGVhcnRiZWF0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IGlkO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IG1hcmtldC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdXBwZXJjYXNlLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVwcGVyY2FzZS5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjVcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Qm9va1N5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbi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XQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnQnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2NsaWVudF9vcmRlcl9pZCc6IG5vbmNlLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAndHlwZSc6ICdleGNoYW5nZSBsaW1pdCcsIC8vIGdlbWluaSBhbGxv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UmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3JlcXVlc3QnOiB1cmwsXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBwYXlsb2FkID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAodGhpcy5lbmNvZGUgKHBheWxvYWQpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHBheWxvYWQsIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEzODQnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICd0ZXh0L3BsYWluJyxcbiAgICAgICAgICAgICAgICAnWC1HRU1JTkktQVBJS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1gtR0VNSU5JLVBBWUxPQUQnOiBwYXlsb2FkLFxuICAgICAgICAgICAgICAgICdYLUdFTUlOSS1TSUdOQVRVUkUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSw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nLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdISycsIC8vIEhvbmcgS29uZ1xuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICcxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTU1LThlYWVjMjBlLTVlZGMtMTFlNy05YzViLTZkYzY5ZmM0MmY1ZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cDovL2FwaS5oaXRidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vaGl0YnRjLWNvbS9oaXRidGMtYXBpL2Jsb2IvbWFzdGVyL0FQSXYxLm1kJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7c3ltYm9sfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vdHJhZGVzL3JlY2VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lLCdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9hY3RpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9yZWNlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvYnkvb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwYXltZW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Mve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3RyYW5zYWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyX3RvX3RyYWRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyX3RvX21haW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Mve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5b3V0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hCVCcpXG4gICAgICAgICAgICByZXR1cm4gJ0JUQyc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRFJLJylcbiAgICAgICAgICAgIHJldHVybiAnREFTSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQ0FUJylcbiAgICAgICAgICAgIHJldHVybiAnQml0Q2xhdmUnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydzeW1ib2xzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydzeW1ib2xzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2NvbW1vZGl0eSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGxvdCA9IHBhcnNlRmxvYXQgKG1hcmtldFsnbG90J10pO1xuICAgICAgICAgICAgbGV0IHN0ZXAgPSBwYXJzZUZsb2F0IChtYXJrZXRbJ3N0ZXAnXSk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnc3RlcCc6IHN0ZXAsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICd0cmFkaW5nJyk7XG4gICAgICAgIG1ldGhvZCArPSAnR2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0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhdmdQcmljZScsIDAuMCk7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ29yZGVyUHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ29yZGVyUXVhbnRpdHknKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3F1YW50aXR5TGVhdmVzJyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgYW1vdW50ICo9IG1hcmtldFsnbG90J107XG4gICAgICAgICAgICByZW1haW5pbmcgKj0gbWFya2V0Wydsb3QnXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYW1vdW50ICYmIHJlbWFpbmluZykge1xuICAgICAgICAgICAgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICAgICAgY29zdCA9IGF2ZXJhZ2VQcmljZSAqIGZpbGxlZDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2NsaWVudE9yZGVySWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyW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CBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0geyAnbm9uY2UnOiBub25jZSwgJ2FwaWtleSc6IHRoaXMuYXBpS2V5IH07XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kIChwYXlsb2FkLCBxdWVyeSk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGF5bG9hZCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHVybDtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgIC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FRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJ00xJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnTTMnLFxuICAgICAgICAgICAgICAgICc1bSc6ICdNNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICdNMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnTTMwJywgLy8gZGVmYXVsdFxuICAgICAgICAgICAgICAgICcxaCc6ICdIMScsXG4gICAgICAgICAgICAgICAgJzRoJzogJ0g0JyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnRDEnLFxuICAgICAgICAgICAgICAgICcxdyc6ICdENycsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTU1LThlYWVjMjBlLTVlZGMtMTFlNy05YzViLTZkYzY5ZmM0MmY1ZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2hpdGJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hcGkuaGl0YnRjLmNvbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsIC8vIEF2YWlsYWJsZSBDdXJyZW5jeSBTeW1ib2xzXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tzeW1ib2x9JywgLy8gR2V0IHN5bWJvbCBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLCAvLyBBdmFpbGFibGUgQ3VycmVuY2llc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tjdXJyZW5jeX0nLCAvLyBHZXQgY3VycmVuY3kgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsIC8vIFRpY2tlciBsaXN0IGZvciBhbGwgc3ltYm9sc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97c3ltYm9sfScsIC8vIFRpY2tlciBmb3Igc3ltYm9sXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tzeW1ib2x9JywgLy8gVHJhZGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL3tzeW1ib2x9JywgLy8gT3JkZXJib29rXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy97c3ltYm9sfScsIC8vIENhbmRsZXNcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gTGlzdCB5b3VyIGN1cnJlbnQgb3BlbiBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci97Y2xpZW50T3JkZXJJZH0nLCAvLyBHZXQgYSBzaW5nbGUgb3JkZXIgYnkgY2xpZW50T3JkZXJJZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvYmFsYW5jZScsIC8vIEdldCB0cmFkaW5nIGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL2ZlZS97c3ltYm9sfScsIC8vIEdldCB0cmFkaW5nIGZlZSByYXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS90cmFkZXMnLCAvLyBHZXQgaGlzdG9yaWNhbCB0cmFkZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L29yZGVyJywgLy8gR2V0IGhpc3RvcmljYWwgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9vcmRlci97aWR9L3RyYWRlcycsIC8vIEdldCBoaXN0b3JpY2FsIHRyYWRlcyBieSBzcGVjaWZpZWQgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLCAvLyBHZXQgbWFpbiBhY2Njb3VudCBiYWxhbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC90cmFuc2FjdGlvbnMnLCAvLyBHZXQgYWNjb3VudCB0cmFuc2FjdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3RyYW5zYWN0aW9ucy97aWR9JywgLy8gR2V0IGFjY291bnQgdHJhbnNhY3Rpb24gYnkgaWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by9hZGRyZXNzL3tjdXJyZW5jeX0nLCAvLyBHZXQgZGVwb3NpdCBjcnlwcm8gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIENyZWF0ZSBuZXcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdycsIC8vIFdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL2FkZHJlc3Mve2N1cnJlbmN5fScsIC8vIENyZWF0ZSBuZXcgZGVwb3NpdCBjcnlwcm8gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdHJhbnNmZXInLCAvLyBUcmFuc2ZlciBhbW91bnQgdG8gdHJhZGluZ1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENyZWF0ZSBuZXcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdy97aWR9JywgLy8gQ29tbWl0IHdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gQ2FuY2VsIGFsbCBvcGVuIG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENhbmNlbCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL3dpdGhkcmF3L3tpZH0nLCAvLyBSb2xsYmFjayB3aXRoZHJhdyBjcnlwcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3BhdGNoJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENhbmNlbCBSZXBsYWNlIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogLTAuMDEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0NBVCcpXG4gICAgICAgICAgICByZXR1cm4gJ0JpdENsYXZlJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGN1cnJlbmN5SWQgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQml0Q2xhdmUnKVxuICAgICAgICAgICAgcmV0dXJuICdDQVQnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgZmVlVG9QcmVjaXNpb24gKHN5bWJvbCwgZmVlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnRydW5jYXRlIChmZWUsIDgpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRTeW1ib2wgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydiYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGVDdXJyZW5jeSddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgbG90ID0gcGFyc2VGbG9hdCAobWFya2V0WydxdWFudGl0eUluY3JlbWVudCddKTtcbiAgICAgICAgICAgIGxldCBzdGVwID0gcGFyc2VGbG9hdCAobWFya2V0Wyd0aWNrU2l6ZSddKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ3RpY2tTaXplJ10pLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsncXVhbnRpdHlJbmNyZW1lbnQnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHRha2VyID0gcGFyc2VGbG9hdCAobWFya2V0Wyd0YWtlTGlxdWlkaXR5UmF0ZSddKTtcbiAgICAgICAgICAgIGxldCBtYWtlciA9IHBhcnNlRmxvYXQgKG1hcmtldFsncHJvdmlkZUxpcXVpZGl0eVJhdGUnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnc3RlcCc6IHN0ZXAsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFrZXIsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBzdGVwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90ICogc3RlcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHR5cGUgPSB0aGlzLnNhZmVTdHJpbmcgKHBhcmFtcywgJ3R5cGUnLCAndHJhZGluZycpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVHZXQnICsgdGhpcy5jYXBpdGFsaXplICh0eXBlKSArICdCYWxhbmNlJztcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpc1ttZXRob2RdICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY29kZSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddKSx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CB0aGlzLnB1YmxpY0dldFRpY2tlclN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGlja2VyWydtZXNzYWdlJ10pO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsndGltZXN0YW1wJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGlkID0gdHJhZGVbJ3N5bWJvbCddO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdmZWUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBtYXJrZXQgPyBtYXJrZXRbJ3F1b3RlJ10gOiB1bmRlZmluZWQ7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0ICh0cmFkZVsnZmVlJ10pLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgb3JkZXJJZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdjbGllbnRPcmRlcklkJyBpbiB0cmFkZSlcbiAgICAgICAgICAgIG9yZGVySWQgPSB0cmFkZVsnY2xpZW50T3JkZXJJZCddO1xuICAgICAgICBsZXQgcHJpY2UgPSBwYXJzZUZsb2F0ICh0cmFkZVsncHJpY2UnXSk7XG4gICAgICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0ICh0cmFkZVsncXVhbnRpdHknXSk7XG4gICAgICAgIGxldCBjb3N0ID0gcHJpY2UgKiBhbW91bnQ7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcklkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgI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R1cyA9PSAnZmlsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGlkID0gb3JkZXJbJ2NsaWVudE9yZGVySWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIHByaWNlID0gdGhpcy5vcmRlcnNbaWRdLnByaWNlO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBmaWxsZWQgIT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICBjb3N0ID0gZmlsbGVkICogcHJpY2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiBjcmVhdGVkLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxIChjcmVhdGVkKSxcbiAgICAgICAgICAgICdjcmVhdGVkJzogY3JlYXRlZCxcbiAgICAgICAgICAgICd1cGRhdGVkJzogdXBkYXRlZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRIaXN0b3J5T3JkZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY2xpZW50T3JkZXJJZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG51bU9yZGVycyA9IHJlc3BvbnNlLmxlbmd0aDtcbiAgICAgICAgaWYgKG51bU9yZGVycyA+IDApXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyIChyZXNwb25zZVswXSk7XG4gICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBvcmRlciAnICsgaWQgKyAnIG5vdCBmb3VuZCcpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQWN0aXZlT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA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nQpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QWNjb3VudENyeXB0b1dpdGhkcmF3ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3lJZCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9ICcvYXBpJyArICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gYXBpICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSB0aGlzLmVuY29kZSAodGhpcy5hcGlLZXkgKyAnOicgKyB0aGlzLnNlY3JldCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHRoaXMuc3RyaW5nVG9CYXNlNjQgKHBheWxvYWQpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQXV0aG9yaXphdGlvbic6IFwiQmFzaWMgXCIgKyB0aGlzLmRlY29kZSAoYXV0aCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHVybDtcbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2VbJ2Vycm9yJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gcmVzcG9uc2VbJ2Vycm9yJ11bJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09ICdPcmRlciBub3QgZm91bmQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnIG9yZGVyIG5vdCBmb3VuZCBpbiBhY3RpdmUgb3JkZXJzJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UgPT0gJ0luc3VmZmljaWVudCBmdW5kcycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyBtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCB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VlLFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzAwMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzAwNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcwMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMDMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMDYwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMTAwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMjAwJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMzAwJyxcbiAgICAgICAgICAgICAgICAnMXknOiAnNDAwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTY5LTE1YWE3YjlhLTVlZGQtMTFlNy05ZTdmLTQ0NzkxZjRlZTQ5Yy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cDovL2FwaS5odW9iaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaHVvYmkuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9odW9iaWFwaS9BUElfRG9jc19lbi93aWtpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdzdGF0aWNtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfV9rbGluZV97cGVyaW9kfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoX3tpZH1fe2xlbmd0aH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RldGFpbF97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd1c2RtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfV9rbGluZV97cGVyaW9kfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoX3tpZH1fe2xlbmd0aH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RldGFpbF97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2FjY291bnRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlfbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsX21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbmV3X2RlYWxfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXJfaWRfYnlfdHJhZGVfaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF93aXRoZHJhd19jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfd2l0aGRyYXdfY29pbl9yZXN1bHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBheW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9sb2FuX2F2YWlsYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2xvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQ05ZJzogeyAnaWQnOiAnYnRjJywgJ3N5bWJvbCc6ICdCVEMvQ05ZJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NOWScsICd0eXBlJzogJ3N0YXRpY21hcmtldCcsICdjb2luVHlwZSc6IDEgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0NOWSc6IHsgJ2lkJzogJ2x0YycsICdzeW1ib2wnOiAnTFRDL0NOWScsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdDTlknLCAndHlwZSc6ICdzdGF0aWNtYXJrZXQnLCAnY29pblR5cGUnOiAyIH0sXG4gICAgICAgICAgICAgICAgLy8gJ0JUQy9VU0QnOiB7ICdpZCc6ICdidGMnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ3R5cGUnOiAndXNkbWFya2V0JywgICAgJ2NvaW5UeXBlJzogMSB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4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Y2tlciwgJ3ZvbCcpLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ3RzJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ2RpcmVjdGlvbiddLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gbWFya2V0Wyd0eXBlJ10gKyAnR2V0RGV0YWlsSWQnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0s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0aW1lZnJhbWUsIHNpbmNlLCBsaW1pdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3RyYWRlUG9zdCcgKyB0aGlzLmNhcGl0YWxpemUgKHNpZGUpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnY29pbl90eXBlJzogbWFya2V0Wydjb2luVHlwZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ3F1b3RlJ10udG9Mb3dlckNhc2UgKCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBlbHNlXG4gICAgICAgICAgICBtZXRob2QgKz0gdGhpcy5jYXBpdGFsaXplICh0eXBlKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy50cmFkZVBvc3RDYW5jZWxPcmRlciAoeyAnaWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBh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Njb3VudHNCeUlkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2hvc3RuYW1lJzogJ2FwaS5odW9iaS5wcm8nLFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bWluJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bWluJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjBtaW4nLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMXdlZWsnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxbW9uJyxcbiAgICAgICAgICAgICAgICAnMXknOiAnMXllYXInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NjktMTVhYTdiOWEtNWVkZC0xMWU3LTllN2YtNDQ3OTFmNGVlNDljLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5odW9iaS5wcm8nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaHVvYmkucHJvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9odW9iaWFwaS9BUElfRG9jcy93aWtpL1JFU1RfYXBpX3JlZmVyZW5jZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3Rvcnkva2xpbmUnLCAvLyDojrflj5ZL57q/5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsL21lcmdlZCcsIC8vIOiOt+WPluiBmuWQiOihjOaDhShUaWNrZXIpXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLCAvLyDojrflj5YgTWFya2V0IERlcHRoIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJywgLy8g6I635Y+WIFRyYWRlIERldGFpbCDmlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L3RyYWRlJywgLy8g5om56YeP6I635Y+W5pyA6L+R55qE5Lqk5piT6K6w5b2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsJywgLy8g6I635Y+WIE1hcmtldCBEZXRhaWwgMjTlsI/ml7bmiJDkuqTph4/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3N5bWJvbHMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInkuqTmmJPlr7lcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21tb24vY3VycmVuY3lzJywgLy8g5p+l6K+i57O757uf5pSv5oyB55qE5omA5pyJ5biB56eNXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3RpbWVzdGFtcCcsIC8vIOafpeivouezu+e7n+W9k+WJjeaXtumXtFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9hY2NvdW50cycsIC8vIOafpeivouW9k+WJjeeUqOaIt+eahOaJgOaciei0puaItyjljbNhY2NvdW50LWlkKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYWNjb3VudHMve2lkfS9iYWxhbmNlJywgLy8g5p+l6K+i5oyH5a6a6LSm5oi355qE5L2Z6aKdXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0nLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXor6bmg4VcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMve2lkfS9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXnmoTmiJDkuqTmmI7nu4ZcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMnLCAvLyDmn6Xor6LlvZPliY3lp5TmiZjjgIHljoblj7Llp5TmiZhcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6LlvZPliY3miJDkuqTjgIHljoblj7LmiJDkuqRcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2FkZHJlc3NlcycsIC8vIOafpeivouiZmuaLn+W4geaPkOeOsOWcsOWdgFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMvcGxhY2UnLCAvLyDliJvlu7rlubbmiafooYzkuIDkuKrmlrDorqLljZUgKOS4gOatpeS4i+WNle+8jCDmjqjojZDkvb/nlKgpXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzJywgLy8g5Yib5bu65LiA5Liq5paw55qE6K6i5Y2V6K+35rGCIO+8iOS7heWIm+W7uuiuouWNle+8jOS4jeaJp+ihjOS4i+WNle+8iVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy97aWR9L3BsYWNlJywgLy8g5omn6KGM5LiA5Liq6K6i5Y2VIO+8iOS7heaJp+ihjOW3suWIm+W7uueahOiuouWNle+8iVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy97aWR9L3N1Ym1pdGNhbmNlbCcsIC8vIOeUs+ivt+aSpOmUgOS4gOS4quiuouWNleivt+axglxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy9iYXRjaGNhbmNlbCcsIC8vIOaJuemHj+aSpOmUgOiuouWNlVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L2JhbGFuY2UvdHJhbnNmZXInLCAvLyDotYTkuqfliJLovaxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2NyZWF0ZScsIC8vIOeUs+ivt+aPkOeOsOiZmuaLn+W4gVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9wbGFjZScsIC8vIOehruiupOeUs+ivt+iZmuaLn+W4geaPkOeOsFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9jYW5jZWwnLCAvLyDnlLPor7flj5bmtojmj5DnjrDomZrmi5/luIFcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDb21tb25TeW1ib2xzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBudW1NYXJrZXRzID0gbWFya2V0cy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1NYXJrZXRzIDwgMSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBwdWJsaWNHZXRDb21tb25TeW1ib2xzIHJldHVybmVkIGVtcHR5IHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlLWN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGUtY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArIHF1b3RlSWQ7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50LXByZWNpc2lvbiddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2UtcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gKGJhc2UgPT0gJ09NRycpID8gMCA6IDAuMiAvIDEwMDtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IChiYXNlID09ICdPTUcnKSA/IDAgOiAwLjIgLyAxMDA7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnbGFzdCcgaW4gdGlja2VyKVxuICAgICAgICAgICAgbGFzdCA9IHRpY2tlclsnbGFzdCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGlmICgndHMnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRpY2tlclsndHMnXTtcbiAgICAgICAgbGV0IGJpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFzayA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdiaWQnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgaWYgKHRpY2tlclsnYmlkJ10pXG4gICAgICAgICAgICAgICAgYmlkID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlclsnYmlkJ10sIDApO1xuICAgICAgICB9XG4gICAgICAgIGlmICgnYXNrJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgIGlmICh0aWNrZXJbJ2FzayddKVxuICAgICAgICAgICAgICAgIGFzayA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXJbJ2FzayddLCAwKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnaGlnaCddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnbG93J10sXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2Fzayc6IGFzayxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB0aWNrZXJbJ29wZW4nXSxcbiAgICAgICAgICAgICdjbG9zZSc6IHRpY2tlclsnY2xvc2UnXSxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHRpY2tlclsndm9sJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMubWFya2V0R2V0RGVwdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiAnc3RlcDAnLFxuICAgICAgICB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pIHtcbiAgICAgICAgaWYgKHJlbG9hZCkge1xuICAgICAgICAgICAgdGhpcy5hY2NvdW50cyA9IGF3YWl0IHRoaXMuZmV0Y2hBY2NvdW50cyAoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmFjY291bnRzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYWNjb3VudHM7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuYWNjb3VudHMgPSBhd2FpdCB0aGlzLmZldGNoQWNjb3VudHMgKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5hY2NvdW50c0J5SWQgPSB0aGlzLmluZGV4QnkgKHRoaXMuYWNjb3VudHMsICdpZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmFjY291bnRzO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQWNjb3VudHMgKCkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBY2NvdW50QWNjb3VudHMgKCk7XG4gICAgICAgIHJldHVybiByZXNwb25zZVsnZGF0YSddO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkQWNjb3VudHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRBY2NvdW50c0lkQmFsYW5jZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuYWNjb3VudHNbMF1bJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddWydsaXN0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYWxhbmNlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiByZXN1bHQpXG4gICAgICAgICAgICAgICAgYWNjb3VudCA9IHJlc3VsdFtjdXJyZW5jeV07XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlWyd0eXBlJ10gPT0gJ3RyYWRlJylcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlWydiYWxhbmNlJ10pO1xuICAgICAgICAgICAgaWYgKGJhbGFuY2VbJ3R5cGUnXSA9PSAnZnJvemVuJylcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlWydiYWxhbmNlJ10pO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR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AgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy51cmxlbmNvZGUgKHJlcXVlc3QpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSBbIG1ldGhvZCwgdGhpcy5ob3N0bmFtZSwgdXJsLCBhdXRoIF0uam9pbiAoXCJcXG5cIik7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocGF5bG9hZCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEyNTYnLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBhdXRoICs9ICcmJyArIHRoaXMudXJsZW5jb2RlICh7ICdTaWduYXR1cmUnOiBzaWduYXR1cmUgfSk7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgYXV0aDtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9XG4gICAgICAgIHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ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c2VydmUnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0FVJywgJ05aJyBdLCAvLyBBdXN0cmFsaWEsIE5ldyBaZWFsYW5kXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwNTIxNjYyLWNmM2Y0NzdjLTliY2ItMTFlNy04OWJjLWQxYWM4NTAxMmVkYS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbS9QdWJsaWMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5pbmRlcGVuZGVudHJlc2VydmUuY29tL1ByaXZhdGUnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5pbmRlcGVuZGVudHJlc2VydmUuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmluZGVwZW5kZW50cmVzZXJ2ZS5jb20vQVBJJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRQcmltYXJ5Q3VycmVuY3lDb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRTZWNvbmRhcnlDdXJyZW5jeUNvZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZExpbWl0T3JkZXJUeXBlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRNYXJrZXRPcmRlclR5cGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZE9yZGVyVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkVHJhbnNhY3Rpb25UeXBlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJCb29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZUhpc3RvcnlTdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRSZWNlbnRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEZ4UmF0ZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1BsYWNlTGltaXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUGxhY2VNYXJrZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldENsb3NlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0Q2xvc2VkRmlsbGVkT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckRldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERpZ2l0YWxDdXJyZW5jeURlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTeW5jaERpZ2l0YWxDdXJyZW5jeURlcG9zaXRBZGRyZXNzV2l0aEJsb2NrY2hhaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3RGlnaXRhbEN1cnJlbmN5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZXF1ZXN0RmlhdFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBiYXNlQ3VycmVuY2llcyA9IGF3YWl0IHRoaXMucHVibGljR2V0VmFsaWRQcmltYXJ5Q3VycmVuY3lDb2RlcyAoKTtcbiAgICAgICAgbGV0IHF1b3RlQ3VycmVuY2llcyA9IGF3YWl0IHRoaXMucHVibGljR2V0VmFsaWRTZWNvbmRhcnlDdXJyZW5jeUNvZGVzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFzZUN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBiYXNlQ3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWRVcHBlcmNhc2UgPSBiYXNlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWRVcHBlcmNhc2UpO1xuICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBxdW90ZUN1cnJlbmNpZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGVJZCA9IHF1b3RlQ3VycmVuY2llc1tqXTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGVJZFVwcGVyY2FzZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWRVcHBlcmNhc2UpO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArICcvJyArIHF1b3RlSWQ7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICBsZXQgdGFrZXIgPSAwLjUgLyAxMDA7XG4gICAgICAgICAgICAgICAgbGV0IG1ha2VyID0gMC41IC8gMTAwO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBpZCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O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gICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IFtcbiAgICAgICAgICAgICAgICB1cmwsXG4gICAgICAgICAgICAgICAgJ2FwaUtleT0nICsgdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlPScgKyBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICBsZXQga2V5c29ydGVkID0gdGhpcy5rZXlzb3J0IChwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAoa2V5c29ydGVkKTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2ldO1xuICAgICAgICAgICAgICAgIGF1dGgucHVzaCAoa2V5ICsgJz0nICsgcGFyYW1zW2tleV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSBhdXRoLmpvaW4gKCcsJyk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAobWVzc2FnZSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5rZXlzb3J0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0aGlzL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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgaXRiaXQgZXh0ZW5kcyBFeGNoYW5nZSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnaXRiaXQnLFxuICAgICAgICAgICAgJ25hbWUnOiAnaXRCaXQnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVUycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4MjIxNTktNjYxNTM2MjAtNjBhZC0xMWU3LTg5ZTctMDA1ZjZkN2YzZGUwLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5pdGJpdC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaXRiaXQuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuaXRiaXQuY29tL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuaXRiaXQuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMve3N5bWJvbH0vb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vYmFsYW5jZXMve2N1cnJlbmN5Q29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9mdW5kaW5nX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldF90cmFuc2ZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9jcnlwdG9jdXJyZW5jeV9kZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2NyeXB0b2N1cnJlbmN5X3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXJlX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ1hCVFVTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9TR0QnOiB7ICdpZCc6ICdYQlRTR0QnLCAnc3ltYm9sJzogJ0JUQy9TR0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnU0dEJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnWEJURVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaW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ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gyNGgnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cyNGgnXSksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2JpZCcpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICd2d2FwJzogdndhcCxcbiAgICAgICAgICAgICdvcGVuJzogcGFyc2VGbG9hdCAodGlja2VyWydvcGVuVG9kYXknXSksXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdFByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsndGltZXN0YW1wJ10pO1xuICAgICAgICBsZXQgaWQgPSB0cmFkZVsnbWF0Y2hOdW1iZXInXS50b1N0cmluZyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IGlkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHNTeW1ib2xUcmFkZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWydyZWNlbnRUcmFkZXMnXSwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlQmFsYW5jZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWyd0b3RhbEJhbGFuY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBmZXRjaFdhbGxldHMgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5wcml2YXRlR2V0V2FsbGV0cyAoKTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IHdhbGxldElkSW5QYXJhbXMgPSAoJ3dhbGxldElkJyBpbiBwYXJhbXMpO1xuICAgICAgICBpZiAoIXdhbGxldElkSW5QYXJhbXMpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY3JlYXRlT3JkZXIgcmVxdWlyZXMgYSB3YWxsZXRJZCBwYXJhbWV0ZXInKTtcbiAgICAgICAgYW1vdW50ID0gYW1vdW50LnRvU3RyaW5nICgpO1xuICAgICAgICBwcmljZSA9IHByaWNlLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnYmFzZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdkaXNwbGF5JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnaW5zdHJ1bWVudCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlQWRkICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAg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H0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgYm9keSA9ICcnO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCB0aW1lc3RhbXAgPSBub25jZTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gWyBtZXRob2QsIHVybCwgYm9keSwgbm9uY2UsIHRpbWVzdGFtcCBdO1xuICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSBub25jZSArIHRoaXMuanNvbiAoYXV0aCk7XG4gICAgICAgICAgICBsZXQgaGFzaCA9IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKG1lc3NhZ2UpLCAnc2hhMjU2JywgJ2JpbmFyeScpO1xuICAgICAgICAgICAgbGV0IGJpbmhhc2ggPSB0aGlzLmJpbmFyeUNvbmNhdCAodXJsLCBoYXNoKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKGJpbmhhc2gsIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogc2VsZi5hcGlLZXkgKyAnOicgKyBzaWduYXR1cmUsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICAnWC1BdXRoLVRpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICAgICAnWC1BdXRoLU5vbmN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G4gICAgICAgICAgICAnaWQnOiAnanViaScsXG4gICAgICAgICAgICAnbmFtZSc6ICdqdWJpLmNvbScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0NOJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU4MS05ZDM5N2Q5YS01ZWRkLTExZTctOGZiOS01ZDgyMzZjMGU2OTIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3Lmp1YmkuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5qdWJpLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5qdWJpLmNvbS9oZWxwL2FwaS5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRBbGx0aWNrZXIgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1twXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICA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IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0c0J5QWx0bmFtZSc6IHt9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzEnLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjAnLFxuICAgICAgICAgICAgICAgICc0aCc6ICcyNDAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxNDQwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgICAgICcydyc6ICcyMTYwMCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU5OS0yMjcwOTMwNC01ZWRlLTExZTctOWRlMS05ZjMzNzMyZTE1MDkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmtyYWtlbi5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cua3Jha2VuLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmtyYWtlbi5jb20vZW4tdXMvaGVscC9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL25vdGhpbmdpc2RlYWQvbnBtLWtyYWtlbi1hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cua3Jha2VuLmNvbS9lbi11cy9oZWxwL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBc3NldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0Fzc2V0UGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPSExDJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTcHJlYWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVGltZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBZGRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0Nsb3NlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRGVwb3NpdE1ldGhvZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xlZGdlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09wZW5Qb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5TGVkZ2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUXVlcnlPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZUJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgY29zdCkge1xuICAgICAgICByZXR1cm4gdGhpcy50cnVuY2F0ZSAocGFyc2VGbG9hdCAoY29zdCksIHRoaXMubWFya2V0c1tzeW1ib2xdWydwcmVjaXNpb24nXVsncHJpY2UnXSk7XG4gICAgfVxuXG4gICAgZmVlVG9QcmVjaXNpb24gKHN5bWJvbCwgZmVlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnRydW5jYXRlIChwYXJzZUZsb2F0IChmZWUpLCB0aGlzLm1hcmtldHNbc3ltYm9sXVsncHJlY2lzaW9uJ11bJ2Ftb3VudCddKTtcbiAgICB9XG5cb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GV0IGJhc2UgPSBtYXJrZXRbJ2Jhc2UnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgIGlmICgoYmFzZVswXSA9PSAnWCcpIHx8IChiYXNlWzBdID09ICdaJykpXG4gICAgICAgICAgICAgICAgYmFzZSA9IGJhc2Uuc2xpY2UgKDEpO1xuICAgICAgICAgICAgaWYgKChxdW90ZVswXSA9PSAnWCcpIHx8IChxdW90ZVswXSA9PSAnWicpKVxuICAgICAgICAgICAgICAgIHF1b3RlID0gcXVvdGUuc2xpY2UgKDEpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBkYXJrcG9vbCA9IGlkLmluZGV4T2YgKCcuZCcpID49IDA7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gZGFya3Bvb2wgPyBtYXJrZXRbJ2FsdG5hbWUnXSA6IChiYXNlICsgJy8nICsgcXVvdGUpO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKCdmZWVzX21ha2VyJyBpbiBtYXJrZXQpIHtcbiAgICAgICAgICAgICAgICBtYWtlciA9IHBhcnNlRmxvYXQgKG1hcmtldFsnZmVlc19tYWtlciddWzBdWzFdKSAvIDEwMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnbG90X2RlY2ltYWxzJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwYWlyX2RlY2ltYWxzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnZGFya3Bvb2wnOiBkYXJrcG9vbCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnYWx0bmFtZSc6IG1hcmtldFsnYWx0bmFtZSddLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHBhcnNlRmxvYXQgKG1hcmtldFsnZmVlcyddWzBdWzFdKSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmVzdWx0ID0gdGhpcy5hcHBlbmRJbmFjdGl2ZU1hcmtldHMgKHJlc3VsdCk7XG4gICAgICAgIHRoaXMubWFya2V0c0J5QWx0bmFtZSA9IHRoaXMuaW5kZXhCeSAocmVzdWx0LCAnYWx0bmFtZScpO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFwcGVuZEluYWN0aXZlTWFya2V0cyAocmVzdWx0ID0gW10pIHtcbiAgICAgICAgbGV0IHByZWNpc2lvbiA9IHsgJ2Ftb3VudCc6IDgsICdwcmljZSc6IDggfTtcbiAgICAgICAgbGV0IGNvc3RMaW1pdHMgPSB7ICdtaW4nOiAwLCAnbWF4JzogdW5kZWZpbmVkIH07XG4gICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHsgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksICdtYXgnOiB1bmRlZmluZWQgfTtcbiAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHsgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLCAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSB9O1xuICAgICAgICBsZXQgbGltaXRzID0geyAnYW1vdW50JzogYW1vdW50TGltaXRzLCAncHJpY2UnOiBwcmljZUxpbWl0cywgJ2Nvc3QnOiBjb3N0TGltaXRzIH07XG4gICAgICAgIGxldCBkZWZhdWx0cyA9IHtcbiAgICAgICAgICAgICdkYXJrcG9vbCc6IGZhbHNlLFxuICAgICAgICAgICAgJ2luZm8nOiB1bmRlZmluZWQsXG4gIC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gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0RGVwdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsncmVzdWx0J11bbWFya2V0WydpZCddXTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vayk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBiYXNlVm9sdW1lID0gcGFyc2VGbG9hdCAodGlja2VyWyd2J11bMV0pO1xuICAgICAgICBsZXQgdndhcCA9IHBhcnNlRmxvYXQgKHRpY2tlclsncCddWzFdKTtcbiAgICAgICAgbGV0IHF1b3RlVm9sdW1lID0gYmFzZVZvbHVtZSAqIHZ3YXA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoJ11bMV0pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbCddWzFdKSxcbiAgICAgICAgICAgICdiaWQnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2InXVswXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhJ11bMF0pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ28nXSksXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYyddWzBdKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBwYWlycyA9IFtdO1xuICAgICAgICBmb3IgKGxldCBzID0gMDsgcyA8IHRoaXMuc3ltYm9scy5sZW5ndGg7IHMrKykge1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHRoaXMuc3ltYm9sc1tzXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgICAgIGlmIChtYXJrZXRbJ2FjdGl2ZSddKVxuICAgICAgICAgICAgICAgIGlmICghbWFya2V0WydkYXJrcG9vbCddKVxuICAgICAgICAgICAgICAgICAgICBwYWlycy5wdXNoIChtYXJrZXRbJ2lkJ10pO1xuICAgICAgICB9XG4gICAgICAgIGxldCBmaWx0ZXIgPSBwYWlycy5qb2luICgnLCcpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogZmlsdGVyLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBkYXJrcG9vbCA9IHN5bWJvbC5pbmRleE9mICgnLmQnKSA+PSAwO1xuICAgICAgICBpZiAoZGFya3Bvb2wpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZG9lcyBub3QgcHJvdmlkZSBhIHRpY2tlciBmb3IgZGFya3Bvb2wgc3ltYm9sICcgKyBzeW1ib2wpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3Jlc3VsdCddW21hcmtldFsnaWQnXV07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VPSExDViAob2hsY3YsIG1hcmtldCA9IHVuZGVmaW5lZCwgdGltZWZyYW1lID0gJzFtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICBvaGxjdlswXSAqIDEwMDAsXG4gICAgICAgICAgICBwYXJzZUZsb2F0IChvaGxjdlsxXSksXG4gICAgICAgICAgICBwYXJzZUZsb2F0IChvaGxjdlsyXSksXG4gICAgICAgICAgICBwYXJzZUZsb2F0IChvaGxjdlszXSksXG4gICAgICAgICAgICBwYXJzZUZsb2F0IChvaGxjdls0XSksXG4gICAgICAgICAgICBwYXJzZUZsb2F0IChvaGxjdls2XSksXG4gICAgICAgIF07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPSExDViAoc3ltYm9sLCB0aW1lZnJhbWUgPSAnMW0nLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZ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10pO1xuICAgICAgICBpZiAoJ29yZGVydHhpZCcgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIG9yZGVyID0gdHJhZGVbJ29yZGVydHhpZCddO1xuICAgICAgICAgICAgaWQgPSB0cmFkZVsnaWQnXTtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsndGltZSddICogMTAwMCk7XG4gICAgICAgICAgICBzaWRlID0gdHJhZGVbJ3R5cGUnXTtcbiAgICAgICAgICAgIHR5cGUgPSB0cmFkZVsnb3JkZXJ0eXBlJ107XG4gICAgICAgICAgICBwcmljZSA9IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKTtcbiAgICAgICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKHRyYWRlWyd2b2wnXSk7XG4gICAgICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgY3VycmVuY3kgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHBhcnNlRmxvYXQgKHRyYWRlWydmZWUnXSksXG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbMl0gKiAxMDAwKTtcbiAgICAgICAgICAgIHNpZGUgPSAodHJhZGVbM10gPT0gJ3MnKSA/ICdzZWxsJyA6ICdidXknO1xuICAgICAgICAgICAgdHlwZSA9ICh0cmFkZVs0XSA9PSAnbCcpID8gJ2xpbWl0JyA6ICdtYXJrZXQnO1xuICAgICAgICAgICAgcHJpY2UgPSBwYXJzZUZsb2F0ICh0cmFkZVswXSk7XG4gICAgICAgICAgICBhbW91bnQgPSBwYXJzZUZsb2F0ICh0cmFkZVsxXSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IChtYXJrZXQpID8gbWFya2V0WydzeW1ib2wnXSA6IHVuZGVmaW5lZDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXIsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiBpZCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0cmFkZXMgPSByZXNwb25zZVsncmVzdWx0J11baWRdO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAodHJhZGVzLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gY3VycmVuY3k7XG4gICAgICAgICAgICAvLyBYLUlTTzQyMTctQTMgc3RhbmRhcmQgY3VycmVuY3kgY29kZXNcbiAgICAgICAgICAgIGlmIChjb2RlWzBdID09ICdYJykge1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjb2RlLnNsaWNlICgxKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY29kZVswXSA9PSAnWicpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gY29kZS5zbGljZSAoMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGNvZGUpO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBwYXJzZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0pO1xuICAgICAgICAgICAgbGV0IG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ICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0IChvcmRlclsndm9sJ10pO1xuICAgICAgICBsZXQgZmlsbGVkID0gcGFyc2VGbG9hdCAob3JkZXJbJ3ZvbF9leGVjJ10pO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Nvc3QnKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKGRlc2NyaXB0aW9uLCAncHJpY2UnKTtcbiAgICAgICAgaWYgKCFwcmljZSlcbiAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmICgnZmVlJyBpbiBvcmRlcikge1xuICAgICAgICAgICAgICAgIGxldCBmbGFncyA9IG9yZGVyWydvZmxhZ3MnXTtcbiAgICAgICAgICAgICAgICBsZXQgZmVlQ29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZScpO1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgICAgICAgICAncmF0ZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmIChmbGFncy5pbmRleE9mICgnZmNpcScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZmVlWydjdXJyZW5jeSddID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxhZ3MuaW5kZXhPZiAoJ2ZjaWInKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGZlZVsnY3VycmVuY3knXSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzdGF0dXMnOiBvcmRlclsnc3RhdHVzJ10sXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgLy8gJ3RyYWRlcyc6IHRoaXMucGFyc2VUcmFkZXMgKG9yZGVyWyd0cmFkZXMnXSwgbWFya2V0KSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVycyAob3JkZXJzLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKG9yZGVycyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAg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Y0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBUEktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FQSS1TaWduJzogdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IG51bUVycm9ycyA9IHJlc3BvbnNlWydlcnJvciddLmxlbmd0aDtcbiAgICAgICAgICAgIGlmIChudW1FcnJvcnMpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJlc3BvbnNlWydlcnJvciddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3InXVt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gcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdrdW5hJyxcbiAgICAgICAgICAgICduYW1lJzogJ0t1bmEnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVQScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YyJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMTY5NzYzOC05MTI4MjRmYS1iM2MxLTExZTctOGMzNi1jZjk2MDZlYjk0YWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8va3VuYS5pbycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2t1bmEuaW8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9rdW5hLmlvL2RvY3VtZW50cy9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZXN0YW1wJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21lbWJlcnMvbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL215JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZWxldGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VQUgnOiB7ICdpZCc6ICdidGN1YWgnLCAnc3ltYm9sJzogJ0JUQy9VQUgnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVUFIJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDYsICdwcmljZSc6IDAgfSwgJ2xvdCc6IDAuMDAwMDAxLCAnbGltaXRzJzogeyAnYW1vdW50JzogeyAnbWluJzogMC4wMDAwMDEsICdtYXgnOiB1bmRlZmluZWQgfSwgJ3ByaWNlJzogeyAnbWluJzogMSwgJ21heCc6IHVuZGVmaW5lZCB9fX0sXG4gICAgICAgICAgICAgICAgJ0VUSC9VQUgnOiB7ICdpZCc6ICdldGh1YWgnLCAnc3ltYm9sJzogJ0VUSC9VQUgnLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnVUFIJywgJ3ByZWNpc2lv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gc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWyd2b2x1bWUnXSxcbiAgICAgICAgICAgICdjb3N0JzogdHJhZGVbJ2Z1bmRzJ10sXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsnc2lkZSddLFxuICAgICAgICAgICAgJ29yZGVyJzogdHJhZGVbJ29yZGVyX2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VNeVRyYWRlcyAodHJhZGVzLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHBhcnNlZFRyYWRlcyA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRyYWRlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IHRyYWRlID0gdHJhZGVzW2ldO1xuICAgICAgICAgICAgbGV0IHBhcnNlZFRyYWRlID0gdGhpcy5wYXJzZU15VHJhZGUgKHRyYWRlLCBtYXJrZXQpO1xuICAgICAgICAgICAgcGFyc2VkVHJhZGVzLnB1c2ggKHBhcnNlZFRyYWRlKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcGFyc2VkVHJhZGVzO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTXlUcmFkZXMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2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J25hbWUnOiAnTGFrZUJUQycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1VTJyxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ2FwaV92MicsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MDc0MTIwLTcyYjdjMzhhLTY2NjAtMTFlNy05MmQ5LWQ5MDI3NTAyMjgxZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkubGFrZWJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubGFrZWJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5sYWtlYnRjLmNvbS9zL2FwaV92MicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5sYWtlYnRjLmNvbS9zL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmNvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JjdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFjY291bnRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRFeHRlcm5hbEFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwga2V5cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1trXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBxdW90ZSA9IHF1b3RlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEFjY291bnRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBwYXJzZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0pO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgIC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HMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbjtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgcGFyYW1zID0gcGFyYW1zLmpvaW4gKCcsJyk7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgcGFyYW1zID0gJyc7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAoe1xuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdhY2Nlc3NrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAncmVxdWVzdG1ldGhvZCc6IG1ldGhvZC50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogcGFyYW1zLFxuICAgICAg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GknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkubGlxdWkuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkubGlxdWkuaW8vdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vbGlxdWkuaW8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9saXF1aS5pby9hcGknLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vbGlxdWkuaW8vZmVlJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWN0aXZlT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYW5zSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ29pbkRlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NyZWF0ZUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVkZWVtQ291cG9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiAwLjAsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjYWxjdWxhdGVGZWUgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSwgdGFrZXJPck1ha2VyID0gJ3Rha2VyJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICBsZXQga2V5ID0gJ3F1b3RlJztcbiAgICAgICAgbGV0IHJhdGUgPSBtYXJrZXRbdGFrZXJPck1ha2VyXTtcbiAgICAgICAgbGV0IGNvc3QgPSBwYXJzZUZsb2F0ICh0aGlzLmNvc3RUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQgKiByYXRlKSk7XG4gICAgICAgIGlmIChzaWRlID09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRba2V5XSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmICghdGhpcy5zdWJzdGl0dXRlQ29tbW9uQ3VycmVuY3lDb2RlcylcbiAgICAgICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdYQlQnKVxuICAgICAgICAgICAgcmV0dXJuICdCVEMnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JDQycpXG4gICAgICAgICAgICByZXR1cm4gJ0JDSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRFJLJylcbiAgICAgICAgICAgIHJldHVybiAnREFTSCc7XG4gICAgICAgIC8vIHRoZXkgbWlzc3BlbGwgREFTSCBhcyBkc2ggOi9cbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEU0gnKVxuICAgICAgICAgICAgcmV0dXJuICdEQVNIJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGdldEJhc2VRdW90ZUZyb21NYXJrZXRJZCAoaWQpIHtcbiAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gdXBwZXJjYXNlLnNwbGl0ICgnXycpO1xuICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgIHJldHVybiBbIGJhc2UsIHF1b3RlIF07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJbmZvICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydwYWlycyddO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbcF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gdGhpcy5nZXRCYXNlUXVvdGVGcm9tTWFya2V0SWQgKGlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnNhZmVJbnRlZ2VyIChtYXJrZXQsICdkZWNpbWFsX3BsYWNlcycpLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ2RlY2ltYWxfcGxhY2VzJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9hbW91bnQnKSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heF9hbW91bnQnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJpY2VMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fcHJpY2UnKSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heF9wcmljZScpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBjb3N0TGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX3RvdGFsJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50TGltaXRzLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlTGltaXRzLFxuICAgICAgICAgICAgICAgICdjb3N0JzogY29zdExpbWl0cyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gKG1hcmtldFsnaGlkZGVuJ10gPT0gMCk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBtYXJrZXRbJ2ZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICdsb3QnOiBhbW91bnRMaW1pdHNbJ21pbiddLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXR1cm4nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgZnVuZHMgPSBiYWxhbmNlc1snZnVuZHMnXTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoZnVuZHMpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICB1cHBlcmNhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAodXBwZXJjYXNlKTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGJhbGFuY2VzWydvcGVuX29yZGVycyddID09IDApIHtcbiAgICAgICAgICAgICAgICB0b3RhbCA9IGZ1bmRzW2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICB1c2VkID0gMC4wO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmd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iAgICAgICAgcmVzdWx0Wydhc2tzJ10gPSB0aGlzLnNvcnRCeSAocmVzdWx0Wydhc2tzJ10sIDApO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd1cGRhdGVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0JyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFx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QgdGFrZXJPck1ha2VyID0gJ3Rha2VyJztcbiAgICAgICAgLy8gaWYgKGlzWW91ck9yZGVyKVxuICAgICAgICAvLyAgICAgdGFrZXJPck1ha2VyID0gJ21ha2VyJztcbiAgICAgICAgLy8gbGV0IGZlZSA9IHRoaXMuY2FsY3VsYXRlRmVlIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UsIHRha2VyT3JNYWtlcik7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKGxpbWl0KVxuICAgICAgICAgICAgcmVxdWVzdFsnbGltaXQnXSA9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5ICgpKTtcbiAgICAgICAgaWYgKCFpZClcbiAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZVsncmV0dXJuJ10sICdpbml0X29yZGVyX2lkJyk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcHJpY2UgPSBwYXJzZUZsb2F0IChwcmljZSk7XG4gICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKGFtb3VudCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogYW1vdW50LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogMC4wLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vICd0cmFkZXMnOiB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsndHJhZGVzJ10sIG1hcmtldCksXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IG9yZGVyO1xuICAgICAgICByZXR1cm4gdGhpcy5leHRlbmQgKHsgJ2luZm8nOiByZXNwb25zZSB9LCBvcmRlcik7XG4gICAgfVxuXG4gICAgZ2V0T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HRwX3Jlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBpZCA9IG9yZGVyWydpZCddLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgc3RhdHVzID0gb3JkZXJbJ3N0YXR1cyddO1xuICAgICAgICBpZiAoc3RhdHVzID09IDApIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdvcGVuJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT0gMSkge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoKHN0YXR1cyA9PSAyKSB8fCAoc3RhdHVzID09IDMpKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2FuY2VsZWQnO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAob3JkZXJbJ3RpbWVzdGFtcF9jcmVhdGVkJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbb3JkZXJbJ3BhaXInXV07XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdzdGFydF9hbW91bnQnLCByZW1haW5pbmcpO1xuICAgICAgICBpZiAodHlwZW9mIGFtb3VudCA9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKSB7XG4gICAgICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRoaXMub3JkZXJzW2lkXSwgJ2Ftb3VudCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JhdGUnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgYW1vdW50ICE9ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICA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WydyZXR1cm4nXSwgbWFya2V0KTtcbiAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBvcGVuT3JkZXJzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICB0aGlzLm9yZGVyc1tvcGVuT3JkZXJzW2pdWydpZCddXSA9IG9wZW5PcmRlcnNbal07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG9wZW5PcmRlcnNJbmRleGVkQnlJZCA9IHRoaXMuaW5kZXhCeSAob3Blbk9yZGVycywgJ2lkJyk7XG4gICAgICAgIGxldCBjYWNoZWRPcmRlcklkcyA9IE9iamVjdC5rZXlzICh0aGlzLm9yZGVycyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBjYWNoZWRPcmRlcklkcy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY2FjaGVkT3JkZXJJZHNba107XG4gICAgICAgICAgICBpZiAoaWQgaW4gb3Blbk9yZGVyc0luZGV4ZWRCeUlkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gdGhpcy5leHRlbmQgKHRoaXMub3JkZXJzW2lkXSwgb3Blbk9yZGVyc0luZGV4ZWRCeUlkW2lkXSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBvcmRlciA9IHRoaXMub3JkZXJzW2lkXTtcbiAgICAgICAgICAgICAgICBpZiAob3JkZXJbJ3N0YXR1cyddID09ICdvcGVuJykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSB0aGlzLmV4dGVuZCAob3JkZXIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnY2xvc2VkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0Jzogb3JkZXJbJ2Ftb3VudCddICogb3JkZXJbJ3ByaWNlJ10sXG4gICAgICAgICAgICAgICAg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gICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLnNpZ25Cb2R5V2l0aFNlY3JldCAoYm9keSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuZ2V0VmVyc2lvblN0cmluZyAoKSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSw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MGE1NGZmOWJlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5saXZlY29pbi5uZXQnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubGl2ZWNvaW4ubmV0JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmxpdmVjb2luLm5ldC9hcGk/bGFuZz1lbicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2FsbC9vcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9sYXN0X3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbWF4YmlkX21pbmFzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvcmVzdHJpY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90aWNrZXInLCAvLyBvbWl0IHBhcmFtcyB0byBnZXQgYWxsIHRpY2tlcnMgYXQgb25jZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vY29pbkluZm8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvY2xpZW50X29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvY29tbWlzc2lvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvY29tbWlzc2lvbkNvbW1vbkluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9nZXQvYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9oaXN0b3J5L3NpemUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvaGlzdG9yeS90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9idXlsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYnV5bWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jYW5jZWxsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvc2VsbGxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9zZWxsbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L291dC9jYXBpdGFsaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L291dC9jYXJkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L291dC9jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L291dC9va3BheScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvcGF5ZWVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L291dC9wZXJmZWN0bW9uZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvdm91Y2hlci9hbW91bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvdm91Y2hlci9tYWtlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L3ZvdWNoZXIvcmVkZWVtJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEV4Y2hhbmdlVGlja2VyICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IDAuMTggLyAxMDA7XG4gICAgICAgICAgICBsZXQgbWFrZXIgPSAwLjE4IC8gMTAwO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRQYXltZW50QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiByZXN1bHQpXG4gICAgICAgICAgICAgICAgYWNjb3VudCA9IHJlc3VsdFtjdXJyZW5jeV07XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlWyd0eXBlJ10gPT0gJ3RvdGFsJylcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsndmFsdWUnXSk7XG4gICAgICAgICAgICBpZiAoYmFsYW5jZVsndHlwZSddID09ICdhdmFpbGFibGUnKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ3ZhbHVlJ10p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gICAgICBsZXQgdndhcCA9IHBhcnNlRmxvYXQgKHRpY2tlclsndndhcCddKTtcbiAgICAgICAgbGV0IGJhc2VWb2x1bWUgPSBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbHVtZSddKTtcbiAgICAgICAgbGV0IHF1b3RlVm9sdW1lID0gYmFzZVZvbHVtZSAqIHZ3YXA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmVzdF9iaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydiZXN0X2FzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogcGFyc2VGbG9hdCAodGlja2VyWyd2d2FwJ10pLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F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W4vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vbnBtanMub3JnL3BhY2thZ2UvYml0eCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYmF1c21laWVyL25vZGUtYml0eCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0vdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWVfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc3RvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0b3BvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvYXV0aDIvZ3JhbnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3Rlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sndGlja2VycyddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sndGlja2VycyddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZ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xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsnaXNfYnV5J10pID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRyYWRlWyd0aW1lc3RhbXAnXSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodHJhZGVbJ3RpbWVzdGFtcCddKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsncHJpY2UnXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAodH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91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzgzNzA2MC1lN2M1ODcxNC02MGVhLTExZTctOTE5Mi1mMDVlODZhZGI4M2YuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vd3d3Lm1lcmNhZG9iaXRjb2luLm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5uZXQvdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lm1lcmNhZG9iaXRjb2luLmNvbS5icicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm1lcmNhZG9iaXRjb2luLmNvbS5ici9hcGktZG9jJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm1lcmNhZG9iaXRjb2luLmNvbS5ici90cmFkZS1hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS9vcmRlcmJvb2svJywgLy8gbGFzdCBzbGFzaCBjcml0aWNhbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90aWNrZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vdHJhZGVzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy97ZnJvbX0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vdHJhZGVzL3tmcm9tfS97dG99JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vZGF5LXN1bW1hcnkve3llYXJ9L3ttb250aH0ve2RheX0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9hY2NvdW50X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3Rfc3lzdGVtX21lc3NhZ2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlX2J1eV9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGxhY2Vfc2VsbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfY29pbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0JSTCc6IHsgJ2lkJzogJ0JSTEJUQycsICdzeW1ib2wnOiAnQlRDL0JSTCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdCUkwnLCAnc3VmZml4JzogJ0JpdGNvaW4nIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9CUkwnOiB7ICdpZCc6ICdCUkxMVEMnLCAnc3ltYm9sJzogJ0xUQy9CUkwnLCAnYmFzZSc6ICdMV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rZXRbJ2Jhc2UnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsndGlja2VyJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodGlja2VyWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydidXknXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0Q29pblRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luJzogbWFya2V0WydiYXNlJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2UsIG1h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XMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncmVzcG9uc2VfZGF0YSddWyd3aXRoZHJhd2FsJ11bJ2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAndGFwaV9tZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICd0YXBpX25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gJy90YXBpLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyAnPycgKyBib2R5O1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgIC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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBtaXhjb2lucyBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdtaXhjb2lucycsXG4gICAgICAgICAgICAnbmFtZSc6ICdNaXhDb2lucycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnR0InLCAnSEsnIF0sXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwMjM3MjEyLWVkMjkzMDNjLTk1MzUtMTFlNy04YWY4LWZjZDM4MWNmYTIwYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9taXhjb2lucy5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vbWl4Y29pbnMuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vbWl4Y29pbnMuY29tL2hlbHAvYXBpLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnYnRjX3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAnbWFrZXInOiAwLjAwMTUsICd0YWtlcic6IDAuMDAyNSB9LFxuICAgICAgICAgICAgICAgICdFVEgvQlRDJzogeyAnaWQnOiAnZXRoX2J0YycsICdzeW1ib2wnOiAnRVRIL0JUQycsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdCVEMnLCAnbWFrZXInOiAwLjAwMSwgJ3Rha2VyJzogMC4wMDE1IH0sXG4gICAgICAgICAgICAgICAgJ0JDSC9CVEMnOiB7ICdpZCc6ICdiY2NfYnRjJywgJ3N5bWJvbCc6ICdCQ0gvQlRDJywgJ2Jhc2UnOiAnQkNIJywgJ3F1b3RlJzogJ0JUQycsICdtYWtlcic6IDAuMDAxLCAndGFrZXInOiAwLjAwMTUgfSxcbiAgICAgICAgICAg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gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChsb3dlcmNhc2UgaW4gYmFsYW5jZSkge1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbbG93ZXJjYXNlXVsnYXZhaWwnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtsb3dlcmNhc2VdWydsb2NrJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0aGlzLnN1bSAoYWNjb3VudFsnZnJlZSddLCBhY2NvdW50Wyd1c2VkJ10pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0RGVwdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChyZXNwb25zZVsncmVzdWx0J10pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbCddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdG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vZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuc2VjcmV0LCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGV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Ly8gVGFuemFuaWFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzA1MTg1NzEtNzhjYTBiY2EtOWI4YS0xMWU3LTg4NDAtNjRiODNhNGE5NGIyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20vcmVtb3RlJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vbm92YWV4Y2hhbmdlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20vcmVtb3RlL2ZhcScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tiYXNlY3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2luZm8ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29yZGVyaGlzdG9yeS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYnV5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW5vcmRlcnMve3BhaXJ9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYm90aC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVub3JkZXJzL3twYWlyfS97b3JkZXJ0eXBlfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2VzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZS97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG5ld2RlcG9zaXRhZGRyZXNzL3tjdXJyZW5jeX0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRkZXBvc2l0YWRkcmVzcy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzX21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxvcmRlci97b3JkZXJpZH0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdGhpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2FsaGlzdG9yeS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnbWFya2V0cyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBpZiAoIW1hcmtldFsnZGlzYWJsZWQnXSkge1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnbWFya2V0bmFtZSddO1xuICAgICAgICAgICAgICAgIGxldCBbIHF1b3RlLCBiYXNlIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIG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snaGlnaDI0aCddKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvdzI0aCddKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2FzaycpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0X3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnY2hhbmdlMjRoJ10pLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUyNGgnXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndW5peF90X2RhdGVzdGFtcCddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAx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gpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBsb2NrYm94ID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYW1vdW50X2xvY2tib3gnXSk7XG4gICAgICAgICAgICBsZXQgdHJhZGVzID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYW1vdW50X3RyYWRlcyddKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdGhpcy5zdW0gKGxvY2tib3gsIHRyYWRlcyksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYW1vdW50X3RvdGFsJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh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XMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpXG4gICAgICAgICAgICB1cmwgKz0gYXBpICsgJy8nO1xuICAgICAgICB1cmwgKz0gdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAoeyAnbm9uY2UnOiBub25jZSB9KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh1cmwpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhcGlrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuIC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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3Mgb2tjb2luY255IGV4dGVuZHMgb2tjb2ludXNkIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdva2NvaW5jbnknLFxuICAgICAgICAgICAgJ25hbWUnOiAnT0tDb2luIENOWScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0NOJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NzkyLThiZTkxNTdhLTVlZTUtMTFlNy05MjZjLTZkNjliOGQzMzc4ZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cub2tjb2luLmNuJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5va2NvaW4uY24vcGFpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNuL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jbicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5va2NvaW4uY24vcmVzdF9nZXRTdGFydGVkLmh0bWwnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQ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B0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdleHRlbnNpb24nOiAnLmRvJywgLy8gYXBwZW5kZWQgdG8gZW5kcG9pbnQgVVJMXG4gICAgICAgICAgICAnaGFzRnV0dXJlTWFya2V0cyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICczbSc6ICczbWluJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW1pbicsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG1pbicsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFob3VyJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMmhvdXInLFxuICAgICAgICAgICAgICAgICc0aCc6ICc0aG91cicsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZob3VyJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaG91cicsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkYXknLFxuICAgICAgICAgICAgICAgICczZCc6ICczZGF5JyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMXdlZWsnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMvcHJvZHVjdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2VfcmF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfZXN0aW1hdGVkX3ByaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfaG9sZF9hbW91bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9pbmRleCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfcHJpY2VfbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvdGNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9yZWNvcmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXRjaF90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9ycm93X21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib3Jyb3dfb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9ycm93c19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfYm9ycm93JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vdGNfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF93aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2JhdGNoX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfZGV2b2x2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2V4cGxvc2l2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9vcmRlcnNfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfcG9zaXRpb25fNGZpeCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdHJhZGVzX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV91c2VyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3VzZXJpbmZvXzRmaXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2ZlZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ290Y19vcmRlcl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvdGNfb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdWJtaXRfb3RjX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfb3RjX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5yZXBheW1lbnRzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY3OTEtODlmZmI1MDItNWVlNS0xMWU3LThhNWItYzU5NTBiNjhhYzY1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5va2NvaW4uY29tL3YyJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5va2NvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20vcmVzdF9nZXRTdGFydGVkLmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubnBtanMuY29tL3BhY2thZ2Uvb2tjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2ViR2V0TWFya2V0c1Byb2R1Y3RzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRzW2ldWydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSB1cHBlcmNhc2Uuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0c1tpXVsnbWF4U2l6ZURpZ2l0J10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0c1tpXVsnbWF4UHJpY2VEaWdpdCddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldHNbaV0sXG4gICAgICAgICAgICAgICAgJ3R5cGUnOiAnc3BvdCcsXG4gICAgICAgICAgICAgICAgJ3Nwb3QnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmdXR1cmUnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRzW2ldWydtaW5UcmFkZVNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoIChtYXJrZXQpO1xuICAgICAgICAgICAgaWYgKCh0aGlzLmhhc0Z1dHVyZU1hcmtldHMpICYmIChtYXJrZXRbJ3F1b3RlJ10gPT0gJ1VTRFQnKSkge1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAobWFya2V0LCB7XG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6ICdVU0QnLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydiYXNlJ10gKyAnL1VTRCcsXG4gICAgICAgICAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXS5yZXBsYWNlICgndXNkdCcsICd1c2QnKSxcbiAgICAgICAgICAgICAgICAgICAgJ3R5cGUnOiAnZnV0dXJlJyxcbiAgICAgICAgICAgICAgICAgICAgJ3Nwb3QnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3B1YmxpY0dldCc7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKG1hcmtldFsnZnV0dXJlJ10pIHtcbiAgICAgICAgICAgI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HRpY2tlclsnaGlnaCddKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvdyddKSxcbiAgICAgICAgICAgICdiaWQnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2J1eSddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3NlbGwnXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2wnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHVibGljR2V0JztcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobWFya2V0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AgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKHRyYWRlWydhbW91bnQnXSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHVibGljR2V0JztcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobWFya2V0WydmdXR1cmUnXSkge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdGdXR1cmUnO1xuICAgICAgICAgICAgcmVxdWVzdFsnY29udHJhY3RfdHlwZSddID0gJ3RoaXNfd2Vlayc7IC8vIG5leHRfd2VlaywgcXVhcnRlclxuICAgICAgICB9XG4gICAgICAgIG1ldGhvZCArPSAnVHJhZGVzJztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9ITENWIChzeW1ib2wsIHRpbWVmcmFtZSA9ICcxbScsIHNpbmNlID0gdW5kZWZpbm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xhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlUG9zdCc7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0Z1dHVyZSc7XG4gICAgICAgICAgICBvcmRlciA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICdjb250cmFjdF90eXBlJzogJ3RoaXNfd2VlaycsIC8vIG5leHRfd2VlaywgcXVhcnRlclxuICAgICAgICAgICAgICAgICdtYXRjaF9wcmljZSc6IDAsIC8vIG1hdGNoIGJlc3QgY291bnRlciBwYXJ0eSBwcmljZT8gMCBvciAxLCBpZ25vcmVzIHByaWNlIGlmIDFcbiAgICAgICAgICAgICAgICAnbGV2ZXJfcmF0ZSc6IDEwLCAvLyBsZXZlcmFnZSByYXRlIHZhbHVlOiAxMCBvciAyMCAoMTAgYnkgZGVmYXVsdClcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAodHlwZSA9PSAnbGltaXQnKSB7XG4gICAgICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgICAgICAgICBvcmRlclsnYW1vdW50J10gPSBhbW91bnQ7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG9yZGVyWyd0eXBlJ10gKz0gJ19tYXJrZXQnO1xuICAgICAgICAgICAgICAgIGlmIChzaWRlID09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5zYWZlRmxvYXQgKHBhcmFtcywgJ2Nvc3QnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFvcmRlclsncHJpY2UnXSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYXJrZXQgYnV5IG9yZGVycyByZXF1aXJlIGFuIGFkZGl0aW9uYWwgY29zdCBwYXJhbWV0ZXIsIGNvc3QgPSBwcmljZSAqIGFtb3VudCcpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcGFyYW1zID0gdGhpcy5vbWl0IChwYXJhbXMsICdjb3N0Jyk7XG4gICAgICAgIG1ldGhvZCArPSAnVHJhZGUnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ29yZGVyX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZW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FydGlhbCc7XG4gICAgICAgIGlmIChzdGF0dXMgPT0gMilcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PSA0KVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHR5cGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgndHlwZScgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGlmICgob3JkZXJbJ3R5cGUnXSA9PSAnYnV5JykgfHwgKG9yZGVyWyd0eXBlJ10gPT0gJ3NlbGwnKSkge1xuICAgICAgICAgICAgICAgIHNpZGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnbGltaXQnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzaWRlID0gKG9yZGVyWyd0eXBlJ10gPT0gJ2J1eV9tYXJrZXQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnbWFya2V0JztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5wYXJzZU9yZGVyU3RhdHVzIChvcmRlclsnc3RhdHVzJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIG9yZGVyKVxuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3ltYm9sJ10gaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbb3JkZXJbJ3N5bWJvbCddXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdjcmVhdGVfZGF0ZScgaW4gb3JkZXIpXG4gICAgICAgICAgICB0aW1lc3RhbXAgPSBvcmRlclsnY3JlYXRlX2RhdGUnXTtcbiAgICAgICAgbGV0IGFtb3VudCA9IG9yZGVyWydhbW91bnQnXTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IG9yZGVyWydkZWFsX2Ftb3VudCddO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgYXZlcmFnZSA9IG9yZGVyWydhdmdfcHJpY2UnXTtcbiAgICAgICAgbGV0IGNvc3QgPSBhdmVyYWdlICogZmlsbGVkO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcl9pZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgIC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JzsgLy8gbmV4dF93ZWVrLCBxdWFydGVyXG4gICAgICAgICAgICBpZiAoIW9yZGVyX2lkX2luX3BhcmFtcylcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZmV0Y2hPcmRlcnMoKSByZXF1aXJlcyBvcmRlcl9pZCBwYXJhbSBmb3IgZnV0dXJlcyBtYXJrZXQgJyArIHN5bWJvbCArICcgKGEgc3RyaW5nIG9mIG9uZSBvciBtb3JlIG9yZGVyIGlkcywgY29tbWEtc2VwYXJhdGVkKScpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IHN0YXR1cyA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmICgndHlwZScgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICAgICAgc3RhdHVzID0gcGFyYW1zWyd0eXBlJ107XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCdzdGF0dXMnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgICAgIHN0YXR1cyA9IHBhcmFtc1snc3RhdHVzJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE9yZGVycygpIHJlcXVpcmVzIHR5cGUgcGFyYW0gb3Igc3RhdHVzIHBhcmFtIGZvciBzcG90IG1hcmtldCAnICsgc3ltYm9sICsgJyAoMCBvciBcIm9wZW5cIiBmb3IgdW5maWxsZWQgb3JkZXJzLCAxIG9yIFwiY2xvc2VkXCIgZm9yIGZpbGxlZCBvcmRlcnMpJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoc3RhdHVzID09ICdvcGVuJylcbiAgICAgICAgICAgICAgICBzdGF0dXMgPSAwO1xuICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSAnY2xvc2VkJylcbiAgICAgICAgICAgICAgICBzdGF0dXMgPSAxO1xuICAgICAgICAgICAgaWYgKG9yZGVyX2lkX2luX3BhcmFtcykge1xuICAgICAgICAgICAgICAgIG1ldGhvZCArPSAnT3JkZXJzSW5mbyc7XG4gICAgICAgICAgICAgICAgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCB7XG4gICAgICAgICAgICAgICAgICAgICd0eXBlJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBtZXRob2QgKz0gJ09yZGVySGlzdG9yeSc7XG4gICAgICAgICAgICAgICAgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCB7XG4gICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW50X3BhZ2UnOiAxLCAvLyBjdXJyZW50IHBhZ2UgbnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICdwYWdlX2xlbmd0aCc6IDIwMCwgLy8gbnVtYmVyIG9mIG9yZGVycyByZXR1cm5lZCBwZXIgcGFnZSwgbWF4aW11bSAyMDBcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcmFtcyA9IHRoaXMub21pdCAocGFyYW1zLCBbICd0eXBlJywgJ3N0YXR1cycgXSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJzIChyZXNwb25zZVsnb3JkZXJzJ10sIG1hcmtldCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcGVuT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyY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QnOiAnb2tleCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdPS0VYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdDTicsICdVUycgXSxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRnV0dXJlTWFya2V0cyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMyNTUyNzY4LTBkNmRkM2M2LWM0YTYtMTFlNy05MGY4LWMwNDNiNjQ3NTZhNy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cub2tleC5jb20vdjInLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vd3d3Lm9rZXguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3Lm9rZXguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lm9rZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3Lm9rZXguY29tL3Jlc3RfZ2V0U3RhcnRlZC5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IEV4Y2hhbmdlID0gcmVxdWlyZSAoJy4vYmFzZS9FeGNoYW5nZScpXG5jb25zdCB7IEV4Y2hhbmdl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nZS9kZXZlbG9wZXJzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3VudHJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9jaGFydHMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fY2hhcnRzL3tpZH0vZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVyY2hhbnQvZ2V0X3BheW1lbnQve1VVSUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9hZGRyZXNzZXMve2J0Y19hZGRyZXNzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzL3tVVUlEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcmljZV9hbGVydHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcGF5bWVudF9yZXF1ZXN0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcmljZV9hbGVydHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21lcmNoYW50L2NyZWF0ZV9wYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycy97VVVJRH0vY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnZXVyJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDU5LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwNTksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlciAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm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BhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdXJsICsgYm9keTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FwaS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQXBpLVNpZ25hdHVyZSc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLnNlY3JldCksXG4gICAgICAgICAgICAgICAgJ0FwaS1Ob25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcm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4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnNW0nOiAzMDAsXG4gICAgICAgICAgICAgICAgJzE1bSc6IDkwMCxcbiAgICAgICAgICAgICAgICAnMzBtJzogMTgwMCxcbiAgICAgICAgICAgICAgICAnMmgnOiA3MjAwLFxuICAgICAgICAgICAgICAgICc0aCc6IDE0NDAwLFxuICAgICAgICAgICAgICAgICcxZCc6IDg2NDAwLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY4MTctZTk0NTYzMTItNWVlNi0xMWU3LTliM2MtYjYyOGNhNTYyNmE1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3BvbG9uaWV4LmNvbS9wdWJsaWMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3BvbG9uaWV4LmNvbS90cmFkaW5nQXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3BvbG9uaWV4LmNvbS9zdXBwb3J0L2FwaS8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cDovL3Bhc3RlYmluLmNvbS9kTVg3bVpFMCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3BvbG9uaWV4LmNvbS9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuMjRoVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5DaGFydERhdGEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkN1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkxvYW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5UcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsTG9hbk9mZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2xvc2VNYXJnaW5Qb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlTG9hbk9mZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZW5lcmF0ZU5ld0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE1hcmdpblBvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5CdXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpblNlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21vdmVPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQWN0aXZlTG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkF2YWlsYWJsZUFjY291bnRCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkNvbXBsZXRlQmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkRlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkRlcG9zaXRzV2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkZlZUluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkxlbmRpbmdIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5NYXJnaW5BY2NvdW50U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuT3BlbkxvYW5PZmZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9yZGVyVHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5UcmFkYWJsZUJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5UcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RvZ2dsZUF1dG9SZW5ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJCYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDE1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IDAuMCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAuMDAwMDAwMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCBrZXkgPSAncXVvdGUnO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAqIHJhdGUpKTtcbiAgICAgICAgaWYgKHNpZGUgPT0gJ3NlbGwnKSB7XG4gICAgICAgICAgICBjb3N0ICo9IHByaWNlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAga2V5ID0gJ2Jhc2UnO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndHlwZSc6IHRha2VyT3JNYWtlcixcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFtrZXldLFxuICAgICAgICAgICAgJ3JhdGUnOiByYXRlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0ICh0aGlzLmZlZVRvUHJlY2lzaW9uIChzeW1ib2wsIGNvc3QpKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQlRNJylcbiAgICAgICAgICAgIHJldHVybiAnQml0bWFyayc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBjdXJyZW5jeUlkIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JpdG1hcmsnKVxuICAgICAgICAgICAgcmV0dXJuICdCVE0nO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgcGFyc2VPSExDViAob2hsY3YsIG1hcmtldCA9IHVuZGVmaW5lZCwgdGltZWZyYW1lID0gJzVtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgIC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gdGhpcy5wYXJzZU9ITENWcyAocmVzcG9uc2UsIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRSZXR1cm5UaWNrZXIgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1twXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIHF1b3RlLCBiYXNlIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdsb3QnOiB0aGlzLmxpbWl0c1snYW1vdW50J11bJ21pbiddLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0UmV0dXJuQ29tcGxldGVCYWxhbmNlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdhY2NvdW50JzogJ2FsbCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpZF07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydvbk9yZGVycyddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgIC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AwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2lkXTtcbiAgICAgICAgICAgIC8vIHRvZG86IHdpbGwgbmVlZCB0byByZXRoaW5rIHRoZSBmZWVzXG4gICAgICAgICAgICAvLyB0byBhZGQgc3VwcG9ydCBmb3IgbXVsdGlwbGUgd2l0aGRyYXdhbC9kZXBvc2l0IG1ldGhvZHMgYW5kXG4gICAgICAgICAgICAvLyBkaWZmZXJlbnRpYXRlZCBmZWVzIGZvciBlYWNoIHBhcnRpY3VsYXIgbWV0aG9kXG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LCAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoY3VycmVuY3lbJ2RlbGlzdGVkJ10gPT0gMCk7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gKGN1cnJlbmN5WydkaXNhYmxlZCddKSA/ICdkaXNhYmxlZCcgOiAnb2snO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd0eEZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsndHhGZWUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICA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J2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGxldCByYXRlID0gcGFyc2VGbG9hdCAodHJhZGVbJ2ZlZSddKTtcbiAgICAgICAgICAgIGxldCBmZWVDb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKHNpZGUgPT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgICAgIGZlZUNvc3QgPSBhbW91bnQgKiByYXRlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgIT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIGZlZUNvc3QgPSBjb3N0ICogcmF0ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAncmF0ZSc6IHJhdGUsXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ3RyYWRlSUQnKSxcbi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Vsc2Uge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgICAgIGxldCB0cmFkZXMgPSB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZVtpZF0sIG1hcmtldCk7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgdHJhZGVzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAodHJhZGVzW2pdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZUludGVnZXIgKG9yZGVyLCAndGltZXN0YW1wJyk7XG4gICAgICAgIGlmICghdGltZXN0YW1wKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydkYXRlJ10pO1xuICAgICAgICBsZXQgdHJhZGVzID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3Jlc3VsdGluZ1RyYWRlcycgaW4gb3JkZXIpXG4gICAgICAgICAgICB0cmFkZXMgPSB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsncmVzdWx0aW5nVHJhZGVzJ10sIG1hcmtldCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgcHJpY2UgPSBwYXJzZUZsb2F0IChvcmRlclsncHJpY2UnXSk7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndG90YWwnLCAwLjApO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdzdGFydGluZ0Ftb3VudCcsIHJlbWFpbmluZyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyTnVtYmVyJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IG9yZGVyWydzdGF0dXMnXSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICA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AgICAgIGxldCBwYWlyID0gbWFya2V0ID8gbWFya2V0WydpZCddIDogJ2FsbCc7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RSZXR1cm5PcGVuT3JkZXJzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcic6IHBhaXIsXG4gICAgICAgIH0pKTtcbiAgICAgICAgbGV0IG9wZW5PcmRlcnMgPSBbXTtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgb3Blbk9yZGVycyA9IHRoaXMucGFyc2VPcGVuT3JkZXJzIChyZXNwb25zZSwgbWFya2V0LCBvcGVuT3JkZXJzKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZHMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRJZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgbWFya2V0SWQgPSBtYXJrZXRJZHNbaV07XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVycyA9IHJlc3BvbnNlW21hcmtldElkXTtcbiAgICAgICAgICAgICAgICBsZXQgbSA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgICAgICAgICAgb3Blbk9yZGVycyA9IHRoaXMucGFyc2VPcGVuT3JkZXJzIChvcmRlcnMsIG0sIG9wZW5PcmRlcnMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgb3Blbk9yZGVycy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgdGhpcy5vcmRlcnNbb3Blbk9yZGVyc1tqXVsnaWQnXV0gPSBvcGVuT3JkZXJzW2pdO1xuICAgICAgICB9XG4gICAgICAgIGxldCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWQgPSB0aGlzLmluZGV4QnkgKG9wZW5PcmRlcnMsICdpZCcpO1xuICAgICAgICBsZXQgY2FjaGVkT3JkZXJJZHMgPSBPYmplY3Qua2V5cyAodGhpcy5vcmRlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwgY2FjaGVkT3JkZXJJZHMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGNhY2hlZE9yZGVySWRzW2tdO1xuICAgICAgICAgICAgaWYgKGlkIGluIG9wZW5PcmRlcnNJbmRleGVkQnlJZCkge1xuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kICh0aGlzLm9yZGVyc1tpZF0sIG9wZW5PcmRlcnNJbmRleGVkQnlJZFtpZF0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzdGF0dXMnXSA9PSAnb3BlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ2Nsb3NlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IG9yZGVyWydhbW91bnQnXSAqIG9yZGVyWydwcmljZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxlZCc6IG9yZGVyWydhbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZW1haW5pbmcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBvcmRlciA9IHRoaXMub3JkZXJzW2lkXTtcbiAgICAgICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgICAgICBpZiAob3JkZXJbJ3N5bWJvbCddID09IHN5bWJvbClcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG9yZGVyKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG9yZGVyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlcnMgPSBhd2FpdCB0aGlzLmZldGNoT3JkZXJzIChzeW1ib2wsIHBhcmFtcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAob3JkZXJzW2ldWydpZCddID09IGlkKVxuICAgICAgICAgICAgICAgIHJldHVybiBvcmRlcnNbaV07XG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgT3JkZXJOb3RDYWNoZWQgKHRoaXMuaWQgKyAnIG9yZGVyIGlkICcgKyBpZC50b1N0cmluZyAoKSArICcgbm90IGZvdW5kIGluIGNhY2hlJyk7XG4gICAgfVxuXG4gICAgZmlsdGVyT3JkZXJzQnlTdGF0dXMgKG9yZGVycywgc3RhdHVzKSB7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvcmRlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmIChvcmRlcnNbaV1bJ3N0YXR1cyddID09IHN0YXR1cylcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAob3JkZXJzW2ldKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1c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mljZSA9IHBhcnNlRmxvYXQgKHByaWNlKTtcbiAgICAgICAgYW1vdW50ID0gcGFyc2VGbG9hdCAoYW1vdW50KTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdyYXRlJzogdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9LCByZXNwb25zZSksIG1hcmtldCk7XG4gICAgICAgIGxldCBpZCA9IG9yZGVyWydpZCddO1xuICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIHRoaXMuZXh0ZW5kICh7ICdpbmZvJzogcmVzcG9uc2UgfSwgb3JkZXIpO1xuICAgIH1cblxuICAgIGFzeW5jIGVkaXRPcmRlciAoaWQsIHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgcHJpY2UgPSBwYXJzZUZsb2F0IChwcmljZSk7XG4gICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKGFtb3VudCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ29yZGVyTnVtYmVyJzogaWQsXG4gICAgICAgICAgICAncmF0ZSc6IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgICAgICAnYW1vdW50JzogdGhpcy5hbW91bnRUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQpLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0TW92ZU9yZGVyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCByZXN1bHQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChpZCBpbiB0aGlzLm9yZGVycykge1xuICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gdGhpcy5leHRlbmQgKHRoaXMub3JkZXJzW2lkXSwge1xuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJlc3VsdCA9IHRoaXMuZXh0ZW5kICh0aGlzLm9yZGVyc1tpZF0sIHsgJ2luZm8nOiByZXNwb25zZSB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IHtcbiAgICAgICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlck51bWJlciddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc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A9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IGVycm9yID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgbGV0IGZhaWxlZCA9IHJlc3BvbnNlWydlcnJvciddLmluZGV4T2YgKCdOb3QgZW5vdWdoJykgPj0gMDtcbiAgICAgICAgICAgIGlmIChmYWlsZWQpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzIChlcnJvcik7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhj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AgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwOTUzOTE1LWIxNjExZGMwLWE0MzYtMTFlNy04OTQ3LWM5NWJkNWE0MjA4Ni5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkucXJ5cHRvcy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cucXJ5cHRvcy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kZXZlbG9wZXJzLnF1b2luZS5jb20nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9wcmljZV9sZXZlbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2lyX2xhZGRlcnMve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG9fYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbnMvbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpYXRfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5fYmlkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfS9sb2FucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdF9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5fYmlkcy97aWR9L2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2Fucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0vY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tpZH0vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9jbG9zZV9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdfYWNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2Jhc2VfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGVkX2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gcGFyc2VGbG9hdCAobWFya2V0WydtYWtlcl9mZWUnXSk7XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSBwYXJzZUZsb2F0IChtYXJrZXRbJ3Rha2VyX2ZlZSddKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAhbWFya2V0WydkaXNhYmxlZCddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRzQmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2JhbGFuY2UnXSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHRvdGFsLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHRvdGFsLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJ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iAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoX21hcmtldF9hc2snXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3dfbWFya2V0X2JpZCddKSxcbiAgICAgICAgICAgICdiaWQnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ21hcmtldF9iaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydtYXJrZXRfYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbHVtZV8yNGgnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbi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gICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRyYWRlWydjcmVhdGVkX2F0J10gKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWyd0YWtlcl9zaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsncHJpY2UnXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAodHJhZGVbJ3F1YW50aXR5J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdwcm9kdWN0X2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobGltaXQpXG4gICAgICAgICAgICByZXF1ZXN0WydsaW1pdCddID0gbGltaXQ7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0RXhlY3V0aW9ucyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbJ21vZGVscyddLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdvcmRlcl90eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdwcm9kdWN0X2lkJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdxdWFudGl0eSc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT0gJ2xpbWl0JylcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlcnMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXIocmVzcG9uc2UpO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2F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gICAnaWQnOiBvcmRlclsnaWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWydvcmRlcl90eXBlJ10sXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IGFtb3VudCAtIGZpbGxlZCxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzoge1xuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAnY29zdCc6IHBhcnNlRmxvYXQgKG9yZGVyWydvcmRlcl9mZWUnXSksXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlcnNJZCAoeyAnaWQnOiBpZCB9KTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlciAob3JkZXIpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNl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AgICAgICAgICBpZiAocmVzcG9uc2VbJ21lc3NhZ2UnXSA9PSAnT3JkZXIgbm90IGZvdW5kJykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChjb2RlID09IDQyMikge1xuICAgICAgICAgICAgaWYgKCdlcnJvcnMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGVycm9ycyA9IHJlc3BvbnNlWydlcnJvcnMnXTtcbiAgICAgICAgICAgICAgICBpZiAoJ3VzZXInIGluIGVycm9ycykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZXMgPSBlcnJvcnNbJ3VzZXInXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2VzLmluZGV4T2YgKCdub3RfZW5vdWdoX2ZyZWVfYmFsYW5jZScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAnWC1RdW9pbmUtQVBJLVZlcnNpb24nOiB0aGlzLnZlcnNpb24sXG4gICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAncGF0aCc6IHVybCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAndG9rZW5faWQnOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnaWF0JzogTWF0aC5mbG9vciAobm9uY2UgLyAxMDAwKSwgLy8gaXNzdWVk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AgICAgICAgICAndmVyc2lvbic6ICd2MicsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAvLyBvYnNvbGV0ZSBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjgyNS05OGE2ZDBkZS01ZWU3LTExZTctOWZhNC0zOGUxMWEyYzZmNTIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLnF1YWRyaWdhY3guY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnF1YWRyaWdhY3guY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnF1YWRyaWdhY3guY29tL2FwaV9pbmZvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldGhlcl9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvb2t1cF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQ0FEJzogeyAnaWQnOiAnYnRjX2NhZCcsICdzeW1ib2wnOiAnQlRDL0NBRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdDQUQnLCAnbWFrZXInOiAwLjAwNSwgJ3Rha2VyJzogMC4wMDUgfSxcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J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AgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY3kudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VzW2xvd2VyY2FzZSArICdfYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogcGFyc2VGbG9hdCAoYmFsYW5jZXNbbG93ZXJjYXNlICsgJ19yZXNlcnZlZCddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlc1tsb3dlcmNhc2UgKyAnX2JhbGFuY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdib29rJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAob3JkZXJib29rWyd0aW1lc3RhbXAnXSkgKiAxMDAwO1xuICAgICAgICByZXR1c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XG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnN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S0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBzb3V0aHhjaGFuZ2UgZXh0ZW5kcyBFeGNoYW5nZSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnc291dGh4Y2hhbmdlJyxcbiAgICAgICAgICAgICduYW1lJzogJ1NvdXRoWGNoYW5nZScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0FSJywgLy8gQXJnZW50aW5hXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3ODM4OTEyLTRmOTRlYzhhLTYwZjYtMTFlNy05ZTVkLWJiZjliZDUwYTU1OS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuc291dGh4Y2hhbmdlLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuc291dGh4Y2hhbmdlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tL0hvbWUvQXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2Uve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxNYXJrZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZW5lcmF0ZW5ld2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGxhY2VPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbMF07XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbMV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGlkID0gc3ltYm9sO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0TGlzdEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydBdmFpbGFibGUnXSk7XG4gICAgICAgICAgICBsZXQgdXNlZCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ1VuY29uZmlybWVkJ10pO1xuICAgICAgICAgICAgbGV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ldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJpY2VzIChwYXJhbXMpO1xuICAgICAgICBsZXQgdGlja2VycyA9IHRoaXMuaW5kZXhCeSAocmVzcG9uc2UsICdNYXJrZXQnKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJpY2VTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgIC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N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdsaXN0aW5nQ3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgICAgICdyZWZlcmVuY2VDdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsnbGltaXRQcmljZSddID0gcHJpY2U7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RQbGFjZU9yZGVyICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1c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YXBpLnRoZXJvY2t0cmFkaW5nLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RoZXJvY2t0cmFkaW5nLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLnRoZXJvY2t0cmFkaW5nLmNvbS9kb2MvdjEvaW5kZXguaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS50aGVyb2NrdHJhZGluZy5jb20vZG9jLycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMvdGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGlzY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkaXNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9wb3NpdGlvbl9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9ucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19saW1pdHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfbGltaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXRtcy93aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3JlbW92ZV9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEZ1bmRzVGlja2VycyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ3RpY2tlcnMnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3RpY2tlcnMnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnZnVuZF9pZCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgIC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JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAob3JkZXJib29rWydkYXRlJ10pO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXAsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnYW1vdW50Jyk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodGlja2VyWydkYXRlJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogcGFyc2VGbG9hdCAodGlja2VyW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m1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0RnVuZHNJZFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnZnVuZF9pZCddXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnZGF0ZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW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ICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdXJsO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1UUlQtS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1gtVFJULU5PTkNFJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ1gtVFJULVNJR04nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdhcHBsaWNhdGlvbi9qc29uJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgb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tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIHZhdWx0b3JvIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3ZhdWx0b3JvJyxcbiAgICAgICAgICAgICduYW1lJzogJ1ZhdWx0b3JvJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ0gnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICcxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY4ODAtZjIwNWU4NzAtNWVlOS0xMWU3LThmZTItMGQ1YjE1ODgwNzUyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS52YXVsdG9yby5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudmF1bHRvcm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYXBpLnZhdWx0b3JvLmNvbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpZGFuZGFzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXRlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdHRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMvZGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMvaG91cicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zL21vbnRoJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkve3N5bWJvbH0ve3R5cGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbC97c3ltYm9sfS97dHlwZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV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Nlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5X2NvZGUnXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBmcmVlID0gYmFsYW5jZVsnY2FzaCddO1xuICAgICAgICAgICAgbGV0IHVzZWQgPSBiYWxhbmNlWydyZXNlcnZlZCddO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gdGhpcy5zdW0gKGZyZWUsIHVzZWQpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rIChwYXJhbXMpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiByZXNwb25zZVsnZGF0YSddWzBdWydiJ10sXG4gICAgICAgICAgICAnYXNrcyc6IHJlc3BvbnNlWydkYXRhJ11bMV1bJ3MnXSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcyc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AgICAgICdhc2snOiBhc2tbMF0sXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ0xhc3RQcmljZSddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJzI0aFZvbHVtZSddKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnVGltZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmV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ICAgICAgICdwcmljZSc6IHByaWNlIHx8IDEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydkYXRhJ11bJ09yZGVyX0lEJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VsSWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHBhdGg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAg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S0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3Mgdmlyd294IGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3ZpcndveCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdWaXJXb1gnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0FUJywgJ0VVJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODk0LTZkYTlkMzYwLTVlZWEtMTFlNy05MGFhLTQxZjI3MTFiNzQwNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cDovL2FwaS52aXJ3b3guY29tL2FwaS9qc29uLnBocCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LnZpcndveC5jb20vYXBpL3RyYWRpbmcucGhwJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudmlyd294LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy52aXJ3b3guY29tL2RldmVsb3BlcnMucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2xvZ2luJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncGFzc3dvcmQnOiB0cnVlXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluc3RydW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRCZXN0UHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRNYXJrZXREZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXN0aW1hdGVNYXJrZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhZGVkUHJpY2VWb2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFJhd1RyYWRlRGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0U3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VGVybWluYWxMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRHcmlkTGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0R3JpZFN0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmVzdFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TWFya2V0RGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2VzdGltYXRlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYWRlZFByaWNlVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRSYXdUcmFkZURhdGEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFN0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRlcm1pbmFsTGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0R3JpZExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q29tbWlzc2lvbkRpc2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGxhY2VPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q29tbWlzc2lvbkRpc2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGxhY2VPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJbnN0cnVtZW50cyAoKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0c1sncmVzdWx0J10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3Jlc3VsdCddW2tleXNbcF1dO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpbnN0cnVtZW50SUQnXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2xvbmdDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydzaG9ydEN1cnJlbmN5J107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRo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gICAgJ2luc3RydW1lbnQnOiBzeW1ib2wsXG4gICAgICAgICAgICAnZW5kRGF0ZSc6IHRoaXMuWW1kSE1TIChlbmQpLFxuICAgICAgICAgICAgJ3N0YXJ0RGF0ZSc6IHRoaXMuWW1kSE1TIChzdGFydCksXG4gICAgICAgICAgICAnSExPQyc6IDEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgbWFya2V0UHJpY2UgPSBhd2FpdCB0aGlzLmZldGNoTWFya2V0UHJpY2UgKHN5bWJvbCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsncmVzdWx0J11bJ3ByaWNlVm9sdW1lTGlzdCddO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IGxlbmd0aCA9IGtleXMubGVuZ3RoO1xuICAgICAgICBsZXQgbGFzdEtleSA9IGtleXNbbGVuZ3RoIC0gMV07XG4gICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2xhc3RLZXldO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IG1hcmtldFByaWNlWydiaWQnXSxcbiAgICAgICAgICAgICdhc2snOiBtYXJrZXRQcmljZVsnYXNrJ10sXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCx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cbiAgICAgICAgbGV0IGF1dGggPSB7fTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYXV0aFsna2V5J10gPSB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIGF1dGhbJ3VzZXInXSA9IHRoaXMubG9naW47XG4gICAgICAgICAgICBhdXRoWydwYXNzJ10gPSB0aGlzLnBhc3N3b3JkO1xuICAgICAgICB9XG4gICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgIH0sIGF1dGgsIHBhcmFtcykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiB0aGlzLmV4dGVuZCAoYXV0aCwgcGFyYW1zKSxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZC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AgICAgICAgJ25hbWUnOiAnV0VYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnTlonLCAvLyBOZXcgWmVhbGFuZFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMycsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwNjUyNzUxLWQ3NGVjOGY4LTllMzEtMTFlNy05OGM1LTcxNDY5ZmNlZjAzZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93ZXgubnovYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93ZXgubnovdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd2V4Lm56JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93ZXgubnovYXBpLzMvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3dleC5uei90YXBpL2RvY3MnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvaW5EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVDb3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZGVlbUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd1cGRhdGVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2VsbCcpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0JyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhdmcnKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbF9jdXInKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA9PSAyMDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdICE9ICd7Jykge1xuICAgICAgICAgICAgICAgIC8vIHJlc3BvbnNlIGlzIG5vdCBKU09OXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHJldHVybmVkIGEgbm9uLUpTT04gcmVwbHk6ICcgKyBib2R5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgZXJyb3IgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdlcnJvcicpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmV0dXJuZWQgYSBtYWxmb3JtZWQgZXJyb3I6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAnYmFkIHN0YXR1cycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yLmluZGV4T2YgKCdJdCBpcyBub3QgZW5vdWdoJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzICh0aGlzLmlkICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09ICdSZXF1ZXN0cyB0b28gb2Z0ZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gJ25vdCBhdmFpbGFibGUnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gJ2V4dGVybmFsIHNlcnZpY2UgdW5hdmFpbGFibGUnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIC8vIHRoYXQncyB3aGF0IGZldGNoT3Blbk9yZGVycyByZXR1cm4gaWYgbm8gb3BlbiBvcmRlcnMgKGZpeCBmb3IgIzQ4OSlcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciAhPSAnbm8gb3JkZXJzJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiA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XG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzUHVibGljQVBJJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODA1OTQxNC1lMjM1OTcwYy02NjJjLTExZTctOGMzYS0wOGUzMWY3ODY4NGIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY3J5cHRvdHRsaXZld2ViYXBpLnhidGNlLm5ldDo4NDQzL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy54YnRjZS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy54YnRjZS5jb20vdHJhZGVhcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LnhidGNlLmluZm8vS25vd2xlZGdlYmFzZS9BcnRpY2xlL1ZpZXcvNTIvMjUveGJ0Y2UtZXhjaGFuZ2UtYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd1aWQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3kve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGV2ZWwyL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2FzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9iaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS9sZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2sve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNlc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXJ2ZXJpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNlc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeS97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXZlbDIve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhc3NldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXNzZXQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2FzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2svaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9iaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS9sZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS9sZXZlbDIvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3BlcmlvZGljaXRpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3RpY2tzL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvY2FjaGUve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2JpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L2NhY2hlL3tzeW1ib2x9L2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L2NhY2hlL3tzeW1ib2x9L3RpY2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkvc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3ZlcnNpb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFN5bWJvbCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydTeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydNYXJnaW5DdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydQcm9maXRDdXJyZW5jeSddO1xuICAgICAgICAgICAgaWYgKGJhc2UgPT0gJ0RTSCcpXG4gICAgICAgICAgICAgICAgYmFzZSA9ICdEQVNIJztcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ0lzVHJhZGVBbGxvd2VkJ10gPyBzeW1ib2wgOiBpZDtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QXNzZXQgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ0N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAvLyB4YnRjZSBuYW1lcyBEQVNIIGluY29ycmVjdGx5IGFzIERTSFxuICAgICAgICAgICAgaWYgKHVwcGVyY2FzZSA9PSAnRFNIJylcbiAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ0ZyZWVBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ0xvY2tlZEFtb3VudCddLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ0Ftb3VudCddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFt1cHBlcmNhc2VdID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhb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N0YW1wJyBpbiB0aWNrZXIpXG4gICAgICAgICAgICBpZiAodGltZXN0YW1wIDwgdGlja2VyWydMYXN0U2VsbFRpbWVzdGFtcCddKSB7XG4gICAgICAgICAgICAgICAgdGltZXN0YW1wID0gdGlja2VyWydMYXN0U2VsbFRpbWVzdGFtcCddO1xuICAgICAgICAgICAgICAgIGxhc3QgPSB0aWNrZXJbJ0xhc3RTZWxsUHJpY2UnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgaWYgKCF0aW1lc3RhbXApXG4gICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyWydEYWlseUJlc3RCdXlQcmljZSddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnRGFpbHlCZXN0U2VsbFByaWNlJ10sXG4gICAgICAgICAgICAnYmlkJzogdGlja2VyWydCZXN0QmlkJ10sXG4gICAgICAgICAgICAnYXNrJzogdGlja2VyWydCZXN0QXNrJ10sXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRpY2tlclsnRGFpbHlUcmFkZWRUb3RhbFZvbHVtZSddLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICB0aWNrZXJzID0gdGhpcy5pbmRleEJ5ICh0aWNrZXJzLCAnU3ltYm9sJyk7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgICAgIGlmIChiYXNlID09ICdEU0gnKVxuICAgICAgICAgICAgICAgICAgICBiYXNlID0gJ0RBU0gnO1xuICAgICAgICAgICAgICAgIGlmIChxdW90ZSA9PSAnRFNIJylcbiAgICAgICAgICAgICAgICAgICAgcXVvdGUgPSAnREFTSCc7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaWRdO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJGaWx0ZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnZmlsdGVyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGxlbmd0aCA9IHRpY2tlcnMubGVuZ3RoO1xuICAgICAgICBpZiAobGVuZ3RoIDwgMSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaFRpY2tlciByZXR1cm5lZCBlbXB0eSByZXNwb25zZSwgeEJUQ2UgcHVibGljIEFQSS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Y2NlcHQtRW5jb2RpbmcnOiAnZ3ppcCwgZGVmbGF0ZScgfTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdhcHBsaWNhdGlvbi9qc29uJztcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB0aGlzLnVpZCArIHRoaXMuYXBpS2V5ICsgbWV0aG9kICsgdXJsO1xuICAgICAgICAgICAgaWYgKGJvZHkpXG4gICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2JywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgbGV0IGNyZWRlbnRpYWxzID0gdGhpcy51aWQgKyAnOicgKyB0aGlzLmFwaUtleSArICc6JyArIG5vbmNlICsgJzonICsgdGhpcy5iaW5hcnlUb1N0cmluZyAoc2lnbmF0dXJlKTtcbiAgICAgICAgICAgIGhlYWRlcnNbJ0F1dGhvcml6YXRpb24nXSA9ICdITUFDICcgKyBjcmVkZW50aWFscztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0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gICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2OTEwLWNkY2JmZGFlLTVlZWEtMTFlNy05ODU5LTAzZmVhODczMjcyZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly95b2JpdC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly95b2JpdC5uZXQvdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnlvYml0Lm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy55b2JpdC5uZXQvZW4vYXBpLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWN0aXZlT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVySW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDb2luc1RvQWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiAwLjAsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGxldCBzdWJzdGl0dXRpb25zID0ge1xuICAgICAgICAgICAgJ0FJUic6ICdBaXJDb2luJyxcbiAgICAgICAgICAgICdBTkknOiAnQU5JQ29pbicsXG4gICAgICAgICAgICAnQU5UJzogJ0FudHNDb2luJyxcbiAgICAgICAgICAgICdBVE0nOiAnQXV0dW1uY29pbicsXG4gICAgICAgICAgICAnQkNDJzogJ0JDSCcsXG4gICAgICAgICAgICAnQlRTJzogJ0JpdHNoYXJlczInLFxuICAgICAgICAgICAgJ0RDVCc6ICdEaXNjb3VudCcsXG4gICAgICAgICAgICAnREdEJzogJ0RhcmtHb2xkQ29pbicsXG4gICAgICAgICAgICAnSUNOJzogJ2lDb2luJyxcbiAgICAgICAgICAgICdMSVpJJzogJ0xpWmknLFxuICAgICAgICAgICAgJ0xVTic6ICdMdW5hckNvaW4nLFxuICAgICAgICAgICAgJ05BVic6ICdOYXZham9Db2luJyxcbiAgICAgICAgICAgICdPTUcnOiAnT01HYW1lJyxcbiAgICAgICAgICAgICdQQVknOiAnRVBBWScsXG4gICAgICAgICAgICAnUkVQJzogJ1JlcHVibGljb2luJyxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKGN1cnJlbmN5IGluIHN1YnN0aXR1dGlvbnMpXG4gICAgICAgICAgICByZXR1cm4gc3Vic3RpdHV0aW9uc1tjdXJyZW5jeV07XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBjdXJyZW5jeUlkIChjb21tb25Db2RlKSB7XG4gICAgICAgIGxldCBzdWJzdGl0dXRpb25zID0ge1xuICAgICAgICAgICAgJ0FpckNvaW4nOiAnQUlSJyxcbiAgICAgICAgICAgICdBTklDb2luJzogJ0FOSScsXG4gICAgICAgICAgICAnQW50c0NvaW4nOiAnQU5UJyxcbiAgICAgICAgICAgICdBdXR1bW5jb2luJzogJ0FUTScsXG4gICAgICAgICAgICAnQkNIJzogJ0JDQycsXG4gICAgICAgICAgICAnQml0c2hhcmVzMic6ICdCVFMnLFxuICAgICAgICAgICAgJ0Rpc2NvdW50JzogJ0RDVCcsXG4gICAgICAgICAgICAnRGFya0dvbGRDb2luJzogJ0RHRCcsXG4gICAgICAgICAgICAnaUNvaW4nOiAnSUNOJyxcbiAgICAgICAgICAgICdMaVppJzogJ0xJWkknLFxuICAgICAgICAgICAgJ0x1bmFyQ29pbic6ICdMVU4nLFxuICAgICAgICAgICAgJ05hdmFqb0NvaW4nOiAnTkFWJyxcbiAgICAgICAgICAgICdPTUdhbWUnOiAnT01HJyxcbiAgICAgICAgICAgICdFUEFZJzogJ1BBWScsXG4gICAgICAgICAgICAnUmVwdWJsaWNvaW4nOiAnUkVQJyxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKGNvbW1vbkNvZGUgaW4gc3Vic3RpdHV0aW9ucylcbiAgICAgICAgICAgIHJldHVybiBzdWJzdGl0dXRpb25zW2NvbW1vbkNvZGVdO1xuICAgICAgICByZXR1cm4gY29tbW9uQ29kZTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmV0dXJuJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IHNpZGVzID0geyAnZnJlZSc6ICdmdW5kcycsICd0b3RhbCc6ICdmdW5kc19pbmNsX29yZGVycycgfTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAoc2lkZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2ldO1xuICAgICAgICAgICAgbGV0IHNpZGUgPSBzaWRlc1trZXldO1xuICAgICAgICAgICAgaWYgKHNpZGUgaW4gYmFsYW5jZXMpIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlc1tzaWRlXSk7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBjdXJyZW5jaWVzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBsb3dlcmNhc2UgPSBjdXJyZW5jaWVzW2pdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gbG93ZXJjYXNlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAodXBwZXJjYXNlKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiByZXN1bHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnQgPSByZXN1bHRbY3VycmVuY3ldO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBhY2NvdW50W2tleV0gPSBiYWxhbmNlc1tzaWRlXVtsb3dlcmNhc2VdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYWNjb3VudFsndG90YWwnXSAmJiBhY2NvdW50WydmcmVlJ10pXG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZURlcG9zaXRBZGRyZXNzIChjdXJyZW5jeSwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaERlcG9zaXRBZGRyZXNzIChjdXJyZW5jeSwgdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICduZWVkX25ldyc6IDEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAnYWRkcmVzcyc6IHJlc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XG4gICAgICAgICAgICAnY29pbk5hbWUnOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydlcnJvciddLmluZGV4T2YgKCdJbnN1ZmZpY2llbnQgZnVuZHMnKSA+PSAwKSB7IC8vIG5vdCBlbm91Z1RoIGlzIGEgdHlwbyBpbnNpZGUgTGlxdWkncyBvd24gQVBJLi4uXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3BvbnNlWydlcnJvciddID09ICdSZXF1ZXN0cyB0b28gb2Z0ZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICc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gICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YyJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMTIwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzcyMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICczZCc6ICc0MzIwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjg1NzA1NDgtNGQ2NDZjNDAtNzE0Ny0xMWU3LTljZjYtODM5YjkzZTZkNjIyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuanNvbicsIC8vIGRlZmF1bHQgZXh0ZW5zaW9uIGFwcGVuZGVkIHRvIGVuZHBvaW50IFVSTHNcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8veXVuYmkuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8veXVuYmkuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly95dW5iaS5jb20vZG9jdW1lbnRzL2FwaS9ndWlkZScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3l1bmJpLmNvbS9zd2FnZ2VyLycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2Vycy97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna193aXRoX3BlbmRpbmdfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lc3RhbXAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Nlcy97YWRkcmVzc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhcnRuZXJzL29yZGVycy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVtYmVycy9tZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvbXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZWxldGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL211bHRpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvY2xlYXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5jb25zdCBFeGNoYW5nZSA9IHJlcXVpcmUgKCcuL2Jhc2UvRXhjaGFuZ2UnKVxuY29uc3QgeyBFeGNoYW5nZUVycm9yIH0gPSByZXF1aXJlICgnLi9iYXNlL2Vycm9ycycpXG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyB6YWlmIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3phaWYnLFxuICAgICAgICAgICAgJ25hbWUnOiAnWmFpZicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0pQJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY5MjctMzljYTJhZGEtNWVlYi0xMWU3LTk3MmYtMWI0MTk5NTE4Y2E2LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS56YWlmLmpwJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vemFpZi5qcCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly90ZWNoYnVyZWF1LWFwaS1kb2N1bWVudC5yZWFkdGhlZG9jcy5pby9qYS9sYXRlc3QvaW5kZXguaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NvcnAuemFpZi5qcC9hcGktZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NvcnAuemFpZi5qcC9hcGktZG9jcy9hcGlfbGlua3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubnBtanMuY29tL3BhY2thZ2UvemFpZi5qcCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20veW91MjE5Nzkvbm9kZS16YWlmJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfcGFpcnMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeV9wYWlycy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhc3RfcHJpY2Uve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2lkX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfaW5mbzInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9wZXJzb25hbF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2VjYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVJbnZvaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbnZvaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbnZvaWNlSWRzQnlPcmRlck51bWJlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsSW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndGxhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZV9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhbmdlX3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfcG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2ZhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JvdXBzL3tncm91cF9pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhc3RfcHJpY2Uve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97Z3JvdXBfaWR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tncm91cF9pZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97Z3JvdXBfaWR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeVBhaXJzQWxsICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2N1cnJlbmN5X3BhaXInXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmV0dXJuJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZXNbJ2Z1bmRzJ10pO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzWydmdW5kcyddW2N1cnJlbmN5XTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmICgnZGVwb3NpdCcgaW4gYmFsYW5jZXMpIHtcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZXNbJ2RlcG9zaXQnXSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gYmFsYW5jZXNbJ2RlcG9zaXQnXVtjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aFBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJQYWlyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgdndhcCA9IHRpY2tlclsndndhcCddO1xuICAgICAgICBsZXQgYmFzZVZvbHVtZSA9IHRpY2tlclsndm9sdW1lJ107XG4gICAgICAgIGxldCBxdW90ZVZvbHVtZSA9IGJhc2VWb2x1bWUgKiB2d2FwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnaGlnaCddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnbG93J10sXG4gICAgICAgICAgICAnYmlkJzogdGlja2VyWydiaWQnXSxcbiAgICAgICAgICAgICdhc2snOiB0aWNrZXJbJ2FzayddLFxuICAgICAgICAgICAgJ3Z3YXAnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRpY2tlclsnbGFzdCddLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNpZGUgPSAodHJhZGVbJ3RyYWR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LnB1YmxpY0dldFRyYWRlc1BhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2FjdGlvbic6IChzaWRlID09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXR1cm4nXVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdvcmRlcl9pZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKG9yZGVyWydhY3Rpb24nXSA9PSAnYmlkJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChvcmRlclsndGltZXN0YW1wJ10pICogMTAwMDtcbiAgICAgICAgaWYgKCFtYXJrZXQpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbb3JkZXJbJ2N1cnJlbmN5X3BhaXInXV07XG4gICAgICAgIGxldCBwcmljZSA9IG9yZGVyWydwcmljZSddO1xuICAgICAgICBsZXQgYW1vdW50ID0gb3JkZXJbJ2Ftb3VudCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogYW1vdW50LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaW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ByZXN1bHRbJ3JldHVybiddWydmZWUnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJ2FwaS8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PSAnZmFwaScpIHtcbiAgICAgICAgICAgIHVybCArPSAnZmFwaS8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBpZiAoYXBpID09ICdlY2FwaScpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJ2VjYXBpJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoYXBpID09ICd0bGFwaScpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJ3RsYXBpJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICd0YXBpJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ25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ICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwOi8vYXBpLnpiLmNvbS9kYXRhJywgLy8gbm8gaHR0cHMgZm9yIHB1YmxpYyBBUElcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly90cmFkZS56Yi5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly90cmFkZS56Yi5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnpiLmNvbS9pL2RldmVsb3BlcicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzTmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnNJZ25vcmVUcmFkZVR5cGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFVuZmluaXNoZWRPcmRlcnNJZ25vcmVUcmFkZVR5cGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFjY291bnRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRVc2VyQWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0V2l0aGRyYXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRXaXRoZHJhd1JlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q2hhcmdlUmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDbnlXaXRoZHJhd1JlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q255Q2hhcmdlUmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGdldFRyYWRpbmdGZWVGcm9tQmFzZVF1b3RlIChiYXNlLCBxdW90ZSkge1xuICAgICAgICAvLyBiYXNlOiBxdW90ZVxuICAgICAgICBsZXQgZmVlcyA9IHtcbiAgICAgICAgICAgICdCVEMnOiB7ICdVU0RUJzogMC4wIH0sXG4gICAgICAgICAgICAnQkNIJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wMDEgfSxcbiAgICAgICAgICAgICdMVEMnOiB7ICdCVEMnOiAwLjAwMSwgJ1VTRFQnOiAwLjAgfSxcbiAgICAgICAgICAgICdFVEgnOiB7ICdCVEMnOiAwLjAwMSwgJ1VTRFQnOiAwLjAgfSxcbiAgICAgICAgICAgICdFVEMnOiB7ICdCVEMnOiAwLjAwMSwgJ1VTRFQnOiAwLjAgfSxcbiAgICAgICA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lICgpKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgZmVlID0gdGhpcy5nZXRUcmFkaW5nRmVlRnJvbUJhc2VRdW90ZSAoYmFzZSwgcXVvdGUpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydhbW91bnRTY2FsZSddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2VTY2FsZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogZmVlLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IGZlZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEFjY291bnRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZXNbJ2JhbGFuY2UnXSlcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlc1snYmFsYW5jZSddW2N1cnJlbmN5XVsnYW1vdW50J10pO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzWydmcm96ZW4nXSlcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlc1snZnJvemVuJ11bY3VycmVuY3ldWydhbW91bnQnXSk7XG4gICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBnZXRNYXJrZXRGaWVsZE5hbWUgKCkge1xuICAgICAgICByZXR1cm4gJ21hcmtldCc7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWFya2V0RmllbGROYW1lID0gdGhpcy5nZXRNYXJrZXRGaWVsZE5hbWUgKCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge307XG4gICAgICAgIHJlcXVlc3RbbWFya2V0RmllbGROYW1lXSA9IG1hcmtldFsnaWQnXTtcbiAgICAgICA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B0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1hcmtldEZpZWxkTmFtZSA9IHRoaXMuZ2V0TWFya2V0RmllbGROYW1lICgpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICByZXF1ZXN0W21hcmtldEZpZWxkTmFtZV0gPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsndGlja2VyJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydidXknXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAg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sb29rdXAgdGFibGVzXG5cdCAgICAoZnVuY3Rpb24gKCkge1xuXHQgICAgICAgIC8vIENvbXB1dGUgZG91YmxlIHRhYmxlXG5cdCAgICAgICAgdmFyIGQgPSBbXTtcblx0ICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgIGlmIChpIDwgMTI4KSB7XG5cdCAgICAgICAgICAgICAgICBkW2ldID0gaSA8PCAxO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgZFtpXSA9IChpIDw8IDEpIF4gMHgxMWI7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9XG5cblx0ICAgICAgICAvLyBXYWxrIEdGKDJeOClcblx0ICAgICAgICB2YXIgeCA9IDA7XG5cdCAgICAgICAgdmFyIHhpID0gMDtcblx0ICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgIC8vIENvbXB1dGUgc2JveFxuXHQgICAgICAgICAgICB2YXIgc3ggPSB4aSBeICh4aSA8PCAxKSBeICh4aSA8PCAyKSBeICh4aSA8PCAzKSBeICh4aSA8PCA0KTtcblx0ICAgICAgICAgICAgc3ggPSAoc3ggPj4+IDgpIF4gKHN4ICYgMHhmZikgXiAweDYzO1xuXHQgICAgICAgICAgICBTQk9YW3hdID0gc3g7XG5cdCAgICAgICAgICAgIElOVl9TQk9YW3N4XSA9IHg7XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBtdWx0aXBsaWNhdGlvblxuXHQgICAgICAgICAgICB2YXIgeDIgPSBkW3hdO1xuXHQgICAgICAgICAgICB2YXIgeDQgPSBkW3gyXTtcblx0ICAgICAgICAgICAgdmFyIHg4ID0gZFt4NF07XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBzdWIgYnl0ZXMsIG1peCBjb2x1bW5zIHRhYmxlc1xuXHQgICAgICAgICAgICB2YXIgdCA9IChkW3N4XSAqIDB4MTAxKSBeIChzeCAqIDB4MTAxMDEwMCk7XG5cdCAgICAgICAgICAgIFNVQl9NSVhfMFt4XSA9ICh0IDw8IDI0KSB8ICh0ID4+PiA4KTtcblx0ICAgICAgICAgICAgU1VCX01JWF8xW3hdID0gKHQgPDwgMTYpIHwgKHQgPj4+IDE2KTtcblx0ICAgICAgICAgICAgU1VCX01JWF8yW3hdID0gKHQgPDwgOCkgIHwgKHQgPj4+IDI0KTtcblx0ICAgICAgICAgICAgU1VCX01JWF8zW3hdID0gdDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGludiBzdWIgYnl0ZXMsIGludiBtaXggY29sdW1ucyB0YWJsZXNcblx0ICAgICAgICAgICAgdmFyIHQgPSAoeDggKiAweDEwMTAxMDEpIF4gKHg0ICogMHgxMDAwMSkgXiAoeDIgKiAweDEwMSkgXiAoeCAqIDB4MTAxMDEwMCk7XG5cdCAgICAgICAgICAgIElOVl9TVUJfTUlYXzBbc3hdID0gKHQgPDwgMjQpIHwgKHQgPj4+IDgpO1xuXHQgICAgICAgICAgICBJTlZfU1VCX01JWF8xW3N4XSA9ICh0IDw8IDE2KSB8ICh0ID4+PiAxNik7XG5cdCAgICAgICAgICAgIElOVl9TVUJfTUlYXzJbc3hdID0gKHQgPDwgOCkgIHwgKHQgPj4+IDI0KTtcblx0ICAgICAgICAgICAgSU5WX1NVQl9NSVhfM1tzeF0gPSB0O1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGUgbmV4dCBjb3VudGVyXG5cdCAgICAgICAgICAgIGlmICgheCkge1xuXHQgICAgICAgICAgICAgICAgeCA9IHhpID0gMTtcblx0ICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgIHggPSB4MiBeIGRbZFtkW3g4IF4geDJdXV07XG5cdCAgICAgICAgICAgICAgICB4aSBePSBkW2RbeGldXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblx0ICAgIH0o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Sb3VuZHMgKyAxKSAqIDQ7XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBrZXkgc2NoZWR1bGVcblx0ICAgICAgICAgICAgdmFyIGtleVNjaGVkdWxlID0gdGhpcy5fa2V5U2NoZWR1bGUgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIga3NSb3cgPSAwOyBrc1JvdyA8IGtzUm93czsga3NSb3crKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKGtzUm93IDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgICAgIGtleVNjaGVkdWxlW2tzUm93XSA9IGtleVdvcmRzW2tzUm93XTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBrZXlTY2hlZHVsZVtrc1JvdyAtIDFdO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgaWYgKCEoa3NSb3cgJSBrZXlTaXplKSkge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBSb3Qgd29yZFxuXHQgICAgICAgICAgICAgICAgICAgICAgICB0ID0gKHQgPDwgOCkgfCAodCA+Pj4gMjQpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN1YiB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoU0JPWFt0ID4+PiAyNF0gPDwgMjQpIHwgKFNCT1hbKHQgPj4+IDE2KSAmIDB4ZmZdIDw8IDE2KSB8IChTQk9YWyh0ID4+PiA4KSAmIDB4ZmZdIDw8IDgpIHwgU0JPWFt0ICYgMHhmZl07XG5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gTWl4IFJjb25cblx0ICAgICAgICAgICAgICAgICAgICAgICAgdCBePSBSQ09OWyhrc1JvdyAvIGtleVNpemUpIHwgMF0gPDwgMjQ7XG5cdCAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXlTaXplID4gNiAmJiBrc1JvdyAlIGtleVNpemUgPT0gNCkge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBTdWIgd29yZFxuXHQgICAgICAgICAgICAgICAgICAgICAgICB0ID0gKFNCT1hbdCA+Pj4gMjRdIDw8IDI0KSB8IChTQk9YWyh0ID4+PiAxNikgJiAweGZmXSA8PCAxNikgfCAoU0JPWFsodCA+Pj4gOCkgJiAweGZmXSA8PCA4KSB8IFNCT1hbdCAmIDB4ZmZdO1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgICAgIGtleVNjaGVkdWxlW2tzUm93XSA9IGtleVNjaGVkdWxlW2tzUm93IC0ga2V5U2l6ZV0gXiB0O1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBpbnYga2V5IHNjaGVkdWxlXG5cdCAgICAgICAgICAgIHZhciBpbnZLZXlTY2hlZHVsZSA9IHRoaXMuX2ludktleVNjaGVkdWxlID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGludktzUm93ID0gMDsgaW52S3NSb3cgPCBrc1Jvd3M7IGludktzUm93KyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciBrc1JvdyA9IGtzUm93cyAtIGludktzUm93O1xuXG5cdCAgICAgICAgICAgICAgICBpZiAoaW52S3NSb3cgJSA0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBrZXlTY2hlZHVsZVtrc1Jvd107XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0ID0ga2V5U2NoZWR1bGVba3NSb3cgLSA0XTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgaWYgKGludktzUm93IDwgNCB8fCBrc1JvdyA8PSA0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaW52S2V5U2NoZWR1bGVbaW52S3NSb3ddID0gdDtcblx0IC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3J5cHRvSlMubGliLkNpcGhlci5fY3JlYXRlSGVscGVyKENyeXB0b0pTLmFsZ28uQUVTKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBfY3JlYXRlSGVscGVyOiAoZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICBmdW5jdGlvbiBzZWxlY3RDaXBoZXJTdHJhdGVneShrZXkpIHtcblx0ICAgICAgICAgICAgICAgIGlmICh0eXBlb2Yga2V5ID09ICdzdHJpbmcnKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBhc3N3b3JkQmFzZWRDaXBoZXI7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIHJldHVybiBTZXJpYWxpemFibGVDaXBoZXI7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGNpcGhlcikge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIHtcblx0ICAgICAgICAgICAgICAgICAgICBlbmNyeXB0OiBmdW5jdGlvbiAobWVzc2FnZSwga2V5LCBjZmcpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGVjdENpcGhlclN0cmF0ZWd5KGtleSkuZW5jcnlwdChjaXBoZXIsIG1lc3NhZ2UsIGtleSwgY2ZnKTtcblx0ICAgICAgICAgICAgICAgICAgICB9LFxuXG5cdCAgICAgICAgICAgICAgICAgICAgZGVjcnlwdDogZnVuY3Rpb24gKGNpcGhlcnRleHQsIGtleSwgY2ZnKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzZWxlY3RDaXBoZXJTdHJhdGVneShrZXkpLmRlY3J5cHQoY2lwaGVyLCBjaXBoZXJ0ZXh0LCBrZXksIGNmZyk7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgfTtcblx0ICAgICAgICAgICA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ENCQy5FbmNyeXB0b3IgPSBDQkMuZXh0ZW5kKHtcblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIFByb2Nlc3NlcyB0aGUgZGF0YSBibG9jayBhdCBvZmZzZXQuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBwYXJhbSB7QXJyYXl9IHdvcmRzIFRoZSBkYXRhIHdvcmRzIHRvIG9wZXJhdGUgb24uXG5cdCAgICAgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBvZmZzZXQgVGhlIG9mZnNldCB3aGVyZSB0aGUgYmxvY2sgc3RhcnRzLlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgbW9kZS5wcm9jZXNzQmxvY2soZGF0YS53b3Jkcywgb2Zmc2V0KTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIHByb2Nlc3NCbG9jazogZnVuY3Rpb24gKHdvcmRzLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIGNpcGhlciA9IHRoaXMuX2NpcGhlcjtcblx0ICAgICAgICAgICAgICAgIHZhciBibG9ja1NpemUgPSBjaXBoZXIuYmxvY2tTaXplO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBYT1IgYW5kIGVuY3J5cHRcblx0ICAgICAgICAgICAgICAgIHhvckJsb2NrLmNhbGwodGhpcywgd29yZHMsIG9mZnNldCwgYmxvY2tTaXplKTtcblx0ICAgICAgICAgICAgICAgIGNpcGhlci5lbmNyeXB0QmxvY2sod29yZHMsIG9mZnNldCk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbWVtYmVyIHRoaXMgYmxvY2sgdG8gdXNlIHdpdGggbmV4dCBibG9ja1xuXHQgICAgICAgICAgICAgICAgdGhpcy5fcHJldkJsb2NrID0gd29yZHMuc2xpY2Uob2Zmc2V0LCBvZmZzZXQgKyBibG9ja1NpemUpO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfSk7XG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDQkMgZGVjcnlwdG9yLlxuXHQgICAgICAgICAqL1xuXHQgICAgICAgIENCQy5EZWNyeXB0b3IgPSBDQkMuZXh0ZW5kKHtcblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIFByb2Nlc3NlcyB0aGUgZGF0YSBibG9jayBhdCBvZmZzZXQuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBwYXJhbSB7QXJyYXl9IHdvcmRzIFRoZSBkYXRhIHdvcmRzIHRvIG9wZXJhdGUgb24uXG5cdCAgICAgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBvZmZzZXQgVGhlIG9mZnNldCB3aGVyZSB0aGUgYmxvY2sgc3RhcnRzLlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgbW9kZS5wcm9jZXNzQmxvY2soZGF0YS53b3Jkcywgb2Zmc2V0KTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIHByb2Nlc3NCbG9jazogZnVuY3Rpb24gKHdvcmRzLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIGNpcGhlciA9IHRoaXMuX2NpcGhlcjtcblx0ICAgICAgICAgICAgICAgIHZhciBibG9ja1NpemUgPSBjaXBoZXIuYmxvY2tTaXplO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBSZW1lbWJlciB0aGlzIGJsb2NrIHRvIHVzZSB3aXRoIG5leHQgYmxvY2tcblx0ICAgICAgICAgICAgICAgIHZhciB0aGlzQmxvY2sgPSB3b3Jkcy5zbGljZShvZmZzZXQsIG9mZnNldCArIGJsb2NrU2l6ZSk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIERlY3J5cHQgYW5kIFhPUlxuXHQgICAgICAgICAgICAgICAgY2lwaGVyLmRlY3J5cHRCbG9jayh3b3Jkcywgb2Zmc2V0KTtcblx0ICAgICAgICAgICAgICAgIHhvckJsb2NrLmNhbGwodGhpcywgd29yZHMsIG9mZnNldCwgYmxvY2tTaXplKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gVGhpcyBibG9jayBiZWNvbWVzIHRoZSBwcmV2aW91cyBibG9ja1xuXHQgICAgICAgICAgICAgICAgdGhpcy5fcHJldkJsb2NrID0gdGhpc0Jsb2NrO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfSk7XG5cblx0ICAgICAgICBmdW5jdGlvbiB4b3JCbG9jayh3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIGl2ID0gdGhpcy5faXY7XG5cblx0ICAgICAgICAgICAgLy8gQ2hvb3NlIG1peGluZyBibG9ja1xuXHQgICAgICAgICAgICBpZiAoaXYpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBibG9jayA9IGl2O1xuXG5cdCAgICAgICAgICAgICAgICAvLyBSZW1vdmUgSVYgZm9yIHN1YnNlcXVlbnQgYmxvY2tzXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9pdiA9IHVuZGVmaW5lZDtcblx0ICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgIHZhciBibG9jayA9IHRoaXMuX3ByZXZCbG9jaztcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFhPUiBibG9ja3Ncblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBibG9ja1NpemU7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgd29yZH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ga2V5OiBrZXlXb3JkQXJyYXksXG5cdCAgICAgICAgICogICAgICAgICBpdjogaXZXb3JkQXJyYXksXG5cdCAgICAgICAgICogICAgICAgICBzYWx0OiBzYWx0V29yZEFycmF5LFxuXHQgICAgICAgICAqICAgICAgICAgYWxnb3JpdGhtOiBDcnlwdG9KUy5hbGdvLkFFUyxcblx0ICAgICAgICAgKiAgICAgICAgIG1vZGU6IENyeXB0b0pTLm1vZGUuQ0JDLFxuXHQgICAgICAgICAqICAgICAgICAgcGFkZGluZzogQ3J5cHRvSlMucGFkLlBLQ1M3LFxuXHQgICAgICAgICAqICAgICAgICAgYmxvY2tTaXplOiA0LFxuXHQgICAgICAgICAqICAgICAgICAgZm9ybWF0dGVyOiBDcnlwdG9KUy5mb3JtYXQuT3BlblNTTFxuXHQgICAgICAgICAqICAgICB9KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBpbml0OiBmdW5jdGlvbiAoY2lwaGVyUGFyYW1zKSB7XG5cdCAgICAgICAgICAgIHRoaXMubWl4SW4oY2lwaGVyUGFyYW1zKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgdGhpcyBjaXBoZXIgcGFyYW1zIG9iamVjdCB0byBhIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7Rm9ybWF0fSBmb3JtYXR0ZXIgKE9wdGlvbmFsKSBUaGUgZm9ybWF0dGluZyBzdHJhdGVneSB0byB1c2UuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IFRoZSBzdHJpbmdpZmllZCBjaXBoZXIgcGFyYW1zLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHRocm93cyBFcnJvciBJZiBuZWl0aGVyIHRoZSBmb3JtYXR0ZXIgbm9yIHRoZSBkZWZhdWx0IGZvcm1hdHRlciBpcyBzZXQuXG5cdCAgICAgICAgICpcblx0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lcblxuXHQgICAgLyoqXG5cdCAgICAgKiBDcnlwdG9KUyBuYW1lc3BhY2UuXG5cdCAgICAgKi9cblx0ICAgIHZhciBDID0ge307XG5cblx0ICAgIC8qKlxuXHQgICAgICogTGlicmFyeSBuYW1lc3BhY2UuXG5cdCAgICAgKi9cblx0ICAgIHZhciBDX2xpYiA9IEMubGliID0ge307XG5cblx0ICAgIC8qKlxuXHQgICAgICogQmFzZSBvYmplY3QgZm9yIHByb3RvdHlwYWwgaW5oZXJpdGFuY2UuXG5cdCAgICAgKi9cblx0ICAgIHZhciBCYXNlID0gQ19saWIuQmFzZSA9IChmdW5jdGlvbiAoKSB7XG5cblxuXHQgICAgICAgIHJldHVybiB7XG5cdCAgICAgICAgICAgIC8qKlxuXHQgICAgICAgICAgICAgKiBDcmVhdGVzIGEgbmV3IG9iamVjdCB0aGF0IGluaGVyaXRzIGZyb20gdGhpcyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBwYXJhbSB7T2JqZWN0fSBvdmVycmlkZXMgUHJvcGVydGllcyB0byBjb3B5IGludG8gdGhlIG5ldyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEByZXR1cm4ge09iamVjdH0gVGhlIG5ldyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBNeVR5cGUgPSBDcnlwdG9KUy5saWIuQmFzZS5leHRlbmQoe1xuXHQgICAgICAgICAgICAgKiAgICAgICAgIGZpZWxkOiAndmFsdWUnLFxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgICAgIG1ldGhvZDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgKiAgICAgICAgIH1cblx0ICAgICAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgZXh0ZW5kOiBmdW5jdGlvbiAob3ZlcnJpZGVzKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTcGF3blxuXHQgICAgICAgICAgICAgICAgdmFyIHN1YnR5cGUgPSBjcmVhdGUodGhpcyk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEF1Z21lbnRcblx0ICAgICAgICAgICAgICAgIGlmIChvdmVycmlkZXMpIHtcblx0ICAgICAgICAgICAgICAgICAgICBzdWJ0eXBlLm1peEluKG92ZXJyaWRlcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBkZWZhdWx0IGluaXRpYWxpemVyXG5cdCAgICAgICAgICAgICAgICBpZiAoIXN1YnR5cGUuaGFzT3duUHJvcGVydHkoJ2luaXQnKSB8fCB0aGlzLmluaXQgPT09IHN1YnR5cGUuaW5pdCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YnR5cGUuaW5pdCA9IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgc3VidHlwZS4kc3VwZXIuaW5pdC5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuXHQgICAgICAgICAgICAgICAgICAgIH07XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIEluaXRpYWxpemVyJ3MgcHJvdG90eXBlIGlzIHRoZSBzdWJ0eXBlIG9iamVjdFxuXHQgICAgICAgICAgICAgICAgc3VidHlwZS5pbml0LnByb3RvdHlwZSA9IHN1YnR5cGU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlZmVyZW5jZSBzdXBlcnR5cGVcblx0ICAgICAgICAgICAgICAgIHN1YnR5cGUuJHN1cGVyID0gdGhpcztcblxuXHQgICAgICAgICAgICAgICAgcmV0dXJuIHN1YnR5cGU7XG5cdCAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIEV4dGVuZHMgdGhpcyBvYmplY3QgYW5kIHJ1bnMgdGhlIGluaXQgbWV0aG9kLlxuXHQgICAgICAgICAgICAgKiBBcmd1bWVudHMgdG8gY3JlYXRlKCkgd2lsbCBiZSBwYXNzZWQgdG8gaW5pdCgpLlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcmV0dXJuIHtPYmplY3R9IFRoZSBuZXcgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICB2YXIgaW5zdGFuY2UgPSBNeVR5cGUuY3JlYXRlKCk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBjcmVhdGU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBpbnN0YW5jZSA9IHRoaXMuZXh0ZW5kKCk7XG5cdCAgICAgICAgICAgICAgICBpbnN0YW5jZS5pbml0LmFwcGx5KGluc3RhbmNlLCBhcmd1bWVudHMpO1xuXG5cdCAgICAgICAgICAgICAgICByZXR1cm4gaW5zdGFuY2U7XG5cdCAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIEluaXRpYWxpemVzIGEgbmV3bHkgY3JlYXRlZCBvYmplY3QuXG5cdCAgICAgICAgICAgICAqIE92ZXJyaWRlIHRoaXMgbWV0aG9kIHRvIGFkZCBzb21lIGxvZ2ljIHdoZW4geW91ciBvYmplY3RzIGFyZSBjcmVhdGVkLlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgdmFyIE15VHlwZSA9IENyeXB0b0pTLmxpYi5CYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgaW5pdDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgKiAgICAgICAgICAgICAvLyAuLi5cblx0ICAgICAgICAgICAgICogICAgICAgICB9XG5cdCAgICAgICAgICAgICAqICAgICB9KTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIGluaXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogQ29waWVzIHByb3BlcnRpZXMgaW50byB0aGlzIG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IHByb3BlcnRpZXMgVGhlIHByb3BlcnRpZXMgdG8gbWl4IGluLlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgTXlUeXBlLm1peEluKHtcblx0ICAgICAgICAgICAgICogICAgICAgICBmaWVsZDogJ3ZhbHVlJ1xuXHQgICAgICAgICAgICAgKiAgICAgfSk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBtaXhJbjogZnVuY3Rpb24gKHByb3BlcnRpZXMpIHtcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHByb3BlcnR5TmFtZSBpbiBwcm9wZXJ0aWVzKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaWYgKHByb3BlcnRpZXMuaGFzT3duUHJvcGVydHkocHJvcGVydHlOYW1lKSkge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB0aGlzW3Byb3BlcnR5TmFtZV0gPSBwcm9wZXJ0aWVzW3Byb3BlcnR5TmFtZV07XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBJRSB3b24ndCBjb3B5IHRvU3RyaW5nIHVzaW5nIHRoZSBsb29wIGFib3ZlXG5cdCAgICAgICAgICAgICAgICBpZiAocHJvcGVydGllcy5oYXNPd25Qcm9wZXJ0eSgndG9TdHJpbmcnKSkge1xuXHQgICAgICAgICAgICAgICAgICAgIHRoaXMudG9TdHJpbmcgPSBwcm9wZXJ0aWVzLnRvU3RyaW5nO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9LFxuXG5cdCAgICAgICAgICAgIC8qKlxuXHQgICAgICAgICAgICAgKiBDcmVhdGVzIGEgY29weSBvZiB0aGlzIG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHJldHVybiB7T2JqZWN0fSBUaGUgY2xvbmUuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICB2YXIgY2xvbmUgPSBpbnN0YW5jZS5jbG9uZSgpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmluaXQucHJvdG90eXBlLmV4dGVuZCh0aGlzKTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH07XG5cdCAgICB9KCkpO1xuXG5cdCAgICAvKipcblx0ICAgICAqIEFuIGFycmF5IG9mIDMyLWJpdCB3b3Jkcy5cblx0ICAgICAqXG5cdCAgICAgKiBAcHJvcGVydHkge0FycmF5fSB3b3JkcyBUaGUgYXJyYXkgb2YgMzItYml0IHdvcmRzLlxuXHQgICAgICogQHByb3BlcnR5IHtudW1iZXJ9IHNpZ0J5dGVzIFRoZSBudW1iZXIgb2Ygc2lnbmlmaWNhbnQgYnl0ZXMgaW4gdGhpcyB3b3JkIGFycmF5LlxuXHQgICAgICovXG5cdCAgICB2YXIgV29yZEFycmF5ID0gQ19saWIuV29yZEFycmF5ID0gQmFzZS5leHRlbmQoe1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEluaXRpYWxpemVzIGEgbmV3bHkgY3JlYXRlZCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgKE9wdGlvbmFsKSBBbiBhcnJheSBvZiAzMi1iaXQgd29yZHMuXG5cdCAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IHNpZ0J5dGVzIChPcHRpb25hbCkgVGhlIG51bWJlciBvZiBzaWduaWZpY2FudCBieXRlcyBpbiB0aGUgd29yZHMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5saWIuV29yZEFycmF5LmNyZWF0ZSgpO1xuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMubGliLldvcmRBcnJheS5jcmVhdGUoWzB4MDAwMTAyMDMsIDB4MDQwNTA2MDddKTtcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmxpYi5Xb3JkQXJyYXkuY3JlYXRlKFsweDAwMDEwMjAzLCAweDA0MDUwNjA3XSwgNik7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgaW5pdDogZnVuY3Rpb24gKHdvcmRzLCBzaWdCeXRlcykge1xuXHQgICAgICAgICAgICB3b3JkcyA9IHRoaXMud29yZHMgPSB3b3JkcyB8fCBbXTtcblxuXHQgICAgICAgICAgICBpZiAoc2lnQnl0ZXMgIT0gdW5kZWZpbmVkKSB7XG5cdCAgICAgICAgICAgICAgICB0aGlzLnNpZ0J5dGVzID0gc2lnQnl0ZXM7XG5cdCAgICAgICAgICAgIH0gZ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IGFycmF5IHRvIGFwcGVuZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhpcyB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB3b3JkQXJyYXkxLmNvbmNhdCh3b3JkQXJyYXkyKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBjb25jYXQ6IGZ1bmN0aW9uICh3b3JkQXJyYXkpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB0aGlzV29yZHMgPSB0aGlzLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgdGhhdFdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgdGhpc1NpZ0J5dGVzID0gdGhpcy5zaWdCeXRlcztcblx0ICAgICAgICAgICAgdmFyIHRoYXRTaWdCeXRlcyA9IHdvcmRBcnJheS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDbGFtcCBleGNlc3MgYml0c1xuXHQgICAgICAgICAgICB0aGlzLmNsYW1wKCk7XG5cblx0ICAgICAgICAgICAgLy8gQ29uY2F0XG5cdCAgICAgICAgICAgIGlmICh0aGlzU2lnQnl0ZXMgJSA0KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBDb3B5IG9uZSBieXRlIGF0IGEgdGltZVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGF0U2lnQnl0ZXM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0aGF0Qnl0ZSA9ICh0aGF0V29yZHNbaSA+Pj4gMl0gPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgICAgIHRoaXNXb3Jkc1sodGhpc1NpZ0J5dGVzICsgaSkgPj4+IDJdIHw9IHRoYXRCeXRlIDw8ICgyNCAtICgodGhpc1NpZ0J5dGVzICsgaSkgJSA0KSAqIDgpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgLy8gQ29weSBvbmUgd29yZCBhdCBhIHRpbWVcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhhdFNpZ0J5dGVzOyBpICs9IDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICB0aGlzV29yZHNbKHRoaXNTaWdCeXRlcyArIGkpID4+PiAyXSA9IHRoYXRXb3Jkc1tpID4+PiAyXTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB0aGlzLnNpZ0J5dGVzICs9IHRoYXRTaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDaGFpbmFibGVcblx0ICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFJlbW92ZXMgaW5zaWduaWZpY2FudCBiaXRzLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB3b3JkQXJyYXkuY2xhbXAoKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBjbGFtcDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gdGhpcy53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNpZ0J5dGVzID0gdGhpcy5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDbGFtcFxuXHQgICAgICAgICAgICB3b3Jkc1tzaWdCeXRlcyA+Pj4gMl0gJj0gMHhmZmZmZmZmZiA8PCAoMzIgLSAoc2lnQnl0ZXMgJSA0KSAqIDgpO1xuXHQgICAgICAgICAgICB3b3Jkcy5sZW5ndGggPSBNYXRoLmNlaWwoc2lnQnl0ZXMgLyA0KTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ3JlYXRlcyBhIGNvcHkgb2YgdGhpcyB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgY2xvbmUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjbG9uZSA9IHdvcmRBcnJheS5jbG9uZSgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEJhc2UuY2xvbmUuY2FsbCh0aGlzKTtcblx0ICAgICAgICAgICAgY2xvbmUud29yZHMgPSB0aGlzLndvcmRzLnNsaWNlKDApO1xuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ3JlYXRlcyBhIHdvcmQgYXJyYXkgZmlsbGVkIHdpdGggcmFuZG9tIGJ5dGVzLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG5CeXRlcyBUaGUgbnVtYmVyIG9mIHJhbmRvbSBieXRlcyB0byBnZW5lcmF0ZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHJhbmRvbSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMubGliLldvcmRBcnJheS5yYW5kb20oMTYpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHJhbmRvbTogZnVuY3Rpb24gKG5CeXRlcykge1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblxuXHQgICAgICAgICAgICB2YXIgciA9IChmdW5jdGlvbiAobV93KSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgbV93ID0gbV93O1xuXHQgICAgICAgICAgICAgICAgdmFyIG1feiA9IDB4M2FkZTY4YjE7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFzayA9IDB4ZmZmZmZmZmY7XG5cblx0ICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbV96ID0gKDB4OTA2OSAqIChtX3ogJiAweEZGRkYpICsgKG1feiA+PiAweDEwKSkgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIG1fdyA9ICgweDQ2NTAgKiAobV93ICYgMHhGRkZGKSArIChtX3cgPj4gMHgxMCkpICYgbWFzaztcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgcmVzdWx0ID0gKChtX3ogPDwgMHgxMCkgKyBtX3cpICYgbWFzaztcblx0ICAgICAgICAgICAgICAgICAgICByZXN1bHQgLz0gMHgxMDAwMDAwMDA7XG5cdCAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IDAuNTtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICogKE1hdGgucmFuZG9tKCkgPiAuNSA/IDEgOiAtMSk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH0pO1xuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCByY2FjaGU7IGkgPCBuQnl0ZXM7IGkgKz0gNCkge1xuXHQgICAgICAgICAgICAgICAgdmFyIF9yID0gcigocmNhY2hlIHx8IE1hdGgucmFuZG9tKCkpICogMHgxMDAwMDAwMDApO1xuXG5cdCAgICAgICAgICAgICAgICByY2FjaGUgPSBfcigpICogMHgzYWRlNjdiNztcblx0ICAgICAgICAgICAgICAgIHdvcmRzLnB1c2goKF9yKCkgKiAweDEwMDAwMDAwMCkgfCAwKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBuZXcgV29yZEFycmF5LmluaXQod29yZHMsIG5CeXRlcyk7XG5cdCAgICAgICAgfVxuXHQgICAgfSk7XG5cblx0ICAgIC8qKlxuXHQgICAgICogRW5jb2RlciBuYW1lc3BhY2UuXG5cdCAgICAgKi9cblx0ICAgIHZhciBDX2VuYyA9IEMuZW5jID0ge307XG5cblx0ICAgIC8qKlxuXHQgICAgICogSGV4IGVuY29kaW5nIHN0cmF0ZWd5LlxuXHQgICAgICovXG5cdCAgICB2YXIgSGV4ID0gQ19lbmMuSGV4ID0ge1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgd29yZCBhcnJheSB0byBhIGhleCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGhleFN0cmluZyA9IENyeXB0b0pTLmVuYy5IZXguc3RyaW5naWZ5KHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzaWdCeXRlcyA9IHdvcmRBcnJheS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciBoZXhDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciBiaXRlID0gKHdvcmRzW2kgPj4+IDJdID4+PiAoMjQgLSAoaSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIGhleENoYXJzLnB1c2goKGJpdGUgPj4+IDQpLnRvU3RyaW5nKDE2KSk7XG5cdCAgICAgICAgICAgICAgICBoZXhDaGFycy5wdXNoKChiaXRlICYgMHgwZikudG9TdHJpbmcoMTYpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBoZXhDaGFycy5qb2luKCcnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBoZXggc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBoZXhTdHIgVGhlIGhleCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMuZW5jLkhleC5wYXJzZShoZXhTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoaGV4U3RyKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBoZXhTdHJMZW5ndGggPSBoZXhTdHIubGVuZ3RoO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgaGV4U3RyTGVuZ3RoOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW2kgPj4+IDNdIHw9IHBhcnNlSW50KGhleFN0ci5zdWJzdHIoaSwgMiksIDE2KSA8PCAoMjQgLSAoaSAlIDgpICogNCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbmV3IFdvcmRBcnJheS5pbml0KHdvcmRzLCBoZXhTdHJMZW5ndGggLyAyKTtcblx0ICAgICAgICB9XG5cdCAgICB9O1xuXG5cdCAgICAvKipcblx0ICAgICAqIExhdGluMSBlbmNvZGluZyBzdHJhdGVneS5cblx0ICAgICAqL1xuXHQgICAgdmFyIExhdGluMSA9IENfZW5jLkxhdGluMSA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBMYXRpbjEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIExhdGluMSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBsYXRpbjFTdHJpbmcgPSBDcnlwdG9KUy5lbmMuTGF0aW4xLnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgbGF0aW4xQ2hhcnMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaWdCeXRlczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgYml0ZSA9ICh3b3Jkc1tpID4+PiAyXSA+Pj4gKDI0IC0gKGkgJSA0KSAqIDgpKSAmIDB4ZmY7XG5cdCAgICAgICAgICAgICAgICBsYXRpbjFDaGFycy5wdXNoKFN0cmluZy5mcm9tQ2hhckNvZGUoYml0ZSkpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGxhdGluMUNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIExhdGluMSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGxhdGluMVN0ciBUaGUgTGF0aW4xIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuTGF0aW4xLnBhcnNlKGxhdGluMVN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChsYXRpbjFTdHIpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIGxhdGluMVN0ckxlbmd0aCA9IGxhdGluMVN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsYXRpbjFTdHJMZW5ndGg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgd29yZHNbaSA+Pj4gMl0gfD0gKGxhdGluMVN0ci5jaGFyQ29kZUF0KGkpICYgMHhmZikgPDwgKDI0IC0gKGkgJSA0KSAqIDgpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdCh3b3JkcywgbGF0aW4xU3RyTGVuZ3RoKTtcblx0ICAgICAgICB9XG5cdCAgICB9O1xuXG5cdCAgICAvKipcblx0ICAgICAqIFVURi04IGVuY29kaW5nIHN0cmF0ZWd5LlxuXHQgICAgICovXG5cdCAgICB2YXIgVXRmOCA9IENfZW5jLlV0ZjggPSB7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSB3b3JkIGFycmF5IHRvIGEgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIFVURi04IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHV0ZjhTdHJpbmcgPSBDcnlwdG9KUy5lbmMuVXRmOC5zdHJpbmdpZnkod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBzdHJpbmdpZnk6IGZ1bmN0aW9uICh3b3JkQXJyYXkpIHtcblx0ICAgICAgICAgICAgdHJ5IHtcblx0ICAgICAgICAgICAgICAgIHJldHVybiBkZWNvZGVVUklDb21wb25lbnQoZXNjYXBlKExhdGluMS5zdHJpbmdpZnkod29yZEFycmF5KSkpO1xuXHQgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG5cdCAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ01hbGZvcm1lZCBVVEYtOCBkYXRhJyk7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBVVEYtOCBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjhTdHIgVGhlIFVURi04IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZSh1dGY4U3RyaW5nKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKHV0ZjhTdHIpIHtcblx0ICAgICAgICAgICAgcmV0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bHRzXG5cdCAgICAgICAgICAgIHRoaXMuY2ZnID0gdGhpcy5jZmcuZXh0ZW5kKGNmZyk7XG5cblx0ICAgICAgICAgICAgLy8gU2V0IGluaXRpYWwgdmFsdWVzXG5cdCAgICAgICAgICAgIHRoaXMucmVzZXQoKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogUmVzZXRzIHRoaXMgaGFzaGVyIHRvIGl0cyBpbml0aWFsIHN0YXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICBoYXNoZXIucmVzZXQoKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICByZXNldDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBSZXNldCBkYXRhIGJ1ZmZlclxuXHQgICAgICAgICAgICBCdWZmZXJlZEJsb2NrQWxnb3JpdGhtLnJlc2V0LmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgLy8gUGVyZm9ybSBjb25jcmV0ZS1oYXNoZXIgbG9naWNcblx0ICAgICAgICAgICAgdGhpcy5fZG9SZXNldCgpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBVcGRhdGVzIHRoaXMgaGFzaGVyIHdpdGggYSBtZXNzYWdlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl8c3RyaW5nfSBtZXNzYWdlVXBkYXRlIFRoZSBtZXNzYWdlIHRvIGFwcGVuZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge0hhc2hlcn0gVGhpcyBoYXNoZXIuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIGhhc2hlci51cGRhdGUoJ21lc3NhZ2UnKTtcblx0ICAgICAgICAg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b3JkIGFycmF5IHRvIGEgQmFzZTY0IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IFRoZSBCYXNlNjQgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgYmFzZTY0U3RyaW5nID0gQ3J5cHRvSlMuZW5jLkJhc2U2NC5zdHJpbmdpZnkod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBzdHJpbmdpZnk6IGZ1bmN0aW9uICh3b3JkQXJyYXkpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IHdvcmRBcnJheS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB2YXIgbWFwID0gdGhpcy5fbWFwO1xuXG5cdCAgICAgICAgICAgIC8vIENsYW1wIGV4Y2VzcyBiaXRzXG5cdCAgICAgICAgICAgIHdvcmRBcnJheS5jbGFtcCgpO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIGJhc2U2NENoYXJzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2lnQnl0ZXM7IGkgKz0gMykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJ5dGUxID0gKHdvcmRzW2kgPj4+IDJdICAgICAgID4+PiAoMjQgLSAoaSAlIDQpICogOCkpICAgICAgICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIHZhciBieXRlMiA9ICh3b3Jkc1soaSArIDEpID4+PiAyXSA+Pj4gKDI0IC0gKChpICsgMSkgJSA0KSAqIDgpKSAmIDB4ZmY7XG5cdCAgICAgICAgICAgICAgICB2YXIgYnl0ZTMgPSAod29yZHNbKGkgKyAyKSA+Pj4gMl0gPj4+ICgyNCAtICgoaSArIDIpICUgNCkgKiA4KSkgJiAweGZmO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgdHJpcGxldCA9IChieXRlMSA8PCAxNikgfCAoYnl0ZTIgPDwgOCkgfCBieXRlMztcblxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IChqIDwgNCkgJiYgKGkgKyBqICogMC43NSA8IHNpZ0J5dGVzKTsgaisrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgYmFzZTY0Q2hhcnMucHVzaChtYXAuY2hhckF0KCh0cmlwbGV0ID4+PiAoNiAqICgzIC0gaikpKSAmIDB4M2YpKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIEFkZCBwYWRkaW5nXG5cdCAgICAgICAgICAgIHZhciBwYWRkaW5nQ2hhciA9IG1hcC5jaGFyQXQoNjQpO1xuXHQgICAgICAgICAgICBpZiAocGFkZGluZ0NoYXIpIHtcblx0ICAgICAgICAgICAgICAgIHdoaWxlIChiYXNlNjRDaGFycy5sZW5ndGggJSA0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgYmFzZTY0Q2hhcnMucHVzaChwYWRkaW5nQ2hhcik7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gYmFzZTY0Q2hhcnMuam9pbignJyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgQmFzZTY0IHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gYmFzZTY0U3RyIFRoZSBCYXNlNjQgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5CYXNlNjQucGFyc2UoYmFzZTY0U3RyaW5nKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGJhc2U2NFN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGJhc2U2NFN0ckxlbmd0aCA9IGJhc2U2NFN0ci5sZW5ndGg7XG5cdCAgICAgICAgICAgIHZhciBtYXAgPSB0aGlzLl9tYXA7XG5cdCAgICAgICAgICAgIHZhciByZXZlcnNlTWFwID0gdGhpcy5fcmV2ZXJzZU1hcDtcblxuXHQgICAgICAgICAgICBpZiAoIXJldmVyc2VNYXApIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXZlcnNlTWFwID0gdGhpcy5fcmV2ZXJzZU1hcCA9IFtdO1xuXHQgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgbWFwLmxlbmd0aDsgaisrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJldmVyc2VNYXBbbWFwLmNoYXJDb2RlQXQoaildID0gajtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJZ25vcmUgcGFkZGluZ1xuXHQgICAgICAgICAgICB2YXIgcGFkZGluZ0NoYXIgPSBtYXAuY2hhckF0KDY0KTtcblx0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QgICAgICovXG5cdCAgICB2YXIgVXRmMTZCRSA9IENfZW5jLlV0ZjE2ID0gQ19lbmMuVXRmMTZCRSA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtMTYgQkUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIFVURi0xNiBCRSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB1dGYxNlN0cmluZyA9IENyeXB0b0pTLmVuYy5VdGYxNi5zdHJpbmdpZnkod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBzdHJpbmdpZnk6IGZ1bmN0aW9uICh3b3JkQXJyYXkpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IHdvcmRBcnJheS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIHV0ZjE2Q2hhcnMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaWdCeXRlczsgaSArPSAyKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgY29kZVBvaW50ID0gKHdvcmRzW2kgPj4+IDJdID4+PiAoMTYgLSAoaSAlIDQpICogOCkpICYgMHhmZmZmO1xuXHQgICAgICAgICAgICAgICAgdXRmMTZDaGFycy5wdXNoKFN0cmluZy5mcm9tQ2hhckNvZGUoY29kZVBvaW50KSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gdXRmMTZDaGFycy5qb2luKCcnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBVVEYtMTYgQkUgc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSB1dGYxNlN0ciBUaGUgVVRGLTE2IEJFIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuVXRmMTYucGFyc2UodXRmMTZTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAodXRmMTZTdHIpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIHV0ZjE2U3RyTGVuZ3RoID0gdXRmMTZTdHIubGVuZ3RoO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdXRmMTZTdHJMZW5ndGg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgd29yZHNbaSA+Pj4gMV0gfD0gdXRmMTZTdHIuY2hhckNvZGVBdChpKSA8PCAoMTYgLSAoaSAlIDIpICogMTYpO1xuXHQgICAgICAgICAgICB9XG5c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eXRlczsgaSArPSAyKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgY29kZVBvaW50ID0gc3dhcEVuZGlhbigod29yZHNbaSA+Pj4gMl0gPj4+ICgxNiAtIChpICUgNCkgKiA4KSkgJiAweGZmZmYpO1xuXHQgICAgICAgICAgICAgICAgdXRmMTZDaGFycy5wdXNoKFN0cmluZy5mcm9tQ2hhckNvZGUoY29kZVBvaW50KSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gdXRmMTZDaGFycy5qb2luKCcnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBVVEYtMTYgTEUgc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSB1dGYxNlN0ciBUaGUgVVRGLTE2IExFIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuVXRmMTZMRS5wYXJzZSh1dGYxNlN0cik7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uICh1dGYxNlN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZTdHJMZW5ndGggPSB1dGYxNlN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGk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XHQgICAgICAgICAqL1xuXHQgICAgICAgIGNmZzogQmFzZS5leHRlbmQoe1xuXHQgICAgICAgICAgICBrZXlTaXplOiAxMjgvMzIsXG5cdCAgICAgICAgICAgIGhhc2hlcjogTUQ1LFxuXHQgICAgICAgICAgICBpdGVyYXRpb25zOiAxXG5cdCAgICAgICAgfSksXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBJbml0aWFsaXplcyBhIG5ld2x5IGNyZWF0ZWQga2V5IGRlcml2YXRpb24gZnVuY3Rpb24uXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gY2ZnIChPcHRpb25hbCkgVGhlIGNvbmZpZ3VyYXRpb24gb3B0aW9ucyB0byB1c2UgZm9yIHRoZSBkZXJpdmF0aW9uLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIga2RmID0gQ3J5cHRvSlMuYWxnby5FdnBLREYuY3JlYXRlKCk7XG5cdCAgICAgICAgICogICAgIHZhciBrZGYgPSBDcnlwdG9KUy5hbGdvLkV2cEtERi5jcmVhdGUoeyBrZXlTaXplOiA4IH0pO1xuXHQgICAgICAgICAqICAgICB2YXIga2RmID0gQ3J5cHRvSlMuYWxnby5FdnBLREYuY3JlYXRlKHsga2V5U2l6ZTogOCwgaXRlcmF0aW9uczogMTAwMCB9KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBpbml0OiBmdW5jdGlvbiAoY2ZnKSB7XG5cdCAgICAgICAgICAgIHRoaXMuY2ZnID0gdGhpcy5jZmcuZXh0ZW5kKGNmZyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIERlcml2ZXMgYSBrZXkgZnJvbSBhIHBhc3N3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl8c3RyaW5nfSBwYXNzd29yZCBUaGUgcGFzc3dvcmQuXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl8c3RyaW5nfSBzYWx0IEEgc2FsdC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIGRlcml2ZWQga2V5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIga2V5ID0ga2RmLmNvbXB1dGUocGFzc3dvcmQsIHNhbHQpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNvbXB1dGU6IGZ1bmN0aW9uIChwYXNzd29yZCwgc2FsdCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgY2ZnID0gdGhpcy5jZmc7XG5cblx0ICAgICAgICAgICAgLy8gSW5pdCBoYXNoZXJcblx0ICAgICAgICAgICAgdmFyIGhhc2hlciA9IGNmZy5oYXNoZXIuY3JlYXRlKCk7XG5cblx0ICAgICAgICAgICAgLy8gSW5pdGlhbCB2YWx1ZXNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXkgPSBXb3JkQXJyYXkuY3JlYXRlKCk7XG5cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBkZXJpdmVkS2V5V29yZHMgPSBkZXJpdmVkS2V5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIga2V5U2l6ZSA9IGNmZy5rZXlTaXplO1xuXHQgICAgICAgICAgICB2YXIgaXRlcmF0aW9ucyA9IGNmZy5pdGVyYXRpb25zO1xuXG5cdCAgICAgICAgICAgIC8vIEdlbmVyYXRlIGtleVxuXHQgICAgICAgICAgICB3aGlsZSAoZGVyaXZlZEtleVdvcmRzLmxlbmd0aCA8IGtleVNpemUpIHtcblx0ICAgICAgICAgICAgICAgIGlmIChibG9jaykge1xuXHQgICAgICAgICAgICAgICAgICAgIGhhc2hlci51cGRhdGUoYmxvY2spO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaGFzaGVyLnVwZGF0ZShwYXNzd29yZCkuZmluYWxpemUoc2FsdCk7XG5cdCAgICAgICAgICAgICAgICBoYXNoZXIucmVzZXQoKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0aW9uc1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDE7IGkgPCBpdGVyYXRpb25zOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBibG9jayA9IGhhc2hlci5maW5hbGl6ZShibG9jayk7XG5cdCAgICAgICAgICAgICAgICAgICAgaGFzaGVyLnJlc2V0KCk7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIGRlcml2ZWRLZXkuY29uY2F0KGJsb2NrKTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICBkZXJpdmVkS2V5LnNpZ0J5dGVzID0ga2V5U2l6ZSAqIDQ7XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGRlcml2ZWRLZXk7XG5cdCAgICAgICAgfVxuXHQgICAgfSk7XG5cblx0ICAgIC8qKlxuXHQgICAgICogRGVyaXZlcyBhIGtleSBmcm9tIGEgcGFzc3dvcmQuXG5cdCAgICAgKlxuXHQgICAgICogQHBhcmFtIHtXb3JkQXJyYXl8c3RyaW5nfSBwYXNzd29yZCBUaGUgcGFzc3dvcmQuXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHNhbHQgQSBzYWx0LlxuXHQgICAgICogQHBhcmFtIHtPYmplY3R9IGNmZyAoT3B0aW9uYWwpIFRoZSBjb25maWd1cmF0aW9uIG9wdGlvbnMgdG8gdXNlIGZvciB0aGlzIGNvbXB1dGF0aW9uLlxuXHQgICAgICpcblx0ICAgICAqIEByZXR1cm4ge1dvcmRBc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c3RyaW5nfSBrZXkgVGhlIHNlY3JldCBrZXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBobWFjSGFzaGVyID0gQ3J5cHRvSlMuYWxnby5ITUFDLmNyZWF0ZShDcnlwdG9KUy5hbGdvLlNIQTI1Niwga2V5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBpbml0OiBmdW5jdGlvbiAoaGFzaGVyLCBrZXkpIHtcblx0ICAgICAgICAgICAgLy8gSW5pdCBoYXNoZXJcblx0ICAgICAgICAgICAgaGFzaGVyID0gdGhpcy5faGFzaGVyID0gbmV3IGhhc2hlci5pbml0KCk7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydCBzdHJpbmcgdG8gV29yZEFycmF5LCBlbHNlIGFzc3VtZSBXb3JkQXJyYXkgYWxyZWFkeVxuXHQgICAgICAgICAgICBpZiAodHlwZW9mIGtleSA9PSAnc3RyaW5nJykge1xuXHQgICAgICAgICAgICAgICAga2V5ID0gVXRmOC5wYXJzZShrZXkpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBoYXNoZXJCbG9ja1NpemUgPSBoYXNoZXIuYmxvY2tTaXplO1xuXHQgICAgICAgICAgICB2YXIgaGFzaGVyQmxvY2tTaXplQnl0ZXMgPSBoYXNoZXJCbG9ja1NpemUgKiA0O1xuXG5cdCAgICAgICAgICAgIC8vIEFsbG93IGFyYml0cmFyeSBsZW5ndGgga2V5c1xuXHQgICAgICAgICAgICBpZiAoa2V5LnNpZ0J5dGVzID4gaGFzaGVyQmxvY2tTaXplQnl0ZXMpIHtcblx0ICAgICAgICAgICAgICAgIGtleSA9IGhhc2hlci5maW5hbGl6ZShrZXkpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ2xhbXAgZXhjZXNzIGJpdHNcblx0ICAgICAgICAgICAga2V5LmNsYW1wKCk7XG5cblx0ICAgICAgICAgICAgLy8gQ2xvbmUga2V5IGZvciBpbm5lciBhbmQgb3V0ZXIgcGFkc1xuXHQgICAgICAgICAgICB2YXIgb0tleSA9IHRoaXMuX29LZXkgPSBrZXkuY2xvbmUoKTtcblx0ICAgICAgICAgICAgdmFyIGlLZXkgPSB0aGlzLl9pS2V5ID0ga2V5LmNsb25lKCk7XG5cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBvS2V5V29yZHMgPSBvS2V5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgaUtleVdvcmRzID0gaUtleS53b3JkcztcblxuXHQgICAgICAgICAgICAvLyBYT1Iga2V5cyB3aXRoIHBhZCBjb25zdGFudHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBoYXNoZXJCbG9ja1NpemU7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgb0tleVdvcmRzW2ldIF49IDB4NWM1YzVjNWM7XG5cdCAgICAgICAgICAgICAgICBpS2V5V29yZHNbaV0gXj0gMHgzNjM2MzYzNjtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICBvS2V5LnNpZ0J5dGVzID0gaUtleS5zaWdCeXRlcyA9IGhhc2hlckJsb2NrU2l6ZUJ5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIFNldCBpbml0aWFsIHZhbHVlc1xuXHQgICAgICAgICAgICB0aGlzLnJlc2V0KCk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFJlc2V0cyB0aGlzIEhNQUMgdG8gaXRzIGluaXRpYWwgc3RhdGUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIGhtYWNIYXNoZXIucmVzZXQoKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICByZXNldDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgaGFzaGVyID0gdGhpcy5faGFzaGVyO1xuXG5cdCAgICAgICAgICAgIC8vIFJlc2V0XG5cdCAgICAgICAgICAgIGhhc2hlci5yZXNldCgpO1xuXHQgICAgICAgICAgICBoYXNoZXIudXBkYXRlKHRoaXMuX2lLZXkpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBVcGRhdGVzIHRoaXMgSE1BQyB3aXRoIGEgbWVzc2FnZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gbWVzc2FnZVVwZGF0ZSBUaGUgbWVzc2FnZSB0byBhcHBlbmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtITUFDfSBUaGlzIEhNQUMgaW5zdGFuY2UuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIGhtYWNIYXNoZXIudXBkYXRlKCdtZXNzYWdlJyk7XG5cdCAgICAgICAgICogICAgIGhtYWNIYXNoZXIudXBkYXRlKHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgdXBkYXRlOiBmdW5jdGlvbiAobWVzc2FnZVVwZGF0ZSkge1xuXHQgICAgICAgICAgICB0aGlzLl9oYXNoZXIudXBkYXRlKG1lc3NhZ2VVcGRhdGUpO1xuXG5cdCAgICAgICAgICAgIC8vIENoYWluYWJsZVxuXHQgICAgICAgICAgICByZXR1cm4gdGhpcztcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogRmluYWxpemVzIHRoZSBITUFDIGNvbXB1dGF0aW9uLlxuXHQgICAgICAgICAqIE5vdGUgdGhhdCB0aGUg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ZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBIID0gdGhpcy5faGFzaC53b3JkcztcblxuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMCAgPSBNW29mZnNldCArIDBdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMSAgPSBNW29mZnNldCArIDFdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMiAgPSBNW29mZnNldCArIDJdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMyAgPSBNW29mZnNldCArIDNdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfNCAgPSBNW29mZnNldCArIDRdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfNSAgPSBNW29mZnNldCArIDVdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfNiAgPSBNW29mZnNldCArIDZdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfNyAgPSBNW29mZnNldCArIDddO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfOCAgPSBNW29mZnNldCArIDhdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfOSAgPSBNW29mZnNldCArIDldO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMTAgPSBNW29mZnNldCArIDEwXTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzExID0gTVtvZmZzZXQgKyAxMV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMiA9IE1bb2Zmc2V0ICsgMTJdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMTMgPSBNW29mZnNldCArIDEzXTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzE0ID0gTVtvZmZzZXQgKyAxNF07XG5cdCAgICAgICAgICAgIHZhciBNX29m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AxXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY2ZnOiBCYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgICAgIGtleVNpemU6IDEyOC8zMixcblx0ICAgICAgICAgICAgaGFzaGVyOiBTSEExLFxuXHQgICAgICAgICAgICBpdGVyYXRpb25zOiAxXG5cdCAgICAgICAgfSksXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBJbml0aWFsaXplcyBhIG5ld2x5IGNyZWF0ZWQga2V5IGRlcml2YXRpb24gZnVuY3Rpb24uXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gY2ZnIChPcHRpb25hbCkgVGhlIGNvbmZpZ3VyYXRpb24gb3B0aW9ucyB0byB1c2UgZm9yIHRoZSBkZXJpdmF0aW9uLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIga2RmID0gQ3J5cHRvSlMuYWxnby5QQktERjIuY3JlYXRlKCk7XG5cdCAgICAgICAgICogICAgIHZhciBrZGYgPSBDcnlwdG9KUy5hbGdvLlBCS0RGMi5jcmVhdGUoeyBrZXlTaXplOiA4IH0pO1xuXHQgICAgICAgICAqICAgICB2YXIga2RmID0gQ3J5cHRvSlMuYWxnby5QQktERjIuY3JlYXRlKHsga2V5U2l6ZTogOCwgaXRlcmF0aW9uczogMTAwMCB9KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBpbml0OiBmdW5jdGlvbiAoY2ZnKSB7XG5cdCAgICAgICAgICAgIHRoaXMuY2ZnID0gdGhpcy5jZmcuZXh0ZW5kKGNmZyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbXB1dGVzIHRoZSBQYXNzd29yZC1CYXNlZCBLZXkgRGVyaXZhdGlvbiBGdW5jdGlvbiAyLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQH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cmF0aW9ucyA9IGNmZy5pdGVyYXRpb25zO1xuXG5cdCAgICAgICAgICAgIC8vIEdlbmVyYXRlIGtleVxuXHQgICAgICAgICAgICB3aGlsZSAoZGVyaXZlZEtleVdvcmRzLmxlbmd0aCA8IGtleVNpemUpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBibG9jayA9IGhtYWMudXBkYXRlKHNhbHQpLmZpbmFsaXplKGJsb2NrSW5kZXgpO1xuXHQgICAgICAgICAgICAgICAgaG1hYy5yZXNldCgpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBibG9ja1dvcmRzID0gYmxvY2sud29yZHM7XG5cdCAgICAgICAgICAgICAgICB2YXIgYmxvY2tXb3Jkc0xlbmd0aCA9IGJsb2NrV29yZHMubGVuZ3RoO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBJdGVyYXRpb25zXG5cdCAgICAgICAgICAgICAgICB2YXIgaW50ZXJtZWRpYXRlID0gYmxvY2s7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IGl0ZXJhdGlvbnM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGludGVybWVkaWF0ZSA9IGhtYWMuZmluYWxpemUoaW50ZXJtZWRpYXRlKTtcblx0ICAgICAgICAgICAgICAgICAgICBobWFjLnJlc2V0KCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgICAgIHZhciBpbnRlcm1lZGlhdGVXb3JkcyA9IGludGVybWVkaWF0ZS53b3JkcztcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFhPUiBpbnRlcm1lZGlhdGUgd2l0aCBibG9ja1xuXHQgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgYmxvY2tXb3Jkc0xlbmd0aDsgaisrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGJs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c3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIG5leHRTdGF0ZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gTW9kaWZ5IHRoZSBjb3VudGVyc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgQ1tpXSBePSBYWyhpICsgNCkgJiA3XTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIElWIHNldHVwXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgSVYgPSBpdi53b3Jkcztcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8wID0gSVZbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgSVZfMSA9IElWWzFdO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBHZW5lcmF0ZSBmb3VyIHN1YnZlY3RvcnNcblx0ICAgICAgICAgICAgICAgIHZhciBpMCA9ICgoKElWXzAgPDwgOCkgfCAoSVZfMCA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMCA8PCAyNCkgfCAoSVZfMCA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTIgPSAoKChJVl8xIDw8IDgpIHwgKElWXzEgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8ICgoKElWXzEgPDwgMjQpIHwgKElWXzEgPj4+IDgpKSAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkxID0gKGkwID4+PiAxNikgfCAoaTIgJiAweGZmZmYwMDAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMyA9IChpMiA8PCAxNikgIHwgKGkwICYgMHgwMDAwZmZmZik7XG5cblx0ICAgICAgICAgICAgICAgIC8vIE1vZGlmeSBjb3VudGVyIHZhbHVlc1xuXHQgICAgICAgICAgICAgICAgQ1swXSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbMV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzJdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1szXSBePSBpMztcblx0ICAgICAgICAgICAgICAgIENbNF0gXj0gaTA7XG5cdCAgICAgICAgICAgICAgICBDWzVdIF49IGkxO1xuXHQgICAgICAgICAgICAgICAgQ1s2XSBePSBpMjtcblx0ICAgICAgICAgICAgICAgIENbN10gXj0gaTM7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEl0ZXJhdGUgdGhlIHN5c3RlbSBmb3VyIHRpbWVzXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIG5leHRTdGF0ZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgWCA9IHRoaXMuX1g7XG5cblx0ICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtXG5cdCAgICAgICAgICAgIG5leHRTdGF0ZS5jYWxsKHRoaXMpO1xuXG5cdCAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIga2V5c3RyZWFtIHdvcmRzXG5cdCAgICAgICAgICAgIFNbMF0gPSBYWzBdIF4gKFhbNV0gPj4+IDE2KSBeIChYWzNdIDw8IDE2KTtcblx0ICAgICAgICAgICAgU1sxXSA9IFhbMl0gXiAoWFs3XSA+Pj4gMTYpIF4gKFhbNV0gPDwgMTYpO1xuXHQgICAgICAgICAgICBTWzJdID0gWFs0XSBeIChYWzFdID4+PiAxNikgXiAoWFs3XSA8PCAxNik7XG5cdCAgICAgICAgICAgIFNbM10gPSBYWzZdIF4gKFhbM10gPj4+IDE2KSBeIChYWzFdIDw8IDE2KTtcblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgICAgIFNbaV0gPSAoKChTW2ldIDw8IDgpICB8IChTW2ldID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICAgICgoKFNbaV0gPDwgMjQpIHwgKFNbaV0gPj4+IDgpKSAgJiAweGZmMDBmZjAwKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRW5jcnlwdFxuXHQgICAgICAgICAgICAgICAgTVtvZmZzZXQgKyBpXSBePSBTW2ldO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGJsb2NrU2l6ZTogMTI4LzMyLFxuXG5cdCAgICAgICAgaXZTaXplOiA2NC8zMlxuXHQgICAgfSk7XG5cblx0ICAgIGZ1bmN0aW9uIG5leHRTdGF0ZSgpIHtcblx0ICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICB2YXIgWCA9IHRoaXMuX1g7XG5cdCAgICAgICAgdmFyIEMgPSB0aGlzLl9DO1xuXG5cdCAgICAgICAgLy8gU2F2ZSBvbGQgY291bnRlciB2YWx1ZXNcblx0ICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDg7IGkrKykge1xuXHQgICAgICAgICAgICBDX1tpXSA9IENbaV07XG5cdCAgICAgICAgfVxuXG5cdCAgICAgICAgLy8gQ2FsY3VsYXRlIG5ldyBjb3VudGVyIHZhbHVlc1xuXHQgICAgICAgIENbMF0gPSAoQ1swXSArI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4+IDE2KSwgKEtbMF0gJiAweGZmZmYwMDAwKSB8IChLWzFdICYgMHgwMDAwZmZmZiksXG5cdCAgICAgICAgICAgICAgICAoS1szXSA8PCAxNikgfCAoS1szXSA+Pj4gMTYpLCAoS1sxXSAmIDB4ZmZmZjAwMDApIHwgKEtbMl0gJiAweDAwMDBmZmZmKSxcblx0ICAgICAgICAgICAgICAgIChLWzBdIDw8IDE2KSB8IChLWzBdID4+PiAxNiksIChLWzJdICYgMHhmZmZmMDAwMCkgfCAoS1szXSAmIDB4MDAwMGZmZmYpLFxuXHQgICAgICAgICAgICAgICAgKEtbMV0gPDwgMTYpIHwgKEtbMV0gPj4+IDE2KSwgKEtbM10gJiAweGZmZmYwMDAwKSB8IChLWzBdICYgMHgwMDAwZmZmZilcblx0ICAgICAgICAgICAgXTtcblxuXHQgICAgICAgICAgICAvLyBDYXJyeSBiaXRcblx0ICAgICAgICAgICAgdGhpcy5fYiA9IDA7XG5cblx0ICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIG5leHRTdGF0ZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gTW9kaWZ5IHRoZSBjb3VudGVyc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgQ1tpXSBePSBYWyhpICsgNCkgJiA3XTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIElWIHNldHVwXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgSVYgPSBpdi53b3Jkcztcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8wID0gSVZbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgSVZfMSA9IElWWzFdO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBHZW5lcmF0ZSBmb3VyIHN1YnZlY3RvcnNcblx0ICAgICAgICAgICAgICAgIHZhciBpMCA9ICgoKElWXzAgPDwgOCkgfCAoSVZfMCA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMCA8PCAyNCkgfCAoSVZfMCA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTIgPSAoKChJVl8xIDw8IDgpIHwgKElWXzEgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8ICgoKElWXzEgPDwgMjQpIHwgKElWXzEgPj4+IDgpKSAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkxID0gKGkwID4+PiAxNikgfCAoaTIgJiAweGZmZmYwMDAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMyA9IChpMiA8PCAxNikgIHwgKGkwICYgMHgwMDAwZmZmZik7XG5cblx0ICAgICAgICAgICAgICAgIC8vIE1vZGlmeSBjb3VudGVyIHZhbHVlc1xuXHQgICAgICAgICAgICAgICAgQ1swXSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbMV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzJdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1szXSBePSBpMztcblx0ICAgICAgICAgICAgICAgIENbNF0gXj0gaTA7XG5cdCAgICAgICAgICAgICAgICBDWzVdIF49IGkxO1xuXHQgICAgICAgICAgICAgICAgQ1s2XSBePSBpMjtcblx0ICAgICAgICAgICAgICAgIENbN10gXj0gaTM7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEl0ZXJhdGUgdGhlIHN5c3RlbSBmb3VyIHRpbWVzXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIG5leHRTdGF0ZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgWCA9IHRoaXMuX1g7XG5cblx0ICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtXG5cdCAgICAgICAgICAgIG5leHRTdGF0ZS5jYWxsKHRoaXMpO1xuXG5cdCAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIga2V5c3RyZWFtIHdvcmRzXG5cdCAgICAgICAgICAgIFNbMF0gPSBYWzBdIF4gKFhbNV0gPj4+IDE2KSBeIChYWzNdIDw8IDE2KTtcblx0ICAgICAgICAgICAgU1sxXSA9IFhbMl0gXiAoWFs3XSA+Pj4gMTYpIF4gKFhbNV0gPDwgMTYpO1xuXHQgICAgICAgICAgICBTWzJdID0gWFs0XSBeIChYWzFdID4+PiAxNikgXiAoWFs3XSA8PCAxNik7XG5cdCAgICAgICAgICAgIFNbM10gPSBYWzZdIF4gKFhbM10gPj4+IDE2KSBeIChYWzFdIDw8IDE2KTtcblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgICAgIFNbaV0gPSAoKChTW2ldIDw8IDgpICB8IChTW2ldID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICAgICgoKFNbaV0gPDwgMjQpIHwgKFNbaV0gPj4+IDgpKSAgJiAweGZmMDBmZjAwKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRW5jcnlwdFxuXHQgICAgICAgICAgICAgICA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HJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cblx0ICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCAxNjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBvZmZzZXRfaSA9IG9mZnNldCArIGk7XG5cdCAgICAgICAgICAgICAgICB2YXIgTV9vZmZzZXRfaSA9IE1bb2Zmc2V0X2ldO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwXG5cdCAgICAgICAgICAgICAgICBNW29mZnNldF9pXSA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChNX29mZnNldF9pIDw8IDgpICB8IChNX29mZnNldF9pID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE1fb2Zmc2V0X2kgPDwgMjQpIHwgKE1fb2Zmc2V0X2kgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICAgICAgKTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgSCAgPSB0aGlzLl9oYXNoLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgaGwgPSBfaGwud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBociA9IF9oci53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHpsID0gX3psLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgenIgPSBfenIud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzbCA9IF9zbC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNyID0gX3NyLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhbCwgYmwsIGNsLCBkbCwgZWw7XG5cdCAgICAgICAgICAgIHZhciBhciwgYnIsIGNyLCBkciwgZXI7XG5cblx0ICAgICAgICAgICAgYXIgPSBhbCA9IEhbMF07XG5cdCAgICAgICAgICAgIGJyID0gYmwgPSBIWzFdO1xuXHQgICAgICAgICAgICBjciA9IGNsID0gSFsyXTtcblx0ICAgICAgICAgICAgZHIgPSBkbCA9IEhbM107XG5cdCAgICAgICAgICAgIGVyID0gZWwgPSBIWzRdO1xuXHQgICAgICAgICAgICAvLyBDb21wdXRhdGlvblxuXHQgICAgICAgICAgICB2YXIgdDtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4MDsgaSArPSAxKSB7XG5cdCAgICAgICAgICAgICAgICB0ID0gKGFsICsgIE1bb2Zmc2V0K3psW2ldXSl8MDtcblx0ICAgICAgICAgICAgICAgIGlmIChpPDE2KXtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMShibCxjbCxkbCkgKyBobFswXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTwzMikge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYyKGJsLGNsLGRsKSArIGhsWzFdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDQ4KSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjMoYmwsY2wsZGwpICsgaGxbMl07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NjQpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmNChibCxjbCxkbCkgKyBobFszXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7Ly8gaWYgKGk8ODApIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmNShibCxjbCxkbCkgKyBobFs0XTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIHQgPSB0fDA7XG5cdCAgICAgICAgICAgICAgICB0ID0gIHJvdGwodCxzbFtpXSk7XG5cdCAgICAgICAgICAgICAgICB0ID0gKHQrZWwpfDA7XG5cdCAgICAgICAgICAgICAgICBhbCA9IGVsO1xuXHQgICAgICAgICAgICAgICAgZWwgPSBkbDtcblx0ICAgICAgICAgICAgICAgIGRsID0gcm90bChjbCwgMTApO1xuXHQgICAgICAgICAgICAgICAgY2wgPSBibDtcblx0ICAgICAgICAgICAgICAgIGJsID0gdDtcblxuXHQgICAgICAgICAgICAgICAgdCA9IChhciArIE1bb2Zmc2V0K3pyW2ldXSl8MDtcblx0ICAgICAgICAgICAgICAgIGlmIChpPDE2KXtcblx0XHQgICAgICAgICAgICB0ICs9ICBmNShicixjcixkcikgKyBoclswXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTwzMikge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY0KGJyLGNyLGRyKSArIGhyWzFdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDQ4KSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjMoYnIsY3IsZHIpICsgaHJbMl07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NjQpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMihicixjcixkcikgKyBoclszXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7Ly8gaWYgKGk8ODApIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMShicixjcixkcikgKyBocls0XTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIHQgPSB0fDA7XG5cdCAgICAgICAgICAgICAgICB0ID0gIHJvdGwodCxzcltpXSkgO1xuXHQgICAgICAgICAgICAgICAgdCA9ICh0K2VyKXwwO1xuXHQgICAgICAgICAgICAgICAgYXIgPSBlcjtcblx0ICAgICAgICAgICAgICAgIGVyID0gZHI7XG5cdCAgICAgICAgICAgICAgICBkciA9IHJvdGwoY3IsIDEwKTtcblx0ICAgICAgICAgICAgICAgIGNyID0gYnI7XG5cdCAgICAgICAgICAgICAgICBiciA9IHQ7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgLy8gSW50ZXJtZWRpYXRlIGhhc2ggdmFsdWVcblx0ICAgICAgICAgICAgdCAgICA9IChIWzFdICsgY2wgKyBkcil8MDtcblx0ICAgICAgICAgICAgSFsxXSA9IChIWzJdICsgZGwgKyBlcil8MDtcblx0ICAgICAgICAgICAgSFsyXSA9IChIWzNdICsgZWwgKyBhcil8MDtcblx0ICAgICAgICAgICAgSFszXSA9IChIWzRdICsgYWwgKyBicil8MDtcblx0ICAgICAgICAgICAgSFs0XSA9IChIWzBdICsgYmwgKyBjcil8MDtcblx0ICAgICAgICAgICAgSFswXSA9ICB0O1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5hbGl6ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRhdGEgPSB0aGlzLl9kYXRhO1xuXHQgICAgICAgICAgICB2YXIgZGF0YVdvcmRzID0gZGF0YS53b3JkcztcblxuXHQgICAgICAgICAgICB2YXIgbkJpdHNUb3RhbCA9IHRoaXMuX25EYXRhQnl0ZXMgKiA4O1xuXHQgICAgICAgICAgICB2YXIgbkJpdHNMZWZ0ID0gZGF0YS5zaWdCeXRlcyAqIDg7XG5cblx0ICAgICAgICAgICAgLy8gQWRkIHBhZGRpbmdcblx0ICAgICAgICAgICAgZGF0YVdvcmRzW25CaXRzTGVmdCA+Pj4gNV0gfD0gMHg4MCA8PCAoMjQgLSBuQml0c0xlZnQgJSAzMik7XG5cdCAgICAgICAgICAgIGRhdGFXb3Jkc1soKChuQml0c0xlZnQgKyA2NCkgPj4+IDkpIDw8IDQpICsgMTRdID0gKFxuXHQgICAgICAgICAgICAgICAgKCgobkJpdHNUb3RhbCA8PCA4KSAgfCAobkJpdHNUb3RhbCA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICgoKG5CaXRzVG90YWwgPDwgMjQpIHwgKG5CaXRzVG90YWwgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICBkYXRhLnNpZ0J5dGVzID0gKGRhdGFXb3Jkcy5sZW5ndGggKyAxKSAqIDQ7XG5cblx0ICAgICAgICAgICAgLy8gSGFzaCBmaW5hbCBibG9ja3Ncblx0ICAgICAgICAgICAgdGhpcy5fcHJvY2VzcygpO1xuXG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgaGFzaCA9IHRoaXMuX2hhc2g7XG5cdCAgICAgICAgICAgIHZhciBIID0gaGFzaC53b3JkcztcblxuXHQgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDU7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgICAgIHZhciBIX2kgPSBIW2ldO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwXG5cdCAgICAgICAgICAgICAgICBIW2ldID0gKCgoSF9pIDw8IDgpICB8IChIX2kgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgICAgKCgoSF9pIDw8IDI0KSB8IChIX2kgPj4+IDgpKSAgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFJldHVybiBmaW5hbCBjb21wdXRlZCBoYXNoXG5cdCAgICAgICAgICAgIHJldHVybiBoYXNoO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBjbG9uZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB2YXIgY2xvbmUgPSBIYXNoZXIuY2xvbmUuY2FsbCh0aGlzKTtcblx0ICAgICAgICAgICAgY2xvbmUuX2hhc2ggPSB0aGlzLl9oYXNoLmNsb25lKCk7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UHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIID0gdGhpcy5faGFzaC53b3JkcztcblxuXHQgICAgICAgICAgICAvLyBXb3JraW5nIHZhcmlhYmxlc1xuXHQgICAgICAgICAgICB2YXIgYSA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBiID0gSFsxXTtcblx0ICAgICAgICAgICAgdmFyIGMgPSBIWzJdO1xuXHQgICAgICAgICAgICB2YXIgZCA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBlID0gSFs0XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRhdGlvblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDgwOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gTVtvZmZzZXQgKyBpXSB8IDA7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBuID0gV1tpIC0gM10gXiBXW2kgLSA4XSBeIFdbaSAtIDE0XSBeIFdbaSAtIDE2XTtcblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gKG4gPDwgMSkgfCAobiA+Pj4gMzEpO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICB2YXIgdCA9ICgoYSA8PCA1KSB8IChhID4+PiAyNykpICsgZSArIFdbaV07XG5cdCAgICAgICAgICAgICAgICBpZiAoaSA8IDIwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdCArPSAoKGIgJiBjKSB8ICh+YiAmIGQpKSArIDB4NWE4Mjc5OTk7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGkgPCA0MCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHQgKz0gKGIgXiBjIF4gZCkgKyAweDZlZDllYmExO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpIDwgNjApIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9ICgoYiAmIGMpIHwgKGIgJiBkKSB8IChjICYgZCkpIC0gMHg3MGU0NDMyNDtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSAvKiBpZiAoaSA8IDgwKSAqLyB7XG5cdCAgICAgICAgICAgICAgICAgICAgdCArPSAoYiBeIGMgXiBkKSAtIDB4MzU5ZDNlMmE7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIGUgPSBkO1xuXHQgICAgICAgICAgICAgICAgZCA9IGM7XG5cdCAgICAgICAgICAgICAgICBjID0gKGIgPDwgMzApIHwgKGIgPj4+IDIpO1xuXHQgICAgICAgICAgICAgICAgYiA9IGE7XG5cdCAgICAgICAgICAgICAgICBhID0gdDtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIEludGVybWVkaWF0ZSBoYXNoIHZhbHVlXG5cdCAgICAgICAgICAgIEhbMF0gPSAoSFswXSArIGEpIHwgMDtcblx0ICAgICAgICAgICAgSFsxXSA9IChIWzFdICsgYikgfCAwO1xuXHQgICAgICAgICAgICBIWzJdID0gKEhbMl0gKyBjKSB8IDA7XG5cdCAgICAgICAgICAgIEhbM10gPSAoSFszXSArIGQpIHwgMDtcblx0ICAgICAgICAgICAgSFs0XSA9IChIWzRdICsgZSkgfCAwO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5hbGl6ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRhdGEgPSB0aGlzLl9kYXRhO1xuXHQgICAgICAgICAgICB2YXIgZGF0YVdvcmRzID0gZGF0YS53b3JkcztcblxuXHQgICAgICAgICAgICB2YXIgbkJpdHNUb3RhbCA9IHRoaXMuX25EYXRhQnl0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AoQ3J5cHRvSlMpIHtcblxuXHQoZnVuY3Rpb24gKE1hdGgpIHtcblx0ICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgdmFyIEMgPSBDcnlwdG9KUztcblx0ICAgIHZhciBDX2xpYiA9IEMubGliO1xuXHQgICAgdmFyIFdvcmRBcnJheSA9IENfbGliLldvcmRBcnJheTtcblx0ICAgIHZhciBIYXNoZXIgPSBDX2xpYi5IYXNoZXI7XG5cdCAgICB2YXIgQ19hbGdvID0gQy5hbGdvO1xuXG5cdCAgICAvLyBJbml0aWFsaXphdGlvbiBhbmQgcm91bmQgY29uc3RhbnRzIHRhYmxlc1xuXHQgICAgdmFyIEggPSBbXTtcblx0ICAgIHZhciBLID0gW107XG5cblx0ICAgIC8vIENvbXB1dGUgY29uc3RhbnRzXG5cdCAgICAoZnVuY3Rpb24gKCkge1xuXHQgICAgICAgIGZ1bmN0aW9uIGlzUHJpbWUobikge1xuXHQgICAgICAgICAgICB2YXIgc3FydE4gPSBNYXRoLnNxcnQobik7XG5cdCAgICAgICAgICAgIGZvciAodmFyIGZhY3RvciA9IDI7IGZhY3RvciA8PSBzcXJ0TjsgZmFjdG9yKyspIHtcblx0ICAgICAgICAgICAgICAgIGlmICghKG4gJSBmYWN0b3IpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIHRydWU7XG5cdCAgICAgICAgfVxuXG5cdCAgICAgICAgZnVuY3Rpb24gZ2V0RnJhY3Rpb25hbEJpdHMobikge1xuXHQgICAgICAgICAgICByZXR1cm4gKChuIC0gKG4gfCAwKSkgKiAweDEwMDAwMDAwMCkgfCAwO1xuXHQgICAgICAgIH1cblxuXHQgICAgICAgIHZhciBuID0gMjtcblx0ICAgICAgICB2YXIgblByaW1lID0gMDtcblx0ICAgICAgICB3aGlsZSAoblByaW1lIDwgNjQpIHtcblx0ICAgICAgICAgICAgaWYgKGlzUHJpbWUobikpIHtcblx0ICAgICAgICAgICAgICAgIGlmIChuUHJpbWUgPCA4KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgSFtuUHJpbWVdID0gZ2V0RnJhY3Rpb25hbEJpdHMoTWF0aC5wb3cobiwgMSAvIDIpKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIEtbblByaW1lXSA9IGdldEZyYWN0aW9uYWxCaXRzKE1hdGgucG93KG4sIDEgLyAzKSk7XG5cblx0ICAgICAgICAgICAgICAgIG5QcmltZSsrO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgbisrO1xuXHQgICAgICAgIH1cblx0ICAgIH0oKSk7XG5cblx0ICAgIC8vIFJldXNhYmxlIG9iamVjdFxuXHQgICAgdmFyIFcgPSBbXTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBTSEEtMjU2IGhhc2ggYWxnb3JpdGhtLlxuXHQgICAgICovXG5cdCAgICB2YXIgU0hBMjU2ID0gQ19hbGdvLlNIQTI1NiA9IEhhc2hlci5leHRlbmQoe1xuXHQgICAgICAgIF9kb1Jlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHRoaXMuX2hhc2ggPSBuZXcgV29yZEFycmF5LmluaXQoSC5zbGljZSgwKSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgSCA9IHRoaXMuX2hhc2gud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGEgPSBIWzBdO1xuXHQgICAgICAgICAgICB2YXIgYiA9IEhbMV07XG5cdCAgICAgICAgICAgIHZhciBjID0gSFsyXTtcblx0ICAgICAgICAgICAgdmFyIGQgPSBIWzNdO1xuXHQgICAgICAgICAgICB2YXIgZSA9IEhbNF07XG5cdCAgICAgICAgICAgIHZhciBmID0gSFs1XTtcblx0ICAgICAgICAgICAgdmFyIGcgPSBIWzZdO1xuXHQgICAgICAgICAgICB2YXIgaCA9IEhbN107XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0YXRpb25cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA2NDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoaSA8IDE2KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgV1tpXSA9IE1bb2Zmc2V0ICsgaV0gfCAwO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEweCA9IFdbaSAtIDE1XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEwICA9ICgoZ2FtbWEweCA8PCAyNSkgfCAoZ2FtbWEweCA+Pj4gNykpICBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGdhbW1hMHggPDwgMTQpIHwgKGdhbW1hMHggPj4+IDE4KSkgXlxuXHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnYW1tYTB4ID4+PiAzKTtcblxuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTF4ID0gV1tpIC0gMl07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMSAgPSAoKGdhbW1hMXggPDwgMTUpIHwgKGdhbW1hMXggPj4+IDE3KSkgXlxuXHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChnYW1tYTF4IDw8IDEzKSB8IChnYW1tYTF4ID4+PiAxOSkpIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZ2FtbWExeCA+Pj4gMTApO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgV1tpXSA9IGdhbW1hMCArIFdbaSAtIDddICsgZ2FtbWExICsgV1tpIC0gMTZdO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICB2YXIgY2ggID0gKGUgJiBmKSBeICh+ZSAmIGcpO1xuXHQgICAgICAgICAgICAgICAgdmFyIG1haiA9IChhICYgYikgXiAoYSAmIGMpIF4gKGIgJiBjKTtcblxuXHQgICAgICAgICAgICAgICAgdmFyIHNpZ21hMCA9ICgoYSA8PCAzMCkgfCAoYSA+Pj4gMikpIF4gKChhIDw8IDE5KSB8IChhID4+PiAxMykpIF4gKChhIDw8IDEwKSB8IChhID4+PiAyMikpO1xuXHQgICAgICAgICAgICAgICAgdmFyIHNpZ21hMSA9ICgoZSA8PCAyNikgfCAoZSA+Pj4gNikpIF4gKChlIDw8IDIxKSB8IChlID4+PiAxMSkpIF4gKChlIDw8IDcpICB8IChlID4+PiAyNSkpO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgdDEgPSBoICsgc2lnbWExICsgY2ggKyBLW2ldICsgV1tpXTtcblx0ICAgICAgICAgICAgICAgIHZhciB0MiA9IHNpZ21hMCArIG1hajtcblxuXHQgICAgICAgICAgICAgICAgaCA9IGc7XG5cdCAgICAgICAgICAgICAgICBnID0gZjtcblx0ICAgICAgICAgICAgICAgIGYgPSBlO1xuXHQgICAgICAgICAgICAgICAgZSA9IChkICsgdDEpIHwgMDtcblx0ICAgICAgICAgICAgICAgIGQgPSBjO1xuXHQgICAgICAgICAgICAgICAgYyA9IGI7XG5cdCAgICAgICAgICAgICAgICBiID0gYTtcblx0ICAgICAgICAgICAgICAgIGEgPSAodDEgKyB0MikgfCAwO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSW50ZXJtZWRpYXRlIGhhc2ggdmFsdWVcblx0ICAgICAgICAgICAgSFswXSA9IChIWzBdICsgYSkgfCAwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMV0gKyBiKSB8IDA7XG5cdCA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V0ZSBwaSBpbmRleCBjb25zdGFudHNcblx0ICAgICAgICBmb3IgKHZhciB4ID0gMDsgeCA8IDU7IHgrKykge1xuXHQgICAgICAgICAgICBmb3IgKHZhciB5ID0gMDsgeSA8IDU7IHkrKykge1xuXHQgICAgICAgICAgICAgICAgUElfSU5ERVhFU1t4ICsgNSAqIHldID0geSArICgoMiAqIHggKyAzICogeSkgJSA1KSAqIDU7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9XG5cblx0ICAgICAgICAvLyBDb21wdXRlIHJvdW5kIGNvbnN0YW50c1xuXHQgICAgICAgIHZhciBMRlNSID0gMHgwMTtcblx0ICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI0OyBpKyspIHtcblx0ICAgICAgICAgICAgdmFyIHJvdW5kQ29uc3RhbnRNc3cgPSAwO1xuXHQgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudExzdyA9IDA7XG5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCA3OyBqKyspIHtcblx0ICAgICAgICAgICAgICAgIGlmIChMRlNSICYgMHgwMSkge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBiaXRQb3NpdGlvbiA9ICgxIDw8IGopIC0gMTtcblx0ICAgICAgICAgICAgICAgICAgICBpZiAoYml0UG9zaXRpb24gPCAzMikge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICByb3VuZENvbnN0YW50THN3IF49IDEgPDwgYml0UG9zaXRpb247XG5cdCAgICAgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChiaXRQb3NpdGlvbiA+PSAzMikgKi8ge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICByb3VuZENvbnN0YW50TXN3IF49IDEgPDwgKGJpdFBvc2l0aW9uIC0gMzIpO1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gQ29tcHV0ZSBuZXh0IExGU1Jcblx0ICAgICAgICAgICAgICAgIGlmIChMRlNSICYgMHg4MCkge1xuXHQgICAgICAgICAgICAgICAgICAgIC8vIFByaW1pdGl2ZSBwb2x5bm9taWFsIG92ZXIgR0YoMik6IHheOCArIHheNiArIHheNSArIHheNCArIDFcblx0ICAgICAgICAgICAgICAgICAgICBMRlNSID0gKExGU1IgPDwgMSkgXiAweDcxO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICBMRlNSIDw8PSAxO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgUk9VTkRfQ09OU1RBTlRTW2ldID0gWDY0V29yZC5jcmVhdGUocm91bmRDb25zdGFudE1zdywgcm91bmRDb25zdGFudExzdyk7XG5cdCAgICAgICAgfVxuXHQgICAgfSgpKTtcblxuXHQgICAgLy8gUmV1c2FibGUgb2JqZWN0cyBmb3IgdGVtcG9yYXJ5IHZhbHVlc1xuXHQgICAgdmFyIFQgPSBbXTtcblx0ICAgIChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTsgaSsrKSB7XG5cdCAgICAgICAgICAgIFRbaV0gPSBYNjRXb3JkLmNyZWF0ZSgpO1xuXHQgICAgICAgIH1cblx0ICAgIH0oKSk7XG5cblx0ICAgIC8qKlxuXHQgICAgICogU0hBLTMgaGFzaCBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBTSEEzID0gQ19hbGdvLlNIQTMgPSBIYXNoZXIuZXh0ZW5kKHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb25maWd1cmF0aW9uIG9wdGlvbnMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcHJvcGVydHkge251bWJlcn0gb3V0cHV0TGVuZ3RoXG5cdCAgICAgICAgICogICBUaGUgZGVzaXJlZCBudW1iZXIgb2YgYml0cyBpbiB0aGUgb3V0c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AgICAgICB2YXIgTTJpMSA9IE1bb2Zmc2V0ICsgMiAqIGkgKyAxXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgICAgIE0yaSA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChNMmkgPDwgOCkgIHwgKE0yaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAoKChNMmkgPDwgMjQpIHwgKE0yaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICAgICAgTTJpMSA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChNMmkxIDw8IDgpICB8IChNMmkxID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaTEgPDwgMjQpIHwgKE0yaTEgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICAgICAgKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gQWJzb3JiIG1lc3NhZ2UgaW50byBzdGF0ZVxuXHQgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVtpXTtcblx0ICAgICAgICAgICAgICAgIGxhbmUuaGlnaCBePSBNMmkxO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5sb3cgIF49IE0yaTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFJvdW5kc1xuXHQgICAgICAgICAgICBmb3IgKHZhciByb3VuZCA9IDA7IHJvdW5kIDwgMjQ7IHJvdW5kKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFRoZXRhXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciB4ID0gMDsgeCA8IDU7IHgrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIC8vIE1peCBjb2x1bW4gbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdE1zdyA9IDAsIHRMc3cgPSAwO1xuXHQgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbeCArIDUgKiB5XTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdE1zdyBePSBsYW5lLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHRMc3cgXj0gbGFuZS5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gVGVtcG9yYXJ5IHZhbHVlc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUeCA9IFRbeF07XG5cdCAgICAgICAgICAgICAgICAgICAgVHguaGlnaCA9IHRNc3c7XG5cdCAgICAgICAgICAgICAgICAgICAgVHgubG93ICA9IHRMc3c7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciB4ID0gMDsgeCA8IDU7IHgrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUeDQgPSBUWyh4ICsgNCkgJSA1XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVHgxID0gVFsoeCArIDEpICUgNV07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4MU1zdyA9IFR4MS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUeDFMc3cgPSBUeDEubG93O1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gTWl4IHN1cnJvdW5kaW5nIGNvbHVtbnNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdE1zdyA9IFR4NC5oaWdoIF4gKChUeDFNc3cgPDwgMSkgfCAoVHgxTHN3ID4+PiAzMSkpO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0THN3ID0gVHg0LmxvdyAgXiAoKFR4MUxzdyA8PCAxKSB8IChUeDFNc3cgPj4+IDMxKSk7XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeSA9IDA7IHkgPCA1OyB5KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVt4ICsgNSAqIHldO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBsYW5lLmhpZ2ggXj0gdE1zdztcblx0ICAgICAgICAgICAgICAgICAgICAgICAgbGFuZS5sb3cgIF49IHRMc3c7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBSaG8gUGlcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGxhbmVJbmRleCA9IDE7IGxhbmVJbmRleCA8IDI1OyBsYW5lSW5kZXgrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbbGFuZUluZGV4XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZU1zdyA9IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZUxzdyA9IGxhbmUubG93O1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciByaG9PZmZzZXQgPSBSSE9fT0ZGU0VUU1tsYW5lSW5kZXhdO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gUm90YXRlIGxhbmVzXG5cdCAgICAgICAgICAgICAgICAgICAgaWYgKHJob09mZnNldCA8IDMyKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gKGxhbmVNc3cgPDwgcmhvT2Zmc2V0KSB8IChsYW5lTHN3ID4+PiAoMzIgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSAobGFuZUxzdyA8PCByaG9PZmZzZXQpIHwgKGxhbmVNc3cgPj4+ICgzMiAtIHJob09mZnNldCkpO1xuXHQgICAgICAgICAgICAgICAgICAgIH0gZWxzZSAvKiBpZiAocmhvT2Zmc2V0ID49IDMyKSAqLyB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gKGxhbmVMc3cgPDwgKHJob09mZnNldCAtIDMyKSkgfCAobGFuZU1zdyA+Pj4gKDY0IC0gcmhvT2Zmc2V0KSk7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0THN3ID0gKGxhbmVNc3cgPDwgKHJob09mZnNldCAtIDMyKSkgfCAobGFuZUxzdyA+Pj4gKDY0IC0gcmhvT2Zmc2V0KSk7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gVHJhbnNwb3NlIGxhbmVzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFRQaUxhbmUgPSBUW1BJX0lOREVYRVNbbGFuZUluZGV4XV07XG5cdCAgICAgICAgICAgICAgICAgICAgVFBpTGFuZS5oaWdoID0gdE1zdztcblx0ICAgICAgICAgICAgICAgICAgICBUUGlMYW5lLmxvdyAgPSB0THN3O1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBSaG8gcGkgYXQgeCA9IHkgPSAwXG5cdCAgICAgICAgICAgICAgICB2YXIgVDAgPSBUWzBdO1xuXHQgICAgICAgICAgICAgICAgdmFyIHN0YXRlMCA9IHN0YXRlWzBdO1xuXHQgICAgICAgICAgICAgICAgVDAuaGlnaCA9IHN0YXRlMC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgVDAubG93ICA9IHN0YXRlMC5sb3c7XG5cblx0ICAgICAgICAgICAgICAgIC8vIENoaVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgeCA9IDA7IHggPCA1OyB4KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB5ID0gMDsgeSA8IDU7IHkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmVJbmRleCA9IHggKyA1ICogeTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVtsYW5lSW5kZXhdO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgVExhbmUgPSBUW2xhbmVJbmRleF07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUeDFMYW5lID0gVFsoKHggKyAxKSAlIDUpICsgNSAqIHldO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgVHgyTGFuZSA9IFRbKCh4ICsgMikgJSA1KSArIDUgKiB5XTtcblxuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBNaXggcm93c1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBsYW5lLmhpZ2ggPSBUTGFuZS5oaWdoIF4gKH5UeDFMYW5lLmhpZ2ggJiBUeDJMYW5lLmhpZ2gpO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBsYW5lLmxvdyAgPSBUTGFuZS5sb3cgIF4gKH5UeDFMYW5lLmxvdyAgJiBUeDJMYW5lLmxvdyk7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBJb3RhXG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlWzBdO1xuXHQgICAgICAgICAgICAgICAgdmFyIHJvdW5kQ29uc3RhbnQgPSBST1VORF9DT05TVEFOVFNbcm91bmRdO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5oaWdoIF49IHJvdW5kQ29uc3RhbnQuaGlnaDtcblx0ICAgICAgICAgICAgICAgIGxhbmUubG93ICBePSByb3VuZENvbnN0YW50Lmxvdzs7XG5cdCAgICAgICAgICAgIH1cbl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RoTGFuZXMgPSBvdXRwdXRMZW5ndGhCeXRlcyAvIDg7XG5cblx0ICAgICAgICAgICAgLy8gU3F1ZWV6ZVxuXHQgICAgICAgICAgICB2YXIgaGFzaFdvcmRzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb3V0cHV0TGVuZ3RoTGFuZXM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2ldO1xuXHQgICAgICAgICAgICAgICAgdmFyIGxhbmVNc3cgPSBsYW5lLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZUxzdyA9IGxhbmUubG93O1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgbGFuZU1zdyA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChsYW5lTXN3IDw8IDgpICB8IChsYW5lTXN3ID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVNc3cgPDwgMjQpIHwgKGxhbmVNc3cgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICAgICAgKTtcblx0ICAgICAgICAgICAgICAgIGxhbmVMc3cgPSAoXG5cdCAgICAgICAgICAgICAgICAgICAgKCgobGFuZUxzdyA8PCA4KSAgfCAobGFuZUxzdyA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAoKChsYW5lTHN3IDw8IDI0KSB8IChsYW5lTHN3ID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNxdWVlemUgc3RhdGUgdG8gcmV0cmlldmUgaGFzaFxuXHQgICAgICAgICAgICAgICAgaGFzaFdvcmRzLnB1c2gobGFuZ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AweDVmMWQzNmYxKSxcblx0ICAgICAgICAgICAgICAgIG5ldyBYNjRXb3JkLmluaXQoMHg1MTBlNTI3ZiwgMHhhZGU2ODJkMSksIG5ldyBYNjRXb3JkLmluaXQoMHg5YjA1Njg4YywgMHgyYjNlNmMxZiksXG5cdCAgICAgICAgICAgICAgICBuZXcgWDY0V29yZC5pbml0KDB4MWY4M2Q5YWIsIDB4ZmI0MWJkNmIpLCBuZXcgWDY0V29yZC5pbml0KDB4NWJlMGNkMTksIDB4MTM3ZTIxNzkpXG5cdCAgICAgICAgICAgIF0pO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBIID0gdGhpcy5faGFzaC53b3JkcztcblxuXHQgICAgICAgICAgICB2YXIgSDAgPSBIWzBdO1xuXHQgICAgICAgICAgICB2YXIgSDEgPSBIWzFdO1xuXHQgICAgICAgICAgICB2YXIgSDIgPSBIWzJdO1xuXHQgICAgICAgICAgICB2YXIgSDMgPSBIWzNdO1xuXHQgICAgICAgICAgICB2YXIgSDQgPSBIWzRdO1xuXHQgICAgICAgICAgICB2YXIgSDUgPSBIWzVdO1xuXHQgICAgICAgICAgICB2YXIgSDYgPSBIWzZdO1xuXHQgICAgICAgICAgICB2YXIgSDcgPSBIWzddO1xuXG5cdCAgICAgICAgICAgIHZhciBIMGggPSBIMC5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDBsID0gSDAubG93O1xuXHQgICAgICAgICAgICB2YXIgSDFoID0gSDEuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEgxbCA9IEgxLmxvdztcblx0ICAgICAgICAgICAgdmFyIEgyaCA9IEgyLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIMmwgPSBIMi5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIM2ggPSBIMy5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDNsID0gSDMubG93O1xuXHQgICAgICAgICAgICB2YXIgSDRoID0gSDQuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEg0bCA9IEg0Lmxvdztcblx0ICAgICAgICAgICAgdmFyIEg1aCA9IEg1LmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBINWwgPSBINS5sb3c7XG5cdCAgICAgICAgICAgIHZhciBINmggPSBINi5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDZsID0gSDYubG93O1xuXHQgICAgICAgICAgICB2YXIgSDdoID0gSDcuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEg3bCA9IEg3LmxvdztcblxuXHQgICAgICAgICAgICAvLyBXb3JraW5nIHZhcmlhYmxlc1xuXHQgICAgICAgICAgICB2YXIgYWggPSBIMGg7XG5cdCAgICAgICAgICAgIHZhciBhbCA9IEgwbDtcblx0ICAgICAgICAgICAgdmFyIGJoID0gSDFoO1xuXHQgICAgICAgICAgICB2YXIgYmwgPSBIMWw7XG5cdCAgICAgICAgICAgIHZhciBjaCA9IEgyaDtcblx0ICAgICAgICAgICAgdmFyIGNsID0gSDJsO1xuXHQgICAgICAgICAgICB2YXIgZGggPSBIM2g7XG5cdCAgICAgICAgICAgIHZhciBkbCA9IEgzbDtcblx0ICAgICAgICAgICAgdmFyIGVoID0gSDRoO1xuXHQgICAgICAgICAgICB2YXIgZWwgPSBINGw7XG5cdCAgICAgICAgICAgIHZhciBmaCA9IEg1aDtcblx0ICAgICAgICAgICAgdmFyIGZsID0gSDVsO1xuXHQgICAgICAgICAgICB2YXIgZ2ggPSBINmg7XG5cdCAgICAgICAgICAgIHZhciBnbCA9IEg2bDtcblx0ICAgICAgICAgICAgdmFyIGhoID0gSDdoO1xuXHQgICAgICAgICAgICB2YXIgaGwgPSBIN2w7XG5cblx0ICAgICAgICAgICAgLy8gUm91bmRzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODA7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgICAgIHZhciBXaSA9IFdbaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEV4dGVuZCBtZXNzYWdlXG5cdCAgICAgICAgICAgICAgICBpZiAoaSA8IDE2KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpaCA9IFdpLmhpZ2ggPSBNW29mZnNldCArIGkgKiAyXSAgICAgfCAwO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWwgPSBXaS5sb3cgID0gTVtvZmZzZXQgKyBpICogMiArIDFdIHwgMDtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gR2FtbWEwXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMHggID0gV1tpIC0gMTVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4aCA9IGdhbW1hMHguaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEweGwgPSBnYW1tYTB4Lmxvdztcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEwaCAgPSAoKGdhbW1hMHhoID4+PiAxKSB8IChnYW1tYTB4bCA8PCAzMSkpIF4gKChnYW1tYTB4aCA+Pj4gOCkgfCAoZ2FtbWEweGwgPDwgMjQpKSBeIChnYW1tYTB4aCA+Pj4gNyk7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMGwgID0gKChnYW1tYTB4bCA+Pj4gMSkgfCAoZ2FtbWEweGggPDwgMzEpKSBeICgoZ2FtbWEweGwgPj4+IDgpIHwgKGdhbW1hMHhoIDw8IDI0KSkgXiAoKGdhbW1hMHhsID4+PiA3KSB8IChnYW1tYTB4aCA8PCAyNSkpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gR2FtbWExXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXggID0gV1tpIC0gMl07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXhoID0gZ2FtbWExeC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTF4bCA9IGdhbW1hMXgubG93O1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTFoICA9ICgoZ2FtbWExeGggPj4+IDE5KSB8IChnYW1tYTF4bCA8PCAxMykpIF4gKChnYW1tYTF4aCA8PCAzKSB8IChnYW1tYTF4bCA+Pj4gMjkpKSBeIChnYW1tYTF4aCA+Pj4gNik7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMWwgID0gKChnYW1tYTF4bCA+Pj4gMTkpIHwgKGdhbW1hMXhoIDw8IDEzKSkgXiAoKGdhbW1hMXhsIDw8IDMpIHwgKGdhbW1hMXhoID4+PiAyOSkpIF4gKChnYW1tYTF4bCA+Pj4gNikgfCAoZ2FtbWExeGggPDwgMjYpKTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFdbaV0gPSBnYW1tYTAgKyBXW2kgLSA3XSArIGdhbW1hMSArIFdbaSAtIDE2XVxuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaTcgID0gV1tpIC0gN107XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpN2ggPSBXaTcuaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2k3bCA9IFdpNy5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2kxNiAgPSBXW2kgLSAxNl07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpMTZoID0gV2kxNi5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaTE2bCA9IFdpMTYubG93O1xuXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpbCA9IGdhbW1hMGwgKyBXaTdsO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWggPSBnYW1tYTBoICsgV2k3aCArICgoV2lsID4+PiAwKSA8IChnYW1tYTBsID4+PiAwKSA/IDEgOiAwKTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2lsID0gV2lsICsgZ2FtbWExbDtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2loICsgZ2FtbWExaCArICgoV2lsID4+PiAwKSA8IChnYW1tYTFsID4+PiAwKSA/IDEgOiAwKTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2lsID0gV2lsICsgV2kxNmw7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpaCA9IFdpaCArIFdpMTZoICsgKChXaWwgPj4+IDApIDwgKFdpMTZsID4+PiAwKSA/IDEgOiAwKTtcblxuXHQgICAgICAgICAgICAgICAgICAgIFdpLmhpZ2ggPSBXaWg7XG5cdCAgICAgICAgICAgICAgICAgICAgV2kubG93ICA9IFdpbDtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgdmFyIGNoaCAgPSAoZWggJiBmaCkgXiAofmVoICYgZ2gpO1xuXHQgICAgICAgICAgICAgICAgdmFyIGNobCAgPSAoZWwgJiBmbCkgXiAofmVsICYgZ2wpO1xuXHQgICAgICAgICAgICAgICAgdmFyIG1hamggPSAoYWggJiBiaCkgXiAoYWggJiBjaCkgXiAoYmggJiBjaCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFqbCA9IChhbCAmIGJsKSBeIChhbCAmIGNsKSBeIChibCAmIGNsKTtcblxuXHQgICAgICAgICAgICAgICAgdmFyIHNpZ21hMGggPSAoKGFoID4+PiAyOCkgfCAoYWwgPDwgNCkpICBeICgoYWggPDwgMzApICB8IChhbCA+Pj4gMikpIF4gKChhaCA8PCAyNSkgfCAoYWwgPj4+IDcpKTtcblx0ICAgICAgICAgICAgICAgIHZhciBzaWdtYTBsID0gKChhbCA+Pj4gMjgpIHwgKGFoIDw8IDQpKSAgXiAoKGFsIDw8IDMwKSAgfCAoYWggPj4+IDIpKSBeICgoYWwgPDwgMjUpIHwgKGFoID4+PiA3KSk7XG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWExaCA9ICgoZWggPj4+IDE0KSB8IChlbCA8PCAxOCkpIF4gKChlaCA+Pj4gMTgpIHwgKGVsIDw8IDE0KSkgXiAoKGVoIDw8IDIzKSB8IChlbCA+Pj4gOSkpO1xuXHQgICAgICAgICAgICAgICAgdmFyIHNpZ21hMWwgPSAoKGVsID4+PiAxNCkgfCAoZWggPDwgMTgpKSBeICgoZWwgPj4+IDE4KSB8IChlaCA8PCAxNCkpIF4gKChlbCA8PCAyMykgfCAoZWggPj4+IDkpKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gdDEgPSBoICsgc2lnbWExICsgY2ggKyBLW2ldICsgV1tpXVxuXHQgICAgICAgICAgICAgICAgdmFyIEtpICA9IEtbaV07XG5cdCAgICAgICAgICAgICAgICB2YXIgS2loID0gS2kuaGlnaDtcblx0ICAgICAgICAgICAgICAgIHZhciBLaWwgPSBLaS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0MWwgPSBobCArIHNpZ21hMWw7XG5cdCAgICAgICAgICAgICAgICB2YXIgdDFoID0gaGggKyBzaWdtYTFoICsgKCh0MWwgPj4+IDApIDwgKGhsID4+PiAwKSA/IDEgOiAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciB0MWwgPSB0MWwgKyBjaGw7XG5cdCAgICAgICAgICAgICAgICB2YXIgdDFoID0gdDFoICsgY2hoICsgKCh0MWwgPj4+IDApIDwgKGNobCA+Pj4gMCkgPyAxIDogMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgdDFsID0gdDFsICsgS2lsO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQxaCA9IHQxaCArIEtpaCArICgodDFsID4+PiAwKSA8IChLaWwgPj4+IDApID8gMSA6IDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQxbCA9IHQxbCArIFdpbDtcblx0ICAgICAgICAgICAgICAgIHZhciB0MWggPSB0MWggKyBXaWggKyAoKHQxbCA+Pj4gMCkgPCAoV2lsID4+PiAwKSA/IDEgOiAwKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gdDIgPSBzaWdtYTAgKyBtYWpcblx0ICAgICAgICAgICAgICAgIHZhciB0MmwgPSBzaWdtYTBsICsgbWFqbDtcblx0ICAgICAgICAgICAgICAgIHZhciB0MmggPSBzaWdtYTBoICsgbWFqaCArICgodDJsID4+PiAwKSA8IChzaWdtYTBsID4+PiAwKSA/IDEgOiAwKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gVXBkYXRlIHdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgICAgICBoaCA9IGdoO1xuXHQgICAgICAgICAgICAgICAgaGwgPSBnbDtcblx0ICAgICAgICAgICAgICAgIGdoID0gZmg7XG5cdCAgICAgICAgICAgICAgICBnbCA9IGZsO1xuXHQgICAgICAgICAgICAgICAgZmggPSBlaDtcblx0ICAgICAgICAgICAgICAgIGZsID0gZWw7XG5cdCAgICAgICAgICAgICAgICBlbCA9IChkbCArIHQxbCkgfCAwO1xuXHQgICAgICAgICAgICAgICAgZWggPSAoZGggKyB0MWggKyAoKGVsID4+PiAwKSA8IChkbCA+Pj4gMCkgPyAxIDogMCkpIHwgMDtcblx0ICAgICAgICAgICAgICAgIGRoID0gY2g7XG5cdCAgICAgICAgICAgICAgICBkbCA9IGNsO1xuXHQgICAgICAgICAgICAgICAgY2ggPSBiaDtcblx0ICAgICAgICAgICAgICAgIGNsID0gYmw7XG5cdCAgICAgICAgICAgICAgICBiaCA9IGFoO1xuXHQgICAgICAgICAgICAgICAgYmwgPSBhbDtcblx0ICAgICAgICAgICAgICAgIGFsID0gKHQxbCArIHQybCkgfCAwO1xuXHQgICAgICAgICAgICAgICAgYWggPSAodDFoICsgdDJoICsgKChhbCA+Pj4gMCkgPCAodDFsID4+PiAwKSA/IDEgOiAwKSkgfCAwO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSW50ZXJtZWRpYXRlIGhhc2ggdmFsdWVcblx0ICAgICAgICAgICAgSDBsID0gSDAubG93ICA9IChIMGwgKyBhbCk7XG5cdCAgICAgICAgICAgIEgwLmhpZ2ggPSAoSDBoICsgYWggKyAoKEgwbCA+Pj4gMCkgPCAoYWwgPj4+IDApID8gMSA6IDApKTtcblx0ICAgICAgICAgICAgSDFsID0gSDEubG93ICA9IChIMWwgKyBibCk7XG5cdCAgICAgICAgICAgIEgxLmhpZ2ggPSAoSDFoICsgYmggKyAoKEgxbCA+Pj4gMCkgPCAoYmwgPj4+IDApID8gMSA6IDApKTtcblx0ICAgICAgICAgICAgSDJsID0gSDIubG93ICA9IChIMmwgKyBjbCk7XG5cdCAgICAgICAgICAgIEgyLmhpZ2ggPSAoSDJoICsgY2ggKyAoKEgybCA+Pj4gMCkgPCAoY2wgPj4+IDApID8gMSA6IDApKTtcblx0ICAgICAgICAgICAgSDNsID0gSDMubG93ICA9IChIM2wgKyBkbCk7XG5cdCAgICAgICAgICAgIEgzLmhpZ2ggPSAoSDNoICsgZGggKyAoKEgzbCA+Pj4gMCkgPCAoZGwgPj4+IDApID8gMSA6IDApKTtcblx0ICAgICAgICAgICAgSDRsID0gSDQubG93ICA9IChINGwgKyBlbCk7XG5cdCAgICAgICAgICAgIEg0LmhpZ2ggPSAoSDRoICsgZWggKyAoKEg0bCA+Pj4gMCkgPCAoZWwgPj4+IDApID8gMSA6IDApKTtcblx0ICAgICAgICAgICAgSDVsID0gSDUubG93ICA9IChINWwgKyBmbCk7XG5cdCAgICAgICAgICAgIEg1LmhpZ2ggPSAoSDVoICsgZmggKyAoKEg1bCA+Pj4gMCkgPCAoZmwgPj4+IDApID8gMSA6IDApKTtcblx0ICAgICAgICAgICAgSDZsID0gSDYubG93ICA9IChINmwgKyBnbCk7XG5cdCAgICAgICAgICAgIEg2LmhpZ2ggPSAoSDZoICsgZ2ggKyAoKEg2bCA+Pj4gMC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DAwOiAweDgwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMDogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4OTAwMDAwMDA6IDB4ODAwMjAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDAwOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4YjAwMDAwMDA6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGMwMDAwMDAwOiAweDgwMDIsXG5cdCAgICAgICAgICAgIDB4ZDAwMDAwMDA6IDB4ODAwMDAyLFxuXHQgICAgICAgICAgICAweGUwMDAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwMDA6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHg4MDAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDA6IDB4ODA4MjAyLFxuXHQgICAgICAgICAgICAweDI4MDAwMDAwOiAweDgyMDIsXG5cdCAgICAgICAgICAgIDB4MzgwMDAwMDA6IDB4ODAwMCxcblx0ICAgICAgICAgICAgMHg0ODAwMDAwMDogMHg4MDgyMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDAwMDA6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDY4MDAwMDAwOiAweDgwODAwMixcblx0ICAgICAgICAgICAgMHg3ODAwMDAwMDogMHgyLFxuXHQgICAgICAgICAgICAweDg4MDAwMDAwOiAweDgwMDIwMCxcblx0ICAgICAgICAgICAgMHg5ODAwMDAwMDogMHg4MjAwLFxuXHQgICAgICAgICAgICAweGE4MDAwMDAwOiAweDgwODAwMCxcblx0ICAgICAgICAgICAgMHhiODAwMDAwMDogMHg4MDAyMDIsXG5cdCAgICAgICAgICAgIDB4YzgwMDAwMDA6IDB4ODAwMDAyLFxuXHQgICAgICAgICAgICAweGQ4MDAwMDAwOiAweDgwMDIsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwMDA6IDB4MjAyLFxuXHQgICAgICAgICAgICAweGY4MDAwMDAwOiAweDgwMDAwMCxcblx0ICAgICAgICAgICAgMHgxOiAweDgwMDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDE6IDB4Mixcblx0ICAgICAgICAgICAgMHgyMDAwMDAwMTogMHg4MDgyMDAsXG5cdCAgICAgICAgICAgIDB4MzAwMDAwMDE6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDQwMDAwMDAxOiAweDgwODAwMixcblx0ICAgICAgICAgICAgMHg1MDAwMDAwMTogMHg4MjAwLFxuXHQgICAgICAgICAgICAweDYwMDAwMDAxOiAweDIwMCxcblx0ICAgICAgICAgICAgMHg3MDAwMDAwMTogMHg4MDAyMDIsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDE6IDB4ODA4MjAyLFxuXHQgICAgICAgICAgICAweDkwMDAwMDAxOiAweDgwODAwMCxcblx0ICAgICAgICAgICAgMHhhMDAwMDAwMTogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4YjAwMDAwMDE6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHhjMDAwMDAwMTogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4ZDAwMDAwMDE6IDB4ODAwMjAwLFxuXHQgICAgICAgICAgICAweGUwMDAwMDAxOiAweDgwMDIsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwMDE6IDB4MCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxOiAweDgwODIwMixcblx0ICAgICAgICAgICAgMHgxODAwMDAwMTogMHg4MDgwMDAsXG5cdCAgICAgICAgICAgIDB4MjgwMDAwMDE6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDAxOiAweDIwMCxcblx0ICAgICAgICAgICAgMHg0ODAwMDAwMTogMHg4MDAwLFxuXHQgICAgICAgICAgICAweDU4MDAwMDAxOiAweDgwMDAwMixcblx0ICAgICAgICAgICAgMHg2ODAwMDAwMTogMHgyLFxuXHQgICAgICAgICAgICAweDc4MDAwMDAxOiAweDgyMDIsXG5cdCAgICAgICAgICAgIDB4ODgwMDAwMDE6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHg5ODAwMDAwMTogMHg4MDAyMDIsXG5cdCAgICAgICAgICAgIDB4YTgwMDAwMDE6IDB4MjAyLFxuXHQgICAgICAgICAgICAweGI4MDAwMDAxOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHhjODAwMDAwMTogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwMDE6IDB4MCxcblx0ICAgICAgICAgICAgMHhlODAwMDAwMTogMHg4MjAwLFxuXHQgICAgICAgICAgICAweGY4MDAwMDAxOiAweDgwODAwMlxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4NDAwODQwMTAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDogMHg0MDAwLFxuXHQgICAgICAgICAgICAweDIwMDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4MzAwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHg0MDAwMDAwOiAweDQwMDAwMDEwLFxuXHQgICAgICAgICAgICAweDUwMDAwMDA6IDB4NDAwODQwMDAsXG5cdCAgICAgICAgICAgIDB4NjAwMDAwMDogMHg0MDAwNDAwMCxcblx0ICAgICAgICAgICAgMHg3MDAwMDAwOiAweDEwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA6IDB4ODQwMDAsXG5cdCAgICAgICAgICAgIDB4OTAwMDAwMDogMHg0MDAwNDAxMCxcblx0ICAgICAgICAgICAgMHhhMDAwMDAwOiAweDQwMDAwMDAwLFxuXHQgICAgICAgICAgICAweGIwMDAwMDA6IDB4ODQwMTAsXG5cdCAgICAgICAgICAgIDB4YzAwMDAwMDogMHg4MDAxMCxcblx0ICAgICAgICAgICAgMHhkMDAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDogMHg0MDEwLFxuXHQgICAgICAgICAgICAweGYwMDAwMDA6IDB4NDAwODAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwOiAweDQwMDA0MDAwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDA6IDB4ODQwMTAsXG5cdCAgICAgICAgICAgIDB4MjgwMDAwMDogMHgxMCxcblx0ICAgICAgICAgICAgMHgzODAwMDAwOiAweDQwMDA0MDEwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDA6IDB4NDAwODQwMTAsXG5cdCAgICAgICAgICAgIDB4NTgwMDAwMDogMHg0MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHg2ODAwMDAwOiAweDgwMDAwLFxuXHQgICAgICAgICAgICAweDc4MDAwMDA6IDB4NDAwODAwMTAsXG5cdCAgICAgICAgICAgIDB4ODgwMDAwMDogMHg4MDAxMCxcblx0ICAgICAgICAgICAgMHg5ODAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDAwMDogMHg0MDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDA6IDB4NDAwODAwMDAsXG5cdCAgICAgICAgICAgIDB4YzgwMDAwMDogMHg0MDAwMDAxMCxcblx0ICAgICAgICAgICAgMHhkODAwMDAwOiAweDg0MDAwLFxuXHQgICAgICAgICAgICAweGU4MDAwMDA6IDB4NDAwODQwMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDogMHg0MDEwLFxuXHQgICAgICAgICAgICAweDEwMDAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTEwMDAwMDA6IDB4NDAwODAwMTAsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwMDA6IDB4NDAwMDQwMTAsXG5cdCAgICAgICAgICAgIDB4MTMwMDAwMDA6IDB4NDAwODQwMDAsXG5cdCAgICAgICAgICAgIDB4MTQwMDAwMDA6IDB4NDAwODAwMDAsXG5cdCAgICAgICAgICAgIDB4MTUwMDAwMDA6IDB4MTAsXG5cdCAgICAgICAgICAgIDB4MTYwMDAwMDA6IDB4ODQwMTAsXG5cdCAgICAgICAgICAgIDB4MTcwMDAwMDA6IDB4NDAwMCxcblx0ICAgICAgICAgICAgMHgxODAwMDAwMDogMHg0MDEwLFxuXHQgICAgICAgICAgICAweDE5MDAwMDAwOiAweDgwMDAwLFxuXHQgICAgICAgICAgICAweDFhMDAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweDFiMDAwMDAwOiAweDQwMDAwMDEwLFxuXHQgICAgICAgICAgICAweDFjMDAwMDAwOiAweDg0MDAwLFxuXHQgICAgICAgICAgICAweDFkMDAwMDAwOiAweDQwMDA0MDAwLFxuXHQgICAgICAgICAgICAweDFlMDAwMDAwOiAweDQwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDFmMDAwMDAwOiAweDQwMDg0MDEwLFxuXHQgICAgICAgICAgICAweDEwODAwMDAwOiAweDg0MDEwLFxuXHQgICAgICAgICAgICAweDExODAwMDAwOiAweDgwMDAwLFxuXHQgICAgICAgICAgICAweDEyODAwMDAwOiAweDQwMDgwMDAwLFxuXHQgICAgICAgICAgICAweDEzODAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDAwMDA6IDB4NDAwMDQwMDAsXG5cdCAgICAgICAgICAgIDB4MTU4MDAwMDA6IDB4NDAwODQwMTAsXG5cdCAgICAgICAgICAgIDB4MTY4MDAwMDA6IDB4MTAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwMDA6IDB4NDAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTg4MDAwMDA6IDB4NDAwODQwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4MWE4MDAwMDA6IDB4NDAwMDQwMTAsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwMDA6IDB4ODAwMTAsXG5cdCAgICAgICAgICAgIDB4MWM4MDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxZDgwMDAwMDogMHg0MDEwLFxuXHQgICAgICAgICAgICAweDFlODAwMDAwOiAweDQwMDgwMDEwLFxuXHQgICAgICAgICAgICAweDFmODAwMDAwOiAweDg0MDAwXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHgxMDQsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MjAwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MzAwMDAwOiAweDEwMTA0LFxuXHQgICAgICAgICAgICAweDQwMDAwMDogMHgxMDAwNCxcblx0ICAgICAgICAgICAgMHg1MDAwMDA6IDB4NDAwMDAwNCxcblx0ICAgICAgICAgICAgMHg2MDAwMDA6IDB4NDAxMDEwNCxcblx0ICAgICAgICAgICAgMHg3MDAwMDA6IDB4NDAxMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDA6IDB4NDAwMDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwMDA6IDB4NDAxMDEwMCxcblx0ICAgICAgICAgICAgMHhhMDAwMDA6IDB4MTAxMDAsXG5cdCAgICAgICAgICAgIDB4YjAwMDAwOiAweDQwMTAwMDQsXG5cdCAgICAgICAgICAgIDB4YzAwMDAwOiAweDQwMDAxMDQsXG5cdCAgICAgICAgICAgIDB4ZDAwMDAwOiAweDEwMDAwLFxuXHQgICAgICAgICAgICAweGUwMDAwMDogMHg0LFxuXHQgICAgICAgICAgICAweGYwMDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDA6IDB4NDAxMDEwMCxcblx0ICAgICAgICAgICAgMHgxODAwMDA6IDB4NDAxMDAwNCxcblx0ICAgICAgICAgICAgMHgyODAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgzODAwMDA6IDB4NDAwMDEwMCxcblx0ICAgICAgICAgICAgMHg0ODAwMDA6IDB4NDAwMDAwNCxcblx0ICAgICAgICAgICAgMHg1ODAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4NjgwMDAwOiAweDEwMDA0LFxuXHQgICAgICAgICAgICAweDc4MDAwMDogMHgxMDQsXG5cdCAgICAgICAgICAgIDB4ODgwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4OTgwMDAwOiAweDEwMCxcblx0ICAgICAgICAgICAgMHhhODAwMDA6IDB4NDAxMDAwMCxcblx0ICAgICAgICAgICAgMHhiODAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4YzgwMDAwOiAweDEwMTAwLFxuXHQgICAgICAgICAgICAweGQ4MDAwMDogMHg0MDAwMTA0LFxuXHQgICAgICAgICAgICAweGU4MDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweGY4MDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDEwMDAwMDA6IDB4NDAxMDEwMCxcblx0ICAgICAgICAgICAgMHgxMTAwMDAwOiAweDEwMDA0LFxuXHQgICAgICAgICAgICAweDEyMDAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4MTMwMDAwMDogMHg0MDAwMTAwLFxuXHQgICAgICAgICAgICAweDE0MDAwMDA6IDB4MTAwLFxuXHQgICAgICAgICAgICAweDE1MDAwMDA6IDB4NDAxMDEwNCxcblx0ICAgICAgICAgICAgMHgxNjAwMDAwOiAweDQwMDAwMDQsXG5cdCAgICAgICAgICAgIDB4MTcwMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHgxOTAwMDAwOiAweDQwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDAwMDogMHg0LFxuXHQgICAgICAgICAgICAweDFiMDAwMDA6IDB4MTAxMDAsXG5cdCAgICAgICAgICAgIDB4MWMwMDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweDFkMDAwMDA6IDB4MTA0LFxuXHQgICAgICAgICAgICAweDFlMDAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4MWYwMDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDEwODAwMDA6IDB4NDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMTgwMDAwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHgxMjgwMDAwOiAweDQwMTAxMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDE0ODAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTU4MDAwMDogMHg0MDAwMTAwLFxuXHQgICAgICAgICAgICAweDE2ODAwMDA6IDB4MTAwLFxuXHQgICAgICAgICAgICAweDE3ODAwMDA6IDB4NDAxMDAwNCxcblx0ICAgICAgICAgICAgMHgxODgwMDAwOiAweDEwMDAwLFxuXHQgICAgICAgICAgICAweDE5ODAwMDA6IDB4NDAxMDEwNCxcblx0ICAgICAgICAgICAgMHgxYTgwMDAwOiAweDEwMTA0LFxuXHQgICAgICAgICAgICAweDFiODAwMDA6IDB4NDAwMDAwNCxcblx0ICAgICAgICAgICAgMHgxYzgwMDAwOiAweDQwMDAxMDQsXG5cdCAgICAgICAgICAgIDB4MWQ4MDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweDFlODAwMDA6IDB4NCxcblx0ICAgICAgICAgICAgMHgxZjgwMDAwOiAweDEwMTAwXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHg4MDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDogMHg4MDAwMTA0MCxcblx0ICAgICAgICAgICAgMHgyMDAwMDogMHg0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MzAwMDA6IDB4ODA0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHg1MDAwMDogMHg0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4NjAwMDA6IDB4ODAwMDAwNDAsXG5cdCAgICAgICAgICAgIDB4NzAwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDgwMDAwOiAweDgwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDkwMDAwOiAweDQwMDAwMCxcblx0ICAgICAgICAgICAgMHhhMDAwMDogMHg0MCxcblx0ICAgICAgICAgICAgMHhiMDAwMDogMHg4MDAwMTAwMCxcblx0ICAgICAgICAgICAgMHhjMDAwMDogMHg4MDQwMDA0MCxcblx0ICAgICAgICAgICAgMHhkMDAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweGUwMDAwOiAweDEwMDAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDA6IDB4ODA0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDogMHg4MDAwMTA0MCxcblx0ICAgICAgICAgICAgMHgxODAwMDogMHg0MCxcblx0ICAgICAgICAgICAgMHgyODAwMDogMHg4MDQwMDA0MCxcblx0ICAgICAgICAgICAgMHgzODAwMDogMHg4MDAwMTAwMCxcblx0ICAgICAgICAgICAgMHg0ODAwMDogMHg0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDA6IDB4ODA0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4NjgwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHg3ODAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHg4ODAwMDogMHgxMDAwLFxuXHQgICAgICAgICAgICAweDk4MDAwOiAweDgwNDAxMDAwLFxuXHQgICAgICAgICAgICAweGE4MDAwOiAweDQwMDAwMCxcblx0ICAgICAgICAgICAgMHhiODAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweGM4MDAwOiAweDgwMDAwMDAwLFxuXHQgICAgICAgICAgICAweGQ4MDAwOiAweDQwMDA0MCxcblx0ICAgICAgICAgICAgMHhlODAwMDogMHg0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4ZjgwMDA6IDB4ODAwMDAwNDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwOiAweDQwMDA0MCxcblx0ICAgICAgICAgICAgMHgxMTAwMDA6IDB4NDAxMDAwLFxuXHQgICAgICAgICAgICAweDEyMDAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxMzAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxNDAwMDA6IDB4MTA0MCxcblx0ICAgICAgICAgICAgMHgxNTAwMDA6IDB4ODA0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4MTYwMDAwOiAweDgwNDAxMDAwLFxuXHQgICAgICAgICAgICAweDE3MDAwMDogMHg4MDAwMTA0MCxcblx0ICAgICAgICAgICAgMHgxODAwMDA6IDB4ODA0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTkwMDAwOiAweDgwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDFhMDAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYjAwMDA6IDB4NDAxMDQwLFxuXHQgICAgICAgICAgICAweDFjMDAwMDogMHg4MDAwMTAwMCxcblx0ICAgICAgICAgICAgMHgxZDAwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweDFlMDAwMDogMHg0MCxcblx0ICAgICAgICAgICAgMHgxZjAwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHgxMDgwMDA6IDB4ODA0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTE4MDAwOiAweDgwNDAxMDQwLFxuXHQgICAgICAgICAgICAweDEyODAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDEzODAwMDogMHg0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDAwOiAweDQwMDA0MCxcblx0ICAgICAgICAgICAgMHgxNTgwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTY4MDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE3ODAwMDogMHg0MCxcblx0ICAgICAgICAgICAgMHgxODgwMDA6IDB4ODAwMDAwNDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDAwOiAweDEwMDAsXG5cdCAgICAgICAgICAgIDB4MWE4MDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDFiODAwMDogMHg4MDQwMDA0MCxcblx0ICAgICAgICAgICAgMHgxYzgwMDA6IDB4MTA0MCxcblx0ICAgICAgICAgICAgMHgxZDgwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwOiAweDQwMDAwMCxcblx0ICAgICAgICAgICAgMHgxZjgwMDA6IDB4NDAxMDQwXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHg4MCxcblx0ICAgICAgICAgICAgMHgxMDAwOiAweDEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MjAwMDogMHg0MDAwMCxcblx0ICAgICAgICAgICAgMHgzMDAwOiAweDIwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDQwMDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4NTAwMDogMHgxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDYwMDA6IDB4MjEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4NzAwMDogMHg0MDA4MCxcblx0ICAgICAgICAgICAgMHg4MDAwOiAweDEwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4OTAwMDogMHgyMDA0MDAwMCxcblx0ICAgICAgICAgICAgMHhhMDAwOiAweDIwMDAwMDgwLFxuXHQgICAgICAgICAgICAweGIwMDA6IDB4MjEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4YzAwMDogMHgyMTA0MDAwMCxcblx0ICAgICAgICAgICAgMHhkMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDogMHgxMDQwMDgwLFxuXHQgICAgICAgICAgICAweGYwMDA6IDB4MjEwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwOiAweDEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTgwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHgyODAwOiAweDgwLFxuXHQgICAgICAgICAgICAweDM4MDA6IDB4MTA0MDAwMCxcblx0ICAgICAgICAgICAgMHg0ODAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDU4MDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4NjgwMDogMHgyMTA0MDAwMCxcblx0ICAgICAgICAgICAgMHg3ODAwOiAweDIwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDg4MDA6IDB4MjAwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4OTgwMDogMHgwLFxuXHQgICAgICAgICAgICAweGE4MDA6IDB4MjEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4YjgwMDogMHgxMDAwMDgwLFxuXHQgICAgICAgICAgICAweGM4MDA6IDB4MjAwMDAwODAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHhlODAwOiAweDEwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwMDogMHg0MDA4MCxcblx0ICAgICAgICAgICAgMHgxMDAwMDogMHg0MDAwMCxcblx0ICAgICAgICAgICAgMHgxMTAwMDogMHg4MCxcblx0ICAgICAgICAgICAgMHgxMjAwMDogMHgyMDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHgxNDAwMDogMHgxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDE1MDAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDE2MDAwOiAweDIwMDQwMDgwLFxuXHQgICAgICAgICAgICAweDE3MDAwOiAweDEwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDA6IDB4MjEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTkwMDA6IDB4MjEwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDA6IDB4MTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxYjAwMDogMHgyMDA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxYzAwMDogMHg0MDA4MCxcblx0ICAgICAgICAgICAgMHgxZDAwMDogMHgyMDAwMDA4MCxcblx0ICAgICAgICAgICAgMHgxZTAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFmMDAwOiAweDEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTA4MDA6IDB4MjEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MTE4MDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMjgwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDEzODAwOiAweDIwMDQwMDgwLFxuXHQgICAgICAgICAgICAweDE0ODAwOiAweDIwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE1ODAwOiAweDEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTY4MDA6IDB4ODAsXG5cdCAgICAgICAgICAgIDB4MTc4MDA6IDB4MjEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTg4MDA6IDB4NDAwODAsXG5cdCAgICAgICAgICAgIDB4MTk4MDA6IDB4MjEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MWE4MDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxYjgwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYzgwMDogMHgxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDFkODAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDFlODAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFmODAwOiAweDIwMDAwMDgwXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHgxMDAwMDAwOCxcblx0ICAgICAgICAgICAgMHgxMDA6IDB4MjAwMCxcblx0ICAgICAgICAgICAgMHgyMDA6IDB4MTAyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzAwOiAweDEwMjAyMDA4LFxuXHQgICAgICAgICAgICAweDQwMDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHg1MDA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDYwMDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4NzAwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDogMHgwLFxuXHQgICAgICAgICAgICAweDkwMDogMHgxMDAwMjAwOCxcblx0ICAgICAgICAgICAgMHhhMDA6IDB4MjAyMDAwLFxuXHQgICAgICAgICAgICAweGIwMDogMHg4LFxuXHQgICAgICAgICAgICAweGMwMDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHhkMDA6IDB4MjAyMDA4LFxuXHQgICAgICAgICAgICAweGUwMDogMHgyMDA4LFxuXHQgICAgICAgICAgICAweGYwMDogMHgxMDIwMjAwMCxcblx0ICAgICAgICAgICAgMHg4MDogMHgxMDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODA6IDB4MTAyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MjgwOiAweDgsXG5cdCAgICAgICAgICAgIDB4MzgwOiAweDIwMDAwMCxcblx0ICAgICAgICAgICAgMHg0ODA6IDB4MjAyMDA4LFxuXHQgICAgICAgICAgICAweDU4MDogMHgxMDAwMDAwOCxcblx0ICAgICAgICAgICAgMHg2ODA6IDB4MTAwMDIwMDAsXG5cdCAgICAgICAgICAgIDB4NzgwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4ODgwOiAweDIwMDAwOCxcblx0ICAgICAgICAgICAgMHg5ODA6IDB4MjAwMCxcblx0ICAgICAgICAgICAgMHhhODA6IDB4MTAwMDIwMDgsXG5cdCAgICAgICAgICAgIDB4YjgwOiAweDEwMjAwMDA4LFxuXHQgICAgICAgICAgICAweGM4MDogMHgwLFxuXHQgICAgICAgICAgICAweGQ4MDogMHgxMDIwMjAwMCxcblx0ICAgICAgICAgICAgMHhlODA6IDB4MjAyMDAwLFxuXHQgICAgICAgICAgICAweGY4MDogMHgxMDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMDAwOiAweDEwMDAyMDAwLFxuXHQgICAgICAgICAgICAweDExMDA6IDB4MTAyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTIwMDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgxMzAwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTQwMDogMHgyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTUwMDogMHgxMDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNjAwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDE3MDA6IDB4MjAyMDAwLFxuXHQgICAgICAgICAgICAweDE4MDA6IDB4MjAyMDA4LFxuXHQgICAgICAgICAgICAweDE5MDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxYTAwOiAweDgsXG5cdCAgICAgICAgICAgIDB4MWIwMDogMHgxMDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYzAwOiAweDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWQwMDogMHgxMDAwMjAwOCxcblx0ICAgICAgICAgICAgMHgxZTAwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweDFmMDA6IDB4MjAwMDA4LFxuXHQgICAgICAgICAgICAweDEwODA6IDB4OCxcblx0ICAgICAgICAgICAgMHgxMTgwOiAweDIwMjAwMCxcblx0ICAgICAgICAgICAgMHgxMjgwOiAweDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMzgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDE0ODA6IDB4MTAwMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTU4MDogMHgyMDA4LFxuXHQgICAgICAgICAgICAweDE2ODA6IDB4MTAyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTc4MDogMHgxMDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODgwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweDE5ODA6IDB4MTAyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MWE4MDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweDFiODA6IDB4MjAyMDA4LFxuXHQgICAgICAgICAgICAweDFjODA6IDB4MjAwMDA4LFxuXHQgICAgICAgICAgICAweDFkODA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxZTgwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDFmODA6IDB4MTAwMDIwMDhcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMDogMHgyMDAwNDAxLFxuXHQgICAgICAgICAgICAweDIwOiAweDQwMCxcblx0ICAgICAgICAgICAgMHgzMDogMHgxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4NDA6IDB4MjEwMDQwMSxcblx0ICAgICAgICAgICAgMHg1MDogMHgwLFxuXHQgICAgICAgICAgICAweDYwOiAweDEsXG5cdCAgICAgICAgICAgIDB4NzA6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHg4MDogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDkwOiAweDEwMDAwMSxcblx0ICAgICAgICAgICAgMHhhMDogMHgyMDAwMDAxLFxuXHQgICAgICAgICAgICAweGIwOiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4YzA6IDB4MjEwMDAwMCxcblx0ICAgICAgICAgICAgMHhkMDogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4ZTA6IDB4MTAwNDAwLFxuXHQgICAgICAgICAgICAweGYwOiAweDIwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODogMHgyMTAwMDAxLFxuXHQgICAgICAgICAgICAweDE4OiAweDAsXG5cdCAgICAgICAgICAgIDB4Mjg6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgzODogMHgyMTAwNDAwLFxuXHQgICAgICAgICAgICAweDQ4OiAweDEwMDAwMCxcblx0ICAgICAgICAgICAgMHg1ODogMHgyMDAwMDAxLFxuXHQgICAgICAgICAgICAweDY4OiAweDIwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4Nzg6IDB4NDAxLFxuXHQgICAgICAgICAgICAweDg4OiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHg5ODogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweGE4OiAweDIxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4Yjg6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweGM4OiAweDQwMCxcblx0ICAgICAgICAgICAgMHhkODogMHgyMTAwNDAxLFxuXHQgICAgICAgICAgICAweGU4OiAweDEsXG5cdCAgICAgICAgICAgIDB4Zjg6IDB4MTAwNDAwLFxuXHQgICAgICAgICAgICAweDEwMDogMHgyMDAwMDAwLFxuXHQgICAgICAgICAgICAweDExMDogMHgxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTIwOiAweDIwMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MTMwOiAweDIxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTQwOiAweDEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxNTA6IDB4MjAwMDQwMCxcblx0ICAgICAgICAgICAgMHgxNjA6IDB4MjEwMDQwMCxcblx0ICAgICAgICAgICAgMHgxNzA6IDB4MTAwNDAxLFxuXHQgICAgICAgICAgICAweDE4MDogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4MTkwOiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MWEwOiAweDEwMDQwMCxcblx0ICAgICAgICAgICAgMHgxYjA6IDB4MSxcblx0ICAgICAgICAgICAgMHgxYzA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxZDA6IDB4MjEwMDAwMCxcblx0ICAgICAgICAgICAgMHgxZTA6IDB4MjAwMDAwMSxcblx0ICAgICAgICAgICAgMHgxZjA6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDEwODogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTE4OiAweDIwMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MTI4OiAweDIxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTM4OiAweDEsXG5cdCAgICAgICAgICAgIDB4MTQ4OiAweDIwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTU4OiAweDEwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNjg6IDB4NDAxLFxuXHQgICAgICAgICAgICAweDE3ODogMHgyMTAwNDAwLFxuXHQgICAgICAgICAgICAweDE4ODogMHgyMDAwMDAxLFxuXHQgICAgICAgICAgICAweDE5ODogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweDFhODogMHgwLFxuXHQgICAgICAgICAgICAweDFiODogMHgyMTAwNDAxLFxuXHQgICAgICAgICAgICAweDFjODogMHgxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MWQ4OiAweDQwMCxcblx0ICAgICAgICAgICAgMHgxZTg6IDB4MjAwMDQwMCxcblx0ICAgICAgICAgICAgMHgxZjg6IDB4MTAwMDAxXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHg4MDAwODIwLFxuXHQgICAgICAgICAgICAweDE6IDB4MjAwMDAsXG5cdCAgICAgICAgICAgIDB4MjogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDM6IDB4MjAsXG5cdCAgICAgICAgICAgIDB4NDogMHgyMDAyMCxcblx0ICAgICAgICAgICAgMHg1OiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4NjogMHg4MDIwODAwLFxuXHQgICAgICAgICAgICAweDc6IDB4ODAwLFxuXHQgICAgICAgICAgICAweDg6IDB4ODAyMDAwMCxcblx0ICAgICAgICAgICAgMHg5OiAweDgwMDA4MDAsXG5cdCAgICAgICAgICAgIDB4YTogMHgyMDgwMCxcblx0ICAgICAgICAgICAgMHhiOiAweDgwMjAwMjAsXG5cdCAgICAgICAgICAgIDB4YzogMHg4MjAsXG5cdCAgICAgICAgICAgIDB4ZDogMHgwLFxuXHQgICAgICAgICAgICAweGU6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHhmOiAweDIwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAwOiAweDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMTogMHg4MDIwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAyOiAweDgwMDA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDM6IDB4ODAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwNDogMHg4MDIwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA1OiAweDIwODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA2OiAweDIwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA3OiAweDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA4OiAweDgwMDAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDk6IDB4ODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBhOiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBiOiAweDgwMjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGM6IDB4MCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwZDogMHg4MDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBlOiAweDgwMDA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGY6IDB4MjAwMDAsXG5cdCAgICAgICAgICAgIDB4MTA6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4MTE6IDB4ODAyMDgwMCxcblx0ICAgICAgICAgICAgMHgxMjogMHgyMCxcblx0ICAgICAgICAgICAgMHgxMzogMHg4MDAsXG5cdCAgICAgICAgICAgIDB4MTQ6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHgxNTogMHg4MDAwMDIwLFxuXHQgICAgICAgICAgICAweDE2OiAweDgwMjAwMjAsXG5cdCAgICAgICAgICAgIDB4MTc6IDB4MjAwMDAsXG5cdCAgICAgICAgICAgIDB4MTg6IDB4MCxcblx0ICAgICAgICAgICAgMHgxOTogMHgyMDAyMCxcblx0ICAgICAgICAgICAgMHgxYTogMHg4MDIwMDAwLFxuXHQgICAgICAgICAgICAweDFiOiAweDgwMDA4MjAsXG5cdCAgICAgICAgICAgIDB4MWM6IDB4ODAyMDgyMCxcblx0ICAgICAgICAgICAgMHgxZDogMHgyMDgwMCxcblx0ICAgICAgICAgICAgMHgxZTogMHg4MjAsXG5cdCAgICAgICAgICAgIDB4MWY6IDB4ODAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxMDogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxMTogMHg4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTI6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxMzogMHgyMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxNDogMHgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxNTogMHg4MDIwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE2OiAweDgwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTc6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxODogMHg4MDIwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE5OiAweDgwMDAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWE6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxYjogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFjOiAweDIwODAwLFxuXH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xO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQXNzZW1ibGUgMTYgc3Via2V5c1xuXHQgICAgICAgICAgICB2YXIgc3ViS2V5cyA9IHRoaXMuX3N1YktleXMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgblN1YktleSA9IDA7IG5TdWJLZXkgPCAxNjsgblN1YktleSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBDcmVhdGUgc3Via2V5XG5cdCAgICAgICAgICAgICAgICB2YXIgc3ViS2V5ID0gc3ViS2V5c1tuU3ViS2V5XSA9IFtdO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIGJpdFNoaWZ0ID0gQklUX1NISUZUU1tuU3ViS2V5XTtcblxuXHQgICAgICAgICAgICAgICAgLy8gU2VsZWN0IDQ4IGJpdHMgYWNjb3JkaW5nIHRvIFBDMlxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2VsZWN0IGZyb20gdGhlIGxlZnQgMjgga2V5IGJpdHNcblx0ICAgICAgICAgICAgICAgICAgICBzdWJLZXlbKGkgLyA2KSB8IDBdIHw9IGtleUJpdHNbKChQQzJbaV0gLSAxKSArIGJpdFNoaWZ0KSAlIDI4XSA8PCAoMzEgLSBpICUgNik7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBTZWxlY3QgZnJvbSB0aGUgcmlnaHQgMjgga2V5IGJpdHNcblx0ICAgICAgICAgICAgICAgICAgICBzdWJLZXlbNCArICgoaSAvIDYpIHwgMCldIHw9IGtleUJpdHNbMjggKyAoKChQQzJbaSArIDI0XSAtIDEpICsgYml0U2hpZnQpICUgMjgpXSA8PCAoMzEgLSBpICUgNik7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNpbmNlIGVhY2ggc3Via2V5IGlzIGFwcGxpZWQgdG8gYW4gZXhwYW5kZWQgMzItYml0IGlucHV0LFxuXHQgICAgICAgICAgICAgICAgLy8gdGhlIHN1YmtleSBjYW4gYmUgYnJva2VuIGludG8gOCB2YWx1ZXMgc2NhbGVkIHRvIDMyLWJpdHMsXG5cdCAgICAgICAgICAgICAgICAvLyB3aGljaCBhbGxvd3MgdGhlIGtleSB0byBiZSB1c2VkIHdpdGhvdXQgZXhwYW5zaW9uXG5cdCAgICAgICAgICAgICAgICBzdWJLZXlbMF0gPSAoc3ViS2V5WzBdIDw8IDEpIHwgKHN1YktleVswXSA+Pj4gMzEpO1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDE7IGkgPCA3OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBzdWJLZXlbaV0gPSBzdWJLZXlbaV0gPj4+ICgoaSAtIDEpICogNCArIDMpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgc3ViS2V5WzddID0gKHN1YktleVs3XSA8PCA1KSB8IChzdWJLZXlbN10gPj4+IDI3KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGUgaW52ZXJzZSBzdWJrZXlzXG5cdCAgICAgICAgICAgIHZhciBpbnZTdWJLZXlzID0gdGhpcy5faW52U3ViS2V5cyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDE2OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIGludlN1YktleXNbaV0gPSBzdWJLZXlzWzE1IC0gaV07XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgZW5jcnlwdEJsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIHRoaXMuX2RvQ3J5cHRCbG9jayhNLCBvZmZzZXQsIHRoaXMuX3N1YktleXMpO1xuXHQgICAgICAg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gICAgICAgICAgICAgICAgdmFyIHJCbG9jayA9IHRoaXMuX3JCbG9jaztcblxuXHQgICAgICAgICAgICAgICAgLy8gRmVpc3RlbCBmdW5jdGlvblxuXHQgICAgICAgICAgICAgICAgdmFyIGYgPSAwO1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBmIHw9IFNCT1hfUFtpXVsoKHJCbG9jayBeIHN1YktleVtpXSkgJiBTQk9YX01BU0tbaV0pID4+PiAwXTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIHRoaXMuX2xCbG9jayA9IHJCbG9jaztcblx0ICAgICAgICAgICAgICAgIHRoaXMuX3JCbG9jayA9IGxCbG9jayBeIGY7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBVbmRvIHN3YXAgZnJvbSBsYXN0IHJvdW5kXG5cdCAgICAgICAgICAgIHZhciB0ID0gdGhpcy5fbEJsb2NrO1xuXHQgICAgICAgICAgICB0aGlzLl9sQmxvY2sgPSB0aGlzLl9yQmxvY2s7XG5cdCAgICAgICAgICAgIHRoaXMuX3JCbG9jayA9IHQ7XG5cblx0ICAgICAgICAgICAgLy8gRmluYWwgcGVybXV0YXRpb25cblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDEsICAweDU1NTU1NTU1KTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VSTC5jYWxsKHRoaXMsIDgsICAweDAwZmYwMGZmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VSTC5jYWxsKHRoaXMsIDIsICAweDMzMzMzMzMzKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDE2LCAweDAwMDBmZmZmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDQsICAweDBmMGYwZjBmKTtcblxuXHQgICAg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JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IGhpZ2ggVGhlIGhpZ2ggMzIgYml0cy5cblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbG93IFRoZSBsb3cgMzIgYml0cy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHg2NFdvcmQgPSBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgwMDAxMDIwMywgMHgwNDA1MDYwNyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgaW5pdDogZnVuY3Rpb24gKGhpZ2gsIGxvdykge1xuXHQgICAgICAgICAgICB0aGlzLmhpZ2ggPSBoaWdoO1xuXHQgICAgICAgICAgICB0aGlzLmxvdyA9IGxvdztcblx0ICAgICAgICB9XG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBCaXR3aXNlIE5PVHMgdGhpcyB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIG5lZ2F0aW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgbmVnYXRlZCA9IHg2NFdvcmQubm90KCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gbm90OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIHZhciBoaWdoID0gfnRoaXMuaGlnaDtcblx0ICAgICAgICAgICAgLy8gdmFyIGxvdyA9IH50aGlzLmxvdztcblxuXHQgICAgICAgICAgICAvLyByZXR1cm4gWDY0V29yZC5jcmVhdGUoaGlnaCwgbG93KTtcblx0ICAgICAgICAvLyB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQml0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blx0ICAgICAgICAvLyB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogU2hpZnRzIHRoaXMgd29yZCBuIGJpdHMgdG8gdGhlIGxlZnQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbiBUaGUgbnVtYmVyIG9mIGJpdHMgdG8gc2hpZnQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgc2hpZnRpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBzaGlmdGVkID0geDY0V29yZC5zaGlmdEwoMjUpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIC8vIHNoaWZ0TDogZnVuY3Rpb24gKG4pIHtcblx0ICAgICAgICAgICAgLy8gaWYgKG4gPCAzMikge1xuXHQgICAgICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSAodGhpcy5oaWdoIDw8IG4pIHwgKHRoaXMubG93ID4+PiAoMzIgLSBuKSk7XG5cdCAgICAgICAgICAgICAgICAvLyB2YXIgbG93ID0gdGhpcy5sb3cgPDwgbjtcblx0ICAgICAgICAgICAgLy8gfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgIC8vIHZhciBoaWdoID0gdGhpcy5sb3cgPDwgKG4gLSAzMik7XG5cdCAgICAgICAgICAgICAgICAvLyB2YXIgbG93ID0gMDtcblx0ICAgICAgICAgICAgLy8gfVxuXG5cdCAgICAgICAgICAgIC8vIHJldHVybiBYNjRXb3JkLmNyZWF0ZShoaWdoLCBsb3cpO1xuXHQgICAgICAgIC8vIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBTaGlmdHMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgcmlnaHQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbiBUaGUgbnVtYmVyIG9mIGJpdHMgdG8gc2hpZnQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgc2hpZnRpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBzaGlmdGVkID0geDY0V29yZC5zaGlmdFIoNyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gc2hpZnRSOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyBpZiAobiA8IDMyKSB7XG5cdCAgICAgICAgICAgICAgICAvLyB2YXIgbG93ID0gKHRoaXMubG93ID4+PiBuKSB8ICh0aGlzLmhpZ2ggPDwgKDMyIC0gbikpO1xuXHQgICAgICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSB0aGlzLmhpZ2ggPj4+IG47XG5cdCAgICAgICAgICAgIC8vIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAvLyB2YXIgbG93ID0gdGhpcy5oaWdoID4+PiAobiAtIDMyKTtcblx0ICAgICAgICAgICAgICAgIC8vIHZhciBoaWdoID0gMDtcblx0ICAgICAgICAgICAgLy8gfVxuXG5cdCAgICAgICAgICAgIC8vIHJldHVybiBYNjRXb3JkLmNyZWF0ZShoaWdoLCBsb3cpO1xuXHQgICAgICAgIC8vIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBSb3RhdGVzIHRoaXMgd29yZCBuIGJpdHMgdG8gdGhlIGxlZnQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbiBUaGUgbnVtYmVyIG9mIGJpdHMgdG8gcm90YXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V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g7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgeDMyV29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB4NjRXb3Jkc0xlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgeDY0V29yZCA9IHg2NFdvcmRzW2ldO1xuXHQgICAgICAgICAgICAgICAgeDMyV29yZHMucHVzaCh4NjRXb3JkLmhpZ2gpO1xuXHQgICAgICAgICAgICAgICAgeDMyV29yZHMucHVzaCh4NjRXb3JkLmxvdyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gWDMyV29yZEFycmF5LmNyZWF0ZSh4MzJXb3JkcywgdGhpcy5zaWdCeXRlcyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENyZWF0ZXMgYSBjb3B5IG9mIHRoaXMgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1g2NFdvcmRBcnJheX0gVGhlIGNsb25lLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgY2xvbmUgPSB4NjRXb3JkQXJyYXkuY2xvbmUoKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBjbG9uZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB2YXIgY2xvbmUgPSBCYXNlLmNsb25lLmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgLy8gQ2xvbmUgXCJ3b3Jkc1wiIGFycmF5XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IGNsb25lLndvcmRzID0gdGhpcy53b3Jkcy5zbGljZSgwKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBlYWNoIFg2NFdvcmQgb2JqZWN0XG5cdCAgICA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QYXJhbXM6ICdVUkxTZWFyY2hQYXJhbXMnIGluIHNlbGYsXG4gICAgICAgICAgaXRlcmFibGU6ICdTeW1ib2wnIGluIHNlbGYgJiYgJ2l0ZXJhdG9yJyBpbiBTeW1ib2wsXG4gICAgICAgICAgYmxvYjogJ0ZpbGVSZWFkZXInIGluIHNlbGYgJiYgJ0Jsb2InIGluIHNlbGYgJiYgKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgbmV3IEJsb2IoKVxuICAgICAgICAgICAgICByZXR1cm4gdHJ1ZVxuICAgICAgICAgICAgfSBjYXRjaChlKSB7XG4gICAgICAgICAgICAgIHJldHVybiBmYWxzZVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pKCksXG4gICAgICAgICAgZm9ybURhdGE6ICdGb3JtRGF0YScgaW4gc2VsZixcbiAgICAgICAgICBhcnJheUJ1ZmZlcjogJ0FycmF5QnVmZmVyJyBpbiBzZWxmXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc3VwcG9ydC5hcnJheUJ1ZmZlcikge1xuICAgICAgICAgIHZhciB2aWV3Q2xhc3NlcyA9IFtcbiAgICAgICAgICAgICdbb2JqZWN0IEludDhBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgVWludDhBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgVWludDhDbGFtcGVkQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEludDE2QXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IFVpbnQxNkFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBJbnQzMkFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50MzJBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgRmxvYXQzMkFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBGbG9hdDY0QXJyYXldJ1xuICAgICAgICAgIF1cblxuICAgICAgICAgIHZhciBpc0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dWUgbGlzdFxuICAgICAgICBmdW5jdGlvbiBpdGVyYXRvckZvcihpdGVtcykge1xuICAgICAgICAgIHZhciBpdGVyYXRvciA9IHtcbiAgICAgICAgICAgIG5leHQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBpdGVtcy5zaGlmdCgpXG4gICAgICAgICAgICAgIHJldHVybiB7ZG9uZTogdmFsdWUgPT09IHVuZGVmaW5lZCwgdmFsdWU6IHZhbHVlfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzdXBwb3J0Lml0ZXJhYmxlKSB7XG4gICAgICAgICAgICBpdGVyYXRvcltTeW1ib2wuaXRlcmF0b3JdID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJldHVybiBpdGVyYXRvclxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBpdGVyYXRvclxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gSGVhZGVycyhoZWFkZXJzKSB7XG4gICAgICAgICAgdGhpcy5tYXAgPSB7fVxuXG4gICAgICAgICAgaWYgKGhlYWRlcnMgaW5zdGFuY2VvZiBIZWFkZXJzKSB7XG4gICAgICAgICAgICBoZWFkZXJzLmZvckVhY2goZnVuY3Rpb24odmFsdWUsIG5hbWUpIHtcbiAgICAgICAgICAgICAgdGhpcy5hcHBlbmQobmFtZSwgdmFsdWUpXG4gICAgICAgICAgICB9LCB0aGlzKVxuICAgICAgICAgIH0gZWxzZSBpZiAoQXJyYXkuaXNBcnJheShoZWFkZXJzKSkge1xuICAgICAgICAgICAgaGVhZGVycy5mb3JFYWNoKGZ1bmN0aW9uKGhlYWRlcikge1xuICAgICAgICAgICAgICB0aGlzLmFwcGVuZChoZWFkZXJbMF0sIGhlYWRlclsxXSlcbiAgICAgICAgICAgIH0sIHRoaXMpXG4gICAgICAgICAgfSBlbHNlIGlmIChoZWFkZXJzKSB7XG4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XVxuICAgICAgICAgIHRoaXMuZm9yRWFjaChmdW5jdGlvbih2YWx1ZSwgbmFtZSkgeyBpdGVtcy5wdXNoKFtuYW1lLCB2YWx1ZV0pIH0pXG4gICAgICAgICAgcmV0dXJuIGl0ZXJhdG9yRm9yKGl0ZW1zKVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHN1cHBvcnQuaXRlcmFibGUpIHtcbiAgICAgICAgICBIZWFkZXJzLnByb3RvdHlwZVtTeW1ib2wuaXRlcmF0b3JdID0gSGVhZGVycy5wcm90b3R5cGUuZW50cmllc1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gY29uc3VtZWQoYm9keSkge1xuICAgICAgICAgIGlmIChib2R5LmJvZHlVc2VkKSB7XG4gICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZWplY3QobmV3IFR5cGVFcnJvcignQWxyZWFkeSByZWFkJykpXG4gICAgICAgICAgfVxuICAgICAgICAgIGJvZHkuYm9keVVzZWQgPSB0cnVlXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBmaWxlUmVhZGVyUmVhZHkocmVhZGVyKSB7XG4gICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgcmVhZGVyLm9ubG9hZCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZXNvbHZlKHJlYWRlci5yZXN1bHQpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZWFkZXIub25lcnJvciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZWplY3QocmVhZGVyLmVycm9yKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiByZWFkQmxvYkFzQXJyYXlCdWZmZXIoYmxvYikge1xuICAgICAgICAgIHZhciByZWFkZXIgPSBuZXcgRmlsZVJlYWRlcigpXG4gICAgICAgICAg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cGVPZihib2R5KSkge1xuICAgICAgICAgICAgICAgIHRoaXMuaGVhZGVycy5zZXQoJ2NvbnRlbnQtdHlwZScsICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQ7Y2hhcnNldD1VVEYtOCcpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoc3VwcG9ydC5ibG9iKSB7XG4gICAgICAgICAgICB0aGlzLmJsb2IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdmFyIHJlamVjdGVkID0gY29uc3VtZWQodGhpcylcbiAgICAgICAgICAgICAgaWYgKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdGVkXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpZiAodGhpcy5fYm9keUJsb2IpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKHRoaXMuX2JvZHlCbG9iKVxuICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMuX2JvZHlBcnJheUJ1ZmZlcikge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUobmV3IEJsb2IoW3RoaXMuX2JvZHlBcnJheUJ1ZmZlcl0pKVxuICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMuX2JvZHlGb3JtRGF0YSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignY291bGQgbm90IHJlYWQgRm9ybURhdGEgYm9keSBhcyBibG9iJylcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKG5ldyBCbG9iKFt0aGlzLl9ib2R5VGV4dF0pKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMuYXJyYXlCdWZmZXIgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgaWYgKHRoaXMuX2JvZHlBcnJheUJ1ZmZlcikge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb25zdW1lZCh0aGlzKSB8fCBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keUFycmF5QnVmZmVyKVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmJsb2IoKS50aGVuKHJlYWRCbG9iQXNBcnJheUJ1ZmZlcilcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMudGV4dCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIHJlamVjdGVkID0gY29uc3VtZWQodGhpcylcbiAgICAgICAgICAgIGlmIChyZWplY3RlZCkge1xuICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0ZWRcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHRoaXMuX2JvZHlCbG9iKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZWFkQmxvYkFzVGV4dCh0aGlzLl9ib2R5QmxvYilcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUocmVhZEFycmF5QnVmZmVyQXNUZXh0KHRoaXMuX2JvZHlBcnJheUJ1ZmZlcikpXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMuX2JvZHlGb3JtRGF0YSkge1xuICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ2NvdWxkIG5vdCByZWFkIEZvcm1EYXRhIGJvZHkgYXMgdGV4dCcpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKHRoaXMuX2JvZHlUZXh0KVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzdXBwb3J0LmZvcm1EYXRhKSB7XG4gICAgICAgICAgICB0aGlzLmZvcm1EYXRhID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJldHVybiB0aGlzLnRleHQoKS50aGVuKGRlY29kZSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICB0aGlzLmpzb24gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnRleHQoKS50aGVuKEpTT04ucGFyc2UpXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIHRoaXNcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEhUVFAgbWV0aG9kcyB3aG9zZSBjYXBpdGFsaXphdGlvbiBzaG91bGQgYmUgbm9ybWFsaXplZFxuICAgICAgICB2YXIgbWV0aG9kcyA9IFsnREVMRVRFJywgJ0dFVCcsICdIRUFEJywgJ09QVElPTlMnLCAnUE9TVCcsICdQVVQnXVxuXG4gICAgICAgIGZ1bmN0aW9uIG5vcm1hbGl6ZU1ldGhvZChtZXRob2QpIHtcbiAgICAgICAgICB2YXIgdXBjYXNlZCA9IG1ldGhvZC50b1VwcGVyQ2FzZSgpXG4gICAgICAgICAgcmV0dXJuIChtZXRob2RzLmluZGV4T2YodXBjYXNlZCkgPiAtMSkgPyB1cGNhc2VkIDogbWV0aG9kXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBSZXF1ZXN0KGlucHV0LCBvcHRpb25zKSB7XG4gICAgICAgICAgb3B0aW9ucyA9IG9wdGlvbnMgfHwge31cbiAgICAgICAgICB2YXIgYm9keSA9IG9wdGlvbnMuYm9keVxuXG4gICAgICAgICAgaWYgKGlucHV0IGluc3RhbmNlb2YgUmVxdWVzdCkge1xuICAgICAgICAgICAgaWYgKGlucHV0LmJvZHlVc2VkKSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ0FscmVhZHkgcmVhZCcpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLnVybCA9IGlucHV0LnVybFxuICAgICAgICAgICAgdGhpcy5jcmVkZW50aWFscyA9IGlucHV0LmNyZWRlbnRpYWxzXG4gICAgICAgICAgICBpZiAoIW9wdGlvbnMuaGVhZGVycykge1xuICAgICAgICAgICAgICB0aGlzLmhlYWRlcnMgPSBuZXcgSGVhZGVycyhpbnB1dC5oZWFkZXJzKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5tZXRob2QgPSBpbnB1dC5tZXRob2RcbiAgICAgICAgICAgIHRoaXMubW9kZSA9IGlucHV0Lm1vZGVcbiAgICAgICAgICAgIGlmICghYm9keSAmJiBpbnB1dC5fYm9keUluaXQgIT0gbnVsbCkge1xuICAgICAgICAgICAgICBib2R5ID0gaW5wdXQuX2JvZHlJbml0XG4gICAgICAgICAgICAgIGlucHV0LmJvZHlVc2VkID0gdHJ1ZVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnVybCA9IFN0cmluZyhpbnB1dClcbiAgICAgICAgICB9XG5cbiAgICAgICAgICB0aGlzLmNyZWRlbnRpYWxzID0gb3B0aW9ucy5jcmVkZW50aWFscyB8fCB0aGlzLmNyZWRlbnRpYWxzIHx8ICdvbWl0J1xuICAgICAgICAgIGlmIChvcHRpb25zLmhlYWRlcnMgfHwgIXRoaXMuaGVhZGVycykge1xuICAgICAgICAgICAgdGhpcy5oZWFkZXJzID0gbmV3IEhlYWRlcnMob3B0aW9ucy5oZWFkZXJzKVxuICAgICAgICAgIH1cbiAgICAgICAgICB0aGlzLm1ldGhvZCA9IG5vcm1hbGl6ZU1ldGhvZChvcHRpb25zLm1ldGhvZCB8fCB0aGlzLm1ldGhvZCB8fCAnR0VUJylcbiAgICAgICAgICB0aGlzLm1vZGUgPSBvcHRpb25zLm1vZGUgfHwgdGhpcy5tb2RlIHx8IG51bGxcbiAgICAgICAgIC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KG9wdGlvbnMuaGVhZGVycylcbiAgICAgICAgICB0aGlzLnVybCA9IG9wdGlvbnMudXJsIHx8ICcnXG4gICAgICAgICAgdGhpcy5faW5pdEJvZHkoYm9keUluaXQpXG4gICAgICAgIH1cblxuICAgICAgICBCb2R5LmNhbGwoUmVzcG9uc2UucHJvdG90eXBlKVxuXG4gICAgICAgIFJlc3BvbnNlLnByb3RvdHlwZS5jbG9uZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiBuZXcgUmVzcG9uc2UodGhpcy5fYm9keUluaXQsIHtcbiAgICAgICAgICAgIHN0YXR1czogdGhpcy5zdGF0dXMsXG4gICAgICAgICAgICBzdGF0dXNUZXh0OiB0aGlzLnN0YXR1c1RleHQsXG4gICAgICAgICAgICBoZWFkZXJzOiBuZXcgSGVhZGVycyh0aGlzLmhlYWRlcnMpLFxuICAgICAgICAgICAgdXJsOiB0aGlzLnVybFxuICAgICAgICAgIH0pXG4gICAgICAgIH1cblxuICAgICAgICBSZXNwb25zZS5lcnJvciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciByZXNwb25zZSA9IG5ldyBSZXNwb25zZShudWxsLCB7c3RhdHVzOiAwLCBzdGF0dXNUZXh0OiAnJ30pXG4gICAgICAgICAgcmVzcG9uc2UudHlwZSA9ICdlcnJvcidcbiAgICAgICAgICByZXR1cm4gcmVzcG9uc2VcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciByZWRpcmVjdFN0YXR1c2VzID0gWzMwMSwgMzAyLCAzMDMsIDMwNywgMzA4XVxuXG4gICAgICAgIFJlc3BvbnNlLnJlZGlyZWN0ID0gZnVuY3Rpb24odXJsLCBzdGF0dXMpIHtcbiAgICAgICAgICBpZiAocmVkaXJlY3RTdGF0dXNlcy5pbmRleE9mKHN0YXR1cykgPT09IC0xKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgUmFuZ2VFcnJvcignSW52YWxpZCBzdGF0dXMgY29kZScpXG4gICAgICAgIC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ICAgcmVzb2x2ZShuZXcgUmVzcG9uc2UoYm9keSwgb3B0aW9ucykpXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHhoci5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlamVjdChuZXcgVHlwZUVycm9yKCdOZXR3b3JrIHJlcXVlc3QgZmFpbGVkJykpXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHhoci5vbnRpbWVvdXQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmVqZWN0KG5ldyBUeXBlRXJyb3IoJ05ldHdvcmsgcmVxdWVzdCBmYWlsZWQnKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9wZW4ocmVxdWVzdC5tZXRob2QsIHJlcXVlc3QudXJsLCB0cnVlKVxuXG4gICAgICAgICAgICBpZiAocmVxdWVzdC5jcmVkZW50aWFscyA9PT0gJ2luY2x1ZGUnKSB7XG4gICAgICAgICAgICAgIHhoci53aXRoQ3JlZGVudGlhbHMgPSB0cnVlXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICgncmVzcG9uc2VUeXBlJyBpbiB4aHIgJiYgc3VwcG9ydC5ibG9iKSB7XG4gICAgICAgICAgICAgIHhoci5yZXNwb25zZVR5cGUgPSAnYmxvYidcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmVxdWVzdC5oZWFkZXJzLmZvckVhY2goZnVuY3Rpb24odmFsdWUsIG5hbWUpIHtcbiAgICAgICAgICAgICAgeGhyLnNldFJlcXVlc3RIZWFkZXIobmFtZSwgdmFsdWUpXG4gICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICB4aHIuc2VuZCh0eXBlb2YgcmVxdWVzdC5fYm9keUluaXQgPT09ICd1bmRlZmluZWQnID8gbnVsbCA6IHJlcXVlc3QuX2JvZHlJbml0KVxuICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgICAgc2VsZi5mZXRjaC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1xufTtcblxudmFyIHBhcnNlT2JqZWN0ID0gZnVuY3Rpb24gKGNoYWluLCB2YWwsIG9wdGlvbnMpIHtcbiAgICB2YXIgbGVhZiA9IHZhbDtcblxuICAgIGZvciAodmFyIGkgPSBjaGFpbi5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgb2JqO1xuICAgICAgICB2YXIgcm9vdCA9IGNoYWluW2ldO1xuXG4gICAgICAgIGlmIChyb290ID09PSAnW10nKSB7XG4gICAgICAgICAgICBvYmogPSBbXTtcbiAgICAgICAgICAgIG9iaiA9IG9iai5jb25jYXQobGVhZik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvYmogPSBvcHRpb25zLnBsYWluT2JqZWN0cyA/IE9iamVjdC5jcmVhdGUobnVsbCkgOiB7fTtcbiAgICAgICAgICAgIHZhciBjbGVhblJvb3QgPSByb290LmNoYXJBdCgwKSA9PT0gJ1snICYmIHJvb3QuY2hhckF0KHJvb3QubGVuZ3RoIC0gMSkgPT09ICddJyA/IHJvb3Quc2xpY2UoMSwgLTEpIDogcm9vdDtcbiAgICAgICAgICAgIHZhciBpbmRleCA9IHBhcnNlSW50KGNsZWFuUm9vdCwgMTApO1xuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICFpc05hTihpbmRleClcbiAgICAgICAgICAgICAgICAmJiByb290ICE9PSBjbGVhblJvb3RcbiAgICAgICAgICAgICAgICAmJiBTdHJpbmcoaW5kZXgpID09PSBjbGVhblJvb3RcbiAgICAgICAgICAgICAgICAmJiBpbmRleCA+PSAwXG4gICAgICAgICAgICAgICAgJiYgKG9wdGlvbnMucGFyc2VBcnJheXMgJiYgaW5kZXggPD0gb3B0aW9ucy5hcnJheUxpbWl0KVxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgb2JqID0gW107XG4gICAgICAgICAgICAgICAgb2JqW2luZGV4XSA9IGxlYWY7XG4gICAgICAgICAgICB9IGVsc2Uge1xu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wdGlvbnMucGxhaW5PYmplY3RzICYmIGhhcy5jYWxsKE9iamVjdC5wcm90b3R5cGUsIHBhcmVudCkpIHtcbiAgICAgICAgICAgIGlmICghb3B0aW9ucy5hbGxvd1Byb3RvdHlwZXMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBrZXlzLnB1c2gocGFyZW50KTtcbiAgICB9XG5cbiAgICAvLyBMb29wIHRocm91Z2ggY2hpbGRyZW4gYXBwZW5kaW5nIHRvIHRoZSBhcnJheSB1bnRpbCB3ZSBoaXQgZGVwdGhcblxuICAgIHZhciBpID0gMDtcbiAgICB3aGlsZSAoKHNlZ21lbnQgPSBjaGlsZC5leGVjKGtleSkpICE9PSBudWxsICYmIGkgPCBvcHRpb25zLmRlcHRoKSB7XG4gICAgICAgIGkgKz0gMTtcbiAgICAgICAgaWYgKCFvcHRpb25zLnBsYWluT2JqZWN0cyAmJiBoYXMuY2FsbChPYmplY3QucHJvdG90eXBlLCBzZWdtZW50WzFdLnNsaWNlKDEsIC0xKSkpIHtcbiAgICAgICAgICAgIGlmICghb3B0aW9ucy5hbGxvd1Byb3RvdHlwZXMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAga2V5cy5wdXNoKHNlZ21lbnRbMV0pO1xuICAgIH1cblxuICAgIC8vIElmIHRoZXJlJ3MgYSByZW1haW5kZXIsIGp1c3QgYWRkIHdoYXRldmVyIGlzIGxlZnRcblxuICAgIGlmIChzZWdtZW50KSB7XG4gICAgICAgIGtleXMucHVzaCgnWycgKyBrZXkuc2xpY2Uoc2VnbWVudC5pbmRleCkgKyAnXScpO1xuICAgIH1cblxuICAgIHJldHVybiBwYXJzZU9iamVjdChrZXlzLCB2YWwsIG9wdGlvbnMpO1xufTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoc3RyLCBvcHRzKSB7XG4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0FycmF5KGZpbHRlcikpIHtcbiAgICAgICAgb2JqS2V5cyA9IGZpbHRlcjtcbiAgICB9IGVsc2Uge1xuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgICAgIG9iaktleXMgPSBzb3J0ID8ga2V5cy5zb3J0KHNvcnQpIDoga2V5cztcbiAgICB9XG5cbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IG9iaktleXMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgdmFyIGtleSA9IG9iaktleXNbaV07XG5cbiAgICAgICAgaWYgKHNraXBOdWxscyAmJiBvYmpba2V5XSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShvYmopKSB7XG4gICAgICAgICAgICB2YWx1ZXMgPSB2YWx1ZXMuY29uY2F0KHN0cmluZ2lmeShcbiAgICAgICAgICAgICAgICBvYmpba2V5XSxcbiAgICAgICAgICAgICAgICBnZW5lcmF0ZUFycmF5UHJlZml4KHByZWZpeCwga2V5KSxcbiAgICAgICAgICAgICAgICBnZW5lcmF0ZUFycmF5UHJlZml4LFxuICAgICAgICAgICAgICAgIHN0cmljdE51bGxIYW5kbGluZyxcbiAgICAgICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICAgICAgZW5jb2RlcixcbiAgICAgICAgICAgICAgICBmaWx0ZXIsXG4gICAgICAgICAgICAgICAgc29ydCxcbiAgICAgICAgICAgICAgICBhbGxvd0RvdHMsXG4gICAgICAgICAgICAgICAgc2VyaWFsaXplRGF0ZSxcbiAgICAgICAgICAgICAgICBmb3JtYXR0ZXIsXG4gICAgICAgICAgICAgICAgZW5jb2RlVmFsdWVzT25seVxuICAgICAgICAgICAgKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB2YWx1ZXMgPSB2YWx1ZXMuY29uY2F0KHN0cmluZ2lmeShcbiAgICAgICAgICAgICAgICBvYmpba2V5XSxcbiAgICAgICAgICAgICAgICBwcmVmaXggKyAoYWxsb3dEb3RzID8gJy4nICsga2V5IDogJ1snICsga2V5ICsgJ10nKSxcbiAgICAgICAgICAgICAgICBnZW5lcmF0ZUFycmF5UHJlZml4LFxuICAgICAgICAgICAgICAgIHN0cmljdE51bGxIYW5kbGluZyxcbiAgICAgICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICAgICAgZW5jb2RlcixcbiAgICAgICAgICAgICAgICBmaWx0ZXIsXG4gICAgICAgICAgICAgICAgc29ydCxcbiAgICAgICAgICAgICAgICBhbGxvd0RvdHMsXG4gICAgICAgICAgICAgICAgc2VyaWFsaXplRGF0ZSxcbiAgICAgICAgICAgICAgICBmb3JtYXR0ZXIsXG4gICAgICAgICAgICAgICAgZW5jb2RlVmFsdWVzT25seVxuICAgICAgICAgICAgKSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gdmFsdWVzO1xufTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAob2JqZWN0LCBvcHRzKSB7XG4gICAgdmFyIG9iaiA9IG9iamVjdDtcbiAgICB2YXIgb3B0aW9ucyA9IG9wdHMgPyB1dGlscy5hc3NpZ24oe30sIG9wdHMpIDoge307XG5cbiAgICBpZiAob3B0aW9ucy5lbmNvZGVyICE9PSBudWxsICYmIG9wdGlvbnMuZW5jb2RlciAhPT0gdW5kZWZpbmVkICYmIHR5cGVvZiBvcHRpb25zLmVuY29kZXIgIT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignRW5jb2RlciBoYXMgdG8gYmUgYSBmdW5jdGlvbi4nKTtcbiAgICB9XG5cbiAgICB2YXIgZGVsaW1pdGVyID0gdHlwZW9mIG9wdGlvbnMuZGVsaW1pdGVyID09PSAndW5kZWZpbmVkJyA/IGRlZmF1bHRzLmRlbGltaXRlciA6IG9wdGlvbnMuZGVsaW1pdGVyO1x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ybWF0ID0gb3B0aW9ucy5hcnJheUZvcm1hdDtcbiAgICB9IGVsc2UgaWYgKCdpbmRpY2VzJyBpbiBvcHRpb25zKSB7XG4gICAgICAgIGFycmF5Rm9ybWF0ID0gb3B0aW9ucy5pbmRpY2VzID8gJ2luZGljZXMnIDogJ3JlcGVhdCc7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgYXJyYXlGb3JtYXQgPSAnaW5kaWNlcyc7XG4gICAgfVxuXG4gICAgdmFyIGdlbmVyYXRlQXJyYXlQcmVmaXggPSBhcnJheVByZWZpeEdlbmVyYXRvcnNbYXJyYXlGb3JtYXRdO1xuXG4gICAgaWYgKCFvYmpLZXlzKSB7XG4gICAgICAgIG9iaktleXMgPSBPYmplY3Qua2V5cyhvYmopO1xuICAgIH1cblxuICAgIGlmIChzb3J0KSB7XG4gICAgICAgIG9iaktleXMuc29ydChzb3J0KTtcbiAgICB9XG5cbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IG9iaktleXMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgdmFyIGtleSA9IG9iaktleXNbaV07XG5cbiAgICAgICAgaWYgKHNraXBOdWxscyAmJiBvYmpba2V5XSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBrZXlzID0ga2V5cy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgb2JqW2tleV0sXG4gICAgICAgICAgICBrZXksXG4gICAgICAgICAgICBnZW5lcmF0ZUFycmF5UHJlZml4LFxuICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgc2tpcE51bGxzLFxuICAgICAgICAgICAgZW5jb2RlID8gZW5jb2RlciA6IG51bGwsXG4gICAgICAgICAgICBmaWx0ZXIsXG4gICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgYWxsb3dEb3RzLFxuICAgICAgICAgICAgc2VyaWFsaXplRGF0ZSxcbiAgICAgICAgICAg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YmplY3QucHJvdG90eXBlLCBzb3VyY2UpKSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0W3NvdXJjZV0gPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIFt0YXJnZXQsIHNvdXJjZV07XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGFyZ2V0O1xuICAgIH1cblxuICAgIGlmICh0eXBlb2YgdGFyZ2V0ICE9PSAnb2JqZWN0Jykge1xuICAgICAgICByZXR1cm4gW3RhcmdldF0uY29uY2F0KHNvdXJjZSk7XG4gICAgfVxuXG4gICAgdmFyIG1lcmdlVGFyZ2V0ID0gdGFyZ2V0O1xuICAgIGlmIChBcnJheS5pc0FycmF5KHRhcmdldCkgJiYgIUFycmF5LmlzQXJyYXkoc291cmNlKSkge1xuICAgICAgICBtZXJnZVRhcmdldCA9IGV4cG9ydHMuYXJyYXlUb09iamVjdCh0YXJnZXQsIG9wdGlvbnMpO1xuICAgIH1cblxuICAgIGlmIChBcnJheS5pc0FycmF5KHRhcmdldCkgJiYgQXJyYXkuaXNBcnJheShzb3VyY2UpKSB7XG4gICAgICAgIHNvdXJjZS5mb3JFYWNoKGZ1bmN0aW9uIChpdGVtLCBpKSB7XG4gICAgICAgICAgICBpZiAoaGFzLmNhbGwodGFyZ2V0LCBpKSkge1xuICAgICAgICAgICAgICAgIGlmICh0YXJnZXRbaV0gJiYgdHlwZW9mIHRhcmdldFtpXSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0W2ldID0gZXhwb3J0cy5tZXJnZSh0YXJnZXRbaV0sIGl0ZW0sIG9wdGlvbnMpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRhcmdldC5wdXNoKGl0ZW0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICA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pdHRlbiBieSBCcmlhbiBXaGl0ZSAobXNjZGV4KSBmb3IgdGhlIGlvLmpzIGNvcmUgcXVlcnlzdHJpbmcgbGlicmFyeS5cbiAgICAvLyBJdCBoYXMgYmVlbiBhZGFwdGVkIGhlcmUgZm9yIHN0cmljdGVyIGFkaGVyZW5jZSB0byBSRkMgMzk4NlxuICAgIGlmIChzdHIubGVuZ3RoID09PSAwKSB7XG4gICAgICAgIHJldHVybiBzdHI7XG4gICAgfVxuXG4gICAgdmFyIHN0cmluZyA9IHR5cGVvZiBzdHIgPT09ICdzdHJpbmcnID8gc3RyIDogU3RyaW5nKHN0cik7XG5cbiAgICB2YXIgb3V0ID0gJyc7XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdHJpbmcubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgdmFyIGMgPSBzdHJpbmcuY2hhckNvZGVBdChpKTtcblxuICAgICAgICBpZiAoXG4gICAgICAgICAgICBjID09PSAweDJEIC8vIC1cbiAgICAgICAgICAgIHx8IGMgPT09IDB4MkUgLy8gLlxuICAgICAgICAgICAgfHwgYyA9PT0gMHg1RiAvLyBfXG4gICAgICAgICAgICB8fCBjID09PSAweDdFIC8vIH5cbiAgICAgICAgICAgIHx8IChjID49IDB4MzAgJiYgYyA8PSAweDM5KSAvLyAwLTlcbiAgICAgICAgICAgIHx8IChjID49IDB4NDEgJiYgYyA8PSAweDVBKSAvLyBhLXpcbiAgICAgICAgICAgIHx8IChjID49IDB4NjEgJiYgYyA8PSAweDdBKSAvLyBBLVpcbiAgICAgICAgKSB7XG4gICAgICAgICAgICBvdXQgKz0gc3RyaW5nLmNoYXJBdChpKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGMgPCAweDgwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyBoZXhUYWJsZVtjXTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgIC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V1ZVtpXTtcbiAgICAgICAgdmFyIG9iaiA9IGl0ZW0ub2JqW2l0ZW0ucHJvcF07XG5cbiAgICAgICAgdmFyIGtleXMgPSBPYmplY3Qua2V5cyhvYmopO1xuICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGtleXMubGVuZ3RoOyArK2opIHtcbiAgICAgICAgICAgIHZhciBrZXkgPSBrZXlzW2pdO1xuICAgICAgICAgICAgdmFyIHZhbCA9IG9ialtrZXldO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiB2YWwgPT09ICdvYmplY3QnICYmIHZhbCAhPT0gbnVsbCAmJiByZWZzLmluZGV4T2YodmFsKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICBxdWV1ZS5wdXNoKHsgb2JqOiBvYmosIHByb3A6IGtleSB9KTtcbiAgICAgICAgICAgICAgICByZWZzLnB1c2godmFsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBjb21wYWN0UXVldWUocXVldWUpO1xufTtcblxuZXhwb3J0cy5pc1JlZ0V4cCA9IGZ1bmN0aW9uIGlzUmVnRXhwKG9iaikge1xuICAgIHJldHVybiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwob2JqKSA9PT0gJ1tvYmplY3QgUmVnRXhwXSc7XG59O1xuXG5leHBvcnRzLmlzQnVmZmVyID0gZnVuY3Rpb24gaXNCdWZmZXIob2JqKSB7XG4gICAgaWYgKG9iaiA9PT0gbnVsbCB8fCB0eXBlb2Ygb2JqID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgcmV0dXJuICEhKG9iai5jb25zdHJ1Y3RvciAmJiBvYmouY29uc3RydWN0b3IuaXNCdWZmZXIgJiYgb2JqLmNvbnN0cnVjdG9yLmlzQnVmZmVyKG9iaikpO1xufTtcbiJdfQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJz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c3QgZXhjaGFuZ2VzID0ge1xuICAgICdfMWJyb2tlcic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL18xYnJva2VyLmpzJyksXG4gICAgJ18xYnRjeGUnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvXzFidGN4ZS5qcycpLFxuICAgICdhY3gnOiAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2FjeC5qcycpLFxuICAgICdhbGxjb2luJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2FsbGNvaW4uanMnKSxcbiAgICAnYW54cHJvJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9hbnhwcm8uanMnKSxcbiAgICAnYmluYW5jZSc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaW5hbmNlLmpzJyksXG4gICAgJ2JpdDJjJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0MmMuanMnKSxcbiAgICAnYml0YmF5JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRiYXkuanMnKSxcbiAgICAnYml0Y29pbmNvaWQnOiAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRjb2luY29pZC5qcycpLFxuICAgICdiaXRmaW5leCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZpbmV4LmpzJyksXG4gICAgJ2JpdGZpbmV4Mic6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0ZmluZXgyLmpzJyksXG4gICAgJ2JpdGZseWVyJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0Zmx5ZXIuanMnKSxcbiAgICAnYml0aHVtYic6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRodW1iLmpzJyksXG4gICAgJ2JpdGxpc2gnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0bGlzaC5qcycpLFxuICAgICdiaXRtYXJrZXQnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdG1hcmtldC5qcycpLFxuICAgICdiaXRtZXgnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdG1leC5qcycpLFxuICAgICdiaXRzbyc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHNvLmpzJyksXG4gICAgJ2JpdHN0YW1wJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0c3RhbXAuanMnKSxcbiAgICAnYml0c3RhbXAxJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRzdGFtcDEuanMnKSxcbiAgICAnYml0dHJleCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXR0cmV4LmpzJyksXG4gICAgJ2JsM3AnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmwzcC5qcycpLFxuICAgICdibGV1dHJhZGUnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JsZXV0cmFkZS5qcycpLFxuICAgICdidGNib3gnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2JveC5qcycpLFxuICAgICdidGNjaGluYSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2NoaW5hLmpzJyksXG4gICAgJ2J0Y2V4Y2hhbmdlJzogICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjZXhjaGFuZ2UuanMnKSxcbiAgICAnYnRjbWFya2V0cyc6ICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNtYXJrZXRzLmpzJyksXG4gICAgJ2J0Y3RyYWRldWEnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjdHJhZGV1YS5qcycpLFxuICAgICdidGN0dXJrJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y3R1cmsuanMnKSxcbiAgICAnYnRjeCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGN4LmpzJyksXG4gICAgJ2J0ZXInOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRlci5qcycpLFxuICAgICdieGludGgnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J4aW50aC5qcycpLFxuICAgICdjY2V4JzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NjZXguanMnKSxcbiAgICAnY2V4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jZXguanMnKSxcbiAgICAnY2hidGMnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jaGJ0Yy5qcycpLFxuICAgICdjaGlsZWJpdCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NoaWxlYml0LmpzJyksXG4gICAgJ2NvaW5jaGVjayc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmNoZWNrLmpzJyksXG4gICAgJ2NvaW5mbG9vcic6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmZsb29yLmpzJyksXG4gICAgJ2NvaW5naSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmdpLmpzJyksXG4gICAgJ2NvaW5tYXJrZXRjYXAnOiAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbm1hcmtldGNhcC5qcycpLFxuICAgICdjb2lubWF0ZSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5tYXRlLmpzJyksXG4gICAgJ2NvaW5zZWN1cmUnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbnNlY3VyZS5qcycpLFxuICAgICdjb2luc3BvdCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5zcG90LmpzJyksXG4gICAgJ2NyeXB0b3BpYSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY3J5cHRvcGlhLmpzJyksXG4gICAgJ2RzeCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZHN4LmpzJyksXG4gICAgJ2V4bW8nOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZXhtby5qcycpLFxuICAgICdmbG93YnRjJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2Zsb3didGMuanMnKSxcbiAgICAnZm94Yml0JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9mb3hiaXQuanMnKSxcbiAgICAnZnlic2UnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9meWJzZS5qcycpLFxuICAgICdmeWJzZyc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2Z5YnNnLmpzJyksXG4gICAgJ2dhdGVjb2luJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2F0ZWNvaW4uanMnKSxcbiAgICAnZ2F0ZWlvJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nYXRlaW8uanMnKSxcbiAgICAnZ2RheCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nZGF4LmpzJyksXG4gICAgJ2dlbWluaSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2VtaW5pLmpzJyksXG4gICAgJ2hpdGJ0Yyc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaGl0YnRjLmpzJyksXG4gICAgJ2hpdGJ0YzInOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaGl0YnRjMi5qcycpLFxuICAgICdodW9iaSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2h1b2JpLmpzJyksXG4gICAgJ2h1b2JpY255JzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaHVvYmljbnkuanMnKSxcbiAgICAnaHVvYmlwcm8nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9odW9iaXByby5qcycpLFxuICAgICdpbmRlcGVuZGVudHJlc2VydmUnOiAgICAgIHJlcXVpcmUgKCcuL2pzL2luZGVwZW5kZW50cmVzZXJ2ZS5qcycpLFxuICAgICdpdGJpdCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2l0Yml0LmpzJyksXG4gICAgJ2p1YmknOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvanViaS5qcycpLFxuICAgICdrcmFrZW4nOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2tyYWtlbi5qcycpLFxuICAgICdrdW5hJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2t1bmEuanMnKSxcbiAgICAnbGFrZWJ0Yyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9sYWtlYnRjLmpzJyksXG4gICAgJ2xpcXVpJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGlxdWkuanMnKSxcbiAgICAnbGl2ZWNvaW4nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9saXZlY29pbi5qcycpLFxuICAgICdsdW5vJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2x1bm8uanMnKSxcbiAgICAnbWVyY2Fkbyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9tZXJjYWRvLmpzJyksXG4gICAgJ21peGNvaW5zJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbWl4Y29pbnMuanMnKSxcbiAgICAnbm92YSc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ub3ZhLmpzJyksXG4gICAgJ29rY29pbmNueSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvb2tjb2luY255LmpzJyksXG4gICAgJ29rY29pbnVzZCc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvb2tjb2ludXNkLmpzJyksXG4gICAgJ29rZXgnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvb2tleC5qcycpLFxuICAgICdwYXltaXVtJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3BheW1pdW0uanMnKSxcbiAgICAncG9sb25pZXgnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9wb2xvbmlleC5qcycpLFxuICAgICdxcnlwdG9zJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3FyeXB0b3MuanMnKSxcbiAgICAncXVhZHJpZ2FjeCc6ICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9xdWFkcmlnYWN4LmpzJyksXG4gICAgJ3F1b2luZSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcXVvaW5lLmpzJyksXG4gICAgJ3NvdXRoeGNoYW5nZSc6ICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc291dGh4Y2hhbmdlLmpzJyksXG4gICAgJ3N1cmJpdGNvaW4nOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc3VyYml0Y29pbi5qcycpLFxuICAgICd0aGVyb2NrJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3RoZXJvY2suanMnKSxcbiAgICAndGlkZXgnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy90aWRleC5qcycpLFxuICAgICd1cmR1Yml0JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3VyZHViaXQuanMnKSxcbiAgICAndmF1bHRvcm8nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92YXVsdG9yby5qcycpLFxuICAgICd2YnRjJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3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l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYwMjEtNDIwYmQ5ZmMtNWVjYi0xMWU3LThlZDYtNTZkMDA4MWVmZWQyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovLzFicm9rZXIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovLzFicm9rZXIuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vMWJyb2tlci5jb20vP2M9ZW4vY29udGVudC9hcGktZG9jdW1lbnRhdGlvbicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2JhcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9jYXRlZ29yaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9xdW90ZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29wZW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbG9zZV9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2VkaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL29wZW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3NoYXJlZC9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NvY2lhbC9wcm9maWxlX3N0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NvY2lhbC9wcm9maWxlX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9iaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL292ZXJ2aWV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3F1b3RhX3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci90cmFuc2FjdGlvbl9sb2cnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaENhdGVnb3JpZXMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRNYXJrZXRDYXRlZ29yaWVzICgpO1xuICAgICAgICAvLyB0aGV5IHJldHVybiBhbiBlbXB0eSBzdHJpbmcgYW1vbmcgdGhlaXIgY2F0ZWdvcmllcywgd3RmP1xuICAgICAgICBsZXQgY2F0ZWdvcmllcyA9IHJlc3BvbnNlWydyZXNwb25zZSddO1xuICAgICA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mRlZmluZWQ7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmICgoY2F0ZWdvcnkgPT0gJ0ZPUkVYJykgfHwgKGNhdGVnb3J5ID09ICdDUllQVE8nKSkge1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhcnRzID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgICAgICAgICBiYXNlID0gcGFydHNbMF07XG4gICAgICAgICAgICAgICAgICAgIHF1b3RlID0gcGFydHNbMV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9IGlkO1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9ICdVU0QnO1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlzXy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpc18uY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICAgICAnb3RoZXJmaWVsZCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvbmVtb3JlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyT3ZlcnZpZXcgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGJhbGFuY2VbJ3Jlc3BvbnNlJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0b3RhbCA9IHBhcnNlRmxvYXQgKHJlc3BvbnNlWydiYWxhbmNlJ10pO1xuICAgICAgICByZXN1bHRbJ0JUQyddWydmcmVlJ10gPSB0b3RhbDtcbiAgICAgICAgcmVzdWx0WydCVEMnXVsndG90YWwnXSA9IHRvdGFsO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pI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Y2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0TWFya2V0QmFycyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3Jlc29sdXRpb24nOiA2MCxcbiAgICAgICAgICAgICdsaW1pdCc6IDEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5mZXRjaE9yZGVyQm9vayAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3VsdFsncmVzcG9uc2UnXVswXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0aWNrZXJbJ2RhdGUnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbCddKSxcbiAgICAgICAgICAgICdiaWQnOiBvcmRlcmJvb2tbJ2JpZHMnXVswXVswXSxcbiAgICAgICAgICAgICdhc2snOiBvcmRlcmJvb2tbJ2Fza3MnXVswXVswXSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ28nXSksXG4gICAgICAgICAgICAnY2xvc2UnOiBwYX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hlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovLzFidGN4ZS5jb20vYXBpLWRvY3MucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcmljYWwtcHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci1ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzLWFuZC1pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci10cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J0Yy1kZXBvc2l0LWFkZHJlc3MvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidGMtZGVwb3NpdC1hZGRyZXNzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9lZGl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMv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CBvaGxjdnMgPSB0aGlzLm9taXQgKHJlc3BvbnNlWydoaXN0b3JpY2FsLXByaWNlcyddLCAncmVxdWVzdF9jdXJyZW5jeScpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9ITENWcyAob2hsY3ZzLCBtYXJrZXQsIHRpbWVmcmFtZSwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ21ha2VyX3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB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ZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhcGlfa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgcXVlcnlbJ3NpZ25hdHVyZSddID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocmVxdWVzdCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnZXJyb3JzJyBpbiBy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gJ2lkJzogJ2FjeCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdBQ1gnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdBVScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YyJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMTIwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzcyMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICczZCc6ICc0MzIwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzAyNDc2MTQtMWZlNjFjNzQtOTYyMS0xMWU3LTllOGMtZjFhNjI3YWZhMjc5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuanNvbicsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FjeC5pby9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hY3guaW8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hY3guaW8vZG9jdW1lbnRzL2FwaV92MicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLCAvLyBHZXQgYWxsIGF2YWlsYWJsZSBtYXJrZXRzXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsIC8vIEdldCB0aWNrZXIgb2YgYWxsIG1hcmtldHNcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3ttYXJrZXR9JywgLy8gR2V0IHRpY2tlciBvZiBzcGVjaWZpYyBtYXJrZXRcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLCAvLyBHZXQgcmVjZW50IHRyYWRlcyBvbiBtYXJrZXQsIGVhY2ggdHJhZGUgaXMgaW5jbHVkZWQgb25seSBvbmNlIFRyYWRlcyBhcmUgc29ydGVkIGluIHJldmVyc2UgY3JlYXRpb24gb3JkZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsIC8vIEdldCB0aGUgb3JkZXIgYm9vayBvZiBzcGVjaWZpZWQgbWFya2V0XG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLCAvLyBHZXQgZGVwdGggb3Igc3BlY2lmaWVkIG1hcmtldCBCb3RoIGFza3MgYW5kIGJpZHMgYXJlIHNvcnRlZCBmcm9tIGhpZ2hlc3QgcHJpY2UgdG8gbG93ZXN0LlxuICAgICAgICAgICAgICAgICAgICAgICAgJ2snLCAvLyBHZXQgT0hMQyhrIGxpbmUpIG9mIHNwZWNpZmljIG1hcmtldFxuICAgICAgICAgICA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RlcnMnLCAvLyBHZXQgeW91ciBvcmRlcnMsIHJlc3VsdHMgaXMgcGFnaW5hdGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLCAvLyBHZXQgaW5mb3JtYXRpb24gb2Ygc3BlY2lmaWVkIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL215JywgLy8gR2V0IHlvdXIgZXhlY3V0ZWQgdHJhZGVzIFRyYWRlcyBhcmUgc29ydGVkIGluIHJldmVyc2UgY3JlYXRpb24gb3JkZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdzJywgLy8gR2V0IHlvdXIgY3J5cHRvY3VycmVuY3kgd2l0aGRyYXdzXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLCAvLyBHZXQgeW91ciBjcnlwdG9jdXJyZW5jeSB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLCAvLyBDcmVhdGUgYSBTZWxsL0J1eSBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9tdWx0aScsIC8vIENyZWF0ZSBtdWx0aXBsZSBzZWxsL2J1eSBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvY2xlYXInLCAvLyBDYW5jZWwgYWxsIG15IG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RlbGV0ZScsIC8vIENhbmNlbCBhbiBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JywgLy8gQ3JlYXRlIGEgd2l0aGRyYXdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRNZW1iZXJzTWUgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydhY2NvdW50cyddO1xuICAg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AgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaWRdO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2Vyc01hcmtldCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAocmVzcG9uc2UsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ3RpbWVzdGFtcCddICogMTAwMDtcbiAgICAgICAgbGV0IHNpZGUgPSAodHJhZGVbJ3R5cGUnXSA9PSAnYmlkJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9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cbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ29yZF90eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0IChvcmRlclsncHJpY2UnXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAob3JkZXJbJ3ZvbHVtZSddKSxcbiAgICAgICAgICAgICdmaWxsZWQnOiBwYXJzZUZsb2F0IChvcmRlclsnZXhlY3V0ZWRfdm9sdW1lJ10pLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHBhcnNlRmxvYXQgKG9yZGVyWydyZW1haW5pbmdfdm9sdW1lJ10pLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdtYXJrZXQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ZvbHVtZSc6IGFtb3VudC50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRfdHlwZSc6IHR5cGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2UudG9TdHJpbmcgKCk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdh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3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYWxsY29pbi5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hbGxjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2FsbGNvaW4uY29tL0Fib3V0L0FQSVJlZmVyZW5jZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldG92ZXJ2aWV3cy8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXRjaF90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnNfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB1bmRlZmluZWQsXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gWyAnQlRDJywgJ0VUSCcsICdVU0QnLCAnUVRVTScgXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldE1hcmtldG92ZXJ2aWV3cyAoe1xuICAgICAgICAgICAgICAgICd0eXBlJzogJ2Z1bGwnLFxuICAgICAgICAgICAgICAgICdzZWNvbmRhcnknOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnTWFya2V0cyddO1xuICAgICAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBtYXJrZXRzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba107XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ1ByaW1hcnknXTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ1NlY29uZGFyeSddO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGJhc2UudG9Mb3dlckNhc2UgKCkgKyAnXycgKyBxdW90ZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAndHlwZSc6ICdzcG90JyxcbiAgICAgICAgICAgICAgICAgICAgJ3Nwb3QnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnZnV0dXJlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgZ2V0T3JkZXJTdGF0dXMgKHN0YXR1cykge1xuICAgICAgICBpZiAoc3RhdHVzID09IC0xKVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIGlmIChzdGF0dXMgPT0gMClcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIGlmIChzdGF0dXMgPT0gMSlcbiAgICAgICAgICAgIHJldHVybiAncGFydGlhbCc7XG4gICAgICAgIGlmIChzdGF0dXMgPT0gMilcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAxMClcbiAgICAgICAgICAgIHJldHVybiAnY2FuY2VsZWQnO1xuICAgICAgICByZXR1cm4gc3RhdHVzO1xuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0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HBzOi8vYW54cHJvLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hbnhwcm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cDovL2RvY3MuYW54djIuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYW54cHJvLmNvbS9wYWdlcy9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9kZXB0aC9mdWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvdHJhZGUvZmV0Y2gnLCAvLyBkaXNhYmxlZCBieSBBTlhQcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvYWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvcXVvdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9yZXN1bHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21vbmV5L3tjdXJyZW5jeX0vYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkve2N1cnJlbmN5fS9zZW5kX3NpbXBsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvdHJhZGUvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvd2FsbGV0L2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdCVENVU0QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvSEtEJzogeyAnaWQnOiAnQlRDSEtEJywgJ3N5bWJvbCc6ICdCVEMvSEtEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0hLRCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ0JUQ0VVUicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9DQUQnOiB7ICdpZCc6ICdCVENDQUQnLCAnc3ltYm9sJzogJ0JUQy9DQUQnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ0FEJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvQVVEJzogeyAnaWQnOiAnQlRDQVVEJywgJ3N5bWJvbCc6ICdCVEMvQVVEJywgJ2Jhc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JQJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4zIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjYgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE1vbmV5SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlWydXYWxsZXRzJ10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZVsnV2FsbGV0cyddKSB7XG4gICAgICAgICAgICAgICAgbGV0IHdhbGxldCA9IGJhbGFuY2VbJ1dhbGxldHMnXVtjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAod2FsbGV0WydBdmFpbGFibGVfQmFsYW5jZSddWyd2YWx1ZSddKTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VG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Q3VycmVuY3lTZW5kU2ltcGxlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAnYW1vdW50X2ludCc6IHBhcnNlSW50IChhbW91bnQgKiAxMDAwMDAwMDApLCAvLyAxMF44XG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydkYXRhJ11bJ3RyYW5zYWN0aW9uSWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcmVxdWVzdDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5j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G5cbiAgICAgICAgaWYgKGlzTm9kZSlcbiAgICAgICAgICAgIHRoaXMubm9kZVZlcnNpb24gPSBwcm9jZXNzLnZlcnNpb24ubWF0Y2ggKC9cXGQrXFwuXFxkKy5cXGQrLykgWzBdXG5cbiAgICAgICAgLy8gdGhpcy5pbml0UmVzdFJhdGVMaW1pdGVyICgpXG5cbiAgICAgICAgaWYgKGlzTm9kZSkge1xuICAgICAgICAgICAgdGhpcy51c2VyQWdlbnQgPSB7XG4gICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiAnY2N4dC8nICsgRXhjaGFuZ2UuY2N4dFZlcnNpb24gK1xuICAgICAgICAgICAgICAgICAgICAnICgraHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dCknICtcbiAgICAgICAgICAgICAgICAgICAgJyBOb2RlLmpzLycgKyB0aGlzLm5vZGVWZXJzaW9uICsgJyAoSmF2YVNjcmlwdCknXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmhlYWRlcnMgPSB7fVxuXG4gICAgICAgIC8vIHByZXBlbmRlZCB0byBVUkwsIGxpa2UgaHR0cHM6Ly9wcm94eS5jb20vaHR0cHM6Ly9leGNoYW5nZS5jb20vYXBpLi4uXG4gICAgICAgIHRoaXMucHJveHkgPSAnJ1xuXG4gICAgICAgIHRoaXMuaXNvODYwMSAgICAgICAgID0gdGltZXN0YW1wID0+IG5ldyBEYXRlICh0aW1lc3RhbXApLnRvSVNPU3RyaW5nICgpXG4gICAgICAgIHRoaXMucGFyc2U4NjAxICAgICAgID0geCA9PiBEYXRlLnBhcnNlICgoKHguaW5kZXhPZiAoJysnKSA+PSAwKSB8fCAoeC5zbGljZSAoLTEpID09ICdaJykpID8geCA6ICh4ICsgJ1onKSlcbiAgICAgICAgdGhpcy5taWxsaXNlY29uZHMgICAgPSBEYXRlLm5vd1xuICAgICAgICB0aGlzLm1pY3Jvc2Vjb25kcyAgICA9ICgpID0+IE1hdGguZmxvb3IgK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gICAgICd1aWQnOiAgICAgIGZhbHNlLFxuICAgICAgICAgICAgJ2xvZ2luJzogICAgZmFsc2UsXG4gICAgICAgICAgICAncGFzc3dvcmQnOiBmYWxzZSxcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuYmFsYW5jZSAgICA9IHt9XG4gICAgICAgIHRoaXMub3JkZXJib29rcyA9IHt9XG4gICAgICAgIHRoaXMudGlja2VycyAgICA9IHt9XG4gICAgICAgIHRoaXMuZmVlcyAgICAgICA9IHt9XG4gICAgICAgIHRoaXMub3JkZXJzICAgICA9IHt9XG4gICAgICAgIHRoaXMudHJhZGVzICAgICA9IHt9XG4gICAgICAgIHRoaXMuY3VycmVuY2llcyA9IHt9XG5cbiAgICAgICAgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UgPSB1bmRlZmluZWRcbiAgICAgICAgdGhpcy5sYXN0X2pzb25fcmVzcG9uc2UgPSB1bmRlZmluZWRcblxuICAgICAgICAvLyBUT0RPOiBnZW5lcmF0ZVxuICAgICAgICB0aGlzLm1hcmtldF9pZCAgICAgICAgICAgICAgICAgICA9IHRoaXMubWFya2V0SWRcbiAgICAgICAgdGhpcy5tYXJrZXRfaWRzICAgICAgICAgICAgICAgICAgPSB0aGlzLm1hcmtldElkc1xuICAgICAgICB0aGlzLmltcGxvZGVfcGFyYW1zICAgICAgICAgICAgICA9IHRoaXMuaW1wbG9kZVBhcmFtc1xuICAgICAgICB0aGlzLmV4dHJhY3RfcGFyYW1zICAgICAgICAgICAgICA9IHRoaXMuZXh0cmFjdFBhcmFtc1xuICAgICAgICB0aGlzLmZldGNoX2JhbGFuY2UgICAgICAgICAgICAgICA9IHRoaXMuZmV0Y2hCYWxhbmNlXG4gICAgICAgIHRoaXMuZmV0Y2hfZnJlZV9iYWxhbmNlICAgICAgICAgID0gdGhpcy5mZXRjaEZyZWVCYWxhbmNlXG4gICAgICAgIHRoaXMuZmV0Y2hfdXNlZF9iYWxhbmNlICAgICAgICAgID0gdGhpcy5mZXRjaFVzZWRCYWxhbmNlXG4gICAgICAgIHRoaXMuZmV0Y2hfdG90YWxfYmFsYW5jZSAgICAgICAgID0gdGhpcy5mZXRjaFRvdGFsQmFsYW5jZVxuICAgICAgICB0aGlzLmZldGNoX2wyX29yZGVyX2Jvb2sgICAgICAgICA9IHRoaXMuZmV0Y2hMMk9yZGVyQm9va1xuICAgICAgICB0aGlzLmZldGNoX29yZGVyX2Jvb2sgICAgICAgICAgICA9IHRoaXMuZmV0Y2hPcmRlckJvb2tcbiAgICAgICAgdGhpcy5mZXRjaF90aWNrZXJzICAgICAgICAgICAgICAgPSB0aGlzLmZldGNoVGlja2Vyc1xuICAgICAgICB0aGlzLmZldGNoX3RpY2tlciAgICAgICAgICAgICAgICA9IHRoaXMuZmV0Y2hUaWNrZXJcbiAgICAgICAgdGhpcy5mZXRjaF90cmFkZXMgICAgICAgICAgICAgICAgPSB0aGlzLmZldGNoVHJhZGVzXG4gICAgICAgIHRoaXMuZmV0Y2hfb3JkZXIgICAgICAgICAgICAgICAgID0gdGhpcy5mZXRjaE9yZGVyXG4gICAgICAgIHRoaXMuZmV0Y2hfb3JkZXJzICAgICAgICAgICAgICAgID0gdGhpcy5mZXRjaE9yZGVyc1xuICAgICAgICB0aGlzLmZldGNoX29wZW5fb3JkZXJzICAgICAgICAgICA9IHRoaXMuZmV0Y2hPcGVuT3JkZXJzXG4gICAgICAgIHRoaXMuZmV0Y2hfY2xvc2VkX29yZGVycyAgICAgICAgID0gdGhpcy5mZXRjaENsb3NlZE9yZGVyc1xuICAgICAgICB0aGlzLmZldGNoX29yZGVyX3N0YXR1cyAgICAgICAgICA9IHRoaXMuZmV0Y2hPcmRlclN0YXR1c1xuICAgICAgICB0aGlzLmZldGNoX21hcmtldHMgICAgICAgICAgICAgICA9IHRoaXMuZmV0Y2hNYXJrZXRzXG4gICAgICAgIHRoaXMubG9hZF9tYXJrZXRzICAgICAgICAgICAgICAgID0gdGhpcy5sb2FkTWFya2V0c1xuICAgICAgICB0aGlzLnNldF9tYXJrZXRzICAgICAgICAgICAgICAgICA9IHRoaXMuc2V0TWFya2V0c1xuICAgICAgICB0aGlzLnBhcnNlX2JhbGFuY2UgICAgICAgICAgICAgICA9IHRoaXMucGFyc2VCYWxhbmNlXG4gICAgICAgIHRoaXMucGFyc2VfYmlkX2FzayAgICAgICAgICAgICAgID0gdGhpcy5wYXJzZUJpZEFza1xuICAgICAgICB0aGlzLnBhcnNlX2JpZHNfYXNrcyAgICAgICAgICAgICA9IHRoaXMucGFyc2VCaWRzQXNrc1xuICAgICAgICB0aGlzLnBhcnNlX29yZGVyX2Jvb2sgICAgICAgICAgICA9IHRoaXMucGFyc2VPcmRlckJvb2tcbiAgICAgICAgdGhpcy5wYXJzZV90cmFkZXMgICAgICAgICAgICAgICAgPSB0aGlzLnBhcnNlVHJhZGVzXG4gICAgICAgIHRoaXMucGFyc2Vfb3JkZXJzICAgICAgICAgICAgICAgID0gdGhpcy5wYXJzZU9yZGVyc1xuICAgICAgICB0aGlzLnBhcnNlX29obGN2ICAgICAgICAgICAgICAgICA9IHRoaXMucGFyc2VPSExDVlxuICAgICAgICB0aGlzLnBhcnNlX29obGN2cyAgICAgICAgICAgICAgICA9IHRoaXMucGFyc2VPSExDVnNcbiAgICAgICAgdGhpcy5lZGl0X2xpbWl0X2J1eV9vcmRlciAgICAgICAgPSB0aGlzLmVkaXRMaW1pdEJ1eU9yZGVyXG4gICAgICAgIHRoaXMuZWRpdF9saW1pdF9zZWxsX29yZGVyICAgICAgID0gdGhpcy5lZGl0TGltaXRTZWxsT3JkZXJcbiAgICAgICAgdGhpcy5lZGl0X2xpbWl0X29yZGVyICAgICAgICAgICAgPSB0aGlzLmVkaXRMaW1pdE9yZGVyXG4gICAgICAgIHRoaXMuZWRpdF9vcmRlciAgICAgICAgICAgICAgICAgID0gdGhpcy5lZGl0T3JkZXJcbiAgICAgICAgdGhpcy5jcmVhdGVfbGltaXRfYnV5X29yZGVyICAgICAgPSB0aGlzLmNyZWF0Z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WVwRXh0ZW5kICh0aGlzLmRlc2NyaWJlICgpLCB1c2VyQ29uZmlnKVxuXG4gICAgICAgIC8vIG1lcmdlIHRvIHRoaXNcbiAgICAgICAgZm9yIChjb25zdCBbcHJvcGVydHksIHZhbHVlXSBvZiBPYmplY3QuZW50cmllcyAoY29uZmlnKSlcbiAgICAgICAgICAgIHRoaXNbcHJvcGVydHldID0gZGVlcEV4dGVuZCAodGhpc1twcm9wZXJ0eV0sIHZhbHVlKVxuXG4gICAgICAgIGlmICh0aGlzLmFwaSlcbiAgICAgICAgICAgIHRoaXMuZGVmaW5lUmVzdEFwaSAodGhpcy5hcGksICdyZXF1ZXN0JylcblxuICAgICAgICB0aGlzLmluaXRSZXN0UmF0ZUxpbWl0ZXIgKClcblxuICAgICAgICBpZiAodGhpcy5tYXJrZXRzKVxuICAgICAgICAgICAgdGhpcy5zZXRNYXJrZXRzICh0aGlzLm1hcmtldHMpXG5cbiAgICAgICAgaWYgKHRoaXMuZGVidWcgJiYgam91cm5hbCkge1xuICAgICAgICAgICAgam91cm5hbCAoKCkgPT4gdGhpcy5qb3VybmFsLCB0aGlzLCBPYmplY3Qua2V5cyAodGhpcy5oYXMpKVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZGVmYXVsdHMgKCkge1xuICAgICAgICByZXR1cm4geyAvKiBvdmVycmlkZSBtZSAqLyB9XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5zZWNvbmRzICgpXG4gICAgfVxuXG4gICAgZW5jb2RlVVJJQ29tcG9uZW50ICguLi5hcmdzKSB7XG4gICAgICAgIHJldHVybiBlbmNvZGVVUklDb21wb25lbnQgKC4uLmFyZ3MpXG4gICAgfVxuXG4gICAgY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpIHtcbiAgICAgICAgT2JqZWN0LmtleXMgKHRoaXMucmVxdWlyZWRDcmVkZW50aWFscykubWFwIChrZXkgPT4ge1xuICAgICAgICAgICAgaWYgKHRoaXMucmVxdWlyZWRDcmVkZW50aWFsc1trZXldICYmICF0aGlzW2tleV0pXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKHRoaXMuaWQgKyAnIHJlcXVpcmVzIGAnICsga2V5ICsgJ2AnKVxuICAgICAgICB9KVxuICAgIH1cblxuICAgIGluaXRSZXN0UmF0ZUxpbWl0ZXIgKCkge1xuXG4gICAgICAgIHRoaXMudG9rZW5CdWNrZXQgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgcmVmaWxsUmF0ZTogIDEgLyB0aGlzLnJhdGVMaW1pdCxcbiAgICAgICAgICAgIGRlbGF5OiAgICAgICAxLFxuICAgICAgICAgICAgY2FwYWNpdHk6ICAgIDEsXG4gICAgICAgICAgICBkZWZhdWx0Q29zdDogMSxcbiAgICAgICAgICAgIG1heENhcGFjaXR5OiAxMDAwLFxuICAgICAgICB9LCB0aGlzLnRva2VuQnVja2V0KVxuXG4gICAgICAgIHRoaXMudGhyb3R0bGUgPSB0aHJvdHRsZSAodGhpcy50b2tlbkJ1Y2tldClcblxuICAgICAgICB0aGlzLmV4ZWN1dGVSZXN0UmVxdWVzdCA9IGZ1bmN0aW9uICh1cmwsIG1ldGhvZCA9ICdHRVQnLCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG5cbiAgICAgICAgICAgIGxldCBwcm9taXNlID1cbiAgICAgICAgICAgICAgICBmZXRjaCAodXJsLCB7ICdtZXRob2QnOiBtZXRob2QsICdoZWFkZXJzJzogaGVhZGVycywgJ2JvZHknOiBib2R5LCAnYWdlbnQnOiB0aGlzLnR1bm5lbEFnZW50IHx8IG51bGx9KVxuICAgICAgICAgICAgICAgICAgICAuY2F0Y2ggKGUgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzTm9kZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKFsgdGhpcy5pZCwgbWV0aG9kLCB1cmwsIGUudHlwZSwgZS5tZXNzYWdlIF0uam9pbiAoJyAnKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IGUgLy8gcmV0aHJvdyBhbGwgdW5rbm93biBlcnJvcnNcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLnRoZW4gKHJlc3BvbnNlID0+IHRoaXMuaGFuZGxlUmVzdEVycm9ycyAocmVzcG9uc2UsIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSlcbiAgICAgICAgICAgICAgICAgICAgLnRoZW4gKHJlc3BvbnNlID0+IHRoaXMuaGFuZGxlUmVzdFJlc3BvbnNlIChyZXNwb25zZSwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpKVxuXG4gICAgICAgICAgICByZXR1cm4gdGltZW91dCAodGhpcy50aW1lb3V0LCBwcm9taXNlKS5jYXRjaCAoZSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKGUgaW5zdGFuY2VvZiBSZXF1ZXN0VGltZW91dClcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJlcXVlc3RUaW1lb3V0ICh0aGlzLmlkICsgJyAnICsgbWV0aG9kICsgJyAnICsgdXJsICsgJyAnICsgZS5tZXNzYWdlICsgJyAoJyArIHRoaXMudGltZW91dCArICcgbXMpJylcbiAgICAgICAgICAgICAgICB0aHJvdyBlXG4gICAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZGVmaW5lUmVzdEFwaSAoYXBpLCBtZXRob2ROYW1lLCBvcHRpb25zID0ge30pIHtcblxuICAgICAgICBmb3IgKGNvbnN0IHR5cGUgb2YgT2JqZWN0LmtleXMgKGFwaSkpIHtcbiAgICAgICAgICAgIGZvciAoY29uc3QgaHR0cE1ldGhvZCBvZiBPYmplY3Qua2V5cyAoYXBpW3R5cGVdKSkge1xuXG4gICAgICAgICAgICAgICAgbGV0IHVybHMgPSBhcGlbdHlwZV1baHR0cE1ldGhvZF1cbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHVybHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IHVybHNbaV0udHJpbSAoKVxuICAgICAgICAgICAgICAgICAgICBsZXQgc3BsaXRQYXRoID0gdXJsLnNwbGl0ICgvW15hLXpBLVowLTldLylcblxuICAgICAgICAgICAgICAgICAgICBsZXQgdXBwZXJjYXNlTWV0aG9kICA9IGh0dHBNZXRob2QudG9VcHBlckNhc2UgKClcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxvd2VyY2FzZU1ldGhvZCAgPSBodHRwTWV0aG9kLnRvTG93ZXJDYXNlICgpXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2VNZXRob2QgID0gdGhpcy5jYXBpdGFsaXplIChsb3dlcmNhc2VNZXRob2QpXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2VTdWZmaXggID0gc3BsaXRQYXRoLm1hcCAodGhpcy5jYXBpdGFsaXplKS5qb2luICgnJylcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVuZGVyc2NvcmVTdWZmaXggPSBzcGxpdFBhdGgubWFwICh4ID0+IHgudHJpbSAoKS50b0xvd2VyQ2FzZSAoKSkuZmlsdGVyICh4ID0+IHgubGVuZ3RoID4gMCkuam9pbiAoJ18nKVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChjYW1lbGNhc2VTdWZmaXguaW5kZXhPZiAoY2FtZWxjYXNlTWV0aG9kKSA9PT0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbWVsY2FzZVN1ZmZpeCA9IGNhbWVsY2FzZVN1ZmZpeC5zbGljZSAoY2FtZWxjYXNlTWV0aG9kLmxlbmd0aClcblxuICAgICAgICAgICAgICAgICAgICBpZiAodW5kZXJzY29yZVN1ZmZpeC5pbmRleE9mIChsb3dlcmNhc2VNZXRob2QpID09PSAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgdW5kZXJzY29yZVN1ZmZpeCA9IHVuZGVyc2NvcmVTdWZmaXguc2xpY2UgKGxvd2VyY2FzZU1ldGhvZC5sZW5ndGgpXG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IGNhbWVsY2FzZSAgPSB0eXBlICsgY2FtZWxjYXNlTWV0aG9kICsgdGhpcy5jYXBpdGFsaXplIChjYW1lbGNhc2VTdWZmaXgpXG4gICAgICAgICAgICAgICAgICAgIGxldCB1bmRlcnNjb3JlID0gdHlwZSArICdfJyArIGxvd2VyY2FzZU1ldGhvZCArICdfJyArIHVuZGVyc2NvcmVTdWZmaXhcblxuICAgICAgICAgICAgICAgICAgICBpZiAoJ3N1ZmZpeGVzJyBpbiBvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ2NhbWVsY2FzZScgaW4gb3B0aW9uc1snc3VmZml4ZXMnXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW1lbGNhc2UgKz0gb3B0aW9uc1snc3VmZml4ZXMnXVsnY2FtZWxjYXNlJ11cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgndW5kZXJzY29yZScgaW4gb3B0aW9ucy5zdWZmaXhlcylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmRlcnNjb3JlICs9IG9wdGlvbnNbJ3N1ZmZpeGVzJ11bJ3VuZGVyc2NvcmUnXVxuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCd1bmRlcnNjb3JlX3N1ZmZpeCcgaW4gb3B0aW9ucylcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuZGVyc2NvcmUgKz0gb3B0aW9ucy51bmRlcnNjb3JlU3VmZml4O1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ2NhbWVsY2FzZV9zdWZmaXgnIGluIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgICAgICBjYW1lbGNhc2UgKz0gb3B0aW9ucy5jYW1lbGNhc2VTdWZmaXg7XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhcnRpYWwgPSBhc3luYyBwYXJhbXMgPT4gdGhpc1ttZXRob2ROYW1lXSAodXJsLCB0eXBlLCB1cHBlcmNhc2VNZXRob2QsIHBhcmFtcyB8fCB7fSlcblxuICAgICAgICAgICAgICAgICAgICB0aGlzW2NhbWVsY2FzZV0gID0gcGFydGlhbFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3VuZGVyc2NvcmVdID0gcGFydGlhbFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZldGNoICh1cmwsIG1ldGhvZCA9ICdHRVQnLCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG5cbiAgICAgICAgaWYgKGlzTm9kZSAmJiB0aGlzLnVzZXJBZ2VudCkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiB0aGlzLnVzZXJBZ2VudCA9PSAnc3RyaW5nJylcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0gZXh0ZW5kICh7ICdVc2VyLUFnZW50JzogdGhpcy51c2VyQWdlbnQgfSwgaGVhZGVycylcbiAgICAgICAgICAgIGVsc2UgaWYgKCh0eXBlb2YgdGhpcy51c2VyQWdlbnQgPT0gJ29iamVjdCcpICYmICgnVXNlci1BZ2VudCcgaW4gdGhpcy51c2VyQWdlbnQpKVxuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSBleHRlbmQgKHRoaXMudXNlckFnZW50LCBoZWFkZXJzKVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGVvZiB0aGlzLnByb3h5ID09ICdmdW5jdGlvbicpIHtcblxuICAgICAgICAgICAgdXJsID0gdGhpcy5wcm94eSAodXJsKVxuICAgICAgICAgICAgaGV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NvZGUpKSB7XG4gICAgICAgICAgICBlcnJvciA9IEREb1NQcm90ZWN0aW9uXG4gICAgICAgIH0gZWxzZSBpZiAoWyA0MDQsIDQwOSwgNDIyLCA1MDAsIDUwMSwgNTAyLCA1MjAsIDUyMSwgNTIyLCA1MjUgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGVycm9yID0gRXhjaGFuZ2VOb3RBdmFpbGFibGVcbiAgICAgICAgfSBlbHNlIGlmIChbIDQwMCwgNDAzLCA0MDUsIDUwMywgNTMwIF0uaW5jbHVkZXMgKGNvZGUpKSB7XG4gICAgICAgICAgICBsZXQgZGRvc1Byb3RlY3Rpb24gPSBib2R5Lm1hdGNoICgvY2xvdWRmbGFyZXxpbmNhcHN1bGEvaSlcbiAgICAgICAgICAgIGlmIChkZG9zUHJvdGVjdGlvbikge1xuICAgICAgICAgICAgICAgIGVycm9yID0gRERvU1Byb3RlY3Rpb25cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZXJyb3IgPSBFeGNoYW5nZU5vdEF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGRldGFpbHMgKz0gJyAocG9zc2libGUgcmVhc29uczogJyArIFtcbiAgICAgICAgICAgICAgICAgICAgJ2ludmFsaWQgQVBJIGtleXMnLFxuICAgICAgICAgICAgICAgICAgICAnYmFkIG9yIG9sZCBub25jZScsXG4gICAgICAgICAgICAgICAgICAgICdleGNoYW5nZSBpcyBkb3duIG9yIG9mZmxpbmUnLFxuICAgICAgICAgICAgICAgICAgICAnb24gbWFpbnRlbmFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAnRERvUyBwcm90ZWN0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUtbGltaXRpbmcnLFxuICAgICAgICAgICAgICAgIF0uam9pbiAoJywgJykgKyAnKSdcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChbIDQwOCwgNTA0IF0uaW5jbHVkZX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AgICAgICAgICAgICAgICBpZiAoZGRvc1Byb3RlY3Rpb24pXG4gICAgICAgICAgICAgICAgICAgIGVycm9yID0gRERvU1Byb3RlY3Rpb25cbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgZXJyb3IgKFsgdGhpcy5pZCwgbWV0aG9kLCB1cmwsIGRldGFpbHMgXS5qb2luICgnICcpKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy52ZXJib3NlKVxuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nICh0aGlzLmlkLCBtZXRob2QsIHVybCwgJ2Vycm9yJywgZSwgXCJyZXNwb25zZSBib2R5OlxcbidcIiArIHJlc3BvbnNlICsgXCInXCIpXG5cbiAgICAgICAgICAgIHRocm93IGVcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHNldE1hcmtldHMgKG1hcmtldHMpIHtcbiAgICAgICAgbGV0IHZhbHVlcyA9IE9iamVjdC52YWx1ZXMgKG1hcmtldHMpLm1hcCAobWFya2V0ID0+IGRlZXBFeHRlbmQgKHtcbiAgICAgICAgICAgICdsaW1pdHMnOiB0aGlzLmxpbWl0cyxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB0aGlzLnByZWNpc2lvbixcbiAgICAgICAgfSwgdGhpcy5mZWVzWyd0cmFkaW5nJ10sIG1hcmtldCkpXG4gICAgICAgIHRoaXMubWFya2V0cyA9IGRlZXBFeHRlbmQgKHRoaXMubWFya2V0cywgaW5kZXhCeSAodmFsdWVzLCAnc3ltYm9sJykpXG4gICAgICAgIHRoaXMubWFya2V0c0J5SWQgPSBpbmRleEJ5IChtYXJrZXRzLCAnaWQnKVxuICAgICAgICB0aGlzLm1hcmtldHNfYnlfaWQgPSB0aGlzLm1hcmtldHNCeUlkXG4gICAgICAgIHRoaXMuc3ltYm9scyA9IE9iamVjdC5rZXlzICh0aGlzLm1hcmtldHMpLnNvcnQgKClcbiAgICAgICAgdGhpcy5pZHMgPSBPYmplY3Qua2V5cyAodGhpcy5tYXJrZXRzX2J5X2lkKS5zb3J0ICgpXG4gICAgICAgIGNvbnN0IGJhc2VDdXJyZW5jaWVzID1cbiAgICAgICAgICAgIHZhbHVlcy5maWx0ZXIgKG1hcmtldCA9PiAnYmFzZScgaW4gbWFya2V0KVxuICAgICAgICAgICAgICAgIC5tYXAgKG1hcmtldCA9PiAoe1xuICAgICAgICAgICAgICAgICAgICBpZDogbWFya2V0LmJhc2VJZCB8fCBtYXJrZXQuYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgY29kZTogbWFya2V0LmJhc2UsXG4gICAgICAgICAgICAgICAgfSkpXG4gICAgICAgIGNvbnN0IHF1b3RlQ3VycmVuY2llcyA9XG4gICAgICAgICAgICB2YWx1ZXMuZmlsdGVyIChtYXJrZXQgPT4gJ3F1b3RlJyBpbiBtYXJrZXQpXG4gICAgICAgICAgICAgICAgLm1hcCAobWFya2V0ID0+ICh7XG4gICAgICAgICAgICAgICAgICAgIGlkOiBtYXJrZXQucXVvdGVJZCB8fCBtYXJrZXQucXVvdGUsXG4gICAgICAgICAgICAgICAgICAgIGNvZGU6IG1hcmtldC5xdW90ZSxcbiAgICAgICAgICAgICAgICB9KSlcbiAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IHNvcnRCeSAoYmFzZUN1cnJlbmNpZXMuY29uY2F0IChxdW90ZUN1cnJlbmNpZXMpLCAnY29kZScpXG4gICAgICAgIHRoaXMuY3VycmVuY2llcyA9IGRlZXBFeHRlbmQgKGluZGV4QnkgKGN1cnJlbmNpZXMsICdjb2RlJyksIHRoaXMuY3VycmVuY2llcyB8fCB7fSlcbiAgICAgICAgcmV0dXJuIHRoaXMubWFya2V0c1xuICAgIH1cblxuICAgIGFzeW5jIGxvYWRNYXJrZXRzIChyZWxvYWQgPSBmYWxzZSkge1xuICAgICAgICBpZiAoIXJlbG9hZCAmJiB0aGlzLm1hcmtldHMpIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5tYXJrZXRzQnlJZCkge1xuIC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ldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgbGV0IGFtb3VudCA9IG9yZGVyWydyZW1haW5pbmcnXVxuICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09IG1hcmtldFsnYmFzZSddICYmIG9yZGVyWydzaWRlJ10gPT0gJ3NlbGwnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRvdGFsICsgYW1vdW50XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09IG1hcmtldFsncXVvdGUnXSAmJiBvcmRlclsnc2lkZSddID09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRvdGFsICsgKG9yZGVyWydjb3N0J10gfHwgKG9yZGVyWydwcmljZSddICogYW1vdW50KSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRvdGFsXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIDApXG4gICAgfVxuXG4gICAgcGFyc2VCYWxhbmNlIChiYWxhbmNlKSB7XG5cbiAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLm9taXQgKGJhbGFuY2UsICdpbmZvJykpO1xuXG4gICAgICAgIGN1cnJlbmNpZXMuZm9yRWFjaCAoY3VycmVuY3kgPT4ge1xuXG4gICAgICAgICAgICBpZiAodHlwZW9mIGJhbGFuY2VbY3VycmVuY3ldLnVzZWQgPT0gJ3VuZGVmaW5lZCcpIHtcblxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnBhcnNlQmFsYW5jZUZyb21PcGVuT3JkZXJzICYmICgnb3Blbl9vcmRlcnMnIGluIGJhbGFuY2VbJ2luZm8nXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjaGFuZ2VPcmRlcnNDb3VudCA9IGJhbGFuY2VbJ2luZm8nXVsnb3Blbl9vcmRlcnMnXTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY2FjaGVkT3JkZXJzQ291bnQgPSBPYmplY3QudmFsdWVzICh0aGlzLm9yZGVycykuZmlsdGVyIChvcmRlciA9PiAob3JkZXJbJ3N0YXR1cyddID09ICdvcGVuJykpLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNhY2hlZE9yZGVyc0NvdW50ID09IGV4Y2hhbmdlT3JkZXJzQ291bnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhbGFuY2VbY3VycmVuY3ldLnVzZWQgPSB0aGlzLmdldEN1cnJlbmN5VXNlZE9uT3Blbk9yZGVycyAoY3VycmVuY3kpXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XS50b3RhbCA9IGJhbGFuY2VbY3VycmVuY3ldLnVzZWQgKyBiYWxhbmNlW2N1cnJlbmN5XS5mcmVlXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XS51c2VkID0gdGhpcy5nZXRDdXJyZW5jeVVzZWRPbk9wZW5PcmRlcnMgKGN1cnJlbmN5KVxuICAgICAgICAgICAgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XS50b3RhbCA9IGJhbGFuY2VbY3VycmVuY3ldLnVzZWQgKyBiYWxhbmNlW2N1cnJlbmN5XS5mcmVlXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBbICdmcmVlJywgJ3VzZWQnLCAndG90YWwnIF0uZm9yRWFjaCAoYWNjb3VudCA9PiB7XG4gICAgICAgICAgICAgICAgYmFsYW5jZVthY2NvdW50XSA9IGJhbGFuY2VbYWNjb3VudF0gfHwge31cbiAgICAgICAgICAgICAgICBiYWxhbmNlW2FjY291bnRdW2N1cnJlbmN5XSA9IGJhbGFuY2VbY3VycmVuY3ldW2FjY291bnRdXG4gICAgICAgICAgICB9KVxuICAgICAgIC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1ib2wgKG9yZGVycywgc3ltYm9sID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBncm91cGVkID0gdGhpcy5ncm91cEJ5IChvcmRlcnMsICdzeW1ib2wnKVxuICAgICAgICBpZiAoc3ltYm9sKSB7XG4gICAgICAgICAgICBpZiAoc3ltYm9sIGluIGdyb3VwZWQpXG4gICAgICAgICAgICAgICAgcmV0dXJuIGdyb3VwZWRbc3ltYm9sXVxuICAgICAgICAgICAgcmV0dXJuIFtdXG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG9yZGVyc1xuICAgIH1cblxuICAgIHBhcnNlT0hMQ1YgKG9obGN2LCBtYXJrZXQgPSB1bmRlZmluZWQsIHRpbWVmcmFtZSA9ICcxbScsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCkge1xuICAgICAgICByZXR1cm4gb2hsY3ZcbiAgICB9XG5cbiAgICBwYXJzZU9ITENWcyAob2hsY3ZzLCBtYXJrZXQgPSB1bmRlZmluZWQsIHRpbWVmcmFtZSA9ICcxbScsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBvaGxjdnMgPSBPYmplY3QudmFsdWVzIChvaGxjdnMpXG4gICAgICAgIGxldCByZXN1bHQgPSBbXVxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9obGN2cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKGxpbWl0ICYmIChyZXN1bHQubGVuZ3RoID49IGxpbWl0KSlcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGxldCBvaGxjdiA9IHRoaXMucGFyc2VPSExDViAob2hsY3ZzW2ldLCBtYXJrZXQsIHRpbWVmcmFtZSwgc2luY2UsIGxpbWl0KVxuICAgICAgICAgICAgaWYgKHNpbmNlICYmIChvaGxjdlswXSA8IHNpbmNlKSlcbiAgICAgICAgICAgICAgICBjb250aW51ZVxuIC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mNvbnN0IGV4dGVuZCA9ICguLi5hcmdzKSA9PiBPYmplY3QuYXNzaWduICh7fSwgLi4uYXJncylcblxuY29uc3QgZGVlcEV4dGVuZCA9IGZ1bmN0aW9uICguLi5hcmdzKSB7XG5cbiAgICAvLyBpZiAoYXJncy5sZW5ndGggPCAxKVxuICAgIC8vICAgICByZXR1cm4gYXJnc1xuICAgIC8vIGVsc2UgaWYgKGFyZ3MubGVuZ3RoIDwgMilcbiAgICAvLyAgICAgcmV0dXJuIGFyZ3NbMF1cblxuICAgIGxldCByZXN1bHQgPSB1bmRlZmluZWRcblxuICAgIGZvciAoY29uc3QgYXJnIG9mIGFyZ3MpIHtcblxuICAgICAgICBpZiAoYXJnICYmICh0eXBlb2YgYXJnID09ICdvYmplY3QnKSAmJiAoYXJnLmNvbnN0cnVjdG9yID09PSBPYmplY3QgfHwgISgnY29uc3RydWN0b3InIGluIGFyZykpKSB7XG5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0ICE9ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0ge31cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gYXJnKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0W2tleV0gPSBkZWVwRXh0ZW5kIChyZXN1bHRba2V5XSwgYXJnW2tleV0pXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgfSBlbHNlIHtcblxuICAgICAgICAgICAgcmVzdWx0ID0gYXJnXG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gcmVzdWx0XG59XG5cbmNvbnN0IG9taXQgPSAob2JqZWN0LCAuLi5hcmdzKSA9PiB7XG4gICAgY29uc3QgcmVzdWx0ID0gZXh0ZW5kIChvYmplY3QpXG4gICAgZm9yIChjb25zdCB4IG9mIGFyZ3MpIHtcbiAgICAgICAgaWYgKHR5cGVvZiB4ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgZGVsZXRlIHJlc3VsdFt4XVxuICAgICAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkgKHgpKSB7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGsgb2YgeClcbiAgICAgICAgICAgICAgICBkZWxldGUgcmVzdWx0W2tdXG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHJlc3VsdFxufVxuXG5jb25zdCBncm91cEJ5ID0gKGFycmF5LCBrZXkpID0+IHtcbiAgICBjb25zdCByZXN1bHQgPSB7fVxuICAgIE9iamVjdFxuICAgICAgICAudmFsdWVzIChhcnJheSlcbiAgICAgICAgLmZpbHRlciAoZW50cnkgPT4gZW50cnlba2V5XSAhPSAndW5kZWZpbmVkJylcbiAgICAgICAgLmZvckVhY2ggKGVudHJ5ID0+IHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0W2VudHJ5W2tleV1dID09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHJlc3VsdFtlbnRyeVtrZXldXSA9IFtdXG4gICAgICAgICAgICByZXN1bHRbZW50cnlba2V5XV0ucHVzaCAoZW50cnkpXG4gICAgICAgIH0pXG4gICAgcmV0dXJuIHJlc3VsdFxufVxuXG5jb25zdCBmaWx0ZXJCeSA9IChhcnJheSwga2V5LCB2YWx1ZSA9IHVuZGVmaW5lZCkgPT4ge1xuICAgIGlmICh2YWx1ZSkge1xuICAgICAgICBsZXQgZ3JvdXBlZCA9IGdyb3VwQnkgKGFycmF5LCBrZXkpXG4gICAgICAgIGlmICh2YWx1ZSBpbiBncm91cGVkKVxuICAgICAgICAgICAgcmV0dXJuIGdyb3VwZWRbdmFsdWVdXG4gICAgICAgIHJldHVybiBbXVxuICAgIH1cbiAgICByZXR1cm4gYXJyYXlcbn1cblxuY29uc3QgaW5kZXhCeSA9IChhcnJheSwga2V5KSA9PiB7XG4gICAgY29uc3QgcmVzdWx0ID0ge31cbiAgICBPYmplY3RcbiAgICAgICAgLnZhbHVlcyAoYXJyY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SA9PiB7XG5cbiAgICAgICAgICAgIHRyeSB7XG5cbiAgICAgICAgICAgICAgICBxdWV1ZS5wdXNoICh7IGNvc3QsIHJlc29sdmUsIHJlamVjdCB9KVxuXG4gICAgICAgICAgICAgICAgaWYgKCFydW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHJ1bm5pbmcgPSB0cnVlXG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChxdWV1ZS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBoYXNFbm91Z2hUb2tlbnMgPSBjZmcuY2FwYWNpdHkgPyAobnVtVG9rZW5zID4gMCkgOiAobnVtVG9rZW5zID49IDApXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFzRW5vdWdoVG9rZW5zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHsgY29zdCwgcmVzb2x2ZSwgcmVqZWN0IH0gPSBxdWV1ZVswXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3N0ID0gKGNvc3QgfHwgY2ZnLmRlZmF1bHRDb3N0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtVG9rZW5zID49IE1hdGgubWluIChjb3N0LCBjZmcuY2FwYWNpdHkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1Ub2tlbnMgLT0gY29zdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVldWUuc2hpZnQgKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUgKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIC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6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICczbSc6ICczbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJoJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGgnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzhoJzogJzhoJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkJyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2QnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxdycsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI5NjA0MDIwLWQ1NDgzY2RjLTg3ZWUtMTFlNy05NGM3LWQxYThkOTE2OTI5My5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cuYmluYW5jZS5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnd2FwaSc6ICdodHRwczovL2FwaS5iaW5hbmNlLmNvbS93YXBpL3YzJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5iaW5hbmNlLmNvbS9hcGkvdjEnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5iaW5hbmNlLmNvbS9hcGkvdjMnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbS9yZXN0YXBpcHViLmh0bWwnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYmluYW5jZS56ZW5kZXNrLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDA0MjkzMzInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9wdWJsaWMvcHJvZHVjdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FnZ1RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvMjRocicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbEJvb2tUaWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbGxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3Rlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJEYXRhU3RyZWFtJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyRGF0YVN0cmVhbSdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlckRhdGFTdHJlYW0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5CJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogNTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAwLjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQVMnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5UJzogMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ08nOiAwLjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDguMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS05DJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSU5LJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hWRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FMVCc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT1RBJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01EQSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEwnOiAwLjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VORyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBU1QnOiA0LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVRJzogMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMUkMnOiA3LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogNy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiA1MDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1dSJzogMTUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUksnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZTyc6IDMwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4xNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT0QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUT1JKJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldEV4Y2hhbmdlUHVibGljUHJvZHVjdCAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAobWFya2V0WydiYXNlQXNzZXQnXSk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAobWFya2V0WydxdW90ZUFzc2V0J10pO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBwYXJzZUZsb2F0IChtYXJrZXRbJ21pblRyYWRlJ10pO1xuICAgICAgICAgICAgbGV0IHRpY2tTaXplID0gcGFyc2VGbG9hdCAobWFya2V0Wyd0aWNrU2l6ZSddKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0Wyd0aWNrU2l6ZSddKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsndGlja1NpemUnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IG1hcmtldFsnYWN0aXZlJ10sXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aWNrU2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCBrZXkgPSAncXVvdGUnO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAqIHJhdGUpKTtcbiAgICAgICAgaWYgKHNpZGUgPT0gJ3NlbGwnKSB7XG4gICAgICAgICAgICBjb3N0ICo9IHByaWNlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAga2V5ID0gJ2Jhc2UnO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndHlwZSc6IHRha2VyT3JNYWtlcixcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFtrZXldLFxuICAgICAgICAgICAgJ3JhdGUnOiByYXRlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0ICh0aGlzLmZlZVRvUHJlY2lzaW9uIChzeW1ib2wsIGNvc3QpKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnQgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2VzJ107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICBsZXQgYXNzZXQgPSBiYWxhbmNlWydhc3NldCddO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGFzc2V0KTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnZnJlZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2xvY2tlZCddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnbGltaXQnOiAxMDAsIC8vIGRlZmF1bHQgPSBtYXhpbXVtID0gMTAwXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZUludGVnZXIgKHRpY2tlciwgJ2Nsb3NlVGltZScpO1xuICAgICAgICBpZiAodHlwZW9mIHRpbWVzdGFtcCA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbm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ICdpZCc7XG4gICAgICAgIGxldCBpZCA9IHRyYWRlW2lkRmllbGRdLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IG9yZGVyID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ29yZGVySWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgb3JkZXIgPSB0cmFkZVsnb3JkZXJJZCddLnRvU3RyaW5nICgpO1xuICAgICAgICBpZiAoJ20nIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBzaWRlID0gdHJhZGVbJ20nXSA/ICdzZWxsJyA6ICdidXknOyAvLyB0aGlzIGlzIHJldmVyc2VkIGludGVudGlvbmFsbHlcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHNpZGUgPSAodHJhZGVbJ2lzQnV5ZXInXSkgPyAnYnV5JyA6ICdzZWxsJzsgLy8gdGhpcyBpcyBhIHRydWUgc2lkZVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY29tbWlzc2lvbicgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHBhcnNlRmxvYXQgKHRyYWRlWydjb21taXNzaW9uJ10pLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh0cmFkZVsnY29tbWlzc2lvbkFzc2V0J10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2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vcmRlclsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBvcmRlclsndGltZSddO1xuICAgICAgICBsZXQgcHJpY2UgPSBwYXJzZUZsb2F0IChvcmRlclsncHJpY2UnXSk7XG4gICAgICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0IChvcmRlclsnb3JpZ1F0eSddKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2V4ZWN1dGVkUXR5JywgMC4wKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IE1hdGgubWF4IChhbW91bnQgLSBmaWxsZWQsIDAuMCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVySWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsndHlwZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBwcmljZSAqIGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3F1YW50aXR5JzogdGhpcy5hbW91bnRUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQpLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbGltaXQnKSB7XG4gICAgICAgICAgICBvcmRlciA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgICAgICAgICAgJ3RpbWVJbkZvcmNlJzogJ0dUQycsIC8vICdHVEMnID0gR29vZCBUbyBDYW5jZWwgKGRlZmF1bHQpLCAnSU9DJyA9IEltbWVkaWF0ZSBPciBDYW5jZWxcbiAgICAgICAgICAgIH0pO1xuICAgIC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gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVycyAocmVzcG9uc2UsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICghc3ltYm9sKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGNhbmNlbE9yZGVyIHJlcXVpcmVzIGEgc3ltYm9sIHBhcmFtJyk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gdW5kZWZpbmVkO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVEZWxldGVPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgICAgICdvcmRlcklkJzogcGFyc2VJbnQgKGlkKSxcbiAgICAgICAgICAgICAgICAvLyAnb3JpZ0NsaWVudE9yZGVySWQnOiBpZCxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UuaW5kZXhPZiAoJ1VOS05PV05fT1JERVInKSA+PSAwKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBjYW5jZWxPcmRlcigpIGVycm9yOiAnICsgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UpO1xuICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgfVxuXG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YWl0IHRoaXMud2FwaVBvc3RXaXRoZHJhdyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdhc3NldCc6IHRoaXMuY3VycmVuY3lJZCAoY3VycmVuY3kpLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKGFtb3VudCksXG4gICAgICAgICAgICAncmVjdldpbmRvdyc6IDEwMDAwMDAwLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICB1cmwgKz0gJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAnd2FwaScpXG4gICAgICAgICAgICB1cmwgKz0gJy5odG1sJztcbiAgICAgICAgaWYgKChhcGkgPT0gJ3ByaXZhdGUnKSB8fCAoYXBpID09ICd3YXBpJykpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoeyAndGltZXN0YW1wJzogbm9uY2UgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpL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XJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MTE5LTM1OTMyMjBlLTVlY2UtMTFlNy04YjNhLTVhMDQxZjZiY2MzZi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0MmMuY28uaWwnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0MmMuY28uaWwnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXQyYy5jby5pbC9ob21lL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vT2ZlckUvYml0MmMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0V4Y2hhbmdlcy97cGFpcn0vVGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeGNoYW5nZXMve3BhaXJ9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9CYWxhbmNlL3YyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNZXJjaGFudC9DcmVhdGVDaGVja291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWNjb3VudEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZENvaW5GdW5kc1JlcXVlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZEZ1bmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRPcmRlck1hcmtldFByaWNlQnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRPcmRlck1hcmtldFByaWNlU2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL015T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQYXltZW50L0dldE15SWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BheW1lbnQvU2VuZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL05JUyc6IHsgJ2lkJzogJ0J0Y05pcycsICdzeW1ib2wnOiAnQlRDL05JUycsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICAgICAgJ0JDSC9OSVMnOiB7ICdpZCc6ICdCY2hOaXMnLCAnc3ltYm9sJzogJ0JDSC9OSVMnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnTklTJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvTklTJzogeyAnaWQnOiAnTHRjTmlzJywgJ3N5bWJvbCc6ICdMVEMvTklTJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ05JUycgfSxcbiAgICAgICAgICAgICAgICAnQlRHL05JUyc6IHsgJ2lkJzogJ0J0Z05pcycsICdzeW1ib2wnOiAnQlRHL05JUycsICdiYXNlJzogJ0JURycsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC41IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEFjY291bnRCYWxhbmNlVjIgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGF2YWlsYWJsZSA9ICdBVkFJTEFCTEVfJyArIGN1cnJlbmN5O1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGJhbGFuY2VbYXZhaWxhYmxlXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gYmFsYW5jZVtjdXJ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9sdW1lICogYXZlcmFnZVByaWNlO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydoJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGwnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IGF2ZXJhZ2VQcmljZSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEV4Y2hhbmdlc1BhaXJUcmFkZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB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ICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9iaXRiYXkubmV0L0FQSS9QdWJsaWMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2JpdGJheS5uZXQvQVBJL1RyYWRpbmcvdHJhZGluZ0FwaS5waHAnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0YmF5Lm5ldC9wdWJsaWMtYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0YmF5Lm5ldC9hY2NvdW50L3RhYi1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdEJheU5ldC9BUEknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnQlRDVVNEJywgJ3N5bWJvbCc6ICdCVEMvVVNEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1VTRCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ0JUQ0VVUicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9QTE4nOiB7ICdpZCc6ICdCVENQTE4nLCAnc3ltYm9sJzogJ0JUQy9QTE4nLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnUExOJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvVVNEJzogeyAnaWQnOiAnTFRDVVNEJywgJ3N5bWJvbCc6ICdMVEMvVVNEJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ1VTRCcgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0VVUic6IHsgJ2lkJzogJ0xUQ0VVUicsICdzeW1ib2wnOiAnTFRDL0VVUicsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdFVVInIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9QTE4nOiB7ICdpZCc6ICdMVENQTE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LL1BMTicsICdiYXNlJzogJ0xTSycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0xTSy9CVEMnOiB7ICdpZCc6ICdMU0tCVEMnLCAnc3ltYm9sJzogJ0xTSy9CVEMnLCAnYmFzZSc6ICdMU0snLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjMgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA0MyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0SW5mbyAoKTtcbiAgICAgICAgaWYgKCdiYWxhbmNlcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ2JhbGFuY2VzJ107XG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAg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gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKSArICcuanNvbic7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbW9tZW50JzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0FQSS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQVBJLUhhc2gnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLC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3B1YmxpYyc6ICdodHRwczovL3ZpcC5iaXRjb2luLmNvLmlkL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vdmlwLmJpdGNvaW4uY28uaWQvdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdGNvaW4uY28uaWQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3ZpcC5iaXRjb2luLmNvLmlkL2Rvd25sb2Fkcy9CSVRDT0lOQ09JRC1BUEktRE9DVU1FTlRBVElPTi5wZGYnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly92aXAuYml0Y29pbi5jby5pZC90cmFkZV9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJz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pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbYmFzZVZvbHVtZV0pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyW3F1b3RlVm9sdW1lXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICA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ICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW0nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWgnLFxuICAgICAgICAgICAgICAgICczaCc6ICczaCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFEJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnN0QnLFxuICAgICAgICAgICAgICAgICcydyc6ICcxNEQnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI0NC1lMzI4YTUwYy01ZWQyLTExZTctOTQ3Yi0wNDE0MTY1NzliYjMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGZpbmV4LnJlYWRtZS5pby92MS9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaXRmaW5leGNvbS9iaXRmaW5leC1hcGktbm9kZScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd2Mic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L3tzZWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy90cmFkZTp7dGltZWZyYW1lfTp7c3ltYm9sfS9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdjYW5kbGVzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kYm9vay97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kcy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzX2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RvZGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRfaW5mb3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXNrZXRfbWFuYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVkaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0L25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZy9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9tb3ZlbWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tleV9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5faW5mb3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlc19mdW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVyL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXIvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVycy9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9tdWx0aScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL3JlcGxhY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvbmV3L211bHRpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2NsYWltJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VuX2Z1bmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0b3RhbF90YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VudXNlZF90YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIC8vIGlzc3VlICM0IEJpdGZpbmV4IG5hbWVzIERhc2ggYXMgRFNILCBpbnN0ZWFkIG9mIERBU0hcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEU0gnKVxuICAgICAgICAgICAgcmV0dXJuICdEQVNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdRVE0nKVxuICAgICAgICAgICAgcmV0dXJuICdRVFVNJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCQ0MnKVxuICAgICAgICAgICAgcmV0dXJuICdDU1RfQkNDJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCQ1UnKVxuICAgICAgICAgICAgcmV0dXJuICdDU1RfQkNVJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRTeW1ib2xzRGV0YWlscyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ10udG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWluaW11bV9vcmRlcl9zaXplJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4aW11bV9vcmRlcl9zaXplJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VUeXBlID0gdGhpcy5zYWZlU3RyaW5nIChwYXJhbXMsICd0eXBlJywgJ2V4Y2hhbmdlJyk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFs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gIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnYW1vdW50Jyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRpY2tlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2ldO1xuICAgICAgICAgICAgaWYgKCdwYWlyJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ3BhaXInXTtcbiAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoVGlja2VycygpIGZhaWxlZCB0byByZWNvZ25pemUgc3ltYm9sICcgKyBpZCArICcgJyArIHRoaXMuanNvbiAodGlja2VyKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZmV0Y2hUaWNrZXJzKCkgcmVzcG9uc2Ugbm90IHJlY29nbml6ZWQgJyArIHRoaXMuanNvbiAodGlja2VycykpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJ0aWNrZXJTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlRmxvYXQgKHRpY2tlclsndGltZXN0YW1wJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIGlmICgncGFpcicgaW4gdGlja2VyKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ3BhaXInXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyB1bnJlY29nbml6ZWQgdGlja2VyIHN5bWJvbCAnICsgaWQgKyAnICcgKyB0aGlzLmpzb24gKHRpY2tlcikpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0X3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxc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3BvbnNlID0gYXdhaXQgdGhpcy52MkdldENhbmRsZXNUcmFkZVRpbWVmcmFtZVN5bWJvbEhpc3QgKHJlcXVlc3QpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9ITENWcyAocmVzcG9uc2UsIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGdldEN1cnJlbmN5TmFtZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCVEMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2JpdGNvaW4nO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdMVEMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2xpdGVjb2luJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnRVRIJykge1xuICAgICAgICAgICAgcmV0dXJuICdldGhlcmV1bSc7XG4gICAgICAgIH0gZWxzZSBpZiAoY3VycmVuY3kgPT0gJ0VUQycpIHtcbiAgICAgICAgICAgIHJldHVybiAnZXRoZXJldW1jJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnT01OSScpIHtcbiAgICAgICAgICAgIHJldHVybiAnbWFzdGVyY29pbic7IC8vID8/P1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdaRUMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ3pjYXNoJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnWE1SJykge1xuICAgICAgICAgICAgcmV0dXJuICdtb25lcm8nO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdVU0QnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ3dpcmUnO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdEQVNIJykge1xuICAgICAgICAgICAgcmV0dXJuICdkYXNoJztcbiAgICAgICAgfSBlbHNl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GlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIHVybCArPSBzdWZmaXg7XG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSBzdWZmaXg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICAgICAncmVxdWVzdCc6IHJlcXVlc3QsXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSB0aGlzLnN0cmluZ1RvQmFzZTY0IChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHBheWxvYWQsIHNlY3JldCwgJ3NoYTM4NCcpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1CRlgtQVBJS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1gtQkZYLVBBWUxPQUQnOiB0aGlzLmRlY29kZSAocGF5bG9hZCksXG4gICAgICAgICAgICAgICAgJ1gtQkZYLVNJR05BVFVSRSc6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gcmVzcG9uc2VbJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnS2V5IHByaWNlIHNob3VsZCBiZSBhIGRlY2ltYWwgbnVtYmVyJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlLmluZGV4T2YgKCdJbnZhbGlkIG9yZGVyOiBub3QgZW5vdWdoIGV4Y2hhbmdlIGJhbGFuY2UnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS5pbmRleE9mICgnSW52YWxpZCBvcmRlcicpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS5pbmRleE9mICgnT3JkZXIgY291bGQgbm90IGJlIGNhbmN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ICAgICdmZXRjaE9wZW5PcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnM2gnOiAnM2gnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxRCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzdEJyxcbiAgICAgICAgICAgICAgICAnMncnOiAnMTREJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI0NC1lMzI4YTUwYy01ZWQyLTExZTctOTQ3Yi0wNDE0MTY1NzliYjMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGZpbmV4LnJlYWRtZS5pby92Mi9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaXRmaW5leGNvbS9iaXRmaW5leC1hcGktbm9kZScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYXRmb3JtL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS97cHJlY2lzaW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9SMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sc19kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L3tzaWRlfS97c2VjdGlvbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzMS97a2V5fTp7c2l6ZX06e3N5bWJvbH0vbG9uZy9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L2xvbmcvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9zaG9ydC9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L3Nob3J0L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2xhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbGMvdHJhZGUvYXZnJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVycy97c3ltYm9sfS9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVyL3tzeW1ib2x9OntpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvdHJhZGVzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL29mZmVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvb2ZmZXJzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL2xvYW5zL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9sb2Fucy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9jcmVkaXRzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9jcmVkaXRzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL3RyYWRlcy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvaW5mby9tYXJnaW4ve2tleX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9pbmZvL2Z1bmRpbmcve2tleX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9tb3ZlbWVudHMve2N1cnJlbmN5fS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivc3RhdHMvcGVyZjp7dGltZWZyYW1lfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvYWxlcnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3cvYWxlc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yJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICAvLyBpc3N1ZSAjNCBCaXRmaW5leCBuYW1lcyBEYXNoIGFzIERTSCwgaW5zdGVhZCBvZiBEQVNIXG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRFNIJylcbiAgICAgICAgICAgIHJldHVybiAnREFTSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnUVRNJylcbiAgICAgICAgICAgIHJldHVybiAnUVRVTSc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RBdXRoUldhbGxldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlVHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICdleGNoYW5nZScpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgcmVzcG9uc2UubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbYl07XG4gICAgICAgICAgICBsZXQgWyBhY2NvdW50VHlwZSwgY3VycmVuY3ksIHRvdGFsLCBpbnRlcmVzdCwgYXZhaWxhYmxlIF0gPSBiYWxhbmNlO1xuICAgICAgICAgICAgaWYgKGFjY291bnRUeXBlID09IGJhbGFuY2VUeXBlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5WzBdID09ICd0JylcbiAgICAgICAgICAgICAgICAgICAgY3VycmVuY3kgPSBjdXJyZW5jeS5zbGljZSAoMSk7XG4gICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIHVwcGVyY2FzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1cHBlcmNhc2UpO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGF2YWlsYWJsZTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdG90YWw7XG4gICAgICAgICAgICAgICAgaWYgKGFjY291bnRbJ2ZyZWUnXSlcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJvb2tTeW1ib2xQcmVjaXNpb24gKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiAnUjAnLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiBbXSxcbiAgICAgICAgICAgICdhc2tzJzogW10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVyYm9vay5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJib29rW2ldO1xuICAgICAgICAgICAgbGV0IHByaWNlID0gb3JkZXJbMV07XG4gICAgICAgICAgICBsZXQgYW1vdW50ID0gb3JkZXJbMl07XG4gICAgICAgICAgICBsZXQgc2lkZSA9IChhbW91bnQgPiAwKSA/ICdiaWRzJyA6ICdhc2tzJztcbiAgICAgICAgICAgIGFtb3VudCA9IE1hdGguYWJzIChhbW91bnQpO1xuICAgICAgICAgICAgcmVzdWx0W3NpZGVdLnB1c2ggKFsgcHJpY2UsIGFtb3VudCBdKTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHRbJ2JpZHMnXSA9IHRoaXMuc29ydEJ5IChyZXN1bHRbJ2JpZHMnXSwgMCwgdHJ1ZSk7XG4gICAgICAgIHJlc3VsdFsnYXNrcyddID0gdGhpcy5zb3J0QnkgKHJlc3VsdFsnYXNrcyddLCAwKTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxlbmd0aCA9IHRpY2tlci5sZW5ndGg7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyW2xlbmd0aCAtIDJdLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlcltsZW5ndGggLSAxXSxcbiAgICAgICAgICAgICdiaWQnOiB0aWNrZXJbbGVuZ3RoIC0gMTBdLFxuICAgICAgICAgICAgJ2Fzayc6IHRpY2tlcltsZW5ndGggLSA4XSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRpY2tlcltsZW5ndGggLSA0XSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB0aWNrZXJbbGVuZ3RoIC0gNl0sXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHRpY2tlcltsZW5ndGggLSA1XSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aWNrZXJbbGVuZ3RoIC0gM10sXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzICh0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hbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnL2FwaScgKyAnLycgKyByZXF1ZXN0ICsgbm9uY2UgKyBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMzg0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdiZngtbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYmZ4LWFwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdiZngtc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmIChyZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgIC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CB7XG4gICAgICAgICAgICAnaWQnOiAnYml0Zmx5ZXInLFxuICAgICAgICAgICAgJ25hbWUnOiAnYml0Rmx5ZXInLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdKUCcsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MDUxNjQyLTU2MTU0MTgyLTY2MGUtMTFlNy05YjBkLTYwNDJkMWU2ZWRkOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYml0Zmx5ZXIuanAnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXRmbHllci5qcCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JpdGZseWVyLmpwL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHMnLCAgICAvLyBvciAnbWFya2V0cydcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRib2FyZCcsICAgICAgLy8gb3IgJ2JvYXJkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHRpY2tlcicsICAgICAvLyBvciAndGlja2VyJ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGV4ZWN1dGlvbnMnLCAvLyBvciAnZXhlY3V0aW9ucydcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRoZWFsdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNoYXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBlcm1pc3Npb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjb2xsYXRlcmFsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjb2xsYXRlcmFsYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29pbmlucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29pbm91dHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbmthY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHdpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjaGlsZG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGFyZW50b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRwYXJlbnRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR0cmFkaW5nY29tbWlzc2lvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRjb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZGNoaWxkb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbGNoaWxkb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRwYXJlbnRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VscGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbGFsbGNoaWxkb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wydwcm9kdWN0X2NvZGUnXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGxldCBudW1DdXJyZW5jaWVzID0gY3VycmVuY2llcy5sZW5ndGg7XG4gICAgICAgICAgICBpZiAobnVtQ3VycmVuY2llcyA9PSAxKSB7XG4gICAgICAgICAgICAgICAgYmFzZSA9IHN5bWJvbC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBzeW1ib2wuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChudW1DdXJyZW5jaWVzID09IDIpIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1swXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMV07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1sxXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMl07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHt9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHJlc3BvbnNlLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHJlc3BvbnNlW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYWNjb3VudFsnY3VycmVuY3lfY29kZSddO1xuICAgICAgICAgICAgYmFsYW5jZXNbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZXNbY3VycmVuY3ldWydhdmFpbGFibGUnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO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Cc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmVzdF9iaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydiZXN0X2FzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbHRwJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lX2J5X3Byb2R1Y3QnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgb3JkZXIgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnc2lkZScgaW4gdHJhZGUpXG4gICAgICAgICAgICBpZiAodHJhZGVbJ3NpZGUnXSkge1xuICAgICAgICAgICAgICAgIHNpZGUgPSB0cmFkZVsnc2lkZSddLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IHNpZGUgKyAnX2NoaWxkX29yZGVyX2FjY2VwdGFuY2VfaWQnO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiB0cmFkZSlcbiAgICAgICAgICAgICAgICAgICAgb3JkZXIgPSB0cmFkZVtpZF07XG4gICAgICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ2V4ZWNfZGF0ZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVyLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnc2l6ZSddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEV4ZWN1dGlvbnMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncHJvZHVjdF9jb2RlJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJ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VtYi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYml0aHVtYi5jb20vdTEvVVMxMjcnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlY2VudF90cmFuc2FjdGlvbnMve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVjZW50X3RyYW5zYWN0aW9ucy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3dhbGxldF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vdXNlcl90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL3BsYWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL29yZGVyX2RldGFpbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9idGNfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUva3J3X2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2tyd193aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9tYXJrZXRfYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9tYXJrZXRfc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlckFsbCAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAobWFya2V0c1snZGF0YSddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBpZiAoaWQgIT0gJ2RhdGUnKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVtpZF07XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSAnS1JXJztcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAgICAgJ2xvdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm9CYWxhbmNlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogJ0FMTCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGxvd2VyY2FzZSA9IGN1cnJlbmN5LnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA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gbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodGlja2VyWydkYXRlJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWF4X3ByaWNlJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21pbl9wcmljZScpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXlfcHJpY2UnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2VsbF9wcmljZScpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdvcGVuaW5nX3ByaWNlJyksXG4gICAgICAgICAgICAnY2xvc2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnY2xvc2luZ19wcmljZScpLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdF90cmFkZScpLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXZlcmFnZV9wcmljZScpLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lXzFkYXknKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJBbGwgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHJlc3BvbnNlWydkYXRhJ11bJ2RhdGUnXTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSB0aGlzLm9taXQgKHJlc3BvbnNlWydkYXRhJ10sICdkYXRlJyk7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICA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tYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgICAgICdjb3VudCc6IDEwMCwgLy8gbWF4ID0gMTAwXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbJ2RhdGEnXSwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICB0aHJvdyBuZXcgTm90U3VwcG9ydGVkICh0aGlzLmlkICsgJyBwcml2YXRlIEFQSSBub3QgaW1wbGVtZW50ZWQgeWV0Jyk7XG4gICAgICAgIC8vICAgICBsZXQgcHJlZml4ID0gJyc7XG4gICAgICAgIC8vICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgLy8gICAgICAgICBwcmVmaXggPSAnbWFya2V0Xyc7XG4gICAgICAgIC8vICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgIC8vICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAvLyAgICAgICAgICdxdWFudGl0eSc6IGFtb3VudCxcbiAgICAgICAgLy8gICAgICAgICAncHJpY2UnOiBwcmljZSB8fCAwLFxuICAgICAgICAvLyAgICAgICAgICd0eXBlJzogcHJlZml4ICsgc2lkZSxcbiAgICAgICAgLy8gICAgIH07XG4gICAgICAgIC8vICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJDcmVhdGUgKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIC8vICAgICByZXR1cm4ge1xuICAgICAgICAvLyAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIC8vICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ29yZGVyX2lk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ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBlbmRwb2ludCA9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArIGVuZHBvaW50O1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdlbmRwb2ludCc6IGVuZHBvaW50LFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IGVuZHBvaW50ICsgXCJcXDBcIiArIGJvZHkgKyBcIlxcMFwiICsgbm9uY2U7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FwaS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQXBpLVNpZ24nOiB0aGlzLmRlY29kZSAodGhpcy5zdH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vbS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGN2JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjdicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc19kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzX29wZXJhdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3RyYWRlc19ieV9pZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9hbGxfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfYmNvZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZV90ZW1wbGF0ZV93YWxsZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZV90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9hY2NvdW50c19vcGVyYXRpb25zX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfYWN0aXZlX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9iY29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfbXlfbWF0Y2hlc19mcm9tX3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X215X3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9teV90cmFkc19mcm9tX3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3BheW1lbnRfbWV0aG9kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9wYXltZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVkZWVtX2NvZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Jlc2lnbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2lnbmluJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWdub3V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9vcHRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfYnlfaWQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmICghdGhpcy5zdWJzdGl0dXRlQ29tbW9uQ3VycmVuY3lDb2RlcylcbiAgICAgICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdYQlQnKVxuICAgICAgICAgICAgcmV0dXJuICdCVEMnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JDQycpXG4gICAgICAgICAgICByZXR1cm4gJ0JDSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRFJLJylcbiAgICAgICAgICAgIHJldHVybiAnREFTSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRFNIJylcbiAgICAgICAgICAgIGN1cnJlbmN5ID0gJ0RBU0gnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFBhaXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tleXNbcF1dO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWF4JyksXG4gICA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NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2N1cnJlbmN5XVsnZnVuZHMnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2hvbGRlZCddKTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBzaWduSW4gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5wcml2YXRlUG9zdFNpZ25pbiAoe1xuICAgICAgICAgICAgJ2xvZ2luJzogdGhpcy5sb2dpbixcbiAgICAgICAgICAgICdwYXNzd2QnOiB0aGlzLnBhc3N3b3JkLFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAncGFpcl9pZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnZGlyJzogKHNpZGUgPT0gJ2J1eScpID8gJ2JpZCcgOiAnYXNrJyxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICA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BhcnNlRmxvYXQgKGFtb3VudCksXG4gICAgICAgICAgICAnYWNjb3VudCc6IGFkZHJlc3MsXG4gICAgICAgICAgICAncGF5bWVudF9tZXRob2QnOiAnYml0Y29pbicsIC8vIHRoZXkgZGlkIG5vdCBkb2N1bWVudCBvdGhlciB0eXBlcy4uLlxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnbWVzc2FnZV9pZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0geyAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZ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c6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICc5MG0nOiAnOTBtJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzdkJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICczTSc6ICczbScsXG4gICAgICAgICAgICAgICAgJzZNJzogJzZtJyxcbiAgICAgICAgICAgICAgICAnMXknOiAnMXknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjcyNTYtYTg1NTUyMDAtNWVmOS0xMWU3LTk2ZmQtNDY5YTY1ZTJiMGJkLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0JyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cuYml0bWFya2V0LnBsL2FwaTIvJywgLy8gbGFzdCBzbGFzaCBpcyBjcml0aWNhbFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmJpdG1hcmtldC5wbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0JyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0L2RvY3MucGhwP2ZpbGU9YXBpX3B1YmxpYy5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmJpdG1hcmtldC5uZXQvZG9jcy5waHA/ZmlsZT1hcGlfcHJpdmF0ZS5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaXRtYXJrZXQtbmV0L2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnanNvbi97bWFya2V0fS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24ve21hcmtldH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqc29uL3ttYXJrZXR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnanNvbi9jdHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS85MG0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS82aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzFkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vN2QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8xbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzNtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vNm0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8xeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nZGVzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ2Rlc2tTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdkZXNrQ29uZmlybScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvdHJhZGluZ2Rlc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b3RyYWRpbmdkZXNrU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG90cmFkaW5nZGVza0NvbmZpcm0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0ZpYXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3UExOUFAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3RmlhdEZhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbk9wZW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkNsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5DYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbk1vZGlmeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQmFsYW5jZUFkZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQmFsYW5jZVJlbW92ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3dhcExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N3YXBPcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzd2FwQ2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9QTE4nOiB7ICdpZCc6ICdCVENQTE4nLCAnc3ltYm9sJzogJ0JUQy9QTE4nLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnUExOJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDRVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgICAgICAnTFRDL1BMTic6IHsgJ2lkJzogJ0xUQ1BMTicsICdzeW1ib2wnOiAnTFRDL1BMTicsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9CVEMnOiB7ICdpZCc6ICdMVENCVEMn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ICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZVsnYXZhaWxhYmxlJ10pXG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZVsnYXZhaWxhYmxlJ11bY3VycmVuY3ldO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VbJ2Jsb2NrZWQnXSlcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBiYWxhbmNlWydibG9ja2VkJ11bY3VycmVuY3ldO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0SnNvbk1hcmtldE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2JpZHMnOiBvcmRlcmJvb2tbJ2JpZHMnXSxcbiAgICAgICAgICAgICdhc2tzJzogb3JkZXJib29rWydhc2tzJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICB9O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AgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsndHlwZSddID09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmF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JhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3B1YmxpY0dldEdyYXBoc01hcmtldCcgKyB0aGlzLnRpbWVmcmFtZXNbdGltZWZyYW1lXTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPSExDVnMgKHJlc3BvbnNlLCBtYXJrZXQsIHRpbWVmcmFtZSwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmF0ZSc6IHByaWNlLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH07XG4gICAgICAgIGlmICgnaWQnIGluIHJlc3BvbnNlWydvcmRlciddKVxuICAgICAgICAgICAgcmVzdWx0WydpZCddID0gcmVzcG9uc2VbJ2lkJ107XG4gICAgICAgIHJld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7XG4gICAgICAgICAgICByZXF1ZXN0WydhZGRyZXNzJ10gPSBhZGRyZXNzO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCArICcuanNvbicsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgfSwgcGFyYW1zKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQVBJLUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBUEktSGFzaCc6IHRoaXMuaG1hY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ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICd0ZXN0JzogJ2h0dHBzOi8vdGVzdG5ldC5iaXRtZXguY29tJyxcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzE5LWY2NTNjNmU2LTVlZDQtMTFlNy05MzNkLWYwYmMzNjk5YWU4Zi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRtZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbS9hcHAvYXBpT3ZlcnZpZXcnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdE1FWC9hcGktY29ubmVjdG9ycy90cmVlL21hc3Rlci9vZmZpY2lhbC1odHRwJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbm5vdW5jZW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fubm91bmNlbWVudC91cmdlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZUFuZEluZGljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQvYWN0aXZlSW50ZXJ2YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2NvbXBvc2l0ZUluZGV4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2luZGljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3VyYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVhZGVyYm9hcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpcXVpZGF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vay9MMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlL2J1Y2tldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzY2hlbWEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NjaGVtYS93ZWJzb2NrZXRIZWxwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZXR0bGVtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2J1Y2tldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdC9jaGFubmVscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdC9jb25uZWN0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9uL3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbm90aWZpY2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYWZmaWxpYXRlU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NoZWNrUmVmZXJyYWxDb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWFyZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21pbldpdGhkcmF3YWxGZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXBpS2V5L2Rpc2FibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleS9lbmFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9idWxrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWxBbGxBZnRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2xvc2VQb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vaXNvbGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3Jpc2tMaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vdHJhbnNmZXJNYXJnaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY2FuY2VsV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb25maXJtRW1haWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybUVuYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb25maXJtV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9kaXNhYmxlVEZBJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dvdXRBbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJlZmVyZW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcmVxdWVzdEVuYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9yZXF1ZXN0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2J1bGsnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJbnN0cnVtZW50QWN0aXZlQW5kSW5kaWNlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChtYXJrZXRbJ3N0YXRlJ10gIT0gJ1VubGlzdGVkJyk7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3VuZGVybHlpbmcnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGVDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHR5cGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgZnV0dXJlID0gZmFsc2U7XG4gICAgICAgICAgICBsZXQgcHJlZGljdGlvbiA9IGZhbHNlO1xuICAgICAgICAgICAgbGV0IGJhc2VxdW90ZSA9IGJhc2UgKyBxdW90ZTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3dhcCA9IChpZCA9PSBiYXNlcXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWYgKHN3YXApIHtcbiAgICAgICAgICAgICAgICB0eXBlID0gJ3N3YXAnO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaWQuaW5kZXhPZiAoJ0JfJykgPj0gMCkge1xuICAgICAgICAgICAgICAgIHByZWRpY3Rpb24gPSB0cnVlO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAncHJlZGljdGlvbic7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZ1dHVyZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdmdXR1cmUnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG1ha2VyID0gbWFya2V0WydtYWtlckZlZSddO1xuICAgICAgICAgICAgbGV0IHRha2VyID0gbWFya2V0Wyd0YWtlckZlZSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICAgICAnc3BvdCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdzd2FwJzogc3dhcCxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZnV0dXJlLFxuICAgICAgICAgICAgICAgICdwcmVkaWN0aW9uJzogcHJlZGljdGlvbixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyTWFyZ2luICh7ICdjdXJyZW5jeSc6ICdhbGwnIH0pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgcmVzcG9uc2UubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVNYXJnaW4nXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydhbW91bnQnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JUQycpIHtcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBhY2NvdW50WydmcmVlJ10gKiAwLjAwMDAwMDAxO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBhY2NvdW50Wyd0b3RhbCddICogMC4wMDAwMDAwMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rTDIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHJl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ICAgICAgICdhc2snOiBwYXJzZUZsb2F0IChxdW90ZVsnYXNrUHJpY2UnXSksXG4gICAgICAgICAgICAndndhcCc6IHBhcnNlRmxvYXQgKHRpY2tlclsndndhcCddKSxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogcGFyc2VGbG9hdCAodGlja2VyWydjbG9zZSddKSxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnaG9tZU5vdGlvbmFsJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWydmb3JlaWduTm90aW9uYWwnXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU9ITENWIChvaGxjdiwgbWFya2V0ID0gdW5kZWZpbmVkLCB0aW1lZnJhbWUgPSAnMW0nLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvaGxjdlsndGltZXN0YW1wJ10pO1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgdGltZXN0YW1wLFxuICAgICAgICAgICAgb2hsY3ZbJ29wZW4nXSxcbiAgICAgICAgICAgIG9obGN2WydoaWdoJ10sXG4gICAgICAgICAgICBvaGxjdlsnbG93J10sXG4gICAgICAgICAgICBvaGxjdlsnY2xvc2UnXS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ggKE9UUCkgaXMgZW5hYmxlZFxuICAgICAgICAgICAgLy8gJ2ZlZSc6IDAuMDAxLCAvLyBiaXRjb2luIG5ldHdvcmsgZmVlXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RVc2VyUmVxdWVzdFdpdGhkcmF3YWwgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsndHJhbnNhY3RJRCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA9PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09IFwie1wiKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZVsnZXJyb3InXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcXVlcnkgPSAnL2FwaScgKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgcXVlcnkgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgcXVlcnk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG1ldGhvZCArIHF1ZXJ5ICsgbm9uY2U7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICAnYXBpLW5vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FwaS1rZXknOiB0aGl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b24nOiAndjMnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjMzNS03MTVjZTdhYS01ZWQ1LTExZTctODhhOC0xNzNhMjdiYjMwZmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdHNvLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2JpdHNvLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JpdHNvLmNvbS9hcGlfaW5mbycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2F2YWlsYWJsZV9ib29rcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5ncy97ZmlkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19kZXN0aW5hdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAna3ljX2RvY3VtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyL2Z1bmRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ214X2JhbmtfY29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl90cmFkZXMve29pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97b2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzL3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL3t3aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZWJpdF9jYXJkX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGhvbmVfbnVtYmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwaG9uZV92ZXJpZmljYXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bob25lX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NwZWlfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tvaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEF2YWlsYWJsZUJvb2tzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0c1sncGF5bG9hZCddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncGF5bG9hZCddW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wydib29rJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQudG9VcHBlckNhc2UgKCkucmVwbGFjZSAoJ18nLCAnLycpO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWluaW11bV9hbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21heGltdW1fYW1vdW50J10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAobWFya2V0WydtaW5pbXVtX3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogcGFyc2VGbG9hdCAobWFya2V0WydtYXhpbXVtX3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pbmltdW1fdmFsdWUnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21heGltdW1fdmFsdWUnXSksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluaW11bV9hbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ21pbmltdW1fcHJpY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IGxpbWl0c1snYW1vdW50J11bJ21pbiddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncGF5bG9hZCddWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydsb2NrZWQnXSksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsndG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIH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odGlja2VyWyd2d2FwJ10pO1xuICAgICAgICBsZXQgYmFzZVZvbHVtZSA9IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lJ10pO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSBiYXNlVm9sdW1lICogdndhcDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgI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OTQ0NTQvMjc3ODYzNzctOGM4YWI1N2UtNWZlOS0xMWU3LThlYTQtMmIwNWI2YmNjZWVjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vay97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfaG91ci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmctcGFpcnMtaW5mby8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhbnNhY3Rpb25zLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMvYWxsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwvbWFya2V0L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2x0Y193aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbHRjX2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldGhfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXItdG8tbWFpbi8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyLWZyb20tbWFpbi8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3hycF93aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAneHJwX2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL29wZW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL3N0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwvY2FuY2VsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlxdWlkYXRpb25fYWRkcmVzcy9uZXcvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXF1aWRhdGlvbl9hZGRyZXNzL2luZm8vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd2MSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9kZXBvc2l0X2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bmNvbmZpcm1lZF9idGMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRpbmdQYWlyc0luZm8gKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3VybF9zeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYmFzZV9kZWNpbWFscyddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsnY291bnRlcl9kZWNpbWFscyddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBbIGNvc3QsIGN1cnJlbmN5IF0gPSBtYXJrZXRbJ21pbmltdW1fb3JkZXInXS5zcGxpdCAoJyAnKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0Wyd0cmFkaW5nJ10gPT0gJ0VuYWJsZWQnKTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKGNvc3QpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlckJvb2tQYWlyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChvcmRlcmJvb2tbJ3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHRpbWVzdGFtcCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge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9TdHJpbmcgKCk7XG4gICAgICAgIGlmICgnY3VycmVuY3lfcGFpcicgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGlmICh0cmFkZVsnY3VycmVuY3lfcGFpciddIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbdHJhZGVbJ2N1cnJlbmN5X3BhaXInXV07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKHRyYWRlWydhbW91bnQnXSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhbnNhY3R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nJlZV0pO1xuICAgICAgICAgICAgaWYgKHVzZWQgaW4gYmFsYW5jZSlcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW3VzZWRdKTtcbiAgICAgICAgICAgIGlmICh0b3RhbCBpbiBiYWxhbmNlKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW3RvdGFsXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlUG9zdCcgKyB0aGlzLmNhcGl0YWxpemUgKHNpZGUpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIG1ldGhvZCArPSAnTWFya2V0JztcbiAgICAgICAgZWxzZVxuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgbWV0aG9kICs9ICdQYWlyJztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICA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XMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHRoaXMudWlkICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5lbmNvZGUgKHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc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IEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXRzdGFtcDEnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQml0c3RhbXAgdjEnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdHQicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3ODYzNzctOGM4YWI1N2UtNWZlOS0xMWU3LThlYTQtMmIwNWI2YmNjZWVjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfaG91cicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldXJfdXNkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfYWxsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmlwcGxlX2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxfcmVxdWVzdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAg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ICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnb25lTWluJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnZml2ZU1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICd0aGlydHlNaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICdob3VyJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnZGF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzUyLWNmMGIzYzI2LTVlZDUtMTFlNy04MmI3LWYzODI2YjdhOTdkOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCc6ICdodHRwczovL2JpdHRyZXguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdtYXJrZXQnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAndjInOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGkvdjIuMC9wdWInLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2JpdHRyZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9Ib21lL0FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5ucG1qcy5vcmcvcGFja2FnZS9ub2RlLmJpdHRyZXguYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9GZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5iaXR0cmV4LmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDAxOTk2NTEtV2hhdC1mZWVzLWRvZXMtQml0dHJleC1jaGFyZ2UtJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YyJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMvR2V0QlRDUHJpY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9HZXRUaWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L0dldExhdGVzdFRpY2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01hcmtldHMvR2V0TWFya2V0U3VtbWFyaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvR2V0TGF0ZXN0VGljaycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0c3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2FjY291bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRhZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0aGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eW1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVub3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAy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5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5UcmFkZVNpemUnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50TGltaXRzLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlTGltaXRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ0lzQWN0aXZlJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgfSkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmFjY291bnRHZXRCYWxhbmNlcyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBpbmRleGVkID0gdGhpcy5pbmRleEJ5IChiYWxhbmNlcywgJ0N1cnJlbmN5Jyk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKGluZGV4ZWQpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGluZGV4ZWRbaWRdO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydBdmFpbGFibGUnXSk7XG4gICAgICAgICAgICBsZXQgdG90YWwgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydCYWxhbmNlJ10pO1xuICAgICAgICAgICAgbGV0IHVzZWQgPSB0b3RhbCAtIGZyZWU7XG4gICAgICAgIC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107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnTG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0JpZCcpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdBc2snKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdMYXN0JyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ1ZvbHVtZScpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0Jhc2VWb2x1bWUnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ3VycmVuY2llcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jaWVzIChwYXJhbXMpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnQ3VycmVuY3knXTtcbiAgICAgICAgICAgIC8vIHRvZG86IHdpbGwgbmVlZCB0byByZXRoaW5rIHRoZSBmZWVzXG4gICAgICAgICAgICAvLyB0byBhZGQgc3VwcG9ydCBmb3IgbXVsdGlwbGUgd2l0aGRyYXdhbC9kZXBvc2l0IG1ldGhvZHMgYW5kXG4gICAgICAgICAgICAvLyBkaWZmZXJlbnRpYXRlZCBmZWVzIGZvciBlYWNoIHBhcnRpY3VsYXIgbWV0aG9kXG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChpZCk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LCAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydDdXJyZW5jeUxvbmcnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogY3VycmVuY3lbJ0lzQWN0aXZlJ10sXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5WydUeEZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnVHhGZWUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHN1bW1hcmllcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgdCA9IDA7IHQgPCB0aWNrZXJzLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1t0XTtcbiAgICAgICAgICAgIGxldCBpZCA9IHRpY2tlclsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBbIHF1b3RlLCBiYXNlIF0gPSBpZC5zcGxpdCAoJy0nKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzdW1tYXJ5ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsncmVzdWx0J11bMF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydUaW1lU3RhbXAnXSk7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHJhZGVbJ09yZGVyVHlwZSddID09ICdCVVknKSB7XG4gICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHJhZGVbJ09yZGVyVHlwZSddID09ICdTRUxMJykge1xuICAgICAgICAgICAgc2lkZSA9ICdzZWxsJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnSWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgaWQgPSB0cmFkZVsnSWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydQcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydRdWFudGl0eSddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldGhpc3RvcnkgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgaWYgKCdyZXN1bHQnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIH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uZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3V1aWQnOiBpZCxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UsICdtZXNzYWdlJyk7XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UgPT0gJ09SREVSX05PVF9PUEVOJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSBlcnJvcjogJyArIHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PSAnVVVJRF9JTlZBTElEJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnIGNhbmNlbE9yZGVyKCkgZXJyb3I6ICcgKyB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ09yZGVyVHlwZScgaW4gb3JkZXIpXG4gICAgICAgICAgICBzaWRlID0gKG9yZGVyWydPcmRlclR5cGUnXSA9PSAnTElNSVRfQlVZJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgaWYgKCdUeXBlJyBpbiBvcmRlcilcbiAgICAgICAgICAgIHNpZGUgPS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AoJ0NvbW1pc3Npb24nIGluIG9yZGVyKSB7XG4gICAgICAgICAgICBjb21taXNzaW9uID0gJ0NvbW1pc3Npb24nO1xuICAgICAgICB9IGVsc2UgaWYgKCdDb21taXNzaW9uUGFpZCcgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGNvbW1pc3Npb24gPSAnQ29tbWlzc2lvblBhaWQnO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjb21taXNzaW9uKSB7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0IChvcmRlcltjb21taXNzaW9uXSksXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdMaW1pdCcpO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1ByaWNlJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdRdWFudGl0eScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUXVhbnRpdHlSZW1haW5pbmcnLCAwLjApO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICBpZiAoIWNvc3QpIHtcbiAgICAgICAgICAgIGlmIChwcmljZSAmJiBhbW91bnQpXG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIGlmICghcHJpY2UpIHtcbiAgICAgICAgICAgIGlmIChjb3N0ICYmIGZpbGxlZClcbiAgICAgICAgICAgICAgICBwcmljZSA9IGNvc3QgLyBmaWxsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZVBlclVuaXQnKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnT3JkZXJVdWlkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBhdmVyYWdlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gdW5kZWZpbmVkO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmFjY291bnRHZXRPcmRlciAoeyAndXVpZCc6IGlkIH0pO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgIC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HJlc3BvbnNlLCAnbWVzc2FnZScpO1xuICAgICAgICBsZXQgc3RhdHVzID0gJ29rJztcbiAgICAgICAgaWYgKCFhZGRyZXNzIHx8IG1lc3NhZ2UgPT0gJ0FERFJFU1NfR0VORVJBVElORycpXG4gICAgICAgICAgICBzdGF0dXMgPSAncGVuZGluZyc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIHdpdGhkcmF3IChjdXJyZW5jeSwgYW1vdW50LCBhZGRyZXNzLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY3lJZCA9IHRoaXMuY3VycmVuY3lJZCAoY3VycmVuY3kpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmFjY291bnRHZXRXaXRoZHJhdyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5SWQsXG4gICAgICAgICAgICAncXVhbnRpdHknOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCd1dWlkJyBpbiByZXNwb25zZVsncmVzdWx0J10pXG4gICAgICAgICAgICAgICAgaWQgPSByZXNwb25zZVsncmVzdWx0J11bJ3V1aWQnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJztcbiAgICAgICAgaWYgKGFwaSAhPSAndjInKVxuICAgICAgICAgICAgdXJsICs9IHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJyArIG1ldGhvZC50b0xvd2VyQ2FzZSAoKSArIHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ3YyJykge1xuICAgICAgICAgICAgdXJsICs9IHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIHVybCArPSBhcGkgKyAnLyc7XG4gICAgICAgICAgICBpZiAoKChhcGkgPT0gJ2FjY291bnQnKSAmJiAocGF0aCAhPSAnd2l0aGRyYXcnKSkgfHwgKHBhdGggPT0gJ29wZW5vcmRlcnMnKSlcbiAgICAgICAgICAgICAgICB1cmwgKz0gbWV0aG9kLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgdXJsICs9IHBhdGggKyAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh1cmwpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnYXBpc2lnbic6IHNpZ25hdHVyZSB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID49IDQwMCkge1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT0gXCJ7XCIpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddID09ICdNSU5fVFJBREVfUkVRVUlSRU1FTlRfTk9UX01FVCcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydtZXNzYWdlJ10gPT0gJ0FQSUtFWV9JTlZBTElEJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ3N1Y2Nlc3MnXSlcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydtZXNzYWdlJ10gP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ICAgICAgICd2ZXJzaW9uJzogJzEnLFxuICAgICAgICAgICAgJ2NvbW1lbnQnOiAnQW4gZXhjaGFuZ2UgbWFya2V0IGJ5IEJpdG9uaWNOTCcsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODUwMTc1Mi02MGMyMWI4Mi02ZmViLTExZTctODE4Yi0wNTVlZTZkMGU3NTQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJsM3AuZXUnLFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JsM3AuZXUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRvbmljLm5sJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vQml0b25pY05ML2JsM3AtYXBpL3RyZWUvbWFzdGVyL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9ibDNwLmV1L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdG9uaWMubmwvZW4vYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9kZXB0aC9mdWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlci9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXIvcmVzdWx0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVycy9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS90cmFkZXMvZmV0Y2gnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFTk1LVC9tb25leS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvbmV3X2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L3dhbGxldC9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdCVENFVVInL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WUnXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoJ2JhbGFuY2UnIGluIGJhbGFuY2VbY3VycmVuY3ldKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2N1cnJlbmN5XVsnYmFsYW5jZSddWyd2YWx1ZSddKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoYWNjb3VudFsndG90YWwnXSkge1xuICAgICAgICAgICAgICAgIGlmIChhY2NvdW50WydmcmVlJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgcGFyc2VCaWRBc2sgKGJpZGFzaywgcHJpY2VLZXkgPSAwLCBhbW91bnRLZXkgPSAwKSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICBiaWRhc2tbJ3ByaWNlX2ludCddIC8gMTAwMDAwLjAsXG4gICAgICAgICAgICBiaWRhc2tbJ2Ftb3VudF9pbnQnXSAvIDEwMDAwMDAwMC4wLFxuICAgICAgICBdO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0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ZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbHVtZSddWycyNGgnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndHJhZGVfaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ2RhdGUnXSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodHJhZGVbJ2RhdGUnXSksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2VfaW50J10gLyAxMDAwMDAuMCxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50X2ludCddIC8gMTAwMDAwMDAwLjAsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFk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5kcyBiaXR0cmV4IHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdibGV1dHJhZGUnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQmxldXRyYWRlJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQlInLCAvLyBCcmF6aWxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDMwMzAwMC1iNjAyZGJlNi05NzZkLTExZTctOTU2ZC0zNmM1MDQ5YzAxZTcuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ21hcmtldCc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbS9oZWxwL0FQSScsXG4gICAgICAgICAg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lICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdidGNib3gnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQnRjQm94JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnSlAnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzEyNzU4MDMtNGRmNzU1YTgtYWFhMS0xMWU3LTlhYmItMTFlYzJmYWQ5ZjJkLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5idGNib3guY28uanAvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJ0Y2JveC5jby5qcC8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYnRjYm94LmNvLmpwL2hlbHAvYXNtJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbGx0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2FkZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV92aWV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9KUFknOiB7ICdpZCc6ICdCVEMvSlBZJywgJ3N5bWJvbCc6ICdCVEMvSlBZJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0pQWScgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xu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ICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBsZXQgbnVtU3ltYm9scyA9IHRoaXMuc3ltYm9scy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1TeW1ib2xzID4gMSlcbiAgICAgICAgICAgIHJlcXVlc3RbJ2NvaW4nXSA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAg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hcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBxdWVyeVsnc2lnbmF0dXJlJ10gPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChyZXF1ZXN0KSwgdGhpcy5lbmNvZGUgKHNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHkn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aXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdidGNjaGluYScsXG4gICAgICAgICAgICAnbmFtZSc6ICdCVENDaGluYScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0NOJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjM2OC00NjViMzI4Ni01ZWQ2LTExZTctOWExMS0wZjY0NjdlMWQ4MmIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncGx1cyc6ICdodHRwczovL3BsdXMtYXBpLmJ0Y2NoaW5hLmNvbS9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vZGF0YS5idGNjaGluYS5jb20vZGF0YScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJ0Y2NoaW5hLmNvbS9hcGlfdHJhZGVfdjEucGhwJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYnRjY2hpbmEuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmJ0Y2NoaW5hLmNvbS9hcGlkb2NzJ1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3BsdXMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeWRhdGEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0J1eUljZWJlcmdPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQnV5T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0J1eU9yZGVyMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQnV5U3RvcE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRBcmNoaXZlZE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRBcmNoaXZlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGVwb3NpdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEljZWJlcmdPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0SWNlYmVyZ09yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0RGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldERlcHRoMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0U3RvcE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRTdG9wT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFdpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZXF1ZXN0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2VsbEljZWJlcmdPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2VsbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWxsT3JkZXIyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWxsU3RvcE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQ05ZJzogeyAnaWQnOiAnYnRjY255JywgJ3N5bWJvbCc6ICdCVEMvQ05ZJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NOWScsICdhcGknOiAncHVibGljJywgJ3BsdXMnOiBmYWxzZSB9LFxuICAgICAgICAgICAgICAgICdMVEMvQ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CBtYXJrZXQgPSBtYXJrZXRzW2tleV07XG4gICAgICAgICAgICBsZXQgcGFydHMgPSBrZXkuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgaWQgPSBwYXJ0c1sxXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBxdW90ZSA9IHF1b3RlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEFjY291bnRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICA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cGFyc2VGbG9hdCAodGlja2VyWydidXknXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3Z3YXAnXSksXG4gICAgICAgICAgICAnb3Blbic6IHBhcnNlRmxvYXQgKHRpY2tlclsnb3BlbiddKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsncHJldl9jbG9zZSddKSxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXJQbHVzICh0aWNrZXIsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWydUaW1lc3RhbXAnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYX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ICAgICAgbGV0IG1ldGhvZCA9IG1hcmtldFsnYXBpJ10gKyAnR2V0VGlja2VyJztcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLmNyZWF0ZU1hcmtldFJlcXVlc3QgKG1hcmtldCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzWyd0aWNrZXInXTtcbiAgICAgICAgaWYgKG1hcmtldFsncGx1cyddKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXJQbHVzICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGVQbHVzICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydzaXplJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZXNQbHVzICh0cmFkZXMsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJhZGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5wYXJzZVRyYWRlUGx1cyAodHJhZGVzW2ldLCBtYXJrZXQpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1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hcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgcCA9IFtdO1xuICAgICAgICAgICAgaWYgKCdwYXJhbXMnIGluIHBhcmFtcylcbiAgICAgICAgICAgICAgICBwID0gcGFyYW1zWydwYXJhbXMnXTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogcCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBwID0gcC5qb2luICgnLCcpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSAoXG4gICAgICAgICAgICAgICAgJ3RvbmNlPScgKyBub25jZSArXG4gICAgICAgICAgICAgICAgJyZhY2Nlc3NrZXk9JyArIHRoaXMuYXBpS2V5ICtcbiAgICAgICAgICAgICAgICAnJnJlcXVlc3RtZXRob2Q9JyArIG1ldGhvZC50b0xvd2VyQ2FzZSAoKSArXG4gICAgICAgICAgICAgICAgJyZpZD0nICsgbm9uY2UgK1xuICAgICAgICAgICAgICAgICcmbWV0aG9kPScgKyBwYXRoICtcbiAgICAgICAgICAgICAgICAnJnBhcmFtcz0nICsgcFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAg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HtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdidGNleGNoYW5nZScsXG4gICAgICAgICAgICAnbmFtZSc6ICdCVENFeGNoYW5nZScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1BIJywgLy8gUGhpbGlwcGluZXNcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc5OTMwNTItNGM5MjkxMWEtNjRhYS0xMWU3LTk2ZDgtZWM2YWMzNDM1NzU3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5idGNleGNoYW5nZS5waC9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYnRjZXhjaGFuZ2UucGgnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL0JUQ1RyYWRlci9icm9rZXItYXBpLWRvY3MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvUEhQJzogeyAnaWQnOiAnQlRDL1BIUCcsICdzeW1ib2wnOiAnQlRDL1BIUCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdQSFAnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL0JUQ01hcmtldHMvQVBJJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vdGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tpZH0vdHJhZGluZ2ZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmR0cmFuc2Zlci93aXRoZHJhd0NyeXB0bycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHRyYW5zZmVyL3dpdGhkcmF3RUZUJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvdHJhZGUvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Jk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JzogMC4wMDIyLCAndGFrZXInOiAwLjAwMjIgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgbXVsdGlwbGllciA9IDEwMDAwMDAwMDtcbiAgICAgICAgICAgIGxldCBmcmVlID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddIC8gbXVsdGlwbGllcik7XG4gICAgICAgICAgICBsZXQgdXNlZCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ3BlbmRpbmdGdW5kcyddIC8gbXVsdGlwbGllcik7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGZyZWUsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiB1c2VkLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHRoaXMuc3VtIChmcmVlLCB1c2VkKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRJZE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBvcmRlcmJvb2tbJ3RpbWVzdGFtcCddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdGltZXN0YW1wKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndGltZXN0YW1wJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmVzdEJpZCddKSxcbiAgICAgICAgICAgICdh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0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldElkVHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgLy8gJ3NpbmNlJzogNTk4NjgzNDUyMzEsXG4gICAgICAgICAgICAnaWQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2UsIG1hcmtldCk7XG4gICAgfVxuXG4g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IHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB1cmkgKyBcIlxcblwiICsgbm9uY2UgKyBcIlxcblwiO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdhcGlrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAndGltZXN0YW1wJzogbm9uY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5iYXNlNjRUb0JpbmFyeSAodGhpcy5zZWNyZXQpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCBzZWNyZXQsICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzWydzaWduYXR1cmUnXSA9IHRoaXMuZGVjb2RlIChzaWduYXR1cmUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1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oKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYnRjdHJhZGV1YScsXG4gICAgICAgICAgICAnbmFtZSc6ICdCVEMgVHJhZGUgVUEnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVQScsIC8vIFVrcmFpbmUsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMzAwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc5NDE0ODMtNzlmYzczNTAtNjJkOS0xMWU3LTlmNjEtYWM0N2YyOGZjZDk2LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2J0Yy10cmFkZS5jb20udWEvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYnRjLXRyYWRlLmNvbS51YScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2RvY3MuZ29vZ2xlLmNvbS9kb2N1bWVudC9kLzFvY1lBMHlNeV9SWGQ1NjFzZkczcUVQWjgwa3lsbDM2SFV4dkNSZTVHYmhFL2VkaXQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZWFscy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3NlbGwve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9idXkve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2phcGFuX3N0YXQvaGlnaC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXNrL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaWQve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlfb3JkZXJzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9zdGF0dXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtb3ZlL29yZGVyL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VQUgnOiB7ICdpZCc6ICdidGNfdWFoJywgJ3N5bWJvbCc6ICdCVEMvVUFIJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1VBSCcsICdwcmVjaXNpb24nOiB7ICdwcmljZSc6IDEgfSwgJ2xpbWl0cyc6IHsgJ2Ftb3VudCc6IHsgJ21pbic6IDAuMDAwMDAwMDAwMSB9fX0sXG4gICAgICAgICAgICAgICAgJ0VUSC9VQUgnOiB7ICdpZCc6ICdldGhfdWFoJywgJ3N5bWJvbCc6ICdFVEgvVUFIJywgJ2Jhc2UnOiAnRVRIJywgJ3F1b3Rl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RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgICAgICAnSVRJL1VBSCc6IHsgJ2lkJzogJ2l0aV91YWgnLCAnc3ltYm9sJzogJ0lUSS9VQUgnLCAnYmFzZSc6ICdJVEknLCAncXVvdGUnOiAnVUFIJyB9LFxuICAgICAgICAgICAgICAgICdET0dFL0JUQyc6IHsgJ2lkJzogJ2RvZ2VfYnRjJywgJ3N5bWJvbCc6ICdET0dFL0JUQycsICdiYXNlJzogJ0RPR0UnLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICAgICAgICdEQVNIL0JUQyc6IHsgJ2lkJzogJ2Rhc2hfYnRjJywgJ3N5bWJvbCc6ICdEQVNIL0JUQycsICdiYXNlJzogJ0RBU0gnLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgc2lnbkluICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMucHJpdmF0ZVBvc3RBdXRoICgpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgaWYgKCdhY2NvdW50cycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBhY2NvdW50cyA9IHJlc3BvbnNlWydhY2NvdW50cyddO1xuICAgICAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBhY2NvdW50cy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gYWNjb3VudHNbYl07XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYWNjb3VudFsnY3VycmVuY3knXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHBhcnNlRmxvYXQgKGFjY291bnRbJ2JhbGFuY2UnXSk7XG4gICAgICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBiaWRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXNCdXlTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGFza3MgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlc1NlbGxTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHtcbiAgICAgICAgICAgICdiaWRzJzogW10sXG4gICAgICAgICAgICAnYXNrcyc6IFtdLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoYmlkcykge1xuICAgICAgICAgICAgaWYgKCdsaXN0JyBpbiBiaWRzKVxuICAgICAgICAgICAgICAgIG9yZGVyYm9va1snYmlkcyddID0gYmlkc1snbGlzdCddO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhc2tzKSB7XG4gICAgICAgICAgICBpZiAoJ2xpc3QnIGluIGFza3MpXG4gICAgICAgICAgICAgICAgb3JkZXJib29rWydhc2tzJ10gPSBhc2tzWydsaXN0J107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcycsICdhc2tzJywgJ3ByaWNlJywgJ2N1cnJlbmN5X3RyYWRlJyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRKYXBhblN0YXRIaWdoU3ltYm9sICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5mZXRjaE9yZGVyQm9vayAoc3ltYm9sKTtcbiAgICAgICAgbGV0IGJpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IG51bUJpZHMgPSBvcmRlcmJvb2tbJ2JpZHMnXS5sZW5ndGg7XG4gICAgICAgIGlmIChudW1CaWRzID4gMClcbiAgICAgICAgICAgIGJpZCA9IG9yZGVyYm9va1snYmlkcyddWzBdWzBdO1xuICAgICAgICBsZXQgYXNrID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgbnVtQXNrcyA9IG9yZGVyYm9va1snYXNrcyddLmxlbmd0aDtcbiAgICAgICAgaWYgKG51bUFza3MgPiAwKVxuICAgICAgICAgICAgYXNrID0gb3JkZXJib29rWydhc2tzJ11bMF1bMF07XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsndHJhZGVzJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IGJpZCxcbiAgICAgICAgICAgICdhc2snOiBhc2ssXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgICAgIGxldCB0aWNrZXJMZW5ndGggPSB0aWNrZXIubGVuZ3RoO1xuICAgICAgICBpZiAodGlja2VyTGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgbGV0IHN0YXJ0ID0gTWF0aC5tYXggKHRpY2tlckxlbmd0aCAtIDQ4LCAwKTtcbiAgICAgICAgICAgIGZvciAobGV0IHQgPSBzdGFydDsgdCA8IHRpY2tlci5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgICAgIGxldCBjYW5kbGUgPSB0aWNrZXJbdF07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiByZXN1bHRbJ29wZW4nXSA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0WydvcGVuJ10gPSBjYW5kbGVbMV07XG4gICAgICAgICAgICAgICAgaWYgKCh0eXBlb2YgcmVzdWx0WydoaWdoJ10gPT0gJ3VuZGVmaW5lZCcpIHx8IChyZXN1bHRbJ2hpZ2gnXSA8IGNhbmRsZVsyXSkpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnaGlnaCddID0gY2FuZGxlWzJdO1xuICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHJlc3VsdFsnbG93J10gPT0gJ3VuZGVmaW5lZCcpIHx8IChyZXN1bHRbJ2xvdyddID4gY2FuZGxlWzNdKSlcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0Wydsb3cnXSA9IGNhbmRsZVszXTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlc3VsdFsnYmFzZVZvbHVtZSddID09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2Jhc2VWb2x1bWUnXSA9IC1jYW5kbGVbNV07XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2Jhc2VWb2x1bWUnXSAtPSBjYW5kbGVbNV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbGFzdCA9IHRpY2tlckxlbmd0aCAtIDE7XG4gICAgICAgICAgICByZXN1bHRbJ2Nsb3NlJ10gPSB0aWNrZXJbbGFzdF1bNF07XG4gICAgICAgICAgICByZXN1bHRbJ2Jhc2VWb2x1bWUnXSA9IC0xICogcmVzdWx0WydiYXNlVm9sdW1lJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBjb252ZXJ0Q3lyaWxsaWNNb250aE5hbWVUb1N0cmluZyAoY3lyaWxsaWMpIHtcbiAgICAgICAgbGV0IG1vbnRocyA9IFtcbiAgICAgICAgICAgICfRj9C90LLQsNGA0Y8nLFxuICAgICAgICAgICAgJ9GE0LXQstGA0LDQu9GPJyxcbiAgICAgICAgICAgICfQvNCw0YDRgtCwJyxcbiAgICAgICAgICAgICfQsNC/0YDQtdC70Y8nLFxuICAgICAgICAgICAgJ9C80LDRjycsXG4gICAgICAgICAgICAn0LjRjtC90Y8nLFxuICAgICAgICAgICAgJ9C40Y7Qu9GPJyxcbiAgICAgICAgICAgICfQsNCy0LPRg9GB0YLQsCcsXG4gICAgICAgICAgICAn0YHQtdC90YLRj9Cx0YDRjycsXG4gICAgICAgICAgICAn0L7QutGC0Y/QsdGA0Y8nLFxuICAgICAgICAgICAgJ9C90L7Rj9Cx0YDRjycsXG4gICAgICAgICAgICAn0LTQtdC60LDQsdGA0Y8nLFxuICAgICAgICBdO1xuICAgICAgICBsZXQgbW9udGggPSB1bmRlZmluZWQ7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbW9udGhzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAoY3lyaWxsaWMgPT0gbW9udGhzW2ldKSB7XG4gICAgICAgICAgICAgICAgbW9udGggPSBpICsgMTtcbiAgICAgICAgICAgICAgICBtb250aCA9IG1vbnRoLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgICAgIGlmIChpIDwgOSlcbiAgICAgICAgICAgICAgICAgICAgbW9udGggPSAnMCcgKyBtb250aDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbW9udGg7XG4gICAgfVxuXG4gICAgcGFyc2VDeXJpbGxpY0RhdGV0aW1lIChjeXJpbGxpYykge1xuICAgICAgICBsZXQgcGFydHMgPSBjeXJpbGxpYy5zcGxpdCAoJyAnKTtcbiAgICAgICAgbGV0IGRheSA9IHBhcnRzWzBdO1xuICAgICAgICBsZXQgbW9udGggPSB0aGlzLmNvbnZlcnRDeXJpbGxpY01vbnRoTmFtZVRvU3RyaW5nIChwYXJ0c1sxXSk7XG4gICAgICAgIGlmICghbW9udGgpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcGFyc2VUcmFkZSgpIHVuZGVmaW5lZCBtb250aCBuYW1lOiAnICsgY3lyaWxsaWMpO1xuICAgICAgICBsZXQgeWVhciA9IHBhcnRzWzJdO1xuICAgICAgICBsZXQgaG1zID0gcGFydHNbNF07XG4gICAgICAgIGxldCBobXNMZW5ndGggPSBobXMubGVuZ3RoO1xuICAgICAgICBpZiAoaG1zTGVuZ3RoID09IDcpIHtcbiAgICAgICAgICAgIGhtcyA9ICcwJyArIGhtcztcbiAgICAgICAgfVxuICAgICAgICBsZXQgeW1kID0gWyB5ZWFyLCBtb250aCwgZGF5IF0uam9pbiAoJy0nKTtcbiAgICAgICAgbGV0IHltZGhtcyA9IHltZCArICdUJyArIGhtcztcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh5bWRobXMpO1xuICAgICAgICB0aW1lc3RhbXAgPSB0aW1lc3RhbXAgLSAxMDgwMDAwMDsgLy8gc2VydmVyIHJlcG9ydHMgbG9jYWwgR01UKzMgdGltZSwgYWRqdXN0IHRvIFVUQ1xuICAgICAgICByZXR1cm4gdGltZXN0YW1wO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2VDeXJpbGxpY0RhdGV0aW1lICh0cmFkZVsncHViX2RhdGUnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKHRyYWRlWydhbW50X3RyYWRlJ10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERlYWxzU3ltYm9sICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0cmFkZXMgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCByZXNwb25zZS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlW2ldWydpZCddICUgMikge1xuICAgICAgICAgICAgICAgIHRyYWRlcy5wdXNoIChyZXNwb25zZVtpXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHRyYWRlcywgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0JyArIHRoaXMuY2FwaXRhbGl6ZSAoc2lkZSkgKyAnSWQnO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnY291bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY3VycmVuY3kxJzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydiYXNlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RSZW1vdmVPcmRlcklkICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIHBhcnNlT3Jk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HMgPSBjbGFzcyBidGN0dXJrIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2J0Y3R1cmsnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQlRDVHVyaycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1RSJywgLy8gVHVya2V5XG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFkJzogJzFkJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTkyNzA5LTE4ZTE1NjQ2LTY0YTMtMTFlNy05ZmEyLWIwOTUwZWM3NzEyZi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYnRjdHVyay5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJ0Y3R1cmsuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9CVENUcmFkZXIvYnJva2VyLWFwaS1kb2NzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY2RhdGEnLCAvLyA/bGFzdD1DT1VOVFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLCAgIC8vID9sYXN0PUNPVU5UIChtYXggNTApXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyVHJhbnNhY3Rpb25zJywgLy8gP29mZnNldD0wJmxpbWl0PTI1JnNvcnQ9YXNjXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9UUlknOiB7ICdpZCc6ICdCVENUUlknLCAnc3ltYm9sJzogJ0JUQy9UUlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVFJZJywgJ21ha2VyJzogMC4wMDIgKiAxLjE4LCAndGFrZXInOiAwLjAwMzUgKiAxLjE4IH0sXG4gICAgICAgICAgICAgICAgJ0VUSC9UUlknOiB7ICdpZCc6ICdFVEhUUlknLCAnc3ltYm9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ljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGlja2Vycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdGlja2VyWydwYWlyJ107XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKHN5bWJvbCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbc3ltYm9sXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMuZmV0Y2hUaWNrZXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoc3ltYm9sIGluIHRpY2tlcnMpXG4gICAgICAgICAgICByZXN1bHQgPSB0aWNrZXJzW3N5bWJvbF07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgI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0byB0ZWxsIHJhdGUgbGltaXRzXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjM4NS05ZmRjYzk4Yy01ZWQ2LTExZTctOGYxNC02NmQ1ZTVjZDQ3ZTYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYnRjLXguaXMvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYnRjLXguaXMnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9idGMteC5pcy9jdXN0b20vYXBpLWRvY3VtZW50Lmh0bWwnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97aWR9L3tsaW1pdH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS97aWR9L3tsaW1pdH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZGVlbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnYnRjL3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdidGMvZXVyJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZXMpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlc1tjdXJyZW5jeV0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aElkTGltaXQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2xpbWl0JzogMTAwMCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2JpZHMnLCAnYXNrcycsICdwcmljZScsICdhbW91bnQnKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd0aW1lJ10gKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnaGlnaCddKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvdyddKSxcbiAgICAgICAgICAgICdiaWQnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3NlbGwnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydidXknXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsndHlwZSddID09ICdhc2snKSA/ICdzZWxsJyA6ICdidXknO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZ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uICAgICAgICAgICAgICAgICdNZXRob2QnOiBwYXRoLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdOb25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ25hdHVyZSc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS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JsaWMnOiAnaHR0cHM6Ly9kYXRhLmJ0ZXIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJ0ZXIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYnRlci5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9idGVyLmNvbS9hcGkyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2sve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeS97aWR9L3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzV2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEFsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldGluZm8gKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3BhaXJzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldCk7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzWzBdO1xuICAgICAgICAgICAgbGV0IGRldGFpbHMgPSBtYXJrZXRbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBxdW90ZSA9IHF1b3RlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBkZXRhaWxzWydkZWNpbWFsX3BsYWNlcyddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IGRldGFpbHNbJ2RlY2ltYWxfcGxhY2VzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogZGV0YWlsc1snbWluX2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmICgnYXZhaWxhYmxlJyBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VbJ2F2YWlsYWJsZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvY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NrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoMjRociddKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvdzI0aHInXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoZXN0QmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93ZXN0QXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsncGVyY2VudENoYW5nZSddKSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgIC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0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAncmF0ZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlck51bWJlciddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdvcmRlck51bWJlcic6IGlkIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIHdpdGhkcmF3IChjdXJyZW5jeSwgYW1vdW50LCBhZGRyZXNzLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0V2l0aGRyYXcgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB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AnaHR0cHM6Ly9ieC5pbi50aC9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9ieC5pbi50aCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2J4LmluLnRoL2luZm8vYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnJywgLy8gdGlja2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlyaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaWxsZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpbGxncm91cCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlsbHBheScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1pc3N1ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWJpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLXNlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teWlzc3VlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tbXliaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teW9wdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1leGVyY2lzZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWNhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsLWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQYWlyaW5nICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tleXNbcF1dO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyaW5nX2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnc2Vjb25kYXJ5X2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3ByaW1hcnlfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICAvLyB3aHkgd291bGQgdGhleSB1c2UgdGhyZWUgbGV0dGVycyBpbnN0ZWFkIG9mIGZvdXIgZm9yIGN1cnJlbmN5IGNvZGVzXG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnREFTJylcbiAgICAgICAgICAgIHJldHVybiAnREFTSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRE9HJylcbiAgICAgICAgICAgIHJldHVybiAnRE9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3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0X3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnY2hhbmdlJ10pLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWVfMjRob3VycyddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldCAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaWRdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgIC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SxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmF0ZSc6IHByaWNlLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHBhaXJpbmcgPSB1bmRlZmluZWQ7IC8vIFRPRE8gZml4bWVcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWwgKHtcbiAgICAgICAgICAgICdvcmRlcl9pZCc6IGlkLFxuICAgICAgICAgICAgJ3BhaXJpbmcnOiBwYWlyaW5nLFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nO1xuICAgICAgICBpZiAocGF0aClcbiAgICAgICAgICAgIHVybCArPSBwYXRoICsgJy8nO1xuICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmFwaUtleSArIG5vbmNlLnRvU3RyaW5nICgpICsgdGhpcy5zZWNyZXQ7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5oYXNoICh0aGlzLmVuY29kZSAoYXV0aCksICdzaGEyNTYnKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3NpZ25hdHVyZSc6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgICAgICAvLyB0d29mYTogdGhpcy50d29mYSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9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zogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY0MzMtMTY4ODFmOTAtNWVkOC0xMWU3LTkyZjgtM2Q5MmNjNzQ3YTZjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnOiAnaHR0cHM6Ly9jLWNleC5jb20vdCcsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9jLWNleC5jb20vdC9hcGlfcHViLmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2MtY2V4LmNvbS90L2FwaS5odG1sJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jLWNleC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9jLWNleC5jb20vP2lkPWFwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAndGlja2Vycyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb2lubmFtZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd2b2x1bWVfe2NvaW59JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZWRpc3RyaWJ1dGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0aGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0c3VtbWFyaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9wZW5vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcmhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnSU9UJylcbiAgICAgICAgICAgIHJldHVybiAnSW9UY29pbic7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQkxDJylcbiAgICAgICAgICAgIHJldHVybiAnQ3J5cHRvYnVsbGNvaW4nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hJRCcpXG4gICAgICAgICAgICByZXR1cm4gJ0ludGVybmF0aW9uYWxEaWFtb25kJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sncmVzdWx0J10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ0Jhc2VDdXJyZW5jeSddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnQXZhaWxhYmxlJ10sXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiBiYWxhbmNlWydQZW5kaW5nJ10sXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZVsnQmFsY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udXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnYXBpc2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHVybCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSB9O1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhJzogJ2dldCcgKyBwYXRoLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpICsgJy5qc29uJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoYXBpID09ICd0aWNrZXJzJylcbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnc3VjY2VzcyddKVxuICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgdGh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bWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDQyLThkZGMzM2IwLTVlZDgtMTFlNy04Yjk4LWY3ODZhZWYwZjNjOS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9jZXguaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY2V4LmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY2V4LmlvL2NleC1hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd1aWQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeV9saW1pdHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhc3RfcHJpY2VzL3tjdXJyZW5jaWVzfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGN2L2hkL3t5eXl5bW1kZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3tjdXJyZW5jaWVzfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3Rvcnkve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnZlcnQve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZV9zdGF0cy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZV9vcmRlcnNfc3RhdHVzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXJjaGl2ZWRfb3JkZXJzL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXJzL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9yZXBsYWNlX29yZGVyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nsb3NlX3Bvc2l0aW9uL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X215ZmVlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X29yZGVyX3R4LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX3Bvc2l0aW9uL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fcG9zaXRpb25zL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlX29yZGVyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEN1cnJlbmN5TGltaXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1snZGF0YSddWydwYWlycyddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1snZGF0YSddWydwYWlycyddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wxJ10gKyAnLycgKyBtYXJrZXRbJ3N5bWJvbDInXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydtaW5QcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IC0xICogTWF0aC5sb2cxMCAobWFya2V0WydtaW5Mb3RTaXplJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ21pbkxvdFNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ21heExvdFNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWluUHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogcGFyc2VGbG9hdCAobWFya2V0WydtYXhQcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5Mb3RTaXplUzInXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAg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WQ7XG4gICAgICAgIGlmICgndGltZXN0YW1wJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0aWNrZXJbJ3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgICAgICBpc284NjAxID0gdGhpcy5pc284NjAxICh0aW1lc3RhbXApO1xuICAgICAgICB9XG4gICAgICAgIGxldCB2b2x1bWUgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lJyk7XG4gICAgICAgIGxldCBoaWdoID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKTtcbiAgICAgICAgbGV0IGxvdyA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKTtcbiAgICAgICAgbGV0IGJpZCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWQnKTtcbiAgICAgICAgbGV0IGFzayA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdoaWdoJzogaGlnaCxcbiAgICAgICAgICAgICdsb3cnOiBsb3csXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2Fzayc6IGFzayxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOi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ZXBsYWNlICgnOicsICcvJyk7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N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SAnY2xvc2VkJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwZW5kaW5nJyk7XG4gICAgICAgIGlmICghcmVtYWluaW5nKVxuICAgICAgICAgICAgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncmVtYWlucycpO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0YTonICsgbWFya2V0WydxdW90ZSddKTtcbiAgICAgICAgICAgIGxldCBiYXNlRmVlID0gJ2ZhOicgKyBtYXJrZXRbJ2Jhc2UnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUZlZSA9ICdmYTonICsgbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgbGV0IGZlZVJhdGUgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0cmFkaW5nRmVlTWFrZXInKTtcbiAgICAgICAgICAgIGlmICghZmVlUmF0ZSlcbiAgICAgICAgICAgICAgICBmZWVSYXRlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndHJhZGluZ0ZlZVRha2VyJywgZmVlUmF0ZSk7XG4gICAgICAgICAgICBpZiAoZmVlUmF0ZSlcbiAgICAgICAgICAgICAgICBmZWVSYXRlIC89IDEwMC4wOyAvLyBjb252ZXJ0IHRvIG1hdGhlbWF0aWNhbGx5LWNvcnJlY3QgcGVyY2VudGFnZSBjb2VmZmljaWVudHM6IDEuMCA9IDEwMCVcbiAgICAgICAgICAgIGlmIChiYXNlRmVlIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgYmFzZUZlZSksXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocXVvdGVGZWUgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgcXVvdGVGZWUpLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFjb3N0KVxuICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcb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LTg0MGUtMzFiMzI5NjhlMWRhLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2NvaW5jaGVjay5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NvaW5jaGVjay5jb20vZG9jdW1lbnRzL2V4Y2hhbmdlL2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy9yYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmF0ZS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy9sZXZlcmFnZV9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYW5rX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcnMvb3BlbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy90cmFuc2FjdGlvbnNfcGFnaW5hdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbGV2ZXJhZ2UvcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kaW5nL2JvcnJvd3MvbWF0Y2hlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZF9tb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFua19hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9tb25leS97aWR9L2Zhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdHJhbnNmZXJzL3RvX2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFuc2ZlcnMvZnJvbV9sZXZlcmFnZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVuZGluZy9ib3Jyb3dzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kaW5nL2JvcnJvd3Mve2lkfS9yZXBheScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZF9tb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYW5rX2FjY291bnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ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AgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ2NyZWF0ZW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hdGVEZWxldGVFeGNoYW5nZU9yZGVyc0lkICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHVybCArIChib2R5IHx8ICcnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdBQ0NFU1MtS0VZJzogdGhpcy5hcGlLZXksX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2h0dHBzOi8vd3d3LmNvaW5mbG9vci5jby51ay9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcmRlcl9ib29rLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3VzZXJfdHJhbnNhY3Rpb25zLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcGVuX29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9idXkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2J1eV9tYXJrZXQvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGxfbWFya2V0LycsXG4gICAgICAgICAgICAgICA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ICAgICAgICBsZXQgdndhcCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2d2FwJyk7XG4gICAgICAgIGxldCBiYXNlVm9sdW1lID0gcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXSk7XG4gICAgICAgIGxldCBxdW90ZVZvbHVtZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiB2d2FwICE9ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBxdW90ZVZvbHVtZSA9IGJhc2VWb2x1bWUgKiB2d2FwO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldElkVGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAodH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ByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2NvaW5naScsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb2luZ2knLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnUEEnLCAnQkcnLCAnQ04nLCAnVVMnIF0sIC8vIFBhbmFtYSwgQnVsZ2FyaWEsIENoaW5hLCBVU1xuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODYxOTcwNy01YzkyMzJhOC03MjEyLTExZTctODZkNi05OGZlNWQxNWNjNmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmNvaW5naS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHA6Ly9kb2NzLmNvaW5naS5hcGlhcnkuaW8vJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdjdXJyZW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyLWJvb2sve3BhaXJ9L3thc2tDb3VudH0ve2JpZENvdW50fS97ZGVwdGh9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3BhaXJ9L3ttYXhDb3VudH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzI0aG91ci1yb2xsaW5nLWFnZ3JlZ2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd1c2VyJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGQtb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC1vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZS1jcnlwdG8td2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyB0b2RvIGFkZCBmZXRjaE1hcmtldHNcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdMVEMvQlRDJzogeyAnaWQnOiAnbHRjLWJ0YycsICdzeW1ib2wnOiAnTFRDL0JUQycsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdCVEMnIH0sXG4gICAgICAgICAgICAgICAgJ1BQQy9CVEMnOiB7ICdpZCc6ICdwcGMtYnRjJywgJ3N5bWJvbCc6ICdQUEMvQlRDJywgJ2Jhc2UnOiAnUFBDJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgICAgICAnRE9HRS9CVEMnOiB7ICdpZCc6ICdkb2dlLWJ0YycsICdzeW1ib2wnOiAnRE9HRS9CVEMnLCAnYmFzZSc6ICdET0dFJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgICAgICAnVlRDL0JUQyc6IHsgJ2lkJzogJ3Z0Yy1idGMnLCAnc3ltYm9sJzogJ1ZU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uICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyWydoaWdoJ10sXG4gICAgICAgICAgICAnbG93JzogdGlja2VyWydsb3cnXSxcbiAgICAgICAgICAgICdiaWQnOiB0aWNrZXJbJ2hpZ2hlc3RCaWQnXSxcbiAgICAgICAgICAgICdhc2snOiB0aWNrZXJbJ2xvd2VzdEFzayddLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRpY2tlclsnYmFzZVZvbHVtZSddLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdGlja2VyWydjb3VudGVyVm9sdW1lJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRpY2tlcjtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuY3VycmVudEdldDI0aG91clJvbGxpbmdBZ2dyZ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mRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyBhcGkgKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAnY3VycmVudCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAndG9rZW4nOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UudG9TdHJpbmcgKCkgKyAnJCcgKyB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIHJlcXVlc3RbJ3NpZ25hdHVyZSddID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gIC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20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2lubWFya2V0Y2FwLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NvaW5tYXJrZXRjYXAuY29tL2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tpZH0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnbG9iYWwvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjdXJyZW5jeUNvZGVzJzogW1xuICAgICAgICAgICAgICAgICdBVUQnLFxuICAgICAgICAgICAgICAgICdCUkwnLFxuICAgICAgICAgICAgICAgICdDQUQnLFxuICAgICAgICAgICAgICAgICdDSEYnLFxuICAgICAgICAgICAgICAgICdDTlknLFxuICAgICAgICAgICAgICAgICdFVVInLFxuICAgICAgICAgICAgICAgICdHQlAnLFxuICAgICAgICAgICAgICAgICdIS0QnLFxuICAgICAgICAgICAgICAgICdJRFInLFxuICAgICAgICAgICAgICAgICdJTlInLFxuICAgICAgICAgICAgICAgICdKUFknLFxuICAgICAgICAgICAgICAgICdLUlcnLFxuICAgICAgICAgICAgICAgICdNWE4nLFxuICAgICAgICAgICAgICAgICdSVUInLFxuICAgICAgICAgICAgICAgICdVU0QnLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKCdGZXRjaGluZyBvcmRlciBib29rcyBpcyBub3Qgc3VwcG9ydGVkIGJ5IHRoZSBBUEkgb2YgJyArIHRoaXMuaWQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHtcbiAgICAgICAgICAgICdsaW1pdCc6IDAsXG4gICAgICAgIH0pO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgY3VycmVuY2llcyA9IHRoaXMuY3VycmVuY3lDb2RlcztcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBxdW90ZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hHbG9iYWwgKGN1cnJlbmN5ID0gJ1VTRCcpIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7fTtcbiAgICAgICAgaWYgKGN1cnJlbmN5KVxuICAgICAgICAgICAgcmVxdWVzdFsnY29udmVydCddID0gY3VycmVuY3k7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnB1YmxpY0dldEdsb2JhbCAocmVxdWVzdCk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgaWYgKCdsYXN0X3VwZGF0ZWQnIGluIHRpY2tlcilcbiAgICAgICAgICAgIGlmICh0aWNrZXJbJ2xhc3RfdXBkYXRlZCddKVxuICAgICAgICAgICAgICAgIHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0aWNrZXJbJ2xhc3RfdXBkYXRlZCddKSAqIDEwMDA7XG4gICAgICAgIGxldCBjaGFuZ2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjaGFuZ2VLZXkgPSAncGVyY2VudF9jaGFuZ2VfMjRoJztcbiAgICAgICAgaWYgKGNoYW5nZUtleSBpbiB0aWNrZXIpXG4gICAgICAgICAgICBjaGFuZ2UgPSBwYXJzZUZsb2F0ICh0aWNrZXJbY2hhbmdlS2V5XSk7XG4gICAgICAgIGxldCBsYXN0ID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgdm9sdW1lID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBsZXQgcHJpY2UgPSAncHJpY2VfJyArIG1hcmtldFsncXVvdGVJZCddO1xuICAgICAgICAgICAgaWYgKHByaWNlIGluIHRpY2tlcilcbiAgICAgICAgICAgICAgICBpZiAodGlja2VyW3ByaWNlXSlcbiAgICAgICAgICAgICAgICAgICAgbGFzdCA9IHBhcnNlRmxvYXQgKHRpY2tlcltwcmljZV0pO1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB2b2x1bWVLZXkgPSAnMjRoX3ZvbHVtZV8nICsgbWFya2V0WydxdW90ZUlkJ107XG4gICAgICAgICAgICBpZiAodm9sdW1lS2V5IGluIHRpY2tlcilcbiAgICAgICAgICAgICAgICB2b2x1bWUgPSBwYXJzZUZsb2F0ICh0aWNrZXJbdm9sdW1lS2V5XSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ2NoYW5nZSc6IGNoYW5nZSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoY3VycmVuY3kgPSAnVVNEJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnbGltaXQnOiAxMDAwMCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKGN1cnJlbmN5KVxuICAgICAgICAgICAgcmVxdWVzdFsnY29udmVydCddID0gY3VycmVuY3k7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXJzID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgcmVzcG9uc2UubGVuZ3RoOyB0KyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVt0XTtcbiAgICAgICAgICAgIGxldCBpZCA9IHRpY2tlclsnaWQnXSArICcvJyArIGN1cnJlbmN5O1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aWNrZXJzW3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRpY2tlcnM7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY29udmVydCc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnYmFzZUlkJ10sXG4gICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VySWQgKHJlcXVlc3QpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbMF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2xpbWl0JzogMFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnc3ltYm9sJ107XG4gICAgICAgICAgICAvLyB0b2RvOiB3aWxsIG5lZWQgdG8gcmV0aGluayB0aGUgZmVlc1xuICAgICAgICAgICAgLy8gdG8gYWRkIHN1cHBvcnQgZm9yIG11bHRpcGxlIHdpdGhkcmF3YWwvZGVwb3NpdCBtZXRob2RzIGFuZFxuICAgICAgICAgICAgLy8gZGlmZmVyZW50aWF0ZWQgZmVlcyBmb3IgZWFjaCBwYXJ0aWN1bGFyIG1ldGhvZFxuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCwgLy8gZGVmYXVsdCBwcmVjaXNpb24sIHRvZG86IGZpeCBcIm1hZ2ljIGNvbnN0YW50c1wiXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChpZCk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1c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tNjA2Yy0xMWU3LTlhMzYtODRiYTJjZTQxMmQ4LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2NvaW5tYXRlLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5tYXRlLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cDovL2RvY3MuY29pbm1hdGUuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY29pbm1hdGUuaW8vZGV2ZWxvcGVycycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJCb29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5XaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luRGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5SW5zdGFudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5TGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcldpdGhJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVWb3VjaGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW1Wb3VjaGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsSW5zdGFudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbExpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbkhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VuY29uZmlybWVkQml0Y29pbkRlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDX0VVUicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogNCwgJ3ByaWNlJzogMiB9fSxcbiAgICAgICAgICAgICAgICAnQlRDL0NaSyc6IHsgJ2lkJzogJ0JUQ19DWksnLCAnc3ltYm9sJzogJ0JUQy9DWksnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ1pLJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDQsICdwcmljZSc6IDIgfX0sXG4gICAgICAgICAgICAgICAgJ0xUQy9CVEMnOiB7ICdpZCc6ICdMVENfQlRDJywgJ3N5bWJvbCc6ICdMVEMvQlRDJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0JUQycsICdwcmVjaXNpb24nOiB7ICdhbW91bnQnOiA0LCAncHJpY2UnOiA1IH19LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAzNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZXMpIHtcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBiYWxhbmNlc1tjdXJyZW5jeV1bJ2F2YWlsYWJsZSddO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGJhbGFuY2V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gcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd0aW1lc3RhbXAnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYW1vdW50J10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnY3VycmVuY3lQYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYW5zYWN0aW9uSWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ3RpbWVzdGFtcCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0cmFkZVsndGltZXN0YW1wJ10pLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYW5zYWN0aW9ucyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnbWludXRlc0ludG9IaXN0b3J5JzogMTAsXG4gICAgICAgIH0sIH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uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnZGF0YSddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdvcmRlcklkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHRoaXMudWlkICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdjbGllbnRJZCc6IHRoaXMudW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AgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuY29pbnNlY3VyZS5pbicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vY29pbnNlY3VyZS9wbHVnaW5zJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbi9zZWFyY2gvY29uZmlybWF0aW9uL3t0eGlkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYXNrL2xvdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYXNrL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYmlkL2hpZ2gnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2JpZC9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2xhc3RUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbWF4MjRIcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbWluMjRIcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2F1dGh5L2NhbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9hdXRoeS9zbXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25ldGtpL3NlYXJjaC97bmV0a2lOYW1lfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9iYW5rL290cC97bnVtYmVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9reWMvb3RwL3tudW1iZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvcGhvbmUvb3RwL3tudW1iZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2FkZHJlc3Mve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L2NvbmZpcm1lZC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vZGVwb3NpdC9jb25maXJtZWQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L3VuY29uZmlybWVkL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L3VuY29uZmlybWVkL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2JhbGFuY2UvYXZhaWxhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9iYWxhbmNlL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2JhbGFuY2UvdG90YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvdmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2JhbGFuY2UvYXZhaWxhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9iYWxhbmNlL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2JhbGFuY2UvdG90YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2RlcG9zaXQvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9kZXBvc2l0L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2RlcG9zaXQvdmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvY29pbi9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvZmlhdC9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2Uva3ljcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbC9jb2luL3BhaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvcmVmZXJyYWwvY29pbi9zdWNjZXNzZnVsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFsL2ZpYXQvcGFpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvdHJhZGUvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dpbi90b2tlbi97dG9rZW59JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2dpbi9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9naW4vcGFzc3dvcmQvZm9yZ290JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZmEvYXV0aHkvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9nYS9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2lnbnVwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL25ldGtpL3VwZGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL2ltYWdlL3VwZGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L25ld1ZlcmlmeWNvZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy9uZXdWZXJpZnljb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Bhc3N3b3JkL2NoYW5nZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wYXNzd29yZC9yZXNldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93aXRoZHJhdy9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvbmV3VmVyaWZ5Y29kZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2lnbnVwL3ZlcmlmeS97dG9rZW59JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2t5YycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2luc3RhbnQvYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2luc3RhbnQvc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvdmVyaWZ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9hY2NvdW50L25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvdmVyaWZ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9hdXRoeS9pbml0aWF0ZS9lbmFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2dhL2luaXRpYXRlL2VuYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9uZXRraS9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9waG9uZS9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vYWRkcmVzcy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L3NlbmRUb0V4Y2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L3ZlcmlmeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9nY20ve2NvZGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvdW52ZXJpZmllZC9jYW5jZWwve3dpdGhkcmF3SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L2NhbmNlbC97ZGVwb3NpdElEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svY2FuY2VsL3tvcmRlcklEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvY2FuY2VsL3tvcmRlcklEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvdW52ZXJpZmllZC9jYW5jZWwve3dpdGhkcmF3SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9hdXRoeS9kaXNhYmxlL3tjb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9tZmEvZ2EvZGlzYWJsZS97Y29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9waG9uZS9kZWxldGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9pbWFnZS9kZWxldGUve25ldGtpTmFtZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvdW52ZXJpZmllZC9jYW5jZWwve3dpdGhkcmF3SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSU5SJzogeyAnaWQnOiAnQlRDL0lOUicsICdzeW1ib2wnOiAnQlRDL0lOUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdJTlInIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuNCAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC40IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFVzZXJFeGNoYW5nZUJhbmtTdW1tYXJ5ICgpO1xuICAgICAgICBsZXQgYmFsYW5jZSA9IHJlc3BvbnNlWydtZXNzYWdlJ107XG4gICAgICAgIGxldCBjb2luID0ge1xuICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVDb2luQmFsYW5jZSddLFxuICAgICAgICAgICAgJ3VzZWQnOiBiYWxhbmNlWydwZW5kaW5nQ29pbkJhbGFuY2UnXSxcbiAgICAgICAgICAgIC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nbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MjA4NDI5LTNjYWNkZjlhLTY4OTYtMTFlNy04NTRlLTRjNzlhNzcyYTMwZi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cuY29pbnNwb3QuY29tLmF1L3B1YmFwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LmNvaW5zcG90LmNvbS5hdS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY29pbnNwb3QuY29tLmF1L2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvY29pbi9kZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9jb2luL3NlbmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlL2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUvc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9idXkvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9zZWxsL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0FVRCc6IHsgJ2lkJzogJ0JUQycsICdzeW1ib2wnOiAnQlRDL0FVRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdBVUQnIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9BVUQnOiB7ICdpZCc6ICdMVEMnLCAnc3ltYm9sJzogJ0xUQy9BVUQnLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnQVVEJyB9LFxuICAgICAgICAgICAgICAgICdET0dFL0FVRCc6IHsgJ2lkJzogJ0RPR0UnLCAnc3ltYm9sJzogJ0RPR0UvQVVEJywgJ2Jhc2UnOiAnRE9HRScsICdxdW90ZSc6ICdBVUQnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RNeUJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGlmICgnYmFsYW5jZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlJ107XG4gICAgICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlc1tjdXJyZW5jeV0sXG4gICAgICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlc1tjdXJyZW5jeV0sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAodXBwZXJjYXNlID09ICdEUksnKVxuICAgICAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW50eXBlJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAg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ICdmZXRjaE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yOTQ4NDM5NC03YjRlYTZlMi04NGM2LTExZTctODNlNS0xZmNjZjRiMmRjODEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L0ZvcnVtL0NhdGVnb3J5LzQ1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9UaHJlYWQvMjU1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9UaHJlYWQvMjU2JyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZVBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMve2hvdXJzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0cy97aWR9L3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXQve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldEhpc3Rvcnkve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRPcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJzL3tpZH0ve2NvdW50fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJHcm91cHMve2lkc30ve2NvdW50fScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0VGlwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTdWJtaXRUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0VHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFdpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0NDJylcbiAgICAgICAgICAgIHJldHVybiAnQ0NYJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdGQ04nKVxuICAgICAgICAgICAgcmV0dXJuICdGYWNpbGVjb2luJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdORVQnKVxuICAgICAgICAgICAgcmV0dXJuICdOZXRDb2luJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCVEcnKVxuICAgICAgICAgICAgcmV0dXJuICdCaXRnZW0nO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgY3VycmVuY3lJZCAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdDQ1gnKVxuICAgICAgICAgICAgcmV0dXJuICdDQyc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRmFjaWxlY29pbicpXG4gICAgICAgICAgICByZXR1cm4gJ0ZDTic7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnTmV0Q29pbicpXG4gICAgICAgICAgICByZXR1cm4gJ05FVCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQml0Z2VtJylcbiAgICAgICAgICAgIHJldHVybiAnQlRHJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVQYWlycyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydEYXRhJ107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ0lkJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydMYWJlbCddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5pbXVtVHJhZGUnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydNYXhpbXVtVHJhZGUnXVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5pbXVtUHJpY2UnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydNYXhpbXVtUHJpY2UnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnU3RhdHVzJ10gPT0gJ09LJztcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFya2V0WydUcmFkZUZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IG1hcmtldFsnVHJhZGVGZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogYW1vdW50TGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1b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ICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmICgnRmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRyYWRlWydGZWUnXSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ1R5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydBbW91bnQnXSxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvb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XJyZW5jeVsnTGlzdGluZ1N0YXR1cyddID09ICdBY3RpdmUnKTtcbiAgICAgICAgICAgIGxldCBzdGF0dXMgPSBjdXJyZW5jeVsnU3RhdHVzJ10udG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnTmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ1dpdGhkcmF3RmVlJ10sXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydNaW5CYXNlVHJhZGUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnTWluV2l0aGRyYXcnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBjdXJyZW5jeVsnTWF4V2l0aGRyYXcnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydEYXRhJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYWxhbmNlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY29kZSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ0F2YWlsYWJsZSddLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ1RvdGFsJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIHByaWNlID0gcGFyc2VGbG9hdCAocHJpY2UpO1xuICAgICAgICBhbW91bnQgPSBwYXJzZUZsb2F0IChhbW91bnQpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdUcmFkZVBhaXJJZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdUeXBlJzogdGhpcy5jYXBpdGFsaXplIChzaWRlKSxcbiAgICAgICAgICAgICdSYXRlJzogdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKSxcbiAgICAgICAgICAgICdBbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RTdWJtaXRUcmFkZSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBpZiAoIXJlc3BvbnNlKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGNyZWF0ZU9yZGVyIHJldHVybmVkIHVua25vd24gZXJyb3I6ICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgIGxldCBpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZpbGxlZCA9IDAuMDtcbiAgICAgICAgaWYgKCdEYXRhJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCdPcmRlcklkJyBpbiByZXNwb25zZVsnRGF0YSddKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydEYXRhJ11bJ09yZGVySWQnXSkge1xuICAgICAgICAgICAgICAgICAgICBpZCA9IHJlc3BvbnNlWydEYXRhJ11bJ09yZGVySWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoJ0ZpbGxlZE9yZGVycycgaW4gcmVzcG9uc2VbJ0RhdGEnXSkge1xuICAgICAgICAgICAgICAgIGxldCBmaWxsZWRPcmRlcnMgPSByZXNwb25zZVsnRGF0YSddWydGaWxsZWRPcmRlcnMnXTtcbiAgICAgICAgICAgICAgICBsZXQgZmlsbGVkT3JkZXJzTGVuZ3RoID0gZmlsbGVkT3JkZXJzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZiAoZmlsbGVkT3JkZXJzTGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwcmljZSAqIGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAvLyAndHJhZGVzJzogdGhpcy5wYXJzZVRyYWRlcyAob3JkZXJbJ3RyYWRlcyddLCBtYXJrZXQpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoaWQpXG4gICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIHRoaXMuZXh0ZW5kICh7ICdpbmZvJzogcmVzcG9uc2UgfSwgb3JkZXIpO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxUcmFkZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnVHlwZSc6ICdUcmFkZScsXG4gICAgICAgICAgICAgICAgJ09yZGVySWQnOiBpZCxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXVsnc3RhdHVzJ10gPSAnY2FuY2VsZWQnO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UsICdFcnJvcicpO1xuICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdkb2VzIG5vdCBleGlzdCcpID49IDApXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSBlcnJvcjogJyArIHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH0gZWxzZSBpZiAoJ01hcmtldCcgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGxldCBpZCA9IG9yZGVyWydNYXJrZXQnXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvcmRlclsnVGltZVN0YW1wJ10pO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnQW1vdW50Jyk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdSZW1haW5pbmcnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydPcmRlcklkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRoaXMub21pdCAob3JkZXIsICdzdGF0dXMnKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogb3JkZXJbJ3N0YXR1cyddLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ1R5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1JhdGUnKSxcbiAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnVG90YWwnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbG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kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBvcmRlclsnYW1vdW50J10gKiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICBpZiAob3JkZXJbJ3N5bWJvbCddID09IHN5bWJvbClcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAob3JkZXIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgaWQgPSBpZC50b1N0cmluZyAoKTtcbiAgICAgICAgbGV0IG9yZGVycyA9IGF3YWl0IHRoaXMuZmV0Y2hPcmRlcnMgKHN5bWJvbCwgcGFyYW1zKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvcmRlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmIChvcmRlcnNbaV1bJ2lkJ10gPT0gaWQpXG4gICAgICAgICAgICAgICAgcmV0dXJuIG9yZGVyc1tpXTtcbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RDYWNoZWQgKHRoaXMuaWQgKyAnIG9yZGVyICcgKyBpZCArICcgbm90IGZvdW5kIGluIGNhY2hlZCAub3JkZXJzLCBmZXRjaE9yZGVyIHJlcXVpcmVzIC5vcmRlcnM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AgJ0Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdBZGRyZXNzJzogYWRkcmVzcywgLy8gQWRkcmVzcyBtdXN0IGV4aXN0IGluIHlvdSBBZGRyZXNzQm9vayBpbiBzZWN1cml0eSBzZXR0aW5nc1xuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnRGF0YSddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IGhhc2ggPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChib2R5KSwgJ21kNScsICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGxldCBzZWNyZXQgPSB0aGlzLmJhc2U2NFRvQmluYXJ5ICh0aGlzLnNlY3JldCk7XG4gICAgICAgICAgICBsZXQgdXJpID0gdGhpcy5lbmNvZGVVUklDb21wb25lbnQgKHVybCk7XG4gICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gdXJpLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSB0aGlzLmFwaUtleSArIG1ldGhvZCArIGxvd2VyY2FzZSArIG5vbmNlICsgdGhpcy5iaW5hcnlUb1N0cmluZyAoaGFzaCk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocGF5bG9hZCksIHNlY3JldCwgJ3NoYTI1NicsICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gJ2FteCAnICsgdGhpcy5hcGlLZXkgKyAnOicgKyB0aGlzLmJpbmFyeVRvU3RyaW5nIChzaWduYXR1cmUpICsgJzonICsgbm9uY2U7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiBhdXRoLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXR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AgJ3d3dyc6ICdodHRwczovL2RzeC51aycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLmRzeC51aycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2RzeC51ay9hcGlfZG9jcy9wdWJsaWMnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kc3gudWsvYXBpX2RvY3MvcHJpdmF0ZScsXG4gICAgICAgICAgICAgICAgICAgICcnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAvLyBtYXJrZXQgZGF0YSAocHVibGljKVxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFyc0Zyb21Nb21lbnQve2lkfS97cGVyaW9kfS97c3RhcnR9JywgLy8gZW1wdHkgcmVwbHkgOlxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0QmFycy97aWR9L3twZXJpb2R9L3thbW91bnR9JywgLy8gcGVyaW9kIGlzIChtLCBoIG9yIGQpXG4gICAgICAgICAgICAgICAgICAgICAgICAncGVyaW9kQmFycy97aWR9L3twZXJpb2R9L3tzdGFydH0ve2VuZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgLy8gdHJhZGluZyAocHJpdmF0ZSlcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhbnNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVySGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWN0aXZlT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgLy8gZGVwb3NpdCAvIHdpdGhkcmF3IChwcml2YXRlKVxuICAgICAgICAgICAgICAgICdkd2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q3J5cHRvRGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b1dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWF0V2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYW5zYWN0aW9uU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBnZXRCYXNlUXVvdGVGcm9tTWFya2V0SWQgKGlkKSB7XG4gICAgICAgIGxldCB1cHBlcmNhc2UgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgbGV0IGJhc2UgPSB1cHBlcmNhc2Uuc2xpY2U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RvdGFsJzogYmFsYW5jZXNbJ3RvdGFsJ11bY3VycmVuY3ldLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd1cGRhdGVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2Un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ExZTctOTIyNS00MGQ2N2I0ODFiOGQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmV4bW8uY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZXhtby5tZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZXhtby5tZS9lbi9hcGlfZG9jJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9leG1vLWRldi9leG1vX2FwaV9saWIvdHJlZS9tYXN0ZXIvbm9kZWpzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcl9zZXR0aW5ncycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX2NhbmNlbGxlZF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVxdWlyZWRfYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NyeXB0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19nZXRfdHhpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjb2RlX2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjb2RlX2xvYWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldF9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFBhaXJTZXR0aW5ncyAoKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkLnJlcGxhY2UgKCdfJywgJy8nKTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5fcXVhbnRpdHknXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ21heF9xdWFudGl0eSddLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5fcHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ21heF9wcmljZSddLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ21pbl9hbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ21heF9hbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFVzZXJJbmZvICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIHJlc3BvbnNlWydiYWxhbmNlcyddKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKHJlc3BvbnNlWydiYWxhbmNlcyddW2N1cnJlbmN5XSk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gcmVzcG9uc2VbJ3Jlc2VydmVkJ10pXG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAocmVzcG9uc2VbJ3Jlc2VydmVkJ11bY3VycmVuY3ldKTtcbiAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0aGlzLnN1bSAoYWNjb3VudFsnZn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aXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVtpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyIChyZXNwb25zZVttYXJrZXRbJ2lkJ11dLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRyYWRlWydkYXRlJ10gKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IH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WFya2V0cyAoKTtcbiAgICAgICAgbGV0IHByZWZpeCA9ICcnO1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHByZWZpeCA9ICdtYXJrZXRfJztcbiAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHByaWNlID0gMDtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3F1YW50aXR5JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAndHlwZSc6IHByZWZpeCArIHNpZGUsXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlckNyZWF0ZSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlckNhbmNlbCAoeyAnb3JkZXJfaWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBhc3luYyB3aXRoZHJhdyAoY3VycmVuY3ksIGFtb3VudCwgYWRkcmVzcywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgb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20uYnIvYXBpLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVzQnlEYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFByb2R1Y3RQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UHJvZHVjdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0NyZWF0ZUFjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFVzZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZXRVc2VySW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTW9kaWZ5T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxBbGxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljUG9zdEdldFByb2R1Y3RQYWlycyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsncHJvZHVjdFBhaXJzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3Byb2R1Y3QxTGFiZWwnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncHJvZHVjdDJMYWJlbCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEFjY291bnRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnY3VycmVuY2llcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWyduYW1lJ107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2JhbGFuY2UnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ2hvbGQnXSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgf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UZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUyNGhyJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUyNGhyUHJvZHVjdDInXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndW5peHRpbWUnXSAqIDEwMDA7XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWydpbmNvbWluZ09yZGVyU2lkZSddID09IDApID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICA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xsaW5nIGFuIG9yZGVyJyk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZS50b1N0cmluZyAoKSArIHRoaXMudWlkICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ2FwaU5vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FwaVNpZyc6IHNpZ25hdHVyZS50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBl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S0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgZm94Yml0IGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2ZveGJpdCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdGb3hCaXQnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdCUicsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTkxNDEzLTExYjQwZDQyLTY0N2YtMTFlNy05MWVlLTc4Y2VkODc0ZGQwOS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuYmxpbmt0cmFkZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYmxpbmt0cmFkZS5jb20vdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZm94Yml0LmV4Y2hhbmdlJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYmxpbmt0cmFkZS5jb20vZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1lbnQnOiAnQmxpbmt0cmFkZSBBUEknLFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeX0vdGlja2VyJywgICAgLy8gP2NyeXB0b19jdXJyZW5jeT1CVENcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3l9L29yZGVyYm9vaycsIC8vID9jcnlwdG9fY3VycmVuY3k9QlRDXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5fS90cmFkZXMnLCAgICAvLyA/Y3J5cHRvX2N1cnJlbmN5PUJUQyZzaW5jZT08VElNRVNUQU1QPiZsaW1pdD08TlVNQkVSPlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0QnLCAgIC8vIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnRicsICAgLy8gY2FuY2VsIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTInLCAgLy8gYmFsYW5jZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ1U0JywgIC8vIG15IG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1U2JywgIC8vIHdpdGhkcmF3XG4gICAgICAgICAgICAgICAgICAgICAgICAnVTE4JywgLy8gZGVwb3NpdFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1UyNCcsIC8vIGNvbmZpcm0gd2l0aGRyYXdhbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1UyNicsIC8vIGxpc3Qgd2l0aGRyYXdhbHNcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMzAnLCAvLyBsaXN0IGRlcG9zaXRzXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTM0JywgLy8gbGVkZ2VyXG4gICAgICAgICAgICAgICAgICAgIC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cltxdW90ZVZvbHVtZV0pLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lUcmFkZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICAnY3J5cHRvX2N1cnJlbmN5JzogbWFya2V0WydiYXNlJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAg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lJzogcGF0aCB9LCBxdWVyeSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChyZXF1ZXN0KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FQSUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdOb25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdTaWduYXR1cmUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChub25jZSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnU3RhdHVzJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnU3RhdHVzJ10gIT0gMjAwKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgfVxufVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vICAtLS0tLS0tLS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J2h0dHA6Ly9kb2NzLmZ5Yi5hcGlhcnkuaW8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcmRldGFpbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YWNjaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGVuZGluZ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXJoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxwZW5kaW5nb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvU0VLJzogeyAnaWQnOiAnU0VLJywgJ3N5bWJvbCc6ICdCVEMvU0VLJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1NFSycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuIC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lZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnZ2F0ZWNvaW4nLFxuICAgICAgICAgICAgJ25hbWUnOiAnR2F0ZWNvaW4nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0hLJywgLy8gSG9uZyBLb25nXG4gICAgICAgICAgICAnY29tbWVudCc6ICdhIHJlZ3VsYXRlZC9saWNlbnNlZCBleGNoYW5nZScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWgnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzI0aCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODY0NjgxNy01MDg0NTdmMi03MjZjLTExZTctOWVlYi0zNTI4ZDI0MTNhNTguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmdhdGVjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2dhdGVjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2F0ZWNvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vR2F0ZWNvaW4vUkVTVGZ1bC1BUEktSW1wbGVtZW50YXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuZ2F0ZWNvaW4uY29tL3N3YWdnZXItdWkvaW5kZXguaHRtbCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnUHVibGljL0V4Y2hhbmdlUmF0ZScsIC8vIEdldCB0aGUgZXhjaGFuZ2UgcmF0ZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvTGl2ZVRpY2tlcicsIC8vIEdldCBsaXZlIHRpY2tlciBmb3IgYWxsIGN1cnJlbmN5XG4gICAgICAgICAgICAgICAgICAgICAgICAnUHVibGljL0xpdmVUaWNrZXIve0N1cnJlbmN5UGFpcn0nLCAvLyBHZXQgbGl2ZSB0aWNrZXIgYnkgY3VycmVuY3lcbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvTGl2ZVRpY2tlcnMnLCAvLyBHZXQgbGl2ZSB0aWNrZXIgZm9yIGFsbCBjdXJyZW5jeVxuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9NYXJrZXREZXB0aC97Q3VycmVuY3lQYWlyfScsIC8vIEdldHMgcHJpY2VzIGFuZCBtYXJrZXQgZGVwdGggZm9yIHRoZSBjdXJyZW5jeSBwYWlyLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9OZXR3b3JrU3RhdGlzdGljcy97RGlnaUN1cnJlbmN5fScsIC8vIEdldCB0aGUgbmV0d29yayBzdGF0dXMgb2YgYSBzcGVjaWZpYyBkaWdpdGFsIGN1cnJlbmN5XG4gICAgICAgICAgICAgIC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ICAgICAgICAnUmVmZXJlbmNlL0lkZW50eWRvY3VtZW50VHlwZXMnLCAvLyBHZXQgdGhlIGRpZmZlcmVudCB0eXBlcyBvZiBpZGVudGl0eSBkb2N1bWVudHMgcG9zc2libGUuXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlbmNlL0luY29tZVJhbmdlTGlzdCcsIC8vIEdldCB0aGUgaW5jb21lIHJhbmdlIGxpc3QuXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlbmNlL0luY29tZVNvdXJjZUxpc3QnLCAvLyBHZXQgdGhlIGluY29tZSBzb3VyY2UgbGlzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVuY2UvVmVyaWZpY2F0aW9uTGV2ZWxMaXN0JywgLy8gR2V0IHRoZSB2ZXJpZiBsZXZlbCBsaXN0LlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N0cmVhbS9QdWJsaWNDaGFubmVsJywgLy8gR2V0IHRoZSBwdWJsaWMgcHVibnViIGNoYW5uZWwgbGlzdFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeHBvcnQvVHJhbnNhY3Rpb25zJywgLy8gUmVxdWVzdCBhIGV4cG9ydCBvZiBhbGwgdHJhZGVzIGZyb20gYmFzZWQgb24gY3VycmVuY3lwYWlyLCBzdGFydCBkYXRlIGFuZCBlbmQgZGF0ZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BpbmcnLCAvLyBQb3N0IGEgc3RyaW5nLCB0aGVuIGdldCBpdCBiYWNrLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9VbnN1YnNjcmliZS97RW1haWxDb2RlfScsIC8vIExldHMgdGhlIHVzZXIgdW5zdWJzY3JpYmUgZnJvbSBlbWFpbHNcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWdpc3RlclVzZXInLCAvLyBJbml0aWFsIHRyYWRlciByZWdpc3RyYXRpb24uXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0NvcnBvcmF0ZURhdGEnLCAvLyBHZXQgY29ycG9yYXRlIGFjY291bnQgZGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRBZGRyZXNzJywgLy8gQ2hlY2sgaWYgcmVzaWRlbmNlIHByb29mIHVwbG9hZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudENvcnBvcmF0aW9uJywgLy8gQ2hlY2sgaWYgcmVnaXN0ZXJlZCBkb2N1bWVudCB1cGxvYWRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJRCcsIC8vIENoZWNrIGlmIElEIGRvY3VtZW50IGNvcHkgdXBsb2FkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SW5mb3JtYXRpb24nLCAvLyBHZXQgU3RlcDMgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwnLCAvLyBHZXQgdXNlciBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRmVlUmF0ZScsIC8vIEdldCBmZWUgcmF0ZSBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvTGV2ZWwnLCAvLyBHZXQgdmVyaWYgbGV2ZWwgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1BlcnNvbmFsSW5mb3JtYXRpb24nLCAvLyBHZXQgU3RlcDEgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUGhvbmUnLCAvLyBHZXQgdXNlciBwaG9uZSBudW1iZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Byb2ZpbGUnLCAvLyBHZXQgdHJhZGVyIHByb2ZpbGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1F1ZXN0aW9ubmFpcmUnLCAvLyBGaWxsIHRoZSBxdWVzdGlvbm5haXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbCcsIC8vIEdldCByZWZlcnJhbCBpbmZvcm1hdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWxDb2RlJywgLy8gR2V0IHRoZSByZWZlcnJhbCBjb2RlIG9mIHRoZSBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWxOYW1lcycsIC8vIEdldCBuYW1lcyBvZiByZWZlcnJlZCB0cmFkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbFJld2FyZCcsIC8vIEdldCByZWZlcnJhbCByZXdhcmQgaW5mb3JtYXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmVkQ29kZScsIC8vIEdldCByZWZlcnJhbCBjb2RlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZXNpZGVudEluZm9ybWF0aW9uJywgLy8gR2V0IFN0ZXAyIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1NlY3VyaXR5U2V0dGluZ3MnLCAvLyBHZXQgdmVyaWYgZGV0YWlscyBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvVXNlcicsIC8vIEdldCBhbGwgdXNlciBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVBJS2V5L0FQ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aGUgbG9nZ2VkIGluIHRyYWRlci4gTWF4IDEwMDAgcmVjb3JkLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL1N0b3BPcmRlcnNIaXN0b3J5JywgLy8gR2V0cyBhbGwgc3RvcCBvcmRlcnMgZm9yIHRoZSBsb2dnZWQgaW4gdHJhZGVyLiBNYXggMTAwMCByZWNvcmQuXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvVHJhZGVzJywgLy8gR2V0cyBhbGwgdHJhbnNhY3Rpb25zIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvVXNlclRyYWRlcycsIC8vIEdldHMgYWxsIHRyYW5zYWN0aW9ucyBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50QWRkcmVzcycsIC8vIFVwbG9hZCBhZGRyZXNzIHByb29mIGRvY3VtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudENvcnBvcmF0aW9uJywgLy8gVXBsb2FkIHJlZ2lzdGVyZWQgZG9jdW1lbnQgZG9jdW1lbnRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SUQnLCAvLyBVcGxvYWQgSUQgZG9jdW1lbnQgY29weVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwvUmVxdWVzdFZlcmlmeScsIC8vIFJlcXVlc3QgZm9yIHZlcmlmaWNhdGlvbiBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwvVmVyaWZ5JywgLy8gVmVyaWZpY2F0aW9uIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Hb29nbGVBdXRoJywgLy8gRW5hYmxlIGdvb2dsZSBhdXRoXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9MZXZlbCcsIC8vIFJlcXVlc3QgdmVyaWYgbGV2ZWwgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1F1ZXN0aW9ubmFpcmUnLCAvLyBGaWxsIHRoZSBxdWVzdGlvbm5haXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbCcsIC8vIFBvc3QgYSByZWZlcnJhbCBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FQSUtleS9BUElLZXknLCAvLyBDcmVhdGUgYSBuZXcgQVBJIGtleSBmb3IgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0NoYW5nZVBhc3N3b3JkJywgLy8gQ2hhbmdlIHBhc3N3b3JkLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvRm9yZ290UGFzc3dvcmQnLCAvLyBSZXF1ZXN0IHJlc2V0IHBhc3N3b3JkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Gb3Jnb3RVc2VySUQnLCAvLyBSZXF1ZXN0IHVzZXIgaWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0xvZ2luJywgLy8gVHJhZGVyIHNlc3Npb24gbG9nIGluLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvTG9nb3V0JywgLy8gTG9nb3V0IGZyb20gdGhlIGN1cnJlbnQgc2Vzc2lvbi5cbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0xvZ291dE90aGVyU2Vzc2lvbnMnLCAvLyBMb2dvdXQgb3RoZXIgc2Vzc2lvbnMuXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9SZXNldFBhc3N3b3JkJywgLy8gUmVzZXQgcGFzc3dvcmRcbiAgICAgICAgICAgICAgICAgICAgICAg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AgICAgICAgICAgICAgICAnRWxlY3Ryb25pY1dhbGxldC9XaXRoZHJhd2Fscy97RGlnaUN1cnJlbmN5fScsIC8vIFJlcXVlc3QgYSB0cmFuc2ZlciBmcm9tIHRoZSB0cmFkZXJzIGFjY291bnQgdG8gYW4gZXh0ZXJuYWwgYWRkcmVzcy4gVGhpcyBpcyBvbmx5IGF2YWlsYWJsZSBmb3IgY3J5cHRvIGN1cnJlbmNpZXMuXG4gICAgICAgICAgICAgICAgICAgICAgICAnTm90aWZpY2F0aW9uL01lc3NhZ2VzJywgLy8gTWFyayBhbGwgYXMgcmVhZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05vdGlmaWNhdGlvbi9NZXNzYWdlcy97SUR9JywgLy8gTWFyayBhcyByZWFkXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvT3JkZXJzJywgLy8gUGxhY2UgYW4gb3JkZXIgYXQgdGhlIGV4Y2hhbmdlLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL1N0b3BPcmRlcnMnLCAvLyBQbGFjZSBhIHN0b3Agb3JkZXIgYXQgdGhlIGV4Y2hhbmdlLlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvQ29ycG9yYXRlRGF0YScsIC8vIFVwZGF0ZSB1c2VyIGNvbXBhbnkgZGF0YSBmb3IgY29ycG9yYXRlIGFjY291bnRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SUQnLCAvLyBVcGRhdGUgSUQgZG9jdW1lbnQgbWV0YSBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEluZm9ybWF0aW9uJywgLy8gVXBkYXRlIFN0ZXAzIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsJywgLy8gVXBkYXRlIHVzZXI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mN5IGFkZHJlc3NlcyByZWxhdGVkIHRvIHRoZSBsb2dnZWQgaW4gdXNlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZS9PcmRlcnMnLCAvLyBDYW5jZWxzIGFsbCBleGlzdGluZyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL09yZGVycy97T3JkZXJJRH0nLCAvLyBDYW5jZWxzIGFuIGV4aXN0aW5nIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvU3RvcE9yZGVycycsIC8vIENhbmNlbHMgYWxsIGV4aXN0aW5nIHN0b3Agb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvU3RvcE9yZGVycy97SUR9JywgLy8gQ2FuY2VscyBhbiBleGlzdGluZyBzdG9wIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMzUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UHVibGljTGl2ZVRpY2tlcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3RpY2tlcnMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydjdXJyZW5jeVBhaXInXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZUJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnYXZhaWxhYmxlQmFsYW5jZSddLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdGhpcy5zdW0gKFxuICAgICAgICAgICAgICAgICAgICBiYWxhbmNlWydwZW5kaW5nSW5jb21pbmcnXSxcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVsncGVuZGluZ091dGdvaW5nJ10sXG4gICAgICAgICAgICAgICAgICAgIGJhbGFuY2VbJ29wZW5PcmRlciddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydiYWxhbmNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0UHVibGljTWFya2V0RGVwdGhDdXJyZW5jeVBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnQ3VycmVuY3lQYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcycsICdhc2tzJywgJ3ByaWNlJywgJ3ZvbHVtZScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRpY2tlcls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ICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UHVibGljTGl2ZVRpY2tlckN1cnJlbmN5UGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdDdXJyZW5jeVBhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RpY2tlciddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNpZGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBvcmRlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCd3YXknIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBzaWRlID0gKHRyYWRlWyd3YXknXSA9PSAnYmlkJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgICAgIGxldCBvcmRlcklkID0gdHJhZGVbJ3dheSddICsgJ09yZGVySWQnO1xuICAgICAgICAgICAgb3JkZXIgPSB0cmFkZVtvcmRlcklkXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWyd0cmFuc2FjdGlvblRpbWUnXSkgKiAxMDAwO1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnY3VycmVuY3lQYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAg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WVmcmFtZSwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnQ29kZSc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnV2F5JzogKHNpZGUgPT0gJ2J1eScpID8gJ0JpZCcgOiAnQXNrJyxcbiAgICAgICAgICAgICdBbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsnUHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBpZiAodGhpcy50d29mYSkge1xuICAgICAgICAgICAgaWYgKCdWYWxpZGF0aW9uQ29kZScgaW4gcGFyYW1zKVxuICAgICAgICAgICAgICAgIG9yZGVyWydWYWxpZGF0aW9uQ29kZSddID0gcGFyYW1zWydWYWxpZGF0aW9uQ29kZSddO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yICh0aGlzLmlkICsgJyB0d28tZmFjdG9yIGF1dGhlbnRpY2F0aW9uIHJlcXVpcmVzIGEgbWlzc2luZyBWYWxpZGF0aW9uQ29kZSBwYXJhbWV0ZXInKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGVPcmRlcnMgKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmV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VHlwZSArIG5vbmNlLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgYXV0aCA9IGF1dGgudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEyNTYnLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBUElfUFVCTElDX0tFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBUElfUkVRVUVTVF9TSUdOQVRVUkUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICAgICAgJ0FQSV9SRVFVRVNUX0RBVEUnOiBub25jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWV0aG9kICE9ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1UeXBlJ10gPSBjb250ZW50VHlwZTtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uICh0aGlzLmV4dGVuZCAoeyAnbm9uY2UnOiBub25jZSB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1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ICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdnZGF4JyxcbiAgICAgICAgICAgICduYW1lJzogJ0dEQVgnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVUycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNEZXBvc2l0JzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogNjAsXG4gICAgICAgICAgICAgICAgJzVtJzogMzAwLFxuICAgICAgICAgICAgICAgICcxNW0nOiA5MDAsXG4gICAgICAgICAgICAgICAgJzMwbSc6IDE4MDAsXG4gICAgICAgICAgICAgICAgJzFoJzogMzYwMCxcbiAgICAgICAgICAgICAgICAnMmgnOiA3MjAwLFxuICAgICAgICAgICAgICAgICc0aCc6IDE0NDAwLFxuICAgICAgICAgICAgICAgICcxMmgnOiA0MzIwMCxcbiAgICAgICAgICAgICAgICAnMWQnOiA4NjQwMCxcbiAgICAgICAgICAgICAgICAnMXcnOiA2MDQ4MDAsXG4gICAgICAgICAgICAgICAgJzFNJzogMjU5MjAwMCxcbiAgICAgICAgICAgICAgICAnMXknOiAzMTUzNjAwMCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAndGVzdCc6ICdodHRwczovL2FwaS1wdWJsaWMuc2FuZGJveC5nZGF4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjUyNy1iMWJlNDFjNi01ZWRiLTExZTctOTVmNi01YjQ5NmM0NjllMmMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmdkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmdkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZG9jcy5nZGF4LmNvbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3Bhc3N3b3JkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9jYW5kbGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L3N0YXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0vaG9sZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0vbGVkZ2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb2luYmFzZS1hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlsbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQtbWV0aG9kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcG9ydHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcnMvc2VsZi90cmFpbGluZy12b2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0cy9jb2luYmFzZS1hY2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0cy9wYXltZW50LW1ldGhvZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZy9yZXBheScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZmlsZXMvbWFyZ2luLXRyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBvcnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9jb2luYmFzZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvY3J5cHRvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9wYXltZW50LW1ldGhvZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJvZHVjdHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydiYXNlX2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3F1b3RlX2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydiYXNlX21pbl9zaXplJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnYmFzZV9tYXhfc2l6ZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydxdW90ZV9pbmNyZW1lbnQnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBjb3N0TGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBwcmljZUxpbWl0c1snbWluJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0TGltaXRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IC1NYXRoLmxvZzEwIChwYXJzZUZsb2F0IChhbW91bnRMaW1pdHNbJ21pbiddKSksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogLU1hdGgubG9nMTAgKHBhcnNlRmxvYXQgKHByaWNlTGltaXRzWydtaW4nXSkpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IHRoaXMuZmVlc1sndHJhZGluZyddWyd0YWtlciddO1xuICAgICAgICAgICAgaWYgKChiYXNlID09ICdFVEgnKSB8fCAoYmFzZSA9PSAnTFRDJykpIHtcbiAgICAgICAgICAgICAgICB0YWtlciA9IDAuMDAzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlc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Wl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0c0lkVGlja2VyIChyZXF1ZXN0KTtcbiAgICAgICAgbGV0IHF1b3RlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0c0lkU3RhdHMgKHJlcXVlc3QpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsndGltZSddKTtcbiAgICAgICAgbGV0IGJpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFzayA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdiaWQnIGluIHRpY2tlcilcbiAgICAgICAgICAgIGJpZCA9IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pO1xuICAgICAgICBpZiAoJ2FzaycgaW4gdGlja2VyKVxuICAgICAgICAgICAgYXNrID0gcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAocXVvdGVbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAocXVvdGVbJ2xvdyddKSxcbiAgICAgICAgICAgICdiaWQnOiBiaWQsXG4gICAgICAgICAgICAnYXNr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XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0V2l0aGRyYXdhbHMnO1xuICAgICAgICBpZiAoJ3BheW1lbnRfbWV0aG9kX2lkJyBpbiBwYXJhbXMpIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnUGF5bWVudE1ldGhvZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoJ2NvaW5iYXNlX2FjY291bnRfaWQnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdDb2luYmFzZUFjY291bnQnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdDcnlwdG8nO1xuICAgICAgICAgICAgcmVxdWVzdFsnY3J5cHRvX2FkZHJlc3MnXSA9IGFkZHJlc3M7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGlmICghcmVzcG9uc2UpXG4gICAgICAgICAgICB0aHJvdyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyB3aXRoZHJhdygpIGVycm9yOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHJlcXVlc3QgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHJlcXVlc3Q7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9ICcnO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCAhPSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgICAgIHBheWxvYWQgPSBib2R5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGxldCBwYXlsb2FkID0gKGJvZHkpID8gYm9keSA6ICcnO1xuICAgICAgICAgICAgbGV0IHdoYXQgPSBub25jZSArIG1ldGhvZCArIHJlcXVlc3QgKyBwYXlsb2FkO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh3aGF0KSwgc2VjcmV0LCAnc2hhMjU2JywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ0ItQUNDRVNTLUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdDQi1BQ0NFU1MtU0lHTic6IHRoaXMuZGVjb2RlIChzaWduYXR1cmUpLFxuICAgICAgICAgICAgICAgICdDQi1BQ0NFU1MtVElNRVNUQU1QJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ0NCLUFDQ0VTUy1QQVNTUEhSQVNFJzogdGhpcy5wYXNzd29yZCxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA9PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09IFwie1wiKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSByZXNwb25zZVsnbWVzc2FnZSddO1xuICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdwcmljZSB0b28gc21hbGwnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgI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ljLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5nZW1pbmkuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZ2VtaW5pLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2RvY3MuZ2VtaW5pLmNvbS9yZXN0LWFwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1YnRpY2tlci97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdWN0aW9uL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdWN0aW9uL3tzeW1ib2x9L2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvc2Vzc2lvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQve2N1cnJlbmN5fS9uZXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoZWFydGJlYXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0U3ltYm9scyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gaWQ7XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gbWFya2V0LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB1cHBlcmNhc2Uuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdXBwZXJjYXNlLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICA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WMyMGUtNWVkYy0xMWU3LTljNWItNmRjNjlmYzQyZjVlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwOi8vYXBpLmhpdGJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9oaXRidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9oaXRidGMtY29tL2hpdGJ0Yy1hcGkvYmxvYi9tYXN0ZXIvQVBJdjEubWQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7c3ltYm9sfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7c3ltYm9sfS90cmFkZXMvcmVjZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWUsJ1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2FjdGl2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3JlY2VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9ieS9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbmV3X29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3BheW1lbnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWRkcmVzcy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97dHJhbnNhY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJfdG9fdHJhZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJfdG9fbWFpbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWRkcmVzcy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXlvdXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWEJUJylcbiAgICAgICAgICAgIHJldHVybiAnQlRDJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEUksnKVxuICAgICAgICAgICAgcmV0dXJuICdEQVNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdDQVQnKVxuICAgICAgICAgICAgcmV0dXJuICdCaXRDbGF2ZSc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0U3ltYm9scyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ3N5bWJvbHMnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3N5bWJvbHMnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnY29tbW9kaXR5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgbG90ID0gcGFyc2VGbG9hdCAobWFya2V0Wydsb3QnXSk7XG4gICAgICAgICAgICBsZXQgc3RlcCA9IHBhcnNlRmxvYXQgKG1hcmtldFsnc3RlcCddKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdzdGVwJzogc3RlcCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWV0aG9kID0gdGhpcy5zYWZlU3RyaW5nIChwYXJhbXMsICd0eXBlJywgJ3RyYWRpbmcnKTtcbiAgICAgICAgbWV0aG9kICs9ICdHZXRCYWxhbmNlJztcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsICd0eXBlJyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAocXVlcnkpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGJhbGFuY2VbJ2N1cnJlbmN5X2NvZGUnXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBmcmVlID0gdGhpcy5zYWZlRmxvYXQ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ddO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhbW91bnQgJiYgcmVtYWluaW5nKSB7XG4gICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICBjb3N0ID0gYXZlcmFnZVByaWNlICogZmlsbGVkO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnY2xpZW50T3JkZXJJZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnRyYWRpbmdHZXRPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAg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xvYWQsIHF1ZXJ5KTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXlsb2FkKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdXJsO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgICAgIGF1dGggKz0gYm9keTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnWC1TaWduYXR1cmUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYW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lcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnTTEnLFxuICAgICAgICAgICAgICAgICczbSc6ICdNMycsXG4gICAgICAgICAgICAgICAgJzVtJzogJ001JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJ00xNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICdNMzAnLCAvLyBkZWZhdWx0XG4gICAgICAgICAgICAgICAgJzFoJzogJ0gxJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnSDQnLFxuICAgICAgICAgICAgICAgICcxZCc6ICdEMScsXG4gICAgICAgICAgICAgICAgJzF3JzogJ0Q3JyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NTUtOGVhZWMyMGUtNWVkYy0xMWU3LTljNWItNmRjNjlmYzQyZjVlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5oaXRidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2FwaS5oaXRidGMuY29tJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJywgLy8gQXZhaWxhYmxlIEN1cnJlbmN5IFN5bWJvbHNcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wve3N5bWJvbH0nLCAvLyBHZXQgc3ltYm9sIGluZm9cbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsIC8vIEF2YWlsYWJsZSBDdXJyZW5jaWVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3kve2N1cnJlbmN5fScsIC8vIEdldCBjdXJyZW5jeSBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJywgLy8gVGlja2VyIGxpc3QgZm9yIGFsbCBzeW1ib2xzXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tzeW1ib2x9JywgLy8gVGlja2VyIGZvciBzeW1ib2xcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLCAvLyBUcmFkZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2sve3N5bWJvbH0nLCAvLyBPcmRlcmJvb2tcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3tzeW1ib2x9JywgLy8gQ2FuZGxlc1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLCAvLyBMaXN0IHlvdXIgY3VycmVudCBvcGVuIG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIEdldCBhIHNpbmdsZSBvcmRlciBieSBjbGllbnRPcmRlcklkXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9iYWxhbmNlJywgLy8gR2V0IHRyYWRpbmcgYmFsYW5jZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvZmVlL3tzeW1ib2x9JywgLy8gR2V0IHRyYWRpbmcgZmVlIHJhdGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L3RyYWRlcycsIC8vIEdldCBoaXN0b3JpY2FsIHRyYWRlc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3Rvcnkvb3JkZXInLCAvLyBHZXQgaGlzdG9yaWNhbCBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L29yZGVyL3tpZH0vdHJhZGVzJywgLy8gR2V0IGhpc3RvcmljYWwgdHJhZGVzIGJ5IHNwZWNpZmllZCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYmFsYW5jZScsIC8vIEdldCBtYWluIGFjY2NvdW50IGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3RyYW5zYWN0aW9ucycsIC8vIEdldCBhY2NvdW50IHRyYW5zYWN0aW9uc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdHJhbnNhY3Rpb25zL3tpZH0nLCAvLyBHZXQgYWNjb3VudCB0cmFuc2FjdGlvbiBieSBpZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL2FkZHJlc3Mve2N1cnJlbmN5fScsIC8vIEdldCBkZXBvc2l0IGNyeXBybyBhZGRyZXNzXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gQ3JlYXRlIG5ldyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL3dpdGhkcmF3JywgLy8gV2l0aGRyYXcgY3J5cHJvXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9jcnlwdG8vYWRkcmVzcy97Y3VycmVuY3l9JywgLy8gQ3JlYXRlIG5ldyBkZXBvc2l0IGNyeXBybyBhZGRyZXNzXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC90cmFuc2ZlcicsIC8vIFRyYW5zZmVyIGFtb3VudCB0byB0cmFkaW5nXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIve2NsaWVudE9yZGVySWR9JywgLy8gQ3JlYXRlIG5ldyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL3dpdGhkcmF3L3tpZH0nLCAvLyBDb21taXQgd2l0aGRyYXcgY3J5cHJvXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLCAvLyBDYW5jZWwgYWxsIG9wZW4gb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIve2NsaWVudE9yZGVySWR9JywgLy8gQ2FuY2VsIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9jcnlwdG8vd2l0aGRyYXcve2lkfScsIC8vIFJvbGxiYWNrIHdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncGF0Y2gnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIve2NsaWVudE9yZGVySWR9JywgLy8gQ2FuY2VsIFJlcGxhY2Ugb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAtMC4wMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQ0FUJylcbiAgICAgICAgICAgIHJldHVybiAnQml0Q2xhdmUnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgY3VycmVuY3lJZCAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCaXRDbGF2ZScpXG4gICAgICAgICAgICByZXR1cm4gJ0NBVCc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBmZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBmZWUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMudHJ1bmNhdGUgKGZlZSwgOCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2Jhc2VDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZUN1cnJlbmN5J107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBwYXJzZUZsb2F0IChtYXJrZXRbJ3F1YW50aXR5SW5jcmVtZW50J10pO1xuICAgICAgICAgICAgbGV0IHN0ZXAgPSBwYXJzZUZsb2F0IChtYXJrZXRbJ3RpY2tTaXplJ10pO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsndGlja1NpemUnXSksXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydxdWFudGl0eUluY3JlbWVudCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSBwYXJzZUZsb2F0IChtYXJrZXRbJ3Rha2VMaXF1aWRpdHlSYXRlJ10pO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gcGFyc2VGbG9hdCAobWFya2V0Wydwcm92aWRlTGlxdWlkaXR5UmF0ZSddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdzdGVwJzogc3RlcCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHN0ZXAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QgKiBzdGVwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICd0cmFkaW5nJyk7XG4gICAgICAgI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PSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsZXQgaWQgPSB0cmFkZVsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IG1hcmtldCA/IG1hcmtldFsncXVvdGUnXSA6IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHBhcnNlRmxvYXQgKHRyYWRlWydmZWUnXSksXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGxldCBvcmRlcklkID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2NsaWVudE9yZGVySWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgb3JkZXJJZCA9IHRyYWRlWydjbGllbnRPcmRlcklkJ107XG4gICAgICAgIGxldCBwcmljZSA9IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHBhcnNlRmxvYXQgKHRyYWRlWydxdWFudGl0eSddKTtcbiAgICAgICAgbGV0IG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ZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCAhPSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIHJlbWFpbmluZyA9IGFtb3VudCAtIGZpbGxlZDtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlICE9ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvc3QgPSBmaWxsZWQgKiBwcmljZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IGNyZWF0ZWQsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKGNyZWF0ZWQpLFxuICAgICAgICAgICAgJ2NyZWF0ZWQnOiBjcmVhdGVkLFxuICAgICAgICAgICAgJ3VwZGF0ZWQnOiB1cGRhdGVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtc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wgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gJy9hcGknICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSBhcGkgKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuZW5jb2RlICh0aGlzLmFwaUtleSArICc6JyArIHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAocGF5bG9hZCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogXCJCYXNpYyBcIiArIHRoaXMuZGVjb2RlIChhdXRoKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA9PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09IFwie1wiKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZVsnZXJyb3InXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSByZXNwb25zZVsnZXJyb3InXVsnbWVzc2FnZSddO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UgPT0gJ09yZGVyIG5vdCBmb3VuZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgb3JkZXIgbm90IGZvdW5kIGluIGFjdGl2ZSBvcmRlcnMnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZi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MnKVxuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgaHVvYmkgZXh0ZW5kcyBFeGNoYW5nZSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnaHVvYmknLFxuICAgICAgICAgICAgJ25hbWUnOiAnSHVvYmknLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YzJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMDAxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnMDA1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzAxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICcwMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICcwNjAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxMDAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcyMDAnLFxuICAgICAgICAgICAgICAgICcxTSc6ICczMDAnLFxuICAgICAgICAgICAgICAgICcxeSc6ICc0MDAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NjktMTVhYTdiOWEtNWVkZC0xMWU3LTllN2YtNDQ3OTFmNGVlNDljLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwOi8vYXBpLmh1b2JpLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5odW9iaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2h1b2JpYXBpL0FQSV9Eb2NzX2VuL3dpa2knLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3N0YXRpY21hcmtldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9X2tsaW5lX3twZXJpb2R9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfV97bGVuZ3RofScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3VzZG1hcmtldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9X2tsaW5lX3twZXJpb2R9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfV97bGVuZ3RofScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RyYWRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWNjb3VudF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eV9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxfbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9uZXdfZGVhbF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcl9pZF9ieV90cmFkZV9pZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF93aXRoZHJhd19jb2luX3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2xvYW5fYXZhaWxhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQ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FsndHlwZSddICsgJ0dldERlcHRoSWQnO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAoeyAnaWQnOiBtYXJrZXRbJ2lkJ10gfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2spO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9IG1hcmtldFsndHlwZSddICsgJ0dldFRpY2tlcklkJztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnNlWyd0aWNrZXInXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChyZXNwb25zZVsndGltZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2J1eScpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndHMnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZ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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGh1b2JpcHJvIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2h1b2JpcHJvJyxcbiAgICAgICAgICAgICduYW1lJzogJ0h1b2JpIFBybycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0NOJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdhY2NvdW50cyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhY2NvdW50c0J5SWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaG9zdG5hbWUnOiAnYXBpLmh1b2JpLnBybycsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW1pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MG1pbicsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkYXknLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxd2VlaycsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFtb24nLFxuICAgICAgICAgICAgICAgICcxeSc6ICcxeWVhcicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU2OS0xNWFhN2I5YS01ZWRkLTExZTctOWU3Zi00NDc5MWY0ZWU0OWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmh1b2JpLnBybycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5odW9iaS5wcm8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2h1b2JpYXBpL0FQSV9Eb2NzL3dpa2kvUkVTVF9hcGlfcmVmZXJlbmNlJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9rbGluZScsIC8vIOiOt+WPlkvnur/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWwvbWVyZ2VkJywgLy8g6I635Y+W6IGa5ZCI6KGM5oOFKFRpY2tlcilcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsIC8vIOiOt+WPliBNYXJrZXQgRGVwdGgg5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLCAvLyDojrflj5YgVHJhZGUgRGV0YWlsIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnkvdHJhZGUnLCAvLyDmibnph4/ojrflj5bmnIDov5HnmoTkuqTmmJPorrDlvZVcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWwnLCAvLyDojrflj5YgTWFya2V0IERldGFpbCAyNOWwj+aXtuaIkOS6pOmHj+aVsOaNrlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21tb24vc3ltYm9scycsIC8vIOafpeivouezu+e7n+aUr+aMgeeahOaJgOacieS6pOaYk+WvuVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbW1vbi9jdXJyZW5jeXMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInluIHnp41cbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21tb24vdGltZXN0YW1wJywgLy8g5p+l6K+i57O757uf5b2T5YmN5pe26Ze0XG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2FjY291bnRzJywgLy8g5p+l6K+i5b2T5YmN55So5oi355qE5omA5pyJ6LSm5oi3KOWNs2FjY291bnQtaWQpXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9hY2NvdW50cy97aWR9L2JhbGFuY2UnLCAvLyDmn6Xor6LmjIflrprotKbmiLfnmoTkvZnpop1cbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMve2lkfScsIC8vIOafpeivouafkOS4quiuouWNleivpuaDhVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy97aWR9L21hdGNocmVzdWx0cycsIC8vIOafpeivouafkOS4quiuouWNleeahOaIkOS6pOaYjue7hlxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycycsIC8vIOafpeivouW9k+WJjeWnlOaJmOOAgeWOhuWPsuWnlOaJmFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL21hdGNocmVzdWx0cycsIC8vIOafpeivouW9k+WJjeaIkOS6pOOAgeWOhuWPsuaIkOS6pFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwvYWRkcmVzc2VzJywgLy8g5p+l6K+i6Jma5ouf5biB5o+Q546w5Zyw5Z2AXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy9wbGFjZScsIC8vIOWIm+W7uuW5tuaJp+ihjOS4gOS4quaWsOiuouWNlSAo5LiA5q2l5LiL5Y2V77yMIOaOqOiNkOS9v+eUqClcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMnLCAvLyDliJvlu7rkuIDkuKrmlrDnmoTorqLljZXor7fmsYIg77yI5LuF5Yib5bu66K6i5Y2V77yM5LiN5omn6KGM5LiL5Y2V77yJXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0vcGxhY2UnLCAvLyDmiafooYzkuIDkuKrorqLljZUg77yI5LuF5omn6KGM5bey5Yib5bu655qE6K6i5Y2V77yJXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0vc3VibWl0Y2FuY2VsJywgLy8g55Sz6K+35pKk6ZSA5LiA5Liq6K6i5Y2V6K+35rGCXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL2JhdGNoY2FuY2VsJywgLy8g5om56YeP5pKk6ZSA6K6i5Y2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnZHcvYmFsYW5jZS90cmFuc2ZlcicsIC8vIOi1hOS6p+WIkui9rFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwvY3JlYXRlJywgLy8g55Sz6K+35o+Q546w6Jma5ouf5biBXG4gICAgICAgICAgICAgICAgICAgICAgICAnZH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ZXQgcXVvdGUgPSBxdW90ZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGlkID0gYmFzZUlkICsgcXVvdGVJZDtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydhbW91bnQtcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZS1wcmVjaXNpb24nXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBsZXQgbWFrZXIgPSAoYmFzZSA9PSAnT01HJykgPyAwIDogMC4yIC8gMTAwO1xuICAgICAgICAgICAgbGV0IHRha2VyID0gKGJhc2UgPT0gJ09NRycpID8gMCA6IDAuMiAvIDEwMDtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgbGFzdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdsYXN0JyBpbiB0aWNrZXIpXG4gICAgICAgICAgICBsYXN0ID0gdGlja2VyWydsYXN0J107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgaWYgKCd0cycgaW4gdGlja2VyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGlja2VyWyd0cyddO1xuICAgICAgICBsZXQgYmlkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgYXNrID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2JpZCcgaW4gdGlja2VyKSB7XG4gICAgICAgICAgICBpZiAodGlja2VyWydiaWQnXSlcbiAgICAgICAgICAgICAgICBiaWQgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyWydiaWQnXSwgMCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCdhc2snIGluIHRpY2tlcikge1xuICAgICAgICAgICAgaWYgKHRpY2tlclsnYXNrJ10pXG4gICAgICAgICAgICAgICAgYXNrID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlclsnYXNrJ10sIDApO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyWydoaWdoJ10sXG4gICAgICAgICAgICAnbG93JzogdGlja2VyWydsb3cnXSxcbiAgICAgICAgICAgICdiaWQnOiBiaWQsXG4gICAgICAgICAgICAnYXNrJzogYXNrLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHRpY2tlclsnb3BlbiddLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdGlja2VyWydjbG9zZSddLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50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1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAocmVzcG9uc2VbJ3RpY2snXSwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndHMnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsnZGlyZWN0aW9uJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZXNEYXRhIChkYXRhLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGRhdGEubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0cmFkZXMgPSB0aGlzLnBhcnNlVHJhZGVzIChkYXRhW2ldWydkYXRhJ10sIG1hcmtldCk7XG4gICAgICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IHRyYWRlcy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0cmFkZXNba10pO1xu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AnPycgKyBhdXRoO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH1cbiAgICAgICAgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHVybDtcbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKCdzdGF0dXMnIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydzdGF0dXMnXSA9PSAnZXJyb3InKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICByZXR1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1YmxpYyc6ICdodHRwczovL2FwaS5pbmRlcGVuZGVudHJlc2VydmUuY29tL1B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmluZGVwZW5kZW50cmVzZXJ2ZS5jb20vUHJpdmF0ZScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmluZGVwZW5kZW50cmVzZXJ2ZS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbS9BUEknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZFByaW1hcnlDdXJyZW5jeUNvZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZFNlY29uZGFyeUN1cnJlbmN5Q29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkTGltaXRPcmRlclR5cGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZE1hcmtldE9yZGVyVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkT3JkZXJUeXBlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRUcmFuc2FjdGlvblR5cGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRTdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlSGlzdG9yeVN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFJlY2VudFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RnhSYXRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnUGxhY2VMaW1pdE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQbGFjZU1hcmtldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0Q2xvc2VkT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDbG9zZWRGaWxsZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyRGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGlnaXRhbEN1cnJlbmN5RGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERpZ2l0YWxDdXJyZW5jeURlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N5bmNoRGlnaXRhbEN1cnJlbmN5RGVwb3NpdEFkZHJlc3NXaXRoQmxvY2tjaGFpbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdEaWdpdGFsQ3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlcXVlc3RGaWF0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVzJyxcbiAgICAgIC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ICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIGxldCB0YWtlciA9IDAuNSAvIDEwMDtcbiAgICAgICAgICAgICAgICBsZXQgbWFrZXIgPSAwLjUgLyAxMDA7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IGlkLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QWNjb3VudHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYWxhbmNlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeUNvZGUgPSBiYWx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ldGhvZF0gKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ09yZGVyR3VpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdvcmRlckd1aWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gW1xuICAgICAgICAgICAgICAgIHVybCxcbiAgICAgICAgICAgICAgICAnYXBpS2V5PScgKyB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2U9JyArIG5vbmNlLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIGxldCBrZXlzb3J0ZWQgPSB0aGlzLmtleXNvcnQgKHBhcmFtcyk7XG4gICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChrZXlzb3J0ZWQpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGtleSA9IGtleXNbaV07XG4gICAgICAgICAgICAgICAgYXV0aC5wdXNoIChrZXkgKyAnPScgKyBwYXJhbXNba2V5XSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbWVzc2FnZSA9IGF1dGguam9pbiAoJywnKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChtZXNzYWdlKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmtleXNvcnQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwa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J2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzgyMjE1OS02NjE1MzYyMC02MGFkLTExZTctODllNy0wMDVmNmQ3ZjNkZTAuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLml0Yml0LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5pdGJpdC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5pdGJpdC5jb20vZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5pdGJpdC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tzeW1ib2x9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS9vcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tzeW1ib2x9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9iYWxhbmNlcy97Y3VycmVuY3lDb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2Z1bmRpbmdfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0X3RyYW5zZmVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2NyeXB0b2N1cnJlbmN5X2RlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vY3J5cHRvY3VycmVuY3lfd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpcmVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnWEJUVVNEJywgJ3N5bWJvbCc6ICdCVEMvVVNEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b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FxuICAgICAgICAgICAgJ29wZW4nOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ29wZW5Ub2RheSddKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0UHJpY2UnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWyd0aW1lc3RhbXAnXSk7XG4gICAgICAgIGxldCBpZCA9IHRyYWRlWydtYXRjaE51bWJlciddLnRvU3RyaW5nICgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogaWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFx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gICAgICAncmF0ZUxpbWl0JzogMzAwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAvLyBvYnNvbGV0ZSBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzQnlBbHRuYW1lJzoge30sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzRoJzogJzI0MCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxMDA4MCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzIxNjAwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTk5LTIyNzA5MzA0LTVlZGUtMTFlNy05ZGUxLTlmMzM3MzJlMTUwOS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkua3Jha2VuLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5rcmFrZW4uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cua3Jha2VuLmNvbS9lbi11cy9oZWxwL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vbm90aGluZ2lzZGVhZC9ucG0ta3Jha2VuLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5rcmFrZW4uY29tL2VuLXVzL2hlbHAvZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0Fzc2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09ITEMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NwcmVhZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUaW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FkZE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2xvc2VkT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEZXBvc2l0QWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEZXBvc2l0TWV0aG9kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRGVwb3NpdFN0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTGVkZ2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3BlblBvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUXVlcnlMZWRnZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRdWVyeU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUXVlcnlUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVzSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVWb2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd1N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvc3RUb1ByZWNpc2lvbiAoc3ltYm9sLCBjb3N0KSB7XG4gICAgICAgIHJldHVybiB0aGlzLnRydW5jYXRlIChwYXJzZUZsb2F0IChjb3N0KSwgdGhpcy5tYXJrZXRzW3N5bWJvbF1bJ3ByZWNpc2lvbiddWydwcmljZSddKTtcbiAgICB9XG5cbiAgICBmZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBmZWUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMudHJ1bmNhdGUgKHBhcnNlRmxvYXQgKGZlZSksIHRoaXMubWFya2V0c1tzeW1ib2xdWydwcmVjaXNpb24nXVsnYW1vdW50J10pO1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnSW52YWxpZCBub25jZScpID49IDApXG4gICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE5vbmNlICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdJbnN1ZmZpY2llbnQgZnVuZHMnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdDYW5jZWwgcGVuZGluZycpID49IDApXG4gICAgICAgICAgICB0aHJvdyBuZXcgQ2FuY2VsUGVuZGluZyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnSW52YWxpZCBhcmd1bWVudHM6dm9sdW1lJykgPj0gMClcbiAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0QXNzZXRQYWlycyAoKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0c1sncmVzdWx0J10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtpZF07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgaWYgKChiYXNlWzBdID09ICdYJykgfHwgKGJhc2VbMF0gPT0gJ1onKSlcbiAgICAgICAgICAgICAgICBiYXNlID0gYmFzZS5zbGljZSAoMSk7XG4gICAgICAgICAgICBpZiAoKHF1b3RlWzBdID09ICdYJykgfHwgKHF1b3RlWzBdID09ICdaJykpXG4gICAgICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS5zbGljZSAoMSk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IGRhcmtwb29sID0gaWQuaW5kZXhPZiAoJy5kJykgPj0gMDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBkYXJrcG9vbCA/IG1hcmtldFsnYWx0bmFtZSddIDogKGJhc2UgKyAnLycgKyBxdW90ZSk7XG4gICAgICAgICAgICBsZXQgbWFrZXIgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoJ2ZlZXNfbWFrZXInIGluIG1hcmtldCkge1xuICAgICAgICAgICAgICAgIG1ha2VyID0gcGFyc2VGbG9hdCAobWFya2V0WydmZWVzX21ha2VyJ11bMF1bMV0pIC8gMTAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0Wydsb3RfZGVjaW1hbHMnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ3BhaXJfZGVjaW1hbHMnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdkYXJrcG9vbCc6IGRhcmtwb29sLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdhbHRuYW1lJzogbWFya2V0WydhbHRuYW1lJ10sXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFrZXIsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogcGFyc2VGbG9hdCAobWFya2V0WydmZWVzJ11bMF1bMV0pIC8gMTAwLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHQgPSB0aGlzLmFwcGVuZEluYWN0aXZlTWFya2V0cyAocmVzdWx0KTtcbiAgICAgICAgdGhpcy5tYXJrZXRzQnlBbHRuYW1lID0gdGhpcy5pbmRleEJ5IChyZXN1bHQsICdhbHRuYW1lJyk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXBwZW5kSW5hY3RpdmVNYXJrZXRzIChyZXN1bHQgPSBbXSkge1xuICAgICAgICBsZXQgcHJlY2lzaW9uID0geyAnYW1vdW50JzogOCwgJ3ByaWNlJzogOCB9O1xuICAgICAgICBsZXQgY29zdExpbWl0cyA9IHsgJ21pbic6IDAsICdtYXgnOiB1bmRlZmluZWQgfTtcbiAgICAgICAgbGV0IHByaWNlTGltaXRzID0geyAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSwgJ21heCc6IHVuZGVmaW5lZCB9O1xuICAgICAgICBsZXQgYW1vdW50TGltaXRzID0geyAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pIH07XG4gICAgICAgIGxldCBsaW1pdHMgPSB7ICdhbW91bnQnOiBhbW91bnRMaW1pdHMsICdwcmljZSc6IHByaWNlTGltaXRzLCAnY29zdCc6IGNvc3RMaW1pdHMgfTtcbiAgICAgICAgbGV0IGRlZmF1bHRzID0ge1xuICAgICAgICAgICAgJ2Rhcmtwb29sJzogZmFsc2UsXG4gICAgICAgICAgICAnaW5mbyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdtYWtlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0YWtlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3QnOiBhbW91bnRMaW1pdHNbJ21pbiddLFxuICAgICAgICAgICAgJ2FjdGl2ZSc6IGZhbHNlLFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgIH07XG4gICAgICAgIGxldCBtYXJrZXRzID0gW1xuICAgICAgICAgICAgeyAnaWQnOiAnWFhMTVpFVVInLCAnc3ltYm9sJzogJ1hMTS9FVVInLCAnYmFzZSc6ICdYTE0nLCAncXVvdGUnOiAnRVVSJywgJ2Fs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zICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGJhc2VWb2x1bWUgPSBwYXJzZUZsb2F0ICh0aWNrZXJbJ3YnXVsxXSk7XG4gICAgICAgIGxldCB2d2FwID0gcGFyc2VGbG9hdCAodGlja2VyWydwJ11bMV0pO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSBiYXNlVm9sdW1lICogdndhcDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2gnXVsxXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsJ11bMV0pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYiddWzBdKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2EnXVswXSksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHBhcnNlRmxvYXQgKHRpY2tlclsnbyddKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydjJ11bMF0pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHBhaXJzID0gW107XG4gICAgICAgIGZvciAobGV0IHMgPSAwOyBzIDwgdGhpcy5zeW1ib2xzLmxlbmd0aDsgcysrKSB7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdGhpcy5zeW1ib2xzW3NdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgaWYgKG1hcmtldFsnYWN0aXZlJ10pXG4gICAgICAgICAgICAgICAgaWYgKCFtYXJrZXRbJ2Rhcmtwb29sJ10pXG4gICAgICAgICAgICAgICAgICAgIHBhaXJzLnB1c2ggKG1hcmtldFsnaWQnXSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZpbHRlciA9IHBhaXJzLmpvaW4gKCcsJyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiBmaWx0ZXIsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VycyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGRhcmtwb29sID0gc3ltYm9sLmluZGV4T2YgKCcuZCcpID49IDA7XG4gICAgICAgIGlmIChkYXJrcG9vbClcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBkb2VzIG5vdCBwcm92aWRlIGEgdGlja2VyIGZvciBkYXJrcG9vbCBzeW1ib2wgJyArIHN5bWJvbCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsncmVzdWx0J11bbWFya2V0WydpZCddXTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0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VGbG9hdCAodHJhZGVbJ3ZvbCddKTtcbiAgICAgICAgICAgIGlmICgnZmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodHJhZGVbJ2ZlZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsyXSAqIDEwMDApO1xuICAgICAgICAgICAgc2lkZSA9ICh0cmFkZVszXSA9PSAncycpID8gJ3NlbGwnIDogJ2J1eSc7XG4gICAgICAgICAgICB0eXBlID0gKHRyYWRlWzRdID09ICdsJykgPyAnbGltaXQnIDogJ21hcmtldCc7XG4gICAgICAgICAgICBwcmljZSA9IHBhcnNlRmxvYXQgKHRyYWRlWzBdKTtcbiAgICAgICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKHRyYWRlWzFdKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gKG1hcmtldCkgPyBtYXJrZXRbJ3N5bWJvbCddIDogdW5kZWZpbmVkO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc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IXByaWNlKVxuICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgaWYgKCdmZWUnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZsYWdzID0gb3JkZXJbJ29mbGFncyddO1xuICAgICAgICAgICAgICAgIGxldCBmZWVDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZmVlJyk7XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgICAgICdyYXRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgaWYgKGZsYWdzLmluZGV4T2YgKCdmY2lxJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICBmZWVbJ2N1cnJlbmN5J10gPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChmbGFncy5pbmRleE9mICgnZmNpYicpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZmVlWydjdXJyZW5jeSddID0gbWFya2V0WydiYXNlJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IG9yZGVyWydzdGF0dXMnXSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAvLyAndHJhZGVzJzogdGhpcy5wYXJzZVRyYWRlcyAob3JkZXJbJ3RyYWRlcyddLCBtYXJrZXQpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJzIChvcmRlcnMsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAob3JkZXJzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBvcmRlciA9IHRoaXMuZXh0ZW5kICh7ICdpZCc6IGlkIH0sIG9yZGVyc1tpZF0pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMucGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFF1ZXJ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RlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBsZXQgbnVtRXJyb3JzID0gcmVzcG9uc2VbJ2Vycm9yJ10ubGVuZ3RoO1xuICAgICAgICAgICAgaWYgKG51bUVycm9ycykge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmVzcG9uc2VbJ2Vycm9yJ10ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydlcnJvciddW2ldID09ICdFU2VydmljZTpVbmF2YWlsYWJsZScpXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3InXVtpXSA9PSAnRVNlcnZpY2U6QnVzeScpXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRocm93IG5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ICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMxNjk3NjM4LTkxMjgyNGZhLWIzYzEtMTFlNy04YzM2LWNmOTYwNmViOTRhYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9rdW5hLmlvJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8va3VuYS5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2t1bmEuaW8vZG9jdW1lbnRzL2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2sve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lc3RhbXAnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVtYmVycy9tZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvbXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICA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bG90JzogMC4wMDAwMDEsICdsaW1pdHMnOiB7ICdhbW91bnQnOiB7ICdtaW4nOiAwLjAwMDAwMSwgJ21heCc6IHVuZGVmaW5lZCB9LCAncHJpY2UnOiB7ICdtaW4nOiAxLCAnbWF4JzogdW5kZWZpbmVkIH19fSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09IDQwMCkge1xuICAgICAgICAgICAgbGV0IGRhdGEgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGxldCBlcnJvciA9IGRhdGFbJ2Vycm9yJ107XG4gICAgICAgICAgICBsZXQgZXJyb3JNZXNzYWdlID0gZXJyb3JbJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgIGlmIChlcnJvck1lc3NhZ2UuaW5kZXhPZiAoJ2Nhbm5vdCBsb2NrIGZ1bmRzJykgPj0gMCkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAoWyB0aGlzLmlkLCBtZXRob2QsIHVybCwgY29kZSwgcmVhc29uLCBib2R5IF0uam9pbiAoJyAnKSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yTWVzc2FnZS5pbmRleE9mIChcIkNvdWxkbid0IGZpbmQgT3JkZXJcIikgPj0gMCkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kIChbIH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ICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5sYWtlYnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lmxha2VidGMuY29tL3MvYXBpX3YyJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lmxha2VidGMuY29tL3MvYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmN0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEV4dGVybmFsQWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMTUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBrZXlzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2tdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBiYXNlID0gYmFzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIHF1b3RlID0gcXVvdGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiA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IHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSBwYXJhbXMuam9pbiAoJywnKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSAnJztcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMudXJsZW5jb2RlICh7XG4gICAgICAgICAgICAgICAgJ3RvbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FjY2Vzc2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdyZXF1ZXN0bWV0aG9kJzogbWV0aG9kLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiBwYXJhbXMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogcGFyYW1zLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMScpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmVuY29kZSAodGhpcy5hcGlLZXkgKyAnOicgKyBzaW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FpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc5ODIwMjItNzVhZWE4MjgtNjNhMC0xMWU3LTk1MTEtY2E1ODRhOGVkZDc0LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5saXF1aS5pby9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5saXF1aS5pby90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9saXF1aS5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2xpcXVpLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9saXF1aS5pby9mZWUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVySW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhbnNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb2luRGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ3JlYXRlQ291cG9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWRlZW1Db3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IDAuMCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCBrZXkgPSAncXVvdGUnO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAqIHJhdGUpKTtcbiAgICAgICAgaWYgKHNpZGUgPT0gJ3NlbGwnKSB7XG4gICAgICAgICAgICBjb3N0ICo9IHByaWNlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAga2V5ID0gJ2Jhc2UnO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndHlwZSc6IHRha2VyT3JNYWtlcixcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFtrZXldLFxuICAgICAgICAgICAgJ3JhdGUnOiByYXRlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKCF0aGlzLnN1YnN0aXR1dGVDb21tb25DdXJyZW5jeUNvZGVzKVxuICAgICAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hCVCcpXG4gICAgICAgICAgICByZXR1cm4gJ0JUQ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TtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSB0aGlzLmdldEJhc2VRdW90ZUZyb21NYXJrZXRJZCAoaWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ2RlY2ltYWxfcGxhY2VzJyksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlSW50ZWdlciAobWFya2V0LCAnZGVjaW1hbF9wbGFjZXMnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYW1vdW50TGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X2Ftb3VudCcpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9wcmljZScpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X3ByaWNlJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGNvc3RMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fdG90YWwnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0TGltaXRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0WydoaWRkZW4nXSA9PSAwKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IG1hcmtldFsnZmVlJ10gLyAxMDAsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGFtb3VudExpbWl0c1snbWluJ10sXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBmdW5kcyA9IGJhbGFuY2VzWydmdW5kcyddO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChmdW5kcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIHVwcGVyY2FzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1cHBlcmNhc2UpO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IHVzZWQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoYmFsYW5jZXNbJ29wZW5fb3JkZXJzJ10gPT0gMCkge1xuICAgICAgICAgICAgICAgIHRvdGFsID0gZnVuZHNbY3VycmVuY3ldO1xuICAgICAgICAgICAgICAgIHVzZWQgPSAwLjA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGZ1bmRzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHVzZWQsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5b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W5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgaWRzID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIXN5bWJvbHMpIHtcbiAgICAgICAgICAgIGxldCBudW1JZHMgPSB0aGlzLmlkcy5sZW5ndGg7XG4gICAgICAgICAgICBpZiAobnVtSWRzID4gMjU2KVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaFRpY2tlcnMoKSByZXF1aXJlcyBzeW1ib2xzIGFyZ3VtZW50Jyk7XG4gICAgICAgICAgICBpZHMgPSB0aGlzLmlkcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlkcyA9IHRoaXMubWFya2V0SWRzIChzeW1ib2xzKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogaWRzLmpvaW4gKCctJyksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGtleXMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNba107XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXI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ogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobGltaXQpXG4gICAgICAgICAgICByZXF1ZXN0WydsaW1pdCddID0gbGltaXQ7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzUGFpciAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbbWFya2V0WydpZCddXSwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIC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h0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiAwLjAsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgLy8gJ3RyYWRlcyc6IHRoaXMucGFyc2VUcmFkZXMgKG9yZGVyWyd0cmFkZXMnXSwgbWFya2V0KSxcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gb3JkZXI7XG4gICAgICAgIHJldHVybiB0aGlzLmV4dGVuZCAoeyAnaW5mbyc6IHJlc3BvbnNlIH0sIG9yZGVyKTtcbiAgICB9XG5cbiAgICBnZXRPcmRlcklkS2V5ICgpIHtcbiAgICAgICAgcmV0dXJuICdvcmRlcl9pZCc7XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0ge307XG4gICAgICAgICAgICBsZXQgaWRLZXkgPSB0aGlzLmdldE9yZGVySWRLZXkgKCk7XG4gICAgICAgICAgICByZXF1ZXN0W2lkS2V5XSA9IGlkO1xuICAgICAgICAgICAgcmVzcG9uc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IHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcmVtYWluaW5nICE9ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGZpbGxlZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJzIChvcmRlcnMsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKG9yZGVycyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubG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ySWRzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBjYWNoZWRPcmRlcklkc1trXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiBvcGVuT3JkZXJzSW5kZXhlZEJ5SWQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSB0aGlzLmV4dGVuZCAodGhpcy5vcmRlcnNbaWRdLCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWRbaWRdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ29wZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBvcmRlclsnYW1vdW50J10gKiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICBpZiAob3JkZXJbJ3N5bWJvbCddID09IHN5bWJvbClcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAob3JkZXIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcGVuT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHN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dHVyZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy5nZXRWZXJzaW9uU3RyaW5nICgpICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3InXS5pbmRleE9mICgnTm90IGVub3VndGgnKSA+PSAwKSB7IC8vIG5vdCBlbm91Z1RoIGlzIGEgdHlwbyBpbnNpZGUgTGlxdWkncyBvd24gQVBJLi4uXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWY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1bGUuZXhwb3J0cyA9IGNsYXNzIGxpdmVjb2luIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2xpdmVjb2luJyxcbiAgICAgICAgICAgICduYW1lJzogJ0xpdmVDb2luJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdVUycsICdVSycsICdSVScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk4MDc2OC1mMjJmYzQyNC02MzhhLTExZTctODljOS02MDEwYTU0ZmY5YmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmxpdmVjb2luLm5ldCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5saXZlY29pbi5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cubGl2ZWNvaW4ubmV0L2FwaT9sYW5nPWVuJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYWxsL29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2xhc3RfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9tYXhiaWRfbWluYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9yZXN0cmljdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RpY2tlcicsIC8vIG9taXQgcGFyYW1zIHRvIGdldCBhbGwgdGlja2VycyBhdCBvbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9jb2luSW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jbGllbnRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jb21taXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jb21taXNzaW9uQ29tbW9uSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2dldC9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2hpc3Rvcnkvc2l6ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9oaXN0b3J5L3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2J1eWxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9idXltYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NhbmNlbGxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9zZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NhcGl0YWxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NhcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L29rcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L291dC9wYXllZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L3BlcmZlY3Rtb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL2Ftb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL21ha2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvdm91Y2hlci9yZWRlZW0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0RXhjaGFuZ2VUaWNrZXIgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IHRha2VyID0gMC4xOCAvIDEwMDtcbiAgICAgICAgICAgIGxldCBtYWtlciA9IDAuMTggLyAxMDA7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFBheW1lbnRCYWxhbmNlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIHJlc3VsdClcbiAgICAgICAgICAgICAgICBhY2NvdW50ID0gcmVzdWx0W2N1cnJlbmN5XTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGJhbGFuY2VbJ3R5cGUnXSA9PSAndG90YWwnKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlWyd2YWx1ZSddKTtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlWyd0eXBlJ10gPT0gJ2F2YWlsYWJsZScpXG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsndmFsdWUnXSk7XG4gICAgICAgICAgICBpZiAoYmFsYW5jZVsndHlwZSddID09ICd0cmFkZScpXG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsndmFsdWUnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0RXhjaGFuZ2VPcmRlckJvb2sgKHRoaXMu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ICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0RXhjaGFuZ2VUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3lQYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndGltZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3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bICdHQicsICdTRycsICdaQScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAzMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NjA3LThjMWE2OWQ4LTVlZGUtMTFlNy05MzBjLTU0MGI1ZWI5YmUyNC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkubXliaXR4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubHVuby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5sdW5vLmNvbS9lbi9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9ucG1qcy5vcmcvcGFja2FnZS9iaXR4JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iYXVzbWVpZXIvbm9kZS1iaXR4JyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0vcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMve2lkfS90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZlZV9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nX2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3R0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zdG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RvcG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nX2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29hdXRoMi9ncmFudCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3Rlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWyd0aWNrZXJzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWyd0aWNrZXJzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3BhaXInXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYWxhbmNlWydhc3NldCddKTtcbiAgICAgICAgICAgIGxldCByZXNlcnZlZCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ3Jlc2VydmVkJ10pO1xuICAgICAgICAgICAgbGV0IHVuY29uZmlybWVkID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsndW5jb25maXJtZWQnXSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2JhbGFuY2UnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiB0aGlzLnN1bSAocmVzZXJ2ZWQsIHVuY29uZmlybWVkKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IG9yZGVyYm9va1sndGltZXN0YW1wJ107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHRpbWVzdGFtcCwgJ2JpZHMnLCAnYXNrcycsICdwcmljZScsICd2b2x1bWUnKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndGltZXN0YW1wJ107XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZX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kZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWydpc19idXknXSkgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ3RpbWVzdGFtcCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0cmFkZVsndGltZXN0YW1wJ10pLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsndm9sdW1lJ10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWyd0cmFkZXMnXSwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAobWFya2V0LCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0JztcbiAgICAgICAgbGV0IG9yZGVyID0geyAncGFpcic6IHRoaXMubWFya2V0SWQgKG1hcmtldCkgfTtcbiAgICAgICAgaWYgKHR5cGUgPT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnTWFya2V0b3JkZXInO1xuICAgICAgICAgICAgb3JkZXJbJ3R5cGUnXSA9IHNpZGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBpZiAoc2lkZSA9PSAnYnV5JylcbiAgICAgICAgICAgICAgICBvcmRlclsnY291bnRlcl92b2x1bWUnXSA9IGFtb3VudDtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBvcmRlclsnYmFzZV92b2x1bWUnXSA9IGFtb3VudDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnT3JkZXInO1xuICAgICAgICAgICAgb3JkZXJbJ3ZvbHVtZSddID0gYW1vdW50O1xuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgICAgIGlmIChzaWRlID09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWyd0eXBlJ10gPSAnQklEJztcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBvcmRlclsndHlwZSddID0gJ0FTSyc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm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VsZS5leHBvcnRzID0gY2xhc3MgbWVyY2FkbyBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdtZXJjYWRvJyxcbiAgICAgICAgICAgICduYW1lJzogJ01lcmNhZG8gQml0Y29pbicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0JSJywgLy8gQnJhemlsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YzJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3ODM3MDYwLWU3YzU4NzE0LTYwZWEtMTFlNy05MTkyLWYwNWU4NmFkYjgzZi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4ubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3Lm1lcmNhZG9iaXRjb2luLm5ldC90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4uY29tLmJyJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4uY29tLmJyL2FwaS1kb2MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4uY29tLmJyL3RyYWRlLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L29yZGVyYm9vay8nLCAvLyBsYXN0IHNsYXNoIGNyaXRpY2FsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RpY2tlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90cmFkZXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vdHJhZGVzL3tmcm9tfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90cmFkZXMve2Zyb219L3t0b30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS9kYXktc3VtbWFyeS97eWVhcn0ve21vbnRofS97ZGF5fS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2FjY291bnRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9zeXN0ZW1fbWVzc2FnZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3Rfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGxhY2VfYnV5X29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9zZWxsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQlJMJzogeyAnaWQnOiAnQlJMQlRDJywgJ3N5bWJvbCc6ICdCVEMvQlJMJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0JSTCcsICdzdWZmaXgnOiAnQml0Y29pbicgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0JSTCc6IHsgJ2lkJzogJ0JSTExUQycsICdzeW1ib2wnOiAnTFRDL0JSTCcsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdCUkwnLCAnc3VmZml4JzogJ0xpdGVjb2luJyB9LFxuICAgICAgICAgICAgICAgICdCQ0gvQlJMJzogeyAnaWQnOiAnQlJMQkNIJywgJ3N5bWJvbCc6ICdCQ0gvQlJMJywgJ2Jhc2UnOiAnQkNIJywgJ3F1b3RlJzogJ0JSTCcsICdzdWZmaXgnOiAnQkNhc2gnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMyAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC43IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAg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ddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3NlbGwnXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2wnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiA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gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLnZlcnNpb24gKyAnLyc7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICd0YXBpX21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ3RhcGlfbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnL3RhcGkvJyArIHRoaXMudmVyc2lvbiArICcvJyArICc/JyArIGJvZHk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnVEFQSS1JRCc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdUQVBJLU1BQyc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0a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SxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzAyMzcyMTItZWQyOTMwM2MtOTUzNS0xMWU3LThhZjgtZmNkMzgxY2ZhMjBjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL21peGNvaW5zLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9taXhjb2lucy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9taXhjb2lucy5jb20vaGVscC9hcGkvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmt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biAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ3Jlc3VsdCddWyd3YWxsZXQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBsb3dlcmNhc2UgPSBjdXJyZW5jeS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGxvd2VyY2FzZSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtsb3dlcmNhc2VdWydhdmFpbCddKTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2xvd2VyY2FzZV1bJ2xvY2snXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5w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4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZ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G4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXN1bHQnXVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWwgKHsgJ2lkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IG5v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vbm92YWV4Y2hhbmdlLmNvbS9yZW1vdGUvZmFxJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMve2Jhc2VjdXJyZW5jeX0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvaW5mby97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3JkZXJoaXN0b3J5L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVub3JkZXJzL3twYWlyfS9idXkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vc2VsbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVub3JkZXJzL3twYWlyfS9ib3RoLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW5vcmRlcnMve3BhaXJ9L3tvcmRlcnR5cGV9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlL3tjdXJyZW5jeX0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRkZXBvc2l0cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHdpdGhkcmF3YWxzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bmV3ZGVwb3NpdGFkZHJlc3Mve2N1cnJlbmN5fS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGRlcG9zaXRhZGRyZXNzL3tjdXJyZW5jeX0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteW9wZW5vcmRlcnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteW9wZW5vcmRlcnNfbWFya2V0L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbG9yZGVyL3tvcmRlcmlkfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3L3tjdXJyZW5jeX0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZWhpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRkZXBvc2l0aGlzdG9yeS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHdpdGhkcmF3YWxoaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0c3RhdHVzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0c3RhdHVzL3tjdXJyZW5jeX0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydtYXJrZXRzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGlmICghbWFya2V0WydkaXNhYmxlZCddKSB7XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydtYXJrZXRuYW1lJ107XG4gICAgICAgICAgICAgICAgbGV0IFsgcXVvdGUsIGJhc2UgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3Blbm9yZGVyc1BhaXJCb3RoICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYnV5b3JkZXJzJywgJ3NlbGxvcmRlcnMnLCAncHJpY2UnLCAnYW1vdW50Jyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0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WxhbmNlWydhbW91bnRfdHJhZGVzJ10pO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiB0aGlzLnN1bSAobG9ja2JveCwgdHJhZGVzKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnRfdG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlID09ICdtYXJrZXQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGFsbG93cyBsaW1pdCBvcmRlcnMgb25seScpO1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBhbW91bnQgPSBhbW91bnQudG9TdHJpbmcgKCk7XG4gICAgICAgIHByaWNlID0gcHJpY2UudG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3RyYWRldHlwZSc6IHNpZGUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAndHJhZGVhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAndHJhZGVwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ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dC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlICh7ICdub25jZSc6IG5vbmNlIH0pO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHVybCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1x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Ghpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ29rY29pbnVzZCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdPS0NvaW4gVVNEJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdDTicsICdVUycgXSxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCwgLy8gdXAgdG8gMzAwMCByZXF1ZXN0cyBwZXIgNSBtaW51dGVzIOKJiCA2MDAgcmVxdWVzdHMgcGVyIG1pbnV0ZSDiiYggMTAgcmVxdWVzdHMgcGVyIHNlY29uZCDiiYggMTAwIG1zXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuZG8nLCAvLyBhcHBlbmRlZCB0byBlbmRwb2ludCBVUkxcbiAgICAgICAgICAgICdoYXNGdXR1cmVNYXJrZXRzJzogZmFsc2UsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW1pbicsXG4gICAgICAgICAgICAgICAgJzNtJzogJzNtaW4nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bWluJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bWluJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWhvdXInLFxuICAgICAgICAgICAgICAgICcyaCc6ICcyaG91cicsXG4gICAgICAgICAgICAgICAgJzRoJzogJzRob3VyJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmhvdXInLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJob3VyJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWRheScsXG4gICAgICAgICAgICAgICAgJzNkJzogJzNkYXknLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxd2VlaycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMvY3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy9wcm9kdWN0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZV9yYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9lc3RpbWF0ZWRfcHJpY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9ob2xkX2Ftb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2luZGV4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfa2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9wcmljZV9saW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ290Y3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50X3JlY29yZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhdGNoX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib3Jyb3dfbW9uZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd19vcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib3Jyb3dzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9ib3Jyb3cnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfYmF0Y2hfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9kZXZvbHZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfZXhwbG9zaXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfcG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9wb3NpdGlvbl80Zml4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV90cmFkZXNfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3VzZXJpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdXNlcmluZm9fNGZpeCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVuZF9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfZmVlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnNfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjX29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ290Y19vcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBheW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N1Ym1pdF9vdGNfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9vdGNfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bnJlcGF5bWVudHNfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njc5MS04OWZmYjUwMi01ZWU1LTExZTctOGE1Yi1jNTk1MGI2OGFjNjUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20vdjInLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5va2NvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS9yZXN0X2dldFN0YXJ0ZWQuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5ucG1qcy5jb20vcGFja2FnZS9va2NvaW4uY29tJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy53ZWJHZXRNYXJrZXRzUHJvZHVjdHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldHNbaV1bJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHVwcGVyY2FzZS5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRzW2ldWydtYXhTaXplRGlnaXQnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRzW2ldWydtYXhQcmljZURpZ2l0J10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0c1tpXSxcbiAgICAgICAgICAgICAgICAndHlwZSc6ICdzcG90JyxcbiAgICAgICAgICAgICAgICAnc3BvdCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2Z1dHVyZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldHNbaV1bJ21pblRyYWRlU2l6ZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG1hcmtldCk7XG4gICAgICAgICAgICBpZiAoKHRoaXMuaGFzRnV0dXJlTWFya2V0cykgJiYgKG1hcmtldFsncXVvdGUnXSA9PSAnVVNEVCcpKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kIChtYXJrZXQsIHtcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogJ1VTRCcsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2Jhc2UnXSArICcvVVNEJyxcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLnJlcGxhY2UgKCd1c2R0JywgJ3VzZCcpLFxuICAgICAgICAgICAgICAgICAgICAndHlwZSc6ICdmdXR1cmUnLFxuICAgICAgICAgICAgICAgICAgICAnc3BvdCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnZnV0dXJlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHVibGljR2V0JztcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobWFya2V0WydmdXR1cmUnXSkge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdGdXR1cmUnO1xuICAgICAgICAgICAgcmVxdWVzdFsnY29udHJhY3RfdHlwZSddID0gJ3RoaXNfd2Vlayc7IC8vIG5leHRfd2VlaywgcXVhcnRlclxuICAgICAgICB9XG4gICAgICAgIG1ldGhvZCArPSAnRGVwdGgnO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdiaWRzJzogb3JkZXJib29rWydiaWRzJ10sXG4gICAgICAgICAgICAnYXNrcyc6IHRoaXMuc29ydEJ5IChvcmRlcmJvb2tbJ2Fza3MnXSwgMCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd0aW1lc3RhbXAnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGV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1lc3RhbXAgfSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ2RhdGVfbXMnXSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodHJhZGVbJ2RhdGVfbXMnXSksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsncHJpY2UnXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAodHJhZGVbJ2Ftb3VudCddKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZ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tcbiAgICAgICAgICAgIG1ldGhvZCArPSAnRnV0dXJlJztcbiAgICAgICAgICAgIG9yZGVyID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgJ2NvbnRyYWN0X3R5cGUnOiAndGhpc193ZWVrJywgLy8gbmV4dF93ZWVrLCBxdWFydGVyXG4gICAgICAgICAgICAgICAgJ21hdGNoX3ByaWNlJzogMCwgLy8gbWF0Y2ggYmVzdCBjb3VudGVyIHBhcnR5IHByaWNlPyAwIG9yIDEsIGlnbm9yZXMgcHJpY2UgaWYgMVxuICAgICAgICAgICAgICAgICdsZXZlcl9yYXRlJzogMTAsIC8vIGxldmVyYWdlIHJhdGUgdmFsdWU6IDEwIG9yIDIwICgxMCBieSBkZWZhdWx0KVxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb3JkZXJbJ3R5cGUnXSArPSAnX21hcmtldCc7XG4gICAgICAgICAgICAgICAgaWYgKHNpZGUgPT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSB0aGlzLnNhZmVGbG9hdCAocGFyYW1zLCAnY29zdCcpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIW9yZGVyWydwcmljZSddKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIG1hcmtldCBidXkgb3JkZXJzIHJlcXVpcmUgYW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sbCcpKSB7XG4gICAgICAgICAgICAgICAgc2lkZSA9IG9yZGVyWyd0eXBlJ107XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdsaW1pdCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNpZGUgPSAob3JkZXJbJ3R5cGUnXSA9PSAnYnV5X21hcmtldCcpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdtYXJrZXQnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKG9yZGVyWydzdGF0dXMnXSk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICghbWFya2V0KSB7XG4gICAgICAgICAgICBpZiAoJ3N5bWJvbCcgaW4gb3JkZXIpXG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzeW1ib2wnXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtvcmRlclsnc3ltYm9sJ11dO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2NyZWF0ZV9kYXRlJyBpbiBvcmRlcilcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IG9yZGVyWydjcmVhdGVfZGF0ZSddO1xuICAgICAgICBsZXQgYW1vdW50ID0gb3JkZXJbJ2Ftb3VudCddO1xuICAgICAgICBsZXQgZmlsbGVkID0gb3JkZXJbJ2RlYWxfYW1vdW50J107XG4gICAgICAgIGxldCByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgIGxldCBhdmVyYWdlID0gb3JkZXJbJ2F2Z19wcmljZSddO1xuICAgICAgICBsZXQgY29zdCA9IGF2ZXJhZ2UgKiBmaWxsZWQ7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IG9yZGVyWydwcmljZSddLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBhdmVyYWdlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgaWYgKCFzeW1ib2wpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICdmZXRjaE9yZGVycyByZXF1aXJlcyBhIHN5bWJvbCBwYXJhbWV0ZXInKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKT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AgICAgJ2NvdW50cmllcyc6IFsgJ0ZSJywgJ0VVJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzkwNTY0LWE5NDVhOWQ0LTVmZjktMTFlNy05ZDJkLWI2MzU3NjNmMmYyNC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9wYXltaXVtLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cucGF5bWl1bS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vUGF5bWl1bS9hcGktZG9jdW1lbnRhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5wYXltaXVtLmNvbS9wYWdlL2RldmVsb3BlcnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvdW50cmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGF0YS97aWR9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGF0YS97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGF0YS97aWR9L2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2NoYXJ0cy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9jaGFydHMve2lkfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZXJjaGFudC9nZXRfcGF5bWVudC97VVVJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3Nlcy97YnRjX2FkZHJlc3N9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMve1VVSUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wYXltZW50X3JlcXVlc3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVyY2hhbnQvY3JlYXRlX3BheW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzL3tVVUlEfS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJpY2VfYWxlcnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdldXInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwNTksXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA1OSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBsb3dlcmNhc2UgPSBjdXJyZW5jeS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSAnYmFsYW5jZV8nICsgbG93ZXJjYXNlO1xuICAgICAgICAgICAgbGV0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gICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ByaWNlJyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndmFyaWF0aW9uJyksXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydjcmVhdGVkX2F0X2ludCddKSAqIDEwMDA7XG4gICAgICAgIGxldCB2b2x1bWUgPSAndHJhZGVkXycgKyBtYXJrZXRbJ2Jhc2UnXS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndXVpZCddLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQn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VzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsndXVpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ29yZGVyTnVtYmVyJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKy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XG4gICAgICAgICAgICAnaGFzRmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICc1bSc6IDMwMCxcbiAgICAgICAgICAgICAgICAnMTVtJzogOTAwLFxuICAgICAgICAgICAgICAgICczMG0nOiAxODAwLFxuICAgICAgICAgICAgICAgICcyaCc6IDcyMDAsXG4gICAgICAgICAgICAgICAgJzRoJzogMTQ0MDAsXG4gICAgICAgICAgICAgICAgJzFkJzogODY0MDAsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjgxNy1lOTQ1NjMxMi01ZWU2LTExZTctOWIzYy1iNjI4Y2E1NjI2YTUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vcG9sb25pZXguY29tL3B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vcG9sb25pZXguY29tL3RyYWRpbmdBcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3BvbG9uaWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vcG9sb25pZXguY29tL3N1cHBvcnQvYXBpLycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vcGFzdGViaW4uY29tL2RNWDdtWkUwJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vcG9sb25pZXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm4yNGhWb2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkNoYXJ0RGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQ3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuTG9hbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuT3JkZXJCb29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5UaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVyblRyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxMb2FuT2ZmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjbG9zZU1hcmdpblBvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVMb2FuT2ZmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dlbmVyYXRlTmV3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TWFyZ2luUG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJ1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luU2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW92ZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5BY3RpdmVMb2FucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQXZhaWxhYmxlQWNjb3VudEJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5CYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQ29tcGxldGVCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuRGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuRGVwb3NpdHNXaXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuRmVlSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuTGVuZGluZ0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk1hcmdpbkFjY291bnRTdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcGVuTG9hbk9mZmVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuT3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuT3JkZXJUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVyblRyYWRhYmxlQmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVyblRyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndG9nZ2xlQXV0b1JlbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlckJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMTUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzogMC4wLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAuMDAwMDAwMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IDEwMDAwMDAwMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAuMDAwMDAwMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY2FsY3VsYXRlRmVlIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UsIHRha2VyT3JNYWtlciA9ICd0YWtlcicsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgbGV0IGtleSA9ICdxdW90ZSc7XG4gICAgICAgIGxldCByYXRlID0gbWFya2V0W3Rha2VyT3JNYWtlcl07XG4gICAgICAgIGxldCBjb3N0ID0gcGFyc2VGbG9hdCAodGhpcy5jb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50ICogcmF0ZSkpO1xuICAgICAgICBpZiAoc2lkZSA9PSAnc2VsbCcpIHtcbiAgICAgICAgICAgIGNvc3QgKj0gcHJpY2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSAnYmFzZSc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICd0eXBlJzogdGFrZXJPck1ha2VyLFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWF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ldHNbaWRdO1xuICAgICAgICAgICAgbGV0IFsgcXVvdGUsIGJhc2UgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IHRoaXMubGltaXRzWydhbW91bnQnXVsnbWluJ10sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RSZXR1cm5Db21wbGV0ZUJhbGFuY2VzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2FjY291bnQnOiAnYWxsJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZXMpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2lkXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChpZCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ29uT3JkZXJzJ10pLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IDAuMCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEZlZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBmZWVzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVybkZlZUluZm8gKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IGZlZXMsXG4gICAgICAgICAgICAnbWFrZXInOiBwYXJzZUZsb2F0IChmZWVzWydtYWtlckZlZSddKSxcbiAgICAgICAgICAgICd0YWtlcic6IHBhcnNlRmxvYXQgKGZlZXNbJ3Rha2VyRmVlJ10pLFxuICAgICAgICAgICAgJ3dpdGhkcmF3JzogMC4wLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFJldHVybk9yZGVyQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vayk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoMjRociddKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvdzI0aHInXSksXG4gICAgICAgICAgICAnYml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gJ2Ftb3VudCc6IDgsIC8vIGRlZmF1bHQgcHJlY2lzaW9uLCB0b2RvOiBmaXggXCJtYWdpYyBjb25zdGFudHNcIlxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChjdXJyZW5jeVsnZGVsaXN0ZWQnXSA9PSAwKTtcbiAgICAgICAgICAgIGxldCBzdGF0dXMgPSAoY3VycmVuY3lbJ2Rpc2FibGVkJ10pID8gJ2Rpc2FibGVkJyA6ICdvayc7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ3R4RmVlJ10sIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5Wyd0eEZlZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRSZXR1cm5UaWNrZXIgKHBhcmFtcyk7XG4gICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW21hcmtldFsnaWQnXV07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4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gICAgICAgICAgICAgIGlmICh0eXBlb2YgY29zdCAhPSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCA9IGNvc3QgKiByYXRlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAndHJhZGVJRCcpLFxuICAgICAgICAgICAgJ29yZGVyJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyTnVtYmVyJyksXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsncmF0ZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pI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WYgKHNpbmNlKSB7XG4gICAgICAgICAgICByZXF1ZXN0WydzdGFydCddID0gcGFyc2VJbnQgKHNpbmNlIC8gMTAwMCk7XG4gICAgICAgICAgICByZXF1ZXN0WydlbmQnXSA9IHRoaXMuc2Vjb25kcyAoKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBsaW1pdCBpcyBkaXNhYmxlZCAoZG9lcyBub3QgcmVhbGx5IHdvcmsgYXMgZXhwZWN0ZWQpXG4gICAgICAgIC8vIGlmIChsaW1pdClcbiAgICAgICAgLy8gICAgIHJlcXVlc3RbJ2xpbWl0J10gPSBwYXJzZUludCAobGltaXQpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0UmV0dXJuVHJhZGVIaXN0b3J5ICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgcmVzdWx0ID0gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2UsIG1hcmtldCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlcyA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlW2lkXSwgbWFya2V0KTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0cmFkZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0cmFkZXNbal0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5zYWZlSW50ZWdlciAob3JkZXIsICd0aW1lc3RhbXAnKTtcbiAgICAgICAgaWYgKCF0aW1lc3RhbXApXG4gICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAob3JkZXJbJ2RhdGUnXSk7XG4gICAgICAgIGxldCB0cmFkZXMgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgncmVzdWx0aW5nVHJhZGVzJyBpbiBvcmRlcilcbiAgICAgICAgICAgIHRyYWRlcyA9IHRoaXMucGFyc2VUcmFkZXMgKG9yZGVyWydyZXN1bHRpbmdUcmFkZXMnXSwgbWFya2V0KTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBwcmljZSA9IHBhcnNlRmxvYXQgKG9yZGVyWydwcmljZSddKTtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0b3RhbCcsIDAuMCk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3N0YXJ0aW5nQW1vdW50JywgcmVtYWluaW5nKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnb3JkZXJOdW1iZXInXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogb3JkZXJbJ3N0YXR1cyddLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHRyYWRlcyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VPcGVuT3JkZXJzIChvcmRlcnMsIG1hcmtldCwgcmVzdWx0ID0gW10pIHtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvcmRlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBvcmRlciA9IG9yZGVyc1tpXTtcbiAgICAgICAgICAgIGxldCBleHRlbmRlZCA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgIC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kcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldElkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IG1hcmtldElkc1tpXTtcbiAgICAgICAgICAgICAgICBsZXQgb3JkZXJzID0gcmVzcG9uc2VbbWFya2V0SWRdO1xuICAgICAgICAgICAgICAgIGxldCBtID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgICAgICAgICBvcGVuT3JkZXJzID0gdGhpcy5wYXJzZU9wZW5PcmRlcnMgKG9yZGVycywgbSwgb3Blbk9yZGVycyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBvcGVuT3JkZXJzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICB0aGlzLm9yZGVyc1tvcGVuT3JkZXJzW2pdWydpZCddXSA9IG9wZW5PcmRlcnNbal07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG9wZW5PcmRlcnNJbmRleGVkQnlJZCA9IHRoaXMuaW5kZXhCeSAob3Blbk9yZGVycywgJ2lkJyk7XG4gICAgICAgIGxldCBjYWNoZWRPcmRlcklkcyA9IE9iamVjdC5rZXlzICh0aGlzLm9yZGVycyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBjYWNoZWRPcmRlcklkcy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY2FjaGVkT3JkZXJJZHNba107XG4gICAgICAgICAgICBpZiAoaWQgaW4gb3Blbk9yZGVyc0luZGV4ZWRCeUlkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gdGhpcy5leHRlbmQgKHRoaXMub3JkZXJzW2lkXSwgb3Blbk9yZGVyc0luZGV4ZWRCeUlkW2lkXSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBvcmRlciA9IHRoaXMub3JkZXJzW2lkXTtcbiAgICAgICAgICAgICAgICBpZiAob3JkZXJbJ3N0YXR1cyddID09ICdvcGVuJykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSB0aGlzLmV4dGVuZCAob3JkZXIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnY2xvc2VkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0Jzogb3JkZXJbJ2Ftb3VudCddICogb3JkZXJbJ3ByaWNlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlsbGVkJzogb3JkZXJbJ2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbWFpbmluZyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3ltYm9sJ10gPT0gc3ltYm9sKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAob3JkZXIpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAob3JkZXIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG9yZGVycyA9IGF3YWl0IHRoaXMuZmV0Y2hPcmRlcnMgKHN5bWJvbCwgcGFyYW1zKTtcbiAgICAgICAgZm9y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b25kcyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5wYXJzZU9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH0sIHJlc3BvbnNlKSwgbWFya2V0KTtcbiAgICAgICAgbGV0IGlkID0gb3JkZXJbJ2lkJ107XG4gICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IG9yZGVyO1xuICAgICAgICByZXR1cm4gdGhpcy5leHRlbmQgKHsgJ2luZm8nOiByZXNwb25zZSB9LCBvcmRlcik7XG4gICAgfVxuXG4gICAgYXN5bmMgZWRpdE9yZGVyIChpZCwgc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBwcmljZSA9IHBhcnNlRmxvYXQgKHByaWNlKTtcbiAgICAgICAgYW1vdW50ID0gcGFyc2VGbG9hdCAoYW1vdW50KTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnb3JkZXJOdW1iZXInOiBpZCxcbiAgICAgICAgICAgICdyYXRlJzogdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVB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5xcnlwdG9zLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5xcnlwdG9zLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2RldmVsb3BlcnMucXVvaW5lLmNvbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L3ByaWNlX2xldmVscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaXJfbGFkZGVycy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b19hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9ucy9tZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdF9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97aWR9L2xvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nX2FjY291bnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWF0X2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FuX2JpZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzL3tpZH0vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5zL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfS9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2Nsb3NlX2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZWRfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgbWFrZXIgPSBwYXJzZUZsb2F0IChtYXJrZXRbJ21ha2VyX2ZlZSddKTtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IHBhcnNlRmxvYXQgKG1hcmtldFsndGFrZXJfZmVlJ10pO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9ICFtYXJrZXRbJ2Rpc2FibGVkJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudHNCYWxhbmNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogdG90YWwsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzSWRQcmljZUxldmVscyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZ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kJ10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbWFya2V0X2JpZCddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ21hcmtldF9hc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lXzI0aCddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgdGlja2Vycy5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbdF07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRpY2tlclsnYmFzZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGlja2VyWydxdW90ZWRfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJvZHVjdHNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2NyZWF0ZWRfYXQnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy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0IHN0YXR1cyA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdzdGF0dXMnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICBpZiAob3JkZXJbJ3N0YXR1cyddID09ICdsaXZlJykge1xuICAgICAgICAgICAgICAgIHN0YXR1cyA9ICdvcGVuJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAob3JkZXJbJ3N0YXR1cyddID09ICdmaWxsZWQnKSB7XG4gICAgICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG9yZGVyWydzdGF0dXMnXSA9PSAnY2FuY2VsbGVkJykgeyAvLyAnbGwnIGludGVuZGVkXG4gICAgICAgICAgICAgICAgc3RhdHVzID0gJ2NhbmNlbGVkJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgYW1vdW50ID0gcGFyc2VGbG9hdCAob3JkZXJbJ3F1YW50aXR5J10pO1xuICAgICAgICBsZXQgZmlsbGVkID0gcGFyc2VGbG9hdCAob3JkZXJbJ2ZpbGxlZF9xdWFudGl0eSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ29yZGVyX3R5cGUnXSxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IG9yZGVyWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdma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blxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChjb2RlID09IDIwMCB8fCBjb2RlID09IDQwNCB8fCBjb2RlID09IDQyMikge1xuICAgICAgICAgICAgaWYgKChib2R5WzBdID09ICd7JykgfHwgKGJvZHlbMF0gPT0gJ1snKSkge1xuICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIGlmIG5vdCBhIEpTT04gcmVzcG9uc2VcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmV0dXJuZWQgYSBub24tSlNPTiByZXBseTogJyArIGJvZHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChjb2RlID09IDQwNCkge1xuICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddID09ICdPcmRlciBub3QgZm91bmQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKGNvZGUgPT0gNDIyKSB7XG4gICAgICAgICAgICBpZiAoJ2Vycm9ycycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgZXJyb3JzID0gcmVzcG9uc2VbJ2Vycm9ycyddO1xuICAgICAgICAgICAgICAgIGlmICgndXNlcicgaW4gZXJyb3JzKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlcyA9IGVycm9yc1sndXNlciddO1xuICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZXMuaW5kZXhPZiAoJ25vdF9lbm91Z2hfZnJlZV9iYWxhbmNlJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICdYLVF1b2luZS1BUEktVmVyc2lvbic6IHRoaXMudmVyc2lvbixcbiAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgICAgICdwYXRoJzogdXJsLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICd0b2tlbl9pZCc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdpYXQnOiBNYXRoLmZsb29yIChub25jZSAvIDEwMDApLCAvLyBpc3N1ZWQgYXRcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBoZWFkZXJzWydYLVF1b2luZS1BdXRoJ10gPSB0aGlzLmp3dCAocmVxdWVzdCwgdGhpcy5zZWNyZXQpO1xuICAgICAgICB9XG4gICAgICAgIHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxufVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc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kMGRlLTVlZTctMTFlNy05ZmE0LTM4ZTExYTJjNmY1Mi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkucXVhZHJpZ2FjeC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cucXVhZHJpZ2FjeC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cucXVhZHJpZ2FjeC5jb20vYXBpX2luZm8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd1aWQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoZXJfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9va3VwX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DQUQnOiB7ICdpZCc6ICdidGNfY2FkJywgJ3N5bWJvbCc6ICdCVEMvQ0FEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NBRCcsICdtYWtlcic6IDAuMDA1LCAndGFrZXInOiAwLjAwNSB9LFxuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnYnRjX3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAnbWFrZXInOiAwLjAwNSwgJ3Rha2VyJzogMC4wMDUgfSxcbiAgICAgICAgICAgICAgICAnRVRIL0JUQyc6IHsgJ2lkJzogJ2V0aF9idGMnLCAnc3ltYm9sJzogJ0VUSC9CVEMnLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnQlRDJywgJ21ha2VyJzogMC4wMDIsICd0YWtlcic6IDAuMDAyIH0sXG4gICAgICAgICAgICAgICAgJ0VUSC9DQUQnOiB7ICdpZCc6ICdldGhfY2FkJywgJ3N5bWJvbCc6ICdFVEgvQ0FEJywgJ2Jhc2UnOiAnRVRIJywgJ3F1b3RlJzogJ0NBRCcsICdtYWtlcic6IDAuMDA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gICAgICBsZXQgYmFzZVZvbHVtZSA9IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lJ10pO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSBiYXNlVm9sdW1lICogdndhcDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUg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bmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gWyBub25jZS50b1N0cmluZyAoKSwgdGhpcy51aWQsIHRoaXMuYXBpS2V5IF0uam9pbiAoJycpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHJlcXVlc3QpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSlcbiAgICAgIC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AgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4Mzg5MTItNGY5NGVjOGEtNjBmNi0xMWU3LTllNWQtYmJmOWJkNTBhNTU5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnNvdXRoeGNoYW5nZS5jb20vSG9tZS9BcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE1hcmtldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dlbmVyYXRlbmV3YWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdEJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFswXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsxXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgaWQgPSBzeW1ib2w7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IH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KGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcmljZVN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRyYWRlWydBdCddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ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QnOiBhbW91bnQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdIYXNoJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH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cblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICd0aGVyb2NrJyxcbiAgICAgICAgICAgICduYW1lJzogJ1RoZVJvY2tUcmFkaW5nJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnTVQnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODY5LTc1MDU3ZmEyLTVlZTktMTFlNy05YTZmLTEzZTY0MWZhNDcwNy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkudGhlcm9ja3RyYWRpbmcuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vdGhlcm9ja3RyYWRpbmcuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkudGhlcm9ja3RyYWRpbmcuY29tL2RvYy92MS9pbmRleC5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLnRoZXJvY2t0cmFkaW5nLmNvbS9kb2MvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy90aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkaXNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Rpc2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9uX2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vcG9zaXRpb25zL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2xpbWl0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19saW1pdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdG1zL3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9vcmRlcnMvcmVtb3ZlX2FsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0RnVuZHNUaWNrZXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sndGlja2VycyddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sndGlja2VycyddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydmdW5kX2lkJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBmcmVlID0gYmFsYW5jZVsndHJ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2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRGdW5kc0lkVGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydmdW5kX2lkJ11dO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydkYXRlJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxp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xuXG5jb25zdCBsaXF1aSA9IHJlcXVpcmUgKCcuL2xpcXVpLmpzJylcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgdGlkZXggZXh0ZW5kcyBsaXF1aSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAndGlkZXgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnVGlkZXgnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVSycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJzMnLFxuICAgICAgICAgICAgLy8gJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgIC8vICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDc4MTc4MC0wMzE0OWRjNC1hMTJlLTExZTctODJiYi0zMTNiMjY5ZDI0ZDQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLnRpZGV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS50aWRleC5jb20vdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vdGlkZXguY29tJyxcbiAgICAgICAgIC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B7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njg4MC1mMjA1ZTg3MC01ZWU5LTExZTctOGZlMi0wZDViMTU4ODA3NTIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLnZhdWx0b3JvLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy52YXVsdG9yby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hcGkudmF1bHRvcm8uY29tJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlkYW5kYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9ob3VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMvbW9udGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS97c3ltYm9sfS97dHlwZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3tzeW1ib2x9L3t0eXBlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1snZGF0YSddO1xuICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnTWFya2V0Q3VycmVuY3knXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2U7XG4gICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGU7XG4gICAgICAgIGxldCBpZCA9IG1hcmtldFsnTWFya2V0TmFtZSddO1xuICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICA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nXS5sZW5ndGg7XG4gICAgICAgIGxldCBiaWQgPSBxdW90ZVsnYmlkcyddW2JpZHNMZW5ndGggLSAxXTtcbiAgICAgICAgbGV0IGFzayA9IHF1b3RlWydhc2tzJ11bMF07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJzI0aEhpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWycyNGhMb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogYmlkWzBdLFxuICAgICAgICAgICAgJ2Fzayc6IGFza1swXSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnTGFzdFByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFz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mxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY4OTQtNmRhOWQzNjAtNWVlYS0xMWU3LTkwYWEtNDFmMjcxMWI3NDA1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwOi8vYXBpLnZpcndveC5jb20vYXBpL2pzb24ucGhwJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cudmlyd294LmNvbS9hcGkvdHJhZGluZy5waHAnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy52aXJ3b3guY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnZpcndveC5jb20vZGV2ZWxvcGVycy5waHAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnbG9naW4nOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWVcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJlc3RQcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdlc3RpbWF0ZU1hcmtldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFkZWRQcmljZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0UmF3VHJhZGVEYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUZXJtaW5hbExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRHcmlkU3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluc3RydW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRCZXN0UHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRNYXJrZXREZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXN0aW1hdGVNYXJrZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhZGVkUHJpY2VWb2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFJhd1RyYWRlRGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0U3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VGVybWluYWxMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRHcmlkTGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0R3JpZFN0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDb21taXNzaW9uRGlzY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDb21taXNzaW9uRGlzY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEluc3RydW1lbnRzICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzWydyZXN1bHQnXSk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncmVzdWx0J11ba2V5c1twXV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2luc3RydW1lbnRJRCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnbG9uZ0N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3Nob3J0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmVzdWx0J11bJ2FjY291bnRMaXN0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgdG90YWwgPSBiYWxhbmNlWydiYWxhbmNlJ107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHRvdGFsLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHRvdGFsLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldFByaWNlIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljUG9zdEdldEJlc3RQcmljZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9scyc6IFsgc3ltYm9sIF0sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0IChyZXN1bHRbMF0sICdiZXN0QnV5UHJpY2UnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAocmVzdWx0WzBdLCAnYmVzdFNlbGxQcmljZScpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljUG9zdEdldE1hcmtldERlcHRoICh0aGlzLmV4dGVuZCAoe1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dCAodGlja2VyWydsb25nVm9sdW1lJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWydzaG9ydFZvbHVtZSddKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wdWJsaWNHZXRSYXdUcmFkZURhdGEgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaW5zdHJ1bWVudCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0aW1lc3Bhbic6IDM2MDAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChtYXJrZXQsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdpbnN0cnVtZW50JzogdGhpcy5zeW1ib2wgKG1hcmtldCksXG4gICAgICAgICAgICAnb3JkZXJUeXBlJzogc2lkZS50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0UGxhY2VPcmRlciAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnb3JkZXJJRCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ29yZGVySUQnOiBpZCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBsZXQgYXV0aCA9IHt9O1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBhdXRoWydrZXknXSA9IHRoaXMuYXBpS2V5O1xuICAgICAgICAgICAgYXV0aFsndXNlciddID0gdGhpcy5sb2dpbjtcbiAgICAgICAgICAgIGF1dGhbJ3Bhc3MnXSA9IHRoaXMucGFzc3dvcmQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgdXJsICs9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VmMDNlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3dleC5uei9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3dleC5uei90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93ZXgubnonLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3dleC5uei9hcGkvMy9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd2V4Lm56L3RhcGkvZG9jcycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWN0aXZlT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYW5zSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ29pbkRlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NyZWF0ZUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVkZWVtQ291cG9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3VwZGF0ZWQnXSAqIDEwMDA7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJ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GFuZ2VFcnJvciAodGhpcy5pZCArICcgcmV0dXJuZWQgYSBub24tSlNPTiByZXBseTogJyArIGJvZHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBlcnJvciA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhIG1hbGZvcm1lZCBlcnJvcjogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09ICdiYWQgc3RhdHVzJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnICcgKyBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IuaW5kZXhPZiAoJ0l0IGlzIG5vdCBlbm91Z2gnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gJ1JlcXVlc3RzIHRvbyBvZnRlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAnbm90IGF2YWlsYWJsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAnZXh0ZXJuYWwgc2VydmljZSB1bmF2YWlsYWJsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gdGhhdCdzIHdoYXQgZmV0Y2hPcGVuT3JkZXJzIHJldHVybiBpZiBubyBvcGVuIG9yZGVycyAoZml4IGZvciAjNDg5KVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yICE9ICdubyBvcmRlcnMnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG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cGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9jcnlwdG90dGxpdmV3ZWJhcGkueGJ0Y2UubmV0Ojg0NDMvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnhidGNlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LnhidGNlLmNvbS90cmFkZWFwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQueGJ0Y2UuaW5mby9Lbm93bGVkZ2ViYXNlL0FydGljbGUvVmlldy81Mi8yNS94YnRjZS1leGNoYW5nZS1hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeS97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXZlbDIve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2JpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3RpY2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbC97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljay97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc2Vzc2lvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNlcnZlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc2Vzc2lvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMi97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2sve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzc2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhc3NldC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24ve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2Fzay9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2JpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9iaWQvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L2xldmVsMi9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vcGVyaW9kaWNpdGllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3RpY2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L2NhY2hlL3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvY2FjaGUve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvY2FjaGUve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9zeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvdmVyc2lvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0U3ltYm9sICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ1N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ01hcmdpbkN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ1Byb2ZpdEN1cnJlbmN5J107XG4gICAgICAgICAgICBpZiAoYmFzZSA9PSAnRFNIJylcbiAgICAgICAgICAgICAgICBiYXNlID0gJ0RBU0gnO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnSXNUcmFkZUFsbG93ZWQnXSA/IHN5bWJvbCA6IGlkO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBc3NldCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIC8vIHhidGNlIG5hbWVzIERBU0ggaW5jb3JyZWN0bHkgYXMgRFNIXG4gICAgICAgICAgICBpZiAodXBwZXJjYXNlID09ICdEU0gnKVxuICAgICAgICAgICAgICAgIHVwcGVyY2FzZSA9ICdEQVNIJztcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnRnJlZUFtb3VudCddLFxuICAgICAgICAgICAgICAgICd1c2VkJzogYmFsYW5jZVsnTG9ja2VkQW1vdW50J10sXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZVsnQW1vdW50J10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRMZXZlbDJGaWx0ZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnZmlsdGVyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgb3JkZXJib29rID0gb3JkZXJib29rWzBdO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gb3JkZXJib29rWydUaW1lc3RhbXAnXTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdGltZXN0YW1wLCAnQmlkcycsICdBc2tzJywgJ1ByaWNlJywgJ1ZvbHVtZScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gMDtcbiAgICAgICAgbGV0IGxhc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnTGFzdEJ1eVRpbWVzdGFtcCcgaW4gdGlja2VyKVxuICAgICAgICAgICAgaWYgKHRpbWVzdGFtcCA8IHRpY2tlclsnTGFzdEJ1eVRpbWVzdGFtcCddKSB7XG4gICAgICAgICAgICAgICAgdGltZXN0YW1wID0gdGlja2VyWydMYXN0QnV5VGltZXN0YW1wJ107XG4gICAgICAgICAgICAgICAgbGFzdCA9IHRpY2tlclsnTGFzdEJ1eVByaWNlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgIGlmICgnTGFzdFNlbGxUaW1lc3RhbXAnIGluIHRpY2tlcilcbiAgICAgICAgICAgIGlmICh0aW1lc3RhbXAgPCB0aWNrZXJbJ0xhc3RTZWxsVGltZXN0YW1wJ10pIHtcbiAgICAgICAgICAgICAgICB0aW1lc3RhbXAgPSB0aWNrZXJbJ0xhc3RTZWxsVGltZXN0YW1wJ107XG4gICAgICAgICAgICAgICAgbGFzdCA9IHRpY2tlclsnTGFzdFNlbGxQcmljZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICBpZiAoIXRpbWVzdGFtcClcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aWNrZXJbJ0RhaWx5QmVzdEJ1eVByaWNlJ10sXG4gICAgICAgICAgICAnbG93JzogdGlja2VyWydEYWlseUJlc3RTZWxsUHJpY2UnXSxcbiAgICAgICAgICAgICdiaWQnOiB0aWNrZXJbJ0Jlc3RCaWQnXSxcbiAgICAgICAgICAgICdhc2snOiB0aWNrZXJbJ0Jlc3RBc2snXSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGlja2VyWydEYWlseVRyYWRlZFRvdGFsVm9sdW1lJ10sXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHBhcmFtcyk7XG4gICAgICAgIHRpY2tlcnMgPSB0aGlzLmluZGV4QnkgKHRpY2tlcnMsICdTeW1ib2wnKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICAgICAgaWYgKGJhc2UgPT0gJ0RTSCcpXG4gICAgICAgICAgICAgICAgICAgIGJhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICAgICAgaWYgKHF1b3RlID09ICdEU0gnKVxuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAg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RpbmcsIHRoZWlyIHB1YmxpYyBBUEkgaXMgYWx3YXlzIGJ1c3knKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb247XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpXG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgYXBpO1xuICAgICAgICB1cmwgKz0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0FjY2VwdC1FbmNvZGluZyc6ICdnemlwLCBkZWZsYXRlJyB9O1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnNbJ0NvbnRlbnQtVHlwZSddID0gJ2FwcGxpY2F0aW9uL2pzb24nO1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgd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V0JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnlvYml0Lm5ldC9lbi9hcGkvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0NvaW5zVG9BZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IDAuMCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgbGV0IHN1YnN0aXR1dGlvbnMgPSB7XG4gICAgICAgICAgICAnQUlSJzogJ0FpckNvaW4nLFxuICAgICAgICAgICAgJ0FOSSc6ICdBTklDb2luJyxcbiAgICAgICAgICAgICdBTlQnOiAnQW50c0NvaW4nLFxuICAgICAgICAgICAgJ0FUTSc6ICdBdXR1bW5jb2luJyxcbiAgICAgICAgICAgICdCQ0MnOiAnQkNIJyxcbiAgICAgICAgICAgICdCVFMnOiAnQml0c2hhcmVzMicsXG4gICAgICAgICAgICAnRENUJzogJ0Rpc2NvdW50JyxcbiAgICAgICAgICAgICdER0QnOiAnRGFya0dvbGRDb2luJyxcbiAgICAgICAgICAgICdJQ04nOiAnaUNvaW4nLFxuICAgICAgICAgICAgJ0xJWkknOiAnTGlaaScsXG4gICAgICAgICAgICAnTFVOJzogJ0x1bmFyQ29pbicsXG4gICAgICAgICAgICAnTkFWJzogJ05hdmFqb0NvaW4nLFxuICAgICAgICAgICAgJ09NRyc6ICdPTUdhbWUnLFxuICAgICAgICAgICAgJ1BBWSc6ICdFUEFZJyxcbiAgICAgICAgICAgICdSRVAnOiAnUmVwdWJsaWNvaW4nLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoY3VycmVuY3kgaW4gc3Vic3RpdHV0aW9ucylcbiAgICAgICAgICAgIHJldHVybiBzdWJzdGl0dXRpb25zW2N1cnJlbmN5XTtcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGN1cnJlbmN5SWQgKGNvbW1vbkNvZGUpIHtcbiAgICAgICAgbGV0IHN1YnN0aXR1dGlvbnMgPSB7XG4gICAgICAgICAgICAnQWlyQ29pbic6ICdBSVInLFxuICAgICAgICAgICAgJ0FOSUNvaW4nOiAnQU5JJyxcbiAgICAgICAgICAgICdBbnRzQ29pbic6ICdBTlQnLFxuICAgICAgICAgICAgJ0F1dHVtbmNvaW4nOiAnQVRNJyxcbiAgICAgICAgICAgICdCQ0gnOiAnQkNDJyxcbiAgICAgICAgICAgICdCaXRzaGFyZXMyJzogJ0JUUycsXG4gICAgICAgICAgICAnRGlzY291bnQnOiAnRENUJyxcbiAgICAgICAgICAgICdEYXJrR29sZENvaW4nOiAnREdEJyxcbiAgICAgICAgICAgICdpQ29pbic6ICdJQ04nLFxuICAgICAgICAgICAgJ0xpWmknOiAnTElaSScsXG4gICAgICAgICAgICAnTHVuYXJDb2luJzogJ0xVTicsXG4gICAgICAgICAgICAnTmF2YWpvQ29pbic6ICdOQVYnLFxuICAgICAgICAgICAgJ09NR2FtZSc6ICdPTUcnLFxuICAgICAgICAgICAgJ0VQQVknOiAnUEFZJyxcbiAgICAgICAgICAgICdSZXB1YmxpY29pbic6ICdSRVAnLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoY29tbW9uQ29kZSBpbiBzdWJzdGl0dXRpb25zKVxuICAgICAgICAgICAgcmV0dXJuIHN1YnN0aXR1dGlvbnNbY29tbW9uQ29kZV07XG4gICAgICAgIHJldHVybiBjb21tb25Db2RlO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXR1cm4nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgc2lkZXMgPSB7ICdmcmVlJzogJ2Z1bmRzJywgJ3RvdGFsJzogJ2Z1bmRzX2luY2xfb3JkZXJzJyB9O1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChzaWRlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGtleSA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgc2lkZSA9IHNpZGVzW2tleV07XG4gICAgICAgICAgICBpZiAoc2lkZSBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzW3NpZGVdKTtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGN1cnJlbmNpZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxvd2VyY2FzZSA9IGN1cnJlbmNpZXNbal07XG4gICAgICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBsb3dlcmNhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1cHBlcmNhc2UpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIHJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3VudCA9IHJlc3VsdFtjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRba2V5XSA9IGJhbGFuY2VzW3NpZGVdW2xvd2VyY2FzZV07XG4gICAgICAgICAgICAgICAgICAgIGlmIChhY2NvdW50Wyd0b3RhbCddICYmIGFjY291bnRbJ2ZyZWUnXSlcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlRGVwb3NpdEFkZHJlc3MgKGN1cnJlbmN5LCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoRGVwb3NpdEFkZHJlc3MgKGN1cnJlbmN5LCB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ25lZWRfbmV3JzogMSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICdhZGRyZXNzJzogcmVzcG9uc2VbJ2FkZHJlc3MnXSxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZVsnaW5mbyddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoRGVwb3NpdEFkZHJlc3MgKGN1cnJlbmN5LCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY3lJZCA9IHRoaXMuY3VycmVuY3lJZCAoY3VycmVuY3kpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdjb2luTmFtZSc6IGN1cnJlbmN5SWQsXG4gICAgIC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ICc1bSc6ICc1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjAnLFxuICAgICAgICAgICAgICAgICcyaCc6ICcxMjAnLFxuICAgICAgICAgICAgICAgICc0aCc6ICcyNDAnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnNzIwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMTQ0MCcsXG4gICAgICAgICAgICAgICAgJzNkJzogJzQzMjAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxMDA4MCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODU3MDU0OC00ZDY0NmM0MC03MTQ3LTExZTctOWNmNi04MzliOTNlNmQ2MjIuanBnJyxcbiAgICAgICAgICAgICAgICAnZXh0ZW5zaW9uJzogJy5qc29uJywgLy8gZGVmYXVsdCBleHRlbnNpb24gYXBwZW5kZWQgdG8gZW5kcG9pbnQgVVJMc1xuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly95dW5iaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly95dW5iaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3l1bmJpLmNvbS9kb2N1bWVudHMvYXBpL2d1aWRlJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8veXVuYmkuY29tL3N3YWdnZXIvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrX3dpdGhfcGVuZGluZ190cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWRkcmVzc2VzL3thZGRyZXNzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFydG5lcnMvb3JkZXJzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZW1iZXJzL21lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9teScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RlbGV0ZScsXG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biAgICAgICAgICAgICdoYXNGZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjkyNy0zOWNhMmFkYS01ZWViLTExZTctOTcyZi0xYjQxOTk1MThjYTYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLnphaWYuanAnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly96YWlmLmpwJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cDovL3RlY2hidXJlYXUtYXBpLWRvY3VtZW50LnJlYWR0aGVkb2NzLmlvL2phL2xhdGVzdC9pbmRleC5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY29ycC56YWlmLmpwL2FwaS1kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY29ycC56YWlmLmpwL2FwaS1kb2NzL2FwaV9saW5rcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5ucG1qcy5jb20vcGFja2FnZS96YWlmLmpwJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS95b3UyMTk3OS9ub2RlLXphaWYnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeV9wYWlycy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXJzL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZV9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfaWRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9pbmZvMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X3BlcnNvbmFsX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZWNhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZUludm9pY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEludm9pY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEludm9pY2VJZHNCeU9yZGVyTnVtYmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxJbnZvaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0bGFwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X3Bvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb25faGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlX3Bvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjaGFuZ2VfcG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZmFwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdncm91cHMve2dyb3VwX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZS97Z3JvdXBfaWR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tncm91cF9pZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3tncm91cF9pZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEN1cnJlbmN5UGFpcnNBbGwgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnY3VycmVuY3lfcGFpciddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXR1cm4nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlc1snZnVuZHMnXSk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbJ2Z1bmRzJ11bY3VycmVuY3ldO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKCdkZXBvc2l0JyBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlc1snZGVwb3NpdCddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBiYWxhbmNlc1snZGVwb3NpdCddW2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERlcHRoUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2spO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlclBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCB2d2FwID0gdGlja2VyWyd2d2FwJ107XG4gICAgICAgIGxldCBiYXNlVm9sdW1lID0gdGlja2VyWyd2b2x1bWUnXTtcbiAgICAgICAgbGV0IHF1b3RlVm9sdW1lID0gYmFzZVZvbHVtZSAqIHZ3YXA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyWydoaWdoJ10sXG4gICAgICAgICAgICAnbG93JzogdGlja2VyWydsb3cnXSxcbiAgICAgICAgICAgICdiaWQnOiB0aWNrZXJbJ2JpZCddLFxuICAgICAgICAgICAgJ2Fzayc6IHRpY2tlclsnYXNrJ10sXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGlja2VyWydsYXN0J10sXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsndHJhZGVfdHlwZSddID09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdpZCcpO1xuICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnLCBpZCk7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdX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aXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGlmICh0eXBlID09ICdtYXJrZXQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGFsbG93cyBsaW1pdCBvcmRlcnMgb25seScpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3lfcGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnYWN0aW9uJzogKHNpZGUgPT0gJ2J1eScpID8gJ2JpZCcgOiAnYXNrJyxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ3JldHVybiddWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ29yZGVyX2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNpZGUgPSAob3JkZXJbJ2FjdGlvbiddID09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyWyd0aW1lc3RhbXAnXSkgKiAxMDAwO1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtvcmRlclsnY3VycmVuY3lfcGFpciddXTtcbiAgICAgICAgbGV0IHByaWNlID0gb3JkZXJbJ3ByaWNlJ107XG4gICAgICAgIGxldCBhbW91bnQgPSBvcmRlclsnYW1vdW50J107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVycyAob3JkZXJzLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChvcmRlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAg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lzLnZlcnNpb24gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSBpZiAoYXBpID09ICdmYXBpJykge1xuICAgICAgICAgICAgdXJsICs9ICdmYXBpLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGlmIChhcGkgPT0gJ2VjYXBpJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAnZWNhcGknO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ3RsYXBpJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAndGxhcGknO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJ3RhcGknO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICA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blxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIHpiIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3piJyxcbiAgICAgICAgICAgICduYW1lJzogJ1pCJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMjg1OTE4Ny1jZDUyMTRmMC1jYTVlLTExZTctOTY3ZC05NjU2OGUyZTJiZDEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHA6Ly9hcGkuemIuY29tL2RhdGEnLCAvLyBubyBodHRwcyBmb3IgcHVibGljIEFQSVxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3RyYWRlLnpiLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RyYWRlLnpiLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuemIuY29tL2kvZGV2ZWxvcGVyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnNOZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVyc0lnbm9yZVRyYWRlVHlwZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VW5maW5pc2hlZE9yZGVyc0lnbm9yZVRyYWRlVHlwZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFVzZXJBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRXaXRoZHJhd0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFdpdGhkcmF3UmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd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ICAgfTtcbiAgICAgICAgaWYgKGJhc2UgaW4gZmVlcykge1xuICAgICAgICAgICAgbGV0IHF1b3RlRmVlcyA9IGZlZXNbYmFzZV07XG4gICAgICAgICAgICBpZiAocXVvdGUgaW4gcXVvdGVGZWVzKVxuICAgICAgICAgICAgICAgIHJldHVybiBxdW90ZUZlZXNbcXVvdGVdO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBmZWUgPSB0aGlzLmdldFRyYWRpbmdGZWVGcm9tQmFzZVF1b3RlIChiYXNlLCBxdW90ZSk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRbJ2Ftb3VudFNjYWxlJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZVNjYWxlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBmZWUsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogZmVlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QWNjb3VudEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlc1snYmFsYW5jZSddKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VzWydiYWxhbmNlJ11bY3VycmVuY3ldWydhbW91bnQnXSk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZXNbJ2Zyb3plbiddKVxuICA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y8nICsgcGF0aDtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgcGFyYW1zTGVuZ3RoID0gcGFyYW1zLmxlbmd0aDsgLy8gcGFyYW1zIHNob3VsZCBiZSBhIHN0cmluZyBoZXJlXG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnbWV0aG9kPScgKyBwYXRoO1xuICAgICAgICAgICAgYXV0aCArPSAnJmFjY2Vzc2tleT0nICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBhdXRoICs9IHBhcmFtc0xlbmd0aCA/IHBhcmFtcyA6ICcnO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTEnKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHNlY3JldCksICdtZDUnKTtcbiAgICAgICAgICAgIGxldCBzdWZmaXggPSAnc2lnbj0nICsgc2lnbmF0dXJlICsgJyZyZXFUaW1lPScgKyBub25jZS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyBwYXRoICsgJz8nICsgYXV0aCArICcmJyArIHN1ZmZpeDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbl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gICBkW2ldID0gKGkgPDwgMSkgXiAweDExYjtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIFdhbGsgR0YoMl44KVxuXHQgICAgICAgIHZhciB4ID0gMDtcblx0ICAgICAgICB2YXIgeGkgPSAwO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBzYm94XG5cdCAgICAgICAgICAgIHZhciBzeCA9IHhpIF4gKHhpIDw8IDEpIF4gKHhpIDw8IDIpIF4gKHhpIDw8IDMpIF4gKHhpIDw8IDQpO1xuXHQgICAgICAgICAgICBzeCA9IChzeCA+Pj4gOCkgXiAoc3ggJiAweGZmKSBeIDB4NjM7XG5cdCAgICAgICAgICAgIFNCT1hbeF0gPSBzeDtcblx0ICAgICAgICAgICAgSU5WX1NCT1hbc3hdID0geDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIG11bHRpcGxpY2F0aW9uXG5cdCAgICAgICAgICAgIHZhciB4MiA9IGRbeF07XG5cdCAgICAgICAgICAgIHZhciB4NCA9IGRbeDJdO1xuXHQgICAgICAgICAgICB2YXIgeDggPSBkW3g0XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIHN1YiBieXRlcywgbWl4IGNvbHVtbnMgdGFibGVzXG5cdCAgICAgICAgICAgIHZhciB0ID0gKGRbc3hdICogMHgxMDEpIF4gKHN4ICogMHgxMDEwMTAwKTtcblx0ICAgICAgICAgICAgU1VCX01JWF8wW3hdID0gKHQgPDwgMjQpIHwgKHQgPj4+IDgpO1xuXHQgICAgICAgICAgICBTVUJfTUlYXzFbeF0gPSAodCA8PCAxNikgfCAodCA+Pj4gMTYpO1xuXHQgICAgICAgICAgICBTVUJfTUlYXzJbeF0gPSAodCA8PCA4KSAgfCAodCA+Pj4gMjQpO1xuXHQgICAgICAgICAgICBTVUJfTUlYXzNbeF0gPSB0O1xuXG5c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aGVyLmV4dGVuZCh7XG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gU2tpcCByZXNldCBvZiBuUm91bmRzIGhhcyBiZWVuIHNldCBiZWZvcmUgYW5kIGtleSBkaWQgbm90IGNoYW5nZVxuXHQgICAgICAgICAgICBpZiAodGhpcy5fblJvdW5kcyAmJiB0aGlzLl9rZXlQcmlvclJlc2V0ID09PSB0aGlzLl9rZXkpIHtcblx0ICAgICAgICAgICAgICAgIHJldHVybjtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIga2V5ID0gdGhpcy5fa2V5UHJpb3JSZXNldCA9IHRoaXMuX2tleTtcblx0ICAgICAgICAgICAgdmFyIGtleVdvcmRzID0ga2V5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIga2V5U2l6ZSA9IGtleS5zaWdCeXRlcyAvIDQ7XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBudW1iZXIgb2Ygcm91bmRzXG5cdCAgICAgICAgICAgIHZhciBuUm91bmRzID0gdGhpcy5fblJvdW5kcyA9IGtleVNpemUgKyA2O1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGUgbnVtYmVyIG9mIGtleSBzY2hlZHVsZSByb3dzXG5cdCAgICAgICAgICAgIHZhciBrc1Jvd3MgPSAoblJvdW5kcyArIDEpICogNDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGtleSBzY2hlZHVsZVxuXHQgICAgICAgICAgICB2YXIga2V5U2NoZWR1bGUgPSB0aGlzLl9rZXlTY2hlZHVsZSA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBrc1JvdyA9IDA7IGtzUm93IDwga3NSb3dzOyBrc1JvdysrKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoa3NSb3cgPCBrZXlTaXplKSB7XG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5V29yZHNba3NSb3ddO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93IC0gMV07XG5cblx0ICAgICAgICAgICAgICAgICAgICBpZiAoIShrc1JvdyAlIGtleVNpemUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJvdCB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAodCA8PCA4KSB8ICh0ID4+PiAyNCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3ViIHdvcmRcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdCA9IChTQk9YW3QgPj4+IDI0XSA8PCAyNCkgfCAoU0JPWFsodCA+Pj4gMTYpICYgMHhmZl0gPDwgMTYpIHwgKFNCT1hbKHQgPj4+IDgpICYgMHhmZl0gPDwgOCkgfCBTQk9YW3QgJiAweGZmXTtcblxuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBNaXggUmNvblxuXHQgICAgICAgICAgICAgICAgICAgICAgICB0IF49IFJDT05bKGtzUm93IC8ga2V5U2l6ZSkgfCAwXSA8PCAyNDtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleVNpemUgPiA2ICYmIGtzUm93ICUga2V5U2l6ZSA9PSA0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN1YiB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoU0JPWFt0ID4+PiAyNF0gPDwgMjQpIHwgKFNCT1hbKHQgPj4+IDE2KSAmIDB4ZmZdIDw8IDE2KSB8IChTQk9YWyh0ID4+PiA4KSAmIDB4ZmZdIDw8IDgpIHwgU0JPWFt0ICYgMHhmZl07XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5U2NoZWR1bGVba3NSb3cgLSBrZXlTaXplXSBeIHQ7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGludiBrZXkgc2NoZWR1bGVcblx0ICAgICAgICAgICAgdmFyIGludktleVNjaGVkdWxlID0gdGhpcy5faW52S2V5U2NoZWR1bGUgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaW52S3NSb3cgPSAwOyBpbnZLc1JvdyA8IGtzUm93czsgaW52S3NSb3crKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGtzUm93ID0ga3NSb3dzIC0gaW52S3NSb3c7XG5cblx0ICAgICAgICAgICAgICAgIGlmIChpbnZLc1JvdyAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93XTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBrZXlTY2hlZHVsZVtrc1JvdyAtIDRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICBpZiAoaW52S3NSb3cgPCA0IHx8IGtzUm93IDw9IDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBpbnZLZXlTY2hlZHVsZVtpbnZLc1Jvd10gPSB0O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICBpbnZLZXlTY2hlZHVsZVtpbnZLc1Jvd10gPSBJTlZfU1VCX01JWF8wW1NCT1hbdCA+Pj4gMjRdXSBeIElOVl9TVUJfTUlYXzFbU0JPWFsodCA+Pj4gMTYpICYgMHhmZl1dIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJTlZfU1VCX01JWF8yW1NCT1hbKHQgPj4+IDgpICYgMHhmZl1dIF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YXNlZENpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNlcmlhbGl6YWJsZUNpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoY2lwaGVyKSB7XG5cdCAgICAgICAgICAgICAgICByZXR1cm4ge1xuXHQgICAgICAgICAgICAgICAgICAgIGVuY3J5cHQ6IGZ1bmN0aW9uIChtZXNzYWdlLCBrZXksIGNmZykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0Q2lwaGVyU3RyYXRlZ3koa2V5KS5lbmNyeXB0KGNpcGhlciwgbWVzc2FnZSwga2V5LCBjZmcpO1xuXHQgICAgICAgICAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgICAgICAgICBkZWNyeXB0OiBmdW5jdGlvbiAoY2lwaGVydGV4dCwga2V5LCBjZmcpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGVjdENpcGhlclN0cmF0ZWd5KGtleSkuZGVjcnlwdChjaXBoZXIsIGNpcGhlcnRleHQsIGtleSwgY2ZnKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9O1xuXHQgICAgICAgICAgICB9O1xuXHQgICAgICAgIH0oKSlcblx0ICAgIH0pO1xuXG5cdCAgICAvKipcblx0ICAgICAqIEFic3RyYWN0IGJhc2Ugc3RyZWFtIGNpcGhlciB0ZW1wbGF0ZS5cblx0ICAgICAqXG5cdCAgICAgKiBAcHJvcGVydHkge251bWJlcn0gYmxvY2tTaXplIFRoZSBudW1iZXIgb2YgMzItYml0IHdvcmRzIHRoaXMgY2lwaGVyIG9wZXJhdGVzIG9uLiBEZWZhdWx0OiAxICgzMiBiaXRzKVxuXHQgICAgICovXG5cdCAgICB2YXIgU3RyZWF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oZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFhPUiBhbmQgZW5jcnlwdFxuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXHQgICAgICAgICAgICAgICAgY2lwaGVyLmVuY3J5cHRCbG9jayh3b3Jkcywgb2Zmc2V0KTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtZW1iZXIgdGhpcyBibG9jayB0byB1c2Ugd2l0aCBuZXh0IGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB3b3Jkcy5zbGljZShvZmZzZXQsIG9mZnNldCArIGJsb2NrU2l6ZSk7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENCQyBkZWNyeXB0b3IuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgQ0JDLkRlY3J5cHRvciA9IENCQy5leHRlbmQoe1xuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogUHJvY2Vzc2VzIHRoZSBkYXRhIGJsb2NrIGF0IG9mZnNldC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbWVtYmVyIHRoaXMgYmxvY2sgdG8gdXNlIHdpdGggbmV4dCBibG9ja1xuXHQgICAgICAgICAgICAgICAgdmFyIHRoaXNCbG9jayA9IHdvcmRzLnNsaWNlKG9mZnNldCwgb2Zmc2V0ICsgYmxvY2tTaXplKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRGVjcnlwdCBhbmQgWE9SXG5cdCAgICAgICAgICAgICAgICBjaXBoZXIuZGVjcnlwdEJsb2NrKHdvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBUaGlzIGJsb2NrIGJlY29tZXMgdGhlIHByZXZpb3VzIGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB0aGlzQmxvY2s7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIGZ1bmN0aW9uIHhvckJsb2NrKHdvcmRzLCBvZmZzZXQsIGJsb2NrU2l6ZSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgaXYgPSB0aGlzLl9pdjtcblxuXHQgICAgICAgICAgICAvLyBDaG9vc2UgbWl4aW5nIGJsb2NrXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaXY7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbW92ZSBJViBmb3Igc3Vic2VxdWVudCBibG9ja3Ncblx0ICAgICAgICAgICAgICAgIHRoaXMuX2l2ID0gdW5kZWZpbmVkO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gdGhpcy5fcHJldkJsb2NrO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gWE9SIGJsb2Nrc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGJsb2NrU2l6ZTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tvZmZzZXQgKyBpXSBePSBibG9ja1tpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIHJldHVybiBDQkM7XG5cdCAgICB9KCkpO1xuXG5cdCAgICAvKipcblx0ICAgICAqIFBhZGRpbmcgbmFtZXNwYWNlLlxuXHQgICAgICovXG5cdCAgICB2YXIgQ19wYWQgPSBDLnBhZCA9IHt9O1xuXG5cdCAgICAvKipcblx0ICAgICAqIFBLQ1MgIzUvNyBwYWRkaW5nIHN0cmF0ZWd5LlxuX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csXG5cdCAgICAgICAgICogICAgICAgICBibG9ja1NpemU6IDQsXG5cdCAgICAgICAgICogICAgICAgICBmb3JtYXR0ZXI6IENyeXB0b0pTLmZvcm1hdC5PcGVuU1NMXG5cdCAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uIChjaXBoZXJQYXJhbXMpIHtcblx0ICAgICAgICAgICAgdGhpcy5taXhJbihjaXBoZXJQYXJhbXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyB0aGlzIGNpcGhlciBwYXJhbXMgb2JqZWN0IHRvIGEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtGb3JtYXR9IGZvcm1hdHRlciAoT3B0aW9uYWwpIFRoZSBmb3JtYXR0aW5nIHN0cmF0ZWd5IHRvIHVzZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIGNpcGhlciBwYXJhbXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAdGhyb3dzIEVycm9yIElmIG5laXRoZXIgdGhlIGZvcm1hdHRlciBub3IgdGhlIGRlZmF1bHQgZm9ybWF0dGVyIGlzIHNldC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IGNpcGhlclBhcmFtcyArICcnO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0gY2lwaGVyUGFyYW1zLnRvU3RyaW5nKCk7XG5cdCAgICAgICAgICogICAgIHZhciBzdHJpbmcgPSBjaXBoZXJQYXJhbXMudG9TdHJpbmcoQ3J5cHRvSlMuZm9ybWF0Lk9wZW5TU0wpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIH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hbCBpbmhlcml0YW5jZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEJhc2UgPSBDX2xpYi5CYXNlID0gKGZ1bmN0aW9uICgpIHtcblxuXG5cdCAgICAgICAgcmV0dXJuIHtcblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBuZXcgb2JqZWN0IHRoYXQgaW5oZXJpdHMgZnJvbSB0aGlzIG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IG92ZXJyaWRlcyBQcm9wZXJ0aWVzIHRvIGNvcHkgaW50byB0aGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHJldHVybiB7T2JqZWN0fSBUaGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgdmFyIE15VHlwZSA9IENyeXB0b0pTLmxpYi5CYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgZmllbGQ6ICd2YWx1ZScsXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICAgICAgbWV0aG9kOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgfVxuXHQgICAgICAgICAgICAgKiAgICAgfSk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBleHRlbmQ6IGZ1bmN0aW9uIChvdmVycmlkZXMpIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNwYXduXG5cdCAgICAgICAgICAgICAgICB2YXIgc3VidHlwZSA9IGNyZWF0ZSh0aGlzKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gQXVnbWVudFxuXHQgICAgICAgICAgICAgICAgaWYgKG92ZXJyaWRlcykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YnR5cGUubWl4SW4ob3ZlcnJpZGVzKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGRlZmF1bHQgaW5pdGlhbGl6ZXJcblx0ICAgICAgICAgICAgICAgIGlmICghc3VidHlwZS5oYXNPd25Qcm9wZXJ0eSgnaW5pdCcpIHx8IHRoaXMuaW5pdCA9PT0gc3VidHlwZS5pbml0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgc3VidHlwZS5pbml0ID0gZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0eXBlLiRzdXBlci5pbml0LmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG5cdCAgICAgICAgICAgICAgICAgICAgfTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gSW5pdGlhbGl6ZXIncyBwcm90b3R5cGUgaXMgdGhlIHN1YnR5cGUgb2JqZWN0XG5cdCAgICAgICAgICAgICAgICBzdWJ0eXBlLmluaXQucHJvdG90eXBlID0gc3VidHlwZTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVmZXJlbmNlIHN1cGVydHlwZVxuXHQgICAgICAgICAgICAgICAgc3VidHlwZS4kc3VwZXIgPSB0aGlzO1xuXG5cdCAgICAgICAgICAgICAgICByZXR1cm4gc3VidHlwZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogRXh0ZW5kcyB0aGlzIG9iamVjdCBhbmQgcnVucyB0aGUgaW5pdCBtZXRob2QuXG5cdCAgICAgICAgICAgICAqIEFyZ3VtZW50cyB0byBjcmVhdGUoKSB3aWxsIGJlIHBhc3NlZCB0byBpbml0KCkuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEByZXR1cm4ge09iamVjdH0gVGhlIG5ldyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBpbnN0YW5jZSA9IE15VHlwZS5jcmVhdGUoKTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIGNyZWF0ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGluc3RhbmNlID0gdGhpcy5leHRlbmQoKTtcblx0ICAgICAgICAgICAgICAgIGluc3RhbmNlLmluaXQuYXBwbHkoaW5zdGFuY2UsIGFyZ3VtZW50cyk7XG5cblx0ICAgICAgICAgICAgICAgIHJldHVybiBpbnN0YW5jZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogSW5pdGlhbGl6ZXMgYSBuZXdseSBjcmVhdGVkIG9iamVjdC5cblx0ICAgICAgICAgICAgICogT3ZlcnJpZGUgdGhpcyBtZXRob2QgdG8gYWRkIHNvbWUgbG9naWMgd2hlbiB5b3VyIG9iamVjdHMgYXJlIGNyZWF0ZWQuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICB2YXIgTXlUeXBlID0gQ3J5cHRvSlMubGliLkJhc2UuZXh0ZW5kKHtcblx0ICAgICAgICAgICAgICogICAgICAgICBpbml0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgICAgIC8vIC4uLlxuXHQgICAgICAgICAgICAgKiAgICAgICAgIH1cblx0ICAgICAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgaW5pdDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB9LFxuXG5cdCAgICAgICAgICAgIC8qKlxuXHQgICAgICAgICAgICAgKiBDb3BpZXMgcHJvcGVydGllcyBpbnRvIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gcHJvcGVydGllcyBUaGUgcHJvcGVydGllcyB0byBtaXggaW4uXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBNeVR5cGUubWl4SW4oe1xuXHQgICAgICAgICAgICAgKiAgICAgICAgIGZpZWxkOiAndmFsdWUnXG5cdCAgICAgICAgICAgICAqICAgICB9KTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIG1peEluOiBmdW5jdGlvbiAocHJvcGVydGllcykge1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgcHJvcGVydHlOYW1lIGluIHByb3BlcnRpZXMpIHtcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocHJvcGVydGllcy5oYXNPd25Qcm9wZXJ0eShwcm9wZXJ0eU5hbWUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbcHJvcGVydHlOYW1lXSA9IHByb3BlcnRpZXNbcHJvcGVydHlOYW1lXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElFIHdvbid0IGNvcHkgdG9TdHJpbmcgdXNpbmcgdGhlIGxvb3AgYWJvdmVcblx0ICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0aWVzLmhhc093blByb3BlcnR5KCd0b1N0cmluZycpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdGhpcy50b1N0cmluZyA9IHByb3BlcnRpZXMudG9TdHJpbmc7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBjb3B5IG9mIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcmV0dXJuIHtPYmplY3R9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBjbG9uZSA9IGluc3RhbmNlLmNsb25lKCk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBjbG9uZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5pdC5wcm90b3R5cGUuZXh0ZW5kKHRoaXMpO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfTtcblx0ICAgIH0oKSk7XG5cblx0ICAgIC8qKlxuXHQgICAgICogQW4gYXJyYXkgb2YgMzItYml0IHdvcmRzLlxuXHQgICAgICpcblx0ICAgICAqIEBwcm9wZXJ0eSB7QXJyYXl9IHdvcmRzIFRoZSBhcnJheSBvZiAzMi1iaXQgd29yZHMuXG5cdCAgICAgKiBAcHJvcGVydHkge251bWJlcn0gc2lnQnl0ZXMgVGhlIG51bWJlciBvZiBzaWduaWZpY2FudCBieXRlcyBpbiB0aGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgKi9cblx0ICAgIHZhciBXb3JkQXJyYXkgPSBDX2xpYi5Xb3JkQXJyYXkgPSBCYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogSW5pdGlhbGl6ZXMgYSBuZXdseSBjcmVhdGVkIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge0FycmF5fSB3b3JkcyAoT3B0aW9uYWwpIEFuIGFycmF5IG9mIDMyL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lciAoT3B0aW9uYWwpIFRoZSBlbmNvZGluZyBzdHJhdGVneSB0byB1c2UuIERlZmF1bHQ6IENyeXB0b0pTLmVuYy5IZXhcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBzdHJpbmcgPSB3b3JkQXJyYXkgKyAnJztcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IHdvcmRBcnJheS50b1N0cmluZygpO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0gd29yZEFycmF5LnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB0b1N0cmluZzogZnVuY3Rpb24gKGVuY29kZXIpIHtcblx0ICAgICAgICAgICAgcmV0dXJuIChlbmNvZGVyIHx8IEhleCkuc3RyaW5naWZ5KHRoaXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb25jYXRlbmF0ZXMgYSB3b3JkIGFycmF5IHRvIHRoaXMgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkgdG8gYXBwZW5kLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHdvcmRBcnJheTEuY29uY2F0KHdvcmRBcnJheTIpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNvbmNhdDogZnVuY3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ge1xuXHQgICAgICAgICAgICAgICAgICAgIHRoaXNXb3Jkc1sodGhpc1NpZ0J5dGVzICsgaSkgPj4+IDJdID0gdGhhdFdvcmRzW2kgPj4+IDJdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIHRoaXMuc2lnQnl0ZXMgKz0gdGhhdFNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENoYWluYWJsZVxuXHQgICAgICAgICAgICByZXR1cm4gdGhpcztcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogUmVtb3ZlcyBpbnNpZ25pZmljYW50IGJpdHMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHdvcmRBcnJheS5jbGFtcCgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNsYW1wOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB0aGlzLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB0aGlzLnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENsYW1wXG5cdCAgICAgICAgICAgIHdvcmRzW3NpZ0J5dGVzID4+PiAyXSAmPSAweGZmZmZmZmZmIDw8ICgzMiAtIChzaWdCeXRlcyAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIHdvcmRzLmxlbmd0aCA9IE1hdGguY2VpbChzaWdCeXRlcyAvIDQpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgY29weSBvZiB0aGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGNsb25lID0gd29yZEFycmF5LmNsb25lKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gQmFzZS5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS53b3JkcyA9IHRoaXMud29yZHMuc2xpY2UoMCk7XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGNsb25lO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgd29yZCBhcnJheSBmaWxsZWQgd2l0aCByYW5kb20gYnl0ZXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbkJ5dGVzIFRoZSBudW1iZXIgb2YgcmFuZG9tIGJ5dGVzIHRvIGdlbmVyYXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgcmFuZG9tIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5saWIuV29yZEFycmF5LnJhbmRvbSgxNik7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcmFuZG9tOiBmdW5jdGlvbiAobkJ5dGVzKSB7XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXG5cdCAgICAgICAgICAgIHZhciByID0gKGZ1bmN0aW9uIChtX3cpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBtX3cgPSBtX3c7XG5cdCAgICAgICAgICAgICAgICB2YXIgbV96ID0gMHgzYWRlNjhiMTtcblx0ICAgICAgICAgICAgICAgIHZhciBtYXNrID0gMHhmZmZmZmZmZjtcblxuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBtX3ogPSAoMHg5MDY5ICogKG1feiAmIDB4RkZGRikgKyAobV96ID4+IDB4MTApKSAmIG1hc2s7XG5cdCAgICAgICAgICAgICAgICAgICAgbV93ID0gKDB4NDY1MCAqIChtX3cgJiAweEZGRkYpICsgKG1fdyA+PiAweDEwKSkgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSAoKG1feiA8PCAweDEwKSArIG1fdykgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAvPSAweDEwMDAwMDAwMDtcblx0ICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gMC41O1xuXHQgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKiAoTWF0aC5yYW5kb20oKSA+IC41ID8gMSA6IC0xKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfSk7XG5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIHJjYWNoZTsgaSA8IG5CeXRlczsgaSArPSA0KSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgX3IgPSByKChyY2FjaGUgfHwgTWF0aC5yYW5kb20oKSkgKiAweDEwMDAwMDAwMCk7XG5cblx0ICAgICAgICAgICAgICAgIHJjYWNoZSA9IF9yKCkgKiAweDNhZGU2N2I3O1xuXHQgICAgICAgICAgICAgICAgd29yZHMucHVzaCgoX3IoKSAqIDB4MTAwMDAwMDAwKSB8IDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdCh3b3JkcywgbkJ5dGVzKTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBFbmNvZGVyIG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfZW5jID0gQy5lbmMgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBIZXggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBIZXggPSBDX2VuYy5IZXggPSB7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSB3b3JkIGFycmF5IHRvIGEgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IFRoZSBoZXggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgaGV4U3RyaW5nID0gQ3J5cHRvSlMuZW5jLkhleC5zdHJpbmdpZnkod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBzdHJpbmdpZnk6IGZ1bmN0aW9uICh3b3JkQXJyYXkpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IHdvcmRBcnJheS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIGhleENoYXJzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2lnQnl0ZXM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJpdGUgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgaGV4Q2hhcnMucHVzaCgoYml0ZSA+Pj4gNCkudG9TdHJpbmcoMTYpKTtcblx0ICAgICAgICAgICAgICAgIGhleENoYXJzLnB1c2goKGJpdGUgJiAweDBmKS50b1N0cmluZygxNikpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGhleENoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIGhleCBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGhleFN0ciBUaGUgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuSGV4LnBhcnNlKGhleFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChoZXhTdHIpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIGhleFN0ckxlbmd0aCA9IGhleFN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBoZXhTdHJMZW5ndGg7IGkgKz0gMikge1xuXHQgICAgICAgICAgICAgICAgd29yZHNbaSA+Pj4gM10gfD0gcGFyc2VJbnQoaGV4U3RyLnN1YnN0cihpLCAyKSwgMTYpIDw8ICgyNCAtIChpICUgOCkgKiA0KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBuZXcgV29yZEFycmF5LmluaXQod29yZHMsIGhleFN0ckxlbmd0aCAvIDIpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogTGF0aW4xIGVuY29kaW5nIHN0cmF0ZWd5LlxuXHQgICAgICovXG5cdCAgICB2YXIgTGF0aW4xID0gQ19lbmMuTGF0aW4xID0ge1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgd29yZCBhcnJheSB0byBhIExhdGluMSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgTGF0aW4xIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGxhdGluMVN0cmluZyA9IENyeXB0b0pTLmVuYy5MYXRpbjEuc3RyaW5naWZ5KHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzaWdCeXRlcyA9IHdvcmRBcnJheS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciBsYXRpbjFDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciBiaXRlID0gKHdvcmRzW2kgPj4+IDJdID4+PiAoMjQgLSAoaSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIGxhdGluMUNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShiaXRlKSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbGF0aW4xQ2hhcnMuam9pbignJyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgTGF0aW4xIHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbGF0aW4xU3RyIFRoZSBMYXRpbjEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5MYXRpbjEucGFyc2UobGF0aW4xU3RyaW5nKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGxhdGluMVN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgbGF0aW4xU3RyTGVuZ3RoID0gbGF0aW4xU3RyLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxhdGluMVN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAyXSB8PSAobGF0aW4xU3RyLmNoYXJDb2RlQXQoaSkgJiAweGZmKSA8PCAoMjQgLSAoaSAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbmV3IFdvcmRBcnJheS5pbml0KHdvcmRzLCBsYXRpbjFTdHJMZW5ndGgpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogVVRGLTggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBVdGY4ID0gQ19lbmMuVXRmOCA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtOCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgdXRmOFN0cmluZyA9IENyeXB0b0pTLmVuYy5VdGY4LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICB0cnkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGRlY29kZVVSSUNvbXBvbmVudChlc2NhcGUoTGF0aW4xLnN0cmluZ2lmeSh3b3JkQXJyYXkpKSk7XG5cdCAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcblx0ICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTWFsZm9ybWVkIFVURi04IGRhdGEnKTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi04IHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gdXRmOFN0ciBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKHV0ZjhTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAodXRmOFN0cikge1xuXHQgICAgICAgICAgICByZXR1cm4gTGF0aW4xLnBhcnNlKHVuZXNjYXBlKGVuY29kZVVSSUNvbXBvbmVudCh1dGY4U3RyKSkpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogQWJzdHJhY3QgYnVmZmVyZWQgYmxvY2sgYWxnb3JpdGhtIHRlbXBsYXRlLlxuXHQgICAgICpcblx0ICAgICAqIFRoZSBwcm9wZXJ0eSBibG9ja1NpemUgbXVzdCBiZSBpbXBsZW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dGUxIDw8IDE2KSB8IChieXRlMiA8PCA4KSB8IGJ5dGUzO1xuXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgKGogPCA0KSAmJiAoaSArIGogKiAwLjc1IDwgc2lnQnl0ZXMpOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKG1hcC5jaGFyQXQoKHRyaXBsZXQgPj4+ICg2ICogKDMgLSBqKSkpICYgMHgzZikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQWRkIHBhZGRpbmdcblx0ICAgICAgICAgICAgdmFyIHBhZGRpbmdDaGFyID0gbWFwLmNoYXJBdCg2NCk7XG5cdCAgICAgICAgICAgIGlmIChwYWRkaW5nQ2hhcikge1xuXHQgICAgICAgICAgICAgICAgd2hpbGUgKGJhc2U2NENoYXJzLmxlbmd0aCAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKHBhZGRpbmdDaGFyKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBiYXNlNjRDaGFycy5qb2luKCcnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBCYXNlNjQgc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBiYXNlNjRTdHIgVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMuZW5jLkJhc2U2NC5wYXJzZShiYXNlNjRTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoYmFzZTY0U3RyKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgYmFzZTY0U3RyTGVuZ3RoID0gYmFzZTY0U3RyLmxlbmd0aDtcblx0ICAgICAgICAgICAgdmFyIG1hcCA9IHRoaXMuX21hcDtcblx0ICAgICAgICAgICAgdmFyIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwO1xuXG5cdCAgICAgICAgICAgIGlmICghcmV2ZXJzZU1hcCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwID0gW107XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBtYXAubGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV2ZXJzZU1hcFttYXAuY2hhckNvZGVBdChqKV0gPSBqO1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIElnbm9yZSBwYWRkaW5nXG5cdCAgICAgICAgICAgIHZhciBwYWRkaW5nQ2hhciA9IG1hcC5jaGFyQXQoNjQpO1xuXHQgICAgICAgICAgICBpZiAocGFkZGluZ0NoYXIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBwYWRkaW5nSW5kZXggPSBiYXNlNjRTdHIuaW5kZXhPZihwYWRkaW5nQ2hhcik7XG5cdCAgICAgICAgICAgICAgICBpZiAocGFkZGluZ0luZGV4ICE9PSAtMSkge1xuXHQgICAgICAgICAgICAgICAgICAgIGJhc2U2NFN0ckxlbmd0aCA9IHBhZGRpbmdJbm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mRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTE2IEJFIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHV0ZjE2U3RyaW5nID0gQ3J5cHRvSlMuZW5jLlV0ZjE2LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgxNiAtIChpICUgNCkgKiA4KSkgJiAweGZmZmY7XG5cdCAgICAgICAgICAgICAgICB1dGYxNkNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlUG9pbnQpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB1dGYxNkNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi0xNiBCRSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjE2U3RyIFRoZSBVVEYtMTYgQkUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGYxNi5wYXJzZSh1dGYxNlN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uICh1dGYxNlN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZTdHJMZW5ndGggPSB1dGYxNlN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB1dGYxNlN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAxXSB8PSB1dGYxNlN0ci5jaGFyQ29kZUF0KGkpIDw8ICgxNiAtIChpICUgMikgKiAxNik7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gV29yZEFycmF5LmNyZWF0ZSh3b3JkcywgdXRmMTZTdHJMZW5ndGggKiAyKTtcblx0ICAgICAgICB9XG5cdCAgICB9O1xuXG5cdCAgICAvKipcblx0ICAgICAqIFVURi0xNiBMRSBlbmNvZGluZyBzdHJhdGVneS5cblx0ICAgICAqL1xuXHQgICAgQ19lbmMuVXRmMTZMRSA9I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tcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB1dGYxNkNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi0xNiBMRSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjE2U3RyIFRoZSBVVEYtMTYgTEUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGYxNkxFLnBhcnNlKHV0ZjE2U3RyKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKHV0ZjE2U3RyKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciB1dGYxNlN0ckxlbmd0aCA9IHV0ZjE2U3RyLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHV0ZjE2U3RyTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW2kgPj4+IDFdIHw9IHN3YXBFbmRpYW4odXRmMTZTdHIuY2hhckNvZGVBdChpKSA8PCAoMTYgLSAoaSAlIDIpICogMTYpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBXb3JkQXJy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AgIHZhciBrZXkgPSBrZGYuY29tcHV0ZShwYXNzd29yZCwgc2FsdCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29tcHV0ZTogZnVuY3Rpb24gKHBhc3N3b3JkLCBzYWx0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBjZmcgPSB0aGlzLmNmZztcblxuXHQgICAgICAgICAgICAvLyBJbml0IGhhc2hlclxuXHQgICAgICAgICAgICB2YXIgaGFzaGVyID0gY2ZnLmhhc2hlci5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBJbml0aWFsIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleSA9IFdvcmRBcnJheS5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXlXb3JkcyA9IGRlcml2ZWRLZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKGJsb2NrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaGFzaGVyLnVwZGF0ZShibG9jayk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB2YXIgYmxvY2sgPSBoYXNoZXIudXBkYXRlKHBhc3N3b3JkKS5maW5hbGl6ZShzYWx0KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hlci5yZXNldCgpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBJdGVyYXRpb25zXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IGl0ZXJhdGlvbnM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGJsb2NrID0gaGFzaGVyLmZpbmFsaXplKGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgICAgICBoYXNoZXIucmVzZXQoKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZGVyaXZlZEtleS5jb25jYXQoYmxvY2spO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIGRlcml2ZWRLZXkuc2lnQnl0ZXMgPSBrZXlTaXplICogNDtcblxuXHQgICAgICAgICAgICByZXR1cm4gZGVyaXZlZEtleTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBEZXJpdmVzIGEga2V5IGZyb20gYSBwYXNzd29yZC5cblx0ICAgICAqXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gc2FsdCBBIHNhbHQuXG5cdCAgICAgKiBAcGFyYW0ge09iamVjdH0gY2ZnIChPcHRpb25hbCkgVGhlIGNvbmZpZ3VyYXRpb24gb3B0aW9ucyB0byB1c2UgZm9yIHRoaXMgY29tcHV0YXRpb24uXG5cdCAgICAgKlxuXHQgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgKlxuXHQgICAgICogQHN0YXRpY1xuXHQgICAgICpcblx0ICAgICAqIEBleGFtcGxlXG5cdCAgICAgKlxuXHQgICAgICogICAgIHZhciBrZXkgPSBDcnlwdG9KUy5FdnBLREYocGFzc3dvcmQsIHNhbHQpO1xuXHQgICAgICogICAgIHZhciBrZXkgPSBDcnlwdG9KUy5FdnBLREYocGFzc3dvcmQsIHNhbHQsIHsga2V5U2l6ZTogOCB9KT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IChoYXNoZXIsIGtleSkge1xuXHQgICAgICAgICAgICAvLyBJbml0IGhhc2hlclxuXHQgICAgICAgICAgICBoYXNoZXIgPSB0aGlzLl9oYXNoZXIgPSBuZXcgaGFzaGVyLmluaXQoKTtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0IHN0cmluZyB0byBXb3JkQXJyYXksIGVsc2UgYXNzdW1lIFdvcmRBcnJheSBhbHJlYWR5XG5cdCAgICAgICAgICAgIGlmICh0eXBlb2Yga2V5ID09ICdzdHJpbmcnKSB7XG5cdCAgICAgICAgICAgICAgICBrZXkgPSBVdGY4LnBhcnNlKGtleSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGhhc2hlckJsb2NrU2l6ZSA9IGhhc2hlci5ibG9ja1NpemU7XG5cdCAgICAgICAgICAgIHZhciBoYXNoZXJCbG9ja1NpemVCeXRlcyA9IGhhc2hlckJsb2NrU2l6ZSAqIDQ7XG5cblx0ICAgICAgICAgICAgLy8gQWxsb3cgYXJiaXRyYXJ5IGxlbmd0aCBrZXlzXG5cdCAgICAgICAgICAgIGlmIChrZXkuc2lnQnl0ZXMgPiBoYXNoZXJCbG9ja1NpemVCeXRlcykge1xuXHQgICAgICAgICAgICAgICAga2V5ID0gaGFzaGVyLmZpbmFsaXplKGtleSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDbGFtcCBleGNlc3MgYml0c1xuXHQgICAgICAgICAgICBrZXkuY2xhbXAoKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBrZXkgZm9yIGlubmVyIGFuZCBvdXRlciBwYWRzXG5cdCAgICAgICAgICAgIHZhciBvS2V5ID0gdGhpcy5fb0tleSA9IGtleS5jbG9uZSgpO1xuXHQgICAgICAgICAgICB2YXIgaUtleSA9IHRoaXMuX2lLZXkgPSBrZXkuY2xvbmUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIG9LZXlXb3JkcyA9IG9LZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBpS2V5V29yZHMgPSBpS2V5LndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFhPUiBrZXlzIHdpdGggcGFkIGNvbnN0YW50c1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGhhc2hlckJsb2NrU2l6ZTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBvS2V5V29yZHNbaV0gXj0gMHg1YzVjNWM1Yztcblx0ICAgICAgICAgICAgICAgIGlLZXlXb3Jkc1tpXSBePSAweDM2MzYzNjM2O1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIG9LZXkuc2lnQnl0ZXMgPSBpS2V5LnNpZ0J5dGVzID0gaGFzaGVyQmxvY2tTaXplQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gU2V0IGluaXRpYWwgdmFsdWVzXG5cdCAgICAgICAgICAgIHRoaXMucmVzZXQoKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogUmVzZXRzIHRoaXMgSE1BQyB0byBpdHMgaW5pdGlhbCBzdGF0ZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci5yZXNldCgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHJlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBoYXNoZXIgPSB0aGlzLl9oYXNoZXI7XG5cblx0ICAgICAgICAgICAgLy8gUmVzZXRcblx0ICAgICAgICAgICAgaGFzaGVyLnJlc2V0KCk7XG5cdCAgICAgICAgICAgIGhhc2hlci51cGRhdGUodGhpcy5faUtleSk7XG5cd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zaGVyLmV4dGVuZCh7XG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdGhpcy5faGFzaCA9IG5ldyBXb3JkQXJyYXkuaW5pdChbXG5cdCAgICAgICAgICAgICAgICAweDY3NDUyMzAxLCAweGVmY2RhYjg5LFxuXHQgICAgICAgICAgICAgICAgMHg5OGJhZGNmZSwgMHgxMDMyNTQ3NlxuXHQgICAgICAgICAgICBdKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0X2kgPSBvZmZzZXQgKyBpO1xuXHQgICAgICAgICAgICAgICAgdmFyIE1fb2Zmc2V0X2kgPSBNW29mZnNldF9pXTtcblxuXHQgICAgICAgICAgICAgICAgTVtvZmZzZXRfaV0gPSAoXG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCA4KSAgfCAoTV9vZmZzZXRfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAoKChNX29mZnNldF9pIDw8IDI0KSB8IChNX29mZnNldF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8wICA9IE1bb2Zmc2V0ICsgMF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xICA9IE1bb2Zmc2V0ICsgMV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8yICA9IE1bb2Zmc2V0ICsgMl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8zICA9IE1bb2Zmc2V0ICsgM107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF80ICA9IE1bb2Zmc2V0ICsgNF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF81ICA9IE1bb2Zmc2V0ICsgNV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF82ICA9IE1bb2Zmc2V0ICsgNl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF83ICA9IE1bb2Zmc2V0ICsgN107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF84ICA9IE1bb2Zmc2V0ICsgOF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF85ICA9IE1bb2Zmc2V0ICsgOV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMCA9IE1bb2Zmc2V0ICsgMTBdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMTEgPSBNW29mZnNldCArIDExXTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzEyID0gTVtvZmZzZXQgKyAxMl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMyA9IE1bb2Zmc2V0ICsgMTNdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMTQgPSBNW29mZnNldCArIDE0XTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzE1ID0gTVtvZmZzZXQgKyAxNV07XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWxiZXNcblx0ICAgICAgICAgICAgdmFyIGEgPSBIWzBdO1xuXHQgICAgICAgICAgICB2YXIgYiA9IEhbMV07XG5cdCAgICAgICAgICAgIHZhciBjID0gSFsyXTtcblx0ICAgICAgICAgICAgdmFyIGQgP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AgICAgICAgICAgZGF0YS5zaWdCeXRlcyA9IChkYXRhV29yZHMubGVuZ3RoICsgMSkgKiA0O1xuXG5cdCAgICAgICAgICAgIC8vIEhhc2ggZmluYWwgYmxvY2tzXG5cdCAgICAgICAgICAgIHRoaXMuX3Byb2Nlc3MoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGhhc2ggPSB0aGlzLl9oYXNoO1xuXHQgICAgICAgICAgICB2YXIgSCA9IGhhc2gud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgSF9pID0gSFtpXTtcblxuXHQgICAgICAgICAgICAgICAgSFtpXSA9ICgoKEhfaSA8PCA4KSAgfCAoSF9pID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICAgICgoKEhfaSA8PCAyNCkgfCAoSF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBSZXR1cm4gZmluYWwgY29tcHV0ZWQgaGFzaFxuXHQgICAgICAgICAgICByZXR1cm4gaGFzaDtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gSGFzaGVyLmNsb25lLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIGNsb25lLl9oYXNoID0gdGhpcy5faGFzaC5jbG9uZSgpO1xuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgZnVuY3Rpb24gRkYoYSwgYiwgYywgZCwgeCwgcywgdCk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AgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBrZXkgPSBrZGYuY29tcHV0ZShwYXNzd29yZCwgc2FsdCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29tcHV0ZTogZnVuY3Rpb24gKHBhc3N3b3JkLCBzYWx0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBjZmcgPSB0aGlzLmNmZztcblxuXHQgICAgICAgICAgICAvLyBJbml0IEhNQUNcblx0ICAgICAgICAgICAgdmFyIGhtYWMgPSBITUFDLmNyZWF0ZShjZmcuaGFzaGVyLCBwYXNzd29yZCk7XG5cblx0ICAgICAgICAgICAgLy8gSW5pdGlhbCB2YWx1ZXNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXkgPSBXb3JkQXJyYXkuY3JlYXRlKCk7XG5cdCAgICAgICAgICAgIHZhciBibG9ja0luZGV4ID0gV29yZEFycmF5LmNyZWF0ZShbMHgwMDAwMDAwMV0pO1xuXG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleVdvcmRzID0gZGVyaXZlZEtleS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGJsb2NrSW5kZXhXb3JkcyA9IGJsb2NrSW5kZXgud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaG1hYy51cGRhdGUoc2FsdCkuZmluYWxpemUoYmxvY2tJbmRleCk7XG5cdCAgICAgICAgICAgICAgICBobWFjLnJlc2V0KCk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrV29yZHMgPSBibG9jay53b3Jkcztcblx0ICAgICAgICAgICAgICAgIHZhciBibG9ja1dvcmRzTGVuZ3RoID0gYmxvY2tXb3Jkcy5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEl0ZXJhdGlvbnNcblx0ICAgICAgICAgICAgICAgIHZhciBpbnRlcm1lZGlhdGUgPSBibG9jaztcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgaXRlcmF0aW9uczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaW50ZXJtZWRpYXRlID0gaG1hYy5maW5hbGl6ZShpbnRlcm1lZGlhdGUpO1xuXHQgICAgICAgICAgICAgICAgICAgIGhtYWMucmVzZXQoKTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGludGVybWVkaWF0ZVdvcmRzID0gaW50ZXJtZWRpYXRlLndvcmRzO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gWE9SIGludGVybWVkaWF0ZSB3aXRoIGJsb2NrXG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBibG9ja1dvcmRzTGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tXb3Jkc1tqXSBePSBpbnRlcm1lZGlhdGVXb3Jkc1tqXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIGRlcml2ZWRLZXkuY29uY2F0KGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgIGJsb2NrSW5kZXhXb3Jkc1swXSsrO1xuXHQgICAgICAgICAgICB9XG5cdC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AgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW1cblx0ICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgZm91ciBrZXlzdHJlYW0gd29yZHNcblx0ICAgICAgICAgICAgU1swXSA9IFhbMF0gXiAoWFs1XSA+Pj4gMTYpIF4gKFhbM10gPDwgMTYpO1xuXHQgICAgICAgICAgICBTWzFdID0gWFsyXSBeIChYWzddID4+PiAxNikgXiAoWFs1XSA8PCAxNik7XG5cdCAgICAgICAgICAgIFNbMl0gPSBYWzRdIF4gKFhbMV0gPj4+IDE2KSBeIChYWzddIDw8IDE2KTtcblx0ICAgICAgICAgICAgU1szXSA9IFhbNl0gXiAoWFszXSA+Pj4gMTYpIF4gKFhbMV0gPDwgMTYpO1xuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyB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cdCAgICAgICAgICAgICAgICAoS1sxXSA8PCAxNikgfCAoS1sxXSA+Pj4gMTYpLCAoS1szXSAmIDB4ZmZmZjAwMDApIHwgKEtbMF0gJiAweDAwMDBmZmZmKVxuXHQgICAgICAgICAgICBdO1xuXG5cdCAgICAgICAgICAgIC8vIENhcnJ5IGJpdFxuXHQgICAgICAgICAgICB0aGlzLl9iID0gMDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIH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dCAgICB2YXIgUkM0ID0gQ19hbGdvLlJDNCA9IFN0cmVhbUNpcGhlci5leHRlbmQoe1xuXHQgICAgICAgIF9kb1Jlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIga2V5ID0gdGhpcy5fa2V5O1xuXHQgICAgICAgICAgICB2YXIga2V5V29yZHMgPSBrZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaWdCeXRlcyA9IGtleS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBJbml0IHNib3hcblx0ICAgICAgICAgICAgdmFyIFMgPSB0aGlzLl9TID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIFNbaV0gPSBpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gS2V5IHNldHVwXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBqID0gMDsgaSA8IDI1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qnl0ZUluZGV4ID0gaSAlIGtleVNpZ0J5dGVzO1xuXHQgICAgICAgICAgICAgICAgdmFyIGtleUJ5dGUgPSAoa2V5V29yZHNba2V5Qnl0ZUluZGV4ID4+PiAyXSA+Pj4gKDI0IC0gKGtleUJ5dGVJbmRleCAlIDQpICogOCkpICYgMHhmZjtcblxuXHQgICAgICAgICAgICAgICAgaiA9IChqICsgU1tpXSArIGtleUJ5dGUpICUgMjU2O1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwXG5cdCAgICAgICAgICAgICAgICB2YXIgdCA9IFNbaV07XG5cdCAgICAgICAgICAgICAgICBTW2ldID0gU1tqXTtcblx0ICAgICAgICAgICAgICAgIFNbal0gPSB0O1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ291bn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Zmc2V0X2ldID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE1fb2Zmc2V0X2kgPDwgOCkgIHwgKE1fb2Zmc2V0X2kgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCAyNCkgfCAoTV9vZmZzZXRfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIICA9IHRoaXMuX2hhc2gud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBobCA9IF9obC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGhyID0gX2hyLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgemwgPSBfemwud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB6ciA9IF96ci53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNsID0gX3NsLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc3IgPSBfc3Iud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGFsLCBibCwgY2wsIGRsLCBlbDtcblx0ICAgICAgICAgICAgdmFyIGFyLCBiciwgY3IsIGRyLCBlcjtcblxuXHQgICAgICAgICAgICBhciA9IGFsID0gSFswXTtcblx0ICAgICAgICAgICAgYnIgPSBibCA9IEhbMV07XG5cdCAgICAgICAgICAgIGNyID0gY2wgPSBIWzJdO1xuXHQgICAgICAgICAgICBkciA9IGRsID0gSFszXTtcblx0ICAgICAgICAgICAgZXIgPSBlbCA9IEhbNF07XG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIHZhciB0O1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDgwOyBpICs9IDEpIHtcblx0ICAgICAgICAgICAgICAgIHQgPSAoYWwgKyAgTVtvZmZzZXQremxbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJsLGNsLGRsKSArIGhsWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjIoYmwsY2wsZGwpICsgaGxbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhibCxjbCxkbCkgKyBobFsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY0KGJsLGNsLGRsKSArIGhsWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJsLGNsLGRsKSArIGhsWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNsW2ldKTtcblx0ICAgICAgICAgICAgICAgIHQgPSAodCtlbCl8MDtcblx0ICAgICAgICAgICAgICAgIGFsID0gZWw7XG5cdCAgICAgICAgICAgICAgICBlbCA9IGRsO1xuXHQgICAgICAgICAgICAgICAgZGwgPSByb3RsKGNsLCAxMCk7XG5cdCAgICAgICAgICAgICAgICBjbCA9IGJsO1xuXHQgICAgICAgICAgICAgICAgYmwgPSB0O1xuXG5cdCAgICAgICAgICAgICAgICB0ID0gKGFyICsgTVtvZmZzZXQrenJbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJyLGNyLGRyKSArIGhyWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjQoYnIsY3IsZHIpICsgaHJbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhicixjcixkcikgKyBoclsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYyKGJyLGNyLGRyKSArIGhyWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJyLGNyLGRyKSArIGhyWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNyW2ldKSA7XG5cdCAgICAgICAgICAgICAgICB0ID0gKHQrZXIpfDA7XG5cdCAgICAgICAgICAgICAgICBhciA9IGVyO1xuXHQgICAgICAgICAgICAgICAgZXIgPSBkcjtcblx0ICAgICAgICAgICAgICAgIGRyID0gcm90bChjciwgMTApO1xuXHQgICAgICAgICAgICAgICAgY3IgPSBicjtcblx0ICAgICAgICAgICAgICAgIGJyID0gdDtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICB0ICAgID0gKEhbMV0gKyBjbCArIGRyKXwwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMl0gKyBkbCArIGVyKXwwO1xuXHQgICAgICAgICAgICBIWzJdID0gKEhbM10gKyBlbCArIGFyKXwwO1xuXHQgICAgICAgICAgICBIWzNdID0gKEhbNF0gKyBhbCArIGJyKXwwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbMF0gKyBibCArIGNyKXwwO1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cblx0ICAgICAgICAgICAgdmFyIEggPSBoYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIEhfaSA9IEhbaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIEhbaV0gPSAoKChIX2kgPDwgOCkgIHwgKEhfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAgICAoKChIX2kgPDwgMjQpIHwgKEhfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIGhhc2g7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEhhc2hlci5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS5faGFzaCA9IHRoaXMuX2hhc2guY2xvbmUoKTtcblxuXHQgICAgICAgICAgICByZXR1cm4gY2xvbmU7XG5cdCAgICAgICAgfVxuXHQgICAgfSk7XG5cblxuXHQgICAgZnVuY3Rpb24gZjEoeCwgeSwgeikge1xuXHQgICAgICAgIHJldHVybiAoKHgpIF4gKHkpIF4gKHopKTtcblxuXHQgICAgfVxuXG5cdCAgICBmdW5jdGlvbiBmMih4LCB5LCB6KSB7XG5cdCAgICAgICAgcmV0dXJuICgoKHgpJih5KSkgfCAoKH54KSYoeikpKTtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gZjMoeCwgeSwgeikge1xuX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ICAgICAgICAgdmFyIGUgPSBIWzRdO1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODA7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKGkgPCAxNikge1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSBNW29mZnNldCArIGldIHwgMDtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIG4gPSBXW2kgLSAzXSBeIFdbaSAtIDhdIF4gV1tpIC0gMTRdIF4gV1tpIC0gMTZdO1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSAobiA8PCAxKSB8IChuID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0ID0gKChhIDw8IDUpIHwgKGEgPj4+IDI3KSkgKyBlICsgV1tpXTtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMjApIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9ICgoYiAmIGMpIHwgKH5iICYgZCkpICsgMHg1YTgyNzk5OTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaSA8IDQwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdCArPSAoYiBeIGMgXiBkKSArIDB4NmVkOWViYTE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGkgPCA2MCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHQgKz0gKChiICYgYykgfCAoYiAmIGQpIHwgKGMgJiBkKSkgLSAweDcwZTQ0MzI0O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChpIDwgODApICovIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9IChiIF4gYyBeIGQpIC0gMHgzNTlkM2UyYTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZSA9IGQ7XG5cdCAgICAgICAgICAgICAgICBkID0gYztcblx0ICAgICAgICAgICAgICAgIGMgPSAoYiA8PCAzMCkgfCAoYiA+Pj4gMik7XG5cdCAgICAgICAgICAgICAgICBiID0gYTtcblx0ICAgICAgICAgICAgICAgIGEgPSB0O1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSW50ZXJtZWRpYXRlIGhhc2ggdmFsdWVcblx0ICAgICAgICAgICAgSFswXSA9IChIWzBdICsgYSkgfCAwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMV0gKyBiKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMl0gPSAoSFsyXSArIGMpIHwgMDtcblx0ICAgICAgICAgICAgSFszXSA9IChIWzNdICsgZCkgfCAwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbNF0gKyBlKSB8IDA7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuX2RhdGE7XG5cdCAgICAgICAgICAgIHZhciBkYXRhV29yZHMgPSBkYXRhLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBuQml0c1RvdGFsID0gdGhpcy5fbkRhdGFCeXRlcyAqIDg7XG5cdCAgICAgICAgICAgIHZhciBuQml0c0xlZnQgPSBkYXRhLnNpZ0J5dGVzICogODtcblxuXHQgICAgICAgICAgICAvLyBBZGQgcGFkZGluZ1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbbkJpdHNMZWZ0ID4+PiA1XSB8PSAweDgwIDw8ICgyNCAtIG5CaXRzTGVmdCAlIDMyKTtcblx0ICAgICAgICAgICAgZGF0YVdvcmRzWygoKG5CaXRzTGVmdCArIDY0KSA+Pj4gOSkgPDwgNCkgKyAxNF0gPSBNYXRoLmZsb29yKG5CaXRzVG90YWwgLyAweD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gSCA9IFtdO1xuXHQgICAgdmFyIEsgPSBbXTtcblxuXHQgICAgLy8gQ29tcHV0ZSBjb25zdGFudHNcblx0ICAgIChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgZnVuY3Rpb24gaXNQcmltZShuKSB7XG5cdCAgICAgICAgICAgIHZhciBzcXJ0TiA9IE1hdGguc3FydChuKTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgZmFjdG9yID0gMjsgZmFjdG9yIDw9IHNxcnROOyBmYWN0b3IrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKCEobiAlIGZhY3RvcikpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICBmdW5jdGlvbiBnZXRGcmFjdGlvbmFsQml0cyhuKSB7XG5cdCAgICAgICAgICAgIHJldHVybiAoKG4gLSAobiB8IDApKSAqIDB4MTAwMDAwMDAwKSB8IDA7XG5cdCAgICAgICAgfVxuXG5cdCAgICAgICAgdmFyIG4gPSAyO1xuXHQgICAgICAgIHZhciBuUHJpbWUgPSAwO1xuXHQgICAgICAgIHdoaWxlIChuUHJpbWUgPCA2NCkge1xuXHQgICAgICAgICAgICBpZiAoaXNQcmltZShuKSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKG5QcmltZSA8IDgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBIW25QcmltZV0gPSBnZXRGcmFjdGlvbmFsQml0cyhNYXRoLnBvdyhuLCAxIC8gMikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgS1tuUHJpbWVdID0gZ2V0RnJhY3Rpb25hbEJpdHMoTWF0aC5wb3cobiwgMSAvIDMpKTtcblxuXHQgICAgICAgICAgICAgICAgblByaW1lKys7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICBuKys7XG5cdCAgICAgICAgfVxuXHQgICAgfSgpKTtcblxuXHQgICAgLy8gUmV1c2FibGUgb2JqZWN0XG5cdCAgICB2YXIgVyA9IFtdO1xuXG5cdCAgICAvKipcblx0ICAgICAqIFNIQS0yNTYgaGFzaCBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBTSEEyNTYgPSBDX2FsZ28uU0hBMjU2ID0gSGFzaGVyLmV4dGVuZCh7XG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdGhpcy5faGFzaCA9IG5ldyBXb3JkQXJyYXkuaW5pdChILnNsaWNlKDApKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIID0gdGhpcy5faGFzaC53b3JkcztcblxuXHQgICAgICAgICAgICAvLyBXb3JraW5nIHZhcmlhYmxlc1xuXHQgICAgICAgICAgICB2YXIgYSA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBiID0gSFsxXTtcblx0ICAgICAgICAgICAgdmFyIGMgPSBIWzJdO1xuXHQgICAgICAgICAgICB2YXIgZCA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBlID0gSFs0XTtcblx0ICAgICAgICAgICAgdmFyIGYgPSBIWzVdO1xuXHQgICAgICAgICAgICB2YXIgZyA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBoID0gSFs3XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRhdGlvblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDY0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gTVtvZmZzZXQgKyBpXSB8IDA7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4ID0gV1tpIC0gMTVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTAgID0gKChnYW1tYTB4IDw8IDI1KSB8IChnYW1tYTB4ID4+PiA3KSkgIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZ2FtbWEweCA8PCAxNCkgfCAoZ2FtbWEweCA+Pj4gMTgpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdhbW1hMHggPj4+IDMpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXggPSBXW2kgLSAyXTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExICA9ICgoZ2FtbWExeCA8PCAxNSkgfCAoZ2FtbWExeCA+Pj4gMTcpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGdhbW1hMXggPDwgMTMpIHwgKGdhbW1hMXggPj4+IDE5KSkgXlxuXHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnYW1tYTF4ID4+PiAxMCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gZ2FtbWEwICsgV1tpIC0gN10gKyBnYW1tYTEgKyBXW2kgLSAxNl07XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciBjaCAgPSAoZSAmIGYpIF4gKH5lICYgZyk7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFqID0gKGEgJiBiKSBeIChhICYgYykgXiAoYiAmIGMpO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWEwID0gKChhIDw8IDMwKSB8IChhID4+PiAyKSkgXiAoKGEgPDwgMTkpIHwgKGEgPj4+IDEzKSkgXiAoKGEgPDwgMTApIHwgKGEgPj4+IDIyKSk7XG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWExID0gKChlIDw8IDI2KSB8IChlID4+PiA2KSkgXiAoKGUgPDwgMjEpIHwgKGUgPj4+IDExKSkgXiAoKGUgPDwgNykgIHwgKGUgPj4+IDI1KSk7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0MSA9IGggKyBzaWdtYTEgKyBjaCArIEtbaV0gKyBXW2ldO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQyID0gc2lnbWEwICsgbWFqO1xuXG5cdCAgICAgICAgICAgICAgICBoID0gZztcblx0ICAgICAgICAgICAgICAgIGcgPSBmO1xuXHQgICAgICAgICAgICAgICAgZiA9IGU7XG5cdCAgICAgICAgICAgICAgICBlID0gKGQgKyB0MSkgfCAwO1xuXHQgICAgICAgICAgICAgICAgZCA9IGM7XG5cdCAgICAgICAgICAgICAgICBjID0gYjtcblx0ICAgICAgICAgICAgICAgIGIgPSBhO1xuXHQgICAgICAgICAgICAgICAgYSA9ICh0MSArIHQyKSB8IDA7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICBIWzBdID0gKEhbMF0gKyBhKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMV0gPSAoSFsxXSArIGIpIHwgMDtcblx0ICAgICAgICAgICAgSFsyXSA9IChIWzJdICsgYykgfCAwO1xuXHQgICAgICAgICAgICBIWzNdID0gKEhbM10gKyBkKSB8IDA7XG5cdCAgICAgICAgICAgIEhbNF0gPSAoSFs0XSArIGUpIHwgMDtcblx0ICAgICAgICAgICAgSFs1XSA9IChIWzVdICsgZikgfCAwO1xuXHQgICAgICAgICAgICBIWzZdID0gKEhbNl0gKyBnKSB8IDA7XG5cdCAgICAgICAgICAgIEhbN10gPSAoSFs3XSArIGgpIHwgMDtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvRmluYWxpemU6IGZ1bmN0aW9uICgpI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ciBYNjRXb3JkID0gQ194NjQuV29yZDtcblx0ICAgIHZhciBDX2FsZ28gPSBDLmFsZ287XG5cblx0ICAgIC8vIENvbnN0YW50cyB0YWJsZXNcblx0ICAgIHZhciBSSE9fT0ZGU0VUUyA9IFtdO1xuXHQgICAgdmFyIFBJX0lOREVYRVMgID0gW107XG5cdCAgICB2YXIgUk9VTkRfQ09OU1RBTlRTID0gW107XG5cblx0ICAgIC8vIENvbXB1dGUgQ29uc3RhbnRzXG5cdCAgICAoZnVuY3Rpb24gKCkge1xuXHQgICAgICAgIC8vIENvbXB1dGUgcmhvIG9mZnNldCBjb25zdGFudHNcblx0ICAgICAgICB2YXIgeCA9IDEsIHkgPSAwO1xuXHQgICAgICAgIGZvciAodmFyIHQgPSAwOyB0IDwgMjQ7IHQrKykge1xuXHQgICAgICAgICAgICBSSE9fT0ZGU0VUU1t4ICsgNSAqIHldID0gKCh0ICsgMSkgKiAodCArIDIpIC8gMikgJSA2NDtcblxuXHQgICAgICAgICAgICB2YXIgbmV3WCA9IHkgJSA1O1xuXHQgICAgICAgICAgICB2YXIgbmV3WSA9ICgyICogeCArIDMgKiB5KSAlIDU7XG5cdCAgICAgICAgICAgIHggPSBuZXdYO1xuXHQgICAgICAgICAgICB5ID0gbmV3WTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICAvLyBDb21wdXRlIHBpIGluZGV4IGNvbnN0YW50c1xuXHQgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICBQSV9JTkRFWEVTW3ggKyA1ICogeV0gPSB5ICsgKCgyICogeCArIDMgKiB5KSAlIDUpICogNTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIENvbXB1dGUgcm91bmQgY29uc3RhbnRzXG5cdCAgICAgICAgdmFyIExGU1IgPSAweDAxO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjQ7IGkrKykge1xuXHQgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudE1zdyA9IDA7XG5cdCAgICAgICAgICAgIHZhciByb3VuZENvbnN0YW50THN3ID0gMDtcblxuXHQgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IDc7IGorKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDAxKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGJpdFBvc2l0aW9uID0gKDEgPDwgaikgLSAxO1xuXHQgICAgICAgICAgICAgICAgICAgIGlmIChiaXRQb3NpdGlvbiA8IDMyKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRMc3cgXj0gMSA8PCBiaXRQb3NpdGlvbjtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgLyogaWYgKGJpdFBvc2l0aW9uID49IDMyKSAqLyB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRNc3cgXj0gMSA8PCAoYml0UG9zaXRpb24gLSAzMik7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBDb21wdXRlIG5leHQgTEZTUlxuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDgwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gUHJpbWl0aXZlIHBvbHlub21pYWwgb3ZlciBHRigyKTogeF44ICsgeF42ICsgeF41ICsgeF40ICsgMVxuXHQgICAgICAgICAgICAgICAgICAgIExGU1IgPSAoTEZTUiA8PCAxKSBeIDB4NzE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIExGU1IgPDw9IDE7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXH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gdmFyIHN0YXRlID0gdGhpcy5fc3RhdGUgPSBbXVxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI1OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHN0YXRlW2ldID0gbmV3IFg2NFdvcmQuaW5pdCgpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgdGhpcy5ibG9ja1NpemUgPSAoMTYwMCAtIDIgKiB0aGlzLmNmZy5vdXRwdXRMZW5ndGgpIC8gMzI7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHN0YXRlID0gdGhpcy5fc3RhdGU7XG5cdCAgICAgICAgICAgIHZhciBuQmxvY2tTaXplTGFuZXMgPSB0aGlzLmJsb2NrU2l6ZSAvIDI7XG5cblx0ICAgICAgICAgICAgLy8gQWJzb3JiXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbkJsb2NrU2l6ZUxhbmVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIE0yaSAgPSBNW29mZnNldCArIDIgKiBpXTtcblx0ICAgICAgICAgICAgICAgIHZhciBNMmkxID0gTVtvZmZzZXQgKyAyICogaSArIDFdO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgTTJpID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCA4KSAgfCAoTTJpID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCAyNCkgfCAoTTJpID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgICAgICBNMmkxID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaTEgPDwgOCkgIHwgKE0yaTEgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTTJpMSA8PCAyNCkgfCAoTTJpMSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBBYnNvcmIgbWVzc2FnZSBpbnRvIHN0YXRlXG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2ldO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5oaWdoIF49IE0yaTE7XG5cdCAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gTTJpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUm91bmRzXG5cdCAgICAgICAgICAgIGZvciAodmFyIHJvdW5kID0gMDsgcm91bmQgPCAyNDsgcm91bmQrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gVGhldGFcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gTWl4IGNvbHVtbiBsYW5lc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gMCwgdExzdyA9IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeSA9IDA7IHkgPCA1OyB5KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVt4ICsgNSAqIHldO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB0TXN3IF49IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdExzdyBePSBsYW5lLmxvdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUZW1wb3JhcnkgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4ID0gVFt4XTtcblx0ICAgICAgICAgICAgICAgICAgICBUeC5oaWdoID0gdE1zdztcblx0ICAgICAgICAgICAgICAgICAgICBUeC5sb3cgID0gdExzdztcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4NCA9IFRbKHggKyA0KSAlIDVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUeDEgPSBUWyh4ICsgMSkgJSA1XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVHgxTXN3ID0gVHgxLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxzdyA9IFR4MS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBNaXggc3Vycm91bmRpbmcgY29sdW1uc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gVHg0LmhpZ2ggXiAoKFR4MU1zdyA8PCAxKSB8IChUeDFMc3cgPj4+IDMxKSk7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSBUeDQubG93ICBeICgoVHgxTHN3IDw8IDEpIHwgKFR4MU1zdyA+Pj4gMzEpKTtcblx0ICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB5ID0gMDsgeSA8IDU7IHkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW3ggKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCBePSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gdExzdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBQaVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgbGFuZUluZGV4ID0gMTsgbGFuZUluZGV4IDwgMjU7IGxhbmVJbmRleCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVtsYW5lSW5kZXhdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTXN3ID0gbGFuZS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHJob09mZnNldCA9IFJIT19PRkZTRVRTW2xhbmVJbmRleF07XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBSb3RhdGUgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocmhvT2Zmc2V0IDwgMzIpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZU1zdyA8PCByaG9PZmZzZXQpIHwgKGxhbmVMc3cgPj4+ICgzMiAtIHJob09mZnNldCkpO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdExzdyA9IChsYW5lTHN3IDw8IHJob09mZnNldCkgfCAobGFuZU1zdyA+Pj4gKDMyIC0gcmhvT2Zmc2V0KSk7XG5cdCAgICAgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChyaG9PZmZzZXQgPj0gMzIpICovIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZUxzdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTXN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSAobGFuZU1zdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTHN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUcmFuc3Bvc2UgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVFBpTGFuZSA9IFRbUElfSU5ERVhFU1tsYW5lSW5kZXhdXTtcblx0ICAgICAgICAgICAgICAgICAgICBUUGlMYW5lLmhpZ2ggPSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgIFRQaUxhbmUubG93ICA9IHRMc3c7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBwaSBhdCB4ID0geSA9IDBcblx0ICAgICAgICAgICAgICAgIHZhciBUMCA9IFRbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgc3RhdGUwID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICBUMC5oaWdoID0gc3RhdGUwLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICBUMC5sb3cgID0gc3RhdGUwLmxvdztcblxuXHQgICAgICAgICAgICAgICAgLy8gQ2hpXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciB4ID0gMDsgeCA8IDU7IHgrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZUluZGV4ID0geCArIDUgKiB5O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2xhbmVJbmRleF07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUTGFuZSA9IFRbbGFuZUluZGV4XTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxhbmUgPSBUWygoeCArIDEpICUgNSkgKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUeDJMYW5lID0gVFsoKHggKyAyKSAlIDUpICsgNSAqIHldO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1peCByb3dzXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCA9IFRMYW5lLmhpZ2ggXiAoflR4MUxhbmUuaGlnaCAmIFR4MkxhbmUuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUubG93ICA9IFRMYW5lLmxvdyAgXiAoflR4MUxhbmUubG93ICAmIFR4MkxhbmUubG93KTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElvdGFcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudCA9IFJPVU5EX0NPTlNUQU5UU1tyb3VuZF07XG5cdCAgICAgICAgICAgICAgICBsYW5lLmhpZ2ggXj0gcm91bmRDb25zdGFudC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5sb3cgIF49IHJvdW5kQ29uc3RhbnQubG93Oztcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5hbGl6ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRhdGEgPSB0aGlzLl9kYXRhO1xuXHQgICAgICAgICAgICB2YXIgZGF0YVdvcmRzID0gZGF0YS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIG5CaXRzVG90YWwgPSB0aGlzLl9uRGF0YUJ5dGVzICogODtcblx0ICAgICAgICAgICAgdmFyIG5CaXRzTGVmdCA9IGRhdGEuc2lnQnl0ZXMgKiA4O1xuXHQgICAgICAgICAgICB2YX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5lTHN3ID0gbGFuZS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgICAgICBsYW5lTXN3ID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVNc3cgPDwgOCkgIHwgKGxhbmVNc3cgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgobGFuZU1zdyA8PCAyNCkgfCAobGFuZU1zdyA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICAgICAgbGFuZUxzdyA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChsYW5lTHN3IDw8IDgpICB8IChsYW5lTHN3ID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVMc3cgPDwgMjQpIHwgKGxhbmVMc3cgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICAgICAgKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gU3F1ZWV6ZSBzdGF0ZSB0byByZXRyaWV2ZSBoYXNoXG5cdCAgICAgICAgICAgICAgICBoYXNoV29yZHMucHVzaChsYW5lTHN3KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hXb3Jkcy5wdXNoKGxhbmVNc3cpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdChoYXNoV29yZHMsIG91dHB1dExlbmd0aEJ5dGVzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gSGFzaGVyLmNsb25lLmNhbGwodGhpcyk7XG5cblx0IC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VuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBIMCA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBIMSA9IEhbMV07XG5cdCAgICAgICAgICAgIHZhciBIMiA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBIMyA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBINCA9IEhbNF07XG5cdCAgICAgICAgICAgIHZhciBINSA9IEhbNV07XG5cdCAgICAgICAgICAgIHZhciBINiA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBINyA9IEhbN107XG5cblx0ICAgICAgICAgICAgdmFyIEgwaCA9IEgwLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIMGwgPSBIMC5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIMWggPSBIMS5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDFsID0gSDEubG93O1xuXHQgICAgICAgICAgICB2YXIgSDJoID0gSDIuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEgybCA9IEgyLmxvdztcblx0ICAgICAgICAgICAgdmFyIEgzaCA9IEgzLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIM2wgPSBIMy5sb3c7XG5cdCAgICAgICAgICAgIHZhciBINGggPSBINC5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDRsID0gSDQubG93O1xuXHQgICAgICAgICAgICB2YXIgSDVoID0gSDUuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEg1bCA9IEg1Lmxvdztcblx0ICAgICAgICAgICAgdmFyIEg2aCA9IEg2LmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBINmwgPSBINi5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIN2ggPSBINy5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDdsID0gSDcubG93O1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhaCA9IEgwaDtcblx0ICAgICAgICAgICAgdmFyIGFsID0gSDBsO1xuXHQgICAgICAgICAgICB2YXIgYmggPSBIMWg7XG5cdCAgICAgICAgICAgIHZhciBibCA9IEgxbDtcblx0ICAgICAgICAgICAgdmFyIGNoID0gSDJoO1xuXHQgICAgICAgICAgICB2YXIgY2wgPSBIMmw7XG5cdCAgICAgICAgICAgIHZhciBkaCA9IEgzaDtcblx0ICAgICAgICAgICAgdmFyIGRsID0gSDNsO1xuXHQgICAgICAgICAgICB2YXIgZWggPSBINGg7XG5cdCAgICAgICAgICAgIHZhciBlbCA9IEg0bDtcblx0ICAgICAgICAgICAgdmFyIGZoID0gSDVoO1xuXHQgICAgICAgICAgICB2YXIgZmwgPSBINWw7XG5cdCAgICAgICAgICAgIHZhciBnaCA9IEg2aDtcblx0ICAgICAgICAgICAgdmFyIGdsID0gSDZsO1xuXHQgICAgICAgICAgICB2YXIgaGggPSBIN2g7XG5cdCAgICAgICAgICAgIHZhciBobCA9IEg3bDtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4MDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIFdpID0gV1tpXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRXh0ZW5kIG1lc3NhZ2Vcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2kuaGlnaCA9IE1bb2Zmc2V0ICsgaSAqIDJdICAgICB8IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpbCA9IFdpLmxvdyAgPSBNW29mZnNldCArIGkgKiAyICsgMV0gfCAwO1xuXHQgICAgICAgICAgICAgICAg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WExbCAgPSAoKGdhbW1hMXhsID4+PiAxOSkgfCAoZ2FtbWExeGggPDwgMTMpKSBeICgoZ2FtbWExeGwgPDwgMykgfCAoZ2FtbWExeGggPj4+IDI5KSkgXiAoKGdhbW1hMXhsID4+PiA2KSB8IChnYW1tYTF4aCA8PCAyNikpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gV1tpXSA9IGdhbW1hMCArIFdbaSAtIDddICsgZ2FtbWExICsgV1tpIC0gMTZdXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpNyAgPSBXW2kgLSA3XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2k3aCA9IFdpNy5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaTdsID0gV2k3LmxvdztcblxuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaTE2ICA9IFdbaSAtIDE2XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2kxNmggPSBXaTE2LmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpMTZsID0gV2kxNi5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2lsID0gZ2FtbWEwbCArIFdpN2w7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpaCA9IGdhbW1hMGggKyBXaTdoICsgKChXaWwgPj4+IDApIDwgKGdhbW1hMGwgPj4+IDApID8gMSA6IDApO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWwgPSBXaWwgKyBnYW1tYTFsO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWggPSBXaWggKyBnYW1tYTFoICsgKChXaWwgPj4+IDApIDwgKGdhbW1hMWwgPj4+IDApID8gMSA6IDApO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWwgPSBXaWwgKyBXaTE2bDtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2loICsgV2kxNmggKyAoKFdpbCA+Pj4gMCkgPCAoV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AgICAgICAgICAgICAgICAvLyB0MSA9IGggKyBzaWdtYTEgKyBjaCArIEtbaV0gKyBXW2ldXG5cdCAgICAgICAgICAgICAgICB2YXIgS2kgID0gS1tpXTtcblx0ICAgICAgICAgICAgICAgIHZhciBLaWggPSBLaS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgdmFyIEtpbCA9IEtpLmxvdztcblxuXHQgICAgICAgICAgICAgICAgdmFyIHQxbCA9IGhsICsgc2lnbWExbDtcblx0ICAgICAgICAgICAgICAgIHZhciB0MWggPSBoaCArIHNpZ21hMWggKyAoKHQxbCA+Pj4gMCkgPCAoaGwgPj4+IDApID8gMSA6IDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQxbCA9IHQxbCArIGNobDtcblx0ICAgICAgICAgICAgICAgIHZhciB0MWggPSB0MWggKyBjaGggKyAoKHQxbCA+Pj4gMCkgPCAoY2hsID4+PiAwKSA/IDEgOiAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciB0MWwgPSB0MWwgKyBLaWw7XG5cdCAgICAgICAgICAgICAgICB2YXIgdDFoID0gdDFoICsgS2loICsgKCh0MWwgPj4+IDApIDwgKEtpbCA+Pj4gMCkgPyAxIDogMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgdDFsID0gdDFsICsgV2lsO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQxaCA9IHQxaCArIFdpaCArICgodDFsID4+PiAwKSA8IChXaWwgPj4+IDApID8gMSA6IDApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyB0MiA9IHNpZ21hMCArIG1halxuXHQgICAgICAgICAgICAgICAgdmFyIHQybCA9IHNpZ21hMGwgKyBtYWpsO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQyaCA9IHNpZ21hMGggKyBtYWpoICsgKCh0MmwgPj4+IDApIDwgKHNpZ21hMGwgPj4+IDApID8gMSA6IDApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBVcGRhdGUgd29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgICAgIGhoID0gZ2g7XG5cdCAgICAgICAgICAgICAgICBobCA9IGdsO1xuXHQgICAgICAgICAgICAgICAgZ2ggPSBmaDtcblx0ICAgICAgICAgICAgICAgIGdsID0gZmw7XG5cdCAgICAgICAgICAgICAgICBmaCA9IGVoO1xuXHQgICAgICAgICAgICAgICAgZmwgPSBlbDtcblx0ICAgICAgICAgICAgICAgIGVsID0gKGRsICsgdDFsKSB8IDA7XG5cdCAgICAgICAgICAgICAgICBlaCA9IChkaCArIHQxaCArICgoZWwgPj4+IDApIDwgKGRsID4+PiAwKSA/IDEgOiAwKSkgfCAwO1xuXHQgICAgICAgICAgICAgICAgZGggPSBjaDtcblx0ICAgICAgICAgICAgICAgIGRsID0gY2w7XG5cdCAgICAgICAgICAgICAgICBjaCA9IGJoO1xuXHQgICAgICAgICAgICAgICAgY2wgPSBibDtcblx0ICAgICAgICAgICAgICAgIGJoID0gYWg7XG5cdCAgICAgICAgICAgICAgICBibCA9IGFsO1xuXHQgICAgICAgICAgICAgICAgYWwgPSAodDFsICsgdDJsKSB8IDA7XG5cdCAgICAgICAgICAgICAgICBhaCA9ICh0MWggKyB0MmggKyAoKGFsID4+PiAwKSA8ICh0MWwgPj4+IDApID8gMSA6IDApKSB8IDA7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICBIMGwgPSBIMC5sb3cgID0gKEgwbCArIGFsKTtcblx0ICAgICAgICAgICAgSDAuaGlnaCA9IChIMGggKyBhaCArICgoSDBsID4+PiAwKSA8IChhbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBIMWwgPSBIMS5sb3cgID0gKEgxbCArIGJsKTtcblx0ICAgICAgICAgICAgSDEuaGlnaCA9IChIMWggKyBiaCArICgoSDFsID4+PiAwKSA8IChibCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBIMmwgPSBIMi5sb3cgID0gKEgybCArIGNsKTtcblx0ICAgICAgICAgICAgSDIuaGlnaCA9IChIMmggKyBjaCArICgoSDJsID4+PiAwKSA8IChjbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBIM2wgPSBIMy5sb3cgID0gKEgzbCArIGRsKTtcblx0ICAgICAgICAgICAgSDMuaGlnaCA9IChIM2ggKyBkaCArICgoSDNsID4+PiAwKSA8IChkbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBINGwgPSBINC5sb3cgID0gKEg0bCArIGVsKTtcblx0ICAgICAgICAgICAgSDQuaGlnaCA9IChINGggKyBlaCArICgoSDRsID4+PiAwKSA8IChlbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBINWwgPSBINS5sb3cgID0gKEg1bCArIGZsKTtcblx0ICAgICAgICAgICAgSDUuaGlnaCA9IChINWggKyBmaCArICgoSDVsID4+PiAwKSA8IChmbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBINmwgPSBINi5sb3cgID0gKEg2bCArIGdsKTtcblx0ICAgICAgICAgICAgSDYuaGlnaCA9IChINmggKyBnaCArICgoSDZsID4+PiAwKSA8IChnbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBIN2wgPSBINy5sb3cgID0gKEg3bCArIGhsKTtcblx0ICAgICAgICAgICAgSDcuaGlnaCA9IChIN2ggKyBoaCArICgoSDdsID4+PiAwKSA8IChobCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5hbGl6ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRhdGEgPSB0aGlzLl9kYXRhO1xuXHQgICAgICAgICAgICB2YXIgZGF0YVdvcmRzID0gZGF0YS53b3JkcztcblxuXHQgICA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DUwLCAzNiwgMjksIDMyXG5cdCAgICBdO1xuXG5cdCAgICAvLyBDdW11bGF0aXZlIGJpdCBzaGlmdCBjb25zdGFudHNcblx0ICAgIHZhciBCSVRfU0hJRlRTID0gWzEsICAyLCAgNCwgIDYsICA4LCAgMTAsIDEyLCAxNCwgMTUsIDE3LCAxOSwgMjEsIDIzLCAyNSwgMjcsIDI4XTtcblxuXHQgICAgLy8gU0JPWGVzIGFuZCByb3VuZCBwZXJtdXRhdGlvbiBjb25zdGFudHNcblx0ICAgIHZhciBTQk9YX1AgPSBbXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4ODA4MjAwLFxuXHQgICAgICAgICAgICAweDEwMDAwMDAwOiAweDgwMDAsXG5cdCAgICAgICAgICAgIDB4MjAwMDAwMDA6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDMwMDAwMDAwOiAweDIsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwMDA6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDUwMDAwMDAwOiAweDgwODIwMixcblx0ICAgICAgICAgICAgMHg2MDAwMDAwMDogMHg4MDAyMDIsXG5cdCAgICAgICAgICAgIDB4NzAwMDAwMDA6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAwOiAweDIwMixcblx0ICAgICAgICAgICAgMHg5MDAwMDAwMDogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4YTAwMDAwMDA6IDB4ODIwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDAwMDogMHg4MDgwMDAsXG5cdCAgICAgICAgICAgIDB4YzAwMDAwMDA6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhkMDAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMDogMHg4MjAyLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxODAwMDAwMDogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4MjgwMDAwMDA6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHgzODAwMDAwMDogMHg4MDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAwOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwMDogMHgyMDAsXG5cdCAgICAgICAgICAgIDB4NjgwMDAwMDA6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDc4MDAwMDAwOiAweDIsXG5cdCAgICAgICAgICAgIDB4ODgwMDAwMDA6IDB4ODAwMjAwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAwOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDAwMDA6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDAwOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhjODAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwMDA6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhlODAwMDAwMDogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDA6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDE6IDB4ODAwMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwMTogMHgyLFxuXHQgICAgICAgICAgICAweDIwMDAwMDAxOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwMDE6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDUwMDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4NjAwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMTogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4OTAwMDAwMDE6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDAxOiAweDgwMDAwMixcblx0ICAgICAgICAgICAgMHhiMDAwMDAwMTogMHg4MjAyLFxuXHQgICAgICAgICAgICAweGMwMDAwMDAxOiAweDIwMixcblx0ICAgICAgICAgICAgMHhkMDAwMDAwMTogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDE6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE6IDB4ODA4MjAyLFxuXHQgICAgICAgICAgICAweDE4MDAwMDAxOiAweDgwODAwMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzgwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAxOiAweDgwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDAwMDE6IDB4ODAwMDAyLFxuXHQgICAgICAgICAgICAweDY4MDAwMDAxOiAweDIsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDE6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHg4ODAwMDAwMTogMHg4MDAyLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhhODAwMDAwMTogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDE6IDB4ODA4MjAwLFxuXHQgICAgICAgICAgICAweGM4MDAwMDAxOiAweDgwMDIwMCxcblx0ICAgICAgICAgICAgMHhkODAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweGU4MDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDE6IDB4ODA4MDAyXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4MjAwMDAwMDogMHg4MDAwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwOiAweDQwMDgwMDEwLFxuXHQgICAgICAgICAgICAweDQwMDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4NTAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDAwOiAweDQwMDA0MDAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDA6IDB4MTAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDogMHg4NDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwMDAwOiAweDQwMDA0MDEwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDA6IDB4NDAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHhjMDAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweGQwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDA6IDB4NDAwMDQwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwOiAweDEwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDA6IDB4NDAwMDQwMTAsXG5cdCAgICAgICAgICAgIDB4NDgwMDAwMDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwOiAweDQwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDY4MDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHg4ODAwMDAwOi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wMTAsXG5cdCAgICAgICAgICAgIDB4MTA4MDAwMDA6IDB4ODQwMTAsXG5cdCAgICAgICAgICAgIDB4MTE4MDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDAwMDA6IDB4NDAwODAwMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDAwMDA6IDB4NDAwMCxcblx0ICAgICAgICAgICAgMHgxNDgwMDAwMDogMHg0MDAwNDAwMCxcblx0ICAgICAgICAgICAgMHgxNTgwMDAwMDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHgxNjgwMDAwMDogMHgxMCxcblx0ICAgICAgICAgICAgMHgxNzgwMDAwMDogMHg0MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODgwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHgxOTgwMDAwMDogMHg0MDAwMDAxMCxcblx0ICAgICAgICAgICAgMHgxYTgwMDAwMDogMHg0MDAwNDAxMCxcblx0ICAgICAgICAgICAgMHgxYjgwMDAwMDogMHg4MDAxMCxcblx0ICAgICAgICAgICAgMHgxYzgwMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkODAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDA6IDB4NDAwODAwMTAsXG5cdCAgICAgICAgICAgIDB4MWY4MDAwMDA6IDB4ODQwMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgyMDAwMDA6IDB4NDAwMDEwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwOiAweDEwMDA0LFxuXHQgICAgICAgICAgICAweDUwMDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDYwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDcwMDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDkwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDA6IDB4NDAxMDAwNCxcblx0ICAgICAgICAgICAgMHhjMDAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHhkMDAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwOiAweDEwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDI4MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDogMHg0MDAwMTAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDU4MDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHg2ODAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHg4ODAwMDA6IDB4NCxcblx0ICAgICAgICAgICAgMHg5ODAwMDA6IDB4MTAwLFxuXHQgICAgICAgICAgICAweGE4MDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHhjODAwMDA6IDB4MTAxMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwOiAweDQwMDAxMDQsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwOiAweDQwMTAxMDQsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwOiAweDQwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDExMDAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTQwMDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTUwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDE2MDAwMDA6IDB4NDAwMDAwNCxcblx0ICAgICAgICAgICAgMHgxNzAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg0MDAwMTA0LFxuXHQgICAgICAgICAgICAweDE5MDAwMDA6IDB4NDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4MWIwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHgxYzAwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWQwMDAwMDogMHgxMDQsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHgxZjAwMDAwOiAweDQwMTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTA4MDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDExODAwMDA6IDB4MTA0LFxuXHQgICAgICAgICAgICAweDEyODAwMDA6IDB4NDAxMDEwMCxcblx0ICAgICAgICAgICAgMHgxMzgwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDAwMDogMHgxMDAwNCxcblx0ICAgICAgICAgICAgMHgxNTgwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTY4MDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDE4ODAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDFhODAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDFjODAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHgxZDgwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDogMHg0LFxuXHQgICAgICAgICAgICAweDFmODAwMDA6IDB4MTAxMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwNDAxMDAwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDIwMDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgzMDAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHg0MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDUwMDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHg3MDAwMDogMHg0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4OTAwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweGIwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweGMwMDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweGQwMDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHhmMDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg4MDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDM4MDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg2ODAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDc4MDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDg4MDAwOiAweDEwMDAsXG5cdCAgICAgICAgICAgIDB4OTgwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4YzgwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweGU4MDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHhmODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDExMDAwMDogMHg0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwOiAweDgwMDAwMDQwLFxuXHQgICAgICAgICAgICAweDEzMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDE0MDAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDE1MDAwMDogMHg4MDQwMDA0MCxcblx0ICAgICAgICAgICAgMHgxNjAwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTcwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwMDogMHg0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MWMwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDFkMDAwMDogMHg0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDFmMDAwMDogMHgxMDAwLFxuXHQgICAgICAgICAgICAweDEwODAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMTgwMDA6IDB4ODA0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxNDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDE1ODAwMDogMHg4MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNjgwMDA6IDB4ODAwMDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDE4ODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHgxYTgwMDA6IDB4ODAwMDEwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDFjODAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDFkODAwMDogMHg4MDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxZTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweDFmODAwMDogMHg0MDEwNDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgyMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDMwMDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg1MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4NjAwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHg3MDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDgwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDA6IDB4MjAwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YjAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhjMDAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweGQwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwOiAweDEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxODAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDI4MDA6IDB4ODAsXG5cdCAgICAgICAgICAgIDB4MzgwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg2ODAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDc4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODgwMDogMHgyMDA0MDAwMCxcblx0ICAgICAgICAgICAgMHg5ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhiODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YzgwMDogMHgyMDAwMDA4MCxcblx0ICAgICAgICAgICAgMHhkODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweGU4MDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDExMDAwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEyMDAwOiAweDIwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEzMDAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDE0MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MTUwMDA6IDB4MjEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTYwMDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTcwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDFkMDAwOiAweDIwMDAwMDgwLFxuXHQgICAgICAgICAgICAweDFlMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxMDgwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHgxMTgwMDogMHgxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEyODAwOiAweDEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTU4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxNjgwMDogMHg4MCxcblx0ICAgICAgICAgICAgMHgxNzgwMDogMHgyMTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxODgwMDogMHg0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxYTgwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFiODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDFjODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MWQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDA6IDB4MjAwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDA6IDB4MjAwMDAwODBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDEwMDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweDIwMDogMHgxMDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgzMDA6IDB4MTAyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NDAwOiAweDEwMDAyMDAwLFxuXHQgICAgICAgICAgICAweDUwMDogMHgyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NjAwOiAweDIwMDAwOCxcblx0ICAgICAgICAgICAgMHg3MDA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4OTAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweGEwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwOiAweDgsXG5cdCAgICAgICAgICAgIDB4YzAwOiAweDEwMjAwMDA4LFxuXHQgICAgICAgICAgICAweGQwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZTAwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZjAwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweDgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgyODA6IDB4OCxcblx0ICAgICAgICAgICAgMHgzODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NTgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDY4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHg3ODA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHg4ODA6IDB4MjAwMDA4LFxuXHQgICAgICAgICAgICAweDk4MDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweGE4MDogMHgxMDAwMjAwOCxcblx0ICAgICAgICAgICAgMHhiODA6IDB4MTAyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4YzgwOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZDgwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweGU4MDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTAwMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwMDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxMjAwOiAweDEwMjAyMDA4LFxuXHQgICAgICAgICAgICAweDEzMDA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHgxNDAwOiAweDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE2MDA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTcwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTkwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFhMDA6IDB4OCxcblx0ICAgICAgICAgICAgMHgxYjAwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDA6IDB4MjAwMCxcblx0ICAgICAgICAgICAgMHgxZDAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweDFlMDA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTA4MDogMHg4LFxuXHQgICAgICAgICAgICAweDExODA6IDB4MjAyMDAwLFxuXHQgICAgICAgICAgICAweDEyODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDEzODA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTQ4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHgxNTgwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTY4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgxNzgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4ODA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxYTgwOiAweDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MWM4MDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MWQ4MDogMHgwLFxuXHQgICAgICAgICAgICAweDFlODA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDogMHgxMDAwMjAwOFxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDEwOiAweDIwMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MjA6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDMwOiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHg0MDogMHgyMTAwNDAxLFxuXHQgICAgICAgICAgICAweDUwOiAweDAsXG5cdCAgICAgICAgICAgIDB4NjA6IDB4MSxcblx0ICAgICAgICAgICAgMHg3MDogMHgyMTAwMDAxLFxuXHQgICAgICAgICAgICAweDgwOiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4OTA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweGEwOiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4YjA6IDB4MjEwMDQwMCxcblx0ICAgICAgICAgICAgMHhjMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweGQwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHhlMDogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4ZjA6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4OiAweDIxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTg6IDB4MCxcblx0ICAgICAgICAgICAgMHgyODogMHgyMDAwNDAxLFxuXHQgICAgICAgICAgICAweDM4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4NDg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDU4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Njg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg3ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4ODg6IDB4MTAwNDAxLFxuXHQgICAgICAgICAgICAweDk4OiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4YTg6IDB4MjEwMDAwMCxcblx0ICAgICAgICAgICAgMHhiODogMHgxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Yzg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweGQ4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4ZTg6IDB4MSxcblx0ICAgICAgICAgICAgMHhmODogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTAwOiAweDIwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwOiAweDEwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMjA6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMzA6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxNDA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweDE1MDogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDE2MDogMHgyMTAwNDAwLFxuXHQgICAgICAgICAgICAweDE3MDogMHgxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MTgwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHgxOTA6IDB4MjEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxYTA6IDB4MTAwNDAwLFxuXHQgICAgICAgICAgICAweDFiMDogMHgxLFxuXHQgICAgICAgICAgICAweDFjMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweDFlMDogMHgyMDAwMDAxLFxuXHQgICAgICAgICAgICAweDFmMDogMHg0MDAsXG5cdCAgICAgICAgICAgIDB4MTA4OiAweDEwMDQwMCxcblx0ICAgICAgICAgICAgMHgxMTg6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMjg6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxMzg6IDB4MSxcblx0ICAgICAgICAgICAgMHgxNDg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDE2ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4MTc4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTg4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTk4OiAweDIxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWE4OiAweDAsXG5cdCAgICAgICAgICAgIDB4MWI4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MWM4OiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxZDg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDFlODogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDFmODogMHgxMDAwMDFcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwMDA4MjAsXG5cdCAgICAgICAgICAgIDB4MTogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgyOiAweDgwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzogMHgyMCxcblx0ICAgICAgICAgICAgMHg0OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDU6IDB4ODAyMDgyMCxcblx0ICAgICAgICAgICAgMHg2OiAweDgwMjA4MDAsXG5cdCAgICAgICAgICAgIDB4NzogMHg4MDAsXG5cdCAgICAgICAgICAgIDB4ODogMHg4MDIwMDAwLFxuXHQgICAgICAgICAgICAweDk6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHhhOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweGI6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHhjOiAweDgyMCxcblx0ICAgICAgICAgICAgMHhkOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZTogMHg4MDAwMDIwLFxuXHQgICAgICAgICAgICAweGY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDA6IDB4ODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAxOiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMzogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA0OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDU6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDc6IDB4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDg6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwOTogMHg4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGE6IDB4MjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGI6IDB4ODAyMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwYzogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBkOiAweDgwMjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGU6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwZjogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxMDogMHgyMDgyMCxcblx0ICAgICAgICAgICAgMHgxMTogMHg4MDIwODAwLFxuXHQgICAgICAgICAgICAweDEyOiAweDIwLFxuXHQgICAgICAgICAgICAweDEzOiAweDgwMCxcblx0ICAgICAgICAgICAgMHgxNDogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDE1OiAweDgwMDAwMjAsXG5cdCAgICAgICAgICAgIDB4MTY6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHgxNzogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxODogMHgwLFxuXHQgICAgICAgICAgICAweDE5OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDFhOiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4MWI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHgxYzogMHg4MDIwODIwLFxuXHQgICAgICAgICAgICAweDFkOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweDFlOiAweDgyMCxcblx0ICAgICAgICAgICAgMHgxZjogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEwOiAweDIwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDExOiAweDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxMjogMHg4MDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEzOiAweDIwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE0OiAweDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE1OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTY6IDB4ODAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxNzogMHg4MDAwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE4OiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTk6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxYTogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFiOiAweDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWM6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWQ6IDB4ODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFlOiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFmOiAweDgwMjA4MDBcblx0ICAgICAgICB9XG5cdCAgICBdO1xuXG5cdCAgICAvLyBNYXNrcyB0aGF0IHNlbGVjdCB0aGUgU0JPWCBpbnB1dFxuXHQgICAgdmFyIFNCT1hfTUFTSyA9IFtcblx0ICAgICAgICAweGY4MDAwMDAxLCAweDFmODAwMDAwLCAweDAxZjgwMDAwLCAweDAwMWY4MDAwLFxuXHQgICAgICAgIDB4MDAwMWY4MDAsIDB4MDAwMDFmODAsIDB4MDAwMDAxZjgsIDB4ODAwMDAwMWZcblx0ICAgIF07XG5cblx0ICAgIC8qKlxuXHQgICAgICogREVTIGJsb2NrIGNpcGhlciBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBERVMgPSBDX2FsZ28uREVTID0gQmxvY2tDaXBoZXIuZXh0ZW5kKHtcblx0ICAgICAgICBfZG9SZXNldDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGtleSA9IHRoaXMuX2tleTtcblx0ICAgICAgICAgICAgdmFyIGtleVdvcmRzID0ga2V5LndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFNlbGVjdCA1NiBiaXRzIGFjY29yZGluZyB0byBQQzFcblx0ICAgICAgICAgICAgdmFyIGtleUJpdHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qml0UG9zID0gUEMxW2ldIC0gMTtcblx0ICAgICAgICAgICAgICAgIGtleUJpdHNbaV0gPSAoa2V5V29yZHNba2V5Qml0UG9zID4+PiA1XSA+Pj4gKDMxIC0ga2V5Qml0UG9zICUgMzIpKSAmIDE7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBBc3NlbWJsZSAxNiBzdWJrZXlzXG5cdCAgICAgICAgICAgIHZhciBzdWJLZXlzID0gdGhpcy5fc3ViS2V5cyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBuU3ViS2V5ID0gMDsgblN1YktleSA8IDE2OyBuU3ViS2V5KyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBzdWJrZXlcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW25TdWJLZXldID0gW107XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgYml0U2hpZnQgPSBCSVRfU0hJRlRTW25TdWJLZXldO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTZWxlY3QgNDggYml0cyBhY2NvcmRpbmcgdG8gUEMyXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBTZWxlY3QgZnJvbSB0aGUgbGVmdCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVsoaSAvIDYpIHwgMF0gfD0ga2V5Qml0c1soKFBDMltpXSAtIDEpICsgYml0U2hpZnQpICUgMjhdIDw8ICgzMSAtIGkgJSA2KTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNlbGVjdCBmcm9tIHRoZSByaWdodCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVs0ICsgKChpIC8gNikgfCAwKV0gfD0ga2V5Qml0c1syOCArICgoKFBDMltpICsgMjRdIC0gMSkgKyBiaXRTaGlmdCkgJSAyOCldIDw8ICgzMSAtIGkgJSA2KTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gU2luY2UgZWFjaCBzdWJrZXkgaXMgYXBwbGllZCB0byBhbiBleHBhbmRlZCAzMi1iaXQgaW5wdXQsXG5cdCAgICAgICAgICAgICAgICAvLyB0aGUgc3Via2V5IGNhbiBiZSBicm9rZW4gaW50byA4IHZhbHVlcyBzY2FsZWQgdG8gMzItYml0cyxcblx0ICAgICAgICAgICAgICAgIC8vIHdoaWNoIGFsbG93cyB0aGUga2V5IHRvIGJlIHVzZWQgd2l0aG91dCBleHBhbnNpb25cblx0ICAgICAgICAgICAgICAgIHN1YktleVswXSA9IChzdWJLZXlbMF0gPDwgMSkgfCAoc3ViS2V5WzBdID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IDc7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVtpXSA9IHN1YktleVtpXSA+Pj4gKChpIC0gMSkgKiA0ICsgMyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICBzdWJLZXlbN10gPSAoc3ViS2V5WzddIDw8IDUpIHwgKHN1YktleVs3XSA+Pj4gMjcpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBpbnZlcnNlIHN1YmtleXNcblx0ICAgICAgICAgICAgdmFyIGludlN1YktleXMgPSB0aGlzLl9pbnZTdWJLZXlzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaW52U3ViS2V5c1tpXSA9IHN1YktleXNbMTUgLSBpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBlbmNyeXB0QmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgdGhpcy5fZG9DcnlwdEJsb2NrKE0sIG9mZnNldCwgdGhpcy5fc3ViS2V5cyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGRlY3J5cHRCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICB0aGlzLl9kb0NyeXB0QmxvY2soTSwgb2Zmc2V0LCB0aGlzLl9pbnZTdWJLZXlzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvQ3J5cHRCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCwgc3ViS2V5cykge1xuXHQgICAgICAgICAgICAvLyBHZXQgaW5wdXRcblx0ICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gTVtvZmZzZXRdO1xuXHQgICAgICAgICAgICB0aGlzLl9yQmxvY2sgPSBNW29mZnNldCArIDFdO1xuXG5cdCAgICAgICAgICAgIC8vIEluaXRpYWwgcGVybXV0YXRpb25cblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDQsICAweDBmMGYwZjBmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDE2LCAweDAwMDBmZmZmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VSTC5jYWxsKHRoaXMsIDIsICAweDMzMzMzMzMzKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VSTC5jYWxsKHRoaXMsIDgsICAweDAwZmYwMGZmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDEsICAweDU1NTU1NTU1KTtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgcm91bmQgPSAwOyByb3VuZCA8IDE2OyByb3VuZCsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW3JvdW5kXTtcblx0ICAgICAgICAgICAgICAgIHZhciBsQmxvY2sgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgICAgICB2YXIgckJsb2NrID0gdGhpcy5fckJsb2NrO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBGZWlzdGVsIGZ1bmN0aW9uXG5cdCAgICAgICAgICAgICAgICB2YXIgZiA9IDA7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGYgfD0gU0JPWF9QW2ldWygockJsb2NrIF4gc3ViS2V5W2ldKSAmIFNCT1hfTUFTS1tpXSkgPj4+IDBdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gckJsb2NrO1xuXHQgICAgICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gbEJsb2NrIF4gZjtcblx0ICAgICAgICAgICAg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0gbG93O1xuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEJpdHdpc2UgTk9UcyB0aGlzIHdvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgbmVnYXRpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBuZWdhdGVkID0geDY0V29yZC5ub3QoKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyBub3Q6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSB+dGhpcy5oaWdoO1xuXHQgICAgICAgICAgICAvLyB2YXIgbG93ID0gfnRoaXMubG93O1xuXG5cdCAgICAgICAgICAgIC8vIHJldHVybiBYNjRXb3JkLmNyZWF0ZShoaWdoLCBsb3cpO1xuXHQgICAgICAgIC8vIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBCaXR3aXNlIEFORHMgdGhpcyB3b3JkIHdpdGggdGhlIHBhc3NlZCB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtYNjRXb3JkfSB3b3JkIFRoZSB4NjQtV29yZCB0byBBTkQgd2l0aCB0aGlzIHdvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgQU5EaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgYW5kZWQgPSB4NjRXb3JkLmFuZChhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gYW5kOiBmdW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ICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbiBUaGUgbnVtYmVyIG9mIGJpdHMgdG8gcm90YXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIHJvdGF0aW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgcm90YXRlZCA9IHg2NFdvcmQucm90Uig3KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RSOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdFIobikub3IodGhpcy5zaGlmdEwoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEFkZHMgdGhpcyB3b3JkIHdpdGggdGhlIHBhc3NlZCB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtYNjRXb3JkfSB3b3JkIFRoZSB4NjQtV29yZCB0byBhZGQgd2l0aCB0aGlzIHdvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgYWRkaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgYWRkZWQgPSB4NjRXb3JkLmFkZChhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gYWRkOiBmdW5jdGlvbiAod29yZCkge1xuXHQgICAgICAgICAgICAvLyB2YXIgbG93ID0gKHRoaXMubG93ICsgd29yZC5sb3cpIHwgMDtcblx0ICAgICAgICAgICAgLy8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2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoKTtcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoW1xuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MDAwMTAyMDMsIDB4MDQwNTA2MDcpLFxuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MTgxOTFhMWIsIDB4MWMxZDFlMWYpXG5cdCAgICAgICAgICogICAgIF0pO1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy54NjQuV29yZEFycmF5LmNyZWF0ZShbXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgwMDAxMDIwMywgMHgwNDA1MDYwNyksXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgxODE5MWExYiwgMHgxYzFkMWUxZilcblx0ICAgICAgICAgKiAgICAgXSwgMTApO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uICh3b3Jkcywgc2lnQnl0ZXMpIHtcblx0ICAgICAgICAgICAgd29yZHMgPSB0aGlzLndvcmRzID0gd29yZHMgfHwgW107XG5cblx0ICAgICAgICAgICAgaWYgKHNpZ0J5dGVzICE9IHVuZGVmaW5lZCkge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHdvcmRzLmxlbmd0aCAqIDg7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgdGhpcyA2NC1iaXQgd29yZCBhcnJheSB0byBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7Q3J5cHRvSlMubGliLldvcmRBcnJheX0gVGhpcyB3b3JkIGFycmF5J3MgZGF0YSBhcyBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgeDMyV29yZEFycmF5ID0geDY0V29yZEFycmF5LnRvWDMyKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgdG9YMzI6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB4NjRXb3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB4NjRXb3Jkc0xlbmd0aCA9IHg2NFdvcmRzLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB4MzJXb3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHg2NFdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciB4NjRXb3JkID0geDY0V29yZHNbaV07XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQubG93KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBYMzJXb3JkQXJyYXkuY3JlYXRlKHgzMldvcmRzLCB0aGlzLnNpZ0J5dGVzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ3JlYXRlcyBhIGNvcHkgb2YgdGhpcyB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZEFycmF5fSBUaGUgY2xvbmUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjbG9uZSA9IHg2NFdvcmRBcnJheS5jbG9uZSgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEJhc2UuY2xvbmUuY2FsbCh0aGlzKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBcIndvcmRzXCIgYXJyYXlcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gY2xvbmUud29yZHMgPSB0aGlzLndvcmRzLnNsaWNlKDApO1xuXG5cdCAgICAgICAgICAgIC8vIENsb25lIGVhY2ggWDY0V29yZCBvYmplY3Rcblx0ICAgICAgICAgICAgdmFyIHdvcmRzTGVuZ3RoID0gd29yZHMubGVuZ3RoO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW2ldID0gd29yZHNbaV0uY2xvbmUoKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblx0fSgpKTtcblxuXG5cdHJldHVybiBDcnlwdG9KUztcblxufSkpOyIsIihmdW5jdGlvbiAoc2VsZikge1xuICAndXNlIHN0cmljdCc7XG5cbiAgZnVuY3Rpb24gZmV0Y2hQb255ZmlsbChvcHRpb25zKSB7XG4gICAgdmFyIFByb21pc2UgPSBvcHRpb25zICYmIG9wdGlvbnMuUHJvbWlzZSB8fCBzZWx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lCdWZmZXInIGluIHNlbGZcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChzdXBwb3J0LmFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgdmFyIHZpZXdDbGFzc2VzID0gW1xuICAgICAgICAgICAgJ1tvYmplY3QgSW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OENsYW1wZWRBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgSW50MTZBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgVWludDE2QXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEludDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IFVpbnQzMkFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBGbG9hdDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEZsb2F0NjRBcnJheV0nXG4gICAgICAgICAgXVxuXG4gICAgICAgICAgdmFyIGlzRGF0YVZpZXcgPSBmdW5jdGlvbihvYmopIHtcbiAgICAgICAgICAgIHJldHVybiBvYmogJiYgRGF0YVZpZXcucHJvdG90eXBlLmlzUHJvdG90eXBlT2Yob2JqKVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBpc0FycmF5QnVmZmVyVmlldyA9IEFycmF5QnVmZmVyLmlzVmlldyB8fCBmdW5jdGlvbihvYmopIHtcbiAgICAgICAgICAgIHJldHVybiBvYmogJiYgdmlld0NsYXNzZXMuaW5kZXhPZihPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwob2JqKSkgPiAtMVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIG5vcm1hbGl6ZU5hbWUobmFtZSkge1xuICAgICAgICAgIGlmICh0eXBlb2YgbmFtZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIG5hbWUgPSBTdHJpbmc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HJlYWQnKSlcbiAgICAgICAgICB9XG4gICAgICAgICAgYm9keS5ib2R5VXNlZCA9IHRydWVcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpIHtcbiAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICByZWFkZXIub25sb2FkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlc29sdmUocmVhZGVyLnJlc3VsdClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlYWRlci5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlamVjdChyZWFkZXIuZXJyb3IpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNBcnJheUJ1ZmZlcihibG9iKSB7XG4gICAgICAgICAgdmFyIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKClcbiAgICAgICAgICB2YXIgcHJvbWlzZSA9IGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpXG4gICAgICAgICAgcmVhZGVyLnJlYWRBc0FycmF5QnVmZmVyKGJsb2IpXG4gICAgICAgICAgcmV0dXJuIHByb21pc2VcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNUZXh0KGJsb2IpIHtcbiAgICAgICAgICB2YXIgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKVxuICAgICAgICAgIHZhciBwcm9taXNlID0gZmlsZVJlYWRlclJlYWR5KHJlYWRlcilcbiAgICAgICAgICByZWFkZXIucmVhZEFzVGV4dChibG9iKVxuICAgICAgICAgIHJldHVybiBwcm9taXNlXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiByZWFkQXJyYXlCdWZmZXJBc1RleHQoYnVmKSB7XG4gICAgICAgICAgdmFyIHZpZXcgPSBuZXcgVWludDhBcnJheShidWYpXG4gICAgICAgICAgdmFyIGNoYXJzID0gbmV3IEFycmF5KHZpZXcubGVuZ3RoKVxuXG4gICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB2aWV3Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjaGFyc1tpXSA9IFN0cmluZy5mcm9tQ2hhckNvZGUodmlld1tpXSlcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGNoYXJzLmpvaW4oJycpXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBidWZmZXJDbG9uZShidWYpIHtcbiAgICAgICAgICBpZiAoYnVmLnNsaWNlKSB7XG4gICAgICAgICAgICByZXR1cm4gYnVmLnNsaWNlKDApXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciB2aWV3ID0gbmV3IFVpbnQ4QXJyYXkoYnVmLmJ5dGVMZW5ndGgpXG4gICAgICAgICAgICB2aWV3LnNldChuZXcgVWludDhBcnJheShidWYpKVxuICAgICAgICAgICAgcmV0dXJuIHZpZXcuYnVmZmVyXG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gQm9keSgpIHtcbiAgICAgICAgICB0aGlzLmJvZHlVc2VkID0gZmFsc2VcblxuICAgICAgICAgIHRoaXMuX2luaXRCb2R5ID0gZnVuY3Rpb24oYm9keSkge1xuICAgICAgICAgICAgdGhpcy5fYm9keUluaXQgPSBib2R5XG4gICAgICAgICAgICBpZiAoIWJvZHkpIHtcbiAgICAgICAgICAgICAgdGhpcy5fYm9keVRleHQgPSAnJ1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgYm9keSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgdGhpcy5fYm9keVRleHQgPSBib2R5XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHN1cHBvcnQuYmxvYiA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gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd1bnN1cHBvcnRlZCBCb2R5SW5pdCB0eXBlJylcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCF0aGlzLmhlYWRlcnMuZ2V0KCdjb250ZW50LXR5cGUnKSkge1xuICAgICAgICAgICAgICBpZiAodHlwZW9mIGJvZHkgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgJ3RleHQvcGxhaW47Y2hhcnNldD1VVEYtOCcpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUJsb2IgJiYgdGhpcy5fYm9keUJsb2IudHlwZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuaGVhZGVycy5zZXQoJ2NvbnRlbnQtdHlwZScsIHRoaXMuX2JvZHlCbG9iLnR5cGUpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3VwcG9ydC5zZWFyY2hQYXJhbXMgJiYgVVJMU2VhcmNoUGFyYW1zLnByb3RvdHlwZS5pc1Byb3RvdHlwZU9mKGJvZHkpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZDtjaGFyc2V0PVVURi04JylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzdXBwb3J0LmJsb2IpIHtcbiAgICAgICAgICAgIHRoaXMuYmxvYiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgICBpZiAocmVqZWN0ZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0ZWRcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmICh0aGlzLl9ib2R5QmxvYikge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keUJsb2IpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShuZXcgQmxvYihbdGhpcy5fYm9keUFycmF5QnVmZmVyXSkpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdjb3VsZCBub3QgcmVhZCBGb3JtRGF0YSBib2R5IGFzIGJsb2InKVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUobmV3IEJsb2IoW3RoaXMuX2JvZHlUZXh0XSkpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5hcnJheUJ1ZmZlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbnN1bWVkKHRoaXMpIHx8IFByb21pc2UucmVzb2x2ZSh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYmxvYigpLnRoZW4ocmVhZEJsb2JBc0FycmF5QnVmZmVyKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50ZXh0ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgaWYgKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZWplY3RlZFxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5fYm9keUJsb2IpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlYWRCbG9iQXNUZXh0KHRoaXMuX2JvZHlCbG9iKVxuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShyZWFkQXJyYXlCdWZmZXJBc1RleHQodGhpcy5fYm9keUFycmF5QnVmZmVyKSlcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignY291bGQgbm90IHJlYWQgRm9ybURhdGEgYm9keSBhcyB0ZXh0JylcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keVRleHQpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHN1cHBvcnQuZm9ybURhdGEpIHtcbiAgICAgICAgICAgIHRoaXMuZm9ybURhdGEgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oZGVjb2RlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuanNvbiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oSlNPTi5wYXJzZSlcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gdGhpc1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gSFRUUCBtZXRob2RzIHdob3NlIGNhcGl0YWxpemF0aW9uIHNob3VsZCBiZSBub3JtYWxpemVkXG4gICAgICAgIHZhciBtZ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1cblxuICAgICAgICBmdW5jdGlvbiBkZWNvZGUoYm9keSkge1xuICAgICAgICAgIHZhciBmb3JtID0gbmV3IEZvcm1EYXRhKClcbiAgICAgICAgICBib2R5LnRyaW0oKS5zcGxpdCgnJicpLmZvckVhY2goZnVuY3Rpb24oYnl0ZXMpIHtcbiAgICAgICAgICAgIGlmIChieXRlcykge1xuICAgICAgICAgICAgICB2YXIgc3BsaXQgPSBieXRlcy5zcGxpdCgnPScpXG4gICAgICAgICAgICAgIHZhciBuYW1lID0gc3BsaXQuc2hpZnQoKS5yZXBsYWNlKC9cXCsvZywgJyAnKVxuICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBzcGxpdC5qb2luKCc9JykucmVwbGFjZSgvXFwrL2csICcgJylcbiAgICAgICAgICAgICAgZm9ybS5hcHBlbmQoZGVjb2RlVVJJQ29tcG9uZW50KG5hbWUpLCBkZWNvZGVVUklDb21wb25lbnQodmFsdWUpKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGZvcm1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHBhcnNlSGVhZGVycyhyYXdIZWFkZXJzKSB7XG4gICAgICAgICAgdmFyIGhlYWRlcnMgPSBuZXcgSGVhZGVycygpXG4gICAgICAgICAgcmF3SGVhZGVycy5zcGxpdCgvXFxyP1xcbi8pLmZvckVhY2goZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgdmFyIHBhcnRzID0gbGluZS5zcGxpdCgnOicpXG4gICAgICAgICAgICB2YXIga2V5ID0gcGFydHMuc2hpZnQoKS50cmltKClcbiAgICAgICAgICAgIGlmIChrZXkpIHtcbiAgICAgICAgICAgICAgdmFyIHZhbHVlID0gcGFydHMuam9pbignOicpLnRyaW0oKVxuICAgICAgICAgICAgICBoZWFkZXJzLmFwcGVuZChrZXksIHZhbHVlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJu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hociA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpXG5cbiAgICAgICAgICAgIHhoci5vbmxvYWQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdmFyIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgc3RhdHVzOiB4aHIuc3RhdHVzLFxuICAgICAgICAgICAgICAgIHN0YXR1c1RleHQ6IHhoci5zdGF0dXNUZXh0LFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHBhcnNlSGVhZGVycyh4aHIuZ2V0QWxsUmVzcG9uc2VIZWFkZXJzKCkgfHwgJycpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgb3B0aW9ucy51cmwgPSAncmVzcG9uc2VVUkwnIGluIHhociA/IHhoci5yZXNwb25zZVVSTCA6IG9wdGlvbnMuaGVhZGVycy5nZXQoJ1gtUmVxdWVzdC1VUkwnKVxuICAgICAgICAgICAgICB2YXIgYm9keSA9ICdyZXNwb25zZScgaW4geGhyID8geGhyLnJlc3BvbnNlIDogeGhyLnJlc3BvbnNlVGV4dFxuICAgICAgICAgICAgICByZXNvbHZlKG5ldyBSZXNwb25zZShib2R5LCBvcHRpb25zKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmVqZWN0KG5ldyBUeXBlRXJyb3IoJ05ldHdvcmsgcmVxdWVzdCBmYWlsZWQnKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9udGltZW91dCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZWplY3QobmV3IFR5cGVFcnJvcignTmV0d29yayByZXF1ZXN0IGZhaWxlZCcpKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB4aHIub3BlbihyZXF1ZXN0Lm1ldGhvZCwgcmVxdWVzdC51cmwsIHRydWUpXG5cbiAgICAgICAgICAgIGlmIChyZXF1ZXN0LmNy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MSkge1xuICAgICAgICAgICAga2V5ID0gb3B0aW9ucy5kZWNvZGVyKHBhcnQsIGRlZmF1bHRzLmRlY29kZXIpO1xuICAgICAgICAgICAgdmFsID0gb3B0aW9ucy5zdHJpY3ROdWxsSGFuZGxpbmcgPyBudWxsIDogJyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSBvcHRpb25zLmRlY29kZXIocGFydC5zbGljZSgwLCBwb3MpLCBkZWZhdWx0cy5kZWNvZGVyKTtcbiAgICAgICAgICAgIHZhbCA9IG9wdGlvbnMuZGVjb2RlcihwYXJ0LnNsaWNlKHBvcyArIDEpLCBkZWZhdWx0cy5kZWNvZGVyKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaGFzLmNhbGwob2JqLCBrZXkpKSB7XG4gICAgICAgICAgICBvYmpba2V5XSA9IFtdLmNvbmNhdChvYmpba2V5XSkuY29uY2F0KHZhbCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvYmpba2V5XSA9IHZhbDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBvYmo7XG59O1xuXG52YXIgcGFyc2VPYmplY3QgPSBmdW5jdGlvbiAoY2hhaW4sIHZhbCwgb3B0aW9ucykge1xuICAgIHZhciBsZWFmID0gdmFsO1xuXG4gICAgZm9yICh2YXIgaSA9IGNoYWluLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBvYmo7XG4gICAgICAgIHZhciByb290ID0gY2hhaW5baV07XG5cbiAgICAgICAgaWYgKHJvb3QgPT09ICdbXScpIHtcbiAgICAgICAgICAgIG9iaiA9IFtdO1xuICAgICAgICAgICAgb2JqID0gb2JqLmNvbmNhdChsZWFmKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9iaiA9IG9wdGlvbnMucGxhaW5PYmplY3RzID8gT2JqZWN0LmNyZWF0ZShudWxsKSA6IHt9O1xuICAgICAgICAgICAgdmFyIGNsZWFuUm9vdCA9IHJvb3QuY2hhckF0KDApID09PSAnWycgJiYgcm9vdC5jaGFyQXQocm9vdC5sZW5ndGggLSAxKSA9PT0gJ10nID8gcm9vdC5zbGljZSgxLCAtMSkgOiByb290O1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gcGFyc2VJbnQoY2xlYW5Sb290LCAxMCk7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgIWlzTmFOKGluZGV4KVxuICAgICAgICAgICAgICAgICYmIHJvb3QgIT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIFN0cmluZyhpbmRleCkgPT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIGluZGV4ID49IDBcbiAgICAgICAgICAgICAgICAmJiAob3B0aW9ucy5wYXJzZUFycmF5cyAmJiBpbmRleCA8PSBvcHRpb25zLmFycmF5TGltaXQpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBvYmogPSBbXTtcbiAgICAgICAgICAgICAgICBvYmpbaW5kZXhdID0gbGVhZjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb2JqW2NsZWFuUm9vdF0gPSBsZWFmO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbGVhZiA9IG9iajtcbiAgICB9XG5cbiAgICByZXR1cm4gbGVhZjtcbn07XG5cbnZhciBwYXJzZUtleXMgPSBmdW5jdGlvbiBwYXJzZVF1ZXJ5U3RyaW5nS2V5cyhnaXZlbktleSwgdmFsLCBvcHRpb25zKSB7XG4gICAgaWYgKCFnaXZlbktleSkge1xuICAgICAgICByZXR1cm47XG4gICAgfVxuXG4gICAgLy8gVHJhbnNmb3JtIGRvdCBub3RhdGlvbiB0byBicmFja2V0IG5vdGF0aW9uXG4gICAgdmFyIGtleSA9IG9wdGlvbnMuYWxsb3dEb3RzID8gZ2l2ZW5LZXkucmVwbGFjZSgvXFwuKFteLltdKykvZyw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JqID09PSAnbnVtYmVyJyB8fCB0eXBlb2Ygb2JqID09PSAnYm9vbGVhbicgfHwgdXRpbHMuaXNCdWZmZXIob2JqKSkge1xuICAgICAgICBpZiAoZW5jb2Rlcikge1xuICAgICAgICAgICAgdmFyIGtleVZhbHVlID0gZW5jb2RlVmFsdWVzT25seSA/IHByZWZpeCA6IGVuY29kZXIocHJlZml4LCBkZWZhdWx0cy5lbmNvZGVyKTtcbiAgICAgICAgICAgIHJldHVybiBbZm9ybWF0dGVyKGtleVZhbHVlKSArICc9JyArIGZvcm1hdHRlcihlbmNvZGVyKG9iaiwgZGVmYXVsdHMuZW5jb2RlcikpXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gW2Zvcm1hdHRlcihwcmVmaXgpICsgJz0nICsgZm9ybWF0dGVyKFN0cmluZyhvYmopKV07XG4gICAgfVxuXG4gICAgdmFyIHZhbHVlcyA9IFtdO1xuXG4gICAgaWYgKHR5cGVvZiBvYmogPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIHJldHVybiB2YWx1ZXM7XG4gICAgfVxuXG4gICAgdmFyIG9iaktleXM7XG4gICAgaWYgKEFycmF5LmlzQXJyYXkoZmlsdGVyKSkge1xuICAgICAgICBvYmpLZXlzID0gZmlsdGVyO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMob2JqKTtcbiAgICAgICAgb2JqS2V5cyA9IHNvcnQgPyBrZXlzLnNvcnQoc29ydCkgOiBrZXlzO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgocHJlZml4LCBrZXkpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgICAgICBlbmNvZGVWYWx1ZXNPbmx5XG4gICAgICAgICAgICApKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIHByZWZpeCArIChhbGxvd0RvdHMgPyAnLicgKyBrZXkgOiAnWycgKyBrZXkgKyAnXScpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgICAgICBlbmNv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IHtcbiAgICAgICAgb2JqS2V5cy5zb3J0KHNvcnQpO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGtleXMgPSBrZXlzLmNvbmNhdChzdHJpbmdpZnkoXG4gICAgICAgICAgICBvYmpba2V5XSxcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICBlbmNvZGUgPyBlbmNvZGVyIDogbnVsbCxcbiAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgIHNvcnQsXG4gICAgICAgICAgICBhbGxvd0RvdHMsXG4gICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgZm9ybWF0dGVyLFxuICAgICAgICAgICAgZW5jb2RlVmFsdWVzT25seVxuICAgICAgICApKTtcbiAgICB9XG5cbiAgICB2YXIgam9pbmVkID0ga2V5cy5qb2luKGRlbGltaXRlcik7XG4gICAgdmFyIHByZWZpeCA9IG9wdGlvbnMuYWRkUXVlcnlQcmVmaXggPT09IHRydWUgPyAnPycgOiAnJztcblxuICAgIHJldHVybiBqb2luZWQubGVuZ3RoID4gMCA/IHByZWZpeCArIGpvaW5lZCA6ICcnO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxudmFyIGhhcyA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG5cbnZhciBoZXhUYWJsZSA9IChmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGFycmF5ID0gW107XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTY7ICsraSkge1xuICAgICAgICBhcnJheS5wdXNoKCclJyArICgoaSA8IDE2ID8gJzAnIDogJycpICsgaS50b1N0cmluZygxNikpLnRvVXBwZXJDYXNlKCkpO1xuICAgIH1cblxuICAgIHJldHVybiBhcnJheTtcbn0oKSk7XG5cbnZhciBjb21wYWN0UXVldWUgPSBmdW5jdGlvbiBjb21wYWN0UXVldWUocXVldWUpIHtcbiAgICB2YXIgb2JqO1xuXG4gICAgd2hpbGUgKHF1ZXVlLmxlbmd0aCkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlLnBvcCgpO1xuICAgICAgICBvYmogPSBpdGVtLm9ialtpdGVtLnByb3BdO1xuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhciBjb21wYWN0ZWQgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBvYmoubGVuZ3RoOyArK2opIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9ialtqXSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tcGFjdGVkLnB1c2gob2JqW2pdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGl0ZW0ub2JqW2l0ZW0ucHJvcF0gPSBjb21wYWN0ZWQ7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gb2JqO1xufTtcblxuZXhwb3J0cy5hcnJheVRvT2JqZWN0ID0gZnVuY3Rpb24gYXJyYXlUb09iamVjdChzb3VyY2UsIG9wdGlvbnMpIHtcbiAgICB2YXIgb2JqID0gb3B0aW9ucyAmJiBvcHRpb25zLnBsYWluT2JqZWN0cyA/IE9iamVjdC5jcmVhdGUobnVsbCkgOiB7fTtcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNvdXJjZS5sZW5ndGg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heShzb3VyY2UpKSB7XG4gICAgICAgIG1lcmdlVGFyZ2V0ID0gZXhwb3J0cy5hcnJheVRvT2JqZWN0KHRhcmdldCwgb3B0aW9ucyk7XG4gICAgfVxuXG4gICAgaWYgKEFycmF5LmlzQXJyYXkodGFyZ2V0KSAmJiBBcnJheS5pc0FycmF5KHNvdXJjZSkpIHtcbiAgICAgICAgc291cmNlLmZvckVhY2goZnVuY3Rpb24gKGl0ZW0sIGkpIHtcbiAgICAgICAgICAgIGlmIChoYXMuY2FsbCh0YXJnZXQsIGkpKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRhcmdldFtpXSAmJiB0eXBlb2YgdGFyZ2V0W2ldID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgICAgICB0YXJnZXRbaV0gPSBleHBvcnRzLm1lcmdlKHRhcmdldFtpXSwgaXRlbSwgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0LnB1c2goaXRlbSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0YXJnZXRbaV0gPSBpdGVtO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHRhcmdldDtcbiAgICB9XG5cbiAgICByZXR1cm4gT2JqZWN0LmtleXMoc291cmNlKS5yZWR1Y2UoZnVuY3Rpb24gKGFjYywga2V5KSB7XG4gICAgICAgIHZhciB2YWx1ZSA9IHNvdXJjZVtrZXldO1xuXG4gICAgICAgIGlmIChoYXMuY2FsbChhY2MsIGtleSkpIHtcbiAgICAgICAgICAgIGFjY1trZXldID0gZXhwb3J0cy5tZXJnZShhY2Nba2V5XSwgdmFsdWUsIG9wdGlvbnMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYWNjW2tleV0gPSB2YWx1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gY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GFyQ29kZUF0KGkpO1xuXG4gICAgICAgIGlmIChcbiAgICAgICAgICAgIGMgPT09IDB4MkQgLy8gLVxuICAgICAgICAgICAgfHwgYyA9PT0gMHgyRSAvLyAuXG4gICAgICAgICAgICB8fCBjID09PSAweDVGIC8vIF9cbiAgICAgICAgICAgIHx8IGMgPT09IDB4N0UgLy8gflxuICAgICAgICAgICAgfHwgKGMgPj0gMHgzMCAmJiBjIDw9IDB4MzkpIC8vIDAtOVxuICAgICAgICAgICAgfHwgKGMgPj0gMHg0MSAmJiBjIDw9IDB4NUEpIC8vIGEtelxuICAgICAgICAgICAgfHwgKGMgPj0gMHg2MSAmJiBjIDw9IDB4N0EpIC8vIEEtWlxuICAgICAgICApIHtcbiAgICAgICAgICAgIG91dCArPSBzdHJpbmcuY2hhckF0KGkpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODApIHtcbiAgICAgICAgICAgIG91dCA9IG91dCArIGhleFRhYmxlW2NdO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhDMCB8IChjID4+IDYpXSArIGhleFRhYmxlWzB4ODAgfCAoYyAmIDB4M0YpXSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjIDwgMHhEODAwIHx8IGMgPj0gMHhFMDAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhFMCB8IChjID4+IDEyKV0gKyBoZXhUYWJsZVsweDgwIHwgKChjID4+IDYpICYgMHgzRildICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaSArPSAxO1xuICAgICAgICBjID0gMHgxMDAwMCArICgoKGMgJiAweDNGRikgPDwgMTApIHwgKHN0cmluZy5jaGFyQ29kZUF0KGkpICYgMHgzRkYpKTtcbiAgICAgICAgb3V0ICs9IGhleFRhYmxlWzB4RjAgfCAoYyA+PiAxOCldXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gMTIpICYgMHgzRildXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gNikgJiAweDNGKV1cbiAgICAgICAgICAgICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQ7XG59O1xuXG5leHBvcnRzLmNvbXBhY3QgPSBmdW5jdGlvbiBjb21wYWN0KHZhbHVlKSB7XG4gICAgdmFyIHF1ZXVlID0gW3sgb2JqOiB7IG86IHZhbHVlIH0sIHByb3A6ICdvJyB9XTtcbiAgICB2YXIgcmVmcyA9IFtdO1xuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlW2ldO1xuICAgICAgICB2YXIgb2JqID0gaXRlbS5vYmpbaXRlbS5wcm9wXTtcblxuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwga2V5cy5sZW5ndGg7ICsraikge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbal07XG4gICAgICAgICAgICB2YXIgdmFsID0gb2JqW2tleV07XG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ29iamVjdCcgJiYgdmFsICE9PSBudWxsICYmIHJlZnMuaW5kZXhPZih2YWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHF1ZXVlLnB1c2goeyBvYmo6IG9iaiwgcHJvcDoga2V5IH0pO1xuICAgICAgICAgICAgICAgIHJlZnMucHVzaCh2YWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbXBhY3RRdWV1ZShxdWV1ZSk7XG59O1xuXG5leHBvcnRzLmlzUmVnRXhwID0gZnVuY3Rpb24gaXNSZWdFeHAob2JqKSB7XG4gICAgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopID09PSAnW29iamVjdCBSZWdFeHBdJztcbn07XG5cbmV4cG9ydHMuaXNCdWZmZXIgPSBmdW5jdGlvbiBpc0J1ZmZlcihvYmopIHtcbiAgICBpZiAob2JqID09PSBudWxsIHx8IHR5cGVvZiBvYmogPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICByZXR1cm4gISEob2JqLmNvbnN0cnVjdG9yICYmIG9iai5jb25zdHJ1Y3Rvci5pc0J1ZmZlciAmJiBvYmouY29uc3RydWN0b3IuaXNCdWZmZXIob2JqKSk7XG59O1xuIl19 diff --git a/ccxt.js b/ccxt.js index c997da7bc3f4..2d43921e572d 100644 --- a/ccxt.js +++ b/ccxt.js @@ -37,7 +37,7 @@ const errors = require ('./js/base/errors') //----------------------------------------------------------------------------- // this is updated by vss.js when building -const version = '1.10.291' +const version = '1.10.292' Exchange.ccxtVersion = version diff --git a/ccxt.php b/ccxt.php index 786ea8715baf..261e0150c2be 100644 --- a/ccxt.php +++ b/ccxt.php @@ -30,7 +30,7 @@ namespace ccxt; -$version = '1.10.291'; +$version = '1.10.292'; const CLASSES_DIR = __DIR__ . DIRECTORY_SEPARATOR . 'php' . DIRECTORY_SEPARATOR; diff --git a/package.json b/package.json index a28ac6f87890..8ed32ae6e77c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ccxt", - "version": "1.10.291", + "version": "1.10.292", "description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 90+ exchanges", "main": "./ccxt.js", "unpkg": "build/ccxt.browser.js", diff --git a/php/bithumb.php b/php/bithumb.php index 8807ce38518c..2813da2874d1 100644 --- a/php/bithumb.php +++ b/php/bithumb.php @@ -69,7 +69,7 @@ public function fetch_markets () { for ($i = 0; $i < count ($currencies); $i++) { $id = $currencies[$i]; if ($id != 'date') { - $market = $markets[$id]; + $market = $markets['data'][$id]; $base = $id; $quote = 'KRW'; $symbol = $id . '/' . $quote; diff --git a/python/ccxt/__init__.py b/python/ccxt/__init__.py index afc3f1b6bf7b..41d4dcc93c7e 100644 --- a/python/ccxt/__init__.py +++ b/python/ccxt/__init__.py @@ -28,7 +28,7 @@ # ---------------------------------------------------------------------------- -__version__ = '1.10.291' +__version__ = '1.10.292' # ---------------------------------------------------------------------------- diff --git a/python/ccxt/async/__init__.py b/python/ccxt/async/__init__.py index 799ed061a537..a19a6ffb0259 100644 --- a/python/ccxt/async/__init__.py +++ b/python/ccxt/async/__init__.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.10.291' +__version__ = '1.10.292' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async/base/exchange.py b/python/ccxt/async/base/exchange.py index 4d1b7acb171b..01565100a614 100644 --- a/python/ccxt/async/base/exchange.py +++ b/python/ccxt/async/base/exchange.py @@ -2,7 +2,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.10.291' +__version__ = '1.10.292' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async/bithumb.py b/python/ccxt/async/bithumb.py index 386316a8bce1..bbf36965ffe3 100644 --- a/python/ccxt/async/bithumb.py +++ b/python/ccxt/async/bithumb.py @@ -71,7 +71,7 @@ async def fetch_markets(self): for i in range(0, len(currencies)): id = currencies[i] if id != 'date': - market = markets[id] + market = markets['data'][id] base = id quote = 'KRW' symbol = id + '/' + quote diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py index 05afa1c4c05b..b075e60e4fbb 100644 --- a/python/ccxt/base/exchange.py +++ b/python/ccxt/base/exchange.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.10.291' +__version__ = '1.10.292' # -----------------------------------------------------------------------------